class Glimmer::Calculator

Constants

APP_ROOT
LICENSE
VERSION

Public Instance Methods

command_button(command, options = {}) click to toggle source
# File lib/views/glimmer/calculator.rb, line 98
def command_button(command, options = {})
  command = command.to_s
  options[:font] ||= @button_font
  options[:horizontal_span] ||= 1
  options[:vertical_span] ||= 1
  
  button { |proxy|
    text command
    font options[:font]
    
    layout_data(:fill, :fill, true, true) {
      horizontal_span options[:horizontal_span]
      vertical_span options[:vertical_span]
    }
    
    on_widget_selected {
      @presenter.press(command)
    }
  }    
end
display_about_dialog() click to toggle source
# File lib/views/glimmer/calculator.rb, line 119
def display_about_dialog
  message_box(body_root) {
    text 'About'
    message "Glimmer - Calculator #{VERSION}\n#{LICENSE}"
  }.open
end
number_button(number, options = {}) click to toggle source
# File lib/views/glimmer/calculator.rb, line 90
def number_button(number, options = {})
  command_button(number, options)
end
operation_button(operation, options = {}) click to toggle source
# File lib/views/glimmer/calculator.rb, line 94
def operation_button(operation, options = {})
  command_button(operation, options.merge(font: @button_font_operation))
end