Skip to content

Commit

Permalink
Disable window hiding
Browse files Browse the repository at this point in the history
add option to hide the toolbar
  • Loading branch information
BitBaboonSteve committed Mar 4, 2018
1 parent 8617d85 commit 9b40a01
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 19 deletions.
44 changes: 30 additions & 14 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
xmlns:zoombox1="clr-namespace:WpfHelpers.WpfControls.Zoombox;assembly=WpfHelpers"
xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"
mc:Ignorable="d"
Title="Slazanger's Map Tool 0.38" Height="800" Width="1024" Background="#FFEEEEEE" WindowState="Maximized" Icon="Images/smt_icon.ico">
Title="Slazanger's Map Tool 0.39" Height="800" Width="1024" Background="#FFEEEEEE" Icon="Images/smt_icon.ico">

<Window.Resources>
</Window.Resources>
Expand All @@ -24,13 +24,29 @@
</StackPanel>

<Grid x:Name="MainContent" >
<Grid.RowDefinitions>
<RowDefinition Height="1"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<xcad:DockingManager x:Name="dockManager" Grid.Row="0" >
<Menu DockPanel.Dock="Top" Grid.Row="0" IsEnabled="False">
<MenuItem Header="_File">
<MenuItem>

</MenuItem>
</MenuItem>
<MenuItem Header="View">
<MenuItem Header="Intel" IsCheckable="True" IsChecked="{Binding IntelLayoutAnchorable.IsVisible}" Click="MenuItem_ViewIntelClick"/>
</MenuItem>
</Menu>


<xcad:DockingManager x:Name="dockManager" Grid.Row="1" Grid.RowSpan="1" >

<xcad:LayoutRoot>
<xcad:LayoutRoot.RootPanel>
<xcad:LayoutPanel>
<xcad:LayoutDocumentPane ShowHeader="True" AllowDuplicateContent="False">
<xcad:LayoutDocumentPane ShowHeader="False" AllowDuplicateContent="False">

<xcad:LayoutDocument Title="Region" CanClose="False" CanFloat="True" ContentId="MapRegionContentID">
<local:RegionControl x:Name="RegionRC" />
Expand All @@ -42,7 +58,7 @@
<xcad:LayoutRoot.RightSide>
<xcad:LayoutAnchorSide>
<xcad:LayoutAnchorGroup>
<xcad:LayoutAnchorable Title="Intel" CanClose="False" CanAutoHide="True" CanHide="True" ContentId="IntelContentID" AutoHideMinHeight="200" AutoHideMinWidth="280">
<xcad:LayoutAnchorable x:Name="IntelLayoutAnchorable" Title="Intel" CanClose="False" CanAutoHide="True" CanHide="False" ContentId="IntelContentID" AutoHideMinHeight="200" AutoHideMinWidth="280">
<Grid Background="#FFE5E5E5">
<ListBox x:Name="RawIntelBox" Margin="0,2" MouseDoubleClick="RawIntelBox_MouseDoubleClick">
<ListBox.ItemTemplate>
Expand All @@ -56,7 +72,7 @@
</Grid>
</xcad:LayoutAnchorable>

<xcad:LayoutAnchorable Title="Anoms" CanClose="False" CanAutoHide="True" CanHide="True" ContentId="AnomsContentID" AutoHideMinHeight="200" AutoHideMinWidth="280">
<xcad:LayoutAnchorable Title="Anoms" CanClose="False" CanAutoHide="True" CanHide="False" ContentId="AnomsContentID" AutoHideMinHeight="200" AutoHideMinWidth="280">
<Grid x:Name="MainAnomGrid" Background="#FFE5E5E5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="60" />
Expand Down Expand Up @@ -97,7 +113,7 @@
</Grid>
</xcad:LayoutAnchorable>

