Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Frame widget

Frame widget provides a frame with border and a title bar.

It can be configured to be resizable and movable.

Typedefs

typedef bool(* wtk_frame_handler_t )(struct wtk_frame *frame, win_command_t command_data)
 Frame command event handler callback. More...
 

Functions

struct win_windowwtk_frame_as_child (struct wtk_frame *frame)
 This function returns a reference to the window that should be used when managing the widget, such as move, resize, destroy and reparenting. More...
 
struct win_windowwtk_frame_as_parent (struct wtk_frame *frame)
 This function returns a reference to the window that should be used as a parent for child widgets and windows. More...
 
struct wtk_framewtk_frame_create (struct win_window *parent, struct win_area const *area, char const *caption, bool allow_resize, wtk_frame_handler_t frame_handler, void *custom_data)
 This function creates a new frame widget. More...
 
void * wtk_frame_get_custom_data (struct wtk_frame const *frame)
 This function returns the custom data from the frame's attributes. More...
 
#define WTK_FRAME_LEFTBORDER   2
 Left frame border size. More...
 
#define WTK_FRAME_RIGHTBORDER   2
 Right frame border size. More...
 
#define WTK_FRAME_TOPBORDER   2
 Top frame border size. More...
 
#define WTK_FRAME_BOTTOMBORDER   4
 Bottom frame border size. More...
 
#define WTK_FRAME_RESIZE_RADIUS   7
 Radius of resize handle (second quadrant of circle). More...
 
#define WTK_FRAME_RESIZE_WIDTH   (WTK_FRAME_RESIZE_RADIUS + 1)
 Width of resize handle. More...
 
#define WTK_FRAME_RESIZE_HEIGHT   (WTK_FRAME_RESIZE_RADIUS + 1)
 Height of resize handle. More...
 
#define WTK_FRAME_MIN_WIDTH   (WTK_FRAME_RESIZE_WIDTH - WTK_FRAME_RIGHTBORDER)
 Minimum width of contents window of a frame. More...
 
#define WTK_FRAME_MIN_HEIGHT   (WTK_FRAME_RESIZE_HEIGHT - WTK_FRAME_BOTTOMBORDER)
 Minimum height of contents window of a frame. More...
 
#define WTK_FRAME_TITLEBAR_HEIGHT   9
 Height of titlebar area. More...
 
#define WTK_FRAME_CAPTION_X   3
 Caption text X offset inside title bar. More...
 
#define WTK_FRAME_CAPTION_Y   1
 Caption text Y offset inside title bar. More...
 
#define WTK_FRAME_BACKGROUND_COLOR   GFX_COLOR_GRAY
 Background color of frame contents window. More...
 
#define WTK_FRAME_BORDER_COLOR   GFX_COLOR(240, 240, 240)
 Frame border color. More...
 
#define WTK_FRAME_TITLEBAR_COLOR   GFX_COLOR(128, 128, 255)
 Background color of frame title bar. More...
 
#define WTK_FRAME_CAPTION_COLOR   GFX_COLOR_WHITE
 Caption text foreground color. More...
 
#define WTK_FRAME_RESIZE_COLOR   GFX_COLOR(64, 192, 192)
 Resize handle color. More...
 
#define WTK_DRAG_THRESHOLD   4
 Distance from origin before dragging operation kicks in. More...
 
#define WTK_DRAG_HANDLE_RADIUS   4
 Radius of drag origin and target handles. More...
 
#define WTK_DRAG_PIXMAP_SIZE   (WTK_DRAG_HANDLE_RADIUS * 2 + 1)
 Pixmap pixel count for storing drag handle background graphics. More...
 
#define WTK_DRAG_ORIGIN_COLOR   GFX_COLOR_RED
 Drag origin handle color. More...
 
#define WTK_DRAG_TARGET_COLOR   GFX_COLOR_GREEN
 Drag target handle color. More...
 
#define WTK_FRAME_LEFTBORDER   2
 Left frame border size. More...
 
#define WTK_FRAME_RIGHTBORDER   2
 Right frame border size. More...
 
#define WTK_FRAME_TOPBORDER   2
 Top frame border size. More...
 
