Commit Graph

59537 Commits

Author SHA1 Message Date
Vadim Zeitlin
ddce6780f6 Fix inserting tools removed from wxToolBar back into it in wxMSW.
Make sure to reset the "to be deleted" flag we set on the tool when removing
it from the toolbar to avoid layout problems if the tool is added back later.

Closes #16735.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-16 20:16:23 +00:00
Vadim Zeitlin
090a8353e5 Move wxRendererMSW::DrawTextCtrl() implementation to wxRendererGeneric.
This ensures that wxRendererGeneric::DrawGauge() is actually usable as
otherwise calling it always resulted in an assertion failure because it used
DrawTextCtrl() which was not implemented in wxRendererGeneric. So this fixes
using DrawGauge() in non-MSW ports which was added by r77023 (see #16406) but
apparently never worked.

Also remove wxRendererMSW::DrawGauge() as it's exactly the same as the version
inherited from wxRendererGeneric.

Closes #16725.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-16 20:16:20 +00:00
Vadim Zeitlin
a580f0b994 Remove unnecessary wxUSE_MFC option.
This didn't do (almost) anything, so just remove it, using MFC and wxWidgets
together works just fine without it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78277 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-16 20:16:16 +00:00
Vadim Zeitlin
ea47af08cb Add wxEVT_MAGNIFY mouse event.
Currently this is implemented for wxOSX only.

Closes #14322.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-16 13:59:26 +00:00
Vadim Zeitlin
2de13dd12e No real changes, just fix some typos in comments in the samples.
Closes #16734.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-16 13:51:09 +00:00
Vadim Zeitlin
0795416871 Fix building with -std=gnu++11 -stdlib=libstdc++ under OS X.
Take into account the possibility of using C++11 compiler with non-C++11
standard library as this may happen when targeting OS X < 10.7, in which case
C++11 libc++ can't be used.

Closes #16730.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-16 13:49:59 +00:00
Stefan Neis
99d08bcc4b No real changes, just fixed a couple of typos in comments, fixes #16726.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-14 11:12:31 +00:00
Paul Cornett
11cbe6ef70 Allow setting icon before m_widget is valid.
There is no need to require a valid m_widget,
the "realize" handler will take care of things later.
Closes #16731


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-13 17:40:29 +00:00
Artur Wieczorek
c7bc7b467a Remove unused member variable from wxSimpleCheckBox (used in wxPGCheckBoxEditor).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-12 22:58:10 +00:00
Artur Wieczorek
1a4921b45a Fix typo in a comment
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-12 22:56:44 +00:00
Artur Wieczorek
cebc3503d2 Create wxPropertyGridManager with default size in the propgrid sample
Since r78150 wxPropertyGridManager can be created with default size with no issues.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-12 22:40:00 +00:00
Artur Wieczorek
6ba0f3016b Use wxBufferedPaintDC to implement double buffering in wxPG.
This also fixes drawing the PG when buffer is not available and there is necessary do draw directly on window DC.
wxPropertyGrid::DrawItems method is simplified and wxPropertyGrid::DoDrawItems method is reimplemented since its 3-rd argument (isBuffered) is unneeded anymore.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-12 22:36:28 +00:00
Tim Kosse
d9d6247f37 In wxMBConvStrictUTF8::ToWChar the length of a multibyte UTF-8 sequence is obtained from a table, with the leading byte as offset. Later in that function, the prefix of the leading byte is compared against the expected prefix for the given length.
Unless the table is faulty, this comparison can never fail. It is thus redundant and not needed. As optimizing compilers aren't smart enough yet to detect this, this commit removes the redundant check.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-11 20:31:21 +00:00
Paul Cornett
def8247c61 avoid generating wxEVT_CHAR when WriteText() is called from wxEVT_CHAR handler, closes #16717
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-11 18:34:37 +00:00
Vadim Zeitlin
0918246efa Restore Kolya Kosenko copyrights on parts of wxQt code.
The original code was originally submitted of #12042.

Closes #16721.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-10 01:04:11 +00:00
Vadim Zeitlin
51404f8792 Cast size_t value when using it with printf() in a test.
Use %lu with a cast to avoid warnings in both 32 and 64 bit builds.

Closes #16720.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78261 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-10 00:14:14 +00:00
Artur Wieczorek
c193b83b6b Refactor: mark wxPropertyGridManager::SetId() as overridden virtual method.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-09 17:11:59 +00:00
Artur Wieczorek
de2f5898c4 Reconnect wxPropertyGridManager event handlers when wxPG id is changing.
Because some event handlers are bound to the particular id's they need to be reconnected when wxPG id is the subject of change.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-09 17:07:59 +00:00
Vadim Zeitlin
2fe72022e3 Update wxGetTranslation() documentation.
Document "i18n" trace mask.

Correct warning about [not] using wxT().

See #16714.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78258 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-09 12:51:56 +00:00
Vadim Zeitlin
6efc50fafd Update i18n overview in the manual.
Remove obsolete warning about gettext 0.10, add a link to Poedit instead.

Also fix Doxygen markup: @see can't be used inside a list item.

See #16714.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78257 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-09 12:51:50 +00:00
Václav Slavík
26d6b58889 Use int& type for argc in wxInitialize and wxInitializer
Other functions that take (argc,argv) arguments (wxEntry, wxEntryStart)
take argc by reference, because they may manipulate the arguments list.
wxInitialize() used passing by value, so any modifications would be
silently lost. Make all the functions consistent in their handling of
argc by using int& everywhere.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78255 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-07 16:40:24 +00:00
Václav Slavík
5c472ee4c6 Don't crash on OS X on exit if -NS* argument used
When converting argv[] from char* to wchar_t* in ConvertArgsToUnicode(),
keep an extra (shallow) copy of argc and the argv[] array so that it can
be safely freed in FreeConvertedArgs().

The reason is that other functions such as wxApp::Initialize() may
modify argv[] and remove some arguments from it; this is indeed exactly
what wxOSX does. After such changes, gs_initData.argv would no longer be
in the original state and could contain e.g. duplicate pointers or be
missing some of the pointers that we should free.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-07 16:40:21 +00:00
Vadim Zeitlin
bb7e69b7d6 Remove .cvsignore files from expat sources.
These files shouldn't be included in the distribution and it's simpler to just
remove them, as it is pretty unlikely that a new Expat release is going to be
made, and even less likely that it would still use CVS if it does happen, than
to filter them out from the distribution creation scripts.

Closes #16711.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78253 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-07 13:47:04 +00:00
Vadim Zeitlin
494b66b5fb Fix appearance of wxMSW wxToggleButtons with bitmaps in pressed state.
Correct the "pushed" state determination in our own drawn code, it didn't work
for wxToggleButton which doesn't return BST_PUSHED from BM_GETSTATE. But it
does have BM_GETCHECK returning its state directly, so add a new virtual
MSWIsPushed() method and implement it differently for it.

Closes #13755.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-07 01:52:42 +00:00
Vadim Zeitlin
81f6d00518 Move MSWGetDefaultLayout() outside of #if wxUSE_EXCEPTIONS block.
Build fix for wxUSE_EXCEPTIONS==0 after r78236.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78250 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-06 13:07:10 +00:00
Vadim Zeitlin
8ae9dae3b4 Build fix for wxOSX after the changes of r78230.
Fix wrong signature of DoHandleMenuEvent() by getting rid of this function
entirely, it's not just a trivial wrapper for ProcessMenuEvent() anyhow, so
just use the latter directly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 23:09:04 +00:00
Vadim Zeitlin
29cd13cc8f Fix checked disabled wxToolBar tools with custom images in wxMSW.
Windows doesn't use the correct image for checked disabled tools, at least up
to and including Windows 7, so don't put such tools in the "checked" state at
all: this doesn't matter as they are disabled anyhow, but shows the correct
image for them.

Closes #12989.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78248 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:19:25 +00:00
Vadim Zeitlin
bf08ea2666 Don't generate wxEVT_MENU_{OPEN,CLOSE} for disabled top menus in wxMSW.
Windows still sends these messages even if a top level menu is disabled, for
some reason, so filter them out manually.

Closes #2168.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:19:19 +00:00
Vadim Zeitlin
79f93d5535 No real changes, just make wxMenuBar::MSWGetMenu() const.
There is no reason not to.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78246 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:19:16 +00:00
Vadim Zeitlin
a2b0b8dbaa Handle updating tooltip text in wxCompositeWindow correctly.
While calling SetToolTip(wxToolTip*) overload already worked correctly for
wxCompositeWindow, using SetToolTip(wxString) did not if a tooltip already
existed, as it didn't use the virtual DoSetToolTip() in this case, resulting
in e.g. impossibility to update wxSpinCtrlDouble tooltip using this method.

Fix this by introducing DoSetToolTipText() virtual which is used by that
overload now and overriding it in wxCompositeWindow.

Also don't override DoSetToolTip() in wxSpinCtrlGenericBase any more, it is
not necessary as it's already done by its base class wxCompositeWindow.

Closes #16595.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:19:10 +00:00
Vadim Zeitlin
68232dec2b Don't keep out of date column widths in generic wxDataViewCtrl.
The cached widths need to be invalidated whenever an item is expanded or
collapsed, whether it's done programmatically (which was already handled) or
interactively by the user (which wasn't).

Closes #16678.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78244 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:19:04 +00:00
Vadim Zeitlin
1d05c077a0 Use another bool constant instead of BOOL one in wxBitmapComboBox.
Just s/FALSE/false/

See #16690.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:59 +00:00
Vadim Zeitlin
7e869a5d4d Measure wxBitmapComboBox height correctly if it has images.
This fixes a regression introduced in r77548 (see #14279): wxBitmapComboBox
must be higher than a normal wxComboBox if it has big enough bitmaps.

Closes #16690.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:52 +00:00
Vadim Zeitlin
2d3ef92acc Prefer file types with a defined open command in Unix wxMimeTypesManager.
It can happen that more than one file type maps to the given extension, in
this case prefer the one which has an open command defined for it as it is
typically more useful.

See #16703.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:48 +00:00
Vadim Zeitlin
13cae6fbb2 Load *.desktop files recursively in wxMimeTypesManager under Unix.
Not all .desktop files are directly under /usr/share/applications, some or, in
some cases, most of them, may be under its subdirectories, so look for them
there as well.

See #16703.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78240 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:43 +00:00
Vadim Zeitlin
08fedc69ef No changes, just fixes for typos in comments in wxMSW headers.
Closes #16706.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78239 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:38 +00:00
Vadim Zeitlin
e841e90fef Make all bitmaps of the same size in the toolbar sample.
This is a requirement under MSW and resulted in problems when a secondary
toolbar was created.

Closes #16707.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:32 +00:00
Vadim Zeitlin
c76ad77c01 Don't use right-to-left markers in wxMSW wxMessageDialog code.
This mechanism is provided as an alternative to specifying MB_RTLREADING
style, e.g. if the source code can't be modified but the [string] resource
from which the message box message is loaded can be. We don't need to do this
if we do add MB_RTLREADING however.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78237 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:29 +00:00
Vadim Zeitlin
f1fd45892f Fall back to default process layout direction in wxMSW.
Add helper wxApp::MSWGetDefaultLayout() static method and use it instead of
wxTheApp->GetLayoutDirection() in wxMSW code.

This serves two purposes: first, wxMessageDialog doesn't crash when it's shown
before wxTheApp is created (or after it's destroyed) any more. And second, we
use the correct layout direction if the main application has enabled it by
calling SetProcessDefaultLayout() or using two U+200E characters in the
beginning of its "FileDescription" resource field by default now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78236 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:25 +00:00
Vadim Zeitlin
59086bd01a Use the layout direction of wxTextCtrl itself, not the app, in wxMSW.
A wxTextCtrl inside an RTL window in an otherwise LTR application should still
be considered RTL, it's not clear at all why do we need to ask the application
for the layout here, so change this for consistency.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78235 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:20 +00:00
Vadim Zeitlin
eb171a4592 Don't dereference wxTheApp unconditionally when showing wxMessageDialog.
The application might not yet (or already) exist, don't crash in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78234 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:16 +00:00
Vadim Zeitlin
e91fb2bbee Fix crash when using wxMessageBox before creating wxTheApp.
CheckIfCanBeUsedAsParent() used by wxMessageBox ctor shouldn't dereference
wxTheApp unconditionally, otherwise it's impossible to show a message box
before creating the application object or after destroying it without crashing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78233 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:13 +00:00
Vadim Zeitlin
c6cd1a305e Don't put wxMenu::MSWGetMenu() inside wxUSE_OWNER_DRAWN check.
This doesn't make any sense, this function is not related to the owner drawing
code at all and should always be available.

This corrects the changes of r70316, see #13851.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:07 +00:00
Vadim Zeitlin
0c61827188 Remove unnecessary assert from wxMenuBar::MSWGetMenu().
This assert was triggered after the changes of the previous commit as we can
get WM_MENUSELECT with menu bar handle as parameter from Windows and still
search for the menu with this handle -- and there is nothing wrong with this,
so just return NULL but without asserting in this case.

This corrects the changes of r67355, see #13080.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78231 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:18:01 +00:00
Vadim Zeitlin
2d20e3fc51 Harmonize wxMenuEvent handling between all major ports.
Send these events to the menu itself first, then to the menu bar containing
it or the window invoking it if it's a popup menu and, finally, to the top
level window in all of wxGTK, wxMSW and wxOSX.

In particular, this ensures that help strings are now shown in the parent MDI
frame status bar by default, even when the menus are attached to the client
MDI frame or shown as popup menus.

At the implementation level, this logic is now encapsulated in a new static
wxMenu::ProcessMenuEvent() method which can be easily modified and reused in
other ports.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:17:58 +00:00
Vadim Zeitlin
62763ad541 Fix fields initialization in wxCommandEvent copy ctor.
Neither m_isCommandEvent nor, worse, m_propagationLevel was set correctly for
wxCommandEvent objects constructed using copy ctor -- and hence Clone(). This
means that such events were not propagated upwards the window hierarchy, quite
possibly resulting in mysterious bugs.

Fix this now by initializing these fields in both the normal and copy ctors.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:17:52 +00:00
Vadim Zeitlin
693abd284f Refactor: extract menu event handling logic from wxMenu::SendEvent().
Make this logic available for reuse with the events of different kind, e.g.
wxMenuEvent in the upcoming commit.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:17:48 +00:00
Vadim Zeitlin
d7653d9c0c Remove "isPopup" parameter from DoSendMenuOpenCloseEvent() in wxMSW.
This parameter is redundant, we can find out whether a menu is a popup one or
not from the menu itself, assuming that we always have a valid wxMenu pointer
for popup menus events, which really should be the case (we may not have one
for the events from system menus).

This allows to handle popup menu events case in the base class version of
MSWFindMenuFromHMENU() which will allow to reuse it from places other than
DoSendMenuOpenCloseEvent() without code duplication now.

There should be no changes to the behaviour, this is just a simplification.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:17:43 +00:00
Vadim Zeitlin
1c6bb3f5b8 Add a popup menu to the MDI sample.
This is just to test how wxEVT_MENU_HIGHLIGHT events from popup menu items are
handled under the different platforms.

Also log menu events to the canvas window too as it now gets some.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:17:38 +00:00
Vadim Zeitlin
5ef2ab09c6 Add logging of wxEVT_MENU_HIGHLIGHT events to the MDI sample too.
This allows to easily compare which events are generated and sent to which
objects under different platforms.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78225 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:17:34 +00:00