{"id":2214,"date":"2021-03-24T19:36:00","date_gmt":"2021-03-24T23:36:00","guid":{"rendered":"https:\/\/anvil-of-time.com\/?p=2214"},"modified":"2021-03-24T14:10:17","modified_gmt":"2021-03-24T18:10:17","slug":"100-days-of-powerbuilder-tutorial-day-6-adding-controls-to-a-form","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/100-days-of-powerbuilder-tutorial-day-6-adding-controls-to-a-form\/","title":{"rendered":"100 Days of PowerBuilder &#8211; Tutorial &#8211; Day 6 &#8211; Adding Controls to a Form"},"content":{"rendered":"\n<p>This is part of my project &#8216;100 Days of PowerBuilder&#8217; which is a series of discussions focused on basic PowerBuilder development.<\/p>\n\n\n\n<p><em>Note: This article is written with examples created in PowerBuilder 2019 R3. Most steps\/examples will be identical with any version going back to 9.<\/em><\/p>\n\n\n\n<p>Lets add some additional controls to our main form and check out some of the functionality of the PowerBuilder IDE. Once you have opened the main window object, choose Insert &#8211; Control from the menu.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-001.png\"><img loading=\"lazy\" width=\"592\" height=\"545\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-001.png\" alt=\"\" class=\"wp-image-2217\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-001.png 592w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-001-300x276.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-001-150x138.png 150w\" sizes=\"(max-width: 592px) 100vw, 592px\" \/><\/a><\/figure>\n\n\n\n<p>Now I&#8217;m sure there is some sort of organizational structure behind how the entries here are listed but I haven&#8217;t taken the time to figure it out. \u00a0You can also click on the down arrow icon next to the control icon on the toolbar.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-002.png\"><img loading=\"lazy\" width=\"122\" height=\"226\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-002.png\" alt=\"\" class=\"wp-image-2218\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-002.png 122w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-002-81x150.png 81w\" sizes=\"(max-width: 122px) 100vw, 122px\" \/><\/a><\/figure>\n\n\n\n<p>The icons within the red rectangle are the controls you can choose from. \u00a0Like many places in the IDE, the toolbar icon will take on the image from the last control chosen. \u00a0Each of the controls is assigned a default name when it is placed on the form. \u00a0The name consists of a defalt prefix and a sequence number. \u00a0You can control the prefix from within the Options dialog (menu option &#8216;Design &#8211; Options&#8217;). \u00a0When opening this dialog you are brought to the &#8216;General&#8217; tab.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial002a.png\"><img loading=\"lazy\" width=\"955\" height=\"226\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial002a.png\" alt=\"\" class=\"wp-image-2220\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial002a.png 955w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial002a-300x71.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial002a-768x182.png 768w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial002a-150x35.png 150w\" sizes=\"(max-width: 955px) 100vw, 955px\" \/><\/a><\/figure>\n\n\n\n<p>Here you can control the alignment grid (which appears on the window control) and whether controls default to a &#8216;3D&#8217; appearance.<\/p>\n\n\n\n<p>The prefixes are found on the next two tabs.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-003.png\"><img loading=\"lazy\" width=\"959\" height=\"712\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-003.png\" alt=\"\" class=\"wp-image-2219\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-003.png 959w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-003-300x223.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-003-768x570.png 768w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-003-150x111.png 150w\" sizes=\"(max-width: 959px) 100vw, 959px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-005.png\"><img loading=\"lazy\" width=\"954\" height=\"436\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-005.png\" alt=\"\" class=\"wp-image-2221\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-005.png 954w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-005-300x137.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-005-768x351.png 768w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-005-150x69.png 150w\" sizes=\"(max-width: 954px) 100vw, 954px\" \/><\/a><\/figure>\n\n\n\n<p>You can change these as you wish but each control must have a unique name when placed on a form within the IDE.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-006.png\"><img loading=\"lazy\" width=\"951\" height=\"274\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-006.png\" alt=\"\" class=\"wp-image-2222\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-006.png 951w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-006-300x86.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-006-768x221.png 768w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-006-150x43.png 150w\" sizes=\"(max-width: 951px) 100vw, 951px\" \/><\/a><\/figure>\n\n\n\n<p>The Script tab defines some script editor behavior (auto indent, dashes) and controls what type of messages appear when the script is compiled (when saved or when you leave the particular script). The Event and Function List Order controls how these lists appear in the editor.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-007.png\"><img loading=\"lazy\" width=\"950\" height=\"705\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-007.png\" alt=\"\" class=\"wp-image-2224\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-007.png 950w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-007-300x223.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-007-768x570.png 768w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-007-150x111.png 150w\" sizes=\"(max-width: 950px) 100vw, 950px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-020.png\"><img loading=\"lazy\" width=\"959\" height=\"678\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-020.png\" alt=\"\" class=\"wp-image-2225\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-020.png 959w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-020-300x212.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-020-768x543.png 768w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-020-150x106.png 150w\" sizes=\"(max-width: 959px) 100vw, 959px\" \/><\/a><\/figure>\n\n\n\n<p>These tabs control the fonts within the script editor and when you choose to print out a script or control. Obviously some are more appropriate than others and are affected by the screen resolution of your monitor.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-008.png\"><img loading=\"lazy\" width=\"820\" height=\"676\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-008.png\" alt=\"\" class=\"wp-image-2223\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-008.png 820w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-008-300x247.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-008-768x633.png 768w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-008-150x124.png 150w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><\/figure>\n\n\n\n<p>Coloring refers to how various statements, keywords, and etc. appear in the editor.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-018.png\"><img loading=\"lazy\" width=\"955\" height=\"674\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-018.png\" alt=\"\" class=\"wp-image-2226\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-018.png 955w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-018-300x212.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-018-768x542.png 768w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-018-150x106.png 150w\" sizes=\"(max-width: 955px) 100vw, 955px\" \/><\/a><\/figure>\n\n\n\n<p>AutoScript is similar to Microsoft&#8217;s Intellisense where the IDE &#8216;guesses&#8217; at what you are doing based on what you type in. You will need ot experiment with this to get the optimal settings for your style of programming.<\/p>\n\n\n\n<p>So now select a SingleLineEdit (SLE) control to drop on your form.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-032.png\"><img loading=\"lazy\" width=\"444\" height=\"219\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-032.png\" alt=\"\" class=\"wp-image-2228\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-032.png 444w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-032-300x148.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-032-150x74.png 150w\" sizes=\"(max-width: 444px) 100vw, 444px\" \/><\/a><\/figure>\n\n\n\n<p>Drop a couple more for a total of three.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-033.png\"><img loading=\"lazy\" width=\"276\" height=\"319\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-033.png\" alt=\"\" class=\"wp-image-2229\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-033.png 276w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-033-260x300.png 260w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-033-130x150.png 130w\" sizes=\"(max-width: 276px) 100vw, 276px\" \/><\/a><\/figure>\n\n\n\n<p>The last control is &#8216;selected&#8217; since it has four &#8216;handles&#8217; in its corners. When an object is selected the Properties window shows information about it. Each type of object will have differing properties.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-034.png\"><img loading=\"lazy\" width=\"342\" height=\"568\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-034.png\" alt=\"\" class=\"wp-image-2230\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-034.png 342w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-034-181x300.png 181w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-034-90x150.png 90w\" sizes=\"(max-width: 342px) 100vw, 342px\" \/><\/a><\/figure>\n\n\n\n<p>The Font tab is used to set typeface related properties of the control. Note that if you change the TextSize the size of the control does not change; you will have to adjust it yourself.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-035.png\"><img loading=\"lazy\" width=\"351\" height=\"510\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-035.png\" alt=\"\" class=\"wp-image-2231\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-035.png 351w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-035-206x300.png 206w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-035-103x150.png 103w\" sizes=\"(max-width: 351px) 100vw, 351px\" \/><\/a><\/figure>\n\n\n\n<p>The Other tab in this case is primarily used for positional changes. Note that (nearly) all properties of controls can be manipulated from within the code of the application.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-036.png\"><img loading=\"lazy\" width=\"352\" height=\"563\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-036.png\" alt=\"\" class=\"wp-image-2233\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-036.png 352w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-036-188x300.png 188w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-036-94x150.png 94w\" sizes=\"(max-width: 352px) 100vw, 352px\" \/><\/a><\/figure>\n\n\n\n<p>Here&#8217;s a trick to saving time when placing a like number of controls on a form. If you want to change the Font, Color, Height, etc. of a control from the defaults PB gives you when you drop it on the form, change a single copy first, select it, choose the same type of control from the menu, and then drop it on the form. The new control will have some of the same properties already assigned to the one you had selected prior to dropping it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-053.png\"><img loading=\"lazy\" width=\"511\" height=\"378\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-053.png\" alt=\"\" class=\"wp-image-2234\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-053.png 511w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-053-300x222.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/Day6tutorial-053-150x111.png 150w\" sizes=\"(max-width: 511px) 100vw, 511px\" \/><\/a><\/figure>\n\n\n\n<p>You can also achieve this by right clicking on a control and then choosing &#8216;duplicate&#8217; from the options menu.<\/p>\n\n\n\n<p>Manipulating Control Groups<\/p>\n\n\n\n<p>You can select multiple controls and manipulate them as a group should you so desire. Simply hold the Control key and click each control. If you selected one too many simply Control click to unselect it. Once a group of controls is selected, the Properties window shows common elements amongst the group. If all items in a group are of the same type, all the properties are available. If multiple controls are selected (say, SingleLineEdit and CommandButton) then a smaller subset of properties are available.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial001.png\"><img loading=\"lazy\" width=\"276\" height=\"468\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial001.png\" alt=\"\" class=\"wp-image-2236\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial001.png 276w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial001-177x300.png 177w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial001-88x150.png 88w\" sizes=\"(max-width: 276px) 100vw, 276px\" \/><\/a><\/figure>\n\n\n\n<p>Group Selected Properties (all Single Line Edit controls)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial002.png\"><img loading=\"lazy\" width=\"296\" height=\"226\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial002.png\" alt=\"\" class=\"wp-image-2237\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial002.png 296w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial002-150x115.png 150w\" sizes=\"(max-width: 296px) 100vw, 296px\" \/><\/a><\/figure>\n\n\n\n<p>Group Selected Properties for SingleLineEdit and CommandButton<\/p>\n\n\n\n<p>You can resize and position object groups by using the Positioning drop down toolbar<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial003.png\"><img loading=\"lazy\" width=\"63\" height=\"169\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial003.png\" alt=\"\" class=\"wp-image-2238\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial003.png 63w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial003-56x150.png 56w\" sizes=\"(max-width: 63px) 100vw, 63px\" \/><\/a><\/figure>\n\n\n\n<p>Remember that the first control selected in the group serves as the &#8216;master&#8217;; changing position and size will all be relative to the master control. In the case of spacing between objects the first two selected serve as the the &#8216;master&#8217;.<\/p>\n\n\n\n<p>Now we have the fields sized and aligned. When designing a form it&#8217;s always important to designate the &#8216;focus flow&#8217;. By this I mean the order in which the controls gain focus as the user tabs through the form. This is set by the Tab Order property and can be displayed from the toolbar icon or menu option.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial004.png\"><img loading=\"lazy\" width=\"354\" height=\"132\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial004.png\" alt=\"\" class=\"wp-image-2239\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial004.png 354w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial004-300x112.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial004-150x56.png 150w\" sizes=\"(max-width: 354px) 100vw, 354px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial005.png\"><img loading=\"lazy\" width=\"347\" height=\"235\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial005.png\" alt=\"\" class=\"wp-image-2240\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial005.png 347w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial005-300x203.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial005-150x102.png 150w\" sizes=\"(max-width: 347px) 100vw, 347px\" \/><\/a><\/figure>\n\n\n\n<p>The tab order icon (or menu) acts as a &#8216;toggle&#8217; into &#8216;tab setting mode&#8217; which basically means you can&#8217;t do anything other than set the tab order until you toggle back out.<\/p>\n\n\n\n<p>In the case of the form I&#8217;ve set up, my tab order is slightly off. The tab stops themselves are displayed in the upper left corner of the control (in red). The actual order on the form is hightlighted by the arrows which have been added to show the actual flow; not the most intuitive.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial006.png\"><img loading=\"lazy\" width=\"447\" height=\"324\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial006.png\" alt=\"\" class=\"wp-image-2241\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial006.png 447w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial006-300x217.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial006-150x109.png 150w\" sizes=\"(max-width: 447px) 100vw, 447px\" \/><\/a><\/figure>\n\n\n\n<p>Clicking on the number of a specified tab order allows it to be changed. To &#8216;insert&#8217; a control between others on a form, simply use a number between the tab numbers of the controls. Once you toggle out of tab order the tab numbers themselves are recalculated into multiples of ten.<\/p>\n\n\n\n<p>Setting the tab order of the Exit button so it is last.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial007.png\"><img loading=\"lazy\" width=\"162\" height=\"96\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial007.png\" alt=\"\" class=\"wp-image-2242\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial007.png 162w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial007-150x89.png 150w\" sizes=\"(max-width: 162px) 100vw, 162px\" \/><\/a><\/figure>\n\n\n\n<p>Now if you run the application, the window opens and focus is set on the first SLE field. Pressing the tab key moves the focus to the subsequent fields and then the Exit button before starting over again at the initial field.<\/p>\n\n\n\n<p>Let&#8217;s put some functionality behind the SLE fields. Right Click on the first SLE and choose Script<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial008.png\"><img loading=\"lazy\" width=\"344\" height=\"128\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial008.png\" alt=\"\" class=\"wp-image-2243\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial008.png 344w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial008-300x112.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial008-150x56.png 150w\" sizes=\"(max-width: 344px) 100vw, 344px\" \/><\/a><\/figure>\n\n\n\n<p>This takes you into the Powerscript Editor for the Event methods of the control. Clicking on the down arrow as shown will list all of the events for this particular control. The script currently in &#8216;edit&#8217; mode is highlighted.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial009.png\"><img loading=\"lazy\" width=\"513\" height=\"290\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial009.png\" alt=\"\" class=\"wp-image-2244\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial009.png 513w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial009-300x170.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial009-150x85.png 150w\" sizes=\"(max-width: 513px) 100vw, 513px\" \/><\/a><\/figure>\n\n\n\n<p>In this case the &#8216;modified&#8217; event is in edit mode. In this event script we will place code to change the background color of the field to indicate that it&#8217;s contents have been changed. The following will do this: <strong>Backcolor = RGB(255,255,0)<\/strong>. RGB is a system function which calculates the long value of a color based on it&#8217;s red, green, and blue component values (integers from 0 to 255). In this case we are changing the value to yellow.<\/p>\n\n\n\n<p>Now run the application, change the the contents of the first SLE, and then tab out of the field.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial010.png\"><img loading=\"lazy\" width=\"435\" height=\"284\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial010.png\" alt=\"\" class=\"wp-image-2245\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial010.png 435w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial010-300x196.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2021\/03\/D6tutorial010-150x98.png 150w\" sizes=\"(max-width: 435px) 100vw, 435px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This is part of my project &#8216;100 Days of PowerBuilder&#8217; which is a series of discussions focused on basic PowerBuilder development. Note: This article is written with examples created in PowerBuilder 2019 R3. Most steps\/examples will be identical with any version going back to 9. Lets add some additional controls to our main form and&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[86,3],"tags":[62],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/2214"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=2214"}],"version-history":[{"count":4,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/2214\/revisions"}],"predecessor-version":[{"id":2246,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/2214\/revisions\/2246"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=2214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=2214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=2214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}