</PropertyGroup>\r
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
<OutputPath>bin\Debug</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;__linux__;DEBUG_LOAD_TIME0;DEBUG_LAYOUTING;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>\r
+ <DefineConstants>TRACE;DEBUG;__linux__;DEBUG_LOAD_TIME0;DEBUG_LAYOUTING0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>\r
</PropertyGroup>\r
<!-- <PropertyGroup Condition=" '$(Platform)' == 'Linux_x86' ">\r
<DefineConstants>__linux__</DefineConstants>\r
<Properties GitUserInfo="UsingGIT" StartupItem="Tests/Tests.csproj">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|Linux_x86" />
- <MonoDevelop.Ide.Workbench ActiveDocument="src/GraphicObjects/GraphicObject.cs">
+ <MonoDevelop.Ide.Workbench ActiveDocument="src/GraphicObjects/Label.cs">
<Files>
- <File FileName="src/GraphicObjects/GraphicObject.cs" Line="572" Column="23" />
- <File FileName="src/GraphicObjects/Label.cs" Line="15" Column="5" />
- <File FileName="src/OpenTKGameWindow.cs" Line="114" Column="1" />
- <File FileName="Tests/GOLIBTests.cs" Line="156" Column="32" />
- <File FileName="src/GraphicObjects/TextBox.cs" Line="15" Column="31" />
+ <File FileName="Tests/GOLIBTest_TypeViewer.cs" Line="1" Column="1" />
+ <File FileName="Tests/Interfaces/testTypeViewer.goml" Line="4" Column="84" />
+ <File FileName="Tests/Interfaces/tmpMembers.goml" Line="3" Column="35" />
+ <File FileName="Tests/Interfaces/testWindow.goml" Line="1" Column="1" />
+ <File FileName="src/GraphicObjects/Label.cs" Line="107" Column="38" />
+ <File FileName="src/OpenTKGameWindow.cs" Line="154" Column="3" />
+ <File FileName="src/GraphicObjects/ScrollBar.cs" Line="1" Column="1" />
+ <File FileName="src/GraphicObjects/TemplatedControl.cs" Line="56" Column="53" />
+ <File FileName="src/GraphicObjects/GraphicObject.cs" Line="153" Column="51" />
+ <File FileName="src/Colors.cs" Line="13" Column="16" />
+ <File FileName="src/GraphicObjects/Container.cs" Line="10" Column="37" />
+ <File FileName="src/GraphicObjects/ProgressBar.cs" Line="97" Column="33" />
+ <File FileName="src/GraphicObjects/Scroller.cs" Line="100" Column="21" />
+ <File FileName="src/GraphicObjects/MessageBox.cs" Line="35" Column="30" />
+ <File FileName="src/Rectangles.cs" Line="143" Column="25" />
+ <File FileName="src/GraphicObjects/Group.cs" Line="210" Column="1" />
+ <File FileName="src/Cairo/CairoHelpers.cs" Line="110" Column="34" />
+ <File FileName="src/GraphicObjects/GraduatedSlider.cs" Line="41" Column="11" />
+ <File FileName="src/GraphicObjects/Slider.cs" Line="134" Column="34" />
+ <File FileName="src/GraphicObjects/Border.cs" Line="61" Column="8" />
+ <File FileName="src/Interface.cs" Line="128" Column="1" />
+ <File FileName="src/XCursor.cs" Line="56" Column="12" />
+ <File FileName="src/GraphicObjects/TextRun.cs" Line="316" Column="37" />
+ <File FileName="src/GraphicObjects/GenericStack.cs" Line="15" Column="18" />
+ <File FileName="src/CompilerServices/CompilerServices.cs" Line="153" Column="1" />
+ <File FileName="src/GraphicObjects/Spinner.cs" Line="29" Column="1" />
+ <File FileName="src/SvgPicture.cs" Line="30" Column="1" />
+ <File FileName="src/GraphicObjects/FileDialog.cs" Line="45" Column="12" />
</Files>
- <Pads>
- <Pad Id="MonoDevelop.Debugger.WatchPad">
- <State />
- </Pad>
- </Pads>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore>
<?xml version="1.0"?>
-<Window Title="OpenFile" Height="300" Width="500">
+<Window Caption="OpenFile" Height="300" Width="500">
<VerticalStack Margin="5">
- <TextBoxWidget Margin="1" Width="0" Height="-1" Text="{CurrentPath}"/>
+ <TextBox Margin="1" Width="0" Height="-1" Text="{CurrentPath}"/>
<HorizontalStack >
<ListBox Data="{Directories}" Width="-1" Height="0"
Background="0,5;0,5;0,5;0,5"
</ListBox>
</HorizontalStack>
<HorizontalStack Fit="true" HorizontalAlignment="Right">
- <Button Text="Ok" MouseClick="onFileSelect"/>
- <Button Text="Cancel"/>
+ <Button Caption="Ok" MouseClick="onFileSelect"/>
+ <Button Caption="Cancel"/>
</HorizontalStack>
</VerticalStack>
</Window>
<VerticalStack Width="{../../../../TemplatedWidth}" Height="-1"
Name="List" Margin="0" VerticalAlignment="Top" />
</Scroller>
- <Scrollbar Name="scrollbar1" Scroll="{../scroller1.ScrollY}"
+ <ScrollBar Name="scrollbar1" Scroll="{../scroller1.ScrollY}"
MaximumScroll="{../scroller1.MaximumScroll}" Orientation="Vertical"
Width="10" Height="{../../../TemplatedHeight}" />
</HorizontalStack>
<?xml version="1.0"?>
<VerticalStack Height="-1" Width="250" Name="hstack" Margin="0" Spacing="0">
- <Border Height="-1" Width="0" BorderWidth="2" CornerRadius="10">
- <Label Name="labName" Text="{Name}" Width="0" Height="-1" Margin="1"/>
+ <Border Height="-1" Width="0" BorderWidth="2" CornerRadius="10" Background="SteelBlue">
+ <Label Name="labName" Text="{Name}" Width="0" Height="-1" Margin="3"/>
</Border>
<ListBox Data="{Members}" Width="0" Height="400" ItemTemplate="Interfaces/tmpMembers.goml" Focusable="true">
<?xml version="1.0"?>\r
<HorizontalStack Width="0" Height="-1" Focusable="true" \r
- MouseEnter="{Background=Red}"\r
+ MouseEnter="{Background=SkyBlue}"\r
MouseLeave="{Background=Transparent}">\r
<Image Width="8" Height="8" Path="#Crow.Images.Icons.member.svg" SvgSub="{GetIcon}"/>\r
- <Label Text="{Name}" Width="0" Height="-1" Margin="2"/>\r
+ <Label Text="{Name}" Width="0" Height="-1" Margin="1"/>\r
<Label Text="{MemberType}" Width="-1" Height="-1" Margin="0"/>\r
</HorizontalStack>\r
\r
<IntermediateOutputPath>obj\$(configuration)</IntermediateOutputPath>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReleaseVersion>0.2</ReleaseVersion>
+ <SynchReleaseVersion>false</SynchReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>..\bin\Debug</OutputPath>
gr.Save();\r
r.Inflate((int)-width / 2, (int)-width / 2);\r
gr.LineWidth = width;\r
- gr.Color = Color.White;\r
+ gr.SetSourceColor(Color.White);\r
gr.MoveTo(r.BottomLeft);\r
gr.LineTo(r.TopLeft);\r
gr.LineTo(r.TopRight);\r
gr.Stroke();\r
\r
- gr.Color = Color.DarkGray;\r
+ gr.SetSourceColor(Color.DarkGray);\r
gr.MoveTo(r.TopRight);\r
gr.LineTo(r.BottomRight);\r
gr.LineTo(r.BottomLeft);\r
gr.Save();\r
r.Inflate((int)-width / 2, (int)-width / 2);\r
gr.LineWidth = width;\r
- gr.Color = Color.DarkGray;\r
+ gr.SetSourceColor(Color.DarkGray);\r
gr.MoveTo(r.BottomLeft);\r
gr.LineTo(r.TopLeft);\r
gr.LineTo(r.TopRight);\r
gr.Stroke();\r
- gr.Color = Color.White;\r
+ gr.SetSourceColor(Color.White);\r
gr.MoveTo(r.TopRight);\r
gr.LineTo(r.BottomRight);\r
gr.LineTo(r.BottomLeft);\r
public static class CompilerServices
{
- static int dynHandleCpt = 0;
-
#region conversions
internal static MethodInfo GetConvertMethod( Type targetType )
if (BorderWidth > 0)
rBack.Inflate (-BorderWidth / 2);
- gr.Color = Background;
+ gr.SetSourceColor(Background);
CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);
gr.Fill ();
if (BorderWidth > 0) {
gr.LineWidth = BorderWidth;
- gr.Color = Foreground;
+ gr.SetSourceColor(Foreground);
CairoHelpers.CairoRectangle(gr, rBack, CornerRadius);
gr.Stroke ();
}
protected override void DrawGraduations(Context gr, PointD pStart, PointD pEnd)\r
{\r
Rectangle r = ClientRectangle;\r
- gr.Color = Foreground;\r
+ gr.SetSourceColor(Foreground);\r
\r
gr.LineWidth = 2;\r
gr.MoveTo(pStart);\r
\r
Picture _backgroundImage;\r
string _backgroundImagePath;\r
- string _template;\r
#endregion\r
\r
#region public fields\r
foreach (PropertyInfo pi in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) {\r
if (pi.GetSetMethod () == null)\r
continue;\r
-\r
- bool isAttribute = false;\r
string name = "";\r
- Type valueType = null;\r
-\r
- MemberInfo mi = pi.GetGetMethod ();\r
\r
object[] att = pi.GetCustomAttributes (false);\r
\r
foreach (object o in att) {\r
XmlAttributeAttribute xaa = o as XmlAttributeAttribute;\r
- if (xaa != null) {\r
- isAttribute = true;\r
+ if (xaa != null) { \r
if (string.IsNullOrEmpty (xaa.AttributeName))\r
name = pi.Name;\r
else\r
{\r
Rectangle rBack = new Rectangle (Slot.Size);\r
\r
- gr.Color = Background;\r
+ gr.SetSourceColor(Background);\r
CairoHelpers.CairoRectangle(gr,rBack,_cornerRadius);\r
gr.Fill ();\r
\r
continue;\r
}\r
\r
- object o = null;\r
-\r
if (pi.PropertyType.IsEnum) {\r
pi.SetValue (this, Enum.Parse (pi.PropertyType, attValue), null);\r
} else {\r
MethodInfo me = pi.PropertyType.GetMethod ("Parse", new Type[] { typeof(string) });\r
pi.SetValue (this, me.Invoke (null, new string[] { attValue }), null);\r
}\r
-\r
- \r
-\r
}\r
}\r
reader.MoveToElement();\r
Rectangle rBack = new Rectangle (Slot.Size);\r
if (BackgroundImage != null) \r
BackgroundImage.Paint (gr, rBack, BackImgSub);\r
- gr.Color = Background;\r
+ gr.SetSourceColor(Background);\r
CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);\r
gr.Fill ();\r
\r
if (bmp == null)\r
UpdateGraphic ();\r
else {\r
-\r
- Rectangle rb = Parent.ContextCoordinates (Slot);\r
-\r
if (clip != null)\r
clip.Rebase (this); \r
else {\r
clip.clearAndClip (gr);\r
\r
Rectangle rBack = Slot.Size;\r
- gr.Color = Background;\r
+ gr.SetSourceColor(Background);\r
CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);\r
gr.Fill ();\r
#if DEBUG_CLIP_RECTANGLE\r
//TODO:change protected to private\r
\r
#region private and protected fields\r
- protected string _text = "label";\r
+ string _text = "label";\r
Alignment _textAlignment = Alignment.LeftCenter; \r
- Font _font;\r
bool _multiline = false;\r
Color selColor;\r
Color selFontColor;\r
protected TextExtents te;\r
#endregion\r
\r
- [XmlAttributeAttribute()][DefaultValue("SkyBlue")]\r
+ [XmlAttributeAttribute()][DefaultValue("SteelBlue")]\r
public virtual Color SelectionBackground {\r
get { return selColor; }\r
set {\r
registerForGraphicUpdate ();\r
}\r
}\r
- [XmlAttributeAttribute()][DefaultValue("DarkGray")]\r
+ [XmlAttributeAttribute()][DefaultValue("White")]\r
public virtual Color SelectionForeground {\r
get { return selFontColor; }\r
set {\r
public Alignment TextAlignment\r
{\r
get { return _textAlignment; }\r
- set { _textAlignment = value; }\r
+ set { \r
+ if (value == _textAlignment)\r
+ return;\r
+ _textAlignment = value; \r
+ registerForGraphicUpdate ();\r
+ NotifyValueChanged ("TextAlignment", _textAlignment);\r
+ }\r
}\r
[XmlAttributeAttribute()][DefaultValue("label")]\r
public string Text\r
\r
lines = getLines;\r
\r
- //registerForGraphicUpdate();\r
+ this.registerForGraphicUpdate ();\r
this.RegisterForLayouting ((int)LayoutingType.Sizing);\r
NotifyValueChanged ("Text", Text);\r
}\r
get { return _multiline; }\r
set\r
{\r
+ if (value == _multiline)\r
+ return;\r
_multiline = value;\r
+ NotifyValueChanged ("Multiline", _multiline);\r
registerForGraphicUpdate();\r
}\r
}\r
- [XmlIgnore]public int currentCol{\r
+ [XmlIgnore]public int CurrentColumn{\r
get { return _currentCol; }\r
set { \r
+ if (value == _currentCol)\r
+ return;\r
if (value < 0)\r
_currentCol = 0;\r
else if (value > lines [_currentLine].Count ())\r
_currentCol = lines [_currentLine].Count ();\r
else\r
_currentCol = value;\r
+ NotifyValueChanged ("CurrentColumn", _currentCol);\r
}\r
}\r
- [XmlIgnore]public int currentLine{\r
+ [XmlIgnore]public int CurrentLine{\r
get { return _currentLine; }\r
set { \r
+ if (value == _currentLine)\r
+ return;\r
if (value > lines.Count)\r
_currentLine = lines.Count; \r
else if (value < 0)\r
_currentLine = 0;\r
else\r
_currentLine = value; \r
+ NotifyValueChanged ("CurrentLine", _currentLine);\r
}\r
}\r
-\r
[XmlIgnore]public Point SelBegin {\r
get {\r
return _selBegin;\r
public void DeleteChar()\r
{\r
if (selectionIsEmpty) { \r
- if (currentCol == 0) {\r
- if (currentLine == 0)\r
+ if (CurrentColumn == 0) {\r
+ if (CurrentLine == 0)\r
return;\r
- currentLine--;\r
- currentCol = lines [currentLine].Count ();\r
- lines [currentLine] += lines [currentLine + 1];\r
- lines.RemoveAt (currentLine + 1);\r
+ CurrentLine--;\r
+ CurrentColumn = lines [CurrentLine].Count ();\r
+ lines [CurrentLine] += lines [CurrentLine + 1];\r
+ lines.RemoveAt (CurrentLine + 1);\r
return;\r
}\r
- currentCol--;\r
- lines [currentLine] = lines [currentLine].Remove (currentCol, 1);\r
+ CurrentColumn--;\r
+ lines [CurrentLine] = lines [CurrentLine].Remove (CurrentColumn, 1);\r
} else {\r
Debug.WriteLine (selectionEnd.ToString());\r
int linesToRemove = selectionEnd.Y - selectionStart.Y;\r
l++;\r
for (int c = 0; c < linesToRemove-1; c++)\r
lines.RemoveAt (l);\r
- currentCol = selectionStart.X;\r
- currentLine = selectionStart.Y;\r
+ CurrentColumn = selectionStart.X;\r
+ CurrentLine = selectionStart.Y;\r
} else \r
lines [l] = lines [l].Remove (selectionStart.X, selectionEnd.X - selectionStart.X);\r
- currentCol = selectionStart.X;\r
+ CurrentColumn = selectionStart.X;\r
SelBegin = -1;\r
SelRelease = -1;\r
}\r
/// <param name="str">String.</param>\r
protected void Insert(string str)\r
{\r
- lines [currentLine] = lines [currentLine].Insert (currentCol, str);\r
- currentCol += str.Length;\r
+ lines [CurrentLine] = lines [CurrentLine].Insert (CurrentColumn, str);\r
+ CurrentColumn += str.Length;\r
}\r
\r
#region GraphicObject overrides\r
if (SelectionInProgress)\r
{\r
if (SelBegin < 0){\r
- SelBegin = new Point(currentCol, currentLine);\r
+ SelBegin = new Point(CurrentColumn, CurrentLine);\r
SelStartCursorPos = textCursorPos;\r
SelRelease = -1;\r
}else{\r
- SelRelease = new Point(currentCol, currentLine);\r
+ SelRelease = new Point(CurrentColumn, CurrentLine);\r
if (SelRelease == SelBegin)\r
SelRelease = -1;\r
else\r
\r
#endregion\r
\r
+ //****** debug selection *************\r
+// if (SelRelease >= 0) {\r
+// gr.Color = Color.Green;\r
+// Rectangle R = new Rectangle (\r
+// rText.X + (int)SelEndCursorPos - 2,\r
+// rText.Y + (int)(SelRelease.Y * fe.Height), \r
+// 4, \r
+// (int)fe.Height);\r
+// gr.Rectangle (R);\r
+// gr.Fill ();\r
+// }\r
+// if (SelBegin >= 0) {\r
+// gr.Color = Color.UnmellowYellow;\r
+// Rectangle R = new Rectangle (\r
+// rText.X + (int)SelStartCursorPos - 2,\r
+// rText.Y + (int)(SelBegin.Y * fe.Height), \r
+// 4, \r
+// (int)fe.Height);\r
+// gr.Rectangle (R);\r
+// gr.Fill ();\r
+// }\r
//*******************\r
- //debug selection\r
- if (SelRelease >= 0) {\r
- gr.Color = Color.Green;\r
- Rectangle R = new Rectangle (\r
- rText.X + (int)SelEndCursorPos - 2,\r
- rText.Y + (int)(SelRelease.Y * fe.Height), \r
- 4, \r
- (int)fe.Height);\r
- gr.Rectangle (R);\r
- gr.Fill ();\r
- }\r
- if (SelBegin >= 0) {\r
- gr.Color = Color.UnmellowYellow;\r
- Rectangle R = new Rectangle (\r
- rText.X + (int)SelStartCursorPos - 2,\r
- rText.Y + (int)(SelBegin.Y * fe.Height), \r
- 4, \r
- (int)fe.Height);\r
- gr.Rectangle (R);\r
- gr.Fill ();\r
- }\r
- //*******************\r
+\r
if (HasFocus )\r
{\r
- //TODO:\r
gr.SetSourceColor(Foreground);\r
gr.LineWidth = 1.5;\r
- gr.MoveTo(new PointD(textCursorPos + rText.X, rText.Y + currentLine * fe.Height));\r
- gr.LineTo(new PointD(textCursorPos + rText.X, rText.Y + (currentLine + 1) * fe.Height));\r
+ gr.MoveTo(new PointD(textCursorPos + rText.X, rText.Y + CurrentLine * fe.Height));\r
+ gr.LineTo(new PointD(textCursorPos + rText.X, rText.Y + (CurrentLine + 1) * fe.Height));\r
gr.Stroke();\r
}\r
gr.FontMatrix = new Matrix(widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0);\r
\r
SelBegin = new Point(0,0);\r
SelRelease = new Point (lines.LastOrDefault ().Length, lines.Count-1);\r
- OpenTKGameWindow.currentWindow.CursorVisible = true;\r
registerForGraphicUpdate ();\r
- Debug.WriteLine("focused:", this.ToString());\r
}\r
public override void onUnfocused (object sender, EventArgs e)\r
{\r
\r
SelBegin = -1;\r
SelRelease = -1;\r
-\r
registerForGraphicUpdate ();\r
- Debug.WriteLine("unfocused:", this.ToString());\r
}\r
public override void onMouseMove (object sender, MouseMoveEventArgs e)\r
{\r
\r
double cPos = 0f;\r
\r
- currentLine = (int)(mouseLocalPos.Y / fe.Height);\r
+ CurrentLine = (int)(mouseLocalPos.Y / fe.Height);\r
\r
//fix cu\r
- if (currentLine >= lines.Count)\r
- currentLine = lines.Count - 1;\r
+ if (CurrentLine >= lines.Count)\r
+ CurrentLine = lines.Count - 1;\r
\r
- for (int i = 0; i < lines[currentLine].Length; i++)\r
+ for (int i = 0; i < lines[CurrentLine].Length; i++)\r
{\r
- string c = lines [currentLine].Substring (i, 1);\r
+ string c = lines [CurrentLine].Substring (i, 1);\r
if (c == "\t")\r
c = new string (' ', Interface.TabSize);\r
\r
\r
if (mouseLocalPos.X <= cPos + halfWidth)\r
{\r
- currentCol = i;\r
+ CurrentColumn = i;\r
textCursorPos = cPos;\r
mouseLocalPos = -1;\r
return;\r
\r
cPos += te.XAdvance;\r
}\r
- currentCol = lines[currentLine].Length;\r
+ CurrentColumn = lines[CurrentLine].Length;\r
textCursorPos = cPos;\r
\r
//reset mouseLocalPos\r
SelStartCursorPos = GetXFromTextPointer (gr, SelBegin);\r
if (SelRelease >= 0)\r
SelEndCursorPos = GetXFromTextPointer (gr, SelRelease);\r
- textCursorPos = GetXFromTextPointer (gr, new Point(currentCol, currentLine));\r
+ textCursorPos = GetXFromTextPointer (gr, new Point(CurrentColumn, CurrentLine));\r
}\r
/// <summary> Compute x offset in cairo unit from text position </summary>\r
double GetXFromTextPointer(Context gr, Point pos)\r
string l = lines [pos.Y].Substring (0, pos.X).\r
Replace ("\t", new String (' ', Interface.TabSize));\r
return gr.TextExtents (l).XAdvance;\r
- } catch (Exception ex) {\r
+ } catch{\r
return -1;\r
}\r
}\r
set { base.BorderWidth = value; }\r
}\r
[XmlAttributeAttribute()][DefaultValue("BlueCrayola")]\r
- public virtual Color Foreground {\r
+ public override Color Foreground {\r
get { return base.Foreground; }\r
set { base.Foreground = value; }\r
}\r
\r
rBack.Width = (int)((double)rBack.Width / Maximum * Value);\r
\r
- gr.Color = Foreground;\r
+ gr.SetSourceColor(Foreground);\r
\r
CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);\r
gr.Fill();\r
namespace Crow\r
{\r
[DefaultTemplate("#Crow.Templates.ScrollBar.goml")]\r
- public class ScrollBar : TemplatedControl, IValueChange\r
+ public class ScrollBar : TemplatedControl\r
{\r
- #region IValueChange implementation\r
- public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
- #endregion\r
-\r
Orientation _orientation;\r
Slider _slider;\r
double _maximumScroll;\r
return;\r
_maximumScroll = value;\r
registerForGraphicUpdate ();\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("MaximumScroll", _maximumScroll));\r
+ NotifyValueChanged ("MaximumScroll", _maximumScroll);\r
}\r
}\r
[XmlAttributeAttribute()][DefaultValue(0.0)]\r
else if (_scroll > _maximumScroll)\r
_scroll = _maximumScroll;\r
registerForGraphicUpdate ();\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("Scroll", _scroll));\r
+ NotifyValueChanged ("Scroll", _scroll);\r
}\r
}\r
[XmlAttributeAttribute()][DefaultValue(Orientation.Vertical)]\r
if (_orientation == value)\r
return;\r
_orientation = value;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("Orientation", _orientation));\r
+ NotifyValueChanged ("Orientation", _orientation);\r
registerForGraphicUpdate ();\r
}\r
}\r
\r
namespace Crow\r
{\r
- public class Scroller : Container, IValueChange\r
- {\r
- #region IValueChange implementation\r
- public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
- #endregion\r
-\r
+ public class Scroller : Container\r
+ {\r
bool _verticalScrolling;\r
bool _horizontalScrolling;\r
bool _scrollbarVisible;\r
\r
\r
#region public properties\r
-\r
[XmlAttributeAttribute][DefaultValue(false)]\r
public bool VerticalScrolling {\r
get { return _verticalScrolling; }\r
public bool ScrollbarVisible {\r
get { return _scrollbarVisible; }\r
set { _scrollbarVisible = value; }\r
- }\r
-\r
-\r
+ } \r
[XmlAttributeAttribute][DefaultValue(0.0)]\r
public double ScrollX {\r
get {\r
_scrollX = Math.Max(0.0, Child.Slot.Width - ClientRectangle.Width);\r
else\r
_scrollX = value;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs("ScrollX", _scrollX));\r
+ NotifyValueChanged("ScrollX", _scrollX);\r
RegisterForRedraw();\r
}\r
- }\r
-\r
-\r
+ } \r
[XmlAttributeAttribute][DefaultValue(0.0)]\r
public double ScrollY {\r
get {\r
_scrollY = Math.Max(0.0,Child.Slot.Height - ClientRectangle.Height);\r
else\r
_scrollY = value;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs("ScrollY", _scrollY));\r
+ NotifyValueChanged("ScrollY", _scrollY);\r
RegisterForRedraw();\r
}\r
}\r
get { return scrollSpeed; }\r
set {\r
scrollSpeed = value;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs("ScrollSpeed", scrollSpeed));\r
+ NotifyValueChanged("ScrollSpeed", scrollSpeed);\r
}\r
}\r
-\r
#endregion\r
\r
\r
public Scroller()\r
- : base()\r
- {\r
- }\r
+ : base(){}\r
\r
#region GraphicObject Overrides\r
void OnChildLayoutChanges (object sender, LayoutChangeEventArgs arg)\r
Debug.WriteLine ("scrolly={0} maxscroll={1}", ScrollY, maxScroll);\r
ScrollY = 0;\r
}\r
- ValueChanged.Raise (this, new ValueChangeEventArgs ("MaximumScroll", maxScroll));\r
+ NotifyValueChanged("MaximumScroll", maxScroll);\r
}\r
} else if (arg.LayoutType == LayoutingType.Width) {\r
if (maxScroll < ScrollX)\r
ScrollX = 0;\r
- ValueChanged.Raise (this, new ValueChangeEventArgs ("MaximumScroll", maxScroll));\r
+ NotifyValueChanged("MaximumScroll", maxScroll);\r
}\r
}\r
void onChildListCleared(object sender, EventArgs e){\r
\r
protected virtual void DrawGraduations(Context gr, PointD pStart, PointD pEnd)\r
{\r
- gr.Color = Foreground;\r
+ gr.SetSourceColor(Foreground);\r
\r
gr.LineWidth = 1;\r
gr.MoveTo(pStart);\r
}\r
protected virtual void DrawCursor(Context gr, Rectangle _cursor)\r
{\r
- gr.Color = CursorColor;\r
+ gr.SetSourceColor(CursorColor);\r
CairoHelpers.CairoRectangle (gr, _cursor, CornerRadius);\r
gr.FillPreserve();\r
}\r
[DefaultTemplate("#Crow.Templates.Spinner.goml")]
public class Spinner : NumericControl
{
- Label labCpt;
-
public Spinner (double minimum, double maximum, double step) :
base (minimum, maximum, step)
{
break;\r
case Key.Delete:\r
if (selectionIsEmpty)\r
- currentCol++;\r
+ CurrentColumn++;\r
this.DeleteChar ();\r
break;\r
case Key.Enter:\r
break;\r
case Key.Escape:\r
Text = "";\r
- currentCol = 0;\r
+ CurrentColumn = 0;\r
SelRelease = -1;\r
break;\r
case Key.Home:\r
//TODO\r
if (e.Control)\r
- currentLine = 0;\r
- currentCol = 0;\r
+ CurrentLine = 0;\r
+ CurrentColumn = 0;\r
break;\r
case Key.End:\r
if (e.Control)\r
- currentLine = int.MaxValue;\r
- currentCol = int.MaxValue;\r
+ CurrentLine = int.MaxValue;\r
+ CurrentColumn = int.MaxValue;\r
break;\r
case Key.Insert:\r
break;\r
case Key.Left: \r
- currentCol--;\r
+ CurrentColumn--;\r
break;\r
case Key.Right: \r
- currentCol++;\r
+ CurrentColumn++;\r
break;\r
case Key.Up:\r
- currentLine--;\r
+ CurrentLine--;\r
break;\r
case Key.Down:\r
- currentLine++;\r
+ CurrentLine++;\r
break;\r
case Key.Menu:\r
break;\r
this.Insert (k);\r
\r
SelRelease = -1;\r
- SelBegin = new Point(currentCol, SelBegin.Y);\r
+ SelBegin = new Point(CurrentColumn, SelBegin.Y);\r
\r
break;\r
}\r
continue;\r
}\r
\r
- gr.Color = Foreground; \r
+ gr.SetSourceColor (Foreground); \r
gr.MoveTo (rText.X, rText.Y + fe.Ascent + fe.Height * curLineCount);\r
\r
#if _WIN32 || _WIN64\r
//try/catch added to prevent nunit error
try {
stream = System.Reflection.Assembly.GetEntryAssembly ().GetManifestResourceStream (resId);
- } catch (Exception ex) {}
+ } catch{}
if (stream == null)//try to find ressource in Crow assembly
stream = System.Reflection.Assembly.GetExecutingAssembly ().GetManifestResourceStream (resId);
if (stream == null)
using (Stream stream = GetStreamFromPath (path)) {
return Load(stream, GetTopContainerOfGOMLStream(stream), hostClass);
}
- CurrentGOMLPath = "";
}
Console.WriteLine("GLSL version: " + GL.GetString (StringName.ShadingLanguageVersion));\r
Console.WriteLine("*************************************\n");\r
\r
- int matl = GL.GetInteger (GetPName.MaxArrayTextureLayers);\r
- int mts = GL.GetInteger (GetPName.MaxTextureSize);\r
-\r
shader = new Crow.TexturedShader ();\r
}\r
\r
ctx.Rectangle(r);\r
}\r
\r
- ctx.Color = c;\r
+ ctx.SetSourceColor(c);\r
\r
ctx.LineWidth = 2;\r
ctx.Stroke ();\r
public class SvgPicture : Picture
{
Rsvg.Handle hSVG;
- string _subSvg;
public SvgPicture ()
{}