GXDGW class¶
-
class
geosoft.gxapi.
GXDGW
¶ Provides access to dialog boxes for user I/O. You can use this class to store to, or retrieve information from the current workspace parameter block via dialog boxes
Note:
Setting Fonts in GX dialogs. By default, "new look" GX dialogs uses the "Tahoma" font. This font can be overridden by updating the application settings. This can be done programmatically using the
geosoft.gxapi.GXSYS.global_set()
function using the following parameters: MONTAJ.GX_FONT="Font_name" This sets the default font to "Font_name". It applies to text in all components of the dialog. Additional customization of individual components can be accomplished using the following parameters: MONTAJ.GX_CAPTION_FONT="Caption_Font": Font for the field captions (labels) MONTAJ.GX_BUTTON_FONT="Button_Font" : Font for buttons, including the "Browse" button MONTAJ.GX_TITLE_FONT="Title_Font" : Font for special titles (seegeosoft.gxapi.GXDGW.set_title()
). The font used for the text in edit windows remains the default, or the value specified using MONTAJ.GX_FONT. Note that the "OK" button, and the Title, use "Bold" versions of the specified font. If the bolded version does not exist as a normal font, then the operating system may provide its own alternative which may not appear the same as you expect. Before version 6.2. there used to be a parameter, MONTAJ.GX_CHARSET, that affected characters above ASCII 127. 6.2. introduced Unicode in the core montaj engine that eliminated the need for such a setting. All strings on the GX API level are encoded in UTF8 during runtime which makes it possible to represent all possible characters without using character sets.-
static
create
((str)arg1) → GXDGW:¶ This method creates a Dialogue window from a specified resource. The Resource is loaded into memory but not displayed.
Parameters: arg1 (str) – Name of the Window Resource to use Returns: Handle to the DGW object. Return type: geosoft.gxapi.GXDGW
New in version 5.0.0.
-
get_info_meta
((int)arg1, (int)arg2, (GXMETA)arg3, (int)arg4, (int)arg5) → None:¶ Copies the Dialogue information to a META attribute.
Parameters: - arg1 (int) – Dialogue Object
- arg2 (int) – DGW_OBJECT constants
- arg3 (
geosoft.gxapi.GXMETA
) – META - arg4 (int) – Object
- arg5 (int) – Attribute
Returns: Nothing
Return type: None
New in version 5.0.0.
-
get_info_sys
((int)arg1, (int)arg2, (str)arg3, (str)arg4) → None:¶ This method uses the information in a Dialogue box to set a SYS variable.
Parameters: - arg1 (int) – Dialogue Object
- arg2 (int) – DGW_OBJECT constants
- arg3 (str) – Group name of the Variable
- arg4 (str) – Variable name
Returns: Nothing
Return type: None
New in version 5.0.0.
-
get_list
((int)arg1) → GXLST:¶ This method retrieves the list (LST) object associated with a Dialogue object.
Parameters: arg1 (int) – Dialogue Object Returns: The List Object Return type: geosoft.gxapi.GXLST
New in version 5.0.0.
-
gt_info
((int)arg1, (int)arg2, (str_ref)arg3) → None:¶ This method fills the specified string with the text from the text object specified.
Parameters: - arg1 (int) – Handle to the TEXT Object
- arg2 (int) – DGW_OBJECT constants
- arg3 (
geosoft.gxapi.str_ref
) – Where to place the String
Returns: Nothing
Return type: None
New in version 5.0.0.
-
is_null
() → bool¶ Check if the instance of
geosoft.gxapi.GXDGW is null (undefined)
Returns: True if this is a null instance of geosoft.gxapi.GXDGW
, False otherwise.Return type: bool`
-
static
null
() → GXDGW¶ A null (undefined) instance of
geosoft.gxapi.GXDGW
Returns: A null geosoft.gxapi.GXDGW
Return type: geosoft.gxapi.GXDGW
-
run_dialogue
() → int:¶ This method runs the Dialogue window.
Returns: The Exit Code of the Dialogue window. Return type: int New in version 5.0.0.
-
set_info
((int)arg1, (int)arg2, (str)arg3) → None:¶ This method sets the string of a text object. If the string is too long it will be truncated.
Parameters: - arg1 (int) – Handle to the TEXT Object
- arg2 (int) – DGW_OBJECT constants
- arg3 (str) – String to set the Text To
Returns: Nothing
Return type: None
New in version 5.0.0.
-
set_info_meta
((int)arg1, (int)arg2, (GXMETA)arg3, (int)arg4, (int)arg5) → None:¶ This sets a text object to the text found in a META attribute.
Parameters: - arg1 (int) – Dialogue Object
- arg2 (int) – DGW_OBJECT constants
- arg3 (
geosoft.gxapi.GXMETA
) – META - arg4 (int) – Object
- arg5 (int) – Attribute
Returns: Nothing
Return type: None
New in version 5.0.0.
-
set_info_sys
((int)arg1, (int)arg2, (str)arg3, (str)arg4) → None:¶ This sets a text object to the text found in a system parameter variable. If the variable has not been set, the text is not set.
Parameters: - arg1 (int) – Dialogue Object
- arg2 (int) – DGW_OBJECT constants
- arg3 (str) – Group name of the Variable
- arg4 (str) – Variable name
Returns: Nothing
Return type: None
New in version 5.0.0.
-
set_title
((str)arg1) → None:¶ Changes the title of the dialog.
Parameters: arg1 (str) – Title to set Returns: Nothing Return type: None New in version 5.0.0.
Note:
A "Special", additional title can be added to a dialog by using the following syntax:
geosoft.gxapi.GXDGW.set_title()
(Diag, "Window TitlenAdditional Title"); In the title argument, a line break character 'n' is used to separate the parts. The window title free_appears as the title in the upper bar of the dialog. The additional title free_appears below this, in the main body of the dialog, and is separated from the rest of the fields by a horizontal line. It is printed in the bold version of the default font (or of the special font specified using the MONTAJ.GX_TITLE_FONT parameter noted above in "Setting Fonts in GX dialogs."
-
static
DGW_OBJECT constants¶
Dialog object defines
INFO TYPE EDIT FEDIT LEDIT CEDIT EBUT
========= ===== ===== ===== ===== =====
LABEL RW RW RW RW RW R - can use GetInfo_DGW
TEXT RW RW RW RW . W - can use \ :func:`geosoft.gxapi.GXDGW.set_info`\
PATH . RW . . .
FILEPATH . RW . . .
LISTVAL . . R . .
LISTALIAS . . RW . .
-
gxapi.
DGW_LABEL
= 0¶
The text label tied to each Dialogue component.
-
gxapi.
DGW_TEXT
= 1¶
The edit field text.
-
gxapi.
DGW_PATH
= 2¶
The file edit path.
-
gxapi.
DGW_FILEPATH
= 3¶
The complete file name, path included.
-
gxapi.
DGW_LISTVAL
= 4¶
The alias value associated with the list entry.
-
gxapi.
DGW_LISTALIAS
= 5¶
The text value associated with the list entry.
-
gxapi.
DGW_EXT
= 7¶
The extension associated with a filename entry.
-
gxapi.
DGW_HIDE
= 8¶
Hide the button or entry and its label, if string is not "0"