#define WTK_FRAME_BOTTOMBORDER   4
 Bottom frame border size. More...
 
#define WTK_FRAME_RESIZE_RADIUS   7
 Radius of resize handle (second quadrant of circle). More...
 
#define WTK_FRAME_RESIZE_WIDTH   (WTK_FRAME_RESIZE_RADIUS + 1)
 Width of resize handle. More...
 
#define WTK_FRAME_RESIZE_HEIGHT   (WTK_FRAME_RESIZE_RADIUS + 1)
 Height of resize handle. More...
 
#define WTK_FRAME_MIN_WIDTH   (WTK_FRAME_RESIZE_WIDTH - WTK_FRAME_RIGHTBORDER)
 Minimum width of contents window of a frame. More...
 
#define WTK_FRAME_MIN_HEIGHT   (WTK_FRAME_RESIZE_HEIGHT - WTK_FRAME_BOTTOMBORDER)
 Minimum height of contents window of a frame. More...
 
#define WTK_FRAME_TITLEBAR_HEIGHT   9
 Height of titlebar area. More...
 
#define WTK_FRAME_CAPTION_X   3
 Caption text X offset inside title bar. More...
 
#define WTK_FRAME_CAPTION_Y   1
 Caption text Y offset inside title bar. More...
 
#define WTK_FRAME_BACKGROUND_COLOR   GFX_COLOR_GRAY
 Background color of frame contents window. More...
 
#define WTK_FRAME_BORDER_COLOR   GFX_COLOR(240, 240, 240)
 Frame border color. More...
 
#define WTK_FRAME_TITLEBAR_COLOR   GFX_COLOR(128, 128, 255)
 Background color of frame title bar. More...
 
#define WTK_FRAME_CAPTION_COLOR   GFX_COLOR_WHITE
 Caption text foreground color. More...
 
#define WTK_FRAME_RESIZE_COLOR   GFX_COLOR(64, 192, 192)
 Resize handle color. More...
 
#define WTK_DRAG_THRESHOLD   4
 Distance from origin before dragging operation kicks in. More...
 
#define WTK_DRAG_HANDLE_RADIUS   4
 Radius of drag origin and target handles. More...
 
#define WTK_DRAG_PIXMAP_SIZE   (WTK_DRAG_HANDLE_RADIUS * 2 + 1)
 Pixmap pixel count for storing drag handle background graphics. More...
 
#define WTK_DRAG_ORIGIN_COLOR   GFX_COLOR_RED
 Drag origin handle color. More...
 
#define WTK_DRAG_TARGET_COLOR   GFX_COLOR_GREEN
 Drag target handle color. More...
 
#define WTK_FRAME_LEFTBORDER   2
 Left frame border size. More...
 
#define WTK_FRAME_RIGHTBORDER   2
 Right frame border size. More...
 
#define WTK_FRAME_TOPBORDER   2
 Top frame border size. More...
 
#define WTK_FRAME_BOTTOMBORDER   4
 Bottom frame border size. More...
 
#define WTK_FRAME_RESIZE_RADIUS   7
 Radius of resize handle (second quadrant of circle). More...
 
#define WTK_FRAME_RESIZE_WIDTH   (WTK_FRAME_RESIZE_RADIUS + 1)
 Width of resize handle. More...
 
#define WTK_FRAME_RESIZE_HEIGHT   (WTK_FRAME_RESIZE_RADIUS + 1)
 Height of resize handle. More...
 
#define WTK_FRAME_MIN_WIDTH   (WTK_FRAME_RESIZE_WIDTH - WTK_FRAME_RIGHTBORDER)
 Minimum width of contents window of a frame. More...
 
#define WTK_FRAME_MIN_HEIGHT   (WTK_FRAME_RESIZE_HEIGHT - WTK_FRAME_BOTTOMBORDER)
 Minimum height of contents window of a frame. More...
 
#define WTK_FRAME_TITLEBAR_HEIGHT   9
 Height of titlebar area. More...
 
#define WTK_FRAME_CAPTION_X   3
 Caption text X offset inside title bar. More...
 
#define WTK_FRAME_CAPTION_Y   1
 Caption text Y offset inside title bar. More...
 
#define WTK_FRAME_BACKGROUND_COLOR   GFX_COLOR_GRAY
 Background color of frame contents window. More...
 
#define WTK_FRAME_BORDER_COLOR   GFX_COLOR(240, 240, 240)
 Frame border color. More...
 
#define WTK_FRAME_TITLEBAR_COLOR   GFX_COLOR(128, 128, 255)
 Background color of frame title bar. More...
 
#define WTK_FRAME_CAPTION_COLOR   GFX_COLOR_WHITE
 Caption text foreground color. More...
 
#define WTK_FRAME_RESIZE_COLOR   GFX_COLOR(64, 192, 192)
 Resize handle color. More...
 
#define WTK_DRAG_THRESHOLD   4
 Distance from origin before dragging operation kicks in. More...
 
#define WTK_DRAG_HANDLE_RADIUS   4
 Radius of drag origin and target handles. More...
 
#define WTK_DRAG_PIXMAP_SIZE   (WTK_DRAG_HANDLE_RADIUS * 2 + 1)
 Pixmap pixel count for storing drag handle background graphics. More...
 
#define WTK_DRAG_ORIGIN_COLOR   GFX_COLOR_RED
 Drag origin handle color. More...
 
#define WTK_DRAG_TARGET_COLOR   GFX_COLOR_GREEN
 Drag target handle color. More...
 
#define WTK_FRAME_LEFTBORDER   2
 Left frame border size. More...
 
#define WTK_FRAME_RIGHTBORDER   2
 Right frame border size. More...
 
#define WTK_FRAME_TOPBORDER   2
 Top frame border size. More...
 
#define WTK_FRAME_BOTTOMBORDER   4
 Bottom frame border size. More...
 
#define WTK_FRAME_RESIZE_RADIUS   7
 Radius of resize handle (second quadrant of circle). More...
 
#define WTK_FRAME_RESIZE_WIDTH   (WTK_FRAME_RESIZE_RADIUS + 1)
 Width of resize handle. More...
 
#define WTK_FRAME_RESIZE_HEIGHT   (WTK_FRAME_RESIZE_RADIUS + 1)
 Height of resize handle. More...
 
#define WTK_FRAME_MIN_WIDTH   (WTK_FRAME_RESIZE_WIDTH - WTK_FRAME_RIGHTBORDER)
 Minimum width of contents window of a frame. More...
 
#define WTK_FRAME_MIN_HEIGHT   (WTK_FRAME_RESIZE_HEIGHT - WTK_FRAME_BOTTOMBORDER)
 Minimum height of contents window of a frame. More...
 
#define WTK_FRAME_TITLEBAR_HEIGHT   9
 Height of titlebar area. More...
 
#define WTK_FRAME_CAPTION_X   3
 Caption text X offset inside title bar. More...
 
#define WTK_FRAME_CAPTION_Y   1
 Caption text Y offset inside title bar. More...
 
#define WTK_FRAME_BACKGROUND_COLOR   GFX_COLOR_GRAY
 Background color of frame contents window. More...
 
#define WTK_FRAME_BORDER_COLOR   GFX_COLOR(240, 240, 240)
 Frame border color. More...
 
#define WTK_FRAME_TITLEBAR_COLOR   GFX_COLOR(128, 128, 255)
 Background color of frame title bar. More...
 
#define WTK_FRAME_CAPTION_COLOR   GFX_COLOR_WHITE
 Caption text foreground color. More...
 
#define WTK_FRAME_RESIZE_COLOR   GFX_COLOR(64, 192, 192)
 Resize handle color. More...
 
#define WTK_DRAG_THRESHOLD   4
 Distance from origin before dragging operation kicks in. More...
 
#define WTK_DRAG_HANDLE_RADIUS   4
 Radius of drag origin and target handles. More...
 
#define WTK_DRAG_PIXMAP_SIZE   (WTK_DRAG_HANDLE_RADIUS * 2 + 1)
 Pixmap pixel count for storing drag handle background graphics. More...
 
