A huge glob of changes in the 2.4 branch merged over to HEAD

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-10-02 00:58:06 +00:00
parent e3c0dc265f
commit 8b9a4190f7
180 changed files with 68512 additions and 1307 deletions

View File

@@ -17,7 +17,7 @@ Load color names/values from the rgb.txt file on my system...
def getColourList():
return map(lambda x: x[0], getColourInfoList())
return [ x[0] for x in getColourInfoList() ]
@@ -656,10 +656,14 @@ def getColourInfoList():
]
_haveUpdated = False
def updateColourDB():
from wxPython.wx import wxTheColourDatabase
cl = getColourInfoList()
for info in cl:
apply(wxTheColourDatabase.Append, info)
global _haveUpdated
if not _haveUpdated:
from wxPython.wx import wxTheColourDatabase
cl = getColourInfoList()
for info in cl:
wxTheColourDatabase.Append(*info)

View File

@@ -79,6 +79,8 @@ class wxEditor(wxScrolledWindow):
pos, size,
style|wxWANTS_CHARS)
self.isDrawing = False
self.InitCoords()
self.InitFonts()
self.SetColors()
@@ -167,8 +169,12 @@ class wxEditor(wxScrolledWindow):
def OnPaint(self, event):
dc = wxPaintDC(self)
if self.isDrawing:
return
self.isDrawing = True
self.UpdateView(dc)
self.AdjustScrollbars()
wxCallAfter(self.AdjustScrollbars)
self.isDrawing = False
def OnEraseBackground(self, evt):
pass

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,101 @@
#----------------------------------------------------------------------------
# Name: wxPython.lib.maskedctrl.py
# Author: Will Sadkin
# Created: 09/24/2003
# Copyright: (c) 2003 by Will Sadkin
# RCS-ID: $Id$
# License: wxWindows license
#----------------------------------------------------------------------------
"""<html><body>
<P>
<B>wxMaskedCtrl</B> is actually a factory function for several types of
masked edit controls:
<P>
<UL>
<LI><b>wxMaskedTextCtrl</b> - standard masked edit text box</LI>
<LI><b>wxMaskedComboBox</b> - adds combobox capabilities</LI>
<LI><b>wxIpAddrCtrl</b> - adds logical input semantics for IP address entry</LI>
<LI><b>wxTimeCtrl</b> - special subclass handling lots of time formats as values</LI>
<LI><b>wxMaskedNumCtrl</b> - special subclass handling numeric values</LI>
</UL>
<P>
<B>wxMaskedCtrl</B> works by looking for a special <b><i>controlType</i></b>
parameter in the variable arguments of the control, to determine
what kind of instance to return.
controlType can be one of:
<PRE><FONT SIZE=-1>
controlTypes.MASKEDTEXT
controlTypes.MASKEDCOMBO
controlTypes.IPADDR
controlTypes.TIME
controlTypes.NUMBER
</FONT></PRE>
These constants are also available individually, ie, you can
use either of the following:
<PRE><FONT SIZE=-1>
from wxPython.wx.lib.maskedctrl import wxMaskedCtrl, MASKEDCOMBO, MASKEDTEXT, NUMBER
from wxPython.wx.lib.maskedctrl import wxMaskedCtrl, controlTypes
</FONT></PRE>
If not specified as a keyword argument, the default controlType is
controlTypes.MASKEDTEXT.
<P>
Each of the above classes has its own unique arguments, but wxMaskedCtrl
provides a single "unified" interface for masked controls. wxMaskedTextCtrl,
wxMaskedComboBox and wxIpAddrCtrl are all documented below; the others have
their own demo pages and interface descriptions.
</body></html>
"""
from wxPython.lib.maskededit import wxMaskedTextCtrl, wxMaskedComboBox, wxIpAddrCtrl
from wxPython.lib.maskednumctrl import wxMaskedNumCtrl
from wxPython.lib.timectrl import wxTimeCtrl
# "type" enumeration for class instance factory function
MASKEDTEXT = 0
MASKEDCOMBO = 1
IPADDR = 2
TIME = 3
NUMBER = 4
# for ease of import
class controlTypes:
MASKEDTEXT = MASKEDTEXT
MASKEDCOMBO = MASKEDCOMBO
IPADDR = IPADDR
TIME = TIME
NUMBER = NUMBER
def wxMaskedCtrl( *args, **kwargs):
"""
Actually a factory function providing a unifying
interface for generating masked controls.
"""
if not kwargs.has_key('controlType'):
controlType = MASKEDTEXT
else:
controlType = kwargs['controlType']
del kwargs['controlType']
if controlType == MASKEDTEXT:
return wxMaskedTextCtrl(*args, **kwargs)
elif controlType == MASKEDCOMBO:
return wxMaskedComboBox(*args, **kwargs)
elif controlType == IPADDR:
return wxIpAddrCtrl(*args, **kwargs)
elif controlType == TIME:
return wxTimeCtrl(*args, **kwargs)
elif controlType == NUMBER:
return wxMaskedNumCtrl(*args, **kwargs)
else:
raise AttributeError(
"invalid controlType specified: %s" % repr(controlType))

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -342,7 +342,7 @@ class wxTimeCtrl(wxMaskedTextCtrl):
# require explicit field change, select entire field on entry,
# and require a resultant valid entry to allow character entry:
hourfield = Field(formatcodes='_0<rSV', validRegex='0[1-9]| [1-9]|1[012]', validRequired=True)
ampmfield = Field(formatcodes='S')
ampmfield = Field(formatcodes='S', emptyInvalid = True, validRequired = True)
# Field 1 is always a zero-padded right-insert minute field,
# similarly configured as above: