Commit Graph

50854 Commits

Author SHA1 Message Date
Paul Cornett
9a4a080711 non-pch build fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64128 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 14:40:58 +00:00
Vadim Zeitlin
6abf7b639c Don't use invoking window in wxGTK wxMenuBar implementation.
wxGTK wxMenuBar used its own SetInvokingWindow/UnsetInvokingWindow() and
related functions instead of reusing the base class Attach/Detach() which
exist for exactly the same purpose. This resulted in unnecessary code
duplication and confusion and, since the changes of r64104, resulted in
asserts due to use of SetInvokingWindow() for non-popup menus.

Fix this by removing the wxGTK-specific functions and doing the work they used
to do in (now overridden) Attach() and Detach(). Also call Attach/Detach()
instead of these functions from wxGTK wxFrame and wxMDIParentFrame code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 15:08:00 +00:00
Vadim Zeitlin
7739f9c947 Use wxMenu::GetWindow() instead of GetInvokingWindow() in SendEvent().
This simplifies the code as we don't need to walk the menu hierarchy upwards
any more (GetInvokingWindow() does it now) and also makes it work for all
menus, not just the popup ones.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64126 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 15:07:55 +00:00
Vadim Zeitlin
341d8cb2cf Avoid code duplication in wxGTK menu events generation code.
Reuse the existing DoCommonMenuCallbackCode() function instead of duplicating
its code in menuitem_select() and menuitem_deselect() GTK callbacks.

