Difference between revisions of "Ide/Resource Editor/GUI Control Properties Table"

From wiki.visual-prolog.com
(New page: <noinclude>Category:Ide</noinclude> ===== GUI Control Properties Table ===== When you open a GUI dialog or a form (GUI window) in the '''IDE Designer''', then the '''Control Properti...)
(No difference)

Revision as of 15:03, 24 April 2013


GUI Control Properties Table

When you open a GUI dialog or a form (GUI window) in the IDE Designer, then the Control Properties table also opens.

The set of properties displayed in the Control Properties table depends on the control type and contains two groups of properties:

  • General properties are common to all types of controls.
    These are: Left Anchor, Top Anchor, Right Anchor, Bottom Anchor, Container Name, Enabled, Lock to Container, Name, Representation, TabStop, Title, X, Y, Width, Height and Visible.
  • Specific properties are individual to different types of GUI controls.
    These are: 3State, AlignBaseline, Alignment, AllowPartialRows, Auto, AutoNotify, AutoHScroll, AutoVScroll, Border, Case, Class, ExtendedSel, HideSel, HScroll, Icon Name, IgnorePrefix, LeftText, MultiColumn, MultiLine, MultiSelect, Password, ReadOnly, Rows, Sort, StaticScrollbar, Style, UseTabStops, VScroll, WantReturn, Wrap.

In Control Properties table you can edit the displayed properties of the selected GUI control.

Initially this table is empty. However, as soon as any of GUI controls in the edited GUI dialog (form) is selected, the Control Properties table displays the current set of properties of the selected control.

If the Control Properties table is closed, double-click a control to show the table. The Control Attributes command, from the speed menu of the IDE Designer, can also be used to open the Control Properties table.

Common Properties of Almost All GUI Controls

There are some basic control properties, which are used by almost all GUI controls. These are:

  • Name
    The Name input box is where you can specify some correct Visual Prolog name, which will be used as the control name (identifier).
    The default Name is generated from the control type (for example, pushButton, checkBox, listButton, etc.) and the _ctl suffix. If several controls of the same type are created, then the control type is suffixed with the number, for example, pushButton1_ctl.
    You can edit this default name or simply type in your own version.
  • Representation
    This property can have one of the following two values: Fact Variable, Variable.
    • Fact Variable
      When Fact Variable is specified, then the IDE generates the fact variable, which will store the object of the control. This fact variable is used to reference to this control in the code. This fact variable name is determined by the Name property. For example, ok_ctl. Notice that in this case the fact variable name is automatically converted to be started with the lowercase character.
    • Variable
      When Variable is specified, then the IDE unifies the object of the control with an ordinary variable. This variable will be used to reference to this control in the code. This variable name is determined by the Name property. For example, Cancel_ctl. Notice that in this case the variable name is automatically converted to be started with the uppercase character.
    The default value is Fact Variable.
  • Title
    The Title property is where you specify the title (label), which you want to be displayed as the control caption.
    One character in the Title text may be underlined to indicate an access key. To underline a character precede it with the ampersand & character. At runtime this character in the control Title will be underlined.
    Notice that this character is displayed underlined also in the value cell of the Title property:
    Ide GUI Prop Title.png
    The used ampersand & character is seen only when the value cell of the Title property has the focus:
    Ide GUI Prop Title2.png
    If you need to display the ampersand & character in the Title text, then use two of them &&.
  • Lock to Container
    Possible values are True and False. True defines that the control is locked inside the container selected in the Container Name property.
  • Container Name
    In this list box you can select the Name of one of containers (currently only the group box groupBox type of containers is supported) defined in the dialog or in the form.
    All controls belonging to the same container are in the same group of related controls. The user may use the arrow keys to move from one control in the group to the next one.
    Only the Names of group boxes, inside which the control is placed, appear in the list of Container Name property values. For example, if you see:
    Ide GUI Prop Container.png
    this means that the control is placed inside two group boxes with names GroupBox_ctl and GroupBox1_ctl.
    If you do not need to relate the control to any container, then you should select [none].
  • X, Y, Width, Height
    These properties determine the control coordinates and size:
    • X
      The X coordinate of the upper-left corner of the control (in Dialog Base Units).
    • Y
      The Y coordinate of the upper-left corner of the control (in Dialog Base Units).
    • Width
      The Width of the control (in Dialog Base Units).
    • Height
      The Height of the control (in Dialog Base Units).
  • Left, Top, Right and Bottom Anchors
    These properties determine how the control coordinates (and may be size) will be handled when the dialog or form (containing this control) is resized. The general rules are described in the "Using Anchors for Positioning GUI Controls while Dialog Resizing".
    • Left Anchor
      Possible values are True and False. True defines that the Left boundary of the control is always positioned at the specified distance (equal to the X property) from the Left boundary of the dialog (form) containing this control.
      The distance is specified in the Dialog Base Units.
    • Top Anchor
      Possible values are True and False. True defines that the Top of the control is always positioned at the specified distance (equal to the Y property) from the Top boundary of the dialog (form) containing this control.
      The distance is specified in the Dialog Base Units.
    • Right Anchor
      Possible values are True and False. True defines that the Right boundary of the control is always positioned at the specified distance from the Right boundary of the dialog (form) containing this control.
      The distance is specified in the Dialog Base Units. The distance value can be seen near the arrow, which appears when the control is selected "Using Anchors for Positioning GUI Controls while Dialog Resizing".
    • Bottom Anchor
      Possible values are True and False. True defines that the Bottom of the control is always positioned at the specified distance from the Bottom boundary of the dialog (form) containing this control.
      The distance is specified in the Dialog Base Units. The distance value can be seen near the arrow, which appears when the control is selected "Using Anchors for Positioning GUI Controls while Dialog Resizing".
  • Enabled
    Possible values are True and False. They define whether the control will be created initially enabled (True) or disabled (False). The default value is True (enabled).
    You can use the window::getEnabled/0-> predicate to get whether the control is enabled
IsEnabled = checkButtonName:getEnabled(),
IsEnabled = true,
and the window::setEnabled/1 predicate
IsEnabled = true,
checkButtonName:setEnabled(IsEnabled),
to set this flag programmatically.
  • Visible
    Possible values are True and False. They define whether the control will be created initially visible (True) or invisible (False). The default value is True (visible).
    You can use the window::getVisible/0-> predicate to get whether the control is visible
IsVisible = checkButtonName:getVisible(),
IsVisible = true,
and the window::setVisible/1 predicate
IsVisible = true,
checkButtonName:setVisible(IsVisible),
to set this flag programmatically.
  • TabStop
    Possible values are True and False. They define whether this control belongs to a subset of controls through which the user can move using the TAB key. The default value is True (the control belongs to a group of controls between which the user can navigate with TAB).
    You can use the control::getTabStop/0-> predicate to get whether the control has this flag
IsTabStop = checkButtonName:getTabStop(),
IsTabStop = true,
and the control::setTabStop/1 predicate
IsTabStop = true,
checkButtonName:setTabStop(IsTabStop),
to set this flag programmatically.
If IsTabStop is true, then the focus will be able to jump to this control while the Tab pressing navigation. Pressing the TAB key moves the focus to the next control, which has the TabStop = True.
Specific Properties of Different GUI Control Types

The following properties are specific to different types of controls:

  • Auto
    Possible values are True and False. They define whether this control is an automatic (an automatic check box or an automatic radio button). When you click an automatic control, then it change its state in the proper way.
    You can use the checkButton::getStyle/2 and radioButton::getAuto/0-> predicates to get whether this flag is set to a control:
checkButtonName:getStyle(IsAuto, _Is3State),
IsAuto = true,
and the checkButton::setStyle/2 or radioButton::setAuto/1 predicates
IsAuto = true,
checkButtonName:setStyle(IsAuto, _Is3State),
to set this flag programmatically.
The default value is True (auto).
  • 3State
    Possible values are True and False. They define whether this check box can have 3 states (unchecked, checked, undetermined). You can use the checkButton::getStyle/2 predicate to get whether this state is set to a control
checkButtonName:getStyle(_IsAuto, Is3State),
Is3State = true,
and the checkButton::setStyle/2 predicate
Is3State = true,
checkButtonName:setStyle(_IsAuto, Is3State),
to set this state programmatically.
A 3-states check box is the same as an ordinary check box, except that the box can be grayed (dimmed) as well as checked. The grayed state is used to show that the state of the check box is not determined.
The default value is False (3State).
  • LeftText
    Possible values are True and False. They define whether the control title text should be positioned on the left or on the right of the control (check box or radio button).
    You can use the checkButton::getLeftText/0-> or radioButton::getLeftText/0-> predicates to get whether the control has this flag
IsLeftText = checkButtonName:getLeftText(),
IsLeftText = true,
and the checkButton:setLeftText/1 or radioButton:setLeftText/1 predicates
IsLeftText = true,
checkButtonName:setLeftText(IsLeftText),
to set this flag programmatically.
The default value is False (caption is on the right side).
  • AlignBaseline
    Possible values are True and False. They define whether the control caption text should be positioned on the same horizontal line with caption texts of all other controls, which have the same vertical position with this control.
    This property is defined to all controls, which can have captions (static texts, check boxes, edit and list edit controls, etc.)
    You can use the getAlignBaseline predicates (like editControl::getAlignBaseline/0->) to get whether the control has this flag
IsAllignBaseLine = checkButtonName:getAllignBaseLine(),
IsAllignBaseLine = true,
and the setAlignBaseline (like textControl::setAlignBaseline/1) predicates
IsAllignBaseLine = true,
checkButtonName:setAllignBaseLine(IsAllignBaseLine),
to set this flag programmatically.
The default value is True (align captions horizontally).
  • Style
    Push buttons
    For push buttons possible values are Cancel, OK and Regular.
    Cancel
    Push buttons with the Cancel style are created by the button::newCancel/1 constructor.
    When a dialog/form contains a push button with the Cancel style, then this dialog/form will provide standard handling of the Esc key - the dialog/form is simply closed without any additional actions.
    OK
    Push buttons with the OK style are created by the button::newOk/1 constructor.
    When a dialog/form contains a push button with the Ok style, then this dialog/form will execute dialog/form validation check when this button is clicked. See "Dialog/Form Validation" tutorial (on WEB) for more information.
    Regular
    Push buttons with the Regular style are created by the ordinary button::new/1 constructor.
    Such buttons do not initiate any special default handling.
    Group boxes
    For group boxes possible values are Group Box, Simple Border, Horizontal Separator, No Border. These values define the border type of the group box control.
    The default is Simple Border.
    You can use the groupBox::getBorderStyle/0-> predicate to get the border style
GroupBoxBorderStyle = controlName : getBorderStyle(),
and the groupBox::setBorderStyle/1 predicate
GroupBoxBorderStyle = groupBox(),
controlName : setBorderStyle(GroupBoxBorderStyle),
to set the border style programmatically.
  • Alignment
    Possible values are Left, Center and Right. Radio buttons in this group box determine how the text in the control is aligned.
    The default value is Left (align left).
    • Left
    Defines that the text in the control will be aligned left.
    You can use the textControl::getAlignment/0-> predicate to get which of these flags the control has
AlignmentType = textControlName : getAlignment(),
AlignmentType = alignLeft(),
and the textControl::setAlignment/1 predicate
AlignmentType = alignLeft(),
textControlName : setAlignment(AlignmentType),
to set this flag programmatically.
  • Center
Defines that the text in the control will be centered.
The AlignmentType = alignCenter().
  • Right
Defines that the text in the control will be aligned right.
The AlignmentType = alignRight().
  • Wrap
    Possible values are True and False. They define whether the text in the control will be wrapped to several lines.
    The default value is True (wrap).
    You can use the textControl::getWrap/0-> predicate to get whether the control has this flag
IsNoWrap = textControlName : getWrap(),
IsNoWrap = true,
and the textControl::setWrap/1 predicate
IsNoWrap = false,
textControlName: setWrap(IsNoWrap),
to set this flag programmatically.
  • IgnorePrefix
    Possible values are True and False. Setting True value prevents interpretation of any & characters in the caption of the static text control as access keys (accelerator prefix characters). Accelerator characters are displayed underlined and the prefix & character is deleted.
    The default value is False.
    Notice that static text controls cannot be activated. Therefore, when an access key of a static text control is pressed, then the control next to this static text control, in the tab-stop order of controls in the dialog, is activated.
    Most often this flag is used when filenames, which can contain the & character, need to be displayed in static text controls.
    You can use the textControl::getIgnorePrefix/0-> predicate to get whether the control has this flag
IsIgnorePrefix = controlName : getIgnorePrefix(),
IsIgnorePrefix = true,
and the textControl::setIgnorePrefix/1 predicate
IsIgnorePrefix = true,
controlName : setIgnorePrefix(IsIgnorePrefix),
to set this flag programmatically.
  • MultiLine
    Possible values are True and False. When this property is True, then the edit control allows multiple lines.
    The default value is True (allows multiple lines).
    Notice that the VScroll, HScroll, AutoVScroll, and WantReturn properties do not work for single-line (False) edit controls.
    You can use the editControl::getMultiLine/0-> predicate to get whether the control has this flag
IsMultiLine = controlName : getMultiLine(),
IsMultiLine = true,
and the editControl::setMultiLine/1 predicate
IsMultiLine = true,
controlName : setMultiLine(IsMultiLine),
to set this flag programmatically.
  • WantReturn

Possible values are True and False.

If it is True, then a carriage return will be inserted as the part of an edited string, when the user presses the Enter key while entering text into a multi-line edit control.

If it is False, then pressing the Enter key has the same effect as pressing the default (OK) push button, which has the latest specified Default = True property value.

This property has no effect on single-line edit controls.

The default value is False.

You can use the editControl::getWantReturn/0-> predicate to get whether the control has this flag


IsWantReturn = controlName : getWantReturn (), IsWantReturn = true,

and the editControl::setWantReturn/1 predicate


IsWantReturn = true, controlName : setWantReturn (IsWantReturn),

to set this flag programmatically.

VScroll

Possible values are True and False. They define whether the multi-line control gets a vertical scroll bar when it needs one.

The default value for edit controls is True for other types of controls is False.

This property has no effect on single-line edit controls.

You can use the editControl::getVScroll/0-> and listControl::getVScroll/0-> predicates to get whether the control has this flag


IsVScrollSet = controlName : getVScroll (), IsVScrollSet = true,

and the editControl::setVScroll/1 and listControl::setVScroll/0 predicates


IsVScrollSet = true, controlName : setVScroll (IsVScrollSet),

to set this flag programmatically.

AutoVScroll

Possible values are True and False. They define whether the multi-line edit control automatically scrolls text up when the user presses the Enter on the last line.

The default value is False (does not scroll).

This property has no effect on single-line edit controls.

You can use the editControl::getAutoVScroll/0-> predicate to get whether the control has this flag


IsAutoVScrollSet = controlName : getAutoVScroll (), IsAutoVScrollSet = true,

and the editControl::setAutoVScroll/1 predicate


IsAutoVScrollSet = true, controlName : setAutoVScroll (IsAutoVScrollSet),

to set this flag programmatically.

HScroll

Possible values are True and False. They define whether the multi-line edit or list box control gets a horizontal scroll bar when it needs one.

The default value is False (does not scroll).

This property has no effect on single-line edit controls.

You can use the editControl::getHScroll/0-> or listBox::getHScroll/0-> predicates to get whether the control has this flag


IsHScrollSet = controlName : getHScroll (), IsHScrollSet = true,

and the editControl::setHScroll/1 or listBox::setHScroll/1 predicates


IsHScrollSet = true, controlName : setHScroll (IsHScrollSet),

to set this flag programmatically.

AutoHScroll

Possible values are True and False. They define whether the control automatically scrolls text in the control in order to display a typed character, when the user types the character at the end of the line.

If it is False, then only text that fits within the rectangular boundary is allowed. When the user presses the Enter key, the control scrolls all text back to the zero position.

The default value is True (scrolls text automatically).

You can use the editControl::getAutoHScroll/0-> predicate to get whether the control has this flag


IsAutoHScrollSet = controlName : getAutoHScroll (), IsAutoHScrollSet = true,

and the editControl::setAutoHScroll/1 predicate


IsAutoHScrollSet = true, controlName : setAutoHScroll (IsAutoHScrollSet),

to set this flag programmatically.

Border

Possible values are True and False. They define whether the control is created initially with a border around the control.

The default value is False.

You can use the editControl::getBorder/0-> or listBox::getBorder/0-> predicates to get whether the control has this flag


BorderIsSet = controlName : getBorder (), BorderIsSet = true,

and the editControl::setBorder/1 or listBox::setBorder/1 predicates


BorderIsSet = true, controlName : setBorder (BorderIsSet),

to set this flag programmatically.

Password

Possible values are True and False. If it is True, then the edit control displays all typed-in characters as asterisks (*).

The default value is False (displays typed characters "as-is").

You can use the editControl::getPassword/0-> predicate to get whether the control has this flag


IsPassword = controlName : getPassword (), IsPassword = true,

and the editControl::setPassword/1 predicate


IsPassword = true, controlName : setPassword (IsPassword),

to set this flag programmatically.

HideSel

Possible values are True and False. If it is True, then the edit control hides selection, when it loses the input focus, and shows selection, when it receives the input focus.

The default value is True (hides selection).

You can use the editControl::getHideSel/0-> predicate to get whether the control has this flag


IsHideSel = controlName : getHideSel (), IsHideSel = true,

and the editControl::setHideSel/1 predicate


IsHideSel = true, controlName : setHideSel (IsHideSel),

to set this flag programmatically.

ReadOnly

Possible values are True and False. If it is True, then the edit control is in the read-only mode.

The default value is False (editable).

You can use the editControl::getReadOnly/0-> predicate to get whether the control has this flag


IsReadOnly = controlName : getReadOnly (), IsReadOnly = true,

and the editControl::setReadOnly/1 predicate


IsReadOnly = true, controlName : setReadOnly (IsReadOnly),

to set this flag programmatically.

Case

Possible values are Insensitive, Upper, Lower.

The default value is Insensitive.

Insensitive

Defines that the edit control leaves the typed-in text "as-is".

This is the default value.

Upper

Defines that the edit control converts all typed-in characters into the upper case.

You can use the editControl::getUpperCase/0-> predicate to get whether the control has this flag


IsUpperCase = controlName : getUpperCase (), IsUpperCase = true,

and the editControl::setUpperCase/1 predicate


IsUpperCase = true, controlName : setUpperCase (IsUpperCase),

to set this flag programmatically.

Lower

Defines that the edit control converts all typed-in characters into the lower case.

You can use the editControl::getLowerCase/0-> predicate to get whether the control has this flag


IsLowerCase = controlName : getLowerCase (), IsLowerCase = true,

and the editControl::setLowerCase/1 predicate


IsLowerCase = true, controlName : setLowerCase (IsLowerCase),

to set this flag programmatically.

Sort

Possible values are True and False. If it is True, then the list control sorts strings alphabetically.

The default value is True (sort).

You can use the listControl::getSort/0-> predicate to get whether the control has this flag


IsSort = controlName : getSort (), IsSort = true,

and the listControl::setSort/1 predicate


IsSort = true, controlName : setSort (IsSort),

to set this flag programmatically.

ExtendedSel

Possible values are True and False. If it is True, then the list box control allows selection of multiple items by using the Shift key and the mouse or using the Shift key and the Up or Down Arrow keys.

The default value is False (cannot select multiple items).

You can use the listBox::getExtendedSel/0-> predicate to get whether the control has this flag


IsExtendedSel = controlName : getExtendedSel (), IsExtendedSel = true,

and the listBox::setExtendedSel/1 predicate


IsExtendedSel = true, controlName : setExtendedSel (IsExtendedSel),

to set this flag programmatically.

MultiSelect

Possible values are True and False. If it is True, then the list box control allows selection of multiple items using the mouse.

The default value is False (cannot select multiple items).

You can use the listBox::getMultiSelect/0-> predicate to get whether the control has this flag


IsMultiSelect = controlName : getMultiSelect (), IsMultiSelect = true,

and the listBox::setMultiSelect/1 predicate


IsMultiSelect = true, controlName : setMultiSelect (IsMultiSelect),

to set this flag programmatically.

AutoNotify

Possible values are True and False. If it is True, then the list box control notifies the parent window with an input message whenever the user clicks or double-clicks in the list box.

The default value is True (notify).

You can use the listBox::getAutoNotify/0-> predicate to get whether the control has this flag


IsAutoNotify = controlName : getAutoNotify (), IsAutoNotify = true,

and the listBox::setAutoNotify/1 predicate


IsAutoNotify = true, controlName : setAutoNotify (IsAutoNotify),

to set this flag programmatically.

UseTabStops

Possible values are True and False. If it is True, then the list box control recognizes and expands TAB characters when drawing strings.

The default value is False (does not expand).

You can use the control::getUseTabStops/0-> predicate to get whether the control has this flag


IsUseTabStops = controlName : getUseTabStops (), IsUseTabStops = true,

and the control::setUseTabStops/1 predicate


IsUseTabStops = true, controlName : setUseTabStops (IsUseTabStops),

to set this flag programmatically.

StaticScrollbar

Possible values are True and False. If it is True, then the list control shows a disabled vertical scroll bar for the list box when the box does not contain enough items to scroll. If it is False, then the scroll bar is hidden when the list box does not contain enough items.

The default value is True (shows vertical scroll bar).

You can use the listControl::getStaticScrollbar/0-> predicate to get whether the control has this flag


IsStaticScrollbar = controlName : getStaticScrollbar (), IsStaticScrollbar = true,

and the listControl::setStaticScrollbar/1 predicate


IsStaticScrollbar = true, controlName : setStaticScrollbar (IsStaticScrollbar),

to set this flag programmatically.

AllowPartialRows

Possible values are True and False. If it is True, then the size of the list box is exactly the size specified by the application when it creates the list box. Normally, Windows re-sizes list boxes so that a list box does not display partial items.

The default value is True for list box controls and False for list button and list edit controls.

You can use the listControl::getAllowPartialRows/0-> predicate to get whether the control has this flag


IsAllowPartialRows = controlName : getAllowPartialRows (), IsAllowPartialRows = true,

and the listControl::setAllowPartialRows/1 predicate


IsAllowPartialRows = true, controlName : setAllowPartialRows (IsAllowPartialRows),

to set this flag programmatically.

MultiColumn

Possible values are True and False. If it is True, then the list box control can have multiple columns.

The default value is False.

You can use the listBox::getMultiColumn/0-> predicate to get whether the control has this flag


IsMultiColumn = controlName : getMultiColumn (), IsMultiColumn = true,

and the listBox::setMultiColumn/1 predicate


IsMultiColumn = true, controlName : setMultiColumn (IsMultiColumn),

to set this flag programmatically.

Rows

Possible values are positive numbers. For list button and list edit controls it specifies the maximal number of rows, which can be displayed in the opened list box sub-control.

The default value is 3.

You can use the listControl::getMaxDropDownRows/0-> predicate to get this number


MaxDropDownRowNumber = controlName : getMaxDropDownRows (),

and the listControl::setMaxDropDownRows/1 predicate


MaxDropDownRowNumber = 5, controlName : setMaxDropDownRows (MaxDropDownRowNumber),

to set this number programmatically.

Icon Name

The icon name must be selected from the list of icon names registered in the Project (by clicking the File:ListButton button.png button). In order to an icon name appears in the list of registered icon names, you should add the icon file (IconName.ICO) into the project files. To do this you should use the File | Add command (the Resource Files should be selected in the Files of Type).

Class

Specify a name of a Windows class for the custom control (your application code must register the custom control by this name).