Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 141 additions & 28 deletions Source/IFCExporterUIOverride/IFCClassificationUI.xaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,147 @@
<auiw:ChildWindow x:Class="BIM.IFC.Export.UI.IFCClassificationWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:p="clr-namespace:BIM.IFC.Export.UI.Properties"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:auiw="clr-namespace:Autodesk.UI.Windows;assembly=Autodesk.UI.Windows"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="{x:Static p:Resources.ClassificationSetting}"
Name="ClassificationTab"
Initialized="ClassificationTab_Initialized"
Loaded="Window_Loaded"
d:DesignWidth="570"
SizeToContent="WidthAndHeight"
HorizontalAlignment="Stretch"
Margin="10,5,5,10"
Height="315">
<Grid Height="276" VerticalAlignment="Top" Margin="0,7,0,0" Grid.RowSpan="2">
<Label Content="{x:Static p:Resources.Name}" Height="28" HorizontalAlignment="Left" Margin="16,10,0,0" Name="ClassificationName" VerticalAlignment="Top" Width="53" />
<TextBox Text="{Binding Path=ClassificationName, UpdateSourceTrigger=PropertyChanged}" Height="23" HorizontalAlignment="Stretch" Margin="235,10,27,0" Name="ClassificationNameTextBox" VerticalAlignment="Top" Width="300" HorizontalContentAlignment="Stretch" ToolTip="{x:Static p:Resources.ClassificationSystemName}" />
<Label Content="{x:Static p:Resources.SourcePublisher}" Height="28" HorizontalAlignment="Left" Margin="16,39,0,0" Name="SourceOrPublisher" VerticalAlignment="Top" Width="105" Grid.ColumnSpan="2" />
<TextBox Text="{Binding Path=ClassificationSource, UpdateSourceTrigger=PropertyChanged}" Height="23" HorizontalAlignment="Stretch" Margin="235,39,27,0" Name="ClassificationSourceTextBox" VerticalAlignment="Top" Width="300" HorizontalContentAlignment="Stretch" ToolTip="{x:Static p:Resources.ClassificationSystemSource}" />
<Label Content="{x:Static p:Resources.Edition}" Height="28" HorizontalAlignment="Left" Margin="16,68,0,0" Name="Edition" VerticalAlignment="Top" IsEnabled="True" Width="53" />
<TextBox Text="{Binding Path=ClassificationEdition, UpdateSourceTrigger=PropertyChanged}" Height="23" HorizontalAlignment="Stretch" Margin="235,68,27,0" Name="ClassificationEditionTextBox" VerticalAlignment="Top" Width="300" HorizontalContentAlignment="Stretch" ToolTip="{x:Static p:Resources.ClassificationSystemEdition}" />
<Label Content="{x:Static p:Resources.EditionDate}" Height="35" HorizontalAlignment="Left" Margin="16,96,0,0" Name="EditionDate" VerticalAlignment="Top" RenderTransformOrigin="0.441,0.466" Width="95" Grid.ColumnSpan="2" />
<DatePicker SelectedDate="{Binding Path=ClassificationEditionDate}" Height="25" Margin="235,97,212,0" Name="datePicker1" VerticalAlignment="Top" />
<Label Content="{x:Static p:Resources.DocumentationLocation}" Height="28" HorizontalAlignment="Left" Margin="16,132,0,0" Name="location" VerticalAlignment="Top" Width="186" Grid.ColumnSpan="2" />
<TextBox Text="{Binding Path=ClassificationLocation, UpdateSourceTrigger=PropertyChanged}" Height="28" Margin="235,132,27,0" Name="ClassificationLocationtextBox" VerticalAlignment="Top" ToolTip="{x:Static p:Resources.ClassificationAltLocation}"/>
<Label Content="{x:Static p:Resources.ClassificationFieldName}" HorizontalAlignment="Left" Margin="16,165,0,0" Name="Label_FieldName" VerticalAlignment="Top" Width="186" Grid.ColumnSpan="2" />
<TextBox Text="{Binding Path=ClassificationFieldName, UpdateSourceTrigger=PropertyChanged}" Height="28" Margin="235,165,27,0" Name="TextBox_FieldName" VerticalAlignment="Top" ToolTip="{x:Static p:Resources.ClassificationAltName}"/>
<Button Content="{x:Static p:Resources.OK}" Height="22" x:Name="buttonOK" Width="75" Click="buttonOK_Click" Margin="0,0,106,12" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
<Button Content="{x:Static p:Resources.Cancel}" Height="22" Name="buttonCancel" Width="75" Click="bottonCancel_Click" RenderTransformOrigin="0.507,-4.636" Margin="0,0,26,12" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:p="clr-namespace:BIM.IFC.Export.UI.Properties"
Name="ClassificationTab"
Title="{x:Static p:Resources.ClassificationSetting}"
MinWidth="570"
MinHeight="315"
Margin="10,5,5,10"
HorizontalAlignment="Stretch"
d:DesignWidth="570"
Initialized="ClassificationTab_Initialized"
Loaded="Window_Loaded"
ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
mc:Ignorable="d">
<Grid Grid.RowSpan="2"
Height="276"
Margin="0,7,0,0"
VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="160" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.Resources>
<Style TargetType="TextBox">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
</Style>
<Style TargetType="Label">
<Setter Property="Margin" Value="5,0,0,0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
</Grid.Resources>
<Label Name="ClassificationName"
Height="28"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Content="{x:Static p:Resources.Name}" />
<TextBox Name="ClassificationNameTextBox"
Grid.Column="1"
Width="300"
Height="23"
Text="{Binding Path=ClassificationName, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{x:Static p:Resources.ClassificationSystemName}" />
<Label Name="SourceOrPublisher"
Grid.Row="1"
Grid.ColumnSpan="2"
Height="28"
Content="{x:Static p:Resources.SourcePublisher}" />
<TextBox Name="ClassificationSourceTextBox"
Grid.Row="1"
Grid.Column="1"
Width="300"
Height="23"
Text="{Binding Path=ClassificationSource, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{x:Static p:Resources.ClassificationSystemSource}" />
<Label Name="Edition"
Grid.Row="2"
Height="28"
Content="{x:Static p:Resources.Edition}"
IsEnabled="True" />
<TextBox Name="ClassificationEditionTextBox"
Grid.Row="2"
Grid.Column="1"
Width="300"
Height="23"
Text="{Binding Path=ClassificationEdition, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{x:Static p:Resources.ClassificationSystemEdition}" />
<Label Name="EditionDate"
Grid.Row="3"
Height="35"
Content="{x:Static p:Resources.EditionDate}"
RenderTransformOrigin="0.441,0.466" />
<DatePicker Name="datePicker1"
Grid.Row="3"
Grid.Column="1"
Width="130"
Height="25"
HorizontalAlignment="Left"
VerticalAlignment="Center"
SelectedDate="{Binding Path=ClassificationEditionDate}" />
<Label Name="location"
Grid.Row="4"
Grid.ColumnSpan="2"
Width="186"
Height="28"
Content="{x:Static p:Resources.DocumentationLocation}" />
<TextBox Name="ClassificationLocationtextBox"
Grid.Row="4"
Grid.Column="1"
Width="300"
Height="28"
Margin="0,5"
Text="{Binding Path=ClassificationLocation, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{x:Static p:Resources.ClassificationAltLocation}" />
<Label Name="Label_FieldName"
Grid.Row="5"
Grid.ColumnSpan="2"
Width="186"
Content="{x:Static p:Resources.ClassificationFieldName}" />
<TextBox Name="TextBox_FieldName"
Grid.Row="5"
Grid.Column="1"
Width="300"
Height="28"
Text="{Binding Path=ClassificationFieldName, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{x:Static p:Resources.ClassificationAltName}" />
<Button x:Name="buttonOK"
Grid.Row="6"
Grid.Column="1"
Width="75"
Height="22"
Margin="0,0,106,12"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Click="buttonOK_Click"
Content="{x:Static p:Resources.OK}" />
<Button Name="buttonCancel"
Grid.Row="6"
Grid.Column="1"
Width="75"
Height="22"
Margin="0,0,26,12"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Click="bottonCancel_Click"
Content="{x:Static p:Resources.Cancel}"
RenderTransformOrigin="0.507,-4.636" />
</Grid>
</auiw:ChildWindow>
5 changes: 4 additions & 1 deletion Source/IFCExporterUIOverride/IFCExport.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ public IFCExport(Autodesk.Revit.UI.UIApplication app, IFCExportConfigurationsMap
SetParent(app.MainWindowHandle);

InitializeComponent();
// When user press escape key it will close the window
PreviewKeyDown += (s, e) => { if (e.Key == System.Windows.Input.Key.Escape) Close(); };

currentSelectedSetup.SelectionChanged -= currentSelectedSetup_SelectionChanged;

Expand Down Expand Up @@ -436,6 +438,7 @@ private void buttonEditSetup_Click(object sender, RoutedEventArgs args)
IFCExportConfiguration selectedConfig = GetSelectedConfiguration();
IFCExportConfigurationsMap configurationsMap = new IFCExportConfigurationsMap(m_configMap);
IFCExporterUIWindow editorWindow = new IFCExporterUIWindow(configurationsMap, selectedConfig.Name);
editorWindow.PreviewKeyDown += (s,e) => { if (e.Key == System.Windows.Input.Key.Escape) editorWindow.Close(); };

// the SelectionChanged event will be temporary disabled when the Modify Config Window is active
// (it is particularly useful for COBie v2.4 setup to avoid the function is called repeatedly)
Expand Down Expand Up @@ -838,4 +841,4 @@ private void ChildWindow_ContentRendered(object sender, EventArgs e)
currentSelectedSetup.SelectionChanged += currentSelectedSetup_SelectionChanged;
}
}
}
}
Loading