Focusable = "true";
AllowDrag = "true";
Margin="0";
+ Width="200";
+ Height="200";
}
FileDialog {
Template = "#Crow.FileDialog.template";
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"/>
<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"/>
(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;
+ }
+ }
}
}
/// <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.
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