Parcourir la source

调整编辑器stretch布局

tanghai il y a 10 ans
Parent
commit
acf9925657

+ 3 - 3
CSharp/App/Modules/BehaviorTreeModule/AllTreeView.xaml

@@ -35,14 +35,14 @@
 						<StackPanel MouseLeftButtonDown="ListBoxItem_OnMouseLeftButtonDown" MouseLeftButtonUp="ListBoxItem_OnMouseLeftButtonUp" 
 									Orientation="Horizontal" Margin="1,0">
 							<Label Content="{Binding TreeId}" VerticalAlignment="Stretch" Width="30"/>
-							<Label Content="{Binding Comment}" VerticalAlignment="Stretch" Width="150"/>
+							<Label Content="{Binding Comment}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
 						</StackPanel>
 					</DataTemplate>
 				</ListBox.ItemTemplate>
 			</ListBox>
 		</GroupBox>
-		<GroupBox Grid.Row="1" Grid.Column="0" Header="节点编辑:" Margin="0,116,0,0">
-			<Tree:NodeDataEditor x:Name="nodeDataEditor" VerticalAlignment="Top" />
+		<GroupBox Grid.Row="1" Grid.Column="0" Header="节点编辑:" Height="250" VerticalAlignment="Bottom">
+			<Tree:NodeDataEditor x:Name="nodeDataEditor" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" />
 		</GroupBox>
 		<GridSplitter Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Width="3" ShowsPreview="False" VerticalAlignment="Stretch"
 				HorizontalAlignment="Stretch" />

+ 10 - 10
CSharp/App/Modules/BehaviorTreeModule/NodeDataEditor.xaml

@@ -4,13 +4,13 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
              xmlns:tree="clr-namespace:Modules.BehaviorTreeModule"
-             mc:Ignorable="d" Height="220" Width="211" DataContextChanged="OnDataContextChanged"
-			 d:DataContext="{d:DesignInstance tree:TreeNodeViewModel}">
+             mc:Ignorable="d" Height="220" DataContextChanged="OnDataContextChanged"
+			 d:DataContext="{d:DesignInstance tree:TreeNodeViewModel}" VerticalContentAlignment="Stretch" HorizontalAlignment="Stretch" d:DesignWidth="242">
 	<UserControl.Resources>
 		<tree:ListToStringConverter x:Key="ListToStringConverter"/>
 	</UserControl.Resources>
 
-	<Grid VerticalAlignment="Stretch">
+	<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
 		<Grid.RowDefinitions>
 			<RowDefinition Height="*"/>
 			<RowDefinition Height="*"/>
@@ -20,8 +20,8 @@
 			<RowDefinition Height="*"/>
 		</Grid.RowDefinitions>
 		<Grid.ColumnDefinitions>
-			<ColumnDefinition Width="40*"/>
-			<ColumnDefinition Width="171*"/>
+			<ColumnDefinition Width="40"/>
+			<ColumnDefinition Width="*"/>
 		</Grid.ColumnDefinitions>
 		<Label Content="Tree:" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalAlignment="Top" VerticalContentAlignment="Stretch" Height="30" />
 		<Label Content="ID  :" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalAlignment="Top" VerticalContentAlignment="Stretch" Height="30"/>
@@ -29,10 +29,10 @@
 		<Label Content="参数:" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalAlignment="Top" Height="30"/>
 		<Label Content="备注:" Grid.Row="4" Grid.Column="0" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalAlignment="Top" Height="30"/>
 		
-		<Label Name="lblTreeId" Grid.Column="1" Grid.Row="0" Content="{Binding TreeId}" />
-		<Label Name="lblId" Grid.Column="1" Grid.Row="1" Content="{Binding Id}" />
-		<ComboBox Name="cbType" Grid.Column="1" Grid.Row="2" Margin="2" SelectionChanged="CbType_OnSelectionChanged" />
-        <TextBox Name="tbArgs" Grid.Column="1" Grid.Row="3" Margin="2" Text="{Binding Args, Converter={StaticResource ListToStringConverter}, UpdateSourceTrigger=PropertyChanged}" />
-		<TextBox Name="tbComment" Grid.Column="1" Grid.Row="4" Margin="2" Text="{Binding Comment, UpdateSourceTrigger=PropertyChanged}" />
+		<Label Name="lblTreeId" Grid.Column="1" Grid.Row="0" Content="{Binding TreeId}" HorizontalAlignment="Stretch"/>
+		<Label Name="lblId" Grid.Column="1" Grid.Row="1" Content="{Binding Id}" HorizontalAlignment="Stretch"/>
+		<ComboBox Name="cbType" Grid.Column="1" Grid.Row="2" Margin="2" SelectionChanged="CbType_OnSelectionChanged" HorizontalAlignment="Stretch"/>
+		<TextBox Name="tbArgs" Grid.Column="1" Grid.Row="3" Margin="2" Text="{Binding Args, Converter={StaticResource ListToStringConverter}, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Stretch"/>
+		<TextBox Name="tbComment" Grid.Column="1" Grid.Row="4" Margin="2" Text="{Binding Comment, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Stretch"/>
 	</Grid>
 </UserControl>

+ 2 - 2
CSharp/App/Modules/BehaviorTreeModule/TreeView.xaml

@@ -6,7 +6,7 @@
              xmlns:tree="clr-namespace:Modules.BehaviorTreeModule"
              mc:Ignorable="d"
              d:DesignHeight="300" d:DesignWidth="300"
-			 d:DataContext="{d:DesignInstance tree:TreeViewModel}">
+			 d:DataContext="{d:DesignInstance tree:TreeViewModel}" HorizontalAlignment="Stretch">
 
 	<UserControl.Resources>
 		<tree:ListToStringConverter x:Key="ListToStringConverter"/>
@@ -39,7 +39,7 @@
 	</UserControl.Resources>
 	
 	<Grid>
-		<ListBox Name="listBox" SelectionMode="Single" ItemsSource="{Binding TreeNodes}" VerticalAlignment="Stretch">
+		<ListBox Name="listBox" SelectionMode="Single" ItemsSource="{Binding TreeNodes}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
 			<ListBox.ContextMenu>
 				<ContextMenu>
 					<MenuItem Header="新建" Click="MenuItem_New" />