Focusable = true;
Height = Fit;
}
+Border {
+ Foreground = Gray;
+}
+CheckBox { Caption = CheckBox; }
+RadioButton { Caption = RadioButton; }
+Expandable { Caption = Expandable; }
+Popper { Caption = Popper; }
+GroupBox { Caption = Group Box; }
Wrapper {
Orientation = Vertical;
}
Button {
+ Caption = Button;
Width = Fit;
}
Label {
VerticalAlignment = Top;
}
MenuItem {
+ Caption = MenuItem;
Width = Stretched;
Height = Fit;
Background = Transparent;
CacheEnabled = false;
}
TabItem {
+ Caption = TabItem;
Focusable = true;
CacheEnabled = false;
}
Margin = 1;
}
Window {
+ Caption = Window;
Focusable = true;
MinimumSize=5,5;
Width = 150;
Height = 150;
}
ToolWindow {
+ Caption = Window;
Template = #Crow.ToolWindow.template;
Focusable = true;
MinimumSize=50,50;
Width = 500;
Height = 300;
}
-Border {
- Foreground = Gray;
-}
ProgressBar {
Foreground = vgradient|0:BlueCrayola|0.5:SkyBlue|1:BlueCrayola;
}
Icon {
Margin=1;
Width=12;
- Height=12;
+ Height=12;
}
Control {
Margin=0;
MouseEnter="{Background=LightGray}"
MouseLeave="{Background=Transparent}">
<Image
- Path="{./Image}"
+ Path="#Crow.Images.Icons.expandable.svg"
Visible="{./IsExpandable}"
SvgSub="{./IsExpanded}"/>
</Container>
{
public class Button : TemplatedContainer
{
- string caption;
string image;
bool isPressed;
Container _contentContainer;
}
#endregion
- [XmlAttributeAttribute][DefaultValue("Button")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
[XmlAttributeAttribute][DefaultValue("#Crow.Images.button.svg")]
public string Image {
get { return image; }
{
public class CheckBox : TemplatedControl
{
- string caption;
- string image;
bool isChecked;
#region CTOR
public CheckBox() : base()
- {}
+ {}
#endregion
public event EventHandler Checked;
public event EventHandler Unchecked;
- [XmlAttributeAttribute()][DefaultValue("Checkbox")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
[XmlAttributeAttribute()][DefaultValue(false)]
public bool IsChecked
{
{
if (isChecked == value)
return;
-
+
isChecked = value;
NotifyValueChanged ("IsChecked", value);
#region Private fields
bool _isExpanded;
- string caption;
string image;
Container _contentContainer;
#endregion
}
#region Public properties
- [XmlAttributeAttribute][DefaultValue("Expandable")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
[XmlAttributeAttribute][DefaultValue("#Crow.Images.Icons.expandable.svg")]
public string Image {
- get { return image; }
+ get { return image; }
set {
if (image == value)
return;
- image = value;
+ image = value;
NotifyValueChanged ("Image", image);
}
- }
+ }
[XmlAttributeAttribute][DefaultValue(false)]
public bool IsExpanded
{
[XmlIgnore]public bool IsExpandable {
get {
try {
- return GetIsExpandable == null ? true : GetIsExpandable (this);
+ return GetIsExpandable == null ? true : GetIsExpandable (this);
} catch (Exception ex) {
System.Diagnostics.Debug.WriteLine ("Not Expandable error: " + ex.ToString ());
return false;
- }
+ }
}
}
#endregion
{
if (_contentContainer != null)
_contentContainer.Visible = true;
-
+
Expand.Raise (this, e);
}
public virtual void onCollapse(object sender, EventArgs e)
{
if (_contentContainer != null)
_contentContainer.Visible = false;
-
+
Collapse.Raise (this, e);
}
}
namespace Crow
{
public class GroupBox : TemplatedContainer
- {
- string caption;
+ {
Container _contentContainer;
#region CTOR
- public GroupBox() : base(){}
+ public GroupBox() : base(){}
#endregion
#region Template overrides
_contentContainer = this.child.FindByName ("Content") as Container;
}
#endregion
-
- [XmlAttributeAttribute][DefaultValue("Groupbox")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
}
}
NotifyValueChanged ("Command", command);
}
}
- [XmlAttributeAttribute][DefaultValue("MenuItem")]
- public string Caption {
- get { return Command == null ? caption : Command.Caption; }
- set {
- if (caption == value)
- return;
- caption = value;
-
- if (command == null)//raise value changed only if not bound to a command
- NotifyValueChanged ("Caption", caption);
- }
+ [XmlAttributeAttribute]
+ public override string Caption {
+ get { return Command == null ? base.Caption : Command.Caption; }
+ set { base.Caption = value; }
}
[XmlAttributeAttribute]
public Picture Icon {
#endregion
bool _isPopped, _canPop;
- string caption;
Alignment popDirection;
GraphicObject _content;
Measure popWidth, popHeight;
- public event EventHandler Pop;
- public event EventHandler Unpop;
+ public event EventHandler Popped;
+ public event EventHandler Unpoped;
#region Public Properties
- [XmlAttributeAttribute()][DefaultValue("Popper")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
[XmlAttributeAttribute()][DefaultValue("Fit")]
public virtual Measure PopWidth {
get { return popWidth; }
CurrentInterface.PutOnTop (Content, true);
_content_LayoutChanged (this, new LayoutingEventArgs (LayoutingType.Sizing));
}
- Pop.Raise (this, e);
+ Popped.Raise (this, e);
}
public virtual void onUnpop(object sender, EventArgs e)
{
if (Content != null) {
Content.Visible = false;
}
- Unpop.Raise (this, e);
+ Unpoped.Raise (this, e);
}
}
}
{
public class RadioButton : TemplatedControl
{
- string caption;
- string image;
bool isChecked;
#region CTOR
}
#endregion
- [XmlAttributeAttribute()][DefaultValue("RadioButton")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
[XmlAttributeAttribute()][DefaultValue(false)]
public bool IsChecked
{
RegisterForGraphicUpdate ();
}
}
- [XmlAttributeAttribute][DefaultValue("TabItem")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
+
[XmlAttributeAttribute][DefaultValue(false)]
public virtual bool IsSelected {
get { return isSelected; }
}
#endregion
- public override void Initialize ()
- {
- loadTemplate ();
- base.Initialize ();
- }
-
string _template;
+ string caption;
+
[XmlAttributeAttribute][DefaultValue(null)]
public string Template {
get { return _template; }
loadTemplate (CurrentInterface.Load (_template));
}
}
-
+ [XmlAttributeAttribute()][DefaultValue("Templated Control")]
+ public virtual string Caption {
+ get { return caption; }
+ set {
+ if (caption == value)
+ return;
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
+ }
+ }
#region GraphicObject overrides
+ public override void Initialize ()
+ {
+ loadTemplate ();
+ base.Initialize ();
+ }
public override GraphicObject FindByName (string nameToFind)
{
//prevent name searching in template