00001 /** $Revision: 1.14 $ 00002 Last updated: $Date: 2002/09/20 12:21:30 $ 00003 00004 Copyright (C) 2001-2002 Vlad Mereuta <dizzy@users.sourceforge.net> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00019 00020 #ifndef __CHOOSE_ACCOUNT_FORM__ 00021 #define __CHOOSE_ACCOUNT_FORM__ 00022 00023 #include <PalmOS.h> 00024 #include "Form.h" 00025 00026 #include "FreeCoinsRsc.h" 00027 00028 /** This class displays a form which enables the user to choose an account from a displayed account list */ 00029 class ChooseAccountForm : public Form 00030 { 00031 public: 00032 ///if true the form will allow the user to click ok without making a selection (for selecting catogories and/or the account currently explored) 00033 bool allow_no_selection; 00034 ///allow creation of new account from this dialog 00035 bool allow_new_account; 00036 ///choosen account 00037 UInt32 chosen_account; 00038 ///true if an account was chosen 00039 bool chosen; 00040 00041 /** constructor; sets form variables */ 00042 ChooseAccountForm() FORM_SECTION1; 00043 ///returns singleton reference to this object 00044 static ChooseAccountForm* instance() FORM_SECTION1; 00045 00046 ///initialises form 00047 Boolean handleOpenEvent() FORM_SECTION1; 00048 ///handles controls 00049 Boolean handleCtlSelectEvent (UInt16 control_id) FORM_SECTION1; 00050 ///handles key presses 00051 Boolean handleKeyDownEvent(WChar key_id, UInt16 modifiers) FORM_SECTION1; 00052 ///handle updates 00053 Boolean handleUpdateEvent (UInt16 update_code) FORM_SECTION1; 00054 /// callback for custom list drawing 00055 static void drawAccountName(Int16 itemNum, RectangleType *bounds, Char **txt) FORM_SECTION1; 00056 00057 private: 00058 ///reference to this object 00059 static ChooseAccountForm* _instance; 00060 }; 00061 00062 #endif