Forward port recent changes on the 2.8 branch to HEAD

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2007-05-16 23:39:42 +00:00
parent f6342fb5e6
commit 0b0849b5a5
87 changed files with 3807 additions and 1586 deletions

View File

@@ -112,6 +112,11 @@ call this function to process posted events. This normally happens
during each event loop iteration.", "");
DocDeclStr(
bool , HasPendingEvents() const,
"Check if there are pending events on global pending event list", "");
DocDeclStr(
virtual bool, Yield(bool onlyIfNeeded = false),
"Process all currently pending events right now, instead of waiting

View File

@@ -630,7 +630,7 @@ works for single line strings.", "");
DocDeclAStrName(
void, GetTextExtent(const wxString& string,
wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord* OUTPUT,
wxFont* font = NULL),
const wxFont* font = NULL),
"GetFullTextExtent(wxString string, Font font=None) ->\n (width, height, descent, externalLeading)",
"Get the width, height, decent and leading of the text using the
current or specified font. Only works for single line strings.", "",
@@ -641,7 +641,7 @@ current or specified font. Only works for single line strings.", "",
DocDeclAStr(
void, GetMultiLineTextExtent(const wxString& text,
wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT,
wxFont *font = NULL),
const wxFont *font = NULL),
"GetMultiLineTextExtent(wxString string, Font font=None) ->\n (width, height, lineHeight)",
"Get the width, height, and line height of the text using the
current or specified font. Works for single as well as multi-line

View File

@@ -1162,6 +1162,7 @@ enum wxItemKind
wxITEM_NORMAL,
wxITEM_CHECK,
wxITEM_RADIO,
wxITEM_DROPDOWN,
wxITEM_MAX
};

View File

@@ -61,6 +61,7 @@ wxEventType wxNewEventType();
%constant wxEventType wxEVT_COMMAND_COMBOBOX_SELECTED;
%constant wxEventType wxEVT_COMMAND_TOOL_RCLICKED;
%constant wxEventType wxEVT_COMMAND_TOOL_ENTER;
%constant wxEventType wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED;
// Mouse event types
%constant wxEventType wxEVT_LEFT_DOWN;
@@ -354,6 +355,7 @@ EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
EVT_TOOL_DROPDOWN = wx.PyEventBinder( wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, 1)
EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)

View File

@@ -23,15 +23,17 @@
#if 0 // #ifdef __WXMAC__
// A dummy class that raises an exception if used...
class wxEventLoop
class wxEventLoopBase
{
public:
wxEventLoop() { wxPyRaiseNotImplemented(); }
wxEventLoopBase() { wxPyRaiseNotImplemented(); }
bool IsOk() const { return false; }
int Run() { return 0; }
void Exit(int rc = 0) {}
bool Pending() const { return false; }
bool Dispatch() { return false; }
bool IsRunning() const { return false; }
void WakeUp() {}
static wxEventLoop *GetActive() { wxPyRaiseNotImplemented(); return NULL; }
static void SetActive(wxEventLoop* loop) { wxPyRaiseNotImplemented(); }
};
@@ -43,12 +45,16 @@ public:
#endif
%}
class wxEventLoop
class wxEventLoopBase
{
public:
wxEventLoop();
wxEventLoopBase();
virtual ~wxEventLoop();
// use this to check whether the event loop was successfully created before
// using it
virtual bool IsOk() const;
// start the event loop, return the exit code when it is finished
virtual int Run();
@@ -64,6 +70,8 @@ public:
// is the event loop running now?
virtual bool IsRunning() const;
virtual void WakeUp();
// return currently active (running) event loop, may be NULL
static wxEventLoop *GetActive();
@@ -72,6 +80,34 @@ public:
};
class wxEventLoopManual : public wxEventLoopBase
{
public:
wxEventLoopManual();
};
class wxGUIEventLoop : public wxEventLoopBase
{
public:
wxGUIEventLoop();
};
%pythoncode {
class EventLoop(GUIEventLoop):
"""Class using the old name for compatibility."""
pass
}
class wxModalEventLoop : public wxGUIEventLoop
{
public:
wxModalEventLoop(wxWindow *winModal)
};
// This object sets the wxEventLoop given to the ctor as the currently active
// one and unsets it in its dtor, this is especially useful in presence of

View File

