Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - how to use the CXTPTablControl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to use the CXTPTablControl

 Post Reply Post Reply
Author
Message
henryzc View Drop Down
Newbie
Newbie


Joined: 29 June 2004
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote henryzc Quote  Post ReplyReply Direct Link To This Post Topic: how to use the CXTPTablControl
    Posted: 30 June 2004 at 12:07am
i just want to use this control in my dialog application,but how?is there anyone can help me?thanks
Back to Top
ICBM View Drop Down
Groupie
Groupie


Joined: 15 January 2004
Location: New Zealand
Status: Offline
Points: 57
Post Options Post Options   Thanks (0) Thanks(0)   Quote ICBM Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2004 at 10:56pm
Isn't there a TabControl sample application ? I'm sure there is...
Back to Top
garand View Drop Down
Newbie
Newbie


Joined: 11 May 2004
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote garand Quote  Post ReplyReply Direct Link To This Post Posted: 15 July 2004 at 9:12pm
Hmmm.. doesn't look like the CodeJock people are monitoring this forum.  I would also like to know about the CXTPTabControl.  There is a class for it but it is barely documented and the samples all seem to be for the CXTTabControl (not the pro, but the old one).  I am going to dig into it on my own, but the lack of info doesn't fill me with confidence.
Back to Top
ddyer View Drop Down
Groupie
Groupie
Avatar

Joined: 01 December 2003
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddyer Quote  Post ReplyReply Direct Link To This Post Posted: 16 July 2004 at 7:07am

I use it (CXTPTabControl) extensively.  What do you want to know?



Edited by ddyer
Back to Top
garand View Drop Down
Newbie
Newbie


Joined: 11 May 2004
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote garand Quote  Post ReplyReply Direct Link To This Post Posted: 16 July 2004 at 12:24pm

Basically, I just want to know... can I just derive a class from CXTPTabControl and use it just like CXTTabControl or any other tab control?  Or more directly -- is there some other base class that I use?

 

Can I give it the Excel/OneNote/.NET look with or without OneNote colors?

Back to Top
ddyer View Drop Down
Groupie
Groupie
Avatar

Joined: 01 December 2003
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddyer Quote  Post ReplyReply Direct Link To This Post Posted: 16 July 2004 at 2:11pm

I derived a class from CXTPTabControl and while the APIs don't line up, it is very similar.  You add a view to create a tab, etc.  Don't forget you have to manually delete views if you remove them from a tab.   Get to know CXTPTabManagerItem very well.  You will walk and manipulate the CXTPTabControl's tabs as elements of CXTPTabManagerItem's. 

Familiar APIs include:

InsertItem
SetSelectedItem
GetSelectedItem
EnsureVisible
DeleteItem //deletes the tab but your view object will still be alive, just invisible.

I never was able to roll in CXTPTabClientWnd's sexy tab groups because it is tightly intertwined with MDI and CXTPMDIFrameWnd, and Im an SDI-based app.  If you are able to include tab groups, please post.

 

Back to Top
garand View Drop Down
Newbie
Newbie


Joined: 11 May 2004
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote garand Quote  Post ReplyReply Direct Link To This Post Posted: 16 July 2004 at 2:16pm

I got the CXTPTabConrol to work as a stand-alone tab control -- even with the fancy colors and Excel/Visual Studio/OneNote appearance.  However I can't figure out how to get my parent window to be notified when the tab selection changes.  It seems to  send a WM_NOTIFY but I can figure out what is in the wParam and lParam values are.  Any help?

 

 

Back to Top
ddyer View Drop Down
Groupie
Groupie
Avatar

Joined: 01 December 2003
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddyer Quote  Post ReplyReply Direct Link To This Post Posted: 16 July 2004 at 2:37pm

Im sure there is more than one way to do that, but in my subclass, I overrode "OnItemClick", which is called whenever a tab is clicked.

My method of course then does any specific noficiations. I also override OnNavigateButtonClick to catch the user closing a tab (check out XTP_TABMANAGER_BUTON_CLOSE) .

Back to Top
garand View Drop Down
Newbie
Newbie


Joined: 11 May 2004
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote garand Quote  Post ReplyReply Direct Link To This Post Posted: 16 July 2004 at 9:11pm
Thanks, that works.  Just one more question -- How do I refresh the tab control after I change appearance attributes.  Calling InvalidateRect or Redraw doesn't work quite right (the tabs are out of alignment).
Back to Top
ddyer View Drop Down
Groupie
Groupie
Avatar

Joined: 01 December 2003
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddyer Quote  Post ReplyReply Direct Link To This Post Posted: 19 July 2004 at 6:48am

You mean appearance attributes of the view the tab manages or the actual tabs themselves? Your redraw/invalidaterect calls may only be affecting the small rectangle that holds the tabs themselves.

To change attributes of the tabs, I stick with the APIs (SetCaption(), SetTooltip(), etc).  If you are having a hard time getting an effect, try a sledge hammer and see what happens:

MyTabManager->GetParent()->Invalidate();

I went back and looked at the view code for the views I assign to the tabs and don't bother with any redraws or invalidates.

 

 

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.344 seconds.