Hi All,
I have a GUI containing a canvas(wxScrolledWindow) with many shapes on
it. I want to right click on a shape and produce some kind of *menu* with
a choice of three items (help, properties and close).
Using wxDialog, wxFrame and wxMiniFrame, and after pressing one of the
buttons on my *menu*, all seem to only return two codes, namely wxID_OK
and wxID_CANCEL. I need three return codes to be able to determine which
button was pressed.
Additionally, I need the *menu* window to be MODAL, which means that when
the menu is displayed, the GUI waits until one of the three buttons are
depressed.
Can someone please tell me if there is a more suitable CLASS to use than
those listed above, or tell me if any of the above classes return more
than just the two codes listed above.
---<snip>---
ID_miniFrame_HELP = wxID_OK #<-- pressing a button with these
ID_miniFrame_PARAM = wxID_CANCEL #<-- ID's closes the dialog and
ID_miniFrame_CANCEL= wxID_NO allows me to tell which button
was pressed (see below)
<...>
win = wxDialog(self, -1, "Select an option:", (-1,-1), (-1,-1) )
wxButton(win, ID_miniFrame_HELP, "A", wxPoint( 6, 10), wxSize(150,30) )
wxButton(win, ID_miniFrame_PARAM, "B", wxPoint( 6, 50), wxSize(150,30) )
wxButton(win, ID_miniFrame_CANCEL, "C", wxPoint( 6, 90), wxSize(150,30) )
val = win.ShowModal()
if val == ID_miniFrame_HELP:
self.displayHelp(shapeUnderMouse)
elif val == ID_miniFrame_PARAM:
print 'do params'
---<snip>---
In the above code, pressing the HELP and PARAM buttons dismiss the *menu*
window. The CANCEL button does not cancel the *menu* window, as I can
only find two codes that do dismiss the wxDialog(wxID_OK and wxID_CANCEL).
Help appreciated,
BenG.
···
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com