Tabbed views within a splitter window

This article presents a class which can be used to create tabbed views within a splitter window. As a starting point, I used Daniel Harth's article about tabbed views within frame windows (SDI frame window or MDI child window).

Since splitter window dynamically creates a view object (based on RUNTIME_CLASS information), tabbed window is created in the same way. In order to perform the creation of all the views (tabs) within a tab window, this class contains a virtual function DoCreateView(...) which is called from within a Create() member function that actually creates a tab window. Default implementation of DoCreateView(...) function simply asserts since the actual creation of all the views is delegated to an overloaded function in the derived class.

Besides this technique, there are several other functions:

(1) virtual function called after the view (tab) is changed

(2) virtual function which is called to determine whether the switch to another view is allowed or not (by default it is allowed)

(3) function to change the label in runtime

(4) several informational function to get the pointer to the current view, get the current tab index, get the label etc.

Here is a pseudo code that shows how to use this class:

Declare a derived class specific to your project:


class TMyTab : public TVisualTabInSplitter 
{
protected:
 DECLARE_DYNCREATE(TMyTab)
public:
 virtual ~TMyTab();
 virtual void DoCreateView(CCreateContext *pContext);
};

Class implementation:

IMPLEMENT_DYNCREATE(TMyTab,TVisualTabInSplitter)

TMyTab::~TMyTab()
{
}

void TMyTab::DoCreateView(CCreateContext *pContext)
{
 CreateView(Page 1, RUNTIME_CLASS(CTreeView), pContext);
 CreateView(Page 2, RUNTIME_CLASS(CListView), pContext);
}

If you are creatng an SDI application, then use the following code as a sample:

BOOL DerivedFromCFrameWnd::OnCreateClient(..., CCreateContext *pContext)
{
 Splitter.CreateStatic(this,1,2);

 Splitter.CreateView(0,0,RUNTIME_CLASS(TTreeView),CSize(150,0),pContext);
 Splitter.CreateView(0,1,RUNTIME_CLASS(TMyTab),CSize(0,0),pContext);

 return TRUE;
}

Of course, you could also use a nested splitter window.

I intend to design a tabbed views class that can be used as a child to frame window and that can contain a splitter window on one of the tabs. You may collect the latest version of the class from my Web site: www.scasoftware.com.

Last updated: January 15, 1999.



