344 Commits
Author SHA1 Message Date
Paul Cornett 672466a111 Avoid -Wdouble-promotion warnings 2026-08-26 00:37:58 -07:00
Vadim Zeitlin a34b910435 Replace remaining 4px borders with standard ones in the samples
The standard border size is 5 or 6 pixels which is not that different
from 4 and it's not worth specifying the size of the border explicitly,
this just distracts from the rest of the code which the samples are
supposed to demonstrate.

Moreover, many borders of size 4 have been already replaced with ones of
standard size in the grandparent commit, so get rid of all the rest of
them too.
2026-08-18 00:56:58 +02:00
VZandCătălin Răceanu f44d75a159 Use wxSizerFlags::HorzBorder() and DoubleHorzBorder()
This is more concise and clear than `wxLEFT | wxRIGHT`.

Co-authored-by: Cătălin Răceanu <catalinr@users.noreply.github.com>
2026-08-18 00:43:03 +02:00
Vadim ZeitlinandClaude Sonnet 5 173f01c980 Use wxSizerFlags and DPI-independent borders in samples
This is an LLM-assisted change as doing it by hand turned out to be too
time-consuming and not worth spending time on it.

See #24755.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-16 23:52:33 +02:00
Vadim Zeitlin 5ccdcd6b2a Update version to 3.3.4
Run misc/scripts/inc_release, update version.bkl and rebake.
2026-07-09 15:08:08 +02:00
iht f5cb9a66c0 Update wxwidgets.props and common.bkl for VS 2026
This is in line with the changes in a0f5c92b96 and 3d88038d01
2026-05-12 16:29:03 +02:00
Vadim Zeitlin edefb4475e Update version to 3.3.3
Run misc/scripts/inc_release and rebake and rerun autoconf.
2026-03-04 19:40:20 +01:00
Daniel Collins acd8b7295e Document that wxApp::OnExit() should be called from overrides
And update the samples to follow the advice in the documentation.

Closes #26173.
2026-02-10 01:05:59 +01:00
Randalphwa 6228eaf449 Add support for using LunaSVG for SVG rasterization
Optionally use LunaSVG library from the new submodule instead of
NanoSVG.

