Commit Graph

62326 Commits

Author SHA1 Message Date
Vadim Zeitlin
214aac6fd6 Avoid calling wxGetenv() twice unnecessarily
Use wxGetEnv() helper function which allows to write the code in more natural
and (slightly) more efficient way.

No real changes.
2017-03-09 18:02:14 +01:00
Vadim Zeitlin
41fe019f3b Refactor: extract GetXDGConfigHome() into a separate function
No real changes, just avoid doing the same thing in 2 different places and do
it in a single helper function instead.
2017-03-09 18:00:29 +01:00
Vadim Zeitlin
a44b61e976 Revert incompatible change to Unix wxStandardPaths::GetUserDir()
There is no reason to break the behaviour of the existing code, which doesn't
call SetFileLayout(FileLayout_XDG), by not returning the correct directories
from GetUserDir(Dir_Downloads) and similar any longer.
2017-03-09 17:56:45 +01:00
Vadim Zeitlin
5cf9fcbb1a Add wxStandardPaths::ConfigFileConv enum for clarity and safety
Use an enum instead of type-unsafe "int" for the second parameter of the
recently added wxStandardPaths::MakeConfigFileName().

This also avoids unnatural dependency of wxStandardPaths on
wxCONFIG_USE_SUBDIR constant defined in a higher level wxFileConfig class.

No real changes, but just make things a bit more robust and hopefully more
clear.
2017-03-09 17:53:14 +01:00
Vadim Zeitlin
4bf6ae8d7c Make FileLayout_XXX elements of an enum
Slight improvement to the previous commit: make FileLayout_Classic and
FileLayout_XDG elements of an enum instead of using an untyped "int" for them
which didn't really make any sense because these values are not bit masks but
exclusive choices for the layout.

Also rewrite the checks for them to use "switch" instead of "if" to be warned
by the compiler if we ever add another enum value but forget to update the
code to handle it.

Finally, improve the documentation (add missing "@since") and comments.
2017-03-09 17:23:20 +01:00
Martin Koegler
d56d127d3f Implement XDG file layout 2017-03-08 22:30:21 +01:00
Martin Koegler
8d5d00db9d Implement MakeConfigFileName 2017-03-08 22:29:55 +01:00
New Pagodi
1bcb30f6d7 Add wxStyledTextCtrl::AutoCompGetCurrentText()
Added support for SCI_AUTOCGETCURRENTTEXT API.

Closes #16263.
2017-03-07 19:15:46 +01:00
New Pagodi
f33da324c0 Don't use deprecated function in stc sample
Call to deprecated wxStyledTextCtrl::SetStyleBits() function can be omitted because underlying SCI_SETSTYLEBITS API is not operational anymore.

See #17671.
2017-03-07 19:07:38 +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
New Pagodi
15ee1ebd12 Improve generating wxSTC code and documentation
Several new features were implemented in gen_iface.py and accompanying '.in' files:
1. Added an option to parse provisional section in Scintilla.iface. When global variable GENERATE_PROVISIONAL_ITEMS is set to 1, methods and values in this section receive corresponding wxSTC items.
2. Deprecated section in Scintilla.iface is not skipped, but parsed and corresponding wxSTC items are created (marked as deprecated in the code and documentation).
3. Added a set 'notMappedSciValues' that can be used to prevent the creation of specific wxSTC values which are intended to be handled manually.
4. For deprecated constants there is generated a code to raise respective warnings during the compilation.

Closes #17671.
2017-03-06 18:38:56 +01:00
Cătălin Răceanu
bbc4b3659a Drop compile and run-time Win9x support in wxFileDialog
All relatively recent SDK versions have the up-to-date definition of struct
OPENFILENAME, so we don't need to provide our own one.

Also, wxWidgets applications don't run under Win9x any longer, so there is no
need to fall back to comdlg32.dll v4 which was used there during run-time.
2017-03-05 17:06:19 +01:00
Cătălin Răceanu
e950e4a129 Remove MONITOR-related declarations not needed any more
Don't define MONITOR-related structs and messages ourselves in wxMSW code,
this shouldn't be needed any more as they're present in all remotely recent
versions of the SDK.

