Saltar para o conteúdo principal
Versão: v20 R4 BETA

Botão rádio

Radio buttons are objects that allow the user to select one of a group of buttons.

Um botão radio aparece na forma de um texto seguido de um círculo. However, radio buttons can have various appearances.

É selecionado um botão rádio:

  • quando o usuário clica nele
  • when it has the focus and the user presses the Space bar key.

Configuração de botões radio

Radio buttons are used in coordinated sets: only one button at a time can be selected in the set. In order to operate in a coordinated manner, a set of radio buttons must share the same Radio Group property.

Os botões rádio são controlados com métodos. Como todos os botões, um botão de rádio é definido como 0 quando o formulário é aberto pela primeira vez. Um método associado a um botão de rádio é executado quando o botão é selecionado. The following is an example of a group of radio buttons used in a video collection database to enter the speed of the recording (SP, LP, or EP):

Selecting one radio button in a group sets that button to 1 and all of the others in the group to 0. Só pode ser selecionado um botão rádio de cada vez.

You can associate Boolean type expressions with radio buttons. In this case, when a radio button in a group is selected, its variable is True and the variables for the group's other radio buttons are False.

The value contained in a radio button object is not saved automatically (except if it is the representation of a Boolean field); radio button values must be stored in their variables and managed with methods.

Estilos de botões

Radio button styles control radio button's general appearance as well as its available properties. É possível aplicar diferentes estilos predefinidos aos botões rádio. However, the same button style must be applied to all radio buttons in a group so that they work as expected.

4D fornece botões rádio nos seguintes estilos predefinidos:

Clássico

The Regular radio button style is a standard system button (i.e., a small bullseye with text) which executes code when a user clicks on it.

In addition to initiating code execution, the Regular radio button style changes bullsey color when being hovered.

Plano

The Flat radio button style is a standard system button (i.e., a small bullseye with text) which executes code when a user clicks on it.

Por padrão, o estilo Plano tem um aspeto minimalista. The Flat button style's graphic nature is particularly useful for forms that will be printed.

Barra de ferramentas

O estilo de botão rádio está pensado principalmente para sua integração em uma barra de ferramentas.

By default, the Toolbar style has a transparent background with a label in the center. A aparência do botão pode ser diferente quando o cursor passar por cima dele, dependendo do SO:

  • Windows - o botão é realçado.

  • macOS - o destaque do botão nunca aparece.

Bevel

The Bevel radio button style is similar to the Toolbar style's behavior, except that it has a light gray background and a gray outline. A aparência do botão pode ser diferente quando o cursor passar por cima dele, dependendo do SO:

  • Windows - o botão é realçado.

  • macOS - o destaque do botão nunca aparece.

Bevel arredondado

O estilo de botão Bevel arredondado é quase idêntico ao estilo Bevel, exceto que, dependendo do sistema operativo, as esquinas do botão podem ser arredondadas.

  • Windows - the button is identical to the Bevel style.

  • macOS - os cantos do botão são arredondados.

OS X Gradient

The OS X Gradient button style is nearly identical to the Bevel style except, depending on the OS, it may have a two-toned appearance.

  • Windows - the button is identical to the Bevel style.

  • macOS - the button is displayed as a two-tone system button.

OS X Texturizado

The OS X Textured radio button style is nearly identical to the Toolbar style except, depending on the OS, it may have a different appearance and does not display hover.

Como padrão, o estilo OS X Textured aparece como:

  • Windows - a toolbar-like button with a label in the center and the background is always displayed.

  • macOS - - um botão sistema padrão que mostra uma mudança de cor cinza claro a cinza escuro. Sua altura está predefinida: não é possível ampliar ou reduzir.

Office XP

O estilo de botão Office XP combina a aparência de estilo Clássico com o comportamento de estilo Barra de ferramentas.

As cores (ressaltado e fundo) de um botão com o estilo Office XP são baseadas nos sistemas de cores. A aparência do botão pode ser diferente quando o cursor passar por cima dele, dependendo do SO:

  • Windows - seu fundo só aparece quando o mouse passa por cima.

  • macOS - seu fundo é sempre mostrado.

Contrair/expandir

Este estilo de botão pode ser utilizado para adicionar um ícone padrão contracter/déployer. Esses botões são usados nativamente em listas hierárquicas. Esses botões são usados nativamente em listas hierárquicas.

info

O estilo Contrair/Expandir tem o nome "disclosure" na gramática JSON do estilo de botão.

Botão disclosure

The disclosure radio button style displays the radio button as a standard disclosure button, usually used to show/hide additional information. O símbolo do botão aponta para baixo com o valor 0 e para cima com o valor 1.

info

O estilo Disclosure tem o nome "roundedDisclosure" na gramática JSON do estilo de botão.

Personalizado

O estilo de botão radio Personalizado aceita uma imagem de fundo personalizada e permite gerir parâmetros adicionais, como o deslocamento do ícone e as margens.

Propriedades compatíveis

Todos os botões rádio partilham o mesmo conjunto de propriedades básicas:

Bold - Bottom - Button Style - Class - Expression Type - Focusable - Font - Font Color - Height - Help Tip - Horizontal Sizing - Italic - Left - Method - Object Name - Radio Group - Right - Save value - Shortcut - Title - Top - Type - Underline - Variable or Expression - Vertical Sizing - Visibility - Width

(1) Not supported by the Regular and Flat styles.
(2) Not supported by the Regular, Flat, Disclosure and Collapse/Expand styles.

Propriedades específicas adicionais estão disponíveis dependendo do estilo botão: