Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTTabCtrl and CXTResizeFormView
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTTabCtrl and CXTResizeFormView

 Post Reply Post Reply
Author
Message
Martin View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2005
Location: Netherlands
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Martin Quote  Post ReplyReply Direct Link To This Post Topic: CXTTabCtrl and CXTResizeFormView
    Posted: 08 July 2005 at 5:31am

Hello,

I have a couple of problems and general questions:

1. When creating tabs with the CXTTabCtrl and using the method AddView with CXTResizeFormView the last added tab is also the active tab. I want to make the first tab the active tab.

I tried this but it has a painting problem in my formview:

CWnd *pView = m_Tab.GetView(RUNTIME_CLASS(MyFormView));
if (pView){
m_Tab.ActivateView(pView);
m_Tab.SetCurSel(0); // Needed because somehow ActivateView doesn't change the tab index

::SetWindowPos(m_Tab.m_hWnd, NULL, 0,0,0,0, SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED);
m_Tab.Invalidate(FALSE);

}

Q: How can I set the first tab as active one AND make sure the tab gets painted correctly?

2. When I create a new dialog based on CFormView I can edit the properties of my dialogs, e.g. create a variable for a textbox of the type CEdit. When I subclass the dialog to use CXTResizeFormView instead of CFormView I cannot do this anymore.

Q: How can I somehow let the VIsual Studio know that CXTResizeFormView is in fact derived from CFormView so I can use the normal dialog handling? Now I have to first change all references to CXTResizeFormView back to CFormView before I can edit the variables.

Now some general questions:

1. Can I also use the method as outlined above to get a pointer to a view in the tabcontrol to access member variables and functions if I typecast them to my own formview class?

2. When I add a formview to my tabcontrol the dialog is created "sunken" which makes a rather terrible effect. How do I get rid of that "sunken" effect so the formview appears more as a part of the tabcontrol?

T.I.A,

Martin



Edited by Martin
Back to Top
Martin View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2005
Location: Netherlands
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Martin Quote  Post ReplyReply Direct Link To This Post Posted: 11 July 2005 at 4:46am

I somehow don't have the paint problem anymore when using the code outlined above. So hopefully this one is solved.

The other problems remain unfortunately.... (I am particularly interested in answers to these questions):

1. How can I somehow let the Visual Studio know that CXTResizeFormView is in fact derived from CFormView so I can use the normal dialog handling? Now I have to first change all references to CXTResizeFormView back to CFormView before I can edit the variables.

2. When I add a formview to my tabcontrol the dialog is created "sunken" which makes a rather terrible effect. How do I get rid of that "sunken" effect so the formview appears more as a part of the tabcontrol (and as a normal tab)?

Any help is greatly appreciated.

Thanks,
Martin

Back to Top
Martin View Drop Down
Newbie
Newbie
Avatar

Joined: 26 April 2005
Location: Netherlands
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Martin Quote  Post ReplyReply Direct Link To This Post Posted: 11 July 2005 at 6:49am

And to answer one of my questions myself (I asked it too soon, because I didn;t test it myself yet):

You can use this code to access the members of the formview:

CMyFormView *pView = (CMyFormView*)m_Tab.GetView(RUNTIME_CLASS(CMyFormView));

pView now holds a pointer to all the available members in the CMyFormView class.

Hope this is helpful to anyone.

 

 

 

 

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.031 seconds.