Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Can't control the initial popup position of a floating control bar Collapse All
Subject Author Date
Harvey Cohen Mar 21, 2005 - 9:38 AM

Hello,

I’m still evaluating Prof-UIS for commercial use. I have a CExtControlBar, declared and created in CMainFrm.cpp, that is serving as a container for a CDialog. I keep the control bar (with it’s CDialog in tow) hidden and reveal it under application control. When I cause the control bar to appear, it is the proper size (as defined by the use of CExtControlBar::SetInitDesiredSizeFloating), but it ALWAYS positioned with it’s upper left corner at (0,0). I have tried the method CWnd::MoveWindow and CWnd::SetWindowPos, but nothing works.

I know that Prof-UIS overrides CWnd::WindowProc, but I can’t seem to get the control bar to respond to the correct WM messages. I overrode CWnd::WindowProc for the CDialog resource, so I can get it to respond to WM_PAINT, but no trick seems to work for the instance of CExtControlBar.

Does anyone have a clue what is going on?

Secondly, when I move ANY visible CExtControlBar in my application (I have several visible), the contents of the CDialog instance disappears only to reappear if I click in the CDialog’s area (I trap ON_WM_LBUTTONDOWN in the CDialog instance). It is obvious that the WM_PAINT message is being trapped, in this instance, in the CExtControlBar instance.

What is the proper procedure here?

TIA

Harvey

Technical Support Mar 22, 2005 - 2:34 AM

If your application fully controls some resizable control bar, then it can use the overloaded version of the CExtControlBar::FloatControlBar() method which allows you to specify a floating position of the control bar:

virtual void FloatControlBar(
        CPoint ptFloat,
        DWORD dwStyle = CBRS_ALIGN_TOP
        );
Besides, you can see that this method is virtual. So, you can override it and pass the modified floating position to its parent class.

We must also note we have had several requests from the library users who would like to simplify the procedure of setting the initial floating position of control bars when the application starts for the first time. So, we added the following methods to the CExtControlBar class in Prof-UIS 2.31 (which is a minor release):
void SetInitDesiredPosFloating( CPoint ptFloat )
    {
        m_ptFloatHelper = size_data;
    }
    CPoint GetPosFloating() const
    {
        return m_ptFloatHelper;
    }
There is not enough information to clarify the problem with painting a dialog in your project. Does this problem exist in any of our sample applications? Could you send us your test project?