Mercurial > repos > IBBoard.GtkSharp
annotate Translatable/TranslatableWindow.cs @ 24:3da8cf449717
Re #47: Add translatable GTK# widgets
* Add "Translate" methods to dialog and window to make them easily translatable without having to remember the required call
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 29 Dec 2010 16:47:46 +0000 |
parents | 2ddde7f1730e |
children |
rev | line source |
---|---|
19
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 // This file (TranslatableWindow.cs) is a part of the IBBoard.GtkSharp project and is copyright 2010 IBBoard |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 // |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 // // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 using System; |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 using Gtk; |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 using IBBoard.Lang; |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 namespace IBBoard.GtkSharp.Translatable |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 { |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 public abstract class TranslatableWindow : Window, ITranslatable |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 { |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 public TranslatableWindow(IntPtr ptr) : base(ptr) |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 { |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 //Do nothing extra |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 } |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 public TranslatableWindow(Gtk.WindowType windowType) : base(windowType) |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 { |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 //Do nothing extra |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 } |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 public TranslatableWindow(string windowTitle) : base(windowTitle) |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 { |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 //Do nothing extra |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 } |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 |
24
3da8cf449717
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
19
diff
changeset
|
28 protected virtual void Translate() |
3da8cf449717
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
19
diff
changeset
|
29 { |
3da8cf449717
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
19
diff
changeset
|
30 ControlTranslator.TranslateWidget(this); |
3da8cf449717
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
19
diff
changeset
|
31 } |
3da8cf449717
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
19
diff
changeset
|
32 |
19
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
33 public string Text |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
34 { |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
35 get |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
36 { |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
37 return Title; |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
38 } |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
39 set |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
40 { |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
41 Title = value; |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
42 } |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
43 } |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
44 } |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
45 } |
2ddde7f1730e
Re #47: Add translatable GTK# widgets
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
46 |