Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

palm/budget.c File Reference

the palm budget UI code More...

#include <PalmOS.h>
#include <unix_stdlib.h>
#include <palmutils.h>
#include <simcity.h>
#include <simcity_resconsts.h>
#include <globals.h>
#include <logging.h>
#include <ui.h>
#include <simulation.h>
#include <sections.h>
#include <budget.h>
#include <stddef.h>
#include <resCompat.h>
#include <repeathandler.h>

Go to the source code of this file.

Data Structures

struct  updateentity
 A collection of all the labels and their related items. More...


Defines

#define ENTITY_COUNT   (sizeof (entity) / sizeof (entity[0]))
 count of budget number entities


Functions

FormPtr budgetSetup (FormPtr form) BUDGET_SECTION
 Set up the budget form.

void dealRepeats (EventPtr event) BUDGET_SECTION
 deal with the repeat event

void dealFieldContentChange (UInt16 fieldID) BUDGET_SECTION
 deal with the manual change of the contents of a field

void updateBudgetValue (FormPtr form, UInt16 label, const Char *format, long value) BUDGET_SECTION
 update the value of a budget number field.

void updateBudgetNumber (BudgetNumber bn) BUDGET_SECTION
void post_fieldhandler (UInt16 field, buttonmapping_t *map, Int32 newValue) BUDGET_SECTION
 deal with the new value that has been passed into a structure

Boolean hBudget (EventPtr event)
 Handler for the budget form.


Variables

buttonmapping_t budget_map []
 button mapping for the spinners

const struct updateentity entity []
 A collection of all the labels and their related items.


Detailed Description

the palm budget UI code

This code deals with the code for the budget form from the pocketcity application

Definition in file budget.c.


Function Documentation

FormPtr budgetSetup FormPtr    form [static]
 

Set up the budget form.

Parameters:
form  the form to use
Returns:
the form that was passed in.
configures all the text strings to read the values from the main simulation, as well as adding in space for the text fields to choose the age to give over to each service.

Definition at line 243 of file budget.c.

References BudgetGetNumber(), updateentity::formatstr, GetObjectPtr(), updateentity::item, updateentity::label, UInt16, and updateBudgetValue().

Referenced by hBudget().

void dealFieldContentChange UInt16    fieldID [static]
 

deal with the manual change of the contents of a field

Parameters:
fieldID  the id# of the field that was changed

Definition at line 78 of file budget.c.

References post_fieldhandler(), processRepeater(), and UInt16.

Referenced by hBudget().

void dealRepeats EventPtr    event [static]
 

deal with the repeat event

Parameters:
event  the event that was passed in

Definition at line 67 of file budget.c.

References post_fieldhandler(), processRepeater(), and UInt16.

Referenced by hBudget().

Boolean hBudget EventPtr    event
 

Handler for the budget form.

Takes care of events directed at the form.

Definition at line 86 of file budget.c.

References budgetSetup(), dealFieldContentChange(), dealRepeats(), formID_pocketCity, UIGotoForm(), and UInt16.

void post_fieldhandler UInt16    field,
buttonmapping_t   map,
Int32    newValue
[static]
 

deal with the new value that has been passed into a structure

Parameters:
field  the field that was changed
map  the button that was pressed
newValue  the new value of the field in question

Definition at line 52 of file budget.c.

References BudgetNumber, Int32, buttonmapping_tag::special1, buttonmapping_tag::special2, UInt16, UInt8, and updateBudgetNumber().

Referenced by dealFieldContentChange(), and dealRepeats().

void updateBudgetNumber const BudgetNumber    item [static]
 

\update the field in question

Parameters:
item  the item to update

Definition at line 214 of file budget.c.

References BudgetGetNumber(), BudgetNumber, updateentity::formatstr, updateentity::item, updateentity::label, and updateBudgetValue().

Referenced by post_fieldhandler().

void updateBudgetValue FormPtr    form,
UInt16    label,
const Char   format,
long    value
[static]
 

update the value of a budget number field.

Scales the number with the K,M... scaling.

Parameters:
form  the form containing the items
label  the label to alter
format  the format of the output
value  the value of the output

Definition at line 197 of file budget.c.

References Char, scaleNumber(), UInt16, and UInt32.

Referenced by budgetSetup(), and updateBudgetNumber().


Variable Documentation

buttonmapping_t budget_map[] [static]
 

Initial value:

 {
        { rbutton_taxdown, rbutton_taxup, fieldID_taxrate,
                0, 20, bnIncome, offsetof(GameStruct, tax) },
        { rbutton_trafdown, rbutton_trafup, fieldID_budget_tra,
                0, 100, bnTraffic, offsetof(GameStruct, upkeep[0]) },
        { rbutton_powdown, rbutton_powup, fieldID_budget_pow,
                0, 100, bnPower, offsetof(GameStruct, upkeep[1]) },
        { rbutton_defdown, rbutton_defup, fieldID_budget_def,
                0, 100, bnDefence, offsetof(GameStruct, upkeep[2]) },
        { 0, 0, 0, 0, 0, 0, 0 }
}
button mapping for the spinners

Definition at line 33 of file budget.c.

const struct updateentity entity[] [static]
 

A collection of all the labels and their related items.

Shrinks the code and makes it more consistent.


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