Commit Graph
10 Commits
Author SHA1 Message Date
David Richardson 886f50fc88 AppKit: Provide default context menu for editable and selectable CPTextFields
CPTextField previously passed the browser's context menu through only when
its next responder was not a view, and no view in the responder chain
supplied one, leaving text fields without a context menu.

Because reading the system clipboard from a custom menu triggers browser permission
prompts, Paste is omitted; Cut and Copy write to the system clipboard via the asynchronous Clipboard API.

- CPTextField:
  - Implement +defaultMenu containing Cut, Copy, and Select All.
  - Implement -menuForEvent:, prioritizing application-assigned menus and
    deferring to enclosing table views for table data views.
  - Write to the system clipboard in -copy: when invoked outside native
    browser clipboard events.
  - Preserve text selection when opening the context menu and restore it
    for Cut and Copy actions, restricted exclusively to editable fields.

- CPSearchField: Present the text field context menu on right-click rather
  than the search menu returned by -menu.

- CPPasteboard: Extract a shared system clipboard write helper and adopt it
  in CPTextView.

- CPTextFieldTest, CPSearchFieldTest: Add unit tests covering context
  menu presentation, validation, and override precedence.
2026-11-18 12:41:52 -06:00
David Richardson fbd08705e9 AppKit: Give Aristo3 colours names that follow appearance, add first dark set
- Add theme colour catalog "Theme" with values in CPColor attribute theme-colors

- Accept colours and arrays in CSS dictionaries; convert each value at write time

- Compare converted CSS of appearance-dependent CSS colours and images in setters

- Skip dynamic values in theme load walks; fix resource paths in strings only

- Rename CPView -_applyBackgroundColor to -_writeBackgroundColor (CPWebView clash)

- Resolve event-time DOM writes in owning view appearance; reapply on change

- Write _CPImageAndTextView text colour in layout

- Define 104 Aristo3 constants as 98 theme colours; add dark table for DarkAqua

- Add tests for CSS values, theme catalog, Aristo3 theme colours and audit sites
2026-11-12 09:02:59 -06:00
Alexandre Wilhelm 923d32ee6d Test: finally put the init of the CPApplication in the instance method setUp. See previous commit #6fe9dae3d62af995f2481bfebdd706aeb0b21365 2015-07-07 15:04:29 -07:00
Alexandre Wilhelm 6fe9dae3d6 Fixed: AppKit unit-tests are not standalone
Previously, every AppKit tests used the same sharedApplication. Due to this implementation, a could not pass because a previous test made failed the current test. For instance, a test could fail because the window of the previous test resigned (just imagine a new window is the key window in the current test), and this resign could raise an error. The error was displayed for the current test thought this test was perfect !

We now instead of using sharedApplication create a new CPApplication per unit-test file in the class method setUp.
2015-07-07 14:12:19 -07:00
Christian Passlack bb9049bef4 Code-styling to match official style-guide. 2015-03-23 20:45:31 +01:00
Christian Passlack 94f15aba40 Updated Test-Cases of CPNumberFormater and CPTextfield because of the
changes for fix #2332. The test-cased failed, because now a
a CPDecimalNumber has a different UID compared to a CPNumber with the same
value. That means isEqual: will return false. In the test-cases the formatter now
generates CPNumbers to make the two Numbers compareable via isEqual.
2015-03-23 20:30:01 +01:00
Martin Carlberg e511638962 Fixed: Cleaned up return and parameter types on methods. 2013-11-24 22:21:56 +01:00
Alexander Ljungberg 4d8758f755 Fix CPTextFieldTest. 2012-08-04 13:58:29 +01:00
Alexander Ljungberg 984b46ba07 Test CPTextField with a formatter. 2011-07-06 13:36:41 -04:00
Alexander Ljungberg dcf1d324a5 Additional test for the previous bug. 2011-04-21 19:03:10 -04:00