Link to home
Start Free TrialLog in
Avatar of tusawant
tusawant

asked on

Developer Studio type Tab controls/Property Sheets

How do we create the Developer Studio type (One in which the tab handles are at the bottom) inverted tab control/Property Sheets?
Avatar of mbhakta
mbhakta

To make tab control which don't work like the CTabCtrl the easiest of the ways is to make a ownerdrawn listbox. Override  the WM_DRAWITEM and WM_MEASUREITEM messages. A tab as a whole is nothing but a cute looking listbox. Every item is an element. It is as easy as making an horizontal listbox.
Avatar of tusawant

ASKER

That's a vague answer. Some concrete code would help. Thanks for the early reply.

I want the similar look and feel as the Developer Studio's Project Workspace. I want to put more than one tree controls similar to the Project Workspace (ones like classview, resourceview,fileview, infoview). I hope I am clear.
Thanks
A vague answer for a vaguer question.. The experts exchange is a discussion group to find answers to your questions. Experts here do their best to answer your issues. If possible (if we find some code in hand) we publish it on the page or mail it to you. Seldom you find people going out of their way to take someones trouble on their shoulders. My job is to guide you to achieve your goals with the easiest possible solution. And I think I have provided you with a pretty good hint. I suggest you find a way to use this hint and do it yourself as you will hardly find any code doing this on the MSDN (I didn't) or elsewhere.


If u have worked with ownerdrawn list boxes you won't have much trouble sorting this issue out. You have to make sure you have given enough height to each item in the listbox by overriding the WM_INSERTITEM. Now in your WM_drawitem mem function make sure you have drawn the tab control as it should look. This will require a bit of artistic touch to get the shading etc right. If you follow the necessary norms you should be up with this in a day or two.
Owner drawn list boxes is OK, but with it how do I use the tree controls?
ASKER CERTIFIED SOLUTION
Avatar of EHaimerl
EHaimerl

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I downloaded the stuff and the exe is fine.Though it is not the same as what I wanted (Same Look and Feel of Developer's studio) the functionalty is the same and hopfully the code will help. Please give me more references for the Project Workspace/ Infoviewer/ Class Viewer type tabs.
Thank U.
Tushar
I am not sure if I got your new question right?
If you have a look at TabViews MainFram.cpp you find

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
   m_splitterTabWnd.AddView( RUNTIME_CLASS( CTabView ),"View nr 1" );  
   m_splitterTabWnd.AddView( RUNTIME_CLASS( CviewTwo ),"View nr 2" );  
   m_splitterTabWnd.AddView( RUNTIME_CLASS( CTabView ),"View three is same as one" );  
   m_splitterTabWnd.Create( this, pContext );
   SetActiveView((CView *)m_splitterTabWnd.GetPane(0,0));
   return TRUE;
}

Here CTabView and CViewTwo are arbitrary example Views. Create any view you want (e.g. from CTreeView, CListView ...) and add it to splitterTabWnd.


More references?
Try weekly MFC extensions: http://www.periphere.com/. It looks fine, but I have not tested it myselfe and it's not free. It's a lot of stuff. Have a closer look at the MFC\samples on your MSVC CD, there a examples of TreeView, ListView ...


Hope that helps - feel free to come up with detailed questions.
Edgar