More lib and demo changes for dropping the wx prefix, from Jeff G.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-12-20 19:36:30 +00:00
parent 2b0a7c092c
commit 33785d9f22
13 changed files with 83 additions and 45 deletions

View File

@@ -176,16 +176,12 @@ class DragableGrid(gridlib.Grid):
self.SetTable(table, True) self.SetTable(table, True)
# Enable Column moving # Enable Column moving
#>> TODO - renamer didn't get this one gridmovers.GridColMover(self)
gridmovers.wxGridColMover(self) self.Bind(gridmovers.EVT_GRID_COL_MOVE, self.OnColMove, self)
#>> TODO - Bind() not working here
gridmovers.EVT_GRID_COL_MOVE(self,self.GetId(),self.OnColMove)
# Enable Row moving # Enable Row moving
#>> TODO - renamer didn't get this one gridmovers.GridRowMover(self)
gridmovers.wxGridRowMover(self) self.Bind(gridmovers.EVT_GRID_ROW_MOVE, self.OnRowMove, self)
#>> TODO - Bind() not working here
gridmovers.EVT_GRID_ROW_MOVE(self,self.GetId(),self.OnRowMove)
# Event method called when a column move needs to take place # Event method called when a column move needs to take place
def OnColMove(self,evt): def OnColMove(self,evt):

View File

@@ -9,9 +9,13 @@
# o Issues - library has to be converted to work properly # o Issues - library has to be converted to work properly
# with new namespace. # with new namespace.
# #
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxFloatBar -> FloatBar
#
import wx import wx
import wx.lib.floatbar as float import wx.lib.floatbar
import images import images
@@ -31,7 +35,7 @@ class TestFloatBar(wx.Frame):
"Toggle the last tool to remove\nthe title.", (15,15) "Toggle the last tool to remove\nthe title.", (15,15)
) )
tb = float.wxFloatBar(self, -1) tb = wx.lib.floatbar.FloatBar(self, -1)
self.SetToolBar(tb) self.SetToolBar(tb)
tb.SetFloatable(1) tb.SetFloatable(1)
tb.SetTitle("Floating!") tb.SetTitle("Floating!")
@@ -73,7 +77,7 @@ class TestFloatBar(wx.Frame):
self.log.WriteText("tool %s clicked\n" % event.GetId()) self.log.WriteText("tool %s clicked\n" % event.GetId())
if event.GetId() == 60: if event.GetId() == 60:
print event.GetExtraLong(), event.Checked(), event.GetInt(), self.tb.GetToolState(60) print event.GetExtraLong(), event.IsChecked(), event.GetInt(), self.tb.GetToolState(60)
if event.GetExtraLong(): if event.GetExtraLong():
self.tb.SetTitle("") self.tb.SetTitle("")
@@ -93,7 +97,7 @@ def runTest(frame, nb, log):
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
overview = """\ overview = """\
wxFloatBar is a subclass of wxToolBar, implemented in Python, which FloatBar is a subclass of wx.ToolBar, implemented in Python, which
can be detached from its frame. can be detached from its frame.
Drag the toolbar with the mouse to make it float, and drag it back, or Drag the toolbar with the mouse to make it float, and drag it back, or

View File

@@ -6,6 +6,10 @@
# #
# o got the wxpTag stuff working right. # o got the wxpTag stuff working right.
# #
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxScrolledMessageDialog -> ScrolledMessageDialog
#
import os import os
import sys import sys
@@ -182,11 +186,11 @@ class TestHtmlPanel(wx.Panel):
def OnViewSource(self, event): def OnViewSource(self, event):
import wx.lib.dialogs as dlgs import wx.lib.dialogs
source = self.html.GetParser().GetSource() source = self.html.GetParser().GetSource()
dlg = dlgs.wxScrolledMessageDialog(self, source, 'HTML Source') dlg = wx.lib.dialogs.ScrolledMessageDialog(self, source, 'HTML Source')
dlg.ShowModal() dlg.ShowModal()
dlg.Destroy() dlg.Destroy()