No real changes, just minor clean up.
2017-03-05 17:01:22 +01:00
Artur Wieczorek
9c5d6e893f Move duplicated code to the shared function
Code to emit PostScript commands to set the current colour is duplicated in several places (in SetBrush, SetPen, DrawAnyText functions) and therefore should be moved to a dedicated function.
2017-03-04 19:07:05 +01:00
Artur Wieczorek
feee67e6a1 Optimize selecting font in generated PostScript code
Emit code to select PostScript font only if it is needed (not at every call to SetFont(), but only if font has been really changed prior to a text drawing operation).
2017-03-04 19:07:04 +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
b308ff3746 Document bounding box fix in changelog
Document changes introduced in ae57d89df8.
2017-03-02 23:46:54 +01:00
Artur Wieczorek
944eccea68 Use new[] instead of malloc() 2017-03-02 22:44:52 +01:00
Artur Wieczorek
ae57d89df8 Fix updating bounding box in DrawSpline() implementation in wxMSWDC
All spline points have to be added to the bounding box.

Closes #17814.
2017-03-02 22:44:40 +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
Paul Cornett
a0cb7c1291 Avoid using stale nl_langinfo() pointer
See #17813
2017-03-02 07:48:08 -08:00
New Pagodi
2278bb0dfa Update wxSTC documentation stuff
1. All stuff to generate documentation is moved from 'gen_iface.py' to a separate module 'gen_docs.py'. It contains several new structures to support maintenance of the documentation:
 categoriesList - A list of the categories and an optional description.
 docsMap - A dictionary that assigns each method to one of the categories.
 docOverrides - A dictionary that can be used to replace the docstring from the iface file.
 docSubstitutions - A dictionary that can be used to replace a few words from the docstring in the iface file.
 extendedDocs - A dictionary that can be used to add extended documentation.
 sinceAnnotations - A dictionary that can be used to add '@since' annotations.

2. Documentation is reformatted and updated:
 - Added a table of contents.
 - Broke the methods into sections.
 - Added docs for previously undocumented methods.
 - Altered docs that were unhelpful or misleading.
 - Added  '@since 3.1.0' notes and '@since 3.1.1' notes.
 - Altered docs which contained references to Scintilla macros or other problematic text.

Closes #17680.
2017-02-28 22:49:43 +01:00
VZ
aaa31b121c Don't build samples not supported in current wxMSW build
Fix certain samples being compiled when they shouldn't because the
corresponding feature was disabled when building the library.
2017-02-27 23:17:37 +01:00
Mat M
ab5312c8d2 Fix typo in assert message in wxOSX wxMenuBar::Refresh()
Spell "unattached" correctly.
2017-02-27 10:47:35 +01:00
Jouk
8164419072 OpenVMS (AXP) needs a != operator in the find function 2017-02-27 08:18:54 +01:00
mgimenez
52130e43ab Minor documentation fix
'heightLine" parameter is not applicable to the function being described.

Closes #17806.
2017-02-25 18:52:23 +01:00
New Pagodi
ee609de199 Fix names for some wxSTC constants
Generally, Scintilla constants which names beginning with 'SCXX' are mapped to wxSTC names by by stripping out the 'SC' before prepending 'wxSTC_', for example SCWS_INVISIBLE gets mapped to wxSTC_WS_INVISIBLE. Unfortunately, this common rule of mapping the names is not applied to the (legacy) names beginning with 'SCVS_' and 'SCMOD_'.
For the sake of consistency, also these names should conform to the common naming convention, so gen_iface.py is updated to generate conformant names for all affected prefixes. Legacy names are preserved for backward compatibility but commented deprecated and no longer referenced in the documentation.

