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 Tech Support » Suggestion for floating bars Collapse All
Subject Author Date
Hans Bergmeister Feb 21, 2007 - 4:49 AM

Hello,

in our applications it is sometimes useful to temporarily fix the current size of a CExtControlBar object, which is currently floating in a CExtMiniDockFrameWnd, and to prevent the user from changing the size with the mouse. In such cases it would be useful to give the CExtControlBar object control over the return value of CExtMiniDockFrameWnd::OnNcHitTest().

A suggested way to solve this, are the following extensions of the source code:

UINT CExtMiniDockFrameWnd::OnNcHitTest(CPoint point)
{
...
CExtControlBar * pExtBar = GetControlBarExt();
    if( pExtBar != NULL )
    {
        ASSERT_VALID( pExtBar );

        if(pExtBar->CalcNcHit(nHit, this, point)))
        {
            return nHit;
        }
...
}

and

class __PROF_UIS_API CExtControlBar
: public ...
{
...
    virtual bool CalcNcHit(UINT& nHit, CFrameWnd* pFrame, CPoint point) const { pFrame; point; return false; }
...
};

This would offer classes derived from CExtControlBar the chance to hook UINT CExtMiniDockFrameWnd::OnNcHitTest().


Is there any change, that a feature like is will be added to Prof-UIS?

Technical Support Feb 22, 2007 - 9:43 AM

If you need to lock all the bars, then it is handy to use the following code:

      CExtControlBar::g_bLockAllBars = true;
      pMainFrame->RecalcLayout();
      CExtControlBar::stat_RecalcBarMetrics( pMainFrame );
The following set of virtual methods should simply return false if you want to lock only one bar:
      CExtControlBar::_DraggingIsEnabled()
      CExtControlBar::_RowResizingIsEnabled()
      CExtControlBar::_RowRecalcingIsEnabled()
      CExtControlBar::_FloatStateChangingIsEnabled()
      CExtControlBar::_NcMenuButtonIsEnabled()
      CExtControlBar::_ClosingIsEnabled()
      CExtControlBar::_AutoHidingIsEnabled()
      CExtControlBar::OnConstructDockSiteControlBarPopupMenu()
      CExtControlBar::_CanDockToTabbedContainers()
      CExtControlBar::_CanDockLTRB()
The CExtControlBar::OnConstructDockSiteControlBarPopupMenu() method is required to remove the bar from the context menus. The last two methods are required to prevent other bars from being docked into the same area with this bar.

Hans Bergmeister Feb 22, 2007 - 2:45 AM

Hello,

I just detected, that 2.64 introduces a new function CExtControlBar::_FloatStateChangingIsEnabled(). This provides exactly the "hook" we have been looking for. Many thanks. Case closed.