[mapguide-commits] r6655 - in branches/2.4/MgDev/Desktop/MapViewer:
. AppLayoutEngine
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed May 16 13:07:13 EDT 2012
Author: jng
Date: 2012-05-16 10:07:12 -0700 (Wed, 16 May 2012)
New Revision: 6655
Modified:
branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/Shell.cs
branches/2.4/MgDev/Desktop/MapViewer/MapViewer.Net40.csproj
branches/2.4/MgDev/Desktop/MapViewer/MgViewerOptionsComponent.cs
branches/2.4/MgDev/Desktop/MapViewer/MgViewerOptionsControlImpl.cs
Log:
mg-desktop updates:
- Apply viewer settings *before* the viewer options component kicks. This allows the viewer options settings saved by the component to be respected.
- Never ever trust ColorTranslator.[To/From]Html(). Never ever!
Modified: branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/Shell.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/Shell.cs 2012-05-16 16:48:40 UTC (rev 6654)
+++ branches/2.4/MgDev/Desktop/MapViewer/AppLayoutEngine/Shell.cs 2012-05-16 17:07:12 UTC (rev 6655)
@@ -39,13 +39,6 @@
}
SetTaskPaneWidth(_layout.TaskPane.Width);
- //Apply viewer properties
- mapViewer.ConvertTiledGroupsToNonTiled = _layout.Settings.ConvertTiledGroupsToNonTiled;
- mapViewer.SelectionColor = Util.FromHtmlColor(_layout.Settings.SelectionColor);
- mapViewer.ShowVertexCoordinatesWhenDigitizing = _layout.Settings.ShowVertexCoordinatesWhenDigitizing;
- mapViewer.ZoomInFactor = _layout.Settings.ZoomInFactor;
- mapViewer.ZoomOutFactor = _layout.Settings.ZoomOutFactor;
-
_provider = provider;
mapViewer.PropertyChanged += new PropertyChangedEventHandler(OnMapViewerPropertyChanged);
}
@@ -355,6 +348,14 @@
}
}
+ //Apply viewer properties. We do this here because we want to respect the viewer options component
+ //So we apply before the viewer options component gets its chance to
+ mapViewer.ConvertTiledGroupsToNonTiled = layout.Settings.ConvertTiledGroupsToNonTiled;
+ mapViewer.SelectionColor = Util.FromHtmlColor(layout.Settings.SelectionColor);
+ mapViewer.ShowVertexCoordinatesWhenDigitizing = layout.Settings.ShowVertexCoordinatesWhenDigitizing;
+ mapViewer.ZoomInFactor = layout.Settings.ZoomInFactor;
+ mapViewer.ZoomOutFactor = layout.Settings.ZoomOutFactor;
+
//3rd pass
foreach (var compDef in layout.Components)
{
Modified: branches/2.4/MgDev/Desktop/MapViewer/MapViewer.Net40.csproj
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/MapViewer.Net40.csproj 2012-05-16 16:48:40 UTC (rev 6654)
+++ branches/2.4/MgDev/Desktop/MapViewer/MapViewer.Net40.csproj 2012-05-16 17:07:12 UTC (rev 6655)
@@ -80,8 +80,12 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AppLayoutEngine\AppLayout.cs" />
- <Compile Include="AppLayoutEngine\MgQuitComponent.cs" />
- <Compile Include="AppLayoutEngine\Shell.cs" />
+ <Compile Include="AppLayoutEngine\MgQuitComponent.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="AppLayoutEngine\Shell.cs">
+ <SubType>Form</SubType>
+ </Compile>
<Compile Include="AppLayoutEngine\Shell.Designer.cs">
<DependentUpon>Shell.cs</DependentUpon>
</Compile>
Modified: branches/2.4/MgDev/Desktop/MapViewer/MgViewerOptionsComponent.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/MgViewerOptionsComponent.cs 2012-05-16 16:48:40 UTC (rev 6654)
+++ branches/2.4/MgDev/Desktop/MapViewer/MgViewerOptionsComponent.cs 2012-05-16 17:07:12 UTC (rev 6655)
@@ -42,7 +42,7 @@
var options = (MgViewerOptions)ser.Deserialize(stream);
//Apply settings
viewer.ShowVertexCoordinatesWhenDigitizing = options.ShowVertexCoordinates;
- viewer.SelectionColor = ColorTranslator.FromHtml(options.SelectionColor);
+ viewer.SelectionColor = Util.FromHtmlColor(options.SelectionColor);
viewer.ZoomInFactor = options.ZoomInFactor;
viewer.ZoomOutFactor = options.ZoomOutFactor;
viewer.ConvertTiledGroupsToNonTiled = options.ConvertTiledLayersToNonTiled;
Modified: branches/2.4/MgDev/Desktop/MapViewer/MgViewerOptionsControlImpl.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/MgViewerOptionsControlImpl.cs 2012-05-16 16:48:40 UTC (rev 6654)
+++ branches/2.4/MgDev/Desktop/MapViewer/MgViewerOptionsControlImpl.cs 2012-05-16 17:07:12 UTC (rev 6655)
@@ -42,7 +42,7 @@
{
var options = new MgViewerOptions();
_viewer.SelectionColor = lblSelectionColor.BackColor;
- options.SelectionColor = ColorTranslator.ToHtml(_viewer.SelectionColor);
+ options.SelectionColor = Util.ToHtmlColor(_viewer.SelectionColor);
options.ShowVertexCoordinates = _viewer.ShowVertexCoordinatesWhenDigitizing = chkShowVertexCoordinates.Checked;
options.ConvertTiledLayersToNonTiled = _viewer.ConvertTiledGroupsToNonTiled = chkConvertTiledToNonTiled.Checked;
options.ZoomInFactor = _viewer.ZoomInFactor = Convert.ToDouble(numZoomInFactor.Value);
More information about the mapguide-commits
mailing list