Commit Graph

55149 Commits

Author SHA1 Message Date
Vadim Zeitlin
6e36db5eca Correct the initial value setting in wxMSW wxSpinCtrl.
Always use value argument for the text control contents and also override the
initial numeric value with it if it's numeric.

This seems to be the only consistent thing to do, so document this behaviour
and add a unit test checking for it.

Closes #13589.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:20 +00:00
Vadim Zeitlin
8087e6c942 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.

See #11657.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:16 +00:00
Vadim Zeitlin
2c2138e937 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.

Closes #11414.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:12 +00:00
Vadim Zeitlin
39d169639b 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.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:10 +00:00
Vadim Zeitlin
30ee0b9764 Fix compilation of wxVariant code with VC6.
This was broken by the changes in r71196 as the original VC6 SDK doesn't
define VARIANT::llVal.

See #14210.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:07 +00:00
Vadim Zeitlin
1b63698581 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.

See #14126.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:03 +00:00
Vadim Zeitlin
912886949a 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.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:01 +00:00
Vadim Zeitlin
ae4375b878 Fix wxStaticBitmap best size calculation in wxMSW.
Take the control borders into account by overriding DoGetBestClientSize()
instead of DoGetBestSize().

Also invalidate the default best size computed before we have any valid image
when setting the initial image in Create().

Closes #4099.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:23:57 +00:00
Julian Smart
7c9fdebe5f Added field implementation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 11:06:04 +00:00
Julian Smart
f819ed5d42 Moved default margins to buffer class Init; reduced chance of accidental selection when clicking
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-08 17:31:06 +00:00
Julian Smart
20d09da5f8 Corrected top-level object layout in paragraphs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71377 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-07 15:47:23 +00:00
Julian Smart
a70eb13eb2 Fixed inconsistent calculation of line height in paragraph layout
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-07 13:13:30 +00:00
Vadim Zeitlin
37424888b8 No real changes, just fix some typos in comments.
Closes #14276.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-07 13:12:27 +00:00
Julian Smart
bea12bf084 Added non-breaking space to whitespace check
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71374 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-07 13:12:27 +00:00
Vadim Zeitlin
25cc08c07b 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.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71373 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-07 13:12:23 +00:00
Vadim Zeitlin
814028444d 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.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-07 13:12:20 +00:00
Václav Slavík
319ff5745e Make wxDocTemplate::CreateDocument() exceptions-safe.
Don't create the document object if InitDocument() throws.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71371 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-07 12:23:09 +00:00
Václav Slavík
e4f762f416 Fix performance of wxHtmlParser::SkipCommentTag() in UTF-8 build.
Avoid computing the difference between two potentially distant
iterators, which is O(1) in wchar_t build, but O(n) in UTF-8 one.

See #13445.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-07 11:15:31 +00:00
Václav Slavík
2a715bcb3c Fix r71367: don't set bgCol twice needlessly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-06 16:56:38 +00:00
Václav Slavík
b7f37d6d86 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.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71367 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-06 13:10:34 +00:00
Vadim Zeitlin
25e3f0c69e No changes, just spelling corrections in the comments.
Closes #14275.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71366 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-05 14:09:59 +00:00
Vadim Zeitlin
8e8d910979 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.

Closes #14268.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-05 11:22:09 +00:00
Stefan Csomor
71940de693 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
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-05 05:32:19 +00:00
Vadim Zeitlin
f8ab0cdb3e Don't return NULL widget from wxFileCtrl page of widgets sample.
This makes all the common operations such as setting tooltip, colours &c on
this page simply crash.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-04 22:20:59 +00:00
Vadim Zeitlin
5804d539be 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.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71362 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-04 22:20:55 +00:00
Vadim Zeitlin
43868fdedc Improve documentation of wxDataViewCtrl mouse event handling.
Explain that catching mouse events directly doesn't work.

Also make it clear that double clicking an item can be caught by processing
wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED.

See #14111.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-04 20:35:52 +00:00
Vadim Zeitlin
e762ef8f53 Fix precompiled headers use with MSVC in wxGTK sources.
Don't use PCH for C sources, do include wx/wxprec.h from all wxGTK C++
sources.

