]> O.S.I.I.S - jp/crow.git/commitdiff
Simplify Alignment Enum; add HorizontalStretch and VerticalStretch to GraphicObject
authorjpbruyere <jp.bruyere@hotmail.com>
Mon, 8 Feb 2016 16:26:51 +0000 (17:26 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Mon, 8 Feb 2016 16:26:51 +0000 (17:26 +0100)
14 files changed:
Templates/Spinner.goml
Tests/Interfaces/0.crow
Tests/Interfaces/2.crow
Tests/Interfaces/4.crow
Tests/Interfaces/fps.goml
Tests/Interfaces/test4.1.goml
Tests/Interfaces/test4.goml
Tests/Interfaces/testExpandable.goml
Tests/Interfaces/testPopper.goml
Tests/Interfaces/testTextBox.crow
Tests/Interfaces/testWindow.goml
src/Enums.cs
src/GraphicObjects/Label.cs
src/GraphicObjects/TextRun.cs

index b8330fcde4c310d89a1ac07ffe2330bb9b4d4270..bd202c1aceae2cbb5ae1e13c6a5f8276ca350cdc 100755 (executable)
@@ -4,7 +4,7 @@
        Background="White">
        <HorizontalStack Name="hstack" Margin="0" Spacing="2" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
                <Label Foreground="DimGray" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}" 
-                       Text="{../../../Value}" Margin="1" TextAlignment="RightCenter"/>
+                       Text="{../../../Value}" Margin="1" TextAlignment="Right"/>
                <VerticalStack Width="-1" Height="{../../../TemplatedHeight}" Spacing="0" >
                        <Button MouseRepeat="true" Width="12" Height="8" MouseClick="../../../../onUp"
                                Template="#Crow.Templates.ArrowButTemplate.crow">
index 0f55b6ced5edaa2cb43dfa5746191463bd06c5ee..9319aa60197bfb9625e34d79479471b53916b9ac 100755 (executable)
@@ -2,17 +2,17 @@
 <VerticalStack Fit="true">
        <ProgressBar CornerRadius="5" Background="DimGray" Margin="1" Maximum="1000" Value="{fps}" Width="200" Height="15"/>
        <HorizontalStack Fit="true">
-               <Label Text="Memory:" Width="50" TextAlignment="RightCenter"/>
+               <Label Text="Memory:" Width="50" TextAlignment="Right"/>
                <Label Text="{memory}" Font="droid,12" 
                        Background="vgradient|0:BlueCrayola|1:Black"/>
        </HorizontalStack>
        <HorizontalStack Fit="true">
-               <Label Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+               <Label Text="Fps:" Width="50" TextAlignment="Right"/>
                <Label Text="{fps}" Font="droid , 12"
                        Background="vgradient|0:LimeGreen|1:Black"/>
        </HorizontalStack>
 <!--   <HorizontalStack Fit="true">
-               <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+               <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                <Label Text="{layouting}" Font="droid,12"
                        Background="vgradient|0:AoEnglish|1:Black"/>
        </HorizontalStack>-->
index 2e8c766b75e4995fdb313e1e0c534edf305915a3..1bd3761df5d1526ff29b56ad50fb2f4a211966f9 100755 (executable)
@@ -4,9 +4,9 @@
                <Label Text="centered" Width="80" Height="30" Background="DarkBlue" TextAlignment="Center"/>
                <Label Text="top left" Width="80" Height="30" Background="DarkBlue" TextAlignment="TopLeft"/>
                <Label Text="top right" Width="80" Height="30" Background="DarkBlue" TextAlignment="TopRight"/>
-               <Label Text="right center" Width="80" Height="30" Background="DarkBlue" TextAlignment="RightCenter"/>
+               <Label Text="right center" Width="80" Height="30" Background="DarkBlue" TextAlignment="Right"/>
                <Label Text="bottom left" Width="80" Height="30" Background="DarkBlue" TextAlignment="BottomLeft"/>
-               <Label Text="bottom center" Width="80" Height="30" Background="DarkBlue" TextAlignment="BottomCenter"/>
+               <Label Text="bottom center" Width="80" Height="30" Background="DarkBlue" TextAlignment="Bottom"/>
                <Label Text="bottom right" Width="80" Height="30" Background="DarkBlue" TextAlignment="BottomRight"/>
        </HorizontalStack>
        <HorizontalStack Fit="true">
index 65d77421e523633cf2d5c9c8b760285bd88214b9..84d8a783c4c6871068cca1b9b2a66e860c7cc222 100755 (executable)
        <VerticalStack Fit="true" Name="vsFps"  Spacing="10" >
                <ProgressBar CornerRadius="5" Background="DimGray" Margin="1" Maximum="1000" Value="{fps}" Width="200" Height="15"/>
                <HorizontalStack Fit="true">
-                       <Label Text="Memory:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Memory:" Width="50" TextAlignment="Right"/>
                        <Label Text="{memory}" Font="droid,12" TextAlignment="Center"
                                Background="vgradient|0:BlueCrayola|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
        </VerticalStack>
        <VerticalStack Fit="true" Name="vsFps"  Spacing="10" >
                <HorizontalStack Fit="true">
-                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
        </VerticalStack>
        <VerticalStack Fit="true" Name="vsFps"  Spacing="10" >
                <HorizontalStack Fit="true">
-                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
        </VerticalStack>
        <VerticalStack Fit="true" Name="vsFps"  Spacing="10" >
                <HorizontalStack Fit="true">
-                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
                <HorizontalStack Fit="true">
-                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                Background="vgradient|0:AoEnglish|1:Black"/>
                </HorizontalStack>
index ff742e7a7d2024a8d8a8694391407d067780403f..18f96c022965bd4f0534adb60847807b06554f63 100755 (executable)
@@ -4,19 +4,19 @@
                Margin="10" Focusable="True" >
                        <VerticalStack Fit="true" Name="vsFps"  Spacing="10" >
                                <HorizontalStack Fit="true">
-                                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Background="AoEnglish" Width="50" TextAlignment="Center"/>
                                </HorizontalStack>
                                <HorizontalStack Fit="true">
-                                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
                                </HorizontalStack>
                                <HorizontalStack Fit="true">
-                                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
                                </HorizontalStack>
                                <HorizontalStack Fit="true">
-                                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                                        <Label Text="{fpsMax}" Font="droid , 12" Background="AoEnglish" Width="50" TextAlignment="Center"/>
                                </HorizontalStack>
                        </VerticalStack>                                
index 6ad43bd27d379e2edf0702a4742368020704baa1..ad4a37e3df6bdfb5f359f966a9c72b7a0e0ef2d0 100755 (executable)
@@ -24,7 +24,7 @@
                                                BorderWidth="2" Foreground="White"/>
 <!--                                   <Label Name="labPb"
                                                Width="20"
-                                               TextAlignment="RightCenter"/>
+                                               TextAlignment="Right"/>
                                        <ProgressBar Name="pbBar"
                                                Width="100" Height="10"
                                                Value="30"/>-->
@@ -44,7 +44,7 @@
                                <Button Margin="5" BorderWidth="0" Background="Gray" Width="-1" Height="-1">
                                        <Label FontSize="10" Text="This is a test" Margin="5" FontColor="White" Foreground="White" />
                                </Button>
-                               <TextBoxWidget  TextAlignment="LeftCenter" Font="droid,14"                                              
+                               <TextBoxWidget  TextAlignment="Left" Font="droid,14"                                            
                                                                Width="300" Height="-1" Margin="2"
                                                                Foreground="White" BorderWidth="1"
                                                                Text="editable text"/>
@@ -64,7 +64,7 @@
                                        <Label Name="labUpdate" Text="xxxx" FontSize="16" Width="60" TextAlignment="Center" Background="DarkGreen"/>
                                </HorizontalStack>
                                <HorizontalStack>
-                                       <Label Text="Fps:" Width = "30" VerticalAlignment="Center"  TextAlignment="LeftCenter"/>
+                                       <Label Text="Fps:" Width = "30" VerticalAlignment="Center"  TextAlignment="Left"/>
                                        <Label Name="labFps" Text="xxxx" Font="droid bold, 14"
                                                TextAlignment="Center" Background="AoEnglish"/>
                                </HorizontalStack>
index 429549c58c51ddab93f7ad4a722ff20c86c1af73..536fb3e9ff53dca78afbc4037cb995c32f54b1f9 100755 (executable)
@@ -38,7 +38,7 @@
                                                <Button MouseClick="onButClick"/>
                                        </VerticalStack>
                                </HorizontalStack>
-                               <TextBox Name="textbox1" TextAlignment="LeftCenter" Font="droid,14"                                             
+                               <TextBox Name="textbox1" TextAlignment="Left" Font="droid,14"                                           
                                                                Width="200" Height="-1" Margin="2" Background="White"
                                                                Forground="Black"
                                                                Foreground="DimGray" BorderWidth="1"
index 880dcf103b96a3c5a78efd158b728dd3bd6d81d3..a2fb1e7880c148cca8cd3e8d8446e9155a604304 100755 (executable)
@@ -6,7 +6,7 @@
                        <CheckBox Name="chk3"/>
                        <CheckBox Name="chk4"/>
                        <HorizontalStack Fit="true" Margin="2" Background="Blue">
-                               <Label Name="captionFps" Text="Fps:" Width="30" TextAlignment="RightCenter"/>
+                               <Label Name="captionFps" Text="Fps:" Width="30" TextAlignment="Right"/>
                                <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="-1" TextAlignment="Center" Background="AoEnglish"/>
                        </HorizontalStack>
                </VerticalStack>
index 88668f3cac0cf4023904caa8c914b4d7a9c8061b..362972e7a7474f79f6eb6a799b89d83cf031843e 100755 (executable)
@@ -8,7 +8,7 @@
                        <CheckBox Name="chk3"/>
                        <CheckBox Name="chk4"/>
                        <HorizontalStack Fit="true" Margin="20">
-                               <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                               <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                                <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
                        </HorizontalStack>
                </VerticalStack>        
index 9623284f38878d46fa2494ac69889e312ed7c941..8a98ff84ea6b1c351a84f329b5595d3d80dddddc 100755 (executable)
@@ -2,23 +2,23 @@
 <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="Top"/>
                <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="Left"/>
                <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="Right"/>
                <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="Bottom"/>
                <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"/>
+               <TextBox Background="DarkGray" Height="30" Width="70" TextAlignment="Top" HorizontalStretch="true" Text="TopStretch"/>
+               <TextBox Background="DarkGray" Height="30" Width="60" TextAlignment="Center" HorizontalStretch="true" Text="HorizontalStretch" />
+               <TextBox Background="DarkGray" Height="30" Width="60" TextAlignment="Bottom" HorizontalStretch="true" Text="BottomStretch"/>
+               <TextBox Background="DarkGray" Height="10" Width="70" TextAlignment="Left" VerticalStretch="true" Text="LeftStretch"/>
+               <TextBox Background="DarkGray" Height="10" Width="70" TextAlignment="Center" VerticalStretch="true" Text="VerticalStretch"/>
+               <TextBox Background="DarkGray" Height="10" Width="70" TextAlignment="Right" VerticalStretch="true" Text="RightStretch"/>
+               <TextBox Background="DarkGray" Height="30" Width="50" HorizontalStretch="true" VerticalStretch="true" 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}"/>
index 9aa86afb563b94cfdd989b296b1cd50aa2ea3450..89e064d4ed1c5d648e2860d8d39139c0eb16447b 100755 (executable)
                                Margin="10" Focusable="True" >
                                        <VerticalStack Fit="true" Name="vsFps"  Spacing="10" >
                                                <HorizontalStack Fit="true">
-                                                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                                                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                                                        <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
                                                                Background="vgradient|0:AoEnglish|1:Black"/>
                                                </HorizontalStack>
                                                <HorizontalStack Fit="true">
-                                                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                                                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                                                        <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                                                Background="vgradient|0:AoEnglish|1:Black"/>
                                                </HorizontalStack>
                                                <HorizontalStack Fit="true">
-                                                       <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+                                                       <Label Text="Drawing:" Width="50" TextAlignment="Right"/>
                                                        <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                                                Background="vgradient|0:AoEnglish|1:Black"/>
                                                </HorizontalStack>
                                                <HorizontalStack Fit="true">
-                                                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+                                                       <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/>
                                                        <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" 
                                                                Background="vgradient|0:AoEnglish|1:Black"/>
                                                </HorizontalStack>
                                                <HorizontalStack Fit="true">
-                                                       <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+                                                       <Label Text="Min:" Width="50" TextAlignment="Right"/>
                                                        <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center"
                                                                Background="vgradient|0:AoEnglish|1:Black"/>
                                                </HorizontalStack>
                                                <HorizontalStack Fit="true">
-                                                       <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+                                                       <Label Text="Max:" Width="50" TextAlignment="Right"/>
                                                        <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center"
                                                                Background="vgradient|0:AoEnglish|1:Black"/>
                                                </HorizontalStack>
                        <Container Name="MainGrp" Background="0,5;0,5;0,5;0,4" Fit="true" Margin="10">
                                        <VerticalStack Fit="true" Spacing="10" >
                                                <HorizontalStack Fit="true">
-                                                       <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+                                                       <Label Text="Update:" Width="50" TextAlignment="Right"/>
                                                        <Label Text="{update}" Font="droid,12" Background="vgradient|0:AoEnglish|1:Black"/>
                                                </HorizontalStack>
                                                <HorizontalStack Fit="true">
-                                                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                                                       <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
                                                        <Label Text="{layouting}" Font="droid,12" Background="vgradient|0:AoEnglish|1:Black"/>
                                                </HorizontalStack>
                                        </VerticalStack>
index 68e1c30f2b7ff352078fe46c2d99a28487b6b90a..6cde0b34e1fbcd80e76a13cbcbec0bd19bc29934 100644 (file)
@@ -10,28 +10,8 @@ namespace Crow
         Horizontal,
         Vertical
     }
-    public enum Alignment
-    {
-        None,
-        TopCenter,
-        TopStretch,
-        LeftCenter,
-        LeftStretch,
-        RightCenter,
-        RightStretch,
-        BottomCenter,
-        BottomStretch,
-        TopLeft,
-        TopRight,
-        BottomLeft,
-        BottomRight,
-        Center,
-        Fit,
-        HorizontalStretch,
-        VerticalStretch
-    }
 
-    public enum PanelBorderPosition
+    public enum Alignment
     {
         Top,
         Left,
@@ -41,9 +21,7 @@ namespace Crow
         TopRight,
         BottomLeft,
         BottomRight,
-        Moving,
-        Closing,
-        ClientArea
+               Center
     }
     public enum HorizontalAlignment
     {
index 08e7211acd6d8ed2876cfca0589a53c0b3b71445..1ce9409b872bc747010d0c8a7774df0e2e9e2352 100644 (file)
@@ -30,7 +30,9 @@ namespace Crow
         
                #region private and protected fields
                string _text = "label";
-        Alignment _textAlignment = Alignment.LeftCenter;        
+        Alignment _textAlignment = Alignment.Left;
+               bool horizontalStretch = false;
+               bool verticalStretch = false;
                bool _multiline = false;
                Color selColor;
                Color selFontColor;
@@ -73,7 +75,7 @@ namespace Crow
                                registerForGraphicUpdate ();
                        }
                }
-        [XmlAttributeAttribute()][DefaultValue(Alignment.LeftCenter)]
+               [XmlAttributeAttribute()][DefaultValue(Alignment.Left)]
                public Alignment TextAlignment
         {
             get { return _textAlignment; }
@@ -82,9 +84,32 @@ namespace Crow
                                        return;
                                _textAlignment = value; 
                                registerForGraphicUpdate ();
+                               registerForGraphicUpdate ();
                                NotifyValueChanged ("TextAlignment", _textAlignment);
                        }
         }
+               [XmlAttributeAttribute()][DefaultValue(false)]
+               public virtual bool HorizontalStretch {
+                       get { return horizontalStretch; }
+                       set {
+                               if (horizontalStretch == value)
+                                       return;
+                               horizontalStretch = value; 
+                               registerForGraphicUpdate ();
+                               NotifyValueChanged ("HorizontalStretch", horizontalStretch);
+                       }
+               }
+               [XmlAttributeAttribute()][DefaultValue(false)]
+               public virtual bool VerticalStretch {
+                       get { return verticalStretch; }
+                       set {
+                               if (verticalStretch == value)
+                                       return;
+                               verticalStretch = value; 
+                               NotifyValueChanged ("VerticalStretch", verticalStretch);
+
+                       }
+               } 
                [XmlAttributeAttribute()][DefaultValue("label")]
         public string Text
         {
@@ -358,62 +383,45 @@ namespace Crow
                                rText.X = cb.X;
                                rText.Y = cb.Y;
                        }else{
+                               if (horizontalStretch) {
+                                       widthRatio = (float)cb.Width / rText.Width;
+                                       if (!verticalStretch)
+                                               heightRatio = widthRatio;
+                               }if (verticalStretch) {
+                                       heightRatio = (float)cb.Height / rText.Height;
+                                       if (!horizontalStretch)
+                                               widthRatio = heightRatio;
+                               }
+                               
+                               rText.Width = (int)(widthRatio * rText.Width);
+                               rText.Height = (int)(heightRatio * rText.Height);
+
                                switch (TextAlignment)
                                {
-                               case Alignment.None:
-                                       break;
                                case Alignment.TopLeft:     //ok
                                        rText.X = cb.X;
                                        rText.Y = cb.Y;
                                        break;
-                               case Alignment.TopCenter:   //ok
+                               case Alignment.Top:   //ok                                              
                                        rText.Y = cb.Y;
                                        rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
                                        break;
                                case Alignment.TopRight:    //ok
-                                       rText.X = cb.Right - rText.Width;
-                                       rText.Y = cb.Y;
-                                       break;
-                               case Alignment.TopStretch://ok
-                                       heightRatio = widthRatio = (float)cb.Width / rText.Width;
-                                       rText.X = cb.X;
                                        rText.Y = cb.Y;
-                                       rText.Width = cb.Width;
-                                       rText.Height = (int)(rText.Height * heightRatio);
+                                       rText.X = cb.Right - rText.Width;
                                        break;
-                               case Alignment.LeftCenter://ok
+                               case Alignment.Left://ok
                                        rText.X = cb.X;
                                        rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
                                        break;
-                               case Alignment.LeftStretch://ok
-                                       heightRatio = widthRatio = (float)cb.Height / rText.Height;
-                                       rText.X = cb.X;
-                                       rText.Y = cb.Y;
-                                       rText.Height = cb.Height;
-                                       rText.Width = (int)(widthRatio * cb.Width);
-                                       break;
-                               case Alignment.RightCenter://ok
+                               case Alignment.Right://ok
                                        rText.X = cb.X + cb.Width - rText.Width;
                                        rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
                                        break;
-                               case Alignment.RightStretch://ok
-                                       heightRatio = widthRatio = (float)cb.Height / rText.Height;
-                                       rText.Height = cb.Height;
-                                       rText.Width = (int)(widthRatio * rText.Width);
-                                       rText.X = cb.Right - rText.Width;
-                                       rText.Y = cb.Y;
-                                       break;
-                               case Alignment.BottomCenter://ok
+                               case Alignment.Bottom://ok
                                        rText.X = cb.Width / 2 - rText.Width / 2;
                                        rText.Y = cb.Height - rText.Height;
                                        break;
-                               case Alignment.BottomStretch://ok
-                                       heightRatio = widthRatio = (float)cb.Width / rText.Width;
-                                       rText.Width = cb.Width;
-                                       rText.Height = (int)(rText.Height * heightRatio);
-                                       rText.Y = cb.Bottom - rText.Height;
-                                       rText.X = cb.X;
-                                       break;
                                case Alignment.BottomLeft://ok
                                        rText.X = cb.X;
                                        rText.Y = cb.Bottom - rText.Height;
@@ -426,27 +434,6 @@ namespace Crow
                                        rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
                                        rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
                                        break;
-                               case Alignment.Fit://ok, peut être mieu aligné                            
-                                       widthRatio = (float)cb.Width / rText.Width;
-                                       heightRatio = (float)cb.Height / rText.Height;
-                                       rText = cb;
-                                       break;
-                               case Alignment.HorizontalStretch://ok
-                                       heightRatio = widthRatio = (float)cb.Width / rText.Width;
-                                       rText.Width = cb.Width;
-                                       rText.Height = (int)(heightRatio * rText.Height);
-                                       rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
-                                       rText.X = cb.X;
-                                       break;
-                               case Alignment.VerticalStretch://ok
-                                       heightRatio = widthRatio = (float)cb.Height / rText.Height;
-                                       rText.Height = cb.Height;
-                                       rText.Width = (int)(widthRatio * rText.Width);
-                                       rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
-                                       rText.Y = cb.Y;
-                                       break;
-                               default:
-                                       break;
                                }
                        }
 
@@ -520,10 +507,10 @@ namespace Crow
                                        (int)fe.Height);
 
 //                             if (TextAlignment == Alignment.Center ||
-//                                     TextAlignment == Alignment.TopCenter ||
-//                                     TextAlignment == Alignment.BottomCenter)
+//                                     TextAlignment == Alignment.Top ||
+//                                     TextAlignment == Alignment.Bottom)
 //                                     lineRect.X += (rText.Width - lineLength) / 2;
-//                             else if (TextAlignment == Alignment.RightCenter ||
+//                             else if (TextAlignment == Alignment.Right ||
 //                                     TextAlignment == Alignment.TopRight ||
 //                                     TextAlignment == Alignment.BottomRight)
 //                                     lineRect.X += (rText.Width - lineLength);
index 76dde9a8443642db562b01f9ee05450a3d5b3457..a426bdee2cfd5ea249ba6ddaf23498d58d287b88 100644 (file)
@@ -30,7 +30,9 @@ namespace Crow
         
                #region private and protected fields
                protected string _text = "label";
-        Alignment _textAlignment = Alignment.LeftCenter;        
+        Alignment _textAlignment = Alignment.Left;
+               bool horizontalStretch = false;
+               bool verticalStretch = false;
                bool _multiline;
                bool wordWrap;
         protected Rectangle rText;
@@ -41,12 +43,34 @@ namespace Crow
                #endregion
 
 
-        [XmlAttributeAttribute()][DefaultValue(Alignment.LeftCenter)]
+        [XmlAttributeAttribute()][DefaultValue(Alignment.Left)]
                public Alignment TextAlignment
         {
             get { return _textAlignment; }
             set { _textAlignment = value; }
         }
+               [XmlAttributeAttribute()][DefaultValue(false)]
+               public virtual bool HorizontalStretch {
+                       get { return horizontalStretch; }
+                       set {
+                               if (horizontalStretch == value)
+                                       return;
+                               horizontalStretch = value; 
+                               registerForGraphicUpdate ();
+                               NotifyValueChanged ("HorizontalStretch", horizontalStretch);
+                       }
+               }
+               [XmlAttributeAttribute()][DefaultValue(false)]
+               public virtual bool VerticalStretch {
+                       get { return verticalStretch; }
+                       set {
+                               if (verticalStretch == value)
+                                       return;
+                               verticalStretch = value; 
+                               NotifyValueChanged ("VerticalStretch", verticalStretch);
+
+                       }
+               } 
                [XmlAttributeAttribute()][DefaultValue("label")]
         public string Text
         {
@@ -185,63 +209,45 @@ namespace Crow
                                rText.X = cb.X;
                                rText.Y = cb.Y;
                        }else {
-                               
+                               if (horizontalStretch) {
+                                       widthRatio = (float)cb.Width / rText.Width;
+                                       if (!verticalStretch)
+                                               heightRatio = widthRatio;
+                               }if (verticalStretch) {
+                                       heightRatio = (float)cb.Height / rText.Height;
+                                       if (!horizontalStretch)
+                                               widthRatio = heightRatio;
+                               }
+
+                               rText.Width = (int)(widthRatio * cb.Width);
+                               rText.Height = (int)(heightRatio * cb.Height);
+
                                switch (TextAlignment)
                                {
-                               case Alignment.None:
-                                       break;
                                case Alignment.TopLeft:     //ok
                                        rText.X = cb.X;
                                        rText.Y = cb.Y;
                                        break;
-                               case Alignment.TopCenter:   //ok
+                               case Alignment.Top:   //ok                                              
                                        rText.Y = cb.Y;
                                        rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
                                        break;
                                case Alignment.TopRight:    //ok
-                                       rText.X = cb.Right - rText.Width;
-                                       rText.Y = cb.Y;
-                                       break;
-                               case Alignment.TopStretch://ok
-                                       heightRatio = widthRatio = (float)cb.Width / rText.Width;
-                                       rText.X = cb.X;
                                        rText.Y = cb.Y;
-                                       rText.Width = cb.Width;
-                                       rText.Height = (int)(rText.Height * heightRatio);
+                                       rText.X = cb.Right - rText.Width;
                                        break;
-                               case Alignment.LeftCenter://ok
+                               case Alignment.Left://ok
                                        rText.X = cb.X;
                                        rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
                                        break;
-                               case Alignment.LeftStretch://ok
-                                       heightRatio = widthRatio = (float)cb.Height / rText.Height;
-                                       rText.X = cb.X;
-                                       rText.Y = cb.Y;
-                                       rText.Height = cb.Height;
-                                       rText.Width = (int)(widthRatio * cb.Width);
-                                       break;
-                               case Alignment.RightCenter://ok
+                               case Alignment.Right://ok
                                        rText.X = cb.X + cb.Width - rText.Width;
                                        rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
                                        break;
-                               case Alignment.RightStretch://ok
-                                       heightRatio = widthRatio = (float)cb.Height / rText.Height;
-                                       rText.Height = cb.Height;
-                                       rText.Width = (int)(widthRatio * cb.Width);
-                                       rText.X = cb.X;
-                                       rText.Y = cb.Y;
-                                       break;
-                               case Alignment.BottomCenter://ok
+                               case Alignment.Bottom://ok
                                        rText.X = cb.Width / 2 - rText.Width / 2;
                                        rText.Y = cb.Height - rText.Height;
                                        break;
-                               case Alignment.BottomStretch://ok
-                                       heightRatio = widthRatio = (float)cb.Width / rText.Width;
-                                       rText.Width = cb.Width;
-                                       rText.Height = (int)(rText.Height * heightRatio);
-                                       rText.Y = cb.Bottom - rText.Height;
-                                       rText.X = cb.X;
-                                       break;
                                case Alignment.BottomLeft://ok
                                        rText.X = cb.X;
                                        rText.Y = cb.Bottom - rText.Height;
@@ -254,27 +260,6 @@ namespace Crow
                                        rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
                                        rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
                                        break;
-                               case Alignment.Fit://ok, peut être mieu aligné                            
-                                       widthRatio = (float)cb.Width / rText.Width;
-                                       heightRatio = (float)cb.Height / rText.Height;
-                                       rText = cb;
-                                       break;
-                               case Alignment.HorizontalStretch://ok
-                                       heightRatio = widthRatio = (float)cb.Width / rText.Width;
-                                       rText.Width = cb.Width;
-                                       rText.Height = (int)(heightRatio * rText.Height);
-                                       rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
-                                       rText.X = cb.X;
-                                       break;
-                               case Alignment.VerticalStretch://ok
-                                       heightRatio = widthRatio = (float)cb.Height / rText.Height;
-                                       rText.Height = cb.Height;
-                                       rText.Width = (int)(widthRatio * rText.Width);
-                                       rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
-                                       rText.Y = cb.Y;
-                                       break;
-                               default:
-                                       break;
                                }
                        }