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

  1. Save Format v2.3(19971110)
  2. @begin Form "Form_Choice"
  3.  
  4.  @begin Object "Powersoft Java AWT 1.10::java.applet.Applet"
  5.   DesignName Form_Choice;
  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 72,68,237,180;
  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_Choice_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_Choice()"
  47.     @begin Definition
  48.      FunctionScope 3;
  49. @begin-code SourceCode "Form_Choice()"
  50.  
  51.     public Form_Choice()
  52.     {
  53.         super();
  54.     }
  55.  
  56. @end-code;
  57.     @end;
  58.    @end;
  59.    @begin UserFunction "updateSelectionInfo()"
  60.     @begin Prototype
  61.      FunctionScope 1;
  62. @begin-code SourceCode "Prototype for updateSelectionInfo()"
  63.  
  64.     private:
  65.         void updateSelectionInfo();
  66.  
  67. @end-code;
  68.     @end;
  69.     @begin Definition
  70.      FunctionScope 1;
  71. @begin-code SourceCode "updateSelectionInfo()"
  72.  
  73.     private void updateSelectionInfo()
  74.     {
  75.         int                             selectedIndex;
  76.  
  77.         // update display for index of selected item
  78.         selectedIndex = choice_1.getSelectedIndex( );
  79.         textf_index.setText( Integer.toString( selectedIndex ) );
  80.  
  81.         // update display for text of selected item
  82.         textf_text.setText( choice_1.getSelectedItem( ) );
  83.  
  84.     }
  85.  
  86. @end-code;
  87.     @end;
  88.    @end;
  89.    @begin UserFunction "handleEvent(java.awt.Event event)"
  90.     @begin Prototype
  91.      FunctionScope 1;
  92. @begin-code SourceCode "Prototype for handleEvent(java.awt.Event event)"
  93.  
  94. // Placeholder for Prototype for handleEvent(java.awt.Event event)
  95. //     you should move the prototype here from the Class Contents section
  96.  
  97. @end-code;
  98.     @end;
  99.     @begin Definition
  100. @begin-code SourceCode "handleEvent(java.awt.Event event)"
  101.  
  102.     public boolean handleEvent(java.awt.Event event)
  103.     {
  104.  
  105.         return defaultHandleEvent(event);
  106.     }
  107.  
  108. @end-code;
  109.     @end;
  110.    @end;
  111.    @begin UserFunction "unhandledEvent( String listenerName, String methodName, java.lang.Object event )"
  112.     @begin Prototype
  113.      FunctionScope 1;
  114. @begin-code SourceCode "Prototype for unhandledEvent( String listenerName, String methodName, java.lang.Object event )"
  115.  
  116. // Placeholder for Prototype for unhandledEvent( String listenerName, String methodName, java.lang.Object event )
  117. //     you should move the prototype here from the Class Contents section
  118.  
  119. @end-code;
  120.     @end;
  121.     @begin Definition
  122. @begin-code SourceCode "unhandledEvent( String listenerName, String methodName, java.lang.Object event )"
  123.  
  124.     public void unhandledEvent( String listenerName, String methodName, java.lang.Object event )
  125.     {
  126.  
  127.     }
  128.  
  129. @end-code;
  130.     @end;
  131.    @end;
  132.    @begin UserFunction "processEvent(java.awt.AWTEvent event)"
  133.     @begin Definition
  134.      FunctionScope 3;
  135. @begin-code SourceCode "processEvent(java.awt.AWTEvent event)"
  136.  
  137.     public void processEvent(java.awt.AWTEvent event)
  138.     {
  139.  
  140.         defaultProcessEvent(event);
  141.     }
  142.  
  143. @end-code;
  144.     @end;
  145.    @end;
  146.    @begin UserFunction "getContentPane()"
  147.     @begin Definition
  148.      FunctionScope 3;
  149. @begin-code SourceCode "getContentPane()"
  150.  
  151.     public java.awt.Container getContentPane()
  152.     {
  153.         //  Use the following if you inherit from a JFC container such as com.sun.java.swing.JFrame
  154.         //  return super.getContentPane();
  155.         return this;
  156.     }
  157.  
  158. @end-code;
  159.     @end;
  160.    @end;
  161.   @end;
  162.   @begin CodeBlocks
  163.    @begin CodeBlock "HppPrefix"
  164.     FunctionScope 1;
  165. @begin-code SourceCode "Imports()"
  166.  
  167. // add your custom import statements here
  168.  
  169. @end-code;
  170.    @end;
  171.    @begin CodeBlock "ClassContents"
  172.     FunctionScope 1;
  173. @begin-code SourceCode "Data Members()"
  174.  
  175.     // add your data members here
  176.  
  177. @end-code;
  178.    @end;
  179.    @begin CodeBlock "GeneratedClassContents"
  180.     FunctionScope 1;
  181. @begin-code SourceCode "GeneratedClassContents()"
  182.  
  183.  
  184. @end-code;
  185.    @end;
  186.    @begin CodeBlock "CppPrefix"
  187.     FunctionScope 1;
  188. @begin-code SourceCode "()"
  189.  
  190.  
  191. @end-code;
  192.    @end;
  193.   @end;
  194.   @begin Objects
  195.    @begin Object "Powersoft Java AWT 1.10::java.awt.Choice"
  196.     DesignName choice_1;
  197.     @begin Properties
  198.      @begin DesignProperties
  199.       ResID 0;
  200.       DesignRect 72,10,65,15;
  201.      @end;
  202.      @begin ObjectProperties
  203.       font "Dialog-Plain-12";
  204.       dataTrackRow "0";
  205.       dataLookupSource "null";
  206.       dataLookupColumns "";
  207.       foreground "java.awt.Color.black";
  208.       background "java.awt.Color.lightGray";
  209.       SerializationData "";
  210.      @end;
  211.      @begin ComponentProperties "choice_1"
  212. @begin-code ComboBoxInitialText
  213.  
  214. Item one
  215. Item two
  216. Item three
  217. Item four
  218. Item five
  219.  
  220. @end-code;
  221.      @end;
  222.     @end;
  223.     @begin Events
  224.      @begin Event "java.awt.event.Item.itemStateChanged"
  225. @begin-code SourceCode "java.awt.event.Item.itemStateChanged"
  226.  
  227.     public boolean choice_1_itemStateChanged(java.awt.event.ItemEvent event)
  228.     {
  229.         updateSelectionInfo( );    
  230.  
  231.         return false;
  232.     }
  233.  
  234. @end-code;
  235.      @end;
  236.     @end;
  237.    @end;
  238.    @begin Object "Powersoft Java AWT 1.10::java.awt.TextField"
  239.     DesignName textf_text;
  240.     @begin Properties
  241.      @begin DesignProperties
  242.       Style "800";
  243.       ResID 0;
  244.       TabIndex 1;
  245.       DesignRect 72,36,65,14;
  246.      @end;
  247.      @begin ObjectProperties
  248.       font "Dialog-Plain-12";
  249.       text "Item one";
  250.       editable "0";
  251.       foreground "java.awt.Color.black";
  252.       background "java.awt.Color.lightGray";
  253.       SerializationData "";
  254.      @end;
  255.     @end;
  256.    @end;
  257.    @begin Object "Powersoft Java AWT 1.10::java.awt.TextField"
  258.     DesignName textf_index;
  259.     @begin Properties
  260.      @begin DesignProperties
  261.       Style "800";
  262.       ResID 0;
  263.       TabIndex 2;
  264.       DesignRect 72,55,65,14;
  265.      @end;
  266.      @begin ObjectProperties
  267.       font "Dialog-Plain-12";
  268.       text "0";
  269.       editable "0";
  270.       foreground "java.awt.Color.black";
  271.       background "java.awt.Color.lightGray";
  272.       SerializationData "";
  273.      @end;
  274.     @end;
  275.    @end;
  276.    @begin Object "Powersoft Java AWT 1.10::java.awt.TextField"
  277.     DesignName textf_count;
  278.     @begin Properties
  279.      @begin DesignProperties
  280.       Style "800";
  281.       ResID 0;
  282.       TabIndex 3;
  283.       DesignRect 72,76,65,14;
  284.      @end;
  285.      @begin ObjectProperties
  286.       font "Dialog-Plain-12";
  287.       text "5";
  288.       editable "0";
  289.       foreground "java.awt.Color.black";
  290.       background "java.awt.Color.lightGray";
  291.       SerializationData "";
  292.      @end;
  293.     @end;
  294.    @end;
  295.    @begin Object "Powersoft Java AWT 1.10::java.awt.TextField"
  296.     DesignName textf_addNewItem;
  297.     @begin Properties
  298.      @begin DesignProperties
  299.       ResID 0;
  300.       TabIndex 4;
  301.       DesignRect 72,95,65,14;
  302.      @end;
  303.      @begin ObjectProperties
  304.       font "Dialog-Plain-12";
  305.       text "Default item";
  306.       foreground "java.awt.Color.black";
  307.       background "java.awt.Color.lightGray";
  308.       SerializationData "";
  309.      @end;
  310.     @end;
  311.    @end;
  312.    @begin Object "Powersoft Java AWT 1.10::java.awt.Button"
  313.     DesignName cb_add;
  314.     @begin Properties
  315.      @begin DesignProperties
  316.       ResID 0;
  317.       TabIndex 5;
  318.       DesignRect 147,95,76,14;
  319.      @end;
  320.      @begin ObjectProperties
  321.       font "Dialog-Plain-12";
  322.       foreground "java.awt.Color.black";
  323.       background "java.awt.Color.lightGray";
  324.       SerializationData "";
  325.       label "Add New Item";
  326.      @end;
  327.     @end;
  328.     @begin Events
  329.      @begin Event "java.awt.event.Action.actionPerformed"
  330. @begin-code SourceCode "java.awt.event.Action.actionPerformed"
  331.  
  332.     public boolean cb_add_actionPerformed(java.awt.event.ActionEvent event)
  333.     {
  334.         String              itemText;
  335.         int                 count;
  336.  
  337.         // add text from textf_addNew to choice
  338.         choice_1.addItem( textf_addNewItem.getText( ) );
  339.  
  340.         // display the number of items now in the choice
  341.         count = choice_1.countItems();
  342.         textf_count.setText( Integer.toString( count ) );
  343.  
  344.         return false;
  345.     }
  346.  
  347. @end-code;
  348.      @end;
  349.     @end;
  350.    @end;
  351.    @begin Object "Powersoft Java AWT 1.10::java.awt.TextField"
  352.     DesignName textf_selectByText;
  353.     @begin Properties
  354.      @begin DesignProperties
  355.       ResID 0;
  356.       TabIndex 6;
  357.       DesignRect 72,116,65,14;
  358.      @end;
  359.      @begin ObjectProperties
  360.       font "Dialog-Plain-12";
  361.       foreground "java.awt.Color.black";
  362.       background "java.awt.Color.lightGray";
  363.       SerializationData "";
  364.      @end;
  365.     @end;
  366.    @end;
  367.    @begin Object "Powersoft Java AWT 1.10::java.awt.Button"
  368.     DesignName cb_selectByString;
  369.     @begin Properties
  370.      @begin DesignProperties
  371.       ResID 0;
  372.       TabIndex 7;
  373.       DesignRect 147,116,76,14;
  374.      @end;
  375.      @begin ObjectProperties
  376.       font "Dialog-Plain-12";
  377.       foreground "java.awt.Color.black";
  378.       background "java.awt.Color.lightGray";
  379.       SerializationData "";
  380.       label "Select String";
  381.      @end;
  382.     @end;
  383.     @begin Events
  384.      @begin Event "java.awt.event.Action.actionPerformed"
  385. @begin-code SourceCode "java.awt.event.Action.actionPerformed"
  386.  
  387.     public boolean cb_selectByString_actionPerformed(java.awt.event.ActionEvent event)
  388.     {
  389.         // select the item with string found in textf_selectByText
  390.         choice_1.select( textf_selectByText.getText() );
  391.         updateSelectionInfo( );
  392.  
  393.         return false;
  394.     }
  395.  
  396. @end-code;
  397.      @end;
  398.     @end;
  399.    @end;
  400.    @begin Object "Powersoft Java AWT 1.10::java.awt.TextField"
  401.     DesignName textf_selectByIndex;
  402.     @begin Properties
  403.      @begin DesignProperties
  404.       ResID 0;
  405.       TabIndex 8;
  406.       DesignRect 72,135,65,14;
  407.      @end;
  408.      @begin ObjectProperties
  409.       font "Dialog-Plain-12";
  410.       foreground "java.awt.Color.black";
  411.       background "java.awt.Color.lightGray";
  412.       SerializationData "";
  413.      @end;
  414.     @end;
  415.    @end;
  416.    @begin Object "Powersoft Java AWT 1.10::java.awt.Button"
  417.     DesignName cb_selectByIndex;
  418.     @begin Properties
  419.      @begin DesignProperties
  420.       ResID 0;
  421.       TabIndex 9;
  422.       DesignRect 147,135,76,14;
  423.      @end;
  424.      @begin ObjectProperties
  425.       font "Dialog-Plain-12";
  426.       foreground "java.awt.Color.black";
  427.       background "java.awt.Color.lightGray";
  428.       SerializationData "";
  429.       label "Select By Index";
  430.      @end;
  431.     @end;
  432.     @begin Events
  433.      @begin Event "java.awt.event.Action.actionPerformed"
  434. @begin-code SourceCode "java.awt.event.Action.actionPerformed"
  435.  
  436.     public boolean cb_selectByIndex_actionPerformed(java.awt.event.ActionEvent event)
  437.     {
  438.         int             count = 0;          // items in choice
  439.         int             index = -1;         // index of selected item
  440.         String          indexStr;           // index retrieved from text field
  441.  
  442.         // retrieve index and check for NumberFormatException
  443.         indexStr = textf_selectByIndex.getText();
  444.         try
  445.         {
  446.             index = Integer.parseInt( indexStr );
  447.         }
  448.         catch ( NumberFormatException e )
  449.         {
  450.             index = -1;
  451.         }
  452.  
  453.         // select the given index number if it is within range
  454.         count = choice_1.countItems();
  455.         if( ( index >= 0 ) && ( index < count ) ){
  456.             choice_1.select( index );
  457.         }
  458.  
  459.         updateSelectionInfo( );
  460.  
  461.         return false;
  462.     }
  463.  
  464. @end-code;
  465.      @end;
  466.     @end;
  467.    @end;
  468.    @begin Object "Powersoft Java AWT 1.10::java.awt.Label"
  469.     DesignName label_1;
  470.     @begin Properties
  471.      @begin DesignProperties
  472.       ResID 0;
  473.       TabIndex 10;
  474.       DesignRect 7,76,65,12;
  475.      @end;
  476.      @begin ObjectProperties
  477.       font "Dialog-Plain-12";
  478.       text "Number of Items:";
  479.       foreground "java.awt.Color.black";
  480.       background "java.awt.Color.lightGray";
  481.       SerializationData "";
  482.      @end;
  483.     @end;
  484.    @end;
  485.    @begin Object "Powersoft Java AWT 1.10::java.awt.Label"
  486.     DesignName label_2;
  487.     @begin Properties
  488.      @begin DesignProperties
  489.       ResID 0;
  490.       TabIndex 11;
  491.       DesignRect 42,55,30,12;
  492.      @end;
  493.      @begin ObjectProperties
  494.       font "Dialog-Plain-12";
  495.       text "Index:";
  496.       foreground "java.awt.Color.black";
  497.       background "java.awt.Color.lightGray";
  498.       SerializationData "";
  499.      @end;
  500.     @end;
  501.    @end;
  502.    @begin Object "Powersoft Java AWT 1.10::java.awt.Label"
  503.     DesignName label_3;
  504.     @begin Properties
  505.      @begin DesignProperties
  506.       ResID 0;
  507.       TabIndex 12;
  508.       DesignRect 45,36,26,10;
  509.      @end;
  510.      @begin ObjectProperties
  511.       font "Dialog-Plain-12";
  512.       text "Text:";
  513.       foreground "java.awt.Color.black";
  514.       background "java.awt.Color.lightGray";
  515.       SerializationData "";
  516.      @end;
  517.     @end;
  518.    @end;
  519.   @end;
  520.  @end;
  521. @end;
  522.