home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / optima / samples.z / HotKeyDialog.wxf < prev    next >
Encoding:
Text File  |  1996-05-02  |  4.4 KB  |  230 lines

  1. Save Format v1.3
  2. @begin Form "HotKeyDialog"
  3.  Exported 0;
  4.  
  5.  @begin Object "WDialog"
  6.   WSCaption 1;
  7.   WSDlgBorder 1;
  8.   WSSysMenu 1;
  9.   WSSystemMenu 1;
  10.   WSMinimizeBox 1;
  11.   WSMaximizeBox 1;
  12.   WSGroup 1;
  13.   WSTabStop 1;
  14.   WSVisible 1;
  15.   Icon "WIcon( WResourceID( ICON_01 ) )";
  16.   FormPositionType "Centered";
  17.   FormAbsTop "268";
  18.   FormAbsLeft "25";
  19.   FDXStructName "HotKeyDialogFDXStruct";
  20.   Font "8.MS Sans Serif";
  21.   Text "Hot Key Dialog";
  22.   @begin Event "Create"
  23.    GencodeSrcLine 154;
  24.    FunctionName "HotKeyDialog::HotKeyDialog_Create";
  25.   @end;
  26.   @begin UserFunction "HotKeyDialog()"
  27.    Compiler 1;
  28.    GencodeSrcLine 174;
  29.    FunctionName "HotKeyDialog::HotKeyDialog()";
  30.   @end;
  31.   @begin UserFunction "~HotKeyDialog()"
  32.    Compiler 1;
  33.    GencodeSrcLine 178;
  34.    FunctionName "HotKeyDialog::~HotKeyDialog()";
  35.   @end;
  36.   ResID 102;
  37.   DesignName HotKeyDialog;
  38.   TabIndex 0;
  39.   DesignRect 216,107,163,67;
  40.  @end;
  41.  
  42.  @begin Object "WLabel"
  43.   WSSLeftNoWordWrap 1;
  44.   WSSNotify 1;
  45.   WCCSNoResize 1;
  46.   WCCSNoParentAlign 1;
  47.   WSChild 1;
  48.   WSMinimizeBox 1;
  49.   WSGroup 1;
  50.   WSVisible 1;
  51.   AutoSize "1";
  52.   Text "Hot key:";
  53.   ResID 101;
  54.   DesignName label_1;
  55.   TabIndex 0;
  56.   DesignRect 10,10,27,8;
  57.  @end;
  58.  
  59.  @begin Object "WHotKey"
  60.   WSChild 1;
  61.   WSMaximizeBox 1;
  62.   WSTabStop 1;
  63.   WSExStaticEdge 1;
  64.   WSVisible 1;
  65.   ResID 102;
  66.   DesignName hotkey_1;
  67.   TabIndex 1;
  68.   DesignRect 10,20,70,13;
  69.  @end;
  70.  
  71.  @begin Object "WCommandButton"
  72.   WSChild 1;
  73.   WSMaximizeBox 1;
  74.   WSTabStop 1;
  75.   WSVisible 1;
  76.   Default "1";
  77.   Text "OK";
  78.   @begin Event "Click"
  79.    GencodeSrcLine 182;
  80.    FunctionName "HotKeyDialog::cb_OK_Click";
  81.   @end;
  82.   ResID 103;
  83.   DesignName cb_OK;
  84.   TabIndex 2;
  85.   DesignRect 105,10,45,14;
  86.  @end;
  87.  
  88.  @begin Object "WCommandButton"
  89.   WSChild 1;
  90.   WSMaximizeBox 1;
  91.   WSTabStop 1;
  92.   WSVisible 1;
  93.   Cancel "1";
  94.   Text "Cancel";
  95.   @begin Event "Click"
  96.    GencodeSrcLine 205;
  97.    FunctionName "HotKeyDialog::cb_Cancel_Click";
  98.   @end;
  99.   ResID 104;
  100.   DesignName cb_Cancel;
  101.   TabIndex 3;
  102.   DesignRect 105,30,45,14;
  103.  @end;
  104.  
  105.  @begin HPPPrefixBlock
  106. @begin-code HPPPrefix
  107.  
  108. // Declarations added here will be included at the top of the .HPP file
  109.  
  110. @end-code;
  111.   GencodeSrcLine 10;
  112.  @end;
  113.  
  114.  @begin CPPPrefixBlock
  115. @begin-code CPPPrefix
  116.  
  117. // Code added here will be included at the top of the .CPP file
  118.  
  119. //  Include definitions for resources.
  120. #include "WRes.h"
  121.  
  122. @end-code;
  123.   GencodeSrcLine 10;
  124.  @end;
  125.  
  126.  @begin ClassContentsBlock
  127. @begin-code ClassContents
  128.  
  129.     public:
  130.         // add your public instance data here
  131.     private:
  132.         // add your private instance data here
  133.     protected:
  134.         // add your protected instance data here
  135.  
  136. @end-code;
  137.   GencodeSrcLine 49;
  138.  @end;
  139.  
  140. @begin-code GeneratedClassContents
  141.  
  142.         HotKeyDialog();
  143.         ~HotKeyDialog();
  144.  
  145. @end-code;
  146.  
  147. @begin-code Code "HotKeyDialog::HotKeyDialog()"
  148.  
  149. HotKeyDialog::HotKeyDialog()
  150. {
  151.     
  152. }
  153.  
  154. @end-code;
  155.  
  156. @begin-code Code "HotKeyDialog::~HotKeyDialog()"
  157.  
  158. HotKeyDialog::~HotKeyDialog()
  159. {
  160.     
  161. }
  162.  
  163. @end-code;
  164.  
  165. @begin-code Code "HotKeyDialog::HotKeyDialog_Create"
  166.  
  167. WBool HotKeyDialog::HotKeyDialog_Create(
  168.     WObject *                 source,
  169.     WCreateEventData *        event )
  170. {
  171.     
  172.     void            *           userData;
  173.     WHotKeyInfo                 hotKey;
  174.     
  175.     // get the user data pointer (contains hot key info
  176.     userData = GetUserData();
  177.     
  178.     // assign the hot key stored in the user data
  179.     hotKey = *(WHotKeyInfo *)userData;
  180.     
  181.     // set the hotkey for the hotkey control
  182.     hotkey_1->SetHotKey( hotKey );
  183.     
  184.     
  185.     return FALSE;
  186. }
  187.  
  188. @end-code;
  189.  
  190. @begin-code Code "HotKeyDialog::cb_OK_Click"
  191.  
  192. WBool HotKeyDialog::cb_OK_Click(
  193.     WObject *           source,
  194.     WEventData *        event )
  195. {
  196.     void                *userData;
  197.     WHotKeyInfo         hotKey;
  198.     WHotKeyInfo         *hotKeyPointer;
  199.     
  200.     // get the currently selected HotKey
  201.     hotKey = hotkey_1->GetHotKey();
  202.     
  203.     // get the user data pointer
  204.     userData = GetUserData();
  205.     
  206.     // assign a new value to the user data
  207.     hotKeyPointer = (WHotKeyInfo *)userData;
  208.     *hotKeyPointer = hotKey;
  209.         
  210.     // dismiss this dialog
  211.     Dismiss( 1 );
  212.         
  213.     return FALSE;
  214. }
  215.  
  216. @end-code;
  217.  
  218. @begin-code Code "HotKeyDialog::cb_Cancel_Click"
  219.  
  220. WBool HotKeyDialog::cb_Cancel_Click(
  221.     WObject *           source,
  222.     WEventData *        event )
  223. {
  224.     Dismiss( 0 );
  225.     return TRUE;
  226. }
  227.  
  228. @end-code;
  229. @end;
  230.