app.h

来自「CD_《Palm OS编程实践》」· C头文件 代码 · 共 90 行

H
90
字号
#ifndef APP_H
#define APP_H
//////////////////////////////////////////////////////////////////////////////
// app.h
// Definitions for the application.
// Copyright (c) 1999, Robert Mykland.  All rights reserved.
//////////////////////////////////////////////////////////////////////////////

//////////////
// Includes //
//////////////

#include <Pilot.h>			// All the Palm includes
#include "Calculator_res.h"	// Resource definitions
#include "fabout.h"			// Definitions for the "about" form
#include "fcalc.h"			// Definitions for the "calc" form
#include "fprefs.h"			// Definitions for the "prefs" form
#include "main.h"			// Definitions for the main entry point
#include "moptions.h"		// Definitions for the "options" menu

//////////////////////////////
// Definitions for fabout.c //
//////////////////////////////

// The menu event handler macro for the "about" form
#define aboutFormMenuEventHandler(spEvent)

/////////////////////////////
// Definitions for fcalc.c //
/////////////////////////////

// The menu event handler macro for the "calc" form
#define calcFormMenuEventHandler(spEvent) \
{\
	optionsMenuEventHandler( spEvent );\
}

//////////////////////////////
// Definitions for fprefs.c //
//////////////////////////////

// The menu event handler macro for the "prefs" form
#define prefsFormMenuEventHandler(spEvent)

////////////////////////////
// Definitions for main.c //
////////////////////////////

// The prototype for getEventHandler()
static FormEventHandlerPtr getEventHandler( Word );

// This creates the function getEventHandler,
// which returns the event handler for a given form
// in this application.
#define EVENT_HANDLER_LIST \
static FormEventHandlerPtr getEventHandler( Word wFormID )\
{\
	switch( wFormID )\
	{\
		case AboutForm:\
			return( aboutFormEventHandler );\
		case CalcForm:\
			return( calcFormEventHandler );\
		case PrefsForm:\
			return( prefsFormEventHandler );\
	}\
	return( NULL );\
}

// This defines the macro that initializes the app
#define appInit()

// This defines the macro that cleans up the app
#define appStop()

// This application works on PalmOS 2.0 and above
#define ROM_VERSION_MIN	ROM_VERSION_2

// Define the starting form
#define StartForm CalcForm

////////////////////////////////
// Definitions for moptions.c //
////////////////////////////////

// Menu ID name conversions
#define OptionsAbout	OptionsAboutCalculator

#endif	// APP_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?