Introduction to PowerBuilder
Tab Control
Tab control allows you to paint
"organizer" like user interface. Did you observe that you have been using
tab control? The properties dialogbox of any control uses tab control. Tab control is new
to version 5.0, till then programmers were simulating tab control with the help of User
Objects. We can skip the tedious programming techniques.
Place a tab control on the window. By
default it has one page. To insert more pages, click with the right mouse-button and
select "Insert Page" option. Invoking popup menu by clicking in the free area
next to page name ( Area 1 in the picture) allows you to select properties for the tab
control. If you invoke popup menu by clicking in the area below the page name (Area 2), it
allows you to specify properties for the page. , First let us see the properties.
"PowerTips": By
turning on the "PowerTips" property, you can display PowerTips for the page
names, similar to the PowerTips for the toolbar
icons.
"Fixed Width": By
default, the tab size automatically adjusts to the width of the tab page name. That means,
the area that displays the tab page name may be longer and sometimes shorter, depending on
the length of the tab page name. To make all tag page's tab to have the same width turn on
"Fixed Width" property. In this case, the tab page's tab width is
decided by the longest tab page text.
"FocusOnButtonDown":
This property is similar to "FocusRectangle" property of other controls. Turning on this option would
display a dotted rectangle line around the tab page name whenever user clicks on the tab
page and brings the tab page to the front.
"ShowText", "ShowPicture" Properties:
In a given situation if you don't want to display the tab page text (We don't see any
need), just turn off "ShowText" property. While this property is off, tab page text will
not displayed even if the tab page has some text. Similar to the menu object, you can
assign a picture to each tab page. Similar to the "ShowText"
property, you can turn on/off "ShowPicture" property.
"PerpendicularText":
By default, a tab page name is displayed horizontally. If a need arises, the name can be
displayed vertically . This can be done by turning on the "PerpendicularText" property. Similarly you can display text in multiple lines
by turning on "MultipleLines" property".
"RaggedRight":
Turning on the "RaggedRight" property stretches the right most page's name display area
till the edge. To test this, insert two more tab pages by selecting "InsertPage" from the popup menu. Turn this property on and off and see how it works.
"BoldSelectedText" property, as the name suggests makes the selected tab
page's text bold.
In cases where there are more tab pages
than the number of tab pages that can fit in the display area, PowerBuilder automatically
displays scrollbar icons. The position of the icon depends
on the "TabPosition" property. "TabPosition" property gives a wide choice of area to display the tab
page text.
Once the tab control is painted, you may
want to rearrange the tab pages. This can be done by dragging and rearranging in the
"PageOrder" tab in the dialog box.
Wondering where to define picture name,
text for PowerTip, etc.; double-click on the page itself (area-2). You can define name for
each tab page, text and picture for the tab page in this dialogbox.
|