X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0c956e8e6db05d79a7bc4757ca56fd8bd016734..b7c75283f2144469e8fa6a24ca285b42fab69a6b:/wxPython/src/_window.i diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index 9c07523c3e..792de7385a 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -24,6 +24,16 @@ MAKE_CONST_WXSTRING(PanelNameStr); %newgroup +enum wxWindowVariant +{ + wxWINDOW_VARIANT_DEFAULT, // Default size (usually == normal, may be set by a wxSystemOptions entry) + wxWINDOW_VARIANT_NORMAL, // Normal size + wxWINDOW_VARIANT_SMALL, // Smaller size (about 25 % smaller than normal ) + wxWINDOW_VARIANT_MINI, // Mini size (about 33 % smaller than normal ) + wxWINDOW_VARIANT_LARGE, // Large size (about 25 % larger than normal ) +}; + + DocStr(wxWindow, " wx.Window is the base class for all windows and represents any visible @@ -253,30 +263,40 @@ has been added to the list of windows pending real deletion."); DocDeclStr( virtual wxString , GetLabel() const, - "Generic way of getting a label from any window, for identification -purposes. The interpretation of this function differs from class to -class. For frames and dialogs, the value returned is the title. For -buttons or static text controls, it is the button text. This function -can be useful for meta-programs (such as testing tools or -special-needs access programs) which need to identify windows by name."); + "Generic way of getting a label from any window, for +identification purposes. The interpretation of this function +differs from class to class. For frames and dialogs, the value +returned is the title. For buttons or static text controls, it is +the button text. This function can be useful for meta-programs +(such as testing tools or special-needs access programs) which +need to identify windows by name."); // the window name is used for ressource setting in X, it is not the // same as the window title/label DocDeclStr( virtual void , SetName( const wxString &name ), - "Sets the window's name. The window name is used for ressource setting -in X, it is not the same as the window title/label"); + "Sets the window's name. The window name is used for ressource +setting in X, it is not the same as the window title/label"); DocDeclStr( virtual wxString , GetName() const, - "Returns the window's name. This name is not guaranteed to be unique; -it is up to the programmer to supply an appropriate name in the window -constructor or via wx.Window.SetName."); + "Returns the window's name. This name is not guaranteed to be +unique; it is up to the programmer to supply an appropriate name +in the window constructor or via wx.Window.SetName."); + + + + DocDeclStr( + void , SetWindowVariant( wxWindowVariant variant ), + "Sets the variant of the window/font size to use for this window, +if the platform supports variants, (for example, wxMac.)"); + + DocDeclStr( + wxWindowVariant , GetWindowVariant() const, + ""); - // window id uniquely identifies the window among its siblings unless - // it is -1 which means "don't care" DocDeclStr( void , SetId( wxWindowID winid ), "Sets the identifier of the window. Each window has an integer @@ -1046,9 +1066,10 @@ colour. Does not cause an erase background event to be generated."); DocDeclStr( virtual void , Freeze(), - "Freezes the window or, in other words, prevents any updates from -taking place on screen, the window is not redrawn at all. Thaw must be -called to reenable window redrawing. + "Freezes the window or, in other words, prevents any updates from taking place +on screen, the window is not redrawn at all. Thaw must be called to reenable +window redrawing. Calls to Freeze/Thaw may be nested, with the actual Thaw +being delayed until all the nesting has been undone. This method is useful for visual appearance optimization (for example, it is a good idea to use it before inserting large amount of text into @@ -1059,7 +1080,9 @@ mandatory directive."); DocDeclStr( virtual void , Thaw(), - "Reenables window updating after a previous call to Freeze."); + "Reenables window updating after a previous call to Freeze. Calls to +Freeze/Thaw may be nested, so Thaw must be called the same number of times +that Freeze was before the window will be updated."); DocDeclStr( @@ -1087,7 +1110,7 @@ optimize redrawing by only redrawing those areas, which have been exposed."); bool IsExposed( int x, int y, int w=1, int h=1 ) const; %name(IsExposedPoint) bool IsExposed( const wxPoint& pt ) const; - %name(isExposedRect) bool IsExposed( const wxRect& rect ) const; + %name(IsExposedRect) bool IsExposed( const wxRect& rect ) const; @@ -1156,7 +1179,7 @@ be reset back to default."); DocDeclStr( wxFont& , GetFont(), - "Returns a reference to the font for this window."); + "Returns the default font used for this window."); @@ -1687,12 +1710,25 @@ wxWindow* wxFindWindowByLabel( const wxString& label, +%{ +#ifdef __WXMSW__ +#include // to get wxGetWindowId +#endif +%} + %inline %{ - wxWindow* wxWindow_FromHWND(unsigned long hWnd) { + wxWindow* wxWindow_FromHWND(wxWindow* parent, unsigned long _hWnd) { #ifdef __WXMSW__ + WXHWND hWnd = (WXHWND)_hWnd; + long id = wxGetWindowId(hWnd); wxWindow* win = new wxWindow; - win->SetHWND((WXHWND)hWnd); - win->SubclassWin((WXHWND)hWnd); + parent->AddChild(win); + win->SetEventHandler(win); + win->SetHWND(hWnd); + win->SetId(id); + win->SubclassWin(hWnd); + win->AdoptAttributesFromHWND(); + win->SetupColours(); return win; #else wxPyRaiseNotImplemented();