No changes in behaviour.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64125 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 15:07:51 +00:00
Vadim Zeitlin
6ea0139862 No real changes, just remove empty wxMenuBar dtor in wxGTK.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64124 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 15:07:47 +00:00
Vadim Zeitlin
7118e711dc Move wxMSW wxMenu::GetWindow() down to wxMenuBase.
GetInvokingWindow() can only be used for the popup menus which have the
invoking window, so add a new function which can be used to get the window
associated with any kind of menu in all ports -- it already existed in wxMSW
but is needed elsewhere too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64123 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 15:07:39 +00:00
Jaakko Salli
3ded4b22fe Allow wxPGProperty::Hide() to be called on unattached property (see #11987)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64121 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 10:13:22 +00:00
Jaakko Salli
cc98c78510 In wxPropertyGrid::DoPropertyChanged(), call GetEditorControl() as late as possible so that editor can be changed in wxPGProperty::OnSetValue() (fixes #11987)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64120 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 10:02:25 +00:00
Václav Slavík
a9da8ef41c wxLocale::InitLanguagesDB() doesn't use wxStringTokenizer, remove it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 07:06:38 +00:00
Václav Slavík
ea14492351 Split intl.h into intl.h, language.h and translation.h.
To make the code more manageable, intl.h now contains wxLocale and
translation.h all translations-related stuff (wxTranslations, _() etc.).
Code generated by genlang.py was moved into its own files (language.h,
languageinfo.cpp).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64118 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 07:06:32 +00:00
Václav Slavík
18e065b48d Split wxLocale into wxLocale and wxTranslations.
wxTranslations is for handling gettext translations. wxLocale manages
locale and provides compatiblity API for translations. Separating these
two loosely related tasks makes it possible to use translations into
languages not known by Windows or using localized GUI without all the
locales compilations.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64117 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 07:06:18 +00:00
Václav Slavík
10afaa0b97 Fix typo in internat sample.
Catalog should be added with domain name ("wxstd"), not file name
("wxstd.mo").

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64116 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-24 07:06:11 +00:00
Vadim Zeitlin
e259ce57e6 Work around wrong client size computation for not yet shown maximized windows.
The client size of maximized windows which hadn't been shown yet isn't
computed correctly by wxMSW because WM_NCCALCSIZE returns too small values for
some reason. Attempts to fix this were unsuccessful so just ensure that the
window is re-laid out using the right size from WM_SIZE it receives when it is
shown instead of using the wrong pending size.

Closes #11762.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64115 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-23 19:34:36 +00:00
Václav Slavík
eddac3cb0f Fixed (correct) warning about uninitialized inputConv.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64113 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 14:57:18 +00:00
Vadim Zeitlin
5811b24f5e Fix harmless warning about a possibly uninitialized variable.
gcc complained about possibly uninitialized variable in QueueTestCase in
optimized build, just initialize it to suppress this warning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 14:16:26 +00:00
Vadim Zeitlin
584be856d1 Don't test possibly uninitialized variable in wxGCDC::SetLogicalFunction().
The variable "mode" is not filled by TranslateRasterOp() function if the input
function is not supported, so don't compare it with wxCOMPOSITION_XOR later.
Just compare "function" itself with wxXOR as this works in any case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64111 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 14:16:22 +00:00
Vadim Zeitlin
a34ce03d63 Fix harmless g++ 4.3 warning about suggested parentheses.
Add parentheses around && within ||.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64110 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 14:16:18 +00:00
Vadim Zeitlin
6dfe3a3aee Define wxStrto{d,l,ul}_l() functions in non-Unicode build too.
This fixes the unit test compilation in ANSI build.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64109 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 14:16:12 +00:00
Jaakko Salli
d1358fcbd7 Added parenthesis around macro arguments
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64108 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 14:06:00 +00:00
Jaakko Salli
153107b402 Allow wxAny to contain 'const char*' or 'const wchar_t*'. This was previously not possible since these pointers were converted to wxString, as convenient means to work with string literals. Now pointers (to string literals) are stored instead, and As<wxString>(), comparison operators do the type conversion.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 13:51:38 +00:00
Vadim Zeitlin
a96160b58f Fix off by one error in wxFTP::GetFileSize().
We incremented the index once more even after finding the line we were looking
for in the array which meant that we accessed a wrong array element in any
case and could even attempt to access an out of bound one if the file was
found in the last line.

Closes #11964.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64105 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 12:08:16 +00:00
Vadim Zeitlin
e3f5caa223 Return correct invoking window for submenus of a popup menu.
SetInvokingWindow() is only called for the top menu being popped up itself but
the invoking window should also be associated with its submenus.

Modify GetInvokingWindow() to return the parents invoking window for submenus.

This fixes a crash due to returning NULL from wxMenu::GetWindow() in wxMSW
owner-drawn code.

And it also makes redundant some code in wxUniversal wxMenu implementation
which can now simply use GetInvokingWindow() in all cases.

Closes #11957.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 11:21:35 +00:00
Vadim Zeitlin
29c7962a9f Use symbolic names for popup menu ids in wxEVT_MENU_HIGHLIGHT events in wxMSW.
No real changes, just use wxID_NONE instead of hardcoded -1 (in one place) and
-3 (in another one). Hardcoding them not only made the code less readable but
also resulted in two numbers actually becoming different when they almost
certainly were meant to be the same.

This shouldn't result in any changes in the user-visible behaviour but we now
avoid searching the menu bar for menu items with id of -1 needlessly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64103 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 11:21:30 +00:00
Vadim Zeitlin
f6a86afff4 Fix bug with using incorrect negative ids in wxEVT_MENU_HIGHLIGHT events.
wxMSW code implicitly cast ids carried by wxEVT_MENU_HIGHLIGHT events to
unsigned short so that they didn't compare equal to the (signed, negative) ids
of the real menu items. Because of this menu help strings were not shown for
any items with negative ids, i.e. those created using wxID_ANY.

Closes #11977.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 11:21:25 +00:00
Vadim Zeitlin
fa5f485828 Override wxWindow::MSWGetCreateWindowCoords() in wxTopLevelWindow.
The old code was messy because it handled both top level and child windows at
wxWindow level when they need quite different treatment. This resulted in
several errors: first, wxWindow versions of WidthDefault and HeightDefault
were used to determine the initial size even of top level windows which was
clearly wrong as it created tiny windows (20*20). Second, CW_USEDEFAULT could
be used for child window for which this shouldn't be done.

Fix this by making MSWGetCreateWindowCoords() virtual and overriding it in
wxTopLevelWindow. This makes the code much simpler and more obviously correct.

Also make MSWGetCreateWindowCoords() void, as nobody was using its return
value anyhow (and the old version also had a bug in it and wrongly returned
true when default size was passed to it).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 11:21:21 +00:00
Vadim Zeitlin
db890987c6 Add documentation for several grid cell renderer/editor classes.
Document the previously undocumented renderers and editors.

Closes #11965.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64100 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 11:20:50 +00:00
Vadim Zeitlin
4582ed9478 Clarify that Raise() is only a request to raise the window.
Calling Raise() doesn't guarantee that the window will be raised.

Closes #11974.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 11:20:45 +00:00
Vadim Zeitlin
64d029f155 Fix fatal bug in ArgsArray(wchar_t**) ctor.
The input pointer was modified before being used again leading to out of bound
array access.

Closes #11979.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 11:20:37 +00:00
Stefan Csomor
3328e0ca26 missed in r64093
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64097 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 07:00:32 +00:00
Stefan Csomor
f2b905d787 switching to correct hit-testing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64096 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 06:46:02 +00:00
Stefan Csomor
cffdfa8f73 simpler code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64095 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 06:23:57 +00:00
Stefan Csomor
2680ddc678 shutdown sequence routing to EndSession calls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 06:18:15 +00:00
Stefan Csomor
7934e44732 overriding the cfrunloop accessor, during booting cocoa has to create a NSRunLoop earlier
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 06:16:34 +00:00
Václav Slavík
ebeac822d9 msgIdCharset is only needed in ANSI build.
In Unicode build, there's no need to create wxCSConv object for every
loaded catalog when it won't be used for anything.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64090 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-21 16:46:05 +00:00
Vadim Zeitlin
b5415496c3 No real changes, just fix typos in the ownerdrw sample.
s/Cheked/Checked/g

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-21 14:40:42 +00:00
Vadim Zeitlin
c71238020c Remove the extra margins when checking owner drawn menu icons size.
The extra +4 in IsLessThanStdSize() functions resulted in assert failures
under Windows XP after the ownerdraw drawing changes so remove it as nobody
knew why was it there anyhow.

Also replace IsLessThanStdSize() with IsGreaterThanStdSize() to allow using it
directly instead of always testing for !IsLessThanStdSize().

See #11657.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64088 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-21 14:40:28 +00:00
Stefan Csomor
42a8164310 non precomp build fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64087 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-21 04:13:56 +00:00
Stefan Csomor
8ec413ce46 avoiding full resize-invalidate and refresh
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64081 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 20:48:49 +00:00
Stefan Csomor
eb68a54a40 restoring special handling for carbon system menu items, fixes #11819
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 20:29:22 +00:00
Stefan Csomor
445e564f12 tracking open modal dialogs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64068 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 19:09:38 +00:00
Stefan Csomor
bd23338782 currently avoid problems when releasing the capture during drag on osx_cocoa
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64067 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 19:07:42 +00:00
Stefan Csomor
66506259a0 better layout for simple one param messages, closes #11810
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 16:02:32 +00:00
Stefan Csomor
075e355305 having common API for mapping between native and wx tlw type
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 14:55:42 +00:00
Stefan Csomor
447e2772a6 type of wrapped window can be any NSWindow, not only our own classes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64064 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 14:55:10 +00:00
Stefan Csomor
e86d68934f TODO done
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64063 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 14:54:32 +00:00
Stefan Csomor
0e05b13c42 use new call
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64062 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 14:53:36 +00:00
Stefan Csomor
638b3cd7a8 wrap native TLWs so that they also appear in the tlw list
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 14:51:54 +00:00
Stefan Csomor
e17ac396d0 support for capturing, use categories instead of member vars for the implementation mapping, so that we can wrap native NSWindow instances as well
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64060 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 14:50:27 +00:00
Jaakko Salli
49efebe247 Fix VC6 compilation by changing the order of assignment operators in wxAny
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 12:55:34 +00:00
Vadim Zeitlin
b871bb951a Check for menu title being non-empty when appending it to the menu bar.
It doesn't make sense to add a menu with empty title to the menu bar so assert
that the title is not empty and fail to add the menu if it is.

See r64033 in wxQT branch.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64058 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 11:59:46 +00:00