diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/GraphicObjects/Button.cs | 4 | ||||
| -rw-r--r-- | src/GraphicObjects/CheckBox.cs (renamed from src/GraphicObjects/Checkbox.cs) | 6 | ||||
| -rw-r--r-- | src/GraphicObjects/ComboBox.cs (renamed from src/GraphicObjects/Combobox.cs) | 30 | ||||
| -rw-r--r-- | src/GraphicObjects/Expandable.cs | 12 | ||||
| -rw-r--r-- | src/GraphicObjects/GroupBox.cs (renamed from src/GraphicObjects/Groupbox.cs) | 18 | ||||
| -rw-r--r-- | src/GraphicObjects/ListBox.cs | 2 | ||||
| -rw-r--r-- | src/GraphicObjects/MessageBox.cs | 12 | ||||
| -rw-r--r-- | src/GraphicObjects/Popper.cs | 21 | ||||
| -rw-r--r-- | src/GraphicObjects/ScrollBar.cs (renamed from src/GraphicObjects/Scrollbar.cs) | 6 | ||||
| -rw-r--r-- | src/GraphicObjects/Slider.cs | 1 | ||||
| -rw-r--r-- | src/GraphicObjects/TextBox.cs | 6 | ||||
| -rw-r--r-- | src/Interface.cs | 7 |
12 files changed, 65 insertions, 60 deletions
diff --git a/src/GraphicObjects/Button.cs b/src/GraphicObjects/Button.cs index c598c3e3..5d3e81ca 100644 --- a/src/GraphicObjects/Button.cs +++ b/src/GraphicObjects/Button.cs @@ -26,12 +26,12 @@ namespace Crow #endregion
#region GraphicObject Overrides
- [XmlAttributeAttribute()][DefaultValue(60)]
+ [XmlAttributeAttribute()][DefaultValue(50)]
public override int Width {
get { return base.Width; }
set { base.Width = value; }
}
- [XmlAttributeAttribute()][DefaultValue(30)]
+ [XmlAttributeAttribute()][DefaultValue(20)]
public override int Height {
get { return base.Height; }
set { base.Height = value; }
diff --git a/src/GraphicObjects/Checkbox.cs b/src/GraphicObjects/CheckBox.cs index 36181602..a08f9fdb 100644 --- a/src/GraphicObjects/Checkbox.cs +++ b/src/GraphicObjects/CheckBox.cs @@ -16,15 +16,15 @@ using System.ComponentModel; namespace Crow
{
- [DefaultTemplate("#Crow.Templates.Checkbox.goml")]
- public class Checkbox : TemplatedControl
+ [DefaultTemplate("#Crow.Templates.CheckBox.goml")]
+ public class CheckBox : TemplatedControl
{
string caption;
string image;
bool isChecked;
#region CTOR
- public Checkbox() : base()
+ public CheckBox() : base()
{
}
#endregion
diff --git a/src/GraphicObjects/Combobox.cs b/src/GraphicObjects/ComboBox.cs index 473c10ff..5d9c8e97 100644 --- a/src/GraphicObjects/Combobox.cs +++ b/src/GraphicObjects/ComboBox.cs @@ -20,16 +20,16 @@ using System.Threading; namespace Crow
{
- [DefaultTemplate("#Crow.Templates.Combobox.goml")]
- [DefaultOverlayTemplate("#Crow.Templates.ComboboxOverlay.goml")]
- public class Combobox : TemplatedContainer
+ [DefaultTemplate("#Crow.Templates.ComboBox.goml")]
+ [DefaultOverlayTemplate("#Crow.Templates.ComboBoxOverlay.goml")]
+ public class ComboBox : TemplatedContainer
{
#region CTOR
- public Combobox() : base(){ }
+ public ComboBox() : base(){ }
#endregion
bool _isPopped;
- string text;
+ string caption;
GraphicObject _overlay;
Group _list;
IList data;
@@ -77,7 +77,7 @@ namespace Crow _itemTemplate = value;
}
}
- [XmlAttributeAttribute][DefaultValue("#Crow.Templates.ComboboxOverlay.goml")]
+ [XmlAttributeAttribute][DefaultValue("#Crow.Templates.ComboBoxOverlay.goml")]
public string OverlayTemplate {
get { return _overlayTemplate; }
set {
@@ -109,9 +109,9 @@ namespace Crow SelectedItemChanged.Raise (this, new SelectionChangeEventArgs(_selectedItem));
if (SelectedItem == null)
- Text = "";
+ Caption = "";
else
- Text = _selectedItem.ToString ();
+ Caption = _selectedItem.ToString ();
}
}
public object SelectedItem{
@@ -125,9 +125,9 @@ namespace Crow SelectedItemChanged.Raise (this, new SelectionChangeEventArgs(_selectedItem));
if (SelectedItem == null)
- Text = "";
+ Caption = "";
else
- Text = _selectedItem.ToString ();
+ Caption = _selectedItem.ToString ();
}
get { return _selectedItem; }
@@ -243,13 +243,13 @@ namespace Crow }
}
[XmlAttributeAttribute()][DefaultValue("Combobox")]
- public string Text {
- get { return text; }
+ public string Caption {
+ get { return caption; }
set {
- if (text == value)
+ if (caption == value)
return;
- text = value;
- NotifyValueChanged ("Text", text);
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
}
}
[XmlAttributeAttribute()][DefaultValue(false)]
diff --git a/src/GraphicObjects/Expandable.cs b/src/GraphicObjects/Expandable.cs index 172406c2..f1e2bdeb 100644 --- a/src/GraphicObjects/Expandable.cs +++ b/src/GraphicObjects/Expandable.cs @@ -22,7 +22,7 @@ namespace Crow public class Expandable : TemplatedContainer
{
bool _isExpanded;
- string title;
+ string caption;
string image;
Container _contentContainer;
@@ -62,13 +62,13 @@ namespace Crow }
[XmlAttributeAttribute()][DefaultValue("Expandable")]
- public string Title {
- get { return title; }
+ public string Caption {
+ get { return caption; }
set {
- if (title == value)
+ if (caption == value)
return;
- title = value;
- NotifyValueChanged ("Title", title);
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
}
}
[XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.expandable.svg")]
diff --git a/src/GraphicObjects/Groupbox.cs b/src/GraphicObjects/GroupBox.cs index e1f33d84..81bac117 100644 --- a/src/GraphicObjects/Groupbox.cs +++ b/src/GraphicObjects/GroupBox.cs @@ -18,14 +18,14 @@ using System.IO; namespace Crow
{
- [DefaultTemplate("#Crow.Templates.Groupbox.goml")]
- public class Groupbox : TemplatedContainer
+ [DefaultTemplate("#Crow.Templates.GroupBox.goml")]
+ public class GroupBox : TemplatedContainer
{
- string title;
+ string caption;
Container _contentContainer;
#region CTOR
- public Groupbox() : base(){}
+ public GroupBox() : base(){}
#endregion
#region Template overrides
@@ -55,13 +55,13 @@ namespace Crow #endregion
[XmlAttributeAttribute()][DefaultValue("Groupbox")]
- public string Title {
- get { return title; }
+ public string Caption {
+ get { return caption; }
set {
- if (title == value)
+ if (caption == value)
return;
- title = value;
- NotifyValueChanged ("Title", title);
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
}
}
}
diff --git a/src/GraphicObjects/ListBox.cs b/src/GraphicObjects/ListBox.cs index 8d9880ad..a0ab540e 100644 --- a/src/GraphicObjects/ListBox.cs +++ b/src/GraphicObjects/ListBox.cs @@ -31,7 +31,7 @@ using System.Threading; namespace Crow { - [DefaultTemplate("#Crow.Templates.Listbox.goml")] + [DefaultTemplate("#Crow.Templates.ListBox.goml")] //[DefaultTemplate("#Crow.Templates.ItemTemplate.goml")] public class ListBox : TemplatedControl//, IXmlSerializable { diff --git a/src/GraphicObjects/MessageBox.cs b/src/GraphicObjects/MessageBox.cs index 40f48e4a..18c4afb3 100644 --- a/src/GraphicObjects/MessageBox.cs +++ b/src/GraphicObjects/MessageBox.cs @@ -54,16 +54,16 @@ namespace Crow } } #region GraphicObject overrides - [XmlAttributeAttribute][DefaultValue(350)] + [XmlAttributeAttribute][DefaultValue(250)] public override int Width { get { return base.Width; } set { base.Width = value; } } - [XmlAttributeAttribute][DefaultValue(150)] - public override int Height { - get { return base.Height; } - set { base.Height = value; } - } +// [XmlAttributeAttribute][DefaultValue(80)] +// public override int Height { +// get { return base.Height; } +// set { base.Height = value; } +// } [XmlAttributeAttribute()][DefaultValue(true)] public override bool Focusable { diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs index 5842faf8..15a209ce 100644 --- a/src/GraphicObjects/Popper.cs +++ b/src/GraphicObjects/Popper.cs @@ -27,7 +27,7 @@ namespace Crow }
#endregion
bool _isPopped;
- string title;
+ string caption;
string image;
GraphicObject _content;
@@ -66,15 +66,16 @@ namespace Crow if (tc == null)
return;
Rectangle r = this.ScreenCoordinates (this.Slot);
- if (e.LayoutType == LayoutingType.Width) {
+ if (((int)e.LayoutType & (int)LayoutingType.Width) > 0) {
if (Content.Slot.Width < tc.ClientRectangle.Width) {
if (r.Left + Content.Slot.Width > tc.ClientRectangle.Right)
Content.Left = tc.ClientRectangle.Right - Content.Slot.Width;
else
Content.Left = r.Left;
- }else
+ } else
Content.Left = 0;
- }else if (e.LayoutType == LayoutingType.Height) {
+ }
+ if (((int)e.LayoutType & (int)LayoutingType.Height) > 0) {
if (Content.Slot.Height < tc.ClientRectangle.Height) {
if (r.Bottom + Content.Slot.Height > tc.ClientRectangle.Bottom)
Content.Top = r.Top - Content.Slot.Height;
@@ -116,13 +117,13 @@ namespace Crow }
[XmlAttributeAttribute()][DefaultValue("Popper")]
- public string Title {
- get { return title; }
+ public string Caption {
+ get { return caption; }
set {
- if (title == value)
+ if (caption == value)
return;
- title = value;
- NotifyValueChanged ("Title", title);
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
}
}
[XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.expandable.svg")]
@@ -165,6 +166,7 @@ namespace Crow if (Content.Parent == null)
tc.AddWidget (Content);
tc.PutOnTop (Content);
+ _content_LayoutChanged (this, new LayoutChangeEventArgs (LayoutingType.Sizing));
}
Pop.Raise (this, e);
}
@@ -182,6 +184,5 @@ namespace Crow IsPopped = !IsPopped;
base.onMouseClick (sender, e);
}
-
}
}
diff --git a/src/GraphicObjects/Scrollbar.cs b/src/GraphicObjects/ScrollBar.cs index f68bdb77..905efc55 100644 --- a/src/GraphicObjects/Scrollbar.cs +++ b/src/GraphicObjects/ScrollBar.cs @@ -16,8 +16,8 @@ using System.ComponentModel; namespace Crow
{
- [DefaultTemplate("#Crow.Templates.Scrollbar.goml")]
- public class Scrollbar : TemplatedControl, IValueChange
+ [DefaultTemplate("#Crow.Templates.ScrollBar.goml")]
+ public class ScrollBar : TemplatedControl, IValueChange
{
#region IValueChange implementation
public event EventHandler<ValueChangeEventArgs> ValueChanged;
@@ -28,7 +28,7 @@ namespace Crow double _maximumScroll;
double _scroll;
- public Scrollbar() : base()
+ public ScrollBar() : base()
{
}
diff --git a/src/GraphicObjects/Slider.cs b/src/GraphicObjects/Slider.cs index 97bc177f..7b44a93e 100644 --- a/src/GraphicObjects/Slider.cs +++ b/src/GraphicObjects/Slider.cs @@ -154,6 +154,7 @@ namespace Crow cursor.TopLeft = new Point ((int)(p1.X - r.Width / 2),
r.Top + (int)(Value * unity));
}
+ cursor.Inflate (-1);
}
#region mouse handling
diff --git a/src/GraphicObjects/TextBox.cs b/src/GraphicObjects/TextBox.cs index 097ecaa1..9fca2fea 100644 --- a/src/GraphicObjects/TextBox.cs +++ b/src/GraphicObjects/TextBox.cs @@ -12,16 +12,16 @@ using System.Runtime.InteropServices; namespace Crow
{
- public class TextBoxWidget : Label
+ public class TextBox : Label
{
#region CTOR
- public TextBoxWidget(string _initialValue)
+ public TextBox(string _initialValue)
: base(_initialValue)
{
}
- public TextBoxWidget()
+ public TextBox()
{ }
#endregion
diff --git a/src/Interface.cs b/src/Interface.cs index c1713838..b6e5b3f1 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -112,8 +112,11 @@ namespace Crow if (path.StartsWith ("#")) { string resId = path.Substring (1); - stream = System.Reflection.Assembly.GetEntryAssembly ().GetManifestResourceStream (resId); - if (stream == null)//try to find ressource in golib assembly + //try/catch added to prevent nunit error + try { + stream = System.Reflection.Assembly.GetEntryAssembly ().GetManifestResourceStream (resId); + } catch (Exception ex) {} + if (stream == null)//try to find ressource in Crow assembly stream = System.Reflection.Assembly.GetExecutingAssembly ().GetManifestResourceStream (resId); if (stream == null) throw new Exception ("Resource not found: " + path); |