#define WTK_DRAG_ORIGIN_COLOR   GFX_COLOR_RED
 Drag origin handle color. More...
 
#define WTK_DRAG_TARGET_COLOR   GFX_COLOR_GREEN
 Drag target handle color. More...
 
#define WTK_FRAME_LEFTBORDER   2
 Left frame border size. More...
 
#define WTK_FRAME_RIGHTBORDER   2
 Right frame border size. More...
 
#define WTK_FRAME_TOPBORDER   2
 Top frame border size. More...
 
#define WTK_FRAME_BOTTOMBORDER   4
 Bottom frame border size. More...
 
#define WTK_FRAME_RESIZE_RADIUS   7
 Radius of resize handle (second quadrant of circle). More...
 
#define WTK_FRAME_RESIZE_WIDTH   (WTK_FRAME_RESIZE_RADIUS + 1)
 Width of resize handle. More...
 
#define WTK_FRAME_RESIZE_HEIGHT   (WTK_FRAME_RESIZE_RADIUS + 1)
 Height of resize handle. More...
 
#define WTK_FRAME_MIN_WIDTH   (WTK_FRAME_RESIZE_WIDTH - WTK_FRAME_RIGHTBORDER)
 Minimum width of contents window of a frame. More...
 
#define WTK_FRAME_MIN_HEIGHT   (WTK_FRAME_RESIZE_HEIGHT - WTK_FRAME_BOTTOMBORDER)
 Minimum height of contents window of a frame. More...
 
#define WTK_FRAME_TITLEBAR_HEIGHT   9
 Height of titlebar area. More...
 
#define WTK_FRAME_CAPTION_X   3
 Caption text X offset inside title bar. More...
 
#define WTK_FRAME_CAPTION_Y   1
 Caption text Y offset inside title bar. More...
 
#define WTK_FRAME_BACKGROUND_COLOR   GFX_COLOR_GRAY
 Background color of frame contents window. More...
 
#define WTK_FRAME_BORDER_COLOR   GFX_COLOR(240, 240, 240)
 Frame border color. More...
 
#define WTK_FRAME_TITLEBAR_COLOR   GFX_COLOR(128, 128, 255)
 Background color of frame title bar. More...
 
#define WTK_FRAME_CAPTION_COLOR   GFX_COLOR_WHITE
 Caption text foreground color. More...
 
#define WTK_FRAME_RESIZE_COLOR   GFX_COLOR(64, 192, 192)
 Resize handle color. More...
 
#define WTK_DRAG_THRESHOLD   4
 Distance from origin before dragging operation kicks in. More...
 
#define WTK_DRAG_HANDLE_RADIUS   4
 Radius of drag origin and target handles. More...
 
#define WTK_DRAG_PIXMAP_SIZE   (WTK_DRAG_HANDLE_RADIUS * 2 + 1)
 Pixmap pixel count for storing drag handle background graphics. More...
 
#define WTK_DRAG_ORIGIN_COLOR   GFX_COLOR_RED
 Drag origin handle color. More...
 
#define WTK_DRAG_TARGET_COLOR   GFX_COLOR_GREEN
 Drag target handle color. More...
 
static bool wtk_frame_handler (struct win_window *win, enum win_event_type type, void const *data)
 This function is the window event handler for frame widgets. More...
 

#define WTK_DRAG_HANDLE_RADIUS   4

Radius of drag origin and target handles.

Referenced by wtk_continue_drag(), wtk_start_drag(), and wtk_stop_drag().

#define WTK_DRAG_HANDLE_RADIUS   4

Radius of drag origin and target handles.

#define WTK_DRAG_HANDLE_RADIUS   4

Radius of drag origin and target handles.

#define WTK_DRAG_HANDLE_RADIUS   4

Radius of drag origin and target handles.

#define WTK_DRAG_HANDLE_RADIUS   4

Radius of drag origin and target handles.

#define WTK_DRAG_ORIGIN_COLOR   GFX_COLOR_RED

Drag origin handle color.

#define WTK_DRAG_ORIGIN_COLOR   GFX_COLOR_RED

Drag origin handle color.

#define WTK_DRAG_ORIGIN_COLOR   GFX_COLOR_RED

