Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pynxc/waxy/fontdialog.py~
diff options
context:
space:
mode:
Diffstat (limited to 'pynxc/waxy/fontdialog.py~')
-rw-r--r--pynxc/waxy/fontdialog.py~35
1 files changed, 35 insertions, 0 deletions
diff --git a/pynxc/waxy/fontdialog.py~ b/pynxc/waxy/fontdialog.py~
new file mode 100644
index 0000000..e6959c0
--- /dev/null
+++ b/pynxc/waxy/fontdialog.py~
@@ -0,0 +1,35 @@
+# fontdialog.py
+
+# Issues:
+# objects' GetFont() really should return a Font instance, not a wx.Font
+
+import wx
+import waxyobject
+from font import Font
+
+class FontDialog(wx.FontDialog, waxobject.WaxObject):
+
+ def __init__(self, parent, data=None):
+ if not data:
+ data = wx.FontData()
+ wx.FontDialog.__init__(self, parent, data)
+
+ def ShowModal(self):
+ """ Simplified ShowModal(), returning strings 'ok' or 'cancel'. """
+ result = wx.FontDialog.ShowModal(self)
+ if result == wx.ID_OK:
+ return 'ok'
+ else:
+ return 'cancel'
+
+ def GetChosenFont(self):
+ """ Shorthand... """
+ data = self.GetFontData()
+ font = data.GetChosenFont()
+ font.__class__ = Font
+ return font
+
+# XXX
+# Problem: GetFontData() returns a wxFontData object, whose GetChosenFont()
+# still returns a wxFont, not a wax Font. No big deal really, but inconsistent.
+# Maybe Wax needs its own FontData class...?