Make it clear that only the menu directly passed to wxWindow::PopupMenu()
doesn't need to be allocated on the heap and that its submenus still do.
Closes#11851.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add a virtual wxDocManager::CreatePreviewFrame() which can be overridden to
customize the print preview used by docview framework.
Closes#11390.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxDocument::Revert() method existed but didn't do anything, provide a
default implementation for it. Also document it and show it in the sample.
Closes#11849.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add wxStaticTextBase::GetLabelWithoutMarkup() and use it in the wxMSW implementation of wxStaticText::SetLabel() to close bug #11446; the function RemoveMarkup() which was previously used in fact could not check for presence/absence of wxST_MARKUP style since it's a static function.
Add wxStaticTextBase::SetLabelText() functions for symmetry with wxControlBase::SetLabelText()
Add test unit for both wxControl::*Label* and wxStaticText::*Label* functions.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63733 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't speak about features "new" in Windows 95 nor 4.0 any more (what next,
discussion of wxWidgets limitations when running on an abacus?) but do mention
that this dialog is native under all major platforms now.
Closes#11820.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63726 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add comments to explain in more details what the function does and in particular the valid ranges of all internal variables; fix in that regard both the code of both wxELLIPSIZE_START, wxELLIPSIZE_MIDDLE and wxELLIPSIZE_END.
Add more asserts to check the valid ranges and turn a couple of time-expensive checks in level-2 asserts.
Add a test unit for the wxControl::Ellipsize function.
Fix minor details in the docs of wxControl::Ellipsize.
Closes#11567.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Document that wxOS_UNIX, wxOS_MAC and wxOS_WINDOWS enum values are combinations of other values (unfortunately doxygen does not show the definition of those symbols in the HTML docs so we need to explicitely state that).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This fixes compilation with wxUSE_FILE=0 as wxFileName::Mkdir() still uses
these constants but their definitions were not available in this case.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Make it possible to use this flag on its own, without wxSTOCK_WITH_MNEMONIC
which is also part of wxSTOCK_FOR_BUTTON. This can be useful for e.g. toolbar
buttons.
Closes#11681, #11682.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow retrieving individual wxDataObjects from wxDataObjectComposite and add
an example showing how can this be done to the documentation.
Closes#11692.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Document that some of the standard cursors are defined in this file.
Also add a (hopefully) helpful assert if loading one of such cursors failed.
Closes#11424.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Currently these functions generate events in both of the existing
implementations (GTK and MSW) so it is simpler to let them to continue to do
it but this must at least be documented as this is probably unexpected by
users.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Failure to create a wxPaintDC in EVT_PAINT handler resulted in many serious
and difficult to debug problems under wxMSW. We used to document that the user
shouldn't do it but this wasn't enough (see #11648). We could also assert if
we detected that a handler didn't create a wxPaintDC but it seems better to
just handle this case gracefully for consistency with the other platforms.
Add wxDidCreatePaintDC global variable which is reset before generating
wxPaintEvent and set to true when ::BeginPaint() is called from wxPaintDC
ctor and validate the update region of the window ourselves if it wasn't set
(meaning that wxPaintDC wasn't created).
Update the documentation to emphasize the link between EVT_PAINT handlers and
wxPaintDC but without saying that wxPaintDC object must always be created in
the handler as this is not true any more.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This makes it possible to easily pass custom data between threads, in
type-safe way (thanks to internal use of wxAny). This adds
sizeof(wxAny)==16+sizeof(void*) overhead to wxThreadEvent, but I think
it's cheaper than doing malloc/free on copying.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Mention that the number of columns may also be automatically deduced.
Don't duplicate the same documentation in wxGridSizer and wxFlexGridSizer as
this inevitably results in forgetting to update one of the versions (as in the
previous commit). Instead, just link to wxGridSizer from wxFlexGridSizer.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Be more clear about what does it mean to specify the number of rows. Don't use
@code for inline expressions. Remove an extraneous "it".
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63156 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Behaviour of GetCellSize() may be very surprising for the unwary as it can
return negative or null "size" of the cell.
Add CellSpan return value to allow the caller to check what kind of cell are
we dealing with easier.
Also document the new return value as well as the function (and matching
SetCellSize()) itself carefully as its behaviour is far from obvious.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Override virtual methods IsSeekable(), GetLength() and OnSysSeek/Tell() to
forward to wxF(F)InputStream base class as otherwise it's impossible to use
them at all because of ambiguity between the versions inherited from this
class and wxF(F)OutputStream (even though the two versions should do the same
thing as they operate on the same file descriptor/handle).
Also improve documentation of these classes: provide a brief description,
correct the base classes.
Closes#11577.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The public header for this class is wx/spinctrl.h, but it was documented in
wx/generic/spinctrg.h which didn't even correspond to an existing real header
file (which is called spinctlg.h). Move the documentation to wx/spinctrl.h and
remove the old file.
Closes#11548.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Stretchable spaces consume all extra toolbar space not allocated to the fixed
size items. They can in particular be used to right-align (some) toolbar tools.
Add and document the new API, change the sample to show it and implement it
for MSW, GTK and OS X/Cocoa.
Also refactor MSW background erasing/repainting code to avoid duplicated calls
to DrawThemeBackground(), call it from a new helper MSWEraseRect() function.
Note that we may want to add support for "invisible" separators, IOW
non-stretchable spaces. This could be easily done for MSW after the changes in
this commit and is supported natively by GTK+ and Cocoa so implementing this
would be trivial if there is any interest.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Added a helper DoInsertNewTool() function to avoid code duplication and ensure
that we never forget to delete a new tool if inserting it into the toolbar
failed.
Also explicitly document that the tool passed to the public InsertTool() is
not owned by the toolbar and so must be deleted by the caller if its insertion
failed.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't mention the words "release mode" as there is no such thing now, instead
refer to wxDEBUG_LEVEL explicitly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Calls to wxStrchr(char-string, wide-char) would previously fail if wide
character couldn't be converted to a single character in the current locale
encoding. Change it to simply return NULL in this case as it's a safe and
useful generalization: a narrow string will never contain a wide character not
representable in the current locale.
Add wxUniChar::GetAsChar() to help with implementing this.
Closes#11487.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxGridCellAttr didn't provide any way to query its alignment attributes
without falling back to the (always defined) default alignment so the code in
wxGridCellNumberRenderer and similar classes simply always used right
alignment,
Add a new wxGridCellAttr::GetNonDefaultAlignment() function which allows to
retrieve the alignment defined in the attribute and use it to use right
alignment by default but allow overriding it.
Add a test to the sample showing a non right-aligned numeric cell.
Incidentally fix a long-standing bug in wxGridCell{DateTime,Enum}Renderers
which used wxRIGHT instead of wxALIGN_RIGHT and so were not aligned properly
even by default.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxGridCellAttr was using literal -1 to indicate "no alignment" which wasn't
immediately obvious, use a new wxALIGN_INVALID (which has the same value)
instead.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxFont::GetNativeFontInfoDesc() and GetNativeFontInfoUserDesc() were
overridden just to ensure that the font is realized but it makes sense to do
it in wxFontRefData::GetNativeFontInfo() itself as detecting the face name
won't work if the font is not realized anyhow. And then we don't need these
functions at all as the only thing they do is checking that the font is valid
when they are called but this can be done in the base class itself as this
should happen in all ports (document that this is the case).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Currently exceptions thrown from this function are not passed to wxApp::
OnExceptionInMainLoop() (unlike exceptions thrown from timer event handlers).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62697 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Support wxSL_{LEFT,TOP,RIGHT,BOTTOM} in wxGTL version of wxSlider.
Make the display of the orientations in the slider page of the widgets sample
more clear.
Also document wxSL_<DIR> meaning better.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use parentheses around the macro expansion to ensure that code like "whatever
& ~wxSL_LABELS" still works as expected.
Be more explicit in wxSL_LABELS description and mark wxSL_MIN_MAX_LABELS and
wxSL_VALUE_LABEL as being new in 2.9.1.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We had wxBase64Decode(void*,size_t,const char*,size_t) as well as
wxBase64Decode(const char*,size_t) and wxBase64Decode(wxString) already but
not a version taking the buffer and wxString, complete the set of overloads
now.
This allows the unit test to compile in STL build (where there is no implicit
conversion from wxString to const char *).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62614 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Set up the DC passed to wxDataViewCustomRenderer::Render() to use the font and
colour defined by the item attribute by default so that any calls to
RenderText() from it will use them automatically.
Also added public wxDataViewCustomRenderer::GetAttr() to allow retrieving the
attribute explicitly in Render().
The column using custom renderer in the dataview sample now works as expected
in the generic version; the native ones will be corrected in the upcoming
commits.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
While this function is usually called by wx itself it may be useful to call it
explicitly in some particular situations, as documented in the function
description, so make it officially public.
Closes#11396.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62546 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method is useful for getting the number of items in the control and
should be part of the public API instead of being marked as internal.
Closes#11380.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is an incompatible change but having to use a non-const model pointer to
call a clearly logically const version was simply too ugly so change it while
we still can.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Old code created the tree model and its unique built-in column only in
wxDataViewTreeCtrl ctor but not in Create(), meaning that the behaviour was
very different depending on whether you used base class ctor call or Create()
in a derived class. This was confusing and completely inconsistent with wx API
in which using the default ctor and Create() is supposed to always have
exactly the same effect as using non-default ctor so change this to create the
model in Create() so that it's always done.
Slightly update the documentation and also add wxDataViewTreeCtrl::Init() for
consistency.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62498 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method allows to simply test whether we have a value at the given row and
column or not (as it happens for container items unless they too have columns).
Currently this method is not virtual and is not used by the implementations
yet but it might make sense to make it virtual and allow overriding it in the
future.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
ChangeValue() is a trivial wrapper calling both SetValue() and ValueChanged().
It allows to replace many calls to SetValue() immediately followed by
ValueChanged() with a single function call which is significantly shorter and
less error-prone (e.g. most of the existing code didn't test SetValue() return
code at all).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Merges everything from the branch with only some minor changes, mostly renamed
wxUSE_FSWATCHER_{INOTIFY,KQUEUE} to wxHAS_{INOTIFY,KQUEUE}.
Add wxFileSystemWatcher and related classes.
Also introduces wxEventLoopSource.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Comment and document the (non obvious) requirement for the PNG image handler
to be enabled when using this function under OS X. In fact, document the
entire function itself which was forgotten previously.
Do enable PNG image handler when using DrawTitleBarBitmap() in the sample.
Closes#11345.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Implemented ellipsization in the generic, GTK and both OS X Carbon and Cocoa
versions but it currently doesn't work well in GTK as it changes the item
alignment unconditionally, this will need to be fixed later.
The behaviour for the columns is currently inconsistent between ports too:
under MSW they (natively) use wxELLIPSIZE_END, under GTK -- wxELLIPSIZE_NONE
and under OS X the same ellipsization mode as the column contents, i.e.
wxELLIPSIZE_MIDDLE by default.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We shouldn't use the same "wxELLIPSIZE_" prefix for two different enums, so
use wxELLIPSIZE_FLAGS one for wxEllipsizeFlags (they should be used less often
than wxEllipsizeMode so it's better to keep the short prefix for the latter).
Also add wxELLIPSIZE_FLAGS_NONE flag.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
SetBellOnError() erroneously inversed the value of its parameter. Fixing it to
behave correctly could silently break the existing code which might work
around this bug already because it always behaved like this (ever since it was
added 10.5 years ago). So instead simply deprecate this function and add a new
SuppressBellOnError() one which behaves as expected.
Closes#11318.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There is no reason to have a separate class for rendering the text honouring
the attributes defined for it, wxDataViewTextRenderer itself already does this
perfectly well.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is similar to the existing wxDCTextColourChanger ctor not changing colour
and is useful in the same kind of situations: when the font may or not be
changed.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Only wxDCTextColourChanger(wxDC, wxColour) one was documented, also document
wxDCTextColourChanger(wxDC) and its Set() method now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The changes in r50025 made the behaviour of wxStandardPaths silently
incompatible with the previous versions under MSW and OS X as it now used the
vendor name in the paths it returned, unlike before. The benefits of doing
this don't justify silently breaking the existing programs so revert this
change and continue to use the application name only by default.
It is, of course, still possible to explicitly ask for the vendor name to be
used with wxStandardPaths::UseAppInfo().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Using different log components for different logging statements provides a
better (because more general and efficient) way to do the same thing that
wxLogTrace() does, so mention them when describing wxLogTrace().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Applications using wxStandardPaths::GetDataDir() to find their files under
Unix can't be ran without being installed as they look for their data files
under $prefix/share/appname. Make it possible to override this location by
setting WX_APPNAME_DATA_DIR environment variable to allow running them without
installation.
Notice that this shouldn't present any security risk unless the application is
SUID (which would be a very bad idea anyhow).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62337 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use "appinfo" instead of "appname" in the examples to make it clear that it
may be different from just the application name.
Also make UseAppInfo() documentation more clear.
See #11275.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62336 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This version animates the window asynchronously and is being checked in just
to preserve it in svn if we later decide to return to this semantics. It will
be replaced by synchronous animation in the next commit.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This id corresponds to the close button bitmap. Currently only wxGTK returns a
natively-looking button from here, MSW and OS X versions will be added later.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Assume that user-added buttons can be already used to close the message so
don't show the default close button if any were added.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Also add an example of handling info bar buttons events to the sample and
mention that this must be done using Connect() or by deriving from wxInfoBar
in the documentation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Also change the GTK implementation to use a separate wxInfoBarGTKImpl to store
its data, this object won't be even allocated if a generic implementation is
used under GTK.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62277 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Straightforward implementation of wxInfoBar using GtkInfoBar widget available
in GTK+ 2.18.
Some side effects of this change:
- Rename wxInfoBar version in wx/generic/infobar.h to wxInfoBarGeneric and
define wxInfoBar in wx/infobar.h.
- Also change default value of flags argument to ShowMessage() to
wxICON_INFORMATION from wxICON_NONE as the default colour for wxICON_NONE
messages is surprisingly ugly in GTK native version.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Calling Show/HideWithEffect() with this effect is the same as calling just the normal Show/Hide().
This is convenient as it allows to use the same API, whether with effects or without them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775