<xcad:LayoutAnchorable Title="Map Config" CanClose="False" CanAutoHide="True" CanHide="True" ContentId="MapColoursContentID" AutoHideMinHeight="200" AutoHideMinWidth="280">
<xcad:LayoutAnchorable Title="Map Config" CanClose="False" CanAutoHide="True" CanHide="False" ContentId="MapColoursContentID" AutoHideMinHeight="200" AutoHideMinWidth="280">
<ScrollViewer Background="#FFE5E5E5">
<StackPanel>
<ComboBox x:Name="ColourListDropdown" SelectionChanged="ColourListDropdown_SelectionChanged" />
Expand Down Expand Up @@ -128,7 +144,7 @@
</ScrollViewer>
</xcad:LayoutAnchorable>

<xcad:LayoutAnchorable Title="Characters" CanClose="False" CanAutoHide="True" CanHide="True" ContentId="CharactersContentID" AutoHideMinHeight="200" AutoHideMinWidth="280">
<xcad:LayoutAnchorable Title="Characters" CanClose="False" CanAutoHide="True" CanHide="False" ContentId="CharactersContentID" AutoHideMinHeight="200" AutoHideMinWidth="280">
<ScrollViewer Background="#FFE5E5E5">
<StackPanel>
<ListBox x:Name="CharacterList"/>
Expand All @@ -137,7 +153,7 @@
</ScrollViewer>
</xcad:LayoutAnchorable>

<xcad:LayoutAnchorable Title="Route" CanClose="False" CanAutoHide="True" CanHide="True" ContentId="RouteContentID" AutoHideMinHeight="200" AutoHideMinWidth="280">
<xcad:LayoutAnchorable Title="Route" CanClose="False" CanAutoHide="True" CanHide="False" ContentId="RouteContentID" AutoHideMinHeight="200" AutoHideMinWidth="280">
<Grid x:Name="MainRouteGrid">
<ScrollViewer Background="#FFE5E5E5">
<StackPanel>
Expand All @@ -154,21 +170,21 @@
</Grid>
</xcad:LayoutAnchorable>

<xcad:LayoutAnchorable Title="Thera" CanClose="False" CanAutoHide="True" CanHide="True" ContentId="TheraContentID" AutoHideMinHeight="200" AutoHideMinWidth="280">
<xcad:LayoutAnchorable Title="Thera" CanClose="False" CanAutoHide="True" CanHide="false" ContentId="TheraContentID" AutoHideMinHeight="200" AutoHideMinWidth="280">
<ScrollViewer Background="#FFE5E5E5">
<StackPanel>

<DataGrid x:Name="TheraConnectionsList" Grid.Row="1" AreRowDetailsFrozen="True" AutoGenerateColumns="False" IsReadOnly="True" MouseDoubleClick="TheraConnectionsList_MouseDoubleClick">

<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style TargetType="DataGridRow">

<Style.Triggers>
<Style.Triggers>
<DataTrigger Binding="{Binding EstimatedEOL}" Value="critical">
<Setter Property="Background" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>

<DataGrid.Columns>
Expand All @@ -194,7 +210,7 @@
</xcad:LayoutRoot>
</xcad:DockingManager>

<Popup x:Name="SystemInfoPopup" IsOpen="False" AllowsTransparency="True" Width="100">
<Popup x:Name="SystemInfoPopup" IsOpen="False" AllowsTransparency="True" Width="100" Margin="458,0" Grid.RowSpan="2">
<StackPanel Background="#FF959595">
<Label Content="{Binding Name}" FontWeight="Bold" />

Expand Down
9 changes: 8 additions & 1 deletion MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public partial class MainWindow : Window

private static NLog.Logger OutputLog = NLog.LogManager.GetCurrentClassLogger();

private MapConfig MapConf;
private MapConfig MapConf { get; set; }

public MainWindow()
{
Expand Down Expand Up @@ -423,6 +423,13 @@ private void btn_UpdateThera_Click(object sender, RoutedEventArgs e)
{
EVEManager.UpdateTheraConnections();
}


private void MenuItem_ViewIntelClick(object sender, RoutedEventArgs e)
{

}

}

}
16 changes: 16 additions & 0 deletions MapConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,21 @@ public bool AlwaysOnTop
}
}

