hi,
i done this. to create the standard menu
behavior isn't hard. if you know how to do
this.
i do it so:
<look at the end of this post>
buuuuuuut there are difficulties....
the both ID's
- wxCLEAR
- wxSELECTALL
don't work. wxCLEAR is there, but nothing
happen. wxSELECTALL is NOT implemented.
python says that there is no variable called wxSEL.
i also checked Ctrl-A and nothing happen. What's
going on?
read ya, reen
rene@meder.de
win98
python 2.0
wxpython2.2.5
wxwin 2.2
python win32extensions
<codesection>
class....
def __init__:
.....
EVT_RIGHT_DOWN(self, self.SetPopupCommentPos)
EVT_COMMAND_RIGHT_CLICK(self,-1, self.SetPopupComment)
def SetPopupCommentPos(self,event):
self.x = event.GetX()
self.y = event.GetY()
self.SetPopupComment(event)
event.Skip()
# Popupmenu mit den Standardwindoze einträgen
#define wxID_CUT 5030
#define wxID_COPY 5031
#define wxID_PASTE 5032
#define wxID_CLEAR 5033
#define wxID_FIND 5034
#define wxID_DUPLICATE 5035
#define wxID_SELECTALL 5036
def SetPopupComment(self,event):
menu = wxMenu()
tPopupID1 = wxID_UNDO
tPopupID2 = 0
tPopupID3 = wxID_CUT
tPopupID4 = wxID_COPY
tPopupID5 = wxID_PASTE
#Funktionieren Nicht
# tPopupID6 = wxID_CLEAR
# tPopupID7 = wxID_SELECTALL
menu.Append(tPopupID1, "&Rückgängig")
menu.AppendSeparator()
menu.Append(tPopupID2, "&Kommentar hinzufügen")
menu.AppendSeparator()
menu.Append(tPopupID3, "&Ausschneiden")
menu.Append(tPopupID4, "&Kopieren")
menu.Append(tPopupID5, "&Einfügen")
# menu.Append(tPopupID6, "&Löschen")
# menu.AppendSeparator()
# menu.Append(tPopupID7, "Alles &markieren")
if self.comment:
menu.Enable(tPopupID2,FALSE)
EVT_MENU(self, tPopupID1, self.NormalWindozePopupFunctions)
EVT_MENU(self, tPopupID2, self.AddComment)
EVT_MENU(self, tPopupID3, self.NormalWindozePopupFunctions)
EVT_MENU(self, tPopupID4, self.NormalWindozePopupFunctions)
EVT_MENU(self, tPopupID5, self.NormalWindozePopupFunctions)
# EVT_MENU(self, tPopupID6, self.NormalWindozePopupFunctions)
# EVT_MENU(self, tPopupID7, self.NormalWindozePopupFunctions)
self.PopupMenu(menu, wxPoint(self.x, self.y))
menu.Destroy()
event.Skip()
def NormalWindozePopupFunctions(self,event):
event.Skip()