Class: ArcadiaDialogManager
- Inherits:
-
Object
- Object
- ArcadiaDialogManager
- Defined in:
- lib/a-core.rb
Instance Method Summary collapse
-
#initialize(_arcadia) ⇒ ArcadiaDialogManager
constructor
A new instance of ArcadiaDialogManager.
- #on_dialog(_event) ⇒ Object
- #on_dialog_old(_event) ⇒ Object
Constructor Details
#initialize(_arcadia) ⇒ ArcadiaDialogManager
Returns a new instance of ArcadiaDialogManager.
1485 1486 1487 1488 |
# File 'lib/a-core.rb', line 1485 def initialize(_arcadia) @arcadia = _arcadia Arcadia.attach_listener(self, DialogEvent) end |
Instance Method Details
#on_dialog(_event) ⇒ Object
1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 |
# File 'lib/a-core.rb', line 1490 def on_dialog(_event) type = _event.type if !DialogEvent::TYPE_PATTERNS.include?(_event.type) type = 'ok' end res_array = type.split('_') if _event.level.nil? || _event.level.length == 0 icon = 'info' else icon = _event.level end tktype = type.gsub('_','').downcase tkdialog = Tk::BWidget::MessageDlg.new( 'icon' => icon, 'bg' => Arcadia.conf('background'), 'fg' => Arcadia.conf('foreground'), 'type' => tktype, 'title' => _event.title, 'message' => _event.msg) tkdialog.configure('font'=>'courier 6') res = tkdialog.create _event.add_result(self, 'value'=>res_array[res.to_i]) end |
#on_dialog_old(_event) ⇒ Object
1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 |
# File 'lib/a-core.rb', line 1517 def on_dialog_old(_event) type = _event.type if !DialogEvent::TYPE_PATTERNS.include?(_event.type) type = 'ok' end icon = _event.level tktype = type.gsub('_','').downcase res = Tk.( 'icon' => icon, 'type' => tktype, 'title' => _event.title, 'message' => _event.msg) _event.add_result(self, 'value'=>res) end |