Stack Window

.

Sample Image

Overview on stack window

The stack window gives alternative way to manage multiple dialog boxes inside single window (see picture). Unlike standard property sheet control layout of stack window is vertical. Pages are separated with captions. Page captions displays user-defined name and can be clicked to expand/contract the page. If size of stack window exceeds size of parent's client area user can pan window contents by clicking and dragging on the whitespace area or static/disabled control of child dialog box.

How to use stack window in your application

1. Add member variable in your CMainFrame class:


CStackWnd m_wndStack;

2. Create stack window during main frame creation



   int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
   {
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	...
	if (!m_wndStack.Create(NULL, NULL, WS_CHILD | WS_VISIBLE,
		CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
	{
		TRACE0("Failed to create view window\n");
		return -1;
	}

   	...
   }

3. Create dialog box template and dialog box class. Dialog box should be invisible child.

4. Insert a page into stack window


CDialog* pDlg;
pDlg = new CMyDialog;
m_wndStack.InsertPage(pDialog, IDD_MY_DIALOG, _T("My dialog"),
SWF_VISIBLE);

5. Return to step 3 to add more pages.

Page flags

The combination of following values can be passed to dwFlags parameter of CStackWnd::InsertPage:

SWF_VISIBLE
Page is visible

SWF_CONTRACTED
Page is contracted (i.e. only caption is visible)

Caution

You should ensure the size of parent window is less or equal to size of the child stack window.

Downloads

Download demo project - 64 Kb
Download source - 9 Kb


Comments

  • reviews after use clarisonic mia 2

    Posted by iouwanzi on 06/06/2013 01:39pm

    [url=http://www.australiaclarisonic.com/clarisonic-classic]clarisonic classic[/url] Excessive, que le logiciel est généralement toute expression caractérisant cette campagne innovante spécifique dénommée collection écarlate dans hommage vers les années folles. Juste pour votre affaire, la présence publique dans le type, Katy Perry est immortalisée tout simplement parce que le blanc lumineux au sol avec la fonction habilité par le numérique photographe David LaChapelle. Golf sautes très étonnante et encore plein d’identité parfaite pour la commercialisation des cas uniques ghd. [url=http://www.australiaclarisonic.com/]clarisonic mia[/url] Utile pour déterminer la nature des cheveux ghd fer bruns de l’enfant, sculptée cheveux bouclés est très souple et le degré volume riche, le contexte plus sain et dynamique des muscles du blé. Les os émettent félin sexy Candice Swanepoel, même les femmes sont inconsciemment attiré par elle. Looks fines et douces boucles dorées, semble exceptionnellement douce et fraîche. Hairline n’est pas évident tailler plus délibérée, un peu paresseux et charmante nature elle-même. Sans aucune modification de toute la personne, de ne pas montrer délibérément, peut émettre goût mignonne et sexy. [url=http://www.miaclarisonicaustralia.org/]clarisonic mia[/url] et en plus vous savez quoi ? Cette approche n’est pas presque tous. Est normalement photographié, à peu près chaque période unique, juste par le photographe professionnel populaire particulière ? Certes, le logiciel n’est pas tout un plus petit montant connu Katy.concernant pour lequel vous consacrez une bonne période de 7 jours. Juste pour une partie, Document mis au point plusieurs évolutions dont je parle avant longtemps. Bien sûr, le logiciel peut-être promi ! Toujours juste avant tout cela, Document allait donner à ma propre volonté.

    Reply
  • Elect in-ear earphones along with earphones cover your eyes

    Posted by motherdhmm on 06/04/2013 08:01pm

    [url=http://www.headphonescheaponlineaustralia.com/]beats by dre[/url] We call to mind a consider you will requisite valid headphone or earphone to hearken to music and pay attention to some information sounds.Enjoy fast-moving games and your darling music wherever you go.Provide various high eminence earphone, Headphone products to all customers.We improvise you want like these feelings that exploit our headphone or earphone to attend to music.We Late Style Beats make offer you concern and upper crust service. [url=http://blog.cheapbeatsbydre.co.nz/]beats by dre nz[/url] Low-priced beats around dre Dreuncomfortable tenderness. Your stage hearing watch over to be redress it possible for drop in on anyhow since expeditiously for the sake those who require inseparable outstanding associates beast is haler than earphones. Moreover, it really is honesty a possessions to be able to churn to to exist the power to be off that Is better than doctor dre. beats past dre Is haler than hea.The decisive affectivity involving Deformity Beats on Generate. Dre Studio is drastically much ripping in relation with Brute Beats Individual Hi-def. Specifically, Beats Headphone assignation extremely reasonably really seemly with reduced balance, sleazy beats by dre furthermore while striper robustness and adaptability. [url=http://www.headphonescheaponlineaustralia.com/]monster beats Australia[/url] Fitting for Mutation headphones australia, the articulate is eternally the most important. When it is specific to each day we using beats at hand dre australia tuppence headphones. We belief that at the epoch of you are enjoying the music, you would not be apprehensive nigh the wind of the cable. Barbarity the beats nigh dr dre lackadaisical headphone adopted the late stretched out cabel which can prevent the mailgram from winding, with the sketch out of tough plugs, you could dig your favourite music without the boring the winding line effect to you.

    Reply
  • Lightweight perceptive – Nike Loose TR Attack in spring 2013 3 series

    Posted by Tufffruntee on 04/19/2013 05:10am

    Nike Free TR Suited 3 prominent features is to use the additional forge: Nike Let off 5 soles improved bending Groove; new tractor pattern making training more focused when; lighter ballast, the permeability is stronger, and more in fashion shoe designs not just order shoes [url=http://fossilsdirect.co.uk/glossarey.cfm]nike huarache free[/url] more smug wearing, barefoot training sensible of, but also more in vogue appearance. Nike Manumitted TR Fitting 3 provides supreme lateral stability, you can be suffering with the legs in the part during training. Strong vamp superiority breathable mesh, lower soap up's unique delineate can be [url=http://markwarren.org.uk/goodbuy.cfm]nike free run uk[/url] seen by virtue of it. Lightweight, demanding, pinched bubbles facts habituated to at hand entirely some seams, more amenable, support is stronger. Lack more mainstay, role of a training irritate, lather come in more parts of the need after agreeableness, bubble loose. Use double patois moisture wicking fake materials, tiresome on your feet, help maintain feet tiring and comfortable. Phylite [url=http://northernroofing.co.uk/roofins.cfm]nike free[/url] midsole offers lightweight stupor level, famous durability and unbroken outsole can do to greatly reduce the comprehensive load of the shoe. Qianzhang pods on the outsole and heel-shaped Grassland rubber enhances the shoe multi-directional gripping power on odd surfaces.

    Reply
  • Stack Window

    Posted by Legacy on 12/28/1999 12:00am

    Originally posted by: Masoud

    Hi every body,

    Cool thing!, But i've been trying to add it to a CFormView
    inside the LefPane of a splitted (2,1) child view app.

    It don't give what i want, instead it loads only the empty form without the stack window or the controls dialog pages on it, just plane sheet!

    I wonder any one can help?

    Thank you and Merry Xmas with wishes for a very happy 2000.

    Masoud.
    marcello43@hotmail.com

    Reply
  • used sample to create a dialogbar

    Posted by Legacy on 10/11/1999 12:00am

    Originally posted by: wolfram

    wow, very good.
    I used the StackWnd class as a sample to create a cool dialogbar. I devired the StackWnd class from CControlBar instead of CWnd and added some changes for control bar behavier. If someone would like to get the code, send a mail and i will publish it here.

    Reply
  • not really a bug, but it's better to be fixed ..

    Posted by Legacy on 09/09/1999 12:00am

    Originally posted by: alexander

    First of all, this is really cool stuff.

    As to the problem : you are missing DT_SINGLELINE flag in CDC::DrawText() call, thus making DT_VCENTER flag meaningless (refer to the mfc docs). See code below for the fix.

    Another comment is that I believe it would be more appropriate to define member variable of type CFont and initialize it once (say, in [PrecreateWindow]) and then just use it in [DrawPageCaption]. Plus you would be able more accurately compute the value of [m_cyCaption] as it depends on the font chars.

    void CStackWnd::DrawPageCaption(...)
    {
    ...

    if (lpszText)
    {
    ...

    pDC->DrawText(lpszText, lpRect,
    DT_CENTER | DT_VCENTER | DT_SINGLELINE);
    }
    }

    Regards,
    alexander.

    Reply
  • Memory leaks :(

    Posted by Legacy on 09/01/1999 12:00am

    Originally posted by: Jack

    Nice job, but on closing of stack window
    
    dialogs stays in the memory.

    The solution is:

    void CStackWnd::ClearPageInfo()
    {
    CPageInfo* ptr = m_pPageInfo, *ptrNext;
    while (ptr)
    {
    ptrNext = ptr->m_pNext;

    // !! This line solve the problem:
    delete ptr->m_pDlg;

    delete ptr;
    ptr = ptrNext;
    }

    m_pPageInfo = NULL;
    }


    Reply
  • Suggestion: indicators

    Posted by Legacy on 08/19/1999 12:00am

    Originally posted by: Tomaz Stih

    It`s a cool class. How about a little improvement? Since there is no scroll bar user has no way of knowing that there is more info above the window limit. Maybe adding cool looking up and down indicators would be an improvement.

    --tomaz

    Reply
  • Font Problems under Win98 1st Edition

    Posted by Legacy on 08/15/1999 12:00am

    Originally posted by: Wraith Zero

    All in all, a nice little feature!  Thanks for the contribution!
    
    

    However, in testing I encountered some problems with fonts on the page captions ...

    In the DrawPageCaption() method, simply replace the existing

    if (lpszText)
    {
    ...
    }

    clause with the one below:

    // draw text
    if (lpszText)
    {
    CFont font;
    LOGFONT lf;
    WU_GetDefaultGUIFont(8, &lf);
    font.CreateFontIndirect(&lf);

    //$ WRAITH: Preserve previous font
    CFont *pfontOld = (CFont*)pDC->SelectObject(&font);

    pDC->SetTextColor(GetSysColor(COLOR_BTNTEXT));
    pDC->SetBkMode(TRANSPARENT);
    pDC->DrawText(lpszText, lpRect, DT_CENTER | DT_VCENTER);

    //$ WRAITH: Restore original font
    pDC->SelectObject(pfontOld);
    }

    Also, I've found some painting anomalies which occur when dragging the client area around and resizing the dialog to its full normal size ... though I haven't had the time to look into it yet.

    Thanks for the great work and keep 'em coming!

    - Wraith Z

    Reply
  • Круто

    Posted by Legacy on 08/05/1999 12:00am

    Originally posted by: Alex II

    Просто круто

    Reply
  • Loading, Please Wait ...

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

Top White Papers and Webcasts

  • The hard facts on SaaS adoption in over 80,000 enterprises: Public vs. private companies Mid-market vs. large enterprise GoogleApps, Office365, Salesforce & more Why security is a growing concern Fill out the form to download the full cloud adoption report.

  • Today's agile organizations pose operations teams with a tremendous challenge: to deploy new releases to production immediately after development and testing is completed. To ensure that applications are deployed successfully, an automatic and transparent process is required. We refer to this process as Zero Touch Deployment™. This white paper reviews two approaches to Zero Touch Deployment--a script-based solution and a release automation platform. The article discusses how each can solve the key …

Most Popular Programming Stories

More for Developers

RSS Feeds