Commit Graph

59501 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
5103243078 No real changes, just shorten log messages in the MDI sample.
There is not enough space for the relatively long messages logged when menus
are opened or closed (added in r78130), shorten them as much as possible while
leaving them still readable.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:17:30 +00:00
Vadim Zeitlin
33fe4b1837 Document the long existing wxFrame::DoGiveHelp().
This function was added way back in 2002 (r15339) but was never documented.
Do it now as it's a useful method to override for customizing the help strings
display.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:17:27 +00:00
Vadim Zeitlin
90639b8339 Send idle events from inside wxYield() in all ports, including wxMSW.
This means it can be now done in wxEventLoopBase itself and calls to
ProcessIdle() in the port-specific code are not needed any more, so remove
them.

This introduces a change in behaviour for wxMSW, where idle event handlers
were not invoked from inside wxYield() at all previously, and for wxOSX, where
only a single idle event is now generated from wxYield() instead of a stream
of them until no idle handler needs any more of them as before. But on the
bright side, the new behaviour seems to make most sense and is now the same in
all ports.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:17:23 +00:00
Vadim Zeitlin
340d7f67b6 Use DTM_GETIDEALSIZE to implement wxDateTimePickerCtrl::DoGetBestSize().
If possible, i.e. when running under Vista or later, just ask the control for
its best size instead of trying to approximate it ourselves.

Notice that we still use our own height, to ensure that it's the same as for
the text controls, but it's the width that really counts.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78221 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:17:17 +00:00
Vadim Zeitlin
9fc78c8167 Add wxLocale::GetOSInfo() and use it in MSW wxDateTimePickerCtrl.
This fixes the size of wxDateTimePickerCtrl in programs that don't set any
specific locale: previously, the standard "%m/%d/%y" format was used for
computing the best size of the control in this case, but this could have been
significantly shorter than the format actually used (compare with the default
"%d %b, %Y"), resulting in the control contents being truncated by default.

GetOSInfo() is currently different from GetInfo() only under MSW, but we might
need to make the same distinction under OS X too, so do make this function
public instead of keeping it MSW-specific.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:17:13 +00:00
Vadim Zeitlin
8a00553fda Remove unneeded CacheBestSize() from wxMSW wxDateTimePickerCtrl.
The best size is already cached by the base class GetBestSize(), no need to do
it here as well.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78219 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 22:17:08 +00:00
Václav Slavík
a0c2416858 Xcode project: src/regex must be in non-user search path
Otherwise it wouldn't be included as <regex.h> and the system copy would
be used. We need to always use the builtin, wxChar-aware copy.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-05 15:55:26 +00:00
Vadim Zeitlin
c671950f72 No real changes, just fix some typos in comments.
Closes #16699.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-03 17:18:17 +00:00
Artur Wieczorek
07371fcd56 Define wxPG toolbar event handler only if library is compiled with toolbar classes.
Include wxPropertyGridManager::OnToolbarClick() code only if wxUSE_TOOLBAR is set to 1.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78214 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-03 17:01:35 +00:00
Artur Wieczorek
922bef4df6 Restore wxPG toolbar buttons state if selecting wxPG page was unsuccessful.
Toolbar button corresponding to the unsuccessfully selected page should be released and button corresponding to the old page should be pressed again.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-03 16:59:11 +00:00
Artur Wieczorek
7dc1ab1c76 Use wxCONTROL_FOCUSED control state flag when drawing native wxPG check box in the "modified state" under wxOSX.
Generally, wxCONTROL_PRESSED control flag is used when drawing native check box (wxPGEditor_CheckBox) in "modified state" but under wxOSX this flag is equivalent to wxCONTROL_CHECKED flag and hence it is necessary to indicate this state in an alternative way.

Closes #16696

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-01 22:47:48 +00:00
Artur Wieczorek
8a25a6fb49 Add member function to retrieve wxBoolProperty attribute.
Added wxBoolProperty::DoGetAttribute virtual function.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78211 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-29 20:18:47 +00:00
Artur Wieczorek
29bf859fae Check if new index is in range before selecting new value in wxPGProperty::SetChoiceSelection.
Closes #16697

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78210 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-29 16:45:21 +00:00
Artur Wieczorek
f34f9d6708 Refresh wxPGProperty after changing its attribute.
Closes #16696

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78209 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-28 20:45:35 +00:00
Vadim Zeitlin
919a7afba2 Turkish translations update from Kaya Zeren.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-27 00:45:38 +00:00
Vadim Zeitlin
1839a01769 German translations update from Wolfgang Stöggl.
Many minor fixes and also replacements of "..." with the ellipsis Unicode
character (U+2026).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-26 19:16:00 +00:00
Václav Slavík
3a64b2e072 Refresh PO files after accelerators changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78182 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-25 19:04:44 +00:00
Václav Slavík
128c6c71e1 Improve wxAcceleratorEntry::ToString() formatting
This method used the wxKeyNames[] array originally intended for parsing
accelerator specification and not for human-friendly formatting. In
particular, non-alphanumeric keys such as WXK_DOWN and many others were
formatted using all-uppercase name, which was highly unusual and not
native on any platforms (the only unaffected one was OS X).

