Re: WinLib32 and tab controls

new topic     » goto parent     » topic index » view thread      » older message » newer message

Mike777 wrote:
> 
> What is the proper method to open a window with a tab control and 4 tabs, and
> ensure that the controls for only the selected tab are visible?
> 
> I have a main window which has a menu item (Configure) which, when clicked:
> 
> setVisible(Window1,w32False)
> setVisible(ConfigureWindow,w32True)
> 
> On the Configure window I have four controls:
> 
> TabControl96
> cmdCancel
> cmdApply
> cmdSaveAndExit
> 
> When I select Configure from the main window, ConfigureWindow opens and
> TabControl96
> is visible.  However, the controls associated with all the tab items (tbiOne,
> tbiTwo, tbiThree) are *all* visible.
> 
> I have tried various combinations of making it work as one might expect, such
> as setting all of the subcontrol defaults to not visible and then making them
> visible when the tbiXXXX is clicked, but nothing works as I would expect.
> 
> What I'm looking for is to have the focus set to a specific page (tbiOne) and
> then to have only those controls which have tbiOne as a parent to be visible.
>  Then, when I click on the other tab items, to have the original tab item's
> controls disappear and the ones associated with the new tab show up.
> [Something
> tells me I didn't really need to type this last paragraph.]
> 
> Again, is there an accepted way of handling the UI on such a design?
> 
> Thanks
> 
> Mike

This had been a long standing bug in earlier versions of win32lib, but it is
corrected in v0.70.1 and later.
Normally, TabControl96 should be a child of ConfigureWindow, cmsCancel a son of
tbiOne and so forth, all of them visible. As a result, only the control on the
selected tab is visible. The tab last created is active by default. You can
change that by specifying an initial focus when you openDialog(ConfigureWindow),
or by creating last the item you want to see first (you can set the index of a
tabitem at the time you create it).
Still doesn't work?
Check the tabcontrol.exw demo, the last tab shows something which definitely
looks like yours, and on my machine I see only one button at a time.

CChris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu