]> O.S.I.I.S - jp/crow.git/commitdiff
rename Root to CurrentDirectory, et CurrentDirectory to
authorjpbruyere <jp.bruyere@hotmail.com>
Fri, 2 Sep 2016 10:44:36 +0000 (12:44 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Fri, 2 Sep 2016 10:44:36 +0000 (12:44 +0200)
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

Templates/DirectoryView.template
Templates/Menu.template
Templates/MenuItem.template
Tests/Interfaces/Divers/0.crow
src/GraphicObjects/DirectoryView.cs

index 44ee0600f866c0e2f6b20611736ff2e939d2bd61..e866f03698124e61c0782f64615032bd30d56d2f 100755 (executable)
@@ -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"
index facc18926997d044722df131dfdadea542dfdb9b..d49e0b311b8e0ab9571fe4e60e7fdb48cee64576 100644 (file)
@@ -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}"/>
index c03cc27d32af9e048eca66d81bdd194db3180822..c6c545f6d86de5c861013110baa4d1e92ce96306 100644 (file)
@@ -14,7 +14,7 @@
                                Background="{./Background}">
                        <Label Text="{./Caption}"
                                Foreground="{./Foreground}"
-                               Margin="3" HorizontalAlignment="Left"
+                               Margin="1" HorizontalAlignment="Left"
                                Font="{./Font}" />
                </Border>
        </Template>
index 18b0691064b358418c0094460fa3c539ead8ffce..c1b06affc8c41317e22cdbf00ec8218d1eddbec5 100755 (executable)
                                <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"
index dbb0c212a23fb903c33fdeea0a6e182fc8a53584..4e29621ef09213f31beb52c1c5936da57e560db6 100644 (file)
@@ -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)