Print Page | Close Window

Automatic pos. of toolbar on first run

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=2117
Printed Date: 08 July 2024 at 1:53pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Automatic pos. of toolbar on first run
Posted By: jimmy
Subject: Automatic pos. of toolbar on first run
Date 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




Replies:
Posted By: Agent 007
Date 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



Posted By: jimmy
Date 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



Posted By: jimmy
Date 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



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