X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d0e2ede057148772415ee526344f1a1597db3ae7..5f2502393e042e6e2c871ff94b7ccaf7a78b264d:/wxPython/src/_event.i diff --git a/wxPython/src/_event.i b/wxPython/src/_event.i index f2a5aab355..33f832615a 100644 --- a/wxPython/src/_event.i +++ b/wxPython/src/_event.i @@ -149,6 +149,7 @@ wxEventType wxNewEventType(); %constant wxEventType wxEVT_ICONIZE; %constant wxEventType wxEVT_MAXIMIZE; %constant wxEventType wxEVT_MOUSE_CAPTURE_CHANGED; +%constant wxEventType wxEVT_MOUSE_CAPTURE_LOST; %constant wxEventType wxEVT_PAINT; %constant wxEventType wxEVT_ERASE_BACKGROUND; %constant wxEventType wxEVT_NC_PAINT; @@ -235,6 +236,7 @@ EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) +EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST ) EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) @@ -473,6 +475,13 @@ example, you can use the value returned by an earlier call to // all derived classes must implement it because otherwise wxPostEvent() // for them wouldn't work (it needs to do a copy of the event) virtual wxEvent *Clone() /* =0*/; + + %property(EventObject, GetEventObject, SetEventObject, doc="See `GetEventObject` and `SetEventObject`"); + %property(EventType, GetEventType, SetEventType, doc="See `GetEventType` and `SetEventType`"); + %property(Id, GetId, SetId, doc="See `GetId` and `SetId`"); + %property(Skipped, GetSkipped, doc="See `GetSkipped`"); + %property(Timestamp, GetTimestamp, SetTimestamp, doc="See `GetTimestamp` and `SetTimestamp`"); + }; @@ -601,6 +610,12 @@ deselection), or a boolean value representing the value of a checkbox.", ""); virtual wxEvent *Clone() const; + %property(ClientData, GetClientData, SetClientData, doc="See `GetClientData` and `SetClientData`"); + %property(ClientObject, GetClientObject, SetClientObject, doc="See `GetClientObject` and `SetClientObject`"); + %property(ExtraLong, GetExtraLong, SetExtraLong, doc="See `GetExtraLong` and `SetExtraLong`"); + %property(Int, GetInt, SetInt, doc="See `GetInt` and `SetInt`"); + %property(Selection, GetSelection, doc="See `GetSelection`"); + %property(String, GetString, SetString, doc="See `GetString` and `SetString`"); }; //--------------------------------------------------------------------------- @@ -663,8 +678,8 @@ Events EVT_SCROLL_PAGEDOWN page down events EVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent as the user drags the 'thumb') - EVT_SCROLL_THUMBRELEASE thumb release events. - EVT_SCROLL_ENDSCROLL End of scrolling + EVT_SCROLL_THUMBRELEASE thumb release events + EVT_SCROLL_CHANGED End of scrolling ======================= ========================================== Note @@ -672,17 +687,17 @@ Note The EVT_SCROLL_THUMBRELEASE event is only emitted when actually dragging the thumb using the mouse and releasing it (This EVT_SCROLL_THUMBRELEASE event is also followed by an - EVT_SCROLL_ENDSCROLL event). + EVT_SCROLL_CHANGED event). - The EVT_SCROLL_ENDSCROLL event also occurs when using the keyboard + The EVT_SCROLL_CHANGED event also occurs when using the keyboard to change the thumb position, and when clicking next to the thumb (In all these cases the EVT_SCROLL_THUMBRELEASE event does not happen). - In short, the EVT_SCROLL_ENDSCROLL event is triggered when + In short, the EVT_SCROLL_CHANGED event is triggered when scrolling/ moving has finished. The only exception (unfortunately) is that changing the thumb position using the mousewheel does give - a EVT_SCROLL_THUMBRELEASE event but NOT an EVT_SCROLL_ENDSCROLL + a EVT_SCROLL_THUMBRELEASE event but NOT an EVT_SCROLL_CHANGED event. "); @@ -705,6 +720,9 @@ the scrollbar.", ""); void SetOrientation(int orient); void SetPosition(int pos); + + %property(Orientation, GetOrientation, SetOrientation, doc="See `GetOrientation` and `SetOrientation`"); + %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`"); }; @@ -727,8 +745,8 @@ Events EVT_SCROLLWIN_PAGEDOWN page down events EVT_SCROLLWIN_THUMBTRACK thumbtrack events (frequent events sent as the user drags the 'thumb') - EVT_SCROLLWIN_THUMBRELEASE thumb release events. - EVT_SCROLLWIN_ENDSCROLL End of scrolling + EVT_SCROLLWIN_THUMBRELEASE thumb release events + EVT_SCROLLWIN_CHANGED End of scrolling ========================== ========================================== :see: `wx.ScrollEvent` @@ -753,6 +771,9 @@ need to query the window itself for the current position in that case.", ""); void SetOrientation(int orient); void SetPosition(int pos); + + %property(Orientation, GetOrientation, SetOrientation, doc="See `GetOrientation` and `SetOrientation`"); + %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`"); }; //--------------------------------------------------------------------------- @@ -1089,6 +1110,15 @@ public: int m_wheelRotation; int m_wheelDelta; int m_linesPerAction; + + %property(Button, GetButton, doc="See `GetButton`"); + %property(LinesPerAction, GetLinesPerAction, doc="See `GetLinesPerAction`"); + %property(LogicalPosition, GetLogicalPosition, doc="See `GetLogicalPosition`"); + %property(Position, GetPosition, doc="See `GetPosition`"); + %property(WheelDelta, GetWheelDelta, doc="See `GetWheelDelta`"); + %property(WheelRotation, GetWheelRotation, doc="See `GetWheelRotation`"); + %property(X, GetX, doc="See `GetX`"); + %property(Y, GetY, doc="See `GetY`"); }; //--------------------------------------------------------------------------- @@ -1131,6 +1161,9 @@ public: bool , HasCursor() const, "Returns true if the cursor specified by this event is a valid cursor.", ""); + %property(Cursor, GetCursor, SetCursor, doc="See `GetCursor` and `SetCursor`"); + %property(X, GetX, doc="See `GetX`"); + %property(Y, GetY, doc="See `GetY`"); }; //--------------------------------------------------------------------------- @@ -1312,7 +1345,8 @@ Note that in Unicode build, the returned value is meaningful only if the user entered a character that can be represented in current locale's default charset. You can obtain the corresponding Unicode character using `GetUnicodeKey`.", ""); - %pythoncode { KeyCode = GetKeyCode } + +// %pythoncode { KeyCode = GetKeyCode } this will be hidden by the property %extend { @@ -1330,6 +1364,17 @@ function is only meaningfule in a Unicode build of wxPython.", ""); } %pythoncode { GetUniChar = GetUnicodeKey } + %extend { + DocStr( + SetUnicodeKey, + "Set the Unicode value of the key event, but only if this is a Unicode +build of wxPython.", ""); + void SetUnicodeKey(int uniChar) { + %#if wxUSE_UNICODE + self->m_uniChar = uniChar; + %#endif + } + } DocDeclStr( wxUint32 , GetRawKeyCode() const, @@ -1382,6 +1427,15 @@ public: wxUint32 m_rawCode; wxUint32 m_rawFlags; + + %property(KeyCode, GetKeyCode, doc="See `GetKeyCode`"); + %property(Modifiers, GetModifiers, doc="See `GetModifiers`"); + %property(Position, GetPosition, doc="See `GetPosition`"); + %property(RawKeyCode, GetRawKeyCode, doc="See `GetRawKeyCode`"); + %property(RawKeyFlags, GetRawKeyFlags, doc="See `GetRawKeyFlags`"); + %property(UnicodeKey, GetUnicodeKey, SetUnicodeKey, doc="See `GetUnicodeKey` and `SetUnicodeKey`"); + %property(X, GetX, doc="See `GetX`"); + %property(Y, GetY, doc="See `GetY`"); }; //--------------------------------------------------------------------------- @@ -1427,9 +1481,11 @@ event.", ""); } } -public: wxSize m_size; wxRect m_rect; + + %property(Rect, GetRect, SetRect, doc="See `GetRect` and `SetRect`"); + %property(Size, GetSize, SetSize, doc="See `GetSize` and `SetSize`"); }; @@ -1459,6 +1515,10 @@ public: m_pos = property(GetPosition, SetPosition) m_rect = property(GetRect, SetRect) } + + %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`"); + %property(Rect, GetRect, SetRect, doc="See `GetRect` and `SetRect`"); + }; //--------------------------------------------------------------------------- @@ -1520,6 +1580,8 @@ public: "Returns the device context the event handler should draw upon. If ``None`` is returned then create a temporary `wx.ClientDC` and use that instead.", ""); + + %property(DC, GetDC, doc="See `GetDC`"); }; @@ -1552,15 +1614,22 @@ window which is going to receive focus for the wxEVT_KILL_FOCUS event. Warning: the window returned may be None!", ""); void SetWindow(wxWindow *win); + + %property(Window, GetWindow, SetWindow, doc="See `GetWindow` and `SetWindow`"); }; //--------------------------------------------------------------------------- %newgroup; DocStr(wxChildFocusEvent, -"wx.ChildFocusEvent notifies the parent that a child has received the -focus. Unlike `wx.FocusEvent` it is propagated up the window -heirarchy.", ""); +"A child focus event is sent to a (parent-)window when one of its child +windows gains focus, so that the window could restore the focus back +to its corresponding child if it loses it now and regains later. + +Notice that child window is the direct child of the window receiving +the event, and so may not be the actual widget recieving focus if it +is further down the containment heirarchy. Use `wx.Window.FindFocus` +to get the widget that is actually receiving focus.", ""); class wxChildFocusEvent : public wxCommandEvent @@ -1572,8 +1641,10 @@ public: DocDeclStr( wxWindow *, GetWindow() const, - "The window which has just received the focus.", ""); + "The window, or (grand)parent of the window which has just received the +focus.", ""); + %property(Window, GetWindow, doc="See `GetWindow`"); }; //--------------------------------------------------------------------------- @@ -1618,6 +1689,7 @@ public: "Returns true if the application or window is being activated, false otherwise.", ""); + %property(Active, GetActive, doc="See `GetActive`"); }; @@ -1698,6 +1770,8 @@ be used with the OPEN and CLOSE events.", ""); "Returns the menu which is being opened or closed. This method should only be used with the OPEN and CLOSE events.", ""); + %property(Menu, GetMenu, doc="See `GetMenu`"); + %property(MenuId, GetMenuId, doc="See `GetMenuId`"); }; //--------------------------------------------------------------------------- @@ -1778,6 +1852,7 @@ event. Vetoing a window close event is not possible if the calling code wishes to force the application to exit, and so this function must be called to check this.", ""); + %property(LoggingOff, GetLoggingOff, SetLoggingOff, doc="See `GetLoggingOff` and `SetLoggingOff`"); }; @@ -1795,6 +1870,7 @@ public: void SetShow(bool show); bool GetShow() const; + %property(Show, GetShow, SetShow, doc="See `GetShow` and `SetShow`"); }; @@ -1888,6 +1964,10 @@ public: return list; } } + + %property(Files, GetFiles, doc="See `GetFiles`"); + %property(NumberOfFiles, GetNumberOfFiles, doc="See `GetNumberOfFiles`"); + %property(Position, GetPosition, doc="See `GetPosition`"); }; @@ -2084,6 +2164,10 @@ The mode may be one of the following values: all windows, or only to those which specify that they will process the events.", ""); + %property(Checked, GetChecked, Check, doc="See `GetChecked`"); + %property(Enabled, GetEnabled, Enable, doc="See `GetEnabled`"); + %property(Shown, GetShown, Show, doc="See `GetShown`"); + %property(Text, GetText, SetText, doc="See `GetText` and `SetText`"); }; //--------------------------------------------------------------------------- @@ -2133,6 +2217,31 @@ public: "Returns the window that gained the capture, or ``None`` if it was a non-wxWidgets window.", ""); + %property(CapturedWindow, GetCapturedWindow, doc="See `GetCapturedWindow`"); +}; + +//--------------------------------------------------------------------------- +%newgroup; + +DocStr(wxMouseCaptureLostEvent, +"A mouse capture lost event is sent to a window that obtained mouse +capture, which was subsequently loss due to \"external\" event, for +example when a dialog box is shown or if another application captures +the mouse. + +If this happens, this event is sent to all windows that are on the +capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but +didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent +if the capture changes because of a call to CaptureMouse or +ReleaseMouse. + +This event is currently emitted under Windows only. +", ""); + +class wxMouseCaptureLostEvent : public wxEvent +{ +public: + wxMouseCaptureLostEvent(wxWindowID winid = 0); }; //--------------------------------------------------------------------------- @@ -2170,6 +2279,7 @@ public: void SetChangedWindow(wxWindow* win); wxWindow* GetChangedWindow(); + %property(ChangedWindow, GetChangedWindow, SetChangedWindow, doc="See `GetChangedWindow` and `SetChangedWindow`"); }; //--------------------------------------------------------------------------- @@ -2193,6 +2303,8 @@ public: "App should set this if it changes the palette.", ""); bool GetPaletteRealized() const; + + %property(PaletteRealized, GetPaletteRealized, SetPaletteRealized, doc="See `GetPaletteRealized` and `SetPaletteRealized`"); }; //--------------------------------------------------------------------------- @@ -2275,6 +2387,10 @@ This is required for proper navogation over radio buttons.", ""); WinChange, FromTab }; + + %property(CurrentFocus, GetCurrentFocus, SetCurrentFocus, doc="See `GetCurrentFocus` and `SetCurrentFocus`"); + %property(Direction, GetDirection, SetDirection, doc="See `GetDirection` and `SetDirection`"); + }; //--------------------------------------------------------------------------- @@ -2294,6 +2410,7 @@ public: wxWindow *, GetWindow() const, "Returns the window that this event refers to.", ""); + %property(Window, GetWindow, doc="See `GetWindow`"); }; @@ -2315,6 +2432,8 @@ public: DocDeclStr( wxWindow *, GetWindow() const, "Returns the window that this event refers to.", ""); + + %property(Window, GetWindow, doc="See `GetWindow`"); }; @@ -2346,6 +2465,7 @@ be shown.", ""); void , SetPosition(const wxPoint& pos), "Sets the position at which the menu should be shown.", ""); + %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`"); }; //--------------------------------------------------------------------------- @@ -2539,6 +2659,7 @@ public: "Sets the date carried by the event, normally only used by the library internally.", ""); + %property(Date, GetDate, SetDate, doc="See `GetDate` and `SetDate`"); };