Class: TkMenuTitledFrame

Inherits:
TkTitledFrame show all
Defined in:
lib/a-tkcommons.rb

Direct Known Subclasses

TkTitledFrameAdapter

Instance Attribute Summary

Attributes inherited from TkTitledFrame

#frame, #parent, #top

Attributes inherited from TkBaseTitledFrame

#frame, #top

Instance Method Summary collapse

Methods inherited from TkTitledFrame

#__create_right_label, #create_right_label, #head_buttons, #initialize, #last_caption, #last_caption_image, #maximize, #maximized?, #resize, #restore_caption, #save_caption, #top_text, #top_text_bind_append, #top_text_bind_remove, #top_text_clear, #top_text_hide, #top_text_hint

Methods inherited from TkBaseTitledFrame

#add_fixed_button, #add_fixed_menu_button, #add_fixed_panel, #add_fixed_sep, #create_frame, #head_buttons, #initialize, #menu_button, #visible?

Constructor Details

This class inherits a constructor from TkTitledFrame

Instance Method Details

#__create_left_menu_button(_frame) ⇒ Object



1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
# File 'lib/a-tkcommons.rb', line 1217

def __create_left_menu_button(_frame)
  img=@img
  @left_menu_button = TkMenuButton.new(_frame, Arcadia.style('titlebutton')){|mb|
    menu TkMenu.new(mb, Arcadia.style('titlemenu'))
    if img
      indicatoron false
      image Arcadia.image_res(img)
    else
      indicatoron true
    end
    padx 0
    textvariable TkVariable.new('')
    pack('side'=> 'left','anchor'=> 'e')
  }

end

#create_left_titleObject



1208
1209
1210
1211
# File 'lib/a-tkcommons.rb', line 1208

def create_left_title
  @left_menu_button = __create_left_menu_button(@top)
  @left_menu_button.bind_append("Double-Button-1", proc{resize})
end

#shift_offObject



1238
1239
1240
# File 'lib/a-tkcommons.rb', line 1238

def shift_off
  @left_menu_button.foreground(Arcadia.conf('titlelabel.disabledforeground'))
end

#shift_onObject



1234
1235
1236
# File 'lib/a-tkcommons.rb', line 1234

def shift_on
  @left_menu_button.foreground(Arcadia.conf('titlelabel.foreground'))
end

#title(_text = nil) ⇒ Object



1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
# File 'lib/a-tkcommons.rb', line 1242

def title(_text=nil)
  if _text.nil?
    return @title
  else
    @title=_text
    if _text.strip.length == 0
      @left_menu_button.textvariable.value=''
    else
      @left_menu_button.textvariable.value=_text+'::'
    end
  end
end

#title_menuObject



1213
1214
1215
# File 'lib/a-tkcommons.rb', line 1213

def title_menu
  @left_menu_button.cget('menu') if @left_menu_button
end