Commit Graph

53893 Commits

Author SHA1 Message Date
Vadim Zeitlin
7ef4a97bfd Align multiline labels correctly in wxMSW owner-drawn buttons.
The label wasn't centered correctly in multi-line case.

Closes #13567.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69442 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-16 17:57:49 +00:00
Steve Lamerton
9a9fa6168a Export a couple of Carbon functions to allow wxWebView to build correctly. This was already done in the wxWebView branch but got missed in the merge to trunk.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-16 15:59:31 +00:00
Václav Slavík
fc55eaa0be Set wxDataViewCtrl::m_focusWidget in wxGTK.
The GtkTreeView control that should get the focus in in scrolled window;
the same is already done for wxListBox.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-15 14:19:22 +00:00
Václav Slavík
d81ccfce37 Don't call wxEvent::SetTimestamp() twice in InitMouseEvent<>().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69435 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-15 14:19:19 +00:00
Vadim Zeitlin
164db177a2 Don't use wxMSW version of wxNonOwnedWindow at all under WinCE.
This class becomes completely trivial under WinCE as its functionality
(setting the window shape) can't be implemented under this platform, so just
don't compile it at all there.

This both (slightly) reduces the amount of #if checks and should make the code
(slightly) smaller.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-15 00:20:56 +00:00
Robin Dunn
322853b3d6 Add data members for RGBValue and HSVValue
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-14 01:38:07 +00:00
Robin Dunn
d554697139 fix parent class and constant
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-14 01:37:19 +00:00
Vadim Zeitlin
c105b3cdd4 Don't assert in wxDateTime::Format("%p") in locales not using AM/PM.
If a locale doesn't use AM/PM strings, strftime() can return an empty string
which does not indicate an error, so don't assert that strftime() failed in
this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69411 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-13 14:54:29 +00:00
Vadim Zeitlin
bb8823c958 The usual fix for PCH-less compilation after the last commit.
Fix wxNonOwnedWindow compilation in wxGTK without PCH.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69409 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-13 13:19:42 +00:00
Vadim Zeitlin
a82afab363 Implement SetShape() for wxPopupWindow in wxGTK.
Move SetShape() implementation from wxTopLevelWindow to wxNonOwnedWindow so
that wxPopupWindow, which also inherits from the latter, could use it as well.

This makes it possible to have popup windows with irregular shapes in wxGTK as
well as in wxMSW and wxOSX.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-13 12:45:56 +00:00
Robin Dunn
b39badac11 Avoid an assert when m_dir is empty
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-13 06:40:59 +00:00
Robin Dunn
e33cc297dd Interface tweaks for Phoenix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-13 06:40:10 +00:00
Vadim Zeitlin
7364317521 And another compilation fix.
This time it really does compile.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69392 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-12 18:08:46 +00:00
Vadim Zeitlin
8938c6ca91 Compilation fix after a bad merge.
Fix bad merge artefact in the previous commit.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-12 18:08:13 +00:00
Vadim Zeitlin
612515aff1 Added wxWindow::GTKHandleRealized() virtual method to wxGTK.
This allows to easily do something in the derived classes when the widget is
realized, without having to deal with GTK+ signals. In particular, get rid of
another "realize" signal handler in wxTopLevelWindow and simply override this
virtual method there.

It also incidentally makes the callback code simpler as the window doesn't
need to be constantly dereferenced.

This shouldn't result in any changes to behaviour.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-12 16:22:14 +00:00
Vadim Zeitlin
f854ecb5a8 Move wxUSE_GUI definition from chkconf.h to the top of platform.h.
This avoids warnings about wxUSE_GUI not being defined in Mac tests in
wx/platform.h which are now (since r69387) done before wx/chkconf.h inclusion.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-12 11:20:15 +00:00
Stefan Csomor
5548cbac13 applying slightly modified patch, fixes #13434
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69388 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-12 10:10:32 +00:00
Stefan Csomor
4b21235820 moving defines in front of the setup.h to make webkit definitions in setup.h work for Xcode builds as well
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-12 08:57:40 +00:00
Vadim Zeitlin
06b3e19fcb Make it possible to close "shaped" sample from the menu.
The sample didn't define any handler for wxID_EXIT menu item, do add it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-12 00:35:04 +00:00
Vadim Zeitlin
a378977021 Added missing WXDLLIMPEXP_CORE to wxNonOwnedWindowBase declaration.
This fixes (harmless) MSVC warning C4275 about inheriting DLL-exported class
from a non-DLL-exported base class.

Closes #13554.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-11 17:56:57 +00:00
Vadim Zeitlin
796be9238d Update status bar labels properly after width change in wxMSW.
The labels were not updated (i.e. ellipsized or, on the contrary, displayed in
full) correctly after a status bar field was changed; there was even a FIXME
comment about this in the code.

