Atrinik Client 1.0
Functions | Variables
client/dialog.c File Reference
#include <include.h>

Go to the source code of this file.

Functions

void draw_frame (SDL_Surface *surface, int x, int y, int w, int h)
void border_create (SDL_Surface *surface, int x, int y, int w, int h, int color, int size)
void add_close_button (int x, int y, int menu)
int add_button (int x, int y, int id, int gfxNr, char *text, char *text_h)
int add_gr_button (int x, int y, int id, int gfxNr, const char *text, const char *text_h)
void add_value (void *value, int type, int offset, int min, int max)
void draw_tabs (const char *tabs[], int *act_tab, const char *head_text, int x, int y)

Variables

int active_button = -1

Detailed Description

Implements most client dialogs (GUIs).

Definition in file dialog.c.


Function Documentation

int add_button ( int  x,
int  y,
int  id,
int  gfxNr,
char *  text,
char *  text_h 
)

Add a button and handle mouse events over it.

Parameters:
xX position.
yY position.
idButton ID.
gfxNrID of the button bitmap to draw.
textText to draw.
text_hText for keyboard user.
Returns:
1 if the button was pressed, 0 otherwise.

Definition at line 135 of file dialog.c.

void add_close_button ( int  x,
int  y,
int  menu 
)

Add a close button and handle mouse events over it.

Parameters:
xX position.
yY position.
menuMenu the button is on.

Definition at line 104 of file dialog.c.

int add_gr_button ( int  x,
int  y,
int  id,
int  gfxNr,
const char *  text,
const char *  text_h 
)

Add a group button and handle mouse events over it.

Parameters:
xX position.
yY position.
idButton ID.
gfxNrID of the button bitmap to draw.
textText to draw.
text_hText for keyboard user.
Returns:
1 if the button was pressed, 0 otherwise.

Definition at line 191 of file dialog.c.

void add_value ( void *  value,
int  type,
int  offset,
int  min,
int  max 
)

Add offset to an integer value.

Parameters:
valueValue to add to.
typeType of the value.
offsetWhat to add to value.
minMinimum value.
maxMaximum value.

Definition at line 231 of file dialog.c.

void border_create ( SDL_Surface *  surface,
int  x,
int  y,
int  w,
int  h,
int  color,
int  size 
)

Create a border around the specified coordinates.

Parameters:
surfaceSurface to use.
xX start of the border.
yY start of the border.
wMaximum border width.
hMaximum border height.
colorColor to use for the border.
sizeBorder's size.

Definition at line 72 of file dialog.c.

void draw_frame ( SDL_Surface *  surface,
int  x,
int  y,
int  w,
int  h 
)

Draw a single frame.

Parameters:
surfaceSurface to draw on.
xX position.
yY position.
wWidth of the frame.
hHeight of the frame.

Definition at line 41 of file dialog.c.

void draw_tabs ( const char *  tabs[],
int *  act_tab,
const char *  head_text,
int  x,
int  y 
)

Draw tabs on the left side of a window.

Parameters:
tabsThe tabs to draw.
[out]act_tabCurrently active tab.
head_textHeader text, above the tabs.
xX position.
yY position.

Definition at line 291 of file dialog.c.