Fix typo in the sample, comma was used instead of a semicolon. The code still
worked correctly but make it look correctly too now.
Closes#13453.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow the user to sort the control contents by clicking on the columns with
wxCOL_SORTABLE flag and also provide SetSortColumn() method to sort the
control programmatically.
Also add wxTreeListItemComparator class and SetItemComparator() method to
allow customizing the way the items are compared.
Update the sample to show how to define a custom comparator.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Override wxDataViewModel::IsListModel() to return true if wxTreeListCtrl
doesn't have any depth. This results in better display when using the generic
implementation of wxDataViewCtrl as no space is reserved for the (unnecessary)
expanders in this case.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68961 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
These styles allow to use a smaller browse button as the standard one takes
too much space, often leaving too little of it for the more important text
control part.
Notice that both styles are, in fact, equal to wxPB_SMALL but only file and
directory pickers currently use it as it doesn't make sense for the colour and
font pickers.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There doesn't seem to be any reason not to do this in the controls which we
know are meant for entering file or directory names into them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The controls were too small to see long paths in them comfortably while there
was plenty of space in the page, use wxEXPAND flag for them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
As we already had MSW-specific AutoCompleteFileNames(), we can just as well
also add the also useful AutoCompleteDirectories() to be used with the text
controls used for path entry.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68918 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is a facade for wxDataViewCtrl allowing to easily work with multi-column
trees, possibly with an optional checkbox in the first column. Its API is very
similar to wxTreeListCtrl and it provides a simple migration path from the
latter.
Add the class itself, documentation for it and minimal unit tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Having wxBITMAP_TYPE_TIFF and wxBITMAP_TYPE_TIFF_RESOURCE is more consistent with already using the complete short name of an image format elsewhere (e.g. wxBITMAP_TYPE_JPEG, not wxBTMAP_TYPE_JPG, and wxTIFFHandler as opposed to wxTIFHandler). Renamed all existing occurrences and kept the old enum values for backwards compatibility.
Also renamed occurrences of wxBITMAP_TYPE_RESOURCE to the already existing wxBITMAP_TYPE_BMP_RESOURCE.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68859 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Avoid defining SetImageList() in several different places in wx API as not
only this resulted in (trivial) code duplication but this method also had
different semantics before: it didn't take ownership of the pointer passed to
it in wxTreeCtrl, wxListCtrl and wxBookCtrl and derived classes but did take
its ownership in wxDataViewTreeCtrl and wxRichTextFormattingDialog.
Harmonize this for all the classes now: SetImageList() never takes ownership
while AssignImageList() (which is now available in all classes having
SetImageList()) always does.
Also add convenience wxWithImages::GetImage() helper to avoid (more) code
duplication in wxDataViewTreeCtrl code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68809 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Thread id is an (unsigned) long, not just unsigned, so use "%lx" to print it
instead of "%x" to avoid asserts in formatting code.
Closes#13404.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
openFiles (available since OS X 10.3) replaces using the openFile method. It allows for more convenient handling of multiple drops and knowing in advance how much files/folders are dropped instead of openFile with which you only get to respond to a single file/folder drop at a time. By default openFiles calls the newly added MacOpenFiles which calls MacOpenFile multiple times, so ordinarily the behaviour is backwards compatible (both on wxOSX Cocoa and Carbon).
The openFile instance method has been removed because it doesn't seem to be called anymore: neither when dropping a single file on the application in the dock or Finder nor when passed as a command-line argument.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68617 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Also generate events corresponding to WM_SYSCOMMAND messages for the custom
items of the system menu.
Add a small snippet to test the new functionality to the dialogs sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Implement support for wxHELP for wxMSW, wxGTK and wxOSX/Cocoa (at least when
showing the message box from the main thread, there doesn't seem to be any way
to show more than three buttons with CFUserNotificationDisplayAlert() so
"Help" button is not supported when using it).
This is useful not only on its own, i.e. to allow the user to ask for help,
but also because it brings the total number of buttons supported by the
message dialog to 4, meaning that more choices can be offered to the user
(which is rarely, but not quite never, useful).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68537 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Show how the file history can be saved to and restored from wxConfig.
This makes it much easier to test file history related stuff as the history
doesn't need to be recreated during every sample run.
It is also closer to what real applications using docview framework do as the
file history is relatively useless if it's not saved.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68332 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It can be useful to induce an error on the stream explicitly, e.g. because an
incorrect value was read from it and we want to indicate it to the caller by
setting stream error to wxSTREAM_READ_ERROR.
Allow to do this by passing an optional error value to wxStreamBase::Reset().
Add an example of using the new functionality to the docview sample which
needs it to be able to signal errors while reading the files.
Also document this method that previously wasn't documented at all.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add new "expanded" attribute for XRC nodes of treebookpage class.
Also update the sample and the XRC format documentation.
Closes#13355.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
VC6 can't instantiate member template functions so get rid of it and use ugly
dynamic casts in the non-template function to construct wxGCDC correctly.
See #13327.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68311 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows to test wxMemoryDC and, under MSW, wxMetafileDC and also can be
used to compare the output of different versions of the sample (possibly from
different ports, too).
Closes#13327.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68305 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxMSW used to handle VK_RETURN in the same way as VK_TAB if it wasn't consumed
by the default push button but this didn't correspond to the native platform
behaviour which considers pressing Return when the OK button is disabled an
error and audibly notifies the user about it.
Fix this by passing VK_RETURN to IsDialogMessage() if we don't translate it to
a button click.
Also add a possibility to test what happens when the default (or all)
button(s) in the dialog are disabled to the dialogs sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Do it for consistency, as the state of all the other buttons is already shown,
and also to have some place for testing this functionality.
Closes#13309.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68211 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Running console sample without parameters didn't do anything by default and
didn't output anything neither which was presumably rather confusing. Do
output a welcome message at least to indicate that something happened.
Closes#13299.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68209 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The virtual ColourToString() method was hidden and not overridden in the
sample because it didn't use the last argument of the base class method.
Fix this in the most straightforward (albeit not necessarily the most correct)
way to at least ensure that the function is really overridden.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68109 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For this, it cannot derive from wxCommandEvent. Extracted the bits
from wxCommandEvent useful for passing data between threads into
wxEventBasicPayloadMixin helper class shared by both.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Child documents are virtual documents corresponding to parts of their parent
document which can't be saved nor loaded independently of their parent and are
closed when the parent is closed.
This finally makes some use of wxDocument::m_documentParent field which was
always present in the docview code but never used before.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68051 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The view doesn't have any associated frame when using the special "single
view" mode in the sample, so don't try to show it when creating a new view.
This resulted in a crash when starting the sample with --single command line
parameter.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
While GTK+ doesn't support imposing ranges for dates selection natively, we
can do it ourselves by preventing the user from selecting any date outside of
the currently valid range.
This allows to use ranges under all platforms and not only in wxCalendarCtrl
itself but in wxDatePickerCtrl as well.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Show focus rectangle around the control when it has focus. Also handle the
space key to trigger the link.
Also allow using either the native or generic version of the class in the
widgets sample.
Closes#11285.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Introduce wxAnyButton class, a common base class for wxButton and
wxToggleButton, allowing to reuse the same implementation for them.
This also allows to implement support for bitmaps in wxToggleButton for all
platforms and make wxBitmapToggleButton a trivial subclass of it everywhere,
similarly to wxBitmapButton and wxButton.
Closes#13198.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The comment in the function implied that it exchanged the items but in fact it
did not and kept their existing order instead.
Do revert them now, at least like this something visibly happens in the sample
when the items are sorted.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
As the arguments to the sort function contain the client data associated with
the items, they may be pointers and hence of greater size than long in Win64
builds. Use wxIntPtr instead of long everywhere to fix this.
Notice that this doesn't break compatibility for 32 bit code where long can
still be used as it is the same as wxIntPtr there after the previous commit.
Closes#4309.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67733 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The directories used to be always monitored recursively, even when this wasn't
requested, in wxMSW implementation. Change this but also implement efficient
support for monitoring the entire hierarchies using the native support for
this.
Also update the sample to allow monitoring directories recursively as well.
See #12847.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Additionally renamed wxOSX' private wxNativePrinterDC::Ok() function to IsOk().
Didn't deprecate the various Ok() functions: given the amount of changes already introduced in 3.0 a trivial one like this seems more suitable for after 3.0.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Still show the print preview app modally by default, i.e. disabling all the
other windows, but also allow disabling only the preview parent or nothing at
all.
Closes#13108.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67619 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED handler should see the new page selected
in the control, not the old one as was the case if the page was changed using
the mouse in wxMSW.
This should have been done together with the other changes of r66224, see its
commit message for more details.
Closes 13145.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow overriding either the iterator-like methods of the base class or the
single and possibly more convenient, albeit slightly less efficient, method of
the derived wxTextCompleterSimple class.
This makes it possible to completely delegate to wxTextCompleter from wxMSW
IEnumString implementation and actually makes the code there easier, even if
it it still not quite trivial because of multi-threading concerns.
It also would make it possible to show the completions progressively, as they
are retrieved, in a future generic implementation of auto-completion (MSW
native implementation doesn't do this unfortunately and waits until all of the
completions become available before showing them).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67515 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add wxTextCompleter class which allows to return the possible completions
dynamically and wxTextCompleter::AutoComplete() overload using it. So far this
is only implemented for wxMSW.
Also fix calling wxTextEntry::AutoComplete(wxArrayString) multiple times under
MSW, this didn't correctly update the list of shown completions before.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use "wxWindows licence" and not "wxWidgets licence" and also use British spelling for licence. Updated new occurrences in recently added files and a couple of previously (r64940) missed ones.
See #12165.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Months returned by wxDateTime::GetMonth() start from 0 while people mostly
expect to have 1-based months in the UI.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67292 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Applied patch by snowleopard2 fixing a bunch of typos such as misspellings and double words in the documentation. Combined the patch with some local queued typos waiting to be committed as well as adding new typo fixes inspired by the patch.
Function names with American spelling were not changed nor was third-party code touched. The only code changes involve some changes in strings that are translated ("Can not" -> "Cannot").
Closes#13063 (again).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Show how to create a custom control with transparent background.
Notice that this doesn't work in wxGTK currently.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The black rectangle drawn in EVT_PAINT handler in the sample prevented the
custom background from showing through the wxStaticBitmap. Maybe it was
initially done intentionally but this makes the sample look broken so just
don't do this.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67265 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method provides a simple way to set a background bitmap without defining
an EVT_ERASE_BACKGROUND handler and, more importantly, one that works
correctly in wxMSW for a window with children as it paints the background of
transparent children too.
Add a test of this method to the erase sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67253 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add a method which can be used to indicate that the help window should prevent
the application from exiting and use it in the help sample to prevent it from
closing prematurely.
Closes#13046.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This control explains better what is going on in the sample and also allows to
test whether wxStaticText itself has properly transparent background (this is
not currently the case under MSW).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Explicitly pass wxART_BUTTON to wxArtProvider to ensure that all the icons are
returned in the same size, otherwise they didn't look well and could result in
an assert too, see #12909.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Demonstrate the use of styles such as wxNB_FIXEDWIDTH or wxTBK_HORZ_LAYOUT
specific to particular controls and not only the ones common to all of them.
Closes#13036.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67192 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It wasn't immediately obvious that this dialog could be used for multiline
text entry too so mention it explicitly in the documentation.
Also show this in action in the dialogs sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The rubber banding selection message box was shown even after a simple click,
i.e. when nothing was actually selected which was quite annoying, so don't do
this.
Also remove unnecessary casts and use wxLogMessage() instead of
wxString::Printf() + wxMessageBox().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Instead of passing them by value, use const reference. This change
is safe to do, because these methods' signatures were different in 2.8
anyhow.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use recently added wxMarkupText to implement support for markup in wxMSW
wxButton.
Update the button page of the widgets sample to show markup support.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Make it possible to disable all the new markup-related code by setting
wxUSE_MARKUP to 0 in setup.h or using configure --disable-markup option.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67062 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is an incompatible change which removes the wxStaticText-specific
wxST_MARKUP style and adds wxControl::SetLabelMarkup() replacing it.
It doesn't actually change anything yet but it simplifies wxStaticText code a
lot by getting rid of many markup-related functions in it which had to behave
differently depending on whether wxST_MARKUP was used or not and also paves
way for adding markup support for the other controls in the future.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This fixes an assert which could happen when showing the rich text editor.
Also show the colour in a more readable form if possible.
Closes#12950.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66960 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
PNG images are used by the main wxWidgets library itself now and so linking
with the monolithic wx library introduces dependencies on PNG as well, even
for the console applications. Link them with linpng to avoid linker errors.
Closes#12889.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66848 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This parameter was never needed nor properly documented. Simply remove it from
SetTickFreq() and keep the overload still taking it for backwards
compatibility only.
Closes#12907.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Update configure and bakefile.m4 for the new version too.
Also add the missing makefiles and projects for the XTI sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66836 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Instead of constructs such as if "( s.length() )" and "if (s.length() > 0)" use "if ( !s.empty() )" instead. Similarly for "if (s.length() == 0)" or "if ( s.IsNull() )", use "if ( s.empty() )".
No code changes intended except for a few instances where a construct like "if ( s.length() && wxFileExists(s) )" was changed to not check the length of the string and let wxFileExists handle such cases.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add validators for integer and floating point numbers.
Add an example of their use to the validate sample as well as a new unit test
and documentation for them.
Use the new classes instead of wxTextValidator in wxGrid code.
Closes#12166.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775