Closes #14224.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-04 20:35:48 +00:00
Vadim Zeitlin
982a0fcd28 Declare variables before doing anything else in C code.
Don't put statements before variable declaration in C source file. This fixes
compilation with non C99-compliant C compilers such as MSVC.

See #14224.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-04 20:35:44 +00:00
Vadim Zeitlin
7d2295a0ca Allow using non-MSW toolkit in MSVC-specific auto-linking header.
This makes it possible to auto-link wxGTK library when using MSVC too.

Closes #14272.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71358 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-04 20:35:41 +00:00
Vadim Zeitlin
47eab2f2e5 Define wxCONCATn() macro up to n=9 from n=5 previously.
We'll need it for n=6 for the next commit, so increase the max value of n a
bit more.

See #14272.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71357 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-04 20:35:37 +00:00
Vadim Zeitlin
0302691e86 Use GTK-based wxWebView when using GTK+, not under Unix.
Test for the GTK+ toolkit, not Unix platform to determine whether GTK+
wxWebView version should be used.

Closes #14273.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-04 20:35:33 +00:00
Vadim Zeitlin
c9f6f0a8cd 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.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-04 20:35:31 +00:00
Vadim Zeitlin
50cbca27ad Document wxTP_DEFAULT as a standalone constant.
Make sure the declarations in the documentation header can be really parsed.

Closes #14270.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-04 20:35:26 +00:00
Vadim Zeitlin
bb91ff63bc Don't remove the last slash from "/" directory name under Unix.
This was totally wrong as it returned empty string as (invalid) directory
name.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71353 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-04 18:31:48 +00:00
Robin Dunn
7bb22bd68d Add wxDropSource::SetIcon for wxGTK to mimic SetCursor on the other ports.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71349 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-03 23:30:40 +00:00
Robin Dunn
07b6b12176 * Change "def" to defResult as def is a reserved word in Python
* Correct some methods that were marked pure virtual but which aren't.
* etc.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-03 23:30:33 +00:00
Robin Dunn
4e4fffec19 fix incorrect default values
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71347 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-03 23:30:27 +00:00
Vadim Zeitlin
df8cd0bd5e Document wxDataViewChoiceByIndexRenderer.
At least briefly document this class too and not only its parent
wxDataViewChoiceRenderer one.

Closes #14265.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71346 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-03 10:17:19 +00:00
Vadim Zeitlin
2ebef6d174 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.

Closes #14264.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71345 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-03 10:17:15 +00:00
Stefan Csomor
18a7376a34 use explicit WakeUp variant, too many errors using heuristics, fixes #14176
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71344 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-02 19:38:58 +00:00
Stefan Csomor
4b0a48dbac make WakeUp variant explicit, too many errors using heuristics, like #14176
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-02 19:30:11 +00:00
Stefan Csomor
6e22db9e3e fixes #14178
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-02 18:44:23 +00:00
Dimitri Schoolwerth
ae580de376 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.

Closes #13512.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-02 14:44:45 +00:00
Vadim Zeitlin
c06efacb1c German translations update from Thomas Krebs.
Closes #14262.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71340 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-02 10:37:36 +00:00
Václav Slavík
dea9430d44 Fix destruction of wxDataViewCtrl's editor control.
Don't pop event handler from the control more than once.

See r70002 and r70005 (which this reverts) for reference.

Fixes #14215.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71336 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-04-30 14:51:52 +00:00
Václav Slavík
840fc4d170 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.

Fixes #14167.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-04-30 09:33:30 +00:00
Václav Slavík
b6b171522b 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.

Fixes #14167.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-04-30 09:33:25 +00:00
Václav Slavík
f0630187ea Respect minimal width in wxDataViewCtrl::GetBestColumnWidth().
See #14167.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71333 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-04-30 09:33:21 +00:00
Vadim Zeitlin
1b29603d20 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.

See #14250.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-04-29 23:48:20 +00:00
Vadim Zeitlin
f330dce9b7 No changes, just refactor common IsSorted() tests in wxGTK wxDataViewCtrl.
Add wxDataViewCtrlInternal::ShouldBeSorted() helper instead of testing for
both IsSorted() and wxDataViewModel::HasDefaultCompare() in several places.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71327 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-04-29 23:22:34 +00:00