Drag origin handle color.

#define WTK_DRAG_ORIGIN_COLOR   GFX_COLOR_RED

Drag origin handle color.

Referenced by wtk_start_drag().

#define WTK_DRAG_ORIGIN_COLOR   GFX_COLOR_RED

Drag origin handle color.

#define WTK_DRAG_PIXMAP_SIZE   (WTK_DRAG_HANDLE_RADIUS * 2 + 1)

Pixmap pixel count for storing drag handle background graphics.

#define WTK_DRAG_PIXMAP_SIZE   (WTK_DRAG_HANDLE_RADIUS * 2 + 1)

Pixmap pixel count for storing drag handle background graphics.

#define WTK_DRAG_PIXMAP_SIZE   (WTK_DRAG_HANDLE_RADIUS * 2 + 1)

Pixmap pixel count for storing drag handle background graphics.

#define WTK_DRAG_PIXMAP_SIZE   (WTK_DRAG_HANDLE_RADIUS * 2 + 1)

Pixmap pixel count for storing drag handle background graphics.

Referenced by wtk_continue_drag(), wtk_start_drag(), and wtk_stop_drag().

#define WTK_DRAG_PIXMAP_SIZE   (WTK_DRAG_HANDLE_RADIUS * 2 + 1)

Pixmap pixel count for storing drag handle background graphics.

#define WTK_DRAG_TARGET_COLOR   GFX_COLOR_GREEN

Drag target handle color.

#define WTK_DRAG_TARGET_COLOR   GFX_COLOR_GREEN

Drag target handle color.

#define WTK_DRAG_TARGET_COLOR   GFX_COLOR_GREEN

Drag target handle color.

#define WTK_DRAG_TARGET_COLOR   GFX_COLOR_GREEN

Drag target handle color.

Referenced by wtk_continue_drag(), and wtk_start_drag().

#define WTK_DRAG_TARGET_COLOR   GFX_COLOR_GREEN

Drag target handle color.

#define WTK_DRAG_THRESHOLD   4

Distance from origin before dragging operation kicks in.

#define WTK_DRAG_THRESHOLD   4

Distance from origin before dragging operation kicks in.

#define WTK_DRAG_THRESHOLD   4

Distance from origin before dragging operation kicks in.

#define WTK_DRAG_THRESHOLD   4

Distance from origin before dragging operation kicks in.

Referenced by wtk_is_drag_threshold_exceeded().

#define WTK_DRAG_THRESHOLD   4

Distance from origin before dragging operation kicks in.

#define WTK_FRAME_BACKGROUND_COLOR   GFX_COLOR_GRAY

Background color of frame contents window.

#define WTK_FRAME_BACKGROUND_COLOR   GFX_COLOR_GRAY

Background color of frame contents window.

#define WTK_FRAME_BACKGROUND_COLOR   GFX_COLOR_GRAY

Background color of frame contents window.

#define WTK_FRAME_BACKGROUND_COLOR   GFX_COLOR_GRAY

Background color of frame contents window.

#define WTK_FRAME_BACKGROUND_COLOR   GFX_COLOR_GRAY

Background color of frame contents window.

#define WTK_FRAME_BORDER_COLOR   GFX_COLOR(240, 240, 240)

Frame border color.

#define WTK_FRAME_BORDER_COLOR   GFX_COLOR(240, 240, 240)

Frame border color.

#define WTK_FRAME_BORDER_COLOR   GFX_COLOR(240, 240, 240)

Frame border color.

Referenced by wtk_frame_handler().

#define WTK_FRAME_BORDER_COLOR   GFX_COLOR(240, 240, 240)

Frame border color.

#define WTK_FRAME_BORDER_COLOR   GFX_COLOR(240, 240, 240)

Frame border color.

#define WTK_FRAME_BOTTOMBORDER   4

Bottom frame border size.

#define WTK_FRAME_BOTTOMBORDER   4

Bottom frame border size.

Referenced by wtk_frame_handler(), and wtk_resize_frame().

#define WTK_FRAME_BOTTOMBORDER   4

Bottom frame border size.

