Vadim Zeitlin [Thu, 22 Dec 2011 14:47:54 +0000 (14:47 +0000)]
Dramatically optimise inserting many items in wxGenericListCtrl.
During each item insertion SetItem() was called and this resulted in a call to
GetItemRect() which, in turn, re-laid out all items in the control meaning
that the relatively expensive wxListMainWindow::RecalculatePositions() was
called N times when inserting N items.
Reduce this to just a single call by not refreshing the item in SetItem() if
everything is going to be redrawn soon anyhow.
This decreases the time needed to insert a couple of thousands of items in
icon view from several minutes to less than a second.
Vadim Zeitlin [Thu, 22 Dec 2011 13:35:01 +0000 (13:35 +0000)]
Add wxLogFormatter to allow easier wxLog output customization.
Delegate the log string creation to wxLogFormatter. This allows defining a
custom object of a class derived from it to customize the log output instead
of having to override DoLogRecord() in wxLog itself.
Vadim Zeitlin [Wed, 21 Dec 2011 13:56:50 +0000 (13:56 +0000)]
Correct generic wxListCtrl display of items with icons in list mode.
The changes of r70066 improved the layout for icon and small icon modes but
broke it for the list mode if items had icons because the item width should
account for the icon as well in this case. Simply disable the code added in
this revision when in list mode, we don't need to do anything then anyhow as
the layout already worked correctly for it.
Vadim Zeitlin [Wed, 21 Dec 2011 13:56:47 +0000 (13:56 +0000)]
Guard against a possible crash in wxListCtrl::DeleteColumn().
We could crash when deleting a column after switching to report view from icon
view. As deleting a column works just fine under MSW in this case, make it
work in the generic version as well.
Vadim Zeitlin [Wed, 21 Dec 2011 13:07:18 +0000 (13:07 +0000)]
Document wxListCtrl::InReportView() and IsVirtual().
These functions are more convenient than directly testing for styles and are
already used outside wxWidgets do make them officially part of the public API.
Vadim Zeitlin [Tue, 20 Dec 2011 21:27:14 +0000 (21:27 +0000)]
Provide native implementation of wx{Date,Time}PickerCtrl for wxOSX/Cocoa.
Use NSDatePicker to implement both of these controls. Almost all of
wxDatePickerCtrl styles are not supported in the native version but the basic
functionality does work and looks much better than the generic version (which
is still available as wxDatePickerCtrlGeneric if needed) under Mac.
Vadim Zeitlin [Tue, 20 Dec 2011 21:27:09 +0000 (21:27 +0000)]
Added helpers for translating between wxDateTime and NSDate.
These functions will be used in the upcoming native implementations of
wxDatePickerCtrl and wxTimePickerCtrl but could also be reused elsewhere in
wxOSX/Cocoa, notably in wxDataViewCtrl where strange ad hoc code is currently
used.
Vadim Zeitlin [Tue, 20 Dec 2011 13:27:59 +0000 (13:27 +0000)]
Add support for webview library to MSW bakefile presets.
The webview library wasn't linked in correctly when using MSW bakefile
presets. Fix this by adding the corresponding <sys-lib> for it (this needs to
be done for MSW only, under Unix it's handled by wx-config).
Vadim Zeitlin [Mon, 19 Dec 2011 12:54:32 +0000 (12:54 +0000)]
Don't use dummy "inline" in wxDEPRECATED_CONSTRUCTOR definition.
Apparently we need this bogus "inline" for g++ < 3.4 but there is no reason to
use it for the other compilers and this results in linking errors with e.g.
MSVC, so remove it.
Fixed min and max label values not being swapped when using wxSL_INVERSE in a horizontal MSW slider.
Changed wxSlider::GetLabelsSize to let the widthMin and widthMax values contain the width of what the minimum (always on the left/top) and maximum (always on the right/bottom) _label_ will contain. This is not the same as the minimum and maximum _value_ in case of using wxSL_INVERSE.
Also don't swap the position of the min/max labels in a horizontal slider with wxSL_INVERSE (just how the labels already stay in place in a vertical slider, regardless of wxSL_INVERSE usage), nor their width.
Vadim Zeitlin [Sun, 18 Dec 2011 14:38:47 +0000 (14:38 +0000)]
Add a reminder to update version.bkl to inc_release script.
While docs/tech/tn0011.txt does document this, it's still too simple to forget
to update version.bkl, as my experience shows, so add a reminder to the script
itself too.
Vadim Zeitlin [Sun, 18 Dec 2011 12:27:04 +0000 (12:27 +0000)]
No changes, just use wxScopedPtr instead of explicit "delete".
Use wxScopedPtr in wxGenericFileDirButton to ensure that the dialog created by
it is always destroyed, even if an exception is thrown while showing the
dialog or while processing the event we generate after showing it.
Vadim Zeitlin [Sat, 17 Dec 2011 23:04:50 +0000 (23:04 +0000)]
Don't activate MSW dialogs when setting their initial size.
As the dialog is not shown yet at this moment, activating it didn't work
correctly and the dialog didn't get the focus when it was shown later.
Fix this by preventing ::SetWindowPos() from activating it, which it does by
default.
Vadim Zeitlin [Fri, 16 Dec 2011 19:57:17 +0000 (19:57 +0000)]
Don't use wxTE_DONTWRAP style in Lines() wxTextCtrl unit case.
The last check in this test couldn't pass under MSW as it relied on the (long)
line of text being wrapped but the style used for the control prevented this
from happening. Not sure how could it have ever worked before but in any case
removing wxTE_DONTWRAP does make the test pass.
Vadim Zeitlin [Fri, 16 Dec 2011 19:47:58 +0000 (19:47 +0000)]
Keep the item being updated selected in wxMSW wxChoice::SetString().
Changing the text of the selected wxChoice (or wxComboBox, as it derives from
it in wxMSW) item made it unselected. Fix this by explicitly restoring the
selection to the item if needed.
Vadim Zeitlin [Fri, 16 Dec 2011 19:47:55 +0000 (19:47 +0000)]
Corrected test for region validity in wxMSW wxRegion::DoOffset().
Checking M_REGION is not enough as the region can be invalid (meaning
m_refData dereferenced inside M_REGION is NULL itself) and not just not
initialized, so it resulted in crashes and not just the expected assert
failure when wxRegion::Offset() was called for an invalid region.
Vadim Zeitlin [Fri, 16 Dec 2011 19:33:31 +0000 (19:33 +0000)]
Use IsThisEnabled() to test if AUI child is enabled, not IsEnabled().
IsEnabled() returns false if the parent window is disabled and calling
Enable() does not help with this, so we could keep trying and trying to enable
the window unsuccessfully if it was reenabled while its parent was disabled,
resulting in a never-ending stream of EVT_IDLE events.
Vadim Zeitlin [Fri, 16 Dec 2011 11:03:15 +0000 (11:03 +0000)]
Make multiline checkboxes wider in wxMSW to avoid word wrap.
At least for some versions of Windows (Server 2003 with classic look and feel)
the native checkboxes auto wrapped the label as it wrongly considered that the
width we specified for it was not big enough. Compensate for this by making
the checkbox wider -- this is just a hack but still better than corrupting the
checkbox display.
Vadim Zeitlin [Fri, 16 Dec 2011 09:36:36 +0000 (09:36 +0000)]
Output the value of --enable-debug option in configure.
As we use AC_ARG_ENABLE() instead of WX_ARG_ENABLE() for it, we need to call
AC_MSG_RESULT() explicitly or its value is never reported and configure output
is corrupted.
Vadim Zeitlin [Thu, 15 Dec 2011 21:13:03 +0000 (21:13 +0000)]
Compilation fix for wxStopWatch with wxUSE_THREADS==0.
Use wxCRIT_SECT_DECLARE_MEMBER/wxCRIT_SECT_LOCKER macros which expand to
nothing in wxUSE_THREADS==0 case instead of using wxCriticalSection[Locker]
classes which are not defined then.
Vadim Zeitlin [Thu, 15 Dec 2011 00:22:48 +0000 (00:22 +0000)]
Ensure that wxPropertyGrid::m_tlp is initialized early enough.
This member variable could be used before it was initialized as
OnTLPChanging() was called from Create() before Init2(), where m_tlp was
assigned NULL, was called.
Václav SlavÃk [Wed, 14 Dec 2011 16:00:30 +0000 (16:00 +0000)]
Close wxDataViewCtrl inline editor when destroying the control.
If the wxDataViewCtrl control was destroyed while an inline editor
control was still active, it wouldn't get destroyed in the right order
and the ~wxWindow assert about unpopped event handlers would be
triggered.
Fix this by popping the handler as one of the first things in
wxDataViewRendererBase destructor.
Václav SlavÃk [Wed, 14 Dec 2011 15:53:28 +0000 (15:53 +0000)]
Don't change horizontal scroll position needlessly in wxDataViewCtrl.
When ScrollTo() or EnsureVisible() was called in the generic
wxDataViewCtrl implementation with unspecified column, horizontal scroll
position was reset to left-most position, which doesn't make much sense.
Instead, leave horizontal position unchanged in this case and only
change it when explicitly requested.
Vadim Zeitlin [Tue, 13 Dec 2011 21:08:17 +0000 (21:08 +0000)]
Use string column identifiers with NSTableColumns in wxDataViewCtrl.
Starting with OS X 10.7 the column identifiers used in NSOutlineView must be
of type NSString, so convert the code to use string identifiers instead of
wxPointerObject.
Vadim Zeitlin [Mon, 12 Dec 2011 14:01:23 +0000 (14:01 +0000)]
Rename src/generic/timectrl.cpp to timectrlg.cpp.
We can't use the same names for these files with VC6, it doesn't support this
and the project can't be built because of the output object file names
conflict.
Vadim Zeitlin [Mon, 12 Dec 2011 13:08:46 +0000 (13:08 +0000)]
Remove the item before notifying about it in wxDataViewIndexListModel.
Remove the item from the internal representation of the model before calling
ItemDeleted() callback so that the callback sees the model in a consistent
state.
This is more consistent with the other callbacks (e.g. ItemAdded()) and other
models (e.g. wxDataViewVirtualListModel) and should fix crashes in wxOSX
version of the control.
Vadim Zeitlin [Sun, 11 Dec 2011 17:03:56 +0000 (17:03 +0000)]
Ensure that Enter key presses are never stolen from wxButton in wxMSW.
This commit fixes the following bug: when an in-place editor control containing
an embedded button was used in wxDataViewCtrl, pressing Enter on the button
would close the editor, accepting changes, instead as (generic) wxDataViewCtrl
intercepts WXK_RETURN in its EVT_CHAR_HOOK handler. To prevent this from
happening, wxButton now handles EVT_CHAR_HOOK itself and never lets the parent
window intercept it if it's for WXK_RETURN. To ensure that normal
wxEVT_KEY_DOWN and wxEVT_CHAR are still generated in this case, wxButton
handler calls the new wxKeyEvent::DoAllowNextEvent() method that was added to
allow suppressing EVT_CHAR_HOOK only, without affecting the subsequent events.
DoAllowNextEvent() is currently only used in wxMSW but support for it was also
added to wxGTK and (both) wxOSX ports.
Vadim Zeitlin [Fri, 9 Dec 2011 21:41:36 +0000 (21:41 +0000)]
Quote variables in -z tests correctly in wx-config.
The changes of r69944 broke wx-config for the traditional Unix systems (at
least Solaris and AIX, probably others too) which don't support using -z
without any value (unlike Linux/bash).
Fix this by quoting the possible empty variables in the tests.
Vadim Zeitlin [Fri, 9 Dec 2011 15:20:55 +0000 (15:20 +0000)]
Restore mouse capturing/releasing in wxPopupTransientWindow under MSW.
Partially revert the changes of r69350 to restore EVT_IDLE handling of
wxPopupTransientWindow under MSW. It turns out that we must release the mouse
for the embedded controls to work.
It would be better to solve the problem differently, e.g. perhaps maybe only
releasing mouse capture when mouse is clicked as the current code is fragile
but for now at least restore the functionality that used to work.
Vadim Zeitlin [Thu, 8 Dec 2011 14:47:37 +0000 (14:47 +0000)]
Only declare wxComboBox::Popup/Dismiss() when using Cocoa in wxOSX.
wxOSX/Carbon doesn't use the core implementation file so declaring these
methods for the Carbon version resulted in linking errors. Just don't do this,
they're not implemented for Carbon anyhow.
Vadim Zeitlin [Wed, 7 Dec 2011 23:41:14 +0000 (23:41 +0000)]
Work around impossibility to use wxCombobox in wxGrid in wxOSX.
Open the combobox when the editor is initially shown, this somehow ensures
that the combobox selection is taken into account when it is closed while
without this the selection is simply completely ignored.
This is just a hack but at least it allows to use wxGridCellChoiceEditor under
wxOSX which was previously impossible at all.
Vadim Zeitlin [Wed, 7 Dec 2011 23:41:10 +0000 (23:41 +0000)]
Use NSApp abortModal instead of stopModal to end modal dialogs.
Using abortModal is apparently the right thing to do if the dialog is not
being closed as the result of user action (but e.g. because a timer expired)
and shouldn't change anything if it done because of something the user did
(e.g. clicked on a button).
Vadim Zeitlin [Wed, 7 Dec 2011 23:21:06 +0000 (23:21 +0000)]
Don't use gtk_menu_item_set_submenu() with NULL menu with GTK+ < 2.12.
In GTK+ 2.10 and earlier gtk_menu_item_remove_submenu() had to be used to
remove the items submenu as gtk_menu_item_set_submenu() gave errors when
passed NULL submenu, so call the old function when using old GTK+ version.
Vadim Zeitlin [Wed, 7 Dec 2011 14:35:23 +0000 (14:35 +0000)]
Fix the size of the buffer when using wxIPC::Execute() with DDE.
Don't multiply the "realSize" variable by sizeof(wxChar) when passing it to
DdeClientTransaction(), as its name indicates it is already supposed to be the
size of the data and not the length of the string so just ensure that it is
always correctly set to the size and not length when initializing it.
Vadim Zeitlin [Wed, 7 Dec 2011 14:05:11 +0000 (14:05 +0000)]
Remove vertical wxTextCtrl adjustment hacks for wxMSW in wxComboCtrl code.
Because wxTextCtrl used to wrongly report its best size in wxNO_BORDER case
under MSW, wxComboCtrl manually adjusted its position to work around this.
However since r69066 wxTextCtrl::GetBestSize() was fixed and now these
adjustments resulted in wrong vertical position for the control.
Just remove all manual adjustments completely now to fix this.