Class: AGBWidgetComboBox

Inherits:
AGTkBase show all
Defined in:
ext/ae-rad/lib/tkext/al-bwidget.rb

Instance Attribute Summary

Attributes inherited from AGTk

#canvas, #l_manager, #x0, #x3, #y0, #y3

Attributes inherited from AG

#ag_parent, #i_ag, #i_name, #obj, #obj_class, #persistent, #props, #props_def, #props_kinds, #renderer, #sniffer, #sons

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AGTkLayoutManaged

#start_properties

Methods inherited from AGTk

#activate, #active_move_tab, class_renderer, class_sniffer, #contains_events, #delete, #getFileName, #has_events, #popup, #popup_items, #update_property

Methods inherited from AG

#activate, active, #add_require, #build_sons, class_renderer, class_sniffer, #defaults, #defaults_values, #del_require, #delete, #fill_defaults_value_from_agobj, #getControlClassName, #getFileName, #getInstanceClass, #getObjClass, #getViewClassName, #get_implementation_block, #get_implementation_code, #get_implementation_new, #get_path_i_name, #has_sons, near_class_wrapped, near_class_wrapper, #new_id, #passed_object, #publish, #publish_def, #publish_del, #publish_mod, publish_property, #register, #retrive_values, #select, #start_properties, #update_property

Constructor Details

#initialize(_ag_parent = nil, _object = nil) ⇒ AGBWidgetComboBox

Returns a new instance of AGBWidgetComboBox.



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'ext/ae-rad/lib/tkext/al-bwidget.rb', line 28

def initialize(_ag_parent = nil, _object = nil)
  super(_ag_parent, _object)
  ppress = proc{@l_manager.deactivate;@obj.callback_break}
  prelease = proc{@l_manager.activate;@obj.callback_break}
  @obj.e.bind("ButtonPress-1", proc{|e| 
      @l_manager.place_manager.do_press_obj(e.x, e.y)
      @obj.callback_break
    }
  )
  @obj.e.bind_append("ButtonPress-1", ppress)
  @obj.e.bind("ButtonRelease-1", prelease)
  @obj.e.bind("B1-Motion", proc{|x, y| @l_manager.place_manager.do_mov_obj(x,y); @obj.callback_break},"%x %y")
end

Class Method Details

.bObject



56
57
58
# File 'ext/ae-rad/lib/tkext/al-bwidget.rb', line 56

def @obj.b
  TkWinfo.children(self)[1]
end

.class_wrappedObject



42
43
44
# File 'ext/ae-rad/lib/tkext/al-bwidget.rb', line 42

def AGBWidgetComboBox.class_wrapped
  Tk::BWidget::ComboBox
end

.eObject



52
53
54
# File 'ext/ae-rad/lib/tkext/al-bwidget.rb', line 52

def @obj.e
  TkWinfo.children(self)[0]
end

Instance Method Details

#initobjObject



51
52
53
54
55
56
57
58
59
60
# File 'ext/ae-rad/lib/tkext/al-bwidget.rb', line 51

def  initobj
  def @obj.e
    TkWinfo.children(self)[0]
  end

  def @obj.b
    TkWinfo.children(self)[1]
  end

end

#new_objectObject



46
47
48
49
# File 'ext/ae-rad/lib/tkext/al-bwidget.rb', line 46

def new_object
  super
  initobj
end

#passedobject(_obj) ⇒ Object



62
63
64
65
# File 'ext/ae-rad/lib/tkext/al-bwidget.rb', line 62

def passedobject(_obj)
  super
  initobj
end

#propertiesObject



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'ext/ae-rad/lib/tkext/al-bwidget.rb', line 67

def properties
  super()

  publish_mod('place','name'=>'width',
    'get'=> proc{if TkWinfo.mapped?(@obj)
        TkWinfo.width(@obj.e)+ TkWinfo.width(@obj.b)
      else
        TkWinfo.reqwidth(@obj.e)+ TkWinfo.reqwidth(@obj.b)
      end
    }
  )

  publish_mod('place','name'=>'height',
      'get'=> proc{ if TkWinfo.mapped?(@obj)
        TkWinfo.height(@obj)
      else
        TkWinfo.reqheight(@obj.b)
      end
    }
  )

  publish('property','name'=>'entry-background',
    'get'=> proc{@obj.e.cget('background')},
    'set'=> proc{|background| @obj.e.configure('background'=>background)},
    'def'=> proc{|x| "TkWinfo.children(self)[0].configure('background'=>#{x})"},
    'type'=> TkType::TkagColor
  )
  publish('property','name'=>'button-background',
    'get'=> proc{@obj.b.cget('background')},
    'set'=> proc{|background| @obj.b.configure('background'=>background)},
    'def'=> proc{|x| "TkWinfo.children(self)[1].configure('background'=>#{x})"},
    'type'=> TkType::TkagColor
  )
  publish('property','name'=>'values',
    'get'=> proc{@obj.cget('values')},
    'set'=> proc{|v| @obj.configure('values'=>v)},
    'def'=> ""
  )
end