[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/forms/src UIwxpython.py
From: |
James Thompson |
Subject: |
gnue/forms/src UIwxpython.py |
Date: |
Tue, 15 Jan 2002 23:39:50 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: James Thompson <address@hidden> 02/01/15 23:39:50
Modified files:
forms/src : UIwxpython.py
Log message:
login tab navigation bug fixed
msg dialogs now line wrap
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/UIwxpython.py.diff?tr1=1.124&tr2=1.125&r1=text&r2=text
Patches:
Index: gnue/forms/src/UIwxpython.py
diff -c gnue/forms/src/UIwxpython.py:1.124 gnue/forms/src/UIwxpython.py:1.125
*** gnue/forms/src/UIwxpython.py:1.124 Tue Jan 8 22:59:11 2002
--- gnue/forms/src/UIwxpython.py Tue Jan 15 23:39:50 2002
***************
*** 93,107 ****
self.seq = seq
def loginFieldEventTrap(self, event):
! if event.KeyCode() in (WXK_RETURN, WXK_TAB):
! if self.seq < len(self.app.textctrlList) - 1:
! self.app.textctrlList[self.seq+1].SetFocus()
! else:
! if event.KeyCode() == WXK_TAB:
! self.app.loginButton.SetFocus()
! else:
! self.app.loginCompleted(1)
! else:
event.Skip()
#
--- 93,110 ----
self.seq = seq
def loginFieldEventTrap(self, event):
! if event.KeyCode() in (WXK_RETURN, WXK_TAB):
! if self.seq < len(self.app.textctrlList) - 1:
! self.app.textctrlList[self.seq+1].SetFocus()
! else:
! if event.KeyCode() == WXK_TAB:
! if event.ShiftDown():
! self.app.textctrlList[self.seq-1].SetFocus()
! else:
! self.app.loginButton.SetFocus()
! else:
! self.app.loginCompleted(1)
! else:
event.Skip()
#
***************
*** 928,937 ****
--- 931,964 ----
#
class UIMessageBox(wxMessageDialog, UIHelper):
def __init__(self, interface, message, caption):
+
+ message = self.lineWrap(message,60)
wxMessageDialog.__init__(self, interface, message, caption,
style=wxOK|wxICON_EXCLAMATION)
+ # TODO: very simple line wrap
+ # TODO: should be moved to common and made more intelligent
+ def lineWrap(self,message,maxWidth):
+ text = ""
+
+ temptext = string.strip(message)
+
+ for strings in string.split(temptext,"\n"):
+ while len(strings) > maxWidth:
+ index = 0
+ for sep in [' ',',',':']:
+ ind = string.rfind(strings,sep,0,maxWidth-1)+1
+ if ind > index: index = ind
+ if index > maxWidth:
+ index = maxWidth-1
+
+ text += "%s\n" % strings[:index]
+ strings = strings[index:]
+
+ text += "%s\n" % strings
+
+ return text
#####################################################################
#####################################################################
- gnue/forms/src UIwxpython.py,
James Thompson <=