@@ -337,8 +337,14 @@ MustHaveApp(wxGetTopLevelParent);
wxWindow* wxGetTopLevelParent(wxWindow *win);
// flags for wxLaunchDefaultBrowser
enum
{
wxBROWSER_NEW_WINDOW = 1
};
DocDeclStr(
bool , wxLaunchDefaultBrowser(const wxString& url),
bool , wxLaunchDefaultBrowser(const wxString& url, int flags = 0),
"Launches the user's default browser and tells it to open the location
at ``url``. Returns ``True`` if the application was successfully
launched.", "");

View File

@@ -240,7 +240,7 @@ public:
wxPyPanel(wxWindow* parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
const wxString& name = wxPyPanelNameStr)
: wxPanel(parent, id, pos, size, style, name) {}
@@ -334,7 +334,7 @@ public:
wxPyPanel(wxWindow* parent, const wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
const wxString& name = wxPyPanelNameStr);
%RenameCtor(PrePyPanel, wxPyPanel());
@@ -415,7 +415,7 @@ public:
wxPyScrolledWindow(wxWindow* parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
long style = wxHSCROLL | wxVSCROLL,
const wxString& name = wxPyPanelNameStr)
: wxScrolledWindow(parent, id, pos, size, style, name) {}
@@ -508,7 +508,7 @@ public:
wxPyScrolledWindow(wxWindow* parent, const wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
long style = wxHSCROLL | wxVSCROLL,
const wxString& name = wxPyPanelNameStr);
%RenameCtor(PrePyScrolledWindow, wxPyScrolledWindow());

View File

@@ -33,7 +33,15 @@ enum wxSoundFlags
%{
#if !wxUSE_SOUND
// A C++ stub class for wxWave for platforms that don't have it.
// A C++ stub class for wxSound for platforms that don't have it.
enum wxSoundFlags
{
wxSOUND_SYNC,
wxSOUND_ASYNC,
wxSOUND_LOOP
};
class wxSound : public wxObject
{
public:

View File

@@ -140,8 +140,10 @@ class wxTimerEvent : public wxEvent
public:
wxTimerEvent(int timerid = 0, int interval = 0);
int GetInterval() const;
wxTimer& GetTimer() const;
%property(Interval, GetInterval, doc="See `GetInterval`");
%property(Timer, GetTimer);
};

View File

@@ -102,6 +102,11 @@ public:
void Detach();
void Attach(wxToolBarBase *tbar);
// these methods are only for tools of wxITEM_DROPDOWN kind (but even such
// tools can have a NULL associated menu)
void SetDropdownMenu(wxMenu *menu);
wxMenu *GetDropdownMenu() const;
//wxObject *GetClientData();
%extend {
// convert the ClientData back to a PyObject
@@ -404,6 +409,10 @@ public:
size_t GetToolsCount() const;
// Set dropdown menu
bool SetDropdownMenu(int toolid, wxMenu *menu);
%property(Margins, GetMargins, SetMargins, doc="See `GetMargins` and `SetMargins`");
%property(MaxCols, GetMaxCols, doc="See `GetMaxCols`");
%property(MaxRows, GetMaxRows, doc="See `GetMaxRows`");

View File

@@ -110,9 +110,6 @@ public:
virtual void RefreshRow(size_t row);
virtual void RefreshRows(size_t from, size_t to);
virtual int HitTest(wxCoord y) const;
size_t GetRowCount() const;
size_t GetVisibleRowsBegin() const;
size_t GetVisibleRowsEnd() const;
@@ -144,8 +141,6 @@ public:
virtual void RefreshColumn(size_t column);
virtual void RefreshColumns(size_t from, size_t to);
virtual int HitTest(wxCoord x) const;
size_t GetColumnCount() const;
size_t GetVisibleColumnsBegin() const;
@@ -212,8 +207,8 @@ public:
const wxPosition& to);
// Override wxPanel::HitTest to use our version
// virtual wxPosition HitTest(wxCoord x, wxCoord y) const;
virtual wxPosition HitTest(const wxPoint &pos) const;
// wxPosition VirtualHitTest(wxCoord x, wxCoord y) const;
wxPosition VirtualHitTest(const wxPoint &pos) const;
// replacement implementation of wxWindow::Layout virtual method. To
// properly forward calls to wxWindow::Layout use
@@ -508,7 +503,6 @@ public:
const wxString& name = wxPyPanelNameStr);
int HitTest(const wxPoint& pt) const;
wxCoord GetColumnsWidth(size_t columnMin, size_t columnMax) const;
wxCoord EstimateTotalWidth() const;
};
@@ -607,8 +601,6 @@ public:
const wxString& name = wxPyPanelNameStr);
wxPosition HitTest(const wxPoint& pt) const;
wxCoord GetRowsHeight(size_t lineMin, size_t lineMax) const;
wxCoord EstimateTotalHeight() const;

