Commit Graph

33306 Commits

Author SHA1 Message Date
Vadim Zeitlin
7664215648 Fix harmless unused parameter warnings.
Wrap parameter in WXUNUSED() in the power resource stub functions.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-04 12:36:19 +00:00
Václav Slavík
325c678f58 Don't prevent app exit when only preferences window exists.
Don't prevent termination of the app if all windows are closed, except
for the preferences one (which may very well be hidden at the moment).
This only affects platforms where the preferences are modeless (GTK+, OS
X) and where the preferences window, once created, continues to exist,
but is hidden.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-03 06:55:02 +00:00
Václav Slavík
796c8079a0 Tweak sizing for general SetWindowVariant() implementation.
Previously, the generic implementation closely mirrored OS X's scaling
factors, with the small size being 3/4 of the normal one and mini 2/3.
This works well with OS X's UI font and font rendering, but less so on
other platforms: wxWINDOW_VARIANT_SMALL is barely readable on Windows
and wxWINDOW_VARIANT_MINI is illegible.  In wxGTK, both sizes are
readable, but don't match small text used in native GNOME interfaces.

Change the sizing to use the same scaling factor of 1.2 between all
variant steps.  This is the same factor that CSS 1.2 defines for
relative sizes and is also used by Pango's (and so GTK+) size scaling in
markup.  This makes wxWINDOW_VARIANT_SMALL identical in size to <small>
markup used in GTK+.

On Windows, this changes default UI font scaling to be less steep and
while wxWINDOW_VARIANT_MINI is still tiny and hard to read (as it is on
OS X), wxWINDOW_VARIANT_SMALL is now readable, thanks to being only 1pt
smaller than the full size (for default GUI font).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-03 06:54:59 +00:00
Vadim Zeitlin
73e915a573 Fix creation of wxBitmap from monochrome wxIcon or wxCursor in wxMSW.
Don't suppose that we always have hbmColor because this is not true for
monochrome icons/cursors. Create our own bitmap in this case.

Closes #16512.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77517 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-30 15:14:18 +00:00
Vadim Zeitlin
51d715e46d Add wxPowerResourceBlocker for power management.
Add functions to acquire/release power resources, preventing/allowing back the
system to go to sleep or turn off the screen and a class wrapping them in a
safe way.

This patch implements the functions for MSW and OSX, adds documentation and
updates the sample to demonstrate the new functionality.

Closes #16413.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-29 23:22:15 +00:00
Vadim Zeitlin
a704ab9cc0 Use wxCOMPtr<> in wxFileName instead of manual Release() calls.
Make the code shorter and safer.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77510 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-29 23:22:09 +00:00
Vadim Zeitlin
614a0ef481 Don't change a shortcut file name when changing its path.
wxFileName::MakeRelativeTo() is only supposed to change the path of the file,
not its name, but it was doing the latter for the shortcuts as it implicitly
resolved them to the name of their target.

Fix this by ensuring we do not use wxPATH_NORM_SHORTCUT in MakeRelativeTo().

Closes #16239.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-29 23:22:05 +00:00
Vadim Zeitlin
ecc5e99b6c Ensure OLE is initialized in wxFileName::GetShortcutTarget().
If it isn't, the function doesn't risk to work. This is especially pernicious
because OLE is initialized on startup in GUI applications, but not in the
console ones only using wxBase, so this function can, completely unexpectedly,
give different results in them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-29 23:22:00 +00:00
Artur Wieczorek
f8aacfa02c Optimize allocating default cells in wxPGProperty::EnsureCells
Use embedded 'resize' function to alloc new slots at once instead of doing this in an iterative way.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-29 21:53:27 +00:00
Artur Wieczorek
7e859ec6c9 Fix drawing custom colours for wxEnumProperty choice items in wxPG.
In order to draw choice items with custom colours there is necessary to merge custom cell object (wxPGCell) associated with individual item with default cell object (in wxPGProperty::GetDisplayInfo).
wxPGProperty::GetDisplayInfo function should return customized cell object instead of returning pointer to the default cell object only.

Closes #16509

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77505 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-29 21:17:16 +00:00
Vadim Zeitlin
0f60be60a2 Don't leave wxHtmlWinParser with a dangling wxDC pointer.
Call SetDC(NULL) to prevent wxHtmlWinParser from using a pointer to the
already destroyed wxDC object.

See #16501.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77504 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-29 11:56:33 +00:00
Vadim Zeitlin
88e808c9ac No changes, just avoid unnecessary heap allocation in wxHtmlWindow.
Create the temporary wxClientDC on the stack, not the heap, there is no need
for the latter.

See #16501.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-29 11:56:27 +00:00
Vadim Zeitlin
a84902e665 Allow wxCmdLineParser::Parse() to be called more than once.
Clear the previously collected parameters in the beginning to avoid
accumulating the results from several command lines.

Closes #16503.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77502 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-29 11:56:23 +00:00
Mariano Reingart
8fc5475e15 Update author's credits comments for wxQT
Commit history was lost in the git to svn merge for trunk, so this reflect work done in two GSOC projects and/or by several authors.
Lines changed by each user was the main metric used to ack major contributions.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-29 03:37:46 +00:00
Vadim Zeitlin
eaf46c3213 Fix wxFont construction from default wxFontInfo in wxMSW.
Don't use -1 as the real point size.

Also update the font sample to allow testing such font.

Closes #16468.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-28 12:55:02 +00:00
Vadim Zeitlin
ce9fa570f0 Fix harmless warning about unreachable statement when wxUSE_EXCEPTIONS==0.
This statement only needed when we do use exceptions.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-28 12:37:16 +00:00
Tim Kosse
1124c57a6d Revision 59305 broke click count adjustment with the result that a right-click after a left-click is reported as double-click.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-28 12:29:21 +00:00
Julian Smart
7269fba894 Compensate for lack of bitmap inversion on Mac when selecting content.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-28 08:31:51 +00:00
Julian Smart
f65b2f589f The wxRTC formatting dialog now retains custom colours set within the colour dialog, and they can be accessed by the application.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-28 08:28:08 +00:00
Artur Wieczorek
1cef1d91e5 Fix deleting (from within wxPG event handler) properties not belonging to the current PG page.
Currently, it is not possible to remove properties from the page other then currently selected.
The scope of iterator used in wxPropertyGridPageState::DoClear() to enumerate properties must be limited to the required page and not always to the selected one.

Closes #16459

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77486 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-26 22:58:39 +00:00
Artur Wieczorek
1443209219 Fix deleting aggregate properties from within wxPG event handler.
Do not explicitly remove sub-properties of aggregate property because they will be removed automatically in their parent property dtor.

See #16459

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-26 22:54:01 +00:00
Jouk Jansen
fb05281b81 Update of OpenVMS build support
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77484 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-26 08:29:52 +00:00
Vadim Zeitlin
2c100e498b Disable the use of std::exception_ptr for MSVC 2010.
While <exception> does define this type in this version of the compiler, it's
non-conforming and doesn't define conversion to bool, so we can't test whether
it is valid or not.

We could work around it but for now just disable the use of exception_ptr with
VC10 and only use it for VC11+.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77483 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-25 18:29:31 +00:00
Vadim Zeitlin
2a0b758973 Fix order of radial gradient stops in wxMSW.
Ensure that the order of stops is consistent with the documentation and other
platforms behaviour, i.e. they are counted from inside to outside of the
circle and not vice versa, which happens to be the GDI+ convention.

Closes #16443.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77481 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-25 17:47:53 +00:00
Vadim Zeitlin
5d330238d5 Add missing wxUSE_EXCEPTIONS checks.
Build fixes after StoreCurrentException and RethrowStoredException()
introduction: don't use the latter if exceptions support is turned off.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77480 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-25 17:47:50 +00:00
Vadim Zeitlin
6283e4e6f1 Get rid of unnecessary wxUsecClockAsString() helper function.
We always build with wxUSE_LONGLONG now, so just use wxLongLong::ToString()
directly.

