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

  1. Save Format v1.3
  2. @begin Form "Form_Main"
  3.  Exported 0;
  4.  
  5.  @begin Object "WModelessDialog"
  6.   WSDlgBorder 1;
  7.   WSDlgFrame 1;
  8.   WSSysMenu 1;
  9.   WSSystemMenu 1;
  10.   WSMinimizeBox 1;
  11.   WSGroup 1;
  12.   WSVisible 1;
  13.   Font "8.MS Sans Serif";
  14.   Icon "WIcon( WResourceID( ICON_PROGRAM ) )";
  15.   FormPositionType "Centered";
  16.   FormAbsTop "163";
  17.   FormAbsLeft "68";
  18.   FDXStructName "Form1FDXStruct";
  19.   Text "Database Order Entry";
  20.   @begin Event "Close"
  21.    GencodeSrcLine 220;
  22.    FunctionName "Form_Main::Form_Main_Close";
  23.   @end;
  24.   @begin Event "Create"
  25.    GencodeSrcLine 248;
  26.    FunctionName "Form_Main::Form_Main_Create";
  27.   @end;
  28.   @begin Event "Destroy"
  29.    GencodeSrcLine 271;
  30.    FunctionName "Form_Main::Form_Main_Destroy";
  31.   @end;
  32.   @begin UserFunction "Form_Main()"
  33.    Compiler 1;
  34.    GencodeSrcLine 279;
  35.    FunctionName "Form_Main::Form_Main()";
  36.   @end;
  37.   @begin UserFunction "~Form_Main()"
  38.    Compiler 1;
  39.    GencodeSrcLine 283;
  40.    FunctionName "Form_Main::~Form_Main()";
  41.   @end;
  42.   ResID 101;
  43.   DesignName Form_Main;
  44.   TabIndex 0;
  45.   DesignRect 68,168,212,121;
  46.  @end;
  47.  
  48.  @begin Object "WPictureButton"
  49.   WBSBitmap 1;
  50.   WSChild 1;
  51.   WSMaximizeBox 1;
  52.   WSTabStop 1;
  53.   WSVisible 1;
  54.   Pressed "0";
  55.   ToolTipText "Click here for a list of customers";
  56.   @begin Event "Click"
  57.    GencodeSrcLine 287;
  58.    FunctionName "Form_Main::pictbttn_Customers_Click";
  59.   @end;
  60.   ResID 101;
  61.   DesignName pictbttn_Customers;
  62.   TabIndex 0;
  63.   DesignRect 5,10,55,30;
  64.   @begin ComponentData "pictbttn_Customers"
  65.    Picture "WBitmap( WResourceID( BITMAP_CUSTOMERS ) )";
  66.   @end;
  67.  @end;
  68.  
  69.  @begin Object "WPictureButton"
  70.   WBSBitmap 1;
  71.   WSChild 1;
  72.   WSMaximizeBox 1;
  73.   WSTabStop 1;
  74.   WSVisible 1;
  75.   Pressed "0";
  76.   ToolTipText "Click here for a list of products";
  77.   @begin Event "Click"
  78.    GencodeSrcLine 295;
  79.    FunctionName "Form_Main::pictbttn_Products_Click";
  80.   @end;
  81.   ResID 102;
  82.   DesignName pictbttn_Products;
  83.   TabIndex 1;
  84.   DesignRect 75,10,54,30;
  85.   @begin ComponentData "pictbttn_Products"
  86.    Picture "WBitmap( WResourceID( BITMAP_PRODUCTS ) )";
  87.   @end;
  88.  @end;
  89.  
  90.  @begin Object "WPictureButton"
  91.   WBSBitmap 1;
  92.   WSChild 1;
  93.   WSMaximizeBox 1;
  94.   WSTabStop 1;
  95.   WSVisible 1;
  96.   Pressed "0";
  97.   ToolTipText "Click here for a list of orders";
  98.   @begin Event "Click"
  99.    GencodeSrcLine 303;
  100.    FunctionName "Form_Main::pictbttn_Orders_Click";
  101.   @end;
  102.   ResID 103;
  103.   DesignName pictbttn_Orders;
  104.   TabIndex 2;
  105.   DesignRect 145,10,54,31;
  106.   @begin ComponentData "pictbttn_Orders"
  107.    Picture "WBitmap( WResourceID( BITMAP_ORDERS ) )";
  108.   @end;
  109.  @end;
  110.  
  111.  @begin Object "WFormProxy"
  112.   FormClass "Form_Customers";
  113.   ResID 104;
  114.   DesignName form_Customers;
  115.   TabIndex 3;
  116.   DesignRect 30,85,14,14;
  117.  @end;
  118.  
  119.  @begin Object "WLabel"
  120.   WSSNotify 1;
  121.   WSChild 1;
  122.   WSExClientEdge 1;
  123.   WSVisible 1;
  124.   Text "See the file Readme.txt in the sample source for information on the code in this sample.  (In Optima++, open the Files view and double click on the Readme.txt file).";
  125.   ResID 105;
  126.   DesignName label_Comments;
  127.   TabIndex 4;
  128.   DesignRect 0,50,205,35;
  129.  @end;
  130.  
  131.  @begin Object "WTransaction"
  132.   AccessMode "WTAMReadOnly";
  133.   AutoCommit "0";
  134.   DataSource "Optima++ 1.0 Order Entry Sample";
  135.   DisplayWarningDialog "1";
  136.   Password "sql";
  137.   Userid "dba";
  138.   AutoConnect "0";
  139.   ResID 106;
  140.   DesignName transaction_OrderEntry;
  141.   TabIndex 5;
  142.   DesignRect 5,85,14,14;
  143.  @end;
  144.  
  145.  @begin Object "WGroupBox"
  146.   WCCSTop 1;
  147.   WCCSNoMoveY 1;
  148.   WCCSBottom 1;
  149.   WCCSNoResize 1;
  150.   WSChild 1;
  151.   WSVisible 1;
  152.   Text "Customers";
  153.   ResID 107;
  154.   DesignName groupb_Customers;
  155.   TabIndex 6;
  156.   DesignRect 0,0,65,45;
  157.  @end;
  158.  
  159.  @begin Object "WGroupBox"
  160.   WCCSTop 1;
  161.   WCCSNoMoveY 1;
  162.   WCCSBottom 1;
  163.   WCCSNoResize 1;
  164.   WSChild 1;
  165.   WSVisible 1;
  166.   Text "Products";
  167.   ResID 108;
  168.   DesignName groupb_Products;
  169.   TabIndex 7;
  170.   DesignRect 70,0,65,45;
  171.  @end;
  172.  
  173.  @begin Object "WGroupBox"
  174.   WCCSTop 1;
  175.   WCCSNoMoveY 1;
  176.   WCCSBottom 1;
  177.   WCCSNoResize 1;
  178.   WSChild 1;
  179.   WSVisible 1;
  180.   Text "Orders";
  181.   ResID 109;
  182.   DesignName groupb_Orders;
  183.   TabIndex 8;
  184.   DesignRect 140,0,65,45;
  185.  @end;
  186.  
  187.  @begin Object "WFormProxy"
  188.   FormClass "Form_Products";
  189.   ResID 110;
  190.   DesignName form_Products;
  191.   TabIndex 9;
  192.   DesignRect 55,85,14,14;
  193.  @end;
  194.  
  195.  @begin Object "WFormProxy"
  196.   FormClass "Form_Orders";
  197.   ResID 111;
  198.   DesignName form_Orders;
  199.   TabIndex 10;
  200.   DesignRect 80,85,14,14;
  201.  @end;
  202.  
  203.  @begin HPPPrefixBlock
  204. @begin-code HPPPrefix
  205.  
  206. // Declarations added here will be included at the top of the .HPP file
  207.  
  208. @end-code;
  209.   GencodeSrcLine 14;
  210.  @end;
  211.  
  212.  @begin CPPPrefixBlock
  213. @begin-code CPPPrefix
  214.  
  215. // Code added here will be included at the top of the .CPP file
  216.  
  217. //  Include definitions for resources.
  218. #include "WRes.h"
  219.  
  220. #include "KeyTable.hpp"
  221. #include "SQLAnyUtil.hpp"
  222.  
  223. @end-code;
  224.   GencodeSrcLine 10;
  225.  @end;
  226.  
  227.  @begin ClassContentsBlock
  228. @begin-code ClassContents
  229.  
  230.     public:
  231.         // add your public instance data here
  232.     private:
  233.         // add your private instance data here
  234.     protected:
  235.         // add your protected instance data here
  236.  
  237. @end-code;
  238.   GencodeSrcLine 66;
  239.  @end;
  240.  
  241. @begin-code GeneratedClassContents
  242.  
  243.         Form_Main();
  244.         ~Form_Main();
  245.  
  246. @end-code;
  247.  
  248. @begin-code Code "Form_Main::Form_Main()"
  249.  
  250. @@CLASSNAME@::@CLASSNAME@()
  251. {
  252.     
  253. }
  254.  
  255. @end-code;
  256.  
  257. @begin-code Code "Form_Main::~Form_Main()"
  258.  
  259. @@CLASSNAME@::~@CLASSNAME@()
  260. {
  261.     
  262. }
  263.  
  264. @end-code;
  265.  
  266. @begin-code Code "Form_Main::Form_Main_Close"
  267.  
  268. WBool @CLASSNAME@::Form_Main_Close(
  269.     WObject *           source,
  270.     WEventData *        event )
  271. {
  272.     WBool               cancelClose = false;
  273.     WMessageBoxReturn   result;
  274.     
  275.     result = WMessageBox::Message( 
  276.         this, 
  277.         WMBLevelInfo, 
  278.         WMBButtonYesNoCancel,
  279.         GetText(),
  280.         "Do you want to save (commit) your changes?",
  281.         WMBDefault2 );
  282.         
  283.     switch( result ) {
  284.     case WMBReturnYes:
  285.         transaction_OrderEntry->Commit();
  286.         break;
  287.     case WMBReturnNo:
  288.         transaction_OrderEntry->Rollback();
  289.         break;
  290.     default:
  291.         cancelClose = true;
  292.     }
  293.     
  294.     return cancelClose;
  295. }
  296.  
  297. @end-code;
  298.  
  299. @begin-code Code "Form_Main::Form_Main_Create"
  300.  
  301. WBool @CLASSNAME@::Form_Main_Create(
  302.     WObject *               source,
  303.     WCreateEventData *      event )
  304. {
  305.     WString                 command;
  306.     const WString           DSN( "Optima++ 1.0 Order Entry Sample" );
  307.     WFilePath               path;
  308.     
  309.     // Register the ODBC data source for this sample.
  310.     // (The database is actually the standard SQL Anywhere sample database,
  311.     // but this shows you how to register a data source as part of an application).
  312.  
  313.     if( !SQLAnyUtil::DataSourceExists( DSN ) ){
  314.         path = SQLAnyUtil::GetSampleDBPath();
  315.         SQLAnyUtil::DataSourceAdd( DSN, path );
  316.     }
  317.     
  318.     transaction_OrderEntry->Connect( this );
  319.     
  320.     KeyTable::Create( transaction_OrderEntry );
  321.  
  322.     return FALSE;
  323. }
  324.  
  325. @end-code;
  326.  
  327. @begin-code Code "Form_Main::Form_Main_Destroy"
  328.  
  329. WBool @CLASSNAME@::Form_Main_Destroy(
  330.     WObject *           source,
  331.     WEventData *        event )
  332. {
  333.     transaction_OrderEntry->Disconnect();
  334.  
  335.     return FALSE;
  336. }
  337.  
  338. @end-code;
  339.  
  340. @begin-code Code "Form_Main::pictbttn_Customers_Click"
  341.  
  342. WBool @CLASSNAME@::pictbttn_Customers_Click(
  343.     WObject *           source,
  344.     WEventData *        event )
  345. {
  346.     form_Customers->Open( this );
  347.     
  348.     return FALSE;
  349. }
  350.  
  351. @end-code;
  352.  
  353. @begin-code Code "Form_Main::pictbttn_Products_Click"
  354.  
  355. WBool @CLASSNAME@::pictbttn_Products_Click(
  356.     WObject *           source,
  357.     WEventData *        event )
  358. {
  359.     form_Products->Open( this );
  360.     
  361.     return FALSE;
  362. }
  363.  
  364. @end-code;
  365.  
  366. @begin-code Code "Form_Main::pictbttn_Orders_Click"
  367.  
  368. WBool @CLASSNAME@::pictbttn_Orders_Click(
  369.     WObject *           source,
  370.     WEventData *        event )
  371. {
  372.     form_Orders->Open( this );
  373.     
  374.     return FALSE;
  375. }
  376.  
  377. @end-code;
  378. @end;
  379.