O'Reilly logo

Palm OS Programming, 2nd Edition by Neil Rhodes, Julie McKeehan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Source Code

Customer.c

/* Copyright (c) 1998-2001, Neil Rhodes and Julie McKeehan neil@pobox.com All rights reserved. From the book "Palm OS Programming (2nd edition)" by O'Reilly. Permission granted to use this file however you see fit. */ #define DO_NOT_ALLOW_ACCESS_TO_INTERNALS_OF_STRUCTS #include <BuildDefines.h> #ifdef DEBUG_BUILD #define ERROR_CHECK_LEVEL ERROR_CHECK_FULL #endif #include <PalmOS.h> #include "Customer.h" #include "Utils.h" #include "SalesRsc.h" #include "Common.h" Boolean gSaveBackup = true; Boolean AskDeleteCustomer(void) { FormPtr form = FrmInitForm(DeleteCustomerForm); UInt16 hitButton; UInt16 ctlIndex; // Set the "save backup" checkbox to its previous setting. ctlIndex = FrmGetObjectIndex(form, DeleteCustomerSaveBackupCheckbox); FrmSetControlValue(form, ctlIndex, gSaveBackup); hitButton = FrmDoDialog(form); if (hitButton == DeleteCustomerOKButton) gSaveBackup = (Boolean) FrmGetControlValue(form, ctlIndex); FrmDeleteForm(form); return (Boolean) (hitButton == DeleteCustomerOKButton); } static Boolean CustomerHandleEvent(EventPtr event) { if (event->eType == ctlSelectEvent && event->data.ctlSelect.controlID == CustomerDeleteButton) { if (!AskDeleteCustomer( )) return true; // Don't bail out if they cancel the Delete dialog box. } return false; } // isNew is true if this is a brand-new customer. void EditCustomerWithSelection(UInt16 recordNumber, Boolean isNew, Boolean *deleted, EventPtr event) { FormPtr form; UInt16 hitButton; Boolean dirty = false; Boolean ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required