View File

@@ -1114,7 +1114,7 @@ handler is handed off to the next one in the chain.", "");
void , PushEventHandler( wxEvtHandler *handler ),
"Pushes this event handler onto the event handler stack for the window.
An event handler is an object that is capable of processing the events
sent to a window. (In other words, is able to dispatch the events to
sent to a window. (In other words, is able to dispatch the events to a
handler function.) By default, the window is its own event handler,
but an application may wish to substitute another, for example to
allow central implementation of event-handling for a variety of

View File

@@ -58,7 +58,7 @@ interface:
**Usage**
The following example shows a simple implementation that utilizes
`wx.aui.FrameManager` to manage three text controls in a frame window::
`wx.aui.AuiManager` to manage three text controls in a frame window::
import wx
import wx.aui
@@ -170,7 +170,7 @@ The following example shows a simple implementation that utilizes
const wxPaneInfo& pane_info,
const wxPoint& drop_pos);
// A typemap for the return value of wxFrameManager::GetAllPanes
// A typemap for the return value of wxAuiManager::GetAllPanes
%typemap(out) wxAuiPaneInfoArray& {
$result = PyList_New(0);
for (size_t i=0; i < $1->GetCount(); i++) {
@@ -179,6 +179,7 @@ The following example shows a simple implementation that utilizes
}
}
//%ignore wxAuiManager::~wxAuiManager;
%nokwargs wxAuiTabContainer::SetActivePage;
@@ -234,7 +235,7 @@ The following example shows a simple implementation that utilizes
#undef wxColor
//---------------------------------------------------------------------------
// Methods to inject into the FrameManager class that will sort out calls to
// Methods to inject into the AuiManager class that will sort out calls to
// the overloaded versions of GetPane and AddPane
%extend wxAuiManager {
@@ -247,7 +248,7 @@ The following example shows a simple implementation that utilizes
widget reference or by pane name, which acts as a unique id
for a window pane. The returned `PaneInfo` object may then be
modified to change a pane's look, state or position. After one
or more modifications to the `PaneInfo`, `FrameManager.Update`
or more modifications to the `PaneInfo`, `AuiManager.Update`
should be called to realize the changes to the user interface.
If the lookup failed (meaning the pane could not be found in

View File

@@ -9360,7 +9360,7 @@ class Window(EvtHandler):
Pushes this event handler onto the event handler stack for the window.
An event handler is an object that is capable of processing the events
sent to a window. (In other words, is able to dispatch the events to
sent to a window. (In other words, is able to dispatch the events to a
handler function.) By default, the window is its own event handler,
but an application may wish to substitute another, for example to
allow central implementation of event-handling for a variety of

View File

@@ -3289,6 +3289,14 @@ public:
#if !wxUSE_SOUND
// A C++ stub class for wxWave for platforms that don't have it.
enum wxSoundFlags
{
wxSOUND_SYNC,
wxSOUND_ASYNC,
wxSOUND_LOOP
};
class wxSound : public wxObject
{
public:

View File

@@ -842,6 +842,7 @@ void wxPyOORClientData_dtor(wxPyOORClientData* self) {
//Py_INCREF(deadObjectClass);
Py_DECREF(klass);
Py_DECREF(name);
Py_DECREF(dict);
}
}

View File

@@ -9360,7 +9360,7 @@ class Window(EvtHandler):
Pushes this event handler onto the event handler stack for the window.
An event handler is an object that is capable of processing the events
sent to a window. (In other words, is able to dispatch the events to
sent to a window. (In other words, is able to dispatch the events to a
handler function.) By default, the window is its own event handler,
but an application may wish to substitute another, for example to
allow central implementation of event-handling for a variety of

View File

@@ -9360,7 +9360,7 @@ class Window(EvtHandler):
Pushes this event handler onto the event handler stack for the window.
An event handler is an object that is capable of processing the events
sent to a window. (In other words, is able to dispatch the events to
sent to a window. (In other words, is able to dispatch the events to a
handler function.) By default, the window is its own event handler,
but an application may wish to substitute another, for example to
allow central implementation of event-handling for a variety of