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 » Minimum size for docked control bar Collapse All
Subject Author Date
Dusan Milanov Aug 23, 2006 - 8:22 AM

Hi

I’m trying to set the minimum size for docked control bars. I have overriden _CalcDesiredMinVH and _CalcDesiredMinHW, and it works fine in some cases. Specificaly, it sets the minimum height for the horizontally docked bar, and minimum width for the vertically docked bar, but I have to return half the needed size. This is my first issue - why do you multiply the returned value by 2? This is from _RowResizingUpdateState:
...
        m_nMetricOffset =
            max(
                _CalcDesiredMinHW()*2,
                bLeft
                    ? (ptCursor.x + rcRowResize.Width()/2)
                    : (m_sizeDockedV.cx - ptCursor.x + rcRowResize.Width()/2 )
                );
...
and it similar with the call to _CalcDesiredMinVH.

The other thing is that if I return the halved value, I get (properly) half the minimum width in the horizontally docked and half the minimum height in the vertically docked bar.

Do you have a good reason for doubling this value? Can you tell me what should I do to rectify this? I don’t feel like modifying the source of your lib, but I will if it helps.


Technical Support Aug 24, 2006 - 8:24 AM

We made the following test with the Prof-UIS source code and SDI sample before giving you a reply: we modified the source code of the CExtControlBar::_CalcDesiredMinHW() and/or CExtControlBar::_CalcDesiredMinVH() methods and simply returned 50 in them. We failed to make the control bar having the size of less than 50 pixels. It seems the problem is hidden somewhere in your code. If you send us a test project, this would us allow to help you more efficiently.

Dusan Milanov Aug 24, 2006 - 10:20 AM

Hi

I just did the same thing. Simply return 50 in both MinHW and MinVH, recompile libraries and SDI. When a control bar is docked horizontally, it’s width can be decreased up to 50 pixels, which is ok. But, when it’s docked vertically, it’s width can only be decreased up to 100 pixels, not a pixel less. That is - bars 2 and 3, initially docked at the top, can be resized to 50 pixels, but 1 and 0, docked vertically - left and right - can be resized (width) only to 100 pixels.

The reverse happens with the bar height: bars 2, 3 and 4 can have their height decreased only to 100 pixels. Try repositioning bar 1 below bar 0. Now decrease the height of either bar: it can be decreased to 50 pixels, which is correct.

Different things deffinitely happen with width and height. And my guess is it’s the _CalcDesiredMinHW()*2 in the line I sent you yesterday.

I sure hope you can reproduce this, I can send you anything you need - including the screenshot. I hate bugs I can’t reproduce, and I’m sure you do too :)