Commit Graph

142 Commits

Author SHA1 Message Date
Robin Dunn
ba763a45d8 Optimized sizers to not call CalcMin more often than neccessary
Window items added with wxFIXED_MINSIZE flag will set the window's
minsize to its curent size.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-06-24 20:13:27 +00:00
Robin Dunn
9f88452895 * Implemented BestSize cache
* Added calls to InvalidateBestSize where things affecting BestSize
  are modified.  There are probably several other places where this
  still needs to be done...

* Added wxWindowBase::GetBestFittingSize that will merge the BestSize
  into the MinSize, (if any) and return the result.

* SetBestFittingSize will now only set the MinSize to the value that
  was passed to it, without merging in the BestSize


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-06-24 20:09:45 +00:00
Václav Slavík
adbf2d732f deprecated wxBookCtrlSizer and wxNotebookSizer, they are no longer needed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-06-24 11:58:06 +00:00
Robin Dunn
fda5e7a16e Only call GetBestSize if one or both of the minsize components are unset.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-06-08 16:33:47 +00:00
Julian Smart
655719367a Use old licence name
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-05-23 20:53:33 +00:00
Julian Smart
77ffb5937e Name and version changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-05-23 14:56:36 +00:00
Robin Dunn
89a94520ea Take the hgap and vgap into account when doing alignments in grid
sizers.  The gap is not part of the "cell" so alignments should be
relative to the edge of the gap, not the next cell.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-05-13 19:12:06 +00:00
Robin Dunn
093475d267 Instead of using GetAdjustedBestSize use the minsize if there is one,
otherwise use GetBestSize.  This allows for situations where the
minsize is smaller than the bestsize (for example, abbreviated state
fields will normally be smaller than the 100px best size for
wxTextCtrls.)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26918 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-04-22 21:44:29 +00:00
Robin Dunn
77aa9abdc4 Set m_window to NULL after destroying it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-04-17 22:40:23 +00:00
Vadim Zeitlin
eb2a7883df show/hide static box when the wxStaticBoxSizer is shown/hidden (replaces patch 897020)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26817 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-04-15 22:26:09 +00:00
Robin Dunn
1eba219387 Added wxSizerItem::SetMinSize that calls m_window->SetSizeHints if not
wxFIXED_MINSIZE, SetInitSize and SetItemMinSize uses SetMinSize, and
fixed [ 934651 ] sizeritem's 'minsize' value has no effect in xrc resources


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-04-14 23:45:21 +00:00
Robin Dunn
f52e0cf489 Changed name to wxFIXED_MINSIZE since that is more descriptive of what
it does.  The size can still be changed by the sizer, but it won't
query the minsize if this flag is set.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-04-07 23:06:35 +00:00
Robin Dunn
caa251e073 Added wxFIXED_SIZE.
Propogated wxSizer::SetItemMinSize to SetSizeHints for window items.
Updated docs for flag parameter to be more readable and understandable.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-04-07 19:21:06 +00:00
Vadim Zeitlin
395a82b13f made wxADJUST_MINSIZE default
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-03-29 10:18:38 +00:00
Stefan Csomor
e11d436ba0 merge of new wxMac code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-03-27 08:11:05 +00:00
Dimitri Schoolwerth
78ca56690e Simplified OS X Panther detection code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25797 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-02-14 02:40:59 +00:00
Stefan Csomor
c54b92d363 system includes instead of user
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-01-20 18:18:48 +00:00
Dimitri Schoolwerth
6702110216 Corrected size of staticbox borders when running OS X Panther or higher.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-12-12 21:04:36 +00:00
Robin Dunn
20b35a6916 Added wxGridBagSizer, a grid sizer where item positions can be
specified and row/col spanning is allowed.

