Class: QTkScrollbar

Inherits:
TkScrollbar
  • Object
show all
Defined in:
ext/ae-rad/lib/tk/al-tk.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent = nil, keys = nil, &b) ⇒ QTkScrollbar

Returns a new instance of QTkScrollbar.



1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
# File 'ext/ae-rad/lib/tk/al-tk.rb', line 1080

def initialize(parent=nil, keys=nil,&b)
  @strin = ''
  if keys
    @strin = keys.to_s
  end
  if block_given?
    @strin = @strin + b.to_s
  end
  super
  ArcadiaLibs.copy_wrapper_of_class_to_class(TkScrollbar, QTkScrollbar)
end

Instance Method Details

#block(_i, _str) ⇒ Object



1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
# File 'ext/ae-rad/lib/tk/al-tk.rb', line 1109

def block(_i, _str)
  _nline = 0
  _strwrk = ''
  _str.each{|line|
    _nline = _nline + 1
    if _nline >= _i
      _strwrk = _strwrk + line
    end
  }

  m = /\{(.*)\}/m.match(_strwrk)
  if m && m[1]
    return m[1]
  else
    ' ma! '
  end

end

#classObject



1092
1093
1094
# File 'ext/ae-rad/lib/tk/al-tk.rb', line 1092

def class
  TkScrollbar
end

#command_scriptObject



1128
1129
1130
# File 'ext/ae-rad/lib/tk/al-tk.rb', line 1128

def command_script
  block(wrapline(@strin), $arcadia['code'])
end

#wrapline(_str) ⇒ Object



1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
# File 'ext/ae-rad/lib/tk/al-tk.rb', line 1096

def wrapline(_str)
  if _str
    m = /@\(eval\)\:([0123456789]*)/.match(_str)
    if m && m[1]
      return m[1].to_i
    else
      -1
    end
  else
    -1
  end
end