Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Toolbars & DockWindow position problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toolbars & DockWindow position problem

 Post Reply Post Reply
Author
Message
pcvuser View Drop Down
Newbie
Newbie


Joined: 12 June 2003
Location: Israel
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote pcvuser Quote  Post ReplyReply Direct Link To This Post Topic: Toolbars & DockWindow position problem
    Posted: 16 June 2003 at 1:44am

Hi All,

In my application I use a few toolbars (CXTToolBar) and a few dockable windows (CXTDockWin).

I've seen a problem that sometimes the toolbars and windows jump back to their original position (i.e. without the user dragging them, and ignoring registry settings). This happens sometimes when the application is open for a long time, and sometimes when upgrading a version of the application.

I save the users position in the registry, like the examples given. I couldn't replicate this problem on XT examples, so I assume it's my bug, but I need help pinpointing what I did wrong.

Has anyone seen this wierd behavior?

Thanks,

Yair

Back to Top
kstowell View Drop Down
Admin Group
Admin Group


Joined: 25 January 2003
Location: MIchigan, USA
Status: Offline
Points: 496
Post Options Post Options   Thanks (0) Thanks(0)   Quote kstowell Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2003 at 1:37pm

Hi Yair,

This is a known problem with the standard toolkit.  We are working on correcting this problem over the next couple of releases.

Regards,
Codejock Support

Back to Top
Cezariusz View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 14 May 2003
Location: Poland
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cezariusz Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2003 at 4:28am

I have the same problem and it's very annoying both for me and my users. I have reported it several times for each version of XT standard since 1.9.0.

I've tried to find a workaround, but it's quite difficult because the problem occures on random ocasions. Usually when the application is in the background for the long time, after using Win+M or Win+D to minimize all windows, after screen saver, after hibernating and so on. But I haven't found a way to reproduce the problem on demand in order to debug it.

One method to reproduce the problem was to quickly minimize and restore application many times, but for that case I have a workaround - override CMainFrame::OnSize and add following code:

if (nType != SIZE_MINIMIZED && cx > 200 && cy > 200)
{
    CXTMDIFrameWnd::OnSize(nType, cx, cy);
}

Unfortunately it doesn't solve the problem, because unwanted rearanging still happens on other ocasions.

Back to Top
Cezariusz View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 14 May 2003
Location: Poland
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cezariusz Quote  Post ReplyReply Direct Link To This Post Posted: 28 November 2003 at 12:20pm
Users are getting more and more nervous about this bug. Any chance for a quick fix?
Back to Top
Cezariusz View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 14 May 2003
Location: Poland
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cezariusz Quote  Post ReplyReply Direct Link To This Post Posted: 07 January 2004 at 10:33am
One of users has found a way to reproduce the error:
Run "GUI Visual Studio 7 Demo", arrange toolbars and docking windows in non standard way (for example toolbars in one row, docks in one column). Minimize the application, change the size of the taskbar (make sure it's not auto-hide), restore the application. You will see the layout completely messed up.
Hope it will help the support to find a solution.
Back to Top
pcvuser View Drop Down
Newbie
Newbie


Joined: 12 June 2003
Location: Israel
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote pcvuser Quote  Post ReplyReply Direct Link To This Post Posted: 08 January 2004 at 7:20am

(copied from a mail sent to support a few month ago)

We managed to trace the problem to your (XT) source code defect.

it seems every time that the bug occurs, these functions are called:
CmainFrame::RecalcLayout() which calls
CWnd::RepositionBars(), which calls
CControlBar::OnSizeParent(), which calls,
CXTDockBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz) - this is the problematic function that should be fixed.
 
