Module: reefvision.widgets.messagebox

Source: ./reefvision/widgets/messagebox.reef


Overview

reefvision.widgets.messagebox — modal dialog (design §10.4–10.5)

object MessageBox extends window.Window. Factory messagebox_create news a dialog and adds a Label plus OK / OK-Cancel / Yes-No / Yes-No-Cancel Buttons (CMD_OK / CMD_CANCEL / CMD_YES / CMD_NO). Esc maps to CMD_CANCEL (not Window's CMD_CLOSE).

Nested modal loop: app.message_box(title, text, kind) — lives in desktop to avoid an import cycle. messagebox_show_stub remains for pure unit tests.


Types

MessageBoxKind (enum)

Variants:

  • Ok
  • OkCancel
  • YesNo
  • YesNoCancel

Objects

MessageBox

Extends: window.Window

proc init(bounds: cell.Rect, title: string)

Methods:

override exclusive fn handle_event(e: event.Event): view.EventResult


Functions

fn messagebox_kind_ok(): MessageBoxKind

fn messagebox_kind_ok_cancel(): MessageBoxKind

fn messagebox_kind_yes_no(): MessageBoxKind

fn messagebox_kind_yes_no_cancel(): MessageBoxKind

fn default_bounds(): cell.Rect

Default dialog size matches the pre-object unit tests (40×8 outer).

fn client_wh(outer: cell.Rect): cell.Rect

fn messagebox_create(title: string, text: string, kind: MessageBoxKind): MessageBox

fn messagebox_show_stub(title: string, text: string, kind: MessageBoxKind): int

No TTY / Application — always CMD_NONE. Use app.message_box.


Procedures

proc add_buttons(mb: MessageBox, kind: MessageBoxKind, bx0: int, by: int, bw: int)


Generated by reefc doc