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 » Maximize does show ribbon window too large Collapse All
Subject Author Date
patrick fritzsch Oct 28, 2010 - 2:36 AM

Hello,


when i maximise the ribbon window on the second (extern) screen of my laptop, the maximise doesnt work correct. The window is locked, but the size is too large. At the bottom the overlap which is not visible, is maybe only 20-30 pixel, to the right. it is about 20% of the whole window. On the main window it works ok.


This applies to the example programs, also to self written code.


I installed Elegant ui 3.7. I have access to the source and can look there into things.


This was working correct with Elegant Ribbon 3.4


OS is Windows XP.


I am looking forward to hearing your respond. Thank you.

patrick fritzsch Nov 2, 2010 - 12:11 PM

Thank you, the patch is working.

patrick fritzsch Nov 2, 2010 - 6:03 AM

Hello,


can you please send me a patch to 3.7?


I am looking forward to hearing your respond. Thank you.


 

Technical Support Nov 2, 2010 - 11:17 AM

Please find the FormFrameSkinner.cs file and replace the PostProcessGetMinMaxInfo method implementation with the following:

private void PostProcessGetMinMaxInfo(ref Message m)
		{
            if (GlassEnabled || Form.IsMdiChild)
                return;

        	WinApi.MINMAXINFO minMaxInfo = 
                (WinApi.MINMAXINFO)Marshal.PtrToStructure(m.LParam, typeof(WinApi.MINMAXINFO));

            minMaxInfo.ptMaxPosition.x = 0;
            minMaxInfo.ptMaxPosition.y = 0;

            // It is said in the documentation that ptMaxSize is based on the width of the primary monitor for top-level windows.
            // Current screen’s working area seemed to work fine for the case when monitors are duplicated or primary monitor bounds 
            // are greater than secondary’s. Current implementation uses current monitor’s working area always except the case when
            // the monitor is extended and a form is located on a secondary monitor.
            Screen screen = Screen.FromControl(Form);
	       Screen primaryScreen = Screen.PrimaryScreen;
	       bool formIsOnExtendingSecodaryScreen = screen.DeviceName != primaryScreen.DeviceName && Screen.AllScreens.Length > 1;
	       if (!formIsOnExtendingSecodaryScreen)
            {
                Rectangle workingArea = screen.WorkingArea;
                minMaxInfo.ptMaxSize.x = workingArea.Width;
                minMaxInfo.ptMaxSize.y = workingArea.Height;
            }
            else
            {
                Rectangle bounds = primaryScreen.Bounds;
                minMaxInfo.ptMaxSize.x = bounds.Width;
                minMaxInfo.ptMaxSize.y = bounds.Height;
            }

            
            WinApi.APPBARDATA taskBarData = new WinApi.APPBARDATA();
            taskBarData.cbSize = Marshal.SizeOf(taskBarData);
            int taskBarState = WinApi.SHAppBarMessage(WinApi.ABM_GETSTATE, ref taskBarData);

	       bool preserveAutoHideTaskBar = false;
            if ((taskBarState & WinApi.ABS_AUTOHIDE) == WinApi.ABS_AUTOHIDE)
            {
                if (!formIsOnExtendingSecodaryScreen)
                {
                    if (SystemInfo.IsWindowsVistaOrHigher || (taskBarState & WinApi.ABS_ALWAYSONTOP) == WinApi.ABS_ALWAYSONTOP)
                        preserveAutoHideTaskBar = true;
                }
            }

            if (preserveAutoHideTaskBar)
			{
				int result = WinApi.SHAppBarMessage(WinApi.ABM_GETTASKBARPOS, ref taskBarData);
				if(result == 1)
				{
					switch(taskBarData.uEdge)
					{
						case WinApi.ABE_BOTTOM:
							minMaxInfo.ptMaxSize.y -= 1;
							break;
						case WinApi.ABE_LEFT:
							minMaxInfo.ptMaxPosition.x += 1;
							minMaxInfo.ptMaxSize.x -= 1;
							break;
						case WinApi.ABE_RIGHT:
							minMaxInfo.ptMaxSize.x -= 1;
							break;
						case WinApi.ABE_TOP:
							minMaxInfo.ptMaxPosition.y += 1;
							minMaxInfo.ptMaxSize.y -= 1;
							break;
					}
				}
			}
			
        	Marshal.StructureToPtr(minMaxInfo, m.LParam, true);

            m.Result = IntPtr.Zero;
            
            return;
        }
Of course this fix assumes that you have the source code.

Technical Support Oct 28, 2010 - 9:37 AM

Thank you for the bug report. We reproduced the issue and fixed it. The fix will be available in the final release of v.3.8.