Rotating ring modeled after the watch Controls menu: UP/DOWN spin,
START/STOP selects. Selection point sits at −30° (≈ 2 o'clock) so it
lines up with the physical enter button on 5-button round Garmins.
Icons are rasterized at 80×80 with automaticPalette="false" and
scaled via drawBitmap2 to stay crisp at any display resolution. Long
German compounds ("Einsatzbeginn", "Beweismittel", "Letzten löschen")
wrap to two lines via a Config array so the center label never
overlaps the surrounding icons. Selected index is persisted in
Application.Storage and restored on next launch.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
31 lines
788 B
MonkeyC
31 lines
788 B
MonkeyC
import Toybox.Lang;
|
|
import Toybox.WatchUi;
|
|
|
|
// Routes menu input. UP/DOWN rotate the ring; START/STOP selects.
|
|
// Dispatch of event-type keys is wired up in later phases — for now
|
|
// each selection just logs and no-ops.
|
|
class MenuDelegate extends WatchUi.BehaviorDelegate {
|
|
|
|
private var _view as MenuView;
|
|
|
|
function initialize(view as MenuView) {
|
|
BehaviorDelegate.initialize();
|
|
_view = view;
|
|
}
|
|
|
|
function onNextPage() as Boolean {
|
|
_view.rotateNext();
|
|
return true;
|
|
}
|
|
|
|
function onPreviousPage() as Boolean {
|
|
_view.rotatePrev();
|
|
return true;
|
|
}
|
|
|
|
function onSelect() as Boolean {
|
|
var item = _view.selectedItem();
|
|
Logger.log("menu.select: " + (item[:key] as String));
|
|
return true;
|
|
}
|
|
}
|