Jaakko Salli [Sun, 8 Aug 2010 12:22:08 +0000 (12:22 +0000)]
Moved wxPGProperty::SetFlag() to protected API since it does not have any side-effects that are usually desired in the user code. Added wxPGProperty::SetAutoUnspecified() since wxPG_PROP_AUTO_UNSPECIFIED can no longer be set (conveniently) with SetFlag().
Vadim Zeitlin [Sun, 8 Aug 2010 11:37:57 +0000 (11:37 +0000)]
Add name argument to wxDataViewCtrl ctor for consistency.
As all the other wxWidgets controls take the parameter in their ctor/Create()
it's unexpected that wxDataViewCtrl does not. Add the name parameter and pass
it to wxWindowBase::CreateBase() as usual.
wxDataViewCtrlInternal is a private class used only inside wxWidgets itself
and doesn't need to be exported from the shared library, so remove the
unnecessary WXDLLIMPEXP_ADV from its declaration.
Vadim Zeitlin [Sun, 8 Aug 2010 11:37:41 +0000 (11:37 +0000)]
Use helper class instead of manually calling gtk_tree_path_free().
No real changes, just simplify the code and make it more obviously correct by
ensuring that all temporary tree paths are always destroyed because they are
assigned to a wxGtkTreePath object which does it in its dtor instead of
calling gtk_tree_path_free() manually every time.
Vadim Zeitlin [Sun, 8 Aug 2010 11:37:37 +0000 (11:37 +0000)]
Add wxDataViewCtrl::GTKPathToItem() function and use it.
No real changes, just refactor the code to use a function mapping GtkTreeIter
to our wxDataViewItem and use it instead of duplicating its code everywhere.
Vadim Zeitlin [Sun, 8 Aug 2010 11:35:55 +0000 (11:35 +0000)]
Include wx/defs.h before testing for wxUSE_CHECKLISTBOX.
We need to include wx/defs.h that (indirectly) defines wxUSE_CHECKLISTBOX
before testing for it in wx/checklst.h, otherwise the test may fail if the
latter header is the first wx header included by the user code.
Václav Slavík [Fri, 6 Aug 2010 16:28:46 +0000 (16:28 +0000)]
Fix DnD in generic wxDataViewCtrl when scrolled.
wxDataViewMainWindow drag and drop code incorrectly used Y coordinate
where X axis should be used to check whether the mouse is inside columns
area. This manifested itself as refusing to accept drops once the
control was sufficiently scrolled down.
Václav Slavík [Thu, 29 Jul 2010 20:54:00 +0000 (20:54 +0000)]
Fix wxDataViewCtrl to omit expander space for all kinds of lists.
List-only models don't have expanders and so the control shouldn't
reserve any space for them; the notion of expander column doesn't make
sense here.
Previously, this was done correctly only for wxDataViewVirtualListModel;
"ordinary" list models, such as the one used by wxDataViewListCtrl, were
treated as generic tree models and 0th column had ugly empty space
reserved for (never used) expander.
This patch fixes it by adding IsListModel() helper function in
addition to existing IsVirtualListModel(). Some of the
IsVirtualListModel() tests were changed into IsListModel() checks as
appropriate.
Add association between wxOSX wxTextWidgetImpl and wxTextEntry.
This allows to always find the correct wxTextEntry to use in the
implementation of text-related widgets without using any casts. Notably, the
wrong up-cast of wxWindow to wxTextCtrl in wxNSTextFieldControl::controlAction()
which resulted in a crash when the window was actually a wxComboBox can now be
fixed.
Correct format specifiers used to show wxIPV4address.
wxIPV4address::IPAddress() used %lu to show each of (byte-sized) IPv4 address
components for some reason, which resulted in asserts about format specifier
mismatch. Fix this by just using %u.
Robert Roebling [Tue, 27 Jul 2010 17:04:44 +0000 (17:04 +0000)]
Let wxMSW report wxDataViewCustomRenderer::LeftClick() report the click position relative to the inner cell, not the window - as in wxGTK, fixes #12270: wxDataViewCustomRenderer::LeftClick behaves differently under wxGTK and
wxMSW
Only define WXUSINGDLL in multilib builds for wxscintilla.lib.
In monolithic builds wxscintilla is linked directly into the one and only wx
DLL and doesn't need to import anything from it, WXUSINGDLL is only needed in
multilib case when wxscintilla is part of wxCore DLL and does need to import
symbols (e.g. wxQsort() used by wxVector) from wxBase one.
Correct creation of the mask for wxImage cursors in wxGTK.
The code created the monochrome bitmap used by wxCursor(wxImage) ctor
incorrectly resulting in bad cursor appearance. Use the right values for
foreground and background pixels (which are inversed compared to naive
expectations) to fix this.
Build fix: don't test for __WXMSW__ using #if in wx/defs.h.
__WXMSW__ should be tested using #ifdef but in fact there doesn't seem to be
any need to test for it at all here as __CYGWIN__ implies __WXMSW__ anyhow.
Jaakko Salli [Sun, 25 Jul 2010 10:36:19 +0000 (10:36 +0000)]
Refactored validation of numeric properties (wxIntProperty, wxUIntProperty and wxFloatProperty). They now use (basically) a single template function instead of three separate ones.
Jaakko Salli [Sun, 25 Jul 2010 09:30:50 +0000 (09:30 +0000)]
Added wxVariant::Convert() implementations for wx(U)LongLong_t, so that wxVariant can be converted to native 64-bit integer types on the same terms as it is converted to other numeric types (useful in e.g. template functions)
No real changes in makefile but avoid repetitious in bakefile.
Collect all preprocessor options needed for Scintilla compilation in
wxscintilla_cppflags template and use for both Scintilla compilation itself
and for the wx libraries using it.
The order of flags in the makefiles has changed but they are still the same
except for Borland makefile which now includes Borland-specific warning
suppression option everywhere it's needed and not just in multilib targets.
Remove asserts in wxMSW::wxTLW::SetIcons() and always set some icon.
In practice having the icons of the exact size for all versions of Windows is
not always possible, there are just too many of them. So set the icon of the
most suitable size if no exact match is found instead of asserting in this
case.
Revert the change of r44514 and do hide the empty sizers. Code relying on them
being shown/positioned should use wxRESERVE_SPACE_EVEN_IF_HIDDEN flag but
assuming it by default results in completely unexpected layouts, e.g. still
using margins around a sizer with hidden window if it contains an empty
sub-sizer.
Postpone showing the notebook pages under wxOSX/Cocoa.
Showing the selected notebook page immediately when it's selected can result
in the top level parent of the notebook being shown prematurely, so don't do
this until the notebook itself is shown.
Remove hard limit on number of pages in wxHtmlPrintout.
This seems to be a leftover from an old version in which the page breaks
positions were stored in a fixed size array. As the code uses a dynamic array
now there doesn't seem to be any reason to impose any limit on the number of
pages and some people did run into the old 999 pages limitation apparently.
Remove selection showing code from the grid sample.
This code is broken as it doesn't always show the selection correctly and
doesn't handle rows-or-columns selection mode at all. Until we can fix it
properly it's better to not have it at all so that at least people avoid
copying the wrong code into their own programs.
Implement wxAuiDefaultTabArt::Clone() using its copy ctor.
Compiler-generated copy ctor works just fine for this class, there is really
no reason to reimplement it, especially wrongly (as it loses many and even
most of the fields), in Clone().
Ensure that wxAuiNotebook::SetArtProvider() always does set it.
It used to only set the provider if the height of the tabs defined by the new
provider was different from the one used by the old one, otherwise the call
was optimized away. Fix this by explicitly setting the art provider for all
tabs in SetArtProvider() itself if UpdateTabCtrlHeight() didn't do it.
Propagate wxHtmlWindow layout direction to the wxDC it uses.
While wxHtmlWindow doesn't support mixing LTR and RTL contents we can indeed
try to make it render pure RTL stuff correctly by setting up the wxDC used for
drawing accordingly.
Allow wxAUI to change the toolbar orientation depending on where is it docked.
It is also now possible to specify wxAUI_TB_VERTICAL or HORIZONTAL to force
the toolbar to be always oriented in the given sense and to prevent it from
being docked at the sides incompatible with it.
Don't assert in wxDataViewCtrl::ItemDeleted() if item doesn't exist.
It seems that it might be valid to delete the items that the GUI control
doesn't know anything about, e.g. this could happen when deleting a child of a
collapsed node in a tree model. So remove the asserts which were triggered in
this case as there doesn't seem to be any way to avoid them with the current
code.
Store the result of wxWindow::NewControlId() in wxWindowIDRef.
The result of calling NewControlId() must be assigned to wxWindowIDRef to be
accounted for correctly, otherwise the id was marked as free while a reference
to it still existed resulting in asserts in id management code when we
attempted to reuse it.
Allow passing multi-line strings to wxDC::DrawText(), even under MSW.
Native wxMSW wxDC::DrawText() implementation doesn't support multi-line
strings so use the generic wxDC::DrawLabel() code instead. Drawing multi-line
strings now works at least in wxGTK and wxMSW, to be tested for the other
platforms.
Avoid using Cygwin sockets as our code assumes that we use WinSock API under
Windows currently (this might change in the future) by defining
__USE_W32_SOCKETS.
Use new, safer and more efficient cygwin_conv_path() function.
Use t_str() instead of fn_str() with Windows API taking file names, under
Cygwin they are different and using fn_str() is incorrect.
Added wxFONTENCODING_EUC_KR alias for wxFONTENCODING_CP949.
Although CP949 might not be exactly the same as EUC-KR it appears to be
similar enough and having a more familiar name for it is helpful for people
unfamiliar with Windows nomenclature.
Define colours for all wxSYS_COLOUR_XXX values in wxUniv.
Ensure that we have enough elements in the array used by
wxSystemSettings::GetColour() in wxUniv to avoid the assert which happened
when e.g. wxSYS_COLOUR_LISTBOXTEXT was requested from it. This resulted in
an infinite stream of asserts and a crash when trying to use wxTreeCtrl in
wxUniv.
Fix harmless unused parameter warnings in wxDEBUG_LEVEL==0 build.
These warnings were harmless as they concerned the parameters used inside
wxASSERTs only but there were hundreds if not thousands of them in
wx/strvararg.h alone so all the rest of build output was completely lost in
them.
Make --disable-debug[_flag] configure option really work.
We never defined wxDEBUG_LEVEL as 0 meaning that debugging code in wxWidgets
was always enabled, even if --disable-debug_flag or --disable-debug (which
implies it) was given.
Fix this now by adding -DwxDEBUG_LEVEL=0 to CPPFLAGS if necessary.
Add wxItemContainer::DetachClientObject() and use it in wxRearrangeList.
Add a method to detach the item from an item control without deleting it and
use it in wxRearrangeList to correctly swap object client data without
deleting the pointers in the process.