[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7515 - trunk/gnue-forms/src/uidrivers/win32
From: |
btami |
Subject: |
[gnue] r7515 - trunk/gnue-forms/src/uidrivers/win32 |
Date: |
Tue, 3 May 2005 17:06:24 -0500 (CDT) |
Author: btami
Date: 2005-05-03 17:06:22 -0500 (Tue, 03 May 2005)
New Revision: 7515
Modified:
trunk/gnue-forms/src/uidrivers/win32/UIdriver.py
trunk/gnue-forms/src/uidrivers/win32/dialogs.py
Log:
added _getInput to uidriver
Modified: trunk/gnue-forms/src/uidrivers/win32/UIdriver.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/win32/UIdriver.py 2005-05-03 12:26:35 UTC
(rev 7514)
+++ trunk/gnue-forms/src/uidrivers/win32/UIdriver.py 2005-05-03 22:06:22 UTC
(rev 7515)
@@ -310,6 +310,7 @@
GDebug.printMesg(6, "Getting clipboard value '%s'" % value)
event.__result__ = value
+
def setClipboardContents(self, event):
GDebug.printMesg(6,"Setting clipboard '%s'" % event.text)
@@ -321,6 +322,7 @@
win32clipboard.CloseClipboard()
else:
GDebug.printMesg(6,'Unable to open clipboard for write')
+
def setTitle(self, event):
ui = self._gfObjToUIWidget[event._form]
@@ -328,7 +330,11 @@
win32gui.SetWindowText(ui.mainWindow.GetHwnd(), event.title)
except AttributeError:
pass
+
+ # ---------------------------------------------------------------------------
+ # create a modal message box
+ # ---------------------------------------------------------------------------
def _showMessage (self, message, kind = 'Info', title = None, cancel =
False):
"""
@@ -362,9 +368,36 @@
res = win32gui.MessageBox(0, message, title, flags)
return self._RESPONSE [res]
+
+
+ # ---------------------------------------------------------------------------
+ # Start an input dialog and return the data record or None if cancelled
+ # ---------------------------------------------------------------------------
+ def _getInput (self, title, fields, cancel = True):
+
+ dialog = dialogs.InputDialog (title, fields, cancel)
+ try:
+ dialog.DoModal ()
+ return dialog.inputData
+
+ finally:
+ dialog.Destroy ()
+
+
+ # ---------------------------------------------------------------------------
+ # Show an exception
+ # TODO: please implement a better dialog box, i.e. add a button for
+ # detail-display and so on
+ # ---------------------------------------------------------------------------
+
def _showException (self, group, name, message, detail):
self.showMessage (detail, kind = 'Error')
+
+
+ # ---------------------------------------------------------------------------
+ # Display an about box
+ # ---------------------------------------------------------------------------
def _showAbout (self, name, appversion, formversion, author, description):
Modified: trunk/gnue-forms/src/uidrivers/win32/dialogs.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/win32/dialogs.py 2005-05-03 12:26:35 UTC
(rev 7514)
+++ trunk/gnue-forms/src/uidrivers/win32/dialogs.py 2005-05-03 22:06:22 UTC
(rev 7515)
@@ -295,6 +295,8 @@
def OnClose(self, hwnd, msg, wparam, lparam):
win32gui.EndDialog(hwnd, 0)
+ def Destroy(self):
+ win32gui.DestroyWindow(self._hwnd)
def OnCommand(self, hwnd, msg, wparam, lparam):
id = win32api.LOWORD(wparam)
@@ -566,8 +568,9 @@
"get's continued in the third line too.\n" \
"And here comes the rest. Here we go."
#desc = "Hey boyz, that thingy is quite complicated"
- x = AboutBox ('Foobar', '1.0', '0.5.2', 'Frodo', desc)
- x.DoModal ()
+ dialog = AboutBox ('Foobar', '1.0', '0.5.2', 'Frodo', desc)
+ dialog.DoModal ()
+ dialog.Destroy
#
---------------------------------------------------------------------------
@@ -602,3 +605,4 @@
dialog = InputDialog('Foobar', fields)
dialog.DoModal()
print dialog.inputData
+ dialog.Destroy
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7515 - trunk/gnue-forms/src/uidrivers/win32,
btami <=