Fix this by calling DoUpdateStatusText() when the field width is changed and
also update the field width after resetting the existing tooltips.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-11 17:14:09 +00:00
Vadim Zeitlin
4dd8339b2a Don't delete wxTaskBarIcon in wxMSW wxNotificationMessage if we don't own it.
wxNotificationMessage can be associated with an existing wxTaskBarIcon under
wxMSW instead of creating its own one internally and in this case the icon
must not be deleted when the notification is hidden but it was always
destroyed unconditionally by wxNotificationIconEvtHandler created by
wxAutoNotifMsgImpl.

Fix this by only creating this helper event handler if we do own the icon.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-11 17:08:02 +00:00
Vadim Zeitlin
bbcf2821a1 Move SetBackgroundBitmap() from wxPanel to new wxCustomBackgroundWindow.
wxCustomBackgroundWindow is a new class allowing to set a custom bitmap for
the background of any window. The relevant code was mostly moved from wxPanel
to which it was added only recently (before 2.9.2) making it unnecessary to
preserve compatibility.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-11 17:07:43 +00:00
Robin Dunn
7422d79765 wxGraphicsRenderer::CreateContextFromImage is not static
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69377 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-11 06:30:30 +00:00
Robin Dunn
7b8c3373a3 Remove the ctor and Init methods that are not available on all ports
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-11 05:33:31 +00:00
Vadim Zeitlin
7652eada41 Fix warnings about wxOSX_USE_CARBON being undefined when using g++.
Test for __WXMAC__ before testing wxOSX_USE_CARBON to avoid -Wundef warnings
from g++ in non-Mac builds.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69367 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-10 17:12:42 +00:00
Vadim Zeitlin
3648be1f8f Fix PCH-less build after adding wxNonOwnerWindow in wxMSW.
Include the required headers when not using PCH to fix compilation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-10 17:08:44 +00:00
Vadim Zeitlin
5bd0ee9966 Move wxTopLevelWindow::SetShape() down to wxNonOwnedWindow.
Also add wxNonOwnedWindow for wxMSW (which previously simply typedef'd it to
wxWindow) and document this class now that it provides some user-visible
functionality.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-10 10:53:23 +00:00
Vadim Zeitlin
95c0502bae No changes, just get rid of unnecessary variables in wxCairoBitmapData.
Don't use bw and bh when we have perfectly appropriate m_width and m_height.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69362 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:07:35 +00:00
Vadim Zeitlin
00953cf010 Don't declare wxCairoFontData::m_underlined unnecessarily.
This member was only used in wxGTK-specific code but it was declared for all
platforms which was unnecessary and confusing.

Move its declaration in wxGTK-only section of the class.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:07:32 +00:00
Vadim Zeitlin
fa378d369f Allow creating wxGraphicsFont without using wxFont.
This is mostly important to allow using wxImage-based wxGraphicsContext
without requiring X server connection under Unix: as wxFont can't be used
without X server, we needed another way to create wxGraphicsFont in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:07:29 +00:00
Vadim Zeitlin
a95f35b07a Remove font scaling from wxMSW wxGraphicsContext.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:07:25 +00:00
Vadim Zeitlin
0a470e5ea5 Allow creating wxGraphicsBitmap and wxGraphicsContext from wxImage.
Provide a way to use wxGraphicsContext to draw on wxImage.

This is implemented internally by drawing on wxGraphicsBitmap which can be now
also created from wxImage.

Add a test of the new functionality to the image sample.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69358 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:07:22 +00:00
Vadim Zeitlin
12493a5fb8 Refactor wxGDIPlusFontData ctor to allow using it without wxGDIPlusContext.
wxGDIPlusFontData only needs wxGDIPlusContext to get the font unit to use, so
pass the font unit directly to the ctor to allow also using it when there is
no context at hand.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69357 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:07:18 +00:00
Vadim Zeitlin
645f9bd377 Simplify and rationalize wxGDIPlusContext class constructors.
Remove the now unnecessary default ctor from wxGDIPlusContext and
wxGDIPlusMeasuringContext and add a ctor taking just wxGraphicsRenderer that
can be useful to the derived classes instead.

Merge Init() and SetDefaults() and initialize everything at once in the new
Init() now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:07:16 +00:00
Vadim Zeitlin
364197e882 Don't make private wxGraphicsContext-derived classes dynamically creatable.
This doesn't make any sense because classes such as wxGDIPlusContext,
wxGDIPlusMeasuringContext and wxMacCoreGraphicsContext are private and don't
need to be creatable by name (only renderers potentially need to be) and was
inconsistent with Unix/Cairo backend in which these classes were not dynamic.

