Commit Graph

19 Commits

Author SHA1 Message Date
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Vadim Zeitlin
2d3f617b34 Fix crash in BoxSizerTestCase::IncompatibleFlags().
Reset the old window sizer pointer, otherwise it was deleted again in the
window dtor (thanks buildbot for finding this one).
2015-04-23 19:31:15 +02:00
Vadim Zeitlin
58114f22c3 Detect the use of incompatible flags for wxGridSizer too.
Complain if wxEXPAND is combined with both horizontal and vertical alignment
flags, as this doesn't make sense and, moreover, the behaviour has changed
since the last commit: now wxEXPAND is ignored instead of overriding the
alignment flags if they are combined.
2015-04-08 23:35:19 +02:00
Vadim Zeitlin
9aaa38c7c8 Make it possible to combine wxEXPAND and alignment in wxGridSizer.
Allow overriding wxEXPAND effect in one of the directions by specifying
wxALIGN_{RIGHT,BOTTOM} or wxALIGN_CENTRE_{HORIZONTAL,VERTICAL} together with
it (unfortunately this doesn't work for wxALIGN_{LEFT,TOP} as their value is 0
and so their presence in flags can't be detected).
2015-04-08 23:35:19 +02:00
Vadim Zeitlin
7e865daa26 Add unit test for wxFlexGridSizer layout logic.
Currently just test that wxEXPAND flag works as expected.
2015-04-08 23:35:19 +02:00
Vadim Zeitlin
78b98bf00c Validate wxBoxSizer flags instead of silently ignoring invalid combinations.
Detect using flags corresponding to the major sizer direction (which doesn't
make sense as only the proportion governs the behaviour in this direction) and
also combinations of alignment flags with wxEXPAND.
2015-04-08 23:35:19 +02:00
Vadim Zeitlin
636d08323f Assert if incompatible sizer flags are used.
We can't check for all the invalid combinations, but at least check for
wxALIGN_CENTER_HORIZONTAL+wxALIGN_RIGHT and wxALIGN_CENTER_VERTICAL+
wxALIGN_BOTTOM which never make sense and can be detected.
2015-04-08 23:35:18 +02:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
93b87dd910 Respect item max sizes in wxBoxSizer.
Don't give more space than the max size, if set, to wxBoxSizer elements.

Closes #11497.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72345 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-08-15 23:34:27 +00:00
Dimitri Schoolwerth
e3778b4d9c No code changes, fixed some typos.
Changed several occurrences of "it's" where "its" is meant, as well as a few other minor typos.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-30 10:57:04 +00:00
Vadim Zeitlin
e4c903b2ea Fix wxWrapSizer minimal size calculation.
Add a unit test checking that wxWrapSizer::CalcMin() returns the expected
results.

Closes #12464.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-02-08 13:36:13 +00:00
Vadim Zeitlin
232fdc630c Merge the new GUI tests from SOC2010_GUI_TEST branch.
Add a lot of tests for many wx GUI classes.

Add tests using the new wxUIActionSimulator class but disable them under OS X
as too many of them currently fail there.

Refactor the test suite to make organizing the existing tests and adding the
new ones easier.

Improve documentation using the information gathered while testing the
classes. Also update the documentation of the testing system itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-08-22 22:16:05 +00:00
Václav Slavík
df67b58b5b Fix another bad format string in the testsuite.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-24 11:25:54 +00:00
Vadim Zeitlin
f27d62bf2f Modify wxBoxSizer minimal size calculations to respect the proportions.
Make wxBoxSizer minimal size big enough to not only give each item enough
space to satisfy its minimal size but also to respect the proportions among
the items by default.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-22 14:57:34 +00:00
Vadim Zeitlin
be8332eb97 Fix more harmless warnings.
Fix a warning about unused parameters and another about signed/unsigned
comparison during samples and tests compilation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-06 17:38:23 +00:00
Vadim Zeitlin
729f53d421 Fix box sizer layout algorithm to respect both proportions and min sizes.
The new version of the algorithm tries to distribute the entire space
allocated to the sizer among its children, just as the version in 2.8 did,
while still respecting minimal children sizes first and foremost. This means
that the space allocated to the item will always be at least its minimal size
if the total space is at least equal to the sum of minimal sizes of the
children but that if there is enough space, the proportions will be respected
too.

Extended the unit test to check that laying out various combinations of three
elements results in the expected results.

Closes #11311.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-18 15:07:24 +00:00
Vadim Zeitlin
a71aeb2426 Ensure that size in the minor direction of box sizer doesn't exceed the total.
This is similar to the previous commit but for the transversal direction of a
box sizer: we could give an item size larger than the size of the sizer itself
making only part of its window visible (and thus potentially making the window
unusable e.g. because the scrollbar wasn't visible at all).

Fix this by always restricting the item size in the minor direction to the
total size available and add a unit test which failed previously and passes
now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-18 15:07:19 +00:00
Vadim Zeitlin
26022721e8 Ensure that size in the major direction of box sizer doesn't exceed the total.
After fixing the problem with "growing items by negative proportion" in r56010
(which still was the correct thing to do as it fixed such indefensibly broken
behaviour as shrinking items with larger proportion by more than "smaller"
items when there was not enough space) the items in a box sizer could become
larger than the total space allocated to the sizer resulting in only parts of
them being visible.

Fix this by truncating the items to the (remaining) total size even if this
means making them less than their minimal sizes -- because there is nothing
else we can do when the total space is smaller than the sum of minimal sizes
anyhow.

Closes #10008.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-18 15:07:14 +00:00
Vadim Zeitlin
869c7a944b Add (a very simple for now) wxBoxSizer unit test.
Only check that layout for a single sizer item works correctly for now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-18 15:07:10 +00:00