[mapguide-commits] r6656 - in branches/2.4/MgDev/Desktop/MapViewer: . AppLayoutEngine

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed May 16 13:12:29 EDT 2012


Author: jng
Date: 2012-05-16 10:12:29 -0700 (Wed, 16 May 2012)
New Revision: 6656

Modified:
   branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/AppLayout.cs
   branches/2.4/MgDev/Desktop/MapViewer/MgViewerOptionsControlImpl.cs
   branches/2.4/MgDev/Desktop/MapViewer/Util.cs
Log:
mg-desktop updates:
  - Fix selection color persistence in MgViewerOptions. We were saving/loading as RGB when we should be using ARGB

Modified: branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/AppLayout.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/AppLayout.cs	2012-05-16 17:07:12 UTC (rev 6655)
+++ branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/AppLayout.cs	2012-05-16 17:12:29 UTC (rev 6656)
@@ -44,7 +44,7 @@
             layout.Settings = new AppLayoutSettings()
             {
                 ConvertTiledGroupsToNonTiled = true,
-                SelectionColor = Util.ToHtmlColor(System.Drawing.Color.Blue),
+                SelectionColor = Util.ToHtmlColorWithAlpha(System.Drawing.Color.Blue),
                 ShowVertexCoordinatesWhenDigitizing = false,
                 ZoomInFactor = 0.5,
                 ZoomOutFactor = 2.0

Modified: branches/2.4/MgDev/Desktop/MapViewer/MgViewerOptionsControlImpl.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/MgViewerOptionsControlImpl.cs	2012-05-16 17:07:12 UTC (rev 6655)
+++ branches/2.4/MgDev/Desktop/MapViewer/MgViewerOptionsControlImpl.cs	2012-05-16 17:12:29 UTC (rev 6656)
@@ -42,7 +42,7 @@
         {
             var options = new MgViewerOptions();
             _viewer.SelectionColor = lblSelectionColor.BackColor;
-            options.SelectionColor = Util.ToHtmlColor(_viewer.SelectionColor);
+            options.SelectionColor = Util.ToHtmlColorWithAlpha(_viewer.SelectionColor);
             options.ShowVertexCoordinates = _viewer.ShowVertexCoordinatesWhenDigitizing = chkShowVertexCoordinates.Checked;
             options.ConvertTiledLayersToNonTiled = _viewer.ConvertTiledGroupsToNonTiled = chkConvertTiledToNonTiled.Checked;
             options.ZoomInFactor = _viewer.ZoomInFactor = Convert.ToDouble(numZoomInFactor.Value);

Modified: branches/2.4/MgDev/Desktop/MapViewer/Util.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/Util.cs	2012-05-16 17:07:12 UTC (rev 6655)
+++ branches/2.4/MgDev/Desktop/MapViewer/Util.cs	2012-05-16 17:12:29 UTC (rev 6656)
@@ -13,6 +13,11 @@
             return String.Format("{0:X2}{1:X2}{2:X2}", color.R, color.G, color.B);
         }
 
+        public static string ToHtmlColorWithAlpha(Color color)
+        {
+            return String.Format("{0:X2}{1:X2}{2:X2}{3:X2}", color.A, color.R, color.G, color.B);
+        }
+
         public static Color FromHtmlColor(string html)
         {
             int rgb = int.Parse(html, System.Globalization.NumberStyles.HexNumber);



More information about the mapguide-commits mailing list