home *** CD-ROM | disk | FTP | other *** search
/ Chip: 25 Years Anniversary / CHIP_25Jahre_Jubilaeum.iso / downloads / 401065 / WPO11 / Data1.cab / _D4723A772ED34D90B3A6DD55372914D8 < prev    next >
Text File  |  2003-03-07  |  62KB  |  1,438 lines

  1. Working with custom dialog boxes and controls
  2.  
  3. Quattro Pro lets you create custom dialog boxes and controls. When you create a dialog box, you can add controls and then customize their appearance and behavior.
  4.  
  5. In this section, you'll learn about
  6.  
  7.   creating custom dialog boxes
  8.   
  9.   editing and positioning dialog boxes
  10.   
  11.   adding dialog box controls
  12.   
  13.   assigning properties to dialog box controls
  14.   
  15.   attaching actions to dialog box controls
  16.   
  17.   editing and positioning dialog box controls
  18.   
  19.   working with child controls in dialog boxes
  20.   
  21.   creating Help and tips for controls
  22.   
  23.   using macros to display a dialog box
  24.   
  25. For more information about working with custom dialog boxes and controls, see "Reference: Working with custom dialog boxes and controls."
  26.  
  27. Creating custom dialog boxes
  28.  
  29. You can create custom dialog boxes in Quattro Pro. Dialog boxes are stored on the Objects sheet and saved with the notebook in which they are created.
  30.  
  31. You can add controls to dialog boxes. When you add a control to a dialog box, it is inactive. For example, list boxes do not contain information and check boxes are not linked to anything. For information about activating controls and buttons, see "Attaching actions to dialog box controls."
  32.  
  33. Adding labels to dialog box controls lets you identify the purpose of each control. Some controls have a label text property that is used to display a label with the control (for example, buttons).
  34.  
  35. You can hide controls when they are not relevant.
  36.  
  37. Whenever a change is made to the dialog box, you can test the dialog box and its controls. For example, you can test a new control after assigning properties or creating links to see if the control behaves in the manner intended. When in Test mode, the dialog box displays as it will in the application. In Test mode, you cannot activate any other windows to display as the active object unless you have configured a control in the dialog box to do so. For example, you can have a second custom dialog box display only when you click a button on the first dialog box.
  38.  
  39. For more information about controls, see Properties of dialog box controls and Properties of form controls in the reference information section of the Quattro Pro online Help.
  40.  
  41. To create a custom dialog box
  42.  
  43. 1    Click Tools  Macro  Dialog designer.
  44.  
  45. 2    Right-click the dialog box background, and click Dialog properties  Name.
  46.  
  47. 3    Type a name for the title bar in the Enter text box.
  48.  
  49. 4    Click OK.
  50.  
  51. 5    Right-click the dialog box background, and click Dialog properties  Title.
  52.  
  53. 6    Type a title in the Enter text box.
  54.  
  55. Notes
  56.  
  57.   You cannot save a file when creating a custom dialog box unless you deactivate the dialog designer by clicking the spreadsheet.
  58.   
  59.   Password protection rights can be assigned to dialog boxes. For information about working with passwords, see "Using password protection."
  60.   
  61. Tip
  62.  
  63.   You can also create a dialog box on the Objects sheet by clicking the Quick tab button at the bottom of the application window, and clicking the Create dialog box button.
  64.   
  65. To add a control to a dialog box
  66.  
  67. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  68.  
  69. 2    Double-click a dialog box.
  70.  
  71. 3    Click Insert, and click a control to add.
  72.  
  73. 4    In the dialog box, drag diagonally to create the control.
  74.  
  75. 5    Right-click the control, and click Connect.
  76.  
  77. 6    Type the cell reference in the Target field.
  78.  
  79. If you want to immediately send control value changes to a cell or another control, enable the Dynamic connection check box.
  80.  
  81. Note
  82.  
  83.   For information about the behavior of specific controls, see "Understanding dialog box controls."
  84.   
  85. Tip
  86.  
  87.   If you want to customize a control, right-click the control, click Properties, and click any option in the submenu that displays.
  88.   
  89. To add a label to a dialog box control
  90.  
  91. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  92.  
  93. 2    Double-click a dialog box.
  94.  
  95. 3    Click Insert  Label text.
  96.  
  97. 4    Click where you want to add the label. 
  98.  
  99. If you need more room, drag the control to a new location.
  100.  
  101. 5    Double-click the label.
  102.  
  103. 6    Type the label text.
  104.  
  105. Tip
  106.  
  107.   You can also add a label to a dialog box by clicking the Label tool on the property bar.
  108.   
  109. To hide a control on a dialog box
  110.  
  111. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  112.  
  113. 2    Double-click a dialog box.
  114.  
  115. 3    Right-click a control, and click Properties  Hidden Yes.
  116.  
  117. You can also    
  118.  
  119. Make a control display grayed    Right-click the control, and click Properties  Grayed  Yes.
  120.  
  121. Disable a control    Right-click the control, and click Properties  Disabled  Yes.
  122.  
  123. Note
  124.  
  125.   When the Hidden property is applied, the control still displays in the dialog window while you are editing, but will disappear when you test the dialog box with the Test button.
  126.   
  127. To test a dialog box
  128.  
  129. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  130.  
  131. 2    Double-click a dialog box.
  132.  
  133. 3    Click the Test button on the property bar.
  134.  
  135. 4    Test the dialog box.
  136.  
  137. Editing and positioning dialog boxes
  138.  
  139. You can edit the properties of dialog box windows, including their size, position, and name. Dialog boxes are created with a default object name (for example, Dialog 1). Macros, link commands, and formulas use this name when referring to a specific dialog box.
  140.  
  141. A dialog box can be copied to another notebook. You can also disable a dialog box. As well, you can delete a dialog box. 
  142.  
  143. For information about specific dialog box properties, see Properties of form controls in the reference information section of the Quattro Pro online Help.
  144.  
  145. To edit a dialog box window
  146.  
  147. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  148.  
  149. 2    Double-click a dialog box.
  150.  
  151. 3    Right-click the title bar, click Dialog properties, and click one of the following:
  152.  
  153.   Dimension-lets you specify the size and position of the dialog box window
  154.   
  155.   Title-lets you change the title that displays on the title bar
  156.   
  157.   Position adjust-lets you specify how the dialog box moves when the window is resized
  158.   
  159.   Grid options-lets you display a grid to aid with placing controls
  160.   
  161.   Name-lets you type an object name to which macros, link commands, and formulas can refer
  162.   
  163. To copy a dialog box to another notebook
  164.  
  165. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  166.  
  167. 2    Double-click a dialog box.
  168.  
  169. 3    Click Edit  Copy.
  170.  
  171. 4    In the notebook to which you are copying the dialog box, click the Quick tab button at the bottom of the application window to display the Objects sheet.
  172.  
  173. 5    Click Edit  Paste.
  174.  
  175. Tip
  176.  
  177.   You can also copy a dialog box to another notebook by holding down CTRL, selecting the dialog box, and dragging it to the second notebook's Object sheet.
  178.   
  179. To disable a dialog box
  180.  
  181. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  182.  
  183. 2    Double-click a dialog box.
  184.  
  185. 3    Right-click the title bar on the dialog box, and click Dialog properties  Disabled  Yes.
  186.  
  187. To delete a dialog box
  188.  
  189. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  190.  
  191. 2    Click a dialog box icon.
  192.  
  193. 3    Press DELETE.
  194.  
  195. Adding dialog box controls
  196.  
  197. After you create a default dialog box, you can add any of the following controls to a dialog box.
  198.  
  199. To specify the action performed when you select a control, right-click the control, and click Connect to connect the control to another control or display its value in a cell, or Links to specify the action to perform.
  200.  
  201. For more information about control properties, see Properties of form controls in the reference information section of the Quattro Pro online Help.
  202.  
  203. Bitmap buttons
  204.  
  205. A bitmap button displays a bitmap image on the face of the button. Bitmap buttons can imitate the behavior of all button types (for example, radio buttons).
  206.  
  207. Push buttons
  208.  
  209. You can add buttons to dialog boxes that can execute a macro, link to a Web site, or activate another custom dialog box when the button is clicked. Buttons do not have a value; buttons execute an event such as clicking instead of displaying a value that is transferred to a cell on a spreadsheet or to another control.
  210.  
  211. Check boxes
  212.  
  213. You can add check boxes to a dialog box. Each check box displays next to a default label.
  214.  
  215. Color controls
  216.  
  217. Adding color controls let you choose a color or create a custom color.
  218.  
  219. Combo boxes
  220.  
  221. You can add combo boxes, which are a type of list box that lets you add items to a list.
  222.  
  223. Label controls
  224.  
  225. You can add a label control to a dialog box. The label control lets you place text on the dialog box as a standalone feature or near a control that does not have a label, such as a rectangle control.
  226.  
  227. Edit boxes
  228.  
  229. Adding edit boxes to dialog boxes let you add data. The input data can be characters, numbers, cell addresses, or can make the typed data hidden.
  230.  
  231. File controls
  232.  
  233. A file control consists of a box for typing filenames and a browse button that displays a list of files on disk. Adding a file control lets you choose a filename, folder, and drive. 
  234.  
  235. Group boxes
  236.  
  237. You can add a group box control, which acts as a container for other controls. Group boxes can contain radio buttons, check boxes, or buttons. These controls are considered child controls of the group box. You can use a group box to manage the controls it contains as a single unit. For example, when you move a group box in the dialog box, you also move the contents of the group box.
  238.  
  239. Scroll bars
  240.  
  241. Two scroll bar controls can be added to a dialog box: a horizontal scroll bar and a vertical scroll bar. Scroll bars let you scroll through a list of data to make a data selection.
  242.  
  243. List boxes
  244.  
  245. You can add a list box to a dialog box to list items which you can choose. The item that you choose becomes the value of the list box.
  246.  
  247. Radio buttons
  248.  
  249. Grouped radio buttons present a list of mutually exclusive choices. Only one radio button can be selected. When radio buttons are on a dialog box, the radio buttons are still mutually exclusive. The dialog box acts as a container for the radio button controls. When you want to use more than one set of radio buttons and have each set provide mutually exclusive choices on the same dialog box, place each set within a group box or rectangle.
  250.  
  251. Rectangle controls
  252.  
  253. A rectangle control performs the same function as a group box control. You can add a rectangle control to organize controls in a dialog box. Like group boxes, controls added to a rectangle become child controls.
  254.  
  255. Spin controls
  256.  
  257. Adding a spin control lets you enter numeric data by clicking arrows to increase or decrease the value of the spin control, or by typing the value.
  258.  
  259. Tab controls
  260.  
  261. You can add a tab control to organize settings in a notebook of controls. Clicking a tab displays controls associated with that tab.
  262.  
  263. Timer controls
  264.  
  265. You can use a timer control to run link commands at regular intervals or at a specified time. This is useful for creating toolbar controls that periodically retrieve current values from the active window.
  266.  
  267. To add a bitmap button to a dialog box
  268.  
  269. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  270.  
  271. 2    Double-click a dialog box.
  272.  
  273. 3    Click Insert  Bitmap button.
  274.  
  275. 4    In the dialog box, drag diagonally to create the control.
  276.  
  277. 5    Right-click the control, and click Properties  Bitmap.
  278.  
  279. 6    Choose a file.
  280.  
  281. Tips
  282.  
  283.   You can add a custom bitmap image by copying a graphic to the clipboard, right-clicking the bitmap button, and selecting Paste.
  284.   
  285.   You can select a button type for the bitmap image to imitate by right-clicking the bitmap button, and clicking Properties  Button type.
  286.   
  287. To add a push button to a dialog box
  288.  
  289. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  290.  
  291. 2    Double-click a dialog box.
  292.  
  293. 3    Click Insert  Push button.
  294.  
  295. 4    In the dialog box, drag diagonally to create the control.
  296.  
  297. Note
  298.  
  299.   You can make a push button close the dialog box by selecting OK exit button or Cancel exit button from the Button type choices in the Properties menu.
  300.   
  301. To add a check box to a dialog box
  302.  
  303. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  304.  
  305. 2    Double-click a dialog box.
  306.  
  307. 3    Click Insert  Check box.
  308.  
  309. 4    In the dialog box, drag diagonally to create the control.
  310.  
  311. 5    Right-click the control, and click Properties  Label text.
  312.  
  313. 6    In the Enter text box, type the label to display.
  314.  
  315. If you want to display the label to the left of the check box, right-click the check box, and click Properties  Draw to right  No.
  316.  
  317. Note
  318.  
  319.   The value of a check box is Yes when it is enabled and No when it is disabled.
  320.   
  321. To add a color control to a dialog box
  322.  
  323. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  324.  
  325. 2    Double-click a dialog box.
  326.  
  327. 3    Click Insert  Color box.
  328.  
  329. 4    In the dialog box, drag diagonally to create the control.
  330.  
  331. To add a combo box to a dialog box
  332.  
  333. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  334.  
  335. 2    Double-click a dialog box.
  336.  
  337. 3    Click Insert  Combo box.
  338.  
  339. 4    In the dialog box, drag diagonally to create the control.
  340.  
  341. If you want to specify a system list for the combo box, right-click the combo box, click Properties  List, and click a list.
  342.  
  343. You can also    
  344.  
  345. Include cell contents in a combo box    Right-click the combo box, click Properties  List, double-click the edit box, and select a cell block on the spreadsheet
  346.  
  347. Paste a block of data into a combo box    Select the data from a spreadsheet, click the combo box, and click Edit  Paste
  348.  
  349. To add a label control to a dialog box
  350.  
  351. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  352.  
  353. 2    Double-click a dialog box.
  354.  
  355. 3    Click Insert  Label text.
  356.  
  357. 4    In the dialog box, drag diagonally to create the control.
  358.  
  359. 5    Right-click the control, and click Properties  Label text.
  360.  
  361. 6    In the Enter text box, type the label to display.
  362.  
  363. To add an edit box to a dialog box
  364.  
  365. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  366.  
  367. 2    Double-click a dialog box.
  368.  
  369. 3    Click Insert  Edit box.
  370.  
  371. 4    In the dialog box, drag diagonally to create the control.
  372.  
  373. Note
  374.  
  375.   Special characters (such as \n, \t, or \\) can only be allowed in an edit box if the Convert text option is set to Yes.
  376.   
  377. Tip
  378.  
  379.   If you want to remove the surrounding box, right-click the edit box, and click Properties  Show frame  No.
  380.   
  381. To add a file control to a dialog box
  382.  
  383. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  384.  
  385. 2    Double-click a dialog box.
  386.  
  387. 3    Click Insert  File control.
  388.  
  389. 4    In the dialog box, drag diagonally to create the control.
  390.  
  391. Note
  392.  
  393.   The value of a file control determines the drive letter, folder, and filename that display. Whenever you view a different folder or use a different filename, the change is reflected in the value of the file control.
  394.   
  395. To add a group box to a dialog box
  396.  
  397. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  398.  
  399. 2    Double-click a dialog box.
  400.  
  401. 3    Click Insert  Group box.
  402.  
  403. 4    In the dialog box, drag diagonally to create the control.
  404.  
  405. 5    Click Insert, and click a control to add to the group box.
  406.  
  407. 6    In the group box, drag diagonally to create the control.
  408.  
  409. Note
  410.  
  411.   When you add a group box, the Process value of a group box is set to yes. The Process value of radio buttons in the group box are set to no.
  412.   
  413. Tip
  414.  
  415.   You can also add options to a group box by copying a block from the clipboard to the group box. Each row of the block becomes a radio button.
  416.   
  417. To add a scroll bar to a dialog box
  418.  
  419. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  420.  
  421. 2    Double-click a dialog box.
  422.  
  423. 3    Click Insert  Scroll bar.
  424.  
  425. 4    In the dialog box, drag diagonally to create the control.
  426.  
  427. Note
  428.  
  429.   The value of a scroll bar is an integer from a fixed range of integers.
  430.   
  431. To add a list box to a dialog box
  432.  
  433. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  434.  
  435. 2    Double-click a dialog box.
  436.  
  437. 3    Click Insert  List box.
  438.  
  439. 4    In the dialog box, drag diagonally to create the control.
  440.  
  441. If you want to specify a system list for the list box, right-click the list box, click Properties  List, and click a list.
  442.  
  443. Note
  444.  
  445.   By default, list box entries are sorted alphanumerically in ascending order.
  446.   
  447. To add a radio button to a dialog box
  448.  
  449. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  450.  
  451. 2    Double-click a dialog box.
  452.  
  453. 3    Click Insert  Radio button.
  454.  
  455. 4    In the dialog box, drag diagonally to create the control.
  456.  
  457. If you want to display the label to the left of the radio button, right-click the radio button, and click Properties  Draw to right  No.
  458.  
  459. Note
  460.  
  461.   By default, a radio button's Process value property is set to no, and the group box containing it has its Process value property set to yes. When the Process value property of a radio button is set to yes, a radio button has a value of yes when enabled and no when disabled.
  462.   
  463. Tip
  464.  
  465.   You can also add radio buttons to a dialog box by copying a block of data from the clipboard so that each row of the block becomes a radio button.
  466.   
  467. To add a rectangle control to a dialog box
  468.  
  469. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  470.  
  471. 2    Double-click a dialog box.
  472.  
  473. 3    Click Insert  Rectangle.
  474.  
  475. 4    In the dialog box, drag diagonally to create the control.
  476.  
  477. 5    Click Insert, and click a control to add to the rectangle control.
  478.  
  479. 6    In the rectangle control, drag diagonally to create the control.
  480.  
  481. To add a spin control to a dialog box
  482.  
  483. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  484.  
  485. 2    Double-click a dialog box.
  486.  
  487. 3    Click Insert  Spin control.
  488.  
  489. 4    In the dialog box, drag diagonally to create the control.
  490.  
  491. Note
  492.  
  493.   The value of a spin control is always an integer.
  494.   
  495. To add a tab control to a dialog box
  496.  
  497. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  498.  
  499. 2    Double-click a dialog box.
  500.  
  501. 3    Click Insert  Tab.
  502.  
  503. 4    In the dialog box, drag diagonally to create the control.
  504.  
  505. If you want to add another control to the tab control, click Insert, and click a control.
  506.  
  507. Note
  508.  
  509.   You can rename a tab by double-clicking on its name and typing a new one.
  510.   
  511. To add a timer control to a dialog box
  512.  
  513. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  514.  
  515. 2    Double-click a dialog box.
  516.  
  517. 3    Click Insert  Timer.
  518.  
  519. 4    In the dialog box, drag diagonally to create the control.
  520.  
  521. Tip
  522.  
  523.   The timer control can be turned into a clock by right-clicking the control, and clicking Properties  Show time  Yes.
  524.   
  525. Assigning properties to dialog box controls
  526.  
  527. You can identify the Name property of a control. The Name property of a dialog box control is usually the way you reference that object in a macro, link command, or spreadsheet function. This property is accessed for graphic objects, clipart, maps, charts, and OLE objects.
  528.  
  529. The Selected property indicates numerically which radio button in a group box is chosen, or which item in a list box or combo box is selected. Numbers are sequential (beginning at zero). If the first item is chosen or selected, the Selected property is set to 0. Choosing or selecting the second item sets the Selected property to 1, and so on.
  530.  
  531. Along with setting the Selected property, you can set the Selection text property. With this property, you can specify the selected text to display in a list box. You see this text selected when the control is activated or when you open the dialog box.
  532.  
  533. Every dialog box has a default button that closes the dialog box. By default, the OK button in a dialog box performs this function. You can assign another control the same function.
  534.  
  535. You can assign shortcut keys to both labeled and unlabelled controls. Assigning a shortcut key to a control allows you to run a macro when the control is selected or activated. For more information about using these events, see "Understanding link events."
  536.  
  537. You can specify areas of a dialog box or control where access is not available.
  538.  
  539. For more information about specific controls, see "Adding dialog box controls" and "Outline of control-specific properties." For more information about specific properties, see Properties of form controls in the reference information section of the Quattro Pro online Help.
  540.  
  541. To identify the Name property of a dialog box control
  542.  
  543. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  544.  
  545. 2    Double-click a dialog box.
  546.  
  547. 3    Right-click a control, and click Properties  Name.
  548.  
  549. You can also    
  550.  
  551. Identify the object ID property of a dialog box control    Right-click the control, and click Properties  Object ID.
  552.  
  553. Note
  554.  
  555.   For information about changing the name of a dialog box control, see "To rename a control in a dialog box."
  556.   
  557. To set the Selected property for a dialog box control
  558.  
  559. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  560.  
  561. 2    Double-click a dialog box.
  562.  
  563. 3    Right-click a control, and click Properties  Selected.
  564.  
  565. 4    Type a number in the Enter number box.
  566.  
  567. This will indicate which item is selected.
  568.  
  569. To set the Selection text property for a dialog box control
  570.  
  571. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  572.  
  573. 2    Double-click a dialog box.
  574.  
  575. 3    Right-click a control, and click Properties  Selection text.
  576.  
  577. 4    Type text in the Enter text box.
  578.  
  579. Note
  580.  
  581.   For more information about creating the list used in a list box, see "To add a list box to a dialog box", "To add a spin control to a dialog box", or "To add a file control to a dialog box."
  582.   
  583. To make a dialog box control the default button
  584.  
  585. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  586.  
  587. 2    Double-click a dialog box.
  588.  
  589. 3    Right-click a control, and click Properties  Default button  Yes.
  590.  
  591. To assign a shortcut key to a labeled dialog box control
  592.  
  593. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  594.  
  595. 2    Double-click a dialog box.
  596.  
  597. 3    Double-click a label.
  598.  
  599. 4    Click just before the letter to use.
  600.  
  601. 5    Type &.
  602.  
  603. 6    Press ENTER.
  604.  
  605. Note
  606.  
  607.   When a control or label control has an attached shortcut, a letter of the label is underlined.
  608.   
  609. To assign a shortcut key to an unlabelled dialog box control
  610.  
  611. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  612.  
  613. 2    Double-click a dialog box.
  614.  
  615. 3    Right-click a control without a label, and click Properties  Name.
  616.  
  617. 4    Click just before the letter to use.
  618.  
  619. 5    Type &.
  620.  
  621. 6    Press ENTER.
  622.  
  623. Note
  624.  
  625.   If you use more than one ampersand, the first is recognized as a shortcut key designation, and the remaining ones display as text.
  626.   
  627. To limit access to a dialog box control or dialog box
  628.  
  629. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  630.  
  631. 2    Double-click a dialog box.
  632.  
  633. 3    Right-click a control, and click Properties  Depend on.
  634.  
  635. 4    Disable any check boxes corresponding to areas in which you do not want the control available.
  636.  
  637. Notes
  638.  
  639.   If all options in the Depend on property are checked, the control is always available.
  640.   
  641.   You can also limit access to dialog boxes and controls by using password protection. For information about assigning password protection, see "Using password protection."
  642.   
  643. Attaching actions to dialog box controls
  644.  
  645. After you add a control to a dialog box, you must specify what happens when a control executes an action or result. A control can execute when triggered by an action or when triggered by another control's actions. There are two ways to activate a control: by connecting it or by linking it.
  646.  
  647. You would connect a control to create a static or dynamic connection to a spreadsheet. For example, if you want the list in a list box to display a list of current customers, then a dynamic connection is appropriate, as it reflects the most recent data in the connected column on the spreadsheet. You should link a control to create a more complicated link. For example, you can create a compound link (a link containing several link actions for a control) or a conditional link (a link using an IF condition).
  648.  
  649. You can connect a control to another control or to a notebook cell. This creates a link command for the selected object.
  650.  
  651. You can specify actions for a control to perform in the Object link dialog box. You can assign a single link or consecutive links to a control. The links execute in the order they display.
  652.  
  653. The list types in the Object link dialog box from which to select are:
  654.  
  655. List    Description
  656.  
  657. Link events    Displays the specific event that triggers the link command
  658.  
  659. Link commands    Displays the command (action) that sends a value to another control or notebook cell, runs a macro, or runs another event in response to a triggering event
  660.  
  661. Link control properties    Displays available properties for the control
  662.  
  663. Object selector list    Allows you to specify a control or cell on which to act
  664.  
  665. Selected object properties    Displays properties for the item selected in the Object selector list
  666.  
  667. You can create conditional links by using the IF-THEN-ELSE link command. An IF-THEN-ELSE link command compares a minimum of two conditions and tests if the results are true. If the conditions are true, the THEN part of the link command occurs. The ELSE portion of the link command occurs if the result is false, so that the second IF link command occurs. For example, you can create a group box with three radio buttons, and link the radio buttons to two edit boxes that display different results depending on which radio button is selected.
  668.  
  669. You can delete a connected link command.
  670.  
  671. For examples of how to link dialog box controls, see Examples of linking controls in the reference information section of the Quattro Pro online Help.
  672.  
  673. For information about the kinds of link events and link commands available, see "Understanding link events" and "Understanding link commands."
  674.  
  675. To connect a dialog box control to cells or other controls
  676.  
  677. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  678.  
  679. 2    Double-click a dialog box.
  680.  
  681. 3    Select a control.
  682.  
  683. 4    Right-click the control, and click Connect.
  684.  
  685. 5    Type the cell reference in the Target field.
  686.  
  687. If you want to immediately send control value changes to a cell or another control, enable the Dynamic connection check box.
  688.  
  689. Notes
  690.  
  691.   The Dynamic connection check box is enabled by default; disable this box if you want to display control value changes to a cell or another control only when you close the dialog box.
  692.   
  693.   You can access the Connect command through the Object link dialog box when you are in Developer mode. For more information about Developer mode, see "Working in Developer mode."
  694.   
  695. To specify the action performed by a dialog box control
  696.  
  697. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  698.  
  699. 2    Double-click a dialog box.
  700.  
  701. 3    Select a control.
  702.  
  703. 4    Right-click the control, and click Links.
  704.  
  705. 5    Click one of the following buttons:
  706.  
  707.   Add-creates a link below the active link
  708.   
  709.   Insert-creates a link above the active link
  710.   
  711. 6    From the Link event list, choose the event that initiates the action.
  712.  
  713. 7    From the Link command list, choose the action to perform.
  714.  
  715. 8    Choose an option from any of the available lists.
  716.  
  717. Tip
  718.  
  719.   You can assign consecutive link commands for the control by repeating steps 3 through 6 of the above procedure.
  720.   
  721. To create a conditional object link
  722.  
  723. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  724.  
  725. 2    Double-click a dialog box.
  726.  
  727. 3    Select a control.
  728.  
  729. 4    Right-click the control, and click Links.
  730.  
  731. 5    Click Add.
  732.  
  733. 6    From the Link event list, choose the event that initiates the action.
  734.  
  735. 7    Choose If from the Link commands list.
  736.  
  737. 8    Choose an option from any of the available lists.
  738.  
  739. To delete a connected link command
  740.  
  741. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  742.  
  743. 2    Double-click a dialog box.
  744.  
  745. 3    Select a control.
  746.  
  747. 4    Right-click the control, and click Links.
  748.  
  749. 5    Click one of the following:
  750.  
  751.   Delete-deletes the selected link in the Object link dialog box
  752.   
  753.   Delete all-deletes all links displayed in the Object link dialog box
  754.   
  755. Editing and positioning dialog box controls
  756.  
  757. Quattro Pro lets you customize the position and appearance of dialog box controls.
  758.  
  759. Dialog box controls are created with a default object name (for example, Dialog 1). Macros, link commands, and formulas use this name when referring to a specific control. You can rename these controls.
  760.  
  761. You can move dialog box controls in the same way as you move other floating objects. You can also specify the exact position of controls on a dialog box.
  762.  
  763. Controls can be copied in the same way as you copy other objects. Each instance of a control has a different object name (Button1, Button2, and so on), to avoid confusion when referring to the control in macros, link commands, and spreadsheet functions.
  764.  
  765. You can edit the controls in a dialog box. As well, you can align, center, and space multiple controls. For example, when you space controls horizontally, the first control you select displays at the left after repositioning, the next control displays to the right of the first, and so on. When you space controls vertically, the first control you select displays at the top, and so on.
  766.  
  767. You can change the size of a control in the same way as you resize other objects.
  768.  
  769. By default, when you press TAB, you can cycle through the controls in the order they were added to the dialog box. However, you can change this tabbing order.
  770.  
  771. To rename a control in a dialog box
  772.  
  773. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  774.  
  775. 2    Double-click a dialog box.
  776.  
  777. 3    Right-click a control, and click Properties  Name.
  778.  
  779. 4    Type a new name in the Enter text box.
  780.  
  781. To move a control in a dialog box
  782.  
  783. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  784.  
  785. 2    Double-click a dialog box.
  786.  
  787. 3    Select a control.
  788.  
  789. 4    Drag the control to a new location.
  790.  
  791. Tips
  792.  
  793.   If two or more controls are covering all or part of another control, you can adjust the overlap options so that the controls position separately by right-clicking one of the controls, clicking Object order, and clicking the appropriate selection.
  794.   
  795.   If you want to use a grid to help you position the control, right-click the dialog box title, click Dialog properties  Grid options, and enable the Show grid check box.
  796.   
  797. To specify an exact position for a control in a dialog box
  798.  
  799. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  800.  
  801. 2    Double-click a dialog box.
  802.  
  803. 3    Right-click the control, and click Properties  Dimension.
  804.  
  805. 4    Type a value in the following boxes:
  806.  
  807.   X pos-lets you specify the distance in pixels between the left edge of the control and the left side of the dialog box
  808.   
  809.   Y pos-lets you specify the distance in pixels between the top edge of the control and the bottom edge of the dialog box's title bar
  810.   
  811. To copy a control in a dialog box
  812.  
  813. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  814.  
  815. 2    Double-click a dialog box.
  816.  
  817. 3    Select a control.
  818.  
  819. 4    Click Edit  Copy.
  820.  
  821. 5    Click where you want to copy the control.
  822.  
  823. 6    Click Edit  Paste.
  824.  
  825. Note
  826.  
  827.   Copying a parent control copies any child controls attached to it as well.
  828.   
  829. Tip
  830.  
  831.   You can also copy a control by using the Copy and Paste buttons on the toolbar.
  832.   
  833. To edit multiple dialog box controls
  834.  
  835. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  836.  
  837. 2    Double-click a dialog box.
  838.  
  839. 3    Drag a frame around the controls you want to edit.
  840.  
  841. 4    Edit the selected controls.
  842.  
  843. Tips
  844.  
  845.   You can also select multiple controls by holding down SHIFT and clicking the controls you want to edit.
  846.   
  847.   You can edit all controls in a dialog box by clicking a control and clicking Edit  Select all.
  848.   
  849. To align multiple dialog box controls
  850.  
  851. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  852.  
  853. 2    Double-click a dialog box.
  854.  
  855. 3    Click a control, hold down SHIFT, and click additional controls.
  856.  
  857. 4    Right-click one of the controls, click Align, and click one of the following:
  858.  
  859.   Align left-lines up the left sides of the selected controls
  860.   
  861.   Align right-lines up the right sides of the selected controls
  862.   
  863.   Align top-lines up the top edges of the selected controls
  864.   
  865.   Align bottom-lines up the bottom edges of the selected controls
  866.   
  867. To center multiple dialog box controls
  868.  
  869. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  870.  
  871. 2    Double-click a dialog box.
  872.  
  873. 3    Click a control, hold down SHIFT, and click additional controls.
  874.  
  875. 4    Right-click one of the controls, click Position, and click one of the following:
  876.  
  877.   Center horizontally-centers controls between the left and right edges of the dialog box
  878.   
  879.   Center vertically-centers controls between the top and bottom edges of the dialog box
  880.   
  881. To space multiple dialog box controls
  882.  
  883. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  884.  
  885. 2    Double-click a dialog box.
  886.  
  887. 3    Click a control, hold down SHIFT, and click additional controls.
  888.  
  889. 4    Right-click one of the controls, click Space, and click one of the following:
  890.  
  891.   Horizontal space
  892.   
  893.   Vertical space
  894.   
  895. 5    Type a number in the Space between objects box.
  896.  
  897. This indicates the pixel distance to space the selected controls.
  898.  
  899. To resize multiple dialog box controls
  900.  
  901. 1    Click the control whose size you want to apply to other controls.
  902.  
  903. 2    Hold down SHIFT, and click additional controls.
  904.  
  905. 3    Click Format  Same size.
  906.  
  907. To change the tab order for dialog box controls
  908.  
  909. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  910.  
  911. 2    Double-click a dialog box.
  912.  
  913. 3    Hold down SHIFT, and select each control in the order you want to move through the controls.
  914.  
  915. 4    Click Format  Tab order  Set new.
  916.  
  917. Note
  918.  
  919.   You can also change the order for settings initial values of a control and the order in which they activate. For more information about changing the initial values and order of controls, see "To change the order for setting initial values in a dialog box."
  920.   
  921. Working with child controls in dialog boxes
  922.  
  923. When you drag a control on top of another control, they become attached. The top control is the child; the bottom control is its parent. You can attach controls to both group boxes and rectangle controls. When you move a parent control on top of another control, the controls attached to the original parent stay associated with the original parent. For example, you can place a group box of radio buttons on top of a rectangle control and the radio buttons remain children of the group box, not of the rectangle.
  924.  
  925. You can also add an unattached control to a parent control. This means that the unattached control is not controlled by the parent control. For example, resizing the parent does not affect the unattached control. A control can be unattached from its parent. This allows the control to work independently from the other child controls in the parent control (like a rectangle control or group box).
  926.  
  927. You can move a child control when the dialog box is resized. When you move a group box, any child controls (for example, radio buttons) move with it. By selecting a relative position for a control, the unlocked edges of a child control move relative to its position in the parent control.
  928.  
  929. If you change settings, however, you can move a child control with the parent as shown by the arrows below.
  930.  
  931.  
  932.  
  933. For more information about creating group boxes and rectangle controls, see "To add a group box to a dialog box" and "To add a rectangle control to a dialog box." For more information about linking group boxes and rectangle controls, see Examples of linking controls in the reference information section of the Quattro Pro online Help.
  934.  
  935. To attach a control to group boxes and rectangle controls
  936.  
  937. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  938.  
  939. 2    Double-click a dialog box.
  940.  
  941. 3    Drag a control onto a rectangle control or group box.
  942.  
  943. 4    Right-click the parent control, and click Properties  Attach child  Yes.
  944.  
  945. Notes
  946.  
  947.   For information about adding buttons, radio buttons, or check boxes to group boxes and rectangle controls, see "To add a group box to a dialog box" and "To add a rectangle control to a dialog box."
  948.   
  949.   Child controls must cover only the parent control. Controls partially covering one another will not attach.
  950.   
  951. To add an unattached control to a parent control
  952.  
  953. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  954.  
  955. 2    Double-click a dialog box.
  956.  
  957. 3    Select a control.
  958.  
  959. 4    Right-click the parent control, and click Properties  Attach child  No.
  960.  
  961. 5    Click Insert, and click a control.
  962.  
  963. 6    Drag the new control onto the parent control.
  964.  
  965. 7    Right-click the parent control, and click Properties  Attach child  Yes.
  966.  
  967. To separate a control from a parent control
  968.  
  969. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  970.  
  971. 2    Double-click a dialog box.
  972.  
  973. 3    Drag the child control onto the dialog box outside of the parent control.
  974.  
  975. 4    Select the parent control.
  976.  
  977. 5    Right-click the parent control, and click Properties  Attach child  No.
  978.  
  979. 6    Drag the control back onto the parent control.
  980.  
  981. To move a child control when the dialog box is resized
  982.  
  983. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  984.  
  985. 2    Double-click a dialog box.
  986.  
  987. 3    Right-click a control, and click Properties  Position adjust.
  988.  
  989. 4    In the Position adjust area, enable any of the following options:
  990.  
  991.   Depend on parent-locks each edge of the child control in place so that the child resizes in proportion to the proportions of the resized parent control
  992.   
  993.   Center horizontally-centers the control between the left and right sides of the resized parent control
  994.   
  995.   Center vertically-centers the control between the top and bottom sides of the resized parent control
  996.   
  997. 5    In the Position relative to area, enable any of the following check boxes:
  998.  
  999.   Top-unlocks the top edge of the control
  1000.   
  1001.   Bottom-unlocks the bottom edge of the control
  1002.   
  1003.   Left-unlocks the left edge of the control
  1004.   
  1005.   Right-unlocks the right edge of the control
  1006.   
  1007. 6    Drag the lower-right corner of the dialog box window to resize the parent control.
  1008.  
  1009. Creating Help and tips for controls
  1010.  
  1011. You can create your own Help (.hlp) files and use them for custom applications you build with Quattro Pro. This allows you to enter tips and Help files for the controls and the dialog boxes you create.
  1012.  
  1013. Application bar hints can be created for a control. For dialog box controls, this property displays the text at the bottom right of the application bar when the cursor hovers over the control.
  1014.  
  1015. You can link a Help file to a control. As well, you can link a Help button to a Help file.
  1016.  
  1017. To create Help for a dialog box control
  1018.  
  1019. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  1020.  
  1021. 2    Double-click a dialog box.
  1022.  
  1023. 3    Right-click a control, and click Properties  Object Help.
  1024.  
  1025. 4    In the Object Help title box, type the title to display.
  1026.  
  1027. 5    In the Object Help text box, type the text to display when you right-click the object in a dialog box.
  1028.  
  1029. Notes
  1030.  
  1031.   For more information about using the Object Help property, see Properties of form controls in the reference information section of the Quattro Pro online Help.
  1032.   
  1033.   The combined total of all characters in the three Object Help fields cannot exceed 194 characters.
  1034.   
  1035. To create an application bar hint for a dialog box control
  1036.  
  1037. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  1038.  
  1039. 2    Double-click a dialog box.
  1040.  
  1041. 3    Right-click a control, and click Properties  Help line.
  1042.  
  1043. 4    Type the hint in the Enter text box.
  1044.  
  1045. To link a Help file to a dialog box control
  1046.  
  1047. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  1048.  
  1049. 2    Double-click a dialog box.
  1050.  
  1051. 3    Right-click a control, and click Properties  Object Help.
  1052.  
  1053. 4    Type the context string, an @ symbol, and the Help filename in the WinHelp context box.
  1054.  
  1055. Note
  1056.  
  1057.   For the Help to launch the Object Help title and Object Help text boxes must both be empty.
  1058.   
  1059. To link a dialog box to a Help file
  1060.  
  1061. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  1062.  
  1063. 2    Double-click a dialog box.
  1064.  
  1065. 3    Right-click a control, and click Links.
  1066.  
  1067. 4    Click Add and make the following list selections:
  1068.  
  1069.   On-On
  1070.   
  1071.   Link event-Init
  1072.   
  1073.   Link command-Set
  1074.   
  1075.   Help topic and filename-HelpContext@HelpFile To
  1076.   
  1077.   Selected object-Help
  1078.   
  1079.   Selected object properties-Context
  1080.   
  1081. Tip
  1082.  
  1083.   When creating the link command, if you do not see Help on the object pick list next to where you type in the Help file, click Enter and type Help.
  1084.   
  1085. To link a Help button to a Help file
  1086.  
  1087. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  1088.  
  1089. 2    Double-click a dialog box.
  1090.  
  1091. 3    Right-click the title of the dialog box, and click Links.
  1092.  
  1093. 4    Click Add and make the following list selections:
  1094.  
  1095.   On-On
  1096.   
  1097.   Link event-Init
  1098.   
  1099.   Link command-Set
  1100.   
  1101.   Blank-HelpContext@HelpFile To
  1102.   
  1103.   Object selector-Help
  1104.   
  1105.   Selected object properties-Context
  1106.   
  1107.   On-On
  1108.   
  1109.   Link event-Clicked
  1110.   
  1111.   Link command-EXECUTE
  1112.   
  1113.   Object selector-Help
  1114.   
  1115.   Selected object properties-Context
  1116.   
  1117. Tip
  1118.  
  1119.   When creating the link command, if you do not see Help on the object pick list next to where you type in the Help file, click Enter and type Help.
  1120.   
  1121. Using macros to display a dialog box
  1122.  
  1123. You can create a macro to display a custom dialog box and set its initial values, using the {DODIALOG} macro command. The most important argument in {DODIALOG} is the third argument, which outlines cells that contain the initial settings of the dialog box controls. Each cell in the block (starting at the upper-left cell and proceeding row by row to the lower-right cell) sets the initial value of one control. If you cancel the dialog box, the values in this block remain unchanged.
  1124.  
  1125. Each control stores one setting. You manipulate the control (by clicking a scroll arrow, typing text, and so on) to change that setting. There are several ways to set a control's value:
  1126.  
  1127.   through initial settings you send (or pass) using a {DODIALOG} command
  1128.   
  1129.   by changing a setting in the dialog box
  1130.   
  1131.   using the {SETOBJECTPROPERTY} command.
  1132.   
  1133.   with link commands from any dialog box control
  1134.   
  1135. For example, the following macro command uses the Value property to enter Spanish in an edit box: {SETOBJECTPROPERTY "Dialog1:EditField3.Value","Spanish"}
  1136.  
  1137. You can change the order for setting initial values. As well, you can reorder controls.
  1138.  
  1139. For additional information, see the reference section "Example of using macros to display a dialog box."
  1140.  
  1141. To display a dialog box and set initial values
  1142.  
  1143. 1    Set up an area in a notebook that will send default settings to the dialog box.
  1144.  
  1145. 2    Type a {DODIALOG} macro command that displays the dialog box and sends the choices back to the notebook. The {DODIALOG} macro must contain the following arguments:
  1146.  
  1147.   Argument 1-specifies the name of the notebook that contains the dialog box you want to display and the name of the dialog box. The name of the notebook is optional if the dialog box is stored in the active notebook.
  1148.   
  1149.   Argument 2-specifies a cell that stores a value indicating how you closed the dialog box. If the dialog box was canceled, 0 is stored in the cell. If the dialog box was closed by pressing ENTER or clicking OK, 1 is stored.
  1150.   
  1151.   Argument 3-specifies a block that contains initial values for the dialog box controls, and receives final values from the dialog box controls when the dialog box is closed
  1152.   
  1153.   Argument 4-specifies whether you should manipulate the dialog box (1) or if the macro should manipulate it (0). The default is 1.
  1154.   
  1155. Notes
  1156.  
  1157.   If a control's Process value property is set to No, the control will not receive an initial value. Controls that do not have a Process value property have no initial value.
  1158.   
  1159.   If you want to make a dialog box dynamic so that changes are immediately reflected in the notebook, add link commands to each control. For information about using link commands, see "Attaching actions to dialog box controls."
  1160.   
  1161. To change the order for setting initial values in a dialog box
  1162.  
  1163. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  1164.  
  1165. 2    Double-click a dialog box.
  1166.  
  1167. 3    Click the dialog box background.
  1168.  
  1169. None of the controls should be selected.
  1170.  
  1171. 4    Hold down SHIFT, and click each control in the order in which you want to send initial value settings.
  1172.  
  1173. 5    Click Format  Value order  Set new.
  1174.  
  1175. To reorder controls in a dialog box
  1176.  
  1177. 1    Click the Quick tab button at the bottom of the application window to display the Objects sheet.
  1178.  
  1179. 2    Double-click a dialog box.
  1180.  
  1181. 3    Click the dialog box background.
  1182.  
  1183. None of the controls should be selected.
  1184.  
  1185. 4    Click Format  Value order  Reorder from first.
  1186.  
  1187. 5    Hold down SHIFT, and click each control in the order in which you want to send values.
  1188.  
  1189. Reference: Working with custom dialog boxes and controls
  1190.  
  1191. Once you have named a dialog box and given it a title, you can add controls to it. Each control is best suited for presenting or receiving a certain type of information. Most controls display a setting and allow you to change the setting.
  1192.  
  1193. Link commands perform dynamic actions in response to events. A link command can make a control do different things. For example, it can send a value to a cell in the notebook, send a value to another control, run a macro, close the dialog box, or change the zoom factor in the notebook. One control can have several link commands listed in the Object link dialog box.
  1194.  
  1195. The first list in the Object link dialog box (the Link event list) shows the event that you want to trigger the link command. More than one link command in a control can respond to the same event. The order in which the link commands display in the Object link dialog box is the order in which they run.
  1196.  
  1197. Understanding dialog box controls
  1198.  
  1199. The following table describes the most common controls.
  1200.  
  1201. Control    Description
  1202.  
  1203.  Button    Performs a specific action when clicked
  1204.  
  1205.  Check box    Provides two choices: Yes when enabled and No when disabled
  1206.  
  1207.  Radio button    Typically used in a mutually exclusive list where only one radio button can be enabled at a time
  1208.  
  1209.  Group box    Contains other controls, such as radio buttons or check boxes
  1210.  
  1211.  List box    Lets you choose data from a list
  1212.  
  1213.  Combo box    Lets you add items to a list box
  1214.  
  1215.  Label    Lets you display text next to a control
  1216.  
  1217.  Spin control    Lets you choose a value by typing or by clicking arrows and selecting a value
  1218.  
  1219.  Edit box    Lets you type text
  1220.  
  1221.  Vertical scroll bar    Lets you select a value from a range of values
  1222.  
  1223.  Horizontal scroll bar    Lets you select a value from a range of values
  1224.  
  1225.  Bitmap button    Lets you display a bitmap image instead of a label on a button, and then imitates the behavior of a check box, radio button, or push button
  1226.  
  1227.  Rectangle control    Embellishes a dialog box, or groups two or more controls
  1228.  
  1229.  File control    Lets you choose a filename and a browse button with access to all available files
  1230.  
  1231.  Color control    Lets you change a color setting
  1232.  
  1233.  Tab    Lets you create tabs on a dialog box
  1234.  
  1235.  Timer control    Lets you add a timer, clock, or alarm to a dialog box
  1236.  
  1237. For more information about the functions of controls, see Properties of dialog box controls in the reference information section of the Quattro Pro online Help.
  1238.  
  1239. Understanding link commands
  1240.  
  1241. The following table shows you the link commands available from the Link command list:
  1242.  
  1243. Choose    Result
  1244.  
  1245. SEND    Sends a value or property to a cell in the notebook; another control; or a property in a selection; sheet; notebook; or the Quattro Pro application
  1246.  
  1247. RECEIVE    Receives a value or property from a cell in the notebook, another control, or a property in a selection, sheet, notebook, or the Quattro Pro application
  1248.  
  1249. DOMACRO    Plays the macro you specify
  1250.  
  1251. EXECUTE    Executes another control or another dialog box
  1252.  
  1253. SET    Sets properties in the dialog box, another dialog box, a cell, a sheet, a notebook, or the Quattro Pro application
  1254.  
  1255. TRIGGER    Executes or "fires" an action or piece of code when certain events or conditions are met. For example, you might use a trigger event for a button that updates values.
  1256.  
  1257. IF    Creates conditional statements
  1258.  
  1259. The {DODIALOG} macro command brings changed values to the notebook when you close the dialog box. However, if you set up a dynamic link, you do not have to close the dialog box to see the changed values. For more information about using {DODIALOG}, see "Using macros to display a dialog box."
  1260.  
  1261. Understanding link events
  1262.  
  1263. The following table describes the link events common to all dialog box controls.
  1264.  
  1265. Link event    Triggers the link command when
  1266.  
  1267. Init    The dialog box is about to display. Use Init to set initial settings.
  1268.  
  1269. Init_Complete    You add a link command to the dialog box itself. This event occurs immediately after all controls have run all link commands that respond to Init.
  1270.  
  1271. OKExit    The dialog box has been closed. The link command runs before the dialog box closes.
  1272.  
  1273. CancelExit    The dialog box has been canceled. The link command runs before the dialog box closes.
  1274.  
  1275. Clicked    The control has been clicked..
  1276.  
  1277. Right_bdown    The control has been right-clicked.
  1278.  
  1279. Left_bdown    You've pointed to the control and held down the left mouse button. Releasing the button generates a Clicked event.
  1280.  
  1281. Doubleclick    The control has been double-clicked.
  1282.  
  1283. Valuechanged    The value of the control has been changed. This event occurs any time the value is changed.
  1284.  
  1285. key:keystroke    The key keystroke has been pressed. When you choose key from the Link event list, it flashes to indicate that you must press a key. Press the key you want to generate the event. For example, key:Ctrl + F5 indicates that the link command is triggered by pressing CTRL + F5.
  1286.  
  1287. Activate    The control for manipulation has been chosen. For example, clicking an edit box generates this event so that Valuechanged traps the final result entered in the edit box.
  1288.  
  1289. Deactivate    Another control has been chosen, leaving this control inactive.
  1290.  
  1291. Trigger    This event cannot be generated by any action. Use it to connect link commands that are triggered (or executed) by link commands. Use the link command TRIGGER to generate this event.
  1292.  
  1293. Some link events that trigger link commands are available only for specific controls. The following table describes link events for edit boxes, scroll bars, combo boxes, and timer controls.
  1294.  
  1295. Control    Link event and purpose
  1296.  
  1297. Edit box    Enter-executes when ENTER is pressed.
  1298.  
  1299. Scroll bars    Lineup-permits you to increase the value of the scroll bar by clicking a scroll arrow
  1300.  
  1301.     Linedown-permits you to decrease the value of the scroll bar by clicking a scroll arrow 
  1302.  
  1303.     Pageup-permits you to increase the scroll bar's value by clicking between a scroll arrow and the scroll box
  1304.  
  1305.     Pagedown-permits you to decrease the scroll bar's value by clicking it between a scroll arrow and the scroll box
  1306.  
  1307.     Thumb-lets you click or drag the scroll bar's scroll box
  1308.  
  1309. Combo box    Editdynamic-lets you insert or delete characters in the combo box's edit box
  1310.  
  1311. Timer control    Alarm-executes when the specified time has been reached
  1312.  
  1313.     Timer-executes when the specified amount of time has elapsed
  1314.  
  1315. Outline of control-specific properties
  1316.  
  1317. You can assign properties to a control by right-clicking it, and clicking Properties. The commands on the Properties menu listed before Dimension are specific to that control. All the properties from Dimension to the end of the menu are properties you can set for all controls. The procedure for assigning these properties differs from control to control. The following list identifies control-specific properties.
  1318.  
  1319. For more information about specific controls, see "Adding dialog box controls."
  1320.  
  1321. Bitmap button properties
  1322.  
  1323. You can select a bitmap image from the systems list or display a bitmap image you have available from another source by using the Bitmap properties dialog box. You can also assign a bitmap button a behavioral identity from the Button type properties.
  1324.  
  1325. Push button properties
  1326.  
  1327. A push button can also imitate the behavior of an OK button or a Cancel button, allowing the button to close the dialog box.
  1328.  
  1329. Check box properties
  1330.  
  1331. You have the option of displaying a check box label to the left of a check box in addition to the default display (which displays the label on the right side.)
  1332.  
  1333. Combo box properties
  1334.  
  1335. One of the variations possible is to configure the combo box to prevent you from entering a value into the list. By default, combo box entries are sorted alphanumerically in ascending order. A combo box can also be set to display a history as the list of the combo box.
  1336.  
  1337. Label control properties
  1338.  
  1339. You can use the default font in a label control, or you can change the label font through the Label font properties. You can also change the word wrap features of the label and position of the text on the label.
  1340.  
  1341. Edit box properties
  1342.  
  1343. The input data can be characters, numbers, cell addresses, or you can make the typed data hidden. When you specify Integer as the field type, the control is renamed to Edit Integer. Default values for Edit Integer are 0 as the minimum value, 32,676 as the maximum value, and 0 as the initial (default) value in the edit box. You can configure the edit box to accept special characters, using the following chart for characters available:
  1344.  
  1345. Special character    Result
  1346.  
  1347. \n    Displays the following text on a new line
  1348.  
  1349. \t    Inserts a tab
  1350.  
  1351. \\    Inserts a backslash (\) into the text
  1352.  
  1353. You can set an edit box so that you can double-click the edit box, and point to a cell or cell block on a spreadsheet to add the cell references to the edit box.
  1354.  
  1355. File control properties
  1356.  
  1357. You can display a predefined list in the File list control. When you click the Browse button, the Quattro Pro open file dialog box displays. If the Dialog type property is set to Save, the Quattro Pro save file dialog displays. You can also prevent users from typing in the box.
  1358.  
  1359. Group box properties
  1360.  
  1361. When a group box contains radio buttons, its value is the title of the radio button chosen. By default, an empty group box does not have a value. A group box has a Value property and a Selected property. The Selected property indicates numerically which of its radio buttons is enabled, starting from the top-left radio button (zero) and proceeding to the bottom-right button.
  1362.  
  1363. When you create a group box, the Process value of a group box is set to Yes. The Process value of radio buttons in the group box are set to No.
  1364.  
  1365. Scroll bar properties
  1366.  
  1367. You can configure a scroll bar by setting parameters and changing the settings.
  1368.  
  1369. List box properties
  1370.  
  1371. You can use a predefined list or assign data in a cell block as the list in a list box. By default, the list displays with one column, but you can add more columns to a list box. By default, lists display in alphanumeric order.
  1372.  
  1373. Radio button properties
  1374.  
  1375. You can change the label of a radio button, as well as display the label on either the right (default) or left sides of the radio button.
  1376.  
  1377. Rectangle control properties
  1378.  
  1379. You can customize the appearance of the rectangle through the Rectangle control properties. The Transparent rectangle style is useful for grouping controls together without displaying the rectangle to which they are attached. The background color and the border color around the rectangle can also be customized.
  1380.  
  1381. Spin control properties
  1382.  
  1383. You can assign a range of values to a spin control through the spin control properties. You can also change the number of digits allowed to display by adjusting the integer length (the default length is 6).
  1384.  
  1385. Tab control properties
  1386.  
  1387. Once you add a tab control to a dialog box, you can then create multiple tabs (or pages) to help organize the dialog box controls. The Active page property indicates which tab is active. The Page list property displays commands for creating, removing, and reordering tabs.
  1388.  
  1389. Timer control properties
  1390.  
  1391. There are two ways to configure a timer control for generating regular events: as a timer or as an alarm.
  1392.  
  1393. A timer generates the timer event at regular intervals (for example, every two seconds). A timer control shows the current time. You can also use a timer control to run link commands at regular intervals or at a certain time. You can use timer controls to display the current time in a dialog box or on a toolbar. Timer controls do not have a value.
  1394.  
  1395. Two properties of the timer control are used to specify the number of milliseconds to wait between timer events, as shown in the following formula: Wait = Units in Milliseconds X Interval in Units
  1396.  
  1397. Units in Milliseconds is set to 1000 by default, so you can use the Interval in units property to specify how many seconds to wait between timer events.
  1398.  
  1399. As an alarm, the timer control generates the alarm event at a certain time. The toolbar must be open; for example, an alarm set for 3:00 will not generate an alarm event if the toolbar is not on screen at 3:00.
  1400.  
  1401. Example of using macros to display a dialog box
  1402.  
  1403. First, set up an area in the notebook that will send default settings to the dialog box. For example, in the following table for a loan payment dialog box, B1..B5 is a block that defines the initial dialog box settings:
  1404.  
  1405. A    B
  1406.  
  1407. 1. Pay_Every    Month
  1408.  
  1409. 2. Loan_Amount    100000
  1410.  
  1411. 3. Int_Rate    12.5
  1412.  
  1413. 4. Term    30
  1414.  
  1415. 5. End_Of_Period    No
  1416.  
  1417. This sets the default payment period to monthly, the default loan amount at 100,000, the default interest rate at 12.5%, the default term at 30 years, and the payment date at the start of the month.
  1418.  
  1419. After the initial dialog box settings have been entered in the notebook, you can enter a macro command that will display the dialog box and send the choices back to the notebook. Use the {DODIALOG} command to do this.
  1420.  
  1421. Each cell in the block (starting at the upper-left cell and proceeding row by row to the lower-right cell) sets the initial value of one control. If the dialog box is cancelled, the values in this block remain unchanged.
  1422.  
  1423. Here is an example of a {DODIALOG} macro command used to display a loan payment dialog box using the initial settings in B1..B5: {DODIALOG LoanData,B6,B1..B5,1}
  1424.  
  1425. This command displays the dialog box and sends (or passes) the initial values in cells B1 through B5 to the dialog box controls. If the dialog box is cancelled, it also sends a value of 0 to cell B6 ; otherwise, the value is 1. The final argument of the command specifies that you can manipulate the dialog box.
  1426.  
  1427. For example, if a dialog box has six controls, but you have set the Process value property of the third control to No, the setting block should be only five cells long. The values in the first two cells will be passed to the first two controls. However, the value in the third cell will go to the fourth control, and the values in the fourth and fifth cells will go to the fifth and sixth controls, respectively.
  1428.  
  1429. Setting the Process value property to Yes lets the {DODIALOG} macro command access the control's value. The Process value property is available for many dialog box controls.
  1430.  
  1431. By default, the order in which you created controls is the order that the {DODIALOG} command sets initial values in a dialog box. The first control you created is sent the first value from the {DODIALOG} command, regardless of its position in the dialog box.
  1432.  
  1433. You can make this dialog box dynamic by adding link commands to each control so that the changes are immediately reflected in the notebook. For more information about using link commands, see "Attaching actions to dialog box controls."
  1434.  
  1435.  
  1436.  
  1437.  
  1438.