"""
Template companion plugin.
Replace every occurrence of ``MyPlugin`` / ``my_plugin`` with your own name,
then implement the methods below.
Rename this directory to match the ``name`` field in ``plugin.toml``
(removing the leading ``_`` so it is auto-discovered).
"""
from wolfhece._menu_companion_abc import AbstractCompanion, ActionItem
from wolfhece._viewer_plugin_handlers import MouseContext, KeyboardSnapshot
# wx key codes — avoid importing wx at module level
[docs]
class MyPluginCompanion(AbstractCompanion):
"""Minimal template — replace with your implementation."""
[docs]
def start(self) -> None:
"""Called when the companion is activated programmatically."""
self._start_action(
self._action_id('run'),
'Right-click to interact — Esc to stop',
)
# -- handlers ------------------------------------------------------------
[docs]
def _on_run(self, event) -> None:
self.start()
[docs]
def _rdown(self, viewer, ctx: MouseContext) -> None:
# TODO: implement your right-click handler
self._force_redraw()
[docs]
def _key(self, viewer, kb: KeyboardSnapshot) -> bool:
if kb.key_code == _WXK_ESCAPE:
self.stop()
return True
return False
[docs]
def _paint(self, viewer) -> None:
# TODO: draw your OpenGL overlay
pass