Class: Wx::Overlay
- Inherits:
-
Object
- Object
- Wx::Overlay
- Defined in:
- lib/wx/doc/gen/dc_overlay.rb
Overview
This class is untracked and should not be derived from nor instances extended!
Creates an overlay over an existing window, allowing for manipulations like rubber-banding, etc.
Overlay is implemented internally as a native window shown on top of the window it is used with and it is more efficient to keep the Overlay object around instead of recreating it every time it’s needed, i.e. typically you would have a member variable of type Overlay in your window class. The overlay is initialized automatically when it is used by DCOverlay or OverlayDC but has to be cleared manually, using its #reset function, when its contents shouldn’t be shown any longer. Use of this class is shown in the Drawing Sample where pressing the left mouse button and dragging the mouse creates a rubber band effect using Overlay.
Instance Method Summary collapse
- #initialize ⇒ Wx::Overlay constructor
-
#reset ⇒ void
Clears the overlay without restoring the former state.
-
#set_opacity(alpha) ⇒ void
(also: #opacity=)
Sets or unsets constant opacity of the overlay window.
Constructor Details
Instance Method Details
#reset ⇒ void
This method returns an undefined value.
Clears the overlay without restoring the former state.
To be done, for example, when the window content has been changed and repainted.
47 |
# File 'lib/wx/doc/gen/dc_overlay.rb', line 47 def reset; end |
#set_opacity(alpha) ⇒ void Also known as: opacity=
This method returns an undefined value.
Sets or unsets constant opacity of the overlay window.
If alpha is -1
, use per-pixel alpha blending, otherwise use the given alpha value for all pixels.
Drawing on the overlay window is opaque by default under WXMSW. You have to call SetOpacity(-1) before initializing the overlay and use a graphics context to do the actual drawing if you want per-pixel alpha blending. Or, assuming that SetOpacity(-1) wasn't called, explicitly set the alpha value (at any time) to change the overlay window's opacity.
This is currently only implemented for WXMSW and does nothing in the other ports.
66 |
# File 'lib/wx/doc/gen/dc_overlay.rb', line 66 def set_opacity(alpha) end |