Skip to Main Content
Palm OS Programming, 2nd Edition
book

Palm OS Programming, 2nd Edition

by Julie McKeehan, Neil Rhodes
October 2001
Intermediate to advanced content levelIntermediate to advanced
704 pages
19h 33m
English
O'Reilly Media, Inc.
Content preview from Palm OS Programming, 2nd Edition

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Palm OS Network Programming

Palm OS Network Programming

Greg Winton
Palm Programming: The Developer's Guide

Palm Programming: The Developer's Guide

Neil Rhodes, Julie McKeehan

Publisher Resources

ISBN: 1565928563Errata Page