Class: MainWindow

Inherits:
FXMainWindow
  • Object
show all
Defined in:
lib/files/main_window.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ MainWindow

Returns a new instance of MainWindow.



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
57
58
# File 'lib/files/main_window.rb', line 10

def initialize(app)
  super(app, "StudentListView" , :width => 800, :height => 500)

  self.tabBook = FXTabBook.new(self)
  tabFrame1 = FXTabItem.new(self.tabBook, "Вкладка 1", nil)
  vFrame1 = FXVerticalFrame.new(self.tabBook)

  tabFrame2 = FXTabItem.new(self.tabBook, "Вкладка 2", nil)
  vFrame2 = FXVerticalFrame.new(self.tabBook)

  tabFrame3 = FXTabItem.new(self.tabBook, "Вкладка 3", nil)
  vFrame3 = FXVerticalFrame.new(self.tabBook)

  # Фамилия Имя Отчество?
  hFrame1 = FXHorizontalFrame.new(vFrame1)
  self.add_name_field(hFrame1)

  # Гит
  self.add_git_field(hFrame1)

  # Мейл
  hFrame2 = FXHorizontalFrame.new(vFrame1)
  self.add_email_field(hFrame2)

  # Телефон
  hFrame3 = FXHorizontalFrame.new(vFrame1)
  self.add_phone_field(hFrame3)

  # Телеграм
  hFrame4 = FXHorizontalFrame.new(vFrame1)
  self.add_tg_field(hFrame4)

  # Табличка
  hFrame5 = FXHorizontalFrame.new(vFrame1)
  FXLabel.new(hFrame5, "Таблица")

  hFrame6 = FXHorizontalFrame.new(vFrame1, opts: LAYOUT_FILL_X | LAYOUT_FIX_HEIGHT)
  hFrame6.height = 230

  self.add_table(hFrame6)

  # Перелистываем страницы
  hFrame7 = FXHorizontalFrame.new(vFrame1, opts: LAYOUT_FILL_X)
  add_lcr_buttons(hFrame7)

  # Кнопки
  hFrame8 = FXHorizontalFrame.new(vFrame1, opts: LAYOUT_FILL_X)
  add_crud_buttons(hFrame8)
end

Instance Attribute Details

#add_buttonObject

Returns the value of attribute add_button.



5
6
7
# File 'lib/files/main_window.rb', line 5

def add_button
  @add_button
end

#chg_buttonObject

Returns the value of attribute chg_button.



5
6
7
# File 'lib/files/main_window.rb', line 5

def chg_button
  @chg_button
end

#cur_page_labelObject

Returns the value of attribute cur_page_label.



7
8
9
# File 'lib/files/main_window.rb', line 7

def cur_page_label
  @cur_page_label
end

#del_buttonObject

Returns the value of attribute del_button.



5
6
7
# File 'lib/files/main_window.rb', line 5

def del_button
  @del_button
end

#go_left_buttonObject

Returns the value of attribute go_left_button.



6
7
8
# File 'lib/files/main_window.rb', line 6

def go_left_button
  @go_left_button
end

#go_right_buttonObject

Returns the value of attribute go_right_button.



6
7
8
# File 'lib/files/main_window.rb', line 6

def go_right_button
  @go_right_button
end

#page_count_labelObject

Returns the value of attribute page_count_label.



7
8
9
# File 'lib/files/main_window.rb', line 7

def page_count_label
  @page_count_label
end

#tabBookObject

Returns the value of attribute tabBook.



8
9
10
# File 'lib/files/main_window.rb', line 8

def tabBook
  @tabBook
end

#tableObject

Returns the value of attribute table.



8
9
10
# File 'lib/files/main_window.rb', line 8

def table
  @table
end

#upd_buttonObject

Returns the value of attribute upd_button.



5
6
7
# File 'lib/files/main_window.rb', line 5

def upd_button
  @upd_button
end

Instance Method Details

#createObject



60
61
62
63
# File 'lib/files/main_window.rb', line 60

def create
  super
  show(PLACEMENT_SCREEN)
end

#set_table_headers(arr) ⇒ Object



65
66
67
68
69
70
71
# File 'lib/files/main_window.rb', line 65

def set_table_headers(arr)
  self.table.setColumnText(0, "")

  arr.each_with_index { |value, index|
    self.table.setColumnText(index+1, value)
  }
end