Print Page | Close Window

how to create toolbar like this in dialog

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=16602
Printed Date: 15 May 2024 at 2:33pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how to create toolbar like this in dialog
Posted By: sunceenjoy
Subject: how to create toolbar like this in dialog
Date Posted: 16 April 2010 at 3:55am
there is no example about how to create a toolbar at any place in a  dialog .
here is a picture shows the toolbar i mean:
 
 
 
 
thanks!



Replies:
Posted By: sunceenjoy
Date Posted: 18 April 2010 at 8:54pm

who can help me??



Posted By: jimmy
Date Posted: 19 April 2010 at 10:32am
Hi,

I use follow.
Add CXTPToolBar    m_wndToolBar;
 to header file.

Add

VERIFY(m_wndToolBar.CreateToolBar(WS_DLGFRAME | WS_VISIBLE | WS_CHILD | CBRS_TOOLTIPS | CCS_NOPARENTALIGN | CCS_NOMOVEY | CCS_NORESIZE, this));
    VERIFY(m_wndToolBar.LoadToolBar(IDR_VST_TB_SPICONFIG));
    // m_wndToolBar.SetPaintManager(new CDialogToolbarTheme() );
    CSize sz = m_wndToolBar.CalcDockingLayout(rcChild.Width(), /*LM_HIDEWRAP|*/ LM_HORZDOCK | LM_HORZ | LM_COMMIT);
    m_wndToolBar.MoveWindow(rcChild.left, 10, rcChild.Width(), sz.cy);
    m_wndToolBar.Invalidate(FALSE);

ON_MESSAGE_VOID(WM_KICKIDLE, OnKickIdle)

void CDlgOwn::OnKickIdle()
{
    m_wndToolBar.OnUpdateCmdUI();
}
 

  Jimmy



Posted By: sunceenjoy
Date Posted: 19 April 2010 at 10:44pm
thanks,
but it doesn't work!
tool is disappear!


Posted By: jimmy
Date Posted: 20 April 2010 at 9:04am
Hi,

Who is the parent of the toolbar.
Is the toolbar over other child ?
make toolbar as child from other child.

Have you ad ON_MESSAGE_VOID(WM_KICKIDLE,...) ?

  Jimmy



Posted By: sunceenjoy
Date Posted: 06 May 2010 at 11:48pm
thanks,i fix it!


Posted By: elmue
Date Posted: 05 June 2010 at 7:30pm
Hello

Your code is definitley wrong.
I tried it in the sample "GUI_VisualStudio".

First:
OnKickIdle() is never called.
(Please dont tell me that I did not add the entry to the AFX_MSG_MAP.  Yes I did !)

Second:
Setting the size of the bar does not help much.
When moving some views and docking them anew the toolbars get redrawn and resized to their original size.


Posted By: SuperMario
Date Posted: 07 June 2010 at 2:57pm
OnKickIdle is only for DIALOG based applications.  GUI_VisualStudio is not Dialog based app.  See CommandBars DialogSample to see OnKickIdle.


Posted By: elmue
Date Posted: 08 June 2010 at 12:17am
OK
I didn't know that.

If someone needs a not moveable toolbar in a MDI application have a look here:
forum_posts.asp?TID=16791 - How to create a fixed toolbar



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