⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prefs.c

📁 可编程器件厂商Xilinx的手持式逻辑分析仪的逻辑设计
💻 C
字号:
/*============================================================================*/
/* Filename:    Prefs.c                                                       */
/*                                                                            */
/* Description: This file contains the functions that receive and handle the  */
/*              events generated by the Prefs Form of the PocketAnalyser      */
/*              application.                                                  */
/*                                                                            */
/* Required Header File(s): PalmOS.h                                          */
/*                          PocketAnalyzerRsc.h                               */
/*                          Globals.h                                         */
/*                                                                            */
/* Function List:                                                             */
/*      PrefsHandleEvent                                                      */
/*                          This function is the event handler for the        */
/*                          Prefs Form.  It checks each event and calls the   */
/*                          appropriate function(s) to respond to it.         */
/*      PrefsDoCommand                                                        */
/*                          This function handles all of the menu events from */
/*                          the Prefs Form Menu.                              */
/*                                                                            */
/*============================================================================*/
/* COPYRIGHT (C) 2001                                                         */
/* NowTech, LLC                                                               */
/* Knoxville, TN                                                              */
/*                                                                            */
/* ALL RIGHTS RESERVED                                                        */
/*                                                                            */
/* This software and all information and ideas contained within are the sole  */
/* property of NowTech, LLC and are confidential.  Neither this software nor  */
/* any part nor any information contained in it may be disclosed or furnished */
/* to others without the prior written consent of NowTech, LLC.               */
/*                                                                            */
/*============================================================================*/

/*============================================================================*/
/* System Level Include Files:                                                */
/*============================================================================*/
#include <PalmOS.h>

/*============================================================================*/
/* Project Specific Include Files:                                            */
/*============================================================================*/
#include "PocketAnalyzerRsc.h"
#include "GlobalDefs.h"

/*============================================================================*/
/* Define any data structures that are used exclusively by the functions      */
/* local to this source file.                                                 */
/*============================================================================*/
/***** None *****/

/*============================================================================*/
/* Define all constants used by the functions in this source file.            */
/*============================================================================*/
/***** None *****/

/*============================================================================*/
/* Define all variables which must have project global scope.  All variables  */
/* defined in this section will be accessible by all functions in all source  */
/* files in this project and must have a corresponding extern statement in    */
/* the GlobalDefs.h include file.                                             */
/*============================================================================*/
/***** None *****/

/*============================================================================*/
/* Define all variables which must have source file global scope but not have */
/* project wide scope.  These variables must be defined with the "static"     */
/* type qualifier so that the variables scope will be limited to only the     */
/* functions in this source file.                                             */
/*============================================================================*/
/***** None *****/

/*============================================================================*/
/* Define the function prototypes for all local functions.  The prototypes    */
/* for all global functions should be defined in the GlobalDefs.h include     */
/* file.                                                                      */
/*============================================================================*/
void PrefsFormInit (FormPtr);
Boolean PrefsDoCommand (UInt16);


/*============================================================================*/
/* Function:            PrefsHandleEvent                                      */
/* Description:         This routine is the event handler for the Prefs Form  */
/*                      of the PocketAnalyzer application.                    */
/*                                                                            */
/* Arguments:           pEvent = a pointer to an EventType structure          */
/* Returns:             bHandled = TRUE if the event is handled and should    */
/*                                 not be passed to a higher level handler.   */
/*                                 FALSE if the event was not handled and     */
/*                                 should be passed to the next higher level  */
/*                                 handler.                                   */
/* Globals affected:    None                                                  */
/* Hardware affected:   None                                                  */
/*                                                                            */
/*============================================================================*/
/* Change History:                                                            */
/*                                                                            */
/* ECO#:  ?                                                                   */
/* Change Date:  dd-mmm-yyyy                                                  */
/* Changed By:   ?                                                            */
/* Description of Change:  ?                                                  */
/*                                                                            */
/*============================================================================*/
Boolean PrefsHandleEvent(EventPtr pEvent)
{
    /*========================================================================*/
    /* Declare all local variables.                                           */
    /*========================================================================*/
    Boolean bHandled = false;
    FormPtr pFrm;

    /*========================================================================*/
    /* Check the event type to see how to respond.                            */
    /*========================================================================*/
    switch (pEvent->eType)
        {
        case menuEvent:
            return PrefsDoCommand(pEvent->data.menu.itemID);
            break;

        case frmOpenEvent:
            pFrm = FrmGetActiveForm();
            PrefsFormInit (pFrm);
            FrmDrawForm (pFrm);
            bHandled = true;
            break;

        case ctlSelectEvent:
            if (pEvent->data.ctlSelect.controlID == FrmPrefsDoneButton)
            {
                FrmGotoForm (FrmMainForm);
            }

        default:
            break;
        }

    return bHandled;
}




/***********************************************************************
 *
 * FUNCTION:    PrefsFormInit
 *
 * DESCRIPTION: This routine initializes the Prefs form.
 *
 * PARAMETERS:  frm - pointer to the Prefs form.
 *
 * RETURNED:    nothing
 *
 * REVISION HISTORY:
 *
 *
 ***********************************************************************/
static void PrefsFormInit(FormPtr /*frmP*/)
{
/*
    FormPtr frm = FrmGetActiveForm();
    UInt16  ModeFieldObjIndex = FrmGetObjectIndex(frm, frmMainModeField);
*/
}




/***********************************************************************
 *
 * FUNCTION:    PrefsDoCommand
 *
 * DESCRIPTION: This routine performs the menu command specified.
 *
 * PARAMETERS:  command  - menu item id
 *
 * RETURNED:    nothing
 *
 * REVISION HISTORY:
 *
 *
 ***********************************************************************/
static Boolean PrefsDoCommand(UInt16 command)
{
    Boolean handled = false;
    FormPtr pFrm;

    switch (command)
        {
        case OptionsHelp:
            MenuEraseStatus(0);                 /* Clear menu from display.   */
            pFrm = FrmGetActiveForm();
            FrmHelp (PrefsHelpString);
            handled = true;
            break;
        case OptionsAboutPocketAnalyzer:
            MenuEraseStatus(0);                 /* Clear menu from display.   */
            pFrm = FrmInitForm (FrmAboutForm);
            FrmDoDialog (pFrm);                 /* Display the About Box.     */
            FrmDeleteForm (pFrm);
            handled = true;
            break;
        }

    return handled;
}

⌨️ 快捷键说明

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