diff options
| author | jp <jp_bruyere@hotmail.com> | 2016-02-28 19:03:23 +0100 |
|---|---|---|
| committer | jp <jp_bruyere@hotmail.com> | 2016-02-28 19:03:23 +0100 |
| commit | dc2ac1f53a079a8daa7c1342b17a8dcefcc62362 (patch) | |
| tree | 2b8a01557da7c94947ece3a2be92dac26e652f1e /src | |
| parent | 1d5a24313cd20b97bf9a852e30bade904cb4b95c (diff) | |
message box events ok cancel
Diffstat (limited to 'src')
| -rw-r--r-- | src/GraphicObjects/MessageBox.cs | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/src/GraphicObjects/MessageBox.cs b/src/GraphicObjects/MessageBox.cs index 18c4afb3..cae43d9f 100644 --- a/src/GraphicObjects/MessageBox.cs +++ b/src/GraphicObjects/MessageBox.cs @@ -23,25 +23,17 @@ using System.ComponentModel; namespace Crow { + [DefaultStyle("#Crow.Styles.MessageBox.style")] [DefaultTemplate("#Crow.Templates.MessageBox.goml")] public class MessageBox : Window { public MessageBox ():base(){} - string title; string message; - [XmlAttributeAttribute][DefaultValue("Message box")] - public virtual string Title - { - get { return title; } - set { - if (title == value) - return; - title = value; - NotifyValueChanged ("Title", title); - } - } + public event EventHandler Ok; + public event EventHandler Cancel; + [XmlAttributeAttribute][DefaultValue("Informations")] public virtual string Message { @@ -53,30 +45,16 @@ namespace Crow NotifyValueChanged ("Message", message); } } - #region GraphicObject overrides - [XmlAttributeAttribute][DefaultValue(250)] - public override int Width { - get { return base.Width; } - set { base.Width = value; } - } -// [XmlAttributeAttribute][DefaultValue(80)] -// public override int Height { -// get { return base.Height; } -// set { base.Height = value; } -// } - [XmlAttributeAttribute()][DefaultValue(true)] - public override bool Focusable + + void onOkButtonClick (object sender, EventArgs e) { - get { return base.Focusable; } - set { base.Focusable = value; } + Ok.Raise (this, null); } - [XmlAttributeAttribute()][DefaultValue("150;80")] - public override Size MinimumSize + void onCancelButtonClick (object sender, EventArgs e) { - get { return base.MinimumSize; } - set { base.MinimumSize = value; } + Ok.Raise (this, null); } - #endregion + } } |