Print Page | Close Window

how to use the CXTPTablControl

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=900
Printed Date: 14 May 2024 at 2:11pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how to use the CXTPTablControl
Posted By: henryzc
Subject: how to use the CXTPTablControl
Date 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



Replies:
Posted By: ICBM
Date Posted: 04 July 2004 at 10:56pm
Isn't there a TabControl sample application ? I'm sure there is...


Posted By: garand
Date 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.


Posted By: ddyer
Date Posted: 16 July 2004 at 7:07am

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



Posted By: garand
Date 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?



Posted By: ddyer
Date 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.

 



Posted By: garand
Date 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?

 

 



Posted By: ddyer
Date 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) .



Posted By: garand
Date 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).


Posted By: ddyer
Date 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.

 

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net