Merge in from trunk r67662 to r64801
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -183,6 +183,17 @@ public:
|
||||
Note that all available wxBitmapHandlers for a given wxWidgets port are
|
||||
automatically loaded at startup so you won't need to use wxBitmap::AddHandler.
|
||||
|
||||
More on the difference between wxImage and wxBitmap: wxImage is just a
|
||||
buffer of RGB bytes with an optional buffer for the alpha bytes. It is all
|
||||
generic, platform independent and image file format independent code. It
|
||||
includes generic code for scaling, resizing, clipping, and other manipulations
|
||||
of the image data. OTOH, wxBitmap is intended to be a wrapper of whatever is
|
||||
the native image format that is quickest/easiest to draw to a DC or to be the
|
||||
target of the drawing operations performed on a wxMemoryDC. By splitting the
|
||||
responsibilities between wxImage/wxBitmap like this then it's easier to use
|
||||
generic code shared by all platforms and image types for generic operations and
|
||||
platform specific code where performance or compatibility is needed.
|
||||
|
||||
@library{wxcore}
|
||||
@category{gdi}
|
||||
|
||||
|
@@ -221,6 +221,10 @@ public:
|
||||
|
||||
/**
|
||||
Adds a new page.
|
||||
|
||||
The page must have the book control itself as the parent and must not
|
||||
have been added to this control previously.
|
||||
|
||||
The call to this function may generate the page changing events.
|
||||
|
||||
@param page
|
||||
|
@@ -424,7 +424,9 @@ public:
|
||||
/**
|
||||
Sets the current date.
|
||||
|
||||
The @a date parameter must be valid.
|
||||
The @a date parameter must be valid and in the currently valid range as
|
||||
set by SetDateRange(), otherwise the current date is not changed and
|
||||
the function returns @false.
|
||||
*/
|
||||
virtual bool SetDate(const wxDateTime& date);
|
||||
|
||||
@@ -476,14 +478,12 @@ public:
|
||||
|
||||
/**
|
||||
@name Date Range Functions
|
||||
|
||||
The functions in this section are currently implemented in the generic
|
||||
and MSW versions and do nothing in the native GTK implementation.
|
||||
*/
|
||||
//@{
|
||||
|
||||
/**
|
||||
Restrict the dates shown by the control to the specified range.
|
||||
Restrict the dates that can be selected in the control to the specified
|
||||
range.
|
||||
|
||||
If either date is set, the corresponding limit will be enforced and
|
||||
@true returned. If none are set, the existing restrictions are removed
|
||||
|
@@ -35,10 +35,10 @@
|
||||
/**
|
||||
Compatibility macro which expands to wxT() in wxWidgets 2 only.
|
||||
|
||||
This macro can be used in the code which needs to compile with both
|
||||
wxWidgets 2 and 3 versions in places where v2 API requires a Unicode string
|
||||
(in Unicode build) and v3 API only accepts a standard narrow
|
||||
string as in e.g. wxCmdLineEntryDesc structure objects initializers.
|
||||
This macro can be used in code which needs to compile with both
|
||||
wxWidgets 2 and 3 versions, in places where the wx2 API requires a Unicode string
|
||||
(in Unicode build) but the wx3 API only accepts a standard narrow
|
||||
string, as in e.g. wxCmdLineEntryDesc structure objects initializers.
|
||||
|
||||
Example of use:
|
||||
@code
|
||||
@@ -50,18 +50,21 @@
|
||||
};
|
||||
@endcode
|
||||
|
||||
Without @c wxT_2 the code above wouldn't compile with wxWidgets 2, with @c
|
||||
wxT instead of it, it wouldn't compile with wxWidgets 3.
|
||||
Without @c wxT_2 the code above wouldn't compile with wxWidgets 2, but using @c
|
||||
wxT instead, it wouldn't compile with wxWidgets 3.
|
||||
|
||||
@see wxT()
|
||||
|
||||
@since 2.8.12, 2.9.2
|
||||
|
||||
@header{wx/chartype.h}
|
||||
*/
|
||||
#define wxT_2(string)
|
||||
|
||||
/**
|
||||
wxS is macro which can be used with character and string literals (in other words,
|
||||
@c 'x' or @c "foo") to either convert them to wide characters or wide strings
|
||||
in @c wchar_t-based (UTF-16) builds or keep them unchanged in @c char-based
|
||||
wxS is a macro which can be used with character and string literals (in other words,
|
||||
@c 'x' or @c "foo") to convert them either to wide characters or wide strings
|
||||
in @c wchar_t-based (UTF-16) builds, or to keep them unchanged in @c char-based
|
||||
(UTF-8) builds.
|
||||
|
||||
Basically this macro produces characters or strings of type wxStringCharType.
|
||||
|
68
interface/wx/containr.h
Normal file
68
interface/wx/containr.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/containr.h
|
||||
// Purpose: documentation of wxNavigationEnabled<>
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-07-23
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
A helper class implementing TAB navigation among the window children.
|
||||
|
||||
This class contains the functionality needed to correctly implement TAB
|
||||
navigation among the children of the window. Its exact contents is not
|
||||
important and is intentionally not documented as the only way to use this
|
||||
class is to inherit from it instead of inheriting from the usual base class
|
||||
directly. For example, if some class needs to inherit from wxControl but
|
||||
contains multiple sub-windows and needs to support keyboard navigation, it
|
||||
is enough to declare it in the following way:
|
||||
@code
|
||||
class MyControlWithSubChildren :
|
||||
public wxNavigationEnabled<wxControl>
|
||||
{
|
||||
public:
|
||||
// Default constructor is implemented in the same way as always.
|
||||
MyControlWithSubChildren() { }
|
||||
|
||||
// Non-default constructor can't use wxControl ctor any more as
|
||||
// wxControl is not its direct base class, but it can use Create().
|
||||
MyControlWithSubChildren(wxWindow *parent, wxWindowID winid)
|
||||
{
|
||||
wxControl::Create(parent, winid);
|
||||
|
||||
// More creation code...
|
||||
}
|
||||
|
||||
// Everything else as usual ...
|
||||
};
|
||||
@endcode
|
||||
|
||||
@library{wxcore}
|
||||
|
||||
@since 2.9.3
|
||||
*/
|
||||
template <class W>
|
||||
class wxNavigationEnabled : public W
|
||||
{
|
||||
public:
|
||||
/// The name of the real base window class that this class derives from.
|
||||
typedef W BaseWindowClass;
|
||||
|
||||
/**
|
||||
Default constructor.
|
||||
|
||||
This class provides only the default constructor as it's not possible,
|
||||
in general, to provide all the constructors of the real base class
|
||||
BaseWindowClass.
|
||||
|
||||
This is however not usually a problem for wxWindow-derived classes as,
|
||||
by convention, they always define a Create() method such that calling
|
||||
it on an object initialized using the default constructor is equivalent
|
||||
to using a non-default constructor directly. So the classes inheriting
|
||||
from wxNavigationEnabled<W> should simply call W::Create() in their
|
||||
constructors.
|
||||
*/
|
||||
wxNavigationEnabled();
|
||||
};
|
@@ -1095,6 +1095,14 @@ public:
|
||||
*/
|
||||
virtual void SetSelections(const wxDataViewItemArray& sel);
|
||||
|
||||
/**
|
||||
Programmatically starts editing the given item on the given column.
|
||||
Currently not implemented on wxOSX Carbon.
|
||||
@since 2.9.2
|
||||
*/
|
||||
|
||||
virtual void StartEditor(const wxDataViewItem & item, unsigned int column);
|
||||
|
||||
/**
|
||||
Unselect the given item.
|
||||
*/
|
||||
@@ -1105,6 +1113,26 @@ public:
|
||||
This method only has effect if multiple selections are allowed.
|
||||
*/
|
||||
virtual void UnselectAll();
|
||||
|
||||
/**
|
||||
Sets the row height.
|
||||
|
||||
This function can only be used when all rows have the same height, i.e.
|
||||
when wxDV_VARIABLE_LINE_HEIGHT flag is not used.
|
||||
|
||||
Currently this is implemented in the generic and native GTK versions
|
||||
only and nothing is done (and @false returned) when using OS X port.
|
||||
|
||||
Also notice that this method can only be used to increase the row
|
||||
height compared with the default one (as determined by the return value
|
||||
of wxDataViewRenderer::GetSize()), if it is set to a too small value
|
||||
then the minimum required by the renderers will be used.
|
||||
|
||||
@return @true if the line height was changed or @false otherwise.
|
||||
|
||||
@since 2.9.2
|
||||
*/
|
||||
virtual bool SetRowHeight(int rowHeight);
|
||||
};
|
||||
|
||||
|
||||
@@ -2687,6 +2715,26 @@ public:
|
||||
*/
|
||||
const wxVariant& GetValue() const;
|
||||
|
||||
/**
|
||||
Can be used to determine whether the new value is going to be accepted
|
||||
in wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE handler.
|
||||
|
||||
Returns @true if editing the item was cancelled or if the user tried to
|
||||
enter an invalid value (refused by wxDataViewRenderer::Validate()). If
|
||||
this method returns @false, it means that the value in the model is
|
||||
about to be changed to the new one.
|
||||
|
||||
Notice that wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event handler can
|
||||
call wxNotifyEvent::Veto() to prevent this from happening.
|
||||
|
||||
Currently support for setting this field and for vetoing the change is
|
||||
only available in the generic version of wxDataViewCtrl, i.e. under MSW
|
||||
but not GTK nor OS X.
|
||||
|
||||
@since 2.9.3
|
||||
*/
|
||||
bool IsEditCancelled() const;
|
||||
|
||||
/**
|
||||
Sets the column index associated with this event.
|
||||
*/
|
||||
|
@@ -105,6 +105,11 @@ public:
|
||||
range is set (or only one of the bounds is set), @a dt1 and/or @a dt2
|
||||
are set to be invalid.
|
||||
|
||||
Notice that when using a native MSW implementation of this control the
|
||||
lower range is always set, even if SetRange() hadn't been called
|
||||
explicitly, as the native control only supports dates later than year
|
||||
1601.
|
||||
|
||||
@param dt1
|
||||
Pointer to the object which receives the lower range limit or
|
||||
becomes invalid if it is not set. May be @NULL if the caller is not
|
||||
|
@@ -35,9 +35,20 @@ public:
|
||||
*/
|
||||
wxGCDC( const wxPrinterDC& dc );
|
||||
|
||||
/**
|
||||
Constructs a wxGCDC from a wxEnhMetaFileDC.
|
||||
|
||||
This constructor is only available in wxMSW port and when @c
|
||||
wxUSE_ENH_METAFILE build option is enabled, i.e. when wxEnhMetaFileDC
|
||||
class itself is available.
|
||||
|
||||
@since 2.9.3
|
||||
*/
|
||||
wxGCDC( const wxEnhMetaFileDC& dc );
|
||||
|
||||
/**
|
||||
Retrieves associated wxGraphicsContext
|
||||
*/
|
||||
wxGraphicsContext* GetGraphicsContext();
|
||||
wxGraphicsContext* GetGraphicsContext() const;
|
||||
};
|
||||
|
||||
|
@@ -176,6 +176,15 @@ public:
|
||||
*/
|
||||
long GetFlags() const;
|
||||
|
||||
/**
|
||||
Returns a reference to the wxPageSetupDialogData associated with the
|
||||
printing operations of this document manager.
|
||||
*/
|
||||
//@{
|
||||
wxPageSetupDialogData& GetPageSetupDialogData();
|
||||
const wxPageSetupDialogData& GetPageSetupDialogData() const;
|
||||
//@}
|
||||
|
||||
/**
|
||||
Returns the run-time class information that allows view instances
|
||||
to be constructed dynamically, as passed to the document template
|
||||
@@ -738,6 +747,38 @@ public:
|
||||
*/
|
||||
void SetMaxDocsOpen(int n);
|
||||
|
||||
|
||||
protected:
|
||||
/**
|
||||
Called when a file selected from the MRU list doesn't exist any more.
|
||||
|
||||
The default behaviour is to remove the file from the MRU (most recently
|
||||
used) files list and the corresponding menu and notify the user about
|
||||
it but this method can be overridden to customize it.
|
||||
|
||||
For example, an application may want to just give an error about the
|
||||
missing file @a filename but not remove it from the file history. Or it
|
||||
could ask the user whether the file should be kept or removed.
|
||||
|
||||
Notice that this method is called only if the file selected by user
|
||||
from the MRU files in the menu doesn't exist, but not if opening it
|
||||
failed for any other reason because in the latter case the default
|
||||
behaviour of removing the file from the MRU list is inappropriate.
|
||||
If you still want to do it, you would need to do it by calling
|
||||
RemoveFileFromHistory() explicitly in the part of the file opening code
|
||||
that may fail.
|
||||
|
||||
@since 2.9.3
|
||||
|
||||
@param n
|
||||
The index of the file in the MRU list, it can be passed to
|
||||
RemoveFileFromHistory() to remove this file from the list.
|
||||
@param filename
|
||||
The full name of the file.
|
||||
*/
|
||||
virtual void OnMRUFileNotExist(unsigned n, const wxString& filename);
|
||||
|
||||
|
||||
/**
|
||||
The currently active view.
|
||||
*/
|
||||
@@ -759,19 +800,16 @@ public:
|
||||
*/
|
||||
wxFileHistory* m_fileHistory;
|
||||
|
||||
/**
|
||||
Stores the flags passed to the constructor.
|
||||
*/
|
||||
long m_flags;
|
||||
|
||||
/**
|
||||
The directory last selected by the user when opening a file.
|
||||
*/
|
||||
wxFileHistory* m_fileHistory;
|
||||
wxString m_lastDirectory;
|
||||
|
||||
/**
|
||||
Stores the maximum number of documents that can be opened before
|
||||
existing documents are closed. By default, this is 10,000.
|
||||
existing documents are closed.
|
||||
|
||||
By default, this is @c INT_MAX i.e. practically unlimited.
|
||||
*/
|
||||
int m_maxDocsOpen;
|
||||
};
|
||||
@@ -1121,9 +1159,25 @@ public:
|
||||
@class wxDocument
|
||||
|
||||
The document class can be used to model an application's file-based data.
|
||||
|
||||
It is part of the document/view framework supported by wxWidgets, and
|
||||
cooperates with the wxView, wxDocTemplate and wxDocManager classes.
|
||||
|
||||
A normal document is the one created without parent document and is
|
||||
associated with a disk file. Since version 2.9.2 wxWidgets also supports a
|
||||
special kind of documents called <em>child documents</em> which are virtual
|
||||
in the sense that they do not correspond to a file but rather to a part of
|
||||
their parent document. Because of this, the child documents can't be
|
||||
created directly by user but can only be created by the parent document
|
||||
(usually when it's being created itself). They also can't be independently
|
||||
saved. A child document has its own view with the corresponding window.
|
||||
This view can be closed by user but, importantly, is also automatically
|
||||
closed when its parent document is closed. Thus, child documents may be
|
||||
convenient for creating additional windows which need to be closed when the
|
||||
main document is. The docview sample demonstrates this use of child
|
||||
documents by creating a child document containing the information about the
|
||||
parameters of the image opened in the main document.
|
||||
|
||||
@library{wxcore}
|
||||
@category{docview}
|
||||
|
||||
@@ -1135,8 +1189,14 @@ public:
|
||||
/**
|
||||
Constructor. Define your own default constructor to initialize
|
||||
application-specific data.
|
||||
|
||||
@param parent
|
||||
Specifying a non-@c NULL parent document here makes this document a
|
||||
special <em>child document</em>, see their description in the class
|
||||
documentation. Notice that this parameter exists but is ignored in
|
||||
wxWidgets versions prior to 2.9.1.
|
||||
*/
|
||||
wxDocument(wxDocument* parent = 0);
|
||||
wxDocument(wxDocument* parent = NULL);
|
||||
|
||||
/**
|
||||
Destructor. Removes itself from the document manager.
|
||||
@@ -1269,6 +1329,18 @@ public:
|
||||
const wxList& GetViews() const;
|
||||
//@}
|
||||
|
||||
/**
|
||||
Returns true if this document is a child document corresponding to a
|
||||
part of the parent document and not a disk file as usual.
|
||||
|
||||
This method can be used to check whether file-related operations make
|
||||
sense for this document as they only apply to top-level documents and
|
||||
not child ones.
|
||||
|
||||
@since 2.9.2
|
||||
*/
|
||||
bool IsChildDocument() const;
|
||||
|
||||
/**
|
||||
Returns @true if the document has been modified since the last save,
|
||||
@false otherwise. You may need to override this if your document view
|
||||
|
@@ -3023,27 +3023,29 @@ public:
|
||||
/**
|
||||
@class wxThreadEvent
|
||||
|
||||
This class adds some simple functionalities to wxCommandEvent conceived
|
||||
for inter-threads communications.
|
||||
This class adds some simple functionality to wxEvent to facilitate
|
||||
inter-thread communication.
|
||||
|
||||
This event is not natively emitted by any control/class: this is just
|
||||
an helper class for the user.
|
||||
This event is not natively emitted by any control/class: it is just
|
||||
a helper class for the user.
|
||||
Its most important feature is the GetEventCategory() implementation which
|
||||
allows thread events to @b NOT be processed by wxEventLoopBase::YieldFor calls
|
||||
allows thread events @b NOT to be processed by wxEventLoopBase::YieldFor calls
|
||||
(unless the @c wxEVT_CATEGORY_THREAD is specified - which is never in wx code).
|
||||
|
||||
@library{wxcore}
|
||||
@category{events,threading}
|
||||
|
||||
@see @ref overview_thread, wxEventLoopBase::YieldFor
|
||||
|
||||
@since 2.9.0
|
||||
*/
|
||||
class wxThreadEvent : public wxCommandEvent
|
||||
class wxThreadEvent : public wxEvent
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Constructor.
|
||||
*/
|
||||
wxThreadEvent(wxEventType eventType = wxEVT_COMMAND_THREAD, int id = wxID_ANY);
|
||||
wxThreadEvent(wxEventType eventType = wxEVT_THREAD, int id = wxID_ANY);
|
||||
|
||||
/**
|
||||
Clones this event making sure that all internal members which use
|
||||
@@ -3090,6 +3092,37 @@ public:
|
||||
*/
|
||||
template<typename T>
|
||||
T GetPayload() const;
|
||||
|
||||
/**
|
||||
Returns extra information integer value.
|
||||
*/
|
||||
long GetExtraLong() const;
|
||||
|
||||
/**
|
||||
Returns stored integer value.
|
||||
*/
|
||||
int GetInt() const;
|
||||
|
||||
/**
|
||||
Returns stored string value.
|
||||
*/
|
||||
wxString GetString() const;
|
||||
|
||||
|
||||
/**
|
||||
Sets the extra information value.
|
||||
*/
|
||||
void SetExtraLong(long extraLong);
|
||||
|
||||
/**
|
||||
Sets the integer value.
|
||||
*/
|
||||
void SetInt(int intCommand);
|
||||
|
||||
/**
|
||||
Sets the string value.
|
||||
*/
|
||||
void SetString(const wxString& string);
|
||||
};
|
||||
|
||||
|
||||
@@ -3464,8 +3497,8 @@ public:
|
||||
|
||||
This event is mainly used by wxWidgets implementations.
|
||||
A wxNavigationKeyEvent handler is automatically provided by wxWidgets
|
||||
when you make a class into a control container with the macro
|
||||
WX_DECLARE_CONTROL_CONTAINER.
|
||||
when you enable keyboard navigation inside a window by inheriting it from
|
||||
wxNavigationEnabled<>.
|
||||
|
||||
@beginEventTable{wxNavigationKeyEvent}
|
||||
@event{EVT_NAVIGATION_KEY(func)}
|
||||
@@ -3769,8 +3802,6 @@ public:
|
||||
Notice that the event is not triggered when the application is iconized
|
||||
(minimized) or restored under wxMSW.
|
||||
|
||||
Currently only wxMSW, wxGTK and wxOS2 generate such events.
|
||||
|
||||
@onlyfor{wxmsw,wxgtk,wxos2}
|
||||
|
||||
@beginEventTable{wxShowEvent}
|
||||
@@ -4246,7 +4277,7 @@ wxEventType wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED;
|
||||
wxEventType wxEVT_COMMAND_TOOL_ENTER;
|
||||
wxEventType wxEVT_COMMAND_COMBOBOX_DROPDOWN;
|
||||
wxEventType wxEVT_COMMAND_COMBOBOX_CLOSEUP;
|
||||
wxEventType wxEVT_COMMAND_THREAD;
|
||||
wxEventType wxEVT_THREAD;
|
||||
wxEventType wxEVT_LEFT_DOWN;
|
||||
wxEventType wxEVT_LEFT_UP;
|
||||
wxEventType wxEVT_MIDDLE_DOWN;
|
||||
|
@@ -611,6 +611,10 @@ public:
|
||||
Don't include the trailing separator in the returned string. This is
|
||||
the default (the value of this flag is 0) and exists only for symmetry
|
||||
with wxPATH_GET_SEPARATOR.
|
||||
|
||||
@note If the path is a toplevel one (e.g. @c "/" on Unix or @c "C:\" on
|
||||
Windows), then the returned path will contain trailing separator
|
||||
even with @c wxPATH_NO_SEPARATOR.
|
||||
*/
|
||||
wxString GetPath(int flags = wxPATH_GET_VOLUME,
|
||||
wxPathFormat format = wxPATH_NATIVE) const;
|
||||
|
@@ -24,54 +24,15 @@
|
||||
|
||||
For the full list of change types that are reported see wxFSWFlags.
|
||||
|
||||
There are three different ways to use this class:
|
||||
|
||||
- You may derive a new class from wxFileSystemWatcher and override the
|
||||
wxFileSystemWatcher::OnChange member to perform the required action
|
||||
when file system change occurrs. Additionally you may also want to
|
||||
override wxFileSystemWatcher::OnWarning and
|
||||
wxFileSystemWatcher::OnError to be notified when an error condition
|
||||
arises.
|
||||
- You may use a derived class and the @c EVT_FSWATCHER macro or
|
||||
wxEvtHandler::Connect to redirect events to an event handler defined in
|
||||
the derived class. If the default constructor is used, the file system
|
||||
watcher object will be its own owner object, since it is derived from
|
||||
wxEvtHandler.
|
||||
- You may redirect the notifications of file system changes as well as of
|
||||
error conditions to any wxEvtHandler derived object by using
|
||||
wxFileSystemWatcher::SetOwner.
|
||||
Then use the @c EVT_FSWATCHER macro or wxEvtHandler::Connect to send the
|
||||
events to the event handler which will receive wxFileSystemWatcherEvent.
|
||||
|
||||
For example:
|
||||
|
||||
@code
|
||||
class MyWatcher : public wxFileSystemWatcher
|
||||
{
|
||||
protected:
|
||||
void OnChange(int changeType, const wxFileName& path, const wxFileName& newPath)
|
||||
{
|
||||
// do whatever you like with the event
|
||||
}
|
||||
};
|
||||
|
||||
class MyApp : public wxApp
|
||||
{
|
||||
public:
|
||||
...
|
||||
void OnEventLoopEnter(wxEventLoopBase* WXUNUSED(loop))
|
||||
{
|
||||
// you have to construct the watcher here, because it needs an active loop
|
||||
m_watcher = new MyWatcher();
|
||||
|
||||
// please notify me when a new log file is created
|
||||
m_watcher->Add(wxFileName::DirName("/var/log", wxFSW_EVENT_CREATE);
|
||||
}
|
||||
|
||||
private:
|
||||
MyWatcher* m_watcher;
|
||||
};
|
||||
@endcode
|
||||
This class notifies the application about the file system changes by
|
||||
sending events of wxFileSystemWatcherEvent class. By default these events
|
||||
are sent to the wxFileSystemWatcher object itself so you can derive from it
|
||||
and use the event table @c EVT_FSWATCHER macro to handle these events in a
|
||||
derived class method. Alternatively, you can use
|
||||
wxFileSystemWatcher::SetOwner() to send the events to another object. Or
|
||||
you could use wxEvtHandler::Connect() with @c wxEVT_FSWATCHER to handle
|
||||
these events in any other object. See the fswatcher sample for an example
|
||||
of the latter approach.
|
||||
|
||||
@library{wxbase}
|
||||
@category{file}
|
||||
@@ -82,9 +43,7 @@ class wxFileSystemWatcher: public wxEvtHandler
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Default constructor. If you create file system watcher using it you have
|
||||
to either call SetOwner() and connect an event handler or override
|
||||
OnChange(), OnWarning() and OnError().
|
||||
Default constructor.
|
||||
*/
|
||||
wxFileSystemWatcher();
|
||||
|
||||
@@ -95,24 +54,34 @@ public:
|
||||
virtual ~wxFileSystemWatcher();
|
||||
|
||||
/**
|
||||
Adds @a path to currently watched files. Optionally a filter can be
|
||||
specified to receive only events of particular type.
|
||||
Adds @a path to currently watched files.
|
||||
|
||||
Any events concerning this particular path will be sent either to
|
||||
connected handler or passed to OnChange(), OnWarning() or OnError().
|
||||
The @a path argument can currently only be a directory and any changes
|
||||
to this directory itself or its immediate children will generate the
|
||||
events. Use AddTree() to monitor the directory recursively.
|
||||
|
||||
@note When adding a directory, immediate children will be watched
|
||||
as well.
|
||||
@param path
|
||||
The name of the path to watch.
|
||||
@param events
|
||||
An optional filter to receive only events of particular types.
|
||||
*/
|
||||
virtual bool Add(const wxFileName& path, int events = wxFSW_EVENT_ALL);
|
||||
|
||||
/**
|
||||
This is the same as Add(), but recursively adds every file/directory in
|
||||
the tree rooted at @a path. Additionally a file mask can be specified to
|
||||
include only files matching that particular mask.
|
||||
the tree rooted at @a path.
|
||||
|
||||
Additionally a file mask can be specified to include only files
|
||||
matching that particular mask.
|
||||
|
||||
This method is implemented efficiently under MSW but shouldn't be used
|
||||
for the directories with a lot of children (such as e.g. the root
|
||||
directory) under the other platforms as it calls Add() there for each
|
||||
subdirectory potentially creating a lot of watches and taking a long
|
||||
time to execute.
|
||||
*/
|
||||
virtual bool AddTree(const wxFileName& path, int events = wxFSW_EVENT_ALL,
|
||||
const wxString& filter = wxEmptyString) = 0;
|
||||
const wxString& filter = wxEmptyString);
|
||||
|
||||
/**
|
||||
Removes @a path from the list of watched paths.
|
||||
@@ -147,9 +116,8 @@ public:
|
||||
/**
|
||||
Associates the file system watcher with the given @a handler object.
|
||||
|
||||
Basically this means that all events will be passed to this handler
|
||||
object unless you have change the default behaviour by overriding
|
||||
OnChange(), OnWarning() or OnError().
|
||||
All the events generated by this object will be passed to the specified
|
||||
owner.
|
||||
*/
|
||||
void SetOwner(wxEvtHandler* handler);
|
||||
};
|
||||
|
@@ -212,6 +212,23 @@ enum wxAntialiasMode
|
||||
wxANTIALIAS_DEFAULT,
|
||||
};
|
||||
|
||||
/**
|
||||
Interpolation quality used by wxGraphicsContext::SetInterpolationQuality().
|
||||
*/
|
||||
enum wxInterpolationQuality
|
||||
{
|
||||
/** default interpolation, based on type of context, in general medium quality */
|
||||
wxINTERPOLATION_DEFAULT,
|
||||
/** no interpolation */
|
||||
wxINTERPOLATION_NONE,
|
||||
/** fast interpolation, suited for interactivity */
|
||||
wxINTERPOLATION_FAST,
|
||||
/** better quality */
|
||||
wxINTERPOLATION_GOOD,
|
||||
/** best quality, not suited for interactivity */
|
||||
wxINTERPOLATION_BEST
|
||||
};
|
||||
|
||||
/**
|
||||
Compositing is done using Porter-Duff compositions
|
||||
(see http://keithp.com/~keithp/porterduff/p253-porter.pdf) with
|
||||
@@ -224,6 +241,14 @@ enum wxAntialiasMode
|
||||
*/
|
||||
enum wxCompositionMode
|
||||
{
|
||||
/**
|
||||
Indicates invalid or unsupported composition mode.
|
||||
|
||||
This value can't be passed to wxGraphicsContext::SetCompositionMode().
|
||||
|
||||
@since 2.9.2
|
||||
*/
|
||||
wxCOMPOSITION_INVALID = -1,
|
||||
wxCOMPOSITION_CLEAR, /**< @e R = 0 */
|
||||
wxCOMPOSITION_SOURCE, /**< @e R = S */
|
||||
wxCOMPOSITION_OVER, /**< @e R = @e S + @e D*(1 - @e Sa) */
|
||||
@@ -237,7 +262,7 @@ enum wxCompositionMode
|
||||
wxCOMPOSITION_DEST_OUT, /**< @e R = @e D*(1 - @e Sa) */
|
||||
wxCOMPOSITION_DEST_ATOP, /**< @e R = @e S*(1 - @e Da) + @e D*@e Sa */
|
||||
wxCOMPOSITION_XOR, /**< @e R = @e S*(1 - @e Da) + @e D*(1 - @e Sa) */
|
||||
wxCOMPOSITION_ADD, /**< @e R = @e S + @e D */
|
||||
wxCOMPOSITION_ADD /**< @e R = @e S + @e D */
|
||||
};
|
||||
|
||||
|
||||
@@ -317,6 +342,16 @@ public:
|
||||
*/
|
||||
static wxGraphicsContext* Create(const wxPrinterDC& dc);
|
||||
|
||||
/**
|
||||
Creates a wxGraphicsContext from a wxEnhMetaFileDC.
|
||||
|
||||
This function, as wxEnhMetaFileDC class itself, is only available only
|
||||
under MSW.
|
||||
|
||||
@see wxGraphicsRenderer::CreateContext()
|
||||
*/
|
||||
static wxGraphicsContext* Create(const wxEnhMetaFileDC& dc);
|
||||
|
||||
/**
|
||||
Clips drawings to the specified region.
|
||||
*/
|
||||
@@ -658,6 +693,16 @@ public:
|
||||
*/
|
||||
virtual wxAntialiasMode GetAntialiasMode() const ;
|
||||
|
||||
/**
|
||||
Sets the interpolation quality, returns true if it supported
|
||||
*/
|
||||
virtual bool SetInterpolationQuality(wxInterpolationQuality interpolation) = 0;
|
||||
|
||||
/**
|
||||
Returns the current interpolation quality
|
||||
*/
|
||||
virtual wxInterpolationQuality GetInterpolationQuality() const;
|
||||
|
||||
/**
|
||||
Sets the compositing operator, returns true if it supported
|
||||
*/
|
||||
@@ -827,6 +872,14 @@ public:
|
||||
*/
|
||||
virtual wxGraphicsContext* CreateContext(const wxPrinterDC& dc) = 0 ;
|
||||
|
||||
/**
|
||||
Creates a wxGraphicsContext from a wxEnhMetaFileDC.
|
||||
|
||||
This function, as wxEnhMetaFileDC class itself, is only available only
|
||||
under MSW.
|
||||
*/
|
||||
virtual wxGraphicsContext* CreateContext(const wxEnhMetaFileDC& dc) = 0;
|
||||
|
||||
/**
|
||||
Creates a native brush from a wxBrush.
|
||||
*/
|
||||
|
@@ -314,6 +314,17 @@ const unsigned char wxIMAGE_ALPHA_OPAQUE = 0xff;
|
||||
the wxBitmap::wxBitmap(wxImage,int depth) constructor.
|
||||
This bitmap can then be drawn in a device context, using wxDC::DrawBitmap.
|
||||
|
||||
More on the difference between wxImage and wxBitmap: wxImage is just a
|
||||
buffer of RGB bytes with an optional buffer for the alpha bytes. It is all
|
||||
generic, platform independent and image file format independent code. It
|
||||
includes generic code for scaling, resizing, clipping, and other manipulations
|
||||
of the image data. OTOH, wxBitmap is intended to be a wrapper of whatever is
|
||||
the native image format that is quickest/easiest to draw to a DC or to be the
|
||||
target of the drawing operations performed on a wxMemoryDC. By splitting the
|
||||
responsibilities between wxImage/wxBitmap like this then it's easier to use
|
||||
generic code shared by all platforms and image types for generic operations and
|
||||
platform specific code where performance or compatibility is needed.
|
||||
|
||||
One colour value of the image may be used as a mask colour which will lead to
|
||||
the automatic creation of a wxMask object associated to the bitmap object.
|
||||
|
||||
|
@@ -953,7 +953,7 @@ public:
|
||||
using the specified @a fnSortCallBack function. This function must have the
|
||||
following prototype:
|
||||
@code
|
||||
int wxCALLBACK wxListCompareFunction(long item1, long item2, wxIntPtr sortData)
|
||||
int wxCALLBACK wxListCompareFunction(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData)
|
||||
@endcode
|
||||
|
||||
It is called each time when the two items must be compared and should return 0
|
||||
|
@@ -708,7 +708,9 @@ public:
|
||||
/**
|
||||
Used inside a class declaration to declare that the class should be made
|
||||
known to the class hierarchy, but objects of this class cannot be created
|
||||
dynamically. The same as wxDECLARE_DYNAMIC_CLASS().
|
||||
dynamically.
|
||||
|
||||
The same as wxDECLARE_ABSTRACT_CLASS().
|
||||
|
||||
@header{wx/object.h}
|
||||
*/
|
||||
|
@@ -195,21 +195,44 @@ public:
|
||||
virtual void CreateControlBar();
|
||||
|
||||
/**
|
||||
Creates the preview canvas and control bar.
|
||||
Initializes the frame elements and prepares for showing it.
|
||||
|
||||
By default also disables the other existing top level windows to
|
||||
prepare for showing the preview frame modally. Since wxWidgets 2.9.2
|
||||
this can be changed by specifying either wxPreviewFrame_WindowModal --
|
||||
to disable just the parent window -- or wxPreviewFrame_NonModal -- to
|
||||
not disable any windows at all -- as @a kind parameter.
|
||||
Calling this method is equivalent to calling InitializeWithModality()
|
||||
with wxPreviewFrame_AppModal argument, please see its documentation for
|
||||
more details.
|
||||
|
||||
This function must be called by the application prior to showing the frame.
|
||||
Please notice that this function is virtual mostly for backwards
|
||||
compatibility only, there is no real need to override it as it's never
|
||||
called by wxWidgets itself.
|
||||
*/
|
||||
virtual void Initialize();
|
||||
|
||||
/**
|
||||
Initializes the frame elements and prepares for showing it with the
|
||||
given modality kind.
|
||||
|
||||
This method creates the frame elements by calling CreateCanvas() and
|
||||
CreateControlBar() methods (which may be overridden to customize them)
|
||||
and prepares to show the frame according to the value of @a kind
|
||||
parameter:
|
||||
- If it is wxPreviewFrame_AppModal, all the other application
|
||||
windows will be disabled when this frame is shown. This is the same
|
||||
behaviour as that of simple Initialize().
|
||||
- If it is wxPreviewFrame_WindowModal, only the parent window of
|
||||
the preview frame will be disabled when it is shown.
|
||||
- And if it is wxPreviewFrame_NonModal, no windows at all will be
|
||||
disabled while the preview is shown.
|
||||
|
||||
Notice that this function (or Initialize()) must be called by the
|
||||
application prior to showing the frame but you still must call @c
|
||||
Show(true) to actually show it afterwards.
|
||||
|
||||
@param kind
|
||||
The modality kind of preview frame. @since 2.9.2
|
||||
The modality kind of preview frame.
|
||||
|
||||
@since 2.9.2
|
||||
*/
|
||||
virtual void Initialize(wxPreviewFrameModalityKind kind
|
||||
= wxPreviewFrame_AppModal);
|
||||
virtual void InitializeWithModality(wxPreviewFrameModalityKind kind);
|
||||
|
||||
/**
|
||||
Enables any disabled frames in the application, and deletes the print preview
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -80,6 +80,18 @@ public:
|
||||
*/
|
||||
virtual bool IsSeekable() const;
|
||||
|
||||
/**
|
||||
Resets the stream state.
|
||||
|
||||
By default, resets the stream to good state, i.e. clears any errors.
|
||||
Since wxWidgets 2.9.3 can be also used to explicitly set the state to
|
||||
the specified error (the @a error argument didn't exist in the previous
|
||||
versions).
|
||||
|
||||
@see GetLastError()
|
||||
*/
|
||||
void Reset(wxStreamError error = wxSTREAM_NO_ERROR);
|
||||
|
||||
/**
|
||||
Returns the opposite of IsOk().
|
||||
You can use this function to test the validity of the stream as if
|
||||
|
@@ -96,6 +96,42 @@ public:
|
||||
window).
|
||||
*/
|
||||
wxGenericValidator(wxDateTime* valPtr);
|
||||
/**
|
||||
Constructor taking a wxFileName pointer. This will be used for
|
||||
wxTextCtrl.
|
||||
|
||||
@param valPtr
|
||||
A pointer to a variable that contains the value. This variable
|
||||
should have a lifetime equal to or longer than the validator
|
||||
lifetime (which is usually determined by the lifetime of the
|
||||
window).
|
||||
@since 2.9.3
|
||||
*/
|
||||
wxGenericValidator(wxFileName* valPtr);
|
||||
/**
|
||||
Constructor taking a float pointer. This will be used for
|
||||
wxTextCtrl.
|
||||
|
||||
@param valPtr
|
||||
A pointer to a variable that contains the value. This variable
|
||||
should have a lifetime equal to or longer than the validator
|
||||
lifetime (which is usually determined by the lifetime of the
|
||||
window).
|
||||
@since 2.9.3
|
||||
*/
|
||||
wxGenericValidator(float* valPtr);
|
||||
/**
|
||||
Constructor taking a double pointer. This will be used for
|
||||
wxTextCtrl.
|
||||
|
||||
@param valPtr
|
||||
A pointer to a variable that contains the value. This variable
|
||||
should have a lifetime equal to or longer than the validator
|
||||
lifetime (which is usually determined by the lifetime of the
|
||||
window).
|
||||
@since 2.9.3
|
||||
*/
|
||||
wxGenericValidator(double* valPtr);
|
||||
|
||||
/**
|
||||
Destructor.
|
||||
|
@@ -495,6 +495,9 @@ public:
|
||||
current parent window (e.g. a non-standard toolbar in a wxFrame)
|
||||
and then re-inserted into another.
|
||||
|
||||
Notice that currently you need to explicitly call
|
||||
wxNotebook::RemovePage() before reparenting a notebook page.
|
||||
|
||||
@param newParent
|
||||
New parent.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user