#define WTK_FRAME_BOTTOMBORDER   4

Bottom frame border size.

#define WTK_FRAME_BOTTOMBORDER   4

Bottom frame border size.

#define WTK_FRAME_CAPTION_COLOR   GFX_COLOR_WHITE

Caption text foreground color.

#define WTK_FRAME_CAPTION_COLOR   GFX_COLOR_WHITE

Caption text foreground color.

#define WTK_FRAME_CAPTION_COLOR   GFX_COLOR_WHITE

Caption text foreground color.

Referenced by wtk_frame_handler().

#define WTK_FRAME_CAPTION_COLOR   GFX_COLOR_WHITE

Caption text foreground color.

#define WTK_FRAME_CAPTION_COLOR   GFX_COLOR_WHITE

Caption text foreground color.

#define WTK_FRAME_CAPTION_X   3

Caption text X offset inside title bar.

#define WTK_FRAME_CAPTION_X   3

Caption text X offset inside title bar.

#define WTK_FRAME_CAPTION_X   3

Caption text X offset inside title bar.

#define WTK_FRAME_CAPTION_X   3

Caption text X offset inside title bar.

Referenced by wtk_frame_handler().

#define WTK_FRAME_CAPTION_X   3

Caption text X offset inside title bar.

#define WTK_FRAME_CAPTION_Y   1

Caption text Y offset inside title bar.

Referenced by wtk_frame_handler().

#define WTK_FRAME_CAPTION_Y   1

Caption text Y offset inside title bar.

#define WTK_FRAME_CAPTION_Y   1

Caption text Y offset inside title bar.

#define WTK_FRAME_CAPTION_Y   1

Caption text Y offset inside title bar.

#define WTK_FRAME_CAPTION_Y   1

Caption text Y offset inside title bar.

#define WTK_FRAME_LEFTBORDER   2

Left frame border size.

Referenced by wtk_frame_create(), wtk_frame_handler(), and wtk_resize_frame().

#define WTK_FRAME_LEFTBORDER   2

Left frame border size.

#define WTK_FRAME_LEFTBORDER   2

Left frame border size.

#define WTK_FRAME_LEFTBORDER   2

Left frame border size.

#define WTK_FRAME_LEFTBORDER   2

Left frame border size.

#define WTK_FRAME_MIN_HEIGHT   (WTK_FRAME_RESIZE_HEIGHT - WTK_FRAME_BOTTOMBORDER)

Minimum height of contents window of a frame.

#define WTK_FRAME_MIN_HEIGHT   (WTK_FRAME_RESIZE_HEIGHT - WTK_FRAME_BOTTOMBORDER)

Minimum height of contents window of a frame.

#define WTK_FRAME_MIN_HEIGHT   (WTK_FRAME_RESIZE_HEIGHT - WTK_FRAME_BOTTOMBORDER)

Minimum height of contents window of a frame.

#define WTK_FRAME_MIN_HEIGHT   (WTK_FRAME_RESIZE_HEIGHT - WTK_FRAME_BOTTOMBORDER)

Minimum height of contents window of a frame.

Referenced by wtk_resize_frame().

#define WTK_FRAME_MIN_HEIGHT   (WTK_FRAME_RESIZE_HEIGHT - WTK_FRAME_BOTTOMBORDER)

Minimum height of contents window of a frame.

#define WTK_FRAME_MIN_WIDTH   (WTK_FRAME_RESIZE_WIDTH - WTK_FRAME_RIGHTBORDER)

Minimum width of contents window of a frame.

#define WTK_FRAME_MIN_WIDTH   (WTK_FRAME_RESIZE_WIDTH - WTK_FRAME_RIGHTBORDER)

Minimum width of contents window of a frame.

#define WTK_FRAME_MIN_WIDTH   (WTK_FRAME_RESIZE_WIDTH - WTK_FRAME_RIGHTBORDER)

Minimum width of contents window of a frame.

#define WTK_FRAME_MIN_WIDTH   (WTK_FRAME_RESIZE_WIDTH - WTK_FRAME_RIGHTBORDER)

Minimum width of contents window of a frame.

