<PlatformTarget>anycpu</PlatformTarget>\r
</PropertyGroup>-->\r
<ItemGroup>\r
- <Compile Include="src\Colors.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\Point.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="Properties\AssemblyInfo.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\Rectangle.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\Rectangles.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\Size.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\OpenTKGameWindow.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\GraphicObject.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\Container.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\Group.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\GroupBox.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\HorizontalStack.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\Image.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\Label.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\TextBox.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\ProgressBar.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\VerticalStack.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\Cairo\CairoHelpers.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\win32\Win32.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\win32\winApi.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\Button.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\GraduatedSlider.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\Slider.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\ValueChangeEventArgs.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\NumericControl.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\Scroller.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\ILayoutable.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\Enums.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\GenericStack.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\CompilerServices\CompilerServices.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\AnalogMeter.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\Border.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\Font.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\TextChangeEventArgs.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\OpenGL\QuadVAO.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\OpenGL\Shader.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\OpenGL\TexturedShader.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\OpenGL\VertexArrayObject.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\Window.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\IGOLibHost.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\ListBox.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\ExtensionsMethods.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\Interface.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\LayoutingQueueItem.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\LayoutingQueue.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\Spinner.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\DynAttribute.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\IValueChange.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\Picture.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\SvgPicture.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\BmpPicture.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\TemplatedControl.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\Checkbox.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
- <Compile Include="src\GraphicObjects\RadioButton.cs">\r
- <LogicalName>\r
- </LogicalName>\r
- </Compile>\r
+ <Compile Include="src\Colors.cs" />\r
+ <Compile Include="src\Point.cs" />\r
+ <Compile Include="Properties\AssemblyInfo.cs" />\r
+ <Compile Include="src\Rectangle.cs" />\r
+ <Compile Include="src\Rectangles.cs" />\r
+ <Compile Include="src\Size.cs" />\r
+ <Compile Include="src\OpenTKGameWindow.cs" />\r
+ <Compile Include="src\GraphicObjects\GraphicObject.cs" />\r
+ <Compile Include="src\GraphicObjects\Container.cs" />\r
+ <Compile Include="src\GraphicObjects\Group.cs" />\r
+ <Compile Include="src\GraphicObjects\GroupBox.cs" />\r
+ <Compile Include="src\GraphicObjects\HorizontalStack.cs" />\r
+ <Compile Include="src\GraphicObjects\Image.cs" />\r
+ <Compile Include="src\GraphicObjects\Label.cs" />\r
+ <Compile Include="src\GraphicObjects\TextBox.cs" />\r
+ <Compile Include="src\GraphicObjects\ProgressBar.cs" />\r
+ <Compile Include="src\GraphicObjects\VerticalStack.cs" />\r
+ <Compile Include="src\Cairo\CairoHelpers.cs" />\r
+ <Compile Include="src\win32\Win32.cs" />\r
+ <Compile Include="src\win32\winApi.cs" />\r
+ <Compile Include="src\GraphicObjects\Button.cs" />\r
+ <Compile Include="src\GraphicObjects\GraduatedSlider.cs" />\r
+ <Compile Include="src\GraphicObjects\Slider.cs" />\r
+ <Compile Include="src\ValueChangeEventArgs.cs" />\r
+ <Compile Include="src\GraphicObjects\NumericControl.cs" />\r
+ <Compile Include="src\GraphicObjects\Scroller.cs" />\r
+ <Compile Include="src\GraphicObjects\ILayoutable.cs" />\r
+ <Compile Include="src\Enums.cs" />\r
+ <Compile Include="src\GraphicObjects\GenericStack.cs" />\r
+ <Compile Include="src\CompilerServices\CompilerServices.cs" />\r
+ <Compile Include="src\GraphicObjects\AnalogMeter.cs" />\r
+ <Compile Include="src\GraphicObjects\Border.cs" />\r
+ <Compile Include="src\Font.cs" />\r
+ <Compile Include="src\TextChangeEventArgs.cs" />\r
+ <Compile Include="src\OpenGL\QuadVAO.cs" />\r
+ <Compile Include="src\OpenGL\Shader.cs" />\r
+ <Compile Include="src\OpenGL\TexturedShader.cs" />\r
+ <Compile Include="src\OpenGL\VertexArrayObject.cs" />\r
+ <Compile Include="src\GraphicObjects\Window.cs" />\r
+ <Compile Include="src\GraphicObjects\IGOLibHost.cs" />\r
+ <Compile Include="src\GraphicObjects\ListBox.cs" />\r
+ <Compile Include="src\ExtensionsMethods.cs" />\r
+ <Compile Include="src\Interface.cs" />\r
+ <Compile Include="src\LayoutingQueueItem.cs" />\r
+ <Compile Include="src\LayoutingQueue.cs" />\r
+ <Compile Include="src\GraphicObjects\Spinner.cs" />\r
+ <Compile Include="src\DynAttribute.cs" />\r
+ <Compile Include="src\GraphicObjects\IValueChange.cs" />\r
+ <Compile Include="src\Picture.cs" />\r
+ <Compile Include="src\SvgPicture.cs" />\r
+ <Compile Include="src\BmpPicture.cs" />\r
+ <Compile Include="src\GraphicObjects\TemplatedControl.cs" />\r
+ <Compile Include="src\GraphicObjects\Checkbox.cs" />\r
+ <Compile Include="src\GraphicObjects\RadioButton.cs" />\r
</ItemGroup>\r
<ItemGroup>\r
<Reference Include="System" />\r
-->\r
<ItemGroup />\r
<ItemGroup>\r
- <Folder Include="src\GraphicObjects\">\r
- <LogicalName>\r
- </LogicalName>\r
- </Folder>\r
- <Folder Include="src\Cairo\">\r
- <LogicalName>\r
- </LogicalName>\r
- </Folder>\r
- <Folder Include="src\win32\">\r
- <LogicalName>\r
- </LogicalName>\r
- </Folder>\r
- <Folder Include="Images\">\r
- <LogicalName>\r
- </LogicalName>\r
- </Folder>\r
- <Folder Include="Images\Icons\">\r
- <LogicalName>\r
- </LogicalName>\r
- </Folder>\r
- <Folder Include="src\CompilerServices\">\r
- <LogicalName>\r
- </LogicalName>\r
- </Folder>\r
- <Folder Include="src\OpenGL\">\r
- <LogicalName>\r
- </LogicalName>\r
- </Folder>\r
+ <Folder Include="src\GraphicObjects\" />\r
+ <Folder Include="src\Cairo\" />\r
+ <Folder Include="src\win32\" />\r
+ <Folder Include="Images\" />\r
+ <Folder Include="Images\Icons\" />\r
+ <Folder Include="src\CompilerServices\" />\r
+ <Folder Include="src\OpenGL\" />\r
</ItemGroup>\r
<ItemGroup>\r
<EmbeddedResource Include="Images\Icons\updown.svg" />\r
: base(1024, 600,"test")\r
{}\r
\r
- Container g;\r
+ Group g;\r
\r
protected override void OnLoad (EventArgs e)\r
{\r
--- /dev/null
+#define MONO_CAIRO_DEBUG_DISPOSE\r
+\r
+\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using OpenTK;\r
+using OpenTK.Graphics.OpenGL;\r
+using OpenTK.Input;\r
+\r
+using System.Diagnostics;\r
+\r
+//using GGL;\r
+using go;\r
+using System.Threading;\r
+\r
+\r
+namespace test\r
+{\r
+ class GOLIBTest_Spinner : OpenTKGameWindow\r
+ {\r
+ public GOLIBTest_Spinner ()\r
+ : base(1024, 600,"test")\r
+ {}\r
+\r
+ Container g;\r
+\r
+ protected override void OnLoad (EventArgs e)\r
+ {\r
+ base.OnLoad (e);\r
+ LoadInterface("Interfaces/testSpinner.goml", out g);\r
+\r
+ }\r
+ protected override void OnRenderFrame (FrameEventArgs e)\r
+ {\r
+ GL.Clear (ClearBufferMask.ColorBufferBit);\r
+ base.OnRenderFrame (e);\r
+ SwapBuffers ();\r
+ }\r
+\r
+ protected override void OnUpdateFrame (FrameEventArgs e)\r
+ {\r
+ base.OnUpdateFrame (e);\r
+ }\r
+\r
+ [STAThread]\r
+ static void Main ()\r
+ {\r
+ Console.WriteLine ("starting example");\r
+\r
+ using (GOLIBTest_Spinner win = new GOLIBTest_Spinner( )) {\r
+ win.Run (30.0);\r
+ }\r
+ }\r
+ }\r
+}
\ No newline at end of file
<?xml version="1.0"?>\r
-<Container HorizontalAlignment="Center" VerticalAlignment="Bottom"\r
- Margin="10" Focusable="True" Fit="True" Background="Green">\r
- <Group Fit="True">\r
- <GraphicObject Width="400" Height="40" Background="Blue"/>\r
- <GraphicObject Width="40" Height="40" Background="Red"\r
+<!--<Container HorizontalAlignment="Center" VerticalAlignment="Bottom"\r
+ Margin="10" Focusable="True" Fit="True" Background="Green">-->\r
+ <Group Fit="true">\r
+ <GraphicObject Name="g1" Width="400" Height="40" Background="Blue"/>\r
+ <GraphicObject Name="g2" Width="40" Height="40" Background="Red"\r
HorizontalAlignment="Right"/> \r
</Group>\r
-</Container>
\ No newline at end of file
+<!--</Container>-->
\ No newline at end of file
</VerticalStack>\r
<VerticalStack Width="-1" Height="-1" BorderWidth="1" Margin="5" WidgetSpacing="4">\r
<Button Margin="1" Width="150" Height="40">\r
- <Image Path="#Tests.image.tetra.png"/>\r
+ <Image Path="#Tests.image.tetra.png"/>\r
</Button>\r
<HorizontalStack>\r
<Label Text="Update" FontColor="White" VerticalAlignment="Center" />\r
--- /dev/null
+<?xml version="1.0"?>\r
+<Container Name="TopContainer" Width="400" Height="350"\r
+ Margin="20" Focusable="True" Background="DarkGray">\r
+\r
+ <Spinner Width="50"></Spinner>\r
+</Container>
\ No newline at end of file
<OutputType>Exe</OutputType>
<RootNamespace>Tests</RootNamespace>
<AssemblyName>Tests</AssemblyName>
- <StartupObject>test.GOLIBTest_4</StartupObject>
+ <StartupObject>test.GOLIBTest_Spinner</StartupObject>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<OutputPath>..\bin\$(configuration)</OutputPath>
<IntermediateOutputPath>obj\$(configuration)</IntermediateOutputPath>
</Reference>
</ItemGroup>
<ItemGroup>
- <Compile Include="GOLIBTest_5.cs">
- <LogicalName>
- </LogicalName>
- </Compile>
- <Compile Include="GOLIBTest_0.cs">
- <LogicalName>
- </LogicalName>
- </Compile>
- <Compile Include="GOLIBTest_4.cs">
- <LogicalName>
- </LogicalName>
- </Compile>
- <Compile Include="GOLIBTest_3.cs">
- <LogicalName>
- </LogicalName>
- </Compile>
- <Compile Include="GOLIBTest_1.cs">
- <LogicalName>
- </LogicalName>
- </Compile>
- <Compile Include="GOLIBTest_2.cs">
- <LogicalName>
- </LogicalName>
- </Compile>
- <Compile Include="GOLIBTest_1.1.cs">
- <LogicalName>
- </LogicalName>
- </Compile>
- <Compile Include="GOLIBTest_1.2.cs">
- <LogicalName>
- </LogicalName>
- </Compile>
- <Compile Include="GOLIBTest_4.1.cs">
- <LogicalName>
- </LogicalName>
- </Compile>
- <Compile Include="GOLIBTest_fps.cs">
- <LogicalName>
- </LogicalName>
- </Compile>
- <Compile Include="GOLIBTest_Listbox.cs">
- <LogicalName>
- </LogicalName>
- </Compile>
+ <Compile Include="GOLIBTest_5.cs" />
+ <Compile Include="GOLIBTest_0.cs" />
+ <Compile Include="GOLIBTest_4.cs" />
+ <Compile Include="GOLIBTest_3.cs" />
+ <Compile Include="GOLIBTest_1.cs" />
+ <Compile Include="GOLIBTest_2.cs" />
+ <Compile Include="GOLIBTest_1.1.cs" />
+ <Compile Include="GOLIBTest_1.2.cs" />
+ <Compile Include="GOLIBTest_4.1.cs" />
+ <Compile Include="GOLIBTest_fps.cs" />
+ <Compile Include="GOLIBTest_Listbox.cs" />
+ <Compile Include="GOLIBTest_Spinner.cs" />
</ItemGroup>
<ItemGroup>
<None Include="image\u.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName>
- </LogicalName>
</None>
<None Include="Interfaces\test1.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName>
- </LogicalName>
</None>
<None Include="Interfaces\test3.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName>
- </LogicalName>
</None>
<None Include="Interfaces\test4.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName>
- </LogicalName>
</None>
<None Include="Interfaces\test5.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName>
- </LogicalName>
</None>
<None Include="Interfaces\test0.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName>
- </LogicalName>
</None>
<None Include="Interfaces\test2.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName>
- </LogicalName>
</None>
<None Include="Interfaces\test1.1.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName>
- </LogicalName>
</None>
<None Include="Interfaces\test1.2.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName>
- </LogicalName>
</None>
<None Include="Interfaces\test4.1.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName>
- </LogicalName>
</None>
<None Include="Interfaces\test1.3.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName>
- </LogicalName>
</None>
<None Include="Interfaces\fps.goml">
- <LogicalName>
- </LogicalName>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Interfaces\log.xml">
- <LogicalName>
- </LogicalName>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Interfaces\test_Listbox.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- <LogicalName>
- </LogicalName>
+ </None>
+ <None Include="Interfaces\testSpinner.goml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
- <Folder Include="Interfaces\">
- <LogicalName>
- </LogicalName>
- </Folder>
- <Folder Include="image\">
- <LogicalName>
- </LogicalName>
- </Folder>
+ <Folder Include="Interfaces\" />
+ <Folder Include="image\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GOLib.csproj">
float heightRatio = (float)rect.Height / Dimensions.Height;
float ratio = Math.Min (widthRatio, heightRatio);
+// if (KeepProportions)
+// widthRatio = heightRatio = ratio;
+
Rectangle rImg = rect;
gr.Save ();
- if (KeepProportions)
+ if (KeepProportions) {
+ gr.Translate ((rect.Width - (float)Dimensions.Width * ratio)/2f,
+ (rect.Height - (float)Dimensions.Height * ratio)/2f);
gr.Scale (ratio, ratio);
- else
+
+ }else
gr.Scale (widthRatio, heightRatio);
using (ImageSurface imgSurf = new ImageSurface (image, Format.Argb32,
\r
return tmp;\r
}\r
-\r
- public override void RegisterForLayouting (int layoutType)\r
+ \r
+ protected override void OnLayoutChanges (LayoutingType layoutType)\r
{\r
- base.RegisterForLayouting (layoutType);\r
+ base.OnLayoutChanges (layoutType);\r
+\r
+ //position smaller objects in group when group size is fit\r
+ switch (layoutType) {\r
+ case LayoutingType.Width: \r
+ if (Width < 0) {\r
+ int crw = ClientRectangle.Width;\r
+ foreach (GraphicObject c in Children.Where(ch => ch.Slot.Width != crw))\r
+ c.RegisterForLayouting ((int)LayoutingType.X); \r
+ }\r
+ break;\r
+ case LayoutingType.Height:\r
+ if (Height < 0) {\r
+ int crh = ClientRectangle.Height;\r
+ foreach (GraphicObject c in Children.Where(ch => ch.Slot.Height != crh))\r
+ c.RegisterForLayouting ((int)LayoutingType.Y); \r
+ }\r
+ break;\r
+ }\r
}\r
\r
public override Rectangle ContextCoordinates(Rectangle r){\r
bool _multiline = false;\r
Color selColor;\r
Color selFontColor;\r
+ bool _selectable;\r
Point mouseLocalPos; //mouse coord in widget space, filled only when clicked \r
int _currentCol; //0 based cursor position in string\r
int _currentLine;\r
registerForGraphicUpdate ();\r
}\r
}\r
+ [XmlAttributeAttribute()][DefaultValue(false)]\r
+ public virtual bool Selectable {\r
+ get { return _selectable; }\r
+ set { _selectable = value; }\r
+ }\r
\r
[XmlAttributeAttribute()][DefaultValue(Alignment.LeftCenter)]\r
public Alignment TextAlignment\r
te = tmp;\r
}\r
fe = gr.FontExtents;\r
- size = new Size ((int)Math.Ceiling (te.XAdvance) + Margin * 2, (int)(fe.Height * lines.Count) + Margin*2);\r
+ int lc = lines.Count;\r
+ //ensure minimal height = text line height\r
+ if (lc == 0)\r
+ lc = 1; \r
+ size = new Size ((int)Math.Ceiling (te.XAdvance) + Margin * 2, (int)(fe.Height * lc) + Margin*2);\r
}\r
}\r
- return size;// +borderWidth;\r
+\r
+ return size;;\r
}\r
protected override void onDraw (Context gr)\r
{\r
else\r
computeTextCursorPosition(gr);\r
\r
- if (HasFocus)\r
+ if (HasFocus && Selectable)\r
{\r
//TODO:\r
gr.Color = Foreground;\r
if ((sender as OpenTKGameWindow).activeWidget != this)\r
return;\r
\r
+ if (!Selectable)\r
+ return;\r
+ \r
SelectionInProgress = true;\r
mouseLocalPos = e.Position - ScreenCoordinates(ClientRectangle).TopLeft;\r
registerForGraphicUpdate();\r
-\r
}\r
public override void onMouseButtonDown (object sender, MouseButtonEventArgs e)\r
{\r
- if (this.HasFocus){\r
+ if (this.HasFocus && Selectable){\r
mouseLocalPos = e.Position - ScreenCoordinates(ClientRectangle).TopLeft;\r
selBegin = -1;\r
selRelease = -1;\r
public Spinner (double minimum, double maximum, double step) :
base (minimum, maximum, step)
{
-// butUp = new Button ();
-// butUp.setChild (new Image ("go.Image.Icons.updown.svg"));
+
}
public Spinner () : base()
{