Commit Graph

51707 Commits

Author SHA1 Message Date
Vadim Zeitlin
4d4c704c3e Use wxLocale::GetInfo() to get date format in wxDatePickerCtrlGeneric.
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
2010-09-10 19:42:23 +00:00
Vadim Zeitlin
5dea30b309 Don't add spurious NULs at the end of wxTextDataObject text under OS X.
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
2010-09-10 19:28:52 +00:00
Vadim Zeitlin
3e4f133a43 Initialize wxGenericProgressDialog button members in Init() too.
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
2010-09-10 17:26:11 +00:00
Vadim Zeitlin
21a5e7e0a7 Fix closing logic in wxMSW native wxProgressDialog.
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
2010-09-10 17:26:07 +00:00
Vadim Zeitlin
cc31a982ec Block in wxMSW wxProgressDialog::Update(max) until the dialog is dismissed.
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
2010-09-10 17:26:03 +00:00
Vadim Zeitlin
2de77c6a54 Fix errors in handling of maximum field in wxGenericProgressDialog.
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
2010-09-10 17:25:58 +00:00
Vadim Zeitlin
4f4d6f44f9 Rename wxGenericProgressDialog::ProgressDialogState to just State.
Repeating "ProgressDialog" twice is redundant.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65505 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-10 17:25:53 +00:00
Vadim Zeitlin
979901c8df No changes, just use less long progress dialog states names.
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
2010-09-10 17:25:45 +00:00
Vadim Zeitlin
928da15b8e Use determinate mode in native wxMSW wxProgressDialog by default.
The dialog was created in indeterminate ("marquee") mode for some reason.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-10 17:25:41 +00:00
Vadim Zeitlin
f434800ca3 Add a possibility to show a progress dialog on dialog sample startup.
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
2010-09-10 17:25:35 +00:00
Vadim Zeitlin
e77570de2e Don't use wxGenericProgressDialog::m_windowStyle for wxPD_XXX styles.
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
2010-09-10 17:25:28 +00:00
Stefan Csomor
827833e2e2 adjusting to new gui mutex for osx, see #12411
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-10 13:41:50 +00:00
Vadim Zeitlin
7ad8a38ae5 Create temporary wxEventLoop in wxGenericProgressDialog if needed.
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
2010-09-10 11:44:46 +00:00
Vadim Zeitlin
79e58a409e Initialize wxGenericProgressDialog::m_winDisabler properly.
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
2010-09-10 11:44:40 +00:00
Vadim Zeitlin
395da337e9 Don't return false from IsOk() for accelerators without flags.
wxAcceleratorEntry::IsOk() checked for m_flags != 0 for some reason. Simply
remove this test.

See #12444.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-10 11:44:35 +00:00
Vadim Zeitlin
da209561e3 Fix infinite loop in wxDateTime::Format() when fields width was used.
Just add a missing increment of the loop variable.

