Kevin Ollivier [Sat, 6 Feb 2010 18:19:43 +0000 (18:19 +0000)]
Fix handling of the *.* extension case, before this fix it was being passed as a "*" filter to the Cocoa dialog which, not being a valid extension, meant that no files were selectable.
Kevin Ollivier [Sat, 6 Feb 2010 01:45:58 +0000 (01:45 +0000)]
Add an accessor to get the current drop source from window.mm so that we can implement GiveFeedback support, and also move a couple functions that check the current drop source into common DND OS X code as a result.
Vadim Zeitlin [Thu, 4 Feb 2010 01:33:32 +0000 (01:33 +0000)]
Extract wxSTOCK_WITHOUT_ELLIPSIS from wxSTOCK_FOR_BUTTON.
Make it possible to use this flag on its own, without wxSTOCK_WITH_MNEMONIC
which is also part of wxSTOCK_FOR_BUTTON. This can be useful for e.g. toolbar
buttons.
Vadim Zeitlin [Thu, 4 Feb 2010 01:20:02 +0000 (01:20 +0000)]
Fix selection event sending for Ctrl-click in generic wxDataViewCtrl.
Ctrl-clicking on the only currently selected item in wxDataViewCtrl crashed
because we dereferenced first element of the empty m_selection array when
generating the selection change event.
Instead, send the event for the current item, this should be more consistent
with the native versions behaviour and at the very least doesn't crash.
Vadim Zeitlin [Wed, 3 Feb 2010 21:07:46 +0000 (21:07 +0000)]
Test wxTE_PROCESS_ENTER style in the widgets sample.
Add a checkbox for toggling wxTE_PROCESS_ENTER to the text page and use this
style by default. This makes it easier to check that this style works as
intended, including that it generates the correct events.
Julian Smart [Tue, 2 Feb 2010 22:19:33 +0000 (22:19 +0000)]
Fixes for incorrect selection, extra newline insertion when undoing deletion of selection,
incorrect SetScrollbar optimization, insufficient refresh for operations on last line,
HasCharacter/ParagraphAttributes bug.
Julian Smart [Mon, 1 Feb 2010 10:45:51 +0000 (10:45 +0000)]
Simplify SetSelectionRange and make consistent with SetSelection.
Fix a bug that returns true for character and paragraph style tests if no characters or paragraphs were found.
Fix SetSelection to position caret at end.
Vadim Zeitlin [Thu, 28 Jan 2010 12:07:16 +0000 (12:07 +0000)]
Disable wxUSE_OWNER_DRAWN for wxUniv to fix the build.
wxMenuItem in wxUniv doesn't even use wxOwnerDrawn but linking in
ownerdrwcmn.cpp is enough to break the DLL build of wxUniv at least under MSW
as it references symbols normally defined in msw/ownerdrw.cpp which is not
part of wxUniv.
Fix this by simply disabling wxUSE_OWNER_DRAWN under wxUniv for now as it's
unused anyhow.
Vadim Zeitlin [Tue, 26 Jan 2010 12:33:34 +0000 (12:33 +0000)]
Don't pass logs at unknown levels to wxLog::DoLogRecord() from wxLogGui.
This results in an assert in DoLogText() which is not implemented in the base
class but ends up being called as DoLogTextAtLevel() doesn't know how to
handle non-standard log levels otherwise. This assert happened if you simply
called wxLogMessage(wxLOG_User, ...) in the program.
Just ignore messages at unknown log levels instead in wxLogGui, by definition
it can't handle them anyhow.
Vadim Zeitlin [Tue, 26 Jan 2010 09:01:08 +0000 (09:01 +0000)]
Avoid g++ warning about unhandled wxFONTFAMILY_XXX value in a switch.
Add wxFONTFAMILY_UNKNOWN case to the switch as it will allow us to be warned
if we add a new family in the future and forget to update this code to take it
into account.
Kevin Ollivier [Sun, 24 Jan 2010 23:28:32 +0000 (23:28 +0000)]
Fix mistake, though this assert is unfortunate since now FindString("whatever") will always assert under OS X Cocoa, even when it would find and return the position correctly.
Václav Slavík [Sun, 24 Jan 2010 11:51:09 +0000 (11:51 +0000)]
Fixed dialog units <-> pixels conversion.
The computation is now identical to Windows native one. To achieve this,
MSDN-recommended GetTextExtent() call is used instead of GetCharWidth().
wxMulDivInt32() is used instead of integer arithmetics to achieve
correct rounding.
Use toplevel parent's font instead of window's own. This makes more
sense, as dialog units are defined for TLWs, not individual subcontrols.
Also fixed wxMSW's wxButton::GetDefaultSize() to compute dialog units
correctly.
Vadim Zeitlin [Sun, 24 Jan 2010 11:33:11 +0000 (11:33 +0000)]
Document that wxComboBox::Dismiss() and Popup() generate events.
Currently these functions generate events in both of the existing
implementations (GTK and MSW) so it is simpler to let them to continue to do
it but this must at least be documented as this is probably unexpected by
users.
Vadim Zeitlin [Sun, 24 Jan 2010 10:13:40 +0000 (10:13 +0000)]
Correct bug with returning 0 for non-empty input from wxConvAuto::ToWChar().
Since the changes of r63064 we could return 0 when asked to convert a
non-empty buffer containing only a BOM. This confused the logic in
wxTextInputStream::NextChar() and was generally unexpected so now return
wxCONV_FAILED in this case.
Vadim Zeitlin [Sun, 24 Jan 2010 10:13:33 +0000 (10:13 +0000)]
Check the result of ToWChar() call in wxTextInputStream::NextChar() better.
The logic in this function depends on ToWChar() working correctly so check
that it doesn't return obviously wrong results, e.g. 0 output length for
non-empty input. This was mostly done to detect the problem in wxConvAuto
currently but it could also be useful with user-defined conversions and
shouldn't have a big performance effect on wxTextInputStream so leave these
checks in to facilitate debugging in the future.
Vadim Zeitlin [Sun, 24 Jan 2010 09:13:40 +0000 (09:13 +0000)]
Replace wxLogWarning()s in wxOSX wxComboBox code with asserts.
This incidentally fixes compilation when not using PCH as wx/log.h was not
included but is also more correct as the messages meant for the programmer,
and not the user, should be given using asserts and not wxLog.
Also correct some asserts messages. In particular, don't mention the function
name in the message itself as it's already shown by the assert and using it in
the string itself isn't useful and simply introduces the risk of forgetting to
update it after refactoring, as happened here in r63105.
Vadim Zeitlin [Sun, 24 Jan 2010 01:00:27 +0000 (01:00 +0000)]
Fix sending of wxEVT_COMMAND_LIST_COL_DRAGGING events in wxMSW wxListCtrl.
We were not getting HDN_TRACK from the system because apparently it is not
sent for header controls with HDS_FULLDRAG style which is used by default by
the native list control. A possible solution would be to forcefully unset this
style but this would make the UI look old fashioned and less intuitive so
instead send these DRAGGING events from HDN_ITEMCHANGING.
Vadim Zeitlin [Sun, 24 Jan 2010 00:59:56 +0000 (00:59 +0000)]
Use a helper wxNEEDS_DECL_BEFORE_TEMPLATE symbol in wxStrcoll() workaround.
The condition for which this workaround is needed has already changed once
(see #11605) and may change again in the future as we test with more compilers
so use a symbolic name for it.
Vadim Zeitlin [Sat, 23 Jan 2010 13:44:46 +0000 (13:44 +0000)]
Add virtual wxSizer::DoInsert() to replace Insert().
This allows to avoid problems with hiding all but the overridden overloads of
Insert() in wxSizer-derived classes, see #11616, without having to explicitly
write any using statements.
Keep Insert(size_t, wxSizerItem) virtual to allow the existing code overriding
it to keep working.
Vadim Zeitlin [Sat, 23 Jan 2010 13:22:25 +0000 (13:22 +0000)]
Allow to not create wxPaintDC in EVT_PAINT handler in wxMSW.
Failure to create a wxPaintDC in EVT_PAINT handler resulted in many serious
and difficult to debug problems under wxMSW. We used to document that the user
shouldn't do it but this wasn't enough (see #11648). We could also assert if
we detected that a handler didn't create a wxPaintDC but it seems better to
just handle this case gracefully for consistency with the other platforms.
Add wxDidCreatePaintDC global variable which is reset before generating
wxPaintEvent and set to true when ::BeginPaint() is called from wxPaintDC
ctor and validate the update region of the window ourselves if it wasn't set
(meaning that wxPaintDC wasn't created).
Update the documentation to emphasize the link between EVT_PAINT handlers and
wxPaintDC but without saying that wxPaintDC object must always be created in
the handler as this is not true any more.