Class: Roebe::GUI::LibUI::InteractiveCaesarCipher

Inherits:
Object
  • Object
show all
Includes:
LibuiParadise::Extensions, InteractiveCaesarCipherModule
Defined in:
lib/roebe/gui/libui/interactive_caesar_cipher/interactive_caesar_cipher.rb

Overview

Roebe::GUI::LibUI::InteractiveCaesarCipher

Constant Summary

Constants included from InteractiveCaesarCipherModule

InteractiveCaesarCipherModule::ALPHABET, InteractiveCaesarCipherModule::CSS_SMALL_BORDER, InteractiveCaesarCipherModule::HEIGHT, InteractiveCaesarCipherModule::HELPER_TEXT_FOR_THE_MAIN_HEADER_LABEL, InteractiveCaesarCipherModule::LARGER_FONT, InteractiveCaesarCipherModule::TITLE, InteractiveCaesarCipherModule::USE_THIS_FONT, InteractiveCaesarCipherModule::WIDTH

Instance Method Summary collapse

Methods included from InteractiveCaesarCipherModule

#add_to_array_entries, #array_entries?, #border_size?, #entry2?, #last_entry?, #padding?, #reset_the_shared_module, #return_text1, #return_text2, #return_text3, #set_top_right_entry, #title?, #top_left_entry?

Constructor Details

#initialize(run_already = true) ⇒ InteractiveCaesarCipher

#

initialize

#


29
30
31
32
33
34
# File 'lib/roebe/gui/libui/interactive_caesar_cipher/interactive_caesar_cipher.rb', line 29

def initialize(
    run_already = true
  )
  reset
  run if run_already
end

Instance Method Details

#create_skeletonObject

#

create_skeleton (create tag, skeleton tag)

#


47
48
49
50
51
52
53
54
# File 'lib/roebe/gui/libui/interactive_caesar_cipher/interactive_caesar_cipher.rb', line 47

def create_skeleton
  # ======================================================================= #
  # === @window
  # ======================================================================= #
  @window = ui_padded_main_window(title?, width?, height?, 0)
  create_the_grid
  create_the_spin_buttons
end

#do_populate_the_main_gridObject

#

do_populate_the_main_grid

#


59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/roebe/gui/libui/interactive_caesar_cipher/interactive_caesar_cipher.rb', line 59

def do_populate_the_main_grid

  @grid.hash(
    create_then_return_the_header_label,
    left: 0, top: 0, xspan: 3, yspan: 1, hexpand: 1, halign: 0.5, vexpand: 1, valign: 0.5
  )

  @grid.hash(
    return_text1,
    left: 0, top: 1, xspan: 1, yspan: 1, hexpand: 0, halign: 0.5, vexpand: 1, valign: 0
  )
  @grid.hash(
    return_text2,
    left: 1, top: 1, xspan: 1, yspan: 1, hexpand: 0, halign: 0.5, vexpand: 1, valign: 0
  )
  @grid.hash(
    return_text3,
    left: 2, top: 1, xspan: 1, yspan: 1, hexpand: 0, halign: 0.5, vexpand: 1, valign: 0
  )

  create_the_apple_entry_then_append_it_onto_the_proper_array
  @grid.hash(
    last_entry?,
    left: 0, top: 2, xspan: 1, yspan: 1, hexpand: 0, halign: 0.5, vexpand: 1, valign: 0
  )
  @grid.hash(
    last_array_spin_button?,
    left: 1, top: 2, xspan: 1, yspan: 1, hexpand: 0, halign: 0, vexpand: 1, valign: 0
  )
  append_a_hcentered_entry
  @grid.hash(
    last_entry?,
    left: 2, top: 2, xspan: 1, yspan: 1, hexpand: 0, halign: 0.5, vexpand: 1, valign: 0
  )

  create_the_crrng_entry_then_append_it_onto_the_proper_array
  @grid.hash(
    last_entry?,
    left: 0, top: 3, xspan: 1, yspan: 1, hexpand: 0, halign: 0.5, vexpand: 1, valign: 0
  )
  @grid.hash(
    centered_spin_button('1'),
    left: 1, top: 3, xspan: 1, yspan: 1, hexpand: 0, halign: 0.5, vexpand: 1, valign: 0
  )
  append_a_hcentered_entry
  @grid.hash(
    last_entry?,
    left: 2, top: 3, xspan: 1, yspan: 1, hexpand: 0, halign: 0.5, vexpand: 1, valign: 0
  )

  # ======================================================================= #
  # Add the quit-button next:
  # ======================================================================= #
  @grid.hash(
    quit_button,
    left: 1, top: 4, xspan: 1, yspan: 1, hexpand: 0, halign: 0.5, vexpand: 0, valign: 0
  )
end

#let_the_main_spin_button_respond_to_change_eventsObject

#

let_the_main_spin_button_respond_to_change_events

#


135
136
137
138
139
140
141
# File 'lib/roebe/gui/libui/interactive_caesar_cipher/interactive_caesar_cipher.rb', line 135

def let_the_main_spin_button_respond_to_change_events
  @spin_button.on_changed {|something|
    proc { |pointer|
      determine_the_top_right_entry
    }
  }
end

#resetObject

#

reset (reset tag)

#


39
40
41
42
# File 'lib/roebe/gui/libui/interactive_caesar_cipher/interactive_caesar_cipher.rb', line 39

def reset
  title_width_height(TITLE, WIDTH, HEIGHT)
  reset_the_shared_module
end

#runObject

#

run (run tag)

#


121
122
123
124
125
126
127
128
129
130
# File 'lib/roebe/gui/libui/interactive_caesar_cipher/interactive_caesar_cipher.rb', line 121

def run
  create_skeleton_then_connect_skeleton
  outer_vbox = padded_vbox
  outer_vbox.add_hsep
  do_populate_the_main_grid
  let_the_main_spin_button_respond_to_change_events
  outer_vbox.maximal(@grid, 1)
  @window.add(outer_vbox)
  @window.intelligent_exit
end