home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / optima / samples.z / MainForm.wxf < prev    next >
Encoding:
Text File  |  1996-09-16  |  4.5 KB  |  228 lines

  1. Save Format v1.3
  2. @begin Form "MainForm"
  3.  Exported 0;
  4.  
  5.  @begin Object "WForm"
  6.   WSCaption 1;
  7.   WSHScroll 1;
  8.   WSVScroll 1;
  9.   WSDlgBorder 1;
  10.   WSSysMenu 1;
  11.   WSSystemMenu 1;
  12.   WSMinimizeBox 1;
  13.   WSMaximizeBox 1;
  14.   WSGroup 1;
  15.   WSTabStop 1;
  16.   WSVisible 1;
  17.   Font "8.MS Sans Serif";
  18.   FormPositionType "Centered";
  19.   FormAbsTop "107";
  20.   FormAbsLeft "12";
  21.   Text "Scrollable Form";
  22.   @begin Event "Create"
  23.    GencodeSrcLine 164;
  24.    FunctionName "MainForm::MainForm_Create";
  25.   @end;
  26.   @begin UserFunction "MainForm()"
  27.    Compiler 1;
  28.    GencodeSrcLine 181;
  29.    FunctionName "MainForm::MainForm()";
  30.   @end;
  31.   @begin UserFunction "~MainForm()"
  32.    Compiler 1;
  33.    GencodeSrcLine 185;
  34.    FunctionName "MainForm::~MainForm()";
  35.   @end;
  36.   ResID 102;
  37.   DesignName MainForm;
  38.   TabIndex 0;
  39.   DesignRect 12,107,190,195;
  40.  @end;
  41.  
  42.  @begin Object "WLabel"
  43.   WSSNotify 1;
  44.   WSChild 1;
  45.   WSExClientEdge 1;
  46.   WSVisible 1;
  47.   Text "This example demonstrates scrollable forms.  You can scroll the form horizontally and vertically to see additional controls.  To make a form scrollable, you should design it full size, then put code in the 'Create' event that makes it smaller and call"+
  48. "s SetAutomaticScrolling( TRUE ) in the Create event.  See MainForm_Create.";
  49.   ResID 101;
  50.   DesignName description;
  51.   TabIndex 0;
  52.   DesignRect 5,5,120,115;
  53.  @end;
  54.  
  55.  @begin Object "WCommandButton"
  56.   WSChild 1;
  57.   WSMaximizeBox 1;
  58.   WSTabStop 1;
  59.   WSVisible 1;
  60.   Default "1";
  61.   Pressed "0";
  62.   FDXFieldName "cb_1_data";
  63.   FDXFieldType "WBool";
  64.   Text "OK";
  65.   @begin Event "Click"
  66.    GencodeSrcLine 189;
  67.    FunctionName "MainForm::ok_Click";
  68.   @end;
  69.   ResID 102;
  70.   DesignName ok;
  71.   TabIndex 1;
  72.   DesignRect 130,5,40,14;
  73.  @end;
  74.  
  75.  @begin Object "WCommandButton"
  76.   WSChild 1;
  77.   WSMaximizeBox 1;
  78.   WSTabStop 1;
  79.   WSVisible 1;
  80.   Pressed "0";
  81.   FDXFieldName "cb_1_data";
  82.   FDXFieldType "WBool";
  83.   Text "Cancel";
  84.   Cancel "1";
  85.   @begin Event "Click"
  86.    GencodeSrcLine 196;
  87.    FunctionName "MainForm::cancel_Click";
  88.   @end;
  89.   ResID 103;
  90.   DesignName cancel;
  91.   TabIndex 2;
  92.   DesignRect 130,25,40,14;
  93.  @end;
  94.  
  95.  @begin Object "WLabel"
  96.   WSSLeftNoWordWrap 1;
  97.   WSSNotify 1;
  98.   WCCSNoResize 1;
  99.   WCCSNoParentAlign 1;
  100.   WSChild 1;
  101.   WSVisible 1;
  102.   Text "Just a dummy field:";
  103.   AutoSize "1";
  104.   ResID 104;
  105.   DesignName label_1;
  106.   TabIndex 3;
  107.   DesignRect 5,130,57,8;
  108.  @end;
  109.  
  110.  @begin Object "WTextBox"
  111.   WTextBoxAutoHScroll 1;
  112.   WSBorder 1;
  113.   WSChild 1;
  114.   WSExClientEdge 1;
  115.   WSVisible 1;
  116.   ResID 105;
  117.   DesignName textb_1;
  118.   TabIndex 4;
  119.   DesignRect 5,145,120,12;
  120.  @end;
  121.  
  122.  @begin HPPPrefixBlock
  123. @begin-code HPPPrefix
  124.  
  125. // Declarations added here will be included at the top of the .HPP file
  126.  
  127. @end-code;
  128.   GencodeSrcLine 10;
  129.  @end;
  130.  
  131.  @begin CPPPrefixBlock
  132. @begin-code CPPPrefix
  133.  
  134. // Code added here will be included at the top of the .CPP file
  135.  
  136. //  Include definitions for resources.
  137. #include "WRes.h"
  138.  
  139. @end-code;
  140.   GencodeSrcLine 10;
  141.  @end;
  142.  
  143.  @begin ClassContentsBlock
  144. @begin-code ClassContents
  145.  
  146.     public:
  147.         // add your public instance data here
  148.     private:
  149.         // add your private instance data here
  150.     protected:
  151.         // add your protected instance data here
  152.  
  153. @end-code;
  154.   GencodeSrcLine 51;
  155.  @end;
  156.  
  157. @begin-code GeneratedClassContents
  158.  
  159.         MainForm();
  160.         ~MainForm();
  161.  
  162. @end-code;
  163.  
  164. @begin-code Code "MainForm::MainForm()"
  165.  
  166. @@CLASSNAME@::@CLASSNAME@()
  167. {
  168.     
  169. }
  170.  
  171. @end-code;
  172.  
  173. @begin-code Code "MainForm::~MainForm()"
  174.  
  175. @@CLASSNAME@::~@CLASSNAME@()
  176. {
  177.     
  178. }
  179.  
  180. @end-code;
  181.  
  182. @begin-code Code "MainForm::MainForm_Create"
  183.  
  184. WBool @CLASSNAME@::MainForm_Create(
  185.     WObject *                 source,
  186.     WCreateEventData *        event )
  187. {
  188.     // enable automatic scrolling
  189.     
  190.     SetAutomaticScrolling( TRUE );
  191.     
  192.     // resize the form so that the description field fits nicely in the visible client rectangle
  193.     WRect r = GetRectangle();
  194.     WRect c = GetClientRectangle();
  195.     WRect d = description->GetRectangle();
  196.     r.h -= c.h - ( d.y + d.h ) - WApplication::GetFrameHeight();
  197.     r.w -= c.w - ( d.x + d.w ) - WApplication::GetFrameWidth();
  198.     Move( r );
  199.     return FALSE;
  200. }
  201.  
  202. @end-code;
  203.  
  204. @begin-code Code "MainForm::ok_Click"
  205.  
  206. WBool @CLASSNAME@::ok_Click(
  207.     WObject *           source,
  208.     WEventData *        event )
  209. {
  210.     Close();
  211.     return FALSE;
  212. }
  213.  
  214. @end-code;
  215.  
  216. @begin-code Code "MainForm::cancel_Click"
  217.  
  218. WBool @CLASSNAME@::cancel_Click(
  219.     WObject *           source,
  220.     WEventData *        event )
  221. {
  222.     Close();
  223.     return FALSE;
  224. }
  225.  
  226. @end-code;
  227. @end;
  228.