aboutsummaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-02-07 07:43:48 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-02-07 07:43:48 +0100
commit158bc472eff0771479d48e5bd74a8141d62ab60a (patch)
tree492f2d255de49b5c04ebba237ecb40b265bd6534 /src
parenta330b907a9c9252c480ea352606d961bdc7c3ecb (diff)
:book: , renames, move some controls to other project file
Diffstat (limited to 'src')
-rw-r--r--src/GraphicObjects/AnalogMeter.cs68
-rw-r--r--src/GraphicObjects/Border.cs2
-rw-r--r--src/GraphicObjects/Button.cs2
-rw-r--r--src/GraphicObjects/CheckBox.cs2
-rw-r--r--src/GraphicObjects/ColorPicker.cs2
-rw-r--r--src/GraphicObjects/ColorSelector.cs2
-rw-r--r--src/GraphicObjects/ComboBox.cs2
-rw-r--r--src/GraphicObjects/Container.cs2
-rw-r--r--src/GraphicObjects/DirectoryView.cs2
-rw-r--r--src/GraphicObjects/DockingView.cs166
-rw-r--r--src/GraphicObjects/DocksView.cs91
-rw-r--r--src/GraphicObjects/Expandable.cs2
-rw-r--r--src/GraphicObjects/FileDialog.cs2
-rw-r--r--src/GraphicObjects/GenericStack.cs2
-rw-r--r--src/GraphicObjects/GraduatedSlider.cs2
-rw-r--r--src/GraphicObjects/Grid.cs40
-rw-r--r--src/GraphicObjects/Group.cs4
-rw-r--r--src/GraphicObjects/GroupBox.cs2
-rw-r--r--src/GraphicObjects/HorizontalStack.cs2
-rw-r--r--src/GraphicObjects/HueSelector.cs2
-rw-r--r--src/GraphicObjects/Image.cs35
-rw-r--r--src/GraphicObjects/Label.cs2
-rw-r--r--src/GraphicObjects/ListBox.cs2
-rw-r--r--src/GraphicObjects/Menu.cs2
-rw-r--r--src/GraphicObjects/MenuItem.cs2
-rw-r--r--src/GraphicObjects/MessageBox.cs2
-rw-r--r--src/GraphicObjects/NumericControl.cs2
-rw-r--r--src/GraphicObjects/Popper.cs2
-rw-r--r--src/GraphicObjects/PrivateContainer.cs2
-rw-r--r--src/GraphicObjects/ProgressBar.cs2
-rw-r--r--src/GraphicObjects/RadioButton.cs2
-rw-r--r--src/GraphicObjects/ScrollBar.cs2
-rw-r--r--src/GraphicObjects/Scroller.cs2
-rw-r--r--src/GraphicObjects/ScrollingObject.cs2
-rw-r--r--src/GraphicObjects/ScrollingTextBox.cs6
-rw-r--r--src/GraphicObjects/Slider.cs2
-rw-r--r--src/GraphicObjects/Spinner.cs2
-rw-r--r--src/GraphicObjects/Splitter.cs2
-rw-r--r--src/GraphicObjects/TabItem.cs2
-rw-r--r--src/GraphicObjects/TabView.cs2
-rw-r--r--src/GraphicObjects/TemplatedContainer.cs2
-rw-r--r--src/GraphicObjects/TemplatedControl.cs2
-rw-r--r--src/GraphicObjects/TemplatedGroup.cs2
-rw-r--r--src/GraphicObjects/TextBox.cs2
-rw-r--r--src/GraphicObjects/TextRun.cs2
-rw-r--r--src/GraphicObjects/TreeView.cs2
-rw-r--r--src/GraphicObjects/Trend.cs5
-rw-r--r--src/GraphicObjects/VerticalStack.cs4
-rw-r--r--src/GraphicObjects/Window.cs2
-rw-r--r--src/GraphicObjects/Wrapper.cs2
-rw-r--r--src/Interface.cs5
51 files changed, 107 insertions, 399 deletions
diff --git a/src/GraphicObjects/AnalogMeter.cs b/src/GraphicObjects/AnalogMeter.cs
deleted file mode 100644
index fba58d9d..00000000
--- a/src/GraphicObjects/AnalogMeter.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// AnalogMeter.cs
-//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Xml.Serialization;
-using System.ComponentModel;
-using Cairo;
-
-namespace Crow
-{
- public class AnalogMeter : NumericControl
- {
- #region CTOR
- public AnalogMeter () : base(){}
- public AnalogMeter (Interface iface) : base(iface){}
- #endregion
-
- #region GraphicObject Overrides
- protected override void onDraw (Context gr)
- {
- base.onDraw (gr);
-
- Rectangle r = ClientRectangle;
- Point m = r.Center;
-
- gr.Save ();
-
-
- double aUnit = Math.PI*2.0 / (Maximum - Minimum);
- gr.Translate (m.X, r.Height *1.1);
- gr.Rotate (Value/4.0 * aUnit - Math.PI/4.0);
- gr.Translate (-m.X, -m.Y);
-
- gr.LineWidth = 2;
- Foreground.SetAsSource (gr);
- gr.MoveTo (m.X,0.0);
- gr.LineTo (m.X, -m.Y*0.5);
- gr.Stroke ();
-
- gr.Restore ();
- }
- #endregion
- }
-}
-
diff --git a/src/GraphicObjects/Border.cs b/src/GraphicObjects/Border.cs
index 569315cc..f2be5993 100644
--- a/src/GraphicObjects/Border.cs
+++ b/src/GraphicObjects/Border.cs
@@ -47,7 +47,7 @@ namespace Crow
public class Border : Container
{
#region CTOR
- public Border () : base(){}
+ protected Border () : base(){}
public Border (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/Button.cs b/src/GraphicObjects/Button.cs
index d4b95457..8b60dcb9 100644
--- a/src/GraphicObjects/Button.cs
+++ b/src/GraphicObjects/Button.cs
@@ -44,7 +44,7 @@ namespace Crow
public class Button : TemplatedContainer
{
#region CTOR
- public Button() : base() {}
+ protected Button() : base() {}
public Button (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/CheckBox.cs b/src/GraphicObjects/CheckBox.cs
index 8ff06a30..3a6b2b6a 100644
--- a/src/GraphicObjects/CheckBox.cs
+++ b/src/GraphicObjects/CheckBox.cs
@@ -36,7 +36,7 @@ namespace Crow
public class CheckBox : TemplatedControl
{
#region CTOR
- public CheckBox () : base(){}
+ protected CheckBox() : base(){}
public CheckBox (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/ColorPicker.cs b/src/GraphicObjects/ColorPicker.cs
index b6165c05..3a5ec23f 100644
--- a/src/GraphicObjects/ColorPicker.cs
+++ b/src/GraphicObjects/ColorPicker.cs
@@ -36,7 +36,7 @@ namespace Crow
public class ColorPicker : TemplatedControl
{
#region CTOR
- public ColorPicker () : base(){}
+ protected ColorPicker() : base(){}
public ColorPicker (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/ColorSelector.cs b/src/GraphicObjects/ColorSelector.cs
index cb33d502..5b32fc95 100644
--- a/src/GraphicObjects/ColorSelector.cs
+++ b/src/GraphicObjects/ColorSelector.cs
@@ -36,7 +36,7 @@ namespace Crow
public class ColorSelector : GraphicObject
{
#region CTOR
- public ColorSelector () : base(){}
+ protected ColorSelector() : base(){}
public ColorSelector (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/ComboBox.cs b/src/GraphicObjects/ComboBox.cs
index fbb4b953..61227055 100644
--- a/src/GraphicObjects/ComboBox.cs
+++ b/src/GraphicObjects/ComboBox.cs
@@ -35,7 +35,7 @@ namespace Crow
public class ComboBox : ListBox
{
#region CTOR
- public ComboBox () : base(){}
+ protected ComboBox() : base(){}
public ComboBox (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/Container.cs b/src/GraphicObjects/Container.cs
index 05d63012..fedee0af 100644
--- a/src/GraphicObjects/Container.cs
+++ b/src/GraphicObjects/Container.cs
@@ -39,7 +39,7 @@ namespace Crow
public class Container : PrivateContainer
{
#region CTOR
- public Container () : base(){}
+ protected Container() : base(){}
public Container (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/DirectoryView.cs b/src/GraphicObjects/DirectoryView.cs
index 9b876d91..0aa44267 100644
--- a/src/GraphicObjects/DirectoryView.cs
+++ b/src/GraphicObjects/DirectoryView.cs
@@ -37,7 +37,7 @@ namespace Crow
public class DirectoryView : TemplatedControl
{
#region CTOR
- public DirectoryView () : base(){}
+ protected DirectoryView() : base(){}
public DirectoryView (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/DockingView.cs b/src/GraphicObjects/DockingView.cs
deleted file mode 100644
index db11c08d..00000000
--- a/src/GraphicObjects/DockingView.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// DockingView.cs
-//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-
-namespace Crow
-{
- public class DockingView : Window
- {
- #region CTOR
- public DockingView () : base ()
- {
- }
- #endregion
-
- bool isDocked = false;
- Alignment docking = Alignment.Center;
-
- Point lastMousePos; //last known mouse pos in this control
- Point undockingMousePosOrig; //mouse pos when docking was donne, use for undocking on mouse move
- Rectangle savedSlot; //last undocked slot recalled when view is undocked
- bool wasResizable;
-
- public DocksView docker;
-
- public override void OnLayoutChanges (LayoutingType layoutType)
- {
- base.OnLayoutChanges (layoutType);
-
- if (isDocked)
- return;
-
- if (docker == null)
- return;
-
- Rectangle dvCliRect = docker.ClientRectangle;
-
- if (layoutType == LayoutingType.X) {
- if (Slot.X < docker.DockingThreshold)
- dock (Alignment.Left);
- else if (Slot.Right > dvCliRect.Width - docker.DockingThreshold)
- dock (Alignment.Right);
- }else if (layoutType == LayoutingType.Y) {
- if (Slot.Y < docker.DockingThreshold)
- dock (Alignment.Top);
- else if (Slot.Bottom > dvCliRect.Height - docker.DockingThreshold)
- dock (Alignment.Bottom);
- }
- }
-
- public override void onMouseMove (object sender, MouseMoveEventArgs e)
- {
- lastMousePos = e.Position;
-
- if (this.HasFocus && e.Mouse.IsButtonDown (MouseButton.Left) && isDocked) {
- if (docking == Alignment.Left) {
- if (lastMousePos.X - undockingMousePosOrig.X > docker.DockingThreshold)
- undock ();
- } else if (docking == Alignment.Right) {
- if (undockingMousePosOrig.X - lastMousePos.X > docker.DockingThreshold)
- undock ();
- } else if (docking == Alignment.Top) {
- if (lastMousePos.Y - undockingMousePosOrig.Y > docker.DockingThreshold)
- undock ();
- } else if (docking == Alignment.Bottom) {
- if (undockingMousePosOrig.Y - lastMousePos.Y > docker.DockingThreshold)
- undock ();
- }
- return;
- }
-
- base.onMouseMove (sender, e);
- }
- public override void onMouseDown (object sender, MouseButtonEventArgs e)
- {
- base.onMouseDown (sender, e);
-
- if (this.HasFocus && isDocked && e.Button == MouseButton.Left)
- undockingMousePosOrig = lastMousePos;
- }
-
-// protected override void onBorderMouseEnter (object sender, MouseMoveEventArgs e)
-// {
-// base.onBorderMouseEnter (sender, e);
-//
-// if (isDocked) {
-// switch (docking) {
-// case Alignment.Top:
-// if (this.currentDirection != Window.Direction.S)
-// onBorderMouseLeave (this, null);
-// break;
-// case Alignment.Left:
-// if (this.currentDirection != Window.Direction.E)
-// onBorderMouseLeave (this, null);
-// break;
-// case Alignment.TopLeft:
-// break;
-// case Alignment.Right:
-// if (this.currentDirection != Window.Direction.W)
-// onBorderMouseLeave (this, null);
-// break;
-// case Alignment.TopRight:
-// break;
-// case Alignment.Bottom:
-// if (this.currentDirection != Window.Direction.N)
-// onBorderMouseLeave (this, null);
-// break;
-// case Alignment.BottomLeft:
-// break;
-// case Alignment.BottomRight:
-// break;
-// case Alignment.Center:
-// break;
-// default:
-// break;
-// }
-// }
-// }
-
- void undock () {
- docker.Undock(this);
-
- this.Left = savedSlot.Left;
- this.Top = savedSlot.Top;
- this.Width = savedSlot.Width;
- this.Height = savedSlot.Height;
-
- isDocked = false;
- Resizable = wasResizable;
- }
- void dock (Alignment align){
- this.Left = this.Top = 0;
- isDocked = true;
- docking = align;
- undockingMousePosOrig = lastMousePos;
- savedSlot = this.LastPaintedSlot;
- wasResizable = Resizable;
- Resizable = false;
-
- docker.Dock (this, align);
- }
- }
-}
-
diff --git a/src/GraphicObjects/DocksView.cs b/src/GraphicObjects/DocksView.cs
deleted file mode 100644
index a93bdc78..00000000
--- a/src/GraphicObjects/DocksView.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// DocksView.cs
-//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Xml.Serialization;
-using System.ComponentModel;
-using System.Collections.Generic;
-
-namespace Crow
-{
- public class DocksView : Group
- {
- List<DockingView> childViews = new List<DockingView>();
- GenericStack rootStack = null;
-
- public override void AddChild (GraphicObject g)
- {
- DockingView dv = g as DockingView;
- if (g == null)
- throw new Exception ("DocksView accept only DockingView as child");
- base.AddChild (g);
- childViews.Add (dv);
- dv.docker = this;
- }
- public override void RemoveChild (GraphicObject child)
- {
- DockingView dv = child as DockingView;
- if (child == null)
- throw new Exception ("DocksView accept only DockingView as child");
- base.RemoveChild (child);
- childViews.Remove (dv);
- dv.docker = this;
- }
- public void Dock (DockingView dv, Alignment pos){
- switch (pos) {
- case Alignment.Top:
- if (rootStack?.Orientation != Orientation.Vertical)
- this.Width = Measure.Stretched;
- break;
- case Alignment.Bottom:
- this.Width = Measure.Stretched;
- break;
- case Alignment.Left:
- this.Height = Measure.Stretched;
- break;
- case Alignment.Right:
- this.Height = Measure.Stretched;
- break;
- }
- }
- public void Undock (DockingView dv){
- }
-
- int dockingThreshold;
-
- [XmlAttributeAttribute][DefaultValue(10)]
- public virtual int DockingThreshold {
- get { return dockingThreshold; }
- set {
- if (dockingThreshold == value)
- return;
- dockingThreshold = value;
- NotifyValueChanged ("DockingThreshold", dockingThreshold);
-
- }
- }
- }
-}
-
diff --git a/src/GraphicObjects/Expandable.cs b/src/GraphicObjects/Expandable.cs
index 43f44a93..aff804f8 100644
--- a/src/GraphicObjects/Expandable.cs
+++ b/src/GraphicObjects/Expandable.cs
@@ -36,7 +36,7 @@ namespace Crow
public class Expandable : TemplatedContainer
{
#region CTOR
- public Expandable () : base(){}
+ protected Expandable() : base(){}
public Expandable (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/FileDialog.cs b/src/GraphicObjects/FileDialog.cs
index 76a5a9ee..f2fb3b89 100644
--- a/src/GraphicObjects/FileDialog.cs
+++ b/src/GraphicObjects/FileDialog.cs
@@ -41,7 +41,7 @@ namespace Crow
public class FileDialog: Window
{
#region CTOR
- public FileDialog () : base(){}
+ protected FileDialog() : base(){}
public FileDialog (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs
index f65447b1..7976f837 100644
--- a/src/GraphicObjects/GenericStack.cs
+++ b/src/GraphicObjects/GenericStack.cs
@@ -37,7 +37,7 @@ namespace Crow
public class GenericStack : Group
{
#region CTOR
- public GenericStack () : base(){}
+ protected GenericStack() : base(){}
public GenericStack(Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/GraduatedSlider.cs b/src/GraphicObjects/GraduatedSlider.cs
index b8d7d581..52ba2960 100644
--- a/src/GraphicObjects/GraduatedSlider.cs
+++ b/src/GraphicObjects/GraduatedSlider.cs
@@ -36,7 +36,7 @@ namespace Crow
public class GraduatedSlider : Slider
{
#region CTOR
- public GraduatedSlider () : base(){}
+ protected GraduatedSlider() : base(){}
public GraduatedSlider(Interface iface) : base(iface)
{}
// public GraduatedSlider(double minimum, double maximum, double step)
diff --git a/src/GraphicObjects/Grid.cs b/src/GraphicObjects/Grid.cs
index 5756525e..f8a50264 100644
--- a/src/GraphicObjects/Grid.cs
+++ b/src/GraphicObjects/Grid.cs
@@ -43,7 +43,7 @@ namespace Crow
public class Grid : Group
{
#region CTOR
- public Grid () : base(){}
+ protected Grid () : base(){}
public Grid(Interface iface) : base(iface)
{
}
@@ -55,17 +55,6 @@ namespace Crow
int _rowCount;
#endregion
- public override void AddChild (GraphicObject child)
- {
- base.AddChild (child);
- this.RegisterForLayouting (LayoutingType.ArrangeChildren);
- }
- public override void RemoveChild (GraphicObject child)
- {
- base.RemoveChild (child);
- this.RegisterForLayouting (LayoutingType.ArrangeChildren);
- }
-
#region Public Properties
[XmlAttributeAttribute()][DefaultValue(2)]
public int Spacing
@@ -73,7 +62,7 @@ namespace Crow
get { return _spacing; }
set { _spacing = value; }
}
- [XmlAttributeAttribute()][DefaultValue(1)]
+ [XmlAttributeAttribute()][DefaultValue(2)]
public virtual int ColumnCount
{
get { return _columnCount; }
@@ -87,7 +76,7 @@ namespace Crow
this.RegisterForLayouting (LayoutingType.ArrangeChildren);
}
}
- [XmlAttributeAttribute()][DefaultValue(1)]
+ [XmlAttributeAttribute()][DefaultValue(2)]
public virtual int RowCount
{
get { return _rowCount; }
@@ -127,6 +116,12 @@ namespace Crow
//
// return tmp;
// }
+ public override void ChildrenLayoutingConstraints (ref LayoutingType layoutType)
+ {
+ //Prevent child repositionning
+ layoutType &= (~LayoutingType.Positioning);
+ }
+ public override bool ArrangeChildren { get { return true; } }
public virtual void ComputeChildrenPositions()
{
int slotWidth = CaseWidth;
@@ -139,17 +134,18 @@ namespace Crow
GraphicObject c = Children [idx];
if (!c.Visible)
continue;
- //ensure Item are not realigned
- c.HorizontalAlignment = HorizontalAlignment.Left;
- c.VerticalAlignment = VerticalAlignment.Top;
- c.Left = curX * (slotWidth + Spacing);
- c.Top = curY * (slotHeight + Spacing);
- c.Width = slotWidth;
- c.Height = slotHeight;
+ c.Slot.X = curX * (slotWidth + Spacing);
+ c.Slot.Y = curY * (slotHeight + Spacing);
+ //c.Slot.Width = slotWidth;
+ //c.Slot.Height = slotHeight;
}
}
+ IsDirty = true;
+ }
+ public override void OnChildLayoutChanges (object sender, LayoutingEventArgs arg)
+ {
+ //base.OnChildLayoutChanges (sender, arg);
}
-
public override bool UpdateLayout (LayoutingType layoutType)
{
diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs
index 2cfa3774..a940ee7e 100644
--- a/src/GraphicObjects/Group.cs
+++ b/src/GraphicObjects/Group.cs
@@ -38,7 +38,7 @@ namespace Crow
public class Group : GraphicObject
{
#region CTOR
- public Group () : base(){}
+ protected Group () : base(){}
public Group(Interface iface) : base(iface){}
#endregion
@@ -67,8 +67,8 @@ namespace Crow
Children.Add (g);
}
g.RegisteredLayoutings = LayoutingType.None;
- g.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren);
g.LayoutChanged += OnChildLayoutChanges;
+ g.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren);
}
public virtual void RemoveChild(GraphicObject child)
{
diff --git a/src/GraphicObjects/GroupBox.cs b/src/GraphicObjects/GroupBox.cs
index 61e7f2af..2e32ddd5 100644
--- a/src/GraphicObjects/GroupBox.cs
+++ b/src/GraphicObjects/GroupBox.cs
@@ -36,7 +36,7 @@ namespace Crow
public class GroupBox : TemplatedContainer
{
#region CTOR
- public GroupBox () : base(){}
+ protected GroupBox () : base(){}
public GroupBox(Interface iface) : base(iface){}
#endregion
}
diff --git a/src/GraphicObjects/HorizontalStack.cs b/src/GraphicObjects/HorizontalStack.cs
index 74e46e9c..64d7cae5 100644
--- a/src/GraphicObjects/HorizontalStack.cs
+++ b/src/GraphicObjects/HorizontalStack.cs
@@ -38,7 +38,7 @@ namespace Crow
public class HorizontalStack : GenericStack
{
#region CTOR
- public HorizontalStack () : base(){}
+ protected HorizontalStack () : base(){}
public HorizontalStack(Interface iface) : base(iface)
{
}
diff --git a/src/GraphicObjects/HueSelector.cs b/src/GraphicObjects/HueSelector.cs
index 08c84deb..518ee6c4 100644
--- a/src/GraphicObjects/HueSelector.cs
+++ b/src/GraphicObjects/HueSelector.cs
@@ -34,7 +34,7 @@ namespace Crow
public class HueSelector : ColorSelector
{
#region CTOR
- public HueSelector () : base(){}
+ protected HueSelector () : base(){}
public HueSelector (Interface iface) : base(iface)
{
}
diff --git a/src/GraphicObjects/Image.cs b/src/GraphicObjects/Image.cs
index 622fa714..75c59f4a 100644
--- a/src/GraphicObjects/Image.cs
+++ b/src/GraphicObjects/Image.cs
@@ -33,6 +33,11 @@ using System.Diagnostics;
namespace Crow
{
+ /// <summary>
+ /// Base widget to display an image. Accepts bitmaps and SVGs.
+ /// </summary>
+ /// <remarks>
+ /// </remarks>
public class Image : GraphicObject
{
Picture _pic;
@@ -41,6 +46,9 @@ namespace Crow
double opacity;
#region Public properties
+ /// <summary>
+ /// If false, original size will be kept in any case.
+ /// </summary>
[XmlAttributeAttribute][DefaultValue(true)]
public virtual bool Scaled {
get { return scaled; }
@@ -55,6 +63,9 @@ namespace Crow
RegisterForGraphicUpdate ();
}
}
+ /// <summary>
+ /// If image is scaled, proportions will be preserved.
+ /// </summary>
[XmlAttributeAttribute][DefaultValue(true)]
public virtual bool KeepProportions {
get { return keepProps; }
@@ -69,6 +80,9 @@ namespace Crow
RegisterForGraphicUpdate ();
}
}
+ /// <summary>
+ /// Image file path, may be on disk or embedded. Accepts bitmaps or SVG drawings.
+ /// </summary>
[XmlAttributeAttribute]
public string Path {
get { return _pic == null ? "" : _pic.Path; }
@@ -90,6 +104,10 @@ namespace Crow
NotifyValueChanged ("Path", Path);
}
}
+ /// <summary>
+ /// Used only for svg images, repaint only node named referenced in SvgSub.
+ /// If null, all the svg is rendered
+ /// </summary>
[XmlAttributeAttribute]
public string SvgSub {
get { return _svgSub; }
@@ -100,6 +118,10 @@ namespace Crow
RegisterForGraphicUpdate ();
}
}
+ /// <summary>
+ /// Object holding the image data once loaded, may be used directely to pupulate this control without
+ /// specifying a path.
+ /// </summary>
[XmlAttributeAttribute]
public Picture Picture {
get { return _pic; }
@@ -111,6 +133,10 @@ namespace Crow
RegisterForGraphicUpdate ();
}
}
+ /// <summary>
+ /// Opacity parameter for the image
+ /// </summary>
+ // TODO:could be moved in GraphicObject
[XmlAttributeAttribute()][DefaultValue(1.0)]
public virtual double Opacity {
get { return opacity; }
@@ -125,7 +151,14 @@ namespace Crow
#endregion
#region CTOR
- public Image () : base(){}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="Crow.Image"/> class.
+ /// </summary>
+ protected Image () : base(){}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="Crow.Image"/> class from code
+ /// </summary>
+ /// <param name="iface">interface to bound to</param>
public Image (Interface iface) : base(iface)
{
}
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs
index 7c7c584c..de7b7f51 100644
--- a/src/GraphicObjects/Label.cs
+++ b/src/GraphicObjects/Label.cs
@@ -38,7 +38,7 @@ namespace Crow
public class Label : GraphicObject
{
#region CTOR
- public Label () : base(){}
+ protected Label () : base(){}
public Label(Interface iface) : base(iface)
{
diff --git a/src/GraphicObjects/ListBox.cs b/src/GraphicObjects/ListBox.cs
index 67e4b583..438e8d60 100644
--- a/src/GraphicObjects/ListBox.cs
+++ b/src/GraphicObjects/ListBox.cs
@@ -39,7 +39,7 @@ namespace Crow
public class ListBox : TemplatedGroup
{
#region CTOR
- public ListBox () : base(){}
+ protected ListBox () : base(){}
public ListBox (Interface iface) : base(iface) {}
#endregion
diff --git a/src/GraphicObjects/Menu.cs b/src/GraphicObjects/Menu.cs
index d7a7f5a6..dbc1d636 100644
--- a/src/GraphicObjects/Menu.cs
+++ b/src/GraphicObjects/Menu.cs
@@ -33,7 +33,7 @@ namespace Crow
public class Menu : TemplatedGroup
{
#region CTOR
- public Menu () : base(){}
+ protected Menu () : base(){}
public Menu (Interface iface) : base(iface) {}
#endregion
diff --git a/src/GraphicObjects/MenuItem.cs b/src/GraphicObjects/MenuItem.cs
index cd2a54a8..ae27b013 100644
--- a/src/GraphicObjects/MenuItem.cs
+++ b/src/GraphicObjects/MenuItem.cs
@@ -33,7 +33,7 @@ namespace Crow
public class MenuItem : Menu
{
#region CTOR
- public MenuItem () : base(){}
+ protected MenuItem () : base(){}
public MenuItem (Interface iface) : base(iface) {}
#endregion
diff --git a/src/GraphicObjects/MessageBox.cs b/src/GraphicObjects/MessageBox.cs
index 0e308bf9..277a7e11 100644
--- a/src/GraphicObjects/MessageBox.cs
+++ b/src/GraphicObjects/MessageBox.cs
@@ -33,7 +33,7 @@ namespace Crow
public class MessageBox : Window
{
#region CTOR
- public MessageBox () : base(){}
+ protected MessageBox () : base(){}
public MessageBox (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/NumericControl.cs b/src/GraphicObjects/NumericControl.cs
index 21cb1961..f0eda90f 100644
--- a/src/GraphicObjects/NumericControl.cs
+++ b/src/GraphicObjects/NumericControl.cs
@@ -33,7 +33,7 @@ namespace Crow
public abstract class NumericControl : TemplatedControl
{
#region CTOR
- public NumericControl () : base(){}
+ protected NumericControl () : base(){}
public NumericControl (Interface iface) : base(iface)
{
}
diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs
index 9f60aa40..5316a5a7 100644
--- a/src/GraphicObjects/Popper.cs
+++ b/src/GraphicObjects/Popper.cs
@@ -33,7 +33,7 @@ namespace Crow
public class Popper : TemplatedContainer
{
#region CTOR
- public Popper () : base(){}
+ protected Popper () : base(){}
public Popper (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/PrivateContainer.cs b/src/GraphicObjects/PrivateContainer.cs
index 6eb5e95e..5ee29e94 100644
--- a/src/GraphicObjects/PrivateContainer.cs
+++ b/src/GraphicObjects/PrivateContainer.cs
@@ -41,7 +41,7 @@ namespace Crow
public class PrivateContainer : GraphicObject
{
#region CTOR
- public PrivateContainer () : base(){}
+ protected PrivateContainer () : base(){}
public PrivateContainer (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/ProgressBar.cs b/src/GraphicObjects/ProgressBar.cs
index 2995272b..e8165fd2 100644
--- a/src/GraphicObjects/ProgressBar.cs
+++ b/src/GraphicObjects/ProgressBar.cs
@@ -39,7 +39,7 @@ namespace Crow
public class ProgressBar : NumericControl
{
#region CTOR
- public ProgressBar () : base(){}
+ protected ProgressBar () : base(){}
public ProgressBar(Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/RadioButton.cs b/src/GraphicObjects/RadioButton.cs
index bf31a42c..ead332ea 100644
--- a/src/GraphicObjects/RadioButton.cs
+++ b/src/GraphicObjects/RadioButton.cs
@@ -35,7 +35,7 @@ namespace Crow
bool isChecked;
#region CTOR
- public RadioButton () : base(){}
+ protected RadioButton () : base(){}
public RadioButton(Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/ScrollBar.cs b/src/GraphicObjects/ScrollBar.cs
index 586ebbbe..31ff7acf 100644
--- a/src/GraphicObjects/ScrollBar.cs
+++ b/src/GraphicObjects/ScrollBar.cs
@@ -40,7 +40,7 @@ namespace Crow
Orientation _orientation;
#region CTOR
- public ScrollBar () : base(){}
+ protected ScrollBar () : base(){}
public ScrollBar(Interface iface) : base(iface) {}
#endregion
diff --git a/src/GraphicObjects/Scroller.cs b/src/GraphicObjects/Scroller.cs
index b68335f6..8dfed1eb 100644
--- a/src/GraphicObjects/Scroller.cs
+++ b/src/GraphicObjects/Scroller.cs
@@ -38,7 +38,7 @@ namespace Crow
public class Scroller : Container
{
#region CTOR
- public Scroller () : base(){}
+ protected Scroller () : base(){}
public Scroller (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/ScrollingObject.cs b/src/GraphicObjects/ScrollingObject.cs
index 7e61c392..9059d8ed 100644
--- a/src/GraphicObjects/ScrollingObject.cs
+++ b/src/GraphicObjects/ScrollingObject.cs
@@ -39,7 +39,7 @@ namespace Crow
public class ScrollingObject : GraphicObject
{
#region CTOR
- public ScrollingObject ():base(){}
+ protected ScrollingObject ():base(){}
public ScrollingObject (Interface iface):base(iface){}
#endregion
diff --git a/src/GraphicObjects/ScrollingTextBox.cs b/src/GraphicObjects/ScrollingTextBox.cs
index 0fb9a7b4..c84594df 100644
--- a/src/GraphicObjects/ScrollingTextBox.cs
+++ b/src/GraphicObjects/ScrollingTextBox.cs
@@ -42,11 +42,11 @@ namespace Crow
public class ScrollingTextBox : ScrollingObject
{
#region CTOR
- public ScrollingTextBox (Interface iface):base(iface){
+ protected ScrollingTextBox ():base()
+ {
KeyEventsOverrides = true;
}
- public ScrollingTextBox ():base()
- {
+ public ScrollingTextBox (Interface iface):base(iface){
KeyEventsOverrides = true;
}
#endregion
diff --git a/src/GraphicObjects/Slider.cs b/src/GraphicObjects/Slider.cs
index bc879a96..a664f4e7 100644
--- a/src/GraphicObjects/Slider.cs
+++ b/src/GraphicObjects/Slider.cs
@@ -39,7 +39,7 @@ namespace Crow
public class Slider : NumericControl
{
#region CTOR
- public Slider() : base(){}
+ protected Slider() : base(){}
public Slider(Interface iface) : base(iface)
{}
// public Slider(double minimum, double maximum, double step)
diff --git a/src/GraphicObjects/Spinner.cs b/src/GraphicObjects/Spinner.cs
index 69924a03..7c5fdb26 100644
--- a/src/GraphicObjects/Spinner.cs
+++ b/src/GraphicObjects/Spinner.cs
@@ -35,7 +35,7 @@ namespace Crow
public class Spinner : NumericControl
{
#region CTOR
- public Spinner() : base(){}
+ protected Spinner() : base(){}
public Spinner (Interface iface) : base(iface)
{
}
diff --git a/src/GraphicObjects/Splitter.cs b/src/GraphicObjects/Splitter.cs
index 1258012e..c688f773 100644
--- a/src/GraphicObjects/Splitter.cs
+++ b/src/GraphicObjects/Splitter.cs
@@ -37,7 +37,7 @@ namespace Crow
public class Splitter : GraphicObject
{
#region CTOR
- public Splitter() : base(){}
+ protected Splitter() : base(){}
public Splitter (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/TabItem.cs b/src/GraphicObjects/TabItem.cs
index b19d14e8..b35c544c 100644
--- a/src/GraphicObjects/TabItem.cs
+++ b/src/GraphicObjects/TabItem.cs
@@ -35,7 +35,7 @@ namespace Crow
public class TabItem : TemplatedContainer
{
#region CTOR
- public TabItem() : base(){}
+ protected TabItem() : base(){}
public TabItem (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/TabView.cs b/src/GraphicObjects/TabView.cs
index 62ada312..7bf93abd 100644
--- a/src/GraphicObjects/TabView.cs
+++ b/src/GraphicObjects/TabView.cs
@@ -35,7 +35,7 @@ namespace Crow
public class TabView : Group
{
#region CTOR
- public TabView() : base(){}
+ protected TabView() : base(){}
public TabView (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/TemplatedContainer.cs b/src/GraphicObjects/TemplatedContainer.cs
index a2e35eab..31bbc436 100644
--- a/src/GraphicObjects/TemplatedContainer.cs
+++ b/src/GraphicObjects/TemplatedContainer.cs
@@ -39,7 +39,7 @@ namespace Crow
public class TemplatedContainer : TemplatedControl
{
#region CTOR
- public TemplatedContainer() : base(){}
+ protected TemplatedContainer() : base(){}
public TemplatedContainer (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs
index a3a6b142..34e4ce07 100644
--- a/src/GraphicObjects/TemplatedControl.cs
+++ b/src/GraphicObjects/TemplatedControl.cs
@@ -44,7 +44,7 @@ namespace Crow
public abstract class TemplatedControl : PrivateContainer
{
#region CTOR
- public TemplatedControl() : base(){}
+ protected TemplatedControl() : base(){}
public TemplatedControl (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/TemplatedGroup.cs b/src/GraphicObjects/TemplatedGroup.cs
index 55726b50..c32b2c44 100644
--- a/src/GraphicObjects/TemplatedGroup.cs
+++ b/src/GraphicObjects/TemplatedGroup.cs
@@ -40,7 +40,7 @@ namespace Crow
public abstract class TemplatedGroup : TemplatedControl
{
#region CTOR
- public TemplatedGroup() : base(){}
+ protected TemplatedGroup() : base(){}
public TemplatedGroup (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/TextBox.cs b/src/GraphicObjects/TextBox.cs
index 2438c65a..a14aea6a 100644
--- a/src/GraphicObjects/TextBox.cs
+++ b/src/GraphicObjects/TextBox.cs
@@ -34,7 +34,7 @@ namespace Crow
public class TextBox : Label
{
#region CTOR
- public TextBox() : base(){}
+ protected TextBox() : base(){}
public TextBox(Interface iface) : base(iface)
{ }
// public TextBox(string _initialValue)
diff --git a/src/GraphicObjects/TextRun.cs b/src/GraphicObjects/TextRun.cs
index 55ac7f33..69495647 100644
--- a/src/GraphicObjects/TextRun.cs
+++ b/src/GraphicObjects/TextRun.cs
@@ -39,7 +39,7 @@ namespace Crow
public class TextRun : GraphicObject
{
#region CTOR
- public TextRun () : base(){}
+ protected TextRun () : base(){}
public TextRun (Interface iface) : base (iface){}
#endregion
diff --git a/src/GraphicObjects/TreeView.cs b/src/GraphicObjects/TreeView.cs
index 80c3385f..4125e582 100644
--- a/src/GraphicObjects/TreeView.cs
+++ b/src/GraphicObjects/TreeView.cs
@@ -39,7 +39,7 @@ namespace Crow
bool isRoot;
#region CTOR
- public TreeView() : base(){}
+ protected TreeView() : base(){}
public TreeView (Interface iface) : base(iface)
{
}
diff --git a/src/GraphicObjects/Trend.cs b/src/GraphicObjects/Trend.cs
index 055c870d..e9d3c2d3 100644
--- a/src/GraphicObjects/Trend.cs
+++ b/src/GraphicObjects/Trend.cs
@@ -50,10 +50,11 @@ namespace Crow
values.RemoveAt (0);
RegisterForRedraw ();
}
-
- public Trend ()
+ #region CTOR
+ protected Trend () : base()
{
}
+ #endregion
[XmlIgnore]public virtual int NewValue {
set {
AddValue (value);
diff --git a/src/GraphicObjects/VerticalStack.cs b/src/GraphicObjects/VerticalStack.cs
index d0122373..9650e685 100644
--- a/src/GraphicObjects/VerticalStack.cs
+++ b/src/GraphicObjects/VerticalStack.cs
@@ -36,10 +36,12 @@ namespace Crow
/// </summary>
public class VerticalStack : GenericStack
{
- public VerticalStack() : base(){}
+ #region CTOR
+ protected VerticalStack() : base(){}
public VerticalStack(Interface iface) : base(iface)
{
}
+ #endregion
[System.Xml.Serialization.XmlIgnore]
public override Orientation Orientation
diff --git a/src/GraphicObjects/Window.cs b/src/GraphicObjects/Window.cs
index efc8f4e3..5025b3fb 100644
--- a/src/GraphicObjects/Window.cs
+++ b/src/GraphicObjects/Window.cs
@@ -65,7 +65,7 @@ namespace Crow
#endregion
#region CTOR
- public Window() : base(){}
+ protected Window() : base(){}
public Window (Interface iface) : base(iface){}
#endregion
diff --git a/src/GraphicObjects/Wrapper.cs b/src/GraphicObjects/Wrapper.cs
index cfa1736f..e56d9332 100644
--- a/src/GraphicObjects/Wrapper.cs
+++ b/src/GraphicObjects/Wrapper.cs
@@ -35,7 +35,7 @@ namespace Crow
public class Wrapper : GenericStack
{
#region CTOR
- public Wrapper() : base(){}
+ protected Wrapper() : base(){}
public Wrapper (Interface iface) : base(iface){}
#endregion
diff --git a/src/Interface.cs b/src/Interface.cs
index b16acc07..7ea61287 100644
--- a/src/Interface.cs
+++ b/src/Interface.cs
@@ -43,7 +43,8 @@ namespace Crow
/// The Interface Class is the root of crow graphic trees. It is thread safe allowing
/// application to run multiple interfaces in different threads.
/// It provides the Dirty bitmap and zone of the interface to be drawn on screen.
- ///
+ /// </summary>
+ /// <remarks>
/// The Interface contains :
/// - rendering and layouting queues and logic.
/// - helpers to load XML interfaces files directely bound to this interface
@@ -61,7 +62,7 @@ namespace Crow
///
/// The resulting surface (a byte array in the OpenTK renderer) is made available and protected with the
/// RenderMutex of the interface.
- /// </summary>
+ /// </remarks>
public class Interface : ILayoutable
{
#region CTOR