Browse Source

Fixed layout of SnippetOptionPanel.

Removed unused EditTemplateDialog.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5072 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
82643cb089
  1. 67
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Snippets/SnippetOptionPanel.xaml
  2. 2
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/FoldingManager.cs
  3. 4
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  4. 67
      src/Main/Base/Project/Resources/EditTemplateDialog.xfrm
  5. 37
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/EditTemplateDialog.cs
  6. 2
      src/Main/Base/Project/Src/Gui/Dialogs/TreeViewOptionsDialog.xaml
  7. 1
      src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj
  8. 37
      src/Main/ICSharpCode.Core.Presentation/RestrictDesiredSize.cs

67
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Snippets/SnippetOptionPanel.xaml

@ -6,15 +6,13 @@
<RowDefinition <RowDefinition
Height="Auto" /> Height="Auto" />
<RowDefinition <RowDefinition
Height="1*" /> Height="2*" MinHeight="120" />
<RowDefinition <RowDefinition
Height="1*" /> Height="1*" MinHeight="80" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid <Grid
Grid.Column="0" Grid.Column="0"
Grid.Row="0" Grid.Row="0">
HorizontalAlignment="Stretch"
VerticalAlignment="Top">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition <RowDefinition
Height="Auto" /> Height="Auto" />
@ -37,6 +35,7 @@
DisplayMemberPath="Extensions" DisplayMemberPath="Extensions"
Grid.Column="1" Grid.Column="1"
Grid.Row="0" Grid.Row="0"
Margin="0,0,4,0"
Height="23" /> Height="23" />
<StackPanel <StackPanel
Grid.Column="0" Grid.Column="0"
@ -88,35 +87,39 @@
Padding="9,1,9,1" Padding="9,1,9,1"
Click="RemoveSnippetButton_Click" /> Click="RemoveSnippetButton_Click" />
</StackPanel>--> </StackPanel>-->
<DataGrid <core:RestrictDesiredSize
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0">
x:Name="dataGrid" <DataGrid
SelectionMode="Single" x:Name="dataGrid"
CanUserAddRows="True" SelectionMode="Single"
CanUserDeleteRows="True" CanUserAddRows="True"
SelectionUnit="FullRow" CanUserDeleteRows="True"
HeadersVisibility="Column" SelectionUnit="FullRow"
CanUserResizeRows="False" HeadersVisibility="Column"
AutoGenerateColumns="False" CanUserResizeRows="False"
ItemsSource="{Binding ElementName=extensionComboBox, Path=SelectedItem.Snippets}" AutoGenerateColumns="False"
SelectionChanged="DataGrid_SelectionChanged"> ItemsSource="{Binding ElementName=extensionComboBox, Path=SelectedItem.Snippets}"
<DataGrid.Columns> SelectionChanged="DataGrid_SelectionChanged">
<DataGridTextColumn <DataGrid.Columns>
Header="{core:Localize Dialog.Options.CodeTemplate.Template}" <DataGridTextColumn
Binding="{Binding Name}" /> Header="{core:Localize Dialog.Options.CodeTemplate.Template}"
<DataGridTextColumn Binding="{Binding Name}" />
Header="{core:Localize Dialog.Options.CodeTemplate.Description}" <DataGridTextColumn
Width="*" Header="{core:Localize Dialog.Options.CodeTemplate.Description}"
Binding="{Binding Description}" /> Width="*"
</DataGrid.Columns> Binding="{Binding Description}" />
</DataGrid> </DataGrid.Columns>
</DataGrid>
</core:RestrictDesiredSize>
<!--</DockPanel>--> <!--</DockPanel>-->
<AvalonEdit:TextEditor <core:RestrictDesiredSize
x:Name="snippetTextBox"
Grid.Column="0" Grid.Column="0"
Grid.Row="2" Grid.Row="2">
FontFamily="Consolas, Courier New" <AvalonEdit:TextEditor
TextChanged="SnippetTextBox_TextChanged"/> x:Name="snippetTextBox"
FontFamily="Consolas, Courier New"
TextChanged="SnippetTextBox_TextChanged"/>
</core:RestrictDesiredSize>
</Grid> </Grid>
</UserControl> </UserControl>

