7.7.7. Button


<< Prev   Next >>

On a form, the command is displayed by the Button form item. A button can be displayed in the command bar and just on a form. If displayed on a form, a button can also look like a hyperlink. To do this, change the View property.

A command that will be accessed by pressing a button is set using the Command property. A button will be shown as disabled if the command associated with this button has the Modifies saved data property set to True and the ReadOnly property is set to True for this button or the form as a whole.

If the button associated with the command is located in the command bar, manage its position using the Position in command bar property (LocationInCommandBar):

  • In additional submenu. The button is placed only in the additional More submenu.
  • In command bar. The button is placed only in the command bar.
  • In command bar and additional submenu. The button is placed both in the command bar and the More menu (if it is available in the command bar).
  • Auto. The position is automatically defined by the system and depends on the command and client application kind.

The command bar has the More menu in the following cases:

  • The command bar contains commands whose placement is set to In additional submenu.
  • Commands whose placement is set to In command bar and additional submenu do not fit in the current command bar.

The user can change button placement in the form settings editor. To open the editor, click More ‑ Change form in 1C:Enterprise mode.

The Command uniqueness property (CommandUniqueness) is intertwined with the Position in command bar property. In short, this property allows you to place two buttons associated with one standard command in the same autocomplete command bar, but these buttons must be placed in different places of the command bar. The key issues: a) he command bar should be autocomplete and b) it works only for the standard commands. Let's see an example.

Let's suppose there is an attribute named Spreadsheet of the SpreadsheetDocument type in the form. This attribute is placed in the form (with the same name) and the command bar (TableCommands), for which the Spreadsheet attribute is selected as the command source, is created in the form. We want to place the Dock the table command in the form command bar and leave it in its default position (More ‑View ‑Dock the table). First, we drag the Dock the table command from the list of standard commands (in the form editor: Commands ‑ Standard commands ‑ Spreadsheet ‑ Dock the table) to the TableCommands command bar. As a result, the command will be in the More menu (it is the standard position for this command) but will disappear from its default position. We are not satisfied with it. Therefore, we point to the SpreadsheetFixTable button in the form editor and set the following properties:

  • The In command bar value for the Position in command bar property. Now the required command has turned out to be visible at once and has disappeared from the More menu.
  • Clear the Command uniqueness property. As a result, the command has reappeared in the same place in the menu where it was located by default.

The form will look as in the figure.

Fig. 308. Command uniqueness for the form button

For the button associated with the Generate by parameter command, you can specify the type of a document that will be created when the button is clicked. To do this, use the Parameter button property.

If the Tooltip property is not set for the form command, then the button associated with this command will not display a tooltip. If the button title cannot be fully displayed on the button, then the full text of the title is displayed in the tooltip as the first (or the only one if no tooltip is set for the button) line.

A button can have several display modes (the Display property). If the Image and text display is selected, then the image located on a button can be located on the left or right relative to the button text. To control this position, use the Picture position button property (available for form and command bar buttons). If this property is set to Auto, then an image will be located on the left side of a text.

Fig. 309. Button image position

If the Image display is selected for a button, the image will always be located in the center of the button.

A managed form button can be displayed in various ways. For this , use the Button shape button property.

Fig. 310. Button shape

This property can have the following values:

  • Auto. In this case, for standard commands, the value specified for the command is used. For other commands, the value is interpreted as Normal.
  • Normal, Oval. The button shape matches the value (fig. 310).

You can set the button shape for buttons located on the form and in the command bar. The property does not affect commands located in submenu.

For a button displayed on a form, you can control the display of the shape of this button. To so this, use the Shape visibility property.

Fig. 311. Button shape display

You can specify several different ways to display the button shape:

  • Auto. In this case, for standard buttons, the display option specified for the command is used. In other cases, it is interpreted as Always.
  • Always . In this case, the button shape is always displayed (the first line in the example in fig. 311).
  • When active. In this case, in the normal state, the button is displayed without a background and a border (the second line in the example in fig. 311). If the mouse cursor points to a button, the input focus or the Mark property is set on it, a standard button with the specified border and background colors is displayed.
  • No. In this case, in the normal state, the button is displayed without a background and a border. When you hover the cursor over the text, an underline appears (the third line in the example in fig. 311) and the mouse cursor changes. The Mark property is not displayed whatsoever in this display option.

The property defines a display for buttons located on a form and in the command bars. The Shape visibility property does not affect commands located in a submenu.

Another way to control the button appearance is to set the View property. Depending on where the button is located, this property can take on the following values:

  • Common button, Command bar button. In this case, the button is displayed as usual.
  • Hyperlink, Command bar hyperlink. In this case, the button is displayed as a hyperlink.

When you drag a button between a form and a command bar, the value of the View property is preserved, adapting to the command location.

<< Prev   Next >>

Icon/Social/001 Icon/Social/006 Icon/Social/005 Icon/Social/004 Icon/Social/002