Class: AMS::SketchupObserver Abstract
- Inherits:
-
Object
- Object
- AMS::SketchupObserver
- Defined in:
- Documentation/ams/sketchup_observer.rb
Overview
SWO events are capable of monitoring window events. SWP, in addition to monitoring, are also capable making decisions to the window events. Returning 1 for an SWP event will prevent the event from reaching the 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, the event will be blocked, regardless of whether other observers wanted the event to be processed by the SketchUp window procedure.
An observer can be a class, a module, or a class instance. Your observer will work as long as the callback methods are public.
Including all observer methods into your class is not necessary. You may include/elude those as you wish.
Windows only!
SketchUpObserver allows monitoring and making decisions to the input events and messages reaching the SketchUp window procedure.
Observer Events collapse
-
#swo_activate ⇒ Object
Called whenever this observer is added.
-
#swo_deactivate ⇒ Object
Called whenever this observer is removed.
-
#swo_error(e) ⇒ Object
Triggered whenever there is an error in any of the observer methods, with exception to this, particular observer method.
Mouse Input Events collapse
-
#swo_on_mouse_enter(x, y) ⇒ Object
Called when cursor enters the viewport client area.
-
#swo_on_mouse_leave(x, y) ⇒ Object
Called when cursor leaves the viewport client area.
-
#swo_on_mouse_move(x, y) ⇒ Object
Called when cursor is moved within the viewport client area.
-
#swp_on_lbutton_double_click(x, y) ⇒ Fixnum
Called when left mouse button is double clicked.
-
#swp_on_lbutton_down(x, y) ⇒ Fixnum
Called when left mouse button is clicked.
-
#swp_on_lbutton_up(x, y) ⇒ Fixnum
Called when left mouse button is released.
-
#swp_on_mbutton_double_click(x, y) ⇒ Fixnum
Called when middle mouse button is double clicked.
-
#swp_on_mbutton_down(x, y) ⇒ Fixnum
Called when middle mouse button is clicked.
-
#swp_on_mbutton_up(x, y) ⇒ Fixnum
Called when middle mouse button is released.
-
#swp_on_mouse_wheel_rotate(x, y, dir) ⇒ Fixnum
Called when mouse wheel is rotated.
-
#swp_on_mouse_wheel_tilt(x, y, dir) ⇒ Fixnum
Called when mouse wheel is tilted.
-
#swp_on_rbutton_down(x, y) ⇒ Fixnum
Called when right mouse button is clicked.
-
#swp_on_rbutton_up(x, y) ⇒ Fixnum
Called when right mouse button is released.
-
#swp_on_xbutton1_double_click(x, y) ⇒ Fixnum
Called when X mouse button 1 is double clicked.
-
#swp_on_xbutton1_down(x, y) ⇒ Fixnum
Called when X mouse button 1 is clicked.
-
#swp_on_xbutton1_up(x, y) ⇒ Fixnum
Called when X mouse button 1 is released.
-
#swp_on_xbutton2_double_click(x, y) ⇒ Fixnum
Called when X mouse button 2 is double clicked.
-
#swp_on_xbutton2_down(x, y) ⇒ Fixnum
Called when X mouse button 2 is clicked.
-
#swp_on_xbutton2_up(x, y) ⇒ Fixnum
Called when X mouse button 2 is released.
Keybaord Input Events collapse
-
#swp_on_key_down(vk_name, vk_value, vk_char) ⇒ Fixnum
Called when key is pressed.
-
#swp_on_key_extended(vk_name, vk_value, vk_char) ⇒ Fixnum
Called when key is held down.
-
#swp_on_key_up(vk_name, vk_value, vk_char) ⇒ Fixnum
Called when key is released.
SketchUp Window Events collapse
-
#swo_on_blur ⇒ Object
Called when main window is deactivated.
-
#swo_on_caption_changed(text) ⇒ Object
Called when main window title text is changed.
-
#swo_on_enter_menu ⇒ Object
Called when application enters the menu loop.
-
#swo_on_enter_size_move(x, y, w, h) ⇒ Object
Called when main window enters the state of being sized and/or moved.
-
#swo_on_exit_menu ⇒ Object
Called when application exits the menu loop.
-
#swo_on_exit_size_move(x, y, w, h) ⇒ Object
Called when main window exits the state of being sized and/or moved.
-
#swo_on_focus ⇒ Object
Called when main window is activated.
-
#swo_on_maximize ⇒ Object
Called when main window is maximized.
-
#swo_on_menu_bar_changed(state) ⇒ Object
Called when main window menu bar is set or removed.
-
#swo_on_minimize ⇒ Object
Called when main window is minimized.
-
#swo_on_page_selected(page1, page2, tab_index1, tab_index2) ⇒ Object
Called when a scenes page is selected.
-
#swo_on_quit ⇒ Object
Called right before SketchUp window is destroyed.
-
#swo_on_restore ⇒ Object
Called when main window is set to normal placement.
-
#swo_on_scenes_bar_emptied ⇒ Object
Called when scenes bar loses its last page.
-
#swo_on_scenes_bar_filled ⇒ Object
Called when scenes bar gets its first page.
-
#swo_on_scenes_bar_visibility_changed(state) ⇒ Object
Called when scenes bar is shown or hidden.
-
#swo_on_size_move(x, y, w, h) ⇒ Object
Called when main window is being sized and/or moved.
-
#swo_on_status_bar_visibility_changed(state) ⇒ Object
Called when status bar is shown or hidden.
-
#swo_on_switch_full_screen(state) ⇒ Object
Called when main window is switched to/from full screen mode.
-
#swo_on_toolbar_container_emptied(bar) ⇒ Object
Called when toolbar container is emptied.
-
#swo_on_toolbar_container_filled(bar) ⇒ Object
Called when toolbar container is filled.
-
#swo_on_toolbar_container_visibility_changed(bar, state) ⇒ Object
Called when toolbar container is shown or hidden.
-
#swo_on_user_message(sender_handle, id, user_data) ⇒ Object
Called when a user-sent message is received.
-
#swo_on_viewport_border_changed(state) ⇒ Object
Called when view border, a thin edge surrounding the view, is set or removed.
-
#swo_on_viewport_paint ⇒ Object
Called when the view window is redrawn.
-
#swo_on_viewport_size(w, h) ⇒ Object
Called when the view window is sized.
-
#swp_on_command(id) ⇒ Fixnum
Called when SketchUp window procedure comes across the WM_COMMAND message.
-
#swp_on_page_selected(page1, page2, tab_index1, tab_index2) ⇒ Fixnum
Called when a scenes page is selected.
SketchUp Window Post Events collapse
-
#swo_on_post_blur ⇒ Object
Called after main window is deactivated.
-
#swo_on_post_caption_changed(text) ⇒ Object
Called after main window title text is changed.
-
#swo_on_post_enter_menu ⇒ Object
Called after application enters the menu loop.
-
#swo_on_post_enter_size_move(x, y, w, h) ⇒ Object
Called after main window enters the state of being sized and/or moved.
-
#swo_on_post_exit_menu ⇒ Object
Called after application exits the menu loop.
-
#swo_on_post_exit_size_move(x, y, w, h) ⇒ Object
Called after main window exits the state of being sized and/or moved.
-
#swo_on_post_focus ⇒ Object
Called after main window is activated.
-
#swo_on_post_maximize ⇒ Object
Called after main window is maximized.
-
#swo_on_post_menu_bar_changed(state) ⇒ Object
Called after main window menu bar is set or removed.
-
#swo_on_post_minimize ⇒ Object
Called after main window is minimized.
-
#swo_on_post_restore ⇒ Object
Called after main window is set to normal placement.
-
#swo_on_post_scenes_bar_emptied ⇒ Object
Called after scenes bar loses its last page.
-
#swo_on_post_scenes_bar_filled ⇒ Object
Called after scenes bar gets its first page.
-
#swo_on_post_scenes_bar_visibility_changed(state) ⇒ Object
Called after scenes bar is shown or hidden.
-
#swo_on_post_size_move(x, y, w, h) ⇒ Object
Called after main window is being sized and/or moved.
-
#swo_on_post_status_bar_visibility_changed(state) ⇒ Object
Called after status bar is shown or hidden.
-
#swo_on_post_switch_full_screen(state) ⇒ Object
Called after main window is switched to/from full screen mode.
-
#swo_on_post_toolbar_container_emptied(bar) ⇒ Object
Called after toolbar container is emptied.
-
#swo_on_post_toolbar_container_filled(bar) ⇒ Object
Called after toolbar container is filled.
-
#swo_on_post_toolbar_container_visibility_changed(bar, state) ⇒ Object
Called after toolbar container is shown or hidden.
-
#swo_on_post_viewport_border_changed(state) ⇒ Object
Called after view border, a thin edge surrounding the view, is set or removed.
-
#swo_on_post_viewport_paint ⇒ Object
Called after the view window is redrawn.
-
#swo_on_post_viewport_size(w, h) ⇒ Object
Called after the view window is sized.
Instance Method Details
#swo_activate ⇒ Object
Called whenever this observer is added.
#swo_deactivate ⇒ Object
Called whenever this observer is removed.
#swo_error(e) ⇒ Object
An error will not force the observer to deactivate. If you want the observer to deactivate on error, then this is the observer method implement.
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 of the observer methods, with exception to this, particular observer method.
#swo_on_blur ⇒ Object
Called when main window is deactivated.
#swo_on_caption_changed(text) ⇒ Object
Called when main window title text is changed.
#swo_on_enter_menu ⇒ Object
Called when application enters the menu loop.
#swo_on_enter_size_move(x, y, w, h) ⇒ Object
Called when main window enters the state of being sized and/or moved.
#swo_on_exit_menu ⇒ Object
Called when application exits the menu loop.
#swo_on_exit_size_move(x, y, w, h) ⇒ Object
Called when main window exits the state of being sized and/or moved.
#swo_on_focus ⇒ Object
Called when main window is activated.
#swo_on_maximize ⇒ Object
Called when main window is maximized.
#swo_on_menu_bar_changed(state) ⇒ Object
Called when main window menu bar is set or removed.
#swo_on_minimize ⇒ Object
Called when main window is minimized.
#swo_on_mouse_enter(x, y) ⇒ Object
Called when cursor enters the viewport client area.
#swo_on_mouse_leave(x, y) ⇒ Object
Called when cursor leaves the viewport client area.
#swo_on_mouse_move(x, y) ⇒ Object
Called when cursor is moved within the viewport client area.
#swo_on_page_selected(page1, page2, tab_index1, tab_index2) ⇒ Object
Two additional parameters, tab_index1
and
tab_index2
, were added in 3.5.0.
Called when a scenes page is selected.
#swo_on_post_blur ⇒ Object
Called after main window is deactivated.
#swo_on_post_caption_changed(text) ⇒ Object
Called after main window title text is changed.
#swo_on_post_enter_menu ⇒ Object
Called after application enters the menu loop.
#swo_on_post_enter_size_move(x, y, w, h) ⇒ Object
Called after main window enters the state of being sized and/or moved.
#swo_on_post_exit_menu ⇒ Object
Called after application exits the menu loop.
#swo_on_post_exit_size_move(x, y, w, h) ⇒ Object
Called after main window exits the state of being sized and/or moved.
#swo_on_post_focus ⇒ Object
Called after main window is activated.
#swo_on_post_maximize ⇒ Object
Called after main window is maximized.
#swo_on_post_menu_bar_changed(state) ⇒ Object
Called after main window menu bar is set or removed.
#swo_on_post_minimize ⇒ Object
Called after main window is minimized.
#swo_on_post_restore ⇒ Object
Called after main window is set to normal placement.
#swo_on_post_scenes_bar_emptied ⇒ Object
Called after scenes bar loses its last page.
#swo_on_post_scenes_bar_filled ⇒ Object
Called after scenes bar gets its first page.
#swo_on_post_scenes_bar_visibility_changed(state) ⇒ Object
Called after scenes bar is shown or hidden.
#swo_on_post_size_move(x, y, w, h) ⇒ Object
Called after main window is being sized and/or moved.
#swo_on_post_status_bar_visibility_changed(state) ⇒ Object
Called after status bar is shown or hidden.
#swo_on_post_switch_full_screen(state) ⇒ Object
Called after main window is switched to/from full screen mode.
#swo_on_post_toolbar_container_emptied(bar) ⇒ Object
Called after toolbar container is emptied.
#swo_on_post_toolbar_container_filled(bar) ⇒ Object
Called after toolbar container is filled.
#swo_on_post_toolbar_container_visibility_changed(bar, state) ⇒ Object
Called after toolbar container is shown or hidden.
#swo_on_post_viewport_border_changed(state) ⇒ Object
Called after view border, a thin edge surrounding the view, is set or removed.
#swo_on_post_viewport_paint ⇒ Object
Called after the view window is redrawn.
#swo_on_post_viewport_size(w, h) ⇒ Object
Called after the view window is sized.
#swo_on_quit ⇒ Object
Called right before SketchUp window is destroyed.
#swo_on_restore ⇒ Object
Called when main window is set to normal placement.
#swo_on_scenes_bar_emptied ⇒ Object
Called when scenes bar loses its last page.
#swo_on_scenes_bar_filled ⇒ Object
Called when scenes bar gets its first page.
#swo_on_scenes_bar_visibility_changed(state) ⇒ Object
Called when scenes bar is shown or hidden.
#swo_on_size_move(x, y, w, h) ⇒ Object
Called when main window is being sized and/or moved.
#swo_on_status_bar_visibility_changed(state) ⇒ Object
Called when status bar is shown or hidden.
#swo_on_switch_full_screen(state) ⇒ Object
Called when main window is switched to/from full screen mode.
#swo_on_toolbar_container_emptied(bar) ⇒ Object
Called when toolbar container is emptied.
#swo_on_toolbar_container_filled(bar) ⇒ Object
Called when toolbar container is filled.
#swo_on_toolbar_container_visibility_changed(bar, state) ⇒ Object
Called when toolbar container is shown or hidden.
#swo_on_user_message(sender_handle, id, user_data) ⇒ Object
Called when a user-sent message is received.
#swo_on_viewport_border_changed(state) ⇒ Object
Called when view border, a thin edge surrounding the view, is set or removed.
#swo_on_viewport_paint ⇒ Object
Called when the view window is redrawn.
#swo_on_viewport_size(w, h) ⇒ Object
Called when the view window is sized.
#swp_on_command(id) ⇒ Fixnum
Since version 3.1.0, this event no longer triggers on 24214 command.
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. This event is usually called when a tool is
activated.
#swp_on_key_down(vk_name, vk_value, vk_char) ⇒ Fixnum
Called when key is pressed.
#swp_on_key_extended(vk_name, vk_value, vk_char) ⇒ Fixnum
Called when key is held down.
#swp_on_key_up(vk_name, vk_value, vk_char) ⇒ Fixnum
Called when key is released.
#swp_on_lbutton_double_click(x, y) ⇒ Fixnum
Called when left mouse button is double clicked.
#swp_on_lbutton_down(x, y) ⇒ Fixnum
Called when left mouse button is clicked.
#swp_on_lbutton_up(x, y) ⇒ Fixnum
Called when left mouse button is released.
#swp_on_mbutton_double_click(x, y) ⇒ Fixnum
Called when middle mouse button is double clicked.
#swp_on_mbutton_down(x, y) ⇒ Fixnum
Called when middle mouse button is clicked.
#swp_on_mbutton_up(x, y) ⇒ Fixnum
Called when middle mouse button is released.
#swp_on_mouse_wheel_rotate(x, y, dir) ⇒ Fixnum
Called when mouse wheel is rotated.
#swp_on_mouse_wheel_tilt(x, y, dir) ⇒ Fixnum
Called when mouse wheel is tilted.
#swp_on_page_selected(page1, page2, tab_index1, tab_index2) ⇒ Fixnum
Unlike the swo_on_page_selected
, this callback function allows
preventing the activation of a page and is triggered only when the page is
activated via selecting it from the scenes bar. Activating a page in any
other way, through the API for instance, will not trigger this event.
This event is useful for creating custom scene transitions.
Called when a scenes page is selected.
#swp_on_rbutton_down(x, y) ⇒ Fixnum
Called when right mouse button is clicked.
#swp_on_rbutton_up(x, y) ⇒ Fixnum
Called when right mouse button is released.
#swp_on_xbutton1_double_click(x, y) ⇒ Fixnum
Called when X mouse button 1 is double clicked.
#swp_on_xbutton1_down(x, y) ⇒ Fixnum
Called when X mouse button 1 is clicked.
#swp_on_xbutton1_up(x, y) ⇒ Fixnum
Called when X mouse button 1 is released.
#swp_on_xbutton2_double_click(x, y) ⇒ Fixnum
Called when X mouse button 2 is double clicked.
#swp_on_xbutton2_down(x, y) ⇒ Fixnum
Called when X mouse button 2 is clicked.
#swp_on_xbutton2_up(x, y) ⇒ Fixnum
Called when X mouse button 2 is released.