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:

View File

@@ -26,7 +26,8 @@ class EditorFrame(frame.Frame):
def __init__(self, parent=None, id=-1, title='PyAlaCarte',
pos=wx.DefaultPosition, size=(800, 600),
style=wx.DEFAULT_FRAME_STYLE, filename=None):
style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE,
filename=None):
"""Create EditorFrame instance."""
frame.Frame.__init__(self, parent, id, title, pos, size, style)
self.buffers = {}
@@ -142,6 +143,7 @@ class EditorFrame(frame.Frame):
self.bufferDestroy()
buffer = Buffer()
self.panel = panel = wx.Panel(parent=self, id=-1)
wx.EVT_ERASE_BACKGROUND(panel, lambda x: x)
editor = Editor(parent=panel)
panel.editor = editor
sizer = wx.BoxSizer(wx.VERTICAL)
@@ -153,6 +155,8 @@ class EditorFrame(frame.Frame):
buffer.open(filename)
self.setEditor(editor)
self.editor.setFocus()
self.SendSizeEvent()
def bufferDestroy(self):
"""Destroy the current buffer."""
@@ -164,6 +168,7 @@ class EditorFrame(frame.Frame):
self.buffer = None
self.panel.Destroy()
def bufferHasChanged(self):
"""Return True if buffer has changed since last save."""
if self.buffer:
@@ -256,7 +261,8 @@ class EditorNotebookFrame(EditorFrame):
def __init__(self, parent=None, id=-1, title='PyAlaMode',
pos=wx.DefaultPosition, size=(800, 600),
style=wx.DEFAULT_FRAME_STYLE, filename=None):
style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE,
filename=None):
"""Create EditorNotebookFrame instance."""
self.notebook = None
EditorFrame.__init__(self, parent, id, title, pos,
@@ -318,6 +324,7 @@ class EditorNotebookFrame(EditorFrame):
"""Create new buffer."""
buffer = Buffer()
panel = wx.Panel(parent=self.notebook, id=-1)
wx.EVT_ERASE_BACKGROUND(panel, lambda x: x)
editor = Editor(parent=panel)
panel.editor = editor
sizer = wx.BoxSizer(wx.VERTICAL)
@@ -364,7 +371,7 @@ class EditorNotebook(wx.Notebook):
def __init__(self, parent):
"""Create EditorNotebook instance."""
wx.Notebook.__init__(self, parent, id=-1)
wx.Notebook.__init__(self, parent, id=-1, style=wx.NO_FULL_REPAINT_ON_RESIZE)
wx.EVT_NOTEBOOK_PAGE_CHANGING(self, self.GetId(),
self.OnPageChanging)
wx.EVT_NOTEBOOK_PAGE_CHANGED(self, self.GetId(),

View File

@@ -300,17 +300,23 @@ class Frame(wx.Frame):
elif id == ID_OPEN:
event.Enable(hasattr(self, 'bufferOpen'))
elif id == ID_REVERT:
event.Enable(hasattr(self, 'bufferRevert') and self.hasBuffer())
event.Enable(hasattr(self, 'bufferRevert')
and self.hasBuffer())
elif id == ID_CLOSE:
event.Enable(hasattr(self, 'bufferClose') and self.hasBuffer())
event.Enable(hasattr(self, 'bufferClose')
and self.hasBuffer())
elif id == ID_SAVE:
event.Enable(hasattr(self, 'bufferSave') and self.bufferHasChanged())
event.Enable(hasattr(self, 'bufferSave')
and self.bufferHasChanged())
elif id == ID_SAVEAS:
event.Enable(hasattr(self, 'bufferSaveAs') and self.hasBuffer())
event.Enable(hasattr(self, 'bufferSaveAs')
and self.hasBuffer())
elif id == ID_NAMESPACE:
event.Enable(hasattr(self, 'updateNamespace') and self.hasBuffer())
event.Enable(hasattr(self, 'updateNamespace')
and self.hasBuffer())
elif id == ID_PRINT:
event.Enable(hasattr(self, 'bufferPrint') and self.hasBuffer())
event.Enable(hasattr(self, 'bufferPrint')
and self.hasBuffer())
elif id == ID_UNDO:
event.Enable(win.CanUndo())
elif id == ID_REDO:

View File

@@ -6,4 +6,4 @@ __author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
__cvsid__ = "$Id$"
__revision__ = "$Revision$"[11:-2]
VERSION = '0.9.2'
VERSION = '0.9.3'

View File

@@ -1,4 +1,4 @@
"""Decorator classes for documentation and shell scripting.
"""StyledTextCtrl decorator class module.
"""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"

View File

@@ -1,3 +1,11 @@
0.1.1-4
-------
Fixed problems with wxStaticBitmap (stock_id attribute, icon type
switching).
Changed some dimensions in properties panel elements.
0.1.1-3
-------

View File

@@ -4,19 +4,14 @@
********************************************************************************
Installation on UNIX
--------------------
System requirements
-------------------
XRCed requires wxGTK and wxPython greater or equal to 2.3.3, and Python 2.2
(it may work with earlier version, but was not tested).
XRCed requires wxWindows and wxPython greater or equal to 2.3.3, and
Python 2.2 or newer (it may work with earlier version, but was not tested).
Of course wxGTK's XRC library (libwxxrc) and it's python module must
be installed.
wxPython must be compiled with XRC support.
Installation on Windows
-----------------------
Works with wxPython 2.3.2 for Python 2.2.
Short manual
------------
@@ -70,4 +65,4 @@ refresh button).
--------------------------------------------------------------------------------
Copyright 2001 Roman Rolinsky <rolinsky@mema.ucl.ac.be>
Copyright 2001-2003 Roman Rolinsky <rollrom@xrced.sourceforge.net>

View File

@@ -15,7 +15,7 @@ modernFont = wxFont(sysFont.GetPointSize(), wxMODERN, wxNORMAL, wxNORMAL)
smallerFont = wxFont(sysFont.GetPointSize()-2, wxDEFAULT, wxNORMAL, wxNORMAL)
progname = 'XRCed'
version = '0.1.1-3'
version = '0.1.1-4'
try:
True

View File

@@ -20,8 +20,11 @@ class Panel(wxNotebook):
self.modified = False
# Set common button size for parameter buttons
bTmp = wxButton(self, -1, '')
import params
params.buttonSize = self.DLG_SZE(buttonSize)
params.buttonSize = (self.DLG_SZE(buttonSize)[0], bTmp.GetSize()[1])
bTmp.Destroy()
del bTmp
# List of child windows
self.pages = []

View File

@@ -16,7 +16,7 @@ genericStyles = ['wxSIMPLE_BORDER', 'wxDOUBLE_BORDER',
'wxTRANSPARENT_WINDOW', 'wxWANTS_CHARS',
'wxNO_FULL_REPAINT_ON_RESIZE']
buttonSize = (30,-1) # in dialog units, transformed to pixels in panel ctor
buttonSize = (35,-1) # in dialog units, transformed to pixels in panel ctor
# Class that can properly disable children
class PPanel(wxPanel):
@@ -274,8 +274,8 @@ class ParamFont(PPanel):
fontStylesWx2Xml.get(font.GetStyle(), "normal"),
fontWeightsWx2Xml.get(font.GetWeight(), "normal"),
str(font.GetUnderlined()),
font.GetFaceName(),
wxFontMapper_GetEncodingName(font.GetEncoding())
font.GetFaceName().encode(),
wxFontMapper_GetEncodingName(font.GetEncoding()).encode()
]
# Add ignored flags
self.SetValue(value)
@@ -694,8 +694,8 @@ class RadioBox(PPanel):
self.choices = choices
topSizer = wxBoxSizer()
for i in choices:
button = wxRadioButton(self, -1, i, name=i)
topSizer.Add(button)
button = wxRadioButton(self, -1, i, size=(-1,buttonSize[1]), name=i)
topSizer.Add(button, 0, wxRIGHT, 5)
EVT_RADIOBUTTON(self, button.GetId(), self.OnRadioChoice)
self.SetAutoLayout(True)
self.SetSizer(topSizer)
@@ -815,10 +815,12 @@ class ParamBitmap(PPanel):
def updateRadios(self):
if self.value[0]:
self.radio_std.SetValue(True)
self.radio_file.SetValue(False)
self.text.Enable(False)
self.button.Enable(False)
self.combo.Enable(True)
else:
self.radio_std.SetValue(False)
self.radio_file.SetValue(True)
self.text.Enable(True)
self.button.Enable(True)

View File

@@ -298,6 +298,7 @@
<object class="wxRadioButton" name="RADIO_STD">
<label>art:</label>
</object>
<flag>wxALIGN_CENTRE_VERTICAL</flag>
</object>
<object class="sizeritem">
<object class="wxComboBox" name="COMBO_STD">
@@ -342,6 +343,7 @@
<object class="wxRadioButton" name="RADIO_FILE">
<label>file:</label>
</object>
<flag>wxALIGN_CENTRE_VERTICAL</flag>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
@@ -355,7 +357,7 @@
<object class="sizeritem">
<object class="wxButton" name="BUTTON_BROWSE">
<label>Browse...</label>
<size>30,-1d</size>
<size>40,-1d</size>
</object>
</object>
</object>

View File

@@ -169,7 +169,7 @@ class xxxParamBitmap(xxxParam):
self.stock_id = value[0]
if self.stock_id:
self.node.setAttribute('stock_id', self.stock_id)
else:
elif self.node.hasAttribute('stock_id'):
self.node.removeAttribute('stock_id')
xxxParam.update(self, value[1])