Instead of trying (and failing) to manually decode the format used by "%x",
simply use wxLocale::GetInfo(wxLOCALE_SHORT_DATE_FMT) and just change "%y" to
"%Y" if necessary.
The new code is more than 10 times shorter and also gives correct results
unlike the old version.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For some reason we added an extra NUL character to the data copied from
wxTextDataObject but this doesn't seem necessary because the Pasteboard API
is passed the correct data size and so the string doesn't need to be
NUL-terminated.
In fact, adding this NUL broke drag and drop between wx and native controls,
including the case of dropping text in our own wxTextCtrl as this uses its
built in support for dnd and not our code (the fact that we can't even set a
drop target for a wxTextCtrl is a separate bug). In this case we got a string
with an extra NUL in the control resulting in all sorts of hard to debug
problems.
So simply don't add the extra bytes, dnd works fine without them both between
wx windows and from/to another OS X applications.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65510 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxGenericProgressDialog::m_btn{Abort,Skip} were not initialized neither which
resulted in crashes inside EnableAbort() which was called if the "Cancel"
button was pressed in a native MSW dialog but the dialog wasn't cancelled (and
hence the button needed to be reenabled).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The dialog must always close if the C++ object was destroyed, independently of
whether it was cancelled or finished.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For consistency with the generic version and because it makes more sense than
blocking in the dialog destructor (which is the only other alternative for the
dialogs without wxPD_AUTO_HIDE to work), we should block in Update() when the
maximal value is reached for dialogs without wxPD_AUTO_HIDE style until the
dialog is dismissed.
Document this behaviour even more clearly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65507 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Provide a SetMaximum() function for setting just m_maximum and return its
value from GetRange() instead of using m_gauge->GetRange() which doesn't work
when the native MSW version is used nor when the range is > USHRT_MAX under
MSW in any case.
More generally, this should fix a lot of bugs for progress dialogs using such
range as the values were not interpreted correctly in many places.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We can refer to them using wxProgressDialog class name and not the base
wxGenericProgressDialog so do this as it is shorter and more clear because
these states have nothing to do with the generic version when used by the
native MSW implementation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65504 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add a command line option to the dialogs sample to allow testing of different
wxProgressDialog styles more easily. This also tests for showing them before
the main event loop is started (see r65499).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65502 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Storing progress dialog styles in the normal window style didn't work because
they clashed with the TLW styles. The original progress dialog implementation
worked around this by using separate m_has{Abort,Skip}Button variables instead
of relying on wxPD_CAN_{ABORT,SKIP} style bits but this didn't work for the
other styles and was unclear so the new native MSW implementation blithely
used m_windowStyle to test or them and other bits which didn't work at all,
see #12416.
Solve this by using a separate m_pdStyle variable for storing the progress
dialog styles and use it for all wxPD_XXX tests in both the generic and MSW
code. This fixes some bugs (although not all of them yet) and allows to get
rid of m_has{Abort,Skip}Button.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65501 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxGenericProgressDialog needs to have an active event loop in order to repaint
itself and process clicks on its buttons but it's more helpful to create a
temporary event loop if there is no currently active one instead of just
asserting. In particular, this allows to use wxProgressDialog from overridden
wxApp::OnInit().
Add temporary event loop creation and remove the now unnecessary asserts
verifying that there is an active event loop as there always will be one.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65499 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This field wasn't initialized by Init() which might have been harmless
considering the current code structure but still untidy, do set it to NULL
there.
Also move the forward declaration of wxWindowDisabler class in
wx/generic/progdlgg.h to the top of the file for consistency with the other
forward declarations.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65498 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This prevented the sample from building when using MinGW-64 and also probably
prevented it from working correctly on other 64-bit systems.
Closes#12453.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Passing not fully initialized struct tm to strftime() results in Valgrind
errors and possible nastiness, see #12455.
Simply use memset() to set all fields of this system-dependent struct to 0
initially.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The fact that a handle to a process can be opened doesn't mean that the
process is still running. In fact, for a child process that we store a handle
for ourselves we will always be able to open (another copy of the) handle even
if it already terminated.
Check for the process termination using WaitForSingleObject() instead in both
normal and wxSIGNONE cases.
Also simplify the code by not using GetExitCodeProcess() at all as we don't
need the process exit code.
Closes#2834.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Remember the PID entered in the dialog and also remember the last used signal
number. This makes these dialogs slightly less painful to use when testing
even though ideally we'd have a single dialog for choosing both values instead
of two consecutive modal dialogs.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This undoes the hack of r35357 which surreptitiously removed all Cairo
libraries from the GTK libraries list. This shouldn't be necessary any more as
we use Cairo calls in our own code and so can't run without it anyhow and in
fact is even actively harmful as it results in linking errors under Fedora 13
(which seems to use a slightly different linker?).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Pressing "Esc" key closed the dialog with only wxID_OK button (but no
wxID_CANCEL one) by default but pressing the "close window" button only closed
it if wxID_CANCEL was present.
Fix this by using the same code in OnCloseWindow() as in OnCharHook(), after
extracting it into the new SendCloseButtonClickEvent() method.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The contents of this file was split over src/msw/mediactrl_{am,qt,wmp10}.cpp a
long time ago and this file is unused and not compiled into the library so
having it in the repository is useless and confusing -- remove it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65487 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Force the linker to include all the backends in the sample executable instead
of discarding them because they are not used directly to allow testing all of
them in the sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This was added apparently by mistake in r45478 and resulted in showing the
backend being used by the control in a message box whenever it was created
ever since.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65483 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This was presumably needed to exclude the top level contrib directory but also
seems to apply to src/tiff/contrib and excluding this directory breaks
configuration of libtiff as it looks for src/tiff/contrib/Makefile.in.
As we don't even have top level contrib any more, simply don't exclude it any
longer.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
From the AppleScript that composes the Xcode projects call a Python script that bases the identifiers on an associated name instead of being random each run like Xcode does. After the Python script reopen the project again in Xcode to have the identifiers sorted (Xcode wants them to be), resulting in the project.pbxproj file being completely different inside but in the IDE the order of files still will be the same.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Compilation of wxScintilla with Borland failed because -D_UNICODE was not
passed on command line resulting in mismatches between wxChar and Windows
TCHAR. It's a mystery why this didn't happen with the other compilers but
defining _UNICODE for them too can't hurt.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65477 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use the correct method to retrieve the parent window to disable and check that
this pointer is not NULL before dereferencing it.
Closes#12414.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65467 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't use the main message if there is no extended message: this looks bad as
the main message is emphasized to contrast with the extended one which doesn't
make sense visually if there is no extended message.
Also recognize the common use of wxMessageBox() with a multiline text composed
of the first string that plays the role of the main message with the rest
being the extended one and handle this appropriately automatically. This
results in a better appearance by default for a lot of message boxes,
including even the one in our own minimal sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Microsoft documentation provides explanations as to how the icons should be
used in the message dialogs which can be useful for people wondering which
icon style to use an when.
See #12417.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
ctl3d32 was used for Win16 development and is not used by wxMSW since many
years, don't link with it unnecessarily when using MinGW.
Also remove a FIXME comment about an issue which doesn't seem to need any
fixing.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If the combobox contained duplicate strings (i.e. multiple items with the
same string value, but differing indexes), then navigating to the second
and subsequent ones skipped to the first occurence instead. We need to
preserve the index.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
without needing a selection, and setting the default style now avoids duplicating
character attributes in subsequently typed text when they exist in the paragraph style.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775