We bypassed this problem in the meantime (we cought most occurances of the bug, but it still happens rarely), by saving our toolbars positions before the bug occurs (added mesage to save toolbars in XTToolkit is change (XTDockContext.cpp CXTDockContext::Track()) - in  case WM_LBUTTONUP:
So we would like you to fix the bug for the next version.
Below see more details on the bug:
 
We managed to define two different scenarios when the bug  occurs (there are others which we don't know how to recreate)
You can use the "GUI_VisualStudio6" sample to recreate the problem:

A. 1. move the toolbars in the application, then minimize the application window.

2. enlarge the toolbars at the bottom of the screen to 2 lines.

3. decrease the height of the toolbars to one line.

4. again, enlarge the toolbars at the bottom of the screen to 2 lines.

5. reopen the application, and see the toolbars/dock windows moved

B. in windows 2000 you should right click onthe desktop and go to screen saver->power and change the settings of monitor standby. This will mix up the windows and toolbars

 

Yair

Back to Top
Kimeli View Drop Down
Newbie
Newbie


Joined: 14 July 2003
Location: Finland
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kimeli Quote  Post ReplyReply Direct Link To This Post Posted: 27 February 2004 at 4:30am
Originally posted by Administrator Administrator wrote:

Hi Yair,

This is a known problem with the standard toolkit.  We are working on correcting this problem over the next couple of releases.

Regards,
Codejock Support

Any progress happening? Or quick fix etc?

Back to Top
MosheY View Drop Down
Newbie
Newbie


Joined: 08 June 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote MosheY Quote  Post ReplyReply Direct Link To This Post Posted: 19 September 2004 at 11:21pm

Has anyone managed to find a decent fix for this?

This is very annoying!

Regards,
Moshe Y.
Back to Top
xred View Drop Down
Groupie
Groupie
Avatar

Joined: 24 August 2004
Location: China
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote xred Quote  Post ReplyReply Direct Link To This Post Posted: 21 September 2004 at 11:27pm

Go on!

Back to Top
kinook View Drop Down
Groupie
Groupie


Joined: 13 May 2003
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote kinook Quote  Post ReplyReply Direct Link To This Post Posted: 08 March 2005 at 10:07am
This problem still exists in 9.51 (and probably 9.6/601 as well since I don't see anything in the release notes indicating it has been addressed). Some users are reporting that their customizations of toolbars/menus don't always get saved (the app saves the customizations to the registry).
Automate software builds with Visual Build Pro

http://www.visualbuild.com
Back to Top
rwfearnley View Drop Down
Groupie
Groupie
Avatar

Joined: 21 January 2004
Location: United Kingdom
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote rwfearnley Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2005 at 6:44am

We came across this problem ages ago & I am surprised its not been fixed yet. To be fair I think this is also a problem in standard MFC implementation as well (or was when we came across it).

It happens because the Dock Bar layout recalculation can be called when the window is minimized. As the window width is zero at that time, it causes the function to automatically wrap all the toolbars onto separate lines (which is by design if you set the width of a normal window so the toolbars do not fit). As it stands they do not snap back when the window is restored.

We worked around this by overriding the CXTDockBar::CalcFixedLayout and temporarily overriding the stored window size before calling the base class implementation, like this:

//////////////////////////////////////////////////////////// /////////////////

// CHyDockBar - to override toolbar layout function to stop wrapping

class CHyDockBar : public CXTDockBar

{

public:

virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);

DECLARE_MESSAGE_MAP()

};

 

CSize CHyDockBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)

{

// Defeat toolbar 'wrapping' by temporarily pretending that the client area is big

CRect rectLayoutTemp = m_rectLayout;

m_rectLayout.SetRect(0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));

CSize size = CXTDockBar::CalcFixedLayout(bStretch, bHorz);

m_rectLayout = rectLayoutTemp;

return size;

}

Unfortunately you cannot specify the DockBar class the standard XT Toolkit / MFC functions create, so you have do this yourself:

// NB Overrides standard MFC function to allow creation of derived CDockBar class

// in order to defeat 'toolbar wrapping' effect

void CMainFrame::EnableDocking(DWORD dwDockStyle)

{

// must be CBRS_ALIGN_XXX or CBRS_FLOAT_MULTI only

ASSERT((dwDockStyle & ~(CBRS_ALIGN_ANY|CBRS_FLOAT_MULTI)) == 0);

m_pFloatingFrameClass = RUNTIME_CLASS(CMiniDockFrameWnd);

for (int i = 0; i < 4; i++)

{

if (dwDockBarMap[1] & dwDockStyle & CBRS_ALIGN_ANY)

{

CXTDockBar *pDock = (CXTDockBar *)GetControlBar(dwDockBarMap[0]);

if (pDock == NULL)

{

pDock = new CHyDockBar;

if (!pDock->Create(this,

WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_CHILD|WS_VISIBLE |

dwDockBarMap[1], dwDockBarMap[0]))

{

AfxThrowResourceException();

}

}

}

}

}

The downside is it means the toolbars never automatically wrap when the window is resized, but frankly I prefer this anyway.

Hope that helps

Back to Top
karthi_sl View Drop Down
Newbie
Newbie


Joined: 07 March 2013
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote karthi_sl Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2013 at 7:23am
Hi Support,

I am also facing the same problem in CDockBar repositioning problem. we are using older version (2002 release) of Xtreme Toolkit.

Is this problem fixed in Latest release ?

If this is fixed, it will be helpful if you provide the nature of bug fix.

Thanks
Karthi
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.140 seconds.