2
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Folding/FoldingManager.cs

@ -164,7 +164,7 @@ namespace ICSharpCode.AvalonEdit.Folding
} }
/// <summary> /// <summary>
/// Gets all foldings that contain <param name="offset" />. /// Gets all foldings that contain <paramref name="offset" />.
/// </summary> /// </summary>
public ReadOnlyCollection<FoldingSection> GetFoldingsContaining(int offset) public ReadOnlyCollection<FoldingSection> GetFoldingsContaining(int offset)
{ {

4
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -351,9 +351,6 @@
<Compile Include="Src\Gui\Dialogs\WordCountDialog.cs"> <Compile Include="Src\Gui\Dialogs\WordCountDialog.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\EditTemplateDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ExternalToolPanel.cs"> <Compile Include="Src\Gui\Dialogs\OptionPanels\ExternalToolPanel.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
@ -550,7 +547,6 @@
<EmbeddedResource Include="Resources\CommonAboutDialog.xfrm" /> <EmbeddedResource Include="Resources\CommonAboutDialog.xfrm" />
<Compile Include="Configuration\AssemblyInfo.cs" /> <Compile Include="Configuration\AssemblyInfo.cs" />
<EmbeddedResource Include="Resources\EditStandardHeaderPanel.xfrm" /> <EmbeddedResource Include="Resources\EditStandardHeaderPanel.xfrm" />
<EmbeddedResource Include="Resources\EditTemplateDialog.xfrm" />
<EmbeddedResource Include="Resources\ExternalToolOptions.xfrm" /> <EmbeddedResource Include="Resources\ExternalToolOptions.xfrm" />
<EmbeddedResource Include="Resources\FontSelectionPanel.xfrm" /> <EmbeddedResource Include="Resources\FontSelectionPanel.xfrm" />
<EmbeddedResource Include="Resources\NewFileWithNameDialog.xfrm" /> <EmbeddedResource Include="Resources\NewFileWithNameDialog.xfrm" />

67
src/Main/Base/Project/Resources/EditTemplateDialog.xfrm

@ -1,67 +0,0 @@
<Components version="1.0">
<System.Windows.Forms.Form>
<Name value="MyForm" />
<ShowInTaskbar value="False" />
<FormBorderStyle value="FixedDialog" />
<StartPosition value="CenterParent" />
<ClientSize value="{Width=338, Height=100}" />
<MinimizeBox value="False" />
<DockPadding value="" />
<Text value="${res:Dialog.Options.CodeTemplate.EditTemplateDialog.DialogName}" />
<AcceptButton value="okButton [System.Windows.Forms.Button], Text: ${res:Global.OKButtonText}" />
<CancelButton value="cancelButton [System.Windows.Forms.Button], Text: ${res:Global.CancelButtonText}" />
<MaximizeBox value="False" />
<Controls>
<System.Windows.Forms.Button>
<Name value="okButton" />
<Location value="{X=173,Y=71}" />
<ClientSize value="{Width=75, Height=23}" />
<Text value="${res:Global.OKButtonText}" />
<Anchor value="Bottom, Right" />
<TabIndex value="4" />
<DialogResult value="OK" />
</System.Windows.Forms.Button>
<System.Windows.Forms.Button>
<Name value="cancelButton" />
<Location value="{X=253,Y=71}" />
<ClientSize value="{Width=75, Height=23}" />
<Text value="${res:Global.CancelButtonText}" />
<Anchor value="Bottom, Right" />
<TabIndex value="5" />
<DialogResult value="Cancel" />
</System.Windows.Forms.Button>
<System.Windows.Forms.TextBox>
<Name value="descriptionTextBox" />
<Anchor value="Top, Left, Right" />
<TabIndex value="3" />
<Location value="{X=112,Y=38}" />
<ClientSize value="{Width=212, Height=17}" />
<Text value="" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="descriptionLabel" />
<Text value="${res:Dialog.Options.CodeTemplate.EditTemplateDialog.DescriptionLabel}" />
<TextAlign value="MiddleRight" />
<TabIndex value="2" />
<ClientSize value="{Width=100, Height=21}" />
<Location value="{X=8,Y=38}" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="templateTextBox" />
<Anchor value="Top, Left, Right" />
<TabIndex value="1" />
<Location value="{X=112,Y=8}" />
<ClientSize value="{Width=212, Height=17}" />
<Text value="" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="templateLabel" />
<Text value="${res:Dialog.Options.CodeTemplate.EditTemplateDialog.TemplateLabel}" />
<TextAlign value="MiddleRight" />
<TabIndex value="0" />
<ClientSize value="{Width=100, Height=21}" />
<Location value="{X=8,Y=8}" />
</System.Windows.Forms.Label>
</Controls>
</System.Windows.Forms.Form>
</Components>

37
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/EditTemplateDialog.cs

@ -1,37 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Drawing;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui.XmlForms;
using ICSharpCode.SharpDevelop.Internal.Templates;
namespace ICSharpCode.SharpDevelop.Gui
{
public class EditTemplateDialog : BaseSharpDevelopForm
{
void AcceptEvent(object sender, EventArgs e)
{
// codeTemplate.Shortcut = ControlDictionary["templateTextBox"].Text;
// codeTemplate.Description = ControlDictionary["descriptionTextBox"].Text;
}
void InitializeComponents()
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.EditTemplateDialog.xfrm"));
// ControlDictionary["templateTextBox"].Text = codeTemplate.Shortcut;
// ControlDictionary["descriptionTextBox"].Text = codeTemplate.Description;
ControlDictionary["okButton"].Click += new EventHandler(AcceptEvent);
Icon = null;
}
}
}

2
src/Main/Base/Project/Src/Gui/Dialogs/TreeViewOptionsDialog.xaml

@ -3,6 +3,8 @@
x:Class="ICSharpCode.SharpDevelop.Gui.TreeViewOptionsDialog" x:Class="ICSharpCode.SharpDevelop.Gui.TreeViewOptionsDialog"
Height="414" Height="414"
Width="552" Width="552"
MinHeight="260"
MinWidth="480"
Style="{StaticResource DialogWindow}"> Style="{StaticResource DialogWindow}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>

1
src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj

@ -67,6 +67,7 @@
<Compile Include="..\GlobalAssemblyInfo.cs"> <Compile Include="..\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link> <Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile> </Compile>
<Compile Include="RestrictDesiredSize.cs" />
<Compile Include="SortableGridViewColumn.cs" /> <Compile Include="SortableGridViewColumn.cs" />
<Compile Include="CollapsiblePanel.cs" /> <Compile Include="CollapsiblePanel.cs" />
<Compile Include="ConditionalSeparator.cs" /> <Compile Include="ConditionalSeparator.cs" />

37
src/Main/ICSharpCode.Core.Presentation/RestrictDesiredSize.cs

@ -0,0 +1,37 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace ICSharpCode.Core.Presentation
{
/// <summary>
/// Cancels the desired size of the child elements. Use this control around scrolling containers (e.g. ListBox) used
/// inside auto-scroll contexts.
/// </summary>
public class RestrictDesiredSize : Decorator
{
Size lastArrangeSize = new Size(double.NaN, double.NaN);
protected override Size MeasureOverride(Size constraint)
{
return new Size(0, 0);
}
protected override Size ArrangeOverride(Size arrangeSize)
{
if (lastArrangeSize != arrangeSize) {
lastArrangeSize = arrangeSize;
base.MeasureOverride(arrangeSize);
}
return base.ArrangeOverride(arrangeSize);
}
}
}
Loading…
Cancel
Save