diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-06-12 14:42:57 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-06-12 14:42:57 +0200 |
| commit | 3260d86cda78bd53070f7318863df642f3492588 (patch) | |
| tree | 4b3799dbc4ff9e5cd083fc8fc2234a118d1aac55 /src/GraphicObjects/Window.cs | |
| parent | f986e2521e113bd67a2f06b92c2ca774aa1e0937 (diff) | |
- Window
- Popper
- redraw clipping debug, solved old top container clipping bug :-)
Diffstat (limited to 'src/GraphicObjects/Window.cs')
| -rw-r--r-- | src/GraphicObjects/Window.cs | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/src/GraphicObjects/Window.cs b/src/GraphicObjects/Window.cs index 750478da..61d6fd1f 100644 --- a/src/GraphicObjects/Window.cs +++ b/src/GraphicObjects/Window.cs @@ -1,12 +1,59 @@ using System; +using System.Xml.Serialization; +using System.ComponentModel; +using System.Diagnostics; +using OpenTK.Input; namespace go { - public class Window : Container + [DefaultTemplate("#go.Templates.Window.goml")] + public class Window : TemplatedContainer { - public Window () + Label _title; + Image _icon; + Container _contentContainer; + + public override GraphicObject Content { + get { + return _contentContainer == null ? null : _contentContainer.Child; + } + set { + _contentContainer.SetChild(value); + } + } + [XmlAttributeAttribute()][DefaultValue("Window")] + public string Title { + get { return _title.Text; } + set { + if (_title == null) + return; + _title.Text = value; + } + } + public Window () : base() + { + } + + void Window_MouseMove (object sender, OpenTK.Input.MouseMoveEventArgs e) { + if (!e.Mouse.IsButtonDown (MouseButton.Left)) + return; + this.TopContainer.redrawClip.AddRectangle (this.ScreenCoordinates(this.Slot)); + this.Left += e.XDelta; + this.Top += e.YDelta; + this.registerForGraphicUpdate (); } + + protected override void loadTemplate(GraphicObject template = null) + { + base.loadTemplate (template); + + _contentContainer = this.child.FindByName ("Content") as Container; + _title = this.child.FindByName ("Title") as Label; + _icon = this.child.FindByName ("Icon") as Image; + } + + } } |