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 » Enforce minimum size on dialog and splitter, how? Collapse All
Subject Author Date
Krister Goodh Mar 5, 2010 - 4:34 AM

Hello!


Question 1 (2):


I Previously used the code below to enforce a minimum dialog size, however it’s not working to well with Prof-UIS.


How can I enforce a mimimum size limit on a CExtNCW<CFrameWnd> ? (I rather want to stop resizing already on WM_SIZING and not on the later WM_SIZE.)


Question 2 (2):


I also have divided the window using a CExtSplitterWnd. Is there a way to enforce limits on the two halvs that does not remove any one of the two halvs when size is to small? If I use SetColumnInfo::SetColumnInfo(x,x,limit), the column may instead disapear completely which is not wanted.


 Thanks. /Jon



case WM_SIZING: {   LPRECT lprc = (LPRECT)lParam;   int changed = 0;

  if (lprc->right - lprc->left < LIMIT_X)   {     switch (wParam)     {     case WMSZ_LEFT:     case WMSZ_TOPLEFT:     case WMSZ_BOTTOMLEFT:   lprc->left = lprc->right - LIMIT_X;   break;     default:   lprc->right = lprc->left + LIMIT_X;   break;     }     changed = 1;   }

  if (lprc->bottom - lprc->top < LIMIT_Y)   {     switch (wParam)     {     case WMSZ_TOP:     case WMSZ_TOPLEFT:     case WMSZ_TOPRIGHT:   lprc->top = lprc->bottom - LIMIT_Y;   break;     default:   lprc->bottom = lprc->top + LIMIT_Y;   break;     }     changed = 1;   }

  return changed; } break;


Krister Goodh Mar 5, 2010 - 6:40 AM

I now have a workaround based on snapping WM_SIZE in one of the childs and checking splitter sizes manually there.


It works, but ther’s probably a better solution...

Technical Support Mar 6, 2010 - 1:27 PM

Prof-UIS supports skinned non-client areas. All behavior details of such skinned windows are implemented by Prof-UIS. Skinned windows do not use the Windows resizing algorithm for desktop windows. It’s written from scratch and we support the WM_SIZING message in v.2.88. You can find the following code in the ../Prof-UIS/Src/ExtNcFrame.cpp file:

   if( ::SendMessage( hWnd, WM_SIZING, wParamSizingCode, LPARAM(&rcWndAdjusted) ) != 0L )
                        rcWnd = rcWndAdjusted;
The way you handle the WM_SIZING message works in Prof-UIS 2.88. This message isn’t supported in older Prof-UIS versions. But, of course, you can use the WM_GETMINMAXINFO message instead.

The CExtSplitterWnd class in Prof-UIS is an extended version of the MFC’s CSplitterWnd class. Our splitter window is just a themed version of MFC’s splitter window. You can override the CExtSplitterBaseWnd::StartTracking() virtual method and modify the CSplitterWnd::m_rectLimit rectangle which defines the screen area enabled for drag-n-drop based resizing of splitter parts. This will allow you to limit resizing of particular splitter panes. You can override the CExtSplitterBaseWnd::RecalcLayout() virtual method and implement your splitter layout calculation. This will allow you to limit the size of particular splitter panes when the entire splitter window is resized.

Krister Goodh Mar 5, 2010 - 5:21 AM

Question 2 (2) still open. 


Question 1 (2) resolution:


void CExtNCW<CFrameWnd>::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) {   if (lpMMI != NULL)   {     lpMMI->ptMinTrackSize.x = LIMIT_X;     lpMMI->ptMinTrackSize.y = LIMIT_Y;   } }