Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

palm/options.c File Reference

code for handling options More...

#include <PalmOS.h>
#include <simcity_resconsts.h>
#include <sections.h>
#include <options.h>
#include <globals.h>
#include <simcity.h>
#include <logging.h>
#include <palmutils.h>

Go to the source code of this file.

Data Structures

struct  bc_chelts
 The elements for the button configuration choices. More...


Functions

FormPtr setupOptions (void) CONFIG_SECTION
 Set the state of the various fields in the options form.

void saveOptions (void) CONFIG_SECTION
 save the options from the option dialog to the application state.

FormPtr setupButtonConfig (void) CONFIG_SECTION
 set up the button config form.

void saveButtonConfig (void) CONFIG_SECTION
 Remember the button choices made.

void clearButtonConfig (void) CONFIG_SECTION
 Clear any allocated data.

Boolean hOptions (EventPtr event)
 Handler for the main options dialog.

Boolean hButtonConfig (EventPtr event)
 handler for the button configuration form


Variables

const struct bc_chelts bc_elts []
 The elements for the button configuration choices.

char ** Popups
 Remember this between form load and form exit.


Detailed Description

code for handling options

This code deals with the two options dialogs in the palm platform The options for the game and the options for the system (buttons)

Definition in file options.c.


Function Documentation

void clearButtonConfig void    [static]
 

Clear any allocated data.

Namely the list of popup strings

Definition at line 286 of file options.c.

References FreeStringList(), and Popups.

Referenced by hButtonConfig().

Boolean hButtonConfig EventPtr    event
 

handler for the button configuration form

Parameters:
event  the event to deal with
Returns:
whether the event was dealt with or not.
This form allows the user to configure the buttons on the PalmOs device.

Definition at line 150 of file options.c.

References clearButtonConfig(), formID_pocketCity, saveButtonConfig(), and setupButtonConfig().

Boolean hOptions EventPtr    event
 

Handler for the main options dialog.

This is the event loop for the form, making all the appropriate calls to set-up and save the options providing the OK button is hit.

Definition at line 29 of file options.c.

References formID_pocketCity, saveOptions(), and setupOptions().

void saveButtonConfig void    [static]
 

Remember the button choices made.

This is not persisted until the application terminates cleanly.

Definition at line 268 of file options.c.

References bc_elts, ButtonKey, GetObjectPtr(), and bc_chelts::popup.

Referenced by hButtonConfig().

void saveOptions void    [static]
 

save the options from the option dialog to the application state.

This does not persist the configuration out, that is the responsiblity of the savegame routines.

Definition at line 111 of file options.c.

References GetObjectPtr(), SETAUTOBULLDOZE, setDifficultyLevel(), setDisasterLevel(), SETMINIMAPDETAILED, SETMINIMAPVISIBLE, and UInt8.

Referenced by hOptions().

FormPtr setupButtonConfig void    [static]
 

set up the button config form.

Returns:
pointer to the form
Adds the string lists to the popups on the screen. Saves having to have multiple copies in the form definition. Costs a bit more at run-time, but saves in application size

Definition at line 238 of file options.c.

References bc_elts, ButtonKey, Char, FillStringList(), GetObjectPtr(), Int16, bc_chelts::popup, Popups, and UInt16.

Referenced by hButtonConfig().

FormPtr setupOptions void    [static]
 

Set the state of the various fields in the options form.

Returns:
the form pointer

Definition at line 79 of file options.c.

References GETAUTOBULLDOZE, getDifficultyLevel(), getDisasterLevel(), GETMINIMAPDETAILED, GETMINIMAPVISIBLE, GetObjectPtr(), UInt16, and UInt8.

Referenced by hOptions().


Variable Documentation

const struct bc_chelts bc_elts[] [static]
 

The elements for the button configuration choices.

It's defined like this to make the code smaller, and hopefully more easy to read and maintain. You simply add in the entities in the list and you're away. Note that changing the order of items in this list has a tendency to upset the application state, making the buttons behave strangely.

Referenced by saveButtonConfig(), and setupButtonConfig().


Generated on Mon Aug 30 19:44:17 2004 for pocketcity by doxygen1.2.18