This avois a warning about unused local function in wxDEBUG_LEVEL==0 builds.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 15:32:19 +00:00
Vadim Zeitlin
73c319ccde Disable deprecation warnings for NS{Open,Save}Panel methods.
They will need to be replaced with the newer equivalents, but for now getting
dozens of warnings for each wxOSX build is just annoying, so get rid of them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77477 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 15:32:16 +00:00
Vadim Zeitlin
b5c18cfec4 Avoid unused variable warnings in !wxDEBUG_LEVEL builds.
Don't define a constant which is only used inside wxASSERT() at all if debug
checks are disabled.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 15:32:10 +00:00
Vadim Zeitlin
33a92d117b Suppress unused variable warning in wxRichTextObject code.
Put the variable used only inside #if 0'd code inside #if 0 itself
(it would be better to get rid of this entirely, of course...).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 15:32:07 +00:00
Vadim Zeitlin
e6cb2e4f8d Remove checks for QueryPerformanceCounter() success.
According to http://msdn.microsoft.com/en-us/library/windows/desktop/dn553408.aspx
this function will never fail under Windows XP or later, so simplify code by
not checking whether it did.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77472 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 15:31:58 +00:00
Vadim Zeitlin
47e13f2be0 Update wxFileDialog filter index when setting its path.
This ensures that GetFilename() and GetFilterIndex() always return consistent
results, even if the path was set programmatically, e.g. during unattended
tests using wxExpectModal<wxFileDialog>.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77471 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 15:31:55 +00:00
Vadim Zeitlin
3bcec846a0 Provide wxApp::StoreCurrentException() implementation for C++11.
When using C++11 we can provide implementations of wxApp::StoreCurrentException()
and RethrowStoredException() ourselves and thus make catching exceptions outside
of the event loop work by default.

Do this and update the documentation and the sample to reflect it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 15:31:52 +00:00
Vadim Zeitlin
73aea138c6 Remove the apparently unnecessary <locale> inclusion.
This header doesn't seem to be needed anywhere.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77469 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 15:31:47 +00:00
Vadim Zeitlin
1cecee5bb7 Add wxApp::StoreCurrentException() and RethrowStoredException().
These methods can be used to ensure that the exceptions thrown from event
handlers are safely rethrown from the code dispatching the events once the
control flow gets back there.

This allows to work around the problem with not being able to propagate
exceptions through non-C++ code and can be used, for example, to catch
exceptions thrown by the handlers invoked from inside wxYield() by a try/catch
block around wxYield() -- something that didn't work before, update the except
sample to show that it does work now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 15:31:44 +00:00
Vadim Zeitlin
82b644d79f No real changes, just simplify SafelyProcessEvent() slightly.
Remove a long comment about initializing "loop" in 2 steps and just do it in 1
step instead.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 15:31:37 +00:00
Vadim Zeitlin
3e2a7cca72 Show new style Windows directory selector even for non-existent paths.
Passing an invalid initial directory to wxDirDialog resulted in using the old
style Windows directory selector dialog instead of the new style (file dialog
like) one, which was unintentional, as incorrect initial directory shouldn't
prevent the dialog from being shown.

Fix this by handling ERROR_FILE_NOT_FOUND error specifically and still showing
the new dialog, just without the (non existent) initial directory value, in
this case.

Closes #16430.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 15:31:27 +00:00
Vadim Zeitlin
79e27d2a08 Also ignore arch-specific build directories in wxMSW wxStandardPaths.
In addition to ignoring debug/release subdirectories, also ignore their
(possible) parent Win32/x64 directories, and for the same reason: this allows
the code using wxStandardPaths to work even when the program is ran from the
build directory.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 15:31:24 +00:00
Vadim Zeitlin
4f0829e135 Avoid unnecessary assignment in wxOSX build.
Don't assign to the variable only to overwrite it with a new value.

