Paul Cornett [Sun, 3 Apr 2011 05:19:59 +0000 (05:19 +0000)]
For wxGTK2, link with X11 explicitly, since we use many X11 functions directly.
Some linkers, notably newer Linux ones, don't implicitly link against dependent libs
Fixes #13100
Disable wxUSE_STD_CONTAINERS by default for MSVC6.
This compiler can't compile its own standard headers with the default options
as it overflows an internal heap. Disable the use of standard containers by
default for it to avoid this problem and indicate that /Zm option must be used
to avoid this.
Remove the weird wxSVG_DEBUG which could apparently be used to trace the code
execution by triggering asserts in all functions. This is really not the right
way to implement tracing and seems pretty useless, just remove it.
Jaakko Salli [Thu, 31 Mar 2011 17:22:51 +0000 (17:22 +0000)]
Added wxComboPopup::DestroyPopup(), which responsibility is to call Destroy() for the popup control and also delete the combo popup object itself. The default implementation should be able to handle common cases.
Vadim Zeitlin [Thu, 31 Mar 2011 09:38:03 +0000 (09:38 +0000)]
Implement wxGraphicsContext::GetSize() for Cairo.
As the implementation of this method is basically the same for all ports move
it to the base class itself instead of requiring the derived classes to
implement it. Now the derived classes need to fill in m_width and m_height
members instead.
Do fill them when creating wxGraphicsContext in Cairo version.
Vadim Zeitlin [Thu, 31 Mar 2011 09:37:59 +0000 (09:37 +0000)]
Tentative compilation fix for wxMSW with MinGW after STL changes.
Include wx/stack.h, which includes the standard <stack> header, before
<windows.h> as the latter redefines min and max as macros conflicting with the
standard headers.
Vadim Zeitlin [Thu, 31 Mar 2011 09:28:41 +0000 (09:28 +0000)]
Fix alpha handling in CSS syntax in wxColour in non-"C" locale.
Use locale-independent functions to parse and generate the floating point
alpha representation in CSS syntax for colours to make it work in locales
which don't use period as decimal separator.
Vadim Zeitlin [Thu, 31 Mar 2011 09:28:38 +0000 (09:28 +0000)]
Fix HMENU to wxMenu translation in wxMSW code.
We didn't find the menus corresponding to the submenu handles. This resulted
in incorrect processing of EVT_UPDATE_UI events for the submenus and probably
other problems.
Fix this by searching for the HMENU recursively in all menus.
Vadim Zeitlin [Thu, 31 Mar 2011 09:28:34 +0000 (09:28 +0000)]
Document unexpected wxWindowDisabler taskbar UI in wxMSW.
It may be unexpected that the application can still be closed from the taskbar
even if its main window is disabled. Mention this in the documentation and
indicate how to prevent this from happening if required.
Vadim Zeitlin [Wed, 30 Mar 2011 14:16:25 +0000 (14:16 +0000)]
Remove REMOVE_UNUSED_ARG option from setup.h files.
This identifier wasn't used anywhere as WXUNUSED() is always defined as
nothing for all compilers since quite some time.
Also moved wxUSE_IOSTREAMH together with the other wxUSE_STD_XXX options and
removed the "compiler (mis)features" section which became empty after doing
this.
Vadim Zeitlin [Wed, 30 Mar 2011 14:16:19 +0000 (14:16 +0000)]
Add support for elements preceding the document node in wxXML.
This is mainly useful for parsing and generating processing instructions but
can be used for any kind of elements, e.g. also comments, occurring before the
document node in XML documents.
Update the internally stored position of a floating AUI frame even if the user
is dragging it too fast to update its position on screen. This prevents the
frame from snapping back to the initial position when movement is over.
Vadim Zeitlin [Wed, 30 Mar 2011 14:16:04 +0000 (14:16 +0000)]
Add wxUSE_STD_CONTAINERS and turn it on by default.
Previously, wxUSE_STL enabled both implicit conversion of wxString to
std::[w]string and use of standard containers for the implementation of their
wx equivalents. Split up the two roles now by allowing to enable the use of
the standard containers independently of (backwards incompatible) implicit
conversion in wxString and actually enable wxUSE_STD_CONTAINERS by default.
Jaakko Salli [Sun, 27 Mar 2011 18:30:56 +0000 (18:30 +0000)]
Instead of just deleting m_popupInterface, call Destroy() of its wxWindow-based popup control obtained via GetControl() member function. Also still delete m_popupInterface if there was no popup control, or if it was implemented as a separate class (versus being multiple-inherited along side wxComboPopup, as has been the common practice).
Václav Slavík [Sun, 27 Mar 2011 17:23:43 +0000 (17:23 +0000)]
Always use gtk2-compat.h definitions.
We support building against newer GTK+ version and using an older
one at runtime, so we must provide our implementations of these
functions even if GTK_CHECK_VERSION would indicate the function is
already available in GTK+.
Václav Slavík [Fri, 25 Mar 2011 11:00:56 +0000 (11:00 +0000)]
Revert r67137.
GTK_DISABLE_SINGLE_INCLUDES causes trouble with other included
libraries (libgnomeprint this time) too. This check for trivially fixed
problems is not worth the continuing trouble.
Vadim Zeitlin [Thu, 24 Mar 2011 16:08:11 +0000 (16:08 +0000)]
Set m_inheritBgCol flag in wxPanel with a background bitmap.
This ensures that the panel background is used by its transparent children
under wxMSW even when the panel itself is inside a wxNotebook with themed
background: making InheritsBackgroundColour() return true prevents the
notebook from overriding our background.
Fixed buffer overflow when saving certain images in the Windows icon format.
When an image did not have a width with a multiple of 4 the calculations for the number of padding bytes (to get a scan line DWORD aligned) would be wrong. This caused a buffer overrun when saving the 1 bits per pixel mask.
Václav Slavík [Wed, 23 Mar 2011 13:57:52 +0000 (13:57 +0000)]
Only react to clicks on the checkbox in wxDataViewToggleRenderer.
Previously, left click anywhere in the cell toggled the checkbox.
This was unexpected when the cursor was far from the checkbox
in a wide column. With this change, one has to be over the
checkbox to toggle it.
Vadim Zeitlin [Wed, 23 Mar 2011 10:37:38 +0000 (10:37 +0000)]
Prevent event generation in wxGtkCalendarCtrl::SetDate().
Block not only gtk_day_selected_callback() but also gtk_month_changed_callback()
as we don't want wxEVT_CALENDAR_PAGE_CHANGED generated neither when calling
SetDate().
This fixes partial resetting of the just set value in wxDatePickerCtrl as
calling SetDate() there resulted in the date being reset from inside it and
the behaviour of the control was clearly wrong as could be seen in the widgets
sample.
Václav Slavík [Tue, 22 Mar 2011 19:13:28 +0000 (19:13 +0000)]
Fix <object_ref> processing to respect overridden attributes.
r60494 accidentally broke this, by adding faster code path for
child-less <object_ref>s. Unfortunately, this made it ignore
<object_ref>s without children, but with attributes overrides.
Vadim Zeitlin [Tue, 22 Mar 2011 17:15:56 +0000 (17:15 +0000)]
Add wxUSE_THREADS checks around wxMSW functions dealing with threads.
This removes the code unneeded in wxUSE_THREADS==0 build and also fixes
compilation of wxGUIAppTraits::WaitForThread() which didn't compile any more
with wxUSE_THREADS==0 since r67185.
Vadim Zeitlin [Tue, 22 Mar 2011 17:15:49 +0000 (17:15 +0000)]
Don't consider fully opaque bitmaps as having alpha in wxMSW.
Remove the alpha channel from the DIB we create not only if all of its pixels
are fully transparent but also if they are all fully opaque. This prevents us
from erroneously creating bitmaps with alpha channel when none is needed nor
expected.
Vadim Zeitlin [Tue, 22 Mar 2011 17:15:38 +0000 (17:15 +0000)]
Post size events to the event handler and not window itself.
Post the artificial wxSizeEvent to the window event handler and not window
itself in SendSizeEvent() as otherwise any event handlers wouldn't see this
event at all.
Vadim Zeitlin [Tue, 22 Mar 2011 17:15:34 +0000 (17:15 +0000)]
Use disabled version of normal bitmap for disabled one in wxMSW::wxButton.
Initialize the disabled button bitmap with a greyed out version of the normal
one instead of using the same normal bitmap for it. This is more consistent
with the other ports and makes more sense.
Vadim Zeitlin [Tue, 22 Mar 2011 15:07:20 +0000 (15:07 +0000)]
Correctly align background brush when erasing owner drawn bitmaps in wxMSW.
Add a hack to work around the problem with background alignment when drawing
the owner-drawn buttons in wxMSW. This fixes the alignment for any custom
brushes used for background painting but doesn't help with user-defined
EVT_ERASE_BACKGROUND handlers which still don't work well with the owner-drawn
buttons. Unfortunately DrawThemeParentBackground() remains a mystery and I
couldn't understand why not only doesn't it position the DC correctly on its
own but also ignores any attempts to do it manually.
This also doesn't help with the stubbornly remaining one pixel non-transparent
border around non-owner-drawn buttons which I just can't get rid of.
Applied patch by snowleopard2 fixing a bunch of typos such as misspellings and double words in the documentation. Combined the patch with some local queued typos waiting to be committed as well as adding new typo fixes inspired by the patch.
Function names with American spelling were not changed nor was third-party code touched. The only code changes involve some changes in strings that are translated ("Can not" -> "Cannot").
Jaakko Salli [Tue, 22 Mar 2011 09:56:40 +0000 (09:56 +0000)]
To have better support for themed and custom backgrounds for wxMSW wxComboCtrl, use WS_EX_COMPOSITED and wxBG_STYLE_ERASE instead of custom double-buffering (when made possible by the OS version)
Vadim Zeitlin [Mon, 21 Mar 2011 10:59:59 +0000 (10:59 +0000)]
Allow using milliseconds in wxLog timestamp.
Use wxDateTime::UNow() instead of time() and wxDateTime::Format() instead of
localtime() to make it possible to use "%l" specifier in wxLog time stamp.
Vadim Zeitlin [Sun, 20 Mar 2011 22:33:16 +0000 (22:33 +0000)]
Don't draw the mysterious black rectangle in the erase sample.
The black rectangle drawn in EVT_PAINT handler in the sample prevented the
custom background from showing through the wxStaticBitmap. Maybe it was
initially done intentionally but this makes the sample look broken so just
don't do this.
Read a few TIFF tags that assist with having a similar TIFF file when saving the image again, instead of (by default) always saving as a 24-bit RGB image. Also, in accordance with libtiff, allow reading X and Y resolution values even if the resolution unit tag is not set.
Applied (modified) patch by scottb. Closes #13015.
Jaakko Salli [Sun, 20 Mar 2011 10:59:22 +0000 (10:59 +0000)]
Redone (generic) wxComboCtrl background painting and handling. The 'actual' wxWindow background colour is now largely ignored and overridden to refer the text-area's background colour instead (as is usually the case with controls like this). Base 'transparent' background is now only painted when double-buffered rendering is required, and otherwise delegated to the system, as appropriate. This should significantly improve control's appearance and compliancy with GTK+ and OS X themes and custom backgrounds.
No changes, synchronised source names that appear commented at the top of files with the actual path to the files.
Fixed commented names (path, filename, and extension) of files in include/ and src/. Prepended the names in src/ with "src/" everywhere, while starting those in include/wx/ with "wx/".
Vadim Zeitlin [Sun, 20 Mar 2011 00:00:49 +0000 (00:00 +0000)]
Add wxPanel::SetBackgroundBitmap().
This method provides a simple way to set a background bitmap without defining
an EVT_ERASE_BACKGROUND handler and, more importantly, one that works
correctly in wxMSW for a window with children as it paints the background of
transparent children too.
Vadim Zeitlin [Sun, 20 Mar 2011 00:00:42 +0000 (00:00 +0000)]
Deprecate old style wxPanel ctor taking separate coordinates.
wxPanel had a ctor in very old (wx 1.x-compatible?) style which was marked as
"old" and not documented but not officially deprecated. Do deprecate it now in
view of removing it in later releases.
Vadim Zeitlin [Sun, 20 Mar 2011 00:00:38 +0000 (00:00 +0000)]
Split wxPanel in wxPanelBase and platform-specific files.
So far we have only wxMSW-specific implementation (and also a trivial
wxUniv-specific one) but it's still tidier to have all platform-specific code
in separate files, especially as we're going to have more of it for wxMSW
soon.
Vadim Zeitlin [Sun, 20 Mar 2011 00:00:29 +0000 (00:00 +0000)]
No changes, just refactor wxMSW background brush methods.
Factor out MSWGetCustomBgBrush() from MSWGetBgBrushForChild(). This is useful
as in the vast majority of cases the parent window will want to use the same
background brush for all of its children so it doesn't really care about the
concrete child passed to MSWGetBgBrushForChild() and we can adjust the brush
to the child origin in the common code instead of asking each derived class
overriding MSWGetBgBrushForChild() to do this.
This doesn't change anything but will make the upcoming changes to wxPanel
background painting simpler.
Vadim Zeitlin [Sat, 19 Mar 2011 11:57:13 +0000 (11:57 +0000)]
Fix wxRegKey::GetKeyInfo() output parameters in 64 bit builds.
Use intermediate 32 bit DWORD variables for ::RegQueryInfoKey() outputs as
size_t is 64 bit in 64 bit MSW builds and so the variables of type size_t
can't/shouldn't be passed directly to this function to avoid only filling
their lower 32 bits.