From 42e2bbb9e149c589ab03cf6d2adec0617a9f0f24 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 6 Sep 2006 04:20:39 +0000 Subject: [PATCH] add more properties git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_accel.i | 6 ++++++ wxPython/src/_cmndlgs.i | 28 ++++++++++++++++++++++++++++ wxPython/src/_core_ex.py | 2 ++ wxPython/src/_dataobj.i | 1 + wxPython/src/_effects.i | 6 ++++++ wxPython/src/_event.i | 11 +++++++++++ wxPython/src/_evthandler.i | 3 +++ wxPython/src/_filesys.i | 15 +++++++++++++++ wxPython/src/_font.i | 18 ++++++++++++++++++ wxPython/src/_functions.i | 14 +++++++++++++- wxPython/src/_mimetype.i | 19 +++++++++++++++++++ wxPython/src/_misc.i | 4 ++++ wxPython/src/_picker.i | 9 +++++++++ wxPython/src/_sizers.i | 10 +++++++--- wxPython/src/_toplvl.i | 5 +++++ 15 files changed, 147 insertions(+), 4 deletions(-) diff --git a/wxPython/src/_accel.i b/wxPython/src/_accel.i index 85f441e0b6..5f0bee9ed2 100644 --- a/wxPython/src/_accel.i +++ b/wxPython/src/_accel.i @@ -70,6 +70,12 @@ public: // void SetMenuItem(wxMenuItem *item); // wxMenuItem *GetMenuItem() const; + %newobject Create; + DocDeclStr( + static wxAcceleratorEntry *, Create(const wxString& str), + "Create accelerator corresponding to the specified string, or None if +it coulnd't be parsed.", ""); + DocDeclStr( int , GetFlags(), "Get the AcceleratorEntry's flags.", ""); diff --git a/wxPython/src/_cmndlgs.i b/wxPython/src/_cmndlgs.i index daf8fa19c2..bb15ae0138 100644 --- a/wxPython/src/_cmndlgs.i +++ b/wxPython/src/_cmndlgs.i @@ -373,6 +373,15 @@ style, use GetPath for the others.", ""); // const wxString &extensionList); + %property(Directory, GetDirectory, SetDirectory, doc="See `GetDirectory` and `SetDirectory`"); + %property(Filename, GetFilename, SetFilename, doc="See `GetFilename` and `SetFilename`"); + %property(Filenames, GetFilenames, doc="See `GetFilenames`"); + %property(FilterIndex, GetFilterIndex, SetFilterIndex, doc="See `GetFilterIndex` and `SetFilterIndex`"); + %property(Message, GetMessage, SetMessage, doc="See `GetMessage` and `SetMessage`"); + %property(Path, GetPath, SetPath, doc="See `GetPath` and `SetPath`"); + %property(Paths, GetPaths, doc="See `GetPaths`"); + %property(Wildcard, GetWildcard, SetWildcard, doc="See `GetWildcard` and `SetWildcard`"); + }; @@ -627,6 +636,14 @@ default is 0, 0 (unrestricted range).", ""); void , SetShowHelp(bool showHelp), "Determines whether the Help button will be displayed in the font dialog (Windows only). The default value is false.", ""); + + %property(AllowSymbols, GetAllowSymbols, SetAllowSymbols, doc="See `GetAllowSymbols` and `SetAllowSymbols`"); + %property(ChosenFont, GetChosenFont, SetChosenFont, doc="See `GetChosenFont` and `SetChosenFont`"); + %property(Colour, GetColour, SetColour, doc="See `GetColour` and `SetColour`"); + %property(EnableEffects, GetEnableEffects, doc="See `GetEnableEffects`"); + %property(InitialFont, GetInitialFont, SetInitialFont, doc="See `GetInitialFont` and `SetInitialFont`"); + %property(ShowHelp, GetShowHelp, SetShowHelp, doc="See `GetShowHelp` and `SetShowHelp`"); + }; @@ -656,6 +673,8 @@ results with via the `wx.FontData` returned by `GetFontData`.", ""); wxFontData& , GetFontData(), "Returns a reference to the internal `wx.FontData` used by the wx.FontDialog.", ""); + + %property(FontData, GetFontData, doc="See `GetFontData`"); }; @@ -890,6 +909,11 @@ and replace all events).", ""); DocDeclStr( void , SetReplaceString(const wxString& str), "", ""); + + %property(Dialog, GetDialog, doc="See `GetDialog`"); + %property(FindString, GetFindString, SetFindString, doc="See `GetFindString` and `SetFindString`"); + %property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`"); + %property(ReplaceString, GetReplaceString, SetReplaceString, doc="See `GetReplaceString` and `SetReplaceString`"); }; @@ -954,6 +978,9 @@ public: void , SetReplaceString(const wxString& str), "Set the replacement string (used as initial value by the dialog).", ""); + %property(FindString, GetFindString, SetFindString, doc="See `GetFindString` and `SetFindString`"); + %property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`"); + %property(ReplaceString, GetReplaceString, SetReplaceString, doc="See `GetReplaceString` and `SetReplaceString`"); }; @@ -1018,6 +1045,7 @@ non-None. Use Show to display the dialog.", ""); void , SetData(wxFindReplaceData *data), "Set the FindReplaceData object used by this dialog.", ""); + %property(Data, GetData, SetData, doc="See `GetData` and `SetData`"); }; //--------------------------------------------------------------------------- diff --git a/wxPython/src/_core_ex.py b/wxPython/src/_core_ex.py index 3856de4f6f..8ede13afee 100644 --- a/wxPython/src/_core_ex.py +++ b/wxPython/src/_core_ex.py @@ -243,6 +243,8 @@ class FutureCall: # if it wasn't restarted, then cleanup wx.CallAfter(self.Stop) + Interval = property(GetInterval) + Result = property(GetResult) #---------------------------------------------------------------------------- diff --git a/wxPython/src/_dataobj.i b/wxPython/src/_dataobj.i index e4a7cc1c04..b7980bcdb9 100644 --- a/wxPython/src/_dataobj.i +++ b/wxPython/src/_dataobj.i @@ -749,6 +749,7 @@ public: void , AddFile(const wxString &filename), "Adds a file to the list of files represented by this data object.", ""); + %property(Filenames, GetFilenames, doc="See `GetFilenames`"); }; //--------------------------------------------------------------------------- diff --git a/wxPython/src/_effects.i b/wxPython/src/_effects.i index fac697f2a3..7e7815c5f3 100644 --- a/wxPython/src/_effects.i +++ b/wxPython/src/_effects.i @@ -50,6 +50,12 @@ public: // Tile a bitmap bool TileBitmap(const wxRect& rect, wxDC& dc, wxBitmap& bitmap); + %property(DarkShadow, GetDarkShadow, SetDarkShadow, doc="See `GetDarkShadow` and `SetDarkShadow`"); + %property(FaceColour, GetFaceColour, SetFaceColour, doc="See `GetFaceColour` and `SetFaceColour`"); + %property(HighlightColour, GetHighlightColour, SetHighlightColour, doc="See `GetHighlightColour` and `SetHighlightColour`"); + %property(LightShadow, GetLightShadow, SetLightShadow, doc="See `GetLightShadow` and `SetLightShadow`"); + %property(MediumShadow, GetMediumShadow, SetMediumShadow, doc="See `GetMediumShadow` and `SetMediumShadow`"); + }; diff --git a/wxPython/src/_event.i b/wxPython/src/_event.i index a0b5fc1a42..bd71cffdb5 100644 --- a/wxPython/src/_event.i +++ b/wxPython/src/_event.i @@ -475,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`"); + }; @@ -1539,6 +1546,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`"); }; @@ -1571,6 +1580,8 @@ 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`"); }; //--------------------------------------------------------------------------- diff --git a/wxPython/src/_evthandler.i b/wxPython/src/_evthandler.i index 5df2f19381..8b39ea8a5e 100644 --- a/wxPython/src/_evthandler.i +++ b/wxPython/src/_evthandler.i @@ -128,6 +128,9 @@ public: return event.Unbind(self, id, id2) } + %property(EvtHandlerEnabled, GetEvtHandlerEnabled, SetEvtHandlerEnabled, doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`"); + %property(NextHandler, GetNextHandler, SetNextHandler, doc="See `GetNextHandler` and `SetNextHandler`"); + %property(PreviousHandler, GetPreviousHandler, SetPreviousHandler, doc="See `GetPreviousHandler` and `SetPreviousHandler`"); }; diff --git a/wxPython/src/_filesys.i b/wxPython/src/_filesys.i index a423b23fe5..4291d52077 100644 --- a/wxPython/src/_filesys.i +++ b/wxPython/src/_filesys.i @@ -42,6 +42,13 @@ public: const wxString& GetLocation(); const wxString& GetAnchor(); wxDateTime GetModificationTime(); + + %property(Anchor, GetAnchor, doc="See `GetAnchor`"); + %property(Location, GetLocation, doc="See `GetLocation`"); + %property(MimeType, GetMimeType, doc="See `GetMimeType`"); + %property(ModificationTime, GetModificationTime, doc="See `GetModificationTime`"); + %property(Stream, GetStream, doc="See `GetStream`"); + }; @@ -121,6 +128,12 @@ public: wxString GetAnchor(const wxString& location); wxString GetRightLocation(const wxString& location); wxString GetMimeTypeFromExt(const wxString& location); + + %property(Anchor, GetAnchor, doc="See `GetAnchor`"); + %property(LeftLocation, GetLeftLocation, doc="See `GetLeftLocation`"); + %property(MimeTypeFromExt, GetMimeTypeFromExt, doc="See `GetMimeTypeFromExt`"); + %property(Protocol, GetProtocol, doc="See `GetProtocol`"); + %property(RightLocation, GetRightLocation, doc="See `GetRightLocation`"); }; @@ -158,6 +171,8 @@ public: return fname.GetFullPath(); } } + + %property(Path, GetPath, doc="See `GetPath`"); }; diff --git a/wxPython/src/_font.i b/wxPython/src/_font.i index 81149f9bbc..fe0746eecf 100644 --- a/wxPython/src/_font.i +++ b/wxPython/src/_font.i @@ -429,6 +429,8 @@ public: // the title for the dialogs (note that default is quite reasonable) void SetDialogTitle(const wxString& title); + + %property(AltForEncoding, GetAltForEncoding, doc="See `GetAltForEncoding`"); }; @@ -803,6 +805,22 @@ then for a font belonging to the same family.", ""); DocDeclStr( static void , SetDefaultEncoding(wxFontEncoding encoding), "Sets the default font encoding.", ""); + + %property(Encoding, GetEncoding, SetEncoding, doc="See `GetEncoding` and `SetEncoding`"); + %property(FaceName, GetFaceName, SetFaceName, doc="See `GetFaceName` and `SetFaceName`"); + %property(Family, GetFamily, SetFamily, doc="See `GetFamily` and `SetFamily`"); + %property(FamilyString, GetFamilyString, doc="See `GetFamilyString`"); + %property(NativeFontInfo, GetNativeFontInfo, SetNativeFontInfo, doc="See `GetNativeFontInfo` and `SetNativeFontInfo`"); + %property(NativeFontInfoDesc, GetNativeFontInfoDesc, doc="See `GetNativeFontInfoDesc`"); + %property(NativeFontInfoUserDesc, GetNativeFontInfoUserDesc, SetNativeFontInfoUserDesc, doc="See `GetNativeFontInfoUserDesc` and `SetNativeFontInfoUserDesc`"); + %property(NoAntiAliasing, GetNoAntiAliasing, SetNoAntiAliasing, doc="See `GetNoAntiAliasing` and `SetNoAntiAliasing`"); + %property(PixelSize, GetPixelSize, SetPixelSize, doc="See `GetPixelSize` and `SetPixelSize`"); + %property(PointSize, GetPointSize, SetPointSize, doc="See `GetPointSize` and `SetPointSize`"); + %property(Style, GetStyle, SetStyle, doc="See `GetStyle` and `SetStyle`"); + %property(StyleString, GetStyleString, doc="See `GetStyleString`"); + %property(Underlined, GetUnderlined, SetUnderlined, doc="See `GetUnderlined` and `SetUnderlined`"); + %property(Weight, GetWeight, SetWeight, doc="See `GetWeight` and `SetWeight`"); + %property(WeightString, GetWeightString, doc="See `GetWeightString`"); }; diff --git a/wxPython/src/_functions.i b/wxPython/src/_functions.i index 533a0aa957..7b5d74e133 100644 --- a/wxPython/src/_functions.i +++ b/wxPython/src/_functions.i @@ -50,7 +50,19 @@ enum wxStockLabelQueryFlag // for wxID_OK): wxString wxGetStockLabel(wxWindowID id, long flags = wxSTOCK_WITH_MNEMONIC); - + + +enum wxStockHelpStringClient +{ + wxSTOCK_MENU // help string to use for menu items +}; + +// Returns an help string for the given stock UI element and for the given "context". +wxString wxGetStockHelpString(wxWindowID id, + wxStockHelpStringClient client = wxSTOCK_MENU); + + + MustHaveApp(wxBell); void wxBell(); diff --git a/wxPython/src/_mimetype.i b/wxPython/src/_mimetype.i index 019f440c64..bd94363c64 100644 --- a/wxPython/src/_mimetype.i +++ b/wxPython/src/_mimetype.i @@ -86,6 +86,16 @@ public: // get the icon info const wxString& GetIconFile() const; int GetIconIndex() const; + + %property(Description, GetDescription, doc="See `GetDescription`"); + %property(Extensions, GetExtensions, doc="See `GetExtensions`"); + %property(ExtensionsCount, GetExtensionsCount, doc="See `GetExtensionsCount`"); + %property(IconFile, GetIconFile, doc="See `GetIconFile`"); + %property(IconIndex, GetIconIndex, doc="See `GetIconIndex`"); + %property(MimeType, GetMimeType, doc="See `GetMimeType`"); + %property(OpenCommand, GetOpenCommand, doc="See `GetOpenCommand`"); + %property(PrintCommand, GetPrintCommand, doc="See `GetPrintCommand`"); + %property(ShortDesc, GetShortDesc, SetShortDesc, doc="See `GetShortDesc` and `SetShortDesc`"); }; @@ -289,6 +299,15 @@ public: } } + %property(AllCommands, GetAllCommands, doc="See `GetAllCommands`"); + %property(Description, GetDescription, doc="See `GetDescription`"); + %property(Extensions, GetExtensions, doc="See `GetExtensions`"); + %property(Icon, GetIcon, doc="See `GetIcon`"); + %property(IconInfo, GetIconInfo, doc="See `GetIconInfo`"); + %property(MimeType, GetMimeType, doc="See `GetMimeType`"); + %property(MimeTypes, GetMimeTypes, doc="See `GetMimeTypes`"); + %property(OpenCommand, GetOpenCommand, doc="See `GetOpenCommand`"); + %property(PrintCommand, GetPrintCommand, doc="See `GetPrintCommand`"); }; diff --git a/wxPython/src/_misc.i b/wxPython/src/_misc.i index cf0257d4d6..681174477f 100644 --- a/wxPython/src/_misc.i +++ b/wxPython/src/_misc.i @@ -182,6 +182,10 @@ public: int GetCount() const; %pythoncode { GetNoHistoryFiles = GetCount } + %property(Count, GetCount, doc="See `GetCount`"); + %property(HistoryFile, GetHistoryFile, doc="See `GetHistoryFile`"); + %property(MaxFiles, GetMaxFiles, doc="See `GetMaxFiles`"); + %property(NoHistoryFiles, GetNoHistoryFiles, doc="See `GetNoHistoryFiles`"); }; diff --git a/wxPython/src/_picker.i b/wxPython/src/_picker.i index d13755e138..8859e174a2 100644 --- a/wxPython/src/_picker.i +++ b/wxPython/src/_picker.i @@ -292,6 +292,8 @@ public: // Returns the filtered value currently placed in the text control (if present). wxString GetTextCtrlValue() const; + %property(Path, GetPath, SetPath, doc="See `GetPath` and `SetPath`"); + %property(TextCtrlValue, GetTextCtrlValue, doc="See `GetTextCtrlValue`"); }; @@ -356,6 +358,8 @@ public: wxString GetPath() const { return m_path; } void SetPath(const wxString &p) { m_path = p; } + + %property(Path, GetPath, SetPath, doc="See `GetPath` and `SetPath`"); }; @@ -413,6 +417,9 @@ public: // set/get the max pointsize void SetMaxPointSize(unsigned int max); unsigned int GetMaxPointSize() const; + + %property(MaxPointSize, GetMaxPointSize, SetMaxPointSize, doc="See `GetMaxPointSize` and `SetMaxPointSize`"); + %property(SelectedFont, GetSelectedFont, SetSelectedFont, doc="See `GetSelectedFont` and `SetSelectedFont`"); }; @@ -430,6 +437,8 @@ public: wxFont GetFont() const; void SetFont(const wxFont &c); + + %property(Font, GetFont, SetFont, doc="See `GetFont` and `SetFont`"); }; //--------------------------------------------------------------------------- diff --git a/wxPython/src/_sizers.i b/wxPython/src/_sizers.i index a009cad8f1..ad35988648 100644 --- a/wxPython/src/_sizers.i +++ b/wxPython/src/_sizers.i @@ -1365,9 +1365,7 @@ previously). Argument *mode* can be one of the following values: growable or not in the flexbile direction. ========================== ================================================= -Note that this method does not trigger relayout. - -", ""); +Note that this method does not trigger relayout.", ""); DocDeclStr( wxFlexSizerGrowMode , GetNonFlexibleGrowMode(), @@ -1390,6 +1388,12 @@ rows in the sizer.", ""); "Returns a list of integers representing the widths of each of the columns in the sizer.", ""); + + %property(ColWidths, GetColWidths, doc="See `GetColWidths`"); + %property(FlexibleDirection, GetFlexibleDirection, SetFlexibleDirection, doc="See `GetFlexibleDirection` and `SetFlexibleDirection`"); + %property(NonFlexibleGrowMode, GetNonFlexibleGrowMode, SetNonFlexibleGrowMode, doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`"); + %property(RowHeights, GetRowHeights, doc="See `GetRowHeights`"); + }; //--------------------------------------------------------------------------- diff --git a/wxPython/src/_toplvl.i b/wxPython/src/_toplvl.i index 00f54823ce..e3d24ec192 100644 --- a/wxPython/src/_toplvl.i +++ b/wxPython/src/_toplvl.i @@ -318,6 +318,11 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + + %property(MenuBar, GetMenuBar, SetMenuBar, doc="See `GetMenuBar` and `SetMenuBar`"); + %property(StatusBar, GetStatusBar, SetStatusBar, doc="See `GetStatusBar` and `SetStatusBar`"); + %property(StatusBarPane, GetStatusBarPane, SetStatusBarPane, doc="See `GetStatusBarPane` and `SetStatusBarPane`"); + %property(ToolBar, GetToolBar, SetToolBar, doc="See `GetToolBar` and `SetToolBar`"); }; //--------------------------------------------------------------------------- -- 2.45.2