scales the measurements of Dialog boxes and Dialog Controls.
DlgBase Pixel
DlgBase Unit
DlgBase InSide
DlgBase OutSide
DlgBase Font font$
DlgBase Bold
DlgBase Bold Off
When creating Dialog boxes with the GFA-BASIC structure Dialog...EndDialog, their position, width and height can be specified either in pixels (DlgBase Pixel) or in Dialog Units (DlgBase Unit). Units are 1/4 character wide and 1/8 character high. If a Dialog has been created using the MS-Windows SDK editor, you should always scale using DlgBase Unit to avoid unnecessary calculations.
DlgBase InSide and DlgBase OutSide determine the meaning of the rectangle coordinates specified with the Dialog #n, x, y, w, h command. DlgBase InSide forces the dialog to use the rectangle as the client size. The outside coordinates are calculated using the Windows system settings. This way the client area of the dialog is the same on each Windows system. DlgBase OutSide switches back to the default setting: the coordinates are the dimensions of the bounding rectangle of the dialog box.
DlgBase Font font$ and DlgBase Bold affect the font used in the controls in the dialog box. The format of font$ is according the format in _font$. DlgBase Bold is only used when the Dialog command includes a font description, for instance
Dialog #n, x, y, w, h, "Title", style, font_height, "Fontname".
The font activated this way is a normal (not bold) version. The command DlgBase Bold forces the use of a bold font.
The different parameters can be combined, such as:
DlgBase Inside, Font "Ms Sans Serif,-8, 8"
DlgBase OutSide, Font "Arial,-12,7" // This works if …
// you remove ',-12,"ARIAL"' in the next line
Dialog # 1, 50, 50, 200, 110, "DlgBase Outside", $80 ', -12, "ARIAL"
LText "This should be bold!", 3, 32, 16, 350, 16, $0
PushButton "Close", IDOK, 55, 45, 80, 20
EndDialog
Dlg_1.AutoClose = 1
Dlg Fill 1, SysCol(COLOR_BTNFACE)
ShowDialog # 1
DlgBase InSide
Dialog # 2, 260, 50, 200, 110, "DlgBase inside", $80, -12, "ARIAL"
LText "This is normal", 3, 32, 16, 350, 16, $0
PushButton "Close", IDOK, 55, 45, 80, 20
EndDialog
Dlg_2.AutoClose = 1
Dlg Fill 2, SysCol(COLOR_BTNFACE)
ShowDialog # 2
Repeat
Sleep
Until Me Is Nothing
Sub Dlg_1_Message(hWnd%, Mess%, wParam%, lParam%)
If Mess% = WM_COMMAND And wParam% = IDOK Then CloseDialog # 1 : CloseDialog # 2
EndSub
Sub Dlg_2_Message(hWnd%, Mess%, wParam%, lParam%)
If Mess% = WM_COMMAND And wParam% = IDOK Then CloseDialog # 1 : CloseDialog # 2
EndSub
Bug - DlgBase Bold doesn't work properly. Instead use DlgBase Font with a bold parameter. Defining a font this way excludes the use of font parameters in the Dialog command.
These commands are only implemented for compatibility with GFA-BASIC 16 bit. They are however, useful in dialog boxes in a GLL.
Dialog, Font, Font To, SetFont, GetFont, RFont, Dlg Font, _hFont, _font$, _font$=, FreeFont, DelFont
{Created by Sjouke Hamstra; Last updated: 03/10/2014 by James Gaite}