MorePalmOS
A development library for developing Palm OS applications

MoreField.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * MorePalmOS
00003  * Copyright (c) 2004 Steven Fisher
00004  *
00005  * Distributed under the Boost Software License, Version 1.0. See accompanying
00006  * license file License.txt or <http://www.boost.org/LICENSE_1_0.txt>.
00007  *
00008  * http://morepalmos.sourceforge.net
00009  *
00010  *   MorePalmOS is the humble begining of an attempt to provide a library for
00011  *   Palm OS development which works around system bugs, illustrate how to
00012  *   use system calls, and provide "glue code" for programming Palm OS
00013  *   applications in a more straightforward way while minimally impacting
00014  *   code size.
00015  *****************************************************************************/
00016 
00020 #ifndef MOREFIELD_H
00021 #define MOREFIELD_H
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 #include "MorePrefix.h"
00028 #include "MoreTypes.h"
00029 
00030 #include <Field.h>
00031 #include <Form.h>
00032 
00033 #if MOREPALMOS_MACRO_SIMPLE_FUNCS
00034 
00035 #define MFldGetByID( formP, id ) \
00036         ( FieldType* )MFrmGetObjPtrByID( formP, id )
00037 #define MFldGetByIdx( formP, idx ) \
00038         ( FieldType* )MFrmGetObjPtrByIdx( formP, idx )
00039 #define MFldGetByPtr( objectP ) \
00040         ( FieldType* )( objectJ )
00041 
00042 #else
00043 
00044 FieldType* MFldGetByID( FormType* formP, FrmObjectID_t id );
00045 FieldType* MFldGetByIdx( FormType* formP, FrmObjectIdx_t idx );
00046 FieldType* MFldGetByPtr( FrmObject_t* objectP );
00047 
00048 #endif
00049 
00072 typedef UInt16 MoreSetTextFlags;
00073 
00074 #define mstDefault 0
00075 enum MoreSetTextFlag
00076 {
00077         mstDontRedraw = 0x0,
00078         mstRedraw = 0x1,
00079 
00080         mstReplaceOld = 0x0,
00081         mstReuseOld = 0x2,
00082 
00083         mstMemHandleFreeOld = 0x0,
00084         mstLeakOld = 0x4
00085 };
00086 
00092 Err MFldSetTextFromChars( FieldType* fieldP, const char *s,
00093                 UInt32 len, MoreSetTextFlags flags );
00094 
00100 Err MFldSetTextFromCharsByID( FormType* formP, FrmObjectID_t fieldID,
00101                 const char *s, UInt32 len, MoreSetTextFlags flags );
00102 
00108 Err MFldSetTextFromCharsByIdx( FormType* formP, FrmObjectIdx_t fieldIdx,
00109                 const char *s, UInt32 len, MoreSetTextFlags flags );
00110 
00116 Err MFldSetTextFromStr( FieldType* fieldP, const char *s,
00117                 MoreSetTextFlags flags );
00118 
00124 Err MFldSetTextFromStrByID( FormType* formP, FrmObjectID_t fieldID, const char *s,
00125                 MoreSetTextFlags flags );
00126 
00132 Err MFldSetTextFromStrByIdx( FormType* formP, FrmObjectIdx_t fieldIdx,
00133                 const char *s, MoreSetTextFlags flags );
00134 
00140 Err MFldClearText( FieldType* fieldP, MoreSetTextFlags flags );
00141 
00147 Err MFldClearTextByID( FormType* formP, FrmObjectID_t fieldID,
00148                 MoreSetTextFlags flags );
00149 
00155 Err MFldClearTextByIdx( FormType* formP, FrmObjectIdx_t fieldIdx,
00156                 MoreSetTextFlags flags );
00157 
00163 Err MFldSetTextFromHandle( FieldPtr fieldP, MemHandle text,
00164                 MoreSetTextFlags flags );
00165 
00171 Err MFldSetTextFromHandleByID( FormType* formP, FrmObjectID_t fieldID,
00172                 MemHandle text, MoreSetTextFlags flags );
00173 
00179 Err MFldSetTextFromHandleByIdx( FormType* formP, FrmObjectIdx_t fieldIdx,
00180                 MemHandle text, MoreSetTextFlags flags );
00181 
00182 #ifdef __cplusplus
00183 }
00184 #endif
00185 
00186 #endif

SourceForge.net Logo