<?xml version="1.0"?>
-<VerticalStack Background="Red" Width="-1" Height="-1">
+<VerticalStack Background="SteelBlue" Fit="true">
+ <HorizontalStack Fit="true">
+ <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="TopLeft"/>
+ <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="TopCenter"/>
+ <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="TopRight"/>
+ <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="LeftCenter"/>
+ <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="Center"/>
+ <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="RightCenter"/>
+ <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="BottomLeft"/>
+ <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="BottomCenter"/>
+ <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="BottomRight"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <TextBox Background="DarkGray" Height="30" Width="70" TextAlignment="TopStretch" Text="TopStretch"/>
+ <TextBox Background="DarkGray" Height="30" Width="60" TextAlignment="HorizontalStretch" Text="HorizontalStretch" />
+ <TextBox Background="DarkGray" Height="30" Width="60" TextAlignment="BottomStretch" Text="BottomStretch"/>
+ <TextBox Background="DarkGray" Height="10" Width="70" TextAlignment="LeftStretch" Text="LeftStretch"/>
+ <TextBox Background="DarkGray" Height="10" Width="70" TextAlignment="VerticalStretch" Text="VerticalStretch"/>
+ <TextBox Background="DarkGray" Height="10" Width="70" TextAlignment="RightStretch" Text="RightStretch"/>
+ <TextBox Background="DarkGray" Height="30" Width="50" TextAlignment="Fit" Text="Fit"/>
+ </HorizontalStack>
<TextBox Name="tb" Multiline="true" Font="droid,16" Margin="5" Text="A\nBB\nCCC\nDDDD"/>
<TextBox Multiline="true" Font="droid,16" Name="tb5" Margin="5" Text="{../tb.SelectedText}"/>
<!-- <TextBox Font="droid,10" Name="tb1" Margin="5" Text="this is a test of a text box"/>
case Alignment.RightStretch://ok\r
heightRatio = widthRatio = (float)cb.Height / rText.Height;\r
rText.Height = cb.Height;\r
- rText.Width = (int)(widthRatio * cb.Width);\r
- rText.X = cb.X;\r
+ rText.Width = (int)(widthRatio * rText.Width);\r
+ rText.X = cb.Right - rText.Width;\r
rText.Y = cb.Y;\r
break;\r
case Alignment.BottomCenter://ok\r
break;\r
}\r
}\r
- OpenTKGameWindow.currentWindow.CursorVisible = true;\r
+\r
+ gr.FontMatrix = new Matrix(widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0);\r
+ fe = gr.FontExtents;\r
\r
#region draw text cursor\r
if (mouseLocalPos >= 0)\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
- OpenTKGameWindow.currentWindow.CursorVisible = true;\r
+\r
for (int i = 0; i < lines.Count; i++) { \r
string l = lines [i].Replace ("\t", new String (' ', Interface.TabSize));\r
int lineLength = (int)gr.TextExtents (l).XAdvance;\r