The use of wxSpinCtrlEventDisabler class ensures that we never forget to
reenable the events after disabling them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
After the changes of r53758 wxMSW didn't generate any wxEVT_TEXT events but
this was still the case for the generic version (and hence for
wxSpinCtrlDouble under MSW too) and wasn't documented.
Fix all versions to avoid sending events for programmatic actions, add unit
tests checking this behaviour and document it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method allows to get the full width needed by wxPropertyGrid and is
useful for determining the space to allocate for it, e.g. when creating a
popup showing the property grid, as shown by the changes to the sample.
Closes#15368.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74628 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
SetForegroundColour() and SetBackgroundColour() were -- presumably
accidentally -- protected in wxComboCtrlBase, even though they are
documented public virtual methods of wxWindow. This prevented their
use from user code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.
If nothing else, this will make an eventual transition to Git simpler.
Closes#14487.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add wxHTTP::SetMethod().
Also simplify the code by determining the method to use in Connect() instead
of doing it in BuildRequest() itself.
Get rid of the now unused wxHTTP_Req enum.
Closes#15354.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74597 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There was a bug similar to the one in the preceding commit with radio boxes
under wxMSW too: if all radio box buttons were disabled (or hidden, although
this should be much more rare in practice, unlike the disabled case which was
deemed to be rare in r74583 commit message but turned out to actually happen),
the radio box still pretended to accept focus but didn't really do it.
Fix this by allowing to override wxWindow::CanBeFocused() and do it in
wxRadioBox to check whether we have any enabled visible items.
Also add a check for CanBeFocused() to wxControlContainer code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxControlContainer::AcceptsFocusFromKeyboard() returned true even if the
control didn't have any currently enabled -- and hence accepting focus --
children. This resulted in strange wxEVT_NAVIGATION_KEY propagation as it
unexpectedly wasn't handled in the control which pretended to accept focus and
instead bubbled up back into the parent, resulting in the focus returning to
the first child of the parent instead of skipping the static box with disabled
children and going to the next enabled child.
Fix this by checking that we have children that can be focused right now and
not only children that are focusable. Notice that this doesn't take care of
calling wxWindow::SetCanFocus() correctly when the children enabled/disabled
state changes so there might still be other problems, notably under wxGTK
where SetCanFocus() does something non-trivial, but it at least improves
things under wxMSW.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74585 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Radio boxes refused to take focus from keyboard as their
wxControlContainer::AcceptsFocusFromKeyboard() always returned false because
the base wxStaticBox class disabled setting the focus to the control itself
and wxRadioBox doesn't have any children at wx level in wxMSW.
Fix this by reenabling "self focus" in wxRadioBox to make it possible to
accept focus from keyboard. This is not ideal as it doesn't take into account
e.g. radio boxes without any items or with all items disabled or hidden, but
this should be rare and would require virtualizing all children access at
wxControlContainer level, i.e. would be quite non-trivial so don't do this for
now as this, at least, fixes the navigation in common/normal case.
Also remove the unnecessary AcceptsFocus() override from wxRadioBox as this is
now done at wxControlContainer level.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74583 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Extract the call to wxWindow::SetCanFocus() into a separate
UpdateParentCanFocus() function as it can be necessary to do it from places
other than UpdateCanFocusChildren() too.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74582 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use __WINDOWS__ symbol as the primary symbol indicating Windows instead of
using all of _WIN32, __WIN32__ and __WINDOWS__.
Also automatically define __WINDOWS__ if __WXMSW__ is defined as this port
only can be used under Windows and doing it like this fixes compilation in the
case when the platform ends up being not defined at all, closes#15342.
Finally, don't assume Windows by default but give an error if we can't detect
the platform. This shouldn't happen in practice but seems a safer thing to do
if it ever does happen.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74581 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't redo the tests already done in wx/wxcrtbase.h in wx/string.h too,
especially as they were not done correctly there (they didn't take into
account the case of MinGW in strict ANSI mode). Just call wxCRT_StricmpA().
This also allows us to get rid of HAVE_STRCASECMP_IN_STRING[S]_H tests in
configure.
Closes#15349.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The cursor didn't change to a link one when the mouse was over link areas in
an image map.
Fix this by generalizing wxHtmlCell::GetMouseCursor() into GetMouseCursorAt().
Closes#15350.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This code was probably copied from wxUniv but was wrong as we can't rely on
the items being always inserted in order. This commit on its own fixes
removing the first radio group menu item but it also makes possible to
properly implement the insertion of new items in the middle of an existing
radio group which couldn't be done with m_startRadioGroup approach at all.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The latter will be convenient to use in the upcoming changes to wxOSX radio
items management code and add the former for the symmetry.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The changes of r74532 were incomplete/wrong and the fix of r74536 didn't
entirely fix the logic here, so try to do it again, hopefully correctly this
time.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74537 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The latter file is also used when building from the command line while the
former is only used in Xcode build, as its name indicates (which didn't help
me to notice it, however).
Also restore the test for wcsftime() in configure as it is available even on
older systems but do not test for strnlen() -- as it is not.
These changes amend those of r74523.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74534 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Nothing is going to work without the console apps/base traits support for the
event loop but at least make it compile.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The tests for these functions may succeed on the system we're running under
but the functions may not be actually available on the system the application
is going to run under (if it's < 10.7).
So use our own replacements for these functions unless 10.7 was explicitly
chosen as the minimal possible version.
An alternative solution could have been to use weak linking but this is more
difficult and there is no real gain (performance would need to be measured
first).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74523 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The changes of r73483 broke inclusion of the manifest in the programs built
using MinGW because wxUSE_RC_MANIFEST was never defined. Somehow nobody
complained about it but this resulted in using comctl32.dll 5.80 instead of
6.0 and e.g. problems with toolbar appearance (see #13512).
Do use the manifest by default with MinGW and, in fact, all the other
compilers if any other ones still work, as only MSVC is known to embed the
manifest automatically and we take care of it separately.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Do keep compiler-specific wxCHECK_MINGW32_VERSION() in wx/compiler.h as it's
needed by wx/cpp.h which includes wx/compiler.h only. But put the rest of the
stuff in gccpriv.h in its old place as including it before wx/setup.h didn't
work correctly and was unnecessary anyhow.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This solves the problem with wx/defs.h -> wx/platform.h -> wx/setup.h which
resolves to msvc/wx/setup.h -> wx/version.h -> wx/cpp.h include path which
resulted in __VISUALC__ not being defined in wx/cpp.h.
This problem was not new but went unnoticed for a long time and was only
discovered when wxCHECK_VISUALC_VERSION() started being used in wx/cpp.h too
as now the compiler started warning about wrong #if syntax due to it being
undefined.
Putting the compiler-specific definitions in a separate file allows this file
to be included from wx/cpp.h to ensure that these symbols are always defined
in it and also makes things a little better organized.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is needed to at least silence g++ warnings but may actually even fix a
real problem as these classes can be inherited from and are deleted via a
pointer (to "this" itself, in Release() implementation).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The main user-visible effect of this change is that giving configure
--disable-vararg-macros argument now really disables the use of variadic
macros whereas it didn't disable them in wx/cpp.h before.
It is, of course, also less confusing to not have two very similar but
different symbols.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The functions are available in wxBase builds too, but wx/windowid.h
isn't. Rather than always including that header, just use int, for which
wxWindowID is a typedef. This keeps the functions available in wxBase
for compatibility and is consistent with how IDs are handled in other
parts of wxBase, particularly wxEvent.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74486 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxNewId(), wxRegisterId() and wxGetCurrentId() functions all work with
window IDs, so they should use the dedicated type. Previously, they
worked with long, which is not even the same type (wxWindowID is int),
causing implicit type conversion warnings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add a hack to ignore WM_MENUSELECT messages we get for the top level menu
items: we must not clear the status bar help message when we get those because
it had just been restored to the original message that was there before the
menu was opened from the base class wxEVT_MENU_CLOSE handler, but this message
comes after it when keyboard is used to close the menu.
Closes#15315.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The compiler warns about content after defined(__has_included), so avoid
the issue by putting these Clang tests inside one big #ifdef
__has_included block.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Using the GNU libstdc++ or Clang's libc++ implementations of the
standard library, <cmath> inclusion undefines the isfinite macro,
resulting in compilation errors when wxFinite() is used. <cmath> can be
included unintentionally, e.g. wx/hashmap.h may result in its inclusion
when using STD containers.
Work around this mess by checking if one of these <cmath>
implementations were already included and using std::isfinite() in that
case.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This happens to work under MSW and Unix where there is only one
wxStandardPaths class for both the console and the GUI applications but
doesn't return the correct result under OS X where the Core Foundation
version, returned by wxStandardPaths::Get(), has to be used for the GUI
programs. And historically this confused a lot of people, so just ensure that
they can't accidentally create an object of the wrong type any more.
Closes#13537.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Record the object propagating the given event upwards in the event object
itself and use it in wxMDIParentFrame to determine whether the event being
handled is already coming from wxMDIChildFrame and avoid sending it back for
processing it there again in this case.
This is ugly and makes wx event processing even more complex but this is the
only way I could find to ensure that
(a) Both the child and the parent frames get the events from the toolbar
(even though the toolbar parent is the parent frame and hence normally
the child wouldn't get notified about them at all and so the forwarding
at wxMDIParentFrame level is required to make this work).
(b) The child gets the event only once, whether it comes from a toolbar (and
hence indirectly via the parent frame) or from the child menu (and hence
directly to the child, at least in wxMSW).
This commit fixes the event propagation unit test case, at least under MSW and
GTK.
See #14314.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74357 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit changes wxExecute() to handle SIGCHLD to be notified about the
child process termination instead of detecting when the file descriptor
corresponding to the other end of a pipe opened in the parent process was
closed in the child as this was not reliable and could (and did) result in not
detecting the termination of the child processes that closed all their file
descriptors before exiting.
This commit also removes a lot of platform-specific code duplicating the
generic event loop sources support and reuses it for wxExecute() purposes too.
Final big change is that wxEndProcessData was merged into wxExecuteData and we
don't have two similar but quite different classes any more but just one,
which is used both to pass the information from wxExecute() to wxAppTraits
methods and to store this information until the child termination.
Closes#10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74350 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method always returns some valid traits, even if we don't have wxTheApp
(which is possible in the console applications) or if its GetTraits() was
overridden to return NULL (which shouldn't be, but still guard against this).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74349 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Instead of hardcoding the call to WakeUpIdle() in the signal handler itself,
just wake up the event loop when we catch a signal. This will still result in
WakeUpIdle() being called, before the next event loop iteration, but it will
also allow us to do other things on wakeup from signal as it will be done in
the upcoming wxExecute() changes to support wxEXEC_NOEVENTS in console
applications.
See #10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74347 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes but use wxEventLoopSource::AddSourceForFD() instead of
wxFDIODispatcher::RegisterFD() for this pipe because this is the preferred way
and because it will allow reusing this class for wxExecute() purposes later.
See #10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74346 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is necessary to ensure that wxUSE_EVENTLOOP_SOURCE which wraps the entire
contents of this header is defined if it's included directly and not after
already including wx/evtloop.h.
See #10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74345 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, just make the header self-containing instead of relying on
the file including it to include <fcntl.h> itself.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74344 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This just reads everything remaining in the stream in a blocking way and will
be used to get the data remaining in the stream buffers after the child
process had been already closed (and hence can't write any more to it and
there is no risk of deadlock).
See #10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use OS X socket APIs for monitoring file descriptors. They are more flexible
than CFFileDescriptor functions and can be used with any descriptors, not
necessarily the socket ones.
See #10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Any event sources should be registered with all the event loops, including the
ones that will be started in the future, and not only the current (and
potentially not even existing yet) one. So make AddSourceForFD() method static.
To still allow it to do different things in console and GUI applications, as
it must, virtualize it via the new wxEventLoopSourcesManager class which has
different implementations in the two cases, returned via wxAppTraits as usual.
Notice that this required moving the implementation of this method from
src/osx/core/evtloop_cf.cpp to src/osx/core/utilsexc_cf.cpp as the former file
is base-only and didn't have access to wxGUIAppTraits.
See #10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This class can also be useful when it's used in the main thread only, so
leave the lock-less part of the code in wxWakeUpPipe and derive a separate
wxWakeUpPipeMT from it for the use in wxConsoleEventLoop where it can be used
by multiple threads.
See #10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74339 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Get rid of the surprising src/common/execcmn.cpp which had a .cpp extension
but was supposed to be used as an included file only and move its contents to
a new private header to make using wxStreamTempInputBuffer class simpler.
See #10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74337 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, just put these classes in a private header. They're still not
part of the public API but at least it will be easier to reuse them inside the
library itself in the upcoming commits.
See #10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74336 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method allows to request exiting from the given event loop even if it's
not the currently active one, unlike Exit() which would assert in this case.
With it, it becomes possible to ask the loop to terminate as soon as possible
even if a nested loop is currently running.
See #10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Call it from public Run() after setting the loop as active and resetting
m_shouldExit flag.
No real changes, just cut down on the code duplication among the ports and
make it easier to implement the upcoming changes. see #10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74333 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Just rename these methods to avoid clashes with DoRun() that will be added to
the base class soon, no real changes.
This is done in preparation for improving nested event loops support, see #10258.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is a simple wrapper for wxTimer::Start(timeout, wxTIMER_ONE_SHOT) but is
often more readable and is definitely better than Start(timeout, true) which
many people still use in spite of wxTIMER_ONE_SHOT existence.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74330 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This should ensure that the entry is always valid, removing the need for r74315.
Also simplify DoInsertItems() by using DoInsertItemsInLoop().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Menu, toolbar and update UI events should be forwarded to the active child
under all platforms in MDI applications and not only MSW, so move TryBefore()
overload from wxMSW wxMDIParentFrame to wxMDIParentFrameBase.
This should make things more consistent in general and notably fixes the lack
of toolbar events in wxDocChildFrame since the changes of r73928.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Embarrassingly, wxIMAGE_QUALITY_HIGH was never used as it had the same value
as wxIMAGE_QUALITY_BILINEAR due to the changes to these constants in r67203.
After fixing its value in the enum, also change the switch on this enum
elements to avoid g++ warnings about unhandled enum values.
See #12845, #15281.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't use m_UseBkColour flag which remained always set once
SetBackgroundColour() had been called, but just rely on m_BkColour itself
being valid to determine whether we should use it. This allows to reset the
background colour after setting it.
Closes#15287.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This fixes the wrong handling of the selection in wxSimplebook when the
currently selected page was deleted.
Also extend the unit tests to check for this bug.
Closes#15188.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Unfortunately, forwarding MSW messages only takes care of the menu events but
not the toolbar ones -- which should be handled in the same way but were not.
So restore the old behaviour, the problem with menu items disabled in the
parent frame but enabled in the child one will be fixed differently.
This reverts r73927.
See #14314.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
g++ 4.8 warns about unused typedef's in local scope resulting in hundreds of
warnings when building wx, suppress them by using WX_ATTRIBUTE_UNUSED for
these typedefs.
Closes#15137.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This improves the solution of the problem already solved in r74197 by
separating setting of m_headerWin variable from the window creation instead of
using an explicit recursion check.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74231 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Contrary to the documentation, this function incorrectly appended the
.bundle extension on OS X for libraries as well as modules.
Fixed to use .dylib for libraries (wxDL_LIBRARY) and continue to use
.bundle for loadable modules (wxDL_MODULE). Change GetDllExt() to take optional wxDynamicLibearyCategory argument.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is similar to the existing GetLinesPerAction() but is for, surprise,
columns.
Also change the documentation to say that the value returned by both of these
methods is 3 under "most platforms" as some wxOSX currently uses 1 and not 3.
Closes#15239.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74156 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Hiding the tree when it's frozen, as done in r72665, results in its own
problems, e.g. loss of focus. So don't do this but resize the control to a
very small size when freezing it and restore it to its old size afterwards.
Closes#15166.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Also send wxEVT_UPDATE_UI events for the extra controls in wxFileDialog.
The combination of these changes allows extra controls to update their state
depending on the current selection in the dialog. Show a simple example of
doing it in the dialogs sample.
Closes#15235.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This relied on SetInsertionPoint(-1) working like in wxTextCtrl but it didn't.
Add an explicit check to it for consistency with the other classes and to make
SetInsertionPointEnd() work.
Closes#15234.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Scroll by entire "sections", i.e. panes of the ribbon, instead of scrolling by
a fixed number of pixels as it's much more useful and user-friendly to uncover
the next section entirely instead of asking the user to press on the arrow
several times before being able to use it.
Closes#15232.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74068 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is just a refactoring of wxMSW code to make it possible to use deferred
window positioning from other places in subsequent commits.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Using wxAtomicDec() is not enough, its result also must be checked as it will
return 0 only in one of the threads if multiple threads call it in parallel,
while the old test for m_count==0 could pass for more than one thread,
resulting in deleting the same pointer more than once.
Closes#15227.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Revert the changes of r72979 and fix wxFileDialog::GetDirectory() return
value bug (see #14786) differently to avoid breaking wxFilePickerCtrl which
relies on getting wxEVT_BUTTON event when the associated dialog is dismissed.
Closes#15218.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Extract wxModalDialogHook from wx/testing.h into its own wx/modalhook.h,
extend it to allow to be notified not only about showing modal dialogs but
also about dismissing them and document it and show its use in the dialogs
sample.
Also replace all the WX_TESTING_SHOW_MODAL_HOOK macros occurrences with
WX_HOOK_MODAL_DIALOG.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74037 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't reuse m_lastcount in wxCountingOutputStream to store the stream length,
this doesn't make any sense and results in LastWrite() returning completely
wrong results as it expects m_lastcount to be the number of bytes written by
the last operation.
Add m_lastPos member to store the stream length instead.
Also correct wxCountingOutputStream documentation.
Closes#15215.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74036 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The code seemed to rely on Destroy() being called for deleting the dialog, but
it's actually not used for child windows, so do it in dtor instead.
Closes#15156.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow conversions to/from long long and unsigned long long values in wxUniChar
for consistency with the other integral types.
Also make the code shorter by using helper wxDO_FOR_INT_TYPES() and
wxDO_FOR_CHAR_INT_TYPES() macros to avoid duplicating the same code for all of
the integral types and having to handle wchar_t (and wxLongLong_t now)
specially because sometimes we may need to overload on it and sometimes not.
Finally, add more tests to check that all the wxUniChar methods compile and
work with all the different types.
Closes#15206.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74029 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Mainly just to suppress g++ warnings about a class with virtual functions but
non-virtual dtor, this class isn't really supposed to be used polymorphically.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74016 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Not sure if this results in any real problems but at the very least memory
checking tools give errors about reading uninitialized memory in
wxXmlResourceHandlerImpl::CreateResource() if we leave them uninitialized, so
do initialize all the pointers.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The modal dialog case is not really different, the dialog may still need to be
dismissed if the associated object doesn't exist any longer.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
While this is not necessary to use wxPreferencesEditor in normal scenario, it
can be useful if the program needs to handle modal dialogs in some special way.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows derived classes to override it to do something before/after
showing the dialog, which can be useful on the platforms where modal dialogs
are used for wxPreferencesEditor implementation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74008 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Customize the title is useful for "Settings"-style windows which are used for
editing the properties of the given object, that should be identified in the
window title, as opposed to the global program preferences.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74006 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We must delete all children and attributes in the node being overwritten and
not just the first one of each.
Add a unit test exercising this code to be able to check that valgrind doesn't
report memory leak any more after the fix.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method did nothing if its argument was less than the current array size,
as it was just a synonym for SetSize() which was documented to behave like
this, but this was inconsistent with std::vector and wxVector resize() which
does shrink the array, so change wxArray version to shrink it too.
Closes#15195.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
They are all virtual and so cannot be inlined anyway and having them in
the header like this confuses the g++ linker into always pulling some of
the methods in merely because geometry.h was included.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Unfortunately Clang intelligent flow analysis prevents us from using different
asserts for invalid parameter value and unhandled one, which could happen if
more elements are added to wxMouseButton enum in the future.
Closes#15201.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow to optionally raed/write float/double values in IEEE 754 single/double
precision formats, respectively, instead of always using the extended
precision format for both of them.
This makes the code more flexible, allowing for better interoperability with
the other programs, and also allows to implement floating point functions in
these classes even when wxUSE_APPLE_IEEE is turned off (as can be the case
because of the licencing concerns for the code in extended.c).
Closes#10625.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73938 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, just put BigEndianOrdered() and SetConv() methods and the
corresponding fields in a common wxDataStreamBase class instead of duplicating
them in wxDataInputStream and wxDataOutputStream.
This will make it simpler to add more features common to both classes in the
future, see #10625.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73933 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Ensure that the events are always (provided there is an open document)
processed in the following order:
1. wxDocument
2. wxView
3. wxDocManager
4. wxDocChildFrame
5. wxDocParentFrame
6. wxApp
Do this by forwarding the events from wxDocParentFrame to wxDocChildFrame
first and forward them from there to wxDocManager which -- and this part
remains unchanged -- in turn forwards them to the active wxView which finally
forwards them to wxDocument. This requires another condition in the event
handling code as we still must forward from wxDocParentFrame to wxDocManager
itself if there are no active children at all, but this is the only way to
have the same event order in all cases, whether the event is originally
received by wxDocChildFrame or wxDocParentFrame.
Document this and add a unit test verifying that things indeed work like this.
See #14314.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We want to handle menu (and toolbar) events in the active MDI child before
handling them in the parent frame itself and the existing code achieved this
by forwarding wxEVT_MENU events at wx event processing level to the active
child. However this was not enough as the underlying MSW WM_COMMAND message
was still sent to the parent frame only and this could result in wx event not
being generated at all if the parent frame had a disabled menu item with the
same ID as (an enabled) item in the child frame, see #14314.
So forward WM_COMMAND directly to ensure that the correct window gets the
event in the first place. And this makes wxEVT_MENU forwarding in TryBefore()
unnecessary.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73927 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method tries to find the current view harder than GetCurrentView() and
always returns a non-NULL view if there are any open documents at all.
This is used by wxDocManager internally to find the view to apply the user
commands to and will also be needed in the upcoming changes outside of
wxDocManager, so just make this method public, as it seems that it could be
useful in user code too, especially if we could use some better fallback than
the first opened document (e.g. the last document the user interacted with
would be better).
This also clarifies the confusion between GetCurrentView() and GetActiveView(),
see #13296.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73925 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Pass the menu event to the window associated with the menu first, before
falling back on wxApp.
This required adding yet another flag to keep state in wxEvent but it seems to
be unavoidable as wxMenuBase::SendEvent() calls ProcessEvent() twice and we
must have some way to distinguish the first call from the second one.
Added a test case verifying that the menu events are indeed processed in the
expected order.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Previously the max number of characters that could be entered into the editor
was lost when it was cloned, making it impossible to really limit the user
entry.
Closes#15175.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This ctor didn't initialize the flags correctly and could result in a crash
when a default constructed object was destroyed.
Closes#15174.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73898 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This helper class allows to create wxFonts using shorter and more readable
code, e.g.
wxFont font(12, wxFONTFLAG_DEFAULT,
wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, true,
"DejaVu Sans");
can now be written simply as
wxFont font(wxFontInfo(12).FaceName("DejaVu Sans").Underlined());
Remove the ctor from font flags added in r70445 as it's not needed any longer
now that we have this one and adding it resulted in compilation errors in the
existing code which compiled with 2.8 because of ambiguities between that ctor
and wxFont(int size, int family, int style, int weight. bool underlined, ...)
one, e.g.
wxFont(12, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL)
didn't compile any more but it does compile again now.
See #9907.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The problem (see #11681) was due to not allowing the native control handle the
focus loss event. This, in turn, was due to the changes of r58969 which tried
to work around a crash which happened if the grid was destroyed from the code
of one of the user-defined event handlers called during the editor dismissal.
Fix both problems at once by calling event.Skip() in OnKillFocus() to let the
native handler have the event too and postponing the editor dismissal a little
by calling DisableCellEditControl() indirectly from a posted event handler
instead of immediately.
As this reverts the now unnecessary changes of r64646, it closes#15162.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix incorrect conflict resolution between the changes of r73823 and r73850:
the first renamed wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED to
wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK while the latter renamed it
to wxEVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED. The proper new name is
wxEVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, use it instead.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73851 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use the same short names as are used by the event table macros for the event
type constants themselves. This makes them much more comfortable to use, e.g.
Bind(wxEVT_BUTTON) compared to Bind(wxEVT_COMMAND_BUTTON_CLICKED).
The old long names are still kept for backwards compatibility and shouldn't be
removed as it doesn't really cost anything to continue providing them, but all
new event types should only use the short versions.
Closes#10661.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Amend the changes of r73839:
- Don't use covariant return type for wxHtmlWinTagHandler::GetParser() as
VC6, which we still support, doesn't like it. Besides, this seems
unnecessary.
- Don't make GetParser() virtual at all as this doesn't appear to be necessary
neither.
- Add "@since 2.9.5" to the documentation of the new method.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73849 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We could keep using the column previously used for sorting even after
UnsetAsSortKey() was called on it. Ensure that this doesn't happen by
resetting the owner wxDataViewCtrl sort column index too.
Closes#15160.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The naming of this macro was inconsistent with other similar macros in
wxListCtrl and wxTreeCtrl and even EVT_DATAVIEW_COLUMN_HEADER_CLICK in
wxDataViewCtrl itself. Moreover, it was even documented under the wrong name
without "ED".
Clear this mess by removing the "ED" suffix while still keeping the old macro
name for compatibility.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73823 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add the simplest and most fool proof of chaining the pages in static wizards:
just chain several calls to the new, non-static, wxWizardPageSimple::Chain()
overload.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73806 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This symbol is not documented but seems to be defined in all the existing
versions of imagehlp.h, so use it instead of relying on a hack with checkng
whether DBHLPAPI symbol is defined.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The module names are not necessarily ASCII strings, so use wxString instead of
"char*" and W-version of GetModuleHandle() if appropriate.
See #15138.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
By default the columns are auto-sized to fit just their label, which is fast
but not very user-friendly. Allow customizing this behaviour by handling the
(new) wxEVT_GRID_COL_AUTO_SIZE event.
Closes#15077.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Associating a validator with the text control in wxTextEntryDialog resulted in
GetValue() always returning an empty string which was completely unexpected.
Fix this by setting the value string manually to avoid interfering with any
possibly used validators.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73774 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't include wxBORDER_NONE in neither wxToolBar ctor and Create() nor
wxFrame::CreateToolBar() flags parameter, override GetDefaultBorder() in
wxToolBar itself instead to use the border style appropriate for the current
platform by default. This has the same effect -- the default border style is
used unless another one is explicitly specified -- but is more clear and
consistent.
Also add wxTB_DEFAULT_STYLE for consistency with the other classes.
Closes#15037.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't change the background colour when the control is being enabled or
disabled, it doesn't seem necessary and it's unclear why was this added by
r10179 in the first place. It does result in problems however as it could
somehow make the selection of wxTextCtrl invisible when it lost focus and so
fixes a serious usability problem which happened to all wxTextCtrls for which
a wxEVT_UPDATE_UI handler using wxUpdateUIEvent::Enable() was defined.
Closes#14898.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775