In dialogs and forms there are two measurement systems (coordinate systems), pixels and
dialog base units.
I think you understand pixels without further explanation.
Dialog base units is a "logical" measurement that depends on the font of the dialog (i.e. the font size at the creation/show time). So if you increase the font size the entire dialog and all controls will become larger.
Predicates on
window all works in pixels, so
window::getOuterRect returns a
rct containing pixels
Code: Select all
predicates
getOuterRect : () -> vpiDomains::rct OuterRectangle.
% @short Returns the outer rectangle of the current window.
% @exception gui_exception::noWindow_exception
% @end
On the other hand predicates on
control,
dialog and
form work in "units":
Code: Select all
predicates
getRect : () -> rct UnitCoordinates.
% @short Returns the dialog layout as a rectangle measured in units.
% @end
Notice that a
control (etc) is also a
window so it has both the mentioned predicates.
The "unit" depends on the font of the relevant
topLevelContainerWindow (i.e. dialog/form) and that interface contains predicates for transforming between the coordinate systems:
Code: Select all
predicates
rectPixel2Unit : (vpiDomains::rct Pixels) -> vpiDomains::rct Units.
% @short Converts the rectangle coordinates measured in pixels
% #Pixels to the rectangle coordinates measured in logical units #Units
% used in the current dialog.
% @detail This predicate can only be used when the dialog is already shown.
% @exception gui_exception::noWindow_exception
% @end
predicates
rectUnit2Pixel : (vpiDomains::rct Units) -> vpiDomains::rct Pixels.
% @short Converts the rectangle coordinates measured in logical units #Units
% (used in the current dialog) to the rectangle coordinates measured in pixels #Pixels.
% @detail This predicate can only be used when the dialog is already shown.
% @exception gui_exception::noWindow_exception
% @end
predicates
pntPixel2Unit : (vpiDomains::pnt Pixels) -> vpiDomains::pnt Units.
% @short Converts the point coordinates measured in pixels
% #Pixels to the point coordinates measured in logical units #Units
% used in the current dialog.
% @detail This predicate can only be used when the dialog is already shown.
% @exception gui_exception::noWindow_exception
% @end
predicates
pntUnit2Pixel : (vpiDomains::pnt Units) -> vpiDomains::pnt Pixels.
% @short Converts the point coordinates measured in logical units #Units
% (used in the current dialog) to the point coordinates measured in pixels #Pixels.
% @detail This predicate can only be used when the dialog is already shown.
% @exception gui_exception::noWindow_exception
% @end