Displaying 2 results from an estimated 2 matches for "width_char".
2007 Apr 30
0
[999] branches/wxruby2/wxwidgets_282/samples/caret/caret.rb: Use paint() instead of ClientDC.new() in caret sample
...+107,17 @@
</span><span class="cx"> end
</span><span class="cx">
</span><span class="cx"> def create_caret
</span><del>- dc = ClientDC.new(self)
- dc.set_font(@font)
- @height_char = dc.get_char_height
- @width_char = dc.get_char_width
</del><ins>+ paint do | dc |
+ dc.set_font(@font)
+ @height_char = dc.get_char_height
+ @width_char = dc.get_char_width
</ins><span class="cx">
</span><del>- caret = Caret.new(self, Size.new(@width_char, @height...
2007 Apr 29
0
[981] branches/wxruby2/wxwidgets_282/samples/caret/caret.rb: Don''t call PaintDC.new; just refresh() instead of duplicating paint code
...caret] = ch.chr
</span><del>-
- caret = get_caret
- if caret
- caret.hide
- end
-
- dc = ClientDC.new(self)
- dc.set_font(@font)
- dc.set_background_mode(SOLID) # overwrite old value
- dc.draw_text(ch.chr, @x_margin + @x_caret * @width_char,
- @y_margin + @y_caret * @height_char )
</del><ins>+ refresh
</ins><span class="cx"> next_char
</span><del>- if caret
- caret.show
- end
</del><span class="cx"> else...