m_FontSize is in 1..7 range, not 0..6, so add 1 to it when setting it from the
index into m_FontsSizes array.
Also update the comment explaining the valid range of m_FontsSize.
Closes#14442.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71878 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The results were incorrect for italic or bold fonts as we hardcoded
FontStyleRegular instead of using the real font style.
Closes#14421.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71821 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Handle creating nested TreeItemUnlocker objects correctly. This fixes the
problem when a wxTreeCtrl method unlocking some item is called with another
item is already unlocked, e.g. from a selection changed event handler.
Closes#14400.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Creating a new wxString from c_str() of the old one resulted in dropping all
string data after the first embedded NUL. Fix this by using Clone() method
that exists specifically for this purpose. It also makes the code more clear.
Closes#14380.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71701 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Show the "extension button" in the ribbon panel if this style is specified.
Also generate a specific event if this button is clicked.
Closes#14283.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71642 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use t_str() instead of wx_str() to make the code work correctly in UTF-8 build
in which wx_str() returns a pointer to UTF-8 buffer while we need a wchar_t
pointer for Windows.
Closes#14371.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxPluginLibrary objects had to be unloaded in exactly the reverse order to
which they were loaded in. This was not documented and was a serious
limitation for any realistic use of plugins anyhow, so fix it and allow
unloading them in any order now.
Instead of keeping a pointer to the last wxClassInfo not created by this
plugin, now keep a pointer to the first wxClassInfo that was created by it.
This makes the code slightly more complex but this pointer, unlike the old
one, remains valid even if another plugin was unloaded.
Closes#14261.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Do not delete the client data in wxDataViewListCtrl, this class mainly exists
for compatibility with wxListCtrl and as the latter doesn't delete its client
data, neither should the former.
See #11088.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fixed composite object positioning in centred and right-aligned
paragraphs.
Added field example to sample, and enabled pixel font size selection.
Added custom text and dimension scaling.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71505 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We need to process GDK_PROPERTY_NOTIFY events when yielding for
wxEVT_CATEGORY_CLIPBOARD, otherwise we never receive large selections.
As GDK_PROPERTY_NOTIFY can be also used for non-clipboard stuff, exceptionally
assign 2 categories to it and process it in either case.
Closes#14284.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We don't have any sufficiently long-lived pointer to return from this
overload, so don't return anything from it -- it's better to break the
compilation of the existing code rather than make it crash during run-time.
Closes#14214.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
These classes can't be forward-declared any more as they're not really classes
any longer but just compatibility #defines and can't be made classes again as
this would break the existing code using wxBookCtrlEvent in 2.9.
See #14242.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Scroll the control automatically if there is not enough space. This is
consistent with (single line) wxTextCtrl and wxSpinCtrl under the other
platforms.
Closes#14211.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It is wrong to use dir.GetName()+"/" to obtain a slash-terminated directory
name as this results in (usually harmless but at best ugly) double slashes at
at the beginning of the string for the root directory. Add GetNameWithSep() to
obtain the correct result in all cases.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow specifying the drag operation flags and retrieving the drop effect when
it's over for wxDataViewCtrl drag-and-drop.
Currently this is only implemented in the generic version.
Closes#12583.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
These events are now generated earlier and can result in crashes if the
controls they use are not initialized yet.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This class allows using virtual wxFSFiles with any wx functions taking
streams. E.g. it makes it possible to load images and animations from
wxFileSystem.
Closes#14185.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This function can be used to obtain language/locale-independent representation
of an accelerator. This is particularly useful for storing it in configuration
files.
Closes#14228.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use IFileDialog in wxDirDialog implementation if possible, it shows a much
more user-friendly dialog than the one used by SHBrowseForFolder().
Closes#11401.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Make wxMSW consistent with the other ports and set the menu itself, not the
window it is attached to, as the event object for the menu open/close events.
See #1595.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71115 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The main window itself should be added using DoAddHWND() and not
AddOtherWindow() as it is not, precisely, "other". This fixes removing and
updating it twice unnecessarily.
Closes#14184.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71097 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It turns out that the changes r71028 were unnecessary (and actually harmful)
in most cases, they're only needed when a DIB is used as a source DC. So move
the manual coordinates adjustments to the branch of code using StretchDIBits()
and don't do it anywhere else.
Also don't list this as an incompatible change as wxMSW actually already
worked as the other ports in the majority of cases and list it as a simple bug
fix instead.
Closes#14188.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71095 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Generating many wake ups from the worker threads could result in overflowing
the buffer of the pipe used to communicate with the main thread which, in
turn, resulted in other serious problems (deadlocks...).
Avoid this by only writing to the pipe if it is empty.
Closes#14166.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
These methods, taking broken down time representation, avoid the problems
arising due to DST complications when using wxDateTime to represent the time
as special care needs to be taken in this case to avoid using the date part
corresponding to a DST change date at which time is discontinuous.
Document the problem with the old functions and use the new ones in the
sample.
See #14137.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use POSIX function if available instead of only using Solaris-specific
thr_setconcurrency() which is not found in modern Linux systems any more.
Closes#2115.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70960 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't separate the function name and its arguments types in 2 different
columns in the assert dialog, this doesn't really work with const methods as
"const" can't be separated from the function like this. The old code just
didn't take "const" into account at all and mangled all the const methods by
showing ") cons" (no typo) at the end.
Just show everything in one column to avoid the problem and also simplify the
code.
Closes#14104.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Simply move the code from non-default constructor to Create(). This allows to
create the dialogs using 2-step creation if necessary.
Closes#14069.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70898 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Using this function was never the right way to show a modal window and it
didn't really work correctly. Instead of futilely trying to fix it, just
deprecate it.
Closes#1561.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This function checks for existence of anything with the given name, not
necessarily just a file or a directory.
Extend the unit test to verify that it returns true for /dev/null on Unix
systems.
Closes#953.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70600 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Provide wxDataViewCtrl::SetAlternateRowColour() to specify the colour to use
for odd rows explicitly but determine it automatically from the background
colour if no explicit colour was specified.
Closes#12834.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use composited windows if supported by GTK+ for wxWindows with this background
style.
Also add wxWindow::IsTransparentBackgroundSupported() and show how to use it
in the sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The code didn't handle cells higher than the page height correctly and entered
an infinite loop when trying to adjust page breaks in their presence, e.g.
when trying to print a very tall image.
Closes#13935.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70528 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Handle positional parameter specifications in wxFormatConverter to ensure that
e.g. "%N$s" are correctly transformed to "%N$S" if needed. This fixes the use
of positional parameters under OS X.
Closes#10965.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70523 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Our overridden xsgetn() method was never called when using these compilers
because they used their own, non-standard, _Xsgetn_s() instead. Because of
this the stream was always read character by character which was very
inefficient.
Fix the problem by overriding _Xsgetn_s() for these compilers and explicitly
forwarding it to xsgetn().
Closes#13926.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70515 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The client data is supposed to be untyped, there is really no reason (other
than compatibility with C conventions of 40 years ago) to use char** here.
So don't do it and provide the versions taking "void**" keeping "char**" ones
for backwards compatibility only.
Also deprecate GetSelectionClientData() that returned char* and add a new
GetSelectionData() returning void* instead.
Closes#13876.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70514 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Set the closest (and larger, if possible) icon if the icon of exactly the
system icon size is not available. This fixes setting the icons when using
custom DPI settings under MSW as the standard icon size may be different from
the standard 32*32 in this case.
This also improves wxIconBundle::GetIcon() to make its behaviour when the icon
with exactly the given size is not found more flexible as a side effect.
Closes#13891.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The internal wxDateTime representation is in the UTC, so use
wxGetUTCTimeMillis() in UNow(), using wxGetLocalTimeMillis() made it
inconsistent with Now() and wrong.
Really closes#13862.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70418 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows to post binary data or text data in e.g. UTF-8 encoding (which is
by far the most common case) easily.
Deprecate the existing SetPostBuffer(wxString) as it didn't explicitly specify
the encoding to use for the data to be posted.
Closes#13870.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method was only available in wxUniv before and just always returned true
in the other ports. Implement it for wxMSW and wxGTK too now and document it.
Also add a unit test.
Closes#795.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70350 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Due to a typo the size was expressed in 1/10th of a point and not in points.
Fix this and add a unit test checking that GetStyle() returns the same font as
was set by SetStyle().
Closes#2120.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow inserting and deleting tools and not only appending them.
Add possibility to enable/disable and toggle tools.
Send wxUpdateUIEvent for the tools.
Add various properties accessors.
Closes#13835.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This currently is only implemented under OS X and sets the proxy icon there
but could be implemented to do something useful under the other platforms too
in the future.
Closes#13797.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70295 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use the column labels to determine the minimal width required by the control
to show them all in full.
Also declare all image list and column-related wxListCtrl methods in
wxListCtrlBase now as we need some of them in DoGetBestClientSize()
implementation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Z-move events don't have (x, y) position, but they do have Z-position which
needs to be set.
Also don't use (x, y) position for these events in the sample.
See #748.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
"%z" specifier can now be used when printing the dates out to specify the time
zone and is also recognized when parsing dates.
Closes#1215.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The children which are not currently shown on the screen shouldn't be affected
by Shift-selecting in multi-selection control.
Closes#1312.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Generate wxUpdateUIEvent for the ribbon buttons to allow updating their state
using wxEVT_UPDATE_UI. Also update the same to show this.
Closes#12003.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxGridSelection::m_rowSelection and m_colSelection for storing the
selected rows/columns respectively instead of storing them in m_blockXXX
arrays. This makes more sense and allows to easily implement the proper
handling of Ctrl-clicking in the row or column selection modes.
Closes#12638.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70177 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Set the wxMenu correctly for wxEVT_MENU_CLOSE events in wxMSW.
Set the menu id correctly to allow wxMenuEvent::IsPopup() to work for both
wxEVT_MENU_OPEN and wxEVT_MENU_CLOSE in wxOSX.
Closes#11313.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70151 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The implementation is far from perfect as it relies on hard-coded margins but
is better than nothing as it allows wxNotebook best size determination and
SetPageSize() method to work correctly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Delegate the log string creation to wxLogFormatter. This allows defining a
custom object of a class derived from it to customize the log output instead
of having to override DoLogRecord() in wxLog itself.
Closes#13792.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70086 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use NSDatePicker to implement both of these controls. Almost all of
wxDatePickerCtrl styles are not supported in the native version but the basic
functionality does work and looks much better than the generic version (which
is still available as wxDatePickerCtrlGeneric if needed) under Mac.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method allows to configure the initial directory to be shown when
browsing for files in an initially empty wxFileDirPickerCtrl.
It is also available for wxDirPickerCtrl but is less useful there.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Also renamed wxEXEC_NOHIDE to wxEXEC_SHOW_CONSOLE for symmetry (keeping the
old name for compatibility, of course).
Extend exec sample to allow easily testing the different flags and adding more
of them later.
See #13676.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69964 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Unlike in the other ports, these methods currently don't generate any events
under OS X because these events are never generated at all there.
Closes#12642.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Send wxEVT_CHAR_HOOK event from wxOSX/Cocoa code.
Also test for wxEVT_CHAR_HOOK in the keyboard sample and show the effect of
not skipping it.
Closes#12431.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69889 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow %e and %g formats (as well as their upper-letter equivalents) in
addition to the default %f format for number display in wxGrid.
Closes#13583.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If gettimeofday() is available we can achieve better than millisecond
precision (even if it usually isn't as high as microsecond), so use it as
clock source in wxStopWatch.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69841 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fixed wxGetLocalTimeMillis() to really return the local time and provide
wxGetUTCTimeMillis() doing what this function used to do before. Closes#13610.
Also add wxGetUTCTimeUSec() for even higher resolution time stamps as it is
basically the same as wxGetUTCTimeMillis() anyhow, at least for MSW and
non-ancient Unix systems providing gettimeofday().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69837 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775