![]() |
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)
Quote Reply
Topic: how to create toolbar like this in dialogPosted: 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)
Quote Reply
Posted: 18 April 2010 at 8:54pm |
|
who can help me?? |
|
![]() |
|
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
sunceenjoy
Groupie
Joined: 16 April 2010 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 April 2010 at 10:44pm |
|
thanks,
but it doesn't work!
tool is disappear!
|
|
![]() |
|
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
sunceenjoy
Groupie
Joined: 16 April 2010 Location: China Status: Offline Points: 12 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 May 2010 at 11:48pm |
|
thanks,i fix it!
|
|
![]() |
|
elmue
Groupie
Joined: 05 June 2010 Location: Germany Status: Offline Points: 24 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
SuperMario
Senior Member
Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
elmue
Groupie
Joined: 05 June 2010 Location: Germany Status: Offline Points: 24 |
Post Options
Thanks(0)
Quote Reply
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: 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 |