Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

MiscFunc Namespace Reference

contains various functions used throughout the program. More...


Functions

Boolean osVerGe (UInt32 version_no)
 checks if the PalmOS version on the current device is greater or equal to the one specified. More...

Char * Pence2String (Int32 pence) FORM_SECTION2
 Get a 32bit int containg a sum of money in pence and return a pointer to a proper formatted string. More...

void DrawCharsRightAlign (const Char *s, const RectangleType *bounds) FORM_SECTION2
 draw right aligned text. More...

Int32 String2Pence (Char *sum) FORM_SECTION2
 Get a string containing a sum of money and convert it to pence. More...

void * GetObjectPtr (UInt16 objID) FORM_SECTION2
 returns a pointer to a given object in the current form. More...

void * GetObjectPtrByForm (FormPtr frm, UInt16 objID) FORM_SECTION2
 returns a pointer to a given object in a given form. More...

Char * GetTextPtr (UInt16 objID) FORM_SECTION2
 returns pointer to the text in a given field in the current form. More...

FieldPtr SetFieldTextFromHandle (Int16 fieldID, MemHandle txtH)
 fills in a text field from a memory handle. More...

FieldPtr SetFieldTextFromStr (Int16 fieldID, const Char *str) FORM_SECTION2
 Allocates new handle and copies incoming string. More...

FieldPtr SetFieldTextFromInt (Int16 fieldID, const Int32 i) FORM_SECTION2
 Allocates new handle and copies incoming integer. More...

void ClearFieldText (Int16 fieldID) FORM_SECTION2
 clears the text from a field:. More...

void updateDateField (UInt16 date_field_id, DateType new_date, Char *date_txt) FORM_SECTION2
 fills in a date field (pushbutton or selectortrigger) with a date. More...

void selectDate (DateType &dest, UInt16 date_field_id, Char *date_txt) FORM_SECTION2
 call the system form to choose a new date. More...

Int16 compareDates (DateType date1, DateType date2) DB_SECTION2
 compares two dates. More...

Boolean validNumberStr (const Char *str, Boolean allow_minus) DB_SECTION2
 check if a string contains a valid decimal number. More...

void PopupListSetSelection (UInt16 listId, UInt16 trigId, Int16 sel_index) FORM_SECTION2
 set list selection and update associated popup trigger label. More...


Variables

char cThousandSep
 Number format: Thousands separator (currently unused). More...

char cDecimalSep
 Number format: Decimal separator. More...

Boolean bDayFirst
 date format, print day first? More...

char cDateSep
 date format, character between day and month. More...


Detailed Description

contains various functions used throughout the program.

Function Documentation

void ClearFieldText Int16    fieldID
 

clears the text from a field:.

Int16 compareDates DateType    date1,
DateType    date2
 

compares two dates.

Parameters:
date1  1st date
date2  2nd date
Returns:
-1 if date1<date2, 0 if date1==date2 and 1 otherwise

void DrawCharsRightAlign const Char *    s,
const RectangleType *    bounds
 

draw right aligned text.

Parameters:
s  string to be drawn
bounds  rectangle inside which the text will be displayed

void* GetObjectPtr UInt16    objID
 

returns a pointer to a given object in the current form.

void* GetObjectPtrByForm FormPtr    frm,
UInt16    objID
 

returns a pointer to a given object in a given form.

Char* GetTextPtr UInt16    objID
 

returns pointer to the text in a given field in the current form.

Boolean osVerGe UInt32    version_no
 

checks if the PalmOS version on the current device is greater or equal to the one specified.

for example if(osVerGe(palmos_3_5)) DoSomething();

Parameters:
version_no  the version number - pass it one of the variables defined above (palmos_*****)
Returns:
true if the os has a verno greater or equal to the one specified, false otherwise

Char* Pence2String Int32    pence
 

Get a 32bit int containg a sum of money in pence and return a pointer to a proper formatted string.

the pointer has to be deallocated after use with MemPtrFree

void PopupListSetSelection UInt16    listId,
UInt16    trigId,
Int16    sel_index
 

set list selection and update associated popup trigger label.

Parameters:
listId  the ID of the list to set
trigId  the ID of the associated popup trigger
sel_index  index of the item to select

void selectDate DateType &    dest,
UInt16    date_field_id,
Char *    date_txt
 

call the system form to choose a new date.

Parameters:
dest  the choosen date will be stored in here
date_field_id  the date choosen will be displayed in this field
date_txt  pointer to be passed to updateDateField

FieldPtr SetFieldTextFromHandle Int16    fieldID,
MemHandle    txtH
 

fills in a text field from a memory handle.

Parameters:
fieldID  id of the field to be filled
txtH  memory handle to the text to be placed in the field
Returns:
pointer to the field

FieldPtr SetFieldTextFromInt Int16    fieldID,
const Int32    i
 

Allocates new handle and copies incoming integer.

FieldPtr SetFieldTextFromStr Int16    fieldID,
const Char *    str
 

Allocates new handle and copies incoming string.

Int32 String2Pence Char *    sum
 

Get a string containing a sum of money and convert it to pence.

Parameters:
sum  the sting containing the formatted amount
Returns:
the amount of pence in the sum

void updateDateField UInt16    date_field_id,
DateType    new_date,
Char *    date_txt
 

fills in a date field (pushbutton or selectortrigger) with a date.

Parameters:
date_field_id  ID of the field
new_date  date to be displayed
date_txt  pointer to an allocated buffer where the date text can be stored

Boolean validNumberStr const Char *    str,
Boolean    allow_minus
 

check if a string contains a valid decimal number.

Parameters:
str  the string
minus_allowed  boolean that indicates if the number may be negative
Returns:
true if the string is valid, false otherwise


Variable Documentation

Boolean MiscFunc::bDayFirst
 

date format, print day first?

Definition at line 52 of file MiscFunc.h.

char MiscFunc::cDateSep
 

date format, character between day and month.

Definition at line 54 of file MiscFunc.h.

char MiscFunc::cDecimalSep
 

Number format: Decimal separator.

Definition at line 50 of file MiscFunc.h.

char MiscFunc::cThousandSep
 

Number format: Thousands separator (currently unused).

Definition at line 48 of file MiscFunc.h.


Generated on Thu Jan 16 23:11:16 2003 for FreeCoins by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002