container.h File Reference

Functions for adding widgets to containers. More...

#include "ntw.h"

Go to the source code of this file.

Functions

int ntw_grid_add_defaults (ntwWidget *parent, ntwWidget *widget, uint16 left, uint16 right, uint16 top, uint16 bottom)
 Add a widget to a grid container with default parameters.
int ntw_grid_add (ntwWidget *container, ntwWidget *widget, uint16 left, uint16 right, uint16 top, uint16 bottom, uint8 xflags, uint8 yflags, uint8 xpad, uint8 ypad)
 Add a widget to a grid container.
int ntw_split_pane_add (ntwWidget *container, ntwWidget *widget, uint8 location)
 Add a widget to a split_pane container.
int ntw_container_add (ntwWidget *container, ntwWidget *widget)
 Add a widget to a container.


Detailed Description

Functions for adding widgets to containers.


Function Documentation

int ntw_container_add ntwWidget *  container,
ntwWidget *  widget
 

Add a widget to a container.

This is used for all containers except grids and split panes. For a grid, use either ntw_grid_add() or ntw_grid_add_defaults(). For a split_pane container, use ntw_split_pane_add().

Parameters:
container Container widget
widget Child widget

int ntw_grid_add ntwWidget *  container,
ntwWidget *  widget,
uint16  left,
uint16  right,
uint16  top,
uint16  bottom,
uint8  xflags,
uint8  yflags,
uint8  xpad,
uint8  ypad
 

Add a widget to a grid container.

A widget may cover multiple grid cells by specifying coordinates greater than one cell apart. (i.e. 0,2,0,2 would cover four cells.)

Parameters:
parent Grid to add to
widget Child widget
left Left coordinate of grid (starts at 0)
right Right coordinate of grid
top Top coordinate of grid (starts at 0)
bottom Bottom coordinate of grid
xflags Flags for horizontal positioning.
yflags Flags for vertical positioning.
  • FLAG_EXPAND - allow widget to grow during container resize
  • FLAG_SHRINK - allow widget to shrink during container resize
  • FLAG_FILL - force widget to completely fill initial container space
xpad Amount of horizontal space between left and right edge of cell and child widget.
xpad Amount of vertical space between top and bottom of cell and child widget.
Returns:
-1 on failure

int ntw_grid_add_defaults ntwWidget *  parent,
ntwWidget *  widget,
uint16  left,
uint16  right,
uint16  top,
uint16  bottom
 

Add a widget to a grid container with default parameters.

The default parameters are FLAG_EXPAND | FLAG_FILL and zero padding.

A widget may cover multiple grid cells by specifying coordinates greater than one cell apart. (i.e. 0,2,0,2 would cover four cells.)

Parameters:
parent Grid to add to
widget Child widget
left Left coordinate of grid (starts at 0)
right Right coordinate of grid
top Top coordinate of grid (starts at 0)
bottom Bottom coordinate of grid
Returns:
-1 on failure

int ntw_split_pane_add ntwWidget *  container,
ntwWidget *  widget,
uint8  location
 

Add a widget to a split_pane container.

Parameters:
container split_pane widget
widget Child widget
location Pane to add widget to:
  • SP_TOP - Add to top of horizontal split pane
  • SP_BOTTOM - Add to bottom of horizontal split pane
  • SP_LEFT - Add to left of vertical split pane
  • SP_RIGHT - Add to right of vertical split pane
Returns:
-1 on failure


Generated on Wed Jun 28 17:00:07 2006 for NTW Server C Library by  doxygen 1.4.6