bool inlineTemplate = false;
reader.Read ();
+
string templatePath = reader.GetAttribute ("Template");
string itemTemplatePath = reader.GetAttribute ("ItemTemplate");
Glfw3.SetCharCallback (hWin, HandleCharDelegate);
Glfw3.SetWindowSizeCallback (hWin, HandleWindowSizeDelegate);
- //Glfw3.SetWindowTitle (hWin, "FPS: " + fps.ToString ());
switch (Environment.OSVersion.Platform) {
case PlatformID.MacOSX:
break;
#endregion
+ public string WindowTitle {
+ set => Glfw3.SetWindowTitle (hWin, value);
+ }
public bool Running {
get => !Glfw3.WindowShouldClose (hWin);
.GetManifestResourceNames ()
.Where (r => r.EndsWith (".style", StringComparison.OrdinalIgnoreCase))) {
using (StyleReader sr = new StyleReader (assembly.GetManifestResourceStream (s)))
- sr.Parse (this.StylingConstants, this.Styling, s);
+ sr.Parse (StylingConstants, Styling, s);
}
}
+ public void LoadStyle (string stylePath) {
+ using (Stream s = new FileStream (stylePath, FileMode.Open))
+ LoadStyle (s, stylePath);
+
+ }
+ public void LoadStyle (Stream stream, string resId) {
+ using (StyleReader sr = new StyleReader (stream))
+ sr.Parse (StylingConstants, Styling, resId);
+ }
#endregion
if (!IFace.DefaultTemplates.ContainsKey (mdTok)) {
string defTmpId = this.GetType ().FullName + ".template";
- Stream s = Assembly.GetEntryAssembly ()?.GetManifestResourceStream (defTmpId);
- if (s == null)
- s = Assembly.GetAssembly (this.GetType ()).GetManifestResourceStream (defTmpId);
+ Stream s = Interface.GetStreamFromPath ("#" + defTmpId);
if (s == null)
throw new Exception (string.Format ("No default template found for '{0}'", this.GetType ().FullName));
IFace.DefaultTemplates [mdTok] = new IML.Instantiator (IFace, s, defTmpId);
else if (LastPaintedSlot.Width != Slot.Width || LastPaintedSlot.Height != Slot.Height)
bmp.SetSize (Slot.Width, Slot.Height);*/
bmp?.Dispose ();
- //bmp = IFace.surf.CreateSimilar (Content.ColorAlpha, Slot.Width, Slot.Height);
- bmp = new ImageSurface(Format.Argb32, Slot.Width, Slot.Height);
+ bmp = IFace.surf.CreateSimilar (Content.ColorAlpha, Slot.Width, Slot.Height);
+ //bmp = new ImageSurface(Format.Argb32, Slot.Width, Slot.Height);
using (Context gr = new Context (bmp)) {
gr.Antialias = Interface.Antialias;
line = 1;
curState = States.classNames;
- string styleKey = resId.Substring (0, resId.Length - 6);
+ //string styleKey = resId.Substring (0, resId.Length - 6);
string token = "";
List<string> targetsClasses = new List<string> ();
string currentProperty = "";
//testFiles = new string [] { @"Interfaces/TemplatedGroup/3.crow" };
//testFiles = new string [] { @"Interfaces/Divers/testShape.crow" };
//testFiles = new string [] { @"Interfaces/TemplatedControl/testEnumSelector.crow" };
- testFiles = new string [] { @"Interfaces/Divers/all.crow" };
+ //testFiles = new string [] { @"Interfaces/Divers/all.crow" };
+ testFiles = new string [] { @"Interfaces/Divers/templateInStyle.crow" };
//testFiles = new string [] { @"Interfaces/Divers/colorPicker2.crow" };
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<CheckBox Style="CheckBox2" />
\ No newline at end of file