![]() |
Funny behaviour inside dialogs |
Post Reply ![]() |
Author | |
Uwe Keim ![]() Newbie ![]() Joined: 01 November 2004 Location: Germany Status: Offline Points: 29 |
![]() ![]() ![]() ![]() ![]() Posted: 08 November 2004 at 1:03am |
I have a dialog box (derived from CXTPDialogBase) that is resizable (I don't use the XT sizable dialogs but this class: http://www.codetools.com/dialog/dynwindow.asp, because I just switched to XT and used the other class already since 2 years). Now I added a menu bar (CXTPMenuBar), a tool bar (CXTPToolBar) and a status bar (CXTPStatusBar) to the dialog. The dialog then looks like this: Now I have a strange behaviour, in that every time the user clicks a tool bar button or a menu bar button and then the dialog is resized by the user, the last-clicked bar (menu bar or tool bar) is put on top of the other. Let me explain: 1.) The user clicks a tool bar button: 2.) Then the user resizes the dialog. Now the tool bar moves up: 3.) The user now clicks a menu bar item: 4.) And then resizes the dialog again. Now the menu bar jumps up again to the correct position: Question: Can you please tell me how I can tell that bars to keep their positions? More informationen: Whenever a WM_SIZE event occurs, I do the following code on the bars to keep them fill up the whole dialog width: RepositionBars( ToolBar.InvalidateParents(); Thank you for enlightening me |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
in void CXTPToolBar::OnLButtonDown(UINT nFlags, CPoint point) of source code replace SetWindowPos(&CWnd::wndTop, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); to if (m_barPosition == xtpBarFloating)
in next version we will fix it too.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Uwe Keim ![]() Newbie ![]() Joined: 01 November 2004 Location: Germany Status: Offline Points: 29 |
![]() ![]() ![]() ![]() ![]() |
Thanks Oleg! My product ships in February 2005. So I will wait and if there is no next version I will recompile the sources as you mentioned. Thanks |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
If you don't want to change source code, you can override CXTPToolBar and its OnLButtonDown method: void CToolBar::OnLButtonDown(UINT nFlags, CPoint point) if (m_barPosition != xtpBarFloating) return CXTPCommandBar::OnLButtonDown(nFlags, point); return CXTPToolBar::OnLButtonDown(nFlags, point); } |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
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 |