Merge remote-tracking branch 'remotes/upstream/master'
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
aboutInfo.SetName("MyApp");
|
||||
aboutInfo.SetVersion(MY_APP_VERSION_STRING);
|
||||
aboutInfo.SetDescription(_("My wxWidgets-based application!"));
|
||||
aboutInfo.SetCopyright("(C) 1992-2020");
|
||||
aboutInfo.SetCopyright("(C) 1992-2021");
|
||||
aboutInfo.SetWebSite("http://myapp.org");
|
||||
aboutInfo.AddDeveloper("My Self");
|
||||
|
||||
@@ -230,7 +230,7 @@ public:
|
||||
"Version " to @a version).
|
||||
|
||||
The generic about dialog and native GTK+ dialog use @a version only,
|
||||
as a suffix to the program name. The native MSW and OS X about dialogs
|
||||
as a suffix to the program name. The native MSW and macOS about dialogs
|
||||
use the long version.
|
||||
*/
|
||||
void SetVersion(const wxString& version, const wxString& longVersion = wxString());
|
||||
|
@@ -15,13 +15,13 @@ enum wxAcceleratorEntryFlags
|
||||
/** hold Alt key down */
|
||||
wxACCEL_ALT,
|
||||
|
||||
/** hold Ctrl key down, corresponds to Command key on OS X */
|
||||
/** hold Ctrl key down, corresponds to Command key on macOS */
|
||||
wxACCEL_CTRL,
|
||||
|
||||
/** hold Shift key down */
|
||||
wxACCEL_SHIFT,
|
||||
|
||||
/** corresponds to real Ctrl key on OS X, identic to @c wxACCEL_CTRL on other platforms */
|
||||
/** corresponds to real Ctrl key on macOS, identic to @c wxACCEL_CTRL on other platforms */
|
||||
wxACCEL_RAW_CTRL,
|
||||
|
||||
/** deprecated, identic to @c wxACCEL_CTRL on all platforms. */
|
||||
|
@@ -95,8 +95,8 @@ public:
|
||||
using this control instead of just creating and managing the buttons
|
||||
directly is that the correct buttons and layout for the current platform
|
||||
are used by this class. E.g. the buttons are positioned under the list
|
||||
control under OS X and GTK+ but to its right under MSW and the buttons
|
||||
themselves use system-specific bitmaps under OS X.
|
||||
control under macOS and GTK+ but to its right under MSW and the buttons
|
||||
themselves use system-specific bitmaps under macOS.
|
||||
|
||||
This class is always used in conjunction with wxAddRemoveAdaptor which is
|
||||
used to actually add items to or remove them from the control containing
|
||||
|
@@ -84,6 +84,25 @@ public:
|
||||
cannot be converted to a specific data type, wxAny will then
|
||||
hold and manage reference to wxVariantData* similar to how
|
||||
wxVariant does.
|
||||
|
||||
Note that objects constructed from list-valued variants
|
||||
require the list to be explicitly cleared using `WX_CLEAR_LIST`
|
||||
to avoid leaking memory. This unfortunate behaviour will not
|
||||
be changed to prevent breaking the existing code relying on it.
|
||||
|
||||
@code
|
||||
wxVariant vList;
|
||||
vList.NullList();
|
||||
vList.Append(15);
|
||||
vList.Append("abc");
|
||||
|
||||
// Create wxAny from the list variant.
|
||||
wxAny any = wxAny(vList);
|
||||
|
||||
// Clear the list to avoid the memory leak.
|
||||
wxAnyList anyList = any.As<wxAnyList>();
|
||||
WX_CLEAR_LIST(wxAnyList, anyList);
|
||||
@endcode
|
||||
*/
|
||||
wxAny(const wxVariant& variant);
|
||||
|
||||
|
@@ -41,10 +41,10 @@ public:
|
||||
wxBitmap GetBitmap() const;
|
||||
|
||||
/**
|
||||
Returns the bitmap used when the mouse is over the button, which may be
|
||||
invalid.
|
||||
Returns the bitmap used when the mouse is over the button.
|
||||
|
||||
@see SetBitmapCurrent()
|
||||
The returned bitmap is only valid if SetBitmapCurrent() had been
|
||||
previously called.
|
||||
|
||||
@since 2.9.1 (available as wxBitmapButton::GetBitmapHover() in previous
|
||||
versions)
|
||||
@@ -52,18 +52,20 @@ public:
|
||||
wxBitmap GetBitmapCurrent() const;
|
||||
|
||||
/**
|
||||
Returns the bitmap for the disabled state, which may be invalid.
|
||||
Returns the bitmap used for the disabled state.
|
||||
|
||||
@see SetBitmapDisabled()
|
||||
The returned bitmap is only valid if SetBitmapDisabled() had been
|
||||
previously called.
|
||||
|
||||
@since 2.9.1 (available in wxBitmapButton only in previous versions)
|
||||
*/
|
||||
wxBitmap GetBitmapDisabled() const;
|
||||
|
||||
/**
|
||||
Returns the bitmap for the focused state, which may be invalid.
|
||||
Returns the bitmap used for the focused state.
|
||||
|
||||
@see SetBitmapFocus()
|
||||
The returned bitmap is only valid if SetBitmapFocus() had been
|
||||
previously called.
|
||||
|
||||
@since 2.9.1 (available in wxBitmapButton only in previous versions)
|
||||
*/
|
||||
@@ -82,9 +84,10 @@ public:
|
||||
wxBitmap GetBitmapLabel() const;
|
||||
|
||||
/**
|
||||
Returns the bitmap for the pressed state, which may be invalid.
|
||||
Returns the bitmap used when the button is pressed.
|
||||
|
||||
@see SetBitmapPressed()
|
||||
The returned bitmap is only valid if SetBitmapPressed() had been
|
||||
previously called.
|
||||
|
||||
@since 2.9.1 (available as wxBitmapButton::GetBitmapSelected() in
|
||||
previous versions)
|
||||
@@ -102,8 +105,11 @@ public:
|
||||
states.
|
||||
|
||||
@param bitmap
|
||||
The bitmap to display in the button. If the bitmap is invalid, any
|
||||
currently shown bitmaps are removed from the button.
|
||||
The bitmap bundle containing the resolution-dependent bitmaps to
|
||||
display in the button. At default DPI, the size of the bitmap is
|
||||
determined by the default bundle size, i.e. the value returned from
|
||||
wxBitmapBundle::GetDefaultSize(). If the bitmap bundle is invalid,
|
||||
any currently shown bitmaps are removed from the button.
|
||||
@param dir
|
||||
The position of the bitmap inside the button. By default it is
|
||||
positioned to the left of the text, near to the left button border.
|
||||
@@ -113,7 +119,7 @@ public:
|
||||
|
||||
@since 2.9.1
|
||||
*/
|
||||
void SetBitmap(const wxBitmap& bitmap, wxDirection dir = wxLEFT);
|
||||
void SetBitmap(const wxBitmapBundle& bitmap, wxDirection dir = wxLEFT);
|
||||
|
||||
/**
|
||||
Sets the bitmap to be shown when the mouse is over the button.
|
||||
@@ -126,7 +132,7 @@ public:
|
||||
@since 2.9.1 (available as wxBitmapButton::SetBitmapHover() in previous
|
||||
versions)
|
||||
*/
|
||||
void SetBitmapCurrent(const wxBitmap& bitmap);
|
||||
void SetBitmapCurrent(const wxBitmapBundle& bitmap);
|
||||
|
||||
/**
|
||||
Sets the bitmap for the disabled button appearance.
|
||||
@@ -142,7 +148,7 @@ public:
|
||||
|
||||
@since 2.9.1 (available in wxBitmapButton only in previous versions)
|
||||
*/
|
||||
void SetBitmapDisabled(const wxBitmap& bitmap);
|
||||
void SetBitmapDisabled(const wxBitmapBundle& bitmap);
|
||||
|
||||
/**
|
||||
Sets the bitmap for the button appearance when it has the keyboard
|
||||
@@ -156,7 +162,7 @@ public:
|
||||
|
||||
@since 2.9.1 (available in wxBitmapButton only in previous versions)
|
||||
*/
|
||||
void SetBitmapFocus(const wxBitmap& bitmap);
|
||||
void SetBitmapFocus(const wxBitmapBundle& bitmap);
|
||||
|
||||
/**
|
||||
Sets the bitmap label for the button.
|
||||
@@ -168,7 +174,7 @@ public:
|
||||
|
||||
@since 2.9.1 (available in wxBitmapButton only in previous versions)
|
||||
*/
|
||||
void SetBitmapLabel(const wxBitmap& bitmap);
|
||||
void SetBitmapLabel(const wxBitmapBundle& bitmap);
|
||||
|
||||
/**
|
||||
Sets the bitmap for the selected (depressed) button appearance.
|
||||
@@ -176,7 +182,7 @@ public:
|
||||
@since 2.9.1 (available as wxBitmapButton::SetBitmapSelected() in
|
||||
previous versions)
|
||||
*/
|
||||
void SetBitmapPressed(const wxBitmap& bitmap);
|
||||
void SetBitmapPressed(const wxBitmapBundle& bitmap);
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -401,6 +401,12 @@ public:
|
||||
Called from OnInit() and may be used to initialize the parser with the
|
||||
command line options for this application. The base class versions adds
|
||||
support for a few standard options only.
|
||||
|
||||
Note that this method should just configure @a parser to accept the
|
||||
desired command line options by calling wxCmdLineParser::AddOption(),
|
||||
wxCmdLineParser::AddSwitch() and similar methods, but should @e not
|
||||
call wxCmdLineParser::Parse() as this will be done by wxWidgets itself
|
||||
slightly later.
|
||||
*/
|
||||
virtual void OnInitCmdLine(wxCmdLineParser& parser);
|
||||
|
||||
@@ -749,8 +755,7 @@ public:
|
||||
std::locale::global(std::locale(""));
|
||||
@endcode
|
||||
but be warned that locale support in C++ standard library can be poor
|
||||
or worse under some platforms, e.g. the above line results in an
|
||||
immediate crash under OS X up to the version 10.8.2.
|
||||
or worse under some platforms.
|
||||
|
||||
@since 2.9.5
|
||||
*/
|
||||
@@ -766,7 +771,7 @@ public:
|
||||
|
||||
Under Windows and Linux/Unix, you should parse the command line
|
||||
arguments and check for files to be opened when starting your
|
||||
application. Under OS X, you need to override MacOpenFiles()
|
||||
application. Under macOS, you need to override MacOpenFiles()
|
||||
since command line arguments are used differently there.
|
||||
|
||||
You may use the wxCmdLineParser to parse command line arguments.
|
||||
@@ -854,6 +859,18 @@ public:
|
||||
*/
|
||||
bool GetUseBestVisual() const;
|
||||
|
||||
/**
|
||||
Returns a pointer to the top application window if any.
|
||||
|
||||
This function is safe to call even before creating, or after
|
||||
destroying, the application object, as it simply returns @NULL if it
|
||||
doesn't exist. Otherwise it's equivalent to calling
|
||||
@c wxTheApp->GetTopWindow().
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
static wxWindow* GetMainTopWindow();
|
||||
|
||||
/**
|
||||
Returns a pointer to the top window.
|
||||
|
||||
@@ -1049,7 +1066,7 @@ public:
|
||||
|
||||
/**
|
||||
May be overridden to indicate that the application is not a foreground
|
||||
GUI application under OS X.
|
||||
GUI application under macOS.
|
||||
|
||||
This method is called during the application startup and returns @true
|
||||
by default. In this case, wxWidgets ensures that the application is ran
|
||||
@@ -1115,8 +1132,17 @@ public:
|
||||
#define wxDECLARE_APP( className )
|
||||
|
||||
/**
|
||||
This is used in the application class implementation file to make the
|
||||
application class known to wxWidgets for dynamic construction.
|
||||
This macro defines the application entry point and tells wxWidgets which
|
||||
application class should be used.
|
||||
|
||||
The two tasks performed by this macro can be done separately by using
|
||||
wxIMPLEMENT_APP_NO_MAIN() and wxIMPLEMENT_WXWIN_MAIN() macros, but in a
|
||||
typical GUI application it's simpler and more convenient to use this macro
|
||||
to do both together.
|
||||
|
||||
The @a className passed to this macro must be a name of the class deriving
|
||||
from wxApp.
|
||||
|
||||
Note that this macro requires a final semicolon.
|
||||
|
||||
@header{wx/app.h}
|
||||
@@ -1131,6 +1157,24 @@ public:
|
||||
*/
|
||||
#define wxIMPLEMENT_APP( className )
|
||||
|
||||
/**
|
||||
This macro defines the application entry point appropriate for the current
|
||||
platform.
|
||||
|
||||
Note that usually wxIMPLEMENT_APP() is used instead of this macro.
|
||||
|
||||
For most platforms, it defines @c main() function, but for GUI Windows
|
||||
applications, it defines @c WinMain() instead.
|
||||
|
||||
In either case, the macro expansion includes the call to
|
||||
wxDISABLE_DEBUG_SUPPORT() which disables debugging code in release builds.
|
||||
If you don't use this macro, but define the entry point yourself, you
|
||||
probably want to call wxDISABLE_DEBUG_SUPPORT() explicitly.
|
||||
|
||||
@header{wx/app.h}
|
||||
*/
|
||||
#define wxIMPLEMENT_WXWIN_MAIN
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
@@ -1176,7 +1220,7 @@ wxAppDerivedClass& wxGetApp();
|
||||
Notice that this function is only available if @c wxUSE_ON_FATAL_EXCEPTION
|
||||
is 1 and under Windows platform this requires a compiler with support for
|
||||
SEH (structured exception handling) which currently means only Microsoft
|
||||
Visual C++ or a recent Borland C++ version.
|
||||
Visual C++.
|
||||
|
||||
@header{wx/app.h}
|
||||
*/
|
||||
@@ -1241,7 +1285,7 @@ bool wxSafeYield(wxWindow* win = NULL, bool onlyIfNeeded = false);
|
||||
This function initializes wxWidgets in a platform-dependent way. Use this if you
|
||||
are not using the default wxWidgets entry code (e.g. main or WinMain).
|
||||
|
||||
For example, you can initialize wxWidgets from an Microsoft Foundation Classes
|
||||
For example, you can initialize wxWidgets from a Microsoft Foundation Classes
|
||||
(MFC) application using this function.
|
||||
|
||||
@note This overload of wxEntry is available under all platforms.
|
||||
|
@@ -9,7 +9,7 @@
|
||||
@class wxAppProgressIndicator
|
||||
|
||||
A helper class that can be used to update the progress bar in the taskbar
|
||||
button on Windows and the dock icon on OS X.
|
||||
button on Windows and the dock icon on macOS.
|
||||
|
||||
@library{wxcore}
|
||||
@category{misc}
|
||||
|
@@ -133,5 +133,40 @@ public:
|
||||
Returns @true to suppress subsequent asserts, @false to continue as before.
|
||||
*/
|
||||
virtual bool ShowAssertDialog(const wxString& msg) = 0;
|
||||
|
||||
/**
|
||||
Shows a message box with the given text and title if possible.
|
||||
|
||||
In some ports, e.g. wxMSW, a message box will always be shown, while in
|
||||
the other ones it will be only done if the GUI is available (e.g. X11
|
||||
display was successfully opened for X11-based ports) and the function
|
||||
simply returns @false without doing anything otherwise.
|
||||
|
||||
This function is safe in the sense that it can always be called, even
|
||||
before creating wxApp, similarly to wxSafeShowMessage() which is
|
||||
implemented by calling this function and then logging the message to
|
||||
standard error stream if it returned @false.
|
||||
|
||||
@since 3.1.5
|
||||
|
||||
@param text
|
||||
The text to show to the user.
|
||||
@param title
|
||||
The title of the message box shown to the user.
|
||||
@return @true if the message box was shown or @false otherwise.
|
||||
*/
|
||||
virtual bool SafeMessageBox(const wxString& text, const wxString& title) = 0;
|
||||
|
||||
/**
|
||||
Helper function mostly useful for derived classes ShowAssertDialog()
|
||||
implementation.
|
||||
|
||||
Returns the stack frame as a plain (and possibly empty) wxString.
|
||||
|
||||
This function is only available when @c wxUSE_STACKWALKER is 1.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
virtual wxString GetAssertStackTrace();
|
||||
};
|
||||
|
||||
|
@@ -363,7 +363,8 @@ public:
|
||||
This function can be used with wxSortedArrayString::Sort() or passed as an
|
||||
argument to wxSortedArrayString constructor.
|
||||
|
||||
@see wxStringSortDescending(), wxDictionaryStringSortAscending()
|
||||
@see wxStringSortDescending(), wxDictionaryStringSortAscending(),
|
||||
wxNaturalStringSortAscending()
|
||||
|
||||
@since 3.1.0
|
||||
*/
|
||||
@@ -375,7 +376,8 @@ int wxStringSortAscending(const wxString& s1, const wxString& s2);
|
||||
This function can be used with wxSortedArrayString::Sort() or passed as an
|
||||
argument to wxSortedArrayString constructor.
|
||||
|
||||
@see wxStringSortAscending(), wxDictionaryStringSortAscending()
|
||||
@see wxStringSortAscending(), wxDictionaryStringSortDescending(),
|
||||
wxNaturalStringSortDescending()
|
||||
|
||||
@since 3.1.0
|
||||
*/
|
||||
@@ -392,7 +394,9 @@ int wxStringSortDescending(const wxString& s1, const wxString& s2);
|
||||
This function can be used with wxSortedArrayString::Sort() or passed as an
|
||||
argument to wxSortedArrayString constructor.
|
||||
|
||||
@see wxStringSortAscending(), wxDictionaryStringSortDescending()
|
||||
@see wxDictionaryStringSortDescending(),
|
||||
wxStringSortAscending(),
|
||||
wxNaturalStringSortAscending()
|
||||
|
||||
@since 3.1.0
|
||||
*/
|
||||
@@ -403,11 +407,91 @@ int wxDictionaryStringSortAscending(const wxString& s1, const wxString& s2);
|
||||
|
||||
See wxDictionaryStringSortAscending() for the dictionary sort description.
|
||||
|
||||
@see wxStringSortDescending()
|
||||
@see wxDictionaryStringSortAscending(),
|
||||
wxStringSortDescending(),
|
||||
wxNaturalStringSortDescending()
|
||||
|
||||
@since 3.1.0
|
||||
*/
|
||||
int wxDictionaryStringSortAscending(const wxString& s1, const wxString& s2);
|
||||
int wxDictionaryStringSortDescending(const wxString& s1, const wxString& s2);
|
||||
|
||||
|
||||
/**
|
||||
Comparison function comparing strings in natural order.
|
||||
|
||||
This function can be used with wxSortedArrayString::Sort()
|
||||
or passed as an argument to wxSortedArrayString constructor.
|
||||
|
||||
See wxCmpNatural() for more information about how natural
|
||||
sort order is implemented.
|
||||
|
||||
@see wxNaturalStringSortDescending(),
|
||||
wxStringSortAscending(), wxDictionaryStringSortAscending()
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
int wxNaturalStringSortAscending(const wxString& s1, const wxString& s2);
|
||||
|
||||
/**
|
||||
Comparison function comparing strings in reverse natural order.
|
||||
|
||||
This function can be used with wxSortedArrayString::Sort()
|
||||
or passed as an argument to wxSortedArrayString constructor.
|
||||
|
||||
See wxCmpNatural() for more information about how natural
|
||||
sort order is implemented.
|
||||
|
||||
@see wxNaturalStringSortAscending(),
|
||||
wxStringSortDescending(), wxDictionaryStringSortDescending()
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
int wxNaturalStringSortDescending(const wxString& s1, const wxString& s2);
|
||||
|
||||
/**
|
||||
This function compares strings using case-insensitive collation and
|
||||
additionally, numbers within strings are recognised and compared
|
||||
numerically, rather than alphabetically. When used for sorting,
|
||||
the result is that e.g. file names containing numbers are sorted
|
||||
in a natural way.
|
||||
|
||||
For example, sorting with a simple string comparison results in:
|
||||
- file1.txt
|
||||
- file10.txt
|
||||
- file100.txt
|
||||
- file2.txt
|
||||
- file20.txt
|
||||
- file3.txt
|
||||
|
||||
But sorting the same strings in natural sort order results in:
|
||||
- file1.txt
|
||||
- file2.txt
|
||||
- file3.txt
|
||||
- file10.txt
|
||||
- file20.txt
|
||||
- file100.txt
|
||||
|
||||
wxCmpNatural() uses an OS native natural sort function when available
|
||||
(currently only under Microsoft Windows), wxCmpNaturalGeneric() otherwise.
|
||||
|
||||
Be aware that OS native implementations might differ from each other,
|
||||
and might change behaviour from release to release.
|
||||
|
||||
@see wxNaturalStringSortAscending(), wxNaturalStringSortDescending()
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
int wxCmpNatural(const wxString& s1, const wxString& s2);
|
||||
|
||||
/**
|
||||
This is wxWidgets' own implementation of the natural sort comparison function.
|
||||
|
||||
@see wxCmpNatural()
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
int wxCmpNaturalGeneric(const wxString& s1, const wxString& s2);
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Global functions/macros
|
||||
@@ -439,7 +523,18 @@ wxArrayString wxSplit(const wxString& str, const wxChar sep,
|
||||
If the @a escape character is non-@NULL, then it's used as prefix for each
|
||||
occurrence of @a sep in the strings contained in @a arr before joining them
|
||||
which is necessary in order to be able to recover the original array
|
||||
contents from the string later using wxSplit().
|
||||
contents from the string later using wxSplit(). The @a escape characters
|
||||
themselves are @e not escaped when they occur in the middle of the @a arr
|
||||
elements, but @e are escaped when they occur at the end, i.e.
|
||||
@code
|
||||
wxArrayString arr;
|
||||
arr.push_back("foo^");
|
||||
arr.push_back("bar^baz");
|
||||
wxPuts(wxJoin(arr, ':', '^')); // prints "foo^^:bar^baz"
|
||||
@endcode
|
||||
|
||||
In any case, applying wxSplit() to the result of wxJoin() is guaranteed to
|
||||
recover the original array.
|
||||
|
||||
@see wxSplit()
|
||||
|
||||
|
@@ -16,80 +16,80 @@ typedef wxString wxArtClient;
|
||||
typedef wxString wxArtID;
|
||||
|
||||
|
||||
wxArtClient wxART_TOOLBAR;
|
||||
wxArtClient wxART_MENU;
|
||||
wxArtClient wxART_FRAME_ICON;
|
||||
const char* wxART_TOOLBAR;
|
||||
const char* wxART_MENU;
|
||||
const char* wxART_FRAME_ICON;
|
||||
|
||||
wxArtClient wxART_CMN_DIALOG;
|
||||
wxArtClient wxART_HELP_BROWSER;
|
||||
wxArtClient wxART_MESSAGE_BOX;
|
||||
wxArtClient wxART_BUTTON;
|
||||
wxArtClient wxART_LIST;
|
||||
const char* wxART_CMN_DIALOG;
|
||||
const char* wxART_HELP_BROWSER;
|
||||
const char* wxART_MESSAGE_BOX;
|
||||
const char* wxART_BUTTON;
|
||||
const char* wxART_LIST;
|
||||
|
||||
wxArtClient wxART_OTHER;
|
||||
const char* wxART_OTHER;
|
||||
|
||||
|
||||
wxArtID wxART_ADD_BOOKMARK;
|
||||
wxArtID wxART_DEL_BOOKMARK;
|
||||
wxArtID wxART_HELP_SIDE_PANEL;
|
||||
wxArtID wxART_HELP_SETTINGS;
|
||||
wxArtID wxART_HELP_BOOK;
|
||||
wxArtID wxART_HELP_FOLDER;
|
||||
wxArtID wxART_HELP_PAGE;
|
||||
wxArtID wxART_GO_BACK;
|
||||
wxArtID wxART_GO_FORWARD;
|
||||
wxArtID wxART_GO_UP;
|
||||
wxArtID wxART_GO_DOWN;
|
||||
wxArtID wxART_GO_TO_PARENT;
|
||||
wxArtID wxART_GO_HOME;
|
||||
wxArtID wxART_GOTO_FIRST;
|
||||
wxArtID wxART_GOTO_LAST;
|
||||
wxArtID wxART_FILE_OPEN;
|
||||
wxArtID wxART_FILE_SAVE;
|
||||
wxArtID wxART_FILE_SAVE_AS;
|
||||
wxArtID wxART_PRINT;
|
||||
wxArtID wxART_HELP;
|
||||
wxArtID wxART_TIP;
|
||||
wxArtID wxART_REPORT_VIEW;
|
||||
wxArtID wxART_LIST_VIEW;
|
||||
wxArtID wxART_NEW_DIR;
|
||||
wxArtID wxART_HARDDISK;
|
||||
wxArtID wxART_FLOPPY;
|
||||
wxArtID wxART_CDROM;
|
||||
wxArtID wxART_REMOVABLE;
|
||||
wxArtID wxART_FOLDER;
|
||||
wxArtID wxART_FOLDER_OPEN;
|
||||
wxArtID wxART_GO_DIR_UP;
|
||||
wxArtID wxART_EXECUTABLE_FILE;
|
||||
wxArtID wxART_NORMAL_FILE;
|
||||
wxArtID wxART_TICK_MARK;
|
||||
wxArtID wxART_CROSS_MARK;
|
||||
wxArtID wxART_ERROR;
|
||||
wxArtID wxART_QUESTION;
|
||||
wxArtID wxART_WARNING;
|
||||
wxArtID wxART_INFORMATION;
|
||||
wxArtID wxART_MISSING_IMAGE;
|
||||
const char* wxART_ADD_BOOKMARK;
|
||||
const char* wxART_DEL_BOOKMARK;
|
||||
const char* wxART_HELP_SIDE_PANEL;
|
||||
const char* wxART_HELP_SETTINGS;
|
||||
const char* wxART_HELP_BOOK;
|
||||
const char* wxART_HELP_FOLDER;
|
||||
const char* wxART_HELP_PAGE;
|
||||
const char* wxART_GO_BACK;
|
||||
const char* wxART_GO_FORWARD;
|
||||
const char* wxART_GO_UP;
|
||||
const char* wxART_GO_DOWN;
|
||||
const char* wxART_GO_TO_PARENT;
|
||||
const char* wxART_GO_HOME;
|
||||
const char* wxART_GOTO_FIRST;
|
||||
const char* wxART_GOTO_LAST;
|
||||
const char* wxART_FILE_OPEN;
|
||||
const char* wxART_FILE_SAVE;
|
||||
const char* wxART_FILE_SAVE_AS;
|
||||
const char* wxART_PRINT;
|
||||
const char* wxART_HELP;
|
||||
const char* wxART_TIP;
|
||||
const char* wxART_REPORT_VIEW;
|
||||
const char* wxART_LIST_VIEW;
|
||||
const char* wxART_NEW_DIR;
|
||||
const char* wxART_HARDDISK;
|
||||
const char* wxART_FLOPPY;
|
||||
const char* wxART_CDROM;
|
||||
const char* wxART_REMOVABLE;
|
||||
const char* wxART_FOLDER;
|
||||
const char* wxART_FOLDER_OPEN;
|
||||
const char* wxART_GO_DIR_UP;
|
||||
const char* wxART_EXECUTABLE_FILE;
|
||||
const char* wxART_NORMAL_FILE;
|
||||
const char* wxART_TICK_MARK;
|
||||
const char* wxART_CROSS_MARK;
|
||||
const char* wxART_ERROR;
|
||||
const char* wxART_QUESTION;
|
||||
const char* wxART_WARNING;
|
||||
const char* wxART_INFORMATION;
|
||||
const char* wxART_MISSING_IMAGE;
|
||||
|
||||
wxArtID wxART_COPY;
|
||||
wxArtID wxART_CUT;
|
||||
wxArtID wxART_PASTE;
|
||||
wxArtID wxART_DELETE;
|
||||
wxArtID wxART_NEW;
|
||||
const char* wxART_COPY;
|
||||
const char* wxART_CUT;
|
||||
const char* wxART_PASTE;
|
||||
const char* wxART_DELETE;
|
||||
const char* wxART_NEW;
|
||||
|
||||
wxArtID wxART_UNDO;
|
||||
wxArtID wxART_REDO;
|
||||
const char* wxART_UNDO;
|
||||
const char* wxART_REDO;
|
||||
|
||||
wxArtID wxART_PLUS;
|
||||
wxArtID wxART_MINUS;
|
||||
const char* wxART_PLUS;
|
||||
const char* wxART_MINUS;
|
||||
|
||||
wxArtID wxART_CLOSE;
|
||||
wxArtID wxART_QUIT;
|
||||
const char* wxART_CLOSE;
|
||||
const char* wxART_QUIT;
|
||||
|
||||
wxArtID wxART_FIND;
|
||||
wxArtID wxART_FIND_AND_REPLACE;
|
||||
const char* wxART_FIND;
|
||||
const char* wxART_FIND_AND_REPLACE;
|
||||
|
||||
wxArtID wxART_FULL_SCREEN;
|
||||
wxArtID wxART_EDIT;
|
||||
const char* wxART_FULL_SCREEN;
|
||||
const char* wxART_EDIT;
|
||||
|
||||
|
||||
/**
|
||||
@@ -110,13 +110,21 @@ wxArtID wxART_EDIT;
|
||||
class MyProvider : public wxArtProvider
|
||||
{
|
||||
protected:
|
||||
// Override this method to return a bundle containing the required
|
||||
// bitmap in all available sizes.
|
||||
wxBitmapBundle CreateBitmapBundle(const wxArtID& id,
|
||||
const wxArtClient& client,
|
||||
const wxSize& size) override;
|
||||
|
||||
// If all bitmaps are available in a single size only, it may be
|
||||
// simpler to override just this one.
|
||||
wxBitmap CreateBitmap(const wxArtID& id,
|
||||
const wxArtClient& client,
|
||||
const wxSize size)
|
||||
const wxSize& size) override;
|
||||
|
||||
// optionally override this one as well
|
||||
wxIconBundle CreateIconBundle(const wxArtID& id,
|
||||
const wxArtClient& client)
|
||||
const wxArtClient& client) override;
|
||||
{ ... }
|
||||
};
|
||||
...
|
||||
@@ -128,12 +136,12 @@ wxArtID wxART_EDIT;
|
||||
and supplying icon bundles that contain different bitmap sizes.
|
||||
|
||||
There's another way of taking advantage of this class: you can use it in your
|
||||
code and use platform native icons as provided by wxArtProvider::GetBitmap or
|
||||
wxArtProvider::GetIcon.
|
||||
code and use platform native icons as provided by wxArtProvider::GetBitmapBundle
|
||||
or wxArtProvider::GetIcon.
|
||||
|
||||
@section artprovider_identify Identifying art resources
|
||||
|
||||
Every bitmap and icon bundle are known to wxArtProvider under an unique ID that
|
||||
Every bitmap and icon bundle are known to wxArtProvider under a unique ID that
|
||||
is used when requesting a resource from it. The ID is represented by the ::wxArtID type
|
||||
and can have one of these predefined values (you can see bitmaps represented by these
|
||||
constants in the @ref page_samples_artprov):
|
||||
@@ -200,6 +208,10 @@ wxArtID wxART_EDIT;
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
@note When building with @c wxNO_IMPLICIT_WXSTRING_ENCODING defined (see
|
||||
@ref overview_string for more details), you need to explicitly use
|
||||
wxASCII_STR() around these constants.
|
||||
|
||||
Additionally, any string recognized by custom art providers registered using
|
||||
wxArtProvider::Push may be used.
|
||||
|
||||
@@ -212,7 +224,7 @@ wxArtID wxART_EDIT;
|
||||
#endif
|
||||
@endcode
|
||||
For a list of the GTK+ stock items please refer to the
|
||||
<a href="http://library.gnome.org/devel/gtk/stable/gtk-Stock-Items.html">GTK+ documentation
|
||||
<a href="https://developer-old.gnome.org/gtk3/stable/gtk3-Stock-Items.html">GTK+ documentation
|
||||
page</a>.
|
||||
It is also possible to load icons from the current icon theme by specifying their name
|
||||
(without extension and directory components).
|
||||
@@ -268,6 +280,9 @@ public:
|
||||
/**
|
||||
Query registered providers for bitmap with given ID.
|
||||
|
||||
Note that applications using wxWidgets 3.1.6 or later should prefer
|
||||
calling GetBitmapBundle().
|
||||
|
||||
@param id
|
||||
wxArtID unique identifier of the bitmap.
|
||||
@param client
|
||||
@@ -282,6 +297,28 @@ public:
|
||||
const wxArtClient& client = wxART_OTHER,
|
||||
const wxSize& size = wxDefaultSize);
|
||||
|
||||
/**
|
||||
Query registered providers for a bundle of bitmaps with given ID.
|
||||
|
||||
@since 3.1.6
|
||||
|
||||
@param id
|
||||
wxArtID unique identifier of the bitmap.
|
||||
@param client
|
||||
wxArtClient identifier of the client (i.e. who is asking for the bitmap).
|
||||
@param size
|
||||
Default size for the returned bundle.
|
||||
|
||||
@return If any of the registered providers recognizes the ID in its
|
||||
CreateBitmapBundle(), this bundle is returned. Otherwise, if any of
|
||||
providers returns a valid bitmap from CreateBitmap(), the bundle
|
||||
containing only this bitmap is returned. Otherwise, an empty bundle
|
||||
is returned.
|
||||
*/
|
||||
static wxBitmapBundle GetBitmapBundle(const wxArtID& id,
|
||||
const wxArtClient& client = wxART_OTHER,
|
||||
const wxSize& size = wxDefaultSize);
|
||||
|
||||
/**
|
||||
Same as wxArtProvider::GetBitmap, but return a wxIcon object
|
||||
(or ::wxNullIcon on failure).
|
||||
@@ -400,8 +437,13 @@ public:
|
||||
protected:
|
||||
|
||||
/**
|
||||
Derived art provider classes must override this method to create requested art
|
||||
resource. Note that returned bitmaps are cached by wxArtProvider and it is
|
||||
Derived art provider classes may override this method to create requested art
|
||||
resource.
|
||||
|
||||
For bitmaps available in more than one size, CreateBitmapBundle()
|
||||
should be overridden instead.
|
||||
|
||||
Note that returned bitmaps are cached by wxArtProvider and it is
|
||||
therefore not necessary to optimize CreateBitmap() for speed (e.g. you may
|
||||
create wxBitmap objects from XPMs here).
|
||||
|
||||
@@ -425,6 +467,29 @@ protected:
|
||||
const wxArtClient& client,
|
||||
const wxSize& size);
|
||||
|
||||
/**
|
||||
Override this method to create the requested art resources available in
|
||||
more than one size.
|
||||
|
||||
Unlike CreateBitmap(), this method can be overridden to return the same
|
||||
bitmap in several (or all, if wxBitmapBundle::FromSVG() is used) sizes
|
||||
at once, which will allow selecting the size best suited for the
|
||||
current display resolution automatically.
|
||||
|
||||
@param id
|
||||
wxArtID unique identifier of the bitmap.
|
||||
@param client
|
||||
wxArtClient identifier of the client (i.e. who is asking for the bitmap).
|
||||
This only serves as a hint.
|
||||
@param size
|
||||
Default size of the bitmaps returned by the bundle.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
virtual wxBitmapBundle CreateBitmapBundle(const wxArtID& id,
|
||||
const wxArtClient& client,
|
||||
const wxSize& size);
|
||||
|
||||
/**
|
||||
This method is similar to CreateBitmap() but can be used when a bitmap
|
||||
(or an icon) exists in several sizes.
|
||||
|
@@ -90,7 +90,7 @@ enum wxAuiToolBarStyle
|
||||
enum wxAuiToolBarArtSetting
|
||||
{
|
||||
/**
|
||||
wxAuiToolBar seperator size.
|
||||
wxAuiToolBar separator size.
|
||||
*/
|
||||
wxAUI_TBART_SEPARATOR_SIZE = 0,
|
||||
|
||||
@@ -259,15 +259,22 @@ public:
|
||||
|
||||
/**
|
||||
Returns the toolbar item kind.
|
||||
|
||||
@return one of @c wxITEM_NORMAL, @c wxITEM_CHECK or @c wxITEM_RADIO,
|
||||
@c wxITEM_SEPARATOR, @c wxITEM_CONTROL, @c wxITEM_SPACER, @c wxITEM_LABEL,
|
||||
*/
|
||||
int GetKind() const;
|
||||
|
||||
/**
|
||||
Set the current state of the toolbar item.
|
||||
|
||||
@param new_state is an or'd combination of flags from wxAuiPaneButtonState
|
||||
*/
|
||||
void SetState(int new_state);
|
||||
/**
|
||||
Gets the current state of the toolbar item.
|
||||
|
||||
@return an or'd combination of flags from wxAuiPaneButtonState representing the current state
|
||||
*/
|
||||
int GetState() const;
|
||||
|
||||
@@ -407,6 +414,13 @@ public:
|
||||
|
||||
*/
|
||||
int GetAlignment() const;
|
||||
|
||||
/**
|
||||
Returns whether the toolbar item can be toggled.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
bool CanBeToggled() const;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -603,26 +617,34 @@ public:
|
||||
|
||||
@beginStyleTable
|
||||
@style{wxAUI_TB_TEXT}
|
||||
Display the label strings on the toolbar buttons.
|
||||
@style{wxAUI_TB_NO_TOOLTIPS}
|
||||
Do not show tooltips for the toolbar items.
|
||||
@style{wxAUI_TB_NO_AUTORESIZE}
|
||||
Do not automatically resize the toolbar when new tools are added.
|
||||
@style{wxAUI_TB_GRIPPER}
|
||||
Show the toolbar's gripper control. If the toolbar is added to
|
||||
an AUI pane that contains a gripper, this style will be automatically
|
||||
set.
|
||||
@style{wxAUI_TB_OVERFLOW}
|
||||
Show an overflow menu containing toolbar items that can't fit on the
|
||||
toolbar if it is too small.
|
||||
@style{wxAUI_TB_VERTICAL}
|
||||
using this style forces the toolbar to be vertical and
|
||||
Using this style forces the toolbar to be vertical and
|
||||
be only dockable to the left or right sides of the window
|
||||
whereas by default it can be horizontal or vertical and
|
||||
be docked anywhere
|
||||
be docked anywhere.
|
||||
@style{wxAUI_TB_HORZ_LAYOUT}
|
||||
@style{wxAUI_TB_HORIZONTAL}
|
||||
analogous to wxAUI_TB_VERTICAL, but forces the toolbar
|
||||
to be horizontal
|
||||
Analogous to wxAUI_TB_VERTICAL, but forces the toolbar
|
||||
to be horizontal.
|
||||
@style{wxAUI_TB_PLAIN_BACKGROUND}
|
||||
Draw a plain background (based on parent) instead of the
|
||||
default gradient background.
|
||||
@style{wxAUI_TB_HORZ_TEXT}
|
||||
Equivalent to wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_TEXT
|
||||
@style{wxAUI_TB_DEFAULT_STYLE}
|
||||
The default is to have no styles
|
||||
The default is to have no styles.
|
||||
@endStyleTable
|
||||
|
||||
@beginEventEmissionTable{wxAuiToolBarEvent}
|
||||
@@ -847,6 +869,18 @@ public:
|
||||
wxString GetToolLongHelp(int toolId) const;
|
||||
void SetToolLongHelp(int toolId, const wxString& help_string);
|
||||
|
||||
/**
|
||||
Add toolbar items that are always displayed in the overflow menu.
|
||||
|
||||
If there are custom items set, then the overflow menu will be
|
||||
displayed even if there are no items from the main toolbar that
|
||||
overflow.
|
||||
|
||||
@param prepend are the items to show before any overflow items
|
||||
@param append are the items to show after any overflow items
|
||||
|
||||
@note The toolbar must have the @c wxAUI_TB_OVERFLOW style.
|
||||
*/
|
||||
void SetCustomOverflowItems(const wxAuiToolBarItemArray& prepend,
|
||||
const wxAuiToolBarItemArray& append);
|
||||
|
||||
|
@@ -208,6 +208,11 @@ public:
|
||||
*/
|
||||
virtual ~wxAuiDockArt();
|
||||
|
||||
/**
|
||||
Create a copy of this wxAuiDockArt instance.
|
||||
*/
|
||||
virtual wxAuiDockArt* Clone() = 0;
|
||||
|
||||
/**
|
||||
Draws a background.
|
||||
*/
|
||||
@@ -297,6 +302,7 @@ public:
|
||||
|
||||
wxAuiDefaultDockArt();
|
||||
|
||||
virtual wxAuiDockArt* Clone();
|
||||
int GetMetric(int metricId);
|
||||
void SetMetric(int metricId, int newVal);
|
||||
wxColour GetColour(int id);
|
||||
|
@@ -23,6 +23,13 @@ public:
|
||||
void SetPaneWindow(const wxAuiPaneInfo& pane);
|
||||
wxAuiManager* GetOwnerManager() const;
|
||||
|
||||
/**
|
||||
Returns the embedded wxAuiManager managing this floating pane's contents.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxAuiManager& GetAuiManager();
|
||||
|
||||
protected:
|
||||
virtual void OnMoveStart();
|
||||
virtual void OnMoving(const wxRect& windowRect, wxDirection dir);
|
||||
|
@@ -207,6 +207,19 @@ public:
|
||||
const wxPoint& drop_pos);
|
||||
//@}
|
||||
|
||||
/**
|
||||
Returns true if live resize is always used on the current platform.
|
||||
|
||||
If this function returns true, ::wxAUI_MGR_LIVE_RESIZE flag is ignored
|
||||
and live resize is always used, whether it's specified or not.
|
||||
|
||||
Currently this is the case for wxOSX and wxGTK3 ports, as live resizing
|
||||
is the only implemented method there.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
static bool AlwaysUsesLiveResize();
|
||||
|
||||
/**
|
||||
This function is used by controls to calculate the drop hint rectangle.
|
||||
|
||||
@@ -310,6 +323,20 @@ public:
|
||||
wxAuiPaneInfo& GetPane(const wxString& name);
|
||||
//@}
|
||||
|
||||
/**
|
||||
Returns true if windows are resized live.
|
||||
|
||||
This function combines the check for AlwaysUsesLiveResize() and, for
|
||||
the platforms where live resizing is optional, the check for
|
||||
wxAUI_MGR_LIVE_RESIZE flag.
|
||||
|
||||
Using this accessor allows to verify whether live resizing is being
|
||||
actually used.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
bool HasLiveResize() const;
|
||||
|
||||
/**
|
||||
HideHint() hides any docking hint that may be visible.
|
||||
*/
|
||||
@@ -457,11 +484,12 @@ public:
|
||||
void StartPaneDrag(wxWindow* paneWindow, const wxPoint& offset);
|
||||
|
||||
/**
|
||||
Uninitializes the framework and should be called before a managed frame or
|
||||
window is destroyed. UnInit() is usually called in the managed wxFrame's
|
||||
destructor. It is necessary to call this function before the managed frame
|
||||
or window is destroyed, otherwise the manager cannot remove its custom event
|
||||
handlers from a window.
|
||||
Dissociate the managed window from the manager.
|
||||
|
||||
This function may be called before the managed frame or window is
|
||||
destroyed, but, since wxWidgets 3.1.4, it's unnecessary to call it
|
||||
explicitly, as it will be called automatically when this window is
|
||||
destroyed, as well as when the manager itself is.
|
||||
*/
|
||||
void UnInit();
|
||||
|
||||
|
@@ -359,9 +359,6 @@ public:
|
||||
This can be useful to display a cursor as it cannot be drawn directly
|
||||
on a window.
|
||||
|
||||
This constructor only exists in wxMSW and wxGTK (where it is
|
||||
implemented for GTK+ 2.8 or later) only.
|
||||
|
||||
@param cursor A valid wxCursor.
|
||||
|
||||
@since 3.1.0
|
||||
@@ -405,6 +402,15 @@ public:
|
||||
*/
|
||||
static void CleanUpHandlers();
|
||||
|
||||
/**
|
||||
Returns disabled (dimmed) version of the bitmap.
|
||||
|
||||
This method is not available when <code>wxUSE_IMAGE == 0</code>.
|
||||
|
||||
@since 2.9.0
|
||||
*/
|
||||
wxBitmap ConvertToDisabled(unsigned char brightness = 255) const;
|
||||
|
||||
/**
|
||||
Creates an image from a platform-dependent bitmap. This preserves
|
||||
mask information so that bitmaps and images can be converted back
|
||||
@@ -445,7 +451,7 @@ public:
|
||||
@param height
|
||||
The height of the bitmap in pixels, must be strictly positive.
|
||||
@param dc
|
||||
DC from wich the scaling factor is inherited
|
||||
DC from which the scaling factor is inherited
|
||||
|
||||
@return @true if the creation was successful.
|
||||
|
||||
@@ -463,7 +469,7 @@ public:
|
||||
@param depth
|
||||
The number of bits used to represent each bitmap pixel.
|
||||
@param logicalScale
|
||||
Scale factor used by the bitmap
|
||||
Scale factor used by the bitmap, see SetScaleFactor().
|
||||
|
||||
@return @true if the creation was successful.
|
||||
|
||||
@@ -545,7 +551,7 @@ public:
|
||||
/**
|
||||
Gets the height of the bitmap in pixels.
|
||||
|
||||
@see GetWidth(), GetSize()
|
||||
@see GetWidth(), GetSize(), GetScaledHeight()
|
||||
*/
|
||||
virtual int GetHeight() const;
|
||||
|
||||
@@ -571,28 +577,75 @@ public:
|
||||
*/
|
||||
virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
|
||||
|
||||
/**
|
||||
Returns the scale factor of this bitmap.
|
||||
|
||||
Scale factor is 1 by default, but can be greater to indicate that the
|
||||
size of bitmap in logical, DPI-independent pixels is smaller than its
|
||||
actual size in physical pixels. Bitmaps with scale factor greater than
|
||||
1 must be used in high DPI to appear sharp on the screen.
|
||||
|
||||
Note that the scale factor is only used in the ports where logical
|
||||
pixels are not the same as physical ones, such as wxOSX or wxGTK3, and
|
||||
this function always returns 1 under the other platforms.
|
||||
|
||||
@see SetScaleFactor(), GetScaledWidth(), GetScaledHeight(), GetScaledSize()
|
||||
|
||||
@since 2.9.5
|
||||
*/
|
||||
virtual double GetScaleFactor() const;
|
||||
|
||||
/**
|
||||
Returns the scaled height of the bitmap.
|
||||
|
||||
See GetScaledSize() for more information.
|
||||
|
||||
@see GetScaledWidth(), GetHeight()
|
||||
|
||||
@since 2.9.5
|
||||
*/
|
||||
virtual double GetScaledHeight() const;
|
||||
|
||||
/**
|
||||
Returns the scaled size of the bitmap.
|
||||
|
||||
The scaled size of the bitmap is its size in pixels, as returned by
|
||||
GetSize(), divided by its scale factor, as returned by
|
||||
GetScaleFactor(), and so is the same as the normal size for bitmaps
|
||||
with the default scale factor of 1 and always less than the physical
|
||||
size for the higher resolution bitmaps supposed to be used on high DPI
|
||||
screens.
|
||||
|
||||
@see GetScaledWidth(), GetScaledHeight(), GetSize()
|
||||
|
||||
@since 2.9.5
|
||||
*/
|
||||
virtual wxSize GetScaledSize() const;
|
||||
|
||||
/**
|
||||
Returns the scaled width of the bitmap.
|
||||
|
||||
See GetScaledSize() for more information.
|
||||
|
||||
@see GetScaledHeight(), GetWidth()
|
||||
|
||||
@since 2.9.5
|
||||
*/
|
||||
virtual double GetScaledWidth() const;
|
||||
|
||||
/**
|
||||
Returns the size of the bitmap in pixels.
|
||||
|
||||
@since 2.9.0
|
||||
|
||||
@see GetHeight(), GetWidth()
|
||||
@see GetHeight(), GetWidth(), GetScaledSize()
|
||||
*/
|
||||
wxSize GetSize() const;
|
||||
|
||||
/**
|
||||
Returns disabled (dimmed) version of the bitmap.
|
||||
|
||||
This method is not available when <code>wxUSE_IMAGE == 0</code>.
|
||||
|
||||
@since 2.9.0
|
||||
*/
|
||||
wxBitmap ConvertToDisabled(unsigned char brightness = 255) const;
|
||||
|
||||
/**
|
||||
Gets the width of the bitmap in pixels.
|
||||
|
||||
@see GetHeight(), GetSize()
|
||||
@see GetHeight(), GetSize(), GetScaledWidth()
|
||||
*/
|
||||
virtual int GetWidth() const;
|
||||
|
||||
@@ -665,7 +718,7 @@ public:
|
||||
@endcode
|
||||
in your application startup code.
|
||||
|
||||
However under OS X this function uses native image loading and so
|
||||
However under macOS this function uses native image loading and so
|
||||
doesn't require wxWidgets PNG support.
|
||||
|
||||
@since 2.9.5
|
||||
@@ -685,6 +738,21 @@ public:
|
||||
*/
|
||||
static bool RemoveHandler(const wxString& name);
|
||||
|
||||
/**
|
||||
Rescale the given bitmap to the requested size.
|
||||
|
||||
This function is just a convenient wrapper for wxImage::Rescale() used
|
||||
to resize the given @a bmp to the requested size. If you need more
|
||||
control over resizing, e.g. to specify the quality option different
|
||||
from ::wxIMAGE_QUALITY_HIGH used by default, please use wxImage
|
||||
function directly instead.
|
||||
|
||||
Both the bitmap itself and size must be valid.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
static void Rescale(wxBitmap& bmp, const wxSize& sizeNeeded);
|
||||
|
||||
/**
|
||||
Saves a bitmap in the named file.
|
||||
|
||||
@@ -729,6 +797,38 @@ public:
|
||||
*/
|
||||
virtual void SetHeight(int height);
|
||||
|
||||
/**
|
||||
Sets the bitmap scale factor.
|
||||
|
||||
This doesn't change the bitmap actual size or its contents, but changes
|
||||
its scale factor, so that it appears in a smaller size when it is drawn
|
||||
on screen: e.g. setting @a scale to 2 means that the bitmap will be
|
||||
twice smaller (in each direction) when drawn on screen in the ports in
|
||||
which logical and physical pixels differ (i.e. wxOSX and wxGTK3, but
|
||||
not wxMSW).
|
||||
|
||||
When creating a new bitmap, CreateScaled() can be used to specify the
|
||||
correct scale factor from the beginning.
|
||||
|
||||
Note that this method exists in all ports, but simply does nothing in
|
||||
those of them that don't use logical pixel scaling. The preprocessor
|
||||
symbol @c wxHAS_BITMAP_SCALE_FACTOR can be tested to determine whether
|
||||
the scale factor is really supported, e.g.
|
||||
|
||||
@code
|
||||
bitmap.SetScaleFactor(2);
|
||||
|
||||
// In the other ports scale factor is always 1, so the assert would
|
||||
// fail there.
|
||||
#ifdef wxHAS_BITMAP_SCALE_FACTOR
|
||||
wxASSERT( bitmap.GetScaleFactor() == 2 );
|
||||
#endif
|
||||
@endcode
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
virtual void SetScaleFactor(double scale);
|
||||
|
||||
/**
|
||||
Sets the mask for this bitmap.
|
||||
|
||||
|
419
interface/wx/bmpbndl.h
Normal file
419
interface/wx/bmpbndl.h
Normal file
@@ -0,0 +1,419 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/bmpbndl.h
|
||||
// Purpose: Interface of wxBitmapBundle.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2021-09-24
|
||||
// Copyright: (c) 2021 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
Contains representations of the same bitmap in different resolutions.
|
||||
|
||||
This class generalizes wxBitmap for applications supporting multiple DPIs
|
||||
and allows to operate with multiple versions of the same bitmap, in the
|
||||
sizes appropriate to the currently used display resolution, as a single
|
||||
unit. Notably, an entire wxBitmapBundle can be passed to functions such as
|
||||
wxToolBar::AddTool() to allow toolbar to select the best available bitmap
|
||||
to be shown.
|
||||
|
||||
Objects of this class are typically created by the application and then
|
||||
passed to wxWidgets functions, but not used by the application itself.
|
||||
Currently bitmap bundles can be created from:
|
||||
|
||||
- A vector of bitmaps, of any provenance.
|
||||
- A single wxBitmap or wxImage for backwards compatibility.
|
||||
|
||||
More functions for creating bitmap bundles will be added in the future.
|
||||
|
||||
Objects of wxBitmapBundle class have value-like semantics, i.e. they can be
|
||||
copied around freely (and cheaply) and don't need to be allocated on the
|
||||
heap. However they usually are created using static factory functions
|
||||
(known as "pseudo-constructors") such as FromBitmaps() instead of using the
|
||||
real constructors.
|
||||
|
||||
Example of using this class to initialize a toolbar in a frame constructor:
|
||||
@code
|
||||
MyFrame::MyFrame()
|
||||
: wxFrame(nullptr, wxID_ANY, "My frame")
|
||||
{
|
||||
...
|
||||
wxToolBar* toolBar = CreateToolBar();
|
||||
|
||||
wxVector<wxBitmap> bitmaps;
|
||||
bitmaps.push_back(wxBITMAP_PNG(open_32x32));
|
||||
bitmaps.push_back(wxBITMAP_PNG(open_48x48));
|
||||
bitmaps.push_back(wxBITMAP_PNG(open_64x64));
|
||||
|
||||
toolBar->AddTool(wxID_OPEN, wxBitmapBundle::FromBitmaps(bitmaps));
|
||||
}
|
||||
@endcode
|
||||
|
||||
The code shown above will use 32 pixel bitmap in normal DPI, 64 pixel
|
||||
bitmap in "high DPI", i.e. pixel-doubling or 200% resolution, and 48 pixel
|
||||
bitmap in 150% resolution. For all the other resolutions, the best matching
|
||||
bitmap will be created dynamically from the best available match, e.g. for
|
||||
175% resolution, 64 pixel bitmap will be rescaled to 56 pixels.
|
||||
|
||||
Of course, this code relies on actually having the resources with the
|
||||
corresponding names (i.e. @c open_NxN) in MSW .rc file or Mac application
|
||||
bundle and @c open_NxN_png arrays being defined in the program code, e.g.
|
||||
by including a file generated with @c bin2c (see wxBITMAP_PNG_FROM_DATA()),
|
||||
on the other platforms.
|
||||
|
||||
For the platforms with resources support, you can also create the bundle
|
||||
from the bitmaps defined in the resources, which has the advantage of not
|
||||
having to explicitly list all the bitmaps, e.g. the code above becomes
|
||||
@code
|
||||
#ifdef wxHAS_IMAGE_RESOURCES
|
||||
toolBar->AddTool(wxID_OPEN, wxBitmapBundle::FromResources("open"));
|
||||
#else
|
||||
... same code as shown above ...
|
||||
#endif
|
||||
@endcode
|
||||
and will load all resources called @c open, @c open_2x, @c open_1_5x etc
|
||||
(at least the first one of them must be available). See also
|
||||
wxBITMAP_BUNDLE_2() macro which can avoid the need to check for
|
||||
wxHAS_IMAGE_RESOURCES explicitly in the code in a common case of having
|
||||
only 2 embedded resources (for standard and high DPI).
|
||||
|
||||
Also note that the existing code using wxBitmap is compatible with the
|
||||
functions taking wxBitmapBundle in wxWidgets 3.1.6 and later because
|
||||
bitmaps are implicitly convertible to the objects of this class, so just
|
||||
passing wxBitmap to the functions taking wxBitmapBundle continues to work
|
||||
and if high resolution versions of bitmap are not (yet) available for the
|
||||
other toolbar tools, single bitmaps can continue to be used instead.
|
||||
|
||||
@library{wxcore}
|
||||
@category{gdi}
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
class wxBitmapBundle
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Default constructor constructs an empty bundle.
|
||||
|
||||
An empty bundle can't be used for anything, but can be assigned
|
||||
something else later.
|
||||
*/
|
||||
wxBitmapBundle();
|
||||
|
||||
/**
|
||||
Conversion constructor from a single bitmap.
|
||||
|
||||
This constructor does the same thing as FromBitmap() and only exists
|
||||
for interoperability with the existing code using wxBitmap.
|
||||
*/
|
||||
wxBitmapBundle(const wxBitmap& bitmap);
|
||||
|
||||
/**
|
||||
Conversion constructor from a single icon.
|
||||
|
||||
This constructor does the same thing as FromBitmap() and only exists
|
||||
for interoperability with the existing code using wxIcon.
|
||||
*/
|
||||
wxBitmapBundle(const wxIcon& icon);
|
||||
|
||||
/**
|
||||
Conversion constructor from a single image.
|
||||
|
||||
Similarly to the constructor from wxBitmap, this constructor only
|
||||
exists for interoperability with the existing code using wxImage and
|
||||
can be replaced with more readable FromImage() in the new code.
|
||||
*/
|
||||
wxBitmapBundle(const wxImage& image);
|
||||
|
||||
/**
|
||||
Copy constructor creates a copy of another bundle.
|
||||
*/
|
||||
wxBitmapBundle(const wxBitmapBundle& other);
|
||||
|
||||
/**
|
||||
Assignment operator makes this bundle a copy of another bundle.
|
||||
*/
|
||||
wxBitmapBundle& operator=(const wxBitmapBundle& other);
|
||||
|
||||
|
||||
/**
|
||||
Create a bundle from the given collection of bitmaps.
|
||||
|
||||
If the @a bitmaps vector is empty, an invalid, empty bundle is
|
||||
returned, otherwise initialize the bundle with all the bitmaps in this
|
||||
vector which must be themselves valid.
|
||||
*/
|
||||
static wxBitmapBundle FromBitmaps(const wxVector<wxBitmap>& bitmaps);
|
||||
|
||||
/// @overload
|
||||
static wxBitmapBundle FromBitmaps(const wxBitmap& bitmap1,
|
||||
const wxBitmap& bitmap2);
|
||||
|
||||
/**
|
||||
Create a bundle from a single bitmap.
|
||||
|
||||
This is only useful for compatibility with the existing code using
|
||||
wxBitmap.
|
||||
|
||||
If @a bitmap is invalid, empty bundle is returned.
|
||||
*/
|
||||
static wxBitmapBundle FromBitmap(const wxBitmap& bitmap);
|
||||
|
||||
/**
|
||||
Create a bundle from a single image.
|
||||
|
||||
This is only useful for compatibility with the existing code using
|
||||
wxImage.
|
||||
|
||||
If @a image is invalid, empty bundle is returned.
|
||||
*/
|
||||
static wxBitmapBundle FromImage(const wxImage& image);
|
||||
|
||||
/**
|
||||
Create a bundle from a custom bitmap bundle implementation.
|
||||
|
||||
This function can be used to create bundles implementing custom logic
|
||||
for creating the bitmaps, e.g. creating them on the fly rather than
|
||||
using predefined bitmaps.
|
||||
|
||||
See wxBitmapBundleImpl.
|
||||
|
||||
@param impl A valid, i.e. non-null, pointer. This function takes
|
||||
ownership of it, so the caller must @e not call DecRef() on it.
|
||||
*/
|
||||
static wxBitmapBundle FromImpl(wxBitmapBundleImpl* impl);
|
||||
|
||||
/**
|
||||
Create a bundle from the bitmaps in the application resources.
|
||||
|
||||
This function can only be used on the platforms supporting storing
|
||||
bitmaps in resources, and currently only works under MSW and simply
|
||||
returns an empty bundle on the other platforms.
|
||||
|
||||
Under MSW, for this function to create a valid bundle, you must have @c
|
||||
RCDATA resource with the given @a name in your application resource
|
||||
file (with the extension @c .rc) containing PNG file, and any other
|
||||
resources using @a name as prefix and suffix with the scale, e.g. "_2x"
|
||||
or "_1_5x" (for 150% DPI) will be also loaded as part of the bundle.
|
||||
*/
|
||||
static wxBitmapBundle FromResources(const wxString& name);
|
||||
|
||||
/**
|
||||
Create a bundle from bitmaps stored as files.
|
||||
|
||||
Looking in @a path for files using @a filename as prefix and potentionally a
|
||||
suffix with scale, e.g. "_2x" or "@2x"
|
||||
|
||||
@param path Path of the directory containing the files
|
||||
@param filename Bitmap's filename without any scale suffix
|
||||
@param extension File extension, without leading dot (`png` by default)
|
||||
*/
|
||||
static wxBitmapBundle FromFiles(const wxString& path, const wxString& filename, const wxString& extension = "png");
|
||||
|
||||
/// @overload
|
||||
static wxBitmapBundle FromFiles(const wxString& fullpathname);
|
||||
|
||||
/**
|
||||
Create a bundle from the SVG image.
|
||||
|
||||
Please note that the current implementation uses NanoSVG library
|
||||
(https://github.com/memononen/nanosvg) for parsing and rasterizing SVG
|
||||
images which imposes the following limitations:
|
||||
|
||||
- Text elements are not supported at all.
|
||||
- SVG 1.1 filters are not supported.
|
||||
|
||||
These limitations will be relaxed in the future wxWidgets versions.
|
||||
|
||||
Please also note that this method is only available in the ports
|
||||
providing raw bitmap access via wxPixelData. This is the case for all
|
||||
tier-1 ports, but not all of them, check if @c wxHAS_SVG is defined
|
||||
before using this method if for maximum portability.
|
||||
|
||||
@param data This data may, or not, have the XML document preamble, i.e.
|
||||
it can start either with @c "<?xml" processing instruction or
|
||||
directly with @c svg tag. Notice that two overloads of this
|
||||
function, taking const and non-const data, are provided: as the
|
||||
current implementation modifies the data while parsing, using the
|
||||
non-const variant is more efficient, as it avoids making copy of
|
||||
the data, but the data is consumed by it and can't be reused any
|
||||
more.
|
||||
@param sizeDef The default size to return from GetDefaultSize() for
|
||||
this bundle. As SVG images usually don't have any natural
|
||||
default size, it should be provided when creating the bundle.
|
||||
*/
|
||||
static wxBitmapBundle FromSVG(char* data, const wxSize& sizeDef);
|
||||
|
||||
/// @overload
|
||||
static wxBitmapBundle FromSVG(const char* data, const wxSize& sizeDef);
|
||||
|
||||
/**
|
||||
Check if bitmap bundle is non-empty.
|
||||
|
||||
Return @true if the bundle contains any bitmaps or @false if it is
|
||||
empty.
|
||||
*/
|
||||
bool IsOk() const;
|
||||
|
||||
/**
|
||||
Get the size of the bitmap represented by this bundle in default
|
||||
resolution or, equivalently, at 100% scaling.
|
||||
|
||||
When creating the bundle from a number of bitmaps, this will be just
|
||||
the size of the smallest bitmap in it.
|
||||
|
||||
Note that this function is mostly used by wxWidgets itself and not the
|
||||
application.
|
||||
*/
|
||||
wxSize GetDefaultSize() const;
|
||||
|
||||
/**
|
||||
Get the size that would be best to use for this bundle at the given DPI
|
||||
scaling factor.
|
||||
|
||||
For bundles containing some number of the fixed-size bitmaps, this
|
||||
function returns the size of an existing bitmap closest to the ideal
|
||||
size at the given scale, i.e. GetDefaultSize() multiplied by @a scale.
|
||||
|
||||
Passing a size returned by this function to GetBitmap() ensures that
|
||||
bitmap doesn't need to be rescaled, which typically significantly
|
||||
lowers its quality.
|
||||
*/
|
||||
wxSize GetPreferredSizeAtScale(double scale) const;
|
||||
|
||||
/**
|
||||
Get the size that would be best to use for this bundle at the DPI
|
||||
scaling factor used by the given window.
|
||||
|
||||
This is just a convenient wrapper for GetPreferredSizeAtScale() calling
|
||||
that function with the result of wxWindow::GetDPIScaleFactor().
|
||||
|
||||
@param window Non-null and fully created window.
|
||||
*/
|
||||
wxSize GetPreferredSizeFor(const wxWindow* window) const;
|
||||
|
||||
/**
|
||||
Get bitmap of the specified size, creating a new bitmap from the closest
|
||||
available size by rescaling it if necessary.
|
||||
|
||||
This function is mostly used by wxWidgets itself and not the
|
||||
application. As all bitmaps created by it dynamically are currently
|
||||
cached, avoid calling it for many different sizes if you do use it, as
|
||||
this will create many bitmaps that will never be deleted and will
|
||||
consume resources until the application termination.
|
||||
*/
|
||||
wxBitmap GetBitmap(const wxSize& size) const;
|
||||
|
||||
/**
|
||||
Get bitmap of the size appropriate for the DPI scaling used by the
|
||||
given window.
|
||||
|
||||
This helper function simply combines GetBitmap() and
|
||||
GetPreferredSizeFor(), i.e. it returns a (normally unscaled) bitmap
|
||||
from the bundle of the closest size to the size that should be used at
|
||||
the DPI scaling of the provided window.
|
||||
|
||||
@param window Non-null and fully created window.
|
||||
*/
|
||||
wxBitmap GetBitmapFor(const wxWindow* window) const;
|
||||
};
|
||||
|
||||
/**
|
||||
Base class for custom implementations of wxBitmapBundle.
|
||||
|
||||
This class shouldn't be used directly in the application code, but may be
|
||||
derived from to implement custom bitmap bundles.
|
||||
|
||||
Example of use:
|
||||
@code
|
||||
class MyCustomBitmapBundleImpl : public wxBitmapBundleImpl
|
||||
{
|
||||
public:
|
||||
MyCustomBitmapBundleImpl()
|
||||
{
|
||||
}
|
||||
|
||||
wxSize GetDefaultSize() const wxOVERRIDE
|
||||
{
|
||||
... determine the minimum/default size for bitmap to use ...
|
||||
}
|
||||
|
||||
wxSize GetPreferredSizeAtScale(double scale) const wxOVERRIDE
|
||||
{
|
||||
// If it's ok to scale the bitmap, just use the standard size
|
||||
// at the given scale:
|
||||
return GetDefaultSize()*scale;
|
||||
|
||||
... otherwise, an existing bitmap of the size closest to the
|
||||
one above would need to be found and its size returned ...
|
||||
}
|
||||
|
||||
wxBitmap GetBitmap(const wxSize& size) wxOVERRIDE
|
||||
{
|
||||
... get the bitmap of the requested size from somewhere and
|
||||
cache it if necessary, i.e. if getting it is expensive ...
|
||||
}
|
||||
};
|
||||
|
||||
toolBar->AddTool(wxID_OPEN, wxBitmapBundle::FromImpl(new MyCustomBitmapBundleImpl());
|
||||
@endcode
|
||||
|
||||
Full (but still very simple) example of using it can be found in the
|
||||
toolbar sample code.
|
||||
|
||||
@library{wxcore}
|
||||
@category{gdi}
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
class wxBitmapBundleImpl : public wxRefCounter
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Return the size of the bitmaps represented by this bundle in the default
|
||||
DPI.
|
||||
|
||||
Must always return a valid size.
|
||||
*/
|
||||
virtual wxSize GetDefaultSize() const = 0;
|
||||
|
||||
/**
|
||||
Return the preferred size that should be used at the given scale.
|
||||
|
||||
Must always return a valid size.
|
||||
*/
|
||||
virtual wxSize GetPreferredSizeAtScale(double scale) const = 0;
|
||||
|
||||
/**
|
||||
Retrieve the bitmap of exactly the given size.
|
||||
|
||||
Note that this function is non-const because it may generate the bitmap
|
||||
on demand and cache it.
|
||||
*/
|
||||
virtual wxBitmap GetBitmap(const wxSize& size) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
Creates a wxBitmapBundle from resources on the platforms supporting them or
|
||||
from two embedded bitmaps otherwise.
|
||||
|
||||
This macro use wxBitmapBundle::FromResources() with the provide @a name,
|
||||
which must be an @e identifier and not a string, i.e. used without quotes,
|
||||
on the platforms where it works and wxBitmapBundle::FromBitmaps() with @c
|
||||
name_png and @c name_2x_png arrays containing PNG data elsewhere.
|
||||
|
||||
Using it allows to avoid using preprocessor checks in the common case when
|
||||
just two bitmaps (for standard and high DPI) are embedded in the
|
||||
application code. Note that all bitmaps defined in the resources, even if
|
||||
there are more than 2 of them.
|
||||
|
||||
Example of use:
|
||||
@code
|
||||
toolBar->AddTool(wxID_OPEN, wxBITMAP_BUNDLE_2(open));
|
||||
@endcode
|
||||
|
||||
@header{wx/bmpbndl.h}
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
#define wxBITMAP_BUNDLE_2(name)
|
@@ -99,6 +99,24 @@ public:
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
|
||||
/**
|
||||
Creation function for two-step creation of "Close" button.
|
||||
|
||||
It is usually not necessary to use this function directly as
|
||||
NewCloseButton() is more convenient, but, if required, it can be called
|
||||
on a default-constructed wxBitmapButton object to achieve the same
|
||||
effect.
|
||||
|
||||
@param parent The button parent window, must be non-@NULL.
|
||||
@param winid The identifier for the new button.
|
||||
@param name The name for the new button.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
bool CreateCloseButton(wxWindow* parent,
|
||||
wxWindowID winid,
|
||||
const wxString& name = wxString());
|
||||
|
||||
/**
|
||||
Helper function creating a standard-looking "Close" button.
|
||||
|
||||
@@ -109,10 +127,13 @@ public:
|
||||
|
||||
@param parent The button parent window, must be non-@NULL.
|
||||
@param winid The identifier for the new button.
|
||||
@param name The name for the new button (available since wxWidgets 3.1.5)
|
||||
@return The new button.
|
||||
|
||||
@since 2.9.5
|
||||
*/
|
||||
static wxBitmapButton* NewCloseButton(wxWindow* parent, wxWindowID winid);
|
||||
static wxBitmapButton* NewCloseButton(wxWindow* parent,
|
||||
wxWindowID winid,
|
||||
const wxString& name = wxString());
|
||||
};
|
||||
|
||||
|
@@ -110,7 +110,7 @@ public:
|
||||
@param size
|
||||
Initial size.
|
||||
@param choices
|
||||
An wxArrayString with which to initialise the control.
|
||||
A wxArrayString with which to initialise the control.
|
||||
@param style
|
||||
The window style, see wxCB_* flags.
|
||||
@param validator
|
||||
|
@@ -12,7 +12,7 @@
|
||||
bits is set if point is over a tab.
|
||||
Notice that wxOSX currently only returns wxBK_HITTEST_ONLABEL or
|
||||
wxBK_HITTEST_NOWHERE and never the other values, so you should only test
|
||||
for these two in the code that should be portable under OS X.
|
||||
for these two in the code that should be portable under macOS.
|
||||
*/
|
||||
enum
|
||||
{
|
||||
@@ -279,7 +279,13 @@ public:
|
||||
|
||||
/**
|
||||
Deletes the specified page, and the associated window.
|
||||
The call to this function generates the page changing events.
|
||||
|
||||
The call to this function generates the page changing events when
|
||||
deleting the currently selected page or a page preceding it in the
|
||||
index order, but it does @e not send any events when deleting the last
|
||||
page: while in this case the selection also changes, it becomes invalid
|
||||
and for compatibility reasons the control never generates events with
|
||||
the invalid selection index.
|
||||
*/
|
||||
virtual bool DeletePage(size_t page);
|
||||
|
||||
@@ -311,6 +317,9 @@ public:
|
||||
|
||||
/**
|
||||
Deletes the specified page, without deleting the associated window.
|
||||
|
||||
See DeletePage() for a note about the events generated by this
|
||||
function.
|
||||
*/
|
||||
virtual bool RemovePage(size_t page);
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
||||
A button may have either a single image for all states or different images
|
||||
for the following states (different images are not currently supported
|
||||
under OS X where the normal image is used for all states):
|
||||
under macOS where the normal image is used for all states):
|
||||
@li @b normal: the default state
|
||||
@li @b disabled: bitmap shown when the button is disabled.
|
||||
@li @b pressed: bitmap shown when the button is pushed (e.g. while the user
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
@ref page_stockitems "this list", a standard label will be used. In
|
||||
other words, if you use a predefined @c wxID_XXX constant, just omit
|
||||
the label completely rather than specifying it. In particular, help
|
||||
buttons (the ones with @a id of @c wxID_HELP) under OS X can't
|
||||
buttons (the ones with @a id of @c wxID_HELP) under macOS can't
|
||||
display any label at all and while wxButton will detect if the standard
|
||||
"Help" label is used and ignore it, using any other label will prevent
|
||||
the button from correctly appearing as a help button and so should be
|
||||
|
@@ -125,7 +125,7 @@ typedef wxUSE_UNICODE_dependent wxUChar;
|
||||
\- @c wchar_t when <tt>wxUSE_UNICODE_WCHAR==1</tt> and <tt>wxUSE_UNICODE==1</tt>
|
||||
|
||||
The @c wxUSE_UNICODE_WCHAR symbol is defined to @c 1 when building on
|
||||
Windows while it's defined to @c 0 when building on Unix, Linux or OS X.
|
||||
Windows while it's defined to @c 0 when building on Unix, Linux or macOS.
|
||||
(Note that @c wxUSE_UNICODE_UTF8 symbol is defined as the opposite of
|
||||
@c wxUSE_UNICODE_WCHAR.)
|
||||
|
||||
|
@@ -50,7 +50,7 @@ enum wxCheckBoxState
|
||||
@style{wxCHK_2STATE}
|
||||
Create a 2-state checkbox. This is the default.
|
||||
@style{wxCHK_3STATE}
|
||||
Create a 3-state checkbox. Not implemented in wxGTK1.
|
||||
Create a 3-state checkbox.
|
||||
@style{wxCHK_ALLOW_3RD_STATE_FOR_USER}
|
||||
By default a user can't set a 3-state checkbox to the third state.
|
||||
It can only be done from code. Using this flags allows the user to
|
||||
|
@@ -53,6 +53,13 @@
|
||||
}
|
||||
@endcode
|
||||
|
||||
@note On GTK, the clipboard behavior can vary depending on the configuration of
|
||||
the end-user's machine. In order for the clipboard data to persist after
|
||||
the window closes, a clipboard manager must be installed. Some clipboard
|
||||
managers will automatically flush the clipboard after each new piece of
|
||||
data is added, while others will not. The Flush() function will force
|
||||
the clipboard manager to flush the data.
|
||||
|
||||
@library{wxcore}
|
||||
@category{dnd}
|
||||
|
||||
@@ -99,6 +106,10 @@ public:
|
||||
Currently this method is implemented in MSW and GTK and always returns @false
|
||||
otherwise.
|
||||
|
||||
@note On GTK, only the non-primary selection can be flushed. Calling this function
|
||||
when the clipboard is using the primary selection will return @false and not
|
||||
make any data available after the program exits.
|
||||
|
||||
@return @false if the operation is unsuccessful for any reason.
|
||||
*/
|
||||
virtual bool Flush();
|
||||
|
@@ -9,9 +9,8 @@
|
||||
|
||||
/**
|
||||
Flags for wxColour -> wxString conversion (see wxColour::GetAsString).
|
||||
|
||||
@{
|
||||
*/
|
||||
//@{
|
||||
enum {
|
||||
wxC2S_NAME = 1, // return colour name, when possible
|
||||
wxC2S_CSS_SYNTAX = 2, // return colour in rgb(r,g,b) syntax
|
||||
@@ -113,10 +112,11 @@ public:
|
||||
@c wxC2S_HTML_SYNTAX, to obtain the colour as "#" followed by 6
|
||||
hexadecimal digits (e.g. wxColour(255,0,0) == "#FF0000").
|
||||
|
||||
This function never fails and always returns a non-empty string but
|
||||
asserts if the colour has alpha channel (i.e. is non opaque) but
|
||||
@c wxC2S_CSS_SYNTAX (which is the only one supporting alpha) is not
|
||||
specified in flags.
|
||||
This function returns empty string if the colour is not initialized
|
||||
(see IsOk()). Otherwise, the returned string is always non-empty, but
|
||||
the function asserts if the colour has alpha channel (i.e. is non
|
||||
opaque) but @c wxC2S_CSS_SYNTAX (which is the only one supporting
|
||||
alpha) is not specified in @a flags.
|
||||
|
||||
@note For non-solid (i.e. non-RGB) colour this function returns
|
||||
"rgb(??, ?? ??)" or "#??????".
|
||||
@@ -201,6 +201,8 @@ public:
|
||||
/**
|
||||
Returns @true if the color can be described using RGB values, i.e. is solid,
|
||||
@false if it is a pattern (currently only possible on macOS)
|
||||
|
||||
@since 3.1.2
|
||||
*/
|
||||
virtual bool IsSolid() const;
|
||||
//@{
|
||||
|
@@ -730,7 +730,7 @@ public:
|
||||
Sets a hint shown in an empty unfocused combo control.
|
||||
|
||||
Notice that hints are known as <em>cue banners</em> under MSW or
|
||||
<em>placeholder strings</em> under OS X.
|
||||
<em>placeholder strings</em> under macOS.
|
||||
|
||||
@see wxTextEntry::SetHint()
|
||||
|
||||
@@ -751,6 +751,47 @@ public:
|
||||
*/
|
||||
virtual void SetInsertionPointEnd();
|
||||
|
||||
/**
|
||||
Uses the given window instead of the default text control as the main
|
||||
window of the combo control.
|
||||
|
||||
By default, combo controls without @c wxCB_READONLY style create a
|
||||
wxTextCtrl which shows the current value and allows to edit it. This
|
||||
method allows to use some other window instead of this wxTextCtrl.
|
||||
|
||||
This method can be called after creating the combo fully, however in
|
||||
this case a wxTextCtrl is unnecessarily created just to be immediately
|
||||
destroyed when it's replaced by a custom window. If you wish to avoid
|
||||
this, you can use the following approach, also shown in the combo
|
||||
sample:
|
||||
|
||||
@code
|
||||
// Create the combo control using its default ctor.
|
||||
wxComboCtrl* combo = new wxComboCtrl();
|
||||
|
||||
// Create the custom main control using its default ctor too.
|
||||
SomeWindow* main = new SomeWindow();
|
||||
|
||||
// Set the custom main control before creating the combo.
|
||||
combo->SetMainControl(main);
|
||||
|
||||
// And only create it now: wxTextCtrl won't be unnecessarily
|
||||
// created because the combo already has a main window.
|
||||
combo->Create(panel, wxID_ANY, wxEmptyString);
|
||||
|
||||
// Finally create the main window itself, now that its parent was
|
||||
// created.
|
||||
main->Create(combo, ...);
|
||||
@endcode
|
||||
|
||||
Note that when a custom main window is used, none of the methods of
|
||||
this class inherited from wxTextEntry, such as SetValue(), Replace(),
|
||||
SetInsertionPoint() etc do anything and simply return.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
void SetMainControl(wxWindow* win);
|
||||
|
||||
//@{
|
||||
/**
|
||||
Attempts to set the control margins. When margins are given as wxPoint,
|
||||
|
@@ -549,6 +549,52 @@ public:
|
||||
*/
|
||||
bool Read(const wxString& key, long* l,
|
||||
long defaultVal) const;
|
||||
/**
|
||||
Reads a 64-bit long long value, returning @true if the value was found.
|
||||
If the value was not found, @a ll is not changed.
|
||||
|
||||
@since 3.1.5
|
||||
|
||||
@beginWxPerlOnly
|
||||
Not supported by wxPerl.
|
||||
@endWxPerlOnly
|
||||
*/
|
||||
bool Read(const wxString& key, wxLongLong_t* ll) const;
|
||||
/**
|
||||
Reads a 64-bit long long value, returning @true if the value was found.
|
||||
If the value was not found, @a defaultVal is used instead.
|
||||
|
||||
@since 3.1.5
|
||||
|
||||
@beginWxPerlOnly
|
||||
Not supported by wxPerl.
|
||||
@endWxPerlOnly
|
||||
*/
|
||||
bool Read(const wxString& key, wxLongLong_t* ll,
|
||||
wxLongLong_t defaultVal) const;
|
||||
/**
|
||||
Reads a size_t value, returning @true if the value was found.
|
||||
If the value was not found, @a value is not changed.
|
||||
|
||||
@since 3.1.5
|
||||
|
||||
@beginWxPerlOnly
|
||||
Not supported by wxPerl.
|
||||
@endWxPerlOnly
|
||||
*/
|
||||
bool Read(const wxString& key, size_t* value) const;
|
||||
/**
|
||||
Reads a size_t value, returning @true if the value was found.
|
||||
If the value was not found, @a defaultVal is used instead.
|
||||
|
||||
@since 3.1.5
|
||||
|
||||
@beginWxPerlOnly
|
||||
Not supported by wxPerl.
|
||||
@endWxPerlOnly
|
||||
*/
|
||||
bool Read(const wxString& key, size_t* value,
|
||||
size_t defaultVal) const;
|
||||
/**
|
||||
Reads a double value, returning @true if the value was found. If the
|
||||
value was not found, @a d is not changed.
|
||||
@@ -662,6 +708,14 @@ public:
|
||||
*/
|
||||
long ReadLong(const wxString& key, long defaultVal) const;
|
||||
|
||||
/**
|
||||
Reads a 64-bit long long value from the key and returns it. @a
|
||||
defaultVal is returned if the key is not found.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxLongLong_t ReadLongLong(const wxString& key, wxLongLong_t defaultVal) const;
|
||||
|
||||
/**
|
||||
Reads a value of type T (for which the function wxFromString() must be
|
||||
defined) from the key and returns it. @a defaultVal is returned if the
|
||||
@@ -678,6 +732,13 @@ public:
|
||||
Writes the long value to the config file and returns @true on success.
|
||||
*/
|
||||
bool Write(const wxString& key, long value);
|
||||
/**
|
||||
Writes the 64-bit long long value to the config file and returns @true
|
||||
on success.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
bool Write(const wxString& key, wxLongLong_t value);
|
||||
/**
|
||||
Writes the double value to the config file and returns @true on
|
||||
success.
|
||||
@@ -894,7 +955,7 @@ public:
|
||||
|
||||
For example:
|
||||
@code
|
||||
// this function loads somes settings from the given wxConfig object;
|
||||
// this function loads some settings from the given wxConfig object;
|
||||
// the path selected inside it is left unchanged
|
||||
bool LoadMySettings(wxConfigBase* cfg)
|
||||
{
|
||||
|
@@ -146,6 +146,22 @@ public:
|
||||
*/
|
||||
wxBOM GetBOM() const;
|
||||
|
||||
/**
|
||||
Return the detected encoding
|
||||
|
||||
Returns @c wxFONTENCODING_MAX if called before the first use.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxBOM GetEncoding() const;
|
||||
|
||||
/**
|
||||
Check if the fall-back encoding is used.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
bool IsUsingFallbackEncoding() const;
|
||||
|
||||
/**
|
||||
Return a pointer to the characters that makes up this BOM.
|
||||
|
||||
|
114
interface/wx/creddlg.h
Normal file
114
interface/wx/creddlg.h
Normal file
@@ -0,0 +1,114 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: creddlg.h
|
||||
// Created: 2018-10-23
|
||||
// Copyright: (c) 2018 wxWidgets development team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
@class wxCredentialEntryDialog
|
||||
|
||||
This class represents a dialog that requests a user name and a password
|
||||
from the user.
|
||||
|
||||
Currently it is implemented as a generic wxWidgets dialog on all platforms.
|
||||
|
||||
Simple example of using this dialog assuming @c MyFrame object has a member
|
||||
@c m_request of wxWebRequest type:
|
||||
@code
|
||||
void MyFrame::OnWebRequestState(wxWebRequestEvent& evt)
|
||||
{
|
||||
if ( evt.GetState() == wxWebRequest::State_Unauthorized )
|
||||
{
|
||||
wxCredentialEntryDialog dialog
|
||||
(
|
||||
this,
|
||||
wxString::Format
|
||||
(
|
||||
"Please enter credentials for accessing "
|
||||
"the web page at %s",
|
||||
evt.GetResponse().GetURL()
|
||||
),
|
||||
"My Application Title"
|
||||
);
|
||||
if ( dialog.ShowModal() == wxID_OK )
|
||||
{
|
||||
m_request.GetAuthChallenge().
|
||||
SetCredentials(dialog.GetCredentials());
|
||||
}
|
||||
//else: the dialog was cancelled
|
||||
}
|
||||
}
|
||||
@endcode
|
||||
|
||||
@note For secure saving and loading users and passwords, have a look at
|
||||
wxSecretStore.
|
||||
|
||||
@since 3.1.5
|
||||
|
||||
@library{wxcore}
|
||||
@category{cmndlg}
|
||||
|
||||
@see @ref overview_cmndlg_cred
|
||||
*/
|
||||
class wxCredentialEntryDialog: public wxDialog
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Default constructor.
|
||||
|
||||
Call Create() to really create the dialog later.
|
||||
*/
|
||||
wxCredentialEntryDialog();
|
||||
|
||||
/**
|
||||
Constructor.
|
||||
|
||||
Use ShowModal() to show the dialog.
|
||||
|
||||
See Create() method for parameter description.
|
||||
*/
|
||||
wxCredentialEntryDialog(wxWindow* parent, const wxString& message,
|
||||
const wxString& title,
|
||||
const wxWebCredentials& cred = wxWebCredentials());
|
||||
|
||||
/**
|
||||
Create the dialog constructed using the default constructor.
|
||||
|
||||
@param parent
|
||||
Parent window.
|
||||
@param message
|
||||
Message to show on the dialog.
|
||||
@param title
|
||||
Title of the dialog.
|
||||
@param cred
|
||||
The default username and password to use (optional).
|
||||
*/
|
||||
bool Create(wxWindow* parent, const wxString& message,
|
||||
const wxString& title,
|
||||
const wxWebCredentials& cred = wxWebCredentials());
|
||||
|
||||
/**
|
||||
Returns the credentials entered by the user.
|
||||
|
||||
This should be called if ShowModal() returned ::wxID_OK.
|
||||
*/
|
||||
wxWebCredentials GetCredentials() const;
|
||||
|
||||
/**
|
||||
Sets the current user name.
|
||||
|
||||
This function may be called before showing the dialog to provide the
|
||||
default value for the user name, if it's different from the one given
|
||||
at the creation time.
|
||||
*/
|
||||
void SetUser(const wxString& user);
|
||||
|
||||
/**
|
||||
Sets the current password.
|
||||
|
||||
This function may be called before showing the dialog for the reasons
|
||||
similar to SetUser().
|
||||
*/
|
||||
void SetPassword(const wxString& password);
|
||||
};
|
@@ -182,7 +182,7 @@ public:
|
||||
so that this button is only added to a dialog for non-Windows platforms
|
||||
(use wxDIALOG_EX_CONTEXTHELP on Windows).
|
||||
|
||||
Note that on OS X, the cursor does not change when in context-sensitive
|
||||
Note that on macOS, the cursor does not change when in context-sensitive
|
||||
help mode.
|
||||
|
||||
@library{wxcore}
|
||||
|
@@ -51,11 +51,14 @@ public:
|
||||
/**
|
||||
Returns the label of the item with the given index.
|
||||
|
||||
The index must be valid, i.e. less than the value returned by
|
||||
GetCount(), otherwise an assert is triggered. Notably, this function
|
||||
can't be called if the control is empty.
|
||||
|
||||
@param n
|
||||
The zero-based index.
|
||||
|
||||
@return The label of the item or an empty string if the position was
|
||||
invalid.
|
||||
@return The label of the item.
|
||||
*/
|
||||
virtual wxString GetString(unsigned int n) const = 0;
|
||||
|
||||
@@ -113,10 +116,6 @@ public:
|
||||
|
||||
@return The position of the current selection.
|
||||
|
||||
@remarks This method can be used with single selection list boxes only,
|
||||
you should use wxListBox::GetSelections() for the list
|
||||
boxes with wxLB_MULTIPLE style.
|
||||
|
||||
@see SetSelection(), GetStringSelection()
|
||||
*/
|
||||
virtual int GetSelection() const = 0;
|
||||
|
@@ -140,7 +140,7 @@ public:
|
||||
- under MacOS, it defaults to @c wxBITMAP_TYPE_MACCURSOR_RESOURCE;
|
||||
when specifying a string resource name, first the color cursors 'crsr'
|
||||
and then the black/white cursors 'CURS' in the resource chain are scanned
|
||||
through. Note that resource forks are deprecated on OS X so this
|
||||
through. Note that resource forks are deprecated on macOS so this
|
||||
is only available for legacy reasons and should not be used in
|
||||
new code.
|
||||
- under GTK, it defaults to @c wxBITMAP_TYPE_XPM.
|
||||
@@ -190,6 +190,17 @@ public:
|
||||
*/
|
||||
wxCursor(const wxImage& image);
|
||||
|
||||
/**
|
||||
Constructs a cursor from XPM data.
|
||||
|
||||
In versions of wxWidgets until 3.1.6 constructing wxCursor from XPM
|
||||
data implicitly used wxImage constructor from XPM data and wxCursor
|
||||
constructor from wxImage. Since 3.1.6 this constructor overload is
|
||||
available to allow constructing wxCursor from XPM to still work, even
|
||||
though wxImage constructor from XPM is now @c explicit.
|
||||
*/
|
||||
wxCursor(const char* const* xpmData);
|
||||
|
||||
/**
|
||||
Copy constructor, uses @ref overview_refcount "reference counting".
|
||||
|
||||
|
@@ -34,6 +34,9 @@
|
||||
A list of filenames.}
|
||||
@itemdef{wxDF_HTML,
|
||||
An HTML string. This is currently only valid on Mac and MSW.}
|
||||
@itemdef{wxDF_PNG,
|
||||
A PNG file. This is valid only on MSW. This constant is available
|
||||
since wxWidgets 3.1.5.}
|
||||
@endDefList
|
||||
|
||||
As mentioned above, these standard formats may be passed to any function
|
||||
@@ -620,6 +623,42 @@ public:
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@class wxImageDataObject
|
||||
|
||||
wxImageDataObject is a specialization of wxDataObject for image data.
|
||||
It can be used e.g. when you need to put on and retrieve from the clipboard
|
||||
a wxImage with its metadata (like image resolution).
|
||||
|
||||
@since 3.1.5
|
||||
|
||||
@library{wxcore}
|
||||
@category{dnd}
|
||||
|
||||
@see @ref overview_dnd, wxDataObject, wxCustomDataObject, wxBitmapDataObject
|
||||
*/
|
||||
class wxImageDataObject : public wxCustomDataObject
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Constructor, optionally passing an image (otherwise use SetImage()
|
||||
later).
|
||||
*/
|
||||
explicit wxImageDataObject(const wxImage& image = wxNullImage);
|
||||
|
||||
/**
|
||||
Returns the image associated with the data object.
|
||||
*/
|
||||
wxImage GetImage() const;
|
||||
|
||||
/**
|
||||
Sets the image stored by the data object.
|
||||
*/
|
||||
void SetImage(const wxImage& image);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@class wxURLDataObject
|
||||
|
||||
|
@@ -73,9 +73,10 @@
|
||||
associating the model with a control like this:
|
||||
|
||||
@code
|
||||
wxDataViewCtrl *musicCtrl = new wxDataViewCtrl( this, wxID_ANY );
|
||||
wxDataViewCtrl *musicCtrl = new wxDataViewCtrl(this, wxID_ANY);
|
||||
wxDataViewModel *musicModel = new MyMusicModel;
|
||||
m_musicCtrl->AssociateModel( musicModel );
|
||||
|
||||
musicCtrl->AssociateModel(musicModel);
|
||||
musicModel->DecRef(); // avoid memory leak !!
|
||||
|
||||
// add columns now
|
||||
@@ -84,11 +85,10 @@
|
||||
A potentially better way to avoid memory leaks is to use wxObjectDataPtr
|
||||
|
||||
@code
|
||||
wxObjectDataPtr<MyMusicModel> musicModel;
|
||||
|
||||
wxDataViewCtrl *musicCtrl = new wxDataViewCtrl( this, wxID_ANY );
|
||||
musicModel = new MyMusicModel;
|
||||
m_musicCtrl->AssociateModel( musicModel.get() );
|
||||
wxDataViewCtrl *musicCtrl = new wxDataViewCtrl(this, wxID_ANY);
|
||||
wxObjectDataPtr<wxDataViewModel> musicModel(new MyMusicModel);
|
||||
|
||||
musicCtrl->AssociateModel(musicModel.get());
|
||||
|
||||
// add columns now
|
||||
@endcode
|
||||
@@ -304,14 +304,18 @@ public:
|
||||
|
||||
All normal items have values in all columns but the container items
|
||||
only show their label in the first column (@a col == 0) by default (but
|
||||
see HasContainerColumns()). So this function always returns true for
|
||||
see HasContainerColumns()). So this function by default returns true for
|
||||
the first column while for the other ones it returns true only if the
|
||||
item is not a container or HasContainerColumns() was overridden to
|
||||
return true for it.
|
||||
|
||||
Since wxWidgets 3.1.4, this method is virtual and can be overridden to
|
||||
explicitly specify for which columns a given item has, and doesn't
|
||||
have, values.
|
||||
|
||||
@since 2.9.1
|
||||
*/
|
||||
bool HasValue(const wxDataViewItem& item, unsigned col) const;
|
||||
virtual bool HasValue(const wxDataViewItem& item, unsigned col) const;
|
||||
|
||||
/**
|
||||
Override this to indicate of @a item is a container, i.e.\ if
|
||||
@@ -609,9 +613,9 @@ public:
|
||||
wxDataViewVirtualListModel is a specialized data model which lets you address
|
||||
an item by its position (row) rather than its wxDataViewItem and as such offers
|
||||
the exact same interface as wxDataViewIndexListModel.
|
||||
The important difference is that under platforms other than OS X, using this
|
||||
The important difference is that under platforms other than macOS, using this
|
||||
model will result in a truly virtual control able to handle millions of items
|
||||
as the control doesn't store any item (a feature not supported by OS X).
|
||||
as the control doesn't store any item (a feature not supported by macOS).
|
||||
|
||||
@see wxDataViewListModel for the API.
|
||||
|
||||
@@ -729,7 +733,7 @@ public:
|
||||
text.
|
||||
|
||||
Currently this attribute is only supported in the generic version of
|
||||
wxDataViewCtrl and GTK and ignored by the native OS X implementations.
|
||||
wxDataViewCtrl and GTK and ignored by the native macOS implementations.
|
||||
|
||||
@since 3.1.2
|
||||
*/
|
||||
@@ -977,14 +981,17 @@ wxEventType wxEVT_DATAVIEW_ITEM_DROP;
|
||||
Process a @c wxEVT_DATAVIEW_COLUMN_HEADER_CLICK event.
|
||||
@event{EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, func)}
|
||||
Process a @c wxEVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK event.
|
||||
Notice that currently this event is not generated in the native OS X
|
||||
Notice that currently this event is not generated in the native macOS
|
||||
versions of the control.
|
||||
@event{EVT_DATAVIEW_COLUMN_SORTED(id, func)}
|
||||
Process a @c wxEVT_DATAVIEW_COLUMN_SORTED event.
|
||||
@event{EVT_DATAVIEW_COLUMN_REORDERED(id, func)}
|
||||
Process a @c wxEVT_DATAVIEW_COLUMN_REORDERED event.
|
||||
@event{EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func)}
|
||||
Process a @c wxEVT_DATAVIEW_ITEM_BEGIN_DRAG event.
|
||||
Process a @c wxEVT_DATAVIEW_ITEM_BEGIN_DRAG event which is generated
|
||||
when the user starts dragging a valid item. This event must be
|
||||
processed and wxDataViewEvent::SetDataObject() must be called to
|
||||
actually start dragging the item.
|
||||
@event{EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func)}
|
||||
Process a @c wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE event.
|
||||
@event{EVT_DATAVIEW_ITEM_DROP(id, func)}
|
||||
@@ -1395,6 +1402,16 @@ public:
|
||||
*/
|
||||
void ExpandAncestors( const wxDataViewItem & item );
|
||||
|
||||
/**
|
||||
Expand all children of the given item recursively.
|
||||
|
||||
This is the same as calling Expand() on the @a item itself and then
|
||||
calling it for all of its children, grandchildren etc recursively.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
void ExpandChildren( const wxDataViewItem & item );
|
||||
|
||||
/**
|
||||
Returns pointer to the column. @a pos refers to the position in the
|
||||
control which may change after reordering columns by the user.
|
||||
@@ -1426,8 +1443,8 @@ public:
|
||||
style as in the case of single selection it returns the same thing as
|
||||
GetSelection().
|
||||
|
||||
Notice that under all platforms except OS X the currently focused
|
||||
item may be selected or not but under OS X the current item is always
|
||||
Notice that under all platforms except macOS the currently focused
|
||||
item may be selected or not but under macOS the current item is always
|
||||
selected.
|
||||
|
||||
@see SetCurrentItem(), GetCurrentColumn()
|
||||
@@ -1632,7 +1649,7 @@ public:
|
||||
In single selection mode, calling this method is the same as calling
|
||||
Select() and is thus not very useful. In multiple selection mode this
|
||||
method only moves the current item however without changing the
|
||||
selection except under OS X where the current item is always selected,
|
||||
selection except under macOS where the current item is always selected,
|
||||
so calling SetCurrentItem() selects @a item if it hadn't been selected
|
||||
before.
|
||||
|
||||
@@ -1668,6 +1685,9 @@ public:
|
||||
|
||||
/**
|
||||
Sets the selection to the array of wxDataViewItems.
|
||||
|
||||
Note that if @a sel contains any invalid items, they are simply
|
||||
ignored.
|
||||
*/
|
||||
virtual void SetSelections(const wxDataViewItemArray& sel);
|
||||
|
||||
@@ -1688,7 +1708,7 @@ public:
|
||||
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 and OS X
|
||||
Currently this is implemented in the generic and native GTK and macOS
|
||||
(since 3.1.1) versions.
|
||||
|
||||
Also notice that this method can only be used to increase the row
|
||||
@@ -2023,7 +2043,7 @@ public:
|
||||
The default value of @c wxDVR_DEFAULT_ALIGNMENT indicates that the content
|
||||
should have the same alignment as the column header.
|
||||
|
||||
The method is not implemented under OS X and the renderer always aligns
|
||||
The method is not implemented under macOS and the renderer always aligns
|
||||
its contents as the column header on that platform. The other platforms
|
||||
support both vertical and horizontal alignment.
|
||||
*/
|
||||
@@ -2037,6 +2057,8 @@ public:
|
||||
/**
|
||||
Set the value of the renderer (and thus its cell) to @a value.
|
||||
The internal code will then render this cell with this data.
|
||||
|
||||
@param value A valid, i.e. non-null, value to be shown.
|
||||
*/
|
||||
virtual bool SetValue(const wxVariant& value) = 0;
|
||||
|
||||
@@ -3727,7 +3749,10 @@ public:
|
||||
Currently this event is not generated when using the native GTK+
|
||||
version of the control.
|
||||
@event{EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func)}
|
||||
Process a @c wxEVT_DATAVIEW_ITEM_BEGIN_DRAG event.
|
||||
Process a @c wxEVT_DATAVIEW_ITEM_BEGIN_DRAG event which is generated
|
||||
when the user starts dragging a valid item. This event must be
|
||||
processed and wxDataViewEvent::SetDataObject() must be called to
|
||||
actually start dragging the item.
|
||||
@event{EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func)}
|
||||
Process a @c wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE event.
|
||||
@event{EVT_DATAVIEW_ITEM_DROP(id, func)}
|
||||
@@ -3812,7 +3837,7 @@ public:
|
||||
|
||||
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.
|
||||
but not GTK nor macOS.
|
||||
|
||||
@since 2.9.3
|
||||
*/
|
||||
@@ -3840,6 +3865,12 @@ public:
|
||||
|
||||
/**
|
||||
Set wxDataObject for data transfer within a drag operation.
|
||||
|
||||
This method must be used inside a @c wxEVT_DATAVIEW_ITEM_BEGIN_DRAG
|
||||
handler to associate the data object to be dragged with the item.
|
||||
|
||||
Note that the control takes ownership of the data object, i.e. @a obj
|
||||
must be heap-allocated and will be deleted by wxDataViewCtrl itself.
|
||||
*/
|
||||
void SetDataObject( wxDataObject *obj );
|
||||
|
||||
@@ -3861,13 +3892,13 @@ public:
|
||||
/**
|
||||
Specify the kind of the drag operation to perform.
|
||||
|
||||
This method can be used inside a wxEVT_DATAVIEW_ITEM_BEGIN_DRAG
|
||||
This method can be used inside a @c wxEVT_DATAVIEW_ITEM_BEGIN_DRAG
|
||||
handler in order to configure the drag operation. Valid values are
|
||||
::wxDrag_CopyOnly (default), ::wxDrag_AllowMove (allow the data to be
|
||||
moved) and ::wxDrag_DefaultMove.
|
||||
|
||||
Currently it is only honoured by the generic version of wxDataViewCtrl
|
||||
(used e.g. under MSW) and not supported by the native GTK and OS X
|
||||
(used e.g. under MSW) and not supported by the native GTK and macOS
|
||||
versions.
|
||||
|
||||
@see GetDropEffect()
|
||||
@@ -3887,7 +3918,7 @@ public:
|
||||
|
||||
Currently this is only available when using the generic version of
|
||||
wxDataViewCtrl (used e.g. under MSW) and always returns ::wxDragNone in
|
||||
the GTK and OS X native versions.
|
||||
the GTK and macOS native versions.
|
||||
|
||||
@since 2.9.4
|
||||
*/
|
||||
@@ -3903,6 +3934,19 @@ public:
|
||||
*/
|
||||
int GetCacheTo() const;
|
||||
|
||||
/**
|
||||
Returns the index of the child item at which an item currently being
|
||||
dragged would be dropped.
|
||||
|
||||
This function can be used from wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE
|
||||
handlers to determine the exact position of the item being dropped.
|
||||
|
||||
Note that it currently always returns wxNOT_FOUND when using native GTK
|
||||
implementation of this control.
|
||||
|
||||
@since 3.1.2
|
||||
*/
|
||||
int GetProposedDropIndex() const;
|
||||
|
||||
/**
|
||||
Returns the item affected by the event.
|
||||
@@ -3984,6 +4028,9 @@ public:
|
||||
(selected) row, typically on a dark background.
|
||||
|
||||
Default implementation returns @a value unmodified.
|
||||
|
||||
The @a value passed to this method is always non-null and it must
|
||||
return a non-null value too.
|
||||
*/
|
||||
virtual wxVariant MakeHighlighted(const wxVariant& value) const;
|
||||
};
|
||||
|
@@ -168,6 +168,22 @@ public:
|
||||
*/
|
||||
virtual wxDateTime GetValue() const;
|
||||
|
||||
/**
|
||||
Set the text to show when there is no valid value.
|
||||
|
||||
For the controls with @c wxDP_ALLOWNONE style, set the string displayed
|
||||
when the control doesn't have any valid value. Currently this is only
|
||||
actually used under MSW, where it can be used to override the previous
|
||||
value which is still displayed by the control in this case, and ignored
|
||||
elsewhere.
|
||||
|
||||
Notably, @a text can be empty to completely hide the date if no valid
|
||||
date is specified.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
void SetNullText(const wxString& text);
|
||||
|
||||
/**
|
||||
Sets the valid range for the date selection. If @a dt1 is valid, it
|
||||
becomes the earliest date (inclusive) accepted by the control. If
|
||||
|
@@ -489,7 +489,7 @@ public:
|
||||
|
||||
Here are the trivial accessors. Other functions, which might have to
|
||||
perform some more complicated calculations to find the answer are under
|
||||
the "Date Arithmetics" section.
|
||||
the "Date Arithmetic" section.
|
||||
*/
|
||||
//@{
|
||||
|
||||
@@ -738,10 +738,10 @@ public:
|
||||
|
||||
|
||||
/**
|
||||
@name Date Arithmetics
|
||||
@name Date Arithmetic
|
||||
|
||||
These functions carry out
|
||||
@ref overview_datetime_arithmetics "arithmetics" on the wxDateTime
|
||||
@ref overview_datetime_arithmetics "arithmetic" on the wxDateTime
|
||||
objects. As explained in the overview, either wxTimeSpan or wxDateSpan
|
||||
may be added to wxDateTime, hence all functions are overloaded to
|
||||
accept both arguments.
|
||||
|
@@ -164,7 +164,7 @@ struct wxFontMetrics
|
||||
In general wxDC methods don't support alpha transparency and the alpha
|
||||
component of wxColour is simply ignored and you need to use wxGraphicsContext
|
||||
for full transparency support. There are, however, a few exceptions: first,
|
||||
under OS X and GTK+ 3 colours with alpha channel are supported in all the normal
|
||||
under macOS and GTK+ 3 colours with alpha channel are supported in all the normal
|
||||
wxDC-derived classes as they use wxGraphicsContext internally. Second,
|
||||
under all platforms wxSVGFileDC also fully supports alpha channel. In both
|
||||
of these cases the instances of wxPen or wxBrush that are built from
|
||||
@@ -173,7 +173,7 @@ struct wxFontMetrics
|
||||
|
||||
@section dc_transform_support Support for Transformation Matrix
|
||||
|
||||
On some platforms (currently under MSW, GTK+ 3, OS X) wxDC has support for
|
||||
On some platforms (currently under MSW, GTK+ 3, macOS) wxDC has support for
|
||||
applying an arbitrary affine transformation matrix to its coordinate system
|
||||
(since 3.1.1 this feature is also supported by wxGCDC in all ports).
|
||||
Call CanUseTransformMatrix() to check if this support is available and then
|
||||
@@ -206,55 +206,151 @@ public:
|
||||
/**
|
||||
Convert @e device X coordinate to logical coordinate, using the current
|
||||
mapping mode, user scale factor, device origin and axis orientation.
|
||||
|
||||
@note Affine transformation applied to the coordinate system
|
||||
with SetTransformMatrix() is not taken into account.
|
||||
*/
|
||||
wxCoord DeviceToLogicalX(wxCoord x) const;
|
||||
|
||||
/**
|
||||
Convert @e device X coordinate to relative logical coordinate, using the
|
||||
current mapping mode and user scale factor but ignoring the
|
||||
axis orientation. Use this for converting a width, for example.
|
||||
axis orientation. Use this for converting a horizontal distance like
|
||||
for example a width.
|
||||
|
||||
@note Affine transformation applied to the coordinate system
|
||||
with SetTransformMatrix() is not taken into account.
|
||||
*/
|
||||
wxCoord DeviceToLogicalXRel(wxCoord x) const;
|
||||
|
||||
/**
|
||||
Converts @e device Y coordinate to logical coordinate, using the current
|
||||
mapping mode, user scale factor, device origin and axis orientation.
|
||||
|
||||
@note Affine transformation applied to the coordinate system
|
||||
with SetTransformMatrix() is not taken into account.
|
||||
*/
|
||||
wxCoord DeviceToLogicalY(wxCoord y) const;
|
||||
|
||||
/**
|
||||
Convert @e device Y coordinate to relative logical coordinate, using the
|
||||
current mapping mode and user scale factor but ignoring the
|
||||
axis orientation. Use this for converting a height, for example.
|
||||
axis orientation. Use this for converting a vertical distance like
|
||||
for example a height.
|
||||
|
||||
@note Affine transformation applied to the coordinate system
|
||||
with SetTransformMatrix() is not taken into account.
|
||||
*/
|
||||
wxCoord DeviceToLogicalYRel(wxCoord y) const;
|
||||
|
||||
/**
|
||||
Converts logical X coordinate to device coordinate, using the current
|
||||
mapping mode, user scale factor, device origin and axis orientation.
|
||||
|
||||
@note Affine transformation applied to the coordinate system
|
||||
with SetTransformMatrix() is not taken into account.
|
||||
*/
|
||||
wxCoord LogicalToDeviceX(wxCoord x) const;
|
||||
|
||||
/**
|
||||
Converts logical X coordinate to relative device coordinate, using the
|
||||
current mapping mode and user scale factor but ignoring the
|
||||
axis orientation. Use this for converting a width, for example.
|
||||
axis orientation. Use this for converting a horizontal distance like
|
||||
for example a width.
|
||||
|
||||
@note Affine transformation applied to the coordinate system
|
||||
with SetTransformMatrix() is not taken into account.
|
||||
*/
|
||||
wxCoord LogicalToDeviceXRel(wxCoord x) const;
|
||||
|
||||
/**
|
||||
Converts logical Y coordinate to device coordinate, using the current
|
||||
mapping mode, user scale factor, device origin and axis orientation.
|
||||
|
||||
@note Affine transformation applied to the coordinate system
|
||||
with SetTransformMatrix() is not taken into account.
|
||||
*/
|
||||
wxCoord LogicalToDeviceY(wxCoord y) const;
|
||||
|
||||
/**
|
||||
Converts logical Y coordinate to relative device coordinate, using the
|
||||
current mapping mode and user scale factor but ignoring the
|
||||
axis orientation. Use this for converting a height, for example.
|
||||
axis orientation. Use this for converting a vertical distance like
|
||||
for example a height.
|
||||
|
||||
@note Affine transformation applied to the coordinate system
|
||||
with SetTransformMatrix() is not taken into account.
|
||||
*/
|
||||
wxCoord LogicalToDeviceYRel(wxCoord y) const;
|
||||
|
||||
/**
|
||||
Converts device (@a x, @a y) coordinates to logical coordinates
|
||||
taking into account all applied transformations like the current
|
||||
mapping mode, scale factors, device origin, axes orientation,
|
||||
affine transformation.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxPoint DeviceToLogical(wxCoord x, wxCoord y) const;
|
||||
|
||||
/**
|
||||
@overload
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxPoint DeviceToLogical(const wxPoint& pt) const;
|
||||
|
||||
/**
|
||||
Converts device @a x, @a y coordinates to relative logical coordinates
|
||||
taking into account all applied transformations like the current
|
||||
mapping mode, scale factors, affine transformation.
|
||||
Use this for converting distances like e.g. width and height.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxSize DeviceToLogicalRel(int x, int y) const;
|
||||
|
||||
/**
|
||||
@overload
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxSize DeviceToLogicalRel(const wxSize& dim) const;
|
||||
|
||||
/**
|
||||
Converts logical (@a x, @a y) coordinates to device coordinates
|
||||
taking into account all applied transformations like the current
|
||||
mapping mode, scale factors, device origin, axes orientation,
|
||||
affine transformation.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxPoint LogicalToDevice(wxCoord x, wxCoord y) const;
|
||||
|
||||
/**
|
||||
@overload
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxPoint LogicalToDevice(const wxPoint& pt) const;
|
||||
|
||||
/**
|
||||
Converts logical @a x, @a y coordinates to relative device coordinates
|
||||
taking into account all applied transformations like the current
|
||||
mapping mode, scale factors, affine transformation.
|
||||
Use this for converting distances like e.g. width and height.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxSize LogicalToDeviceRel(int x, int y) const;
|
||||
|
||||
/**
|
||||
@overload
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxSize LogicalToDeviceRel(const wxSize& dim) const;
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
@@ -305,7 +401,7 @@ public:
|
||||
|
||||
/**
|
||||
Draw a bitmap on the device context at the specified point. If
|
||||
@a transparent is @true and the bitmap has a transparency mask, the
|
||||
@a useMask is @true and the bitmap has a transparency mask, the
|
||||
bitmap will be drawn transparently.
|
||||
|
||||
When drawing a mono-bitmap, the current text foreground colour will be
|
||||
@@ -618,9 +714,16 @@ public:
|
||||
/**
|
||||
Draws a spline between all given points using the current pen.
|
||||
|
||||
The number of points must be at least 2 for the spline to be drawn.
|
||||
|
||||
@note Drawn curve is not an interpolating curve - it does not go
|
||||
through all points. It may be considered a smoothing curve.
|
||||
|
||||
@beginWxPerlOnly
|
||||
Not supported by wxPerl.
|
||||
@endWxPerlOnly
|
||||
|
||||
@image html drawing-spline.png
|
||||
*/
|
||||
void DrawSpline(int n, const wxPoint points[]);
|
||||
|
||||
@@ -892,6 +995,12 @@ public:
|
||||
used for the text extent calculation, otherwise the currently selected
|
||||
font is used.
|
||||
|
||||
If @a string is empty, its horizontal extent is 0 but, for convenience
|
||||
when using this function for allocating enough space for a possibly
|
||||
multi-line string, its vertical extent is the same as the height of an
|
||||
empty line of text. Please note that this behaviour differs from that
|
||||
of GetTextExtent().
|
||||
|
||||
@note This function works with both single-line and multi-line strings.
|
||||
|
||||
@beginWxPerlOnly
|
||||
@@ -954,6 +1063,8 @@ public:
|
||||
used for the text extent calculation. Otherwise the currently selected
|
||||
font is.
|
||||
|
||||
If @a string is empty, its extent is 0 in both directions, as expected.
|
||||
|
||||
@note This function only works with single-line strings.
|
||||
|
||||
@beginWxPerlOnly
|
||||
@@ -989,7 +1100,7 @@ public:
|
||||
//@{
|
||||
|
||||
/**
|
||||
Returns the current background mode: @c wxPENSTYLE_SOLID or @c wxPENSTYLE_TRANSPARENT.
|
||||
Returns the current background mode: @c wxBRUSHSTYLE_SOLID or @c wxBRUSHSTYLE_TRANSPARENT.
|
||||
|
||||
@see SetBackgroundMode()
|
||||
*/
|
||||
@@ -1029,10 +1140,15 @@ public:
|
||||
const wxColour& GetTextForeground() const;
|
||||
|
||||
/**
|
||||
@a mode may be one of @c wxPENSTYLE_SOLID and @c wxPENSTYLE_TRANSPARENT.
|
||||
Change the current background mode.
|
||||
|
||||
This setting determines whether text will be drawn with a background
|
||||
colour or not.
|
||||
|
||||
Default is @c wxBRUSHSTYLE_TRANSPARENT, i.e. text background is not
|
||||
drawn.
|
||||
|
||||
@param mode one of @c wxBRUSHSTYLE_SOLID and @c wxBRUSHSTYLE_TRANSPARENT.
|
||||
*/
|
||||
void SetBackgroundMode(int mode);
|
||||
|
||||
@@ -1640,7 +1756,7 @@ public:
|
||||
context, if this wxDC has something that could be thought of in that
|
||||
way. (Not all of them do.)
|
||||
|
||||
For example, on Windows the return value is an HDC, on OS X it is a
|
||||
For example, on Windows the return value is an HDC, on macOS it is a
|
||||
CGContextRef and on wxGTK it will be a GdkDrawable. If the DC is a
|
||||
wxGCDC then the return value will be the value returned from
|
||||
wxGraphicsContext::GetNativeContext. A value of NULL is returned if
|
||||
@@ -1687,6 +1803,21 @@ public:
|
||||
void GetLogicalOrigin(wxCoord *x, wxCoord *y) const;
|
||||
wxPoint GetLogicalOrigin() const;
|
||||
//@}
|
||||
|
||||
/**
|
||||
If supported by the platform and the @a wxDC implementation, this method
|
||||
will return the @a wxGraphicsContext associated with the DC. Otherwise
|
||||
@NULL is returned.
|
||||
*/
|
||||
virtual wxGraphicsContext* GetGraphicsContext() const;
|
||||
|
||||
/**
|
||||
Associate a wxGraphicsContext with the DC. Ignored if not supported by
|
||||
the specific @a wxDC implementation. It is unlikely that this will need to
|
||||
be used in application code.
|
||||
*/
|
||||
virtual void SetGraphicsContext( wxGraphicsContext* ctx );
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1957,7 +2088,8 @@ public:
|
||||
@param dc
|
||||
The DC where the mode must be temporary set.
|
||||
@param mode
|
||||
The background mode to set.
|
||||
The background mode to set, one of @c wxBRUSHSTYLE_SOLID or @c
|
||||
wxBRUSHSTYLE_TRANSPARENT.
|
||||
*/
|
||||
wxDCBgModeChanger(wxDC& dc, int mode);
|
||||
|
||||
|
@@ -40,7 +40,7 @@
|
||||
backing store for the window contents. In this case, the associated @e DC
|
||||
may be @NULL but a valid backing store bitmap should be specified.
|
||||
|
||||
Finally, please note that GTK+ 2.0 as well as OS X provide double buffering
|
||||
Finally, please note that GTK+ 2.0 as well as macOS provide double buffering
|
||||
themselves natively. You can either use wxWindow::IsDoubleBuffered() to
|
||||
determine whether you need to use buffering or not, or use
|
||||
wxAutoBufferedPaintDC to avoid needless double buffering on the systems
|
||||
|
@@ -18,12 +18,6 @@
|
||||
automatically sets the clipping area to the damaged area of the window.
|
||||
Attempts to draw outside this area do not appear.
|
||||
|
||||
To draw on a window from outside your EVT_PAINT() handler, construct a
|
||||
wxClientDC object.
|
||||
|
||||
To draw on the whole window including decorations, construct a wxWindowDC
|
||||
object (Windows only).
|
||||
|
||||
A wxPaintDC object is initialized to use the same font and colours as the
|
||||
window it is associated with.
|
||||
|
||||
@@ -46,16 +40,36 @@ public:
|
||||
/**
|
||||
@class wxClientDC
|
||||
|
||||
A wxClientDC must be constructed if an application wishes to paint on the
|
||||
client area of a window from outside an EVT_PAINT() handler. This should
|
||||
normally be constructed as a temporary stack object; don't store a
|
||||
wxClientDC object.
|
||||
wxClientDC is primarily useful for obtaining information about the window
|
||||
from outside EVT_PAINT() handler.
|
||||
|
||||
To draw on a window from within an EVT_PAINT() handler, construct a
|
||||
wxPaintDC object instead.
|
||||
Typical use of this class is to obtain the extent of some text string in
|
||||
order to allocate enough size for a window, e.g.
|
||||
@code
|
||||
// Create the initially empty label with the size big enough to show
|
||||
// the given string.
|
||||
wxClientDC dc(this);
|
||||
wxStaticText* text = new wxStaticText
|
||||
(
|
||||
this, wxID_ANY, "",
|
||||
wxPoint(),
|
||||
dc.GetTextExtent("String of max length"),
|
||||
wxST_NO_AUTORESIZE
|
||||
);
|
||||
}
|
||||
@endcode
|
||||
|
||||
To draw on the whole window including decorations, construct a wxWindowDC
|
||||
object (Windows only).
|
||||
@note While wxClientDC may also be used for drawing on the client area of a
|
||||
window from outside an EVT_PAINT() handler in some ports, this does @em not
|
||||
work on all platforms (neither wxOSX nor wxGTK with GTK 3 Wayland backend
|
||||
support this, so drawing using wxClientDC simply doesn't have any effect
|
||||
there) and the only portable way of drawing is via wxPaintDC. To redraw a
|
||||
small part of the window, use wxWindow::RefreshRect() to invalidate just
|
||||
this part and check wxWindow::GetUpdateRegion() in the paint event handler
|
||||
to redraw this part only.
|
||||
|
||||
wxClientDC objects should normally be constructed as temporary stack
|
||||
objects, i.e. don't store a wxClientDC object.
|
||||
|
||||
A wxClientDC object is initialized to use the same font and colours as the
|
||||
window it is associated with.
|
||||
|
@@ -18,8 +18,6 @@
|
||||
void wxAbort();
|
||||
|
||||
/**
|
||||
@def wxDEBUG_LEVEL
|
||||
|
||||
Preprocessor symbol defining the level of debug support available.
|
||||
|
||||
This symbol is defined to 1 by default meaning that asserts are compiled in
|
||||
@@ -40,8 +38,6 @@ void wxAbort();
|
||||
#define wxDEBUG_LEVEL
|
||||
|
||||
/**
|
||||
@def __WXDEBUG__
|
||||
|
||||
Compatibility macro indicating presence of debug support.
|
||||
|
||||
This symbol is defined if wxDEBUG_LEVEL is greater than 0 and undefined
|
||||
@@ -275,8 +271,6 @@ typedef void (*wxAssertHandler_t)(const wxString& file,
|
||||
void wxDisableAsserts();
|
||||
|
||||
/**
|
||||
@def wxDISABLE_ASSERTS_IN_RELEASE_BUILD
|
||||
|
||||
Use this macro to disable asserts in release build when not using
|
||||
wxIMPLEMENT_APP().
|
||||
|
||||
|
@@ -854,6 +854,7 @@ enum wxDataFormatId
|
||||
wxDF_LOCALE = 16,
|
||||
wxDF_PRIVATE = 20,
|
||||
wxDF_HTML = 30, /* Note: does not correspond to CF_ constant */
|
||||
wxDF_PNG = 31, /* Note: does not correspond to CF_ constant */
|
||||
wxDF_MAX
|
||||
};
|
||||
|
||||
@@ -931,13 +932,13 @@ enum wxKeyCode
|
||||
WXK_CLEAR,
|
||||
WXK_SHIFT,
|
||||
WXK_ALT,
|
||||
/** Note that under OS X, to improve compatibility with other
|
||||
/** Note that under macOS, to improve compatibility with other
|
||||
* systems, 'WXK_CONTROL' represents the 'Command' key. Use this
|
||||
* constant to work with keyboard shortcuts. See 'WXK_RAW_CONTROL'
|
||||
* to get the state of the actual 'Control' key.
|
||||
*/
|
||||
WXK_CONTROL,
|
||||
/** Under OS X, where the 'Command' key is mapped to 'Control'
|
||||
/** Under macOS, where the 'Command' key is mapped to 'Control'
|
||||
* to improve compatibility with other systems, WXK_RAW_CONTROL may
|
||||
* be used to obtain the state of the actual 'Control' key
|
||||
* ('WXK_CONTROL' would obtain the status of the 'Command' key).
|
||||
@@ -1035,7 +1036,7 @@ enum wxKeyCode
|
||||
WXK_WINDOWS_RIGHT,
|
||||
WXK_WINDOWS_MENU ,
|
||||
|
||||
/** This special key code was used to represent the key used for keyboard shortcuts. Under OS X,
|
||||
/** This special key code was used to represent the key used for keyboard shortcuts. Under macOS,
|
||||
* this key maps to the 'Command' (aka logo or 'Apple') key, whereas on Linux/Windows/others
|
||||
* this is the Control key, with the new semantic of WXK_CONTROL, WXK_COMMAND is not needed anymore
|
||||
*/
|
||||
@@ -1063,23 +1064,55 @@ enum wxKeyCode
|
||||
WXK_SPECIAL19,
|
||||
WXK_SPECIAL20,
|
||||
|
||||
WXK_BROWSER_BACK = 501,
|
||||
WXK_BROWSER_FORWARD,
|
||||
WXK_BROWSER_REFRESH,
|
||||
WXK_BROWSER_STOP,
|
||||
WXK_BROWSER_SEARCH,
|
||||
WXK_BROWSER_FAVORITES,
|
||||
WXK_BROWSER_HOME,
|
||||
WXK_VOLUME_MUTE,
|
||||
WXK_VOLUME_DOWN,
|
||||
WXK_VOLUME_UP,
|
||||
WXK_MEDIA_NEXT_TRACK,
|
||||
WXK_MEDIA_PREV_TRACK,
|
||||
WXK_MEDIA_STOP,
|
||||
WXK_MEDIA_PLAY_PAUSE,
|
||||
WXK_LAUNCH_MAIL,
|
||||
WXK_BROWSER_BACK = 501, ///< Since wxWidgets 3.1.0
|
||||
WXK_BROWSER_FORWARD, ///< Since wxWidgets 3.1.0
|
||||
WXK_BROWSER_REFRESH, ///< Since wxWidgets 3.1.0
|
||||
WXK_BROWSER_STOP, ///< Since wxWidgets 3.1.0
|
||||
WXK_BROWSER_SEARCH, ///< Since wxWidgets 3.1.0
|
||||
WXK_BROWSER_FAVORITES, ///< Since wxWidgets 3.1.0
|
||||
WXK_BROWSER_HOME, ///< Since wxWidgets 3.1.0
|
||||
WXK_VOLUME_MUTE, ///< Since wxWidgets 3.1.0
|
||||
WXK_VOLUME_DOWN, ///< Since wxWidgets 3.1.0
|
||||
WXK_VOLUME_UP, ///< Since wxWidgets 3.1.0
|
||||
WXK_MEDIA_NEXT_TRACK, ///< Since wxWidgets 3.1.0
|
||||
WXK_MEDIA_PREV_TRACK, ///< Since wxWidgets 3.1.0
|
||||
WXK_MEDIA_STOP, ///< Since wxWidgets 3.1.0
|
||||
WXK_MEDIA_PLAY_PAUSE, ///< Since wxWidgets 3.1.0
|
||||
WXK_LAUNCH_MAIL, ///< Since wxWidgets 3.1.0
|
||||
|
||||
/**
|
||||
First application launch key.
|
||||
|
||||
Note that this constant has the same value as WXK_LAUNCH_A.
|
||||
|
||||
@since 3.1.0
|
||||
*/
|
||||
WXK_LAUNCH_APP1,
|
||||
WXK_LAUNCH_APP2
|
||||
/**
|
||||
Second application launch key.
|
||||
|
||||
Note that this constant has the same value as WXK_LAUNCH_B.
|
||||
|
||||
@since 3.1.0
|
||||
*/
|
||||
WXK_LAUNCH_APP2,
|
||||
|
||||
WXK_LAUNCH_0, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_1, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_2, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_3, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_4, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_5, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_6, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_7, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_8, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_9, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_A, ///< Available since wxWidgets 3.1.6, generated by wxGTK and wxMSW.
|
||||
WXK_LAUNCH_B, ///< Available since wxWidgets 3.1.6, generated by wxGTK and wxMSW.
|
||||
WXK_LAUNCH_C, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_D, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_E, ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
WXK_LAUNCH_F ///< Available since wxWidgets 3.1.6 and only generated by wxGTK.
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1089,14 +1122,14 @@ enum wxKeyModifier
|
||||
{
|
||||
wxMOD_NONE = 0x0000,
|
||||
wxMOD_ALT = 0x0001,
|
||||
/** Ctlr Key, corresponds to Command key on OS X */
|
||||
/** Ctlr Key, corresponds to Command key on macOS */
|
||||
wxMOD_CONTROL = 0x0002,
|
||||
wxMOD_ALTGR = wxMOD_ALT | wxMOD_CONTROL,
|
||||
wxMOD_SHIFT = 0x0004,
|
||||
wxMOD_META = 0x0008,
|
||||
wxMOD_WIN = wxMOD_META,
|
||||
|
||||
/** used to describe the true Ctrl Key under OS X,
|
||||
/** used to describe the true Ctrl Key under macOS,
|
||||
identic to @c wxMOD_CONTROL on other platforms */
|
||||
wxMOD_RAW_CONTROL,
|
||||
|
||||
@@ -1577,7 +1610,7 @@ typedef double wxDouble;
|
||||
|
||||
@header{wx/defs.h}
|
||||
*/
|
||||
template <typename T> wxDELETE(T*& ptr);
|
||||
template <typename T> void wxDELETE(T*& ptr);
|
||||
|
||||
/**
|
||||
A function which deletes and nulls the pointer.
|
||||
@@ -1597,7 +1630,18 @@ template <typename T> wxDELETE(T*& ptr);
|
||||
|
||||
@header{wx/defs.h}
|
||||
*/
|
||||
template <typename T> wxDELETEA(T*& array);
|
||||
template <typename T> void wxDELETEA(T*& array);
|
||||
|
||||
/**
|
||||
Expands to the standard C++14 [[deprecated]] attribute if supported.
|
||||
|
||||
If not supported by the compiler, expands to nothing. If support for such
|
||||
compilers is important, use wxDEPRECATED_MSG() which is almost universally
|
||||
available.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
#define wxDEPRECATED_ATTR(msg) [[deprecated(msg)]]
|
||||
|
||||
/**
|
||||
Generate deprecation warning with the given message when a function is
|
||||
@@ -1796,7 +1840,7 @@ template <typename T> wxDELETEA(T*& array);
|
||||
wxASSERT( x == 4 && y == 3 );
|
||||
@endcode
|
||||
*/
|
||||
template <typename T> wxSwap(T& first, T& second);
|
||||
template <typename T> void wxSwap(T& first, T& second);
|
||||
|
||||
/**
|
||||
This macro is the same as the standard C99 @c va_copy for the compilers
|
||||
|
@@ -126,7 +126,7 @@ enum wxDialogLayoutAdaptationMode
|
||||
calling SetExtraStyle() before Create is called (two-step
|
||||
construction).
|
||||
@style{wxDIALOG_EX_METAL}
|
||||
On OS X, frames with this style will be shown with a metallic
|
||||
On macOS, frames with this style will be shown with a metallic
|
||||
look. This is an extra style.
|
||||
@endStyleTable
|
||||
|
||||
@@ -140,8 +140,7 @@ enum wxDialogLayoutAdaptationMode
|
||||
The dialog is being closed by the user or programmatically (see wxWindow::Close).
|
||||
The user may generate this event clicking the close button
|
||||
(typically the 'X' on the top-right of the title bar) if it's present
|
||||
(see the @c wxCLOSE_BOX style) or by clicking a button with the
|
||||
@c wxID_CANCEL or @c wxID_OK ids.
|
||||
(see the @c wxCLOSE_BOX style).
|
||||
@event{EVT_INIT_DIALOG(func)}
|
||||
Process a @c wxEVT_INIT_DIALOG event. See wxInitDialogEvent.
|
||||
@endEventTable
|
||||
@@ -582,7 +581,7 @@ public:
|
||||
otherwise the box is hidden. If @false and the dialog is modal,
|
||||
control is returned to the calling program.
|
||||
*/
|
||||
virtual bool Show(bool show = 1);
|
||||
virtual bool Show(bool show = true);
|
||||
|
||||
/**
|
||||
Shows an application-modal dialog.
|
||||
|
@@ -226,8 +226,10 @@ public:
|
||||
/**
|
||||
The function appends the names of all the files under directory
|
||||
@a dirname to the array @a files (note that its old content is
|
||||
preserved). Only files matching the @a filespec are taken, with empty
|
||||
spec matching all the files.
|
||||
preserved).
|
||||
|
||||
Only files matching the @a filespec are taken, with empty spec matching
|
||||
all non-hidden files (use ::wxDIR_HIDDEN to include them too).
|
||||
|
||||
The @a flags parameter should always include ::wxDIR_FILES or the array
|
||||
would be unchanged and should include ::wxDIR_DIRS flag to recurse into
|
||||
|
@@ -5,8 +5,12 @@
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#define wxDD_CHANGE_DIR 0x0100
|
||||
#define wxDD_DIR_MUST_EXIST 0x0200
|
||||
#define wxDD_MULTIPLE 0x0400
|
||||
#define wxDD_SHOW_HIDDEN 0x0001
|
||||
|
||||
#define wxDD_NEW_DIR_BUTTON 0 // deprecated, on by default now,
|
||||
|
||||
#define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
|
||||
@@ -43,6 +47,13 @@ const char wxDirDialogNameStr[] = "wxDirCtrl";
|
||||
@style{wxDD_CHANGE_DIR}
|
||||
Change the current working directory to the directory chosen by the
|
||||
user.
|
||||
This flag cannot be used with the @c wxDD_MULTIPLE style.
|
||||
@style{wxDD_MULTIPLE}
|
||||
Allow the user to select multiple directories.
|
||||
This flag is only available since wxWidgets 3.1.4
|
||||
@style{wxDD_SHOW_HIDDEN}
|
||||
Show hidden and system folders.
|
||||
This flag is only available since wxWidgets 3.1.4
|
||||
@endStyleTable
|
||||
|
||||
Notice that @c wxRESIZE_BORDER has special side effect under Windows
|
||||
@@ -60,6 +71,11 @@ const char wxDirDialogNameStr[] = "wxDirCtrl";
|
||||
@endcode
|
||||
instead of just using @c wxDD_DIR_MUST_EXIST style alone.
|
||||
|
||||
@remarks MacOS 10.11+ does not display a title bar on the dialog. Use SetMessage()
|
||||
to change the string displayed to the user at the top of the dialog after creation.
|
||||
The SetTitle() method is provided for compatibility with pre-10.11 MacOS versions
|
||||
that do still support displaying the title bar.
|
||||
|
||||
@library{wxcore}
|
||||
@category{cmndlg}
|
||||
|
||||
@@ -106,9 +122,22 @@ public:
|
||||
|
||||
/**
|
||||
Returns the default or user-selected path.
|
||||
|
||||
@note This function can't be used with dialogs which have the @c wxDD_MULTIPLE style,
|
||||
use GetPaths() instead.
|
||||
*/
|
||||
virtual wxString GetPath() const;
|
||||
|
||||
/**
|
||||
Fills the array @a paths with the full paths of the chosen directories.
|
||||
|
||||
@note This function should only be used with the dialogs which have @c wxDD_MULTIPLE style,
|
||||
use GetPath() for the others.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
virtual void GetPaths(wxArrayString& paths) const;
|
||||
|
||||
/**
|
||||
Sets the message that will be displayed on the dialog.
|
||||
*/
|
||||
|
@@ -143,6 +143,46 @@ public:
|
||||
*/
|
||||
wxSize GetPPI() const;
|
||||
|
||||
/**
|
||||
Returns scaling factor used by this display.
|
||||
|
||||
The scaling factor is the ratio between GetPPI() and GetStdPPI()
|
||||
(it is implicitly assumed that this ratio is the same for both
|
||||
horizontal and vertical components).
|
||||
|
||||
@see wxWindow::GetContentScaleFactor(), wxWindow::GetDPIScaleFactor()
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
double GetScaleFactor() const;
|
||||
|
||||
/**
|
||||
Returns default display resolution for the current platform in pixels
|
||||
per inch.
|
||||
|
||||
This function mostly used internally, use GetPPI() to get the actual
|
||||
display resolution.
|
||||
|
||||
Currently the standard PPI is the same in both horizontal and vertical
|
||||
directions on all platforms and its value is 96 everywhere except under
|
||||
Apple devices (those running macOS, iOS, watchOS etc), where it is 72.
|
||||
|
||||
@see GetStdPPI()
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
static int GetStdPPIValue();
|
||||
|
||||
/**
|
||||
Returns default display resolution for the current platform as wxSize.
|
||||
|
||||
This function is equivalent to constructing wxSize object with both
|
||||
components set to GetStdPPIValue().
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
static wxSize GetStdPPI();
|
||||
|
||||
/**
|
||||
Returns @true if the display is the primary display. The primary
|
||||
display is the one whose index is 0.
|
||||
|
@@ -146,7 +146,7 @@ public:
|
||||
/**
|
||||
Sets the default action for drag and drop. Use wxDragMove or
|
||||
wxDragCopy to set default action to move or copy and use wxDragNone
|
||||
(default) to set default action specified by initialization of draging
|
||||
(default) to set default action specified by initialization of dragging
|
||||
(see wxDropSource::DoDragDrop())
|
||||
*/
|
||||
void SetDefaultAction(wxDragResult action);
|
||||
|
@@ -922,6 +922,8 @@ public:
|
||||
/**
|
||||
Closes the view by calling OnClose(). If @a deleteWindow is @true, this
|
||||
function should delete the window associated with the view.
|
||||
|
||||
@return @true if the view was closed
|
||||
*/
|
||||
virtual bool Close(bool deleteWindow = true);
|
||||
|
||||
@@ -971,6 +973,9 @@ public:
|
||||
example, if your views all share the same window, you need to
|
||||
disassociate the window from the view and perhaps clear the window. If
|
||||
@a deleteWindow is @true, delete the frame associated with the view.
|
||||
|
||||
Returning @false from this function prevents the view, and possibly the
|
||||
document, from being closed.
|
||||
*/
|
||||
virtual bool OnClose(bool deleteWindow);
|
||||
|
||||
@@ -1295,6 +1300,8 @@ public:
|
||||
Closes the document, by calling OnSaveModified() and then (if this
|
||||
returned @true) OnCloseDocument(). This does not normally delete the
|
||||
document object, use DeleteAllViews() to do this implicitly.
|
||||
|
||||
@return @true if the document was closed
|
||||
*/
|
||||
virtual bool Close();
|
||||
|
||||
@@ -1463,6 +1470,12 @@ public:
|
||||
Notice that previous wxWidgets versions used to call this function also
|
||||
from OnNewDocument(), rather counter-intuitively. This is no longer the
|
||||
case since wxWidgets 2.9.0.
|
||||
|
||||
Returning @false from this function prevents the document from closing.
|
||||
The default implementation does this if the document is modified and
|
||||
the user didn't confirm discarding the modifications to it.
|
||||
|
||||
Return @true to allow the document to be closed.
|
||||
*/
|
||||
virtual bool OnCloseDocument();
|
||||
|
||||
|
@@ -123,7 +123,7 @@ public:
|
||||
is included.
|
||||
|
||||
For example, on Windows @c ".dll" is returned, and either @c ".dylib"
|
||||
or @c ".bundle" on OS X.
|
||||
or @c ".bundle" on macOS.
|
||||
*/
|
||||
static wxString GetDllExt(wxDynamicLibraryCategory cat = wxDL_LIBRARY);
|
||||
|
||||
@@ -147,9 +147,23 @@ public:
|
||||
wxPluginCategory cat = wxDL_PLUGIN_GUI);
|
||||
|
||||
/**
|
||||
Detaches this object from its library handle, i.e.\ the object will not
|
||||
unload the library any longer in its destructor but it is now the
|
||||
callers responsibility to do this using Unload().
|
||||
Attaches the object to an existing handle.
|
||||
|
||||
This allows to give ownership of an existing handle, possibly obtained
|
||||
from Detach(), to this object, so that it will unload it when destroyed.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
void Attach(wxDllType h);
|
||||
|
||||
/**
|
||||
Detaches this object from its library handle.
|
||||
|
||||
This means that the object will not unload the library any longer in
|
||||
its destructor but it is now the callers responsibility to do this
|
||||
using static Unload().
|
||||
|
||||
@see Attach()
|
||||
*/
|
||||
wxDllType Detach();
|
||||
|
||||
|
@@ -710,7 +710,13 @@ public:
|
||||
Notice that Bind() provides a more flexible and safer way to do the
|
||||
same thing as Connect(), please use it in any new code -- while
|
||||
Connect() is not formally deprecated due to its existing widespread
|
||||
usage, it has no advantages compared to Bind().
|
||||
usage, it has no advantages compared to Bind() and has a number of
|
||||
drawbacks, including:
|
||||
|
||||
- Less compile-time safety.
|
||||
- Unintuitive parameter order.
|
||||
- Limited to use with the methods of the classes publicly inheriting
|
||||
from wxEvtHandler.
|
||||
|
||||
This is an alternative to the use of static event tables. It is more
|
||||
flexible as it allows connecting events generated by some object to an
|
||||
@@ -1315,20 +1321,26 @@ enum wxKeyCategoryFlags
|
||||
This event class contains information about key press and release events.
|
||||
|
||||
The main information carried by this event is the key being pressed or
|
||||
released. It can be accessed using either GetKeyCode() function or
|
||||
GetUnicodeKey(). For the printable characters, the latter should be used as
|
||||
it works for any keys, including non-Latin-1 characters that can be entered
|
||||
when using national keyboard layouts. GetKeyCode() should be used to handle
|
||||
released. It can be accessed using one of GetUnicodeKey(), GetKeyCode()
|
||||
or GetRawKeyCode() functions.
|
||||
For the printable characters, GetUnicodeKey() should be used as it works
|
||||
for any keys, including non-Latin-1 characters that can be entered when
|
||||
using national keyboard layouts. GetKeyCode() should be used to handle
|
||||
special characters (such as cursor arrows keys or @c HOME or @c INS and so
|
||||
on) which correspond to ::wxKeyCode enum elements above the @c WXK_START
|
||||
constant. While GetKeyCode() also returns the character code for Latin-1
|
||||
keys for compatibility, it doesn't work for Unicode characters in general
|
||||
and will return @c WXK_NONE for any non-Latin-1 ones. For this reason, it's
|
||||
recommended to always use GetUnicodeKey() and only fall back to GetKeyCode()
|
||||
if GetUnicodeKey() returned @c WXK_NONE meaning that the event corresponds
|
||||
to a non-printable special keys.
|
||||
and will return @c WXK_NONE for any non-Latin-1 ones.
|
||||
If both GetUnicodeKey() and GetKeyCode() return @c WXK_NONE then the key
|
||||
has no @c WXK_xxx mapping and GetRawKeyCode() can be used to distinguish
|
||||
between keys, but raw key codes are platform specific.
|
||||
For these reasons, it is recommended to always use GetUnicodeKey() and
|
||||
only fall back to GetKeyCode() if GetUnicodeKey() returned @c WXK_NONE,
|
||||
meaning that the event corresponds to a non-printable special keys, then
|
||||
optionally check GetRawKeyCode() if GetKeyCode() also returned @c WXK_NONE
|
||||
or simply ignore that key.
|
||||
|
||||
While both of these functions can be used with the events of @c
|
||||
While these three functions can be used with the events of @c
|
||||
wxEVT_KEY_DOWN, @c wxEVT_KEY_UP and @c wxEVT_CHAR types, the values
|
||||
returned by them are different for the first two events and the last one.
|
||||
For the latter, the key returned corresponds to the character that would
|
||||
@@ -1362,6 +1374,10 @@ enum wxKeyCategoryFlags
|
||||
can be used to retrieve the key code as GetKeyCode() just returns @c
|
||||
WXK_NONE in this case.
|
||||
|
||||
Also, note that @c wxEVT_CHAR events are not generated for keys which do
|
||||
not have a wxWidgets mapping, so GetRawKeyCode() should never be required
|
||||
for this event.
|
||||
|
||||
To summarize: you should handle @c wxEVT_CHAR if you need the translated
|
||||
key and @c wxEVT_KEY_DOWN if you only need the value of the key itself,
|
||||
independent of the current keyboard state.
|
||||
@@ -1547,6 +1563,15 @@ public:
|
||||
*/
|
||||
bool IsKeyInCategory(int category) const;
|
||||
|
||||
/**
|
||||
Returns true if this event is an auto-repeat of the key, false if this
|
||||
is the initial key press.
|
||||
|
||||
@since 3.1.6
|
||||
@onlyfor{wxosx,wxmsw,wxQt}
|
||||
*/
|
||||
bool IsAutoRepeat() const;
|
||||
|
||||
//@{
|
||||
/**
|
||||
Obtains the position (in client coordinates) at which the key was pressed.
|
||||
@@ -1574,7 +1599,7 @@ public:
|
||||
Under GTK, the raw key code is the @c keyval field of the corresponding
|
||||
GDK event.
|
||||
|
||||
Under OS X, the raw key code is the @c keyCode field of the
|
||||
Under macOS, the raw key code is the @c keyCode field of the
|
||||
corresponding NSEvent.
|
||||
|
||||
@note Currently the raw key codes are not supported by all ports, use
|
||||
@@ -1594,7 +1619,7 @@ public:
|
||||
Under GTK, the raw flags contain the @c hardware_keycode field of the
|
||||
corresponding GDK event.
|
||||
|
||||
Under OS X, the raw flags contain the modifiers state.
|
||||
Under macOS, the raw flags contain the modifiers state.
|
||||
|
||||
@note Currently the raw key flags are not supported by all ports, use
|
||||
@ifdef_ wxHAS_RAW_KEY_CODES to determine if this feature is available.
|
||||
@@ -1876,14 +1901,18 @@ public:
|
||||
@class wxSysColourChangedEvent
|
||||
|
||||
This class is used for system colour change events, which are generated
|
||||
when the user changes the colour settings using the control panel.
|
||||
This is only appropriate under Windows.
|
||||
when the user changes the colour settings or when the system theme changes
|
||||
(e.g. automatic dark mode switching on macOS).
|
||||
|
||||
Event handlers for this event can access the new system colour settings through
|
||||
wxSystemSettings::GetColour().
|
||||
|
||||
@remarks
|
||||
The default event handler for this event propagates the event to child windows,
|
||||
since Windows only sends the events to top-level windows.
|
||||
If intercepting this event for a top-level window, remember to call the base
|
||||
class handler, or to pass the event on to the window's children explicitly.
|
||||
since the system events are only sent to top-level windows.
|
||||
If intercepting this event for a top-level window, remember to either call
|
||||
wxEvent::Skip() on the event, call the base class handler, or pass the event
|
||||
on to the window's children explicitly.
|
||||
|
||||
@beginEventTable{wxSysColourChangedEvent}
|
||||
@event{EVT_SYS_COLOUR_CHANGED(func)}
|
||||
@@ -2258,6 +2287,46 @@ public:
|
||||
wxMaximizeEvent(int id = 0);
|
||||
};
|
||||
|
||||
/**
|
||||
@class wxFullScreenEvent
|
||||
|
||||
An event being sent when the user enters or exits full screen mode.
|
||||
|
||||
Currently this event is only generated in the wxOSX/Cocoa port when
|
||||
wxTopLevelWindow::EnableFullScreenView() is enabled and the user
|
||||
the user enters or exits full screen. Note that this event is @e not
|
||||
generated when wxTopLevelWindow::ShowFullScreen().
|
||||
|
||||
@beginEventTable{wxFullScreenEvent}
|
||||
@event{EVT_FULLSCREEN(func)}
|
||||
Process a @c wxEVT_FULLSCREEN event.
|
||||
@endEventTable
|
||||
|
||||
@library{wxcore}
|
||||
@category{events}
|
||||
|
||||
@since 3.1.5
|
||||
|
||||
@see @ref overview_events, wxTopLevelWindow::EnableFullScreenView,
|
||||
wxTopLevelWindow::IsFullScreen
|
||||
*/
|
||||
class wxFullScreenEvent : public wxEvent
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Constructor.
|
||||
*/
|
||||
wxFullScreenEvent(int id = 0, bool fullscreen = true);
|
||||
|
||||
/**
|
||||
Returns @true if the frame entered full screen, @false if exited
|
||||
full screen.
|
||||
*/
|
||||
bool IsFullScreen() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
The possibles modes to pass to wxUpdateUIEvent::SetMode().
|
||||
*/
|
||||
@@ -2374,6 +2443,26 @@ public:
|
||||
*/
|
||||
bool GetEnabled() const;
|
||||
|
||||
/**
|
||||
Returns @true if the UI element can be checked.
|
||||
|
||||
For the event handlers that can be used for multiple items, not all of
|
||||
which can be checked, this method can be useful to determine whether
|
||||
to call Check() on the event object or not, i.e. the main use case for
|
||||
this method is:
|
||||
@code
|
||||
void MyWindow::OnUpdateUI(wxUpdateUIEvent& event)
|
||||
{
|
||||
....
|
||||
if ( event.IsCheckable() )
|
||||
event.Check(...some condition...);
|
||||
}
|
||||
@endcode
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
bool IsCheckable() const;
|
||||
|
||||
/**
|
||||
Static function returning a value specifying how wxWidgets will send update
|
||||
events: to all windows, or only to those which specify that they will process
|
||||
@@ -2784,7 +2873,7 @@ public:
|
||||
(or zoom in), a negative value means we should shrink (or zoom out).
|
||||
|
||||
This method is only valid to call for @c wxEVT_MAGNIFY events which are
|
||||
currently only generated under OS X.
|
||||
currently only generated under macOS.
|
||||
|
||||
@see Magnify()
|
||||
|
||||
@@ -2877,7 +2966,7 @@ public:
|
||||
/**
|
||||
Returns @true if the event is a magnify (i.e.\ pinch to zoom) event.
|
||||
|
||||
Such events are currently generated only under OS X.
|
||||
Such events are currently generated only under macOS.
|
||||
|
||||
@see GetMagnification()
|
||||
|
||||
@@ -3371,6 +3460,39 @@ public:
|
||||
Returns the new DPI.
|
||||
*/
|
||||
wxSize GetNewDPI() const;
|
||||
|
||||
/**
|
||||
Rescale a value in pixels to match the new DPI.
|
||||
|
||||
This is a convenience function to use in wxEVT_DPI_CHANGED event
|
||||
handlers, as they often need to update some sizes to the new DPI.
|
||||
It simply calls wxMulDivInt32() with new and old DPI values, but
|
||||
is more readable and less error-prone.
|
||||
|
||||
For example, the returned value will be twice bigger than the original
|
||||
one when switching from normal (96) DPI to high (2x, 192) DPI.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
wxSize Scale(wxSize sz) const;
|
||||
|
||||
/**
|
||||
Rescale horizontal component to match the new DPI.
|
||||
|
||||
This is the same as Scale(), but for the horizontal component only.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
int ScaleX(int x) const;
|
||||
|
||||
/**
|
||||
Rescale vertical component to match the new DPI.
|
||||
|
||||
This is the same as Scale(), but for the vertical component only.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
int ScaleY(int y) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -4291,7 +4413,7 @@ public:
|
||||
/**
|
||||
@class wxMouseCaptureChangedEvent
|
||||
|
||||
An mouse capture changed event is sent to a window that loses its
|
||||
A mouse capture changed event is sent to a window that loses its
|
||||
mouse capture. This is called even if wxWindow::ReleaseMouse
|
||||
was called by the application code. Handling this event allows
|
||||
an application to cater for unexpected capture releases which
|
||||
@@ -4459,7 +4581,6 @@ public:
|
||||
wxMenuBar, attached to wxFrame, and popup menus shown by
|
||||
wxWindow::PopupMenu(). They are sent to the following objects until one of
|
||||
them handles the event:
|
||||
|
||||
-# The menu object itself, as returned by GetMenu(), if any.
|
||||
-# The wxMenuBar to which this menu is attached, if any.
|
||||
-# The window associated with the menu, e.g. the one calling
|
||||
@@ -5128,4 +5249,3 @@ wxEventType wxEVT_WINDOW_MODAL_DIALOG_CLOSED;
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
//@}
|
||||
|
||||
|
@@ -91,9 +91,6 @@ public:
|
||||
Initial size.
|
||||
@param name
|
||||
Control name.
|
||||
|
||||
@return @true if the control was successfully created or @false if
|
||||
creation failed.
|
||||
*/
|
||||
|
||||
wxFileCtrl(wxWindow* parent, wxWindowID id,
|
||||
@@ -107,6 +104,9 @@ public:
|
||||
|
||||
/**
|
||||
Create function for two-step construction. See wxFileCtrl() for details.
|
||||
|
||||
@return @true if the control was successfully created or @false if
|
||||
creation failed.
|
||||
*/
|
||||
bool Create(wxWindow* parent, wxWindowID id,
|
||||
const wxString& defaultDirectory = wxEmptyString,
|
||||
|
@@ -108,7 +108,7 @@ const char wxFileSelectorDefaultWildcardStr[];
|
||||
descriptive test; "BMP files (*.bmp)|*.bmp" is displayed as "*.bmp", and both
|
||||
"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif" and "Image files|*.bmp;*.gif"
|
||||
are errors.
|
||||
On Mac OS X in the open file dialog the filter choice box is not shown by default.
|
||||
On Mac macOS in the open file dialog the filter choice box is not shown by default.
|
||||
Instead all given wildcards are appplied at the same time: So in the above
|
||||
example all bmp, gif and png files are displayed. To enforce the
|
||||
display of the filter choice set the corresponding wxSystemOptions before calling
|
||||
@@ -117,7 +117,7 @@ const char wxFileSelectorDefaultWildcardStr[];
|
||||
wxSystemOptions::SetOption(wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES, 1)
|
||||
@endcode
|
||||
But in contrast to Windows and Unix, where the file type choice filters only
|
||||
the selected files, on Mac OS X even in this case the dialog shows all files
|
||||
the selected files, on Mac macOS even in this case the dialog shows all files
|
||||
matching all file types. The files which does not match the currently selected
|
||||
file type are greyed out and are not selectable.
|
||||
|
||||
@@ -133,6 +133,7 @@ const char wxFileSelectorDefaultWildcardStr[];
|
||||
@style{wxFD_OVERWRITE_PROMPT}
|
||||
For save dialog only: prompt for a confirmation if a file will be
|
||||
overwritten.
|
||||
This style is always enabled on wxOSX and cannot be disabled.
|
||||
@style{wxFD_NO_FOLLOW}
|
||||
Directs the dialog to return the path and file name of the selected
|
||||
shortcut file, not its target as it does by default. Currently this
|
||||
@@ -143,9 +144,9 @@ const char wxFileSelectorDefaultWildcardStr[];
|
||||
3.1.0.
|
||||
@style{wxFD_FILE_MUST_EXIST}
|
||||
For open dialog only: the user may only select files that actually
|
||||
exist. Notice that under OS X the file dialog with @c wxFD_OPEN
|
||||
exist. Notice that under macOS the file dialog with @c wxFD_OPEN
|
||||
style always behaves as if this style was specified, because it is
|
||||
impossible to choose a file that doesn't exist from a standard OS X
|
||||
impossible to choose a file that doesn't exist from a standard macOS
|
||||
file dialog.
|
||||
@style{wxFD_MULTIPLE}
|
||||
For open dialog only: allows selecting multiple files.
|
||||
@@ -235,10 +236,11 @@ public:
|
||||
control to update its state depending on the currently selected file
|
||||
type filter.
|
||||
|
||||
Currently this function is fully implemented only under MSW and
|
||||
Currently this function is fully implemented under macOS and MSW and
|
||||
always returns @c wxNOT_FOUND elsewhere.
|
||||
|
||||
@since 3.1.3
|
||||
@since 3.1.3 - MSW
|
||||
@since 3.1.5 - macOS
|
||||
|
||||
@return The 0-based index of the currently selected file type filter or
|
||||
wxNOT_FOUND if nothing is selected.
|
||||
@@ -264,6 +266,9 @@ public:
|
||||
|
||||
/**
|
||||
Returns the default filename.
|
||||
|
||||
@note This function can't be used with dialogs which have the @c wxFD_MULTIPLE style,
|
||||
use GetFilenames() instead.
|
||||
*/
|
||||
virtual wxString GetFilename() const;
|
||||
|
||||
@@ -298,6 +303,9 @@ public:
|
||||
|
||||
/**
|
||||
Returns the full path (directory and filename) of the selected file.
|
||||
|
||||
@note This function can't be used with dialogs which have the @c wxFD_MULTIPLE style,
|
||||
use GetPaths() instead.
|
||||
*/
|
||||
virtual wxString GetPath() const;
|
||||
|
||||
|
@@ -263,6 +263,9 @@ bool wxFileExists(const wxString& filename);
|
||||
@true, filenames beginning with a dot are not matched with wildcard
|
||||
characters.
|
||||
|
||||
@note Matching is always case-sensitive, even on platforms where paths
|
||||
are generally treated as case-insensitive.
|
||||
|
||||
@see wxIsWild()
|
||||
|
||||
@header{wx/filefn.h}
|
||||
|
@@ -5,6 +5,41 @@
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
Styles for the paths shown in wxFileHistory menus.
|
||||
|
||||
The values of this enum determine whether the labels in the menu managed by
|
||||
wxFileHistory show the full path for the corresponding file or just the
|
||||
base name.
|
||||
|
||||
The default style is wxFH_PATH_SHOW_IF_DIFFERENT, i.e. the full path of the
|
||||
file is only shown in the menu if it's different from the path of the first
|
||||
file.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
enum wxFileHistoryMenuPathStyle
|
||||
{
|
||||
/**
|
||||
Show the full path if it's different from the path of the first file.
|
||||
|
||||
Otherwise show just the file name.
|
||||
|
||||
This value corresponds to the default behaviour.
|
||||
*/
|
||||
wxFH_PATH_SHOW_IF_DIFFERENT,
|
||||
|
||||
/**
|
||||
Never show full path, always show just the base file name.
|
||||
*/
|
||||
wxFH_PATH_SHOW_NEVER,
|
||||
|
||||
/**
|
||||
Always show the full path for all files.
|
||||
*/
|
||||
wxFH_PATH_SHOW_ALWAYS
|
||||
};
|
||||
|
||||
/**
|
||||
@class wxFileHistory
|
||||
|
||||
@@ -120,4 +155,26 @@ public:
|
||||
called, as this is not done automatically.
|
||||
*/
|
||||
virtual void UseMenu(wxMenu* menu);
|
||||
|
||||
/**
|
||||
Set the style of the menu item labels.
|
||||
|
||||
By default, the menu item label style is ::wxFH_PATH_SHOW_IF_DIFFERENT.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
void SetMenuPathStyle(wxFileHistoryMenuPathStyle style);
|
||||
|
||||
/**
|
||||
Get the current style of the menu item labels.
|
||||
|
||||
Initially returns ::wxFH_PATH_SHOW_IF_DIFFERENT.
|
||||
|
||||
@see SetMenuPathStyle()
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxFileHistoryMenuPathStyle GetMenuPathStyle() const;
|
||||
|
||||
|
||||
};
|
||||
|
@@ -54,20 +54,52 @@ enum wxSizeConvention
|
||||
*/
|
||||
enum wxPathNormalize
|
||||
{
|
||||
//! Replace environment variables with their values.
|
||||
//! wxFileName understands both Unix and Windows (but only under Windows) environment
|
||||
//! variables expansion: i.e. @c "$var", @c "$(var)" and @c "${var}" are always understood
|
||||
//! and in addition under Windows @c "%var%" is also.
|
||||
/**
|
||||
Replace environment variables with their values.
|
||||
|
||||
wxFileName understands both Unix and Windows (but only under Windows) environment
|
||||
variables expansion: i.e. @c "$var", @c "$(var)" and @c "${var}" are always understood
|
||||
and in addition under Windows @c "%var%" is also.
|
||||
|
||||
Note that when this flag is used, dollar or percent signs may be
|
||||
escaped with backslashes to prevent them from being used for the
|
||||
variable expansion, meaning that normalizing any path with a directory
|
||||
starting with a dollar sign under Windows can give unexpected results,
|
||||
as normalizing @c c:\\foo\\$bar results in @c c:\\foo$bar. Because of
|
||||
this, using this flag with arbitrary paths is not recommended.
|
||||
*/
|
||||
wxPATH_NORM_ENV_VARS = 0x0001,
|
||||
|
||||
wxPATH_NORM_DOTS = 0x0002, //!< Squeeze all @c ".." and @c ".".
|
||||
wxPATH_NORM_TILDE = 0x0004, //!< Replace @c "~" and @c "~user" (Unix only).
|
||||
wxPATH_NORM_CASE = 0x0008, //!< If the platform is case insensitive, make lowercase the path.
|
||||
wxPATH_NORM_ABSOLUTE = 0x0010, //!< Make the path absolute.
|
||||
wxPATH_NORM_LONG = 0x0020, //!< Expand the path to the "long" form (Windows only).
|
||||
|
||||
/**
|
||||
Expand the path to the "long" form under Windows.
|
||||
|
||||
This flag converts DOS short paths in 8.3 format to long form under
|
||||
Windows and does nothing under the other platforms. It is mostly
|
||||
irrelevant nowadays as short paths are not used any longer in practice.
|
||||
|
||||
Notice that it only works for the existing file paths.
|
||||
|
||||
@see wxFileName::GetLongPath()
|
||||
*/
|
||||
wxPATH_NORM_LONG = 0x0020,
|
||||
|
||||
wxPATH_NORM_SHORTCUT = 0x0040, //!< Resolve the shortcut, if it is a shortcut (Windows only).
|
||||
|
||||
//! A value indicating all normalization flags except for @c wxPATH_NORM_CASE.
|
||||
/**
|
||||
Flags used by wxFileName::Normalize() by default.
|
||||
|
||||
This includes all normalization flags except for @c wxPATH_NORM_CASE
|
||||
and notably does include @c wxPATH_NORM_ENV_VARS which may yield
|
||||
unexpected results, as described above. Because of this, this flag is
|
||||
deprecated and shouldn't be used in the new code and the existing code
|
||||
should be reviewed to check if expanding environment variables is
|
||||
really needed.
|
||||
*/
|
||||
wxPATH_NORM_ALL = 0x00ff & ~wxPATH_NORM_CASE
|
||||
};
|
||||
|
||||
@@ -266,8 +298,6 @@ wxULongLong wxInvalidSize;
|
||||
@li wxFileName::SetName()
|
||||
@li wxFileName::SetVolume()
|
||||
|
||||
You can initialize a wxFileName instance using one of the following functions:
|
||||
|
||||
|
||||
@section filename_operations File name operations
|
||||
|
||||
@@ -287,6 +317,24 @@ wxULongLong wxInvalidSize;
|
||||
@li wxFileName::Mkdir()
|
||||
@li wxFileName::Rmdir()
|
||||
|
||||
@section symlink_behavior Behavior with symlinks
|
||||
|
||||
wxFileName instances can store the path to symlinks on systems that support them.
|
||||
When the path is for a symlink, the behavior of the following methods can be modified
|
||||
to either operate on the symlink itself or on the file the link points to.
|
||||
|
||||
@li wxFileName::FileExists()
|
||||
@li wxFileName::DirExists()
|
||||
@li wxFileName::Exists()
|
||||
@li wxFileName::SameAs()
|
||||
@li wxFileName::GetTimes()
|
||||
|
||||
By default, those functions will operate on the target of the link, but they can be
|
||||
made to operate on the link itself by calling wxFileName::DontFollowLink(). The current
|
||||
link-following mode can be examined by calling wxFileName::ShouldFollowLink().
|
||||
|
||||
The wxFileName::ResolveLink() method can be used to get the absolute path for the target
|
||||
of the symlink.
|
||||
|
||||
@library{wxbase}
|
||||
@category{file}
|
||||
@@ -585,6 +633,17 @@ public:
|
||||
static wxFileName FileName(const wxString& file,
|
||||
wxPathFormat format = wxPATH_NATIVE);
|
||||
|
||||
/**
|
||||
Returns full absolute path for this file.
|
||||
|
||||
This is just a convenient shortcut using MakeAbsolute() and
|
||||
GetFullPath() internally.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
wxString GetAbsolutePath(const wxString& cwd = wxEmptyString,
|
||||
wxPathFormat format = wxPATH_NATIVE) const;
|
||||
|
||||
/**
|
||||
Retrieves the value of the current working directory on the specified volume.
|
||||
If the volume is empty, the program's current working directory is returned for
|
||||
@@ -800,14 +859,32 @@ public:
|
||||
wxDateTime* dtCreate) const;
|
||||
|
||||
/**
|
||||
Returns the string containing the volume for this file name, empty if it
|
||||
doesn't have one or if the file system doesn't support volumes at all
|
||||
(for example, Unix).
|
||||
Returns the string containing the volume for this file name.
|
||||
|
||||
The returned string is empty if this object doesn't have a volume name,
|
||||
as is always the case for the paths in Unix format which don't support
|
||||
volumes at all.
|
||||
|
||||
Note that for @c wxPATH_DOS format paths, the returned string may have
|
||||
one of the following forms:
|
||||
|
||||
- Just a single letter, for the usual drive letter volumes, e.g. @c C.
|
||||
- A share name preceded by a double backslash, e.g. @c \\\\share.
|
||||
- A GUID volume preceded by a double backslash and a question mark,
|
||||
e.g. @c \\\\?\\Volume{12345678-9abc-def0-1234-56789abcdef0}.
|
||||
*/
|
||||
wxString GetVolume() const;
|
||||
|
||||
/**
|
||||
Returns the string separating the volume from the path for this format.
|
||||
|
||||
Note that for @c wxPATH_DOS paths this string can only be used for
|
||||
single-character volumes representing the drive letters, but not with
|
||||
the UNC or GUID volumes (see their description in GetVolume()
|
||||
documentation). For this reason, its use should be avoided, prefer
|
||||
using wxFileName constructor and Assign() overload taking the volume
|
||||
and the path as separate arguments to combining the volume and the path
|
||||
into a single string using the volume separator between them.
|
||||
*/
|
||||
static wxString GetVolumeSeparator(wxPathFormat format = wxPATH_NATIVE);
|
||||
|
||||
@@ -1051,7 +1128,9 @@ public:
|
||||
Normalize the path.
|
||||
|
||||
With the default flags value, the path will be made absolute, without
|
||||
any ".." and "." and all environment variables will be expanded in it.
|
||||
any ".." and ".", and, for the Unix format paths, any occurrences of
|
||||
tilde (@c ~) character will be replaced with the home directory of the
|
||||
user following it.
|
||||
|
||||
Notice that in some rare cases normalizing a valid path may result in
|
||||
an invalid wxFileName object. E.g. normalizing "./" path using
|
||||
@@ -1062,6 +1141,9 @@ public:
|
||||
@param flags
|
||||
The kind of normalization to do with the file name. It can be
|
||||
any or-combination of the ::wxPathNormalize enumeration values.
|
||||
These values should be explicitly specified, omitting them uses the
|
||||
deprecated wxPATH_NORM_ALL value which is not recommended, see
|
||||
wxPathNormalize enum for more details.
|
||||
@param cwd
|
||||
If not empty, this directory will be used instead of current
|
||||
working directory in normalization (see @c wxPATH_NORM_ABSOLUTE).
|
||||
@@ -1070,7 +1152,7 @@ public:
|
||||
|
||||
@return @true if normalization was successfully or @false otherwise.
|
||||
*/
|
||||
bool Normalize(int flags = wxPATH_NORM_ALL,
|
||||
bool Normalize(int flags,
|
||||
const wxString& cwd = wxEmptyString,
|
||||
wxPathFormat format = wxPATH_NATIVE);
|
||||
|
||||
@@ -1138,14 +1220,35 @@ public:
|
||||
*/
|
||||
bool ReplaceHomeDir(wxPathFormat format = wxPATH_NATIVE);
|
||||
|
||||
/**
|
||||
Find the absolute path of the file/directory that is pointed to by this
|
||||
path.
|
||||
|
||||
If this path isn't a symlink, then this function will return the current
|
||||
path. If the path does not exist on disk, An empty wxFileName instance
|
||||
will be returned.
|
||||
|
||||
@note This is only supported on Unix-like platforms (e.g. wxGTK, wxOSX),
|
||||
on other platforms (e.g. wxMSW) this function just returns the
|
||||
current path.
|
||||
|
||||
@since 3.1.5
|
||||
|
||||
@return The absolute path that the current symlink path points to.
|
||||
*/
|
||||
wxFileName ResolveLink();
|
||||
|
||||
|
||||
/**
|
||||
Deletes the specified directory from the file system.
|
||||
|
||||
@param flags
|
||||
Can contain one of wxPATH_RMDIR_FULL or wxPATH_RMDIR_RECURSIVE. By
|
||||
default contains neither so the directory will not be removed
|
||||
unless it is empty.
|
||||
With default value, the directory is removed only if it is empty.
|
||||
If wxPATH_RMDIR_FULL is specified, it is removed even if it
|
||||
contains subdirectories, provided that there are no files in
|
||||
neither this directory nor its subdirectories. If flags contains
|
||||
wxPATH_RMDIR_RECURSIVE, then the directory is removed with all the
|
||||
files and directories under it.
|
||||
|
||||
@return Returns @true if the directory was successfully deleted, @false
|
||||
otherwise.
|
||||
@@ -1158,9 +1261,12 @@ public:
|
||||
@param dir
|
||||
The directory to delete
|
||||
@param flags
|
||||
Can contain one of wxPATH_RMDIR_FULL or wxPATH_RMDIR_RECURSIVE. By
|
||||
default contains neither so the directory will not be removed
|
||||
unless it is empty.
|
||||
With default value, the directory is removed only if it is empty.
|
||||
If wxPATH_RMDIR_FULL is specified, it is removed even if it
|
||||
contains subdirectories, provided that there are no files in
|
||||
neither this directory nor its subdirectories. If flags contains
|
||||
wxPATH_RMDIR_RECURSIVE, then the directory is removed with all the
|
||||
files and directories under it.
|
||||
|
||||
@return Returns @true if the directory was successfully deleted, @false
|
||||
otherwise.
|
||||
|
@@ -493,7 +493,7 @@ public:
|
||||
|
||||
Use wxStreamBase::IsOk() to verify if the constructor succeeded.
|
||||
*/
|
||||
wxFileInputStream(const wxString& filename, int flags = 0);
|
||||
wxFSInputStream(const wxString& filename, int flags = 0);
|
||||
|
||||
/**
|
||||
Returns @true if the stream is initialized and ready.
|
||||
|
@@ -322,16 +322,12 @@ public:
|
||||
/**
|
||||
Constructor setting the font size in points to use.
|
||||
|
||||
The canonical type of @a pointSize argument is @c float, however any
|
||||
other integer type, as well as @c double, is also accepted for
|
||||
compatibility.
|
||||
|
||||
Notice that until wxWidgets 3.1.2, the type could only be @c int.
|
||||
Note that until wxWidgets 3.1.2 fractional point sizes were not
|
||||
supported, and the type of @a pointSize was @c int.
|
||||
|
||||
@see wxFont::SetPointSize()
|
||||
*/
|
||||
template <typename T>
|
||||
explicit wxFontInfo(T pointSize);
|
||||
explicit wxFontInfo(double pointSize);
|
||||
|
||||
/**
|
||||
Constructor setting the font size in pixels to use.
|
||||
@@ -743,7 +739,7 @@ public:
|
||||
This method can be used to allow this application to use the font from
|
||||
the given file even if it is not globally installed on the system.
|
||||
|
||||
Under OS X this method actually doesn't do anything other than check
|
||||
Under macOS this method actually doesn't do anything other than check
|
||||
for the existence of the file in the "Fonts" subdirectory of the
|
||||
application bundle "Resources" directory. You are responsible for
|
||||
actually making the font file available in this directory and setting
|
||||
@@ -786,7 +782,7 @@ public:
|
||||
|
||||
@since 3.1.2
|
||||
*/
|
||||
virtual float GetFractionalPointSize() const;
|
||||
virtual double GetFractionalPointSize() const;
|
||||
|
||||
/**
|
||||
Gets the pixel size.
|
||||
@@ -1139,7 +1135,7 @@ public:
|
||||
|
||||
@since 3.1.2
|
||||
*/
|
||||
virtual void SetFractionalPointSize(float pointSize);
|
||||
virtual void SetFractionalPointSize(double pointSize);
|
||||
|
||||
/**
|
||||
Sets the pixel size.
|
||||
|
@@ -64,6 +64,23 @@ public:
|
||||
*/
|
||||
bool GetEnableEffects() const;
|
||||
|
||||
/**
|
||||
Returns the state of the flags restricting the selection.
|
||||
|
||||
Note that currently these flags are only effectively used in wxMSW.
|
||||
|
||||
@returns
|
||||
- @c wxFONTRESTRICT_NONE If no restriction applies, or a combination of
|
||||
the following flags:
|
||||
- @c wxFONTRESTRICT_SCALABLE To show only scalable fonts - no raster fonts.
|
||||
- @c wxFONTRESTRICT_FIXEDPITCH To show only monospaced fonts.
|
||||
|
||||
The default value is @c wxFONTRESTRICT_NONE.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
int GetRestrictSelection() const;
|
||||
|
||||
/**
|
||||
Gets the font that will be initially used by the font dialog. This
|
||||
should have previously been set by the application.
|
||||
@@ -77,6 +94,24 @@ public:
|
||||
*/
|
||||
bool GetShowHelp() const;
|
||||
|
||||
/**
|
||||
Restricts the selection to a subset of the available fonts.
|
||||
|
||||
Note that currently these flags are only effectively used in wxMSW and
|
||||
are ignored in the other ports.
|
||||
|
||||
Possible values are:
|
||||
|
||||
- @c wxFONTRESTRICT_NONE No restriction, show all fonts in the dialog.
|
||||
- @c wxFONTRESTRICT_SCALABLE To show only scalable fonts - no raster fonts.
|
||||
- @c wxFONTRESTRICT_FIXEDPITCH To show only monospaced fonts.
|
||||
|
||||
The default value is @c wxFONTRESTRICT_NONE.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
void RestrictSelection(int flags);
|
||||
|
||||
/**
|
||||
Under Windows, determines whether symbol fonts can be selected. Has no
|
||||
effect on other platforms.
|
||||
|
@@ -26,7 +26,7 @@
|
||||
CreateToolBar() functions, manages these windows and adjusts the value returned
|
||||
by GetClientSize() to reflect the remaining size available to application windows.
|
||||
|
||||
@remarks An application should normally define an wxCloseEvent handler for the
|
||||
@remarks An application should normally define a wxCloseEvent handler for the
|
||||
frame to respond to system close events, for example so that related
|
||||
data and subwindows can be cleaned up.
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
frames having this style (the dialogs don't have a minimize or a
|
||||
maximize box by default)
|
||||
@style{wxFRAME_EX_METAL}
|
||||
On OS X, frames with this style will be shown with a metallic
|
||||
On macOS, frames with this style will be shown with a metallic
|
||||
look. This is an extra style.
|
||||
@endExtraStyleTable
|
||||
|
||||
|
@@ -14,10 +14,10 @@
|
||||
system changes.
|
||||
|
||||
@note Implementation limitations: this class is currently implemented for
|
||||
MSW, OS X and GTK ports but doesn't detect all changes correctly
|
||||
MSW, macOS and GTK ports but doesn't detect all changes correctly
|
||||
everywhere: under MSW accessing the file is not detected (only
|
||||
modifying it is) and under OS X neither accessing nor modifying is
|
||||
detected (only creating and deleting files is). Moreover, OS X
|
||||
modifying it is) and under macOS neither accessing nor modifying is
|
||||
detected (only creating and deleting files is). Moreover, macOS
|
||||
version doesn't currently collapse pairs of create/delete events in a
|
||||
rename event, unlike the other ones.
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
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
|
||||
you could use wxEvtHandler::Bind() with @c wxEVT_FSWATCHER to handle
|
||||
these events in any other object. See the fswatcher sample for an example
|
||||
of the latter approach.
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
Additionally a file mask can be specified to include only files
|
||||
matching that particular mask.
|
||||
|
||||
This method is implemented efficiently on MSW and OS X >= 10.7, but
|
||||
This method is implemented efficiently on MSW and macOS, but
|
||||
should be used with care on other platforms for directories with lots
|
||||
of children (e.g. the root directory) as it calls Add() for each
|
||||
subdirectory, potentially creating a lot of watches and taking a long
|
||||
@@ -250,7 +250,7 @@ enum wxFSWFlags
|
||||
Notice that under MSW this event is sometimes -- although not always --
|
||||
followed by a ::wxFSW_EVENT_MODIFY for the new file.
|
||||
|
||||
Under OS X this event is only detected when watching entire trees. When
|
||||
Under macOS this event is only detected when watching entire trees. When
|
||||
watching directories, separate ::wxFSW_EVENT_CREATE and
|
||||
::wxFSW_EVENT_DELETE events are detected instead.
|
||||
*/
|
||||
@@ -262,7 +262,7 @@ enum wxFSWFlags
|
||||
Depending on the program doing the file modification, multiple such
|
||||
events can be reported for a single logical file update.
|
||||
|
||||
Under OS X this event is only detected when watching entire trees.
|
||||
Under macOS this event is only detected when watching entire trees.
|
||||
*/
|
||||
wxFSW_EVENT_MODIFY = 0x08,
|
||||
|
||||
@@ -276,8 +276,8 @@ enum wxFSWFlags
|
||||
/**
|
||||
The item's metadata was changed, e.g.\ its permissions or timestamps.
|
||||
|
||||
This event is currently only detected under Linux and OS X.
|
||||
Under OS X this event is only detected when watching entire trees.
|
||||
This event is currently only detected under Linux and macOS.
|
||||
Under macOS this event is only detected when watching entire trees.
|
||||
|
||||
@since 2.9.5
|
||||
*/
|
||||
@@ -289,8 +289,8 @@ enum wxFSWFlags
|
||||
wxFSW_EVENT_UNMOUNT cannot be set; unmount events are produced automatically. This flag
|
||||
is therefore not included in wxFSW_EVENT_ALL.
|
||||
|
||||
This event is currently only detected under Linux and OS X.
|
||||
Under OS X this event is only detected when watching entire trees.
|
||||
This event is currently only detected under Linux and macOS.
|
||||
Under macOS this event is only detected when watching entire trees.
|
||||
|
||||
@since 2.9.5
|
||||
*/
|
||||
|
@@ -13,7 +13,7 @@
|
||||
#define wxGA_HORIZONTAL wxHORIZONTAL
|
||||
#define wxGA_VERTICAL wxVERTICAL
|
||||
|
||||
// Available since Windows 7 only. With this style, the value of guage will
|
||||
// Available since Windows 7 only. With this style, the value of gauge will
|
||||
// reflect on the taskbar button.
|
||||
#define wxGA_PROGRESS 0x0010
|
||||
// Win32 only, is default (and only) on some other platforms
|
||||
@@ -52,14 +52,12 @@
|
||||
Display the current value in percents in the gauge itself. This
|
||||
style is only supported in wxQt and ignored under the other
|
||||
platforms.
|
||||
@since 3.1.0
|
||||
|
||||
This flag is only available in wxWidgets 3.1.0 and later.
|
||||
@style{wxGA_PROGRESS}
|
||||
Reflect the value of gauge in the application taskbar button under
|
||||
Windows 7 and later and the dock icon under OS X, ignored under
|
||||
Windows 7 and later and the dock icon under macOS, ignored under
|
||||
the other platforms.
|
||||
@since 3.1.0
|
||||
|
||||
This flag is only available in wxWidgets 3.1.0 and later.
|
||||
@endStyleTable
|
||||
|
||||
@library{wxcore}
|
||||
|
@@ -1131,7 +1131,7 @@ const wxSize wxDefaultSize;
|
||||
@endcode
|
||||
to be able to use @c wxBITMAP_PNG(mybitmap) in the code.
|
||||
|
||||
Under OS X the file with the specified name and "png" extension must be
|
||||
Under macOS the file with the specified name and "png" extension must be
|
||||
present in the "Resources" subdirectory of the application bundle.
|
||||
|
||||
Under the other platforms, this is equivalent to wxBITMAP_PNG_FROM_DATA()
|
||||
@@ -1175,7 +1175,7 @@ const wxSize wxDefaultSize;
|
||||
|
||||
You can use wxBITMAP_PNG() to load the PNG bitmaps from resources on the
|
||||
platforms that support this and only fall back to loading them from data
|
||||
under the other ones (i.e. not Windows and not OS X).
|
||||
under the other ones (i.e. not Windows and not macOS).
|
||||
|
||||
@header{wx/gdicmn.h}
|
||||
|
||||
@@ -1344,4 +1344,3 @@ void wxDisplaySizeMM(int* width, int* height);
|
||||
*/
|
||||
wxSize wxGetDisplaySizeMM();
|
||||
//@}
|
||||
|
||||
|
@@ -22,7 +22,7 @@
|
||||
To instantiate an object from your wxGenericAboutDialog-based class, you
|
||||
can use either the default constructor followed by a call to Create(), or
|
||||
directly using the alternate constructor. In either case, you have to
|
||||
prepare a wxAboutDialogInfo containing standard informations to display in
|
||||
prepare a wxAboutDialogInfo containing standard information to display in
|
||||
an about-box.
|
||||
|
||||
Example of usage, MyAboutDlg being a class derived from wxGenericAboutDialog:
|
||||
@@ -34,7 +34,7 @@
|
||||
aboutInfo.SetName("MyApp");
|
||||
aboutInfo.SetVersion(MY_APP_VERSION_STRING);
|
||||
aboutInfo.SetDescription(_("My wxWidgets-based application!"));
|
||||
aboutInfo.SetCopyright("(C) 1992-2020");
|
||||
aboutInfo.SetCopyright("(C) 1992-2021");
|
||||
aboutInfo.SetWebSite("http://myapp.org");
|
||||
aboutInfo.AddDeveloper("My Self");
|
||||
|
||||
|
@@ -41,7 +41,7 @@ public :
|
||||
wxInt32 GetCrossProduct( const wxPoint2DInt &vec ) const;
|
||||
|
||||
// the reflection of this point
|
||||
wxPoint2DInt operator-();
|
||||
wxPoint2DInt operator-() const;
|
||||
|
||||
wxPoint2DInt& operator=(const wxPoint2DInt& pt);
|
||||
wxPoint2DInt& operator+=(const wxPoint2DInt& pt);
|
||||
@@ -100,7 +100,7 @@ public :
|
||||
wxDouble GetCrossProduct( const wxPoint2DDouble &vec ) const;
|
||||
|
||||
// the reflection of this point
|
||||
wxPoint2DDouble operator-();
|
||||
wxPoint2DDouble operator-() const;
|
||||
|
||||
wxPoint2DDouble& operator=(const wxPoint2DDouble& pt);
|
||||
wxPoint2DDouble& operator+=(const wxPoint2DDouble& pt);
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
|
||||
void ConstrainTo( const wxRect2DDouble &rect );
|
||||
|
||||
wxPoint2DDouble Interpolate( wxInt32 widthfactor , wxInt32 heightfactor );
|
||||
wxPoint2DDouble Interpolate( wxInt32 widthfactor, wxInt32 heightfactor ) const;
|
||||
|
||||
static void Intersect( const wxRect2DDouble &src1 , const wxRect2DDouble &src2 , wxRect2DDouble *dest );
|
||||
void Intersect( const wxRect2DDouble &otherRect );
|
||||
@@ -280,7 +280,7 @@ public:
|
||||
void Inset( wxInt32 left , wxInt32 top ,wxInt32 right , wxInt32 bottom );
|
||||
void Offset( const wxPoint2DInt &pt );
|
||||
void ConstrainTo( const wxRect2DInt &rect );
|
||||
wxPoint2DInt Interpolate( wxInt32 widthfactor , wxInt32 heightfactor );
|
||||
wxPoint2DInt Interpolate( wxInt32 widthfactor, wxInt32 heightfactor ) const;
|
||||
|
||||
static void Intersect( const wxRect2DInt &src1 , const wxRect2DInt &src2 , wxRect2DInt *dest );
|
||||
void Intersect( const wxRect2DInt &otherRect );
|
||||
|
@@ -144,7 +144,7 @@ class wxGLAttributes : public wxGLAttribsBase
|
||||
public:
|
||||
/**
|
||||
Use true colour instead of colour index rendering for each pixel.
|
||||
It makes no effect for OS X.
|
||||
It makes no effect for macOS.
|
||||
*/
|
||||
wxGLAttributes& RGBA();
|
||||
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
wxGLAttributes& BufferSize(int val);
|
||||
|
||||
/**
|
||||
Specifies the framebuffer level. It makes no effect for OS X.
|
||||
Specifies the framebuffer level. It makes no effect for macOS.
|
||||
|
||||
@param val
|
||||
0 for main buffer, >0 for overlay, <0 for underlay.
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
wxGLAttributes& Samplers(int val);
|
||||
|
||||
/**
|
||||
Used to request a frame buffer sRGB capable. It makes no effect for OS X.
|
||||
Used to request a frame buffer sRGB capable. It makes no effect for macOS.
|
||||
*/
|
||||
wxGLAttributes& FrameBuffersRGB();
|
||||
|
||||
@@ -315,7 +315,7 @@ public:
|
||||
@param val
|
||||
The major version number requested.
|
||||
|
||||
It has no effect under OS X where specifying CoreProfile() will
|
||||
It has no effect under macOS where specifying CoreProfile() will
|
||||
result in using OpenGL version at least 3.2.
|
||||
*/
|
||||
wxGLContextAttrs& MajorVersion(int val);
|
||||
@@ -326,7 +326,7 @@ public:
|
||||
@param val
|
||||
The minor version number requested, e.g. 2 if OpenGL 3.2 is requested.
|
||||
|
||||
It has no effect under OS X where specifying CoreProfile() will
|
||||
It has no effect under macOS where specifying CoreProfile() will
|
||||
result in using OpenGL version at least 3.2.
|
||||
*/
|
||||
wxGLContextAttrs& MinorVersion(int val);
|
||||
@@ -340,7 +340,7 @@ public:
|
||||
@param vminor
|
||||
The minor version number requested, e.g. 5 if OpenGL 4.5 is requested.
|
||||
|
||||
It has no effect under OS X where specifying CoreProfile() will
|
||||
It has no effect under macOS where specifying CoreProfile() will
|
||||
result in using OpenGL version at least 3.2.
|
||||
*/
|
||||
wxGLContextAttrs& OGLVersion(int vmayor, int vminor);
|
||||
@@ -358,7 +358,7 @@ public:
|
||||
later. They must not support functionality marked as deprecated or
|
||||
removed by the requested version of the OpenGL API.
|
||||
|
||||
It has no effect under OS X.
|
||||
It has no effect under macOS.
|
||||
*/
|
||||
wxGLContextAttrs& ForwardCompatible();
|
||||
|
||||
@@ -367,7 +367,7 @@ public:
|
||||
subsets of OpenGL, lacking some features of the full specification.
|
||||
Used mainly in embedded devices such as mobile phones.
|
||||
|
||||
It has no effect under OS X.
|
||||
It has no effect under macOS.
|
||||
*/
|
||||
wxGLContextAttrs& ES2();
|
||||
|
||||
@@ -376,7 +376,7 @@ public:
|
||||
some logs are enabled and also allows OGL to send debug messages through
|
||||
a callback function.
|
||||
|
||||
It has no effect under OS X.
|
||||
It has no effect under macOS.
|
||||
*/
|
||||
wxGLContextAttrs& DebugCtx();
|
||||
|
||||
@@ -384,14 +384,14 @@ public:
|
||||
Request robustness, or how OpenGL handles out-of-bounds buffer object
|
||||
accesses and graphics reset notification behaviours.
|
||||
|
||||
It has no effect under OS X.
|
||||
It has no effect under macOS.
|
||||
*/
|
||||
wxGLContextAttrs& Robust();
|
||||
|
||||
/**
|
||||
With robustness enabled, never deliver notification of reset events.
|
||||
|
||||
It has no effect under OS X.
|
||||
It has no effect under macOS.
|
||||
*/
|
||||
wxGLContextAttrs& NoResetNotify();
|
||||
|
||||
@@ -399,7 +399,7 @@ public:
|
||||
With robustness enabled, if graphics reset happens, all context state is
|
||||
lost.
|
||||
|
||||
It has no effect under OS X.
|
||||
It has no effect under macOS.
|
||||
*/
|
||||
wxGLContextAttrs& LoseOnReset();
|
||||
|
||||
@@ -407,7 +407,7 @@ public:
|
||||
Request OpenGL to protect other applications or shared contexts from reset
|
||||
side-effects.
|
||||
|
||||
It has no effect under OS X.
|
||||
It has no effect under macOS.
|
||||
*/
|
||||
wxGLContextAttrs& ResetIsolation();
|
||||
|
||||
@@ -419,7 +419,7 @@ public:
|
||||
@param val
|
||||
0 for not flushing, 1 (wxWidgets default) for flushing pending commands.
|
||||
|
||||
It has no effect under OS X.
|
||||
It has no effect under macOS.
|
||||
*/
|
||||
wxGLContextAttrs& ReleaseFlush(int val = 1);
|
||||
|
||||
@@ -620,7 +620,7 @@ enum
|
||||
This attribute should be followed by the major version number
|
||||
requested.
|
||||
|
||||
It has no effect under OS X where specifying ::WX_GL_CORE_PROFILE will
|
||||
It has no effect under macOS where specifying ::WX_GL_CORE_PROFILE will
|
||||
result in using OpenGL version at least 3.2 but can still be used
|
||||
there for portability.
|
||||
|
||||
@@ -752,7 +752,7 @@ enum
|
||||
platforms where wxWindow uses logical pixels, affected by the coordinate
|
||||
scaling, on high DPI displays. Thus, if you want to set the OpenGL view
|
||||
port to the size of entire window, you must multiply the result returned by
|
||||
wxWindow::GetClientSize() by wxWindow::GetContentScaleFactor() before
|
||||
wxWindow::GetClientSize() by wxGLCanvas::GetContentScaleFactor() before
|
||||
passing it to @c glViewport(). Same considerations apply to other OpenGL
|
||||
functions and other coordinates, notably those retrieved from wxMouseEvent
|
||||
in the event handlers.
|
||||
@@ -769,14 +769,13 @@ enum
|
||||
parameter) but it's discouraged.
|
||||
|
||||
@note
|
||||
On those platforms which use a configure script (e.g. Linux and OS X)
|
||||
On those platforms which use a configure script (e.g. Linux and macOS)
|
||||
OpenGL support is automatically enabled if the relative headers and
|
||||
libraries are found.
|
||||
To switch it on under the other platforms (e.g. Windows), you need to edit
|
||||
the @c setup.h file and set @c wxUSE_GLCANVAS to @c 1 and then also pass
|
||||
@c USE_OPENGL=1 to the make utility. You may also need to add @c opengl32.lib
|
||||
(and @c glu32.lib for old OpenGL versions) to the list of the libraries
|
||||
your program is linked with.
|
||||
On Windows, OpenGL support is enabled by default (@c wxUSE_GLCANVAS set
|
||||
to @c 1 in the @c setup.h file). If your program links with wxWidgets
|
||||
statically, you need to add @c opengl32.lib (and @c glu32.lib for old
|
||||
OpenGL versions) to the list of the libraries your program is linked with.
|
||||
|
||||
@library{wxgl}
|
||||
@category{gl}
|
||||
|
@@ -804,8 +804,8 @@ public:
|
||||
@param y
|
||||
The y coordinate position to draw the text at.
|
||||
@param angle
|
||||
The angle relative to the (default) horizontal direction to draw
|
||||
the string.
|
||||
The angle, in radians, relative to the (default) horizontal
|
||||
direction to draw the string.
|
||||
*/
|
||||
void DrawText(const wxString& str, wxDouble x, wxDouble y, wxDouble angle);
|
||||
|
||||
@@ -833,8 +833,8 @@ public:
|
||||
@param y
|
||||
The y coordinate position to draw the text at.
|
||||
@param angle
|
||||
The angle relative to the (default) horizontal direction to draw
|
||||
the string.
|
||||
The angle, in radians, relative to the (default) horizontal
|
||||
direction to draw the string.
|
||||
@param backgroundBrush
|
||||
Brush to fill the text with.
|
||||
*/
|
||||
@@ -1154,7 +1154,7 @@ public:
|
||||
virtual void EnableOffset(bool enable = true);
|
||||
|
||||
void DisableOffset();
|
||||
bool OffsetEnabled();
|
||||
bool OffsetEnabled() const;
|
||||
|
||||
/** @}
|
||||
*/
|
||||
@@ -1327,7 +1327,7 @@ public:
|
||||
Creates wxGraphicsBitmap from a native bitmap handle.
|
||||
|
||||
@a bitmap meaning is platform-dependent. Currently it's a GDI+ @c
|
||||
Bitmap pointer under MSW, @c CGImage pointer under OS X or a @c
|
||||
Bitmap pointer under MSW, @c CGImage pointer under macOS or a @c
|
||||
cairo_surface_t pointer when using Cairo under any platform.
|
||||
|
||||
Notice that this method takes ownership of @a bitmap, i.e. it will be
|
||||
@@ -1478,7 +1478,7 @@ public:
|
||||
and end colours could be specified.
|
||||
|
||||
The ability to apply a transformation matrix to the gradient was added in 3.1.3
|
||||
|
||||
|
||||
*/
|
||||
virtual wxGraphicsBrush CreateLinearGradientBrush(wxDouble x1,
|
||||
wxDouble y1,
|
||||
@@ -1534,7 +1534,7 @@ public:
|
||||
|
||||
Currently this function returns "gdiplus" for Windows GDI+
|
||||
implementation, "direct2d" for Windows Direct2D implementation,
|
||||
"cairo" for Cairo implementation and "cg" for OS X CoreGraphics
|
||||
"cairo" for Cairo implementation and "cg" for macOS CoreGraphics
|
||||
implementation.
|
||||
|
||||
@remarks The string returned by this method is not user-readable and is
|
||||
@@ -1559,7 +1559,7 @@ public:
|
||||
virtual void GetVersion(int* major, int* minor = NULL, int* micro=NULL) const = 0;
|
||||
|
||||
/**
|
||||
Returns the default renderer on this platform. On OS X this is the Core
|
||||
Returns the default renderer on this platform. On macOS this is the Core
|
||||
Graphics (a.k.a. Quartz 2D) renderer, on MSW the GDIPlus renderer, and
|
||||
on GTK we currently default to the Cairo renderer.
|
||||
*/
|
||||
@@ -1660,25 +1660,25 @@ public:
|
||||
|
||||
wxGraphicsPenInfo& Cap(wxPenCap cap);
|
||||
|
||||
wxGraphicsPenInfo&
|
||||
wxGraphicsPenInfo&
|
||||
LinearGradient(wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
|
||||
const wxColour& c1, const wxColour& c2,
|
||||
const wxGraphicsMatrix& matrix = wxNullGraphicsMatrix);
|
||||
|
||||
wxGraphicsPenInfo&
|
||||
wxGraphicsPenInfo&
|
||||
LinearGradient(wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2,
|
||||
const wxGraphicsGradientStops& stops,
|
||||
const wxGraphicsMatrix& matrix = wxNullGraphicsMatrix);
|
||||
|
||||
wxGraphicsPenInfo&
|
||||
wxGraphicsPenInfo&
|
||||
RadialGradient(wxDouble startX, wxDouble startY,
|
||||
wxDouble endX, wxDouble endY, wxDouble radius,
|
||||
wxDouble endX, wxDouble endY, wxDouble radius,
|
||||
const wxColour& oColor, const wxColour& cColor,
|
||||
const wxGraphicsMatrix& matrix = wxNullGraphicsMatrix);
|
||||
|
||||
wxGraphicsPenInfo&
|
||||
wxGraphicsPenInfo&
|
||||
RadialGradient(wxDouble startX, wxDouble startY,
|
||||
wxDouble endX, wxDouble endY,
|
||||
wxDouble endX, wxDouble endY,
|
||||
wxDouble radius, const wxGraphicsGradientStops& stops,
|
||||
const wxGraphicsMatrix& matrix = wxNullGraphicsMatrix);
|
||||
|
||||
@@ -1690,7 +1690,7 @@ public:
|
||||
int GetDashes(wxDash **ptr);
|
||||
int GetDashCount() const;
|
||||
wxDash* GetDash() const;
|
||||
bool IsTransparent() const;
|
||||
bool IsTransparent() const;
|
||||
wxDouble GetWidth() const;
|
||||
wxGradientType GetGradientType() const;
|
||||
wxDouble GetX1() const;
|
||||
|
@@ -88,7 +88,44 @@ public:
|
||||
virtual int GetBestWidth(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
|
||||
int row, int col, int height);
|
||||
|
||||
/**
|
||||
Get the maximum possible size for a cell using this renderer, if
|
||||
possible.
|
||||
|
||||
This function may be overridden in the derived class if it can return
|
||||
the maximum size needed for displaying the cells rendered it without
|
||||
iterating over all cells. The base class version simply returns
|
||||
::wxDefaultSize, indicating that this is infeasible and that
|
||||
GetBestSize() should be called for each cell individually.
|
||||
|
||||
Note that this method will only be used if
|
||||
wxGridTableBase::CanMeasureColUsingSameAttr() is overridden to return
|
||||
@true.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
virtual wxSize GetMaxBestSize(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc);
|
||||
|
||||
protected:
|
||||
/**
|
||||
Helper function setting the correct colours and font.
|
||||
|
||||
This function can be useful in the derived classes Draw()
|
||||
implementation as it takes care of setting the appropriate colours and
|
||||
font for @a dc depending on the global @a grid attributes, cell
|
||||
attributions specified in @a attr and whether @a isSelected is @true.
|
||||
|
||||
Simply call it before doing any drawing in the derived class version to
|
||||
use consistent colours and font for all cells.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
void SetTextColoursAndFont(const wxGrid& grid,
|
||||
const wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
bool isSelected);
|
||||
/**
|
||||
The destructor is private because only DecRef() can delete us.
|
||||
*/
|
||||
@@ -228,16 +265,6 @@ public:
|
||||
*/
|
||||
wxGridCellDateTimeRenderer(const wxString& outformat = wxDefaultDateTimeFormat,
|
||||
const wxString& informat = wxDefaultDateTimeFormat);
|
||||
|
||||
|
||||
/**
|
||||
Sets the strptime()-like format string which will be used to parse
|
||||
the date/time.
|
||||
|
||||
@param params
|
||||
strptime()-like format string used to parse the date/time.
|
||||
*/
|
||||
virtual void SetParameters(const wxString& params);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -427,6 +454,97 @@ public:
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Represents a source of cell activation, which may be either a user event
|
||||
(mouse or keyboard) or the program itself.
|
||||
|
||||
An object of this class is passed to wxGridCellEditor::TryActivate() by the
|
||||
library and the code overriding this method may use its GetOrigin() method
|
||||
to determine how exactly the cell is being activated.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
class wxGridActivationSource
|
||||
{
|
||||
public:
|
||||
/// Result of GetOrigin().
|
||||
enum Origin
|
||||
{
|
||||
/// Activated due to an explicit wxGrid::EnableCellEditControl() call.
|
||||
Program,
|
||||
|
||||
/// Activated due to the user pressing a key, see GetKeyEvent().
|
||||
Key,
|
||||
|
||||
/// Activated due to the user clicking on a cell, see GetMouseEvent().
|
||||
Mouse
|
||||
};
|
||||
|
||||
/// Get the origin of the activation.
|
||||
Origin GetOrigin() const;
|
||||
|
||||
/**
|
||||
Get the key event corresponding to the key press activating the cell.
|
||||
|
||||
This method can be called for objects with Key origin only, use
|
||||
GetOrigin() to check for this first.
|
||||
*/
|
||||
const wxKeyEvent& GetKeyEvent() const;
|
||||
|
||||
/**
|
||||
Get the mouse event corresponding to the click activating the cell.
|
||||
|
||||
This method can be called for objects with Mouse origin only, use
|
||||
GetOrigin() to check for this first.
|
||||
*/
|
||||
const wxMouseEvent& GetMouseEvent() const;
|
||||
};
|
||||
|
||||
/**
|
||||
Represents the result of wxGridCellEditor::TryActivate().
|
||||
|
||||
Editors overriding wxGridCellEditor::TryActivate() must use one of
|
||||
DoNothing(), DoChange() or DoEdit() methods to return an object of this
|
||||
type corresponding to the desired action.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
class wxGridActivationResult
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Indicate that nothing should be done and the cell shouldn't be edited
|
||||
at all.
|
||||
|
||||
Note that this is different from DoEdit() and may be useful when the
|
||||
value of the cell wouldn't change if it were activated anyhow, e.g.
|
||||
because the key or mouse event carried by wxGridActivationSource would
|
||||
leave the cell value unchanged.
|
||||
*/
|
||||
static wxGridActivationResult DoNothing();
|
||||
|
||||
/**
|
||||
Indicate that activating the cell is possible and would change its
|
||||
value to the given one.
|
||||
|
||||
This is the method to call for activatable editors, using it will
|
||||
result in changing the value of the cell to @a newval without showing
|
||||
the editor control at all.
|
||||
|
||||
Note that the change may still be vetoed by wxEVT_GRID_CELL_CHANGING
|
||||
handler.
|
||||
*/
|
||||
static wxGridActivationResult DoChange(const wxString& newval);
|
||||
|
||||
/**
|
||||
Indicate that the editor control should be shown and the cell should be
|
||||
edited normally.
|
||||
|
||||
This is the default return value of wxGridCellEditor::TryActivate().
|
||||
*/
|
||||
static wxGridActivationResult DoEdit();
|
||||
};
|
||||
|
||||
/**
|
||||
@class wxGridCellEditor
|
||||
|
||||
@@ -436,6 +554,15 @@ public:
|
||||
the cell attributes for individual cells, rows, columns, or even for the
|
||||
entire grid.
|
||||
|
||||
Normally wxGridCellEditor shows some UI control allowing the user to edit
|
||||
the cell, but starting with wxWidgets 3.1.4 it's also possible to define
|
||||
"activatable" cell editors, that change the value of the cell directly when
|
||||
it's activated (typically by pressing Space key or clicking on it), see
|
||||
TryActivate() method. Note that when implementing an editor which is always
|
||||
activatable, i.e. never shows any in-place editor, it is more convenient to
|
||||
derive its class from wxGridCellActivatableEditor than from wxGridCellEditor
|
||||
itself.
|
||||
|
||||
@library{wxcore}
|
||||
@category{grid}
|
||||
|
||||
@@ -607,6 +734,41 @@ public:
|
||||
void SetControl(wxControl* control);
|
||||
|
||||
|
||||
/**
|
||||
Function allowing to create an "activatable" editor.
|
||||
|
||||
As explained in this class description, activatable editors don't show
|
||||
any edit control but change the cell value directly, when it is
|
||||
activated (by any way described by wxGridActivationSource).
|
||||
|
||||
To create such editor, this method must be overridden to return
|
||||
wxGridActivationResult::DoChange() passing it the new value of the
|
||||
cell. If the change is not vetoed by wxEVT_GRID_CELL_CHANGING handler,
|
||||
DoActivate() will be called to actually change the value, so it must be
|
||||
overridden as well if TryActivate() is overridden.
|
||||
|
||||
By default, wxGridActivationResult::DoEdit() is returned, meaning that
|
||||
this is a normal editor, using an edit control for changing the cell
|
||||
value.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
virtual wxGridActivationResult
|
||||
TryActivate(int row, int col, wxGrid* grid,
|
||||
const wxGridActivationSource& actSource);
|
||||
|
||||
/**
|
||||
Function which must be overridden for "activatable" editors.
|
||||
|
||||
If TryActivate() is overridden to return "change" action, this function
|
||||
will be called to actually apply this change. Note that it is not
|
||||
passed the value to apply, as it is assumed that the editor class
|
||||
stores this value as a member variable anyhow.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
virtual void DoActivate(int row, int col, wxGrid* grid);
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
@@ -615,6 +777,34 @@ protected:
|
||||
virtual ~wxGridCellEditor();
|
||||
};
|
||||
|
||||
/**
|
||||
Base class for activatable editors.
|
||||
|
||||
Inheriting from this class makes it simpler to implement editors that
|
||||
support only activation, but not in-place editing, as they only need to
|
||||
implement TryActivate(), DoActivate() and Clone() methods, but not all the
|
||||
other pure virtual methods of wxGridCellEditor.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
class wxGridCellActivatableEditor : public wxGridCellEditor
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Same method as in wxGridCellEditor, but pure virtual.
|
||||
|
||||
Note that the implementation of this method must never return
|
||||
wxGridActivationResult::DoEdit() for the editors inheriting from this
|
||||
class, as it doesn't support normal editing.
|
||||
*/
|
||||
virtual wxGridActivationResult
|
||||
TryActivate(int row, int col, wxGrid* grid,
|
||||
const wxGridActivationSource& actSource) = 0;
|
||||
|
||||
/// Same method as in wxGridCellEditor, but pure virtual.
|
||||
virtual void DoActivate(int row, int col, wxGrid* grid) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
Smart pointer wrapping wxGridCellEditor.
|
||||
|
||||
@@ -909,8 +1099,14 @@ class wxGridCellDateEditor : public wxGridCellEditor
|
||||
public:
|
||||
/**
|
||||
Date editor constructor.
|
||||
|
||||
@param format Optional format for the date displayed in the associated
|
||||
cell. By default, the locale-specific date format ("%x") is assumed.
|
||||
You would typically want to specify the same format as the one
|
||||
used with the cell renderer, if a non-default one is used.
|
||||
Note that this parameter is only available since wxWidgets 3.1.5.
|
||||
*/
|
||||
wxGridCellDateEditor();
|
||||
explicit wxGridCellDateEditor(const wxString& format = wxString());
|
||||
};
|
||||
|
||||
|
||||
@@ -1306,7 +1502,7 @@ public:
|
||||
Returns @true if the cell will draw an overflowed text into the
|
||||
neighbouring cells.
|
||||
|
||||
Note that only left aligned cells currenty can overflow. It means that
|
||||
Note that only left aligned cells currently can overflow. It means that
|
||||
GetFitMode().IsOverflow() should returns true and GetAlignment should
|
||||
returns wxALIGN_LEFT for hAlign parameter.
|
||||
|
||||
@@ -1678,7 +1874,7 @@ public:
|
||||
/**
|
||||
Gets an id
|
||||
*/
|
||||
int GetId();
|
||||
int GetId() const;
|
||||
|
||||
/**
|
||||
Set the position after which the insertion/deletion occur
|
||||
@@ -1688,7 +1884,7 @@ public:
|
||||
/**
|
||||
Get the position after which the insertion/deletion occur
|
||||
*/
|
||||
int GetCommandInt();
|
||||
int GetCommandInt() const;
|
||||
|
||||
/**
|
||||
Set the number of rows to be inserted/deleted
|
||||
@@ -1698,7 +1894,7 @@ public:
|
||||
/**
|
||||
Get the number of rows to be inserted/deleted
|
||||
*/
|
||||
int GetCommandInt2();
|
||||
int GetCommandInt2() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -1816,6 +2012,251 @@ public:
|
||||
bool operator!() const;
|
||||
};
|
||||
|
||||
/**
|
||||
Represents coordinates of a block of cells in the grid.
|
||||
|
||||
An object of this class contains coordinates of the left top and the bottom right
|
||||
corners of a block.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
class wxGridBlockCoords
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Default constructor initializes the object to invalid state.
|
||||
|
||||
Initially the coordinates are invalid (-1) and so operator!() for an
|
||||
uninitialized wxGridBlockCoords returns @true.
|
||||
*/
|
||||
wxGridBlockCoords();
|
||||
|
||||
/**
|
||||
Constructor taking a coordinates of the left top and the bottom right
|
||||
corners.
|
||||
*/
|
||||
wxGridBlockCoords(int topRow, int leftCol, int bottomRow, int rightCol);
|
||||
|
||||
/**
|
||||
Return the row of the left top corner.
|
||||
*/
|
||||
int GetTopRow() const;
|
||||
|
||||
/**
|
||||
Set the row of the left top corner.
|
||||
*/
|
||||
void SetTopRow(int row);
|
||||
|
||||
/**
|
||||
Return the column of the left top corner.
|
||||
*/
|
||||
int GetLeftCol() const;
|
||||
|
||||
/**
|
||||
Set the column of the left top corner.
|
||||
*/
|
||||
void SetLeftCol(int col);
|
||||
|
||||
/**
|
||||
Return the row of the bottom right corner.
|
||||
*/
|
||||
int GetBottomRow() const;
|
||||
|
||||
/**
|
||||
Set the row of the bottom right corner.
|
||||
*/
|
||||
void SetBottomRow(int row);
|
||||
|
||||
/**
|
||||
Return the column of the bottom right corner.
|
||||
*/
|
||||
int GetRightCol() const;
|
||||
|
||||
/**
|
||||
Set the column of the bottom right corner.
|
||||
*/
|
||||
void SetRightCol(int col);
|
||||
|
||||
/**
|
||||
Return the coordinates of the top left corner.
|
||||
*/
|
||||
wxGridCellCoords GetTopLeft() const
|
||||
{
|
||||
return wxGridCellCoords(m_topRow, m_leftCol);
|
||||
}
|
||||
|
||||
/**
|
||||
Return the coordinates of the bottom right corner.
|
||||
*/
|
||||
wxGridCellCoords GetBottomRight() const
|
||||
{
|
||||
return wxGridCellCoords(m_bottomRow, m_rightCol);
|
||||
}
|
||||
|
||||
/**
|
||||
Return the canonicalized block where top left coordinates is less
|
||||
then bottom right coordinates.
|
||||
*/
|
||||
wxGridBlockCoords Canonicalize() const;
|
||||
|
||||
/**
|
||||
Whether the blocks intersect.
|
||||
|
||||
@return
|
||||
@true, if the block intersects with the other, @false, otherwise.
|
||||
*/
|
||||
bool Intersects(const wxGridBlockCoords& other) const
|
||||
{
|
||||
return m_topRow <= other.m_bottomRow && m_bottomRow >= other.m_topRow &&
|
||||
m_leftCol <= other.m_rightCol && m_rightCol >= other.m_leftCol;
|
||||
}
|
||||
|
||||
/**
|
||||
Check whether this block contains the given cell.
|
||||
|
||||
@return
|
||||
@true, if the block contains the cell, @false otherwise.
|
||||
*/
|
||||
bool Contains(const wxGridCellCoords& cell) const;
|
||||
|
||||
/**
|
||||
Check whether this block contains another one.
|
||||
|
||||
@return
|
||||
@true if @a other is entirely contained within this block.
|
||||
*/
|
||||
bool Contains(const wxGridBlockCoords& other) const;
|
||||
|
||||
/**
|
||||
Calculates the result blocks by subtracting the other block from this
|
||||
block.
|
||||
|
||||
@param other
|
||||
The block to subtract from this block.
|
||||
@param splitOrientation
|
||||
The block splitting orientation (either @c wxHORIZONTAL or
|
||||
@c wxVERTICAL).
|
||||
@return
|
||||
Up to 4 blocks. If block doesn't exist in the result, it has value
|
||||
of @c wxGridNoBlockCoords.
|
||||
*/
|
||||
wxGridBlockDiffResult
|
||||
Difference(const wxGridBlockCoords& other, int splitOrientation) const;
|
||||
|
||||
/**
|
||||
Calculates the symmetric difference of the blocks.
|
||||
|
||||
@param other
|
||||
The block to subtract from this block.
|
||||
@return
|
||||
Up to 4 blocks. If block doesn't exist in the result, it has value
|
||||
of @c wxGridNoBlockCoords.
|
||||
*/
|
||||
wxGridBlockDiffResult
|
||||
SymDifference(const wxGridBlockCoords& other) const;
|
||||
|
||||
/**
|
||||
Equality operator.
|
||||
*/
|
||||
bool operator==(const wxGridBlockCoords& other) const;
|
||||
|
||||
/**
|
||||
Inequality operator.
|
||||
*/
|
||||
bool operator!=(const wxGridBlockCoords& other) const;
|
||||
|
||||
/**
|
||||
Checks whether the cells block is invalid.
|
||||
|
||||
Returns @true only if all components are -1. Notice that if one
|
||||
of the components (but not all) is -1, this method returns @false even
|
||||
if the object is invalid. This is done because objects in such state
|
||||
should actually never exist, i.e. either all components should be -1
|
||||
or none of them should be -1.
|
||||
*/
|
||||
bool operator!() const;
|
||||
|
||||
private:
|
||||
int m_topRow;
|
||||
int m_leftCol;
|
||||
int m_bottomRow;
|
||||
int m_rightCol;
|
||||
};
|
||||
|
||||
/**
|
||||
@class wxGridBlockDiffResult
|
||||
|
||||
The helper struct uses as a result type for difference functions of
|
||||
@c wxGridBlockCoords class.
|
||||
|
||||
Parts can be uninitialized (equals to @c wxGridNoBlockCoords), that means
|
||||
that the corresponding part doesn't exists in the result.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
struct wxGridBlockDiffResult
|
||||
{
|
||||
wxGridBlockCoords m_parts[4];
|
||||
};
|
||||
|
||||
/**
|
||||
Represents a collection of grid blocks that can be iterated over.
|
||||
|
||||
This class provides read-only access to the blocks making up the grid
|
||||
selection in the most general case.
|
||||
|
||||
Note that objects of this class can only be returned by wxGrid, but not
|
||||
constructed in the application code.
|
||||
|
||||
The preferable way to iterate over it is using C++11 range-for loop:
|
||||
@code
|
||||
for ( const auto& block: grid->GetSelectedBlocks() ) {
|
||||
... do something with block ...
|
||||
}
|
||||
@endcode
|
||||
When not using C++11, iteration has to be done manually:
|
||||
@code
|
||||
wxGridBlocks range = grid->GetSelectedBlocks();
|
||||
for ( wxGridBlocks::iterator it = range.begin();
|
||||
it != range.end();
|
||||
++it ) {
|
||||
... do something with *it ...
|
||||
}
|
||||
@endcode
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
class wxGridBlocks
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Read-only forward iterator type.
|
||||
|
||||
This is an opaque type, which satisfies the forward iterator
|
||||
requirements, i.e. provides all the expected operations, such as
|
||||
comparison, dereference and pre- and post-increment.
|
||||
*/
|
||||
class iterator
|
||||
{
|
||||
iterator();
|
||||
|
||||
const wxGridBlockCoords& operator*() const;
|
||||
const wxGridBlockCoords* operator->() const;
|
||||
|
||||
iterator& operator++();
|
||||
iterator operator++(int);
|
||||
|
||||
bool operator==(const iterator& it) const;
|
||||
bool operator!=(const iterator& it) const;
|
||||
};
|
||||
|
||||
/// Return iterator corresponding to the beginning of the range.
|
||||
iterator begin() const;
|
||||
|
||||
/// Return iterator corresponding to the end of the range.
|
||||
iterator end() const;
|
||||
};
|
||||
|
||||
/**
|
||||
@class wxGridTableBase
|
||||
|
||||
@@ -2087,9 +2528,6 @@ public:
|
||||
/**
|
||||
Delete rows from the table.
|
||||
|
||||
Notice that currently deleting a row intersecting a multi-cell (see
|
||||
SetCellSize()) is not supported and will result in a crash.
|
||||
|
||||
@param pos
|
||||
The first row to delete.
|
||||
@param numRows
|
||||
@@ -2272,6 +2710,25 @@ public:
|
||||
returns @true.
|
||||
*/
|
||||
virtual bool CanHaveAttributes();
|
||||
|
||||
/**
|
||||
Override to return true if the same attribute can be used for measuring
|
||||
all cells in the given column.
|
||||
|
||||
This function is provided for optimization purposes: it returns @false
|
||||
by default, but can be overridden to return @true when all the cells in
|
||||
the same grid column use sensibly the same attribute, i.e. they use the
|
||||
same renderer (either explicitly, or implicitly, due to their type as
|
||||
returned by GetTypeName()) and the font of the same size.
|
||||
|
||||
Returning @true from this function allows AutoSizeColumns() to skip
|
||||
looking up the attribute and the renderer for each individual cell,
|
||||
which results in very noticeable performance improvements for the grids
|
||||
with many rows.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
virtual bool CanMeasureColUsingSameAttr(int col) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -2498,7 +2955,16 @@ public:
|
||||
|
||||
@since 2.9.1
|
||||
*/
|
||||
wxGridSelectRowsOrColumns
|
||||
wxGridSelectRowsOrColumns,
|
||||
|
||||
/**
|
||||
The selection mode allowing no selections to be made at all.
|
||||
|
||||
The user won't be able to select any cells in this mode.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxGridSelectNone
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -3153,9 +3619,12 @@ public:
|
||||
allows the user to change the cell value.
|
||||
|
||||
Disabling in-place editing does nothing if the in-place editor isn't
|
||||
currently show, otherwise the @c wxEVT_GRID_EDITOR_HIDDEN event is
|
||||
currently shown, otherwise the @c wxEVT_GRID_EDITOR_HIDDEN event is
|
||||
generated but, unlike the "shown" event, it can't be vetoed and the
|
||||
in-place editor is dismissed unconditionally.
|
||||
|
||||
Note that it is an error to call this function if the current cell is
|
||||
read-only, use CanEnableCellControl() to check for this precondition.
|
||||
*/
|
||||
void EnableCellEditControl(bool enable = true);
|
||||
|
||||
@@ -3540,8 +4009,9 @@ public:
|
||||
Displays the active in-place cell edit control for the current cell
|
||||
after it was hidden.
|
||||
|
||||
Note that this method does @em not start editing the cell, this is only
|
||||
done by EnableCellEditControl().
|
||||
This method should only be called after calling HideCellEditControl(),
|
||||
to start editing the current grid cell use EnableCellEditControl()
|
||||
instead.
|
||||
*/
|
||||
void ShowCellEditControl();
|
||||
|
||||
@@ -3994,7 +4464,7 @@ public:
|
||||
may still be negative, see GetCellSize(int, int, int *, int *) for
|
||||
details.
|
||||
*/
|
||||
wxSize GetCellSize(const wxGridCellCoords& coords);
|
||||
wxSize GetCellSize(const wxGridCellCoords& coords) const;
|
||||
|
||||
//@}
|
||||
|
||||
@@ -4038,6 +4508,26 @@ public:
|
||||
*/
|
||||
bool CanDragColSize(int col) const;
|
||||
|
||||
/**
|
||||
Return @true if column edges inside the grid can be dragged to resize
|
||||
the rows.
|
||||
|
||||
@see CanDragGridSize(), CanDragColSize()
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
bool CanDragGridColEdges() const;
|
||||
|
||||
/**
|
||||
Return @true if row edges inside the grid can be dragged to resize the
|
||||
rows.
|
||||
|
||||
@see CanDragGridSize(), CanDragRowSize()
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
bool CanDragGridRowEdges() const;
|
||||
|
||||
/**
|
||||
Return @true if the dragging of grid lines to resize rows and columns
|
||||
is enabled or @false otherwise.
|
||||
@@ -4419,6 +4909,61 @@ public:
|
||||
*/
|
||||
void DeselectCell( int row, int col );
|
||||
|
||||
/**
|
||||
Returns a range of grid selection blocks.
|
||||
|
||||
The returned range can be iterated over, e.g. with C++11 range-for loop:
|
||||
@code
|
||||
for ( const auto block: grid->GetSelectedBlocks() ) {
|
||||
if ( block.Intersects(myBlock) )
|
||||
break;
|
||||
}
|
||||
@endcode
|
||||
|
||||
Notice that the blocks returned by this method are not ordered in any
|
||||
particular way and may overlap. For grids using rows or columns-only
|
||||
selection modes, GetSelectedRowBlocks() or GetSelectedColBlocks() can
|
||||
be more convenient, as they return ordered and non-overlapping blocks.
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
wxGridBlocks GetSelectedBlocks() const;
|
||||
|
||||
/**
|
||||
Returns an ordered range of non-overlapping selected rows.
|
||||
|
||||
For the grids using wxGridSelectRows selection mode, returns the
|
||||
possibly empty vector containing the coordinates of non-overlapping
|
||||
selected row blocks in the natural order, i.e. from smallest to the
|
||||
biggest row indices.
|
||||
|
||||
To see the difference between this method and GetSelectedBlocks(),
|
||||
consider the case when the user selects rows 2..4 in the grid and then
|
||||
also selects (using Ctrl/Shift keys) the rows 1..3. Iterating over the
|
||||
result of GetSelectedBlocks() would yield two blocks directly
|
||||
corresponding to the users selection, while this method returns a
|
||||
vector with a single element corresponding to the rows 1..4.
|
||||
|
||||
This method returns empty vector for the other selection modes.
|
||||
|
||||
@see GetSelectedBlocks(), GetSelectedColBlocks()
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
wxGridBlockCoordsVector GetSelectedRowBlocks() const;
|
||||
|
||||
/**
|
||||
Returns an ordered range of non-overlapping selected columns.
|
||||
|
||||
This method is symmetric to GetSelectedRowBlocks(), but is useful only
|
||||
in wxGridSelectColumns selection mode.
|
||||
|
||||
@see GetSelectedBlocks()
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
wxGridBlockCoordsVector GetSelectedColBlocks() const;
|
||||
|
||||
/**
|
||||
Returns an array of individually selected cells.
|
||||
|
||||
@@ -4434,6 +4979,9 @@ public:
|
||||
a grid with a million of columns, we don't want to create an array with
|
||||
a million of entries in this function, instead it returns an empty
|
||||
array and GetSelectedCols() returns an array containing one element).
|
||||
|
||||
The function can be slow for the big grids, use GetSelectedBlocks()
|
||||
in the new code.
|
||||
*/
|
||||
wxGridCellCoordsArray GetSelectedCells() const;
|
||||
|
||||
@@ -4445,6 +4993,9 @@ public:
|
||||
individually selected but not those being part of the block selection
|
||||
or being selected in virtue of all of their cells being selected
|
||||
individually, please see GetSelectedCells() for more details.
|
||||
|
||||
The function can be slow for the big grids, use GetSelectedBlocks()
|
||||
in the new code.
|
||||
*/
|
||||
wxArrayInt GetSelectedCols() const;
|
||||
|
||||
@@ -4456,6 +5007,9 @@ public:
|
||||
selected but not those being part of the block selection or being
|
||||
selected in virtue of all of their cells being selected individually,
|
||||
please see GetSelectedCells() for more details.
|
||||
|
||||
The function can be slow for the big grids, use GetSelectedBlocks()
|
||||
in the new code.
|
||||
*/
|
||||
wxArrayInt GetSelectedRows() const;
|
||||
|
||||
@@ -4471,6 +5025,9 @@ public:
|
||||
Please see GetSelectedCells() for more information about the selection
|
||||
representation in wxGrid.
|
||||
|
||||
The function can be slow for the big grids, use GetSelectedBlocks()
|
||||
in the new code.
|
||||
|
||||
@see GetSelectionBlockTopLeft()
|
||||
*/
|
||||
wxGridCellCoordsArray GetSelectionBlockBottomRight() const;
|
||||
@@ -4481,6 +5038,9 @@ public:
|
||||
Please see GetSelectedCells() for more information about the selection
|
||||
representation in wxGrid.
|
||||
|
||||
The function can be slow for the big grids, use GetSelectedBlocks()
|
||||
in the new code.
|
||||
|
||||
@see GetSelectionBlockBottomRight()
|
||||
*/
|
||||
wxGridCellCoordsArray GetSelectionBlockTopLeft() const;
|
||||
@@ -4641,6 +5201,17 @@ public:
|
||||
*/
|
||||
void MakeCellVisible(const wxGridCellCoords& coords);
|
||||
|
||||
/**
|
||||
Returns the topmost row of the current visible area.
|
||||
Returns -1 if the grid doesn't have any rows.
|
||||
*/
|
||||
int GetFirstFullyVisibleRow() const;
|
||||
/**
|
||||
Returns the leftmost column of the current visible area.
|
||||
Returns -1 if the grid doesn't have any columns.
|
||||
*/
|
||||
int GetFirstFullyVisibleColumn() const;
|
||||
|
||||
/**
|
||||
Sets the number of pixels per horizontal scroll increment.
|
||||
|
||||
@@ -5680,12 +6251,12 @@ public:
|
||||
column of the newly selected cell while the previously selected cell
|
||||
can be retrieved using wxGrid::GetGridCursorCol().
|
||||
*/
|
||||
virtual int GetCol();
|
||||
int GetCol() const;
|
||||
|
||||
/**
|
||||
Position in pixels at which the event occurred.
|
||||
*/
|
||||
wxPoint GetPosition();
|
||||
wxPoint GetPosition() const;
|
||||
|
||||
/**
|
||||
Row at which the event occurred.
|
||||
@@ -5694,7 +6265,7 @@ public:
|
||||
of the newly selected cell while the previously selected cell can be
|
||||
retrieved using wxGrid::GetGridCursorRow().
|
||||
*/
|
||||
virtual int GetRow();
|
||||
int GetRow() const;
|
||||
|
||||
/**
|
||||
Returns @true if the Meta key was down at the time of the event.
|
||||
@@ -5705,7 +6276,7 @@ public:
|
||||
Returns @true if the user is selecting grid cells, or @false if
|
||||
deselecting.
|
||||
*/
|
||||
bool Selecting();
|
||||
bool Selecting() const;
|
||||
|
||||
/**
|
||||
Returns @true if the Shift key was down at the time of the event.
|
||||
@@ -5770,12 +6341,12 @@ public:
|
||||
/**
|
||||
Position in pixels at which the event occurred.
|
||||
*/
|
||||
wxPoint GetPosition();
|
||||
wxPoint GetPosition() const;
|
||||
|
||||
/**
|
||||
Row or column at that was resized.
|
||||
*/
|
||||
int GetRowOrCol();
|
||||
int GetRowOrCol() const;
|
||||
|
||||
/**
|
||||
Returns @true if the Meta key was down at the time of the event.
|
||||
@@ -5793,13 +6364,41 @@ public:
|
||||
/**
|
||||
@class wxGridRangeSelectEvent
|
||||
|
||||
Events of this class notify about a range of cells being selected.
|
||||
|
||||
When the user uses the mouse for selection, one or more @c SELECTING events
|
||||
are generated first, with @c SELECTED event generated at the end, when
|
||||
selection is final. This allows the application to handle either the @c
|
||||
SELECTING events if it needs to update its state in real-time, as the
|
||||
selection changes, or just the final @c SELECTED event, if updating its
|
||||
state on every selection change would be too time-consuming.
|
||||
|
||||
Note that if the user performs the selection from keyboard, @c SELECTING
|
||||
events are not generated at all, so @c SELECTED event still must be
|
||||
handled.
|
||||
|
||||
Finally, contrary to most of the other events with the name ending in
|
||||
"ing", @c SELECTING event can @e not be vetoed.
|
||||
|
||||
@beginEventTable{wxGridRangeSelectEvent}
|
||||
@event{EVT_GRID_RANGE_SELECT(func)}
|
||||
@event{EVT_GRID_RANGE_SELECTING(func)}
|
||||
The user is selecting a group of contiguous cells. Processes a
|
||||
@c wxEVT_GRID_RANGE_SELECTING event type.
|
||||
This event is available in wxWidgets 3.1.5 and later only.
|
||||
@event{EVT_GRID_CMD_RANGE_SELECTING(id, func)}
|
||||
The user is selecting a group of contiguous cells; variant taking a window
|
||||
identifier. Processes a @c wxEVT_GRID_RANGE_SELECTING event type.
|
||||
This event is available in wxWidgets 3.1.5 and later only.
|
||||
@event{EVT_GRID_RANGE_SELECTED(func)}
|
||||
The user selected a group of contiguous cells. Processes a
|
||||
@c wxEVT_GRID_RANGE_SELECT event type.
|
||||
@event{EVT_GRID_CMD_RANGE_SELECT(id, func)}
|
||||
@c wxEVT_GRID_RANGE_SELECTED event type.
|
||||
This event is available in wxWidgets 3.1.5 and later only and was
|
||||
called @c wxEVT_GRID_RANGE_SELECT in the previous versions.
|
||||
@event{EVT_GRID_CMD_RANGE_SELECTED(id, func)}
|
||||
The user selected a group of contiguous cells; variant taking a window
|
||||
identifier. Processes a @c wxEVT_GRID_RANGE_SELECT event type.
|
||||
identifier. Processes a @c wxEVT_GRID_RANGE_SELECTED event type.
|
||||
This event is available in wxWidgets 3.1.5 and later only and was
|
||||
called @c wxEVT_GRID_CMD_RANGE_SELECT in the previous versions.
|
||||
@endEventTable
|
||||
|
||||
@library{wxcore}
|
||||
@@ -5834,32 +6433,32 @@ public:
|
||||
/**
|
||||
Top left corner of the rectangular area that was (de)selected.
|
||||
*/
|
||||
wxGridCellCoords GetBottomRightCoords();
|
||||
wxGridCellCoords GetBottomRightCoords() const;
|
||||
|
||||
/**
|
||||
Bottom row of the rectangular area that was (de)selected.
|
||||
*/
|
||||
int GetBottomRow();
|
||||
int GetBottomRow() const;
|
||||
|
||||
/**
|
||||
Left column of the rectangular area that was (de)selected.
|
||||
*/
|
||||
int GetLeftCol();
|
||||
int GetLeftCol() const;
|
||||
|
||||
/**
|
||||
Right column of the rectangular area that was (de)selected.
|
||||
*/
|
||||
int GetRightCol();
|
||||
int GetRightCol() const;
|
||||
|
||||
/**
|
||||
Top left corner of the rectangular area that was (de)selected.
|
||||
*/
|
||||
wxGridCellCoords GetTopLeftCoords();
|
||||
wxGridCellCoords GetTopLeftCoords() const;
|
||||
|
||||
/**
|
||||
Top row of the rectangular area that was (de)selected.
|
||||
*/
|
||||
int GetTopRow();
|
||||
int GetTopRow() const;
|
||||
|
||||
/**
|
||||
Returns @true if the Meta key was down at the time of the event.
|
||||
@@ -5869,7 +6468,7 @@ public:
|
||||
/**
|
||||
Returns @true if the area was selected, @false otherwise.
|
||||
*/
|
||||
bool Selecting();
|
||||
bool Selecting() const;
|
||||
|
||||
/**
|
||||
Returns @true if the Shift key was down at the time of the event.
|
||||
@@ -5910,7 +6509,7 @@ public:
|
||||
/**
|
||||
Returns the column at which the event occurred.
|
||||
*/
|
||||
int GetCol();
|
||||
int GetCol() const;
|
||||
|
||||
/**
|
||||
Returns the edit control.
|
||||
@@ -5927,14 +6526,14 @@ public:
|
||||
/**
|
||||
Returns the row at which the event occurred.
|
||||
*/
|
||||
int GetRow();
|
||||
int GetRow() const;
|
||||
|
||||
/**
|
||||
Returns the edit window.
|
||||
|
||||
@since 3.1.3
|
||||
*/
|
||||
wxWindow* GetWindow();
|
||||
wxWindow* GetWindow() const;
|
||||
|
||||
/**
|
||||
Sets the column at which the event occurred.
|
||||
@@ -5974,7 +6573,8 @@ wxEventType wxEVT_GRID_LABEL_RIGHT_DCLICK;
|
||||
wxEventType wxEVT_GRID_ROW_SIZE;
|
||||
wxEventType wxEVT_GRID_COL_SIZE;
|
||||
wxEventType wxEVT_GRID_COL_AUTO_SIZE;
|
||||
wxEventType wxEVT_GRID_RANGE_SELECT;
|
||||
wxEventType wxEVT_GRID_RANGE_SELECTING;
|
||||
wxEventType wxEVT_GRID_RANGE_SELECTED;
|
||||
wxEventType wxEVT_GRID_CELL_CHANGING;
|
||||
wxEventType wxEVT_GRID_CELL_CHANGED;
|
||||
wxEventType wxEVT_GRID_SELECT_CELL;
|
||||
@@ -5985,4 +6585,3 @@ wxEventType wxEVT_GRID_CELL_BEGIN_DRAG;
|
||||
wxEventType wxEVT_GRID_COL_MOVE;
|
||||
wxEventType wxEVT_GRID_COL_SORT;
|
||||
wxEventType wxEVT_GRID_TABBING;
|
||||
|
||||
|
@@ -18,8 +18,8 @@ enum
|
||||
/**
|
||||
Size the column automatically to fit all values.
|
||||
|
||||
@note On OS X, this style is only implemented in the Cocoa build on
|
||||
OS X >= 10.5; it behaves identically to wxCOL_WIDTH_DEFAULT otherwise.
|
||||
@note On macOS, this style is only implemented in the Cocoa build on
|
||||
macOS >= 10.5; it behaves identically to wxCOL_WIDTH_DEFAULT otherwise.
|
||||
*/
|
||||
wxCOL_WIDTH_AUTOSIZE = -2
|
||||
};
|
||||
|
@@ -77,7 +77,7 @@ public:
|
||||
For the values of @a helpStyle, please see the documentation for
|
||||
wxHtmlHelpController.
|
||||
*/
|
||||
wxHtmlHelpWindow(wxWindow* parent, int wxWindowID,
|
||||
wxHtmlHelpWindow(wxWindow* parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int style = wxTAB_TRAVERSAL|wxBORDER_NONE,
|
||||
|
@@ -504,7 +504,7 @@ protected:
|
||||
/**
|
||||
This method is called when a mouse button is clicked inside wxHtmlWindow.
|
||||
The default behaviour is to emit a wxHtmlCellEvent and, if the event was
|
||||
not processed or skipped, call OnLinkClicked() if the cell contains an
|
||||
not processed or skipped, call OnLinkClicked() if the cell contains a
|
||||
hypertext link.
|
||||
|
||||
Overloading this method is deprecated; intercept the event instead.
|
||||
|
@@ -1,152 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/html/webkit.h
|
||||
// Purpose: wxWebKitCtrl - embeddable web kit control
|
||||
// Author: Jethro Grassie / Kevin Ollivier
|
||||
// Modified by:
|
||||
// Created: 2004-4-16
|
||||
// Copyright: (c) Jethro Grassie / Kevin Ollivier
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_WEBKIT_H
|
||||
#define _WX_WEBKIT_H
|
||||
|
||||
/**
|
||||
@class wxWebKitCtrl
|
||||
|
||||
This control is a native wrapper around the Safari web browsing
|
||||
engine. This wrapper differs from the one in wxWebView in that this
|
||||
version supports functionality specific to WebKit, such as having
|
||||
RunScript return a value, which is a very critical feature in many web
|
||||
embedding scenarios.
|
||||
|
||||
This class is only available on OS X.
|
||||
**/
|
||||
|
||||
class wxWebKitCtrl : public wxControl
|
||||
{
|
||||
public:
|
||||
|
||||
wxWebKitCtrl();
|
||||
wxWebKitCtrl(wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& strURL,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxWebKitCtrlNameStr);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& strURL,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxWebKitCtrlNameStr);
|
||||
virtual ~wxWebKitCtrl();
|
||||
|
||||
void LoadURL(const wxString &url);
|
||||
|
||||
bool CanGoBack();
|
||||
bool CanGoForward();
|
||||
bool GoBack();
|
||||
bool GoForward();
|
||||
void Reload();
|
||||
void Stop();
|
||||
bool CanGetPageSource();
|
||||
wxString GetPageSource();
|
||||
void SetPageSource(const wxString& source, const wxString& baseUrl = wxEmptyString);
|
||||
wxString GetPageURL();
|
||||
void SetPageTitle(const wxString& title);
|
||||
wxString GetPageTitle();
|
||||
|
||||
// since these worked in 2.6, add wrappers
|
||||
void SetTitle(const wxString& title);
|
||||
wxString GetTitle();
|
||||
|
||||
wxString GetSelection();
|
||||
|
||||
bool CanIncreaseTextSize();
|
||||
void IncreaseTextSize();
|
||||
bool CanDecreaseTextSize();
|
||||
void DecreaseTextSize();
|
||||
|
||||
void Print(bool showPrompt = false);
|
||||
|
||||
void MakeEditable(bool enable = true);
|
||||
bool IsEditable();
|
||||
|
||||
wxString RunScript(const wxString& javascript);
|
||||
|
||||
void SetScrollPos(int pos);
|
||||
int GetScrollPos();
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Web Kit Events
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
enum {
|
||||
wxWEBKIT_STATE_START = 1,
|
||||
wxWEBKIT_STATE_NEGOTIATING = 2,
|
||||
wxWEBKIT_STATE_REDIRECTING = 4,
|
||||
wxWEBKIT_STATE_TRANSFERRING = 8,
|
||||
wxWEBKIT_STATE_STOP = 16,
|
||||
wxWEBKIT_STATE_FAILED = 32
|
||||
};
|
||||
|
||||
enum {
|
||||
wxWEBKIT_NAV_LINK_CLICKED = 1,
|
||||
wxWEBKIT_NAV_BACK_NEXT = 2,
|
||||
wxWEBKIT_NAV_FORM_SUBMITTED = 4,
|
||||
wxWEBKIT_NAV_RELOAD = 8,
|
||||
wxWEBKIT_NAV_FORM_RESUBMITTED = 16,
|
||||
wxWEBKIT_NAV_OTHER = 32
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
class wxWebKitBeforeLoadEvent : public wxCommandEvent
|
||||
{
|
||||
public:
|
||||
bool IsCancelled();
|
||||
void Cancel(bool cancel = true);
|
||||
wxString GetURL();
|
||||
void SetURL(const wxString& url);
|
||||
void SetNavigationType(int navType);
|
||||
int GetNavigationType();
|
||||
|
||||
wxWebKitBeforeLoadEvent( wxWindow* win = 0 );
|
||||
};
|
||||
|
||||
class wxWebKitStateChangedEvent : public wxCommandEvent
|
||||
{
|
||||
public:
|
||||
int GetState();
|
||||
void SetState(int state);
|
||||
wxString GetURL();
|
||||
void SetURL(const wxString& url);
|
||||
|
||||
wxWebKitStateChangedEvent( wxWindow* win = 0 );
|
||||
};
|
||||
|
||||
|
||||
class wxWebKitNewWindowEvent : public wxCommandEvent
|
||||
{
|
||||
public:
|
||||
wxString GetURL() const;
|
||||
void SetURL(const wxString& url);
|
||||
wxString GetTargetName() const;
|
||||
void SetTargetName(const wxString& name);
|
||||
|
||||
wxWebKitNewWindowEvent( wxWindow* win = 0 );
|
||||
};
|
||||
|
||||
wxEventType wxEVT_WEBKIT_STATE_CHANGED;
|
||||
wxEventType wxEVT_WEBKIT_BEFORE_LOAD;
|
||||
wxEventType wxEVT_WEBKIT_NEW_WINDOW;
|
||||
|
||||
|
||||
#endif
|
||||
// _WX_WEBKIT_H_
|
@@ -182,7 +182,7 @@ public:
|
||||
Attach a Windows icon handle.
|
||||
|
||||
This wxMSW-specific method allows assigning a native Windows @c HICON
|
||||
(which must be castes to @c WXHICON opaque handle type) to wxIcon.
|
||||
(which must be cast to @c WXHICON opaque handle type) to wxIcon.
|
||||
Notice that this means that the @c HICON will be destroyed by wxIcon
|
||||
when it is destroyed.
|
||||
|
||||
@@ -267,6 +267,9 @@ public:
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
|
||||
/**
|
||||
@deprecated This function is deprecated since version 3.1.2, dimensions
|
||||
and depth can only be set at construction time.
|
||||
|
||||
Sets the depth member (does not affect the icon data).
|
||||
|
||||
@param depth
|
||||
@@ -275,6 +278,9 @@ public:
|
||||
void SetDepth(int depth);
|
||||
|
||||
/**
|
||||
@deprecated This function is deprecated since version 3.1.2, dimensions
|
||||
and depth can only be set at construction time.
|
||||
|
||||
Sets the height member (does not affect the icon data).
|
||||
|
||||
@param height
|
||||
@@ -283,6 +289,9 @@ public:
|
||||
void SetHeight(int height);
|
||||
|
||||
/**
|
||||
@deprecated This function is deprecated since version 3.1.2, dimensions
|
||||
and depth can only be set at construction time.
|
||||
|
||||
Sets the width member (does not affect the icon data).
|
||||
|
||||
@param width
|
||||
|
@@ -60,6 +60,21 @@ enum wxImageResizeQuality
|
||||
wxIMAGE_QUALITY_HIGH
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Constants for wxImage::Paste() for specifying alpha blending option.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
enum wxImageAlphaBlendMode
|
||||
{
|
||||
/// Overwrite the original alpha values with the ones being pasted.
|
||||
wxIMAGE_ALPHA_BLEND_OVER = 0,
|
||||
|
||||
/// Compose the original alpha values with the ones being pasted.
|
||||
wxIMAGE_ALPHA_BLEND_COMPOSE = 1
|
||||
};
|
||||
|
||||
/**
|
||||
Possible values for PNG image type option.
|
||||
|
||||
@@ -596,8 +611,10 @@ public:
|
||||
@beginWxPerlOnly
|
||||
Not supported by wxPerl.
|
||||
@endWxPerlOnly
|
||||
|
||||
This constructor has become @c explicit in wxWidgets 3.1.6.
|
||||
*/
|
||||
wxImage(const char* const* xpmData);
|
||||
explicit wxImage(const char* const* xpmData);
|
||||
|
||||
/**
|
||||
Creates an image from a file.
|
||||
@@ -803,8 +820,17 @@ public:
|
||||
|
||||
/**
|
||||
Copy the data of the given @a image to the specified position in this image.
|
||||
|
||||
Takes care of the mask colour and out of bounds problems.
|
||||
|
||||
@param alphaBlend
|
||||
This parameter (new in wx 3.1.5) determines whether the alpha values
|
||||
of the original image replace (default) or are composed with the
|
||||
alpha channel of this image. Notice that alpha blending overrides
|
||||
the mask handling.
|
||||
*/
|
||||
void Paste(const wxImage& image, int x, int y);
|
||||
void Paste(const wxImage& image, int x, int y,
|
||||
wxImageAlphaBlendMode alphaBlend = wxIMAGE_ALPHA_BLEND_OVER);
|
||||
|
||||
/**
|
||||
Replaces the colour specified by @e r1,g1,b1 by the colour @e r2,g2,b2.
|
||||
@@ -871,12 +897,43 @@ public:
|
||||
wxImage Rotate180() const;
|
||||
|
||||
/**
|
||||
Rotates the hue of each pixel in the image by @e angle, which is a double in
|
||||
the range of -1.0 to +1.0, where -1.0 corresponds to -360 degrees and +1.0
|
||||
Rotates the hue of each pixel in the image by @e angle, which is a double
|
||||
in the range [-1.0..+1.0], where -1.0 corresponds to -360 degrees and +1.0
|
||||
corresponds to +360 degrees.
|
||||
*/
|
||||
void RotateHue(double angle);
|
||||
|
||||
/**
|
||||
Changes the saturation of each pixel in the image. factor is a double in
|
||||
the range [-1.0..+1.0], where -1.0 corresponds to -100 percent and +1.0
|
||||
corresponds to +100 percent.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
void ChangeSaturation(double factor);
|
||||
|
||||
/**
|
||||
Changes the brightness (value) of each pixel in the image. factor is a
|
||||
double in the range [-1.0..+1.0], where -1.0 corresponds to -100 percent
|
||||
and +1.0 corresponds to +100 percent.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
void ChangeBrightness(double factor);
|
||||
|
||||
/**
|
||||
Changes the hue, the saturation and the brightness (value) of each pixel
|
||||
in the image. angleH is a double in the range [-1.0..+1.0], where -1.0
|
||||
corresponds to -360 degrees and +1.0 corresponds to +360 degrees, factorS
|
||||
is a double in the range [-1.0..+1.0], where -1.0 corresponds to -100 percent
|
||||
and +1.0 corresponds to +100 percent and factorV is a double in the range
|
||||
[-1.0..+1.0], where -1.0 corresponds to -100 percent and +1.0 corresponds
|
||||
to +100 percent.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
void ChangeHSV(double angleH, double factorS, double factorV);
|
||||
|
||||
/**
|
||||
Returns a scaled version of the image.
|
||||
|
||||
@@ -915,6 +972,11 @@ public:
|
||||
}
|
||||
@endcode
|
||||
|
||||
@note The algorithm used for the default (normal) quality value doesn't
|
||||
work with images larger than 65536 (2^16) pixels in either dimension
|
||||
for 32-bit programs. For 64-bit programs the limit is 2^48 and so not
|
||||
relevant in practice.
|
||||
|
||||
@see Rescale()
|
||||
*/
|
||||
wxImage Scale(int width, int height,
|
||||
@@ -994,6 +1056,9 @@ public:
|
||||
calculate the greyscale. Defaults to using the standard ITU-T BT.601
|
||||
when converting to YUV, where every pixel equals
|
||||
(R * @a weight_r) + (G * @a weight_g) + (B * @a weight_b).
|
||||
|
||||
@remarks
|
||||
This function calls wxColour::MakeGrey() for each pixel in the image.
|
||||
*/
|
||||
wxImage ConvertToGreyscale(double weight_r, double weight_g, double weight_b) const;
|
||||
|
||||
@@ -1008,15 +1073,35 @@ public:
|
||||
|
||||
The returned image has white colour where the original has @e (r,g,b)
|
||||
colour and black colour everywhere else.
|
||||
|
||||
@remarks
|
||||
This function calls wxColour::MakeMono() for each pixel in the image.
|
||||
*/
|
||||
wxImage ConvertToMono(unsigned char r, unsigned char g, unsigned char b) const;
|
||||
|
||||
/**
|
||||
Returns disabled (dimmed) version of the image.
|
||||
|
||||
@remarks
|
||||
This function calls wxColour::MakeDisabled() for each pixel in the image.
|
||||
|
||||
@since 2.9.0
|
||||
*/
|
||||
wxImage ConvertToDisabled(unsigned char brightness = 255) const;
|
||||
|
||||
/**
|
||||
Returns a changed version of the image based on the given lightness.
|
||||
This utility function simply darkens or lightens a color, based on the
|
||||
specified percentage @a ialpha. @a ialpha of 0 would make the color
|
||||
completely black, 200 completely white and 100 would not change the color.
|
||||
|
||||
@remarks
|
||||
This function calls wxColour::ChangeLightness() for each pixel in the image.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
wxImage ChangeLightness(int alpha) const;
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
@@ -1247,12 +1332,12 @@ public:
|
||||
(http://www.libpng.org/pub/png/libpng-1.2.5-manual.html) for possible values
|
||||
(e.g. PNG_FILTER_NONE, PNG_FILTER_SUB, PNG_FILTER_UP, etc).
|
||||
@li @c wxIMAGE_OPTION_PNG_COMPRESSION_LEVEL: Compression level (0..9) for
|
||||
saving a PNG file. An high value creates smaller-but-slower PNG file.
|
||||
saving a PNG file. A high value creates smaller-but-slower PNG file.
|
||||
Note that unlike other formats (e.g. JPEG) the PNG format is always
|
||||
lossless and thus this compression level doesn't tradeoff the image
|
||||
quality.
|
||||
@li @c wxIMAGE_OPTION_PNG_COMPRESSION_MEM_LEVEL: Compression memory usage
|
||||
level (1..9) for saving a PNG file. An high value means the saving
|
||||
level (1..9) for saving a PNG file. A high value means the saving
|
||||
process consumes more memory, but may create smaller PNG file.
|
||||
@li @c wxIMAGE_OPTION_PNG_COMPRESSION_STRATEGY: Possible values are 0 for
|
||||
default strategy, 1 for filter, and 2 for Huffman-only.
|
||||
|
@@ -124,11 +124,29 @@ public:
|
||||
int Add(const wxIcon& icon);
|
||||
|
||||
/**
|
||||
Initializes the list. See wxImageList() for details.
|
||||
Initializes the list.
|
||||
|
||||
See wxImageList() for details.
|
||||
|
||||
This function can be called only once after creating the object using
|
||||
its default ctor or after calling Destroy().
|
||||
*/
|
||||
bool Create(int width, int height, bool mask = true,
|
||||
int initialCount = 1);
|
||||
|
||||
/**
|
||||
Destroys the current list.
|
||||
|
||||
This function resets the object to its initial state and does more than
|
||||
just RemoveAll() in the native wxMSW version.
|
||||
|
||||
After calling it, Create() may be called again to recreate the image
|
||||
list, e.g. using a different size.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
void Destroy();
|
||||
|
||||
/**
|
||||
Draws a specified image onto a device context.
|
||||
|
||||
@@ -205,7 +223,6 @@ public:
|
||||
|
||||
/**
|
||||
Replaces the existing image with the new image.
|
||||
Windows only.
|
||||
|
||||
@param index
|
||||
The index of the bitmap to be replaced.
|
||||
|
@@ -131,7 +131,7 @@ public:
|
||||
Notice that the generic wxInfoBar implementation handles the button
|
||||
events itself and so they are not propagated to the info bar parent and
|
||||
you need to either inherit from wxInfoBar and handle them in your
|
||||
derived class or use wxEvtHandler::Connect(), as is done in the dialogs
|
||||
derived class or use wxEvtHandler::Bind(), as is done in the dialogs
|
||||
sample, to handle the button events in the parent frame.
|
||||
|
||||
@param btnid
|
||||
|
@@ -69,7 +69,7 @@ struct wxLanguageInfo
|
||||
/**
|
||||
The category of locale settings.
|
||||
|
||||
@see wxLocale::GetInfo()
|
||||
@see wxLocale::GetInfo(), wxUILocale::GetInfo()
|
||||
*/
|
||||
enum wxLocaleCategory
|
||||
{
|
||||
@@ -108,6 +108,8 @@ enum wxLocaleCategory
|
||||
|
||||
All of these values are used with @c wxLOCALE_CAT_DATE in wxLocale::GetInfo() or,
|
||||
more typically, with @c wxLOCALE_CAT_DEFAULT as they only apply to a single category.
|
||||
|
||||
@see wxUILocale::GetInfo()
|
||||
*/
|
||||
enum wxLocaleInfo
|
||||
{
|
||||
@@ -116,6 +118,9 @@ enum wxLocaleInfo
|
||||
|
||||
This value can be used with either wxLOCALE_CAT_NUMBER or
|
||||
wxLOCALE_CAT_MONEY categories.
|
||||
|
||||
By default, i.e. when wxLOCALE_CAT_DEFAULT is used, the separator for
|
||||
numbers is returned.
|
||||
*/
|
||||
wxLOCALE_THOUSANDS_SEP,
|
||||
|
||||
@@ -124,6 +129,9 @@ enum wxLocaleInfo
|
||||
|
||||
This value can be used with either wxLOCALE_CAT_NUMBER or
|
||||
wxLOCALE_CAT_MONEY categories.
|
||||
|
||||
By default, i.e. when wxLOCALE_CAT_DEFAULT is used, the decimal point
|
||||
for numbers is returned.
|
||||
*/
|
||||
wxLOCALE_DECIMAL_POINT,
|
||||
|
||||
@@ -131,7 +139,7 @@ enum wxLocaleInfo
|
||||
Short date format.
|
||||
|
||||
Notice that short and long date formats may be the same under POSIX
|
||||
systems currently but may, and typically are, different under MSW or OS X.
|
||||
systems currently but may, and typically are, different under MSW or macOS.
|
||||
|
||||
@since 2.9.0
|
||||
*/
|
||||
@@ -166,6 +174,13 @@ enum wxLocaleInfo
|
||||
wxLocale class encapsulates all language-dependent settings and is a
|
||||
generalization of the C locale concept.
|
||||
|
||||
@note While this class can still be used in wxMSW and wxGTK ports, it
|
||||
doesn't work in wxOSX where it is impossible to change the application
|
||||
UI locale after launching it. Worse, since macOS 11 (Big Sur), using
|
||||
wxLocale can break application display due to bugs in C locale support
|
||||
in macOS itself. Because of this, it is recommended to use wxUILocale
|
||||
instead of this class for the applications targeting macOS.
|
||||
|
||||
In wxWidgets this class manages current locale. It also initializes and
|
||||
activates wxTranslations object that manages message catalogs.
|
||||
|
||||
@@ -435,6 +450,9 @@ public:
|
||||
/**
|
||||
Get the values of a locale datum in the OS locale.
|
||||
|
||||
This function shouldn't be used in the new code, use
|
||||
wxUILocale::GetInfo() instead.
|
||||
|
||||
This function is similar to GetInfo() and, in fact, identical to it
|
||||
under non-MSW systems. Under MSW it differs from it when no locale had
|
||||
been explicitly set: GetInfo() returns the values corresponding to the
|
||||
@@ -459,9 +477,11 @@ public:
|
||||
try to translate the messages using the message catalogs for this locale.
|
||||
|
||||
@param language
|
||||
::wxLanguage identifier of the locale.
|
||||
@c wxLANGUAGE_DEFAULT has special meaning -- wxLocale will use system's
|
||||
default language (see GetSystemLanguage()).
|
||||
::wxLanguage identifier of the locale. It can be either some
|
||||
concrete language, e.g. @c wxLANGUAGE_ESPERANTO, or a special value
|
||||
@c wxLANGUAGE_DEFAULT which means that wxLocale should use system's
|
||||
default language (see GetSystemLanguage()). Notice that the value
|
||||
@c wxLANGUAGE_UNKNOWN is not allowed here.
|
||||
@param flags
|
||||
Combination of the following:
|
||||
- wxLOCALE_LOAD_DEFAULT: Load the message catalog for the given locale
|
||||
|
@@ -30,6 +30,7 @@ public:
|
||||
|
||||
By default, no modifiers are active.
|
||||
*/
|
||||
explicit
|
||||
wxKeyboardState(bool controlDown = false,
|
||||
bool shiftDown = false,
|
||||
bool altDown = false,
|
||||
@@ -85,7 +86,7 @@ public:
|
||||
/**
|
||||
Returns true if Control or Alt are pressed.
|
||||
|
||||
Checks if Control, Alt or, under OS X only, Command key are pressed
|
||||
Checks if Control, Alt or, under macOS only, Command key are pressed
|
||||
(notice that the real Control key is still taken into account under OS
|
||||
X too).
|
||||
|
||||
@@ -97,7 +98,7 @@ public:
|
||||
bool HasModifiers() const;
|
||||
|
||||
/**
|
||||
Returns true if the Control key or Apple/Command key under OS X is pressed.
|
||||
Returns true if the Control key or Apple/Command key under macOS is pressed.
|
||||
|
||||
This function doesn't distinguish between right and left control keys.
|
||||
|
||||
@@ -106,7 +107,7 @@ public:
|
||||
bool ControlDown() const;
|
||||
|
||||
/**
|
||||
Returns true if the Control key (also under OS X).
|
||||
Returns true if the Control key (also under macOS).
|
||||
|
||||
This function doesn't distinguish between right and left control keys.
|
||||
|
||||
|
@@ -87,6 +87,7 @@ enum wxLanguage
|
||||
wxLANGUAGE_ENGLISH_CARIBBEAN,
|
||||
wxLANGUAGE_ENGLISH_DENMARK,
|
||||
wxLANGUAGE_ENGLISH_EIRE,
|
||||
wxLANGUAGE_ENGLISH_ISRAEL,
|
||||
wxLANGUAGE_ENGLISH_JAMAICA,
|
||||
wxLANGUAGE_ENGLISH_NEW_ZEALAND,
|
||||
wxLANGUAGE_ENGLISH_PHILIPPINES,
|
||||
|
@@ -84,14 +84,14 @@ public:
|
||||
wxEdge GetMyEdge() const;
|
||||
void SetEdge(wxEdge which);
|
||||
void SetValue(int v);
|
||||
int GetMargin();
|
||||
int GetMargin() const;
|
||||
void SetMargin(int m);
|
||||
int GetValue() const;
|
||||
int GetPercent() const;
|
||||
int GetOtherEdge() const;
|
||||
bool GetDone() const;
|
||||
void SetDone(bool d);
|
||||
wxRelationship GetRelationship();
|
||||
wxRelationship GetRelationship() const;
|
||||
void SetRelationship(wxRelationship r);
|
||||
|
||||
// Reset constraint if it mentions otherWin
|
||||
|
@@ -99,18 +99,18 @@ public:
|
||||
/**
|
||||
Default constructor.
|
||||
*/
|
||||
wxList<T>();
|
||||
wxList();
|
||||
|
||||
/**
|
||||
Constructor which initialized the list with an array of @a count elements.
|
||||
*/
|
||||
wxList<T>(size_t count, T* elements[]);
|
||||
wxList(size_t count, T* elements[]);
|
||||
|
||||
/**
|
||||
Destroys the list, but does not delete the objects stored in the list
|
||||
unless you called DeleteContents(@true ).
|
||||
*/
|
||||
~wxList<T>();
|
||||
~wxList();
|
||||
|
||||
/**
|
||||
Appends the pointer to @a object to the list.
|
||||
@@ -278,7 +278,7 @@ public:
|
||||
const_iterator end() const;
|
||||
|
||||
/**
|
||||
Returns a iterator pointing at the end of the list.
|
||||
Returns an iterator pointing at the end of the list.
|
||||
*/
|
||||
iterator end() const;
|
||||
|
||||
|
@@ -24,10 +24,7 @@
|
||||
performance nor from user interface point of view, for large number of
|
||||
items.
|
||||
|
||||
Notice that currently @c TAB characters in list box items text are not
|
||||
handled consistently under all platforms, so they should be replaced by
|
||||
spaces to display strings properly everywhere. The list box doesn't
|
||||
support any other control characters at all.
|
||||
Notice that the list box doesn't support control characters other than @c TAB.
|
||||
|
||||
@beginStyleTable
|
||||
@style{wxLB_SINGLE}
|
||||
@@ -177,6 +174,18 @@ public:
|
||||
|
||||
virtual void SetSelection(int n);
|
||||
|
||||
/**
|
||||
Returns the index of the selected item or @c wxNOT_FOUND if no item is
|
||||
selected.
|
||||
|
||||
@return The position of the current selection.
|
||||
|
||||
@remarks This method can be used with single selection list boxes only,
|
||||
you must use wxListBox::GetSelections() for the list
|
||||
boxes with wxLB_MULTIPLE style.
|
||||
|
||||
@see SetSelection(), GetStringSelection()
|
||||
*/
|
||||
virtual int GetSelection() const;
|
||||
|
||||
virtual bool SetStringSelection(const wxString& s, bool select);
|
||||
@@ -186,7 +195,7 @@ public:
|
||||
Fill an array of ints with the positions of the currently selected items.
|
||||
|
||||
@param selections
|
||||
A reference to an wxArrayInt instance that is used to store the result of
|
||||
A reference to a wxArrayInt instance that is used to store the result of
|
||||
the query.
|
||||
|
||||
@return The number of selections.
|
||||
@@ -321,6 +330,28 @@ public:
|
||||
*/
|
||||
int GetTopItem() const;
|
||||
|
||||
/**
|
||||
MSW-specific function for setting custom tab stop distances.
|
||||
|
||||
Tab stops are expressed in dialog unit widths, i.e. "quarters of the
|
||||
average character width for the font that is selected into the list
|
||||
box".
|
||||
|
||||
@param tabStops
|
||||
If this argument is empty, tab stops are reset to their default
|
||||
value (every 32 dialog units). If it contains a single element, tab
|
||||
stops are set at each multiple of the given value. Otherwise tab
|
||||
stops are set at every element of the array, which must be in
|
||||
ascending order.
|
||||
|
||||
@return @true if all specified tabs are set, @false otherwise
|
||||
|
||||
@onlyfor{wxmsw}
|
||||
|
||||
@since 3.1.4
|
||||
*/
|
||||
virtual bool MSWSetTabStops(const wxVector<int>& tabStops);
|
||||
|
||||
// NOTE: Phoenix needs to see the implementation of pure virtuals so it
|
||||
// knows that this class is not abstract.
|
||||
virtual unsigned int GetCount() const;
|
||||
@@ -328,4 +359,3 @@ public:
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
};
|
||||
|
||||
|
@@ -89,7 +89,7 @@ enum wxListColumnFormat
|
||||
wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
|
||||
};
|
||||
|
||||
/// Autosize values for SetColumnWidth
|
||||
/// Values for SetColumnWidth()
|
||||
enum
|
||||
{
|
||||
wxLIST_AUTOSIZE = -1,
|
||||
@@ -147,10 +147,43 @@ enum
|
||||
To intercept events from a list control, use the event table macros described
|
||||
in wxListEvent.
|
||||
|
||||
<b>wxMac Note</b>: Starting with wxWidgets 2.8, wxListCtrl uses a native
|
||||
implementation for report mode, and uses a generic implementation for other
|
||||
modes. You can use the generic implementation for report mode as well by setting
|
||||
the @c mac.listctrl.always_use_generic system option (see wxSystemOptions) to 1.
|
||||
@note The native wxOSX implementation for report mode that was added in wxWidgets
|
||||
2.8 was removed in wxWidgets 3.1, meaning for wxWidgets 3.1+ wxOSX uses the generic
|
||||
implementation for all modes.
|
||||
|
||||
@section column_order Column Ordering
|
||||
|
||||
By default, the columns of a list control appear on the screen in order
|
||||
of their indices, i.e. column 0 appears first, then column 1 next,
|
||||
and so on. However this can be changed by using the SetColumnsOrder() function
|
||||
to arbitrarily reorder the columns visual order.
|
||||
|
||||
The user can also rearrange the columns interactively by dragging them.
|
||||
In this case, the index of the column is not the same as its order and
|
||||
the functions GetColumnOrder() and GetColumnIndexFromOrder() should be
|
||||
used to translate between them.
|
||||
|
||||
@note All the other functions still work with the column indices,
|
||||
i.e. the visual positioning of the columns on screen doesn't affect the
|
||||
code setting or getting their values for example.
|
||||
|
||||
Example of reordering columns:
|
||||
@code
|
||||
wxListCtrl *list = new wxListCtrl(...);
|
||||
for ( int i = 0; i < 3; i++ )
|
||||
list->InsertColumn(i, wxString::Format("Column %d", i));
|
||||
|
||||
wxArrayInt order(3);
|
||||
order[0] = 2;
|
||||
order[1] = 0;
|
||||
order[2] = 1;
|
||||
list->SetColumnsOrder(order);
|
||||
|
||||
// now list->GetColumnsOrder() will return order and
|
||||
// list->GetColumnIndexFromOrder(n) will return order[n] and
|
||||
// list->GetColumnOrder() will return 1, 2 and 0 for the column 0,
|
||||
// 1 and 2 respectively
|
||||
@endcode
|
||||
|
||||
|
||||
@beginStyleTable
|
||||
@@ -538,8 +571,10 @@ public:
|
||||
corresponds to the value of the element number @a pos in the array
|
||||
returned by GetColumnsOrder().
|
||||
|
||||
Please see SetColumnsOrder() documentation for an example and
|
||||
additional remarks about the columns ordering.
|
||||
@note This function makes sense for report view only and currently is only
|
||||
implemented in the wxMSW port. Use @c wxHAS_LISTCTRL_COLUMN_ORDER to guard uses
|
||||
of this function so that they will start working under the other platforms when
|
||||
support for the column reordering is added there.
|
||||
|
||||
@see GetColumnOrder()
|
||||
*/
|
||||
@@ -552,8 +587,10 @@ public:
|
||||
given visual position, e.g. calling it with @a col equal to 0 returns
|
||||
the index of the first shown column.
|
||||
|
||||
Please see SetColumnsOrder() documentation for an example and
|
||||
additional remarks about the columns ordering.
|
||||
@note This function makes sense for report view only and currently is only
|
||||
implemented in the wxMSW port. Use @c wxHAS_LISTCTRL_COLUMN_ORDER to guard uses
|
||||
of this function so that they will start working under the other platforms when
|
||||
support for the column reordering is added there.
|
||||
|
||||
@see GetColumnsOrder(), GetColumnIndexFromOrder()
|
||||
*/
|
||||
@@ -569,8 +606,10 @@ public:
|
||||
|
||||
On error, an empty array is returned.
|
||||
|
||||
Please see SetColumnsOrder() documentation for an example and
|
||||
additional remarks about the columns ordering.
|
||||
@note This function makes sense for report view only and currently is only
|
||||
implemented in the wxMSW port. Use @c wxHAS_LISTCTRL_COLUMN_ORDER to guard uses
|
||||
of this function so that they will start working under the other platforms when
|
||||
support for the column reordering is added there.
|
||||
|
||||
@see GetColumnOrder(), GetColumnIndexFromOrder()
|
||||
*/
|
||||
@@ -588,7 +627,7 @@ public:
|
||||
Returns @NULL if no label is being edited.
|
||||
|
||||
@note It is currently only implemented for wxMSW and the generic version,
|
||||
not for the native OS X version.
|
||||
not for the native macOS version.
|
||||
*/
|
||||
wxTextCtrl* GetEditControl() const;
|
||||
|
||||
@@ -617,7 +656,7 @@ public:
|
||||
/**
|
||||
Returns the colour for this item.
|
||||
If the item has no specific colour, returns an invalid colour
|
||||
(and not the default background control of the control itself).
|
||||
(and not the default background colour of the control itself).
|
||||
|
||||
@see GetItemTextColour()
|
||||
*/
|
||||
@@ -690,7 +729,7 @@ public:
|
||||
Returns the colour for this item.
|
||||
|
||||
If the item has no specific colour, returns an invalid colour (and not the
|
||||
default foreground control of the control itself as this wouldn't allow
|
||||
default foreground colour of the control itself as this wouldn't allow
|
||||
distinguishing between items having the same colour as the current control
|
||||
foreground and items with default colour which, hence, have always the
|
||||
same colour as the control).
|
||||
@@ -906,7 +945,7 @@ public:
|
||||
long InsertItem(wxListItem& info);
|
||||
|
||||
/**
|
||||
Insert an string item.
|
||||
Insert a string item.
|
||||
|
||||
@param index
|
||||
Index of the new item, supplied by the application
|
||||
@@ -999,6 +1038,10 @@ public:
|
||||
|
||||
Note that the wxWindow::GetBackgroundColour() function of wxWindow base
|
||||
class can be used to retrieve the current background colour.
|
||||
|
||||
@note If alternate row colouring is enabled, then call
|
||||
EnableAlternateRowColours() again after changing the background colour. This
|
||||
will update the alternate row color to match the new background colour.
|
||||
*/
|
||||
virtual bool SetBackgroundColour(const wxColour& col);
|
||||
|
||||
@@ -1027,17 +1070,6 @@ public:
|
||||
/**
|
||||
Changes the order in which the columns are shown.
|
||||
|
||||
By default, the columns of a list control appear on the screen in order
|
||||
of their indices, i.e. the column 0 appears first, the column 1 next
|
||||
and so on. However by using this function it is possible to arbitrarily
|
||||
reorder the columns visual order and the user can also rearrange the
|
||||
columns interactively by dragging them. In this case, the index of the
|
||||
column is not the same as its order and the functions GetColumnOrder()
|
||||
and GetColumnIndexFromOrder() should be used to translate between them.
|
||||
Notice that all the other functions still work with the column indices,
|
||||
i.e. the visual positioning of the columns on screen doesn't affect the
|
||||
code setting or getting their values for example.
|
||||
|
||||
The @a orders array must have the same number elements as the number of
|
||||
columns and contain each position exactly once. Its n-th element
|
||||
contains the index of the column to be shown in n-th position, so for a
|
||||
@@ -1045,28 +1077,9 @@ public:
|
||||
results in the third column being displayed first, the first one next
|
||||
and the second one last.
|
||||
|
||||
Example of using it:
|
||||
@code
|
||||
wxListCtrl *list = new wxListCtrl(...);
|
||||
for ( int i = 0; i < 3; i++ )
|
||||
list->InsertColumn(i, wxString::Format("Column %d", i));
|
||||
|
||||
wxArrayInt order(3);
|
||||
order[0] = 2;
|
||||
order[1] = 0;
|
||||
order[2] = 1;
|
||||
list->SetColumnsOrder(order);
|
||||
|
||||
// now list->GetColumnsOrder() will return order and
|
||||
// list->GetColumnIndexFromOrder(n) will return order[n] and
|
||||
// list->GetColumnOrder() will return 1, 2 and 0 for the column 0,
|
||||
// 1 and 2 respectively
|
||||
@endcode
|
||||
|
||||
Please notice that this function makes sense for report view only and
|
||||
currently is only implemented in wxMSW port. To avoid explicit tests
|
||||
for @c __WXMSW__ in your code, please use @c wxHAS_LISTCTRL_COLUMN_ORDER
|
||||
as this will allow it to start working under the other platforms when
|
||||
@note This function makes sense for report view only and currently is only
|
||||
implemented in the wxMSW port. Use @c wxHAS_LISTCTRL_COLUMN_ORDER to guard uses
|
||||
of this function so that they will start working under the other platforms when
|
||||
support for the column reordering is added there.
|
||||
|
||||
@see GetColumnsOrder()
|
||||
@@ -1101,6 +1114,11 @@ public:
|
||||
This method does not take ownership of the image list, you have to
|
||||
delete it yourself.
|
||||
|
||||
Note that, unlike for most of the other methods of this class, it is
|
||||
possible to call this function before the corresponding window is
|
||||
created, i.e. do it in a constructor of a class derived from wxListCtrl
|
||||
before calling Create().
|
||||
|
||||
@see AssignImageList()
|
||||
*/
|
||||
void SetImageList(wxImageList* imageList, int which);
|
||||
@@ -1333,6 +1351,33 @@ public:
|
||||
*/
|
||||
void CheckItem(long item, bool check);
|
||||
|
||||
/**
|
||||
Extend rules and alternate rows background to the entire client area.
|
||||
|
||||
Bu default, the rules (when enabled with wxLC_HRULES and wxLC_VRULES)
|
||||
and alternate row background (when EnableAlternateRowColours() was
|
||||
called) are only shown in the part of the control occupied by the
|
||||
items, which can be smaller than the entire window if there are few
|
||||
items in the control.
|
||||
|
||||
Calling this function extends the display of the rules and alternate
|
||||
background rows to the entire client area.
|
||||
|
||||
Similarly to EnableAlternateRowColours(), this method can only be used
|
||||
with controls having ::wxLC_REPORT and ::wxLC_VIRTUAL styles.
|
||||
|
||||
Note that this method is currently not implemented in the native MSW
|
||||
version and does nothing there.
|
||||
|
||||
@param extend
|
||||
if @true, draws horizontal rules and vertical rules on empty rows
|
||||
and uses the colour parameter to paint the background of
|
||||
alternate rows when those rows are blank, empty, with no data.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
void ExtendRulesAndAlternateColour(bool extend = true);
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
@@ -1442,7 +1487,7 @@ protected:
|
||||
control itself when this event is generated, see @ref
|
||||
overview_events_with_mouse_capture "event handling overview".
|
||||
@event{EVT_LIST_ITEM_DESELECTED(id, func)}
|
||||
The item has been deselected.
|
||||
The item has been deselected. GetIndex() may be -1 with virtual lists.
|
||||
@event{EVT_LIST_ITEM_ACTIVATED(id, func)}
|
||||
The item has been activated (ENTER or double click).
|
||||
@event{EVT_LIST_ITEM_FOCUSED(id, func)}
|
||||
|
@@ -54,7 +54,18 @@ public:
|
||||
*/
|
||||
const char *func;
|
||||
|
||||
/// Time when the log message was generated.
|
||||
/**
|
||||
Time in milliseconds since Epoch when the log message was generated.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxLongLong_t timestampMS;
|
||||
|
||||
/**
|
||||
Time when the log message was generated.
|
||||
|
||||
@deprecated Please use timestampMS instead.
|
||||
*/
|
||||
time_t timestamp;
|
||||
|
||||
/**
|
||||
@@ -148,9 +159,30 @@ public:
|
||||
const wxLogRecordInfo& info) const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
This function formats the time stamp part of the log message including
|
||||
milliseconds.
|
||||
|
||||
Override this function if you need to customize just the time stamp
|
||||
formatting in the log messages.
|
||||
|
||||
@param msec
|
||||
Time to format as the number of milliseconds since
|
||||
1970-01-01T00:00:00.
|
||||
|
||||
@return
|
||||
The formatted time string, may be empty.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
virtual wxString FormatTimeMS(wxLongLong_t msec) const;
|
||||
|
||||
/**
|
||||
This function formats the time stamp part of the log message.
|
||||
|
||||
@deprecated This function only exists for compatibility, please
|
||||
override FormatTimeMS() in the new code.
|
||||
|
||||
Override this function if you need to customize just the time stamp.
|
||||
|
||||
@param time
|
||||
@@ -668,7 +700,7 @@ public:
|
||||
By default, the log messages are passed to the previously active log target.
|
||||
Calling this function with @false parameter disables this behaviour
|
||||
(presumably temporarily, as you shouldn't use wxLogChain at all otherwise) and
|
||||
it can be reenabled by calling it again with @a passMessages set to @true.
|
||||
it can be re-enabled by calling it again with @a passMessages set to @true.
|
||||
*/
|
||||
void PassMessages(bool passMessages);
|
||||
|
||||
@@ -1236,12 +1268,17 @@ public:
|
||||
message string.
|
||||
@param text
|
||||
The text to show to the user.
|
||||
@return
|
||||
@true If a message box was actually shown or @false if the message was
|
||||
logged to the console because there is no safe to show it currently
|
||||
(the return value is only available since wxWidgets 3.1.5, the function
|
||||
doesn't return anything in the previous versions).
|
||||
|
||||
@see wxLogFatalError()
|
||||
|
||||
@header{wx/log.h}
|
||||
*/
|
||||
void wxSafeShowMessage(const wxString& title, const wxString& text);
|
||||
bool wxSafeShowMessage(const wxString& title, const wxString& text);
|
||||
|
||||
/**
|
||||
Returns the error code from the last system call. This function uses
|
||||
|
@@ -89,9 +89,18 @@ double wxRadToDeg(double rad);
|
||||
unsigned int wxCTZ(wxUint32 x);
|
||||
|
||||
/**
|
||||
Small wrapper around round().
|
||||
Small wrapper around std::lround().
|
||||
|
||||
This function exists for compatibility, as it was more convenient than
|
||||
std::round() before C++11. Use std::lround() in the new code.
|
||||
|
||||
It is defined for all floating point types @c T and can be also used with
|
||||
integer types for compatibility, but such use is deprecated -- simply
|
||||
remove the calls to wxRound() from your code if you're using it with
|
||||
integer types, it is unnecessary in this case.
|
||||
*/
|
||||
int wxRound(double x);
|
||||
template <typename T>
|
||||
int wxRound(T x);
|
||||
|
||||
/**
|
||||
Returns true if both double values are identical. This is
|
||||
@@ -106,5 +115,15 @@ bool wxIsSameDouble(double x, double y);
|
||||
*/
|
||||
bool wxIsNullDouble(double x);
|
||||
|
||||
/**
|
||||
Computes the product of a number with a fraction with rounding.
|
||||
|
||||
This function returns @c n*numerator/denominator rounding the result. It is
|
||||
similar to the standard Win32 @c MulDiv() function and, in fact, is
|
||||
implemented by calling it under MSW, where @c wx/msw/wrapwin.h must be
|
||||
included in addition to @c wx/math.h for it to be used.
|
||||
*/
|
||||
int wxMulDivInt32(int n, int numerator, int denominator);
|
||||
|
||||
//@}
|
||||
|
||||
|
@@ -251,7 +251,7 @@ public:
|
||||
and this function can be used to retrieve it. Notice that the default
|
||||
menu can be replaced by calling SetWindowMenu().
|
||||
|
||||
This function is currently not available under OS X.
|
||||
This function is currently not available under macOS.
|
||||
|
||||
@return The current Window menu or @NULL.
|
||||
*/
|
||||
@@ -320,7 +320,7 @@ public:
|
||||
All of which are handled by wxMDIParentFrame itself. If any other
|
||||
commands are used in the menu, the derived frame should handle them.
|
||||
|
||||
This function is currently not available under OS X.
|
||||
This function is currently not available under macOS.
|
||||
|
||||
@param menu
|
||||
The menu to be used instead of the standard MDI Window menu or @NULL.
|
||||
|
@@ -86,8 +86,8 @@ public:
|
||||
/**
|
||||
@class wxMediaCtrl
|
||||
|
||||
wxMediaCtrl is a class for displaying types of media, such as videos, audio
|
||||
files, natively through native codecs.
|
||||
wxMediaCtrl is a class for displaying various types of media, such as videos,
|
||||
audio files, natively through native codecs.
|
||||
|
||||
wxMediaCtrl uses native backends to render media, for example on Windows
|
||||
there is a ActiveMovie/DirectShow backend, and on Macintosh there is a
|
||||
@@ -120,18 +120,15 @@ public:
|
||||
Example:
|
||||
|
||||
@code
|
||||
//connect to the media event
|
||||
this->Connect(wxMY_ID, wxEVT_MEDIA_STOP, (wxObjectEventFunction)
|
||||
(wxEventFunction)(wxMediaEventFunction) &MyFrame::OnMediaStop);
|
||||
// bind the media event
|
||||
Bind(wxMY_ID, wxEVT_MEDIA_STOP, &MyFrame::OnMediaStop, this);
|
||||
|
||||
//...
|
||||
void MyFrame::OnMediaStop(const wxMediaEvent& evt)
|
||||
void MyFrame::OnMediaStop(wxMediaEvent& evt)
|
||||
{
|
||||
if(bUserWantsToSeek)
|
||||
if( userWantsToSeek )
|
||||
{
|
||||
m_mediactrl->SetPosition(
|
||||
m_mediactrl->GetDuration() << 1
|
||||
);
|
||||
m_mediactrl->Seek(m_mediactrl->Length() - 1);
|
||||
evt.Veto();
|
||||
}
|
||||
}
|
||||
@@ -147,7 +144,7 @@ public:
|
||||
|
||||
Note that when changing the state of the media through Play() and other methods,
|
||||
the media may not actually be in the @c wxMEDIASTATE_PLAYING, for example.
|
||||
If you are relying on the media being in certain state catch the event relevant
|
||||
If you are relying on the media being in certain state, catch the event relevant
|
||||
to the state. See wxMediaEvent for the kinds of events that you can catch.
|
||||
|
||||
|
||||
@@ -200,18 +197,14 @@ public:
|
||||
Default backend on Windows and supported by nearly all Windows versions.
|
||||
May display a windows media player logo while inactive.
|
||||
- @b wxMEDIABACKEND_QUICKTIME: Use QuickTime. Mac Only.
|
||||
WARNING: May not working correctly embedded in a wxNotebook.
|
||||
WARNING: May not work correctly when embedded in a wxNotebook.
|
||||
- @b wxMEDIABACKEND_GSTREAMER, Use GStreamer. Unix Only.
|
||||
Requires GStreamer 0.10 along with at the very least the xvimagesink,
|
||||
xoverlay and gst-play modules of gstreamer to function.
|
||||
You need the correct modules to play the relevant files, for example the
|
||||
mad module to play mp3s, etc.
|
||||
- @b wxMEDIABACKEND_WMP10, Uses Windows Media Player 10 (Windows only) -
|
||||
works on mobile machines with Windows Media Player 10 and desktop machines
|
||||
with either Windows Media Player 9 or 10.
|
||||
|
||||
Note that other backends such as wxMEDIABACKEND_MCI can now be found at
|
||||
wxCode (http://wxcode.sourceforge.net/).
|
||||
- @b wxMEDIABACKEND_WMP10, Use Windows Media Player 10 (Windows only).
|
||||
Works on systems with either Windows Media Player 9 or 10 installed.
|
||||
|
||||
|
||||
@section mediactrl_creating_backend Creating a backend
|
||||
@@ -226,9 +219,9 @@ public:
|
||||
|
||||
The only real tricky part is that you need to make sure the file in compiled in,
|
||||
which if there are just backends in there will not happen and you may need to
|
||||
use a force link hack (see https://wiki.wxwidgets.org/RTTI).
|
||||
use a force link hack (see @c wxFORCE_LINK_MODULE usage in the mediactrl sample).
|
||||
|
||||
This is a rather simple example of how to create a backend in the
|
||||
There is a rather simple example of how to create a backend in the
|
||||
wxActiveXContainer documentation.
|
||||
|
||||
|
||||
@@ -278,8 +271,8 @@ public:
|
||||
|
||||
/**
|
||||
Creates this control.
|
||||
Returns @false if it can't load the movie located at @a fileName
|
||||
or it cannot load one of its native backends.
|
||||
Returns @false if it can't load the media located at @a fileName
|
||||
or it can't create a backend.
|
||||
|
||||
If you specify a file to open via @a fileName and you don't specify a
|
||||
backend to use, wxMediaCtrl tries each of its backends until one that
|
||||
@@ -330,9 +323,9 @@ public:
|
||||
Obtains the state the playback of the media is in.
|
||||
|
||||
@beginTable
|
||||
@row2col{wxMEDIASTATE_STOPPED, The movie has stopped.}
|
||||
@row2col{wxMEDIASTATE_PAUSED, The movie is paused.}
|
||||
@row2col{wxMEDIASTATE_PLAYING, The movie is currently playing.}
|
||||
@row2col{wxMEDIASTATE_STOPPED, The media has stopped.}
|
||||
@row2col{wxMEDIASTATE_PAUSED, The media is paused.}
|
||||
@row2col{wxMEDIASTATE_PLAYING, The media is currently playing.}
|
||||
@endTable
|
||||
*/
|
||||
wxMediaState GetState();
|
||||
@@ -346,7 +339,7 @@ public:
|
||||
double GetVolume();
|
||||
|
||||
/**
|
||||
Obtains the length - the total amount of time the movie has in milliseconds.
|
||||
Obtains the length - the total amount of time the media has in milliseconds.
|
||||
*/
|
||||
wxFileOffset Length();
|
||||
|
||||
@@ -381,17 +374,17 @@ public:
|
||||
bool LoadURIWithProxy(const wxString& uri, const wxString& proxy);
|
||||
|
||||
/**
|
||||
Pauses playback of the movie.
|
||||
Pauses playback of the media.
|
||||
*/
|
||||
bool Pause();
|
||||
|
||||
/**
|
||||
Resumes playback of the movie.
|
||||
Resumes playback of the media.
|
||||
*/
|
||||
bool Play();
|
||||
|
||||
/**
|
||||
Seeks to a position within the movie.
|
||||
Seeks to a position within the media.
|
||||
|
||||
@todo Document the wxSeekMode parameter @a mode, and perhaps also the
|
||||
wxFileOffset and wxSeekMode themselves.
|
||||
@@ -421,7 +414,7 @@ public:
|
||||
A special feature to wxMediaCtrl. Applications using native toolkits such as
|
||||
QuickTime usually have a scrollbar, play button, and more provided to
|
||||
them by the toolkit. By default wxMediaCtrl does not do this. However, on
|
||||
the directshow and quicktime backends you can show or hide the native controls
|
||||
the DirectShow and QuickTime backends you can show or hide the native controls
|
||||
provided by the underlying toolkit at will using ShowPlayerControls(). Simply
|
||||
calling the function with default parameters tells wxMediaCtrl to use the
|
||||
default controls provided by the toolkit. The function takes a
|
||||
@@ -442,7 +435,7 @@ public:
|
||||
bool Stop();
|
||||
|
||||
/**
|
||||
Obtains the current position in time within the movie in milliseconds.
|
||||
Obtains the current position in time within the media in milliseconds.
|
||||
*/
|
||||
wxFileOffset Tell();
|
||||
};
|
||||
|
@@ -445,8 +445,8 @@ public:
|
||||
@note
|
||||
Please note that @e wxID_ABOUT and @e wxID_EXIT are predefined by wxWidgets
|
||||
and have a special meaning since entries using these IDs will be taken out
|
||||
of the normal menus under OS X and will be inserted into the system menu
|
||||
(following the appropriate OS X interface guideline).
|
||||
of the normal menus under macOS and will be inserted into the system menu
|
||||
(following the appropriate macOS interface guideline).
|
||||
|
||||
Menu items may be either @e normal items, @e check items or @e radio items.
|
||||
Normal items don't have any special properties while the check items have a
|
||||
@@ -665,6 +665,9 @@ public:
|
||||
/**
|
||||
Inserts a break in a menu, causing the next appended item to appear in
|
||||
a new column.
|
||||
|
||||
This function only actually inserts a break in wxMSW and does nothing
|
||||
under the other platforms.
|
||||
*/
|
||||
virtual void Break();
|
||||
|
||||
@@ -928,6 +931,33 @@ public:
|
||||
*/
|
||||
bool IsEnabled(int id) const;
|
||||
|
||||
/**
|
||||
Allows handling native MSW menu command messages.
|
||||
|
||||
This is a low-level function which allows handling MSW @c WM_COMMAND
|
||||
messages generated when menu items are selected. It is particularly
|
||||
useful for the popup menus, as specific handling can then be defined in
|
||||
a wxMenu-derived class directly, instead of in the wxWindow-derived
|
||||
owner class.
|
||||
|
||||
The base class version of this function generates @c wxEVT_MENU command
|
||||
events.
|
||||
|
||||
@param param
|
||||
The MSW command parameter.
|
||||
|
||||
@param id
|
||||
The id of the command.
|
||||
|
||||
@return
|
||||
@true if the command was handled, @false otherwise.
|
||||
|
||||
@onlyfor{wxmsw}
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
|
||||
/**
|
||||
Inserts the given @a item at position 0, i.e.\ before all the other
|
||||
existing items.
|
||||
|
@@ -418,7 +418,7 @@ public:
|
||||
"ALT" and @c "SHIFT" strings (case doesn't matter) separated by either
|
||||
@c '-' or @c '+' characters and followed by the accelerator itself.
|
||||
Notice that @c CTRL corresponds to the "Ctrl" key on most platforms but
|
||||
not under OS X where it is mapped to "Cmd" key on Mac keyboard.
|
||||
not under macOS where it is mapped to "Cmd" key on Mac keyboard.
|
||||
Usually this is exactly what you want in portable code but if you
|
||||
really need to use the (rarely used for this purpose) "Ctrl" key even
|
||||
under Mac, you may use @c RAWCTRL to prevent this mapping. Under the
|
||||
|
@@ -106,7 +106,7 @@ public:
|
||||
used for anything, but the wxMetafile object must still be destroyed by
|
||||
the application.
|
||||
|
||||
Below is a example of metafile, metafile device context and clipboard use
|
||||
Below is an example of metafile, metafile device context and clipboard use
|
||||
from the @c hello.cpp example. Note the way the metafile dimensions
|
||||
are passed to the clipboard, making use of the device context's ability
|
||||
to keep track of the maximum extent of drawing commands.
|
||||
|
@@ -56,7 +56,7 @@ const char wxMessageBoxCaptionStr[] = "Message";
|
||||
Displays a warning icon in the dialog. This style should be used for
|
||||
informative warnings or, in combination with @c wxYES_NO or @c wxCANCEL,
|
||||
for questions that have potentially serious consequences (caution
|
||||
icon is used on OS X in this case).
|
||||
icon is used on macOS in this case).
|
||||
@style{wxICON_QUESTION}
|
||||
Displays a question mark symbol. This icon is automatically used
|
||||
with @c wxYES_NO so it's usually unnecessary to specify it explicitly.
|
||||
|
@@ -350,6 +350,14 @@ public:
|
||||
*/
|
||||
bool QueryValue(const wxString& szValue, long* plValue) const;
|
||||
|
||||
/**
|
||||
Retrieves the 64-bit value. Returns @true if successful.
|
||||
An empty @a szValue queries the default/unnamed key value.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
bool QueryValue64(const wxString& szValue, wxLongLong_t* plValue) const;
|
||||
|
||||
/**
|
||||
Retrieves the binary structure. Returns @true if successful.
|
||||
An empty @a szValue queries the default/unnamed key value.
|
||||
@@ -397,6 +405,17 @@ public:
|
||||
An empty @a szValue sets the default/unnamed key value.
|
||||
*/
|
||||
bool SetValue(const wxString& szValue, long lValue);
|
||||
|
||||
/**
|
||||
Sets a 64-bit value.
|
||||
|
||||
This function creates or modifies a field of @c QWORD type in the
|
||||
registry.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
bool SetValue64(const wxString& szValue, wxLongLong_t lValue);
|
||||
|
||||
/**
|
||||
Sets the given @a szValue which must be string. If the value doesn't
|
||||
exist, it is created. Returns @true if successful.
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
This class allows showing the user a message non intrusively.
|
||||
|
||||
Currently it is implemented natively for Windows, OS X, GTK and uses
|
||||
Currently it is implemented natively for Windows, macOS, GTK and uses
|
||||
generic toast notifications under the other platforms. It's not recommended
|
||||
but @c wxGenericNotificationMessage can be used instead of the native ones.
|
||||
This might make sense if your application requires features not available in
|
||||
@@ -30,8 +30,8 @@
|
||||
recommended to call MSWUseToasts() before showing the first notification
|
||||
message.
|
||||
|
||||
@par OS X
|
||||
The OS X implementation uses Notification Center to display native notifications.
|
||||
@par macOS
|
||||
The macOS implementation uses Notification Center to display native notifications.
|
||||
In order to use actions your notifications must use the alert style. This can
|
||||
be enabled by the user in system settings or by setting the
|
||||
@c NSUserNotificationAlertStyle value in Info.plist to @c alert. Please note
|
||||
@@ -39,13 +39,13 @@
|
||||
|
||||
|
||||
@beginEventEmissionTable{wxCommandEvent}
|
||||
@event{wxEVT_NOTIFICATION_MESSAGE_CLICK(id, func)}
|
||||
@event{EVT_NOTIFICATION_MESSAGE_CLICK(id, func)}
|
||||
Process a @c wxEVT_NOTIFICATION_MESSAGE_CLICK event, when a notification
|
||||
is clicked.
|
||||
@event{wxEVT_NOTIFICATION_MESSAGE_DISMISSED(id, func)}
|
||||
@event{EVT_NOTIFICATION_MESSAGE_DISMISSED(id, func)}
|
||||
Process a @c wxEVT_NOTIFICATION_MESSAGE_DISMISSED event, when a notification
|
||||
is dismissed by the user or times out.
|
||||
@event{wxEVT_NOTIFICATION_MESSAGE_ACTION(id, func)}
|
||||
@event{EVT_NOTIFICATION_MESSAGE_ACTION(id, func)}
|
||||
Process a @c wxEVT_NOTIFICATION_MESSAGE_ACTION event, when the user
|
||||
selects on of the actions added by AddAction()
|
||||
@endEventTable
|
||||
@@ -216,3 +216,6 @@ public:
|
||||
const wxString& appId = wxString());
|
||||
};
|
||||
|
||||
wxEventType wxEVT_NOTIFICATION_MESSAGE_CLICK;
|
||||
wxEventType wxEVT_NOTIFICATION_MESSAGE_DISMISSED;
|
||||
wxEventType wxEVT_NOTIFICATION_MESSAGE_ACTION;
|
||||
|
@@ -8,11 +8,15 @@
|
||||
/**
|
||||
@class wxNumberFormatter
|
||||
|
||||
Helper class for formatting and parsing numbers with thousands separators.
|
||||
Formatting and parsing numbers using the current UI locale conventions,
|
||||
including support for using the correct decimal point character and
|
||||
thousands separators.
|
||||
|
||||
This class contains only static functions, so users must not create instances
|
||||
but directly call the member functions.
|
||||
|
||||
@see wxUILocale
|
||||
|
||||
@since 2.9.2
|
||||
|
||||
@library{wxbase}
|
||||
@@ -32,7 +36,7 @@ public:
|
||||
|
||||
/**
|
||||
If this flag is given, thousands separators will be inserted in the
|
||||
number string representation as defined by the current locale.
|
||||
number string representation as defined by the current UI locale.
|
||||
*/
|
||||
Style_WithThousandsSep = 0x01,
|
||||
|
||||
@@ -56,7 +60,7 @@ public:
|
||||
Returns string representation of an integer number.
|
||||
|
||||
By default, the string will use thousands separators if appropriate for
|
||||
the current locale. This can be avoided by passing Style_None as @a
|
||||
the current UI locale. This can be avoided by passing Style_None as @a
|
||||
flags in which case the call to the function has exactly the same
|
||||
effect as <code>wxString::Format("%ld", val)</code>.
|
||||
|
||||
@@ -70,7 +74,11 @@ public:
|
||||
Combination of values from the Style enumeration (except for
|
||||
Style_NoTrailingZeroes which can't be used with this overload).
|
||||
*/
|
||||
//@{
|
||||
static wxString ToString(long val, int flags = Style_WithThousandsSep);
|
||||
static wxString ToString(long long val, int flags = Style_WithThousandsSep);
|
||||
static wxString ToString(unsigned long long val, int flags = Style_WithThousandsSep);
|
||||
//@}
|
||||
|
||||
/**
|
||||
Returns string representation of a floating point number.
|
||||
@@ -85,24 +93,42 @@ public:
|
||||
static wxString
|
||||
ToString(double val, int precision, int flags = Style_WithThousandsSep);
|
||||
|
||||
/**
|
||||
Format the given number using one of the floating point formats and
|
||||
ensure that the result uses the correct decimal separator.
|
||||
|
||||
Prefer using ToString() if possible, i.e. if format is "%g" or "%.Nf"
|
||||
which are supported by it directly.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
static wxString Format(const wxString& format, double val);
|
||||
|
||||
/**
|
||||
Parse a string representation of a number possibly including thousands
|
||||
separators.
|
||||
|
||||
These functions parse number representation in the current locale. On
|
||||
These functions parse number representation in the current UI locale. On
|
||||
success they return @true and store the result at the location pointed
|
||||
to by @a val (which can't be @NULL), otherwise @false is returned.
|
||||
|
||||
Note that the overload taking unsigned long long value is only
|
||||
available since wxWidgets 3.1.5. Also, unlike wxString::ToULongLong()
|
||||
and the standard functions such as @c strtoul(), this overload does
|
||||
@em not accept, i.e. returns @false, for the strings starting with the
|
||||
minus sign.
|
||||
|
||||
@see wxString::ToLong(), wxString::ToDouble()
|
||||
*/
|
||||
//@{
|
||||
static bool FromString(wxString s, long *val);
|
||||
static bool FromString(wxString s, long long *val);
|
||||
static bool FromString(wxString s, unsigned long long *val);
|
||||
static bool FromString(wxString s, double *val);
|
||||
//@}
|
||||
|
||||
/**
|
||||
Get the decimal separator for the current locale.
|
||||
Get the decimal separator for the current UI locale.
|
||||
|
||||
Decimal separators is always defined and we fall back to returning '.'
|
||||
in case of an error.
|
||||
@@ -111,14 +137,14 @@ public:
|
||||
|
||||
/**
|
||||
Get the thousands separator if grouping of the digits is used by the
|
||||
current locale.
|
||||
current UI locale.
|
||||
|
||||
The value returned in @a sep should be only used if the function
|
||||
returns @true, otherwise no thousands separator should be used at all.
|
||||
|
||||
@param sep
|
||||
Points to the variable receiving the thousands separator character
|
||||
if it is used by the current locale. May be @NULL if only the
|
||||
if it is used by the current UI locale. May be @NULL if only the
|
||||
function return value is needed.
|
||||
*/
|
||||
static bool GetThousandsSeparatorIfUsed(wxChar *sep);
|
||||
|
@@ -481,7 +481,7 @@ public:
|
||||
|
||||
/**
|
||||
|
||||
This is an helper template class primarily written to avoid memory leaks because
|
||||
This is a helper template class primarily written to avoid memory leaks because
|
||||
of missing calls to wxRefCounter::DecRef() and wxObjectRefData::DecRef().
|
||||
|
||||
Despite the name this template can actually be used as a smart pointer for any
|
||||
@@ -583,19 +583,25 @@ public:
|
||||
@a ptr is a pointer to the reference counted object to which this class points.
|
||||
If @a ptr is not NULL @b T::IncRef() will be called on the object.
|
||||
*/
|
||||
wxObjectDataPtr<T>(T* ptr = NULL);
|
||||
wxObjectDataPtr(T* ptr = NULL);
|
||||
|
||||
//@{
|
||||
/**
|
||||
This copy constructor increases the count of the reference counted object to
|
||||
which @a tocopy points and then this class will point to, as well.
|
||||
|
||||
Using @a U different from @c T is only supported since wxWidgets 3.1.5.
|
||||
*/
|
||||
wxObjectDataPtr<T>(const wxObjectDataPtr<T>& tocopy);
|
||||
template <typename U>
|
||||
wxObjectDataPtr(const wxObjectDataPtr<U>& tocopy);
|
||||
wxObjectDataPtr(const wxObjectDataPtr<T>& tocopy);
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
Decreases the reference count of the object to which this class points.
|
||||
*/
|
||||
~wxObjectDataPtr<T>();
|
||||
~wxObjectDataPtr();
|
||||
|
||||
/**
|
||||
Gets a pointer to the reference counted object to which this class points.
|
||||
@@ -625,7 +631,7 @@ public:
|
||||
|
||||
/**
|
||||
Conversion to a boolean expression (in a variant which is not
|
||||
convertable to anything but a boolean expression).
|
||||
convertible to anything but a boolean expression).
|
||||
|
||||
If this class contains a valid pointer it will return @true, if it contains
|
||||
a @NULL pointer it will return @false.
|
||||
@@ -649,7 +655,11 @@ public:
|
||||
//@{
|
||||
/**
|
||||
Assignment operator.
|
||||
|
||||
Using @a U different from @c T is only supported since wxWidgets 3.1.5.
|
||||
*/
|
||||
template <typename U>
|
||||
wxObjectDataPtr<T>& operator=(const wxObjectDataPtr<U>& tocopy);
|
||||
wxObjectDataPtr<T>& operator=(const wxObjectDataPtr<T>& tocopy);
|
||||
wxObjectDataPtr<T>& operator=(T* ptr);
|
||||
//@}
|
||||
|
@@ -89,7 +89,7 @@ public:
|
||||
wxOwnerDrawnComboBox();
|
||||
|
||||
/**
|
||||
Constructor, creating and showing a owner-drawn combobox.
|
||||
Constructor, creating and showing an owner-drawn combobox.
|
||||
|
||||
@param parent
|
||||
Parent window. Must not be @NULL.
|
||||
|
@@ -111,12 +111,12 @@ public:
|
||||
@param event
|
||||
The colour change event.
|
||||
|
||||
@remarks Changes the panel's colour to conform to the current settings
|
||||
(Windows only). Add an event table entry for your panel
|
||||
class if you wish the behaviour to be different (such
|
||||
as keeping a user-defined background colour). If you do
|
||||
override this function, call wxEvent::Skip() to propagate
|
||||
the notification to child windows and controls.
|
||||
@remarks Changes the panel's colour to conform to the current settings.
|
||||
Add an event table entry for your panel class if you wish the
|
||||
behaviour to be different (such as keeping a user-defined
|
||||
background colour). If you do override this function, call
|
||||
wxEvent::Skip() to propagate the notification to child windows
|
||||
and controls.
|
||||
|
||||
@see wxSysColourChangedEvent
|
||||
*/
|
||||
|
@@ -70,6 +70,31 @@ enum wxPenStyle
|
||||
/**< Last of the hatch styles (inclusive). */
|
||||
};
|
||||
|
||||
/**
|
||||
Possible values for pen quality.
|
||||
|
||||
Pen quality is currently only used in wxMSW, the other ports ignore it and
|
||||
always use the same default pen quality.
|
||||
|
||||
In wxMSW the choice of quality affects whether "cosmetic" or "geometric"
|
||||
native pens are used in situations when both are usable. Notably, for
|
||||
dotted and dashed pens of width 1, high quality geometric pens are used by
|
||||
default since wxWidgets 3.1.4, while previous versions used lower quality
|
||||
but much faster cosmetic pens. If drawing performance is more important
|
||||
than the exact appearance of the lines drawn using this pen, low quality
|
||||
may be explicitly selected.
|
||||
|
||||
See wxPenInfo::Quality() and wxPen::SetQuality().
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
enum wxPenQuality
|
||||
{
|
||||
wxPEN_QUALITY_DEFAULT, ///< Select the appropriate quality automatically.
|
||||
wxPEN_QUALITY_LOW, ///< Less good looking but faster.
|
||||
wxPEN_QUALITY_HIGH ///< Best looking, at the expense of speed.
|
||||
};
|
||||
|
||||
/**
|
||||
The possible join values of a wxPen.
|
||||
|
||||
@@ -138,15 +163,45 @@ public:
|
||||
|
||||
wxPenInfo& Cap(wxPenCap cap);
|
||||
|
||||
/**
|
||||
Set the pen quality.
|
||||
|
||||
Using LowQuality() or HighQuality() is usually more convenient.
|
||||
|
||||
@see wxPen::SetQuality()
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxPenInfo& Quality(wxPenQuality quality);
|
||||
|
||||
/**
|
||||
Set low pen quality.
|
||||
|
||||
This is the same as calling Quality() with ::wxPEN_QUALITY_LOW.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxPenInfo& LowQuality();
|
||||
|
||||
/**
|
||||
Set high pen quality.
|
||||
|
||||
This is the same as calling Quality() with ::wxPEN_QUALITY_HIGH.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxPenInfo& HighQuality();
|
||||
|
||||
wxColour GetColour() const;
|
||||
wxBitmap GetStipple() const;
|
||||
wxPenStyle GetStyle() const;
|
||||
wxPenJoin GetJoin() const;
|
||||
wxPenCap GetCap() const;
|
||||
wxPenQuality GetQuality() const;
|
||||
int GetDashes(wxDash **ptr);
|
||||
int GetDashCount() const;
|
||||
wxDash* GetDash() const;
|
||||
bool IsTransparent() const;
|
||||
bool IsTransparent() const;
|
||||
int GetWidth() const;
|
||||
};
|
||||
|
||||
@@ -279,6 +334,15 @@ public:
|
||||
*/
|
||||
virtual wxPenCap GetCap() const;
|
||||
|
||||
/**
|
||||
Returns the pen quality.
|
||||
|
||||
The default is ::wxPEN_QUALITY_DEFAULT.
|
||||
|
||||
@see wxPenQuality, SetQuality()
|
||||
*/
|
||||
wxPenQuality GetQuality() const;
|
||||
|
||||
/**
|
||||
Returns a reference to the pen colour.
|
||||
|
||||
@@ -375,6 +439,19 @@ public:
|
||||
*/
|
||||
virtual void SetCap(wxPenCap capStyle);
|
||||
|
||||
/**
|
||||
Sets the pen quality.
|
||||
|
||||
Explicitly selecting low pen quality may be useful in wxMSW if drawing
|
||||
performance is more important than the exact appearance of the lines
|
||||
drawn with this pen.
|
||||
|
||||
@see wxPenQuality
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
void SetQuality(wxPenQuality quality);
|
||||
|
||||
//@{
|
||||
/**
|
||||
The pen's colour is changed to the given colour.
|
||||
|
77
interface/wx/persist/combobox.h
Normal file
77
interface/wx/persist/combobox.h
Normal file
@@ -0,0 +1,77 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/persist/combobox.h
|
||||
// Purpose: Interface of wxPersistentComboBox
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2020-11-19
|
||||
// Copyright: (c) 2020 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
Persistence adapter for wxComboBox.
|
||||
|
||||
This adapter saves and restores the items of wxComboBox. A persistent
|
||||
combobox can be used to preserve history of user entries.
|
||||
|
||||
Example of using it:
|
||||
@code
|
||||
// Suppose you need to ask the user to select their favourite Linux
|
||||
// distribution, for some reason:
|
||||
wxComboBox* combo = new wxComboBox(this, wxID_ANY);
|
||||
if ( !wxPersistentRegisterAndRestore(combo, "distribution") )
|
||||
{
|
||||
// Seed it with some default contents.
|
||||
combo->Append("Debian");
|
||||
combo->Append("Fedora");
|
||||
combo->Append("Ubuntu");
|
||||
}
|
||||
|
||||
// Optionally, you might want to restore the last used entry:
|
||||
combo->SetSelection(0);
|
||||
|
||||
@endcode
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
class wxPersistentComboBox : public wxPersistentWindow<wxComboBox>
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Constructor.
|
||||
|
||||
@param combobox
|
||||
The associated combobox.
|
||||
*/
|
||||
explicit wxPersistentComboBox(wxComboBox *combobox);
|
||||
|
||||
/**
|
||||
Save the current items and value.
|
||||
|
||||
The current control value is saved as the first item, so that calling
|
||||
@c SetSelection(0) when the control is created the next time will
|
||||
restore the value which was last used. If the current value is the same
|
||||
as one of the existing items, this item is moved to the front of the
|
||||
list, instead of being added again.
|
||||
|
||||
If the current value is empty, it is not saved at all.
|
||||
|
||||
At most 10 items are saved, if the combobox has more than 10 items, or
|
||||
exactly 10 items and the current value is different from all of them,
|
||||
the items beyond the tenth one are discarded.
|
||||
*/
|
||||
virtual void Save() const;
|
||||
|
||||
/**
|
||||
Restore the combobox items.
|
||||
|
||||
This function doesn't change the current combobox value, you need to
|
||||
call @c SetSelection(0) explicitly, after verifying that the combobox
|
||||
is not empty using its IsListEmpty() method, if you want to restore the
|
||||
last used value automatically. Otherwise the user can always do it by
|
||||
opening the combobox and selecting it manually.
|
||||
*/
|
||||
virtual bool Restore();
|
||||
};
|
||||
|
||||
/// Overload allowing persistence adapter creation for wxComboBox objects.
|
||||
wxPersistentObject *wxCreatePersistentObject(wxComboBox *combobox);
|
@@ -28,7 +28,7 @@ public:
|
||||
/**
|
||||
Constructor for a persistent window object.
|
||||
|
||||
The constructor uses wxEvtHandler::Connect() to catch
|
||||
The constructor uses wxEvtHandler::Bind() to catch
|
||||
wxWindowDestroyEvent generated when the window is destroyed and call
|
||||
wxPersistenceManager::SaveAndUnregister() when this happens. This
|
||||
ensures that the window properties are saved and that this object
|
||||
|
@@ -16,7 +16,7 @@
|
||||
Base abstract class for all pickers which support an auxiliary text control.
|
||||
|
||||
This class handles all positioning and sizing of the text control like a
|
||||
an horizontal wxBoxSizer would do, with the text control on the left of the
|
||||
a horizontal wxBoxSizer would do, with the text control on the left of the
|
||||
picker button.
|
||||
|
||||
The proportion (see wxSizer documentation for more info about proportion values)
|
||||
|
@@ -23,7 +23,7 @@ enum wxOperatingSystemId
|
||||
wxOS_UNKNOWN = 0, //!< returned on error
|
||||
|
||||
wxOS_MAC_OS = 1 << 0, //!< Apple Mac OS 8/9/X with Mac paths
|
||||
wxOS_MAC_OSX_DARWIN = 1 << 1, //!< Apple OS X with Unix paths
|
||||
wxOS_MAC_OSX_DARWIN = 1 << 1, //!< Apple macOS with Unix paths
|
||||
|
||||
//! A combination of all @c wxOS_MAC_* values previously listed.
|
||||
wxOS_MAC = wxOS_MAC_OS|wxOS_MAC_OSX_DARWIN,
|
||||
@@ -74,9 +74,25 @@ enum wxPortId
|
||||
|
||||
|
||||
/**
|
||||
The architecture of the operating system
|
||||
The architecture bitness of the operating system
|
||||
(regardless of the build environment of wxWidgets library - see ::wxIsPlatform64Bit()
|
||||
documentation for more info).
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
enum wxBitness
|
||||
{
|
||||
wxBITNESS_INVALID = -1, //!< returned on error
|
||||
|
||||
wxBITNESS_32, //!< 32 bit
|
||||
wxBITNESS_64, //!< 64 bit
|
||||
|
||||
wxBITNESS_MAX
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@deprecated Use wxBitness instead.
|
||||
*/
|
||||
enum wxArchitecture
|
||||
{
|
||||
@@ -122,11 +138,50 @@ struct wxLinuxDistributionInfo
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@class wxPlatformId
|
||||
|
||||
Defines a very broad platform categorization.
|
||||
|
||||
Usually you would use wxPlatformInfo to get all the platform details rather
|
||||
than this class which only distinguishes between MSW, Mac and Unix
|
||||
platforms.
|
||||
|
||||
This class is mostly useful if a short string describing the platform
|
||||
corresponds to the current platform, i.e. the platform under which the
|
||||
executable runs. The recognized strings are:
|
||||
|
||||
- "msw" (preferred) or "win" (for compatibility) for MSW.
|
||||
- "mac" for Apple systems, i.e. macOS and iOS.
|
||||
- "unix" for the (other) Unix-like systems.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
class wxPlatformId
|
||||
{
|
||||
/**
|
||||
Returns the preferred current platform name.
|
||||
|
||||
Use MatchesCurrent() to check if the name is one of the possibly
|
||||
several names corresponding to the current platform.
|
||||
|
||||
Returns one of "msw", "mac" or "unix" or an empty string if the current
|
||||
platform is not recognized.
|
||||
*/
|
||||
static wxString GetCurrent();
|
||||
|
||||
/**
|
||||
Returns true if the given string matches the current platform.
|
||||
*/
|
||||
static bool MatchesCurrent(const wxString& s);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@class wxPlatformInfo
|
||||
|
||||
This class holds information about the operating system, the toolkit and the
|
||||
basic architecture of the machine where the application is currently running.
|
||||
basic architecture bitness of the machine where the application is currently running.
|
||||
|
||||
This class does not only have @e getters for the information above, it also has
|
||||
@e setters. This allows you to e.g. save the current platform information in a
|
||||
@@ -172,7 +227,7 @@ public:
|
||||
wxOperatingSystemId id = wxOS_UNKNOWN,
|
||||
int osMajor = -1,
|
||||
int osMinor = -1,
|
||||
wxArchitecture arch = wxARCH_INVALID,
|
||||
wxBitness bitness = wxBITNESS_INVALID,
|
||||
wxEndianness endian = wxENDIAN_INVALID);
|
||||
|
||||
|
||||
@@ -226,9 +281,16 @@ public:
|
||||
//@{
|
||||
|
||||
/**
|
||||
Converts the given string to a wxArchitecture enum value or to
|
||||
@c wxARCH_INVALID if the given string is not a valid architecture string
|
||||
Converts the given string to a wxBitness enum value or to
|
||||
@c wxBITNESS_INVALID if the given string is not a valid architecture bitness string
|
||||
(i.e. does not contain nor @c 32 nor @c 64 strings).
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
static wxBitness GetBitness(const wxString& bitness);
|
||||
|
||||
/**
|
||||
@deprecated Use GetBitness() instead.
|
||||
*/
|
||||
static wxArchitecture GetArch(const wxString& arch);
|
||||
|
||||
@@ -263,10 +325,17 @@ public:
|
||||
//@{
|
||||
|
||||
/**
|
||||
Returns the name for the given wxArchitecture enumeration value.
|
||||
@deprecated Use GetBitnessName() instead.
|
||||
*/
|
||||
static wxString GetArchName(wxArchitecture arch);
|
||||
|
||||
/**
|
||||
Returns the name for the given wxBitness enumeration value.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
static wxString GetBitnessName(wxBitness bitness);
|
||||
|
||||
/**
|
||||
Returns name for the given wxEndianness enumeration value.
|
||||
*/
|
||||
@@ -322,15 +391,31 @@ public:
|
||||
//@{
|
||||
|
||||
/**
|
||||
Returns the architecture ID of this wxPlatformInfo instance.
|
||||
@deprecated Use GetBitness() instead.
|
||||
*/
|
||||
wxArchitecture GetArchitecture() const;
|
||||
|
||||
/**
|
||||
Returns the architecture bitness ID of this wxPlatformInfo instance.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxBitness GetBitness() const;
|
||||
|
||||
/**
|
||||
Returns the endianness ID of this wxPlatformInfo instance.
|
||||
*/
|
||||
wxEndianness GetEndianness() const;
|
||||
|
||||
/**
|
||||
Returns the CPU architecture name, if available.
|
||||
|
||||
@see wxGetCpuArchitectureName()
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxString GetCpuArchitectureName() const;
|
||||
|
||||
/**
|
||||
Returns the run-time major version of the OS associated with this
|
||||
wxPlatformInfo instance.
|
||||
@@ -440,10 +525,17 @@ public:
|
||||
//@{
|
||||
|
||||
/**
|
||||
Returns the name for the architecture of this wxPlatformInfo instance.
|
||||
@deprecated Use GetBitnessName() instead.
|
||||
*/
|
||||
wxString GetArchName() const;
|
||||
|
||||
/**
|
||||
Returns the name for the architecture bitness of this wxPlatformInfo instance.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
wxString GetBitnessName() const;
|
||||
|
||||
/**
|
||||
Returns the name for the endianness of this wxPlatformInfo instance.
|
||||
*/
|
||||
@@ -483,10 +575,17 @@ public:
|
||||
//@{
|
||||
|
||||
/**
|
||||
Sets the architecture enum value associated with this wxPlatformInfo instance.
|
||||
@deprecated Use SetBitness() instead.
|
||||
*/
|
||||
void SetArchitecture(wxArchitecture n);
|
||||
|
||||
/**
|
||||
Sets the architecture bitness enum value associated with this wxPlatformInfo instance.
|
||||
|
||||
@since 3.1.5
|
||||
*/
|
||||
void SetBitness(wxBitness n);
|
||||
|
||||
/**
|
||||
Sets the endianness enum value associated with this wxPlatformInfo instance.
|
||||
*/
|
||||
@@ -531,3 +630,15 @@ public:
|
||||
//@}
|
||||
};
|
||||
|
||||
/**
|
||||
Returns true only for MSW programs running under Wine.
|
||||
|
||||
This function can be used to check for some functionality not implemented
|
||||
when using Wine.
|
||||
|
||||
@since 3.1.6
|
||||
|
||||
@library{wxbase}
|
||||
@category{cfg}
|
||||
*/
|
||||
bool wxIsRunningUnderWine();
|
||||
|
@@ -106,7 +106,7 @@ wxEventType wxEVT_POWER_RESUME;
|
||||
powering off the screen and Acquire() method can be used to do this.
|
||||
|
||||
Notice that currently this functionality is only implemented for MSW and
|
||||
OS X.
|
||||
macOS.
|
||||
|
||||
If possible, use wxPowerResourceBlocker class to ensure that Release() is
|
||||
called instead of calling it manually.
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
Helper RAII class ensuring that power resources are released.
|
||||
|
||||
A wxPowerResourceBlocker object acquires a power resource in the
|
||||
constructor and releases it in the destructor making it impossible to to
|
||||
constructor and releases it in the destructor making it impossible to
|
||||
forget to release the power resource (which would prevent suspending or
|
||||
screen power off until the application ends).
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user