Commit Graph

371 Commits

Author SHA1 Message Date
Vadim Zeitlin
9a9c845289 Add wxSystemAppearance to check for dark mode under macOS
Provide a way to retrieve the name of the current system appearance
(mostly for diagnostic purposes) and check if it uses predominantly dark
colours.

Currently this class has a non-trivial (but still very simple)
implementation under macOS only and simply checks whether the default
text colour is brighter than the default background colour under the
other platforms, but other platform-specific implementations could be
added later.

Also update the drawing sample "system colours" page to show the system
appearance as well.
2019-04-21 02:11:07 +02:00
Vadim Zeitlin
e1185d8bf0 Increment version number to 3.1.3
Done by running misc/scripts/inc_release, manually updating version.bkl,
rebaking and rerunning autoconf.
2018-12-10 19:06:18 +01:00
Maarten Bent
39ff5b90e5 Replace wxDeprecatedGUIConstants enum values 2018-11-25 21:29:32 +01:00
Vadim Zeitlin
8fb1152eee Fix error about duplicate PNG image handler in the drawing sample
Add the handler earlier, as creating the handler main frame uses
wxArtProvider::GetBitmap() which can add the PNG handler on some
platforms (e.g. macOS, when using wxTangoArtProvider), so calling
wxImage::AddHandler() again after creating the frame could result in a
debug error message about adding the same handler twice.
2018-11-13 16:11:24 +01:00
Blake Eryx
65827a0572 Remove unnecessary c_str() calls from the samples
Pass wxStrings directly to wxString::Format("%s") and similar
pseudo-vararg functions, there is no need for c_str() there since
wxWidgets 2.9.

Closes https://github.com/wxWidgets/wxWidgets/pull/1009
2018-11-03 22:52:57 +01:00
Blake Eryx
4fb39beae1 Remove all wxS() macros from samples
The use of wxS() is an optimization which can be used to avoid an
implicit conversion from narrow to wide strings, but such optimizations
are not really needed in the samples and just make their code less
readable, so remove them.

Closes https://github.com/wxWidgets/wxWidgets/pull/956
2018-10-01 13:55:42 +02:00
Blake-Eryx
f58ea62596 Remove (most) occurrences of wxT() macro from the samples
Also replace wxChar* with wxString.

Closes https://github.com/wxWidgets/wxWidgets/pull/945
2018-09-23 01:15:08 +02:00
Vadim Zeitlin
6401c2e956 Merge branch 'font-fixes'
Complete support for fractional point sizes and font weights other than
light/bold.

Also harmonize wxFont API and implementation among all ports (fixing
compilation of those of them that were broken by recent changes).

See https://github.com/wxWidgets/wxWidgets/pull/919
2018-09-17 22:58:56 +02:00
Vadim Zeitlin
f69dbaa1ae Introduce MSW ARM64 support
This is a preliminary ARM64 platform support for wxWidgets at "it
compiles" stage. This will allow building and testing wxWidgets based
apps for oncoming Windows 10 ARM64.

Requirements:
- Visual Studio 2017 Update 4 or later with Visual C++ compilers and
  libraries for ARM64 component installed

Building:
1. Open command prompt.
2. Change directory to build\msw subfolder.
3. Run "C:\Program Files (x86)\Microsoft Visual
   Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" once.
4. Use `nmake TARGET_CPU=ARM64 ...` to build required flavor of wxWidget
   libraries.

