![]() |
Can the command bar be positioned at bottom right? |
Post Reply ![]() |
Author | |
Josh233 ![]() Newbie ![]() ![]() Joined: 02 May 2007 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
|
Josh233 ![]() Newbie ![]() ![]() Joined: 02 May 2007 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Sorry I meant Tool Bar of course, please read Tool bar wherever Command bar is mentioned. Really sorry for that. |
|
-Joshua
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
You can place toolbar manually to call GetCommandBars()->DockCommandBar.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Josh233 ![]() Newbie ![]() ![]() Joined: 02 May 2007 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Josh233 ![]() Newbie ![]() ![]() Joined: 02 May 2007 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
![]() 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
|
|
![]() |
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 |