| Line No. | Rev | Author | Line |
|---|---|---|---|
| 1 | 32 | kaklik | /***************************************************************************** |
| 2 | * |
||
| 3 | * Module for Microchip Graphics Library |
||
| 4 | * GOL Layer |
||
| 5 | * This template can be used to create additional controls |
||
| 6 | * |
||
| 7 | ***************************************************************************** |
||
| 8 | * FileName: Template.h |
||
| 9 | * Dependencies: None |
||
| 10 | * Processor: PIC24F, PIC24H, dsPIC, PIC32 |
||
| 11 | * Compiler: MPLAB C30 V3.00 |
||
| 12 | * Linker: MPLAB LINK30 |
||
| 13 | * Company: Microchip Technology Incorporated |
||
| 14 | * |
||
| 15 | * Software License Agreement |
||
| 16 | * |
||
| 17 | * Copyright © 2008 Microchip Technology Inc. All rights reserved. |
||
| 18 | * Microchip licenses to you the right to use, modify, copy and distribute |
||
| 19 | * Software only when embedded on a Microchip microcontroller or digital |
||
| 20 | * signal controller, which is integrated into your product or third party |
||
| 21 | * product (pursuant to the sublicense terms in the accompanying license |
||
| 22 | * agreement). |
||
| 23 | * |
||
| 24 | * You should refer to the license agreement accompanying this Software |
||
| 25 | * for additional information regarding your rights and obligations. |
||
| 26 | * |
||
| 27 | * SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY |
||
| 28 | * KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY |
||
| 29 | * OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR |
||
| 30 | * PURPOSE. IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR |
||
| 31 | * OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, |
||
| 32 | * BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT |
||
| 33 | * DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, |
||
| 34 | * INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, |
||
| 35 | * COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY |
||
| 36 | * CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), |
||
| 37 | * OR OTHER SIMILAR COSTS. |
||
| 38 | * |
||
| 39 | * Author Date Comment |
||
| 40 | *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
| 41 | * Anton Alkhimenok 06/15/07 Beta release |
||
| 42 | *****************************************************************************/ |
||
| 43 | #ifndef _CUSTOM_H |
||
| 44 | #define _CUSTOM_H |
||
| 45 | |||
| 46 | #include <Graphics\GOL.h> |
||
| 47 | |||
| 48 | // Control states: |
||
| 49 | #define CC_FOCUSED 0x0001 // bit to indicate the control is focused |
||
| 50 | #define CC_DISABLED 0x0002 // bit to indicate the control is disabled |
||
| 51 | #define CC_HIDE 0x8000 // bit to indicate the control must be removed from screen |
||
| 52 | #define CC_DRAW 0x4000 // bits to indicate the whole control must be redrawn |
||
| 53 | |||
| 54 | // The structure contains data for the control |
||
| 55 | typedef struct |
||
| 56 | { |
||
| 57 | OBJ_HEADER hdr; |
||
| 58 | } CUSTOM; |
||
| 59 | |||
| 60 | /********************************************************************* |
||
| 61 | * Function: CUSTOM *CcCreate(WORD ID, SHORT left, SHORT top, SHORT right, |
||
| 62 | * SHORT bottom, WORD state, GOL_SCHEME *pScheme) |
||
| 63 | * |
||
| 64 | * PreCondition: none |
||
| 65 | * |
||
| 66 | * Input: ID - user defined ID for the object |
||
| 67 | * left, top, right, bottom - location of the left,top and |
||
| 68 | * right, bottom corners of the object |
||
| 69 | * state - state of object |
||
| 70 | * pScheme - pointer to the style scheme |
||
| 71 | * |
||
| 72 | * Output: returns the pointer to the object created |
||
| 73 | * |
||
| 74 | * Side Effects: none |
||
| 75 | * |
||
| 76 | * Overview: creates the object and initialize with the passed parameters and |
||
| 77 | * default settings |
||
| 78 | * |
||
| 79 | * Note: none |
||
| 80 | * |
||
| 81 | ********************************************************************/ |
||
| 82 | CUSTOM *CcCreate(WORD ID, SHORT left, SHORT top, SHORT right, SHORT bottom, WORD state, GOL_SCHEME *pScheme); |
||
| 83 | |||
| 84 | /********************************************************************* |
||
| 85 | * Function: WORD CcTranslateMsg(CUSTOM *pCc, GOL_MSG *pMsg) |
||
| 86 | * |
||
| 87 | * PreCondition: none |
||
| 88 | * |
||
| 89 | * Input: pMsg - pointer to the message struct containing the message from |
||
| 90 | * the user interface |
||
| 91 | * pCc - the pointer to the object where the message will be tested |
||
| 92 | * to check if the message will affect the object |
||
| 93 | * |
||
| 94 | * Output: returns the action that the object will be performing |
||
| 95 | * |
||
| 96 | * Overview: evaluates the message if the object will be affected by the |
||
| 97 | * message or not |
||
| 98 | * |
||
| 99 | * Note: THIS FUNCTION CALL SHOULD BE ADDED INTO GOLMsg() FUNCTION IN |
||
| 100 | * GOL.C FILE |
||
| 101 | * |
||
| 102 | ********************************************************************/ |
||
| 103 | WORD CcTranslateMsg(CUSTOM *pCc, GOL_MSG *pMsg); |
||
| 104 | |||
| 105 | /********************************************************************* |
||
| 106 | * Function: void CcMsgDefault(CUSTOM* pCc, GOL_MSG* pMsg) |
||
| 107 | * |
||
| 108 | * PreCondition: None |
||
| 109 | * |
||
| 110 | * Input: pMsg - pointer to the message struct containing the message the user |
||
| 111 | * pCc - the pointer to the object whose state will be modified |
||
| 112 | * |
||
| 113 | * Output: none |
||
| 114 | * |
||
| 115 | * Side Effects: |
||
| 116 | * |
||
| 117 | * Overview: changes the state of the object |
||
| 118 | * |
||
| 119 | * Note: THIS FUNCTION CALL SHOULD BE ADDED INTO GOLMsg() FUNCTION IN |
||
| 120 | * GOL.C FILE |
||
| 121 | * |
||
| 122 | ********************************************************************/ |
||
| 123 | void CcMsgDefault(CUSTOM *pCc, GOL_MSG *pMsg); |
||
| 124 | |||
| 125 | /********************************************************************* |
||
| 126 | * Function: WORD CcDraw(CUSTOM *pCc) |
||
| 127 | * |
||
| 128 | * PreCondition: object must be created before this is called |
||
| 129 | * |
||
| 130 | * Input: pCc - pointer to struct CUSTOM with data |
||
| 131 | * |
||
| 132 | * Output: returns the status of the drawing |
||
| 133 | * 0 - not complete |
||
| 134 | * 1 - done |
||
| 135 | * |
||
| 136 | * Overview: draws control |
||
| 137 | * |
||
| 138 | * Note: THIS FUNCTION CALL SHOULD BE ADDED INTO GOLDraw() FUNCTION IN |
||
| 139 | * GOL.C FILE |
||
| 140 | * |
||
| 141 | ********************************************************************/ |
||
| 142 | WORD CcDraw(CUSTOM *pCc); |
||
| 143 | #endif // _CUSTOM_H |
Powered by WebSVN v2.8.3