Added wxHyperlinkCtrl, wxPowerEvent, and lots of little things to

match changes made in wx.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39452 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-05-29 19:52:17 +00:00
parent 9e89f049b8
commit d0e2ede057
15 changed files with 630 additions and 378 deletions

View File

@@ -153,6 +153,16 @@ to OpenEditor to send the BEGIN_LABEL_EDIT event and to not allow the
opening of the editor to continue if the event handler doesn't allow opening of the editor to continue if the event handler doesn't allow
it. it.
wx.StaticBoxSizer now keeps better track of the wx.StaticBox, and it
will destroy it if the sizer is destroyed before the parent window is.
Added wx.HyperlinkCtrl.
Added battery and power related functions and events (wxMSW only so
far.) See wx.PowerEvent, wx.GetPowerType and wx.GetBatteryState.
Added wx.ListCtrl.HitTestSubItem which returns the sub-item that was
hit (if any) in addition to the item and flags.

View File

@@ -30,48 +30,48 @@ DocStr(wxColourData,
"This class holds a variety of information related to the colour "This class holds a variety of information related to the colour
chooser dialog, used to transfer settings and results to and from the chooser dialog, used to transfer settings and results to and from the
`wx.ColourDialog`.", ""); `wx.ColourDialog`.", "");
class wxColourData : public wxObject { class wxColourData : public wxObject {
public: public:
DocCtorStr( DocCtorStr(
wxColourData(), wxColourData(),
"Constructor, sets default values.", ""); "Constructor, sets default values.", "");
~wxColourData(); ~wxColourData();
DocDeclStr( DocDeclStr(
bool , GetChooseFull(), bool , GetChooseFull(),
"Under Windows, determines whether the Windows colour dialog will "Under Windows, determines whether the Windows colour dialog will
display the full dialog with custom colour selection controls. Has no display the full dialog with custom colour selection controls. Has no
meaning under other platforms. The default value is true.", ""); meaning under other platforms. The default value is true.", "");
DocDeclStr( DocDeclStr(
wxColour , GetColour(), wxColour , GetColour(),
"Gets the colour (pre)selected by the dialog.", ""); "Gets the colour (pre)selected by the dialog.", "");
DocDeclStr( DocDeclStr(
wxColour , GetCustomColour(int i), wxColour , GetCustomColour(int i),
"Gets the i'th custom colour associated with the colour dialog. i "Gets the i'th custom colour associated with the colour dialog. i
should be an integer between 0 and 15. The default custom colours are should be an integer between 0 and 15. The default custom colours are
all invalid colours.", ""); all invalid colours.", "");
DocDeclStr( DocDeclStr(
void , SetChooseFull(int flag), void , SetChooseFull(int flag),
"Under Windows, tells the Windows colour dialog to display the full "Under Windows, tells the Windows colour dialog to display the full
dialog with custom colour selection controls. Under other platforms, dialog with custom colour selection controls. Under other platforms,
has no effect. The default value is true.", ""); has no effect. The default value is true.", "");
DocDeclStr( DocDeclStr(
void , SetColour(const wxColour& colour), void , SetColour(const wxColour& colour),
"Sets the default colour for the colour dialog. The default colour is "Sets the default colour for the colour dialog. The default colour is
black.", ""); black.", "");
DocDeclStr( DocDeclStr(
void , SetCustomColour(int i, const wxColour& colour), void , SetCustomColour(int i, const wxColour& colour),
"Sets the i'th custom colour for the colour dialog. i should be an "Sets the i'th custom colour for the colour dialog. i should be an
integer between 0 and 15. The default custom colours are all invalid colours.", ""); integer between 0 and 15. The default custom colours are all invalid colours.", "");
}; };
@@ -105,6 +105,11 @@ wxColour wxGetColourFromUser(wxWindow *parent = (wxWindow *)NULL,
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
enum {
wxDD_NEW_DIR_BUTTON,
wxDD_DEFAULT_STYLE,
wxDD_CHANGE_DIR,
};
DocStr(wxDirDialog, DocStr(wxDirDialog,
"wx.DirDialog allows the user to select a directory by browising the "wx.DirDialog allows the user to select a directory by browising the
@@ -113,10 +118,17 @@ file system.", "
Window Styles Window Styles
-------------- --------------
==================== ========================================== ==================== ==========================================
wx.DD_DEFAULT_STYLE Equivalent to a combination of
wx.DEFAULT_DIALOG_STYLE, wx.DD_NEW_DIR_BUTTON
and wx.RESIZE_BORDER.
wx.DD_NEW_DIR_BUTTON Add 'Create new directory' button and allow wx.DD_NEW_DIR_BUTTON Add 'Create new directory' button and allow
directory names to be editable. On Windows directory names to be editable. On Windows
the new directory button is only available the new directory button is only available
with recent versions of the common dialogs. with recent versions of the common dialogs.
wx.DD_CHANGE_DIR Change the current working directory to the
directory chosen by the user.
==================== ========================================== ==================== ==========================================
"); ");
@@ -126,12 +138,12 @@ class wxDirDialog : public wxDialog {
public: public:
%pythonAppend wxDirDialog "self._setOORInfo(self)" %pythonAppend wxDirDialog "self._setOORInfo(self)"
%pythonAppend wxDirDialog() "" %pythonAppend wxDirDialog() ""
DocCtorStr( DocCtorStr(
wxDirDialog(wxWindow* parent, wxDirDialog(wxWindow* parent,
const wxString& message = wxPyDirSelectorPromptStr, const wxString& message = wxPyDirSelectorPromptStr,
const wxString& defaultPath = wxPyEmptyString, const wxString& defaultPath = wxPyEmptyString,
long style = 0, long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
const wxString& name = wxPyDirDialogNameStr), const wxString& name = wxPyDirDialogNameStr),
@@ -150,24 +162,43 @@ public:
DocDeclStr( DocDeclStr(
wxString , GetPath(), wxString , GetPath(),
"Returns the default or user-selected path.", ""); "Returns the default or user-selected path.", "");
DocDeclStr( DocDeclStr(
wxString , GetMessage(), wxString , GetMessage(),
"Returns the message that will be displayed on the dialog.", ""); "Returns the message that will be displayed on the dialog.", "");
DocDeclStr( DocDeclStr(
void , SetMessage(const wxString& message), void , SetMessage(const wxString& message),
"Sets the message that will be displayed on the dialog.", ""); "Sets the message that will be displayed on the dialog.", "");
DocDeclStr( DocDeclStr(
void , SetPath(const wxString& path), void , SetPath(const wxString& path),
"Sets the default path.", ""); "Sets the default path.", "");
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
enum {
// These will dissappear in 2.8
wxOPEN,
wxSAVE,
wxHIDE_READONLY,
wxOVERWRITE_PROMPT,
wxFILE_MUST_EXIST,
wxMULTIPLE,
wxCHANGE_DIR,
wxFD_OPEN,
wxFD_SAVE,
wxFD_OVERWRITE_PROMPT,
wxFD_FILE_MUST_EXIST,
wxFD_MULTIPLE,
wxFD_CHANGE_DIR,
wxFD_DEFAULT_STYLE,
};
DocStr(wxFileDialog, DocStr(wxFileDialog,
"wx.FileDialog allows the user to select one or more files from the "wx.FileDialog allows the user to select one or more files from the
filesystem.", " filesystem.", "
@@ -191,24 +222,21 @@ types of file with a description for each, such as::
Window Styles Window Styles
-------------- --------------
=================== ========================================== ====================== ==========================================
wx.OPEN This is an open dialog. wx.FD_OPEN This is an open dialog.
wx.SAVE This is a save dialog. wx.FD_SAVE This is a save dialog.
wx.HIDE_READONLY For open dialog only: hide the checkbox wx.FD_OVERWRITE_PROMPT For save dialog only: prompt for a confirmation
allowing to open the file in read-only mode. if a file will be overwritten.
wx.OVERWRITE_PROMPT For save dialog only: prompt for a confirmation wx.FD_MULTIPLE For open dialog only: allows selecting multiple
if a file will be overwritten. files.
wx.MULTIPLE For open dialog only: allows selecting multiple wx.FD_CHANGE_DIR Change the current working directory to the
files. directory where the file(s) chosen by the user
are.
wx.CHANGE_DIR Change the current working directory to the ====================== ==========================================
directory where the file(s) chosen by the user
are.
=================== ==========================================
"); ");
@@ -225,7 +253,7 @@ public:
const wxString& defaultDir = wxPyEmptyString, const wxString& defaultDir = wxPyEmptyString,
const wxString& defaultFile = wxPyEmptyString, const wxString& defaultFile = wxPyEmptyString,
const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr, const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
long style = 0, long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition), const wxPoint& pos = wxDefaultPosition),
"Constructor. Use ShowModal method to show the dialog.", ""); "Constructor. Use ShowModal method to show the dialog.", "");
@@ -233,20 +261,20 @@ public:
DocDeclStr( DocDeclStr(
void , SetMessage(const wxString& message), void , SetMessage(const wxString& message),
"Sets the message that will be displayed on the dialog.", ""); "Sets the message that will be displayed on the dialog.", "");
DocDeclStr( DocDeclStr(
void , SetPath(const wxString& path), void , SetPath(const wxString& path),
"Sets the path (the combined directory and filename that will be "Sets the path (the combined directory and filename that will be
returned when the dialog is dismissed).", ""); returned when the dialog is dismissed).", "");
DocDeclStr( DocDeclStr(
void , SetDirectory(const wxString& dir), void , SetDirectory(const wxString& dir),
"Sets the default directory.", ""); "Sets the default directory.", "");
DocDeclStr( DocDeclStr(
void , SetFilename(const wxString& name), void , SetFilename(const wxString& name),
"Sets the default filename.", ""); "Sets the default filename.", "");
DocDeclStr( DocDeclStr(
void , SetWildcard(const wxString& wildCard), void , SetWildcard(const wxString& wildCard),
"Sets the wildcard, which can contain multiple file types, for "Sets the wildcard, which can contain multiple file types, for
@@ -254,39 +282,39 @@ example::
\"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif\" \"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif\"
", ""); ", "");
DocDeclStr( DocDeclStr(
void , SetStyle(long style), void , SetStyle(long style),
"Sets the dialog style.", ""); "Sets the dialog style.", "");
DocDeclStr( DocDeclStr(
void , SetFilterIndex(int filterIndex), void , SetFilterIndex(int filterIndex),
"Sets the default filter index, starting from zero.", ""); "Sets the default filter index, starting from zero.", "");
DocDeclStr( DocDeclStr(
wxString , GetMessage() const, wxString , GetMessage() const,
"Returns the message that will be displayed on the dialog.", ""); "Returns the message that will be displayed on the dialog.", "");
DocDeclStr( DocDeclStr(
wxString , GetPath() const, wxString , GetPath() const,
"Returns the full path (directory and filename) of the selected file.", ""); "Returns the full path (directory and filename) of the selected file.", "");
DocDeclStr( DocDeclStr(
wxString , GetDirectory() const, wxString , GetDirectory() const,
"Returns the default directory.", ""); "Returns the default directory.", "");
DocDeclStr( DocDeclStr(
wxString , GetFilename() const, wxString , GetFilename() const,
"Returns the default filename.", ""); "Returns the default filename.", "");
DocDeclStr( DocDeclStr(
wxString , GetWildcard() const, wxString , GetWildcard() const,
"Returns the file dialog wildcard.", ""); "Returns the file dialog wildcard.", "");
DocDeclStr( DocDeclStr(
long , GetStyle() const, long , GetStyle() const,
"Returns the dialog style.", ""); "Returns the dialog style.", "");
DocDeclStr( DocDeclStr(
int , GetFilterIndex() const, int , GetFilterIndex() const,
"Returns the index into the list of filters supplied, optionally, in "Returns the index into the list of filters supplied, optionally, in
@@ -309,8 +337,8 @@ GetFilename for the others.", "");
DocStr(GetPaths, DocStr(GetPaths,
"Fills the array paths with the full paths of the files chosen. This "Fills the array paths with the full paths of the files chosen. This
function should only be used with the dialogs which have wx.MULTIPLE function should only be used with the dialogs which have wx.MULTIPLE
style, use GetPath for the others.", ""); style, use GetPath for the others.", "");
PyObject* GetPaths() { PyObject* GetPaths() {
wxArrayString arr; wxArrayString arr;
self->GetPaths(arr); self->GetPaths(arr);
@@ -379,7 +407,7 @@ public:
", ""); ", "");
DocDeclAStr( DocDeclAStr(
void, SetSelections(const wxArrayInt& selections), void, SetSelections(const wxArrayInt& selections),
"SetSelections(List selections)", "SetSelections(List selections)",
@@ -434,11 +462,11 @@ public:
DocDeclStr( DocDeclStr(
int , GetSelection(), int , GetSelection(),
"Get the index of teh currently selected item.", ""); "Get the index of teh currently selected item.", "");
DocDeclStr( DocDeclStr(
wxString , GetStringSelection(), wxString , GetStringSelection(),
"Returns the string value of the currently selected item", ""); "Returns the string value of the currently selected item", "");
DocDeclStr( DocDeclStr(
void , SetSelection(int sel), void , SetSelection(int sel),
"Set the current selected item to sel", ""); "Set the current selected item to sel", "");
@@ -471,7 +499,7 @@ public:
wxString , GetValue(), wxString , GetValue(),
"Returns the text that the user has entered if the user has pressed OK, "Returns the text that the user has entered if the user has pressed OK,
or the original value if the user has pressed Cancel.", ""); or the original value if the user has pressed Cancel.", "");
DocDeclStr( DocDeclStr(
void , SetValue(const wxString& value), void , SetValue(const wxString& value),
"Sets the default text value.", ""); "Sets the default text value.", "");
@@ -510,60 +538,60 @@ public:
"Enables or disables 'effects' under MS Windows only. This refers to "Enables or disables 'effects' under MS Windows only. This refers to
the controls for manipulating colour, strikeout and underline the controls for manipulating colour, strikeout and underline
properties. The default value is true.", ""); properties. The default value is true.", "");
DocDeclStr( DocDeclStr(
bool , GetAllowSymbols(), bool , GetAllowSymbols(),
"Under MS Windows, returns a flag determining whether symbol fonts can "Under MS Windows, returns a flag determining whether symbol fonts can
be selected. Has no effect on other platforms. The default value is be selected. Has no effect on other platforms. The default value is
true.", ""); true.", "");
DocDeclStr( DocDeclStr(
wxColour , GetColour(), wxColour , GetColour(),
"Gets the colour associated with the font dialog. The default value is "Gets the colour associated with the font dialog. The default value is
black.", ""); black.", "");
DocDeclStr( DocDeclStr(
wxFont , GetChosenFont(), wxFont , GetChosenFont(),
"Gets the font chosen by the user.", ""); "Gets the font chosen by the user.", "");
DocDeclStr( DocDeclStr(
bool , GetEnableEffects(), bool , GetEnableEffects(),
"Determines whether 'effects' are enabled under Windows.", ""); "Determines whether 'effects' are enabled under Windows.", "");
DocDeclStr( DocDeclStr(
wxFont , GetInitialFont(), wxFont , GetInitialFont(),
"Gets the font that will be initially used by the font dialog. This "Gets the font that will be initially used by the font dialog. This
should have previously been set by the application.", ""); should have previously been set by the application.", "");
DocDeclStr( DocDeclStr(
bool , GetShowHelp(), bool , GetShowHelp(),
"Returns true if the Help button will be shown (Windows only). The "Returns true if the Help button will be shown (Windows only). The
default value is false.", ""); default value is false.", "");
DocDeclStr( DocDeclStr(
void , SetAllowSymbols(bool allowSymbols), void , SetAllowSymbols(bool allowSymbols),
"Under MS Windows, determines whether symbol fonts can be selected. Has "Under MS Windows, determines whether symbol fonts can be selected. Has
no effect on other platforms. The default value is true.", ""); no effect on other platforms. The default value is true.", "");
DocDeclStr( DocDeclStr(
void , SetChosenFont(const wxFont& font), void , SetChosenFont(const wxFont& font),
"Sets the font that will be returned to the user (normally for internal "Sets the font that will be returned to the user (normally for internal
use only).", ""); use only).", "");
DocDeclStr( DocDeclStr(
void , SetColour(const wxColour& colour), void , SetColour(const wxColour& colour),
"Sets the colour that will be used for the font foreground colour. The "Sets the colour that will be used for the font foreground colour. The
default colour is black.", ""); default colour is black.", "");
DocDeclStr( DocDeclStr(
void , SetInitialFont(const wxFont& font), void , SetInitialFont(const wxFont& font),
"Sets the font that will be initially used by the font dialog.", ""); "Sets the font that will be initially used by the font dialog.", "");
DocDeclStr( DocDeclStr(
void , SetRange(int min, int max), void , SetRange(int min, int max),
"Sets the valid range for the font point size (Windows only). The "Sets the valid range for the font point size (Windows only). The
default is 0, 0 (unrestricted range).", ""); default is 0, 0 (unrestricted range).", "");
DocDeclStr( DocDeclStr(
void , SetShowHelp(bool showHelp), void , SetShowHelp(bool showHelp),
"Determines whether the Help button will be displayed in the font "Determines whether the Help button will be displayed in the font
@@ -592,11 +620,11 @@ the dialog. If ShowModal returns ``wx.ID_OK`` then you can fetch the
results with via the `wx.FontData` returned by `GetFontData`.", ""); results with via the `wx.FontData` returned by `GetFontData`.", "");
wxFontDialog(wxWindow* parent, const wxFontData& data); wxFontDialog(wxWindow* parent, const wxFontData& data);
DocDeclStr( DocDeclStr(
wxFontData& , GetFontData(), wxFontData& , GetFontData(),
"Returns a reference to the internal `wx.FontData` used by the "Returns a reference to the internal `wx.FontData` used by the
wx.FontDialog.", ""); wx.FontDialog.", "");
}; };
@@ -638,7 +666,7 @@ MustHaveApp(wxMessageDialog);
class wxMessageDialog : public wxDialog { class wxMessageDialog : public wxDialog {
public: public:
%pythonAppend wxMessageDialog "self._setOORInfo(self)" %pythonAppend wxMessageDialog "self._setOORInfo(self)"
DocCtorStr( DocCtorStr(
wxMessageDialog(wxWindow* parent, wxMessageDialog(wxWindow* parent,
const wxString& message, const wxString& message,
@@ -731,12 +759,12 @@ If the ``continue`` return value is ``false``, the application can either
immediately destroy the dialog or ask the user for confirmation, and if the immediately destroy the dialog or ask the user for confirmation, and if the
abort is not confirmed the dialog may be resumed with `Resume` function. abort is not confirmed the dialog may be resumed with `Resume` function.
", ""); ", "");
DocDeclStr( DocDeclStr(
void , Resume(), void , Resume(),
"Can be used to continue with the dialog, after the user had chosen to "Can be used to continue with the dialog, after the user had chosen to
abort.", ""); abort.", "");
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@@ -786,11 +814,11 @@ EVT_FIND_REPLACE_ALL = wx.PyEventBinder( wxEVT_COMMAND_FIND_REPLACE_ALL, 1 )
EVT_FIND_CLOSE = wx.PyEventBinder( wxEVT_COMMAND_FIND_CLOSE, 1 ) EVT_FIND_CLOSE = wx.PyEventBinder( wxEVT_COMMAND_FIND_CLOSE, 1 )
%# For backwards compatibility. Should they be removed? %# For backwards compatibility. Should they be removed?
EVT_COMMAND_FIND = EVT_FIND EVT_COMMAND_FIND = EVT_FIND
EVT_COMMAND_FIND_NEXT = EVT_FIND_NEXT EVT_COMMAND_FIND_NEXT = EVT_FIND_NEXT
EVT_COMMAND_FIND_REPLACE = EVT_FIND_REPLACE EVT_COMMAND_FIND_REPLACE = EVT_FIND_REPLACE
EVT_COMMAND_FIND_REPLACE_ALL = EVT_FIND_REPLACE_ALL EVT_COMMAND_FIND_REPLACE_ALL = EVT_FIND_REPLACE_ALL
EVT_COMMAND_FIND_CLOSE = EVT_FIND_CLOSE EVT_COMMAND_FIND_CLOSE = EVT_FIND_CLOSE
} }
@@ -801,33 +829,33 @@ class wxFindDialogEvent : public wxCommandEvent
{ {
public: public:
wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0); wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
DocDeclStr( DocDeclStr(
int , GetFlags(), int , GetFlags(),
"Get the currently selected flags: this is the combination of "Get the currently selected flags: this is the combination of
wx.FR_DOWN, wx.FR_WHOLEWORD and wx.FR_MATCHCASE flags.", ""); wx.FR_DOWN, wx.FR_WHOLEWORD and wx.FR_MATCHCASE flags.", "");
DocDeclStr( DocDeclStr(
const wxString& , GetFindString(), const wxString& , GetFindString(),
"Return the string to find (never empty).", ""); "Return the string to find (never empty).", "");
DocDeclStr( DocDeclStr(
const wxString& , GetReplaceString(), const wxString& , GetReplaceString(),
"Return the string to replace the search string with (only for replace "Return the string to replace the search string with (only for replace
and replace all events).", ""); and replace all events).", "");
DocDeclStr( DocDeclStr(
wxFindReplaceDialog *, GetDialog(), wxFindReplaceDialog *, GetDialog(),
"Return the pointer to the dialog which generated this event.", ""); "Return the pointer to the dialog which generated this event.", "");
DocDeclStr( DocDeclStr(
void , SetFlags(int flags), void , SetFlags(int flags),
"", ""); "", "");
DocDeclStr( DocDeclStr(
void , SetFindString(const wxString& str), void , SetFindString(const wxString& str),
"", ""); "", "");
DocDeclStr( DocDeclStr(
void , SetReplaceString(const wxString& str), void , SetReplaceString(const wxString& str),
"", ""); "", "");
@@ -835,7 +863,7 @@ and replace all events).", "");
DocStr(wxFindReplaceData, DocStr(wxFindReplaceData,
"wx.FindReplaceData holds the data for wx.FindReplaceDialog. It is used "wx.FindReplaceData holds the data for wx.FindReplaceDialog. It is used
to initialize the dialog with the default values and will keep the to initialize the dialog with the default values and will keep the
last values from the dialog when it is closed. It is also updated each last values from the dialog when it is closed. It is also updated each
@@ -847,7 +875,7 @@ dialog and calling them has no effect later.", "
Flags Flags
----- -----
================ =============================================== ================ ===============================================
wx.FR_DOWN Downward search/replace selected (otherwise, wx.FR_DOWN Downward search/replace selected (otherwise,
upwards) upwards)
@@ -855,7 +883,7 @@ Flags
wx.FR_MATCHCASE Case sensitive search/replace selected wx.FR_MATCHCASE Case sensitive search/replace selected
(otherwise, case insensitive) (otherwise, case insensitive)
================ =============================================== ================ ===============================================
"); ");
@@ -867,34 +895,34 @@ public:
DocCtorStr( DocCtorStr(
wxFindReplaceData(int flags=0), wxFindReplaceData(int flags=0),
"Constuctor initializes the flags to default value (0).", ""); "Constuctor initializes the flags to default value (0).", "");
~wxFindReplaceData(); ~wxFindReplaceData();
DocDeclStr( DocDeclStr(
const wxString& , GetFindString(), const wxString& , GetFindString(),
"Get the string to find.", ""); "Get the string to find.", "");
DocDeclStr( DocDeclStr(
const wxString& , GetReplaceString(), const wxString& , GetReplaceString(),
"Get the replacement string.", ""); "Get the replacement string.", "");
DocDeclStr( DocDeclStr(
int , GetFlags(), int , GetFlags(),
"Get the combination of flag values.", ""); "Get the combination of flag values.", "");
DocDeclStr( DocDeclStr(
void , SetFlags(int flags), void , SetFlags(int flags),
"Set the flags to use to initialize the controls of the dialog.", ""); "Set the flags to use to initialize the controls of the dialog.", "");
DocDeclStr( DocDeclStr(
void , SetFindString(const wxString& str), void , SetFindString(const wxString& str),
"Set the string to find (used as initial value by the dialog).", ""); "Set the string to find (used as initial value by the dialog).", "");
DocDeclStr( DocDeclStr(
void , SetReplaceString(const wxString& str), void , SetReplaceString(const wxString& str),
"Set the replacement string (used as initial value by the dialog).", ""); "Set the replacement string (used as initial value by the dialog).", "");
}; };
@@ -944,21 +972,21 @@ non-None. Use Show to display the dialog.", "");
"Precreate a FindReplaceDialog for 2-phase creation", "", "Precreate a FindReplaceDialog for 2-phase creation", "",
PreFindReplaceDialog); PreFindReplaceDialog);
DocDeclStr( DocDeclStr(
bool , Create(wxWindow *parent, wxFindReplaceData *data, bool , Create(wxWindow *parent, wxFindReplaceData *data,
const wxString &title, int style = 0), const wxString &title, int style = 0),
"Create the dialog, for 2-phase create.", ""); "Create the dialog, for 2-phase create.", "");
DocDeclStr( DocDeclStr(
const wxFindReplaceData *, GetData(), const wxFindReplaceData *, GetData(),
"Get the FindReplaceData object used by this dialog.", ""); "Get the FindReplaceData object used by this dialog.", "");
DocDeclStr( DocDeclStr(
void , SetData(wxFindReplaceData *data), void , SetData(wxFindReplaceData *data),
"Set the FindReplaceData object used by this dialog.", ""); "Set the FindReplaceData object used by this dialog.", "");
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@@ -679,14 +679,6 @@ enum {
wxID_HIGHEST, wxID_HIGHEST,
wxOPEN,
wxSAVE,
wxHIDE_READONLY,
wxOVERWRITE_PROMPT,
wxFILE_MUST_EXIST,
wxMULTIPLE,
wxCHANGE_DIR,
wxACCEL_ALT, wxACCEL_ALT,
wxACCEL_CTRL, wxACCEL_CTRL,
wxACCEL_SHIFT, wxACCEL_SHIFT,
@@ -701,10 +693,6 @@ enum {
wxPD_SMOOTH, wxPD_SMOOTH,
wxPD_CAN_SKIP, wxPD_CAN_SKIP,
wxDD_NEW_DIR_BUTTON,
wxDD_DEFAULT_STYLE,
wxDD_CHANGE_DIR,
wxMENU_TEAROFF, wxMENU_TEAROFF,
wxMB_DOCKABLE, wxMB_DOCKABLE,
wxNO_FULL_REPAINT_ON_RESIZE, wxNO_FULL_REPAINT_ON_RESIZE,

View File

@@ -86,7 +86,8 @@ public:
// Try to expand as much of the given path as possible. // Try to expand as much of the given path as possible.
virtual bool ExpandPath(const wxString& path); virtual bool ExpandPath(const wxString& path);
// collapse the path
virtual bool CollapsePath(const wxString& path);
virtual inline wxString GetDefaultPath() const; virtual inline wxString GetDefaultPath() const;
virtual void SetDefaultPath(const wxString& path); virtual void SetDefaultPath(const wxString& path);

File diff suppressed because it is too large Load Diff

View File

@@ -250,10 +250,18 @@ public:
void SetStyle(wxFontStyle style); void SetStyle(wxFontStyle style);
void SetWeight(wxFontWeight weight); void SetWeight(wxFontWeight weight);
void SetUnderlined(bool underlined); void SetUnderlined(bool underlined);
void SetFaceName(wxString facename); bool SetFaceName(wxString facename);
void SetFamily(wxFontFamily family); void SetFamily(wxFontFamily family);
void SetEncoding(wxFontEncoding encoding); void SetEncoding(wxFontEncoding encoding);
// TODO:
// // sets the first facename in the given array which is found
// // to be valid. If no valid facename is given, sets the
// // first valid facename returned by wxFontEnumerator::GetFacenames().
// // Does not return a bool since it cannot fail.
// void SetFaceName(const wxArrayString &facenames);
// it is important to be able to serialize wxNativeFontInfo objects to be // it is important to be able to serialize wxNativeFontInfo objects to be
// able to store them (in config file, for example) // able to store them (in config file, for example)
bool FromString(const wxString& s); bool FromString(const wxString& s);
@@ -734,7 +742,7 @@ size is found using a binary search.", "");
"Sets the font weight.", ""); "Sets the font weight.", "");
DocDeclStr( DocDeclStr(
virtual void , SetFaceName( const wxString& faceName ), virtual bool , SetFaceName( const wxString& faceName ),
"Sets the facename for the font. The facename, which should be a valid "Sets the facename for the font. The facename, which should be a valid
font installed on the end-user's system. font installed on the end-user's system.
@@ -758,13 +766,13 @@ then for a font belonging to the same family.", "");
DocDeclStrName( DocDeclStrName(
void , SetNativeFontInfo(const wxString& info), bool , SetNativeFontInfo(const wxString& info),
"Set the font's attributes from string representation of a "Set the font's attributes from string representation of a
`wx.NativeFontInfo` object.", "", `wx.NativeFontInfo` object.", "",
SetNativeFontInfoFromString); SetNativeFontInfoFromString);
DocDeclStr( DocDeclStr(
void , SetNativeFontInfoUserDesc(const wxString& info), bool , SetNativeFontInfoUserDesc(const wxString& info),
"Set the font's attributes from a string formerly returned from "Set the font's attributes from a string formerly returned from
`GetNativeFontInfoDesc`.", ""); `GetNativeFontInfoDesc`.", "");
@@ -838,33 +846,31 @@ public:
bool EnumerateEncodings(const wxString& facename = wxPyEmptyString); bool EnumerateEncodings(const wxString& facename = wxPyEmptyString);
//wxArrayString* GetEncodings();
//wxArrayString* GetFacenames();
%extend { %extend {
PyObject* GetEncodings() { static PyObject* GetEncodings() {
PyObject* ret; PyObject* ret;
wxArrayString* arr = self->GetEncodings(); wxArrayString arr = wxFontEnumerator::GetEncodings();
wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPyBlock_t blocked = wxPyBeginBlockThreads();
if (arr) ret = wxArrayString2PyList_helper(arr);
ret = wxArrayString2PyList_helper(*arr);
else
ret = PyList_New(0);
wxPyEndBlockThreads(blocked); wxPyEndBlockThreads(blocked);
return ret; return ret;
} }
PyObject* GetFacenames() { static PyObject* GetFacenames() {
PyObject* ret; PyObject* ret;
wxArrayString* arr = self->GetFacenames(); wxArrayString arr = wxFontEnumerator::GetFacenames();
wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPyBlock_t blocked = wxPyBeginBlockThreads();
if (arr) ret = wxArrayString2PyList_helper(arr);
ret = wxArrayString2PyList_helper(*arr);
else
ret = PyList_New(0);
wxPyEndBlockThreads(blocked); wxPyEndBlockThreads(blocked);
return ret; return ret;
} }
} }
DocDeclStr(
static bool , IsValidFacename(const wxString &str),
"Convenience function that returns true if the given face name exist in
the user's system", "");
}; };

View File

@@ -427,40 +427,5 @@ MustHaveApp(wxThread);
} }
%} %}
//---------------------------------------------------------------------------
// enum wxPowerType
// {
// wxPOWER_SOCKET,
// wxPOWER_BATTERY,
// wxPOWER_UNKNOWN
// };
// DocDeclStr(
// wxPowerType , wxGetPowerType(),
// "Returns the type of power source as one of wx.POWER_SOCKET,
// wx.POWER_BATTERY or wx.POWER_UNKNOWN. wx.POWER_UNKNOWN is also the
// default on platforms where this feature is not implemented.", "");
// enum wxBatteryState
// {
// wxBATTERY_NORMAL_STATE, // system is fully usable
// wxBATTERY_LOW_STATE, // start to worry
// wxBATTERY_CRITICAL_STATE, // save quickly
// wxBATTERY_SHUTDOWN_STATE, // too late
// wxBATTERY_UNKNOWN_STATE
// };
// DocDeclStr(
// wxBatteryState , wxGetBatteryState(),
// "Returns battery state as one of wx.BATTERY_NORMAL_STATE,
// wx.BATTERY_LOW_STATE}, wx.BATTERY_CRITICAL_STATE,
// wx.BATTERY_SHUTDOWN_STATE or wx.BATTERY_UNKNOWN_STATE.
// wx.BATTERY_UNKNOWN_STATE is also the default on platforms where this
// feature is not implemented.", "");
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

118
wxPython/src/_hyperlink.i Normal file
View File

@@ -0,0 +1,118 @@
/////////////////////////////////////////////////////////////////////////////
// Name: _hyperlink.i
// Purpose: SWIG interface defs for wxHyperlinkCtrl
//
// Author: Robin Dunn
//
// Created: 28-May-2006
// RCS-ID: $Id$
// Copyright: (c) 2006 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Not a %module
//---------------------------------------------------------------------------
%{
#include <wx/hyperlink.h>
%}
MAKE_CONST_WXSTRING(HyperlinkCtrlNameStr);
enum {
wxHL_CONTEXTMENU,
wxHL_DEFAULT_STYLE
};
//---------------------------------------------------------------------------
%newgroup
MustHaveApp(wxHyperlinkCtrl);
DocStr( wxHyperlinkCtrl,
"A static text control that emulates a hyperlink. The link is displayed
in an appropriate text style, derived from the control's normal font.
When the mouse rolls over the link, the cursor changes to a hand and
the link's color changes to the active color.
Clicking on the link does not launch a web browser; instead, a
wx.HyperlinkEvent is fired. Use the wx.EVT_HYPERLINK to catch link
events.
", "");
class wxHyperlinkCtrl : public wxControl
{
public:
%pythonAppend wxHyperlinkCtrl "self._setOORInfo(self)"
%pythonAppend wxHyperlinkCtrl() ""
// Constructor.
wxHyperlinkCtrl(wxWindow *parent,
wxWindowID id,
const wxString& label, const wxString& url,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHL_DEFAULT_STYLE,
const wxString& name = wxPyHyperlinkCtrlNameStr);
%RenameCtor(PreHyperlinkCtrl, wxHyperlinkCtrl());
// Creation function (for two-step construction).
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& label, const wxString& url,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHL_DEFAULT_STYLE,
const wxString& name = wxPyHyperlinkCtrlNameStr);
// get/set
wxColour GetHoverColour() const;
void SetHoverColour(const wxColour &colour);
wxColour GetNormalColour() const;
void SetNormalColour(const wxColour &colour);
wxColour GetVisitedColour() const;
void SetVisitedColour(const wxColour &colour);
wxString GetURL() const;
void SetURL (const wxString &url);
void SetVisited(bool visited = true);
bool GetVisited() const;
};
%constant wxEventType wxEVT_COMMAND_HYPERLINK;
//
// An event fired when the user clicks on the label in a hyperlink control.
// See HyperlinkControl for details.
//
class wxHyperlinkEvent : public wxCommandEvent
{
public:
wxHyperlinkEvent(wxObject *generator, wxWindowID id, const wxString& url);
// Returns the URL associated with the hyperlink control
// that the user clicked on.
wxString GetURL() const;
void SetURL(const wxString &url);
};
%pythoncode {
EVT_HYPERLINK = wx.PyEventBinder( wxEVT_COMMAND_HYPERLINK, 1 )
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

View File

@@ -84,6 +84,9 @@ enum {
wxLIST_HITTEST_TOLEFT, wxLIST_HITTEST_TOLEFT,
wxLIST_HITTEST_TORIGHT, wxLIST_HITTEST_TORIGHT,
wxLIST_HITTEST_ONITEM, wxLIST_HITTEST_ONITEM,
// GetSubItemRect constants
wxLIST_GETSUBITEMRECT_WHOLEITEM,
}; };
@@ -544,6 +547,13 @@ public:
self->GetItemRect(item, rect, code); self->GetItemRect(item, rect, code);
return rect; return rect;
} }
// MSW only so far...
// wxRect GetSubItemRect(long item, long subItem, int code = wxLIST_RECT_BOUNDS) {
// wxRect rect;
// self->GetSubItemRect(item, subItem, rect, code);
// return rect;
// }
} }
@@ -660,6 +670,15 @@ public:
"Determines which item (if any) is at the specified point, giving "Determines which item (if any) is at the specified point, giving
details in the second return value (see wx.LIST_HITTEST flags.)", ""); details in the second return value (see wx.LIST_HITTEST flags.)", "");
DocDeclAStrName(
long, HitTest(const wxPoint& point, int& OUTPUT, long* OUTPUT),
"HitTestSubItem(Point point) -> (item, where, subItem)",
"Determines which item (if any) is at the specified point, giving details in
the second return value (see wx.LIST_HITTEST flags) and also the subItem, if
any.", "",
HitTestSubItem);
// Inserts an item, returning the index of the new item if successful, // Inserts an item, returning the index of the new item if successful,
// -1 otherwise. // -1 otherwise.
long InsertItem(wxListItem& info); long InsertItem(wxListItem& info);

108
wxPython/src/_power.i Normal file
View File

@@ -0,0 +1,108 @@
/////////////////////////////////////////////////////////////////////////////
// Name: _power.i
// Purpose: SWIG interface for wx poser events and functions
//
// Author: Robin Dunn
//
// Created: 28-May-2006
// RCS-ID: $Id$
// Copyright: (c) 2006 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Not a %module
//---------------------------------------------------------------------------
%newgroup
%{
#include <wx/power.h>
%}
%{
#ifndef wxHAS_POWER_EVENTS
// Dummy class and other definitions for platforms that don't have them
class wxPowerEvent : public wxEvent
{
public:
wxPowerEvent(wxEventType evtType) : wxEvent(wxID_NONE, evtType) {}
void Veto() {}
bool IsVetoed() const { return false; }
virtual wxEvent *Clone() const { return new wxPowerEvent(*this); }
};
enum {
wxEVT_POWER_SUSPENDING,
wxEVT_POWER_SUSPENDED,
wxEVT_POWER_SUSPEND_CANCEL,
wxEVT_POWER_RESUME,
};
wxPowerType wxGetPowerType() { return wxPOWER_UNKNOWN; }
wxBatteryState wxGetBatteryState() { return wxBATTERY_UNKNOWN_STATE; }
#endif
%}
enum wxPowerType
{
wxPOWER_SOCKET,
wxPOWER_BATTERY,
wxPOWER_UNKNOWN
};
enum wxBatteryState
{
wxBATTERY_NORMAL_STATE, // system is fully usable
wxBATTERY_LOW_STATE, // start to worry
wxBATTERY_CRITICAL_STATE, // save quickly
wxBATTERY_SHUTDOWN_STATE, // too late
wxBATTERY_UNKNOWN_STATE
};
DocStr(wxPowerEvent,
"wx.PowerEvent is generated when the system online status changes.
Currently this is only implemented for Windows.",
"");
class wxPowerEvent : public wxEvent
{
public:
wxPowerEvent(wxEventType evtType);
// Veto the operation (only makes sense with EVT_POWER_SUSPENDING)
void Veto();
bool IsVetoed() const;
};
%constant wxEventType wxEVT_POWER_SUSPENDING;
%constant wxEventType wxEVT_POWER_SUSPENDED;
%constant wxEventType wxEVT_POWER_SUSPEND_CANCEL;
%constant wxEventType wxEVT_POWER_RESUME;
%pythoncode {
EVT_POWER_SUSPENDING = wx.PyEventBinder( wxEVT_POWER_SUSPENDING , 1 )
EVT_POWER_SUSPENDED = wx.PyEventBinder( wxEVT_POWER_SUSPENDED , 1 )
EVT_POWER_SUSPEND_CANCEL = wx.PyEventBinder( wxEVT_POWER_SUSPEND_CANCEL , 1 )
EVT_POWER_RESUME = wx.PyEventBinder( wxEVT_POWER_RESUME , 1 )
}
DocDeclStr(
wxPowerType , wxGetPowerType(),
"return the current system power state: online or offline", "");
DocDeclStr(
wxBatteryState , wxGetBatteryState(),
"return approximate battery state", "");
//---------------------------------------------------------------------------

View File

@@ -43,6 +43,7 @@ enum {
wxTB_NOALIGN, wxTB_NOALIGN,
wxTB_HORZ_LAYOUT, wxTB_HORZ_LAYOUT,
wxTB_HORZ_TEXT, wxTB_HORZ_TEXT,
wxTB_NO_TOOLTIPS,
}; };

View File

@@ -980,9 +980,18 @@ functions so should not be required by the application programmer.", "");
"Removes a child window. This is called automatically by window "Removes a child window. This is called automatically by window
deletion functions so should not be required by the application deletion functions so should not be required by the application
programmer.", ""); programmer.", "");
DocStr(SetDoubleBuffered,
"Currently wxGTK2 only.", "");
#ifdef __WXGTK__
void SetDoubleBuffered(bool on);
#else
%extend {
void SetDoubleBuffered(bool on) {}
}
#endif
// looking for windows // looking for windows
// ------------------- // -------------------

View File

@@ -59,7 +59,7 @@ MAKE_CONST_WXSTRING_NOSWIG(ControlNameStr);
%include _cshelp.i %include _cshelp.i
%include _dragimg.i %include _dragimg.i
%include _datectrl.i %include _datectrl.i
%include _hyperlink.i
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@@ -1146,10 +1146,8 @@ public:
const wxString& normal_face = wxPyEmptyString, const wxString& normal_face = wxPyEmptyString,
const wxString& fixed_face = wxPyEmptyString); const wxString& fixed_face = wxPyEmptyString);
int Render(int x, int y, int from = 0, int dont_render = false, int maxHeight = INT_MAX, int Render(int x, int y, wxArrayInt& known_pagebreaks, int from = 0,
//int *known_pagebreaks = NULL, int number_of_pages = 0 int dont_render = FALSE, int to = INT_MAX);
int* choices=NULL, int LCOUNT = 0
);
int GetTotalHeight(); int GetTotalHeight();
// returns total height of the html document // returns total height of the html document
// (compare Render's return value with this) // (compare Render's return value with this)

View File

@@ -48,5 +48,6 @@ MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
%include _clipbrd.i %include _clipbrd.i
%include _display.i %include _display.i
%include _stdpaths.i %include _stdpaths.i
%include _power.i
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------