Check Box
Uma caixa de seleção é um tipo de botão usado para introduzir ou exibir dados binários (verdadeiro-falso). Basically, it is either checked or unchecked, but a third state can be defined.
Check boxes are controlled by methods or standard actions. O método associado com ela é executado quando selecionar a caixa de seleção. Como todos os botões, uma variável da caixa de seleção é estabelecida em 0 quando o formulário é aberto pela primeira vez.
Uma caixa de seleção mostra o teto do lado de um pequeno quadrado. Este texto é estabelecido na propriedade Title da caixa de seleção. Pode entrar um título no formulário de uma referência XLIFF nessa área (ver Anexo B: XLIFF arquitetura).
Utilizar caixas de seleção
Uma caixa de seleção pode ser associada a uma variável ou expressão de tipo inteiro ou booleano.
- inteiro: se a caixa for selecionada, a variável tem o valor 1. Quando não for marcado, tem o valor 0. Se a caixa de seleção estiver no terceiro estado (ver abaixo), tem o valor 2.
- booleano: se a caixa for marcada, a variável tem o valor
True
. Quando não for marcado, tem o valorFalse
.
Uma parte ou todas as caixas de seleção de um formulário podem estar marcadas ou desmarcadas. As caixas de seleção múltiplas permitem ao usuário selecionar várias opções.
Caixas de seleção de três estados
Check box objects with Regular and Flat button style accept a third state. Este terceiro estado é um estado intermediário, que geralmente se usa para fins de visualização. Por exemplo, permite indicar que uma propriedade é presentada em uma seleção de objetos,
Para ativar este terceiro estado, deve selecionar a propriedade Três estados.
Essa propriedade só está disponível para caixas de seleção regulares e planas associadas a variáveis ou expressões — as caixas de seleção de expressões booleanas não podem usar a propriedade Três Estados (uma expressão Booleana não pode estar em um estado intermediário).
A variável associada à caixa de seleção devolve o valor 2 quando a caixa estiver no terceiro estado.
No modo de entrada, as caixas de seleção dos três estados mostram cada estado de forma sequencial na ordem abaixo: sem marcar/marcado/intermediário/sem marcar, etc. No modo de entrada, as caixas de seleção dos três estados mostram cada estado de forma sequencial na ordem abaixo: sem marcar/marcado/intermediário/sem marcar, etc. O estado intermediário não é geralmente muito útil no modo entrada; no código, simplesmente force o valor da variável para 0 quando tomar o valor de 2 para passar diretamente de um estado marcado para o estado desmarcado.
Usar uma ação padrão
Pode atribuir uma ação padrão a uma caixa de seleção para manejar os atributos das áreas de texto. Por exemplo, se atribuir a ação padrão fontBold
, em execução a caixa de seleção gerenciará o atributo "negrito" do texxto selecionado na área atual.
Só as ações que podem representar um estado verdadeiro/falso (ações "marcáveis") são compatíveis com esse objeto:
Ações compatíveis | Condições de uso (se houver) |
---|---|
avoidPageBreakInsideEnabled | Apenas Zonas 4D Write Pro |
fontItalic | |
fontBold | |
fontLinethrough | |
fontSubscript | Apenas Zonas 4D Write Pro |
fontSuperscript | Apenas Zonas 4D Write Pro |
fontUnderline | |
font/showDialog | Só em Mac |
htmlWYSIWIGEnabled | Apenas Zonas 4D Write Pro |
section/differentFirstPage | Apenas Zonas 4D Write Pro |
section/differentLeftRightPages | Apenas Zonas 4D Write Pro |
spell/autoCorrectionEnabled | |
spell/autoDashSubstitutionsEnabled | Só em Mac |
spell/autoLanguageEnabled | Só em Mac |
spell/autoQuoteSubstitutionsEnabled | Só em Mac |
spell/autoSubstitutionsEnabled | |
spell/enabled | |
spell/grammarEnabled | Só em Mac |
spell/showDialog | Só em Mac |
spell/visibleSubstitutions | |
visibleBackground | Apenas Zonas 4D Write Pro |
visibleFooters | Apenas Zonas 4D Write Pro |
visibleHeaders | Apenas Zonas 4D Write Pro |
visibleHiddenChars | Apenas Zonas 4D Write Pro |
visibleHorizontalRuler | Apenas Zonas 4D Write Pro |
visiblePageFrames | Apenas Zonas 4D Write Pro |
visibleReferences | |
widowAndOrphanControlEnabled | Apenas Zonas 4D Write Pro |
For detailed information on these actions, please refer to the Standard actions section.
Estilos de botão caixas de seleção
Check boxes use button styles to control a check box's general appearance as well as its available properties. É possível aplicar diferentes estilos pré-definidos para caixas de seleção. A great number of variations can be obtained by combining these properties / behaviors.
Com exceção daspropriedades disponíveis, muitos objetos caixa de seleção são estruturalmente idênticos. The difference is in the processing of their associated variables.
4D provides check boxes in the following predefined button styles:
Clássico
The Regular check box button style is a standard system check box (i.e., a rectangle with a descriptive title):
JSON Example:
"myCheckBox": {
"type": "checkbox",
"style":"regular",
"text": "Cancel",
"action": "Cancel",
"left": 60,
"top": 160,
"width": 100,
"height": 20
"dataSourceTypeHint":"boolean"
}
Flat
The Flat check box button style is a minimalist appearance. A natureza gráfica do estilo Flat é especialmente útil para os formulários que vão ser impressos.
JSON Example:
"myCheckBox": {
"type": "checkbox",
"style":"flat",
"text": "Cancel",
"action": "cancel",
"left": 60,
"top": 160,
"width": 100,
"height": 20
}
Toolbar Button
The Toolbar Button check box button style is primarily intended for integration in a toolbar.
The Toolbar Button check box button style has a transparent background with a title. Está geralmente associado com uma imagem de 4 estados.
Exemplo com estados selecionado/ não selecionado/ ressaltado:
JSON Example:
"myCheckBox": {
"type": "checkbox",
"style":"toolbar",
"text": "Checkbox",
"icon": "/RESOURCES/File.png",
"iconFrames": 4
"left": 60,
"top": 160,
"width": 100,
"height": 20
}
Bevel
The Bevel check box button style combines the appearance of the Regular button style (i.e., a rectangle with a descriptive title) with the Toolbar Button button style's behavior.
The Bevel button style has a light gray background with a title. Está geralmente associado com uma imagem de 4 estados.
Exemplo com estados selecionado/ não selecionado/ ressaltado:
JSON Example:
"myCheckBox": {
"type": "checkbox",
"style":"bevel",
"text": "Checkbox",
"icon": "/RESOURCES/File.png",
"iconFrames": 4
"left": 60,
"top": 160,
"width": 100,
"height": 20
}
Rounded Bevel
The Rounded Bevel check box button style is nearly identical to the Bevel button style except, depending on the OS, the corners of the button may be rounded. As with the Bevel button style, the Rounded Bevel button style combines the appearance of the Regular button style with the Toolbar Button button style's behavior.
The Rounded Bevel button style has a light gray background with a title. Está geralmente associado com uma imagem de 4 estados.
Exemplo em macOS:
On Windows, the Rounded Bevel button style is identical to the Bevel button style.
JSON Example:
"myCheckBox": {
"type": "checkbox",
"style":"roundedBevel",
"text": "Checkbox",
"icon": "/RESOURCES/File.png",
"iconFrames": 4
"left": 60,
"top": 160,
"width": 100,
"height": 20
}
OS X Gradient
The OS X Gradient check box button style is nearly identical to the Bevel button style. As with the Bevel button style, the OS X Gradient button style combines the appearance of the Regular button style with the Toolbar Button button style's behavior.
The OS X Gradient button style has a light gray background with a title and may be displayed as a two-tone system button on macOS. Está geralmente associado com uma imagem de 4 estados.
On Windows, this check box button style is identical to the Bevel button style.
JSON Example:
"myCheckBox": {
"type": "checkbox",
"style":"gradientBevel",
"text": "Checkbox",
"icon": "/RESOURCES/File.png",
"iconFrames": 4
"left": 60,
"top": 160,
"width": 100,
"height": 20
}
OS X Textured
The OS X Textured button style is similar to the Bevel button style but with a smaller size (maximum size is the size of a standard macOS system button). As with the Bevel button style, the OS X Textured button style combines the appearance of the Regular button style with the Toolbar Button button style's behavior.
By default, the OS X Textured button style appears as:
- Windows - um botão padrão com um fundo azul claro com um título no centro.
- macOS - a standard system button. Its height is predefined: it is not possible to enlarge or reduce it.
JSON Example:
"myCheckBox": {
"type": "checkbox",
"style":"texturedBevel",
"text": "Checkbox",
"left": 60,
"top": 160,
"width": 100,
"height": 20
}
Office XP
The Office XP button style combines the appearance of the Regular button style with the Toolbar Button button style's behavior.
The colors (highlight and background) of a check box with the Office XP button style are based on the system colors. The appearance of the check box can be different when the cursor hovers over it, depending on the OS:
- Windows - its background only appears when the mouse rolls over it. Exemplo com estados selecionado/ não selecionado/ ressaltado:
- macOS - its background is always displayed. Exemplos com estados desmarcado/ marcado:
JSON Example:
"myCheckBox": {
"type": "checkbox",
"style":"office",
"text": "Checkbox",
"action": "fontBold",
"icon": "/RESOURCES/File.png",
"iconFrames": 4
"left": 60,
"top": 160,
"width": 100,
"height": 20
}
Contrair/expandir
This check box button style can be used to add a standard collapse/expand icon. These icons are used natively in hierarchical lists.
- Windows - the icon looks like a [+] or a [-]
- macOS - parece com um triângulo apontando para cima ou para baixo.
JSON Example:
"myCheckBox": {
"type": "checkbox",
"style":"disclosure",
"method": "m_collapse",
"left": 60,
"top": 160,
"width": 100,
"height": 20
}
Botão disclosure
In macOS and Windows, a check box with the "Disclosure" button style appears as a standard disclosure button, usually used to show/hide additional information. Quando usar um botão radio, o símbolo botão aponta para baixo com o valor 0 e para cima com o valor 1.
Windows
macOS
JSON Example:
"myCheckBox": {
"type": "checkbox",
"style":"roundedDisclosure",
"method": "m_disclose",
"left": 60,
"top": 160,
"width": 100,
"height": 20
}
Personalizado
The Custom button style accepts a personalized background picture and allows managing specific properties:
Geralmente associado com uma imagem de 4 estados, que pode ser usada em conjunção com um quarto estado background picture.
JSON Example:
"myCheckbox": {
"type": "checkbox",
"style":"custom",
"text": "OK",
"icon": "/RESOURCES/smiley.jpg",
"iconFrame": 4,
"customBackgroundPicture": "/RESOURCES/paper.jpg",
"iconOffset": 5, //custom icon offset when clicked
"left": 60,
"top": 160,
"width": 100,
"height": 20,
"customBorderX": 20,
"customBorderY": 5
}
Supported Properties
Todas as caixas de seleção partilhar o mesmo conjunto de propriedades básicas:
Bold - Bottom - Button Style - Class - Enterable - Expression Type - Focusable - Font - Font Color - Font Size - Height - Help Tip - Horizontal Sizing - Italic - Left - Object Name - Right - Save value - Shortcut - Standard action - Title - Top - Type - Underline - Variable or Expression - Vertical Sizing - Visibility - Width
Additional specific properties are available, depending on the button style:
- Background pathname - Horizontal Margin - Icon Offset - Vertical Margin (Custom)
- Três Estados (Flat, Clássico)
- Número de estados - Rota de imagem - Titulo/posição imagem (botão Toolbar, Bevel, Bevel arredondado, OS X Gradient, OS X Textured, Office XP, Custom)