Improve the formatting by doing the following:

a) use Title case for the entries; because parsing is case-insensitive,
   this has no effect on it;
b) add display_name field for keys where the symbolic name wasn't
   appropriate for display and set it for some of the keys that are
   likely to show up in menus;
c) add explanatory comments for translators

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78181 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-25 19:04:32 +00:00
Václav Slavík
249c9e28e5 Extract translator comments into wxstd.pot
Extract the commonly used TRANSLATORS: prefix into translation files, to
provide some additional context where needed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-25 19:04:29 +00:00
Václav Slavík
cfc3dc874f Translate menu accelerators from XRC
The content of <accel> property was taken verbatim and appended to the
(translated) label; this bypassed wx's internal accelerators translation
mechanism, because wxMenuItem code quite reasonably assumes that the
string passed to it is translated.

Explicitly use SetAccel() instead, to force translation. This matters
for languages such as German where e.g. Ctrl+ is translated as Strg+.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-25 19:04:26 +00:00
Václav Slavík
541a460f7b Close NSWindows properly
Don't just release the window, call the close method. This is usually
the same, but in some situations, the difference (close sends
NSWindowWillCloseNotification, which wx doesn't use) is significant.

In particular, if the window is shown as fullscreen, OS X won't dispose
of its space correctly when the window is released, but not closed
first. See https://github.com/vslavik/poedit/issues/119

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78177 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-25 18:23:02 +00:00
Artur Wieczorek
ffbee3a059 Remove unused wxPG member variable.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-24 16:11:19 +00:00
Artur Wieczorek
161e8dcff2 Use Boolean variable to store Boolean values in wxPG.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-24 16:09:46 +00:00
Artur Wieczorek
a1f83adcec Fix using compatibility flag in propgridpagestate.h header file.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-24 16:06:42 +00:00
Artur Wieczorek
1fd049988d Use a hash set instead of vector to hold dedicated keys in wxPG.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-24 16:04:53 +00:00
Václav Slavík
4d8d25e8bc Skip Cocoa's options in wxCmdLineParser on OS X
Skip Cocoa-specific flags used by Xcode (such as -AppleLanguages) on OS
X when parsing the command line. They all take a single argument, so
skip both the flag and the following value in the argv list.

Also fix handling of -ApplePersistenceIgnoreState, which didn't skip the
value as it should.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-24 13:45:02 +00:00
Paul Cornett
b74403baca Remove gtk_tree_view_set_fixed_height_mode() call from AssociateModel()
The check for wxDV_VARIABLE_LINE_HEIGHT is already done in Create(), and the
IsVirtualListModel() check was probably an attempt to get around a performance
problem (#16680), but it's not a valid criteria for changing the height mode.
closes #16683


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-22 19:12:41 +00:00
Paul Cornett
1a4e398732 fix assert in dataview sample, closes #16679
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-21 17:20:04 +00:00
Paul Cornett
daa8fd03f3 fix "wrong type" error when using wxDataViewChoiceByIndexRenderer, closes #15955
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78168 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-21 17:00:29 +00:00
Paul Cornett
bb9515c729 fix crashes in wxGTK3 when running with non-X11 backend, see #16688
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-20 17:04:13 +00:00
Bryan Petty
a4a57d0fa2 Upgrade Doxygen to 1.8.8.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78165 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-19 22:38:35 +00:00
Paul Cornett
9bee2091d4 clarify comment
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-19 19:00:00 +00:00
Paul Cornett
173cfe28a1 fix build when GDK_WINDOWING_X11 is not defined
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78163 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-19 18:59:43 +00:00
Vadim Zeitlin
4797f01bc0 Credit Marco Trevisan for wxGTK3/Mir patches.
Closes #16688.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78162 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-19 13:29:32 +00:00
Vadim Zeitlin
17135e0a77 Don't use X11-only functions when not using X11 in wxGTK.
See #16688.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-19 13:29:28 +00:00
Vadim Zeitlin
a6b14c2ed1 Don't crash when switching to full screen in non X11-based wxGTK.
Only use internal X11 display if we're running in a such environment.

See #16688.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-19 13:29:23 +00:00