Closes #25902.
2026-01-18 00:48:57 +01:00
Vadim Zeitlin 0a6523c4d9 Update copyright years to 2025
Unix builds / Ubuntu 18.04 wxGTK 3 compatible 3.0 (push) Has been cancelled
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK UTF-8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxQt (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxX11 (push) Has been cancelled
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Has been cancelled
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Has been cancelled
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxDFB (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 3 static with gcc 4.8 (push) Has been cancelled
Unix builds / Ubuntu 18.04 wxGTK 2 (push) Has been cancelled
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Has been cancelled
CMake builds / MSW/MSVC wxMSW (push) Has been cancelled
CMake builds / MSW/Clang wxMSW (push) Has been cancelled
CMake builds / macOS latest wxOSX Ninja (push) Has been cancelled
CMake builds / macOS 14 wxOSX Xcode (push) Has been cancelled
CMake builds / macOS 14 wxIOS (push) Has been cancelled
CMake builds / MSW/MSVC wxQt 5.15 (push) Has been cancelled
CMake builds / MSW/MSVC wxQt 6.10 (push) Has been cancelled
Mac builds / wxMac ARM ASAN not compatible (push) Has been cancelled
Mac builds / wxMac Universal C++14 (push) Has been cancelled
Mac builds / wxiOS Simulator on Silicon Mac (push) Has been cancelled
Mac builds / wxiOS (push) Has been cancelled
Mac builds / wxMac Intel C++17 (push) Has been cancelled
Mac Xcode builds / iOS Simulator static (push) Has been cancelled
Mac Xcode builds / macOS dynamic Release (push) Has been cancelled
Mac Xcode builds / iOS static Debug (push) Has been cancelled
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Has been cancelled
MSW builds / wxMSW vs2022 DLL Release x64 (push) Has been cancelled
MSW builds / wxMSW vs2022 Debug Win32 (push) Has been cancelled
MSW builds / wxMSW vs2022 Release arm64 (push) Has been cancelled
MSW cross-builds / wxMSW 64 bits not compatible (push) Has been cancelled
MSW cross-builds / wxMSW/Univ (push) Has been cancelled
MSW cross-builds / wxMSW 32 bits (push) Has been cancelled
Code Checks / Check Spelling (push) Has been cancelled
Code Checks / Check Whitespace (push) Has been cancelled
Code Checks / Check Mixed EOL (push) Has been cancelled
Code Checks / Check C++ Style (push) Has been cancelled
Code Checks / Check All Headers In allheaders.h (push) Has been cancelled
Update Documentation / Update Online Documentation (push) Has been cancelled
No Response / no-response (push) Has been cancelled
Just run misc/scripts/inc_year and commit the results.

See #18690.
2026-01-01 17:40:18 +01:00
Eran Ifrah d4c8e395b4 Make menu commands in stc sample usable under macOS
On macOS, "Minimal editor" and "Document map" items placed in the
"Window" menu didn't appear in the (standard) "Window" menu at all and
so couldn't be accessed.

Temporarily work around this wxOSX bug by moving them to another menu.

Closes #25935.

Signed-off-by: Eran Ifrah <eran@codelite.org>
2025-11-01 16:06:17 +01:00
Vadim Zeitlin 9d75245d08 Synchronize markers with the mirror control too
Add a demo marker to the sample to verify that it is shown in the map as
well.
2025-10-21 02:05:45 +02:00
Vadim Zeitlin f0b72c36b1 Move wxStyledTextCtrlMiniMap from stc sample to the library
After experimenting with this code in the sample, move it to its
permanent place in the library.

This commit is best viewed using Git --color-moved option and ignoring
whitespace changes.
2025-10-17 02:11:02 +02:00
Vadim Zeitlin 42e87852eb Add Edit::ToggleLineNumbers() to the sample
Make it a bit simpler to show line numbers when showing the minimap.
2025-10-16 23:54:39 +02:00
Vadim Zeitlin 68a55e9c9b Synchronize folding in the map and the main editor
Also don't hide fold margin any longer to allow testing folding.
2025-10-16 23:48:49 +02:00
Vadim Zeitlin 42ac97b157 Increase the line number margin width
It wasn't big enough to show 4 digit numbers.
2025-10-13 18:46:58 +02:00
Vadim Zeitlin 7d7caf4a3e Extract iteration algorithm in its own function
Avoid duplicating the same code in different functions that need to
iteratively find the correct first visible line in the editor.
2025-10-13 18:38:37 +02:00
Vadim Zeitlin 58cd52d2db Fix SyncEditPosition() for the case of wrapped lines too
We need to iteratively find the first editor line such that the
corresponding first map line is the desired one.
2025-10-13 18:19:56 +02:00
Vadim Zeitlin 87c8ce0184 Fix scrolling the editor while dragging the thumb
Find the candidate middle of the thumb directly from the first visible
line in the editor, we don't need to compute the first visible map line
(especially as we did it wrongly) for this.

Get rid of m_dragLastY which is not needed to get a reasonably accurate
initial estimation.
2025-10-13 18:02:20 +02:00
Vadim Zeitlin 9396c1980b Add MapVisibleFromEditVisible() helper function
No real changes, just simplify the code a bit by adding a trivial
function performing a commonly needed mapping.
2025-10-13 17:42:01 +02:00
Vadim Zeitlin 5500f3d38c Really fix map sync when lines can be wrapped
The assumption that first visible lines of the map and the editor are
proportional doesn't hold in this case, only the thumb position and the
first visible line in the editor must be proportional to each other in
order to accurately represent the position in the document.
2025-10-13 15:20:43 +02:00
Vadim Zeitlin f0d9d909c4 Improve skipping scroll events caused by the program itself
Don't use a single m_updateBlocked flag which was reset too early,
before the re-wrapping happened, and so didn't really avoid processing
the scroll events due to the program itself.

Remember the last first line value we set instead and ignore events
scrolling to this line instead.
2025-10-13 15:10:26 +02:00
Vadim Zeitlin 187f68f2a4 Replace {map,edit}Display with {map,edit}Max in LinesInfo
No real changes, just store the maximum possible values for the first
visible line in both controls instead of storing the number of display
lines as we only really need the former.
2025-10-13 14:40:00 +02:00
Vadim Zeitlin bc322eb65a Fix multiple bugs in determining position when dragging
Improve the initial estimate: old method was more precise when display
and document lines matched up (i.e. without wrapping) but could result
in completely wrong value when they were very different.

Add proper range checking to avoid ending up with an invalid editor
first visible line.

Ensure that we don't enter an infinite loop when there are two first
visible lines values resulting in the thumb position close to but
either just above or below the correct one.
2025-10-02 23:51:27 +02:00
Vadim Zeitlin 2ef91eb6a3 Rename all "editor" variables to start with "edit" instead
Use consistent naming instead of using "editorFoo" for some things and
"editBar" for the other ones.

No real changes.
2025-10-02 15:09:47 +02:00
Vadim Zeitlin 4a440d6079 Sync map and document properly when lines are wrapped
Don't assume that display and document lines are the same any longer.

This complicates things a lot, notably while dragging because we can't
simply find the correct first line for the editor any longer but need to
search for it iteratively because the size of the thumb now depends on
its position, as different regions of the document may wrap differently.

Also synchronize the map with the document when it is repainted and not
resized because line wrapping is done in the background after the resize
and we don't have the correct mapping between the display and document
lines yet in the wxEVT_SIZE handler -- but we eventually get it for the
last wxEVT_PAINT provoked by it.
2025-09-10 01:46:28 +02:00
Vadim Zeitlin f7d62775ee Rename GetMapLineAtPoint() to GetDocLineAtMapPoint()
Make it clear that this function returns the logical/document line and
not the physical/display line.

No real changes.
2025-09-09 18:59:26 +02:00
Vadim Zeitlin 4150ab89a0 Collect information about visible lines in LinesInfo struct
This makes it simpler to check if any of the relevant variables have
changed and update them all at once.
2025-09-09 18:59:26 +02:00
Vadim Zeitlin 7db300305c Initialize m_mapLineHeight only once
It doesn't change even if the window is resized.

No real changes.
2025-09-09 18:59:26 +02:00
Vadim Zeitlin cc089bf7be Add separate m_isDragging instead of reusing m_dragOffset
The value of m_dragOffset will possibly become negative after the
upcoming changes, so don't rely on the special value -1 meaning that we
are not dragging any more.

No real changes.
2025-09-09 18:59:26 +02:00
Vadim Zeitlin 96be24e510 Wrap lines in the main document used with the map for testing 2025-09-08 15:36:49 +02:00
Vadim Zeitlin 87e81bce48 Use number of displayed, and not document, lines in the map code
We really care about the number of physical, i.e. "display", lines
appearing in the window and not the number of logical, or "document",
lines.

They are the same as long as no lines are either wrapped or folded but
become different as soon as either of them is used.
2025-09-01 17:26:52 +02:00
Vadim Zeitlin df2f85d0b7 Do not set the lexer for the map wxSTC instance
Apparently using the same lexer for 2 controls sharing the same document
doesn't work, this results in problems with syntax highlighting and
folding not working at all.

Simply not doing this fixes these problems while still showing the
correct syntax highlighting in the map, as it shares the same document.
2025-09-01 17:25:03 +02:00
Vadim Zeitlin 08b041c123 Use variable instead of hardcoded number for folding margin
Make the comparison more understandable and avoid hardcoding "2".
2025-09-01 17:24:07 +02:00
Vadim Zeitlin b9198771bc Prevent removing the document or the map in ShowDocumentMap()
Don't allow un-splitting wxSplitterWindow.
2025-08-30 19:25:06 +02:00
Vadim Zeitlin 246f8a6505 Don't allow Ctrl+mouse wheel zooming in the map
Still allow scrolling using just the mouse wheel.
2025-08-26 19:47:01 +02:00
Vadim Zeitlin 5089cbc1ff Handle double clicks in the map as simple clicks
This is much more useful than ignoring them as some clicks in a series
of clicks could be unintentionally lost/ignored before.
2025-08-26 00:26:55 +02:00
Vadim Zeitlin 86e0b4db63 Simplify and improve map thumb positioning logic
Cache often used values for efficiency.

Avoid recursive calls to our Sync{Edit,Map}Position() by using a flag to
block the unwanted notifications.

Fix thumb positioning while dragging.
2025-08-24 17:56:10 +02:00
Vadim Zeitlin d67398896e Add convenient GetThumbTopPos() function
Just extract it from DrawVisibleZone().

No real changes, this is just a refactoring.
2025-08-24 17:56:10 +02:00
Vadim Zeitlin d3dd2294d2 Don't scroll when starting to drag
Add forgotten return to prevent falling through to the logic for
clicking outside of the thumb when clicking on it.
2025-08-24 17:56:10 +02:00
Vadim Zeitlin 9bf20b80a2 Prevent Scintilla from handling double clicks in the map
This results in unwanted text selection and messes up mouse capture, so
don't let it process this event.
2025-08-22 23:30:47 +02:00
Vadim Zeitlin 5c90cf4963 Make the overlay more opaque while dragging under non-MSW too
Unfortunately opacity needs to be handled differently for wxMSW and the
others.
2025-08-04 02:06:46 +02:00
Vadim Zeitlin 57321c6eaa Experiment with document map in wxSTC sample
Add a menu item showing a dialog with the document and its map.
2025-08-04 02:01:01 +02:00
Vadim Zeitlin e4fc22b1e1 Avoid using Tab and Shift+Tab as accelerators
This doesn't work in wxGTK and results in a debug warning on the sample
startup.
2025-08-02 16:40:48 +02:00
Vadim Zeitlin 3b7ce8e9a7 Increment version to 3.3.2
Rebake all generated files.
2025-07-25 00:29:00 +02:00
Vadim Zeitlin 29f9d3512a Update version to 3.3.1 and rebake 2025-06-09 22:36:35 +02:00
Maarten Bent fd14294606 Recreate build-files 2025-05-10 18:22:27 +02:00
Maarten Bent b0b3da6ce2 Add libwebp to MSVS solutions 2025-05-10 18:06:41 +02:00
Vadim Zeitlin 981341c913 Update copyright years to 2025
Just run misc/scripts/inc_year and commit the results.

See #18690, #25041.
2025-01-06 22:16:06 +01:00
PB eba106431a Allow running samples from MSVS in DLL configurations
Create file samples/samples.props which adds the DLL build directory
to MSVS PATH in <LocalDebuggerEnvironment> property.

Add file samples.props to all MSVS sample projects.
2024-11-16 18:35:41 +01:00