]> O.S.I.I.S - jp/crow.git/commitdiff
split ProjectNode classes in separate files
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 11 Mar 2018 12:20:27 +0000 (13:20 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 11 Mar 2018 12:20:27 +0000 (13:20 +0100)
Default.style
Templates/DockWindow.template
src/GraphicObjects/Window.cs
src/Interface.cs

index 0c9fe38f17279cc5c9118b8e76750afb26ab3335..54d2b974be5e4de4e77d20cae6e3211926f8102d 100644 (file)
@@ -132,6 +132,8 @@ DockWindow {
        Focusable = "true";
        AllowDrag = "true";
        Margin="0";
+       Width="200";
+       Height="200";
 }
 FileDialog {
        Template = "#Crow.FileDialog.template";
index 56afd3ebd8460e81afa36889f96bb4f94dc8d7a3..71685a164843903eee52457318a20c7b31fa83d5 100755 (executable)
@@ -5,7 +5,12 @@
                                MouseEnter="./onBorderMouseEnter"
                                MouseLeave="./onBorderMouseLeave">
        <VerticalStack Spacing="0">
-               <Label Visible="{./IsDocked}" Width="Stretched" Foreground="White" Margin="0" TextAlignment="Left" Text="{./Caption}" />
+               <HorizontalStack Visible="{./IsDocked}" Height="Fit" Margin="1" Background="Gray">
+                       <Label  Text="{./Caption}" TextAlignment="Left" Width="Stretched"
+                                        Foreground="Black" />
+                       <Image Width="10" Height="10" Focusable="true" Margin="0" Path="#Crow.Images.Icons.exit2.svg"
+                                        MouseClick="./butQuitPress"/>
+               </HorizontalStack>
                <HorizontalStack Background="vgradient|0:0.5,0.6,0.5,0.5|1:0.2,0.3,0.3,0.7"
                                Name="hs" Margin="0" Spacing="0" Height="Fit" Visible="{./IsFloating}">
                        <GraphicObject Width="5"/>
@@ -13,7 +18,7 @@
                        <Label Width="Stretched" Foreground="White" Margin="1" TextAlignment="Left" Text="{./Caption}" />
                        <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent"  Height="10" Width="10"
                                MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
-                               <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Images.Icons.exit2.svg"
+                               <Image Focusable="true" Name="Image" Margin="0" Path="#Crow.Images.Icons.exit2.svg"
                                         MouseClick="./butQuitPress"/>
                        </Border>
                        <GraphicObject Width="5"/>
index 6a15d0163fdcbc9a82d91c8ce847f0f5506e6644..d95f3d75c173d631d8643108e652d9f29ba2eb23 100644 (file)
@@ -453,6 +453,14 @@ namespace Crow
                                        (Parent as Container).Child = null;
                        }
                }
+
+               public static Window Show (Interface iface, string imlPath, bool modal = false){
+                       lock (iface.UpdateMutex) {
+                               Window w = iface.AddWidget (imlPath) as Window;
+                               w.Modal = modal;
+                               return w;
+                       }
+               }
        }
 }
 
index 00a952b0e440392d2d15cd0b840f197241c4ef67..349243b26ac2422ce9bf08a0dfb174464058d82c 100644 (file)
@@ -410,11 +410,11 @@ namespace Crow
                /// <param name="path">path of the iml file to load</param>
                public virtual GraphicObject Load (string path)
                {
-                       //try {
+                       try {
                                return GetInstantiator (path).CreateInstance ();
-                       //} catch (Exception ex) {
-                       //      throw new Exception ("Error loading <" + path + ">:", ex);
-                       //}
+                       } catch (Exception ex) {
+                               throw new Exception ("Error loading <" + path + ">:", ex);
+                       }
                }
                /// <summary>
                /// Fetch instantiator from cache or create it.
@@ -435,18 +435,6 @@ namespace Crow
                                Instantiators [path] = new ItemTemplate(this, path);
                        return Instantiators [path] as ItemTemplate;
                }
-               //TODO: .Net xml serialisation is no longer used, it has been replaced with instantiators
-               public void Save<T> (string file, T graphicObject)
-               {
-                       XmlSerializerNamespaces xn = new XmlSerializerNamespaces ();
-                       xn.Add ("", "");
-                       XmlSerializer xs = new XmlSerializer (typeof(T));
-
-                       xs = new XmlSerializer (typeof(T));
-                       using (Stream s = new FileStream (file, FileMode.Create)) {
-                               xs.Serialize (s, graphicObject, xn);
-                       }
-               }
                #endregion
 
                #region focus