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 » CExtResizableDialog Question Collapse All
Subject Author Date
Offer Har Nov 28, 2006 - 11:04 AM

Hi,

I have a dialog that i don’t want the user to make smaller then a pre-defined size.
Is there a way to do it in CExtResizableDialog?

Thanks.

Offer Har Dec 18, 2006 - 8:16 PM

Dear Support,

Any change this bug will be fixed in the coming version?

Regards,
Ron.

Technical Support Nov 30, 2006 - 9:08 AM

The CExtResizableDialog class is based on the CExtWA template decorator class and all the methods of CExtWA can also be found in CExtResizableDialog. There are two methods in CExtWA which allows you to limit the dialog’s size: SetMinTrackSize() and SetMaxTrackSize(). By using both methods, you can even make a dialog that can be resized only horizontally or vertically.

Offer Har Nov 30, 2006 - 9:11 AM

I tried with no success.
I have a following implementation:
A dock-bar containing a dialog derived from CExtResizableDialog.
I call SetMinTrackSize (tried before and after the dialog was created)
And i can still drag the dialog to be of no size.
Am i missing something?
Do you have a sample that does that?
Is there a bug?
Thanks.

Suhai Gyorgy Nov 30, 2006 - 9:28 AM

My guess is: It is not the dialog that you are dragging, but the dock-bar, so you should disable sizing of dock-bar, not sizing of dialog. But sorry, I couldn’t find anything on disabling that in Help. I’m not even sure if by dock-bar you mean CExtControlBar or some other class.

Suhai Gyorgy Nov 30, 2006 - 9:29 AM

Sorry, I meant restricting the sizing, not disabling it.

Offer Har Nov 30, 2006 - 9:31 AM

Exactly,
I want an example of a CExtControlBar with a dialog inside, which is how all my dialogs are created.

Suhai Gyorgy Nov 29, 2006 - 1:34 AM

You can get the answer to your problem in this feature article of Prof-UIS. The important part for you:
---BEGIN QUOTE---
The Prof-UIS dialog has a resizing gripper, which can be turned on or off with the ShowSizeGrip() method. For example, you may pass FALSE to it in the OnInitDialog handler to turn it off.

As in the standard MFC dialog application, the resizing of the dialog is enabled/disabled in the Border field of the dialog resource’s properties.
---END QUOTE---

Offer Har Nov 29, 2006 - 6:39 AM

What i mean is that i don’t want the dialog to become smaller then some predefined value, something like
SetMinSize(400,200)
This will prevent the dialog from becoming smaller then 400 units on the X axe, and 200 on the Y axe.
Any idea?

Suhai Gyorgy Nov 29, 2006 - 8:18 AM

CExtResizableDialog class is derived from some CExtWA < SomeBaseClass >, so you can use SetMinTrackSize on it.
From Help:
CExtWA::SetMinTrackSize
Sets the minimum size to which the window can be shrunk.

void SetMinTrackSize( const CSize & size);

Offer Har Nov 29, 2006 - 8:47 AM

Deosn’t work.
I have a dialog inside a dock bar, and i called the SetMinTrackSize function, and nothing changed.
What am i missing?

Technical Support Nov 30, 2006 - 12:19 PM

In a CExtControlBar-derived class, please override the following virtual method(s):

1) CExtControlBar::_CalcDesiredMinHW()(an internal virtual method) is invoked to query the minimum control bar’s width in pixels.

2) CExtControlBar::_CalcDesiredMinVH() (an internal virtual method) is invoked to query the minimum control bar’s height in pixels.

Offer Har Nov 30, 2006 - 12:29 PM

Another bug:
When i try do dock the bar to the left, it limits the size in a very strange behavior, which is absolutly not related to the limit size i set in the H size.
Please fix this issue as well.
Regards,
Ron.

Offer Har Nov 30, 2006 - 12:27 PM

Thanks,
This works, BUT, as always, a tab problem...
When the dialog is tabbed, still the same size apply, which means than now the tab control obscures the content of the docked dialog.
If the dialog is tabbed, the V size must be bigger by the size of the tab control.
Regards,
Ron.

Technical Support Dec 1, 2006 - 7:30 AM

A tabbed container for control bars is an instance of CExtDynTabControlBar which in turn is derived from CExtControlBar. So you can override CExtDynTabControlBar and implement any custom restrictions in it. When this custom class is ready and you need to use it in Prof-UIS, you can do this by handling the CExtControlBar::g_nMsgCreateTabbedBar registered windows message in your main frame window:

class C_YOUR_DynTabControlBar : public CExtDynTabControlBar
{
    . . .
};
 
ON_REGISTERED_MESSAGE( CExtControlBar::g_nMsgCreateTabbedBar, OnMsgCreateTabbedBar )
 
LRESULT CMainFrame::OnMsgCreateTabbedBar( WPARAM wParam, LPARAM lParam )
{
    lParam;
CExtDynTabControlBar ** ppBar = (CExtDynTabControlBar **)wParam;
    (*ppBar) = new C_YOUR_DynTabControlBar;
    return 0L;
}

Offer Har Dec 1, 2006 - 7:34 AM

I don’t understand what you are saying.

You think that this is not a bug, but a desired behavior?

I don’t think that this is true.

Please try and explain to me why i need to implement this myself.