how to create toolbar like this in dialog |
Post Reply |
Author | |
sunceenjoy
Groupie Joined: 16 April 2010 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
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!
|
|
sunceenjoy
Groupie Joined: 16 April 2010 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
|
who can help me?? |
|
jimmy
Senior Member Joined: 11 November 2003 Location: Austria Status: Offline Points: 515 |
Post Options
Thanks(0)
|
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 |
|
sunceenjoy
Groupie Joined: 16 April 2010 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
|
thanks,
but it doesn't work!
tool is disappear!
|
|
jimmy
Senior Member Joined: 11 November 2003 Location: Austria Status: Offline Points: 515 |
Post Options
Thanks(0)
|
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 |
|
sunceenjoy
Groupie Joined: 16 April 2010 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
|
thanks,i fix it!
|
|
elmue
Groupie Joined: 05 June 2010 Location: Germany Status: Offline Points: 24 |
Post Options
Thanks(0)
|
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. |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
OnKickIdle is only for DIALOG based applications. GUI_VisualStudio is not Dialog based app. See CommandBars DialogSample to see OnKickIdle.
|
|
elmue
Groupie Joined: 05 June 2010 Location: Germany Status: Offline Points: 24 |
Post Options
Thanks(0)
|
OK
I didn't know that. If someone needs a not moveable toolbar in a MDI application have a look here: How to create a fixed toolbar |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |