</PropertyGroup>\r
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
<OutputPath>bin\Debug</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;__linux__;DEBUG_LOAD_TIME0;DEBUG_LAYOUTING0;DEBUG_BINDING0</DefineConstants>\r
+ <DefineConstants>TRACE;DEBUG;__linux__;DEBUG_LOAD_TIME0;DEBUG_LAYOUTING;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>\r
</PropertyGroup>\r
<!-- <PropertyGroup Condition=" '$(Platform)' == 'Linux_x86' ">\r
<DefineConstants>__linux__</DefineConstants>\r
<Compile Include="src\GraphicObjects\ComboBox.cs" />\r
<Compile Include="src\GraphicObjects\GroupBox.cs" />\r
<Compile Include="src\GraphicObjects\ScrollBar.cs" />\r
+ <Compile Include="src\BubblingMouseButtonEventArgs.cs" />\r
</ItemGroup>\r
<ItemGroup>\r
<Reference Include="System" />\r
<EmbeddedResource Include="Templates\GroupBox.goml" />\r
<EmbeddedResource Include="Templates\ListBox.goml" />\r
<EmbeddedResource Include="Templates\ScrollBar.goml" />\r
+ <EmbeddedResource Include="Templates\Button.crow" />\r
+ <EmbeddedResource Include="Templates\ArrowButTemplate.crow" />\r
</ItemGroup>\r
<ItemGroup>\r
<None Include="README.md" />\r
<Properties GitUserInfo="UsingGIT" StartupItem="Tests/Tests.csproj">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|Linux_x86" />
- <MonoDevelop.Ide.Workbench ActiveDocument="src/GraphicObjects/TemplatedControl.cs">
+ <MonoDevelop.Ide.Workbench ActiveDocument="src/GraphicObjects/GraphicObject.cs">
<Files>
- <File FileName="src/GraphicObjects/GraphicObject.cs" Line="848" Column="39" />
- <File FileName="Tests/GOLIBTests.cs" Line="41" Column="1" />
- <File FileName="Tests/Interfaces/testWindow3.goml" Line="10" Column="6" />
- <File FileName="src/GraphicObjects/TemplatedControl.cs" Line="114" Column="1" />
- <File FileName="src/GraphicObjects/Window.cs" Line="214" Column="1" />
- <File FileName="src/GraphicObjects/TemplatedContainer.cs" Line="80" Column="19" />
- <File FileName="src/GraphicObjects/Container.cs" Line="31" Column="1" />
- <File FileName="src/GraphicObjects/PrivateContainer.cs" Line="67" Column="1" />
+ <File FileName="src/GraphicObjects/GraphicObject.cs" Line="572" Column="23" />
+ <File FileName="src/GraphicObjects/Label.cs" Line="15" Column="5" />
+ <File FileName="src/OpenTKGameWindow.cs" Line="114" Column="1" />
+ <File FileName="Tests/GOLIBTests.cs" Line="156" Column="32" />
+ <File FileName="src/GraphicObjects/TextBox.cs" Line="15" Column="31" />
</Files>
+ <Pads>
+ <Pad Id="MonoDevelop.Debugger.WatchPad">
+ <State />
+ </Pad>
+ </Pads>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore>
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- viewBox="0 0 65.480012 51.479989"
- height="51.479988"
- width="65.480011"
- id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
- sodipodi:docname="updown.svg">
-<!-- <metadata
- id="metadata13">
+ id="svg2"
+ width="44.717388"
+ height="31.938803"
+ viewBox="0 0 44.717389 31.938803">
+ <metadata
+ id="metadata11">
<rdf:RDF>
<cc:Work
rdf:about="">
</cc:Work>
</rdf:RDF>
</metadata>
- <sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="1260"
- inkscape:window-height="644"
- id="namedview11"
- showgrid="false"
- inkscape:zoom="3.2415936"
- inkscape:cx="30.089585"
- inkscape:cy="-4.9619855"
- inkscape:window-x="0"
- inkscape:window-y="16"
- inkscape:window-maximized="0"
- inkscape:current-layer="svg2" />-->
+ <defs
+ id="defs9" />
+
<g
- id="up"
- transform="matrix(0.88780545,0,0,0.79362094,4.0529638,4.3893292)">
+ transform="matrix(0.81305037,0,0,0.79847006,-3.6589183,-5.1900554)"
+ id="up">
<path
- style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 32,9 7,44 57,44 Z"
id="path4144"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cccc" />
+ d="M 32,9 7,44 57,44 Z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<g
- id="down"
- transform="matrix(0.88780545,0,0,0.79362094,4.0529638,4.3893292)">
+ transform="matrix(0.81305037,0,0,0.79847006,-3.6589183,-5.1900554)"
+ id="down">
<path
- style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 7,9 57,9 32,44 Z"
id="path4144-0"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cccc" />
+ d="M 7,9 57,9 32,44 Z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</svg>
}
}
- public IGOLibHost TopContainer {
+ public IGOLibHost HostContainer {
get { return this as IGOLibHost; }
}
--- /dev/null
+<?xml version="1.0"?>\r
+<!--<HorizontalStack Spacing="1" Height="100" Width="300">\r
+ <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>\r
+ <Label Text="{../../Caption}" Height="80" Width="200"/>\r
+</HorizontalStack>-->\r
+<Border Name="Content"\r
+ Background="Gray" Foreground="DarkGray" \r
+ Height="{../TemplatedHeight}" Width="{../TemplatedWidth}"\r
+ MouseEnter="{Foreground=White}"\r
+ MouseLeave="{Foreground=DarkGray}"\r
+ MouseDown="{Background=LightGray}"\r
+ MouseUp="{Background=Gray}"\r
+ >\r
+</Border>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>\r
+<!--<HorizontalStack Spacing="1" Height="100" Width="300">\r
+ <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>\r
+ <Label Text="{../../Caption}" Height="80" Width="200"/>\r
+</HorizontalStack>-->\r
+<Border Fit="True" Background="Gray" MinimumSize="50;20" Foreground="Gray" CornerRadius="3" \r
+ MouseEnter="{Foreground=White;caption.Foreground=White}"\r
+ MouseLeave="{Foreground=Gray;caption.Foreground=Black}"\r
+ MouseDown="{Background=LightGray}"\r
+ MouseUp="{Background=Gray}"\r
+ >\r
+<!-- <Image Height="0" Width="0" Margin="0" Path="{../../Image}" SvgSub="{../../SvgSub}"/>-->\r
+ <Label Name="caption" Margin="5" Foreground="Black" Text="{../../Caption}"/>\r
+</Border>
\ No newline at end of file
<?xml version="1.0"?>\r
-<Border CornerRadius="0" BorderColor="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+<Border CornerRadius="0" Foreground="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
<HorizontalStack Margin="1" Spacing="1" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
<Label Margin="1" Foreground="Black" Background="White" Text="{../../../Caption}" \r
Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>\r
<?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" \r
+<Border BorderWidth="1" Foreground="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" \r
MouseClick="../onMouseClick">\r
<VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
<HorizontalStack Spacing="1" Height="-1" Width="{../../../TemplatedWidth}">\r
<?xml version="1.0"?>
-<Border Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" BorderWidth="1" BorderColor="White" CornerRadius="10" >
+<Border Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" BorderWidth="1" Foreground="White" CornerRadius="10" >
<VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}" Background="0,4;0,4;0,4;0,4">
- <Border BorderWidth="1" BorderColor="White" Width="{../../../TemplatedWidth}" Height="-1"
+ <Border BorderWidth="1" Foreground="White" Width="{../../../TemplatedWidth}" Height="-1"
Background="0,1;0,5;1,0;0,5">
<HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../TemplatedWidth}" Height="-1" >
<GraphicObject Width="5" Height="5"/>
<Image Margin="1" Width="12" Height="12" Path="{../../../../../Icon}"/>
<Label Foreground="White" Width="{../../../../../TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{../../../../../Title}" />
- <Border CornerRadius="6" BorderWidth="1" BorderColor="Transparent" Height="12" Width="12"
- MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">
+ <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent" Height="12" Width="12"
+ MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
<Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#Crow.Images.Icons.exit2.svg"
MouseClick="../../../../../../butQuitPress"/>
</Border>
</HorizontalStack>
<HorizontalStack Height="-1" Width="{../../../TemplatedWidth}" Margin="3">
<GraphicObject Height="5"/>
- <Button Text="Ok"/>
- <Button Text="Cancel"/>
+ <Button Caption="Ok"/>
+ <Button Caption="Cancel"/>
</HorizontalStack>
</VerticalStack>
</Border>
<?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="LightGray" Height="-1" Width="{../TemplatedWidth}" MouseClick="../onMouseClick">\r
+<Border BorderWidth="1" Foreground="LightGray" Height="-1" Width="{../TemplatedWidth}" MouseClick="../onMouseClick">\r
<HorizontalStack Spacing="1" Height="-1" Width="{../../TemplatedWidth}">\r
<Image Margin="2" Width="12" Height="12" Path="{../../../Image}" SvgSub="{../../../SvgSub}"/>\r
<Label Text="{../../../Caption}" Width="{../../../TemplatedWidth}"/>\r
<?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="LightGray" Width="{../TemplatedWidth}" Height="{../TemplatedHeight}">\r
+<Border BorderWidth="1" Foreground="LightGray" Width="{../TemplatedWidth}" Height="{../TemplatedHeight}">\r
<GenericStack Orientation="{../../Orientation}" Width="{../../TemplatedWidth}" Height="{../../TemplatedHeight}">\r
- <Button Width="12" Height="12" MouseClick="../../../onScrollBack">\r
+ <Button MouseRepeat="true" Width="12" Height="8" MouseClick="../../../onScrollBack"\r
+ Template="#Crow.Templates.ArrowButTemplate.crow">\r
<Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="up"/>\r
</Button>\r
<Slider Name="Slider" Value="{../../../Scroll}" Maximum="{../../../MaximumScroll}" \r
Width="{../../../TemplatedWidth}" Height="{../../../TemplatedHeight}" Orientation="{../../../Orientation}"\r
ValueChanged="../../../onSliderValueChange"/>\r
- <Button Width="12" Height="12" MouseClick="../../../onScrollForth">\r
+ <Button MouseRepeat="true" Width="12" Height="8" MouseClick="../../../onScrollForth"\r
+ Template="#Crow.Templates.ArrowButTemplate.crow">\r
<Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>\r
</Button>\r
</GenericStack>\r
<?xml version="1.0"?>
-<Border BorderWidth="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" Background="White">
+<Border BorderWidth="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}"
+ Foreground="Gray"
+ 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"/>
- <VerticalStack Width="-1" Height="{../../../TemplatedHeight}" Spacing="1" >
- <Button Width="12" Height="8" MouseClick="../../../../onUp">
+ <VerticalStack Width="-1" Height="{../../../TemplatedHeight}" Spacing="0" >
+ <Button MouseRepeat="true" Width="12" Height="8" MouseClick="../../../../onUp"
+ Template="#Crow.Templates.ArrowButTemplate.crow">
<Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="up"/>
</Button>
- <Button Width="12" Height="8" MouseClick="../../../../onDown">
+
+ <Button MouseRepeat="true" Width="12" Height="8" MouseClick="../../../../onDown"
+ Template="#Crow.Templates.ArrowButTemplate.crow">
<Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
</Button>
</VerticalStack>
<?xml version="1.0"?>\r
-<Border BorderWidth="1" BorderColor="White" CornerRadius="20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+<Border BorderWidth="1" Foreground="White" CornerRadius="20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
<VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
- <Border BorderWidth="1" BorderColor="White" Width="{../../../TemplatedWidth}" Height="-1" \r
+ <Border Name="TitleBar" BorderWidth="1" Foreground="White" Width="{../../../TemplatedWidth}" Height="-1" \r
Background="0,1;0,5;1,0;0,5">\r
<HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../TemplatedWidth}" Height="-1" >\r
<GraphicObject Width="5"/>\r
<Image Margin="1" Width="12" Height="12" Path="{../../../../../Icon}"/>\r
<Label Foreground="White" Width="{../../../../../TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{../../../../../Title}" />\r
- <Border CornerRadius="6" BorderWidth="1" BorderColor="Transparent" Height="12" Width="12"\r
- MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">\r
+ <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent" Height="12" Width="12"\r
+ MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">\r
<Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#Crow.Images.Icons.exit2.svg"\r
MouseClick="../../../../../../butQuitPress"/>\r
</Border>\r
CornerRadius = 5,\r
Background = col,\r
BorderWidth = 2,\r
- BorderColor = Color.Transparent,\r
+ Foreground = Color.Transparent,\r
Focusable = true\r
};\r
b.MouseEnter += delegate(object sender, MouseMoveEventArgs ee) {\r
- (sender as Border).BorderColor = Color.White;\r
+ (sender as Border).Foreground = Color.White;\r
};\r
b.MouseLeave += delegate(object sender, MouseMoveEventArgs ee) {\r
- (sender as Border).BorderColor = Color.Transparent;\r
+ (sender as Border).Foreground = Color.Transparent;\r
};\r
s.addChild (b);\r
\r
CornerRadius = 5,\r
Background = col,\r
BorderWidth = 2,\r
- BorderColor = Color.Transparent,\r
+ Foreground = Color.Transparent,\r
Focusable = true\r
};\r
b.MouseEnter += delegate(object sender, MouseMoveEventArgs ee) {\r
- (sender as Border).BorderColor = Color.White;\r
+ (sender as Border).Foreground = Color.White;\r
};\r
b.MouseLeave += delegate(object sender, MouseMoveEventArgs ee) {\r
- (sender as Border).BorderColor = Color.Transparent;\r
+ (sender as Border).Foreground = Color.Transparent;\r
};\r
s.addChild (b);\r
\r
int frameCpt = 0;\r
int idx = 0;\r
string[] testFiles = {\r
+ "testTextBox.crow",\r
+ "testSpinner.goml",\r
+ "testImage.crow",\r
+ "testButton.crow",\r
+ "fps.goml",\r
"test4.goml",\r
"testScrollbar.goml",\r
"2.crow",\r
"testExpandable.goml",\r
"testCheckbox.goml",\r
"testPopper.goml",\r
- "fps.goml",\r
"testLabel.goml",\r
"testAll.goml",\r
// "testSpinner.goml",\r
"testContainer.goml",\r
"testBorder.goml",\r
"testRadioButton.goml",\r
- "testSpinner.goml",\r
"testMsgBox.goml",\r
"testGrid.goml",\r
"testMeter.goml",\r
ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));\r
ValueChanged.Raise (this, new ValueChangeEventArgs ("update",\r
this.updateTime.ElapsedMilliseconds.ToString () + " ms"));\r
+ ValueChanged.Raise (this, new ValueChangeEventArgs ("drawing",\r
+ this.drawingTime.ElapsedMilliseconds.ToString () + " ms"));\r
}\r
}\r
\r
_fps = 0;\r
}\r
public string update = "";\r
+ public string drawing = "";\r
#endregion\r
\r
public int intValue = 25;\r
}\r
protected override void OnKeyDown (KeyboardKeyEventArgs e)\r
{\r
-// if (FocusedWidget != null) {\r
-// base.OnKeyDown (e);\r
-// return;\r
-// }\r
+ if (FocusedWidget is TextBox) {\r
+ base.OnKeyDown (e);\r
+ return;\r
+ }\r
if (e.Key == Key.Escape) {\r
this.Quit ();\r
return;\r
- }else if (e.Key == Key.L) {\r
+ } else if (e.Key == Key.L) {\r
TestList.Add ("new string");\r
NotifyValueChanged ("TestList", TestList);\r
return;\r
+ } else if (e.Key == Key.W) {\r
+ GraphicObject w = LoadInterface("Interfaces/testWindow.goml");\r
+ w.DataSource = this;\r
+ return;\r
}\r
ClearInterface ();\r
idx++;\r
obj.DataSource = this;\r
\r
}\r
-\r
+ void onButClick(object send, MouseButtonEventArgs e)\r
+ {\r
+ Console.WriteLine ("button clicked:" + send.ToString());\r
+ }\r
[STAThread]\r
static void Main ()\r
{\r
Background="0,5;0,5;0,5;0,5" Foreground="White"\r
Margin="10" >\r
<Border \r
- BorderWidth="2" BorderColor="Transparent"\r
+ BorderWidth="2" Foreground="Transparent"\r
Focusable="True"\r
- MouseEnter="{BorderColor = White}"\r
- MouseLeave="{BorderColor = Transparent}">\r
+ MouseEnter="{Foreground = White}"\r
+ MouseLeave="{Foreground = Transparent}">\r
\r
<HorizontalStack Name="hs0" Fit="true"\r
WidgetSpacing="10" \r
Width="100" Height="20"\r
Value="50"\r
Foreground="BlueCrayola" Background="DarkGray"\r
- BorderWidth="2" BorderColor="White"/>\r
+ BorderWidth="2" Foreground="White"/>\r
<!-- <Label Name="labPb"\r
Width="20"\r
TextAlignment="RightCenter"/>\r
</Button>\r
<TextBoxWidget TextAlignment="LeftCenter" Font="droid,14" \r
Width="300" Height="-1" Margin="2"\r
- BorderColor="White" BorderWidth="1"\r
+ Foreground="White" BorderWidth="1"\r
Text="editable text"/>\r
<GroupBox Title="Group Box" Width="300" Height="100" \r
- BorderColor="White" BorderWidth="2" Margin="3">\r
+ Foreground="White" BorderWidth="2" Margin="3">\r
<Label Name="labValue" FontSize="14" Text="000" TextAlignment="Center"/>\r
</GroupBox>\r
<Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />\r
Margin="5" VerticalScrolling="true">\r
<VerticalStack Name="colors" VerticalAlignment="Top" Margin="5">\r
<ProgressBar Name="pbBar2" Width="100" Height="20" Value="50"\r
- BorderWidth="2" BorderColor="White" Foreground="BlueCrayola" Background="DarkGray"/>\r
+ BorderWidth="2" Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/>\r
</VerticalStack>\r
</Scroller>-->\r
\r
Margin="10" >\r
<Border Margin="10" CornerRadius="10"\r
Name="mainBorder"\r
- BorderWidth="2" BorderColor="Transparent"\r
+ BorderWidth="2" Foreground="Transparent"\r
Focusable="True"\r
- MouseEnter="{BorderColor = White}"\r
- MouseLeave="{BorderColor = Transparent}">\r
+ MouseEnter="{Foreground = White}"\r
+ MouseLeave="{Foreground = Transparent}">\r
<HorizontalStack WidgetSpacing="1">\r
<VerticalStack Width="-1">\r
<HorizontalStack WidgetSpacing="1" Fit="true">\r
<TextBox Name="textbox1" TextAlignment="LeftCenter" Font="droid,14" \r
Width="200" Height="-1" Margin="2" Background="White"\r
Forground="Black"\r
- BorderColor="DimGray" BorderWidth="1"\r
+ Foreground="DimGray" BorderWidth="1"\r
Text="editable text"/>\r
<Popper Width="100">\r
<Border Fit="True" Background="ArmyGreen">\r
Margin="5" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">\r
<VerticalStack Name="colors" VerticalAlignment="Top" Margin="1" Fit="true">\r
<!-- <ProgressBar Name="pbBar2" Width="100" Height="20" Value="50"\r
- BorderWidth="2" BorderColor="White" Foreground="BlueCrayola" Background="DarkGray"/>\r
+ BorderWidth="2" Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/>\r
<ProgressBar Width="100" Height="20" Value="{fps}" BorderWidth="2"\r
- BorderColor="White" Foreground="BlueCrayola" Background="DarkGray"/> -->\r
+ Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/> -->\r
</VerticalStack>\r
</Scroller>\r
<ScrollBar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"\r
Maximum="200"\r
Value="{fps}"\r
Foreground="BlueCrayola" Background="DarkGray"\r
- BorderWidth="2" BorderColor="White"/>\r
+ BorderWidth="2" Foreground="White"/>\r
</HorizontalStack>\r
\r
<Button Margin="5" BorderWidth="0" Width="-1" Height="-1" HorizontalAlignment="Center">\r
</Button>\r
\r
<GroupBox Title="Group Box" Width="300" Height="100" \r
- BorderColor="White" BorderWidth="2" Margin="3">\r
+ Foreground="White" BorderWidth="2" Margin="3">\r
<Label Name="labValue" FontSize="14" Text="{../../slider.Value}" TextAlignment="Center"/>\r
</GroupBox>\r
<Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />\r
Margin="5" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">\r
<VerticalStack Name="colors" VerticalAlignment="Top" Margin="1">\r
<ProgressBar Name="pbBar2" Width="100" Height="20" Value="50"\r
- BorderWidth="2" BorderColor="White" Foreground="BlueCrayola" Background="DarkGray"/>\r
+ BorderWidth="2" Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/>\r
<ProgressBar Width="100" Height="20" Value="{fps}" BorderWidth="2"\r
- BorderColor="White" Foreground="BlueCrayola" Background="DarkGray"/> \r
+ Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/> \r
</VerticalStack>\r
</Scroller>\r
<Scrollbar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"\r
<?xml version="1.0"?>\r
-<Container Name="container0" BorderColor="White" BorderWidth="2" Margin="100"\r
+<Container Name="container0" Foreground="White" BorderWidth="2" Margin="100"\r
CornerRadius="50">\r
<Group Name="group0" Background="Green" Margin="20">\r
<HorizontalStack Name="hs0" Background="Blue" Margin="20">\r
</Group>\r
<!-- <Scroller Height="100" Width="300" Background="Green" VerticalScrolling="true" Margin="5">\r
<Group Name="MainGrp" Background="Red" VerticalAlignment="Top"\r
- BorderColor="White" BorderWidth="2" Margin="10" Focusable="True" \r
+ Foreground="White" BorderWidth="2" Margin="10" Focusable="True" \r
Width="400" Height="200">\r
<HorizontalStack>\r
<Button Width="-1" Height="-1" Margin="5" BorderWidth="2" Background="Gray">\r
<?xml version="1.0"?>
-<Border BorderWidth="1" BorderColor="White" CornerRadius="10" Width="500" Height="300">
+<Border BorderWidth="1" Foreground="White" CornerRadius="10" Width="500" Height="300">
<VerticalStack Height="0" Background="0,4;0,4;0,4;0,4">
- <Border BorderWidth="1" BorderColor="White" Height="20" Background="0,1;0,5;1,0;0,5">
+ <Border BorderWidth="1" Foreground="White" Height="20" Background="0,1;0,5;1,0;0,5">
<HorizontalStack Name="hs" Margin="1" Spacing="1" Height="-1" >
<GraphicObject Width="5"/>
<Image Name="Image" Margin="1" Width="12" Height="12" Path="#go.Images.Icons.tetra.png"/>
<Label Foreground="White" Width="0" Name="Title" Margin="1" TextAlignment="Center" />
- <Border CornerRadius="6" BorderWidth="1" Margin="0" BorderColor="Transparent" Height="12" Width="12"
- MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">
+ <Border CornerRadius="6" BorderWidth="1" Margin="0" Foreground="Transparent" Height="12" Width="12"
+ MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
<Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0"
Path="#go.Images.Icons.exit2.svg"/>
</Border>
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack Fit="true">
+ <HorizontalStack Fit="True">
+ <Button Caption="but" MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack> <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+</VerticalStack>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack Fit="true">
+ <HorizontalStack Fit="true" Background="Red" Margin="5">
+ <Label Text="SCALED PROPORTIONNAL" Width="150"/>
+ <Image Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Margin="10" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Margin="10" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Margin="10" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Margin="10" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true" Background="Red" Margin="5">
+ <Label Text="SCALED NOT PROPORTIONNAL" Width="150"/>
+ <Image KeepProportions="false" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true" Background="Red" Margin="5">
+ <Label Text="UNSCALED" Width="150"/>
+ <Image Scaled="false" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true" Background="Red" Margin="5">
+ <Label Text="SCALED PROPORTIONNAL" Width="150"/>
+ <Image Background="Blue" Path="#Tests.image.tetra.png"/>
+ <Image Margin="10" Background="Blue" Path="#Tests.image.tetra.png"/>
+ <Image Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
+ <Image Margin="2" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
+ <Image Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
+ <Image Margin="10" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
+ <Image Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
+ <Image Margin="10" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
+ <Image Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
+ <Image Margin="10" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true" Background="Red" Margin="5">
+ <Label Text="SCALED NOT PROPORTIONNAL" Width="150"/>
+ <Image KeepProportions="false" Background="Blue" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true" Background="Red" Margin="5">
+ <Label Text="UNSCALED" Width="150"/>
+ <Image Scaled="false" Background="Blue" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
+ </HorizontalStack>
+ <HorizontalStack Width="-1" Height="100" Background="Red" Margin="5">
+ <Image Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Margin="10" Background="White" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Background="White" Width="20" Height="10" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Margin="1" Background="White" Width="20" Height="10" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ </HorizontalStack>
+</VerticalStack>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack Background="Red" Width="-1" Height="-1">
+ <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"/>
+ <TextBox Width="300" Height="35" Text="this is a test of a text box"/>-->
+ <TextBox Font="droid,10" Name="tb2" Margin="0" Text="this is a test of a text box"/>
+ <TextBox Font="droid,10" Name="tb3" Margin="5" Text="this is a test of a text box"/>
+ <TextBox Font="droid,10" Name="tb4" Margin="5" Text="this is a test of a text box"/>
+ <TextBox Font="droid,10" Name="tb5" Margin="20" Text="this is a test of a text box"/>
+ <TextBox Multiline="true" Font="droid,10" Name="tb6" Margin="5" Text="this is a test of a text box\nthis is a test of a text box"/>
+ <TextBox Multiline="true" Font="droid,10" Name="tb7" Margin="1" TextAlignment="Center"
+ Text="this is a test of a text box\nthis is a test\nthis is a test when line are centered"/>
+ <TextBox Multiline="true" Font="droid,10" Name="tb8" Margin="1" TextAlignment="Center"
+ Text="this is a test of a text box\n\n\nthis is a test\nthis is a test when line are centered"/>
+</VerticalStack>
\ No newline at end of file
<?xml version="1.0"?>\r
<Window Left="10" Top="10" Title="Test window" \r
- Width="250" Height="300" >\r
- <VerticalStack Name="contentVSStack" Margin="10" Spacing="10">\r
+ Width="250" Height="550" >\r
+ <VerticalStack Name="contentVSStack" Margin="10" Spacing="10" Background="0,4;0,4;0,4;0,4">\r
<Slider Name="slider" Height="10" Width="0"/>\r
<GroupBox Caption="test" Height="-1" Width="-1" Margin="5">\r
<VerticalStack Height="-1" Width="0" >\r
<GraphicObject Width="0"/>\r
<CheckBox Height="-1" Width="80" IsChecked="true"/>\r
</HorizontalStack>\r
-\r
+<Border Fit="true" CornerRadius="5" BorderWidth="1">\r
+ <Container Name="MainGrp" Background="0,5;0,5;0,5;0,4" Width="120" Fit="true"\r
+ Margin="10" Focusable="True" >\r
+ <VerticalStack Fit="true" Name="vsFps" Spacing="10" >\r
+ <HorizontalStack Fit="true">\r
+ <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>\r
+ <Label Name="labUpdate" Text="{update}" Font="droid,12" Background="AoEnglish" Width="50" TextAlignment="Center"/>\r
+ </HorizontalStack>\r
+ <HorizontalStack Fit="true">\r
+ <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>\r
+ <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Background="AoEnglish" Width="50" TextAlignment="Center"/>\r
+ </HorizontalStack>\r
+ <HorizontalStack Fit="true">\r
+ <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>\r
+ <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>\r
+ </HorizontalStack>\r
+ <HorizontalStack Fit="true">\r
+ <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>\r
+ <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>\r
+ </HorizontalStack>\r
+ <HorizontalStack Fit="true">\r
+ <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>\r
+ <Label Text="{fpsMax}" Font="droid , 12" Background="AoEnglish" Width="50" TextAlignment="Center"/>\r
+ </HorizontalStack>\r
+ </VerticalStack> \r
+ </Container>\r
+</Border>\r
<!-- <Checkbox Height="-1" Width="-1" Background="Red" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>-->\r
</VerticalStack>\r
</Window>\r
<Window Name="window1" Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0,5;0,5;0,5;0,8" \r
Focusable="True" CornerRadius="20" MinimumSize="100;100" MaximumSize="500;500">\r
<Template>\r
- <Border BorderWidth="1" BorderColor="White" CornerRadius="20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
+ <Border BorderWidth="1" Foreground="White" CornerRadius="20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
<VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
- <Border BorderWidth="1" BorderColor="White" Width="{../../../TemplatedWidth}" Height="-1" \r
+ <Border BorderWidth="1" Foreground="White" Width="{../../../TemplatedWidth}" Height="-1" \r
Background="0,1;0,5;1,0;0,5">\r
<HorizontalStack Name="hs" Margin="1" Spacing="1" Width="{../../../../TemplatedWidth}" Height="-1" >\r
<GraphicObject Width="5"/>\r
<Image Margin="1" Width="12" Height="12" Path="{../../../../../Icon}"/>\r
<Label Foreground="White" Width="{../../../../../TemplatedWidth}" Margin="1" TextAlignment="Center" Text="{../../../../../Title}" />\r
- <Border CornerRadius="6" BorderWidth="1" BorderColor="Transparent" Height="12" Width="12"\r
- MouseEnter="{BorderColor=White}" MouseLeave="{BorderColor=Transparent}">\r
+ <Border CornerRadius="6" BorderWidth="1" Foreground="Transparent" Height="12" Width="12"\r
+ MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">\r
<Image Focusable="true" Name="Image" Margin="0" Width="0" Height="0" Path="#Crow.Images.Icons.exit2.svg"\r
MouseClick="../../../../../../butQuitPress"/>\r
</Border>\r
<VerticalStack Fit="true" Margin="50">\r
<Label Text="{MousePos}" Width="-1" Background="DarkGreen"/>\r
<Label Text="{Hover}" Width="-1" Background="DarkGreen"/>\r
- <Button Text="Clear" Width="150" MouseClick="OnClear"/>\r
+ <Button Caption="Clear" Width="150" MouseClick="OnClear"/>\r
<ListBox Data="{TestList}" Background="0,5;0,5;0,5;0,5"\r
HorizontalAlignment="Center" Width="-1" Height="150" Margin="5">\r
<Template>\r
</Border>\r
</Template>\r
</ListBox>\r
- <Button Text="Load list" Width="0" MouseClick="OnLoadList"/>\r
+ <Button Caption="Load list" Width="0" MouseClick="OnLoadList"/>\r
</VerticalStack>\r
</Border>
\ No newline at end of file
<Compile Include="..\bin\Debug\Interfaces\test_stack.goml.cs">
<Link>Interfaces\test_stack.goml.cs</Link>
</Compile>
- <Compile Include="..\bin\Debug\Interfaces\test4.goml.cs">
- <Link>Interfaces\test4.goml.cs</Link>
- </Compile>
</ItemGroup>
<ItemGroup>
<None Include="image\u.svg">
<None Include="Interfaces\1.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="Interfaces\testButton.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Interfaces\testImage.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Interfaces\testTextBox.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<ItemGroup>
<Folder Include="Interfaces\" />
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack Fit="true">
+ <HorizontalStack Fit="True">
+ <Button Caption="but" MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack> <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="True">
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ <Button MouseClick="onButClick"/>
+ </HorizontalStack>
+</VerticalStack>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack Fit="true">
+ <HorizontalStack Fit="true" Background="Red" Margin="5">
+ <Label Text="SCALED PROPORTIONNAL" Width="150"/>
+ <Image Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Margin="10" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Margin="10" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Margin="10" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Margin="10" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true" Background="Red" Margin="5">
+ <Label Text="SCALED NOT PROPORTIONNAL" Width="150"/>
+ <Image KeepProportions="false" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true" Background="Red" Margin="5">
+ <Label Text="UNSCALED" Width="150"/>
+ <Image Scaled="false" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="-1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true" Background="Red" Margin="5">
+ <Label Text="SCALED PROPORTIONNAL" Width="150"/>
+ <Image Background="Blue" Path="#Tests.image.tetra.png"/>
+ <Image Margin="10" Background="Blue" Path="#Tests.image.tetra.png"/>
+ <Image Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
+ <Image Margin="2" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
+ <Image Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
+ <Image Margin="10" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
+ <Image Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
+ <Image Margin="10" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
+ <Image Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
+ <Image Margin="10" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true" Background="Red" Margin="5">
+ <Label Text="SCALED NOT PROPORTIONNAL" Width="150"/>
+ <Image KeepProportions="false" Background="Blue" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
+ <Image KeepProportions="false" Margin="10" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true" Background="Red" Margin="5">
+ <Label Text="UNSCALED" Width="150"/>
+ <Image Scaled="false" Background="Blue" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Margin="2" Background="Blue" Width="20" Height="20" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="100" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Width="100" Height="50" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
+ <Image Scaled="false" Margin="10" Background="Blue" Width="50" Height="-1" Path="#Tests.image.tetra.png"/>
+ </HorizontalStack>
+</VerticalStack>
\ No newline at end of file
{\r
if (_activeWidget != null) {\r
//first, ensure object is still in the graphic tree\r
- if (_activeWidget.TopContainer == null) {\r
+ if (_activeWidget.HostContainer == null) {\r
activeWidget = null;\r
} else {\r
\r
\r
if (_hoverWidget != null) {\r
//first, ensure object is still in the graphic tree\r
- if (_hoverWidget.TopContainer == null) {\r
+ if (_hoverWidget.HostContainer == null) {\r
hoverWidget = null;\r
} else {\r
//check topmost graphicobject first\r
return;\r
}\r
\r
- _activeWidget.onMouseButtonUp (this, e);\r
+ _activeWidget.onMouseUp (this, e);\r
_activeWidget = null;\r
}\r
void Mouse_ButtonDown(object sender, MouseButtonEventArgs e)\r
}\r
\r
_activeWidget = g;\r
- _activeWidget.onMouseButtonDown (this, e);\r
+ _activeWidget.onMouseDown (this, e);\r
}\r
\r
void Mouse_WheelChanged(object sender, MouseWheelEventArgs e)\r
Rectangle ILayoutable.ClientRectangle {\r
get { return new Size(this.ClientRectangle.Size.Width,this.ClientRectangle.Size.Height); }\r
}\r
- public IGOLibHost TopContainer {\r
+ public IGOLibHost HostContainer {\r
get { return this; }\r
}\r
\r
<RootNamespace>UnitTest</RootNamespace>
<AssemblyName>UnitTest</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <ReleaseVersion>0.2</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<None Include="Interfaces\2.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="Interfaces\testButton.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Interfaces\testImage.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Crow.csproj">
float widthRatio = 1f;
float heightRatio = 1f;
- if (Scale){
+ if (Scaled){
widthRatio = (float)rect.Width / Dimensions.Width;
heightRatio = (float)rect.Height / Dimensions.Height;
}
- float ratio = Math.Min (widthRatio, heightRatio);
-
-// if (KeepProportions)
-// widthRatio = heightRatio = ratio;
+ if (KeepProportions) {
+ if (widthRatio < heightRatio)
+ heightRatio = widthRatio;
+ else
+ widthRatio = heightRatio;
+ }
- Rectangle rImg = rect;
gr.Save ();
- if (KeepProportions) {
- gr.Translate ((rect.Width - (float)Dimensions.Width * ratio)/2f,
- (rect.Height - (float)Dimensions.Height * ratio)/2f);
- gr.Scale (ratio, ratio);
-
- }else
- gr.Scale (widthRatio, heightRatio);
+ gr.Translate (rect.Left,rect.Top);
+ gr.Scale (widthRatio, heightRatio);
+ gr.Translate ((rect.Width/widthRatio - Dimensions.Width)/2, (rect.Height/heightRatio - Dimensions.Height)/2);
using (ImageSurface imgSurf = new ImageSurface (image, Format.Argb32,
Dimensions.Width, Dimensions.Height, 4 * Dimensions.Width)) {
- gr.SetSourceSurface (imgSurf, (int)(rImg.X / widthRatio), (int)(rImg.Y / heightRatio));
+ gr.SetSourceSurface (imgSurf, 0,0);
gr.Paint ();
}
gr.Restore ();
--- /dev/null
+using System;
+using OpenTK.Input;
+
+namespace Crow
+{
+ public class BubblingMouseButtonEventArg: MouseButtonEventArgs
+ {
+ public GraphicObject Focused;
+ public BubblingMouseButtonEventArg(MouseButtonEventArgs mbe) : base(mbe){
+
+ }
+ }
+}
+
ILayoutable tmp = Source.Instance as ILayoutable;
if (string.IsNullOrEmpty (bindingExp [0])) {
//if exp start with '/' => Graphic tree parsing start at top container
- tmp = tmp.TopContainer as ILayoutable;
+ tmp = tmp.HostContainer as ILayoutable;
ptr++;
}
while (ptr < bindingExp.Length - 1) {
#endregion
#region private fields
- Color _borderColor;
int _borderWidth;
#endregion
}
}
[XmlAttributeAttribute()][DefaultValue("White")]
- public virtual Color BorderColor {
- get { return _borderColor; }
- set {
- _borderColor = value;
- registerForGraphicUpdate ();
- }
+ public override Color Foreground {
+ get { return base.Foreground;}
+ set {base.Foreground = value;}
}
#endregion
if (BorderWidth > 0) {
gr.LineWidth = BorderWidth;
- gr.Color = BorderColor;
+ gr.Color = Foreground;
CairoHelpers.CairoRectangle(gr, rBack, CornerRadius);
gr.Stroke ();
}
\r
namespace Crow\r
{\r
- public class Button : Container, IXmlSerializable\r
+ [DefaultTemplate("#Crow.Templates.Button.crow")]\r
+ public class Button : TemplatedContainer\r
{\r
#region CTOR\r
public Button() : base()\r
{\r
//MouseEnter += delegate { Background = Color.RedDevil;};\r
//MouseLeave += delegate { Background = Color.Transparent;};\r
- MouseButtonDown += delegate { BackImgSub = "pressed"; registerForGraphicUpdate();};\r
- MouseButtonUp += delegate { BackImgSub = "normal";registerForGraphicUpdate();};\r
+// MouseButtonDown += delegate { BackImgSub = "pressed"; registerForGraphicUpdate();};\r
+// MouseButtonUp += delegate { BackImgSub = "normal";registerForGraphicUpdate();};\r
}\r
#endregion\r
\r
- #region GraphicObject Overrides\r
- [XmlAttributeAttribute()][DefaultValue(50)]\r
- public override int Width {\r
- get { return base.Width; }\r
- set { base.Width = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(20)]\r
- public override int Height {\r
- get { return base.Height; }\r
- set { base.Height = value; }\r
+ string caption;\r
+ string image;\r
+ Container _contentContainer;\r
+\r
+ public override GraphicObject Content {\r
+ get {\r
+ return _contentContainer == null ? null : _contentContainer.Child;\r
+ }\r
+ set {\r
+ if (_contentContainer != null) \r
+ _contentContainer.SetChild(value);\r
+ }\r
}\r
- [XmlAttributeAttribute()][DefaultValue("Transparent")]\r
- public override Color Background {\r
- get { return base.Background; }\r
- set { base.Background = value; }\r
+ protected override void loadTemplate(GraphicObject template = null)\r
+ {\r
+ base.loadTemplate (template);\r
+\r
+ _contentContainer = this.child.FindByName ("Content") as Container;\r
}\r
+\r
+ #region GraphicObject Overrides\r
+// [XmlAttributeAttribute()][DefaultValue(50)]\r
+// public override int Width {\r
+// get { return base.Width; }\r
+// set { base.Width = value; }\r
+// }\r
+// [XmlAttributeAttribute()][DefaultValue(20)]\r
+// public override int Height {\r
+// get { return base.Height; }\r
+// set { base.Height = value; }\r
+// }\r
[XmlAttributeAttribute()][DefaultValue(true)]\r
public override bool Focusable\r
{\r
get { return base.Focusable; }\r
set { base.Focusable = value; }\r
}\r
- [XmlAttributeAttribute()][DefaultValue("#Crow.Images.button.svg")]\r
- public override Picture BackgroundImage {\r
- get {\r
- return base.BackgroundImage;\r
- }\r
- set {\r
- base.BackgroundImage = value;\r
- BackImgSub = "normal";\r
- }\r
+ public override void ResolveBindings ()\r
+ {\r
+ base.ResolveBindings ();\r
+ if (Content != null)\r
+ Content.ResolveBindings ();\r
+ }\r
+ public override void onMouseDown (object sender, MouseButtonEventArgs e)\r
+ {\r
+ base.onMouseDown (sender, e);\r
+ NotifyValueChanged ("State", "pressed");\r
+ }\r
+ public override void onMouseUp (object sender, MouseButtonEventArgs e)\r
+ {\r
+ base.onMouseUp (sender, e);\r
+ NotifyValueChanged ("State", "normal");\r
}\r
#endregion\r
\r
- [XmlAttributeAttribute][DefaultValue("Button")]\r
- public string Text\r
- {\r
- get {\r
- Label l = Child as Label;\r
- return l == null ? "" : l.Text; \r
+ [XmlAttributeAttribute()][DefaultValue("Button")]\r
+ public string Caption {\r
+ get { return caption; } \r
+ set {\r
+ if (caption == value)\r
+ return;\r
+ caption = value; \r
+ NotifyValueChanged ("Caption", caption);\r
}\r
- set\r
- {\r
- Label l = Child as Label;\r
- if (l == null)\r
- this.SetChild(new Label (value) \r
- { \r
- TextAlignment = Alignment.Center,\r
- Foreground = Color.Black\r
- });\r
- else\r
- l.Text = value;\r
+ } \r
+ [XmlAttributeAttribute()][DefaultValue("#Crow.Images.button.svg")]\r
+ public string Image {\r
+ get { return image; } \r
+ set {\r
+ if (image == value)\r
+ return;\r
+ image = value; \r
+ NotifyValueChanged ("Image", image);\r
}\r
- } \r
+ } \r
}\r
}\r
\r
public virtual void onPop(object sender, EventArgs e)\r
{\r
- IGOLibHost tc = TopContainer;\r
+ IGOLibHost tc = HostContainer;\r
if (tc == null)\r
return;\r
if (Overlay != null) {\r
}\r
public virtual void onUnpop(object sender, EventArgs e)\r
{\r
- IGOLibHost tc = TopContainer;\r
+ IGOLibHost tc = HostContainer;\r
if (tc == null)\r
return;\r
Overlay.Visible = false;\r
}\r
public virtual void ComputeChildrenPositions()\r
{\r
+ #if DEBUG_LAYOUTING\r
+ Debug.WriteLine("ComputeChildrenPosition: " + this.ToString());\r
+ #endif\r
int d = 0;\r
if (Orientation == Orientation.Horizontal) {\r
foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {\r
int _margin = 0;\r
bool _focusable = false;\r
bool _hasFocus = false;\r
+ bool _mouseRepeat;\r
protected bool _isVisible = true;\r
VerticalAlignment _verticalAlignment = VerticalAlignment.Center;\r
HorizontalAlignment _horizontalAlignment = HorizontalAlignment.Center;\r
#endregion\r
\r
#region ILayoutable\r
+ //TODO: it would save the recurent cost of a cast in event bubbling if parent type was GraphicObject\r
+ // or we could add to the interface the mouse events\r
[XmlIgnore]public ILayoutable Parent { \r
get { return _parent; }\r
set {\r
return cb;\r
}\r
}\r
- [XmlIgnore]public virtual IGOLibHost TopContainer {\r
- get { return Parent == null ? null : Parent.TopContainer; }\r
+ [XmlIgnore]public virtual IGOLibHost HostContainer {\r
+ get { return Parent == null ? null : Parent.HostContainer; }\r
}\r
public virtual Rectangle ContextCoordinates(Rectangle r){\r
return\r
\r
#region EVENT HANDLERS\r
public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;\r
- public event EventHandler<MouseButtonEventArgs> MouseButtonUp;\r
- public event EventHandler<MouseButtonEventArgs> MouseButtonDown;\r
+ public event EventHandler<MouseButtonEventArgs> MouseUp;\r
+ public event EventHandler<MouseButtonEventArgs> MouseDown;\r
public event EventHandler<MouseButtonEventArgs> MouseClick;\r
public event EventHandler<MouseMoveEventArgs> MouseMove;\r
public event EventHandler<MouseMoveEventArgs> MouseEnter;\r
}\r
[XmlAttributeAttribute()][DefaultValue(false)]\r
public virtual bool Focusable {\r
- get { return _focusable | Interface.DesignerMode; }\r
- set { _focusable = value; }\r
- } \r
+ get { return _focusable; }\r
+ set {\r
+ if (_focusable == value)\r
+ return;\r
+ _focusable = value; \r
+ NotifyValueChanged ("Focusable", _focusable);\r
+ }\r
+ }\r
+ [XmlIgnore]public virtual bool HasFocus {\r
+ get { return _hasFocus; }\r
+ set { \r
+ if (value == _hasFocus)\r
+ return;\r
+\r
+ _hasFocus = value; \r
+ NotifyValueChanged ("HasFocus", _hasFocus);\r
+ }\r
+ }\r
+ [XmlAttributeAttribute()][DefaultValue(false)]\r
+ public virtual bool MouseRepeat {\r
+ get { return _mouseRepeat; }\r
+ set {\r
+ if (_mouseRepeat == value)\r
+ return;\r
+ _mouseRepeat = value; \r
+ NotifyValueChanged ("MouseRepeat", _mouseRepeat);\r
+ }\r
+ } \r
[XmlAttributeAttribute()][DefaultValue("Transparent")]\r
public virtual Color Background {\r
get { return _background; }\r
set {\r
- _background = value;\r
+ if (_background == value)\r
+ return;\r
+ _background = value; \r
+ NotifyValueChanged ("Background", _background);\r
registerForGraphicUpdate ();\r
}\r
- }\r
+ } \r
[XmlAttributeAttribute()][DefaultValue("White")]\r
public virtual Color Foreground {\r
get { return _foreground; }\r
set {\r
- _foreground = value;\r
+ if (_foreground == value)\r
+ return;\r
+ _foreground = value; \r
+ NotifyValueChanged ("Foreground", _foreground);\r
registerForGraphicUpdate ();\r
}\r
- }\r
+ } \r
[XmlAttributeAttribute()][DefaultValue("droid,10")]\r
public virtual Font Font {\r
get { return _font; }\r
- set { _font = value; }\r
+ set { \r
+ if (value == _font)\r
+ return; \r
+ _font = value; \r
+ NotifyValueChanged ("Font", _font);\r
+ registerForGraphicUpdate ();\r
+ }\r
}\r
[XmlAttributeAttribute()][DefaultValue(0.0)]\r
public virtual double CornerRadius {\r
get { return _cornerRadius; }\r
set {\r
- _cornerRadius = value;\r
+ if (value == _cornerRadius)\r
+ return; \r
+ _cornerRadius = value; \r
+ NotifyValueChanged ("CornerRadius", _cornerRadius);\r
registerForGraphicUpdate ();\r
}\r
}\r
public virtual int Margin {\r
get { return _margin; }\r
set {\r
- _margin = value;\r
+ if (value == _margin)\r
+ return; \r
+ _margin = value; \r
+ NotifyValueChanged ("Margin", _margin);\r
registerForGraphicUpdate ();\r
}\r
}\r
\r
_isVisible = value;\r
\r
- if (TopContainer == null)\r
+ if (HostContainer == null)\r
return;\r
//add slot to clipping to redraw\r
- TopContainer.gobjsToRedraw.Add (this);\r
+ HostContainer.gobjsToRedraw.Add (this);\r
\r
//ensure main win doesn't keep hidden childrens ref\r
- if (this.Contains (TopContainer.hoverWidget))\r
- TopContainer.hoverWidget = null;\r
+ if (this.Contains (HostContainer.hoverWidget))\r
+ HostContainer.hoverWidget = null;\r
if (Parent is GenericStack)\r
Parent.RegisterForLayouting ((int)LayoutingType.Sizing | (int)LayoutingType.PositionChildren);\r
-// Parent.InvalidateLayout ();\r
- //else\r
- // registerForRedraw();\r
+\r
+ NotifyValueChanged ("Visible", _isVisible);\r
}\r
}\r
- [XmlIgnore]public virtual bool HasFocus {\r
- get { return _hasFocus; }\r
- set { _hasFocus = value; }\r
- }\r
//TODO: only used in group, should be removed from base go object\r
[XmlIgnore]public virtual bool DrawingIsValid\r
{ get { return bmp == null ? \r
public virtual void registerForGraphicUpdate ()\r
{\r
bmp = null;\r
- if (TopContainer != null)\r
- TopContainer.gobjsToRedraw.Add (this);\r
+ if (HostContainer != null)\r
+ HostContainer.gobjsToRedraw.Add (this);\r
}\r
/// <summary>\r
/// Add clipping region in redraw list of interface, dont update cached object content\r
/// </summary>\r
public virtual void RegisterForRedraw ()\r
{\r
- if (TopContainer != null)\r
- TopContainer.gobjsToRedraw.Add (this);\r
+ if (HostContainer != null)\r
+ HostContainer.gobjsToRedraw.Add (this);\r
}\r
\r
/// <summary>\r
\r
public virtual void registerClipRect()\r
{\r
- TopContainer.redrawClip.AddRectangle (ScreenCoordinates(Slot));\r
+ HostContainer.redrawClip.AddRectangle (ScreenCoordinates(Slot));\r
//this clipping should take only last painted slots in ancestor tree which\r
//is not the case for now.\r
- TopContainer.redrawClip.AddRectangle (ScreenCoordinates(LastPaintedSlot));\r
+ HostContainer.redrawClip.AddRectangle (ScreenCoordinates(LastPaintedSlot));\r
}\r
/// <summary> return size of content + margins </summary>\r
protected virtual Size measureRawSize ()\r
}\r
public virtual void checkHoverWidget(MouseMoveEventArgs e)\r
{\r
- IGOLibHost glh = TopContainer;\r
+ IGOLibHost glh = HostContainer;\r
if (glh.hoverWidget != this) {\r
glh.hoverWidget = this;\r
onMouseEnter (this, e);\r
\r
MouseMove.Raise (sender, e);\r
}\r
- public virtual void onMouseButtonUp(object sender, MouseButtonEventArgs e){\r
- if (MouseIsIn (e.Position))\r
- onMouseClick (sender, e);\r
-\r
- MouseButtonUp.Raise (this, e);\r
+ public virtual void onMouseDown(object sender, MouseButtonEventArgs e){\r
+ IGOLibHost hc = HostContainer;\r
+ if (hc.activeWidget == null)\r
+ hc.activeWidget = this;\r
+ if (this.Focusable && !Interface.FocusOnHover) {\r
+ BubblingMouseButtonEventArg be = e as BubblingMouseButtonEventArg;\r
+ if (be.Focused == null) {\r
+ be.Focused = this;\r
+ hc.FocusedWidget = this;\r
+ }\r
+ }\r
+ //bubble event to the top\r
+ GraphicObject p = Parent as GraphicObject;\r
+ if (p != null)\r
+ p.onMouseDown(sender,e);\r
+ \r
+ MouseDown.Raise (this, e);\r
}\r
- public virtual void onMouseButtonDown(object sender, MouseButtonEventArgs e){\r
- TopContainer.FocusedWidget = this;\r
+ public virtual void onMouseUp(object sender, MouseButtonEventArgs e){\r
+ //bubble event to the top\r
+ GraphicObject p = Parent as GraphicObject;\r
+ if (p != null)\r
+ p.onMouseUp(sender,e);\r
\r
- MouseButtonDown.Raise (this, e);\r
+ MouseUp.Raise (this, e);\r
+\r
+ if (MouseIsIn (e.Position)&&HasFocus)\r
+ onMouseClick(sender,e);\r
}\r
- public virtual void onMouseClick(object sender, MouseButtonEventArgs e){ \r
- MouseClick.Raise (this,e);\r
+ public virtual void onMouseClick(object sender, MouseButtonEventArgs e){ \r
+ MouseClick.Raise (this, e);\r
}\r
public virtual void onMouseWheel(object sender, MouseWheelEventArgs e){\r
GraphicObject p = Parent as GraphicObject;\r
GraphicObject lopObj = this; //default left operand base object is \r
//the first arg (object sender) of the event handler\r
\r
+ il.Emit(OpCodes.Ldarg_0); //load sender ref onto the stack\r
+\r
string[] lopParts = lop.Split (new char[] { '.' });\r
- if (lopParts.Length == 2) {//should search also for member of es.Source\r
- lopObj = this.FindByName (lopParts [0]);\r
- if (lopObj==null)\r
- throw new Exception (string.Format("GOML:Unknown name: {0}", lopParts[0]));\r
- //TODO: should create private member holding ref of lopObj, and emit\r
- //a call to FindByName(lopObjName) during #ctor or in a onLoad func or evt handler\r
- throw new Exception (string.Format("GOML:obj tree ref not yet implemented", lopParts[0]));\r
- }else\r
- il.Emit(OpCodes.Ldarg_0); //load sender ref onto the stack\r
+ if (lopParts.Length > 1) {//should search also for member of es.Source\r
+ MethodInfo FindByNameMi = typeof(GraphicObject).GetMethod("FindByName");\r
+ for (int j = 0; j < lopParts.Length - 1; j++) {\r
+ il.Emit (OpCodes.Ldstr, lopParts[j]);\r
+ il.Emit(OpCodes.Callvirt, FindByNameMi);\r
+ }\r
+ }\r
\r
int i = lopParts.Length -1;\r
\r
- MemberInfo lopMbi = lopObj.GetType().GetMember (lopParts[i])[0];\r
+ MemberInfo[] lopMbis = lopObj.GetType().GetMember (lopParts[i]);\r
+\r
+ if (lopMbis.Length<1)\r
+ throw new Exception (string.Format("CROW BINDING: Member not found '{0}'", lop));\r
+ \r
OpCode lopSetOC;\r
dynamic lopSetMbi;\r
Type lopT = null;\r
- switch (lopMbi.MemberType) {\r
+ switch (lopMbis[0].MemberType) {\r
case MemberTypes.Property:\r
PropertyInfo lopPi = sourceType.GetProperty (lopParts[i]);\r
MethodInfo dstMi = lopPi.GetSetMethod ();\r
#region Mouse handling\r
public override void checkHoverWidget (OpenTK.Input.MouseMoveEventArgs e)\r
{\r
- if (TopContainer.hoverWidget != this) {\r
- TopContainer.hoverWidget = this;\r
+ if (HostContainer.hoverWidget != this) {\r
+ HostContainer.hoverWidget = this;\r
onMouseEnter (this, e);\r
}\r
foreach (GraphicObject g in Children)\r
Rectangle getSlot();
Rectangle getBounds();
- IGOLibHost TopContainer { get; }
+ IGOLibHost HostContainer { get; }
void RegisterForLayouting(int layoutType);
void UpdateLayout(LayoutingType layoutType);
{\r
Picture _pic;\r
string _svgSub;\r
-\r
+ bool scaled;\r
+ [XmlAttributeAttribute()][DefaultValue(true)]\r
+ public virtual bool Scaled {\r
+ get { return scaled; }\r
+ set {\r
+ if (scaled == value)\r
+ return;\r
+ scaled = value; \r
+ NotifyValueChanged ("Scaled", scaled);\r
+ if (_pic == null)\r
+ return;\r
+ _pic.Scaled = scaled;\r
+ registerForGraphicUpdate ();\r
+ }\r
+ } \r
+ bool keepProps;\r
+ [XmlAttributeAttribute()][DefaultValue(true)]\r
+ public virtual bool KeepProportions {\r
+ get { return keepProps; }\r
+ set {\r
+ if (keepProps == value)\r
+ return;\r
+ keepProps = value; \r
+ NotifyValueChanged ("KeepProportions", keepProps);\r
+ if (_pic == null)\r
+ return;\r
+ _pic.KeepProportions = keepProps;\r
+ registerForGraphicUpdate ();\r
+ }\r
+ } \r
[XmlAttributeAttribute("Path")] \r
public string Path {\r
get { return _pic == null ? null : _pic.Path; }\r
return;\r
}\r
LoadImage (value);\r
- _pic.KeepProportions = true;\r
+ _pic.Scaled = scaled;\r
+ _pic.KeepProportions = keepProps;\r
} catch (Exception ex) {\r
Debug.WriteLine (ex.Message);\r
_pic = null;\r
public Image () : base()\r
{\r
}\r
- public Image (string _imgPath, Rectangle _bounds)\r
- : base(_bounds)\r
- { \r
- LoadImage(_imgPath);\r
- }\r
- public Image (string _imgPath)\r
- : base()\r
- { \r
- LoadImage(_imgPath);\r
- }\r
-// public Image (System.Drawing.Bitmap _bitmap)\r
-// : base()\r
-// {\r
-// _pic = new BmpPicture ();\r
-//\r
-// LoadImage (_bitmap);\r
-// }\r
#endregion\r
\r
#region Image Loading\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
+ Point mouseLocalPos = -1;//mouse coord in widget space, filled only when clicked \r
int _currentCol; //0 based cursor position in string\r
int _currentLine;\r
+ Point _selBegin = -1; //selection start (row,column)\r
+ Point _selRelease = -1; //selection end (row,column)\r
double textCursorPos; //cursor position in cairo units in widget client coord.\r
double SelStartCursorPos = -1;\r
double SelEndCursorPos = -1;\r
public virtual Color SelectionBackground {\r
get { return selColor; }\r
set {\r
+ if (value == selColor)\r
+ return;\r
selColor = value;\r
+ NotifyValueChanged ("SelectionBackground", selColor);\r
registerForGraphicUpdate ();\r
}\r
}\r
- [XmlAttributeAttribute()][DefaultValue("Black")]\r
+ [XmlAttributeAttribute()][DefaultValue("DarkGray")]\r
public virtual Color SelectionForeground {\r
get { return selFontColor; }\r
set {\r
+ if (value == selFontColor)\r
+ return;\r
selFontColor = value;\r
+ NotifyValueChanged ("SelectionForeground", selFontColor);\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
{\r
{\r
if (_text == value)\r
return;\r
- \r
- registerForGraphicUpdate();\r
- this.RegisterForLayouting ((int)LayoutingType.Sizing);\r
-\r
-\r
+ \r
_text = value;\r
\r
if (string.IsNullOrEmpty(_text))\r
_text = "";\r
\r
lines = getLines;\r
+\r
+ //registerForGraphicUpdate();\r
+ this.RegisterForLayouting ((int)LayoutingType.Sizing);\r
+ NotifyValueChanged ("Text", Text);\r
}\r
}\r
- [XmlAttributeAttribute()][DefaultValue("droid,10")]\r
- public Font Font {\r
- get { return _font; }\r
- set { _font = value; }\r
- }\r
[XmlAttributeAttribute()][DefaultValue(false)]\r
public bool Multiline\r
{\r
else if (value > lines [_currentLine].Count ())\r
_currentCol = lines [_currentLine].Count ();\r
else\r
- _currentCol = value; \r
+ _currentCol = value;\r
}\r
}\r
[XmlIgnore]public int currentLine{\r
_currentLine = value; \r
}\r
}\r
- [XmlIgnore]protected Point selBegin;\r
- [XmlIgnore]protected Point selRelease;\r
+\r
+ [XmlIgnore]public Point SelBegin {\r
+ get {\r
+ return _selBegin;\r
+ }\r
+ set {\r
+ if (value == _selBegin)\r
+ return;\r
+ _selBegin = value;\r
+ NotifyValueChanged ("SelectedText", SelectedText);\r
+ }\r
+ } \r
+ [XmlIgnore]public Point SelRelease {\r
+ get {\r
+ return _selRelease;\r
+ }\r
+ set {\r
+ if (value == _selRelease)\r
+ return;\r
+ _selRelease = value;\r
+ NotifyValueChanged ("SelectedText", SelectedText);\r
+ }\r
+ }\r
+\r
[XmlIgnore]protected Point selectionStart //ordered selection start and end positions\r
{\r
get { \r
- return selRelease < 0 || selBegin.Y < selRelease.Y ? selBegin : \r
- selBegin.Y > selRelease.Y ? selRelease :\r
- selBegin.X < selRelease.X ? selBegin : selRelease;\r
+ return SelRelease < 0 || SelBegin.Y < SelRelease.Y ? SelBegin : \r
+ SelBegin.Y > SelRelease.Y ? SelRelease :\r
+ SelBegin.X < SelRelease.X ? SelBegin : SelRelease;\r
}\r
}\r
[XmlIgnore]public Point selectionEnd\r
{ \r
get { \r
- return selRelease < 0 || selBegin.Y > selRelease.Y ? selBegin : \r
- selBegin.Y < selRelease.Y ? selRelease :\r
- selBegin.X > selRelease.X ? selBegin : selRelease;\r
+ return SelRelease < 0 || SelBegin.Y > SelRelease.Y ? SelBegin : \r
+ SelBegin.Y < SelRelease.Y ? SelRelease :\r
+ SelBegin.X > SelRelease.X ? SelBegin : SelRelease;\r
} \r
}\r
- [XmlIgnore]public string selectedText\r
+ [XmlIgnore]public string SelectedText\r
{ \r
- get { \r
- return null; \r
- //selectionEnd < 0 ? null : \r
- //Text.Substring(selectionStart, selectionEnd - selectionStart); \r
+ get {\r
+ \r
+ if (SelRelease < 0 || SelBegin < 0)\r
+ return "";\r
+ if (selectionStart.Y == selectionEnd.Y)\r
+ return lines [selectionStart.Y].Substring (selectionStart.X, selectionEnd.X - selectionStart.X);\r
+ string tmp = "";\r
+ tmp = lines [selectionStart.Y].Substring (selectionStart.X);\r
+ for (int l = selectionStart.Y + 1; l < selectionEnd.Y; l++) {\r
+ tmp += Interface.LineBreak + lines [l];\r
+ }\r
+ tmp += Interface.LineBreak + lines [selectionEnd.Y].Substring (0, selectionEnd.X);\r
+ return tmp;\r
} \r
}\r
[XmlIgnore]public bool selectionIsEmpty\r
- { get { return selRelease < 0; } }\r
+ { get { return SelRelease < 0; } }\r
\r
List<string> lines;\r
List<string> getLines {\r
get { \r
return _multiline ?\r
- Regex.Split (_text, "\r\n|\r|\n").ToList() :\r
+ Regex.Split (_text, "\r\n|\r|\n|" + @"\\n").ToList() :\r
new List<string>(new string[] { _text });\r
}\r
}\r
} else \r
lines [l] = lines [l].Remove (selectionStart.X, selectionEnd.X - selectionStart.X);\r
currentCol = selectionStart.X;\r
- selBegin = -1;\r
- selRelease = -1;\r
+ SelBegin = -1;\r
+ SelRelease = -1;\r
}\r
}\r
/// <summary>\r
break;\r
}\r
}\r
+ OpenTKGameWindow.currentWindow.CursorVisible = true;\r
\r
#region draw text cursor\r
- if (mouseLocalPos > 0)\r
+ if (mouseLocalPos >= 0)\r
{\r
computeTextCursor(gr);\r
\r
if (SelectionInProgress)\r
{\r
- selRelease = new Point(currentCol, currentLine);\r
- SelEndCursorPos = textCursorPos;\r
+ if (SelBegin < 0){\r
+ SelBegin = new Point(currentCol, currentLine);\r
+ SelStartCursorPos = textCursorPos;\r
+ SelRelease = -1;\r
+ }else{\r
+ SelRelease = new Point(currentCol, currentLine);\r
+ if (SelRelease == SelBegin)\r
+ SelRelease = -1;\r
+ else\r
+ SelEndCursorPos = textCursorPos;\r
+ } \r
}\r
- else if (selBegin < 0)\r
- {\r
- selBegin = new Point(currentCol, currentLine);\r
- SelStartCursorPos = textCursorPos;\r
- selRelease = -1;\r
- }\r
- else\r
- computeTextCursorPosition(gr);\r
- }\r
- else\r
+ }else\r
computeTextCursorPosition(gr);\r
\r
- if (HasFocus && Selectable)\r
+\r
+ #endregion\r
+\r
+ //*******************\r
+ //debug selection\r
+ if (SelRelease >= 0) {\r
+ gr.Color = Color.Green;\r
+ Rectangle R = new Rectangle (\r
+ rText.X + (int)SelEndCursorPos - 2,\r
+ rText.Y + (int)(SelRelease.Y * fe.Height), \r
+ 4, \r
+ (int)fe.Height);\r
+ gr.Rectangle (R);\r
+ gr.Fill ();\r
+ }\r
+ if (SelBegin >= 0) {\r
+ gr.Color = Color.UnmellowYellow;\r
+ Rectangle R = new Rectangle (\r
+ rText.X + (int)SelStartCursorPos - 2,\r
+ rText.Y + (int)(SelBegin.Y * fe.Height), \r
+ 4, \r
+ (int)fe.Height);\r
+ gr.Rectangle (R);\r
+ gr.Fill ();\r
+ }\r
+ //*******************\r
+ if (HasFocus )\r
{\r
//TODO:\r
- gr.Color = Foreground;\r
+ gr.SetSourceColor(Foreground);\r
gr.LineWidth = 1.5;\r
gr.MoveTo(new PointD(textCursorPos + rText.X, rText.Y + currentLine * fe.Height));\r
gr.LineTo(new PointD(textCursorPos + rText.X, rText.Y + (currentLine + 1) * fe.Height));\r
gr.Stroke();\r
}\r
- #endregion\r
-\r
- //*******************\r
- //debug selection\r
-// gr.Color = Color.Green;\r
-// Rectangle R = new Rectangle(\r
-// rText.X + (int)SelEndCursorPos-10,\r
-// rText.Y + (int)(selRelease.Y * fe.Height), \r
-// 20, \r
-// (int)fe.Height);\r
-// gr.Rectangle(R);\r
-// gr.Fill();\r
-// gr.Color = Color.UnmellowYellow;\r
-// R = new Rectangle(\r
-// rText.X + (int)SelStartCursorPos-10,\r
-// rText.Y + (int)(selBegin.Y * fe.Height), \r
-// 20, \r
-// (int)fe.Height);\r
-// gr.Rectangle(R);\r
-// gr.Fill();\r
- //*******************\r
-\r
gr.FontMatrix = new Matrix(widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0);\r
-\r
+ OpenTKGameWindow.currentWindow.CursorVisible = true;\r
for (int i = 0; i < lines.Count; i++) { \r
string l = lines [i].Replace ("\t", new String (' ', Interface.TabSize));\r
- if (selRelease >= 0 && i >= selectionStart.Y && i <= selectionEnd.Y) { \r
- gr.Color = selColor;\r
- int lineLength = (int)gr.TextExtents (l).XAdvance;\r
- Rectangle selRect = new Rectangle (\r
- rText.X,\r
- rText.Y + (int)(i * fe.Height), \r
- lineLength, \r
- (int)fe.Height);\r
+ int lineLength = (int)gr.TextExtents (l).XAdvance;\r
+ Rectangle lineRect = new Rectangle (\r
+ rText.X,\r
+ rText.Y + (int)(i * fe.Height), \r
+ lineLength, \r
+ (int)fe.Height);\r
+\r
+// if (TextAlignment == Alignment.Center ||\r
+// TextAlignment == Alignment.TopCenter ||\r
+// TextAlignment == Alignment.BottomCenter)\r
+// lineRect.X += (rText.Width - lineLength) / 2;\r
+// else if (TextAlignment == Alignment.RightCenter ||\r
+// TextAlignment == Alignment.TopRight ||\r
+// TextAlignment == Alignment.BottomRight)\r
+// lineRect.X += (rText.Width - lineLength);\r
+ \r
+ if (SelRelease >= 0 && i >= selectionStart.Y && i <= selectionEnd.Y) { \r
+ gr.SetSourceColor(selColor);\r
+\r
+ Rectangle selRect = lineRect ;\r
\r
int cpStart = (int)SelStartCursorPos,\r
cpEnd = (int)SelEndCursorPos;\r
\r
- if (selBegin.Y > selRelease.Y) {\r
+ if (SelBegin.Y > SelRelease.Y) {\r
cpStart = cpEnd;\r
cpEnd = (int)SelStartCursorPos;\r
}\r
\r
if (string.IsNullOrWhiteSpace (l))\r
continue;\r
- \r
-// double t = rText.Y;\r
-// gr.LineWidth = 1;\r
-// gr.Color = Color.Green;\r
-// gr.MoveTo (rText.X, t);\r
-// gr.LineTo (rText.X + rText.Width, t);\r
-// gr.Stroke ();\r
-// gr.MoveTo (rText.X, t + rText.Height);\r
-// gr.LineTo (rText.X + rText.Width, t + rText.Height);\r
-// gr.Stroke ();\r
-// gr.Rectangle (rText);\r
-// gr.Fill ();\r
-//\r
-// t += fe.Ascent;\r
-// gr.Color = Color.Red;\r
-// gr.MoveTo (rText.X, t);\r
-// gr.LineTo (rText.X + rText.Width, t);\r
-// gr.Stroke ();\r
-\r
- gr.Color = Foreground; \r
- gr.MoveTo (rText.X, rText.Y + fe.Ascent + fe.Height * i);\r
+\r
+ gr.SetSourceColor(Foreground); \r
+ gr.MoveTo (lineRect.X, rText.Y + fe.Ascent + fe.Height * i);\r
\r
#if _WIN32 || _WIN64\r
gr.ShowText(l.ToUtf8());\r
gr.ShowText (l);\r
#endif\r
gr.Fill ();\r
-\r
- } \r
+ }\r
}\r
#endregion\r
\r
#region Mouse handling\r
- public override void onMouseEnter (object sender, MouseMoveEventArgs e)\r
+ void updatemouseLocalPos(Point mpos){\r
+ mouseLocalPos = mpos - ScreenCoordinates(Slot).TopLeft - ClientRectangle.TopLeft;\r
+ if (mouseLocalPos.X < 0)\r
+ mouseLocalPos.X = 0;\r
+ if (mouseLocalPos.Y < 0)\r
+ mouseLocalPos.Y = 0;\r
+ }\r
+ public override void onFocused (object sender, EventArgs e)\r
{\r
- // SelectionInProgress = true; \r
- // mouseLocalPos = e.Position - ScreenCoordBounds.TopLeft - rText.TopLeft;\r
- // registerForGraphicUpdate();\r
+ base.onFocused (sender, e);\r
\r
- base.onMouseEnter (sender, e);\r
+ SelBegin = new Point(0,0);\r
+ SelRelease = new Point (lines.LastOrDefault ().Length, lines.Count-1);\r
+ OpenTKGameWindow.currentWindow.CursorVisible = true;\r
+ registerForGraphicUpdate ();\r
+ Debug.WriteLine("focused:", this.ToString());\r
}\r
- public override void onMouseLeave (object sender, MouseMoveEventArgs e)\r
+ public override void onUnfocused (object sender, EventArgs e)\r
{\r
- base.onMouseLeave (sender, e);\r
+ base.onUnfocused (sender, e);\r
+\r
+ SelBegin = -1;\r
+ SelRelease = -1;\r
+\r
+ registerForGraphicUpdate ();\r
+ Debug.WriteLine("unfocused:", this.ToString());\r
}\r
public override void onMouseMove (object sender, MouseMoveEventArgs e)\r
{\r
base.onMouseMove (sender, e);\r
\r
- IGOLibHost glh = TopContainer;\r
- if (glh.activeWidget != this)\r
- return;\r
- if (!Selectable)\r
+ if (!(SelectionInProgress && HasFocus))\r
return;\r
- \r
- SelectionInProgress = true;\r
- mouseLocalPos = e.Position - ScreenCoordinates(ClientRectangle).TopLeft;\r
+\r
+ updatemouseLocalPos (e.Position);\r
+\r
registerForGraphicUpdate();\r
}\r
- public override void onMouseButtonDown (object sender, MouseButtonEventArgs e)\r
- {\r
- if (this.HasFocus && Selectable){\r
- mouseLocalPos = e.Position - ScreenCoordinates(ClientRectangle).TopLeft;\r
- selBegin = -1;\r
- selRelease = -1;\r
- }else{\r
-// selBeginPos = 0;\r
-// selReleasePos = new Point(lines[lines.Count].Length-1, lines.Count-1);\r
- } \r
+ public override void onMouseDown (object sender, MouseButtonEventArgs e)\r
+ { \r
+ if (this.HasFocus){\r
+ updatemouseLocalPos (e.Position);\r
+ SelBegin = -1;\r
+ SelRelease = -1;\r
+ SelectionInProgress = true;\r
+ } \r
\r
//done at the end to set 'hasFocus' value after testing it\r
- base.onMouseButtonDown (sender, e);\r
+ base.onMouseDown (sender, e);\r
\r
registerForGraphicUpdate();\r
}\r
- public override void onMouseButtonUp (object sender, MouseButtonEventArgs e)\r
+ public override void onMouseUp (object sender, MouseButtonEventArgs e)\r
{\r
- base.onMouseButtonUp (sender, e);\r
+ base.onMouseUp (sender, e);\r
+\r
+ if (!SelectionInProgress)\r
+ return;\r
+ \r
+ updatemouseLocalPos (e.Position);\r
SelectionInProgress = false;\r
+ registerForGraphicUpdate ();\r
}\r
#endregion\r
-\r
-\r
+ /// <summary>\r
+ /// Update Current Column, line and TextCursorPos\r
+ /// from mouseLocalPos\r
+ /// </summary>\r
void computeTextCursor(Context gr)\r
- {\r
- //FontExtents fe = gr.FontExtents;\r
+ { \r
TextExtents te;\r
\r
double cPos = 0f;\r
//reset mouseLocalPos\r
mouseLocalPos = -1;\r
}\r
+ /// <summary> Computes offsets in cairo units </summary>\r
void computeTextCursorPosition(Context gr)\r
{ \r
- TextExtents te;\r
-\r
- double cPos = 0f;\r
-\r
- int limit = currentCol;\r
-\r
- if (selectionEnd > 0)\r
- limit = Math.Max(currentCol, selectionEnd.X);\r
-\r
- for (int i = 0; i <= limit; i++)\r
- {\r
- if (i == currentCol)\r
- textCursorPos = cPos;\r
- if (i == selectionStart.X)\r
- SelStartCursorPos = cPos;\r
- if (i == selectionEnd.X)\r
- SelEndCursorPos = cPos;\r
-\r
- if (i < lines[currentLine].Length)\r
- {\r
- string c = lines [currentLine].Substring (i, 1);\r
- if (c == "\t")\r
- c = new string (' ', Interface.TabSize);\r
- #if _WIN32 || _WIN64\r
- byte[] c = System.Text.UTF8Encoding.UTF8.GetBytes(Text.Substring(i, 1));\r
- te = gr.TextExtents(c);\r
- #elif __linux__\r
- te = gr.TextExtents(c);\r
- #endif\r
- cPos += te.XAdvance;\r
- }\r
+ if (SelBegin >= 0)\r
+ SelStartCursorPos = GetXFromTextPointer (gr, SelBegin);\r
+ if (SelRelease >= 0)\r
+ SelEndCursorPos = GetXFromTextPointer (gr, SelRelease);\r
+ textCursorPos = GetXFromTextPointer (gr, new Point(currentCol, currentLine));\r
+ }\r
+ /// <summary> Compute x offset in cairo unit from text position </summary>\r
+ double GetXFromTextPointer(Context gr, Point pos)\r
+ {\r
+ try {\r
+ string l = lines [pos.Y].Substring (0, pos.X).\r
+ Replace ("\t", new String (' ', Interface.TabSize));\r
+ return gr.TextExtents (l).XAdvance;\r
+ } catch (Exception ex) {\r
+ return -1;\r
}\r
-\r
- } \r
+ }\r
}\r
}\r
public NumericControl(double minimum, double maximum, double step)
: base()
{
- minValue = minimum;
- maxValue = maximum;
- smallStep = step;
- bigStep = step * 5;
}
#endregion
\r
public virtual void onPop(object sender, EventArgs e)\r
{\r
- IGOLibHost tc = TopContainer;\r
+ IGOLibHost tc = HostContainer;\r
if (tc == null)\r
return;\r
if (Content != null) {\r
}\r
public virtual void onUnpop(object sender, EventArgs e)\r
{\r
- IGOLibHost tc = TopContainer;\r
+ IGOLibHost tc = HostContainer;\r
if (tc == null)\r
return;\r
Content.Visible = false;\r
\r
public override void registerClipRect ()\r
{\r
- TopContainer.redrawClip.AddRectangle (base.ScreenCoordinates(Slot));\r
+ HostContainer.redrawClip.AddRectangle (base.ScreenCoordinates(Slot));\r
}\r
\r
public override void Paint(ref Cairo.Context ctx, Rectangles clip = null)\r
}\r
\r
#region mouse handling\r
- public override void onMouseButtonDown (object sender, OpenTK.Input.MouseButtonEventArgs e)\r
+ public override void onMouseDown (object sender, OpenTK.Input.MouseButtonEventArgs e)\r
{\r
- base.onMouseButtonDown (sender, e);\r
+ base.onMouseDown (sender, e);\r
\r
Rectangle cursInScreenCoord = ScreenCoordinates (cursor + Slot.Position);\r
if (cursInScreenCoord.ContainsOrIsEqual (e.Position))\r
Value += LargeIncrement;\r
}\r
}\r
- public override void onMouseButtonUp (object sender, OpenTK.Input.MouseButtonEventArgs e)\r
+ public override void onMouseUp (object sender, OpenTK.Input.MouseButtonEventArgs e)\r
{\r
- base.onMouseButtonUp (sender, e);\r
+ base.onMouseUp (sender, e);\r
\r
holdCursor = false;\r
}\r
get { return base.Focusable; }\r
set { base.Focusable = value; }\r
}\r
- [XmlAttributeAttribute()][DefaultValue(true)]\r
- public override bool Selectable {\r
- get { return base.Selectable; }\r
- set { base.Selectable = value; }\r
- }\r
[XmlAttributeAttribute()][DefaultValue("White")]\r
public override Color Background {\r
get { return base.Background; }\r
case Key.Escape:\r
Text = "";\r
currentCol = 0;\r
- selRelease = -1;\r
+ SelRelease = -1;\r
break;\r
case Key.Home:\r
//TODO\r
\r
this.Insert (k);\r
\r
- selRelease = -1;\r
- selBegin.X = currentCol;\r
+ SelRelease = -1;\r
+ SelBegin = new Point(currentCol, SelBegin.Y);\r
\r
break;\r
}\r
{
base.onMouseMove (sender, e);
- OpenTKGameWindow otkgw = TopContainer as OpenTKGameWindow;
-
- if (otkgw.activeWidget == null) {
- if (Resizable) {
- Direction lastDir = currentDirection;
-
- if (Math.Abs (e.Position.Y - this.Slot.Y) < Interface.BorderThreshold) {
- if (Math.Abs (e.Position.X - this.Slot.X) < Interface.BorderThreshold)
- currentDirection = Direction.NW;
- else if (Math.Abs (e.Position.X - this.Slot.Right) < Interface.BorderThreshold)
- currentDirection = Direction.NE;
- else
- currentDirection = Direction.N;
- } else if (Math.Abs (e.Position.Y - this.Slot.Bottom) < Interface.BorderThreshold) {
- if (Math.Abs (e.Position.X - this.Slot.X) < Interface.BorderThreshold)
- currentDirection = Direction.SW;
- else if (Math.Abs (e.Position.X - this.Slot.Right) < Interface.BorderThreshold)
- currentDirection = Direction.SE;
- else
- currentDirection = Direction.S;
- } else if (Math.Abs (e.Position.X - this.Slot.X) < Interface.BorderThreshold)
- currentDirection = Direction.W;
- else if (Math.Abs (e.Position.X - this.Slot.Right) < Interface.BorderThreshold)
- currentDirection = Direction.E;
- else
- currentDirection = Direction.None;
-
- if (currentDirection != lastDir) {
- switch (currentDirection) {
- case Direction.None:
- otkgw.Cursor = XCursor.Default;
- break;
- case Direction.N:
- otkgw.Cursor = XCursor.V;
- break;
- case Direction.S:
- otkgw.Cursor = XCursor.V;
- break;
- case Direction.E:
- otkgw.Cursor = XCursor.H;
- break;
- case Direction.W:
- otkgw.Cursor = XCursor.H;
- 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;
- }
- }
+ OpenTKGameWindow otkgw = HostContainer as OpenTKGameWindow;
+
+ if (e.Mouse.IsButtonDown (MouseButton.Left)) {
+ if (!HasFocus)
+ return;
+
+ otkgw.redrawClip.AddRectangle (this.ScreenCoordinates(this.Slot));
+
+ int currentLeft = this.Left;
+ int currentTop = this.Top;
+
+ if (currentLeft == 0)
+ currentLeft = this.Slot.Left;
+ if (currentTop == 0)
+ currentTop = this.Slot.Top;
+
+ switch (currentDirection) {
+ case Direction.None:
+ this.Left = currentLeft + e.XDelta;
+ this.Top = currentTop + e.YDelta;
+ break;
+ case Direction.N:
+ this.Top = currentTop + e.YDelta;
+ this.Height -= e.YDelta;
+ break;
+ case Direction.S:
+ this.Height += e.YDelta;
+ break;
+ case Direction.W:
+ this.Left = currentLeft + e.XDelta;
+ this.Width -= e.XDelta;
+ break;
+ case Direction.E:
+ this.Width += e.XDelta;
+ break;
+ case Direction.NW:
+ this.Left = currentLeft + e.XDelta;
+ this.Top = currentTop + e.YDelta;
+ this.Width -= e.XDelta;
+ this.Height -= e.YDelta;
+ break;
+ case Direction.NE:
+ this.Width += e.XDelta;
+ this.Top = currentTop + e.YDelta;
+ this.Height -= e.YDelta;
+ break;
+ case Direction.SW:
+ this.Left = currentLeft + e.XDelta;
+ this.Width -= e.XDelta;
+ this.Height += e.YDelta;
+ break;
+ case Direction.SE:
+ this.Width += e.XDelta;
+ this.Height += e.YDelta;
+ break;
}
return;
}
+ GraphicObject firstFocusableAncestor = otkgw.hoverWidget;
+ while (firstFocusableAncestor != this) {
+ if (firstFocusableAncestor == null)
+ return;
+ if (firstFocusableAncestor.Focusable)
+ return;
+ firstFocusableAncestor = firstFocusableAncestor.Parent as GraphicObject;
+ }
+ if (Resizable) {
+ Direction lastDir = currentDirection;
- if (TopContainer.activeWidget != this)
- return;
-
- this.TopContainer.redrawClip.AddRectangle (this.ScreenCoordinates(this.Slot));
-
- int currentLeft = this.Left;
- int currentTop = this.Top;
-
- if (currentLeft == 0)
- currentLeft = this.Slot.Left;
- if (currentTop == 0)
- currentTop = this.Slot.Top;
-
- switch (currentDirection) {
- case Direction.None:
- this.Left = currentLeft + e.XDelta;
- this.Top = currentTop + e.YDelta;
- break;
- case Direction.N:
- this.Top = currentTop + e.YDelta;
- this.Height -= e.YDelta;
- break;
- case Direction.S:
- this.Height += e.YDelta;
- break;
- case Direction.W:
- this.Left = currentLeft + e.XDelta;
- this.Width -= e.XDelta;
- break;
- case Direction.E:
- this.Width += e.XDelta;
- break;
- case Direction.NW:
- this.Left = currentLeft + e.XDelta;
- this.Top = currentTop + e.YDelta;
- this.Width -= e.XDelta;
- this.Height -= e.YDelta;
- break;
- case Direction.NE:
- this.Width += e.XDelta;
- this.Top = currentTop + e.YDelta;
- this.Height -= e.YDelta;
- break;
- case Direction.SW:
- this.Left = currentLeft + e.XDelta;
- this.Width -= e.XDelta;
- this.Height += e.YDelta;
- break;
- case Direction.SE:
- this.Width += e.XDelta;
- this.Height += e.YDelta;
- break;
- }
+ if (Math.Abs (e.Position.Y - this.Slot.Y) < Interface.BorderThreshold) {
+ if (Math.Abs (e.Position.X - this.Slot.X) < Interface.BorderThreshold)
+ currentDirection = Direction.NW;
+ else if (Math.Abs (e.Position.X - this.Slot.Right) < Interface.BorderThreshold)
+ currentDirection = Direction.NE;
+ else
+ currentDirection = Direction.N;
+ } else if (Math.Abs (e.Position.Y - this.Slot.Bottom) < Interface.BorderThreshold) {
+ if (Math.Abs (e.Position.X - this.Slot.X) < Interface.BorderThreshold)
+ currentDirection = Direction.SW;
+ else if (Math.Abs (e.Position.X - this.Slot.Right) < Interface.BorderThreshold)
+ currentDirection = Direction.SE;
+ else
+ currentDirection = Direction.S;
+ } else if (Math.Abs (e.Position.X - this.Slot.X) < Interface.BorderThreshold)
+ currentDirection = Direction.W;
+ else if (Math.Abs (e.Position.X - this.Slot.Right) < Interface.BorderThreshold)
+ currentDirection = Direction.E;
+ else
+ currentDirection = Direction.None;
+
+ if (currentDirection != lastDir) {
+ switch (currentDirection) {
+ case Direction.None:
+ otkgw.Cursor = XCursor.Default;
+ break;
+ case Direction.N:
+ otkgw.Cursor = XCursor.V;
+ break;
+ case Direction.S:
+ otkgw.Cursor = XCursor.V;
+ break;
+ case Direction.E:
+ otkgw.Cursor = XCursor.H;
+ break;
+ case Direction.W:
+ otkgw.Cursor = XCursor.H;
+ 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;
+ }
+ }
+ }
}
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
{
base.onMouseLeave (sender, e);
currentDirection = Direction.None;
- OpenTKGameWindow otkgw = TopContainer as OpenTKGameWindow;
+ OpenTKGameWindow otkgw = HostContainer as OpenTKGameWindow;
otkgw.Cursor = XCursor.Default;
}
ILayoutable parent = (sender as GraphicObject).Parent;
while(!(parent is Window))
parent = parent.Parent;
- TopContainer.DeleteWidget (parent as GraphicObject);
+ HostContainer.DeleteWidget (parent as GraphicObject);
}
public override void ResolveBindings ()
public static int TabSize = 4;
public static string LineBreak = "\r\n";
+ public static bool FocusOnHover = false;
+ /// <summary> Time to wait in millisecond before starting repeat loop</summary>
+ public static int DeviceRepeatDelay = 1000;
+ /// <summary> Time interval in millisecond between device event repeat</summary>
+ public static int DeviceRepeatInterval = 100;
public static bool ReplaceTabsWithSpace = false;
/// <summary> Allow rendering of interface in development environment </summary>
public static bool DesignerMode = false;
/// <summary> Threshold to catch borders for sizing </summary>
public static int BorderThreshold = 5;
- /// <summary>
- /// Graphic objects References use in dynamic delegates for binding
- /// </summary>
- public static List<object> References = new List<object> ();
- public static Queue<int> FreeRefIndices = new Queue<int> ();
public static List<ListBox> LoadingLists= new List<ListBox>();
-
- public static void Unreference (Object o)
- {
- int idxt = Interface.References.IndexOf (o);
- if (idxt < 0)
- return;
- References [idxt] = null;
- FreeRefIndices.Enqueue (idxt);
- }
-
- /// <summary> register target object reference in an array for binding CIL </summary>
- public static int Reference (object o)
- {
-
- int dstIdx = Interface.References.IndexOf (o);
-
- if (dstIdx < 0) {
- if (FreeRefIndices.Count == 0) {
- dstIdx = Interface.References.Count ();
- Interface.References.Add (o);
- } else {
- dstIdx = FreeRefIndices.Dequeue ();
- Interface.References [dstIdx] = o;
- }
- }
- return dstIdx;
- }
-
public static LayoutingQueue LayoutingQueue = new LayoutingQueue ();
#region Load/Save
-
- internal static Stack<List<DynAttribute>> GOMLResolutionStack = new Stack<List<DynAttribute>> ();
-
- internal static List<DynAttribute> GOMLResolver {
- get { return GOMLResolutionStack.Peek (); }
- }
//internal static List<DynAttribute> Bindings;
set \r
{\r
if (_activeWidget == value)\r
- return;\r
+ return; \r
_activeWidget = value;\r
}\r
}\r
Crow.Shader shader;\r
int[] viewport = new int[4];\r
\r
- Rectangle dirtyZone = Rectangle.Empty;\r
void createContext()\r
{ \r
createOpenGLSurface ();\r
shader.Disable ();\r
GL.Viewport (viewport [0], viewport [1], viewport [2], viewport [3]);\r
}\r
-// public void RenderCustomTextureOnUIQuad(int _customTex)\r
-// {\r
-// GL.GetInteger (GetPName.Viewport, viewport);\r
-// GL.Viewport (0, 0, ClientRectangle.Width, ClientRectangle.Height);\r
-//\r
-// shader.Enable ();\r
-//\r
-// GL.ActiveTexture (TextureUnit.Texture0);\r
-// GL.BindTexture (TextureTarget.Texture2D, _customTex);\r
-// GL.Disable (EnableCap.DepthTest);\r
-// uiQuad2.Render (PrimitiveType.TriangleStrip);\r
-// GL.Enable (EnableCap.DepthTest);\r
-// GL.BindTexture(TextureTarget.Texture2D, 0);\r
-// shader.Disable ();\r
-// GL.Viewport (viewport [0], viewport [1], viewport [2], viewport [3]); \r
-// }\r
- \r
#endregion\r
\r
#region update\r
\r
void update ()\r
{\r
+ if (mouseRepeatCount > 0) {\r
+ int mc = mouseRepeatCount;\r
+ mouseRepeatCount -= mc;\r
+ for (int i = 0; i < mc; i++) {\r
+ FocusedWidget.onMouseClick (this, new MouseButtonEventArgs (Mouse.X, Mouse.Y, MouseButton.Left, true));\r
+ }\r
+ }\r
+\r
updateTime.Restart ();\r
layoutTime.Reset ();\r
guTime.Reset ();\r
foreach (GraphicObject p in gotr) {\r
p.registerClipRect ();\r
}\r
+ updateTime.Stop ();\r
\r
+ drawingTime.Start ();\r
\r
lock (redrawClip) {\r
if (redrawClip.count > 0) { \r
-// #if DEBUG_CLIP_RECTANGLE\r
-// redrawClip.stroke (ctx, new Color(1.0,0,0,0.3));\r
-// #endif\r
+ #if DEBUG_CLIP_RECTANGLE\r
+ redrawClip.stroke (ctx, new Color(1.0,0,0,0.3));\r
+ #endif\r
redrawClip.clearAndClip (ctx);//rajouté après, tester si utile \r
\r
//Link.draw (ctx);\r
foreach (GraphicObject p in invGOList) {\r
if (p.Visible) {\r
- drawingTime.Start ();\r
\r
ctx.Save ();\r
if (redrawClip.count > 0) {\r
p.Paint (ref ctx, clip);\r
}\r
ctx.Restore ();\r
-\r
- drawingTime.Stop ();\r
}\r
}\r
ctx.ResetClip ();\r
- dirtyZone = redrawClip.Bounds;\r
-// #if DEBUG_CLIP_RECTANGLE\r
-// redrawClip.stroke (ctx, Color.Red.AdjustAlpha(0.1));\r
-// #endif\r
+ #if DEBUG_CLIP_RECTANGLE\r
+ redrawClip.stroke (ctx, Color.Red.AdjustAlpha(0.1));\r
+ #endif\r
redrawClip.Reset ();\r
}\r
}\r
+ drawingTime.Stop ();\r
//surf.WriteToPng (@"/mnt/data/test.png");\r
ctx.Dispose ();\r
surf.Dispose ();\r
// layoutTime.ElapsedMilliseconds,\r
// guTime.ElapsedMilliseconds,\r
// drawingTime.ElapsedMilliseconds);\r
- updateTime.Stop ();\r
+\r
// Debug.WriteLine("UPDATE: {0} ticks \t, {1} ms",\r
// updateTime.ElapsedTicks,\r
// updateTime.ElapsedMilliseconds);\r
{\r
if (_activeWidget != null) {\r
//first, ensure object is still in the graphic tree\r
- if (_activeWidget.TopContainer == null) {\r
+ if (_activeWidget.HostContainer == null) {\r
activeWidget = null;\r
} else {\r
\r
\r
if (_hoverWidget != null) {\r
//first, ensure object is still in the graphic tree\r
- if (_hoverWidget.TopContainer == null) {\r
+ if (_hoverWidget.HostContainer == null) {\r
hoverWidget = null;\r
} else {\r
//check topmost graphicobject first\r
MouseButtonUp.Raise (this, e);\r
return;\r
}\r
+ \r
+ if (mouseRepeatThread != null) {\r
+ mouseRepeatOn = false;\r
+ mouseRepeatThread.Abort();\r
+ mouseRepeatThread.Join ();\r
+ }\r
\r
- _activeWidget.onMouseButtonUp (this, e);\r
- _activeWidget = null;\r
+ _activeWidget.onMouseUp (this, e);\r
+ activeWidget = null;\r
}\r
void Mouse_ButtonDown(object sender, MouseButtonEventArgs e)\r
{\r
return;\r
}\r
\r
- GraphicObject g = _hoverWidget;\r
- while (!g.Focusable) { \r
- g = g.Parent as GraphicObject;\r
- if (g == null) { \r
- return;\r
- }\r
- }\r
+ _hoverWidget.onMouseDown(_hoverWidget,new BubblingMouseButtonEventArg(e));\r
\r
- _activeWidget = g;\r
- _activeWidget.onMouseButtonDown (this, e);\r
+ if (FocusedWidget == null)\r
+ return;\r
+ if (!FocusedWidget.MouseRepeat)\r
+ return;\r
+ mouseRepeatThread = new Thread (mouseRepeatThreadFunc);\r
+ mouseRepeatThread.Start ();\r
}\r
-\r
void Mouse_WheelChanged(object sender, MouseWheelEventArgs e)\r
{\r
if (_hoverWidget == null) {\r
return;\r
}\r
_hoverWidget.onMouseWheel (this, e);\r
- } \r
+ }\r
+\r
+ volatile bool mouseRepeatOn;\r
+ volatile int mouseRepeatCount;\r
+ Thread mouseRepeatThread;\r
+ void mouseRepeatThreadFunc()\r
+ {\r
+ mouseRepeatOn = true;\r
+ Thread.Sleep (Interface.DeviceRepeatDelay);\r
+ while (mouseRepeatOn) {\r
+ mouseRepeatCount++;\r
+ Thread.Sleep (Interface.DeviceRepeatInterval);\r
+ }\r
+ mouseRepeatCount = 0;\r
+ }\r
#endregion\r
\r
#region keyboard Handling\r
Rectangle ILayoutable.ClientRectangle {\r
get { return new Size(this.ClientRectangle.Size.Width,this.ClientRectangle.Size.Height); }\r
}\r
- public IGOLibHost TopContainer {\r
+ public IGOLibHost HostContainer {\r
get { return this; }\r
}\r
\r
public string Path;
public Size Dimensions;
public bool KeepProportions = false;
- public bool Scale = true;
+ public bool Scaled = true;
public Picture ()
{
public override void Paint (Cairo.Context gr, Rectangle rect, string subPart = "")
{
- float widthRatio = (float)rect.Width / Dimensions.Width;
- float heightRatio = (float)rect.Height / Dimensions.Height;
- float ratio = Math.Min (widthRatio, heightRatio);
-
- Rectangle rImg = rect;
+ float widthRatio = 1f;
+ float heightRatio = 1f;
+ if (Scaled) {
+ widthRatio = (float)rect.Width / Dimensions.Width;
+ heightRatio = (float)rect.Height / Dimensions.Height;
+ }
+ if (KeepProportions) {
+ if (widthRatio < heightRatio)
+ heightRatio = widthRatio;
+ else
+ widthRatio = heightRatio;
+ }
+
gr.Save ();
- if (KeepProportions)
- gr.Scale (ratio, ratio);
- else
- gr.Scale (widthRatio, heightRatio);
+ gr.Translate (rect.Left,rect.Top);
+ gr.Scale (widthRatio, heightRatio);
+ gr.Translate (((float)rect.Width/widthRatio - Dimensions.Width)/2f, ((float)rect.Height/heightRatio - Dimensions.Height)/2f);
- gr.Translate (rImg.X/widthRatio, rImg.Y/heightRatio);
if (string.IsNullOrEmpty (subPart))
hSVG.RenderCairo (gr);
else