Commit Graph
17 Commits
Author SHA1 Message Date
David Richardson 00851abfa9 AppKit: Model CPRulerView and CPRulerMarker on NSRulerView and NSRulerMarker
Ruler classes departed from canonical NS versions, resulting in functional and visual gaps.:

markers were views that drew text characters and ignored their location argument, the ruler rebuilt its subviews on every update and had no origin offset, measurement units or reserved thicknesses, and CPTextView updated the ruler only on focus and typing attribute changes, had no ruler control methods, and never showed a right indent marker.

* AppKit.j: Import CPRulerMarker and CPRulerView.

* CPScrollView.j: Tile rulers by their required thickness, and give a ruler its scroll view when it is set.

* CPTextView/CPRulerMarker.j: Add CPRulerMarker as an object drawn by its ruler, with a marker location, an image and image origin, movability and removability, and tracking that adds, moves and removes markers through the client view.

* CPTextView/CPRulerView.j: Rewrite CPRulerView with an origin offset, registered measurement units defaulting to the user's region, reserved thicknesses for markers and an accessory view, Cocoa's client view methods, temporary ruler lines, and drawing in a single pass.

* CPTextView/CPTextView.j: Add usesRuler, isRulerVisible, setRulerVisible: and toggleRuler: with a Show Ruler or Hide Ruler title; update the ruler on every selection change; place tab stop, first line, head and tail indent markers relative to the start of the text, with SVG marker images and a context menu for changing tab types and resetting indents.

* Tests/Manual/TextEditor/DocumentWindowController.j: Show the ruler through setRulerVisible:.
2026-10-23 19:30:48 -06:00
David Richardson 4a5a25bb65 Fix undeclared _clientView instance variable in CPRulerView
Declare _clientView within the CPRulerView instance variable block.

This resolves a cold build compilation failure where the Objective-J parser flags assignments to the undeclared variable as illegal global variable creations.
2026-08-28 20:57:03 -06:00
daboe01 874792fa6e new: constrain tab stop marker dragging to preceding text boundary 2026-08-26 19:01:32 +02:00
daboe01 9ffa4decd4 fixed: indentation paddle dragging and clientView binding 2026-08-26 17:06:34 +02:00
David Richardson 533a1d46eb Address CPRulerOrientation build warning
CPRulerView.j declared CPRulerOrientation's constants directly,
with only a comment claiming it was a typedef.

No @typedef directive existed, so the type was unknown wherever used as an ivar or parameter type.

Added the missing @typedef CPRulerOrientation, matching the pattern already used for CPTextAlignment in CPText.j.
2026-08-20 19:57:35 -06:00
David Richardson 52658b636a Add missing CPTextTab forward declaration in CPRulerView
CPRulerView.j referenced CPTextTab (isKindOfClass: and alloc/init) without a declaration.

Added @class CPTextTab; to resolve the symbol reference. A forward declaration was utilized rather than importing CPParagraphStyle.j to minimize dependency coupling, despite the absence of a circular import risk.

Resolves build warning.
2026-08-20 16:28:02 -06:00
David Richardson 78a0ebab6e Remove CPScrollView build warning
CPRulerView.j did not import CPScrollView.
A direct import would create a cycle, since CPScrollView.j already imports CPRulerView.j.
Added a forward declaration instead.
2026-08-19 20:23:33 -06:00
David Richardson 1a9a42ff54 Replace #pragma mark with // MARK:
Replace objc directive with native Javascript version // MARK: to facilitate elimination of preproccsing pass.
2026-07-21 15:15:53 -06:00
daboe01 a981b8b04d improved: indentation markers 2026-06-16 19:17:44 +02:00
daboe01 22fdc971c7 improved: marker icons 2026-05-30 10:11:00 +02:00
daboe01 2a83dcb64a fixed: adding new tabstops 2026-05-30 09:08:56 +02:00
daboe01 c704880e13 improved: tabstop handles 2026-05-29 11:41:39 +02:00
daboe01 41c422ed03 new: visual feedback when "tearing off" 2026-05-29 10:55:22 +02:00
daboe01 c94ed00f41 fixed: basic ruler view support 2026-05-29 10:46:10 +02:00
daboe01 7e0f03a6fc fixed: CI error 2026-05-28 21:03:31 +02:00
daboe01 6e36fc0b20 formatting 2026-05-28 17:51:10 +02:00
daboe01 d180a25f2e new: CPRulerview and friends 2026-01-16 17:08:50 +01:00