<VerticalStack Height="0" Width="0" Margin="0">\r
<Border BorderWidth="1" BorderColor="LightGray" Height="-1" Width="0" Background="BlueCrayola">\r
<HorizontalStack Name="hs" Margin="1" Spacing="1" Height="-1" Width="0" Focusable="false" >\r
- <Image Name="Image" Margin="1" Width="16" Height="16" Path="#go.Images.Icons.tetra.png"/>\r
- <Label Width="0" Name="Title" Margin="5" />\r
- <Image Focusable="true" Name="Image" Margin="1" Width="16" Height="16" Path="#go.Images.Icons.exit.svg"\r
+ <Image Name="Image" Margin="1" Width="12" Height="12" Path="#go.Images.Icons.tetra.png"/>\r
+ <Label Width="0" Name="Title" Margin="1" />\r
+ <Image Focusable="true" Name="Image" Margin="1" Width="12" Height="12" Path="#go.Images.Icons.exit.svg"\r
MouseEnter="{Background=Red}" MouseLeave="{Background=Transparent}" MouseClick="butQuitPress"/>\r
</HorizontalStack>\r
</Border>\r
- <Container Name="Content" Margin="1"/>\r
+ <Container Name="Content" Margin="1" Width="0" Height="0"/>\r
</VerticalStack>\r
</Border>
\ No newline at end of file
--- /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 test3\r
+{\r
+ class GOLIBTest_HStack : OpenTKGameWindow\r
+ {\r
+ public GOLIBTest_HStack ()\r
+ : base(1024, 600,"test")\r
+ {}\r
+\r
+ protected override void OnLoad (EventArgs e)\r
+ {\r
+ base.OnLoad (e);\r
+ LoadInterface("Interfaces/testHStack.goml");\r
+\r
+ } \r
+\r
+ [STAThread]\r
+ static void Main ()\r
+ {\r
+ Console.WriteLine ("starting example");\r
+\r
+ using (GOLIBTest_HStack win = new GOLIBTest_HStack( )) {\r
+ win.Run (30.0);\r
+ }\r
+ }\r
+ }\r
+}
\ No newline at end of file
{\r
base.OnLoad (e);\r
LoadInterface("Interfaces/testWindow.goml", out g);\r
- LoadInterface("Interfaces/testWindow.goml", out g);\r
- LoadInterface("Interfaces/testWindow.goml", out g);\r
- LoadInterface("Interfaces/testWindow.goml", out g);\r
- LoadInterface("Interfaces/testWindow.goml", out g);\r
- LoadInterface("Interfaces/testWindow.goml", out g);\r
+// LoadInterface("Interfaces/testWindow.goml", out g);\r
+// LoadInterface("Interfaces/testWindow.goml", out g);\r
+// LoadInterface("Interfaces/testWindow.goml", out g);\r
+// LoadInterface("Interfaces/testWindow.goml", out g);\r
+// LoadInterface("Interfaces/testWindow.goml", out g);\r
\r
}\r
protected override void OnRenderFrame (FrameEventArgs e)\r
--- /dev/null
+<?xml version="1.0"?>\r
+<!--<HorizontalStack Background="Gray" Margin="1">-->\r
+<Group Background="Gray" Margin="5" Height="-1" Width="-1">\r
+ <VerticalStack Background="Green" Margin="1">\r
+ <HorizontalStack Width="-1" Height="-1" Margin="5" Background="Red">\r
+ <Checkbox Height="100" Width="200" Background="Blue"/>\r
+ <!-- <Checkbox Height="-1" Width="-1"/>-->\r
+ </HorizontalStack>\r
+ </VerticalStack>\r
+</Group>\r
+<!--</HorizontalStack>-->
\ No newline at end of file
<Window Name="window1" Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0,5;0,5;0,5;0,5" \r
Focusable="True">\r
<VerticalStack Height="0" Width="0">\r
+ <Slider Name="slider" Height="10" Width="150"/>\r
<Label Text="{fps}" Background="DarkRed"/>\r
<Label Text="{fpsMin}" />\r
<Label Text="{fpsMax}" />\r
- <Checkbox Height="-1" Width="-1"/>\r
+ <HorizontalStack Width="150" Height="-1" Margin="5" Background="Red">\r
+ <Checkbox Height="-1" Width="-1"/>\r
+ <Checkbox Height="-1" Width="-1"/>\r
+ </HorizontalStack>\r
<GroupBox Title="test" Height="-1" Width="-1" Margin="5">\r
<VerticalStack Width="100">\r
- <RadioButton Height="-1" Width="-1"/>\r
- <RadioButton Height="-1" Width="-1"/>\r
- <RadioButton Height="-1" Width="-1"/>\r
+ <RadioButton Caption="Radio 1"/>\r
+ <RadioButton Caption="Radio 2" IsChecked="true"/>\r
+ <RadioButton Caption="Radio 3"/>\r
+\r
</VerticalStack>\r
</GroupBox>\r
-\r
</VerticalStack>\r
</Window>\r
<!--</Group>-->\r
<OutputType>Exe</OutputType>
<RootNamespace>Tests</RootNamespace>
<AssemblyName>Tests</AssemblyName>
- <StartupObject>test.GOLIBTest_4</StartupObject>
+ <StartupObject>test3.GOLIBTest_HStack</StartupObject>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<OutputPath>..\bin\$(configuration)</OutputPath>
<IntermediateOutputPath>obj\$(configuration)</IntermediateOutputPath>
<Compile Include="GOLIBTest_0.cs" />
<Compile Include="GOLIBTest_TypeViewer.cs" />
<Compile Include="GOLIBTest_stack.cs" />
+ <Compile Include="GOLIBTest_HStack.cs" />
</ItemGroup>
<ItemGroup>
<None Include="image\u.svg">
<None Include="Interfaces\itemTmp.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="Interfaces\testHStack.goml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<ItemGroup>
<Folder Include="Interfaces\" />
}
+ enum Direction
+ {
+ None,
+ N,
+ S,
+ E,
+ W,
+ NW,
+ NE,
+ SW,
+ SE
+ }
+ Direction currentDirection = Direction.None;
+
public override void onMouseMove (object sender, MouseMoveEventArgs e)
{
base.onMouseMove (sender, e);
-
OpenTKGameWindow otkgw = TopContainer as OpenTKGameWindow;
- if ((e.Position - this.Slot.TopLeft).Length < 5)
- otkgw.Cursor = XCursor.NW;
- else
- otkgw.Cursor = XCursor.Cross;
-
+ int borderLim = 5;
+
+
+
+ if (TopContainer.activeWidget == null) {
+ Direction lastDir = currentDirection;
+
+ if ((e.Position - this.Slot.TopLeft).Length < borderLim)
+ currentDirection = Direction.NW;
+ else if ((e.Position - this.Slot.TopRight).Length < borderLim)
+ currentDirection = Direction.NE;
+ else if ((e.Position - this.Slot.BottomLeft).Length < borderLim)
+ currentDirection = Direction.SW;
+ else if ((e.Position - this.Slot.BottomRight).Length < borderLim)
+ currentDirection = Direction.SE;
+ else
+ currentDirection = Direction.None;
+
+
+ if (currentDirection != lastDir) {
+ switch (currentDirection) {
+ case Direction.None:
+ otkgw.Cursor = XCursor.Default;
+ break;
+ case Direction.N:
+ otkgw.Cursor = XCursor.Cross;
+ break;
+ case Direction.S:
+ otkgw.Cursor = XCursor.Cross;
+ break;
+ case Direction.E:
+ otkgw.Cursor = XCursor.Cross;
+ break;
+ case Direction.W:
+ otkgw.Cursor = XCursor.Cross;
+ break;
+ case Direction.NW:
+ otkgw.Cursor = XCursor.NW;
+ break;
+ case Direction.NE:
+ otkgw.Cursor = XCursor.NE;
+ break;
+ case Direction.SW:
+ otkgw.Cursor = XCursor.SW;
+ break;
+ case Direction.SE:
+ otkgw.Cursor = XCursor.SE;
+ break;
+ }
+ }
+ return;
+ }
if (TopContainer.activeWidget != this)
return;
-
+
this.TopContainer.redrawClip.AddRectangle (this.ScreenCoordinates(this.Slot));
- this.Left += e.XDelta;
- this.Top += e.YDelta;
- this.registerForGraphicUpdate ();
-
+ switch (currentDirection) {
+ case Direction.None:
+ this.Left += e.XDelta;
+ this.Top += e.YDelta;
+ break;
+ case Direction.N:
+ break;
+ case Direction.S:
+ break;
+ case Direction.E:
+ break;
+ case Direction.W:
+ break;
+ case Direction.NW:
+ this.Left += e.XDelta;
+ this.Top += e.YDelta;
+ this.Width -= e.XDelta;
+ this.Height -= e.YDelta;
+ break;
+ case Direction.NE:
+ this.Width += e.XDelta;
+ this.Top += e.YDelta;
+ this.Height -= e.YDelta;
+ break;
+ case Direction.SW:
+ this.Left += e.XDelta;
+ this.Width -= e.XDelta;
+ this.Height += e.YDelta;
+ break;
+ case Direction.SE:
+ this.Width += e.XDelta;
+ this.Height += e.YDelta;
+ break;
+ }
+
+ this.RegisterForLayouting ((int)LayoutingType.All);
}
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
{
base.onMouseLeave (sender, e);
+ currentDirection = Direction.None;
OpenTKGameWindow otkgw = TopContainer as OpenTKGameWindow;
otkgw.Cursor = XCursor.Default;
}
AddWidget (result as GraphicObject);\r
return result;\r
}\r
+ public GraphicObject LoadInterface (string path)\r
+ {\r
+ GraphicObject tmp = Interface.Load (path, this);\r
+ AddWidget (tmp);\r
+ return tmp;\r
+ }\r
#endregion\r
- \r
+ public virtual void OnRender(FrameEventArgs e)\r
+ {\r
+ }\r
#region Game win overrides\r
protected override void OnUpdateFrame(FrameEventArgs e)\r
{ \r
}\r
protected override void OnRenderFrame(FrameEventArgs e)\r
{\r
+ GL.Clear (ClearBufferMask.ColorBufferBit);\r
+\r
base.OnRenderFrame(e);\r
+\r
OpenGLDraw ();\r
+ OnRender (e);\r
+\r
+ SwapBuffers ();\r
}\r
protected override void OnLoad(EventArgs e)\r
{\r