Updated docs, the layout sample, files.bkl, and updated makefiles.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-11-06 01:31:44 +00:00
Robin Dunn
02319c2458 Prevent possible divide by zero problem
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-09-19 20:27:11 +00:00
Julian Smart
8d2474f486 Applied patch [ 800183 ] wxFlexGridSizer::RemoveGrowableRow/Col fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23515 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-09-11 15:57:37 +00:00
Vadim Zeitlin
85e5cfc952 fix redistribution of the extra space between sizer items
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-08-31 13:29:28 +00:00
Vadim Zeitlin
ccf5c8a88c undid the last change
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23315 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-08-31 12:54:48 +00:00
Vadim Zeitlin
f43c777175 use SetClientSize(), not SetSize() in Fit()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23311 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-08-30 22:39:56 +00:00
Robin Dunn
2d480e4045 wxNotebookSizer ctor was missing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-08-22 05:48:38 +00:00
Vadim Zeitlin
ade4eb65af added wxBookCtrlSizer; derive wxNotebookSizer from it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-08-21 23:09:35 +00:00
Julian Smart
196be0f137 Warning fixes from ABX
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23020 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-08-19 15:40:58 +00:00
Václav Slavík
14f355c2b5 added support for gcc precompiled headers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-08-09 12:46:53 +00:00
Stefan Csomor
066f1b7a95 xti extensions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22601 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-08-05 17:30:46 +00:00
Vadim Zeitlin
f91e838284 set the containing sizer to NULL when destroying the sizer; this fixes a crash (don't ask me how could it work before)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21927 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-07-12 20:36:31 +00:00
Mattia Barbon
89c20ac15c Fix some leaks cause by removing list.DeleteContents calls.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-07-12 02:27:53 +00:00
Mattia Barbon
222ed1d678 STL-ification patch for wxMSW and wxGTK.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-07-10 19:55:12 +00:00
Vadim Zeitlin
55f9f0cbc8 support Show() in wxFlexGridSizer (patch 737850)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21308 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-06-22 22:08:13 +00:00
David Elliott
ec4e4a1415 Use the wxStaticBox::GetBordersForSizer method to get border information
on wxCocoa.  Perhaps the other ports should do this?


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19999 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-04-06 00:51:44 +00:00
Julian Smart
aa5973eef4 Copyright correction
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-03-21 15:30:17 +00:00
Vadim Zeitlin
e8800dcfa7 added proportion parameter to wxFlexGridSizer::AddGrowableRow/Col()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-02-27 11:55:26 +00:00
Julian Smart
f2b99f6323 Applied patch [ 675376 ] Improves wxStaticBoxSizer
(uses GetCharHeight() instead of guessing).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-02-02 14:58:56 +00:00
Ron Lee
150c8d89c7 Fixed bug in FlexGridSizer mods that prevented them from ever shrinking.
Reverted the earlier SetScrollbars patch and fixed a bug in GetVirtualSize
that was hopefully the real cause of all the preceding woe.

Added a comment and a kludge for a most unusual bug manifesting in the
scrollsub sample.  If it is resized quickly size events appear to get lost
and the scrollbar is set incorrectly.  Adding an extra call to
AdjustScrollbars masks the problem, though its clearly superfluous since
the FitInside above already calls it.  This seems to be a brand new problem
(on both Gtk and msw) as of some time prior to this patch and it should be
looked into further.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18959 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-01-27 09:02:58 +00:00
Vadim Zeitlin
5d76f46282 added support for non flexible (in one direction only) flexible sizers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-01-26 00:04:24 +00:00
Vadim Zeitlin
e0d8fb4572 restored int (instea of size_t) in Remove() and Detach(); TRUE/FALSE -> true/false
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18926 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-01-25 12:50:32 +00:00
David Webster
dc259b7926 TRUE not true, FALSE not false
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-01-20 21:22:43 +00:00
Ron Lee
9cbee2ceee Improved const correctness.
Clear wxWindow containing sizer on Remove( index ).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-01-13 19:31:37 +00:00
Ron Lee
12a3f2275c Deprecated wxSizer::Remove( wxWindow* ), s/Remove/Detach/ in most places.
Made wxSizer child list typesafe.  I've not added the wxList implicit
conversion kludge yet, let's see who complains first perhaps..

Deprecated wxSizer::{G,S}etOption in favour of {G,S}etProportion in line
with the parameter name change in the docs.

Added {G,S}etSpacer consistent with the accessors for windows/sizers.

Made all wxSizer index parameters size_t -- we support no sensible
interpretation for negative indexes in them.  Hopefully this will
cause no real problems, but code doing (eg. Remove( 0 )) will need
to change to use 0u to resolve the ambiguity with overloaded members.
This is probably a Good Thing though, ymmv.

s/FALSE/false/g ; s/TRUE/true/g ; s/wxASSERT/wxASSERT_MSG/g in sizer.{cpp,h}

Fixed (I hope) the brokenness in wxSizer::Show -- I have no code to test
this yet, so it's a blind change, but spacers should now be hidden correctly
instead of ignored, and it should be properly reversable over multiple
calls now too.

removed pointless private scoping around DECLARE_CLASS macros.

Replace 0's I added previously with NULL -- not like that will end the
email thread either..

Added Add( wxSizerItem * ) & co.  There are probably a couple of other
places we can usefully do something like this too.  Stopped short of
refactoring everything to raise some issues about sizer method recursion
on -dev.

Updated wxSizer docs some more, they are still incomplete but getting
better.

wrapped KeyCode in wxDEPRECATED, converted all (gtk build) instances
to GetKeyCode.  There may be a few left for other ports.

Fixed a couple of other random compile warnings along the way.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18616 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-01-07 10:22:07 +00:00
Ron Lee
96fdbb60f1 Ok, so we don't need the extra bool at all, we can just zero the sizer
pointer in wxSizerItem.  :-)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-12-30 15:26:47 +00:00
Ron Lee
00976fe56b Add wxSizer::Detach so we can detach child sizers without deletion.
Updated wxSizer docs for this and a couple of other missing/outdated
things.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18460 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-12-30 13:02:15 +00:00
Vadim Zeitlin
2b5f62a0b2 merged 2.4 branch into the trunk
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-12-04 14:11:26 +00:00
Vadim Zeitlin
0ca5105b34 don't crash in wx(Flex)GridSizer with division by 0, assert instead; also factored out a lot of duplicated code in a single function
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16854 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-08-29 21:48:32 +00:00
Robert Roebling
2e9c65bf83 Oops.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-07-09 05:51:38 +00:00
Robert Roebling
4f469fb5c4 This memory corruption caused me three and
a half weeks of trouble.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16080 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-07-08 14:01:57 +00:00
Vadim Zeitlin
e5251d4f78 fixes to the sizers behaviour necessary to make the log dialog work again
(thanks to Dimitri) and a few updates to the docs after the recent changes


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-06-13 20:21:20 +00:00