So remove wxRTTI macros from them in wxMSW/wxOSX as well as this allows us to
get rid of unnecessary default ctors.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:07:13 +00:00
Vadim Zeitlin
7931320806 Fixed non-existent wxCairoContext default ctor.
wxCairoContext class declared default ctor which wasn't implemented and even
couldn't be implemented because its base class didn't have any default ctor
neither.

Fix this by providing a ctor taking wxGraphicsRenderer* and implement it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:07:10 +00:00
Vadim Zeitlin
08b2d55fdf Added wxGraphicsBitmap::ConvertToImage().
Allow to convert wxGraphicsBitmap directly to wxImage, without passing by
wxBitmap.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69353 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:07:07 +00:00
Vadim Zeitlin
5f606e6515 No changes, just refactor wxCairoBitmapData ctor.
Extract the code for buffer and surface creation into separate helper
functions so that they could be reused by other constructors (to be added in
the next commits).

Also use cairo_format_stride_for_width(), if available, to compute the stride
for the surfaces we create instead of hard coding 4*width.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69352 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:07:04 +00:00
Vadim Zeitlin
3c9e0b81fa Document wxGraphicsBitmap and methods involving it.
Document wxGraphics{Context,Renderer}::CreateBitmap() and CreateSubBitmap()
and wxGraphicsContext::DrawBitmap() as well as the (trivial) class itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69351 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:07:01 +00:00
Vadim Zeitlin
0419fee9c3 Implement EVT_MOUSE_CAPTURE_LOST handling for wxPopupTransientWindow.
Handle mouse capture lost events instead of polling for the mouse status in
EVT_IDLE handler. This is not only more efficient but also catches the cases
when the capture was lost before OnIdle() could be executed which could result
in assertion failures and, before the previous commit, even crashes.

The idle-time code is still used for wxOSX/Carbon because it doesn't seem to
generate mouse capture loss events currently -- but should be removed as soon
as support for these events is added.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69350 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:02:05 +00:00
Vadim Zeitlin
f9e19204bf Implement delayed destruction for wxPopupTransientWindow.
Windows of this class can be destroyed at any moment, even while some events
are still being processed, so delay the real destruction until we can be sure
that it's safe to delete the window.

This fixes problems (crashes due to dangling pointers) when the object is
deleted from the overridden OnDismiss(), for example.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69349 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:02:02 +00:00
Vadim Zeitlin
4506b42ce9 Fix inheriting parent background colour in wxPanel in wxMSW.
wxPanel didn't inherit the background colour set for its parent any more in
wxMSW because its HasTransparentBackground() didn't return true unless the
panel was a child of wxNotebook. This was wrong because not only themed
notebook background should be inherited but also any solid background
explicitly set for a panel parent.

Fix this by returning true from MSWHasInheritableBackground(), which is used
by wxPanel::HasTransparentBackground() under MSW, if the window has an
explicitly set and inheritable background colour.

Closes #13487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 22:01:57 +00:00
Václav Slavík
28fefd45f9 Return true from wxDataViewMainWindow::ItemDeleted().
Presumably, 'false' indicates failure, but there's no failure here: if
an item is not visible, because its parent wasn't expanded yet, it's
perfectly OK that we don't need to do anything.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69344 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 13:07:10 +00:00
Steve Lamerton
a1a1790666 Reuse existing MinGW defines for all compilers that are missing them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 10:45:16 +00:00
Robin Dunn
d775ec48a7 Interface updates for Phoenix. Add wxNativeFontInfo.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69326 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-09 01:28:20 +00:00
Steve Lamerton
7cd038613b Work around the fact that wxWebViewIE doesn't send page changing and page changed events during a refresh, yet IsBusy returns true.
Closes #13518

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-07 21:25:59 +00:00
Václav Slavík
a67e6b86f6 Handle inline editing in generic wxDataViewCtrl as Windows 7 does.
Mimic the behavior of Windows 7's Explorer: edit the item that has focus
if it is selected or the first selected item if focus is out of
selection.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-07 17:24:06 +00:00
Václav Slavík
1c8e71c92d Add columns focus and keyboard navigation to generic wxDataViewCtrl.
The UI tries to mimic Windows 7's Explorer's approach as much as
possible, taking inspiration in the GTK+ implementation when
appropriate. In particular, as long as the user doesn't use horizontal
navigation keys, everything looks as before and the user isn't bothered
with the existence of per-cell focus.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69322 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-07 15:03:02 +00:00
Julian Smart
f18d5c6f24 Allow selected symbol to be scrolled into view initially
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69321 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-07 03:51:23 +00:00