DI_VTEXT

Far Manager

DI_VTEXT

The DI_VTEXT dialog item describes a vertical static text label.
struct FarDialogItem
{
  int Type          = DI_VTEXT
  int X1            = X
  int Y1            = Y1
  int X2            = X (not used in Dialog API 1.0, must be equal to X1)
  int Y2            = Y2
  int Focus         = 0
  int Selected      = 0
  DWORD Flags       = Flags
  int DefaultButton = 0
  char Data[512]    = text label
};

Attention! Attention!

  • This is an exemplary structure; read full description here.

Flags

There are several flags applicable to the DI_VTEXT control:
FlagDescription
DIF_SETCOLOR The low byte of Flags will be used as the item's color.
DIF_BOXCOLOR The text item will be displayed using box colors (COL_DIALOGBOX or COL_WARNDIALOGBOX)
DIF_CENTERGROUP Centers two vertical text labels with equal horizontal position (Y1 is ignored)
DIF_SEPARATOR Draws a single-line vertical separator; Y1 is ignored if Data is empty;
if Data is not empty, it will also be drawn with Y1 as its starting position.
DIF_SEPARATOR2 Draws a double-line vertical separator Y1 is ignored if Data is empty;
if Data is not empty, it will also be drawn with Y1 as its starting position.
DIF_SHOWAMPERSAND Show ampersand symbol in caption instead of using it for defining hotkeys.
DIF_CENTERTEXT Centers the text between the Y1 and Y2 coordinates.

Events

EventDescription
DN_DRAWDLGITEM This event is sent to the dialog callback function just before the text item is drawn.
DN_CTLCOLORDLGITEM Plugin should pass the color attributes of the text item when this event comes. Param2 parameter (foreground+background):
LoWord LoByte - color of the text
                (COL_WARNDIALOGTEXT or
                 COL_DIALOGTEXT).
                If DIF_BOXCOLOR flag is set:
                 COL_WARNDIALOGBOX or
                 COL_DIALOGBOX
LoWord HiByte - color of highlighted text
                (COL_WARNDIALOGHIGHLIGHTTEXT or
                 COL_DIALOGHIGHLIGHTTEXT)
HiWord LoByte - 0 (not used)
HiWord HiByte - 0 (not used)
If a special attribute is used (DIF_SETCOLOR flag), the text (LoWord LoByte) will be drawn according to the parameters.
DN_MOUSECLICK This event comes after the user has clicked one of the dialog items or outside the dialog with the mouse button.

Remarks

  1. It is recommended to set the X2 coordinate correctly, although it isn't used in Dialog API 1.0. Just set it equal to the X1 coordinate.
  2. If the DIF_CENTERTEXT flag is set, the Y2 field must have an adequate value for the correct text centering.
  3. If the DIF_CENTERTEXT flag is not set, FAR will calculate the X2 and Y2 coordinates automatically.
  4. If the text of the DI_TEXT item has a hotkey and DIF_SHOWAMPERSAND flag isn't set, then pressing Alt-Letter causes the keyboard focus to move to the next available dialog item.
See also: