diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-09-02 12:44:36 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-09-02 12:44:36 +0200 |
| commit | d739f2dfd491d781153eb3218173097ff942e0a6 (patch) | |
| tree | c12d8da1eb9eebaa6d5baa777cc03378c06a4606 | |
| parent | 4fd5c81c6579581d47f70b373daacae8a59200e0 (diff) | |
rename Root to CurrentDirectory, et CurrentDirectory to
FileSystemEntries
modifié : CrowIDE/ui/imlEditor.crow
modifié : Templates/DirectoryView.template
modifié : Tests/Interfaces/Divers/0.crow
modifié : src/GraphicObjects/DirectoryView.cs
thiner menu
modifié : Templates/Menu.template
modifié : Templates/MenuItem.template
| -rw-r--r-- | CrowIDE/ui/imlEditor.crow | 21 | ||||
| -rwxr-xr-x | Templates/DirectoryView.template | 6 | ||||
| -rw-r--r-- | Templates/Menu.template | 2 | ||||
| -rw-r--r-- | Templates/MenuItem.template | 2 | ||||
| -rwxr-xr-x | Tests/Interfaces/Divers/0.crow | 2 | ||||
| -rw-r--r-- | src/GraphicObjects/DirectoryView.cs | 34 |
6 files changed, 44 insertions, 23 deletions
diff --git a/CrowIDE/ui/imlEditor.crow b/CrowIDE/ui/imlEditor.crow index 11478f0c..dae1c84f 100644 --- a/CrowIDE/ui/imlEditor.crow +++ b/CrowIDE/ui/imlEditor.crow @@ -1,6 +1,23 @@ <?xml version="1.0"?> <Window Height="99%" Width="99%" > <VerticalStack> + <Menu> + <MenuItem Caption="File"> + <MenuItem Caption="New"></MenuItem> + <MenuItem Caption="Open"></MenuItem> + <MenuItem Caption="Save"></MenuItem> + <MenuItem Caption="Quit"></MenuItem> + </MenuItem> + <MenuItem Caption="Edit"> + <MenuItem Caption="Cut"/> + <MenuItem Caption="Copy"/> + <MenuItem Caption="Paste"/> + </MenuItem> + <MenuItem Caption="Help"> + <MenuItem Caption="Help"/> + <MenuItem Caption="About"/> + </MenuItem> + </Menu> <HorizontalStack Height="Fit" Margin="2"> <Image Style="icon" Path="#CrowIDE.images.save.svg" MouseClick="onCommandSave"/> </HorizontalStack> @@ -8,10 +25,10 @@ <Label Width="Stretched" Margin="1" Text="{../../dv.SelectedItem}"/> </Border> <HorizontalStack> - <DirectoryView Name="dv" Root="./" SelectedItemChanged="Tv_SelectedItemChanged" + <DirectoryView Name="dv" CurrentDirectory="./" SelectedItemChanged="Tv_SelectedItemChanged" Width="20%" Height="100%" Margin="10"/> <Splitter/> - <VerticalStack Width="60%"> + <VerticalStack Width="Stretched"> <ImlVisualEditor Height="60%" Margin="0" MinimumSize="10,10" Foreground="SkyBlue" ImlPath="{../../../dv.SelectedItem}" Name="crowContainer" Background="Onyx"/> diff --git a/Templates/DirectoryView.template b/Templates/DirectoryView.template index 44ee0600..e866f036 100755 --- a/Templates/DirectoryView.template +++ b/Templates/DirectoryView.template @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<TreeView IsRoot="true" Name="treeView" Data="{./CurrentDirectory}" +<TreeView IsRoot="true" Name="treeView" Data="{./FileSystemEntries}" SelectedItemChanged="./onSelectedItemChanged"> <ItemTemplate DataType="System.IO.FileInfo"> <HorizontalStack Focusable="true" Height="Fit" Width="Stretched" Background="{../Background}" > @@ -10,7 +10,7 @@ MouseLeave="{Background=Transparent}"/> </HorizontalStack> </ItemTemplate> - <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfos"> + <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetDirectories"> <Expandable Caption="{Name}" > <Template> <VerticalStack Height="{./HeightPolicy}" Width="{./WidthPolicy}"> @@ -18,7 +18,7 @@ MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}" MouseLeave="{Background=Transparent}"> <Image Margin="2" Width="12" Height="12" - Visible="{./HasContent}" + Visible="{./HasChildren}" Path="{./Image}" SvgSub="{./IsExpanded}"/> <Image Margin="2" Width="14" Height="14" diff --git a/Templates/Menu.template b/Templates/Menu.template index facc1892..d49e0b31 100644 --- a/Templates/Menu.template +++ b/Templates/Menu.template @@ -1,3 +1,3 @@ <?xml version="1.0"?> -<HorizontalStack Name="ItemsContainer" Margin="2" Background="{./Background}" +<HorizontalStack Name="ItemsContainer" Margin="0" Background="{./Background}" Width="{./WidthPolicy}" Height="{./HeightPolicy}"/> diff --git a/Templates/MenuItem.template b/Templates/MenuItem.template index c03cc27d..c6c545f6 100644 --- a/Templates/MenuItem.template +++ b/Templates/MenuItem.template @@ -14,7 +14,7 @@ Background="{./Background}"> <Label Text="{./Caption}" Foreground="{./Foreground}" - Margin="3" HorizontalAlignment="Left" + Margin="1" HorizontalAlignment="Left" Font="{./Font}" /> </Border> </Template> diff --git a/Tests/Interfaces/Divers/0.crow b/Tests/Interfaces/Divers/0.crow index 18b06910..c1b06aff 100755 --- a/Tests/Interfaces/Divers/0.crow +++ b/Tests/Interfaces/Divers/0.crow @@ -143,7 +143,7 @@ <Label Width="Stretched" Margin="1" Text="{../../dv.SelectedItem}"/> </Border> <Border Margin="5" Background="Onyx" Height="50%"> - <DirectoryView Name="dv" Root="./" Margin="1"/> + <DirectoryView Name="dv" CurrentDirectory="./" Margin="1"/> </Border> <Splitter/> <ListBox Data="{TestList}" Background="Onyx" Margin="5" diff --git a/src/GraphicObjects/DirectoryView.cs b/src/GraphicObjects/DirectoryView.cs index dbb0c212..4e29621e 100644 --- a/src/GraphicObjects/DirectoryView.cs +++ b/src/GraphicObjects/DirectoryView.cs @@ -37,8 +37,8 @@ namespace Crow public event EventHandler<SelectionChangeEventArgs> SelectedItemChanged; #endregion - string _root = "/"; - bool _showFiles; + string currentDirectory = "/"; + bool showFiles; object _selectedItem; [XmlIgnore]public object SelectedItem { @@ -52,29 +52,33 @@ namespace Crow NotifyValueChanged ("SelectedItem", _selectedItem); } } - [XmlAttributeAttribute()][DefaultValue(true)] + [XmlAttributeAttribute()][DefaultValue(false)] public virtual bool ShowFiles { - get { return _showFiles; } + get { return showFiles; } set { - if (_showFiles == value) + if (showFiles == value) return; - _showFiles = value; - NotifyValueChanged ("ShowFiles", _showFiles); + showFiles = value; + NotifyValueChanged ("ShowFiles", showFiles); + NotifyValueChanged ("FileSystemEntries", FileSystemEntries); } } [XmlAttributeAttribute][DefaultValue("/")] - public virtual string Root { - get { return _root; } + public virtual string CurrentDirectory { + get { return currentDirectory; } set { - if (_root == value) + if (currentDirectory == value) return; - _root = value; - NotifyValueChanged ("Root", _root); - NotifyValueChanged ("CurrentDirectory", CurrentDirectory); + currentDirectory = value; + NotifyValueChanged ("CurrentDirectory", currentDirectory); + NotifyValueChanged ("FileSystemEntries", FileSystemEntries); } } - [XmlIgnore]public FileSystemInfo[] CurrentDirectory { - get { return new DirectoryInfo (Root).GetFileSystemInfos (); } + [XmlIgnore]public FileSystemInfo[] FileSystemEntries { + get { + return showFiles ? new DirectoryInfo (CurrentDirectory).GetFileSystemInfos (): + new DirectoryInfo(currentDirectory).GetDirectories(); + } } public void onSelectedItemChanged (object sender, SelectionChangeEventArgs e){ if (e.NewValue == SelectedItem) |