Vadim Zeitlin [Wed, 11 Aug 2010 16:04:00 +0000 (16:04 +0000)]
Handle wxDefaultSize correctly in wxNonOwnedWindow under wxOSX.
Creating a wxNonOwnedWindow with default size created tiny, practically
invisible windows because the default size was only taken care of at
wxTopLevelWindow level but not in wxNonOwnedWindow itself. In particular, this
broke creation of wxMDIChildFrames with the default size as this class only
derived from wxNonOwnedWindow and not from wxTopLevelWindow under OS X. It
also probably wasn't intentional as the code did use {Width,Height}Default()
functions but they were wxWindow methods and not the wxTopLevelWindow
(confusingly and error-pronely) named the same.
Fix this, remove the now redundant checks for the default size in
wxTopLevelWindow itself and also rationalize and condense the checks for the
default position and size components in wxNonOwnedWindow::Create().
Vadim Zeitlin [Wed, 11 Aug 2010 16:03:55 +0000 (16:03 +0000)]
Make wxTopLevelWindow::GetDefaultSize() public and document it.
This method is/will be needed by wxNonOwnedWindow in wxOSX but couldn't be
used as long as it was protected, so make it public. And as it seems that it
might be useful outside of wx itself, document it as well.
Vadim Zeitlin [Wed, 11 Aug 2010 16:03:46 +0000 (16:03 +0000)]
Fix handling of help buttons with non-empty label under OS X.
Creating a button with wxID_HELP and a non-empty label used to always show
this label, even if it was just a standard "Help" or "&Help". This didn't work
at all as the help buttons under OS X are too small to show any label.
To fix this, use normal buttons, not help ones, if a really custom label is
used to ensure that it can be seen. And to still use the correct help buttons
in as many cases as possible, ignore the standard "Help" label and its
variants and don't show it at all.
Vadim Zeitlin [Tue, 10 Aug 2010 22:39:04 +0000 (22:39 +0000)]
Fix line indices translation in wxGrid::DoEndDragResizeLine().
We used the translation in wrong direction, i.e. interpreted x coordinates as
rows and y coordinates as columns. This could result in passing invalid cell
indices to GetCellSize() and was generally completely wrong.
Vadim Zeitlin [Tue, 10 Aug 2010 22:38:54 +0000 (22:38 +0000)]
Don't set Unicode key code in key events to non-Unicode values in wxGTK.
Only assign the wx key code wxKeyEvent::m_uniChar if it's a key corresponding
to an ASCII symbol, don't do it for the values outside of ASCII range such as
all the special WXK_ constants. It doesn't make sense to generate Unicode key
codes for e.g. cursor key presses.
Vadim Zeitlin [Tue, 10 Aug 2010 21:48:22 +0000 (21:48 +0000)]
Use wxPanel as controls parent in wrapsizer sample.
Follow our own advice about never creating controls directly on the frame and
using an intermediate wxPanel in our own sample. This is better style and
makes it look better under Windows.
Vadim Zeitlin [Tue, 10 Aug 2010 21:48:17 +0000 (21:48 +0000)]
Inherit notebook background recursively under wxMSW.
With MSWSetTransparentBackground() hack only the panel which was the immediate
child of wxNotebook (i.e. its page) inherited the notebook background but not
its children. This resulted in jarring background discontinuities when nested
panels were used.
Fix this by inheriting notebook background in all child panels by testing for
the return value of the parents MSWHasInheritableBackground() method in
wxPanel::HasTransparentBackground() recursively.
Vadim Zeitlin [Tue, 10 Aug 2010 18:58:06 +0000 (18:58 +0000)]
Fix wxBitmapButton initial best size determination in wxMSW.
This was broken during wxButton/wxBitmapButton merge and wxBitmapButton was
not created with the correct initial size if the default size was specified
when creating it any longer. Fix this by calling SetInitialSize() once again
after setting the bitmap.
Vadim Zeitlin [Tue, 10 Aug 2010 18:58:02 +0000 (18:58 +0000)]
Keep the button bitmap centered if the button has no label in wxMSW.
We should only honour the bitmap alignment if the button shows both the bitmap
and the label. If only the bitmap is shown (e.g. when wxBitmapButton is used),
it should always be centered as it used to be done in 2.8.
Vadim Zeitlin [Tue, 10 Aug 2010 18:57:47 +0000 (18:57 +0000)]
Don't use bitmap still selected in wxMemoryDC in image sample.
The bitmap must be deselected from wxMemoryDC before being used in any other
way but the sample didn't do this. Fix this by simply destroying the DC as
soon as we don't need it, this makes bitmap available for other use as well.
Vadim Zeitlin [Tue, 10 Aug 2010 18:57:42 +0000 (18:57 +0000)]
Use window position in screen coordinates in wxDisplay::GetFromWindow().
To determine the display to which the window belongs we must use the window
position in screen coordinates returned by wxWindow::GetScreenRect() and not
the positioned returned by GetRect() which is the same only for the top level
windows but not for the child ones.
Vadim Zeitlin [Tue, 10 Aug 2010 12:53:03 +0000 (12:53 +0000)]
Add wxDataViewCtrl::{Set,Get}CurrentItem().
Current item is the same as the selected item in single selection mode but in
multiple selection mode there was no way to neither get this item nor change
it before so add the new functions to allow doing this now.
The new methods are implemented for the generic, GTK and OS X/Cocoa versions
but only stubs are provided for OS X/Carbon.
Vadim Zeitlin [Mon, 9 Aug 2010 21:17:51 +0000 (21:17 +0000)]
Don't lose selection in wxDataViewCtrl::Select() under Mac.
Calling Select() for an item should not deselect the other selected items in
multiple selection mode. This is consistent with the GTK and generic versions
behaviour and also just makes more sense but also document that this is indeed
the desired behaviour just in case.
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.