GEOS SDK TechDocs
|
|
2 File Selector Basics
|
2.2 Supporting the File Selector
For a typical configuration, you will have to set up a GenInteraction as a dialog box. (For information dialog boxes, see the Menus and Dialog Boxes chapter.) The File Selector and other elements of the dialog should be placed as children of the Interaction.
A Basic File Selector shows the Goc code required to display and use a File Selector in this basic form. You can use this code to create a similar dialog box with the proper elements or modify it to gain the functionality you want. Specific permutations of this configuration will be described in Some Common Customizations ; however, the remainder of this section describes the basics of the File Selector.
Code Display 14-1 A Basic File Selector
/* Extra code for menus and other UI objects is left out. Only what is * required for these objects is included. */
/* This dialog box provides the organization needed to contain the File
* Selector, the name of the box, and the Reply Bar. */
@object GenInteractionClass MyDialogBox = {
GI_visMoniker = `I', "Insert From Text File";
GI_comp = MyGlyph, MyFileSel, MyInsertTrigger;
GII_visibility = (GIV_DIALOG);
GII_type = (GIT_COMMAND);
};
/* The Glyph Display provides the label in the dialog box. Alternatively, the
* moniker of the GenInteraction could be used for this functionality. */
@object GenGlyphClass MyGlyph = {
GI_visMoniker = "Insert From Text File";
}
/* The File Selector is as basic as possible. */
@object GenFileSelectorClass MyFileSel = {
GFSI_destination = process; /* The object receiving notification. */
GFSI_notificationMsg = MSG_MY_APP_FILE_SELECTED; /* The message sent
* upon selection. */
};
@object GenTriggerClass MyInsertTrigger = {
GI_visMoniker = "Insert";
GTI_destination = process;
GTI_actionMsg = MSG_MY_APP_INSERT_TRIGGER_SELECTED;
HINT_SEEK_REPLY_BAR;
};
/* Note that in most cases, this trigger will not be needed. Generally, the File * Selector will include an "OK" or "Use This File" trigger in its reply bar that * executes an IC_OK function. For your trigger above to demonstrate that * functionality, remove the GTI_... fields and add the line * ATTR_GEN_TRIGGER_INTERACTION_COMMAND = (IC_OK); */
GEOS SDK TechDocs
|
|
2 File Selector Basics
|
2.2 Supporting the File Selector