[Fxruby-commits] CVS: FXRuby/examples scribble.rb,1.16,1.17
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <ly...@us...> - 2002-03-26 13:32:47
|
Update of /cvsroot/fxruby/FXRuby/examples In directory usw-pr-cvs1:/tmp/cvs-serv10827 Modified Files: scribble.rb Log Message: Added a "mirroring" mode for the scribble example, using patches from Guaracy Monteiro (gua...@ig...). Index: scribble.rb =================================================================== RCS file: /cvsroot/fxruby/FXRuby/examples/scribble.rb,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** scribble.rb 13 Mar 2002 21:59:19 -0000 1.16 --- scribble.rb 26 Mar 2002 13:32:44 -0000 1.17 *************** *** 51,54 **** --- 51,64 ---- # Draw a line from the previous mouse coordinates to the current ones + if @mirrorMode.value + cW = @canvas.width + cH = @canvas.height + dc.drawLine(cW-event.last_x, event.last_y, + cW-event.win_x, event.win_y) + dc.drawLine(event.last_x, cH-event.last_y, + event.win_x, cH-event.win_y) + dc.drawLine(cW-event.last_x, cH-event.last_y, + cW-event.win_x, cH-event.win_y) + end dc.drawLine(event.last_x, event.last_y, event.win_x, event.win_y) *************** *** 95,98 **** --- 105,112 ---- FXHorizontalSeparator.new(@buttonFrame, SEPARATOR_RIDGE|LAYOUT_FILL_X) + + # Enable or disable mirror mode + @mirrorMode = FXDataTarget.new(false) + FXCheckButton.new(@buttonFrame, "Mirror", @mirrorMode, FXDataTarget::ID_VALUE, CHECKBUTTON_NORMAL|LAYOUT_FILL_X) # Button to clear the canvas |