private bool m_ShowToolBox = true;
[Category("General")]
[DisplayName("Show Toolbox")]
public bool ShowToolBox
{
get
{
return m_ShowToolBox;
}
set
{
m_ShowToolBox = value;
OnPropertyChanged("ShowToolBox");
}
}



Expand All @@ -122,6 +137,7 @@ public void SetDefaults()
ShowSystemPopup = true;
MaxIntelSeconds = 120;
AlwaysOnTop = false;
ShowToolBox = true;
MapColours = new List<MapColours>();
}

Expand Down
8 changes: 5 additions & 3 deletions RegionControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
xmlns:dotNetKitControls="clr-namespace:DotNetKit.Windows.Controls;assembly=DotNetKit.Wpf.AutoCompleteComboBox"
xmlns:zoombox1="clr-namespace:WpfHelpers.WpfControls.Zoombox;assembly=WpfHelpers"
xmlns:local="clr-namespace:SMT"
xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="800">

<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="BoolToVis" />
<ContextMenu x:Key="SysRightClickContextMenu">

<ContextMenu.ItemTemplate>
Expand Down Expand Up @@ -52,17 +54,17 @@
</dotNetKitControls:AutoCompleteComboBox.ItemsPanel>
</dotNetKitControls:AutoCompleteComboBox>
<ComboBox x:Name="CharacterDropDown" Width="150" Margin="5,0" HorizontalAlignment="Center" SelectionChanged="CharacterDropDown_SelectionChanged" DropDownClosed="CharacterDropDown_DropDownClosed" />
<CheckBox x:Name="FollowCharacterChk" Margin="5,-1,5,0" Content="Follow?" HorizontalAlignment="Left" VerticalAlignment="Center" IsChecked="{Binding FollowCharacter}" Checked="FollowCharacterChk_Checked" />
<CheckBox x:Name="FollowCharacterChk" Margin="5,-1,5,0" Content="Follow?" HorizontalAlignment="Left" VerticalAlignment="Center" IsChecked="False" Checked="FollowCharacterChk_Checked" />
</StackPanel>


<Grid x:Name="MainCanvasGrid" ClipToBounds="True" Grid.Row="1">
<Grid x:Name="MainCanvasGrid" ClipToBounds="True" Grid.Row="1" >
<zoombox1:ZoomControl x:Name="MainZoomControl" MinZoom="0.2" MaxZoom="10" Margin="0" >
<Canvas x:Name="MainCanvas" Margin="5" Width="1050" Height="800" />
</zoombox1:ZoomControl>
<Label x:Name="label" HorizontalAlignment="Right" Margin="0,50,50,0" VerticalAlignment="Bottom" FontSize="30" Panel.ZIndex="50" FontWeight="Bold" />

<Border BorderThickness="2" BorderBrush="Black" Background="#FF232223" Width="210" Height="160" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,20,20" CornerRadius="4" Panel.ZIndex="111" Grid.Row="1" >
<Border BorderThickness="2" BorderBrush="Black" Background="#FF232223" Width="210" Height="160" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,20,20" CornerRadius="4" Panel.ZIndex="111" Grid.Row="1" Visibility="{Binding Path=MapConf.ShowToolBox, Converter={StaticResource BoolToVis}, diag:PresentationTraceSources.TraceLevel=High}" >
<Canvas x:Name="ToolBoxCanvas">
<Grid Canvas.Left="0" Canvas.Top="2" Width="210" >

Expand Down
4 changes: 3 additions & 1 deletion RegionControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ public void Init()
uiRefreshTimer.Interval = new TimeSpan(0, 0, 2);
uiRefreshTimer.Start();

ToolBoxCanvas.DataContext = this;
DataContext = this;

//ToolBoxCanvas.DataContext = this;

PropertyChanged += MapObjectChanged;
}
Expand Down

0 comments on commit 9b40a01

Please sign in to comment.