#define WTK_FRAME_MIN_WIDTH   (WTK_FRAME_RESIZE_WIDTH - WTK_FRAME_RIGHTBORDER)

Minimum width of contents window of a frame.

Referenced by wtk_resize_frame().

#define WTK_FRAME_RESIZE_COLOR   GFX_COLOR(64, 192, 192)

Resize handle color.

#define WTK_FRAME_RESIZE_COLOR   GFX_COLOR(64, 192, 192)

Resize handle color.

Referenced by wtk_frame_handler().

#define WTK_FRAME_RESIZE_COLOR   GFX_COLOR(64, 192, 192)

Resize handle color.

#define WTK_FRAME_RESIZE_COLOR   GFX_COLOR(64, 192, 192)

Resize handle color.

#define WTK_FRAME_RESIZE_COLOR   GFX_COLOR(64, 192, 192)

Resize handle color.

#define WTK_FRAME_RESIZE_HEIGHT   (WTK_FRAME_RESIZE_RADIUS + 1)

Height of resize handle.

#define WTK_FRAME_RESIZE_HEIGHT   (WTK_FRAME_RESIZE_RADIUS + 1)

Height of resize handle.

#define WTK_FRAME_RESIZE_HEIGHT   (WTK_FRAME_RESIZE_RADIUS + 1)

Height of resize handle.

Referenced by wtk_frame_create(), and wtk_resize_frame().

#define WTK_FRAME_RESIZE_HEIGHT   (WTK_FRAME_RESIZE_RADIUS + 1)

Height of resize handle.

#define WTK_FRAME_RESIZE_HEIGHT   (WTK_FRAME_RESIZE_RADIUS + 1)

Height of resize handle.

#define WTK_FRAME_RESIZE_RADIUS   7

Radius of resize handle (second quadrant of circle).

#define WTK_FRAME_RESIZE_RADIUS   7

Radius of resize handle (second quadrant of circle).

Referenced by wtk_frame_handler().

#define WTK_FRAME_RESIZE_RADIUS   7

Radius of resize handle (second quadrant of circle).

#define WTK_FRAME_RESIZE_RADIUS   7

Radius of resize handle (second quadrant of circle).

#define WTK_FRAME_RESIZE_RADIUS   7

Radius of resize handle (second quadrant of circle).

#define WTK_FRAME_RESIZE_WIDTH   (WTK_FRAME_RESIZE_RADIUS + 1)

Width of resize handle.

#define WTK_FRAME_RESIZE_WIDTH   (WTK_FRAME_RESIZE_RADIUS + 1)

Width of resize handle.

#define WTK_FRAME_RESIZE_WIDTH   (WTK_FRAME_RESIZE_RADIUS + 1)

Width of resize handle.

Referenced by wtk_frame_create(), and wtk_resize_frame().

#define WTK_FRAME_RESIZE_WIDTH   (WTK_FRAME_RESIZE_RADIUS + 1)

Width of resize handle.

#define WTK_FRAME_RESIZE_WIDTH   (WTK_FRAME_RESIZE_RADIUS + 1)

Width of resize handle.

#define WTK_FRAME_RIGHTBORDER   2

Right frame border size.

Referenced by wtk_frame_handler(), and wtk_resize_frame().

#define WTK_FRAME_RIGHTBORDER   2

Right frame border size.

#define WTK_FRAME_RIGHTBORDER   2

Right frame border size.

#define WTK_FRAME_RIGHTBORDER   2

Right frame border size.

#define WTK_FRAME_RIGHTBORDER   2

Right frame border size.

#define WTK_FRAME_TITLEBAR_COLOR   GFX_COLOR(128, 128, 255)

Background color of frame title bar.

#define WTK_FRAME_TITLEBAR_COLOR   GFX_COLOR(128, 128, 255)

Background color of frame title bar.

#define WTK_FRAME_TITLEBAR_COLOR   GFX_COLOR(128, 128, 255)

Background color of frame title bar.

#define WTK_FRAME_TITLEBAR_COLOR   GFX_COLOR(128, 128, 255)

Background color of frame title bar.

#define WTK_FRAME_TITLEBAR_COLOR   GFX_COLOR(128, 128, 255)

