-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <!-- <Platform Condition=" '$(Platform)' == '' ">Linux_x86</Platform>-->\r
- <ProjectGuid>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>Crow</RootNamespace>\r
- <AssemblyName>Crow</AssemblyName>\r
- <FileAlignment>512</FileAlignment>\r
- <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r
- <NoStdLib>False</NoStdLib>\r
- <TreatWarningsAsErrors>False</TreatWarningsAsErrors>\r
- <OutputPath>bin\$(Configuration)</OutputPath>\r
- <IntermediateOutputPath>obj\$(Configuration)</IntermediateOutputPath>\r
- <WarningLevel>4</WarningLevel>\r
- <NoWin32Manifest>False</NoWin32Manifest>\r
- <SignAssembly>false</SignAssembly>\r
- <DelaySign>False</DelaySign>\r
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>\r
- <ProductVersion>8.0.30703</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ReleaseVersion>0.2</ReleaseVersion>\r
- <SynchReleaseVersion>false</SynchReleaseVersion>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DefineConstants>TRACE;DEBUG;__linux__</DefineConstants>\r
- <Optimize>False</Optimize>\r
- <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>\r
- <DebugType>Full</DebugType>\r
- <BaseAddress>4194304</BaseAddress>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">\r
- <DefineConstants>__linux__</DefineConstants>\r
- <Optimize>True</Optimize>\r
- <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r
- <DebugType>None</DebugType>\r
- <BaseAddress>4194304</BaseAddress>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <OutputPath>bin\Release</OutputPath>\r
- </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;DEBUG_CLIP_RECTANGLE0</DefineConstants>\r
- </PropertyGroup>\r
- <!-- <PropertyGroup Condition=" '$(Platform)' == 'Linux_x86' ">\r
- <DefineConstants>__linux__</DefineConstants>\r
- <PlatformTarget>x86</PlatformTarget>\r
- <BaseAddress>4194304</BaseAddress>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$$(Platform)' == 'Win_x86' ">\r
- <DefineConstants>_WIN32</DefineConstants>\r
- </PropertyGroup>-->\r
- <!-- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Linux_x86' ">\r
- <DefineConstants>DEBUG;__linux__;DEBUG;TRACE</DefineConstants>\r
- <PlatformTarget>anycpu</PlatformTarget>\r
- </PropertyGroup>-->\r
- <ItemGroup>\r
- <Compile Include="src\Colors.cs" />\r
- <Compile Include="src\Point.cs" />\r
- <Compile Include="Properties\AssemblyInfo.cs" />\r
- <Compile Include="src\Rectangle.cs" />\r
- <Compile Include="src\Rectangles.cs" />\r
- <Compile Include="src\Size.cs" />\r
- <Compile Include="src\OpenTKGameWindow.cs" />\r
- <Compile Include="src\GraphicObjects\GraphicObject.cs" />\r
- <Compile Include="src\GraphicObjects\Container.cs" />\r
- <Compile Include="src\GraphicObjects\Group.cs" />\r
- <Compile Include="src\GraphicObjects\HorizontalStack.cs" />\r
- <Compile Include="src\GraphicObjects\Image.cs" />\r
- <Compile Include="src\GraphicObjects\Label.cs" />\r
- <Compile Include="src\GraphicObjects\TextBox.cs" />\r
- <Compile Include="src\GraphicObjects\ProgressBar.cs" />\r
- <Compile Include="src\GraphicObjects\VerticalStack.cs" />\r
- <Compile Include="src\Cairo\CairoHelpers.cs" />\r
- <Compile Include="src\win32\Win32.cs" />\r
- <Compile Include="src\win32\winApi.cs" />\r
- <Compile Include="src\GraphicObjects\Button.cs" />\r
- <Compile Include="src\GraphicObjects\GraduatedSlider.cs" />\r
- <Compile Include="src\GraphicObjects\Slider.cs" />\r
- <Compile Include="src\GraphicObjects\NumericControl.cs" />\r
- <Compile Include="src\GraphicObjects\Scroller.cs" />\r
- <Compile Include="src\GraphicObjects\ILayoutable.cs" />\r
- <Compile Include="src\Enums.cs" />\r
- <Compile Include="src\GraphicObjects\GenericStack.cs" />\r
- <Compile Include="src\CompilerServices\CompilerServices.cs" />\r
- <Compile Include="src\GraphicObjects\AnalogMeter.cs" />\r
- <Compile Include="src\GraphicObjects\Border.cs" />\r
- <Compile Include="src\Font.cs" />\r
- <Compile Include="src\OpenGL\QuadVAO.cs" />\r
- <Compile Include="src\OpenGL\Shader.cs" />\r
- <Compile Include="src\OpenGL\TexturedShader.cs" />\r
- <Compile Include="src\OpenGL\VertexArrayObject.cs" />\r
- <Compile Include="src\GraphicObjects\Window.cs" />\r
- <Compile Include="src\GraphicObjects\IGOLibHost.cs" />\r
- <Compile Include="src\GraphicObjects\ListBox.cs" />\r
- <Compile Include="src\ExtensionsMethods.cs" />\r
- <Compile Include="src\Interface.cs" />\r
- <Compile Include="src\LayoutingQueueItem.cs" />\r
- <Compile Include="src\LayoutingQueue.cs" />\r
- <Compile Include="src\GraphicObjects\Spinner.cs" />\r
- <Compile Include="src\DynAttribute.cs" />\r
- <Compile Include="src\GraphicObjects\IValueChange.cs" />\r
- <Compile Include="src\Picture.cs" />\r
- <Compile Include="src\SvgPicture.cs" />\r
- <Compile Include="src\BmpPicture.cs" />\r
- <Compile Include="src\GraphicObjects\TemplatedControl.cs" />\r
- <Compile Include="src\GraphicObjects\RadioButton.cs" />\r
- <Compile Include="src\GraphicObjects\Expandable.cs" />\r
- <Compile Include="src\GraphicObjects\PrivateContainer.cs" />\r
- <Compile Include="src\GraphicObjects\TemplatedContainer.cs" />\r
- <Compile Include="src\GraphicObjects\Popper.cs" />\r
- <Compile Include="src\TextChangeEventArgs.cs" />\r
- <Compile Include="src\LayoutChangeEventArgs.cs" />\r
- <Compile Include="src\ReflexionExtensions.cs" />\r
- <Compile Include="src\XCursor.cs" />\r
- <Compile Include="src\GraphicObjects\Grid.cs" />\r
- <Compile Include="src\GraphicObjects\TextRun.cs" />\r
- <Compile Include="src\GraphicObjects\MessageBox.cs" />\r
- <Compile Include="src\SelectionChangeEventArgs.cs" />\r
- <Compile Include="src\ValueChangeEventArgs.cs" />\r
- <Compile Include="src\GraphicObjects\FileDialog.cs" />\r
- <Compile Include="src\GraphicObjects\CheckBox.cs" />\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
- <Compile Include="src\Cairo\IFill.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Drawing" />\r
- <Reference Include="System.Xml" />\r
- <Reference Include="glib-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">\r
- <Package>glib-sharp-3.0</Package>\r
- </Reference>\r
- <Reference Include="Microsoft.CSharp" />\r
- <Reference Include="OpenTK">\r
- <HintPath>..\opentk\Binaries\OpenTK\Release\OpenTK.dll</HintPath>\r
- </Reference>\r
- <Reference Include="Mono.Cairo" />\r
- <Reference Include="rsvg2-sharp, Version=2.18.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ItemGroup />\r
- <ItemGroup>\r
- <Folder Include="src\GraphicObjects\" />\r
- <Folder Include="src\Cairo\" />\r
- <Folder Include="src\win32\" />\r
- <Folder Include="Images\" />\r
- <Folder Include="Images\Icons\" />\r
- <Folder Include="src\CompilerServices\" />\r
- <Folder Include="src\OpenGL\" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="Images\Icons\updown.svg" />\r
- <EmbeddedResource Include="Images\Icons\IconAlerte.svg" />\r
- <EmbeddedResource Include="Images\Icons\button.svg" />\r
- <EmbeddedResource Include="Images\Icons\buttonB.svg" />\r
- <EmbeddedResource Include="Images\Icons\buttest.svg" />\r
- <EmbeddedResource Include="Images\Icons\buttest2.svg" />\r
- <EmbeddedResource Include="Images\Icons\buttest4.svg" />\r
- <EmbeddedResource Include="Images\Icons\checkbox.svg" />\r
- <EmbeddedResource Include="Images\Icons\radiobutton.svg" />\r
- <EmbeddedResource Include="Templates\RadioButton.goml" />\r
- <EmbeddedResource Include="Templates\Slider.goml" />\r
- <EmbeddedResource Include="Templates\Spinner.goml" />\r
- <EmbeddedResource Include="Templates\Spinner %28copier%29.goml" />\r
- <EmbeddedResource Include="Templates\ItemTemplate.goml" />\r
- <EmbeddedResource Include="Templates\Expandable.goml" />\r
- <EmbeddedResource Include="Images\Icons\expandable.svg" />\r
- <EmbeddedResource Include="Templates\Checkbox2.goml" />\r
- <EmbeddedResource Include="Templates\Popper.goml" />\r
- <EmbeddedResource Include="Templates\Window.goml" />\r
- <EmbeddedResource Include="Images\Icons\tetra.png" />\r
- <EmbeddedResource Include="Images\Icons\exit.svg" />\r
- <EmbeddedResource Include="Templates\AnalogMeter0.goml" />\r
- <EmbeddedResource Include="Images\meter.svg" />\r
- <EmbeddedResource Include="Images\Icons\member.svg" />\r
- <EmbeddedResource Include="Images\Icons\exit2.svg" />\r
- <EmbeddedResource Include="Images\button.svg" />\r
- <EmbeddedResource Include="Templates\MessageBox.goml" />\r
- <EmbeddedResource Include="Images\Icons\iconInfo.svg" />\r
- <EmbeddedResource Include="Templates\FileDialog.goml" />\r
- <EmbeddedResource Include="Templates\tmpDirItem.goml" />\r
- <EmbeddedResource Include="Templates\ScrollingListBox.goml" />\r
- <EmbeddedResource Include="Templates\imgItemTemplate.goml" />\r
- <EmbeddedResource Include="Images\Icons\Cursors\cross" />\r
- <EmbeddedResource Include="Images\Icons\Cursors\bottom_left_corner" />\r
- <EmbeddedResource Include="Images\Icons\Cursors\bottom_right_corner" />\r
- <EmbeddedResource Include="Images\Icons\Cursors\top_left_corner" />\r
- <EmbeddedResource Include="Images\Icons\Cursors\top_right_corner" />\r
- <EmbeddedResource Include="Images\Icons\Cursors\arrow" />\r
- <EmbeddedResource Include="Images\Icons\Cursors\sb_h_double_arrow" />\r
- <EmbeddedResource Include="Images\Icons\Cursors\sb_v_double_arrow" />\r
- <EmbeddedResource Include="Images\Icons\Cursors\hand" />\r
- <EmbeddedResource Include="Images\Icons\Cursors\help" />\r
- <EmbeddedResource Include="Images\Icons\Cursors\move" />\r
- <EmbeddedResource Include="Templates\CheckBox.goml" />\r
- <EmbeddedResource Include="Templates\ComboBox.goml" />\r
- <EmbeddedResource Include="Templates\ComboBoxOverlay.goml" />\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
- </ItemGroup>\r
-</Project>\r
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <!-- <Platform Condition=" '$(Platform)' == '' ">Linux_x86</Platform>-->
+ <ProjectGuid>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Crow</RootNamespace>
+ <AssemblyName>Crow</AssemblyName>
+ <FileAlignment>512</FileAlignment>
+ <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+ <NoStdLib>False</NoStdLib>
+ <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
+ <OutputPath>bin\$(Configuration)</OutputPath>
+ <IntermediateOutputPath>obj\$(Configuration)</IntermediateOutputPath>
+ <WarningLevel>4</WarningLevel>
+ <NoWin32Manifest>False</NoWin32Manifest>
+ <SignAssembly>false</SignAssembly>
+ <DelaySign>False</DelaySign>
+ <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ReleaseVersion>0.2</ReleaseVersion>
+ <SynchReleaseVersion>false</SynchReleaseVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DefineConstants>TRACE;DEBUG;__linux__</DefineConstants>
+ <Optimize>False</Optimize>
+ <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
+ <DebugType>Full</DebugType>
+ <BaseAddress>4194304</BaseAddress>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+ <DefineConstants>__linux__</DefineConstants>
+ <Optimize>True</Optimize>
+ <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
+ <DebugType>None</DebugType>
+ <BaseAddress>4194304</BaseAddress>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>bin\Release</OutputPath>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>TRACE;DEBUG;__linux__;DEBUG_LOAD_TIME0;DEBUG_LAYOUTING0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
+ </PropertyGroup>
+ <!-- <PropertyGroup Condition=" '$(Platform)' == 'Linux_x86' ">
+ <DefineConstants>__linux__</DefineConstants>
+ <PlatformTarget>x86</PlatformTarget>
+ <BaseAddress>4194304</BaseAddress>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$$(Platform)' == 'Win_x86' ">
+ <DefineConstants>_WIN32</DefineConstants>
+ </PropertyGroup>-->
+ <!-- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Linux_x86' ">
+ <DefineConstants>DEBUG;__linux__;DEBUG;TRACE</DefineConstants>
+ <PlatformTarget>anycpu</PlatformTarget>
+ </PropertyGroup>-->
+ <ItemGroup>
+ <Compile Include="src\Colors.cs" />
+ <Compile Include="src\Point.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="src\Rectangle.cs" />
+ <Compile Include="src\Rectangles.cs" />
+ <Compile Include="src\Size.cs" />
+ <Compile Include="src\OpenTKGameWindow.cs" />
+ <Compile Include="src\GraphicObjects\GraphicObject.cs" />
+ <Compile Include="src\GraphicObjects\Container.cs" />
+ <Compile Include="src\GraphicObjects\Group.cs" />
+ <Compile Include="src\GraphicObjects\HorizontalStack.cs" />
+ <Compile Include="src\GraphicObjects\Image.cs" />
+ <Compile Include="src\GraphicObjects\Label.cs" />
+ <Compile Include="src\GraphicObjects\TextBox.cs" />
+ <Compile Include="src\GraphicObjects\ProgressBar.cs" />
+ <Compile Include="src\GraphicObjects\VerticalStack.cs" />
+ <Compile Include="src\Cairo\CairoHelpers.cs" />
+ <Compile Include="src\win32\Win32.cs" />
+ <Compile Include="src\win32\winApi.cs" />
+ <Compile Include="src\GraphicObjects\Button.cs" />
+ <Compile Include="src\GraphicObjects\GraduatedSlider.cs" />
+ <Compile Include="src\GraphicObjects\Slider.cs" />
+ <Compile Include="src\GraphicObjects\NumericControl.cs" />
+ <Compile Include="src\GraphicObjects\Scroller.cs" />
+ <Compile Include="src\GraphicObjects\ILayoutable.cs" />
+ <Compile Include="src\Enums.cs" />
+ <Compile Include="src\GraphicObjects\GenericStack.cs" />
+ <Compile Include="src\CompilerServices\CompilerServices.cs" />
+ <Compile Include="src\GraphicObjects\AnalogMeter.cs" />
+ <Compile Include="src\GraphicObjects\Border.cs" />
+ <Compile Include="src\Font.cs" />
+ <Compile Include="src\OpenGL\QuadVAO.cs" />
+ <Compile Include="src\OpenGL\Shader.cs" />
+ <Compile Include="src\OpenGL\TexturedShader.cs" />
+ <Compile Include="src\OpenGL\VertexArrayObject.cs" />
+ <Compile Include="src\GraphicObjects\Window.cs" />
+ <Compile Include="src\GraphicObjects\IGOLibHost.cs" />
+ <Compile Include="src\GraphicObjects\ListBox.cs" />
+ <Compile Include="src\ExtensionsMethods.cs" />
+ <Compile Include="src\Interface.cs" />
+ <Compile Include="src\LayoutingQueueItem.cs" />
+ <Compile Include="src\LayoutingQueue.cs" />
+ <Compile Include="src\GraphicObjects\Spinner.cs" />
+ <Compile Include="src\DynAttribute.cs" />
+ <Compile Include="src\GraphicObjects\IValueChange.cs" />
+ <Compile Include="src\Picture.cs" />
+ <Compile Include="src\SvgPicture.cs" />
+ <Compile Include="src\BmpPicture.cs" />
+ <Compile Include="src\GraphicObjects\TemplatedControl.cs" />
+ <Compile Include="src\GraphicObjects\RadioButton.cs" />
+ <Compile Include="src\GraphicObjects\Expandable.cs" />
+ <Compile Include="src\GraphicObjects\PrivateContainer.cs" />
+ <Compile Include="src\GraphicObjects\TemplatedContainer.cs" />
+ <Compile Include="src\GraphicObjects\Popper.cs" />
+ <Compile Include="src\TextChangeEventArgs.cs" />
+ <Compile Include="src\LayoutChangeEventArgs.cs" />
+ <Compile Include="src\ReflexionExtensions.cs" />
+ <Compile Include="src\XCursor.cs" />
+ <Compile Include="src\GraphicObjects\Grid.cs" />
+ <Compile Include="src\GraphicObjects\TextRun.cs" />
+ <Compile Include="src\GraphicObjects\MessageBox.cs" />
+ <Compile Include="src\SelectionChangeEventArgs.cs" />
+ <Compile Include="src\ValueChangeEventArgs.cs" />
+ <Compile Include="src\GraphicObjects\FileDialog.cs" />
+ <Compile Include="src\GraphicObjects\CheckBox.cs" />
+ <Compile Include="src\GraphicObjects\ComboBox.cs" />
+ <Compile Include="src\GraphicObjects\GroupBox.cs" />
+ <Compile Include="src\GraphicObjects\ScrollBar.cs" />
+ <Compile Include="src\BubblingMouseButtonEventArgs.cs" />
+ <Compile Include="src\Cairo\IFill.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Xml" />
+ <Reference Include="glib-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <Package>glib-sharp-3.0</Package>
+ </Reference>
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="OpenTK">
+ <HintPath>..\opentk\Binaries\OpenTK\Release\OpenTK.dll</HintPath>
+ </Reference>
+ <Reference Include="Mono.Cairo" />
+ <Reference Include="rsvg2-sharp, Version=2.18.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+ <ItemGroup />
+ <ItemGroup>
+ <Folder Include="src\GraphicObjects\" />
+ <Folder Include="src\Cairo\" />
+ <Folder Include="src\win32\" />
+ <Folder Include="Images\" />
+ <Folder Include="Images\Icons\" />
+ <Folder Include="src\CompilerServices\" />
+ <Folder Include="src\OpenGL\" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Images\Icons\updown.svg" />
+ <EmbeddedResource Include="Images\Icons\IconAlerte.svg" />
+ <EmbeddedResource Include="Images\Icons\button.svg" />
+ <EmbeddedResource Include="Images\Icons\buttonB.svg" />
+ <EmbeddedResource Include="Images\Icons\buttest.svg" />
+ <EmbeddedResource Include="Images\Icons\buttest2.svg" />
+ <EmbeddedResource Include="Images\Icons\buttest4.svg" />
+ <EmbeddedResource Include="Images\Icons\checkbox.svg" />
+ <EmbeddedResource Include="Images\Icons\radiobutton.svg" />
+ <EmbeddedResource Include="Templates\RadioButton.goml" />
+ <EmbeddedResource Include="Templates\Slider.goml" />
+ <EmbeddedResource Include="Templates\Spinner.goml" />
+ <EmbeddedResource Include="Templates\Spinner %28copier%29.goml" />
+ <EmbeddedResource Include="Templates\ItemTemplate.goml" />
+ <EmbeddedResource Include="Templates\Expandable.goml" />
+ <EmbeddedResource Include="Images\Icons\expandable.svg" />
+ <EmbeddedResource Include="Templates\Checkbox2.goml" />
+ <EmbeddedResource Include="Templates\Popper.goml" />
+ <EmbeddedResource Include="Templates\Window.goml" />
+ <EmbeddedResource Include="Images\Icons\tetra.png" />
+ <EmbeddedResource Include="Images\Icons\exit.svg" />
+ <EmbeddedResource Include="Templates\AnalogMeter0.goml" />
+ <EmbeddedResource Include="Images\meter.svg" />
+ <EmbeddedResource Include="Images\Icons\member.svg" />
+ <EmbeddedResource Include="Images\Icons\exit2.svg" />
+ <EmbeddedResource Include="Images\button.svg" />
+ <EmbeddedResource Include="Templates\MessageBox.goml" />
+ <EmbeddedResource Include="Images\Icons\iconInfo.svg" />
+ <EmbeddedResource Include="Templates\FileDialog.goml" />
+ <EmbeddedResource Include="Templates\tmpDirItem.goml" />
+ <EmbeddedResource Include="Templates\ScrollingListBox.goml" />
+ <EmbeddedResource Include="Templates\imgItemTemplate.goml" />
+ <EmbeddedResource Include="Images\Icons\Cursors\cross" />
+ <EmbeddedResource Include="Images\Icons\Cursors\bottom_left_corner" />
+ <EmbeddedResource Include="Images\Icons\Cursors\bottom_right_corner" />
+ <EmbeddedResource Include="Images\Icons\Cursors\top_left_corner" />
+ <EmbeddedResource Include="Images\Icons\Cursors\top_right_corner" />
+ <EmbeddedResource Include="Images\Icons\Cursors\arrow" />
+ <EmbeddedResource Include="Images\Icons\Cursors\sb_h_double_arrow" />
+ <EmbeddedResource Include="Images\Icons\Cursors\sb_v_double_arrow" />
+ <EmbeddedResource Include="Images\Icons\Cursors\hand" />
+ <EmbeddedResource Include="Images\Icons\Cursors\help" />
+ <EmbeddedResource Include="Images\Icons\Cursors\move" />
+ <EmbeddedResource Include="Templates\CheckBox.goml" />
+ <EmbeddedResource Include="Templates\ComboBox.goml" />
+ <EmbeddedResource Include="Templates\ComboBoxOverlay.goml" />
+ <EmbeddedResource Include="Templates\GroupBox.goml" />
+ <EmbeddedResource Include="Templates\ListBox.goml" />
+ <EmbeddedResource Include="Templates\ScrollBar.goml" />
+ <EmbeddedResource Include="Templates\Button.crow" />
+ <EmbeddedResource Include="Templates\ArrowButTemplate.crow" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="README.md" />
+ </ItemGroup>
+</Project>
-\r
-Microsoft Visual Studio Solution File, Format Version 11.00\r
-# Visual Studio 2010\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow", "Crow.csproj", "{C2980F9B-4798-4C05-99E2-E174810F7C7B}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{74289092-9F70-4941-AFCB-DFD7BE2140B6}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.GOLib", "MonoDevelop.GOLib\MonoDevelop.GOLib.csproj", "{E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.Diagram", "..\MonoDevelop.Diagram\MonoDevelop.Diagram.csproj", "{232716B4-D19D-4FD7-B310-94A98FD926F0}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTest", "UnitTest\UnitTest.csproj", "{7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Linux_x86 = Debug|Linux_x86\r
- Release|Linux_x86 = Release|Linux_x86\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {232716B4-D19D-4FD7-B310-94A98FD926F0}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU\r
- {232716B4-D19D-4FD7-B310-94A98FD926F0}.Release|Linux_x86.ActiveCfg = Debug|Any CPU\r
- {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU\r
- {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Linux_x86.Build.0 = Debug|Any CPU\r
- {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Linux_x86.ActiveCfg = Release|Any CPU\r
- {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Linux_x86.Build.0 = Release|Any CPU\r
- {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU\r
- {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Debug|Linux_x86.Build.0 = Debug|Any CPU\r
- {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Release|Linux_x86.ActiveCfg = Release|Any CPU\r
- {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Release|Linux_x86.Build.0 = Release|Any CPU\r
- {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU\r
- {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Linux_x86.Build.0 = Debug|Any CPU\r
- {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Linux_x86.ActiveCfg = Release|Any CPU\r
- {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Linux_x86.Build.0 = Release|Any CPU\r
- {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU\r
- {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Debug|Linux_x86.Build.0 = Debug|Any CPU\r
- {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Release|Linux_x86.ActiveCfg = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(MonoDevelopProperties) = preSolution\r
- Policies = $0\r
- $0.StandardHeader = $1\r
- $1.Text = @ \n ${FileName}\n \n Author:\n ${AuthorName} <${AuthorEmail}>\n\n Copyright (c) ${Year} ${CopyrightHolder}\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\r
- $1.IncludeInNewFiles = True\r
- $0.DotNetNamingPolicy = $2\r
- $2.DirectoryNamespaceAssociation = None\r
- $2.ResourceNamePolicy = FileFormatDefault\r
- version = 0.2\r
- EndGlobalSection\r
-EndGlobal\r
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow", "Crow.csproj", "{C2980F9B-4798-4C05-99E2-E174810F7C7B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{74289092-9F70-4941-AFCB-DFD7BE2140B6}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.GOLib", "MonoDevelop.GOLib\MonoDevelop.GOLib.csproj", "{E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.Diagram", "..\MonoDevelop.Diagram\MonoDevelop.Diagram.csproj", "{232716B4-D19D-4FD7-B310-94A98FD926F0}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTest", "UnitTest\UnitTest.csproj", "{7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Linux_x86 = Debug|Linux_x86
+ Release|Linux_x86 = Release|Linux_x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {232716B4-D19D-4FD7-B310-94A98FD926F0}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU
+ {232716B4-D19D-4FD7-B310-94A98FD926F0}.Release|Linux_x86.ActiveCfg = Debug|Any CPU
+ {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU
+ {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Linux_x86.Build.0 = Debug|Any CPU
+ {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Linux_x86.ActiveCfg = Release|Any CPU
+ {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Linux_x86.Build.0 = Release|Any CPU
+ {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU
+ {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Debug|Linux_x86.Build.0 = Debug|Any CPU
+ {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Release|Linux_x86.ActiveCfg = Release|Any CPU
+ {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Release|Linux_x86.Build.0 = Release|Any CPU
+ {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU
+ {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Linux_x86.Build.0 = Debug|Any CPU
+ {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Linux_x86.ActiveCfg = Release|Any CPU
+ {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Linux_x86.Build.0 = Release|Any CPU
+ {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU
+ {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Debug|Linux_x86.Build.0 = Debug|Any CPU
+ {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Release|Linux_x86.ActiveCfg = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ Policies = $0
+ $0.StandardHeader = $1
+ $1.Text = @ \n ${FileName}\n \n Author:\n ${AuthorName} <${AuthorEmail}>\n\n Copyright (c) ${Year} ${CopyrightHolder}\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.
+ $1.IncludeInNewFiles = True
+ $0.DotNetNamingPolicy = $2
+ $2.DirectoryNamespaceAssociation = None
+ $2.ResourceNamePolicy = FileFormatDefault
+ version = 0.2
+ EndGlobalSection
+EndGlobal
<Properties GitUserInfo="UsingGIT" StartupItem="Tests/Tests.csproj">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|Linux_x86" />
- <MonoDevelop.Ide.Workbench ActiveDocument="src/GraphicObjects/Label.cs">
+ <MonoDevelop.Ide.Workbench ActiveDocument="src/Colors.cs">
<Files>
- <File FileName="Tests/GOLIBTest_TypeViewer.cs" Line="1" Column="1" />
- <File FileName="Tests/Interfaces/testTypeViewer.goml" Line="4" Column="84" />
- <File FileName="Tests/Interfaces/tmpMembers.goml" Line="3" Column="35" />
- <File FileName="Tests/Interfaces/testWindow.goml" Line="1" Column="1" />
- <File FileName="src/GraphicObjects/Label.cs" Line="107" Column="38" />
- <File FileName="src/OpenTKGameWindow.cs" Line="154" Column="3" />
- <File FileName="src/GraphicObjects/ScrollBar.cs" Line="1" Column="1" />
- <File FileName="src/GraphicObjects/TemplatedControl.cs" Line="56" Column="53" />
- <File FileName="src/GraphicObjects/GraphicObject.cs" Line="153" Column="51" />
- <File FileName="src/Colors.cs" Line="13" Column="16" />
- <File FileName="src/GraphicObjects/Container.cs" Line="10" Column="37" />
- <File FileName="src/GraphicObjects/ProgressBar.cs" Line="97" Column="33" />
- <File FileName="src/GraphicObjects/Scroller.cs" Line="100" Column="21" />
- <File FileName="src/GraphicObjects/MessageBox.cs" Line="35" Column="30" />
- <File FileName="src/Rectangles.cs" Line="143" Column="25" />
- <File FileName="src/GraphicObjects/Group.cs" Line="210" Column="1" />
- <File FileName="src/Cairo/CairoHelpers.cs" Line="110" Column="34" />
- <File FileName="src/GraphicObjects/GraduatedSlider.cs" Line="41" Column="11" />
- <File FileName="src/GraphicObjects/Slider.cs" Line="134" Column="34" />
- <File FileName="src/GraphicObjects/Border.cs" Line="61" Column="8" />
- <File FileName="src/Interface.cs" Line="128" Column="1" />
- <File FileName="src/XCursor.cs" Line="56" Column="12" />
- <File FileName="src/GraphicObjects/TextRun.cs" Line="316" Column="37" />
- <File FileName="src/GraphicObjects/GenericStack.cs" Line="15" Column="18" />
- <File FileName="src/CompilerServices/CompilerServices.cs" Line="153" Column="1" />
- <File FileName="src/GraphicObjects/Spinner.cs" Line="29" Column="1" />
- <File FileName="src/SvgPicture.cs" Line="30" Column="1" />
- <File FileName="src/GraphicObjects/FileDialog.cs" Line="45" Column="12" />
+ <File FileName="src/Colors.cs" Line="13" Column="32" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
-<?xml version="1.0" encoding="utf-8"?>\r
-<packages>\r
- <package id="MonoDevelop.Addins" version="0.2.3" targetFramework="net45" />\r
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="MonoDevelop.Addins" version="0.2.3" targetFramework="net45" />
</packages>
\ No newline at end of file
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-using System.Runtime.InteropServices;\r
-\r
-// General Information about an assembly is controlled through the following \r
-// set of attributes. Change these attribute values to modify the information\r
-// associated with an assembly.\r
-[assembly: AssemblyTitle("golib")]\r
-[assembly: AssemblyDescription("")]\r
-[assembly: AssemblyConfiguration("")]\r
-[assembly: AssemblyCompany("")]\r
-[assembly: AssemblyProduct("golib")]\r
-[assembly: AssemblyCopyright("Copyright © 2014")]\r
-[assembly: AssemblyTrademark("")]\r
-[assembly: AssemblyCulture("")]\r
-\r
-// Setting ComVisible to false makes the types in this assembly not visible \r
-// to COM components. If you need to access a type in this assembly from \r
-// COM, set the ComVisible attribute to true on that type.\r
-[assembly: ComVisible(false)]\r
-\r
-// The following GUID is for the ID of the typelib if this project is exposed to COM\r
-[assembly: Guid("150376dc-e648-46a2-b692-6429d0a62362")]\r
-\r
-// Version information for an assembly consists of the following four values:\r
-//\r
-// Major Version\r
-// Minor Version \r
-// Build Number\r
-// Revision\r
-//\r
-// You can specify all the values or you can default the Build and Revision Numbers \r
-// by using the '*' as shown below:\r
-// [assembly: AssemblyVersion("1.0.*")]\r
-[assembly: AssemblyVersion("1.0.0.1")]\r
-[assembly: AssemblyFileVersion("1.0.0.1")]\r
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("golib")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("golib")]
+[assembly: AssemblyCopyright("Copyright © 2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("150376dc-e648-46a2-b692-6429d0a62362")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.1")]
+[assembly: AssemblyFileVersion("1.0.0.1")]
-<?xml version="1.0"?>\r
-<Group Margin="0" Width="-1" Height="-1" Focusable="false">\r
- <Image Name="Image" Path="#go.Images.meter.svg" SvgSub="background"/>\r
-<!-- <Image Name="Image" Path="#go.Images.meter.svg" SvgSub="gauge"/>-->\r
+<?xml version="1.0"?>
+<Group Margin="0" Width="-1" Height="-1" Focusable="false">
+ <Image Name="Image" Path="#go.Images.meter.svg" SvgSub="background"/>
+<!-- <Image Name="Image" Path="#go.Images.meter.svg" SvgSub="gauge"/>-->
</Group>
\ No newline at end of file
-<?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
+<?xml version="1.0"?>
+<!--<HorizontalStack Spacing="1" Height="100" Width="300">
+ <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>
+ <Label Text="{../../Caption}" Height="80" Width="200"/>
+</HorizontalStack>-->
+<Border Name="Content"
+ Background="Gray" Foreground="DarkGray"
+ Height="{../TemplatedHeight}" Width="{../TemplatedWidth}"
+ MouseEnter="{Foreground=White}"
+ MouseLeave="{Foreground=DarkGray}"
+ MouseDown="{Background=LightGray}"
+ MouseUp="{Background=Gray}"
+ >
</Border>
\ No newline at end of file
-<?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
+<?xml version="1.0"?>
+<!--<HorizontalStack Spacing="1" Height="100" Width="300">
+ <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>
+ <Label Text="{../../Caption}" Height="80" Width="200"/>
+</HorizontalStack>-->
+<Border Fit="True" Background="Gray" MinimumSize="50;20" Foreground="Gray" CornerRadius="3"
+ MouseEnter="{Foreground=White;caption.Foreground=White}"
+ MouseLeave="{Foreground=Gray;caption.Foreground=Black}"
+ MouseDown="{Background=LightGray}"
+ MouseUp="{Background=Gray}"
+ >
+<!-- <Image Height="0" Width="0" Margin="0" Path="{../../Image}" SvgSub="{../../SvgSub}"/>-->
+ <Label Name="caption" Margin="5" Foreground="Black" Text="{../../Caption}"/>
</Border>
\ No newline at end of file
-<?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
-<HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
- <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>\r
- <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>\r
+<?xml version="1.0"?>
+<!--<HorizontalStack Spacing="1" Height="100" Width="300">
+ <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>
+ <Label Text="{../../Caption}" Height="80" Width="200"/>
+</HorizontalStack>-->
+<HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
+ <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>
+ <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>
</HorizontalStack>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<HorizontalStack Margin="0" Spacing="1" Focusable="false">\r
- <Image Name="Image" Width="16" Height="16" Path="#go.Images.Icons.checkbox.svg"/>\r
- <Label Name="Caption" Background="Red"/>\r
+<?xml version="1.0"?>
+<HorizontalStack Margin="0" Spacing="1" Focusable="false">
+ <Image Name="Image" Width="16" Height="16" Path="#go.Images.Icons.checkbox.svg"/>
+ <Label Name="Caption" Background="Red"/>
</HorizontalStack>
\ No newline at end of file
-<?xml version="1.0"?>\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
- <Button Width="14" Height="14" >\r
- <Image Margin="0" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>\r
- </Button>\r
- </HorizontalStack>\r
+<?xml version="1.0"?>
+<Border CornerRadius="0" Foreground="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
+ <HorizontalStack Margin="1" Spacing="1" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
+ <Label Margin="1" Foreground="Black" Background="White" Text="{../../../Caption}"
+ Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>
+ <Button Width="14" Height="14" >
+ <Image Margin="0" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ </Button>
+ </HorizontalStack>
</Border>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >\r
-<!-- <Scroller Name="scroller1" Margin="1" VerticalScrolling="true"\r
- Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">-->\r
- <VerticalStack Height="-1" Width="{../../../TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
-<!-- </Scroller>-->\r
+<?xml version="1.0"?>
+<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >
+<!-- <Scroller Name="scroller1" Margin="1" VerticalScrolling="true"
+ Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">-->
+ <VerticalStack Height="-1" Width="{../../../TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>
+<!-- </Scroller>-->
</Border>
\ No newline at end of file
-<?xml version="1.0"?>\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
- <Image Margin="2" Width="12" Height="12" Path="{../../../../Image}" SvgSub="{../../../../SvgSub}"/>\r
- <Label Text="{../../../../Caption}" Width="{../../../../TemplatedWidth}"/>\r
- </HorizontalStack>\r
- <Container Name="Content" Visible="false" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>\r
- </VerticalStack>\r
+<?xml version="1.0"?>
+<Border BorderWidth="1" Foreground="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}"
+ MouseClick="../onMouseClick">
+ <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
+ <HorizontalStack Spacing="1" Height="-1" Width="{../../../TemplatedWidth}">
+ <Image Margin="2" Width="12" Height="12" Path="{../../../../Image}" SvgSub="{../../../../SvgSub}"/>
+ <Label Text="{../../../../Caption}" Width="{../../../../TemplatedWidth}"/>
+ </HorizontalStack>
+ <Container Name="Content" Visible="false" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>
+ </VerticalStack>
</Border>
\ No newline at end of file
-<?xml version="1.0"?>\r
-\r
-<Label Text="{}" Focusable="true" Fit="true" Margin="0"\r
- MouseEnter="{Background=SteelBlue}"\r
- MouseLeave="{Background=Transparent}"\r
-/>\r
-\r
+<?xml version="1.0"?>
+
+<Label Text="{}" Focusable="true" Fit="true" Margin="0"
+ MouseEnter="{Background=SteelBlue}"
+ MouseLeave="{Background=Transparent}"
+/>
+
-<?xml version="1.0"?>\r
-<!--<Border BorderWidth="1" Margin="1" MinimumSize="0;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="Gray">\r
- <VerticalStack Name="List" Margin="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>\r
-</Border>-->\r
-<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >\r
- <Scroller Name="scroller1" Margin="1" VerticalScrolling="true"\r
- Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
- <VerticalStack Height="-1" Width="{../../../TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>\r
- </Scroller>\r
+<?xml version="1.0"?>
+<!--<Border BorderWidth="1" Margin="1" MinimumSize="0;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="Gray">
+ <VerticalStack Name="List" Margin="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>
+</Border>-->
+<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >
+ <Scroller Name="scroller1" Margin="1" VerticalScrolling="true"
+ Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
+ <VerticalStack Height="-1" Width="{../../../TemplatedWidth}" Name="List" Margin="0" VerticalAlignment="Top"/>
+ </Scroller>
</Border>
\ No newline at end of file
-<?xml version="1.0"?>\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
- </HorizontalStack>\r
+<?xml version="1.0"?>
+<Border BorderWidth="1" Foreground="LightGray" Height="-1" Width="{../TemplatedWidth}" MouseClick="../onMouseClick">
+ <HorizontalStack Spacing="1" Height="-1" Width="{../../TemplatedWidth}">
+ <Image Margin="2" Width="12" Height="12" Path="{../../../Image}" SvgSub="{../../../SvgSub}"/>
+ <Label Text="{../../../Caption}" Width="{../../../TemplatedWidth}"/>
+ </HorizontalStack>
</Border>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
- <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>\r
- <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>\r
+<?xml version="1.0"?>
+<HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
+ <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>
+ <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>
</HorizontalStack>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<Border BorderWidth="1" Foreground="LightGray" Width="{../TemplatedWidth}" Height="{../TemplatedHeight}">\r
- <GenericStack Orientation="{../../Orientation}" Width="{../../TemplatedWidth}" Height="{../../TemplatedHeight}">\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 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" Foreground="LightGray" Width="{../TemplatedWidth}" Height="{../TemplatedHeight}">
+ <GenericStack Orientation="{../../Orientation}" Width="{../../TemplatedWidth}" Height="{../../TemplatedHeight}">
+ <Button MouseRepeat="true" Width="12" Height="8" MouseClick="../../../onScrollBack"
+ Template="#Crow.Templates.ArrowButTemplate.crow">
+ <Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="up"/>
+ </Button>
+ <Slider Name="Slider" Value="{../../../Scroll}" Maximum="{../../../MaximumScroll}"
+ Width="{../../../TemplatedWidth}" Height="{../../../TemplatedHeight}" Orientation="{../../../Orientation}"
+ ValueChanged="../../../onSliderValueChange"/>
+ <Button MouseRepeat="true" Width="12" Height="8" MouseClick="../../../onScrollForth"
+ Template="#Crow.Templates.ArrowButTemplate.crow">
+ <Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ </Button>
+ </GenericStack>
</Border>
\ No newline at end of file
-<?xml version="1.0"?>\r
+<?xml version="1.0"?>
-<?xml version="1.0"?>\r
-<Border BorderWidth="1" Foreground="White" CornerRadius="20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
- <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\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" 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
- <GraphicObject Width="5"/>\r
- </HorizontalStack>\r
- </Border>\r
- <Container Name="Content" Height="{../../../../TemplatedHeight}" Width="{../../../../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>\r
- </VerticalStack>\r
+<?xml version="1.0"?>
+<Border BorderWidth="1" Foreground="White" CornerRadius="20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
+ <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
+ <Border Name="TitleBar" 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"/>
+ <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" 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>
+ <GraphicObject Width="5"/>
+ </HorizontalStack>
+ </Border>
+ <Container Name="Content" Height="{../../../../TemplatedHeight}" Width="{../../../../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>
+ </VerticalStack>
</Border>
\ No newline at end of file
-<?xml version="1.0"?>\r
- <VerticalStack Width="0" Height="-1" Focusable="true" \r
- MouseEnter="{Background=BlueCrayola}"\r
- MouseLeave="{Background=Transparent}">\r
- <Image Width="-1" Height="-1" Path="{FullName}" MaximumSize="80;80"/>\r
- <Label Text="{Name}" Width="-1" Height="-1" Margin="0" MaximumSize="100;0"/>\r
- </VerticalStack>\r
-\r
+<?xml version="1.0"?>
+ <VerticalStack Width="0" Height="-1" Focusable="true"
+ MouseEnter="{Background=BlueCrayola}"
+ MouseLeave="{Background=Transparent}">
+ <Image Width="-1" Height="-1" Path="{FullName}" MaximumSize="80;80"/>
+ <Label Text="{Name}" Width="-1" Height="-1" Margin="0" MaximumSize="100;0"/>
+ </VerticalStack>
+
-<?xml version="1.0"?>\r
- <HorizontalStack Width="-1" Height="-1" Focusable="true"\r
- HorizontalAlignment="Left"\r
- MouseEnter="{Background=BlueCrayola}"\r
- MouseLeave="{Background=Transparent}">\r
- <Image Width="16" Height="16" Path="#Tests.image.folder1.svg" SvgSub="{Attributes}"/>\r
- <Label Text="{Name}" Width="-1" Height="-1" Margin="0"/>\r
-<!-- <Label Text="{Attributes}" Width="-1" Height="-1" Margin="0"/>\r
- <Label Text="{Extension}" Width="-1" Height="-1" Margin="0"/>-->\r
- </HorizontalStack>\r
-\r
+<?xml version="1.0"?>
+ <HorizontalStack Width="-1" Height="-1" Focusable="true"
+ HorizontalAlignment="Left"
+ MouseEnter="{Background=BlueCrayola}"
+ MouseLeave="{Background=Transparent}">
+ <Image Width="16" Height="16" Path="#Tests.image.folder1.svg" SvgSub="{Attributes}"/>
+ <Label Text="{Name}" Width="-1" Height="-1" Margin="0"/>
+<!-- <Label Text="{Attributes}" Width="-1" Height="-1" Margin="0"/>
+ <Label Text="{Extension}" Width="-1" Height="-1" Margin="0"/>-->
+ </HorizontalStack>
+
-#define MONO_CAIRO_DEBUG_DISPOSE\r
-\r
-\r
-using System;\r
-using System.Runtime.InteropServices;\r
-using OpenTK;\r
-using OpenTK.Graphics.OpenGL;\r
-using OpenTK.Input;\r
-\r
-using System.Diagnostics;\r
-\r
-//using GGL;\r
-using Crow;\r
-using System.Threading;\r
-\r
-\r
-namespace test6\r
-{\r
- class GOLIBTest_0 : OpenTKGameWindow\r
- {\r
- public GOLIBTest_0 ()\r
- : base(1024, 600,"test")\r
- {}\r
-\r
- GraphicObject g;\r
- Label l;\r
-\r
- protected override void OnLoad (EventArgs e)\r
- {\r
- base.OnLoad (e);\r
- g = LoadInterface("Interfaces/test0.goml");\r
- l = g.FindByName ("labCpt") as Label;\r
- }\r
-\r
- void onUp (object sender, MouseButtonEventArgs e)\r
- {\r
- decimal tmp = 0;\r
- if (!decimal.TryParse (l.Text, out tmp))\r
- return;\r
- \r
- tmp += 1;\r
- l.Text = tmp.ToString ();\r
- }\r
- void onDown (object sender, MouseButtonEventArgs e)\r
- {\r
- decimal tmp = 0;\r
- if (!decimal.TryParse (l.Text, out tmp))\r
- return;\r
-\r
- tmp -= 1;\r
- l.Text = tmp.ToString ();\r
- }\r
-\r
- protected override void OnKeyDown (KeyboardKeyEventArgs e)\r
- {\r
- switch (e.Key) {\r
- case Key.Left:\r
- g.Left++;\r
- break;\r
- case Key.Right:\r
- g.Left--;\r
- break;\r
- case Key.Up:\r
- g.Top--;\r
- break;\r
- case Key.Down:\r
- g.Top++;\r
- break;\r
- default:\r
- break;\r
- }\r
- }\r
- protected override void OnUpdateFrame (FrameEventArgs e)\r
- {\r
- base.OnUpdateFrame (e);\r
- }\r
-\r
- [STAThread]\r
- static void Main ()\r
- {\r
- Console.WriteLine ("starting example");\r
-\r
- using (GOLIBTest_0 win = new GOLIBTest_0( )) {\r
- win.Run (30.0);\r
- }\r
- }\r
- }\r
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+//using GGL;
+using Crow;
+using System.Threading;
+
+
+namespace test6
+{
+ class GOLIBTest_0 : OpenTKGameWindow
+ {
+ public GOLIBTest_0 ()
+ : base(1024, 600,"test")
+ {}
+
+ GraphicObject g;
+ Label l;
+
+ protected override void OnLoad (EventArgs e)
+ {
+ base.OnLoad (e);
+ g = LoadInterface("Interfaces/test0.goml");
+ l = g.FindByName ("labCpt") as Label;
+ }
+
+ void onUp (object sender, MouseButtonEventArgs e)
+ {
+ decimal tmp = 0;
+ if (!decimal.TryParse (l.Text, out tmp))
+ return;
+
+ tmp += 1;
+ l.Text = tmp.ToString ();
+ }
+ void onDown (object sender, MouseButtonEventArgs e)
+ {
+ decimal tmp = 0;
+ if (!decimal.TryParse (l.Text, out tmp))
+ return;
+
+ tmp -= 1;
+ l.Text = tmp.ToString ();
+ }
+
+ protected override void OnKeyDown (KeyboardKeyEventArgs e)
+ {
+ switch (e.Key) {
+ case Key.Left:
+ g.Left++;
+ break;
+ case Key.Right:
+ g.Left--;
+ break;
+ case Key.Up:
+ g.Top--;
+ break;
+ case Key.Down:
+ g.Top++;
+ break;
+ default:
+ break;
+ }
+ }
+ protected override void OnUpdateFrame (FrameEventArgs e)
+ {
+ base.OnUpdateFrame (e);
+ }
+
+ [STAThread]
+ static void Main ()
+ {
+ Console.WriteLine ("starting example");
+
+ using (GOLIBTest_0 win = new GOLIBTest_0( )) {
+ win.Run (30.0);
+ }
+ }
+ }
}
\ No newline at end of file
-#define MONO_CAIRO_DEBUG_DISPOSE\r
-\r
-\r
-using System;\r
-using System.Runtime.InteropServices;\r
-using OpenTK;\r
-using OpenTK.Graphics.OpenGL;\r
-using OpenTK.Input;\r
-\r
-using System.Diagnostics;\r
-\r
-\r
-using Crow;\r
-using System.Threading;\r
-using System.Collections.Generic;\r
-using System.IO;\r
-\r
-\r
-namespace test\r
-{\r
-\r
- class GOLIBTest_4 : OpenTKGameWindow, IValueChange\r
- {\r
- #region IValueChange implementation\r
-\r
- public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
-\r
- #endregion\r
-\r
- public GOLIBTest_4 ()\r
- : base(1024, 800,"test4")\r
- {}\r
-\r
-\r
- #region FPS\r
- int _fps = 0;\r
-\r
- public int fps {\r
- get { return _fps; }\r
- set {\r
- if (_fps == value)\r
- return;\r
-\r
- _fps = value;\r
-\r
- if (_fps > fpsMax) {\r
- fpsMax = _fps;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax));\r
- } else if (_fps < fpsMin) {\r
- fpsMin = _fps;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin));\r
- }\r
-\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));\r
- ValueChanged.Raise (this, new ValueChangeEventArgs ("update",\r
- this.updateTime.ElapsedMilliseconds.ToString () + " ms"));\r
- }\r
- }\r
-\r
- public int fpsMin = int.MaxValue;\r
- public int fpsMax = 0;\r
-\r
- void resetFps ()\r
- {\r
- fpsMin = int.MaxValue;\r
- fpsMax = 0;\r
- _fps = 0;\r
- }\r
- public string update = "";\r
- #endregion\r
-\r
-\r
- GraphicObject c;\r
- ProgressBar pb, pb2;\r
- Label labMousePos, labPb, labF, labA, labH, labFps, labFpsMin, labFpsMax, labV,\r
- labUpdate;\r
- Slider slTest;\r
- Group colors;\r
-\r
- public List<ClsItem> TestList = new List<ClsItem>(new ClsItem[] \r
- {\r
- new ClsItem("string 1"),\r
- new ClsItem("string 2")\r
- });\r
- int i = 0;\r
- Color[] colorsArray;\r
- volatile List<GraphicObject> loadedCols = new List<GraphicObject>();\r
- volatile bool allColsLoaded = false;\r
- private static readonly object mutex = new object();\r
-\r
- protected override void OnLoad (EventArgs e)\r
- {\r
- base.OnLoad (e);\r
-\r
- c = LoadInterface("Interfaces/test4.goml");\r
- //LoadInterface("golibtests/test4.xml", out c2);\r
- //c2.HorizontalAlignment = HorizontalAlignment.Left;\r
- //c2.VerticalAlignment = VerticalAlignment.Top;\r
- c.Background.AdjustAlpha (0.5);\r
-// labMousePos = c.FindByName ("labMouse") as Label;\r
-// //pb = c.FindByName("pbBar") as ProgressBar;\r
-// pb2 = c.FindByName("pbBar2") as ProgressBar;\r
-// labPb = c.FindByName ("labPb") as Label;\r
- labF = c.FindByName ("labFocus") as Label;\r
- labA = c.FindByName ("labActive") as Label;\r
- labH = c.FindByName ("labHover") as Label;\r
-// labFps = c.FindByName ("labFps") as Label;\r
-// labFpsMin = c.FindByName ("labFpsMin") as Label;\r
-// labFpsMax = c.FindByName ("labFpsMax") as Label;\r
-// labV = c.FindByName ("labValue") as Label;\r
-// labUpdate = c.FindByName ("labUpdate") as Label;\r
-// slTest = c.FindByName ("slider") as Slider;\r
- colors = c.FindByName ("colors") as Group;\r
-\r
-\r
- c.MouseMove += pFps_mousemove;\r
-// slTest.ValueChanged += (object sender, ValueChangeEventArgs vce) => {\r
-// labV.Text = vce.NewValue.ToString ("00.00");\r
-// };\r
-\r
-\r
- colorsArray = Color.ColorDic.ToArray ();\r
-\r
- Thread t = new Thread (loadingThread);\r
- t.Start ();\r
-\r
-// ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList));\r
- }\r
-\r
- void loadingThread()\r
- { \r
- foreach (Color col in colorsArray) {\r
- HorizontalStack s = new HorizontalStack () { Fit = true};\r
- s.HorizontalAlignment = HorizontalAlignment.Left;\r
- Border b = new Border () {\r
- Bounds = new Size (32, 20),\r
- CornerRadius = 5,\r
- Background = col,\r
- BorderWidth = 2,\r
- Foreground = Color.Transparent,\r
- Focusable = true\r
- };\r
- b.MouseEnter += delegate(object sender, MouseMoveEventArgs ee) {\r
- (sender as Border).Foreground = Color.White;\r
- };\r
- b.MouseLeave += delegate(object sender, MouseMoveEventArgs ee) {\r
- (sender as Border).Foreground = Color.Transparent;\r
- };\r
- s.addChild (b);\r
-\r
- s.addChild (\r
- new Label (col.ToString ()){\r
- Bounds=new Rectangle(0,0,-1,-1),\r
- }\r
- );\r
- i++;\r
-\r
- while(true){\r
- lock (mutex) {\r
- loadedCols.Add (s);\r
- break;\r
- }\r
- }\r
-\r
- Thread.Sleep (10);\r
- \r
- } \r
- allColsLoaded = true;\r
- }\r
- void pFps_mousemove(object sender, MouseMoveEventArgs e)\r
- {\r
- if (!e.Mouse.IsButtonDown (MouseButton.Left)||sender!=c)\r
- return;\r
- redrawClip.AddRectangle (c.ScreenCoordinates(c.Slot));\r
- c.Left += e.XDelta;\r
- c.Top += e.YDelta;\r
- c.registerForGraphicUpdate ();\r
- }\r
- void onButClick(object send, MouseButtonEventArgs e)\r
- {\r
- Color col = Color.ColorDic.ToArray () [i];\r
- HorizontalStack s = colors.addChild (new HorizontalStack () { Fit = true});\r
- s.HorizontalAlignment = HorizontalAlignment.Left;\r
- Border b = new Border () {\r
- Bounds = new Size (32, 20),\r
- CornerRadius = 5,\r
- Background = col,\r
- BorderWidth = 2,\r
- Foreground = Color.Transparent,\r
- Focusable = true\r
- };\r
- b.MouseEnter += delegate(object sender, MouseMoveEventArgs ee) {\r
- (sender as Border).Foreground = Color.White;\r
- };\r
- b.MouseLeave += delegate(object sender, MouseMoveEventArgs ee) {\r
- (sender as Border).Foreground = Color.Transparent;\r
- };\r
- s.addChild (b);\r
-\r
- s.addChild (\r
- new Label (col.ToString ()){\r
- Bounds=new Rectangle(0,0,-1,-1),\r
- }\r
- );\r
- i++;\r
- }\r
- private int frameCpt = 0;\r
- protected override void OnUpdateFrame (FrameEventArgs e)\r
- {\r
- base.OnUpdateFrame (e);\r
-\r
- fps = (int)RenderFrequency;\r
-\r
- lock (mutex) {\r
- if (loadedCols.Count > 50 || allColsLoaded) {\r
- while (loadedCols.Count > 0) {\r
- colors.addChild (loadedCols[0]);\r
- loadedCols.RemoveAt (0);\r
- }\r
- }\r
- }\r
-\r
- if (frameCpt > 200) {\r
- resetFps ();\r
- frameCpt = 0;\r
- }\r
- frameCpt++;\r
-\r
-\r
-// if (FocusedWidget==null)\r
-// labF.Text = "- none -";\r
-// else\r
-// labF.Text = FocusedWidget.Name;\r
-//\r
-// if (activeWidget==null)\r
-// labA.Text = "- none -";\r
-// else\r
-// labA.Text = activeWidget.Name;\r
-//\r
-// if (hoverWidget==null)\r
-// labH.Text = "- none -";\r
-// else\r
-// labH.Text = hoverWidget.Name;\r
- }\r
- //public Point MousePosition;\r
-\r
- protected override void OnMouseMove (MouseMoveEventArgs e)\r
- {\r
- base.OnMouseMove (e);\r
- //MousePosition = e.Position;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("MousePosition", e.Position.ToString()));\r
- }\r
- [STAThread]\r
- static void Main ()\r
- {\r
- Console.WriteLine ("starting example");\r
-\r
- using (GOLIBTest_4 win = new GOLIBTest_4( )) {\r
- win.Run (60.0);\r
- }\r
- }\r
- }\r
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+
+using Crow;
+using System.Threading;
+using System.Collections.Generic;
+using System.IO;
+
+
+namespace test
+{
+
+ class GOLIBTest_4 : OpenTKGameWindow, IValueChange
+ {
+ #region IValueChange implementation
+
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+
+ #endregion
+
+ public GOLIBTest_4 ()
+ : base(1024, 800,"test4")
+ {}
+
+
+ #region FPS
+ int _fps = 0;
+
+ public int fps {
+ get { return _fps; }
+ set {
+ if (_fps == value)
+ return;
+
+ _fps = value;
+
+ if (_fps > fpsMax) {
+ fpsMax = _fps;
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax));
+ } else if (_fps < fpsMin) {
+ fpsMin = _fps;
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin));
+ }
+
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));
+ ValueChanged.Raise (this, new ValueChangeEventArgs ("update",
+ this.updateTime.ElapsedMilliseconds.ToString () + " ms"));
+ }
+ }
+
+ public int fpsMin = int.MaxValue;
+ public int fpsMax = 0;
+
+ void resetFps ()
+ {
+ fpsMin = int.MaxValue;
+ fpsMax = 0;
+ _fps = 0;
+ }
+ public string update = "";
+ #endregion
+
+
+ GraphicObject c;
+ ProgressBar pb, pb2;
+ Label labMousePos, labPb, labF, labA, labH, labFps, labFpsMin, labFpsMax, labV,
+ labUpdate;
+ Slider slTest;
+ Group colors;
+
+ public List<ClsItem> TestList = new List<ClsItem>(new ClsItem[]
+ {
+ new ClsItem("string 1"),
+ new ClsItem("string 2")
+ });
+ int i = 0;
+ Color[] colorsArray;
+ volatile List<GraphicObject> loadedCols = new List<GraphicObject>();
+ volatile bool allColsLoaded = false;
+ private static readonly object mutex = new object();
+
+ protected override void OnLoad (EventArgs e)
+ {
+ base.OnLoad (e);
+
+ c = LoadInterface("Interfaces/test4.goml");
+ //LoadInterface("golibtests/test4.xml", out c2);
+ //c2.HorizontalAlignment = HorizontalAlignment.Left;
+ //c2.VerticalAlignment = VerticalAlignment.Top;
+ c.Background.AdjustAlpha (0.5);
+// labMousePos = c.FindByName ("labMouse") as Label;
+// //pb = c.FindByName("pbBar") as ProgressBar;
+// pb2 = c.FindByName("pbBar2") as ProgressBar;
+// labPb = c.FindByName ("labPb") as Label;
+ labF = c.FindByName ("labFocus") as Label;
+ labA = c.FindByName ("labActive") as Label;
+ labH = c.FindByName ("labHover") as Label;
+// labFps = c.FindByName ("labFps") as Label;
+// labFpsMin = c.FindByName ("labFpsMin") as Label;
+// labFpsMax = c.FindByName ("labFpsMax") as Label;
+// labV = c.FindByName ("labValue") as Label;
+// labUpdate = c.FindByName ("labUpdate") as Label;
+// slTest = c.FindByName ("slider") as Slider;
+ colors = c.FindByName ("colors") as Group;
+
+
+ c.MouseMove += pFps_mousemove;
+// slTest.ValueChanged += (object sender, ValueChangeEventArgs vce) => {
+// labV.Text = vce.NewValue.ToString ("00.00");
+// };
+
+
+ colorsArray = Color.ColorDic.ToArray ();
+
+ Thread t = new Thread (loadingThread);
+ t.Start ();
+
+// ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList));
+ }
+
+ void loadingThread()
+ {
+ foreach (Color col in colorsArray) {
+ HorizontalStack s = new HorizontalStack () { Fit = true};
+ s.HorizontalAlignment = HorizontalAlignment.Left;
+ Border b = new Border () {
+ Bounds = new Size (32, 20),
+ CornerRadius = 5,
+ Background = col,
+ BorderWidth = 2,
+ Foreground = Color.Transparent,
+ Focusable = true
+ };
+ b.MouseEnter += delegate(object sender, MouseMoveEventArgs ee) {
+ (sender as Border).Foreground = Color.White;
+ };
+ b.MouseLeave += delegate(object sender, MouseMoveEventArgs ee) {
+ (sender as Border).Foreground = Color.Transparent;
+ };
+ s.addChild (b);
+
+ s.addChild (
+ new Label (col.ToString ()){
+ Bounds=new Rectangle(0,0,-1,-1),
+ }
+ );
+ i++;
+
+ while(true){
+ lock (mutex) {
+ loadedCols.Add (s);
+ break;
+ }
+ }
+
+ Thread.Sleep (10);
+
+ }
+ allColsLoaded = true;
+ }
+ void pFps_mousemove(object sender, MouseMoveEventArgs e)
+ {
+ if (!e.Mouse.IsButtonDown (MouseButton.Left)||sender!=c)
+ return;
+ redrawClip.AddRectangle (c.ScreenCoordinates(c.Slot));
+ c.Left += e.XDelta;
+ c.Top += e.YDelta;
+ c.registerForGraphicUpdate ();
+ }
+ void onButClick(object send, MouseButtonEventArgs e)
+ {
+ Color col = Color.ColorDic.ToArray () [i];
+ HorizontalStack s = colors.addChild (new HorizontalStack () { Fit = true});
+ s.HorizontalAlignment = HorizontalAlignment.Left;
+ Border b = new Border () {
+ Bounds = new Size (32, 20),
+ CornerRadius = 5,
+ Background = col,
+ BorderWidth = 2,
+ Foreground = Color.Transparent,
+ Focusable = true
+ };
+ b.MouseEnter += delegate(object sender, MouseMoveEventArgs ee) {
+ (sender as Border).Foreground = Color.White;
+ };
+ b.MouseLeave += delegate(object sender, MouseMoveEventArgs ee) {
+ (sender as Border).Foreground = Color.Transparent;
+ };
+ s.addChild (b);
+
+ s.addChild (
+ new Label (col.ToString ()){
+ Bounds=new Rectangle(0,0,-1,-1),
+ }
+ );
+ i++;
+ }
+ private int frameCpt = 0;
+ protected override void OnUpdateFrame (FrameEventArgs e)
+ {
+ base.OnUpdateFrame (e);
+
+ fps = (int)RenderFrequency;
+
+ lock (mutex) {
+ if (loadedCols.Count > 50 || allColsLoaded) {
+ while (loadedCols.Count > 0) {
+ colors.addChild (loadedCols[0]);
+ loadedCols.RemoveAt (0);
+ }
+ }
+ }
+
+ if (frameCpt > 200) {
+ resetFps ();
+ frameCpt = 0;
+ }
+ frameCpt++;
+
+
+// if (FocusedWidget==null)
+// labF.Text = "- none -";
+// else
+// labF.Text = FocusedWidget.Name;
+//
+// if (activeWidget==null)
+// labA.Text = "- none -";
+// else
+// labA.Text = activeWidget.Name;
+//
+// if (hoverWidget==null)
+// labH.Text = "- none -";
+// else
+// labH.Text = hoverWidget.Name;
+ }
+ //public Point MousePosition;
+
+ protected override void OnMouseMove (MouseMoveEventArgs e)
+ {
+ base.OnMouseMove (e);
+ //MousePosition = e.Position;
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("MousePosition", e.Position.ToString()));
+ }
+ [STAThread]
+ static void Main ()
+ {
+ Console.WriteLine ("starting example");
+
+ using (GOLIBTest_4 win = new GOLIBTest_4( )) {
+ win.Run (60.0);
+ }
+ }
+ }
}
\ No newline at end of file
-using System;\r
-using System.Runtime.InteropServices;\r
-using OpenTK;\r
-using OpenTK.Graphics.OpenGL;\r
-using OpenTK.Input;\r
-\r
-using System.Diagnostics;\r
-\r
-//using GGL;\r
-using Crow;\r
-using System.Threading;\r
-using System.Collections.Generic;\r
-\r
-\r
-namespace test\r
-{\r
- class GOLIBTest_5 : OpenTKGameWindow\r
- {\r
- public GOLIBTest_5 ()\r
- : base(1024, 600,"test5")\r
- {}\r
-\r
- GraphicObject c;\r
- List<GraphicObject> gl = new List<GraphicObject>();\r
- List<Label> ll = new List<Label>();\r
- protected override void OnLoad (EventArgs e)\r
- {\r
- base.OnLoad (e);\r
-\r
- c = LoadInterface("Interfaces/test5.goml");\r
- gl.Add (c.FindByName ("g0"));\r
- ll.Add (c.FindByName ("lab0")as Label);\r
- }\r
-\r
- int cpt;\r
- protected override void OnUpdateFrame (FrameEventArgs e)\r
- {\r
- if (cpt > 100)\r
- cpt = 0;\r
- else\r
- cpt++;\r
-\r
- foreach (Label l in ll) {\r
- l.Text = cpt.ToString ();\r
- }\r
- foreach (GraphicObject o in gl) {\r
- Color a = o.Background;\r
- if (a.A > 1)\r
- a.A = 0;\r
- else\r
- a.A += 0.05;\r
- //a.A = 0.5;\r
- o.Background = a;\r
- o.Width = cpt + 10;\r
- }\r
- base.OnUpdateFrame (e);\r
- }\r
-\r
- [STAThread]\r
- static void Main ()\r
- {\r
- using (GOLIBTest_5 win = new GOLIBTest_5( )) {\r
- win.Run (30.0);\r
- }\r
- }\r
- }\r
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+//using GGL;
+using Crow;
+using System.Threading;
+using System.Collections.Generic;
+
+
+namespace test
+{
+ class GOLIBTest_5 : OpenTKGameWindow
+ {
+ public GOLIBTest_5 ()
+ : base(1024, 600,"test5")
+ {}
+
+ GraphicObject c;
+ List<GraphicObject> gl = new List<GraphicObject>();
+ List<Label> ll = new List<Label>();
+ protected override void OnLoad (EventArgs e)
+ {
+ base.OnLoad (e);
+
+ c = LoadInterface("Interfaces/test5.goml");
+ gl.Add (c.FindByName ("g0"));
+ ll.Add (c.FindByName ("lab0")as Label);
+ }
+
+ int cpt;
+ protected override void OnUpdateFrame (FrameEventArgs e)
+ {
+ if (cpt > 100)
+ cpt = 0;
+ else
+ cpt++;
+
+ foreach (Label l in ll) {
+ l.Text = cpt.ToString ();
+ }
+ foreach (GraphicObject o in gl) {
+ Color a = o.Background;
+ if (a.A > 1)
+ a.A = 0;
+ else
+ a.A += 0.05;
+ //a.A = 0.5;
+ o.Background = a;
+ o.Width = cpt + 10;
+ }
+ base.OnUpdateFrame (e);
+ }
+
+ [STAThread]
+ static void Main ()
+ {
+ using (GOLIBTest_5 win = new GOLIBTest_5( )) {
+ win.Run (30.0);
+ }
+ }
+ }
}
\ No newline at end of file
-#define MONO_CAIRO_DEBUG_DISPOSE\r
-\r
-\r
-using System;\r
-using System.Runtime.InteropServices;\r
-using OpenTK;\r
-using OpenTK.Graphics.OpenGL;\r
-using OpenTK.Input;\r
-\r
-using System.Diagnostics;\r
-\r
-//using GGL;\r
-using Crow;\r
-using System.Threading;\r
-using System.Reflection;\r
-using System.Linq;\r
-using System.IO;\r
-using System.Collections.Generic;\r
-\r
-\r
-namespace test2\r
-{\r
- class GOLIBTest_DirViewer : OpenTKGameWindow, IValueChange\r
- {\r
- #region IValueChange implementation\r
- public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
- public void NotifyValueChanged(string name, object value)\r
- {\r
- ValueChanged.Raise (this, new ValueChangeEventArgs (name, value));\r
- }\r
- #endregion\r
-\r
- public GOLIBTest_DirViewer ()\r
- : base(1024, 600,"test")\r
- {}\r
-\r
- public DirContainer CurDir;\r
- FileDialog dialog;\r
-\r
- protected override void OnLoad (EventArgs e)\r
- {\r
- base.OnLoad (e);\r
-\r
- CurDir = new DirContainer(new DirectoryInfo ("/home/jp/"));\r
-\r
-// GraphicObject dv = Interface.Load ("Interfaces/testDirViewer.goml");\r
-// this.AddWidget(dv);\r
-// dv.DataSource = CurDir;\r
- dialog = new FileDialog();\r
- dialog.SearchPattern = ".png|.jpg|.jpeg|.gif|.svg";\r
- dialog.Show ();\r
-\r
- //LoadInterface("Interfaces/testTypeViewer.goml", out g);\r
- }\r
- \r
-\r
- [STAThread]\r
- static void Main ()\r
- {\r
- Console.WriteLine ("starting example");\r
-\r
- using (GOLIBTest_DirViewer win = new GOLIBTest_DirViewer( )) {\r
- win.Run (30.0);\r
- }\r
- }\r
- }\r
- public class DirContainer: IValueChange\r
- {\r
- #region IValueChange implementation\r
- public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
- public void NotifyValueChanged(string name, object value)\r
- {\r
- ValueChanged.Raise (this, new ValueChangeEventArgs (name, value));\r
- }\r
- #endregion\r
-\r
- public DirectoryInfo CurDir;\r
- public DirContainer(DirectoryInfo _dir){\r
- CurDir = _dir;\r
- }\r
- public string Name {\r
- get { return CurDir.Name; }\r
- }\r
- public FileSystemInfo[] GetFileSystemInfos\r
- {\r
- get {\r
- List<FileSystemInfo> tmp = CurDir.GetFileSystemInfos ().Where(fi => !fi.Attributes.HasFlag(FileAttributes.Hidden)).ToList();\r
- if (CurDir.Parent != null)\r
- tmp.Insert (0, CurDir.Parent);\r
- return tmp.ToArray ();\r
- }\r
- }\r
- void onDirUp(object sender, MouseButtonEventArgs e)\r
- {\r
- \r
- }\r
- public void onMouseDown(object sender, MouseButtonEventArgs e)\r
- {\r
- Debug.WriteLine (sender.ToString ());\r
- }\r
- void OnSelectedItemChanged (object sender, SelectionChangeEventArgs e)\r
- {\r
- CurDir = e.NewValue as DirectoryInfo;\r
- NotifyValueChanged ("GetFileSystemInfos", GetFileSystemInfos);\r
- NotifyValueChanged ("Name", Name);\r
-\r
- }\r
- }\r
-\r
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+//using GGL;
+using Crow;
+using System.Threading;
+using System.Reflection;
+using System.Linq;
+using System.IO;
+using System.Collections.Generic;
+
+
+namespace test2
+{
+ class GOLIBTest_DirViewer : OpenTKGameWindow, IValueChange
+ {
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ public void NotifyValueChanged(string name, object value)
+ {
+ ValueChanged.Raise (this, new ValueChangeEventArgs (name, value));
+ }
+ #endregion
+
+ public GOLIBTest_DirViewer ()
+ : base(1024, 600,"test")
+ {}
+
+ public DirContainer CurDir;
+ FileDialog dialog;
+
+ protected override void OnLoad (EventArgs e)
+ {
+ base.OnLoad (e);
+
+ CurDir = new DirContainer(new DirectoryInfo ("/home/jp/"));
+
+// GraphicObject dv = Interface.Load ("Interfaces/testDirViewer.goml");
+// this.AddWidget(dv);
+// dv.DataSource = CurDir;
+ dialog = new FileDialog();
+ dialog.SearchPattern = ".png|.jpg|.jpeg|.gif|.svg";
+ dialog.Show ();
+
+ //LoadInterface("Interfaces/testTypeViewer.goml", out g);
+ }
+
+
+ [STAThread]
+ static void Main ()
+ {
+ Console.WriteLine ("starting example");
+
+ using (GOLIBTest_DirViewer win = new GOLIBTest_DirViewer( )) {
+ win.Run (30.0);
+ }
+ }
+ }
+ public class DirContainer: IValueChange
+ {
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ public void NotifyValueChanged(string name, object value)
+ {
+ ValueChanged.Raise (this, new ValueChangeEventArgs (name, value));
+ }
+ #endregion
+
+ public DirectoryInfo CurDir;
+ public DirContainer(DirectoryInfo _dir){
+ CurDir = _dir;
+ }
+ public string Name {
+ get { return CurDir.Name; }
+ }
+ public FileSystemInfo[] GetFileSystemInfos
+ {
+ get {
+ List<FileSystemInfo> tmp = CurDir.GetFileSystemInfos ().Where(fi => !fi.Attributes.HasFlag(FileAttributes.Hidden)).ToList();
+ if (CurDir.Parent != null)
+ tmp.Insert (0, CurDir.Parent);
+ return tmp.ToArray ();
+ }
+ }
+ void onDirUp(object sender, MouseButtonEventArgs e)
+ {
+
+ }
+ public void onMouseDown(object sender, MouseButtonEventArgs e)
+ {
+ Debug.WriteLine (sender.ToString ());
+ }
+ void OnSelectedItemChanged (object sender, SelectionChangeEventArgs e)
+ {
+ CurDir = e.NewValue as DirectoryInfo;
+ NotifyValueChanged ("GetFileSystemInfos", GetFileSystemInfos);
+ NotifyValueChanged ("Name", Name);
+
+ }
+ }
+
}
\ No newline at end of file
-#define MONO_CAIRO_DEBUG_DISPOSE\r
-\r
-\r
-using System;\r
-using System.Runtime.InteropServices;\r
-using OpenTK;\r
-using OpenTK.Graphics.OpenGL;\r
-using OpenTK.Input;\r
-\r
-using System.Diagnostics;\r
-\r
-//using GGL;\r
-using Crow;\r
-using System.Threading;\r
-using System.Collections.Generic;\r
-using System.IO;\r
-using System.Linq;\r
-\r
-\r
-namespace test\r
-{\r
- public class ClsItem\r
- {\r
-// #region IValueChange implementation\r
-//\r
-// public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
-//\r
-// #endregion\r
-\r
- public string field;\r
-\r
- public string Field {\r
- get {\r
- return field;\r
- }\r
- set {\r
- field = value;\r
- //ValueChanged.Raise(this, new ValueChangeEventArgs ("Field", null, field));\r
- }\r
- }\r
-\r
- public ClsItem(){\r
- }\r
- public ClsItem(string str){\r
- Field = str;\r
- }\r
- }\r
- \r
- class GOLIBTest_Listbox : OpenTKGameWindow, IValueChange\r
- {\r
- #region IValueChange implementation\r
-\r
- public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
-\r
- #endregion\r
- \r
- public GOLIBTest_Listbox ()\r
- : base(1024, 600,"test")\r
- {}\r
-\r
-// public List<ClsItem> TestList = new List<ClsItem>(new ClsItem[] \r
-// {\r
-// new ClsItem("string 1"),\r
-// new ClsItem("string 2"),\r
-// new ClsItem("string 3")\r
-// });\r
- public List<string> TestList;/* = new List<string>( new string[] \r
- {\r
- "string 1",\r
- "string 2",\r
- "string 3"\r
- }); */\r
-\r
- public String Hover {\r
- get { return hoverWidget == null ? "None" : hoverWidget.ToString(); }\r
- }\r
- Point mPos;\r
- public string MousePos {\r
- get { return mPos.ToString(); }\r
- }\r
- protected override void OnLoad (EventArgs e)\r
- {\r
- base.OnLoad (e);\r
-\r
- //TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList();\r
- GraphicObject tlb = LoadInterface("Interfaces/test_Listbox.goml");\r
- tlb.DataSource = this;\r
-\r
-// TestList [1].Field = "test string";\r
-// ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList));\r
- }\r
- void OnClear (object sender, MouseButtonEventArgs e){\r
- TestList = null;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList));\r
- }\r
- void OnLoadList (object sender, MouseButtonEventArgs e){\r
- TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList();\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList));\r
- }\r
- protected override void OnMouseMove (MouseMoveEventArgs e)\r
- { \r
- base.OnMouseMove (e);\r
- ValueChanged.Raise (this, new ValueChangeEventArgs ("Hover", Hover));\r
- ValueChanged.Raise (this, new ValueChangeEventArgs ("MousePos", e.Position.ToString()));\r
- }\r
-\r
- protected override void OnUpdateFrame (FrameEventArgs e)\r
- {\r
- base.OnUpdateFrame (e);\r
- }\r
- protected override void OnKeyDown (KeyboardKeyEventArgs e)\r
- {\r
- TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList();\r
- //TestList.Add ("newly added list item");\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList));\r
- }\r
-\r
- [STAThread]\r
- static void Main ()\r
- {\r
- Console.WriteLine ("starting example");\r
-\r
- using (GOLIBTest_Listbox win = new GOLIBTest_Listbox( )) {\r
- win.Run (30.0);\r
- }\r
- }\r
- }\r
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+//using GGL;
+using Crow;
+using System.Threading;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+
+
+namespace test
+{
+ public class ClsItem
+ {
+// #region IValueChange implementation
+//
+// public event EventHandler<ValueChangeEventArgs> ValueChanged;
+//
+// #endregion
+
+ public string field;
+
+ public string Field {
+ get {
+ return field;
+ }
+ set {
+ field = value;
+ //ValueChanged.Raise(this, new ValueChangeEventArgs ("Field", null, field));
+ }
+ }
+
+ public ClsItem(){
+ }
+ public ClsItem(string str){
+ Field = str;
+ }
+ }
+
+ class GOLIBTest_Listbox : OpenTKGameWindow, IValueChange
+ {
+ #region IValueChange implementation
+
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+
+ #endregion
+
+ public GOLIBTest_Listbox ()
+ : base(1024, 600,"test")
+ {}
+
+// public List<ClsItem> TestList = new List<ClsItem>(new ClsItem[]
+// {
+// new ClsItem("string 1"),
+// new ClsItem("string 2"),
+// new ClsItem("string 3")
+// });
+ public List<string> TestList;/* = new List<string>( new string[]
+ {
+ "string 1",
+ "string 2",
+ "string 3"
+ }); */
+
+ public String Hover {
+ get { return hoverWidget == null ? "None" : hoverWidget.ToString(); }
+ }
+ Point mPos;
+ public string MousePos {
+ get { return mPos.ToString(); }
+ }
+ protected override void OnLoad (EventArgs e)
+ {
+ base.OnLoad (e);
+
+ //TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList();
+ GraphicObject tlb = LoadInterface("Interfaces/test_Listbox.goml");
+ tlb.DataSource = this;
+
+// TestList [1].Field = "test string";
+// ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList));
+ }
+ void OnClear (object sender, MouseButtonEventArgs e){
+ TestList = null;
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList));
+ }
+ void OnLoadList (object sender, MouseButtonEventArgs e){
+ TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList();
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList));
+ }
+ protected override void OnMouseMove (MouseMoveEventArgs e)
+ {
+ base.OnMouseMove (e);
+ ValueChanged.Raise (this, new ValueChangeEventArgs ("Hover", Hover));
+ ValueChanged.Raise (this, new ValueChangeEventArgs ("MousePos", e.Position.ToString()));
+ }
+
+ protected override void OnUpdateFrame (FrameEventArgs e)
+ {
+ base.OnUpdateFrame (e);
+ }
+ protected override void OnKeyDown (KeyboardKeyEventArgs e)
+ {
+ TestList = Directory.GetFileSystemEntries("/home/jp/tmp/mtgdata/a", "*.txt",SearchOption.AllDirectories).ToList();
+ //TestList.Add ("newly added list item");
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("TestList", TestList));
+ }
+
+ [STAThread]
+ static void Main ()
+ {
+ Console.WriteLine ("starting example");
+
+ using (GOLIBTest_Listbox win = new GOLIBTest_Listbox( )) {
+ win.Run (30.0);
+ }
+ }
+ }
}
\ No newline at end of file
-#define MONO_CAIRO_DEBUG_DISPOSE\r
-\r
-\r
-using System;\r
-using System.Runtime.InteropServices;\r
-using OpenTK;\r
-using OpenTK.Graphics.OpenGL;\r
-using OpenTK.Input;\r
-\r
-using System.Diagnostics;\r
-\r
-//using GGL;\r
-using Crow;\r
-using System.Threading;\r
-using System.Reflection;\r
-using System.Linq;\r
-\r
-\r
-namespace test\r
-{\r
- class GOLIBTest_TypeViewer : OpenTKGameWindow\r
- {\r
- public GOLIBTest_TypeViewer ()\r
- : base(1024, 600,"test")\r
- {}\r
-\r
- VerticalStack g;\r
- TypeContainer type;\r
-\r
- protected override void OnLoad (EventArgs e)\r
- {\r
- base.OnLoad (e);\r
- type = new TypeContainer(typeof (GraphicObject));\r
-\r
- //this.AddWidget(Interface.Load ("Interfaces/testTypeViewer.goml", type));\r
- GraphicObject go = LoadInterface("Interfaces/testTypeViewer.goml");\r
- go.DataSource = type;\r
- }\r
-\r
- protected override void OnRenderFrame (FrameEventArgs e)\r
- {\r
- GL.Clear (ClearBufferMask.ColorBufferBit);\r
- base.OnRenderFrame (e);\r
- SwapBuffers ();\r
-\r
- MemberInfo mi;\r
-\r
-\r
- }\r
-\r
- [STAThread]\r
- static void Main ()\r
- {\r
- Console.WriteLine ("starting example");\r
-\r
- using (GOLIBTest_TypeViewer win = new GOLIBTest_TypeViewer( )) {\r
- win.Run (30.0);\r
- }\r
- }\r
- }\r
- public class TypeContainer\r
- {\r
- public Type Type;\r
- public TypeContainer(Type _type){\r
- Type = _type;\r
- }\r
- public string Name {\r
- get { return Type.Name; }\r
- }\r
- public MemberInfo[] Members {\r
- get {\r
- MemberInfo[] mi = Properties.Cast<MemberInfo> ().Concat (Methods.Cast<MemberInfo> ()).ToArray(); \r
- return mi;\r
- }\r
- }\r
- public MethodInfo[] Methods {\r
- get { return Type.GetMethods (BindingFlags.Public | BindingFlags.Instance).Where (m => !m.IsSpecialName).ToArray(); }\r
- }\r
- public PropertyInfo[] Properties {\r
- get { return Type.GetProperties (); }\r
- }\r
- \r
- }\r
-\r
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+//using GGL;
+using Crow;
+using System.Threading;
+using System.Reflection;
+using System.Linq;
+
+
+namespace test
+{
+ class GOLIBTest_TypeViewer : OpenTKGameWindow
+ {
+ public GOLIBTest_TypeViewer ()
+ : base(1024, 600,"test")
+ {}
+
+ VerticalStack g;
+ TypeContainer type;
+
+ protected override void OnLoad (EventArgs e)
+ {
+ base.OnLoad (e);
+ type = new TypeContainer(typeof (GraphicObject));
+
+ //this.AddWidget(Interface.Load ("Interfaces/testTypeViewer.goml", type));
+ GraphicObject go = LoadInterface("Interfaces/testTypeViewer.goml");
+ go.DataSource = type;
+ }
+
+ protected override void OnRenderFrame (FrameEventArgs e)
+ {
+ GL.Clear (ClearBufferMask.ColorBufferBit);
+ base.OnRenderFrame (e);
+ SwapBuffers ();
+
+ MemberInfo mi;
+
+
+ }
+
+ [STAThread]
+ static void Main ()
+ {
+ Console.WriteLine ("starting example");
+
+ using (GOLIBTest_TypeViewer win = new GOLIBTest_TypeViewer( )) {
+ win.Run (30.0);
+ }
+ }
+ }
+ public class TypeContainer
+ {
+ public Type Type;
+ public TypeContainer(Type _type){
+ Type = _type;
+ }
+ public string Name {
+ get { return Type.Name; }
+ }
+ public MemberInfo[] Members {
+ get {
+ MemberInfo[] mi = Properties.Cast<MemberInfo> ().Concat (Methods.Cast<MemberInfo> ()).ToArray();
+ return mi;
+ }
+ }
+ public MethodInfo[] Methods {
+ get { return Type.GetMethods (BindingFlags.Public | BindingFlags.Instance).Where (m => !m.IsSpecialName).ToArray(); }
+ }
+ public PropertyInfo[] Properties {
+ get { return Type.GetProperties (); }
+ }
+
+ }
+
}
\ No newline at end of file
-#define MONO_CAIRO_DEBUG_DISPOSE\r
-\r
-\r
-using System;\r
-using System.Runtime.InteropServices;\r
-using OpenTK;\r
-using OpenTK.Graphics.OpenGL;\r
-using OpenTK.Input;\r
-\r
-using System.Diagnostics;\r
-\r
-//using GGL;\r
-using go;\r
-using System.Threading;\r
-\r
-\r
-namespace test\r
-{\r
- class GOLIBTest_Window : OpenTKGameWindow , IValueChange\r
- {\r
- #region IValueChange implementation\r
- public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
- #endregion\r
-\r
- #region FPS\r
- int _fps = 0;\r
-\r
- public int fps {\r
- get { return _fps; }\r
- set {\r
- if (_fps == value)\r
- return;\r
- \r
- _fps = value;\r
-\r
- if (_fps > fpsMax) {\r
- fpsMax = _fps;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax));\r
- } else if (_fps < fpsMin) {\r
- fpsMin = _fps;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin));\r
- }\r
-\r
- if (ValueChanged != null)\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));\r
- }\r
- }\r
- string name = "testName";\r
-\r
- public string Name {\r
- get {\r
- return name;\r
- }\r
- set {\r
- name = value;\r
- }\r
- }\r
-\r
- public int fpsMin = int.MaxValue;\r
- public int fpsMax = 0;\r
-\r
- void resetFps ()\r
- {\r
- fpsMin = int.MaxValue;\r
- fpsMax = 0;\r
- _fps = 0;\r
- }\r
- #endregion\r
-\r
- public GOLIBTest_Window ()\r
- : base(800, 600,"test")\r
- {}\r
-\r
-\r
- protected override void OnLoad (EventArgs e)\r
- {\r
- base.OnLoad (e);\r
- LoadInterface("Interfaces/testWindow.goml");\r
- LoadInterface("Interfaces/testWindow.goml");\r
-// LoadInterface("Interfaces/testWindow.goml", out g);\r
-// LoadInterface("Interfaces/testWindow.goml", out g);\r
-// LoadInterface("Interfaces/testWindow.goml", out g);\r
-// LoadInterface("Interfaces/testWindow.goml", out g);\r
-// LoadInterface("Interfaces/testWindow.goml", out g);\r
- CursorVisible = true;\r
- }\r
-\r
-\r
- private int frameCpt = 0;\r
- protected override void OnUpdateFrame (FrameEventArgs e)\r
- {\r
- base.OnUpdateFrame (e);\r
-\r
- fps = (int)RenderFrequency;\r
-\r
- if (frameCpt > 200) {\r
- resetFps ();\r
- frameCpt = 0;\r
-\r
- }\r
- frameCpt++;\r
- }\r
-\r
- protected override void OnKeyDown (KeyboardKeyEventArgs e)\r
- {\r
- base.OnKeyDown (e);\r
- this.Quit ();\r
- }\r
-\r
- void butQuitPress (object sender, MouseButtonEventArgs e)\r
- {\r
- DeleteWidget (sender as GraphicObject);\r
- }\r
-\r
- [STAThread]\r
- static void Main ()\r
- {\r
- Console.WriteLine ("starting example");\r
-\r
- using (GOLIBTest_Window win = new GOLIBTest_Window( )) {\r
- win.Run (30.0);\r
- }\r
- }\r
- }\r
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+//using GGL;
+using go;
+using System.Threading;
+
+
+namespace test
+{
+ class GOLIBTest_Window : OpenTKGameWindow , IValueChange
+ {
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ #endregion
+
+ #region FPS
+ int _fps = 0;
+
+ public int fps {
+ get { return _fps; }
+ set {
+ if (_fps == value)
+ return;
+
+ _fps = value;
+
+ if (_fps > fpsMax) {
+ fpsMax = _fps;
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax));
+ } else if (_fps < fpsMin) {
+ fpsMin = _fps;
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin));
+ }
+
+ if (ValueChanged != null)
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));
+ }
+ }
+ string name = "testName";
+
+ public string Name {
+ get {
+ return name;
+ }
+ set {
+ name = value;
+ }
+ }
+
+ public int fpsMin = int.MaxValue;
+ public int fpsMax = 0;
+
+ void resetFps ()
+ {
+ fpsMin = int.MaxValue;
+ fpsMax = 0;
+ _fps = 0;
+ }
+ #endregion
+
+ public GOLIBTest_Window ()
+ : base(800, 600,"test")
+ {}
+
+
+ protected override void OnLoad (EventArgs e)
+ {
+ base.OnLoad (e);
+ LoadInterface("Interfaces/testWindow.goml");
+ LoadInterface("Interfaces/testWindow.goml");
+// LoadInterface("Interfaces/testWindow.goml", out g);
+// LoadInterface("Interfaces/testWindow.goml", out g);
+// LoadInterface("Interfaces/testWindow.goml", out g);
+// LoadInterface("Interfaces/testWindow.goml", out g);
+// LoadInterface("Interfaces/testWindow.goml", out g);
+ CursorVisible = true;
+ }
+
+
+ private int frameCpt = 0;
+ protected override void OnUpdateFrame (FrameEventArgs e)
+ {
+ base.OnUpdateFrame (e);
+
+ fps = (int)RenderFrequency;
+
+ if (frameCpt > 200) {
+ resetFps ();
+ frameCpt = 0;
+
+ }
+ frameCpt++;
+ }
+
+ protected override void OnKeyDown (KeyboardKeyEventArgs e)
+ {
+ base.OnKeyDown (e);
+ this.Quit ();
+ }
+
+ void butQuitPress (object sender, MouseButtonEventArgs e)
+ {
+ DeleteWidget (sender as GraphicObject);
+ }
+
+ [STAThread]
+ static void Main ()
+ {
+ Console.WriteLine ("starting example");
+
+ using (GOLIBTest_Window win = new GOLIBTest_Window( )) {
+ win.Run (30.0);
+ }
+ }
+ }
}
\ No newline at end of file
-#define MONO_CAIRO_DEBUG_DISPOSE\r
-\r
-\r
-using System;\r
-using System.Runtime.InteropServices;\r
-using OpenTK;\r
-using OpenTK.Graphics.OpenGL;\r
-using OpenTK.Input;\r
-\r
-using System.Diagnostics;\r
-\r
-//using GGL;\r
-using go;\r
-using System.Threading;\r
-\r
-\r
-namespace test6\r
-{\r
- class GOLIBTest_0 : OpenTKGameWindow\r
- {\r
- public GOLIBTest_0 ()\r
- : base(1024, 600,"test")\r
- {}\r
-\r
- GraphicObject g;\r
- Label l;\r
-\r
- protected override void OnLoad (EventArgs e)\r
- {\r
- base.OnLoad (e);\r
- g = LoadInterface("Interfaces/test0.goml");\r
- l = g.FindByName ("labCpt") as Label;\r
- }\r
-\r
- void onUp (object sender, MouseButtonEventArgs e)\r
- {\r
- decimal tmp = 0;\r
- if (!decimal.TryParse (l.Text, out tmp))\r
- return;\r
- \r
- tmp += 1;\r
- l.Text = tmp.ToString ();\r
- }\r
- void onDown (object sender, MouseButtonEventArgs e)\r
- {\r
- decimal tmp = 0;\r
- if (!decimal.TryParse (l.Text, out tmp))\r
- return;\r
-\r
- tmp -= 1;\r
- l.Text = tmp.ToString ();\r
- }\r
-\r
- protected override void OnKeyDown (KeyboardKeyEventArgs e)\r
- {\r
- switch (e.Key) {\r
- case Key.Left:\r
- g.Left++;\r
- break;\r
- case Key.Right:\r
- g.Left--;\r
- break;\r
- case Key.Up:\r
- g.Top--;\r
- break;\r
- case Key.Down:\r
- g.Top++;\r
- break;\r
- default:\r
- break;\r
- }\r
- }\r
- protected override void OnUpdateFrame (FrameEventArgs e)\r
- {\r
- base.OnUpdateFrame (e);\r
- }\r
-\r
- [STAThread]\r
- static void Main ()\r
- {\r
- Console.WriteLine ("starting example");\r
-\r
- using (GOLIBTest_0 win = new GOLIBTest_0( )) {\r
- win.Run (30.0);\r
- }\r
- }\r
- }\r
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+//using GGL;
+using go;
+using System.Threading;
+
+
+namespace test6
+{
+ class GOLIBTest_0 : OpenTKGameWindow
+ {
+ public GOLIBTest_0 ()
+ : base(1024, 600,"test")
+ {}
+
+ GraphicObject g;
+ Label l;
+
+ protected override void OnLoad (EventArgs e)
+ {
+ base.OnLoad (e);
+ g = LoadInterface("Interfaces/test0.goml");
+ l = g.FindByName ("labCpt") as Label;
+ }
+
+ void onUp (object sender, MouseButtonEventArgs e)
+ {
+ decimal tmp = 0;
+ if (!decimal.TryParse (l.Text, out tmp))
+ return;
+
+ tmp += 1;
+ l.Text = tmp.ToString ();
+ }
+ void onDown (object sender, MouseButtonEventArgs e)
+ {
+ decimal tmp = 0;
+ if (!decimal.TryParse (l.Text, out tmp))
+ return;
+
+ tmp -= 1;
+ l.Text = tmp.ToString ();
+ }
+
+ protected override void OnKeyDown (KeyboardKeyEventArgs e)
+ {
+ switch (e.Key) {
+ case Key.Left:
+ g.Left++;
+ break;
+ case Key.Right:
+ g.Left--;
+ break;
+ case Key.Up:
+ g.Top--;
+ break;
+ case Key.Down:
+ g.Top++;
+ break;
+ default:
+ break;
+ }
+ }
+ protected override void OnUpdateFrame (FrameEventArgs e)
+ {
+ base.OnUpdateFrame (e);
+ }
+
+ [STAThread]
+ static void Main ()
+ {
+ Console.WriteLine ("starting example");
+
+ using (GOLIBTest_0 win = new GOLIBTest_0( )) {
+ win.Run (30.0);
+ }
+ }
+ }
}
\ No newline at end of file
-#define MONO_CAIRO_DEBUG_DISPOSE\r
-\r
-\r
-using System;\r
-using System.Runtime.InteropServices;\r
-using OpenTK;\r
-using OpenTK.Graphics.OpenGL;\r
-using OpenTK.Input;\r
-\r
-using System.Diagnostics;\r
-\r
-//using GGL;\r
-using Crow;\r
-using System.Threading;\r
-using System.Collections.Generic;\r
-\r
-\r
-namespace test\r
-{\r
- class GOLIBTests : OpenTKGameWindow, IValueChange\r
- {\r
- #region IValueChange implementation\r
- public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
- public virtual void NotifyValueChanged(string MemberName, object _value)\r
- {\r
- ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value)); \r
- }\r
- #endregion\r
-\r
- public GOLIBTests ()\r
- : base(800, 600,"test: press spacebar to toogle test files")\r
- {\r
- VSync = VSyncMode.Off;\r
- }\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
- "test1.goml",\r
- "testWindow2.goml",\r
-// "testCombobox.goml",\r
- "testWindow3.goml",\r
- "testWindow.goml",\r
- "testGroupBox.goml",\r
- "testExpandable.goml",\r
- "testCheckbox.goml",\r
- "testPopper.goml",\r
- "testLabel.goml",\r
- "testAll.goml",\r
-// "testSpinner.goml",\r
- "testRadioButton2.goml",\r
- "testContainer.goml",\r
- "testBorder.goml",\r
- "testRadioButton.goml",\r
- "testMsgBox.goml",\r
- "testGrid.goml",\r
- "testMeter.goml",\r
- "test_Listbox.goml",\r
- };\r
-\r
- #region FPS\r
- int _fps = 0;\r
-\r
- public int fps {\r
- get { return _fps; }\r
- set {\r
- if (_fps == value)\r
- return;\r
-\r
- _fps = value;\r
-\r
- if (_fps > fpsMax) {\r
- fpsMax = _fps;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax));\r
- } else if (_fps < fpsMin) {\r
- fpsMin = _fps;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin));\r
- }\r
-\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
- public int fpsMin = int.MaxValue;\r
- public int fpsMax = 0;\r
-\r
- void resetFps ()\r
- {\r
- fpsMin = int.MaxValue;\r
- fpsMax = 0;\r
- _fps = 0;\r
- }\r
- public string update = "";\r
- public string drawing = "";\r
- #endregion\r
-\r
- public int intValue = 25;\r
-\r
- public int IntValue {\r
- get {\r
- return intValue;\r
- }\r
- set {\r
- intValue = value;\r
- NotifyValueChanged ("IntValue", intValue);\r
- }\r
- }\r
- void onSpinnerValueChange(object sender, ValueChangeEventArgs e){\r
- if (e.MemberName != "Value")\r
- return;\r
- intValue = Convert.ToInt32(e.NewValue);\r
- }\r
- public List<String> TestList = new List<string>( new string[] \r
- {\r
- "string 1",\r
- "string 2",\r
- "string 3"\r
- }); \r
-\r
- protected override void OnLoad (EventArgs e)\r
- {\r
- base.OnLoad (e);\r
- //this.AddWidget(new test4());\r
-\r
- GraphicObject obj = LoadInterface("Interfaces/" + testFiles[idx]);\r
- obj.DataSource = this;\r
- }\r
- protected override void OnUpdateFrame (FrameEventArgs e)\r
- {\r
- //if (frameCpt % 8 == 0)\r
- base.OnUpdateFrame (e);\r
- \r
- fps = (int)RenderFrequency;\r
-\r
-\r
- if (frameCpt > 200) {\r
- resetFps ();\r
- frameCpt = 0;\r
- }\r
- frameCpt++;\r
- }\r
- protected override void OnKeyDown (KeyboardKeyEventArgs e)\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
- 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
- if (idx == testFiles.Length)\r
- idx = 0;\r
- this.Title = testFiles [idx];\r
- GraphicObject obj = LoadInterface("Interfaces/" + testFiles[idx]);\r
- obj.DataSource = this;\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
- Console.WriteLine ("starting example");\r
-\r
- using (GOLIBTests win = new GOLIBTests( )) {\r
- win.Run (30.0);\r
- }\r
- }\r
- }\r
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+//using GGL;
+using Crow;
+using System.Threading;
+using System.Collections.Generic;
+
+
+namespace test
+{
+ class GOLIBTests : OpenTKGameWindow, IValueChange
+ {
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ public virtual void NotifyValueChanged(string MemberName, object _value)
+ {
+ ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+ }
+ #endregion
+
+ public GOLIBTests ()
+ : base(800, 600,"test: press spacebar to toogle test files")
+ {
+ VSync = VSyncMode.Off;
+ }
+
+ int frameCpt = 0;
+ int idx = 0;
+ string[] testFiles = {
+ "testTextBox.crow",
+ "testSpinner.goml",
+ "testImage.crow",
+ "testButton.crow",
+ "fps.goml",
+ "test4.goml",
+ "testScrollbar.goml",
+ "2.crow",
+ "test1.goml",
+ "testWindow2.goml",
+// "testCombobox.goml",
+ "testWindow3.goml",
+ "testWindow.goml",
+ "testGroupBox.goml",
+ "testExpandable.goml",
+ "testCheckbox.goml",
+ "testPopper.goml",
+ "testLabel.goml",
+ "testAll.goml",
+// "testSpinner.goml",
+ "testRadioButton2.goml",
+ "testContainer.goml",
+ "testBorder.goml",
+ "testRadioButton.goml",
+ "testMsgBox.goml",
+ "testGrid.goml",
+ "testMeter.goml",
+ "test_Listbox.goml",
+ };
+
+ #region FPS
+ int _fps = 0;
+
+ public int fps {
+ get { return _fps; }
+ set {
+ if (_fps == value)
+ return;
+
+ _fps = value;
+
+ if (_fps > fpsMax) {
+ fpsMax = _fps;
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax));
+ } else if (_fps < fpsMin) {
+ fpsMin = _fps;
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin));
+ }
+
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));
+ ValueChanged.Raise (this, new ValueChangeEventArgs ("update",
+ this.updateTime.ElapsedMilliseconds.ToString () + " ms"));
+ ValueChanged.Raise (this, new ValueChangeEventArgs ("drawing",
+ this.drawingTime.ElapsedMilliseconds.ToString () + " ms"));
+ }
+ }
+
+ public int fpsMin = int.MaxValue;
+ public int fpsMax = 0;
+
+ void resetFps ()
+ {
+ fpsMin = int.MaxValue;
+ fpsMax = 0;
+ _fps = 0;
+ }
+ public string update = "";
+ public string drawing = "";
+ #endregion
+
+ public int intValue = 25;
+
+ public int IntValue {
+ get {
+ return intValue;
+ }
+ set {
+ intValue = value;
+ NotifyValueChanged ("IntValue", intValue);
+ }
+ }
+ void onSpinnerValueChange(object sender, ValueChangeEventArgs e){
+ if (e.MemberName != "Value")
+ return;
+ intValue = Convert.ToInt32(e.NewValue);
+ }
+ public List<String> TestList = new List<string>( new string[]
+ {
+ "string 1",
+ "string 2",
+ "string 3"
+ });
+
+ protected override void OnLoad (EventArgs e)
+ {
+ base.OnLoad (e);
+ //this.AddWidget(new test4());
+
+ GraphicObject obj = LoadInterface("Interfaces/" + testFiles[idx]);
+ obj.DataSource = this;
+ }
+ protected override void OnUpdateFrame (FrameEventArgs e)
+ {
+ //if (frameCpt % 8 == 0)
+ base.OnUpdateFrame (e);
+
+ fps = (int)RenderFrequency;
+
+
+ if (frameCpt > 200) {
+ resetFps ();
+ frameCpt = 0;
+ }
+ frameCpt++;
+ }
+ protected override void OnKeyDown (KeyboardKeyEventArgs e)
+ {
+ if (FocusedWidget is TextBox) {
+ base.OnKeyDown (e);
+ return;
+ }
+ if (e.Key == Key.Escape) {
+ this.Quit ();
+ return;
+ } else if (e.Key == Key.L) {
+ TestList.Add ("new string");
+ NotifyValueChanged ("TestList", TestList);
+ return;
+ } else if (e.Key == Key.W) {
+ GraphicObject w = LoadInterface("Interfaces/testWindow.goml");
+ w.DataSource = this;
+ return;
+ }
+ ClearInterface ();
+ idx++;
+ if (idx == testFiles.Length)
+ idx = 0;
+ this.Title = testFiles [idx];
+ GraphicObject obj = LoadInterface("Interfaces/" + testFiles[idx]);
+ obj.DataSource = this;
+
+ }
+ void onButClick(object send, MouseButtonEventArgs e)
+ {
+ Console.WriteLine ("button clicked:" + send.ToString());
+ }
+ [STAThread]
+ static void Main ()
+ {
+ Console.WriteLine ("starting example");
+
+ using (GOLIBTests win = new GOLIBTests( )) {
+ win.Run (30.0);
+ }
+ }
+ }
}
\ No newline at end of file
-#define MONO_CAIRO_DEBUG_DISPOSE\r
-\r
-\r
-using System;\r
-using System.Runtime.InteropServices;\r
-using OpenTK;\r
-using OpenTK.Graphics.OpenGL;\r
-using OpenTK.Input;\r
-\r
-using System.Diagnostics;\r
-\r
-//using GGL;\r
-using go;\r
-using System.Threading;\r
-\r
-\r
-namespace test\r
-{\r
- interface IValueChange\r
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+//using GGL;
+using go;
+using System.Threading;
+
+
+namespace test
+{
+ interface IValueChange
{
}
-\r
+
}
\ No newline at end of file
-<?xml version="1.0"?>\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 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
+<?xml version="1.0"?>
+<Border Fit="true" CornerRadius="5" BorderWidth="1">
+ <Container Name="MainGrp" Background="0,5;0,5;0,5;0,4" Width="120" Fit="true"
+ Margin="10" Focusable="True" >
+ <VerticalStack Fit="true" Name="vsFps" Spacing="10" >
+ <HorizontalStack Fit="true">
+ <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+ <Label Name="labUpdate" Text="{update}" Font="droid,12" Background="AoEnglish" Width="50" TextAlignment="Center"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+ <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+ <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+ <Label Text="{fpsMax}" Font="droid , 12" Background="AoEnglish" Width="50" TextAlignment="Center"/>
+ </HorizontalStack>
+ </VerticalStack>
+ </Container>
</Border>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<Border BorderWidth="3">\r
- <Label Text="{Name}" Focusable="true" Width="0" Height="-1" Margin="0"\r
- MouseEnter="{Background=Red}"\r
- MouseLeave="{Background=Transparent}"\r
- />\r
-</Border>\r
-\r
+<?xml version="1.0"?>
+<Border BorderWidth="3">
+ <Label Text="{Name}" Focusable="true" Width="0" Height="-1" Margin="0"
+ MouseEnter="{Background=Red}"
+ MouseLeave="{Background=Transparent}"
+ />
+</Border>
+
-<?xml version="1.0"?>\r
-<Group Name="TopGroup" Width="500" Height="400" Margin="5"\r
- Focusable="True" Background="Yellow">\r
- <Group Name="InnerGroup" Width="-1" Height="-1" Margin="50" \r
- VerticalAlignment="Top" HorizontalAlignment="Left"\r
- Focusable="True" Background="Green">\r
- <Image VerticalAlignment="Bottom" \r
- Name="PhaseOverlay1" Width="100" Height="100" Path="image/u.svg" Background="Red"/>\r
- <Image Top="100" \r
- Name="PhaseOverlay2" Width="100" Height="100" Path="image/u.svg" Background="Red"/>\r
- </Group>\r
- <Image VerticalAlignment="Center" HorizontalAlignment="Right"\r
- Name="PhaseOverlay0" Width="100" Height="100" Path="image/u.svg" Background="Red"/>\r
-\r
+<?xml version="1.0"?>
+<Group Name="TopGroup" Width="500" Height="400" Margin="5"
+ Focusable="True" Background="Yellow">
+ <Group Name="InnerGroup" Width="-1" Height="-1" Margin="50"
+ VerticalAlignment="Top" HorizontalAlignment="Left"
+ Focusable="True" Background="Green">
+ <Image VerticalAlignment="Bottom"
+ Name="PhaseOverlay1" Width="100" Height="100" Path="image/u.svg" Background="Red"/>
+ <Image Top="100"
+ Name="PhaseOverlay2" Width="100" Height="100" Path="image/u.svg" Background="Red"/>
+ </Group>
+ <Image VerticalAlignment="Center" HorizontalAlignment="Right"
+ Name="PhaseOverlay0" Width="100" Height="100" Path="image/u.svg" Background="Red"/>
+
</Group>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<Container Background="Green" Height="400" Width="400">\r
-<VerticalStack Margin="10" Background="DarkBlue" Height="-1" Width="0">\r
- <Label Text="label11" Width="0"/>\r
- <Label Text="label21"/>\r
- <HorizontalStack Width="-1" Height="-1" Margin="5"\r
- Focusable="True" Background="Blue">\r
- <Label Text="label12"/>\r
- <Label Text="label22"/>\r
- <Label Text="label32"/>\r
- <Label Text="label42"/>\r
- <Label Text="label52"/>\r
- </HorizontalStack>\r
- <Label Text="label33" Background="Green" Width="0"/>\r
- <Button/>\r
- <Label Text="label43"/>\r
- <Label Text="label53"/>\r
-\r
-</VerticalStack>\r
+<?xml version="1.0"?>
+<Container Background="Green" Height="400" Width="400">
+<VerticalStack Margin="10" Background="DarkBlue" Height="-1" Width="0">
+ <Label Text="label11" Width="0"/>
+ <Label Text="label21"/>
+ <HorizontalStack Width="-1" Height="-1" Margin="5"
+ Focusable="True" Background="Blue">
+ <Label Text="label12"/>
+ <Label Text="label22"/>
+ <Label Text="label32"/>
+ <Label Text="label42"/>
+ <Label Text="label52"/>
+ </HorizontalStack>
+ <Label Text="label33" Background="Green" Width="0"/>
+ <Button/>
+ <Label Text="label43"/>
+ <Label Text="label53"/>
+
+</VerticalStack>
</Container>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<Container Name="TopContainer" Width="400" Height="350"\r
- Margin="20" Focusable="True" Background="Yellow">\r
- <Container Name="MiddleContainer" Width="0" Height="0"\r
- Margin="20" Focusable="True" Background="Green">\r
- <Image VerticalAlignment="Bottom" \r
- Name="PhaseOverlay" Width="100" Height="100" Path="image/u.svg" Background="Red"/>\r
- </Container>\r
+<?xml version="1.0"?>
+<Container Name="TopContainer" Width="400" Height="350"
+ Margin="20" Focusable="True" Background="Yellow">
+ <Container Name="MiddleContainer" Width="0" Height="0"
+ Margin="20" Focusable="True" Background="Green">
+ <Image VerticalAlignment="Bottom"
+ Name="PhaseOverlay" Width="100" Height="100" Path="image/u.svg" Background="Red"/>
+ </Container>
</Container>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<!--<Container HorizontalAlignment="Center" VerticalAlignment="Bottom"\r
- Margin="10" Focusable="True" Fit="True" Background="Green">-->\r
- <Group Fit="true">\r
- <GraphicObject Name="g1" Width="400" Height="40" Background="Blue"/>\r
- <GraphicObject Name="g2" Width="400" Height="40" Background="Red"\r
- HorizontalAlignment="Right"/> \r
- </Group>\r
+<?xml version="1.0"?>
+<!--<Container HorizontalAlignment="Center" VerticalAlignment="Bottom"
+ Margin="10" Focusable="True" Fit="True" Background="Green">-->
+ <Group Fit="true">
+ <GraphicObject Name="g1" Width="400" Height="40" Background="Blue"/>
+ <GraphicObject Name="g2" Width="400" Height="40" Background="Red"
+ HorizontalAlignment="Right"/>
+ </Group>
<!--</Container>-->
\ No newline at end of file
-<?xml version="1.0"?>\r
-<Container Name="MainGrp" \r
- Width="600" Height="600" \r
- Background="White" Margin="10" Focusable="True">\r
-\r
- <Button Margin="1" BorderWidth="0" Background="Gray" Width="400" Height="400">\r
- <Image Path="image/u.svg"/>\r
- </Button> \r
+<?xml version="1.0"?>
+<Container Name="MainGrp"
+ Width="600" Height="600"
+ Background="White" Margin="10" Focusable="True">
+
+ <Button Margin="1" BorderWidth="0" Background="Gray" Width="400" Height="400">
+ <Image Path="image/u.svg"/>
+ </Button>
</Container>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<Group Name="MainGrp"\r
- Width="800" Height="500"\r
- Background="0,5;0,5;0,5;0,5" Foreground="White"\r
- Margin="10" >\r
- <Border \r
- BorderWidth="2" Foreground="Transparent"\r
- Focusable="True"\r
- MouseEnter="{Foreground = White}"\r
- MouseLeave="{Foreground = Transparent}">\r
-\r
- <HorizontalStack Name="hs0" Fit="true"\r
- WidgetSpacing="10" \r
- VerticalAlignment="Center" \r
- Background="0,5;0,5;0,5;0,5">\r
- <VerticalStack Name="vs1"\r
- Margin="20" Width="400" Height="-1">\r
- <Label Name="labMouse" Text="MousePos"/>\r
- <HorizontalStack Name="hsPbar" Fit="true">\r
- <ProgressBar Name="pbBar" \r
- Width="100" Height="20"\r
- Value="50"\r
- Foreground="BlueCrayola" Background="DarkGray"\r
- BorderWidth="2" Foreground="White"/>\r
-<!-- <Label Name="labPb"\r
- Width="20"\r
- TextAlignment="RightCenter"/>\r
- <ProgressBar Name="pbBar"\r
- Width="100" Height="10"\r
- Value="30"/>-->\r
- </HorizontalStack>\r
- <HorizontalStack Name="hsFocus" Fit="true">\r
- <Label Text="Focused:"/>\r
- <Label Name="labFocus" />\r
- </HorizontalStack>\r
- <HorizontalStack Fit="true">\r
- <Label Text="Active:" Name="hsActive"/>\r
- <Label Name="labActive"/>\r
- </HorizontalStack>\r
- <HorizontalStack Fit="true">\r
- <Label Text="Hover:" Name="hsHover"/>\r
- <Label Name="labHover" />\r
- </HorizontalStack>\r
- <Button Margin="5" BorderWidth="0" Background="Gray" Width="-1" Height="-1">\r
- <Label FontSize="10" Text="This is a test" Margin="5" FontColor="White" Foreground="White" />\r
- </Button>\r
- <TextBoxWidget TextAlignment="LeftCenter" Font="droid,14" \r
- Width="300" Height="-1" Margin="2"\r
- Foreground="White" BorderWidth="1"\r
- Text="editable text"/>\r
- <GroupBox Title="Group Box" Width="300" Height="100" \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
- <GraduatedSlider Name="slider" Height="30" Width="300" Foreground="BlueBell"/>\r
- </VerticalStack>\r
-<!-- <VerticalStack Width="-1" Height="-1" BorderWidth="1" Margin="5" WidgetSpacing="4">\r
- <Button Width="-1" Height="-1" Margin="15">\r
- <Image Path="/mnt/data/Images/130px-Blason_ville_fr_Aubure_(Haut-Rhin).svg.png"/>\r
- </Button>\r
- <HorizontalStack>\r
- <Label Text="Update" FontColor="White" VerticalAlignment="Center" />\r
- <Label Name="labUpdate" Text="xxxx" FontSize="16" Width="60" TextAlignment="Center" Background="DarkGreen"/>\r
- </HorizontalStack>\r
- <HorizontalStack>\r
- <Label Text="Fps:" Width = "30" VerticalAlignment="Center" TextAlignment="LeftCenter"/>\r
- <Label Name="labFps" Text="xxxx" Font="droid bold, 14"\r
- TextAlignment="Center" Background="AoEnglish"/>\r
- </HorizontalStack>\r
- <HorizontalStack>\r
- <Label Text="Min:" Width = "30" />\r
- <Label Name="labFpsMin" Text="xxxx" Font="droid bold, 14"\r
- TextAlignment="Center" Background="AoEnglish"/>\r
- </HorizontalStack>\r
- <HorizontalStack>\r
- <Label Text="Max:" Width = "30"/>\r
- <Label Name="labFpsMax" Text="xxxx" Font="droid bold, 14"\r
- TextAlignment="Center" Background="AoEnglish"/>\r
- </HorizontalStack>\r
- </VerticalStack>\r
-\r
- <Scroller Background="DimGray" Height="350" Width="300" \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" Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/>\r
- </VerticalStack>\r
- </Scroller>-->\r
-\r
- </HorizontalStack>\r
-\r
- <Slider \r
- Height="20" Width="300" \r
- Background="Transparent"\r
- VerticalAlignment="Bottom" />\r
- </Border>\r
+<?xml version="1.0"?>
+<Group Name="MainGrp"
+ Width="800" Height="500"
+ Background="0,5;0,5;0,5;0,5" Foreground="White"
+ Margin="10" >
+ <Border
+ BorderWidth="2" Foreground="Transparent"
+ Focusable="True"
+ MouseEnter="{Foreground = White}"
+ MouseLeave="{Foreground = Transparent}">
+
+ <HorizontalStack Name="hs0" Fit="true"
+ WidgetSpacing="10"
+ VerticalAlignment="Center"
+ Background="0,5;0,5;0,5;0,5">
+ <VerticalStack Name="vs1"
+ Margin="20" Width="400" Height="-1">
+ <Label Name="labMouse" Text="MousePos"/>
+ <HorizontalStack Name="hsPbar" Fit="true">
+ <ProgressBar Name="pbBar"
+ Width="100" Height="20"
+ Value="50"
+ Foreground="BlueCrayola" Background="DarkGray"
+ BorderWidth="2" Foreground="White"/>
+<!-- <Label Name="labPb"
+ Width="20"
+ TextAlignment="RightCenter"/>
+ <ProgressBar Name="pbBar"
+ Width="100" Height="10"
+ Value="30"/>-->
+ </HorizontalStack>
+ <HorizontalStack Name="hsFocus" Fit="true">
+ <Label Text="Focused:"/>
+ <Label Name="labFocus" />
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Active:" Name="hsActive"/>
+ <Label Name="labActive"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Hover:" Name="hsHover"/>
+ <Label Name="labHover" />
+ </HorizontalStack>
+ <Button Margin="5" BorderWidth="0" Background="Gray" Width="-1" Height="-1">
+ <Label FontSize="10" Text="This is a test" Margin="5" FontColor="White" Foreground="White" />
+ </Button>
+ <TextBoxWidget TextAlignment="LeftCenter" Font="droid,14"
+ Width="300" Height="-1" Margin="2"
+ Foreground="White" BorderWidth="1"
+ Text="editable text"/>
+ <GroupBox Title="Group Box" Width="300" Height="100"
+ Foreground="White" BorderWidth="2" Margin="3">
+ <Label Name="labValue" FontSize="14" Text="000" TextAlignment="Center"/>
+ </GroupBox>
+ <Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />
+ <GraduatedSlider Name="slider" Height="30" Width="300" Foreground="BlueBell"/>
+ </VerticalStack>
+<!-- <VerticalStack Width="-1" Height="-1" BorderWidth="1" Margin="5" WidgetSpacing="4">
+ <Button Width="-1" Height="-1" Margin="15">
+ <Image Path="/mnt/data/Images/130px-Blason_ville_fr_Aubure_(Haut-Rhin).svg.png"/>
+ </Button>
+ <HorizontalStack>
+ <Label Text="Update" FontColor="White" VerticalAlignment="Center" />
+ <Label Name="labUpdate" Text="xxxx" FontSize="16" Width="60" TextAlignment="Center" Background="DarkGreen"/>
+ </HorizontalStack>
+ <HorizontalStack>
+ <Label Text="Fps:" Width = "30" VerticalAlignment="Center" TextAlignment="LeftCenter"/>
+ <Label Name="labFps" Text="xxxx" Font="droid bold, 14"
+ TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ <HorizontalStack>
+ <Label Text="Min:" Width = "30" />
+ <Label Name="labFpsMin" Text="xxxx" Font="droid bold, 14"
+ TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ <HorizontalStack>
+ <Label Text="Max:" Width = "30"/>
+ <Label Name="labFpsMax" Text="xxxx" Font="droid bold, 14"
+ TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ </VerticalStack>
+
+ <Scroller Background="DimGray" Height="350" Width="300"
+ Margin="5" VerticalScrolling="true">
+ <VerticalStack Name="colors" VerticalAlignment="Top" Margin="5">
+ <ProgressBar Name="pbBar2" Width="100" Height="20" Value="50"
+ BorderWidth="2" Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/>
+ </VerticalStack>
+ </Scroller>-->
+
+ </HorizontalStack>
+
+ <Slider
+ Height="20" Width="300"
+ Background="Transparent"
+ VerticalAlignment="Bottom" />
+ </Border>
</Group>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<Group Name="MainGrp"\r
- Width="800" Height="500"\r
- Background="0,5;0,5;0,5;0,5" Foreground="White"\r
- Margin="10" >\r
- <Border Margin="10" CornerRadius="10"\r
- Name="mainBorder"\r
- BorderWidth="2" Foreground="Transparent"\r
- Focusable="True"\r
- MouseEnter="{Foreground = White}"\r
- MouseLeave="{Foreground = Transparent}">\r
- <HorizontalStack WidgetSpacing="1">\r
- <VerticalStack Width="-1">\r
- <HorizontalStack WidgetSpacing="1" Fit="true">\r
- <VerticalStack Fit="true">\r
- <Label Text="{MousePosition}"/>\r
- <HorizontalStack Name="hsFocus" Fit="true">\r
- <Label Text="Focused:"/>\r
- <Label Name="labFocus"/>\r
- </HorizontalStack>\r
- <HorizontalStack Fit="true">\r
- <Label Text="Active:" Name="hsActive"/>\r
- <Label Name="labActive"/>\r
- </HorizontalStack>\r
- <HorizontalStack Fit="true">\r
- <Label Text="Hover:" Name="hsHover"/>\r
- <Label Name="labHover"/>\r
- </HorizontalStack>\r
- </VerticalStack>\r
- <VerticalStack Fit="true"> \r
- <CheckBox Name="chk1"/>\r
- <CheckBox Name="chk2" IsChecked="true"/>\r
-\r
- </VerticalStack>\r
- <VerticalStack Fit="true">\r
- <RadioButton IsChecked="true"/>\r
- <RadioButton/>\r
- <Button MouseClick="onButClick"/>\r
- </VerticalStack>\r
- </HorizontalStack>\r
- <TextBox Name="textbox1" TextAlignment="LeftCenter" Font="droid,14" \r
- Width="200" Height="-1" Margin="2" Background="White"\r
- Forground="Black"\r
- Foreground="DimGray" BorderWidth="1"\r
- Text="editable text"/>\r
- <Popper Width="100">\r
- <Border Fit="True" Background="ArmyGreen">\r
- <Image Margin="10" Fit="true" Path="#Crow.Images.Icons.tetra.png"/>\r
- </Border>\r
- </Popper>\r
-\r
- </VerticalStack>\r
- <VerticalStack Fit="true" Margin="0" WidgetSpacing="1">\r
- <Button Margin="1" Width="150" Height="100">\r
- <Image Path="#Tests.image.tetra.png"/>\r
- </Button>\r
- <Popper Width="100">\r
- <Border Fit="True" Background="ArmyGreen">\r
- <Image Margin="10" Fit="true" Path="#Crow.Images.Icons.tetra.png"/>\r
- </Border>\r
- </Popper>\r
- <Expandable Name="expander" Width="150" Height="-1">\r
- <VerticalStack Name="vsExpanded" Width="100">\r
- <CheckBox Name="chk1"/>\r
- <CheckBox Name="chk2" IsChecked="true"/>\r
- <CheckBox Name="chk3"/>\r
- <CheckBox Name="chk4"/>\r
- </VerticalStack> \r
- </Expandable>\r
- <Expandable Name="expander2" Width="150" Height="-1">\r
- <VerticalStack Name="vsExpanded" Width="100">\r
- <CheckBox Name="chk1"/>\r
- <CheckBox Name="chk2" IsChecked="true"/>\r
- </VerticalStack> \r
- </Expandable>\r
- <Expandable Name="expander3" Width="150" Height="-1">\r
- <VerticalStack Name="vsExpanded" Width="100">\r
- <CheckBox Name="chk1" IsChecked="true"/>\r
- <CheckBox Name="chk2"/>\r
- </VerticalStack> \r
- </Expandable>\r
- <HorizontalStack>\r
- <Label Text="Update" FontColor="White"/>\r
- <Label Name="labUpdate" Text="{update}" FontSize="16" Width="60" TextAlignment="Center" Background="DarkGreen"/>\r
- </HorizontalStack>\r
- <HorizontalStack>\r
- <Label Text="Fps:" Width = "30"/>\r
- <Label Name="labFps" Text="{fps}" Font="droid bold, 14"\r
- TextAlignment="Center" Background="AoEnglish"/>\r
- </HorizontalStack>\r
- <HorizontalStack>\r
- <Label Text="Min:" Width = "30"/>\r
- <Label Name="labFpsMin" Text="{fpsMin}" Font="droid bold, 14"\r
- TextAlignment="Center" Background="AoEnglish"/>\r
- </HorizontalStack>\r
- <HorizontalStack>\r
- <Label Text="Max:" Width = "30"/>\r
- <Label Name="labFpsMax" Text="{fpsMax}" Font="droid bold, 14"\r
- TextAlignment="Center" Background="AoEnglish"/>\r
- </HorizontalStack>\r
- </VerticalStack>\r
- <HorizontalStack Width="-1">\r
- <Scroller Name="scroller1" Background="DimGray" Width="-1" \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" Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/>\r
- <ProgressBar Width="100" Height="20" Value="{fps}" BorderWidth="2"\r
- Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/> -->\r
- </VerticalStack>\r
- </Scroller>\r
- <ScrollBar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"\r
- Orientation="Vertical" Width="10" Height="0"/>\r
- </HorizontalStack>\r
- </HorizontalStack>\r
-<!-- <HorizontalStack Name="hs0"\r
- WidgetSpacing="1" \r
- VerticalAlignment="Top">\r
- <Slider Orientation="Vertical" Height="300" Width="10" Background="Transparent" />\r
- <VerticalStack Name="vs1" Spacing="5">\r
- <Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />\r
- <HorizontalStack WidgetSpacing="10">\r
- \r
-\r
- <Spinner Width="50" Value="5"></Spinner>\r
- </HorizontalStack>\r
- <HorizontalStack Name="hsPbar" Margin="5">\r
- <ProgressBar Name="pbBar" \r
- Width="200" Height="20"\r
- Minimum="0"\r
- Maximum="200"\r
- Value="{fps}"\r
- Foreground="BlueCrayola" Background="DarkGray"\r
- BorderWidth="2" Foreground="White"/>\r
- </HorizontalStack>\r
-\r
- <Button Margin="5" BorderWidth="0" Width="-1" Height="-1" HorizontalAlignment="Center">\r
- <Label FontSize="18" Text="This is a test" Margin="5" Foreground="Black" />\r
- </Button>\r
-\r
- <GroupBox Title="Group Box" Width="300" Height="100" \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
- <GraduatedSlider Name="slider" Height="30" Width="300" Foreground="BlueBell"/>\r
- </VerticalStack>\r
- \r
- <HorizontalStack Height="350" Width="-1">\r
- <Scroller Name="scroller1" Background="DimGray" Height="0" Width="-1" \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" Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/>\r
- <ProgressBar Width="100" Height="20" Value="{fps}" BorderWidth="2"\r
- Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/> \r
- </VerticalStack>\r
- </Scroller>\r
- <Scrollbar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"\r
- Orientation="Vertical" Width="16" />\r
- </HorizontalStack>\r
- </HorizontalStack>\r
--->\r
-<!-- <Slider \r
- Height="20" Width="100" \r
- Background="Transparent"\r
- VerticalAlignment="Bottom" />-->\r
- </Border>\r
+<?xml version="1.0"?>
+<Group Name="MainGrp"
+ Width="800" Height="500"
+ Background="0,5;0,5;0,5;0,5" Foreground="White"
+ Margin="10" >
+ <Border Margin="10" CornerRadius="10"
+ Name="mainBorder"
+ BorderWidth="2" Foreground="Transparent"
+ Focusable="True"
+ MouseEnter="{Foreground = White}"
+ MouseLeave="{Foreground = Transparent}">
+ <HorizontalStack WidgetSpacing="1">
+ <VerticalStack Width="-1">
+ <HorizontalStack WidgetSpacing="1" Fit="true">
+ <VerticalStack Fit="true">
+ <Label Text="{MousePosition}"/>
+ <HorizontalStack Name="hsFocus" Fit="true">
+ <Label Text="Focused:"/>
+ <Label Name="labFocus"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Active:" Name="hsActive"/>
+ <Label Name="labActive"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Hover:" Name="hsHover"/>
+ <Label Name="labHover"/>
+ </HorizontalStack>
+ </VerticalStack>
+ <VerticalStack Fit="true">
+ <CheckBox Name="chk1"/>
+ <CheckBox Name="chk2" IsChecked="true"/>
+
+ </VerticalStack>
+ <VerticalStack Fit="true">
+ <RadioButton IsChecked="true"/>
+ <RadioButton/>
+ <Button MouseClick="onButClick"/>
+ </VerticalStack>
+ </HorizontalStack>
+ <TextBox Name="textbox1" TextAlignment="LeftCenter" Font="droid,14"
+ Width="200" Height="-1" Margin="2" Background="White"
+ Forground="Black"
+ Foreground="DimGray" BorderWidth="1"
+ Text="editable text"/>
+ <Popper Width="100">
+ <Border Fit="True" Background="ArmyGreen">
+ <Image Margin="10" Fit="true" Path="#Crow.Images.Icons.tetra.png"/>
+ </Border>
+ </Popper>
+
+ </VerticalStack>
+ <VerticalStack Fit="true" Margin="0" WidgetSpacing="1">
+ <Button Margin="1" Width="150" Height="100">
+ <Image Path="#Tests.image.tetra.png"/>
+ </Button>
+ <Popper Width="100">
+ <Border Fit="True" Background="ArmyGreen">
+ <Image Margin="10" Fit="true" Path="#Crow.Images.Icons.tetra.png"/>
+ </Border>
+ </Popper>
+ <Expandable Name="expander" Width="150" Height="-1">
+ <VerticalStack Name="vsExpanded" Width="100">
+ <CheckBox Name="chk1"/>
+ <CheckBox Name="chk2" IsChecked="true"/>
+ <CheckBox Name="chk3"/>
+ <CheckBox Name="chk4"/>
+ </VerticalStack>
+ </Expandable>
+ <Expandable Name="expander2" Width="150" Height="-1">
+ <VerticalStack Name="vsExpanded" Width="100">
+ <CheckBox Name="chk1"/>
+ <CheckBox Name="chk2" IsChecked="true"/>
+ </VerticalStack>
+ </Expandable>
+ <Expandable Name="expander3" Width="150" Height="-1">
+ <VerticalStack Name="vsExpanded" Width="100">
+ <CheckBox Name="chk1" IsChecked="true"/>
+ <CheckBox Name="chk2"/>
+ </VerticalStack>
+ </Expandable>
+ <HorizontalStack>
+ <Label Text="Update" FontColor="White"/>
+ <Label Name="labUpdate" Text="{update}" FontSize="16" Width="60" TextAlignment="Center" Background="DarkGreen"/>
+ </HorizontalStack>
+ <HorizontalStack>
+ <Label Text="Fps:" Width = "30"/>
+ <Label Name="labFps" Text="{fps}" Font="droid bold, 14"
+ TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ <HorizontalStack>
+ <Label Text="Min:" Width = "30"/>
+ <Label Name="labFpsMin" Text="{fpsMin}" Font="droid bold, 14"
+ TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ <HorizontalStack>
+ <Label Text="Max:" Width = "30"/>
+ <Label Name="labFpsMax" Text="{fpsMax}" Font="droid bold, 14"
+ TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ </VerticalStack>
+ <HorizontalStack Width="-1">
+ <Scroller Name="scroller1" Background="DimGray" Width="-1"
+ Margin="5" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">
+ <VerticalStack Name="colors" VerticalAlignment="Top" Margin="1" Fit="true">
+<!-- <ProgressBar Name="pbBar2" Width="100" Height="20" Value="50"
+ BorderWidth="2" Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/>
+ <ProgressBar Width="100" Height="20" Value="{fps}" BorderWidth="2"
+ Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/> -->
+ </VerticalStack>
+ </Scroller>
+ <ScrollBar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"
+ Orientation="Vertical" Width="10" Height="0"/>
+ </HorizontalStack>
+ </HorizontalStack>
+<!-- <HorizontalStack Name="hs0"
+ WidgetSpacing="1"
+ VerticalAlignment="Top">
+ <Slider Orientation="Vertical" Height="300" Width="10" Background="Transparent" />
+ <VerticalStack Name="vs1" Spacing="5">
+ <Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />
+ <HorizontalStack WidgetSpacing="10">
+
+
+ <Spinner Width="50" Value="5"></Spinner>
+ </HorizontalStack>
+ <HorizontalStack Name="hsPbar" Margin="5">
+ <ProgressBar Name="pbBar"
+ Width="200" Height="20"
+ Minimum="0"
+ Maximum="200"
+ Value="{fps}"
+ Foreground="BlueCrayola" Background="DarkGray"
+ BorderWidth="2" Foreground="White"/>
+ </HorizontalStack>
+
+ <Button Margin="5" BorderWidth="0" Width="-1" Height="-1" HorizontalAlignment="Center">
+ <Label FontSize="18" Text="This is a test" Margin="5" Foreground="Black" />
+ </Button>
+
+ <GroupBox Title="Group Box" Width="300" Height="100"
+ Foreground="White" BorderWidth="2" Margin="3">
+ <Label Name="labValue" FontSize="14" Text="{../../slider.Value}" TextAlignment="Center"/>
+ </GroupBox>
+ <Slider Height="10" Width="300" BorderWidth="1" Background="Transparent" />
+ <GraduatedSlider Name="slider" Height="30" Width="300" Foreground="BlueBell"/>
+ </VerticalStack>
+
+ <HorizontalStack Height="350" Width="-1">
+ <Scroller Name="scroller1" Background="DimGray" Height="0" Width="-1"
+ Margin="5" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">
+ <VerticalStack Name="colors" VerticalAlignment="Top" Margin="1">
+ <ProgressBar Name="pbBar2" Width="100" Height="20" Value="50"
+ BorderWidth="2" Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/>
+ <ProgressBar Width="100" Height="20" Value="{fps}" BorderWidth="2"
+ Foreground="White" Foreground="BlueCrayola" Background="DarkGray"/>
+ </VerticalStack>
+ </Scroller>
+ <Scrollbar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"
+ Orientation="Vertical" Width="16" />
+ </HorizontalStack>
+ </HorizontalStack>
+-->
+<!-- <Slider
+ Height="20" Width="100"
+ Background="Transparent"
+ VerticalAlignment="Bottom" />-->
+ </Border>
</Group>
\ No newline at end of file
-<?xml version="1.0"?>\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
- <GraphicObject Name="g0" Background="Desert" Width="50" Height="50"\r
- MouseEnter="g_MouseEnter" MouseLeave="g_MouseLeave"/>\r
- <GraphicObject Name="g1" Background="Desert" Width="50" Height="50"\r
- MouseEnter="g_MouseEnter" MouseLeave="g_MouseLeave"/>\r
- <GraphicObject Name="g2" Background="Desert" Width="50" Height="50"\r
- MouseEnter="g_MouseEnter" MouseLeave="g_MouseLeave"/>\r
- <Label Name="lab0" Text="000" FontSize="16"/>\r
- <GraphicObject Name="g3" Background="Desert" Width="50" Height="50"\r
- MouseEnter="g_MouseEnter" MouseLeave="g_MouseLeave"/>\r
- <GraphicObject Name="g4" Background="Desert" Width="50" Height="50"\r
- MouseEnter="g_MouseEnter" MouseLeave="g_MouseLeave"/>\r
- <GraphicObject Name="g5" Background="Desert" Width="50" Height="50"\r
- MouseEnter="g_MouseEnter" MouseLeave="g_MouseLeave"/>\r
- </HorizontalStack>\r
- </Group>\r
-<!-- <Scroller Height="100" Width="300" Background="Green" VerticalScrolling="true" Margin="5">\r
- <Group Name="MainGrp" Background="Red" VerticalAlignment="Top"\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
- <Label Text="button"/>\r
- </Button>\r
- <Button Width="-1" Height="-1" Margin="5" BorderWidth="2">\r
- <Label Text="button"/>\r
- </Button>\r
- <Button Width="-1" Height="-1" Margin="5" BorderWidth="2">\r
- <Label Text="button"/>\r
- </Button>\r
- <Button Width="-1" Height="-1" Margin="5" BorderWidth="2">\r
- <Label Text="button"/>\r
- </Button>\r
- <Button Width="-1" Height="200" Margin="5" BorderWidth="2" >\r
- <Label Text="button"/>\r
- </Button> \r
- </HorizontalStack>\r
- </Group>\r
- <Container Width="100" Height="200" Margin="5" BorderWidth="2" VerticalAlignment="Top"/>\r
- </Scroller>-->\r
-\r
+<?xml version="1.0"?>
+<Container Name="container0" Foreground="White" BorderWidth="2" Margin="100"
+ CornerRadius="50">
+ <Group Name="group0" Background="Green" Margin="20">
+ <HorizontalStack Name="hs0" Background="Blue" Margin="20">
+ <GraphicObject Name="g0" Background="Desert" Width="50" Height="50"
+ MouseEnter="g_MouseEnter" MouseLeave="g_MouseLeave"/>
+ <GraphicObject Name="g1" Background="Desert" Width="50" Height="50"
+ MouseEnter="g_MouseEnter" MouseLeave="g_MouseLeave"/>
+ <GraphicObject Name="g2" Background="Desert" Width="50" Height="50"
+ MouseEnter="g_MouseEnter" MouseLeave="g_MouseLeave"/>
+ <Label Name="lab0" Text="000" FontSize="16"/>
+ <GraphicObject Name="g3" Background="Desert" Width="50" Height="50"
+ MouseEnter="g_MouseEnter" MouseLeave="g_MouseLeave"/>
+ <GraphicObject Name="g4" Background="Desert" Width="50" Height="50"
+ MouseEnter="g_MouseEnter" MouseLeave="g_MouseLeave"/>
+ <GraphicObject Name="g5" Background="Desert" Width="50" Height="50"
+ MouseEnter="g_MouseEnter" MouseLeave="g_MouseLeave"/>
+ </HorizontalStack>
+ </Group>
+<!-- <Scroller Height="100" Width="300" Background="Green" VerticalScrolling="true" Margin="5">
+ <Group Name="MainGrp" Background="Red" VerticalAlignment="Top"
+ Foreground="White" BorderWidth="2" Margin="10" Focusable="True"
+ Width="400" Height="200">
+ <HorizontalStack>
+ <Button Width="-1" Height="-1" Margin="5" BorderWidth="2" Background="Gray">
+ <Label Text="button"/>
+ </Button>
+ <Button Width="-1" Height="-1" Margin="5" BorderWidth="2">
+ <Label Text="button"/>
+ </Button>
+ <Button Width="-1" Height="-1" Margin="5" BorderWidth="2">
+ <Label Text="button"/>
+ </Button>
+ <Button Width="-1" Height="-1" Margin="5" BorderWidth="2">
+ <Label Text="button"/>
+ </Button>
+ <Button Width="-1" Height="200" Margin="5" BorderWidth="2" >
+ <Label Text="button"/>
+ </Button>
+ </HorizontalStack>
+ </Group>
+ <Container Width="100" Height="200" Margin="5" BorderWidth="2" VerticalAlignment="Top"/>
+ </Scroller>-->
+
</Container>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<!--<GraphicObject\r
- Width="100" Height="100"\r
- Top="200" Left="200" \r
- Margin="10" Background="Green"/>-->\r
-<Border CornerRadius="5" Margin="1" BorderWidth="1" Fit="True" Background="SteelBlue">\r
- <HorizontalStack Name="hstack" Margin="0" Spacing="5" Fit="True">\r
- <Label Name="labCpt" Text="55"/>\r
- <VerticalStack Spacing="1" Name="vstack" Fit="True">\r
- <Button Width="10" Height="8" >\r
- <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="up"/>\r
- </Button>\r
- <Button Width="10" Height="8" >\r
- <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="down"/>\r
- </Button>\r
- </VerticalStack>\r
- </HorizontalStack>\r
+<?xml version="1.0"?>
+<!--<GraphicObject
+ Width="100" Height="100"
+ Top="200" Left="200"
+ Margin="10" Background="Green"/>-->
+<Border CornerRadius="5" Margin="1" BorderWidth="1" Fit="True" Background="SteelBlue">
+ <HorizontalStack Name="hstack" Margin="0" Spacing="5" Fit="True">
+ <Label Name="labCpt" Text="55"/>
+ <VerticalStack Spacing="1" Name="vstack" Fit="True">
+ <Button Width="10" Height="8" >
+ <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="up"/>
+ </Button>
+ <Button Width="10" Height="8" >
+ <Image Margin="1" Path="#go.Images.Icons.updown.svg" SvgSub="down"/>
+ </Button>
+ </VerticalStack>
+ </HorizontalStack>
</Border>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<!--<VerticalStack Background="Blue" Fit="true" >-->\r
-<!-- <TextRun Text="text run test"/>\r
- <Label Text="label test"/>\r
- <TextBoxWidget Text="Text box test"/>\r
- <Checkbox Caption="Checkbox test"/>\r
- <RadioButton Caption="Radio button test"/>-->\r
-<!-- <Groupbox Margin="0" Fit="true"> \r
- <VerticalStack Fit="true" Background="Red" Margin="0">\r
- <TextRun Text="text run test" />\r
- <TextRun Text="text run test" />\r
- <TextRun Text="text run test"/>\r
- </VerticalStack>\r
- </Groupbox>-->\r
- <GroupBox Background="DarkGreen"> \r
-<!-- <Template>\r
- <Group Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
- <Border CornerRadius="5" BorderWidth="1" Margin="0"\r
- Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\r
- <Container Name="Content" Margin="0"\r
- Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>\r
- </Border>\r
- <Label Text="{../../Title}" VerticalAlignment="Top" Left="15"\r
- Background="Clear" Margin="1"/>\r
- </Group>\r
- </Template>-->\r
- <VerticalStack Fit="true" Background="Red" Margin="10">\r
- <TextRun Text="text run test" />\r
- <TextRun Text="text run test" />\r
- <TextRun Text="text run test"/>\r
- </VerticalStack>\r
- </GroupBox>\r
-<!-- <Group Fit="true">\r
- <Border CornerRadius="5" BorderWidth="1" Margin="6" Fit="true">\r
- <Container Name="Content" Margin="10" Fit="true">\r
- <VerticalStack Fit="true" Background="Red" Margin="0">\r
- <TextRun Text="text run test" />\r
- <TextRun Text="text run test" />\r
- <TextRun Text="text run test"/>\r
- </VerticalStack>\r
- </Container>\r
- </Border>\r
- <Label Text="test" VerticalAlignment="Top" Left="15"\r
- Background="Clear" Margin="1"/>\r
- </Group>-->\r
+<?xml version="1.0"?>
+<!--<VerticalStack Background="Blue" Fit="true" >-->
+<!-- <TextRun Text="text run test"/>
+ <Label Text="label test"/>
+ <TextBoxWidget Text="Text box test"/>
+ <Checkbox Caption="Checkbox test"/>
+ <RadioButton Caption="Radio button test"/>-->
+<!-- <Groupbox Margin="0" Fit="true">
+ <VerticalStack Fit="true" Background="Red" Margin="0">
+ <TextRun Text="text run test" />
+ <TextRun Text="text run test" />
+ <TextRun Text="text run test"/>
+ </VerticalStack>
+ </Groupbox>-->
+ <GroupBox Background="DarkGreen">
+<!-- <Template>
+ <Group Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
+ <Border CornerRadius="5" BorderWidth="1" Margin="0"
+ Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
+ <Container Name="Content" Margin="0"
+ Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>
+ </Border>
+ <Label Text="{../../Title}" VerticalAlignment="Top" Left="15"
+ Background="Clear" Margin="1"/>
+ </Group>
+ </Template>-->
+ <VerticalStack Fit="true" Background="Red" Margin="10">
+ <TextRun Text="text run test" />
+ <TextRun Text="text run test" />
+ <TextRun Text="text run test"/>
+ </VerticalStack>
+ </GroupBox>
+<!-- <Group Fit="true">
+ <Border CornerRadius="5" BorderWidth="1" Margin="6" Fit="true">
+ <Container Name="Content" Margin="10" Fit="true">
+ <VerticalStack Fit="true" Background="Red" Margin="0">
+ <TextRun Text="text run test" />
+ <TextRun Text="text run test" />
+ <TextRun Text="text run test"/>
+ </VerticalStack>
+ </Container>
+ </Border>
+ <Label Text="test" VerticalAlignment="Top" Left="15"
+ Background="Clear" Margin="1"/>
+ </Group>-->
<!--</VerticalStack>-->
\ No newline at end of file
-<?xml version="1.0"?>\r
-<Border BorderWidth="5" Width="200" Height="200" CornerRadius="20" Margin="0" Background="Mantis">\r
- <GraphicObject CornerRadius="0" Background="CornflowerBlue" Height="100" Width="100"/>\r
-</Border>\r
+<?xml version="1.0"?>
+<Border BorderWidth="5" Width="200" Height="200" CornerRadius="20" Margin="0" Background="Mantis">
+ <GraphicObject CornerRadius="0" Background="CornflowerBlue" Height="100" Width="100"/>
+</Border>
-<?xml version="1.0"?>\r
-<CheckBox Width="-1" Height="-1" Caption="Checkbox" Background="DimGray" IsChecked="true"/>\r
-\r
+<?xml version="1.0"?>
+<CheckBox Width="-1" Height="-1" Caption="Checkbox" Background="DimGray" IsChecked="true"/>
+
-<?xml version="1.0"?>\r
+<?xml version="1.0"?>
<ComboBox Height="-1" Data="{TestList}" SelectedIndex="0"/>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<Container Class="TestContainer1" Background="Red" Left="100" Top="100" Height="300" Width="300" >\r
- <Container Left="100" Top="100" Height="100" Width="100" Background="LightGreen" Margin="0">\r
- <Label Text="{fps}" Background="DarkRed"/>\r
- </Container>\r
-</Container>\r
+<?xml version="1.0"?>
+<Container Class="TestContainer1" Background="Red" Left="100" Top="100" Height="300" Width="300" >
+ <Container Left="100" Top="100" Height="100" Width="100" Background="LightGreen" Margin="0">
+ <Label Text="{fps}" Background="DarkRed"/>
+ </Container>
+</Container>
-<?xml version="1.0"?>\r
-<Expandable Caption="Test expandable" Background="DimGray">\r
- <VerticalStack Width="-1" Height="-1">\r
- <CheckBox Name="chk1" Background="Red"/>\r
- <CheckBox Name="chk2" IsChecked="true"/>\r
- <CheckBox Name="chk3"/>\r
- <CheckBox Name="chk4"/>\r
- <HorizontalStack Fit="true" Margin="2" Background="Blue">\r
- <Label Name="captionFps" Text="Fps:" Width="30" TextAlignment="RightCenter"/>\r
- <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="-1" TextAlignment="Center" Background="AoEnglish"/>\r
- </HorizontalStack>\r
- </VerticalStack>\r
-</Expandable>\r
+<?xml version="1.0"?>
+<Expandable Caption="Test expandable" Background="DimGray">
+ <VerticalStack Width="-1" Height="-1">
+ <CheckBox Name="chk1" Background="Red"/>
+ <CheckBox Name="chk2" IsChecked="true"/>
+ <CheckBox Name="chk3"/>
+ <CheckBox Name="chk4"/>
+ <HorizontalStack Fit="true" Margin="2" Background="Blue">
+ <Label Name="captionFps" Text="Fps:" Width="30" TextAlignment="RightCenter"/>
+ <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="-1" TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ </VerticalStack>
+</Expandable>
-<?xml version="1.0"?>\r
-<Grid RowCount="2" ColumnCount="2">\r
- <GraphicObject Background="0,0;0,0;0,0;1,0"/>\r
- <GraphicObject Background="0,0;0,0;0,5;1,0"/>\r
- <GraphicObject Background="0,0;0,5;0,0;1,0"/>\r
- <GraphicObject Background="0,5;0,0;0,0;1,0"/>\r
+<?xml version="1.0"?>
+<Grid RowCount="2" ColumnCount="2">
+ <GraphicObject Background="0,0;0,0;0,0;1,0"/>
+ <GraphicObject Background="0,0;0,0;0,5;1,0"/>
+ <GraphicObject Background="0,0;0,5;0,0;1,0"/>
+ <GraphicObject Background="0,5;0,0;0,0;1,0"/>
</Grid>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<GroupBox Width="-1" Height="-1" Background="Red">\r
-<Label/>\r
-</GroupBox>\r
+<?xml version="1.0"?>
+<GroupBox Width="-1" Height="-1" Background="Red">
+<Label/>
+</GroupBox>
-<?xml version="1.0"?>\r
-<Window Width="600" Height="500">\r
-<Border BorderWidth="5" Margin="10">\r
- <VerticalStack Margin="10">\r
- <GraphicObject Height="20" Width="50" Background="Blue"/>\r
- <HorizontalStack Spacing="5" Margin="5" Background="Red">\r
- <GraphicObject Height="20" Width="50" Background="Blue"/>\r
- <GraphicObject Height="20" Width="50" Background="Blue"/>\r
- <Image Name="Image" Width="40" Height="40" Background="Red"\r
- Path="#go.Images.Icons.iconInfo.svg" />\r
- <Label Font="serif, 12" Width="0" Height="0" Text="MessageBox"\r
- Multiline="true" WordWrap="true"/>\r
- <GraphicObject Height="20" Width="50" Background="Blue"/>\r
- <GraphicObject Height="20" Width="50" Background="Blue"/>\r
- <GraphicObject Height="20" Width="50" Background="Blue"/>\r
- </HorizontalStack>\r
- </VerticalStack>\r
-</Border>\r
-</Window>\r
+<?xml version="1.0"?>
+<Window Width="600" Height="500">
+<Border BorderWidth="5" Margin="10">
+ <VerticalStack Margin="10">
+ <GraphicObject Height="20" Width="50" Background="Blue"/>
+ <HorizontalStack Spacing="5" Margin="5" Background="Red">
+ <GraphicObject Height="20" Width="50" Background="Blue"/>
+ <GraphicObject Height="20" Width="50" Background="Blue"/>
+ <Image Name="Image" Width="40" Height="40" Background="Red"
+ Path="#go.Images.Icons.iconInfo.svg" />
+ <Label Font="serif, 12" Width="0" Height="0" Text="MessageBox"
+ Multiline="true" WordWrap="true"/>
+ <GraphicObject Height="20" Width="50" Background="Blue"/>
+ <GraphicObject Height="20" Width="50" Background="Blue"/>
+ <GraphicObject Height="20" Width="50" Background="Blue"/>
+ </HorizontalStack>
+ </VerticalStack>
+</Border>
+</Window>
-<?xml version="1.0"?>\r
-<VerticalStack>\r
- <TextRun Multiline="true" WordWrap="true" Width="0" Height="100" Background="DimGray"\r
- Text="This is a long text to test text wrapping, and so here is another statement to add to this meaningless text only designed to make a small test" />\r
- <Label Name="labFps" Text="{fps}" Font="droid bold, 12" TextAlignment="Center" Background="AoEnglish" />\r
+<?xml version="1.0"?>
+<VerticalStack>
+ <TextRun Multiline="true" WordWrap="true" Width="0" Height="100" Background="DimGray"
+ Text="This is a long text to test text wrapping, and so here is another statement to add to this meaningless text only designed to make a small test" />
+ <Label Name="labFps" Text="{fps}" Font="droid bold, 12" TextAlignment="Center" Background="AoEnglish" />
</VerticalStack>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<Popper Caption="TestPopper" Width="100" Background="DimGray">\r
- <Border Fit="True" Background="ArmyGreen">\r
-<!-- <Image Fit="true" Path="#go.Images.Icons.tetra.png" Margin="10"/>-->\r
- <VerticalStack Fit="true" Margin="10" Background="CornflowerBlue">\r
- <CheckBox Name="chk1" Background="Red"/>\r
- <CheckBox Name="chk2" IsChecked="true"/>\r
- <CheckBox Name="chk3"/>\r
- <CheckBox Name="chk4"/>\r
- <HorizontalStack Fit="true" Margin="20">\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
- </VerticalStack> \r
- </Border>\r
-</Popper>\r
+<?xml version="1.0"?>
+<Popper Caption="TestPopper" Width="100" Background="DimGray">
+ <Border Fit="True" Background="ArmyGreen">
+<!-- <Image Fit="true" Path="#go.Images.Icons.tetra.png" Margin="10"/>-->
+ <VerticalStack Fit="true" Margin="10" Background="CornflowerBlue">
+ <CheckBox Name="chk1" Background="Red"/>
+ <CheckBox Name="chk2" IsChecked="true"/>
+ <CheckBox Name="chk3"/>
+ <CheckBox Name="chk4"/>
+ <HorizontalStack Fit="true" Margin="20">
+ <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+ <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ </VerticalStack>
+ </Border>
+</Popper>
-<?xml version="1.0"?>\r
-<VerticalStack Width="200" Height="-1" Margin="20" Background="DimGray">\r
- <RadioButton Caption="Radio1"/>\r
- <RadioButton Caption="Radio2" IsChecked="true"/>\r
- <RadioButton Caption="Radio3"/>\r
- <RadioButton Caption="Radio4"/>\r
-</VerticalStack>\r
-\r
+<?xml version="1.0"?>
+<VerticalStack Width="200" Height="-1" Margin="20" Background="DimGray">
+ <RadioButton Caption="Radio1"/>
+ <RadioButton Caption="Radio2" IsChecked="true"/>
+ <RadioButton Caption="Radio3"/>
+ <RadioButton Caption="Radio4"/>
+</VerticalStack>
+
-<?xml version="1.0"?>\r
-<VerticalStack Width="200" Height="-1" Margin="20" Background="DimGray">\r
- <RadioButton Caption="Radio1"/>\r
- <RadioButton Caption="Radio2" IsChecked="true"/>\r
- <RadioButton Caption="Radio3"/>\r
- <RadioButton Caption="Radio4">\r
- <Template>\r
- <HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
- <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>\r
- <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>\r
- </HorizontalStack>\r
- </Template>\r
- </RadioButton>\r
-</VerticalStack>\r
-\r
+<?xml version="1.0"?>
+<VerticalStack Width="200" Height="-1" Margin="20" Background="DimGray">
+ <RadioButton Caption="Radio1"/>
+ <RadioButton Caption="Radio2" IsChecked="true"/>
+ <RadioButton Caption="Radio3"/>
+ <RadioButton Caption="Radio4">
+ <Template>
+ <HorizontalStack Spacing="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
+ <Image Margin="2" Width="14" Height="14" Path="{../../Image}" SvgSub="{../../SvgSub}"/>
+ <Label Text="{../../Caption}" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}"/>
+ </HorizontalStack>
+ </Template>
+ </RadioButton>
+</VerticalStack>
+
-<?xml version="1.0"?>\r
-<Group Name="TopContainer" Width="400" Height="400"\r
- Focusable="True" Background="Gray">\r
- <ScrollBar Height="0" Orientation="Vertical" Width="16" MaximumScroll="100"/>\r
+<?xml version="1.0"?>
+<Group Name="TopContainer" Width="400" Height="400"
+ Focusable="True" Background="Gray">
+ <ScrollBar Height="0" Orientation="Vertical" Width="16" MaximumScroll="100"/>
</Group>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<VerticalStack Name="TopContainer" Width="400" Height="-1"\r
- Margin="20" Background="DarkGray">\r
-\r
- <HorizontalStack Fit="true">\r
- <Spinner Value="{IntValue}" ValueChanged="onSpinnerValueChange"/>\r
- <Spinner Value="5"/>\r
- <Spinner Value="5"/>\r
- <Button></Button>\r
- </HorizontalStack>\r
+<?xml version="1.0"?>
+<VerticalStack Name="TopContainer" Width="400" Height="-1"
+ Margin="20" Background="DarkGray">
+
+ <HorizontalStack Fit="true">
+ <Spinner Value="{IntValue}" ValueChanged="onSpinnerValueChange"/>
+ <Spinner Value="5"/>
+ <Spinner Value="5"/>
+ <Button></Button>
+ </HorizontalStack>
</VerticalStack>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<Window Left="10" Top="10" Title="Test window" \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
- <RadioButton Caption="Radio 1" Background="Red" />\r
- <RadioButton Caption="Radio 2" IsChecked="true" />\r
- <RadioButton Caption="Radio 3" />\r
- </VerticalStack>\r
- </GroupBox>\r
- <HorizontalStack Width="0" Height="-1" Margin="10" Background="BlueCrayola">\r
- <CheckBox Height="-1" Width="80"/>\r
- <GraphicObject Width="0"/>\r
- <CheckBox Height="-1" Width="80" IsChecked="true"/>\r
- </HorizontalStack>\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
-<!--</Group>-->\r
-<!-- <Label Text="{fps}" Background="DarkRed"/>\r
- <Label Text="{fpsMin}" />\r
+<?xml version="1.0"?>
+<Window Left="10" Top="10" Title="Test window"
+ Width="250" Height="550" >
+ <VerticalStack Name="contentVSStack" Margin="10" Spacing="10" Background="0,4;0,4;0,4;0,4">
+ <Slider Name="slider" Height="10" Width="0"/>
+ <GroupBox Caption="test" Height="-1" Width="-1" Margin="5">
+ <VerticalStack Height="-1" Width="0" >
+ <RadioButton Caption="Radio 1" Background="Red" />
+ <RadioButton Caption="Radio 2" IsChecked="true" />
+ <RadioButton Caption="Radio 3" />
+ </VerticalStack>
+ </GroupBox>
+ <HorizontalStack Width="0" Height="-1" Margin="10" Background="BlueCrayola">
+ <CheckBox Height="-1" Width="80"/>
+ <GraphicObject Width="0"/>
+ <CheckBox Height="-1" Width="80" IsChecked="true"/>
+ </HorizontalStack>
+<Border Fit="true" CornerRadius="5" BorderWidth="1">
+ <Container Name="MainGrp" Background="0,5;0,5;0,5;0,4" Width="120" Fit="true"
+ Margin="10" Focusable="True" >
+ <VerticalStack Fit="true" Name="vsFps" Spacing="10" >
+ <HorizontalStack Fit="true">
+ <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
+ <Label Name="labUpdate" Text="{update}" Font="droid,12" Background="AoEnglish" Width="50" TextAlignment="Center"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
+ <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Background="AoEnglish" Width="50" TextAlignment="Center"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="RightCenter"/>
+ <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Min:" Width="50" TextAlignment="RightCenter"/>
+ <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" Background="AoEnglish"/>
+ </HorizontalStack>
+ <HorizontalStack Fit="true">
+ <Label Text="Max:" Width="50" TextAlignment="RightCenter"/>
+ <Label Text="{fpsMax}" Font="droid , 12" Background="AoEnglish" Width="50" TextAlignment="Center"/>
+ </HorizontalStack>
+ </VerticalStack>
+ </Container>
+</Border>
+<!-- <Checkbox Height="-1" Width="-1" Background="Red" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>-->
+ </VerticalStack>
+</Window>
+<!--</Group>-->
+<!-- <Label Text="{fps}" Background="DarkRed"/>
+ <Label Text="{fpsMin}" />
<Label Text="{fpsMax}" />-->
\ No newline at end of file
-<?xml version="1.0"?>\r
-<!--<Group>-->\r
-<Window Name="window1" Left="10" Top="10" Title="Test window" \r
- Width="250" Height="300" >\r
- <VerticalStack Name="contentVSStack" Margin="10" Spacing="10">\r
- <Slider Name="slider" Height="10" Width="0"/>\r
-\r
- <HorizontalStack Width="0" Height="-1" Margin="10" Background="BlueCrayola">\r
- <Checkbox Height="-1" Width="80"/>\r
- <GraphicObject Width="0"/>\r
- <Checkbox Height="-1" Width="80"/>\r
- </HorizontalStack>\r
- <Groupbox Text="test" Height="-1" Width="-1" Margin="5">\r
- <VerticalStack Height="-1" Width="0" >\r
- <RadioButton Caption="Radio 1" Background="Red" />\r
- <RadioButton Caption="Radio 2" IsChecked="true" />\r
- <RadioButton Caption="Radio 3" />\r
- </VerticalStack>\r
- </Groupbox>\r
-<!-- <Checkbox Height="-1" Width="-1" Background="Red" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>-->\r
- </VerticalStack>\r
-</Window>\r
-<!--</Group>-->\r
-<!-- <Label Text="{fps}" Background="DarkRed"/>\r
- <Label Text="{fpsMin}" />\r
+<?xml version="1.0"?>
+<!--<Group>-->
+<Window Name="window1" Left="10" Top="10" Title="Test window"
+ Width="250" Height="300" >
+ <VerticalStack Name="contentVSStack" Margin="10" Spacing="10">
+ <Slider Name="slider" Height="10" Width="0"/>
+
+ <HorizontalStack Width="0" Height="-1" Margin="10" Background="BlueCrayola">
+ <Checkbox Height="-1" Width="80"/>
+ <GraphicObject Width="0"/>
+ <Checkbox Height="-1" Width="80"/>
+ </HorizontalStack>
+ <Groupbox Text="test" Height="-1" Width="-1" Margin="5">
+ <VerticalStack Height="-1" Width="0" >
+ <RadioButton Caption="Radio 1" Background="Red" />
+ <RadioButton Caption="Radio 2" IsChecked="true" />
+ <RadioButton Caption="Radio 3" />
+ </VerticalStack>
+ </Groupbox>
+<!-- <Checkbox Height="-1" Width="-1" Background="Red" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>-->
+ </VerticalStack>
+</Window>
+<!--</Group>-->
+<!-- <Label Text="{fps}" Background="DarkRed"/>
+ <Label Text="{fpsMin}" />
<Label Text="{fpsMax}" />-->
\ No newline at end of file
-<?xml version="1.0"?>\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" Foreground="White" CornerRadius="20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
- <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">\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" 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
- <GraphicObject Width="5"/>\r
- </HorizontalStack>\r
- </Border>\r
- <Container Name="Content" Height="{../../../../TemplatedHeight}" Width="{../../../../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>\r
- </VerticalStack>\r
- </Border>\r
- </Template>\r
- <GraphicObject Height="50" Width="50" Background="Green"/>\r
-</Window>\r
+<?xml version="1.0"?>
+<Window Name="window1" Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0,5;0,5;0,5;0,8"
+ Focusable="True" CornerRadius="20" MinimumSize="100;100" MaximumSize="500;500">
+ <Template>
+ <Border BorderWidth="1" Foreground="White" CornerRadius="20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
+ <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
+ <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"/>
+ <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" 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>
+ <GraphicObject Width="5"/>
+ </HorizontalStack>
+ </Border>
+ <Container Name="Content" Height="{../../../../TemplatedHeight}" Width="{../../../../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>
+ </VerticalStack>
+ </Border>
+ </Template>
+ <GraphicObject Height="50" Width="50" Background="Green"/>
+</Window>
-<?xml version="1.0"?>\r
-<Window 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
- <Container Margin="20" Name="Content" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>\r
- </Template>\r
-<!-- <Group Background="Green">-->\r
- <GraphicObject Height="50" Width="50" Background="Red" Margin="5"/>\r
-<!-- <Scrollbar Orientation="Vertical" Height="0" Width="10" Background="Blue" Margin="0" HorizontalAlignment="Right"/>-->\r
-<!-- </Group>-->\r
-</Window>\r
+<?xml version="1.0"?>
+<Window Left="10" Top="10" Title="Test window" Width="200" Height="200" Background="0,5;0,5;0,5;0,8"
+ Focusable="True" CornerRadius="20" MinimumSize="100;100" MaximumSize="500;500">
+ <Template>
+ <Container Margin="20" Name="Content" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" Background="0,5;0,5;0,5;0,5"/>
+ </Template>
+<!-- <Group Background="Green">-->
+ <GraphicObject Height="50" Width="50" Background="Red" Margin="5"/>
+<!-- <Scrollbar Orientation="Vertical" Height="0" Width="10" Background="Blue" Margin="0" HorizontalAlignment="Right"/>-->
+<!-- </Group>-->
+</Window>
-<?xml version="1.0"?>\r
-<!--<ListBox Data="{TestList}" Focusable="true"/>-->\r
-<Border BorderWidth="2" Fit="true">\r
- <VerticalStack Fit="true" Margin="50">\r
- <Label Text="{MousePos}" Width="-1" Background="DarkGreen"/>\r
- <Label Text="{Hover}" Width="-1" Background="DarkGreen"/>\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 BorderWidth="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">\r
- <HorizontalStack Margin="1" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}" >\r
- <Scroller Name="scroller1" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}" \r
- Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">\r
- <VerticalStack Width="{../../../../TemplatedWidth}" Height="-1" MinimumSize="100;100"\r
- Name="List" Margin="0" VerticalAlignment="Top" />\r
- </Scroller>\r
- <ScrollBar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" \r
- MaximumScroll="{../scroller1.MaximumScroll}" Orientation="Vertical" \r
- Width="10" Height="{../../../TemplatedHeight}" />\r
- </HorizontalStack>\r
- </Border>\r
- </Template>\r
- </ListBox>\r
- <Button Caption="Load list" Width="0" MouseClick="OnLoadList"/>\r
- </VerticalStack>\r
+<?xml version="1.0"?>
+<!--<ListBox Data="{TestList}" Focusable="true"/>-->
+<Border BorderWidth="2" Fit="true">
+ <VerticalStack Fit="true" Margin="50">
+ <Label Text="{MousePos}" Width="-1" Background="DarkGreen"/>
+ <Label Text="{Hover}" Width="-1" Background="DarkGreen"/>
+ <Button Caption="Clear" Width="150" MouseClick="OnClear"/>
+ <ListBox Data="{TestList}" Background="0,5;0,5;0,5;0,5"
+ HorizontalAlignment="Center" Width="-1" Height="150" Margin="5">
+ <Template>
+ <Border BorderWidth="1" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}">
+ <HorizontalStack Margin="1" Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}" >
+ <Scroller Name="scroller1" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"
+ Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">
+ <VerticalStack Width="{../../../../TemplatedWidth}" Height="-1" MinimumSize="100;100"
+ Name="List" Margin="0" VerticalAlignment="Top" />
+ </Scroller>
+ <ScrollBar Name="scrollbar1" Scroll="{../scroller1.ScrollY}"
+ MaximumScroll="{../scroller1.MaximumScroll}" Orientation="Vertical"
+ Width="10" Height="{../../../TemplatedHeight}" />
+ </HorizontalStack>
+ </Border>
+ </Template>
+ </ListBox>
+ <Button Caption="Load list" Width="0" MouseClick="OnLoadList"/>
+ </VerticalStack>
</Border>
\ No newline at end of file
-<?xml version="1.0"?>\r
-<VerticalStack Background="DarkBlue" Height="300" Width="200">\r
-<!-- <Label Text="label11" Width="0" Background="Green"/>\r
- <Label Text="label21"/>-->\r
- <HorizontalStack Width="-1" Height="-1" Margin="5"\r
- Focusable="True" Background="Blue">\r
-\r
- <Label Text="label12"/>\r
- <VerticalStack Background="Red" Fit="true">\r
- <Label Text="label99"/>\r
- <Label Text="label999"/>\r
- </VerticalStack>\r
- <Label Text="label22"/>\r
-<!-- <Label Text="label32"/>\r
- <Label Text="label42"/>\r
- <Label Text="label52"/>-->\r
- </HorizontalStack>\r
-<!-- <Label Text="label33" Background="Green" Width="0"/>-->\r
-<!-- <Label Text="label43"/>-->\r
-<!-- <Border Margin="10">\r
- <Label Text="label53" Background="Red" Height="0" CornerRadius="10"/>\r
- </Border>-->\r
- <Label Text="label43"/>\r
- <Label Text="label43"/>\r
-</VerticalStack>\r
+<?xml version="1.0"?>
+<VerticalStack Background="DarkBlue" Height="300" Width="200">
+<!-- <Label Text="label11" Width="0" Background="Green"/>
+ <Label Text="label21"/>-->
+ <HorizontalStack Width="-1" Height="-1" Margin="5"
+ Focusable="True" Background="Blue">
+
+ <Label Text="label12"/>
+ <VerticalStack Background="Red" Fit="true">
+ <Label Text="label99"/>
+ <Label Text="label999"/>
+ </VerticalStack>
+ <Label Text="label22"/>
+<!-- <Label Text="label32"/>
+ <Label Text="label42"/>
+ <Label Text="label52"/>-->
+ </HorizontalStack>
+<!-- <Label Text="label33" Background="Green" Width="0"/>-->
+<!-- <Label Text="label43"/>-->
+<!-- <Border Margin="10">
+ <Label Text="label53" Background="Red" Height="0" CornerRadius="10"/>
+ </Border>-->
+ <Label Text="label43"/>
+ <Label Text="label43"/>
+</VerticalStack>
-<?xml version="1.0"?>\r
- <HorizontalStack Width="-1" Height="-1" Focusable="true"\r
- HorizontalAlignment="Left"\r
- MouseEnter="{Background=BlueCrayola}"\r
- MouseLeave="{Background=Transparent}">\r
- <Image Width="16" Height="16" Path="#Tests.image.folder1.svg" SvgSub="{Attributes}"/>\r
- <Label Text="{Name}" Width="-1" Height="-1" Margin="0"/>\r
- <Label Text="{Attributes}" Width="-1" Height="-1" Margin="0"/>\r
- <Label Text="{Extension}" Width="-1" Height="-1" Margin="0"/>\r
- </HorizontalStack>\r
-\r
+<?xml version="1.0"?>
+ <HorizontalStack Width="-1" Height="-1" Focusable="true"
+ HorizontalAlignment="Left"
+ MouseEnter="{Background=BlueCrayola}"
+ MouseLeave="{Background=Transparent}">
+ <Image Width="16" Height="16" Path="#Tests.image.folder1.svg" SvgSub="{Attributes}"/>
+ <Label Text="{Name}" Width="-1" Height="-1" Margin="0"/>
+ <Label Text="{Attributes}" Width="-1" Height="-1" Margin="0"/>
+ <Label Text="{Extension}" Width="-1" Height="-1" Margin="0"/>
+ </HorizontalStack>
+
-<?xml version="1.0"?>\r
- <HorizontalStack Width="0" Height="-1" Focusable="true" \r
- MouseEnter="{Background=SkyBlue}"\r
- MouseLeave="{Background=Transparent}">\r
- <Image Width="8" Height="8" Path="#Crow.Images.Icons.member.svg" SvgSub="{GetIcon}"/>\r
- <Label Text="{Name}" Width="0" Height="-1" Margin="1"/>\r
- <Label Text="{MemberType}" Width="-1" Height="-1" Margin="0"/>\r
- </HorizontalStack>\r
-\r
+<?xml version="1.0"?>
+ <HorizontalStack Width="0" Height="-1" Focusable="true"
+ MouseEnter="{Background=SkyBlue}"
+ MouseLeave="{Background=Transparent}">
+ <Image Width="8" Height="8" Path="#Crow.Images.Icons.member.svg" SvgSub="{GetIcon}"/>
+ <Label Text="{Name}" Width="0" Height="-1" Margin="1"/>
+ <Label Text="{MemberType}" Width="-1" Height="-1" Margin="0"/>
+ </HorizontalStack>
+
-#define MONO_CAIRO_DEBUG_DISPOSE\r
-\r
-\r
-using System;\r
-using System.Runtime.InteropServices;\r
-using OpenTK;\r
-using OpenTK.Graphics.OpenGL;\r
-using OpenTK.Input;\r
-\r
-using System.Diagnostics;\r
-\r
-//using GGL;\r
-using System.Threading;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using Cairo;\r
-\r
-\r
-namespace Crow\r
-{\r
- class NUnitCrowWindow : IValueChange, ILayoutable, IGOLibHost\r
- {\r
- #region IValueChange implementation\r
- public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
- public virtual void NotifyValueChanged(string MemberName, object _value)\r
- {\r
- ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value)); \r
- }\r
- #endregion\r
-\r
- public Rectangle ClientRectangle = new Rectangle(0,0,800,600);\r
- public List<GraphicObject> GraphicObjects = new List<GraphicObject>();\r
- public Color Background = Color.Transparent;\r
-\r
- Rectangles _redrawClip = new Rectangles();//should find another way to access it from child\r
- List<GraphicObject> _gobjsToRedraw = new List<GraphicObject>();\r
-\r
- #region IGOLibHost implementation\r
- public Rectangles redrawClip {\r
- get {\r
- return _redrawClip;\r
- }\r
- set {\r
- _redrawClip = value;\r
- }\r
- }\r
-\r
- public List<GraphicObject> gobjsToRedraw {\r
- get {\r
- return _gobjsToRedraw;\r
- }\r
- set {\r
- _gobjsToRedraw = value;\r
- }\r
- }\r
- public void AddWidget(GraphicObject g)\r
- {\r
- g.Parent = this;\r
- GraphicObjects.Insert (0, g);\r
-\r
- g.RegisterForLayouting ((int)LayoutingType.Sizing);\r
- }\r
- public void DeleteWidget(GraphicObject g)\r
- {\r
- g.Visible = false;//trick to ensure clip is added to refresh zone\r
- g.ClearBinding();\r
- GraphicObjects.Remove (g);\r
- }\r
- public void PutOnTop(GraphicObject g)\r
- {\r
- if (GraphicObjects.IndexOf(g) > 0)\r
- {\r
- GraphicObjects.Remove(g);\r
- GraphicObjects.Insert(0, g);\r
- g.registerClipRect ();\r
- }\r
- }\r
- public void Quit ()\r
- {\r
- }\r
-\r
- #region focus\r
- GraphicObject _activeWidget; //button is pressed on widget \r
- GraphicObject _hoverWidget; //mouse is over\r
- GraphicObject _focusedWidget; //has keyboard (or other perif) focus \r
-\r
- public GraphicObject activeWidget\r
- {\r
- get { return _activeWidget; }\r
- set \r
- {\r
- if (_activeWidget == value)\r
- return;\r
- _activeWidget = value;\r
- }\r
- }\r
- public GraphicObject hoverWidget\r
- {\r
- get { return _hoverWidget; }\r
- set { _hoverWidget = value; }\r
- }\r
- public GraphicObject FocusedWidget {\r
- get { return _focusedWidget; }\r
- set {\r
- if (_focusedWidget == value)\r
- return;\r
- if (_focusedWidget != null)\r
- _focusedWidget.onUnfocused (this, null);\r
- _focusedWidget = value;\r
- if (_focusedWidget != null)\r
- _focusedWidget.onFocused (this, null);\r
- }\r
- }\r
- #endregion\r
-\r
- #endregion\r
-\r
- #region Events\r
- //those events are raised only if mouse isn't in a graphic object\r
- public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;\r
- public event EventHandler<MouseButtonEventArgs> MouseButtonUp;\r
- public event EventHandler<MouseButtonEventArgs> MouseButtonDown;\r
- public event EventHandler<MouseButtonEventArgs> MouseClick;\r
- public event EventHandler<MouseMoveEventArgs> MouseMove;\r
- #endregion\r
-\r
- #region graphic contexte\r
- Context ctx;\r
- public Surface surf;\r
- string testId;\r
- #endregion\r
-\r
- #region update\r
- public Stopwatch updateTime = new Stopwatch ();\r
- public Stopwatch layoutTime = new Stopwatch ();\r
- public Stopwatch guTime = new Stopwatch ();\r
- public Stopwatch drawingTime = new Stopwatch ();\r
-\r
- public void Update ()\r
- {\r
- guTime.Reset ();\r
- updateTime.Restart ();\r
- layoutTime.Restart ();\r
-\r
- ctx = new Context(surf);\r
-\r
- GraphicObject[] invGOList = new GraphicObject[GraphicObjects.Count];\r
- GraphicObjects.CopyTo (invGOList,0);\r
- invGOList = invGOList.Reverse ().ToArray ();\r
-\r
- //Debug.WriteLine ("======= Layouting queue start =======");\r
- lock (Interface.LayoutingQueue) { \r
- while (Interface.LayoutingQueue.Count > 0) {\r
- // Stopwatch lqiProcTime = new Stopwatch ();\r
- // lqiProcTime.Start ();\r
- LayoutingQueueItem lqi = Interface.LayoutingQueue.Dequeue ();\r
- lqi.ProcessLayouting ();\r
- // lqiProcTime.Stop ();\r
- // if (lqiProcTime.ElapsedMilliseconds > 10) {\r
- // Debug.WriteLine("lqi {2}: {0} ticks \t, {1} ms",\r
- // updateTime.ElapsedTicks,\r
- // updateTime.ElapsedMilliseconds, lqi.ToString());\r
- // }\r
- }\r
- }\r
-\r
- //final redraw clips should be added only when layout is completed among parents,\r
- //that's why it take place in a second pass\r
- GraphicObject[] gotr = new GraphicObject[gobjsToRedraw.Count];\r
- gobjsToRedraw.CopyTo (gotr);\r
- gobjsToRedraw.Clear ();\r
- foreach (GraphicObject p in gotr) {\r
- p.registerClipRect ();\r
- }\r
-\r
- layoutTime.Stop ();\r
- guTime.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
- 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
- Rectangles clip = redrawClip.intersectingRects (p.Slot);\r
-\r
- if (clip.count > 0)\r
- p.Paint (ref ctx, clip);\r
- }\r
- ctx.Restore ();\r
-\r
- drawingTime.Stop ();\r
- }\r
- }\r
- ctx.ResetClip ();\r
- // #if DEBUG_CLIP_RECTANGLE\r
- // redrawClip.stroke (ctx, Color.Red.AdjustAlpha(0.1));\r
- // #endif\r
- redrawClip.Reset ();\r
- }\r
- }\r
- guTime.Stop ();\r
- updateTime.Stop ();\r
- ctx.Dispose ();\r
- Console.WriteLine("{3} => layout:{0,8} t\tdraw:{1,8} t\tupdate:{2,8} t",\r
- layoutTime.ElapsedTicks,\r
- guTime.ElapsedTicks,\r
- updateTime.ElapsedTicks,\r
- testId);\r
-// Console.WriteLine("{3} => layout:{0}ms\tdraw{1}ms\tupdate:{2}ms",\r
-// layoutTime.ElapsedMilliseconds,\r
-// guTime.ElapsedMilliseconds,\r
-// updateTime.ElapsedMilliseconds,\r
-// testId);\r
- surf.WriteToPng (@"ExpectedOutputs/" + testId + ".png");\r
- surf.WriteToPng (@"tmp.png");\r
- } \r
- #endregion\r
-\r
- #region loading\r
- public GraphicObject LoadTest (string id)\r
- {\r
- testId = id;\r
- GraphicObject tmp = Interface.Load ("Interfaces/" + testId + ".crow", this);\r
- AddWidget (tmp);\r
- return tmp;\r
- }\r
- /// <summary> Remove all Graphic objects from top container </summary>\r
- public void ClearInterface()\r
- {\r
- int i = 0;\r
- while (GraphicObjects.Count>0) {\r
- GraphicObject g = GraphicObjects [i];\r
- g.Visible = false;\r
- g.ClearBinding ();\r
- GraphicObjects.RemoveAt (0);\r
- }\r
- }\r
- #endregion\r
-\r
- public NUnitCrowWindow (int width, int height)\r
- {\r
- ClientRectangle.Width = width;\r
- ClientRectangle.Height = height;\r
-\r
- surf = new ImageSurface(Format.Argb32, ClientRectangle.Width, ClientRectangle.Height);\r
- }\r
-\r
- int frameCpt = 0;\r
- int idx = 0;\r
-\r
-\r
- #region FPS\r
- int _fps = 0;\r
-\r
- public int fps {\r
- get { return _fps; }\r
- set {\r
- if (_fps == value)\r
- return;\r
-\r
- _fps = value;\r
-\r
- if (_fps > fpsMax) {\r
- fpsMax = _fps;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax));\r
- } else if (_fps < fpsMin) {\r
- fpsMin = _fps;\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin));\r
- }\r
-\r
- ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));\r
- ValueChanged.Raise (this, new ValueChangeEventArgs ("update",\r
- this.updateTime.ElapsedMilliseconds.ToString () + " ms"));\r
- }\r
- }\r
-\r
- public int fpsMin = int.MaxValue;\r
- public int fpsMax = 0;\r
-\r
- void resetFps ()\r
- {\r
- fpsMin = int.MaxValue;\r
- fpsMax = 0;\r
- _fps = 0;\r
- }\r
- //public string update = "";\r
- #endregion\r
-\r
-\r
- #region Mouse Handling\r
- void Mouse_Move(object sender, MouseMoveEventArgs e)\r
- {\r
- if (_activeWidget != null) {\r
- //first, ensure object is still in the graphic tree\r
- if (_activeWidget.HostContainer == null) {\r
- activeWidget = null;\r
- } else {\r
-\r
- //send move evt even if mouse move outside bounds\r
- _activeWidget.onMouseMove (_activeWidget, e);\r
- return;\r
- }\r
- }\r
-\r
- if (_hoverWidget != null) {\r
- //first, ensure object is still in the graphic tree\r
- if (_hoverWidget.HostContainer == null) {\r
- hoverWidget = null;\r
- } else {\r
- //check topmost graphicobject first\r
- GraphicObject tmp = _hoverWidget;\r
- GraphicObject topc = null;\r
- while (tmp is GraphicObject) {\r
- topc = tmp;\r
- tmp = tmp.Parent as GraphicObject;\r
- }\r
- int idxhw = GraphicObjects.IndexOf (topc);\r
- if (idxhw != 0) {\r
- int i = 0;\r
- while (i < idxhw) {\r
- if (GraphicObjects [i].MouseIsIn (e.Position)) {\r
- _hoverWidget.onMouseLeave (this, e);\r
- GraphicObjects [i].checkHoverWidget (e);\r
- return;\r
- }\r
- i++;\r
- }\r
- }\r
-\r
-\r
- if (_hoverWidget.MouseIsIn (e.Position)) {\r
- _hoverWidget.checkHoverWidget (e);\r
- return;\r
- } else {\r
- _hoverWidget.onMouseLeave (this, e);\r
- //seek upward from last focused graph obj's\r
- while (_hoverWidget.Parent as GraphicObject != null) {\r
- _hoverWidget = _hoverWidget.Parent as GraphicObject;\r
- if (_hoverWidget.MouseIsIn (e.Position)) {\r
- _hoverWidget.checkHoverWidget (e);\r
- return;\r
- } else\r
- _hoverWidget.onMouseLeave (this, e);\r
- }\r
- }\r
- }\r
- }\r
-\r
- //top level graphic obj's parsing\r
- for (int i = 0; i < GraphicObjects.Count; i++) {\r
- GraphicObject g = GraphicObjects[i];\r
- if (g.MouseIsIn (e.Position)) {\r
- g.checkHoverWidget (e);\r
- PutOnTop (g);\r
- return;\r
- }\r
- }\r
- _hoverWidget = null;\r
- MouseMove.Raise (this, e);\r
- }\r
- void Mouse_ButtonUp(object sender, MouseButtonEventArgs e)\r
- {\r
- if (_activeWidget == null) {\r
- MouseButtonUp.Raise (this, e);\r
- return;\r
- }\r
-\r
- _activeWidget.onMouseUp (this, e);\r
- _activeWidget = null;\r
- }\r
- void Mouse_ButtonDown(object sender, MouseButtonEventArgs e)\r
- {\r
- if (_hoverWidget == null) {\r
- MouseButtonDown.Raise (this, e);\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
-\r
- _activeWidget = g;\r
- _activeWidget.onMouseDown (this, e);\r
- }\r
-\r
- void Mouse_WheelChanged(object sender, MouseWheelEventArgs e)\r
- {\r
- if (_hoverWidget == null) {\r
- MouseWheelChanged.Raise (this, e);\r
- return;\r
- }\r
- _hoverWidget.onMouseWheel (this, e);\r
- } \r
- #endregion\r
-\r
- #region keyboard Handling\r
- void Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)\r
- { \r
- if (_focusedWidget == null)\r
- return;\r
- _focusedWidget.onKeyDown (sender, e);\r
- }\r
- #endregion\r
-\r
- #region ILayoutable implementation\r
-\r
- public void RegisterForLayouting (int layoutType) { throw new NotImplementedException (); }\r
- public void UpdateLayout (LayoutingType layoutType) { throw new NotImplementedException (); }\r
- public Rectangle ContextCoordinates (Rectangle r)\r
- {\r
- return r;\r
- }\r
- public Rectangle ScreenCoordinates (Rectangle r)\r
- {\r
- return r;\r
- }\r
-\r
- public ILayoutable Parent {\r
- get {\r
- return null;\r
- }\r
- set {\r
- throw new NotImplementedException ();\r
- }\r
- }\r
- Rectangle ILayoutable.ClientRectangle {\r
- get { return new Size(this.ClientRectangle.Size.Width,this.ClientRectangle.Size.Height); }\r
- }\r
- public IGOLibHost HostContainer {\r
- get { return this; }\r
- }\r
-\r
- public Rectangle getSlot ()\r
- {\r
- return ClientRectangle;\r
- }\r
- public Rectangle getBounds ()//redundant but fill ILayoutable implementation\r
- {\r
- return ClientRectangle;\r
- } \r
- #endregion \r
- }\r
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+//using GGL;
+using System.Threading;
+using System.Collections.Generic;
+using System.Linq;
+using Cairo;
+
+
+namespace Crow
+{
+ class NUnitCrowWindow : IValueChange, ILayoutable, IGOLibHost
+ {
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ public virtual void NotifyValueChanged(string MemberName, object _value)
+ {
+ ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+ }
+ #endregion
+
+ public Rectangle ClientRectangle = new Rectangle(0,0,800,600);
+ public List<GraphicObject> GraphicObjects = new List<GraphicObject>();
+ public Color Background = Color.Transparent;
+
+ Rectangles _redrawClip = new Rectangles();//should find another way to access it from child
+ List<GraphicObject> _gobjsToRedraw = new List<GraphicObject>();
+
+ #region IGOLibHost implementation
+ public Rectangles redrawClip {
+ get {
+ return _redrawClip;
+ }
+ set {
+ _redrawClip = value;
+ }
+ }
+
+ public List<GraphicObject> gobjsToRedraw {
+ get {
+ return _gobjsToRedraw;
+ }
+ set {
+ _gobjsToRedraw = value;
+ }
+ }
+ public void AddWidget(GraphicObject g)
+ {
+ g.Parent = this;
+ GraphicObjects.Insert (0, g);
+
+ g.RegisterForLayouting ((int)LayoutingType.Sizing);
+ }
+ public void DeleteWidget(GraphicObject g)
+ {
+ g.Visible = false;//trick to ensure clip is added to refresh zone
+ g.ClearBinding();
+ GraphicObjects.Remove (g);
+ }
+ public void PutOnTop(GraphicObject g)
+ {
+ if (GraphicObjects.IndexOf(g) > 0)
+ {
+ GraphicObjects.Remove(g);
+ GraphicObjects.Insert(0, g);
+ g.registerClipRect ();
+ }
+ }
+ public void Quit ()
+ {
+ }
+
+ #region focus
+ GraphicObject _activeWidget; //button is pressed on widget
+ GraphicObject _hoverWidget; //mouse is over
+ GraphicObject _focusedWidget; //has keyboard (or other perif) focus
+
+ public GraphicObject activeWidget
+ {
+ get { return _activeWidget; }
+ set
+ {
+ if (_activeWidget == value)
+ return;
+ _activeWidget = value;
+ }
+ }
+ public GraphicObject hoverWidget
+ {
+ get { return _hoverWidget; }
+ set { _hoverWidget = value; }
+ }
+ public GraphicObject FocusedWidget {
+ get { return _focusedWidget; }
+ set {
+ if (_focusedWidget == value)
+ return;
+ if (_focusedWidget != null)
+ _focusedWidget.onUnfocused (this, null);
+ _focusedWidget = value;
+ if (_focusedWidget != null)
+ _focusedWidget.onFocused (this, null);
+ }
+ }
+ #endregion
+
+ #endregion
+
+ #region Events
+ //those events are raised only if mouse isn't in a graphic object
+ public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;
+ public event EventHandler<MouseButtonEventArgs> MouseButtonUp;
+ public event EventHandler<MouseButtonEventArgs> MouseButtonDown;
+ public event EventHandler<MouseButtonEventArgs> MouseClick;
+ public event EventHandler<MouseMoveEventArgs> MouseMove;
+ #endregion
+
+ #region graphic contexte
+ Context ctx;
+ public Surface surf;
+ string testId;
+ #endregion
+
+ #region update
+ public Stopwatch updateTime = new Stopwatch ();
+ public Stopwatch layoutTime = new Stopwatch ();
+ public Stopwatch guTime = new Stopwatch ();
+ public Stopwatch drawingTime = new Stopwatch ();
+
+ public void Update ()
+ {
+ guTime.Reset ();
+ updateTime.Restart ();
+ layoutTime.Restart ();
+
+ ctx = new Context(surf);
+
+ GraphicObject[] invGOList = new GraphicObject[GraphicObjects.Count];
+ GraphicObjects.CopyTo (invGOList,0);
+ invGOList = invGOList.Reverse ().ToArray ();
+
+ //Debug.WriteLine ("======= Layouting queue start =======");
+ lock (Interface.LayoutingQueue) {
+ while (Interface.LayoutingQueue.Count > 0) {
+ // Stopwatch lqiProcTime = new Stopwatch ();
+ // lqiProcTime.Start ();
+ LayoutingQueueItem lqi = Interface.LayoutingQueue.Dequeue ();
+ lqi.ProcessLayouting ();
+ // lqiProcTime.Stop ();
+ // if (lqiProcTime.ElapsedMilliseconds > 10) {
+ // Debug.WriteLine("lqi {2}: {0} ticks \t, {1} ms",
+ // updateTime.ElapsedTicks,
+ // updateTime.ElapsedMilliseconds, lqi.ToString());
+ // }
+ }
+ }
+
+ //final redraw clips should be added only when layout is completed among parents,
+ //that's why it take place in a second pass
+ GraphicObject[] gotr = new GraphicObject[gobjsToRedraw.Count];
+ gobjsToRedraw.CopyTo (gotr);
+ gobjsToRedraw.Clear ();
+ foreach (GraphicObject p in gotr) {
+ p.registerClipRect ();
+ }
+
+ layoutTime.Stop ();
+ guTime.Start ();
+
+ lock (redrawClip) {
+ if (redrawClip.count > 0) {
+ // #if DEBUG_CLIP_RECTANGLE
+ // redrawClip.stroke (ctx, new Color(1.0,0,0,0.3));
+ // #endif
+ redrawClip.clearAndClip (ctx);//rajouté après, tester si utile
+
+ //Link.draw (ctx);
+ foreach (GraphicObject p in invGOList) {
+ if (p.Visible) {
+ drawingTime.Start ();
+
+ ctx.Save ();
+ if (redrawClip.count > 0) {
+ Rectangles clip = redrawClip.intersectingRects (p.Slot);
+
+ if (clip.count > 0)
+ p.Paint (ref ctx, clip);
+ }
+ ctx.Restore ();
+
+ drawingTime.Stop ();
+ }
+ }
+ ctx.ResetClip ();
+ // #if DEBUG_CLIP_RECTANGLE
+ // redrawClip.stroke (ctx, Color.Red.AdjustAlpha(0.1));
+ // #endif
+ redrawClip.Reset ();
+ }
+ }
+ guTime.Stop ();
+ updateTime.Stop ();
+ ctx.Dispose ();
+ Console.WriteLine("{3} => layout:{0,8} t\tdraw:{1,8} t\tupdate:{2,8} t",
+ layoutTime.ElapsedTicks,
+ guTime.ElapsedTicks,
+ updateTime.ElapsedTicks,
+ testId);
+// Console.WriteLine("{3} => layout:{0}ms\tdraw{1}ms\tupdate:{2}ms",
+// layoutTime.ElapsedMilliseconds,
+// guTime.ElapsedMilliseconds,
+// updateTime.ElapsedMilliseconds,
+// testId);
+ surf.WriteToPng (@"ExpectedOutputs/" + testId + ".png");
+ surf.WriteToPng (@"tmp.png");
+ }
+ #endregion
+
+ #region loading
+ public GraphicObject LoadTest (string id)
+ {
+ testId = id;
+ GraphicObject tmp = Interface.Load ("Interfaces/" + testId + ".crow", this);
+ AddWidget (tmp);
+ return tmp;
+ }
+ /// <summary> Remove all Graphic objects from top container </summary>
+ public void ClearInterface()
+ {
+ int i = 0;
+ while (GraphicObjects.Count>0) {
+ GraphicObject g = GraphicObjects [i];
+ g.Visible = false;
+ g.ClearBinding ();
+ GraphicObjects.RemoveAt (0);
+ }
+ }
+ #endregion
+
+ public NUnitCrowWindow (int width, int height)
+ {
+ ClientRectangle.Width = width;
+ ClientRectangle.Height = height;
+
+ surf = new ImageSurface(Format.Argb32, ClientRectangle.Width, ClientRectangle.Height);
+ }
+
+ int frameCpt = 0;
+ int idx = 0;
+
+
+ #region FPS
+ int _fps = 0;
+
+ public int fps {
+ get { return _fps; }
+ set {
+ if (_fps == value)
+ return;
+
+ _fps = value;
+
+ if (_fps > fpsMax) {
+ fpsMax = _fps;
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMax", fpsMax));
+ } else if (_fps < fpsMin) {
+ fpsMin = _fps;
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fpsMin", fpsMin));
+ }
+
+ ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));
+ ValueChanged.Raise (this, new ValueChangeEventArgs ("update",
+ this.updateTime.ElapsedMilliseconds.ToString () + " ms"));
+ }
+ }
+
+ public int fpsMin = int.MaxValue;
+ public int fpsMax = 0;
+
+ void resetFps ()
+ {
+ fpsMin = int.MaxValue;
+ fpsMax = 0;
+ _fps = 0;
+ }
+ //public string update = "";
+ #endregion
+
+
+ #region Mouse Handling
+ void Mouse_Move(object sender, MouseMoveEventArgs e)
+ {
+ if (_activeWidget != null) {
+ //first, ensure object is still in the graphic tree
+ if (_activeWidget.HostContainer == null) {
+ activeWidget = null;
+ } else {
+
+ //send move evt even if mouse move outside bounds
+ _activeWidget.onMouseMove (_activeWidget, e);
+ return;
+ }
+ }
+
+ if (_hoverWidget != null) {
+ //first, ensure object is still in the graphic tree
+ if (_hoverWidget.HostContainer == null) {
+ hoverWidget = null;
+ } else {
+ //check topmost graphicobject first
+ GraphicObject tmp = _hoverWidget;
+ GraphicObject topc = null;
+ while (tmp is GraphicObject) {
+ topc = tmp;
+ tmp = tmp.Parent as GraphicObject;
+ }
+ int idxhw = GraphicObjects.IndexOf (topc);
+ if (idxhw != 0) {
+ int i = 0;
+ while (i < idxhw) {
+ if (GraphicObjects [i].MouseIsIn (e.Position)) {
+ _hoverWidget.onMouseLeave (this, e);
+ GraphicObjects [i].checkHoverWidget (e);
+ return;
+ }
+ i++;
+ }
+ }
+
+
+ if (_hoverWidget.MouseIsIn (e.Position)) {
+ _hoverWidget.checkHoverWidget (e);
+ return;
+ } else {
+ _hoverWidget.onMouseLeave (this, e);
+ //seek upward from last focused graph obj's
+ while (_hoverWidget.Parent as GraphicObject != null) {
+ _hoverWidget = _hoverWidget.Parent as GraphicObject;
+ if (_hoverWidget.MouseIsIn (e.Position)) {
+ _hoverWidget.checkHoverWidget (e);
+ return;
+ } else
+ _hoverWidget.onMouseLeave (this, e);
+ }
+ }
+ }
+ }
+
+ //top level graphic obj's parsing
+ for (int i = 0; i < GraphicObjects.Count; i++) {
+ GraphicObject g = GraphicObjects[i];
+ if (g.MouseIsIn (e.Position)) {
+ g.checkHoverWidget (e);
+ PutOnTop (g);
+ return;
+ }
+ }
+ _hoverWidget = null;
+ MouseMove.Raise (this, e);
+ }
+ void Mouse_ButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ if (_activeWidget == null) {
+ MouseButtonUp.Raise (this, e);
+ return;
+ }
+
+ _activeWidget.onMouseUp (this, e);
+ _activeWidget = null;
+ }
+ void Mouse_ButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (_hoverWidget == null) {
+ MouseButtonDown.Raise (this, e);
+ return;
+ }
+
+ GraphicObject g = _hoverWidget;
+ while (!g.Focusable) {
+ g = g.Parent as GraphicObject;
+ if (g == null) {
+ return;
+ }
+ }
+
+ _activeWidget = g;
+ _activeWidget.onMouseDown (this, e);
+ }
+
+ void Mouse_WheelChanged(object sender, MouseWheelEventArgs e)
+ {
+ if (_hoverWidget == null) {
+ MouseWheelChanged.Raise (this, e);
+ return;
+ }
+ _hoverWidget.onMouseWheel (this, e);
+ }
+ #endregion
+
+ #region keyboard Handling
+ void Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)
+ {
+ if (_focusedWidget == null)
+ return;
+ _focusedWidget.onKeyDown (sender, e);
+ }
+ #endregion
+
+ #region ILayoutable implementation
+
+ public void RegisterForLayouting (int layoutType) { throw new NotImplementedException (); }
+ public void UpdateLayout (LayoutingType layoutType) { throw new NotImplementedException (); }
+ public Rectangle ContextCoordinates (Rectangle r)
+ {
+ return r;
+ }
+ public Rectangle ScreenCoordinates (Rectangle r)
+ {
+ return r;
+ }
+
+ public ILayoutable Parent {
+ get {
+ return null;
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+ Rectangle ILayoutable.ClientRectangle {
+ get { return new Size(this.ClientRectangle.Size.Width,this.ClientRectangle.Size.Height); }
+ }
+ public IGOLibHost HostContainer {
+ get { return this; }
+ }
+
+ public Rectangle getSlot ()
+ {
+ return ClientRectangle;
+ }
+ public Rectangle getBounds ()//redundant but fill ILayoutable implementation
+ {
+ return ClientRectangle;
+ }
+ #endregion
+ }
}
\ No newline at end of file
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace Crow\r
-{\r
- public static class CairoHelpers\r
- {\r
- public static T Clamp<T>(this T val, T min, T max) where T : IComparable<T>\r
- {\r
- if (val.CompareTo(min) < 0) return min;\r
- else if(val.CompareTo(max) > 0) return max;\r
- else return val;\r
- }\r
- /// <summary>\r
- /// Convert string to utf8 (extension method)\r
- /// </summary>\r
- /// <returns>byte array with utf8 encoding</returns>\r
- public static byte[] ToUtf8(this String str)\r
- {\r
- return System.Text.UTF8Encoding.UTF8.GetBytes (str);\r
- }\r
-\r
- public static double min(params double[] arr)\r
- {\r
- int minp = 0;\r
- for (int i = 1; i < arr.Length; i++)\r
- if (arr[i] < arr[minp])\r
- minp = i;\r
-\r
- return arr[minp];\r
- }\r
- public static void CairoRectangle(Cairo.Context gr, Rectangle r, double radius)\r
- {\r
- if (radius>0)\r
- CairoHelpers.DrawRoundedRectangle(gr,r,radius);\r
- else\r
- gr.Rectangle (r);\r
- }\r
- public static void CairoCircle(Cairo.Context gr, Rectangle r)\r
- {\r
- gr.Arc(r.X + r.Width/2, r.Y + r.Height/2, Math.Min(r.Width,r.Height)/2, 0, 2*Math.PI);\r
- }\r
- public static void DrawRoundedRectangle(Cairo.Context gr, Rectangle r, double radius)\r
- {\r
- DrawRoundedRectangle(gr, r.X, r.Y, r.Width, r.Height, radius);\r
- }\r
- public static void DrawCurvedRectangle(Cairo.Context gr, Rectangle r)\r
- {\r
- DrawCurvedRectangle(gr, r.X, r.Y, r.Width, r.Height);\r
- }\r
- public static void DrawRoundedRectangle(Cairo.Context gr, double x, double y, double width, double height, double radius)\r
- {\r
- gr.Save();\r
-\r
- if ((radius > height / 2) || (radius > width / 2))\r
- radius = min(height / 2, width / 2);\r
-\r
- gr.MoveTo(x, y + radius);\r
- gr.Arc(x + radius, y + radius, radius, Math.PI, -Math.PI / 2);\r
- gr.LineTo(x + width - radius, y);\r
- gr.Arc(x + width - radius, y + radius, radius, -Math.PI / 2, 0);\r
- gr.LineTo(x + width, y + height - radius);\r
- gr.Arc(x + width - radius, y + height - radius, radius, 0, Math.PI / 2);\r
- gr.LineTo(x + radius, y + height);\r
- gr.Arc(x + radius, y + height - radius, radius, Math.PI / 2, Math.PI);\r
- gr.ClosePath();\r
- gr.Restore();\r
- }\r
- public static void DrawCurvedRectangle(Cairo.Context gr, double x, double y, double width, double height)\r
- {\r
- gr.Save();\r
- gr.MoveTo(x, y + height / 2);\r
- gr.CurveTo(x, y, x, y, x + width / 2, y);\r
- gr.CurveTo(x + width, y, x + width, y, x + width, y + height / 2);\r
- gr.CurveTo(x + width, y + height, x + width, y + height, x + width / 2, y + height);\r
- gr.CurveTo(x, y + height, x, y + height, x, y + height / 2);\r
- gr.Restore();\r
- }\r
- public static void StrokeRaisedRectangle(Cairo.Context gr, Rectangle r, double width = 1)\r
- {\r
- gr.Save();\r
- r.Inflate((int)-width / 2, (int)-width / 2);\r
- gr.LineWidth = width;\r
- gr.SetSourceColor(Color.White);\r
- gr.MoveTo(r.BottomLeft);\r
- gr.LineTo(r.TopLeft);\r
- gr.LineTo(r.TopRight);\r
- gr.Stroke();\r
-\r
- gr.SetSourceColor(Color.DarkGray);\r
- gr.MoveTo(r.TopRight);\r
- gr.LineTo(r.BottomRight);\r
- gr.LineTo(r.BottomLeft);\r
- gr.Stroke();\r
-\r
- gr.Restore();\r
- }\r
- public static void StrokeLoweredRectangle(Cairo.Context gr, Rectangle r, double width = 1)\r
- {\r
- gr.Save();\r
- r.Inflate((int)-width / 2, (int)-width / 2);\r
- gr.LineWidth = width;\r
- gr.SetSourceColor(Color.DarkGray);\r
- gr.MoveTo(r.BottomLeft);\r
- gr.LineTo(r.TopLeft);\r
- gr.LineTo(r.TopRight);\r
- gr.Stroke();\r
- gr.SetSourceColor(Color.White);\r
- gr.MoveTo(r.TopRight);\r
- gr.LineTo(r.BottomRight);\r
- gr.LineTo(r.BottomLeft);\r
- gr.Stroke();\r
-\r
- gr.Restore();\r
- }\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Crow
+{
+ public static class CairoHelpers
+ {
+ public static T Clamp<T>(this T val, T min, T max) where T : IComparable<T>
+ {
+ if (val.CompareTo(min) < 0) return min;
+ else if(val.CompareTo(max) > 0) return max;
+ else return val;
+ }
+ /// <summary>
+ /// Convert string to utf8 (extension method)
+ /// </summary>
+ /// <returns>byte array with utf8 encoding</returns>
+ public static byte[] ToUtf8(this String str)
+ {
+ return System.Text.UTF8Encoding.UTF8.GetBytes (str);
+ }
+
+ public static double min(params double[] arr)
+ {
+ int minp = 0;
+ for (int i = 1; i < arr.Length; i++)
+ if (arr[i] < arr[minp])
+ minp = i;
+
+ return arr[minp];
+ }
+ public static void CairoRectangle(Cairo.Context gr, Rectangle r, double radius)
+ {
+ if (radius>0)
+ CairoHelpers.DrawRoundedRectangle(gr,r,radius);
+ else
+ gr.Rectangle (r);
+ }
+ public static void CairoCircle(Cairo.Context gr, Rectangle r)
+ {
+ gr.Arc(r.X + r.Width/2, r.Y + r.Height/2, Math.Min(r.Width,r.Height)/2, 0, 2*Math.PI);
+ }
+ public static void DrawRoundedRectangle(Cairo.Context gr, Rectangle r, double radius)
+ {
+ DrawRoundedRectangle(gr, r.X, r.Y, r.Width, r.Height, radius);
+ }
+ public static void DrawCurvedRectangle(Cairo.Context gr, Rectangle r)
+ {
+ DrawCurvedRectangle(gr, r.X, r.Y, r.Width, r.Height);
+ }
+ public static void DrawRoundedRectangle(Cairo.Context gr, double x, double y, double width, double height, double radius)
+ {
+ gr.Save();
+
+ if ((radius > height / 2) || (radius > width / 2))
+ radius = min(height / 2, width / 2);
+
+ gr.MoveTo(x, y + radius);
+ gr.Arc(x + radius, y + radius, radius, Math.PI, -Math.PI / 2);
+ gr.LineTo(x + width - radius, y);
+ gr.Arc(x + width - radius, y + radius, radius, -Math.PI / 2, 0);
+ gr.LineTo(x + width, y + height - radius);
+ gr.Arc(x + width - radius, y + height - radius, radius, 0, Math.PI / 2);
+ gr.LineTo(x + radius, y + height);
+ gr.Arc(x + radius, y + height - radius, radius, Math.PI / 2, Math.PI);
+ gr.ClosePath();
+ gr.Restore();
+ }
+ public static void DrawCurvedRectangle(Cairo.Context gr, double x, double y, double width, double height)
+ {
+ gr.Save();
+ gr.MoveTo(x, y + height / 2);
+ gr.CurveTo(x, y, x, y, x + width / 2, y);
+ gr.CurveTo(x + width, y, x + width, y, x + width, y + height / 2);
+ gr.CurveTo(x + width, y + height, x + width, y + height, x + width / 2, y + height);
+ gr.CurveTo(x, y + height, x, y + height, x, y + height / 2);
+ gr.Restore();
+ }
+ public static void StrokeRaisedRectangle(Cairo.Context gr, Rectangle r, double width = 1)
+ {
+ gr.Save();
+ r.Inflate((int)-width / 2, (int)-width / 2);
+ gr.LineWidth = width;
+ gr.SetSourceColor(Color.White);
+ gr.MoveTo(r.BottomLeft);
+ gr.LineTo(r.TopLeft);
+ gr.LineTo(r.TopRight);
+ gr.Stroke();
+
+ gr.SetSourceColor(Color.DarkGray);
+ gr.MoveTo(r.TopRight);
+ gr.LineTo(r.BottomRight);
+ gr.LineTo(r.BottomLeft);
+ gr.Stroke();
+
+ gr.Restore();
+ }
+ public static void StrokeLoweredRectangle(Cairo.Context gr, Rectangle r, double width = 1)
+ {
+ gr.Save();
+ r.Inflate((int)-width / 2, (int)-width / 2);
+ gr.LineWidth = width;
+ gr.SetSourceColor(Color.DarkGray);
+ gr.MoveTo(r.BottomLeft);
+ gr.LineTo(r.TopLeft);
+ gr.LineTo(r.TopRight);
+ gr.Stroke();
+ gr.SetSourceColor(Color.White);
+ gr.MoveTo(r.TopRight);
+ gr.LineTo(r.BottomRight);
+ gr.LineTo(r.BottomLeft);
+ gr.Stroke();
+
+ gr.Restore();
+ }
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Xml.Serialization;\r
-using System.Reflection;\r
-using System.Diagnostics;\r
-\r
-\r
-\r
-namespace Crow\r
-{\r
- public struct Color : ICairoFill\r
- {\r
- #region CTOR\r
- public Color(double _R, double _G, double _B, double _A)\r
- {\r
- A = _A.Clamp(0,1);\r
- R = _R.Clamp(0,1);\r
- G = _G.Clamp(0,1);\r
- B = _B.Clamp(0,1);\r
- Name = "";\r
- }\r
- internal Color(double _R, double _G, double _B, double _A, string _name)\r
- {\r
- A = _A;\r
- R = _R;\r
- G = _G;\r
- B = _B;\r
- Name = _name;\r
- ColorDic.Add(this);\r
- } \r
- #endregion\r
-\r
- public static List<Color> ColorDic = new List<Color>();\r
-\r
- internal string Name; \r
-\r
- #region public fields\r
- public double A;\r
- public double R;\r
- public double G;\r
- public double B; \r
- #endregion\r
-\r
- #region Operators\r
- public static implicit operator string(Color c)\r
- {\r
- return c.ToString();\r
- }\r
- public static implicit operator Color(string s)\r
- {\r
- if (string.IsNullOrEmpty(s))\r
- return White;\r
-\r
- string[] c = s.Split(new char[] { ';' });\r
-\r
- if (c.Length == 1)\r
- {\r
- foreach (Color cr in ColorDic)\r
- {\r
- if (cr.Name == s)\r
- return cr;\r
- }\r
- }\r
-\r
- return new Color(\r
- double.Parse(c[0]),\r
- double.Parse(c[1]),\r
- double.Parse(c[2]),\r
- double.Parse(c[3])); \r
- }\r
-\r
- public static implicit operator OpenTK.Vector4(Color c)\r
- {\r
- return new OpenTK.Vector4 ((float)c.R, (float)c.G, (float)c.B, (float)c.A);\r
- }\r
- public static implicit operator Color(OpenTK.Vector4 v)\r
- {\r
- return new Color (v.X, v.Y, v.Z, v.W);\r
- }\r
-\r
- public static implicit operator System.Drawing.Color(Color c)\r
- {\r
- return System.Drawing.Color.FromArgb((int)(c.A * 255), (int)(c.R * 255), (int)(c.G * 255), (int)(c.B * 255));\r
- }\r
- public static implicit operator Color(System.Drawing.Color c)\r
- {\r
- return new Color (1.0f / c.R, 1.0f / c.G, 1.0f / c.B, 1.0f / c.A);\r
- }\r
- public static implicit operator Cairo.Color(Color c)\r
- {\r
- return new Cairo.Color(c.R, c.G, c.B, c.A);\r
- }\r
-\r
- public static bool operator ==(Color left, Color right)\r
- {\r
- return left.A == right.A &&\r
- left.R == right.R &&\r
- left.G == right.G &&\r
- left.B == right.B ? true : false;\r
- }\r
- public static bool operator !=(Color left, Color right)\r
- {\r
- return left.A == right.A &&\r
- left.R == right.R &&\r
- left.G == right.G &&\r
- left.B == right.B ? false : true;\r
-\r
- }\r
- public static bool operator ==(Color c, string n)\r
- {\r
- return c.Name == n ? true : false;\r
- }\r
- public static bool operator !=(Color c, string n)\r
- {\r
- return c.Name == n ? false : true;\r
- }\r
- public static bool operator ==(string n, Color c)\r
- {\r
- return c.Name == n ? true : false;\r
- }\r
- public static bool operator !=(string n, Color c)\r
- {\r
- return c.Name == n ? false : true;\r
- }\r
- public static Color operator *(Color c, Double f)\r
- {\r
- return new Color(c.R,c.G,c.B,c.A * f);\r
- }\r
- public static Color operator +(Color c1, Color c2)\r
- {\r
- return new Color(c1.R + c2.R,c1.G + c2.G,c1.B + c2.B,c1.A + c2.A);\r
- }\r
- public static Color operator -(Color c1, Color c2)\r
- {\r
- return new Color(c1.R - c2.R,c1.G - c2.G,c1.B - c2.B,c1.A - c2.A);\r
- }\r
- #endregion\r
-\r
-\r
- public float[] floatArray\r
- {\r
- get { return new float[]{ (float)R, (float)G, (float)B, (float)A }; }\r
- }\r
- public Color AdjustAlpha(double _A)\r
- {\r
- return new Color (this.R, this.G, this.B, _A);\r
- }\r
-\r
- #region IFill implementation\r
-\r
- public void SetAsSource (Cairo.Context ctx)\r
- {\r
- ctx.SetSourceRGBA (R, G, B, A);\r
- }\r
-\r
- #endregion\r
-\r
- #region Predefined colors\r
- public static readonly Color Transparent = new Color(0, 0, 0, 0, "Transparent");\r
- public static readonly Color Clear = new Color(-1, -1, -1, -1, "Clear");\r
- public static readonly Color Green = new Color(0, 1.0, 0, 1.0, "Green");\r
- public static readonly Color AirForceBlueRaf = new Color(0.364705882352941,0.541176470588235,0.658823529411765,1.0,"AirForceBlueRaf");\r
- public static readonly Color AirForceBlueUsaf = new Color(0,0.188235294117647,0.56078431372549,1.0,"AirForceBlueUsaf");\r
- public static readonly Color AirSuperiorityBlue = new Color(0.447058823529412,0.627450980392157,0.756862745098039,1.0,"AirSuperiorityBlue");\r
- public static readonly Color AlabamaCrimson = new Color(0.63921568627451,0.149019607843137,0.219607843137255,1.0,"AlabamaCrimson");\r
- public static readonly Color AliceBlue = new Color(0.941176470588235,0.972549019607843,1,1.0,"AliceBlue");\r
- public static readonly Color AlizarinCrimson = new Color(0.890196078431373,0.149019607843137,0.211764705882353,1.0,"AlizarinCrimson");\r
- public static readonly Color AlloyOrange = new Color(0.768627450980392,0.384313725490196,0.0627450980392157,1.0,"AlloyOrange");\r
- public static readonly Color Almond = new Color(0.937254901960784,0.870588235294118,0.803921568627451,1.0,"Almond");\r
- public static readonly Color Amaranth = new Color(0.898039215686275,0.168627450980392,0.313725490196078,1.0,"Amaranth");\r
- public static readonly Color Amber = new Color(1,0.749019607843137,0,1.0,"Amber");\r
- public static readonly Color AmberSaeEce = new Color(1,0.494117647058824,0,1.0,"AmberSaeEce");\r
- public static readonly Color AmericanRose = new Color(1,0.0117647058823529,0.243137254901961,1.0,"AmericanRose");\r
- public static readonly Color Amethyst = new Color(0.6,0.4,0.8,1.0,"Amethyst");\r
- public static readonly Color AndroidGreen = new Color(0.643137254901961,0.776470588235294,0.223529411764706,1.0,"AndroidGreen");\r
- public static readonly Color AntiFlashWhite = new Color(0.949019607843137,0.952941176470588,0.956862745098039,1.0,"AntiFlashWhite");\r
- public static readonly Color AntiqueBrass = new Color(0.803921568627451,0.584313725490196,0.458823529411765,1.0,"AntiqueBrass");\r
- public static readonly Color AntiqueFuchsia = new Color(0.568627450980392,0.36078431372549,0.513725490196078,1.0,"AntiqueFuchsia");\r
- public static readonly Color AntiqueRuby = new Color(0.517647058823529,0.105882352941176,0.176470588235294,1.0,"AntiqueRuby");\r
- public static readonly Color AntiqueWhite = new Color(0.980392156862745,0.92156862745098,0.843137254901961,1.0,"AntiqueWhite");\r
- public static readonly Color AoEnglish = new Color(0,0.501960784313725,0,1.0,"AoEnglish");\r
- public static readonly Color AppleGreen = new Color(0.552941176470588,0.713725490196078,0,1.0,"AppleGreen");\r
- public static readonly Color Apricot = new Color(0.984313725490196,0.807843137254902,0.694117647058824,1.0,"Apricot");\r
- public static readonly Color Aqua = new Color(0,1,1,1.0,"Aqua");\r
- public static readonly Color Aquamarine = new Color(0.498039215686275,1,0.831372549019608,1.0,"Aquamarine");\r
- public static readonly Color ArmyGreen = new Color(0.294117647058824,0.325490196078431,0.125490196078431,1.0,"ArmyGreen");\r
- public static readonly Color Arsenic = new Color(0.231372549019608,0.266666666666667,0.294117647058824,1.0,"Arsenic");\r
- public static readonly Color ArylideYellow = new Color(0.913725490196078,0.83921568627451,0.419607843137255,1.0,"ArylideYellow");\r
- public static readonly Color AshGrey = new Color(0.698039215686274,0.745098039215686,0.709803921568627,1.0,"AshGrey");\r
- public static readonly Color Asparagus = new Color(0.529411764705882,0.662745098039216,0.419607843137255,1.0,"Asparagus");\r
- public static readonly Color AtomicTangerine = new Color(1,0.6,0.4,1.0,"AtomicTangerine");\r
- public static readonly Color Auburn = new Color(0.647058823529412,0.164705882352941,0.164705882352941,1.0,"Auburn");\r
- public static readonly Color Aureolin = new Color(0.992156862745098,0.933333333333333,0,1.0,"Aureolin");\r
- public static readonly Color Aurometalsaurus = new Color(0.431372549019608,0.498039215686275,0.501960784313725,1.0,"Aurometalsaurus");\r
- public static readonly Color Avocado = new Color(0.337254901960784,0.509803921568627,0.0117647058823529,1.0,"Avocado");\r
- public static readonly Color Azure = new Color(0,0.498039215686275,1,1.0,"Azure");\r
- public static readonly Color AzureMistWeb = new Color(0.941176470588235,1,1,1.0,"AzureMistWeb");\r
- public static readonly Color BabyBlue = new Color(0.537254901960784,0.811764705882353,0.941176470588235,1.0,"BabyBlue");\r
- public static readonly Color BabyBlueEyes = new Color(0.631372549019608,0.792156862745098,0.945098039215686,1.0,"BabyBlueEyes");\r
- public static readonly Color BabyPink = new Color(0.956862745098039,0.76078431372549,0.76078431372549,1.0,"BabyPink");\r
- public static readonly Color BallBlue = new Color(0.129411764705882,0.670588235294118,0.803921568627451,1.0,"BallBlue");\r
- public static readonly Color BananaMania = new Color(0.980392156862745,0.905882352941176,0.709803921568627,1.0,"BananaMania");\r
- public static readonly Color BananaYellow = new Color(1,0.882352941176471,0.207843137254902,1.0,"BananaYellow");\r
- public static readonly Color BarnRed = new Color(0.486274509803922,0.0392156862745098,0.00784313725490196,1.0,"BarnRed");\r
- public static readonly Color BattleshipGrey = new Color(0.517647058823529,0.517647058823529,0.509803921568627,1.0,"BattleshipGrey");\r
- public static readonly Color Bazaar = new Color(0.596078431372549,0.466666666666667,0.482352941176471,1.0,"Bazaar");\r
- public static readonly Color BeauBlue = new Color(0.737254901960784,0.831372549019608,0.901960784313726,1.0,"BeauBlue");\r
- public static readonly Color Beaver = new Color(0.623529411764706,0.505882352941176,0.43921568627451,1.0,"Beaver");\r
- public static readonly Color Beige = new Color(0.96078431372549,0.96078431372549,0.862745098039216,1.0,"Beige");\r
- public static readonly Color BigDipORuby = new Color(0.611764705882353,0.145098039215686,0.258823529411765,1.0,"BigDipORuby");\r
- public static readonly Color Bisque = new Color(1,0.894117647058824,0.768627450980392,1.0,"Bisque");\r
- public static readonly Color Bistre = new Color(0.23921568627451,0.168627450980392,0.12156862745098,1.0,"Bistre");\r
- public static readonly Color Bittersweet = new Color(0.996078431372549,0.435294117647059,0.368627450980392,1.0,"Bittersweet");\r
- public static readonly Color BittersweetShimmer = new Color(0.749019607843137,0.309803921568627,0.317647058823529,1.0,"BittersweetShimmer");\r
- public static readonly Color Black = new Color(0,0,0,1.0,"Black");\r
- public static readonly Color BlackBean = new Color(0.23921568627451,0.0470588235294118,0.00784313725490196,1.0,"BlackBean");\r
- public static readonly Color BlackLeatherJacket = new Color(0.145098039215686,0.207843137254902,0.16078431372549,1.0,"BlackLeatherJacket");\r
- public static readonly Color BlackOlive = new Color(0.231372549019608,0.235294117647059,0.211764705882353,1.0,"BlackOlive");\r
- public static readonly Color BlanchedAlmond = new Color(1,0.92156862745098,0.803921568627451,1.0,"BlanchedAlmond");\r
- public static readonly Color BlastOffBronze = new Color(0.647058823529412,0.443137254901961,0.392156862745098,1.0,"BlastOffBronze");\r
- public static readonly Color BleuDeFrance = new Color(0.192156862745098,0.549019607843137,0.905882352941176,1.0,"BleuDeFrance");\r
- public static readonly Color BlizzardBlue = new Color(0.674509803921569,0.898039215686275,0.933333333333333,1.0,"BlizzardBlue");\r
- public static readonly Color Blond = new Color(0.980392156862745,0.941176470588235,0.745098039215686,1.0,"Blond");\r
- public static readonly Color Blue = new Color(0,0,1,1.0,"Blue");\r
- public static readonly Color BlueBell = new Color(0.635294117647059,0.635294117647059,0.815686274509804,1.0,"BlueBell");\r
- public static readonly Color BlueCrayola = new Color(0.12156862745098,0.458823529411765,0.996078431372549,1.0,"BlueCrayola");\r
- public static readonly Color BlueGray = new Color(0.4,0.6,0.8,1.0,"BlueGray");\r
- public static readonly Color BlueGreen = new Color(0.0509803921568627,0.596078431372549,0.729411764705882,1.0,"BlueGreen");\r
- public static readonly Color BlueMunsell = new Color(0,0.576470588235294,0.686274509803922,1.0,"BlueMunsell");\r
- public static readonly Color BlueNcs = new Color(0,0.529411764705882,0.741176470588235,1.0,"BlueNcs");\r
- public static readonly Color BluePigment = new Color(0.2,0.2,0.6,1.0,"BluePigment");\r
- public static readonly Color BlueRyb = new Color(0.00784313725490196,0.27843137254902,0.996078431372549,1.0,"BlueRyb");\r
- public static readonly Color BlueSapphire = new Color(0.0705882352941176,0.380392156862745,0.501960784313725,1.0,"BlueSapphire");\r
- public static readonly Color BlueViolet = new Color(0.541176470588235,0.168627450980392,0.886274509803922,1.0,"BlueViolet");\r
- public static readonly Color Blush = new Color(0.870588235294118,0.364705882352941,0.513725490196078,1.0,"Blush");\r
- public static readonly Color Bole = new Color(0.474509803921569,0.266666666666667,0.231372549019608,1.0,"Bole");\r
- public static readonly Color BondiBlue = new Color(0,0.584313725490196,0.713725490196078,1.0,"BondiBlue");\r
- public static readonly Color Bone = new Color(0.890196078431373,0.854901960784314,0.788235294117647,1.0,"Bone");\r
- public static readonly Color BostonUniversityRed = new Color(0.8,0,0,1.0,"BostonUniversityRed");\r
- public static readonly Color BottleGreen = new Color(0,0.415686274509804,0.305882352941176,1.0,"BottleGreen");\r
- public static readonly Color Boysenberry = new Color(0.529411764705882,0.196078431372549,0.376470588235294,1.0,"Boysenberry");\r
- public static readonly Color BrandeisBlue = new Color(0,0.43921568627451,1,1.0,"BrandeisBlue");\r
- public static readonly Color Brass = new Color(0.709803921568627,0.650980392156863,0.258823529411765,1.0,"Brass");\r
- public static readonly Color BrickRed = new Color(0.796078431372549,0.254901960784314,0.329411764705882,1.0,"BrickRed");\r
- public static readonly Color BrightCerulean = new Color(0.113725490196078,0.674509803921569,0.83921568627451,1.0,"BrightCerulean");\r
- public static readonly Color BrightGreen = new Color(0.4,1,0,1.0,"BrightGreen");\r
- public static readonly Color BrightLavender = new Color(0.749019607843137,0.580392156862745,0.894117647058824,1.0,"BrightLavender");\r
- public static readonly Color BrightMaroon = new Color(0.764705882352941,0.129411764705882,0.282352941176471,1.0,"BrightMaroon");\r
- public static readonly Color BrightPink = new Color(1,0,0.498039215686275,1.0,"BrightPink");\r
- public static readonly Color BrightTurquoise = new Color(0.0313725490196078,0.909803921568627,0.870588235294118,1.0,"BrightTurquoise");\r
- public static readonly Color BrightUbe = new Color(0.819607843137255,0.623529411764706,0.909803921568627,1.0,"BrightUbe");\r
- public static readonly Color BrilliantLavender = new Color(0.956862745098039,0.733333333333333,1,1.0,"BrilliantLavender");\r
- public static readonly Color BrilliantRose = new Color(1,0.333333333333333,0.63921568627451,1.0,"BrilliantRose");\r
- public static readonly Color BrinkPink = new Color(0.984313725490196,0.376470588235294,0.498039215686275,1.0,"BrinkPink");\r
- public static readonly Color BritishRacingGreen = new Color(0,0.258823529411765,0.145098039215686,1.0,"BritishRacingGreen");\r
- public static readonly Color Bronze = new Color(0.803921568627451,0.498039215686275,0.196078431372549,1.0,"Bronze");\r
- public static readonly Color BrownTraditional = new Color(0.588235294117647,0.294117647058824,0,1.0,"BrownTraditional");\r
- public static readonly Color BrownWeb = new Color(0.647058823529412,0.164705882352941,0.164705882352941,1.0,"BrownWeb");\r
- public static readonly Color BubbleGum = new Color(1,0.756862745098039,0.8,1.0,"BubbleGum");\r
- public static readonly Color Bubbles = new Color(0.905882352941176,0.996078431372549,1,1.0,"Bubbles");\r
- public static readonly Color Buff = new Color(0.941176470588235,0.862745098039216,0.509803921568627,1.0,"Buff");\r
- public static readonly Color BulgarianRose = new Color(0.282352941176471,0.0235294117647059,0.0274509803921569,1.0,"BulgarianRose");\r
- public static readonly Color Burgundy = new Color(0.501960784313725,0,0.125490196078431,1.0,"Burgundy");\r
- public static readonly Color Burlywood = new Color(0.870588235294118,0.72156862745098,0.529411764705882,1.0,"Burlywood");\r
- public static readonly Color BurntOrange = new Color(0.8,0.333333333333333,0,1.0,"BurntOrange");\r
- public static readonly Color BurntSienna = new Color(0.913725490196078,0.454901960784314,0.317647058823529,1.0,"BurntSienna");\r
- public static readonly Color BurntUmber = new Color(0.541176470588235,0.2,0.141176470588235,1.0,"BurntUmber");\r
- public static readonly Color Byzantine = new Color(0.741176470588235,0.2,0.643137254901961,1.0,"Byzantine");\r
- public static readonly Color Byzantium = new Color(0.43921568627451,0.16078431372549,0.388235294117647,1.0,"Byzantium");\r
- public static readonly Color Cadet = new Color(0.325490196078431,0.407843137254902,0.447058823529412,1.0,"Cadet");\r
- public static readonly Color CadetBlue = new Color(0.372549019607843,0.619607843137255,0.627450980392157,1.0,"CadetBlue");\r
- public static readonly Color CadetGrey = new Color(0.568627450980392,0.63921568627451,0.690196078431373,1.0,"CadetGrey");\r
- public static readonly Color CadmiumGreen = new Color(0,0.419607843137255,0.235294117647059,1.0,"CadmiumGreen");\r
- public static readonly Color CadmiumOrange = new Color(0.929411764705882,0.529411764705882,0.176470588235294,1.0,"CadmiumOrange");\r
- public static readonly Color CadmiumRed = new Color(0.890196078431373,0,0.133333333333333,1.0,"CadmiumRed");\r
- public static readonly Color CadmiumYellow = new Color(1,0.964705882352941,0,1.0,"CadmiumYellow");\r
- public static readonly Color CafAuLait = new Color(0.650980392156863,0.482352941176471,0.356862745098039,1.0,"CafAuLait");\r
- public static readonly Color CafNoir = new Color(0.294117647058824,0.211764705882353,0.129411764705882,1.0,"CafNoir");\r
- public static readonly Color CalPolyGreen = new Color(0.117647058823529,0.301960784313725,0.168627450980392,1.0,"CalPolyGreen");\r
- public static readonly Color CambridgeBlue = new Color(0.63921568627451,0.756862745098039,0.67843137254902,1.0,"CambridgeBlue");\r
- public static readonly Color Camel = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"Camel");\r
- public static readonly Color CameoPink = new Color(0.937254901960784,0.733333333333333,0.8,1.0,"CameoPink");\r
- public static readonly Color CamouflageGreen = new Color(0.470588235294118,0.525490196078431,0.419607843137255,1.0,"CamouflageGreen");\r
- public static readonly Color CanaryYellow = new Color(1,0.937254901960784,0,1.0,"CanaryYellow");\r
- public static readonly Color CandyAppleRed = new Color(1,0.0313725490196078,0,1.0,"CandyAppleRed");\r
- public static readonly Color CandyPink = new Color(0.894117647058824,0.443137254901961,0.47843137254902,1.0,"CandyPink");\r
- public static readonly Color Capri = new Color(0,0.749019607843137,1,1.0,"Capri");\r
- public static readonly Color CaputMortuum = new Color(0.349019607843137,0.152941176470588,0.125490196078431,1.0,"CaputMortuum");\r
- public static readonly Color Cardinal = new Color(0.768627450980392,0.117647058823529,0.227450980392157,1.0,"Cardinal");\r
- public static readonly Color CaribbeanGreen = new Color(0,0.8,0.6,1.0,"CaribbeanGreen");\r
- public static readonly Color Carmine = new Color(0.588235294117647,0,0.0941176470588235,1.0,"Carmine");\r
- public static readonly Color CarmineMP = new Color(0.843137254901961,0,0.250980392156863,1.0,"CarmineMP");\r
- public static readonly Color CarminePink = new Color(0.92156862745098,0.298039215686275,0.258823529411765,1.0,"CarminePink");\r
- public static readonly Color CarmineRed = new Color(1,0,0.219607843137255,1.0,"CarmineRed");\r
- public static readonly Color CarnationPink = new Color(1,0.650980392156863,0.788235294117647,1.0,"CarnationPink");\r
- public static readonly Color Carnelian = new Color(0.701960784313725,0.105882352941176,0.105882352941176,1.0,"Carnelian");\r
- public static readonly Color CarolinaBlue = new Color(0.6,0.729411764705882,0.866666666666667,1.0,"CarolinaBlue");\r
- public static readonly Color CarrotOrange = new Color(0.929411764705882,0.568627450980392,0.129411764705882,1.0,"CarrotOrange");\r
- public static readonly Color CatalinaBlue = new Color(0.0235294117647059,0.164705882352941,0.470588235294118,1.0,"CatalinaBlue");\r
- public static readonly Color Ceil = new Color(0.572549019607843,0.631372549019608,0.811764705882353,1.0,"Ceil");\r
- public static readonly Color Celadon = new Color(0.674509803921569,0.882352941176471,0.686274509803922,1.0,"Celadon");\r
- public static readonly Color CeladonBlue = new Color(0,0.482352941176471,0.654901960784314,1.0,"CeladonBlue");\r
- public static readonly Color CeladonGreen = new Color(0.184313725490196,0.517647058823529,0.486274509803922,1.0,"CeladonGreen");\r
- public static readonly Color CelesteColour = new Color(0.698039215686274,1,1,1.0,"CelesteColour");\r
- public static readonly Color CelestialBlue = new Color(0.286274509803922,0.592156862745098,0.815686274509804,1.0,"CelestialBlue");\r
- public static readonly Color Cerise = new Color(0.870588235294118,0.192156862745098,0.388235294117647,1.0,"Cerise");\r
- public static readonly Color CerisePink = new Color(0.925490196078431,0.231372549019608,0.513725490196078,1.0,"CerisePink");\r
- public static readonly Color Cerulean = new Color(0,0.482352941176471,0.654901960784314,1.0,"Cerulean");\r
- public static readonly Color CeruleanBlue = new Color(0.164705882352941,0.32156862745098,0.745098039215686,1.0,"CeruleanBlue");\r
- public static readonly Color CeruleanFrost = new Color(0.427450980392157,0.607843137254902,0.764705882352941,1.0,"CeruleanFrost");\r
- public static readonly Color CgBlue = new Color(0,0.47843137254902,0.647058823529412,1.0,"CgBlue");\r
- public static readonly Color CgRed = new Color(0.87843137254902,0.235294117647059,0.192156862745098,1.0,"CgRed");\r
- public static readonly Color Chamoisee = new Color(0.627450980392157,0.470588235294118,0.352941176470588,1.0,"Chamoisee");\r
- public static readonly Color Champagne = new Color(0.980392156862745,0.83921568627451,0.647058823529412,1.0,"Champagne");\r
- public static readonly Color Charcoal = new Color(0.211764705882353,0.270588235294118,0.309803921568627,1.0,"Charcoal");\r
- public static readonly Color CharmPink = new Color(0.901960784313726,0.56078431372549,0.674509803921569,1.0,"CharmPink");\r
- public static readonly Color ChartreuseTraditional = new Color(0.874509803921569,1,0,1.0,"ChartreuseTraditional");\r
- public static readonly Color ChartreuseWeb = new Color(0.498039215686275,1,0,1.0,"ChartreuseWeb");\r
- public static readonly Color Cherry = new Color(0.870588235294118,0.192156862745098,0.388235294117647,1.0,"Cherry");\r
- public static readonly Color CherryBlossomPink = new Color(1,0.717647058823529,0.772549019607843,1.0,"CherryBlossomPink");\r
- public static readonly Color Chestnut = new Color(0.803921568627451,0.36078431372549,0.36078431372549,1.0,"Chestnut");\r
- public static readonly Color ChinaPink = new Color(0.870588235294118,0.435294117647059,0.631372549019608,1.0,"ChinaPink");\r
- public static readonly Color ChinaRose = new Color(0.658823529411765,0.317647058823529,0.431372549019608,1.0,"ChinaRose");\r
- public static readonly Color ChineseRed = new Color(0.666666666666667,0.219607843137255,0.117647058823529,1.0,"ChineseRed");\r
- public static readonly Color ChocolateTraditional = new Color(0.482352941176471,0.247058823529412,0,1.0,"ChocolateTraditional");\r
- public static readonly Color ChocolateWeb = new Color(0.823529411764706,0.411764705882353,0.117647058823529,1.0,"ChocolateWeb");\r
- public static readonly Color ChromeYellow = new Color(1,0.654901960784314,0,1.0,"ChromeYellow");\r
- public static readonly Color Cinereous = new Color(0.596078431372549,0.505882352941176,0.482352941176471,1.0,"Cinereous");\r
- public static readonly Color Cinnabar = new Color(0.890196078431373,0.258823529411765,0.203921568627451,1.0,"Cinnabar");\r
- public static readonly Color Cinnamon = new Color(0.823529411764706,0.411764705882353,0.117647058823529,1.0,"Cinnamon");\r
- public static readonly Color Citrine = new Color(0.894117647058824,0.815686274509804,0.0392156862745098,1.0,"Citrine");\r
- public static readonly Color ClassicRose = new Color(0.984313725490196,0.8,0.905882352941176,1.0,"ClassicRose");\r
- public static readonly Color Cobalt = new Color(0,0.27843137254902,0.670588235294118,1.0,"Cobalt");\r
- public static readonly Color CocoaBrown = new Color(0.823529411764706,0.411764705882353,0.117647058823529,1.0,"CocoaBrown");\r
- public static readonly Color Coffee = new Color(0.435294117647059,0.305882352941176,0.215686274509804,1.0,"Coffee");\r
- public static readonly Color ColumbiaBlue = new Color(0.607843137254902,0.866666666666667,1,1.0,"ColumbiaBlue");\r
- public static readonly Color CongoPink = new Color(0.972549019607843,0.513725490196078,0.474509803921569,1.0,"CongoPink");\r
- public static readonly Color CoolBlack = new Color(0,0.180392156862745,0.388235294117647,1.0,"CoolBlack");\r
- public static readonly Color CoolGrey = new Color(0.549019607843137,0.572549019607843,0.674509803921569,1.0,"CoolGrey");\r
- public static readonly Color Copper = new Color(0.72156862745098,0.450980392156863,0.2,1.0,"Copper");\r
- public static readonly Color CopperCrayola = new Color(0.854901960784314,0.541176470588235,0.403921568627451,1.0,"CopperCrayola");\r
- public static readonly Color CopperPenny = new Color(0.67843137254902,0.435294117647059,0.411764705882353,1.0,"CopperPenny");\r
- public static readonly Color CopperRed = new Color(0.796078431372549,0.427450980392157,0.317647058823529,1.0,"CopperRed");\r
- public static readonly Color CopperRose = new Color(0.6,0.4,0.4,1.0,"CopperRose");\r
- public static readonly Color Coquelicot = new Color(1,0.219607843137255,0,1.0,"Coquelicot");\r
- public static readonly Color Coral = new Color(1,0.498039215686275,0.313725490196078,1.0,"Coral");\r
- public static readonly Color CoralPink = new Color(0.972549019607843,0.513725490196078,0.474509803921569,1.0,"CoralPink");\r
- public static readonly Color CoralRed = new Color(1,0.250980392156863,0.250980392156863,1.0,"CoralRed");\r
- public static readonly Color Cordovan = new Color(0.537254901960784,0.247058823529412,0.270588235294118,1.0,"Cordovan");\r
- public static readonly Color Corn = new Color(0.984313725490196,0.925490196078431,0.364705882352941,1.0,"Corn");\r
- public static readonly Color CornellRed = new Color(0.701960784313725,0.105882352941176,0.105882352941176,1.0,"CornellRed");\r
- public static readonly Color CornflowerBlue = new Color(0.392156862745098,0.584313725490196,0.929411764705882,1.0,"CornflowerBlue");\r
- public static readonly Color Cornsilk = new Color(1,0.972549019607843,0.862745098039216,1.0,"Cornsilk");\r
- public static readonly Color CosmicLatte = new Color(1,0.972549019607843,0.905882352941176,1.0,"CosmicLatte");\r
- public static readonly Color CottonCandy = new Color(1,0.737254901960784,0.850980392156863,1.0,"CottonCandy");\r
- public static readonly Color Cream = new Color(1,0.992156862745098,0.815686274509804,1.0,"Cream");\r
- public static readonly Color Crimson = new Color(0.862745098039216,0.0784313725490196,0.235294117647059,1.0,"Crimson");\r
- public static readonly Color CrimsonGlory = new Color(0.745098039215686,0,0.196078431372549,1.0,"CrimsonGlory");\r
- public static readonly Color Cyan = new Color(0,1,1,1.0,"Cyan");\r
- public static readonly Color CyanProcess = new Color(0,0.717647058823529,0.92156862745098,1.0,"CyanProcess");\r
- public static readonly Color Daffodil = new Color(1,1,0.192156862745098,1.0,"Daffodil");\r
- public static readonly Color Dandelion = new Color(0.941176470588235,0.882352941176471,0.188235294117647,1.0,"Dandelion");\r
- public static readonly Color DarkBlue = new Color(0,0,0.545098039215686,1.0,"DarkBlue");\r
- public static readonly Color DarkBrown = new Color(0.396078431372549,0.262745098039216,0.129411764705882,1.0,"DarkBrown");\r
- public static readonly Color DarkByzantium = new Color(0.364705882352941,0.223529411764706,0.329411764705882,1.0,"DarkByzantium");\r
- public static readonly Color DarkCandyAppleRed = new Color(0.643137254901961,0,0,1.0,"DarkCandyAppleRed");\r
- public static readonly Color DarkCerulean = new Color(0.0313725490196078,0.270588235294118,0.494117647058824,1.0,"DarkCerulean");\r
- public static readonly Color DarkChestnut = new Color(0.596078431372549,0.411764705882353,0.376470588235294,1.0,"DarkChestnut");\r
- public static readonly Color DarkCoral = new Color(0.803921568627451,0.356862745098039,0.270588235294118,1.0,"DarkCoral");\r
- public static readonly Color DarkCyan = new Color(0,0.545098039215686,0.545098039215686,1.0,"DarkCyan");\r
- public static readonly Color DarkElectricBlue = new Color(0.325490196078431,0.407843137254902,0.470588235294118,1.0,"DarkElectricBlue");\r
- public static readonly Color DarkGoldenrod = new Color(0.72156862745098,0.525490196078431,0.0431372549019608,1.0,"DarkGoldenrod");\r
- public static readonly Color DarkGray = new Color(0.662745098039216,0.662745098039216,0.662745098039216,1.0,"DarkGray");\r
- public static readonly Color DarkGreen = new Color(0.00392156862745098,0.196078431372549,0.125490196078431,1.0,"DarkGreen");\r
- public static readonly Color DarkImperialBlue = new Color(0,0.254901960784314,0.415686274509804,1.0,"DarkImperialBlue");\r
- public static readonly Color DarkJungleGreen = new Color(0.101960784313725,0.141176470588235,0.129411764705882,1.0,"DarkJungleGreen");\r
- public static readonly Color DarkKhaki = new Color(0.741176470588235,0.717647058823529,0.419607843137255,1.0,"DarkKhaki");\r
- public static readonly Color DarkLava = new Color(0.282352941176471,0.235294117647059,0.196078431372549,1.0,"DarkLava");\r
- public static readonly Color DarkLavender = new Color(0.450980392156863,0.309803921568627,0.588235294117647,1.0,"DarkLavender");\r
- public static readonly Color DarkMagenta = new Color(0.545098039215686,0,0.545098039215686,1.0,"DarkMagenta");\r
- public static readonly Color DarkMidnightBlue = new Color(0,0.2,0.4,1.0,"DarkMidnightBlue");\r
- public static readonly Color DarkOliveGreen = new Color(0.333333333333333,0.419607843137255,0.184313725490196,1.0,"DarkOliveGreen");\r
- public static readonly Color DarkOrange = new Color(1,0.549019607843137,0,1.0,"DarkOrange");\r
- public static readonly Color DarkOrchid = new Color(0.6,0.196078431372549,0.8,1.0,"DarkOrchid");\r
- public static readonly Color DarkPastelBlue = new Color(0.466666666666667,0.619607843137255,0.796078431372549,1.0,"DarkPastelBlue");\r
- public static readonly Color DarkPastelGreen = new Color(0.0117647058823529,0.752941176470588,0.235294117647059,1.0,"DarkPastelGreen");\r
- public static readonly Color DarkPastelPurple = new Color(0.588235294117647,0.435294117647059,0.83921568627451,1.0,"DarkPastelPurple");\r
- public static readonly Color DarkPastelRed = new Color(0.76078431372549,0.231372549019608,0.133333333333333,1.0,"DarkPastelRed");\r
- public static readonly Color DarkPink = new Color(0.905882352941176,0.329411764705882,0.501960784313725,1.0,"DarkPink");\r
- public static readonly Color DarkPowderBlue = new Color(0,0.2,0.6,1.0,"DarkPowderBlue");\r
- public static readonly Color DarkRaspberry = new Color(0.529411764705882,0.149019607843137,0.341176470588235,1.0,"DarkRaspberry");\r
- public static readonly Color DarkRed = new Color(0.545098039215686,0,0,1.0,"DarkRed");\r
- public static readonly Color DarkSalmon = new Color(0.913725490196078,0.588235294117647,0.47843137254902,1.0,"DarkSalmon");\r
- public static readonly Color DarkScarlet = new Color(0.337254901960784,0.0117647058823529,0.0980392156862745,1.0,"DarkScarlet");\r
- public static readonly Color DarkSeaGreen = new Color(0.56078431372549,0.737254901960784,0.56078431372549,1.0,"DarkSeaGreen");\r
- public static readonly Color DarkSienna = new Color(0.235294117647059,0.0784313725490196,0.0784313725490196,1.0,"DarkSienna");\r
- public static readonly Color DarkSlateBlue = new Color(0.282352941176471,0.23921568627451,0.545098039215686,1.0,"DarkSlateBlue");\r
- public static readonly Color DarkSlateGray = new Color(0.184313725490196,0.309803921568627,0.309803921568627,1.0,"DarkSlateGray");\r
- public static readonly Color DarkSpringGreen = new Color(0.0901960784313725,0.447058823529412,0.270588235294118,1.0,"DarkSpringGreen");\r
- public static readonly Color DarkTan = new Color(0.568627450980392,0.505882352941176,0.317647058823529,1.0,"DarkTan");\r
- public static readonly Color DarkTangerine = new Color(1,0.658823529411765,0.0705882352941176,1.0,"DarkTangerine");\r
- public static readonly Color DarkTaupe = new Color(0.282352941176471,0.235294117647059,0.196078431372549,1.0,"DarkTaupe");\r
- public static readonly Color DarkTerraCotta = new Color(0.8,0.305882352941176,0.36078431372549,1.0,"DarkTerraCotta");\r
- public static readonly Color DarkTurquoise = new Color(0,0.807843137254902,0.819607843137255,1.0,"DarkTurquoise");\r
- public static readonly Color DarkViolet = new Color(0.580392156862745,0,0.827450980392157,1.0,"DarkViolet");\r
- public static readonly Color DarkYellow = new Color(0.607843137254902,0.529411764705882,0.0470588235294118,1.0,"DarkYellow");\r
- public static readonly Color DartmouthGreen = new Color(0,0.43921568627451,0.235294117647059,1.0,"DartmouthGreen");\r
- public static readonly Color DavySGrey = new Color(0.333333333333333,0.333333333333333,0.333333333333333,1.0,"DavySGrey");\r
- public static readonly Color DebianRed = new Color(0.843137254901961,0.0392156862745098,0.325490196078431,1.0,"DebianRed");\r
- public static readonly Color DeepCarmine = new Color(0.662745098039216,0.125490196078431,0.243137254901961,1.0,"DeepCarmine");\r
- public static readonly Color DeepCarminePink = new Color(0.937254901960784,0.188235294117647,0.219607843137255,1.0,"DeepCarminePink");\r
- public static readonly Color DeepCarrotOrange = new Color(0.913725490196078,0.411764705882353,0.172549019607843,1.0,"DeepCarrotOrange");\r
- public static readonly Color DeepCerise = new Color(0.854901960784314,0.196078431372549,0.529411764705882,1.0,"DeepCerise");\r
- public static readonly Color DeepChampagne = new Color(0.980392156862745,0.83921568627451,0.647058823529412,1.0,"DeepChampagne");\r
- public static readonly Color DeepChestnut = new Color(0.725490196078431,0.305882352941176,0.282352941176471,1.0,"DeepChestnut");\r
- public static readonly Color DeepCoffee = new Color(0.43921568627451,0.258823529411765,0.254901960784314,1.0,"DeepCoffee");\r
- public static readonly Color DeepFuchsia = new Color(0.756862745098039,0.329411764705882,0.756862745098039,1.0,"DeepFuchsia");\r
- public static readonly Color DeepJungleGreen = new Color(0,0.294117647058824,0.286274509803922,1.0,"DeepJungleGreen");\r
- public static readonly Color DeepLilac = new Color(0.6,0.333333333333333,0.733333333333333,1.0,"DeepLilac");\r
- public static readonly Color DeepMagenta = new Color(0.8,0,0.8,1.0,"DeepMagenta");\r
- public static readonly Color DeepPeach = new Color(1,0.796078431372549,0.643137254901961,1.0,"DeepPeach");\r
- public static readonly Color DeepPink = new Color(1,0.0784313725490196,0.576470588235294,1.0,"DeepPink");\r
- public static readonly Color DeepRuby = new Color(0.517647058823529,0.247058823529412,0.356862745098039,1.0,"DeepRuby");\r
- public static readonly Color DeepSaffron = new Color(1,0.6,0.2,1.0,"DeepSaffron");\r
- public static readonly Color DeepSkyBlue = new Color(0,0.749019607843137,1,1.0,"DeepSkyBlue");\r
- public static readonly Color DeepTuscanRed = new Color(0.4,0.258823529411765,0.301960784313725,1.0,"DeepTuscanRed");\r
- public static readonly Color Denim = new Color(0.0823529411764706,0.376470588235294,0.741176470588235,1.0,"Denim");\r
- public static readonly Color Desert = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"Desert");\r
- public static readonly Color DesertSand = new Color(0.929411764705882,0.788235294117647,0.686274509803922,1.0,"DesertSand");\r
- public static readonly Color DimGray = new Color(0.411764705882353,0.411764705882353,0.411764705882353,1.0,"DimGray");\r
- public static readonly Color DodgerBlue = new Color(0.117647058823529,0.564705882352941,1,1.0,"DodgerBlue");\r
- public static readonly Color DogwoodRose = new Color(0.843137254901961,0.0941176470588235,0.407843137254902,1.0,"DogwoodRose");\r
- public static readonly Color DollarBill = new Color(0.52156862745098,0.733333333333333,0.396078431372549,1.0,"DollarBill");\r
- public static readonly Color Drab = new Color(0.588235294117647,0.443137254901961,0.0901960784313725,1.0,"Drab");\r
- public static readonly Color DukeBlue = new Color(0,0,0.611764705882353,1.0,"DukeBlue");\r
- public static readonly Color EarthYellow = new Color(0.882352941176471,0.662745098039216,0.372549019607843,1.0,"EarthYellow");\r
- public static readonly Color Ebony = new Color(0.333333333333333,0.364705882352941,0.313725490196078,1.0,"Ebony");\r
- public static readonly Color Ecru = new Color(0.76078431372549,0.698039215686274,0.501960784313725,1.0,"Ecru");\r
- public static readonly Color Eggplant = new Color(0.380392156862745,0.250980392156863,0.317647058823529,1.0,"Eggplant");\r
- public static readonly Color Eggshell = new Color(0.941176470588235,0.917647058823529,0.83921568627451,1.0,"Eggshell");\r
- public static readonly Color EgyptianBlue = new Color(0.0627450980392157,0.203921568627451,0.650980392156863,1.0,"EgyptianBlue");\r
- public static readonly Color ElectricBlue = new Color(0.490196078431373,0.976470588235294,1,1.0,"ElectricBlue");\r
- public static readonly Color ElectricCrimson = new Color(1,0,0.247058823529412,1.0,"ElectricCrimson");\r
- public static readonly Color ElectricCyan = new Color(0,1,1,1.0,"ElectricCyan");\r
- public static readonly Color ElectricGreen = new Color(0,1,0,1.0,"ElectricGreen");\r
- public static readonly Color ElectricIndigo = new Color(0.435294117647059,0,1,1.0,"ElectricIndigo");\r
- public static readonly Color ElectricLavender = new Color(0.956862745098039,0.733333333333333,1,1.0,"ElectricLavender");\r
- public static readonly Color ElectricLime = new Color(0.8,1,0,1.0,"ElectricLime");\r
- public static readonly Color ElectricPurple = new Color(0.749019607843137,0,1,1.0,"ElectricPurple");\r
- public static readonly Color ElectricUltramarine = new Color(0.247058823529412,0,1,1.0,"ElectricUltramarine");\r
- public static readonly Color ElectricViolet = new Color(0.56078431372549,0,1,1.0,"ElectricViolet");\r
- public static readonly Color ElectricYellow = new Color(1,1,0,1.0,"ElectricYellow");\r
- public static readonly Color Emerald = new Color(0.313725490196078,0.784313725490196,0.470588235294118,1.0,"Emerald");\r
- public static readonly Color EnglishLavender = new Color(0.705882352941177,0.513725490196078,0.584313725490196,1.0,"EnglishLavender");\r
- public static readonly Color EtonBlue = new Color(0.588235294117647,0.784313725490196,0.635294117647059,1.0,"EtonBlue");\r
- public static readonly Color Fallow = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"Fallow");\r
- public static readonly Color FaluRed = new Color(0.501960784313725,0.0941176470588235,0.0941176470588235,1.0,"FaluRed");\r
- public static readonly Color Fandango = new Color(0.709803921568627,0.2,0.537254901960784,1.0,"Fandango");\r
- public static readonly Color FashionFuchsia = new Color(0.956862745098039,0,0.631372549019608,1.0,"FashionFuchsia");\r
- public static readonly Color Fawn = new Color(0.898039215686275,0.666666666666667,0.43921568627451,1.0,"Fawn");\r
- public static readonly Color Feldgrau = new Color(0.301960784313725,0.364705882352941,0.325490196078431,1.0,"Feldgrau");\r
- public static readonly Color FernGreen = new Color(0.309803921568627,0.474509803921569,0.258823529411765,1.0,"FernGreen");\r
- public static readonly Color FerrariRed = new Color(1,0.156862745098039,0,1.0,"FerrariRed");\r
- public static readonly Color FieldDrab = new Color(0.423529411764706,0.329411764705882,0.117647058823529,1.0,"FieldDrab");\r
- public static readonly Color FireEngineRed = new Color(0.807843137254902,0.125490196078431,0.16078431372549,1.0,"FireEngineRed");\r
- public static readonly Color Firebrick = new Color(0.698039215686274,0.133333333333333,0.133333333333333,1.0,"Firebrick");\r
- public static readonly Color Flame = new Color(0.886274509803922,0.345098039215686,0.133333333333333,1.0,"Flame");\r
- public static readonly Color FlamingoPink = new Color(0.988235294117647,0.556862745098039,0.674509803921569,1.0,"FlamingoPink");\r
- public static readonly Color Flavescent = new Color(0.968627450980392,0.913725490196078,0.556862745098039,1.0,"Flavescent");\r
- public static readonly Color Flax = new Color(0.933333333333333,0.862745098039216,0.509803921568627,1.0,"Flax");\r
- public static readonly Color FloralWhite = new Color(1,0.980392156862745,0.941176470588235,1.0,"FloralWhite");\r
- public static readonly Color FluorescentOrange = new Color(1,0.749019607843137,0,1.0,"FluorescentOrange");\r
- public static readonly Color FluorescentPink = new Color(1,0.0784313725490196,0.576470588235294,1.0,"FluorescentPink");\r
- public static readonly Color FluorescentYellow = new Color(0.8,1,0,1.0,"FluorescentYellow");\r
- public static readonly Color Folly = new Color(1,0,0.309803921568627,1.0,"Folly");\r
- public static readonly Color ForestGreenTraditional = new Color(0.00392156862745098,0.266666666666667,0.129411764705882,1.0,"ForestGreenTraditional");\r
- public static readonly Color ForestGreenWeb = new Color(0.133333333333333,0.545098039215686,0.133333333333333,1.0,"ForestGreenWeb");\r
- public static readonly Color FrenchBeige = new Color(0.650980392156863,0.482352941176471,0.356862745098039,1.0,"FrenchBeige");\r
- public static readonly Color FrenchBlue = new Color(0,0.447058823529412,0.733333333333333,1.0,"FrenchBlue");\r
- public static readonly Color FrenchLilac = new Color(0.525490196078431,0.376470588235294,0.556862745098039,1.0,"FrenchLilac");\r
- public static readonly Color FrenchLime = new Color(0.8,1,0,1.0,"FrenchLime");\r
- public static readonly Color FrenchRaspberry = new Color(0.780392156862745,0.172549019607843,0.282352941176471,1.0,"FrenchRaspberry");\r
- public static readonly Color FrenchRose = new Color(0.964705882352941,0.290196078431373,0.541176470588235,1.0,"FrenchRose");\r
- public static readonly Color Fuchsia = new Color(1,0,1,1.0,"Fuchsia");\r
- public static readonly Color FuchsiaCrayola = new Color(0.756862745098039,0.329411764705882,0.756862745098039,1.0,"FuchsiaCrayola");\r
- public static readonly Color FuchsiaPink = new Color(1,0.466666666666667,1,1.0,"FuchsiaPink");\r
- public static readonly Color FuchsiaRose = new Color(0.780392156862745,0.262745098039216,0.458823529411765,1.0,"FuchsiaRose");\r
- public static readonly Color Fulvous = new Color(0.894117647058824,0.517647058823529,0,1.0,"Fulvous");\r
- public static readonly Color FuzzyWuzzy = new Color(0.8,0.4,0.4,1.0,"FuzzyWuzzy");\r
- public static readonly Color Gainsboro = new Color(0.862745098039216,0.862745098039216,0.862745098039216,1.0,"Gainsboro");\r
- public static readonly Color Gamboge = new Color(0.894117647058824,0.607843137254902,0.0588235294117647,1.0,"Gamboge");\r
- public static readonly Color GhostWhite = new Color(0.972549019607843,0.972549019607843,1,1.0,"GhostWhite");\r
- public static readonly Color Ginger = new Color(0.690196078431373,0.396078431372549,0,1.0,"Ginger");\r
- public static readonly Color Glaucous = new Color(0.376470588235294,0.509803921568627,0.713725490196078,1.0,"Glaucous");\r
- public static readonly Color Glitter = new Color(0.901960784313726,0.909803921568627,0.980392156862745,1.0,"Glitter");\r
- public static readonly Color GoldMetallic = new Color(0.831372549019608,0.686274509803922,0.215686274509804,1.0,"GoldMetallic");\r
- public static readonly Color GoldWebGolden = new Color(1,0.843137254901961,0,1.0,"GoldWebGolden");\r
- public static readonly Color GoldenBrown = new Color(0.6,0.396078431372549,0.0823529411764706,1.0,"GoldenBrown");\r
- public static readonly Color GoldenPoppy = new Color(0.988235294117647,0.76078431372549,0,1.0,"GoldenPoppy");\r
- public static readonly Color GoldenYellow = new Color(1,0.874509803921569,0,1.0,"GoldenYellow");\r
- public static readonly Color Goldenrod = new Color(0.854901960784314,0.647058823529412,0.125490196078431,1.0,"Goldenrod");\r
- public static readonly Color GrannySmithApple = new Color(0.658823529411765,0.894117647058824,0.627450980392157,1.0,"GrannySmithApple");\r
- public static readonly Color Gray = new Color(0.501960784313725,0.501960784313725,0.501960784313725,1.0,"Gray");\r
- public static readonly Color GrayAsparagus = new Color(0.274509803921569,0.349019607843137,0.270588235294118,1.0,"GrayAsparagus");\r
- public static readonly Color GrayHtmlCssGray = new Color(0.501960784313725,0.501960784313725,0.501960784313725,1.0,"GrayHtmlCssGray");\r
- public static readonly Color GrayX11Gray = new Color(0.745098039215686,0.745098039215686,0.745098039215686,1.0,"GrayX11Gray");\r
- public static readonly Color GreenColorWheelX11Green = new Color(0,1,0,1.0,"GreenColorWheelX11Green");\r
- public static readonly Color GreenCrayola = new Color(0.109803921568627,0.674509803921569,0.470588235294118,1.0,"GreenCrayola");\r
- public static readonly Color GreenHtmlCssGreen = new Color(0,0.501960784313725,0,1.0,"GreenHtmlCssGreen");\r
- public static readonly Color GreenMunsell = new Color(0,0.658823529411765,0.466666666666667,1.0,"GreenMunsell");\r
- public static readonly Color GreenNcs = new Color(0,0.623529411764706,0.419607843137255,1.0,"GreenNcs");\r
- public static readonly Color GreenPigment = new Color(0,0.647058823529412,0.313725490196078,1.0,"GreenPigment");\r
- public static readonly Color GreenRyb = new Color(0.4,0.690196078431373,0.196078431372549,1.0,"GreenRyb");\r
- public static readonly Color GreenYellow = new Color(0.67843137254902,1,0.184313725490196,1.0,"GreenYellow");\r
- public static readonly Color Grullo = new Color(0.662745098039216,0.603921568627451,0.525490196078431,1.0,"Grullo");\r
- public static readonly Color GuppieGreen = new Color(0,1,0.498039215686275,1.0,"GuppieGreen");\r
- public static readonly Color HalayBe = new Color(0.4,0.219607843137255,0.329411764705882,1.0,"HalayBe");\r
- public static readonly Color HanBlue = new Color(0.266666666666667,0.423529411764706,0.811764705882353,1.0,"HanBlue");\r
- public static readonly Color HanPurple = new Color(0.32156862745098,0.0941176470588235,0.980392156862745,1.0,"HanPurple");\r
- public static readonly Color HansaYellow = new Color(0.913725490196078,0.83921568627451,0.419607843137255,1.0,"HansaYellow");\r
- public static readonly Color Harlequin = new Color(0.247058823529412,1,0,1.0,"Harlequin");\r
- public static readonly Color HarvardCrimson = new Color(0.788235294117647,0,0.0862745098039216,1.0,"HarvardCrimson");\r
- public static readonly Color HarvestGold = new Color(0.854901960784314,0.568627450980392,0,1.0,"HarvestGold");\r
- public static readonly Color HeartGold = new Color(0.501960784313725,0.501960784313725,0,1.0,"HeartGold");\r
- public static readonly Color Heliotrope = new Color(0.874509803921569,0.450980392156863,1,1.0,"Heliotrope");\r
- public static readonly Color HollywoodCerise = new Color(0.956862745098039,0,0.631372549019608,1.0,"HollywoodCerise");\r
- public static readonly Color Honeydew = new Color(0.941176470588235,1,0.941176470588235,1.0,"Honeydew");\r
- public static readonly Color HonoluluBlue = new Color(0,0.498039215686275,0.749019607843137,1.0,"HonoluluBlue");\r
- public static readonly Color HookerSGreen = new Color(0.286274509803922,0.474509803921569,0.419607843137255,1.0,"HookerSGreen");\r
- public static readonly Color HotMagenta = new Color(1,0.113725490196078,0.807843137254902,1.0,"HotMagenta");\r
- public static readonly Color HotPink = new Color(1,0.411764705882353,0.705882352941177,1.0,"HotPink");\r
- public static readonly Color HunterGreen = new Color(0.207843137254902,0.368627450980392,0.231372549019608,1.0,"HunterGreen");\r
- public static readonly Color Iceberg = new Color(0.443137254901961,0.650980392156863,0.823529411764706,1.0,"Iceberg");\r
- public static readonly Color Icterine = new Color(0.988235294117647,0.968627450980392,0.368627450980392,1.0,"Icterine");\r
- public static readonly Color ImperialBlue = new Color(0,0.137254901960784,0.584313725490196,1.0,"ImperialBlue");\r
- public static readonly Color Inchworm = new Color(0.698039215686274,0.925490196078431,0.364705882352941,1.0,"Inchworm");\r
- public static readonly Color IndiaGreen = new Color(0.0745098039215686,0.533333333333333,0.0313725490196078,1.0,"IndiaGreen");\r
- public static readonly Color IndianRed = new Color(0.803921568627451,0.36078431372549,0.36078431372549,1.0,"IndianRed");\r
- public static readonly Color IndianYellow = new Color(0.890196078431373,0.658823529411765,0.341176470588235,1.0,"IndianYellow");\r
- public static readonly Color Indigo = new Color(0.435294117647059,0,1,1.0,"Indigo");\r
- public static readonly Color IndigoDye = new Color(0,0.254901960784314,0.415686274509804,1.0,"IndigoDye");\r
- public static readonly Color IndigoWeb = new Color(0.294117647058824,0,0.509803921568627,1.0,"IndigoWeb");\r
- public static readonly Color InternationalKleinBlue = new Color(0,0.184313725490196,0.654901960784314,1.0,"InternationalKleinBlue");\r
- public static readonly Color InternationalOrangeAerospace = new Color(1,0.309803921568627,0,1.0,"InternationalOrangeAerospace");\r
- public static readonly Color InternationalOrangeEngineering = new Color(0.729411764705882,0.0862745098039216,0.0470588235294118,1.0,"InternationalOrangeEngineering");\r
- public static readonly Color InternationalOrangeGoldenGateBridge = new Color(0.752941176470588,0.211764705882353,0.172549019607843,1.0,"InternationalOrangeGoldenGateBridge");\r
- public static readonly Color Iris = new Color(0.352941176470588,0.309803921568627,0.811764705882353,1.0,"Iris");\r
- public static readonly Color Isabelline = new Color(0.956862745098039,0.941176470588235,0.925490196078431,1.0,"Isabelline");\r
- public static readonly Color IslamicGreen = new Color(0,0.564705882352941,0,1.0,"IslamicGreen");\r
- public static readonly Color Ivory = new Color(1,1,0.941176470588235,1.0,"Ivory");\r
- public static readonly Color Jade = new Color(0,0.658823529411765,0.419607843137255,1.0,"Jade");\r
- public static readonly Color Jasmine = new Color(0.972549019607843,0.870588235294118,0.494117647058824,1.0,"Jasmine");\r
- public static readonly Color Jasper = new Color(0.843137254901961,0.231372549019608,0.243137254901961,1.0,"Jasper");\r
- public static readonly Color JazzberryJam = new Color(0.647058823529412,0.0431372549019608,0.368627450980392,1.0,"JazzberryJam");\r
- public static readonly Color Jet = new Color(0.203921568627451,0.203921568627451,0.203921568627451,1.0,"Jet");\r
- public static readonly Color Jonquil = new Color(0.980392156862745,0.854901960784314,0.368627450980392,1.0,"Jonquil");\r
- public static readonly Color JuneBud = new Color(0.741176470588235,0.854901960784314,0.341176470588235,1.0,"JuneBud");\r
- public static readonly Color JungleGreen = new Color(0.16078431372549,0.670588235294118,0.529411764705882,1.0,"JungleGreen");\r
- public static readonly Color KellyGreen = new Color(0.298039215686275,0.733333333333333,0.0901960784313725,1.0,"KellyGreen");\r
- public static readonly Color KenyanCopper = new Color(0.486274509803922,0.109803921568627,0.0196078431372549,1.0,"KenyanCopper");\r
- public static readonly Color KhakiHtmlCssKhaki = new Color(0.764705882352941,0.690196078431373,0.568627450980392,1.0,"KhakiHtmlCssKhaki");\r
- public static readonly Color KhakiX11LightKhaki = new Color(0.941176470588235,0.901960784313726,0.549019607843137,1.0,"KhakiX11LightKhaki");\r
- public static readonly Color KuCrimson = new Color(0.909803921568627,0,0.0509803921568627,1.0,"KuCrimson");\r
- public static readonly Color LaSalleGreen = new Color(0.0313725490196078,0.470588235294118,0.188235294117647,1.0,"LaSalleGreen");\r
- public static readonly Color LanguidLavender = new Color(0.83921568627451,0.792156862745098,0.866666666666667,1.0,"LanguidLavender");\r
- public static readonly Color LapisLazuli = new Color(0.149019607843137,0.380392156862745,0.611764705882353,1.0,"LapisLazuli");\r
- public static readonly Color LaserLemon = new Color(0.996078431372549,0.996078431372549,0.133333333333333,1.0,"LaserLemon");\r
- public static readonly Color LaurelGreen = new Color(0.662745098039216,0.729411764705882,0.615686274509804,1.0,"LaurelGreen");\r
- public static readonly Color Lava = new Color(0.811764705882353,0.0627450980392157,0.125490196078431,1.0,"Lava");\r
- public static readonly Color LavenderBlue = new Color(0.8,0.8,1,1.0,"LavenderBlue");\r
- public static readonly Color LavenderBlush = new Color(1,0.941176470588235,0.96078431372549,1.0,"LavenderBlush");\r
- public static readonly Color LavenderFloral = new Color(0.709803921568627,0.494117647058824,0.862745098039216,1.0,"LavenderFloral");\r
- public static readonly Color LavenderGray = new Color(0.768627450980392,0.764705882352941,0.815686274509804,1.0,"LavenderGray");\r
- public static readonly Color LavenderIndigo = new Color(0.580392156862745,0.341176470588235,0.92156862745098,1.0,"LavenderIndigo");\r
- public static readonly Color LavenderMagenta = new Color(0.933333333333333,0.509803921568627,0.933333333333333,1.0,"LavenderMagenta");\r
- public static readonly Color LavenderMist = new Color(0.901960784313726,0.901960784313726,0.980392156862745,1.0,"LavenderMist");\r
- public static readonly Color LavenderPink = new Color(0.984313725490196,0.682352941176471,0.823529411764706,1.0,"LavenderPink");\r
- public static readonly Color LavenderPurple = new Color(0.588235294117647,0.482352941176471,0.713725490196078,1.0,"LavenderPurple");\r
- public static readonly Color LavenderRose = new Color(0.984313725490196,0.627450980392157,0.890196078431373,1.0,"LavenderRose");\r
- public static readonly Color LavenderWeb = new Color(0.901960784313726,0.901960784313726,0.980392156862745,1.0,"LavenderWeb");\r
- public static readonly Color LawnGreen = new Color(0.486274509803922,0.988235294117647,0,1.0,"LawnGreen");\r
- public static readonly Color Lemon = new Color(1,0.968627450980392,0,1.0,"Lemon");\r
- public static readonly Color LemonChiffon = new Color(1,0.980392156862745,0.803921568627451,1.0,"LemonChiffon");\r
- public static readonly Color LemonLime = new Color(0.890196078431373,1,0,1.0,"LemonLime");\r
- public static readonly Color Licorice = new Color(0.101960784313725,0.0666666666666667,0.0627450980392157,1.0,"Licorice");\r
- public static readonly Color LightApricot = new Color(0.992156862745098,0.835294117647059,0.694117647058824,1.0,"LightApricot");\r
- public static readonly Color LightBlue = new Color(0.67843137254902,0.847058823529412,0.901960784313726,1.0,"LightBlue");\r
- public static readonly Color LightBrown = new Color(0.709803921568627,0.396078431372549,0.113725490196078,1.0,"LightBrown");\r
- public static readonly Color LightCarminePink = new Color(0.901960784313726,0.403921568627451,0.443137254901961,1.0,"LightCarminePink");\r
- public static readonly Color LightCoral = new Color(0.941176470588235,0.501960784313725,0.501960784313725,1.0,"LightCoral");\r
- public static readonly Color LightCornflowerBlue = new Color(0.576470588235294,0.8,0.917647058823529,1.0,"LightCornflowerBlue");\r
- public static readonly Color LightCrimson = new Color(0.96078431372549,0.411764705882353,0.568627450980392,1.0,"LightCrimson");\r
- public static readonly Color LightCyan = new Color(0.87843137254902,1,1,1.0,"LightCyan");\r
- public static readonly Color LightFuchsiaPink = new Color(0.976470588235294,0.517647058823529,0.937254901960784,1.0,"LightFuchsiaPink");\r
- public static readonly Color LightGoldenrodYellow = new Color(0.980392156862745,0.980392156862745,0.823529411764706,1.0,"LightGoldenrodYellow");\r
- public static readonly Color LightGray = new Color(0.827450980392157,0.827450980392157,0.827450980392157,1.0,"LightGray");\r
- public static readonly Color LightGreen = new Color(0.564705882352941,0.933333333333333,0.564705882352941,1.0,"LightGreen");\r
- public static readonly Color LightKhaki = new Color(0.941176470588235,0.901960784313726,0.549019607843137,1.0,"LightKhaki");\r
- public static readonly Color LightPastelPurple = new Color(0.694117647058824,0.611764705882353,0.850980392156863,1.0,"LightPastelPurple");\r
- public static readonly Color LightPink = new Color(1,0.713725490196078,0.756862745098039,1.0,"LightPink");\r
- public static readonly Color LightRedOchre = new Color(0.913725490196078,0.454901960784314,0.317647058823529,1.0,"LightRedOchre");\r
- public static readonly Color LightSalmon = new Color(1,0.627450980392157,0.47843137254902,1.0,"LightSalmon");\r
- public static readonly Color LightSalmonPink = new Color(1,0.6,0.6,1.0,"LightSalmonPink");\r
- public static readonly Color LightSeaGreen = new Color(0.125490196078431,0.698039215686274,0.666666666666667,1.0,"LightSeaGreen");\r
- public static readonly Color LightSkyBlue = new Color(0.529411764705882,0.807843137254902,0.980392156862745,1.0,"LightSkyBlue");\r
- public static readonly Color LightSlateGray = new Color(0.466666666666667,0.533333333333333,0.6,1.0,"LightSlateGray");\r
- public static readonly Color LightTaupe = new Color(0.701960784313725,0.545098039215686,0.427450980392157,1.0,"LightTaupe");\r
- public static readonly Color LightThulianPink = new Color(0.901960784313726,0.56078431372549,0.674509803921569,1.0,"LightThulianPink");\r
- public static readonly Color LightYellow = new Color(1,1,0.87843137254902,1.0,"LightYellow");\r
- public static readonly Color Lilac = new Color(0.784313725490196,0.635294117647059,0.784313725490196,1.0,"Lilac");\r
- public static readonly Color LimeColorWheel = new Color(0.749019607843137,1,0,1.0,"LimeColorWheel");\r
- public static readonly Color LimeGreen = new Color(0.196078431372549,0.803921568627451,0.196078431372549,1.0,"LimeGreen");\r
- public static readonly Color LimeWebX11Green = new Color(0,1,0,1.0,"LimeWebX11Green");\r
- public static readonly Color Limerick = new Color(0.615686274509804,0.76078431372549,0.0352941176470588,1.0,"Limerick");\r
- public static readonly Color LincolnGreen = new Color(0.0980392156862745,0.349019607843137,0.0196078431372549,1.0,"LincolnGreen");\r
- public static readonly Color Linen = new Color(0.980392156862745,0.941176470588235,0.901960784313726,1.0,"Linen");\r
- public static readonly Color Lion = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"Lion");\r
- public static readonly Color LittleBoyBlue = new Color(0.423529411764706,0.627450980392157,0.862745098039216,1.0,"LittleBoyBlue");\r
- public static readonly Color Liver = new Color(0.325490196078431,0.294117647058824,0.309803921568627,1.0,"Liver");\r
- public static readonly Color Lust = new Color(0.901960784313726,0.125490196078431,0.125490196078431,1.0,"Lust");\r
- public static readonly Color Magenta = new Color(1,0,1,1.0,"Magenta");\r
- public static readonly Color MagentaDye = new Color(0.792156862745098,0.12156862745098,0.482352941176471,1.0,"MagentaDye");\r
- public static readonly Color MagentaProcess = new Color(1,0,0.564705882352941,1.0,"MagentaProcess");\r
- public static readonly Color MagicMint = new Color(0.666666666666667,0.941176470588235,0.819607843137255,1.0,"MagicMint");\r
- public static readonly Color Magnolia = new Color(0.972549019607843,0.956862745098039,1,1.0,"Magnolia");\r
- public static readonly Color Mahogany = new Color(0.752941176470588,0.250980392156863,0,1.0,"Mahogany");\r
- public static readonly Color Maize = new Color(0.984313725490196,0.925490196078431,0.364705882352941,1.0,"Maize");\r
- public static readonly Color MajorelleBlue = new Color(0.376470588235294,0.313725490196078,0.862745098039216,1.0,"MajorelleBlue");\r
- public static readonly Color Malachite = new Color(0.0431372549019608,0.854901960784314,0.317647058823529,1.0,"Malachite");\r
- public static readonly Color Manatee = new Color(0.592156862745098,0.603921568627451,0.666666666666667,1.0,"Manatee");\r
- public static readonly Color MangoTango = new Color(1,0.509803921568627,0.262745098039216,1.0,"MangoTango");\r
- public static readonly Color Mantis = new Color(0.454901960784314,0.764705882352941,0.396078431372549,1.0,"Mantis");\r
- public static readonly Color MardiGras = new Color(0.533333333333333,0,0.52156862745098,1.0,"MardiGras");\r
- public static readonly Color MaroonCrayola = new Color(0.764705882352941,0.129411764705882,0.282352941176471,1.0,"MaroonCrayola");\r
- public static readonly Color MaroonHtmlCss = new Color(0.501960784313725,0,0,1.0,"MaroonHtmlCss");\r
- public static readonly Color MaroonX11 = new Color(0.690196078431373,0.188235294117647,0.376470588235294,1.0,"MaroonX11");\r
- public static readonly Color Mauve = new Color(0.87843137254902,0.690196078431373,1,1.0,"Mauve");\r
- public static readonly Color MauveTaupe = new Color(0.568627450980392,0.372549019607843,0.427450980392157,1.0,"MauveTaupe");\r
- public static readonly Color Mauvelous = new Color(0.937254901960784,0.596078431372549,0.666666666666667,1.0,"Mauvelous");\r
- public static readonly Color MayaBlue = new Color(0.450980392156863,0.76078431372549,0.984313725490196,1.0,"MayaBlue");\r
- public static readonly Color MeatBrown = new Color(0.898039215686275,0.717647058823529,0.231372549019608,1.0,"MeatBrown");\r
- public static readonly Color MediumAquamarine = new Color(0.4,0.866666666666667,0.666666666666667,1.0,"MediumAquamarine");\r
- public static readonly Color MediumBlue = new Color(0,0,0.803921568627451,1.0,"MediumBlue");\r
- public static readonly Color MediumCandyAppleRed = new Color(0.886274509803922,0.0235294117647059,0.172549019607843,1.0,"MediumCandyAppleRed");\r
- public static readonly Color MediumCarmine = new Color(0.686274509803922,0.250980392156863,0.207843137254902,1.0,"MediumCarmine");\r
- public static readonly Color MediumChampagne = new Color(0.952941176470588,0.898039215686275,0.670588235294118,1.0,"MediumChampagne");\r
- public static readonly Color MediumElectricBlue = new Color(0.0117647058823529,0.313725490196078,0.588235294117647,1.0,"MediumElectricBlue");\r
- public static readonly Color MediumJungleGreen = new Color(0.109803921568627,0.207843137254902,0.176470588235294,1.0,"MediumJungleGreen");\r
- public static readonly Color MediumLavenderMagenta = new Color(0.866666666666667,0.627450980392157,0.866666666666667,1.0,"MediumLavenderMagenta");\r
- public static readonly Color MediumOrchid = new Color(0.729411764705882,0.333333333333333,0.827450980392157,1.0,"MediumOrchid");\r
- public static readonly Color MediumPersianBlue = new Color(0,0.403921568627451,0.647058823529412,1.0,"MediumPersianBlue");\r
- public static readonly Color MediumPurple = new Color(0.576470588235294,0.43921568627451,0.858823529411765,1.0,"MediumPurple");\r
- public static readonly Color MediumRedViolet = new Color(0.733333333333333,0.2,0.52156862745098,1.0,"MediumRedViolet");\r
- public static readonly Color MediumRuby = new Color(0.666666666666667,0.250980392156863,0.411764705882353,1.0,"MediumRuby");\r
- public static readonly Color MediumSeaGreen = new Color(0.235294117647059,0.701960784313725,0.443137254901961,1.0,"MediumSeaGreen");\r
- public static readonly Color MediumSlateBlue = new Color(0.482352941176471,0.407843137254902,0.933333333333333,1.0,"MediumSlateBlue");\r
- public static readonly Color MediumSpringBud = new Color(0.788235294117647,0.862745098039216,0.529411764705882,1.0,"MediumSpringBud");\r
- public static readonly Color MediumSpringGreen = new Color(0,0.980392156862745,0.603921568627451,1.0,"MediumSpringGreen");\r
- public static readonly Color MediumTaupe = new Color(0.403921568627451,0.298039215686275,0.27843137254902,1.0,"MediumTaupe");\r
- public static readonly Color MediumTurquoise = new Color(0.282352941176471,0.819607843137255,0.8,1.0,"MediumTurquoise");\r
- public static readonly Color MediumTuscanRed = new Color(0.474509803921569,0.266666666666667,0.231372549019608,1.0,"MediumTuscanRed");\r
- public static readonly Color MediumVermilion = new Color(0.850980392156863,0.376470588235294,0.231372549019608,1.0,"MediumVermilion");\r
- public static readonly Color MediumVioletRed = new Color(0.780392156862745,0.0823529411764706,0.52156862745098,1.0,"MediumVioletRed");\r
- public static readonly Color MellowApricot = new Color(0.972549019607843,0.72156862745098,0.470588235294118,1.0,"MellowApricot");\r
- public static readonly Color MellowYellow = new Color(0.972549019607843,0.870588235294118,0.494117647058824,1.0,"MellowYellow");\r
- public static readonly Color Melon = new Color(0.992156862745098,0.737254901960784,0.705882352941177,1.0,"Melon");\r
- public static readonly Color MidnightBlue = new Color(0.0980392156862745,0.0980392156862745,0.43921568627451,1.0,"MidnightBlue");\r
- public static readonly Color MidnightGreenEagleGreen = new Color(0,0.286274509803922,0.325490196078431,1.0,"MidnightGreenEagleGreen");\r
- public static readonly Color MikadoYellow = new Color(1,0.768627450980392,0.0470588235294118,1.0,"MikadoYellow");\r
- public static readonly Color Mint = new Color(0.243137254901961,0.705882352941177,0.537254901960784,1.0,"Mint");\r
- public static readonly Color MintCream = new Color(0.96078431372549,1,0.980392156862745,1.0,"MintCream");\r
- public static readonly Color MintGreen = new Color(0.596078431372549,1,0.596078431372549,1.0,"MintGreen");\r
- public static readonly Color MistyRose = new Color(1,0.894117647058824,0.882352941176471,1.0,"MistyRose");\r
- public static readonly Color Moccasin = new Color(0.980392156862745,0.92156862745098,0.843137254901961,1.0,"Moccasin");\r
- public static readonly Color ModeBeige = new Color(0.588235294117647,0.443137254901961,0.0901960784313725,1.0,"ModeBeige");\r
- public static readonly Color MoonstoneBlue = new Color(0.450980392156863,0.662745098039216,0.76078431372549,1.0,"MoonstoneBlue");\r
- public static readonly Color MordantRed19 = new Color(0.682352941176471,0.0470588235294118,0,1.0,"MordantRed19");\r
- public static readonly Color MossGreen = new Color(0.67843137254902,0.874509803921569,0.67843137254902,1.0,"MossGreen");\r
- public static readonly Color MountainMeadow = new Color(0.188235294117647,0.729411764705882,0.56078431372549,1.0,"MountainMeadow");\r
- public static readonly Color MountbattenPink = new Color(0.6,0.47843137254902,0.552941176470588,1.0,"MountbattenPink");\r
- public static readonly Color MsuGreen = new Color(0.0941176470588235,0.270588235294118,0.231372549019608,1.0,"MsuGreen");\r
- public static readonly Color Mulberry = new Color(0.772549019607843,0.294117647058824,0.549019607843137,1.0,"Mulberry");\r
- public static readonly Color Mustard = new Color(1,0.858823529411765,0.345098039215686,1.0,"Mustard");\r
- public static readonly Color Myrtle = new Color(0.129411764705882,0.258823529411765,0.117647058823529,1.0,"Myrtle");\r
- public static readonly Color NadeshikoPink = new Color(0.964705882352941,0.67843137254902,0.776470588235294,1.0,"NadeshikoPink");\r
- public static readonly Color NapierGreen = new Color(0.164705882352941,0.501960784313725,0,1.0,"NapierGreen");\r
- public static readonly Color NaplesYellow = new Color(0.980392156862745,0.854901960784314,0.368627450980392,1.0,"NaplesYellow");\r
- public static readonly Color NavajoWhite = new Color(1,0.870588235294118,0.67843137254902,1.0,"NavajoWhite");\r
- public static readonly Color NavyBlue = new Color(0,0,0.501960784313725,1.0,"NavyBlue");\r
- public static readonly Color NeonCarrot = new Color(1,0.63921568627451,0.262745098039216,1.0,"NeonCarrot");\r
- public static readonly Color NeonFuchsia = new Color(0.996078431372549,0.254901960784314,0.392156862745098,1.0,"NeonFuchsia");\r
- public static readonly Color NeonGreen = new Color(0.223529411764706,1,0.0784313725490196,1.0,"NeonGreen");\r
- public static readonly Color NewYorkPink = new Color(0.843137254901961,0.513725490196078,0.498039215686275,1.0,"NewYorkPink");\r
- public static readonly Color NonPhotoBlue = new Color(0.643137254901961,0.866666666666667,0.929411764705882,1.0,"NonPhotoBlue");\r
- public static readonly Color NorthTexasGreen = new Color(0.0196078431372549,0.564705882352941,0.2,1.0,"NorthTexasGreen");\r
- public static readonly Color OceanBoatBlue = new Color(0,0.466666666666667,0.745098039215686,1.0,"OceanBoatBlue");\r
- public static readonly Color Ochre = new Color(0.8,0.466666666666667,0.133333333333333,1.0,"Ochre");\r
- public static readonly Color OfficeGreen = new Color(0,0.501960784313725,0,1.0,"OfficeGreen");\r
- public static readonly Color OldGold = new Color(0.811764705882353,0.709803921568627,0.231372549019608,1.0,"OldGold");\r
- public static readonly Color OldLace = new Color(0.992156862745098,0.96078431372549,0.901960784313726,1.0,"OldLace");\r
- public static readonly Color OldLavender = new Color(0.474509803921569,0.407843137254902,0.470588235294118,1.0,"OldLavender");\r
- public static readonly Color OldMauve = new Color(0.403921568627451,0.192156862745098,0.27843137254902,1.0,"OldMauve");\r
- public static readonly Color OldRose = new Color(0.752941176470588,0.501960784313725,0.505882352941176,1.0,"OldRose");\r
- public static readonly Color Olive = new Color(0.501960784313725,0.501960784313725,0,1.0,"Olive");\r
- public static readonly Color OliveDrab7 = new Color(0.235294117647059,0.203921568627451,0.12156862745098,1.0,"OliveDrab7");\r
- public static readonly Color OliveDrabWebOliveDrab3 = new Color(0.419607843137255,0.556862745098039,0.137254901960784,1.0,"OliveDrabWebOliveDrab3");\r
- public static readonly Color Olivine = new Color(0.603921568627451,0.725490196078431,0.450980392156863,1.0,"Olivine");\r
- public static readonly Color Onyx = new Color(0.207843137254902,0.219607843137255,0.223529411764706,1.0,"Onyx");\r
- public static readonly Color OperaMauve = new Color(0.717647058823529,0.517647058823529,0.654901960784314,1.0,"OperaMauve");\r
- public static readonly Color OrangeColorWheel = new Color(1,0.498039215686275,0,1.0,"OrangeColorWheel");\r
- public static readonly Color OrangePeel = new Color(1,0.623529411764706,0,1.0,"OrangePeel");\r
- public static readonly Color OrangeRed = new Color(1,0.270588235294118,0,1.0,"OrangeRed");\r
- public static readonly Color OrangeRyb = new Color(0.984313725490196,0.6,0.00784313725490196,1.0,"OrangeRyb");\r
- public static readonly Color OrangeWebColor = new Color(1,0.647058823529412,0,1.0,"OrangeWebColor");\r
- public static readonly Color Orchid = new Color(0.854901960784314,0.43921568627451,0.83921568627451,1.0,"Orchid");\r
- public static readonly Color OtterBrown = new Color(0.396078431372549,0.262745098039216,0.129411764705882,1.0,"OtterBrown");\r
- public static readonly Color OuCrimsonRed = new Color(0.6,0,0,1.0,"OuCrimsonRed");\r
- public static readonly Color OuterSpace = new Color(0.254901960784314,0.290196078431373,0.298039215686275,1.0,"OuterSpace");\r
- public static readonly Color OutrageousOrange = new Color(1,0.431372549019608,0.290196078431373,1.0,"OutrageousOrange");\r
- public static readonly Color OxfordBlue = new Color(0,0.129411764705882,0.27843137254902,1.0,"OxfordBlue");\r
- public static readonly Color PakistanGreen = new Color(0,0.4,0,1.0,"PakistanGreen");\r
- public static readonly Color PalatinateBlue = new Color(0.152941176470588,0.231372549019608,0.886274509803922,1.0,"PalatinateBlue");\r
- public static readonly Color PalatinatePurple = new Color(0.407843137254902,0.156862745098039,0.376470588235294,1.0,"PalatinatePurple");\r
- public static readonly Color PaleAqua = new Color(0.737254901960784,0.831372549019608,0.901960784313726,1.0,"PaleAqua");\r
- public static readonly Color PaleBlue = new Color(0.686274509803922,0.933333333333333,0.933333333333333,1.0,"PaleBlue");\r
- public static readonly Color PaleBrown = new Color(0.596078431372549,0.462745098039216,0.329411764705882,1.0,"PaleBrown");\r
- public static readonly Color PaleCarmine = new Color(0.686274509803922,0.250980392156863,0.207843137254902,1.0,"PaleCarmine");\r
- public static readonly Color PaleCerulean = new Color(0.607843137254902,0.768627450980392,0.886274509803922,1.0,"PaleCerulean");\r
- public static readonly Color PaleChestnut = new Color(0.866666666666667,0.67843137254902,0.686274509803922,1.0,"PaleChestnut");\r
- public static readonly Color PaleCopper = new Color(0.854901960784314,0.541176470588235,0.403921568627451,1.0,"PaleCopper");\r
- public static readonly Color PaleCornflowerBlue = new Color(0.670588235294118,0.803921568627451,0.937254901960784,1.0,"PaleCornflowerBlue");\r
- public static readonly Color PaleGold = new Color(0.901960784313726,0.745098039215686,0.541176470588235,1.0,"PaleGold");\r
- public static readonly Color PaleGoldenrod = new Color(0.933333333333333,0.909803921568627,0.666666666666667,1.0,"PaleGoldenrod");\r
- public static readonly Color PaleGreen = new Color(0.596078431372549,0.984313725490196,0.596078431372549,1.0,"PaleGreen");\r
- public static readonly Color PaleLavender = new Color(0.862745098039216,0.815686274509804,1,1.0,"PaleLavender");\r
- public static readonly Color PaleMagenta = new Color(0.976470588235294,0.517647058823529,0.898039215686275,1.0,"PaleMagenta");\r
- public static readonly Color PalePink = new Color(0.980392156862745,0.854901960784314,0.866666666666667,1.0,"PalePink");\r
- public static readonly Color PalePlum = new Color(0.866666666666667,0.627450980392157,0.866666666666667,1.0,"PalePlum");\r
- public static readonly Color PaleRedViolet = new Color(0.858823529411765,0.43921568627451,0.576470588235294,1.0,"PaleRedViolet");\r
- public static readonly Color PaleRobinEggBlue = new Color(0.588235294117647,0.870588235294118,0.819607843137255,1.0,"PaleRobinEggBlue");\r
- public static readonly Color PaleSilver = new Color(0.788235294117647,0.752941176470588,0.733333333333333,1.0,"PaleSilver");\r
- public static readonly Color PaleSpringBud = new Color(0.925490196078431,0.92156862745098,0.741176470588235,1.0,"PaleSpringBud");\r
- public static readonly Color PaleTaupe = new Color(0.737254901960784,0.596078431372549,0.494117647058824,1.0,"PaleTaupe");\r
- public static readonly Color PaleVioletRed = new Color(0.858823529411765,0.43921568627451,0.576470588235294,1.0,"PaleVioletRed");\r
- public static readonly Color PansyPurple = new Color(0.470588235294118,0.0941176470588235,0.290196078431373,1.0,"PansyPurple");\r
- public static readonly Color PapayaWhip = new Color(1,0.937254901960784,0.835294117647059,1.0,"PapayaWhip");\r
- public static readonly Color ParisGreen = new Color(0.313725490196078,0.784313725490196,0.470588235294118,1.0,"ParisGreen");\r
- public static readonly Color PastelBlue = new Color(0.682352941176471,0.776470588235294,0.811764705882353,1.0,"PastelBlue");\r
- public static readonly Color PastelBrown = new Color(0.513725490196078,0.411764705882353,0.325490196078431,1.0,"PastelBrown");\r
- public static readonly Color PastelGray = new Color(0.811764705882353,0.811764705882353,0.768627450980392,1.0,"PastelGray");\r
- public static readonly Color PastelGreen = new Color(0.466666666666667,0.866666666666667,0.466666666666667,1.0,"PastelGreen");\r
- public static readonly Color PastelMagenta = new Color(0.956862745098039,0.603921568627451,0.76078431372549,1.0,"PastelMagenta");\r
- public static readonly Color PastelOrange = new Color(1,0.701960784313725,0.27843137254902,1.0,"PastelOrange");\r
- public static readonly Color PastelPink = new Color(0.870588235294118,0.647058823529412,0.643137254901961,1.0,"PastelPink");\r
- public static readonly Color PastelPurple = new Color(0.701960784313725,0.619607843137255,0.709803921568627,1.0,"PastelPurple");\r
- public static readonly Color PastelRed = new Color(1,0.411764705882353,0.380392156862745,1.0,"PastelRed");\r
- public static readonly Color PastelViolet = new Color(0.796078431372549,0.6,0.788235294117647,1.0,"PastelViolet");\r
- public static readonly Color PastelYellow = new Color(0.992156862745098,0.992156862745098,0.588235294117647,1.0,"PastelYellow");\r
- public static readonly Color Patriarch = new Color(0.501960784313725,0,0.501960784313725,1.0,"Patriarch");\r
- public static readonly Color PayneSGrey = new Color(0.325490196078431,0.407843137254902,0.470588235294118,1.0,"PayneSGrey");\r
- public static readonly Color Peach = new Color(1,0.898039215686275,0.705882352941177,1.0,"Peach");\r
- public static readonly Color PeachCrayola = new Color(1,0.796078431372549,0.643137254901961,1.0,"PeachCrayola");\r
- public static readonly Color PeachOrange = new Color(1,0.8,0.6,1.0,"PeachOrange");\r
- public static readonly Color PeachPuff = new Color(1,0.854901960784314,0.725490196078431,1.0,"PeachPuff");\r
- public static readonly Color PeachYellow = new Color(0.980392156862745,0.874509803921569,0.67843137254902,1.0,"PeachYellow");\r
- public static readonly Color Pear = new Color(0.819607843137255,0.886274509803922,0.192156862745098,1.0,"Pear");\r
- public static readonly Color Pearl = new Color(0.917647058823529,0.87843137254902,0.784313725490196,1.0,"Pearl");\r
- public static readonly Color PearlAqua = new Color(0.533333333333333,0.847058823529412,0.752941176470588,1.0,"PearlAqua");\r
- public static readonly Color PearlyPurple = new Color(0.717647058823529,0.407843137254902,0.635294117647059,1.0,"PearlyPurple");\r
- public static readonly Color Peridot = new Color(0.901960784313726,0.886274509803922,0,1.0,"Peridot");\r
- public static readonly Color Periwinkle = new Color(0.8,0.8,1,1.0,"Periwinkle");\r
- public static readonly Color PersianBlue = new Color(0.109803921568627,0.223529411764706,0.733333333333333,1.0,"PersianBlue");\r
- public static readonly Color PersianGreen = new Color(0,0.650980392156863,0.576470588235294,1.0,"PersianGreen");\r
- public static readonly Color PersianIndigo = new Color(0.196078431372549,0.0705882352941176,0.47843137254902,1.0,"PersianIndigo");\r
- public static readonly Color PersianOrange = new Color(0.850980392156863,0.564705882352941,0.345098039215686,1.0,"PersianOrange");\r
- public static readonly Color PersianPink = new Color(0.968627450980392,0.498039215686275,0.745098039215686,1.0,"PersianPink");\r
- public static readonly Color PersianPlum = new Color(0.43921568627451,0.109803921568627,0.109803921568627,1.0,"PersianPlum");\r
- public static readonly Color PersianRed = new Color(0.8,0.2,0.2,1.0,"PersianRed");\r
- public static readonly Color PersianRose = new Color(0.996078431372549,0.156862745098039,0.635294117647059,1.0,"PersianRose");\r
- public static readonly Color Persimmon = new Color(0.925490196078431,0.345098039215686,0,1.0,"Persimmon");\r
- public static readonly Color Peru = new Color(0.803921568627451,0.52156862745098,0.247058823529412,1.0,"Peru");\r
- public static readonly Color Phlox = new Color(0.874509803921569,0,1,1.0,"Phlox");\r
- public static readonly Color PhthaloBlue = new Color(0,0.0588235294117647,0.537254901960784,1.0,"PhthaloBlue");\r
- public static readonly Color PhthaloGreen = new Color(0.0705882352941176,0.207843137254902,0.141176470588235,1.0,"PhthaloGreen");\r
- public static readonly Color PiggyPink = new Color(0.992156862745098,0.866666666666667,0.901960784313726,1.0,"PiggyPink");\r
- public static readonly Color PineGreen = new Color(0.00392156862745098,0.474509803921569,0.435294117647059,1.0,"PineGreen");\r
- public static readonly Color Pink = new Color(1,0.752941176470588,0.796078431372549,1.0,"Pink");\r
- public static readonly Color PinkLace = new Color(1,0.866666666666667,0.956862745098039,1.0,"PinkLace");\r
- public static readonly Color PinkOrange = new Color(1,0.6,0.4,1.0,"PinkOrange");\r
- public static readonly Color PinkPearl = new Color(0.905882352941176,0.674509803921569,0.811764705882353,1.0,"PinkPearl");\r
- public static readonly Color PinkSherbet = new Color(0.968627450980392,0.56078431372549,0.654901960784314,1.0,"PinkSherbet");\r
- public static readonly Color Pistachio = new Color(0.576470588235294,0.772549019607843,0.447058823529412,1.0,"Pistachio");\r
- public static readonly Color Platinum = new Color(0.898039215686275,0.894117647058824,0.886274509803922,1.0,"Platinum");\r
- public static readonly Color PlumTraditional = new Color(0.556862745098039,0.270588235294118,0.52156862745098,1.0,"PlumTraditional");\r
- public static readonly Color PlumWeb = new Color(0.866666666666667,0.627450980392157,0.866666666666667,1.0,"PlumWeb");\r
- public static readonly Color PortlandOrange = new Color(1,0.352941176470588,0.211764705882353,1.0,"PortlandOrange");\r
- public static readonly Color PowderBlueWeb = new Color(0.690196078431373,0.87843137254902,0.901960784313726,1.0,"PowderBlueWeb");\r
- public static readonly Color PrincetonOrange = new Color(1,0.56078431372549,0,1.0,"PrincetonOrange");\r
- public static readonly Color Prune = new Color(0.43921568627451,0.109803921568627,0.109803921568627,1.0,"Prune");\r
- public static readonly Color PrussianBlue = new Color(0,0.192156862745098,0.325490196078431,1.0,"PrussianBlue");\r
- public static readonly Color PsychedelicPurple = new Color(0.874509803921569,0,1,1.0,"PsychedelicPurple");\r
- public static readonly Color Puce = new Color(0.8,0.533333333333333,0.6,1.0,"Puce");\r
- public static readonly Color Pumpkin = new Color(1,0.458823529411765,0.0941176470588235,1.0,"Pumpkin");\r
- public static readonly Color PurpleHeart = new Color(0.411764705882353,0.207843137254902,0.611764705882353,1.0,"PurpleHeart");\r
- public static readonly Color PurpleHtmlCss = new Color(0.501960784313725,0,0.501960784313725,1.0,"PurpleHtmlCss");\r
- public static readonly Color PurpleMountainMajesty = new Color(0.588235294117647,0.470588235294118,0.713725490196078,1.0,"PurpleMountainMajesty");\r
- public static readonly Color PurpleMunsell = new Color(0.623529411764706,0,0.772549019607843,1.0,"PurpleMunsell");\r
- public static readonly Color PurplePizzazz = new Color(0.996078431372549,0.305882352941176,0.854901960784314,1.0,"PurplePizzazz");\r
- public static readonly Color PurpleTaupe = new Color(0.313725490196078,0.250980392156863,0.301960784313725,1.0,"PurpleTaupe");\r
- public static readonly Color PurpleX11 = new Color(0.627450980392157,0.125490196078431,0.941176470588235,1.0,"PurpleX11");\r
- public static readonly Color Quartz = new Color(0.317647058823529,0.282352941176471,0.309803921568627,1.0,"Quartz");\r
- public static readonly Color Rackley = new Color(0.364705882352941,0.541176470588235,0.658823529411765,1.0,"Rackley");\r
- public static readonly Color RadicalRed = new Color(1,0.207843137254902,0.368627450980392,1.0,"RadicalRed");\r
- public static readonly Color Rajah = new Color(0.984313725490196,0.670588235294118,0.376470588235294,1.0,"Rajah");\r
- public static readonly Color Raspberry = new Color(0.890196078431373,0.0431372549019608,0.364705882352941,1.0,"Raspberry");\r
- public static readonly Color RaspberryGlace = new Color(0.568627450980392,0.372549019607843,0.427450980392157,1.0,"RaspberryGlace");\r
- public static readonly Color RaspberryPink = new Color(0.886274509803922,0.313725490196078,0.596078431372549,1.0,"RaspberryPink");\r
- public static readonly Color RaspberryRose = new Color(0.701960784313725,0.266666666666667,0.423529411764706,1.0,"RaspberryRose");\r
- public static readonly Color RawUmber = new Color(0.509803921568627,0.4,0.266666666666667,1.0,"RawUmber");\r
- public static readonly Color RazzleDazzleRose = new Color(1,0.2,0.8,1.0,"RazzleDazzleRose");\r
- public static readonly Color Razzmatazz = new Color(0.890196078431373,0.145098039215686,0.419607843137255,1.0,"Razzmatazz");\r
- public static readonly Color Red = new Color(1,0,0,1.0,"Red");\r
- public static readonly Color RedBrown = new Color(0.647058823529412,0.164705882352941,0.164705882352941,1.0,"RedBrown");\r
- public static readonly Color RedDevil = new Color(0.525490196078431,0.00392156862745098,0.0666666666666667,1.0,"RedDevil");\r
- public static readonly Color RedMunsell = new Color(0.949019607843137,0,0.235294117647059,1.0,"RedMunsell");\r
- public static readonly Color RedNcs = new Color(0.768627450980392,0.00784313725490196,0.2,1.0,"RedNcs");\r
- public static readonly Color RedOrange = new Color(1,0.325490196078431,0.286274509803922,1.0,"RedOrange");\r
- public static readonly Color RedPigment = new Color(0.929411764705882,0.109803921568627,0.141176470588235,1.0,"RedPigment");\r
- public static readonly Color RedRyb = new Color(0.996078431372549,0.152941176470588,0.0705882352941176,1.0,"RedRyb");\r
- public static readonly Color RedViolet = new Color(0.780392156862745,0.0823529411764706,0.52156862745098,1.0,"RedViolet");\r
- public static readonly Color Redwood = new Color(0.670588235294118,0.305882352941176,0.32156862745098,1.0,"Redwood");\r
- public static readonly Color Regalia = new Color(0.32156862745098,0.176470588235294,0.501960784313725,1.0,"Regalia");\r
- public static readonly Color ResolutionBlue = new Color(0,0.137254901960784,0.529411764705882,1.0,"ResolutionBlue");\r
- public static readonly Color RichBlack = new Color(0,0.250980392156863,0.250980392156863,1.0,"RichBlack");\r
- public static readonly Color RichBrilliantLavender = new Color(0.945098039215686,0.654901960784314,0.996078431372549,1.0,"RichBrilliantLavender");\r
- public static readonly Color RichCarmine = new Color(0.843137254901961,0,0.250980392156863,1.0,"RichCarmine");\r
- public static readonly Color RichElectricBlue = new Color(0.0313725490196078,0.572549019607843,0.815686274509804,1.0,"RichElectricBlue");\r
- public static readonly Color RichLavender = new Color(0.654901960784314,0.419607843137255,0.811764705882353,1.0,"RichLavender");\r
- public static readonly Color RichLilac = new Color(0.713725490196078,0.4,0.823529411764706,1.0,"RichLilac");\r
- public static readonly Color RichMaroon = new Color(0.690196078431373,0.188235294117647,0.376470588235294,1.0,"RichMaroon");\r
- public static readonly Color RifleGreen = new Color(0.254901960784314,0.282352941176471,0.2,1.0,"RifleGreen");\r
- public static readonly Color RobinEggBlue = new Color(0,0.8,0.8,1.0,"RobinEggBlue");\r
- public static readonly Color Rose = new Color(1,0,0.498039215686275,1.0,"Rose");\r
- public static readonly Color RoseBonbon = new Color(0.976470588235294,0.258823529411765,0.619607843137255,1.0,"RoseBonbon");\r
- public static readonly Color RoseEbony = new Color(0.403921568627451,0.282352941176471,0.274509803921569,1.0,"RoseEbony");\r
- public static readonly Color RoseGold = new Color(0.717647058823529,0.431372549019608,0.474509803921569,1.0,"RoseGold");\r
- public static readonly Color RoseMadder = new Color(0.890196078431373,0.149019607843137,0.211764705882353,1.0,"RoseMadder");\r
- public static readonly Color RosePink = new Color(1,0.4,0.8,1.0,"RosePink");\r
- public static readonly Color RoseQuartz = new Color(0.666666666666667,0.596078431372549,0.662745098039216,1.0,"RoseQuartz");\r
- public static readonly Color RoseTaupe = new Color(0.564705882352941,0.364705882352941,0.364705882352941,1.0,"RoseTaupe");\r
- public static readonly Color RoseVale = new Color(0.670588235294118,0.305882352941176,0.32156862745098,1.0,"RoseVale");\r
- public static readonly Color Rosewood = new Color(0.396078431372549,0,0.0431372549019608,1.0,"Rosewood");\r
- public static readonly Color RossoCorsa = new Color(0.831372549019608,0,0,1.0,"RossoCorsa");\r
- public static readonly Color RosyBrown = new Color(0.737254901960784,0.56078431372549,0.56078431372549,1.0,"RosyBrown");\r
- public static readonly Color RoyalAzure = new Color(0,0.219607843137255,0.658823529411765,1.0,"RoyalAzure");\r
- public static readonly Color RoyalBlueTraditional = new Color(0,0.137254901960784,0.4,1.0,"RoyalBlueTraditional");\r
- public static readonly Color RoyalBlueWeb = new Color(0.254901960784314,0.411764705882353,0.882352941176471,1.0,"RoyalBlueWeb");\r
- public static readonly Color RoyalFuchsia = new Color(0.792156862745098,0.172549019607843,0.572549019607843,1.0,"RoyalFuchsia");\r
- public static readonly Color RoyalPurple = new Color(0.470588235294118,0.317647058823529,0.662745098039216,1.0,"RoyalPurple");\r
- public static readonly Color RoyalYellow = new Color(0.980392156862745,0.854901960784314,0.368627450980392,1.0,"RoyalYellow");\r
- public static readonly Color RubineRed = new Color(0.819607843137255,0,0.337254901960784,1.0,"RubineRed");\r
- public static readonly Color Ruby = new Color(0.87843137254902,0.0666666666666667,0.372549019607843,1.0,"Ruby");\r
- public static readonly Color RubyRed = new Color(0.607843137254902,0.0666666666666667,0.117647058823529,1.0,"RubyRed");\r
- public static readonly Color Ruddy = new Color(1,0,0.156862745098039,1.0,"Ruddy");\r
- public static readonly Color RuddyBrown = new Color(0.733333333333333,0.396078431372549,0.156862745098039,1.0,"RuddyBrown");\r
- public static readonly Color RuddyPink = new Color(0.882352941176471,0.556862745098039,0.588235294117647,1.0,"RuddyPink");\r
- public static readonly Color Rufous = new Color(0.658823529411765,0.109803921568627,0.0274509803921569,1.0,"Rufous");\r
- public static readonly Color Russet = new Color(0.501960784313725,0.274509803921569,0.105882352941176,1.0,"Russet");\r
- public static readonly Color Rust = new Color(0.717647058823529,0.254901960784314,0.0549019607843137,1.0,"Rust");\r
- public static readonly Color RustyRed = new Color(0.854901960784314,0.172549019607843,0.262745098039216,1.0,"RustyRed");\r
- public static readonly Color SacramentoStateGreen = new Color(0,0.337254901960784,0.247058823529412,1.0,"SacramentoStateGreen");\r
- public static readonly Color SaddleBrown = new Color(0.545098039215686,0.270588235294118,0.0745098039215686,1.0,"SaddleBrown");\r
- public static readonly Color SafetyOrangeBlazeOrange = new Color(1,0.403921568627451,0,1.0,"SafetyOrangeBlazeOrange");\r
- public static readonly Color Saffron = new Color(0.956862745098039,0.768627450980392,0.188235294117647,1.0,"Saffron");\r
- public static readonly Color Salmon = new Color(1,0.549019607843137,0.411764705882353,1.0,"Salmon");\r
- public static readonly Color SalmonPink = new Color(1,0.568627450980392,0.643137254901961,1.0,"SalmonPink");\r
- public static readonly Color Sand = new Color(0.76078431372549,0.698039215686274,0.501960784313725,1.0,"Sand");\r
- public static readonly Color SandDune = new Color(0.588235294117647,0.443137254901961,0.0901960784313725,1.0,"SandDune");\r
- public static readonly Color Sandstorm = new Color(0.925490196078431,0.835294117647059,0.250980392156863,1.0,"Sandstorm");\r
- public static readonly Color SandyBrown = new Color(0.956862745098039,0.643137254901961,0.376470588235294,1.0,"SandyBrown");\r
- public static readonly Color SandyTaupe = new Color(0.588235294117647,0.443137254901961,0.0901960784313725,1.0,"SandyTaupe");\r
- public static readonly Color Sangria = new Color(0.572549019607843,0,0.0392156862745098,1.0,"Sangria");\r
- public static readonly Color SapGreen = new Color(0.313725490196078,0.490196078431373,0.164705882352941,1.0,"SapGreen");\r
- public static readonly Color Sapphire = new Color(0.0588235294117647,0.32156862745098,0.729411764705882,1.0,"Sapphire");\r
- public static readonly Color SapphireBlue = new Color(0,0.403921568627451,0.647058823529412,1.0,"SapphireBlue");\r
- public static readonly Color SatinSheenGold = new Color(0.796078431372549,0.631372549019608,0.207843137254902,1.0,"SatinSheenGold");\r
- public static readonly Color Scarlet = new Color(1,0.141176470588235,0,1.0,"Scarlet");\r
- public static readonly Color ScarletCrayola = new Color(0.992156862745098,0.0549019607843137,0.207843137254902,1.0,"ScarletCrayola");\r
- public static readonly Color SchoolBusYellow = new Color(1,0.847058823529412,0,1.0,"SchoolBusYellow");\r
- public static readonly Color ScreaminGreen = new Color(0.462745098039216,1,0.47843137254902,1.0,"ScreaminGreen");\r
- public static readonly Color SeaBlue = new Color(0,0.411764705882353,0.580392156862745,1.0,"SeaBlue");\r
- public static readonly Color SeaGreen = new Color(0.180392156862745,0.545098039215686,0.341176470588235,1.0,"SeaGreen");\r
- public static readonly Color SealBrown = new Color(0.196078431372549,0.0784313725490196,0.0784313725490196,1.0,"SealBrown");\r
- public static readonly Color Seashell = new Color(1,0.96078431372549,0.933333333333333,1.0,"Seashell");\r
- public static readonly Color SelectiveYellow = new Color(1,0.729411764705882,0,1.0,"SelectiveYellow");\r
- public static readonly Color Sepia = new Color(0.43921568627451,0.258823529411765,0.0784313725490196,1.0,"Sepia");\r
- public static readonly Color Shadow = new Color(0.541176470588235,0.474509803921569,0.364705882352941,1.0,"Shadow");\r
- public static readonly Color ShamrockGreen = new Color(0,0.619607843137255,0.376470588235294,1.0,"ShamrockGreen");\r
- public static readonly Color ShockingPink = new Color(0.988235294117647,0.0588235294117647,0.752941176470588,1.0,"ShockingPink");\r
- public static readonly Color ShockingPinkCrayola = new Color(1,0.435294117647059,1,1.0,"ShockingPinkCrayola");\r
- public static readonly Color Sienna = new Color(0.533333333333333,0.176470588235294,0.0901960784313725,1.0,"Sienna");\r
- public static readonly Color Silver = new Color(0.752941176470588,0.752941176470588,0.752941176470588,1.0,"Silver");\r
- public static readonly Color Sinopia = new Color(0.796078431372549,0.254901960784314,0.0431372549019608,1.0,"Sinopia");\r
- public static readonly Color Skobeloff = new Color(0,0.454901960784314,0.454901960784314,1.0,"Skobeloff");\r
- public static readonly Color SkyBlue = new Color(0.529411764705882,0.807843137254902,0.92156862745098,1.0,"SkyBlue");\r
- public static readonly Color SkyMagenta = new Color(0.811764705882353,0.443137254901961,0.686274509803922,1.0,"SkyMagenta");\r
- public static readonly Color SlateBlue = new Color(0.415686274509804,0.352941176470588,0.803921568627451,1.0,"SlateBlue");\r
- public static readonly Color SlateGray = new Color(0.43921568627451,0.501960784313725,0.564705882352941,1.0,"SlateGray");\r
- public static readonly Color SmaltDarkPowderBlue = new Color(0,0.2,0.6,1.0,"SmaltDarkPowderBlue");\r
- public static readonly Color SmokeyTopaz = new Color(0.576470588235294,0.23921568627451,0.254901960784314,1.0,"SmokeyTopaz");\r
- public static readonly Color SmokyBlack = new Color(0.0627450980392157,0.0470588235294118,0.0313725490196078,1.0,"SmokyBlack");\r
- public static readonly Color Snow = new Color(1,0.980392156862745,0.980392156862745,1.0,"Snow");\r
- public static readonly Color SpiroDiscoBall = new Color(0.0588235294117647,0.752941176470588,0.988235294117647,1.0,"SpiroDiscoBall");\r
- public static readonly Color SpringBud = new Color(0.654901960784314,0.988235294117647,0,1.0,"SpringBud");\r
- public static readonly Color SpringGreen = new Color(0,1,0.498039215686275,1.0,"SpringGreen");\r
- public static readonly Color StPatrickSBlue = new Color(0.137254901960784,0.16078431372549,0.47843137254902,1.0,"StPatrickSBlue");\r
- public static readonly Color SteelBlue = new Color(0.274509803921569,0.509803921568627,0.705882352941177,1.0,"SteelBlue");\r
- public static readonly Color StilDeGrainYellow = new Color(0.980392156862745,0.854901960784314,0.368627450980392,1.0,"StilDeGrainYellow");\r
- public static readonly Color Stizza = new Color(0.6,0,0,1.0,"Stizza");\r
- public static readonly Color Stormcloud = new Color(0.309803921568627,0.4,0.415686274509804,1.0,"Stormcloud");\r
- public static readonly Color Straw = new Color(0.894117647058824,0.850980392156863,0.435294117647059,1.0,"Straw");\r
- public static readonly Color Sunglow = new Color(1,0.8,0.2,1.0,"Sunglow");\r
- public static readonly Color Sunset = new Color(0.980392156862745,0.83921568627451,0.647058823529412,1.0,"Sunset");\r
- public static readonly Color Tan = new Color(0.823529411764706,0.705882352941177,0.549019607843137,1.0,"Tan");\r
- public static readonly Color Tangelo = new Color(0.976470588235294,0.301960784313725,0,1.0,"Tangelo");\r
- public static readonly Color Tangerine = new Color(0.949019607843137,0.52156862745098,0,1.0,"Tangerine");\r
- public static readonly Color TangerineYellow = new Color(1,0.8,0,1.0,"TangerineYellow");\r
- public static readonly Color TangoPink = new Color(0.894117647058824,0.443137254901961,0.47843137254902,1.0,"TangoPink");\r
- public static readonly Color Taupe = new Color(0.282352941176471,0.235294117647059,0.196078431372549,1.0,"Taupe");\r
- public static readonly Color TaupeGray = new Color(0.545098039215686,0.52156862745098,0.537254901960784,1.0,"TaupeGray");\r
- public static readonly Color TeaGreen = new Color(0.815686274509804,0.941176470588235,0.752941176470588,1.0,"TeaGreen");\r
- public static readonly Color TeaRoseOrange = new Color(0.972549019607843,0.513725490196078,0.474509803921569,1.0,"TeaRoseOrange");\r
- public static readonly Color TeaRoseRose = new Color(0.956862745098039,0.76078431372549,0.76078431372549,1.0,"TeaRoseRose");\r
- public static readonly Color Teal = new Color(0,0.501960784313725,0.501960784313725,1.0,"Teal");\r
- public static readonly Color TealBlue = new Color(0.211764705882353,0.458823529411765,0.533333333333333,1.0,"TealBlue");\r
- public static readonly Color TealGreen = new Color(0,0.509803921568627,0.498039215686275,1.0,"TealGreen");\r
- public static readonly Color Telemagenta = new Color(0.811764705882353,0.203921568627451,0.462745098039216,1.0,"Telemagenta");\r
- public static readonly Color TennTawny = new Color(0.803921568627451,0.341176470588235,0,1.0,"TennTawny");\r
- public static readonly Color TerraCotta = new Color(0.886274509803922,0.447058823529412,0.356862745098039,1.0,"TerraCotta");\r
- public static readonly Color Thistle = new Color(0.847058823529412,0.749019607843137,0.847058823529412,1.0,"Thistle");\r
- public static readonly Color ThulianPink = new Color(0.870588235294118,0.435294117647059,0.631372549019608,1.0,"ThulianPink");\r
- public static readonly Color TickleMePink = new Color(0.988235294117647,0.537254901960784,0.674509803921569,1.0,"TickleMePink");\r
- public static readonly Color TiffanyBlue = new Color(0.0392156862745098,0.729411764705882,0.709803921568627,1.0,"TiffanyBlue");\r
- public static readonly Color TigerSEye = new Color(0.87843137254902,0.552941176470588,0.235294117647059,1.0,"TigerSEye");\r
- public static readonly Color Timberwolf = new Color(0.858823529411765,0.843137254901961,0.823529411764706,1.0,"Timberwolf");\r
- public static readonly Color TitaniumYellow = new Color(0.933333333333333,0.901960784313726,0,1.0,"TitaniumYellow");\r
- public static readonly Color Tomato = new Color(1,0.388235294117647,0.27843137254902,1.0,"Tomato");\r
- public static readonly Color Toolbox = new Color(0.454901960784314,0.423529411764706,0.752941176470588,1.0,"Toolbox");\r
- public static readonly Color Topaz = new Color(1,0.784313725490196,0.486274509803922,1.0,"Topaz");\r
- public static readonly Color TractorRed = new Color(0.992156862745098,0.0549019607843137,0.207843137254902,1.0,"TractorRed");\r
- public static readonly Color TrolleyGrey = new Color(0.501960784313725,0.501960784313725,0.501960784313725,1.0,"TrolleyGrey");\r
- public static readonly Color TropicalRainForest = new Color(0,0.458823529411765,0.368627450980392,1.0,"TropicalRainForest");\r
- public static readonly Color TrueBlue = new Color(0,0.450980392156863,0.811764705882353,1.0,"TrueBlue");\r
- public static readonly Color TuftsBlue = new Color(0.254901960784314,0.490196078431373,0.756862745098039,1.0,"TuftsBlue");\r
- public static readonly Color Tumbleweed = new Color(0.870588235294118,0.666666666666667,0.533333333333333,1.0,"Tumbleweed");\r
- public static readonly Color TurkishRose = new Color(0.709803921568627,0.447058823529412,0.505882352941176,1.0,"TurkishRose");\r
- public static readonly Color Turquoise = new Color(0.188235294117647,0.835294117647059,0.784313725490196,1.0,"Turquoise");\r
- public static readonly Color TurquoiseBlue = new Color(0,1,0.937254901960784,1.0,"TurquoiseBlue");\r
- public static readonly Color TurquoiseGreen = new Color(0.627450980392157,0.83921568627451,0.705882352941177,1.0,"TurquoiseGreen");\r
- public static readonly Color TuscanRed = new Color(0.486274509803922,0.282352941176471,0.282352941176471,1.0,"TuscanRed");\r
- public static readonly Color TwilightLavender = new Color(0.541176470588235,0.286274509803922,0.419607843137255,1.0,"TwilightLavender");\r
- public static readonly Color TyrianPurple = new Color(0.4,0.00784313725490196,0.235294117647059,1.0,"TyrianPurple");\r
- public static readonly Color UaBlue = new Color(0,0.2,0.666666666666667,1.0,"UaBlue");\r
- public static readonly Color UaRed = new Color(0.850980392156863,0,0.298039215686275,1.0,"UaRed");\r
- public static readonly Color Ube = new Color(0.533333333333333,0.470588235294118,0.764705882352941,1.0,"Ube");\r
- public static readonly Color UclaBlue = new Color(0.325490196078431,0.407843137254902,0.584313725490196,1.0,"UclaBlue");\r
- public static readonly Color UclaGold = new Color(1,0.701960784313725,0,1.0,"UclaGold");\r
- public static readonly Color UfoGreen = new Color(0.235294117647059,0.815686274509804,0.43921568627451,1.0,"UfoGreen");\r
- public static readonly Color UltraPink = new Color(1,0.435294117647059,1,1.0,"UltraPink");\r
- public static readonly Color Ultramarine = new Color(0.0705882352941176,0.0392156862745098,0.56078431372549,1.0,"Ultramarine");\r
- public static readonly Color UltramarineBlue = new Color(0.254901960784314,0.4,0.96078431372549,1.0,"UltramarineBlue");\r
- public static readonly Color Umber = new Color(0.388235294117647,0.317647058823529,0.27843137254902,1.0,"Umber");\r
- public static readonly Color UnbleachedSilk = new Color(1,0.866666666666667,0.792156862745098,1.0,"UnbleachedSilk");\r
- public static readonly Color UnitedNationsBlue = new Color(0.356862745098039,0.572549019607843,0.898039215686275,1.0,"UnitedNationsBlue");\r
- public static readonly Color UniversityOfCaliforniaGold = new Color(0.717647058823529,0.529411764705882,0.152941176470588,1.0,"UniversityOfCaliforniaGold");\r
- public static readonly Color UnmellowYellow = new Color(1,1,0.4,1.0,"UnmellowYellow");\r
- public static readonly Color UpForestGreen = new Color(0.00392156862745098,0.266666666666667,0.129411764705882,1.0,"UpForestGreen");\r
- public static readonly Color UpMaroon = new Color(0.482352941176471,0.0666666666666667,0.0745098039215686,1.0,"UpMaroon");\r
- public static readonly Color UpsdellRed = new Color(0.682352941176471,0.125490196078431,0.16078431372549,1.0,"UpsdellRed");\r
- public static readonly Color Urobilin = new Color(0.882352941176471,0.67843137254902,0.129411764705882,1.0,"Urobilin");\r
- public static readonly Color UsafaBlue = new Color(0,0.309803921568627,0.596078431372549,1.0,"UsafaBlue");\r
- public static readonly Color UscCardinal = new Color(0.6,0,0,1.0,"UscCardinal");\r
- public static readonly Color UscGold = new Color(1,0.8,0,1.0,"UscGold");\r
- public static readonly Color UtahCrimson = new Color(0.827450980392157,0,0.247058823529412,1.0,"UtahCrimson");\r
- public static readonly Color Vanilla = new Color(0.952941176470588,0.898039215686275,0.670588235294118,1.0,"Vanilla");\r
- public static readonly Color VegasGold = new Color(0.772549019607843,0.701960784313725,0.345098039215686,1.0,"VegasGold");\r
- public static readonly Color VenetianRed = new Color(0.784313725490196,0.0313725490196078,0.0823529411764706,1.0,"VenetianRed");\r
- public static readonly Color Verdigris = new Color(0.262745098039216,0.701960784313725,0.682352941176471,1.0,"Verdigris");\r
- public static readonly Color VermilionCinnabar = new Color(0.890196078431373,0.258823529411765,0.203921568627451,1.0,"VermilionCinnabar");\r
- public static readonly Color VermilionPlochere = new Color(0.850980392156863,0.376470588235294,0.231372549019608,1.0,"VermilionPlochere");\r
- public static readonly Color Veronica = new Color(0.627450980392157,0.125490196078431,0.941176470588235,1.0,"Veronica");\r
- public static readonly Color Violet = new Color(0.56078431372549,0,1,1.0,"Violet");\r
- public static readonly Color VioletBlue = new Color(0.196078431372549,0.290196078431373,0.698039215686274,1.0,"VioletBlue");\r
- public static readonly Color VioletColorWheel = new Color(0.498039215686275,0,1,1.0,"VioletColorWheel");\r
- public static readonly Color VioletRyb = new Color(0.525490196078431,0.00392156862745098,0.686274509803922,1.0,"VioletRyb");\r
- public static readonly Color VioletWeb = new Color(0.933333333333333,0.509803921568627,0.933333333333333,1.0,"VioletWeb");\r
- public static readonly Color Viridian = new Color(0.250980392156863,0.509803921568627,0.427450980392157,1.0,"Viridian");\r
- public static readonly Color VividAuburn = new Color(0.572549019607843,0.152941176470588,0.141176470588235,1.0,"VividAuburn");\r
- public static readonly Color VividBurgundy = new Color(0.623529411764706,0.113725490196078,0.207843137254902,1.0,"VividBurgundy");\r
- public static readonly Color VividCerise = new Color(0.854901960784314,0.113725490196078,0.505882352941176,1.0,"VividCerise");\r
- public static readonly Color VividTangerine = new Color(1,0.627450980392157,0.537254901960784,1.0,"VividTangerine");\r
- public static readonly Color VividViolet = new Color(0.623529411764706,0,1,1.0,"VividViolet");\r
- public static readonly Color WarmBlack = new Color(0,0.258823529411765,0.258823529411765,1.0,"WarmBlack");\r
- public static readonly Color Waterspout = new Color(0.643137254901961,0.956862745098039,0.976470588235294,1.0,"Waterspout");\r
- public static readonly Color Wenge = new Color(0.392156862745098,0.329411764705882,0.32156862745098,1.0,"Wenge");\r
- public static readonly Color Wheat = new Color(0.96078431372549,0.870588235294118,0.701960784313725,1.0,"Wheat");\r
- public static readonly Color White = new Color(1,1,1,1.0,"White");\r
- public static readonly Color WhiteSmoke = new Color(0.96078431372549,0.96078431372549,0.96078431372549,1.0,"WhiteSmoke");\r
- public static readonly Color WildBlueYonder = new Color(0.635294117647059,0.67843137254902,0.815686274509804,1.0,"WildBlueYonder");\r
- public static readonly Color WildStrawberry = new Color(1,0.262745098039216,0.643137254901961,1.0,"WildStrawberry");\r
- public static readonly Color WildWatermelon = new Color(0.988235294117647,0.423529411764706,0.52156862745098,1.0,"WildWatermelon");\r
- public static readonly Color Wine = new Color(0.447058823529412,0.184313725490196,0.215686274509804,1.0,"Wine");\r
- public static readonly Color WineDregs = new Color(0.403921568627451,0.192156862745098,0.27843137254902,1.0,"WineDregs");\r
- public static readonly Color Wisteria = new Color(0.788235294117647,0.627450980392157,0.862745098039216,1.0,"Wisteria");\r
- public static readonly Color WoodBrown = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"WoodBrown");\r
- public static readonly Color Xanadu = new Color(0.450980392156863,0.525490196078431,0.470588235294118,1.0,"Xanadu");\r
- public static readonly Color YaleBlue = new Color(0.0588235294117647,0.301960784313725,0.572549019607843,1.0,"YaleBlue");\r
- public static readonly Color Yellow = new Color(1,1,0,1.0,"Yellow");\r
- public static readonly Color YellowGreen = new Color(0.603921568627451,0.803921568627451,0.196078431372549,1.0,"YellowGreen");\r
- public static readonly Color YellowMunsell = new Color(0.937254901960784,0.8,0,1.0,"YellowMunsell");\r
- public static readonly Color YellowNcs = new Color(1,0.827450980392157,0,1.0,"YellowNcs");\r
- public static readonly Color YellowOrange = new Color(1,0.682352941176471,0.258823529411765,1.0,"YellowOrange");\r
- public static readonly Color YellowProcess = new Color(1,0.937254901960784,0,1.0,"YellowProcess");\r
- public static readonly Color YellowRyb = new Color(0.996078431372549,0.996078431372549,0.2,1.0,"YellowRyb");\r
- public static readonly Color Zaffre = new Color(0,0.0784313725490196,0.658823529411765,1.0,"Zaffre");\r
- public static readonly Color ZinnwalditeBrown = new Color(0.172549019607843,0.0862745098039216,0.0313725490196078,1.0,"ZinnwalditeBrown");\r
- #endregion\r
- \r
- #region IXmlSerializable\r
- public void ReadXml(System.Xml.XmlReader reader)\r
- {\r
- string[] c = reader["Color"].Split(new char[] { ';' }); \r
- R = double.Parse(c[0]);\r
- G = double.Parse(c[1]);\r
- B = double.Parse(c[2]);\r
- A = double.Parse(c[3]);\r
- }\r
- public void WriteXml(System.Xml.XmlWriter writer)\r
- {\r
- writer.WriteAttributeString("Color", this.ToString());\r
- }\r
- public System.Xml.Schema.XmlSchema GetSchema()\r
- {\r
- return null;\r
- }\r
- #endregion\r
-\r
- public override string ToString()\r
- {\r
- if (!string.IsNullOrEmpty(Name))\r
- return Name;\r
-\r
- foreach (Color cr in ColorDic)\r
- {\r
- if (cr == this)\r
- {\r
- Name = cr.Name;\r
- return cr.Name;\r
- }\r
- }\r
-\r
- return string.Format("{0};{1};{2};{3}", R, G, B, A);\r
- }\r
-\r
- public static object Parse(string s)\r
- {\r
- return (Color)s;\r
- }\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+using System.Reflection;
+using System.Diagnostics;
+
+
+
+namespace Crow
+{
+ public struct Color : ICairoFill
+ {
+ #region CTOR
+ public Color(double _R, double _G, double _B, double _A)
+ {
+ A = _A.Clamp(0,1);
+ R = _R.Clamp(0,1);
+ G = _G.Clamp(0,1);
+ B = _B.Clamp(0,1);
+ Name = "";
+ }
+ internal Color(double _R, double _G, double _B, double _A, string _name)
+ {
+ A = _A;
+ R = _R;
+ G = _G;
+ B = _B;
+ Name = _name;
+ ColorDic.Add(this);
+ }
+ #endregion
+
+ public static List<Color> ColorDic = new List<Color>();
+
+ internal string Name;
+
+ #region public fields
+ public double A;
+ public double R;
+ public double G;
+ public double B;
+ #endregion
+
+ #region Operators
+ public static implicit operator string(Color c)
+ {
+ return c.ToString();
+ }
+ public static implicit operator Color(string s)
+ {
+ if (string.IsNullOrEmpty(s))
+ return White;
+
+ string[] c = s.Split(new char[] { ';' });
+
+ if (c.Length == 1)
+ {
+ foreach (Color cr in ColorDic)
+ {
+ if (cr.Name == s)
+ return cr;
+ }
+ }
+
+ return new Color(
+ double.Parse(c[0]),
+ double.Parse(c[1]),
+ double.Parse(c[2]),
+ double.Parse(c[3]));
+ }
+
+ public static implicit operator OpenTK.Vector4(Color c)
+ {
+ return new OpenTK.Vector4 ((float)c.R, (float)c.G, (float)c.B, (float)c.A);
+ }
+ public static implicit operator Color(OpenTK.Vector4 v)
+ {
+ return new Color (v.X, v.Y, v.Z, v.W);
+ }
+
+ public static implicit operator System.Drawing.Color(Color c)
+ {
+ return System.Drawing.Color.FromArgb((int)(c.A * 255), (int)(c.R * 255), (int)(c.G * 255), (int)(c.B * 255));
+ }
+ public static implicit operator Color(System.Drawing.Color c)
+ {
+ return new Color (1.0f / c.R, 1.0f / c.G, 1.0f / c.B, 1.0f / c.A);
+ }
+ public static implicit operator Cairo.Color(Color c)
+ {
+ return new Cairo.Color(c.R, c.G, c.B, c.A);
+ }
+
+ public static bool operator ==(Color left, Color right)
+ {
+ return left.A == right.A &&
+ left.R == right.R &&
+ left.G == right.G &&
+ left.B == right.B ? true : false;
+ }
+ public static bool operator !=(Color left, Color right)
+ {
+ return left.A == right.A &&
+ left.R == right.R &&
+ left.G == right.G &&
+ left.B == right.B ? false : true;
+
+ }
+ public static bool operator ==(Color c, string n)
+ {
+ return c.Name == n ? true : false;
+ }
+ public static bool operator !=(Color c, string n)
+ {
+ return c.Name == n ? false : true;
+ }
+ public static bool operator ==(string n, Color c)
+ {
+ return c.Name == n ? true : false;
+ }
+ public static bool operator !=(string n, Color c)
+ {
+ return c.Name == n ? false : true;
+ }
+ public static Color operator *(Color c, Double f)
+ {
+ return new Color(c.R,c.G,c.B,c.A * f);
+ }
+ public static Color operator +(Color c1, Color c2)
+ {
+ return new Color(c1.R + c2.R,c1.G + c2.G,c1.B + c2.B,c1.A + c2.A);
+ }
+ public static Color operator -(Color c1, Color c2)
+ {
+ return new Color(c1.R - c2.R,c1.G - c2.G,c1.B - c2.B,c1.A - c2.A);
+ }
+ #endregion
+
+
+ public float[] floatArray
+ {
+ get { return new float[]{ (float)R, (float)G, (float)B, (float)A }; }
+ }
+ public Color AdjustAlpha(double _A)
+ {
+ return new Color (this.R, this.G, this.B, _A);
+ }
+
+ #region IFill implementation
+
+ public void SetAsSource (Cairo.Context ctx)
+ {
+ ctx.SetSourceRGBA (R, G, B, A);
+ }
+
+ #endregion
+
+ #region Predefined colors
+ public static readonly Color Transparent = new Color(0, 0, 0, 0, "Transparent");
+ public static readonly Color Clear = new Color(-1, -1, -1, -1, "Clear");
+ public static readonly Color Green = new Color(0, 1.0, 0, 1.0, "Green");
+ public static readonly Color AirForceBlueRaf = new Color(0.364705882352941,0.541176470588235,0.658823529411765,1.0,"AirForceBlueRaf");
+ public static readonly Color AirForceBlueUsaf = new Color(0,0.188235294117647,0.56078431372549,1.0,"AirForceBlueUsaf");
+ public static readonly Color AirSuperiorityBlue = new Color(0.447058823529412,0.627450980392157,0.756862745098039,1.0,"AirSuperiorityBlue");
+ public static readonly Color AlabamaCrimson = new Color(0.63921568627451,0.149019607843137,0.219607843137255,1.0,"AlabamaCrimson");
+ public static readonly Color AliceBlue = new Color(0.941176470588235,0.972549019607843,1,1.0,"AliceBlue");
+ public static readonly Color AlizarinCrimson = new Color(0.890196078431373,0.149019607843137,0.211764705882353,1.0,"AlizarinCrimson");
+ public static readonly Color AlloyOrange = new Color(0.768627450980392,0.384313725490196,0.0627450980392157,1.0,"AlloyOrange");
+ public static readonly Color Almond = new Color(0.937254901960784,0.870588235294118,0.803921568627451,1.0,"Almond");
+ public static readonly Color Amaranth = new Color(0.898039215686275,0.168627450980392,0.313725490196078,1.0,"Amaranth");
+ public static readonly Color Amber = new Color(1,0.749019607843137,0,1.0,"Amber");
+ public static readonly Color AmberSaeEce = new Color(1,0.494117647058824,0,1.0,"AmberSaeEce");
+ public static readonly Color AmericanRose = new Color(1,0.0117647058823529,0.243137254901961,1.0,"AmericanRose");
+ public static readonly Color Amethyst = new Color(0.6,0.4,0.8,1.0,"Amethyst");
+ public static readonly Color AndroidGreen = new Color(0.643137254901961,0.776470588235294,0.223529411764706,1.0,"AndroidGreen");
+ public static readonly Color AntiFlashWhite = new Color(0.949019607843137,0.952941176470588,0.956862745098039,1.0,"AntiFlashWhite");
+ public static readonly Color AntiqueBrass = new Color(0.803921568627451,0.584313725490196,0.458823529411765,1.0,"AntiqueBrass");
+ public static readonly Color AntiqueFuchsia = new Color(0.568627450980392,0.36078431372549,0.513725490196078,1.0,"AntiqueFuchsia");
+ public static readonly Color AntiqueRuby = new Color(0.517647058823529,0.105882352941176,0.176470588235294,1.0,"AntiqueRuby");
+ public static readonly Color AntiqueWhite = new Color(0.980392156862745,0.92156862745098,0.843137254901961,1.0,"AntiqueWhite");
+ public static readonly Color AoEnglish = new Color(0,0.501960784313725,0,1.0,"AoEnglish");
+ public static readonly Color AppleGreen = new Color(0.552941176470588,0.713725490196078,0,1.0,"AppleGreen");
+ public static readonly Color Apricot = new Color(0.984313725490196,0.807843137254902,0.694117647058824,1.0,"Apricot");
+ public static readonly Color Aqua = new Color(0,1,1,1.0,"Aqua");
+ public static readonly Color Aquamarine = new Color(0.498039215686275,1,0.831372549019608,1.0,"Aquamarine");
+ public static readonly Color ArmyGreen = new Color(0.294117647058824,0.325490196078431,0.125490196078431,1.0,"ArmyGreen");
+ public static readonly Color Arsenic = new Color(0.231372549019608,0.266666666666667,0.294117647058824,1.0,"Arsenic");
+ public static readonly Color ArylideYellow = new Color(0.913725490196078,0.83921568627451,0.419607843137255,1.0,"ArylideYellow");
+ public static readonly Color AshGrey = new Color(0.698039215686274,0.745098039215686,0.709803921568627,1.0,"AshGrey");
+ public static readonly Color Asparagus = new Color(0.529411764705882,0.662745098039216,0.419607843137255,1.0,"Asparagus");
+ public static readonly Color AtomicTangerine = new Color(1,0.6,0.4,1.0,"AtomicTangerine");
+ public static readonly Color Auburn = new Color(0.647058823529412,0.164705882352941,0.164705882352941,1.0,"Auburn");
+ public static readonly Color Aureolin = new Color(0.992156862745098,0.933333333333333,0,1.0,"Aureolin");
+ public static readonly Color Aurometalsaurus = new Color(0.431372549019608,0.498039215686275,0.501960784313725,1.0,"Aurometalsaurus");
+ public static readonly Color Avocado = new Color(0.337254901960784,0.509803921568627,0.0117647058823529,1.0,"Avocado");
+ public static readonly Color Azure = new Color(0,0.498039215686275,1,1.0,"Azure");
+ public static readonly Color AzureMistWeb = new Color(0.941176470588235,1,1,1.0,"AzureMistWeb");
+ public static readonly Color BabyBlue = new Color(0.537254901960784,0.811764705882353,0.941176470588235,1.0,"BabyBlue");
+ public static readonly Color BabyBlueEyes = new Color(0.631372549019608,0.792156862745098,0.945098039215686,1.0,"BabyBlueEyes");
+ public static readonly Color BabyPink = new Color(0.956862745098039,0.76078431372549,0.76078431372549,1.0,"BabyPink");
+ public static readonly Color BallBlue = new Color(0.129411764705882,0.670588235294118,0.803921568627451,1.0,"BallBlue");
+ public static readonly Color BananaMania = new Color(0.980392156862745,0.905882352941176,0.709803921568627,1.0,"BananaMania");
+ public static readonly Color BananaYellow = new Color(1,0.882352941176471,0.207843137254902,1.0,"BananaYellow");
+ public static readonly Color BarnRed = new Color(0.486274509803922,0.0392156862745098,0.00784313725490196,1.0,"BarnRed");
+ public static readonly Color BattleshipGrey = new Color(0.517647058823529,0.517647058823529,0.509803921568627,1.0,"BattleshipGrey");
+ public static readonly Color Bazaar = new Color(0.596078431372549,0.466666666666667,0.482352941176471,1.0,"Bazaar");
+ public static readonly Color BeauBlue = new Color(0.737254901960784,0.831372549019608,0.901960784313726,1.0,"BeauBlue");
+ public static readonly Color Beaver = new Color(0.623529411764706,0.505882352941176,0.43921568627451,1.0,"Beaver");
+ public static readonly Color Beige = new Color(0.96078431372549,0.96078431372549,0.862745098039216,1.0,"Beige");
+ public static readonly Color BigDipORuby = new Color(0.611764705882353,0.145098039215686,0.258823529411765,1.0,"BigDipORuby");
+ public static readonly Color Bisque = new Color(1,0.894117647058824,0.768627450980392,1.0,"Bisque");
+ public static readonly Color Bistre = new Color(0.23921568627451,0.168627450980392,0.12156862745098,1.0,"Bistre");
+ public static readonly Color Bittersweet = new Color(0.996078431372549,0.435294117647059,0.368627450980392,1.0,"Bittersweet");
+ public static readonly Color BittersweetShimmer = new Color(0.749019607843137,0.309803921568627,0.317647058823529,1.0,"BittersweetShimmer");
+ public static readonly Color Black = new Color(0,0,0,1.0,"Black");
+ public static readonly Color BlackBean = new Color(0.23921568627451,0.0470588235294118,0.00784313725490196,1.0,"BlackBean");
+ public static readonly Color BlackLeatherJacket = new Color(0.145098039215686,0.207843137254902,0.16078431372549,1.0,"BlackLeatherJacket");
+ public static readonly Color BlackOlive = new Color(0.231372549019608,0.235294117647059,0.211764705882353,1.0,"BlackOlive");
+ public static readonly Color BlanchedAlmond = new Color(1,0.92156862745098,0.803921568627451,1.0,"BlanchedAlmond");
+ public static readonly Color BlastOffBronze = new Color(0.647058823529412,0.443137254901961,0.392156862745098,1.0,"BlastOffBronze");
+ public static readonly Color BleuDeFrance = new Color(0.192156862745098,0.549019607843137,0.905882352941176,1.0,"BleuDeFrance");
+ public static readonly Color BlizzardBlue = new Color(0.674509803921569,0.898039215686275,0.933333333333333,1.0,"BlizzardBlue");
+ public static readonly Color Blond = new Color(0.980392156862745,0.941176470588235,0.745098039215686,1.0,"Blond");
+ public static readonly Color Blue = new Color(0,0,1,1.0,"Blue");
+ public static readonly Color BlueBell = new Color(0.635294117647059,0.635294117647059,0.815686274509804,1.0,"BlueBell");
+ public static readonly Color BlueCrayola = new Color(0.12156862745098,0.458823529411765,0.996078431372549,1.0,"BlueCrayola");
+ public static readonly Color BlueGray = new Color(0.4,0.6,0.8,1.0,"BlueGray");
+ public static readonly Color BlueGreen = new Color(0.0509803921568627,0.596078431372549,0.729411764705882,1.0,"BlueGreen");
+ public static readonly Color BlueMunsell = new Color(0,0.576470588235294,0.686274509803922,1.0,"BlueMunsell");
+ public static readonly Color BlueNcs = new Color(0,0.529411764705882,0.741176470588235,1.0,"BlueNcs");
+ public static readonly Color BluePigment = new Color(0.2,0.2,0.6,1.0,"BluePigment");
+ public static readonly Color BlueRyb = new Color(0.00784313725490196,0.27843137254902,0.996078431372549,1.0,"BlueRyb");
+ public static readonly Color BlueSapphire = new Color(0.0705882352941176,0.380392156862745,0.501960784313725,1.0,"BlueSapphire");
+ public static readonly Color BlueViolet = new Color(0.541176470588235,0.168627450980392,0.886274509803922,1.0,"BlueViolet");
+ public static readonly Color Blush = new Color(0.870588235294118,0.364705882352941,0.513725490196078,1.0,"Blush");
+ public static readonly Color Bole = new Color(0.474509803921569,0.266666666666667,0.231372549019608,1.0,"Bole");
+ public static readonly Color BondiBlue = new Color(0,0.584313725490196,0.713725490196078,1.0,"BondiBlue");
+ public static readonly Color Bone = new Color(0.890196078431373,0.854901960784314,0.788235294117647,1.0,"Bone");
+ public static readonly Color BostonUniversityRed = new Color(0.8,0,0,1.0,"BostonUniversityRed");
+ public static readonly Color BottleGreen = new Color(0,0.415686274509804,0.305882352941176,1.0,"BottleGreen");
+ public static readonly Color Boysenberry = new Color(0.529411764705882,0.196078431372549,0.376470588235294,1.0,"Boysenberry");
+ public static readonly Color BrandeisBlue = new Color(0,0.43921568627451,1,1.0,"BrandeisBlue");
+ public static readonly Color Brass = new Color(0.709803921568627,0.650980392156863,0.258823529411765,1.0,"Brass");
+ public static readonly Color BrickRed = new Color(0.796078431372549,0.254901960784314,0.329411764705882,1.0,"BrickRed");
+ public static readonly Color BrightCerulean = new Color(0.113725490196078,0.674509803921569,0.83921568627451,1.0,"BrightCerulean");
+ public static readonly Color BrightGreen = new Color(0.4,1,0,1.0,"BrightGreen");
+ public static readonly Color BrightLavender = new Color(0.749019607843137,0.580392156862745,0.894117647058824,1.0,"BrightLavender");
+ public static readonly Color BrightMaroon = new Color(0.764705882352941,0.129411764705882,0.282352941176471,1.0,"BrightMaroon");
+ public static readonly Color BrightPink = new Color(1,0,0.498039215686275,1.0,"BrightPink");
+ public static readonly Color BrightTurquoise = new Color(0.0313725490196078,0.909803921568627,0.870588235294118,1.0,"BrightTurquoise");
+ public static readonly Color BrightUbe = new Color(0.819607843137255,0.623529411764706,0.909803921568627,1.0,"BrightUbe");
+ public static readonly Color BrilliantLavender = new Color(0.956862745098039,0.733333333333333,1,1.0,"BrilliantLavender");
+ public static readonly Color BrilliantRose = new Color(1,0.333333333333333,0.63921568627451,1.0,"BrilliantRose");
+ public static readonly Color BrinkPink = new Color(0.984313725490196,0.376470588235294,0.498039215686275,1.0,"BrinkPink");
+ public static readonly Color BritishRacingGreen = new Color(0,0.258823529411765,0.145098039215686,1.0,"BritishRacingGreen");
+ public static readonly Color Bronze = new Color(0.803921568627451,0.498039215686275,0.196078431372549,1.0,"Bronze");
+ public static readonly Color BrownTraditional = new Color(0.588235294117647,0.294117647058824,0,1.0,"BrownTraditional");
+ public static readonly Color BrownWeb = new Color(0.647058823529412,0.164705882352941,0.164705882352941,1.0,"BrownWeb");
+ public static readonly Color BubbleGum = new Color(1,0.756862745098039,0.8,1.0,"BubbleGum");
+ public static readonly Color Bubbles = new Color(0.905882352941176,0.996078431372549,1,1.0,"Bubbles");
+ public static readonly Color Buff = new Color(0.941176470588235,0.862745098039216,0.509803921568627,1.0,"Buff");
+ public static readonly Color BulgarianRose = new Color(0.282352941176471,0.0235294117647059,0.0274509803921569,1.0,"BulgarianRose");
+ public static readonly Color Burgundy = new Color(0.501960784313725,0,0.125490196078431,1.0,"Burgundy");
+ public static readonly Color Burlywood = new Color(0.870588235294118,0.72156862745098,0.529411764705882,1.0,"Burlywood");
+ public static readonly Color BurntOrange = new Color(0.8,0.333333333333333,0,1.0,"BurntOrange");
+ public static readonly Color BurntSienna = new Color(0.913725490196078,0.454901960784314,0.317647058823529,1.0,"BurntSienna");
+ public static readonly Color BurntUmber = new Color(0.541176470588235,0.2,0.141176470588235,1.0,"BurntUmber");
+ public static readonly Color Byzantine = new Color(0.741176470588235,0.2,0.643137254901961,1.0,"Byzantine");
+ public static readonly Color Byzantium = new Color(0.43921568627451,0.16078431372549,0.388235294117647,1.0,"Byzantium");
+ public static readonly Color Cadet = new Color(0.325490196078431,0.407843137254902,0.447058823529412,1.0,"Cadet");
+ public static readonly Color CadetBlue = new Color(0.372549019607843,0.619607843137255,0.627450980392157,1.0,"CadetBlue");
+ public static readonly Color CadetGrey = new Color(0.568627450980392,0.63921568627451,0.690196078431373,1.0,"CadetGrey");
+ public static readonly Color CadmiumGreen = new Color(0,0.419607843137255,0.235294117647059,1.0,"CadmiumGreen");
+ public static readonly Color CadmiumOrange = new Color(0.929411764705882,0.529411764705882,0.176470588235294,1.0,"CadmiumOrange");
+ public static readonly Color CadmiumRed = new Color(0.890196078431373,0,0.133333333333333,1.0,"CadmiumRed");
+ public static readonly Color CadmiumYellow = new Color(1,0.964705882352941,0,1.0,"CadmiumYellow");
+ public static readonly Color CafAuLait = new Color(0.650980392156863,0.482352941176471,0.356862745098039,1.0,"CafAuLait");
+ public static readonly Color CafNoir = new Color(0.294117647058824,0.211764705882353,0.129411764705882,1.0,"CafNoir");
+ public static readonly Color CalPolyGreen = new Color(0.117647058823529,0.301960784313725,0.168627450980392,1.0,"CalPolyGreen");
+ public static readonly Color CambridgeBlue = new Color(0.63921568627451,0.756862745098039,0.67843137254902,1.0,"CambridgeBlue");
+ public static readonly Color Camel = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"Camel");
+ public static readonly Color CameoPink = new Color(0.937254901960784,0.733333333333333,0.8,1.0,"CameoPink");
+ public static readonly Color CamouflageGreen = new Color(0.470588235294118,0.525490196078431,0.419607843137255,1.0,"CamouflageGreen");
+ public static readonly Color CanaryYellow = new Color(1,0.937254901960784,0,1.0,"CanaryYellow");
+ public static readonly Color CandyAppleRed = new Color(1,0.0313725490196078,0,1.0,"CandyAppleRed");
+ public static readonly Color CandyPink = new Color(0.894117647058824,0.443137254901961,0.47843137254902,1.0,"CandyPink");
+ public static readonly Color Capri = new Color(0,0.749019607843137,1,1.0,"Capri");
+ public static readonly Color CaputMortuum = new Color(0.349019607843137,0.152941176470588,0.125490196078431,1.0,"CaputMortuum");
+ public static readonly Color Cardinal = new Color(0.768627450980392,0.117647058823529,0.227450980392157,1.0,"Cardinal");
+ public static readonly Color CaribbeanGreen = new Color(0,0.8,0.6,1.0,"CaribbeanGreen");
+ public static readonly Color Carmine = new Color(0.588235294117647,0,0.0941176470588235,1.0,"Carmine");
+ public static readonly Color CarmineMP = new Color(0.843137254901961,0,0.250980392156863,1.0,"CarmineMP");
+ public static readonly Color CarminePink = new Color(0.92156862745098,0.298039215686275,0.258823529411765,1.0,"CarminePink");
+ public static readonly Color CarmineRed = new Color(1,0,0.219607843137255,1.0,"CarmineRed");
+ public static readonly Color CarnationPink = new Color(1,0.650980392156863,0.788235294117647,1.0,"CarnationPink");
+ public static readonly Color Carnelian = new Color(0.701960784313725,0.105882352941176,0.105882352941176,1.0,"Carnelian");
+ public static readonly Color CarolinaBlue = new Color(0.6,0.729411764705882,0.866666666666667,1.0,"CarolinaBlue");
+ public static readonly Color CarrotOrange = new Color(0.929411764705882,0.568627450980392,0.129411764705882,1.0,"CarrotOrange");
+ public static readonly Color CatalinaBlue = new Color(0.0235294117647059,0.164705882352941,0.470588235294118,1.0,"CatalinaBlue");
+ public static readonly Color Ceil = new Color(0.572549019607843,0.631372549019608,0.811764705882353,1.0,"Ceil");
+ public static readonly Color Celadon = new Color(0.674509803921569,0.882352941176471,0.686274509803922,1.0,"Celadon");
+ public static readonly Color CeladonBlue = new Color(0,0.482352941176471,0.654901960784314,1.0,"CeladonBlue");
+ public static readonly Color CeladonGreen = new Color(0.184313725490196,0.517647058823529,0.486274509803922,1.0,"CeladonGreen");
+ public static readonly Color CelesteColour = new Color(0.698039215686274,1,1,1.0,"CelesteColour");
+ public static readonly Color CelestialBlue = new Color(0.286274509803922,0.592156862745098,0.815686274509804,1.0,"CelestialBlue");
+ public static readonly Color Cerise = new Color(0.870588235294118,0.192156862745098,0.388235294117647,1.0,"Cerise");
+ public static readonly Color CerisePink = new Color(0.925490196078431,0.231372549019608,0.513725490196078,1.0,"CerisePink");
+ public static readonly Color Cerulean = new Color(0,0.482352941176471,0.654901960784314,1.0,"Cerulean");
+ public static readonly Color CeruleanBlue = new Color(0.164705882352941,0.32156862745098,0.745098039215686,1.0,"CeruleanBlue");
+ public static readonly Color CeruleanFrost = new Color(0.427450980392157,0.607843137254902,0.764705882352941,1.0,"CeruleanFrost");
+ public static readonly Color CgBlue = new Color(0,0.47843137254902,0.647058823529412,1.0,"CgBlue");
+ public static readonly Color CgRed = new Color(0.87843137254902,0.235294117647059,0.192156862745098,1.0,"CgRed");
+ public static readonly Color Chamoisee = new Color(0.627450980392157,0.470588235294118,0.352941176470588,1.0,"Chamoisee");
+ public static readonly Color Champagne = new Color(0.980392156862745,0.83921568627451,0.647058823529412,1.0,"Champagne");
+ public static readonly Color Charcoal = new Color(0.211764705882353,0.270588235294118,0.309803921568627,1.0,"Charcoal");
+ public static readonly Color CharmPink = new Color(0.901960784313726,0.56078431372549,0.674509803921569,1.0,"CharmPink");
+ public static readonly Color ChartreuseTraditional = new Color(0.874509803921569,1,0,1.0,"ChartreuseTraditional");
+ public static readonly Color ChartreuseWeb = new Color(0.498039215686275,1,0,1.0,"ChartreuseWeb");
+ public static readonly Color Cherry = new Color(0.870588235294118,0.192156862745098,0.388235294117647,1.0,"Cherry");
+ public static readonly Color CherryBlossomPink = new Color(1,0.717647058823529,0.772549019607843,1.0,"CherryBlossomPink");
+ public static readonly Color Chestnut = new Color(0.803921568627451,0.36078431372549,0.36078431372549,1.0,"Chestnut");
+ public static readonly Color ChinaPink = new Color(0.870588235294118,0.435294117647059,0.631372549019608,1.0,"ChinaPink");
+ public static readonly Color ChinaRose = new Color(0.658823529411765,0.317647058823529,0.431372549019608,1.0,"ChinaRose");
+ public static readonly Color ChineseRed = new Color(0.666666666666667,0.219607843137255,0.117647058823529,1.0,"ChineseRed");
+ public static readonly Color ChocolateTraditional = new Color(0.482352941176471,0.247058823529412,0,1.0,"ChocolateTraditional");
+ public static readonly Color ChocolateWeb = new Color(0.823529411764706,0.411764705882353,0.117647058823529,1.0,"ChocolateWeb");
+ public static readonly Color ChromeYellow = new Color(1,0.654901960784314,0,1.0,"ChromeYellow");
+ public static readonly Color Cinereous = new Color(0.596078431372549,0.505882352941176,0.482352941176471,1.0,"Cinereous");
+ public static readonly Color Cinnabar = new Color(0.890196078431373,0.258823529411765,0.203921568627451,1.0,"Cinnabar");
+ public static readonly Color Cinnamon = new Color(0.823529411764706,0.411764705882353,0.117647058823529,1.0,"Cinnamon");
+ public static readonly Color Citrine = new Color(0.894117647058824,0.815686274509804,0.0392156862745098,1.0,"Citrine");
+ public static readonly Color ClassicRose = new Color(0.984313725490196,0.8,0.905882352941176,1.0,"ClassicRose");
+ public static readonly Color Cobalt = new Color(0,0.27843137254902,0.670588235294118,1.0,"Cobalt");
+ public static readonly Color CocoaBrown = new Color(0.823529411764706,0.411764705882353,0.117647058823529,1.0,"CocoaBrown");
+ public static readonly Color Coffee = new Color(0.435294117647059,0.305882352941176,0.215686274509804,1.0,"Coffee");
+ public static readonly Color ColumbiaBlue = new Color(0.607843137254902,0.866666666666667,1,1.0,"ColumbiaBlue");
+ public static readonly Color CongoPink = new Color(0.972549019607843,0.513725490196078,0.474509803921569,1.0,"CongoPink");
+ public static readonly Color CoolBlack = new Color(0,0.180392156862745,0.388235294117647,1.0,"CoolBlack");
+ public static readonly Color CoolGrey = new Color(0.549019607843137,0.572549019607843,0.674509803921569,1.0,"CoolGrey");
+ public static readonly Color Copper = new Color(0.72156862745098,0.450980392156863,0.2,1.0,"Copper");
+ public static readonly Color CopperCrayola = new Color(0.854901960784314,0.541176470588235,0.403921568627451,1.0,"CopperCrayola");
+ public static readonly Color CopperPenny = new Color(0.67843137254902,0.435294117647059,0.411764705882353,1.0,"CopperPenny");
+ public static readonly Color CopperRed = new Color(0.796078431372549,0.427450980392157,0.317647058823529,1.0,"CopperRed");
+ public static readonly Color CopperRose = new Color(0.6,0.4,0.4,1.0,"CopperRose");
+ public static readonly Color Coquelicot = new Color(1,0.219607843137255,0,1.0,"Coquelicot");
+ public static readonly Color Coral = new Color(1,0.498039215686275,0.313725490196078,1.0,"Coral");
+ public static readonly Color CoralPink = new Color(0.972549019607843,0.513725490196078,0.474509803921569,1.0,"CoralPink");
+ public static readonly Color CoralRed = new Color(1,0.250980392156863,0.250980392156863,1.0,"CoralRed");
+ public static readonly Color Cordovan = new Color(0.537254901960784,0.247058823529412,0.270588235294118,1.0,"Cordovan");
+ public static readonly Color Corn = new Color(0.984313725490196,0.925490196078431,0.364705882352941,1.0,"Corn");
+ public static readonly Color CornellRed = new Color(0.701960784313725,0.105882352941176,0.105882352941176,1.0,"CornellRed");
+ public static readonly Color CornflowerBlue = new Color(0.392156862745098,0.584313725490196,0.929411764705882,1.0,"CornflowerBlue");
+ public static readonly Color Cornsilk = new Color(1,0.972549019607843,0.862745098039216,1.0,"Cornsilk");
+ public static readonly Color CosmicLatte = new Color(1,0.972549019607843,0.905882352941176,1.0,"CosmicLatte");
+ public static readonly Color CottonCandy = new Color(1,0.737254901960784,0.850980392156863,1.0,"CottonCandy");
+ public static readonly Color Cream = new Color(1,0.992156862745098,0.815686274509804,1.0,"Cream");
+ public static readonly Color Crimson = new Color(0.862745098039216,0.0784313725490196,0.235294117647059,1.0,"Crimson");
+ public static readonly Color CrimsonGlory = new Color(0.745098039215686,0,0.196078431372549,1.0,"CrimsonGlory");
+ public static readonly Color Cyan = new Color(0,1,1,1.0,"Cyan");
+ public static readonly Color CyanProcess = new Color(0,0.717647058823529,0.92156862745098,1.0,"CyanProcess");
+ public static readonly Color Daffodil = new Color(1,1,0.192156862745098,1.0,"Daffodil");
+ public static readonly Color Dandelion = new Color(0.941176470588235,0.882352941176471,0.188235294117647,1.0,"Dandelion");
+ public static readonly Color DarkBlue = new Color(0,0,0.545098039215686,1.0,"DarkBlue");
+ public static readonly Color DarkBrown = new Color(0.396078431372549,0.262745098039216,0.129411764705882,1.0,"DarkBrown");
+ public static readonly Color DarkByzantium = new Color(0.364705882352941,0.223529411764706,0.329411764705882,1.0,"DarkByzantium");
+ public static readonly Color DarkCandyAppleRed = new Color(0.643137254901961,0,0,1.0,"DarkCandyAppleRed");
+ public static readonly Color DarkCerulean = new Color(0.0313725490196078,0.270588235294118,0.494117647058824,1.0,"DarkCerulean");
+ public static readonly Color DarkChestnut = new Color(0.596078431372549,0.411764705882353,0.376470588235294,1.0,"DarkChestnut");
+ public static readonly Color DarkCoral = new Color(0.803921568627451,0.356862745098039,0.270588235294118,1.0,"DarkCoral");
+ public static readonly Color DarkCyan = new Color(0,0.545098039215686,0.545098039215686,1.0,"DarkCyan");
+ public static readonly Color DarkElectricBlue = new Color(0.325490196078431,0.407843137254902,0.470588235294118,1.0,"DarkElectricBlue");
+ public static readonly Color DarkGoldenrod = new Color(0.72156862745098,0.525490196078431,0.0431372549019608,1.0,"DarkGoldenrod");
+ public static readonly Color DarkGray = new Color(0.662745098039216,0.662745098039216,0.662745098039216,1.0,"DarkGray");
+ public static readonly Color DarkGreen = new Color(0.00392156862745098,0.196078431372549,0.125490196078431,1.0,"DarkGreen");
+ public static readonly Color DarkImperialBlue = new Color(0,0.254901960784314,0.415686274509804,1.0,"DarkImperialBlue");
+ public static readonly Color DarkJungleGreen = new Color(0.101960784313725,0.141176470588235,0.129411764705882,1.0,"DarkJungleGreen");
+ public static readonly Color DarkKhaki = new Color(0.741176470588235,0.717647058823529,0.419607843137255,1.0,"DarkKhaki");
+ public static readonly Color DarkLava = new Color(0.282352941176471,0.235294117647059,0.196078431372549,1.0,"DarkLava");
+ public static readonly Color DarkLavender = new Color(0.450980392156863,0.309803921568627,0.588235294117647,1.0,"DarkLavender");
+ public static readonly Color DarkMagenta = new Color(0.545098039215686,0,0.545098039215686,1.0,"DarkMagenta");
+ public static readonly Color DarkMidnightBlue = new Color(0,0.2,0.4,1.0,"DarkMidnightBlue");
+ public static readonly Color DarkOliveGreen = new Color(0.333333333333333,0.419607843137255,0.184313725490196,1.0,"DarkOliveGreen");
+ public static readonly Color DarkOrange = new Color(1,0.549019607843137,0,1.0,"DarkOrange");
+ public static readonly Color DarkOrchid = new Color(0.6,0.196078431372549,0.8,1.0,"DarkOrchid");
+ public static readonly Color DarkPastelBlue = new Color(0.466666666666667,0.619607843137255,0.796078431372549,1.0,"DarkPastelBlue");
+ public static readonly Color DarkPastelGreen = new Color(0.0117647058823529,0.752941176470588,0.235294117647059,1.0,"DarkPastelGreen");
+ public static readonly Color DarkPastelPurple = new Color(0.588235294117647,0.435294117647059,0.83921568627451,1.0,"DarkPastelPurple");
+ public static readonly Color DarkPastelRed = new Color(0.76078431372549,0.231372549019608,0.133333333333333,1.0,"DarkPastelRed");
+ public static readonly Color DarkPink = new Color(0.905882352941176,0.329411764705882,0.501960784313725,1.0,"DarkPink");
+ public static readonly Color DarkPowderBlue = new Color(0,0.2,0.6,1.0,"DarkPowderBlue");
+ public static readonly Color DarkRaspberry = new Color(0.529411764705882,0.149019607843137,0.341176470588235,1.0,"DarkRaspberry");
+ public static readonly Color DarkRed = new Color(0.545098039215686,0,0,1.0,"DarkRed");
+ public static readonly Color DarkSalmon = new Color(0.913725490196078,0.588235294117647,0.47843137254902,1.0,"DarkSalmon");
+ public static readonly Color DarkScarlet = new Color(0.337254901960784,0.0117647058823529,0.0980392156862745,1.0,"DarkScarlet");
+ public static readonly Color DarkSeaGreen = new Color(0.56078431372549,0.737254901960784,0.56078431372549,1.0,"DarkSeaGreen");
+ public static readonly Color DarkSienna = new Color(0.235294117647059,0.0784313725490196,0.0784313725490196,1.0,"DarkSienna");
+ public static readonly Color DarkSlateBlue = new Color(0.282352941176471,0.23921568627451,0.545098039215686,1.0,"DarkSlateBlue");
+ public static readonly Color DarkSlateGray = new Color(0.184313725490196,0.309803921568627,0.309803921568627,1.0,"DarkSlateGray");
+ public static readonly Color DarkSpringGreen = new Color(0.0901960784313725,0.447058823529412,0.270588235294118,1.0,"DarkSpringGreen");
+ public static readonly Color DarkTan = new Color(0.568627450980392,0.505882352941176,0.317647058823529,1.0,"DarkTan");
+ public static readonly Color DarkTangerine = new Color(1,0.658823529411765,0.0705882352941176,1.0,"DarkTangerine");
+ public static readonly Color DarkTaupe = new Color(0.282352941176471,0.235294117647059,0.196078431372549,1.0,"DarkTaupe");
+ public static readonly Color DarkTerraCotta = new Color(0.8,0.305882352941176,0.36078431372549,1.0,"DarkTerraCotta");
+ public static readonly Color DarkTurquoise = new Color(0,0.807843137254902,0.819607843137255,1.0,"DarkTurquoise");
+ public static readonly Color DarkViolet = new Color(0.580392156862745,0,0.827450980392157,1.0,"DarkViolet");
+ public static readonly Color DarkYellow = new Color(0.607843137254902,0.529411764705882,0.0470588235294118,1.0,"DarkYellow");
+ public static readonly Color DartmouthGreen = new Color(0,0.43921568627451,0.235294117647059,1.0,"DartmouthGreen");
+ public static readonly Color DavySGrey = new Color(0.333333333333333,0.333333333333333,0.333333333333333,1.0,"DavySGrey");
+ public static readonly Color DebianRed = new Color(0.843137254901961,0.0392156862745098,0.325490196078431,1.0,"DebianRed");
+ public static readonly Color DeepCarmine = new Color(0.662745098039216,0.125490196078431,0.243137254901961,1.0,"DeepCarmine");
+ public static readonly Color DeepCarminePink = new Color(0.937254901960784,0.188235294117647,0.219607843137255,1.0,"DeepCarminePink");
+ public static readonly Color DeepCarrotOrange = new Color(0.913725490196078,0.411764705882353,0.172549019607843,1.0,"DeepCarrotOrange");
+ public static readonly Color DeepCerise = new Color(0.854901960784314,0.196078431372549,0.529411764705882,1.0,"DeepCerise");
+ public static readonly Color DeepChampagne = new Color(0.980392156862745,0.83921568627451,0.647058823529412,1.0,"DeepChampagne");
+ public static readonly Color DeepChestnut = new Color(0.725490196078431,0.305882352941176,0.282352941176471,1.0,"DeepChestnut");
+ public static readonly Color DeepCoffee = new Color(0.43921568627451,0.258823529411765,0.254901960784314,1.0,"DeepCoffee");
+ public static readonly Color DeepFuchsia = new Color(0.756862745098039,0.329411764705882,0.756862745098039,1.0,"DeepFuchsia");
+ public static readonly Color DeepJungleGreen = new Color(0,0.294117647058824,0.286274509803922,1.0,"DeepJungleGreen");
+ public static readonly Color DeepLilac = new Color(0.6,0.333333333333333,0.733333333333333,1.0,"DeepLilac");
+ public static readonly Color DeepMagenta = new Color(0.8,0,0.8,1.0,"DeepMagenta");
+ public static readonly Color DeepPeach = new Color(1,0.796078431372549,0.643137254901961,1.0,"DeepPeach");
+ public static readonly Color DeepPink = new Color(1,0.0784313725490196,0.576470588235294,1.0,"DeepPink");
+ public static readonly Color DeepRuby = new Color(0.517647058823529,0.247058823529412,0.356862745098039,1.0,"DeepRuby");
+ public static readonly Color DeepSaffron = new Color(1,0.6,0.2,1.0,"DeepSaffron");
+ public static readonly Color DeepSkyBlue = new Color(0,0.749019607843137,1,1.0,"DeepSkyBlue");
+ public static readonly Color DeepTuscanRed = new Color(0.4,0.258823529411765,0.301960784313725,1.0,"DeepTuscanRed");
+ public static readonly Color Denim = new Color(0.0823529411764706,0.376470588235294,0.741176470588235,1.0,"Denim");
+ public static readonly Color Desert = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"Desert");
+ public static readonly Color DesertSand = new Color(0.929411764705882,0.788235294117647,0.686274509803922,1.0,"DesertSand");
+ public static readonly Color DimGray = new Color(0.411764705882353,0.411764705882353,0.411764705882353,1.0,"DimGray");
+ public static readonly Color DodgerBlue = new Color(0.117647058823529,0.564705882352941,1,1.0,"DodgerBlue");
+ public static readonly Color DogwoodRose = new Color(0.843137254901961,0.0941176470588235,0.407843137254902,1.0,"DogwoodRose");
+ public static readonly Color DollarBill = new Color(0.52156862745098,0.733333333333333,0.396078431372549,1.0,"DollarBill");
+ public static readonly Color Drab = new Color(0.588235294117647,0.443137254901961,0.0901960784313725,1.0,"Drab");
+ public static readonly Color DukeBlue = new Color(0,0,0.611764705882353,1.0,"DukeBlue");
+ public static readonly Color EarthYellow = new Color(0.882352941176471,0.662745098039216,0.372549019607843,1.0,"EarthYellow");
+ public static readonly Color Ebony = new Color(0.333333333333333,0.364705882352941,0.313725490196078,1.0,"Ebony");
+ public static readonly Color Ecru = new Color(0.76078431372549,0.698039215686274,0.501960784313725,1.0,"Ecru");
+ public static readonly Color Eggplant = new Color(0.380392156862745,0.250980392156863,0.317647058823529,1.0,"Eggplant");
+ public static readonly Color Eggshell = new Color(0.941176470588235,0.917647058823529,0.83921568627451,1.0,"Eggshell");
+ public static readonly Color EgyptianBlue = new Color(0.0627450980392157,0.203921568627451,0.650980392156863,1.0,"EgyptianBlue");
+ public static readonly Color ElectricBlue = new Color(0.490196078431373,0.976470588235294,1,1.0,"ElectricBlue");
+ public static readonly Color ElectricCrimson = new Color(1,0,0.247058823529412,1.0,"ElectricCrimson");
+ public static readonly Color ElectricCyan = new Color(0,1,1,1.0,"ElectricCyan");
+ public static readonly Color ElectricGreen = new Color(0,1,0,1.0,"ElectricGreen");
+ public static readonly Color ElectricIndigo = new Color(0.435294117647059,0,1,1.0,"ElectricIndigo");
+ public static readonly Color ElectricLavender = new Color(0.956862745098039,0.733333333333333,1,1.0,"ElectricLavender");
+ public static readonly Color ElectricLime = new Color(0.8,1,0,1.0,"ElectricLime");
+ public static readonly Color ElectricPurple = new Color(0.749019607843137,0,1,1.0,"ElectricPurple");
+ public static readonly Color ElectricUltramarine = new Color(0.247058823529412,0,1,1.0,"ElectricUltramarine");
+ public static readonly Color ElectricViolet = new Color(0.56078431372549,0,1,1.0,"ElectricViolet");
+ public static readonly Color ElectricYellow = new Color(1,1,0,1.0,"ElectricYellow");
+ public static readonly Color Emerald = new Color(0.313725490196078,0.784313725490196,0.470588235294118,1.0,"Emerald");
+ public static readonly Color EnglishLavender = new Color(0.705882352941177,0.513725490196078,0.584313725490196,1.0,"EnglishLavender");
+ public static readonly Color EtonBlue = new Color(0.588235294117647,0.784313725490196,0.635294117647059,1.0,"EtonBlue");
+ public static readonly Color Fallow = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"Fallow");
+ public static readonly Color FaluRed = new Color(0.501960784313725,0.0941176470588235,0.0941176470588235,1.0,"FaluRed");
+ public static readonly Color Fandango = new Color(0.709803921568627,0.2,0.537254901960784,1.0,"Fandango");
+ public static readonly Color FashionFuchsia = new Color(0.956862745098039,0,0.631372549019608,1.0,"FashionFuchsia");
+ public static readonly Color Fawn = new Color(0.898039215686275,0.666666666666667,0.43921568627451,1.0,"Fawn");
+ public static readonly Color Feldgrau = new Color(0.301960784313725,0.364705882352941,0.325490196078431,1.0,"Feldgrau");
+ public static readonly Color FernGreen = new Color(0.309803921568627,0.474509803921569,0.258823529411765,1.0,"FernGreen");
+ public static readonly Color FerrariRed = new Color(1,0.156862745098039,0,1.0,"FerrariRed");
+ public static readonly Color FieldDrab = new Color(0.423529411764706,0.329411764705882,0.117647058823529,1.0,"FieldDrab");
+ public static readonly Color FireEngineRed = new Color(0.807843137254902,0.125490196078431,0.16078431372549,1.0,"FireEngineRed");
+ public static readonly Color Firebrick = new Color(0.698039215686274,0.133333333333333,0.133333333333333,1.0,"Firebrick");
+ public static readonly Color Flame = new Color(0.886274509803922,0.345098039215686,0.133333333333333,1.0,"Flame");
+ public static readonly Color FlamingoPink = new Color(0.988235294117647,0.556862745098039,0.674509803921569,1.0,"FlamingoPink");
+ public static readonly Color Flavescent = new Color(0.968627450980392,0.913725490196078,0.556862745098039,1.0,"Flavescent");
+ public static readonly Color Flax = new Color(0.933333333333333,0.862745098039216,0.509803921568627,1.0,"Flax");
+ public static readonly Color FloralWhite = new Color(1,0.980392156862745,0.941176470588235,1.0,"FloralWhite");
+ public static readonly Color FluorescentOrange = new Color(1,0.749019607843137,0,1.0,"FluorescentOrange");
+ public static readonly Color FluorescentPink = new Color(1,0.0784313725490196,0.576470588235294,1.0,"FluorescentPink");
+ public static readonly Color FluorescentYellow = new Color(0.8,1,0,1.0,"FluorescentYellow");
+ public static readonly Color Folly = new Color(1,0,0.309803921568627,1.0,"Folly");
+ public static readonly Color ForestGreenTraditional = new Color(0.00392156862745098,0.266666666666667,0.129411764705882,1.0,"ForestGreenTraditional");
+ public static readonly Color ForestGreenWeb = new Color(0.133333333333333,0.545098039215686,0.133333333333333,1.0,"ForestGreenWeb");
+ public static readonly Color FrenchBeige = new Color(0.650980392156863,0.482352941176471,0.356862745098039,1.0,"FrenchBeige");
+ public static readonly Color FrenchBlue = new Color(0,0.447058823529412,0.733333333333333,1.0,"FrenchBlue");
+ public static readonly Color FrenchLilac = new Color(0.525490196078431,0.376470588235294,0.556862745098039,1.0,"FrenchLilac");
+ public static readonly Color FrenchLime = new Color(0.8,1,0,1.0,"FrenchLime");
+ public static readonly Color FrenchRaspberry = new Color(0.780392156862745,0.172549019607843,0.282352941176471,1.0,"FrenchRaspberry");
+ public static readonly Color FrenchRose = new Color(0.964705882352941,0.290196078431373,0.541176470588235,1.0,"FrenchRose");
+ public static readonly Color Fuchsia = new Color(1,0,1,1.0,"Fuchsia");
+ public static readonly Color FuchsiaCrayola = new Color(0.756862745098039,0.329411764705882,0.756862745098039,1.0,"FuchsiaCrayola");
+ public static readonly Color FuchsiaPink = new Color(1,0.466666666666667,1,1.0,"FuchsiaPink");
+ public static readonly Color FuchsiaRose = new Color(0.780392156862745,0.262745098039216,0.458823529411765,1.0,"FuchsiaRose");
+ public static readonly Color Fulvous = new Color(0.894117647058824,0.517647058823529,0,1.0,"Fulvous");
+ public static readonly Color FuzzyWuzzy = new Color(0.8,0.4,0.4,1.0,"FuzzyWuzzy");
+ public static readonly Color Gainsboro = new Color(0.862745098039216,0.862745098039216,0.862745098039216,1.0,"Gainsboro");
+ public static readonly Color Gamboge = new Color(0.894117647058824,0.607843137254902,0.0588235294117647,1.0,"Gamboge");
+ public static readonly Color GhostWhite = new Color(0.972549019607843,0.972549019607843,1,1.0,"GhostWhite");
+ public static readonly Color Ginger = new Color(0.690196078431373,0.396078431372549,0,1.0,"Ginger");
+ public static readonly Color Glaucous = new Color(0.376470588235294,0.509803921568627,0.713725490196078,1.0,"Glaucous");
+ public static readonly Color Glitter = new Color(0.901960784313726,0.909803921568627,0.980392156862745,1.0,"Glitter");
+ public static readonly Color GoldMetallic = new Color(0.831372549019608,0.686274509803922,0.215686274509804,1.0,"GoldMetallic");
+ public static readonly Color GoldWebGolden = new Color(1,0.843137254901961,0,1.0,"GoldWebGolden");
+ public static readonly Color GoldenBrown = new Color(0.6,0.396078431372549,0.0823529411764706,1.0,"GoldenBrown");
+ public static readonly Color GoldenPoppy = new Color(0.988235294117647,0.76078431372549,0,1.0,"GoldenPoppy");
+ public static readonly Color GoldenYellow = new Color(1,0.874509803921569,0,1.0,"GoldenYellow");
+ public static readonly Color Goldenrod = new Color(0.854901960784314,0.647058823529412,0.125490196078431,1.0,"Goldenrod");
+ public static readonly Color GrannySmithApple = new Color(0.658823529411765,0.894117647058824,0.627450980392157,1.0,"GrannySmithApple");
+ public static readonly Color Gray = new Color(0.501960784313725,0.501960784313725,0.501960784313725,1.0,"Gray");
+ public static readonly Color GrayAsparagus = new Color(0.274509803921569,0.349019607843137,0.270588235294118,1.0,"GrayAsparagus");
+ public static readonly Color GrayHtmlCssGray = new Color(0.501960784313725,0.501960784313725,0.501960784313725,1.0,"GrayHtmlCssGray");
+ public static readonly Color GrayX11Gray = new Color(0.745098039215686,0.745098039215686,0.745098039215686,1.0,"GrayX11Gray");
+ public static readonly Color GreenColorWheelX11Green = new Color(0,1,0,1.0,"GreenColorWheelX11Green");
+ public static readonly Color GreenCrayola = new Color(0.109803921568627,0.674509803921569,0.470588235294118,1.0,"GreenCrayola");
+ public static readonly Color GreenHtmlCssGreen = new Color(0,0.501960784313725,0,1.0,"GreenHtmlCssGreen");
+ public static readonly Color GreenMunsell = new Color(0,0.658823529411765,0.466666666666667,1.0,"GreenMunsell");
+ public static readonly Color GreenNcs = new Color(0,0.623529411764706,0.419607843137255,1.0,"GreenNcs");
+ public static readonly Color GreenPigment = new Color(0,0.647058823529412,0.313725490196078,1.0,"GreenPigment");
+ public static readonly Color GreenRyb = new Color(0.4,0.690196078431373,0.196078431372549,1.0,"GreenRyb");
+ public static readonly Color GreenYellow = new Color(0.67843137254902,1,0.184313725490196,1.0,"GreenYellow");
+ public static readonly Color Grullo = new Color(0.662745098039216,0.603921568627451,0.525490196078431,1.0,"Grullo");
+ public static readonly Color GuppieGreen = new Color(0,1,0.498039215686275,1.0,"GuppieGreen");
+ public static readonly Color HalayBe = new Color(0.4,0.219607843137255,0.329411764705882,1.0,"HalayBe");
+ public static readonly Color HanBlue = new Color(0.266666666666667,0.423529411764706,0.811764705882353,1.0,"HanBlue");
+ public static readonly Color HanPurple = new Color(0.32156862745098,0.0941176470588235,0.980392156862745,1.0,"HanPurple");
+ public static readonly Color HansaYellow = new Color(0.913725490196078,0.83921568627451,0.419607843137255,1.0,"HansaYellow");
+ public static readonly Color Harlequin = new Color(0.247058823529412,1,0,1.0,"Harlequin");
+ public static readonly Color HarvardCrimson = new Color(0.788235294117647,0,0.0862745098039216,1.0,"HarvardCrimson");
+ public static readonly Color HarvestGold = new Color(0.854901960784314,0.568627450980392,0,1.0,"HarvestGold");
+ public static readonly Color HeartGold = new Color(0.501960784313725,0.501960784313725,0,1.0,"HeartGold");
+ public static readonly Color Heliotrope = new Color(0.874509803921569,0.450980392156863,1,1.0,"Heliotrope");
+ public static readonly Color HollywoodCerise = new Color(0.956862745098039,0,0.631372549019608,1.0,"HollywoodCerise");
+ public static readonly Color Honeydew = new Color(0.941176470588235,1,0.941176470588235,1.0,"Honeydew");
+ public static readonly Color HonoluluBlue = new Color(0,0.498039215686275,0.749019607843137,1.0,"HonoluluBlue");
+ public static readonly Color HookerSGreen = new Color(0.286274509803922,0.474509803921569,0.419607843137255,1.0,"HookerSGreen");
+ public static readonly Color HotMagenta = new Color(1,0.113725490196078,0.807843137254902,1.0,"HotMagenta");
+ public static readonly Color HotPink = new Color(1,0.411764705882353,0.705882352941177,1.0,"HotPink");
+ public static readonly Color HunterGreen = new Color(0.207843137254902,0.368627450980392,0.231372549019608,1.0,"HunterGreen");
+ public static readonly Color Iceberg = new Color(0.443137254901961,0.650980392156863,0.823529411764706,1.0,"Iceberg");
+ public static readonly Color Icterine = new Color(0.988235294117647,0.968627450980392,0.368627450980392,1.0,"Icterine");
+ public static readonly Color ImperialBlue = new Color(0,0.137254901960784,0.584313725490196,1.0,"ImperialBlue");
+ public static readonly Color Inchworm = new Color(0.698039215686274,0.925490196078431,0.364705882352941,1.0,"Inchworm");
+ public static readonly Color IndiaGreen = new Color(0.0745098039215686,0.533333333333333,0.0313725490196078,1.0,"IndiaGreen");
+ public static readonly Color IndianRed = new Color(0.803921568627451,0.36078431372549,0.36078431372549,1.0,"IndianRed");
+ public static readonly Color IndianYellow = new Color(0.890196078431373,0.658823529411765,0.341176470588235,1.0,"IndianYellow");
+ public static readonly Color Indigo = new Color(0.435294117647059,0,1,1.0,"Indigo");
+ public static readonly Color IndigoDye = new Color(0,0.254901960784314,0.415686274509804,1.0,"IndigoDye");
+ public static readonly Color IndigoWeb = new Color(0.294117647058824,0,0.509803921568627,1.0,"IndigoWeb");
+ public static readonly Color InternationalKleinBlue = new Color(0,0.184313725490196,0.654901960784314,1.0,"InternationalKleinBlue");
+ public static readonly Color InternationalOrangeAerospace = new Color(1,0.309803921568627,0,1.0,"InternationalOrangeAerospace");
+ public static readonly Color InternationalOrangeEngineering = new Color(0.729411764705882,0.0862745098039216,0.0470588235294118,1.0,"InternationalOrangeEngineering");
+ public static readonly Color InternationalOrangeGoldenGateBridge = new Color(0.752941176470588,0.211764705882353,0.172549019607843,1.0,"InternationalOrangeGoldenGateBridge");
+ public static readonly Color Iris = new Color(0.352941176470588,0.309803921568627,0.811764705882353,1.0,"Iris");
+ public static readonly Color Isabelline = new Color(0.956862745098039,0.941176470588235,0.925490196078431,1.0,"Isabelline");
+ public static readonly Color IslamicGreen = new Color(0,0.564705882352941,0,1.0,"IslamicGreen");
+ public static readonly Color Ivory = new Color(1,1,0.941176470588235,1.0,"Ivory");
+ public static readonly Color Jade = new Color(0,0.658823529411765,0.419607843137255,1.0,"Jade");
+ public static readonly Color Jasmine = new Color(0.972549019607843,0.870588235294118,0.494117647058824,1.0,"Jasmine");
+ public static readonly Color Jasper = new Color(0.843137254901961,0.231372549019608,0.243137254901961,1.0,"Jasper");
+ public static readonly Color JazzberryJam = new Color(0.647058823529412,0.0431372549019608,0.368627450980392,1.0,"JazzberryJam");
+ public static readonly Color Jet = new Color(0.203921568627451,0.203921568627451,0.203921568627451,1.0,"Jet");
+ public static readonly Color Jonquil = new Color(0.980392156862745,0.854901960784314,0.368627450980392,1.0,"Jonquil");
+ public static readonly Color JuneBud = new Color(0.741176470588235,0.854901960784314,0.341176470588235,1.0,"JuneBud");
+ public static readonly Color JungleGreen = new Color(0.16078431372549,0.670588235294118,0.529411764705882,1.0,"JungleGreen");
+ public static readonly Color KellyGreen = new Color(0.298039215686275,0.733333333333333,0.0901960784313725,1.0,"KellyGreen");
+ public static readonly Color KenyanCopper = new Color(0.486274509803922,0.109803921568627,0.0196078431372549,1.0,"KenyanCopper");
+ public static readonly Color KhakiHtmlCssKhaki = new Color(0.764705882352941,0.690196078431373,0.568627450980392,1.0,"KhakiHtmlCssKhaki");
+ public static readonly Color KhakiX11LightKhaki = new Color(0.941176470588235,0.901960784313726,0.549019607843137,1.0,"KhakiX11LightKhaki");
+ public static readonly Color KuCrimson = new Color(0.909803921568627,0,0.0509803921568627,1.0,"KuCrimson");
+ public static readonly Color LaSalleGreen = new Color(0.0313725490196078,0.470588235294118,0.188235294117647,1.0,"LaSalleGreen");
+ public static readonly Color LanguidLavender = new Color(0.83921568627451,0.792156862745098,0.866666666666667,1.0,"LanguidLavender");
+ public static readonly Color LapisLazuli = new Color(0.149019607843137,0.380392156862745,0.611764705882353,1.0,"LapisLazuli");
+ public static readonly Color LaserLemon = new Color(0.996078431372549,0.996078431372549,0.133333333333333,1.0,"LaserLemon");
+ public static readonly Color LaurelGreen = new Color(0.662745098039216,0.729411764705882,0.615686274509804,1.0,"LaurelGreen");
+ public static readonly Color Lava = new Color(0.811764705882353,0.0627450980392157,0.125490196078431,1.0,"Lava");
+ public static readonly Color LavenderBlue = new Color(0.8,0.8,1,1.0,"LavenderBlue");
+ public static readonly Color LavenderBlush = new Color(1,0.941176470588235,0.96078431372549,1.0,"LavenderBlush");
+ public static readonly Color LavenderFloral = new Color(0.709803921568627,0.494117647058824,0.862745098039216,1.0,"LavenderFloral");
+ public static readonly Color LavenderGray = new Color(0.768627450980392,0.764705882352941,0.815686274509804,1.0,"LavenderGray");
+ public static readonly Color LavenderIndigo = new Color(0.580392156862745,0.341176470588235,0.92156862745098,1.0,"LavenderIndigo");
+ public static readonly Color LavenderMagenta = new Color(0.933333333333333,0.509803921568627,0.933333333333333,1.0,"LavenderMagenta");
+ public static readonly Color LavenderMist = new Color(0.901960784313726,0.901960784313726,0.980392156862745,1.0,"LavenderMist");
+ public static readonly Color LavenderPink = new Color(0.984313725490196,0.682352941176471,0.823529411764706,1.0,"LavenderPink");
+ public static readonly Color LavenderPurple = new Color(0.588235294117647,0.482352941176471,0.713725490196078,1.0,"LavenderPurple");
+ public static readonly Color LavenderRose = new Color(0.984313725490196,0.627450980392157,0.890196078431373,1.0,"LavenderRose");
+ public static readonly Color LavenderWeb = new Color(0.901960784313726,0.901960784313726,0.980392156862745,1.0,"LavenderWeb");
+ public static readonly Color LawnGreen = new Color(0.486274509803922,0.988235294117647,0,1.0,"LawnGreen");
+ public static readonly Color Lemon = new Color(1,0.968627450980392,0,1.0,"Lemon");
+ public static readonly Color LemonChiffon = new Color(1,0.980392156862745,0.803921568627451,1.0,"LemonChiffon");
+ public static readonly Color LemonLime = new Color(0.890196078431373,1,0,1.0,"LemonLime");
+ public static readonly Color Licorice = new Color(0.101960784313725,0.0666666666666667,0.0627450980392157,1.0,"Licorice");
+ public static readonly Color LightApricot = new Color(0.992156862745098,0.835294117647059,0.694117647058824,1.0,"LightApricot");
+ public static readonly Color LightBlue = new Color(0.67843137254902,0.847058823529412,0.901960784313726,1.0,"LightBlue");
+ public static readonly Color LightBrown = new Color(0.709803921568627,0.396078431372549,0.113725490196078,1.0,"LightBrown");
+ public static readonly Color LightCarminePink = new Color(0.901960784313726,0.403921568627451,0.443137254901961,1.0,"LightCarminePink");
+ public static readonly Color LightCoral = new Color(0.941176470588235,0.501960784313725,0.501960784313725,1.0,"LightCoral");
+ public static readonly Color LightCornflowerBlue = new Color(0.576470588235294,0.8,0.917647058823529,1.0,"LightCornflowerBlue");
+ public static readonly Color LightCrimson = new Color(0.96078431372549,0.411764705882353,0.568627450980392,1.0,"LightCrimson");
+ public static readonly Color LightCyan = new Color(0.87843137254902,1,1,1.0,"LightCyan");
+ public static readonly Color LightFuchsiaPink = new Color(0.976470588235294,0.517647058823529,0.937254901960784,1.0,"LightFuchsiaPink");
+ public static readonly Color LightGoldenrodYellow = new Color(0.980392156862745,0.980392156862745,0.823529411764706,1.0,"LightGoldenrodYellow");
+ public static readonly Color LightGray = new Color(0.827450980392157,0.827450980392157,0.827450980392157,1.0,"LightGray");
+ public static readonly Color LightGreen = new Color(0.564705882352941,0.933333333333333,0.564705882352941,1.0,"LightGreen");
+ public static readonly Color LightKhaki = new Color(0.941176470588235,0.901960784313726,0.549019607843137,1.0,"LightKhaki");
+ public static readonly Color LightPastelPurple = new Color(0.694117647058824,0.611764705882353,0.850980392156863,1.0,"LightPastelPurple");
+ public static readonly Color LightPink = new Color(1,0.713725490196078,0.756862745098039,1.0,"LightPink");
+ public static readonly Color LightRedOchre = new Color(0.913725490196078,0.454901960784314,0.317647058823529,1.0,"LightRedOchre");
+ public static readonly Color LightSalmon = new Color(1,0.627450980392157,0.47843137254902,1.0,"LightSalmon");
+ public static readonly Color LightSalmonPink = new Color(1,0.6,0.6,1.0,"LightSalmonPink");
+ public static readonly Color LightSeaGreen = new Color(0.125490196078431,0.698039215686274,0.666666666666667,1.0,"LightSeaGreen");
+ public static readonly Color LightSkyBlue = new Color(0.529411764705882,0.807843137254902,0.980392156862745,1.0,"LightSkyBlue");
+ public static readonly Color LightSlateGray = new Color(0.466666666666667,0.533333333333333,0.6,1.0,"LightSlateGray");
+ public static readonly Color LightTaupe = new Color(0.701960784313725,0.545098039215686,0.427450980392157,1.0,"LightTaupe");
+ public static readonly Color LightThulianPink = new Color(0.901960784313726,0.56078431372549,0.674509803921569,1.0,"LightThulianPink");
+ public static readonly Color LightYellow = new Color(1,1,0.87843137254902,1.0,"LightYellow");
+ public static readonly Color Lilac = new Color(0.784313725490196,0.635294117647059,0.784313725490196,1.0,"Lilac");
+ public static readonly Color LimeColorWheel = new Color(0.749019607843137,1,0,1.0,"LimeColorWheel");
+ public static readonly Color LimeGreen = new Color(0.196078431372549,0.803921568627451,0.196078431372549,1.0,"LimeGreen");
+ public static readonly Color LimeWebX11Green = new Color(0,1,0,1.0,"LimeWebX11Green");
+ public static readonly Color Limerick = new Color(0.615686274509804,0.76078431372549,0.0352941176470588,1.0,"Limerick");
+ public static readonly Color LincolnGreen = new Color(0.0980392156862745,0.349019607843137,0.0196078431372549,1.0,"LincolnGreen");
+ public static readonly Color Linen = new Color(0.980392156862745,0.941176470588235,0.901960784313726,1.0,"Linen");
+ public static readonly Color Lion = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"Lion");
+ public static readonly Color LittleBoyBlue = new Color(0.423529411764706,0.627450980392157,0.862745098039216,1.0,"LittleBoyBlue");
+ public static readonly Color Liver = new Color(0.325490196078431,0.294117647058824,0.309803921568627,1.0,"Liver");
+ public static readonly Color Lust = new Color(0.901960784313726,0.125490196078431,0.125490196078431,1.0,"Lust");
+ public static readonly Color Magenta = new Color(1,0,1,1.0,"Magenta");
+ public static readonly Color MagentaDye = new Color(0.792156862745098,0.12156862745098,0.482352941176471,1.0,"MagentaDye");
+ public static readonly Color MagentaProcess = new Color(1,0,0.564705882352941,1.0,"MagentaProcess");
+ public static readonly Color MagicMint = new Color(0.666666666666667,0.941176470588235,0.819607843137255,1.0,"MagicMint");
+ public static readonly Color Magnolia = new Color(0.972549019607843,0.956862745098039,1,1.0,"Magnolia");
+ public static readonly Color Mahogany = new Color(0.752941176470588,0.250980392156863,0,1.0,"Mahogany");
+ public static readonly Color Maize = new Color(0.984313725490196,0.925490196078431,0.364705882352941,1.0,"Maize");
+ public static readonly Color MajorelleBlue = new Color(0.376470588235294,0.313725490196078,0.862745098039216,1.0,"MajorelleBlue");
+ public static readonly Color Malachite = new Color(0.0431372549019608,0.854901960784314,0.317647058823529,1.0,"Malachite");
+ public static readonly Color Manatee = new Color(0.592156862745098,0.603921568627451,0.666666666666667,1.0,"Manatee");
+ public static readonly Color MangoTango = new Color(1,0.509803921568627,0.262745098039216,1.0,"MangoTango");
+ public static readonly Color Mantis = new Color(0.454901960784314,0.764705882352941,0.396078431372549,1.0,"Mantis");
+ public static readonly Color MardiGras = new Color(0.533333333333333,0,0.52156862745098,1.0,"MardiGras");
+ public static readonly Color MaroonCrayola = new Color(0.764705882352941,0.129411764705882,0.282352941176471,1.0,"MaroonCrayola");
+ public static readonly Color MaroonHtmlCss = new Color(0.501960784313725,0,0,1.0,"MaroonHtmlCss");
+ public static readonly Color MaroonX11 = new Color(0.690196078431373,0.188235294117647,0.376470588235294,1.0,"MaroonX11");
+ public static readonly Color Mauve = new Color(0.87843137254902,0.690196078431373,1,1.0,"Mauve");
+ public static readonly Color MauveTaupe = new Color(0.568627450980392,0.372549019607843,0.427450980392157,1.0,"MauveTaupe");
+ public static readonly Color Mauvelous = new Color(0.937254901960784,0.596078431372549,0.666666666666667,1.0,"Mauvelous");
+ public static readonly Color MayaBlue = new Color(0.450980392156863,0.76078431372549,0.984313725490196,1.0,"MayaBlue");
+ public static readonly Color MeatBrown = new Color(0.898039215686275,0.717647058823529,0.231372549019608,1.0,"MeatBrown");
+ public static readonly Color MediumAquamarine = new Color(0.4,0.866666666666667,0.666666666666667,1.0,"MediumAquamarine");
+ public static readonly Color MediumBlue = new Color(0,0,0.803921568627451,1.0,"MediumBlue");
+ public static readonly Color MediumCandyAppleRed = new Color(0.886274509803922,0.0235294117647059,0.172549019607843,1.0,"MediumCandyAppleRed");
+ public static readonly Color MediumCarmine = new Color(0.686274509803922,0.250980392156863,0.207843137254902,1.0,"MediumCarmine");
+ public static readonly Color MediumChampagne = new Color(0.952941176470588,0.898039215686275,0.670588235294118,1.0,"MediumChampagne");
+ public static readonly Color MediumElectricBlue = new Color(0.0117647058823529,0.313725490196078,0.588235294117647,1.0,"MediumElectricBlue");
+ public static readonly Color MediumJungleGreen = new Color(0.109803921568627,0.207843137254902,0.176470588235294,1.0,"MediumJungleGreen");
+ public static readonly Color MediumLavenderMagenta = new Color(0.866666666666667,0.627450980392157,0.866666666666667,1.0,"MediumLavenderMagenta");
+ public static readonly Color MediumOrchid = new Color(0.729411764705882,0.333333333333333,0.827450980392157,1.0,"MediumOrchid");
+ public static readonly Color MediumPersianBlue = new Color(0,0.403921568627451,0.647058823529412,1.0,"MediumPersianBlue");
+ public static readonly Color MediumPurple = new Color(0.576470588235294,0.43921568627451,0.858823529411765,1.0,"MediumPurple");
+ public static readonly Color MediumRedViolet = new Color(0.733333333333333,0.2,0.52156862745098,1.0,"MediumRedViolet");
+ public static readonly Color MediumRuby = new Color(0.666666666666667,0.250980392156863,0.411764705882353,1.0,"MediumRuby");
+ public static readonly Color MediumSeaGreen = new Color(0.235294117647059,0.701960784313725,0.443137254901961,1.0,"MediumSeaGreen");
+ public static readonly Color MediumSlateBlue = new Color(0.482352941176471,0.407843137254902,0.933333333333333,1.0,"MediumSlateBlue");
+ public static readonly Color MediumSpringBud = new Color(0.788235294117647,0.862745098039216,0.529411764705882,1.0,"MediumSpringBud");
+ public static readonly Color MediumSpringGreen = new Color(0,0.980392156862745,0.603921568627451,1.0,"MediumSpringGreen");
+ public static readonly Color MediumTaupe = new Color(0.403921568627451,0.298039215686275,0.27843137254902,1.0,"MediumTaupe");
+ public static readonly Color MediumTurquoise = new Color(0.282352941176471,0.819607843137255,0.8,1.0,"MediumTurquoise");
+ public static readonly Color MediumTuscanRed = new Color(0.474509803921569,0.266666666666667,0.231372549019608,1.0,"MediumTuscanRed");
+ public static readonly Color MediumVermilion = new Color(0.850980392156863,0.376470588235294,0.231372549019608,1.0,"MediumVermilion");
+ public static readonly Color MediumVioletRed = new Color(0.780392156862745,0.0823529411764706,0.52156862745098,1.0,"MediumVioletRed");
+ public static readonly Color MellowApricot = new Color(0.972549019607843,0.72156862745098,0.470588235294118,1.0,"MellowApricot");
+ public static readonly Color MellowYellow = new Color(0.972549019607843,0.870588235294118,0.494117647058824,1.0,"MellowYellow");
+ public static readonly Color Melon = new Color(0.992156862745098,0.737254901960784,0.705882352941177,1.0,"Melon");
+ public static readonly Color MidnightBlue = new Color(0.0980392156862745,0.0980392156862745,0.43921568627451,1.0,"MidnightBlue");
+ public static readonly Color MidnightGreenEagleGreen = new Color(0,0.286274509803922,0.325490196078431,1.0,"MidnightGreenEagleGreen");
+ public static readonly Color MikadoYellow = new Color(1,0.768627450980392,0.0470588235294118,1.0,"MikadoYellow");
+ public static readonly Color Mint = new Color(0.243137254901961,0.705882352941177,0.537254901960784,1.0,"Mint");
+ public static readonly Color MintCream = new Color(0.96078431372549,1,0.980392156862745,1.0,"MintCream");
+ public static readonly Color MintGreen = new Color(0.596078431372549,1,0.596078431372549,1.0,"MintGreen");
+ public static readonly Color MistyRose = new Color(1,0.894117647058824,0.882352941176471,1.0,"MistyRose");
+ public static readonly Color Moccasin = new Color(0.980392156862745,0.92156862745098,0.843137254901961,1.0,"Moccasin");
+ public static readonly Color ModeBeige = new Color(0.588235294117647,0.443137254901961,0.0901960784313725,1.0,"ModeBeige");
+ public static readonly Color MoonstoneBlue = new Color(0.450980392156863,0.662745098039216,0.76078431372549,1.0,"MoonstoneBlue");
+ public static readonly Color MordantRed19 = new Color(0.682352941176471,0.0470588235294118,0,1.0,"MordantRed19");
+ public static readonly Color MossGreen = new Color(0.67843137254902,0.874509803921569,0.67843137254902,1.0,"MossGreen");
+ public static readonly Color MountainMeadow = new Color(0.188235294117647,0.729411764705882,0.56078431372549,1.0,"MountainMeadow");
+ public static readonly Color MountbattenPink = new Color(0.6,0.47843137254902,0.552941176470588,1.0,"MountbattenPink");
+ public static readonly Color MsuGreen = new Color(0.0941176470588235,0.270588235294118,0.231372549019608,1.0,"MsuGreen");
+ public static readonly Color Mulberry = new Color(0.772549019607843,0.294117647058824,0.549019607843137,1.0,"Mulberry");
+ public static readonly Color Mustard = new Color(1,0.858823529411765,0.345098039215686,1.0,"Mustard");
+ public static readonly Color Myrtle = new Color(0.129411764705882,0.258823529411765,0.117647058823529,1.0,"Myrtle");
+ public static readonly Color NadeshikoPink = new Color(0.964705882352941,0.67843137254902,0.776470588235294,1.0,"NadeshikoPink");
+ public static readonly Color NapierGreen = new Color(0.164705882352941,0.501960784313725,0,1.0,"NapierGreen");
+ public static readonly Color NaplesYellow = new Color(0.980392156862745,0.854901960784314,0.368627450980392,1.0,"NaplesYellow");
+ public static readonly Color NavajoWhite = new Color(1,0.870588235294118,0.67843137254902,1.0,"NavajoWhite");
+ public static readonly Color NavyBlue = new Color(0,0,0.501960784313725,1.0,"NavyBlue");
+ public static readonly Color NeonCarrot = new Color(1,0.63921568627451,0.262745098039216,1.0,"NeonCarrot");
+ public static readonly Color NeonFuchsia = new Color(0.996078431372549,0.254901960784314,0.392156862745098,1.0,"NeonFuchsia");
+ public static readonly Color NeonGreen = new Color(0.223529411764706,1,0.0784313725490196,1.0,"NeonGreen");
+ public static readonly Color NewYorkPink = new Color(0.843137254901961,0.513725490196078,0.498039215686275,1.0,"NewYorkPink");
+ public static readonly Color NonPhotoBlue = new Color(0.643137254901961,0.866666666666667,0.929411764705882,1.0,"NonPhotoBlue");
+ public static readonly Color NorthTexasGreen = new Color(0.0196078431372549,0.564705882352941,0.2,1.0,"NorthTexasGreen");
+ public static readonly Color OceanBoatBlue = new Color(0,0.466666666666667,0.745098039215686,1.0,"OceanBoatBlue");
+ public static readonly Color Ochre = new Color(0.8,0.466666666666667,0.133333333333333,1.0,"Ochre");
+ public static readonly Color OfficeGreen = new Color(0,0.501960784313725,0,1.0,"OfficeGreen");
+ public static readonly Color OldGold = new Color(0.811764705882353,0.709803921568627,0.231372549019608,1.0,"OldGold");
+ public static readonly Color OldLace = new Color(0.992156862745098,0.96078431372549,0.901960784313726,1.0,"OldLace");
+ public static readonly Color OldLavender = new Color(0.474509803921569,0.407843137254902,0.470588235294118,1.0,"OldLavender");
+ public static readonly Color OldMauve = new Color(0.403921568627451,0.192156862745098,0.27843137254902,1.0,"OldMauve");
+ public static readonly Color OldRose = new Color(0.752941176470588,0.501960784313725,0.505882352941176,1.0,"OldRose");
+ public static readonly Color Olive = new Color(0.501960784313725,0.501960784313725,0,1.0,"Olive");
+ public static readonly Color OliveDrab7 = new Color(0.235294117647059,0.203921568627451,0.12156862745098,1.0,"OliveDrab7");
+ public static readonly Color OliveDrabWebOliveDrab3 = new Color(0.419607843137255,0.556862745098039,0.137254901960784,1.0,"OliveDrabWebOliveDrab3");
+ public static readonly Color Olivine = new Color(0.603921568627451,0.725490196078431,0.450980392156863,1.0,"Olivine");
+ public static readonly Color Onyx = new Color(0.207843137254902,0.219607843137255,0.223529411764706,1.0,"Onyx");
+ public static readonly Color OperaMauve = new Color(0.717647058823529,0.517647058823529,0.654901960784314,1.0,"OperaMauve");
+ public static readonly Color OrangeColorWheel = new Color(1,0.498039215686275,0,1.0,"OrangeColorWheel");
+ public static readonly Color OrangePeel = new Color(1,0.623529411764706,0,1.0,"OrangePeel");
+ public static readonly Color OrangeRed = new Color(1,0.270588235294118,0,1.0,"OrangeRed");
+ public static readonly Color OrangeRyb = new Color(0.984313725490196,0.6,0.00784313725490196,1.0,"OrangeRyb");
+ public static readonly Color OrangeWebColor = new Color(1,0.647058823529412,0,1.0,"OrangeWebColor");
+ public static readonly Color Orchid = new Color(0.854901960784314,0.43921568627451,0.83921568627451,1.0,"Orchid");
+ public static readonly Color OtterBrown = new Color(0.396078431372549,0.262745098039216,0.129411764705882,1.0,"OtterBrown");
+ public static readonly Color OuCrimsonRed = new Color(0.6,0,0,1.0,"OuCrimsonRed");
+ public static readonly Color OuterSpace = new Color(0.254901960784314,0.290196078431373,0.298039215686275,1.0,"OuterSpace");
+ public static readonly Color OutrageousOrange = new Color(1,0.431372549019608,0.290196078431373,1.0,"OutrageousOrange");
+ public static readonly Color OxfordBlue = new Color(0,0.129411764705882,0.27843137254902,1.0,"OxfordBlue");
+ public static readonly Color PakistanGreen = new Color(0,0.4,0,1.0,"PakistanGreen");
+ public static readonly Color PalatinateBlue = new Color(0.152941176470588,0.231372549019608,0.886274509803922,1.0,"PalatinateBlue");
+ public static readonly Color PalatinatePurple = new Color(0.407843137254902,0.156862745098039,0.376470588235294,1.0,"PalatinatePurple");
+ public static readonly Color PaleAqua = new Color(0.737254901960784,0.831372549019608,0.901960784313726,1.0,"PaleAqua");
+ public static readonly Color PaleBlue = new Color(0.686274509803922,0.933333333333333,0.933333333333333,1.0,"PaleBlue");
+ public static readonly Color PaleBrown = new Color(0.596078431372549,0.462745098039216,0.329411764705882,1.0,"PaleBrown");
+ public static readonly Color PaleCarmine = new Color(0.686274509803922,0.250980392156863,0.207843137254902,1.0,"PaleCarmine");
+ public static readonly Color PaleCerulean = new Color(0.607843137254902,0.768627450980392,0.886274509803922,1.0,"PaleCerulean");
+ public static readonly Color PaleChestnut = new Color(0.866666666666667,0.67843137254902,0.686274509803922,1.0,"PaleChestnut");
+ public static readonly Color PaleCopper = new Color(0.854901960784314,0.541176470588235,0.403921568627451,1.0,"PaleCopper");
+ public static readonly Color PaleCornflowerBlue = new Color(0.670588235294118,0.803921568627451,0.937254901960784,1.0,"PaleCornflowerBlue");
+ public static readonly Color PaleGold = new Color(0.901960784313726,0.745098039215686,0.541176470588235,1.0,"PaleGold");
+ public static readonly Color PaleGoldenrod = new Color(0.933333333333333,0.909803921568627,0.666666666666667,1.0,"PaleGoldenrod");
+ public static readonly Color PaleGreen = new Color(0.596078431372549,0.984313725490196,0.596078431372549,1.0,"PaleGreen");
+ public static readonly Color PaleLavender = new Color(0.862745098039216,0.815686274509804,1,1.0,"PaleLavender");
+ public static readonly Color PaleMagenta = new Color(0.976470588235294,0.517647058823529,0.898039215686275,1.0,"PaleMagenta");
+ public static readonly Color PalePink = new Color(0.980392156862745,0.854901960784314,0.866666666666667,1.0,"PalePink");
+ public static readonly Color PalePlum = new Color(0.866666666666667,0.627450980392157,0.866666666666667,1.0,"PalePlum");
+ public static readonly Color PaleRedViolet = new Color(0.858823529411765,0.43921568627451,0.576470588235294,1.0,"PaleRedViolet");
+ public static readonly Color PaleRobinEggBlue = new Color(0.588235294117647,0.870588235294118,0.819607843137255,1.0,"PaleRobinEggBlue");
+ public static readonly Color PaleSilver = new Color(0.788235294117647,0.752941176470588,0.733333333333333,1.0,"PaleSilver");
+ public static readonly Color PaleSpringBud = new Color(0.925490196078431,0.92156862745098,0.741176470588235,1.0,"PaleSpringBud");
+ public static readonly Color PaleTaupe = new Color(0.737254901960784,0.596078431372549,0.494117647058824,1.0,"PaleTaupe");
+ public static readonly Color PaleVioletRed = new Color(0.858823529411765,0.43921568627451,0.576470588235294,1.0,"PaleVioletRed");
+ public static readonly Color PansyPurple = new Color(0.470588235294118,0.0941176470588235,0.290196078431373,1.0,"PansyPurple");
+ public static readonly Color PapayaWhip = new Color(1,0.937254901960784,0.835294117647059,1.0,"PapayaWhip");
+ public static readonly Color ParisGreen = new Color(0.313725490196078,0.784313725490196,0.470588235294118,1.0,"ParisGreen");
+ public static readonly Color PastelBlue = new Color(0.682352941176471,0.776470588235294,0.811764705882353,1.0,"PastelBlue");
+ public static readonly Color PastelBrown = new Color(0.513725490196078,0.411764705882353,0.325490196078431,1.0,"PastelBrown");
+ public static readonly Color PastelGray = new Color(0.811764705882353,0.811764705882353,0.768627450980392,1.0,"PastelGray");
+ public static readonly Color PastelGreen = new Color(0.466666666666667,0.866666666666667,0.466666666666667,1.0,"PastelGreen");
+ public static readonly Color PastelMagenta = new Color(0.956862745098039,0.603921568627451,0.76078431372549,1.0,"PastelMagenta");
+ public static readonly Color PastelOrange = new Color(1,0.701960784313725,0.27843137254902,1.0,"PastelOrange");
+ public static readonly Color PastelPink = new Color(0.870588235294118,0.647058823529412,0.643137254901961,1.0,"PastelPink");
+ public static readonly Color PastelPurple = new Color(0.701960784313725,0.619607843137255,0.709803921568627,1.0,"PastelPurple");
+ public static readonly Color PastelRed = new Color(1,0.411764705882353,0.380392156862745,1.0,"PastelRed");
+ public static readonly Color PastelViolet = new Color(0.796078431372549,0.6,0.788235294117647,1.0,"PastelViolet");
+ public static readonly Color PastelYellow = new Color(0.992156862745098,0.992156862745098,0.588235294117647,1.0,"PastelYellow");
+ public static readonly Color Patriarch = new Color(0.501960784313725,0,0.501960784313725,1.0,"Patriarch");
+ public static readonly Color PayneSGrey = new Color(0.325490196078431,0.407843137254902,0.470588235294118,1.0,"PayneSGrey");
+ public static readonly Color Peach = new Color(1,0.898039215686275,0.705882352941177,1.0,"Peach");
+ public static readonly Color PeachCrayola = new Color(1,0.796078431372549,0.643137254901961,1.0,"PeachCrayola");
+ public static readonly Color PeachOrange = new Color(1,0.8,0.6,1.0,"PeachOrange");
+ public static readonly Color PeachPuff = new Color(1,0.854901960784314,0.725490196078431,1.0,"PeachPuff");
+ public static readonly Color PeachYellow = new Color(0.980392156862745,0.874509803921569,0.67843137254902,1.0,"PeachYellow");
+ public static readonly Color Pear = new Color(0.819607843137255,0.886274509803922,0.192156862745098,1.0,"Pear");
+ public static readonly Color Pearl = new Color(0.917647058823529,0.87843137254902,0.784313725490196,1.0,"Pearl");
+ public static readonly Color PearlAqua = new Color(0.533333333333333,0.847058823529412,0.752941176470588,1.0,"PearlAqua");
+ public static readonly Color PearlyPurple = new Color(0.717647058823529,0.407843137254902,0.635294117647059,1.0,"PearlyPurple");
+ public static readonly Color Peridot = new Color(0.901960784313726,0.886274509803922,0,1.0,"Peridot");
+ public static readonly Color Periwinkle = new Color(0.8,0.8,1,1.0,"Periwinkle");
+ public static readonly Color PersianBlue = new Color(0.109803921568627,0.223529411764706,0.733333333333333,1.0,"PersianBlue");
+ public static readonly Color PersianGreen = new Color(0,0.650980392156863,0.576470588235294,1.0,"PersianGreen");
+ public static readonly Color PersianIndigo = new Color(0.196078431372549,0.0705882352941176,0.47843137254902,1.0,"PersianIndigo");
+ public static readonly Color PersianOrange = new Color(0.850980392156863,0.564705882352941,0.345098039215686,1.0,"PersianOrange");
+ public static readonly Color PersianPink = new Color(0.968627450980392,0.498039215686275,0.745098039215686,1.0,"PersianPink");
+ public static readonly Color PersianPlum = new Color(0.43921568627451,0.109803921568627,0.109803921568627,1.0,"PersianPlum");
+ public static readonly Color PersianRed = new Color(0.8,0.2,0.2,1.0,"PersianRed");
+ public static readonly Color PersianRose = new Color(0.996078431372549,0.156862745098039,0.635294117647059,1.0,"PersianRose");
+ public static readonly Color Persimmon = new Color(0.925490196078431,0.345098039215686,0,1.0,"Persimmon");
+ public static readonly Color Peru = new Color(0.803921568627451,0.52156862745098,0.247058823529412,1.0,"Peru");
+ public static readonly Color Phlox = new Color(0.874509803921569,0,1,1.0,"Phlox");
+ public static readonly Color PhthaloBlue = new Color(0,0.0588235294117647,0.537254901960784,1.0,"PhthaloBlue");
+ public static readonly Color PhthaloGreen = new Color(0.0705882352941176,0.207843137254902,0.141176470588235,1.0,"PhthaloGreen");
+ public static readonly Color PiggyPink = new Color(0.992156862745098,0.866666666666667,0.901960784313726,1.0,"PiggyPink");
+ public static readonly Color PineGreen = new Color(0.00392156862745098,0.474509803921569,0.435294117647059,1.0,"PineGreen");
+ public static readonly Color Pink = new Color(1,0.752941176470588,0.796078431372549,1.0,"Pink");
+ public static readonly Color PinkLace = new Color(1,0.866666666666667,0.956862745098039,1.0,"PinkLace");
+ public static readonly Color PinkOrange = new Color(1,0.6,0.4,1.0,"PinkOrange");
+ public static readonly Color PinkPearl = new Color(0.905882352941176,0.674509803921569,0.811764705882353,1.0,"PinkPearl");
+ public static readonly Color PinkSherbet = new Color(0.968627450980392,0.56078431372549,0.654901960784314,1.0,"PinkSherbet");
+ public static readonly Color Pistachio = new Color(0.576470588235294,0.772549019607843,0.447058823529412,1.0,"Pistachio");
+ public static readonly Color Platinum = new Color(0.898039215686275,0.894117647058824,0.886274509803922,1.0,"Platinum");
+ public static readonly Color PlumTraditional = new Color(0.556862745098039,0.270588235294118,0.52156862745098,1.0,"PlumTraditional");
+ public static readonly Color PlumWeb = new Color(0.866666666666667,0.627450980392157,0.866666666666667,1.0,"PlumWeb");
+ public static readonly Color PortlandOrange = new Color(1,0.352941176470588,0.211764705882353,1.0,"PortlandOrange");
+ public static readonly Color PowderBlueWeb = new Color(0.690196078431373,0.87843137254902,0.901960784313726,1.0,"PowderBlueWeb");
+ public static readonly Color PrincetonOrange = new Color(1,0.56078431372549,0,1.0,"PrincetonOrange");
+ public static readonly Color Prune = new Color(0.43921568627451,0.109803921568627,0.109803921568627,1.0,"Prune");
+ public static readonly Color PrussianBlue = new Color(0,0.192156862745098,0.325490196078431,1.0,"PrussianBlue");
+ public static readonly Color PsychedelicPurple = new Color(0.874509803921569,0,1,1.0,"PsychedelicPurple");
+ public static readonly Color Puce = new Color(0.8,0.533333333333333,0.6,1.0,"Puce");
+ public static readonly Color Pumpkin = new Color(1,0.458823529411765,0.0941176470588235,1.0,"Pumpkin");
+ public static readonly Color PurpleHeart = new Color(0.411764705882353,0.207843137254902,0.611764705882353,1.0,"PurpleHeart");
+ public static readonly Color PurpleHtmlCss = new Color(0.501960784313725,0,0.501960784313725,1.0,"PurpleHtmlCss");
+ public static readonly Color PurpleMountainMajesty = new Color(0.588235294117647,0.470588235294118,0.713725490196078,1.0,"PurpleMountainMajesty");
+ public static readonly Color PurpleMunsell = new Color(0.623529411764706,0,0.772549019607843,1.0,"PurpleMunsell");
+ public static readonly Color PurplePizzazz = new Color(0.996078431372549,0.305882352941176,0.854901960784314,1.0,"PurplePizzazz");
+ public static readonly Color PurpleTaupe = new Color(0.313725490196078,0.250980392156863,0.301960784313725,1.0,"PurpleTaupe");
+ public static readonly Color PurpleX11 = new Color(0.627450980392157,0.125490196078431,0.941176470588235,1.0,"PurpleX11");
+ public static readonly Color Quartz = new Color(0.317647058823529,0.282352941176471,0.309803921568627,1.0,"Quartz");
+ public static readonly Color Rackley = new Color(0.364705882352941,0.541176470588235,0.658823529411765,1.0,"Rackley");
+ public static readonly Color RadicalRed = new Color(1,0.207843137254902,0.368627450980392,1.0,"RadicalRed");
+ public static readonly Color Rajah = new Color(0.984313725490196,0.670588235294118,0.376470588235294,1.0,"Rajah");
+ public static readonly Color Raspberry = new Color(0.890196078431373,0.0431372549019608,0.364705882352941,1.0,"Raspberry");
+ public static readonly Color RaspberryGlace = new Color(0.568627450980392,0.372549019607843,0.427450980392157,1.0,"RaspberryGlace");
+ public static readonly Color RaspberryPink = new Color(0.886274509803922,0.313725490196078,0.596078431372549,1.0,"RaspberryPink");
+ public static readonly Color RaspberryRose = new Color(0.701960784313725,0.266666666666667,0.423529411764706,1.0,"RaspberryRose");
+ public static readonly Color RawUmber = new Color(0.509803921568627,0.4,0.266666666666667,1.0,"RawUmber");
+ public static readonly Color RazzleDazzleRose = new Color(1,0.2,0.8,1.0,"RazzleDazzleRose");
+ public static readonly Color Razzmatazz = new Color(0.890196078431373,0.145098039215686,0.419607843137255,1.0,"Razzmatazz");
+ public static readonly Color Red = new Color(1,0,0,1.0,"Red");
+ public static readonly Color RedBrown = new Color(0.647058823529412,0.164705882352941,0.164705882352941,1.0,"RedBrown");
+ public static readonly Color RedDevil = new Color(0.525490196078431,0.00392156862745098,0.0666666666666667,1.0,"RedDevil");
+ public static readonly Color RedMunsell = new Color(0.949019607843137,0,0.235294117647059,1.0,"RedMunsell");
+ public static readonly Color RedNcs = new Color(0.768627450980392,0.00784313725490196,0.2,1.0,"RedNcs");
+ public static readonly Color RedOrange = new Color(1,0.325490196078431,0.286274509803922,1.0,"RedOrange");
+ public static readonly Color RedPigment = new Color(0.929411764705882,0.109803921568627,0.141176470588235,1.0,"RedPigment");
+ public static readonly Color RedRyb = new Color(0.996078431372549,0.152941176470588,0.0705882352941176,1.0,"RedRyb");
+ public static readonly Color RedViolet = new Color(0.780392156862745,0.0823529411764706,0.52156862745098,1.0,"RedViolet");
+ public static readonly Color Redwood = new Color(0.670588235294118,0.305882352941176,0.32156862745098,1.0,"Redwood");
+ public static readonly Color Regalia = new Color(0.32156862745098,0.176470588235294,0.501960784313725,1.0,"Regalia");
+ public static readonly Color ResolutionBlue = new Color(0,0.137254901960784,0.529411764705882,1.0,"ResolutionBlue");
+ public static readonly Color RichBlack = new Color(0,0.250980392156863,0.250980392156863,1.0,"RichBlack");
+ public static readonly Color RichBrilliantLavender = new Color(0.945098039215686,0.654901960784314,0.996078431372549,1.0,"RichBrilliantLavender");
+ public static readonly Color RichCarmine = new Color(0.843137254901961,0,0.250980392156863,1.0,"RichCarmine");
+ public static readonly Color RichElectricBlue = new Color(0.0313725490196078,0.572549019607843,0.815686274509804,1.0,"RichElectricBlue");
+ public static readonly Color RichLavender = new Color(0.654901960784314,0.419607843137255,0.811764705882353,1.0,"RichLavender");
+ public static readonly Color RichLilac = new Color(0.713725490196078,0.4,0.823529411764706,1.0,"RichLilac");
+ public static readonly Color RichMaroon = new Color(0.690196078431373,0.188235294117647,0.376470588235294,1.0,"RichMaroon");
+ public static readonly Color RifleGreen = new Color(0.254901960784314,0.282352941176471,0.2,1.0,"RifleGreen");
+ public static readonly Color RobinEggBlue = new Color(0,0.8,0.8,1.0,"RobinEggBlue");
+ public static readonly Color Rose = new Color(1,0,0.498039215686275,1.0,"Rose");
+ public static readonly Color RoseBonbon = new Color(0.976470588235294,0.258823529411765,0.619607843137255,1.0,"RoseBonbon");
+ public static readonly Color RoseEbony = new Color(0.403921568627451,0.282352941176471,0.274509803921569,1.0,"RoseEbony");
+ public static readonly Color RoseGold = new Color(0.717647058823529,0.431372549019608,0.474509803921569,1.0,"RoseGold");
+ public static readonly Color RoseMadder = new Color(0.890196078431373,0.149019607843137,0.211764705882353,1.0,"RoseMadder");
+ public static readonly Color RosePink = new Color(1,0.4,0.8,1.0,"RosePink");
+ public static readonly Color RoseQuartz = new Color(0.666666666666667,0.596078431372549,0.662745098039216,1.0,"RoseQuartz");
+ public static readonly Color RoseTaupe = new Color(0.564705882352941,0.364705882352941,0.364705882352941,1.0,"RoseTaupe");
+ public static readonly Color RoseVale = new Color(0.670588235294118,0.305882352941176,0.32156862745098,1.0,"RoseVale");
+ public static readonly Color Rosewood = new Color(0.396078431372549,0,0.0431372549019608,1.0,"Rosewood");
+ public static readonly Color RossoCorsa = new Color(0.831372549019608,0,0,1.0,"RossoCorsa");
+ public static readonly Color RosyBrown = new Color(0.737254901960784,0.56078431372549,0.56078431372549,1.0,"RosyBrown");
+ public static readonly Color RoyalAzure = new Color(0,0.219607843137255,0.658823529411765,1.0,"RoyalAzure");
+ public static readonly Color RoyalBlueTraditional = new Color(0,0.137254901960784,0.4,1.0,"RoyalBlueTraditional");
+ public static readonly Color RoyalBlueWeb = new Color(0.254901960784314,0.411764705882353,0.882352941176471,1.0,"RoyalBlueWeb");
+ public static readonly Color RoyalFuchsia = new Color(0.792156862745098,0.172549019607843,0.572549019607843,1.0,"RoyalFuchsia");
+ public static readonly Color RoyalPurple = new Color(0.470588235294118,0.317647058823529,0.662745098039216,1.0,"RoyalPurple");
+ public static readonly Color RoyalYellow = new Color(0.980392156862745,0.854901960784314,0.368627450980392,1.0,"RoyalYellow");
+ public static readonly Color RubineRed = new Color(0.819607843137255,0,0.337254901960784,1.0,"RubineRed");
+ public static readonly Color Ruby = new Color(0.87843137254902,0.0666666666666667,0.372549019607843,1.0,"Ruby");
+ public static readonly Color RubyRed = new Color(0.607843137254902,0.0666666666666667,0.117647058823529,1.0,"RubyRed");
+ public static readonly Color Ruddy = new Color(1,0,0.156862745098039,1.0,"Ruddy");
+ public static readonly Color RuddyBrown = new Color(0.733333333333333,0.396078431372549,0.156862745098039,1.0,"RuddyBrown");
+ public static readonly Color RuddyPink = new Color(0.882352941176471,0.556862745098039,0.588235294117647,1.0,"RuddyPink");
+ public static readonly Color Rufous = new Color(0.658823529411765,0.109803921568627,0.0274509803921569,1.0,"Rufous");
+ public static readonly Color Russet = new Color(0.501960784313725,0.274509803921569,0.105882352941176,1.0,"Russet");
+ public static readonly Color Rust = new Color(0.717647058823529,0.254901960784314,0.0549019607843137,1.0,"Rust");
+ public static readonly Color RustyRed = new Color(0.854901960784314,0.172549019607843,0.262745098039216,1.0,"RustyRed");
+ public static readonly Color SacramentoStateGreen = new Color(0,0.337254901960784,0.247058823529412,1.0,"SacramentoStateGreen");
+ public static readonly Color SaddleBrown = new Color(0.545098039215686,0.270588235294118,0.0745098039215686,1.0,"SaddleBrown");
+ public static readonly Color SafetyOrangeBlazeOrange = new Color(1,0.403921568627451,0,1.0,"SafetyOrangeBlazeOrange");
+ public static readonly Color Saffron = new Color(0.956862745098039,0.768627450980392,0.188235294117647,1.0,"Saffron");
+ public static readonly Color Salmon = new Color(1,0.549019607843137,0.411764705882353,1.0,"Salmon");
+ public static readonly Color SalmonPink = new Color(1,0.568627450980392,0.643137254901961,1.0,"SalmonPink");
+ public static readonly Color Sand = new Color(0.76078431372549,0.698039215686274,0.501960784313725,1.0,"Sand");
+ public static readonly Color SandDune = new Color(0.588235294117647,0.443137254901961,0.0901960784313725,1.0,"SandDune");
+ public static readonly Color Sandstorm = new Color(0.925490196078431,0.835294117647059,0.250980392156863,1.0,"Sandstorm");
+ public static readonly Color SandyBrown = new Color(0.956862745098039,0.643137254901961,0.376470588235294,1.0,"SandyBrown");
+ public static readonly Color SandyTaupe = new Color(0.588235294117647,0.443137254901961,0.0901960784313725,1.0,"SandyTaupe");
+ public static readonly Color Sangria = new Color(0.572549019607843,0,0.0392156862745098,1.0,"Sangria");
+ public static readonly Color SapGreen = new Color(0.313725490196078,0.490196078431373,0.164705882352941,1.0,"SapGreen");
+ public static readonly Color Sapphire = new Color(0.0588235294117647,0.32156862745098,0.729411764705882,1.0,"Sapphire");
+ public static readonly Color SapphireBlue = new Color(0,0.403921568627451,0.647058823529412,1.0,"SapphireBlue");
+ public static readonly Color SatinSheenGold = new Color(0.796078431372549,0.631372549019608,0.207843137254902,1.0,"SatinSheenGold");
+ public static readonly Color Scarlet = new Color(1,0.141176470588235,0,1.0,"Scarlet");
+ public static readonly Color ScarletCrayola = new Color(0.992156862745098,0.0549019607843137,0.207843137254902,1.0,"ScarletCrayola");
+ public static readonly Color SchoolBusYellow = new Color(1,0.847058823529412,0,1.0,"SchoolBusYellow");
+ public static readonly Color ScreaminGreen = new Color(0.462745098039216,1,0.47843137254902,1.0,"ScreaminGreen");
+ public static readonly Color SeaBlue = new Color(0,0.411764705882353,0.580392156862745,1.0,"SeaBlue");
+ public static readonly Color SeaGreen = new Color(0.180392156862745,0.545098039215686,0.341176470588235,1.0,"SeaGreen");
+ public static readonly Color SealBrown = new Color(0.196078431372549,0.0784313725490196,0.0784313725490196,1.0,"SealBrown");
+ public static readonly Color Seashell = new Color(1,0.96078431372549,0.933333333333333,1.0,"Seashell");
+ public static readonly Color SelectiveYellow = new Color(1,0.729411764705882,0,1.0,"SelectiveYellow");
+ public static readonly Color Sepia = new Color(0.43921568627451,0.258823529411765,0.0784313725490196,1.0,"Sepia");
+ public static readonly Color Shadow = new Color(0.541176470588235,0.474509803921569,0.364705882352941,1.0,"Shadow");
+ public static readonly Color ShamrockGreen = new Color(0,0.619607843137255,0.376470588235294,1.0,"ShamrockGreen");
+ public static readonly Color ShockingPink = new Color(0.988235294117647,0.0588235294117647,0.752941176470588,1.0,"ShockingPink");
+ public static readonly Color ShockingPinkCrayola = new Color(1,0.435294117647059,1,1.0,"ShockingPinkCrayola");
+ public static readonly Color Sienna = new Color(0.533333333333333,0.176470588235294,0.0901960784313725,1.0,"Sienna");
+ public static readonly Color Silver = new Color(0.752941176470588,0.752941176470588,0.752941176470588,1.0,"Silver");
+ public static readonly Color Sinopia = new Color(0.796078431372549,0.254901960784314,0.0431372549019608,1.0,"Sinopia");
+ public static readonly Color Skobeloff = new Color(0,0.454901960784314,0.454901960784314,1.0,"Skobeloff");
+ public static readonly Color SkyBlue = new Color(0.529411764705882,0.807843137254902,0.92156862745098,1.0,"SkyBlue");
+ public static readonly Color SkyMagenta = new Color(0.811764705882353,0.443137254901961,0.686274509803922,1.0,"SkyMagenta");
+ public static readonly Color SlateBlue = new Color(0.415686274509804,0.352941176470588,0.803921568627451,1.0,"SlateBlue");
+ public static readonly Color SlateGray = new Color(0.43921568627451,0.501960784313725,0.564705882352941,1.0,"SlateGray");
+ public static readonly Color SmaltDarkPowderBlue = new Color(0,0.2,0.6,1.0,"SmaltDarkPowderBlue");
+ public static readonly Color SmokeyTopaz = new Color(0.576470588235294,0.23921568627451,0.254901960784314,1.0,"SmokeyTopaz");
+ public static readonly Color SmokyBlack = new Color(0.0627450980392157,0.0470588235294118,0.0313725490196078,1.0,"SmokyBlack");
+ public static readonly Color Snow = new Color(1,0.980392156862745,0.980392156862745,1.0,"Snow");
+ public static readonly Color SpiroDiscoBall = new Color(0.0588235294117647,0.752941176470588,0.988235294117647,1.0,"SpiroDiscoBall");
+ public static readonly Color SpringBud = new Color(0.654901960784314,0.988235294117647,0,1.0,"SpringBud");
+ public static readonly Color SpringGreen = new Color(0,1,0.498039215686275,1.0,"SpringGreen");
+ public static readonly Color StPatrickSBlue = new Color(0.137254901960784,0.16078431372549,0.47843137254902,1.0,"StPatrickSBlue");
+ public static readonly Color SteelBlue = new Color(0.274509803921569,0.509803921568627,0.705882352941177,1.0,"SteelBlue");
+ public static readonly Color StilDeGrainYellow = new Color(0.980392156862745,0.854901960784314,0.368627450980392,1.0,"StilDeGrainYellow");
+ public static readonly Color Stizza = new Color(0.6,0,0,1.0,"Stizza");
+ public static readonly Color Stormcloud = new Color(0.309803921568627,0.4,0.415686274509804,1.0,"Stormcloud");
+ public static readonly Color Straw = new Color(0.894117647058824,0.850980392156863,0.435294117647059,1.0,"Straw");
+ public static readonly Color Sunglow = new Color(1,0.8,0.2,1.0,"Sunglow");
+ public static readonly Color Sunset = new Color(0.980392156862745,0.83921568627451,0.647058823529412,1.0,"Sunset");
+ public static readonly Color Tan = new Color(0.823529411764706,0.705882352941177,0.549019607843137,1.0,"Tan");
+ public static readonly Color Tangelo = new Color(0.976470588235294,0.301960784313725,0,1.0,"Tangelo");
+ public static readonly Color Tangerine = new Color(0.949019607843137,0.52156862745098,0,1.0,"Tangerine");
+ public static readonly Color TangerineYellow = new Color(1,0.8,0,1.0,"TangerineYellow");
+ public static readonly Color TangoPink = new Color(0.894117647058824,0.443137254901961,0.47843137254902,1.0,"TangoPink");
+ public static readonly Color Taupe = new Color(0.282352941176471,0.235294117647059,0.196078431372549,1.0,"Taupe");
+ public static readonly Color TaupeGray = new Color(0.545098039215686,0.52156862745098,0.537254901960784,1.0,"TaupeGray");
+ public static readonly Color TeaGreen = new Color(0.815686274509804,0.941176470588235,0.752941176470588,1.0,"TeaGreen");
+ public static readonly Color TeaRoseOrange = new Color(0.972549019607843,0.513725490196078,0.474509803921569,1.0,"TeaRoseOrange");
+ public static readonly Color TeaRoseRose = new Color(0.956862745098039,0.76078431372549,0.76078431372549,1.0,"TeaRoseRose");
+ public static readonly Color Teal = new Color(0,0.501960784313725,0.501960784313725,1.0,"Teal");
+ public static readonly Color TealBlue = new Color(0.211764705882353,0.458823529411765,0.533333333333333,1.0,"TealBlue");
+ public static readonly Color TealGreen = new Color(0,0.509803921568627,0.498039215686275,1.0,"TealGreen");
+ public static readonly Color Telemagenta = new Color(0.811764705882353,0.203921568627451,0.462745098039216,1.0,"Telemagenta");
+ public static readonly Color TennTawny = new Color(0.803921568627451,0.341176470588235,0,1.0,"TennTawny");
+ public static readonly Color TerraCotta = new Color(0.886274509803922,0.447058823529412,0.356862745098039,1.0,"TerraCotta");
+ public static readonly Color Thistle = new Color(0.847058823529412,0.749019607843137,0.847058823529412,1.0,"Thistle");
+ public static readonly Color ThulianPink = new Color(0.870588235294118,0.435294117647059,0.631372549019608,1.0,"ThulianPink");
+ public static readonly Color TickleMePink = new Color(0.988235294117647,0.537254901960784,0.674509803921569,1.0,"TickleMePink");
+ public static readonly Color TiffanyBlue = new Color(0.0392156862745098,0.729411764705882,0.709803921568627,1.0,"TiffanyBlue");
+ public static readonly Color TigerSEye = new Color(0.87843137254902,0.552941176470588,0.235294117647059,1.0,"TigerSEye");
+ public static readonly Color Timberwolf = new Color(0.858823529411765,0.843137254901961,0.823529411764706,1.0,"Timberwolf");
+ public static readonly Color TitaniumYellow = new Color(0.933333333333333,0.901960784313726,0,1.0,"TitaniumYellow");
+ public static readonly Color Tomato = new Color(1,0.388235294117647,0.27843137254902,1.0,"Tomato");
+ public static readonly Color Toolbox = new Color(0.454901960784314,0.423529411764706,0.752941176470588,1.0,"Toolbox");
+ public static readonly Color Topaz = new Color(1,0.784313725490196,0.486274509803922,1.0,"Topaz");
+ public static readonly Color TractorRed = new Color(0.992156862745098,0.0549019607843137,0.207843137254902,1.0,"TractorRed");
+ public static readonly Color TrolleyGrey = new Color(0.501960784313725,0.501960784313725,0.501960784313725,1.0,"TrolleyGrey");
+ public static readonly Color TropicalRainForest = new Color(0,0.458823529411765,0.368627450980392,1.0,"TropicalRainForest");
+ public static readonly Color TrueBlue = new Color(0,0.450980392156863,0.811764705882353,1.0,"TrueBlue");
+ public static readonly Color TuftsBlue = new Color(0.254901960784314,0.490196078431373,0.756862745098039,1.0,"TuftsBlue");
+ public static readonly Color Tumbleweed = new Color(0.870588235294118,0.666666666666667,0.533333333333333,1.0,"Tumbleweed");
+ public static readonly Color TurkishRose = new Color(0.709803921568627,0.447058823529412,0.505882352941176,1.0,"TurkishRose");
+ public static readonly Color Turquoise = new Color(0.188235294117647,0.835294117647059,0.784313725490196,1.0,"Turquoise");
+ public static readonly Color TurquoiseBlue = new Color(0,1,0.937254901960784,1.0,"TurquoiseBlue");
+ public static readonly Color TurquoiseGreen = new Color(0.627450980392157,0.83921568627451,0.705882352941177,1.0,"TurquoiseGreen");
+ public static readonly Color TuscanRed = new Color(0.486274509803922,0.282352941176471,0.282352941176471,1.0,"TuscanRed");
+ public static readonly Color TwilightLavender = new Color(0.541176470588235,0.286274509803922,0.419607843137255,1.0,"TwilightLavender");
+ public static readonly Color TyrianPurple = new Color(0.4,0.00784313725490196,0.235294117647059,1.0,"TyrianPurple");
+ public static readonly Color UaBlue = new Color(0,0.2,0.666666666666667,1.0,"UaBlue");
+ public static readonly Color UaRed = new Color(0.850980392156863,0,0.298039215686275,1.0,"UaRed");
+ public static readonly Color Ube = new Color(0.533333333333333,0.470588235294118,0.764705882352941,1.0,"Ube");
+ public static readonly Color UclaBlue = new Color(0.325490196078431,0.407843137254902,0.584313725490196,1.0,"UclaBlue");
+ public static readonly Color UclaGold = new Color(1,0.701960784313725,0,1.0,"UclaGold");
+ public static readonly Color UfoGreen = new Color(0.235294117647059,0.815686274509804,0.43921568627451,1.0,"UfoGreen");
+ public static readonly Color UltraPink = new Color(1,0.435294117647059,1,1.0,"UltraPink");
+ public static readonly Color Ultramarine = new Color(0.0705882352941176,0.0392156862745098,0.56078431372549,1.0,"Ultramarine");
+ public static readonly Color UltramarineBlue = new Color(0.254901960784314,0.4,0.96078431372549,1.0,"UltramarineBlue");
+ public static readonly Color Umber = new Color(0.388235294117647,0.317647058823529,0.27843137254902,1.0,"Umber");
+ public static readonly Color UnbleachedSilk = new Color(1,0.866666666666667,0.792156862745098,1.0,"UnbleachedSilk");
+ public static readonly Color UnitedNationsBlue = new Color(0.356862745098039,0.572549019607843,0.898039215686275,1.0,"UnitedNationsBlue");
+ public static readonly Color UniversityOfCaliforniaGold = new Color(0.717647058823529,0.529411764705882,0.152941176470588,1.0,"UniversityOfCaliforniaGold");
+ public static readonly Color UnmellowYellow = new Color(1,1,0.4,1.0,"UnmellowYellow");
+ public static readonly Color UpForestGreen = new Color(0.00392156862745098,0.266666666666667,0.129411764705882,1.0,"UpForestGreen");
+ public static readonly Color UpMaroon = new Color(0.482352941176471,0.0666666666666667,0.0745098039215686,1.0,"UpMaroon");
+ public static readonly Color UpsdellRed = new Color(0.682352941176471,0.125490196078431,0.16078431372549,1.0,"UpsdellRed");
+ public static readonly Color Urobilin = new Color(0.882352941176471,0.67843137254902,0.129411764705882,1.0,"Urobilin");
+ public static readonly Color UsafaBlue = new Color(0,0.309803921568627,0.596078431372549,1.0,"UsafaBlue");
+ public static readonly Color UscCardinal = new Color(0.6,0,0,1.0,"UscCardinal");
+ public static readonly Color UscGold = new Color(1,0.8,0,1.0,"UscGold");
+ public static readonly Color UtahCrimson = new Color(0.827450980392157,0,0.247058823529412,1.0,"UtahCrimson");
+ public static readonly Color Vanilla = new Color(0.952941176470588,0.898039215686275,0.670588235294118,1.0,"Vanilla");
+ public static readonly Color VegasGold = new Color(0.772549019607843,0.701960784313725,0.345098039215686,1.0,"VegasGold");
+ public static readonly Color VenetianRed = new Color(0.784313725490196,0.0313725490196078,0.0823529411764706,1.0,"VenetianRed");
+ public static readonly Color Verdigris = new Color(0.262745098039216,0.701960784313725,0.682352941176471,1.0,"Verdigris");
+ public static readonly Color VermilionCinnabar = new Color(0.890196078431373,0.258823529411765,0.203921568627451,1.0,"VermilionCinnabar");
+ public static readonly Color VermilionPlochere = new Color(0.850980392156863,0.376470588235294,0.231372549019608,1.0,"VermilionPlochere");
+ public static readonly Color Veronica = new Color(0.627450980392157,0.125490196078431,0.941176470588235,1.0,"Veronica");
+ public static readonly Color Violet = new Color(0.56078431372549,0,1,1.0,"Violet");
+ public static readonly Color VioletBlue = new Color(0.196078431372549,0.290196078431373,0.698039215686274,1.0,"VioletBlue");
+ public static readonly Color VioletColorWheel = new Color(0.498039215686275,0,1,1.0,"VioletColorWheel");
+ public static readonly Color VioletRyb = new Color(0.525490196078431,0.00392156862745098,0.686274509803922,1.0,"VioletRyb");
+ public static readonly Color VioletWeb = new Color(0.933333333333333,0.509803921568627,0.933333333333333,1.0,"VioletWeb");
+ public static readonly Color Viridian = new Color(0.250980392156863,0.509803921568627,0.427450980392157,1.0,"Viridian");
+ public static readonly Color VividAuburn = new Color(0.572549019607843,0.152941176470588,0.141176470588235,1.0,"VividAuburn");
+ public static readonly Color VividBurgundy = new Color(0.623529411764706,0.113725490196078,0.207843137254902,1.0,"VividBurgundy");
+ public static readonly Color VividCerise = new Color(0.854901960784314,0.113725490196078,0.505882352941176,1.0,"VividCerise");
+ public static readonly Color VividTangerine = new Color(1,0.627450980392157,0.537254901960784,1.0,"VividTangerine");
+ public static readonly Color VividViolet = new Color(0.623529411764706,0,1,1.0,"VividViolet");
+ public static readonly Color WarmBlack = new Color(0,0.258823529411765,0.258823529411765,1.0,"WarmBlack");
+ public static readonly Color Waterspout = new Color(0.643137254901961,0.956862745098039,0.976470588235294,1.0,"Waterspout");
+ public static readonly Color Wenge = new Color(0.392156862745098,0.329411764705882,0.32156862745098,1.0,"Wenge");
+ public static readonly Color Wheat = new Color(0.96078431372549,0.870588235294118,0.701960784313725,1.0,"Wheat");
+ public static readonly Color White = new Color(1,1,1,1.0,"White");
+ public static readonly Color WhiteSmoke = new Color(0.96078431372549,0.96078431372549,0.96078431372549,1.0,"WhiteSmoke");
+ public static readonly Color WildBlueYonder = new Color(0.635294117647059,0.67843137254902,0.815686274509804,1.0,"WildBlueYonder");
+ public static readonly Color WildStrawberry = new Color(1,0.262745098039216,0.643137254901961,1.0,"WildStrawberry");
+ public static readonly Color WildWatermelon = new Color(0.988235294117647,0.423529411764706,0.52156862745098,1.0,"WildWatermelon");
+ public static readonly Color Wine = new Color(0.447058823529412,0.184313725490196,0.215686274509804,1.0,"Wine");
+ public static readonly Color WineDregs = new Color(0.403921568627451,0.192156862745098,0.27843137254902,1.0,"WineDregs");
+ public static readonly Color Wisteria = new Color(0.788235294117647,0.627450980392157,0.862745098039216,1.0,"Wisteria");
+ public static readonly Color WoodBrown = new Color(0.756862745098039,0.603921568627451,0.419607843137255,1.0,"WoodBrown");
+ public static readonly Color Xanadu = new Color(0.450980392156863,0.525490196078431,0.470588235294118,1.0,"Xanadu");
+ public static readonly Color YaleBlue = new Color(0.0588235294117647,0.301960784313725,0.572549019607843,1.0,"YaleBlue");
+ public static readonly Color Yellow = new Color(1,1,0,1.0,"Yellow");
+ public static readonly Color YellowGreen = new Color(0.603921568627451,0.803921568627451,0.196078431372549,1.0,"YellowGreen");
+ public static readonly Color YellowMunsell = new Color(0.937254901960784,0.8,0,1.0,"YellowMunsell");
+ public static readonly Color YellowNcs = new Color(1,0.827450980392157,0,1.0,"YellowNcs");
+ public static readonly Color YellowOrange = new Color(1,0.682352941176471,0.258823529411765,1.0,"YellowOrange");
+ public static readonly Color YellowProcess = new Color(1,0.937254901960784,0,1.0,"YellowProcess");
+ public static readonly Color YellowRyb = new Color(0.996078431372549,0.996078431372549,0.2,1.0,"YellowRyb");
+ public static readonly Color Zaffre = new Color(0,0.0784313725490196,0.658823529411765,1.0,"Zaffre");
+ public static readonly Color ZinnwalditeBrown = new Color(0.172549019607843,0.0862745098039216,0.0313725490196078,1.0,"ZinnwalditeBrown");
+ #endregion
+
+ #region IXmlSerializable
+ public void ReadXml(System.Xml.XmlReader reader)
+ {
+ string[] c = reader["Color"].Split(new char[] { ';' });
+ R = double.Parse(c[0]);
+ G = double.Parse(c[1]);
+ B = double.Parse(c[2]);
+ A = double.Parse(c[3]);
+ }
+ public void WriteXml(System.Xml.XmlWriter writer)
+ {
+ writer.WriteAttributeString("Color", this.ToString());
+ }
+ public System.Xml.Schema.XmlSchema GetSchema()
+ {
+ return null;
+ }
+ #endregion
+
+ public override string ToString()
+ {
+ if (!string.IsNullOrEmpty(Name))
+ return Name;
+
+ foreach (Color cr in ColorDic)
+ {
+ if (cr == this)
+ {
+ Name = cr.Name;
+ return cr.Name;
+ }
+ }
+
+ return string.Format("{0};{1};{2};{3}", R, G, B, A);
+ }
+
+ public static object Parse(string s)
+ {
+ return (Color)s;
+ }
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace Crow\r
-{\r
- public class DynAttribute\r
- {\r
- public GraphicObject Source;\r
- public string MemberName;\r
- public String Value;\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Crow
+{
+ public class DynAttribute
+ {
+ public GraphicObject Source;
+ public string MemberName;
+ public String Value;
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace Crow\r
-{\r
- public enum Orientation\r
- {\r
- Horizontal,\r
- Vertical\r
- }\r
- public enum Alignment\r
- {\r
- None,\r
- TopCenter,\r
- TopStretch,\r
- LeftCenter,\r
- LeftStretch,\r
- RightCenter,\r
- RightStretch,\r
- BottomCenter,\r
- BottomStretch,\r
- TopLeft,\r
- TopRight,\r
- BottomLeft,\r
- BottomRight,\r
- Center,\r
- Fit,\r
- HorizontalStretch,\r
- VerticalStretch\r
- }\r
-\r
- public enum PanelBorderPosition\r
- {\r
- Top,\r
- Left,\r
- Right,\r
- Bottom,\r
- TopLeft,\r
- TopRight,\r
- BottomLeft,\r
- BottomRight,\r
- Moving,\r
- Closing,\r
- ClientArea\r
- }\r
- public enum HorizontalAlignment\r
- {\r
- Left,\r
- Right,\r
- Center,\r
- }\r
- public enum VerticalAlignment\r
- {\r
- Top,\r
- Bottom,\r
- Center,\r
- }\r
-\r
- public enum RectanglesRelations\r
- {\r
- NoRelation, //nothing to do\r
- Intersect, //clipped clear & repaint, no test\r
- Contains, //clipped clear & repaint, test children\r
- Equal //repaint, no test\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Crow
+{
+ public enum Orientation
+ {
+ Horizontal,
+ Vertical
+ }
+ public enum Alignment
+ {
+ None,
+ TopCenter,
+ TopStretch,
+ LeftCenter,
+ LeftStretch,
+ RightCenter,
+ RightStretch,
+ BottomCenter,
+ BottomStretch,
+ TopLeft,
+ TopRight,
+ BottomLeft,
+ BottomRight,
+ Center,
+ Fit,
+ HorizontalStretch,
+ VerticalStretch
+ }
+
+ public enum PanelBorderPosition
+ {
+ Top,
+ Left,
+ Right,
+ Bottom,
+ TopLeft,
+ TopRight,
+ BottomLeft,
+ BottomRight,
+ Moving,
+ Closing,
+ ClientArea
+ }
+ public enum HorizontalAlignment
+ {
+ Left,
+ Right,
+ Center,
+ }
+ public enum VerticalAlignment
+ {
+ Top,
+ Bottom,
+ Center,
+ }
+
+ public enum RectanglesRelations
+ {
+ NoRelation, //nothing to do
+ Intersect, //clipped clear & repaint, no test
+ Contains, //clipped clear & repaint, test children
+ Equal //repaint, no test
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-//using OpenTK.Graphics.OpenGL;\r
-\r
-using System.Diagnostics;\r
-\r
-using System.Xml.Serialization;\r
-using Cairo;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-\r
-namespace Crow\r
-{\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
- }\r
- #endregion\r
-\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
- 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
- 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 Caption {\r
- get { return caption; } \r
- set {\r
- if (caption == value)\r
- return;\r
- caption = value; \r
- NotifyValueChanged ("Caption", caption);\r
- }\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
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+//using OpenTK.Graphics.OpenGL;
+
+using System.Diagnostics;
+
+using System.Xml.Serialization;
+using Cairo;
+using OpenTK.Input;
+using System.ComponentModel;
+
+namespace Crow
+{
+ [DefaultTemplate("#Crow.Templates.Button.crow")]
+ public class Button : TemplatedContainer
+ {
+ #region CTOR
+ public Button() : base()
+ {
+ //MouseEnter += delegate { Background = Color.RedDevil;};
+ //MouseLeave += delegate { Background = Color.Transparent;};
+// MouseButtonDown += delegate { BackImgSub = "pressed"; registerForGraphicUpdate();};
+// MouseButtonUp += delegate { BackImgSub = "normal";registerForGraphicUpdate();};
+ }
+ #endregion
+
+ string caption;
+ string image;
+ Container _contentContainer;
+
+ public override GraphicObject Content {
+ get {
+ return _contentContainer == null ? null : _contentContainer.Child;
+ }
+ set {
+ if (_contentContainer != null)
+ _contentContainer.SetChild(value);
+ }
+ }
+ protected override void loadTemplate(GraphicObject template = null)
+ {
+ base.loadTemplate (template);
+
+ _contentContainer = this.child.FindByName ("Content") as Container;
+ }
+
+ #region GraphicObject Overrides
+// [XmlAttributeAttribute()][DefaultValue(50)]
+// public override int Width {
+// get { return base.Width; }
+// set { base.Width = value; }
+// }
+// [XmlAttributeAttribute()][DefaultValue(20)]
+// public override int Height {
+// get { return base.Height; }
+// set { base.Height = value; }
+// }
+ [XmlAttributeAttribute()][DefaultValue(true)]
+ public override bool Focusable
+ {
+ get { return base.Focusable; }
+ set { base.Focusable = value; }
+ }
+ public override void ResolveBindings ()
+ {
+ base.ResolveBindings ();
+ if (Content != null)
+ Content.ResolveBindings ();
+ }
+ public override void onMouseDown (object sender, MouseButtonEventArgs e)
+ {
+ base.onMouseDown (sender, e);
+ NotifyValueChanged ("State", "pressed");
+ }
+ public override void onMouseUp (object sender, MouseButtonEventArgs e)
+ {
+ base.onMouseUp (sender, e);
+ NotifyValueChanged ("State", "normal");
+ }
+ #endregion
+
+ [XmlAttributeAttribute()][DefaultValue("Button")]
+ public string Caption {
+ get { return caption; }
+ set {
+ if (caption == value)
+ return;
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue("#Crow.Images.button.svg")]
+ public string Image {
+ get { return image; }
+ set {
+ if (image == value)
+ return;
+ image = value;
+ NotifyValueChanged ("Image", image);
+ }
+ }
+ }
+}
-using System;\r
-\r
-\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-//using OpenTK.Graphics.OpenGL;\r
-\r
-using Cairo;\r
-\r
-using winColors = System.Drawing.Color;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-\r
-namespace Crow\r
-{\r
- [DefaultTemplate("#Crow.Templates.CheckBox.goml")]\r
- public class CheckBox : TemplatedControl\r
- { \r
- string caption;\r
- string image;\r
- bool isChecked;\r
-\r
- #region CTOR\r
- public CheckBox() : base()\r
- { \r
- } \r
- #endregion\r
-\r
- public event EventHandler Checked;\r
- public event EventHandler Unchecked;\r
-\r
- #region GraphicObject overrides\r
-// [XmlAttributeAttribute()][DefaultValue(-1)]\r
-// public override int Height {\r
-// get { return base.Height; }\r
-// set { base.Height = value; }\r
-// }\r
- [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
- public override bool Focusable\r
- {\r
- get { return base.Focusable; }\r
- set { base.Focusable = value; }\r
- }\r
- #endregion\r
-\r
- [XmlAttributeAttribute()][DefaultValue("Checkbox")]\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
- } \r
- [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.checkbox.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
- [XmlAttributeAttribute()][DefaultValue(false)]\r
- public bool IsChecked\r
- {\r
- get { return isChecked; }\r
- set\r
- {\r
- isChecked = value;\r
-\r
- NotifyValueChanged ("IsChecked", value);\r
- if (isChecked) {\r
- NotifyValueChanged ("SvgSub", "checked");\r
- Checked.Raise (this, null);\r
- } else {\r
- NotifyValueChanged ("SvgSub", "unchecked");\r
- Unchecked.Raise (this, null);\r
- }\r
- }\r
- }\r
- public override void onMouseClick (object sender, MouseButtonEventArgs e)\r
- {\r
- IsChecked = !IsChecked;\r
- base.onMouseClick (sender, e);\r
- }\r
- }\r
-}\r
+using System;
+
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+//using OpenTK.Graphics.OpenGL;
+
+using Cairo;
+
+using winColors = System.Drawing.Color;
+using System.Diagnostics;
+using System.Xml.Serialization;
+using OpenTK.Input;
+using System.ComponentModel;
+
+namespace Crow
+{
+ [DefaultTemplate("#Crow.Templates.CheckBox.goml")]
+ public class CheckBox : TemplatedControl
+ {
+ string caption;
+ string image;
+ bool isChecked;
+
+ #region CTOR
+ public CheckBox() : base()
+ {
+ }
+ #endregion
+
+ public event EventHandler Checked;
+ public event EventHandler Unchecked;
+
+ #region GraphicObject overrides
+// [XmlAttributeAttribute()][DefaultValue(-1)]
+// public override int Height {
+// get { return base.Height; }
+// set { base.Height = value; }
+// }
+ [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true
+ public override bool Focusable
+ {
+ get { return base.Focusable; }
+ set { base.Focusable = value; }
+ }
+ #endregion
+
+ [XmlAttributeAttribute()][DefaultValue("Checkbox")]
+ public string Caption {
+ get { return caption; }
+ set {
+ if (caption == value)
+ return;
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.checkbox.svg")]
+ public string Image {
+ get { return image; }
+ set {
+ if (image == value)
+ return;
+ image = value;
+ NotifyValueChanged ("Image", image);
+ }
+ }
+
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public bool IsChecked
+ {
+ get { return isChecked; }
+ set
+ {
+ isChecked = value;
+
+ NotifyValueChanged ("IsChecked", value);
+ if (isChecked) {
+ NotifyValueChanged ("SvgSub", "checked");
+ Checked.Raise (this, null);
+ } else {
+ NotifyValueChanged ("SvgSub", "unchecked");
+ Unchecked.Raise (this, null);
+ }
+ }
+ }
+ public override void onMouseClick (object sender, MouseButtonEventArgs e)
+ {
+ IsChecked = !IsChecked;
+ base.onMouseClick (sender, e);
+ }
+ }
+}
-using System;\r
-\r
-\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-//using OpenTK.Graphics.OpenGL;\r
-\r
-using Cairo;\r
-\r
-using winColors = System.Drawing.Color;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-using System.Xml;\r
-using System.IO;\r
-using System.Collections;\r
-using System.Threading;\r
-\r
-namespace Crow\r
-{\r
- [DefaultTemplate("#Crow.Templates.ComboBox.goml")]\r
- [DefaultOverlayTemplate("#Crow.Templates.ComboBoxOverlay.goml")]\r
- public class ComboBox : TemplatedContainer\r
- { \r
- #region CTOR\r
- public ComboBox() : base(){ } \r
- #endregion\r
-\r
- bool _isPopped;\r
- string caption;\r
- GraphicObject _overlay;\r
- Group _list;\r
- IList data;\r
- int _selectedIndex;\r
- object _selectedItem;\r
- string _itemTemplate;\r
- string _overlayTemplate;\r
-\r
- public event EventHandler Pop;\r
- public event EventHandler Unpop;\r
- public event EventHandler<SelectionChangeEventArgs> SelectedItemChanged;\r
-\r
- #region implemented abstract members of TemplatedControl\r
- protected override void loadTemplate (GraphicObject template)\r
- {\r
- base.loadTemplate (template);\r
- loadOverlayTemplate (null);\r
- }\r
- public override GraphicObject Content {\r
- get {\r
- throw new NotImplementedException ();\r
- }\r
- set {\r
- throw new NotImplementedException ();\r
- }\r
- }\r
- #endregion\r
-\r
- protected virtual void loadOverlayTemplate(GraphicObject overlayTemplate)\r
- {\r
- if (overlayTemplate == null) {\r
- DefaultOverlayTemplate dt = (DefaultOverlayTemplate)this.GetType ().GetCustomAttributes (typeof(DefaultOverlayTemplate), true).FirstOrDefault ();\r
- Overlay = Interface.Load (dt.Path);\r
- Overlay.ResolveBindings ();\r
- } else\r
- Overlay = overlayTemplate;\r
- _list = Overlay.FindByName ("List") as Group;\r
- }\r
-\r
- [XmlAttributeAttribute][DefaultValue("#Crow.Templates.ItemTemplate.goml")]\r
- public string ItemTemplate {\r
- get { return _itemTemplate; }\r
- set { \r
- //TODO:reload list with new template?\r
- _itemTemplate = value; \r
- }\r
- }\r
- [XmlAttributeAttribute][DefaultValue("#Crow.Templates.ComboBoxOverlay.goml")]\r
- public string OverlayTemplate {\r
- get { return _overlayTemplate; }\r
- set { \r
- //TODO:reload list with new template?\r
- _overlayTemplate = value; \r
-\r
- Overlay = Interface.Load (_overlayTemplate);\r
- Overlay.ResolveBindings ();\r
- _list = Overlay.FindByName ("List") as Group;\r
- }\r
- }\r
- [XmlAttributeAttribute][DefaultValue(-1)]\r
- public int SelectedIndex{\r
- get { return _selectedIndex; }\r
- set { \r
- //store value event if data is null, because in xml parsing selindex is always\r
- //before data, so it's impossible without that trick to set a default index in goml\r
- _selectedIndex = value; \r
- \r
- if (data == null) \r
- return;\r
- \r
- if (_selectedIndex > data.Count - 1 || _selectedIndex < 0)\r
- throw new Exception ("Combobox SelectedIndex out of range");\r
-\r
-\r
- _selectedItem = data [_selectedIndex];\r
- NotifyValueChanged ("SelectedIndex", SelectedIndex);\r
- SelectedItemChanged.Raise (this, new SelectionChangeEventArgs(_selectedItem));\r
-\r
- if (SelectedItem == null)\r
- Caption = "";\r
- else\r
- Caption = _selectedItem.ToString ();\r
- }\r
- }\r
- public object SelectedItem{\r
- set {\r
- if (_selectedItem == value)\r
- return;\r
-\r
- _selectedItem = value;\r
- _selectedIndex = data.IndexOf (_selectedItem);\r
- NotifyValueChanged ("SelectedIndex", _selectedIndex);\r
- SelectedItemChanged.Raise (this, new SelectionChangeEventArgs(_selectedItem));\r
-\r
- if (SelectedItem == null)\r
- Caption = "";\r
- else\r
- Caption = _selectedItem.ToString ();\r
- }\r
-\r
- get { return _selectedItem; }\r
- }\r
- [XmlAttributeAttribute][DefaultValue(null)]\r
- public IList Data {\r
- get {\r
- return data;\r
- }\r
- set { \r
- data = value;\r
- if (_list == null)\r
- return;\r
-\r
- foreach (GraphicObject c in _list.Children) {\r
- c.ClearBinding ();\r
- }\r
- _list.Children.Clear ();\r
- _list.registerForGraphicUpdate ();\r
- if (data == null)\r
- return;\r
- if (SelectedIndex < 0)\r
- return;\r
-\r
- //force raise of changes\r
- SelectedIndex = SelectedIndex;\r
-\r
- pendingChildrenAddition = new Queue<GraphicObject> ();\r
- threadedLoadingFinished = false;\r
-\r
- Thread t = new Thread (loadingThread);\r
- t.Start ();\r
- t.Join ();\r
-\r
- }\r
- }\r
- public override void UpdateLayout (LayoutingType layoutType)\r
- {\r
- CheckPendingChildrenAddition ();\r
- base.UpdateLayout (layoutType);\r
- }\r
- internal void CheckPendingChildrenAddition()\r
- {\r
- if (pendingChildrenAddition == null)\r
- return;\r
- lock (pendingChildrenAddition) {\r
- if (!threadedLoadingFinished && pendingChildrenAddition.Count < 50)\r
- return;\r
- while (pendingChildrenAddition.Count > 0) {\r
- _list.addChild (pendingChildrenAddition.Dequeue ());\r
- }\r
- }\r
- }\r
-\r
- volatile Queue<GraphicObject> pendingChildrenAddition;\r
- volatile bool threadedLoadingFinished = false;\r
-\r
- void loadingThread()\r
- {\r
- #if DEBUG_LOAD_TIME\r
- Stopwatch loadingTime = new Stopwatch ();\r
- loadingTime.Start ();\r
- #endif\r
-\r
- MemoryStream ms = new MemoryStream ();\r
- lock (ItemTemplate) {\r
- using (Stream stream = Interface.GetStreamFromPath (ItemTemplate))\r
- stream.CopyTo (ms);\r
- }\r
-\r
- Type t = Interface.GetTopContainerOfGOMLStream (ms);\r
-\r
- foreach (var item in data) {\r
- ms.Seek(0,SeekOrigin.Begin);\r
- GraphicObject g = Interface.Load (ms, t);\r
- g.DataSource = item;\r
- g.MouseClick += itemClick;\r
-\r
- lock (pendingChildrenAddition) {\r
- pendingChildrenAddition.Enqueue (g);\r
- }\r
- }\r
-\r
- ms.Dispose (); \r
-\r
- threadedLoadingFinished = true;\r
-\r
- #if DEBUG_LOAD_TIME\r
- loadingTime.Stop ();\r
- Debug.WriteLine("Listbox {2} Loading: {0} ticks \t, {1} ms",\r
- loadingTime.ElapsedTicks,\r
- loadingTime.ElapsedMilliseconds, this.ToString());\r
- #endif\r
- }\r
- public GraphicObject Overlay {\r
- get { return _overlay; }\r
- set { \r
- if (_overlay != null) {\r
- _overlay.LayoutChanged -= _overlay_LayoutChanged;\r
- _overlay.MouseLeave -= _overlay_MouseLeave;\r
- _overlay.LogicalParent = null;\r
- }\r
-\r
- _overlay = value; \r
-\r
- if (_overlay == null)\r
- return;\r
-\r
- _overlay.LogicalParent = this;\r
- _overlay.Focusable = true;\r
- _overlay.LayoutChanged += _overlay_LayoutChanged;\r
- _overlay.MouseLeave += _overlay_MouseLeave;\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue("Combobox")]\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
- } \r
- [XmlAttributeAttribute()][DefaultValue(false)]\r
- public bool IsPopped\r
- {\r
- get { return _isPopped; }\r
- set\r
- {\r
- _isPopped = value;\r
-\r
- if (_isPopped) {\r
- onPop (this, null);\r
- NotifyValueChanged ("SvgSub", "expanded");\r
- return;\r
- }\r
-\r
- onUnpop (this, null);\r
- NotifyValueChanged ("SvgSub", "collapsed");\r
- }\r
- }\r
-\r
- void itemClick(object sender, OpenTK.Input.MouseButtonEventArgs e){\r
- object datasource = (sender as GraphicObject).DataSource;\r
- SelectedItem = datasource;\r
- IsPopped = false;\r
- //Debug.WriteLine ((sender as GraphicObject).DataSource);\r
- }\r
- void _overlay_MouseLeave (object sender, MouseMoveEventArgs e)\r
- {\r
- IsPopped = false;\r
- }\r
- void _overlay_LayoutChanged (object sender, LayoutChangeEventArgs e)\r
- {\r
- ILayoutable tc = Overlay.Parent as ILayoutable;\r
- if (tc == null)\r
- return;\r
- Rectangle r = this.ScreenCoordinates (this.Slot);\r
- if (e.LayoutType == LayoutingType.Width) {\r
- if (Overlay.Slot.Width < tc.ClientRectangle.Width) {\r
- if (r.Left + Overlay.Slot.Width > tc.ClientRectangle.Right)\r
- Overlay.Left = tc.ClientRectangle.Right - Overlay.Slot.Width;\r
- else\r
- Overlay.Left = r.Left;\r
- }else\r
- Overlay.Left = 0;\r
- }else if (e.LayoutType == LayoutingType.Height) {\r
- if (Overlay.Slot.Height < tc.ClientRectangle.Height) {\r
- if (r.Bottom + Overlay.Slot.Height > tc.ClientRectangle.Bottom)\r
- Overlay.Top = r.Top - Overlay.Slot.Height;\r
- else\r
- Overlay.Top = r.Bottom;\r
- }else\r
- Overlay.Top = 0;\r
- }\r
- }\r
-\r
- [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
- public override bool Focusable\r
- {\r
- get { return base.Focusable; }\r
- set { base.Focusable = value; }\r
- }\r
-\r
- \r
- public virtual void onPop(object sender, EventArgs e)\r
- {\r
- IGOLibHost tc = HostContainer;\r
- if (tc == null)\r
- return;\r
- if (Overlay != null) {\r
- Overlay.Visible = true;\r
- if (Overlay.Parent == null)\r
- tc.AddWidget (Overlay);\r
- (tc as OpenTKGameWindow).PutOnTop (Overlay);\r
- }\r
- Pop.Raise (this, e);\r
- }\r
- public virtual void onUnpop(object sender, EventArgs e)\r
- {\r
- IGOLibHost tc = HostContainer;\r
- if (tc == null)\r
- return;\r
- Overlay.Visible = false;\r
- Unpop.Raise (this, e);\r
- }\r
- \r
- public override void onMouseClick (object sender, MouseButtonEventArgs e)\r
- {\r
- IsPopped = !IsPopped;\r
- base.onMouseClick (sender, e);\r
- }\r
-\r
- public override void ClearBinding ()\r
- {\r
- //ensure popped window is cleared\r
- if (Overlay != null) {\r
- if (Overlay.Parent != null) {\r
- IGOLibHost tc = Overlay.Parent as IGOLibHost;\r
- if (tc != null)\r
- tc.DeleteWidget (Overlay);\r
- }\r
- }\r
- base.ClearBinding ();\r
-\r
- }\r
- public override void ResolveBindings ()\r
- {\r
- base.ResolveBindings ();\r
- if (Overlay != null)\r
- Overlay.ResolveBindings ();\r
- }\r
- }\r
-}\r
+using System;
+
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+//using OpenTK.Graphics.OpenGL;
+
+using Cairo;
+
+using winColors = System.Drawing.Color;
+using System.Diagnostics;
+using System.Xml.Serialization;
+using OpenTK.Input;
+using System.ComponentModel;
+using System.Xml;
+using System.IO;
+using System.Collections;
+using System.Threading;
+
+namespace Crow
+{
+ [DefaultTemplate("#Crow.Templates.ComboBox.goml")]
+ [DefaultOverlayTemplate("#Crow.Templates.ComboBoxOverlay.goml")]
+ public class ComboBox : TemplatedContainer
+ {
+ #region CTOR
+ public ComboBox() : base(){ }
+ #endregion
+
+ bool _isPopped;
+ string caption;
+ GraphicObject _overlay;
+ Group _list;
+ IList data;
+ int _selectedIndex;
+ object _selectedItem;
+ string _itemTemplate;
+ string _overlayTemplate;
+
+ public event EventHandler Pop;
+ public event EventHandler Unpop;
+ public event EventHandler<SelectionChangeEventArgs> SelectedItemChanged;
+
+ #region implemented abstract members of TemplatedControl
+ protected override void loadTemplate (GraphicObject template)
+ {
+ base.loadTemplate (template);
+ loadOverlayTemplate (null);
+ }
+ public override GraphicObject Content {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+ #endregion
+
+ protected virtual void loadOverlayTemplate(GraphicObject overlayTemplate)
+ {
+ if (overlayTemplate == null) {
+ DefaultOverlayTemplate dt = (DefaultOverlayTemplate)this.GetType ().GetCustomAttributes (typeof(DefaultOverlayTemplate), true).FirstOrDefault ();
+ Overlay = Interface.Load (dt.Path);
+ Overlay.ResolveBindings ();
+ } else
+ Overlay = overlayTemplate;
+ _list = Overlay.FindByName ("List") as Group;
+ }
+
+ [XmlAttributeAttribute][DefaultValue("#Crow.Templates.ItemTemplate.goml")]
+ public string ItemTemplate {
+ get { return _itemTemplate; }
+ set {
+ //TODO:reload list with new template?
+ _itemTemplate = value;
+ }
+ }
+ [XmlAttributeAttribute][DefaultValue("#Crow.Templates.ComboBoxOverlay.goml")]
+ public string OverlayTemplate {
+ get { return _overlayTemplate; }
+ set {
+ //TODO:reload list with new template?
+ _overlayTemplate = value;
+
+ Overlay = Interface.Load (_overlayTemplate);
+ Overlay.ResolveBindings ();
+ _list = Overlay.FindByName ("List") as Group;
+ }
+ }
+ [XmlAttributeAttribute][DefaultValue(-1)]
+ public int SelectedIndex{
+ get { return _selectedIndex; }
+ set {
+ //store value event if data is null, because in xml parsing selindex is always
+ //before data, so it's impossible without that trick to set a default index in goml
+ _selectedIndex = value;
+
+ if (data == null)
+ return;
+
+ if (_selectedIndex > data.Count - 1 || _selectedIndex < 0)
+ throw new Exception ("Combobox SelectedIndex out of range");
+
+
+ _selectedItem = data [_selectedIndex];
+ NotifyValueChanged ("SelectedIndex", SelectedIndex);
+ SelectedItemChanged.Raise (this, new SelectionChangeEventArgs(_selectedItem));
+
+ if (SelectedItem == null)
+ Caption = "";
+ else
+ Caption = _selectedItem.ToString ();
+ }
+ }
+ public object SelectedItem{
+ set {
+ if (_selectedItem == value)
+ return;
+
+ _selectedItem = value;
+ _selectedIndex = data.IndexOf (_selectedItem);
+ NotifyValueChanged ("SelectedIndex", _selectedIndex);
+ SelectedItemChanged.Raise (this, new SelectionChangeEventArgs(_selectedItem));
+
+ if (SelectedItem == null)
+ Caption = "";
+ else
+ Caption = _selectedItem.ToString ();
+ }
+
+ get { return _selectedItem; }
+ }
+ [XmlAttributeAttribute][DefaultValue(null)]
+ public IList Data {
+ get {
+ return data;
+ }
+ set {
+ data = value;
+ if (_list == null)
+ return;
+
+ foreach (GraphicObject c in _list.Children) {
+ c.ClearBinding ();
+ }
+ _list.Children.Clear ();
+ _list.registerForGraphicUpdate ();
+ if (data == null)
+ return;
+ if (SelectedIndex < 0)
+ return;
+
+ //force raise of changes
+ SelectedIndex = SelectedIndex;
+
+ pendingChildrenAddition = new Queue<GraphicObject> ();
+ threadedLoadingFinished = false;
+
+ Thread t = new Thread (loadingThread);
+ t.Start ();
+ t.Join ();
+
+ }
+ }
+ public override void UpdateLayout (LayoutingType layoutType)
+ {
+ CheckPendingChildrenAddition ();
+ base.UpdateLayout (layoutType);
+ }
+ internal void CheckPendingChildrenAddition()
+ {
+ if (pendingChildrenAddition == null)
+ return;
+ lock (pendingChildrenAddition) {
+ if (!threadedLoadingFinished && pendingChildrenAddition.Count < 50)
+ return;
+ while (pendingChildrenAddition.Count > 0) {
+ _list.addChild (pendingChildrenAddition.Dequeue ());
+ }
+ }
+ }
+
+ volatile Queue<GraphicObject> pendingChildrenAddition;
+ volatile bool threadedLoadingFinished = false;
+
+ void loadingThread()
+ {
+ #if DEBUG_LOAD_TIME
+ Stopwatch loadingTime = new Stopwatch ();
+ loadingTime.Start ();
+ #endif
+
+ MemoryStream ms = new MemoryStream ();
+ lock (ItemTemplate) {
+ using (Stream stream = Interface.GetStreamFromPath (ItemTemplate))
+ stream.CopyTo (ms);
+ }
+
+ Type t = Interface.GetTopContainerOfGOMLStream (ms);
+
+ foreach (var item in data) {
+ ms.Seek(0,SeekOrigin.Begin);
+ GraphicObject g = Interface.Load (ms, t);
+ g.DataSource = item;
+ g.MouseClick += itemClick;
+
+ lock (pendingChildrenAddition) {
+ pendingChildrenAddition.Enqueue (g);
+ }
+ }
+
+ ms.Dispose ();
+
+ threadedLoadingFinished = true;
+
+ #if DEBUG_LOAD_TIME
+ loadingTime.Stop ();
+ Debug.WriteLine("Listbox {2} Loading: {0} ticks \t, {1} ms",
+ loadingTime.ElapsedTicks,
+ loadingTime.ElapsedMilliseconds, this.ToString());
+ #endif
+ }
+ public GraphicObject Overlay {
+ get { return _overlay; }
+ set {
+ if (_overlay != null) {
+ _overlay.LayoutChanged -= _overlay_LayoutChanged;
+ _overlay.MouseLeave -= _overlay_MouseLeave;
+ _overlay.LogicalParent = null;
+ }
+
+ _overlay = value;
+
+ if (_overlay == null)
+ return;
+
+ _overlay.LogicalParent = this;
+ _overlay.Focusable = true;
+ _overlay.LayoutChanged += _overlay_LayoutChanged;
+ _overlay.MouseLeave += _overlay_MouseLeave;
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue("Combobox")]
+ public string Caption {
+ get { return caption; }
+ set {
+ if (caption == value)
+ return;
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public bool IsPopped
+ {
+ get { return _isPopped; }
+ set
+ {
+ _isPopped = value;
+
+ if (_isPopped) {
+ onPop (this, null);
+ NotifyValueChanged ("SvgSub", "expanded");
+ return;
+ }
+
+ onUnpop (this, null);
+ NotifyValueChanged ("SvgSub", "collapsed");
+ }
+ }
+
+ void itemClick(object sender, OpenTK.Input.MouseButtonEventArgs e){
+ object datasource = (sender as GraphicObject).DataSource;
+ SelectedItem = datasource;
+ IsPopped = false;
+ //Debug.WriteLine ((sender as GraphicObject).DataSource);
+ }
+ void _overlay_MouseLeave (object sender, MouseMoveEventArgs e)
+ {
+ IsPopped = false;
+ }
+ void _overlay_LayoutChanged (object sender, LayoutChangeEventArgs e)
+ {
+ ILayoutable tc = Overlay.Parent as ILayoutable;
+ if (tc == null)
+ return;
+ Rectangle r = this.ScreenCoordinates (this.Slot);
+ if (e.LayoutType == LayoutingType.Width) {
+ if (Overlay.Slot.Width < tc.ClientRectangle.Width) {
+ if (r.Left + Overlay.Slot.Width > tc.ClientRectangle.Right)
+ Overlay.Left = tc.ClientRectangle.Right - Overlay.Slot.Width;
+ else
+ Overlay.Left = r.Left;
+ }else
+ Overlay.Left = 0;
+ }else if (e.LayoutType == LayoutingType.Height) {
+ if (Overlay.Slot.Height < tc.ClientRectangle.Height) {
+ if (r.Bottom + Overlay.Slot.Height > tc.ClientRectangle.Bottom)
+ Overlay.Top = r.Top - Overlay.Slot.Height;
+ else
+ Overlay.Top = r.Bottom;
+ }else
+ Overlay.Top = 0;
+ }
+ }
+
+ [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true
+ public override bool Focusable
+ {
+ get { return base.Focusable; }
+ set { base.Focusable = value; }
+ }
+
+
+ public virtual void onPop(object sender, EventArgs e)
+ {
+ IGOLibHost tc = HostContainer;
+ if (tc == null)
+ return;
+ if (Overlay != null) {
+ Overlay.Visible = true;
+ if (Overlay.Parent == null)
+ tc.AddWidget (Overlay);
+ (tc as OpenTKGameWindow).PutOnTop (Overlay);
+ }
+ Pop.Raise (this, e);
+ }
+ public virtual void onUnpop(object sender, EventArgs e)
+ {
+ IGOLibHost tc = HostContainer;
+ if (tc == null)
+ return;
+ Overlay.Visible = false;
+ Unpop.Raise (this, e);
+ }
+
+ public override void onMouseClick (object sender, MouseButtonEventArgs e)
+ {
+ IsPopped = !IsPopped;
+ base.onMouseClick (sender, e);
+ }
+
+ public override void ClearBinding ()
+ {
+ //ensure popped window is cleared
+ if (Overlay != null) {
+ if (Overlay.Parent != null) {
+ IGOLibHost tc = Overlay.Parent as IGOLibHost;
+ if (tc != null)
+ tc.DeleteWidget (Overlay);
+ }
+ }
+ base.ClearBinding ();
+
+ }
+ public override void ResolveBindings ()
+ {
+ base.ResolveBindings ();
+ if (Overlay != null)
+ Overlay.ResolveBindings ();
+ }
+ }
+}
-using System;\r
-using System.Xml.Serialization;\r
-using System.Reflection;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-using System.Linq;\r
-\r
-namespace Crow\r
-{\r
- public class Container : PrivateContainer, IXmlSerializable\r
- {\r
- #region CTOR\r
- public Container()\r
- : base()\r
- {\r
- }\r
- public Container(Rectangle _bounds)\r
- : base(_bounds)\r
- {\r
- }\r
- #endregion\r
-\r
- [XmlIgnore]\r
- public GraphicObject Child {\r
- get { return child; }\r
- set { child = value; }\r
- }\r
- public virtual T SetChild<T> (T _child)\r
- {\r
- return base.SetChild (_child);\r
- }\r
-\r
- #region IXmlSerializable\r
-\r
- public override System.Xml.Schema.XmlSchema GetSchema()\r
- {\r
- return null;\r
- }\r
- public override void ReadXml(System.Xml.XmlReader reader)\r
- {\r
- //only read attributes in GraphicObject IXmlReader implementation\r
- base.ReadXml(reader);\r
-\r
-\r
- using (System.Xml.XmlReader subTree = reader.ReadSubtree())\r
- {\r
- subTree.Read(); //skip current node\r
- subTree.Read(); //read first child\r
-\r
- if (!subTree.IsStartElement())\r
- return;\r
-\r
- Type t = Type.GetType("Crow." + subTree.Name);\r
- GraphicObject go = (GraphicObject)Activator.CreateInstance(t); \r
-\r
- (go as IXmlSerializable).ReadXml(subTree);\r
- \r
- SetChild(go);\r
-\r
- subTree.Read();//closing tag\r
- }\r
- }\r
- public override void WriteXml(System.Xml.XmlWriter writer)\r
- {\r
- base.WriteXml(writer);\r
-\r
- if (Child == null)\r
- return;\r
-\r
- writer.WriteStartElement(Child.GetType().Name);\r
- (Child as IXmlSerializable).WriteXml(writer);\r
- writer.WriteEndElement();\r
- }\r
- \r
- #endregion\r
- }\r
-}\r
-\r
+using System;
+using System.Xml.Serialization;
+using System.Reflection;
+using OpenTK.Input;
+using System.ComponentModel;
+using System.Linq;
+
+namespace Crow
+{
+ public class Container : PrivateContainer, IXmlSerializable
+ {
+ #region CTOR
+ public Container()
+ : base()
+ {
+ }
+ public Container(Rectangle _bounds)
+ : base(_bounds)
+ {
+ }
+ #endregion
+
+ [XmlIgnore]
+ public GraphicObject Child {
+ get { return child; }
+ set { child = value; }
+ }
+ public virtual T SetChild<T> (T _child)
+ {
+ return base.SetChild (_child);
+ }
+
+ #region IXmlSerializable
+
+ public override System.Xml.Schema.XmlSchema GetSchema()
+ {
+ return null;
+ }
+ public override void ReadXml(System.Xml.XmlReader reader)
+ {
+ //only read attributes in GraphicObject IXmlReader implementation
+ base.ReadXml(reader);
+
+
+ using (System.Xml.XmlReader subTree = reader.ReadSubtree())
+ {
+ subTree.Read(); //skip current node
+ subTree.Read(); //read first child
+
+ if (!subTree.IsStartElement())
+ return;
+
+ Type t = Type.GetType("Crow." + subTree.Name);
+ GraphicObject go = (GraphicObject)Activator.CreateInstance(t);
+
+ (go as IXmlSerializable).ReadXml(subTree);
+
+ SetChild(go);
+
+ subTree.Read();//closing tag
+ }
+ }
+ public override void WriteXml(System.Xml.XmlWriter writer)
+ {
+ base.WriteXml(writer);
+
+ if (Child == null)
+ return;
+
+ writer.WriteStartElement(Child.GetType().Name);
+ (Child as IXmlSerializable).WriteXml(writer);
+ writer.WriteEndElement();
+ }
+
+ #endregion
+ }
+}
+
-using System;\r
-\r
-\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-//using OpenTK.Graphics.OpenGL;\r
-\r
-using Cairo;\r
-\r
-using winColors = System.Drawing.Color;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-using System.Xml;\r
-using System.IO;\r
-\r
-namespace Crow\r
-{\r
- [DefaultTemplate("#Crow.Templates.Expandable.goml")]\r
- public class Expandable : TemplatedContainer\r
- { \r
- bool _isExpanded;\r
- string caption;\r
- string image;\r
- Container _contentContainer;\r
-\r
- public event EventHandler Expand;\r
- public event EventHandler Collapse;\r
-\r
- public override GraphicObject Content {\r
- get {\r
- return _contentContainer == null ? null : _contentContainer.Child;\r
- }\r
- set {\r
- _contentContainer.SetChild(value);\r
- }\r
- }\r
-\r
- public Expandable() : base()\r
- {\r
- } \r
-\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
- [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
- public override bool Focusable\r
- {\r
- get { return base.Focusable; }\r
- set { base.Focusable = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(-1)]\r
- public override int Height {\r
- get { return base.Height; }\r
- set { base.Height = value; }\r
- }\r
-\r
- [XmlAttributeAttribute()][DefaultValue("Expandable")]\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
- } \r
- [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.expandable.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
- [XmlAttributeAttribute()][DefaultValue(false)]\r
- public bool IsExpanded\r
- {\r
- get { return _isExpanded; }\r
- set\r
- {\r
- _isExpanded = value;\r
-\r
- if (_isExpanded) {\r
- onExpand (this, null);\r
- NotifyValueChanged ("SvgSub", "expanded");\r
- return;\r
- }\r
-\r
- onCollapse (this, null);\r
- NotifyValueChanged ("SvgSub", "collapsed");\r
- }\r
- }\r
-\r
- public virtual void onExpand(object sender, EventArgs e)\r
- {\r
- if (_contentContainer != null)\r
- _contentContainer.Visible = true;\r
- \r
- Expand.Raise (this, e);\r
- }\r
- public virtual void onCollapse(object sender, EventArgs e)\r
- {\r
- if (_contentContainer != null)\r
- _contentContainer.Visible = false;\r
- \r
- Collapse.Raise (this, e);\r
- }\r
- \r
- public override void onMouseClick (object sender, MouseButtonEventArgs e)\r
- {\r
- IsExpanded = !IsExpanded;\r
- base.onMouseClick (sender, e);\r
- }\r
- public override void ResolveBindings ()\r
- {\r
- base.ResolveBindings ();\r
- if (Content != null)\r
- Content.ResolveBindings ();\r
- }\r
- }\r
-}\r
+using System;
+
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+//using OpenTK.Graphics.OpenGL;
+
+using Cairo;
+
+using winColors = System.Drawing.Color;
+using System.Diagnostics;
+using System.Xml.Serialization;
+using OpenTK.Input;
+using System.ComponentModel;
+using System.Xml;
+using System.IO;
+
+namespace Crow
+{
+ [DefaultTemplate("#Crow.Templates.Expandable.goml")]
+ public class Expandable : TemplatedContainer
+ {
+ bool _isExpanded;
+ string caption;
+ string image;
+ Container _contentContainer;
+
+ public event EventHandler Expand;
+ public event EventHandler Collapse;
+
+ public override GraphicObject Content {
+ get {
+ return _contentContainer == null ? null : _contentContainer.Child;
+ }
+ set {
+ _contentContainer.SetChild(value);
+ }
+ }
+
+ public Expandable() : base()
+ {
+ }
+
+ protected override void loadTemplate(GraphicObject template = null)
+ {
+ base.loadTemplate (template);
+
+ _contentContainer = this.child.FindByName ("Content") as Container;
+ }
+
+ [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true
+ public override bool Focusable
+ {
+ get { return base.Focusable; }
+ set { base.Focusable = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue(-1)]
+ public override int Height {
+ get { return base.Height; }
+ set { base.Height = value; }
+ }
+
+ [XmlAttributeAttribute()][DefaultValue("Expandable")]
+ public string Caption {
+ get { return caption; }
+ set {
+ if (caption == value)
+ return;
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.expandable.svg")]
+ public string Image {
+ get { return image; }
+ set {
+ if (image == value)
+ return;
+ image = value;
+ NotifyValueChanged ("Image", image);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public bool IsExpanded
+ {
+ get { return _isExpanded; }
+ set
+ {
+ _isExpanded = value;
+
+ if (_isExpanded) {
+ onExpand (this, null);
+ NotifyValueChanged ("SvgSub", "expanded");
+ return;
+ }
+
+ onCollapse (this, null);
+ NotifyValueChanged ("SvgSub", "collapsed");
+ }
+ }
+
+ public virtual void onExpand(object sender, EventArgs e)
+ {
+ if (_contentContainer != null)
+ _contentContainer.Visible = true;
+
+ Expand.Raise (this, e);
+ }
+ public virtual void onCollapse(object sender, EventArgs e)
+ {
+ if (_contentContainer != null)
+ _contentContainer.Visible = false;
+
+ Collapse.Raise (this, e);
+ }
+
+ public override void onMouseClick (object sender, MouseButtonEventArgs e)
+ {
+ IsExpanded = !IsExpanded;
+ base.onMouseClick (sender, e);
+ }
+ public override void ResolveBindings ()
+ {
+ base.ResolveBindings ();
+ if (Content != null)
+ Content.ResolveBindings ();
+ }
+ }
+}
-using System;\r
-using System.Diagnostics;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Xml.Serialization;\r
-using System.ComponentModel;\r
-\r
-namespace Crow\r
-{\r
- public class GenericStack : Group\r
- {\r
- internal class Page\r
- {\r
- public byte[] bmp;\r
- public int Size;\r
- }\r
-\r
- #region CTOR\r
- public GenericStack()\r
- : base()\r
- { \r
- }\r
- #endregion\r
-\r
- #region Private fields\r
- int _spacing;\r
- Orientation _orientation;\r
- #endregion\r
-\r
- public override T addChild<T> (T child)\r
- {\r
- T tmp = base.addChild (child);\r
- this.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
- return tmp;\r
- }\r
- public override void removeChild (GraphicObject child)\r
- {\r
- base.removeChild (child);\r
- this.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
- }\r
-\r
- #region Public Properties\r
- [XmlAttributeAttribute()][DefaultValue(2)]\r
- public int Spacing\r
- {\r
- get { return _spacing; }\r
- set { \r
- if (_spacing == value)\r
- return;\r
- _spacing = value; \r
- NotifyValueChanged ("Spacing", Spacing);\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(Orientation.Horizontal)]\r
- public virtual Orientation Orientation\r
- {\r
- get { return _orientation; }\r
- set { _orientation = value; }\r
- }\r
- #endregion\r
-\r
- #region GraphicObject Overrides\r
- protected override Size measureRawSize ()\r
- {\r
- Size tmp = new Size ();\r
-\r
- if (Orientation == Orientation.Horizontal) {\r
- foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {\r
- tmp.Width += c.Slot.Width + Spacing;\r
- tmp.Height = Math.Max (tmp.Height, Math.Max(c.Slot.Bottom, c.Slot.Height));\r
- }\r
- if (tmp.Width > 0)\r
- tmp.Width -= Spacing;\r
- } else {\r
- foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {\r
- tmp.Width = Math.Max (tmp.Width, Math.Max(c.Slot.Right, c.Slot.Width));\r
- tmp.Height += c.Slot.Height + Spacing;\r
- }\r
- if (tmp.Height > 0)\r
- tmp.Height -= Spacing;\r
- }\r
-\r
- tmp.Width += 2 * Margin;\r
- tmp.Height += 2 * Margin;\r
-\r
- return tmp;\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
- c.Slot.X = d;\r
- d += c.Slot.Width + Spacing;\r
- c.RegisterForLayouting ((int)LayoutingType.Y);\r
- }\r
- } else {\r
- foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {\r
- c.Slot.Y = d;\r
- d += c.Slot.Height + Spacing;\r
- c.RegisterForLayouting ((int)LayoutingType.X);\r
- }\r
- }\r
- }\r
-\r
- public override void RegisterForLayouting (int layoutType)\r
- { \r
- if (Parent == null)\r
- return;\r
-\r
- base.RegisterForLayouting (layoutType);\r
-\r
- if ((layoutType & (int)LayoutingType.PositionChildren) > 0)\r
- Interface.LayoutingQueue.Enqueue (LayoutingType.PositionChildren, this);\r
- \r
- }\r
- public override void UpdateLayout (LayoutingType layoutType)\r
- { \r
- if (layoutType == LayoutingType.PositionChildren) {\r
- //allow 1 child to have size to 0 if stack has fixed or streched size,\r
- //this child will occupy remaining space\r
- if (Orientation == Orientation.Horizontal) {\r
- if (Width >= 0) {\r
- GraphicObject[] gobjs = Children.Where (c => c.Width == 0 && c.Visible).ToArray();\r
- if (gobjs.Length > 1)\r
- throw new Exception ("Only one child in stack may have size to stretched");\r
- else if (gobjs.Length == 1) {\r
- int sz = Children.Where(ch=>ch.Visible).Except (gobjs).Sum (g => g.Slot.Width);\r
- if (sz < Slot.Width) {\r
- gobjs [0].Slot.Width = Slot.Width - sz - (Children.Count-1) * Spacing - 2 * Margin;\r
- int idx = Children.IndexOf (gobjs [0]);\r
- if (idx > 0 && idx < Children.Count - 1)\r
- gobjs [0].Slot.Width -= Spacing;\r
- if (gobjs [0].LastSlots.Width != gobjs [0].Slot.Width) {\r
- gobjs [0].bmp = null;\r
- gobjs [0].OnLayoutChanges (LayoutingType.Width);\r
- gobjs [0].LastSlots.Width = gobjs [0].Slot.Width;\r
- }\r
- }\r
- }\r
- } \r
- } else {\r
- if (Height >= 0) {\r
- GraphicObject[] gobjs = Children.Where(ch=>ch.Visible).Where (c => c.Height == 0).ToArray();\r
- if (gobjs.Length > 1)\r
- throw new Exception ("Only one child in stack may have size to stretched");\r
- else if (gobjs.Length == 1) {\r
- int sz = Children.Where(ch=>ch.Visible).Except (gobjs).Sum (g => g.Slot.Height);\r
- if (sz < Slot.Height) {\r
- gobjs [0].Slot.Height = Slot.Height - sz- (Children.Count-1) * Spacing - 2 * Margin;\r
- int idx = Children.IndexOf (gobjs [0]);\r
- if (idx > 0 && idx < Children.Count - 1)\r
- gobjs [0].Slot.Height -= Spacing;\r
- if (gobjs [0].LastSlots.Height != gobjs [0].Slot.Height) {\r
- gobjs [0].bmp = null;\r
- gobjs [0].OnLayoutChanges (LayoutingType.Height);\r
- gobjs [0].LastSlots.Height = gobjs [0].Slot.Height;\r
- }\r
- }\r
- }\r
- }\r
- } \r
- ComputeChildrenPositions ();\r
- //if no layouting remains in queue for item, registre for redraw\r
- if (Interface.LayoutingQueue.Where (lq => lq.GraphicObject == this).Count () <= 0 && bmp==null)\r
- this.RegisterForRedraw ();\r
- }else\r
- base.UpdateLayout(layoutType);\r
- }\r
- #endregion\r
-\r
- \r
- }\r
-}\r
+using System;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+using System.ComponentModel;
+
+namespace Crow
+{
+ public class GenericStack : Group
+ {
+ internal class Page
+ {
+ public byte[] bmp;
+ public int Size;
+ }
+
+ #region CTOR
+ public GenericStack()
+ : base()
+ {
+ }
+ #endregion
+
+ #region Private fields
+ int _spacing;
+ Orientation _orientation;
+ #endregion
+
+ public override T addChild<T> (T child)
+ {
+ T tmp = base.addChild (child);
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ return tmp;
+ }
+ public override void removeChild (GraphicObject child)
+ {
+ base.removeChild (child);
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ }
+
+ #region Public Properties
+ [XmlAttributeAttribute()][DefaultValue(2)]
+ public int Spacing
+ {
+ get { return _spacing; }
+ set {
+ if (_spacing == value)
+ return;
+ _spacing = value;
+ NotifyValueChanged ("Spacing", Spacing);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(Orientation.Horizontal)]
+ public virtual Orientation Orientation
+ {
+ get { return _orientation; }
+ set { _orientation = value; }
+ }
+ #endregion
+
+ #region GraphicObject Overrides
+ protected override Size measureRawSize ()
+ {
+ Size tmp = new Size ();
+
+ if (Orientation == Orientation.Horizontal) {
+ foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
+ tmp.Width += c.Slot.Width + Spacing;
+ tmp.Height = Math.Max (tmp.Height, Math.Max(c.Slot.Bottom, c.Slot.Height));
+ }
+ if (tmp.Width > 0)
+ tmp.Width -= Spacing;
+ } else {
+ foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
+ tmp.Width = Math.Max (tmp.Width, Math.Max(c.Slot.Right, c.Slot.Width));
+ tmp.Height += c.Slot.Height + Spacing;
+ }
+ if (tmp.Height > 0)
+ tmp.Height -= Spacing;
+ }
+
+ tmp.Width += 2 * Margin;
+ tmp.Height += 2 * Margin;
+
+ return tmp;
+ }
+ public virtual void ComputeChildrenPositions()
+ {
+ #if DEBUG_LAYOUTING
+ Debug.WriteLine("ComputeChildrenPosition: " + this.ToString());
+ #endif
+ int d = 0;
+ if (Orientation == Orientation.Horizontal) {
+ foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
+ c.Slot.X = d;
+ d += c.Slot.Width + Spacing;
+ c.RegisterForLayouting ((int)LayoutingType.Y);
+ }
+ } else {
+ foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
+ c.Slot.Y = d;
+ d += c.Slot.Height + Spacing;
+ c.RegisterForLayouting ((int)LayoutingType.X);
+ }
+ }
+ }
+
+ public override void RegisterForLayouting (int layoutType)
+ {
+ if (Parent == null)
+ return;
+
+ base.RegisterForLayouting (layoutType);
+
+ if ((layoutType & (int)LayoutingType.PositionChildren) > 0)
+ Interface.LayoutingQueue.Enqueue (LayoutingType.PositionChildren, this);
+
+ }
+ public override void UpdateLayout (LayoutingType layoutType)
+ {
+ if (layoutType == LayoutingType.PositionChildren) {
+ //allow 1 child to have size to 0 if stack has fixed or streched size,
+ //this child will occupy remaining space
+ if (Orientation == Orientation.Horizontal) {
+ if (Width >= 0) {
+ GraphicObject[] gobjs = Children.Where (c => c.Width == 0 && c.Visible).ToArray();
+ if (gobjs.Length > 1)
+ throw new Exception ("Only one child in stack may have size to stretched");
+ else if (gobjs.Length == 1) {
+ int sz = Children.Where(ch=>ch.Visible).Except (gobjs).Sum (g => g.Slot.Width);
+ if (sz < Slot.Width) {
+ gobjs [0].Slot.Width = Slot.Width - sz - (Children.Count-1) * Spacing - 2 * Margin;
+ int idx = Children.IndexOf (gobjs [0]);
+ if (idx > 0 && idx < Children.Count - 1)
+ gobjs [0].Slot.Width -= Spacing;
+ if (gobjs [0].LastSlots.Width != gobjs [0].Slot.Width) {
+ gobjs [0].bmp = null;
+ gobjs [0].OnLayoutChanges (LayoutingType.Width);
+ gobjs [0].LastSlots.Width = gobjs [0].Slot.Width;
+ }
+ }
+ }
+ }
+ } else {
+ if (Height >= 0) {
+ GraphicObject[] gobjs = Children.Where(ch=>ch.Visible).Where (c => c.Height == 0).ToArray();
+ if (gobjs.Length > 1)
+ throw new Exception ("Only one child in stack may have size to stretched");
+ else if (gobjs.Length == 1) {
+ int sz = Children.Where(ch=>ch.Visible).Except (gobjs).Sum (g => g.Slot.Height);
+ if (sz < Slot.Height) {
+ gobjs [0].Slot.Height = Slot.Height - sz- (Children.Count-1) * Spacing - 2 * Margin;
+ int idx = Children.IndexOf (gobjs [0]);
+ if (idx > 0 && idx < Children.Count - 1)
+ gobjs [0].Slot.Height -= Spacing;
+ if (gobjs [0].LastSlots.Height != gobjs [0].Slot.Height) {
+ gobjs [0].bmp = null;
+ gobjs [0].OnLayoutChanges (LayoutingType.Height);
+ gobjs [0].LastSlots.Height = gobjs [0].Slot.Height;
+ }
+ }
+ }
+ }
+ }
+ ComputeChildrenPositions ();
+ //if no layouting remains in queue for item, registre for redraw
+ if (Interface.LayoutingQueue.Where (lq => lq.GraphicObject == this).Count () <= 0 && bmp==null)
+ this.RegisterForRedraw ();
+ }else
+ base.UpdateLayout(layoutType);
+ }
+ #endregion
+
+
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using Cairo;\r
-using System.Xml.Serialization;\r
-\r
-namespace Crow\r
-{\r
- public class GraduatedSlider : Slider\r
- { \r
- #region CTOR\r
- public GraduatedSlider() : base()\r
- {}\r
- public GraduatedSlider(double minimum, double maximum, double step)\r
- : base()\r
- {\r
- Minimum = minimum;\r
- Maximum = maximum;\r
- SmallIncrement = step;\r
- LargeIncrement = step * 5;\r
- }\r
- #endregion\r
-\r
- protected override void DrawGraduations(Context gr, PointD pStart, PointD pEnd)\r
- {\r
- Rectangle r = ClientRectangle;\r
- gr.SetSourceColor(Foreground);\r
-\r
- gr.LineWidth = 2;\r
- gr.MoveTo(pStart);\r
- gr.LineTo(pEnd);\r
-\r
- gr.Stroke();\r
- gr.LineWidth = 1;\r
-\r
- double sst = unity * SmallIncrement;\r
- double bst = unity * LargeIncrement;\r
-\r
-\r
- PointD vBar = new PointD(0, sst);\r
- for (double x = Minimum; x <= Maximum - Minimum; x += SmallIncrement)\r
- {\r
- double lineLength = r.Height / 3;\r
- if (x % LargeIncrement != 0)\r
- lineLength /= 3;\r
- PointD p = new PointD(pStart.X + x * unity, pStart.Y);\r
- gr.MoveTo(p);\r
- gr.LineTo(new PointD(p.X, p.Y + lineLength));\r
- }\r
- gr.Stroke();\r
- }\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Cairo;
+using System.Xml.Serialization;
+
+namespace Crow
+{
+ public class GraduatedSlider : Slider
+ {
+ #region CTOR
+ public GraduatedSlider() : base()
+ {}
+ public GraduatedSlider(double minimum, double maximum, double step)
+ : base()
+ {
+ Minimum = minimum;
+ Maximum = maximum;
+ SmallIncrement = step;
+ LargeIncrement = step * 5;
+ }
+ #endregion
+
+ protected override void DrawGraduations(Context gr, PointD pStart, PointD pEnd)
+ {
+ Rectangle r = ClientRectangle;
+ gr.SetSourceColor(Foreground);
+
+ gr.LineWidth = 2;
+ gr.MoveTo(pStart);
+ gr.LineTo(pEnd);
+
+ gr.Stroke();
+ gr.LineWidth = 1;
+
+ double sst = unity * SmallIncrement;
+ double bst = unity * LargeIncrement;
+
+
+ PointD vBar = new PointD(0, sst);
+ for (double x = Minimum; x <= Maximum - Minimum; x += SmallIncrement)
+ {
+ double lineLength = r.Height / 3;
+ if (x % LargeIncrement != 0)
+ lineLength /= 3;
+ PointD p = new PointD(pStart.X + x * unity, pStart.Y);
+ gr.MoveTo(p);
+ gr.LineTo(new PointD(p.X, p.Y + lineLength));
+ }
+ gr.Stroke();
+ }
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-//using OpenTK.Graphics.OpenGL;\r
-using System.Drawing.Imaging;\r
-using System.Diagnostics;\r
-using OpenTK.Input;\r
-\r
-using Cairo;\r
-\r
-using System.Xml.Serialization;\r
-using System.Reflection;\r
-using System.ComponentModel;\r
-using System.IO;\r
-//using System.Xml;\r
-using System.Xml;\r
-using System.Runtime.CompilerServices;\r
-using System.Reflection.Emit;\r
-\r
-namespace Crow\r
-{ \r
- public class GraphicObject : IXmlSerializable, ILayoutable, IValueChange\r
- {\r
- #if DEBUG_LAYOUTING\r
- internal static ulong currentUid = 0;\r
- internal ulong uid = 0;\r
- #endif\r
-\r
- internal List<Binding> Bindings = new List<Binding> ();\r
-\r
- #region IValueChange implementation\r
- public event EventHandler<ValueChangeEventArgs> ValueChanged;\r
- public virtual void NotifyValueChanged(string MemberName, object _value)\r
- {\r
- ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value)); \r
- }\r
- #endregion\r
-\r
- #region CTOR\r
- public GraphicObject ()\r
- {\r
- #if DEBUG_LAYOUTING\r
- uid = currentUid;\r
- currentUid++;\r
- #endif\r
-\r
- if (Interface.XmlSerializerInit)\r
- return;\r
-\r
- loadDefaultValues ();\r
- registerForGraphicUpdate ();\r
- }\r
- public GraphicObject (Rectangle _bounds)\r
- {\r
- if (Interface.XmlSerializerInit)\r
- return;\r
- \r
- loadDefaultValues ();\r
- Bounds = _bounds;\r
- registerForGraphicUpdate ();\r
- }\r
- #endregion\r
-\r
- #region private fields\r
- ILayoutable _parent;\r
- string _name = "unamed";\r
- Color _background = Color.Transparent;\r
- Color _foreground = Color.White;\r
- Font _font = "droid, 10";\r
- double _cornerRadius = 0;\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
- Size _maximumSize = "0;0";\r
- Size _minimumSize = "0;0";\r
-\r
- Picture _backgroundImage;\r
- string _backgroundImagePath;\r
- #endregion\r
-\r
- #region public fields\r
- public GraphicObject LogicalParent;\r
- public Rectangle Bounds;\r
- public Rectangle Slot = new Rectangle ();\r
- public object Tag;\r
- public byte[] bmp;\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
-// if (_parent == value)\r
-// return;\r
-// if (_parent != null)\r
-// ClearBinding ();\r
-// \r
- _parent = value;\r
-//\r
-// if (DataSource != null)\r
-// ResolveBindings ();\r
- }\r
- }\r
-\r
-\r
- [XmlIgnore]public virtual Rectangle ClientRectangle {\r
- get {\r
- Rectangle cb = Slot.Size;\r
- cb.Inflate ( - Margin);\r
- return cb;\r
- }\r
- }\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
- Parent.ContextCoordinates (r);// + ClientRectangle.Position;\r
- } \r
- public virtual Rectangle ScreenCoordinates (Rectangle r){\r
- //r += Slot.Position;\r
-\r
- return \r
- Parent.ScreenCoordinates(r) + Parent.getSlot().Position + Parent.ClientRectangle.Position;\r
- }\r
- public virtual Rectangle getSlot()\r
- {\r
- return Slot;\r
- }\r
- public virtual Rectangle getBounds()\r
- {\r
- return Bounds;\r
- }\r
- #endregion\r
-\r
- #region EVENT HANDLERS\r
- public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;\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
- public event EventHandler<MouseMoveEventArgs> MouseLeave;\r
- public event EventHandler<KeyboardKeyEventArgs> KeyDown;\r
- public event EventHandler<KeyboardKeyEventArgs> KeyUp;\r
- public event EventHandler Focused;\r
- public event EventHandler Unfocused;\r
- public event EventHandler<LayoutChangeEventArgs> LayoutChanged;\r
- #endregion\r
-\r
- #region public properties\r
- [XmlAttributeAttribute()][DefaultValue("unamed")]\r
- public virtual string Name {\r
- get { return _name; }\r
- set { \r
- if (_name == value)\r
- return;\r
- _name = value; \r
- NotifyValueChanged("Name", _verticalAlignment);\r
- }\r
- }\r
- [XmlAttributeAttribute ()][DefaultValue(VerticalAlignment.Center)]\r
- public virtual VerticalAlignment VerticalAlignment {\r
- get { return _verticalAlignment; }\r
- set { \r
- if (_verticalAlignment == value)\r
- return;\r
-\r
- _verticalAlignment = value; \r
- NotifyValueChanged("VerticalAlignment", _verticalAlignment);\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(HorizontalAlignment.Center)]\r
- public virtual HorizontalAlignment HorizontalAlignment {\r
- get { return _horizontalAlignment; }\r
- set { \r
- if (_horizontalAlignment == value)\r
- return;\r
-\r
- _horizontalAlignment = value; \r
- NotifyValueChanged("HorizontalAlignment", _horizontalAlignment);\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(0)]\r
- public virtual int Left {\r
- get { return Bounds.X; }\r
- set {\r
- if (Bounds.X == value)\r
- return;\r
-\r
- Bounds.X = value;\r
- NotifyValueChanged ("Left", Bounds.X);\r
- this.RegisterForLayouting ((int)LayoutingType.X);\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(0)]\r
- public virtual int Top {\r
- get { return Bounds.Y; }\r
- set {\r
- if (Bounds.Y == value)\r
- return;\r
-\r
- Bounds.Y = value;\r
- NotifyValueChanged ("Top", Bounds.Y);\r
- this.RegisterForLayouting ((int)LayoutingType.Y);\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(0)]\r
- public virtual int Width {\r
- get { return Bounds.Width; }\r
- set {\r
- if (Bounds.Width == value)\r
- return;\r
-\r
- Bounds.Width = value;\r
- NotifyValueChanged ("Width", Bounds.Width);\r
- this.RegisterForLayouting ((int)LayoutingType.Width);\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(0)]\r
- public virtual int Height {\r
- get { return Bounds.Height; }\r
- set {\r
- if (Bounds.Height == value)\r
- return;\r
-\r
- Bounds.Height = value;\r
- NotifyValueChanged ("Height", Bounds.Height);\r
- this.RegisterForLayouting ((int)LayoutingType.Height);\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(false)]\r
- public virtual bool Fit {\r
- get { return Bounds.Width < 0 && Bounds.Height < 0 ? true : false; }\r
- set {\r
- if (value == Fit)\r
- return;\r
-\r
- Bounds.Width = Bounds.Height = -1;\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(false)]\r
- public virtual bool Focusable {\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
- if (_background == value)\r
- return;\r
- _background = value; \r
- NotifyValueChanged ("Background", _background);\r
- registerForGraphicUpdate ();\r
- }\r
- } \r
- [XmlAttributeAttribute()][DefaultValue("White")]\r
- public virtual Color Foreground {\r
- get { return _foreground; }\r
- set {\r
- if (_foreground == value)\r
- return;\r
- _foreground = value; \r
- NotifyValueChanged ("Foreground", _foreground);\r
- registerForGraphicUpdate ();\r
- }\r
- } \r
- [XmlAttributeAttribute()][DefaultValue("droid,10")]\r
- public virtual Font Font {\r
- get { return _font; }\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
- if (value == _cornerRadius)\r
- return; \r
- _cornerRadius = value; \r
- NotifyValueChanged ("CornerRadius", _cornerRadius);\r
- registerForGraphicUpdate ();\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(0)]\r
- public virtual int Margin {\r
- get { return _margin; }\r
- set {\r
- if (value == _margin)\r
- return; \r
- _margin = value; \r
- NotifyValueChanged ("Margin", _margin);\r
- registerForGraphicUpdate ();\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(true)]\r
- public virtual bool Visible {\r
- get { return _isVisible; }\r
- set {\r
- if (value == _isVisible)\r
- return;\r
-\r
- _isVisible = value;\r
-\r
- if (HostContainer == null)\r
- return;\r
- //add slot to clipping to redraw\r
- HostContainer.gobjsToRedraw.Add (this);\r
-\r
- //ensure main win doesn't keep hidden childrens ref\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
-\r
- NotifyValueChanged ("Visible", _isVisible);\r
- }\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
- false : \r
- true; } }\r
- [XmlAttributeAttribute()][DefaultValue("0;0")]\r
- public virtual Size MaximumSize {\r
- get { return _maximumSize; }\r
- set { _maximumSize = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue("0;0")]\r
- public virtual Size MinimumSize {\r
- get { return _minimumSize; }\r
- set { _minimumSize = value; }\r
- }\r
- object dataSource;\r
-\r
- [XmlIgnore]public virtual object DataSource {\r
- set {\r
- if (dataSource == value)\r
- return;\r
-\r
- if (dataSource != null)\r
- this.ClearBinding ();\r
- \r
- dataSource = value;\r
-\r
- if (dataSource != null)\r
- this.ResolveBindings();\r
- }\r
- get { \r
- return dataSource == null ? \r
- LogicalParent == null ?\r
- Parent is GraphicObject ? (Parent as GraphicObject).DataSource : null : LogicalParent.DataSource : dataSource;\r
- }\r
- }\r
- #endregion\r
-\r
-\r
- /// <summary>\r
- /// Loads the default values from XML attributes default\r
- /// </summary>\r
- protected virtual void loadDefaultValues()\r
- {\r
- foreach (PropertyInfo pi in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) {\r
- if (pi.GetSetMethod () == null)\r
- continue;\r
- string name = "";\r
-\r
- object[] att = pi.GetCustomAttributes (false);\r
-\r
- foreach (object o in att) {\r
- XmlAttributeAttribute xaa = o as XmlAttributeAttribute;\r
- if (xaa != null) { \r
- if (string.IsNullOrEmpty (xaa.AttributeName))\r
- name = pi.Name;\r
- else\r
- name = xaa.AttributeName;\r
- continue;\r
- }\r
-\r
- XmlIgnoreAttribute xia = o as XmlIgnoreAttribute;\r
- if (xia != null)\r
- continue;\r
-\r
- DefaultValueAttribute dv = o as DefaultValueAttribute;\r
- if (dv != null) {\r
- object defaultValue = dv.Value;\r
- //avoid system types automaticaly converted by parser\r
- if (defaultValue != null && !pi.PropertyType.Namespace.StartsWith("System")) {\r
- if (pi.PropertyType != defaultValue.GetType()) {\r
- MethodInfo miParse = pi.PropertyType.GetMethod ("Parse", BindingFlags.Static | BindingFlags.Public);\r
- if (miParse != null) { \r
- pi.SetValue (this, miParse.Invoke (null, new object[]{ defaultValue }), null);\r
- continue;\r
- }\r
- }\r
- }\r
- pi.SetValue (this, defaultValue, null); \r
- } \r
- }\r
- }\r
- }\r
-\r
- public virtual GraphicObject FindByName(string nameToFind){\r
- return nameToFind == _name ? this : null;\r
- }\r
- public virtual bool Contains(GraphicObject goToFind){\r
- return false;\r
- }\r
-\r
-\r
- /// <summary>\r
- /// Clear chached object and add clipping region in redraw list of interface\r
- /// </summary>\r
- public virtual void registerForGraphicUpdate ()\r
- {\r
- bmp = null;\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 (HostContainer != null)\r
- HostContainer.gobjsToRedraw.Add (this);\r
- }\r
-\r
- /// <summary>\r
- /// keep last slot components for each layouting pass to track\r
- /// changes and trigger update of other component accordingly\r
- /// </summary>\r
- public Rectangle LastSlots;\r
- /// <summary>\r
- /// keep last slot painted on screen to clear traces if moved or resized\r
- /// TODO: we should ensure the whole parsed widget tree is the last painted\r
- /// version to clear effective oldslot if parents have been moved or resized.\r
- /// IDEA is to add a ScreenCoordinates function that use only lastPaintedSlots\r
- /// </summary>\r
- public Rectangle LastPaintedSlot;\r
-\r
- public virtual void registerClipRect()\r
- {\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
- HostContainer.redrawClip.AddRectangle (ScreenCoordinates(LastPaintedSlot));\r
- }\r
- /// <summary> return size of content + margins </summary>\r
- protected virtual Size measureRawSize ()\r
- {\r
- return Bounds.Size;\r
- }\r
- /// <summary> clear current layoutingQueue items for object and\r
- /// trigger a new layouting pass for a layoutType </summary>\r
- public virtual void RegisterForLayouting(int layoutType)\r
- {\r
- if (Parent == null)\r
- return;\r
- #if DEBUG_LAYOUTING\r
- Debug.WriteLine ("RegisterForLayouting => {1}->{0}", layoutType, this.ToString());\r
- #endif\r
- lock (Interface.LayoutingQueue) {\r
- Interface.LayoutingQueue.RemoveAll (lq => lq.GraphicObject == this && (layoutType & (int)lq.LayoutType) > 0);\r
-\r
- if ((layoutType & (int)LayoutingType.Width) > 0) {\r
- if (Bounds.Width == 0) //stretch in parent\r
- Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Width, this);\r
- else if (Bounds.Width < 0) //fit \r
- Interface.LayoutingQueue.EnqueueBeforeParentSizing (LayoutingType.Width, this);\r
- else\r
- Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Width, this));\r
- }\r
-\r
- if ((layoutType & (int)LayoutingType.Height) > 0) {\r
- if (Bounds.Height == 0) //stretch in parent\r
- Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Height, this);\r
- else if (Bounds.Height < 0) //fit \r
- Interface.LayoutingQueue.EnqueueBeforeParentSizing (LayoutingType.Height, this);\r
- else\r
- Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Height, this));\r
- }\r
-\r
- if ((layoutType & (int)LayoutingType.X) > 0)\r
- //for x positionning, sizing of parent and this have to be done\r
- Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.X, this);\r
-\r
- if ((layoutType & (int)LayoutingType.Y) > 0)\r
- //for x positionning, sizing of parent and this have to be done\r
- Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.Y, this);\r
- }\r
- }\r
-\r
- /// <summary> trigger dependant sizing component update </summary>\r
- public virtual void OnLayoutChanges(LayoutingType layoutType)\r
- {\r
- if (Parent==null)\r
- return;\r
- #if DEBUG_LAYOUTING\r
- Debug.WriteLine ("Layout change: " + this.ToString () + ":" + LastSlots.ToString() + "=>" + Slot.ToString ());\r
- #endif\r
- \r
- switch (layoutType) {\r
- case LayoutingType.Width: \r
- if (Parent.getBounds ().Width < 0) {\r
- Group gw = Parent as Group;\r
- if (gw != null) {\r
- if (Slot.Width > gw.maxChildrenWidth)\r
- gw.maxChildrenWidth = Slot.Width;\r
- }\r
- this.Parent.RegisterForLayouting ((int)LayoutingType.Width);\r
- }else if (Width != 0) //update position in parent\r
- this.RegisterForLayouting ((int)LayoutingType.X);\r
- GenericStack gsw = Parent as GenericStack;\r
- if (gsw == null)\r
- break; \r
- if ((Parent as GenericStack).Orientation == Orientation.Horizontal) {\r
-// ulong idx = (ulong)gsw.Children.IndexOf (this);\r
-// if (idx < gsw.stackingUpdateStartIndex)\r
-// gsw.stackingUpdateStartIndex = idx;\r
- this.Parent.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
- }\r
- break;\r
- case LayoutingType.Height:\r
- if (Parent.getBounds ().Height < 0) {\r
- Group gh = Parent as Group;\r
- if (gh != null) {\r
- if (Slot.Width > gh.maxChildrenHeight)\r
- gh.maxChildrenHeight = Slot.Height;\r
- }\r
- this.Parent.RegisterForLayouting ((int)LayoutingType.Height);\r
- }else if (Height != 0) //update position in parent\r
- this.RegisterForLayouting ((int)LayoutingType.Y);\r
- GenericStack gsh = Parent as GenericStack;\r
- if (gsh==null)\r
- break; \r
- if (gsh.Orientation == Orientation.Vertical) {\r
-// ulong idx = (ulong)gsh.Children.IndexOf (this);\r
-// if (idx < gsh.stackingUpdateStartIndex)\r
-// gsh.stackingUpdateStartIndex = idx;\r
- this.Parent.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
- }\r
- break;\r
- }\r
- LayoutChanged.Raise (this, new LayoutChangeEventArgs (layoutType));\r
- }\r
- /// <summary> Update layout component, this is where the computation of alignement\r
- /// and size take place </summary>\r
- public virtual void UpdateLayout (LayoutingType layoutType)\r
- { \r
- switch (layoutType) {\r
- case LayoutingType.X:\r
- if (Bounds.X == 0) {\r
- switch (HorizontalAlignment) {\r
- case HorizontalAlignment.Left:\r
- Slot.X = 0;\r
- break;\r
- case HorizontalAlignment.Right:\r
- Slot.X = Parent.ClientRectangle.Width - Slot.Width;\r
- break;\r
- case HorizontalAlignment.Center:\r
- Slot.X = Parent.ClientRectangle.Width / 2 - Slot.Width / 2;\r
- break;\r
- }\r
- } else\r
- Slot.X = Bounds.X;\r
-\r
- if (LastSlots.X == Slot.X)\r
- break;\r
-\r
- bmp = null;\r
-\r
- OnLayoutChanges (layoutType);\r
-\r
- LastSlots.X = Slot.X;\r
- break;\r
- case LayoutingType.Y:\r
- if (Bounds.Y == 0) {\r
- switch (VerticalAlignment) {\r
- case VerticalAlignment.Top:\r
- Slot.Y = 0;\r
- break;\r
- case VerticalAlignment.Bottom:\r
- Slot.Y = Parent.ClientRectangle.Height - Slot.Height;\r
- break;\r
- case VerticalAlignment.Center:\r
- Slot.Y = Parent.ClientRectangle.Height / 2 - Slot.Height / 2;\r
- break;\r
- }\r
- }else\r
- Slot.Y = Bounds.Y;\r
-\r
- if (LastSlots.Y == Slot.Y)\r
- break;\r
-\r
- bmp = null;\r
-\r
- OnLayoutChanges (layoutType);\r
-\r
- LastSlots.Y = Slot.Y;\r
- break;\r
- case LayoutingType.Width:\r
- //force sizing to fit if parent is sizing on children and\r
- //this object has stretched size\r
- if (Parent.getBounds ().Width < 0 && Width == 0)\r
- Width = -1;\r
-\r
- if (Width > 0)\r
- Slot.Width = Width;\r
- else if (Width < 0)\r
- Slot.Width = measureRawSize ().Width;\r
- else\r
- Slot.Width = Parent.ClientRectangle.Width;\r
-\r
- //size constrain\r
- if (Slot.Width < MinimumSize.Width)\r
- Slot.Width = MinimumSize.Width;\r
- else if (Slot.Width > MaximumSize.Width && MaximumSize.Width > 0)\r
- Slot.Width = MaximumSize.Width;\r
-\r
- if (LastSlots.Width == Slot.Width)\r
- break;\r
-\r
- bmp = null;\r
-\r
- OnLayoutChanges (layoutType);\r
-\r
- LastSlots.Width = Slot.Width;\r
- break;\r
- case LayoutingType.Height:\r
- //force sizing to fit if parent is sizing on children\r
- if (Parent.getBounds ().Height < 0 && Height == 0)\r
- Height = -1;\r
-\r
- if (Height > 0)\r
- Slot.Height = Height;\r
- else if (Height < 0)\r
- Slot.Height = measureRawSize ().Height;\r
- else\r
- Slot.Height = Parent.ClientRectangle.Height;\r
-\r
- //size constrain\r
- if (Slot.Height < MinimumSize.Height)\r
- Slot.Height = MinimumSize.Height;\r
- else if (Slot.Height > MaximumSize.Height && MaximumSize.Height > 0)\r
- Slot.Height = MaximumSize.Height;\r
-\r
-\r
- if (LastSlots.Height == Slot.Height)\r
- break;\r
-\r
- bmp = null;\r
-\r
- OnLayoutChanges (layoutType);\r
-\r
- LastSlots.Height = Slot.Height;\r
- break;\r
- }\r
- lock (Interface.LayoutingQueue) {\r
- //if no layouting remains in queue for item, registre for redraw\r
- if (Interface.LayoutingQueue.Where (lq => lq.GraphicObject == this).Count () <= 0 && bmp == null)\r
- this.RegisterForRedraw ();\r
- }\r
- }\r
-\r
- /// <summary> This is the common overridable drawing routine to create new widget </summary>\r
- protected virtual void onDraw(Context gr)\r
- {\r
- Rectangle rBack = new Rectangle (Slot.Size);\r
-\r
- Background.SetAsSource (gr);\r
- CairoHelpers.CairoRectangle(gr,rBack,_cornerRadius);\r
- gr.Fill ();\r
- }\r
-\r
- /// <summary>\r
- /// Interfal drawing context creation on a cached surface limited to slot size\r
- /// this trigger the effective drawing routine </summary>\r
- protected virtual void UpdateGraphic ()\r
- {\r
- LastPaintedSlot = Slot;\r
-\r
- int stride = 4 * Slot.Width;\r
-\r
- int bmpSize = Math.Abs (stride) * Slot.Height;\r
- bmp = new byte[bmpSize];\r
-\r
- using (ImageSurface draw =\r
- new ImageSurface(bmp, Format.Argb32, Slot.Width, Slot.Height, stride)) {\r
- using (Context gr = new Context (draw)) {\r
- gr.Antialias = Antialias.Subpixel;\r
- onDraw (gr);\r
- }\r
- draw.Flush ();\r
- //draw.WriteToPng ("/mnt/data/test.png");\r
- }\r
- }\r
- /// <summary> Chained painting routine on the parent context of the actual cached version\r
- /// of the widget </summary>\r
- public virtual void Paint (ref Context ctx, Rectangles clip = null)\r
- {\r
- if (!Visible)\r
- return;\r
-\r
- if (bmp == null)\r
- UpdateGraphic ();\r
-\r
- Rectangle rb = Parent.ContextCoordinates(Slot);\r
-\r
- using (ImageSurface source = new ImageSurface(bmp, Format.Argb32, Slot.Width, Slot.Height, 4 * Slot.Width)) {\r
- if (this.Background == Color.Clear) {\r
- ctx.Save ();\r
- ctx.Operator = Operator.Clear;\r
- ctx.Rectangle(rb);\r
- ctx.Fill ();\r
- ctx.Restore ();\r
- }\r
- ctx.SetSourceSurface (source, rb.X, rb.Y);\r
- ctx.Paint ();\r
- }\r
- }\r
-\r
- #region Keyboard handling\r
- public virtual void onKeyDown(object sender, KeyboardKeyEventArgs e){\r
- KeyDown.Raise (sender, e);\r
- }\r
- #endregion\r
-\r
- #region Mouse handling\r
- public virtual bool MouseIsIn(Point m)\r
- {\r
- if (!Visible) \r
- return false;\r
- if (ScreenCoordinates (Slot).ContainsOrIsEqual (m)) {\r
- Scroller scr = Parent as Scroller;\r
- if (scr == null)\r
- return true;\r
- return scr.MouseIsIn (scr.savedMousePos);\r
- }\r
- return false; \r
- }\r
- public virtual void checkHoverWidget(MouseMoveEventArgs e)\r
- {\r
- IGOLibHost glh = HostContainer;\r
- if (glh.hoverWidget != this) {\r
- glh.hoverWidget = this;\r
- onMouseEnter (this, e);\r
- }\r
-\r
- this.onMouseMove (this, e);\r
- }\r
- public virtual void onMouseMove(object sender, MouseMoveEventArgs e)\r
- {\r
- //bubble event to the top\r
- GraphicObject p = Parent as GraphicObject;\r
- if (p != null)\r
- p.onMouseMove(sender,e);\r
- \r
- MouseMove.Raise (sender, e);\r
- }\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 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
- 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
- }\r
- public virtual void onMouseWheel(object sender, MouseWheelEventArgs e){\r
- GraphicObject p = Parent as GraphicObject;\r
- if (p != null)\r
- p.onMouseWheel(this,e);\r
- \r
- MouseWheelChanged.Raise (this, e);\r
- }\r
- public virtual void onFocused(object sender, EventArgs e){\r
- Focused.Raise (this, e);\r
- this.HasFocus = true;\r
- }\r
- public virtual void onUnfocused(object sender, EventArgs e){\r
- Unfocused.Raise (this, e);\r
- this.HasFocus = false;\r
- }\r
- public virtual void onMouseEnter(object sender, MouseMoveEventArgs e)\r
- {\r
- MouseEnter.Raise (this, e);\r
- }\r
- public virtual void onMouseLeave(object sender, MouseMoveEventArgs e)\r
- {\r
- MouseLeave.Raise (this, e);\r
- }\r
- #endregion\r
-\r
- public override string ToString ()\r
- {\r
- string tmp ="";\r
-\r
- if (Parent != null)\r
- tmp = Parent.ToString () + tmp;\r
- #if DEBUG_LAYOUTING\r
- return Name == "unamed" ? tmp + "." + this.GetType ().Name + uid.ToString(): tmp + "." + Name;\r
- #else\r
- return Name == "unamed" ? tmp + "." + this.GetType ().Name : tmp + "." + Name;\r
- #endif\r
- }\r
-\r
- #region Binding\r
- public virtual void ResolveBindings()\r
- {\r
- #if DEBUG_BINDING\r
- Debug.WriteLine ("ResolveBinding => " + this.ToString ());\r
- #endif\r
- List<Binding> resolved = new List<Binding> ();\r
- foreach (Binding b in Bindings) {\r
- if (!string.IsNullOrEmpty (b.DynMethodId))\r
- continue;\r
- if (b.Source.Member.MemberType == MemberTypes.Event) {\r
- if (b.Expression.StartsWith("{")){\r
- CompileEventSource(b);\r
- continue;\r
- }\r
- }\r
- if (!b.FindTarget ())\r
- continue;\r
- if (b.Source.Member.MemberType == MemberTypes.Event) {\r
- //register handler for event\r
- if (b.Target.Method == null) {\r
- Debug.WriteLine ("Handler Method not found: " + b.Expression);\r
- continue;\r
- }\r
-\r
- MethodInfo addHandler = b.Source.Event.GetAddMethod ();\r
- Delegate del = Delegate.CreateDelegate (b.Source.Event.EventHandlerType, b.Target.Instance, b.Target.Method);\r
- addHandler.Invoke (this, new object[] { del });\r
- continue;\r
- }\r
- resolved.Add (b); \r
- }\r
- //group;only one dynMethods by target (valuechanged event source)\r
- //changed value name tested in switch\r
- IEnumerable<Binding[]> groupedByTarget = resolved.GroupBy (g => g.Target.Instance, g => g, (k, g) => g.ToArray ());\r
- foreach (Binding[] grouped in groupedByTarget) {\r
- int i = 0;\r
- Type targetType = grouped[0].Target.Instance.GetType();\r
- Type sourceType = this.GetType();\r
-\r
- DynamicMethod dm = null;\r
- ILGenerator il = null;\r
-\r
- MethodInfo stringEquals = typeof(string).GetMethod\r
- ("op_Equality", new Type[2] {typeof(string), typeof(string)});\r
-\r
-\r
- System.Reflection.Emit.Label[] jumpTable = null;\r
- System.Reflection.Emit.Label endMethod = new System.Reflection.Emit.Label();\r
-\r
- #region Retrieve EventHandler parameter type\r
- EventInfo ei = targetType.GetEvent ("ValueChanged");\r
- //no dynamic update if ValueChanged interface is not implemented\r
- if (ei != null){\r
- MethodInfo evtInvoke = ei.EventHandlerType.GetMethod ("Invoke");\r
- ParameterInfo[] evtParams = evtInvoke.GetParameters ();\r
- Type handlerArgsType = evtParams [1].ParameterType;\r
-\r
- Type[] args = {typeof(object), typeof(object),handlerArgsType};\r
- dm = new DynamicMethod(grouped[0].NewDynMethodId,\r
- MethodAttributes.Family | MethodAttributes.FamANDAssem | MethodAttributes.NewSlot,\r
- CallingConventions.Standard,\r
- typeof(void),\r
- args,\r
- sourceType,true);\r
-\r
- il = dm.GetILGenerator(256);\r
-\r
- endMethod = il.DefineLabel();\r
- jumpTable = new System.Reflection.Emit.Label[grouped.Length];\r
- for (i = 0; i < grouped.Length; i++)\r
- jumpTable [i] = il.DefineLabel ();\r
- il.DeclareLocal(typeof(string));\r
- il.DeclareLocal(typeof(object));\r
-\r
- il.Emit(OpCodes.Nop);\r
- il.Emit(OpCodes.Ldarg_0);\r
- //il.Emit(OpCodes.Isinst, sourceType);\r
- //push new value onto stack\r
- il.Emit(OpCodes.Ldarg_2);\r
- FieldInfo fiNewValue = typeof(ValueChangeEventArgs).GetField("NewValue");\r
- il.Emit(OpCodes.Ldfld, fiNewValue);\r
- il.Emit(OpCodes.Stloc_1);\r
- //push name \r
- il.Emit(OpCodes.Ldarg_2);\r
- FieldInfo fiMbName = typeof(ValueChangeEventArgs).GetField("MemberName");\r
- il.Emit(OpCodes.Ldfld, fiMbName);\r
- il.Emit(OpCodes.Stloc_0);\r
- il.Emit(OpCodes.Ldloc_0);\r
- il.Emit(OpCodes.Brfalse, endMethod);\r
- }\r
- #endregion\r
-\r
- i = 0;\r
- foreach (Binding b in grouped) {\r
- #region initialize target with actual value\r
- object targetValue = null;\r
- if (b.Target.Member != null){\r
- if (b.Target.Member.MemberType == MemberTypes.Property)\r
- targetValue = b.Target.Property.GetGetMethod ().Invoke (b.Target.Instance, null);\r
- else if (b.Target.Member.MemberType == MemberTypes.Field)\r
- targetValue = b.Target.Field.GetValue (b.Target.Instance);\r
- else if (b.Target.Member.MemberType == MemberTypes.Method){\r
- MethodInfo mthSrc = b.Target.Method;\r
- if (mthSrc.IsDefined(typeof(ExtensionAttribute), false))\r
- targetValue = mthSrc.Invoke(null, new object[] {b.Target.Instance});\r
- else\r
- targetValue = mthSrc.Invoke(b.Target.Instance, null);\r
- }else\r
- throw new Exception ("unandled source member type for binding"); \r
- }else if (string.IsNullOrEmpty(b.Expression))\r
- targetValue= grouped [0].Target.Instance;//empty binding exp=> bound to target object by default\r
- //TODO: handle other dest type conversions\r
- if (b.Source.Property.PropertyType == typeof(string)){\r
- if (targetValue == null){\r
- //set default value\r
-\r
- }else\r
- targetValue = targetValue.ToString ();\r
- }\r
- b.Source.Property.GetSetMethod ().Invoke (this, new object[] { targetValue });\r
- #endregion\r
-\r
- //if no dyn update, skip jump table\r
- if (il == null)\r
- continue;\r
-\r
- il.Emit (OpCodes.Ldloc_0);\r
- if (b.Target.Member != null)\r
- il.Emit (OpCodes.Ldstr, b.Target.Member.Name);\r
- else\r
- il.Emit (OpCodes.Ldstr, b.Expression.Split('/').LastOrDefault());\r
- il.Emit (OpCodes.Callvirt, stringEquals);\r
- il.Emit (OpCodes.Brtrue, jumpTable[i]);\r
- i++;\r
- }\r
-\r
- if (il == null)\r
- continue;\r
- \r
- il.Emit (OpCodes.Br, endMethod);\r
-\r
- i = 0;\r
- foreach (Binding b in grouped) {\r
-\r
- il.MarkLabel (jumpTable [i]);\r
- il.Emit(OpCodes.Ldloc_1);\r
-\r
- //by default, target value type is deducted from source member type to allow\r
- //memberless binding, if targetMember exists, it will be used to determine target\r
- //value type for conversion\r
- Type targetValueType = b.Source.Property.PropertyType;\r
- if (b.Target.Member != null) {\r
- if (b.Target.Member.MemberType == MemberTypes.Property)\r
- targetValueType = b.Target.Property.PropertyType;\r
- else if (b.Target.Member.MemberType == MemberTypes.Field)\r
- targetValueType = b.Target.Field.FieldType;\r
- else\r
- throw new Exception ("unhandle target member type in binding");\r
- }\r
- \r
- if (!targetValueType.IsValueType)\r
- il.Emit(OpCodes.Castclass, targetValueType);\r
- else if (b.Source.Property.PropertyType != targetValueType)\r
- il.Emit(OpCodes.Callvirt, CompilerServices.GetConvertMethod( b.Source.Property.PropertyType ));\r
- else\r
- il.Emit(OpCodes.Unbox_Any, b.Source.Property.PropertyType);\r
-\r
- il.Emit(OpCodes.Callvirt, b.Source.Property.GetSetMethod());\r
- il.Emit (OpCodes.Br, endMethod);\r
- i++;\r
-\r
- }\r
- il.MarkLabel(endMethod);\r
- il.Emit(OpCodes.Pop);\r
- il.Emit(OpCodes.Ret);\r
-\r
- Delegate del = dm.CreateDelegate(ei.EventHandlerType, this);\r
- MethodInfo addHandler = ei.GetAddMethod ();\r
- addHandler.Invoke(grouped [0].Target.Instance, new object[] {del});\r
- }\r
- }\r
- /// <summary>\r
- /// Compile events expression in GOML attributes\r
- /// </summary>\r
- /// <param name="es">Event binding details</param>\r
- public void CompileEventSource(Binding binding)\r
- { \r
- Type sourceType = this.GetType();\r
-\r
- #region Retrieve EventHandler parameter type\r
- MethodInfo evtInvoke = binding.Source.Event.EventHandlerType.GetMethod ("Invoke");\r
- ParameterInfo[] evtParams = evtInvoke.GetParameters ();\r
- Type handlerArgsType = evtParams [1].ParameterType;\r
- #endregion\r
-\r
- Type[] args = {typeof(object), typeof(object),handlerArgsType};\r
- DynamicMethod dm = new DynamicMethod(binding.NewDynMethodId,\r
- typeof(void), \r
- args,\r
- sourceType);\r
-\r
-\r
- #region IL generation\r
- ILGenerator il = dm.GetILGenerator(256);\r
-\r
- string src = binding.Expression.Trim();\r
-\r
- if (! (src.StartsWith("{") || src.EndsWith ("}"))) \r
- throw new Exception (string.Format("GOML:Malformed {0} Event handler: {1}", binding.Source.Member.Name, binding.Expression));\r
-\r
- src = src.Substring (1, src.Length - 2);\r
- string[] srcLines = src.Split (new char[] { ';' });\r
-\r
- foreach (string srcLine in srcLines) {\r
- string statement = srcLine.Trim ();\r
-\r
- string[] operandes = statement.Split (new char[] { '=' });\r
- if (operandes.Length < 2) //not an affectation\r
- {\r
- continue;\r
- }\r
- string lop = operandes [0].Trim ();\r
- string rop = operandes [operandes.Length-1].Trim ();\r
-\r
- #region LEFT OPERANDES\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 > 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[] 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 (lopMbis[0].MemberType) {\r
- case MemberTypes.Property:\r
- PropertyInfo lopPi = sourceType.GetProperty (lopParts[i]);\r
- MethodInfo dstMi = lopPi.GetSetMethod ();\r
- lopT = lopPi.PropertyType;\r
- lopSetMbi = dstMi;\r
- lopSetOC = OpCodes.Callvirt;\r
- break;\r
- case MemberTypes.Field:\r
- FieldInfo dstFi = sourceType.GetField(lopParts[i]);\r
- lopT = dstFi.FieldType;\r
- lopSetMbi = dstFi;\r
- lopSetOC = OpCodes.Stfld;\r
- break;\r
- default:\r
- throw new Exception (string.Format("GOML:member type not handle: {0}", lopParts[i]));\r
- } \r
- #endregion\r
-\r
- #region RIGHT OPERANDES\r
- if (rop.StartsWith("\'")){\r
- if (!rop.EndsWith("\'"))\r
- throw new Exception (string.Format\r
- ("GOML:malformed string constant in handler: {0}", rop)); \r
- string strcst = rop.Substring (1, rop.Length - 2);\r
-\r
- il.Emit(OpCodes.Ldstr,strcst);\r
-\r
- }else{\r
- //search for a static field in left operand type named 'rop name'\r
- FieldInfo ropFi = lopT.GetField (rop, BindingFlags.Static|BindingFlags.Public);\r
- if (ropFi != null)\r
- {\r
- il.Emit (OpCodes.Ldsfld, ropFi);\r
- }else{\r
- //search if parsing methods are present\r
- MethodInfo lopTryParseMi = lopT.GetMethod("TryParse");\r
- //TODO\r
- }\r
- }\r
-\r
- #endregion\r
-\r
- //emit left operand assignment\r
- il.Emit(lopSetOC, lopSetMbi);\r
- }\r
-\r
- il.Emit(OpCodes.Ret);\r
-\r
- #endregion\r
-\r
- Delegate del = dm.CreateDelegate(binding.Source.Event.EventHandlerType,this);\r
- MethodInfo addHandler = binding.Source.Event.GetAddMethod ();\r
- addHandler.Invoke(this, new object[] {del});\r
- }\r
- /// <summary>\r
- /// Remove dynamic delegates by ids from dataSource\r
- /// and delete ref of this in Shared interface refs\r
- /// </summary>\r
- public virtual void ClearBinding(){\r
- foreach (Binding b in Bindings) {\r
- if (string.IsNullOrEmpty (b.DynMethodId))\r
- continue;\r
- MemberReference mr = null;\r
- if (b.Target == null)\r
- mr = b.Source;\r
- else\r
- mr = b.Target;\r
- Type dataSourceType = mr.Instance.GetType();\r
- EventInfo evtInfo = dataSourceType.GetEvent ("ValueChanged");\r
- FieldInfo evtFi = CompilerServices.GetEventHandlerField (dataSourceType, "ValueChanged");\r
- MulticastDelegate multicastDelegate = evtFi.GetValue (mr.Instance) as MulticastDelegate;\r
- if (multicastDelegate != null) { \r
- foreach (Delegate d in multicastDelegate.GetInvocationList()) { \r
- if (d.Method.Name == b.DynMethodId)\r
- evtInfo.RemoveEventHandler (mr.Instance, d);\r
- }\r
- }\r
- b.Reset ();\r
- }\r
- }\r
- #endregion\r
-\r
- #region IXmlSerializable\r
- public virtual System.Xml.Schema.XmlSchema GetSchema ()\r
- {\r
- return null;\r
- }\r
- public virtual void ReadXml (System.Xml.XmlReader reader)\r
- {\r
- if (!reader.HasAttributes)\r
- return;\r
- Type thisType = this.GetType ();\r
- while (reader.MoveToNextAttribute ()) {\r
- string attName = reader.Name;\r
- string attValue = reader.Value;\r
-\r
- if (string.IsNullOrEmpty (attValue))\r
- continue;\r
- \r
- MemberInfo mi = thisType.GetMember (attName).FirstOrDefault();\r
- if (mi == null) {\r
- Debug.WriteLine ("GOML: Unknown attribute in " + thisType.ToString() + " : " + attName);\r
- continue;\r
- }\r
- if (mi.MemberType == MemberTypes.Event) {\r
- this.Bindings.Add (new Binding (new MemberReference(this, mi), attValue));\r
- continue;\r
- }\r
- if (mi.MemberType == MemberTypes.Property) {\r
- PropertyInfo pi = mi as PropertyInfo;\r
-\r
- if (pi.GetSetMethod () == null)\r
- continue;\r
-\r
- bool isAttribute = false;\r
- object defaultValue = null;\r
-\r
- foreach (object attrib in pi.GetCustomAttributes ()) {\r
- XmlAttributeAttribute xaa = attrib as XmlAttributeAttribute;\r
- if (xaa != null) {\r
- isAttribute = true;\r
- if (!string.IsNullOrEmpty (xaa.AttributeName))\r
- attName = xaa.AttributeName;\r
- continue;\r
- }\r
- if (attrib is XmlIgnoreAttribute)\r
- break;\r
- DefaultValueAttribute dv = attrib as DefaultValueAttribute;\r
- if (dv != null)\r
- defaultValue = dv.Value; \r
- }\r
- if (!isAttribute)\r
- continue;\r
-// {\r
-// //avoid system types automaticaly converted by parser\r
-// if (defaultValue != null && !pi.PropertyType.Namespace.StartsWith("System")) {\r
-// if (pi.PropertyType != defaultValue.GetType()) {\r
-// MethodInfo miParse = pi.PropertyType.GetMethod ("Parse", BindingFlags.Static | BindingFlags.Public);\r
-// if (miParse != null) { \r
-// pi.SetValue (this, miParse.Invoke (null, new object[]{ defaultValue }), null);\r
-// continue;\r
-// }\r
-// }\r
-// }\r
-// pi.SetValue (this, defaultValue, null);\r
-// } else {\r
-\r
- if (attValue.StartsWith("{")) {\r
- //binding\r
- if (!attValue.EndsWith("}"))\r
- throw new Exception (string.Format("GOML:Malformed binding: {0}", attValue));\r
-\r
- this.Bindings.Add (new Binding (new MemberReference(this, pi), attValue.Substring (1, attValue.Length - 2)));\r
- continue;\r
- }\r
-\r
- if (pi.PropertyType == typeof(string)) {\r
- pi.SetValue (this, attValue, null);\r
- continue;\r
- }\r
-\r
- if (pi.PropertyType.IsEnum) {\r
- pi.SetValue (this, Enum.Parse (pi.PropertyType, attValue), null);\r
- } else {\r
- MethodInfo me = pi.PropertyType.GetMethod ("Parse", new Type[] { typeof(string) });\r
- pi.SetValue (this, me.Invoke (null, new string[] { attValue }), null);\r
- }\r
- }\r
- }\r
- reader.MoveToElement();\r
- }\r
- public virtual void WriteXml (System.Xml.XmlWriter writer)\r
- {\r
- foreach (PropertyInfo pi in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) {\r
- if (pi.GetSetMethod () == null)\r
- continue;\r
-\r
- bool isAttribute = false;\r
- bool hasDefaultValue = false;\r
- bool ignore = false;\r
- string name = "";\r
- object value = null;\r
- Type valueType = null;\r
-\r
-\r
- MemberInfo mi = pi.GetGetMethod ();\r
-\r
- if (mi == null)\r
- continue;\r
-\r
- value = pi.GetValue (this, null);\r
- valueType = pi.PropertyType;\r
- name = pi.Name;\r
-\r
-\r
-\r
- object[] att = pi.GetCustomAttributes (false);\r
-\r
- foreach (object o in att) {\r
- XmlAttributeAttribute xaa = o as XmlAttributeAttribute;\r
- if (xaa != null) {\r
- isAttribute = true;\r
- if (string.IsNullOrEmpty (xaa.AttributeName))\r
- name = pi.Name;\r
- else\r
- name = xaa.AttributeName;\r
- continue;\r
- }\r
-\r
- XmlIgnoreAttribute xia = o as XmlIgnoreAttribute;\r
- if (xia != null) {\r
- ignore = true;\r
- continue;\r
- }\r
-\r
- DefaultValueAttribute dv = o as DefaultValueAttribute;\r
- if (dv != null) {\r
- if (dv.Value.Equals (value))\r
- hasDefaultValue = true;\r
- if (dv.Value.ToString () == value.ToString ())\r
- hasDefaultValue = true;\r
-\r
- continue;\r
- }\r
-\r
-\r
- }\r
-\r
- if (hasDefaultValue || ignore || value==null)\r
- continue;\r
-\r
- if (isAttribute)\r
- writer.WriteAttributeString (name, value.ToString ());\r
- else {\r
- if (valueType.GetInterface ("IXmlSerializable") == null)\r
- continue;\r
-\r
- (pi.GetValue (this, null) as IXmlSerializable).WriteXml (writer);\r
- }\r
- }\r
- foreach (EventInfo ei in this.GetType().GetEvents()) {\r
- FieldInfo fi = this.GetType().GetField(ei.Name,\r
- BindingFlags.NonPublic |\r
- BindingFlags.Instance |\r
- BindingFlags.GetField);\r
-\r
- Delegate dg = (System.Delegate)fi.GetValue (this);\r
-\r
- if (dg == null)\r
- continue;\r
-\r
- foreach (Delegate d in dg.GetInvocationList()) {\r
- if (!d.Method.Name.StartsWith ("<"))//Skipping empty handler, not clear it's trikky \r
- writer.WriteAttributeString (ei.Name, d.Method.Name);\r
- } \r
- }\r
- }\r
- #endregion\r
-\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+//using OpenTK.Graphics.OpenGL;
+using System.Drawing.Imaging;
+using System.Diagnostics;
+using OpenTK.Input;
+
+using Cairo;
+
+using System.Xml.Serialization;
+using System.Reflection;
+using System.ComponentModel;
+using System.IO;
+//using System.Xml;
+using System.Xml;
+using System.Runtime.CompilerServices;
+using System.Reflection.Emit;
+
+namespace Crow
+{
+ public class GraphicObject : IXmlSerializable, ILayoutable, IValueChange
+ {
+ #if DEBUG_LAYOUTING
+ internal static ulong currentUid = 0;
+ internal ulong uid = 0;
+ #endif
+
+ internal List<Binding> Bindings = new List<Binding> ();
+
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ public virtual void NotifyValueChanged(string MemberName, object _value)
+ {
+ ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+ }
+ #endregion
+
+ #region CTOR
+ public GraphicObject ()
+ {
+ #if DEBUG_LAYOUTING
+ uid = currentUid;
+ currentUid++;
+ #endif
+
+ if (Interface.XmlSerializerInit)
+ return;
+
+ loadDefaultValues ();
+ registerForGraphicUpdate ();
+ }
+ public GraphicObject (Rectangle _bounds)
+ {
+ if (Interface.XmlSerializerInit)
+ return;
+
+ loadDefaultValues ();
+ Bounds = _bounds;
+ registerForGraphicUpdate ();
+ }
+ #endregion
+
+ #region private fields
+ ILayoutable _parent;
+ string _name = "unamed";
+ Color _background = Color.Transparent;
+ Color _foreground = Color.White;
+ Font _font = "droid, 10";
+ double _cornerRadius = 0;
+ int _margin = 0;
+ bool _focusable = false;
+ bool _hasFocus = false;
+ bool _mouseRepeat;
+ protected bool _isVisible = true;
+ VerticalAlignment _verticalAlignment = VerticalAlignment.Center;
+ HorizontalAlignment _horizontalAlignment = HorizontalAlignment.Center;
+ Size _maximumSize = "0;0";
+ Size _minimumSize = "0;0";
+
+ Picture _backgroundImage;
+ string _backgroundImagePath;
+ #endregion
+
+ #region public fields
+ public GraphicObject LogicalParent;
+ public Rectangle Bounds;
+ public Rectangle Slot = new Rectangle ();
+ public object Tag;
+ public byte[] bmp;
+ #endregion
+
+ #region ILayoutable
+ //TODO: it would save the recurent cost of a cast in event bubbling if parent type was GraphicObject
+ // or we could add to the interface the mouse events
+ [XmlIgnore]public ILayoutable Parent {
+ get { return _parent; }
+ set {
+// if (_parent == value)
+// return;
+// if (_parent != null)
+// ClearBinding ();
+//
+ _parent = value;
+//
+// if (DataSource != null)
+// ResolveBindings ();
+ }
+ }
+
+
+ [XmlIgnore]public virtual Rectangle ClientRectangle {
+ get {
+ Rectangle cb = Slot.Size;
+ cb.Inflate ( - Margin);
+ return cb;
+ }
+ }
+ [XmlIgnore]public virtual IGOLibHost HostContainer {
+ get { return Parent == null ? null : Parent.HostContainer; }
+ }
+ public virtual Rectangle ContextCoordinates(Rectangle r){
+ return
+ Parent.ContextCoordinates (r);// + ClientRectangle.Position;
+ }
+ public virtual Rectangle ScreenCoordinates (Rectangle r){
+ //r += Slot.Position;
+
+ return
+ Parent.ScreenCoordinates(r) + Parent.getSlot().Position + Parent.ClientRectangle.Position;
+ }
+ public virtual Rectangle getSlot()
+ {
+ return Slot;
+ }
+ public virtual Rectangle getBounds()
+ {
+ return Bounds;
+ }
+ #endregion
+
+ #region EVENT HANDLERS
+ public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;
+ public event EventHandler<MouseButtonEventArgs> MouseUp;
+ public event EventHandler<MouseButtonEventArgs> MouseDown;
+ public event EventHandler<MouseButtonEventArgs> MouseClick;
+ public event EventHandler<MouseMoveEventArgs> MouseMove;
+ public event EventHandler<MouseMoveEventArgs> MouseEnter;
+ public event EventHandler<MouseMoveEventArgs> MouseLeave;
+ public event EventHandler<KeyboardKeyEventArgs> KeyDown;
+ public event EventHandler<KeyboardKeyEventArgs> KeyUp;
+ public event EventHandler Focused;
+ public event EventHandler Unfocused;
+ public event EventHandler<LayoutChangeEventArgs> LayoutChanged;
+ #endregion
+
+ #region public properties
+ [XmlAttributeAttribute()][DefaultValue("unamed")]
+ public virtual string Name {
+ get { return _name; }
+ set {
+ if (_name == value)
+ return;
+ _name = value;
+ NotifyValueChanged("Name", _verticalAlignment);
+ }
+ }
+ [XmlAttributeAttribute ()][DefaultValue(VerticalAlignment.Center)]
+ public virtual VerticalAlignment VerticalAlignment {
+ get { return _verticalAlignment; }
+ set {
+ if (_verticalAlignment == value)
+ return;
+
+ _verticalAlignment = value;
+ NotifyValueChanged("VerticalAlignment", _verticalAlignment);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(HorizontalAlignment.Center)]
+ public virtual HorizontalAlignment HorizontalAlignment {
+ get { return _horizontalAlignment; }
+ set {
+ if (_horizontalAlignment == value)
+ return;
+
+ _horizontalAlignment = value;
+ NotifyValueChanged("HorizontalAlignment", _horizontalAlignment);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(0)]
+ public virtual int Left {
+ get { return Bounds.X; }
+ set {
+ if (Bounds.X == value)
+ return;
+
+ Bounds.X = value;
+ NotifyValueChanged ("Left", Bounds.X);
+ this.RegisterForLayouting ((int)LayoutingType.X);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(0)]
+ public virtual int Top {
+ get { return Bounds.Y; }
+ set {
+ if (Bounds.Y == value)
+ return;
+
+ Bounds.Y = value;
+ NotifyValueChanged ("Top", Bounds.Y);
+ this.RegisterForLayouting ((int)LayoutingType.Y);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(0)]
+ public virtual int Width {
+ get { return Bounds.Width; }
+ set {
+ if (Bounds.Width == value)
+ return;
+
+ Bounds.Width = value;
+ NotifyValueChanged ("Width", Bounds.Width);
+ this.RegisterForLayouting ((int)LayoutingType.Width);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(0)]
+ public virtual int Height {
+ get { return Bounds.Height; }
+ set {
+ if (Bounds.Height == value)
+ return;
+
+ Bounds.Height = value;
+ NotifyValueChanged ("Height", Bounds.Height);
+ this.RegisterForLayouting ((int)LayoutingType.Height);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public virtual bool Fit {
+ get { return Bounds.Width < 0 && Bounds.Height < 0 ? true : false; }
+ set {
+ if (value == Fit)
+ return;
+
+ Bounds.Width = Bounds.Height = -1;
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public virtual bool Focusable {
+ get { return _focusable; }
+ set {
+ if (_focusable == value)
+ return;
+ _focusable = value;
+ NotifyValueChanged ("Focusable", _focusable);
+ }
+ }
+ [XmlIgnore]public virtual bool HasFocus {
+ get { return _hasFocus; }
+ set {
+ if (value == _hasFocus)
+ return;
+
+ _hasFocus = value;
+ NotifyValueChanged ("HasFocus", _hasFocus);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public virtual bool MouseRepeat {
+ get { return _mouseRepeat; }
+ set {
+ if (_mouseRepeat == value)
+ return;
+ _mouseRepeat = value;
+ NotifyValueChanged ("MouseRepeat", _mouseRepeat);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue("Transparent")]
+ public virtual Color Background {
+ get { return _background; }
+ set {
+ if (_background == value)
+ return;
+ _background = value;
+ NotifyValueChanged ("Background", _background);
+ registerForGraphicUpdate ();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue("White")]
+ public virtual Color Foreground {
+ get { return _foreground; }
+ set {
+ if (_foreground == value)
+ return;
+ _foreground = value;
+ NotifyValueChanged ("Foreground", _foreground);
+ registerForGraphicUpdate ();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue("droid,10")]
+ public virtual Font Font {
+ get { return _font; }
+ set {
+ if (value == _font)
+ return;
+ _font = value;
+ NotifyValueChanged ("Font", _font);
+ registerForGraphicUpdate ();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(0.0)]
+ public virtual double CornerRadius {
+ get { return _cornerRadius; }
+ set {
+ if (value == _cornerRadius)
+ return;
+ _cornerRadius = value;
+ NotifyValueChanged ("CornerRadius", _cornerRadius);
+ registerForGraphicUpdate ();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(0)]
+ public virtual int Margin {
+ get { return _margin; }
+ set {
+ if (value == _margin)
+ return;
+ _margin = value;
+ NotifyValueChanged ("Margin", _margin);
+ registerForGraphicUpdate ();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(true)]
+ public virtual bool Visible {
+ get { return _isVisible; }
+ set {
+ if (value == _isVisible)
+ return;
+
+ _isVisible = value;
+
+ if (HostContainer == null)
+ return;
+ //add slot to clipping to redraw
+ HostContainer.gobjsToRedraw.Add (this);
+
+ //ensure main win doesn't keep hidden childrens ref
+ if (this.Contains (HostContainer.hoverWidget))
+ HostContainer.hoverWidget = null;
+ if (Parent is GenericStack)
+ Parent.RegisterForLayouting ((int)LayoutingType.Sizing | (int)LayoutingType.PositionChildren);
+
+ NotifyValueChanged ("Visible", _isVisible);
+ }
+ }
+ //TODO: only used in group, should be removed from base go object
+ [XmlIgnore]public virtual bool DrawingIsValid
+ { get { return bmp == null ?
+ false :
+ true; } }
+ [XmlAttributeAttribute()][DefaultValue("0;0")]
+ public virtual Size MaximumSize {
+ get { return _maximumSize; }
+ set { _maximumSize = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue("0;0")]
+ public virtual Size MinimumSize {
+ get { return _minimumSize; }
+ set { _minimumSize = value; }
+ }
+ object dataSource;
+
+ [XmlIgnore]public virtual object DataSource {
+ set {
+ if (dataSource == value)
+ return;
+
+ if (dataSource != null)
+ this.ClearBinding ();
+
+ dataSource = value;
+
+ if (dataSource != null)
+ this.ResolveBindings();
+ }
+ get {
+ return dataSource == null ?
+ LogicalParent == null ?
+ Parent is GraphicObject ? (Parent as GraphicObject).DataSource : null : LogicalParent.DataSource : dataSource;
+ }
+ }
+ #endregion
+
+
+ /// <summary>
+ /// Loads the default values from XML attributes default
+ /// </summary>
+ protected virtual void loadDefaultValues()
+ {
+ foreach (PropertyInfo pi in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) {
+ if (pi.GetSetMethod () == null)
+ continue;
+ string name = "";
+
+ object[] att = pi.GetCustomAttributes (false);
+
+ foreach (object o in att) {
+ XmlAttributeAttribute xaa = o as XmlAttributeAttribute;
+ if (xaa != null) {
+ if (string.IsNullOrEmpty (xaa.AttributeName))
+ name = pi.Name;
+ else
+ name = xaa.AttributeName;
+ continue;
+ }
+
+ XmlIgnoreAttribute xia = o as XmlIgnoreAttribute;
+ if (xia != null)
+ continue;
+
+ DefaultValueAttribute dv = o as DefaultValueAttribute;
+ if (dv != null) {
+ object defaultValue = dv.Value;
+ //avoid system types automaticaly converted by parser
+ if (defaultValue != null && !pi.PropertyType.Namespace.StartsWith("System")) {
+ if (pi.PropertyType != defaultValue.GetType()) {
+ MethodInfo miParse = pi.PropertyType.GetMethod ("Parse", BindingFlags.Static | BindingFlags.Public);
+ if (miParse != null) {
+ pi.SetValue (this, miParse.Invoke (null, new object[]{ defaultValue }), null);
+ continue;
+ }
+ }
+ }
+ pi.SetValue (this, defaultValue, null);
+ }
+ }
+ }
+ }
+
+ public virtual GraphicObject FindByName(string nameToFind){
+ return nameToFind == _name ? this : null;
+ }
+ public virtual bool Contains(GraphicObject goToFind){
+ return false;
+ }
+
+
+ /// <summary>
+ /// Clear chached object and add clipping region in redraw list of interface
+ /// </summary>
+ public virtual void registerForGraphicUpdate ()
+ {
+ bmp = null;
+ if (HostContainer != null)
+ HostContainer.gobjsToRedraw.Add (this);
+ }
+ /// <summary>
+ /// Add clipping region in redraw list of interface, dont update cached object content
+ /// </summary>
+ public virtual void RegisterForRedraw ()
+ {
+ if (HostContainer != null)
+ HostContainer.gobjsToRedraw.Add (this);
+ }
+
+ /// <summary>
+ /// keep last slot components for each layouting pass to track
+ /// changes and trigger update of other component accordingly
+ /// </summary>
+ public Rectangle LastSlots;
+ /// <summary>
+ /// keep last slot painted on screen to clear traces if moved or resized
+ /// TODO: we should ensure the whole parsed widget tree is the last painted
+ /// version to clear effective oldslot if parents have been moved or resized.
+ /// IDEA is to add a ScreenCoordinates function that use only lastPaintedSlots
+ /// </summary>
+ public Rectangle LastPaintedSlot;
+
+ public virtual void registerClipRect()
+ {
+ HostContainer.redrawClip.AddRectangle (ScreenCoordinates(Slot));
+ //this clipping should take only last painted slots in ancestor tree which
+ //is not the case for now.
+ HostContainer.redrawClip.AddRectangle (ScreenCoordinates(LastPaintedSlot));
+ }
+ /// <summary> return size of content + margins </summary>
+ protected virtual Size measureRawSize ()
+ {
+ return Bounds.Size;
+ }
+ /// <summary> clear current layoutingQueue items for object and
+ /// trigger a new layouting pass for a layoutType </summary>
+ public virtual void RegisterForLayouting(int layoutType)
+ {
+ if (Parent == null)
+ return;
+ #if DEBUG_LAYOUTING
+ Debug.WriteLine ("RegisterForLayouting => {1}->{0}", layoutType, this.ToString());
+ #endif
+ lock (Interface.LayoutingQueue) {
+ Interface.LayoutingQueue.RemoveAll (lq => lq.GraphicObject == this && (layoutType & (int)lq.LayoutType) > 0);
+
+ if ((layoutType & (int)LayoutingType.Width) > 0) {
+ if (Bounds.Width == 0) //stretch in parent
+ Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Width, this);
+ else if (Bounds.Width < 0) //fit
+ Interface.LayoutingQueue.EnqueueBeforeParentSizing (LayoutingType.Width, this);
+ else
+ Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Width, this));
+ }
+
+ if ((layoutType & (int)LayoutingType.Height) > 0) {
+ if (Bounds.Height == 0) //stretch in parent
+ Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Height, this);
+ else if (Bounds.Height < 0) //fit
+ Interface.LayoutingQueue.EnqueueBeforeParentSizing (LayoutingType.Height, this);
+ else
+ Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Height, this));
+ }
+
+ if ((layoutType & (int)LayoutingType.X) > 0)
+ //for x positionning, sizing of parent and this have to be done
+ Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.X, this);
+
+ if ((layoutType & (int)LayoutingType.Y) > 0)
+ //for x positionning, sizing of parent and this have to be done
+ Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.Y, this);
+ }
+ }
+
+ /// <summary> trigger dependant sizing component update </summary>
+ public virtual void OnLayoutChanges(LayoutingType layoutType)
+ {
+ if (Parent==null)
+ return;
+ #if DEBUG_LAYOUTING
+ Debug.WriteLine ("Layout change: " + this.ToString () + ":" + LastSlots.ToString() + "=>" + Slot.ToString ());
+ #endif
+
+ switch (layoutType) {
+ case LayoutingType.Width:
+ if (Parent.getBounds ().Width < 0) {
+ Group gw = Parent as Group;
+ if (gw != null) {
+ if (Slot.Width > gw.maxChildrenWidth)
+ gw.maxChildrenWidth = Slot.Width;
+ }
+ this.Parent.RegisterForLayouting ((int)LayoutingType.Width);
+ }else if (Width != 0) //update position in parent
+ this.RegisterForLayouting ((int)LayoutingType.X);
+ GenericStack gsw = Parent as GenericStack;
+ if (gsw == null)
+ break;
+ if ((Parent as GenericStack).Orientation == Orientation.Horizontal) {
+// ulong idx = (ulong)gsw.Children.IndexOf (this);
+// if (idx < gsw.stackingUpdateStartIndex)
+// gsw.stackingUpdateStartIndex = idx;
+ this.Parent.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ }
+ break;
+ case LayoutingType.Height:
+ if (Parent.getBounds ().Height < 0) {
+ Group gh = Parent as Group;
+ if (gh != null) {
+ if (Slot.Width > gh.maxChildrenHeight)
+ gh.maxChildrenHeight = Slot.Height;
+ }
+ this.Parent.RegisterForLayouting ((int)LayoutingType.Height);
+ }else if (Height != 0) //update position in parent
+ this.RegisterForLayouting ((int)LayoutingType.Y);
+ GenericStack gsh = Parent as GenericStack;
+ if (gsh==null)
+ break;
+ if (gsh.Orientation == Orientation.Vertical) {
+// ulong idx = (ulong)gsh.Children.IndexOf (this);
+// if (idx < gsh.stackingUpdateStartIndex)
+// gsh.stackingUpdateStartIndex = idx;
+ this.Parent.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ }
+ break;
+ }
+ LayoutChanged.Raise (this, new LayoutChangeEventArgs (layoutType));
+ }
+ /// <summary> Update layout component, this is where the computation of alignement
+ /// and size take place </summary>
+ public virtual void UpdateLayout (LayoutingType layoutType)
+ {
+ switch (layoutType) {
+ case LayoutingType.X:
+ if (Bounds.X == 0) {
+ switch (HorizontalAlignment) {
+ case HorizontalAlignment.Left:
+ Slot.X = 0;
+ break;
+ case HorizontalAlignment.Right:
+ Slot.X = Parent.ClientRectangle.Width - Slot.Width;
+ break;
+ case HorizontalAlignment.Center:
+ Slot.X = Parent.ClientRectangle.Width / 2 - Slot.Width / 2;
+ break;
+ }
+ } else
+ Slot.X = Bounds.X;
+
+ if (LastSlots.X == Slot.X)
+ break;
+
+ bmp = null;
+
+ OnLayoutChanges (layoutType);
+
+ LastSlots.X = Slot.X;
+ break;
+ case LayoutingType.Y:
+ if (Bounds.Y == 0) {
+ switch (VerticalAlignment) {
+ case VerticalAlignment.Top:
+ Slot.Y = 0;
+ break;
+ case VerticalAlignment.Bottom:
+ Slot.Y = Parent.ClientRectangle.Height - Slot.Height;
+ break;
+ case VerticalAlignment.Center:
+ Slot.Y = Parent.ClientRectangle.Height / 2 - Slot.Height / 2;
+ break;
+ }
+ }else
+ Slot.Y = Bounds.Y;
+
+ if (LastSlots.Y == Slot.Y)
+ break;
+
+ bmp = null;
+
+ OnLayoutChanges (layoutType);
+
+ LastSlots.Y = Slot.Y;
+ break;
+ case LayoutingType.Width:
+ //force sizing to fit if parent is sizing on children and
+ //this object has stretched size
+ if (Parent.getBounds ().Width < 0 && Width == 0)
+ Width = -1;
+
+ if (Width > 0)
+ Slot.Width = Width;
+ else if (Width < 0)
+ Slot.Width = measureRawSize ().Width;
+ else
+ Slot.Width = Parent.ClientRectangle.Width;
+
+ //size constrain
+ if (Slot.Width < MinimumSize.Width)
+ Slot.Width = MinimumSize.Width;
+ else if (Slot.Width > MaximumSize.Width && MaximumSize.Width > 0)
+ Slot.Width = MaximumSize.Width;
+
+ if (LastSlots.Width == Slot.Width)
+ break;
+
+ bmp = null;
+
+ OnLayoutChanges (layoutType);
+
+ LastSlots.Width = Slot.Width;
+ break;
+ case LayoutingType.Height:
+ //force sizing to fit if parent is sizing on children
+ if (Parent.getBounds ().Height < 0 && Height == 0)
+ Height = -1;
+
+ if (Height > 0)
+ Slot.Height = Height;
+ else if (Height < 0)
+ Slot.Height = measureRawSize ().Height;
+ else
+ Slot.Height = Parent.ClientRectangle.Height;
+
+ //size constrain
+ if (Slot.Height < MinimumSize.Height)
+ Slot.Height = MinimumSize.Height;
+ else if (Slot.Height > MaximumSize.Height && MaximumSize.Height > 0)
+ Slot.Height = MaximumSize.Height;
+
+
+ if (LastSlots.Height == Slot.Height)
+ break;
+
+ bmp = null;
+
+ OnLayoutChanges (layoutType);
+
+ LastSlots.Height = Slot.Height;
+ break;
+ }
+ lock (Interface.LayoutingQueue) {
+ //if no layouting remains in queue for item, registre for redraw
+ if (Interface.LayoutingQueue.Where (lq => lq.GraphicObject == this).Count () <= 0 && bmp == null)
+ this.RegisterForRedraw ();
+ }
+ }
+
+ /// <summary> This is the common overridable drawing routine to create new widget </summary>
+ protected virtual void onDraw(Context gr)
+ {
+ Rectangle rBack = new Rectangle (Slot.Size);
+
+ Background.SetAsSource (gr);
+ CairoHelpers.CairoRectangle(gr,rBack,_cornerRadius);
+ gr.Fill ();
+ }
+
+ /// <summary>
+ /// Interfal drawing context creation on a cached surface limited to slot size
+ /// this trigger the effective drawing routine </summary>
+ protected virtual void UpdateGraphic ()
+ {
+ LastPaintedSlot = Slot;
+
+ int stride = 4 * Slot.Width;
+
+ int bmpSize = Math.Abs (stride) * Slot.Height;
+ bmp = new byte[bmpSize];
+
+ using (ImageSurface draw =
+ new ImageSurface(bmp, Format.Argb32, Slot.Width, Slot.Height, stride)) {
+ using (Context gr = new Context (draw)) {
+ gr.Antialias = Antialias.Subpixel;
+ onDraw (gr);
+ }
+ draw.Flush ();
+ //draw.WriteToPng ("/mnt/data/test.png");
+ }
+ }
+ /// <summary> Chained painting routine on the parent context of the actual cached version
+ /// of the widget </summary>
+ public virtual void Paint (ref Context ctx, Rectangles clip = null)
+ {
+ if (!Visible)
+ return;
+
+ if (bmp == null)
+ UpdateGraphic ();
+
+ Rectangle rb = Parent.ContextCoordinates(Slot);
+
+ using (ImageSurface source = new ImageSurface(bmp, Format.Argb32, Slot.Width, Slot.Height, 4 * Slot.Width)) {
+ if (this.Background == Color.Clear) {
+ ctx.Save ();
+ ctx.Operator = Operator.Clear;
+ ctx.Rectangle(rb);
+ ctx.Fill ();
+ ctx.Restore ();
+ }
+ ctx.SetSourceSurface (source, rb.X, rb.Y);
+ ctx.Paint ();
+ }
+ }
+
+ #region Keyboard handling
+ public virtual void onKeyDown(object sender, KeyboardKeyEventArgs e){
+ KeyDown.Raise (sender, e);
+ }
+ #endregion
+
+ #region Mouse handling
+ public virtual bool MouseIsIn(Point m)
+ {
+ if (!Visible)
+ return false;
+ if (ScreenCoordinates (Slot).ContainsOrIsEqual (m)) {
+ Scroller scr = Parent as Scroller;
+ if (scr == null)
+ return true;
+ return scr.MouseIsIn (scr.savedMousePos);
+ }
+ return false;
+ }
+ public virtual void checkHoverWidget(MouseMoveEventArgs e)
+ {
+ IGOLibHost glh = HostContainer;
+ if (glh.hoverWidget != this) {
+ glh.hoverWidget = this;
+ onMouseEnter (this, e);
+ }
+
+ this.onMouseMove (this, e);
+ }
+ public virtual void onMouseMove(object sender, MouseMoveEventArgs e)
+ {
+ //bubble event to the top
+ GraphicObject p = Parent as GraphicObject;
+ if (p != null)
+ p.onMouseMove(sender,e);
+
+ MouseMove.Raise (sender, e);
+ }
+ public virtual void onMouseDown(object sender, MouseButtonEventArgs e){
+ IGOLibHost hc = HostContainer;
+ if (hc.activeWidget == null)
+ hc.activeWidget = this;
+ if (this.Focusable && !Interface.FocusOnHover) {
+ BubblingMouseButtonEventArg be = e as BubblingMouseButtonEventArg;
+ if (be.Focused == null) {
+ be.Focused = this;
+ hc.FocusedWidget = this;
+ }
+ }
+ //bubble event to the top
+ GraphicObject p = Parent as GraphicObject;
+ if (p != null)
+ p.onMouseDown(sender,e);
+
+ MouseDown.Raise (this, e);
+ }
+ public virtual void onMouseUp(object sender, MouseButtonEventArgs e){
+ //bubble event to the top
+ GraphicObject p = Parent as GraphicObject;
+ if (p != null)
+ p.onMouseUp(sender,e);
+
+ MouseUp.Raise (this, e);
+
+ if (MouseIsIn (e.Position)&&HasFocus)
+ onMouseClick(sender,e);
+ }
+ public virtual void onMouseClick(object sender, MouseButtonEventArgs e){
+ MouseClick.Raise (this, e);
+ }
+ public virtual void onMouseWheel(object sender, MouseWheelEventArgs e){
+ GraphicObject p = Parent as GraphicObject;
+ if (p != null)
+ p.onMouseWheel(this,e);
+
+ MouseWheelChanged.Raise (this, e);
+ }
+ public virtual void onFocused(object sender, EventArgs e){
+ Focused.Raise (this, e);
+ this.HasFocus = true;
+ }
+ public virtual void onUnfocused(object sender, EventArgs e){
+ Unfocused.Raise (this, e);
+ this.HasFocus = false;
+ }
+ public virtual void onMouseEnter(object sender, MouseMoveEventArgs e)
+ {
+ MouseEnter.Raise (this, e);
+ }
+ public virtual void onMouseLeave(object sender, MouseMoveEventArgs e)
+ {
+ MouseLeave.Raise (this, e);
+ }
+ #endregion
+
+ public override string ToString ()
+ {
+ string tmp ="";
+
+ if (Parent != null)
+ tmp = Parent.ToString () + tmp;
+ #if DEBUG_LAYOUTING
+ return Name == "unamed" ? tmp + "." + this.GetType ().Name + uid.ToString(): tmp + "." + Name;
+ #else
+ return Name == "unamed" ? tmp + "." + this.GetType ().Name : tmp + "." + Name;
+ #endif
+ }
+
+ #region Binding
+ public virtual void ResolveBindings()
+ {
+ #if DEBUG_BINDING
+ Debug.WriteLine ("ResolveBinding => " + this.ToString ());
+ #endif
+ List<Binding> resolved = new List<Binding> ();
+ foreach (Binding b in Bindings) {
+ if (!string.IsNullOrEmpty (b.DynMethodId))
+ continue;
+ if (b.Source.Member.MemberType == MemberTypes.Event) {
+ if (b.Expression.StartsWith("{")){
+ CompileEventSource(b);
+ continue;
+ }
+ }
+ if (!b.FindTarget ())
+ continue;
+ if (b.Source.Member.MemberType == MemberTypes.Event) {
+ //register handler for event
+ if (b.Target.Method == null) {
+ Debug.WriteLine ("Handler Method not found: " + b.Expression);
+ continue;
+ }
+
+ MethodInfo addHandler = b.Source.Event.GetAddMethod ();
+ Delegate del = Delegate.CreateDelegate (b.Source.Event.EventHandlerType, b.Target.Instance, b.Target.Method);
+ addHandler.Invoke (this, new object[] { del });
+ continue;
+ }
+ resolved.Add (b);
+ }
+ //group;only one dynMethods by target (valuechanged event source)
+ //changed value name tested in switch
+ IEnumerable<Binding[]> groupedByTarget = resolved.GroupBy (g => g.Target.Instance, g => g, (k, g) => g.ToArray ());
+ foreach (Binding[] grouped in groupedByTarget) {
+ int i = 0;
+ Type targetType = grouped[0].Target.Instance.GetType();
+ Type sourceType = this.GetType();
+
+ DynamicMethod dm = null;
+ ILGenerator il = null;
+
+ MethodInfo stringEquals = typeof(string).GetMethod
+ ("op_Equality", new Type[2] {typeof(string), typeof(string)});
+
+
+ System.Reflection.Emit.Label[] jumpTable = null;
+ System.Reflection.Emit.Label endMethod = new System.Reflection.Emit.Label();
+
+ #region Retrieve EventHandler parameter type
+ EventInfo ei = targetType.GetEvent ("ValueChanged");
+ //no dynamic update if ValueChanged interface is not implemented
+ if (ei != null){
+ MethodInfo evtInvoke = ei.EventHandlerType.GetMethod ("Invoke");
+ ParameterInfo[] evtParams = evtInvoke.GetParameters ();
+ Type handlerArgsType = evtParams [1].ParameterType;
+
+ Type[] args = {typeof(object), typeof(object),handlerArgsType};
+ dm = new DynamicMethod(grouped[0].NewDynMethodId,
+ MethodAttributes.Family | MethodAttributes.FamANDAssem | MethodAttributes.NewSlot,
+ CallingConventions.Standard,
+ typeof(void),
+ args,
+ sourceType,true);
+
+ il = dm.GetILGenerator(256);
+
+ endMethod = il.DefineLabel();
+ jumpTable = new System.Reflection.Emit.Label[grouped.Length];
+ for (i = 0; i < grouped.Length; i++)
+ jumpTable [i] = il.DefineLabel ();
+ il.DeclareLocal(typeof(string));
+ il.DeclareLocal(typeof(object));
+
+ il.Emit(OpCodes.Nop);
+ il.Emit(OpCodes.Ldarg_0);
+ //il.Emit(OpCodes.Isinst, sourceType);
+ //push new value onto stack
+ il.Emit(OpCodes.Ldarg_2);
+ FieldInfo fiNewValue = typeof(ValueChangeEventArgs).GetField("NewValue");
+ il.Emit(OpCodes.Ldfld, fiNewValue);
+ il.Emit(OpCodes.Stloc_1);
+ //push name
+ il.Emit(OpCodes.Ldarg_2);
+ FieldInfo fiMbName = typeof(ValueChangeEventArgs).GetField("MemberName");
+ il.Emit(OpCodes.Ldfld, fiMbName);
+ il.Emit(OpCodes.Stloc_0);
+ il.Emit(OpCodes.Ldloc_0);
+ il.Emit(OpCodes.Brfalse, endMethod);
+ }
+ #endregion
+
+ i = 0;
+ foreach (Binding b in grouped) {
+ #region initialize target with actual value
+ object targetValue = null;
+ if (b.Target.Member != null){
+ if (b.Target.Member.MemberType == MemberTypes.Property)
+ targetValue = b.Target.Property.GetGetMethod ().Invoke (b.Target.Instance, null);
+ else if (b.Target.Member.MemberType == MemberTypes.Field)
+ targetValue = b.Target.Field.GetValue (b.Target.Instance);
+ else if (b.Target.Member.MemberType == MemberTypes.Method){
+ MethodInfo mthSrc = b.Target.Method;
+ if (mthSrc.IsDefined(typeof(ExtensionAttribute), false))
+ targetValue = mthSrc.Invoke(null, new object[] {b.Target.Instance});
+ else
+ targetValue = mthSrc.Invoke(b.Target.Instance, null);
+ }else
+ throw new Exception ("unandled source member type for binding");
+ }else if (string.IsNullOrEmpty(b.Expression))
+ targetValue= grouped [0].Target.Instance;//empty binding exp=> bound to target object by default
+ //TODO: handle other dest type conversions
+ if (b.Source.Property.PropertyType == typeof(string)){
+ if (targetValue == null){
+ //set default value
+
+ }else
+ targetValue = targetValue.ToString ();
+ }
+ b.Source.Property.GetSetMethod ().Invoke (this, new object[] { targetValue });
+ #endregion
+
+ //if no dyn update, skip jump table
+ if (il == null)
+ continue;
+
+ il.Emit (OpCodes.Ldloc_0);
+ if (b.Target.Member != null)
+ il.Emit (OpCodes.Ldstr, b.Target.Member.Name);
+ else
+ il.Emit (OpCodes.Ldstr, b.Expression.Split('/').LastOrDefault());
+ il.Emit (OpCodes.Callvirt, stringEquals);
+ il.Emit (OpCodes.Brtrue, jumpTable[i]);
+ i++;
+ }
+
+ if (il == null)
+ continue;
+
+ il.Emit (OpCodes.Br, endMethod);
+
+ i = 0;
+ foreach (Binding b in grouped) {
+
+ il.MarkLabel (jumpTable [i]);
+ il.Emit(OpCodes.Ldloc_1);
+
+ //by default, target value type is deducted from source member type to allow
+ //memberless binding, if targetMember exists, it will be used to determine target
+ //value type for conversion
+ Type targetValueType = b.Source.Property.PropertyType;
+ if (b.Target.Member != null) {
+ if (b.Target.Member.MemberType == MemberTypes.Property)
+ targetValueType = b.Target.Property.PropertyType;
+ else if (b.Target.Member.MemberType == MemberTypes.Field)
+ targetValueType = b.Target.Field.FieldType;
+ else
+ throw new Exception ("unhandle target member type in binding");
+ }
+
+ if (!targetValueType.IsValueType)
+ il.Emit(OpCodes.Castclass, targetValueType);
+ else if (b.Source.Property.PropertyType != targetValueType)
+ il.Emit(OpCodes.Callvirt, CompilerServices.GetConvertMethod( b.Source.Property.PropertyType ));
+ else
+ il.Emit(OpCodes.Unbox_Any, b.Source.Property.PropertyType);
+
+ il.Emit(OpCodes.Callvirt, b.Source.Property.GetSetMethod());
+ il.Emit (OpCodes.Br, endMethod);
+ i++;
+
+ }
+ il.MarkLabel(endMethod);
+ il.Emit(OpCodes.Pop);
+ il.Emit(OpCodes.Ret);
+
+ Delegate del = dm.CreateDelegate(ei.EventHandlerType, this);
+ MethodInfo addHandler = ei.GetAddMethod ();
+ addHandler.Invoke(grouped [0].Target.Instance, new object[] {del});
+ }
+ }
+ /// <summary>
+ /// Compile events expression in GOML attributes
+ /// </summary>
+ /// <param name="es">Event binding details</param>
+ public void CompileEventSource(Binding binding)
+ {
+ Type sourceType = this.GetType();
+
+ #region Retrieve EventHandler parameter type
+ MethodInfo evtInvoke = binding.Source.Event.EventHandlerType.GetMethod ("Invoke");
+ ParameterInfo[] evtParams = evtInvoke.GetParameters ();
+ Type handlerArgsType = evtParams [1].ParameterType;
+ #endregion
+
+ Type[] args = {typeof(object), typeof(object),handlerArgsType};
+ DynamicMethod dm = new DynamicMethod(binding.NewDynMethodId,
+ typeof(void),
+ args,
+ sourceType);
+
+
+ #region IL generation
+ ILGenerator il = dm.GetILGenerator(256);
+
+ string src = binding.Expression.Trim();
+
+ if (! (src.StartsWith("{") || src.EndsWith ("}")))
+ throw new Exception (string.Format("GOML:Malformed {0} Event handler: {1}", binding.Source.Member.Name, binding.Expression));
+
+ src = src.Substring (1, src.Length - 2);
+ string[] srcLines = src.Split (new char[] { ';' });
+
+ foreach (string srcLine in srcLines) {
+ string statement = srcLine.Trim ();
+
+ string[] operandes = statement.Split (new char[] { '=' });
+ if (operandes.Length < 2) //not an affectation
+ {
+ continue;
+ }
+ string lop = operandes [0].Trim ();
+ string rop = operandes [operandes.Length-1].Trim ();
+
+ #region LEFT OPERANDES
+ GraphicObject lopObj = this; //default left operand base object is
+ //the first arg (object sender) of the event handler
+
+ il.Emit(OpCodes.Ldarg_0); //load sender ref onto the stack
+
+ string[] lopParts = lop.Split (new char[] { '.' });
+ if (lopParts.Length > 1) {//should search also for member of es.Source
+ MethodInfo FindByNameMi = typeof(GraphicObject).GetMethod("FindByName");
+ for (int j = 0; j < lopParts.Length - 1; j++) {
+ il.Emit (OpCodes.Ldstr, lopParts[j]);
+ il.Emit(OpCodes.Callvirt, FindByNameMi);
+ }
+ }
+
+ int i = lopParts.Length -1;
+
+ MemberInfo[] lopMbis = lopObj.GetType().GetMember (lopParts[i]);
+
+ if (lopMbis.Length<1)
+ throw new Exception (string.Format("CROW BINDING: Member not found '{0}'", lop));
+
+ OpCode lopSetOC;
+ dynamic lopSetMbi;
+ Type lopT = null;
+ switch (lopMbis[0].MemberType) {
+ case MemberTypes.Property:
+ PropertyInfo lopPi = sourceType.GetProperty (lopParts[i]);
+ MethodInfo dstMi = lopPi.GetSetMethod ();
+ lopT = lopPi.PropertyType;
+ lopSetMbi = dstMi;
+ lopSetOC = OpCodes.Callvirt;
+ break;
+ case MemberTypes.Field:
+ FieldInfo dstFi = sourceType.GetField(lopParts[i]);
+ lopT = dstFi.FieldType;
+ lopSetMbi = dstFi;
+ lopSetOC = OpCodes.Stfld;
+ break;
+ default:
+ throw new Exception (string.Format("GOML:member type not handle: {0}", lopParts[i]));
+ }
+ #endregion
+
+ #region RIGHT OPERANDES
+ if (rop.StartsWith("\'")){
+ if (!rop.EndsWith("\'"))
+ throw new Exception (string.Format
+ ("GOML:malformed string constant in handler: {0}", rop));
+ string strcst = rop.Substring (1, rop.Length - 2);
+
+ il.Emit(OpCodes.Ldstr,strcst);
+
+ }else{
+ //search for a static field in left operand type named 'rop name'
+ FieldInfo ropFi = lopT.GetField (rop, BindingFlags.Static|BindingFlags.Public);
+ if (ropFi != null)
+ {
+ il.Emit (OpCodes.Ldsfld, ropFi);
+ }else{
+ //search if parsing methods are present
+ MethodInfo lopTryParseMi = lopT.GetMethod("TryParse");
+ //TODO
+ }
+ }
+
+ #endregion
+
+ //emit left operand assignment
+ il.Emit(lopSetOC, lopSetMbi);
+ }
+
+ il.Emit(OpCodes.Ret);
+
+ #endregion
+
+ Delegate del = dm.CreateDelegate(binding.Source.Event.EventHandlerType,this);
+ MethodInfo addHandler = binding.Source.Event.GetAddMethod ();
+ addHandler.Invoke(this, new object[] {del});
+ }
+ /// <summary>
+ /// Remove dynamic delegates by ids from dataSource
+ /// and delete ref of this in Shared interface refs
+ /// </summary>
+ public virtual void ClearBinding(){
+ foreach (Binding b in Bindings) {
+ if (string.IsNullOrEmpty (b.DynMethodId))
+ continue;
+ MemberReference mr = null;
+ if (b.Target == null)
+ mr = b.Source;
+ else
+ mr = b.Target;
+ Type dataSourceType = mr.Instance.GetType();
+ EventInfo evtInfo = dataSourceType.GetEvent ("ValueChanged");
+ FieldInfo evtFi = CompilerServices.GetEventHandlerField (dataSourceType, "ValueChanged");
+ MulticastDelegate multicastDelegate = evtFi.GetValue (mr.Instance) as MulticastDelegate;
+ if (multicastDelegate != null) {
+ foreach (Delegate d in multicastDelegate.GetInvocationList()) {
+ if (d.Method.Name == b.DynMethodId)
+ evtInfo.RemoveEventHandler (mr.Instance, d);
+ }
+ }
+ b.Reset ();
+ }
+ }
+ #endregion
+
+ #region IXmlSerializable
+ public virtual System.Xml.Schema.XmlSchema GetSchema ()
+ {
+ return null;
+ }
+ public virtual void ReadXml (System.Xml.XmlReader reader)
+ {
+ if (!reader.HasAttributes)
+ return;
+ Type thisType = this.GetType ();
+ while (reader.MoveToNextAttribute ()) {
+ string attName = reader.Name;
+ string attValue = reader.Value;
+
+ if (string.IsNullOrEmpty (attValue))
+ continue;
+
+ MemberInfo mi = thisType.GetMember (attName).FirstOrDefault();
+ if (mi == null) {
+ Debug.WriteLine ("GOML: Unknown attribute in " + thisType.ToString() + " : " + attName);
+ continue;
+ }
+ if (mi.MemberType == MemberTypes.Event) {
+ this.Bindings.Add (new Binding (new MemberReference(this, mi), attValue));
+ continue;
+ }
+ if (mi.MemberType == MemberTypes.Property) {
+ PropertyInfo pi = mi as PropertyInfo;
+
+ if (pi.GetSetMethod () == null)
+ continue;
+
+ bool isAttribute = false;
+ object defaultValue = null;
+
+ foreach (object attrib in pi.GetCustomAttributes ()) {
+ XmlAttributeAttribute xaa = attrib as XmlAttributeAttribute;
+ if (xaa != null) {
+ isAttribute = true;
+ if (!string.IsNullOrEmpty (xaa.AttributeName))
+ attName = xaa.AttributeName;
+ continue;
+ }
+ if (attrib is XmlIgnoreAttribute)
+ break;
+ DefaultValueAttribute dv = attrib as DefaultValueAttribute;
+ if (dv != null)
+ defaultValue = dv.Value;
+ }
+ if (!isAttribute)
+ continue;
+// {
+// //avoid system types automaticaly converted by parser
+// if (defaultValue != null && !pi.PropertyType.Namespace.StartsWith("System")) {
+// if (pi.PropertyType != defaultValue.GetType()) {
+// MethodInfo miParse = pi.PropertyType.GetMethod ("Parse", BindingFlags.Static | BindingFlags.Public);
+// if (miParse != null) {
+// pi.SetValue (this, miParse.Invoke (null, new object[]{ defaultValue }), null);
+// continue;
+// }
+// }
+// }
+// pi.SetValue (this, defaultValue, null);
+// } else {
+
+ if (attValue.StartsWith("{")) {
+ //binding
+ if (!attValue.EndsWith("}"))
+ throw new Exception (string.Format("GOML:Malformed binding: {0}", attValue));
+
+ this.Bindings.Add (new Binding (new MemberReference(this, pi), attValue.Substring (1, attValue.Length - 2)));
+ continue;
+ }
+
+ if (pi.PropertyType == typeof(string)) {
+ pi.SetValue (this, attValue, null);
+ continue;
+ }
+
+ if (pi.PropertyType.IsEnum) {
+ pi.SetValue (this, Enum.Parse (pi.PropertyType, attValue), null);
+ } else {
+ MethodInfo me = pi.PropertyType.GetMethod ("Parse", new Type[] { typeof(string) });
+ pi.SetValue (this, me.Invoke (null, new string[] { attValue }), null);
+ }
+ }
+ }
+ reader.MoveToElement();
+ }
+ public virtual void WriteXml (System.Xml.XmlWriter writer)
+ {
+ foreach (PropertyInfo pi in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) {
+ if (pi.GetSetMethod () == null)
+ continue;
+
+ bool isAttribute = false;
+ bool hasDefaultValue = false;
+ bool ignore = false;
+ string name = "";
+ object value = null;
+ Type valueType = null;
+
+
+ MemberInfo mi = pi.GetGetMethod ();
+
+ if (mi == null)
+ continue;
+
+ value = pi.GetValue (this, null);
+ valueType = pi.PropertyType;
+ name = pi.Name;
+
+
+
+ object[] att = pi.GetCustomAttributes (false);
+
+ foreach (object o in att) {
+ XmlAttributeAttribute xaa = o as XmlAttributeAttribute;
+ if (xaa != null) {
+ isAttribute = true;
+ if (string.IsNullOrEmpty (xaa.AttributeName))
+ name = pi.Name;
+ else
+ name = xaa.AttributeName;
+ continue;
+ }
+
+ XmlIgnoreAttribute xia = o as XmlIgnoreAttribute;
+ if (xia != null) {
+ ignore = true;
+ continue;
+ }
+
+ DefaultValueAttribute dv = o as DefaultValueAttribute;
+ if (dv != null) {
+ if (dv.Value.Equals (value))
+ hasDefaultValue = true;
+ if (dv.Value.ToString () == value.ToString ())
+ hasDefaultValue = true;
+
+ continue;
+ }
+
+
+ }
+
+ if (hasDefaultValue || ignore || value==null)
+ continue;
+
+ if (isAttribute)
+ writer.WriteAttributeString (name, value.ToString ());
+ else {
+ if (valueType.GetInterface ("IXmlSerializable") == null)
+ continue;
+
+ (pi.GetValue (this, null) as IXmlSerializable).WriteXml (writer);
+ }
+ }
+ foreach (EventInfo ei in this.GetType().GetEvents()) {
+ FieldInfo fi = this.GetType().GetField(ei.Name,
+ BindingFlags.NonPublic |
+ BindingFlags.Instance |
+ BindingFlags.GetField);
+
+ Delegate dg = (System.Delegate)fi.GetValue (this);
+
+ if (dg == null)
+ continue;
+
+ foreach (Delegate d in dg.GetInvocationList()) {
+ if (!d.Method.Name.StartsWith ("<"))//Skipping empty handler, not clear it's trikky
+ writer.WriteAttributeString (ei.Name, d.Method.Name);
+ }
+ }
+ }
+ #endregion
+
+ }
+}
-using System;\r
-using System.Diagnostics;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Xml.Serialization;\r
-using System.ComponentModel;\r
-\r
-namespace Crow\r
-{\r
- /// <summary>\r
- /// Simple grid container\r
- /// Allow symetric placement of children on a grid,\r
- /// excedental child (above grid sizing) are ignored\r
- /// and invisible child keep their place in the grid\r
- /// </summary>\r
- public class Grid : Group\r
- {\r
- #region CTOR\r
- public Grid()\r
- : base()\r
- { \r
- }\r
- #endregion\r
-\r
- #region Private fields\r
- int _spacing;\r
- int _columnCount;\r
- int _rowCount;\r
- #endregion\r
-\r
- public override T addChild<T> (T child)\r
- {\r
- T tmp = base.addChild (child);\r
- this.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
- return tmp;\r
- }\r
- public override void removeChild (GraphicObject child)\r
- {\r
- base.removeChild (child);\r
- this.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
- }\r
-\r
- #region Public Properties\r
- [XmlAttributeAttribute()][DefaultValue(2)]\r
- public int Spacing\r
- {\r
- get { return _spacing; }\r
- set { _spacing = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(1)]\r
- public virtual int ColumnCount\r
- {\r
- get { return _columnCount; }\r
- set { \r
- if (_columnCount == value)\r
- return;\r
-\r
- _columnCount = value; \r
-\r
- NotifyValueChanged ("ColumnCount", ColumnCount);\r
- this.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(1)]\r
- public virtual int RowCount\r
- {\r
- get { return _rowCount; }\r
- set { \r
- if (_rowCount == value)\r
- return;\r
-\r
- _rowCount = value; \r
-\r
- NotifyValueChanged ("RowCount", RowCount);\r
- this.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
- }\r
- }\r
- public virtual int CaseWidth {\r
- get { return (Slot.Width - (ColumnCount - 1) * Spacing) / ColumnCount; }\r
- }\r
- public virtual int CaseHeight {\r
- get { return (Slot.Height - (RowCount - 1) * Spacing) / RowCount; }\r
- }\r
-\r
- #endregion\r
-\r
- #region GraphicObject Overrides\r
-// protected override Size measureRawSize ()\r
-// {\r
-// Size tmp = new Size ();\r
-//\r
-// foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {\r
-// tmp.Width = Math.Max (tmp.Width, c.Slot.Width);\r
-// tmp.Height = Math.Max (tmp.Height, c.Slot.Height);\r
-// }\r
-//\r
-// tmp.Width *= (ColumnCount - 1) * Spacing / ColumnCount;;\r
-// tmp.Height *= (RowCount - 1) * Spacing / RowCount;\r
-// tmp.Width += 2 * Margin;\r
-// tmp.Height += 2 * Margin;\r
-//\r
-// return tmp;\r
-// }\r
- public virtual void ComputeChildrenPositions()\r
- {\r
- int slotWidth = CaseWidth;\r
- int slotHeight = CaseHeight;\r
- for (int curY = 0; curY < RowCount; curY++) {\r
- for (int curX = 0; curX < ColumnCount; curX++) {\r
- int idx = curY * ColumnCount + curX;\r
- if (idx >= Children.Count)\r
- return;\r
- GraphicObject c = Children [idx];\r
- if (!c.Visible)\r
- continue;\r
- //ensure Item are not realigned\r
- c.HorizontalAlignment = HorizontalAlignment.Left;\r
- c.VerticalAlignment = VerticalAlignment.Top;\r
- c.Left = curX * (slotWidth + Spacing);\r
- c.Top = curY * (slotHeight + Spacing);\r
- c.Width = slotWidth;\r
- c.Height = slotHeight;\r
- }\r
- }\r
- }\r
-\r
- public override void RegisterForLayouting (int layoutType)\r
- { \r
- base.RegisterForLayouting (layoutType);\r
-\r
- if ((layoutType & (int)LayoutingType.PositionChildren) > 0)\r
- Interface.LayoutingQueue.Enqueue (LayoutingType.PositionChildren, this); \r
- }\r
- public override void UpdateLayout (LayoutingType layoutType)\r
- { \r
- if (layoutType == LayoutingType.PositionChildren) { \r
- ComputeChildrenPositions ();\r
- //if no layouting remains in queue for item, registre for redraw\r
- if (Interface.LayoutingQueue.Where (lq => lq.GraphicObject == this).Count () <= 0 && bmp==null)\r
- this.RegisterForRedraw ();\r
- }else\r
- base.UpdateLayout(layoutType);\r
- }\r
- #endregion\r
-\r
- \r
- }\r
-}\r
+using System;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+using System.ComponentModel;
+
+namespace Crow
+{
+ /// <summary>
+ /// Simple grid container
+ /// Allow symetric placement of children on a grid,
+ /// excedental child (above grid sizing) are ignored
+ /// and invisible child keep their place in the grid
+ /// </summary>
+ public class Grid : Group
+ {
+ #region CTOR
+ public Grid()
+ : base()
+ {
+ }
+ #endregion
+
+ #region Private fields
+ int _spacing;
+ int _columnCount;
+ int _rowCount;
+ #endregion
+
+ public override T addChild<T> (T child)
+ {
+ T tmp = base.addChild (child);
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ return tmp;
+ }
+ public override void removeChild (GraphicObject child)
+ {
+ base.removeChild (child);
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ }
+
+ #region Public Properties
+ [XmlAttributeAttribute()][DefaultValue(2)]
+ public int Spacing
+ {
+ get { return _spacing; }
+ set { _spacing = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue(1)]
+ public virtual int ColumnCount
+ {
+ get { return _columnCount; }
+ set {
+ if (_columnCount == value)
+ return;
+
+ _columnCount = value;
+
+ NotifyValueChanged ("ColumnCount", ColumnCount);
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(1)]
+ public virtual int RowCount
+ {
+ get { return _rowCount; }
+ set {
+ if (_rowCount == value)
+ return;
+
+ _rowCount = value;
+
+ NotifyValueChanged ("RowCount", RowCount);
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ }
+ }
+ public virtual int CaseWidth {
+ get { return (Slot.Width - (ColumnCount - 1) * Spacing) / ColumnCount; }
+ }
+ public virtual int CaseHeight {
+ get { return (Slot.Height - (RowCount - 1) * Spacing) / RowCount; }
+ }
+
+ #endregion
+
+ #region GraphicObject Overrides
+// protected override Size measureRawSize ()
+// {
+// Size tmp = new Size ();
+//
+// foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
+// tmp.Width = Math.Max (tmp.Width, c.Slot.Width);
+// tmp.Height = Math.Max (tmp.Height, c.Slot.Height);
+// }
+//
+// tmp.Width *= (ColumnCount - 1) * Spacing / ColumnCount;;
+// tmp.Height *= (RowCount - 1) * Spacing / RowCount;
+// tmp.Width += 2 * Margin;
+// tmp.Height += 2 * Margin;
+//
+// return tmp;
+// }
+ public virtual void ComputeChildrenPositions()
+ {
+ int slotWidth = CaseWidth;
+ int slotHeight = CaseHeight;
+ for (int curY = 0; curY < RowCount; curY++) {
+ for (int curX = 0; curX < ColumnCount; curX++) {
+ int idx = curY * ColumnCount + curX;
+ if (idx >= Children.Count)
+ return;
+ GraphicObject c = Children [idx];
+ if (!c.Visible)
+ continue;
+ //ensure Item are not realigned
+ c.HorizontalAlignment = HorizontalAlignment.Left;
+ c.VerticalAlignment = VerticalAlignment.Top;
+ c.Left = curX * (slotWidth + Spacing);
+ c.Top = curY * (slotHeight + Spacing);
+ c.Width = slotWidth;
+ c.Height = slotHeight;
+ }
+ }
+ }
+
+ public override void RegisterForLayouting (int layoutType)
+ {
+ base.RegisterForLayouting (layoutType);
+
+ if ((layoutType & (int)LayoutingType.PositionChildren) > 0)
+ Interface.LayoutingQueue.Enqueue (LayoutingType.PositionChildren, this);
+ }
+ public override void UpdateLayout (LayoutingType layoutType)
+ {
+ if (layoutType == LayoutingType.PositionChildren) {
+ ComputeChildrenPositions ();
+ //if no layouting remains in queue for item, registre for redraw
+ if (Interface.LayoutingQueue.Where (lq => lq.GraphicObject == this).Count () <= 0 && bmp==null)
+ this.RegisterForRedraw ();
+ }else
+ base.UpdateLayout(layoutType);
+ }
+ #endregion
+
+
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Drawing;\r
-using System.Diagnostics;\r
-using Cairo;\r
-using System.Xml.Serialization;\r
-using System.ComponentModel;\r
-\r
-namespace Crow\r
-{\r
- public class Group : GraphicObject, IXmlSerializable\r
- {\r
- #region CTOR\r
- public Group()\r
- : base()\r
- { \r
- }\r
- #endregion\r
-\r
- #region EVENT HANDLERS\r
- public event EventHandler<EventArgs> ChildrenCleared;\r
- #endregion\r
-\r
- internal int maxChildrenWidth = 0;\r
- internal int maxChildrenHeight = 0;\r
-\r
- bool _multiSelect = false;\r
- List<GraphicObject> children = new List<GraphicObject>();\r
-\r
- public GraphicObject activeWidget;\r
-\r
- public virtual List<GraphicObject> Children {\r
- get { return children; }\r
- set { children = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(false)]\r
- public bool MultiSelect\r
- {\r
- get { return _multiSelect; }\r
- set { _multiSelect = value; }\r
- }\r
- \r
- \r
- public virtual T addChild<T>(T child)\r
- {\r
- GraphicObject g = child as GraphicObject;\r
- Children.Add(g);\r
- g.Parent = this as GraphicObject; \r
- g.RegisterForLayouting ((int)LayoutingType.Sizing);\r
- return (T)child;\r
- }\r
- public virtual void removeChild(GraphicObject child) \r
- { \r
- child.ClearBinding ();\r
- child.Parent = null;\r
- Children.Remove(child);\r
- this.RegisterForLayouting ((int)LayoutingType.Sizing);\r
- }\r
- public virtual void ClearChildren()\r
- {\r
- int lim = children.Count;\r
- for (int i = 0; i < lim; i++) {\r
- GraphicObject g = Children [0];\r
- g.ClearBinding ();\r
- g.Parent = null;\r
- Children.Remove(g); \r
- }\r
- this.RegisterForLayouting ((int)LayoutingType.Sizing);\r
- ChildrenCleared.Raise (this, new EventArgs ());\r
- }\r
- public void putWidgetOnTop(GraphicObject w)\r
- {\r
- if (Children.Contains(w))\r
- {\r
- Children.Remove(w);\r
- Children.Add(w);\r
- }\r
- }\r
- public void putWidgetOnBottom(GraphicObject w)\r
- {\r
- if (Children.Contains(w))\r
- {\r
- Children.Remove(w);\r
- Children.Insert(0, w);\r
- }\r
- }\r
- \r
- #region GraphicObject overrides\r
- [XmlIgnore]public override bool DrawingIsValid {\r
- get {\r
- if (!base.DrawingIsValid)\r
- return false;\r
- foreach (GraphicObject g in Children) {\r
- if (!g.DrawingIsValid)\r
- return false;\r
- }\r
- return true;\r
- }\r
- }\r
- public override void ResolveBindings ()\r
- {\r
- base.ResolveBindings ();\r
- foreach (GraphicObject w in Children)\r
- w.ResolveBindings ();\r
- }\r
- public override GraphicObject FindByName (string nameToFind)\r
- {\r
- if (Name == nameToFind)\r
- return this;\r
-\r
- foreach (GraphicObject w in Children) {\r
- GraphicObject r = w.FindByName (nameToFind);\r
- if (r != null)\r
- return r;\r
- }\r
- return null;\r
- }\r
- public override bool Contains (GraphicObject goToFind)\r
- {\r
- foreach (GraphicObject w in Children) {\r
- if (w == goToFind)\r
- return true;\r
- if (w.Contains (goToFind))\r
- return true;\r
- }\r
- return false;\r
- }\r
- protected override Size measureRawSize ()\r
- {\r
-// Size tmp = new Size ();\r
-//\r
-// foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {\r
-// tmp.Width = Math.Max (tmp.Width, c.Slot.Right);\r
-// tmp.Height = Math.Max (tmp.Height, c.Slot.Bottom);\r
-// }\r
-//\r
-// tmp.Width += 2*Margin;\r
-// tmp.Height += 2*Margin;\r
-//\r
-// return tmp;\r
- return new Size(maxChildrenWidth + 2 * Margin, maxChildrenHeight + 2 * Margin);\r
- }\r
- \r
- public override void OnLayoutChanges (LayoutingType layoutType)\r
- {\r
- base.OnLayoutChanges (layoutType);\r
-\r
- GenericStack gs = this as GenericStack;\r
- //position smaller objects in group when group size is fit\r
- switch (layoutType) {\r
- case LayoutingType.Width:\r
- if (gs != null) {\r
- if (gs.Orientation == Orientation.Horizontal) {\r
- this.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
- break;\r
- }\r
- } \r
- foreach (GraphicObject c in Children.Where(ch => ch.Visible)) {\r
- if (c.getBounds ().Width == 0)\r
- c.RegisterForLayouting ((int)LayoutingType.Width);\r
- else\r
- c.RegisterForLayouting ((int)LayoutingType.X); \r
- }\r
- break;\r
- case LayoutingType.Height:\r
- if (gs != null) {\r
- if (gs.Orientation == Orientation.Vertical) {\r
- this.RegisterForLayouting ((int)LayoutingType.PositionChildren);\r
- break;\r
- }\r
- }\r
- foreach (GraphicObject c in Children.Where(ch => ch.Visible)) {\r
- if (c.getBounds ().Height == 0)\r
- c.RegisterForLayouting ((int)LayoutingType.Height);\r
- else\r
- c.RegisterForLayouting ((int)LayoutingType.Y);\r
- }\r
- break;\r
- }\r
- }\r
-\r
- public override Rectangle ContextCoordinates(Rectangle r){\r
- return r + ClientRectangle.Position;\r
- } \r
-\r
- protected override void onDraw (Context gr)\r
- {\r
- Rectangle rBack = new Rectangle (Slot.Size);\r
- gr.SetSourceColor(Background);\r
- CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);\r
- gr.Fill ();\r
-\r
- foreach (GraphicObject g in Children) {\r
- g.Paint (ref gr);\r
- }\r
- }\r
-\r
- public override void Paint(ref Context ctx, Rectangles clip = null)\r
- {\r
- if ( !Visible )\r
- return;\r
-\r
- if (bmp == null)\r
- UpdateGraphic ();\r
- else {\r
- if (clip != null)\r
- clip.Rebase (this); \r
- else {\r
- clip = new Rectangles ();\r
- //TODO:added lately slot to empty clip,\r
- //should rework this precise case causing expandable not\r
- //to show image changes\r
- clip.AddRectangle (ContextCoordinates (Slot.Size));\r
- }\r
-\r
- if (!DrawingIsValid || clip != null) {//false when 1 child has changed\r
- //child having their content changed has to be repainted\r
- //and those with slot intersecting clip rectangle have also to be repainted\r
-\r
- using (ImageSurface cache =\r
- new ImageSurface (bmp, Format.Argb32, Slot.Width, Slot.Height, Slot.Width * 4)) {\r
- Context gr = new Context (cache);\r
- clip.clearAndClip (gr);\r
-\r
- Rectangle rBack = Slot.Size;\r
- gr.SetSourceColor(Background);\r
- CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);\r
- gr.Fill ();\r
- #if DEBUG_CLIP_RECTANGLE\r
- clip.stroke (gr, Color.Amaranth.AdjustAlpha (0.8));\r
- #endif\r
- foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {\r
- Rectangles childClip = clip.intersectingRects (ContextCoordinates(c.Slot));\r
- if (!c.DrawingIsValid || childClip.count > 0)\r
- c.Paint (ref gr, childClip);//, localClip);\r
- }\r
-\r
- gr.Dispose ();\r
- }\r
- }\r
- }\r
- \r
- base.Paint (ref ctx, clip);\r
- }\r
- #endregion\r
-\r
- \r
- #region Mouse handling\r
- public override void checkHoverWidget (OpenTK.Input.MouseMoveEventArgs e)\r
- {\r
- if (HostContainer.hoverWidget != this) {\r
- HostContainer.hoverWidget = this;\r
- onMouseEnter (this, e);\r
- }\r
- foreach (GraphicObject g in Children)\r
- {\r
- if (g.MouseIsIn(e.Position))\r
- {\r
- g.checkHoverWidget (e);\r
- return;\r
- }\r
- }\r
- base.checkHoverWidget (e);\r
- }\r
- #endregion\r
-\r
- #region IXmlSerializable\r
-\r
- public override System.Xml.Schema.XmlSchema GetSchema()\r
- {\r
- return null;\r
- }\r
- public override void ReadXml(System.Xml.XmlReader reader)\r
- {\r
- base.ReadXml(reader);\r
-\r
- using (System.Xml.XmlReader subTree = reader.ReadSubtree())\r
- {\r
- subTree.Read();\r
-\r
- while (!subTree.EOF)\r
- {\r
- subTree.Read();\r
-\r
- if (!subTree.IsStartElement())\r
- break;\r
-\r
- Type t = Type.GetType("Crow." + subTree.Name);\r
- GraphicObject go = (GraphicObject)Activator.CreateInstance(t);\r
- (go as IXmlSerializable).ReadXml(subTree); \r
- addChild(go);\r
- }\r
- }\r
- }\r
- public override void WriteXml(System.Xml.XmlWriter writer)\r
- {\r
- base.WriteXml(writer);\r
-\r
- foreach (GraphicObject go in Children)\r
- {\r
- writer.WriteStartElement(go.GetType().Name);\r
- (go as IXmlSerializable).WriteXml(writer);\r
- writer.WriteEndElement();\r
- }\r
- }\r
- \r
- #endregion\r
-\r
- public override void ClearBinding(){\r
- foreach (GraphicObject c in children)\r
- c.ClearBinding ();\r
- base.ClearBinding ();\r
- }\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Diagnostics;
+using Cairo;
+using System.Xml.Serialization;
+using System.ComponentModel;
+
+namespace Crow
+{
+ public class Group : GraphicObject, IXmlSerializable
+ {
+ #region CTOR
+ public Group()
+ : base()
+ {
+ }
+ #endregion
+
+ #region EVENT HANDLERS
+ public event EventHandler<EventArgs> ChildrenCleared;
+ #endregion
+
+ internal int maxChildrenWidth = 0;
+ internal int maxChildrenHeight = 0;
+
+ bool _multiSelect = false;
+ List<GraphicObject> children = new List<GraphicObject>();
+
+ public GraphicObject activeWidget;
+
+ public virtual List<GraphicObject> Children {
+ get { return children; }
+ set { children = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public bool MultiSelect
+ {
+ get { return _multiSelect; }
+ set { _multiSelect = value; }
+ }
+
+
+ public virtual T addChild<T>(T child)
+ {
+ GraphicObject g = child as GraphicObject;
+ Children.Add(g);
+ g.Parent = this as GraphicObject;
+ g.RegisterForLayouting ((int)LayoutingType.Sizing);
+ return (T)child;
+ }
+ public virtual void removeChild(GraphicObject child)
+ {
+ child.ClearBinding ();
+ child.Parent = null;
+ Children.Remove(child);
+ this.RegisterForLayouting ((int)LayoutingType.Sizing);
+ }
+ public virtual void ClearChildren()
+ {
+ int lim = children.Count;
+ for (int i = 0; i < lim; i++) {
+ GraphicObject g = Children [0];
+ g.ClearBinding ();
+ g.Parent = null;
+ Children.Remove(g);
+ }
+ this.RegisterForLayouting ((int)LayoutingType.Sizing);
+ ChildrenCleared.Raise (this, new EventArgs ());
+ }
+ public void putWidgetOnTop(GraphicObject w)
+ {
+ if (Children.Contains(w))
+ {
+ Children.Remove(w);
+ Children.Add(w);
+ }
+ }
+ public void putWidgetOnBottom(GraphicObject w)
+ {
+ if (Children.Contains(w))
+ {
+ Children.Remove(w);
+ Children.Insert(0, w);
+ }
+ }
+
+ #region GraphicObject overrides
+ [XmlIgnore]public override bool DrawingIsValid {
+ get {
+ if (!base.DrawingIsValid)
+ return false;
+ foreach (GraphicObject g in Children) {
+ if (!g.DrawingIsValid)
+ return false;
+ }
+ return true;
+ }
+ }
+ public override void ResolveBindings ()
+ {
+ base.ResolveBindings ();
+ foreach (GraphicObject w in Children)
+ w.ResolveBindings ();
+ }
+ public override GraphicObject FindByName (string nameToFind)
+ {
+ if (Name == nameToFind)
+ return this;
+
+ foreach (GraphicObject w in Children) {
+ GraphicObject r = w.FindByName (nameToFind);
+ if (r != null)
+ return r;
+ }
+ return null;
+ }
+ public override bool Contains (GraphicObject goToFind)
+ {
+ foreach (GraphicObject w in Children) {
+ if (w == goToFind)
+ return true;
+ if (w.Contains (goToFind))
+ return true;
+ }
+ return false;
+ }
+ protected override Size measureRawSize ()
+ {
+// Size tmp = new Size ();
+//
+// foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
+// tmp.Width = Math.Max (tmp.Width, c.Slot.Right);
+// tmp.Height = Math.Max (tmp.Height, c.Slot.Bottom);
+// }
+//
+// tmp.Width += 2*Margin;
+// tmp.Height += 2*Margin;
+//
+// return tmp;
+ return new Size(maxChildrenWidth + 2 * Margin, maxChildrenHeight + 2 * Margin);
+ }
+
+ public override void OnLayoutChanges (LayoutingType layoutType)
+ {
+ base.OnLayoutChanges (layoutType);
+
+ GenericStack gs = this as GenericStack;
+ //position smaller objects in group when group size is fit
+ switch (layoutType) {
+ case LayoutingType.Width:
+ if (gs != null) {
+ if (gs.Orientation == Orientation.Horizontal) {
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ break;
+ }
+ }
+ foreach (GraphicObject c in Children.Where(ch => ch.Visible)) {
+ if (c.getBounds ().Width == 0)
+ c.RegisterForLayouting ((int)LayoutingType.Width);
+ else
+ c.RegisterForLayouting ((int)LayoutingType.X);
+ }
+ break;
+ case LayoutingType.Height:
+ if (gs != null) {
+ if (gs.Orientation == Orientation.Vertical) {
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ break;
+ }
+ }
+ foreach (GraphicObject c in Children.Where(ch => ch.Visible)) {
+ if (c.getBounds ().Height == 0)
+ c.RegisterForLayouting ((int)LayoutingType.Height);
+ else
+ c.RegisterForLayouting ((int)LayoutingType.Y);
+ }
+ break;
+ }
+ }
+
+ public override Rectangle ContextCoordinates(Rectangle r){
+ return r + ClientRectangle.Position;
+ }
+
+ protected override void onDraw (Context gr)
+ {
+ Rectangle rBack = new Rectangle (Slot.Size);
+ gr.SetSourceColor(Background);
+ CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);
+ gr.Fill ();
+
+ foreach (GraphicObject g in Children) {
+ g.Paint (ref gr);
+ }
+ }
+
+ public override void Paint(ref Context ctx, Rectangles clip = null)
+ {
+ if ( !Visible )
+ return;
+
+ if (bmp == null)
+ UpdateGraphic ();
+ else {
+ if (clip != null)
+ clip.Rebase (this);
+ else {
+ clip = new Rectangles ();
+ //TODO:added lately slot to empty clip,
+ //should rework this precise case causing expandable not
+ //to show image changes
+ clip.AddRectangle (ContextCoordinates (Slot.Size));
+ }
+
+ if (!DrawingIsValid || clip != null) {//false when 1 child has changed
+ //child having their content changed has to be repainted
+ //and those with slot intersecting clip rectangle have also to be repainted
+
+ using (ImageSurface cache =
+ new ImageSurface (bmp, Format.Argb32, Slot.Width, Slot.Height, Slot.Width * 4)) {
+ Context gr = new Context (cache);
+ clip.clearAndClip (gr);
+
+ Rectangle rBack = Slot.Size;
+ gr.SetSourceColor(Background);
+ CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);
+ gr.Fill ();
+ #if DEBUG_CLIP_RECTANGLE
+ clip.stroke (gr, Color.Amaranth.AdjustAlpha (0.8));
+ #endif
+ foreach (GraphicObject c in Children.Where(ch=>ch.Visible)) {
+ Rectangles childClip = clip.intersectingRects (ContextCoordinates(c.Slot));
+ if (!c.DrawingIsValid || childClip.count > 0)
+ c.Paint (ref gr, childClip);//, localClip);
+ }
+
+ gr.Dispose ();
+ }
+ }
+ }
+
+ base.Paint (ref ctx, clip);
+ }
+ #endregion
+
+
+ #region Mouse handling
+ public override void checkHoverWidget (OpenTK.Input.MouseMoveEventArgs e)
+ {
+ if (HostContainer.hoverWidget != this) {
+ HostContainer.hoverWidget = this;
+ onMouseEnter (this, e);
+ }
+ foreach (GraphicObject g in Children)
+ {
+ if (g.MouseIsIn(e.Position))
+ {
+ g.checkHoverWidget (e);
+ return;
+ }
+ }
+ base.checkHoverWidget (e);
+ }
+ #endregion
+
+ #region IXmlSerializable
+
+ public override System.Xml.Schema.XmlSchema GetSchema()
+ {
+ return null;
+ }
+ public override void ReadXml(System.Xml.XmlReader reader)
+ {
+ base.ReadXml(reader);
+
+ using (System.Xml.XmlReader subTree = reader.ReadSubtree())
+ {
+ subTree.Read();
+
+ while (!subTree.EOF)
+ {
+ subTree.Read();
+
+ if (!subTree.IsStartElement())
+ break;
+
+ Type t = Type.GetType("Crow." + subTree.Name);
+ GraphicObject go = (GraphicObject)Activator.CreateInstance(t);
+ (go as IXmlSerializable).ReadXml(subTree);
+ addChild(go);
+ }
+ }
+ }
+ public override void WriteXml(System.Xml.XmlWriter writer)
+ {
+ base.WriteXml(writer);
+
+ foreach (GraphicObject go in Children)
+ {
+ writer.WriteStartElement(go.GetType().Name);
+ (go as IXmlSerializable).WriteXml(writer);
+ writer.WriteEndElement();
+ }
+ }
+
+ #endregion
+
+ public override void ClearBinding(){
+ foreach (GraphicObject c in children)
+ c.ClearBinding ();
+ base.ClearBinding ();
+ }
+ }
+}
-using System;\r
-\r
-\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-//using OpenTK.Graphics.OpenGL;\r
-\r
-using Cairo;\r
-\r
-using winColors = System.Drawing.Color;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-using System.Xml;\r
-using System.IO;\r
-\r
-namespace Crow\r
-{\r
- [DefaultTemplate("#Crow.Templates.GroupBox.goml")]\r
- public class GroupBox : TemplatedContainer\r
- { \r
- string caption;\r
- Container _contentContainer;\r
-\r
- #region CTOR\r
- public GroupBox() : base(){} \r
- #endregion\r
-\r
- #region Template overrides\r
- public override GraphicObject Content {\r
- get {\r
- return _contentContainer == null ? null : _contentContainer.Child;\r
- }\r
- set {\r
- _contentContainer.SetChild(value);\r
- }\r
- }\r
- protected override void loadTemplate(GraphicObject template = null)\r
- {\r
- base.loadTemplate (template);\r
-\r
- _contentContainer = this.child.FindByName ("Content") as Container;\r
- }\r
- #endregion\r
-\r
- #region GraphicObject overrides\r
- [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
- public override bool Focusable\r
- {\r
- get { return base.Focusable; }\r
- set { base.Focusable = value; }\r
- }\r
- #endregion\r
-\r
- [XmlAttributeAttribute()][DefaultValue("Groupbox")]\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
- } \r
- }\r
-}\r
+using System;
+
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+//using OpenTK.Graphics.OpenGL;
+
+using Cairo;
+
+using winColors = System.Drawing.Color;
+using System.Diagnostics;
+using System.Xml.Serialization;
+using OpenTK.Input;
+using System.ComponentModel;
+using System.Xml;
+using System.IO;
+
+namespace Crow
+{
+ [DefaultTemplate("#Crow.Templates.GroupBox.goml")]
+ public class GroupBox : TemplatedContainer
+ {
+ string caption;
+ Container _contentContainer;
+
+ #region CTOR
+ public GroupBox() : base(){}
+ #endregion
+
+ #region Template overrides
+ public override GraphicObject Content {
+ get {
+ return _contentContainer == null ? null : _contentContainer.Child;
+ }
+ set {
+ _contentContainer.SetChild(value);
+ }
+ }
+ protected override void loadTemplate(GraphicObject template = null)
+ {
+ base.loadTemplate (template);
+
+ _contentContainer = this.child.FindByName ("Content") as Container;
+ }
+ #endregion
+
+ #region GraphicObject overrides
+ [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true
+ public override bool Focusable
+ {
+ get { return base.Focusable; }
+ set { base.Focusable = value; }
+ }
+ #endregion
+
+ [XmlAttributeAttribute()][DefaultValue("Groupbox")]
+ public string Caption {
+ get { return caption; }
+ set {
+ if (caption == value)
+ return;
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
+ }
+ }
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Xml.Serialization;\r
-\r
-namespace Crow\r
-{\r
- public class HorizontalStack : GenericStack\r
- {\r
- public HorizontalStack()\r
- : base()\r
- {\r
- Orientation = Crow.Orientation.Horizontal;\r
- }\r
-\r
- [XmlIgnore]\r
- public override Orientation Orientation\r
- {\r
- get { return Orientation.Horizontal; }\r
- }\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+
+namespace Crow
+{
+ public class HorizontalStack : GenericStack
+ {
+ public HorizontalStack()
+ : base()
+ {
+ Orientation = Crow.Orientation.Horizontal;
+ }
+
+ [XmlIgnore]
+ public override Orientation Orientation
+ {
+ get { return Orientation.Horizontal; }
+ }
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using Cairo;\r
-using System.IO;\r
-using System.Runtime.InteropServices;\r
-using System.Xml.Serialization;\r
-using System.ComponentModel;\r
-using System.Diagnostics;\r
-\r
-namespace Crow\r
-{\r
- public class Image : GraphicObject\r
- {\r
- Picture _pic;\r
- string _svgSub;\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
- set { \r
- try {\r
- if (string.IsNullOrEmpty(value)){\r
- _pic = null;\r
- return;\r
- }\r
- LoadImage (value);\r
- _pic.Scaled = scaled;\r
- _pic.KeepProportions = keepProps;\r
- } catch (Exception ex) {\r
- Debug.WriteLine (ex.Message);\r
- _pic = null;\r
- }\r
- }\r
- }\r
-\r
- [XmlAttributeAttribute()][DefaultValue(null)]\r
- public string SvgSub {\r
- get { return _svgSub; }\r
- set {\r
- _svgSub = value;\r
- registerForGraphicUpdate ();\r
- }\r
- }\r
- \r
- #region CTOR\r
- public Image () : base()\r
- {\r
- }\r
- #endregion\r
-\r
- #region Image Loading\r
- public void LoadImage (string path)\r
- {\r
-\r
- if (path.EndsWith (".svg", true, System.Globalization.CultureInfo.InvariantCulture)) \r
- _pic = new SvgPicture ();\r
- else \r
- _pic = new BmpPicture ();\r
-\r
- _pic.LoadImage (path);\r
- registerForGraphicUpdate ();\r
- }\r
- #endregion\r
-\r
- #region GraphicObject overrides\r
- protected override Size measureRawSize ()\r
- {\r
-// if (_pic == null)\r
-// _pic = "#Crow.Images.Icons.IconAlerte.svg";\r
-\r
- return _pic.Dimensions + Margin * 2;\r
- }\r
- protected override void onDraw (Context gr)\r
- {\r
- base.onDraw (gr);\r
-\r
- if (_pic == null)\r
- return;\r
-\r
- _pic.Paint (gr, ClientRectangle, _svgSub);\r
- }\r
- #endregion\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Cairo;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Xml.Serialization;
+using System.ComponentModel;
+using System.Diagnostics;
+
+namespace Crow
+{
+ public class Image : GraphicObject
+ {
+ Picture _pic;
+ string _svgSub;
+ bool scaled;
+ [XmlAttributeAttribute()][DefaultValue(true)]
+ public virtual bool Scaled {
+ get { return scaled; }
+ set {
+ if (scaled == value)
+ return;
+ scaled = value;
+ NotifyValueChanged ("Scaled", scaled);
+ if (_pic == null)
+ return;
+ _pic.Scaled = scaled;
+ registerForGraphicUpdate ();
+ }
+ }
+ bool keepProps;
+ [XmlAttributeAttribute()][DefaultValue(true)]
+ public virtual bool KeepProportions {
+ get { return keepProps; }
+ set {
+ if (keepProps == value)
+ return;
+ keepProps = value;
+ NotifyValueChanged ("KeepProportions", keepProps);
+ if (_pic == null)
+ return;
+ _pic.KeepProportions = keepProps;
+ registerForGraphicUpdate ();
+ }
+ }
+ [XmlAttributeAttribute("Path")]
+ public string Path {
+ get { return _pic == null ? null : _pic.Path; }
+ set {
+ try {
+ if (string.IsNullOrEmpty(value)){
+ _pic = null;
+ return;
+ }
+ LoadImage (value);
+ _pic.Scaled = scaled;
+ _pic.KeepProportions = keepProps;
+ } catch (Exception ex) {
+ Debug.WriteLine (ex.Message);
+ _pic = null;
+ }
+ }
+ }
+
+ [XmlAttributeAttribute()][DefaultValue(null)]
+ public string SvgSub {
+ get { return _svgSub; }
+ set {
+ _svgSub = value;
+ registerForGraphicUpdate ();
+ }
+ }
+
+ #region CTOR
+ public Image () : base()
+ {
+ }
+ #endregion
+
+ #region Image Loading
+ public void LoadImage (string path)
+ {
+
+ if (path.EndsWith (".svg", true, System.Globalization.CultureInfo.InvariantCulture))
+ _pic = new SvgPicture ();
+ else
+ _pic = new BmpPicture ();
+
+ _pic.LoadImage (path);
+ registerForGraphicUpdate ();
+ }
+ #endregion
+
+ #region GraphicObject overrides
+ protected override Size measureRawSize ()
+ {
+// if (_pic == null)
+// _pic = "#Crow.Images.Icons.IconAlerte.svg";
+
+ return _pic.Dimensions + Margin * 2;
+ }
+ protected override void onDraw (Context gr)
+ {
+ base.onDraw (gr);
+
+ if (_pic == null)
+ return;
+
+ _pic.Paint (gr, ClientRectangle, _svgSub);
+ }
+ #endregion
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Diagnostics;\r
-using Cairo;\r
-using System.Text.RegularExpressions;\r
-using System.Xml.Serialization;\r
-using System.ComponentModel;\r
-using OpenTK.Input;\r
-\r
-namespace Crow\r
-{\r
- [Serializable]\r
- public class Label : GraphicObject\r
- {\r
- #region CTOR\r
- public Label()\r
- { \r
-\r
- }\r
- public Label(string _text)\r
- : base()\r
- {\r
- Text = _text;\r
- }\r
- #endregion\r
-\r
- //TODO:change protected to private\r
- \r
- #region private and protected fields\r
- string _text = "label";\r
- Alignment _textAlignment = Alignment.LeftCenter; \r
- bool _multiline = false;\r
- Color selColor;\r
- Color selFontColor;\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
- bool SelectionInProgress = false;\r
-\r
- protected Rectangle rText;\r
- protected float widthRatio = 1f;\r
- protected float heightRatio = 1f;\r
- protected FontExtents fe;\r
- protected TextExtents te;\r
- #endregion\r
-\r
- [XmlAttributeAttribute()][DefaultValue("SteelBlue")]\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("White")]\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(Alignment.LeftCenter)]\r
- public Alignment TextAlignment\r
- {\r
- get { return _textAlignment; }\r
- set { \r
- if (value == _textAlignment)\r
- return;\r
- _textAlignment = value; \r
- registerForGraphicUpdate ();\r
- NotifyValueChanged ("TextAlignment", _textAlignment);\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue("label")]\r
- public string Text\r
- {\r
- get { \r
- return lines == null ? \r
- _text : lines.Aggregate((i, j) => i + Interface.LineBreak + j);\r
- }\r
- set\r
- {\r
- if (_text == value)\r
- return;\r
- \r
- _text = value;\r
-\r
- if (string.IsNullOrEmpty(_text))\r
- _text = "";\r
-\r
- lines = getLines;\r
-\r
- this.registerForGraphicUpdate ();\r
- this.RegisterForLayouting ((int)LayoutingType.Sizing);\r
- NotifyValueChanged ("Text", Text);\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(false)]\r
- public bool Multiline\r
- {\r
- get { return _multiline; }\r
- set\r
- {\r
- if (value == _multiline)\r
- return;\r
- _multiline = value;\r
- NotifyValueChanged ("Multiline", _multiline);\r
- registerForGraphicUpdate();\r
- }\r
- }\r
- [XmlIgnore]public int CurrentColumn{\r
- get { return _currentCol; }\r
- set { \r
- if (value == _currentCol)\r
- return;\r
- if (value < 0)\r
- _currentCol = 0;\r
- else if (value > lines [_currentLine].Count ())\r
- _currentCol = lines [_currentLine].Count ();\r
- else\r
- _currentCol = value;\r
- NotifyValueChanged ("CurrentColumn", _currentCol);\r
- }\r
- }\r
- [XmlIgnore]public int CurrentLine{\r
- get { return _currentLine; }\r
- set { \r
- if (value == _currentLine)\r
- return;\r
- if (value > lines.Count)\r
- _currentLine = lines.Count; \r
- else if (value < 0)\r
- _currentLine = 0;\r
- else\r
- _currentLine = value; \r
- NotifyValueChanged ("CurrentLine", _currentLine);\r
- }\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
- }\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
- } \r
- }\r
- [XmlIgnore]public string SelectedText\r
- { \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
-\r
- List<string> lines;\r
- List<string> getLines {\r
- get { \r
- return _multiline ?\r
- Regex.Split (_text, "\r\n|\r|\n|" + @"\\n").ToList() :\r
- new List<string>(new string[] { _text });\r
- }\r
- }\r
-\r
- public void DeleteChar()\r
- {\r
- if (selectionIsEmpty) { \r
- if (CurrentColumn == 0) {\r
- if (CurrentLine == 0)\r
- return;\r
- CurrentLine--;\r
- CurrentColumn = lines [CurrentLine].Count ();\r
- lines [CurrentLine] += lines [CurrentLine + 1];\r
- lines.RemoveAt (CurrentLine + 1);\r
- return;\r
- }\r
- CurrentColumn--;\r
- lines [CurrentLine] = lines [CurrentLine].Remove (CurrentColumn, 1);\r
- } else {\r
- Debug.WriteLine (selectionEnd.ToString());\r
- int linesToRemove = selectionEnd.Y - selectionStart.Y;\r
- int l = selectionStart.Y;\r
-\r
- if (linesToRemove > 0) {\r
- lines [l] = lines [l].Remove (selectionStart.X, lines [l].Length - selectionStart.X) +\r
- lines [selectionEnd.Y].Substring (selectionEnd.X, lines [selectionEnd.Y].Length - selectionEnd.X);\r
- l++;\r
- for (int c = 0; c < linesToRemove-1; c++)\r
- lines.RemoveAt (l);\r
- CurrentColumn = selectionStart.X;\r
- CurrentLine = selectionStart.Y;\r
- } else \r
- lines [l] = lines [l].Remove (selectionStart.X, selectionEnd.X - selectionStart.X);\r
- CurrentColumn = selectionStart.X;\r
- SelBegin = -1;\r
- SelRelease = -1;\r
- }\r
- }\r
- /// <summary>\r
- /// Insert new string at caret position, should be sure no line break is inside.\r
- /// </summary>\r
- /// <param name="str">String.</param>\r
- protected void Insert(string str)\r
- {\r
- lines [CurrentLine] = lines [CurrentLine].Insert (CurrentColumn, str);\r
- CurrentColumn += str.Length;\r
- }\r
-\r
- #region GraphicObject overrides\r
- [XmlAttributeAttribute()][DefaultValue(-1)]\r
- public override int Width {\r
- get { return base.Width; }\r
- set { base.Width = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(-1)]\r
- public override int Height {\r
- get { return base.Height; }\r
- set { base.Height = value; }\r
- }\r
-\r
- protected override Size measureRawSize()\r
- {\r
- Size size;\r
-\r
- if (lines == null)\r
- lines = getLines;\r
- \r
- using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) {\r
- using (Context gr = new Context (img)) {\r
- //Cairo.FontFace cf = gr.GetContextFontFace ();\r
-\r
- gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);\r
- gr.SetFontSize (Font.Size);\r
-\r
- te = new TextExtents();\r
-\r
- foreach (string s in lines) {\r
- string l = s.Replace("\t", new String (' ', Interface.TabSize));\r
-\r
-#if _WIN32 || _WIN64\r
- TextExtents tmp = gr.TextExtents(str.ToUtf8());\r
-#elif __linux__\r
- TextExtents tmp = gr.TextExtents (l);\r
-#endif\r
- if (tmp.XAdvance > te.XAdvance)\r
- te = tmp;\r
- }\r
- fe = gr.FontExtents;\r
- int lc = lines.Count;\r
- //ensure minimal height = text line height\r
- if (lc == 0)\r
- lc = 1; \r
- size = new Size ((int)Math.Ceiling (te.XAdvance) + Margin * 2, (int)(fe.Height * lc) + Margin*2);\r
- }\r
- }\r
-\r
- return size;;\r
- }\r
- protected override void onDraw (Context gr)\r
- {\r
- base.onDraw (gr);\r
-\r
- gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);\r
- gr.SetFontSize (Font.Size);\r
-\r
- gr.Antialias = Antialias.Subpixel;\r
- //gr.FontOptions.Antialias = Antialias.Subpixel;\r
- //gr.FontOptions.HintMetrics = HintMetrics.On;\r
-\r
- rText = new Rectangle(measureRawSize());\r
- rText.Width -= 2 * Margin;\r
- rText.Height -= 2 * Margin;\r
-\r
- widthRatio = 1f;\r
- heightRatio = 1f;\r
-\r
- Rectangle cb = ClientRectangle;\r
-\r
- //ignore text alignment if size to content = true\r
- if (Bounds.Size < 0)\r
- {\r
- rText.X = cb.X;\r
- rText.Y = cb.Y;\r
- }else{\r
- switch (TextAlignment)\r
- {\r
- case Alignment.None:\r
- break;\r
- case Alignment.TopLeft: //ok\r
- rText.X = cb.X;\r
- rText.Y = cb.Y;\r
- break;\r
- case Alignment.TopCenter: //ok\r
- rText.Y = cb.Y;\r
- rText.X = cb.X + cb.Width / 2 - rText.Width / 2;\r
- break;\r
- case Alignment.TopRight: //ok\r
- rText.X = cb.Right - rText.Width;\r
- rText.Y = cb.Y;\r
- break;\r
- case Alignment.TopStretch://ok\r
- heightRatio = widthRatio = (float)cb.Width / rText.Width;\r
- rText.X = cb.X;\r
- rText.Y = cb.Y;\r
- rText.Width = cb.Width;\r
- rText.Height = (int)(rText.Height * heightRatio);\r
- break;\r
- case Alignment.LeftCenter://ok\r
- rText.X = cb.X;\r
- rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;\r
- break;\r
- case Alignment.LeftStretch://ok\r
- heightRatio = widthRatio = (float)cb.Height / rText.Height;\r
- rText.X = cb.X;\r
- rText.Y = cb.Y;\r
- rText.Height = cb.Height;\r
- rText.Width = (int)(widthRatio * cb.Width);\r
- break;\r
- case Alignment.RightCenter://ok\r
- rText.X = cb.X + cb.Width - rText.Width;\r
- rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;\r
- break;\r
- case Alignment.RightStretch://ok\r
- heightRatio = widthRatio = (float)cb.Height / rText.Height;\r
- rText.Height = cb.Height;\r
- rText.Width = (int)(widthRatio * rText.Width);\r
- rText.X = cb.Right - rText.Width;\r
- rText.Y = cb.Y;\r
- break;\r
- case Alignment.BottomCenter://ok\r
- rText.X = cb.Width / 2 - rText.Width / 2;\r
- rText.Y = cb.Height - rText.Height;\r
- break;\r
- case Alignment.BottomStretch://ok\r
- heightRatio = widthRatio = (float)cb.Width / rText.Width;\r
- rText.Width = cb.Width;\r
- rText.Height = (int)(rText.Height * heightRatio);\r
- rText.Y = cb.Bottom - rText.Height;\r
- rText.X = cb.X;\r
- break;\r
- case Alignment.BottomLeft://ok\r
- rText.X = cb.X;\r
- rText.Y = cb.Bottom - rText.Height;\r
- break;\r
- case Alignment.BottomRight://ok\r
- rText.Y = cb.Bottom - rText.Height;\r
- rText.X = cb.Right - rText.Width;\r
- break;\r
- case Alignment.Center://ok\r
- rText.X = cb.X + cb.Width / 2 - rText.Width / 2;\r
- rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;\r
- break;\r
- case Alignment.Fit://ok, peut être mieu aligné \r
- widthRatio = (float)cb.Width / rText.Width;\r
- heightRatio = (float)cb.Height / rText.Height;\r
- rText = cb;\r
- break;\r
- case Alignment.HorizontalStretch://ok\r
- heightRatio = widthRatio = (float)cb.Width / rText.Width;\r
- rText.Width = cb.Width;\r
- rText.Height = (int)(heightRatio * rText.Height);\r
- rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;\r
- rText.X = cb.X;\r
- break;\r
- case Alignment.VerticalStretch://ok\r
- heightRatio = widthRatio = (float)cb.Height / rText.Height;\r
- rText.Height = cb.Height;\r
- rText.Width = (int)(widthRatio * rText.Width);\r
- rText.X = cb.X + cb.Width / 2 - rText.Width / 2;\r
- rText.Y = cb.Y;\r
- break;\r
- default:\r
- break;\r
- }\r
- }\r
-\r
- gr.FontMatrix = new Matrix(widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0);\r
- fe = gr.FontExtents;\r
-\r
- #region draw text cursor\r
- if (mouseLocalPos >= 0)\r
- {\r
- computeTextCursor(gr);\r
-\r
- if (SelectionInProgress)\r
- {\r
- if (SelBegin < 0){\r
- SelBegin = new Point(CurrentColumn, CurrentLine);\r
- SelStartCursorPos = textCursorPos;\r
- SelRelease = -1;\r
- }else{\r
- SelRelease = new Point(CurrentColumn, CurrentLine);\r
- if (SelRelease == SelBegin)\r
- SelRelease = -1;\r
- else\r
- SelEndCursorPos = textCursorPos;\r
- } \r
- }\r
- }else\r
- computeTextCursorPosition(gr);\r
-\r
-\r
- #endregion\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
-\r
- if (HasFocus )\r
- {\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
-\r
- for (int i = 0; i < lines.Count; i++) { \r
- string l = lines [i].Replace ("\t", new String (' ', Interface.TabSize));\r
- int lineLength = (int)gr.TextExtents (l).XAdvance;\r
- 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
- cpStart = cpEnd;\r
- cpEnd = (int)SelStartCursorPos;\r
- }\r
-\r
- if (i == selectionStart.Y) {\r
- selRect.Width -= cpStart;\r
- selRect.Left += cpStart;\r
- }\r
- if (i == selectionEnd.Y) \r
- selRect.Width -= (lineLength - cpEnd); \r
-\r
- gr.Rectangle (selRect);\r
- gr.Fill ();\r
- } \r
-\r
- if (string.IsNullOrWhiteSpace (l))\r
- continue;\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
- #elif __linux__\r
- gr.ShowText (l);\r
- #endif\r
- gr.Fill ();\r
- }\r
- }\r
- #endregion\r
-\r
- #region Mouse handling\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
- base.onFocused (sender, e);\r
-\r
- SelBegin = new Point(0,0);\r
- SelRelease = new Point (lines.LastOrDefault ().Length, lines.Count-1);\r
- registerForGraphicUpdate ();\r
- }\r
- public override void onUnfocused (object sender, EventArgs e)\r
- {\r
- base.onUnfocused (sender, e);\r
-\r
- SelBegin = -1;\r
- SelRelease = -1;\r
- registerForGraphicUpdate ();\r
- }\r
- public override void onMouseMove (object sender, MouseMoveEventArgs e)\r
- {\r
- base.onMouseMove (sender, e);\r
-\r
- if (!(SelectionInProgress && HasFocus))\r
- return;\r
-\r
- updatemouseLocalPos (e.Position);\r
-\r
- registerForGraphicUpdate();\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.onMouseDown (sender, e);\r
-\r
- registerForGraphicUpdate();\r
- }\r
- public override void onMouseUp (object sender, MouseButtonEventArgs e)\r
- {\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
- /// <summary>\r
- /// Update Current Column, line and TextCursorPos\r
- /// from mouseLocalPos\r
- /// </summary>\r
- void computeTextCursor(Context gr)\r
- { \r
- TextExtents te;\r
-\r
- double cPos = 0f;\r
-\r
- CurrentLine = (int)(mouseLocalPos.Y / fe.Height);\r
-\r
- //fix cu\r
- if (CurrentLine >= lines.Count)\r
- CurrentLine = lines.Count - 1;\r
-\r
- for (int i = 0; i < lines[CurrentLine].Length; i++)\r
- {\r
- string c = lines [CurrentLine].Substring (i, 1);\r
- if (c == "\t")\r
- c = new string (' ', Interface.TabSize);\r
- \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
- double halfWidth = te.XAdvance / 2;\r
-\r
- if (mouseLocalPos.X <= cPos + halfWidth)\r
- {\r
- CurrentColumn = i;\r
- textCursorPos = cPos;\r
- mouseLocalPos = -1;\r
- return;\r
- }\r
-\r
- cPos += te.XAdvance;\r
- }\r
- CurrentColumn = lines[CurrentLine].Length;\r
- textCursorPos = cPos;\r
-\r
- //reset mouseLocalPos\r
- mouseLocalPos = -1;\r
- }\r
- /// <summary> Computes offsets in cairo units </summary>\r
- void computeTextCursorPosition(Context gr)\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(CurrentColumn, 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{\r
- return -1;\r
- }\r
- }\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics;
+using Cairo;
+using System.Text.RegularExpressions;
+using System.Xml.Serialization;
+using System.ComponentModel;
+using OpenTK.Input;
+
+namespace Crow
+{
+ [Serializable]
+ public class Label : GraphicObject
+ {
+ #region CTOR
+ public Label()
+ {
+
+ }
+ public Label(string _text)
+ : base()
+ {
+ Text = _text;
+ }
+ #endregion
+
+ //TODO:change protected to private
+
+ #region private and protected fields
+ string _text = "label";
+ Alignment _textAlignment = Alignment.LeftCenter;
+ bool _multiline = false;
+ Color selColor;
+ Color selFontColor;
+ Point mouseLocalPos = -1;//mouse coord in widget space, filled only when clicked
+ int _currentCol; //0 based cursor position in string
+ int _currentLine;
+ Point _selBegin = -1; //selection start (row,column)
+ Point _selRelease = -1; //selection end (row,column)
+ double textCursorPos; //cursor position in cairo units in widget client coord.
+ double SelStartCursorPos = -1;
+ double SelEndCursorPos = -1;
+ bool SelectionInProgress = false;
+
+ protected Rectangle rText;
+ protected float widthRatio = 1f;
+ protected float heightRatio = 1f;
+ protected FontExtents fe;
+ protected TextExtents te;
+ #endregion
+
+ [XmlAttributeAttribute()][DefaultValue("SteelBlue")]
+ public virtual Color SelectionBackground {
+ get { return selColor; }
+ set {
+ if (value == selColor)
+ return;
+ selColor = value;
+ NotifyValueChanged ("SelectionBackground", selColor);
+ registerForGraphicUpdate ();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue("White")]
+ public virtual Color SelectionForeground {
+ get { return selFontColor; }
+ set {
+ if (value == selFontColor)
+ return;
+ selFontColor = value;
+ NotifyValueChanged ("SelectionForeground", selFontColor);
+ registerForGraphicUpdate ();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(Alignment.LeftCenter)]
+ public Alignment TextAlignment
+ {
+ get { return _textAlignment; }
+ set {
+ if (value == _textAlignment)
+ return;
+ _textAlignment = value;
+ registerForGraphicUpdate ();
+ NotifyValueChanged ("TextAlignment", _textAlignment);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue("label")]
+ public string Text
+ {
+ get {
+ return lines == null ?
+ _text : lines.Aggregate((i, j) => i + Interface.LineBreak + j);
+ }
+ set
+ {
+ if (_text == value)
+ return;
+
+ _text = value;
+
+ if (string.IsNullOrEmpty(_text))
+ _text = "";
+
+ lines = getLines;
+
+ this.registerForGraphicUpdate ();
+ this.RegisterForLayouting ((int)LayoutingType.Sizing);
+ NotifyValueChanged ("Text", Text);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public bool Multiline
+ {
+ get { return _multiline; }
+ set
+ {
+ if (value == _multiline)
+ return;
+ _multiline = value;
+ NotifyValueChanged ("Multiline", _multiline);
+ registerForGraphicUpdate();
+ }
+ }
+ [XmlIgnore]public int CurrentColumn{
+ get { return _currentCol; }
+ set {
+ if (value == _currentCol)
+ return;
+ if (value < 0)
+ _currentCol = 0;
+ else if (value > lines [_currentLine].Count ())
+ _currentCol = lines [_currentLine].Count ();
+ else
+ _currentCol = value;
+ NotifyValueChanged ("CurrentColumn", _currentCol);
+ }
+ }
+ [XmlIgnore]public int CurrentLine{
+ get { return _currentLine; }
+ set {
+ if (value == _currentLine)
+ return;
+ if (value > lines.Count)
+ _currentLine = lines.Count;
+ else if (value < 0)
+ _currentLine = 0;
+ else
+ _currentLine = value;
+ NotifyValueChanged ("CurrentLine", _currentLine);
+ }
+ }
+ [XmlIgnore]public Point SelBegin {
+ get {
+ return _selBegin;
+ }
+ set {
+ if (value == _selBegin)
+ return;
+ _selBegin = value;
+ NotifyValueChanged ("SelectedText", SelectedText);
+ }
+ }
+ [XmlIgnore]public Point SelRelease {
+ get {
+ return _selRelease;
+ }
+ set {
+ if (value == _selRelease)
+ return;
+ _selRelease = value;
+ NotifyValueChanged ("SelectedText", SelectedText);
+ }
+ }
+
+ [XmlIgnore]protected Point selectionStart //ordered selection start and end positions
+ {
+ get {
+ return SelRelease < 0 || SelBegin.Y < SelRelease.Y ? SelBegin :
+ SelBegin.Y > SelRelease.Y ? SelRelease :
+ SelBegin.X < SelRelease.X ? SelBegin : SelRelease;
+ }
+ }
+ [XmlIgnore]public Point selectionEnd
+ {
+ get {
+ return SelRelease < 0 || SelBegin.Y > SelRelease.Y ? SelBegin :
+ SelBegin.Y < SelRelease.Y ? SelRelease :
+ SelBegin.X > SelRelease.X ? SelBegin : SelRelease;
+ }
+ }
+ [XmlIgnore]public string SelectedText
+ {
+ get {
+
+ if (SelRelease < 0 || SelBegin < 0)
+ return "";
+ if (selectionStart.Y == selectionEnd.Y)
+ return lines [selectionStart.Y].Substring (selectionStart.X, selectionEnd.X - selectionStart.X);
+ string tmp = "";
+ tmp = lines [selectionStart.Y].Substring (selectionStart.X);
+ for (int l = selectionStart.Y + 1; l < selectionEnd.Y; l++) {
+ tmp += Interface.LineBreak + lines [l];
+ }
+ tmp += Interface.LineBreak + lines [selectionEnd.Y].Substring (0, selectionEnd.X);
+ return tmp;
+ }
+ }
+ [XmlIgnore]public bool selectionIsEmpty
+ { get { return SelRelease < 0; } }
+
+ List<string> lines;
+ List<string> getLines {
+ get {
+ return _multiline ?
+ Regex.Split (_text, "\r\n|\r|\n|" + @"\\n").ToList() :
+ new List<string>(new string[] { _text });
+ }
+ }
+
+ public void DeleteChar()
+ {
+ if (selectionIsEmpty) {
+ if (CurrentColumn == 0) {
+ if (CurrentLine == 0)
+ return;
+ CurrentLine--;
+ CurrentColumn = lines [CurrentLine].Count ();
+ lines [CurrentLine] += lines [CurrentLine + 1];
+ lines.RemoveAt (CurrentLine + 1);
+ return;
+ }
+ CurrentColumn--;
+ lines [CurrentLine] = lines [CurrentLine].Remove (CurrentColumn, 1);
+ } else {
+ Debug.WriteLine (selectionEnd.ToString());
+ int linesToRemove = selectionEnd.Y - selectionStart.Y;
+ int l = selectionStart.Y;
+
+ if (linesToRemove > 0) {
+ lines [l] = lines [l].Remove (selectionStart.X, lines [l].Length - selectionStart.X) +
+ lines [selectionEnd.Y].Substring (selectionEnd.X, lines [selectionEnd.Y].Length - selectionEnd.X);
+ l++;
+ for (int c = 0; c < linesToRemove-1; c++)
+ lines.RemoveAt (l);
+ CurrentColumn = selectionStart.X;
+ CurrentLine = selectionStart.Y;
+ } else
+ lines [l] = lines [l].Remove (selectionStart.X, selectionEnd.X - selectionStart.X);
+ CurrentColumn = selectionStart.X;
+ SelBegin = -1;
+ SelRelease = -1;
+ }
+ }
+ /// <summary>
+ /// Insert new string at caret position, should be sure no line break is inside.
+ /// </summary>
+ /// <param name="str">String.</param>
+ protected void Insert(string str)
+ {
+ lines [CurrentLine] = lines [CurrentLine].Insert (CurrentColumn, str);
+ CurrentColumn += str.Length;
+ }
+
+ #region GraphicObject overrides
+ [XmlAttributeAttribute()][DefaultValue(-1)]
+ public override int Width {
+ get { return base.Width; }
+ set { base.Width = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue(-1)]
+ public override int Height {
+ get { return base.Height; }
+ set { base.Height = value; }
+ }
+
+ protected override Size measureRawSize()
+ {
+ Size size;
+
+ if (lines == null)
+ lines = getLines;
+
+ using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) {
+ using (Context gr = new Context (img)) {
+ //Cairo.FontFace cf = gr.GetContextFontFace ();
+
+ gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
+ gr.SetFontSize (Font.Size);
+
+ te = new TextExtents();
+
+ foreach (string s in lines) {
+ string l = s.Replace("\t", new String (' ', Interface.TabSize));
+
+#if _WIN32 || _WIN64
+ TextExtents tmp = gr.TextExtents(str.ToUtf8());
+#elif __linux__
+ TextExtents tmp = gr.TextExtents (l);
+#endif
+ if (tmp.XAdvance > te.XAdvance)
+ te = tmp;
+ }
+ fe = gr.FontExtents;
+ int lc = lines.Count;
+ //ensure minimal height = text line height
+ if (lc == 0)
+ lc = 1;
+ size = new Size ((int)Math.Ceiling (te.XAdvance) + Margin * 2, (int)(fe.Height * lc) + Margin*2);
+ }
+ }
+
+ return size;;
+ }
+ protected override void onDraw (Context gr)
+ {
+ base.onDraw (gr);
+
+ gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
+ gr.SetFontSize (Font.Size);
+
+ gr.Antialias = Antialias.Subpixel;
+ //gr.FontOptions.Antialias = Antialias.Subpixel;
+ //gr.FontOptions.HintMetrics = HintMetrics.On;
+
+ rText = new Rectangle(measureRawSize());
+ rText.Width -= 2 * Margin;
+ rText.Height -= 2 * Margin;
+
+ widthRatio = 1f;
+ heightRatio = 1f;
+
+ Rectangle cb = ClientRectangle;
+
+ //ignore text alignment if size to content = true
+ if (Bounds.Size < 0)
+ {
+ rText.X = cb.X;
+ rText.Y = cb.Y;
+ }else{
+ switch (TextAlignment)
+ {
+ case Alignment.None:
+ break;
+ case Alignment.TopLeft: //ok
+ rText.X = cb.X;
+ rText.Y = cb.Y;
+ break;
+ case Alignment.TopCenter: //ok
+ rText.Y = cb.Y;
+ rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
+ break;
+ case Alignment.TopRight: //ok
+ rText.X = cb.Right - rText.Width;
+ rText.Y = cb.Y;
+ break;
+ case Alignment.TopStretch://ok
+ heightRatio = widthRatio = (float)cb.Width / rText.Width;
+ rText.X = cb.X;
+ rText.Y = cb.Y;
+ rText.Width = cb.Width;
+ rText.Height = (int)(rText.Height * heightRatio);
+ break;
+ case Alignment.LeftCenter://ok
+ rText.X = cb.X;
+ rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
+ break;
+ case Alignment.LeftStretch://ok
+ heightRatio = widthRatio = (float)cb.Height / rText.Height;
+ rText.X = cb.X;
+ rText.Y = cb.Y;
+ rText.Height = cb.Height;
+ rText.Width = (int)(widthRatio * cb.Width);
+ break;
+ case Alignment.RightCenter://ok
+ rText.X = cb.X + cb.Width - rText.Width;
+ rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
+ break;
+ case Alignment.RightStretch://ok
+ heightRatio = widthRatio = (float)cb.Height / rText.Height;
+ rText.Height = cb.Height;
+ rText.Width = (int)(widthRatio * rText.Width);
+ rText.X = cb.Right - rText.Width;
+ rText.Y = cb.Y;
+ break;
+ case Alignment.BottomCenter://ok
+ rText.X = cb.Width / 2 - rText.Width / 2;
+ rText.Y = cb.Height - rText.Height;
+ break;
+ case Alignment.BottomStretch://ok
+ heightRatio = widthRatio = (float)cb.Width / rText.Width;
+ rText.Width = cb.Width;
+ rText.Height = (int)(rText.Height * heightRatio);
+ rText.Y = cb.Bottom - rText.Height;
+ rText.X = cb.X;
+ break;
+ case Alignment.BottomLeft://ok
+ rText.X = cb.X;
+ rText.Y = cb.Bottom - rText.Height;
+ break;
+ case Alignment.BottomRight://ok
+ rText.Y = cb.Bottom - rText.Height;
+ rText.X = cb.Right - rText.Width;
+ break;
+ case Alignment.Center://ok
+ rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
+ rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
+ break;
+ case Alignment.Fit://ok, peut être mieu aligné
+ widthRatio = (float)cb.Width / rText.Width;
+ heightRatio = (float)cb.Height / rText.Height;
+ rText = cb;
+ break;
+ case Alignment.HorizontalStretch://ok
+ heightRatio = widthRatio = (float)cb.Width / rText.Width;
+ rText.Width = cb.Width;
+ rText.Height = (int)(heightRatio * rText.Height);
+ rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
+ rText.X = cb.X;
+ break;
+ case Alignment.VerticalStretch://ok
+ heightRatio = widthRatio = (float)cb.Height / rText.Height;
+ rText.Height = cb.Height;
+ rText.Width = (int)(widthRatio * rText.Width);
+ rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
+ rText.Y = cb.Y;
+ break;
+ default:
+ break;
+ }
+ }
+
+ gr.FontMatrix = new Matrix(widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0);
+ fe = gr.FontExtents;
+
+ #region draw text cursor
+ if (mouseLocalPos >= 0)
+ {
+ computeTextCursor(gr);
+
+ if (SelectionInProgress)
+ {
+ if (SelBegin < 0){
+ SelBegin = new Point(CurrentColumn, CurrentLine);
+ SelStartCursorPos = textCursorPos;
+ SelRelease = -1;
+ }else{
+ SelRelease = new Point(CurrentColumn, CurrentLine);
+ if (SelRelease == SelBegin)
+ SelRelease = -1;
+ else
+ SelEndCursorPos = textCursorPos;
+ }
+ }
+ }else
+ computeTextCursorPosition(gr);
+
+
+ #endregion
+
+ //****** debug selection *************
+// if (SelRelease >= 0) {
+// gr.Color = Color.Green;
+// Rectangle R = new Rectangle (
+// rText.X + (int)SelEndCursorPos - 2,
+// rText.Y + (int)(SelRelease.Y * fe.Height),
+// 4,
+// (int)fe.Height);
+// gr.Rectangle (R);
+// gr.Fill ();
+// }
+// if (SelBegin >= 0) {
+// gr.Color = Color.UnmellowYellow;
+// Rectangle R = new Rectangle (
+// rText.X + (int)SelStartCursorPos - 2,
+// rText.Y + (int)(SelBegin.Y * fe.Height),
+// 4,
+// (int)fe.Height);
+// gr.Rectangle (R);
+// gr.Fill ();
+// }
+ //*******************
+
+ if (HasFocus )
+ {
+ gr.SetSourceColor(Foreground);
+ gr.LineWidth = 1.5;
+ gr.MoveTo(new PointD(textCursorPos + rText.X, rText.Y + CurrentLine * fe.Height));
+ gr.LineTo(new PointD(textCursorPos + rText.X, rText.Y + (CurrentLine + 1) * fe.Height));
+ gr.Stroke();
+ }
+
+ for (int i = 0; i < lines.Count; i++) {
+ string l = lines [i].Replace ("\t", new String (' ', Interface.TabSize));
+ int lineLength = (int)gr.TextExtents (l).XAdvance;
+ Rectangle lineRect = new Rectangle (
+ rText.X,
+ rText.Y + (int)(i * fe.Height),
+ lineLength,
+ (int)fe.Height);
+
+// if (TextAlignment == Alignment.Center ||
+// TextAlignment == Alignment.TopCenter ||
+// TextAlignment == Alignment.BottomCenter)
+// lineRect.X += (rText.Width - lineLength) / 2;
+// else if (TextAlignment == Alignment.RightCenter ||
+// TextAlignment == Alignment.TopRight ||
+// TextAlignment == Alignment.BottomRight)
+// lineRect.X += (rText.Width - lineLength);
+
+ if (SelRelease >= 0 && i >= selectionStart.Y && i <= selectionEnd.Y) {
+ gr.SetSourceColor(selColor);
+
+ Rectangle selRect = lineRect ;
+
+ int cpStart = (int)SelStartCursorPos,
+ cpEnd = (int)SelEndCursorPos;
+
+ if (SelBegin.Y > SelRelease.Y) {
+ cpStart = cpEnd;
+ cpEnd = (int)SelStartCursorPos;
+ }
+
+ if (i == selectionStart.Y) {
+ selRect.Width -= cpStart;
+ selRect.Left += cpStart;
+ }
+ if (i == selectionEnd.Y)
+ selRect.Width -= (lineLength - cpEnd);
+
+ gr.Rectangle (selRect);
+ gr.Fill ();
+ }
+
+ if (string.IsNullOrWhiteSpace (l))
+ continue;
+
+ gr.SetSourceColor(Foreground);
+ gr.MoveTo (lineRect.X, rText.Y + fe.Ascent + fe.Height * i);
+
+ #if _WIN32 || _WIN64
+ gr.ShowText(l.ToUtf8());
+ #elif __linux__
+ gr.ShowText (l);
+ #endif
+ gr.Fill ();
+ }
+ }
+ #endregion
+
+ #region Mouse handling
+ void updatemouseLocalPos(Point mpos){
+ mouseLocalPos = mpos - ScreenCoordinates(Slot).TopLeft - ClientRectangle.TopLeft;
+ if (mouseLocalPos.X < 0)
+ mouseLocalPos.X = 0;
+ if (mouseLocalPos.Y < 0)
+ mouseLocalPos.Y = 0;
+ }
+ public override void onFocused (object sender, EventArgs e)
+ {
+ base.onFocused (sender, e);
+
+ SelBegin = new Point(0,0);
+ SelRelease = new Point (lines.LastOrDefault ().Length, lines.Count-1);
+ registerForGraphicUpdate ();
+ }
+ public override void onUnfocused (object sender, EventArgs e)
+ {
+ base.onUnfocused (sender, e);
+
+ SelBegin = -1;
+ SelRelease = -1;
+ registerForGraphicUpdate ();
+ }
+ public override void onMouseMove (object sender, MouseMoveEventArgs e)
+ {
+ base.onMouseMove (sender, e);
+
+ if (!(SelectionInProgress && HasFocus))
+ return;
+
+ updatemouseLocalPos (e.Position);
+
+ registerForGraphicUpdate();
+ }
+ public override void onMouseDown (object sender, MouseButtonEventArgs e)
+ {
+ if (this.HasFocus){
+ updatemouseLocalPos (e.Position);
+ SelBegin = -1;
+ SelRelease = -1;
+ SelectionInProgress = true;
+ }
+
+ //done at the end to set 'hasFocus' value after testing it
+ base.onMouseDown (sender, e);
+
+ registerForGraphicUpdate();
+ }
+ public override void onMouseUp (object sender, MouseButtonEventArgs e)
+ {
+ base.onMouseUp (sender, e);
+
+ if (!SelectionInProgress)
+ return;
+
+ updatemouseLocalPos (e.Position);
+ SelectionInProgress = false;
+ registerForGraphicUpdate ();
+ }
+ #endregion
+ /// <summary>
+ /// Update Current Column, line and TextCursorPos
+ /// from mouseLocalPos
+ /// </summary>
+ void computeTextCursor(Context gr)
+ {
+ TextExtents te;
+
+ double cPos = 0f;
+
+ CurrentLine = (int)(mouseLocalPos.Y / fe.Height);
+
+ //fix cu
+ if (CurrentLine >= lines.Count)
+ CurrentLine = lines.Count - 1;
+
+ for (int i = 0; i < lines[CurrentLine].Length; i++)
+ {
+ string c = lines [CurrentLine].Substring (i, 1);
+ if (c == "\t")
+ c = new string (' ', Interface.TabSize);
+
+ #if _WIN32 || _WIN64
+ byte[] c = System.Text.UTF8Encoding.UTF8.GetBytes(Text.Substring(i, 1));
+ te = gr.TextExtents(c);
+ #elif __linux__
+ te = gr.TextExtents(c);
+ #endif
+ double halfWidth = te.XAdvance / 2;
+
+ if (mouseLocalPos.X <= cPos + halfWidth)
+ {
+ CurrentColumn = i;
+ textCursorPos = cPos;
+ mouseLocalPos = -1;
+ return;
+ }
+
+ cPos += te.XAdvance;
+ }
+ CurrentColumn = lines[CurrentLine].Length;
+ textCursorPos = cPos;
+
+ //reset mouseLocalPos
+ mouseLocalPos = -1;
+ }
+ /// <summary> Computes offsets in cairo units </summary>
+ void computeTextCursorPosition(Context gr)
+ {
+ if (SelBegin >= 0)
+ SelStartCursorPos = GetXFromTextPointer (gr, SelBegin);
+ if (SelRelease >= 0)
+ SelEndCursorPos = GetXFromTextPointer (gr, SelRelease);
+ textCursorPos = GetXFromTextPointer (gr, new Point(CurrentColumn, CurrentLine));
+ }
+ /// <summary> Compute x offset in cairo unit from text position </summary>
+ double GetXFromTextPointer(Context gr, Point pos)
+ {
+ try {
+ string l = lines [pos.Y].Substring (0, pos.X).
+ Replace ("\t", new String (' ', Interface.TabSize));
+ return gr.TextExtents (l).XAdvance;
+ } catch{
+ return -1;
+ }
+ }
+ }
+}
-using System;\r
-\r
-\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-//using OpenTK.Graphics.OpenGL;\r
-\r
-using Cairo;\r
-\r
-using winColors = System.Drawing.Color;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-using System.Xml;\r
-using System.IO;\r
-\r
-namespace Crow\r
-{\r
- [DefaultTemplate("#Crow.Templates.Popper.goml")]\r
- public class Popper : TemplatedContainer\r
- { \r
- #region CTOR\r
- public Popper() : base()\r
- {\r
- } \r
- #endregion\r
- bool _isPopped;\r
- string caption;\r
- string image;\r
- GraphicObject _content;\r
-\r
- public event EventHandler Pop;\r
- public event EventHandler Unpop;\r
-\r
- public override GraphicObject Content {\r
- get { return _content; }\r
- set { \r
- if (_content != null) {\r
- _content.LogicalParent = null;\r
- _content.LayoutChanged -= _content_LayoutChanged;\r
- _content.MouseLeave -= _content_MouseLeave;\r
- }\r
- \r
- _content = value; \r
-\r
- if (_content == null)\r
- return;\r
-\r
- _content.LogicalParent = this;\r
- _content.Focusable = true;\r
- _content.LayoutChanged += _content_LayoutChanged;\r
- _content.MouseLeave += _content_MouseLeave;\r
- }\r
- }\r
-\r
- void _content_MouseLeave (object sender, MouseMoveEventArgs e)\r
- {\r
- IsPopped = false;\r
- }\r
-\r
- void _content_LayoutChanged (object sender, LayoutChangeEventArgs e)\r
- {\r
- ILayoutable tc = Content.Parent as ILayoutable;\r
- if (tc == null)\r
- return;\r
- Rectangle r = this.ScreenCoordinates (this.Slot);\r
- if (((int)e.LayoutType & (int)LayoutingType.Width) > 0) {\r
- if (Content.Slot.Width < tc.ClientRectangle.Width) {\r
- if (r.Left + Content.Slot.Width > tc.ClientRectangle.Right)\r
- Content.Left = tc.ClientRectangle.Right - Content.Slot.Width;\r
- else\r
- Content.Left = r.Left;\r
- } else\r
- Content.Left = 0;\r
- }\r
- if (((int)e.LayoutType & (int)LayoutingType.Height) > 0) {\r
- if (Content.Slot.Height < tc.ClientRectangle.Height) {\r
- if (r.Bottom + Content.Slot.Height > tc.ClientRectangle.Bottom)\r
- Content.Top = r.Top - Content.Slot.Height;\r
- else\r
- Content.Top = r.Bottom;\r
- }else\r
- Content.Top = 0;\r
- }\r
- }\r
- public override void ClearBinding ()\r
- {\r
- //ensure popped window is cleared\r
- if (Content != null) {\r
- if (Content.Parent != null) {\r
- IGOLibHost tc = Content.Parent as IGOLibHost;\r
- if (tc != null)\r
- tc.DeleteWidget (Content);\r
- }\r
- }\r
- base.ClearBinding ();\r
- }\r
- public override void ResolveBindings ()\r
- {\r
- base.ResolveBindings ();\r
- if (Content != null)\r
- Content.ResolveBindings ();\r
- }\r
-\r
- [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
- public override bool Focusable\r
- {\r
- get { return base.Focusable; }\r
- set { base.Focusable = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(-1)]\r
- public override int Height {\r
- get { return base.Height; }\r
- set { base.Height = value; }\r
- }\r
-\r
- [XmlAttributeAttribute()][DefaultValue("Popper")]\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
- } \r
- [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.expandable.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
- [XmlAttributeAttribute()][DefaultValue(false)]\r
- public bool IsPopped\r
- {\r
- get { return _isPopped; }\r
- set\r
- {\r
- _isPopped = value;\r
-\r
- if (_isPopped) {\r
- onPop (this, null);\r
- NotifyValueChanged ("SvgSub", "expanded");\r
- return;\r
- }\r
-\r
- onUnpop (this, null);\r
- NotifyValueChanged ("SvgSub", "collapsed");\r
- }\r
- }\r
- \r
- public virtual void onPop(object sender, EventArgs e)\r
- {\r
- IGOLibHost tc = HostContainer;\r
- if (tc == null)\r
- return;\r
- if (Content != null) {\r
- Content.Visible = true;\r
- if (Content.Parent == null)\r
- tc.AddWidget (Content);\r
- tc.PutOnTop (Content);\r
- _content_LayoutChanged (this, new LayoutChangeEventArgs (LayoutingType.Sizing));\r
- }\r
- Pop.Raise (this, e);\r
- }\r
- public virtual void onUnpop(object sender, EventArgs e)\r
- {\r
- IGOLibHost tc = HostContainer;\r
- if (tc == null)\r
- return;\r
- Content.Visible = false;\r
- Unpop.Raise (this, e);\r
- }\r
- \r
- public override void onMouseClick (object sender, MouseButtonEventArgs e)\r
- {\r
- IsPopped = !IsPopped;\r
- base.onMouseClick (sender, e);\r
- }\r
- }\r
-}\r
+using System;
+
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+//using OpenTK.Graphics.OpenGL;
+
+using Cairo;
+
+using winColors = System.Drawing.Color;
+using System.Diagnostics;
+using System.Xml.Serialization;
+using OpenTK.Input;
+using System.ComponentModel;
+using System.Xml;
+using System.IO;
+
+namespace Crow
+{
+ [DefaultTemplate("#Crow.Templates.Popper.goml")]
+ public class Popper : TemplatedContainer
+ {
+ #region CTOR
+ public Popper() : base()
+ {
+ }
+ #endregion
+ bool _isPopped;
+ string caption;
+ string image;
+ GraphicObject _content;
+
+ public event EventHandler Pop;
+ public event EventHandler Unpop;
+
+ public override GraphicObject Content {
+ get { return _content; }
+ set {
+ if (_content != null) {
+ _content.LogicalParent = null;
+ _content.LayoutChanged -= _content_LayoutChanged;
+ _content.MouseLeave -= _content_MouseLeave;
+ }
+
+ _content = value;
+
+ if (_content == null)
+ return;
+
+ _content.LogicalParent = this;
+ _content.Focusable = true;
+ _content.LayoutChanged += _content_LayoutChanged;
+ _content.MouseLeave += _content_MouseLeave;
+ }
+ }
+
+ void _content_MouseLeave (object sender, MouseMoveEventArgs e)
+ {
+ IsPopped = false;
+ }
+
+ void _content_LayoutChanged (object sender, LayoutChangeEventArgs e)
+ {
+ ILayoutable tc = Content.Parent as ILayoutable;
+ if (tc == null)
+ return;
+ Rectangle r = this.ScreenCoordinates (this.Slot);
+ if (((int)e.LayoutType & (int)LayoutingType.Width) > 0) {
+ if (Content.Slot.Width < tc.ClientRectangle.Width) {
+ if (r.Left + Content.Slot.Width > tc.ClientRectangle.Right)
+ Content.Left = tc.ClientRectangle.Right - Content.Slot.Width;
+ else
+ Content.Left = r.Left;
+ } else
+ Content.Left = 0;
+ }
+ if (((int)e.LayoutType & (int)LayoutingType.Height) > 0) {
+ if (Content.Slot.Height < tc.ClientRectangle.Height) {
+ if (r.Bottom + Content.Slot.Height > tc.ClientRectangle.Bottom)
+ Content.Top = r.Top - Content.Slot.Height;
+ else
+ Content.Top = r.Bottom;
+ }else
+ Content.Top = 0;
+ }
+ }
+ public override void ClearBinding ()
+ {
+ //ensure popped window is cleared
+ if (Content != null) {
+ if (Content.Parent != null) {
+ IGOLibHost tc = Content.Parent as IGOLibHost;
+ if (tc != null)
+ tc.DeleteWidget (Content);
+ }
+ }
+ base.ClearBinding ();
+ }
+ public override void ResolveBindings ()
+ {
+ base.ResolveBindings ();
+ if (Content != null)
+ Content.ResolveBindings ();
+ }
+
+ [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true
+ public override bool Focusable
+ {
+ get { return base.Focusable; }
+ set { base.Focusable = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue(-1)]
+ public override int Height {
+ get { return base.Height; }
+ set { base.Height = value; }
+ }
+
+ [XmlAttributeAttribute()][DefaultValue("Popper")]
+ public string Caption {
+ get { return caption; }
+ set {
+ if (caption == value)
+ return;
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.expandable.svg")]
+ public string Image {
+ get { return image; }
+ set {
+ if (image == value)
+ return;
+ image = value;
+ NotifyValueChanged ("Image", image);
+ }
+ }
+
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public bool IsPopped
+ {
+ get { return _isPopped; }
+ set
+ {
+ _isPopped = value;
+
+ if (_isPopped) {
+ onPop (this, null);
+ NotifyValueChanged ("SvgSub", "expanded");
+ return;
+ }
+
+ onUnpop (this, null);
+ NotifyValueChanged ("SvgSub", "collapsed");
+ }
+ }
+
+ public virtual void onPop(object sender, EventArgs e)
+ {
+ IGOLibHost tc = HostContainer;
+ if (tc == null)
+ return;
+ if (Content != null) {
+ Content.Visible = true;
+ if (Content.Parent == null)
+ tc.AddWidget (Content);
+ tc.PutOnTop (Content);
+ _content_LayoutChanged (this, new LayoutChangeEventArgs (LayoutingType.Sizing));
+ }
+ Pop.Raise (this, e);
+ }
+ public virtual void onUnpop(object sender, EventArgs e)
+ {
+ IGOLibHost tc = HostContainer;
+ if (tc == null)
+ return;
+ Content.Visible = false;
+ Unpop.Raise (this, e);
+ }
+
+ public override void onMouseClick (object sender, MouseButtonEventArgs e)
+ {
+ IsPopped = !IsPopped;
+ base.onMouseClick (sender, e);
+ }
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using Cairo;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using System.ComponentModel;\r
-\r
-namespace Crow\r
-{\r
- [Serializable]\r
- public class ProgressBar : Border\r
- {\r
- #region CTOR\r
- public ProgressBar() : base(){}\r
- public ProgressBar(int _max) : base()\r
- {\r
- Maximum = _max;\r
- }\r
- #endregion\r
-\r
- #region private fields\r
- int _currentValue = 0;\r
- int _minimum = 0;\r
- int _maximum = 100;\r
- #endregion\r
-\r
- #region public properties\r
- [XmlAttributeAttribute()][DefaultValue(0)]\r
- public int Value\r
- {\r
- get { return _currentValue; }\r
- set\r
- {\r
- if (_currentValue == value)\r
- return;\r
-\r
- _currentValue = value;\r
-\r
- if (_currentValue > Maximum)\r
- _currentValue = Maximum;\r
-\r
- registerForGraphicUpdate();\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(0)]\r
- public int Minimum {\r
- get {return _minimum;}\r
- set {\r
- if (_minimum == value || _minimum >= Maximum)\r
- return;\r
- _minimum = value;\r
- registerForGraphicUpdate ();\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(100)]\r
- public int Maximum {\r
- get {return _maximum;}\r
- set {\r
- if (_maximum == value || _maximum <= _minimum)\r
- return;\r
- _maximum = value;\r
- registerForGraphicUpdate();\r
- }\r
- }\r
- #endregion\r
-\r
- #region GraphicObject overrides\r
- [XmlAttributeAttribute()][DefaultValue("Gray")]\r
- public override Color Background {\r
- get { return base.Background; }\r
- set { base.Background = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(0)]\r
- public override int BorderWidth {\r
- get { return base.BorderWidth; }\r
- set { base.BorderWidth = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue("BlueCrayola")]\r
- public override Color Foreground {\r
- get { return base.Foreground; }\r
- set { base.Foreground = value; }\r
- }\r
-\r
- protected override void onDraw (Context gr)\r
- {\r
- base.onDraw (gr);\r
-\r
- Rectangle rBack = Slot.Size;\r
-\r
- if (BorderWidth > 0)\r
- rBack.Inflate(-BorderWidth, -BorderWidth);\r
-\r
- rBack.Width = (int)((double)rBack.Width / Maximum * Value);\r
-\r
- gr.SetSourceColor(Foreground);\r
-\r
- CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);\r
- gr.Fill();\r
- }\r
- #endregion\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Cairo;
+using System.Diagnostics;
+using System.Xml.Serialization;
+using System.ComponentModel;
+
+namespace Crow
+{
+ [Serializable]
+ public class ProgressBar : Border
+ {
+ #region CTOR
+ public ProgressBar() : base(){}
+ public ProgressBar(int _max) : base()
+ {
+ Maximum = _max;
+ }
+ #endregion
+
+ #region private fields
+ int _currentValue = 0;
+ int _minimum = 0;
+ int _maximum = 100;
+ #endregion
+
+ #region public properties
+ [XmlAttributeAttribute()][DefaultValue(0)]
+ public int Value
+ {
+ get { return _currentValue; }
+ set
+ {
+ if (_currentValue == value)
+ return;
+
+ _currentValue = value;
+
+ if (_currentValue > Maximum)
+ _currentValue = Maximum;
+
+ registerForGraphicUpdate();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(0)]
+ public int Minimum {
+ get {return _minimum;}
+ set {
+ if (_minimum == value || _minimum >= Maximum)
+ return;
+ _minimum = value;
+ registerForGraphicUpdate ();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(100)]
+ public int Maximum {
+ get {return _maximum;}
+ set {
+ if (_maximum == value || _maximum <= _minimum)
+ return;
+ _maximum = value;
+ registerForGraphicUpdate();
+ }
+ }
+ #endregion
+
+ #region GraphicObject overrides
+ [XmlAttributeAttribute()][DefaultValue("Gray")]
+ public override Color Background {
+ get { return base.Background; }
+ set { base.Background = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue(0)]
+ public override int BorderWidth {
+ get { return base.BorderWidth; }
+ set { base.BorderWidth = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue("BlueCrayola")]
+ public override Color Foreground {
+ get { return base.Foreground; }
+ set { base.Foreground = value; }
+ }
+
+ protected override void onDraw (Context gr)
+ {
+ base.onDraw (gr);
+
+ Rectangle rBack = Slot.Size;
+
+ if (BorderWidth > 0)
+ rBack.Inflate(-BorderWidth, -BorderWidth);
+
+ rBack.Width = (int)((double)rBack.Width / Maximum * Value);
+
+ gr.SetSourceColor(Foreground);
+
+ CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);
+ gr.Fill();
+ }
+ #endregion
+ }
+}
-using System;\r
-\r
-\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-//using OpenTK.Graphics.OpenGL;\r
-\r
-using Cairo;\r
-\r
-using winColors = System.Drawing.Color;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-\r
-namespace Crow\r
-{\r
- [DefaultTemplate("#Crow.Templates.RadioButton.goml")]\r
- public class RadioButton : TemplatedControl\r
- { \r
- string caption;\r
- string image;\r
- bool isChecked;\r
-\r
- #region CTOR\r
- public RadioButton() : base(){} \r
- #endregion\r
- \r
- #region GraphicObject overrides\r
- [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true\r
- public override bool Focusable\r
- {\r
- get { return base.Focusable; }\r
- set { base.Focusable = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(-1)]\r
- public override int Height {\r
- get { return base.Height; }\r
- set { base.Height = value; }\r
- }\r
- #endregion\r
-\r
- [XmlAttributeAttribute()][DefaultValue("RadioButton")]\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
- } \r
- [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.radiobutton.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
- [XmlAttributeAttribute()][DefaultValue(false)]\r
- public bool IsChecked\r
- {\r
- get { return isChecked; }\r
- set\r
- {\r
- isChecked = value;\r
-\r
- NotifyValueChanged ("IsChecked", value);\r
- if (isChecked)\r
- NotifyValueChanged ("SvgSub", "checked");\r
- else\r
- NotifyValueChanged ("SvgSub", "unchecked");\r
- }\r
- }\r
-\r
- public override void onMouseClick (object sender, MouseButtonEventArgs e)\r
- { \r
- Group pg = Parent as Group;\r
- if (pg != null) {\r
- foreach (RadioButton c in pg.Children.OfType<RadioButton>())\r
- c.IsChecked = (c == this);\r
- } else\r
- IsChecked = !IsChecked;\r
-\r
- base.onMouseClick (sender, e);\r
- }\r
- }\r
-}\r
+using System;
+
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+//using OpenTK.Graphics.OpenGL;
+
+using Cairo;
+
+using winColors = System.Drawing.Color;
+using System.Diagnostics;
+using System.Xml.Serialization;
+using OpenTK.Input;
+using System.ComponentModel;
+
+namespace Crow
+{
+ [DefaultTemplate("#Crow.Templates.RadioButton.goml")]
+ public class RadioButton : TemplatedControl
+ {
+ string caption;
+ string image;
+ bool isChecked;
+
+ #region CTOR
+ public RadioButton() : base(){}
+ #endregion
+
+ #region GraphicObject overrides
+ [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true
+ public override bool Focusable
+ {
+ get { return base.Focusable; }
+ set { base.Focusable = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue(-1)]
+ public override int Height {
+ get { return base.Height; }
+ set { base.Height = value; }
+ }
+ #endregion
+
+ [XmlAttributeAttribute()][DefaultValue("RadioButton")]
+ public string Caption {
+ get { return caption; }
+ set {
+ if (caption == value)
+ return;
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.radiobutton.svg")]
+ public string Image {
+ get { return image; }
+ set {
+ if (image == value)
+ return;
+ image = value;
+ NotifyValueChanged ("Image", image);
+ }
+ }
+
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public bool IsChecked
+ {
+ get { return isChecked; }
+ set
+ {
+ isChecked = value;
+
+ NotifyValueChanged ("IsChecked", value);
+ if (isChecked)
+ NotifyValueChanged ("SvgSub", "checked");
+ else
+ NotifyValueChanged ("SvgSub", "unchecked");
+ }
+ }
+
+ public override void onMouseClick (object sender, MouseButtonEventArgs e)
+ {
+ Group pg = Parent as Group;
+ if (pg != null) {
+ foreach (RadioButton c in pg.Children.OfType<RadioButton>())
+ c.IsChecked = (c == this);
+ } else
+ IsChecked = !IsChecked;
+
+ base.onMouseClick (sender, e);
+ }
+ }
+}
-using System;\r
-\r
-\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-//using OpenTK.Graphics.OpenGL;\r
-\r
-using Cairo;\r
-\r
-using winColors = System.Drawing.Color;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-\r
-namespace Crow\r
-{\r
- [DefaultTemplate("#Crow.Templates.ScrollBar.goml")]\r
- public class ScrollBar : TemplatedControl\r
- {\r
- Orientation _orientation;\r
- Slider _slider;\r
- double _maximumScroll;\r
- double _scroll;\r
-\r
- public ScrollBar() : base()\r
- {\r
- } \r
-\r
- protected override void loadTemplate(GraphicObject template = null)\r
- { \r
- base.loadTemplate (template);\r
- _slider = this.child.FindByName ("Slider") as Slider;\r
- }\r
-\r
- [XmlAttributeAttribute()][DefaultValue(0.0)]\r
- public virtual double MaximumScroll\r
- {\r
- get { return _maximumScroll; }\r
- set {\r
- if (_maximumScroll == value)\r
- return;\r
- _maximumScroll = value;\r
- registerForGraphicUpdate ();\r
- NotifyValueChanged ("MaximumScroll", _maximumScroll);\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(0.0)]\r
- public virtual double Scroll\r
- {\r
- get { return _scroll; }\r
- set {\r
- if (_scroll == value)\r
- return;\r
- _scroll = value;\r
- if (_scroll < 0.0)\r
- _scroll = 0.0;\r
- else if (_scroll > _maximumScroll)\r
- _scroll = _maximumScroll;\r
- registerForGraphicUpdate ();\r
- NotifyValueChanged ("Scroll", _scroll);\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(Orientation.Vertical)]\r
- public virtual Orientation Orientation\r
- {\r
- get { return _orientation; }\r
- set { \r
- if (_orientation == value)\r
- return;\r
- _orientation = value;\r
- NotifyValueChanged ("Orientation", _orientation);\r
- registerForGraphicUpdate ();\r
- }\r
- }\r
- public void onScrollBack (object sender, MouseButtonEventArgs e)\r
- {\r
- Scroll -= _slider.LargeIncrement;\r
- }\r
- public void onScrollForth (object sender, MouseButtonEventArgs e)\r
- {\r
- Scroll += _slider.LargeIncrement;\r
-\r
- }\r
-\r
- public void onSliderValueChange(object sender, ValueChangeEventArgs e){\r
- Scroll = Convert.ToDouble(e.NewValue);\r
- }\r
-\r
- public override void OnLayoutChanges (LayoutingType layoutType)\r
- {\r
- OpenTKGameWindow.currentWindow.CursorVisible = true;\r
- base.OnLayoutChanges (layoutType);\r
- }\r
- }\r
-}\r
+using System;
+
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+//using OpenTK.Graphics.OpenGL;
+
+using Cairo;
+
+using winColors = System.Drawing.Color;
+using System.Diagnostics;
+using System.Xml.Serialization;
+using OpenTK.Input;
+using System.ComponentModel;
+
+namespace Crow
+{
+ [DefaultTemplate("#Crow.Templates.ScrollBar.goml")]
+ public class ScrollBar : TemplatedControl
+ {
+ Orientation _orientation;
+ Slider _slider;
+ double _maximumScroll;
+ double _scroll;
+
+ public ScrollBar() : base()
+ {
+ }
+
+ protected override void loadTemplate(GraphicObject template = null)
+ {
+ base.loadTemplate (template);
+ _slider = this.child.FindByName ("Slider") as Slider;
+ }
+
+ [XmlAttributeAttribute()][DefaultValue(0.0)]
+ public virtual double MaximumScroll
+ {
+ get { return _maximumScroll; }
+ set {
+ if (_maximumScroll == value)
+ return;
+ _maximumScroll = value;
+ registerForGraphicUpdate ();
+ NotifyValueChanged ("MaximumScroll", _maximumScroll);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(0.0)]
+ public virtual double Scroll
+ {
+ get { return _scroll; }
+ set {
+ if (_scroll == value)
+ return;
+ _scroll = value;
+ if (_scroll < 0.0)
+ _scroll = 0.0;
+ else if (_scroll > _maximumScroll)
+ _scroll = _maximumScroll;
+ registerForGraphicUpdate ();
+ NotifyValueChanged ("Scroll", _scroll);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(Orientation.Vertical)]
+ public virtual Orientation Orientation
+ {
+ get { return _orientation; }
+ set {
+ if (_orientation == value)
+ return;
+ _orientation = value;
+ NotifyValueChanged ("Orientation", _orientation);
+ registerForGraphicUpdate ();
+ }
+ }
+ public void onScrollBack (object sender, MouseButtonEventArgs e)
+ {
+ Scroll -= _slider.LargeIncrement;
+ }
+ public void onScrollForth (object sender, MouseButtonEventArgs e)
+ {
+ Scroll += _slider.LargeIncrement;
+
+ }
+
+ public void onSliderValueChange(object sender, ValueChangeEventArgs e){
+ Scroll = Convert.ToDouble(e.NewValue);
+ }
+
+ public override void OnLayoutChanges (LayoutingType layoutType)
+ {
+ OpenTKGameWindow.currentWindow.CursorVisible = true;
+ base.OnLayoutChanges (layoutType);
+ }
+ }
+}
-using System;\r
-using System.Diagnostics;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Drawing;\r
-using Cairo;\r
-using System.Xml.Serialization;\r
-using OpenTK.Input;\r
-using System.ComponentModel;\r
-\r
-namespace Crow\r
-{\r
- public class Scroller : Container\r
- {\r
- bool _verticalScrolling;\r
- bool _horizontalScrolling;\r
- bool _scrollbarVisible;\r
- double _scrollX = 0.0;\r
- double _scrollY = 0.0;\r
- int scrollSpeed;\r
-\r
-\r
-\r
- #region public properties\r
- [XmlAttributeAttribute][DefaultValue(false)]\r
- public bool VerticalScrolling {\r
- get { return _verticalScrolling; }\r
- set { _verticalScrolling = value; }\r
- }\r
- \r
- [XmlAttributeAttribute][DefaultValue(false)]\r
- public bool HorizontalScrolling {\r
- get { return _horizontalScrolling; }\r
- set { _horizontalScrolling = value; }\r
- }\r
- [XmlAttributeAttribute][DefaultValue(true)]\r
- public bool ScrollbarVisible {\r
- get { return _scrollbarVisible; }\r
- set { _scrollbarVisible = value; }\r
- } \r
- [XmlAttributeAttribute][DefaultValue(0.0)]\r
- public double ScrollX {\r
- get {\r
- return _scrollX;\r
- }\r
- set {\r
- if (_scrollX == value)\r
- return;\r
- if (value < 0.0)\r
- _scrollX = 0.0;\r
- else if (value > Child.Slot.Width - ClientRectangle.Width)\r
- _scrollX = Math.Max(0.0, Child.Slot.Width - ClientRectangle.Width);\r
- else\r
- _scrollX = value;\r
- NotifyValueChanged("ScrollX", _scrollX);\r
- RegisterForRedraw();\r
- }\r
- } \r
- [XmlAttributeAttribute][DefaultValue(0.0)]\r
- public double ScrollY {\r
- get {\r
- return _scrollY;\r
- }\r
- set {\r
- if (_scrollY == value)\r
- return;\r
- if (value < 0.0)\r
- _scrollY = 0.0;\r
- else if (value > Child.Slot.Height - ClientRectangle.Height)\r
- _scrollY = Math.Max(0.0,Child.Slot.Height - ClientRectangle.Height);\r
- else\r
- _scrollY = value;\r
- NotifyValueChanged("ScrollY", _scrollY);\r
- RegisterForRedraw();\r
- }\r
- }\r
-\r
- [XmlIgnore]\r
- public int MaximumScroll {\r
- get {\r
- return VerticalScrolling ? \r
- child == null ? 0 : Child.Slot.Height - ClientRectangle.Height :\r
- Child.Slot.Width - ClientRectangle.Width; \r
- }\r
- }\r
-\r
- [XmlAttributeAttribute][DefaultValue(30)]\r
- public int ScrollSpeed {\r
- get { return scrollSpeed; }\r
- set {\r
- scrollSpeed = value;\r
- NotifyValueChanged("ScrollSpeed", scrollSpeed);\r
- }\r
- }\r
- #endregion\r
-\r
-\r
- public Scroller()\r
- : base(){}\r
-\r
- #region GraphicObject Overrides\r
- void OnChildLayoutChanges (object sender, LayoutChangeEventArgs arg)\r
- {\r
- int maxScroll = MaximumScroll;\r
- if (_verticalScrolling) {\r
- if (arg.LayoutType == LayoutingType.Height) {\r
- if (maxScroll < ScrollY) {\r
- Debug.WriteLine ("scrolly={0} maxscroll={1}", ScrollY, maxScroll);\r
- ScrollY = 0;\r
- }\r
- NotifyValueChanged("MaximumScroll", maxScroll);\r
- }\r
- } else if (arg.LayoutType == LayoutingType.Width) {\r
- if (maxScroll < ScrollX)\r
- ScrollX = 0;\r
- NotifyValueChanged("MaximumScroll", maxScroll);\r
- }\r
- }\r
- void onChildListCleared(object sender, EventArgs e){\r
- ScrollY = 0;\r
- ScrollX = 0;\r
- }\r
- public override T SetChild<T> (T _child)\r
- { \r
- GraphicObject c = child as GraphicObject;\r
- Group g = child as Group;\r
- if (c != null) {\r
- c.LayoutChanged -= OnChildLayoutChanges;\r
- if (g != null)\r
- g.ChildrenCleared -= onChildListCleared;\r
- }\r
- c = _child as GraphicObject;\r
- g = _child as Group;\r
- if (c != null) {\r
- c.LayoutChanged += OnChildLayoutChanges;\r
- if (g != null)\r
- g.ChildrenCleared += onChildListCleared; \r
- }\r
- return base.SetChild (_child);\r
- }\r
- #endregion\r
-\r
- #region Mouse handling\r
- internal Point savedMousePos;\r
- public override bool MouseIsIn (Point m)\r
- { \r
-// Debug.WriteLine ("Mouse in scroller: {0} scr coord:{1} mouse:{2}",\r
-// base.ScreenCoordinates (Slot).ContainsOrIsEqual (m),\r
-// base.ScreenCoordinates (Slot), m);\r
-\r
- return Visible ? base.ScreenCoordinates(Slot).ContainsOrIsEqual (m) : false; \r
- }\r
- public override void checkHoverWidget (MouseMoveEventArgs e)\r
- {\r
- savedMousePos = e.Position;\r
- Point m = e.Position - new Point ((int)ScrollX, (int)ScrollY);\r
- base.checkHoverWidget (new MouseMoveEventArgs(m.X,m.Y,e.XDelta,e.YDelta));\r
- }\r
- public override void onMouseWheel (object sender, MouseWheelEventArgs e)\r
- {\r
- //base.onMouseWheel (sender, e); base event buble to the top\r
-// if (MouseWheelChanged!=null)\r
-// MouseWheelChanged (this, e);\r
-\r
- if (Child == null)\r
- return;\r
- \r
- if (VerticalScrolling )\r
- ScrollY -= e.Delta * ScrollSpeed;\r
- if (HorizontalScrolling )\r
- ScrollX -= e.Delta * ScrollSpeed;\r
- }\r
- public override void onMouseMove (object sender, MouseMoveEventArgs e)\r
- {\r
- savedMousePos.X += e.XDelta;\r
- savedMousePos.Y += e.YDelta;\r
- base.onMouseMove (sender, new MouseMoveEventArgs(savedMousePos.X,savedMousePos.Y,e.XDelta,e.YDelta));\r
- }\r
- #endregion\r
-\r
- public override Rectangle ContextCoordinates (Rectangle r)\r
- {\r
- return base.ContextCoordinates (r) - new Point((int)ScrollX,(int)ScrollY);\r
- }\r
- public override Rectangle ScreenCoordinates (Rectangle r)\r
- {\r
- return base.ScreenCoordinates (r) - new Point((int)ScrollX,(int)ScrollY);\r
- }\r
-\r
- public override void registerClipRect ()\r
- {\r
- HostContainer.redrawClip.AddRectangle (base.ScreenCoordinates(Slot));\r
- }\r
-\r
- public override void Paint(ref Cairo.Context ctx, Rectangles clip = null)\r
- {\r
- if (!Visible)//check if necessary??\r
- return;\r
-\r
- ctx.Save();\r
-\r
- // ctx.Rectangle(ContextCoordinates(Slot));\r
- // ctx.Clip();\r
- //\r
-// if (clip != null)\r
-// clip.clip(ctx);\r
- //clip.Srcoll (this);\r
-\r
- base.Paint (ref ctx, clip);\r
-\r
- //clip to client zone\r
- ctx.Rectangle(Parent.ContextCoordinates(ClientRectangle + Slot.Position));\r
- ctx.Clip();\r
-\r
-// if (clip != null)\r
-// clip.Srcoll (this);\r
- // if (clip != null)\r
- // clip.Rebase(this);\r
-\r
- if (Child != null)\r
- Child.Paint(ref ctx, clip);\r
-\r
- ctx.Restore(); \r
- }\r
- }\r
-}\r
+using System;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using Cairo;
+using System.Xml.Serialization;
+using OpenTK.Input;
+using System.ComponentModel;
+
+namespace Crow
+{
+ public class Scroller : Container
+ {
+ bool _verticalScrolling;
+ bool _horizontalScrolling;
+ bool _scrollbarVisible;
+ double _scrollX = 0.0;
+ double _scrollY = 0.0;
+ int scrollSpeed;
+
+
+
+ #region public properties
+ [XmlAttributeAttribute][DefaultValue(false)]
+ public bool VerticalScrolling {
+ get { return _verticalScrolling; }
+ set { _verticalScrolling = value; }
+ }
+
+ [XmlAttributeAttribute][DefaultValue(false)]
+ public bool HorizontalScrolling {
+ get { return _horizontalScrolling; }
+ set { _horizontalScrolling = value; }
+ }
+ [XmlAttributeAttribute][DefaultValue(true)]
+ public bool ScrollbarVisible {
+ get { return _scrollbarVisible; }
+ set { _scrollbarVisible = value; }
+ }
+ [XmlAttributeAttribute][DefaultValue(0.0)]
+ public double ScrollX {
+ get {
+ return _scrollX;
+ }
+ set {
+ if (_scrollX == value)
+ return;
+ if (value < 0.0)
+ _scrollX = 0.0;
+ else if (value > Child.Slot.Width - ClientRectangle.Width)
+ _scrollX = Math.Max(0.0, Child.Slot.Width - ClientRectangle.Width);
+ else
+ _scrollX = value;
+ NotifyValueChanged("ScrollX", _scrollX);
+ RegisterForRedraw();
+ }
+ }
+ [XmlAttributeAttribute][DefaultValue(0.0)]
+ public double ScrollY {
+ get {
+ return _scrollY;
+ }
+ set {
+ if (_scrollY == value)
+ return;
+ if (value < 0.0)
+ _scrollY = 0.0;
+ else if (value > Child.Slot.Height - ClientRectangle.Height)
+ _scrollY = Math.Max(0.0,Child.Slot.Height - ClientRectangle.Height);
+ else
+ _scrollY = value;
+ NotifyValueChanged("ScrollY", _scrollY);
+ RegisterForRedraw();
+ }
+ }
+
+ [XmlIgnore]
+ public int MaximumScroll {
+ get {
+ return VerticalScrolling ?
+ child == null ? 0 : Child.Slot.Height - ClientRectangle.Height :
+ Child.Slot.Width - ClientRectangle.Width;
+ }
+ }
+
+ [XmlAttributeAttribute][DefaultValue(30)]
+ public int ScrollSpeed {
+ get { return scrollSpeed; }
+ set {
+ scrollSpeed = value;
+ NotifyValueChanged("ScrollSpeed", scrollSpeed);
+ }
+ }
+ #endregion
+
+
+ public Scroller()
+ : base(){}
+
+ #region GraphicObject Overrides
+ void OnChildLayoutChanges (object sender, LayoutChangeEventArgs arg)
+ {
+ int maxScroll = MaximumScroll;
+ if (_verticalScrolling) {
+ if (arg.LayoutType == LayoutingType.Height) {
+ if (maxScroll < ScrollY) {
+ Debug.WriteLine ("scrolly={0} maxscroll={1}", ScrollY, maxScroll);
+ ScrollY = 0;
+ }
+ NotifyValueChanged("MaximumScroll", maxScroll);
+ }
+ } else if (arg.LayoutType == LayoutingType.Width) {
+ if (maxScroll < ScrollX)
+ ScrollX = 0;
+ NotifyValueChanged("MaximumScroll", maxScroll);
+ }
+ }
+ void onChildListCleared(object sender, EventArgs e){
+ ScrollY = 0;
+ ScrollX = 0;
+ }
+ public override T SetChild<T> (T _child)
+ {
+ GraphicObject c = child as GraphicObject;
+ Group g = child as Group;
+ if (c != null) {
+ c.LayoutChanged -= OnChildLayoutChanges;
+ if (g != null)
+ g.ChildrenCleared -= onChildListCleared;
+ }
+ c = _child as GraphicObject;
+ g = _child as Group;
+ if (c != null) {
+ c.LayoutChanged += OnChildLayoutChanges;
+ if (g != null)
+ g.ChildrenCleared += onChildListCleared;
+ }
+ return base.SetChild (_child);
+ }
+ #endregion
+
+ #region Mouse handling
+ internal Point savedMousePos;
+ public override bool MouseIsIn (Point m)
+ {
+// Debug.WriteLine ("Mouse in scroller: {0} scr coord:{1} mouse:{2}",
+// base.ScreenCoordinates (Slot).ContainsOrIsEqual (m),
+// base.ScreenCoordinates (Slot), m);
+
+ return Visible ? base.ScreenCoordinates(Slot).ContainsOrIsEqual (m) : false;
+ }
+ public override void checkHoverWidget (MouseMoveEventArgs e)
+ {
+ savedMousePos = e.Position;
+ Point m = e.Position - new Point ((int)ScrollX, (int)ScrollY);
+ base.checkHoverWidget (new MouseMoveEventArgs(m.X,m.Y,e.XDelta,e.YDelta));
+ }
+ public override void onMouseWheel (object sender, MouseWheelEventArgs e)
+ {
+ //base.onMouseWheel (sender, e); base event buble to the top
+// if (MouseWheelChanged!=null)
+// MouseWheelChanged (this, e);
+
+ if (Child == null)
+ return;
+
+ if (VerticalScrolling )
+ ScrollY -= e.Delta * ScrollSpeed;
+ if (HorizontalScrolling )
+ ScrollX -= e.Delta * ScrollSpeed;
+ }
+ public override void onMouseMove (object sender, MouseMoveEventArgs e)
+ {
+ savedMousePos.X += e.XDelta;
+ savedMousePos.Y += e.YDelta;
+ base.onMouseMove (sender, new MouseMoveEventArgs(savedMousePos.X,savedMousePos.Y,e.XDelta,e.YDelta));
+ }
+ #endregion
+
+ public override Rectangle ContextCoordinates (Rectangle r)
+ {
+ return base.ContextCoordinates (r) - new Point((int)ScrollX,(int)ScrollY);
+ }
+ public override Rectangle ScreenCoordinates (Rectangle r)
+ {
+ return base.ScreenCoordinates (r) - new Point((int)ScrollX,(int)ScrollY);
+ }
+
+ public override void registerClipRect ()
+ {
+ HostContainer.redrawClip.AddRectangle (base.ScreenCoordinates(Slot));
+ }
+
+ public override void Paint(ref Cairo.Context ctx, Rectangles clip = null)
+ {
+ if (!Visible)//check if necessary??
+ return;
+
+ ctx.Save();
+
+ // ctx.Rectangle(ContextCoordinates(Slot));
+ // ctx.Clip();
+ //
+// if (clip != null)
+// clip.clip(ctx);
+ //clip.Srcoll (this);
+
+ base.Paint (ref ctx, clip);
+
+ //clip to client zone
+ ctx.Rectangle(Parent.ContextCoordinates(ClientRectangle + Slot.Position));
+ ctx.Clip();
+
+// if (clip != null)
+// clip.Srcoll (this);
+ // if (clip != null)
+ // clip.Rebase(this);
+
+ if (Child != null)
+ Child.Paint(ref ctx, clip);
+
+ ctx.Restore();
+ }
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using Cairo;\r
-using System.Xml.Serialization;\r
-using System.ComponentModel;\r
-using System.Diagnostics;\r
-\r
-namespace Crow\r
-{\r
- public class Slider : NumericControl\r
- {\r
- #region CTOR\r
- public Slider() : base()\r
- {}\r
- public Slider(double minimum, double maximum, double step)\r
- : base(minimum,maximum,step)\r
- {\r
- }\r
- #endregion\r
-\r
- #region implemented abstract members of TemplatedControl\r
-\r
- protected override void loadTemplate (GraphicObject template = null)\r
- {\r
- \r
- }\r
-\r
- #endregion\r
-\r
- #region private fields\r
- Rectangle cursor;\r
- int _cursorSize;\r
- Color _cursorColor;\r
- Orientation _orientation;\r
- bool holdCursor = false;\r
- #endregion\r
-\r
- protected double unity;\r
-\r
- #region Public properties\r
- [XmlAttributeAttribute()][DefaultValue("BlueGray")]\r
- public virtual Color CursorColor {\r
- get { return _cursorColor; }\r
- set {\r
- _cursorColor = value;\r
- registerForGraphicUpdate ();\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(20)]\r
- public virtual int CursorSize {\r
- get { return _cursorSize; }\r
- set {\r
- _cursorSize = value;\r
- registerForGraphicUpdate ();\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(Orientation.Horizontal)]\r
- public virtual Orientation Orientation\r
- {\r
- get { return _orientation; }\r
- set { _orientation = value; }\r
- }\r
- #endregion\r
- [XmlAttributeAttribute()][DefaultValue(10.0)]\r
- public override double Maximum {\r
- get { return base.Maximum; }\r
- set {\r
- if (value == base.Maximum)\r
- return;\r
- base.Maximum = value;\r
- LargeIncrement = base.Maximum / 10.0;\r
- SmallIncrement = LargeIncrement / 5.0;\r
-\r
- }\r
- }\r
- #region GraphicObject Overrides\r
- [XmlAttributeAttribute()][DefaultValue("Gray")]\r
- public override Color Background {\r
- get { return base.Background; }\r
- set { base.Background = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(true)]\r
- public override bool Focusable\r
- {\r
- get { return base.Focusable; }\r
- set { base.Focusable = value; }\r
- }\r
- //TODO:seems strange to trigger layout computation in an\r
- //overriding of updateGraphic\r
- protected override void UpdateGraphic ()\r
- {\r
- if (Maximum > 0)\r
- computeCursorPosition();\r
- base.UpdateGraphic ();\r
- }\r
-\r
- protected override void onDraw (Context gr)\r
- {\r
- base.onDraw (gr);\r
- if (Maximum <= 0)\r
- return;\r
- Rectangle r = ClientRectangle;\r
- PointD pStart;\r
- PointD pEnd;\r
- if (_orientation == Orientation.Horizontal) {\r
- pStart = r.TopLeft + new Point (_cursorSize / 2, r.Height / 2);\r
- pEnd = r.TopRight + new Point (-_cursorSize / 2, r.Height / 2);\r
- } else {\r
- pStart = r.TopLeft + new Point (r.Width / 2, _cursorSize / 2);\r
- pEnd = r.BottomLeft + new Point (r.Width / 2,- _cursorSize / 2);\r
- }\r
-\r
- DrawGraduations (gr, pStart,pEnd);\r
-\r
- DrawCursor (gr, cursor);\r
- }\r
- #endregion\r
-\r
- protected virtual void DrawGraduations(Context gr, PointD pStart, PointD pEnd)\r
- {\r
- gr.SetSourceColor(Foreground);\r
-\r
- gr.LineWidth = 1;\r
- gr.MoveTo(pStart);\r
- gr.LineTo(pEnd);\r
-\r
- gr.Stroke();\r
-\r
- }\r
- protected virtual void DrawCursor(Context gr, Rectangle _cursor)\r
- {\r
- gr.SetSourceColor(CursorColor);\r
- CairoHelpers.CairoRectangle (gr, _cursor, CornerRadius);\r
- gr.FillPreserve();\r
- }\r
-\r
- void computeCursorPosition()\r
- { \r
- Rectangle r = ClientRectangle;\r
- PointD p1; \r
-\r
- if (_orientation == Orientation.Horizontal) {\r
- cursor = new Rectangle (new Size (_cursorSize, (int)(r.Height)));\r
- p1 = r.TopLeft + new Point (_cursorSize / 2, r.Height / 2);\r
- unity = (double)(r.Width - _cursorSize) / (Maximum - Minimum);\r
- cursor.TopLeft = new Point (r.Left + (int)(Value * unity),\r
- (int)(p1.Y - cursor.Height / 2));\r
- } else {\r
- cursor = new Rectangle (new Size ((int)(r.Width), _cursorSize));\r
- p1 = r.TopLeft + new Point (r.Width / 2, _cursorSize / 2);\r
- unity = (double)(r.Height - _cursorSize) / (Maximum - Minimum);\r
- cursor.TopLeft = new Point ((int)(p1.X - r.Width / 2),\r
- r.Top + (int)(Value * unity)); \r
- }\r
- cursor.Inflate (-1);\r
- }\r
- \r
- #region mouse handling\r
- public override void onMouseDown (object sender, OpenTK.Input.MouseButtonEventArgs e)\r
- {\r
- base.onMouseDown (sender, e);\r
-\r
- Rectangle cursInScreenCoord = ScreenCoordinates (cursor + Slot.Position);\r
- if (cursInScreenCoord.ContainsOrIsEqual (e.Position))\r
- holdCursor = true;\r
- else if (_orientation == Orientation.Horizontal) {\r
- if (e.Position.X < cursInScreenCoord.Left)\r
- Value -= LargeIncrement;\r
- else\r
- Value += LargeIncrement;\r
- } else {\r
- if (e.Position.Y < cursInScreenCoord.Top)\r
- Value -= LargeIncrement;\r
- else\r
- Value += LargeIncrement;\r
- }\r
- }\r
- public override void onMouseUp (object sender, OpenTK.Input.MouseButtonEventArgs e)\r
- {\r
- base.onMouseUp (sender, e);\r
-\r
- holdCursor = false;\r
- }\r
- public override void onMouseMove (object sender, OpenTK.Input.MouseMoveEventArgs e)\r
- {\r
- if (holdCursor) {\r
- if (_orientation == Orientation.Horizontal)\r
- Value += (double)e.XDelta / unity;\r
- else\r
- Value += (double)e.YDelta / unity;\r
- }\r
- \r
- base.onMouseMove (sender, e);\r
- }\r
- #endregion\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Cairo;
+using System.Xml.Serialization;
+using System.ComponentModel;
+using System.Diagnostics;
+
+namespace Crow
+{
+ public class Slider : NumericControl
+ {
+ #region CTOR
+ public Slider() : base()
+ {}
+ public Slider(double minimum, double maximum, double step)
+ : base(minimum,maximum,step)
+ {
+ }
+ #endregion
+
+ #region implemented abstract members of TemplatedControl
+
+ protected override void loadTemplate (GraphicObject template = null)
+ {
+
+ }
+
+ #endregion
+
+ #region private fields
+ Rectangle cursor;
+ int _cursorSize;
+ Color _cursorColor;
+ Orientation _orientation;
+ bool holdCursor = false;
+ #endregion
+
+ protected double unity;
+
+ #region Public properties
+ [XmlAttributeAttribute()][DefaultValue("BlueGray")]
+ public virtual Color CursorColor {
+ get { return _cursorColor; }
+ set {
+ _cursorColor = value;
+ registerForGraphicUpdate ();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(20)]
+ public virtual int CursorSize {
+ get { return _cursorSize; }
+ set {
+ _cursorSize = value;
+ registerForGraphicUpdate ();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(Orientation.Horizontal)]
+ public virtual Orientation Orientation
+ {
+ get { return _orientation; }
+ set { _orientation = value; }
+ }
+ #endregion
+ [XmlAttributeAttribute()][DefaultValue(10.0)]
+ public override double Maximum {
+ get { return base.Maximum; }
+ set {
+ if (value == base.Maximum)
+ return;
+ base.Maximum = value;
+ LargeIncrement = base.Maximum / 10.0;
+ SmallIncrement = LargeIncrement / 5.0;
+
+ }
+ }
+ #region GraphicObject Overrides
+ [XmlAttributeAttribute()][DefaultValue("Gray")]
+ public override Color Background {
+ get { return base.Background; }
+ set { base.Background = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue(true)]
+ public override bool Focusable
+ {
+ get { return base.Focusable; }
+ set { base.Focusable = value; }
+ }
+ //TODO:seems strange to trigger layout computation in an
+ //overriding of updateGraphic
+ protected override void UpdateGraphic ()
+ {
+ if (Maximum > 0)
+ computeCursorPosition();
+ base.UpdateGraphic ();
+ }
+
+ protected override void onDraw (Context gr)
+ {
+ base.onDraw (gr);
+ if (Maximum <= 0)
+ return;
+ Rectangle r = ClientRectangle;
+ PointD pStart;
+ PointD pEnd;
+ if (_orientation == Orientation.Horizontal) {
+ pStart = r.TopLeft + new Point (_cursorSize / 2, r.Height / 2);
+ pEnd = r.TopRight + new Point (-_cursorSize / 2, r.Height / 2);
+ } else {
+ pStart = r.TopLeft + new Point (r.Width / 2, _cursorSize / 2);
+ pEnd = r.BottomLeft + new Point (r.Width / 2,- _cursorSize / 2);
+ }
+
+ DrawGraduations (gr, pStart,pEnd);
+
+ DrawCursor (gr, cursor);
+ }
+ #endregion
+
+ protected virtual void DrawGraduations(Context gr, PointD pStart, PointD pEnd)
+ {
+ gr.SetSourceColor(Foreground);
+
+ gr.LineWidth = 1;
+ gr.MoveTo(pStart);
+ gr.LineTo(pEnd);
+
+ gr.Stroke();
+
+ }
+ protected virtual void DrawCursor(Context gr, Rectangle _cursor)
+ {
+ gr.SetSourceColor(CursorColor);
+ CairoHelpers.CairoRectangle (gr, _cursor, CornerRadius);
+ gr.FillPreserve();
+ }
+
+ void computeCursorPosition()
+ {
+ Rectangle r = ClientRectangle;
+ PointD p1;
+
+ if (_orientation == Orientation.Horizontal) {
+ cursor = new Rectangle (new Size (_cursorSize, (int)(r.Height)));
+ p1 = r.TopLeft + new Point (_cursorSize / 2, r.Height / 2);
+ unity = (double)(r.Width - _cursorSize) / (Maximum - Minimum);
+ cursor.TopLeft = new Point (r.Left + (int)(Value * unity),
+ (int)(p1.Y - cursor.Height / 2));
+ } else {
+ cursor = new Rectangle (new Size ((int)(r.Width), _cursorSize));
+ p1 = r.TopLeft + new Point (r.Width / 2, _cursorSize / 2);
+ unity = (double)(r.Height - _cursorSize) / (Maximum - Minimum);
+ cursor.TopLeft = new Point ((int)(p1.X - r.Width / 2),
+ r.Top + (int)(Value * unity));
+ }
+ cursor.Inflate (-1);
+ }
+
+ #region mouse handling
+ public override void onMouseDown (object sender, OpenTK.Input.MouseButtonEventArgs e)
+ {
+ base.onMouseDown (sender, e);
+
+ Rectangle cursInScreenCoord = ScreenCoordinates (cursor + Slot.Position);
+ if (cursInScreenCoord.ContainsOrIsEqual (e.Position))
+ holdCursor = true;
+ else if (_orientation == Orientation.Horizontal) {
+ if (e.Position.X < cursInScreenCoord.Left)
+ Value -= LargeIncrement;
+ else
+ Value += LargeIncrement;
+ } else {
+ if (e.Position.Y < cursInScreenCoord.Top)
+ Value -= LargeIncrement;
+ else
+ Value += LargeIncrement;
+ }
+ }
+ public override void onMouseUp (object sender, OpenTK.Input.MouseButtonEventArgs e)
+ {
+ base.onMouseUp (sender, e);
+
+ holdCursor = false;
+ }
+ public override void onMouseMove (object sender, OpenTK.Input.MouseMoveEventArgs e)
+ {
+ if (holdCursor) {
+ if (_orientation == Orientation.Horizontal)
+ Value += (double)e.XDelta / unity;
+ else
+ Value += (double)e.YDelta / unity;
+ }
+
+ base.onMouseMove (sender, e);
+ }
+ #endregion
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using OpenTK.Input;\r
-using Cairo;\r
-using System.Diagnostics;\r
-using System.Xml.Serialization;\r
-using System.Globalization;\r
-using System.ComponentModel;\r
-using System.Runtime.InteropServices;\r
-\r
-namespace Crow\r
-{\r
- public class TextBox : Label\r
- {\r
- #region CTOR\r
- public TextBox(string _initialValue)\r
- : base(_initialValue)\r
- {\r
-\r
- }\r
-\r
- public TextBox()\r
- { }\r
- #endregion\r
-\r
- #region GraphicObject overrides\r
- [XmlIgnore]public override bool HasFocus //trigger update when lost focus to errase text beam\r
- {\r
- get\r
- {\r
- return base.HasFocus;\r
- }\r
- set\r
- {\r
- base.HasFocus = value;\r
- registerForGraphicUpdate();\r
- }\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("White")]\r
- public override Color Background {\r
- get { return base.Background; }\r
- set { base.Background = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue("Black")]\r
- public override Color Foreground {\r
- get { return base.Foreground; }\r
- set { base.Foreground = value; }\r
- }\r
-\r
- protected override void onDraw (Context gr)\r
- {\r
- base.onDraw (gr);\r
- FontExtents fe = gr.FontExtents;\r
- }\r
- #endregion\r
-\r
- public event EventHandler<TextChangeEventArgs> TextChanged;\r
-\r
- public virtual void OnTextChanged(Object sender, TextChangeEventArgs e)\r
- {\r
- TextChanged.Raise (this, e);\r
- }\r
- \r
- #region Keyboard handling\r
- public override void onKeyDown (object sender, KeyboardKeyEventArgs e)\r
- {\r
- base.onKeyDown (sender, e);\r
-\r
- Key key = e.Key;\r
-\r
- switch (key)\r
- {\r
- case Key.Back:\r
- if (!selectionIsEmpty)\r
- {\r
-// Text = Text.Remove(selectionStart, selectionEnd - selectionStart);\r
-// selReleasePos = -1;\r
-// currentCol = selBeginPos;\r
- }\r
- else \r
- this.DeleteChar();\r
- break;\r
- case Key.Clear:\r
- break;\r
- case Key.Delete:\r
- if (selectionIsEmpty)\r
- CurrentColumn++;\r
- this.DeleteChar ();\r
- break;\r
- case Key.Enter:\r
- case Key.KeypadEnter:\r
- OnTextChanged(this,new TextChangeEventArgs(Text));\r
- break;\r
- case Key.Escape:\r
- Text = "";\r
- CurrentColumn = 0;\r
- SelRelease = -1;\r
- break;\r
- case Key.Home:\r
- //TODO\r
- if (e.Control)\r
- CurrentLine = 0;\r
- CurrentColumn = 0;\r
- break;\r
- case Key.End:\r
- if (e.Control)\r
- CurrentLine = int.MaxValue;\r
- CurrentColumn = int.MaxValue;\r
- break;\r
- case Key.Insert:\r
- break;\r
- case Key.Left: \r
- CurrentColumn--;\r
- break;\r
- case Key.Right: \r
- CurrentColumn++;\r
- break;\r
- case Key.Up:\r
- CurrentLine--;\r
- break;\r
- case Key.Down:\r
- CurrentLine++;\r
- break;\r
- case Key.Menu:\r
- break;\r
- case Key.NumLock:\r
- break;\r
- case Key.PageDown:\r
- break;\r
- case Key.PageUp:\r
- break;\r
- case Key.RWin:\r
- break;\r
- case Key.Tab:\r
- this.Insert("\t");\r
- break;\r
- case Key.KeypadDecimal:\r
- this.Insert ("."); \r
- break;\r
- case Key.Space:\r
- this.Insert(" ");\r
- break;\r
- case Key.KeypadDivide:\r
- case Key.Slash:\r
- this.Insert("/");\r
- break;\r
- case Key.KeypadMultiply:\r
- this.Insert("*");\r
- break;\r
- case Key.KeypadMinus:\r
- case Key.Minus:\r
- this.Insert("-");\r
- break;\r
- case Key.KeypadPlus:\r
- case Key.Plus:\r
- this.Insert("+");\r
- break;\r
- case Key.ShiftLeft:\r
- case Key.ShiftRight:\r
- case Key.AltLeft:\r
- case Key.AltRight:\r
- break;\r
- case Key.Semicolon:\r
- this.Insert(";");\r
- break;\r
- default:\r
- if (!selectionIsEmpty)\r
- {\r
-// Text = Text.Remove(selectionStart, selectionEnd - selectionStart);\r
-// currentCol = selBeginPos;\r
- }\r
-\r
- string k = "?";\r
- if ((char)key >= 67 && (char)key <= 76)\r
- k = ((int)key - 67).ToString();\r
- else if ((char)key >= 109 && (char)key <= 118)\r
- k = ((int)key - 109).ToString();\r
- else if (e.Shift)\r
- k = key.ToString();\r
- else\r
- k = key.ToString().ToLower();\r
-\r
- this.Insert (k);\r
-\r
- SelRelease = -1;\r
- SelBegin = new Point(CurrentColumn, SelBegin.Y);\r
-\r
- break;\r
- }\r
- registerForGraphicUpdate();\r
- }\r
- #endregion\r
- } \r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OpenTK.Input;
+using Cairo;
+using System.Diagnostics;
+using System.Xml.Serialization;
+using System.Globalization;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+
+namespace Crow
+{
+ public class TextBox : Label
+ {
+ #region CTOR
+ public TextBox(string _initialValue)
+ : base(_initialValue)
+ {
+
+ }
+
+ public TextBox()
+ { }
+ #endregion
+
+ #region GraphicObject overrides
+ [XmlIgnore]public override bool HasFocus //trigger update when lost focus to errase text beam
+ {
+ get
+ {
+ return base.HasFocus;
+ }
+ set
+ {
+ base.HasFocus = value;
+ registerForGraphicUpdate();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(true)]
+ public override bool Focusable
+ {
+ get { return base.Focusable; }
+ set { base.Focusable = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue("White")]
+ public override Color Background {
+ get { return base.Background; }
+ set { base.Background = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue("Black")]
+ public override Color Foreground {
+ get { return base.Foreground; }
+ set { base.Foreground = value; }
+ }
+
+ protected override void onDraw (Context gr)
+ {
+ base.onDraw (gr);
+ FontExtents fe = gr.FontExtents;
+ }
+ #endregion
+
+ public event EventHandler<TextChangeEventArgs> TextChanged;
+
+ public virtual void OnTextChanged(Object sender, TextChangeEventArgs e)
+ {
+ TextChanged.Raise (this, e);
+ }
+
+ #region Keyboard handling
+ public override void onKeyDown (object sender, KeyboardKeyEventArgs e)
+ {
+ base.onKeyDown (sender, e);
+
+ Key key = e.Key;
+
+ switch (key)
+ {
+ case Key.Back:
+ if (!selectionIsEmpty)
+ {
+// Text = Text.Remove(selectionStart, selectionEnd - selectionStart);
+// selReleasePos = -1;
+// currentCol = selBeginPos;
+ }
+ else
+ this.DeleteChar();
+ break;
+ case Key.Clear:
+ break;
+ case Key.Delete:
+ if (selectionIsEmpty)
+ CurrentColumn++;
+ this.DeleteChar ();
+ break;
+ case Key.Enter:
+ case Key.KeypadEnter:
+ OnTextChanged(this,new TextChangeEventArgs(Text));
+ break;
+ case Key.Escape:
+ Text = "";
+ CurrentColumn = 0;
+ SelRelease = -1;
+ break;
+ case Key.Home:
+ //TODO
+ if (e.Control)
+ CurrentLine = 0;
+ CurrentColumn = 0;
+ break;
+ case Key.End:
+ if (e.Control)
+ CurrentLine = int.MaxValue;
+ CurrentColumn = int.MaxValue;
+ break;
+ case Key.Insert:
+ break;
+ case Key.Left:
+ CurrentColumn--;
+ break;
+ case Key.Right:
+ CurrentColumn++;
+ break;
+ case Key.Up:
+ CurrentLine--;
+ break;
+ case Key.Down:
+ CurrentLine++;
+ break;
+ case Key.Menu:
+ break;
+ case Key.NumLock:
+ break;
+ case Key.PageDown:
+ break;
+ case Key.PageUp:
+ break;
+ case Key.RWin:
+ break;
+ case Key.Tab:
+ this.Insert("\t");
+ break;
+ case Key.KeypadDecimal:
+ this.Insert (".");
+ break;
+ case Key.Space:
+ this.Insert(" ");
+ break;
+ case Key.KeypadDivide:
+ case Key.Slash:
+ this.Insert("/");
+ break;
+ case Key.KeypadMultiply:
+ this.Insert("*");
+ break;
+ case Key.KeypadMinus:
+ case Key.Minus:
+ this.Insert("-");
+ break;
+ case Key.KeypadPlus:
+ case Key.Plus:
+ this.Insert("+");
+ break;
+ case Key.ShiftLeft:
+ case Key.ShiftRight:
+ case Key.AltLeft:
+ case Key.AltRight:
+ break;
+ case Key.Semicolon:
+ this.Insert(";");
+ break;
+ default:
+ if (!selectionIsEmpty)
+ {
+// Text = Text.Remove(selectionStart, selectionEnd - selectionStart);
+// currentCol = selBeginPos;
+ }
+
+ string k = "?";
+ if ((char)key >= 67 && (char)key <= 76)
+ k = ((int)key - 67).ToString();
+ else if ((char)key >= 109 && (char)key <= 118)
+ k = ((int)key - 109).ToString();
+ else if (e.Shift)
+ k = key.ToString();
+ else
+ k = key.ToString().ToLower();
+
+ this.Insert (k);
+
+ SelRelease = -1;
+ SelBegin = new Point(CurrentColumn, SelBegin.Y);
+
+ break;
+ }
+ registerForGraphicUpdate();
+ }
+ #endregion
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Diagnostics;\r
-using Cairo;\r
-using System.Text.RegularExpressions;\r
-using System.Xml.Serialization;\r
-using System.ComponentModel;\r
-using OpenTK.Input;\r
-\r
-namespace Crow\r
-{\r
- [Serializable]\r
- public class TextRun : GraphicObject\r
- {\r
- #region CTOR\r
- public TextRun()\r
- { \r
-\r
- }\r
- public TextRun(string _text)\r
- : base()\r
- {\r
- Text = _text;\r
- }\r
- #endregion\r
-\r
- //TODO:change protected to private\r
- \r
- #region private and protected fields\r
- protected string _text = "label";\r
- Alignment _textAlignment = Alignment.LeftCenter; \r
- bool _multiline;\r
- bool wordWrap;\r
- protected Rectangle rText;\r
- protected float widthRatio = 1f;\r
- protected float heightRatio = 1f;\r
- protected FontExtents fe;\r
- protected TextExtents te;\r
- #endregion\r
-\r
-\r
- [XmlAttributeAttribute()][DefaultValue(Alignment.LeftCenter)]\r
- public Alignment TextAlignment\r
- {\r
- get { return _textAlignment; }\r
- set { _textAlignment = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue("label")]\r
- public string Text\r
- {\r
- get { \r
- return lines == null ? \r
- _text : lines.Aggregate((i, j) => i + Interface.LineBreak + j);\r
- }\r
- set\r
- {\r
- if (_text == value)\r
- return;\r
- \r
- registerForGraphicUpdate();\r
- this.RegisterForLayouting ((int)LayoutingType.Sizing);\r
-\r
-\r
- _text = value;\r
-\r
- if (string.IsNullOrEmpty(_text))\r
- _text = "";\r
-\r
- lines = getLines;\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(false)]\r
- public bool Multiline\r
- {\r
- get { return _multiline; }\r
- set\r
- {\r
- _multiline = value;\r
- registerForGraphicUpdate();\r
- }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(false)]\r
- public bool WordWrap {\r
- get {\r
- return wordWrap;\r
- }\r
- set {\r
- if (wordWrap == value)\r
- return;\r
- wordWrap = value;\r
- registerForGraphicUpdate();\r
- }\r
- }\r
-\r
- List<string> lines;\r
- List<string> getLines {\r
- get { \r
- return _multiline ?\r
- Regex.Split (_text, "\r\n|\r|\n").ToList() :\r
- new List<string>(new string[] { _text });\r
- }\r
- }\r
-\r
- #region GraphicObject overrides\r
- [XmlAttributeAttribute()][DefaultValue(-1)]\r
- public override int Width {\r
- get { return base.Width; }\r
- set { base.Width = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(-1)]\r
- public override int Height {\r
- get { return base.Height; }\r
- set { base.Height = value; }\r
- }\r
- [XmlAttributeAttribute()][DefaultValue(2)]\r
- public override int Margin {\r
- get { return base.Margin; }\r
- set { base.Margin = value; }\r
- }\r
-\r
- protected override Size measureRawSize()\r
- {\r
- Size size;\r
-\r
- if (lines == null)\r
- lines = getLines;\r
- \r
- using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) {\r
- using (Context gr = new Context (img)) {\r
- //Cairo.FontFace cf = gr.GetContextFontFace ();\r
-\r
- gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);\r
- gr.SetFontSize (Font.Size);\r
-\r
- te = new TextExtents();\r
-\r
- foreach (string s in lines) {\r
- string l = s.Replace("\t", new String (' ', Interface.TabSize));\r
-\r
-#if _WIN32 || _WIN64\r
- TextExtents tmp = gr.TextExtents(str.ToUtf8());\r
-#elif __linux__\r
- TextExtents tmp = gr.TextExtents (l);\r
-#endif\r
- if (tmp.XAdvance > te.XAdvance)\r
- te = tmp;\r
- }\r
- fe = gr.FontExtents;\r
- int lc = lines.Count;\r
- //ensure minimal height = text line height\r
- if (lc == 0)\r
- lc = 1; \r
- size = new Size ((int)Math.Ceiling (te.XAdvance) + Margin * 2, (int)(fe.Height * lc) + Margin*2);\r
- }\r
- }\r
-\r
- return size;;\r
- }\r
- protected override void onDraw (Context gr)\r
- {\r
- base.onDraw (gr);\r
-\r
- gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);\r
- gr.SetFontSize (Font.Size);\r
-\r
- gr.Antialias = Antialias.Subpixel;\r
- //gr.FontOptions.Antialias = Antialias.Subpixel;\r
- //gr.FontOptions.HintMetrics = HintMetrics.On;\r
-\r
- rText = new Rectangle(measureRawSize());\r
- rText.Width -= 2 * Margin;\r
- rText.Height -= 2 * Margin;\r
-\r
- widthRatio = 1f;\r
- heightRatio = 1f;\r
-\r
- Rectangle cb = ClientRectangle;\r
-\r
- //ignore text alignment if size to content = true\r
- //or if text size is larger than client bounds\r
- if (Bounds.Size < 0 || rText.Width > cb.Width)\r
- {\r
- rText.X = cb.X;\r
- rText.Y = cb.Y;\r
- }else {\r
- \r
- switch (TextAlignment)\r
- {\r
- case Alignment.None:\r
- break;\r
- case Alignment.TopLeft: //ok\r
- rText.X = cb.X;\r
- rText.Y = cb.Y;\r
- break;\r
- case Alignment.TopCenter: //ok\r
- rText.Y = cb.Y;\r
- rText.X = cb.X + cb.Width / 2 - rText.Width / 2;\r
- break;\r
- case Alignment.TopRight: //ok\r
- rText.X = cb.Right - rText.Width;\r
- rText.Y = cb.Y;\r
- break;\r
- case Alignment.TopStretch://ok\r
- heightRatio = widthRatio = (float)cb.Width / rText.Width;\r
- rText.X = cb.X;\r
- rText.Y = cb.Y;\r
- rText.Width = cb.Width;\r
- rText.Height = (int)(rText.Height * heightRatio);\r
- break;\r
- case Alignment.LeftCenter://ok\r
- rText.X = cb.X;\r
- rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;\r
- break;\r
- case Alignment.LeftStretch://ok\r
- heightRatio = widthRatio = (float)cb.Height / rText.Height;\r
- rText.X = cb.X;\r
- rText.Y = cb.Y;\r
- rText.Height = cb.Height;\r
- rText.Width = (int)(widthRatio * cb.Width);\r
- break;\r
- case Alignment.RightCenter://ok\r
- rText.X = cb.X + cb.Width - rText.Width;\r
- rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;\r
- break;\r
- case Alignment.RightStretch://ok\r
- heightRatio = widthRatio = (float)cb.Height / rText.Height;\r
- rText.Height = cb.Height;\r
- rText.Width = (int)(widthRatio * cb.Width);\r
- rText.X = cb.X;\r
- rText.Y = cb.Y;\r
- break;\r
- case Alignment.BottomCenter://ok\r
- rText.X = cb.Width / 2 - rText.Width / 2;\r
- rText.Y = cb.Height - rText.Height;\r
- break;\r
- case Alignment.BottomStretch://ok\r
- heightRatio = widthRatio = (float)cb.Width / rText.Width;\r
- rText.Width = cb.Width;\r
- rText.Height = (int)(rText.Height * heightRatio);\r
- rText.Y = cb.Bottom - rText.Height;\r
- rText.X = cb.X;\r
- break;\r
- case Alignment.BottomLeft://ok\r
- rText.X = cb.X;\r
- rText.Y = cb.Bottom - rText.Height;\r
- break;\r
- case Alignment.BottomRight://ok\r
- rText.Y = cb.Bottom - rText.Height;\r
- rText.X = cb.Right - rText.Width;\r
- break;\r
- case Alignment.Center://ok\r
- rText.X = cb.X + cb.Width / 2 - rText.Width / 2;\r
- rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;\r
- break;\r
- case Alignment.Fit://ok, peut être mieu aligné \r
- widthRatio = (float)cb.Width / rText.Width;\r
- heightRatio = (float)cb.Height / rText.Height;\r
- rText = cb;\r
- break;\r
- case Alignment.HorizontalStretch://ok\r
- heightRatio = widthRatio = (float)cb.Width / rText.Width;\r
- rText.Width = cb.Width;\r
- rText.Height = (int)(heightRatio * rText.Height);\r
- rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;\r
- rText.X = cb.X;\r
- break;\r
- case Alignment.VerticalStretch://ok\r
- heightRatio = widthRatio = (float)cb.Height / rText.Height;\r
- rText.Height = cb.Height;\r
- rText.Width = (int)(widthRatio * rText.Width);\r
- rText.X = cb.X + cb.Width / 2 - rText.Width / 2;\r
- rText.Y = cb.Y;\r
- break;\r
- default:\r
- break;\r
- }\r
- }\r
-\r
- gr.FontMatrix = new Matrix(widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0);\r
-\r
-\r
- int curLineCount = 0;\r
- for (int i = 0;i < lines.Count;i++) { \r
- string l = lines [i].Replace ("\t", new String (' ', Interface.TabSize));\r
- List<string> wl = new List<string> ();\r
- int lineLength = (int)gr.TextExtents (l).XAdvance;\r
-\r
- if (wordWrap && lineLength > cb.Width) {\r
- string tmpLine = "";\r
- int curChar = 0;\r
- while (curChar < l.Length) {\r
- tmpLine += l [curChar];\r
- if ((int)gr.TextExtents (tmpLine).XAdvance > cb.Width) {\r
- tmpLine = tmpLine.Remove (tmpLine.Length - 1);\r
- wl.Add (tmpLine);\r
- tmpLine = "";\r
- continue;\r
- }\r
- curChar++;\r
- }\r
- wl.Add (tmpLine);\r
- } else\r
- wl.Add (l);\r
-\r
- foreach (string ll in wl) {\r
- lineLength = (int)gr.TextExtents (ll).XAdvance;\r
- \r
-\r
- if (string.IsNullOrWhiteSpace (ll)) {\r
- curLineCount++;\r
- continue;\r
- }\r
-\r
- gr.SetSourceColor (Foreground); \r
- gr.MoveTo (rText.X, rText.Y + fe.Ascent + fe.Height * curLineCount);\r
-\r
- #if _WIN32 || _WIN64\r
- gr.ShowText(ll.ToUtf8());\r
- #elif __linux__\r
- gr.ShowText (ll);\r
- #endif\r
- gr.Fill ();\r
-\r
- curLineCount++;\r
- \r
- }\r
- } \r
- }\r
- #endregion\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Diagnostics;
+using Cairo;
+using System.Text.RegularExpressions;
+using System.Xml.Serialization;
+using System.ComponentModel;
+using OpenTK.Input;
+
+namespace Crow
+{
+ [Serializable]
+ public class TextRun : GraphicObject
+ {
+ #region CTOR
+ public TextRun()
+ {
+
+ }
+ public TextRun(string _text)
+ : base()
+ {
+ Text = _text;
+ }
+ #endregion
+
+ //TODO:change protected to private
+
+ #region private and protected fields
+ protected string _text = "label";
+ Alignment _textAlignment = Alignment.LeftCenter;
+ bool _multiline;
+ bool wordWrap;
+ protected Rectangle rText;
+ protected float widthRatio = 1f;
+ protected float heightRatio = 1f;
+ protected FontExtents fe;
+ protected TextExtents te;
+ #endregion
+
+
+ [XmlAttributeAttribute()][DefaultValue(Alignment.LeftCenter)]
+ public Alignment TextAlignment
+ {
+ get { return _textAlignment; }
+ set { _textAlignment = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue("label")]
+ public string Text
+ {
+ get {
+ return lines == null ?
+ _text : lines.Aggregate((i, j) => i + Interface.LineBreak + j);
+ }
+ set
+ {
+ if (_text == value)
+ return;
+
+ registerForGraphicUpdate();
+ this.RegisterForLayouting ((int)LayoutingType.Sizing);
+
+
+ _text = value;
+
+ if (string.IsNullOrEmpty(_text))
+ _text = "";
+
+ lines = getLines;
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public bool Multiline
+ {
+ get { return _multiline; }
+ set
+ {
+ _multiline = value;
+ registerForGraphicUpdate();
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public bool WordWrap {
+ get {
+ return wordWrap;
+ }
+ set {
+ if (wordWrap == value)
+ return;
+ wordWrap = value;
+ registerForGraphicUpdate();
+ }
+ }
+
+ List<string> lines;
+ List<string> getLines {
+ get {
+ return _multiline ?
+ Regex.Split (_text, "\r\n|\r|\n").ToList() :
+ new List<string>(new string[] { _text });
+ }
+ }
+
+ #region GraphicObject overrides
+ [XmlAttributeAttribute()][DefaultValue(-1)]
+ public override int Width {
+ get { return base.Width; }
+ set { base.Width = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue(-1)]
+ public override int Height {
+ get { return base.Height; }
+ set { base.Height = value; }
+ }
+ [XmlAttributeAttribute()][DefaultValue(2)]
+ public override int Margin {
+ get { return base.Margin; }
+ set { base.Margin = value; }
+ }
+
+ protected override Size measureRawSize()
+ {
+ Size size;
+
+ if (lines == null)
+ lines = getLines;
+
+ using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) {
+ using (Context gr = new Context (img)) {
+ //Cairo.FontFace cf = gr.GetContextFontFace ();
+
+ gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
+ gr.SetFontSize (Font.Size);
+
+ te = new TextExtents();
+
+ foreach (string s in lines) {
+ string l = s.Replace("\t", new String (' ', Interface.TabSize));
+
+#if _WIN32 || _WIN64
+ TextExtents tmp = gr.TextExtents(str.ToUtf8());
+#elif __linux__
+ TextExtents tmp = gr.TextExtents (l);
+#endif
+ if (tmp.XAdvance > te.XAdvance)
+ te = tmp;
+ }
+ fe = gr.FontExtents;
+ int lc = lines.Count;
+ //ensure minimal height = text line height
+ if (lc == 0)
+ lc = 1;
+ size = new Size ((int)Math.Ceiling (te.XAdvance) + Margin * 2, (int)(fe.Height * lc) + Margin*2);
+ }
+ }
+
+ return size;;
+ }
+ protected override void onDraw (Context gr)
+ {
+ base.onDraw (gr);
+
+ gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
+ gr.SetFontSize (Font.Size);
+
+ gr.Antialias = Antialias.Subpixel;
+ //gr.FontOptions.Antialias = Antialias.Subpixel;
+ //gr.FontOptions.HintMetrics = HintMetrics.On;
+
+ rText = new Rectangle(measureRawSize());
+ rText.Width -= 2 * Margin;
+ rText.Height -= 2 * Margin;
+
+ widthRatio = 1f;
+ heightRatio = 1f;
+
+ Rectangle cb = ClientRectangle;
+
+ //ignore text alignment if size to content = true
+ //or if text size is larger than client bounds
+ if (Bounds.Size < 0 || rText.Width > cb.Width)
+ {
+ rText.X = cb.X;
+ rText.Y = cb.Y;
+ }else {
+
+ switch (TextAlignment)
+ {
+ case Alignment.None:
+ break;
+ case Alignment.TopLeft: //ok
+ rText.X = cb.X;
+ rText.Y = cb.Y;
+ break;
+ case Alignment.TopCenter: //ok
+ rText.Y = cb.Y;
+ rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
+ break;
+ case Alignment.TopRight: //ok
+ rText.X = cb.Right - rText.Width;
+ rText.Y = cb.Y;
+ break;
+ case Alignment.TopStretch://ok
+ heightRatio = widthRatio = (float)cb.Width / rText.Width;
+ rText.X = cb.X;
+ rText.Y = cb.Y;
+ rText.Width = cb.Width;
+ rText.Height = (int)(rText.Height * heightRatio);
+ break;
+ case Alignment.LeftCenter://ok
+ rText.X = cb.X;
+ rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
+ break;
+ case Alignment.LeftStretch://ok
+ heightRatio = widthRatio = (float)cb.Height / rText.Height;
+ rText.X = cb.X;
+ rText.Y = cb.Y;
+ rText.Height = cb.Height;
+ rText.Width = (int)(widthRatio * cb.Width);
+ break;
+ case Alignment.RightCenter://ok
+ rText.X = cb.X + cb.Width - rText.Width;
+ rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
+ break;
+ case Alignment.RightStretch://ok
+ heightRatio = widthRatio = (float)cb.Height / rText.Height;
+ rText.Height = cb.Height;
+ rText.Width = (int)(widthRatio * cb.Width);
+ rText.X = cb.X;
+ rText.Y = cb.Y;
+ break;
+ case Alignment.BottomCenter://ok
+ rText.X = cb.Width / 2 - rText.Width / 2;
+ rText.Y = cb.Height - rText.Height;
+ break;
+ case Alignment.BottomStretch://ok
+ heightRatio = widthRatio = (float)cb.Width / rText.Width;
+ rText.Width = cb.Width;
+ rText.Height = (int)(rText.Height * heightRatio);
+ rText.Y = cb.Bottom - rText.Height;
+ rText.X = cb.X;
+ break;
+ case Alignment.BottomLeft://ok
+ rText.X = cb.X;
+ rText.Y = cb.Bottom - rText.Height;
+ break;
+ case Alignment.BottomRight://ok
+ rText.Y = cb.Bottom - rText.Height;
+ rText.X = cb.Right - rText.Width;
+ break;
+ case Alignment.Center://ok
+ rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
+ rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
+ break;
+ case Alignment.Fit://ok, peut être mieu aligné
+ widthRatio = (float)cb.Width / rText.Width;
+ heightRatio = (float)cb.Height / rText.Height;
+ rText = cb;
+ break;
+ case Alignment.HorizontalStretch://ok
+ heightRatio = widthRatio = (float)cb.Width / rText.Width;
+ rText.Width = cb.Width;
+ rText.Height = (int)(heightRatio * rText.Height);
+ rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
+ rText.X = cb.X;
+ break;
+ case Alignment.VerticalStretch://ok
+ heightRatio = widthRatio = (float)cb.Height / rText.Height;
+ rText.Height = cb.Height;
+ rText.Width = (int)(widthRatio * rText.Width);
+ rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
+ rText.Y = cb.Y;
+ break;
+ default:
+ break;
+ }
+ }
+
+ gr.FontMatrix = new Matrix(widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0);
+
+
+ int curLineCount = 0;
+ for (int i = 0;i < lines.Count;i++) {
+ string l = lines [i].Replace ("\t", new String (' ', Interface.TabSize));
+ List<string> wl = new List<string> ();
+ int lineLength = (int)gr.TextExtents (l).XAdvance;
+
+ if (wordWrap && lineLength > cb.Width) {
+ string tmpLine = "";
+ int curChar = 0;
+ while (curChar < l.Length) {
+ tmpLine += l [curChar];
+ if ((int)gr.TextExtents (tmpLine).XAdvance > cb.Width) {
+ tmpLine = tmpLine.Remove (tmpLine.Length - 1);
+ wl.Add (tmpLine);
+ tmpLine = "";
+ continue;
+ }
+ curChar++;
+ }
+ wl.Add (tmpLine);
+ } else
+ wl.Add (l);
+
+ foreach (string ll in wl) {
+ lineLength = (int)gr.TextExtents (ll).XAdvance;
+
+
+ if (string.IsNullOrWhiteSpace (ll)) {
+ curLineCount++;
+ continue;
+ }
+
+ gr.SetSourceColor (Foreground);
+ gr.MoveTo (rText.X, rText.Y + fe.Ascent + fe.Height * curLineCount);
+
+ #if _WIN32 || _WIN64
+ gr.ShowText(ll.ToUtf8());
+ #elif __linux__
+ gr.ShowText (ll);
+ #endif
+ gr.Fill ();
+
+ curLineCount++;
+
+ }
+ }
+ }
+ #endregion
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace Crow\r
-{\r
- public class VerticalStack : GenericStack\r
- {\r
- public VerticalStack()\r
- : base()\r
- {\r
- Orientation = Crow.Orientation.Vertical;\r
- }\r
-\r
- [System.Xml.Serialization.XmlIgnore]\r
- public override Orientation Orientation\r
- {\r
- get { return Orientation.Vertical; }\r
- //set { }\r
- }\r
-\r
-\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Crow
+{
+ public class VerticalStack : GenericStack
+ {
+ public VerticalStack()
+ : base()
+ {
+ Orientation = Crow.Orientation.Vertical;
+ }
+
+ [System.Xml.Serialization.XmlIgnore]
+ public override Orientation Orientation
+ {
+ get { return Orientation.Vertical; }
+ //set { }
+ }
+
+
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Drawing;\r
-using OpenTK.Graphics.OpenGL;\r
-using System.Diagnostics;\r
-\r
-namespace go\r
-{\r
- public class WrappedWidgetGroup : Group\r
- {\r
-\r
- public int widgetSpacing = 2;\r
-\r
- public Orientation Orientation = Orientation.Horizontal;\r
-\r
-\r
- public WrappedWidgetGroup()\r
- : base()\r
- {\r
- BorderWidth = 0;\r
- }\r
-\r
- int currentXForWidget = 0;\r
- int currentYForWidget = 0;\r
-\r
- int highestWidget = 0;\r
- int largestWidget = 0;\r
-\r
-\r
- public override void UpdateLayout()\r
- {\r
- //while (!layoutIsValid)\r
- //{\r
- //if (!(sizeIsValid && positionIsValid))\r
- base.UpdateLayout();\r
-\r
- //if (!base.layoutIsValid)\r
- // return;\r
-\r
- currentXForWidget = ClientRectangle.X;\r
- currentYForWidget = ClientRectangle.Y;\r
-\r
- highestWidget = 0;\r
- largestWidget = 0;\r
-\r
- Rectangle contentBounds = Rectangle.Zero;\r
-\r
- GraphicObject[] widgets = new GraphicObject[Children.Count];\r
- Children.CopyTo(widgets);\r
- foreach (GraphicObject w in widgets)\r
- {\r
- if (w.renderBounds.Width > largestWidget)\r
- largestWidget = w.renderBounds.Width;\r
- if (w.renderBounds.Height > highestWidget)\r
- highestWidget = w.renderBounds.Height;\r
-\r
- if (!enoughtSpaceForWidget(w))\r
- advance(w);\r
-\r
- if (enoughtSpaceForWidget(w))\r
- {\r
- w.renderBounds.X = currentXForWidget;\r
- w.renderBounds.Y = currentYForWidget;\r
-\r
- w.positionIsValid = true;\r
-\r
- contentBounds += w.renderBounds;\r
-\r
- advance(w);\r
- }\r
- else\r
- break;\r
- }\r
-\r
- contentBounds.Width += BorderWidth + Margin;\r
- contentBounds.Height += BorderWidth + Margin;\r
-\r
- if (SizeToContent)\r
- renderBounds.Size = contentBounds.Size;\r
- else if (VerticalScrolling)\r
- renderBounds.Size = new Size(renderBounds.Size.Width, contentBounds.Size.Height);\r
- else if (HorizontalScrolling)\r
- renderBounds.Size = new Size(contentBounds.Size.Width, renderBounds.Size.Height);\r
-\r
- if (layoutIsValid)\r
- registerForRedraw();\r
- }\r
-\r
-\r
- bool enoughtSpaceForWidget(GraphicObject w)\r
- {\r
- int nextXForWidget = 0;\r
- int nextYForWidget = 0;\r
-\r
- if (Orientation == Orientation.Horizontal)\r
- nextXForWidget = currentXForWidget + w.renderBounds.Width;\r
- else\r
- nextYForWidget = nextYForWidget + w.renderBounds.Height;\r
-\r
- if (!SizeToContent)\r
- {\r
- if (nextXForWidget > ClientRectangle.Right && !HorizontalScrolling)\r
- return false;\r
- if (currentYForWidget > ClientRectangle.Bottom && !VerticalScrolling)\r
- return false;\r
- }\r
- return true;\r
- }\r
- void advance(GraphicObject w)\r
- {\r
- if (Orientation == Orientation.Horizontal)\r
- {\r
- //if (w is LabelWidget)\r
- // Debugger.Break();\r
- currentXForWidget = currentXForWidget + widgetSpacing + w.renderBounds.Width;\r
- }\r
- else\r
- currentYForWidget = currentYForWidget + widgetSpacing + w.renderBounds.Height;\r
-\r
- if (!SizeToContent)\r
- {\r
- if (currentXForWidget > ClientRectangle.Right && !HorizontalScrolling)\r
- {\r
- if (Orientation == Orientation.Vertical)\r
- {\r
- //not scrolling\r
- }\r
- else\r
- {\r
- currentXForWidget = ClientRectangle.X;\r
- currentYForWidget += widgetSpacing + highestWidget;\r
- highestWidget = 0;\r
- }\r
- }\r
- if (currentYForWidget > ClientRectangle.Bottom && !VerticalScrolling)\r
- {\r
- if (Orientation == Orientation.Horizontal)\r
- {\r
- //not scrolling\r
- }\r
- else\r
- {\r
- currentXForWidget += widgetSpacing + largestWidget;\r
- currentYForWidget = ClientRectangle.Y;\r
- largestWidget = 0;\r
- }\r
-\r
- }\r
- }\r
- }\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using OpenTK.Graphics.OpenGL;
+using System.Diagnostics;
+
+namespace go
+{
+ public class WrappedWidgetGroup : Group
+ {
+
+ public int widgetSpacing = 2;
+
+ public Orientation Orientation = Orientation.Horizontal;
+
+
+ public WrappedWidgetGroup()
+ : base()
+ {
+ BorderWidth = 0;
+ }
+
+ int currentXForWidget = 0;
+ int currentYForWidget = 0;
+
+ int highestWidget = 0;
+ int largestWidget = 0;
+
+
+ public override void UpdateLayout()
+ {
+ //while (!layoutIsValid)
+ //{
+ //if (!(sizeIsValid && positionIsValid))
+ base.UpdateLayout();
+
+ //if (!base.layoutIsValid)
+ // return;
+
+ currentXForWidget = ClientRectangle.X;
+ currentYForWidget = ClientRectangle.Y;
+
+ highestWidget = 0;
+ largestWidget = 0;
+
+ Rectangle contentBounds = Rectangle.Zero;
+
+ GraphicObject[] widgets = new GraphicObject[Children.Count];
+ Children.CopyTo(widgets);
+ foreach (GraphicObject w in widgets)
+ {
+ if (w.renderBounds.Width > largestWidget)
+ largestWidget = w.renderBounds.Width;
+ if (w.renderBounds.Height > highestWidget)
+ highestWidget = w.renderBounds.Height;
+
+ if (!enoughtSpaceForWidget(w))
+ advance(w);
+
+ if (enoughtSpaceForWidget(w))
+ {
+ w.renderBounds.X = currentXForWidget;
+ w.renderBounds.Y = currentYForWidget;
+
+ w.positionIsValid = true;
+
+ contentBounds += w.renderBounds;
+
+ advance(w);
+ }
+ else
+ break;
+ }
+
+ contentBounds.Width += BorderWidth + Margin;
+ contentBounds.Height += BorderWidth + Margin;
+
+ if (SizeToContent)
+ renderBounds.Size = contentBounds.Size;
+ else if (VerticalScrolling)
+ renderBounds.Size = new Size(renderBounds.Size.Width, contentBounds.Size.Height);
+ else if (HorizontalScrolling)
+ renderBounds.Size = new Size(contentBounds.Size.Width, renderBounds.Size.Height);
+
+ if (layoutIsValid)
+ registerForRedraw();
+ }
+
+
+ bool enoughtSpaceForWidget(GraphicObject w)
+ {
+ int nextXForWidget = 0;
+ int nextYForWidget = 0;
+
+ if (Orientation == Orientation.Horizontal)
+ nextXForWidget = currentXForWidget + w.renderBounds.Width;
+ else
+ nextYForWidget = nextYForWidget + w.renderBounds.Height;
+
+ if (!SizeToContent)
+ {
+ if (nextXForWidget > ClientRectangle.Right && !HorizontalScrolling)
+ return false;
+ if (currentYForWidget > ClientRectangle.Bottom && !VerticalScrolling)
+ return false;
+ }
+ return true;
+ }
+ void advance(GraphicObject w)
+ {
+ if (Orientation == Orientation.Horizontal)
+ {
+ //if (w is LabelWidget)
+ // Debugger.Break();
+ currentXForWidget = currentXForWidget + widgetSpacing + w.renderBounds.Width;
+ }
+ else
+ currentYForWidget = currentYForWidget + widgetSpacing + w.renderBounds.Height;
+
+ if (!SizeToContent)
+ {
+ if (currentXForWidget > ClientRectangle.Right && !HorizontalScrolling)
+ {
+ if (Orientation == Orientation.Vertical)
+ {
+ //not scrolling
+ }
+ else
+ {
+ currentXForWidget = ClientRectangle.X;
+ currentYForWidget += widgetSpacing + highestWidget;
+ highestWidget = 0;
+ }
+ }
+ if (currentYForWidget > ClientRectangle.Bottom && !VerticalScrolling)
+ {
+ if (Orientation == Orientation.Horizontal)
+ {
+ //not scrolling
+ }
+ else
+ {
+ currentXForWidget += widgetSpacing + largestWidget;
+ currentYForWidget = ClientRectangle.Y;
+ largestWidget = 0;
+ }
+
+ }
+ }
+ }
+ }
+}
-// Released to the public domain. Use, modify and relicense at will.\r
-using System;\r
-using System.Collections.Generic;\r
-using System.Diagnostics;\r
-using System.Drawing.Imaging;\r
-using System.IO;\r
-using System.Linq;\r
-using System.Threading;\r
-using System.Xml;\r
-using Cairo;\r
-using OpenTK;\r
-using OpenTK.Graphics.OpenGL;\r
-using OpenTK.Input;\r
-\r
-\r
-\r
-namespace Crow\r
-{\r
- public class OpenTKGameWindow : GameWindow, ILayoutable, IGOLibHost\r
- {\r
- #region ctor\r
-// public OpenTKGameWindow(int _width, int _height, string _title="golib")\r
-// : base(_width, _height, new OpenTK.Graphics.GraphicsMode(32, 24, 0, 1), _title,\r
-// GameWindowFlags.Fullscreen,\r
-// DisplayDevice.Default,\r
-// 3,0,OpenTK.Graphics.GraphicsContextFlags.Default)\r
- public OpenTKGameWindow(int _width, int _height, string _title="Crow")\r
- : base(_width, _height, new OpenTK.Graphics.GraphicsMode(32, 24, 0, 1), \r
- _title,GameWindowFlags.Default,DisplayDevice.GetDisplay(DisplayIndex.Second),\r
- 3,3,OpenTK.Graphics.GraphicsContextFlags.Debug)\r
-// public OpenTKGameWindow(int _width, int _height, string _title="golib")\r
-// : base(_width, _height, new OpenTK.Graphics.GraphicsMode(32, 24, 0, 8), _title)\r
- {\r
- //VSync = VSyncMode.On;\r
- currentWindow = this;\r
- //Load cursors\r
- XCursor.Cross = XCursorFile.Load("#Crow.Images.Icons.Cursors.cross").Cursors[0];\r
- XCursor.Default = XCursorFile.Load("#Crow.Images.Icons.Cursors.arrow").Cursors[0];\r
- XCursor.NW = XCursorFile.Load("#Crow.Images.Icons.Cursors.top_left_corner").Cursors[0];\r
- XCursor.NE = XCursorFile.Load("#Crow.Images.Icons.Cursors.top_right_corner").Cursors[0];\r
- XCursor.SW = XCursorFile.Load("#Crow.Images.Icons.Cursors.bottom_left_corner").Cursors[0];\r
- XCursor.SE = XCursorFile.Load("#Crow.Images.Icons.Cursors.bottom_right_corner").Cursors[0];\r
- XCursor.H = XCursorFile.Load("#Crow.Images.Icons.Cursors.sb_h_double_arrow").Cursors[0];\r
- XCursor.V = XCursorFile.Load("#Crow.Images.Icons.Cursors.sb_v_double_arrow").Cursors[0];\r
- } \r
- #endregion\r
-\r
- public List<GraphicObject> GraphicObjects = new List<GraphicObject>();\r
- public Color Background = Color.Transparent;\r
-\r
- internal static OpenTKGameWindow currentWindow;\r
-\r
- Rectangles _redrawClip = new Rectangles();//should find another way to access it from child\r
- List<GraphicObject> _gobjsToRedraw = new List<GraphicObject>();\r
-\r
- #region IGOLibHost implementation\r
- public Rectangles redrawClip {\r
- get {\r
- return _redrawClip;\r
- }\r
- set {\r
- _redrawClip = value;\r
- }\r
- }\r
-\r
- public List<GraphicObject> gobjsToRedraw {\r
- get {\r
- return _gobjsToRedraw;\r
- }\r
- set {\r
- _gobjsToRedraw = value;\r
- }\r
- }\r
- public void AddWidget(GraphicObject g)\r
- {\r
- g.Parent = this;\r
- GraphicObjects.Insert (0, g);\r
-\r
- g.RegisterForLayouting ((int)LayoutingType.Sizing);\r
- }\r
- public void DeleteWidget(GraphicObject g)\r
- {\r
- g.Visible = false;//trick to ensure clip is added to refresh zone\r
- g.ClearBinding();\r
- GraphicObjects.Remove (g);\r
- }\r
- public void PutOnTop(GraphicObject g)\r
- {\r
- if (GraphicObjects.IndexOf(g) > 0)\r
- {\r
- GraphicObjects.Remove(g);\r
- GraphicObjects.Insert(0, g);\r
- g.registerClipRect ();\r
- }\r
- }\r
- public void Quit ()\r
- {\r
- this.Exit ();\r
- }\r
-\r
- #region focus\r
- GraphicObject _activeWidget; //button is pressed on widget \r
- GraphicObject _hoverWidget; //mouse is over\r
- GraphicObject _focusedWidget; //has keyboard (or other perif) focus \r
-\r
- public GraphicObject activeWidget\r
- {\r
- get { return _activeWidget; }\r
- set \r
- {\r
- if (_activeWidget == value)\r
- return; \r
- _activeWidget = value;\r
- }\r
- }\r
- public GraphicObject hoverWidget\r
- {\r
- get { return _hoverWidget; }\r
- set { _hoverWidget = value; }\r
- }\r
- public GraphicObject FocusedWidget {\r
- get { return _focusedWidget; }\r
- set {\r
- if (_focusedWidget == value)\r
- return;\r
- if (_focusedWidget != null)\r
- _focusedWidget.onUnfocused (this, null);\r
- _focusedWidget = value;\r
- if (_focusedWidget != null)\r
- _focusedWidget.onFocused (this, null);\r
- }\r
- }\r
- #endregion\r
-\r
- #endregion\r
-\r
- /// <summary> Remove all Graphic objects from top container </summary>\r
- public void ClearInterface()\r
- {\r
- int i = 0;\r
- while (GraphicObjects.Count>0) {\r
- GraphicObject g = GraphicObjects [i];\r
- g.Visible = false;\r
- g.ClearBinding ();\r
- GraphicObjects.RemoveAt (0);\r
- }\r
- }\r
-\r
- #region Events\r
- //those events are raised only if mouse isn't in a graphic object\r
- public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;\r
- public event EventHandler<MouseButtonEventArgs> MouseButtonUp;\r
- public event EventHandler<MouseButtonEventArgs> MouseButtonDown;\r
- public event EventHandler<MouseButtonEventArgs> MouseClick;\r
- public event EventHandler<MouseMoveEventArgs> MouseMove;\r
- #endregion\r
-\r
- #region graphic contexte\r
- Context ctx;\r
- Surface surf;\r
- byte[] bmp;\r
- int texID;\r
-\r
- public QuadVAO uiQuad, uiQuad2;\r
- Crow.Shader shader;\r
- int[] viewport = new int[4];\r
-\r
- void createContext()\r
- { \r
- createOpenGLSurface ();\r
-\r
- if (uiQuad != null)\r
- uiQuad.Dispose ();\r
- uiQuad = new QuadVAO (0, 0, ClientRectangle.Width, ClientRectangle.Height, 0, 1, 1, -1);\r
- uiQuad2 = new QuadVAO (0, 0, ClientRectangle.Width, ClientRectangle.Height, 0, 0, 1, 1);\r
-\r
- shader.ProjectionMatrix = Matrix4.CreateOrthographicOffCenter \r
- (0, ClientRectangle.Width, ClientRectangle.Height, 0, 0, 1); \r
-\r
- redrawClip.AddRectangle (ClientRectangle);\r
- }\r
- void createOpenGLSurface()\r
- {\r
- currentWindow = this;\r
-\r
- int stride = 4 * ClientRectangle.Width;\r
- int bmpSize = Math.Abs (stride) * ClientRectangle.Height;\r
- bmp = new byte[bmpSize];\r
-\r
- //create texture\r
- if (GL.IsTexture(texID))\r
- GL.DeleteTexture (texID);\r
- GL.GenTextures(1, out texID);\r
- GL.ActiveTexture (TextureUnit.Texture0);\r
- GL.BindTexture(TextureTarget.Texture2D, texID);\r
-\r
- GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, \r
- ClientRectangle.Width, ClientRectangle.Height, 0,\r
- OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, bmp);\r
-\r
- GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);\r
- GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);\r
-\r
- GL.BindTexture(TextureTarget.Texture2D, 0);\r
-\r
- shader.Texture = texID;\r
- }\r
- void OpenGLDraw()\r
- {\r
- GL.GetInteger (GetPName.Viewport, viewport);\r
- GL.Viewport (0, 0, ClientRectangle.Width, ClientRectangle.Height);\r
-\r
- shader.Enable ();\r
-\r
- GL.TexSubImage2D (TextureTarget.Texture2D, 0,\r
- 0, 0, ClientRectangle.Width, ClientRectangle.Height,\r
- OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, bmp);\r
-\r
- uiQuad.Render (PrimitiveType.TriangleStrip);\r
-\r
- GL.BindTexture(TextureTarget.Texture2D, 0);\r
-\r
- shader.Disable ();\r
- GL.Viewport (viewport [0], viewport [1], viewport [2], viewport [3]);\r
- }\r
- #endregion\r
-\r
- #region update\r
- public Stopwatch updateTime = new Stopwatch ();\r
- public Stopwatch layoutTime = new Stopwatch ();\r
- public Stopwatch guTime = new Stopwatch ();\r
- public Stopwatch drawingTime = new Stopwatch ();\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
- drawingTime.Reset ();\r
-\r
- surf = new ImageSurface(bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height,ClientRectangle.Width*4);\r
- ctx = new Context(surf);\r
-\r
- if (Interface.LoadingLists.Count > 0) {\r
- ListBox[] loadings = new ListBox[Interface.LoadingLists.Count];\r
- Interface.LoadingLists.CopyTo (loadings, 0);\r
- for (int i = 0; i < loadings.Length; i++)\r
- loadings [i].CheckPendingChildrenAddition (); \r
- }\r
-\r
- GraphicObject[] invGOList = new GraphicObject[GraphicObjects.Count];\r
- GraphicObjects.CopyTo (invGOList,0);\r
- invGOList = invGOList.Reverse ().ToArray ();\r
-\r
- //Debug.WriteLine ("======= Layouting queue start =======");\r
- lock (Interface.LayoutingQueue) { \r
- while (Interface.LayoutingQueue.Count > 0) {\r
-// Stopwatch lqiProcTime = new Stopwatch ();\r
-// lqiProcTime.Start ();\r
- LayoutingQueueItem lqi = Interface.LayoutingQueue.Dequeue ();\r
- lqi.ProcessLayouting ();\r
-// lqiProcTime.Stop ();\r
-// if (lqiProcTime.ElapsedMilliseconds > 10) {\r
-// Debug.WriteLine("lqi {2}: {0} ticks \t, {1} ms",\r
-// updateTime.ElapsedTicks,\r
-// updateTime.ElapsedMilliseconds, lqi.ToString());\r
-// }\r
- }\r
- }\r
-\r
- //Debug.WriteLine ("otd:" + gobjsToRedraw.Count.ToString () + "-");\r
- //final redraw clips should be added only when layout is completed among parents,\r
- //that's why it take place in a second pass\r
- GraphicObject[] gotr = new GraphicObject[gobjsToRedraw.Count];\r
- gobjsToRedraw.CopyTo (gotr);\r
- gobjsToRedraw.Clear ();\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
- redrawClip.clearAndClip (ctx); \r
-\r
- //Link.draw (ctx);\r
- foreach (GraphicObject p in invGOList) {\r
- if (p.Visible) {\r
-\r
- ctx.Save ();\r
- if (redrawClip.count > 0) {\r
- Rectangles clip = redrawClip.intersectingRects (p.Slot);\r
-\r
- if (clip.count > 0)\r
- p.Paint (ref ctx, clip);\r
- }\r
- ctx.Restore ();\r
- }\r
- }\r
- ctx.ResetClip ();\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
-// if (ToolTip.isVisible) {\r
-// ToolTip.panel.processkLayouting();\r
-// if (ToolTip.panel.layoutIsValid)\r
-// ToolTip.panel.Paint(ref ctx);\r
-// }\r
-// Debug.WriteLine("INTERFACE: layouting: {0} ticks \t graphical update {1} ticks \t drawing {2} ticks",\r
-// layoutTime.ElapsedTicks,\r
-// guTime.ElapsedTicks,\r
-// drawingTime.ElapsedTicks);\r
-// Debug.WriteLine("INTERFACE: layouting: {0} ms \t graphical update {1} ms \t drawing {2} ms",\r
-// layoutTime.ElapsedMilliseconds,\r
-// guTime.ElapsedMilliseconds,\r
-// drawingTime.ElapsedMilliseconds);\r
-\r
-// Debug.WriteLine("UPDATE: {0} ticks \t, {1} ms",\r
-// updateTime.ElapsedTicks,\r
-// updateTime.ElapsedMilliseconds);\r
- } \r
- #endregion\r
- \r
- #region loading\r
- public GraphicObject LoadInterface (string path)\r
- {\r
- GraphicObject tmp = Interface.Load (path, this);\r
- AddWidget (tmp);\r
- return tmp;\r
- }\r
- #endregion\r
-\r
- public virtual void OnRender(FrameEventArgs e)\r
- {\r
- }\r
- public virtual void GLClear()\r
- {\r
- GL.Clear (ClearBufferMask.ColorBufferBit);\r
- }\r
-\r
- #region Game win overrides\r
- protected override void OnUpdateFrame(FrameEventArgs e)\r
- { \r
- base.OnUpdateFrame(e);\r
- update ();\r
- }\r
- protected override void OnRenderFrame(FrameEventArgs e)\r
- {\r
- GLClear ();\r
-\r
-\r
- base.OnRenderFrame(e);\r
-\r
- OnRender (e);\r
- OpenGLDraw ();\r
-\r
-\r
- SwapBuffers ();\r
- }\r
- protected override void OnLoad(EventArgs e)\r
- {\r
- base.OnLoad(e);\r
-\r
- Keyboard.KeyDown += new EventHandler<KeyboardKeyEventArgs>(Keyboard_KeyDown);\r
- Mouse.WheelChanged += new EventHandler<MouseWheelEventArgs>(Mouse_WheelChanged);\r
- Mouse.ButtonDown += new EventHandler<MouseButtonEventArgs>(Mouse_ButtonDown);\r
- Mouse.ButtonUp += new EventHandler<MouseButtonEventArgs>(Mouse_ButtonUp);\r
- Mouse.Move += new EventHandler<MouseMoveEventArgs>(Mouse_Move);\r
-\r
- GL.ClearColor(0.0f, 0.0f, 0.0f, 0.0f);\r
-\r
- Console.WriteLine("\n\n*************************************");\r
- Console.WriteLine("GL version: " + GL.GetString (StringName.Version));\r
- Console.WriteLine("GL vendor: " + GL.GetString (StringName.Vendor));\r
- Console.WriteLine("GLSL version: " + GL.GetString (StringName.ShadingLanguageVersion));\r
- Console.WriteLine("*************************************\n");\r
-\r
- shader = new Crow.TexturedShader ();\r
- }\r
-\r
- protected override void OnResize(EventArgs e)\r
- {\r
- base.OnResize (e);\r
- createContext ();\r
- foreach (GraphicObject g in GraphicObjects) {\r
- g.RegisterForLayouting ((int)LayoutingType.All);\r
- //g.registerForGraphicUpdate();\r
- }\r
- }\r
- #endregion\r
-\r
- #region Mouse Handling\r
- void Mouse_Move(object sender, MouseMoveEventArgs e)\r
- {\r
- if (_activeWidget != null) {\r
- //first, ensure object is still in the graphic tree\r
- if (_activeWidget.HostContainer == null) {\r
- activeWidget = null;\r
- } else {\r
- \r
- //send move evt even if mouse move outside bounds\r
- _activeWidget.onMouseMove (_activeWidget, e);\r
- return;\r
- }\r
- }\r
-\r
- if (_hoverWidget != null) {\r
- //first, ensure object is still in the graphic tree\r
- if (_hoverWidget.HostContainer == null) {\r
- hoverWidget = null;\r
- } else {\r
- //check topmost graphicobject first\r
- GraphicObject tmp = _hoverWidget;\r
- GraphicObject topc = null;\r
- while (tmp is GraphicObject) {\r
- topc = tmp;\r
- tmp = tmp.Parent as GraphicObject;\r
- }\r
- int idxhw = GraphicObjects.IndexOf (topc);\r
- if (idxhw != 0) {\r
- int i = 0;\r
- while (i < idxhw) {\r
- if (GraphicObjects [i].MouseIsIn (e.Position)) {\r
- _hoverWidget.onMouseLeave (this, e);\r
- GraphicObjects [i].checkHoverWidget (e);\r
- return;\r
- }\r
- i++;\r
- }\r
- }\r
- \r
- \r
- if (_hoverWidget.MouseIsIn (e.Position)) {\r
- _hoverWidget.checkHoverWidget (e);\r
- return;\r
- } else {\r
- _hoverWidget.onMouseLeave (this, e);\r
- //seek upward from last focused graph obj's\r
- while (_hoverWidget.Parent as GraphicObject != null) {\r
- _hoverWidget = _hoverWidget.Parent as GraphicObject;\r
- if (_hoverWidget.MouseIsIn (e.Position)) {\r
- _hoverWidget.checkHoverWidget (e);\r
- return;\r
- } else\r
- _hoverWidget.onMouseLeave (this, e);\r
- }\r
- }\r
- }\r
- }\r
-\r
- //top level graphic obj's parsing\r
- for (int i = 0; i < GraphicObjects.Count; i++) {\r
- GraphicObject g = GraphicObjects[i];\r
- if (g.MouseIsIn (e.Position)) {\r
- g.checkHoverWidget (e);\r
- PutOnTop (g);\r
- return;\r
- }\r
- }\r
- _hoverWidget = null;\r
- MouseMove.Raise (this, e);\r
- }\r
- void Mouse_ButtonUp(object sender, MouseButtonEventArgs e)\r
- {\r
- if (_activeWidget == null) {\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.onMouseUp (this, e);\r
- activeWidget = null;\r
- }\r
- void Mouse_ButtonDown(object sender, MouseButtonEventArgs e)\r
- {\r
- if (_hoverWidget == null) {\r
- MouseButtonDown.Raise (this, e);\r
- return;\r
- }\r
-\r
- _hoverWidget.onMouseDown(_hoverWidget,new BubblingMouseButtonEventArg(e));\r
-\r
- if (FocusedWidget == null)\r
- return;\r
- if (!FocusedWidget.MouseRepeat)\r
- return;\r
- mouseRepeatThread = new Thread (mouseRepeatThreadFunc);\r
- mouseRepeatThread.Start ();\r
- }\r
- void Mouse_WheelChanged(object sender, MouseWheelEventArgs e)\r
- {\r
- if (_hoverWidget == null) {\r
- MouseWheelChanged.Raise (this, e);\r
- return;\r
- }\r
- _hoverWidget.onMouseWheel (this, e);\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
- void Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)\r
- { \r
- if (_focusedWidget == null)\r
- return;\r
- _focusedWidget.onKeyDown (sender, e);\r
- }\r
- #endregion\r
-\r
- #region ILayoutable implementation\r
-\r
- public void RegisterForLayouting (int layoutType) { throw new NotImplementedException (); }\r
- public void UpdateLayout (LayoutingType layoutType) { throw new NotImplementedException (); }\r
- public Rectangle ContextCoordinates (Rectangle r)\r
- {\r
- return r;\r
- }\r
- public Rectangle ScreenCoordinates (Rectangle r)\r
- {\r
- return r;\r
- }\r
-\r
- public ILayoutable Parent {\r
- get {\r
- return null;\r
- }\r
- set {\r
- throw new NotImplementedException ();\r
- }\r
- }\r
- Rectangle ILayoutable.ClientRectangle {\r
- get { return new Size(this.ClientRectangle.Size.Width,this.ClientRectangle.Size.Height); }\r
- }\r
- public IGOLibHost HostContainer {\r
- get { return this; }\r
- }\r
-\r
- public Rectangle getSlot ()\r
- {\r
- return ClientRectangle;\r
- }\r
- public Rectangle getBounds ()//redundant but fill ILayoutable implementation\r
- {\r
- return ClientRectangle;\r
- } \r
- #endregion\r
- }\r
+// Released to the public domain. Use, modify and relicense at will.
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Drawing.Imaging;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Xml;
+using Cairo;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+
+
+namespace Crow
+{
+ public class OpenTKGameWindow : GameWindow, ILayoutable, IGOLibHost
+ {
+ #region ctor
+// public OpenTKGameWindow(int _width, int _height, string _title="golib")
+// : base(_width, _height, new OpenTK.Graphics.GraphicsMode(32, 24, 0, 1), _title,
+// GameWindowFlags.Fullscreen,
+// DisplayDevice.Default,
+// 3,0,OpenTK.Graphics.GraphicsContextFlags.Default)
+ public OpenTKGameWindow(int _width, int _height, string _title="Crow")
+ : base(_width, _height, new OpenTK.Graphics.GraphicsMode(32, 24, 0, 1),
+ _title,GameWindowFlags.Default,DisplayDevice.GetDisplay(DisplayIndex.Second),
+ 3,3,OpenTK.Graphics.GraphicsContextFlags.Debug)
+// public OpenTKGameWindow(int _width, int _height, string _title="golib")
+// : base(_width, _height, new OpenTK.Graphics.GraphicsMode(32, 24, 0, 8), _title)
+ {
+ //VSync = VSyncMode.On;
+ currentWindow = this;
+ //Load cursors
+ XCursor.Cross = XCursorFile.Load("#Crow.Images.Icons.Cursors.cross").Cursors[0];
+ XCursor.Default = XCursorFile.Load("#Crow.Images.Icons.Cursors.arrow").Cursors[0];
+ XCursor.NW = XCursorFile.Load("#Crow.Images.Icons.Cursors.top_left_corner").Cursors[0];
+ XCursor.NE = XCursorFile.Load("#Crow.Images.Icons.Cursors.top_right_corner").Cursors[0];
+ XCursor.SW = XCursorFile.Load("#Crow.Images.Icons.Cursors.bottom_left_corner").Cursors[0];
+ XCursor.SE = XCursorFile.Load("#Crow.Images.Icons.Cursors.bottom_right_corner").Cursors[0];
+ XCursor.H = XCursorFile.Load("#Crow.Images.Icons.Cursors.sb_h_double_arrow").Cursors[0];
+ XCursor.V = XCursorFile.Load("#Crow.Images.Icons.Cursors.sb_v_double_arrow").Cursors[0];
+ }
+ #endregion
+
+ public List<GraphicObject> GraphicObjects = new List<GraphicObject>();
+ public Color Background = Color.Transparent;
+
+ internal static OpenTKGameWindow currentWindow;
+
+ Rectangles _redrawClip = new Rectangles();//should find another way to access it from child
+ List<GraphicObject> _gobjsToRedraw = new List<GraphicObject>();
+
+ #region IGOLibHost implementation
+ public Rectangles redrawClip {
+ get {
+ return _redrawClip;
+ }
+ set {
+ _redrawClip = value;
+ }
+ }
+
+ public List<GraphicObject> gobjsToRedraw {
+ get {
+ return _gobjsToRedraw;
+ }
+ set {
+ _gobjsToRedraw = value;
+ }
+ }
+ public void AddWidget(GraphicObject g)
+ {
+ g.Parent = this;
+ GraphicObjects.Insert (0, g);
+
+ g.RegisterForLayouting ((int)LayoutingType.Sizing);
+ }
+ public void DeleteWidget(GraphicObject g)
+ {
+ g.Visible = false;//trick to ensure clip is added to refresh zone
+ g.ClearBinding();
+ GraphicObjects.Remove (g);
+ }
+ public void PutOnTop(GraphicObject g)
+ {
+ if (GraphicObjects.IndexOf(g) > 0)
+ {
+ GraphicObjects.Remove(g);
+ GraphicObjects.Insert(0, g);
+ g.registerClipRect ();
+ }
+ }
+ public void Quit ()
+ {
+ this.Exit ();
+ }
+
+ #region focus
+ GraphicObject _activeWidget; //button is pressed on widget
+ GraphicObject _hoverWidget; //mouse is over
+ GraphicObject _focusedWidget; //has keyboard (or other perif) focus
+
+ public GraphicObject activeWidget
+ {
+ get { return _activeWidget; }
+ set
+ {
+ if (_activeWidget == value)
+ return;
+ _activeWidget = value;
+ }
+ }
+ public GraphicObject hoverWidget
+ {
+ get { return _hoverWidget; }
+ set { _hoverWidget = value; }
+ }
+ public GraphicObject FocusedWidget {
+ get { return _focusedWidget; }
+ set {
+ if (_focusedWidget == value)
+ return;
+ if (_focusedWidget != null)
+ _focusedWidget.onUnfocused (this, null);
+ _focusedWidget = value;
+ if (_focusedWidget != null)
+ _focusedWidget.onFocused (this, null);
+ }
+ }
+ #endregion
+
+ #endregion
+
+ /// <summary> Remove all Graphic objects from top container </summary>
+ public void ClearInterface()
+ {
+ int i = 0;
+ while (GraphicObjects.Count>0) {
+ GraphicObject g = GraphicObjects [i];
+ g.Visible = false;
+ g.ClearBinding ();
+ GraphicObjects.RemoveAt (0);
+ }
+ }
+
+ #region Events
+ //those events are raised only if mouse isn't in a graphic object
+ public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;
+ public event EventHandler<MouseButtonEventArgs> MouseButtonUp;
+ public event EventHandler<MouseButtonEventArgs> MouseButtonDown;
+ public event EventHandler<MouseButtonEventArgs> MouseClick;
+ public event EventHandler<MouseMoveEventArgs> MouseMove;
+ #endregion
+
+ #region graphic contexte
+ Context ctx;
+ Surface surf;
+ byte[] bmp;
+ int texID;
+
+ public QuadVAO uiQuad, uiQuad2;
+ Crow.Shader shader;
+ int[] viewport = new int[4];
+
+ void createContext()
+ {
+ createOpenGLSurface ();
+
+ if (uiQuad != null)
+ uiQuad.Dispose ();
+ uiQuad = new QuadVAO (0, 0, ClientRectangle.Width, ClientRectangle.Height, 0, 1, 1, -1);
+ uiQuad2 = new QuadVAO (0, 0, ClientRectangle.Width, ClientRectangle.Height, 0, 0, 1, 1);
+
+ shader.ProjectionMatrix = Matrix4.CreateOrthographicOffCenter
+ (0, ClientRectangle.Width, ClientRectangle.Height, 0, 0, 1);
+
+ redrawClip.AddRectangle (ClientRectangle);
+ }
+ void createOpenGLSurface()
+ {
+ currentWindow = this;
+
+ int stride = 4 * ClientRectangle.Width;
+ int bmpSize = Math.Abs (stride) * ClientRectangle.Height;
+ bmp = new byte[bmpSize];
+
+ //create texture
+ if (GL.IsTexture(texID))
+ GL.DeleteTexture (texID);
+ GL.GenTextures(1, out texID);
+ GL.ActiveTexture (TextureUnit.Texture0);
+ GL.BindTexture(TextureTarget.Texture2D, texID);
+
+ GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba,
+ ClientRectangle.Width, ClientRectangle.Height, 0,
+ OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, bmp);
+
+ GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
+ GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
+
+ GL.BindTexture(TextureTarget.Texture2D, 0);
+
+ shader.Texture = texID;
+ }
+ void OpenGLDraw()
+ {
+ GL.GetInteger (GetPName.Viewport, viewport);
+ GL.Viewport (0, 0, ClientRectangle.Width, ClientRectangle.Height);
+
+ shader.Enable ();
+
+ GL.TexSubImage2D (TextureTarget.Texture2D, 0,
+ 0, 0, ClientRectangle.Width, ClientRectangle.Height,
+ OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, bmp);
+
+ uiQuad.Render (PrimitiveType.TriangleStrip);
+
+ GL.BindTexture(TextureTarget.Texture2D, 0);
+
+ shader.Disable ();
+ GL.Viewport (viewport [0], viewport [1], viewport [2], viewport [3]);
+ }
+ #endregion
+
+ #region update
+ public Stopwatch updateTime = new Stopwatch ();
+ public Stopwatch layoutTime = new Stopwatch ();
+ public Stopwatch guTime = new Stopwatch ();
+ public Stopwatch drawingTime = new Stopwatch ();
+
+ void update ()
+ {
+ if (mouseRepeatCount > 0) {
+ int mc = mouseRepeatCount;
+ mouseRepeatCount -= mc;
+ for (int i = 0; i < mc; i++) {
+ FocusedWidget.onMouseClick (this, new MouseButtonEventArgs (Mouse.X, Mouse.Y, MouseButton.Left, true));
+ }
+ }
+
+ updateTime.Restart ();
+ layoutTime.Reset ();
+ guTime.Reset ();
+ drawingTime.Reset ();
+
+ surf = new ImageSurface(bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height,ClientRectangle.Width*4);
+ ctx = new Context(surf);
+
+ if (Interface.LoadingLists.Count > 0) {
+ ListBox[] loadings = new ListBox[Interface.LoadingLists.Count];
+ Interface.LoadingLists.CopyTo (loadings, 0);
+ for (int i = 0; i < loadings.Length; i++)
+ loadings [i].CheckPendingChildrenAddition ();
+ }
+
+ GraphicObject[] invGOList = new GraphicObject[GraphicObjects.Count];
+ GraphicObjects.CopyTo (invGOList,0);
+ invGOList = invGOList.Reverse ().ToArray ();
+
+ //Debug.WriteLine ("======= Layouting queue start =======");
+ lock (Interface.LayoutingQueue) {
+ while (Interface.LayoutingQueue.Count > 0) {
+// Stopwatch lqiProcTime = new Stopwatch ();
+// lqiProcTime.Start ();
+ LayoutingQueueItem lqi = Interface.LayoutingQueue.Dequeue ();
+ lqi.ProcessLayouting ();
+// lqiProcTime.Stop ();
+// if (lqiProcTime.ElapsedMilliseconds > 10) {
+// Debug.WriteLine("lqi {2}: {0} ticks \t, {1} ms",
+// updateTime.ElapsedTicks,
+// updateTime.ElapsedMilliseconds, lqi.ToString());
+// }
+ }
+ }
+
+ //Debug.WriteLine ("otd:" + gobjsToRedraw.Count.ToString () + "-");
+ //final redraw clips should be added only when layout is completed among parents,
+ //that's why it take place in a second pass
+ GraphicObject[] gotr = new GraphicObject[gobjsToRedraw.Count];
+ gobjsToRedraw.CopyTo (gotr);
+ gobjsToRedraw.Clear ();
+ foreach (GraphicObject p in gotr) {
+ p.registerClipRect ();
+ }
+ updateTime.Stop ();
+
+ drawingTime.Start ();
+
+ lock (redrawClip) {
+ if (redrawClip.count > 0) {
+ #if DEBUG_CLIP_RECTANGLE
+ redrawClip.stroke (ctx, new Color(1.0,0,0,0.3));
+ #endif
+ redrawClip.clearAndClip (ctx);
+
+ //Link.draw (ctx);
+ foreach (GraphicObject p in invGOList) {
+ if (p.Visible) {
+
+ ctx.Save ();
+ if (redrawClip.count > 0) {
+ Rectangles clip = redrawClip.intersectingRects (p.Slot);
+
+ if (clip.count > 0)
+ p.Paint (ref ctx, clip);
+ }
+ ctx.Restore ();
+ }
+ }
+ ctx.ResetClip ();
+ #if DEBUG_CLIP_RECTANGLE
+ redrawClip.stroke (ctx, Color.Red.AdjustAlpha(0.1));
+ #endif
+ redrawClip.Reset ();
+ }
+ }
+ drawingTime.Stop ();
+ //surf.WriteToPng (@"/mnt/data/test.png");
+ ctx.Dispose ();
+ surf.Dispose ();
+// if (ToolTip.isVisible) {
+// ToolTip.panel.processkLayouting();
+// if (ToolTip.panel.layoutIsValid)
+// ToolTip.panel.Paint(ref ctx);
+// }
+// Debug.WriteLine("INTERFACE: layouting: {0} ticks \t graphical update {1} ticks \t drawing {2} ticks",
+// layoutTime.ElapsedTicks,
+// guTime.ElapsedTicks,
+// drawingTime.ElapsedTicks);
+// Debug.WriteLine("INTERFACE: layouting: {0} ms \t graphical update {1} ms \t drawing {2} ms",
+// layoutTime.ElapsedMilliseconds,
+// guTime.ElapsedMilliseconds,
+// drawingTime.ElapsedMilliseconds);
+
+// Debug.WriteLine("UPDATE: {0} ticks \t, {1} ms",
+// updateTime.ElapsedTicks,
+// updateTime.ElapsedMilliseconds);
+ }
+ #endregion
+
+ #region loading
+ public GraphicObject LoadInterface (string path)
+ {
+ GraphicObject tmp = Interface.Load (path, this);
+ AddWidget (tmp);
+ return tmp;
+ }
+ #endregion
+
+ public virtual void OnRender(FrameEventArgs e)
+ {
+ }
+ public virtual void GLClear()
+ {
+ GL.Clear (ClearBufferMask.ColorBufferBit);
+ }
+
+ #region Game win overrides
+ protected override void OnUpdateFrame(FrameEventArgs e)
+ {
+ base.OnUpdateFrame(e);
+ update ();
+ }
+ protected override void OnRenderFrame(FrameEventArgs e)
+ {
+ GLClear ();
+
+
+ base.OnRenderFrame(e);
+
+ OnRender (e);
+ OpenGLDraw ();
+
+
+ SwapBuffers ();
+ }
+ protected override void OnLoad(EventArgs e)
+ {
+ base.OnLoad(e);
+
+ Keyboard.KeyDown += new EventHandler<KeyboardKeyEventArgs>(Keyboard_KeyDown);
+ Mouse.WheelChanged += new EventHandler<MouseWheelEventArgs>(Mouse_WheelChanged);
+ Mouse.ButtonDown += new EventHandler<MouseButtonEventArgs>(Mouse_ButtonDown);
+ Mouse.ButtonUp += new EventHandler<MouseButtonEventArgs>(Mouse_ButtonUp);
+ Mouse.Move += new EventHandler<MouseMoveEventArgs>(Mouse_Move);
+
+ GL.ClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+
+ Console.WriteLine("\n\n*************************************");
+ Console.WriteLine("GL version: " + GL.GetString (StringName.Version));
+ Console.WriteLine("GL vendor: " + GL.GetString (StringName.Vendor));
+ Console.WriteLine("GLSL version: " + GL.GetString (StringName.ShadingLanguageVersion));
+ Console.WriteLine("*************************************\n");
+
+ shader = new Crow.TexturedShader ();
+ }
+
+ protected override void OnResize(EventArgs e)
+ {
+ base.OnResize (e);
+ createContext ();
+ foreach (GraphicObject g in GraphicObjects) {
+ g.RegisterForLayouting ((int)LayoutingType.All);
+ //g.registerForGraphicUpdate();
+ }
+ }
+ #endregion
+
+ #region Mouse Handling
+ void Mouse_Move(object sender, MouseMoveEventArgs e)
+ {
+ if (_activeWidget != null) {
+ //first, ensure object is still in the graphic tree
+ if (_activeWidget.HostContainer == null) {
+ activeWidget = null;
+ } else {
+
+ //send move evt even if mouse move outside bounds
+ _activeWidget.onMouseMove (_activeWidget, e);
+ return;
+ }
+ }
+
+ if (_hoverWidget != null) {
+ //first, ensure object is still in the graphic tree
+ if (_hoverWidget.HostContainer == null) {
+ hoverWidget = null;
+ } else {
+ //check topmost graphicobject first
+ GraphicObject tmp = _hoverWidget;
+ GraphicObject topc = null;
+ while (tmp is GraphicObject) {
+ topc = tmp;
+ tmp = tmp.Parent as GraphicObject;
+ }
+ int idxhw = GraphicObjects.IndexOf (topc);
+ if (idxhw != 0) {
+ int i = 0;
+ while (i < idxhw) {
+ if (GraphicObjects [i].MouseIsIn (e.Position)) {
+ _hoverWidget.onMouseLeave (this, e);
+ GraphicObjects [i].checkHoverWidget (e);
+ return;
+ }
+ i++;
+ }
+ }
+
+
+ if (_hoverWidget.MouseIsIn (e.Position)) {
+ _hoverWidget.checkHoverWidget (e);
+ return;
+ } else {
+ _hoverWidget.onMouseLeave (this, e);
+ //seek upward from last focused graph obj's
+ while (_hoverWidget.Parent as GraphicObject != null) {
+ _hoverWidget = _hoverWidget.Parent as GraphicObject;
+ if (_hoverWidget.MouseIsIn (e.Position)) {
+ _hoverWidget.checkHoverWidget (e);
+ return;
+ } else
+ _hoverWidget.onMouseLeave (this, e);
+ }
+ }
+ }
+ }
+
+ //top level graphic obj's parsing
+ for (int i = 0; i < GraphicObjects.Count; i++) {
+ GraphicObject g = GraphicObjects[i];
+ if (g.MouseIsIn (e.Position)) {
+ g.checkHoverWidget (e);
+ PutOnTop (g);
+ return;
+ }
+ }
+ _hoverWidget = null;
+ MouseMove.Raise (this, e);
+ }
+ void Mouse_ButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ if (_activeWidget == null) {
+ MouseButtonUp.Raise (this, e);
+ return;
+ }
+
+ if (mouseRepeatThread != null) {
+ mouseRepeatOn = false;
+ mouseRepeatThread.Abort();
+ mouseRepeatThread.Join ();
+ }
+
+ _activeWidget.onMouseUp (this, e);
+ activeWidget = null;
+ }
+ void Mouse_ButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (_hoverWidget == null) {
+ MouseButtonDown.Raise (this, e);
+ return;
+ }
+
+ _hoverWidget.onMouseDown(_hoverWidget,new BubblingMouseButtonEventArg(e));
+
+ if (FocusedWidget == null)
+ return;
+ if (!FocusedWidget.MouseRepeat)
+ return;
+ mouseRepeatThread = new Thread (mouseRepeatThreadFunc);
+ mouseRepeatThread.Start ();
+ }
+ void Mouse_WheelChanged(object sender, MouseWheelEventArgs e)
+ {
+ if (_hoverWidget == null) {
+ MouseWheelChanged.Raise (this, e);
+ return;
+ }
+ _hoverWidget.onMouseWheel (this, e);
+ }
+
+ volatile bool mouseRepeatOn;
+ volatile int mouseRepeatCount;
+ Thread mouseRepeatThread;
+ void mouseRepeatThreadFunc()
+ {
+ mouseRepeatOn = true;
+ Thread.Sleep (Interface.DeviceRepeatDelay);
+ while (mouseRepeatOn) {
+ mouseRepeatCount++;
+ Thread.Sleep (Interface.DeviceRepeatInterval);
+ }
+ mouseRepeatCount = 0;
+ }
+ #endregion
+
+ #region keyboard Handling
+ void Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)
+ {
+ if (_focusedWidget == null)
+ return;
+ _focusedWidget.onKeyDown (sender, e);
+ }
+ #endregion
+
+ #region ILayoutable implementation
+
+ public void RegisterForLayouting (int layoutType) { throw new NotImplementedException (); }
+ public void UpdateLayout (LayoutingType layoutType) { throw new NotImplementedException (); }
+ public Rectangle ContextCoordinates (Rectangle r)
+ {
+ return r;
+ }
+ public Rectangle ScreenCoordinates (Rectangle r)
+ {
+ return r;
+ }
+
+ public ILayoutable Parent {
+ get {
+ return null;
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+ Rectangle ILayoutable.ClientRectangle {
+ get { return new Size(this.ClientRectangle.Size.Width,this.ClientRectangle.Size.Height); }
+ }
+ public IGOLibHost HostContainer {
+ get { return this; }
+ }
+
+ public Rectangle getSlot ()
+ {
+ return ClientRectangle;
+ }
+ public Rectangle getBounds ()//redundant but fill ILayoutable implementation
+ {
+ return ClientRectangle;
+ }
+ #endregion
+ }
}
\ No newline at end of file
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace Crow\r
-{\r
- public struct Point\r
- {\r
- int _x;\r
- int _y;\r
-\r
- public int X\r
- {\r
- get { return _x; }\r
- set { _x = value; }\r
- }\r
- public int Y\r
- {\r
- get { return _y; }\r
- set { _y = value; }\r
- }\r
- public Point(int x, int y)\r
- {\r
- _x = x;\r
- _y = y;\r
- }\r
-\r
- public int Length {\r
- get { return (int)Math.Sqrt (Math.Pow (_x, 2) + Math.Pow (_y, 2)); }\r
- }\r
- public static implicit operator Cairo.Point(Point p)\r
- {\r
- return new Cairo.Point(p.X, p.Y);\r
- }\r
- public static implicit operator Cairo.PointD(Point p)\r
- {\r
- return new Cairo.PointD(p.X, p.Y);\r
- }\r
- public static implicit operator System.Drawing.Point(Point p)\r
- {\r
- return new System.Drawing.Point(p.X, p.Y);\r
- }\r
- public static implicit operator Point(System.Drawing.Point p)\r
- {\r
- return new Point(p.X, p.Y);\r
- }\r
- public static implicit operator Point(int i)\r
- {\r
- return new Point(i, i);\r
- }\r
- public static Point operator /(Point p, int d)\r
- {\r
- return new Point(p.X / d, p.Y / d);\r
- }\r
- public static Point operator *(Point p, int d)\r
- {\r
- return new Point(p.X * d, p.Y * d);\r
- }\r
- public static Point operator /(Point p, double d)\r
- {\r
- return new Point((int)(p.X / d), (int)(p.Y / d));\r
- }\r
- public static Point operator *(Point p, double d)\r
- {\r
- return new Point((int)(p.X * d), (int)(p.Y * d));\r
- }\r
- public static Point operator +(Point p1, Point p2)\r
- {\r
- return new Point(p1.X + p2.X, p1.Y + p2.Y);\r
- }\r
- public static Point operator +(Point p, int i)\r
- {\r
- return new Point(p.X + i, p.Y + i);\r
- }\r
- public static Point operator -(Point p1, Point p2)\r
- {\r
- return new Point(p1.X - p2.X, p1.Y - p2.Y);\r
- }\r
- public static bool operator >=(Point p1, Point p2)\r
- {\r
- return p1.X >= p2.X && p1.Y >= p2.Y ? true : false;\r
- }\r
- public static bool operator <=(Point p1, Point p2)\r
- {\r
- return p1.X <= p2.X && p1.Y <= p2.Y ? true : false;\r
- }\r
- public static bool operator ==(Point s, int i)\r
- {\r
- if (s.X == i && s.Y == i)\r
- return true;\r
- else\r
- return false;\r
- }\r
- public static bool operator !=(Point s, int i)\r
- {\r
- if (s.X == i && s.Y == i)\r
- return false;\r
- else\r
- return true;\r
- }\r
- public static bool operator >(Point s, int i)\r
- {\r
- if (s.X > i && s.Y > i)\r
- return true;\r
- else\r
- return false;\r
- }\r
- public static bool operator <(Point s, int i)\r
- {\r
- if (s.X < i && s.Y < i)\r
- return true;\r
- else\r
- return false;\r
- }\r
- public static bool operator ==(Point s1, Point s2)\r
- {\r
- if (s1.X == s2.X && s1.Y == s2.Y)\r
- return true;\r
- else\r
- return false;\r
- }\r
- public static bool operator !=(Point s1, Point s2)\r
- {\r
- if (s1.X == s2.X && s1.Y == s2.Y)\r
- return false;\r
- else\r
- return true;\r
- }\r
-\r
- public override string ToString()\r
- {\r
- return string.Format("({0},{1})", X, Y);\r
- }\r
-\r
- public override bool Equals(object obj)\r
- {\r
- return base.Equals(obj);\r
- }\r
- public override int GetHashCode()\r
- {\r
- return base.GetHashCode();\r
- }\r
- }\r
-\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Crow
+{
+ public struct Point
+ {
+ int _x;
+ int _y;
+
+ public int X
+ {
+ get { return _x; }
+ set { _x = value; }
+ }
+ public int Y
+ {
+ get { return _y; }
+ set { _y = value; }
+ }
+ public Point(int x, int y)
+ {
+ _x = x;
+ _y = y;
+ }
+
+ public int Length {
+ get { return (int)Math.Sqrt (Math.Pow (_x, 2) + Math.Pow (_y, 2)); }
+ }
+ public static implicit operator Cairo.Point(Point p)
+ {
+ return new Cairo.Point(p.X, p.Y);
+ }
+ public static implicit operator Cairo.PointD(Point p)
+ {
+ return new Cairo.PointD(p.X, p.Y);
+ }
+ public static implicit operator System.Drawing.Point(Point p)
+ {
+ return new System.Drawing.Point(p.X, p.Y);
+ }
+ public static implicit operator Point(System.Drawing.Point p)
+ {
+ return new Point(p.X, p.Y);
+ }
+ public static implicit operator Point(int i)
+ {
+ return new Point(i, i);
+ }
+ public static Point operator /(Point p, int d)
+ {
+ return new Point(p.X / d, p.Y / d);
+ }
+ public static Point operator *(Point p, int d)
+ {
+ return new Point(p.X * d, p.Y * d);
+ }
+ public static Point operator /(Point p, double d)
+ {
+ return new Point((int)(p.X / d), (int)(p.Y / d));
+ }
+ public static Point operator *(Point p, double d)
+ {
+ return new Point((int)(p.X * d), (int)(p.Y * d));
+ }
+ public static Point operator +(Point p1, Point p2)
+ {
+ return new Point(p1.X + p2.X, p1.Y + p2.Y);
+ }
+ public static Point operator +(Point p, int i)
+ {
+ return new Point(p.X + i, p.Y + i);
+ }
+ public static Point operator -(Point p1, Point p2)
+ {
+ return new Point(p1.X - p2.X, p1.Y - p2.Y);
+ }
+ public static bool operator >=(Point p1, Point p2)
+ {
+ return p1.X >= p2.X && p1.Y >= p2.Y ? true : false;
+ }
+ public static bool operator <=(Point p1, Point p2)
+ {
+ return p1.X <= p2.X && p1.Y <= p2.Y ? true : false;
+ }
+ public static bool operator ==(Point s, int i)
+ {
+ if (s.X == i && s.Y == i)
+ return true;
+ else
+ return false;
+ }
+ public static bool operator !=(Point s, int i)
+ {
+ if (s.X == i && s.Y == i)
+ return false;
+ else
+ return true;
+ }
+ public static bool operator >(Point s, int i)
+ {
+ if (s.X > i && s.Y > i)
+ return true;
+ else
+ return false;
+ }
+ public static bool operator <(Point s, int i)
+ {
+ if (s.X < i && s.Y < i)
+ return true;
+ else
+ return false;
+ }
+ public static bool operator ==(Point s1, Point s2)
+ {
+ if (s1.X == s2.X && s1.Y == s2.Y)
+ return true;
+ else
+ return false;
+ }
+ public static bool operator !=(Point s1, Point s2)
+ {
+ if (s1.X == s2.X && s1.Y == s2.Y)
+ return false;
+ else
+ return true;
+ }
+
+ public override string ToString()
+ {
+ return string.Format("({0},{1})", X, Y);
+ }
+
+ public override bool Equals(object obj)
+ {
+ return base.Equals(obj);
+ }
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+ }
+
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using System.Xml.Serialization;\r
-\r
-namespace Crow\r
-{ \r
- public struct Rectangle\r
- {\r
- #region private fields\r
- int _x;\r
- int _y;\r
- int _width;\r
- int _height;\r
- #endregion\r
-\r
- #region ctor\r
- public Rectangle(Point p, Size s)\r
- {\r
- _x = p.X;\r
- _y = p.Y;\r
- _width = s.Width;\r
- _height = s.Height;\r
- }\r
- public Rectangle(Size s)\r
- {\r
- _x = 0;\r
- _y = 0;\r
- _width = s.Width;\r
- _height = s.Height;\r
- }\r
- public Rectangle(int x, int y, int width, int height)\r
- {\r
- _x = x;\r
- _y = y;\r
- _width = width;\r
- _height = height;\r
- }\r
- #endregion\r
-\r
- #region PROPERTIES\r
- [XmlIgnore]public int X{\r
- get { return _x; }\r
- set { _x = value; }\r
- }\r
- [XmlIgnore]public int Y{\r
- get { return _y; }\r
- set { _y = value; }\r
- }\r
- [XmlIgnore]public int Left{\r
- get { return _x; }\r
- set { _x = value; }\r
- }\r
- [XmlIgnore]public int Top{\r
- get { return _y; }\r
- set { _y = value; }\r
- }\r
- [XmlIgnore]public int Right{\r
- get { return _x + _width; }\r
- }\r
- [XmlIgnore]public int Bottom{\r
- get { return _y + _height; }\r
- }\r
- [XmlIgnore]public int Width{\r
- get { return _width; }\r
- set { _width = value; }\r
- }\r
- [XmlIgnore]public int Height{\r
- get { return _height; }\r
- set { _height = value; }\r
- }\r
- [XmlIgnore]public Size Size{\r
- get { return new Size(Width, Height); }\r
- set\r
- {\r
- Width = value.Width;\r
- Height = value.Height;\r
- }\r
- }\r
- [XmlIgnore]public Point Position{\r
- get { return new Point(X, Y); }\r
- set\r
- {\r
- X = value.X;\r
- Y = value.Y;\r
- }\r
- }\r
- [XmlIgnore]public Point TopLeft{\r
- set\r
- {\r
- X = value.X;\r
- Y = value.Y;\r
- }\r
- get { return new Point(X, Y); }\r
- }\r
- [XmlIgnore]public Point TopRight{\r
- get { return new Point(Right, Y); }\r
- }\r
- [XmlIgnore]public Point BottomLeft{\r
- get { return new Point(X, Bottom); }\r
- }\r
- [XmlIgnore]public Point BottomRight{\r
- get { return new Point(Right, Bottom); }\r
- }\r
- [XmlIgnore]public Point Center\r
- {\r
- get { return new Point(Left + Width / 2, Top + Height / 2); }\r
- }\r
- #endregion\r
-\r
- #region FUNCTIONS\r
- public void Inflate(int xDelta, int yDelta)\r
- {\r
- this.X -= xDelta;\r
- this.Width += 2 * xDelta;\r
- this.Y -= yDelta;\r
- this.Height += 2 * yDelta;\r
- }\r
- public void Inflate(int delta)\r
- {\r
- Inflate (delta, delta);\r
- }\r
- public bool ContainsOrIsEqual(Point p)\r
- {\r
- return (p.X >= X && p.X <= X + Width && p.Y >= Y && p.Y <= Y + Height) ?\r
- true : false;\r
- }\r
- public bool ContainsOrIsEqual(Rectangle r)\r
- {\r
- return r.TopLeft >= this.TopLeft && r.BottomRight <= this.BottomRight ? true : false;\r
- }\r
- public bool Intersect(Rectangle r)\r
- {\r
- int maxLeft = Math.Max(this.Left, r.Left);\r
- int minRight = Math.Min(this.Right, r.Right);\r
- int maxTop = Math.Max(this.Top, r.Top);\r
- int minBottom = Math.Min(this.Bottom, r.Bottom);\r
-\r
- return (maxLeft < minRight) && (maxTop < minBottom) ?\r
- true : false;\r
- }\r
- public Rectangle Intersection(Rectangle r)\r
- {\r
- Rectangle result = new Rectangle();\r
- \r
- if (r.Left >= this.Left)\r
- result.Left = r.Left;\r
- else\r
- result.TopLeft = this.TopLeft;\r
-\r
- if (r.Right >= this.Right)\r
- result.Width = this.Right - result.Left;\r
- else\r
- result.Width = r.Right - result.Left;\r
-\r
- if (r.Top >= this.Top)\r
- result.Top = r.Top;\r
- else\r
- result.Top = this.Top;\r
-\r
- if (r.Bottom >= this.Bottom)\r
- result.Height = this.Bottom - result.Top;\r
- else\r
- result.Height = r.Bottom - result.Top;\r
-\r
- return result;\r
- }\r
- #endregion\r
-\r
- #region operators\r
- public static implicit operator Rectangle(System.Drawing.Rectangle r)\r
- {\r
- return new Rectangle(r.X, r.Y, r.Width, r.Height);\r
- }\r
- public static implicit operator System.Drawing.Rectangle(Rectangle r)\r
- {\r
- return new System.Drawing.Rectangle(r.X, r.Y, r.Width, r.Height);\r
- }\r
- public static implicit operator Cairo.Rectangle(Rectangle r)\r
- {\r
- return new Cairo.Rectangle((double)r.X, (double)r.Y, (double)r.Width, (double)r.Height);\r
- }\r
- public static Rectangle operator +(Rectangle r1, Rectangle r2)\r
- {\r
- int x = Math.Min(r1.X, r2.X);\r
- int y = Math.Min(r1.Y, r2.Y);\r
- int x2 = Math.Max(r1.Right, r2.Right);\r
- int y2 = Math.Max(r1.Bottom, r2.Bottom);\r
- return new Rectangle(x, y, x2 - x, y2 - y);\r
- }\r
- public static Rectangle operator +(Rectangle r, Point p)\r
- {\r
- return new Rectangle(r.X + p.X, r.Y + p.Y, r.Width, r.Height);\r
- }\r
- public static Rectangle operator -(Rectangle r, Point p)\r
- {\r
- return new Rectangle(r.X - p.X, r.Y - p.Y, r.Width, r.Height);\r
- }\r
- public static bool operator ==(Rectangle r1, Rectangle r2)\r
- {\r
- return r1.TopLeft == r2.TopLeft && r1.Size == r2.Size ? true : false;\r
- }\r
- public static bool operator !=(Rectangle r1, Rectangle r2)\r
- {\r
- return r1.TopLeft == r2.TopLeft && r1.Size == r2.Size ? false : true;\r
- }\r
- #endregion\r
-\r
- public RectanglesRelations test(Rectangle r)\r
- {\r
- if (r == this)\r
- return RectanglesRelations.Equal;\r
-\r
- int nbrPtIncluded = 0;\r
-\r
- if (this.ContainsOrIsEqual(r.TopLeft))\r
- nbrPtIncluded++;\r
- if (this.ContainsOrIsEqual(r.TopRight))\r
- nbrPtIncluded++;\r
- if (this.ContainsOrIsEqual(r.BottomLeft))\r
- nbrPtIncluded++;\r
- if (this.ContainsOrIsEqual(r.BottomRight))\r
- nbrPtIncluded++;\r
-\r
- switch (nbrPtIncluded)\r
- {\r
- case 0:\r
- return RectanglesRelations.NoRelation;\r
- case 4:\r
- return RectanglesRelations.Contains;\r
- default:\r
- return RectanglesRelations.Intersect;\r
- }\r
- }\r
-\r
- public static Rectangle Zero\r
- {\r
- get { return new Rectangle(0, 0, 0, 0); }\r
- }\r
- public static Rectangle Empty\r
- {\r
- get { return Zero; }\r
- }\r
- public override string ToString()\r
- {\r
- return string.Format("{0};{1};{2};{3}", X, Y, Width, Height);\r
- }\r
- public static Rectangle Parse(string s)\r
- {\r
- string[] d = s.Split(new char[] { ';' });\r
- return new Rectangle(\r
- int.Parse(d[0]),\r
- int.Parse(d[1]),\r
- int.Parse(d[2]),\r
- int.Parse(d[3]));\r
- }\r
- }\r
-\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml.Serialization;
+
+namespace Crow
+{
+ public struct Rectangle
+ {
+ #region private fields
+ int _x;
+ int _y;
+ int _width;
+ int _height;
+ #endregion
+
+ #region ctor
+ public Rectangle(Point p, Size s)
+ {
+ _x = p.X;
+ _y = p.Y;
+ _width = s.Width;
+ _height = s.Height;
+ }
+ public Rectangle(Size s)
+ {
+ _x = 0;
+ _y = 0;
+ _width = s.Width;
+ _height = s.Height;
+ }
+ public Rectangle(int x, int y, int width, int height)
+ {
+ _x = x;
+ _y = y;
+ _width = width;
+ _height = height;
+ }
+ #endregion
+
+ #region PROPERTIES
+ [XmlIgnore]public int X{
+ get { return _x; }
+ set { _x = value; }
+ }
+ [XmlIgnore]public int Y{
+ get { return _y; }
+ set { _y = value; }
+ }
+ [XmlIgnore]public int Left{
+ get { return _x; }
+ set { _x = value; }
+ }
+ [XmlIgnore]public int Top{
+ get { return _y; }
+ set { _y = value; }
+ }
+ [XmlIgnore]public int Right{
+ get { return _x + _width; }
+ }
+ [XmlIgnore]public int Bottom{
+ get { return _y + _height; }
+ }
+ [XmlIgnore]public int Width{
+ get { return _width; }
+ set { _width = value; }
+ }
+ [XmlIgnore]public int Height{
+ get { return _height; }
+ set { _height = value; }
+ }
+ [XmlIgnore]public Size Size{
+ get { return new Size(Width, Height); }
+ set
+ {
+ Width = value.Width;
+ Height = value.Height;
+ }
+ }
+ [XmlIgnore]public Point Position{
+ get { return new Point(X, Y); }
+ set
+ {
+ X = value.X;
+ Y = value.Y;
+ }
+ }
+ [XmlIgnore]public Point TopLeft{
+ set
+ {
+ X = value.X;
+ Y = value.Y;
+ }
+ get { return new Point(X, Y); }
+ }
+ [XmlIgnore]public Point TopRight{
+ get { return new Point(Right, Y); }
+ }
+ [XmlIgnore]public Point BottomLeft{
+ get { return new Point(X, Bottom); }
+ }
+ [XmlIgnore]public Point BottomRight{
+ get { return new Point(Right, Bottom); }
+ }
+ [XmlIgnore]public Point Center
+ {
+ get { return new Point(Left + Width / 2, Top + Height / 2); }
+ }
+ #endregion
+
+ #region FUNCTIONS
+ public void Inflate(int xDelta, int yDelta)
+ {
+ this.X -= xDelta;
+ this.Width += 2 * xDelta;
+ this.Y -= yDelta;
+ this.Height += 2 * yDelta;
+ }
+ public void Inflate(int delta)
+ {
+ Inflate (delta, delta);
+ }
+ public bool ContainsOrIsEqual(Point p)
+ {
+ return (p.X >= X && p.X <= X + Width && p.Y >= Y && p.Y <= Y + Height) ?
+ true : false;
+ }
+ public bool ContainsOrIsEqual(Rectangle r)
+ {
+ return r.TopLeft >= this.TopLeft && r.BottomRight <= this.BottomRight ? true : false;
+ }
+ public bool Intersect(Rectangle r)
+ {
+ int maxLeft = Math.Max(this.Left, r.Left);
+ int minRight = Math.Min(this.Right, r.Right);
+ int maxTop = Math.Max(this.Top, r.Top);
+ int minBottom = Math.Min(this.Bottom, r.Bottom);
+
+ return (maxLeft < minRight) && (maxTop < minBottom) ?
+ true : false;
+ }
+ public Rectangle Intersection(Rectangle r)
+ {
+ Rectangle result = new Rectangle();
+
+ if (r.Left >= this.Left)
+ result.Left = r.Left;
+ else
+ result.TopLeft = this.TopLeft;
+
+ if (r.Right >= this.Right)
+ result.Width = this.Right - result.Left;
+ else
+ result.Width = r.Right - result.Left;
+
+ if (r.Top >= this.Top)
+ result.Top = r.Top;
+ else
+ result.Top = this.Top;
+
+ if (r.Bottom >= this.Bottom)
+ result.Height = this.Bottom - result.Top;
+ else
+ result.Height = r.Bottom - result.Top;
+
+ return result;
+ }
+ #endregion
+
+ #region operators
+ public static implicit operator Rectangle(System.Drawing.Rectangle r)
+ {
+ return new Rectangle(r.X, r.Y, r.Width, r.Height);
+ }
+ public static implicit operator System.Drawing.Rectangle(Rectangle r)
+ {
+ return new System.Drawing.Rectangle(r.X, r.Y, r.Width, r.Height);
+ }
+ public static implicit operator Cairo.Rectangle(Rectangle r)
+ {
+ return new Cairo.Rectangle((double)r.X, (double)r.Y, (double)r.Width, (double)r.Height);
+ }
+ public static Rectangle operator +(Rectangle r1, Rectangle r2)
+ {
+ int x = Math.Min(r1.X, r2.X);
+ int y = Math.Min(r1.Y, r2.Y);
+ int x2 = Math.Max(r1.Right, r2.Right);
+ int y2 = Math.Max(r1.Bottom, r2.Bottom);
+ return new Rectangle(x, y, x2 - x, y2 - y);
+ }
+ public static Rectangle operator +(Rectangle r, Point p)
+ {
+ return new Rectangle(r.X + p.X, r.Y + p.Y, r.Width, r.Height);
+ }
+ public static Rectangle operator -(Rectangle r, Point p)
+ {
+ return new Rectangle(r.X - p.X, r.Y - p.Y, r.Width, r.Height);
+ }
+ public static bool operator ==(Rectangle r1, Rectangle r2)
+ {
+ return r1.TopLeft == r2.TopLeft && r1.Size == r2.Size ? true : false;
+ }
+ public static bool operator !=(Rectangle r1, Rectangle r2)
+ {
+ return r1.TopLeft == r2.TopLeft && r1.Size == r2.Size ? false : true;
+ }
+ #endregion
+
+ public RectanglesRelations test(Rectangle r)
+ {
+ if (r == this)
+ return RectanglesRelations.Equal;
+
+ int nbrPtIncluded = 0;
+
+ if (this.ContainsOrIsEqual(r.TopLeft))
+ nbrPtIncluded++;
+ if (this.ContainsOrIsEqual(r.TopRight))
+ nbrPtIncluded++;
+ if (this.ContainsOrIsEqual(r.BottomLeft))
+ nbrPtIncluded++;
+ if (this.ContainsOrIsEqual(r.BottomRight))
+ nbrPtIncluded++;
+
+ switch (nbrPtIncluded)
+ {
+ case 0:
+ return RectanglesRelations.NoRelation;
+ case 4:
+ return RectanglesRelations.Contains;
+ default:
+ return RectanglesRelations.Intersect;
+ }
+ }
+
+ public static Rectangle Zero
+ {
+ get { return new Rectangle(0, 0, 0, 0); }
+ }
+ public static Rectangle Empty
+ {
+ get { return Zero; }
+ }
+ public override string ToString()
+ {
+ return string.Format("{0};{1};{2};{3}", X, Y, Width, Height);
+ }
+ public static Rectangle Parse(string s)
+ {
+ string[] d = s.Split(new char[] { ';' });
+ return new Rectangle(
+ int.Parse(d[0]),
+ int.Parse(d[1]),
+ int.Parse(d[2]),
+ int.Parse(d[3]));
+ }
+ }
+
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using Cairo;\r
-using System.Diagnostics;\r
-\r
-namespace Crow\r
-{\r
- public class Rectangles\r
- {\r
- public List<Rectangle> list = new List<Rectangle>();\r
- public int count\r
- {\r
- get { return list.Count; }\r
- }\r
-\r
- public void AddRectangle(Rectangle r)\r
- {\r
- if (rectIsNotContainedInRectangles (r)) {\r
- list.Add (r);\r
- boundsUpToDate = false;\r
- }\r
- }\r
- public void Reset()\r
- {\r
- list = new List<Rectangle>();\r
- _bounds = Rectangle.Empty;\r
- boundsUpToDate = true;\r
- }\r
- bool rectIsNotContainedInRectangles(Rectangle r)\r
- {\r
- foreach (Rectangle rInList in list)\r
- if (rInList.ContainsOrIsEqual(r))\r
- return false;\r
- return true;\r
- }\r
- \r
- public bool intersect(Rectangle r)\r
- {\r
- foreach (Rectangle rInList in list)\r
- if (rInList.Intersect(r))\r
- return true;\r
- return false;\r
- }\r
- \r
- public Rectangles intersectingRects(Rectangle r)\r
- {\r
- Rectangles tmp = new Rectangles();\r
-\r
- foreach (Rectangle rInList in list)\r
- if (rInList.Intersect(r))\r
- tmp.list.Add(rInList);//on bypass le test déjà fait a l'ajout intial du rect dans la liste\r
-\r
- return tmp;\r
- }\r
- public Rectangles SmallerContainedRects(Rectangle r)\r
- {\r
- Rectangles tmp = new Rectangles();\r
-\r
- foreach (Rectangle rInList in list)\r
- if (r.ContainsOrIsEqual(rInList) && rInList.Size < r.Size)\r
- tmp.list.Add(rInList);\r
-\r
- return tmp;\r
- }\r
- /// <summary>\r
- /// Return rectangles with size smaller than r.size\r
- /// </summary>\r
- public Rectangles SmallerRects(Rectangle r)\r
- {\r
- Rectangles tmp = new Rectangles();\r
-\r
- foreach (Rectangle rInList in list)\r
- if (rInList.Size < r.Size)\r
- tmp.list.Add(rInList);\r
-\r
- return tmp;\r
- }\r
- public Rectangles containedOrEqualRects(Rectangle r)\r
- {\r
- Rectangles tmp = new Rectangles();\r
-\r
- foreach (Rectangle rInList in list)\r
- if (r.ContainsOrIsEqual(rInList))// && rInList.Size <= r.Size)\r
- tmp.list.Add(rInList);\r
-\r
- return tmp;\r
- }\r
- public void Srcoll(GraphicObject w)\r
- {\r
- Scroller sw = w as Scroller;\r
- if (sw == null)\r
- return;\r
-\r
- List<Rectangle> newList = new List<Rectangle>();\r
-\r
- foreach (Rectangle rInList in list)\r
- {\r
- Rectangle r = rInList;\r
-\r
- if (sw.VerticalScrolling)\r
- r.Top -= (int)sw.ScrollY;\r
- if (sw.HorizontalScrolling)\r
- r.Left -= (int)sw.ScrollX;\r
-\r
- newList.Add(r);\r
- }\r
- list = newList; \r
- }\r
- public void Rebase(GraphicObject w)\r
- {\r
- Rectangle r = w.Parent.ContextCoordinates(w.Slot);\r
- List<Rectangle> newList = new List<Rectangle>();\r
-\r
- foreach (Rectangle rInList in list)\r
- {\r
- Rectangle rebasedR = rInList;\r
- rebasedR.TopLeft-= r.TopLeft;\r
-\r
- Scroller sw = w as Scroller;\r
- if (sw != null)\r
- {\r
- if (sw.VerticalScrolling) {\r
- rebasedR.Top -= (int)sw.ScrollY;\r
-// if (sw.scrollY < 0)\r
-// Debug.WriteLine ("..");\r
- }if (sw.HorizontalScrolling)\r
- rebasedR.Left -= (int)sw.ScrollX;\r
- }\r
-\r
- newList.Add(rebasedR);\r
- }\r
- list = newList; \r
- }\r
- public void stroke(Context ctx, Color c)\r
- {\r
- foreach (Rectangle r in list)\r
- {\r
- ctx.Rectangle(r);\r
- }\r
-\r
- ctx.SetSourceColor(c);\r
-\r
- ctx.LineWidth = 2;\r
- ctx.Stroke ();\r
- }\r
- public void clearAndClip(Context ctx)\r
- {\r
- foreach (Rectangle r in list)\r
- ctx.Rectangle(r);\r
-\r
- ctx.ClipPreserve();\r
- ctx.Operator = Operator.Clear; \r
- ctx.Fill();\r
- ctx.Operator = Operator.Over; \r
- }\r
-\r
- public void clip(Context ctx)\r
- {\r
- foreach (Rectangle r in list)\r
- {\r
- ctx.Rectangle(r);\r
- }\r
-\r
- ctx.Clip();\r
- }\r
-\r
- Rectangle _bounds;\r
- bool boundsUpToDate = true;\r
- public Rectangle Bounds {\r
- get { \r
- if (!boundsUpToDate) {\r
- _bounds = Rectangle.Empty;\r
- foreach (Rectangle rInList in list)\r
- _bounds += rInList;\r
- boundsUpToDate = true;\r
- }\r
- return _bounds;\r
- }\r
- }\r
- public void clear(Context ctx)\r
- {\r
- //ctx.Save();\r
-\r
- foreach (Rectangle r in list)\r
- {\r
- ctx.Rectangle(r);\r
- }\r
- ctx.Operator = Operator.Clear;\r
- ctx.Fill();\r
- ctx.Operator = Operator.Over;\r
- //ctx.Restore();\r
- }\r
- public override string ToString ()\r
- {\r
- string tmp = "";\r
- foreach (Rectangle r in list) {\r
- tmp += r.ToString ();\r
- }\r
- return tmp;\r
- }\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Cairo;
+using System.Diagnostics;
+
+namespace Crow
+{
+ public class Rectangles
+ {
+ public List<Rectangle> list = new List<Rectangle>();
+ public int count
+ {
+ get { return list.Count; }
+ }
+
+ public void AddRectangle(Rectangle r)
+ {
+ if (rectIsNotContainedInRectangles (r)) {
+ list.Add (r);
+ boundsUpToDate = false;
+ }
+ }
+ public void Reset()
+ {
+ list = new List<Rectangle>();
+ _bounds = Rectangle.Empty;
+ boundsUpToDate = true;
+ }
+ bool rectIsNotContainedInRectangles(Rectangle r)
+ {
+ foreach (Rectangle rInList in list)
+ if (rInList.ContainsOrIsEqual(r))
+ return false;
+ return true;
+ }
+
+ public bool intersect(Rectangle r)
+ {
+ foreach (Rectangle rInList in list)
+ if (rInList.Intersect(r))
+ return true;
+ return false;
+ }
+
+ public Rectangles intersectingRects(Rectangle r)
+ {
+ Rectangles tmp = new Rectangles();
+
+ foreach (Rectangle rInList in list)
+ if (rInList.Intersect(r))
+ tmp.list.Add(rInList);//on bypass le test déjà fait a l'ajout intial du rect dans la liste
+
+ return tmp;
+ }
+ public Rectangles SmallerContainedRects(Rectangle r)
+ {
+ Rectangles tmp = new Rectangles();
+
+ foreach (Rectangle rInList in list)
+ if (r.ContainsOrIsEqual(rInList) && rInList.Size < r.Size)
+ tmp.list.Add(rInList);
+
+ return tmp;
+ }
+ /// <summary>
+ /// Return rectangles with size smaller than r.size
+ /// </summary>
+ public Rectangles SmallerRects(Rectangle r)
+ {
+ Rectangles tmp = new Rectangles();
+
+ foreach (Rectangle rInList in list)
+ if (rInList.Size < r.Size)
+ tmp.list.Add(rInList);
+
+ return tmp;
+ }
+ public Rectangles containedOrEqualRects(Rectangle r)
+ {
+ Rectangles tmp = new Rectangles();
+
+ foreach (Rectangle rInList in list)
+ if (r.ContainsOrIsEqual(rInList))// && rInList.Size <= r.Size)
+ tmp.list.Add(rInList);
+
+ return tmp;
+ }
+ public void Srcoll(GraphicObject w)
+ {
+ Scroller sw = w as Scroller;
+ if (sw == null)
+ return;
+
+ List<Rectangle> newList = new List<Rectangle>();
+
+ foreach (Rectangle rInList in list)
+ {
+ Rectangle r = rInList;
+
+ if (sw.VerticalScrolling)
+ r.Top -= (int)sw.ScrollY;
+ if (sw.HorizontalScrolling)
+ r.Left -= (int)sw.ScrollX;
+
+ newList.Add(r);
+ }
+ list = newList;
+ }
+ public void Rebase(GraphicObject w)
+ {
+ Rectangle r = w.Parent.ContextCoordinates(w.Slot);
+ List<Rectangle> newList = new List<Rectangle>();
+
+ foreach (Rectangle rInList in list)
+ {
+ Rectangle rebasedR = rInList;
+ rebasedR.TopLeft-= r.TopLeft;
+
+ Scroller sw = w as Scroller;
+ if (sw != null)
+ {
+ if (sw.VerticalScrolling) {
+ rebasedR.Top -= (int)sw.ScrollY;
+// if (sw.scrollY < 0)
+// Debug.WriteLine ("..");
+ }if (sw.HorizontalScrolling)
+ rebasedR.Left -= (int)sw.ScrollX;
+ }
+
+ newList.Add(rebasedR);
+ }
+ list = newList;
+ }
+ public void stroke(Context ctx, Color c)
+ {
+ foreach (Rectangle r in list)
+ {
+ ctx.Rectangle(r);
+ }
+
+ ctx.SetSourceColor(c);
+
+ ctx.LineWidth = 2;
+ ctx.Stroke ();
+ }
+ public void clearAndClip(Context ctx)
+ {
+ foreach (Rectangle r in list)
+ ctx.Rectangle(r);
+
+ ctx.ClipPreserve();
+ ctx.Operator = Operator.Clear;
+ ctx.Fill();
+ ctx.Operator = Operator.Over;
+ }
+
+ public void clip(Context ctx)
+ {
+ foreach (Rectangle r in list)
+ {
+ ctx.Rectangle(r);
+ }
+
+ ctx.Clip();
+ }
+
+ Rectangle _bounds;
+ bool boundsUpToDate = true;
+ public Rectangle Bounds {
+ get {
+ if (!boundsUpToDate) {
+ _bounds = Rectangle.Empty;
+ foreach (Rectangle rInList in list)
+ _bounds += rInList;
+ boundsUpToDate = true;
+ }
+ return _bounds;
+ }
+ }
+ public void clear(Context ctx)
+ {
+ //ctx.Save();
+
+ foreach (Rectangle r in list)
+ {
+ ctx.Rectangle(r);
+ }
+ ctx.Operator = Operator.Clear;
+ ctx.Fill();
+ ctx.Operator = Operator.Over;
+ //ctx.Restore();
+ }
+ public override string ToString ()
+ {
+ string tmp = "";
+ foreach (Rectangle r in list) {
+ tmp += r.ToString ();
+ }
+ return tmp;
+ }
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-\r
-namespace Crow\r
-{\r
- public struct Size\r
- {\r
- public static Size Zero\r
- { get { return new Size(0, 0); } }\r
-\r
- int _width;\r
- int _height;\r
-\r
- public Size(int width, int height)\r
- {\r
- _width = width;\r
- _height = height;\r
- }\r
- public Size(int size)\r
- {\r
- _width = size;\r
- _height = size;\r
- }\r
- public int Width\r
- {\r
- get { return _width; }\r
- set { _width = value; }\r
- }\r
- public int Height\r
- {\r
- get { return _height; }\r
- set { _height = value; }\r
- }\r
-\r
- #region operators\r
- public static implicit operator Rectangle(Size s)\r
- {\r
- return new Rectangle (s);\r
- }\r
- public static implicit operator Size(int i)\r
- {\r
- return new Size(i, i);\r
- }\r
- public static implicit operator string(Size s)\r
- {\r
- return s.ToString ();\r
- }\r
- public static implicit operator Size(string s)\r
- {\r
- return string.IsNullOrEmpty (s) ? Size.Zero : Parse (s);\r
- }\r
- public static bool operator ==(Size s1, Size s2)\r
- {\r
- if (s1.Width == s2.Width && s1.Height == s2.Height)\r
- return true;\r
- else\r
- return false;\r
- }\r
- public static bool operator !=(Size s1, Size s2)\r
- {\r
- if (s1.Width == s2.Width && s1.Height == s2.Height)\r
- return false;\r
- else\r
- return true;\r
- }\r
- public static bool operator >(Size s1, Size s2)\r
- {\r
- if (s1.Width > s2.Width && s1.Height > s2.Height)\r
- return true;\r
- else\r
- return false;\r
- }\r
- public static bool operator >=(Size s1, Size s2)\r
- {\r
- if (s1.Width >= s2.Width && s1.Height >= s2.Height)\r
- return true;\r
- else\r
- return false;\r
- }\r
- public static bool operator <(Size s1, Size s2)\r
- {\r
- if (s1.Width < s2.Width)\r
- if (s1.Height <= s2.Height)\r
- return true;\r
- else\r
- return false;\r
- else if (s1.Width == s2.Width && s1.Height < s2.Height)\r
- return true;\r
-\r
- return false;\r
- }\r
- public static bool operator <(Size s, int i)\r
- {\r
- return s.Width < i && s.Height < i ? true : false;\r
- }\r
- public static bool operator <=(Size s, int i)\r
- {\r
- return s.Width <= i && s.Height <= i ? true : false;\r
- }\r
- public static bool operator <=(Size s1, Size s2)\r
- {\r
- if (s1.Width <= s2.Width && s1.Height <= s2.Height)\r
- return true;\r
- else\r
- return false;\r
- }\r
- public static bool operator ==(Size s, int i)\r
- {\r
- if (s.Width == i && s.Height == i)\r
- return true;\r
- else\r
- return false;\r
- }\r
- public static bool operator !=(Size s, int i)\r
- {\r
- if (s.Width == i && s.Height == i)\r
- return false;\r
- else\r
- return true;\r
- }\r
- public static Size operator +(Size s1, Size s2)\r
- {\r
- return new Size(s1.Width + s2.Width, s1.Height + s2.Height);\r
- }\r
- public static Size operator +(Size s, int i)\r
- {\r
- return new Size(s.Width + i, s.Height + i);\r
- }\r
- #endregion\r
- \r
- public override string ToString()\r
- {\r
- return string.Format("{0},{1}", Width, Height);\r
- }\r
- public static Size Parse(string s)\r
- {\r
- string[] d = s.Split(new char[] { ';' });\r
- return d.Length == 1 ? new Size(int.Parse(d[0])) : new Size(\r
- int.Parse(d[0]),\r
- int.Parse(d[1]));\r
- }\r
- }\r
-\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Crow
+{
+ public struct Size
+ {
+ public static Size Zero
+ { get { return new Size(0, 0); } }
+
+ int _width;
+ int _height;
+
+ public Size(int width, int height)
+ {
+ _width = width;
+ _height = height;
+ }
+ public Size(int size)
+ {
+ _width = size;
+ _height = size;
+ }
+ public int Width
+ {
+ get { return _width; }
+ set { _width = value; }
+ }
+ public int Height
+ {
+ get { return _height; }
+ set { _height = value; }
+ }
+
+ #region operators
+ public static implicit operator Rectangle(Size s)
+ {
+ return new Rectangle (s);
+ }
+ public static implicit operator Size(int i)
+ {
+ return new Size(i, i);
+ }
+ public static implicit operator string(Size s)
+ {
+ return s.ToString ();
+ }
+ public static implicit operator Size(string s)
+ {
+ return string.IsNullOrEmpty (s) ? Size.Zero : Parse (s);
+ }
+ public static bool operator ==(Size s1, Size s2)
+ {
+ if (s1.Width == s2.Width && s1.Height == s2.Height)
+ return true;
+ else
+ return false;
+ }
+ public static bool operator !=(Size s1, Size s2)
+ {
+ if (s1.Width == s2.Width && s1.Height == s2.Height)
+ return false;
+ else
+ return true;
+ }
+ public static bool operator >(Size s1, Size s2)
+ {
+ if (s1.Width > s2.Width && s1.Height > s2.Height)
+ return true;
+ else
+ return false;
+ }
+ public static bool operator >=(Size s1, Size s2)
+ {
+ if (s1.Width >= s2.Width && s1.Height >= s2.Height)
+ return true;
+ else
+ return false;
+ }
+ public static bool operator <(Size s1, Size s2)
+ {
+ if (s1.Width < s2.Width)
+ if (s1.Height <= s2.Height)
+ return true;
+ else
+ return false;
+ else if (s1.Width == s2.Width && s1.Height < s2.Height)
+ return true;
+
+ return false;
+ }
+ public static bool operator <(Size s, int i)
+ {
+ return s.Width < i && s.Height < i ? true : false;
+ }
+ public static bool operator <=(Size s, int i)
+ {
+ return s.Width <= i && s.Height <= i ? true : false;
+ }
+ public static bool operator <=(Size s1, Size s2)
+ {
+ if (s1.Width <= s2.Width && s1.Height <= s2.Height)
+ return true;
+ else
+ return false;
+ }
+ public static bool operator ==(Size s, int i)
+ {
+ if (s.Width == i && s.Height == i)
+ return true;
+ else
+ return false;
+ }
+ public static bool operator !=(Size s, int i)
+ {
+ if (s.Width == i && s.Height == i)
+ return false;
+ else
+ return true;
+ }
+ public static Size operator +(Size s1, Size s2)
+ {
+ return new Size(s1.Width + s2.Width, s1.Height + s2.Height);
+ }
+ public static Size operator +(Size s, int i)
+ {
+ return new Size(s.Width + i, s.Height + i);
+ }
+ #endregion
+
+ public override string ToString()
+ {
+ return string.Format("{0},{1}", Width, Height);
+ }
+ public static Size Parse(string s)
+ {
+ string[] d = s.Split(new char[] { ';' });
+ return d.Length == 1 ? new Size(int.Parse(d[0])) : new Size(
+ int.Parse(d[0]),
+ int.Parse(d[1]));
+ }
+ }
+
+}
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Runtime.InteropServices;\r
-using System.Diagnostics;\r
-\r
-namespace Crow\r
-{\r
- public static class Win32\r
- {\r
- [DllImport("user32.dll")]\r
- public static extern IntPtr GetDC(IntPtr hWnd);\r
- #region mouse winApi\r
-\r
- [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]\r
- public struct Point\r
- {\r
-\r
- /// LONG->int\r
- public int x;\r
-\r
- /// LONG->int\r
- public int y;\r
- }\r
- [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]\r
- public struct HICON__\r
- {\r
-\r
- /// int\r
- public int unused;\r
- }\r
-\r
-#if _WIN32 || _WIN64\r
- /// Return Type: HCURSOR->HICON->HICON__*\r
- ///hCursor: HCURSOR->HICON->HICON__*\r
- [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursor")]\r
- public static extern System.IntPtr SetCursor([System.Runtime.InteropServices.InAttribute()] System.IntPtr hCursor);\r
-#elif __linux__\r
- public static System.IntPtr SetCursor(System.IntPtr hCursor)\r
- {\r
-\r
- return (IntPtr)0;\r
- }\r
-#endif\r
-\r
- /// Return Type: BOOL->int\r
- ///lpPoint: LPPOINT->tagPOINT*\r
- [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetCursorPos")]\r
- [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)]\r
- public static extern bool GetCursorPos([System.Runtime.InteropServices.OutAttribute()] out Point lpPoint);\r
-\r
- /// Return Type: BOOL->int\r
- ///X: int\r
- ///Y: int\r
- [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursorPos")]\r
- [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)]\r
- public static extern bool SetCursorPos(int X, int Y);\r
-\r
- #endregion\r
- }\r
-}\r
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Diagnostics;
+
+namespace Crow
+{
+ public static class Win32
+ {
+ [DllImport("user32.dll")]
+ public static extern IntPtr GetDC(IntPtr hWnd);
+ #region mouse winApi
+
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+ public struct Point
+ {
+
+ /// LONG->int
+ public int x;
+
+ /// LONG->int
+ public int y;
+ }
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+ public struct HICON__
+ {
+
+ /// int
+ public int unused;
+ }
+
+#if _WIN32 || _WIN64
+ /// Return Type: HCURSOR->HICON->HICON__*
+ ///hCursor: HCURSOR->HICON->HICON__*
+ [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursor")]
+ public static extern System.IntPtr SetCursor([System.Runtime.InteropServices.InAttribute()] System.IntPtr hCursor);
+#elif __linux__
+ public static System.IntPtr SetCursor(System.IntPtr hCursor)
+ {
+
+ return (IntPtr)0;
+ }
+#endif
+
+ /// Return Type: BOOL->int
+ ///lpPoint: LPPOINT->tagPOINT*
+ [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetCursorPos")]
+ [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)]
+ public static extern bool GetCursorPos([System.Runtime.InteropServices.OutAttribute()] out Point lpPoint);
+
+ /// Return Type: BOOL->int
+ ///X: int
+ ///Y: int
+ [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursorPos")]
+ [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)]
+ public static extern bool SetCursorPos(int X, int Y);
+
+ #endregion
+ }
+}
- /// <summary>\r
- /// Windows Messages\r
- /// Defined in winuser.h from Windows SDK v6.1\r
- /// Documentation pulled from MSDN.\r
- /// </summary>\r
-using System;\r
-\r
-public enum WM : uint\r
- {\r
- /// <summary>\r
- /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.\r
- /// </summary>\r
- NULL = 0x0000,\r
- /// <summary>\r
- /// The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.\r
- /// </summary>\r
- CREATE = 0x0001,\r
- /// <summary>\r
- /// The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen.\r
- /// This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist.\r
- /// /// </summary>\r
- DESTROY = 0x0002,\r
- /// <summary>\r
- /// The WM_MOVE message is sent after a window has been moved.\r
- /// </summary>\r
- MOVE = 0x0003,\r
- /// <summary>\r
- /// The WM_SIZE message is sent to a window after its size has changed.\r
- /// </summary>\r
- SIZE = 0x0005,\r
- /// <summary>\r
- /// The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately.\r
- /// </summary>\r
- ACTIVATE = 0x0006,\r
- /// <summary>\r
- /// The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus.\r
- /// </summary>\r
- SETFOCUS = 0x0007,\r
- /// <summary>\r
- /// The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus.\r
- /// </summary>\r
- KILLFOCUS = 0x0008,\r
- /// <summary>\r
- /// The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed.\r
- /// </summary>\r
- ENABLE = 0x000A,\r
- /// <summary>\r
- /// An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn.\r
- /// </summary>\r
- SETREDRAW = 0x000B,\r
- /// <summary>\r
- /// An application sends a WM_SETTEXT message to set the text of a window.\r
- /// </summary>\r
- SETTEXT = 0x000C,\r
- /// <summary>\r
- /// An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller.\r
- /// </summary>\r
- GETTEXT = 0x000D,\r
- /// <summary>\r
- /// An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window.\r
- /// </summary>\r
- GETTEXTLENGTH = 0x000E,\r
- /// <summary>\r
- /// The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function.\r
- /// </summary>\r
- PAINT = 0x000F,\r
- /// <summary>\r
- /// The WM_CLOSE message is sent as a signal that a window or an application should terminate.\r
- /// </summary>\r
- CLOSE = 0x0010,\r
- /// <summary>\r
- /// The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.\r
- /// After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.\r
- /// </summary>\r
- QUERYENDSESSION = 0x0011,\r
- /// <summary>\r
- /// The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position.\r
- /// </summary>\r
- QUERYOPEN = 0x0013,\r
- /// <summary>\r
- /// The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.\r
- /// </summary>\r
- ENDSESSION = 0x0016,\r
- /// <summary>\r
- /// The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero.\r
- /// </summary>\r
- QUIT = 0x0012,\r
- /// <summary>\r
- /// The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting.\r
- /// </summary>\r
- ERASEBKGND = 0x0014,\r
- /// <summary>\r
- /// This message is sent to all top-level windows when a change is made to a system color setting.\r
- /// </summary>\r
- SYSCOLORCHANGE = 0x0015,\r
- /// <summary>\r
- /// The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.\r
- /// </summary>\r
- SHOWWINDOW = 0x0018,\r
- /// <summary>\r
- /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\r
- /// Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\r
- /// </summary>\r
- WININICHANGE = 0x001A,\r
- /// <summary>\r
- /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.\r
- /// Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.\r
- /// </summary>\r
- SETTINGCHANGE = WININICHANGE,\r
- /// <summary>\r
- /// The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings.\r
- /// </summary>\r
- DEVMODECHANGE = 0x001B,\r
- /// <summary>\r
- /// The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.\r
- /// </summary>\r
- ACTIVATEAPP = 0x001C,\r
- /// <summary>\r
- /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources.\r
- /// </summary>\r
- FONTCHANGE = 0x001D,\r
- /// <summary>\r
- /// A message that is sent whenever there is a change in the system time.\r
- /// </summary>\r
- TIMECHANGE = 0x001E,\r
- /// <summary>\r
- /// The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.\r
- /// </summary>\r
- CANCELMODE = 0x001F,\r
- /// <summary>\r
- /// The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.\r
- /// </summary>\r
- SETCURSOR = 0x0020,\r
- /// <summary>\r
- /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.\r
- /// </summary>\r
- MOUSEACTIVATE = 0x0021,\r
- /// <summary>\r
- /// The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized.\r
- /// </summary>\r
- CHILDACTIVATE = 0x0022,\r
- /// <summary>\r
- /// The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure.\r
- /// </summary>\r
- QUEUESYNC = 0x0023,\r
- /// <summary>\r
- /// The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size.\r
- /// </summary>\r
- GETMINMAXINFO = 0x0024,\r
- /// <summary>\r
- /// Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks.\r
- /// </summary>\r
- PAINTICON = 0x0026,\r
- /// <summary>\r
- /// Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.\r
- /// </summary>\r
- ICONERASEBKGND = 0x0027,\r
- /// <summary>\r
- /// The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box.\r
- /// </summary>\r
- NEXTDLGCTL = 0x0028,\r
- /// <summary>\r
- /// The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue.\r
- /// </summary>\r
- SPOOLERSTATUS = 0x002A,\r
- /// <summary>\r
- /// The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.\r
- /// </summary>\r
- DRAWITEM = 0x002B,\r
- /// <summary>\r
- /// The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.\r
- /// </summary>\r
- MEASUREITEM = 0x002C,\r
- /// <summary>\r
- /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data.\r
- /// </summary>\r
- DELETEITEM = 0x002D,\r
- /// <summary>\r
- /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message.\r
- /// </summary>\r
- VKEYTOITEM = 0x002E,\r
- /// <summary>\r
- /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message.\r
- /// </summary>\r
- CHARTOITEM = 0x002F,\r
- /// <summary>\r
- /// An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text.\r
- /// </summary>\r
- SETFONT = 0x0030,\r
- /// <summary>\r
- /// An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text.\r
- /// </summary>\r
- GETFONT = 0x0031,\r
- /// <summary>\r
- /// An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window.\r
- /// </summary>\r
- SETHOTKEY = 0x0032,\r
- /// <summary>\r
- /// An application sends a WM_GETHOTKEY message to determine the hot key associated with a window.\r
- /// </summary>\r
- GETHOTKEY = 0x0033,\r
- /// <summary>\r
- /// The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon.\r
- /// </summary>\r
- QUERYDRAGICON = 0x0037,\r
- /// <summary>\r
- /// The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style.\r
- /// </summary>\r
- COMPAREITEM = 0x0039,\r
- /// <summary>\r
- /// Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application.\r
- /// Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message.\r
- /// </summary>\r
- GETOBJECT = 0x003D,\r
- /// <summary>\r
- /// The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.\r
- /// </summary>\r
- COMPACTING = 0x0041,\r
- /// <summary>\r
- /// WM_COMMNOTIFY is Obsolete for Win32-Based Applications\r
- /// </summary>\r
- [Obsolete]\r
- COMMNOTIFY = 0x0044,\r
- /// <summary>\r
- /// The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.\r
- /// </summary>\r
- WINDOWPOSCHANGING = 0x0046,\r
- /// <summary>\r
- /// The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function.\r
- /// </summary>\r
- WINDOWPOSCHANGED = 0x0047,\r
- /// <summary>\r
- /// Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode.\r
- /// Use: POWERBROADCAST\r
- /// </summary>\r
- [Obsolete]\r
- POWER = 0x0048,\r
- /// <summary>\r
- /// An application sends the WM_COPYDATA message to pass data to another application.\r
- /// </summary>\r
- COPYDATA = 0x004A,\r
- /// <summary>\r
- /// The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle.\r
- /// </summary>\r
- CANCELJOURNAL = 0x004B,\r
- /// <summary>\r
- /// Sent by a common control to its parent window when an event has occurred or the control requires some information.\r
- /// </summary>\r
- NOTIFY = 0x004E,\r
- /// <summary>\r
- /// The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately.\r
- /// </summary>\r
- INPUTLANGCHANGEREQUEST = 0x0050,\r
- /// <summary>\r
- /// The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on.\r
- /// </summary>\r
- INPUTLANGCHANGE = 0x0051,\r
- /// <summary>\r
- /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function.\r
- /// </summary>\r
- TCARD = 0x0052,\r
- /// <summary>\r
- /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window.\r
- /// </summary>\r
- HELP = 0x0053,\r
- /// <summary>\r
- /// The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.\r
- /// </summary>\r
- USERCHANGED = 0x0054,\r
- /// <summary>\r
- /// Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control.\r
- /// </summary>\r
- NOTIFYFORMAT = 0x0055,\r
- /// <summary>\r
- /// The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window.\r
- /// </summary>\r
- CONTEXTMENU = 0x007B,\r
- /// <summary>\r
- /// The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles.\r
- /// </summary>\r
- STYLECHANGING = 0x007C,\r
- /// <summary>\r
- /// The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles\r
- /// </summary>\r
- STYLECHANGED = 0x007D,\r
- /// <summary>\r
- /// The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.\r
- /// </summary>\r
- DISPLAYCHANGE = 0x007E,\r
- /// <summary>\r
- /// The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption.\r
- /// </summary>\r
- GETICON = 0x007F,\r
- /// <summary>\r
- /// An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption.\r
- /// </summary>\r
- SETICON = 0x0080,\r
- /// <summary>\r
- /// The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.\r
- /// </summary>\r
- NCCREATE = 0x0081,\r
- /// <summary>\r
- /// The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window.\r
- /// The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed.\r
- /// </summary>\r
- NCDESTROY = 0x0082,\r
- /// <summary>\r
- /// The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes.\r
- /// </summary>\r
- NCCALCSIZE = 0x0083,\r
- /// <summary>\r
- /// The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse.\r
- /// </summary>\r
- NCHITTEST = 0x0084,\r
- /// <summary>\r
- /// The WM_NCPAINT message is sent to a window when its frame must be painted.\r
- /// </summary>\r
- NCPAINT = 0x0085,\r
- /// <summary>\r
- /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state.\r
- /// </summary>\r
- NCACTIVATE = 0x0086,\r
- /// <summary>\r
- /// The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself.\r
- /// </summary>\r
- GETDLGCODE = 0x0087,\r
- /// <summary>\r
- /// The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads.\r
- /// </summary>\r
- SYNCPAINT = 0x0088,\r
- /// <summary>\r
- /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCMOUSEMOVE = 0x00A0,\r
- /// <summary>\r
- /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCLBUTTONDOWN = 0x00A1,\r
- /// <summary>\r
- /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCLBUTTONUP = 0x00A2,\r
- /// <summary>\r
- /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCLBUTTONDBLCLK = 0x00A3,\r
- /// <summary>\r
- /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCRBUTTONDOWN = 0x00A4,\r
- /// <summary>\r
- /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCRBUTTONUP = 0x00A5,\r
- /// <summary>\r
- /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCRBUTTONDBLCLK = 0x00A6,\r
- /// <summary>\r
- /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCMBUTTONDOWN = 0x00A7,\r
- /// <summary>\r
- /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCMBUTTONUP = 0x00A8,\r
- /// <summary>\r
- /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCMBUTTONDBLCLK = 0x00A9,\r
- /// <summary>\r
- /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCXBUTTONDOWN = 0x00AB,\r
- /// <summary>\r
- /// The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCXBUTTONUP = 0x00AC,\r
- /// <summary>\r
- /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.\r
- /// </summary>\r
- NCXBUTTONDBLCLK = 0x00AD,\r
- /// <summary>\r
- /// The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- INPUT_DEVICE_CHANGE = 0x00FE,\r
- /// <summary>\r
- /// The WM_INPUT message is sent to the window that is getting raw input.\r
- /// </summary>\r
- INPUT = 0x00FF,\r
- /// <summary>\r
- /// This message filters for keyboard messages.\r
- /// </summary>\r
- KEYFIRST = 0x0100,\r
- /// <summary>\r
- /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed.\r
- /// </summary>\r
- KEYDOWN = 0x0100,\r
- /// <summary>\r
- /// The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.\r
- /// </summary>\r
- KEYUP = 0x0101,\r
- /// <summary>\r
- /// The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed.\r
- /// </summary>\r
- CHAR = 0x0102,\r
- /// <summary>\r
- /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key.\r
- /// </summary>\r
- DEADCHAR = 0x0103,\r
- /// <summary>\r
- /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter.\r
- /// </summary>\r
- SYSKEYDOWN = 0x0104,\r
- /// <summary>\r
- /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter.\r
- /// </summary>\r
- SYSKEYUP = 0x0105,\r
- /// <summary>\r
- /// The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down.\r
- /// </summary>\r
- SYSCHAR = 0x0106,\r
- /// <summary>\r
- /// The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key.\r
- /// </summary>\r
- SYSDEADCHAR = 0x0107,\r
- /// <summary>\r
- /// The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed.\r
- /// The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle Unicode Supplementary Plane characters.\r
- /// </summary>\r
- UNICHAR = 0x0109,\r
- /// <summary>\r
- /// This message filters for keyboard messages.\r
- /// </summary>\r
- KEYLAST = 0x0109,\r
- /// <summary>\r
- /// Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- IME_STARTCOMPOSITION = 0x010D,\r
- /// <summary>\r
- /// Sent to an application when the IME ends composition. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- IME_ENDCOMPOSITION = 0x010E,\r
- /// <summary>\r
- /// Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- IME_COMPOSITION = 0x010F,\r
- IME_KEYLAST = 0x010F,\r
- /// <summary>\r
- /// The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box.\r
- /// </summary>\r
- INITDIALOG = 0x0110,\r
- /// <summary>\r
- /// The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.\r
- /// </summary>\r
- COMMAND = 0x0111,\r
- /// <summary>\r
- /// A window receives this message when the user chooses a command from the Window menu, clicks the maximize button, minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering this out.\r
- /// </summary>\r
- SYSCOMMAND = 0x0112,\r
- /// <summary>\r
- /// The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function.\r
- /// </summary>\r
- TIMER = 0x0113,\r
- /// <summary>\r
- /// The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control.\r
- /// </summary>\r
- HSCROLL = 0x0114,\r
- /// <summary>\r
- /// The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control.\r
- /// </summary>\r
- VSCROLL = 0x0115,\r
- /// <summary>\r
- /// The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed.\r
- /// </summary>\r
- INITMENU = 0x0116,\r
- /// <summary>\r
- /// The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu.\r
- /// </summary>\r
- INITMENUPOPUP = 0x0117,\r
- /// <summary>\r
- /// The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item.\r
- /// </summary>\r
- MENUSELECT = 0x011F,\r
- /// <summary>\r
- /// The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu.\r
- /// </summary>\r
- MENUCHAR = 0x0120,\r
- /// <summary>\r
- /// The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages.\r
- /// </summary>\r
- ENTERIDLE = 0x0121,\r
- /// <summary>\r
- /// The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item.\r
- /// </summary>\r
- MENURBUTTONUP = 0x0122,\r
- /// <summary>\r
- /// The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item.\r
- /// </summary>\r
- MENUDRAG = 0x0123,\r
- /// <summary>\r
- /// The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item.\r
- /// </summary>\r
- MENUGETOBJECT = 0x0124,\r
- /// <summary>\r
- /// The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed.\r
- /// </summary>\r
- UNINITMENUPOPUP = 0x0125,\r
- /// <summary>\r
- /// The WM_MENUCOMMAND message is sent when the user makes a selection from a menu.\r
- /// </summary>\r
- MENUCOMMAND = 0x0126,\r
- /// <summary>\r
- /// An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed.\r
- /// </summary>\r
- CHANGEUISTATE = 0x0127,\r
- /// <summary>\r
- /// An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows.\r
- /// </summary>\r
- UPDATEUISTATE = 0x0128,\r
- /// <summary>\r
- /// An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window.\r
- /// </summary>\r
- QUERYUISTATE = 0x0129,\r
- /// <summary>\r
- /// The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle.\r
- /// </summary>\r
- CTLCOLORMSGBOX = 0x0132,\r
- /// <summary>\r
- /// An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control.\r
- /// </summary>\r
- CTLCOLOREDIT = 0x0133,\r
- /// <summary>\r
- /// Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle.\r
- /// </summary>\r
- CTLCOLORLISTBOX = 0x0134,\r
- /// <summary>\r
- /// The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message.\r
- /// </summary>\r
- CTLCOLORBTN = 0x0135,\r
- /// <summary>\r
- /// The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle.\r
- /// </summary>\r
- CTLCOLORDLG = 0x0136,\r
- /// <summary>\r
- /// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control.\r
- /// </summary>\r
- CTLCOLORSCROLLBAR = 0x0137,\r
- /// <summary>\r
- /// A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control.\r
- /// </summary>\r
- CTLCOLORSTATIC = 0x0138,\r
- /// <summary>\r
- /// Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function.\r
- /// </summary>\r
- MOUSEFIRST = 0x0200,\r
- /// <summary>\r
- /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- MOUSEMOVE = 0x0200,\r
- /// <summary>\r
- /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- LBUTTONDOWN = 0x0201,\r
- /// <summary>\r
- /// The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- LBUTTONUP = 0x0202,\r
- /// <summary>\r
- /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- LBUTTONDBLCLK = 0x0203,\r
- /// <summary>\r
- /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- RBUTTONDOWN = 0x0204,\r
- /// <summary>\r
- /// The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- RBUTTONUP = 0x0205,\r
- /// <summary>\r
- /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- RBUTTONDBLCLK = 0x0206,\r
- /// <summary>\r
- /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- MBUTTONDOWN = 0x0207,\r
- /// <summary>\r
- /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- MBUTTONUP = 0x0208,\r
- /// <summary>\r
- /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- MBUTTONDBLCLK = 0x0209,\r
- /// <summary>\r
- /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\r
- /// </summary>\r
- MOUSEWHEEL = 0x020A,\r
- /// <summary>\r
- /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- XBUTTONDOWN = 0x020B,\r
- /// <summary>\r
- /// The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- XBUTTONUP = 0x020C,\r
- /// <summary>\r
- /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.\r
- /// </summary>\r
- XBUTTONDBLCLK = 0x020D,\r
- /// <summary>\r
- /// The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.\r
- /// </summary>\r
- MOUSEHWHEEL = 0x020E,\r
- /// <summary>\r
- /// Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function.\r
- /// </summary>\r
- MOUSELAST = 0x020E,\r
- /// <summary>\r
- /// The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.\r
- /// </summary>\r
- PARENTNOTIFY = 0x0210,\r
- /// <summary>\r
- /// The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered.\r
- /// </summary>\r
- ENTERMENULOOP = 0x0211,\r
- /// <summary>\r
- /// The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited.\r
- /// </summary>\r
- EXITMENULOOP = 0x0212,\r
- /// <summary>\r
- /// The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu.\r
- /// </summary>\r
- NEXTMENU = 0x0213,\r
- /// <summary>\r
- /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position.\r
- /// </summary>\r
- SIZING = 0x0214,\r
- /// <summary>\r
- /// The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture.\r
- /// </summary>\r
- CAPTURECHANGED = 0x0215,\r
- /// <summary>\r
- /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.\r
- /// </summary>\r
- MOVING = 0x0216,\r
- /// <summary>\r
- /// Notifies applications that a power-management event has occurred.\r
- /// </summary>\r
- POWERBROADCAST = 0x0218,\r
- /// <summary>\r
- /// Notifies an application of a change to the hardware configuration of a device or the computer.\r
- /// </summary>\r
- DEVICECHANGE = 0x0219,\r
- /// <summary>\r
- /// An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window.\r
- /// </summary>\r
- MDICREATE = 0x0220,\r
- /// <summary>\r
- /// An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window.\r
- /// </summary>\r
- MDIDESTROY = 0x0221,\r
- /// <summary>\r
- /// An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window.\r
- /// </summary>\r
- MDIACTIVATE = 0x0222,\r
- /// <summary>\r
- /// An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size.\r
- /// </summary>\r
- MDIRESTORE = 0x0223,\r
- /// <summary>\r
- /// An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window.\r
- /// </summary>\r
- MDINEXT = 0x0224,\r
- /// <summary>\r
- /// An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window.\r
- /// </summary>\r
- MDIMAXIMIZE = 0x0225,\r
- /// <summary>\r
- /// An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format.\r
- /// </summary>\r
- MDITILE = 0x0226,\r
- /// <summary>\r
- /// An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format.\r
- /// </summary>\r
- MDICASCADE = 0x0227,\r
- /// <summary>\r
- /// An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized.\r
- /// </summary>\r
- MDIICONARRANGE = 0x0228,\r
- /// <summary>\r
- /// An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window.\r
- /// </summary>\r
- MDIGETACTIVE = 0x0229,\r
- /// <summary>\r
- /// An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both.\r
- /// </summary>\r
- MDISETMENU = 0x0230,\r
- /// <summary>\r
- /// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.\r
- /// The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled.\r
- /// </summary>\r
- ENTERSIZEMOVE = 0x0231,\r
- /// <summary>\r
- /// The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.\r
- /// </summary>\r
- EXITSIZEMOVE = 0x0232,\r
- /// <summary>\r
- /// Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files.\r
- /// </summary>\r
- DROPFILES = 0x0233,\r
- /// <summary>\r
- /// An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window.\r
- /// </summary>\r
- MDIREFRESHMENU = 0x0234,\r
- /// <summary>\r
- /// Sent to an application when a window is activated. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- IME_SETCONTEXT = 0x0281,\r
- /// <summary>\r
- /// Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- IME_NOTIFY = 0x0282,\r
- /// <summary>\r
- /// Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters.\r
- /// </summary>\r
- IME_CONTROL = 0x0283,\r
- /// <summary>\r
- /// Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- IME_COMPOSITIONFULL = 0x0284,\r
- /// <summary>\r
- /// Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- IME_SELECT = 0x0285,\r
- /// <summary>\r
- /// Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- IME_CHAR = 0x0286,\r
- /// <summary>\r
- /// Sent to an application to provide commands and request information. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- IME_REQUEST = 0x0288,\r
- /// <summary>\r
- /// Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- IME_KEYDOWN = 0x0290,\r
- /// <summary>\r
- /// Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- IME_KEYUP = 0x0291,\r
- /// <summary>\r
- /// The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent.\r
- /// </summary>\r
- MOUSEHOVER = 0x02A1,\r
- /// <summary>\r
- /// The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent.\r
- /// </summary>\r
- MOUSELEAVE = 0x02A3,\r
- /// <summary>\r
- /// The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent.\r
- /// </summary>\r
- NCMOUSEHOVER = 0x02A0,\r
- /// <summary>\r
- /// The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent.\r
- /// </summary>\r
- NCMOUSELEAVE = 0x02A2,\r
- /// <summary>\r
- /// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.\r
- /// </summary>\r
- WTSSESSION_CHANGE = 0x02B1,\r
- TABLET_FIRST = 0x02c0,\r
- TABLET_LAST = 0x02df,\r
- /// <summary>\r
- /// An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format.\r
- /// </summary>\r
- CUT = 0x0300,\r
- /// <summary>\r
- /// An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format.\r
- /// </summary>\r
- COPY = 0x0301,\r
- /// <summary>\r
- /// An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format.\r
- /// </summary>\r
- PASTE = 0x0302,\r
- /// <summary>\r
- /// An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control.\r
- /// </summary>\r
- CLEAR = 0x0303,\r
- /// <summary>\r
- /// An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted.\r
- /// </summary>\r
- UNDO = 0x0304,\r
- /// <summary>\r
- /// The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function.\r
- /// </summary>\r
- RENDERFORMAT = 0x0305,\r
- /// <summary>\r
- /// The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function.\r
- /// </summary>\r
- RENDERALLFORMATS = 0x0306,\r
- /// <summary>\r
- /// The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard.\r
- /// </summary>\r
- DESTROYCLIPBOARD = 0x0307,\r
- /// <summary>\r
- /// The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard.\r
- /// </summary>\r
- DRAWCLIPBOARD = 0x0308,\r
- /// <summary>\r
- /// The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting.\r
- /// </summary>\r
- PAINTCLIPBOARD = 0x0309,\r
- /// <summary>\r
- /// The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values.\r
- /// </summary>\r
- VSCROLLCLIPBOARD = 0x030A,\r
- /// <summary>\r
- /// The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size.\r
- /// </summary>\r
- SIZECLIPBOARD = 0x030B,\r
- /// <summary>\r
- /// The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format.\r
- /// </summary>\r
- ASKCBFORMATNAME = 0x030C,\r
- /// <summary>\r
- /// The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain.\r
- /// </summary>\r
- CHANGECBCHAIN = 0x030D,\r
- /// <summary>\r
- /// The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values.\r
- /// </summary>\r
- HSCROLLCLIPBOARD = 0x030E,\r
- /// <summary>\r
- /// This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus.\r
- /// </summary>\r
- QUERYNEWPALETTE = 0x030F,\r
- /// <summary>\r
- /// The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette.\r
- /// </summary>\r
- PALETTEISCHANGING = 0x0310,\r
- /// <summary>\r
- /// This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette.\r
- /// This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas.\r
- /// </summary>\r
- PALETTECHANGED = 0x0311,\r
- /// <summary>\r
- /// The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key.\r
- /// </summary>\r
- HOTKEY = 0x0312,\r
- /// <summary>\r
- /// The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.\r
- /// </summary>\r
- PRINT = 0x0317,\r
- /// <summary>\r
- /// The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context.\r
- /// </summary>\r
- PRINTCLIENT = 0x0318,\r
- /// <summary>\r
- /// The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard.\r
- /// </summary>\r
- APPCOMMAND = 0x0319,\r
- /// <summary>\r
- /// The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.\r
- /// </summary>\r
- THEMECHANGED = 0x031A,\r
- /// <summary>\r
- /// Sent when the contents of the clipboard have changed.\r
- /// </summary>\r
- CLIPBOARDUPDATE = 0x031D,\r
- /// <summary>\r
- /// The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop composition has changed.\r
- /// </summary>\r
- DWMCOMPOSITIONCHANGED = 0x031E,\r
- /// <summary>\r
- /// WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message.\r
- /// </summary>\r
- DWMNCRENDERINGCHANGED = 0x031F,\r
- /// <summary>\r
- /// Sent to all top-level windows when the colorization color has changed.\r
- /// </summary>\r
- DWMCOLORIZATIONCOLORCHANGED = 0x0320,\r
- /// <summary>\r
- /// WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register for this message as well. You'd have other windowd go opaque when this message is sent.\r
- /// </summary>\r
- DWMWINDOWMAXIMIZEDCHANGE = 0x0321,\r
- /// <summary>\r
- /// Sent to request extended title bar information. A window receives this message through its WindowProc function.\r
- /// </summary>\r
- GETTITLEBARINFOEX = 0x033F,\r
- HANDHELDFIRST = 0x0358,\r
- HANDHELDLAST = 0x035F,\r
- AFXFIRST = 0x0360,\r
- AFXLAST = 0x037F,\r
- PENWINFIRST = 0x0380,\r
- PENWINLAST = 0x038F,\r
- /// <summary>\r
- /// The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value.\r
- /// </summary>\r
- APP = 0x8000,\r
- /// <summary>\r
- /// The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value.\r
- /// </summary>\r
- USER = 0x0400,\r
-\r
- /// <summary>\r
- /// An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application be started.\r
- /// </summary>\r
- CPL_LAUNCH = USER+0x1000,\r
- /// <summary>\r
- /// The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH message that started the application.\r
- /// </summary>\r
- CPL_LAUNCHED = USER+0x1001,\r
- /// <summary>\r
- /// WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like scrolling.\r
- /// </summary>\r
- SYSTIMER = 0x118,\r
-\r
- /// <summary>\r
- /// The accessibility state has changed.\r
- /// </summary>\r
- HSHELL_ACCESSIBILITYSTATE = 11,\r
- /// <summary>\r
- /// The shell should activate its main window.\r
- /// </summary>\r
- HSHELL_ACTIVATESHELLWINDOW = 3,\r
- /// <summary>\r
- /// The user completed an input event (for example, pressed an application command button on the mouse or an application command key on the keyboard), and the application did not handle the WM_APPCOMMAND message generated by that input.\r
- /// If the Shell procedure handles the WM_COMMAND message, it should not call CallNextHookEx. See the Return Value section for more information.\r
- /// </summary>\r
- HSHELL_APPCOMMAND = 12,\r
- /// <summary>\r
- /// A window is being minimized or maximized. The system needs the coordinates of the minimized rectangle for the window.\r
- /// </summary>\r
- HSHELL_GETMINRECT = 5,\r
- /// <summary>\r
- /// Keyboard language was changed or a new keyboard layout was loaded.\r
- /// </summary>\r
- HSHELL_LANGUAGE = 8,\r
- /// <summary>\r
- /// The title of a window in the task bar has been redrawn.\r
- /// </summary>\r
- HSHELL_REDRAW = 6,\r
- /// <summary>\r
- /// The user has selected the task list. A shell application that provides a task list should return TRUE to prevent Windows from starting its task list.\r
- /// </summary>\r
- HSHELL_TASKMAN = 7,\r
- /// <summary>\r
- /// A top-level, unowned window has been created. The window exists when the system calls this hook.\r
- /// </summary>\r
- HSHELL_WINDOWCREATED = 1,\r
- /// <summary>\r
- /// A top-level, unowned window is about to be destroyed. The window still exists when the system calls this hook.\r
- /// </summary>\r
- HSHELL_WINDOWDESTROYED = 2,\r
- /// <summary>\r
- /// The activation has changed to a different top-level, unowned window.\r
- /// </summary>\r
- HSHELL_WINDOWACTIVATED = 4,\r
- /// <summary>\r
- /// A top-level window is being replaced. The window exists when the system calls this hook.\r
- /// </summary>\r
- HSHELL_WINDOWREPLACED = 13\r
-}\r
-\r
-/// <summary>\r
-/// Window Styles.\r
-/// The following styles can be specified wherever a window style is required. After the control has been created, these styles cannot be modified, except as noted.\r
-/// </summary>\r
-[Flags()]\r
-public enum WindowStyles : uint\r
-{\r
- /// <summary>The window has a thin-line border.</summary>\r
- WS_BORDER = 0x800000,\r
-\r
- /// <summary>The window has a title bar (includes the WS_BORDER style).</summary>\r
- WS_CAPTION = 0xc00000,\r
-\r
- /// <summary>The window is a child window. A window with this style cannot have a menu bar. This style cannot be used with the WS_POPUP style.</summary>\r
- WS_CHILD = 0x40000000,\r
-\r
- /// <summary>Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window.</summary>\r
- WS_CLIPCHILDREN = 0x2000000,\r
-\r
- /// <summary>\r
- /// Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated.\r
- /// If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window.\r
- /// </summary>\r
- WS_CLIPSIBLINGS = 0x4000000,\r
-\r
- /// <summary>The window is initially disabled. A disabled window cannot receive input from the user. To change this after a window has been created, use the EnableWindow function.</summary>\r
- WS_DISABLED = 0x8000000,\r
-\r
- /// <summary>The window has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar.</summary>\r
- WS_DLGFRAME = 0x400000,\r
-\r
- /// <summary>\r
- /// The window is the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style.\r
- /// The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys.\r
- /// You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function.\r
- /// </summary>\r
- WS_GROUP = 0x20000,\r
-\r
- /// <summary>The window has a horizontal scroll bar.</summary>\r
- WS_HSCROLL = 0x100000,\r
-\r
- /// <summary>The window is initially maximized.</summary>\r
- WS_MAXIMIZE = 0x1000000,\r
-\r
- /// <summary>The window has a maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.</summary>\r
- WS_MAXIMIZEBOX = 0x10000,\r
-\r
- /// <summary>The window is initially minimized.</summary>\r
- WS_MINIMIZE = 0x20000000,\r
-\r
- /// <summary>The window has a minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.</summary>\r
- WS_MINIMIZEBOX = 0x20000,\r
-\r
- /// <summary>The window is an overlapped window. An overlapped window has a title bar and a border.</summary>\r
- WS_OVERLAPPED = 0x0,\r
-\r
- /// <summary>The window is an overlapped window.</summary>\r
- WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_SIZEFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX,\r
-\r
- /// <summary>The window is a pop-up window. This style cannot be used with the WS_CHILD style.</summary>\r
- WS_POPUP = 0x80000000u,\r
-\r
- /// <summary>The window is a pop-up window. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.</summary>\r
- WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU,\r
-\r
- /// <summary>The window has a sizing border.</summary>\r
- WS_SIZEFRAME = 0x40000,\r
-\r
- /// <summary>The window has a window menu on its title bar. The WS_CAPTION style must also be specified.</summary>\r
- WS_SYSMENU = 0x80000,\r
-\r
- /// <summary>\r
- /// The window is a control that can receive the keyboard focus when the user presses the TAB key.\r
- /// Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style. \r
- /// You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function.\r
- /// For user-created windows and modeless dialogs to work with tab stops, alter the message loop to call the IsDialogMessage function.\r
- /// </summary>\r
- WS_TABSTOP = 0x10000,\r
-\r
- /// <summary>The window is initially visible. This style can be turned on and off by using the ShowWindow or SetWindowPos function.</summary>\r
- WS_VISIBLE = 0x10000000,\r
-\r
- /// <summary>The window has a vertical scroll bar.</summary>\r
- WS_VSCROLL = 0x200000\r
-}\r
-\r
-[Flags]\r
-public enum WindowStylesEx : uint\r
-{\r
- /// <summary>\r
- /// Specifies that a window created with this style accepts drag-drop files.\r
- /// </summary>\r
- WS_EX_ACCEPTFILES = 0x00000010,\r
- /// <summary>\r
- /// Forces a top-level window onto the taskbar when the window is visible.\r
- /// </summary>\r
- WS_EX_APPWINDOW = 0x00040000,\r
- /// <summary>\r
- /// Specifies that a window has a border with a sunken edge.\r
- /// </summary>\r
- WS_EX_CLIENTEDGE = 0x00000200,\r
- /// <summary>\r
- /// Windows XP: Paints all descendants of a window in bottom-to-top painting order using double-buffering. For more information, see Remarks. This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC.\r
- /// </summary>\r
- WS_EX_COMPOSITED = 0x02000000,\r
- /// <summary>\r
- /// Includes a question mark in the title bar of the window. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a child window, the child receives a WM_HELP message. The child window should pass the message to the parent window procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help for the child window.\r
- /// WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.\r
- /// </summary>\r
- WS_EX_CONTEXTHELP = 0x00000400,\r
- /// <summary>\r
- /// The window itself contains child windows that should take part in dialog box navigation. If this style is specified, the dialog manager recurses into children of this window when performing navigation operations such as handling the TAB key, an arrow key, or a keyboard mnemonic.\r
- /// </summary>\r
- WS_EX_CONTROLPARENT = 0x00010000,\r
- /// <summary>\r
- /// Creates a window that has a double border; the window can, optionally, be created with a title bar by specifying the WS_CAPTION style in the dwStyle parameter.\r
- /// </summary>\r
- WS_EX_DLGMODALFRAME = 0x00000001,\r
- /// <summary>\r
- /// Windows 2000/XP: Creates a layered window. Note that this cannot be used for child windows. Also, this cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC.\r
- /// </summary>\r
- WS_EX_LAYERED = 0x00080000,\r
- /// <summary>\r
- /// Arabic and Hebrew versions of Windows 98/Me, Windows 2000/XP: Creates a window whose horizontal origin is on the right edge. Increasing horizontal values advance to the left.\r
- /// </summary>\r
- WS_EX_LAYOUTRTL = 0x00400000,\r
- /// <summary>\r
- /// Creates a window that has generic left-aligned properties. This is the default.\r
- /// </summary>\r
- WS_EX_LEFT = 0x00000000,\r
- /// <summary>\r
- /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored.\r
- /// </summary>\r
- WS_EX_LEFTSCROLLBAR = 0x00004000,\r
- /// <summary>\r
- /// The window text is displayed using left-to-right reading-order properties. This is the default.\r
- /// </summary>\r
- WS_EX_LTRREADING = 0x00000000,\r
- /// <summary>\r
- /// Creates a multiple-document interface (MDI) child window.\r
- /// </summary>\r
- WS_EX_MDICHILD = 0x00000040,\r
- /// <summary>\r
- /// Windows 2000/XP: A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window.\r
- /// To activate the window, use the SetActiveWindow or SetForegroundWindow function.\r
- /// The window does not appear on the taskbar by default. To force the window to appear on the taskbar, use the WS_EX_APPWINDOW style.\r
- /// </summary>\r
- WS_EX_NOACTIVATE = 0x08000000,\r
- /// <summary>\r
- /// Windows 2000/XP: A window created with this style does not pass its window layout to its child windows.\r
- /// </summary>\r
- WS_EX_NOINHERITLAYOUT = 0x00100000,\r
- /// <summary>\r
- /// Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed.\r
- /// </summary>\r
- WS_EX_NOPARENTNOTIFY = 0x00000004,\r
- /// <summary>\r
- /// Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles.\r
- /// </summary>\r
- WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE,\r
- /// <summary>\r
- /// Combines the WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW, and WS_EX_TOPMOST styles.\r
- /// </summary>\r
- WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST,\r
- /// <summary>\r
- /// The window has generic "right-aligned" properties. This depends on the window class. This style has an effect only if the shell language is Hebrew, Arabic, or another language that supports reading-order alignment; otherwise, the style is ignored.\r
- /// Using the WS_EX_RIGHT style for static or edit controls has the same effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this style with button controls has the same effect as using BS_RIGHT and BS_RIGHTBUTTON styles.\r
- /// </summary>\r
- WS_EX_RIGHT = 0x00001000,\r
- /// <summary>\r
- /// Vertical scroll bar (if present) is to the right of the client area. This is the default.\r
- /// </summary>\r
- WS_EX_RIGHTSCROLLBAR = 0x00000000,\r
- /// <summary>\r
- /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order properties. For other languages, the style is ignored.\r
- /// </summary>\r
- WS_EX_RTLREADING = 0x00002000,\r
- /// <summary>\r
- /// Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.\r
- /// </summary>\r
- WS_EX_STATICEDGE = 0x00020000,\r
- /// <summary>\r
- /// Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by right-clicking or by typing ALT+SPACE.\r
- /// </summary>\r
- WS_EX_TOOLWINDOW = 0x00000080,\r
- /// <summary>\r
- /// Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function.\r
- /// </summary>\r
- WS_EX_TOPMOST = 0x00000008,\r
- /// <summary>\r
- /// Specifies that a window created with this style should not be painted until siblings beneath the window (that were created by the same thread) have been painted. The window appears transparent because the bits of underlying sibling windows have already been painted.\r
- /// To achieve transparency without these restrictions, use the SetWindowRgn function.\r
- /// </summary>\r
- WS_EX_TRANSPARENT = 0x00000020,\r
- /// <summary>\r
- /// Specifies that a window has a border with a raised edge.\r
- /// </summary>\r
- WS_EX_WINDOWEDGE = 0x00000100\r
-}\r
-\r
-public enum ShowWindowCommands\r
-{\r
- /// <summary>\r
- /// Hides the window and activates another window.\r
- /// </summary>\r
- Hide = 0,\r
- /// <summary>\r
- /// Activates and displays a window. If the window is minimized or\r
- /// maximized, the system restores it to its original size and position.\r
- /// An application should specify this flag when displaying the window\r
- /// for the first time.\r
- /// </summary>\r
- Normal = 1,\r
- /// <summary>\r
- /// Activates the window and displays it as a minimized window.\r
- /// </summary>\r
- ShowMinimized = 2,\r
- /// <summary>\r
- /// Maximizes the specified window.\r
- /// </summary>\r
- Maximize = 3, // is this the right value?\r
- /// <summary>\r
- /// Activates the window and displays it as a maximized window.\r
- /// </summary> \r
- ShowMaximized = 3,\r
- /// <summary>\r
- /// Displays a window in its most recent size and position. This value\r
- /// is similar to <see cref="Win32.ShowWindowCommand.Normal"/>, except\r
- /// the window is not activated.\r
- /// </summary>\r
- ShowNoActivate = 4,\r
- /// <summary>\r
- /// Activates the window and displays it in its current size and position.\r
- /// </summary>\r
- Show = 5,\r
- /// <summary>\r
- /// Minimizes the specified window and activates the next top-level\r
- /// window in the Z order.\r
- /// </summary>\r
- Minimize = 6,\r
- /// <summary>\r
- /// Displays the window as a minimized window. This value is similar to\r
- /// <see cref="Win32.ShowWindowCommand.ShowMinimized"/>, except the\r
- /// window is not activated.\r
- /// </summary>\r
- ShowMinNoActive = 7,\r
- /// <summary>\r
- /// Displays the window in its current size and position. This value is\r
- /// similar to <see cref="Win32.ShowWindowCommand.Show"/>, except the\r
- /// window is not activated.\r
- /// </summary>\r
- ShowNA = 8,\r
- /// <summary>\r
- /// Activates and displays the window. If the window is minimized or\r
- /// maximized, the system restores it to its original size and position.\r
- /// An application should specify this flag when restoring a minimized window.\r
- /// </summary>\r
- Restore = 9,\r
- /// <summary>\r
- /// Sets the show state based on the SW_* value specified in the\r
- /// STARTUPINFO structure passed to the CreateProcess function by the\r
- /// program that started the application.\r
- /// </summary>\r
- ShowDefault = 10,\r
- /// <summary>\r
- /// <b>Windows 2000/XP:</b> Minimizes a window, even if the thread\r
- /// that owns the window is not responding. This flag should only be\r
- /// used when minimizing windows from a different thread.\r
- /// </summary>\r
- ForceMinimize = 11\r
-}\r
+ /// <summary>
+ /// Windows Messages
+ /// Defined in winuser.h from Windows SDK v6.1
+ /// Documentation pulled from MSDN.
+ /// </summary>
+using System;
+
+public enum WM : uint
+ {
+ /// <summary>
+ /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.
+ /// </summary>
+ NULL = 0x0000,
+ /// <summary>
+ /// The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.
+ /// </summary>
+ CREATE = 0x0001,
+ /// <summary>
+ /// The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen.
+ /// This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist.
+ /// /// </summary>
+ DESTROY = 0x0002,
+ /// <summary>
+ /// The WM_MOVE message is sent after a window has been moved.
+ /// </summary>
+ MOVE = 0x0003,
+ /// <summary>
+ /// The WM_SIZE message is sent to a window after its size has changed.
+ /// </summary>
+ SIZE = 0x0005,
+ /// <summary>
+ /// The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately.
+ /// </summary>
+ ACTIVATE = 0x0006,
+ /// <summary>
+ /// The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus.
+ /// </summary>
+ SETFOCUS = 0x0007,
+ /// <summary>
+ /// The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus.
+ /// </summary>
+ KILLFOCUS = 0x0008,
+ /// <summary>
+ /// The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed.
+ /// </summary>
+ ENABLE = 0x000A,
+ /// <summary>
+ /// An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn.
+ /// </summary>
+ SETREDRAW = 0x000B,
+ /// <summary>
+ /// An application sends a WM_SETTEXT message to set the text of a window.
+ /// </summary>
+ SETTEXT = 0x000C,
+ /// <summary>
+ /// An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller.
+ /// </summary>
+ GETTEXT = 0x000D,
+ /// <summary>
+ /// An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window.
+ /// </summary>
+ GETTEXTLENGTH = 0x000E,
+ /// <summary>
+ /// The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function.
+ /// </summary>
+ PAINT = 0x000F,
+ /// <summary>
+ /// The WM_CLOSE message is sent as a signal that a window or an application should terminate.
+ /// </summary>
+ CLOSE = 0x0010,
+ /// <summary>
+ /// The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.
+ /// After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.
+ /// </summary>
+ QUERYENDSESSION = 0x0011,
+ /// <summary>
+ /// The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position.
+ /// </summary>
+ QUERYOPEN = 0x0013,
+ /// <summary>
+ /// The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.
+ /// </summary>
+ ENDSESSION = 0x0016,
+ /// <summary>
+ /// The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero.
+ /// </summary>
+ QUIT = 0x0012,
+ /// <summary>
+ /// The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting.
+ /// </summary>
+ ERASEBKGND = 0x0014,
+ /// <summary>
+ /// This message is sent to all top-level windows when a change is made to a system color setting.
+ /// </summary>
+ SYSCOLORCHANGE = 0x0015,
+ /// <summary>
+ /// The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.
+ /// </summary>
+ SHOWWINDOW = 0x0018,
+ /// <summary>
+ /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.
+ /// Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.
+ /// </summary>
+ WININICHANGE = 0x001A,
+ /// <summary>
+ /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.
+ /// Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.
+ /// </summary>
+ SETTINGCHANGE = WININICHANGE,
+ /// <summary>
+ /// The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings.
+ /// </summary>
+ DEVMODECHANGE = 0x001B,
+ /// <summary>
+ /// The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.
+ /// </summary>
+ ACTIVATEAPP = 0x001C,
+ /// <summary>
+ /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources.
+ /// </summary>
+ FONTCHANGE = 0x001D,
+ /// <summary>
+ /// A message that is sent whenever there is a change in the system time.
+ /// </summary>
+ TIMECHANGE = 0x001E,
+ /// <summary>
+ /// The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.
+ /// </summary>
+ CANCELMODE = 0x001F,
+ /// <summary>
+ /// The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.
+ /// </summary>
+ SETCURSOR = 0x0020,
+ /// <summary>
+ /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.
+ /// </summary>
+ MOUSEACTIVATE = 0x0021,
+ /// <summary>
+ /// The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized.
+ /// </summary>
+ CHILDACTIVATE = 0x0022,
+ /// <summary>
+ /// The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure.
+ /// </summary>
+ QUEUESYNC = 0x0023,
+ /// <summary>
+ /// The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size.
+ /// </summary>
+ GETMINMAXINFO = 0x0024,
+ /// <summary>
+ /// Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks.
+ /// </summary>
+ PAINTICON = 0x0026,
+ /// <summary>
+ /// Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.
+ /// </summary>
+ ICONERASEBKGND = 0x0027,
+ /// <summary>
+ /// The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box.
+ /// </summary>
+ NEXTDLGCTL = 0x0028,
+ /// <summary>
+ /// The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue.
+ /// </summary>
+ SPOOLERSTATUS = 0x002A,
+ /// <summary>
+ /// The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.
+ /// </summary>
+ DRAWITEM = 0x002B,
+ /// <summary>
+ /// The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.
+ /// </summary>
+ MEASUREITEM = 0x002C,
+ /// <summary>
+ /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data.
+ /// </summary>
+ DELETEITEM = 0x002D,
+ /// <summary>
+ /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message.
+ /// </summary>
+ VKEYTOITEM = 0x002E,
+ /// <summary>
+ /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message.
+ /// </summary>
+ CHARTOITEM = 0x002F,
+ /// <summary>
+ /// An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text.
+ /// </summary>
+ SETFONT = 0x0030,
+ /// <summary>
+ /// An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text.
+ /// </summary>
+ GETFONT = 0x0031,
+ /// <summary>
+ /// An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window.
+ /// </summary>
+ SETHOTKEY = 0x0032,
+ /// <summary>
+ /// An application sends a WM_GETHOTKEY message to determine the hot key associated with a window.
+ /// </summary>
+ GETHOTKEY = 0x0033,
+ /// <summary>
+ /// The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon.
+ /// </summary>
+ QUERYDRAGICON = 0x0037,
+ /// <summary>
+ /// The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style.
+ /// </summary>
+ COMPAREITEM = 0x0039,
+ /// <summary>
+ /// Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application.
+ /// Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message.
+ /// </summary>
+ GETOBJECT = 0x003D,
+ /// <summary>
+ /// The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.
+ /// </summary>
+ COMPACTING = 0x0041,
+ /// <summary>
+ /// WM_COMMNOTIFY is Obsolete for Win32-Based Applications
+ /// </summary>
+ [Obsolete]
+ COMMNOTIFY = 0x0044,
+ /// <summary>
+ /// The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.
+ /// </summary>
+ WINDOWPOSCHANGING = 0x0046,
+ /// <summary>
+ /// The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function.
+ /// </summary>
+ WINDOWPOSCHANGED = 0x0047,
+ /// <summary>
+ /// Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode.
+ /// Use: POWERBROADCAST
+ /// </summary>
+ [Obsolete]
+ POWER = 0x0048,
+ /// <summary>
+ /// An application sends the WM_COPYDATA message to pass data to another application.
+ /// </summary>
+ COPYDATA = 0x004A,
+ /// <summary>
+ /// The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle.
+ /// </summary>
+ CANCELJOURNAL = 0x004B,
+ /// <summary>
+ /// Sent by a common control to its parent window when an event has occurred or the control requires some information.
+ /// </summary>
+ NOTIFY = 0x004E,
+ /// <summary>
+ /// The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately.
+ /// </summary>
+ INPUTLANGCHANGEREQUEST = 0x0050,
+ /// <summary>
+ /// The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on.
+ /// </summary>
+ INPUTLANGCHANGE = 0x0051,
+ /// <summary>
+ /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function.
+ /// </summary>
+ TCARD = 0x0052,
+ /// <summary>
+ /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window.
+ /// </summary>
+ HELP = 0x0053,
+ /// <summary>
+ /// The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.
+ /// </summary>
+ USERCHANGED = 0x0054,
+ /// <summary>
+ /// Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control.
+ /// </summary>
+ NOTIFYFORMAT = 0x0055,
+ /// <summary>
+ /// The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window.
+ /// </summary>
+ CONTEXTMENU = 0x007B,
+ /// <summary>
+ /// The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles.
+ /// </summary>
+ STYLECHANGING = 0x007C,
+ /// <summary>
+ /// The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles
+ /// </summary>
+ STYLECHANGED = 0x007D,
+ /// <summary>
+ /// The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.
+ /// </summary>
+ DISPLAYCHANGE = 0x007E,
+ /// <summary>
+ /// The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption.
+ /// </summary>
+ GETICON = 0x007F,
+ /// <summary>
+ /// An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption.
+ /// </summary>
+ SETICON = 0x0080,
+ /// <summary>
+ /// The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.
+ /// </summary>
+ NCCREATE = 0x0081,
+ /// <summary>
+ /// The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window.
+ /// The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed.
+ /// </summary>
+ NCDESTROY = 0x0082,
+ /// <summary>
+ /// The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes.
+ /// </summary>
+ NCCALCSIZE = 0x0083,
+ /// <summary>
+ /// The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse.
+ /// </summary>
+ NCHITTEST = 0x0084,
+ /// <summary>
+ /// The WM_NCPAINT message is sent to a window when its frame must be painted.
+ /// </summary>
+ NCPAINT = 0x0085,
+ /// <summary>
+ /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state.
+ /// </summary>
+ NCACTIVATE = 0x0086,
+ /// <summary>
+ /// The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself.
+ /// </summary>
+ GETDLGCODE = 0x0087,
+ /// <summary>
+ /// The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads.
+ /// </summary>
+ SYNCPAINT = 0x0088,
+ /// <summary>
+ /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCMOUSEMOVE = 0x00A0,
+ /// <summary>
+ /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCLBUTTONDOWN = 0x00A1,
+ /// <summary>
+ /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCLBUTTONUP = 0x00A2,
+ /// <summary>
+ /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCLBUTTONDBLCLK = 0x00A3,
+ /// <summary>
+ /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCRBUTTONDOWN = 0x00A4,
+ /// <summary>
+ /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCRBUTTONUP = 0x00A5,
+ /// <summary>
+ /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCRBUTTONDBLCLK = 0x00A6,
+ /// <summary>
+ /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCMBUTTONDOWN = 0x00A7,
+ /// <summary>
+ /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCMBUTTONUP = 0x00A8,
+ /// <summary>
+ /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCMBUTTONDBLCLK = 0x00A9,
+ /// <summary>
+ /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCXBUTTONDOWN = 0x00AB,
+ /// <summary>
+ /// The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCXBUTTONUP = 0x00AC,
+ /// <summary>
+ /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
+ /// </summary>
+ NCXBUTTONDBLCLK = 0x00AD,
+ /// <summary>
+ /// The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives this message through its WindowProc function.
+ /// </summary>
+ INPUT_DEVICE_CHANGE = 0x00FE,
+ /// <summary>
+ /// The WM_INPUT message is sent to the window that is getting raw input.
+ /// </summary>
+ INPUT = 0x00FF,
+ /// <summary>
+ /// This message filters for keyboard messages.
+ /// </summary>
+ KEYFIRST = 0x0100,
+ /// <summary>
+ /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed.
+ /// </summary>
+ KEYDOWN = 0x0100,
+ /// <summary>
+ /// The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.
+ /// </summary>
+ KEYUP = 0x0101,
+ /// <summary>
+ /// The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed.
+ /// </summary>
+ CHAR = 0x0102,
+ /// <summary>
+ /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key.
+ /// </summary>
+ DEADCHAR = 0x0103,
+ /// <summary>
+ /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter.
+ /// </summary>
+ SYSKEYDOWN = 0x0104,
+ /// <summary>
+ /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter.
+ /// </summary>
+ SYSKEYUP = 0x0105,
+ /// <summary>
+ /// The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down.
+ /// </summary>
+ SYSCHAR = 0x0106,
+ /// <summary>
+ /// The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key.
+ /// </summary>
+ SYSDEADCHAR = 0x0107,
+ /// <summary>
+ /// The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed.
+ /// The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle Unicode Supplementary Plane characters.
+ /// </summary>
+ UNICHAR = 0x0109,
+ /// <summary>
+ /// This message filters for keyboard messages.
+ /// </summary>
+ KEYLAST = 0x0109,
+ /// <summary>
+ /// Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function.
+ /// </summary>
+ IME_STARTCOMPOSITION = 0x010D,
+ /// <summary>
+ /// Sent to an application when the IME ends composition. A window receives this message through its WindowProc function.
+ /// </summary>
+ IME_ENDCOMPOSITION = 0x010E,
+ /// <summary>
+ /// Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function.
+ /// </summary>
+ IME_COMPOSITION = 0x010F,
+ IME_KEYLAST = 0x010F,
+ /// <summary>
+ /// The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box.
+ /// </summary>
+ INITDIALOG = 0x0110,
+ /// <summary>
+ /// The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.
+ /// </summary>
+ COMMAND = 0x0111,
+ /// <summary>
+ /// A window receives this message when the user chooses a command from the Window menu, clicks the maximize button, minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering this out.
+ /// </summary>
+ SYSCOMMAND = 0x0112,
+ /// <summary>
+ /// The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function.
+ /// </summary>
+ TIMER = 0x0113,
+ /// <summary>
+ /// The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control.
+ /// </summary>
+ HSCROLL = 0x0114,
+ /// <summary>
+ /// The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control.
+ /// </summary>
+ VSCROLL = 0x0115,
+ /// <summary>
+ /// The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed.
+ /// </summary>
+ INITMENU = 0x0116,
+ /// <summary>
+ /// The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu.
+ /// </summary>
+ INITMENUPOPUP = 0x0117,
+ /// <summary>
+ /// The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item.
+ /// </summary>
+ MENUSELECT = 0x011F,
+ /// <summary>
+ /// The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu.
+ /// </summary>
+ MENUCHAR = 0x0120,
+ /// <summary>
+ /// The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages.
+ /// </summary>
+ ENTERIDLE = 0x0121,
+ /// <summary>
+ /// The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item.
+ /// </summary>
+ MENURBUTTONUP = 0x0122,
+ /// <summary>
+ /// The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item.
+ /// </summary>
+ MENUDRAG = 0x0123,
+ /// <summary>
+ /// The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item.
+ /// </summary>
+ MENUGETOBJECT = 0x0124,
+ /// <summary>
+ /// The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed.
+ /// </summary>
+ UNINITMENUPOPUP = 0x0125,
+ /// <summary>
+ /// The WM_MENUCOMMAND message is sent when the user makes a selection from a menu.
+ /// </summary>
+ MENUCOMMAND = 0x0126,
+ /// <summary>
+ /// An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed.
+ /// </summary>
+ CHANGEUISTATE = 0x0127,
+ /// <summary>
+ /// An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows.
+ /// </summary>
+ UPDATEUISTATE = 0x0128,
+ /// <summary>
+ /// An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window.
+ /// </summary>
+ QUERYUISTATE = 0x0129,
+ /// <summary>
+ /// The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle.
+ /// </summary>
+ CTLCOLORMSGBOX = 0x0132,
+ /// <summary>
+ /// An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control.
+ /// </summary>
+ CTLCOLOREDIT = 0x0133,
+ /// <summary>
+ /// Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle.
+ /// </summary>
+ CTLCOLORLISTBOX = 0x0134,
+ /// <summary>
+ /// The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message.
+ /// </summary>
+ CTLCOLORBTN = 0x0135,
+ /// <summary>
+ /// The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle.
+ /// </summary>
+ CTLCOLORDLG = 0x0136,
+ /// <summary>
+ /// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control.
+ /// </summary>
+ CTLCOLORSCROLLBAR = 0x0137,
+ /// <summary>
+ /// A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control.
+ /// </summary>
+ CTLCOLORSTATIC = 0x0138,
+ /// <summary>
+ /// Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function.
+ /// </summary>
+ MOUSEFIRST = 0x0200,
+ /// <summary>
+ /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ MOUSEMOVE = 0x0200,
+ /// <summary>
+ /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ LBUTTONDOWN = 0x0201,
+ /// <summary>
+ /// The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ LBUTTONUP = 0x0202,
+ /// <summary>
+ /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ LBUTTONDBLCLK = 0x0203,
+ /// <summary>
+ /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ RBUTTONDOWN = 0x0204,
+ /// <summary>
+ /// The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ RBUTTONUP = 0x0205,
+ /// <summary>
+ /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ RBUTTONDBLCLK = 0x0206,
+ /// <summary>
+ /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ MBUTTONDOWN = 0x0207,
+ /// <summary>
+ /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ MBUTTONUP = 0x0208,
+ /// <summary>
+ /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ MBUTTONDBLCLK = 0x0209,
+ /// <summary>
+ /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.
+ /// </summary>
+ MOUSEWHEEL = 0x020A,
+ /// <summary>
+ /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ XBUTTONDOWN = 0x020B,
+ /// <summary>
+ /// The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ XBUTTONUP = 0x020C,
+ /// <summary>
+ /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
+ /// </summary>
+ XBUTTONDBLCLK = 0x020D,
+ /// <summary>
+ /// The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.
+ /// </summary>
+ MOUSEHWHEEL = 0x020E,
+ /// <summary>
+ /// Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function.
+ /// </summary>
+ MOUSELAST = 0x020E,
+ /// <summary>
+ /// The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.
+ /// </summary>
+ PARENTNOTIFY = 0x0210,
+ /// <summary>
+ /// The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered.
+ /// </summary>
+ ENTERMENULOOP = 0x0211,
+ /// <summary>
+ /// The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited.
+ /// </summary>
+ EXITMENULOOP = 0x0212,
+ /// <summary>
+ /// The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu.
+ /// </summary>
+ NEXTMENU = 0x0213,
+ /// <summary>
+ /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position.
+ /// </summary>
+ SIZING = 0x0214,
+ /// <summary>
+ /// The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture.
+ /// </summary>
+ CAPTURECHANGED = 0x0215,
+ /// <summary>
+ /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.
+ /// </summary>
+ MOVING = 0x0216,
+ /// <summary>
+ /// Notifies applications that a power-management event has occurred.
+ /// </summary>
+ POWERBROADCAST = 0x0218,
+ /// <summary>
+ /// Notifies an application of a change to the hardware configuration of a device or the computer.
+ /// </summary>
+ DEVICECHANGE = 0x0219,
+ /// <summary>
+ /// An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window.
+ /// </summary>
+ MDICREATE = 0x0220,
+ /// <summary>
+ /// An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window.
+ /// </summary>
+ MDIDESTROY = 0x0221,
+ /// <summary>
+ /// An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window.
+ /// </summary>
+ MDIACTIVATE = 0x0222,
+ /// <summary>
+ /// An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size.
+ /// </summary>
+ MDIRESTORE = 0x0223,
+ /// <summary>
+ /// An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window.
+ /// </summary>
+ MDINEXT = 0x0224,
+ /// <summary>
+ /// An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window.
+ /// </summary>
+ MDIMAXIMIZE = 0x0225,
+ /// <summary>
+ /// An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format.
+ /// </summary>
+ MDITILE = 0x0226,
+ /// <summary>
+ /// An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format.
+ /// </summary>
+ MDICASCADE = 0x0227,
+ /// <summary>
+ /// An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized.
+ /// </summary>
+ MDIICONARRANGE = 0x0228,
+ /// <summary>
+ /// An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window.
+ /// </summary>
+ MDIGETACTIVE = 0x0229,
+ /// <summary>
+ /// An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both.
+ /// </summary>
+ MDISETMENU = 0x0230,
+ /// <summary>
+ /// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
+ /// The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled.
+ /// </summary>
+ ENTERSIZEMOVE = 0x0231,
+ /// <summary>
+ /// The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
+ /// </summary>
+ EXITSIZEMOVE = 0x0232,
+ /// <summary>
+ /// Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files.
+ /// </summary>
+ DROPFILES = 0x0233,
+ /// <summary>
+ /// An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window.
+ /// </summary>
+ MDIREFRESHMENU = 0x0234,
+ /// <summary>
+ /// Sent to an application when a window is activated. A window receives this message through its WindowProc function.
+ /// </summary>
+ IME_SETCONTEXT = 0x0281,
+ /// <summary>
+ /// Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function.
+ /// </summary>
+ IME_NOTIFY = 0x0282,
+ /// <summary>
+ /// Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters.
+ /// </summary>
+ IME_CONTROL = 0x0283,
+ /// <summary>
+ /// Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function.
+ /// </summary>
+ IME_COMPOSITIONFULL = 0x0284,
+ /// <summary>
+ /// Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function.
+ /// </summary>
+ IME_SELECT = 0x0285,
+ /// <summary>
+ /// Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function.
+ /// </summary>
+ IME_CHAR = 0x0286,
+ /// <summary>
+ /// Sent to an application to provide commands and request information. A window receives this message through its WindowProc function.
+ /// </summary>
+ IME_REQUEST = 0x0288,
+ /// <summary>
+ /// Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function.
+ /// </summary>
+ IME_KEYDOWN = 0x0290,
+ /// <summary>
+ /// Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function.
+ /// </summary>
+ IME_KEYUP = 0x0291,
+ /// <summary>
+ /// The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent.
+ /// </summary>
+ MOUSEHOVER = 0x02A1,
+ /// <summary>
+ /// The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent.
+ /// </summary>
+ MOUSELEAVE = 0x02A3,
+ /// <summary>
+ /// The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent.
+ /// </summary>
+ NCMOUSEHOVER = 0x02A0,
+ /// <summary>
+ /// The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent.
+ /// </summary>
+ NCMOUSELEAVE = 0x02A2,
+ /// <summary>
+ /// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.
+ /// </summary>
+ WTSSESSION_CHANGE = 0x02B1,
+ TABLET_FIRST = 0x02c0,
+ TABLET_LAST = 0x02df,
+ /// <summary>
+ /// An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format.
+ /// </summary>
+ CUT = 0x0300,
+ /// <summary>
+ /// An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format.
+ /// </summary>
+ COPY = 0x0301,
+ /// <summary>
+ /// An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format.
+ /// </summary>
+ PASTE = 0x0302,
+ /// <summary>
+ /// An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control.
+ /// </summary>
+ CLEAR = 0x0303,
+ /// <summary>
+ /// An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted.
+ /// </summary>
+ UNDO = 0x0304,
+ /// <summary>
+ /// The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function.
+ /// </summary>
+ RENDERFORMAT = 0x0305,
+ /// <summary>
+ /// The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function.
+ /// </summary>
+ RENDERALLFORMATS = 0x0306,
+ /// <summary>
+ /// The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard.
+ /// </summary>
+ DESTROYCLIPBOARD = 0x0307,
+ /// <summary>
+ /// The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard.
+ /// </summary>
+ DRAWCLIPBOARD = 0x0308,
+ /// <summary>
+ /// The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting.
+ /// </summary>
+ PAINTCLIPBOARD = 0x0309,
+ /// <summary>
+ /// The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values.
+ /// </summary>
+ VSCROLLCLIPBOARD = 0x030A,
+ /// <summary>
+ /// The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size.
+ /// </summary>
+ SIZECLIPBOARD = 0x030B,
+ /// <summary>
+ /// The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format.
+ /// </summary>
+ ASKCBFORMATNAME = 0x030C,
+ /// <summary>
+ /// The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain.
+ /// </summary>
+ CHANGECBCHAIN = 0x030D,
+ /// <summary>
+ /// The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values.
+ /// </summary>
+ HSCROLLCLIPBOARD = 0x030E,
+ /// <summary>
+ /// This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus.
+ /// </summary>
+ QUERYNEWPALETTE = 0x030F,
+ /// <summary>
+ /// The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette.
+ /// </summary>
+ PALETTEISCHANGING = 0x0310,
+ /// <summary>
+ /// This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette.
+ /// This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas.
+ /// </summary>
+ PALETTECHANGED = 0x0311,
+ /// <summary>
+ /// The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key.
+ /// </summary>
+ HOTKEY = 0x0312,
+ /// <summary>
+ /// The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.
+ /// </summary>
+ PRINT = 0x0317,
+ /// <summary>
+ /// The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context.
+ /// </summary>
+ PRINTCLIENT = 0x0318,
+ /// <summary>
+ /// The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard.
+ /// </summary>
+ APPCOMMAND = 0x0319,
+ /// <summary>
+ /// The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.
+ /// </summary>
+ THEMECHANGED = 0x031A,
+ /// <summary>
+ /// Sent when the contents of the clipboard have changed.
+ /// </summary>
+ CLIPBOARDUPDATE = 0x031D,
+ /// <summary>
+ /// The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop composition has changed.
+ /// </summary>
+ DWMCOMPOSITIONCHANGED = 0x031E,
+ /// <summary>
+ /// WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message.
+ /// </summary>
+ DWMNCRENDERINGCHANGED = 0x031F,
+ /// <summary>
+ /// Sent to all top-level windows when the colorization color has changed.
+ /// </summary>
+ DWMCOLORIZATIONCOLORCHANGED = 0x0320,
+ /// <summary>
+ /// WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register for this message as well. You'd have other windowd go opaque when this message is sent.
+ /// </summary>
+ DWMWINDOWMAXIMIZEDCHANGE = 0x0321,
+ /// <summary>
+ /// Sent to request extended title bar information. A window receives this message through its WindowProc function.
+ /// </summary>
+ GETTITLEBARINFOEX = 0x033F,
+ HANDHELDFIRST = 0x0358,
+ HANDHELDLAST = 0x035F,
+ AFXFIRST = 0x0360,
+ AFXLAST = 0x037F,
+ PENWINFIRST = 0x0380,
+ PENWINLAST = 0x038F,
+ /// <summary>
+ /// The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value.
+ /// </summary>
+ APP = 0x8000,
+ /// <summary>
+ /// The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value.
+ /// </summary>
+ USER = 0x0400,
+
+ /// <summary>
+ /// An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application be started.
+ /// </summary>
+ CPL_LAUNCH = USER+0x1000,
+ /// <summary>
+ /// The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH message that started the application.
+ /// </summary>
+ CPL_LAUNCHED = USER+0x1001,
+ /// <summary>
+ /// WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like scrolling.
+ /// </summary>
+ SYSTIMER = 0x118,
+
+ /// <summary>
+ /// The accessibility state has changed.
+ /// </summary>
+ HSHELL_ACCESSIBILITYSTATE = 11,
+ /// <summary>
+ /// The shell should activate its main window.
+ /// </summary>
+ HSHELL_ACTIVATESHELLWINDOW = 3,
+ /// <summary>
+ /// The user completed an input event (for example, pressed an application command button on the mouse or an application command key on the keyboard), and the application did not handle the WM_APPCOMMAND message generated by that input.
+ /// If the Shell procedure handles the WM_COMMAND message, it should not call CallNextHookEx. See the Return Value section for more information.
+ /// </summary>
+ HSHELL_APPCOMMAND = 12,
+ /// <summary>
+ /// A window is being minimized or maximized. The system needs the coordinates of the minimized rectangle for the window.
+ /// </summary>
+ HSHELL_GETMINRECT = 5,
+ /// <summary>
+ /// Keyboard language was changed or a new keyboard layout was loaded.
+ /// </summary>
+ HSHELL_LANGUAGE = 8,
+ /// <summary>
+ /// The title of a window in the task bar has been redrawn.
+ /// </summary>
+ HSHELL_REDRAW = 6,
+ /// <summary>
+ /// The user has selected the task list. A shell application that provides a task list should return TRUE to prevent Windows from starting its task list.
+ /// </summary>
+ HSHELL_TASKMAN = 7,
+ /// <summary>
+ /// A top-level, unowned window has been created. The window exists when the system calls this hook.
+ /// </summary>
+ HSHELL_WINDOWCREATED = 1,
+ /// <summary>
+ /// A top-level, unowned window is about to be destroyed. The window still exists when the system calls this hook.
+ /// </summary>
+ HSHELL_WINDOWDESTROYED = 2,
+ /// <summary>
+ /// The activation has changed to a different top-level, unowned window.
+ /// </summary>
+ HSHELL_WINDOWACTIVATED = 4,
+ /// <summary>
+ /// A top-level window is being replaced. The window exists when the system calls this hook.
+ /// </summary>
+ HSHELL_WINDOWREPLACED = 13
+}
+
+/// <summary>
+/// Window Styles.
+/// The following styles can be specified wherever a window style is required. After the control has been created, these styles cannot be modified, except as noted.
+/// </summary>
+[Flags()]
+public enum WindowStyles : uint
+{
+ /// <summary>The window has a thin-line border.</summary>
+ WS_BORDER = 0x800000,
+
+ /// <summary>The window has a title bar (includes the WS_BORDER style).</summary>
+ WS_CAPTION = 0xc00000,
+
+ /// <summary>The window is a child window. A window with this style cannot have a menu bar. This style cannot be used with the WS_POPUP style.</summary>
+ WS_CHILD = 0x40000000,
+
+ /// <summary>Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window.</summary>
+ WS_CLIPCHILDREN = 0x2000000,
+
+ /// <summary>
+ /// Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated.
+ /// If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window.
+ /// </summary>
+ WS_CLIPSIBLINGS = 0x4000000,
+
+ /// <summary>The window is initially disabled. A disabled window cannot receive input from the user. To change this after a window has been created, use the EnableWindow function.</summary>
+ WS_DISABLED = 0x8000000,
+
+ /// <summary>The window has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar.</summary>
+ WS_DLGFRAME = 0x400000,
+
+ /// <summary>
+ /// The window is the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style.
+ /// The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys.
+ /// You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function.
+ /// </summary>
+ WS_GROUP = 0x20000,
+
+ /// <summary>The window has a horizontal scroll bar.</summary>
+ WS_HSCROLL = 0x100000,
+
+ /// <summary>The window is initially maximized.</summary>
+ WS_MAXIMIZE = 0x1000000,
+
+ /// <summary>The window has a maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.</summary>
+ WS_MAXIMIZEBOX = 0x10000,
+
+ /// <summary>The window is initially minimized.</summary>
+ WS_MINIMIZE = 0x20000000,
+
+ /// <summary>The window has a minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.</summary>
+ WS_MINIMIZEBOX = 0x20000,
+
+ /// <summary>The window is an overlapped window. An overlapped window has a title bar and a border.</summary>
+ WS_OVERLAPPED = 0x0,
+
+ /// <summary>The window is an overlapped window.</summary>
+ WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_SIZEFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
+
+ /// <summary>The window is a pop-up window. This style cannot be used with the WS_CHILD style.</summary>
+ WS_POPUP = 0x80000000u,
+
+ /// <summary>The window is a pop-up window. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.</summary>
+ WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU,
+
+ /// <summary>The window has a sizing border.</summary>
+ WS_SIZEFRAME = 0x40000,
+
+ /// <summary>The window has a window menu on its title bar. The WS_CAPTION style must also be specified.</summary>
+ WS_SYSMENU = 0x80000,
+
+ /// <summary>
+ /// The window is a control that can receive the keyboard focus when the user presses the TAB key.
+ /// Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style.
+ /// You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function.
+ /// For user-created windows and modeless dialogs to work with tab stops, alter the message loop to call the IsDialogMessage function.
+ /// </summary>
+ WS_TABSTOP = 0x10000,
+
+ /// <summary>The window is initially visible. This style can be turned on and off by using the ShowWindow or SetWindowPos function.</summary>
+ WS_VISIBLE = 0x10000000,
+
+ /// <summary>The window has a vertical scroll bar.</summary>
+ WS_VSCROLL = 0x200000
+}
+
+[Flags]
+public enum WindowStylesEx : uint
+{
+ /// <summary>
+ /// Specifies that a window created with this style accepts drag-drop files.
+ /// </summary>
+ WS_EX_ACCEPTFILES = 0x00000010,
+ /// <summary>
+ /// Forces a top-level window onto the taskbar when the window is visible.
+ /// </summary>
+ WS_EX_APPWINDOW = 0x00040000,
+ /// <summary>
+ /// Specifies that a window has a border with a sunken edge.
+ /// </summary>
+ WS_EX_CLIENTEDGE = 0x00000200,
+ /// <summary>
+ /// Windows XP: Paints all descendants of a window in bottom-to-top painting order using double-buffering. For more information, see Remarks. This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC.
+ /// </summary>
+ WS_EX_COMPOSITED = 0x02000000,
+ /// <summary>
+ /// Includes a question mark in the title bar of the window. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a child window, the child receives a WM_HELP message. The child window should pass the message to the parent window procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help for the child window.
+ /// WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.
+ /// </summary>
+ WS_EX_CONTEXTHELP = 0x00000400,
+ /// <summary>
+ /// The window itself contains child windows that should take part in dialog box navigation. If this style is specified, the dialog manager recurses into children of this window when performing navigation operations such as handling the TAB key, an arrow key, or a keyboard mnemonic.
+ /// </summary>
+ WS_EX_CONTROLPARENT = 0x00010000,
+ /// <summary>
+ /// Creates a window that has a double border; the window can, optionally, be created with a title bar by specifying the WS_CAPTION style in the dwStyle parameter.
+ /// </summary>
+ WS_EX_DLGMODALFRAME = 0x00000001,
+ /// <summary>
+ /// Windows 2000/XP: Creates a layered window. Note that this cannot be used for child windows. Also, this cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC.
+ /// </summary>
+ WS_EX_LAYERED = 0x00080000,
+ /// <summary>
+ /// Arabic and Hebrew versions of Windows 98/Me, Windows 2000/XP: Creates a window whose horizontal origin is on the right edge. Increasing horizontal values advance to the left.
+ /// </summary>
+ WS_EX_LAYOUTRTL = 0x00400000,
+ /// <summary>
+ /// Creates a window that has generic left-aligned properties. This is the default.
+ /// </summary>
+ WS_EX_LEFT = 0x00000000,
+ /// <summary>
+ /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored.
+ /// </summary>
+ WS_EX_LEFTSCROLLBAR = 0x00004000,
+ /// <summary>
+ /// The window text is displayed using left-to-right reading-order properties. This is the default.
+ /// </summary>
+ WS_EX_LTRREADING = 0x00000000,
+ /// <summary>
+ /// Creates a multiple-document interface (MDI) child window.
+ /// </summary>
+ WS_EX_MDICHILD = 0x00000040,
+ /// <summary>
+ /// Windows 2000/XP: A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window.
+ /// To activate the window, use the SetActiveWindow or SetForegroundWindow function.
+ /// The window does not appear on the taskbar by default. To force the window to appear on the taskbar, use the WS_EX_APPWINDOW style.
+ /// </summary>
+ WS_EX_NOACTIVATE = 0x08000000,
+ /// <summary>
+ /// Windows 2000/XP: A window created with this style does not pass its window layout to its child windows.
+ /// </summary>
+ WS_EX_NOINHERITLAYOUT = 0x00100000,
+ /// <summary>
+ /// Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed.
+ /// </summary>
+ WS_EX_NOPARENTNOTIFY = 0x00000004,
+ /// <summary>
+ /// Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles.
+ /// </summary>
+ WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE,
+ /// <summary>
+ /// Combines the WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW, and WS_EX_TOPMOST styles.
+ /// </summary>
+ WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST,
+ /// <summary>
+ /// The window has generic "right-aligned" properties. This depends on the window class. This style has an effect only if the shell language is Hebrew, Arabic, or another language that supports reading-order alignment; otherwise, the style is ignored.
+ /// Using the WS_EX_RIGHT style for static or edit controls has the same effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this style with button controls has the same effect as using BS_RIGHT and BS_RIGHTBUTTON styles.
+ /// </summary>
+ WS_EX_RIGHT = 0x00001000,
+ /// <summary>
+ /// Vertical scroll bar (if present) is to the right of the client area. This is the default.
+ /// </summary>
+ WS_EX_RIGHTSCROLLBAR = 0x00000000,
+ /// <summary>
+ /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order properties. For other languages, the style is ignored.
+ /// </summary>
+ WS_EX_RTLREADING = 0x00002000,
+ /// <summary>
+ /// Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.
+ /// </summary>
+ WS_EX_STATICEDGE = 0x00020000,
+ /// <summary>
+ /// Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by right-clicking or by typing ALT+SPACE.
+ /// </summary>
+ WS_EX_TOOLWINDOW = 0x00000080,
+ /// <summary>
+ /// Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function.
+ /// </summary>
+ WS_EX_TOPMOST = 0x00000008,
+ /// <summary>
+ /// Specifies that a window created with this style should not be painted until siblings beneath the window (that were created by the same thread) have been painted. The window appears transparent because the bits of underlying sibling windows have already been painted.
+ /// To achieve transparency without these restrictions, use the SetWindowRgn function.
+ /// </summary>
+ WS_EX_TRANSPARENT = 0x00000020,
+ /// <summary>
+ /// Specifies that a window has a border with a raised edge.
+ /// </summary>
+ WS_EX_WINDOWEDGE = 0x00000100
+}
+
+public enum ShowWindowCommands
+{
+ /// <summary>
+ /// Hides the window and activates another window.
+ /// </summary>
+ Hide = 0,
+ /// <summary>
+ /// Activates and displays a window. If the window is minimized or
+ /// maximized, the system restores it to its original size and position.
+ /// An application should specify this flag when displaying the window
+ /// for the first time.
+ /// </summary>
+ Normal = 1,
+ /// <summary>
+ /// Activates the window and displays it as a minimized window.
+ /// </summary>
+ ShowMinimized = 2,
+ /// <summary>
+ /// Maximizes the specified window.
+ /// </summary>
+ Maximize = 3, // is this the right value?
+ /// <summary>
+ /// Activates the window and displays it as a maximized window.
+ /// </summary>
+ ShowMaximized = 3,
+ /// <summary>
+ /// Displays a window in its most recent size and position. This value
+ /// is similar to <see cref="Win32.ShowWindowCommand.Normal"/>, except
+ /// the window is not activated.
+ /// </summary>
+ ShowNoActivate = 4,
+ /// <summary>
+ /// Activates the window and displays it in its current size and position.
+ /// </summary>
+ Show = 5,
+ /// <summary>
+ /// Minimizes the specified window and activates the next top-level
+ /// window in the Z order.
+ /// </summary>
+ Minimize = 6,
+ /// <summary>
+ /// Displays the window as a minimized window. This value is similar to
+ /// <see cref="Win32.ShowWindowCommand.ShowMinimized"/>, except the
+ /// window is not activated.
+ /// </summary>
+ ShowMinNoActive = 7,
+ /// <summary>
+ /// Displays the window in its current size and position. This value is
+ /// similar to <see cref="Win32.ShowWindowCommand.Show"/>, except the
+ /// window is not activated.
+ /// </summary>
+ ShowNA = 8,
+ /// <summary>
+ /// Activates and displays the window. If the window is minimized or
+ /// maximized, the system restores it to its original size and position.
+ /// An application should specify this flag when restoring a minimized window.
+ /// </summary>
+ Restore = 9,
+ /// <summary>
+ /// Sets the show state based on the SW_* value specified in the
+ /// STARTUPINFO structure passed to the CreateProcess function by the
+ /// program that started the application.
+ /// </summary>
+ ShowDefault = 10,
+ /// <summary>
+ /// <b>Windows 2000/XP:</b> Minimizes a window, even if the thread
+ /// that owns the window is not responding. This flag should only be
+ /// used when minimizing windows from a different thread.
+ /// </summary>
+ ForceMinimize = 11
+}