<Window x:Class="HaCreator.GUI.HaEditor"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        
        xmlns:local="clr-namespace:HaCreator.GUI"
        xmlns:editorItems="clr-namespace:HaCreator.GUI.EditorPanels"
        xmlns:mapEditor="clr-namespace:HaCreator.MapEditor"

        mc:Ignorable="d" 
        d:DesignHeight="721" d:DesignWidth="1111" 
        
        MouseWheel="OnMouseWheel" 
        Closing="HaEditor2_Closing" 
        SizeChanged="WindowSizeChanged" Title="HaCreator resurrected">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="20"/>
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="350"/>
        </Grid.ColumnDefinitions>

        <local:HaRibbon x:Name="ribbon"
                        Grid.Row="0" Grid.ColumnSpan="2"/>

        <!-- editor board-->
        <Grid Grid.Row="1" Grid.Column="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            
            <TabControl x:Name="tabControl1" Grid.Row="0"
                       SelectionChanged="tabControl1_SelectionChanged"
                        >

            </TabControl>
            <mapEditor:MultiBoard x:Name="multiBoard" Grid.Row="1"/>
        </Grid>


        <!-- Side panel-->
        <ScrollViewer Grid.Row="1" Grid.Column="1"
                      HorizontalScrollBarVisibility="Disabled"
                      VerticalScrollBarVisibility="Visible"
                      x:Name="editorPanel">
            <StackPanel Orientation="Vertical">

                <Expander Header="Tile"
                          Expanded="Expander_Expanded" Collapsed="Expander_Collapsed">
                    <WindowsFormsHost x:Name="tilePanelHost" Visibility="Collapsed">
                        <editorItems:TilePanel x:Name="tilePanel"/>
                    </WindowsFormsHost>
                </Expander>

                <Expander Header="Object"
                          Expanded="Expander_Expanded" Collapsed="Expander_Collapsed">
                    <WindowsFormsHost x:Name="objPanelHost" Visibility="Collapsed">
                        <editorItems:ObjPanel x:Name="objPanel"/>
                    </WindowsFormsHost>
                </Expander>

                <Expander Header="Life"
                          Expanded="Expander_Expanded" Collapsed="Expander_Collapsed">
                    <WindowsFormsHost x:Name="lifePanelHost" Visibility="Collapsed">
                        <editorItems:LifePanel x:Name="lifePanel"/>
                    </WindowsFormsHost>
                </Expander>

                <Expander Header="Portal"
                          Expanded="Expander_Expanded" Collapsed="Expander_Collapsed">
                    <WindowsFormsHost x:Name="portalPanelHost" Visibility="Collapsed">
                        <editorItems:PortalPanel x:Name="portalPanel"/>
                    </WindowsFormsHost>
                </Expander>

                <Expander Header="Background"
                          Expanded="Expander_Expanded" Collapsed="Expander_Collapsed">
                    <WindowsFormsHost x:Name="bgPanelHost" Visibility="Collapsed">
                        <editorItems:BackgroundPanel x:Name="bgPanel"/>
                    </WindowsFormsHost>
                </Expander>

                <Expander x:Name="expander_bgBlackBorderPanel"
                           Header="Background Border"
                          Expanded="Expander_Expanded" Collapsed="Expander_Collapsed">
                    <WindowsFormsHost x:Name="bgBlackBorderPanelHost" Visibility="Collapsed">
                        <editorItems:BlackBorderPanel x:Name="bgBlackBorderPanel"/>
                    </WindowsFormsHost>
                </Expander>

                <Expander Header="Common"
                          Expanded="Expander_Expanded" Collapsed="Expander_Collapsed">
                    <WindowsFormsHost x:Name="commonPanelHost" Visibility="Collapsed">
                        <editorItems:CommonPanel x:Name="commonPanel"/>
                    </WindowsFormsHost>
                </Expander>

                <Button x:Name="btnObjectViewer"
                        Content="Object Viewer"
                        Click="BtnObjectViewer_Click"
                        Margin="5"
                        Padding="10,5"
                        ToolTip="Open Object Viewer window"/>

                <Expander x:Name="expanderAIMapEditor"
                          Header="AI Map Editor"
                          Expanded="ExpanderAIMapEditor_Expanded"
                          ToolTip="Open AI Map Editor for the current map"/>
            </StackPanel>
        </ScrollViewer>

        <StatusBar x:Name="statusBar" Grid.Row="2" Grid.ColumnSpan="2">
            <StatusBarItem HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="5*"/>
                        <ColumnDefinition Width="5*"/>
                    </Grid.ColumnDefinitions>

                    <StackPanel Grid.Column="0" Orientation="Horizontal">
                        <TextBlock Text="Game Cursor: X = " />
                        <TextBlock x:Name="textblock_CursorX" Text="0" />
                        <TextBlock Text=", Y = " />
                        <TextBlock x:Name="textblock_CursorY" Text="0" />

                        <TextBlock Text="|" Margin="20,0,20,0"/>
                        <TextBlock Text="Monitor cursor: X = " />
                        <TextBlock x:Name="textblock_RCursorX" Text="0" />
                        <TextBlock Text=", Y = " />
                        <TextBlock x:Name="textblock_RCursorY" Text="0" />
                    </StackPanel>

                    <StackPanel Grid.Column="1" Orientation="Horizontal" Margin="0,0,0,0">
                        <TextBlock Text="|" Margin="20,0,20,0"/>
                        <TextBlock Text="Selected item: " />
                        <TextBlock x:Name="textblock_selectedItem" Text="" />

                        <TextBlock Text="|" Margin="20,0,10,0"/>
                        <TextBlock Text="Zoom: " VerticalAlignment="Center"/>
                        <Button x:Name="btnZoomOut" Content="-" Width="20" Height="18"
                                Click="BtnZoomOut_Click" ToolTip="Zoom Out" Padding="0,-2,0,0"/>
                        <TextBlock x:Name="txtZoomLevel" Text="100%" Width="40" TextAlignment="Center"
                                   VerticalAlignment="Center" Margin="2,0"/>
                        <Button x:Name="btnZoomIn" Content="+" Width="20" Height="18"
                                Click="BtnZoomIn_Click" ToolTip="Zoom In" Padding="0,-2,0,0"/>
                        <Button x:Name="btnZoomReset" Content="1:1" Width="28" Height="18"
                                Click="BtnZoomReset_Click" ToolTip="Reset Zoom" Margin="4,0,0,0" Padding="0,-2,0,0"/>
                    </StackPanel>
                </Grid>
               
            </StatusBarItem>
        </StatusBar>
    </Grid>

</Window>
