Programming Reference:DisplayWindow Class
- 1 Location
- 2 Synopsis
- 3 Methods
- 3.1 DisplayWindow()
- 3.2 ~DisplayWindow()
- 3.3 Show()
- 3.4 Hide()
- 3.5 DeleteObjects()
- 3.6 Invalidate()
- 3.7 InvalidateRect(GUI::Rect)
- 3.8 Update()
- 3.9 GUI::Rect NormalizedToPixelCoordinates(GUI::Rect)
- 3.10 GUI::Rect PixelToNormalizedCoordinates(GUI::Rect)
- 3.11 Paint(RegionHandle=NULL)
- 3.12 Change()
- 3.13 Click(int x, int y)
- 3.14 QueueOfGraphObjects ObjectsClicked()
- 3.15 ClearClicks()
- 3.16 BitmapImage BitmapData(width=0, height=0)
- 4 Properties
- 5 See also
DisplayWindow is a GraphDisplay descendant representing a frameless GUI window.
Typically, a BCI2000 application module uses a DisplayWindow to implement its user display.
Initializes to an empty window.
In addition to disposing of the window itself, the destructor deletes all GraphObjects that are present inside the window.
Makes the window visible. Initially, the window is created invisible.
Hides the window.
Removes and deletes all GraphObject instances contained in the GraphDisplay.
Marks the entire GraphDisplay area for repainting.
Marks a rectangle within the GraphDisplay for repainting. The rectangle is given in screen pixel coordinates.
NOTE: The use of pixel coordinates has been introduced in rev 3599 to avoid artifacts from converting forth and back between normalized and pixel coordinates. Originally, the rectangle was specified in normalized coordinates.
Forces an immediate repaint of all invalidated areas in the GraphDisplay, making sure that changes in GraphObject state are reflected in the device's frame buffer. In BCI2000 application modules, this function should be called immediately before setting the StimulusTime time stamp.
These functions are used to convert between pixel/device coordinates, and normalized coordinates. Note that, from application code, GraphObjects are positioned and sized using normalized coordinates relative to the GraphDisplay's screen rectangle; in their OnPaint handlers, they are provided with pixel coordinates.
Triggers a repaint of the GraphDisplay's contents. When a region handle is specified, it is used as a clip during the paint operation, saving redraw of the entire GraphDisplay area when only a subregion has become invalid.
Triggers a Change event for all GraphObjects that are part of the display. For modifications in size or draw context, this function is called automatically.
Click(int x, int y)
Triggers a Click event for all GraphObjects that are part of the display. Unlike GraphObject::OnClick(), coordinates are pixel coordinates.
When the user clicks inside a GraphDisplay, all objects' Click events are called to determine which of them were below the mouse pointer when clicking. Objects that consider themselves clicked are added to a queue, which is of type std::queue<GraphObject*>. This queue is accessible from the ObjectsClicked function; from the queue, clicked objects may be retrieved using its pop() member function.
Empties the queue of clicked objects.
BitmapImage BitmapData(width=0, height=0)
Returns the display's content, resampled to the specified target resolution, as a BitmapImage. When both width and height are 0 (the default), the image is returned in its original size, and no resampling takes place.
bool Visible (r)
True when the window is visible, false otherwise. Use the Hide() and Show() methods to change this property.
string Title (rw)
The title of the window, as displayed in its title bar, or in the task bar.
int Left, Top, Width, Height (rw)
The window's position and size, in screen coordinates.
RGBColor Color (rw)
The DisplayWindow's background color.
GUI::DrawContext Context (rw)
The draw context into which a GraphDisplay is supposed to render the GraphObjects it contains. Although this property is write-exposed in the GraphDisplay interface inherited by DisplayWindow, it is managed by the class itself, and should not be modified from client code.