index on master: c769c7a
Add GtkMac bridge (MonoMac hosted in Gtk) project
This commit is contained in:
Родитель
c769c7afd4
Коммит
92b85a59a1
|
@ -11,25 +11,25 @@
|
|||
<AssemblyName>GtkTest</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
|
@ -38,7 +38,7 @@
|
|||
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
|
@ -49,7 +49,7 @@
|
|||
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
|
||||
<DebugType>none</DebugType>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
|
|
@ -12,22 +12,30 @@
|
|||
<AssemblyName>MacTest</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<EnableCodeSigning>False</EnableCodeSigning>
|
||||
<CreatePackage>False</CreatePackage>
|
||||
<EnablePackageSigning>False</EnablePackageSigning>
|
||||
<IncludeMonoRuntime>False</IncludeMonoRuntime>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<EnableCodeSigning>False</EnableCodeSigning>
|
||||
<CreatePackage>False</CreatePackage>
|
||||
<EnablePackageSigning>False</EnablePackageSigning>
|
||||
<IncludeMonoRuntime>False</IncludeMonoRuntime>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
|
|
@ -11,22 +11,22 @@
|
|||
<AssemblyName>Samples</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
@ -53,8 +53,13 @@
|
|||
</Compile>
|
||||
<Compile Include="MainWindow.cs">
|
||||
<SubType>Component</SubType>
|
||||
<DeployService-Deploy>True</DeployService-Deploy>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Compile>
|
||||
<Compile Include="App.cs">
|
||||
<DeployService-Deploy>True</DeployService-Deploy>
|
||||
<Gettext-ScanForTranslations>False</Gettext-ScanForTranslations>
|
||||
</Compile>
|
||||
<Compile Include="App.cs" />
|
||||
<Compile Include="MonoDevelop.Components.Chart\Axis.cs" />
|
||||
<Compile Include="MonoDevelop.Components.Chart\AxisDimension.cs" />
|
||||
<Compile Include="MonoDevelop.Components.Chart\AxisPosition.cs" />
|
||||
|
@ -161,6 +166,7 @@
|
|||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Samples\cow.jpg">
|
||||
<LogicalName>cow.jpg</LogicalName>
|
||||
<DeployService-Deploy>True</DeployService-Deploy>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
|
|
|
@ -32,9 +32,9 @@ namespace Samples
|
|||
{
|
||||
public Windows ()
|
||||
{
|
||||
Button b = new Button ("Show borderless window");
|
||||
PackStart (b);
|
||||
b.Clicked += delegate {
|
||||
Button bp = new Button ("Show borderless window");
|
||||
PackStart (bp);
|
||||
bp.Clicked += delegate {
|
||||
Window w = new Window ();
|
||||
w.Decorated = false;
|
||||
Button c = new Button ("This is a window");
|
||||
|
@ -43,11 +43,11 @@ namespace Samples
|
|||
c.Clicked += delegate {
|
||||
w.Dispose ();
|
||||
};
|
||||
var bpos = b.ScreenBounds;
|
||||
w.ScreenBounds = new Rectangle (bpos.X, bpos.Y + b.Size.Height, w.Width, w.Height);
|
||||
var bpos = bp.ScreenBounds;
|
||||
w.ScreenBounds = new Rectangle (bpos.X, bpos.Y + bp.Size.Height, w.Width, w.Height);
|
||||
w.Show ();
|
||||
};
|
||||
b = new Button ("Show message dialog");
|
||||
Button b = new Button ("Show message dialog");
|
||||
PackStart (b);
|
||||
b.Clicked += delegate {
|
||||
MessageDialog.ShowMessage (ParentWindow, "Hi there!");
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// ButtonTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class ButtonTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new Button ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// CanvasTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class CanvasTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new Canvas ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// CheckBoxTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class CheckBoxTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new CheckBox ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
//
|
||||
// ComboBoxEntryTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
[Ignore]
|
||||
public class ComboBoxEntryTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new ComboBoxEntry ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
//
|
||||
// ComboBoxTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class ComboBoxTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new ComboBox ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
//
|
||||
// FrameTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class FrameTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new Frame ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// HBoxTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class HBoxTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new HBox ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// HPanedTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class HPanedTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new HPaned ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// HSeparator.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class HSeparatorTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new HSeparator ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// ImageViewTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class ImageViewTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new ImageView ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// LabelTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class LabelTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new Label ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// ListBoxTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class ListBoxTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new ListBox ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// ListViewTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class ListViewTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new ListView ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// NotebookTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class NotebookTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new Notebook ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// ProgressBarTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class ProgressBarTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new ProgressBar ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// ScrollViewTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class ScrollViewTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new ScrollView ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
//
|
||||
// Setup.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
[SetUpFixture]
|
||||
public class Setup
|
||||
{
|
||||
[SetUp]
|
||||
public void SetUp ()
|
||||
{
|
||||
Xwt.Application.Initialize ("Xwt.GtkBackend.GtkEngine, Xwt.Gtk, Version=1.0.0.0");
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void Cleanup ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// SpinButtonTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class SpinButtonTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new SpinButton ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// TableTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class TableTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new Table ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>10.0.0</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{3C7623A9-9E16-41F6-BBB2-0B550F28E749}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Test</RootNamespace>
|
||||
<AssemblyName>Test</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="nunit.framework">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ButtonTests.cs" />
|
||||
<Compile Include="WidgetTests.cs" />
|
||||
<Compile Include="Setup.cs" />
|
||||
<Compile Include="TextEntryTests.cs" />
|
||||
<Compile Include="HBoxTests.cs" />
|
||||
<Compile Include="VBoxTests.cs" />
|
||||
<Compile Include="CanvasTests.cs" />
|
||||
<Compile Include="CheckBoxTests.cs" />
|
||||
<Compile Include="ComboBoxTests.cs" />
|
||||
<Compile Include="ComboBoxEntryTests.cs" />
|
||||
<Compile Include="FrameTests.cs" />
|
||||
<Compile Include="HPanedTests.cs" />
|
||||
<Compile Include="VPanedTests.cs" />
|
||||
<Compile Include="HSeparatorTests.cs" />
|
||||
<Compile Include="ImageViewTests.cs" />
|
||||
<Compile Include="LabelTests.cs" />
|
||||
<Compile Include="ListBoxTests.cs" />
|
||||
<Compile Include="ListViewTests.cs" />
|
||||
<Compile Include="NotebookTests.cs" />
|
||||
<Compile Include="ProgressBarTests.cs" />
|
||||
<Compile Include="ScrollViewTests.cs" />
|
||||
<Compile Include="SpinButtonTests.cs" />
|
||||
<Compile Include="TableTests.cs" />
|
||||
<Compile Include="VSeparatorTests.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Xwt\Xwt.csproj">
|
||||
<Project>{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}</Project>
|
||||
<Name>Xwt</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Xwt.Gtk\Xwt.Gtk.csproj">
|
||||
<Project>{C3887A93-B2BD-4097-8E2F-3A063EFF32FD}</Project>
|
||||
<Name>Xwt.Gtk</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// TextEntryTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class TextEntryTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new TextEntry ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// VBoxTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class VBoxTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new VBox ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// VPanedTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class VPanedTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new VPaned ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// VSeparatorTests.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
public class VSeparatorTests: WidgetTests
|
||||
{
|
||||
public override Widget CreateWidget ()
|
||||
{
|
||||
return new VSeparator ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,239 @@
|
|||
//
|
||||
// Widget.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Xwt
|
||||
{
|
||||
[TestFixture]
|
||||
public abstract class WidgetTests
|
||||
{
|
||||
public abstract Widget CreateWidget ();
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void Init ()
|
||||
{
|
||||
}
|
||||
|
||||
[TestFixtureTearDown]
|
||||
public void Cleanup ()
|
||||
{
|
||||
}
|
||||
|
||||
public void Run (Action a)
|
||||
{
|
||||
Exception ex = null;
|
||||
Application.Invoke (delegate {
|
||||
try {
|
||||
a ();
|
||||
} catch (Exception e) {
|
||||
ex = e;
|
||||
}
|
||||
Application.Exit ();
|
||||
});
|
||||
Application.Run ();
|
||||
if (ex != null)
|
||||
throw new Exception ("Exception in gui event loop", ex);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Visibility ()
|
||||
{
|
||||
var w = CreateWidget ();
|
||||
Assert.IsTrue (w.Visible, "Not visible by default");
|
||||
w.Hide ();
|
||||
Assert.IsFalse (w.Visible);
|
||||
w.Show ();
|
||||
Assert.IsTrue (w.Visible);
|
||||
w.Visible = false;
|
||||
Assert.IsFalse (w.Visible);
|
||||
w.Visible = true;
|
||||
Assert.IsTrue (w.Visible);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sensitivity ()
|
||||
{
|
||||
var w = CreateWidget ();
|
||||
Assert.IsTrue (w.Sensitive, "Not sensitive by default");
|
||||
w.Sensitive = false;
|
||||
Assert.IsFalse (w.Sensitive);
|
||||
w.Sensitive = true;
|
||||
Assert.IsTrue (w.Sensitive);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ParentWindow ()
|
||||
{
|
||||
var w = CreateWidget ();
|
||||
var win = new Window ();
|
||||
win.Content = w;
|
||||
Assert.AreSame (win, w.ParentWindow);
|
||||
win.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Margin ()
|
||||
{
|
||||
var w = CreateWidget ();
|
||||
Assert.AreEqual (0, w.Margin.Left);
|
||||
Assert.AreEqual (0, w.Margin.Top);
|
||||
Assert.AreEqual (0, w.Margin.Right);
|
||||
Assert.AreEqual (0, w.Margin.Bottom);
|
||||
w.Margin.SetAll (4);
|
||||
Assert.AreEqual (4, w.Margin.Left);
|
||||
Assert.AreEqual (4, w.Margin.Top);
|
||||
Assert.AreEqual (4, w.Margin.Right);
|
||||
Assert.AreEqual (4, w.Margin.Bottom);
|
||||
w.Margin.Set (10, 20, 30, 40);
|
||||
Assert.AreEqual (10, w.Margin.Left);
|
||||
Assert.AreEqual (20, w.Margin.Top);
|
||||
Assert.AreEqual (30, w.Margin.Right);
|
||||
Assert.AreEqual (40, w.Margin.Bottom);
|
||||
w.Margin.Left = 1;
|
||||
Assert.AreEqual (1, w.Margin.Left);
|
||||
Assert.AreEqual (20, w.Margin.Top);
|
||||
Assert.AreEqual (30, w.Margin.Right);
|
||||
Assert.AreEqual (40, w.Margin.Bottom);
|
||||
w.Margin.Top = 2;
|
||||
Assert.AreEqual (1, w.Margin.Left);
|
||||
Assert.AreEqual (2, w.Margin.Top);
|
||||
Assert.AreEqual (30, w.Margin.Right);
|
||||
Assert.AreEqual (40, w.Margin.Bottom);
|
||||
w.Margin.Right = 3;
|
||||
Assert.AreEqual (1, w.Margin.Left);
|
||||
Assert.AreEqual (2, w.Margin.Top);
|
||||
Assert.AreEqual (3, w.Margin.Right);
|
||||
Assert.AreEqual (40, w.Margin.Bottom);
|
||||
w.Margin.Bottom = 4;
|
||||
Assert.AreEqual (1, w.Margin.Left);
|
||||
Assert.AreEqual (2, w.Margin.Top);
|
||||
Assert.AreEqual (3, w.Margin.Right);
|
||||
Assert.AreEqual (4, w.Margin.Bottom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Focus ()
|
||||
{
|
||||
var win = new Window ();
|
||||
var w = CreateWidget ();
|
||||
|
||||
Run (delegate {
|
||||
HBox box = new HBox ();
|
||||
TextEntry e = new TextEntry ();
|
||||
box.PackStart (e);
|
||||
box.PackStart (w);
|
||||
win.Content = box;
|
||||
win.Show ();
|
||||
win.Present ();
|
||||
|
||||
// for (int n=0; n < 500; n++) {
|
||||
Application.DispatchPendingEvents ();
|
||||
// System.Threading.Thread.Sleep (10);
|
||||
// }
|
||||
|
||||
e.SetFocus ();
|
||||
|
||||
Application.DispatchPendingEvents ();
|
||||
|
||||
Assert.IsFalse (w.HasFocus);
|
||||
// Assert.IsTrue (w.CanGetFocus);
|
||||
|
||||
int gotFocus = 0;
|
||||
w.GotFocus += delegate {
|
||||
gotFocus++;
|
||||
};
|
||||
|
||||
w.SetFocus ();
|
||||
Assert.IsTrue (w.HasFocus);
|
||||
Assert.AreEqual (1, gotFocus);
|
||||
|
||||
int lostFocus = 0;
|
||||
w.LostFocus += delegate {
|
||||
lostFocus++;
|
||||
};
|
||||
|
||||
e.SetFocus ();
|
||||
|
||||
Assert.IsFalse (w.HasFocus);
|
||||
// Assert.AreEqual (1, lostFocus);
|
||||
|
||||
win.Dispose ();
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Ignore]
|
||||
public void MinSize ()
|
||||
{
|
||||
var win = new Window ();
|
||||
var w = CreateWidget ();
|
||||
|
||||
win.Content = w;
|
||||
win.Show ();
|
||||
|
||||
Application.DispatchPendingEvents ();
|
||||
|
||||
var defw = w.Size.Width;
|
||||
var defh = w.Size.Height;
|
||||
|
||||
w.MinWidth = 300;
|
||||
Assert.AreEqual (300, w.MinWidth);
|
||||
Assert.AreEqual (300, w.Size.Width);
|
||||
|
||||
w.MinHeight = 400;
|
||||
Assert.AreEqual (400, w.MinHeight);
|
||||
Assert.AreEqual (400, w.Size.Height);
|
||||
|
||||
w.MinWidth = -1;
|
||||
Assert.AreEqual (-1, w.MinWidth);
|
||||
Assert.AreEqual (defw, w.Size.Width);
|
||||
|
||||
w.MinHeight = -1;
|
||||
Assert.AreEqual (-1, w.MinHeight);
|
||||
Assert.AreEqual (defh, w.Size.Height);
|
||||
|
||||
win.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Ignore]
|
||||
public void Coordinates ()
|
||||
{
|
||||
var win = new Window ();
|
||||
var w = CreateWidget ();
|
||||
win.Content = w;
|
||||
win.Show ();
|
||||
|
||||
Application.DispatchPendingEvents ();
|
||||
|
||||
Assert.AreEqual (w.ScreenBounds, win.ScreenBounds);
|
||||
|
||||
win.Dispose ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
|
@ -24,12 +24,12 @@
|
|||
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
|
||||
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<Optimize>True</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
|
@ -37,7 +37,7 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
|
@ -47,12 +47,12 @@
|
|||
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
|
||||
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<Optimize>True</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
|
|
|
@ -34,23 +34,13 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
|
||||
<Package>gtk-sharp-2.0</Package>
|
||||
</Reference>
|
||||
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
|
||||
<Package>glib-sharp-2.0</Package>
|
||||
</Reference>
|
||||
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
|
||||
<Package>gtk-sharp-2.0</Package>
|
||||
</Reference>
|
||||
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
|
||||
<Package>gtk-sharp-2.0</Package>
|
||||
</Reference>
|
||||
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
|
||||
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
|
||||
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
|
||||
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Mono.Cairo" />
|
||||
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
|
||||
<Package>gtk-sharp-2.0</Package>
|
||||
</Reference>
|
||||
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
|
||||
<Reference Include="System.Drawing" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -105,7 +95,9 @@
|
|||
<Compile Include="Xwt.GtkBackend\CheckBoxMenuItemBackend.cs" />
|
||||
<Compile Include="Xwt.GtkBackend\RadioButtonMenuItemBackend.cs" />
|
||||
<Compile Include="Xwt.GtkBackend\SeparatorMenuItemBackend.cs" />
|
||||
<Compile Include="Xwt.GtkBackend\ScrollAdjustmentBackend.cs" />
|
||||
<Compile Include="Xwt.GtkBackend\ScrollAdjustmentBackend.cs">
|
||||
<Gettext-ScanForTranslations>False</Gettext-ScanForTranslations>
|
||||
</Compile>
|
||||
<Compile Include="Xwt.GtkBackend\FileDialogBackend.cs" />
|
||||
<Compile Include="Xwt.GtkBackend\PanedBackend.cs" />
|
||||
<Compile Include="Xwt.GtkBackend\SelectColorDialogBackend.cs" />
|
||||
|
|
|
@ -207,6 +207,22 @@ namespace Xwt.GtkBackend
|
|||
IGtkWidgetBackend wb = (IGtkWidgetBackend)Registry.GetBackend (w);
|
||||
return wb.Widget.Toplevel as Gtk.Window;
|
||||
}
|
||||
|
||||
public override void DispatchPendingEvents ()
|
||||
{
|
||||
// The loop is limited to 1000 iterations as a workaround for an issue that some users
|
||||
// have experienced. Sometimes EventsPending starts return 'true' for all iterations,
|
||||
// causing the loop to never end.
|
||||
|
||||
int n = 1000;
|
||||
Gdk.Threads.Enter();
|
||||
|
||||
while (Gtk.Application.EventsPending () && --n > 0) {
|
||||
Gtk.Application.RunIteration (false);
|
||||
}
|
||||
|
||||
Gdk.Threads.Leave();
|
||||
}
|
||||
}
|
||||
|
||||
public interface IGtkContainer
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace Xwt.GtkBackend
|
|||
|
||||
static IntPtr cls_NSScreen;
|
||||
static IntPtr sel_screens, sel_objectEnumerator, sel_nextObject, sel_frame, sel_visibleFrame,
|
||||
sel_requestUserAttention;
|
||||
sel_requestUserAttention, sel_activateIgnoringOtherApps;
|
||||
static IntPtr sharedApp;
|
||||
|
||||
const int NSCriticalRequest = 0;
|
||||
|
@ -117,6 +117,7 @@ namespace Xwt.GtkBackend
|
|||
sel_visibleFrame = sel_registerName ("visibleFrame");
|
||||
sel_frame = sel_registerName ("frame");
|
||||
sel_requestUserAttention = sel_registerName ("requestUserAttention:");
|
||||
sel_activateIgnoringOtherApps = sel_registerName ("activateIgnoringOtherApps:");
|
||||
sharedApp = objc_msgSend_IntPtr (objc_getClass ("NSApplication"), sel_registerName ("sharedApplication"));
|
||||
}
|
||||
|
||||
|
@ -177,6 +178,11 @@ namespace Xwt.GtkBackend
|
|||
objc_msgSend_int_int (sharedApp, sel_requestUserAttention, kind);
|
||||
}
|
||||
|
||||
public static void GrabDesktopFocus ()
|
||||
{
|
||||
objc_msgSend_void_bool (sharedApp, sel_activateIgnoringOtherApps, true);
|
||||
}
|
||||
|
||||
public static Gdk.Rectangle GetUsableMonitorGeometry (this Gdk.Screen screen, int monitor)
|
||||
{
|
||||
if (Platform.IsMac)
|
||||
|
|
|
@ -134,12 +134,22 @@ namespace Xwt.GtkBackend
|
|||
}
|
||||
|
||||
public bool HasFocus {
|
||||
get { return Widget.HasFocus; }
|
||||
get { return Widget.IsFocus; }
|
||||
}
|
||||
|
||||
public void SetFocus ()
|
||||
{
|
||||
Widget.GrabFocus ();
|
||||
Widget.IsFocus = true;
|
||||
// SetFocus (Widget);
|
||||
}
|
||||
|
||||
void SetFocus (Gtk.Widget w)
|
||||
{
|
||||
if (w.Parent != null)
|
||||
SetFocus (w.Parent);
|
||||
w.GrabFocus ();
|
||||
w.IsFocus = true;
|
||||
w.HasFocus = true;
|
||||
}
|
||||
|
||||
public string TooltipText {
|
||||
|
@ -422,9 +432,11 @@ namespace Xwt.GtkBackend
|
|||
Widget.KeyReleaseEvent += HandleKeyReleaseEvent;
|
||||
break;
|
||||
case WidgetEvent.GotFocus:
|
||||
Widget.FocusInEvent += HandleWidgetFocusInEvent;
|
||||
EventsRootWidget.Events |= Gdk.EventMask.FocusChangeMask;
|
||||
Widget.FocusGrabbed += HandleWidgetFocusInEvent;
|
||||
break;
|
||||
case WidgetEvent.LostFocus:
|
||||
EventsRootWidget.Events |= Gdk.EventMask.FocusChangeMask;
|
||||
Widget.FocusOutEvent += HandleWidgetFocusOutEvent;
|
||||
break;
|
||||
case WidgetEvent.MouseEntered:
|
||||
|
@ -536,6 +548,9 @@ namespace Xwt.GtkBackend
|
|||
if ((ev & sizeCheckEvents) != 0) {
|
||||
DisableSizeCheckEvents ();
|
||||
}
|
||||
if ((ev & WidgetEvent.GotFocus) == 0 && (enabledEvents & WidgetEvent.LostFocus) == 0) {
|
||||
EventsRootWidget.Events &= ~Gdk.EventMask.FocusChangeMask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -716,7 +731,7 @@ namespace Xwt.GtkBackend
|
|||
});
|
||||
}
|
||||
|
||||
void HandleWidgetFocusInEvent (object o, Gtk.FocusInEventArgs args)
|
||||
void HandleWidgetFocusInEvent (object o, EventArgs args)
|
||||
{
|
||||
Toolkit.Invoke (delegate {
|
||||
EventSink.OnGotFocus ();
|
||||
|
|
|
@ -175,6 +175,8 @@ namespace Xwt.GtkBackend
|
|||
|
||||
public void Present ()
|
||||
{
|
||||
if (Platform.IsMac)
|
||||
GtkWorkarounds.GrabDesktopFocus ();
|
||||
Window.Present ();
|
||||
}
|
||||
|
||||
|
|
|
@ -12,22 +12,30 @@
|
|||
<AssemblyName>Xwt.Mac</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<EnableCodeSigning>False</EnableCodeSigning>
|
||||
<CreatePackage>False</CreatePackage>
|
||||
<EnablePackageSigning>False</EnablePackageSigning>
|
||||
<IncludeMonoRuntime>False</IncludeMonoRuntime>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<EnableCodeSigning>False</EnableCodeSigning>
|
||||
<CreatePackage>False</CreatePackage>
|
||||
<EnablePackageSigning>False</EnablePackageSigning>
|
||||
<IncludeMonoRuntime>False</IncludeMonoRuntime>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
|
|
@ -165,6 +165,10 @@ namespace Xwt.Mac
|
|||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public override void DispatchPendingEvents ()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public interface IViewContainer
|
||||
|
|
|
@ -11,25 +11,25 @@
|
|||
<AssemblyName>Xwt.WPF</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>True</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>..\xwt.snk</AssemblyOriginatorKeyFile>
|
||||
|
|
12
Xwt.sln
12
Xwt.sln
|
@ -1,4 +1,4 @@
|
|||
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt", "Xwt\Xwt.csproj", "{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}"
|
||||
|
@ -18,12 +18,14 @@ EndProject
|
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfTest", "WpfTest\WpfTest.csproj", "{E41F4448-15C3-4E95-B310-FD333FDF5D2F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt.Gtk.Mac", "Xwt.Gtk.Mac\Xwt.Gtk.Mac.csproj", "{FB234220-D409-43D9-8926-E2D629A19285}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{3C7623A9-9E16-41F6-BBB2-0B550F28E749}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Mac-Debug|Any CPU = Mac-Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Win-Debug|Any CPU = Win-Debug|Any CPU
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0AF50CE4-E455-4A9D-92AD-711CBD068A55}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
|
@ -38,6 +40,14 @@ Global
|
|||
{2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2B7FF081-FE53-42F7-9D5D-D4B38E548F94}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3C7623A9-9E16-41F6-BBB2-0B550F28E749}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3C7623A9-9E16-41F6-BBB2-0B550F28E749}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3C7623A9-9E16-41F6-BBB2-0B550F28E749}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3C7623A9-9E16-41F6-BBB2-0B550F28E749}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3C7623A9-9E16-41F6-BBB2-0B550F28E749}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3C7623A9-9E16-41F6-BBB2-0B550F28E749}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3C7623A9-9E16-41F6-BBB2-0B550F28E749}.Win-Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3C7623A9-9E16-41F6-BBB2-0B550F28E749}.Win-Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.Mac-Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.Mac-Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{88C04B85-B69B-47B4-AB9F-64F6DD4E0897}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
|
|
@ -111,6 +111,11 @@ namespace Xwt.Backends
|
|||
{
|
||||
return WidgetRegistry.MainRegistry.GetBackend (image);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispatches pending events in the UI event queue
|
||||
/// </summary>
|
||||
public abstract void DispatchPendingEvents ();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the backend for a native window.
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
//
|
||||
// ToolkitEngine.cs
|
||||
//
|
||||
// Author:
|
||||
// Lluis Sanchez Gual <lluis@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2012 Xamarin Inc
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Xwt.Engine
|
||||
{
|
||||
public class ToolkitEngine
|
||||
{
|
||||
public ToolkitEngine ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -138,6 +138,16 @@ namespace Xwt
|
|||
}, timeSpan);
|
||||
return t;
|
||||
}
|
||||
|
||||
public static void DispatchPendingEvents ()
|
||||
{
|
||||
try {
|
||||
Toolkit.ExitUserCode (null);
|
||||
engine.DispatchPendingEvents ();
|
||||
} finally {
|
||||
Toolkit.EnterUserCode ();
|
||||
}
|
||||
}
|
||||
|
||||
public static StatusIcon CreateStatusIcon ()
|
||||
{
|
||||
|
|
|
@ -392,7 +392,7 @@ namespace Xwt
|
|||
public string Name { get; set; }
|
||||
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
public Widget Parent { get; set; }
|
||||
public Widget Parent { get; private set; }
|
||||
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
public IWidgetSurface Surface {
|
||||
|
@ -431,6 +431,8 @@ namespace Xwt
|
|||
public double MinWidth {
|
||||
get { return minWidth; }
|
||||
set {
|
||||
if (value < -1)
|
||||
throw new ArgumentException ("MinWidth can't be less that -1");
|
||||
minWidth = value;
|
||||
Backend.SetMinSize (minWidth >= 0 ? minWidth : -1, minHeight >= 0 ? minHeight : -1);
|
||||
OnPreferredSizeChanged ();
|
||||
|
@ -450,6 +452,8 @@ namespace Xwt
|
|||
public double MinHeight {
|
||||
get { return minHeight; }
|
||||
set {
|
||||
if (value < -1)
|
||||
throw new ArgumentException ("MinHeight can't be less that -1");
|
||||
minHeight = value;
|
||||
Backend.SetMinSize (minWidth >= 0 ? minWidth : -1, minHeight >= 0 ? minHeight : -1);
|
||||
OnPreferredSizeChanged ();
|
||||
|
@ -469,6 +473,8 @@ namespace Xwt
|
|||
public double NaturalWidth {
|
||||
get { return minWidth; }
|
||||
set {
|
||||
if (value < -1)
|
||||
throw new ArgumentException ("NaturalWidth can't be less that -1");
|
||||
naturalWidth = value;
|
||||
Backend.SetNaturalSize (naturalWidth >= 0 ? naturalWidth : -1, naturalHeight >= 0 ? naturalHeight : -1);
|
||||
OnPreferredSizeChanged ();
|
||||
|
@ -488,6 +494,8 @@ namespace Xwt
|
|||
public double NaturalHeight {
|
||||
get { return naturalHeight; }
|
||||
set {
|
||||
if (value < -1)
|
||||
throw new ArgumentException ("NaturalHeight can't be less that -1");
|
||||
naturalHeight = value;
|
||||
Backend.SetNaturalSize (naturalWidth >= 0 ? naturalWidth : -1, naturalHeight >= 0 ? naturalHeight : -1);
|
||||
OnPreferredSizeChanged ();
|
||||
|
@ -537,7 +545,13 @@ namespace Xwt
|
|||
{
|
||||
return Backend.ConvertToScreenCoordinates (widgetCoordinates);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the bounds of the widget in screen coordinates
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The widget bounds
|
||||
/// </value>
|
||||
public Rectangle ScreenBounds {
|
||||
get { return new Rectangle (ConvertToScreenCoordinates (new Point (0,0)), Size); }
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче