Commit Graph

50328 Commits

Author SHA1 Message Date
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
Jouk Jansen
b1b5ebb7e2 Correction on previous commit: statement order corrected
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-22 15:52:20 +00:00
Jouk Jansen
83d59607cd Get wxDC defined when nescessary
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-22 07:55:26 +00:00
Kevin Ollivier
2c755d9bbf Handle the case of NSNotFound result properly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-20 02:07:22 +00:00
Vadim Zeitlin
9584818ae9 Disable size grip for TLW status bar if TLW is not resizeable.
wxSTB_SIZEGRIP is part of default status bar style but it doesn't make sense
for non-resizeable TLWs, so turn it off in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63195 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-20 00:17:08 +00:00
Václav Slavík
7ca3cc6fc3 Fix wxMulDivInt32() to round the result like win32 MulDiv() does.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-19 22:02:59 +00:00
Václav Slavík
0e7f59ab29 Make ConvertPixelsToDialog() and ConvertDialogToPixels() const.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63193 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-19 17:53:29 +00:00
Václav Slavík
e27619029d Don't query metrics that won't be used.
If ConvertPixelsToDialog() or ConvertDialogToPixels() was called with
one of the two input values set to -1, the respective font metric was
queried needlessly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63192 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-19 16:32:31 +00:00
Václav Slavík
319106d6e2 Support XHTML ' entity.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63191 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-19 14:47:20 +00:00
Vadim Zeitlin
dff3fa53dc Further enhancement to the samples overview page.
Add links to samples sources in svn to all the individual samples and be even
more explicit about their location on the local disk.

Move the paragraph explaining the samples location further below -- but <hr>
still doesn't work somehow.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-19 13:49:12 +00:00
Vadim Zeitlin
187acdec76 Explain the location of samples better in the samples overview page.
Don't mention controls sample, just the widgets one, as the latter is much
richer and easier to understand.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-19 13:02:21 +00:00
Vadim Zeitlin
49c2653000 Don't set initial size as min size for top level windows in wxMSW.
This was accidentally done because wxWindowBase::CreateBase() didn't recognize
the window as being top level as it was called before the window was appended
to wxTopLevelWindows list.

Fix this by doing the same thing wxGTK already did: just call
wxTopLevelWindows.Append() before CreateBase().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-19 13:02:14 +00:00
Václav Slavík
dae60aeebb Add wxThreadEvent::SetPayload<T>().
This makes it possible to easily pass custom data between threads, in
type-safe way (thanks to internal use of wxAny). This adds
sizeof(wxAny)==16+sizeof(void*) overhead to wxThreadEvent, but I think
it's cheaper than doing malloc/free on copying.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-19 13:01:40 +00:00
Václav Slavík
f8a7dd5f41 Don't make full copy of string in wxThreadEvent::Clone().
It's enough to do it once to ensure thread-safety. Doing it twice (once
in copy ctor called by Clone(), once in Clone() itself) only wastes
time.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-19 13:01:33 +00:00
Stefan Csomor
477618ea0c moving GetPageInfo to later stage, closes #11494
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63182 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 11:05:27 +00:00
Stefan Csomor
2ea6073516 switching to LaunchServices implementation, fixes #11508
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63181 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 10:56:17 +00:00
Stefan Csomor
43201491cd fixing type for 64 bit, closes #11550
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 10:09:47 +00:00
Stefan Csomor
1e287c5df7 avoiding Insert shadowing superclass methods, closes #11616
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 09:45:32 +00:00
Stefan Csomor
2efd54a41b setting correct 'default' for m_filterIndex, closes #11541
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 09:12:53 +00:00
Stefan Csomor
237077b501 applying patch, closes #11309
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63177 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 09:03:05 +00:00
Stefan Csomor
0ee6e44952 setting correct refcon in menus (was incorrectly changed to menuimpl), fixes #11611
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 08:56:20 +00:00
Stefan Csomor
1ad953420b avoiding double define warning
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 08:52:46 +00:00
Vadim Zeitlin
7981d3408f Document wxCENTRE style for wxMessageDialog.
This is currently only implemented for MSW but we could implement it for the
other ports in the future.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 00:29:12 +00:00
Vadim Zeitlin
187839afce Don't set stretchable spacers size to 0, this doesn't work so use 1 instead.
If the toolbar is not big enough for its fixed-size contents, we set the size
of the tools corresponding to stretchable spacers to 0 but this didn't really
work and resulted in bad toolbar appearance even after resizing it to be big
enough (as could be seen in samples/xrc).

So set the spacers size to at least 1 to ensure that we do resize them
correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 00:29:05 +00:00
Vadim Zeitlin
5852e62f1f Add support for stretchable spacers to XRC wxToolBar handler.
Notice that currently only stretchable spacers are supported via
separator-like "space" XRC element. If we ever add support for fixed spacers
in the toolbar we should do it via its fixed sub-element, e.g. they would be
specified with <fixed>1</fixed> in XRC file.

Also use spacers instead of separator in the XRC sample and ensure that the
toolbars in it are resized.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 00:29:00 +00:00
Vadim Zeitlin
ca67f0d859 Correct test for parent being on screen in wxTLW::DoCentre().
The old test was needlessly complicated, didn't take all cases into account
and had a typo in it which prevented it from working in half of the cases
which it did [try to] take into account.

Correct this by simply checking if the parent rectangle intersects the visible
display area at all.

Also simplify the code a little by checking for the window being maximized
from the beginning as centering a maximized window on either screen or parent
is a no-op.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 00:28:53 +00:00
Vadim Zeitlin
f19259fce0 Invalidate stored wxTreeItemIds when the corresponding item is deleted in wxMSW.
m_htSelStart and m_htClickedItem stored in wxTreeCtrl must be invalidated when
the item they point to is deleted (which also happens when all the items are
deleted), otherwise the selection doesn't behave correctly after doing it.

Closes #11619.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 00:28:47 +00:00
Vadim Zeitlin
d6d857b124 Generate wxEVT_KEY_DOWN events for navigation keys in wxMSW wxTreeCtrl.
We only generated wxEVT_COMMAND_TREE_KEY_DOWN events for the keys which can be
used for tree control navigation and which are handled specially in the code
but not the wxEVT_KEY_DOWN ones. This was inconsistent with the other keys and
incompatible with wx 2.8 and other ports, so generate both events unless the
wxEVT_KEY_DOWN one was handled by the user code.

Closes #11621.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63169 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-18 00:28:41 +00:00