Notes:
1. Building of *.sln/*.vcxproj files does not support ARM64 yet. This
   requires to hardcode Windows SDK to 10.0.15063.0 or later in
   *.vcxproj files, which would render them non-compilable in older
   Visual Studio versions. Microsoft is aware of this issue and is
   planning a fix in the next version of Visual Studio.
2. wxmsw31ud_gl.dll does not build yet. Awaiting Microsoft to deliver
   missing opengl32.lib for ARM64. Please, specify USE_OPENGL=0.

Closes https://github.com/wxWidgets/wxWidgets/pull/923
2018-09-17 22:34:32 +02:00
Vadim Zeitlin
2cc44337c6 Use only wxFont ctor from wxFontInfo in the samples
Follow the documentation advice and prefer to use the ctor taking
wxFontInfo as it makes the code slightly shorter and more readable.
2018-09-17 15:29:42 +02:00
Maarten Bent
e581b72955 Look in multiple paths when searching for resource files of samples
When using an out of source build, the files are not in the default wxWidgets directories.
Also search in the current directory, parent directory and sample sub-directories.

Closes https://trac.wxwidgets.org/ticket/18118
2018-05-17 20:20:04 +02:00
Vadim Zeitlin
2ec2837f6d Update version to 3.1.2
Run misc/scripts/inc_release and rebake.
2018-02-20 00:08:01 +01:00
Tobias Taschner
ddceaab001
Remove MSW wxUxThemeEngine class
This undocumented "private" class was used for various windows UxTheme
functions which are available since WinXP. As wxWidgets 3.1 is XP+ it
does not make sense anymore to load the theme functions dynamically.
2018-01-22 00:51:11 +01:00
Vadim Zeitlin
0d394eec9c Update to bakefile 0.2.11 and rebake everything
The main/only change in this version is the removal of automatic rules
using old Carbon Rez/DeRez/SetFile tools.
2017-10-21 17:42:30 +02:00
Stefan Csomor
a6ba2245ef Redo Use implicit wxColour to wxBrush conversion 2017-06-28 07:22:54 +02:00
Stefan Csomor
526889dc57 Properly initialize newly created wxGraphicsContext with window background color 2017-06-26 08:40:09 +02:00
Artur Wieczorek
716f42b416 Fix drawing sample compilation when wxUSE_GRAPHICS_CONTEXT==0
'File_ShowGraphics' constant is not defined in this case so it cannot be referred to.
2017-03-25 21:00:51 +01:00
Artur Wieczorek
da66e81fb9 Update bounding box when drawing gradients in drawing sample
Advanced gradients are drawn using wxGraphicsContext and hence bounding box for underlying wxDC is not updated automatically. We need to update bounding box with extents of all used graphics paths.
2017-03-06 18:48:49 +01:00
Artur Wieczorek
92b64ff997 Set background colour of saved image in drawing sample
Initialize background colour prior to actual drawing to make it uniform for all kinds of drawing operations.
2017-03-06 18:47:02 +01:00
Artur Wieczorek
8950ac9a3f Change keyboard shortcut to show bounding box in drawing sample
Ctrl-B shortcut is already used to change background mode.
2017-03-03 21:08:53 +01:00
Artur Wieczorek
8aee0244b0 Add option to save as PostScript in drawing sample 2017-03-03 21:07:58 +01:00
Artur Wieczorek
3d4850bdf3 Use size of drawing area as a size of saved images in drawing sample
Determine actual size of drawing area and use it (instead of virtual size of the window) as a dimension of the images to be saved. Thanks to this clipping, produced images contain only results of drawing operations and not lot of empty background space.
2017-03-03 21:06:06 +01:00
Artur Wieczorek
c0b6540c6f Add option to show bounding box in drawing sample
Visualizing bounding box can be helpful in diagnosing problems with determining extents of drawing operations.
2017-03-02 20:57:30 +01:00
Vadim Zeitlin
59bd1178f1 Fix build with RTTI turned off using MSVC makefiles
Rebake these makefiles using fixed version of bakefile (pre-0.3.0).

See https://github.com/vslavik/bakefile/pull/85

Closes #17767.
2017-01-04 12:01:14 +01:00
Vadim Zeitlin
395d453c94 Link with oleacc.lib when using MSW gcc makefiles
This library is now required when wxUSE_ACCESSIBILITY==1, but was only linked,
using a compiler-specific pragma, when using MSVC resulting in link errors
with gcc.

Fix this by adding the library to the bakefile for non-MSVC compilers and
rebaking.
2017-01-04 11:50:18 +01:00
Paul Cornett
d20fb180b1 Display system colors in alphabetical order 2016-12-04 11:33:48 -08:00
Paul Cornett
cb19499c90 Fix layout of drawing sample System colours screen for colors with non-opaque alpha 2016-11-20 09:59:33 -08:00
Maarten Bent
c7e4b301d0 Add saving as SVG to drawing sample.
Changed the colour of the third star-polygon to test brush pattern with different colours.
Use the width and height of the scroll panel as image size.
2016-06-12 18:40:11 +02:00
Vadim Zeitlin
21d90d48ba Fix another typo in a comment in the drawing sample
This went unnoticed in 5e500de7e8.
2016-05-31 18:58:38 +02:00
Artur Wieczorek
5e500de7e8 Fixed minor typos in the drawing sample 2016-05-26 17:57:11 +02:00
Artur Wieczorek
16f111d007 Modified drawing sample to use wxGraphicsContext::GetTextExtent function.
Use GetTextExtent function to centrally align a bitmap to the text label (on Graphics screen).
2016-03-25 23:14:17 +01:00
Artur Wieczorek
f38485afa5 Modified drawing sample to demonstrate drawing graphics bitmaps.
Draw graphics bitmap and sub-bitmap (on Graphics screen) to present wxGraphicsBitmap support.
2016-03-25 23:12:40 +01:00
Artur Wieczorek
cce6f4edaa Fixed minor typo in the drawing sample. 2016-03-24 22:24:58 +01:00
Artur Wieczorek
494c2e3a6a Display graphics renderer info in the drawing sample.
Display on the status bar a description (name and version) of currently used graphics renderer.
2016-03-16 21:43:09 +01:00
Vadim Zeitlin
7eee3576cf Update version to 3.1.1
Update misc/scripts/inc_release script: remove non-existent any more files and
update the version in the MSVS 200x project files not generated by bakefile
any more and MSVS 201x project files which were not previously taken into
account.

Run it and rebake.
2016-03-03 23:23:06 +01:00
Vadim Zeitlin
4a78ed8bb7 Use fixed width font for the RGB values in the drawing sample
This makes them more readable and aligns all colours vertically.
2016-02-12 03:18:30 +01:00
Vadim Zeitlin
6680dbf906 Fix MSVC14 warning about a shadowed variable in the drawing sample
The warning is harmless but avoid it nevertheless.
2016-02-12 03:18:18 +01:00
Vadim Zeitlin
8c7ada391a Reformat the system colour names in the drawing sample
No real changes, just prettify the code a little.
2016-02-12 03:17:46 +01:00
Tobias Taschner
d811906b79 Add System Colour screen to drawing sample.
This adds an additional screen to the drawing sample showing all available wxSystemColour values. It makes sense for testing these values but also provides a convenient overview of available colours for the library user.
2016-02-08 14:34:37 +01:00
Artur Wieczorek
46953a1426 Enable "Alpha screen" in drawing sample also if wxDC supports alpha transparency.
For some systems (like OS X, GTK+ 3) drawing with transparency is supporting by native wxDC and in this case "Alpha screen" sample can be shown even if wxGraphicsContext is not used/enabled. For such wxDC's all drawing operations can be done directly without using wxGraphicsContext.
2016-01-14 23:07:45 +01:00
Artur Wieczorek
9aa5a4de0c Modify drawing on "Alpha Screen" in drawing sample to make transparency effect more visible.
Use transparent colours in drawing operations to show more clearly transparency effects.
2016-01-07 21:32:22 +01:00
Artur Wieczorek
537fcac633 Disable "Use wxDC" menu item if displayed screen requires wxGraphicContext (drawing sample).
To display "show alpha" and "show graphics" screens there is necessary to use wxGraphicContext and switching to wxDC should blocked in this case.
2015-12-26 17:44:28 +01:00
Artur Wieczorek
3fb70061ae Synchronize menu state in drawing sample with actually selected graphics renderer.
Because graphics renderer is not only selected via menu but also directly in the application (in MyFrame::OnShow) there is necessary to update menu items responsible for selecting graphics context to represent current state of the application.
This is done in EVT_UPDATE_UI handlers where there is checked what graphics renderer is currently in use and state of the menu items is updated accordingly.

Closes #16971.
2015-12-26 17:43:50 +01:00
Catalin
f61627fc7e Remove obsolete symbols from the samples
Mostly don't mention OS/2 in the comments about the icons.

Also replace a couple of occurrences of "wxWindows" with "wxWidgets".

Closes https://github.com/wxWidgets/wxWidgets/pull/138
2015-12-03 22:11:04 +01:00
Vadim Zeitlin
5cce48186c Link with shlwapi.lib and version.lib under MSW
These libraries are required now that we don't load the functions from them
dynamically (see e78be14ac1)

Closes #17180
2015-10-07 18:56:33 +02:00
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
3ee12b2ca9 Convert all XPM files to Unix EOLs.
Just as the normal sources (*.h, *.cpp), these files should be using LF and
not CR LF.
2015-03-19 21:46:05 +01:00
Vadim Zeitlin
4c72988c82 Convert really all CRLF files to use LF in the git repository.
This completes the changes of c3e5751c36.
2015-03-19 21:09:08 +01:00
Vadim Zeitlin
7653edb34d Avoid blank alpha and graphics screens in the drawing sample.
It was confusing to not see anything when selecting one of the screens using
wxGraphicsRenderer if a renderer hadn't been selected from the menu before.

Switch to using wxGC automatically now if one of these screens selected and
there was no previously selected renderer.
2015-03-08 16:28:22 +01:00
Vadim Zeitlin
2f51147732 Fix resource compiler include path for Borland.
Explicitly include $(BCCDIR)/include/windows/sdk directory in the resource
compiler options, as it needs it to find windows.h.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77993 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-11 16:30:00 +00:00