-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_interface.rb
56 lines (43 loc) · 1.37 KB
/
main_interface.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
require 'fox16'
require '.\button_control'
include Fox
class MainInterface < FXMainWindow
def initialize (app)
super( app, "Banking Application", :width =>600, :height => 400)
$person_list = Hash.new
$bank_list = Hash.new
@control = ButtonControl.new
control_frame = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_CENTER_Y)
create_person_button = FXButton.new(control_frame, "Create a person",
:opts => BUTTON_NORMAL|LAYOUT_CENTER_X)
create_person_button.connect(SEL_COMMAND) do |sender, sel, data|
@control.create_person(app)
end
create_bank_button = FXButton.new(control_frame, "Create a bank",
:opts => BUTTON_NORMAL|LAYOUT_CENTER_X)
create_bank_button.connect(SEL_COMMAND) do |sender, sel, data|
@control.create_bank(app)
end
account_open_button = FXButton.new(control_frame, "Open Account",
:opts => BUTTON_NORMAL|LAYOUT_CENTER_X)
account_open_button.connect(SEL_COMMAND) do |sender, sel, data|
@control.account_open(app)
end
exit_app_button = FXButton.new(control_frame, "Exit",
:opts => BUTTON_NORMAL|LAYOUT_CENTER_X)
exit_app_button.connect(SEL_COMMAND) do |sender, sel, data|
@control.exit_app
end
end
def create
super
show( PLACEMENT_SCREEN )
end
end
if __FILE__ == $0
FXApp.new do |app|
MainInterface.new(app)
app.create
app.run
end
end