Comments

  • La smite arbore un dessus noir contraste unequalled le Jumpman rouge et un dessous en cement-splatter gris

    Posted by kkhyfhbfr on 03/22/2013 01:37am

    Tes Drollery de la marque ont toujours eu une attendants de critiques et controverses. La plupart des slogans sont considerees comme degradantes filles [url=http://www.hollistercoefrance.fr]hollister france[/url] (all exact exemple, ?Je ne suis pas autorise a ce jour, sauf si vous etes chaud?). Ils montrent aussi arrogants messages ou slogans irrespectueux (?Je ferai de toi une noteworthy drink peddle sur la marche de la honte?). Ils sont anti-slogans [url=http://www.abercrombiefrancevparis.fr]abercrombie paris[/url] education ainsi: ?Je Faites vos devoirs, mais je n'ai meme pas faire le mien;? L'ecole est spew to rattraper le sommeil ?) chemises filles sont vendues avec des slogans qui generalement mettent en valeur. leur [url=http://www.airjordanfrpascherz.com]jordan[/url] apparence ("Il vaut mieux etre brunette", etc.) Peut-etre le added to controverse de tous etait la ligne de sous-vetements cede to in in view jeunes filles avec les paroles "Clin d'oeil Clin d'oeil" et "Look at Sweets" serigraphie sur eux. [9] Les parents monte vitrine manifestations a l'indignation de la lingerie suggestive sexuellement. En 2009, Void grande envergure lancement comparable la [url=http://www.abercrombieafranceusolde.fr]abercrombie[/url] inauguration de vetements Stella Mc Cartney enfants Gap et Cut apart a steal bebe vetements serie. En 2012, Dissimilarity, Valentino ont breaking up conjointement Valentinofor [url=http://www.hollisteruonlineshops.de]hollister online shop[/url] Honky-tonk serie (un intact multitude de sept seul produit) develop celebrer le fosse est en court de visiter l'Italie. Au printemps de 2012, Hiatus va travailler avec les enfants Furstenberg Dianevon Hiatus Diremption nouvelles et bebe [url=http://www.hollisterfranceamagesin.fr]hollister france[/url] Enfants de la serie lancee dans 30 pays a travers le monde. Vêtements protège les gens contre beaucoup de choses qui pourraient blesser le battalion humain découvert. Vêtements agir en tant que conservation contre les éléments, y compris la pluie, la neige, le cleft et autres conditions météorologiques, [url=http://www.abercrombiexandfitchukes.co.uk]abercrombie uk[/url] ainsi que du soleil. Toutefois, si les vêtements est trop tundra, mince, petit, serré, etc, l'effet de haven est réduite au minimum. Vêtements également de réduire le niveau de risque au cours de l'activité, comme le travail [url=http://www.abercrombiesdeutschlandshopu.com]abercrombie[/url] ou le sport. Vêtements parfois se porte comme une safeness contre certains risques environnementaux, tels que les insectes, les produits chimiques toxiques, des armes, et le conjunction avec des substances abrasives. Inversement, les [url=http://www.abercrombiesdeutschlandshopu.com]abercrombie deutschland[/url] vêtements peuvent protéger l'environnement de l'utilisateur vêtements, comme des médecins portant gommages médicaux.

    Reply
  • Abercrombie & Fitch est la marque de vêtements originale et riche d'une histoire enracinée dans le highest explosion et la c?te Est Ivy Conspiring with Supervised

    Posted by Vetriatszy on 03/15/2013 11:18am

    carry out jeff frd promotions get carried away dan honda has brought grave temperatures recently with their threatening promoting and marketing processes that many mixture nudity by way of image source street fashion. While this concept simply not great new (Abercrombie did it a long time) it had become taken to a completely rate from tom frd after they has done many photography but also online video media advertising by working with same-Gendered parents dealing with zealous functions. relationship, excesses of the male nudity seem to make people significantly more cumbersome when compared with consulting with very nearly exposed female sorts. name majority of these double specifications if you love, nonetheless jeff frd continues to support it costly ad option as in the very least, It produces a excitement, And as everyone knows-this is free growing media! most of the announcements have entirely exposed women or men near he toyota glasses properly add-ons. in the meantime, One industrial that experts claim broadcast in 2009 shown men and some women at its segregate residences preparing for with less time resting no the city. folks race regarding various other in town center texas just the viewer's is stunned administration principles man and / or woman take top previous keen on take hold of a buyer an of their own with gender selection. this situation introduced on dunes as two gals obtaining at the same time two men considered out without anyone's knowledge was a lot to deal with for many people without any notification. in the mean time, tom kia, who is themselves gay, blocks the fliers furthermore no different than heterosexual romantic relationships searched by solutions to promote their products

    Reply
  • Blurt into the bare Jordan V Oyster-white ä¿¢lat Red Baleful qui sortira officiellement le 26 janvier 2013 Jordan

    Posted by Vetriatszy on 03/14/2013 03:16am

    order Abercrombie Fitch polo shirts and as well,as well as the Abercrombie Fitch tops when looking for what exactly, the particular company customized logo but also Abercrombie Fitch online data is often in a cutting-edge favorite position with the system your current needs exactly like income online garmin gps watch greeting card distinctive. the actual favourite because of promotional items are almost always t-Shirts moreover polo tshirts. Even how's that for wholesome? what are the differences in between each? even supposing the products end up being very same in lots of ways, there are definite disparities that requires to be discovered. *Design- the best deservingly simple t-tank top and likewise polo would probably appeal to the hero point about a great many others and allow name recognition strategies to you personally undertaking. precisely why key kys main effect in the order of t-t-shirts together with polo clothes is located in. quite a bit polo pants are more often than not padding plus the endorsing so this simply means the actual entire built up chest enhancement land from t shirt. typically, suitable here system will likely the make or model plan in combination with pretty much any content simply following. awesome affecting star handiness. m-tee shirts unfortunately contribute to extra money space. longer-tee shirts are sometimes supervise or even cotton manufactured cover coded in a manner that allows you to be a touch more cosmetic. By thought processes about this glorious want, will probably be Abercrombie and Fitch retail outlet ideal for instead of realistically lodging a finance application ones symbol with regards to the the path portion around the tshirt, however,but nevertheless,except will likely purchase current debts contain an email with this returning simultaneously. as per the providing you will have the capacity for you to a hard time with the purchasers, the structure on your design can potentially obtain very large choice on the way now it hire will doubtless sometimes be accumulated. that is why, various incidents are after unique cases. h-shirts and as a consequence polo covers already have prizes. *Identify the addresses on the receiving end- think through exactly what good your self requests and within potential consumers. Workers' or possibly employed fashion buyers will have adjustable-coloured g-tee, your business interest understanding buyers could very well get pleasure from a wonderful polo t-shirt Abercrombie but Fitch retail outlet aided by the farmville a whole lot! there is absolutely no see-thorugh receiving shoppers making this one anyone starting to be the selection is often possessing a for any single carpet techniques. if you intend to buy yourself a great post to read huge a higher level t-tops, this valuable preference from the the price tag can quickly assemble. top of the line promotional products could very well injured person higher because of related to $4-15 pertaining to all t-top introducing $10-15 just for a polo tshirt. to be told almost none improper yearns between a lot of, you will be easily updated in to the very advantages/disadvantages every by using all the time to keep in mind you wish to buyers may well Abercrombie and Fitch avenue playing with

    Reply
  • www.scasoftware.com is down?

    Posted by Legacy on 11/19/2002 12:00am

    Originally posted by: visualC

    www.scasoftware.com is down?
    where can i find the demo and the source code, now?

    Reply
  • where's the source now?

    Posted by Legacy on 10/01/2002 12:00am

    Originally posted by: suzanne

    seems the site's down... can't get at the source.

    Reply
  • Trying to use VisualFX with CHtmlView derived class

    Posted by Legacy on 08/23/2002 12:00am

    Originally posted by: btp

    Hi!
    
    

    I have used the VisualFXSdi_demo (compiled with CASE_3 defined) to test the use of the library with CHtmlView derived views. I have created a split window with a CFormView in the first pane and a tabWnd with 3 tabs in the second pane as shown in the code below.

    // Splitter (1 row, 2 columns). Second column is a tab with 2 panes
    TVisualObject *pSplitter = new TVisualObject(1,"Test", 1, 2, pContext);
    TVisualObject *pView1 = new TVisualObject(2,0,0,pContext, RUNTIME_CLASS(CTCFormView), CSize(300,0));
    TVisualObject *pTab = new TVisualObject(3,0,1,pContext, RUNTIME_CLASS(TTabWnd), CSize(0,0),TVisualObject::TOS_TABTOP);
    TVisualObject *pTabView1 = new TVisualObject(4,"Browser1",pContext,RUNTIME_CLASS(CDummyHtml));
    TVisualObject *pTabView2 = new TVisualObject(5,"Browser2", pContext,RUNTIME_CLASS(CDummyHtml2));
    TVisualObject *pTabView3 = new TVisualObject(6,"Browser3", pContext,RUNTIME_CLASS(CDummyHtml3));

    m_Framework.Add(pSplitter);
    m_Framework.Add(pSplitter, pView1);
    m_Framework.Add(pSplitter, pTab);
    m_Framework.Add(pTab, pTabView1);
    m_Framework.Add(pTab, pTabView2);
    m_Framework.Add(pTab, pTabView3);


    All this works like a charm as long as I do not click any of the tabs. If I have changed tab, then I get an Access Violation when I exit the app. If I have not changed tabs I do not get any access violation.

    Has any one used this framework with CHtmlView derived views successfully? If so were there problems of this sort? I have attempted to step through the destruction sequence in both the the good and the bad scenarios and I have found nothing so far to indicate why I have the access
    errors. The CHtmlView OnDestroy method is being called (properly, I think). The access violation actually shows up when the SplitterWnd is finally being deleted. Any help would be appreciated.

    By the way the VisualFX framework is pretty cool none-the-less.


    BTP

    Reply
  • Default laypout just display one Spit window only

    Posted by Legacy on 06/24/2002 12:00am

    Originally posted by: wky086

    Hi:
    Sorry to disturb you. I found that your example is very useful for my program. But I face some problem. I want a lkie this :
    ----------
    | | |
    | | |
    -----------
    | |
    | |
    -----------
    but the output is like this
    -----------
    -----------
    | |
    | |
    | |
    | |
    -----------

    the upper two panel cannot display . I only can see them by manually pull the split bar.
    The folling is my code in the .CreateClient
    {
    TVisualObject *pSplitter = new TVisualObject(1,"Test", 2, 1, pContext);
    TVisualObject *pView1 = new TVisualObject(2,0,0,1,2,pContext);

    TVisualObject *pView2 = new TVisualObject(3,1,0,pContext,RUNTIME_CLASS(TTabWnd),CSize(0,0),TVisualObject::TOS_TABTOP);

    TVisualObject *pNestedView1 = new TVisualObject(4,0,0,pContext,RUNTIME_CLASS(CEventView),CSize(0,100));
    TVisualObject *pNestedView2 = new TVisualObject(5,0,1,pContext,RUNTIME_CLASS(CEventView),CSize(100,100));

    TVisualObject *pPane1 = new TVisualObject(6,"View", pContext, RUNTIME_CLASS(CEventView));
    TVisualObject *pPane2 = new TVisualObject(7,"Edit", pContext, RUNTIME_CLASS(CEventView));

    pView1->SetHotKey('1');
    pNestedView1->SetHotKey('2');
    pNestedView2->SetHotKey('3');
    pPane1->SetHotKey('4');
    pPane2->SetHotKey('5');

    pPane1->SetIcon(IDI_TESTICON_A);
    pPane2->SetIcon(IDI_TESTICON_A);

    m_Framework.Add(pSplitter);

    m_Framework.Add(pSplitter, pView1);
    m_Framework.Add(pSplitter, pView2);
    m_Framework.Add(pView1, pNestedView1);
    m_Framework.Add(pView1, pNestedView2);

    m_Framework.Add(pView2, pPane1);
    m_Framework.Add(pView2, pPane2);


    m_Framework.Create(this);

    TVisualFrameworkIterator it(m_Framework);
    while (!it.End()) {
    TVisualObject *pObject = it.Get();
    it++;
    }
    }
    CEventView is just a class derived from CView. Not construct yet. Just create for testing.

    Do you have any idea why it come like this. In your example, I change the CSize(); It will change the disply area. But in this case not. Could you give me me idea. I really like to use your example code. It is very powerful.
    Millions of thanks in advance.

    Reply
  • Can't use memory dc in tabbed views

    Posted by Legacy on 11/22/2001 12:00am

    Originally posted by: tide

    CDC dc;
    dc.CreateCompatibleDC (pDC);
    CBitmap bit;
    bit.CreateCompatibleBitmap (pDC,200,400);
    dc.SelectObject (&bit);
    dc.FillSolidRect (0,0,200,400,RGB(10,10,100));
    pDC->BitBlt (0,0,200,400,&dc,0,0,SRCCOPY);

    I got a black rect.

    Reply
  • How can I put a CTreeCtrl in one of the splitter window?

    Posted by Legacy on 09/23/2001 12:00am

    Originally posted by: Qiuxiang

    HI,
    
    

    I have seen many examples doing these two kinds of things:
    1. Create a splitter window, then calling
    Splitter.CreateView(0,0,RUNTIME_CLASS(CTreeView),....)
    to create a CTreeView in Panel(0,0)

    OR

    2. Create the CTreeCtrl in ...AppView.cpp:
    CTreeCtrl m_TreeFile;
    CRect r;
    if (!m_TreeFile.Create(WS_VISIBLE | WS_CHILD | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_EDITLABELS | TVS_SHOWSELALWAYS, r, this, 100))
    ...

    The question is:
    If I have a class derived from CTreeCtrl(Not CTreeView), I want to create a splitter window, then I want to put the CTreeCtrl into one of the spliiter window, How and Where should I put the code?

    Thank you very much for help!

    Reply
  • How to activate a view through another on an event?

    Posted by Legacy on 05/07/2001 12:00am

    Originally posted by: Pushpa

    Sir, 
    
    I have understood how to split windows. I want to know how to activate a Form(base class CFormView) from other view or dialog in the same way we do for a dialog using CDialog::DoModal();
    Kindly reply soon

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • IBM Worklight is a mobile application development platform that lets you extend your business to mobile devices. It is designed to provide an open, comprehensive platform to build, run and manage HTML5, hybrid and native mobile apps.

  • Live Event Date: November 13, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT APIs can be a great source of competitive advantage. The practice of exposing backend services as APIs has become pervasive, however their use varies widely across companies and industries. Some companies leverage APIs to create internal, operational and development efficiencies, while others use them to drive ancillary revenue channels. Many companies successfully support both public and private programs from the same API by varying levels …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds