<Window x:Class="OPlanner.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="OPlanner" WindowState="Maximized" xmlns:CustomControl="clr-namespace:OPlanner" Closing="Window_Closing" Icon="Icon.ico">
    <Window.Resources>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Menu Height="25" Name="MainMenu" Grid.Row="0" Style="{StaticResource MainMenuStyle}">
            <MenuItem Header="File">
                <MenuItem Header="New" Name="newFileItem" Click="newFileItem_Click">
                    <MenuItem.Icon>
                        <Image Source="Icons/New.png"></Image>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Open" Name="openFileItem" Click="openFileItem_Click">
                    <MenuItem.Icon>
                        <Image Source="Icons/Open.png"></Image>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Save" Name="saveFileItem"  Click="saveFileItem_Click" IsEnabled="False">
                    <MenuItem.Icon>
                        <Image Source="Icons/Save.png"></Image>
                    </MenuItem.Icon>
                </MenuItem>
				<MenuItem Header="Save As" Name="saveAsFileItem"  Click="saveAsFileItem_Click" IsEnabled="False">
					<MenuItem.Icon>
						<Image Source="Icons/Save.png"></Image>
					</MenuItem.Icon>
				</MenuItem>
				<MenuItem Header="Close" Name="closeFileItem"  Click="closeFileItem_Click" IsEnabled="False">
                    <MenuItem.Icon>
                        <Image Source="Icons/Close.png"></Image>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Name="exportPrintDescriptionsItem" Header="Export/Print Descriptions" Click="exportPrintDescriptions_Click" IsEnabled="False">
                    <MenuItem.Icon>
                        <Image Source="Icons/Print.png"></Image>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Export/Print Course Maps" Name="exportPrintCoursesItem" Click="exportPrintCoursesItem_Click" IsEnabled="False">
                    <MenuItem.Icon>
                        <Image Source="Icons/Print.png"></Image>
                    </MenuItem.Icon>
                </MenuItem>
				<MenuItem Header="Export Course Data" Name="exportCourseDataItem" Click="exportCourseDataItem_Click" IsEnabled="False">
				</MenuItem>
				<MenuItem Header="Exit" Name="exitItem" Click="exitItem_Click">
                    <MenuItem.Icon>
                        <Image Source="Icons/Exit.png"></Image>
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
            <MenuItem Header="Edit">
                <MenuItem Header="Undo" Name="undoItem" Command="ApplicationCommands.Undo" IsEnabled="False">
                    <MenuItem.Icon>
                        <Image Source="Icons/Undo.png"></Image>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Redo" Name="redoItem" Command="ApplicationCommands.Redo" IsEnabled="False">
                    <MenuItem.Icon>
                        <Image Source="Icons/Redo.png"></Image>
                    </MenuItem.Icon>
                </MenuItem>
				<MenuItem Header="Copy" Name="copyItem" Command="ApplicationCommands.Copy">
				</MenuItem>
				<MenuItem Header="Paste" Name="pasteItem" Command="ApplicationCommands.Paste">
				</MenuItem>
				<MenuItem Header="Delete" Name="deleteItem" Click="deleteItem_Click" IsEnabled="False">
				</MenuItem>
				<MenuItem Header="Deselect" Name="deselectItem" Click="deselectItem_Click" IsEnabled="False">
				</MenuItem>
			</MenuItem>
            <MenuItem Header="Map">
                <MenuItem Header="Load Map" Name="loadMapItem" Click="loadMapItem_Click" IsEnabled="False">
                    <MenuItem.Icon>
                        <Image Source="Icons/Open.png"></Image>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Remove Map" Name="removeMapItem" Click="removeMapItem_Click" IsEnabled="False">
                    <MenuItem.Icon>
                        <Image Source="Icons/Close.png"></Image>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Canvas Size" Name="canvasSizeItem" Click="canvasSizeItem_Click" IsEnabled="False"></MenuItem>
                <MenuItem Header="Settings" Name="mapSettingsItem" Click="mapSettingsItem_Click" IsEnabled="False"></MenuItem>
				<MenuItem Header="Info" Name="mapInfoItem" Click="mapInfoItem_Click" IsEnabled="False"></MenuItem>
            </MenuItem>
			<MenuItem Header="Extras">
				<MenuItem Header="Renumber Controls" Name="renumberControlsItem" Click="renumberControlsItem_Click"  IsEnabled="False"></MenuItem>
				<MenuItem Header="Scale Coordinates" Name="scaleCoordinatesItem" Click="scaleCoordinatesItem_Click"  IsEnabled="False"></MenuItem>
				<MenuItem Header="Select Unused Controls" Name="selectUnusedControlsItem" Click="selectUnusedControlsItem_Click" IsEnabled="False"></MenuItem>
			</MenuItem>
			<MenuItem Header="Help">
				<MenuItem Header="Online Help" Name="onlineHelpItem" Click="onlineHelpItem_Click"></MenuItem>
				<MenuItem Header="About" Name="aboutItem" Click="aboutItem_Click"></MenuItem>
				<MenuItem Header="Check for Updates" Name="updateCheckItem" Click="updateCheckItem_Click"></MenuItem>
			</MenuItem>
		</Menu>
        <StackPanel Grid.Row="1" Orientation="Horizontal" Background="{StaticResource SubMenuBarBrush}">
            <StackPanel.Resources>
                <Style TargetType="Button">
                    <Setter Property="Template" Value="{StaticResource SubMenuBarButtonTemplate}"></Setter>
                </Style>
            </StackPanel.Resources>
            <Button Name="saveButton" Click="saveFileItem_Click" IsEnabled="False">
                <Image Source="Icons/Save.png" Width="16" Height="16" Stretch="Fill" VerticalAlignment="Center"></Image>
            </Button>
			<StackPanel Orientation="Horizontal" Margin="10,0,0,0">
				<Label>Zoom:</Label>
				<CustomControl:CustomSlider Height="20" x:Name="zoomSlider" Width="100" VerticalAlignment="Center" Margin="5,0,0,0" Value="0" Maximum="2.7" Minimum="-3" ValueChanged="zoomSlider_ValueChanged" ThumbDoubleClick="zoomSlider_ThumbDoubleClick" />
				<TextBox Name="zoomText" Width="40" Height="23" Padding="0,0,0,0" LostFocus="zoomText_LostFocus"></TextBox>
				<Label>%</Label>
				<Button Name="fullSizeButton" Click="fullSizeButton_Click">
					Full Size
				</Button>
			</StackPanel>
		</StackPanel>
        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100" MinWidth="100" MaxWidth="100"></ColumnDefinition>
                <ColumnDefinition Width="3"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="3"></ColumnDefinition>
                <ColumnDefinition Width="200" MinWidth="100" MaxWidth="300"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <GridSplitter Grid.Column="1" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsEnabled="False" />
            <GridSplitter Grid.Column="3" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
            <Grid Grid.Column="2">
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition Height="3"></RowDefinition>
                    <RowDefinition Height="170" MinHeight="170" MaxHeight="300"></RowDefinition>
                </Grid.RowDefinitions>
                <GridSplitter Grid.Row="1" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                <ScrollViewer Name="mainView" Grid.Row="0" Margin="0,0,0,0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Background="#CCCCCC" KeyDown="mainView_KeyDown" PreviewKeyDown="mainView_PreviewKeyDown" PreviewKeyUp="mainView_PreviewKeyUp">
                    <AdornerDecorator ClipToBounds="True" HorizontalAlignment="Center" VerticalAlignment="Center">
                        <CustomControl:OCanvas x:Name="mainCanvas" Visibility="Collapsed"></CustomControl:OCanvas>
                    </AdornerDecorator>
                </ScrollViewer>
                <CustomControl:ObjectProperties Grid.Row="2" x:Name="objectPropertiesPanel"></CustomControl:ObjectProperties>
            </Grid>
            <CustomControl:ToolsPanel x:Name="toolsPanel" Grid.Column="0"></CustomControl:ToolsPanel>
            <Grid Grid.Column="4">
                <Grid.RowDefinitions>
                    <RowDefinition MinHeight="50"></RowDefinition>
                    <RowDefinition Height="3"></RowDefinition>
                    <RowDefinition MinHeight="50"></RowDefinition>
                </Grid.RowDefinitions>
                <GridSplitter Grid.Row="1" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                <CustomControl:CoursesPanel Grid.Row="0" x:Name="coursesPanel"></CustomControl:CoursesPanel>
                <CustomControl:ObjectsPanel Grid.Row="2" x:Name="objectsPanel"></CustomControl:ObjectsPanel>
            </Grid>
        </Grid>
    </Grid>
</Window>
