Paul Cornett [Thu, 17 May 2012 15:29:50 +0000 (15:29 +0000)]
Remove use of "size-request" signal for wxWindow sizing.
This signal has been removed from GTK3. Instead have wxPizza keep track of child
size, and use gtk_widget_set_size_request() for wxWindows in native containers.
Vadim Zeitlin [Wed, 16 May 2012 15:10:05 +0000 (15:10 +0000)]
Make variable containing port number an ushort in the sockets sample.
A port number is an unsigned short, not long, so don't make it long just
because wxCmdLineParser doesn't provide a convenient way to get the value of
an unsigned short option (it would be nice if it did...).
This fixes the problem with using "%d" format specifier with a long variable
as this resulted in an assert under LP64 systems.
Vadim Zeitlin [Wed, 16 May 2012 15:10:01 +0000 (15:10 +0000)]
Fix wxWakeUpIdle() in Unix console application broken by r71089.
Initialize m_pipeIsEmpty to true as we don't have anything in the pipe
initially and if this variable was false, nothing was ever written to the wake
up pipe and it was never set to true as nothing was read from it neither.
Vadim Zeitlin [Tue, 15 May 2012 10:04:01 +0000 (10:04 +0000)]
Enable variadic macros for VC9 and later.
VC9 and 10 support variadic macros so define HAVE_VARIADIC_MACROS for them
too. This currently only affects wxLog{Debug,Trace} definitions in wx/log.h.
Vadim Zeitlin [Tue, 15 May 2012 10:03:57 +0000 (10:03 +0000)]
Fix keyboard navigation in wx{List,Choice,Tree,Tool}book controls.
Inherit from wxNavigationEnabled<wxBookCtrlBase> instead of just
wxBookCtrlBase to ensure that the keyboard navigation works correctly for
these controls.
The toolbar in wxToolbook still doesn't accept focus from keyboard but at
least the pages can be TAB-bed too and from. And the rest of the controls
are now fully accessible using only the keyboard.
Don't try to process any remaining pending events in ProcessEvents() itself as
this was inconsistent: we only processed low-level toolkit pending events in
the main event loop itself if the loop was exited from a normal event handler
but only processed the wxApp-level pending events if it was exited from a
pending event handler. It also required more code than the new version that
simply processes all the remaining pending events, of both kinds, after the
main event loop termination.
This corrects changes of r71304 and replaces those of r71329.
Vadim Zeitlin [Sun, 13 May 2012 21:37:25 +0000 (21:37 +0000)]
Don't return a dangling pointer from wxDateTime::ParseXXX(wxCStrData).
We don't have any sufficiently long-lived pointer to return from this
overload, so don't return anything from it -- it's better to break the
compilation of the existing code rather than make it crash during run-time.
Vadim Zeitlin [Sun, 13 May 2012 21:37:23 +0000 (21:37 +0000)]
No changes, just simplify the code using wx2stc() a little.
Assign wx2stc() return value to a suitably const variable instead of using
ugly casts to get rid of constness.
Also use wxCharBuffer/char* explicitly inside explicit wxUSE_UNICODE checks,
using wxWX2MBbuf here doesn't gain us anything and just confuses the reader of
this code.
Vadim Zeitlin [Sun, 13 May 2012 21:37:18 +0000 (21:37 +0000)]
Fix wxStyledTextCtrl compilation in non-Unicode build.
The value returned by wx2stc() in non-Unicode build is a simple "char*" and we
can't call length() method on it, add a helper wx2stclen() function to get the
length from the original wxString itself in this case.
Vadim Zeitlin [Sun, 13 May 2012 21:37:16 +0000 (21:37 +0000)]
Don't assert if no icon is specified for a wxDataViewCtrl item.
An item in a column using wxDataViewIconTextRenderer might not have any valid
icon associated with it, don't assert in case it doesn't in the native GTK
version.
Notice that the generic wxDataViewCtrl implementation already supports this
but not perfectly: no space is reserved for the icon in the images without
one, so giving the image to only some of them looks ugly. The GTK version
aligns both the items with and without icon properly and simply leaves the
image part blank and it would be better to modify the generic version to do
the same thing in the future.
Vadim Zeitlin [Sun, 13 May 2012 21:37:13 +0000 (21:37 +0000)]
Minor change to wxString pretty-printer for gdb.
Calling string() explicitly isn't necessary, at least not with gdb 7.2, and is
actually harmful when using Python 2.5 (which doesn't support UTF-32) with
wide strings.
Vadim Zeitlin [Sun, 13 May 2012 21:37:10 +0000 (21:37 +0000)]
Don't handle branches specially when sorting items in wxDataViewCtrl.
The generic version of wxDataViewCtrl tried to put all branches before the
leaves when sorting. This had a couple of problems: first, it didn't do it
correctly and actually placed the branches after the leaves which didn't make
any sense. Second, this was only done in the generic version and not the
native GTK one making the behaviour inconsistent between platforms. Finally,
this behaviour just doesn't make sense in general (i.e. when items don't
necessarily represent anything in the file system and maybe even sometimes
when they do) and there doesn't seem any good reason to do it by default.
So stop doing it, partially reverting the changes of r47562.
Vadim Zeitlin [Sun, 13 May 2012 13:17:22 +0000 (13:17 +0000)]
Remove wxDECLARE_APP() from wxIMPLEMENT_APP_NO_MAIN().
There is no need for a separate declaration inside wxIMPLEMENT_APP() as
wxGetApp() is defined by it and redeclaring it immediately after definition
results in a warning with some compilers/environments (Eclipse CDT).
The move of wxGetApp() to the beginning of the macro is only to ensure that a
semicolon is still required after wxIMPLEMENT_APP_NO_MAIN() and the other
macros terminating with it, such as wxIMPLEMENT_APP() itself.
Vadim Zeitlin [Fri, 11 May 2012 22:10:25 +0000 (22:10 +0000)]
Fix extra event sent by wxTextEntry::ChangeValue() since r71308.
The changes of r71308 sent the event unconditionally in case the text didn't
really change but no events should be sent if the flags don't include
SetValue_SendEvent, add a check for it.
Vadim Zeitlin [Wed, 9 May 2012 14:24:51 +0000 (14:24 +0000)]
Unconditionally define IID_IShellItem in wxMSW sources.
This GUID may not be defined in uuid.lib even when
__IShellItem_INTERFACE_DEFINED__ is defined in the headers, so just define it
always to avoid any problems.
Use GetBest{Height,Width}() in wxBookCtrlBase to compute the controller
control size height/width from its known (from wxBookCtrlBase size itself)
width/height. This will allow to correctly compute the size of wxListCtrl used
by wxListbook once it provides the necessary support for width-from-height and
height-from-width calculations.
Vadim Zeitlin [Wed, 9 May 2012 14:24:37 +0000 (14:24 +0000)]
Add wxWindow::GetBest{Height,Width}().
These functions will be used when it is necessary to determine the best size
of the control if one of its size components is fixed. Currently none of the
classes implements DoGetBestClient{Height,Width}() yet but wxListCtrl will do
it soon, see #13898.
Vadim Zeitlin [Wed, 9 May 2012 14:24:30 +0000 (14:24 +0000)]
Mention wxFoobookEvent change from classes to #defines in the change log.
These classes can't be forward-declared any more as they're not really classes
any longer but just compatibility #defines and can't be made classes again as
this would break the existing code using wxBookCtrlEvent in 2.9.
Vadim Zeitlin [Wed, 9 May 2012 14:24:27 +0000 (14:24 +0000)]
Allow entering more digits in wxSpinCtrl in wxMSW than fits into it.
Scroll the control automatically if there is not enough space. This is
consistent with (single line) wxTextCtrl and wxSpinCtrl under the other
platforms.
Vadim Zeitlin [Wed, 9 May 2012 14:24:16 +0000 (14:24 +0000)]
Remove assert checking bitmap size in wxMenuItem drawing code in wxMSW.
This assert was fatal, as usual when asserting from a WM_PAINT handler, as the
function was reentered resulting in nested asserts and program abort, so
remove it to at least let the program continue to run even if there is not
enough space for the bitmap in the menu.
There is, of course, still something wrong with the menu geometry calculations
if this happens but I can't even reproduce this any more so not sure what
exactly.
Vadim Zeitlin [Wed, 9 May 2012 14:24:12 +0000 (14:24 +0000)]
Fix creation of wxBitmap from wxIcon in wxMSW: premultiply the pixels.
wxBitmap in wxMSW is supposed to store its data in alpha-premultiplied format
but didn't do it when it was created from an icon (or a cursor), resulting in
wrong display of wxIcons with alpha channel when they were used for e.g. menu
items.
Fix this by ensuring that the data is always premultiplied. This is not the
best solution as in some cases (e.g. if this wxBitmap is added to wxImageList
later) we could need to undo this premultiplication later which is quite
inefficient but at least it's simple and straightforward.
Vadim Zeitlin [Wed, 9 May 2012 14:24:10 +0000 (14:24 +0000)]
Fix wxString unit test when not using UTF-8.
Restrict the tests added in r70987 to run when using UTF-8 strings only, they
test for something that is simply not true (and for a bug that can't happen)
with non-multibyte encodings.
Vadim Zeitlin [Wed, 9 May 2012 14:24:03 +0000 (14:24 +0000)]
Use better face names first in wxGTK wxNativeFontInfo::SetFamily().
Try better matches and not the most widespread ones first when building a list
of face names to try for the given family. This gives better results when
these better fonts are indeed available and doesn't change anything if they
are not.
Vadim Zeitlin [Wed, 9 May 2012 14:24:01 +0000 (14:24 +0000)]
Check that item ID is initialized when inserting it in wxListCtrl.
Using uninitialized ID happened to work by accident with 2.8 but it doesn't
work any more, try to detect this as early as possible and give a clear
explanation of why it doesn't to help fixing the broken code that used to
accidentally work.
Vadim Zeitlin [Mon, 7 May 2012 13:12:23 +0000 (13:12 +0000)]
Use XkbKeycodeToKeysym() instead of deprecated XKeycodeToKeysym().
XKeycodeToKeysym() is deprecated in new X11 headers because it doesn't work
correctly with all symbols (https://bugs.freedesktop.org/show_bug.cgi?id=5349).
Use XkbKeycodeToKeysym() instead, this should help with some keys and also
avoids deprecation warnings during compilation.
Vadim Zeitlin [Mon, 7 May 2012 13:12:20 +0000 (13:12 +0000)]
Create a wrapper file for X11/XKBlib.h header.
We need some hacks for the older systems before including this header, extract
them from src/x11/utilsx.cpp into a new private header to be able to reuse it
from wxGTK in the next commit.
Václav Slavík [Sun, 6 May 2012 13:10:34 +0000 (13:10 +0000)]
Fix wxOwnerDrawnComboBox background on with classic theme.
In wxMSW, if the classic theme was used, read-only wxOwnerDrawnComboBox
had gray background, but native look should be the same for both
editable and read-only combo boxes: white text entry-like rectangle.
Apparently, a similar problem existed with non-classic themes too
before, as there was a workaround in place. Fixed by moving the
workaround into code used by both themed and classic rendering.
Vadim Zeitlin [Sat, 5 May 2012 11:22:09 +0000 (11:22 +0000)]
Update the field widths on demand in wxStatusBarGeneric.
This ensures that the value returned from GetFieldRect() is always up to date,
even when this method is called from the user-defined wxEVT_SIZE handler, i.e.
before our own OnSize() could run.
Also remove the now unneeded hack with calling the base class OnSize() from
the statbar sample.
Stefan Csomor [Sat, 5 May 2012 05:32:19 +0000 (05:32 +0000)]
fixes crashes with embedded controls in toolbars after toolbar destruction, code was moved in r62988, but apparently Destroy doesn't have to be called, so do a last check, fixes #14258
Vadim Zeitlin [Fri, 4 May 2012 22:20:55 +0000 (22:20 +0000)]
Derive wxGenericFileCtrl from wxControl.
wxFileCtrl -- which can be #define'd as wxGenericFileCtrl -- is documented to
inherit from wxControl and does derive from it in the native GTK version, so
do it for the generic version too.
Vadim Zeitlin [Fri, 4 May 2012 20:35:31 +0000 (20:35 +0000)]
Add wxDir::GetNameWithSep() and use it to avoid consecutive slashes.
It is wrong to use dir.GetName()+"/" to obtain a slash-terminated directory
name as this results in (usually harmless but at best ugly) double slashes at
at the beginning of the string for the root directory. Add GetNameWithSep() to
obtain the correct result in all cases.
Vadim Zeitlin [Thu, 3 May 2012 10:17:15 +0000 (10:17 +0000)]
No changes, just remove duplicate flags checks in wxUniv wxTLW.
For some reason (rename of the old wxTHICK_FRAME to wxRESIZE_BORDER?) we
tested for wxRESIZE_BORDER twice in a couple of places. Don't do it for
clarity.
Fixed parts of toolbar background not being drawn with older comctl32.dll.
When using comctl32.dll versions older than 6.0 toolbar icons would not have their background drawn. Fix this in a rough way by always completely erasing the background like was done before. Regression since r62971.
Václav Slavík [Mon, 30 Apr 2012 09:33:30 +0000 (09:33 +0000)]
wxDataViewCtrl: always update the header when col best width changes.
Have an explicit per-column dirty flag and use that to determine whether
we need to call wxHeaderCtrl::UpdateColumn(). Previously, the lack of
computed best width was used as an indicator, but this didn't work
correctly if some code called GetWidth() after invalidation but before
wxDataViewCtrl::UpdateColWidths() was called at idle time. This resulted
in header's column widths getting out of sync with the control itself.
Václav Slavík [Mon, 30 Apr 2012 09:33:25 +0000 (09:33 +0000)]
Invalidate wxDataViewCtrl bests widths on expand/collapse.
The best column widths are computed from "realized" items that are
available as rows in wxDataViewCtrl. This information changes when a
previously collapsed node is expanded and new items become available for
column width calculation.
Work around the problem with not exiting event loop under MSW.
Changes of r71304 broke the event loop termination under MSW, limit them to
only the case in which they were really needed, i.e. when loop is really
exited by a pending event handler.
This is only a temporary solution, we need something better in longer term.
Use PCH in the tests in all Windows ports and not only when using wxMSW.
This change doesn't actually change anything for the "normal" ports as it only
affects wxGTK/MSW which is not officially supported yet, so the make/project
files are unchanged by it.
Set the data size in wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE in wxGTK.
Allow wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE handler to examine the data
being dragged by setting not only the pointer to it but also its size, as
otherwise it's impossible to do anything with it.
Remove internal only methods from wxDataViewEvent documentation.
SetDataXXX() methods are only meant to be used by wxDataViewCtrl itself, so
don't document them as part of public API. Their documentation was pretty
useless anyhow as it didn't say anything not already contained in the method
name.