OSDN Git Service

Make GUI support visual styles in current Windows versions.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Fri, 18 Jan 2013 16:51:30 +0000 (16:51 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Fri, 18 Jan 2013 16:51:30 +0000 (16:51 +0000)
ChangeLog
src/guidata.rc
src/guiexec.cpp
src/pkgview.cpp

index e43ff53..fc61b36 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2013-01-18  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Make GUI support visual styles in current Windows versions.
+
+       * src/guidata.rc: Add an appropriate inline manifest resource.
+
+       * src/guiexec.cpp (AppWindowMaker::Invoked): Ensure UpdateWindow() is
+       called after the initial call to AdjustLayout(); this is required to
+       ensure that all child windows are properly displayed from the outset.
+
+       * src/pkgview.cpp (AppWindowMaker::LayoutEngine):
+       [ID_PACKAGE_DATASHEET]: Adjust the top position of the frame, to make
+       the border coincide with the bottom border of the tab strip above.
+
 2013-01-12  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Merge gui-dev branch head to master; close gui-dev branch.
index e889956..3565464 100644 (file)
@@ -36,7 +36,7 @@ ID_MAIN_WINDOW        ICON    DISCARDABLE     "pkgicon.ico"
  * which is called out by the "Help --> About mingw-get" menu pick.
  */
 IDD_HELP_ABOUT DIALOG  DISCARDABLE     80, 50, 250, 185
-CAPTION                                        "about mingw-get"
+CAPTION                                        "About mingw-get"
 STYLE                                  DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_DLGFRAME
 FONT                                   9, "Verdana"
 BEGIN
@@ -53,6 +53,31 @@ conditions.  There is NO WARRANTY; not even an implied WARRANTY OF MERCHANTABILI
 ANY PARTICULAR PURPOSE.", -1, 10, 108, 230, 40
 END
 
+/* Include a manifest resource, to support visual style attributes
+ * and unprivileged UAC, when running on current MS-Windows variants.
+ */
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST MOVEABLE PURE
+BEGIN
+  "<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?> \
+  <assembly xmlns=""urn:schemas-microsoft-com:asm.v1"" manifestVersion=""1.0""> \
+    <trustInfo xmlns=""urn:schemas-microsoft-com:asm.v2""> \
+      <security> \
+       <requestedPrivileges> \
+         <requestedExecutionLevel level=""asInvoker"" uiAccess=""false"" /> \
+       </requestedPrivileges> \
+      </security> \
+    </trustInfo> \
+    <dependency> \
+      <dependentAssembly> \
+       <assemblyIdentity \
+         type=""Win32"" name=""Microsoft.Windows.Common-Controls"" version=""6.0.0.0"" \
+         processorArchitecture=""x86"" publicKeyToken=""6595b64144ccf1df"" language=""*"" \
+       /> \
+      </dependentAssembly> \
+    </dependency> \
+  </assembly>"
+END
+
 /* Miscellaneous string constants.
  */
 STRINGTABLE            DISCARDABLE
index 4303aee..1313c74 100644 (file)
@@ -588,6 +588,8 @@ int AppWindowMaker::Invoked( void )
    * data controls are correctly populated.
    */
   AdjustLayout();
+  InvalidateRect( AppWindow, NULL, FALSE );
+  UpdateWindow( AppWindow );
 
   /* Finally, we may delegate all further processing to the main
    * window's message loop.
index 2c5f6ad..61a3593 100644 (file)
@@ -4,7 +4,7 @@
  * $Id$
  *
  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2012, MinGW.org Project
+ * Copyright (C) 2012, 2013, MinGW.org Project
  *
  *
  * Implementation of the layout controller for the main mingw-get
@@ -233,7 +233,7 @@ int AppWindowMaker::LayoutEngine( HWND pane, LPARAM region )
        frame.right = pane_left + pane_width;
        frame.bottom = pane_top + pane_height;
        TabCtrl_AdjustRect( PackageTabControl, FALSE, &frame );
-       pane_top = frame.top;
+       pane_top = frame.top - 1;
       }
       /* Adjust height and width to fill the space below and to the right
        * of the two sash bars.