changeset 42:f04e973e5ea0 default tip

* Drop back to old Tooltips to support GTK# before 2.12 * Make sure we're not 2.12 specific to allow building on the server (running 2.10)
author IBBoard <dev@ibboard.co.uk>
date Sun, 07 Oct 2012 19:58:40 +0100
parents 122a93b48f3d
children
files IBBoard.GtkSharp.csproj Translatable/ControlTranslator.cs
diffstat 2 files changed, 23 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/IBBoard.GtkSharp.csproj	Sun Nov 27 13:51:27 2011 +0000
+++ b/IBBoard.GtkSharp.csproj	Sun Oct 07 19:58:40 2012 +0100
@@ -12,22 +12,22 @@
     <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
   </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>
     <Compile Include="AssemblyInfo.cs" />
@@ -53,12 +53,22 @@
   </ItemGroup>
   <ItemGroup>
     <Reference Include="System" />
-    <Reference Include="gtk-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="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+    <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+      <SpecificVersion>False</SpecificVersion>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+      <SpecificVersion>False</SpecificVersion>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+      <SpecificVersion>False</SpecificVersion>
+      <Private>False</Private>
+    </Reference>
     <Reference Include="Mono.Posix" />
     <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
       <Private>False</Private>
+      <SpecificVersion>False</SpecificVersion>
     </Reference>
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
--- a/Translatable/ControlTranslator.cs	Sun Nov 27 13:51:27 2011 +0000
+++ b/Translatable/ControlTranslator.cs	Sun Oct 07 19:58:40 2012 +0100
@@ -13,6 +13,9 @@
 	/// </summary>
 	public class ControlTranslator
 	{
+		//Tooltips is now obselete, but we need it to support GTK# pre-2.12
+		private static Tooltips tooltips = new Tooltips();
+		
 		public static void TranslateWidget(Widget toTranslate)
 		{
 			TranslateWidget(toTranslate, true);
@@ -42,11 +45,11 @@
 
 			if (translation == "")
 			{
-				widget.TooltipText = translation;
+				tooltips.SetTip(widget, translation, null);
 			}
 			else if (action != null)
 			{
-				widget.TooltipText = action.Label;
+				tooltips.SetTip(widget, action.Label, null);
 			}
 		}