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 » Resizing of CExtControlBar Collapse All
Subject Author Date
Denis Konovalov Nov 20, 2007 - 9:26 AM

Hello!

I have a CExtControlBar with dialog. And i need resize floating control bar with fixed aspect ratio. How can I do it?
If i load bar states on start application, then embedded dialog incorrectly resized in floating control bar. Why?

Thanks.

Technical Support Nov 23, 2007 - 5:34 AM

Why don’t you use the Visual Studio 2005 style docking algorithm, which is based on docking markers. This algorithm is used by default in Studio2005 and Office 2007 themes. You can apply this algorithm for other themes using the code below:

CExtControlBar::g_eResizablePanelDockingType = CExtControlBar::__RESIZABLE_DOCKING_TYPE_STUDIO_2005;



Technical Support Nov 22, 2007 - 4:46 AM

We guess the following class implements exactly what you are looking for

      class CMyBarResizableBar : public CExtControlBar
      {
      public:
            CSize m_sizeInitialFloatingAndProportion;
            CMyBarResizableBar()
                  : m_sizeInitialFloatingAndProportion( 150, 100 )
            {
                  SetInitDesiredSizeFloating( m_sizeInitialFloatingAndProportion );
            }
            virtual bool IsFixedMode() const
            {
                  return ( IsFloating() && LPVOID(_DraggingGetBar()) != LPVOID(this) ) ? true : false;
            }
            virtual CSize CalcDynamicLayout(
                  int nLength,
                  DWORD nMode
                  )
            {
                  CSize _size = CExtControlBar::CalcDynamicLayout( nLength, nMode );
                  if( IsFloating() )
                  {
                        if( nMode & LM_LENGTHY )
                        {
                              _size.cx =
                                    ::MulDiv(
                                          _size.cy,
                                          m_sizeInitialFloatingAndProportion.cx,
                                          m_sizeInitialFloatingAndProportion.cy
                                          ) ;
                        }
                        else
                        {
                              _size.cy =
                                    ::MulDiv(
                                          _size.cx,
                                          m_sizeInitialFloatingAndProportion.cy,
                                          m_sizeInitialFloatingAndProportion.cx
                                          ) ;
                        }
                  }
                  return _size;
            }
      };

Denis Konovalov Nov 22, 2007 - 5:41 AM

Thanks, this is it.

And last question: if i want to dock this bar, i don’t have a dragging border on dock site, border is simple (1 pixel). This can confuse user, because other bars have thick dragging border while re-docking. How can i resolve this?

Technical Support Nov 21, 2007 - 5:10 AM

We can implement the proportional resizing feature for a floating mini frame window with a resizable bar as part of the control bar functionality, but there are some questions:

1) This kind of resizing will work when resizable control bar is a single bar in its floating mini frame window. It’s not always possible to restore bar sizes when it’s in a complex floating mini frame window with several bars inside organized into a tabbed layout and/or multi row/column layout. This feature cannot be implemented if each bar inside complex layout requires its own specific size restriction.

2) Should this feature be implemented as single available kind of resizing for particular bar or should we make it available for each bar and make them resizing proportional only if, for instance, the CTRL key is pressed while resizing?

Finally, you can allow your resizable bar with dialog be resized as is, use anchored controls inside dialog and put this dialog into scrollable container demonstrated in the following sample application. This container allows your dialog to have a size which is always equal to or larger than its initial size.

Denis Konovalov Nov 22, 2007 - 12:12 AM

Ideally, i want to control resizing of floating control bar using a derived class with some overloaded functions. This is realized in CExtToolControlBar that can be resized to fit wrapped icons, but i don’t understand how to implement it in my case.

Technical Support Nov 20, 2007 - 11:50 AM

The CExtControlBar class implements a resizable panel similar to dockable panes in Visual Studio .NET and Visual Studio 2005. This control is designed as a fully resizable window without limits. It’s possible to change the size of a floating resizable control bar as it is demonstrated in the following sample but the resizable control bar cannot have a fixed size. If you need a control bar with a fixed size so that its size is determined by the size of its child dialog, there is another class, CExtPanelControlBar, demonstrated in the FixedSizePanels sample.

Denis Konovalov Nov 21, 2007 - 12:30 AM

Sorry, i think about interactive resizing with mouse (drag bottom-right corner of control bar).
In this case control bar must be resized proportionally, i.e. if it’s quad then it still be quad but more big or more small.
Now, resizing a control bar with mouse can change it proportions.
It’s must look like resize of floating tool bar when it’s size depends on icons layout and can’t be changed to other size.