Class: TkEnumProcType

Inherits:
TkEnumType show all
Defined in:
ext/ae-rad/ae-rad-inspector.rb

Instance Attribute Summary

Attributes inherited from TkTy

#agobj, #labelhost, #prop

Instance Method Summary collapse

Methods inherited from TkEnumType

#bool_to_string, #setpropvalue, #source_to_bool

Constructor Details

#initialize(_host, _family, _agobj, _prop) ⇒ TkEnumProcType

Returns a new instance of TkEnumProcType.



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'ext/ae-rad/ae-rad-inspector.rb', line 184

def initialize(_host,  _family, _agobj, _prop)
  super(_host, _family, _agobj, _prop, true)
  @bProp = TkButton.new(@propobj.e, Arcadia.style('toolbarbutton')){
    text  '...'
    #relief  'flat'
    anchor  'e'
    padx  0
    pady  0
    #activebackground background
    #activeforeground 'red'
    #borderwidth 1
    pack('side' => 'right','fill' => 'y')
  }
  do_proc_update = proc{
    _pr = @prop['type'].procReturn
    $arcadia['objic.action.raise_active_obj'].call
    @etextvalue = _pr if _pr != ''
    @agobj.update_property(self, _family, @prop['name'], @etextvalue)
    @propobj.configure('text'=>@etextvalue)
  }
  @propobj.e.bind("Double-1", do_proc_update)
  @bProp.bind("ButtonRelease-1", do_proc_update)
end

Instance Method Details

#do_updateObject



208
209
210
211
212
213
# File 'ext/ae-rad/ae-rad-inspector.rb', line 208

def do_update
  if @etextvalue != @propobj.cget('text')
    @etextvalue = @propobj.cget('text')
    @agobj.update_property(self, @family, @prop['name'], @etextvalue)
  end
end

#free(_updatehost = true, _text = nil) ⇒ Object



215
216
217
218
# File 'ext/ae-rad/ae-rad-inspector.rb', line 215

def free(_updatehost=true, _text=nil)
  do_update if (defined? @propobj)&&(@propobj != nil)
  super
end