Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Automatic pos. of toolbar on first run
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Automatic pos. of toolbar on first run

 Post Reply Post Reply
Author
Message
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Topic: Automatic pos. of toolbar on first run
    Posted: 15 April 2005 at 8:10am
Hello,

how can i set the position of the toolbar on the first run.
Default:
All toolbars are in down order.
Toolbar1
Toolbar2
Toolbar3
Toolbar4
...

On first run set it to
Toolbar1 Toolbar2 Toolbar3  | End of windows
Toolbar4

  Jimmy

Back to Top
Agent 007 View Drop Down
Newbie
Newbie
Avatar

Joined: 08 April 2005
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Agent 007 Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2005 at 9:35am

Hello Jimmy,

The CommandBars place the toolbars on top of each other by default.
If you use
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 ...
 // Create ToolBar
 CXTPToolBar* pToolBar = (CXTPToolBar*)pCommandBars->Add(_T("Standard"), xtpBarTop);
 if (!pToolBar || !pToolBar->LoadToolBar(IDR_MAINFRAME))
 {
     TRACE0("Failed to create toolbar\n");
     return -1;
 }

 // Create ToolBar1
 CXTPToolBar* pToolBar1 = (CXTPToolBar*)pCommandBars->Add(_T("Tool Bar 1"), xtpBarTop);
 if (!pToolBar1 || !pToolBar1->LoadToolBar(IDR_TOOLBAR1))
 {
  TRACE0("Failed to create toolbar\n");
  return -1;
 }

 // Create ToolBar2
 CXTPToolBar* pToolBar2 = (CXTPToolBar*)pCommandBars->Add(_T("Tool Bar 2"), xtpBarTop);
 if (!pToolBar2 || !pToolBar2->LoadToolBar(IDR_TOOLBAR2))
 {
  TRACE0("Failed to create toolbar\n");
  return -1;
 }

 // Create ToolBar3
 CXTPToolBar* pToolBar3 = (CXTPToolBar*)pCommandBars->Add(_T("Tool Bar 3"), xtpBarTop);
 if (!pToolBar3 || !pToolBar3->LoadToolBar(IDR_TOOLBAR3))
 {
  TRACE0("Failed to create toolbar\n");
  return -1;
 }
   ...
}

Then the MainFrame toolbar is placed on top and the toolbar1, toolbar2, and toolbar 3
are each placed on their own line like:

MainFrame
ToolBar1
ToolBar2
ToolBar3

Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Posted: 18 April 2005 at 2:04am
Hello,

After this i call LoadCommandBars(...).
But on first start the toolbarbar are not in one line. Every toolbar use
a new line.

  Jimmy

Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Posted: 18 April 2005 at 4:51am
Hello,

I think, i've found the correct function.
DockRightOf.
Is put all Toolbar in one line. Do not make a new line
after end of window.

But it work.
    Jimmy
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.