Final tweaks for 2.1b1
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2915 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -154,6 +154,7 @@ class wxPythonDemo(wxFrame):
|
|||||||
numLines = h/self.charHeight
|
numLines = h/self.charHeight
|
||||||
x, y = self.log.PositionToXY(self.log.GetLastPosition())
|
x, y = self.log.PositionToXY(self.log.GetLastPosition())
|
||||||
self.log.ShowPosition(self.log.XYToPosition(x, y-numLines+1))
|
self.log.ShowPosition(self.log.XYToPosition(x, y-numLines+1))
|
||||||
|
self.log.SetInsertionPointEnd()
|
||||||
|
|
||||||
def write(self, txt):
|
def write(self, txt):
|
||||||
self.WriteText(txt)
|
self.WriteText(txt)
|
||||||
|
@@ -49,13 +49,19 @@ class TestListCtrlPanel(wxPanel):
|
|||||||
self.currentItem = 0
|
self.currentItem = 0
|
||||||
EVT_LIST_ITEM_SELECTED(self, tID, self.OnItemSelected)
|
EVT_LIST_ITEM_SELECTED(self, tID, self.OnItemSelected)
|
||||||
EVT_LEFT_DCLICK(self.list, self.OnDoubleClick)
|
EVT_LEFT_DCLICK(self.list, self.OnDoubleClick)
|
||||||
EVT_COMMAND_RIGHT_CLICK(self.list, tID, self.OnRightClick)
|
|
||||||
EVT_RIGHT_DOWN(self.list, self.OnRightDown)
|
EVT_RIGHT_DOWN(self.list, self.OnRightDown)
|
||||||
|
|
||||||
|
# for wxMSW
|
||||||
|
EVT_COMMAND_RIGHT_CLICK(self.list, tID, self.OnRightClick)
|
||||||
|
|
||||||
|
# for wxGTK
|
||||||
|
EVT_RIGHT_UP(self.list, self.OnRightClick)
|
||||||
|
|
||||||
|
|
||||||
def OnRightDown(self, event):
|
def OnRightDown(self, event):
|
||||||
self.x = event.GetX()
|
self.x = event.GetX()
|
||||||
self.log.WriteText("x = %d\n" % self.x)
|
self.y = event.GetY()
|
||||||
|
self.log.WriteText("x, y = %s\n" % str((self.x, self.y)))
|
||||||
event.Skip()
|
event.Skip()
|
||||||
|
|
||||||
def OnItemSelected(self, event):
|
def OnItemSelected(self, event):
|
||||||
@@ -68,18 +74,17 @@ class TestListCtrlPanel(wxPanel):
|
|||||||
|
|
||||||
def OnRightClick(self, event):
|
def OnRightClick(self, event):
|
||||||
self.log.WriteText("OnRightClick %s\n" % self.list.GetItemText(self.currentItem))
|
self.log.WriteText("OnRightClick %s\n" % self.list.GetItemText(self.currentItem))
|
||||||
menu = wxPyMenu()
|
self.menu = wxMenu()
|
||||||
tPopupID1 = 0
|
tPopupID1 = 0
|
||||||
tPopupID2 = 1
|
tPopupID2 = 1
|
||||||
tPopupID3 = 2
|
tPopupID3 = 2
|
||||||
menu.Append(tPopupID1, "One")
|
self.menu.Append(tPopupID1, "One")
|
||||||
menu.Append(tPopupID2, "Two")
|
self.menu.Append(tPopupID2, "Two")
|
||||||
menu.Append(tPopupID3, "Three")
|
self.menu.Append(tPopupID3, "Three")
|
||||||
EVT_MENU(self, tPopupID1, self.OnPopupOne)
|
EVT_MENU(self, tPopupID1, self.OnPopupOne)
|
||||||
EVT_MENU(self, tPopupID2, self.OnPopupTwo)
|
EVT_MENU(self, tPopupID2, self.OnPopupTwo)
|
||||||
EVT_MENU(self, tPopupID3, self.OnPopupThree)
|
EVT_MENU(self, tPopupID3, self.OnPopupThree)
|
||||||
pos = self.list.GetItemPosition(self.currentItem)
|
self.PopupMenu(self.menu, self.x, self.y)
|
||||||
self.PopupMenu(menu, self.x, pos.y)
|
|
||||||
|
|
||||||
def OnPopupOne(self, event):
|
def OnPopupOne(self, event):
|
||||||
self.log.WriteText("Popup one\n")
|
self.log.WriteText("Popup one\n")
|
||||||
|
@@ -33,8 +33,8 @@
|
|||||||
* and things like that.
|
* and things like that.
|
||||||
*
|
*
|
||||||
* $Log$
|
* $Log$
|
||||||
* Revision 1.13 1999/06/22 17:45:34 RD
|
* Revision 1.14 1999/06/28 04:08:58 RD
|
||||||
* wxPython 2.1b1: Very minor changes needed for wxGTK
|
* Final tweaks for 2.1b1
|
||||||
*
|
*
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
@@ -1497,6 +1497,9 @@ SWIGEXPORT(void,initwxc)() {
|
|||||||
PyDict_SetItemString(d,"wxPD_AUTO_HIDE", PyInt_FromLong((long) wxPD_AUTO_HIDE));
|
PyDict_SetItemString(d,"wxPD_AUTO_HIDE", PyInt_FromLong((long) wxPD_AUTO_HIDE));
|
||||||
PyDict_SetItemString(d,"wxPD_APP_MODAL", PyInt_FromLong((long) wxPD_APP_MODAL));
|
PyDict_SetItemString(d,"wxPD_APP_MODAL", PyInt_FromLong((long) wxPD_APP_MODAL));
|
||||||
PyDict_SetItemString(d,"wxPD_CAN_ABORT", PyInt_FromLong((long) wxPD_CAN_ABORT));
|
PyDict_SetItemString(d,"wxPD_CAN_ABORT", PyInt_FromLong((long) wxPD_CAN_ABORT));
|
||||||
|
PyDict_SetItemString(d,"wxPD_ELAPSED_TIME", PyInt_FromLong((long) wxPD_ELAPSED_TIME));
|
||||||
|
PyDict_SetItemString(d,"wxPD_ESTIMATED_TIME", PyInt_FromLong((long) wxPD_ESTIMATED_TIME));
|
||||||
|
PyDict_SetItemString(d,"wxPD_REMAINING_TIME", PyInt_FromLong((long) wxPD_REMAINING_TIME));
|
||||||
PyDict_SetItemString(d,"wxNO_DEFAULT", PyInt_FromLong((long) wxNO_DEFAULT));
|
PyDict_SetItemString(d,"wxNO_DEFAULT", PyInt_FromLong((long) wxNO_DEFAULT));
|
||||||
PyDict_SetItemString(d,"wxDEFAULT", PyInt_FromLong((long) wxDEFAULT));
|
PyDict_SetItemString(d,"wxDEFAULT", PyInt_FromLong((long) wxDEFAULT));
|
||||||
PyDict_SetItemString(d,"wxDECORATIVE", PyInt_FromLong((long) wxDECORATIVE));
|
PyDict_SetItemString(d,"wxDECORATIVE", PyInt_FromLong((long) wxDECORATIVE));
|
||||||
|
@@ -333,6 +333,9 @@ wxACCEL_SHIFT = wxc.wxACCEL_SHIFT
|
|||||||
wxPD_AUTO_HIDE = wxc.wxPD_AUTO_HIDE
|
wxPD_AUTO_HIDE = wxc.wxPD_AUTO_HIDE
|
||||||
wxPD_APP_MODAL = wxc.wxPD_APP_MODAL
|
wxPD_APP_MODAL = wxc.wxPD_APP_MODAL
|
||||||
wxPD_CAN_ABORT = wxc.wxPD_CAN_ABORT
|
wxPD_CAN_ABORT = wxc.wxPD_CAN_ABORT
|
||||||
|
wxPD_ELAPSED_TIME = wxc.wxPD_ELAPSED_TIME
|
||||||
|
wxPD_ESTIMATED_TIME = wxc.wxPD_ESTIMATED_TIME
|
||||||
|
wxPD_REMAINING_TIME = wxc.wxPD_REMAINING_TIME
|
||||||
wxNO_DEFAULT = wxc.wxNO_DEFAULT
|
wxNO_DEFAULT = wxc.wxNO_DEFAULT
|
||||||
wxDEFAULT = wxc.wxDEFAULT
|
wxDEFAULT = wxc.wxDEFAULT
|
||||||
wxDECORATIVE = wxc.wxDECORATIVE
|
wxDECORATIVE = wxc.wxDECORATIVE
|
||||||
|
Reference in New Issue
Block a user