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(_frame, _controller) ⇒ AgEditorOutlineToolbar

Returns a new instance of AgEditorOutlineToolbar.



700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
# File 'ext/ae-editor/ae-editor.rb', line 700

def initialize(_frame, _controller)
  @controller = _controller
  @cb_sync = TkCheckButton.new(_frame, Arcadia.style('checkbox')){
    text  'Sync'
    justify  'left'
    indicatoron 0
    offrelief 'raised'
    image TkPhotoImage.new('dat' => SYNCICON20_GIF)
    place('x' => 0,'y' => 0,'height' => 26, 'width' => 26)
  }
  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
  }
  @sync = false
  @cb_sync.command(do_check)
end

Instance Attribute Details

#syncObject

Returns the value of attribute sync.



699
700
701
# File 'ext/ae-editor/ae-editor.rb', line 699

def sync
  @sync
end

Instance Method Details

#is_sync_on?Boolean

Returns:

  • (Boolean)


736
737
738
# File 'ext/ae-editor/ae-editor.rb', line 736

def is_sync_on?
  @sync
end

#sync_offObject



732
733
734
# File 'ext/ae-editor/ae-editor.rb', line 732

def sync_off
  @sync = false
end

#sync_onObject



724
725
726
727
728
729
730
# File 'ext/ae-editor/ae-editor.rb', line 724

def sync_on
  @sync = true
  e = @controller.raised
  if e
    e.outline.select_without_event(e.outline.last_row) if e.outline.last_row
  end
end