Commit Graph

50355 Commits

Author SHA1 Message Date
Vadim Zeitlin
c9980eb871 Another compilation fix for wxMSW without PCH.
Need to include <commctrl.h> as we use HIMAGELIST and related functions now.

See #11595.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-26 12:33:01 +00:00
Vadim Zeitlin
32b8e70161 Implement RequestUserAttention() for wxOSX/Cocoa.
Simply use NSApplication:requestUserAttention to do it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-26 12:16:44 +00:00
Vadim Zeitlin
9d043a9227 Compilation fixes for PCH-less build after ownerdraw-refactor branch merge.
Forward declare more classes, in particular use tagRECT which can be forward
declared, instead of RECT typedef in public headers.

Also include more header in #ifndef WX_PRECOMP case.

See #11595.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-26 09:01:13 +00:00
Vadim Zeitlin
a4a0bff166 Avoid g++ warning about unhandled wxFONTFAMILY_XXX value in a switch.
Add wxFONTFAMILY_UNKNOWN case to the switch as it will allow us to be warned
if we add a new family in the future and forget to update this code to take it
into account.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-26 09:01:08 +00:00
Vadim Zeitlin
0369a9fedf No real changes, just don't initialize extern variable to avoid g++ warning.
g++ warns about initialized extern variables so separate the declaration from
the initialization to avoid this warning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-26 09:01:02 +00:00
Vadim Zeitlin
108694fe19 Make wxWindow::MSWGetThemeColour() const.
There doesn't seem to be any reason for this method to not be const.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-26 09:00:55 +00:00
Vadim Zeitlin
6c0487907a Compilation fix for wxUniv.
We need explicit casts to wxWindow in wxWindowMSW code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-26 09:00:48 +00:00
Stefan Csomor
4d572a2cac simplifying code, removing outdated API
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-25 22:27:42 +00:00
Stefan Csomor
bdb5b32a58 adding note for correct wheel params
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63265 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-25 22:24:49 +00:00
Julian Smart
deeb0a89b9 Added EVT_WIZARD_PAGE_SHOWN event for wxWizard, to give apps
a chance to initiate processing after a page is presented.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-25 18:48:21 +00:00
Stefan Csomor
83ffdd7111 better wheel support
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63261 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-25 17:12:53 +00:00
Stefan Csomor
1814b27e45 make sure we can override GetModality
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-25 17:12:07 +00:00
Stefan Csomor
f44af1dc9e adding wxWindow::Show in order to make the sheet showing its children as well
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-25 13:27:59 +00:00
Stefan Csomor
f0d454bd6a fixing building on iphone
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63258 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-25 13:26:36 +00:00
Jouk Jansen
55f375a584 Update compile support for OpenVMS
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63257 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-25 11:32:19 +00:00
Kevin Ollivier
72247c2f53 Fix mistake, though this assert is unfortunate since now FindString("whatever") will always assert under OS X Cocoa, even when it would find and return the position correctly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 23:28:32 +00:00
Stefan Csomor
c7109e1ac3 supporting auto-rotate for translucent statusbar
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63253 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 19:09:20 +00:00
Vadim Zeitlin
b8190883d0 Compilation fix after ownerdraw-refactor branch merge.
Don't use HDC in public headers, it may not be declared there. Use WXHDC
instead even if this means having ugly casts.

