fix incoherency between the wxThread implementation based on MSW threads and pthread: Delete()ing a thread which hasn't started yet must return wxTHREAD_MISC_ERROR
Vadim Zeitlin [Tue, 25 May 2010 21:15:24 +0000 (21:15 +0000)]
Fix setting the fonts for wxMSW wxTextCtrl with wxTE_RICH(2) style.
Using WM_SETFONT seemed to work with rich edit controls but in fact it
doesn't, it only changes the font used by the control initially apparently but
it can be reset later.
Vadim Zeitlin [Sun, 23 May 2010 10:53:17 +0000 (10:53 +0000)]
Remove non-working or semi-working tests added from console.cpp.
Remove tests added in r64324, there is no need to have commented out code
here and UTF-8 test was pretty strange as well (it's far from clear what
should the result of converting "utf8Invalid" be).
This also suppresses a warning that these changes introduced.
Vadim Zeitlin [Sat, 22 May 2010 15:43:00 +0000 (15:43 +0000)]
Restore selection on click in row/column selection mode in wxGrid.
This might be less consistent with the other selection modes but seems to be
more convenient in practice, so restore the old, 2.8 behaviour and select the
entire row/column on a simply click in row/column selection mode.
Vadim Zeitlin [Sat, 22 May 2010 14:57:34 +0000 (14:57 +0000)]
Modify wxBoxSizer minimal size calculations to respect the proportions.
Make wxBoxSizer minimal size big enough to not only give each item enough
space to satisfy its minimal size but also to respect the proportions among
the items by default.
Vadim Zeitlin [Sat, 22 May 2010 11:58:50 +0000 (11:58 +0000)]
Correct notebook sample layout.
Use a sizer for the frame to make sure its initial and minimal size correspond
to the best size of the panel inside it. Also add a Layout() call on the panel
which was somehow not done initially. And finally don't centre the frame, this
is unnecessary.
Vadim Zeitlin [Sat, 22 May 2010 10:51:27 +0000 (10:51 +0000)]
Unset the debug report preview dialog as critical window when it's hidden.
Otherwise no events can be dispatched to any other window after
wxDebugReportPreviewStd::Show() is called, resulting in apparent hanging of
the application as can be seen in debugrpt sample.
Robert Roebling [Fri, 21 May 2010 20:13:49 +0000 (20:13 +0000)]
Second try to get wxDataViewChoiceByIndex and its name right, hopefully fixes #11970: wxDataViewChoiceRenderer set/get methods should use the current selection
index not a string
Vadim Zeitlin [Fri, 21 May 2010 13:17:30 +0000 (13:17 +0000)]
Erase the column label background in wxGrid to avoid display artefacts.
Apparently the column label text is not always drawn correctly when double
buffering is used, so erase the background completely before drawing the text.
Unfortunately this might result in flicker but presumably correct display is
more important.
Vadim Zeitlin [Fri, 21 May 2010 12:52:12 +0000 (12:52 +0000)]
Always define SIZEOF_WCHAR_T if it's not defined under Windows.
The assumption that SIZEOF_EVERYTHING_ELSE is defined when SIZEOF_INT is is
wrong. While wxWidgets configure does define all SIZEOF_XXX at once,
SIZEOF_INT could also be defined in some third party headers (e.g. Python.h)
and we still need to define the other ones.
In particular, doing this fixes the problem with SIZEOF_WCHAR_T not being
defined during wxPython build.
Vadim Zeitlin [Fri, 21 May 2010 12:51:20 +0000 (12:51 +0000)]
Simplify and correct MSW selection of background brush for children painting.
Check for the transparency of the window background in MSWGetBgBrush() itself
and let MSWGetBgBrushForChild() just return the brush to be used.
This required adding a MSW-specific hack to wxPanel to allow inheriting
background of wxNotebook by its children which is slightly ugly but is exactly
what we need to do in this case and makes the rest of the code much simpler.
Also add a possibility to set the background of the page containing the
control being tested to the widgets sample to test for background inheritance.
This shows problems with wxSlider and wxRadioBox backgrounds but they're not
new with this patch.
Vadim Zeitlin [Fri, 21 May 2010 12:07:45 +0000 (12:07 +0000)]
Yet another fix to event propagation in scrolled windows.
Calling ProcessEventLocally() didn't work because the command events were not
propagated to the parent window any more, breaking a lot of things including
wxDataViewCtrl event generation in the generic version. So do restore
ProcessEvent() call but use it on the next handler (i.e. the window itself)
and not this one now. This still results in some duplicate calls but at least
the events should be passed everywhere where they are expected to arrive.
Vadim Zeitlin [Thu, 20 May 2010 17:33:26 +0000 (17:33 +0000)]
Fix wxScrollHelperEvtHandler broken by recent changes to event processing.
Use ProcessEventLocally() added in r64261 (which was probably the one to break
this) to forward event to the window itself instead of ProcessEvent() in
wxScrollHelperEvtHandler::ProcessEvent() implementation. Calling ProcessEvent()
didn't work any more in a case when another event handler was pushed on a
wxScrolledWindow: in this case the EVT_SIZE and EVT_PAINT handlers defined in
the window itself were not called at all any more.
Add a unit test checking for the even more tortuous than usual event
processing path in this particular case.
Robert Roebling [Sun, 16 May 2010 15:52:35 +0000 (15:52 +0000)]
Added quick implementation of wxDataViewChoiceByIndexRenderer, closes #11970 (wxDataViewChoiceRenderer set/get methods should use the current selection index
move TestUtf8() and TestEncodingConverter() functions to UnicodeTestCase. Disable some code which does not run clean and mark it with FIXME comments (needs revision).
Robert Roebling [Sun, 16 May 2010 14:44:58 +0000 (14:44 +0000)]
Don't call super class explicitly so overriding is possible, closes #12025 (wxDataViewVirtualListModel calls super-class' version of certain virtual methods).
Václav Slavík [Sun, 16 May 2010 13:21:03 +0000 (13:21 +0000)]
Fix incorrect painting of backgrounds inside notebook.
Children without transparent background (e.g. wxListBox) were still
pained using notebook's background brush. They shouldn't, it should
apply only to transparent-bg controls.
Vadim Zeitlin [Sat, 15 May 2010 11:15:09 +0000 (11:15 +0000)]
Clip drawing in wxRendererGeneric::DrawHeaderButtonContents().
Clip drawing of the icon and bitmap to the header rectangle.
Don't clip the text because we already ellipsize it to avoid overflowing but
do the ellipsization correctly, using wxControl::Ellipsize() instead of the
simple (and wrong) duplicated version here.
Also correct and simplify the alignment calculations.
Vadim Zeitlin [Sat, 15 May 2010 10:47:28 +0000 (10:47 +0000)]
Remove wxGTK-specific text shift in wxRenderer::DrawHeaderButtonContents().
This was probably related to the code removed by r63947 and doesn't seem to be
needed here neither (and could presumably result in the same problems as in
the ticket #11780).
Vadim Zeitlin [Thu, 13 May 2010 15:31:35 +0000 (15:31 +0000)]
Never enable wxSpinCtrlGenericBase window itself at underlying toolkit level.
We create wxSpinCtrlGenericBase window disabled at underlying toolkit level
(but enabled at the level of wxWidgets API, of course), but calling Disable()
and Enable() on it re-enabled it resulting in loss of mouse events under
Windows.
Don't re-enable it (again, at the low-level toolkit level only) in its
Enable() any more but keep this window itself always disabled.
Vadim Zeitlin [Thu, 13 May 2010 15:31:30 +0000 (15:31 +0000)]
Use GetWidgets() in the widgets samples instead of GetWidget2().
Add a function which can be overridden to return an arbitrary number of
widgets instead of having just GetWidget() and GetWidget2(): spin control page
already uses 3 widgets (and defines GetWidget3() which is never called) and we
could have even more in the future. Just use a generic solution which will
always work.
The practical consequence of this is that the "Enable/Disable" menu item now
also enables and disables the wxSpinCtrlDouble in the spin page, see #12045.
Vadim Zeitlin [Thu, 13 May 2010 14:37:00 +0000 (14:37 +0000)]
Document wxDocument::DeleteContents().
This method purpose was not quite clear as it was only mentioned in passing in
documentation of OnCloseDocument() but not really documented itself.
Also don't call it from wxDocument dtor as this is useless: the user-defined
overridden version will never be called from here and the base class version
does nothing.
Vadim Zeitlin [Wed, 12 May 2010 14:34:18 +0000 (14:34 +0000)]
Refactor wxDocParentFrame and wxDocMDIParentFrame to share common base class.
Use the same approach as for the child frames: add a base template class which
allows wxDocParentFrame to inherit from wxFrame and wxDocMDIParentFrame from
wxMDIParentFrame while still allowing to reuse the common code.
This reduces code duplication and should make implementing parent AUI document
frame easier as well, see #8945.
Vadim Zeitlin [Mon, 10 May 2010 21:10:03 +0000 (21:10 +0000)]
Change wxDIALOG_NO_PARENT value to avoid clashing with wxCENTRE.
Use a bit freed by removing wxTINY_CAPTION_HORIZ for wxDIALOG_NO_PARENT. This
allows to move it out from the lower byte of the style word to avoid conflicts
with the button selection flags which can be commonly combined with the dialog
styles.
More precisely, wxDIALOG_NO_PARENT used to clash with wxCENTRE, meaning that
wxSingleChoiceDialog, for example, was always created without parent because
its default style included wxCENTRE. This commit fixes this particular bug and
probably more similar ones.