Class: QDA::GUI::MultiFrameWorkArea

Inherits:
Wx::Frame
  • Object
show all
Includes:
InspectorWindowManager
Defined in:
lib/weft/wxgui/workarea.rb

Overview

presentation of main window as a standalone window, launching inspector windows as separate frames

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from InspectorWindowManager

#app, #close_all, #get_open_window, #get_open_windows, #launch_window, #notify, #proportional_size, #remember_layout, #remember_layouts, #remember_size, #restore_layout, #restore_layouts, #restore_size, #set_active_category

Methods included from Subscriber

#notify, #subscribe

Constructor Details

#initialize(weft_client) ⇒ MultiFrameWorkArea

Returns a new instance of MultiFrameWorkArea.



256
257
258
259
260
261
262
263
# File 'lib/weft/wxgui/workarea.rb', line 256

def initialize(weft_client)
  @client = weft_client
  @window_map = {}
  super(nil, -1, "Weft QDA")
  restore_size()
  set_sizer( @sizer = Wx::BoxSizer.new(Wx::VERTICAL) )
  subscribe(@client, :all)
end

Instance Attribute Details

#active_childObject (readonly)

Returns the value of attribute active_child.



254
255
256
# File 'lib/weft/wxgui/workarea.rb', line 254

def active_child
  @active_child
end

#d_and_cObject (readonly)

Returns the value of attribute d_and_c.



254
255
256
# File 'lib/weft/wxgui/workarea.rb', line 254

def d_and_c
  @d_and_c
end

Instance Method Details

#close_d_and_cObject



283
284
285
286
287
# File 'lib/weft/wxgui/workarea.rb', line 283

def close_d_and_c()
  @sizer.remove(@d_and_c)
  @d_and_c.destroy()
  @d_and_c = nil
end

#hide_allObject



289
290
291
292
# File 'lib/weft/wxgui/workarea.rb', line 289

def hide_all()
  @window_map.each { | w | w.hide() }
  self.hide()
end

#hide_d_and_cObject



279
280
281
# File 'lib/weft/wxgui/workarea.rb', line 279

def hide_d_and_c()
  # do nothing
end

#show_d_and_cObject



265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/weft/wxgui/workarea.rb', line 265

def show_d_and_c()
  if not @d_and_c
    @d_and_c ||= DocumentsAndCategories.new(self, @client)
    conf = Wx::ConfigBase::get()
    conf.path = "/SideFrame"
    split = conf.read_int("split", 200)
    # sometimes weirdly ends up with negative value
    split = client_size.height / 2 if split <= 0
    @d_and_c.set_sash_position(split)
    @sizer.add(@d_and_c, 1, Wx::GROW|Wx::ALL, 0)
    @sizer.layout()
  end
end