See #12451.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-09 22:20:12 +00:00
Vadim Zeitlin
ca9fc039c1 Fix cast of pointer to int in artprov sample.
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
2010-09-09 22:20:07 +00:00
Vadim Zeitlin
ba75967c9c Initialize all fields of struct tm used by wxDateTime::Format().
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
2010-09-09 21:57:52 +00:00
Vadim Zeitlin
e436c454e1 Fix wxKill(wxSIGNONE) always returning true for child processes in wxMSW.
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
2010-09-09 21:49:44 +00:00
Vadim Zeitlin
b54ceb72ce Remember last values used in exec sample "Kill" menu item dialogs.
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
2010-09-09 21:49:25 +00:00
Vadim Zeitlin
732c0c4874 Very minor fixes to wxKill() documentation.
Fix "the the" typo.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65491 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-09 21:49:07 +00:00
Vadim Zeitlin
e19dbcf76b Use minimal required process access mask in wxMSW wxKill().
We don't need PROCESS_TERMINATE permission if we are not going to call
TerminateProcess() for it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65490 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-09 21:48:48 +00:00
Vadim Zeitlin
38fd5bad72 Don't filter out Cairo libraries from GTK libraries list in configure.
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
2010-09-09 20:59:10 +00:00
Vadim Zeitlin
83a7613b71 Use the same logic for closing dialogs as for handling Escape key.
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
2010-09-09 20:53:26 +00:00
Vadim Zeitlin
0b94182cdc Remove the unused "monolithic" MSW wxMediaCtrl file.
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
2010-09-09 20:34:00 +00:00
Vadim Zeitlin
6161dd2d48 No real changes, just don't use obsolete FORCE_LINK_ME in wxMediaCtrl.
Use wxFORCE_LINK_THIS_MODULE() instead of the obsolete FORCE_LINK_ME.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65486 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-09 20:33:56 +00:00
Vadim Zeitlin
9b10161eb6 Force linking of all wxMSW wxMediaCtrl backends in mediactrl sample.
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
2010-09-09 20:33:51 +00:00
Vadim Zeitlin
6d9db33c47 No changes, just remove cruft from mediactrl sample.
Remove the test for wxUSE_GUI together with the comment questioning its
presence.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65484 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-09 20:33:47 +00:00
Vadim Zeitlin
beea183b40 Remove debugging wxLogMessage from wxMediaCtrl::Create().
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
2010-09-09 20:33:41 +00:00
Vadim Zeitlin
b672b8f490 Don't exclude "contrib" from wxMSW setup.exe generation.
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
2010-09-09 10:18:31 +00:00
Dimitri Schoolwerth
6cb0fee84d use svn:keywords instead of eol:keywords
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65481 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-09 08:57:07 +00:00
Robert Roebling
89b6b731b6 Unregister configure callback,part of #12447: wxGTK patch: Segfault on Drag&Drop
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-08 20:00:44 +00:00
Dimitri Schoolwerth
59719014c5 Make Xcode identifiers in generated project files be the same after each run.
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
2010-09-08 17:11:15 +00:00
Vadim Zeitlin
5eda55f775 Use correct Unicode define for wxScintilla compilation.
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
2010-09-07 21:37:22 +00:00
Stefan Csomor
77eb08cc36 resetting the wrapper flag later, otherwise the native destructors dealloc too much, fixes #12448
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-07 16:05:01 +00:00
Stefan Csomor
d623e8b18a modeling subclassing along msw, unsubclassing filedialog at end of ShowModal, fixes #12236
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-07 06:51:13 +00:00
Stefan Csomor
a94c4b8529 using non-sleep version for GUI mutex, solves #12411
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-06 13:50:12 +00:00
Steve Lamerton
d377e9fe75 Simplify ButtonTestCase::Bitmap. The old test was not correct as it tested all bitmaps to see if they were valid, however these do not get set by SetBitmap and so the tests only passed if the platform set valid defaults.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65472 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-05 13:31:13 +00:00
Steve Lamerton
6e269b25f0 Fix typo from previous commit.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65471 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-05 13:14:14 +00:00
Steve Lamerton
48d133393c Move the second wxListBox sort test back to the ownerdrawn section and re-enable it under wxGTK.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-05 13:11:42 +00:00
Steve Lamerton
663a3ae1da Wrap BitmapToggleButtonTestCase in a preprocessor check so compilation shouldn't fail on platforms that don't support it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65469 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-05 12:47:46 +00:00
Vadim Zeitlin
8297e64b31 Remove unused wxProgressDialogTaskRunner::m_parent field.
This seems to be a left over from old version of the code and is not used any
longer.

See #12414.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-04 13:33:40 +00:00
Vadim Zeitlin
a5655d37db Fix crash in wxMSW wxProgressDialog without wxPD_APP_MODAL style.
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
2010-09-04 13:33:36 +00:00
Vadim Zeitlin
aebe0d3b6c Improve main and extended messages handling in new wxMSW wxMessageDialog.
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
2010-09-04 13:33:29 +00:00
Vadim Zeitlin
b8737371e2 Add a link to Microsoft guidelines from wxICON_QUESTION documentation.
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
2010-09-04 09:36:25 +00:00
Vadim Zeitlin
78dfd1fdd6 Don't link with long obsolete ctl3d32 library when using MinGW.
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
2010-09-03 22:48:44 +00:00
Václav Slavík
71dd05d58a Fix wxOwnerDrawnComboBox keyboard navigation with duplicate items.
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
2010-09-03 19:33:18 +00:00
Václav Slavík
0a9c5e3564 Fixed wxscintilla compilation for wxDFB.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-03 19:33:11 +00:00
Steve Lamerton
5bb302a7aa Fix compilation under MinGW, also add missing SVN properties.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-01 15:25:01 +00:00
Julian Smart
edae63b076 wxRichTextCtrl::ApplyStyle now applies a paragraph style at the cursor
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
2010-09-01 14:48:54 +00:00