Displaying 12 results from an estimated 12 matches for "evt_motion".
2008 Mar 31
2
Mouse motion example - help
...t the
mouse motion event does not seem to be captured right. What am I doing
wrong?
Thanks
warrior
# code below
require ''wx''
class MyFrame < Wx::Frame
def initialize
super(nil, -1, "My Frame", :size => [300,300])
@my_panel = Wx::Panel.new(self, -1)
evt_motion(){ |event| on_move(event)}
Wx::StaticText.new(@my_panel, -1, :label => "Pos:", :pos => [10, 12])
@posCtrl = Wx::TextCtrl.new(@my_panel, -1, "",:pos => [40, 10])
show
end
def on_move(event)
@pos = event.get_position
@posCtrl.change_value("#{...
2010 Sep 09
1
Wx::Grid and motion events, bug?
...include Wx
def initialize(parent = nil)
super(parent, title: "Test", size: Size.new(400, 400))
self.background_colour = NULL_COLOUR
StaticText.new(self, label: "") #Dummy
@grid = Grid.new(self, size: Size.new(300, 200))
@grid.create_grid(10, 10)
@grid.evt_motion{|e| p "!"; $stdout.flush}
end
end
class MyApp < Wx::App
include Wx
def on_init
@mainwindow = MyFrame.new
@mainwindow.show
end
end
x = MyApp.new
x.main_loop
- --------------------------------------------------------------
If I hover the mouse above the grid, nothin...
2006 Apr 07
3
Pointer position on keypress event?
...htforward way to tell pointer position (x, y)
upon keypress? In original wxWidgets, wxKeyEvent supports GetX()
and GetY() methods, but wxRuby''s KeyEvent object does not have
one. I also checked with event.methods and event.instance_variables.
Do I need to keep track of pointer position by evt_motion?
--
Taisuke Yamada <tyamadajp@spam.rakugaki.org>, http://rakugaki.org/
2268 E9A2 D4F9 014E F11D 1DF7 DCA3 83BC 78E5 CD3A
Message to my public address may not be handled in a timely manner.
For a direct contact, please use my private address on my namecard.
2004 Jun 22
8
Tracking Mouse motion
Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst_wxPaint.rbw
Type: application/octet-stream
Size: 4446 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20040622/abc8ba85/tst_wxPaint-0001.obj
2005 Jan 22
9
Dragging images across the canvas
...39;'wxruby''
class MyFrame < Wx::Frame
def initialize(title)
super(nil, -1, title,Wx::DEFAULT_POSITION, Wx::Size.new(250,250))
image = Wx::Image.new("sk.png")
@bitmap = Wx::Bitmap.new(image)
@left_dn = false
evt_paint { on_paint }
evt_motion {|event| on_motion(event) }
evt_left_down {|event| @left_dn = true }
evt_left_up {|event| @left_dn = false }
end
def move_region(nx,ny)
ox,oy,w,h = @reg.get_box
@reg.clear
@reg = Wx::Region.new(nx,ny,nx+w,ny+h)
dc = Wx::ClientDC.new(self)
# E...
2007 Jun 25
0
[1067] trunk/wxruby2: Set up event handlers in Ruby rather than by post-processing SWIG output
...MouseEvent,
- Wx::EVT_MIDDLE_DOWN => Wx::MouseEvent,
- Wx::EVT_MIDDLE_UP => Wx::MouseEvent,
- Wx::EVT_MIDDLE_DCLICK => Wx::MouseEvent,
- Wx::EVT_RIGHT_DOWN => Wx::MouseEvent,
- Wx::EVT_RIGHT_UP => Wx::MouseEvent,
- Wx::EVT_RIGHT_DCLICK => Wx::MouseEvent,
- Wx::EVT_MOTION => Wx::MouseEvent,
- Wx::EVT_ENTER_WINDOW => Wx::MouseEvent,
- Wx::EVT_LEAVE_WINDOW => Wx::MouseEvent,
- Wx::EVT_MOUSEWHEEL => Wx::MouseEvent,
- Wx::EVT_SCROLL_THUMBTRACK => Wx::ScrollEvent,
- Wx::EVT_SCROLL_LINEUP => Wx::ScrollEvent,
- Wx::EVT_SCROLL_LINEDOWN =&...
2008 May 14
0
[ wxruby-Patches-20130 ] Event handling performance issues
...ng. Based on my tests I could get a 40% increase in the number of events generated per second.
A little background history:
As I had previously worked with wxPython, I thought that sometimes wxRuby was not responding as fast as it did in wxPython, specially on events that keep being generated like EVT_MOTION and EVT_IDLE.
As a proof of that I wrote a small benchmark script (ruby version attached) using both wxPython and wxRuby. It was not my surprise that on my machine I had wxPython with an average of 97033 events/second and wxRuby with 39435 events/second. The script does not intend to have scientifi...
2007 Jun 26
0
[1086] trunk/wxruby2/lib/wx/classes/evthandler.rb: Restore evt_mouse_events convenience handler, fixing bug in printing sample
...gt;<ins>+ # convenience evt_handler to listen to all mouse events
+ def evt_mouse_events(&block)
+ evt_left_down(&block)
+ evt_left_up(&block)
+ evt_middle_down(&block)
+ evt_middle_up(&block)
+ evt_right_down(&block)
+ evt_right_up(&block)
+ evt_motion(&block)
+ evt_left_dclick(&block)
+ evt_middle_dclick(&block)
+ evt_right_dclick(&block)
+ evt_leave_window(&block)
+ evt_enter_window(&block)
+ evt_mousewheel(&block)
+ end
</ins><span class="cx">
</span><span class=&qu...
2007 Mar 17
0
[886] branches/wxruby2/wxwidgets_282/swig/fixevents.rb: Mouse events fix for Win32 (Artur Kuptel)
...;FUNC_DEF
+static VALUE evt_mouse_events(int argc, VALUE *argv, VALUE self)
+{
+ evt_left_down(argc,argv,self);
+ evt_left_up(argc,argv,self);
+ evt_middle_down(argc,argv,self);
+ evt_middle_up(argc,argv,self);
+ evt_right_down(argc,argv,self);
+ evt_right_up(argc,argv,self);
+ evt_motion(argc,argv,self);
+ evt_left_dclick(argc,argv,self);
+ evt_middle_dclick(argc,argv,self);
+ evt_right_dclick(argc,argv,self);
+ evt_leave_window(argc,argv,self);
+ evt_enter_window(argc,argv,self);
+ return evt_mousewheel(argc,argv,self);
+}
+FUNC_DEF
</ins><span class=&qu...
2007 Apr 29
0
[993] branches/wxruby2/wxwidgets_282/samples/bigdemo/wxScrolledWindow.rbw: Use ClientDC via Window#paint object
...;>@@ -35,11 +35,11 @@
</span><span class="cx"> evt_left_down {|event| on_left_button_event_down(event)}
</span><span class="cx"> evt_left_up {|event| on_left_button_event_up(event)}
</span><span class="cx"> evt_motion {|event| on_left_button_event_motion(event)}
</span><del>- evt_paint {|event| on_paint(event)}
</del><ins>+ evt_paint { on_paint }
</ins><span class="cx"> #evt_mousewheel {|event| on_wheel(event)}
</span><span class="...
2007 May 31
0
[1042] trunk/wxruby2: Overhaul of the event handling WxType->RubyClass mapping to make it
...MouseEvent,
+ Wx::EVT_MIDDLE_DOWN => Wx::MouseEvent,
+ Wx::EVT_MIDDLE_UP => Wx::MouseEvent,
+ Wx::EVT_MIDDLE_DCLICK => Wx::MouseEvent,
+ Wx::EVT_RIGHT_DOWN => Wx::MouseEvent,
+ Wx::EVT_RIGHT_UP => Wx::MouseEvent,
+ Wx::EVT_RIGHT_DCLICK => Wx::MouseEvent,
+ Wx::EVT_MOTION => Wx::MouseEvent,
+ Wx::EVT_ENTER_WINDOW => Wx::MouseEvent,
+ Wx::EVT_LEAVE_WINDOW => Wx::MouseEvent,
+ Wx::EVT_MOUSEWHEEL => Wx::MouseEvent,
+ Wx::EVT_SCROLL_THUMBTRACK => Wx::ScrollEvent,
+ Wx::EVT_SCROLL_LINEUP => Wx::ScrollEvent,
+ Wx::EVT_SCROLL_LINEDOWN =&...
2007 May 29
0
[1035] trunk/wxruby2/swig/classes/EvtHandler.i: Removed a heap of redundant stuff that''s been #if 0''d for a while
...t_middle_up(int argc, VALUE *argv, VALUE self)
-{
- return internal_evt_no_parameters(argc, argv, self, wxEVT_MIDDLE_UP);
-}
-
-static VALUE evt_middle_dclick(int argc, VALUE *argv, VALUE self)
-{
- return internal_evt_no_parameters(argc, argv, self, wxEVT_MIDDLE_DCLICK);
-}
-
-static VALUE evt_motion(int argc, VALUE *argv, VALUE self)
-{
- return internal_evt_no_parameters(argc, argv, self, wxEVT_MOTION);
-}
-
-static VALUE evt_enter_window(int argc, VALUE *argv, VALUE self)
-{
- return internal_evt_no_parameters(argc, argv, self, wxEVT_ENTER_WINDOW);
-}
-
-static VALUE evt_leave_window...