[Migrated content. Thread originally posted on 09 November 2004]
Is it just me? Shouldn't the tab control be simpler to implement? It's bothered me for a while, but since I've only used it on occasion I've just lived with it. Now that I'm using it more, it just seems like it could be easiar.For instance, shouldn't each tab page automatically act as a virtual container for a group of controls that display on it without extra coding for controlling group section visibilty in an event handler?
It seems like the screen section could accomplish this by optionally allowing a group item(a group of controls) to be referenced in the TAB-TO-ADD property of a Tab control. Then, the DISPLAY statement could automatically(no need for event coding) control visibility of controls on tab pages based upon which tab was active.
For instance,
01 TAB-FORM.
03 MY-TAB, TAB-CONTROL
COL 10 PIXELS
LINE 10 PIXELS
LINES 200 PIXELS
SIZE 200 PIXELS
TAB-TO-ADD IS (TAB-PAGE-1, TAB-PAGE-2)
EVENT PROCEDURE TAB-EVENT
VALUE WS-ACTIVE-PAGE.
03 TAB-PAGE-1.
05 LABEL
COL 30 PIXELS
LINE 50 PIXELS
TITLE "This is page 1"
LEFT.
03 TAB-PAGE-2.
05 LABEL
COL 30 PIXELS
LINE 50 PIXELS
TITLE "This is page 2"
LEFT.
In this example, when DISPLAY TAB-FORM statement executes, only the controls on TAB-PAGE-1 would be visible. TAB-PAGE-2 controls remain invisible until CMD-TABCHANGED occurs to activate it(without need for event handler code) and then TAB-PAGE-1 controls become invisibile.
Yes, I know, I did not specify a title for the tabs. Maybe a new property like TAB-TITLES = ("Tab1", "Tab2") or something?
But does any of this make sense, would it be helpful to anyone?