home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1998 September / dppcpro0998.iso / Rwc / Sybase / Install.exe / samples.z / Form_Button.wxf < prev    next >
Encoding:
Text File  |  1998-03-25  |  10.3 KB  |  419 lines

  1. Save Format v2.3(19971110)
  2. @begin Form "Form_Button"
  3.  
  4.  @begin Object "Powersoft Java AWT 1.10::java.applet.Applet"
  5.   DesignName Form_Button;
  6.   @begin ClassProperties
  7. @begin-code BaseClassList
  8.  
  9. extends java.applet.Applet
  10.  
  11. @end-code;
  12.   @end;
  13.   @begin Properties
  14.    @begin DesignProperties
  15.     Style "cf0000";
  16.     ResID 0;
  17.     DesignRect 59,125,165,114;
  18.    @end;
  19.    @begin ObjectProperties
  20.     font "Dialog-Plain-12";
  21.     LayoutManager "powersoft.powerj.ui.ResizePercentageLayout";
  22.     foreground "java.awt.Color.black";
  23.     background "java.awt.Color.lightGray";
  24.     SerializationData "";
  25.    @end;
  26.   @end;
  27.   @begin UserFunctions
  28.    @begin UserFunction "java.awt.WindowDestroy()"
  29.     @begin Definition
  30.      FunctionScope 1;
  31. @begin-code SourceCode "java.awt.WindowDestroy()"
  32.  
  33. // This function refers to an event which doesn't exist for this object type.
  34. // it has been converted to a user function.
  35.     public boolean Form_Button_WindowDestroy(java.awt.Event event)
  36.     {
  37.  
  38.         hide();
  39.         destroy();
  40.         return false;
  41.     }
  42.  
  43. @end-code;
  44.     @end;
  45.    @end;
  46.    @begin UserFunction "Form_Button()"
  47.     @begin Definition
  48.      FunctionScope 3;
  49. @begin-code SourceCode "Form_Button()"
  50.  
  51.     public Form_Button()
  52.     {
  53.         super();
  54.     }
  55.  
  56. @end-code;
  57.     @end;
  58.    @end;
  59.    @begin UserFunction "updateCounterDisplay()"
  60.     @begin Prototype
  61.      FunctionScope 1;
  62. @begin-code SourceCode "Prototype for updateCounterDisplay()"
  63.  
  64.     private:
  65.         void updateCounterDisplay();
  66.  
  67. @end-code;
  68.     @end;
  69.     @begin Definition
  70.      FunctionScope 1;
  71. @begin-code SourceCode "updateCounterDisplay()"
  72.  
  73.     private void updateCounterDisplay( )
  74.     {
  75.         String          countStr;
  76.  
  77.         countStr = Integer.toString( _count );
  78.         textf_count.setText( countStr );
  79.     }
  80.  
  81. @end-code;
  82.     @end;
  83.    @end;
  84.    @begin UserFunction "handleEvent(java.awt.Event event)"
  85.     @begin Prototype
  86.      FunctionScope 1;
  87. @begin-code SourceCode "Prototype for handleEvent(java.awt.Event event)"
  88.  
  89. // Placeholder for Prototype for handleEvent(java.awt.Event event)
  90. //     you should move the prototype here from the Class Contents section
  91.  
  92. @end-code;
  93.     @end;
  94.     @begin Definition
  95. @begin-code SourceCode "handleEvent(java.awt.Event event)"
  96.  
  97.     public boolean handleEvent(java.awt.Event event)
  98.     {
  99.  
  100.         return defaultHandleEvent(event);
  101.     }
  102.  
  103. @end-code;
  104.     @end;
  105.    @end;
  106.    @begin UserFunction "unhandledEvent( String listenerName, String methodName, java.lang.Object event )"
  107.     @begin Prototype
  108.      FunctionScope 1;
  109. @begin-code SourceCode "Prototype for unhandledEvent( String listenerName, String methodName, java.lang.Object event )"
  110.  
  111. // Placeholder for Prototype for unhandledEvent( String listenerName, String methodName, java.lang.Object event )
  112. //     you should move the prototype here from the Class Contents section
  113.  
  114. @end-code;
  115.     @end;
  116.     @begin Definition
  117. @begin-code SourceCode "unhandledEvent( String listenerName, String methodName, java.lang.Object event )"
  118.  
  119.     public void unhandledEvent( String listenerName, String methodName, java.lang.Object event )
  120.     {
  121.  
  122.     }
  123.  
  124. @end-code;
  125.     @end;
  126.    @end;
  127.    @begin UserFunction "processEvent(java.awt.AWTEvent event)"
  128.     @begin Definition
  129.      FunctionScope 3;
  130. @begin-code SourceCode "processEvent(java.awt.AWTEvent event)"
  131.  
  132.     public void processEvent(java.awt.AWTEvent event)
  133.     {
  134.  
  135.         defaultProcessEvent(event);
  136.     }
  137.  
  138. @end-code;
  139.     @end;
  140.    @end;
  141.    @begin UserFunction "getContentPane()"
  142.     @begin Definition
  143.      FunctionScope 3;
  144. @begin-code SourceCode "getContentPane()"
  145.  
  146.     public java.awt.Container getContentPane()
  147.     {
  148.         //  Use the following if you inherit from a JFC container such as com.sun.java.swing.JFrame
  149.         //  return super.getContentPane();
  150.         return this;
  151.     }
  152.  
  153. @end-code;
  154.     @end;
  155.    @end;
  156.   @end;
  157.   @begin CodeBlocks
  158.    @begin CodeBlock "HppPrefix"
  159.     FunctionScope 1;
  160. @begin-code SourceCode "Imports()"
  161.  
  162. // add your custom import statements here
  163.  
  164. @end-code;
  165.    @end;
  166.    @begin CodeBlock "ClassContents"
  167.     FunctionScope 1;
  168. @begin-code SourceCode "Data Members()"
  169.  
  170.     // add your data members here
  171.     private int         _count = 0;  // records the number clicks of button
  172.  
  173. @end-code;
  174.    @end;
  175.    @begin CodeBlock "GeneratedClassContents"
  176.     FunctionScope 1;
  177. @begin-code SourceCode "GeneratedClassContents()"
  178.  
  179.  
  180. @end-code;
  181.    @end;
  182.    @begin CodeBlock "CppPrefix"
  183.     FunctionScope 1;
  184. @begin-code SourceCode "()"
  185.  
  186.  
  187. @end-code;
  188.    @end;
  189.   @end;
  190.   @begin Objects
  191.    @begin Object "Powersoft Java AWT 1.10::java.awt.Button"
  192.     DesignName cb_test;
  193.     @begin Properties
  194.      @begin DesignProperties
  195.       ResID 0;
  196.       DesignRect 77,35,75,15;
  197.      @end;
  198.      @begin ObjectProperties
  199.       font "Dialog-Plain-12";
  200.       foreground "java.awt.Color.black";
  201.       background "java.awt.Color.lightGray";
  202.       SerializationData "";
  203.       label "Test Button";
  204.      @end;
  205.     @end;
  206.     @begin Events
  207.      @begin Event "java.awt.event.Action.actionPerformed"
  208. @begin-code SourceCode "java.awt.event.Action.actionPerformed"
  209.  
  210.     public boolean cb_test_actionPerformed(java.awt.event.ActionEvent event)
  211.     {
  212.         // increment counter
  213.         _count += 1;
  214.         updateCounterDisplay( );
  215.  
  216.         return false;
  217.     }
  218.  
  219. @end-code;
  220.      @end;
  221.     @end;
  222.    @end;
  223.    @begin Object "Powersoft Java AWT 1.10::java.awt.Checkbox"
  224.     DesignName checkbox_enabled;
  225.     @begin Properties
  226.      @begin DesignProperties
  227.       ResID 0;
  228.       TabIndex 1;
  229.       DesignRect 17,20,50,16;
  230.      @end;
  231.      @begin ObjectProperties
  232.       font "Dialog-Plain-12";
  233.       label "Enabled";
  234.       state "1";
  235.       foreground "java.awt.Color.black";
  236.       background "java.awt.Color.lightGray";
  237.       SerializationData "";
  238.      @end;
  239.     @end;
  240.     @begin Events
  241.      @begin Event "java.awt.event.Item.itemStateChanged"
  242. @begin-code SourceCode "java.awt.event.Item.itemStateChanged"
  243.  
  244.     public boolean checkbox_enabled_itemStateChanged(java.awt.event.ItemEvent event)
  245.     {
  246.         if( checkbox_enabled.getState( ) ){
  247.             cb_test.enable( true );
  248.         } else {
  249.             cb_test.enable( false );
  250.         }
  251.  
  252.         return false;
  253.     }
  254.  
  255. @end-code;
  256.      @end;
  257.     @end;
  258.    @end;
  259.    @begin Object "Powersoft Java AWT 1.10::java.awt.Checkbox"
  260.     DesignName checkbox_visible;
  261.     @begin Properties
  262.      @begin DesignProperties
  263.       ResID 0;
  264.       TabIndex 2;
  265.       DesignRect 17,35,50,15;
  266.      @end;
  267.      @begin ObjectProperties
  268.       font "Dialog-Plain-12";
  269.       label "Visible";
  270.       state "1";
  271.       foreground "java.awt.Color.black";
  272.       background "java.awt.Color.lightGray";
  273.       SerializationData "";
  274.      @end;
  275.     @end;
  276.     @begin Events
  277.      @begin Event "java.awt.event.Item.itemStateChanged"
  278. @begin-code SourceCode "java.awt.event.Item.itemStateChanged"
  279.  
  280.     public boolean checkbox_visible_itemStateChanged(java.awt.event.ItemEvent event)
  281.     {
  282.         if( checkbox_visible.getState( ) ){
  283.             cb_test.show( true );
  284.         } else {
  285.             cb_test.show( false );
  286.         }
  287.  
  288.         return false;
  289.     }
  290.  
  291. @end-code;
  292.      @end;
  293.     @end;
  294.    @end;
  295.    @begin Object "Powersoft Java AWT 1.10::java.awt.TextField"
  296.     DesignName textf_count;
  297.     @begin Properties
  298.      @begin DesignProperties
  299.       Style "800";
  300.       ResID 0;
  301.       TabIndex 3;
  302.       DesignRect 57,70,34,15;
  303.      @end;
  304.      @begin ObjectProperties
  305.       font "Dialog-Plain-12";
  306.       text "0";
  307.       foreground "java.awt.Color.black";
  308.       background "java.awt.Color.lightGray";
  309.       SerializationData "";
  310.      @end;
  311.     @end;
  312.    @end;
  313.    @begin Object "Powersoft Java AWT 1.10::java.awt.Button"
  314.     DesignName cb_reset;
  315.     @begin Properties
  316.      @begin DesignProperties
  317.       ResID 0;
  318.       TabIndex 4;
  319.       DesignRect 97,70,55,15;
  320.      @end;
  321.      @begin ObjectProperties
  322.       font "Dialog-Plain-12";
  323.       foreground "java.awt.Color.black";
  324.       background "java.awt.Color.lightGray";
  325.       SerializationData "";
  326.       label "Reset Count";
  327.      @end;
  328.     @end;
  329.     @begin Events
  330.      @begin Event "java.awt.event.Action.actionPerformed"
  331. @begin-code SourceCode "java.awt.event.Action.actionPerformed"
  332.  
  333.     public boolean cb_reset_actionPerformed(java.awt.event.ActionEvent event)
  334.     {
  335.         // reset counter to zero
  336.         _count = 0;
  337.         updateCounterDisplay( );
  338.  
  339.         return false;
  340.     }
  341.  
  342. @end-code;
  343.      @end;
  344.     @end;
  345.    @end;
  346.    @begin Object "Powersoft Java AWT 1.10::java.awt.Checkbox"
  347.     DesignName checkbox_label;
  348.     @begin Properties
  349.      @begin DesignProperties
  350.       ResID 0;
  351.       TabIndex 5;
  352.       DesignRect 17,50,50,15;
  353.      @end;
  354.      @begin ObjectProperties
  355.       font "Dialog-Plain-12";
  356.       label "Label";
  357.       state "1";
  358.       foreground "java.awt.Color.black";
  359.       background "java.awt.Color.lightGray";
  360.       SerializationData "";
  361.      @end;
  362.     @end;
  363.     @begin Events
  364.      @begin Event "java.awt.event.Item.itemStateChanged"
  365. @begin-code SourceCode "java.awt.event.Item.itemStateChanged"
  366.  
  367.     public boolean checkbox_label_itemStateChanged(java.awt.event.ItemEvent event)
  368.     {
  369.         if( checkbox_label.getState( ) ){
  370.             cb_test.setLabel( "Test Button" );
  371.         } else {
  372.             cb_test.setLabel( "" );
  373.         }
  374.  
  375.         return false;
  376.     }
  377.  
  378. @end-code;
  379.      @end;
  380.     @end;
  381.    @end;
  382.    @begin Object "Powersoft Java AWT 1.10::java.awt.Label"
  383.     DesignName label_1;
  384.     @begin Properties
  385.      @begin DesignProperties
  386.       ResID 0;
  387.       TabIndex 6;
  388.       DesignRect 7,5,70,15;
  389.      @end;
  390.      @begin ObjectProperties
  391.       font "Dialog-Plain-12";
  392.       text "Button Properties:";
  393.       foreground "java.awt.Color.black";
  394.       background "java.awt.Color.lightGray";
  395.       SerializationData "";
  396.      @end;
  397.     @end;
  398.    @end;
  399.    @begin Object "Powersoft Java AWT 1.10::java.awt.Label"
  400.     DesignName label_count;
  401.     @begin Properties
  402.      @begin DesignProperties
  403.       ResID 0;
  404.       TabIndex 7;
  405.       DesignRect 7,70,50,16;
  406.      @end;
  407.      @begin ObjectProperties
  408.       font "Dialog-Plain-12";
  409.       text "Click Count:";
  410.       foreground "java.awt.Color.black";
  411.       background "java.awt.Color.lightGray";
  412.       SerializationData "";
  413.      @end;
  414.     @end;
  415.    @end;
  416.   @end;
  417.  @end;
  418. @end;
  419.