Class: FloatFrameWrapper
- Inherits:
-
AbstractFrameWrapper
- Object
- AbstractFrameWrapper
- FloatFrameWrapper
- Defined in:
- lib/a-commons.rb
Instance Method Summary collapse
- #float_frame_forge ⇒ Object
- #free ⇒ Object
- #hide ⇒ Object
- #hinner_frame ⇒ Object
-
#initialize(_arcadia, _geometry = nil, _title = nil) ⇒ FloatFrameWrapper
constructor
include AbstractFrameWrapper.
- #show ⇒ Object
- #title(_title = nil) ⇒ Object
Constructor Details
#initialize(_arcadia, _geometry = nil, _title = nil) ⇒ FloatFrameWrapper
include AbstractFrameWrapper
145 146 147 148 149 150 |
# File 'lib/a-commons.rb', line 145 def initialize(_arcadia, _geometry=nil, _title=nil) @arcadia = _arcadia @geometry = _geometry @title= _title float_frame_forge end |
Instance Method Details
#float_frame_forge ⇒ Object
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/a-commons.rb', line 152 def float_frame_forge if @obj.nil? a = @geometry.scan(/[+-]*\d\d*%*/) p_height = TkWinfo.screenheight(@arcadia.layout.root) p_width = TkWinfo.screenwidth(@arcadia.layout.root) if a[0][-1..-1]=='%' n = a[0][0..-2].to_i.abs a[0] = (p_width/100*n).to_i end if a[1][-1..-1]=='%' n = a[1][0..-2].to_i.abs a[1] = (p_height/100*n).to_i end if a[2][-1..-1]=='%' n = a[2][0..-2].to_i.abs a[2] = (p_width/100*n).to_i end if a[3][-1..-1]=='%' n = a[3][0..-2].to_i.abs a[3] = (p_height/100*n).to_i end args = {'width'=>a[0], 'height'=>a[1], 'x'=>a[2], 'y'=>a[3]} @obj = @arcadia.layout.new_float_frame(args) @obj.title(@title) if @title end end |
#free ⇒ Object
200 201 202 203 |
# File 'lib/a-commons.rb', line 200 def free @obj.destroy if @obj @obj = nil end |
#hide ⇒ Object
195 196 197 198 |
# File 'lib/a-commons.rb', line 195 def hide float_frame_forge @obj.hide if @obj end |
#hinner_frame ⇒ Object
180 181 182 183 |
# File 'lib/a-commons.rb', line 180 def hinner_frame float_frame_forge @obj.frame if @obj end |
#show ⇒ Object
190 191 192 193 |
# File 'lib/a-commons.rb', line 190 def show float_frame_forge @obj.show if @obj end |
#title(_title = nil) ⇒ Object
185 186 187 188 |
# File 'lib/a-commons.rb', line 185 def title(_title=nil) float_frame_forge @obj.title(_title) if @obj end |