View File

@@ -6,9 +6,13 @@
# #
# o wx renamer not applied to lib. # o wx renamer not applied to lib.
# #
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxMultipleChoiceDialog -> MultipleChoiceDialog
#
import wx import wx
import wx.lib.dialogs as dlgs import wx.lib.dialogs
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -16,9 +20,10 @@ def runTest(frame, nb, log):
lst = [ 'apple', 'pear', 'banana', 'coconut', 'orange', lst = [ 'apple', 'pear', 'banana', 'coconut', 'orange',
'etc', 'etc..', 'etc...' ] 'etc', 'etc..', 'etc...' ]
dlg = dlgs.wxMultipleChoiceDialog(frame, dlg = wx.lib.dialogs.MultipleChoiceDialog(
"Pick some from\n this list\nblah blah...", frame,
"m.s.d.", lst) "Pick some from\n this list\nblah blah...",
"m.s.d.", lst)
if (dlg.ShowModal() == wx.ID_OK): if (dlg.ShowModal() == wx.ID_OK):
print "Selection:", dlg.GetValue(), " -> ", dlg.GetValueString() print "Selection:", dlg.GetValue(), " -> ", dlg.GetValueString()
@@ -34,7 +39,7 @@ overview = """\
This is a Python implementation of a dialog that is not yet implemented in wxWindows This is a Python implementation of a dialog that is not yet implemented in wxWindows
proper, so don't let the wxWindows documentation mislead you. proper, so don't let the wxWindows documentation mislead you.
<p><code><b>wxMultipleChoiceDialog</b>(self, parent, msg, title, lst, <p><code><b>MultipleChoiceDialog</b>(self, parent, msg, title, lst,
pos = wx.wxDefaultPosition, size = (200,200), style = wx.wxDEFAULT_DIALOG_STYLE) pos = wx.wxDefaultPosition, size = (200,200), style = wx.wxDEFAULT_DIALOG_STYLE)
</code> </code>
@@ -74,7 +79,7 @@ available.
</dl> </dl>
Additionally, wxMultipleChoiceDialog.lbox is a standard wxListBox which supports all Additionally, MultipleChoiceDialog.lbox is a standard wx.ListBox which supports all
methods applicable to that class. methods applicable to that class.
</body> </body>

View File

@@ -10,9 +10,13 @@
# #
# o dialogs library converted. All is well. # o dialogs library converted. All is well.
# #
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxScrolledMessageDialog -> ScrolledMessageDialog
#
import wx import wx
import wx.lib.dialogs as dlgs import wx.lib.dialogs
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -21,7 +25,7 @@ def runTest(frame, nb, log):
msg = f.read() msg = f.read()
f.close() f.close()
dlg = dlgs.wxScrolledMessageDialog(frame, msg, "message test") dlg = wx.lib.dialogs.ScrolledMessageDialog(frame, msg, "message test")
dlg.ShowModal() dlg.ShowModal()
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -30,7 +34,7 @@ def runTest(frame, nb, log):
overview = """\ overview = """\
<code><b>wxScrolledMessageDialog</b>(parent, msg, caption, pos=wx.DefaultPosition, size=(500,300))</code> <code><b>ScrolledMessageDialog</b>(parent, msg, caption, pos=wx.DefaultPosition, size=(500,300))</code>
This class represents a message dialog that uses a wxTextCtrl to display the This class represents a message dialog that uses a wxTextCtrl to display the
message. This allows more flexible information display without having to be message. This allows more flexible information display without having to be

View File

@@ -14,13 +14,18 @@
# #
# o Updated for 2.5 compatability. # o Updated for 2.5 compatability.
# #
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxScrolledMessageDialog -> ScrolledMessageDialog
# o wxMultipleChoiceDialog -> MultipleChoiceDialog
#
import wx import wx
import layoutf import layoutf
#---------------------------------------------------------------------- #----------------------------------------------------------------------
class wxScrolledMessageDialog(wx.Dialog): class ScrolledMessageDialog(wx.Dialog):
def __init__(self, parent, msg, caption, pos = wx.DefaultPosition, def __init__(self, parent, msg, caption, pos = wx.DefaultPosition,
size = (500,300)): size = (500,300)):
wx.Dialog.__init__(self, parent, -1, caption, pos, size) wx.Dialog.__init__(self, parent, -1, caption, pos, size)
@@ -41,7 +46,7 @@ class wxScrolledMessageDialog(wx.Dialog):
self.Layout() self.Layout()
class wxMultipleChoiceDialog(wx.Dialog): class MultipleChoiceDialog(wx.Dialog):
def __init__(self, parent, msg, title, lst, pos = wx.DefaultPosition, def __init__(self, parent, msg, title, lst, pos = wx.DefaultPosition,
size = (200,200), style = wx.DEFAULT_DIALOG_STYLE): size = (200,200), style = wx.DEFAULT_DIALOG_STYLE):
wx.Dialog.__init__(self, parent, -1, title, pos, size, style) wx.Dialog.__init__(self, parent, -1, title, pos, size, style)
@@ -263,7 +268,7 @@ def alertDialog(parent=None, message='', title='Alert', pos=wx.DefaultPosition):
def scrolledMessageDialog(parent=None, message='', title='', pos=wx.DefaultPosition, def scrolledMessageDialog(parent=None, message='', title='', pos=wx.DefaultPosition,
size=(500,300)): size=(500,300)):
dialog = wxScrolledMessageDialog(parent, message, title, pos, size) dialog = ScrolledMessageDialog(parent, message, title, pos, size)
result = DialogResults(dialog.ShowModal()) result = DialogResults(dialog.ShowModal())
dialog.Destroy() dialog.Destroy()
return result return result
@@ -324,7 +329,7 @@ def singleChoiceDialog(parent=None, message='', title='', lst=[],
def multipleChoiceDialog(parent=None, message='', title='', lst=[], pos=wx.DefaultPosition, def multipleChoiceDialog(parent=None, message='', title='', lst=[], pos=wx.DefaultPosition,
size=(200,200)): size=(200,200)):
dialog = wxMultipleChoiceDialog(parent, message, title, lst, pos, size) dialog = MultipleChoiceDialog(parent, message, title, lst, pos, size)
result = DialogResults(dialog.ShowModal()) result = DialogResults(dialog.ShowModal())
result.selection = dialog.GetValueString() result.selection = dialog.GetValueString()
dialog.Destroy() dialog.Destroy()

View File

@@ -14,6 +14,10 @@
# #
# o Added deprecation warning. # o Added deprecation warning.
# #
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxFloatBar -> FloatBar
#
""" """
NOTE: This module is *not* supported in any way. Use it however you NOTE: This module is *not* supported in any way. Use it however you
@@ -42,7 +46,7 @@ if wx.Platform == '__WXGTK__':
# #
# For wxGTK all we have to do is set the wxTB_DOCKABLE flag # For wxGTK all we have to do is set the wxTB_DOCKABLE flag
# #
class wxFloatBar(wx.ToolBar): class FloatBar(wx.ToolBar):
def __init__(self, parent, ID, def __init__(self, parent, ID,
pos = wx.DefaultPosition, pos = wx.DefaultPosition,
size = wx.DefaultSize, size = wx.DefaultSize,
@@ -68,7 +72,7 @@ if wx.Platform == '__WXGTK__':
else: else:
_DOCKTHRESHOLD = 25 _DOCKTHRESHOLD = 25
class wxFloatBar(wx.ToolBar): class FloatBar(wx.ToolBar):
""" """
wxToolBar subclass which can be dragged off its frame and later wxToolBar subclass which can be dragged off its frame and later
replaced there. Drag on the toolbar to release it, close it like replaced there. Drag on the toolbar to release it, close it like

View File

@@ -13,6 +13,14 @@
# #
# o 2.5 Compatability changes # o 2.5 Compatability changes
# #
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxGridColMoveEvent -> GridColMoveEvent
# o wxGridRowMoveEvent -> GridRowMoveEvent
# o wxGridColMover -> GridColMover
# o wxGridRowMover -> GridRowMover
#
import wx import wx
import wx.grid import wx.grid
@@ -31,7 +39,7 @@ EVT_GRID_ROW_MOVE = wx.PyEventBinder(wxEVT_COMMAND_GRID_ROW_MOVE, 1)
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
class wxGridColMoveEvent(wx.PyCommandEvent): class GridColMoveEvent(wx.PyCommandEvent):
def __init__(self, id, dCol, bCol): def __init__(self, id, dCol, bCol):
wx.PyCommandEvent.__init__(self, id = id) wx.PyCommandEvent.__init__(self, id = id)
self.SetEventType(wxEVT_COMMAND_GRID_COL_MOVE) self.SetEventType(wxEVT_COMMAND_GRID_COL_MOVE)
@@ -45,7 +53,7 @@ class wxGridColMoveEvent(wx.PyCommandEvent):
return self.beforeColumn return self.beforeColumn
class wxGridRowMoveEvent(wx.PyCommandEvent): class GridRowMoveEvent(wx.PyCommandEvent):
def __init__(self, id, dRow, bRow): def __init__(self, id, dRow, bRow):
wx.PyCommandEvent.__init__(self,id = id) wx.PyCommandEvent.__init__(self,id = id)
self.SetEventType(wxEVT_COMMAND_GRID_ROW_MOVE) self.SetEventType(wxEVT_COMMAND_GRID_ROW_MOVE)
@@ -223,7 +231,7 @@ class RowDragWindow(wx.Window):
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
class wxGridColMover(wx.EvtHandler): class GridColMover(wx.EvtHandler):
def __init__(self,grid): def __init__(self,grid):
wx.EvtHandler.__init__(self) wx.EvtHandler.__init__(self)
@@ -328,7 +336,7 @@ class wxGridColMover(wx.EvtHandler):
bCol = self.colWin.GetInsertionColumn() bCol = self.colWin.GetInsertionColumn()
dCol = self.colWin.GetMoveColumn() dCol = self.colWin.GetMoveColumn()
wx.PostEvent(self, wx.PostEvent(self,
wxGridColMoveEvent(self.grid.GetId(), dCol, bCol)) GridColMoveEvent(self.grid.GetId(), dCol, bCol))
self.colWin.Destroy() self.colWin.Destroy()
evt.Skip() evt.Skip()
@@ -343,7 +351,7 @@ class wxGridColMover(wx.EvtHandler):
return bmp return bmp
class wxGridRowMover(wx.EvtHandler): class GridRowMover(wx.EvtHandler):
def __init__(self,grid): def __init__(self,grid):
wx.EvtHandler.__init__(self) wx.EvtHandler.__init__(self)
@@ -451,7 +459,7 @@ class wxGridRowMover(wx.EvtHandler):
dRow = self.rowWin.GetMoveRow() dRow = self.rowWin.GetMoveRow()
wx.PostEvent(self, wx.PostEvent(self,
wxGridRowMoveEvent(self.grid.GetId(), dRow, bRow)) GridRowMoveEvent(self.grid.GetId(), dRow, bRow))
self.rowWin.Destroy() self.rowWin.Destroy()
evt.Skip() evt.Skip()

View File

@@ -2,6 +2,10 @@
# #
# o Updated for wx namespace # o Updated for wx namespace
# #
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxScrolledMessageDialog -> ScrolledMessageDialog
#
import re import re
import wx import wx
@@ -240,7 +244,7 @@ if __name__=='__main__':
def OnAbout(self, event): def OnAbout(self, event):
import wx.lib.dialogs import wx.lib.dialogs
msg = wx.lib.dialogs.wxScrolledMessageDialog(self, Layoutf.__doc__, "about") msg = wx.lib.dialogs.ScrolledMessageDialog(self, Layoutf.__doc__, "about")
msg.ShowModal() msg.ShowModal()
msg.Destroy() msg.Destroy()

View File

@@ -16,6 +16,10 @@
# o Reworked test frame to work with wx demo framework. This saves a bit # o Reworked test frame to work with wx demo framework. This saves a bit
# of tedious cut and paste, and the test app is excellent. # of tedious cut and paste, and the test app is excellent.
# #
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxScrolledMessageDialog -> ScrolledMessageDialog
#
""" """
This is a simple light weight plotting module that can be used with This is a simple light weight plotting module that can be used with
@@ -1455,8 +1459,8 @@ class TestFrame(wx.Frame):
self.client.Reset() self.client.Reset()
def OnHelpAbout(self, event): def OnHelpAbout(self, event):
from wx.lib.dialogs import wxScrolledMessageDialog from wx.lib.dialogs import ScrolledMessageDialog
about = wxScrolledMessageDialog(self, __doc__, "About...") about = ScrolledMessageDialog(self, __doc__, "About...")
about.ShowModal() about.ShowModal()
def resetDefaults(self): def resetDefaults(self):

View File

@@ -23,5 +23,5 @@ saveFileDialog = wx.lib.dialogs.saveFileDialog
scrolledMessageDialog = wx.lib.dialogs.scrolledMessageDialog scrolledMessageDialog = wx.lib.dialogs.scrolledMessageDialog
singleChoiceDialog = wx.lib.dialogs.singleChoiceDialog singleChoiceDialog = wx.lib.dialogs.singleChoiceDialog
textEntryDialog = wx.lib.dialogs.textEntryDialog textEntryDialog = wx.lib.dialogs.textEntryDialog
wxMultipleChoiceDialog = wx.lib.dialogs.wxMultipleChoiceDialog wxMultipleChoiceDialog = wx.lib.dialogs.MultipleChoiceDialog
wxScrolledMessageDialog = wx.lib.dialogs.wxScrolledMessageDialog wxScrolledMessageDialog = wx.lib.dialogs.ScrolledMessageDialog

View File

@@ -6,4 +6,4 @@ import wx.lib.floatbar
__doc__ = wx.lib.floatbar.__doc__ __doc__ = wx.lib.floatbar.__doc__
wxFloatBar = wx.lib.floatbar.wxFloatBar wxFloatBar = wx.lib.floatbar.FloatBar

View File

@@ -12,7 +12,7 @@ EVT_GRID_ROW_MOVE = wx.lib.gridmovers.EVT_GRID_ROW_MOVE
RowDragWindow = wx.lib.gridmovers.RowDragWindow RowDragWindow = wx.lib.gridmovers.RowDragWindow
_ColToRect = wx.lib.gridmovers._ColToRect _ColToRect = wx.lib.gridmovers._ColToRect
_RowToRect = wx.lib.gridmovers._RowToRect _RowToRect = wx.lib.gridmovers._RowToRect
wxGridColMoveEvent = wx.lib.gridmovers.wxGridColMoveEvent wxGridColMoveEvent = wx.lib.gridmovers.GridColMoveEvent
wxGridColMover = wx.lib.gridmovers.wxGridColMover wxGridColMover = wx.lib.gridmovers.GridColMover
wxGridRowMoveEvent = wx.lib.gridmovers.wxGridRowMoveEvent wxGridRowMoveEvent = wx.lib.gridmovers.GridRowMoveEvent
wxGridRowMover = wx.lib.gridmovers.wxGridRowMover wxGridRowMover = wx.lib.gridmovers.GridRowMover