Commit Graph

68132 Commits

Author SHA1 Message Date
Robin Dunn
085f08aefe Remove the generic-specific methods from the wxAnimation API 2020-04-01 13:30:49 -07:00
Robin Dunn
cd74255da3 Ensure the animation is ok before getting its impl 2020-04-01 12:58:35 -07:00
Robin Dunn
606f365ea3 Verify the animation impl type matches the animation ctrl type 2020-04-01 12:39:48 -07:00
Robin Dunn
e464453073 * Switch wxAnimation to be a facade over a wxAnimationImpl class.
* Implement wxAnimationGenericImpl
* Update wxGenericAnimationCtrl as needed
2020-04-01 11:53:19 -07:00
Paul Cornett
3e7e7dd24c Avoid generating wxEVT_TEXT when wxTextCtrl initial value is not empty
See #18714
2020-04-01 10:23:44 -07:00
NancyLi1013
d781764d6d Add vcpkg installation instructions for wxMSW
Closes https://github.com/wxWidgets/wxWidgets/pull/1777
2020-04-01 13:24:24 +02:00
Vadim Zeitlin
f2923d49e1 Update native wxGrid header on DPI change
Simply resize all columns to their effective widths when using native
wxHeaderCtrl for the grid.
2020-04-01 01:08:41 +02:00
Vadim Zeitlin
5525e0ed3f Update grid row/column sizes when switching DPI
Because the size of the text (usually) shown in the grid changes, the
size of its columns/rows should change as well when DPI changes. Scale
them by the DPI ratio if necessary, i.e. if any of them were set to
non-default values to achieve this.

Note that this is not ideal because it can result in rounding errors and
hence in slight change of row/column size when moving the grid window to
another display with a different DPI and then back, but to prevent this
from happening we'd need to store the column/rows sizes in DIPs inside
wxGrid and convert them to actual physical pixels everywhere, which
would require much more changes. Still, if the round trip problems turn
out to be a real problem in practice, we probably will need to do this.

Also note that this doesn't take care of the grid with a native header,
but this will be addressed by upcoming commits.
2020-04-01 00:58:59 +02:00
Vadim Zeitlin
5e761ad99f Add minimal DPI change handler to wxGrid
This handler redoes wxGrid layout and refreshes it to at least avoid
ugly display artifacts when moving wxGrid window between displays with
different DPI.
2020-04-01 00:46:39 +02:00
Robin Dunn
85bd16fb06 Trim trailing whitespace 2020-03-31 14:02:39 -07:00
Robin Dunn
aa30a6d46e commit suggested change
Co-Authored-By: VZ <vadim@wxwidgets.org>
2020-03-31 13:53:56 -07:00
Robin Dunn
f3b916a99e commit suggested change
Co-Authored-By: VZ <vadim@wxwidgets.org>
2020-03-31 13:26:51 -07:00
Vadim Zeitlin
393f5c8e2b Use less arbitrary column/row sizes in the grid sample
Base the sizes on the default column/row size instead of just hardcoding
pixel, or even DIP, values.
2020-03-31 19:38:18 +02:00
Vadim Zeitlin
f48c3f1e83 Sprinkle grid sample with FromDIP() to improve its appearance
Make frame sizes and column/row sizes more appropriate for high DPI
displays.
2020-03-31 19:38:18 +02:00
Vadim Zeitlin
104733550e Use wxGridCellAttrPtr typedef
No real changes, just make the code slightly shorter.
2020-03-31 19:37:39 +02:00
Vadim Zeitlin
ca30169767 Restore overflowing for cells with non-default vertical alignment
Since the changes in a40acbb28e (Add CanOverflow function to
wxGridCellAttr, 2020-02-06), cells with non-default vertical alignment
didn't overflow any more, even if their horizontal alignment was
unchanged and still defaulted to left-aligned.

This was due to assuming that if the alignment of wxGridCellAttr itself
was different from wxALIGN_LEFT, it meant that it wasn't left-aligned,
which seems logical but is in fact false, as the alignment can also be
wxALIGN_INVALID, in which case the real alignment is taken from the
default grid attribute.

