/* InitDialogSettings(theDialog, dsp) Called when the dialog is first displayed to initialize all items. */ static int InitDialogSettings(XOP_DIALOG_REF theDialog, DialogStorage* dsp) { int err; err = 0; InitPopMenus(theDialog); do { SetDDouble(theDialog, SCALING_OFFSET_TEXT, dsp->offsetPtr); SetDDouble(theDialog, SCALING_MULTIPLIER_TEXT, dsp->multiplierPtr); SelEditItem(theDialog, SCALING_OFFSET_TEXT); UpdateDialogItems(theDialog, dsp); } while(0); if (err != 0) KillPopMenus(theDialog); return err; }
/* SelMacEditItem(theDialog, itemNumber) This is a NOP on Windows. On Macintosh, selects the entire text of the edit item specified by itemID and sets the focus to that item. If itemID is 0, it selects the entire text for the current editText item. In Macintosh dialogs, often only edit items can have the focus. Thus, there are times when it is convenient for the program to set the focus to a particular edit item. On Windows, any item can have the focus and it is usually best to leave this in the control of the user. This routine achieves this by selecting a particular edit item on Macintosh while doing nothing on Windows. Thread Safety: SelMacEditItem is not thread-safe. */ void SelMacEditItem(DialogPtr theDialog, int itemNumber) { SelEditItem(theDialog, itemNumber); }