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.



775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
# File 'ext/ae-editor/ae-editor.rb', line 775

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'=> Arcadia.text('ext.editor.button.link.hint'))

  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.



774
775
776
# File 'ext/ae-editor/ae-editor.rb', line 774

def sync
  @sync
end

Instance Method Details

#is_sync_on?Boolean

Returns:

  • (Boolean)


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

def is_sync_on?
  @sync
end

#sync_offObject



811
812
813
# File 'ext/ae-editor/ae-editor.rb', line 811

def sync_off
  @sync = false
end

#sync_onObject



802
803
804
805
806
807
808
809
# File 'ext/ae-editor/ae-editor.rb', line 802

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