Difference between revisions of "Ide/Resource Editor/Editing a Toolbar"

From wiki.visual-prolog.com
(New page: <noinclude>Category:Ide</noinclude> To edit a toolbar, double-click (or press '''Enter''') the name of a file with a toolbar description in the project tree in the '''Project''' window...)
 
Line 45: Line 45:
 
==== Control Types Used in Toolbars ====
 
==== Control Types Used in Toolbars ====
  
In the lower part of the previous picture we see the '''[Controls_Toolbar_in_the_Toolbar_Editor.htm Controls]''' toolbar, which contains all kinds of controls that can be used in toolbars.
+
In the lower part of the previous picture we see the  
 +
{{ide|Resource Editor#Controls Toolbar|'''Controls toolbar'''}} toolbar, which contains all kinds of controls that can be used in toolbars.
  
 
{|{{prettytable}}
 
{|{{prettytable}}
Line 92: Line 93:
 
Double-click a Push button or a Check button calls the '''Button Attributes''' dialog.
 
Double-click a Push button or a Check button calls the '''Button Attributes''' dialog.
  
[[Image:Ide_Toolbar_ButtonAttributes.png|center|frame|'''Specifying properties of push buttons and check buttons''']]
+
[[Image:Ide_Toolbar_ButtonAttributes.png|center]]
 +
<center>'''Specifying properties of push buttons and check buttons'''</center>
  
 
The following information must be specified:
 
The following information must be specified:
Line 161: Line 163:
 
Double-clicking a List Button control calls the '''List Button Attributes''' dialog.
 
Double-clicking a List Button control calls the '''List Button Attributes''' dialog.
  
[[Image:Ide_Toolbar_ListButtonAttributes.png|center|frame|'''Specifying properties of list buttons in a toolbar''']]
+
[[Image:Ide_Toolbar_ListButtonAttributes.png|center]]
 +
<center>'''Specifying properties of list buttons in a toolbar'''</center>
  
 
Only two parameters can be set for a list button in a toolbar:
 
Only two parameters can be set for a list button in a toolbar:

Revision as of 12:03, 17 May 2013

To edit a toolbar, double-click (or press Enter) the name of a file with a toolbar description in the project tree in the Project window's list of project files. The Toolbar Editor window appears and you can create whatever form of a toolbar you wish.

The Toolbar Editor

In the top of the picture you see edited toolbar (ProjectToolbar in the picture).

Controls Toolbar

In the bottom of the previous picture you see the Controls toolbar. Using the Controls toolbar you can easily add desired controls into the edited toolbar.

There are the Controls toolbar commands inserting the following kinds of controls into toolbars:

Ide Ctrl PushBtn.png Push Button Enables inserting of the push button control into the edited toolbar. Click inside the toolbar to specify the place where the control should be inserted, press on the button Ide Ctrl PushBtn.png, the Button Attributes dialog appears. In this dialog you must specify a bitmap that will be used to display the button. Press the OK button to create the control.
Ide Ctrl CheckBx.png Check Button Enables inserting of the check button control into the edited toolbar. Click inside the toolbar to specify the place where the control should be inserted, press on the button Ide Ctrl CheckBx.png, the Button Attributes dialog appears. In this dialog you must specify a bitmap that will be used to display the button. Press the OK button to create the control.
Ide Ctrl StaText.png Static Text Enables inserting of the static text control into the edited toolbar. Click inside the toolbar to specify the place where the control should be inserted, press on the button Ide Ctrl StaText.png, the Text Attributes dialog appears. In this dialog you can specify the Initial Text that will be displayed in the control. Press the OK button to create the control.
Ide TB ContextText.png Context Sensitive Text Enables inserting of the context sensitive text control into the edited toolbar. Click inside the toolbar to specify the place where the control should be inserted, press on the button Ide TB ContextText.png, the Text Attributes dialog appears. Press the OK button to create the control.
Ide Ctrl ListBtn.png List Button Enables inserting of the list button control into the edited toolbar. Click inside the toolbar to specify the place where the control should be inserted, press on the button Ide Ctrl ListBtn.png, the List Button Attributes dialog appears. Press the OK button to create the control. List buttons can be used to select one item from a list of possible values.
Ide TB Separator.png Separator Enables inserting of a separator into the edited toolbar. Click inside the toolbar to specify the place where the separator should be inserted, press on the button Ide TB Separator.png, the separator will be inserted. The separator is like a space; it is used to make some space and a vertical bar between other controls, usually to divide them into functional groups.
Ide TB NewRow.png New Row Enables inserting of a new row into the edited toolbar. Click inside the toolbar to specify the place where the new row should start, press on the button Ide TB NewRow.png, the new row will be created. Notice that the new rows are relevant only for toolbars with the styles Inside and Movable. A new row control will cause breaking of the current line, the following controls appear on the next line.

Control Types Used in Toolbars

In the lower part of the previous picture we see the Controls toolbar toolbar, which contains all kinds of controls that can be used in toolbars.

Control Description
Push Button This is a standard push button. When pressed it sends an vpiDomains::e_Menu event to the parent window. The bitmap must be registered for the button.
Check Button This is used to indicate the state of a property that can have two states; either checked or unchecked. When pressed it sends an vpiDomains::e_Control(_, vpiDomains::wc_CheckBox,_,_) event to the parent window. You must register a bitmap for a check button.
List Button A list button can be used to select one item from a number of values. When pressed it sends an vpiDomains::e_Control(_, vpiDomains::wc_LBoxButton,_,_) event to the parent window.
Static Text Text may be placed in this control initially and also dynamically. A Static Text is often used for titles.
Context Sensitive Text If a Context Sensitive Text field is put into the toolbar, this field will display help information about the control the mouse is currently located over.
Separator A separator is like a space; it is used to make some space and a vertical bar between other controls, usually to divide them into functional groups.
New Row New row is relevant only for toolbars with the styles Inside and Movable. A New Row control will cause the current line to break, and the following controls to appear on the next line of the toolbar.

Toolbar Layout Editing

The layout of the toolbar can be done both with the keyboard, and with the mouse. There is an insertion point that is marked with a colored bar. This insertion point can be moved with the arrow keys, or by clicking the mouse on the new location. When the insertion bar is at a given location, the control to the right of the bar can be deleted by pressing the Delete key, the control to the left can be deleted by pressing the Backspace key.

To place a new control at the insertion point:

  • select an item from the Controls menu or
  • choose a control from the ones shown in the Controls floating dialog or
  • click the right mouse button anywhere in the Toolbars Editor window area outside the toolbar to display a pop up from which a desired control can be selected.

Attributes of Toolbar Controls

After a control is inserted, it is possible to change the control attributes. Just double-click the control.

Push and Check Button Attributes

Double-click a Push button or a Check button calls the Button Attributes dialog.

Ide Toolbar ButtonAttributes.png
Specifying properties of push buttons and check buttons

The following information must be specified:

Constant A constant name to identify the button control. This is the constant that will be used in the vpiDomains::e_Menu events. Therefore, it is recommended to use the same constant as is used for the menu item correspondent to the same command.

The Constant input box is where you can select or type in the symbolic constant that will be used as the control identifier. It can be input directly from the keyboard or selected from the list of available constants (by clicking the Ide ListButton Button.png button). It must be either a legal symbolic constant (for example, idt_file_open ) or an integer value.

If you enter a symbolic constant, then the IDE automatically places this symbolic constant into the resourceidentifiers.i file and generates an appropriate integer value for it. The Toolbar Editor automatically generates the default symbolic constants (for example, idt_7 from the toolbar constant prefix idt_ and the number of this control in the toolbar.

Status Text The string entered into this field can consist from 2 sub-strings separated by a semicolon. The sub-string specified before the semicolon (if specified) is used as the button Tool Tip text. The sub-string specified after the semicolon (or if the semicolon is not specified) will be displayed in the Context Sensitive Text field (when the mouse cursor is positioned over this button).

For example, the text New;New file will cause New to be shown in the yellow tool tip while New file will be shown in a context sensitive field when the mouse is over the button.

Checked If this check box is checked than the button initial state is "pressed" and the icon shaped as pressed is initially displayed. Otherwise the button initial state is "released" and the icon shaped as released is displayed.
Disabled If this check box is checked then the button initially does not accept a user input and is grayed. Otherwise the button is initially enabled (accepts a user input) and has initial state specified by the Checked check box.
Push Button
or
Check Button
Select the appropriate button style (Push Button or Check Button). The style can be changed at any time. At runtime the state (pressed or released) of a check button can be switched by clicking the check button.
Bitmap Name This bitmap will be used to display a button. This bitmap should be selected from the list of bitmaps registered in the Project window (by clicking the Ide ListButton Button.png button). Before a bitmap name will appear in the registered bitmap list, it should be registered in the project with the File | Add command (the Resource Files should be selected in the Files of Type).

In Visual Prolog v.7 we use a single bitmap for each button and automatically draw different state ornamentations for the released state, the pressed state, and the disabled state of the button.

Edit If the Edit button is pressed, then the Graphics Editor will come up with the given bitmap allowing you to view and edit the bitmap.
Text Control Attributes

Double-clicking a Static Text or a Context Sensitive Text control calls the Text Attributes dialog:

Specifying properties of text controls in a toolbar

The following information must be specified:

Constant A constant name to identify the Text control.
Initial Text The default text to display in the field.
Static
or
Context Sensitive
Select the appropriate text control type. The style can be changed at any time.
Font Select a font name, font style (Normal, Bold, Italic ...), and font size for the displayed text.
Text Width Determines a width in pixels of the Text control field. It can be entered manually or, by pushing the "|<---Text--->|" button. In this case the width of the field will be optimized to display the Initial Text with the selected Font.
Foreground Color Select the Foreground Color for the displayed text.
List Button Attributes

Double-clicking a List Button control calls the List Button Attributes dialog.

Ide Toolbar ListButtonAttributes.png
Specifying properties of list buttons in a toolbar

Only two parameters can be set for a list button in a toolbar:

Constant A constant name to identify the List Button control.
Width Determines the width in pixels of the List Button control field.