Print Page | Close Window

Can the command bar be positioned at bottom right?

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=7024
Printed Date: 06 October 2024 at 10:24am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Can the command bar be positioned at bottom right?
Posted By: Josh233
Subject: Can the command bar be positioned at bottom right?
Date Posted: 02 May 2007 at 3:15am
Hello,
         I Know we can set the command bar at any one of the following positions
  .
  .
    xtpBarTop = 0,        // Docked at top.
    xtpBarBottom = 1,    // Docked at bottom.
    xtpBarLeft = 2,        // Docked at left.
    xtpBarRight = 3,    // Docked at right.
  .
 
But i want to set the position at the bottom right by default.

      I know we can drag the bar to the right but i don't want to do that, i want the command bar to be placed at bottom right whenever the application is opened. Is there any way to do that?


-------------
-Joshua



Replies:
Posted By: Josh233
Date Posted: 02 May 2007 at 3:21am
Originally posted by Josh233 Josh233 wrote:

Hello,
         I Know we can set the command bar at any one of the following positions
  .
  .
    xtpBarTop = 0,        // Docked at top.
    xtpBarBottom = 1,    // Docked at bottom.
    xtpBarLeft = 2,        // Docked at left.
    xtpBarRight = 3,    // Docked at right.
  .
 
But i want to set the position at the bottom right by default.

      I know we can drag the bar to the right but i don't want to do that, i want the command bar to be placed at bottom right whenever the application is opened. Is there any way to do that?


Sorry I meant Tool Bar of course, please read Tool bar wherever Command bar is mentioned. Really sorry for that.


-------------
-Joshua


Posted By: Oleg
Date Posted: 02 May 2007 at 9:15am
Hello,
 
You can place toolbar manually to call GetCommandBars()->DockCommandBar.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Josh233
Date Posted: 03 May 2007 at 4:43am
Hi Oleg,

Thank you very much for the reply. I have tried to place the tool bar to the right by using the following code, but it remains in the same place

    .
    .
   CRect rectBar, rectWnd;
    pStandardBar->GetWindowRect(&rectBar);
    this->GetWindowRect(&rectWnd);
    rectBar.left   += rectWnd.left - rectBar.left;
    rectBar.bottom += rectWnd.bottom - rectBar.bottom;
    rectBar.right   = rectWnd.right;
    rectBar.bottom  = rectWnd.bottom;
    pCommandBars->DockCommandBar(pStandardBar, rectBar,    pStandardBar->GetDockBar());
    .
    .

but this line     pStandardBar->GetWindowRect(&rectBar); returns the rect of the whole window.

Can you please tell me how can i get the rect of the tool bar alone ?
Also is my above coding looks correct? or Am i missing something here?


-------------
-Joshua


Posted By: Josh233
Date Posted: 03 May 2007 at 8:57am
Hurray !! Solved...

These lines solved the problem....

    RecalcLayout(TRUE);
    CXTPWindowRect rectBar(pStandardBar);
    rectBar.OffsetRect(rectBar.Width() * 15, 0);
    pCommandBars->DockCommandBar(pStandardBar, rectBar, pStandardBar->GetDockBar());


Even though not sure putting 15 in the line

    rectBar.OffsetRect(rectBar.Width() * 15, 0); 

is right, this works OK. I tried putting different numbers but putting 15 makes it to work OK. I even tried it with resizing it works OK.

Thanks Oleg for your help


-------------
-Joshua



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