Closes #16436.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 13:35:39 +00:00
Vadim Zeitlin
9c74f1329e Avoid warning about unused variable in wxiOS build.
Define variable only used if wxOSX_USE_COCOA_OR_CARBON inside the check for it.

Closes #16435.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 13:35:34 +00:00
Vadim Zeitlin
a8bd40d571 Avoid unused variable warning in wxUSE_DATAOBJ==0 build.
Declare variable only used when wxUSE_DATAOBJ==1 inside the check for it.

Closes #16434.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77460 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 13:35:29 +00:00
Vadim Zeitlin
005aa92678 Remove unused variable in wxDCImpl::CalculateEllipticPoints().
Closes #16433.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77459 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 13:35:24 +00:00
Vadim Zeitlin
df13791078 Merge wxQT branch into the trunk.
This merges in the latest sources from GSoC 2014 wxQt project with just a few
minor corrections, mostly undoing wrong changes to common files in that branch
(results of a previous bad merge?) and getting rid of whitespace-only changes.
Also remove debug logging from wxGrid.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-24 01:50:11 +00:00
Vadim Zeitlin
d513d3e2f0 Fix ribbon bar tab width computation if the first tab is hidden.
The logic for the first tab should really deal with the first visible tab as
the actual first tab might be hidden and in this case we shouldn't account for
it at all.

Closes #16432.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-21 14:14:15 +00:00
Vadim Zeitlin
a307120d50 Fix generic wxSearchCtrl size/layout code.
Override DoGetBestClientSize() instead of DoGetBestSize(), as we're really
computing just the size of our contents and like this we don't need to hard
code platform-dependent border sizes in this control itself.

Also use the client size in LayoutControls() for the same reason. This also
makes it unnecessary to pass it the width and height as it can find them on
its own. And x and y were never used in the first place, so remove them too.

Finally, center the bitmaps vertically.

Closes #16422.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-18 21:32:55 +00:00
Vadim Zeitlin
0223c10048 Don't exit event loop when exception occurs inside Yield().
If an unhandled exception occurs in an event handler called from Yield(),
don't exit the current event loop which can continue running after handling
this exception in the code calling Yield().

Closes #16419.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77075 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-16 00:24:56 +00:00
Paul Cornett
d0406f4606 Fix handling of identical consecutive key events
Events generated programmatically may have the same timestamp as the previous
event, which caused them to be ignored on the assumption that they were the same
event being sent to a parent window. Fix this by detecting when a new event could
be generated by the event loop.
Closes #15802


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-15 17:09:39 +00:00
Vadim Zeitlin
a4606fbb44 Refactor Unix OpenGL code to avoid using static attributes array.
Put the context attributes in wxGLCanvasX11 itself instead.

See #16402.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77073 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-15 12:14:11 +00:00
Vadim Zeitlin
74421a7f35 Fix creating wxGLCanvas without any attributes in wxMSW.
This was broken by the changes of r77018, see #16402.

Just check that we do have the attributes before examining them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-15 12:14:06 +00:00
Vadim Zeitlin
a728a9ac15 Allow using ESC as accelerator in wxMSW again.
This ended up being broken due to an interplay between different unrelated
changes (at least r15120 and r41134) which were both correct, but didn't work
well together and resulted in not only preventing IsDialogMessage() from
handling ESC, but also our own accelerator tables.

Fix this by doing the check for IsDialogMessage() brokenness in
MSWProcessMessage() itself, just before calling it, instead of doing it in
MSWShouldPreProcessMessage() which is (and must be) called before
MSWTranslateMessage() which checks for accelerators using ESC.

Closes #3813.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-14 16:05:32 +00:00
Vadim Zeitlin
a4f707b8a8 Add support for paragraph spacing attribute to wxTextCtrl in wxMSW.
Use PFM_SPACEAFTER/PFM_SPACEBEFORE to implement support for them.

Closes #16417.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-14 12:17:17 +00:00