Closes #17808.
2017-02-25 18:05:59 +01:00
VZ
217941e9c3 Merge pull request #423 from MaartenBent/resolve-warnings
Resolve -Wsuggest-override and -Wmisleading-indentation warnings.
2017-02-25 03:23:11 +01:00
Maarten Bent
87308746be Resolve -Wsuggest-override warnings. 2017-02-24 23:37:44 +01:00
Maarten Bent
f6f72449fe Resolve -Wmisleading-indentation warnings. 2017-02-24 23:37:38 +01:00
Cătălin Răceanu
e8207c8c59 Fix building tests with wxUSE_UNSAFE_WXSTRING_CONV==0
Avoid relying on implicit conversions to std::string in the tests code.
2017-02-24 15:37:37 +01:00
Cătălin Răceanu
3a02672de8 Use MIIM_FTYPE rather than MIIM_TYPE in wxMSW
There is no need to use the old symbol any more now that we don't support
Windows 9x any longer.
2017-02-24 15:36:46 +01:00
Jouk
af70755124 Correction on the prious update of this file 2017-02-24 14:13:35 +01:00
VZ
bb8a7dc931 Merge pull request #420 from catalinr/fix_charset_comments
Fix a couple of charset-related comments.

No real changes.
2017-02-24 02:26:18 +01:00
New Pagodi
98720ee7a4 Fix names of newly introduced wxSTC constants
In 68888ca0a2 there were introduced new wxSTC constants representing Scintilla SCTD_* parameters. Unfortunately, their names don't conform to naming convention of other constants and therefore should be changed. For the sake of consistency, Scintilla SCTD_* names should be mapped to wxSTC_TD_* ones.

Closes #17807.
2017-02-23 23:03:40 +01:00
Artur Wieczorek
c6e4507c07 Add unit tests for wxHexToDec()
See #12814.
2017-02-23 20:50:18 +01:00
Artur Wieczorek
71305cff62 Add sanity checks for input string in wxHexToDec()
Check if the length of the string is appropriate and if it contains hexadecimal characters.
Also document this function.

Closes #12814.
2017-02-23 20:49:59 +01:00
Artur Wieczorek
2ecd4a07ba Add unit tests for wxDecToHex() 2017-02-23 20:48:28 +01:00
Artur Wieczorek
2934f77660 Fix and document wxDecToHex()
1. Integer instead of floating point arithmetic should be used in calculations.
2. Because this function always returns 2 hexadecimal characters, its parameter type should be changed from 'int' to 'unsigned char' to avoid misunderstandings and prevent misuses.

Closes #12612.
2017-02-23 20:48:03 +01:00
Artur Wieczorek
bfa2b2896b Use wxDecToHex() to convert integer value to hex string 2017-02-23 19:32:18 +01:00
Catalin
456eb42a92 Removed irrelevant comment about MSW charset in OSX code. 2017-02-23 19:23:35 +02:00
Catalin
882e109ed5 Improved description of charset values under MSW. 2017-02-23 19:20:20 +02:00
Cătălin Răceanu
933e3e6fc5 Remove compile-time checks for always defined WM_XXX in wxMSW
The symbols in question are present at least since XP, and most of them since
Windows 2000, so remove preprocessor checks for them, they shouldn't be needed
when any remotely current compiler/SDK.
2017-02-22 23:17:56 +01:00
Kvaz1r
f9f5f9770a Update a few Ukrainian translations 2017-02-22 23:14:50 +01:00
Artur Wieczorek
74ab36c125 Simplify PostScript code generated by wxPostScriptDC to draw elliptic arc
Optimize procedure 'ellipticarc' by doing all operations on the operand stack instead of creating local dictionary and temporary variables.
2017-02-22 21:23:44 +01:00
Artur Wieczorek
8a45881e44 Simplify PostScript code generated by wxPostScriptDC to draw elliptic contour
Optimize procedure 'ellipse' (to draw elliptic contour) by doing all operations on the operand stack instead of creating local dictionary and temporary variables.
2017-02-22 21:15:21 +01:00
Artur Wieczorek
f49528cc2f Fix DrawArc() implementation in wxPostScriptDC
Draw pie, not arc, if current brush is not transparent.
Also simplify the code by invoking PostScript 'arc' operator only once if pie is drawn.

Closes #17805.
2017-02-22 21:09:17 +01:00