Class: AgEditorOutlineToolbar

Inherits:
Object
  • Object
show all
Defined in:
ext/ae-editor/ae-editor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_controller) ⇒ AgEditorOutlineToolbar

Returns a new instance of AgEditorOutlineToolbar.



817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
# File 'ext/ae-editor/ae-editor.rb', line 817

def initialize(_controller)
  @controller = _controller
  @panel = @controller.main_instance.frame(1).root.add_panel(@controller.main_instance.frame(1).name, "sync");
  @cb_sync = TkCheckButton.new(@panel, Arcadia.style('checkbox').update('background'=>@panel.background)){
    text  'Sync'
    justify  'left'
    indicatoron 0
    offrelief 'flat'
    image Arcadia.image_res(SYNC_GIF)
    pack
  }        
  Tk::BWidget::DynamicHelp::add(@cb_sync, 
    'text'=>'Link open editors with content in the Navigator')

  do_check = proc {
    if @cb_sync.cget('onvalue')==@cb_sync.cget('variable').value.to_i
      sync_on
    else
      sync_off
    end
    #Arcadia.console(self, "msg"=>"@sync=#{@sync}" )

  }
  @sync = false
  @cb_sync.command(do_check)
end

Instance Attribute Details

#syncObject

Returns the value of attribute sync.



816
817
818
# File 'ext/ae-editor/ae-editor.rb', line 816

def sync
  @sync
end

Instance Method Details

#is_sync_on?Boolean

Returns:

  • (Boolean)


857
858
859
# File 'ext/ae-editor/ae-editor.rb', line 857

def is_sync_on?
  @sync
end

#sync_offObject



853
854
855
# File 'ext/ae-editor/ae-editor.rb', line 853

def sync_off
  @sync = false
end

#sync_onObject



844
845
846
847
848
849
850
851
# File 'ext/ae-editor/ae-editor.rb', line 844

def sync_on
  @sync = true
  e = @controller.active_instance.raised
  if e
    #Arcadia.console(self, "msg"=>"@sync=#{@sync} file=#{e.file}" )
    e.outline.select_without_event(e.outline.last_row) if e.outline.last_row
  end
end