Documentation from preference.h

ROV

Introduction

[top]

ROV - Easy applications from C

Copyright - © Jason Tribbeck / 7th ARM 1994-2001

Contributing authors - Jason Tribbeck

File - preference.h

Type - helper

Description

The preference helper is designed to create a common preference scheme, with tabbed preference panes, and standard button features.

See the preferences tutorial for more details.

_rov_prefh (function pointer)

[top]

Definition of a preference event handler.

Parameters:

 - int event - the event code.
 - int page - the page the event occurred on.

typedef void (*_rov_prefh)(int event,
			   int page); 			/* Operation, Page number 	 	 */

See also: PREFERENCE_CANCEL, PREFERENCE_CHANGE, PREFERENCE_CLOSE, PREFERENCE_NEW, PREFERENCE_SAVE, PREFERENCE_SET, PREFERENCE_SETANDCLOSE

preference_init

[top]

Initialises the preference helper.

Parameters:

 - int pages - the number of pages in the preferece system.
 - char *title - the title of the preference canvas.
 - _rov_prefh handler - the preference event handler.

Returns:

 -  the canvas for the preference system.

Note - You can only have one preference system per application.

canvas preference_init(int pages,
		       char *title,
		       _rov_prefh handler);

See also: _rov_prefh

preference_makepage

[top]

Create a preference pane for a new page.

Parameters:

 - char *title - the preference title.
 - _rov_prefh handler - the preference handler for this page. You can use the parent event handler if you do not wish to write several preference event handlers.

Returns:

 -  the canvas created for the page.

canvas preference_makepage(char *title,
			   _rov_prefh handler);

See also: preference_makecanvaspage()

preference_makecanvaspage

[top]

Create a preference pane from an existing canvas.

Parameters:

 - char *title - the preference title.
 - _rov_prefh handler - the preference handler for this page.
 - canvas c - the canvas to use.

Returns:

 -  the canvas passed in.

canvas preference_makecanvaspage(char *title,
				 _rov_prefh handler,
				 canvas c);

See also: preference_makepage()

preference_open

[top]

Open the preferences at a set page,

Parameters:

 - int page - the page to open at.

void preference_open(int page);

preference_close

[top]

Close the preferences.

void preference_close(void);

PREFERENCE_NEW (definition)

[top]

Event code called when prefereces are opened for the first time.

#define PREFERENCE_NEW		(0)

PREFERENCE_CHANGE (definition)

[top]

Called when the preferences page has changed to the new page.

#define PREFERENCE_CHANGE	(1)

PREFERENCE_CLOSE (definition)

[top]

Called when the preferences page has been closed.

#define PREFERENCE_CLOSE	(2)

PREFERENCE_DEFAULT (definition)

[top]

Called when the 'default' button is pressed.

#define PREFERENCE_DEFAULT	(3)

PREFERENCE_SAVE (definition)

[top]

Called when the 'save' button is pressed.

#define PREFERENCE_SAVE		(4)

PREFERENCE_CANCEL (definition)

[top]

Called when the 'cancel' button is pressed.

#define PREFERENCE_CANCEL	(5)

PREFERENCE_SET (definition)

[top]

Called when the 'set' button is pressed with ADJUST.

#define PREFERENCE_SET		(6)

PREFERENCE_SETANDCLOSE (definition)

[top]

Called when the 'set' button is pressed with SELECT.

#define PREFERENCE_SETANDCLOSE	(7)

Preference canvas sizes

[top]
#define PREFERENCE_MAXX (740)
#define PREFERENCE_MAXY (512)

PREFERENCE_NULLPAGE (definition)

[top]

Definition of a null page

#define PREFERENCE_NULLPAGE (-1)

Generated Thu Feb 7 23:22:52 2002