isDirty = imlVE.IsDirty;
if (isDirty) {
- lock (CurrentInterface.UpdateMutex)
+ lock (IFace.UpdateMutex)
RegisterForRedraw ();
}
return;
//tv.AddChild (new TabItem (CurrentInterface) { Caption = "NewTab" });
lock (CurrentInterface.UpdateMutex) {
- tv.AddChild (Crow.IML.Instantiator.CreateFromImlFragment
- (@"<TabItem Caption='New tab' Background='Blue'><Label/></TabItem>").CreateInstance (CurrentInterface));
+ tv.AddChild (CurrentInterface.LoadIMLFragment
+ (@"<TabItem Caption='New tab' Background='Blue'><Label/></TabItem>"));
}
}
[STAThread]
internal static MethodInfo miDSChangeEmitHelper = typeof(Instantiator).GetMethod("dataSourceChangedEmitHelper", BindingFlags.Instance | BindingFlags.NonPublic);
internal static MethodInfo miDSReverseBinding = typeof(Instantiator).GetMethod("dataSourceReverseBinding", BindingFlags.Static | BindingFlags.NonPublic);
- internal static FieldInfo miSetCurIface = typeof(GraphicObject).GetField ("CurrentInterface", BindingFlags.Public | BindingFlags.Instance);
+ internal static FieldInfo miSetCurIface = typeof(GraphicObject).GetField ("IFace", BindingFlags.Public | BindingFlags.Instance);
internal static MethodInfo miFindByName = typeof (GraphicObject).GetMethod ("FindByName");
internal static MethodInfo miGetGObjItem = typeof(List<GraphicObject>).GetMethod("get_Item", new Type[] { typeof(Int32) });
internal static MethodInfo miLoadDefaultVals = typeof (GraphicObject).GetMethod ("loadDefaultValues");
thread = new Thread (start);
thread.IsBackground = true;
Host = host;
- lock (Host.CurrentInterface.CrowThreads)
- Host.CurrentInterface.CrowThreads.Add (this);
+ lock (Host.IFace.CrowThreads)
+ Host.IFace.CrowThreads.Add (this);
}
public void CheckState(){
if (thread.ThreadState != ThreadState.Stopped)
return;
Finished.Raise (Host, null);
- lock (Host.CurrentInterface.CrowThreads)
- Host.CurrentInterface.CrowThreads.Remove (this);
+ lock (Host.IFace.CrowThreads)
+ Host.IFace.CrowThreads.Remove (this);
}
public void Start() { thread.Start();}
public void Cancel(){
cancelRequested = true;
thread.Join ();
}
- lock (Host.CurrentInterface.CrowThreads)
- Host.CurrentInterface.CrowThreads.Remove (this);
+ lock (Host.IFace.CrowThreads)
+ Host.IFace.CrowThreads.Remove (this);
}
}
}
public override void onMouseMove (object sender, MouseMoveEventArgs e)
{
base.onMouseMove (sender, e);
- if (CurrentInterface.Mouse.LeftButton == ButtonState.Released)
+ if (IFace.Mouse.LeftButton == ButtonState.Released)
return;
updateMouseLocalPos (e.Position);
}
}
public Docker () : base ()
{
- instStack = Instantiator.CreateFromImlFragment(CurrentInterface, @"<GenericStack Background='Blue' AllowDrop='true' DragEnter='onStackDragEnter'/>");
- instSplit = Instantiator.CreateFromImlFragment(CurrentInterface, @"<Splitter/>");
- instSpacer = Instantiator.CreateFromImlFragment(CurrentInterface, @"<GraphicObject Background='Red' IsEnabled='false'/>");
+ instStack = IFace.CreateITorFromIMLFragment (@"<GenericStack Background='Blue' AllowDrop='true' DragEnter='onStackDragEnter'/>");
+ instSplit = IFace.CreateITorFromIMLFragment (@"<Splitter/>");
+ instSpacer = IFace.CreateITorFromIMLFragment (@"<GraphicObject Background='Red' IsEnabled='false'/>");
}
#endregion
public override void onMouseMove (object sender, MouseMoveEventArgs e)
{
- if (CurrentInterface.DragAndDropOperation?.DragSource as DockWindow != null) {
- DockWindow dw = CurrentInterface.DragAndDropOperation?.DragSource as DockWindow;
- if (CurrentInterface.DragAndDropOperation.DragSource.Parent == this && !dw.IsDocked)
+ if (IFace.DragAndDropOperation?.DragSource as DockWindow != null) {
+ DockWindow dw = IFace.DragAndDropOperation?.DragSource as DockWindow;
+ if (IFace.DragAndDropOperation.DragSource.Parent == this && !dw.IsDocked)
dw.MoveAndResize (e.XDelta, e.YDelta);
Rectangle r = ClientRectangle;
childrenRWLock.EnterReadLock ();
foreach (GraphicObject g in Children) {
- if (CurrentInterface.DragAndDropOperation?.DragSource == g)
+ if (IFace.DragAndDropOperation?.DragSource == g)
continue;
g.Paint (ref gr);
}
gr.Stroke ();
}
- if (CurrentInterface.DragAndDropOperation != null)
- CurrentInterface.DragAndDropOperation.DragSource.Paint (ref gr);
+ if (IFace.DragAndDropOperation != null)
+ IFace.DragAndDropOperation.DragSource.Paint (ref gr);
gr.Restore ();
public void Dock(DockWindow dw){
if (dockingDirection == Alignment.Center)
return;
- lock (CurrentInterface.UpdateMutex) {
+ lock (IFace.UpdateMutex) {
Splitter splitter = instSplit.CreateInstance<Splitter> ();
CurrentDirectory = SelectedDirectory;
else {
OkClicked.Raise (this, null);
- CurrentInterface.DeleteWidget (this);
+ IFace.DeleteWidget (this);
}
}
void onCancel(object sender, MouseButtonEventArgs e){
- CurrentInterface.DeleteWidget (this);
+ IFace.DeleteWidget (this);
}
}
}
//if no layouting remains in queue for item, registre for redraw
if (RegisteredLayoutings == LayoutingType.None && IsDirty)
- CurrentInterface.EnqueueForRepaint (this);
+ IFace.EnqueueForRepaint (this);
return true;
}
throw new Exception("Trying to dispose an object queued for Redraw: " + this.ToString());
#endif
- if (CurrentInterface.HoverWidget != null) {
- if (CurrentInterface.HoverWidget.IsOrIsInside(this))
- CurrentInterface.HoverWidget = null;
+ if (IFace.HoverWidget != null) {
+ if (IFace.HoverWidget.IsOrIsInside(this))
+ IFace.HoverWidget = null;
}
- if (CurrentInterface.ActiveWidget != null) {
- if (CurrentInterface.ActiveWidget.IsOrIsInside (this))
- CurrentInterface.ActiveWidget = null;
+ if (IFace.ActiveWidget != null) {
+ if (IFace.ActiveWidget.IsOrIsInside (this))
+ IFace.ActiveWidget = null;
}
- if (CurrentInterface.FocusedWidget != null) {
- if (CurrentInterface.FocusedWidget.IsOrIsInside (this))
- CurrentInterface.FocusedWidget = null;
+ if (IFace.FocusedWidget != null) {
+ if (IFace.FocusedWidget.IsOrIsInside (this))
+ IFace.FocusedWidget = null;
}
if (!localDataSourceIsNull)
DataSource = null;
/// <summary>
/// interface this widget is bound to, this should not be changed once the instance is created
/// </summary>
- public Interface CurrentInterface = null;
+ public Interface IFace = null;
/// <summary>
/// contains the dirty rectangles in the coordinate system of the cache. those dirty zones
/// <param name="iface">Iface.</param>
public GraphicObject (Interface iface) : this()
{
- CurrentInterface = iface;
+ IFace = iface;
Initialize ();
}
#endregion
Type thisType = this.GetType ();
if (!string.IsNullOrEmpty (Style)) {
- if (CurrentInterface.DefaultValuesLoader.ContainsKey (Style)) {
- CurrentInterface.DefaultValuesLoader [Style] (this);
+ if (IFace.DefaultValuesLoader.ContainsKey (Style)) {
+ IFace.DefaultValuesLoader [Style] (this);
return;
}
} else {
- if (CurrentInterface.DefaultValuesLoader.ContainsKey (thisType.FullName)) {
- CurrentInterface.DefaultValuesLoader [thisType.FullName] (this);
+ if (IFace.DefaultValuesLoader.ContainsKey (thisType.FullName)) {
+ IFace.DefaultValuesLoader [thisType.FullName] (this);
return;
- } else if (!CurrentInterface.Styling.ContainsKey (thisType.FullName)) {
- if (CurrentInterface.DefaultValuesLoader.ContainsKey (thisType.Name)) {
- CurrentInterface.DefaultValuesLoader [thisType.Name] (this);
+ } else if (!IFace.Styling.ContainsKey (thisType.FullName)) {
+ if (IFace.DefaultValuesLoader.ContainsKey (thisType.Name)) {
+ IFace.DefaultValuesLoader [thisType.Name] (this);
return;
}
}
// those files being placed in a Styles folder
string styleKey = Style;
if (!string.IsNullOrEmpty (Style)) {
- if (CurrentInterface.Styling.ContainsKey (Style)) {
- styling.Add (CurrentInterface.Styling [Style]);
+ if (IFace.Styling.ContainsKey (Style)) {
+ styling.Add (IFace.Styling [Style]);
}
}
- if (CurrentInterface.Styling.ContainsKey (thisType.FullName)) {
- styling.Add (CurrentInterface.Styling [thisType.FullName]);
+ if (IFace.Styling.ContainsKey (thisType.FullName)) {
+ styling.Add (IFace.Styling [thisType.FullName]);
if (string.IsNullOrEmpty (styleKey))
styleKey = thisType.FullName;
}
- if (CurrentInterface.Styling.ContainsKey (thisType.Name)) {
- styling.Add (CurrentInterface.Styling [thisType.Name]);
+ if (IFace.Styling.ContainsKey (thisType.Name)) {
+ styling.Add (IFace.Styling [thisType.Name]);
if (string.IsNullOrEmpty (styleKey))
styleKey = thisType.Name;
}
#endregion
try {
- CurrentInterface.DefaultValuesLoader[styleKey] = (Interface.LoaderInvoker)dm.CreateDelegate(typeof(Interface.LoaderInvoker));
- CurrentInterface.DefaultValuesLoader[styleKey] (this);
+ IFace.DefaultValuesLoader[styleKey] = (Interface.LoaderInvoker)dm.CreateDelegate(typeof(Interface.LoaderInvoker));
+ IFace.DefaultValuesLoader[styleKey] (this);
} catch (Exception ex) {
throw new Exception ("Error applying style <" + styleKey + ">:", ex);
}
/// fired when drag and drop operation start
/// </summary>
protected virtual void onStartDrag (object sender, DragDropEventArgs e){
- CurrentInterface.HoverWidget = null;
+ IFace.HoverWidget = null;
IsDragged = true;
StartDrag.Raise (this, e);
Debug.WriteLine(this.ToString() + " : START DRAG => " + e.ToString());
if (Width.IsFit || Height.IsFit)
RegisterForLayouting (LayoutingType.Sizing);
else if (RegisteredLayoutings == LayoutingType.None)
- CurrentInterface.EnqueueForRepaint (this);
+ IFace.EnqueueForRepaint (this);
}
/// <summary> query an update of the content, a redraw </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
IsDirty = true;
if (RegisteredLayoutings == LayoutingType.None)
- CurrentInterface.EnqueueForRepaint (this);
+ IFace.EnqueueForRepaint (this);
}
#endregion
public virtual void RegisterForLayouting(LayoutingType layoutType){
if (Parent == null)
return;
- lock (CurrentInterface.LayoutMutex) {
+ lock (IFace.LayoutMutex) {
//prevent queueing same LayoutingType for this
layoutType &= (~RegisteredLayoutings);
//enqueue LQI LayoutingTypes separately
if (layoutType.HasFlag (LayoutingType.Width))
- CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Width, this));
+ IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Width, this));
if (layoutType.HasFlag (LayoutingType.Height))
- CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Height, this));
+ IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Height, this));
if (layoutType.HasFlag (LayoutingType.X))
- CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.X, this));
+ IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.X, this));
if (layoutType.HasFlag (LayoutingType.Y))
- CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Y, this));
+ IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Y, this));
if (layoutType.HasFlag (LayoutingType.ArrangeChildren))
- CurrentInterface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.ArrangeChildren, this));
+ IFace.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.ArrangeChildren, this));
}
}
//if no layouting remains in queue for item, registre for redraw
if (this.registeredLayoutings == LayoutingType.None && IsDirty)
- CurrentInterface.EnqueueForRepaint (this);
+ IFace.EnqueueForRepaint (this);
return true;
}
}
public virtual void checkHoverWidget(MouseMoveEventArgs e)
{
- if (CurrentInterface.HoverWidget != this) {
- CurrentInterface.HoverWidget = this;
+ if (IFace.HoverWidget != this) {
+ IFace.HoverWidget = this;
onMouseEnter (this, e);
}
public virtual void onMouseMove(object sender, MouseMoveEventArgs e)
{
if (AllowDrag & HasFocus & e.Mouse.LeftButton == ButtonState.Pressed) {
- if (CurrentInterface.DragAndDropOperation == null) {
- CurrentInterface.DragAndDropOperation = new DragDropEventArgs (this);
- onStartDrag (this, CurrentInterface.DragAndDropOperation);
+ if (IFace.DragAndDropOperation == null) {
+ IFace.DragAndDropOperation = new DragDropEventArgs (this);
+ onStartDrag (this, IFace.DragAndDropOperation);
}
}
Debug.WriteLine("MOUSE DOWN => " + this.ToString());
#endif
- if (CurrentInterface.ActiveWidget == null)
- CurrentInterface.ActiveWidget = this;
+ if (IFace.ActiveWidget == null)
+ IFace.ActiveWidget = this;
if (this.Focusable && !Interface.FocusOnHover) {
BubblingMouseButtonEventArg be = e as BubblingMouseButtonEventArg;
if (be.Focused == null) {
be.Focused = this;
- CurrentInterface.FocusedWidget = this;
+ IFace.FocusedWidget = this;
if (e.Button == MouseButton.Right && this.ContextCommands != null)
- CurrentInterface.ShowContextMenu (this);
+ IFace.ShowContextMenu (this);
}
}
//bubble event to the top
Debug.WriteLine("MOUSE UP => " + this.ToString());
#endif
- if (CurrentInterface.DragAndDropOperation != null){
- if (CurrentInterface.DragAndDropOperation.DragSource == this) {
- if (CurrentInterface.DragAndDropOperation.DropTarget != null)
- onDrop (this, CurrentInterface.DragAndDropOperation);
+ if (IFace.DragAndDropOperation != null){
+ if (IFace.DragAndDropOperation.DragSource == this) {
+ if (IFace.DragAndDropOperation.DropTarget != null)
+ onDrop (this, IFace.DragAndDropOperation);
else
- onEndDrag (this, CurrentInterface.DragAndDropOperation);
- CurrentInterface.DragAndDropOperation = null;
+ onEndDrag (this, IFace.DragAndDropOperation);
+ IFace.DragAndDropOperation = null;
}
}
Debug.WriteLine("MouseEnter => " + this.ToString());
#endif
- if (CurrentInterface.DragAndDropOperation != null) {
+ if (IFace.DragAndDropOperation != null) {
if (this.AllowDrop) {
- if (CurrentInterface.DragAndDropOperation.DragSource != this && CurrentInterface.DragAndDropOperation.DropTarget != this)
- onDragEnter (this, CurrentInterface.DragAndDropOperation);
+ if (IFace.DragAndDropOperation.DragSource != this && IFace.DragAndDropOperation.DropTarget != this)
+ onDragEnter (this, IFace.DragAndDropOperation);
}
}
#if DEBUG_FOCUS
Debug.WriteLine("MouseLeave => " + this.ToString());
#endif
- if (CurrentInterface.DragAndDropOperation != null) {
- if (CurrentInterface.DragAndDropOperation.DropTarget == this)
- onDragLeave (this, CurrentInterface.DragAndDropOperation);
+ if (IFace.DragAndDropOperation != null) {
+ if (IFace.DragAndDropOperation.DropTarget == this)
+ onDragLeave (this, IFace.DragAndDropOperation);
}
MouseLeave.Raise (this, e);
}
//if no layouting remains in queue for item, registre for redraw
if (RegisteredLayoutings == LayoutingType.None && IsDirty)
- CurrentInterface.EnqueueForRepaint (this);
+ IFace.EnqueueForRepaint (this);
return true;
}
{
child.LayoutChanged -= OnChildLayoutChanges;
//check if HoverWidget is removed from Tree
- if (CurrentInterface.HoverWidget != null) {
- if (this.Contains (CurrentInterface.HoverWidget))
- CurrentInterface.HoverWidget = null;
+ if (IFace.HoverWidget != null) {
+ if (this.Contains (IFace.HoverWidget))
+ IFace.HoverWidget = null;
}
childrenRWLock.EnterWriteLock ();
#region Mouse handling
public override void checkHoverWidget (MouseMoveEventArgs e)
{
- if (CurrentInterface.HoverWidget != this) {
- CurrentInterface.HoverWidget = this;
+ if (IFace.HoverWidget != this) {
+ IFace.HoverWidget = this;
onMouseEnter (this, e);
}
for (int i = Children.Count - 1; i >= 0; i--) {
if (path == value)
return;
path = value;
- this.SetChild (CurrentInterface.Load (path));
+ this.SetChild (IFace.Load (path));
NotifyValueChanged ("Path", path);
}
}
if (string.IsNullOrEmpty(value))
Picture = null;
else {
- lock(CurrentInterface.LayoutMutex){
+ lock(IFace.LayoutMutex){
LoadImage (value);
}
}
{
base.onMouseEnter (sender, e);
if (Selectable)
- CurrentInterface.MouseCursor = XCursor.Text;
+ IFace.MouseCursor = XCursor.Text;
}
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
{
base.onMouseLeave (sender, e);
- CurrentInterface.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = XCursor.Default;
}
protected override void onFocused (object sender, EventArgs e)
{
public static MessageBox Show (Interface iface, Type msgBoxType, string message, string okMsg = "", string cancelMsg = ""){
lock (iface.UpdateMutex) {
MessageBox mb = new MessageBox (iface);
- mb.CurrentInterface.AddWidget (mb);
+ mb.IFace.AddWidget (mb);
mb.MsgType = msgBoxType;
mb.Message = message;
if (!string.IsNullOrEmpty(okMsg))
}
public override void checkHoverWidget (MouseMoveEventArgs e)
{
- if (CurrentInterface.HoverWidget != this) {
- CurrentInterface.HoverWidget = this;
+ if (IFace.HoverWidget != this) {
+ IFace.HoverWidget = this;
onMouseEnter (this, e);
}
if (Content != null){
if (Content != null) {
Content.Visible = true;
if (Content.Parent == null)
- CurrentInterface.AddWidget (Content);
+ IFace.AddWidget (Content);
if (Content.LogicalParent != this)
Content.LogicalParent = this;
- CurrentInterface.PutOnTop (Content, true);
+ IFace.PutOnTop (Content, true);
_content_LayoutChanged (this, new LayoutingEventArgs (LayoutingType.Sizing));
}
Popped.Raise (this, e);
if (child != null) {
//check if HoverWidget is removed from Tree
- if (CurrentInterface.HoverWidget != null) {
- if (this.Contains (CurrentInterface.HoverWidget))
- CurrentInterface.HoverWidget = null;
+ if (IFace.HoverWidget != null) {
+ if (this.Contains (IFace.HoverWidget))
+ IFace.HoverWidget = null;
}
contentSize = new Size (0, 0);
child.LayoutChanged -= OnChildLayoutChanges;
public override void onMouseWheel (object sender, MouseWheelEventArgs e)
{
base.onMouseWheel (sender, e);
- if (CurrentInterface.Keyboard.IsKeyDown (Key.ShiftLeft))
+ if (IFace.Keyboard.IsKeyDown (Key.ShiftLeft))
ScrollX += e.Delta * MouseWheelSpeed;
else
ScrollY -= e.Delta * MouseWheelSpeed;
public override void onMouseEnter (object sender, MouseMoveEventArgs e)
{
base.onMouseEnter (sender, e);
- CurrentInterface.MouseCursor = XCursor.Text;
+ IFace.MouseCursor = XCursor.Text;
}
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
{
base.onMouseLeave (sender, e);
- CurrentInterface.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = XCursor.Default;
}
protected override void onFocused (object sender, EventArgs e)
{
if (!MoveRight ())
return;
}else if (e.Shift)
- CurrentInterface.Clipboard = this.SelectedText;
+ IFace.Clipboard = this.SelectedText;
this.DeleteChar ();
break;
case Key.Enter:
break;
case Key.Insert:
if (e.Shift)
- this.Insert (CurrentInterface.Clipboard);
+ this.Insert (IFace.Clipboard);
else if (e.Control && !selectionIsEmpty)
- CurrentInterface.Clipboard = this.SelectedText;
+ IFace.Clipboard = this.SelectedText;
break;
case Key.Left:
if (e.Shift) {
{
base.onMouseEnter (sender, e);
if ((Parent as GenericStack).Orientation == Orientation.Horizontal)
- CurrentInterface.MouseCursor = XCursor.H;
+ IFace.MouseCursor = XCursor.H;
else
- CurrentInterface.MouseCursor = XCursor.V;
+ IFace.MouseCursor = XCursor.V;
}
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
{
base.onMouseLeave (sender, e);
- CurrentInterface.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = XCursor.Default;
}
public override void onMouseDown (object sender, MouseButtonEventArgs e)
{
//if no layouting remains in queue for item, registre for redraw
if (RegisteredLayoutings == LayoutingType.None && IsDirty)
- CurrentInterface.EnqueueForRepaint (this);
+ IFace.EnqueueForRepaint (this);
return true;
}
#region Mouse handling
public override void checkHoverWidget (MouseMoveEventArgs e)
{
- if (CurrentInterface.HoverWidget != this) {
- CurrentInterface.HoverWidget = this;
+ if (IFace.HoverWidget != this) {
+ IFace.HoverWidget = this;
onMouseEnter (this, e);
}
if (string.IsNullOrEmpty(_template))
loadTemplate ();
else
- loadTemplate (CurrentInterface.Load (_template));
+ loadTemplate (IFace.Load (_template));
}
}
/// <summary>
this.ClearTemplateBinding();
if (template == null) {
- if (!CurrentInterface.DefaultTemplates.ContainsKey (this.GetType ().FullName))
+ if (!IFace.DefaultTemplates.ContainsKey (this.GetType ().FullName))
throw new Exception (string.Format ("No default template found for '{0}'", this.GetType ().FullName));
- this.SetChild (CurrentInterface.Load (CurrentInterface.DefaultTemplates[this.GetType ().FullName]));
+ this.SetChild (IFace.Load (IFace.DefaultTemplates[this.GetType ().FullName]));
}else
this.SetChild (template);
}
iTemp = ItemTemplates ["default"];
}
- lock (CurrentInterface.LayoutMutex) {
+ lock (IFace.LayoutMutex) {
g = iTemp.CreateInstance();
page.AddChild (g);
// if (isPaged)
if (!MoveRight ())
return;
}else if (e.Shift)
- CurrentInterface.Clipboard = this.SelectedText;
+ IFace.Clipboard = this.SelectedText;
this.DeleteChar ();
break;
case Key.Enter:
break;
case Key.Insert:
if (e.Shift)
- this.Insert (CurrentInterface.Clipboard);
+ this.Insert (IFace.Clipboard);
else if (e.Control && !selectionIsEmpty)
- CurrentInterface.Clipboard = this.SelectedText;
+ IFace.Clipboard = this.SelectedText;
break;
case Key.Left:
if (e.Shift) {
alwaysOnTop = value;
if (alwaysOnTop && Parent != null)
- CurrentInterface.PutOnTop (this);
+ IFace.PutOnTop (this);
NotifyValueChanged ("AlwaysOnTop", alwaysOnTop);
}
{
base.onMouseMove (sender, e);
- Interface otkgw = CurrentInterface;
+ Interface otkgw = IFace;
if (!hoverBorder) {
currentDirection = Direction.None;
- CurrentInterface.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = XCursor.Default;
return;
}
#endregion
protected void onMaximized (object sender, EventArgs e){
- lock (CurrentInterface.LayoutMutex) {
+ lock (IFace.LayoutMutex) {
if (!IsMinimized)
savedBounds = this.LastPaintedSlot;
this.Left = this.Top = 0;
Maximized.Raise (sender, e);
}
protected void onUnmaximized (object sender, EventArgs e){
- lock (CurrentInterface.LayoutMutex) {
+ lock (IFace.LayoutMutex) {
this.Left = savedBounds.Left;
this.Top = savedBounds.Top;
this.Width = savedBounds.Width;
Unmaximized.Raise (sender, e);
}
protected void onMinimized (object sender, EventArgs e){
- lock (CurrentInterface.LayoutMutex) {
+ lock (IFace.LayoutMutex) {
if (IsNormal)
savedBounds = this.LastPaintedSlot;
Width = 200;
{
hoverBorder = false;
currentDirection = Direction.None;
- CurrentInterface.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = XCursor.Default;
}
protected virtual void onBorderMouseEnter (object sender, MouseMoveEventArgs e)
{
protected void butQuitPress (object sender, MouseButtonEventArgs e)
{
- CurrentInterface.MouseCursor = XCursor.Default;
+ IFace.MouseCursor = XCursor.Default;
close ();
}
//if no layouting remains in queue for item, registre for redraw
if (RegisteredLayoutings == LayoutingType.None && IsDirty)
- CurrentInterface.EnqueueForRepaint (this);
+ IFace.EnqueueForRepaint (this);
return true;
}
/// <param name="imlFragment">a valid IML string</param>
public GraphicObject LoadIMLFragment (string imlFragment) {
lock (UpdateMutex) {
- GraphicObject tmp = Instantiator.CreateFromImlFragment (this, imlFragment).CreateInstance();
+ GraphicObject tmp = CreateITorFromIMLFragment (imlFragment).CreateInstance();
AddWidget (tmp);
return tmp;
}
}
/// <summary>
+ /// Add the content of the IML fragment to the graphic tree of this interface
+ /// </summary>
+ /// <returns>return the new instance for convenience, may be ignored</returns>
+ /// <param name="imlFragment">a valid IML string</param>
+ public Instantiator CreateITorFromIMLFragment (string imlFragment) {
+ return Instantiator.CreateFromImlFragment (this, imlFragment);
+ }
+ /// <summary>
/// Create an instance of a GraphicObject and add it to the GraphicTree of this Interface
/// </summary>
/// <returns>new instance of graphic object created</returns>
#endif
if (LayoutingTries < Interface.MaxLayoutingTries) {
Layoutable.RegisteredLayoutings |= LayoutType;
- (Layoutable as GraphicObject).CurrentInterface.LayoutingQueue.Enqueue (this);
+ (Layoutable as GraphicObject).IFace.LayoutingQueue.Enqueue (this);
} else if (DiscardCount < Interface.MaxDiscardCount) {
#if DEBUG_LAYOUTING
Debug.WriteLine ("\t\tDiscarded");
LayoutingTries = 0;
DiscardCount++;
Layoutable.RegisteredLayoutings |= LayoutType;
- (Layoutable as GraphicObject).CurrentInterface.DiscardQueue.Enqueue (this);
+ (Layoutable as GraphicObject).IFace.DiscardQueue.Enqueue (this);
}
#if DEBUG_LAYOUTING
else