Fix this by using GetNonDefaultAlignment() to get the alignment value
effectively used and add a unit test, as well as an example in the
sample, showing that this now works correctly.
2020-03-31 19:32:47 +02:00
Vadim Zeitlin
5834bef2f7 Fix memory leaks in wxGrid unit tests
Use smart pointers to ensure that various objects are released, as they
have to be.
2020-03-31 19:32:47 +02:00
Vadim Zeitlin
59ad458d39 Scale default wxGrid constants by DPI
In particular, this makes default column width better suited for high
DPI displays, as it was too narrow before.

Also mark a couple of obsolete constants as such with a comment.
2020-03-31 14:48:54 +02:00
Vadim Zeitlin
06af121e9c Add wxObjectDataPtr::release()
This makes it possible to use wxObjectDataPtr inside functions returning
raw pointers owned by the caller, such as custom GetAttr() in the grid
sample.
2020-03-31 02:57:01 +02:00
Vadim Zeitlin
15b5a1865c Add a simple wxGrid::AssignTable() wrapper for SetTable()
In many case SetTable() is called with its takeOwnership parameter set
to true, as shown by the grid sample in which all 3 of the calls to
SetTable() set it to true, but calling it in this case is awkward, as
bare "true" in the caller is unreadable and almost invariably requires
an explanatory comment.

Improve the API by adding AssignTable(), which is the same to SetTable()
as the existing AssignImageList() to SetImageLabel(), which always takes
ownership of the table pointer.
2020-03-31 02:43:08 +02:00
Robin Dunn
e72793abec IsOk is pure virtual 2020-03-30 15:44:32 -07:00
Robin Dunn
f13c3dc1ec Documentation updates for Animation classes 2020-03-30 15:26:52 -07:00
Robin Dunn
1608fde659 Add a Create method to the shim class 2020-03-30 15:20:19 -07:00
Robin Dunn
868154ee90 native wxAnimationCtrl derives from the generic class 2020-03-30 15:01:21 -07:00
Robin Dunn
a7f9d5e3c5 * Switch back to using an wxAnimationBase class
* Change the [GS]etAnimation methods to be non-virtual so they can use generic/native types of animation obj
2020-03-30 14:53:11 -07:00
Vadim Zeitlin
3674240146 Add missing wx/scopedptr.h in wxMSW wxFileDialog code
This file uses wxScopedPtr<> and so needs to include this header
explicitly instead of relying on it being included indirectly from some
other header, as happens in the default build, but not always.

Closes #18711.
2020-03-30 23:10:13 +02:00
Vadim Zeitlin
6c061b6bf9 Fix compilation of spinctrlcmn.cpp when wxUSE_SPINCTRL==0
Don't include wx/private/spinctrl.h header (nor the other ones) at all
in this case, as it doesn't compile in this build configuration.

This fixes one of build problems under iOS.

See https://github.com/wxWidgets/wxWidgets/pull/1773
2020-03-30 15:26:00 +02:00
Vadim Zeitlin
00f6cfec51 Fix wxUniv build with wxNO_RTTI
ForceUpperFunctor must have a default ctor when wxNO_RTTI is on, i.e.
when wxRTTI is used.

Closes #18707.
2020-03-30 00:57:16 +02:00
Vadim Zeitlin
c6a4cc80fe Merge branch 'pmdpi-build' of git://github.com/MaartenBent/wxWidgets
Improve DPI aware builds with .vc and .vcproj files.

See https://github.com/wxWidgets/wxWidgets/pull/1769
2020-03-28 14:10:17 +01:00
Robin Dunn
08ac4dbad6 Name the base animation class wxGenericAnimation with a wxAnimation shim class 2020-03-27 15:53:03 -07:00
Maarten Bent
343bd89b63 Rebake after changes 2020-03-27 23:15:03 +01:00
Maarten Bent
3978733a37 CMake: Enable DPI awareness options for demos 2020-03-27 23:11:00 +01:00
Maarten Bent
820234340f Remove unnecessary arguments for nmake in AppVeyor script 2020-03-27 23:11:00 +01:00
Maarten Bent
f1a017539a Generate an error when the CPU parameter is not specified and cannot be determined
See #18640
2020-03-27 23:11:00 +01:00
Maarten Bent
284b25ce02 Automatically detect if target architecture is x64 in .vc file
This allows a successful build even if the user omits specifying CPU=X64.

