1 /////////////////////////////////////////////////////////////////////////////
 
   3 // Purpose:     SWIG interface defs for wxPopupWindow and derived classes
 
   7 // Created:     22-Dec-1998
 
   9 // Copyright:   (c) 2003 by Total Control Software
 
  10 // Licence:     wxWindows license
 
  11 /////////////////////////////////////////////////////////////////////////////
 
  16 //---------------------------------------------------------------------------
 
  19 #include <wx/popupwin.h>
 
  22 //---------------------------------------------------------------------------
 
  26 MustHaveApp(wxPopupWindow);
 
  28 // wxPopupWindow: a special kind of top level window used for popup menus,
 
  29 // combobox popups and such.
 
  30 MustHaveApp(wxPopupWindow);
 
  32 class wxPopupWindow : public wxWindow {
 
  34     %pythonAppend wxPopupWindow         "self._setOORInfo(self)"
 
  35     %pythonAppend wxPopupWindow()       ""
 
  37     wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
 
  38     %RenameCtor(PrePopupWindow, wxPopupWindow());
 
  40     bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
 
  42     // move the popup window to the right position, i.e. such that it is
 
  45     // the popup is positioned at ptOrigin + size if it opens below and to the
 
  46     // right (default), at ptOrigin - sizePopup if it opens above and to the
 
  49     // the point must be given in screen coordinates!
 
  50     void Position(const wxPoint& ptOrigin,
 
  55 //---------------------------------------------------------------------------
 
  59 class wxPyPopupTransientWindow : public wxPopupTransientWindow
 
  62     wxPyPopupTransientWindow() : wxPopupTransientWindow() {}
 
  63     wxPyPopupTransientWindow(wxWindow* parent, int style = wxBORDER_NONE)
 
  64         : wxPopupTransientWindow(parent, style) {}
 
  66     DEC_PYCALLBACK_BOOL_ME(ProcessLeftDown);
 
  67     DEC_PYCALLBACK__(OnDismiss);
 
  68     DEC_PYCALLBACK_BOOL_(CanDismiss);
 
  73 IMP_PYCALLBACK_BOOL_ME(wxPyPopupTransientWindow, wxPopupTransientWindow, ProcessLeftDown);
 
  74 IMP_PYCALLBACK__(wxPyPopupTransientWindow, wxPopupTransientWindow, OnDismiss);
 
  75 IMP_PYCALLBACK_BOOL_(wxPyPopupTransientWindow, wxPopupTransientWindow, CanDismiss);
 
  79 MustHaveApp(wxPyPopupTransientWindow);
 
  81 // wxPopupTransientWindow: a wxPopupWindow which disappears automatically
 
  82 // when the user clicks mouse outside it or if it loses focus in any other way
 
  84 %rename(PopupTransientWindow) wxPyPopupTransientWindow;
 
  85 class wxPyPopupTransientWindow : public wxPopupWindow
 
  88     %pythonAppend wxPyPopupTransientWindow         "self._setOORInfo(self);" setCallbackInfo(PopupTransientWindow)
 
  89     %pythonAppend wxPyPopupTransientWindow()       ""
 
  91     wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
 
  92     %RenameCtor(PrePopupTransientWindow, wxPyPopupTransientWindow());
 
  94     void _setCallbackInfo(PyObject* self, PyObject* _class);
 
  96     // popup the window (this will show it too) and keep focus at winFocus
 
  97     // (or itself if it's NULL), dismiss the popup if we lose focus
 
  98     virtual void Popup(wxWindow *focus = NULL);
 
 101     virtual void Dismiss();   
 
 104 //---------------------------------------------------------------------------
 
 108 #else  // On Mac we need to provide dummy classes to keep the renamers in sync
 
 110 class wxPopupWindow : public wxWindow {
 
 112     wxPopupWindow(wxWindow *, int)  { wxPyRaiseNotImplemented(); }
 
 113     wxPopupWindow()                 { wxPyRaiseNotImplemented(); }
 
 116 class wxPyPopupTransientWindow : public wxPopupWindow
 
 119     wxPyPopupTransientWindow(wxWindow *, int)  { wxPyRaiseNotImplemented(); }
 
 120     wxPyPopupTransientWindow()                 { wxPyRaiseNotImplemented(); }
 
 125 class wxPopupWindow : public wxWindow {
 
 127     wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
 
 128     %RenameCtor(PrePopupWindow, wxPopupWindow());
 
 131 %rename(PopupTransientWindow) wxPyPopupTransientWindow;
 
 132 class wxPyPopupTransientWindow : public wxPopupWindow
 
 135     wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
 
 136     %RenameCtor(PrePopupTransientWindow, wxPyPopupTransientWindow());
 
 141 //---------------------------------------------------------------------------