FolderIcon = "#Crow.Icons.folder.svg";
FileIcon = "#Crow.Icons.file.svg";
+FontSmall = "sans, 10";
+FontNormal = "sans, 12";
+FontBig = "sans, 16";
+
+Widget {
+ Font = "${FontNormal}";
+}
Border {
BorderWidth = "${ControlBorderWidth}";
Foreground = "${ControlBorderColor}";
Background = "0.1,0.1,0.2,0.85";
Width = "Fit";
Caption="MessageBox";
- Font = "serif, 12";
+ Font = "${FontNormal}";
//MinimumSize = "200,120";
AlwaysOnTop = "true";
Resizable = "false";
// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;
-using System.ComponentModel;
-using System.Reflection;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Reflection.Emit;
-namespace Crow {
+namespace Crow
+{
/// <summary>
/// helper class to bind in one step icon, caption, action, and validity tests to a controls
/// </summary>
if (crowAssemblies.Contains (a))
return;
crowAssemblies.Add (a);
- loadStylingFromAssembly (a);
+ init_internal ();
}
}
/// <summary>
return false;
}
-
#region CTOR
static Interface ()
{
ItemTemplates = new Dictionary<string, ItemTemplate> (initCapacity);
knownCrowWidgetTypes = new Dictionary<string, Type> (initCapacity);
knownExtMethods = new Dictionary<string, MethodInfo> (initCapacity);
+ sharedPictures = new Dictionary<string, sharedPicture> (initCapacity);
}
void loadThemeFiles () {
if (string.IsNullOrEmpty (Theme))
/// <summary>
/// share a single store for picture resources among usage in different controls
/// </summary>
- internal Dictionary<string, sharedPicture> sharedPictures = new Dictionary<string, sharedPicture> ();
+ internal Dictionary<string, sharedPicture> sharedPictures;
static bool tryFindResource (Assembly a, string resId, out Stream stream) {
stream = null;
PerformanceMeasure.Begin (PerformanceMeasure.Kind.Clipping);
Widget g = null;
+ lock (ClippingMutex) {
while (ClippingQueue.Count > 0) {
- lock (ClippingMutex) {
+
g = ClippingQueue.Dequeue ();
g.IsQueueForClipping = false;
- }
+
g.ClippingRegistration ();
}
+ }
PerformanceMeasure.End (PerformanceMeasure.Kind.Clipping);
DbgLogger.EndEvent (DbgEvtType.ClippingRegistration, true);
{
DbgLogger.StartEvent(DbgEvtType.GOUpdateCache, this);
- Rectangle rb = Slot + Parent.ClientRectangle.Position;
if (!Clipping.IsEmpty) {
using (IContext gr = IFace.Backend.CreateContext (bmp)) {
for (int i = 0; i < Clipping.NumRectangles; i++)
#if DEBUG_STATS
public override long ChildCount => child == null ? 0 : 1 + child.ChildCount;
#endif
-
- /*public override bool IsVisible {
- get => base.IsVisible;
- set {
- if (value == isVisible)
- return;
-
- base.IsVisible = value;
-
- if (isVisible && child != null) {
- child.RegisterForRedraw();
- }
- }
- }*/
}
}
parentElem.AppendChild (xe);
}
- public Surface CreateIcon (int dragIconSize = 32) {
-#if VKVG
- Surface di = new Surface (IFace.vkvgDevice, dragIconSize, dragIconSize);
-#else
- ImageSurface di = new ImageSurface (Format.Argb32, dragIconSize, dragIconSize);
-#endif
- using (Context ctx = new Context (di)) {
+ public ISurface CreateIcon (int dragIconSize = 32) {
+
+ ISurface ico = IFace.Backend.CreateSurface (dragIconSize, dragIconSize);
+ using (IContext ctx = IFace.Backend.CreateContext (ico)) {
double div = Math.Max (LastPaintedSlot.Width, LastPaintedSlot.Height);
double s = (double)dragIconSize / div;
ctx.Scale (s, s);
ctx.Paint ();
}
}
- return di;
+ return ico;
}
public string DesignName => LogName + design_id;
#endif
<Project>
<PropertyGroup>
+ <SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir>
<OutputPath>$(SolutionDir)build\$(Configuration)\</OutputPath>
<License>MIT</License>
<Authors>Jean-Philippe Bruyère</Authors>
<LangVersion>7.3</LangVersion>
- <CrowVersion>1.1.0</CrowVersion>
+ <CrowVersion>1.2.0</CrowVersion>
<CrowPackageVersion>$(CrowVersion)-beta</CrowPackageVersion>
<!-- If you dont have a native libstb on your system, enable the managed version of stb here