This fixed mingw32 compilation (see #11595).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63252 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 14:15:12 +00:00
Václav Slavík
5c3c137277 Fixed dialog units <-> pixels conversion.
The computation is now identical to Windows native one. To achieve this,
MSDN-recommended GetTextExtent() call is used instead of GetCharWidth().
wxMulDivInt32() is used instead of integer arithmetics to achieve
correct rounding.

Use toplevel parent's font instead of window's own. This makes more
sense, as dialog units are defined for TLWs, not individual subcontrols.

Also fixed wxMSW's wxButton::GetDefaultSize() to compute dialog units
correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 11:51:09 +00:00
Václav Slavík
8cb03510a1 Determine wxButton size correctly in wxMSW.
Instead of using default size for default GUI font, use the default font
for this dialog's current font.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63250 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 11:51:00 +00:00
Vadim Zeitlin
0c550516dd Fix bug in wxStringOutputStream unit test.
We wrote an extra NUL byte to the stream and, unsurprisingly, contents of its
buffer didn't match the original string resulting in the test failure.

Also get rid of a #if wxUSE_UNICODE.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 11:33:24 +00:00
Vadim Zeitlin
421f32d102 Override IsSeekable() in wxString{Input,Output}Stream to return true.
These streams are seekable but somehow IsSeekable() was never overridden for
them resulting in test failures in Input_SeekI().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63248 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 11:33:17 +00:00
Vadim Zeitlin
73c997ba7b Document that wxComboBox::Dismiss() and Popup() generate events.
Currently these functions generate events in both of the existing
implementations (GTK and MSW) so it is simpler to let them to continue to do
it but this must at least be documented as this is probably unexpected by
users.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 11:33:11 +00:00
Vadim Zeitlin
823e82e260 Correct UTF-32BE BOM detection in wxConvAuto.
On the fly detection of the BOM was wrongly implemented for UTF-32BE in
r63064 and returned BOM_None for it if we tried to read exactly 2 bytes.

Fix this by returning BOM_Unknown if the first 2 bytes are NUL.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63246 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 10:13:45 +00:00
Vadim Zeitlin
4ca973967a Correct bug with returning 0 for non-empty input from wxConvAuto::ToWChar().
Since the changes of r63064 we could return 0 when asked to convert a
non-empty buffer containing only a BOM. This confused the logic in
wxTextInputStream::NextChar() and was generally unexpected so now return
wxCONV_FAILED in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 10:13:40 +00:00
Vadim Zeitlin
32dd8aa22b Check the result of ToWChar() call in wxTextInputStream::NextChar() better.
The logic in this function depends on ToWChar() working correctly so check
that it doesn't return obviously wrong results, e.g. 0 output length for
non-empty input. This was mostly done to detect the problem in wxConvAuto
currently but it could also be useful with user-defined conversions and
shouldn't have a big performance effect on wxTextInputStream so leave these
checks in to facilitate debugging in the future.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63244 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 10:13:33 +00:00
Vadim Zeitlin
8e7262fca7 Replace wxLogWarning()s in wxOSX wxComboBox code with asserts.
This incidentally fixes compilation when not using PCH as wx/log.h was not
included but is also more correct as the messages meant for the programmer,
and not the user, should be given using asserts and not wxLog.

Also correct some asserts messages. In particular, don't mention the function
name in the message itself as it's already shown by the assert and using it in
the string itself isn't useful and simply introduces the risk of forgetting to
update it after refactoring, as happened here in r63105.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 09:13:40 +00:00
Vadim Zeitlin
d1d1f8175d Add wxComboBox::Popup() and Dismiss() to manually show or hide its popup.
Add implementations for wxMSW and wxGTK.

Closes #11506.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 01:00:45 +00:00
Vadim Zeitlin
d21866cbd7 No changes, just remove the strange "#if 1".
This was apparently unintentionally added in r15050 to all files of the
widgets sample and somehow survived in this one only until now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 01:00:33 +00:00
Vadim Zeitlin
b66c3a6751 Fix sending of wxEVT_COMMAND_LIST_COL_DRAGGING events in wxMSW wxListCtrl.
We were not getting HDN_TRACK from the system because apparently it is not
sent for header controls with HDS_FULLDRAG style which is used by default by
the native list control. A possible solution would be to forcefully unset this
style but this would make the UI look old fashioned and less intuitive so
instead send these DRAGGING events from HDN_ITEMCHANGING.

Closes #9471,

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63240 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 01:00:27 +00:00
Vadim Zeitlin
002374070e Move wx/evtloop.h from GUI_CMN_HDR to BASE_CMN_HDR in files.bkl.
And rebake.

Now that wxEventLoop can be used in wxBase as well, we need this file to be
installed as part of wxBase too.

Closes #11617.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63239 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 01:00:20 +00:00
Vadim Zeitlin
330ca4d434 Fix wxHTTPStream::Eof() to return true for empty HTTP resources.
Eof() never returned true when attempting to read an empty resource before.

Closes #11596.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 01:00:03 +00:00
Vadim Zeitlin
9677a8f017 Use a helper wxNEEDS_DECL_BEFORE_TEMPLATE symbol in wxStrcoll() workaround.
The condition for which this workaround is needed has already changed once
(see #11605) and may change again in the future as we test with more compilers
so use a symbolic name for it.

No real changes otherwise.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63237 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 00:59:56 +00:00
Vadim Zeitlin
a95d18b8a8 Apply workaround for wxStrcoll() template for g++ to 3.4 too.
At least mingw32 version of g++ 3.4.5 needs the same workaround to be able to
compile wx.

Closes #11605.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63236 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-24 00:59:49 +00:00
Kevin Ollivier
2482282d47 Fix for generic implementation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63235 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 22:45:24 +00:00
Kevin Ollivier
2d4c4ba89b Fix for non-Mac builds.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63234 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 21:17:19 +00:00
Kevin Ollivier
45bc06dfaf Remove assert that was used during testing while changing style flags.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63233 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 20:10:17 +00:00
Kevin Ollivier
9482c64466 Start on ShowWindowModal for OS X Cocoa. Not working properly as children do not display.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 20:06:48 +00:00
Vadim Zeitlin
e556b61236 Add virtual wxSizer::DoInsert() to replace Insert().
This allows to avoid problems with hiding all but the overridden overloads of
Insert() in wxSizer-derived classes, see #11616, without having to explicitly
write any using statements.

Keep Insert(size_t, wxSizerItem) virtual to allow the existing code overriding
it to keep working.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 13:44:46 +00:00
Vadim Zeitlin
7ca106e860 Allow to not create wxPaintDC in EVT_PAINT handler in wxMSW.
Failure to create a wxPaintDC in EVT_PAINT handler resulted in many serious
and difficult to debug problems under wxMSW. We used to document that the user
shouldn't do it but this wasn't enough (see #11648). We could also assert if
we detected that a handler didn't create a wxPaintDC but it seems better to
just handle this case gracefully for consistency with the other platforms.

Add wxDidCreatePaintDC global variable which is reset before generating
wxPaintEvent and set to true when ::BeginPaint() is called from wxPaintDC
ctor and validate the update region of the window ourselves if it wasn't set
(meaning that wxPaintDC wasn't created).

Update the documentation to emphasize the link between EVT_PAINT handlers and
wxPaintDC but without saying that wxPaintDC object must always be created in
the handler as this is not true any more.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 13:22:25 +00:00
Vadim Zeitlin
975fb32b5c Don't crash when input is empty in wxFileConfig(wxInputStream) ctor.
Fix crash due to dereferencing a NULL pointer when the input buffer in
wxFileConfig ctor is empty.

Closes #11636.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 13:22:14 +00:00
Vadim Zeitlin
03cc29918f Fix off by 1 errors in owner-drawn menu drawing code in wxMSW.
The label was offset by 1 pixel vertically and the check marks were 1 pixel
too wide compared to the native ones under XP, correct this.

Closes #11420 (again).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 13:22:07 +00:00
Vadim Zeitlin
85ee88cd53 Improve wxCheckListBox appearance under Vista/Win7.
Fix the items alignment and also code cleanup: fix indentation, remove magic
numbers &c.

Closes #10286.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 13:22:00 +00:00
Vadim Zeitlin
ee00931326 Correct drawing of check marks for owner-drawn items without bitmaps.
Standard check mark was not drawn correctly for check/radio items without
bitmaps.

Closes #11480.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63225 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 13:21:52 +00:00
Vadim Zeitlin
9c32ed26a2 Correct alignment of menu accelerator strings in owner-drawn menus.
Draw them right-aligned as the native menus do.

Closes #11479.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 13:21:46 +00:00
Vadim Zeitlin
aa4919edd1 Use theme functions for drawing owner-drawn menus.
This makes the menu items with custom attributes or bitmaps look more native,
especially on post-XP systems.

Closes #11420.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 13:21:36 +00:00
Vadim Zeitlin
d08504dfa5 Fix calculation of the margins for owner-drawn menu items.
Take into account the widths of the bitmaps properly.

Closes #11268.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 13:21:27 +00:00
Vadim Zeitlin
4e7c767fed Set up menu bitmaps correctly for checkable items.
We must not set MENUITEMINFO::hbmpItem for the checkable items as it would
then be used for both checked and unchecked state.

Closes #11244.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63221 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 13:21:20 +00:00
Vadim Zeitlin
98fbab9e7b Refactor owner-drawing code.
Only keep common code in the base class and extract all menu/listbox-specific
stuff into derived classes.

This makes the code cleaner and more maintainable but introduces some problems
in wxCheckListBox appearance which will be fixed by the next patch.

Closes #10635.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 13:21:12 +00:00
Vadim Zeitlin
937d5b6075 Return old, not new, selection from wxMSW wxNotebook::ChangeSelection().
The function is documented to return the old selection and not the new one, so
correct it to behave as expected.

Closes #11646.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63219 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-23 13:20:54 +00:00