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 » Dynamically changing size of undocked window Collapse All
Subject Author Date
Douglas Hoppes Mar 12, 2009 - 8:23 AM

Hopefully this is a simple question: How do I change the size of an undocked window (programmatically)? I have a window that is sub-classed from CExtResizableDialog. When the user undocks the window, it comes up with the correct size. However, when the user hits a button on the window, I would like the dialog to expand to twice it’s size (showing advanced options) (if the window is undocked).

I’ve tried the standard SetWindowPos and it doesn’t seem to work. Is there a method for doing this?

Any help is greatly appreciated.

Doug

Douglas Hoppes Mar 13, 2009 - 7:22 AM

Thanks for the code. The issue is still that I want to resize the dialog when it is not docked. The code shows the resizing when it is docked.

Doug

Technical Support Mar 13, 2009 - 3:27 PM
Douglas Hoppes Mar 16, 2009 - 6:33 AM

Excellent.. I read through the code (still didn’t work), but did notice something. The floating window that you change the size for is subclassed from CExtNCSB. We have version 2.80, rather than 2.84. From reading the help documentation, that class doesn’t seem to exist in our version. Is it possible to do it without the CExtNCSB, or do we have to upgrade?

Technical Support Mar 16, 2009 - 1:33 PM

The CExtNCSB template class replaces scroll bars of other window with the CExtScrollBar based themed Prof-UIS scroll bars. If you don’t need themed scroll bars, you don’t need the CExtNCSB template class. If you need themed scroll bars, then you need a newer Prof-UIS version because the CExtNCSB template class requires the newer CExtScrollBar class which requires the newer paint manager classes. The last classes require newer versions of mostly all the other classes. This template class is not related to the programmatic control bar resizing task. You can simply remove it if you have old Prof-UIS version. The sample application we improved for you does programmatic control bar resizing and it must work even with oldest Prof-UIS versions. Please describe us what you did after running the latest version of the test project referred in our previous answer.

Douglas Hoppes Mar 17, 2009 - 5:26 AM

Well, I figured out a solution. Not the most optimum, but works enough for me. It seems if I do:

            CSize szDialog(iWidth, iHeight);
            bar->SetInitDesiredSizeFloating(szDialog);
            bar->m_pDockSite->ShowControlBar(bar,false, false);
            bar->m_pDockSite->ShowControlBar(bar,true, false);

The dynamic change of the window works. I’m using version 2.80. If I just set the desired size for floating and called the recalclayout on the mainframe, nothing happened. In this situation, I get a flicker, but the user isn’t doing the auto-resizing all that often, so, it’s okay.

Technical Support Mar 12, 2009 - 2:28 PM

Please take a look at the following sample project:

http://www.prof-uis.com/download/forums/ChangeFloatingSize2.zip

Douglas Hoppes Mar 13, 2009 - 7:22 AM

Thanks for the code. The issue is still that I want to resize the dialog when it is not docked. The code shows the resizing when it is docked.

Doug