Skip to content

Commit

Permalink
fix minsize window
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Jun 27, 2022
1 parent e31b3de commit 25acbc8
Showing 1 changed file with 99 additions and 43 deletions.
142 changes: 99 additions & 43 deletions RevitPythonShell/Views/IronPythonConsole.xaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
<Window x:Class="RevitPythonShell.Views.IronPythonConsole"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
xmlns:console="clr-namespace:PythonConsoleControl;assembly=PythonConsoleControl"
xmlns:wpg="clr-namespace:WPG;assembly=WPG"
xmlns:pg="http://schemas.denisvuyka.wordpress.com/wpfpropertygrid"
Title="IronPython Console" Height="600" Width="850">
<!--
Copyright (c) 2010 Joe Moorhouse
<Window
Height="600"
MinHeight="400"
MinWidth="300"
Title="IronPython Console"
Width="850"
x:Class="RevitPythonShell.Views.IronPythonConsole"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
xmlns:console="clr-namespace:PythonConsoleControl;assembly=PythonConsoleControl"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--
Copyright (c) 2010 Joe Moorhouse
-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="30*"/>
<RowDefinition Height="50*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="30*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid Grid.Row="0" Grid.Column="0">
<console:IronPythonConsoleControl Name="consoleControl"></console:IronPythonConsoleControl>
<Grid Grid.Column="0" Grid.Row="0">
<console:IronPythonConsoleControl Name="consoleControl" />
</Grid>
<GridSplitter Grid.Row="1" Height="10" VerticalAlignment="Center" HorizontalAlignment="Stretch"></GridSplitter>
<DockPanel Grid.Row="2" Grid.Column="0">
<GridSplitter
Grid.Row="1"
Height="10"
HorizontalAlignment="Stretch"
VerticalAlignment="Center" />
<DockPanel Grid.Column="0" Grid.Row="2">
<ToolBar DockPanel.Dock="Top">
<ToolBar.Resources>
<Style TargetType="{x:Type Image}">
Expand All @@ -35,55 +42,104 @@
</Style>
</ToolBar.Resources>
<Button Click="openFileClick">
<Image Source="/RevitPythonShell;component/Resources/Theme/Open.png" Height="16" SnapsToDevicePixels="True" ToolTip="Open Python Script"/>
<Image
Height="16"
SnapsToDevicePixels="True"
Source="/RevitPythonShell;component/Resources/Theme/Open.png"
ToolTip="Open Python Script" />
</Button>
<Button Click="saveFileClick">
<Image Source="/RevitPythonShell;component/Resources/Theme/Save.png" Height="16" SnapsToDevicePixels="True" ToolTip="Save This Script Into File"/>
<Image
Height="16"
SnapsToDevicePixels="True"
Source="/RevitPythonShell;component/Resources/Theme/Save.png"
ToolTip="Save This Script Into File" />
</Button>
<Separator/>
<Separator />
<Button Command="Cut">
<Image Source="/RevitPythonShell;component/Resources/Theme/Cut.png" Height="16" SnapsToDevicePixels="True" ToolTip="Cut Selected"/>
<Image
Height="16"
SnapsToDevicePixels="True"
Source="/RevitPythonShell;component/Resources/Theme/Cut.png"
ToolTip="Cut Selected" />
</Button>
<Button Command="Copy">
<Image Source="/RevitPythonShell;component/Resources/Theme/Copy.png" Height="16" SnapsToDevicePixels="True" ToolTip="Copy Selected"/>
<Image
Height="16"
SnapsToDevicePixels="True"
Source="/RevitPythonShell;component/Resources/Theme/Copy.png"
ToolTip="Copy Selected" />
</Button>
<Button Command="Paste">
<Image Source="/RevitPythonShell;component/Resources/Theme/Paste.png" Height="16" SnapsToDevicePixels="True" ToolTip="Paste Into Script Editor"/>
<Image
Height="16"
SnapsToDevicePixels="True"
Source="/RevitPythonShell;component/Resources/Theme/Paste.png"
ToolTip="Paste Into Script Editor" />
</Button>
<Button Command="Delete">
<Image Source="/RevitPythonShell;component/Resources/Theme/Delete.png" Height="16" SnapsToDevicePixels="True" ToolTip="Delete Selected"/>
<Image
Height="16"
SnapsToDevicePixels="True"
Source="/RevitPythonShell;component/Resources/Theme/Delete.png"
ToolTip="Delete Selected" />
</Button>
<Separator/>
<Separator />
<Button Command="Undo">
<Image Source="/RevitPythonShell;component/Resources/Theme/Undo.png" Height="16" SnapsToDevicePixels="True" ToolTip="Undo"/>
<Image
Height="16"
SnapsToDevicePixels="True"
Source="/RevitPythonShell;component/Resources/Theme/Undo.png"
ToolTip="Undo" />
</Button>
<Button Command="Redo">
<Image Source="/RevitPythonShell;component/Resources/Theme/Redo.png" Height="16" SnapsToDevicePixels="True" ToolTip="Redo"/>
<Image
Height="16"
SnapsToDevicePixels="True"
Source="/RevitPythonShell;component/Resources/Theme/Redo.png"
ToolTip="Redo" />
</Button>
<Separator/>
<CheckBox IsChecked="{Binding ElementName=textEditor,Path=WordWrap}">
<Image Source="/RevitPythonShell;component/Resources/Theme/WordWrap.png" Height="16" SnapsToDevicePixels="True" ToolTip="Toggle Word Wrap"/>
<Separator />
<CheckBox IsChecked="{Binding ElementName=textEditor, Path=WordWrap}">
<Image
Height="16"
SnapsToDevicePixels="True"
Source="/RevitPythonShell;component/Resources/Theme/WordWrap.png"
ToolTip="Toggle Word Wrap" />
</CheckBox>
<CheckBox IsChecked="{Binding ElementName=textEditor,Path=ShowLineNumbers}">
<Image Source="/RevitPythonShell;component/Resources/Theme/Number.png" Height="16" SnapsToDevicePixels="True" ToolTip="Toggle Line Numbers"/>
<CheckBox IsChecked="{Binding ElementName=textEditor, Path=ShowLineNumbers}">
<Image
Height="16"
SnapsToDevicePixels="True"
Source="/RevitPythonShell;component/Resources/Theme/Number.png"
ToolTip="Toggle Line Numbers" />
</CheckBox>
<CheckBox IsChecked="{Binding ElementName=textEditor,Path=Options.ShowEndOfLine}">
<Image Source="/RevitPythonShell;component/Resources/Theme/Paragraph.png" Height="16" SnapsToDevicePixels="True" ToolTip="Toggle Show End of Line"/>
<CheckBox IsChecked="{Binding ElementName=textEditor, Path=Options.ShowEndOfLine}">
<Image
Height="16"
SnapsToDevicePixels="True"
Source="/RevitPythonShell;component/Resources/Theme/Paragraph.png"
ToolTip="Toggle Show End of Line" />
</CheckBox>
<Separator/>
<Separator />
<Button Click="runClick">
<Image Source="/RevitPythonShell;component/Resources/Theme/Run.png" Height="16" SnapsToDevicePixels="True" ToolTip="Run Script. Results will be displayed in the IronPython prompt."/>
<Image
Height="16"
SnapsToDevicePixels="True"
Source="/RevitPythonShell;component/Resources/Theme/Run.png"
ToolTip="Run Script. Results will be displayed in the IronPython prompt." />
</Button>
</ToolBar>
<Grid DockPanel.Dock="Bottom">
<avalonEdit:TextEditor
Name="textEditor"
FontFamily="Consolas"
FontSize="10pt" GotFocus="textEditor_GotFocus"
># IronPython Pad. Write code snippets here and F5 to run.
FontFamily="Consolas"
FontSize="10pt"
GotFocus="textEditor_GotFocus"
Name="textEditor">
# IronPython Pad. Write code snippets here and F5 to run.
</avalonEdit:TextEditor>
</Grid>
</DockPanel>

</Grid>
</Window>

0 comments on commit 25acbc8

Please sign in to comment.