Index

Package: Windows

Description

package Widgets.Containers.Windows is

Classes

Window

type Window is new Container with private;

Ancestors:

Primitive operations:

Construct
Delete (overriding Widgets.Containers.Delete)
Dispatch_Click
Dispatch_Key_Held
Dispatch_Key_Press
Dispatch_Key_Release
Dispatch_Mouse_Held
Dispatch_Mouse_Move
Dispatch_Mouse_Press
Dispatch_Mouse_Release
Dispatch_Mouse_Release
Dispatch_Mouse_Scroll
Draw (overriding Widgets.Containers.Draw)
Draw_Content (overriding Widgets.Containers.Draw_Content)
Find_Widget (overriding Widgets.Containers.Find_Widget)
Get_Window (overriding Widgets.Get_Window)
Handle_Descendant_Hidden (overriding Widgets.Handle_Descendant_Hidden)
Handle_Descendant_Unhidden (overriding Widgets.Handle_Descendant_Unhidden)
Handle_Key_Press (overriding Widgets.Handle_Key_Press)
Objects.Construct (Inherited)
Pack (overriding Widgets.Containers.Pack)
Translate_To_Content (overriding Widgets.Translate_To_Content)
Translate_To_Window (overriding Widgets.Translate_To_Window)
Widgets.Activate_Popup (Inherited)
Widgets.Bring_To_Front (Inherited)
Widgets.Construct (Inherited)
Widgets.Containers.Add (Inherited)
Widgets.Containers.Apply_Container_Layout (Inherited)
Widgets.Containers.Bring_To_Front (Inherited)
Widgets.Containers.Delete_Child (Inherited)
Widgets.Containers.Delete_Children (Inherited)
Widgets.Containers.Draw_Children (Inherited)
Widgets.Containers.Handle_Ancestor_Hidden (Inherited)
Widgets.Containers.Handle_Ancestor_Unhidden (Inherited)
Widgets.Containers.Handle_Resize (Inherited)
Widgets.Containers.Remove (Inherited)
Widgets.Containers.Set_Zoom (Inherited)
Widgets.Get_Color (Inherited)
Widgets.Get_Min_Height (Inherited)
Widgets.Get_Min_Width (Inherited)
Widgets.Get_Process_Name (Inherited)
Widgets.Get_View (Inherited)
Widgets.Handle_Blur (Inherited)
Widgets.Handle_Click (Inherited)
Widgets.Handle_Disabled (Inherited)
Widgets.Handle_Enabled (Inherited)
Widgets.Handle_Enter (Inherited)
Widgets.Handle_Exit (Inherited)
Widgets.Handle_Focus (Inherited)
Widgets.Handle_Hidden (Inherited)
Widgets.Handle_Key_Held (Inherited)
Widgets.Handle_Key_Release (Inherited)
Widgets.Handle_Mouse_Held (Inherited)
Widgets.Handle_Mouse_Move (Inherited)
Widgets.Handle_Mouse_Press (Inherited)
Widgets.Handle_Mouse_Release (Inherited)
Widgets.Handle_Mouse_Scroll (Inherited)
Widgets.Handle_Unhidden (Inherited)
Widgets.Set_Color (Inherited)
Widgets.Set_Dirty (Inherited)
Widgets.Set_Parent (Inherited)
Widgets.To_String (Inherited)
A Window is the root of the widget tree within the application window. All interface input events are delivered to the Window and then dispatched by the Window to its descendent widgets. Widget events are handled in a bottom-up approach, being delivered to the focused widget first and then dispatching up the tree, toward the Window, until the event is captured and handled. Input focus, or just "focus", is tracked by the Window. Exactly one widget in the Window tree will have focus at all times. If no other widget is focused, the Window will be focused by default. The focused widget will receive all keyboard events.

Types

A_Window

type A_Window is access all Window'Class;

Subprograms & Entries

Create_Window

function Create_Window
( view: access Game_Views.Game_View'Class;
id: String;
width, height: Natural;
scale: Positive := 1;
filter: Filter_Type := Filter_Nearest ) return A_Window;
Creates a new Window within 'view'. 'width' and 'height' are the size of the widget. The window can be upscaled to a higher resolution by setting 'scale' > 1 and the upscale filter effect with 'filter'.

Dispatch_Click

procedure Dispatch_Click
( this: access Window;
evt: not null A_Mouse_Button_Event );
Dispatches a mouse click event to the widget that the mouse clicked on. If the button release occurred over a different widget than the press, then the click will be ignored.

Dispatch_Key_Held

function Dispatch_Key_Held
( this: access Window;
evt: not null A_Key_Event ) return Boolean;
Dispatches a key held event to the focused widget, if the key was pressed after the widget received focus.

Dispatch_Key_Press

function Dispatch_Key_Press
( this: access Window;
evt: not null A_Key_Event ) return Boolean;
Dispatches a key press event to the focused widget.

Dispatch_Key_Release

function Dispatch_Key_Release
( this: access Window;
evt: not null A_Key_Event ) return Boolean;
Dispatches a key release event to the widget that received the key press event, regardless of input focus.

Dispatch_Mouse_Held

procedure Dispatch_Mouse_Held
( this: access Window;
evt: not null A_Mouse_Button_Event );
Dispatches a mouse held event to the widget that the mouse was over at the time the mouse button was pressed.

Dispatch_Mouse_Move

procedure Dispatch_Mouse_Move
( this: access Window;
evt: not null A_Mouse_Event );
Dispatches a mouse move event. If the mouse is over a different widget than last move then widget exit and widget enter events are dispatched appropriately first. If the left mouse button is being held down, a mouse move event is sent to the widget that the mouse was over when the left button was pressed. If the mouse is currently over a widget that isn't the one that the left mouse button was pressed over, then that widget will also receive a mouse move event.

Dispatch_Mouse_Press

procedure Dispatch_Mouse_Press
( this: access Window;
evt: not null A_Mouse_Button_Event );
Dispatches a mouse press event to the widget the mouse is currently over. If a popup widget (or stack of popup widgets) is being displayed, then the popup widgets will be popped off the stack and hidden unless they are under the mouse. This allows context menus, etc, to be hidden when the user clicks somewhere else in the Window. If a modal dialog widget is being displayed, then the press will only be dispatched to descendents of the modal widget.

Dispatch_Mouse_Release

procedure Dispatch_Mouse_Release
( this: access Window;
evt: not null A_Mouse_Button_Event );
Dispatches a mouse release event to the widget the mouse is over.

Dispatch_Mouse_Scroll

function Dispatch_Mouse_Scroll
( this: access Window;
evt: not null A_Mouse_Scroll_Event ) return Boolean;
Dispatches a scroll wheel event to the widget the mouse is over.

Draw

procedure Draw
( this: access Window;
bmp: not null A_Bitmap );
Draws the whole window and all its descendents to 'bmp'. This procedure is used by the renderer to draw the whole screen. The bitmap 'bmp' must be at least (width*scale, height*scale) in size and it can be any kind of bitmap (ie: a system/video bitmap).

Get_Scale

function Get_Scale
( this: not null access Window'Class ) return Positive;
Get the scaling factor used when drawing the Window to the screen. A return value of 1 means no upscaling.

Give_Focus

procedure Give_Focus
( this: access Window;
target: not null A_Widget );
Gives input focus to 'target'. If 'target' doesn't accept focus, then focus will be given to its "next focus" widget (what happens when you press the Tab key). If no "next focus" widget exists or accepts focus, then focus will be given to the widget's nearest ancestor that accepts it. Changing the input focus will prevent any potential key held and key release events from being sent to the old focused widget that received the key press.

Pop_Popup

procedure Pop_Popup
( this: access Window );
Pops the top-most widget off the popup stack. If there are no active popup widgets, nothing will happen.

Pop_Popup

procedure Pop_Popup
( this: access Window;
popup: not null A_Widget );
Pops all widgets from the popups stack until the given popup widget has been popped. If the widget isn't an active popup menu, nothing will happen.

Push_Popup

procedure Push_Popup
( this: access Window;
popup: not null A_Widget );
Pushes a popup widget onto the top of the popup stack, making it visible. Popups are the highest in the Z-order, so they will be displayed in front of any modal widget, most recent on top. The widget will temporarily become a child of the window while its on the popup stack.

Set_Offset

procedure Set_Offset
( this: access Window;
x, y: Integer );
Sets the offset of the top left corner of the window from the top left corner of the screen.

Set_Menubar

procedure Set_Menubar
( this: access Window;
menu: in out A_Menubar );
Sets the Window's menu bar widget. The menu bar is optional and there can be only one per Window. 'menu' will be consumed. If a menu bar has already been set, the old one will be deleted.

Set_Modal

procedure Set_Modal
( this: access Window;
modal: A_Widget );
Sets the modal widget drawn on top of all others in the Window. This widget and its descendents will receive all input events or prevent them from being sent to any others, while it is visible. Set 'modal' to null to clear the modal widget. 'modal' will be set visible when it's set and invisible when another modal widget is set or it's unset. The modal modal widget tree will be drawn in front of all other Window children and behind any active popup widgets.

Set_Title

procedure Set_Title
( this: access Window;
title: String );
Sets the title at the top of the application window.

Delete

procedure Delete
( this: in out A_Window );
Deletes the Window.