See #18640
2020-03-27 23:11:00 +01:00
Maarten Bent
3c53fbb94b Add DPI manifest only for MSVS 2015 and later in .vc file
Prevent errors and warnings when embedding the manifest.

Check if environment variable VISUALSTUDIOVERSION (set by VS developer command
prompt) is 14.0, 15.0 or 16.0.

See #18665
2020-03-27 23:10:56 +01:00
Robin Dunn
488084c2f5 Name the base animation class wxGenericAnimation with a wxAnimation shim class 2020-03-27 14:33:11 -07:00
Vadim Zeitlin
42c9375c14 Merge branch 'drawing-lines'
Fix drawing of dotted/hatched lines in wxMSW and some drawing sample
improvements.

Closes #7097.

See https://github.com/wxWidgets/wxWidgets/pull/1771
2020-03-27 20:22:17 +01:00
Anton Triest
53d51105be Fix drawing of non-solid lines with width 0 using wxDC in wxMSW
::ExtCreatePen() doesn't allow the pen width to be 0, unlike
::CreatePen() and failed to create the brush in this case.

Use width of 1 to draw e.g. hatched lines of width 0 correctly.

See #7097.
2020-03-27 12:02:36 +01:00
Anton Triest
d245dc9e1f Fix drawing of dotted lines with wxDC in wxMSW
Use ::ExtCreatePen() for creating pens for such lines, as it results in
much better appearance for them than ::CreatePen(), which draws dashed,
and not dotted, lines in this case.

See #7097.
2020-03-27 11:59:10 +01:00
Vadim Zeitlin
bb489418b0 Number renderers using consecutive digits in the sample
This has the disadvantage of not using the same accelerators in
different wxWidgets builds, but the advantage of appearing logical to a
casual user when running the sample, while having "0, 1, 3, 4" sequence
was surprising.

Alternatively, we could always add all menu items, but disable the ones
that are not available in the current build. It could be surprising to
see "GDI+" under non-MSW systems too though.
2020-03-27 11:51:56 +01:00
Vadim Zeitlin
e7c8039d13 Simplify renderer selection in the drawing sample
Make "Use default wxGraphicsContext" part of the renderer selection
radio group and put it in correct order, as having "1, 0, 3, 4"
accelerators order in the menu was really surprising.

Remove wxEVT_UPDATE_UI handlers as they complicated things in the sample
code (which is supposed to be simple, after all) without much benefit
and arguably even added to the confusion during run-time as menu items
could both be manually selected and checked automatically.
2020-03-27 11:43:19 +01:00
Vadim Zeitlin
62bb47cfdb Use white background for drawing lines in the drawing sample
This makes the display more readable, black on red was really not ideal.

No real changes.
2020-03-27 11:39:03 +01:00
Scott Talbert
8886f47ee4 Update GPL and LGPL license texts to the latest versions
This corrects the outdated FSF address and reformats the text slightly.

References:
https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
https://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt
2020-03-26 19:50:13 -04:00
Maarten Bent
5767a906eb Disable embedding manifest via linker in .vcproj files
This causes errors (<=2010) and warnings (<=2012) with older VS versions.

See #18665
2020-03-26 22:51:38 +01:00
Robin Dunn
fae15d39a6 * Rename the generic version as wxGenericAnimationCtrl
* Add a simple shim class for the generic wxAnimationCtrl
* Use the generic wxAnimation as the base class (this will probably change...)
2020-03-25 16:29:34 -07:00
Robin Dunn
f501177857 Run autoconf 2020-03-25 14:05:06 -07:00
Robin Dunn
1fa74df7f4 Remove --disable-nativeanimation and wxUSE_NATIVE_ANIMATIONCTRL 2020-03-25 14:03:28 -07:00
Vadim Zeitlin
2c7924dd2e Remove the now unused UNIV_PLATFORM_{SRC,HDR} variables
They used to contain animation-related files, but are empty now and can
be simply removed.
2020-03-25 13:58:57 +01:00
Vadim Zeitlin
842e185f3b Move generic files to common sources/headers in the right place
This corresponds to the changes already manually done in
build/bakefiles/files.bkl but is now done in the right file and so also
for CMake-based build system.
2020-03-25 13:57:39 +01:00