Background color of frame title bar.

Referenced by wtk_frame_handler().

#define WTK_FRAME_TITLEBAR_HEIGHT   9

Height of titlebar area.

#define WTK_FRAME_TITLEBAR_HEIGHT   9

Height of titlebar area.

#define WTK_FRAME_TITLEBAR_HEIGHT   9

Height of titlebar area.

#define WTK_FRAME_TITLEBAR_HEIGHT   9

Height of titlebar area.

Referenced by wtk_frame_create(), wtk_frame_handler(), and wtk_resize_frame().

#define WTK_FRAME_TITLEBAR_HEIGHT   9

Height of titlebar area.

#define WTK_FRAME_TOPBORDER   2

Top frame border size.

#define WTK_FRAME_TOPBORDER   2

Top frame border size.

#define WTK_FRAME_TOPBORDER   2

Top frame border size.

#define WTK_FRAME_TOPBORDER   2

Top frame border size.

#define WTK_FRAME_TOPBORDER   2

Top frame border size.

Referenced by wtk_frame_create(), wtk_frame_handler(), and wtk_resize_frame().

typedef bool(* wtk_frame_handler_t)(struct wtk_frame *frame, win_command_t command_data)

Frame command event handler callback.

struct win_window* wtk_frame_as_child ( struct wtk_frame frame)

This function returns a reference to the window that should be used when managing the widget, such as move, resize, destroy and reparenting.

Parameters
frameFrame widget to manage.
Returns
Window to be used for managing the frame.

References Assert, and wtk_frame::container.

struct win_window* wtk_frame_as_parent ( struct wtk_frame frame)

This function returns a reference to the window that should be used as a parent for child widgets and windows.

This corresponds to the internal area inside borders and title bar.

Parameters
frameFrame widget to be a parent.
Returns
Window to be used as parent for child contents.

References Assert, and wtk_frame::contents.

struct wtk_frame* wtk_frame_create ( struct win_window parent,
struct win_area const *  area,
char const *  caption,
bool  allow_resize,
wtk_frame_handler_t  frame_handler,
void *  custom_data 
)

This function creates a new frame widget.

It allocates required memory and intializes necessary windows to create the widget. If there is not enough memory, the function returns NULL.

To destroy the widget and all its contents, and free its memory, call win_destroy() on the frame's child reference, given by wtk_frame_as_child(), like this: "win_destroy(wtk_frame_as_child(my_frame_ptr));". The frame's internal area will equal the area parameter, but the total extents will be slightly larger, to accommodate for titlebar, borders etc.

Parameters
parentParent window.
areaArea of the internal contents.
captionPointer to caption string. Will be copied into widget.
allow_resizeTrue if resize handle should be included on the frame.
frame_handlerOptional command event handler, for applications.
custom_dataOptional custom data link, for applications.
Returns
Pointer to frame, or NULL if failed.

References win_attributes::area, Assert, win_attributes::background, win_attributes::behavior, wtk_frame::caption, wtk_frame::container, wtk_frame::contents, win_attributes::custom, wtk_frame::custom_data, win_attributes::event_handler, wtk_frame::frame_handler, membag_alloc(), membag_free(), NULL, win_area::pos, wtk_frame::resize, win_area::size, wtk_frame::state, WIN_BEHAVIOR_RAISE_ON_PRESS, win_create(), win_destroy(), win_show(), wtk_copy_string(), wtk_frame_background, wtk_frame_handler(), WTK_FRAME_LEFTBORDER, WTK_FRAME_NORMAL, WTK_FRAME_RESIZE_HEIGHT, WTK_FRAME_RESIZE_WIDTH, WTK_FRAME_TITLEBAR_HEIGHT, WTK_FRAME_TOPBORDER, wtk_resize_frame(), win_point::x, and win_point::y.

void* wtk_frame_get_custom_data ( struct wtk_frame const *  frame)

This function returns the custom data from the frame's attributes.

The custom data can be used for e.g. linking to associated applications.

Parameters
framePointer to frame.
Returns
Copy of the custom data.

References Assert, and wtk_frame::custom_data.