You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Yes but the controls parents remain on the window and not the tabcontrol.
And just move them into sight (z-order etc)
That was my point for confirmation..
You must have lost your mind? Let me see if I can help you out...
And tomorrow, I want you to visit your doctor, becasue I'm very concerned now.
Tab control... (parented by your main window/dialog)
Child window 1, parented by your window/dialog, not the tab control
Child window 2, ditto
Child window 3, ditto
All the controls are on child window/dialog, you have no choice. The Tab ctl sends notifications to your main window/dialog, you take action, show/hide child window/dialogs.
...this part I know you underdstand well enough!
The bounding area of the tab control, below the actual tabs is not a window, it is only painted on the main window/dialog to tramatize you.... this is the part that confuses many.
And I was only kidding about losing your mind and seeing a doctor...
I do the same for years but i thought this was the easiest (but i may have looked that up in those days and came to same conclusion but hey.. that was all before the previous weekend.. hips!)
I believe some programmers actually create controls upon the tab control
Indeed Tab control (like menu bar items) are nothing else than buttons (i mean kind of), and it is up to you to take the appropriate action to show/hide the child controls belonging to the same group. But of course easier to have a container as the parent of the child controls, then just hide/show the parent instead of each of the individual child.
I just do CreateWindowEx to create a screen with the required controls, and make that 'hwnd' a child of the main screen. The tab control is as Patrice says, something the user can click on to tell me which set of controls he wants to see right now.
>I do the same for years but i thought this was the easiest<
Probably from the VB days, ...you can place controls right on the TABs at design time.
This is why I made QTAB for PB, putting the visual back into visual design.
When you think about it, it does make logical sense that to have your controls grouped together in a child container, just imagine if you had 10 controls per tab and 5 tabs--lots of individual Ctl_show & hide, also, makes it nice to have individual callbacks...
The controls MUST be on a child dialog if you are using themes, otherwise the frame and label, and possibly other controls' colors will be off (grey on white when using XP's 'Luna' theme). On a child dialog that has EnableThemeDialogTexture applied, the control colors are correctly blended with the tab control background.
No worries, what i meant was that i already created te controls outside the tab area (on a childwindow) and just make it visible and put it on front on demand.
In using PB Forms and the Tab Control, I first place the controls for tab 0, test and then move them to wm_initdialog, repeating the same for each tab. Any controls needing to stay on the tab regardless of which tab is clicked I leave in the area dialog new/dialog show modal. Initially I create all fields in wm_initdialog including and sublcass code and immediatley %SW_HIDE anything not on the first tab.
In WM_NOTIFY on a tabhit I hide what shouldn't be there for that tab and show what should be. The TCN_SELCHANGE and TCN_SELCHANGING can be used to remove the current fields with %SW_HIDE and then the new fields with %SW_SHOW. I don't see why they need to be on a child dialog unless you want the callbacks segregated into one dialog call back per tab. Seems like more work to me.
The gradient stuff and resizing stuff make the tab control really a nice way to handle a lot of fields.
If controls are created with a consecutive range of control ids per tab, it's pretty simple to hide whole screens with 2 or 3 lines of code.
BOB MECHLER
Last edited by BOB MECHLER; 8 Mar 2008, 12:35 PM.
Reason: TYPO
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment