Class: AMS::SketchupObserver
- Inherits:
-
Object
- Object
- AMS::SketchupObserver
- Defined in:
- sketchup_observer.rb
Overview
SWO events are capable of monitoring window events. SWP events are capable of monitoring a making decisions to window events. Returning 1 in SWP event will prevent the event from interacting with SketchUp window procedure; any other return value won't block the event. If more than one observers install SWP events and one of them returns 1, then the event will be prevent, regardless of whether other observers wanted the event to be processed by SketchUp window procedure.
AMS SketchUp Observer allows you to monitor and make decisions to SketchUp window events.
Observer Events (collapse)
-
- (Object) swo_activate
Called whenever the observer is added.
-
- (Object) swo_deactivate
Called whenever the observer is removed.
-
- (Object) swo_error(e)
Triggered whenever there is an error in any observer events, except this one.
Mouse Input Events (collapse)
-
- (Object) swo_on_mouse_enter(x, y)
Called when cursor enters the viewport client area.
-
- (Object) swo_on_mouse_leave(x, y)
Called when cursor leaves the viewport client area.
-
- (Object) swo_on_mouse_move(x, y)
Called when cursor is moved within the viewport client area.
-
- (Fixnum) swp_on_lbutton_double_click(x, y)
Called when left mouse button is double clicked.
-
- (Fixnum) swp_on_lbutton_down(x, y)
Called when left mouse button is clicked.
-
- (Fixnum) swp_on_lbutton_up(x, y)
Called when left mouse button is released.
-
- (Fixnum) swp_on_mbutton_double_click(x, y)
Called when middle mouse button is double clicked.
-
- (Fixnum) swp_on_mbutton_down(x, y)
Called when middle mouse button is clicked.
-
- (Fixnum) swp_on_mbutton_up(x, y)
Called when middle mouse button is released.
-
- (Fixnum) swp_on_mouse_wheel_rotate(x, y, dir)
Called when mouse wheel is rotated.
-
- (Fixnum) swp_on_mouse_wheel_tilt(x, y, dir)
Called when mouse wheel is tilted.
-
- (Fixnum) swp_on_rbutton_down(x, y)
Called when right mouse button is clicked.
-
- (Fixnum) swp_on_rbutton_up(x, y)
Called when right mouse button is released.
-
- (Fixnum) swp_on_xbutton1_double_click(x, y)
Called when X mouse button 1 is double clicked.
-
- (Fixnum) swp_on_xbutton1_down(x, y)
Called when X mouse button 1 is clicked.
-
- (Fixnum) swp_on_xbutton1_up(x, y)
Called when X mouse button 1 is released.
-
- (Fixnum) swp_on_xbutton2_double_click(x, y)
Called when X mouse button 2 is double clicked.
-
- (Fixnum) swp_on_xbutton2_down(x, y)
Called when X mouse button 2 is clicked.
-
- (Fixnum) swp_on_xbutton2_up(x, y)
Called when X mouse button 2 is released.
Keybaord Input Events (collapse)
-
- (Fixnum) swp_on_key_down(vk_name, vk_value, vk_char)
Called when key is pressed.
-
- (Fixnum) swp_on_key_extended(vk_name, vk_value, vk_char)
Called when key is held down.
-
- (Fixnum) swp_on_key_up(vk_name, vk_value, vk_char)
Called when key is released.
SketchUp Window Events (collapse)
-
- (Object) swo_on_blur
Called when main window is deactivated.
-
- (Object) swo_on_caption_changed(text)
Called when main window title text is changed.
-
- (Object) swo_on_enter_menu
Called when the application enters the menu loop.
-
- (Object) swo_on_enter_size_move(x, y, w, h)
Called when main window enters the state of being sized and/or moved.
-
- (Object) swo_on_exit_menu
Called when the application exits the menu loop.
-
- (Object) swo_on_exit_size_move(x, y, w, h)
Called when main window exits the state of being sized and/or moved.
-
- (Object) swo_on_focus
Called when main window is activated.
-
- (Object) swo_on_maximize
Called when main window is maximized.
-
- (Object) swo_on_menu_bar_changed(state)
Called when main window menu bar is set or removed.
-
- (Object) swo_on_minimize
Called when main window is minimized.
-
- (Object) swo_on_quit
Called right before SketchUp window is destroyed.
-
- (Object) swo_on_restore
Called when main window is set to normal placement.
-
- (Object) swo_on_scenes_bar_emptied
Called when scenes bar loses its last page.
-
- (Object) swo_on_scenes_bar_filled
Called when scenes bar gets its first page.
-
- (Object) swo_on_scenes_bar_visibility_changed(state)
Called when scenes bar is shown or hidden.
-
- (Object) swo_on_size_move(x, y, w, h)
Called when main window is being sized and/or moved.
-
- (Object) swo_on_status_bar_visibility_changed(state)
Called when status bar is shown or hidden.
-
- (Object) swo_on_switch_full_screen(state)
Called when main window full screen state is changed.
-
- (Object) swo_on_toolbar_container_emptied(bar)
Called when toolbar container is emptied.
-
- (Object) swo_on_toolbar_container_filled(bar)
Called when toolbar container is filled.
-
- (Object) swo_on_toolbar_container_visibility_changed(bar, state)
Called when toolbar container is shown or hidden.
-
- (Object) swo_on_viewport_border_changed(state)
Called when view border, a thin edge surrounding the view, is set or removed.
-
- (Object) swo_on_viewport_paint
Called when the view window is redrawn.
-
- (Object) swo_on_viewport_size(w, h)
Called when the view window is sized.
-
- (Fixnum) swp_on_command(id)
Called when SketchUp window procedure comes across the WM_COMMAND message.
Instance Method Details
- (Object) swo_activate
Called whenever the observer is added.
51 52 |
# File 'sketchup_observer.rb', line 51 def swo_activate end |
- (Object) swo_deactivate
Called whenever the observer is removed.
56 57 |
# File 'sketchup_observer.rb', line 56 def swo_deactivate end |
- (Object) swo_error(e)
An error will not force the observer to deactivate. If you want the observer to deactivate on error, then this is the event to be implemented.
If this event is not implemented, by default, the error will be outputted in console.
If there is an error in this event, the error message will be outputted in console.
Triggered whenever there is an error in any observer events, except this one.
69 70 |
# File 'sketchup_observer.rb', line 69 def swo_error(e) end |
- (Object) swo_on_blur
Called when main window is deactivated.
321 322 |
# File 'sketchup_observer.rb', line 321 def swo_on_blur end |
- (Object) swo_on_caption_changed(text)
Called when main window title text is changed.
350 351 |
# File 'sketchup_observer.rb', line 350 def swo_on_caption_changed(text) end |
- (Object) swo_on_enter_menu
Called when the application enters the menu loop.
284 285 |
# File 'sketchup_observer.rb', line 284 def end |
- (Object) swo_on_enter_size_move(x, y, w, h)
Called when main window enters the state of being sized and/or moved.
332 333 |
# File 'sketchup_observer.rb', line 332 def swo_on_enter_size_move(x,y, w,h) end |
- (Object) swo_on_exit_menu
Called when the application exits the menu loop.
289 290 |
# File 'sketchup_observer.rb', line 289 def end |
- (Object) swo_on_exit_size_move(x, y, w, h)
Called when main window exits the state of being sized and/or moved.
344 345 |
# File 'sketchup_observer.rb', line 344 def swo_on_exit_size_move(x,y, w,h) end |
- (Object) swo_on_focus
Called when main window is activated.
316 317 |
# File 'sketchup_observer.rb', line 316 def swo_on_focus end |
- (Object) swo_on_maximize
Called when main window is maximized.
301 302 |
# File 'sketchup_observer.rb', line 301 def swo_on_maximize end |
- (Object) swo_on_menu_bar_changed(state)
Called when main window menu bar is set or removed.
357 358 |
# File 'sketchup_observer.rb', line 357 def (state) end |
- (Object) swo_on_minimize
Called when main window is minimized.
306 307 |
# File 'sketchup_observer.rb', line 306 def swo_on_minimize end |
- (Object) swo_on_mouse_enter(x, y)
Called when cursor enters the viewport client area.
213 214 |
# File 'sketchup_observer.rb', line 213 def swo_on_mouse_enter(x,y) end |
- (Object) swo_on_mouse_leave(x, y)
Called when cursor leaves the viewport client area.
219 220 |
# File 'sketchup_observer.rb', line 219 def swo_on_mouse_leave(x,y) end |
- (Object) swo_on_mouse_move(x, y)
Called when cursor is moved within the viewport client area.
225 226 |
# File 'sketchup_observer.rb', line 225 def swo_on_mouse_move(x,y) end |
- (Object) swo_on_quit
Called right before SketchUp window is destroyed.
279 280 |
# File 'sketchup_observer.rb', line 279 def swo_on_quit end |
- (Object) swo_on_restore
Called when main window is set to normal placement.
311 312 |
# File 'sketchup_observer.rb', line 311 def swo_on_restore end |
- (Object) swo_on_scenes_bar_emptied
Called when scenes bar loses its last page.
394 395 |
# File 'sketchup_observer.rb', line 394 def end |
- (Object) swo_on_scenes_bar_filled
Called when scenes bar gets its first page.
389 390 |
# File 'sketchup_observer.rb', line 389 def end |
- (Object) swo_on_scenes_bar_visibility_changed(state)
Called when scenes bar is shown or hidden.
384 385 |
# File 'sketchup_observer.rb', line 384 def (state) end |
- (Object) swo_on_size_move(x, y, w, h)
Called when main window is being sized and/or moved.
338 339 |
# File 'sketchup_observer.rb', line 338 def swo_on_size_move(x,y, w,h) end |
- (Object) swo_on_status_bar_visibility_changed(state)
Called when status bar is shown or hidden.
401 402 |
# File 'sketchup_observer.rb', line 401 def (state) end |
- (Object) swo_on_switch_full_screen(state)
Called when main window full screen state is changed.
296 297 |
# File 'sketchup_observer.rb', line 296 def swo_on_switch_full_screen(state) end |
- (Object) swo_on_toolbar_container_emptied(bar)
Called when toolbar container is emptied.
421 422 |
# File 'sketchup_observer.rb', line 421 def () end |
- (Object) swo_on_toolbar_container_filled(bar)
Called when toolbar container is filled.
415 416 |
# File 'sketchup_observer.rb', line 415 def () end |
- (Object) swo_on_toolbar_container_visibility_changed(bar, state)
Called when toolbar container is shown or hidden.
409 410 |
# File 'sketchup_observer.rb', line 409 def (, state) end |
- (Object) swo_on_viewport_border_changed(state)
Called when view border, a thin edge surrounding the view, is set or removed.
377 378 |
# File 'sketchup_observer.rb', line 377 def (state) end |
- (Object) swo_on_viewport_paint
Called when the view window is redrawn.
362 363 |
# File 'sketchup_observer.rb', line 362 def end |
- (Object) swo_on_viewport_size(w, h)
Called when the view window is sized.
369 370 |
# File 'sketchup_observer.rb', line 369 def (w,h) end |
- (Fixnum) swp_on_command(id)
Called when SketchUp window procedure comes across the WM_COMMAND message.
This event responds to Sketchup.send_action, as it too,
generates WM_COMMAND messages.
274 275 |
# File 'sketchup_observer.rb', line 274 def swp_on_command(id) end |
- (Fixnum) swp_on_key_down(vk_name, vk_value, vk_char)
Called when key is pressed.
239 240 |
# File 'sketchup_observer.rb', line 239 def swp_on_key_down(vk_name, vk_value, vk_char) end |
- (Fixnum) swp_on_key_extended(vk_name, vk_value, vk_char)
Called when key is held down.
250 251 |
# File 'sketchup_observer.rb', line 250 def swp_on_key_extended(vk_name, vk_value, vk_char) end |
- (Fixnum) swp_on_key_up(vk_name, vk_value, vk_char)
Called when key is released.
261 262 |
# File 'sketchup_observer.rb', line 261 def swp_on_key_up(vk_name, vk_value, vk_char) end |
- (Fixnum) swp_on_lbutton_double_click(x, y)
Called when left mouse button is double clicked.
98 99 |
# File 'sketchup_observer.rb', line 98 def (x,y) end |
- (Fixnum) swp_on_lbutton_down(x, y)
Called when left mouse button is clicked.
84 85 |
# File 'sketchup_observer.rb', line 84 def (x,y) end |
- (Fixnum) swp_on_lbutton_up(x, y)
Called when left mouse button is released.
91 92 |
# File 'sketchup_observer.rb', line 91 def (x,y) end |
- (Fixnum) swp_on_mbutton_double_click(x, y)
Called when middle mouse button is double clicked.
119 120 |
# File 'sketchup_observer.rb', line 119 def (x,y) end |
- (Fixnum) swp_on_mbutton_down(x, y)
Called when middle mouse button is clicked.
126 127 |
# File 'sketchup_observer.rb', line 126 def (x,y) end |
- (Fixnum) swp_on_mbutton_up(x, y)
Called when middle mouse button is released.
133 134 |
# File 'sketchup_observer.rb', line 133 def (x,y) end |
- (Fixnum) swp_on_mouse_wheel_rotate(x, y, dir)
Called when mouse wheel is rotated.
195 196 |
# File 'sketchup_observer.rb', line 195 def swp_on_mouse_wheel_rotate(x,y, dir) end |
- (Fixnum) swp_on_mouse_wheel_tilt(x, y, dir)
Called when mouse wheel is tilted.
207 208 |
# File 'sketchup_observer.rb', line 207 def swp_on_mouse_wheel_tilt(x,y, dir) end |
- (Fixnum) swp_on_rbutton_down(x, y)
Called when right mouse button is clicked.
105 106 |
# File 'sketchup_observer.rb', line 105 def (x,y) end |
- (Fixnum) swp_on_rbutton_up(x, y)
Called when right mouse button is released.
112 113 |
# File 'sketchup_observer.rb', line 112 def (x,y) end |
- (Fixnum) swp_on_xbutton1_double_click(x, y)
Called when X mouse button 1 is double clicked.
161 162 |
# File 'sketchup_observer.rb', line 161 def (x,y) end |
- (Fixnum) swp_on_xbutton1_down(x, y)
Called when X mouse button 1 is clicked.
147 148 |
# File 'sketchup_observer.rb', line 147 def (x,y) end |
- (Fixnum) swp_on_xbutton1_up(x, y)
Called when X mouse button 1 is released.
154 155 |
# File 'sketchup_observer.rb', line 154 def (x,y) end |
- (Fixnum) swp_on_xbutton2_double_click(x, y)
Called when X mouse button 2 is double clicked.
182 183 |
# File 'sketchup_observer.rb', line 182 def (x,y) end |
- (Fixnum) swp_on_xbutton2_down(x, y)
Called when X mouse button 2 is clicked.
168 169 |
# File 'sketchup_observer.rb', line 168 def (x,y) end |
- (Fixnum) swp_on_xbutton2_up(x, y)
Called when X mouse button 2 is released.
175 176 |
# File 'sketchup_observer.rb', line 175 def (x,y) end |