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)
# Enable Column moving
#>> TODO - renamer didn't get this one
gridmovers.wxGridColMover(self)
#>> TODO - Bind() not working here
gridmovers.EVT_GRID_COL_MOVE(self,self.GetId(),self.OnColMove)
gridmovers.GridColMover(self)
self.Bind(gridmovers.EVT_GRID_COL_MOVE, self.OnColMove, self)
# Enable Row moving
#>> TODO - renamer didn't get this one
gridmovers.wxGridRowMover(self)
#>> TODO - Bind() not working here
gridmovers.EVT_GRID_ROW_MOVE(self,self.GetId(),self.OnRowMove)
gridmovers.GridRowMover(self)
self.Bind(gridmovers.EVT_GRID_ROW_MOVE, self.OnRowMove, self)
# Event method called when a column move needs to take place
def OnColMove(self,evt):

View File

@ -9,9 +9,13 @@
# o Issues - library has to be converted to work properly
# with new namespace.
#
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxFloatBar -> FloatBar
#
import wx
import wx.lib.floatbar as float
import wx.lib.floatbar
import images
@ -31,7 +35,7 @@ class TestFloatBar(wx.Frame):
"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)
tb.SetFloatable(1)
tb.SetTitle("Floating!")
@ -73,7 +77,7 @@ class TestFloatBar(wx.Frame):
self.log.WriteText("tool %s clicked\n" % event.GetId())
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():
self.tb.SetTitle("")
@ -93,7 +97,7 @@ def runTest(frame, nb, log):
#---------------------------------------------------------------------------
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.
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.
#
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxScrolledMessageDialog -> ScrolledMessageDialog
#
import os
import sys
@ -182,11 +186,11 @@ class TestHtmlPanel(wx.Panel):
def OnViewSource(self, event):
import wx.lib.dialogs as dlgs
import wx.lib.dialogs
source = self.html.GetParser().GetSource()
dlg = dlgs.wxScrolledMessageDialog(self, source, 'HTML Source')
dlg = wx.lib.dialogs.ScrolledMessageDialog(self, source, 'HTML Source')
dlg.ShowModal()
dlg.Destroy()

View File

@ -6,9 +6,13 @@
#
# o wx renamer not applied to lib.
#
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxMultipleChoiceDialog -> MultipleChoiceDialog
#
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',
'etc', 'etc..', 'etc...' ]
dlg = dlgs.wxMultipleChoiceDialog(frame,
"Pick some from\n this list\nblah blah...",
"m.s.d.", lst)
dlg = wx.lib.dialogs.MultipleChoiceDialog(
frame,
"Pick some from\n this list\nblah blah...",
"m.s.d.", lst)
if (dlg.ShowModal() == wx.ID_OK):
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
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)
</code>
@ -74,7 +79,7 @@ available.
</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.
</body>

View File

@ -10,9 +10,13 @@
#
# o dialogs library converted. All is well.
#
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxScrolledMessageDialog -> ScrolledMessageDialog
#
import wx
import wx.lib.dialogs as dlgs
import wx.lib.dialogs
#---------------------------------------------------------------------------
@ -21,7 +25,7 @@ def runTest(frame, nb, log):
msg = f.read()
f.close()
dlg = dlgs.wxScrolledMessageDialog(frame, msg, "message test")
dlg = wx.lib.dialogs.ScrolledMessageDialog(frame, msg, "message test")
dlg.ShowModal()
#---------------------------------------------------------------------------
@ -30,7 +34,7 @@ def runTest(frame, nb, log):
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
message. This allows more flexible information display without having to be

View File

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

View File

@ -14,6 +14,10 @@
#
# 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
@ -42,7 +46,7 @@ if wx.Platform == '__WXGTK__':
#
# 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,
pos = wx.DefaultPosition,
size = wx.DefaultSize,
@ -68,7 +72,7 @@ if wx.Platform == '__WXGTK__':
else:
_DOCKTHRESHOLD = 25
class wxFloatBar(wx.ToolBar):
class FloatBar(wx.ToolBar):
"""
wxToolBar subclass which can be dragged off its frame and later
replaced there. Drag on the toolbar to release it, close it like

View File

@ -13,6 +13,14 @@
#
# 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.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):
wx.PyCommandEvent.__init__(self, id = id)
self.SetEventType(wxEVT_COMMAND_GRID_COL_MOVE)
@ -45,7 +53,7 @@ class wxGridColMoveEvent(wx.PyCommandEvent):
return self.beforeColumn
class wxGridRowMoveEvent(wx.PyCommandEvent):
class GridRowMoveEvent(wx.PyCommandEvent):
def __init__(self, id, dRow, bRow):
wx.PyCommandEvent.__init__(self,id = id)
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):
wx.EvtHandler.__init__(self)
@ -328,7 +336,7 @@ class wxGridColMover(wx.EvtHandler):
bCol = self.colWin.GetInsertionColumn()
dCol = self.colWin.GetMoveColumn()
wx.PostEvent(self,
wxGridColMoveEvent(self.grid.GetId(), dCol, bCol))
GridColMoveEvent(self.grid.GetId(), dCol, bCol))
self.colWin.Destroy()
evt.Skip()
@ -343,7 +351,7 @@ class wxGridColMover(wx.EvtHandler):
return bmp
class wxGridRowMover(wx.EvtHandler):
class GridRowMover(wx.EvtHandler):
def __init__(self,grid):
wx.EvtHandler.__init__(self)
@ -451,7 +459,7 @@ class wxGridRowMover(wx.EvtHandler):
dRow = self.rowWin.GetMoveRow()
wx.PostEvent(self,
wxGridRowMoveEvent(self.grid.GetId(), dRow, bRow))
GridRowMoveEvent(self.grid.GetId(), dRow, bRow))
self.rowWin.Destroy()
evt.Skip()

View File

@ -2,6 +2,10 @@
#
# o Updated for wx namespace
#
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxScrolledMessageDialog -> ScrolledMessageDialog
#
import re
import wx
@ -240,7 +244,7 @@ if __name__=='__main__':
def OnAbout(self, event):
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.Destroy()

View File

@ -16,6 +16,10 @@
# 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.
#
# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o wxScrolledMessageDialog -> ScrolledMessageDialog
#
"""
This is a simple light weight plotting module that can be used with
@ -1455,8 +1459,8 @@ class TestFrame(wx.Frame):
self.client.Reset()
def OnHelpAbout(self, event):
from wx.lib.dialogs import wxScrolledMessageDialog
about = wxScrolledMessageDialog(self, __doc__, "About...")
from wx.lib.dialogs import ScrolledMessageDialog
about = ScrolledMessageDialog(self, __doc__, "About...")
about.ShowModal()
def resetDefaults(self):

View File

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

View File

@ -6,4 +6,4 @@ import wx.lib.floatbar
__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
_ColToRect = wx.lib.gridmovers._ColToRect
_RowToRect = wx.lib.gridmovers._RowToRect
wxGridColMoveEvent = wx.lib.gridmovers.wxGridColMoveEvent
wxGridColMover = wx.lib.gridmovers.wxGridColMover
wxGridRowMoveEvent = wx.lib.gridmovers.wxGridRowMoveEvent
wxGridRowMover = wx.lib.gridmovers.wxGridRowMover
wxGridColMoveEvent = wx.lib.gridmovers.GridColMoveEvent
wxGridColMover = wx.lib.gridmovers.GridColMover
wxGridRowMoveEvent = wx.lib.gridmovers.GridRowMoveEvent
wxGridRowMover = wx.lib.gridmovers.GridRowMover