<?xml version="1.0"?>\r
-<Border Margin="0" MinimumSize="0;200" Fit="True" Background="Gray">\r
+<Border BorderWidth="1" Margin="1" MinimumSize="0;100" Fit="True" Background="Gray">\r
<VerticalStack Name="List" Margin="1" VerticalAlignment="Top"/>\r
</Border>
\ No newline at end of file
MouseMove="Window_MouseMove">\r
<HorizontalStack Margin="1" Spacing="1" Height="-1" Width="0" Focusable="true" MouseMove="Window_MouseMove">\r
<Image Name="Image" Margin="1" Width="16" Height="16" Path="#go.Images.Icons.tetra.png"/>\r
- <Label Width="0" Focusable="true" Name="Title" MouseMove="Window_MouseMove"/>\r
+ <Label Width="0" Focusable="true" Name="Title" MouseMove="Window_MouseMove" Margin="5" />\r
<Image Focusable="true" Name="Image" Margin="1" Width="16" Height="16" Path="#go.Images.Icons.exit.svg"\r
MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}" MouseClick="butQuitPress"/>\r
</HorizontalStack>\r
protected override void OnLoad (EventArgs e)\r
{\r
base.OnLoad (e);\r
- LoadInterface("Interfaces/log.xml", out g);\r
+ LoadInterface("Interfaces/test1.goml", out g);\r
\r
}\r
protected override void OnRenderFrame (FrameEventArgs e)\r
}\r
frameCpt++;\r
\r
-// if (pb.Value == pb.Maximum)\r
-// pb.Value = 0;\r
-// pb.Value++;\r
+ if (pb.Value == pb.Maximum)\r
+ pb.Value = 0;\r
+ pb.Value++;\r
pb2.Value = pb.Value;\r
//labPb.Text = pb.Value.ToString ();\r
if (FocusedWidget==null)\r
#define MONO_CAIRO_DEBUG_DISPOSE\r
+#define DEBUG_CLIP_RECTANGLE\r
\r
\r
using System;\r
Foreground="BlueCrayola" Background="DarkGray"\r
BorderWidth="2" BorderColor="White"/>\r
<Label Name="labPb"\r
- Width="20"\r
+ Width="30"\r
TextAlignment="RightCenter"/>\r
</HorizontalStack>\r
<HorizontalStack Name="hsFocus">\r
<Button Margin="5" BorderWidth="0" Width="-1" Height="-1" HorizontalAlignment="Center">\r
<Label FontSize="18" Text="This is a test" Margin="5" Foreground="Black" />\r
</Button>\r
- <TextBoxWidget TextAlignment="LeftCenter" Font="droid,14" \r
+ <TextBoxWidget Name="textbox1" TextAlignment="LeftCenter" Font="droid,14" \r
Width="300" Height="-1" Margin="2"\r
BorderColor="White" BorderWidth="1"\r
Text="editable text"/>\r
- <Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />\r
- <Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />\r
<GroupBox Title="Group Box" Width="300" Height="100" \r
BorderColor="White" BorderWidth="2" Margin="3">\r
<Label Name="labValue" FontSize="14" Text="000" TextAlignment="Center"/>\r
<Image Path="#Tests.image.tetra.png"/>\r
</Button>\r
<Popper Width="100">\r
- <Image Fit="true" Path="#Tests.image.tetra.png"/>\r
+ <Border Margin="10" Fit="True" Background="ArmyGreen">\r
+ <Image Fit="true" Path="#go.Images.Icons.tetra.png"/>\r
+ </Border>\r
</Popper>\r
<Expandable Name="expander" Width="150" Height="-1">\r
<VerticalStack Name="vsExpanded" Width="100">\r
<?xml version="1.0"?>\r
-<Container Name="TopContainer" Width="400" Height="-1"\r
+<Container Name="TopContainer" Width="400" Height="400"\r
Margin="20" Focusable="True" Background="Gray">\r
\r
- <Expandable Width="150" Background="Green" Margin="2">\r
- <VerticalStack Width="100" Background="Red">\r
+ <Expandable Width="150" Height="-1" Margin="2" VerticalAlignment="Top">\r
+ <VerticalStack Width="100" >\r
<Checkbox Name="chk1"/>\r
<Checkbox Name="chk2" IsChecked="true"/>\r
<Checkbox Name="chk3"/>\r
<OutputType>Exe</OutputType>
<RootNamespace>Tests</RootNamespace>
<AssemblyName>Tests</AssemblyName>
- <StartupObject>test.GOLIBTest_Window</StartupObject>
+ <StartupObject>test.GOLIBTest_4</StartupObject>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<OutputPath>..\bin\$(configuration)</OutputPath>
<IntermediateOutputPath>obj\$(configuration)</IntermediateOutputPath>
#region IXmlSerializable\r
public void ReadXml(System.Xml.XmlReader reader)\r
{\r
- string[] c = reader["Color"].Split(new char[] { ';' });\r
- A = double.Parse(c[0]);\r
- R = double.Parse(c[1]);\r
- G = double.Parse(c[2]);\r
- B = double.Parse(c[3]);\r
+ string[] c = reader["Color"].Split(new char[] { ';' }); \r
+ R = double.Parse(c[0]);\r
+ G = double.Parse(c[1]);\r
+ B = double.Parse(c[2]);\r
+ A = double.Parse(c[3]);\r
}\r
public void WriteXml(System.Xml.XmlWriter writer)\r
{\r
if (!srcValueType.IsValueType)
il.Emit(OpCodes.Castclass, srcValueType);
- if (piTarget.PropertyType == typeof(string))
- il.Emit(OpCodes.Callvirt, miToStr);
+ else
+ il.Emit( OpCodes.Callvirt, GetConvertMethod( piTarget.PropertyType ));
+ // if (piTarget.PropertyType == typeof(string))
+// else if ( srcValueType != piTarget.PropertyType)
+//
+
il.Emit(OpCodes.Callvirt, piTarget.GetSetMethod());
}
il.MarkLabel(labFailed);
//Delegate del = dm.CreateDelegate(typeof(System.EventHandler));
addHandler.Invoke(_source, new object[] {del});
}
+
+ #region conversions
+
+ internal static MethodInfo GetConvertMethod( Type targetType )
+ {
+ string name;
+
+ if( targetType == typeof( bool ) )
+ name = "ToBoolean";
+ else if( targetType == typeof( byte ) )
+ name = "ToByte";
+ else if( targetType == typeof( short ) )
+ name = "ToInt16";
+ else if( targetType == typeof( int ) )
+ name = "ToInt32";
+ else if( targetType == typeof( long ) )
+ name = "ToInt64";
+ else if (targetType == typeof (string ) )
+ return typeof(object).GetMethod("ToString", Type.EmptyTypes);
+ else
+ throw new NotImplementedException( string.Format( "Conversion to {0} is not implemented.", targetType.Name ) );
+
+ return typeof( Convert ).GetMethod( name, BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof( object ) }, null );
+ }
+ #endregion
public static FieldInfo getEventHandlerField(Type type, string eventName)
{
#endregion
#region public properties
- [XmlAttributeAttribute()][DefaultValue(2)]
+ [XmlAttributeAttribute()][DefaultValue(1)]
public virtual int BorderWidth {
get { return _borderWidth; }
set {
else\r
_image.SvgSub = "unchecked";\r
\r
- registerForGraphicUpdate();\r
+ //registerForGraphicUpdate();\r
}\r
}\r
\r
return;\r
_image.SvgSub = "collapsed";\r
\r
- this.Expand += (object sender, EventArgs e) => {_image.SvgSub = "expanded";};\r
- this.Collapse += (object sender, EventArgs e) => {_image.SvgSub = "collapsed";};\r
+// this.Expand += (object sender, EventArgs e) => {};\r
+// this.Collapse += (object sender, EventArgs e) => {};\r
\r
}\r
\r
else\r
onCollapse (this, null);\r
\r
- registerForGraphicUpdate();\r
+ //registerForGraphicUpdate();\r
}\r
}\r
\r
public virtual void onExpand(object sender, EventArgs e)\r
{\r
_contentContainer.Visible = true;\r
+ _image.SvgSub = "expanded";\r
Expand.Raise (this, e);\r
}\r
public virtual void onCollapse(object sender, EventArgs e)\r
{\r
_contentContainer.Visible = false;\r
+ _image.SvgSub = "collapsed";\r
Collapse.Raise (this, e);\r
}\r
\r
if (clip != null) {\r
clip.Rebase (this); \r
//localClip = clip.intersectingRects (Slot.Size);\r
- } else\r
+ } else {\r
clip = new Rectangles ();\r
+ //TODO:added lately slot to empty clip,\r
+ //should rework this precise case causing expandable not\r
+ //to show image changes\r
+ clip.AddRectangle (ContextCoordinates (Slot.Size));\r
+ }\r
\r
if (!DrawingIsValid || clip != null) {//false when 1 child has changed\r
//child having their content changed has to be repainted\r
//gr.FontOptions.HintMetrics = HintMetrics.On;\r
\r
rText = new Rectangle(measureRawSize());\r
+ rText.Width -= 2 * Margin;\r
+ rText.Height -= 2 * Margin;\r
\r
widthRatio = 1f;\r
heightRatio = 1f;\r
if (string.IsNullOrWhiteSpace (l))\r
continue;\r
\r
+// double t = rText.Y;\r
+// gr.LineWidth = 1;\r
+// gr.Color = Color.Green;\r
+// gr.MoveTo (rText.X, t);\r
+// gr.LineTo (rText.X + rText.Width, t);\r
+// gr.Stroke ();\r
+// gr.MoveTo (rText.X, t + rText.Height);\r
+// gr.LineTo (rText.X + rText.Width, t + rText.Height);\r
+// gr.Stroke ();\r
+// gr.Rectangle (rText);\r
+// gr.Fill ();\r
+//\r
+// t += fe.Ascent;\r
+// gr.Color = Color.Red;\r
+// gr.MoveTo (rText.X, t);\r
+// gr.LineTo (rText.X + rText.Width, t);\r
+// gr.Stroke ();\r
+\r
gr.Color = Foreground; \r
gr.MoveTo (rText.X, rText.Y + fe.Ascent + fe.Height * i);\r
\r
\r
cursor.TopLeft = new Point(r.Left + (int)(Value * unity),\r
(int)(p1.Y - cursor.Height / 2)); \r
- Debug.WriteLine (cursor.TopLeft.ToString ());\r
}\r
\r
#region mouse handling\r
get { return base.Focusable; }\r
set { base.Focusable = value; }\r
}\r
+ [XmlAttributeAttribute()][DefaultValue(true)]\r
+ public override bool Selectable {\r
+ get { return base.Selectable; }\r
+ set { base.Selectable = value; }\r
+ }\r
[XmlAttributeAttribute()][DefaultValue("White")]\r
public override Color Background {\r
get { return base.Background; }\r
// Released to the public domain. Use, modify and relicense at will.\r
-//#define DEBUG_CLIP_RECTANGLE\r
-\r
using System;\r
\r
using OpenTK;\r