Single Photo displayed on LPC4088
Dependencies: DMBasicGUI DMSupport
easyGUIFixed/GuiItems.h@0:9140ec6aa604, 2017-07-28 (annotated)
- Committer:
- jmitc91516
- Date:
- Fri Jul 28 14:19:12 2017 +0000
- Revision:
- 0:9140ec6aa604
Simple application that displays a single photograph on the LPC4088 display.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jmitc91516 | 0:9140ec6aa604 | 1 | /* ************************************************************************ */ |
jmitc91516 | 0:9140ec6aa604 | 2 | /* */ |
jmitc91516 | 0:9140ec6aa604 | 3 | /* (C)2004-2015 IBIS Solutions ApS */ |
jmitc91516 | 0:9140ec6aa604 | 4 | /* sales@easyGUI.com */ |
jmitc91516 | 0:9140ec6aa604 | 5 | /* www.easyGUI.com */ |
jmitc91516 | 0:9140ec6aa604 | 6 | /* */ |
jmitc91516 | 0:9140ec6aa604 | 7 | /* v6.0.9.005 */ |
jmitc91516 | 0:9140ec6aa604 | 8 | /* */ |
jmitc91516 | 0:9140ec6aa604 | 9 | /* GuiLib.c include file - do NOT reference it in your linker setup */ |
jmitc91516 | 0:9140ec6aa604 | 10 | /* */ |
jmitc91516 | 0:9140ec6aa604 | 11 | /* ************************************************************************ */ |
jmitc91516 | 0:9140ec6aa604 | 12 | |
jmitc91516 | 0:9140ec6aa604 | 13 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 14 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 15 | static GuiConst_INT8U GetItemByte( |
jmitc91516 | 0:9140ec6aa604 | 16 | GuiConst_INT8U *PrefixLocate*PrefixLocate ItemDataPtrPtr) |
jmitc91516 | 0:9140ec6aa604 | 17 | { |
jmitc91516 | 0:9140ec6aa604 | 18 | GuiConst_INT8U D; |
jmitc91516 | 0:9140ec6aa604 | 19 | #ifdef GuiConst_AVRGCC_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 20 | D = ReadBytePtr(*ItemDataPtrPtr); |
jmitc91516 | 0:9140ec6aa604 | 21 | #else |
jmitc91516 | 0:9140ec6aa604 | 22 | #ifdef GuiConst_AVR_COMPILER_FLASH_RAM |
jmitc91516 | 0:9140ec6aa604 | 23 | GuiConst_INT8U PrefixRom * ItemFlashPtr = |
jmitc91516 | 0:9140ec6aa604 | 24 | (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 25 | D = *ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 26 | #else |
jmitc91516 | 0:9140ec6aa604 | 27 | #ifdef GuiConst_ICC_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 28 | GuiConst_INT8U PrefixRom * ItemFlashPtr = |
jmitc91516 | 0:9140ec6aa604 | 29 | (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 30 | D = *ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 31 | #else |
jmitc91516 | 0:9140ec6aa604 | 32 | #ifdef GuiConst_CODEVISION_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 33 | GuiConst_INT8U PrefixRom * ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 34 | ItemFlashPtr = (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 35 | D = *ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 36 | #else |
jmitc91516 | 0:9140ec6aa604 | 37 | D = **ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 38 | #endif |
jmitc91516 | 0:9140ec6aa604 | 39 | #endif |
jmitc91516 | 0:9140ec6aa604 | 40 | #endif |
jmitc91516 | 0:9140ec6aa604 | 41 | #endif |
jmitc91516 | 0:9140ec6aa604 | 42 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 43 | return (D); |
jmitc91516 | 0:9140ec6aa604 | 44 | } |
jmitc91516 | 0:9140ec6aa604 | 45 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 46 | static GuiConst_INT16S GetItemWord( |
jmitc91516 | 0:9140ec6aa604 | 47 | GuiConst_INT8U *PrefixLocate*PrefixLocate ItemDataPtrPtr) |
jmitc91516 | 0:9140ec6aa604 | 48 | { |
jmitc91516 | 0:9140ec6aa604 | 49 | GuiConst_INT16U D; |
jmitc91516 | 0:9140ec6aa604 | 50 | |
jmitc91516 | 0:9140ec6aa604 | 51 | #ifdef GuiConst_AVRGCC_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 52 | D = ReadBytePtr(*ItemDataPtrPtr); |
jmitc91516 | 0:9140ec6aa604 | 53 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 54 | D += 0x0100 * (GuiConst_INT16U)ReadBytePtr(*ItemDataPtrPtr); |
jmitc91516 | 0:9140ec6aa604 | 55 | #else |
jmitc91516 | 0:9140ec6aa604 | 56 | #ifdef GuiConst_AVR_COMPILER_FLASH_RAM |
jmitc91516 | 0:9140ec6aa604 | 57 | GuiConst_INT8U PrefixRom * ItemFlashPtr = |
jmitc91516 | 0:9140ec6aa604 | 58 | (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 59 | D = *ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 60 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 61 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 62 | D += 0x0100 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 63 | #else |
jmitc91516 | 0:9140ec6aa604 | 64 | #ifdef GuiConst_ICC_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 65 | GuiConst_INT8U PrefixRom * ItemFlashPtr = |
jmitc91516 | 0:9140ec6aa604 | 66 | (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 67 | D = *ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 68 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 69 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 70 | D += 0x0100 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 71 | #else |
jmitc91516 | 0:9140ec6aa604 | 72 | #ifdef GuiConst_CODEVISION_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 73 | GuiConst_INT8U PrefixRom * ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 74 | ItemFlashPtr = (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 75 | D = *ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 76 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 77 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 78 | D += 0x0100 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 79 | #else |
jmitc91516 | 0:9140ec6aa604 | 80 | D = **ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 81 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 82 | D += 0x0100 * (GuiConst_INT16U)**ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 83 | #endif |
jmitc91516 | 0:9140ec6aa604 | 84 | #endif |
jmitc91516 | 0:9140ec6aa604 | 85 | #endif |
jmitc91516 | 0:9140ec6aa604 | 86 | #endif |
jmitc91516 | 0:9140ec6aa604 | 87 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 88 | return ((GuiConst_INT16S) D); |
jmitc91516 | 0:9140ec6aa604 | 89 | } |
jmitc91516 | 0:9140ec6aa604 | 90 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 91 | #ifdef GuiLib_COLOR_BYTESIZE_3 |
jmitc91516 | 0:9140ec6aa604 | 92 | static GuiConst_INT32S GetItemTriple( |
jmitc91516 | 0:9140ec6aa604 | 93 | GuiConst_INT8U *PrefixLocate*PrefixLocate ItemDataPtrPtr) |
jmitc91516 | 0:9140ec6aa604 | 94 | { |
jmitc91516 | 0:9140ec6aa604 | 95 | GuiConst_INT32U D; |
jmitc91516 | 0:9140ec6aa604 | 96 | |
jmitc91516 | 0:9140ec6aa604 | 97 | #ifdef GuiConst_AVRGCC_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 98 | D = ReadBytePtr(*ItemDataPtrPtr); |
jmitc91516 | 0:9140ec6aa604 | 99 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 100 | D += 0x00000100 * (GuiConst_INT32U)ReadBytePtr(*ItemDataPtrPtr); |
jmitc91516 | 0:9140ec6aa604 | 101 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 102 | D += 0x00010000 * (GuiConst_INT32U)ReadBytePtr(*ItemDataPtrPtr); |
jmitc91516 | 0:9140ec6aa604 | 103 | #else |
jmitc91516 | 0:9140ec6aa604 | 104 | #ifdef GuiConst_AVR_COMPILER_FLASH_RAM |
jmitc91516 | 0:9140ec6aa604 | 105 | GuiConst_INT8U PrefixRom * ItemFlashPtr = |
jmitc91516 | 0:9140ec6aa604 | 106 | (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 107 | D = *ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 108 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 109 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 110 | D += 0x00000100 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 111 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 112 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 113 | D += 0x00010000 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 114 | #else |
jmitc91516 | 0:9140ec6aa604 | 115 | #ifdef GuiConst_ICC_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 116 | GuiConst_INT8U PrefixRom * ItemFlashPtr = |
jmitc91516 | 0:9140ec6aa604 | 117 | (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 118 | D = *ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 119 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 120 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 121 | D += 0x00000100 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 122 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 123 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 124 | D += 0x00010000 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 125 | #else |
jmitc91516 | 0:9140ec6aa604 | 126 | #ifdef GuiConst_CODEVISION_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 127 | GuiConst_INT8U PrefixRom * ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 128 | ItemFlashPtr = (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 129 | D = *ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 130 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 131 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 132 | D += 0x00000100 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 133 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 134 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 135 | D += 0x00010000 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 136 | #else |
jmitc91516 | 0:9140ec6aa604 | 137 | D = **ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 138 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 139 | D += 0x00000100 * (GuiConst_INT32U)**ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 140 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 141 | D += 0x00010000 * (GuiConst_INT32U)**ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 142 | #endif |
jmitc91516 | 0:9140ec6aa604 | 143 | #endif |
jmitc91516 | 0:9140ec6aa604 | 144 | #endif |
jmitc91516 | 0:9140ec6aa604 | 145 | #endif |
jmitc91516 | 0:9140ec6aa604 | 146 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 147 | return ((GuiConst_INT32S) D); |
jmitc91516 | 0:9140ec6aa604 | 148 | } |
jmitc91516 | 0:9140ec6aa604 | 149 | #endif |
jmitc91516 | 0:9140ec6aa604 | 150 | |
jmitc91516 | 0:9140ec6aa604 | 151 | #ifdef GuiLib_GETITEMLONG |
jmitc91516 | 0:9140ec6aa604 | 152 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 153 | static GuiConst_INT32S GetItemLong( |
jmitc91516 | 0:9140ec6aa604 | 154 | GuiConst_INT8U *PrefixLocate*PrefixLocate ItemDataPtrPtr) |
jmitc91516 | 0:9140ec6aa604 | 155 | { |
jmitc91516 | 0:9140ec6aa604 | 156 | GuiConst_INT32U D; |
jmitc91516 | 0:9140ec6aa604 | 157 | |
jmitc91516 | 0:9140ec6aa604 | 158 | #ifdef GuiConst_AVRGCC_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 159 | D = ReadBytePtr(*ItemDataPtrPtr); |
jmitc91516 | 0:9140ec6aa604 | 160 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 161 | D += 0x00000100 * (GuiConst_INT32U)ReadBytePtr(*ItemDataPtrPtr); |
jmitc91516 | 0:9140ec6aa604 | 162 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 163 | D += 0x00010000 * (GuiConst_INT32U)ReadBytePtr(*ItemDataPtrPtr); |
jmitc91516 | 0:9140ec6aa604 | 164 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 165 | D += 0x01000000 * (GuiConst_INT32U)ReadBytePtr(*ItemDataPtrPtr); |
jmitc91516 | 0:9140ec6aa604 | 166 | #else |
jmitc91516 | 0:9140ec6aa604 | 167 | #ifdef GuiConst_AVR_COMPILER_FLASH_RAM |
jmitc91516 | 0:9140ec6aa604 | 168 | GuiConst_INT8U PrefixRom * ItemFlashPtr = |
jmitc91516 | 0:9140ec6aa604 | 169 | (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 170 | D = *ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 171 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 172 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 173 | D += 0x00000100 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 174 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 175 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 176 | D += 0x00010000 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 177 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 178 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 179 | D += 0x01000000 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 180 | #else |
jmitc91516 | 0:9140ec6aa604 | 181 | #ifdef GuiConst_ICC_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 182 | GuiConst_INT8U PrefixRom * ItemFlashPtr = |
jmitc91516 | 0:9140ec6aa604 | 183 | (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 184 | D = *ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 185 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 186 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 187 | D += 0x00000100 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 188 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 189 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 190 | D += 0x00010000 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 191 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 192 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 193 | D += 0x01000000 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 194 | #else |
jmitc91516 | 0:9140ec6aa604 | 195 | #ifdef GuiConst_CODEVISION_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 196 | GuiConst_INT8U PrefixRom * ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 197 | ItemFlashPtr = (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 198 | D = *ItemFlashPtr; |
jmitc91516 | 0:9140ec6aa604 | 199 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 200 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 201 | D += 0x00000100 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 202 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 203 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 204 | D += 0x00010000 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 205 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 206 | ItemFlashPtr++; |
jmitc91516 | 0:9140ec6aa604 | 207 | D += 0x01000000 * (*ItemFlashPtr); |
jmitc91516 | 0:9140ec6aa604 | 208 | #else |
jmitc91516 | 0:9140ec6aa604 | 209 | D = **ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 210 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 211 | D += 0x00000100 * (GuiConst_INT32U)**ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 212 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 213 | D += 0x00010000 * (GuiConst_INT32U)**ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 214 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 215 | D += 0x01000000 * (GuiConst_INT32U)**ItemDataPtrPtr; |
jmitc91516 | 0:9140ec6aa604 | 216 | #endif |
jmitc91516 | 0:9140ec6aa604 | 217 | #endif |
jmitc91516 | 0:9140ec6aa604 | 218 | #endif |
jmitc91516 | 0:9140ec6aa604 | 219 | #endif |
jmitc91516 | 0:9140ec6aa604 | 220 | (*ItemDataPtrPtr)++; |
jmitc91516 | 0:9140ec6aa604 | 221 | return ((GuiConst_INT32S) D); |
jmitc91516 | 0:9140ec6aa604 | 222 | } |
jmitc91516 | 0:9140ec6aa604 | 223 | #endif |
jmitc91516 | 0:9140ec6aa604 | 224 | |
jmitc91516 | 0:9140ec6aa604 | 225 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 226 | #ifdef GuiLib_COLOR_BYTESIZE_1 |
jmitc91516 | 0:9140ec6aa604 | 227 | #define GetItemColor GetItemByte |
jmitc91516 | 0:9140ec6aa604 | 228 | #endif |
jmitc91516 | 0:9140ec6aa604 | 229 | #ifdef GuiLib_COLOR_BYTESIZE_2 |
jmitc91516 | 0:9140ec6aa604 | 230 | #define GetItemColor GetItemWord |
jmitc91516 | 0:9140ec6aa604 | 231 | #endif |
jmitc91516 | 0:9140ec6aa604 | 232 | #ifdef GuiLib_COLOR_BYTESIZE_3 |
jmitc91516 | 0:9140ec6aa604 | 233 | #define GetItemColor GetItemTriple |
jmitc91516 | 0:9140ec6aa604 | 234 | #endif |
jmitc91516 | 0:9140ec6aa604 | 235 | |
jmitc91516 | 0:9140ec6aa604 | 236 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 237 | GuiConst_TEXT PrefixGeneric *GetItemTextPtr(GuiConst_INT8U index) |
jmitc91516 | 0:9140ec6aa604 | 238 | { |
jmitc91516 | 0:9140ec6aa604 | 239 | #ifndef GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 240 | #ifdef GuiConst_REMOTE_STRUCT_DATA |
jmitc91516 | 0:9140ec6aa604 | 241 | GuiConst_INT16U TxtReadSize; |
jmitc91516 | 0:9140ec6aa604 | 242 | #endif |
jmitc91516 | 0:9140ec6aa604 | 243 | #endif |
jmitc91516 | 0:9140ec6aa604 | 244 | |
jmitc91516 | 0:9140ec6aa604 | 245 | if (index > 2) |
jmitc91516 | 0:9140ec6aa604 | 246 | return NULL; |
jmitc91516 | 0:9140ec6aa604 | 247 | |
jmitc91516 | 0:9140ec6aa604 | 248 | #ifdef GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 249 | sgl.CurItem.TextLength[index] = GetRemoteText(sgl.CurItem.TextIndex[index]); |
jmitc91516 | 0:9140ec6aa604 | 250 | sgl.CurItem.TextPtr[index] = &sgl.GuiLib_RemoteTextBuffer[0]; |
jmitc91516 | 0:9140ec6aa604 | 251 | |
jmitc91516 | 0:9140ec6aa604 | 252 | #else |
jmitc91516 | 0:9140ec6aa604 | 253 | #ifdef GuiConst_REMOTE_STRUCT_DATA |
jmitc91516 | 0:9140ec6aa604 | 254 | |
jmitc91516 | 0:9140ec6aa604 | 255 | TxtReadSize = sgl.CurItem.TextLength[index] + 1; |
jmitc91516 | 0:9140ec6aa604 | 256 | #ifndef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 257 | TxtReadSize *= 2; |
jmitc91516 | 0:9140ec6aa604 | 258 | #endif |
jmitc91516 | 0:9140ec6aa604 | 259 | |
jmitc91516 | 0:9140ec6aa604 | 260 | GuiLib_RemoteDataReadBlock(sgl.CurItem.TextOffset[index], |
jmitc91516 | 0:9140ec6aa604 | 261 | TxtReadSize, |
jmitc91516 | 0:9140ec6aa604 | 262 | (GuiConst_INT8U PrefixGeneric*)&sgl.GuiLib_RemoteStructText); |
jmitc91516 | 0:9140ec6aa604 | 263 | sgl.CurItem.TextPtr[index] = (GuiConst_TEXT PrefixGeneric*)&sgl.GuiLib_RemoteStructText; |
jmitc91516 | 0:9140ec6aa604 | 264 | #endif |
jmitc91516 | 0:9140ec6aa604 | 265 | #endif // GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 266 | |
jmitc91516 | 0:9140ec6aa604 | 267 | return sgl.CurItem.TextPtr[index]; |
jmitc91516 | 0:9140ec6aa604 | 268 | |
jmitc91516 | 0:9140ec6aa604 | 269 | |
jmitc91516 | 0:9140ec6aa604 | 270 | } |
jmitc91516 | 0:9140ec6aa604 | 271 | |
jmitc91516 | 0:9140ec6aa604 | 272 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 273 | #ifdef GuiConst_ITEM_RADIOBUTTON_INUSE |
jmitc91516 | 0:9140ec6aa604 | 274 | #define GuiItem_TEMP_PTR_NEEDED |
jmitc91516 | 0:9140ec6aa604 | 275 | #endif |
jmitc91516 | 0:9140ec6aa604 | 276 | #ifdef GuiConst_ITEM_BUTTON_INUSE |
jmitc91516 | 0:9140ec6aa604 | 277 | #ifndef GuiItem_TEMP_PTR_NEEDED |
jmitc91516 | 0:9140ec6aa604 | 278 | #define GuiItem_TEMP_PTR_NEEDED |
jmitc91516 | 0:9140ec6aa604 | 279 | #endif |
jmitc91516 | 0:9140ec6aa604 | 280 | #endif |
jmitc91516 | 0:9140ec6aa604 | 281 | #ifdef GuiConst_ITEM_CHECKBOX_INUSE |
jmitc91516 | 0:9140ec6aa604 | 282 | #ifndef GuiItem_TEMP_PTR_NEEDED |
jmitc91516 | 0:9140ec6aa604 | 283 | #define GuiItem_TEMP_PTR_NEEDED |
jmitc91516 | 0:9140ec6aa604 | 284 | #endif |
jmitc91516 | 0:9140ec6aa604 | 285 | #endif |
jmitc91516 | 0:9140ec6aa604 | 286 | |
jmitc91516 | 0:9140ec6aa604 | 287 | static void DrawItem( |
jmitc91516 | 0:9140ec6aa604 | 288 | GuiConst_INT8U ColorInvert) |
jmitc91516 | 0:9140ec6aa604 | 289 | { |
jmitc91516 | 0:9140ec6aa604 | 290 | GuiConst_INT16U StructToCallIndex; |
jmitc91516 | 0:9140ec6aa604 | 291 | GuiConst_INT32S VarValue; |
jmitc91516 | 0:9140ec6aa604 | 292 | GuiConst_INT16S I, N; |
jmitc91516 | 0:9140ec6aa604 | 293 | #ifdef GuiConst_ITEM_CHECKBOX_INUSE |
jmitc91516 | 0:9140ec6aa604 | 294 | GuiConst_INT8U CheckmarkMode; |
jmitc91516 | 0:9140ec6aa604 | 295 | #endif |
jmitc91516 | 0:9140ec6aa604 | 296 | #ifdef GuiConst_ITEM_RADIOBUTTON_INUSE |
jmitc91516 | 0:9140ec6aa604 | 297 | GuiConst_INT16S RemYMemory; |
jmitc91516 | 0:9140ec6aa604 | 298 | #endif |
jmitc91516 | 0:9140ec6aa604 | 299 | #ifdef GuiConst_ITEM_BUTTON_INUSE |
jmitc91516 | 0:9140ec6aa604 | 300 | GuiConst_INT8U DisabledGlyphColorInUse; |
jmitc91516 | 0:9140ec6aa604 | 301 | GuiConst_INT8U DisabledTextColorInUse; |
jmitc91516 | 0:9140ec6aa604 | 302 | GuiConst_INT16S CX, CY; |
jmitc91516 | 0:9140ec6aa604 | 303 | GuiConst_INT16S RemX1, RemY1; |
jmitc91516 | 0:9140ec6aa604 | 304 | GuiConst_INT16S GX1, GX2, GY1, GY2; |
jmitc91516 | 0:9140ec6aa604 | 305 | GuiConst_INTCOLOR ButtonColor; |
jmitc91516 | 0:9140ec6aa604 | 306 | #ifdef GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 307 | GuiConst_INT16S RemClippingX1, RemClippingY1, RemClippingX2, RemClippingY2; |
jmitc91516 | 0:9140ec6aa604 | 308 | #endif // GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 309 | #endif |
jmitc91516 | 0:9140ec6aa604 | 310 | GuiConst_INT16U StrLen; |
jmitc91516 | 0:9140ec6aa604 | 311 | #ifdef GuiItem_TEMP_PTR_NEEDED |
jmitc91516 | 0:9140ec6aa604 | 312 | TextParRec TempTextPar; |
jmitc91516 | 0:9140ec6aa604 | 313 | #endif |
jmitc91516 | 0:9140ec6aa604 | 314 | #ifdef GuiConst_CURSOR_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 315 | GuiConst_INT8U IsCursorField; |
jmitc91516 | 0:9140ec6aa604 | 316 | GuiConst_INT8U FoundActiveCursorField; |
jmitc91516 | 0:9140ec6aa604 | 317 | #endif |
jmitc91516 | 0:9140ec6aa604 | 318 | GuiConst_INTCOLOR ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 319 | GuiConst_INTCOLOR BackColor; |
jmitc91516 | 0:9140ec6aa604 | 320 | GuiConst_INT8U BackColorTransp; |
jmitc91516 | 0:9140ec6aa604 | 321 | GuiConst_INT32S BackColor2; |
jmitc91516 | 0:9140ec6aa604 | 322 | #ifndef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 323 | GuiConst_INT16U P; |
jmitc91516 | 0:9140ec6aa604 | 324 | #endif |
jmitc91516 | 0:9140ec6aa604 | 325 | GuiConst_TEXT PrefixGeneric *CharPtr; |
jmitc91516 | 0:9140ec6aa604 | 326 | GuiConst_INT16S X1, X2, Y1, Y2; |
jmitc91516 | 0:9140ec6aa604 | 327 | #ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE |
jmitc91516 | 0:9140ec6aa604 | 328 | GuiConst_INT16S CX1, CX2, CY1, CY2; |
jmitc91516 | 0:9140ec6aa604 | 329 | GuiConst_INT16S Y; |
jmitc91516 | 0:9140ec6aa604 | 330 | GuiConst_INT16S SourceLayerIndexNo; |
jmitc91516 | 0:9140ec6aa604 | 331 | GuiConst_INT16S DestLayerIndexNo; |
jmitc91516 | 0:9140ec6aa604 | 332 | GuiConst_INT8U PrefixLocate *DestAddress; |
jmitc91516 | 0:9140ec6aa604 | 333 | GuiConst_INT16U DestLineSize; |
jmitc91516 | 0:9140ec6aa604 | 334 | GuiConst_INT16S DestX; |
jmitc91516 | 0:9140ec6aa604 | 335 | GuiConst_INT16S DestY; |
jmitc91516 | 0:9140ec6aa604 | 336 | GuiConst_INT16U DestWidth; |
jmitc91516 | 0:9140ec6aa604 | 337 | GuiConst_INT16U DestHeight; |
jmitc91516 | 0:9140ec6aa604 | 338 | GuiConst_INT8U PrefixLocate *SourceAddress; |
jmitc91516 | 0:9140ec6aa604 | 339 | GuiConst_INT16U SourceLineSize; |
jmitc91516 | 0:9140ec6aa604 | 340 | GuiConst_INT16S SourceX; |
jmitc91516 | 0:9140ec6aa604 | 341 | GuiConst_INT16S SourceY; |
jmitc91516 | 0:9140ec6aa604 | 342 | GuiConst_INT16U SourceWidth; |
jmitc91516 | 0:9140ec6aa604 | 343 | GuiConst_INT16U SourceHeight; |
jmitc91516 | 0:9140ec6aa604 | 344 | GuiConst_INT32S FilterPars[10]; |
jmitc91516 | 0:9140ec6aa604 | 345 | #endif |
jmitc91516 | 0:9140ec6aa604 | 346 | #ifdef GuiConst_ITEM_STRUCTCOND_INUSE |
jmitc91516 | 0:9140ec6aa604 | 347 | GuiConst_INT8U FirstRound; |
jmitc91516 | 0:9140ec6aa604 | 348 | #endif |
jmitc91516 | 0:9140ec6aa604 | 349 | #ifdef GuiConst_ITEM_TOUCHAREA_INUSE |
jmitc91516 | 0:9140ec6aa604 | 350 | GuiConst_INT32S TouchSearch; |
jmitc91516 | 0:9140ec6aa604 | 351 | GuiConst_INT32S TouchIndex; |
jmitc91516 | 0:9140ec6aa604 | 352 | #endif |
jmitc91516 | 0:9140ec6aa604 | 353 | #ifdef GuiConst_TEXTBOX_FIELDS_ON |
jmitc91516 | 0:9140ec6aa604 | 354 | GuiConst_INT16S found; |
jmitc91516 | 0:9140ec6aa604 | 355 | GuiConst_INT16S PrefixLocate *ScrollPos; |
jmitc91516 | 0:9140ec6aa604 | 356 | #endif |
jmitc91516 | 0:9140ec6aa604 | 357 | |
jmitc91516 | 0:9140ec6aa604 | 358 | #ifdef GuiConst_REL_COORD_ORIGO_INUSE |
jmitc91516 | 0:9140ec6aa604 | 359 | if (!sgl.InitialDrawing) |
jmitc91516 | 0:9140ec6aa604 | 360 | { |
jmitc91516 | 0:9140ec6aa604 | 361 | sgl.CoordOrigoX = sgl.CurItem.CoordOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 362 | sgl.CoordOrigoY = sgl.CurItem.CoordOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 363 | } |
jmitc91516 | 0:9140ec6aa604 | 364 | #endif |
jmitc91516 | 0:9140ec6aa604 | 365 | #ifdef GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 366 | if (!sgl.InitialDrawing && sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 367 | GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1, |
jmitc91516 | 0:9140ec6aa604 | 368 | sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2); |
jmitc91516 | 0:9140ec6aa604 | 369 | #endif |
jmitc91516 | 0:9140ec6aa604 | 370 | |
jmitc91516 | 0:9140ec6aa604 | 371 | SetCurFont(sgl.CurItem.TextPar[0].FontIndex); |
jmitc91516 | 0:9140ec6aa604 | 372 | |
jmitc91516 | 0:9140ec6aa604 | 373 | #ifdef GuiConst_CURSOR_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 374 | IsCursorField = (sgl.CursorInUse && (sgl.CurItem.CursorFieldNo >= 0)); |
jmitc91516 | 0:9140ec6aa604 | 375 | FoundActiveCursorField = |
jmitc91516 | 0:9140ec6aa604 | 376 | (IsCursorField && (GuiLib_ActiveCursorFieldNo == sgl.CurItem.CursorFieldNo)); |
jmitc91516 | 0:9140ec6aa604 | 377 | if (FoundActiveCursorField) |
jmitc91516 | 0:9140ec6aa604 | 378 | sgl.CursorActiveFieldFound = 1; |
jmitc91516 | 0:9140ec6aa604 | 379 | #endif |
jmitc91516 | 0:9140ec6aa604 | 380 | |
jmitc91516 | 0:9140ec6aa604 | 381 | sgl.AutoRedrawSaveIndex = -1; |
jmitc91516 | 0:9140ec6aa604 | 382 | |
jmitc91516 | 0:9140ec6aa604 | 383 | if ((sgl.InitialDrawing) || (sgl.AutoRedrawUpdate == GuiLib_TRUE)) |
jmitc91516 | 0:9140ec6aa604 | 384 | { |
jmitc91516 | 0:9140ec6aa604 | 385 | #ifdef GuiConst_CURSOR_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 386 | if ((sgl.CurItem.CursorFieldNo >= 0) && (sgl.CursorFieldFound == -1)) |
jmitc91516 | 0:9140ec6aa604 | 387 | sgl.CursorFieldFound = sgl.CurItem.CursorFieldNo; |
jmitc91516 | 0:9140ec6aa604 | 388 | |
jmitc91516 | 0:9140ec6aa604 | 389 | if (IsCursorField) |
jmitc91516 | 0:9140ec6aa604 | 390 | { |
jmitc91516 | 0:9140ec6aa604 | 391 | sgl.CurItem.CursorFieldLevel++; |
jmitc91516 | 0:9140ec6aa604 | 392 | |
jmitc91516 | 0:9140ec6aa604 | 393 | #ifdef GuiConst_ITEM_SCROLLBOX_INUSE |
jmitc91516 | 0:9140ec6aa604 | 394 | if (sgl.NextScrollLineReading) |
jmitc91516 | 0:9140ec6aa604 | 395 | { |
jmitc91516 | 0:9140ec6aa604 | 396 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FIELDSCROLLBOX; |
jmitc91516 | 0:9140ec6aa604 | 397 | sgl.CurItem.CursorScrollBoxIndex = sgl.GlobalScrollBoxIndex; |
jmitc91516 | 0:9140ec6aa604 | 398 | } |
jmitc91516 | 0:9140ec6aa604 | 399 | else |
jmitc91516 | 0:9140ec6aa604 | 400 | #endif |
jmitc91516 | 0:9140ec6aa604 | 401 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_FIELDSCROLLBOX; |
jmitc91516 | 0:9140ec6aa604 | 402 | |
jmitc91516 | 0:9140ec6aa604 | 403 | #ifndef GuiConst_CURSOR_FIELDS_OFF |
jmitc91516 | 0:9140ec6aa604 | 404 | if (!(sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_AUTOREDRAWFIELD)) |
jmitc91516 | 0:9140ec6aa604 | 405 | sgl.AutoRedrawSaveIndex = AutoRedraw_InsertCursor(&sgl.CurItem, 0, sgl.DisplayLevel); |
jmitc91516 | 0:9140ec6aa604 | 406 | #endif |
jmitc91516 | 0:9140ec6aa604 | 407 | } |
jmitc91516 | 0:9140ec6aa604 | 408 | #endif // GuiConst_CURSOR_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 409 | |
jmitc91516 | 0:9140ec6aa604 | 410 | if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_AUTOREDRAWFIELD) |
jmitc91516 | 0:9140ec6aa604 | 411 | { |
jmitc91516 | 0:9140ec6aa604 | 412 | sgl.AutoRedrawSaveIndex = AutoRedraw_Insert(&sgl.CurItem, 0, sgl.DisplayLevel); |
jmitc91516 | 0:9140ec6aa604 | 413 | |
jmitc91516 | 0:9140ec6aa604 | 414 | #ifdef GuiConst_CURSOR_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 415 | if (IsCursorField) |
jmitc91516 | 0:9140ec6aa604 | 416 | AutoRedraw_SetAsCursor(sgl.AutoRedrawSaveIndex); |
jmitc91516 | 0:9140ec6aa604 | 417 | #endif // GuiConst_CURSOR_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 418 | } |
jmitc91516 | 0:9140ec6aa604 | 419 | } |
jmitc91516 | 0:9140ec6aa604 | 420 | |
jmitc91516 | 0:9140ec6aa604 | 421 | switch (ColorInvert) |
jmitc91516 | 0:9140ec6aa604 | 422 | { |
jmitc91516 | 0:9140ec6aa604 | 423 | case GuiLib_COL_INVERT_OFF: |
jmitc91516 | 0:9140ec6aa604 | 424 | sgl.SwapColors = 0; |
jmitc91516 | 0:9140ec6aa604 | 425 | break; |
jmitc91516 | 0:9140ec6aa604 | 426 | |
jmitc91516 | 0:9140ec6aa604 | 427 | case GuiLib_COL_INVERT_ON: |
jmitc91516 | 0:9140ec6aa604 | 428 | sgl.SwapColors = 1; |
jmitc91516 | 0:9140ec6aa604 | 429 | break; |
jmitc91516 | 0:9140ec6aa604 | 430 | |
jmitc91516 | 0:9140ec6aa604 | 431 | case GuiLib_COL_INVERT_IF_CURSOR: |
jmitc91516 | 0:9140ec6aa604 | 432 | #ifdef GuiConst_CURSOR_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 433 | if (FoundActiveCursorField) |
jmitc91516 | 0:9140ec6aa604 | 434 | sgl.SwapColors = 1; |
jmitc91516 | 0:9140ec6aa604 | 435 | #else |
jmitc91516 | 0:9140ec6aa604 | 436 | sgl.SwapColors = 0; |
jmitc91516 | 0:9140ec6aa604 | 437 | #endif |
jmitc91516 | 0:9140ec6aa604 | 438 | break; |
jmitc91516 | 0:9140ec6aa604 | 439 | } |
jmitc91516 | 0:9140ec6aa604 | 440 | if (sgl.SwapColors) |
jmitc91516 | 0:9140ec6aa604 | 441 | { |
jmitc91516 | 0:9140ec6aa604 | 442 | ForeColor = sgl.CurItem.BarForeColor; |
jmitc91516 | 0:9140ec6aa604 | 443 | BackColor = sgl.CurItem.BarBackColor; |
jmitc91516 | 0:9140ec6aa604 | 444 | BackColorTransp = |
jmitc91516 | 0:9140ec6aa604 | 445 | ((sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_BARTRANSPARENT) > 0); |
jmitc91516 | 0:9140ec6aa604 | 446 | } |
jmitc91516 | 0:9140ec6aa604 | 447 | else |
jmitc91516 | 0:9140ec6aa604 | 448 | { |
jmitc91516 | 0:9140ec6aa604 | 449 | ForeColor = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 450 | BackColor = sgl.CurItem.BackColor; |
jmitc91516 | 0:9140ec6aa604 | 451 | BackColorTransp = |
jmitc91516 | 0:9140ec6aa604 | 452 | ((sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_TRANSPARENT) > 0); |
jmitc91516 | 0:9140ec6aa604 | 453 | } |
jmitc91516 | 0:9140ec6aa604 | 454 | |
jmitc91516 | 0:9140ec6aa604 | 455 | sgl.CurItem.Drawn = 0; |
jmitc91516 | 0:9140ec6aa604 | 456 | switch (sgl.CurItem.ItemType) |
jmitc91516 | 0:9140ec6aa604 | 457 | { |
jmitc91516 | 0:9140ec6aa604 | 458 | case GuiLib_ITEM_CLEARAREA: |
jmitc91516 | 0:9140ec6aa604 | 459 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 460 | { |
jmitc91516 | 0:9140ec6aa604 | 461 | X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 462 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 463 | X2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 464 | Y2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 465 | OrderCoord(&X1, &X2); |
jmitc91516 | 0:9140ec6aa604 | 466 | OrderCoord(&Y1, &Y2); |
jmitc91516 | 0:9140ec6aa604 | 467 | if (!BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 468 | GuiLib_FillBox(X1, Y1, X2, Y2, BackColor); |
jmitc91516 | 0:9140ec6aa604 | 469 | UpdateDrawLimits(X1, Y1, X2, Y2); |
jmitc91516 | 0:9140ec6aa604 | 470 | } |
jmitc91516 | 0:9140ec6aa604 | 471 | |
jmitc91516 | 0:9140ec6aa604 | 472 | break; |
jmitc91516 | 0:9140ec6aa604 | 473 | |
jmitc91516 | 0:9140ec6aa604 | 474 | case GuiLib_ITEM_TEXT: |
jmitc91516 | 0:9140ec6aa604 | 475 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 476 | { |
jmitc91516 | 0:9140ec6aa604 | 477 | if (sgl.CurItem.TextPar[0].BackBoxSizeX > 0) |
jmitc91516 | 0:9140ec6aa604 | 478 | { |
jmitc91516 | 0:9140ec6aa604 | 479 | DrawBackBox(BackColor, BackColorTransp, 0); |
jmitc91516 | 0:9140ec6aa604 | 480 | UpdateDrawLimits(sgl.BbX1, sgl.BbY1, sgl.BbX2, sgl.BbY2); |
jmitc91516 | 0:9140ec6aa604 | 481 | } |
jmitc91516 | 0:9140ec6aa604 | 482 | |
jmitc91516 | 0:9140ec6aa604 | 483 | DRAW_ROM_TEXT(GetItemTextPtr(0), |
jmitc91516 | 0:9140ec6aa604 | 484 | sgl.CurItem.TextLength[0], |
jmitc91516 | 0:9140ec6aa604 | 485 | 0, |
jmitc91516 | 0:9140ec6aa604 | 486 | ForeColor, |
jmitc91516 | 0:9140ec6aa604 | 487 | BackColor, |
jmitc91516 | 0:9140ec6aa604 | 488 | BackColorTransp); |
jmitc91516 | 0:9140ec6aa604 | 489 | |
jmitc91516 | 0:9140ec6aa604 | 490 | UpdateDrawLimits(sgl.FontWriteX1, sgl.FontWriteY1, sgl.FontWriteX2, sgl.FontWriteY2); |
jmitc91516 | 0:9140ec6aa604 | 491 | } |
jmitc91516 | 0:9140ec6aa604 | 492 | |
jmitc91516 | 0:9140ec6aa604 | 493 | break; |
jmitc91516 | 0:9140ec6aa604 | 494 | |
jmitc91516 | 0:9140ec6aa604 | 495 | case GuiLib_ITEM_TEXTBLOCK: |
jmitc91516 | 0:9140ec6aa604 | 496 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 497 | { |
jmitc91516 | 0:9140ec6aa604 | 498 | #ifdef GuiConst_ITEM_TEXTBLOCK_INUSE |
jmitc91516 | 0:9140ec6aa604 | 499 | #ifdef GuiConst_TEXTBOX_FIELDS_ON |
jmitc91516 | 0:9140ec6aa604 | 500 | ScrollPos = TextBox_Scroll_GetPosRec( |
jmitc91516 | 0:9140ec6aa604 | 501 | sgl.CurItem.CompPars.CompTextBox.ScrollIndex); |
jmitc91516 | 0:9140ec6aa604 | 502 | |
jmitc91516 | 0:9140ec6aa604 | 503 | if (ScrollPos != NULL) |
jmitc91516 | 0:9140ec6aa604 | 504 | sgl.CurItem.CompPars.CompTextBox.ScrollPos = *ScrollPos; |
jmitc91516 | 0:9140ec6aa604 | 505 | #endif |
jmitc91516 | 0:9140ec6aa604 | 506 | DRAW_ROM_TEXTBLOCK(GetItemTextPtr(0), |
jmitc91516 | 0:9140ec6aa604 | 507 | sgl.CurItem.TextLength[0], |
jmitc91516 | 0:9140ec6aa604 | 508 | 0, |
jmitc91516 | 0:9140ec6aa604 | 509 | ForeColor, |
jmitc91516 | 0:9140ec6aa604 | 510 | BackColor, |
jmitc91516 | 0:9140ec6aa604 | 511 | BackColorTransp); |
jmitc91516 | 0:9140ec6aa604 | 512 | |
jmitc91516 | 0:9140ec6aa604 | 513 | #ifdef GuiConst_TEXTBOX_FIELDS_ON |
jmitc91516 | 0:9140ec6aa604 | 514 | if (ScrollPos != NULL) |
jmitc91516 | 0:9140ec6aa604 | 515 | *ScrollPos = sgl.CurItem.CompPars.CompTextBox.ScrollPos; |
jmitc91516 | 0:9140ec6aa604 | 516 | #endif |
jmitc91516 | 0:9140ec6aa604 | 517 | |
jmitc91516 | 0:9140ec6aa604 | 518 | UpdateDrawLimits(sgl.CurItem.X1, sgl.CurItem.Y1, sgl.CurItem.X2, sgl.CurItem.Y2); |
jmitc91516 | 0:9140ec6aa604 | 519 | #endif |
jmitc91516 | 0:9140ec6aa604 | 520 | } |
jmitc91516 | 0:9140ec6aa604 | 521 | |
jmitc91516 | 0:9140ec6aa604 | 522 | break; |
jmitc91516 | 0:9140ec6aa604 | 523 | |
jmitc91516 | 0:9140ec6aa604 | 524 | case GuiLib_ITEM_VAR: |
jmitc91516 | 0:9140ec6aa604 | 525 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 526 | { |
jmitc91516 | 0:9140ec6aa604 | 527 | #ifdef GuiConst_DISP_VAR_NOW |
jmitc91516 | 0:9140ec6aa604 | 528 | displayVarNow = 1; |
jmitc91516 | 0:9140ec6aa604 | 529 | #endif |
jmitc91516 | 0:9140ec6aa604 | 530 | |
jmitc91516 | 0:9140ec6aa604 | 531 | if (sgl.CurItem.TextPar[0].BackBoxSizeX > 0) |
jmitc91516 | 0:9140ec6aa604 | 532 | { |
jmitc91516 | 0:9140ec6aa604 | 533 | DrawBackBox(BackColor, BackColorTransp, 0); |
jmitc91516 | 0:9140ec6aa604 | 534 | UpdateDrawLimits(sgl.BbX1, sgl.BbY1, sgl.BbX2, sgl.BbY2); |
jmitc91516 | 0:9140ec6aa604 | 535 | } |
jmitc91516 | 0:9140ec6aa604 | 536 | |
jmitc91516 | 0:9140ec6aa604 | 537 | if (sgl.CurItem.VarPtr != 0) |
jmitc91516 | 0:9140ec6aa604 | 538 | { |
jmitc91516 | 0:9140ec6aa604 | 539 | if (sgl.CurItem.VarType == GuiLib_VAR_STRING) |
jmitc91516 | 0:9140ec6aa604 | 540 | { |
jmitc91516 | 0:9140ec6aa604 | 541 | CharPtr = (GuiConst_TEXT PrefixGeneric *)sgl.CurItem.VarPtr; |
jmitc91516 | 0:9140ec6aa604 | 542 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 543 | StrLen = strlen(CharPtr); |
jmitc91516 | 0:9140ec6aa604 | 544 | #else |
jmitc91516 | 0:9140ec6aa604 | 545 | #ifdef GuiConst_CODEVISION_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 546 | StrLen = GuiLib_UnicodeStrLen((GuiConst_TEXT*)CharPtr); |
jmitc91516 | 0:9140ec6aa604 | 547 | #else |
jmitc91516 | 0:9140ec6aa604 | 548 | StrLen = GuiLib_UnicodeStrLen(CharPtr); |
jmitc91516 | 0:9140ec6aa604 | 549 | #endif |
jmitc91516 | 0:9140ec6aa604 | 550 | #endif |
jmitc91516 | 0:9140ec6aa604 | 551 | } |
jmitc91516 | 0:9140ec6aa604 | 552 | else |
jmitc91516 | 0:9140ec6aa604 | 553 | { |
jmitc91516 | 0:9140ec6aa604 | 554 | VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType); |
jmitc91516 | 0:9140ec6aa604 | 555 | StrLen = DataNumStr(VarValue, sgl.CurItem.VarType, 0); |
jmitc91516 | 0:9140ec6aa604 | 556 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 557 | CharPtr = (GuiConst_TEXT PrefixGeneric *) sgl.VarNumTextStr; |
jmitc91516 | 0:9140ec6aa604 | 558 | #else |
jmitc91516 | 0:9140ec6aa604 | 559 | for (P = 0; P <= StrLen; P++) |
jmitc91516 | 0:9140ec6aa604 | 560 | sgl.VarNumUnicodeTextStr[P] = sgl.VarNumTextStr[P]; |
jmitc91516 | 0:9140ec6aa604 | 561 | CharPtr = (GuiConst_TEXT PrefixGeneric *) sgl.VarNumUnicodeTextStr; |
jmitc91516 | 0:9140ec6aa604 | 562 | #endif |
jmitc91516 | 0:9140ec6aa604 | 563 | } |
jmitc91516 | 0:9140ec6aa604 | 564 | |
jmitc91516 | 0:9140ec6aa604 | 565 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 566 | strcpy(sgl.AnsiTextBuf, CharPtr); |
jmitc91516 | 0:9140ec6aa604 | 567 | DrawText(sgl.AnsiTextBuf, |
jmitc91516 | 0:9140ec6aa604 | 568 | StrLen, |
jmitc91516 | 0:9140ec6aa604 | 569 | 0, |
jmitc91516 | 0:9140ec6aa604 | 570 | ForeColor, |
jmitc91516 | 0:9140ec6aa604 | 571 | BackColor, |
jmitc91516 | 0:9140ec6aa604 | 572 | BackColorTransp); |
jmitc91516 | 0:9140ec6aa604 | 573 | #else |
jmitc91516 | 0:9140ec6aa604 | 574 | GuiLib_UnicodeStrCpy(sgl.UnicodeTextBuf, CharPtr); |
jmitc91516 | 0:9140ec6aa604 | 575 | DrawText(sgl.UnicodeTextBuf, |
jmitc91516 | 0:9140ec6aa604 | 576 | StrLen, |
jmitc91516 | 0:9140ec6aa604 | 577 | 0, |
jmitc91516 | 0:9140ec6aa604 | 578 | ForeColor, |
jmitc91516 | 0:9140ec6aa604 | 579 | BackColor, |
jmitc91516 | 0:9140ec6aa604 | 580 | BackColorTransp); |
jmitc91516 | 0:9140ec6aa604 | 581 | #endif |
jmitc91516 | 0:9140ec6aa604 | 582 | } |
jmitc91516 | 0:9140ec6aa604 | 583 | |
jmitc91516 | 0:9140ec6aa604 | 584 | #ifdef GuiConst_DISP_VAR_NOW |
jmitc91516 | 0:9140ec6aa604 | 585 | displayVarNow = 0; |
jmitc91516 | 0:9140ec6aa604 | 586 | #endif |
jmitc91516 | 0:9140ec6aa604 | 587 | |
jmitc91516 | 0:9140ec6aa604 | 588 | UpdateDrawLimits(sgl.FontWriteX1, sgl.FontWriteY1, sgl.FontWriteX2, sgl.FontWriteY2); |
jmitc91516 | 0:9140ec6aa604 | 589 | } |
jmitc91516 | 0:9140ec6aa604 | 590 | |
jmitc91516 | 0:9140ec6aa604 | 591 | break; |
jmitc91516 | 0:9140ec6aa604 | 592 | |
jmitc91516 | 0:9140ec6aa604 | 593 | case GuiLib_ITEM_VARBLOCK: |
jmitc91516 | 0:9140ec6aa604 | 594 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 595 | { |
jmitc91516 | 0:9140ec6aa604 | 596 | #ifdef GuiConst_ITEM_TEXTBLOCK_INUSE |
jmitc91516 | 0:9140ec6aa604 | 597 | #ifdef GuiConst_DISP_VAR_NOW |
jmitc91516 | 0:9140ec6aa604 | 598 | displayVarNow = 1; |
jmitc91516 | 0:9140ec6aa604 | 599 | #endif |
jmitc91516 | 0:9140ec6aa604 | 600 | |
jmitc91516 | 0:9140ec6aa604 | 601 | if (sgl.CurItem.VarPtr != 0) |
jmitc91516 | 0:9140ec6aa604 | 602 | { |
jmitc91516 | 0:9140ec6aa604 | 603 | if (sgl.CurItem.VarType == GuiLib_VAR_STRING) |
jmitc91516 | 0:9140ec6aa604 | 604 | { |
jmitc91516 | 0:9140ec6aa604 | 605 | CharPtr = (GuiConst_TEXT PrefixGeneric *)sgl.CurItem.VarPtr; |
jmitc91516 | 0:9140ec6aa604 | 606 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 607 | StrLen = strlen(CharPtr); |
jmitc91516 | 0:9140ec6aa604 | 608 | #else |
jmitc91516 | 0:9140ec6aa604 | 609 | #ifdef GuiConst_CODEVISION_COMPILER |
jmitc91516 | 0:9140ec6aa604 | 610 | StrLen = GuiLib_UnicodeStrLen((GuiConst_TEXT*)CharPtr); |
jmitc91516 | 0:9140ec6aa604 | 611 | #else |
jmitc91516 | 0:9140ec6aa604 | 612 | StrLen = GuiLib_UnicodeStrLen(CharPtr); |
jmitc91516 | 0:9140ec6aa604 | 613 | #endif |
jmitc91516 | 0:9140ec6aa604 | 614 | #endif |
jmitc91516 | 0:9140ec6aa604 | 615 | } |
jmitc91516 | 0:9140ec6aa604 | 616 | else |
jmitc91516 | 0:9140ec6aa604 | 617 | { |
jmitc91516 | 0:9140ec6aa604 | 618 | VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType); |
jmitc91516 | 0:9140ec6aa604 | 619 | StrLen = DataNumStr(VarValue, sgl.CurItem.VarType, 0); |
jmitc91516 | 0:9140ec6aa604 | 620 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 621 | CharPtr = (GuiConst_TEXT PrefixGeneric *) sgl.VarNumTextStr; |
jmitc91516 | 0:9140ec6aa604 | 622 | #else |
jmitc91516 | 0:9140ec6aa604 | 623 | for (P = 0; P <= StrLen; P++) |
jmitc91516 | 0:9140ec6aa604 | 624 | sgl.VarNumUnicodeTextStr[P] = sgl.VarNumTextStr[P]; |
jmitc91516 | 0:9140ec6aa604 | 625 | CharPtr = (GuiConst_TEXT PrefixGeneric *) sgl.VarNumUnicodeTextStr; |
jmitc91516 | 0:9140ec6aa604 | 626 | #endif |
jmitc91516 | 0:9140ec6aa604 | 627 | } |
jmitc91516 | 0:9140ec6aa604 | 628 | #ifdef GuiConst_TEXTBOX_FIELDS_ON |
jmitc91516 | 0:9140ec6aa604 | 629 | ScrollPos = TextBox_Scroll_GetPosRec( |
jmitc91516 | 0:9140ec6aa604 | 630 | sgl.CurItem.CompPars.CompTextBox.ScrollIndex); |
jmitc91516 | 0:9140ec6aa604 | 631 | |
jmitc91516 | 0:9140ec6aa604 | 632 | if (ScrollPos != NULL) |
jmitc91516 | 0:9140ec6aa604 | 633 | sgl.CurItem.CompPars.CompTextBox.ScrollPos = *ScrollPos; |
jmitc91516 | 0:9140ec6aa604 | 634 | #endif |
jmitc91516 | 0:9140ec6aa604 | 635 | |
jmitc91516 | 0:9140ec6aa604 | 636 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 637 | strcpy(sgl.AnsiTextBuf, CharPtr); |
jmitc91516 | 0:9140ec6aa604 | 638 | DrawTextBlock(sgl.AnsiTextBuf, |
jmitc91516 | 0:9140ec6aa604 | 639 | StrLen, |
jmitc91516 | 0:9140ec6aa604 | 640 | 0, |
jmitc91516 | 0:9140ec6aa604 | 641 | ForeColor, |
jmitc91516 | 0:9140ec6aa604 | 642 | BackColor, |
jmitc91516 | 0:9140ec6aa604 | 643 | BackColorTransp); |
jmitc91516 | 0:9140ec6aa604 | 644 | #else |
jmitc91516 | 0:9140ec6aa604 | 645 | GuiLib_UnicodeStrCpy(sgl.UnicodeTextBuf, CharPtr); |
jmitc91516 | 0:9140ec6aa604 | 646 | DrawTextBlock(sgl.UnicodeTextBuf, |
jmitc91516 | 0:9140ec6aa604 | 647 | StrLen, |
jmitc91516 | 0:9140ec6aa604 | 648 | 0, |
jmitc91516 | 0:9140ec6aa604 | 649 | ForeColor, |
jmitc91516 | 0:9140ec6aa604 | 650 | BackColor, |
jmitc91516 | 0:9140ec6aa604 | 651 | BackColorTransp); |
jmitc91516 | 0:9140ec6aa604 | 652 | #endif |
jmitc91516 | 0:9140ec6aa604 | 653 | |
jmitc91516 | 0:9140ec6aa604 | 654 | #ifdef GuiConst_TEXTBOX_FIELDS_ON |
jmitc91516 | 0:9140ec6aa604 | 655 | if (ScrollPos != NULL) |
jmitc91516 | 0:9140ec6aa604 | 656 | *ScrollPos = sgl.CurItem.CompPars.CompTextBox.ScrollPos; |
jmitc91516 | 0:9140ec6aa604 | 657 | #endif |
jmitc91516 | 0:9140ec6aa604 | 658 | |
jmitc91516 | 0:9140ec6aa604 | 659 | } |
jmitc91516 | 0:9140ec6aa604 | 660 | |
jmitc91516 | 0:9140ec6aa604 | 661 | #ifdef GuiConst_DISP_VAR_NOW |
jmitc91516 | 0:9140ec6aa604 | 662 | displayVarNow = 0; |
jmitc91516 | 0:9140ec6aa604 | 663 | #endif |
jmitc91516 | 0:9140ec6aa604 | 664 | |
jmitc91516 | 0:9140ec6aa604 | 665 | UpdateDrawLimits(sgl.CurItem.X1, sgl.CurItem.Y1, sgl.CurItem.X2, sgl.CurItem.Y2); |
jmitc91516 | 0:9140ec6aa604 | 666 | #endif |
jmitc91516 | 0:9140ec6aa604 | 667 | } |
jmitc91516 | 0:9140ec6aa604 | 668 | |
jmitc91516 | 0:9140ec6aa604 | 669 | break; |
jmitc91516 | 0:9140ec6aa604 | 670 | |
jmitc91516 | 0:9140ec6aa604 | 671 | case GuiLib_ITEM_DOT: |
jmitc91516 | 0:9140ec6aa604 | 672 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 673 | { |
jmitc91516 | 0:9140ec6aa604 | 674 | GuiLib_Dot(sgl.CurItem.X1, sgl.CurItem.Y1, ForeColor); |
jmitc91516 | 0:9140ec6aa604 | 675 | UpdateDrawLimits(sgl.CurItem.X1, sgl.CurItem.Y1, sgl.CurItem.X1, sgl.CurItem.Y1); |
jmitc91516 | 0:9140ec6aa604 | 676 | } |
jmitc91516 | 0:9140ec6aa604 | 677 | |
jmitc91516 | 0:9140ec6aa604 | 678 | break; |
jmitc91516 | 0:9140ec6aa604 | 679 | |
jmitc91516 | 0:9140ec6aa604 | 680 | case GuiLib_ITEM_LINE: |
jmitc91516 | 0:9140ec6aa604 | 681 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 682 | { |
jmitc91516 | 0:9140ec6aa604 | 683 | X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 684 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 685 | X2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 686 | Y2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 687 | if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_PATTERNEDLINE) |
jmitc91516 | 0:9140ec6aa604 | 688 | GuiLib_LinePattern(X1, Y1, X2, Y2, sgl.CurItem.LinePattern, ForeColor); |
jmitc91516 | 0:9140ec6aa604 | 689 | else |
jmitc91516 | 0:9140ec6aa604 | 690 | GuiLib_Line(X1, Y1, X2, Y2, ForeColor); |
jmitc91516 | 0:9140ec6aa604 | 691 | UpdateDrawLimits(X1, Y1, X2, Y2); |
jmitc91516 | 0:9140ec6aa604 | 692 | } |
jmitc91516 | 0:9140ec6aa604 | 693 | break; |
jmitc91516 | 0:9140ec6aa604 | 694 | |
jmitc91516 | 0:9140ec6aa604 | 695 | case GuiLib_ITEM_FRAME: |
jmitc91516 | 0:9140ec6aa604 | 696 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 697 | { |
jmitc91516 | 0:9140ec6aa604 | 698 | X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 699 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 700 | X2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 701 | Y2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 702 | OrderCoord(&X1, &X2); |
jmitc91516 | 0:9140ec6aa604 | 703 | OrderCoord(&Y1, &Y2); |
jmitc91516 | 0:9140ec6aa604 | 704 | if (sgl.CurItem.FrameThickness == 0) |
jmitc91516 | 0:9140ec6aa604 | 705 | N = sgl.ThicknessMemory; |
jmitc91516 | 0:9140ec6aa604 | 706 | else |
jmitc91516 | 0:9140ec6aa604 | 707 | N = sgl.CurItem.FrameThickness; |
jmitc91516 | 0:9140ec6aa604 | 708 | DrawBorderBox(X1, Y1, X2, Y2, ForeColor, BackColor, BackColorTransp, N); |
jmitc91516 | 0:9140ec6aa604 | 709 | UpdateDrawLimits(X1, Y1, X2, Y2); |
jmitc91516 | 0:9140ec6aa604 | 710 | } |
jmitc91516 | 0:9140ec6aa604 | 711 | |
jmitc91516 | 0:9140ec6aa604 | 712 | break; |
jmitc91516 | 0:9140ec6aa604 | 713 | |
jmitc91516 | 0:9140ec6aa604 | 714 | case GuiLib_ITEM_ROUNDEDFRAME: |
jmitc91516 | 0:9140ec6aa604 | 715 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 716 | { |
jmitc91516 | 0:9140ec6aa604 | 717 | X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 718 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 719 | X2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 720 | Y2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 721 | OrderCoord(&X1, &X2); |
jmitc91516 | 0:9140ec6aa604 | 722 | OrderCoord(&Y1, &Y2); |
jmitc91516 | 0:9140ec6aa604 | 723 | |
jmitc91516 | 0:9140ec6aa604 | 724 | if (BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 725 | BackColor2 = GuiLib_NO_COLOR; |
jmitc91516 | 0:9140ec6aa604 | 726 | else |
jmitc91516 | 0:9140ec6aa604 | 727 | BackColor2 = BackColor; |
jmitc91516 | 0:9140ec6aa604 | 728 | |
jmitc91516 | 0:9140ec6aa604 | 729 | if (sgl.CurItem.R1 <= 0) |
jmitc91516 | 0:9140ec6aa604 | 730 | DrawBorderBox( |
jmitc91516 | 0:9140ec6aa604 | 731 | X1, Y1, X2, Y2, |
jmitc91516 | 0:9140ec6aa604 | 732 | ForeColor, BackColor, BackColorTransp, 1); |
jmitc91516 | 0:9140ec6aa604 | 733 | else |
jmitc91516 | 0:9140ec6aa604 | 734 | { |
jmitc91516 | 0:9140ec6aa604 | 735 | Ellipse( |
jmitc91516 | 0:9140ec6aa604 | 736 | X1 + sgl.CurItem.R1, Y1 + sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 737 | ForeColor, BackColor2, 0, 0, 1, 0); |
jmitc91516 | 0:9140ec6aa604 | 738 | if (X2 - X1 + 1 - 2 * sgl.CurItem.R1 > 0) |
jmitc91516 | 0:9140ec6aa604 | 739 | { |
jmitc91516 | 0:9140ec6aa604 | 740 | GuiLib_HLine(X1 + sgl.CurItem.R1, X2 - sgl.CurItem.R1, Y1, ForeColor); |
jmitc91516 | 0:9140ec6aa604 | 741 | if (!BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 742 | GuiLib_FillBox( |
jmitc91516 | 0:9140ec6aa604 | 743 | X1 + sgl.CurItem.R1, Y1 + 1, X2 - sgl.CurItem.R1, Y1 + sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 744 | BackColor); |
jmitc91516 | 0:9140ec6aa604 | 745 | } |
jmitc91516 | 0:9140ec6aa604 | 746 | Ellipse( |
jmitc91516 | 0:9140ec6aa604 | 747 | X2 - sgl.CurItem.R1, Y1 + sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 748 | ForeColor, BackColor2, 0, 0, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 749 | if (Y2 - Y1 + 1 - 2 * sgl.CurItem.R1 > 0) |
jmitc91516 | 0:9140ec6aa604 | 750 | { |
jmitc91516 | 0:9140ec6aa604 | 751 | GuiLib_VLine(X1, Y1 + sgl.CurItem.R1, Y2 - sgl.CurItem.R1, ForeColor); |
jmitc91516 | 0:9140ec6aa604 | 752 | if (!BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 753 | GuiLib_FillBox( |
jmitc91516 | 0:9140ec6aa604 | 754 | X1 + 1, Y1 + sgl.CurItem.R1, X2 - 1, Y2 - sgl.CurItem.R1, BackColor); |
jmitc91516 | 0:9140ec6aa604 | 755 | GuiLib_VLine(X2 , Y1 + sgl.CurItem.R1, Y2 - sgl.CurItem.R1, ForeColor); |
jmitc91516 | 0:9140ec6aa604 | 756 | } |
jmitc91516 | 0:9140ec6aa604 | 757 | Ellipse( |
jmitc91516 | 0:9140ec6aa604 | 758 | X1 + sgl.CurItem.R1, Y2 - sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 759 | ForeColor, BackColor2, 0, 1, 0, 0); |
jmitc91516 | 0:9140ec6aa604 | 760 | if (X2 - X1 + 1 - 2 * sgl.CurItem.R1 > 0) |
jmitc91516 | 0:9140ec6aa604 | 761 | { |
jmitc91516 | 0:9140ec6aa604 | 762 | if (!BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 763 | GuiLib_FillBox( |
jmitc91516 | 0:9140ec6aa604 | 764 | X1 + sgl.CurItem.R1, Y2 - sgl.CurItem.R1, X2 - sgl.CurItem.R1, Y2 - 1, |
jmitc91516 | 0:9140ec6aa604 | 765 | BackColor); |
jmitc91516 | 0:9140ec6aa604 | 766 | GuiLib_HLine(X1 + sgl.CurItem.R1, X2 - sgl.CurItem.R1, Y2, ForeColor); |
jmitc91516 | 0:9140ec6aa604 | 767 | } |
jmitc91516 | 0:9140ec6aa604 | 768 | Ellipse( |
jmitc91516 | 0:9140ec6aa604 | 769 | X2 - sgl.CurItem.R1, Y2 - sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 770 | ForeColor, BackColor2, 1, 0, 0, 0); |
jmitc91516 | 0:9140ec6aa604 | 771 | } |
jmitc91516 | 0:9140ec6aa604 | 772 | } |
jmitc91516 | 0:9140ec6aa604 | 773 | break; |
jmitc91516 | 0:9140ec6aa604 | 774 | |
jmitc91516 | 0:9140ec6aa604 | 775 | case GuiLib_ITEM_BLOCK: |
jmitc91516 | 0:9140ec6aa604 | 776 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 777 | { |
jmitc91516 | 0:9140ec6aa604 | 778 | X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 779 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 780 | X2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 781 | Y2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 782 | OrderCoord(&X1, &X2); |
jmitc91516 | 0:9140ec6aa604 | 783 | OrderCoord(&Y1, &Y2); |
jmitc91516 | 0:9140ec6aa604 | 784 | GuiLib_FillBox(X1, Y1, X2, Y2, ForeColor); |
jmitc91516 | 0:9140ec6aa604 | 785 | UpdateDrawLimits(X1, Y1, X2, Y2); |
jmitc91516 | 0:9140ec6aa604 | 786 | } |
jmitc91516 | 0:9140ec6aa604 | 787 | |
jmitc91516 | 0:9140ec6aa604 | 788 | break; |
jmitc91516 | 0:9140ec6aa604 | 789 | |
jmitc91516 | 0:9140ec6aa604 | 790 | case GuiLib_ITEM_ROUNDEDBLOCK: |
jmitc91516 | 0:9140ec6aa604 | 791 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 792 | { |
jmitc91516 | 0:9140ec6aa604 | 793 | X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 794 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 795 | X2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 796 | Y2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 797 | OrderCoord(&X1, &X2); |
jmitc91516 | 0:9140ec6aa604 | 798 | OrderCoord(&Y1, &Y2); |
jmitc91516 | 0:9140ec6aa604 | 799 | |
jmitc91516 | 0:9140ec6aa604 | 800 | if (sgl.CurItem.R1 <= 0) |
jmitc91516 | 0:9140ec6aa604 | 801 | GuiLib_FillBox(X1, Y1, X2, Y2, ForeColor); |
jmitc91516 | 0:9140ec6aa604 | 802 | else |
jmitc91516 | 0:9140ec6aa604 | 803 | { |
jmitc91516 | 0:9140ec6aa604 | 804 | Ellipse( |
jmitc91516 | 0:9140ec6aa604 | 805 | X1 + sgl.CurItem.R1, Y1 + sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 806 | ForeColor, ForeColor, 0, 0, 1, 0); |
jmitc91516 | 0:9140ec6aa604 | 807 | if (X2 - X1 + 1 - 2 * sgl.CurItem.R1 > 0) |
jmitc91516 | 0:9140ec6aa604 | 808 | GuiLib_FillBox( |
jmitc91516 | 0:9140ec6aa604 | 809 | X1 + sgl.CurItem.R1, Y1, X2 - sgl.CurItem.R1, Y1 + sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 810 | ForeColor); |
jmitc91516 | 0:9140ec6aa604 | 811 | Ellipse( |
jmitc91516 | 0:9140ec6aa604 | 812 | X2 - sgl.CurItem.R1, Y1 + sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 813 | ForeColor, ForeColor, 0, 0, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 814 | if (Y2 - Y1 + 1 - 2 * sgl.CurItem.R1 > 0) |
jmitc91516 | 0:9140ec6aa604 | 815 | GuiLib_FillBox(X1, Y1 + sgl.CurItem.R1, X2, Y2 - sgl.CurItem.R1, ForeColor); |
jmitc91516 | 0:9140ec6aa604 | 816 | Ellipse( |
jmitc91516 | 0:9140ec6aa604 | 817 | X1 + sgl.CurItem.R1, Y2 - sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 818 | ForeColor, ForeColor, 0, 1, 0, 0); |
jmitc91516 | 0:9140ec6aa604 | 819 | if (X2 - X1 + 1 - 2 * sgl.CurItem.R1 > 0) |
jmitc91516 | 0:9140ec6aa604 | 820 | GuiLib_FillBox( |
jmitc91516 | 0:9140ec6aa604 | 821 | X1 + sgl.CurItem.R1, Y2 - sgl.CurItem.R1, X2 - sgl.CurItem.R1, Y2, |
jmitc91516 | 0:9140ec6aa604 | 822 | ForeColor); |
jmitc91516 | 0:9140ec6aa604 | 823 | Ellipse( |
jmitc91516 | 0:9140ec6aa604 | 824 | X2 - sgl.CurItem.R1, Y2 - sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 825 | ForeColor, ForeColor, 1, 0, 0, 0); |
jmitc91516 | 0:9140ec6aa604 | 826 | } |
jmitc91516 | 0:9140ec6aa604 | 827 | } |
jmitc91516 | 0:9140ec6aa604 | 828 | break; |
jmitc91516 | 0:9140ec6aa604 | 829 | |
jmitc91516 | 0:9140ec6aa604 | 830 | case GuiLib_ITEM_CIRCLE: |
jmitc91516 | 0:9140ec6aa604 | 831 | if (sgl.DisplayWriting && (sgl.CurItem.R1 >= 0)) |
jmitc91516 | 0:9140ec6aa604 | 832 | { |
jmitc91516 | 0:9140ec6aa604 | 833 | if (BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 834 | BackColor2 = GuiLib_NO_COLOR; |
jmitc91516 | 0:9140ec6aa604 | 835 | else |
jmitc91516 | 0:9140ec6aa604 | 836 | BackColor2 = BackColor; |
jmitc91516 | 0:9140ec6aa604 | 837 | if ((sgl.CurItem.FrameThickness == 0xFF) && |
jmitc91516 | 0:9140ec6aa604 | 838 | !(sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_CIRCLE_IF)) |
jmitc91516 | 0:9140ec6aa604 | 839 | { |
jmitc91516 | 0:9140ec6aa604 | 840 | Ellipse(sgl.CurItem.X1 + sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 841 | sgl.CurItem.Y1, |
jmitc91516 | 0:9140ec6aa604 | 842 | sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 843 | sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 844 | ForeColor, BackColor2, |
jmitc91516 | 0:9140ec6aa604 | 845 | 1, 1, 1, 1); |
jmitc91516 | 0:9140ec6aa604 | 846 | UpdateDrawLimits(sgl.CurItem.X1, |
jmitc91516 | 0:9140ec6aa604 | 847 | sgl.CurItem.Y1 - sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 848 | sgl.CurItem.X1 + 2 * sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 849 | sgl.CurItem.Y1 + sgl.CurItem.R1); |
jmitc91516 | 0:9140ec6aa604 | 850 | } |
jmitc91516 | 0:9140ec6aa604 | 851 | else |
jmitc91516 | 0:9140ec6aa604 | 852 | { |
jmitc91516 | 0:9140ec6aa604 | 853 | Circle(sgl.CurItem.X1 + sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 854 | sgl.CurItem.Y1, |
jmitc91516 | 0:9140ec6aa604 | 855 | sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 856 | ForeColor, |
jmitc91516 | 0:9140ec6aa604 | 857 | sgl.CurItem.FrameThickness & 0x01, |
jmitc91516 | 0:9140ec6aa604 | 858 | sgl.CurItem.FrameThickness & 0x02, |
jmitc91516 | 0:9140ec6aa604 | 859 | sgl.CurItem.FrameThickness & 0x04, |
jmitc91516 | 0:9140ec6aa604 | 860 | sgl.CurItem.FrameThickness & 0x08, |
jmitc91516 | 0:9140ec6aa604 | 861 | sgl.CurItem.FrameThickness & 0x10, |
jmitc91516 | 0:9140ec6aa604 | 862 | sgl.CurItem.FrameThickness & 0x20, |
jmitc91516 | 0:9140ec6aa604 | 863 | sgl.CurItem.FrameThickness & 0x40, |
jmitc91516 | 0:9140ec6aa604 | 864 | sgl.CurItem.FrameThickness & 0x80, |
jmitc91516 | 0:9140ec6aa604 | 865 | sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_CIRCLE_IF); |
jmitc91516 | 0:9140ec6aa604 | 866 | X1 = sgl.CurItem.X1 + sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 867 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 868 | X2 = sgl.CurItem.X1 + sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 869 | Y2 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 870 | if (sgl.CurItem.FrameThickness & 0xC3) |
jmitc91516 | 0:9140ec6aa604 | 871 | X2 += sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 872 | if (sgl.CurItem.FrameThickness & 0x3C) |
jmitc91516 | 0:9140ec6aa604 | 873 | X1 -= sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 874 | if (sgl.CurItem.FrameThickness & 0xF0) |
jmitc91516 | 0:9140ec6aa604 | 875 | Y1 -= sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 876 | if (sgl.CurItem.FrameThickness & 0x0F) |
jmitc91516 | 0:9140ec6aa604 | 877 | Y2 += sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 878 | UpdateDrawLimits(X1, Y1, X2, Y2); |
jmitc91516 | 0:9140ec6aa604 | 879 | } |
jmitc91516 | 0:9140ec6aa604 | 880 | } |
jmitc91516 | 0:9140ec6aa604 | 881 | break; |
jmitc91516 | 0:9140ec6aa604 | 882 | |
jmitc91516 | 0:9140ec6aa604 | 883 | case GuiLib_ITEM_QUARTERCIRCLE: |
jmitc91516 | 0:9140ec6aa604 | 884 | if (sgl.DisplayWriting && (sgl.CurItem.R1 >= 0)) |
jmitc91516 | 0:9140ec6aa604 | 885 | { |
jmitc91516 | 0:9140ec6aa604 | 886 | if (BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 887 | BackColor2 = GuiLib_NO_COLOR; |
jmitc91516 | 0:9140ec6aa604 | 888 | else |
jmitc91516 | 0:9140ec6aa604 | 889 | BackColor2 = BackColor; |
jmitc91516 | 0:9140ec6aa604 | 890 | |
jmitc91516 | 0:9140ec6aa604 | 891 | X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 892 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 893 | Ellipse(X1 + sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 894 | Y1, |
jmitc91516 | 0:9140ec6aa604 | 895 | sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 896 | sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 897 | ForeColor, BackColor2, |
jmitc91516 | 0:9140ec6aa604 | 898 | (sgl.CurItem.FrameThickness == 0), |
jmitc91516 | 0:9140ec6aa604 | 899 | (sgl.CurItem.FrameThickness == 1), |
jmitc91516 | 0:9140ec6aa604 | 900 | (sgl.CurItem.FrameThickness == 2), |
jmitc91516 | 0:9140ec6aa604 | 901 | (sgl.CurItem.FrameThickness == 3)); |
jmitc91516 | 0:9140ec6aa604 | 902 | |
jmitc91516 | 0:9140ec6aa604 | 903 | switch (sgl.CurItem.FrameThickness) |
jmitc91516 | 0:9140ec6aa604 | 904 | { |
jmitc91516 | 0:9140ec6aa604 | 905 | case 1: |
jmitc91516 | 0:9140ec6aa604 | 906 | X1 += sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 907 | break; |
jmitc91516 | 0:9140ec6aa604 | 908 | case 2: |
jmitc91516 | 0:9140ec6aa604 | 909 | X1 += sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 910 | Y1 += sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 911 | break; |
jmitc91516 | 0:9140ec6aa604 | 912 | case 3: |
jmitc91516 | 0:9140ec6aa604 | 913 | Y1 += sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 914 | break; |
jmitc91516 | 0:9140ec6aa604 | 915 | } |
jmitc91516 | 0:9140ec6aa604 | 916 | UpdateDrawLimits(sgl.CurItem.X1, |
jmitc91516 | 0:9140ec6aa604 | 917 | sgl.CurItem.Y1, |
jmitc91516 | 0:9140ec6aa604 | 918 | sgl.CurItem.X1 + sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 919 | sgl.CurItem.Y1 + sgl.CurItem.R1); |
jmitc91516 | 0:9140ec6aa604 | 920 | } |
jmitc91516 | 0:9140ec6aa604 | 921 | break; |
jmitc91516 | 0:9140ec6aa604 | 922 | |
jmitc91516 | 0:9140ec6aa604 | 923 | case GuiLib_ITEM_ELLIPSE: |
jmitc91516 | 0:9140ec6aa604 | 924 | if (sgl.DisplayWriting && (sgl.CurItem.R1 >= 0) && (sgl.CurItem.R2 >= 0)) |
jmitc91516 | 0:9140ec6aa604 | 925 | { |
jmitc91516 | 0:9140ec6aa604 | 926 | if (BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 927 | BackColor2 = GuiLib_NO_COLOR; |
jmitc91516 | 0:9140ec6aa604 | 928 | else |
jmitc91516 | 0:9140ec6aa604 | 929 | BackColor2 = BackColor; |
jmitc91516 | 0:9140ec6aa604 | 930 | Ellipse(sgl.CurItem.X1 + sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 931 | sgl.CurItem.Y1, |
jmitc91516 | 0:9140ec6aa604 | 932 | sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 933 | sgl.CurItem.R2, |
jmitc91516 | 0:9140ec6aa604 | 934 | ForeColor, BackColor2, 1, 1, 1, 1); |
jmitc91516 | 0:9140ec6aa604 | 935 | |
jmitc91516 | 0:9140ec6aa604 | 936 | UpdateDrawLimits(sgl.CurItem.X1, |
jmitc91516 | 0:9140ec6aa604 | 937 | sgl.CurItem.Y1 - sgl.CurItem.R2, |
jmitc91516 | 0:9140ec6aa604 | 938 | sgl.CurItem.X1 + 2 * sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 939 | sgl.CurItem.Y1 + sgl.CurItem.R2); |
jmitc91516 | 0:9140ec6aa604 | 940 | } |
jmitc91516 | 0:9140ec6aa604 | 941 | break; |
jmitc91516 | 0:9140ec6aa604 | 942 | |
jmitc91516 | 0:9140ec6aa604 | 943 | case GuiLib_ITEM_QUARTERELLIPSE: |
jmitc91516 | 0:9140ec6aa604 | 944 | if (sgl.DisplayWriting && (sgl.CurItem.R1 >= 0) && (sgl.CurItem.R2 >= 0)) |
jmitc91516 | 0:9140ec6aa604 | 945 | { |
jmitc91516 | 0:9140ec6aa604 | 946 | if (BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 947 | BackColor2 = GuiLib_NO_COLOR; |
jmitc91516 | 0:9140ec6aa604 | 948 | else |
jmitc91516 | 0:9140ec6aa604 | 949 | BackColor2 = BackColor; |
jmitc91516 | 0:9140ec6aa604 | 950 | |
jmitc91516 | 0:9140ec6aa604 | 951 | X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 952 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 953 | Ellipse(X1 + sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 954 | Y1, |
jmitc91516 | 0:9140ec6aa604 | 955 | sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 956 | sgl.CurItem.R2, |
jmitc91516 | 0:9140ec6aa604 | 957 | ForeColor, BackColor2, |
jmitc91516 | 0:9140ec6aa604 | 958 | (sgl.CurItem.FrameThickness == 0), |
jmitc91516 | 0:9140ec6aa604 | 959 | (sgl.CurItem.FrameThickness == 1), |
jmitc91516 | 0:9140ec6aa604 | 960 | (sgl.CurItem.FrameThickness == 2), |
jmitc91516 | 0:9140ec6aa604 | 961 | (sgl.CurItem.FrameThickness == 3)); |
jmitc91516 | 0:9140ec6aa604 | 962 | |
jmitc91516 | 0:9140ec6aa604 | 963 | switch (sgl.CurItem.FrameThickness) |
jmitc91516 | 0:9140ec6aa604 | 964 | { |
jmitc91516 | 0:9140ec6aa604 | 965 | case 1: |
jmitc91516 | 0:9140ec6aa604 | 966 | X1 += sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 967 | break; |
jmitc91516 | 0:9140ec6aa604 | 968 | case 2: |
jmitc91516 | 0:9140ec6aa604 | 969 | X1 += sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 970 | Y1 += sgl.CurItem.R2; |
jmitc91516 | 0:9140ec6aa604 | 971 | break; |
jmitc91516 | 0:9140ec6aa604 | 972 | case 3: |
jmitc91516 | 0:9140ec6aa604 | 973 | Y1 += sgl.CurItem.R2; |
jmitc91516 | 0:9140ec6aa604 | 974 | break; |
jmitc91516 | 0:9140ec6aa604 | 975 | } |
jmitc91516 | 0:9140ec6aa604 | 976 | UpdateDrawLimits(sgl.CurItem.X1, |
jmitc91516 | 0:9140ec6aa604 | 977 | sgl.CurItem.Y1, |
jmitc91516 | 0:9140ec6aa604 | 978 | sgl.CurItem.X1 + sgl.CurItem.R1, |
jmitc91516 | 0:9140ec6aa604 | 979 | sgl.CurItem.Y1 + sgl.CurItem.R2); |
jmitc91516 | 0:9140ec6aa604 | 980 | } |
jmitc91516 | 0:9140ec6aa604 | 981 | break; |
jmitc91516 | 0:9140ec6aa604 | 982 | |
jmitc91516 | 0:9140ec6aa604 | 983 | case GuiLib_ITEM_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 984 | case GuiLib_ITEM_BACKGROUND: |
jmitc91516 | 0:9140ec6aa604 | 985 | #ifdef GuiConst_BITMAP_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 986 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 987 | { |
jmitc91516 | 0:9140ec6aa604 | 988 | if (sgl.CommonByte6 & 0x02) |
jmitc91516 | 0:9140ec6aa604 | 989 | BackColor2 = sgl.CurItem.CompPars.CompBitmap.TranspColor; |
jmitc91516 | 0:9140ec6aa604 | 990 | else |
jmitc91516 | 0:9140ec6aa604 | 991 | BackColor2 = -1; |
jmitc91516 | 0:9140ec6aa604 | 992 | GuiLib_ShowBitmap(sgl.CurItem.StructToCallIndex, |
jmitc91516 | 0:9140ec6aa604 | 993 | sgl.CurItem.X1, |
jmitc91516 | 0:9140ec6aa604 | 994 | sgl.CurItem.Y1, |
jmitc91516 | 0:9140ec6aa604 | 995 | BackColor2); |
jmitc91516 | 0:9140ec6aa604 | 996 | UpdateDrawLimits(sgl.CurItem.X1, sgl.CurItem.Y1, |
jmitc91516 | 0:9140ec6aa604 | 997 | sgl.BitmapWriteX2, sgl.BitmapWriteY2); |
jmitc91516 | 0:9140ec6aa604 | 998 | } |
jmitc91516 | 0:9140ec6aa604 | 999 | |
jmitc91516 | 0:9140ec6aa604 | 1000 | if (sgl.CurItem.ItemType == GuiLib_ITEM_BACKGROUND) |
jmitc91516 | 0:9140ec6aa604 | 1001 | { |
jmitc91516 | 0:9140ec6aa604 | 1002 | sgl.BackgrBitmapAry[sgl.GlobalBackgrBitmapIndex].InUse = 1; |
jmitc91516 | 0:9140ec6aa604 | 1003 | sgl.BackgrBitmapAry[sgl.GlobalBackgrBitmapIndex].Index = |
jmitc91516 | 0:9140ec6aa604 | 1004 | sgl.CurItem.StructToCallIndex; |
jmitc91516 | 0:9140ec6aa604 | 1005 | sgl.BackgrBitmapAry[sgl.GlobalBackgrBitmapIndex].X = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 1006 | sgl.BackgrBitmapAry[sgl.GlobalBackgrBitmapIndex].Y = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 1007 | if (sgl.GlobalBackgrBitmapIndex < GuiConst_MAX_BACKGROUND_BITMAPS - 1) |
jmitc91516 | 0:9140ec6aa604 | 1008 | sgl.GlobalBackgrBitmapIndex++; |
jmitc91516 | 0:9140ec6aa604 | 1009 | } |
jmitc91516 | 0:9140ec6aa604 | 1010 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1011 | |
jmitc91516 | 0:9140ec6aa604 | 1012 | break; |
jmitc91516 | 0:9140ec6aa604 | 1013 | |
jmitc91516 | 0:9140ec6aa604 | 1014 | case GuiLib_ITEM_ACTIVEAREA: |
jmitc91516 | 0:9140ec6aa604 | 1015 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 1016 | { |
jmitc91516 | 0:9140ec6aa604 | 1017 | #ifdef GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 1018 | if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_CLIPPING) |
jmitc91516 | 0:9140ec6aa604 | 1019 | { |
jmitc91516 | 0:9140ec6aa604 | 1020 | sgl.CurItem.ClipRectX1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 1021 | sgl.CurItem.ClipRectY1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 1022 | sgl.CurItem.ClipRectX2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 1023 | sgl.CurItem.ClipRectY2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 1024 | sgl.ActiveAreaX1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 1025 | sgl.ActiveAreaY1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 1026 | sgl.ActiveAreaX2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 1027 | sgl.ActiveAreaY2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 1028 | OrderCoord(&sgl.ActiveAreaX1, &sgl.ActiveAreaX2); |
jmitc91516 | 0:9140ec6aa604 | 1029 | OrderCoord(&sgl.ActiveAreaY1, &sgl.ActiveAreaY2); |
jmitc91516 | 0:9140ec6aa604 | 1030 | #ifdef GuiConst_DISPLAY_ACTIVE_AREA_CLIPPING |
jmitc91516 | 0:9140ec6aa604 | 1031 | if (sgl.ActiveAreaX1 < sgl.DisplayActiveAreaX1) |
jmitc91516 | 0:9140ec6aa604 | 1032 | sgl.ActiveAreaX1 = sgl.DisplayActiveAreaX1; |
jmitc91516 | 0:9140ec6aa604 | 1033 | if (sgl.ActiveAreaY1 < sgl.DisplayActiveAreaY1) |
jmitc91516 | 0:9140ec6aa604 | 1034 | sgl.ActiveAreaY1 = sgl.DisplayActiveAreaY1; |
jmitc91516 | 0:9140ec6aa604 | 1035 | if (sgl.ActiveAreaX2 > sgl.DisplayActiveAreaX2) |
jmitc91516 | 0:9140ec6aa604 | 1036 | sgl.ActiveAreaX2 = sgl.DisplayActiveAreaX2; |
jmitc91516 | 0:9140ec6aa604 | 1037 | if (sgl.ActiveAreaY2 > sgl.DisplayActiveAreaY2) |
jmitc91516 | 0:9140ec6aa604 | 1038 | sgl.ActiveAreaY2 = sgl.DisplayActiveAreaY2; |
jmitc91516 | 0:9140ec6aa604 | 1039 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1040 | GuiLib_SetClipping(sgl.ActiveAreaX1, sgl.ActiveAreaY1, |
jmitc91516 | 0:9140ec6aa604 | 1041 | sgl.ActiveAreaX2, sgl.ActiveAreaY2); |
jmitc91516 | 0:9140ec6aa604 | 1042 | } |
jmitc91516 | 0:9140ec6aa604 | 1043 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1044 | |
jmitc91516 | 0:9140ec6aa604 | 1045 | #ifdef GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 1046 | #ifdef GuiConst_REL_COORD_ORIGO_INUSE |
jmitc91516 | 0:9140ec6aa604 | 1047 | if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_ACTIVEAREARELCOORD) |
jmitc91516 | 0:9140ec6aa604 | 1048 | { |
jmitc91516 | 0:9140ec6aa604 | 1049 | sgl.CurItem.ClipRectX1 += sgl.CoordOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 1050 | sgl.CurItem.ClipRectY1 += sgl.CoordOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 1051 | sgl.CurItem.ClipRectX2 += sgl.CoordOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 1052 | sgl.CurItem.ClipRectY2 += sgl.CoordOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 1053 | } |
jmitc91516 | 0:9140ec6aa604 | 1054 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1055 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1056 | |
jmitc91516 | 0:9140ec6aa604 | 1057 | sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 1058 | sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 1059 | if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_ACTIVEAREARELCOORD) |
jmitc91516 | 0:9140ec6aa604 | 1060 | { |
jmitc91516 | 0:9140ec6aa604 | 1061 | sgl.CoordOrigoX += sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 1062 | sgl.CoordOrigoY += sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 1063 | } |
jmitc91516 | 0:9140ec6aa604 | 1064 | #ifdef GuiConst_REL_COORD_ORIGO_INUSE |
jmitc91516 | 0:9140ec6aa604 | 1065 | sgl.CurItem.CoordOrigoX = sgl.CoordOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 1066 | sgl.CurItem.CoordOrigoY = sgl.CoordOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 1067 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1068 | |
jmitc91516 | 0:9140ec6aa604 | 1069 | #ifdef GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 1070 | #ifdef GuiConst_REL_COORD_ORIGO_INUSE |
jmitc91516 | 0:9140ec6aa604 | 1071 | sgl.CurItem.ClipRectX1 -= sgl.CoordOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 1072 | sgl.CurItem.ClipRectY1 -= sgl.CoordOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 1073 | sgl.CurItem.ClipRectX2 -= sgl.CoordOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 1074 | sgl.CurItem.ClipRectY2 -= sgl.CoordOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 1075 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1076 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1077 | } |
jmitc91516 | 0:9140ec6aa604 | 1078 | break; |
jmitc91516 | 0:9140ec6aa604 | 1079 | |
jmitc91516 | 0:9140ec6aa604 | 1080 | case GuiLib_ITEM_CLIPRECT: |
jmitc91516 | 0:9140ec6aa604 | 1081 | #ifdef GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 1082 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 1083 | { |
jmitc91516 | 0:9140ec6aa604 | 1084 | if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_CLIPPING) |
jmitc91516 | 0:9140ec6aa604 | 1085 | { |
jmitc91516 | 0:9140ec6aa604 | 1086 | sgl.CurItem.ClipRectX1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 1087 | sgl.CurItem.ClipRectY1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 1088 | sgl.CurItem.ClipRectX2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 1089 | sgl.CurItem.ClipRectY2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 1090 | } |
jmitc91516 | 0:9140ec6aa604 | 1091 | StartClipping( |
jmitc91516 | 0:9140ec6aa604 | 1092 | (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_CLIPPING) != 0); |
jmitc91516 | 0:9140ec6aa604 | 1093 | } |
jmitc91516 | 0:9140ec6aa604 | 1094 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1095 | break; |
jmitc91516 | 0:9140ec6aa604 | 1096 | |
jmitc91516 | 0:9140ec6aa604 | 1097 | case GuiLib_ITEM_STRUCTURE: |
jmitc91516 | 0:9140ec6aa604 | 1098 | case GuiLib_ITEM_STRUCTARRAY: |
jmitc91516 | 0:9140ec6aa604 | 1099 | case GuiLib_ITEM_STRUCTCOND: |
jmitc91516 | 0:9140ec6aa604 | 1100 | if (sgl.DisplayWriting && (sgl.CurItem.TextPar[0].BackBoxSizeX > 0)) |
jmitc91516 | 0:9140ec6aa604 | 1101 | { |
jmitc91516 | 0:9140ec6aa604 | 1102 | DrawBackBox(BackColor, BackColorTransp, 0); |
jmitc91516 | 0:9140ec6aa604 | 1103 | UpdateDrawLimits(sgl.BbX1, sgl.BbY1, sgl.BbX2, sgl.BbY2); |
jmitc91516 | 0:9140ec6aa604 | 1104 | } |
jmitc91516 | 0:9140ec6aa604 | 1105 | |
jmitc91516 | 0:9140ec6aa604 | 1106 | StructToCallIndex = sgl.CurItem.StructToCallIndex; |
jmitc91516 | 0:9140ec6aa604 | 1107 | if (sgl.CurItem.ItemType == GuiLib_ITEM_STRUCTARRAY) |
jmitc91516 | 0:9140ec6aa604 | 1108 | { |
jmitc91516 | 0:9140ec6aa604 | 1109 | if (StructToCallIndex != 0xFFFF) |
jmitc91516 | 0:9140ec6aa604 | 1110 | { |
jmitc91516 | 0:9140ec6aa604 | 1111 | VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType); |
jmitc91516 | 0:9140ec6aa604 | 1112 | |
jmitc91516 | 0:9140ec6aa604 | 1113 | I = sgl.CurItem.CompPars.StructCall.IndexCount; |
jmitc91516 | 0:9140ec6aa604 | 1114 | while (I > 0) |
jmitc91516 | 0:9140ec6aa604 | 1115 | { |
jmitc91516 | 0:9140ec6aa604 | 1116 | if (ReadWord(GuiStruct_StructNdxList[StructToCallIndex]) == |
jmitc91516 | 0:9140ec6aa604 | 1117 | VarValue) |
jmitc91516 | 0:9140ec6aa604 | 1118 | break; |
jmitc91516 | 0:9140ec6aa604 | 1119 | |
jmitc91516 | 0:9140ec6aa604 | 1120 | StructToCallIndex++; |
jmitc91516 | 0:9140ec6aa604 | 1121 | I--; |
jmitc91516 | 0:9140ec6aa604 | 1122 | } |
jmitc91516 | 0:9140ec6aa604 | 1123 | if (I == 0) |
jmitc91516 | 0:9140ec6aa604 | 1124 | { |
jmitc91516 | 0:9140ec6aa604 | 1125 | if (ReadWord(GuiStruct_StructNdxList[sgl.CurItem.StructToCallIndex]) == 0xFFFF) |
jmitc91516 | 0:9140ec6aa604 | 1126 | StructToCallIndex = sgl.CurItem.StructToCallIndex; |
jmitc91516 | 0:9140ec6aa604 | 1127 | else |
jmitc91516 | 0:9140ec6aa604 | 1128 | StructToCallIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 1129 | } |
jmitc91516 | 0:9140ec6aa604 | 1130 | } |
jmitc91516 | 0:9140ec6aa604 | 1131 | } |
jmitc91516 | 0:9140ec6aa604 | 1132 | #ifdef GuiConst_ITEM_STRUCTCOND_INUSE |
jmitc91516 | 0:9140ec6aa604 | 1133 | else if (sgl.CurItem.ItemType == GuiLib_ITEM_STRUCTCOND) |
jmitc91516 | 0:9140ec6aa604 | 1134 | { |
jmitc91516 | 0:9140ec6aa604 | 1135 | VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType); |
jmitc91516 | 0:9140ec6aa604 | 1136 | |
jmitc91516 | 0:9140ec6aa604 | 1137 | I = sgl.CurItem.CompPars.StructCall.IndexCount - 1; |
jmitc91516 | 0:9140ec6aa604 | 1138 | FirstRound = 1; |
jmitc91516 | 0:9140ec6aa604 | 1139 | while (I >= 0) |
jmitc91516 | 0:9140ec6aa604 | 1140 | { |
jmitc91516 | 0:9140ec6aa604 | 1141 | if ((VarValue >= sgl.CurItem.CompPars.StructCall.IndexFirst[I]) && |
jmitc91516 | 0:9140ec6aa604 | 1142 | (VarValue <= sgl.CurItem.CompPars.StructCall.IndexLast[I]) && |
jmitc91516 | 0:9140ec6aa604 | 1143 | ((sgl.CurItem.CompPars.StructCall.IndexFirst[I] == |
jmitc91516 | 0:9140ec6aa604 | 1144 | sgl.CurItem.CompPars.StructCall.IndexLast[I]) || |
jmitc91516 | 0:9140ec6aa604 | 1145 | !FirstRound)) |
jmitc91516 | 0:9140ec6aa604 | 1146 | { |
jmitc91516 | 0:9140ec6aa604 | 1147 | StructToCallIndex = sgl.CurItem.CompPars.StructCall.CallIndex[I]; |
jmitc91516 | 0:9140ec6aa604 | 1148 | break; |
jmitc91516 | 0:9140ec6aa604 | 1149 | } |
jmitc91516 | 0:9140ec6aa604 | 1150 | |
jmitc91516 | 0:9140ec6aa604 | 1151 | I--; |
jmitc91516 | 0:9140ec6aa604 | 1152 | |
jmitc91516 | 0:9140ec6aa604 | 1153 | if ((I == -1) && FirstRound) |
jmitc91516 | 0:9140ec6aa604 | 1154 | { |
jmitc91516 | 0:9140ec6aa604 | 1155 | FirstRound = 0; |
jmitc91516 | 0:9140ec6aa604 | 1156 | I = sgl.CurItem.CompPars.StructCall.IndexCount - 1; |
jmitc91516 | 0:9140ec6aa604 | 1157 | } |
jmitc91516 | 0:9140ec6aa604 | 1158 | } |
jmitc91516 | 0:9140ec6aa604 | 1159 | } |
jmitc91516 | 0:9140ec6aa604 | 1160 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1161 | DrawSubStruct(StructToCallIndex, ColorInvert, 0); |
jmitc91516 | 0:9140ec6aa604 | 1162 | break; |
jmitc91516 | 0:9140ec6aa604 | 1163 | |
jmitc91516 | 0:9140ec6aa604 | 1164 | #ifdef GuiConst_ITEM_TOUCHAREA_INUSE |
jmitc91516 | 0:9140ec6aa604 | 1165 | case GuiLib_ITEM_TOUCHAREA: |
jmitc91516 | 0:9140ec6aa604 | 1166 | TouchIndex = -1; |
jmitc91516 | 0:9140ec6aa604 | 1167 | for (TouchSearch = 0; TouchSearch < sgl.TouchAreaCnt; TouchSearch++) |
jmitc91516 | 0:9140ec6aa604 | 1168 | if (sgl.TouchAreas[TouchSearch].IndexNo == |
jmitc91516 | 0:9140ec6aa604 | 1169 | sgl.CurItem.CompPars.CompTouch.AreaNo) |
jmitc91516 | 0:9140ec6aa604 | 1170 | { |
jmitc91516 | 0:9140ec6aa604 | 1171 | TouchIndex = TouchSearch; |
jmitc91516 | 0:9140ec6aa604 | 1172 | break; |
jmitc91516 | 0:9140ec6aa604 | 1173 | } |
jmitc91516 | 0:9140ec6aa604 | 1174 | if (TouchIndex == -1) |
jmitc91516 | 0:9140ec6aa604 | 1175 | { |
jmitc91516 | 0:9140ec6aa604 | 1176 | TouchIndex = sgl.TouchAreaCnt; |
jmitc91516 | 0:9140ec6aa604 | 1177 | sgl.TouchAreaCnt++; |
jmitc91516 | 0:9140ec6aa604 | 1178 | } |
jmitc91516 | 0:9140ec6aa604 | 1179 | sgl.TouchAreas[TouchIndex].IndexNo = sgl.CurItem.CompPars.CompTouch.AreaNo; |
jmitc91516 | 0:9140ec6aa604 | 1180 | sgl.TouchAreas[TouchIndex].X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 1181 | sgl.TouchAreas[TouchIndex].Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 1182 | sgl.TouchAreas[TouchIndex].X2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 1183 | sgl.TouchAreas[TouchIndex].Y2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 1184 | OrderCoord(&sgl.TouchAreas[TouchIndex].X1, &sgl.TouchAreas[TouchIndex].X2); |
jmitc91516 | 0:9140ec6aa604 | 1185 | OrderCoord(&sgl.TouchAreas[TouchIndex].Y1, &sgl.TouchAreas[TouchIndex].Y2); |
jmitc91516 | 0:9140ec6aa604 | 1186 | |
jmitc91516 | 0:9140ec6aa604 | 1187 | break; |
jmitc91516 | 0:9140ec6aa604 | 1188 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1189 | |
jmitc91516 | 0:9140ec6aa604 | 1190 | case GuiLib_ITEM_POSCALLBACK: |
jmitc91516 | 0:9140ec6aa604 | 1191 | for (I = 0; I < GuiConst_POSCALLBACK_CNT; I++) |
jmitc91516 | 0:9140ec6aa604 | 1192 | if (sgl.PosCallbacks[I].InUse && |
jmitc91516 | 0:9140ec6aa604 | 1193 | (sgl.PosCallbacks[I].IndexNo == sgl.CurItem.PosCallbackNo) && |
jmitc91516 | 0:9140ec6aa604 | 1194 | (sgl.PosCallbacks[I].PosCallbackFunc != 0)) |
jmitc91516 | 0:9140ec6aa604 | 1195 | { |
jmitc91516 | 0:9140ec6aa604 | 1196 | (*sgl.PosCallbacks[I].PosCallbackFunc)(sgl.CurItem.PosCallbackNo, |
jmitc91516 | 0:9140ec6aa604 | 1197 | sgl.CurItem.X1, |
jmitc91516 | 0:9140ec6aa604 | 1198 | sgl.CurItem.Y1); |
jmitc91516 | 0:9140ec6aa604 | 1199 | break; |
jmitc91516 | 0:9140ec6aa604 | 1200 | } |
jmitc91516 | 0:9140ec6aa604 | 1201 | break; |
jmitc91516 | 0:9140ec6aa604 | 1202 | |
jmitc91516 | 0:9140ec6aa604 | 1203 | #ifdef GuiConst_ITEM_SCROLLBOX_INUSE |
jmitc91516 | 0:9140ec6aa604 | 1204 | case GuiLib_ITEM_SCROLLBOX: |
jmitc91516 | 0:9140ec6aa604 | 1205 | break; |
jmitc91516 | 0:9140ec6aa604 | 1206 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1207 | |
jmitc91516 | 0:9140ec6aa604 | 1208 | #ifdef GuiConst_ITEM_CHECKBOX_INUSE |
jmitc91516 | 0:9140ec6aa604 | 1209 | case GuiLib_ITEM_CHECKBOX: |
jmitc91516 | 0:9140ec6aa604 | 1210 | PrepareInternalStruct(); |
jmitc91516 | 0:9140ec6aa604 | 1211 | |
jmitc91516 | 0:9140ec6aa604 | 1212 | GuiVarCompInt1 = sgl.CurItem.CompPars.CompCheckBox.Size; |
jmitc91516 | 0:9140ec6aa604 | 1213 | sgl.Memory.C[0] = ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 1214 | |
jmitc91516 | 0:9140ec6aa604 | 1215 | Y2 = sgl.CurItem.Y1 + sgl.CurItem.CompPars.CompCheckBox.Size - 1; |
jmitc91516 | 0:9140ec6aa604 | 1216 | switch (sgl.CurItem.CompPars.CompCheckBox.Style) |
jmitc91516 | 0:9140ec6aa604 | 1217 | { |
jmitc91516 | 0:9140ec6aa604 | 1218 | case GuiLib_CHECKBOX_FLAT: |
jmitc91516 | 0:9140ec6aa604 | 1219 | if (BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 1220 | DrawSubStruct(GuiStructCOMP_CBFLATTRANSP, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1221 | else |
jmitc91516 | 0:9140ec6aa604 | 1222 | DrawSubStruct(GuiStructCOMP_CBFLAT, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1223 | break; |
jmitc91516 | 0:9140ec6aa604 | 1224 | case GuiLib_CHECKBOX_3D: |
jmitc91516 | 0:9140ec6aa604 | 1225 | DrawSubStruct(GuiStructCOMP_CB3D, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1226 | if (!BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 1227 | DrawSubStruct(GuiStructCOMP_CB3DINNER, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1228 | break; |
jmitc91516 | 0:9140ec6aa604 | 1229 | case GuiLib_CHECKBOX_ICON: |
jmitc91516 | 0:9140ec6aa604 | 1230 | TempTextPar = sgl.CurItem.TextPar[0]; |
jmitc91516 | 0:9140ec6aa604 | 1231 | SetCurFont(sgl.CurItem.CompPars.CompCheckBox.IconFont); |
jmitc91516 | 0:9140ec6aa604 | 1232 | sgl.CurItem.X1 = sgl.CurItem.X1 + sgl.CurItem.CompPars.CompCheckBox.IconOffsetX; |
jmitc91516 | 0:9140ec6aa604 | 1233 | sgl.CurItem.Y1 = sgl.CurItem.Y1 + sgl.CurItem.CompPars.CompCheckBox.IconOffsetY; |
jmitc91516 | 0:9140ec6aa604 | 1234 | sgl.CurItem.TextPar[0].Alignment = GuiLib_ALIGN_LEFT; |
jmitc91516 | 0:9140ec6aa604 | 1235 | sgl.CurItem.TextPar[0].Ps = GuiLib_PS_OFF; |
jmitc91516 | 0:9140ec6aa604 | 1236 | sgl.CurItem.TextPar[0].BitFlags = 0; |
jmitc91516 | 0:9140ec6aa604 | 1237 | sgl.CurItem.TextPar[0].BackBoxSizeX = 0; |
jmitc91516 | 0:9140ec6aa604 | 1238 | sgl.CurItem.TextPar[0].BackBorderPixels = 0; |
jmitc91516 | 0:9140ec6aa604 | 1239 | DrawText(sgl.CurItem.CompPars.CompCheckBox.IconPtr, |
jmitc91516 | 0:9140ec6aa604 | 1240 | 1, |
jmitc91516 | 0:9140ec6aa604 | 1241 | 0, |
jmitc91516 | 0:9140ec6aa604 | 1242 | ForeColor, |
jmitc91516 | 0:9140ec6aa604 | 1243 | BackColor, |
jmitc91516 | 0:9140ec6aa604 | 1244 | BackColorTransp); |
jmitc91516 | 0:9140ec6aa604 | 1245 | Y2 = sgl.FontWriteY2; |
jmitc91516 | 0:9140ec6aa604 | 1246 | sgl.CurItem.TextPar[0] = TempTextPar; |
jmitc91516 | 0:9140ec6aa604 | 1247 | break; |
jmitc91516 | 0:9140ec6aa604 | 1248 | case GuiLib_CHECKBOX_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 1249 | if (sgl.CurItem.CompPars.CompCheckBox.BitmapIsTransparent) |
jmitc91516 | 0:9140ec6aa604 | 1250 | BackColor2 = sgl.CurItem.CompPars.CompCheckBox.BitmapTranspColor; |
jmitc91516 | 0:9140ec6aa604 | 1251 | else |
jmitc91516 | 0:9140ec6aa604 | 1252 | BackColor2 = -1; |
jmitc91516 | 0:9140ec6aa604 | 1253 | GuiLib_ShowBitmap(sgl.CurItem.CompPars.CompCheckBox.BitmapIndex, |
jmitc91516 | 0:9140ec6aa604 | 1254 | sgl.CurItem.X1, sgl.CurItem.Y1, |
jmitc91516 | 0:9140ec6aa604 | 1255 | BackColor2); |
jmitc91516 | 0:9140ec6aa604 | 1256 | break; |
jmitc91516 | 0:9140ec6aa604 | 1257 | } |
jmitc91516 | 0:9140ec6aa604 | 1258 | |
jmitc91516 | 0:9140ec6aa604 | 1259 | if ((sgl.CurItem.VarPtr != 0) && (sgl.CurItem.VarType != GuiLib_VAR_STRING)) |
jmitc91516 | 0:9140ec6aa604 | 1260 | { |
jmitc91516 | 0:9140ec6aa604 | 1261 | VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType); |
jmitc91516 | 0:9140ec6aa604 | 1262 | |
jmitc91516 | 0:9140ec6aa604 | 1263 | if (VarValue != 0) |
jmitc91516 | 0:9140ec6aa604 | 1264 | CheckmarkMode = 1; |
jmitc91516 | 0:9140ec6aa604 | 1265 | else if ((sgl.CurItem.CompPars.CompCheckBox.Style == GuiLib_CHECKBOX_NONE) && |
jmitc91516 | 0:9140ec6aa604 | 1266 | (!BackColorTransp)) |
jmitc91516 | 0:9140ec6aa604 | 1267 | CheckmarkMode = 2; |
jmitc91516 | 0:9140ec6aa604 | 1268 | else |
jmitc91516 | 0:9140ec6aa604 | 1269 | CheckmarkMode = 0; |
jmitc91516 | 0:9140ec6aa604 | 1270 | |
jmitc91516 | 0:9140ec6aa604 | 1271 | if (CheckmarkMode > 0) |
jmitc91516 | 0:9140ec6aa604 | 1272 | { |
jmitc91516 | 0:9140ec6aa604 | 1273 | GuiVarCompInt1 = sgl.CurItem.CompPars.CompCheckBox.Size; |
jmitc91516 | 0:9140ec6aa604 | 1274 | if (CheckmarkMode == 1) |
jmitc91516 | 0:9140ec6aa604 | 1275 | sgl.Memory.C[0] = sgl.CurItem.CompPars.CompCheckBox.MarkColor; |
jmitc91516 | 0:9140ec6aa604 | 1276 | else |
jmitc91516 | 0:9140ec6aa604 | 1277 | sgl.Memory.C[0] = BackColor; |
jmitc91516 | 0:9140ec6aa604 | 1278 | |
jmitc91516 | 0:9140ec6aa604 | 1279 | switch (sgl.CurItem.CompPars.CompCheckBox.MarkStyle) |
jmitc91516 | 0:9140ec6aa604 | 1280 | { |
jmitc91516 | 0:9140ec6aa604 | 1281 | case GuiLib_CHECKBOX_MARK_CHECKED: |
jmitc91516 | 0:9140ec6aa604 | 1282 | GuiVarCompInt1 = |
jmitc91516 | 0:9140ec6aa604 | 1283 | (sgl.CurItem.CompPars.CompCheckBox.Size / 2) - |
jmitc91516 | 0:9140ec6aa604 | 1284 | ((sgl.CurItem.CompPars.CompCheckBox.Size - 6) / 6); |
jmitc91516 | 0:9140ec6aa604 | 1285 | GuiVarCompInt2 = |
jmitc91516 | 0:9140ec6aa604 | 1286 | (sgl.CurItem.CompPars.CompCheckBox.Size / |
jmitc91516 | 0:9140ec6aa604 | 1287 | 2) + |
jmitc91516 | 0:9140ec6aa604 | 1288 | ((sgl.CurItem.CompPars.CompCheckBox.Size - 8) / 6); |
jmitc91516 | 0:9140ec6aa604 | 1289 | GuiVarCompInt3 = GuiVarCompInt2 - |
jmitc91516 | 0:9140ec6aa604 | 1290 | ((sgl.CurItem.CompPars.CompCheckBox.Size - 1) / 5); |
jmitc91516 | 0:9140ec6aa604 | 1291 | GuiVarCompInt4 = -GuiVarCompInt3; |
jmitc91516 | 0:9140ec6aa604 | 1292 | GuiVarCompInt5 = -((GuiVarCompInt3 - 1) / 2); |
jmitc91516 | 0:9140ec6aa604 | 1293 | if (((sgl.CurItem.CompPars.CompCheckBox.Style == |
jmitc91516 | 0:9140ec6aa604 | 1294 | GuiLib_CHECKBOX_FLAT) || |
jmitc91516 | 0:9140ec6aa604 | 1295 | (sgl.CurItem.CompPars.CompCheckBox.Style == |
jmitc91516 | 0:9140ec6aa604 | 1296 | GuiLib_CHECKBOX_3D) || |
jmitc91516 | 0:9140ec6aa604 | 1297 | (sgl.CurItem.CompPars.CompCheckBox.Style == |
jmitc91516 | 0:9140ec6aa604 | 1298 | GuiLib_CHECKBOX_NONE)) && |
jmitc91516 | 0:9140ec6aa604 | 1299 | (sgl.CurItem.CompPars.CompCheckBox.Size <= 10)) |
jmitc91516 | 0:9140ec6aa604 | 1300 | DrawSubStruct(GuiStructCOMP_CBMCHSMALL, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1301 | else |
jmitc91516 | 0:9140ec6aa604 | 1302 | DrawSubStruct(GuiStructCOMP_CBMCHBIG, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1303 | break; |
jmitc91516 | 0:9140ec6aa604 | 1304 | case GuiLib_CHECKBOX_MARK_CROSSED: |
jmitc91516 | 0:9140ec6aa604 | 1305 | if ((sgl.CurItem.CompPars.CompCheckBox.Style == |
jmitc91516 | 0:9140ec6aa604 | 1306 | GuiLib_CHECKBOX_FLAT) && |
jmitc91516 | 0:9140ec6aa604 | 1307 | (sgl.CurItem.CompPars.CompCheckBox.Size <= 8)) |
jmitc91516 | 0:9140ec6aa604 | 1308 | DrawSubStruct(GuiStructCOMP_CBMCRFLSMALL, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1309 | else if (((sgl.CurItem.CompPars.CompCheckBox.Style == |
jmitc91516 | 0:9140ec6aa604 | 1310 | GuiLib_CHECKBOX_3D) || |
jmitc91516 | 0:9140ec6aa604 | 1311 | (sgl.CurItem.CompPars.CompCheckBox.Style == |
jmitc91516 | 0:9140ec6aa604 | 1312 | GuiLib_CHECKBOX_NONE)) && |
jmitc91516 | 0:9140ec6aa604 | 1313 | (sgl.CurItem.CompPars.CompCheckBox.Size <= 8)) |
jmitc91516 | 0:9140ec6aa604 | 1314 | DrawSubStruct(GuiStructCOMP_CBMCR3DSMALL, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1315 | else |
jmitc91516 | 0:9140ec6aa604 | 1316 | DrawSubStruct(GuiStructCOMP_CBMCRBIG, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1317 | break; |
jmitc91516 | 0:9140ec6aa604 | 1318 | case GuiLib_CHECKBOX_MARK_FILLED: |
jmitc91516 | 0:9140ec6aa604 | 1319 | if (sgl.CurItem.CompPars.CompCheckBox.Style == GuiLib_CHECKBOX_FLAT) |
jmitc91516 | 0:9140ec6aa604 | 1320 | DrawSubStruct(GuiStructCOMP_CBMFIFLAT, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1321 | else |
jmitc91516 | 0:9140ec6aa604 | 1322 | DrawSubStruct(GuiStructCOMP_CBMFI3D, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1323 | break; |
jmitc91516 | 0:9140ec6aa604 | 1324 | case GuiLib_CHECKBOX_MARK_ICON: |
jmitc91516 | 0:9140ec6aa604 | 1325 | TempTextPar = sgl.CurItem.TextPar[0]; |
jmitc91516 | 0:9140ec6aa604 | 1326 | SetCurFont(sgl.CurItem.CompPars.CompCheckBox.MarkIconFont); |
jmitc91516 | 0:9140ec6aa604 | 1327 | sgl.CurItem.X1 = sgl.CurItem.X1 + |
jmitc91516 | 0:9140ec6aa604 | 1328 | sgl.CurItem.CompPars.CompCheckBox.MarkOffsetX; |
jmitc91516 | 0:9140ec6aa604 | 1329 | sgl.CurItem.Y1 = Y2 + |
jmitc91516 | 0:9140ec6aa604 | 1330 | sgl.CurItem.CompPars.CompCheckBox.MarkOffsetY; |
jmitc91516 | 0:9140ec6aa604 | 1331 | sgl.CurItem.TextPar[0].Alignment = GuiLib_ALIGN_LEFT; |
jmitc91516 | 0:9140ec6aa604 | 1332 | sgl.CurItem.TextPar[0].Ps = GuiLib_PS_OFF; |
jmitc91516 | 0:9140ec6aa604 | 1333 | sgl.CurItem.TextPar[0].BitFlags = 0; |
jmitc91516 | 0:9140ec6aa604 | 1334 | sgl.CurItem.TextPar[0].BackBoxSizeX = 0; |
jmitc91516 | 0:9140ec6aa604 | 1335 | sgl.CurItem.TextPar[0].BackBorderPixels = 0; |
jmitc91516 | 0:9140ec6aa604 | 1336 | if (CheckmarkMode == 1) |
jmitc91516 | 0:9140ec6aa604 | 1337 | DrawText(sgl.CurItem.CompPars.CompCheckBox.MarkIconPtr, |
jmitc91516 | 0:9140ec6aa604 | 1338 | 1, |
jmitc91516 | 0:9140ec6aa604 | 1339 | 0, |
jmitc91516 | 0:9140ec6aa604 | 1340 | sgl.CurItem.CompPars.CompCheckBox.MarkColor, |
jmitc91516 | 0:9140ec6aa604 | 1341 | 0, |
jmitc91516 | 0:9140ec6aa604 | 1342 | 1); |
jmitc91516 | 0:9140ec6aa604 | 1343 | else |
jmitc91516 | 0:9140ec6aa604 | 1344 | DrawText(sgl.CurItem.CompPars.CompCheckBox.MarkIconPtr, |
jmitc91516 | 0:9140ec6aa604 | 1345 | 1, |
jmitc91516 | 0:9140ec6aa604 | 1346 | 0, |
jmitc91516 | 0:9140ec6aa604 | 1347 | BackColor, |
jmitc91516 | 0:9140ec6aa604 | 1348 | 0, |
jmitc91516 | 0:9140ec6aa604 | 1349 | 2); |
jmitc91516 | 0:9140ec6aa604 | 1350 | sgl.CurItem.TextPar[0] = TempTextPar; |
jmitc91516 | 0:9140ec6aa604 | 1351 | break; |
jmitc91516 | 0:9140ec6aa604 | 1352 | case GuiLib_CHECKBOX_MARK_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 1353 | if (CheckmarkMode == 1) |
jmitc91516 | 0:9140ec6aa604 | 1354 | { |
jmitc91516 | 0:9140ec6aa604 | 1355 | if (sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIsTransparent) |
jmitc91516 | 0:9140ec6aa604 | 1356 | BackColor2 = sgl.CurItem.CompPars.CompCheckBox.MarkBitmapTranspColor; |
jmitc91516 | 0:9140ec6aa604 | 1357 | else |
jmitc91516 | 0:9140ec6aa604 | 1358 | BackColor2 = -1; |
jmitc91516 | 0:9140ec6aa604 | 1359 | GuiLib_ShowBitmap(sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIndex, |
jmitc91516 | 0:9140ec6aa604 | 1360 | sgl.CurItem.X1 + |
jmitc91516 | 0:9140ec6aa604 | 1361 | sgl.CurItem.CompPars.CompCheckBox.MarkOffsetX, |
jmitc91516 | 0:9140ec6aa604 | 1362 | sgl.CurItem.Y1 + |
jmitc91516 | 0:9140ec6aa604 | 1363 | sgl.CurItem.CompPars.CompCheckBox.MarkOffsetY, |
jmitc91516 | 0:9140ec6aa604 | 1364 | BackColor2); |
jmitc91516 | 0:9140ec6aa604 | 1365 | } |
jmitc91516 | 0:9140ec6aa604 | 1366 | else |
jmitc91516 | 0:9140ec6aa604 | 1367 | { |
jmitc91516 | 0:9140ec6aa604 | 1368 | ReadBitmapSizes(sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIndex); |
jmitc91516 | 0:9140ec6aa604 | 1369 | GuiLib_FillBox(sgl.CurItem.X1, sgl.CurItem.Y1, |
jmitc91516 | 0:9140ec6aa604 | 1370 | sgl.CurItem.X1 + sgl.BitmapSizeX -1, sgl.CurItem.Y1 + sgl.BitmapSizeY - 1, |
jmitc91516 | 0:9140ec6aa604 | 1371 | BackColor); |
jmitc91516 | 0:9140ec6aa604 | 1372 | } |
jmitc91516 | 0:9140ec6aa604 | 1373 | break; |
jmitc91516 | 0:9140ec6aa604 | 1374 | } |
jmitc91516 | 0:9140ec6aa604 | 1375 | } |
jmitc91516 | 0:9140ec6aa604 | 1376 | } |
jmitc91516 | 0:9140ec6aa604 | 1377 | break; |
jmitc91516 | 0:9140ec6aa604 | 1378 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1379 | |
jmitc91516 | 0:9140ec6aa604 | 1380 | #ifdef GuiConst_ITEM_RADIOBUTTON_INUSE |
jmitc91516 | 0:9140ec6aa604 | 1381 | case GuiLib_ITEM_RADIOBUTTON: |
jmitc91516 | 0:9140ec6aa604 | 1382 | PrepareInternalStruct(); |
jmitc91516 | 0:9140ec6aa604 | 1383 | |
jmitc91516 | 0:9140ec6aa604 | 1384 | X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 1385 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 1386 | RemYMemory = sgl.Memory.Y[GuiLib_MEMORY_CNT]; |
jmitc91516 | 0:9140ec6aa604 | 1387 | |
jmitc91516 | 0:9140ec6aa604 | 1388 | if ((sgl.CurItem.VarPtr != 0) && |
jmitc91516 | 0:9140ec6aa604 | 1389 | (sgl.CurItem.VarType != GuiLib_VAR_STRING)) |
jmitc91516 | 0:9140ec6aa604 | 1390 | VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType); |
jmitc91516 | 0:9140ec6aa604 | 1391 | else |
jmitc91516 | 0:9140ec6aa604 | 1392 | VarValue = -1; |
jmitc91516 | 0:9140ec6aa604 | 1393 | |
jmitc91516 | 0:9140ec6aa604 | 1394 | for (N = 0; N < sgl.CurItem.CompPars.CompRadioButton.Count; N++) |
jmitc91516 | 0:9140ec6aa604 | 1395 | { |
jmitc91516 | 0:9140ec6aa604 | 1396 | GuiVarCompInt1 = sgl.CurItem.CompPars.CompRadioButton.Size; |
jmitc91516 | 0:9140ec6aa604 | 1397 | sgl.Memory.C[0] = ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 1398 | switch (sgl.CurItem.CompPars.CompRadioButton.Style) |
jmitc91516 | 0:9140ec6aa604 | 1399 | { |
jmitc91516 | 0:9140ec6aa604 | 1400 | case GuiLib_RADIOBUTTON_FLAT: |
jmitc91516 | 0:9140ec6aa604 | 1401 | if (BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 1402 | DrawSubStruct(GuiStructCOMP_RBFLATTRANSP, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1403 | else |
jmitc91516 | 0:9140ec6aa604 | 1404 | DrawSubStruct(GuiStructCOMP_RBFLAT, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1405 | break; |
jmitc91516 | 0:9140ec6aa604 | 1406 | case GuiLib_RADIOBUTTON_3D: |
jmitc91516 | 0:9140ec6aa604 | 1407 | if (!BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 1408 | DrawSubStruct(GuiStructCOMP_RB3DINNER, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1409 | DrawSubStruct(GuiStructCOMP_RB3D, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1410 | break; |
jmitc91516 | 0:9140ec6aa604 | 1411 | case GuiLib_RADIOBUTTON_ICON: |
jmitc91516 | 0:9140ec6aa604 | 1412 | TempTextPar = sgl.CurItem.TextPar[0]; |
jmitc91516 | 0:9140ec6aa604 | 1413 | SetCurFont(sgl.CurItem.CompPars.CompRadioButton.IconFont); |
jmitc91516 | 0:9140ec6aa604 | 1414 | sgl.CurItem.X1 = X1 + sgl.CurItem.CompPars.CompRadioButton.IconOffsetX; |
jmitc91516 | 0:9140ec6aa604 | 1415 | sgl.CurItem.Y1 = Y1 + sgl.CurItem.CompPars.CompRadioButton.IconOffsetY + |
jmitc91516 | 0:9140ec6aa604 | 1416 | sgl.CurFont->BaseLine; |
jmitc91516 | 0:9140ec6aa604 | 1417 | sgl.CurItem.TextPar[0].Alignment = GuiLib_ALIGN_LEFT; |
jmitc91516 | 0:9140ec6aa604 | 1418 | sgl.CurItem.TextPar[0].Ps = GuiLib_PS_OFF; |
jmitc91516 | 0:9140ec6aa604 | 1419 | sgl.CurItem.TextPar[0].BitFlags = 0; |
jmitc91516 | 0:9140ec6aa604 | 1420 | sgl.CurItem.TextPar[0].BackBoxSizeX = 0; |
jmitc91516 | 0:9140ec6aa604 | 1421 | sgl.CurItem.TextPar[0].BackBorderPixels = 0; |
jmitc91516 | 0:9140ec6aa604 | 1422 | DrawText(sgl.CurItem.CompPars.CompRadioButton.IconPtr, |
jmitc91516 | 0:9140ec6aa604 | 1423 | 1, |
jmitc91516 | 0:9140ec6aa604 | 1424 | 0, |
jmitc91516 | 0:9140ec6aa604 | 1425 | ForeColor, |
jmitc91516 | 0:9140ec6aa604 | 1426 | BackColor, |
jmitc91516 | 0:9140ec6aa604 | 1427 | BackColorTransp); |
jmitc91516 | 0:9140ec6aa604 | 1428 | sgl.CurItem.TextPar[0] = TempTextPar; |
jmitc91516 | 0:9140ec6aa604 | 1429 | break; |
jmitc91516 | 0:9140ec6aa604 | 1430 | case GuiLib_RADIOBUTTON_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 1431 | if (sgl.CurItem.CompPars.CompRadioButton.BitmapIsTransparent) |
jmitc91516 | 0:9140ec6aa604 | 1432 | BackColor2 = sgl.CurItem.CompPars.CompRadioButton.BitmapTranspColor; |
jmitc91516 | 0:9140ec6aa604 | 1433 | else |
jmitc91516 | 0:9140ec6aa604 | 1434 | BackColor2 = -1; |
jmitc91516 | 0:9140ec6aa604 | 1435 | GuiLib_ShowBitmap(sgl.CurItem.CompPars.CompRadioButton.BitmapIndex, |
jmitc91516 | 0:9140ec6aa604 | 1436 | X1, Y1, |
jmitc91516 | 0:9140ec6aa604 | 1437 | BackColor2); |
jmitc91516 | 0:9140ec6aa604 | 1438 | break; |
jmitc91516 | 0:9140ec6aa604 | 1439 | } |
jmitc91516 | 0:9140ec6aa604 | 1440 | |
jmitc91516 | 0:9140ec6aa604 | 1441 | if (VarValue == N) |
jmitc91516 | 0:9140ec6aa604 | 1442 | { |
jmitc91516 | 0:9140ec6aa604 | 1443 | GuiVarCompInt1 = sgl.CurItem.CompPars.CompRadioButton.Size; |
jmitc91516 | 0:9140ec6aa604 | 1444 | GuiVarCompInt2 = sgl.CurItem.CompPars.CompRadioButton.Size - 3; |
jmitc91516 | 0:9140ec6aa604 | 1445 | if (sgl.CurItem.CompPars.CompRadioButton.Style == |
jmitc91516 | 0:9140ec6aa604 | 1446 | GuiLib_RADIOBUTTON_FLAT) |
jmitc91516 | 0:9140ec6aa604 | 1447 | GuiVarCompInt2++; |
jmitc91516 | 0:9140ec6aa604 | 1448 | sgl.Memory.C[0] = sgl.CurItem.CompPars.CompRadioButton.MarkColor; |
jmitc91516 | 0:9140ec6aa604 | 1449 | switch (sgl.CurItem.CompPars.CompRadioButton.MarkStyle) |
jmitc91516 | 0:9140ec6aa604 | 1450 | { |
jmitc91516 | 0:9140ec6aa604 | 1451 | case GuiLib_RADIOBUTTON_MARK_STANDARD: |
jmitc91516 | 0:9140ec6aa604 | 1452 | if (GuiVarCompInt1 <= 1) |
jmitc91516 | 0:9140ec6aa604 | 1453 | DrawSubStruct(GuiStructCOMP_RBMSQUA, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1454 | else if (sgl.CurItem.CompPars.CompRadioButton.Style == |
jmitc91516 | 0:9140ec6aa604 | 1455 | GuiLib_RADIOBUTTON_FLAT) |
jmitc91516 | 0:9140ec6aa604 | 1456 | DrawSubStruct(GuiStructCOMP_RBMFLAT, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1457 | else |
jmitc91516 | 0:9140ec6aa604 | 1458 | DrawSubStruct(GuiStructCOMP_RBM3D, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1459 | break; |
jmitc91516 | 0:9140ec6aa604 | 1460 | case GuiLib_RADIOBUTTON_MARK_ICON: |
jmitc91516 | 0:9140ec6aa604 | 1461 | TempTextPar = sgl.CurItem.TextPar[0]; |
jmitc91516 | 0:9140ec6aa604 | 1462 | SetCurFont(sgl.CurItem.CompPars.CompRadioButton.MarkIconFont); |
jmitc91516 | 0:9140ec6aa604 | 1463 | sgl.CurItem.X1 = X1 + sgl.CurItem.CompPars.CompRadioButton.MarkOffsetX; |
jmitc91516 | 0:9140ec6aa604 | 1464 | sgl.CurItem.Y1 = Y1 + sgl.CurItem.CompPars.CompRadioButton.MarkOffsetY + |
jmitc91516 | 0:9140ec6aa604 | 1465 | sgl.CurFont->BaseLine; |
jmitc91516 | 0:9140ec6aa604 | 1466 | sgl.CurItem.TextPar[0].Alignment = GuiLib_ALIGN_LEFT; |
jmitc91516 | 0:9140ec6aa604 | 1467 | sgl.CurItem.TextPar[0].Ps = GuiLib_PS_OFF; |
jmitc91516 | 0:9140ec6aa604 | 1468 | sgl.CurItem.TextPar[0].BitFlags = 0; |
jmitc91516 | 0:9140ec6aa604 | 1469 | sgl.CurItem.TextPar[0].BackBoxSizeX = 0; |
jmitc91516 | 0:9140ec6aa604 | 1470 | sgl.CurItem.TextPar[0].BackBorderPixels = 0; |
jmitc91516 | 0:9140ec6aa604 | 1471 | DrawText(sgl.CurItem.CompPars.CompRadioButton.MarkIconPtr, |
jmitc91516 | 0:9140ec6aa604 | 1472 | 1, |
jmitc91516 | 0:9140ec6aa604 | 1473 | 0, |
jmitc91516 | 0:9140ec6aa604 | 1474 | ForeColor, |
jmitc91516 | 0:9140ec6aa604 | 1475 | BackColor, |
jmitc91516 | 0:9140ec6aa604 | 1476 | BackColorTransp); |
jmitc91516 | 0:9140ec6aa604 | 1477 | sgl.CurItem.TextPar[0] = TempTextPar; |
jmitc91516 | 0:9140ec6aa604 | 1478 | break; |
jmitc91516 | 0:9140ec6aa604 | 1479 | case GuiLib_RADIOBUTTON_MARK_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 1480 | if (sgl.CurItem.CompPars.CompRadioButton.MarkBitmapIsTransparent) |
jmitc91516 | 0:9140ec6aa604 | 1481 | BackColor2 = sgl.CurItem.CompPars.CompRadioButton.MarkBitmapTranspColor; |
jmitc91516 | 0:9140ec6aa604 | 1482 | else |
jmitc91516 | 0:9140ec6aa604 | 1483 | BackColor2 = -1; |
jmitc91516 | 0:9140ec6aa604 | 1484 | GuiLib_ShowBitmap(sgl.CurItem.CompPars.CompRadioButton.MarkBitmapIndex, |
jmitc91516 | 0:9140ec6aa604 | 1485 | X1 + |
jmitc91516 | 0:9140ec6aa604 | 1486 | sgl.CurItem.CompPars.CompRadioButton.MarkOffsetX, |
jmitc91516 | 0:9140ec6aa604 | 1487 | Y1 + |
jmitc91516 | 0:9140ec6aa604 | 1488 | sgl.CurItem.CompPars.CompRadioButton.MarkOffsetY, |
jmitc91516 | 0:9140ec6aa604 | 1489 | BackColor2); |
jmitc91516 | 0:9140ec6aa604 | 1490 | break; |
jmitc91516 | 0:9140ec6aa604 | 1491 | } |
jmitc91516 | 0:9140ec6aa604 | 1492 | } |
jmitc91516 | 0:9140ec6aa604 | 1493 | |
jmitc91516 | 0:9140ec6aa604 | 1494 | Y1 += sgl.CurItem.CompPars.CompRadioButton.InterDistance; |
jmitc91516 | 0:9140ec6aa604 | 1495 | sgl.Memory.Y[GuiLib_MEMORY_CNT] += |
jmitc91516 | 0:9140ec6aa604 | 1496 | sgl.CurItem.CompPars.CompRadioButton.InterDistance; |
jmitc91516 | 0:9140ec6aa604 | 1497 | } |
jmitc91516 | 0:9140ec6aa604 | 1498 | |
jmitc91516 | 0:9140ec6aa604 | 1499 | sgl.Memory.Y[GuiLib_MEMORY_CNT] = RemYMemory; |
jmitc91516 | 0:9140ec6aa604 | 1500 | break; |
jmitc91516 | 0:9140ec6aa604 | 1501 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1502 | |
jmitc91516 | 0:9140ec6aa604 | 1503 | #ifdef GuiConst_ITEM_BUTTON_INUSE |
jmitc91516 | 0:9140ec6aa604 | 1504 | case GuiLib_ITEM_BUTTON: |
jmitc91516 | 0:9140ec6aa604 | 1505 | PrepareInternalStruct(); |
jmitc91516 | 0:9140ec6aa604 | 1506 | |
jmitc91516 | 0:9140ec6aa604 | 1507 | X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 1508 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 1509 | X2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 1510 | Y2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 1511 | RemX1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 1512 | RemY1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 1513 | |
jmitc91516 | 0:9140ec6aa604 | 1514 | GuiVarCompInt1 = X2 - X1 + 1; |
jmitc91516 | 0:9140ec6aa604 | 1515 | GuiVarCompInt2 = Y2 - Y1 + 1; |
jmitc91516 | 0:9140ec6aa604 | 1516 | GuiVarCompInt3 = sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 1517 | GuiVarCompInt4 = GuiVarCompInt1 - sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 1518 | GuiVarCompInt5 = GuiVarCompInt2 - sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 1519 | |
jmitc91516 | 0:9140ec6aa604 | 1520 | sgl.Memory.C[0] = ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 1521 | sgl.Memory.C[1] = BackColor; |
jmitc91516 | 0:9140ec6aa604 | 1522 | |
jmitc91516 | 0:9140ec6aa604 | 1523 | if (sgl.ButtonColorOverride == GuiLib_TRUE) |
jmitc91516 | 0:9140ec6aa604 | 1524 | sgl.Memory.C[2] = sgl.DisabledButtonColor; |
jmitc91516 | 0:9140ec6aa604 | 1525 | else |
jmitc91516 | 0:9140ec6aa604 | 1526 | sgl.Memory.C[2] = GuiLib_DesaturatePixelColor(BackColor,800); |
jmitc91516 | 0:9140ec6aa604 | 1527 | |
jmitc91516 | 0:9140ec6aa604 | 1528 | if ((sgl.CurItem.VarPtr != 0) && |
jmitc91516 | 0:9140ec6aa604 | 1529 | (sgl.CurItem.VarType != GuiLib_VAR_STRING)) |
jmitc91516 | 0:9140ec6aa604 | 1530 | { |
jmitc91516 | 0:9140ec6aa604 | 1531 | VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType); |
jmitc91516 | 0:9140ec6aa604 | 1532 | if ((VarValue < GuiLib_BUTTON_STATE_UP) || |
jmitc91516 | 0:9140ec6aa604 | 1533 | (VarValue > GuiLib_BUTTON_STATE_DISABLED)) |
jmitc91516 | 0:9140ec6aa604 | 1534 | VarValue = GuiLib_BUTTON_STATE_UP; |
jmitc91516 | 0:9140ec6aa604 | 1535 | } |
jmitc91516 | 0:9140ec6aa604 | 1536 | else |
jmitc91516 | 0:9140ec6aa604 | 1537 | VarValue = GuiLib_BUTTON_STATE_UP; |
jmitc91516 | 0:9140ec6aa604 | 1538 | |
jmitc91516 | 0:9140ec6aa604 | 1539 | DisabledGlyphColorInUse = 0; |
jmitc91516 | 0:9140ec6aa604 | 1540 | DisabledTextColorInUse = 0; |
jmitc91516 | 0:9140ec6aa604 | 1541 | switch (sgl.CurItem.CompPars.CompButton.BodyStyle) |
jmitc91516 | 0:9140ec6aa604 | 1542 | { |
jmitc91516 | 0:9140ec6aa604 | 1543 | case GuiLib_BUTTON_BODY_FLAT: |
jmitc91516 | 0:9140ec6aa604 | 1544 | switch (VarValue) |
jmitc91516 | 0:9140ec6aa604 | 1545 | { |
jmitc91516 | 0:9140ec6aa604 | 1546 | case 0 : |
jmitc91516 | 0:9140ec6aa604 | 1547 | if (sgl.CurItem.R1 == 0) |
jmitc91516 | 0:9140ec6aa604 | 1548 | DrawSubStruct(GuiStructCOMP_BUFLAT0, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1549 | else |
jmitc91516 | 0:9140ec6aa604 | 1550 | DrawSubStruct(GuiStructCOMP_BUFLATR0, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1551 | break; |
jmitc91516 | 0:9140ec6aa604 | 1552 | case 1 : |
jmitc91516 | 0:9140ec6aa604 | 1553 | if (sgl.CurItem.R1 == 0) |
jmitc91516 | 0:9140ec6aa604 | 1554 | DrawSubStruct(GuiStructCOMP_BUFLAT1, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1555 | else |
jmitc91516 | 0:9140ec6aa604 | 1556 | DrawSubStruct(GuiStructCOMP_BUFLATR1, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1557 | break; |
jmitc91516 | 0:9140ec6aa604 | 1558 | case 2 : |
jmitc91516 | 0:9140ec6aa604 | 1559 | if (sgl.CurItem.R1 == 0) |
jmitc91516 | 0:9140ec6aa604 | 1560 | DrawSubStruct(GuiStructCOMP_BUFLAT2, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1561 | else |
jmitc91516 | 0:9140ec6aa604 | 1562 | DrawSubStruct(GuiStructCOMP_BUFLATR2, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1563 | DisabledGlyphColorInUse = |
jmitc91516 | 0:9140ec6aa604 | 1564 | (sgl.CurItem.CompPars.CompButton.GlyphLikeUp & 0x02); |
jmitc91516 | 0:9140ec6aa604 | 1565 | DisabledTextColorInUse = |
jmitc91516 | 0:9140ec6aa604 | 1566 | (sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x08); |
jmitc91516 | 0:9140ec6aa604 | 1567 | break; |
jmitc91516 | 0:9140ec6aa604 | 1568 | } |
jmitc91516 | 0:9140ec6aa604 | 1569 | break; |
jmitc91516 | 0:9140ec6aa604 | 1570 | case GuiLib_BUTTON_BODY_3D: |
jmitc91516 | 0:9140ec6aa604 | 1571 | switch (VarValue) |
jmitc91516 | 0:9140ec6aa604 | 1572 | { |
jmitc91516 | 0:9140ec6aa604 | 1573 | case 0 : |
jmitc91516 | 0:9140ec6aa604 | 1574 | if (sgl.CurItem.R1 == 0) |
jmitc91516 | 0:9140ec6aa604 | 1575 | DrawSubStruct(GuiStructCOMP_BU3D0, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1576 | else |
jmitc91516 | 0:9140ec6aa604 | 1577 | DrawSubStruct(GuiStructCOMP_BU3DR0, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1578 | break; |
jmitc91516 | 0:9140ec6aa604 | 1579 | case 1 : |
jmitc91516 | 0:9140ec6aa604 | 1580 | if (sgl.CurItem.R1 == 0) |
jmitc91516 | 0:9140ec6aa604 | 1581 | DrawSubStruct(GuiStructCOMP_BU3D1, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1582 | else |
jmitc91516 | 0:9140ec6aa604 | 1583 | DrawSubStruct(GuiStructCOMP_BU3DR1, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1584 | break; |
jmitc91516 | 0:9140ec6aa604 | 1585 | case 2 : |
jmitc91516 | 0:9140ec6aa604 | 1586 | if (sgl.CurItem.R1 == 0) |
jmitc91516 | 0:9140ec6aa604 | 1587 | DrawSubStruct(GuiStructCOMP_BU3D2, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1588 | else |
jmitc91516 | 0:9140ec6aa604 | 1589 | DrawSubStruct(GuiStructCOMP_BU3DR2, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1590 | DisabledGlyphColorInUse = |
jmitc91516 | 0:9140ec6aa604 | 1591 | !(sgl.CurItem.CompPars.CompButton.GlyphLikeUp & 0x02); |
jmitc91516 | 0:9140ec6aa604 | 1592 | DisabledTextColorInUse = |
jmitc91516 | 0:9140ec6aa604 | 1593 | !(sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x08); |
jmitc91516 | 0:9140ec6aa604 | 1594 | break; |
jmitc91516 | 0:9140ec6aa604 | 1595 | } |
jmitc91516 | 0:9140ec6aa604 | 1596 | break; |
jmitc91516 | 0:9140ec6aa604 | 1597 | case GuiLib_BUTTON_BODY_ICON: |
jmitc91516 | 0:9140ec6aa604 | 1598 | TempTextPar = sgl.CurItem.TextPar[VarValue]; |
jmitc91516 | 0:9140ec6aa604 | 1599 | SetCurFont(sgl.CurItem.CompPars.CompButton.BodyIconFont[VarValue]); |
jmitc91516 | 0:9140ec6aa604 | 1600 | sgl.CurItem.X1 = |
jmitc91516 | 0:9140ec6aa604 | 1601 | X1 + |
jmitc91516 | 0:9140ec6aa604 | 1602 | sgl.CurItem.CompPars.CompButton.BodyIconOffsetX[VarValue]; |
jmitc91516 | 0:9140ec6aa604 | 1603 | sgl.CurItem.Y1 = |
jmitc91516 | 0:9140ec6aa604 | 1604 | Y1 + |
jmitc91516 | 0:9140ec6aa604 | 1605 | sgl.CurItem.CompPars.CompButton.BodyIconOffsetY[VarValue] + |
jmitc91516 | 0:9140ec6aa604 | 1606 | sgl.CurFont->BaseLine; |
jmitc91516 | 0:9140ec6aa604 | 1607 | sgl.CurItem.TextPar[VarValue].Alignment = GuiLib_ALIGN_LEFT; |
jmitc91516 | 0:9140ec6aa604 | 1608 | sgl.CurItem.TextPar[VarValue].Ps = GuiLib_PS_OFF; |
jmitc91516 | 0:9140ec6aa604 | 1609 | sgl.CurItem.TextPar[VarValue].BitFlags = 0; |
jmitc91516 | 0:9140ec6aa604 | 1610 | sgl.CurItem.TextPar[VarValue].BackBoxSizeX = 0; |
jmitc91516 | 0:9140ec6aa604 | 1611 | sgl.CurItem.TextPar[VarValue].BackBorderPixels = 0; |
jmitc91516 | 0:9140ec6aa604 | 1612 | DrawText(sgl.CurItem.CompPars.CompButton.BodyIconPtr[VarValue], |
jmitc91516 | 0:9140ec6aa604 | 1613 | 1, |
jmitc91516 | 0:9140ec6aa604 | 1614 | VarValue, |
jmitc91516 | 0:9140ec6aa604 | 1615 | ForeColor, |
jmitc91516 | 0:9140ec6aa604 | 1616 | BackColor, |
jmitc91516 | 0:9140ec6aa604 | 1617 | BackColorTransp); |
jmitc91516 | 0:9140ec6aa604 | 1618 | sgl.CurItem.TextPar[VarValue] = TempTextPar; |
jmitc91516 | 0:9140ec6aa604 | 1619 | X1 = sgl.FontWriteX1; |
jmitc91516 | 0:9140ec6aa604 | 1620 | Y1 = sgl.FontWriteY1; |
jmitc91516 | 0:9140ec6aa604 | 1621 | X2 = sgl.FontWriteX2; |
jmitc91516 | 0:9140ec6aa604 | 1622 | Y2 = sgl.FontWriteY2; |
jmitc91516 | 0:9140ec6aa604 | 1623 | break; |
jmitc91516 | 0:9140ec6aa604 | 1624 | case GuiLib_BUTTON_BODY_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 1625 | if (sgl.CurItem.CompPars.CompButton.BodyBitmapIsTransparent[VarValue]) |
jmitc91516 | 0:9140ec6aa604 | 1626 | BackColor2 = |
jmitc91516 | 0:9140ec6aa604 | 1627 | sgl.CurItem.CompPars.CompButton.BodyBitmapTranspColor[VarValue]; |
jmitc91516 | 0:9140ec6aa604 | 1628 | else |
jmitc91516 | 0:9140ec6aa604 | 1629 | BackColor2 = -1; |
jmitc91516 | 0:9140ec6aa604 | 1630 | GuiLib_ShowBitmap(sgl.CurItem.CompPars.CompButton.BodyBitmapIndex[VarValue], |
jmitc91516 | 0:9140ec6aa604 | 1631 | X1, Y1, |
jmitc91516 | 0:9140ec6aa604 | 1632 | BackColor2); |
jmitc91516 | 0:9140ec6aa604 | 1633 | X2 = sgl.BitmapWriteX2; |
jmitc91516 | 0:9140ec6aa604 | 1634 | Y2 = sgl.BitmapWriteY2; |
jmitc91516 | 0:9140ec6aa604 | 1635 | break; |
jmitc91516 | 0:9140ec6aa604 | 1636 | } |
jmitc91516 | 0:9140ec6aa604 | 1637 | |
jmitc91516 | 0:9140ec6aa604 | 1638 | CX = (X1 + X2) / 2; |
jmitc91516 | 0:9140ec6aa604 | 1639 | CY = (Y1 + Y2) / 2; |
jmitc91516 | 0:9140ec6aa604 | 1640 | |
jmitc91516 | 0:9140ec6aa604 | 1641 | #ifdef GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 1642 | RemClippingX1 = sgl.CurItem.ClipRectX1; |
jmitc91516 | 0:9140ec6aa604 | 1643 | RemClippingY1 = sgl.CurItem.ClipRectY1; |
jmitc91516 | 0:9140ec6aa604 | 1644 | RemClippingX2 = sgl.CurItem.ClipRectX2; |
jmitc91516 | 0:9140ec6aa604 | 1645 | RemClippingY2 = sgl.CurItem.ClipRectY2; |
jmitc91516 | 0:9140ec6aa604 | 1646 | sgl.CurItem.ClipRectX1 = GuiLib_GET_MAX(sgl.CurItem.ClipRectX1, X1); |
jmitc91516 | 0:9140ec6aa604 | 1647 | sgl.CurItem.ClipRectY1 = GuiLib_GET_MAX(sgl.CurItem.ClipRectY1, Y1); |
jmitc91516 | 0:9140ec6aa604 | 1648 | sgl.CurItem.ClipRectX2 = GuiLib_GET_MIN(sgl.CurItem.ClipRectX2, X2); |
jmitc91516 | 0:9140ec6aa604 | 1649 | sgl.CurItem.ClipRectY2 = GuiLib_GET_MIN(sgl.CurItem.ClipRectY2, Y2); |
jmitc91516 | 0:9140ec6aa604 | 1650 | GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1, |
jmitc91516 | 0:9140ec6aa604 | 1651 | sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2); |
jmitc91516 | 0:9140ec6aa604 | 1652 | #endif // GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 1653 | |
jmitc91516 | 0:9140ec6aa604 | 1654 | if (sgl.CurItem.CompPars.CompButton.Layout != GuiLib_BUTTON_LAYOUT_TEXT) |
jmitc91516 | 0:9140ec6aa604 | 1655 | { |
jmitc91516 | 0:9140ec6aa604 | 1656 | switch (sgl.CurItem.CompPars.CompButton.Layout) |
jmitc91516 | 0:9140ec6aa604 | 1657 | { |
jmitc91516 | 0:9140ec6aa604 | 1658 | case GuiLib_BUTTON_LAYOUT_GLYPH: |
jmitc91516 | 0:9140ec6aa604 | 1659 | GX1 = CX; |
jmitc91516 | 0:9140ec6aa604 | 1660 | GY1 = CY; |
jmitc91516 | 0:9140ec6aa604 | 1661 | break; |
jmitc91516 | 0:9140ec6aa604 | 1662 | case GuiLib_BUTTON_LAYOUT_GLYPHLEFT: |
jmitc91516 | 0:9140ec6aa604 | 1663 | GX1 = X1 + GuiLib_GET_MIN((Y2 - Y1) / 2, (X2 - X1) / 4); |
jmitc91516 | 0:9140ec6aa604 | 1664 | GY1 = CY; |
jmitc91516 | 0:9140ec6aa604 | 1665 | break; |
jmitc91516 | 0:9140ec6aa604 | 1666 | case GuiLib_BUTTON_LAYOUT_GLYPHRIGHT: |
jmitc91516 | 0:9140ec6aa604 | 1667 | GX1 = X2 - GuiLib_GET_MIN((Y2 - Y1) / 2, (X2 - X1) / 4); |
jmitc91516 | 0:9140ec6aa604 | 1668 | GY1 = CY; |
jmitc91516 | 0:9140ec6aa604 | 1669 | break; |
jmitc91516 | 0:9140ec6aa604 | 1670 | case GuiLib_BUTTON_LAYOUT_GLYPHTOP: |
jmitc91516 | 0:9140ec6aa604 | 1671 | GX1 = CX; |
jmitc91516 | 0:9140ec6aa604 | 1672 | GY1 = Y1 + ((Y2 - Y1) / 4); |
jmitc91516 | 0:9140ec6aa604 | 1673 | break; |
jmitc91516 | 0:9140ec6aa604 | 1674 | case GuiLib_BUTTON_LAYOUT_GLYPHBOTTOM: |
jmitc91516 | 0:9140ec6aa604 | 1675 | GX1 = CX; |
jmitc91516 | 0:9140ec6aa604 | 1676 | GY1 = Y2 - ((Y2 - Y1) / 4); |
jmitc91516 | 0:9140ec6aa604 | 1677 | break; |
jmitc91516 | 0:9140ec6aa604 | 1678 | } |
jmitc91516 | 0:9140ec6aa604 | 1679 | switch (sgl.CurItem.CompPars.CompButton.GlyphStyle) |
jmitc91516 | 0:9140ec6aa604 | 1680 | { |
jmitc91516 | 0:9140ec6aa604 | 1681 | case GuiLib_BUTTON_GLYPH_ICON: |
jmitc91516 | 0:9140ec6aa604 | 1682 | TempTextPar = sgl.CurItem.TextPar[VarValue]; |
jmitc91516 | 0:9140ec6aa604 | 1683 | SetCurFont(sgl.CurItem.CompPars.CompButton.GlyphIconFont[VarValue]); |
jmitc91516 | 0:9140ec6aa604 | 1684 | sgl.CurItem.X1 = |
jmitc91516 | 0:9140ec6aa604 | 1685 | GX1 + |
jmitc91516 | 0:9140ec6aa604 | 1686 | sgl.CurItem.CompPars.CompButton.GlyphIconOffsetX[VarValue]; |
jmitc91516 | 0:9140ec6aa604 | 1687 | sgl.CurItem.Y1 = |
jmitc91516 | 0:9140ec6aa604 | 1688 | GY1 + |
jmitc91516 | 0:9140ec6aa604 | 1689 | sgl.CurItem.CompPars.CompButton.GlyphIconOffsetY[VarValue] + |
jmitc91516 | 0:9140ec6aa604 | 1690 | GuiLib_FONT_MID_Y(sgl.CurFont->BaseLine, sgl.CurFont->TopLine); |
jmitc91516 | 0:9140ec6aa604 | 1691 | sgl.CurItem.TextPar[VarValue].Alignment = GuiLib_ALIGN_CENTER; |
jmitc91516 | 0:9140ec6aa604 | 1692 | sgl.CurItem.TextPar[VarValue].Ps = GuiLib_PS_OFF; |
jmitc91516 | 0:9140ec6aa604 | 1693 | sgl.CurItem.TextPar[VarValue].BitFlags = 0; |
jmitc91516 | 0:9140ec6aa604 | 1694 | sgl.CurItem.TextPar[VarValue].BackBoxSizeX = 0; |
jmitc91516 | 0:9140ec6aa604 | 1695 | sgl.CurItem.TextPar[VarValue].BackBorderPixels = 0; |
jmitc91516 | 0:9140ec6aa604 | 1696 | if (DisabledGlyphColorInUse) |
jmitc91516 | 0:9140ec6aa604 | 1697 | ButtonColor = GuiLib_MiddlePixelColor( |
jmitc91516 | 0:9140ec6aa604 | 1698 | sgl.CurItem.CompPars.CompButton.GlyphIconColor[VarValue], |
jmitc91516 | 0:9140ec6aa604 | 1699 | sgl.Memory.C[2], |
jmitc91516 | 0:9140ec6aa604 | 1700 | 800); |
jmitc91516 | 0:9140ec6aa604 | 1701 | else |
jmitc91516 | 0:9140ec6aa604 | 1702 | ButtonColor = sgl.CurItem.CompPars.CompButton.GlyphIconColor[VarValue]; |
jmitc91516 | 0:9140ec6aa604 | 1703 | DrawText(sgl.CurItem.CompPars.CompButton.GlyphIconPtr[VarValue], |
jmitc91516 | 0:9140ec6aa604 | 1704 | 1, |
jmitc91516 | 0:9140ec6aa604 | 1705 | VarValue, |
jmitc91516 | 0:9140ec6aa604 | 1706 | ButtonColor, |
jmitc91516 | 0:9140ec6aa604 | 1707 | 0, |
jmitc91516 | 0:9140ec6aa604 | 1708 | GuiLib_TRUE); |
jmitc91516 | 0:9140ec6aa604 | 1709 | sgl.CurItem.TextPar[VarValue] = TempTextPar; |
jmitc91516 | 0:9140ec6aa604 | 1710 | GX1 = sgl.FontWriteX1; |
jmitc91516 | 0:9140ec6aa604 | 1711 | GY1 = sgl.FontWriteY1; |
jmitc91516 | 0:9140ec6aa604 | 1712 | GX2 = sgl.FontWriteX2; |
jmitc91516 | 0:9140ec6aa604 | 1713 | GY2 = sgl.FontWriteY2; |
jmitc91516 | 0:9140ec6aa604 | 1714 | break; |
jmitc91516 | 0:9140ec6aa604 | 1715 | case GuiLib_BUTTON_GLYPH_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 1716 | ReadBitmapSizes(sgl.CurItem.CompPars.CompButton.GlyphBitmapIndex[VarValue]); |
jmitc91516 | 0:9140ec6aa604 | 1717 | GX1 -= sgl.BitmapSizeX / 2; |
jmitc91516 | 0:9140ec6aa604 | 1718 | GY1 -= sgl.BitmapSizeY / 2; |
jmitc91516 | 0:9140ec6aa604 | 1719 | |
jmitc91516 | 0:9140ec6aa604 | 1720 | GX1 += sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetX[VarValue]; |
jmitc91516 | 0:9140ec6aa604 | 1721 | GY1 += sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetY[VarValue]; |
jmitc91516 | 0:9140ec6aa604 | 1722 | if (sgl.CurItem.CompPars.CompButton.GlyphBitmapIsTransparent[VarValue]) |
jmitc91516 | 0:9140ec6aa604 | 1723 | BackColor2 = sgl.CurItem.CompPars.CompButton.GlyphBitmapTranspColor[VarValue]; |
jmitc91516 | 0:9140ec6aa604 | 1724 | else |
jmitc91516 | 0:9140ec6aa604 | 1725 | BackColor2 = -1; |
jmitc91516 | 0:9140ec6aa604 | 1726 | GuiLib_ShowBitmap(sgl.CurItem.CompPars.CompButton.GlyphBitmapIndex[VarValue], |
jmitc91516 | 0:9140ec6aa604 | 1727 | GX1, GY1, |
jmitc91516 | 0:9140ec6aa604 | 1728 | BackColor2); |
jmitc91516 | 0:9140ec6aa604 | 1729 | GX2 = sgl.BitmapWriteX2; |
jmitc91516 | 0:9140ec6aa604 | 1730 | GY2 = sgl.BitmapWriteY2; |
jmitc91516 | 0:9140ec6aa604 | 1731 | break; |
jmitc91516 | 0:9140ec6aa604 | 1732 | } |
jmitc91516 | 0:9140ec6aa604 | 1733 | } |
jmitc91516 | 0:9140ec6aa604 | 1734 | |
jmitc91516 | 0:9140ec6aa604 | 1735 | if (sgl.CurItem.CompPars.CompButton.Layout != GuiLib_BUTTON_LAYOUT_GLYPH) |
jmitc91516 | 0:9140ec6aa604 | 1736 | { |
jmitc91516 | 0:9140ec6aa604 | 1737 | TempTextPar = sgl.CurItem.TextPar[VarValue]; |
jmitc91516 | 0:9140ec6aa604 | 1738 | SetCurFont(sgl.CurItem.TextPar[VarValue].FontIndex); |
jmitc91516 | 0:9140ec6aa604 | 1739 | switch (sgl.CurItem.CompPars.CompButton.Layout) |
jmitc91516 | 0:9140ec6aa604 | 1740 | { |
jmitc91516 | 0:9140ec6aa604 | 1741 | case GuiLib_BUTTON_LAYOUT_TEXT: |
jmitc91516 | 0:9140ec6aa604 | 1742 | sgl.CurItem.X1 = CX; |
jmitc91516 | 0:9140ec6aa604 | 1743 | sgl.CurItem.Y1 = CY; |
jmitc91516 | 0:9140ec6aa604 | 1744 | break; |
jmitc91516 | 0:9140ec6aa604 | 1745 | case GuiLib_BUTTON_LAYOUT_GLYPHLEFT: |
jmitc91516 | 0:9140ec6aa604 | 1746 | sgl.CurItem.X1 = X2 - ((X2 - GX2 + 1) / 2); |
jmitc91516 | 0:9140ec6aa604 | 1747 | sgl.CurItem.Y1 = CY; |
jmitc91516 | 0:9140ec6aa604 | 1748 | break; |
jmitc91516 | 0:9140ec6aa604 | 1749 | case GuiLib_BUTTON_LAYOUT_GLYPHRIGHT: |
jmitc91516 | 0:9140ec6aa604 | 1750 | sgl.CurItem.X1 = X1 + ((GX1 - X1 + 1) / 2); |
jmitc91516 | 0:9140ec6aa604 | 1751 | sgl.CurItem.Y1 = CY; |
jmitc91516 | 0:9140ec6aa604 | 1752 | break; |
jmitc91516 | 0:9140ec6aa604 | 1753 | case GuiLib_BUTTON_LAYOUT_GLYPHTOP: |
jmitc91516 | 0:9140ec6aa604 | 1754 | sgl.CurItem.X1 = CX; |
jmitc91516 | 0:9140ec6aa604 | 1755 | sgl.CurItem.Y1 = Y2 - ((Y2 - GY2 + 1) / 2); |
jmitc91516 | 0:9140ec6aa604 | 1756 | break; |
jmitc91516 | 0:9140ec6aa604 | 1757 | case GuiLib_BUTTON_LAYOUT_GLYPHBOTTOM: |
jmitc91516 | 0:9140ec6aa604 | 1758 | sgl.CurItem.X1 = CX; |
jmitc91516 | 0:9140ec6aa604 | 1759 | sgl.CurItem.Y1 = Y1 + ((GY1 - Y1 + 1) / 2); |
jmitc91516 | 0:9140ec6aa604 | 1760 | break; |
jmitc91516 | 0:9140ec6aa604 | 1761 | } |
jmitc91516 | 0:9140ec6aa604 | 1762 | sgl.CurItem.Y1 += |
jmitc91516 | 0:9140ec6aa604 | 1763 | GuiLib_FONT_MID_Y(sgl.CurFont->BaseLine, sgl.CurFont->TopLine); |
jmitc91516 | 0:9140ec6aa604 | 1764 | sgl.CurItem.TextPar[VarValue].Alignment = GuiLib_ALIGN_CENTER; |
jmitc91516 | 0:9140ec6aa604 | 1765 | sgl.CurItem.TextPar[VarValue].BitFlags = 0; |
jmitc91516 | 0:9140ec6aa604 | 1766 | sgl.CurItem.TextPar[VarValue].BackBoxSizeX = 0; |
jmitc91516 | 0:9140ec6aa604 | 1767 | sgl.CurItem.TextPar[VarValue].BackBorderPixels = 0; |
jmitc91516 | 0:9140ec6aa604 | 1768 | if (DisabledTextColorInUse) |
jmitc91516 | 0:9140ec6aa604 | 1769 | ButtonColor = GuiLib_MiddlePixelColor( |
jmitc91516 | 0:9140ec6aa604 | 1770 | sgl.CurItem.CompPars.CompButton.TextColor[VarValue], |
jmitc91516 | 0:9140ec6aa604 | 1771 | sgl.Memory.C[2], |
jmitc91516 | 0:9140ec6aa604 | 1772 | 800); |
jmitc91516 | 0:9140ec6aa604 | 1773 | else |
jmitc91516 | 0:9140ec6aa604 | 1774 | ButtonColor = sgl.CurItem.CompPars.CompButton.TextColor[VarValue]; |
jmitc91516 | 0:9140ec6aa604 | 1775 | DRAW_ROM_TEXT(GetItemTextPtr(VarValue), |
jmitc91516 | 0:9140ec6aa604 | 1776 | sgl.CurItem.TextLength[VarValue], |
jmitc91516 | 0:9140ec6aa604 | 1777 | VarValue, |
jmitc91516 | 0:9140ec6aa604 | 1778 | ButtonColor, |
jmitc91516 | 0:9140ec6aa604 | 1779 | 0, |
jmitc91516 | 0:9140ec6aa604 | 1780 | GuiLib_TRUE); |
jmitc91516 | 0:9140ec6aa604 | 1781 | sgl.CurItem.TextPar[VarValue] = TempTextPar; |
jmitc91516 | 0:9140ec6aa604 | 1782 | } |
jmitc91516 | 0:9140ec6aa604 | 1783 | |
jmitc91516 | 0:9140ec6aa604 | 1784 | sgl.CurItem.X1 = RemX1; |
jmitc91516 | 0:9140ec6aa604 | 1785 | sgl.CurItem.Y1 = RemY1; |
jmitc91516 | 0:9140ec6aa604 | 1786 | |
jmitc91516 | 0:9140ec6aa604 | 1787 | #ifdef GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 1788 | sgl.CurItem.ClipRectX1 = RemClippingX1; |
jmitc91516 | 0:9140ec6aa604 | 1789 | sgl.CurItem.ClipRectY1 = RemClippingY1; |
jmitc91516 | 0:9140ec6aa604 | 1790 | sgl.CurItem.ClipRectX2 = RemClippingX2; |
jmitc91516 | 0:9140ec6aa604 | 1791 | sgl.CurItem.ClipRectY2 = RemClippingY2; |
jmitc91516 | 0:9140ec6aa604 | 1792 | GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1, |
jmitc91516 | 0:9140ec6aa604 | 1793 | sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2); |
jmitc91516 | 0:9140ec6aa604 | 1794 | #endif // GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 1795 | |
jmitc91516 | 0:9140ec6aa604 | 1796 | break; |
jmitc91516 | 0:9140ec6aa604 | 1797 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1798 | |
jmitc91516 | 0:9140ec6aa604 | 1799 | #ifdef GuiConst_ITEM_PANEL_INUSE |
jmitc91516 | 0:9140ec6aa604 | 1800 | case GuiLib_ITEM_PANEL: |
jmitc91516 | 0:9140ec6aa604 | 1801 | PrepareInternalStruct(); |
jmitc91516 | 0:9140ec6aa604 | 1802 | |
jmitc91516 | 0:9140ec6aa604 | 1803 | X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 1804 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 1805 | X2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 1806 | Y2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 1807 | OrderCoord(&X1, &X2); |
jmitc91516 | 0:9140ec6aa604 | 1808 | OrderCoord(&Y1, &Y2); |
jmitc91516 | 0:9140ec6aa604 | 1809 | |
jmitc91516 | 0:9140ec6aa604 | 1810 | GuiVarCompInt1 = X2 - X1 + 1; |
jmitc91516 | 0:9140ec6aa604 | 1811 | GuiVarCompInt2 = Y2 - Y1 + 1; |
jmitc91516 | 0:9140ec6aa604 | 1812 | GuiVarCompInt3 = sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 1813 | GuiVarCompInt4 = GuiVarCompInt1 - sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 1814 | GuiVarCompInt5 = GuiVarCompInt2 - sgl.CurItem.R1; |
jmitc91516 | 0:9140ec6aa604 | 1815 | |
jmitc91516 | 0:9140ec6aa604 | 1816 | sgl.Memory.C[0] = ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 1817 | switch (sgl.CurItem.CompPars.CompPanel.Style) |
jmitc91516 | 0:9140ec6aa604 | 1818 | { |
jmitc91516 | 0:9140ec6aa604 | 1819 | case GuiLib_PANEL_FLAT: |
jmitc91516 | 0:9140ec6aa604 | 1820 | if (sgl.CurItem.R1 == 0) |
jmitc91516 | 0:9140ec6aa604 | 1821 | { |
jmitc91516 | 0:9140ec6aa604 | 1822 | if (BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 1823 | DrawSubStruct(GuiStructCOMP_PAFLATTRANSP, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1824 | else |
jmitc91516 | 0:9140ec6aa604 | 1825 | DrawSubStruct(GuiStructCOMP_PAFLAT, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1826 | } |
jmitc91516 | 0:9140ec6aa604 | 1827 | else |
jmitc91516 | 0:9140ec6aa604 | 1828 | { |
jmitc91516 | 0:9140ec6aa604 | 1829 | if (BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 1830 | DrawSubStruct(GuiStructCOMP_PAFLATTRANSPR, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1831 | else |
jmitc91516 | 0:9140ec6aa604 | 1832 | DrawSubStruct(GuiStructCOMP_PAFLATR, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1833 | } |
jmitc91516 | 0:9140ec6aa604 | 1834 | break; |
jmitc91516 | 0:9140ec6aa604 | 1835 | |
jmitc91516 | 0:9140ec6aa604 | 1836 | case GuiLib_PANEL_3D_RAISED: |
jmitc91516 | 0:9140ec6aa604 | 1837 | if (sgl.CurItem.R1 == 0) |
jmitc91516 | 0:9140ec6aa604 | 1838 | { |
jmitc91516 | 0:9140ec6aa604 | 1839 | if (!BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 1840 | DrawSubStruct(GuiStructCOMP_PA3DINNER, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1841 | DrawSubStruct(GuiStructCOMP_PA3DRAIS, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1842 | } |
jmitc91516 | 0:9140ec6aa604 | 1843 | else |
jmitc91516 | 0:9140ec6aa604 | 1844 | { |
jmitc91516 | 0:9140ec6aa604 | 1845 | if (!BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 1846 | DrawSubStruct(GuiStructCOMP_PA3DINNERR, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1847 | DrawSubStruct(GuiStructCOMP_PA3DRAISR, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1848 | } |
jmitc91516 | 0:9140ec6aa604 | 1849 | break; |
jmitc91516 | 0:9140ec6aa604 | 1850 | |
jmitc91516 | 0:9140ec6aa604 | 1851 | case GuiLib_PANEL_3D_LOWERED: |
jmitc91516 | 0:9140ec6aa604 | 1852 | if (sgl.CurItem.R1 == 0) |
jmitc91516 | 0:9140ec6aa604 | 1853 | { |
jmitc91516 | 0:9140ec6aa604 | 1854 | if (!BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 1855 | DrawSubStruct(GuiStructCOMP_PA3DINNER, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1856 | DrawSubStruct(GuiStructCOMP_PA3DLOW, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1857 | } |
jmitc91516 | 0:9140ec6aa604 | 1858 | else |
jmitc91516 | 0:9140ec6aa604 | 1859 | { |
jmitc91516 | 0:9140ec6aa604 | 1860 | if (!BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 1861 | DrawSubStruct(GuiStructCOMP_PA3DINNERR, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1862 | DrawSubStruct(GuiStructCOMP_PA3DLOWR, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1863 | } |
jmitc91516 | 0:9140ec6aa604 | 1864 | break; |
jmitc91516 | 0:9140ec6aa604 | 1865 | |
jmitc91516 | 0:9140ec6aa604 | 1866 | case GuiLib_PANEL_EMBOSSED_RAISED: |
jmitc91516 | 0:9140ec6aa604 | 1867 | if (!BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 1868 | DrawSubStruct(GuiStructCOMP_PA3DINNER, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1869 | DrawSubStruct(GuiStructCOMP_PAEMBRAIS, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1870 | break; |
jmitc91516 | 0:9140ec6aa604 | 1871 | |
jmitc91516 | 0:9140ec6aa604 | 1872 | case GuiLib_PANEL_EMBOSSED_LOWERED: |
jmitc91516 | 0:9140ec6aa604 | 1873 | if (!BackColorTransp) |
jmitc91516 | 0:9140ec6aa604 | 1874 | DrawSubStruct(GuiStructCOMP_PA3DINNER, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1875 | DrawSubStruct(GuiStructCOMP_PAEMBLOW, 0, 1); |
jmitc91516 | 0:9140ec6aa604 | 1876 | break; |
jmitc91516 | 0:9140ec6aa604 | 1877 | } |
jmitc91516 | 0:9140ec6aa604 | 1878 | break; |
jmitc91516 | 0:9140ec6aa604 | 1879 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1880 | |
jmitc91516 | 0:9140ec6aa604 | 1881 | #ifdef GuiConst_ITEM_GRAPH_INUSE |
jmitc91516 | 0:9140ec6aa604 | 1882 | case GuiLib_ITEM_GRAPH: |
jmitc91516 | 0:9140ec6aa604 | 1883 | break; |
jmitc91516 | 0:9140ec6aa604 | 1884 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1885 | |
jmitc91516 | 0:9140ec6aa604 | 1886 | #ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE |
jmitc91516 | 0:9140ec6aa604 | 1887 | case GuiLib_ITEM_GRAPHICSLAYER: |
jmitc91516 | 0:9140ec6aa604 | 1888 | #ifdef GuiLib_LAYERS_SUPPORTED |
jmitc91516 | 0:9140ec6aa604 | 1889 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 1890 | { |
jmitc91516 | 0:9140ec6aa604 | 1891 | sgl.LayerOrigoX = 0; |
jmitc91516 | 0:9140ec6aa604 | 1892 | sgl.LayerOrigoY = 0; |
jmitc91516 | 0:9140ec6aa604 | 1893 | sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 1894 | sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 1895 | |
jmitc91516 | 0:9140ec6aa604 | 1896 | X1 = sgl.CurItem.X1; |
jmitc91516 | 0:9140ec6aa604 | 1897 | X2 = sgl.CurItem.X2; |
jmitc91516 | 0:9140ec6aa604 | 1898 | Y1 = sgl.CurItem.Y1; |
jmitc91516 | 0:9140ec6aa604 | 1899 | Y2 = sgl.CurItem.Y2; |
jmitc91516 | 0:9140ec6aa604 | 1900 | GuiLib_COORD_ADJUST(X1, Y1); |
jmitc91516 | 0:9140ec6aa604 | 1901 | GuiLib_COORD_ADJUST(X2, Y2); |
jmitc91516 | 0:9140ec6aa604 | 1902 | OrderCoord(&X1, &X2); |
jmitc91516 | 0:9140ec6aa604 | 1903 | OrderCoord(&Y1, &Y2); |
jmitc91516 | 0:9140ec6aa604 | 1904 | |
jmitc91516 | 0:9140ec6aa604 | 1905 | switch (sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].SizeMode) |
jmitc91516 | 0:9140ec6aa604 | 1906 | { |
jmitc91516 | 0:9140ec6aa604 | 1907 | case GuiLib_GRAPHICS_LAYER_SIZE_COORD: |
jmitc91516 | 0:9140ec6aa604 | 1908 | X1 = GuiLib_GET_MINMAX(X1, 0, GuiConst_DISPLAY_WIDTH_HW - 1); |
jmitc91516 | 0:9140ec6aa604 | 1909 | Y1 = GuiLib_GET_MINMAX(Y1, 0, GuiConst_DISPLAY_HEIGHT_HW - 1); |
jmitc91516 | 0:9140ec6aa604 | 1910 | X2 = GuiLib_GET_MINMAX(X2, 0, GuiConst_DISPLAY_WIDTH_HW - 1); |
jmitc91516 | 0:9140ec6aa604 | 1911 | Y2 = GuiLib_GET_MINMAX(Y2, 0, GuiConst_DISPLAY_HEIGHT_HW - 1); |
jmitc91516 | 0:9140ec6aa604 | 1912 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X = GuiLib_GET_MINMAX( |
jmitc91516 | 0:9140ec6aa604 | 1913 | X1, 0, GuiConst_DISPLAY_WIDTH_HW); |
jmitc91516 | 0:9140ec6aa604 | 1914 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y = GuiLib_GET_MINMAX( |
jmitc91516 | 0:9140ec6aa604 | 1915 | Y1, 0, GuiConst_DISPLAY_HEIGHT_HW); |
jmitc91516 | 0:9140ec6aa604 | 1916 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width = X2 - X1 + 1; |
jmitc91516 | 0:9140ec6aa604 | 1917 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Height = Y2 - Y1 + 1; |
jmitc91516 | 0:9140ec6aa604 | 1918 | break; |
jmitc91516 | 0:9140ec6aa604 | 1919 | |
jmitc91516 | 0:9140ec6aa604 | 1920 | case GuiLib_GRAPHICS_LAYER_SIZE_SCREEN: |
jmitc91516 | 0:9140ec6aa604 | 1921 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X = 0; |
jmitc91516 | 0:9140ec6aa604 | 1922 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y = 0; |
jmitc91516 | 0:9140ec6aa604 | 1923 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width = |
jmitc91516 | 0:9140ec6aa604 | 1924 | GuiConst_DISPLAY_WIDTH_HW; |
jmitc91516 | 0:9140ec6aa604 | 1925 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Height = |
jmitc91516 | 0:9140ec6aa604 | 1926 | GuiConst_DISPLAY_HEIGHT_HW; |
jmitc91516 | 0:9140ec6aa604 | 1927 | break; |
jmitc91516 | 0:9140ec6aa604 | 1928 | |
jmitc91516 | 0:9140ec6aa604 | 1929 | case GuiLib_GRAPHICS_LAYER_SIZE_CLIP: |
jmitc91516 | 0:9140ec6aa604 | 1930 | CX1 = sgl.CurItem.ClipRectX1; |
jmitc91516 | 0:9140ec6aa604 | 1931 | CX2 = sgl.CurItem.ClipRectX2; |
jmitc91516 | 0:9140ec6aa604 | 1932 | CY1 = sgl.CurItem.ClipRectY1; |
jmitc91516 | 0:9140ec6aa604 | 1933 | CY2 = sgl.CurItem.ClipRectY2; |
jmitc91516 | 0:9140ec6aa604 | 1934 | GuiLib_COORD_ADJUST(CX1, CY1); |
jmitc91516 | 0:9140ec6aa604 | 1935 | GuiLib_COORD_ADJUST(CX2, CY2); |
jmitc91516 | 0:9140ec6aa604 | 1936 | OrderCoord(&CX1, &CX2); |
jmitc91516 | 0:9140ec6aa604 | 1937 | OrderCoord(&CY1, &CY2); |
jmitc91516 | 0:9140ec6aa604 | 1938 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X = CX1; |
jmitc91516 | 0:9140ec6aa604 | 1939 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y = CY1; |
jmitc91516 | 0:9140ec6aa604 | 1940 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width = CX2 - CX1 + 1; |
jmitc91516 | 0:9140ec6aa604 | 1941 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Height = CY2 - CY1 + 1; |
jmitc91516 | 0:9140ec6aa604 | 1942 | break; |
jmitc91516 | 0:9140ec6aa604 | 1943 | } |
jmitc91516 | 0:9140ec6aa604 | 1944 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].LineSize = |
jmitc91516 | 0:9140ec6aa604 | 1945 | GuiConst_PIXEL_BYTE_SIZE * |
jmitc91516 | 0:9140ec6aa604 | 1946 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width; |
jmitc91516 | 0:9140ec6aa604 | 1947 | sgl.CurItem.ClipRectX1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 1948 | sgl.CurItem.ClipRectY1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 1949 | sgl.CurItem.ClipRectX2 = |
jmitc91516 | 0:9140ec6aa604 | 1950 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width - 1; |
jmitc91516 | 0:9140ec6aa604 | 1951 | sgl.CurItem.ClipRectY2 = |
jmitc91516 | 0:9140ec6aa604 | 1952 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Height - 1; |
jmitc91516 | 0:9140ec6aa604 | 1953 | #ifdef GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 1954 | StartClipping(1); |
jmitc91516 | 0:9140ec6aa604 | 1955 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1956 | sgl.LayerOrigoX = -sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X; |
jmitc91516 | 0:9140ec6aa604 | 1957 | sgl.LayerOrigoY = -sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y; |
jmitc91516 | 0:9140ec6aa604 | 1958 | sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 1959 | sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 1960 | |
jmitc91516 | 0:9140ec6aa604 | 1961 | if (GraphicsLayer_Push(sgl.GlobalGraphicsLayerIndex)) |
jmitc91516 | 0:9140ec6aa604 | 1962 | { |
jmitc91516 | 0:9140ec6aa604 | 1963 | switch (sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].InitMode) |
jmitc91516 | 0:9140ec6aa604 | 1964 | { |
jmitc91516 | 0:9140ec6aa604 | 1965 | case GuiLib_GRAPHICS_LAYER_INIT_NONE: |
jmitc91516 | 0:9140ec6aa604 | 1966 | break; |
jmitc91516 | 0:9140ec6aa604 | 1967 | |
jmitc91516 | 0:9140ec6aa604 | 1968 | case GuiLib_GRAPHICS_LAYER_INIT_COL: |
jmitc91516 | 0:9140ec6aa604 | 1969 | GuiLib_FillBox( |
jmitc91516 | 0:9140ec6aa604 | 1970 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X, |
jmitc91516 | 0:9140ec6aa604 | 1971 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y, |
jmitc91516 | 0:9140ec6aa604 | 1972 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X + |
jmitc91516 | 0:9140ec6aa604 | 1973 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width - 1, |
jmitc91516 | 0:9140ec6aa604 | 1974 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y + |
jmitc91516 | 0:9140ec6aa604 | 1975 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Height - 1, |
jmitc91516 | 0:9140ec6aa604 | 1976 | BackColor); |
jmitc91516 | 0:9140ec6aa604 | 1977 | break; |
jmitc91516 | 0:9140ec6aa604 | 1978 | |
jmitc91516 | 0:9140ec6aa604 | 1979 | case GuiLib_GRAPHICS_LAYER_INIT_COPY: |
jmitc91516 | 0:9140ec6aa604 | 1980 | GraphicsLayer_Copy( |
jmitc91516 | 0:9140ec6aa604 | 1981 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].BaseAddress, |
jmitc91516 | 0:9140ec6aa604 | 1982 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].LineSize, |
jmitc91516 | 0:9140ec6aa604 | 1983 | 0, |
jmitc91516 | 0:9140ec6aa604 | 1984 | 0, |
jmitc91516 | 0:9140ec6aa604 | 1985 | #ifdef GuiConst_DISPLAY_BUFFER_EASYGUI |
jmitc91516 | 0:9140ec6aa604 | 1986 | #ifdef GuiLib_COLOR_UNIT_16 |
jmitc91516 | 0:9140ec6aa604 | 1987 | (GuiConst_INT8U*)GuiLib_DisplayBuf.Bytes, |
jmitc91516 | 0:9140ec6aa604 | 1988 | #else |
jmitc91516 | 0:9140ec6aa604 | 1989 | (GuiConst_INT8U*)GuiLib_DisplayBuf, |
jmitc91516 | 0:9140ec6aa604 | 1990 | #endif |
jmitc91516 | 0:9140ec6aa604 | 1991 | #else // GuiConst_DISPLAY_BUFFER_EASYGUI |
jmitc91516 | 0:9140ec6aa604 | 1992 | 0, |
jmitc91516 | 0:9140ec6aa604 | 1993 | #endif // GuiConst_DISPLAY_BUFFER_EASYGUI |
jmitc91516 | 0:9140ec6aa604 | 1994 | GuiConst_BYTES_PR_LINE, |
jmitc91516 | 0:9140ec6aa604 | 1995 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X, |
jmitc91516 | 0:9140ec6aa604 | 1996 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y, |
jmitc91516 | 0:9140ec6aa604 | 1997 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width, |
jmitc91516 | 0:9140ec6aa604 | 1998 | sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Height); |
jmitc91516 | 0:9140ec6aa604 | 1999 | break; |
jmitc91516 | 0:9140ec6aa604 | 2000 | } |
jmitc91516 | 0:9140ec6aa604 | 2001 | } |
jmitc91516 | 0:9140ec6aa604 | 2002 | } |
jmitc91516 | 0:9140ec6aa604 | 2003 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2004 | break; |
jmitc91516 | 0:9140ec6aa604 | 2005 | |
jmitc91516 | 0:9140ec6aa604 | 2006 | case GuiLib_ITEM_GRAPHICSFILTER: |
jmitc91516 | 0:9140ec6aa604 | 2007 | #ifdef GuiLib_LAYERS_SUPPORTED |
jmitc91516 | 0:9140ec6aa604 | 2008 | if (sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 2009 | { |
jmitc91516 | 0:9140ec6aa604 | 2010 | sgl.LayerOrigoX = 0; |
jmitc91516 | 0:9140ec6aa604 | 2011 | sgl.LayerOrigoY = 0; |
jmitc91516 | 0:9140ec6aa604 | 2012 | sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 2013 | sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 2014 | |
jmitc91516 | 0:9140ec6aa604 | 2015 | SourceLayerIndexNo = IndexOfGraphicsLayer( |
jmitc91516 | 0:9140ec6aa604 | 2016 | sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].SourceLayerIndexNo); |
jmitc91516 | 0:9140ec6aa604 | 2017 | DestLayerIndexNo = IndexOfGraphicsLayer( |
jmitc91516 | 0:9140ec6aa604 | 2018 | sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].DestLayerIndexNo); |
jmitc91516 | 0:9140ec6aa604 | 2019 | if (SourceLayerIndexNo != DestLayerIndexNo) |
jmitc91516 | 0:9140ec6aa604 | 2020 | { |
jmitc91516 | 0:9140ec6aa604 | 2021 | if (SourceLayerIndexNo == GuiLib_GRAPHICS_LAYER_BASE) |
jmitc91516 | 0:9140ec6aa604 | 2022 | { |
jmitc91516 | 0:9140ec6aa604 | 2023 | #ifdef GuiConst_DISPLAY_BUFFER_EASYGUI |
jmitc91516 | 0:9140ec6aa604 | 2024 | #ifdef GuiLib_COLOR_UNIT_16 |
jmitc91516 | 0:9140ec6aa604 | 2025 | SourceAddress = &(GuiLib_DisplayBuf.Bytes[0][0]); |
jmitc91516 | 0:9140ec6aa604 | 2026 | #else |
jmitc91516 | 0:9140ec6aa604 | 2027 | #ifdef GuiConst_COLOR_DEPTH_2 |
jmitc91516 | 0:9140ec6aa604 | 2028 | #ifdef GuiConst_BYTE_HORIZONTAL |
jmitc91516 | 0:9140ec6aa604 | 2029 | #ifdef GuiConst_COLOR_PLANES_2 |
jmitc91516 | 0:9140ec6aa604 | 2030 | SourceAddress = &(GuiLib_DisplayBuf[0][0][0]); |
jmitc91516 | 0:9140ec6aa604 | 2031 | #else |
jmitc91516 | 0:9140ec6aa604 | 2032 | SourceAddress = &(GuiLib_DisplayBuf[0][0]); |
jmitc91516 | 0:9140ec6aa604 | 2033 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2034 | #else |
jmitc91516 | 0:9140ec6aa604 | 2035 | #ifdef GuiConst_COLOR_PLANES_2 |
jmitc91516 | 0:9140ec6aa604 | 2036 | SourceAddress = &(GuiLib_DisplayBuf[0][0][0]); |
jmitc91516 | 0:9140ec6aa604 | 2037 | #else |
jmitc91516 | 0:9140ec6aa604 | 2038 | SourceAddress = &(GuiLib_DisplayBuf[0][0]); |
jmitc91516 | 0:9140ec6aa604 | 2039 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2040 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2041 | #else |
jmitc91516 | 0:9140ec6aa604 | 2042 | SourceAddress = &(GuiLib_DisplayBuf[0][0]); |
jmitc91516 | 0:9140ec6aa604 | 2043 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2044 | #endif // GuiLib_COLOR_UNIT_16 |
jmitc91516 | 0:9140ec6aa604 | 2045 | #else // GuiConst_DISPLAY_BUFFER_EASYGUI |
jmitc91516 | 0:9140ec6aa604 | 2046 | SourceAddress = 0; |
jmitc91516 | 0:9140ec6aa604 | 2047 | #endif // GuiConst_DISPLAY_BUFFER_EASYGUI |
jmitc91516 | 0:9140ec6aa604 | 2048 | SourceLineSize = GuiConst_BYTES_PR_LINE; |
jmitc91516 | 0:9140ec6aa604 | 2049 | SourceX = 0; |
jmitc91516 | 0:9140ec6aa604 | 2050 | SourceY = 0; |
jmitc91516 | 0:9140ec6aa604 | 2051 | SourceWidth = GuiConst_DISPLAY_WIDTH_HW; |
jmitc91516 | 0:9140ec6aa604 | 2052 | SourceHeight = GuiConst_DISPLAY_HEIGHT_HW; |
jmitc91516 | 0:9140ec6aa604 | 2053 | } |
jmitc91516 | 0:9140ec6aa604 | 2054 | else |
jmitc91516 | 0:9140ec6aa604 | 2055 | { |
jmitc91516 | 0:9140ec6aa604 | 2056 | SourceAddress = sgl.GraphicsLayerList[SourceLayerIndexNo].BaseAddress; |
jmitc91516 | 0:9140ec6aa604 | 2057 | SourceLineSize = sgl.GraphicsLayerList[SourceLayerIndexNo].LineSize; |
jmitc91516 | 0:9140ec6aa604 | 2058 | SourceX = sgl.GraphicsLayerList[SourceLayerIndexNo].X; |
jmitc91516 | 0:9140ec6aa604 | 2059 | SourceY = sgl.GraphicsLayerList[SourceLayerIndexNo].Y; |
jmitc91516 | 0:9140ec6aa604 | 2060 | SourceWidth = sgl.GraphicsLayerList[SourceLayerIndexNo].Width; |
jmitc91516 | 0:9140ec6aa604 | 2061 | SourceHeight = sgl.GraphicsLayerList[SourceLayerIndexNo].Height; |
jmitc91516 | 0:9140ec6aa604 | 2062 | } |
jmitc91516 | 0:9140ec6aa604 | 2063 | if (DestLayerIndexNo == GuiLib_GRAPHICS_LAYER_BASE) |
jmitc91516 | 0:9140ec6aa604 | 2064 | { |
jmitc91516 | 0:9140ec6aa604 | 2065 | #ifdef GuiConst_DISPLAY_BUFFER_EASYGUI |
jmitc91516 | 0:9140ec6aa604 | 2066 | #ifdef GuiLib_COLOR_UNIT_16 |
jmitc91516 | 0:9140ec6aa604 | 2067 | DestAddress = &(GuiLib_DisplayBuf.Bytes[0][0]); |
jmitc91516 | 0:9140ec6aa604 | 2068 | #else |
jmitc91516 | 0:9140ec6aa604 | 2069 | #ifdef GuiConst_COLOR_DEPTH_2 |
jmitc91516 | 0:9140ec6aa604 | 2070 | #ifdef GuiConst_BYTE_HORIZONTAL |
jmitc91516 | 0:9140ec6aa604 | 2071 | #ifdef GuiConst_COLOR_PLANES_2 |
jmitc91516 | 0:9140ec6aa604 | 2072 | DestAddress = &(GuiLib_DisplayBuf[0][0][0]); |
jmitc91516 | 0:9140ec6aa604 | 2073 | #else |
jmitc91516 | 0:9140ec6aa604 | 2074 | DestAddress = &(GuiLib_DisplayBuf[0][0]); |
jmitc91516 | 0:9140ec6aa604 | 2075 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2076 | #else |
jmitc91516 | 0:9140ec6aa604 | 2077 | #ifdef GuiConst_COLOR_PLANES_2 |
jmitc91516 | 0:9140ec6aa604 | 2078 | DestAddress = &(GuiLib_DisplayBuf[0][0][0]); |
jmitc91516 | 0:9140ec6aa604 | 2079 | #else |
jmitc91516 | 0:9140ec6aa604 | 2080 | DestAddress = &(GuiLib_DisplayBuf[0][0]); |
jmitc91516 | 0:9140ec6aa604 | 2081 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2082 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2083 | #else |
jmitc91516 | 0:9140ec6aa604 | 2084 | DestAddress = &(GuiLib_DisplayBuf[0][0]); |
jmitc91516 | 0:9140ec6aa604 | 2085 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2086 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2087 | #else // GuiConst_DISPLAY_BUFFER_EASYGUI |
jmitc91516 | 0:9140ec6aa604 | 2088 | DestAddress = 0; |
jmitc91516 | 0:9140ec6aa604 | 2089 | #endif // GuiConst_DISPLAY_BUFFER_EASYGUI |
jmitc91516 | 0:9140ec6aa604 | 2090 | DestLineSize = GuiConst_BYTES_PR_LINE; |
jmitc91516 | 0:9140ec6aa604 | 2091 | DestX = SourceX; |
jmitc91516 | 0:9140ec6aa604 | 2092 | DestY = SourceY; |
jmitc91516 | 0:9140ec6aa604 | 2093 | DestWidth = SourceWidth; |
jmitc91516 | 0:9140ec6aa604 | 2094 | DestHeight = SourceHeight; |
jmitc91516 | 0:9140ec6aa604 | 2095 | } |
jmitc91516 | 0:9140ec6aa604 | 2096 | else |
jmitc91516 | 0:9140ec6aa604 | 2097 | { |
jmitc91516 | 0:9140ec6aa604 | 2098 | DestAddress = sgl.GraphicsLayerList[DestLayerIndexNo].BaseAddress; |
jmitc91516 | 0:9140ec6aa604 | 2099 | DestLineSize = sgl.GraphicsLayerList[DestLayerIndexNo].LineSize; |
jmitc91516 | 0:9140ec6aa604 | 2100 | DestX = sgl.GraphicsLayerList[DestLayerIndexNo].X; |
jmitc91516 | 0:9140ec6aa604 | 2101 | DestY = sgl.GraphicsLayerList[DestLayerIndexNo].Y; |
jmitc91516 | 0:9140ec6aa604 | 2102 | DestWidth = sgl.GraphicsLayerList[DestLayerIndexNo].Width; |
jmitc91516 | 0:9140ec6aa604 | 2103 | DestHeight = sgl.GraphicsLayerList[DestLayerIndexNo].Height; |
jmitc91516 | 0:9140ec6aa604 | 2104 | } |
jmitc91516 | 0:9140ec6aa604 | 2105 | |
jmitc91516 | 0:9140ec6aa604 | 2106 | if ((DestX <= SourceX) && (DestY <= SourceY) && |
jmitc91516 | 0:9140ec6aa604 | 2107 | (DestX + DestWidth >= SourceX + SourceWidth) && |
jmitc91516 | 0:9140ec6aa604 | 2108 | (DestY + DestHeight >= SourceY + SourceHeight) && |
jmitc91516 | 0:9140ec6aa604 | 2109 | (sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex]. |
jmitc91516 | 0:9140ec6aa604 | 2110 | GraphicsFilterFunc != 0)) |
jmitc91516 | 0:9140ec6aa604 | 2111 | { |
jmitc91516 | 0:9140ec6aa604 | 2112 | if (DestLayerIndexNo != GuiLib_GRAPHICS_LAYER_BASE) |
jmitc91516 | 0:9140ec6aa604 | 2113 | { |
jmitc91516 | 0:9140ec6aa604 | 2114 | DestX = SourceX - DestX; |
jmitc91516 | 0:9140ec6aa604 | 2115 | DestY = SourceY - DestY; |
jmitc91516 | 0:9140ec6aa604 | 2116 | } |
jmitc91516 | 0:9140ec6aa604 | 2117 | if (SourceLayerIndexNo != GuiLib_GRAPHICS_LAYER_BASE) |
jmitc91516 | 0:9140ec6aa604 | 2118 | { |
jmitc91516 | 0:9140ec6aa604 | 2119 | SourceX = 0; |
jmitc91516 | 0:9140ec6aa604 | 2120 | SourceY = 0; |
jmitc91516 | 0:9140ec6aa604 | 2121 | } |
jmitc91516 | 0:9140ec6aa604 | 2122 | |
jmitc91516 | 0:9140ec6aa604 | 2123 | for (I = 0; I <= 9; I++) |
jmitc91516 | 0:9140ec6aa604 | 2124 | { |
jmitc91516 | 0:9140ec6aa604 | 2125 | if (sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].ParVarType[I] == |
jmitc91516 | 0:9140ec6aa604 | 2126 | GuiLib_VAR_NONE) |
jmitc91516 | 0:9140ec6aa604 | 2127 | FilterPars[I] = |
jmitc91516 | 0:9140ec6aa604 | 2128 | sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].ParValueNum[I]; |
jmitc91516 | 0:9140ec6aa604 | 2129 | else |
jmitc91516 | 0:9140ec6aa604 | 2130 | FilterPars[I] = ReadVar( |
jmitc91516 | 0:9140ec6aa604 | 2131 | sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].ParVarPtr[I], |
jmitc91516 | 0:9140ec6aa604 | 2132 | sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].ParVarType[I]); |
jmitc91516 | 0:9140ec6aa604 | 2133 | } |
jmitc91516 | 0:9140ec6aa604 | 2134 | sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].GraphicsFilterFunc( |
jmitc91516 | 0:9140ec6aa604 | 2135 | DestAddress + DestY * DestLineSize + |
jmitc91516 | 0:9140ec6aa604 | 2136 | DestX * GuiConst_PIXEL_BYTE_SIZE, |
jmitc91516 | 0:9140ec6aa604 | 2137 | DestLineSize, |
jmitc91516 | 0:9140ec6aa604 | 2138 | SourceAddress + SourceY * SourceLineSize + |
jmitc91516 | 0:9140ec6aa604 | 2139 | SourceX * GuiConst_PIXEL_BYTE_SIZE, |
jmitc91516 | 0:9140ec6aa604 | 2140 | SourceLineSize, |
jmitc91516 | 0:9140ec6aa604 | 2141 | sgl.GraphicsLayerList[SourceLayerIndexNo].Width, |
jmitc91516 | 0:9140ec6aa604 | 2142 | sgl.GraphicsLayerList[SourceLayerIndexNo].Height, |
jmitc91516 | 0:9140ec6aa604 | 2143 | FilterPars); |
jmitc91516 | 0:9140ec6aa604 | 2144 | } |
jmitc91516 | 0:9140ec6aa604 | 2145 | |
jmitc91516 | 0:9140ec6aa604 | 2146 | GraphicsLayer_Pop( |
jmitc91516 | 0:9140ec6aa604 | 2147 | sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].ContAtLayerIndexNo); |
jmitc91516 | 0:9140ec6aa604 | 2148 | MarkDisplayBoxRepaint( |
jmitc91516 | 0:9140ec6aa604 | 2149 | DestX, |
jmitc91516 | 0:9140ec6aa604 | 2150 | DestY, |
jmitc91516 | 0:9140ec6aa604 | 2151 | DestX + sgl.GraphicsLayerList[SourceLayerIndexNo].Width - 1, |
jmitc91516 | 0:9140ec6aa604 | 2152 | DestY + sgl.GraphicsLayerList[SourceLayerIndexNo].Height - 1); |
jmitc91516 | 0:9140ec6aa604 | 2153 | } |
jmitc91516 | 0:9140ec6aa604 | 2154 | else |
jmitc91516 | 0:9140ec6aa604 | 2155 | GraphicsLayer_Pop(GuiLib_GRAPHICS_LAYER_BASE); |
jmitc91516 | 0:9140ec6aa604 | 2156 | |
jmitc91516 | 0:9140ec6aa604 | 2157 | if (sgl.BaseLayerDrawing) |
jmitc91516 | 0:9140ec6aa604 | 2158 | { |
jmitc91516 | 0:9140ec6aa604 | 2159 | sgl.LayerOrigoX = 0; |
jmitc91516 | 0:9140ec6aa604 | 2160 | sgl.LayerOrigoY = 0; |
jmitc91516 | 0:9140ec6aa604 | 2161 | } |
jmitc91516 | 0:9140ec6aa604 | 2162 | else |
jmitc91516 | 0:9140ec6aa604 | 2163 | { |
jmitc91516 | 0:9140ec6aa604 | 2164 | I = sgl.GraphicsLayerLifo[sgl.GraphicsLayerLifoCnt - 1]; |
jmitc91516 | 0:9140ec6aa604 | 2165 | sgl.LayerOrigoX = -sgl.GraphicsLayerList[I].X; |
jmitc91516 | 0:9140ec6aa604 | 2166 | sgl.LayerOrigoY = -sgl.GraphicsLayerList[I].Y; |
jmitc91516 | 0:9140ec6aa604 | 2167 | } |
jmitc91516 | 0:9140ec6aa604 | 2168 | sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 2169 | sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 2170 | |
jmitc91516 | 0:9140ec6aa604 | 2171 | if (sgl.BaseLayerDrawing) |
jmitc91516 | 0:9140ec6aa604 | 2172 | { |
jmitc91516 | 0:9140ec6aa604 | 2173 | #ifdef GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 2174 | StartClipping(0); |
jmitc91516 | 0:9140ec6aa604 | 2175 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2176 | } |
jmitc91516 | 0:9140ec6aa604 | 2177 | else |
jmitc91516 | 0:9140ec6aa604 | 2178 | { |
jmitc91516 | 0:9140ec6aa604 | 2179 | I = sgl.GraphicsLayerLifo[sgl.GraphicsLayerLifoCnt - 1]; |
jmitc91516 | 0:9140ec6aa604 | 2180 | sgl.CurItem.ClipRectX1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2181 | sgl.CurItem.ClipRectY1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2182 | sgl.CurItem.ClipRectX2 = sgl.GraphicsLayerList[I].Width - 1; |
jmitc91516 | 0:9140ec6aa604 | 2183 | sgl.CurItem.ClipRectY2 = sgl.GraphicsLayerList[I].Height - 1; |
jmitc91516 | 0:9140ec6aa604 | 2184 | #ifdef GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 2185 | StartClipping(1); |
jmitc91516 | 0:9140ec6aa604 | 2186 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2187 | } |
jmitc91516 | 0:9140ec6aa604 | 2188 | } |
jmitc91516 | 0:9140ec6aa604 | 2189 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2190 | break; |
jmitc91516 | 0:9140ec6aa604 | 2191 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2192 | } |
jmitc91516 | 0:9140ec6aa604 | 2193 | |
jmitc91516 | 0:9140ec6aa604 | 2194 | if (sgl.CurItem.UpdateType == GuiLib_UPDATE_ON_CHANGE) |
jmitc91516 | 0:9140ec6aa604 | 2195 | if ((sgl.InitialDrawing) || (sgl.AutoRedrawUpdate == GuiLib_TRUE)) |
jmitc91516 | 0:9140ec6aa604 | 2196 | AutoRedraw_UpdateOnChange(sgl.AutoRedrawSaveIndex); |
jmitc91516 | 0:9140ec6aa604 | 2197 | |
jmitc91516 | 0:9140ec6aa604 | 2198 | if (sgl.AutoRedrawSaveIndex >= 0) |
jmitc91516 | 0:9140ec6aa604 | 2199 | AutoRedraw_UpdateDrawn(sgl.AutoRedrawSaveIndex, &sgl.CurItem); |
jmitc91516 | 0:9140ec6aa604 | 2200 | |
jmitc91516 | 0:9140ec6aa604 | 2201 | #ifdef GuiConst_TEXTBOX_FIELDS_ON |
jmitc91516 | 0:9140ec6aa604 | 2202 | if (((sgl.CurItem.ItemType == GuiLib_ITEM_TEXTBLOCK) || |
jmitc91516 | 0:9140ec6aa604 | 2203 | (sgl.CurItem.ItemType == GuiLib_ITEM_VARBLOCK)) && |
jmitc91516 | 0:9140ec6aa604 | 2204 | (sgl.CurItem.CompPars.CompTextBox.ScrollIndex != 0xFF)) |
jmitc91516 | 0:9140ec6aa604 | 2205 | { |
jmitc91516 | 0:9140ec6aa604 | 2206 | found = AutoRedraw_GetTextBox( |
jmitc91516 | 0:9140ec6aa604 | 2207 | sgl.CurItem.CompPars.CompTextBox.ScrollIndex, -1); |
jmitc91516 | 0:9140ec6aa604 | 2208 | if (found == -1) |
jmitc91516 | 0:9140ec6aa604 | 2209 | { |
jmitc91516 | 0:9140ec6aa604 | 2210 | if (sgl.AutoRedrawSaveIndex >= 0) |
jmitc91516 | 0:9140ec6aa604 | 2211 | AutoRedraw_SetAsTextBox(sgl.AutoRedrawSaveIndex); |
jmitc91516 | 0:9140ec6aa604 | 2212 | else |
jmitc91516 | 0:9140ec6aa604 | 2213 | AutoRedraw_InsertTextBox(&sgl.CurItem, 0, sgl.DisplayLevel); |
jmitc91516 | 0:9140ec6aa604 | 2214 | } |
jmitc91516 | 0:9140ec6aa604 | 2215 | |
jmitc91516 | 0:9140ec6aa604 | 2216 | found = 0; |
jmitc91516 | 0:9140ec6aa604 | 2217 | |
jmitc91516 | 0:9140ec6aa604 | 2218 | for (N = 0; N < GuiConst_TEXTBOX_FIELDS_MAX; N++) |
jmitc91516 | 0:9140ec6aa604 | 2219 | { |
jmitc91516 | 0:9140ec6aa604 | 2220 | if (sgl.TextBoxScrollPositions[N].index == |
jmitc91516 | 0:9140ec6aa604 | 2221 | sgl.CurItem.CompPars.CompTextBox.ScrollIndex) |
jmitc91516 | 0:9140ec6aa604 | 2222 | { |
jmitc91516 | 0:9140ec6aa604 | 2223 | found = 1; |
jmitc91516 | 0:9140ec6aa604 | 2224 | break; |
jmitc91516 | 0:9140ec6aa604 | 2225 | } |
jmitc91516 | 0:9140ec6aa604 | 2226 | } |
jmitc91516 | 0:9140ec6aa604 | 2227 | |
jmitc91516 | 0:9140ec6aa604 | 2228 | if (found == 0) |
jmitc91516 | 0:9140ec6aa604 | 2229 | { |
jmitc91516 | 0:9140ec6aa604 | 2230 | for (N = 0; N < GuiConst_TEXTBOX_FIELDS_MAX; N++) |
jmitc91516 | 0:9140ec6aa604 | 2231 | { |
jmitc91516 | 0:9140ec6aa604 | 2232 | if (sgl.TextBoxScrollPositions[N].index == -1) |
jmitc91516 | 0:9140ec6aa604 | 2233 | { |
jmitc91516 | 0:9140ec6aa604 | 2234 | sgl.TextBoxScrollPositions[N].index = |
jmitc91516 | 0:9140ec6aa604 | 2235 | sgl.CurItem.CompPars.CompTextBox.ScrollIndex; |
jmitc91516 | 0:9140ec6aa604 | 2236 | sgl.TextBoxScrollPositions[N].pos = |
jmitc91516 | 0:9140ec6aa604 | 2237 | sgl.CurItem.CompPars.CompTextBox.ScrollPos; |
jmitc91516 | 0:9140ec6aa604 | 2238 | break; |
jmitc91516 | 0:9140ec6aa604 | 2239 | } |
jmitc91516 | 0:9140ec6aa604 | 2240 | } |
jmitc91516 | 0:9140ec6aa604 | 2241 | } |
jmitc91516 | 0:9140ec6aa604 | 2242 | } |
jmitc91516 | 0:9140ec6aa604 | 2243 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2244 | |
jmitc91516 | 0:9140ec6aa604 | 2245 | #ifdef GuiConst_CURSOR_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 2246 | if (sgl.InitialDrawing && IsCursorField) |
jmitc91516 | 0:9140ec6aa604 | 2247 | sgl.CurItem.CursorFieldLevel--; |
jmitc91516 | 0:9140ec6aa604 | 2248 | |
jmitc91516 | 0:9140ec6aa604 | 2249 | if ((ColorInvert == GuiLib_COL_INVERT_IF_CURSOR) && FoundActiveCursorField) |
jmitc91516 | 0:9140ec6aa604 | 2250 | sgl.SwapColors = 0; |
jmitc91516 | 0:9140ec6aa604 | 2251 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2252 | |
jmitc91516 | 0:9140ec6aa604 | 2253 | #ifdef GuiConst_REL_COORD_ORIGO_INUSE |
jmitc91516 | 0:9140ec6aa604 | 2254 | if (!sgl.InitialDrawing) |
jmitc91516 | 0:9140ec6aa604 | 2255 | { |
jmitc91516 | 0:9140ec6aa604 | 2256 | sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 2257 | sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 2258 | } |
jmitc91516 | 0:9140ec6aa604 | 2259 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2260 | #ifdef GuiConst_CLIPPING_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 2261 | if (!sgl.InitialDrawing && sgl.DisplayWriting) |
jmitc91516 | 0:9140ec6aa604 | 2262 | GuiLib_ResetClipping(); |
jmitc91516 | 0:9140ec6aa604 | 2263 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2264 | } |
jmitc91516 | 0:9140ec6aa604 | 2265 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 2266 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 2267 | static void ReadItem(GuiConst_INT16S LanguageIndex) |
jmitc91516 | 0:9140ec6aa604 | 2268 | { |
jmitc91516 | 0:9140ec6aa604 | 2269 | GuiConst_INT16S X; |
jmitc91516 | 0:9140ec6aa604 | 2270 | GuiConst_INT16S N; |
jmitc91516 | 0:9140ec6aa604 | 2271 | GuiConst_INT16S I,J; |
jmitc91516 | 0:9140ec6aa604 | 2272 | GuiConst_INTCOLOR TmpForeColor, TmpBackColor; |
jmitc91516 | 0:9140ec6aa604 | 2273 | GuiConst_INTCOLOR PrefixLocate *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 2274 | GuiConst_INT16U ColVarPtrIdx, PtrIdx; |
jmitc91516 | 0:9140ec6aa604 | 2275 | GuiConst_INT16U TmpColIdx; |
jmitc91516 | 0:9140ec6aa604 | 2276 | GuiConst_INT16U TmpForeColIdx; |
jmitc91516 | 0:9140ec6aa604 | 2277 | #ifdef GuiConst_ADV_CONTROLS |
jmitc91516 | 0:9140ec6aa604 | 2278 | GuiConst_INT16U TmpBackColIdx; |
jmitc91516 | 0:9140ec6aa604 | 2279 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2280 | GuiConst_INT8U B1; |
jmitc91516 | 0:9140ec6aa604 | 2281 | GuiConst_INT16U W1; |
jmitc91516 | 0:9140ec6aa604 | 2282 | #ifdef GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 2283 | GuiConst_INT16U Ti; |
jmitc91516 | 0:9140ec6aa604 | 2284 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2285 | GuiConst_INT16U TxtSize; |
jmitc91516 | 0:9140ec6aa604 | 2286 | #ifndef GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 2287 | GuiConst_INT16U TxtSum1, TxtSum2; |
jmitc91516 | 0:9140ec6aa604 | 2288 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2289 | #ifdef GuiConst_REMOTE_STRUCT_DATA |
jmitc91516 | 0:9140ec6aa604 | 2290 | GuiConst_INT16U TxtReadSize; |
jmitc91516 | 0:9140ec6aa604 | 2291 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2292 | #ifdef GuiConst_BLINK_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 2293 | GuiConst_INT8S BS2; |
jmitc91516 | 0:9140ec6aa604 | 2294 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2295 | #ifdef GuiConst_ITEM_SCROLLBOX_INUSE |
jmitc91516 | 0:9140ec6aa604 | 2296 | GuiConst_INT8U ScrollBoxIndex; |
jmitc91516 | 0:9140ec6aa604 | 2297 | #ifndef GuiConst_SCROLLITEM_BAR_NONE |
jmitc91516 | 0:9140ec6aa604 | 2298 | #ifdef GuiConst_REMOTE_BITMAP_DATA |
jmitc91516 | 0:9140ec6aa604 | 2299 | GuiConst_INT8U * PixelDataPtr; |
jmitc91516 | 0:9140ec6aa604 | 2300 | GuiConst_INT8U BitmapHeader[4]; |
jmitc91516 | 0:9140ec6aa604 | 2301 | #else |
jmitc91516 | 0:9140ec6aa604 | 2302 | GuiConst_INT8U PrefixRom * PixelDataPtr; |
jmitc91516 | 0:9140ec6aa604 | 2303 | #endif // GuiConst_REMOTE_BITMAP_DATA |
jmitc91516 | 0:9140ec6aa604 | 2304 | #endif // GuiConst_SCROLLITEM_BAR_NONE |
jmitc91516 | 0:9140ec6aa604 | 2305 | #endif // GuiConst_ITEM_SCROLLBOX_INUSE |
jmitc91516 | 0:9140ec6aa604 | 2306 | #ifdef GuiConst_ADV_COMPONENTS |
jmitc91516 | 0:9140ec6aa604 | 2307 | GuiConst_INT8U L; |
jmitc91516 | 0:9140ec6aa604 | 2308 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2309 | #ifdef GuiConst_ITEM_GRAPH_INUSE |
jmitc91516 | 0:9140ec6aa604 | 2310 | GuiConst_INT8U GraphIndex; |
jmitc91516 | 0:9140ec6aa604 | 2311 | GuiConst_INT8U Axis; |
jmitc91516 | 0:9140ec6aa604 | 2312 | GuiConst_INT8U B; |
jmitc91516 | 0:9140ec6aa604 | 2313 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2314 | #ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE |
jmitc91516 | 0:9140ec6aa604 | 2315 | GuiConst_INT8U GraphicsLayerIndex; |
jmitc91516 | 0:9140ec6aa604 | 2316 | GuiConst_INT8U GraphicsFilterIndex; |
jmitc91516 | 0:9140ec6aa604 | 2317 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2318 | #ifdef GuiConst_ITEM_STRUCTCOND_INUSE |
jmitc91516 | 0:9140ec6aa604 | 2319 | GuiConst_INT16U CondI; |
jmitc91516 | 0:9140ec6aa604 | 2320 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2321 | GuiConst_INT8U ColMemoryFore; |
jmitc91516 | 0:9140ec6aa604 | 2322 | GuiConst_INT8U ColMemoryBack; |
jmitc91516 | 0:9140ec6aa604 | 2323 | |
jmitc91516 | 0:9140ec6aa604 | 2324 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_INUSE; |
jmitc91516 | 0:9140ec6aa604 | 2325 | |
jmitc91516 | 0:9140ec6aa604 | 2326 | #ifdef GuiConst_REL_COORD_ORIGO_INUSE |
jmitc91516 | 0:9140ec6aa604 | 2327 | if (sgl.DisplayLevel == 0) |
jmitc91516 | 0:9140ec6aa604 | 2328 | { |
jmitc91516 | 0:9140ec6aa604 | 2329 | sgl.CurItem.CoordOrigoX = sgl.CoordOrigoX; |
jmitc91516 | 0:9140ec6aa604 | 2330 | sgl.CurItem.CoordOrigoY = sgl.CoordOrigoY; |
jmitc91516 | 0:9140ec6aa604 | 2331 | } |
jmitc91516 | 0:9140ec6aa604 | 2332 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2333 | |
jmitc91516 | 0:9140ec6aa604 | 2334 | sgl.CommonByte0 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2335 | sgl.CommonByte1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2336 | sgl.CommonByte2 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2337 | sgl.CommonByte3 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2338 | sgl.CommonByte4 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2339 | sgl.CommonByte5 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2340 | sgl.CommonByte6 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2341 | sgl.CommonByte7 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2342 | |
jmitc91516 | 0:9140ec6aa604 | 2343 | sgl.CurItem.ItemType = sgl.CommonByte0 & 0x3F; |
jmitc91516 | 0:9140ec6aa604 | 2344 | if (sgl.CurItem.ItemType < 32) |
jmitc91516 | 0:9140ec6aa604 | 2345 | sgl.ItemTypeBit1 = (GuiConst_INT32U)0x00000001 << (sgl.CurItem.ItemType & 0x1F); |
jmitc91516 | 0:9140ec6aa604 | 2346 | else |
jmitc91516 | 0:9140ec6aa604 | 2347 | sgl.ItemTypeBit1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2348 | if (sgl.CurItem.ItemType >= 32) |
jmitc91516 | 0:9140ec6aa604 | 2349 | sgl.ItemTypeBit2 = (GuiConst_INT32U)0x00000001 << (sgl.CurItem.ItemType - 32); |
jmitc91516 | 0:9140ec6aa604 | 2350 | else |
jmitc91516 | 0:9140ec6aa604 | 2351 | sgl.ItemTypeBit2 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2352 | |
jmitc91516 | 0:9140ec6aa604 | 2353 | if (sgl.CommonByte7 & 0x20) |
jmitc91516 | 0:9140ec6aa604 | 2354 | { |
jmitc91516 | 0:9140ec6aa604 | 2355 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2356 | if (B1 & 0x01) |
jmitc91516 | 0:9140ec6aa604 | 2357 | sgl.CurItem.ForeColorEnhance = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2358 | if (B1 & 0x02) |
jmitc91516 | 0:9140ec6aa604 | 2359 | sgl.CurItem.BackColorEnhance = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2360 | if (B1 & 0x04) |
jmitc91516 | 0:9140ec6aa604 | 2361 | sgl.CurItem.BarForeColorEnhance = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2362 | if (B1 & 0x08) |
jmitc91516 | 0:9140ec6aa604 | 2363 | sgl.CurItem.BarBackColorEnhance = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2364 | } |
jmitc91516 | 0:9140ec6aa604 | 2365 | else |
jmitc91516 | 0:9140ec6aa604 | 2366 | { |
jmitc91516 | 0:9140ec6aa604 | 2367 | sgl.CurItem.ForeColorEnhance = 0; |
jmitc91516 | 0:9140ec6aa604 | 2368 | sgl.CurItem.BackColorEnhance = 0; |
jmitc91516 | 0:9140ec6aa604 | 2369 | sgl.CurItem.BarForeColorEnhance = 0; |
jmitc91516 | 0:9140ec6aa604 | 2370 | sgl.CurItem.BarBackColorEnhance = 0; |
jmitc91516 | 0:9140ec6aa604 | 2371 | } |
jmitc91516 | 0:9140ec6aa604 | 2372 | if (sgl.CommonByte7 & 0x40) |
jmitc91516 | 0:9140ec6aa604 | 2373 | { |
jmitc91516 | 0:9140ec6aa604 | 2374 | ColMemoryFore = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2375 | ColMemoryBack = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2376 | } |
jmitc91516 | 0:9140ec6aa604 | 2377 | else |
jmitc91516 | 0:9140ec6aa604 | 2378 | { |
jmitc91516 | 0:9140ec6aa604 | 2379 | ColMemoryFore = 0; |
jmitc91516 | 0:9140ec6aa604 | 2380 | ColMemoryBack = 0; |
jmitc91516 | 0:9140ec6aa604 | 2381 | } |
jmitc91516 | 0:9140ec6aa604 | 2382 | |
jmitc91516 | 0:9140ec6aa604 | 2383 | TmpForeColor = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 2384 | TmpForeColIdx = sgl.CurItem.ForeColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 2385 | |
jmitc91516 | 0:9140ec6aa604 | 2386 | TmpBackColor = sgl.CurItem.BackColor; |
jmitc91516 | 0:9140ec6aa604 | 2387 | #ifdef GuiConst_ADV_CONTROLS |
jmitc91516 | 0:9140ec6aa604 | 2388 | TmpBackColIdx = sgl.CurItem.BackColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 2389 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2390 | |
jmitc91516 | 0:9140ec6aa604 | 2391 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 2392 | GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2393 | GuiLib_ITEMBIT_DOT + |
jmitc91516 | 0:9140ec6aa604 | 2394 | GuiLib_ITEMBIT_LINE + |
jmitc91516 | 0:9140ec6aa604 | 2395 | GuiLib_ITEMBIT_FRAME + |
jmitc91516 | 0:9140ec6aa604 | 2396 | GuiLib_ITEMBIT_BLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2397 | GuiLib_ITEMBIT_CIRCLE + |
jmitc91516 | 0:9140ec6aa604 | 2398 | GuiLib_ITEMBIT_ELLIPSE + |
jmitc91516 | 0:9140ec6aa604 | 2399 | GuiLib_ITEMBIT_STRUCTURE + |
jmitc91516 | 0:9140ec6aa604 | 2400 | GuiLib_ITEMBIT_STRUCTARRAY + |
jmitc91516 | 0:9140ec6aa604 | 2401 | GuiLib_ITEMBIT_VAR + |
jmitc91516 | 0:9140ec6aa604 | 2402 | GuiLib_ITEMBIT_VARBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2403 | GuiLib_ITEMBIT_SCROLLBOX + |
jmitc91516 | 0:9140ec6aa604 | 2404 | GuiLib_ITEMBIT_GRAPH)) || |
jmitc91516 | 0:9140ec6aa604 | 2405 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_ROUNDEDFRAME + |
jmitc91516 | 0:9140ec6aa604 | 2406 | GuiLib_ITEMBIT_ROUNDEDBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2407 | GuiLib_ITEMBIT_QUARTERCIRCLE + |
jmitc91516 | 0:9140ec6aa604 | 2408 | GuiLib_ITEMBIT_QUARTERELLIPSE + |
jmitc91516 | 0:9140ec6aa604 | 2409 | GuiLib_ITEMBIT_CHECKBOX + |
jmitc91516 | 0:9140ec6aa604 | 2410 | GuiLib_ITEMBIT_RADIOBUTTON + |
jmitc91516 | 0:9140ec6aa604 | 2411 | GuiLib_ITEMBIT_BUTTON + |
jmitc91516 | 0:9140ec6aa604 | 2412 | GuiLib_ITEMBIT_EDITBOX + |
jmitc91516 | 0:9140ec6aa604 | 2413 | GuiLib_ITEMBIT_PANEL + |
jmitc91516 | 0:9140ec6aa604 | 2414 | GuiLib_ITEMBIT_MEMO + |
jmitc91516 | 0:9140ec6aa604 | 2415 | GuiLib_ITEMBIT_LISTBOX + |
jmitc91516 | 0:9140ec6aa604 | 2416 | GuiLib_ITEMBIT_COMBOBOX + |
jmitc91516 | 0:9140ec6aa604 | 2417 | GuiLib_ITEMBIT_SCROLLAREA + |
jmitc91516 | 0:9140ec6aa604 | 2418 | GuiLib_ITEMBIT_PROGRESSBAR + |
jmitc91516 | 0:9140ec6aa604 | 2419 | GuiLib_ITEMBIT_STRUCTCOND))) |
jmitc91516 | 0:9140ec6aa604 | 2420 | { |
jmitc91516 | 0:9140ec6aa604 | 2421 | B1 = ColMemoryFore & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2422 | if (B1) |
jmitc91516 | 0:9140ec6aa604 | 2423 | { |
jmitc91516 | 0:9140ec6aa604 | 2424 | sgl.CurItem.ForeColor = sgl.Memory.C[B1-1]; |
jmitc91516 | 0:9140ec6aa604 | 2425 | sgl.CurItem.ForeColorIndex = sgl.ColMemoryIndex[B1-1]; |
jmitc91516 | 0:9140ec6aa604 | 2426 | } |
jmitc91516 | 0:9140ec6aa604 | 2427 | else |
jmitc91516 | 0:9140ec6aa604 | 2428 | { |
jmitc91516 | 0:9140ec6aa604 | 2429 | TmpColIdx = sgl.CurItem.ForeColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 2430 | sgl.CurItem.ForeColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 2431 | switch (sgl.CommonByte3 & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 2432 | { |
jmitc91516 | 0:9140ec6aa604 | 2433 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 2434 | sgl.CurItem.ForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 2435 | break; |
jmitc91516 | 0:9140ec6aa604 | 2436 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 2437 | sgl.CurItem.ForeColor = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 2438 | break; |
jmitc91516 | 0:9140ec6aa604 | 2439 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 2440 | sgl.CurItem.ForeColor = (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2441 | break; |
jmitc91516 | 0:9140ec6aa604 | 2442 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 2443 | sgl.CurItem.ForeColor = TmpBackColor; |
jmitc91516 | 0:9140ec6aa604 | 2444 | break; |
jmitc91516 | 0:9140ec6aa604 | 2445 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 2446 | sgl.CurItem.ForeColor = |
jmitc91516 | 0:9140ec6aa604 | 2447 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 2448 | break; |
jmitc91516 | 0:9140ec6aa604 | 2449 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 2450 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2451 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 2452 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 2453 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 2454 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 2455 | { |
jmitc91516 | 0:9140ec6aa604 | 2456 | sgl.CurItem.ForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 2457 | } |
jmitc91516 | 0:9140ec6aa604 | 2458 | else |
jmitc91516 | 0:9140ec6aa604 | 2459 | { |
jmitc91516 | 0:9140ec6aa604 | 2460 | sgl.CurItem.ForeColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 2461 | sgl.CurItem.ForeColorIndex = ColVarPtrIdx; |
jmitc91516 | 0:9140ec6aa604 | 2462 | } |
jmitc91516 | 0:9140ec6aa604 | 2463 | break; |
jmitc91516 | 0:9140ec6aa604 | 2464 | default: |
jmitc91516 | 0:9140ec6aa604 | 2465 | sgl.CurItem.ForeColorIndex = TmpColIdx; |
jmitc91516 | 0:9140ec6aa604 | 2466 | break; |
jmitc91516 | 0:9140ec6aa604 | 2467 | } |
jmitc91516 | 0:9140ec6aa604 | 2468 | } |
jmitc91516 | 0:9140ec6aa604 | 2469 | if (sgl.CurItem.ForeColorEnhance > 0) |
jmitc91516 | 0:9140ec6aa604 | 2470 | sgl.CurItem.ForeColor = GuiLib_BrightenPixelColor( |
jmitc91516 | 0:9140ec6aa604 | 2471 | sgl.CurItem.ForeColor, sgl.CurItem.ForeColorEnhance); |
jmitc91516 | 0:9140ec6aa604 | 2472 | else if (sgl.CurItem.ForeColorEnhance < 0) |
jmitc91516 | 0:9140ec6aa604 | 2473 | sgl.CurItem.ForeColor = GuiLib_DarkenPixelColor( |
jmitc91516 | 0:9140ec6aa604 | 2474 | sgl.CurItem.ForeColor, -sgl.CurItem.ForeColorEnhance); |
jmitc91516 | 0:9140ec6aa604 | 2475 | |
jmitc91516 | 0:9140ec6aa604 | 2476 | B1 = ColMemoryFore & 0x30; |
jmitc91516 | 0:9140ec6aa604 | 2477 | if (B1) |
jmitc91516 | 0:9140ec6aa604 | 2478 | { |
jmitc91516 | 0:9140ec6aa604 | 2479 | sgl.CurItem.BarForeColor = sgl.Memory.C[B1-1]; |
jmitc91516 | 0:9140ec6aa604 | 2480 | sgl.CurItem.BarForeColorIndex = sgl.ColMemoryIndex[B1-1]; |
jmitc91516 | 0:9140ec6aa604 | 2481 | } |
jmitc91516 | 0:9140ec6aa604 | 2482 | else |
jmitc91516 | 0:9140ec6aa604 | 2483 | { |
jmitc91516 | 0:9140ec6aa604 | 2484 | TmpColIdx = sgl.CurItem.BarForeColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 2485 | sgl.CurItem.BarForeColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 2486 | switch ((sgl.CommonByte5 >> 1) & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 2487 | { |
jmitc91516 | 0:9140ec6aa604 | 2488 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 2489 | sgl.CurItem.BarForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 2490 | break; |
jmitc91516 | 0:9140ec6aa604 | 2491 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 2492 | sgl.CurItem.BarForeColor = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 2493 | break; |
jmitc91516 | 0:9140ec6aa604 | 2494 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 2495 | sgl.CurItem.BarForeColor = (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2496 | break; |
jmitc91516 | 0:9140ec6aa604 | 2497 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 2498 | sgl.CurItem.BarForeColor = sgl.CurItem.BackColor; |
jmitc91516 | 0:9140ec6aa604 | 2499 | break; |
jmitc91516 | 0:9140ec6aa604 | 2500 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 2501 | sgl.CurItem.BarForeColor = |
jmitc91516 | 0:9140ec6aa604 | 2502 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 2503 | break; |
jmitc91516 | 0:9140ec6aa604 | 2504 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 2505 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2506 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 2507 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 2508 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 2509 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 2510 | { |
jmitc91516 | 0:9140ec6aa604 | 2511 | sgl.CurItem.BarForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 2512 | } |
jmitc91516 | 0:9140ec6aa604 | 2513 | else |
jmitc91516 | 0:9140ec6aa604 | 2514 | { |
jmitc91516 | 0:9140ec6aa604 | 2515 | sgl.CurItem.BarForeColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 2516 | sgl.CurItem.BarForeColorIndex = ColVarPtrIdx; |
jmitc91516 | 0:9140ec6aa604 | 2517 | } |
jmitc91516 | 0:9140ec6aa604 | 2518 | break; |
jmitc91516 | 0:9140ec6aa604 | 2519 | default: |
jmitc91516 | 0:9140ec6aa604 | 2520 | sgl.CurItem.BarForeColorIndex = TmpColIdx; |
jmitc91516 | 0:9140ec6aa604 | 2521 | break; |
jmitc91516 | 0:9140ec6aa604 | 2522 | } |
jmitc91516 | 0:9140ec6aa604 | 2523 | } |
jmitc91516 | 0:9140ec6aa604 | 2524 | if (sgl.CurItem.BarForeColorEnhance > 0) |
jmitc91516 | 0:9140ec6aa604 | 2525 | sgl.CurItem.BarForeColor = GuiLib_BrightenPixelColor( |
jmitc91516 | 0:9140ec6aa604 | 2526 | sgl.CurItem.BarForeColor, sgl.CurItem.BarForeColorEnhance); |
jmitc91516 | 0:9140ec6aa604 | 2527 | else if (sgl.CurItem.BarForeColorEnhance < 0) |
jmitc91516 | 0:9140ec6aa604 | 2528 | sgl.CurItem.BarForeColor = GuiLib_DarkenPixelColor( |
jmitc91516 | 0:9140ec6aa604 | 2529 | sgl.CurItem.BarForeColor, -sgl.CurItem.BarForeColorEnhance); |
jmitc91516 | 0:9140ec6aa604 | 2530 | } |
jmitc91516 | 0:9140ec6aa604 | 2531 | |
jmitc91516 | 0:9140ec6aa604 | 2532 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_CLEARAREA + |
jmitc91516 | 0:9140ec6aa604 | 2533 | GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 2534 | GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2535 | GuiLib_ITEMBIT_FRAME + |
jmitc91516 | 0:9140ec6aa604 | 2536 | GuiLib_ITEMBIT_CIRCLE + |
jmitc91516 | 0:9140ec6aa604 | 2537 | GuiLib_ITEMBIT_ELLIPSE + |
jmitc91516 | 0:9140ec6aa604 | 2538 | GuiLib_ITEMBIT_STRUCTURE + |
jmitc91516 | 0:9140ec6aa604 | 2539 | GuiLib_ITEMBIT_STRUCTARRAY + |
jmitc91516 | 0:9140ec6aa604 | 2540 | GuiLib_ITEMBIT_VAR + |
jmitc91516 | 0:9140ec6aa604 | 2541 | GuiLib_ITEMBIT_VARBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2542 | GuiLib_ITEMBIT_SCROLLBOX + |
jmitc91516 | 0:9140ec6aa604 | 2543 | GuiLib_ITEMBIT_GRAPH + |
jmitc91516 | 0:9140ec6aa604 | 2544 | GuiLib_ITEMBIT_GRAPHICSLAYER)) || |
jmitc91516 | 0:9140ec6aa604 | 2545 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_ROUNDEDFRAME + |
jmitc91516 | 0:9140ec6aa604 | 2546 | GuiLib_ITEMBIT_QUARTERCIRCLE + |
jmitc91516 | 0:9140ec6aa604 | 2547 | GuiLib_ITEMBIT_QUARTERELLIPSE + |
jmitc91516 | 0:9140ec6aa604 | 2548 | GuiLib_ITEMBIT_CHECKBOX + |
jmitc91516 | 0:9140ec6aa604 | 2549 | GuiLib_ITEMBIT_RADIOBUTTON + |
jmitc91516 | 0:9140ec6aa604 | 2550 | GuiLib_ITEMBIT_BUTTON + |
jmitc91516 | 0:9140ec6aa604 | 2551 | GuiLib_ITEMBIT_EDITBOX + |
jmitc91516 | 0:9140ec6aa604 | 2552 | GuiLib_ITEMBIT_PANEL + |
jmitc91516 | 0:9140ec6aa604 | 2553 | GuiLib_ITEMBIT_MEMO + |
jmitc91516 | 0:9140ec6aa604 | 2554 | GuiLib_ITEMBIT_LISTBOX + |
jmitc91516 | 0:9140ec6aa604 | 2555 | GuiLib_ITEMBIT_COMBOBOX + |
jmitc91516 | 0:9140ec6aa604 | 2556 | GuiLib_ITEMBIT_SCROLLAREA + |
jmitc91516 | 0:9140ec6aa604 | 2557 | GuiLib_ITEMBIT_PROGRESSBAR + |
jmitc91516 | 0:9140ec6aa604 | 2558 | GuiLib_ITEMBIT_STRUCTCOND))) |
jmitc91516 | 0:9140ec6aa604 | 2559 | { |
jmitc91516 | 0:9140ec6aa604 | 2560 | B1 = ColMemoryBack & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2561 | if (B1) |
jmitc91516 | 0:9140ec6aa604 | 2562 | { |
jmitc91516 | 0:9140ec6aa604 | 2563 | sgl.CurItem.BackColor = sgl.Memory.C[B1-1]; |
jmitc91516 | 0:9140ec6aa604 | 2564 | sgl.CurItem.BackColorIndex = sgl.ColMemoryIndex[B1-1]; |
jmitc91516 | 0:9140ec6aa604 | 2565 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2566 | } |
jmitc91516 | 0:9140ec6aa604 | 2567 | else |
jmitc91516 | 0:9140ec6aa604 | 2568 | { |
jmitc91516 | 0:9140ec6aa604 | 2569 | TmpColIdx = sgl.CurItem.BackColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 2570 | sgl.CurItem.BackColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 2571 | switch ((sgl.CommonByte3 >> 3) & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 2572 | { |
jmitc91516 | 0:9140ec6aa604 | 2573 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 2574 | sgl.CurItem.BackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 2575 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2576 | break; |
jmitc91516 | 0:9140ec6aa604 | 2577 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 2578 | sgl.CurItem.BackColor = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 2579 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2580 | break; |
jmitc91516 | 0:9140ec6aa604 | 2581 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 2582 | sgl.CurItem.BackColor = GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2583 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2584 | break; |
jmitc91516 | 0:9140ec6aa604 | 2585 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 2586 | sgl.CurItem.BackColor = TmpForeColor; |
jmitc91516 | 0:9140ec6aa604 | 2587 | sgl.CurItem.BackColorIndex = TmpForeColIdx; |
jmitc91516 | 0:9140ec6aa604 | 2588 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2589 | break; |
jmitc91516 | 0:9140ec6aa604 | 2590 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 2591 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_TRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2592 | break; |
jmitc91516 | 0:9140ec6aa604 | 2593 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 2594 | sgl.CurItem.BackColor = |
jmitc91516 | 0:9140ec6aa604 | 2595 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 2596 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2597 | break; |
jmitc91516 | 0:9140ec6aa604 | 2598 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 2599 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2600 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 2601 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 2602 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 2603 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 2604 | { |
jmitc91516 | 0:9140ec6aa604 | 2605 | sgl.CurItem.BackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 2606 | } |
jmitc91516 | 0:9140ec6aa604 | 2607 | else |
jmitc91516 | 0:9140ec6aa604 | 2608 | { |
jmitc91516 | 0:9140ec6aa604 | 2609 | sgl.CurItem.BackColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 2610 | sgl.CurItem.BackColorIndex = ColVarPtrIdx; |
jmitc91516 | 0:9140ec6aa604 | 2611 | } |
jmitc91516 | 0:9140ec6aa604 | 2612 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2613 | break; |
jmitc91516 | 0:9140ec6aa604 | 2614 | default: |
jmitc91516 | 0:9140ec6aa604 | 2615 | sgl.CurItem.BackColorIndex = TmpColIdx; |
jmitc91516 | 0:9140ec6aa604 | 2616 | break; |
jmitc91516 | 0:9140ec6aa604 | 2617 | } |
jmitc91516 | 0:9140ec6aa604 | 2618 | } |
jmitc91516 | 0:9140ec6aa604 | 2619 | if (sgl.CurItem.BackColorEnhance > 0) |
jmitc91516 | 0:9140ec6aa604 | 2620 | sgl.CurItem.BackColor = GuiLib_BrightenPixelColor( |
jmitc91516 | 0:9140ec6aa604 | 2621 | sgl.CurItem.BackColor, sgl.CurItem.BackColorEnhance); |
jmitc91516 | 0:9140ec6aa604 | 2622 | else if (sgl.CurItem.BackColorEnhance < 0) |
jmitc91516 | 0:9140ec6aa604 | 2623 | sgl.CurItem.BackColor = GuiLib_DarkenPixelColor( |
jmitc91516 | 0:9140ec6aa604 | 2624 | sgl.CurItem.BackColor, -sgl.CurItem.BackColorEnhance); |
jmitc91516 | 0:9140ec6aa604 | 2625 | |
jmitc91516 | 0:9140ec6aa604 | 2626 | B1 = ColMemoryBack & 0x30; |
jmitc91516 | 0:9140ec6aa604 | 2627 | if (B1) |
jmitc91516 | 0:9140ec6aa604 | 2628 | { |
jmitc91516 | 0:9140ec6aa604 | 2629 | sgl.CurItem.BarBackColor = sgl.Memory.C[B1-1]; |
jmitc91516 | 0:9140ec6aa604 | 2630 | sgl.CurItem.BarBackColorIndex = sgl.ColMemoryIndex[B1-1]; |
jmitc91516 | 0:9140ec6aa604 | 2631 | } |
jmitc91516 | 0:9140ec6aa604 | 2632 | else |
jmitc91516 | 0:9140ec6aa604 | 2633 | { |
jmitc91516 | 0:9140ec6aa604 | 2634 | TmpColIdx = sgl.CurItem.BarBackColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 2635 | sgl.CurItem.BarBackColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 2636 | switch ((sgl.CommonByte5 >> 4) & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 2637 | { |
jmitc91516 | 0:9140ec6aa604 | 2638 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 2639 | sgl.CurItem.BarBackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 2640 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BARTRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2641 | break; |
jmitc91516 | 0:9140ec6aa604 | 2642 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 2643 | sgl.CurItem.BarBackColor = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 2644 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BARTRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2645 | break; |
jmitc91516 | 0:9140ec6aa604 | 2646 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 2647 | sgl.CurItem.BarBackColor = GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2648 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BARTRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2649 | break; |
jmitc91516 | 0:9140ec6aa604 | 2650 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 2651 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BARTRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2652 | sgl.CurItem.BarBackColor = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 2653 | break; |
jmitc91516 | 0:9140ec6aa604 | 2654 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 2655 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_BARTRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2656 | break; |
jmitc91516 | 0:9140ec6aa604 | 2657 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 2658 | sgl.CurItem.BarBackColor = |
jmitc91516 | 0:9140ec6aa604 | 2659 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 2660 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BARTRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2661 | break; |
jmitc91516 | 0:9140ec6aa604 | 2662 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 2663 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2664 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 2665 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 2666 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate*)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 2667 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 2668 | { |
jmitc91516 | 0:9140ec6aa604 | 2669 | sgl.CurItem.BarBackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 2670 | } |
jmitc91516 | 0:9140ec6aa604 | 2671 | else |
jmitc91516 | 0:9140ec6aa604 | 2672 | { |
jmitc91516 | 0:9140ec6aa604 | 2673 | sgl.CurItem.BarBackColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 2674 | sgl.CurItem.BarBackColorIndex = ColVarPtrIdx; |
jmitc91516 | 0:9140ec6aa604 | 2675 | } |
jmitc91516 | 0:9140ec6aa604 | 2676 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BARTRANSPARENT; |
jmitc91516 | 0:9140ec6aa604 | 2677 | break; |
jmitc91516 | 0:9140ec6aa604 | 2678 | default: |
jmitc91516 | 0:9140ec6aa604 | 2679 | sgl.CurItem.BarBackColorIndex = TmpColIdx; |
jmitc91516 | 0:9140ec6aa604 | 2680 | break; |
jmitc91516 | 0:9140ec6aa604 | 2681 | } |
jmitc91516 | 0:9140ec6aa604 | 2682 | } |
jmitc91516 | 0:9140ec6aa604 | 2683 | if (sgl.CurItem.BarBackColorEnhance > 0) |
jmitc91516 | 0:9140ec6aa604 | 2684 | sgl.CurItem.BarBackColor = GuiLib_BrightenPixelColor( |
jmitc91516 | 0:9140ec6aa604 | 2685 | sgl.CurItem.BarBackColor, sgl.CurItem.BarBackColorEnhance); |
jmitc91516 | 0:9140ec6aa604 | 2686 | else if (sgl.CurItem.BarBackColorEnhance < 0) |
jmitc91516 | 0:9140ec6aa604 | 2687 | sgl.CurItem.BarBackColor = GuiLib_DarkenPixelColor( |
jmitc91516 | 0:9140ec6aa604 | 2688 | sgl.CurItem.BarBackColor, -sgl.CurItem.BarBackColorEnhance); |
jmitc91516 | 0:9140ec6aa604 | 2689 | } |
jmitc91516 | 0:9140ec6aa604 | 2690 | |
jmitc91516 | 0:9140ec6aa604 | 2691 | #ifdef GuiConst_COLOR_DEPTH_1 |
jmitc91516 | 0:9140ec6aa604 | 2692 | #ifdef GuiConst_BITMAP_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 2693 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_BITMAP + |
jmitc91516 | 0:9140ec6aa604 | 2694 | GuiLib_ITEMBIT_BACKGROUND)) && |
jmitc91516 | 0:9140ec6aa604 | 2695 | (sgl.CommonByte6 & 0x02)) |
jmitc91516 | 0:9140ec6aa604 | 2696 | sgl.CurItem.CompPars.CompBitmap.TranspColor = (sgl.CommonByte6 >> 2) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 2697 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2698 | #else |
jmitc91516 | 0:9140ec6aa604 | 2699 | #ifdef GuiConst_BITMAP_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 2700 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_BITMAP + |
jmitc91516 | 0:9140ec6aa604 | 2701 | GuiLib_ITEMBIT_BACKGROUND)) && |
jmitc91516 | 0:9140ec6aa604 | 2702 | (sgl.CommonByte6 & 0x02)) |
jmitc91516 | 0:9140ec6aa604 | 2703 | { |
jmitc91516 | 0:9140ec6aa604 | 2704 | sgl.CurItem.CompPars.CompBitmap.TranspColor = GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2705 | } |
jmitc91516 | 0:9140ec6aa604 | 2706 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2707 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2708 | |
jmitc91516 | 0:9140ec6aa604 | 2709 | B1 = ColMemoryFore & 0x0C; |
jmitc91516 | 0:9140ec6aa604 | 2710 | if (B1) |
jmitc91516 | 0:9140ec6aa604 | 2711 | { |
jmitc91516 | 0:9140ec6aa604 | 2712 | sgl.Memory.C[B1 - 1] = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 2713 | sgl.ColMemoryIndex[B1 - 1] = sgl.CurItem.ForeColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 2714 | } |
jmitc91516 | 0:9140ec6aa604 | 2715 | B1 = ColMemoryFore & 0xC0; |
jmitc91516 | 0:9140ec6aa604 | 2716 | if (B1) |
jmitc91516 | 0:9140ec6aa604 | 2717 | { |
jmitc91516 | 0:9140ec6aa604 | 2718 | sgl.Memory.C[B1 - 1] = sgl.CurItem.BarForeColor; |
jmitc91516 | 0:9140ec6aa604 | 2719 | sgl.ColMemoryIndex[B1 - 1] = sgl.CurItem.BarForeColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 2720 | } |
jmitc91516 | 0:9140ec6aa604 | 2721 | B1 = ColMemoryBack & 0x0C; |
jmitc91516 | 0:9140ec6aa604 | 2722 | if (B1) |
jmitc91516 | 0:9140ec6aa604 | 2723 | { |
jmitc91516 | 0:9140ec6aa604 | 2724 | sgl.Memory.C[B1 - 1] = sgl.CurItem.BackColor; |
jmitc91516 | 0:9140ec6aa604 | 2725 | sgl.ColMemoryIndex[B1 - 1] = sgl.CurItem.BackColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 2726 | } |
jmitc91516 | 0:9140ec6aa604 | 2727 | B1 = ColMemoryBack & 0xC0; |
jmitc91516 | 0:9140ec6aa604 | 2728 | if (B1) |
jmitc91516 | 0:9140ec6aa604 | 2729 | { |
jmitc91516 | 0:9140ec6aa604 | 2730 | sgl.Memory.C[B1 - 1] = sgl.CurItem.BarBackColor; |
jmitc91516 | 0:9140ec6aa604 | 2731 | sgl.ColMemoryIndex[B1 - 1] = sgl.CurItem.BarBackColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 2732 | } |
jmitc91516 | 0:9140ec6aa604 | 2733 | |
jmitc91516 | 0:9140ec6aa604 | 2734 | if (sgl.CommonByte0 & 0x40) |
jmitc91516 | 0:9140ec6aa604 | 2735 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2736 | else |
jmitc91516 | 0:9140ec6aa604 | 2737 | B1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2738 | sgl.X1MemoryRead = B1 & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2739 | sgl.X1MemoryWrite = (B1 >> 2) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2740 | sgl.Y1MemoryRead = (B1 >> 4) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2741 | sgl.Y1MemoryWrite = (B1 >> 6) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2742 | if (sgl.CommonByte0 & 0x80) |
jmitc91516 | 0:9140ec6aa604 | 2743 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2744 | else |
jmitc91516 | 0:9140ec6aa604 | 2745 | B1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2746 | sgl.X2MemoryRead = B1 & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2747 | sgl.X2MemoryWrite = (B1 >> 2) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2748 | sgl.Y2MemoryRead = (B1 >> 4) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2749 | sgl.Y2MemoryWrite = (B1 >> 6) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2750 | if (sgl.CommonByte7 & 0x01) |
jmitc91516 | 0:9140ec6aa604 | 2751 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2752 | else |
jmitc91516 | 0:9140ec6aa604 | 2753 | B1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2754 | sgl.R1MemoryRead = B1 & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2755 | sgl.R1MemoryWrite = (B1 >> 2) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2756 | sgl.R2MemoryRead = (B1 >> 4) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2757 | sgl.R2MemoryWrite = (B1 >> 6) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2758 | if (sgl.CommonByte7 & 0x80) |
jmitc91516 | 0:9140ec6aa604 | 2759 | { |
jmitc91516 | 0:9140ec6aa604 | 2760 | if (sgl.X1MemoryRead) |
jmitc91516 | 0:9140ec6aa604 | 2761 | sgl.X1MemoryRead += GuiLib_MEMORY_CNT; |
jmitc91516 | 0:9140ec6aa604 | 2762 | if (sgl.X1MemoryWrite) |
jmitc91516 | 0:9140ec6aa604 | 2763 | sgl.X1MemoryWrite += GuiLib_MEMORY_CNT; |
jmitc91516 | 0:9140ec6aa604 | 2764 | if (sgl.Y1MemoryRead) |
jmitc91516 | 0:9140ec6aa604 | 2765 | sgl.Y1MemoryRead += GuiLib_MEMORY_CNT; |
jmitc91516 | 0:9140ec6aa604 | 2766 | if (sgl.Y1MemoryWrite) |
jmitc91516 | 0:9140ec6aa604 | 2767 | sgl.Y1MemoryWrite += GuiLib_MEMORY_CNT; |
jmitc91516 | 0:9140ec6aa604 | 2768 | if (sgl.X2MemoryRead) |
jmitc91516 | 0:9140ec6aa604 | 2769 | sgl.X2MemoryRead += GuiLib_MEMORY_CNT; |
jmitc91516 | 0:9140ec6aa604 | 2770 | if (sgl.X2MemoryWrite) |
jmitc91516 | 0:9140ec6aa604 | 2771 | sgl.X2MemoryWrite += GuiLib_MEMORY_CNT; |
jmitc91516 | 0:9140ec6aa604 | 2772 | if (sgl.Y2MemoryRead) |
jmitc91516 | 0:9140ec6aa604 | 2773 | sgl.Y2MemoryRead += GuiLib_MEMORY_CNT; |
jmitc91516 | 0:9140ec6aa604 | 2774 | if (sgl.Y2MemoryWrite) |
jmitc91516 | 0:9140ec6aa604 | 2775 | sgl.Y2MemoryWrite += GuiLib_MEMORY_CNT; |
jmitc91516 | 0:9140ec6aa604 | 2776 | if (sgl.R1MemoryRead) |
jmitc91516 | 0:9140ec6aa604 | 2777 | sgl.R1MemoryRead += GuiLib_MEMORY_CNT; |
jmitc91516 | 0:9140ec6aa604 | 2778 | if (sgl.R1MemoryWrite) |
jmitc91516 | 0:9140ec6aa604 | 2779 | sgl.R1MemoryWrite += GuiLib_MEMORY_CNT; |
jmitc91516 | 0:9140ec6aa604 | 2780 | if (sgl.R2MemoryRead) |
jmitc91516 | 0:9140ec6aa604 | 2781 | sgl.R2MemoryRead += GuiLib_MEMORY_CNT; |
jmitc91516 | 0:9140ec6aa604 | 2782 | if (sgl.R2MemoryWrite) |
jmitc91516 | 0:9140ec6aa604 | 2783 | sgl.R2MemoryWrite += GuiLib_MEMORY_CNT; |
jmitc91516 | 0:9140ec6aa604 | 2784 | } |
jmitc91516 | 0:9140ec6aa604 | 2785 | |
jmitc91516 | 0:9140ec6aa604 | 2786 | if (sgl.CommonByte6 & 0x01) |
jmitc91516 | 0:9140ec6aa604 | 2787 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2788 | else |
jmitc91516 | 0:9140ec6aa604 | 2789 | B1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2790 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 2791 | GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2792 | GuiLib_ITEMBIT_STRUCTURE + |
jmitc91516 | 0:9140ec6aa604 | 2793 | GuiLib_ITEMBIT_STRUCTARRAY + |
jmitc91516 | 0:9140ec6aa604 | 2794 | GuiLib_ITEMBIT_VAR + |
jmitc91516 | 0:9140ec6aa604 | 2795 | GuiLib_ITEMBIT_VARBLOCK)) || |
jmitc91516 | 0:9140ec6aa604 | 2796 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_STRUCTCOND))) |
jmitc91516 | 0:9140ec6aa604 | 2797 | sgl.CurItem.TextPar[0].BackBorderPixels = B1; |
jmitc91516 | 0:9140ec6aa604 | 2798 | else |
jmitc91516 | 0:9140ec6aa604 | 2799 | sgl.CurItem.TextPar[0].BackBorderPixels = 0; |
jmitc91516 | 0:9140ec6aa604 | 2800 | |
jmitc91516 | 0:9140ec6aa604 | 2801 | if (sgl.CommonByte6 & 0x08) |
jmitc91516 | 0:9140ec6aa604 | 2802 | { |
jmitc91516 | 0:9140ec6aa604 | 2803 | N = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2804 | sgl.CurItem.TextPar[0].BackBoxSizeY1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2805 | sgl.CurItem.TextPar[0].BackBoxSizeY2 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2806 | } |
jmitc91516 | 0:9140ec6aa604 | 2807 | else |
jmitc91516 | 0:9140ec6aa604 | 2808 | N = 0; |
jmitc91516 | 0:9140ec6aa604 | 2809 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 2810 | GuiLib_ITEMBIT_STRUCTURE + |
jmitc91516 | 0:9140ec6aa604 | 2811 | GuiLib_ITEMBIT_STRUCTARRAY + |
jmitc91516 | 0:9140ec6aa604 | 2812 | GuiLib_ITEMBIT_VAR)) || |
jmitc91516 | 0:9140ec6aa604 | 2813 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_STRUCTCOND))) |
jmitc91516 | 0:9140ec6aa604 | 2814 | sgl.CurItem.TextPar[0].BackBoxSizeX = N; |
jmitc91516 | 0:9140ec6aa604 | 2815 | else |
jmitc91516 | 0:9140ec6aa604 | 2816 | sgl.CurItem.TextPar[0].BackBoxSizeX = 0; |
jmitc91516 | 0:9140ec6aa604 | 2817 | #ifdef GuiConst_ITEM_SCROLLBOX_INUSE |
jmitc91516 | 0:9140ec6aa604 | 2818 | if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_SCROLLBOX) |
jmitc91516 | 0:9140ec6aa604 | 2819 | { |
jmitc91516 | 0:9140ec6aa604 | 2820 | if (sgl.NextScrollLineReading) |
jmitc91516 | 0:9140ec6aa604 | 2821 | if (sgl.CommonByte6 & 0x08) |
jmitc91516 | 0:9140ec6aa604 | 2822 | { |
jmitc91516 | 0:9140ec6aa604 | 2823 | sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].LineSizeX = |
jmitc91516 | 0:9140ec6aa604 | 2824 | sgl.CurItem.TextPar[0].BackBoxSizeX; |
jmitc91516 | 0:9140ec6aa604 | 2825 | sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].LineSizeY = |
jmitc91516 | 0:9140ec6aa604 | 2826 | sgl.CurItem.TextPar[0].BackBoxSizeY1; |
jmitc91516 | 0:9140ec6aa604 | 2827 | sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].LineSizeY2 = |
jmitc91516 | 0:9140ec6aa604 | 2828 | sgl.CurItem.TextPar[0].BackBoxSizeY2; |
jmitc91516 | 0:9140ec6aa604 | 2829 | } |
jmitc91516 | 0:9140ec6aa604 | 2830 | } |
jmitc91516 | 0:9140ec6aa604 | 2831 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2832 | |
jmitc91516 | 0:9140ec6aa604 | 2833 | sgl.X1Mode = sgl.CommonByte1 & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2834 | sgl.Y1Mode = (sgl.CommonByte1 >> 2) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2835 | sgl.X2Mode = (sgl.CommonByte1 >> 4) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2836 | sgl.Y2Mode = (sgl.CommonByte1 >> 6) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2837 | sgl.R1Mode = (sgl.CommonByte7 >> 1) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2838 | sgl.R2Mode = (sgl.CommonByte7 >> 3) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2839 | |
jmitc91516 | 0:9140ec6aa604 | 2840 | if (sgl.CommonByte2 & 0x01) |
jmitc91516 | 0:9140ec6aa604 | 2841 | sgl.ItemX1 = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2842 | else |
jmitc91516 | 0:9140ec6aa604 | 2843 | sgl.ItemX1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2844 | if (sgl.CommonByte2 & 0x02) |
jmitc91516 | 0:9140ec6aa604 | 2845 | sgl.ItemY1 = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2846 | else |
jmitc91516 | 0:9140ec6aa604 | 2847 | sgl.ItemY1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2848 | if (sgl.CommonByte2 & 0x04) |
jmitc91516 | 0:9140ec6aa604 | 2849 | sgl.ItemX2 = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2850 | else |
jmitc91516 | 0:9140ec6aa604 | 2851 | sgl.ItemX2 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2852 | if (sgl.CommonByte2 & 0x08) |
jmitc91516 | 0:9140ec6aa604 | 2853 | sgl.ItemY2 = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2854 | else |
jmitc91516 | 0:9140ec6aa604 | 2855 | sgl.ItemY2 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2856 | if (sgl.CommonByte6 & 0x10) |
jmitc91516 | 0:9140ec6aa604 | 2857 | sgl.ItemR1 = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2858 | else |
jmitc91516 | 0:9140ec6aa604 | 2859 | sgl.ItemR1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2860 | if (sgl.CommonByte6 & 0x20) |
jmitc91516 | 0:9140ec6aa604 | 2861 | sgl.ItemR2 = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2862 | else |
jmitc91516 | 0:9140ec6aa604 | 2863 | sgl.ItemR2 = 0; |
jmitc91516 | 0:9140ec6aa604 | 2864 | |
jmitc91516 | 0:9140ec6aa604 | 2865 | if (sgl.CommonByte2 & 0x10) |
jmitc91516 | 0:9140ec6aa604 | 2866 | { |
jmitc91516 | 0:9140ec6aa604 | 2867 | sgl.X1VarIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2868 | if (sgl.X1VarIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 2869 | sgl.X1VarIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 2870 | } |
jmitc91516 | 0:9140ec6aa604 | 2871 | if (sgl.CommonByte2 & 0x20) |
jmitc91516 | 0:9140ec6aa604 | 2872 | { |
jmitc91516 | 0:9140ec6aa604 | 2873 | sgl.Y1VarIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2874 | if (sgl.Y1VarIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 2875 | sgl.Y1VarIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 2876 | } |
jmitc91516 | 0:9140ec6aa604 | 2877 | if (sgl.CommonByte2 & 0x40) |
jmitc91516 | 0:9140ec6aa604 | 2878 | { |
jmitc91516 | 0:9140ec6aa604 | 2879 | sgl.X2VarIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2880 | if (sgl.X2VarIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 2881 | sgl.X2VarIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 2882 | } |
jmitc91516 | 0:9140ec6aa604 | 2883 | if (sgl.CommonByte2 & 0x80) |
jmitc91516 | 0:9140ec6aa604 | 2884 | { |
jmitc91516 | 0:9140ec6aa604 | 2885 | sgl.Y2VarIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2886 | if (sgl.Y2VarIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 2887 | sgl.Y2VarIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 2888 | } |
jmitc91516 | 0:9140ec6aa604 | 2889 | if (sgl.CommonByte6 & 0x40) |
jmitc91516 | 0:9140ec6aa604 | 2890 | { |
jmitc91516 | 0:9140ec6aa604 | 2891 | sgl.R1VarIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2892 | if (sgl.R1VarIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 2893 | sgl.R1VarIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 2894 | } |
jmitc91516 | 0:9140ec6aa604 | 2895 | if (sgl.CommonByte6 & 0x80) |
jmitc91516 | 0:9140ec6aa604 | 2896 | { |
jmitc91516 | 0:9140ec6aa604 | 2897 | sgl.R2VarIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2898 | if (sgl.R2VarIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 2899 | sgl.R2VarIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 2900 | } |
jmitc91516 | 0:9140ec6aa604 | 2901 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_CLEARAREA + |
jmitc91516 | 0:9140ec6aa604 | 2902 | GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 2903 | GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2904 | GuiLib_ITEMBIT_LINE + |
jmitc91516 | 0:9140ec6aa604 | 2905 | GuiLib_ITEMBIT_FRAME + |
jmitc91516 | 0:9140ec6aa604 | 2906 | GuiLib_ITEMBIT_BLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2907 | GuiLib_ITEMBIT_CIRCLE + |
jmitc91516 | 0:9140ec6aa604 | 2908 | GuiLib_ITEMBIT_ELLIPSE + |
jmitc91516 | 0:9140ec6aa604 | 2909 | GuiLib_ITEMBIT_BITMAP + |
jmitc91516 | 0:9140ec6aa604 | 2910 | GuiLib_ITEMBIT_BACKGROUND + |
jmitc91516 | 0:9140ec6aa604 | 2911 | GuiLib_ITEMBIT_STRUCTURE + |
jmitc91516 | 0:9140ec6aa604 | 2912 | GuiLib_ITEMBIT_STRUCTARRAY + |
jmitc91516 | 0:9140ec6aa604 | 2913 | GuiLib_ITEMBIT_ACTIVEAREA + |
jmitc91516 | 0:9140ec6aa604 | 2914 | GuiLib_ITEMBIT_CLIPRECT + |
jmitc91516 | 0:9140ec6aa604 | 2915 | GuiLib_ITEMBIT_VAR + |
jmitc91516 | 0:9140ec6aa604 | 2916 | GuiLib_ITEMBIT_VARBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2917 | GuiLib_ITEMBIT_TOUCHAREA + |
jmitc91516 | 0:9140ec6aa604 | 2918 | GuiLib_ITEMBIT_SCROLLBOX + |
jmitc91516 | 0:9140ec6aa604 | 2919 | GuiLib_ITEMBIT_GRAPH + |
jmitc91516 | 0:9140ec6aa604 | 2920 | GuiLib_ITEMBIT_GRAPHICSLAYER)) || |
jmitc91516 | 0:9140ec6aa604 | 2921 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_ROUNDEDFRAME + |
jmitc91516 | 0:9140ec6aa604 | 2922 | GuiLib_ITEMBIT_ROUNDEDBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2923 | GuiLib_ITEMBIT_QUARTERCIRCLE + |
jmitc91516 | 0:9140ec6aa604 | 2924 | GuiLib_ITEMBIT_QUARTERELLIPSE + |
jmitc91516 | 0:9140ec6aa604 | 2925 | GuiLib_ITEMBIT_CHECKBOX + |
jmitc91516 | 0:9140ec6aa604 | 2926 | GuiLib_ITEMBIT_RADIOBUTTON + |
jmitc91516 | 0:9140ec6aa604 | 2927 | GuiLib_ITEMBIT_BUTTON + |
jmitc91516 | 0:9140ec6aa604 | 2928 | GuiLib_ITEMBIT_EDITBOX + |
jmitc91516 | 0:9140ec6aa604 | 2929 | GuiLib_ITEMBIT_PANEL + |
jmitc91516 | 0:9140ec6aa604 | 2930 | GuiLib_ITEMBIT_MEMO + |
jmitc91516 | 0:9140ec6aa604 | 2931 | GuiLib_ITEMBIT_LISTBOX + |
jmitc91516 | 0:9140ec6aa604 | 2932 | GuiLib_ITEMBIT_COMBOBOX + |
jmitc91516 | 0:9140ec6aa604 | 2933 | GuiLib_ITEMBIT_SCROLLAREA + |
jmitc91516 | 0:9140ec6aa604 | 2934 | GuiLib_ITEMBIT_PROGRESSBAR + |
jmitc91516 | 0:9140ec6aa604 | 2935 | GuiLib_ITEMBIT_STRUCTCOND))) |
jmitc91516 | 0:9140ec6aa604 | 2936 | { |
jmitc91516 | 0:9140ec6aa604 | 2937 | B1 = (sgl.CommonByte3 >> 6) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2938 | if (B1 != GuiLib_ALIGN_NOCHANGE) |
jmitc91516 | 0:9140ec6aa604 | 2939 | sgl.CurItem.TextPar[0].Alignment = B1; |
jmitc91516 | 0:9140ec6aa604 | 2940 | } |
jmitc91516 | 0:9140ec6aa604 | 2941 | |
jmitc91516 | 0:9140ec6aa604 | 2942 | B1 = sgl.CommonByte4 & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 2943 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 2944 | GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2945 | GuiLib_ITEMBIT_STRUCTURE + |
jmitc91516 | 0:9140ec6aa604 | 2946 | GuiLib_ITEMBIT_STRUCTARRAY + |
jmitc91516 | 0:9140ec6aa604 | 2947 | GuiLib_ITEMBIT_VAR + |
jmitc91516 | 0:9140ec6aa604 | 2948 | GuiLib_ITEMBIT_VARBLOCK)) || |
jmitc91516 | 0:9140ec6aa604 | 2949 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_EDITBOX + |
jmitc91516 | 0:9140ec6aa604 | 2950 | GuiLib_ITEMBIT_MEMO + |
jmitc91516 | 0:9140ec6aa604 | 2951 | GuiLib_ITEMBIT_LISTBOX + |
jmitc91516 | 0:9140ec6aa604 | 2952 | GuiLib_ITEMBIT_COMBOBOX + |
jmitc91516 | 0:9140ec6aa604 | 2953 | GuiLib_ITEMBIT_PROGRESSBAR + |
jmitc91516 | 0:9140ec6aa604 | 2954 | GuiLib_ITEMBIT_STRUCTCOND))) |
jmitc91516 | 0:9140ec6aa604 | 2955 | { |
jmitc91516 | 0:9140ec6aa604 | 2956 | if (B1 != GuiLib_PS_NOCHANGE) |
jmitc91516 | 0:9140ec6aa604 | 2957 | sgl.CurItem.TextPar[0].Ps = B1; |
jmitc91516 | 0:9140ec6aa604 | 2958 | } |
jmitc91516 | 0:9140ec6aa604 | 2959 | |
jmitc91516 | 0:9140ec6aa604 | 2960 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 2961 | GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 2962 | GuiLib_ITEMBIT_STRUCTURE + |
jmitc91516 | 0:9140ec6aa604 | 2963 | GuiLib_ITEMBIT_STRUCTARRAY + |
jmitc91516 | 0:9140ec6aa604 | 2964 | GuiLib_ITEMBIT_VAR + |
jmitc91516 | 0:9140ec6aa604 | 2965 | GuiLib_ITEMBIT_VARBLOCK)) || |
jmitc91516 | 0:9140ec6aa604 | 2966 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_EDITBOX + |
jmitc91516 | 0:9140ec6aa604 | 2967 | GuiLib_ITEMBIT_MEMO + |
jmitc91516 | 0:9140ec6aa604 | 2968 | GuiLib_ITEMBIT_LISTBOX + |
jmitc91516 | 0:9140ec6aa604 | 2969 | GuiLib_ITEMBIT_COMBOBOX + |
jmitc91516 | 0:9140ec6aa604 | 2970 | GuiLib_ITEMBIT_PROGRESSBAR + |
jmitc91516 | 0:9140ec6aa604 | 2971 | GuiLib_ITEMBIT_STRUCTCOND))) |
jmitc91516 | 0:9140ec6aa604 | 2972 | { |
jmitc91516 | 0:9140ec6aa604 | 2973 | if (sgl.CommonByte4 & 0x10) |
jmitc91516 | 0:9140ec6aa604 | 2974 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_UNDERLINE; |
jmitc91516 | 0:9140ec6aa604 | 2975 | else |
jmitc91516 | 0:9140ec6aa604 | 2976 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_UNDERLINE; |
jmitc91516 | 0:9140ec6aa604 | 2977 | } |
jmitc91516 | 0:9140ec6aa604 | 2978 | else if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_LINE + |
jmitc91516 | 0:9140ec6aa604 | 2979 | GuiLib_ITEMBIT_CIRCLE)) |
jmitc91516 | 0:9140ec6aa604 | 2980 | { |
jmitc91516 | 0:9140ec6aa604 | 2981 | if (sgl.CommonByte4 & 0x10) |
jmitc91516 | 0:9140ec6aa604 | 2982 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_PATTERNEDLINE; |
jmitc91516 | 0:9140ec6aa604 | 2983 | else |
jmitc91516 | 0:9140ec6aa604 | 2984 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_PATTERNEDLINE; |
jmitc91516 | 0:9140ec6aa604 | 2985 | } |
jmitc91516 | 0:9140ec6aa604 | 2986 | |
jmitc91516 | 0:9140ec6aa604 | 2987 | if (sgl.CommonByte4 & 0x20) |
jmitc91516 | 0:9140ec6aa604 | 2988 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_AUTOREDRAWFIELD; |
jmitc91516 | 0:9140ec6aa604 | 2989 | else |
jmitc91516 | 0:9140ec6aa604 | 2990 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_AUTOREDRAWFIELD; |
jmitc91516 | 0:9140ec6aa604 | 2991 | |
jmitc91516 | 0:9140ec6aa604 | 2992 | #ifdef GuiConst_CURSOR_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 2993 | if (sgl.CommonByte4 & 0x40) |
jmitc91516 | 0:9140ec6aa604 | 2994 | sgl.CurItem.CursorFieldNo = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 2995 | else |
jmitc91516 | 0:9140ec6aa604 | 2996 | sgl.CurItem.CursorFieldNo = -1; |
jmitc91516 | 0:9140ec6aa604 | 2997 | #endif |
jmitc91516 | 0:9140ec6aa604 | 2998 | |
jmitc91516 | 0:9140ec6aa604 | 2999 | #ifdef GuiConst_BLINK_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 3000 | if (sgl.CommonByte5 & 0x01) |
jmitc91516 | 0:9140ec6aa604 | 3001 | BS2 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3002 | else |
jmitc91516 | 0:9140ec6aa604 | 3003 | BS2 = -1; |
jmitc91516 | 0:9140ec6aa604 | 3004 | if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 3005 | GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 3006 | GuiLib_ITEMBIT_VAR + |
jmitc91516 | 0:9140ec6aa604 | 3007 | GuiLib_ITEMBIT_VARBLOCK)) |
jmitc91516 | 0:9140ec6aa604 | 3008 | sgl.CurItem.BlinkFieldNo = BS2; |
jmitc91516 | 0:9140ec6aa604 | 3009 | else |
jmitc91516 | 0:9140ec6aa604 | 3010 | sgl.CurItem.BlinkFieldNo = -1; |
jmitc91516 | 0:9140ec6aa604 | 3011 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3012 | |
jmitc91516 | 0:9140ec6aa604 | 3013 | if (sgl.CommonByte4 & 0x80) |
jmitc91516 | 0:9140ec6aa604 | 3014 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_TRANSLATION; |
jmitc91516 | 0:9140ec6aa604 | 3015 | else |
jmitc91516 | 0:9140ec6aa604 | 3016 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSLATION; |
jmitc91516 | 0:9140ec6aa604 | 3017 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 3018 | GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 3019 | GuiLib_ITEMBIT_VAR + |
jmitc91516 | 0:9140ec6aa604 | 3020 | GuiLib_ITEMBIT_VARBLOCK)) || |
jmitc91516 | 0:9140ec6aa604 | 3021 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_BUTTON))) |
jmitc91516 | 0:9140ec6aa604 | 3022 | { |
jmitc91516 | 0:9140ec6aa604 | 3023 | if (sgl.CommonByte5 & 0x80) |
jmitc91516 | 0:9140ec6aa604 | 3024 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3025 | else |
jmitc91516 | 0:9140ec6aa604 | 3026 | { |
jmitc91516 | 0:9140ec6aa604 | 3027 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_VAR + |
jmitc91516 | 0:9140ec6aa604 | 3028 | GuiLib_ITEMBIT_VARBLOCK)) || |
jmitc91516 | 0:9140ec6aa604 | 3029 | (sgl.CommonByte4 & 0x80)) |
jmitc91516 | 0:9140ec6aa604 | 3030 | I = LanguageIndex; |
jmitc91516 | 0:9140ec6aa604 | 3031 | else |
jmitc91516 | 0:9140ec6aa604 | 3032 | I = 0; |
jmitc91516 | 0:9140ec6aa604 | 3033 | B1 = ReadByte(GuiFont_LanguageTextDir[I]); |
jmitc91516 | 0:9140ec6aa604 | 3034 | } |
jmitc91516 | 0:9140ec6aa604 | 3035 | } |
jmitc91516 | 0:9140ec6aa604 | 3036 | else |
jmitc91516 | 0:9140ec6aa604 | 3037 | B1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 3038 | if (B1) |
jmitc91516 | 0:9140ec6aa604 | 3039 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_REVERSEWRITING; |
jmitc91516 | 0:9140ec6aa604 | 3040 | else |
jmitc91516 | 0:9140ec6aa604 | 3041 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_REVERSEWRITING; |
jmitc91516 | 0:9140ec6aa604 | 3042 | |
jmitc91516 | 0:9140ec6aa604 | 3043 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_LINE)) && |
jmitc91516 | 0:9140ec6aa604 | 3044 | (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_PATTERNEDLINE)) |
jmitc91516 | 0:9140ec6aa604 | 3045 | sgl.CurItem.LinePattern = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3046 | |
jmitc91516 | 0:9140ec6aa604 | 3047 | #ifdef GuiConst_BLINK_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 3048 | if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 3049 | GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 3050 | GuiLib_ITEMBIT_VAR + |
jmitc91516 | 0:9140ec6aa604 | 3051 | GuiLib_ITEMBIT_VARBLOCK)) |
jmitc91516 | 0:9140ec6aa604 | 3052 | { |
jmitc91516 | 0:9140ec6aa604 | 3053 | if (sgl.CommonByte5 & 0x01) |
jmitc91516 | 0:9140ec6aa604 | 3054 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_BLINKTEXTFIELD; |
jmitc91516 | 0:9140ec6aa604 | 3055 | else |
jmitc91516 | 0:9140ec6aa604 | 3056 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BLINKTEXTFIELD; |
jmitc91516 | 0:9140ec6aa604 | 3057 | } |
jmitc91516 | 0:9140ec6aa604 | 3058 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3059 | |
jmitc91516 | 0:9140ec6aa604 | 3060 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 3061 | GuiLib_ITEMBIT_TEXTBLOCK)) || |
jmitc91516 | 0:9140ec6aa604 | 3062 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_BUTTON))) |
jmitc91516 | 0:9140ec6aa604 | 3063 | sgl.CurItem.TextCnt = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3064 | else |
jmitc91516 | 0:9140ec6aa604 | 3065 | sgl.CurItem.TextCnt = 1; |
jmitc91516 | 0:9140ec6aa604 | 3066 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 3067 | GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 3068 | GuiLib_ITEMBIT_STRUCTURE + |
jmitc91516 | 0:9140ec6aa604 | 3069 | GuiLib_ITEMBIT_STRUCTARRAY + |
jmitc91516 | 0:9140ec6aa604 | 3070 | GuiLib_ITEMBIT_VAR + |
jmitc91516 | 0:9140ec6aa604 | 3071 | GuiLib_ITEMBIT_VARBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 3072 | GuiLib_ITEMBIT_SCROLLBOX + |
jmitc91516 | 0:9140ec6aa604 | 3073 | GuiLib_ITEMBIT_GRAPH)) || |
jmitc91516 | 0:9140ec6aa604 | 3074 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_BUTTON + |
jmitc91516 | 0:9140ec6aa604 | 3075 | GuiLib_ITEMBIT_EDITBOX + |
jmitc91516 | 0:9140ec6aa604 | 3076 | GuiLib_ITEMBIT_LISTBOX + |
jmitc91516 | 0:9140ec6aa604 | 3077 | GuiLib_ITEMBIT_COMBOBOX + |
jmitc91516 | 0:9140ec6aa604 | 3078 | GuiLib_ITEMBIT_PROGRESSBAR + |
jmitc91516 | 0:9140ec6aa604 | 3079 | GuiLib_ITEMBIT_STRUCTCOND))) |
jmitc91516 | 0:9140ec6aa604 | 3080 | { |
jmitc91516 | 0:9140ec6aa604 | 3081 | if (sgl.CurItem.ItemType == GuiLib_ITEM_BUTTON) |
jmitc91516 | 0:9140ec6aa604 | 3082 | J = 3; |
jmitc91516 | 0:9140ec6aa604 | 3083 | else |
jmitc91516 | 0:9140ec6aa604 | 3084 | J = 1; |
jmitc91516 | 0:9140ec6aa604 | 3085 | for (I = 0; I < J; I++) |
jmitc91516 | 0:9140ec6aa604 | 3086 | { |
jmitc91516 | 0:9140ec6aa604 | 3087 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3088 | if (B1 != 0xFF) |
jmitc91516 | 0:9140ec6aa604 | 3089 | sgl.CurItem.TextPar[I].FontIndex = B1 + 1; |
jmitc91516 | 0:9140ec6aa604 | 3090 | } |
jmitc91516 | 0:9140ec6aa604 | 3091 | } |
jmitc91516 | 0:9140ec6aa604 | 3092 | |
jmitc91516 | 0:9140ec6aa604 | 3093 | if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 3094 | GuiLib_ITEMBIT_VARBLOCK)) |
jmitc91516 | 0:9140ec6aa604 | 3095 | { |
jmitc91516 | 0:9140ec6aa604 | 3096 | #ifdef GuiConst_TEXTBOX_FIELDS_ON |
jmitc91516 | 0:9140ec6aa604 | 3097 | sgl.CurItem.CompPars.CompTextBox.ScrollPos = 0; |
jmitc91516 | 0:9140ec6aa604 | 3098 | sgl.CurItem.CompPars.CompTextBox.ScrollIndex = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3099 | #else |
jmitc91516 | 0:9140ec6aa604 | 3100 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3101 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3102 | } |
jmitc91516 | 0:9140ec6aa604 | 3103 | |
jmitc91516 | 0:9140ec6aa604 | 3104 | sgl.CurItem.UpdateType = GuiLib_AUTOREDRAW_MODE; |
jmitc91516 | 0:9140ec6aa604 | 3105 | |
jmitc91516 | 0:9140ec6aa604 | 3106 | if (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_CHECKBOX + |
jmitc91516 | 0:9140ec6aa604 | 3107 | GuiLib_ITEMBIT_RADIOBUTTON + |
jmitc91516 | 0:9140ec6aa604 | 3108 | GuiLib_ITEMBIT_BUTTON + |
jmitc91516 | 0:9140ec6aa604 | 3109 | GuiLib_ITEMBIT_EDITBOX + |
jmitc91516 | 0:9140ec6aa604 | 3110 | GuiLib_ITEMBIT_LISTBOX + |
jmitc91516 | 0:9140ec6aa604 | 3111 | GuiLib_ITEMBIT_COMBOBOX + |
jmitc91516 | 0:9140ec6aa604 | 3112 | GuiLib_ITEMBIT_PROGRESSBAR)) |
jmitc91516 | 0:9140ec6aa604 | 3113 | { |
jmitc91516 | 0:9140ec6aa604 | 3114 | PtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3115 | if (PtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3116 | PtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3117 | |
jmitc91516 | 0:9140ec6aa604 | 3118 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_AUTOREDRAWFIELD; |
jmitc91516 | 0:9140ec6aa604 | 3119 | sgl.CurItem.UpdateType = GuiLib_UPDATE_ON_CHANGE; |
jmitc91516 | 0:9140ec6aa604 | 3120 | sgl.CurItem.VarPtr = (void PrefixLocate *)ReadWord(GuiStruct_VarPtrList[PtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3121 | sgl.CurItem.VarType = ReadByte(GuiStruct_VarTypeList[PtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3122 | } |
jmitc91516 | 0:9140ec6aa604 | 3123 | |
jmitc91516 | 0:9140ec6aa604 | 3124 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_STRUCTARRAY + |
jmitc91516 | 0:9140ec6aa604 | 3125 | GuiLib_ITEMBIT_VAR + |
jmitc91516 | 0:9140ec6aa604 | 3126 | GuiLib_ITEMBIT_VARBLOCK)) || |
jmitc91516 | 0:9140ec6aa604 | 3127 | (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_STRUCTCOND)) |
jmitc91516 | 0:9140ec6aa604 | 3128 | { |
jmitc91516 | 0:9140ec6aa604 | 3129 | PtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3130 | if (PtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3131 | PtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3132 | |
jmitc91516 | 0:9140ec6aa604 | 3133 | sgl.CurItem.UpdateType = GuiLib_AUTOREDRAW_MODE; |
jmitc91516 | 0:9140ec6aa604 | 3134 | sgl.CurItem.VarPtr = (void PrefixLocate *)ReadWord(GuiStruct_VarPtrList[PtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3135 | sgl.CurItem.VarType = ReadByte(GuiStruct_VarTypeList[PtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3136 | |
jmitc91516 | 0:9140ec6aa604 | 3137 | } |
jmitc91516 | 0:9140ec6aa604 | 3138 | |
jmitc91516 | 0:9140ec6aa604 | 3139 | #ifdef GuiConst_AUTOREDRAW_ON_CHANGE |
jmitc91516 | 0:9140ec6aa604 | 3140 | if ((sgl.CommonByte4 & 0x20) && |
jmitc91516 | 0:9140ec6aa604 | 3141 | ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 3142 | GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 3143 | GuiLib_ITEMBIT_DOT + |
jmitc91516 | 0:9140ec6aa604 | 3144 | GuiLib_ITEMBIT_LINE + |
jmitc91516 | 0:9140ec6aa604 | 3145 | GuiLib_ITEMBIT_FRAME + |
jmitc91516 | 0:9140ec6aa604 | 3146 | GuiLib_ITEMBIT_BLOCK + |
jmitc91516 | 0:9140ec6aa604 | 3147 | GuiLib_ITEMBIT_CIRCLE + |
jmitc91516 | 0:9140ec6aa604 | 3148 | GuiLib_ITEMBIT_ELLIPSE + |
jmitc91516 | 0:9140ec6aa604 | 3149 | GuiLib_ITEMBIT_BITMAP + |
jmitc91516 | 0:9140ec6aa604 | 3150 | GuiLib_ITEMBIT_BACKGROUND + |
jmitc91516 | 0:9140ec6aa604 | 3151 | GuiLib_ITEMBIT_STRUCTURE)) || |
jmitc91516 | 0:9140ec6aa604 | 3152 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_ROUNDEDFRAME + |
jmitc91516 | 0:9140ec6aa604 | 3153 | GuiLib_ITEMBIT_ROUNDEDBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 3154 | GuiLib_ITEMBIT_QUARTERCIRCLE + |
jmitc91516 | 0:9140ec6aa604 | 3155 | GuiLib_ITEMBIT_QUARTERELLIPSE)))) |
jmitc91516 | 0:9140ec6aa604 | 3156 | { |
jmitc91516 | 0:9140ec6aa604 | 3157 | PtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3158 | if (PtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3159 | PtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3160 | |
jmitc91516 | 0:9140ec6aa604 | 3161 | sgl.CurItem.UpdateType = GuiLib_AUTOREDRAW_MODE; |
jmitc91516 | 0:9140ec6aa604 | 3162 | sgl.CurItem.VarPtr = (void PrefixLocate *)ReadWord(GuiStruct_VarPtrList[PtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3163 | sgl.CurItem.VarType = ReadByte(GuiStruct_VarTypeList[PtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3164 | } |
jmitc91516 | 0:9140ec6aa604 | 3165 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3166 | |
jmitc91516 | 0:9140ec6aa604 | 3167 | if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_FRAME + |
jmitc91516 | 0:9140ec6aa604 | 3168 | GuiLib_ITEMBIT_CIRCLE + |
jmitc91516 | 0:9140ec6aa604 | 3169 | GuiLib_ITEMBIT_ELLIPSE)) |
jmitc91516 | 0:9140ec6aa604 | 3170 | { |
jmitc91516 | 0:9140ec6aa604 | 3171 | sgl.CurItem.FrameThickness = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3172 | } |
jmitc91516 | 0:9140ec6aa604 | 3173 | |
jmitc91516 | 0:9140ec6aa604 | 3174 | if (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_QUARTERCIRCLE + |
jmitc91516 | 0:9140ec6aa604 | 3175 | GuiLib_ITEMBIT_QUARTERELLIPSE)) |
jmitc91516 | 0:9140ec6aa604 | 3176 | { |
jmitc91516 | 0:9140ec6aa604 | 3177 | sgl.CurItem.FrameThickness = GetItemByte(&sgl.ItemDataPtr) % 4; |
jmitc91516 | 0:9140ec6aa604 | 3178 | } |
jmitc91516 | 0:9140ec6aa604 | 3179 | |
jmitc91516 | 0:9140ec6aa604 | 3180 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_STRUCTARRAY)) || |
jmitc91516 | 0:9140ec6aa604 | 3181 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_STRUCTCOND))) |
jmitc91516 | 0:9140ec6aa604 | 3182 | sgl.CurItem.CompPars.StructCall.IndexCount = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3183 | |
jmitc91516 | 0:9140ec6aa604 | 3184 | #ifdef GuiConst_ITEM_STRUCTCOND_INUSE |
jmitc91516 | 0:9140ec6aa604 | 3185 | if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_STRUCTCOND) |
jmitc91516 | 0:9140ec6aa604 | 3186 | { |
jmitc91516 | 0:9140ec6aa604 | 3187 | for (CondI = 0; CondI < sgl.CurItem.CompPars.StructCall.IndexCount; CondI++) |
jmitc91516 | 0:9140ec6aa604 | 3188 | { |
jmitc91516 | 0:9140ec6aa604 | 3189 | sgl.CurItem.CompPars.StructCall.IndexFirst[CondI] = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3190 | sgl.CurItem.CompPars.StructCall.IndexLast[CondI] = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3191 | sgl.CurItem.CompPars.StructCall.CallIndex[CondI] = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3192 | } |
jmitc91516 | 0:9140ec6aa604 | 3193 | } |
jmitc91516 | 0:9140ec6aa604 | 3194 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3195 | |
jmitc91516 | 0:9140ec6aa604 | 3196 | if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_ACTIVEAREA + |
jmitc91516 | 0:9140ec6aa604 | 3197 | GuiLib_ITEMBIT_CLIPRECT)) |
jmitc91516 | 0:9140ec6aa604 | 3198 | { |
jmitc91516 | 0:9140ec6aa604 | 3199 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3200 | if (B1 & 0x01) |
jmitc91516 | 0:9140ec6aa604 | 3201 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_CLIPPING; |
jmitc91516 | 0:9140ec6aa604 | 3202 | else |
jmitc91516 | 0:9140ec6aa604 | 3203 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_CLIPPING; |
jmitc91516 | 0:9140ec6aa604 | 3204 | if (B1 & 0x02) |
jmitc91516 | 0:9140ec6aa604 | 3205 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_ACTIVEAREARELCOORD; |
jmitc91516 | 0:9140ec6aa604 | 3206 | else |
jmitc91516 | 0:9140ec6aa604 | 3207 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_ACTIVEAREARELCOORD; |
jmitc91516 | 0:9140ec6aa604 | 3208 | } |
jmitc91516 | 0:9140ec6aa604 | 3209 | |
jmitc91516 | 0:9140ec6aa604 | 3210 | if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_FORMATTER) |
jmitc91516 | 0:9140ec6aa604 | 3211 | { |
jmitc91516 | 0:9140ec6aa604 | 3212 | sgl.CurItem.FormatFormat = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3213 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3214 | if (B1 & 0x01) |
jmitc91516 | 0:9140ec6aa604 | 3215 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FORMATSHOWSIGN; |
jmitc91516 | 0:9140ec6aa604 | 3216 | else |
jmitc91516 | 0:9140ec6aa604 | 3217 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_FORMATSHOWSIGN; |
jmitc91516 | 0:9140ec6aa604 | 3218 | if (B1 & 0x02) |
jmitc91516 | 0:9140ec6aa604 | 3219 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FORMATZEROPADDING; |
jmitc91516 | 0:9140ec6aa604 | 3220 | else |
jmitc91516 | 0:9140ec6aa604 | 3221 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_FORMATZEROPADDING; |
jmitc91516 | 0:9140ec6aa604 | 3222 | sgl.CurItem.FormatAlignment = (B1 >> 2) & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 3223 | if (B1 & 0x10) |
jmitc91516 | 0:9140ec6aa604 | 3224 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FORMATTRAILINGZEROS; |
jmitc91516 | 0:9140ec6aa604 | 3225 | else |
jmitc91516 | 0:9140ec6aa604 | 3226 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_FORMATTRAILINGZEROS; |
jmitc91516 | 0:9140ec6aa604 | 3227 | if (B1 & 0x20) |
jmitc91516 | 0:9140ec6aa604 | 3228 | sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FORMATTHOUSANDSSEP; |
jmitc91516 | 0:9140ec6aa604 | 3229 | else |
jmitc91516 | 0:9140ec6aa604 | 3230 | sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_FORMATTHOUSANDSSEP; |
jmitc91516 | 0:9140ec6aa604 | 3231 | sgl.CurItem.FormatFieldWidth = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3232 | sgl.CurItem.FormatDecimals = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3233 | } |
jmitc91516 | 0:9140ec6aa604 | 3234 | |
jmitc91516 | 0:9140ec6aa604 | 3235 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_STRUCTURE + |
jmitc91516 | 0:9140ec6aa604 | 3236 | GuiLib_ITEMBIT_STRUCTARRAY + |
jmitc91516 | 0:9140ec6aa604 | 3237 | GuiLib_ITEMBIT_BITMAP + |
jmitc91516 | 0:9140ec6aa604 | 3238 | GuiLib_ITEMBIT_BACKGROUND)) || |
jmitc91516 | 0:9140ec6aa604 | 3239 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_STRUCTCOND))) |
jmitc91516 | 0:9140ec6aa604 | 3240 | sgl.CurItem.StructToCallIndex = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3241 | |
jmitc91516 | 0:9140ec6aa604 | 3242 | #ifdef GuiConst_ITEM_TEXTBLOCK_INUSE |
jmitc91516 | 0:9140ec6aa604 | 3243 | if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXTBLOCK + |
jmitc91516 | 0:9140ec6aa604 | 3244 | GuiLib_ITEMBIT_VARBLOCK)) |
jmitc91516 | 0:9140ec6aa604 | 3245 | { |
jmitc91516 | 0:9140ec6aa604 | 3246 | sgl.CurItem.CompPars.CompTextBox.HorzAlignment = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3247 | sgl.CurItem.CompPars.CompTextBox.VertAlignment = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3248 | sgl.CurItem.CompPars.CompTextBox.LineDist = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3249 | sgl.CurItem.CompPars.CompTextBox.LineDistRelToFont = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3250 | } |
jmitc91516 | 0:9140ec6aa604 | 3251 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3252 | |
jmitc91516 | 0:9140ec6aa604 | 3253 | #ifdef GuiConst_ITEM_TOUCHAREA_INUSE |
jmitc91516 | 0:9140ec6aa604 | 3254 | if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_TOUCHAREA) |
jmitc91516 | 0:9140ec6aa604 | 3255 | sgl.CurItem.CompPars.CompTouch.AreaNo = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3256 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3257 | |
jmitc91516 | 0:9140ec6aa604 | 3258 | if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_POSCALLBACK) |
jmitc91516 | 0:9140ec6aa604 | 3259 | sgl.CurItem.PosCallbackNo = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3260 | |
jmitc91516 | 0:9140ec6aa604 | 3261 | #ifdef GuiConst_ITEM_SCROLLBOX_INUSE |
jmitc91516 | 0:9140ec6aa604 | 3262 | if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_SCROLLBOX) |
jmitc91516 | 0:9140ec6aa604 | 3263 | { |
jmitc91516 | 0:9140ec6aa604 | 3264 | ScrollBoxIndex = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3265 | sgl.GlobalScrollBoxIndex = ScrollBoxIndex; |
jmitc91516 | 0:9140ec6aa604 | 3266 | sgl.ScrollBoxesAry[ScrollBoxIndex].InUse = GuiLib_SCROLL_STRUCTURE_READ; |
jmitc91516 | 0:9140ec6aa604 | 3267 | sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxType = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3268 | sgl.ScrollBoxesAry[ScrollBoxIndex].MakeUpStructIndex = |
jmitc91516 | 0:9140ec6aa604 | 3269 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3270 | sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines = |
jmitc91516 | 0:9140ec6aa604 | 3271 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3272 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineVerticalOffset = |
jmitc91516 | 0:9140ec6aa604 | 3273 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3274 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineOffsetX = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3275 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineOffsetY = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3276 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineSizeX = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3277 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineSizeY = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3278 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructIndex = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3279 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructOffsetX = |
jmitc91516 | 0:9140ec6aa604 | 3280 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3281 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructOffsetY = |
jmitc91516 | 0:9140ec6aa604 | 3282 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3283 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3284 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorTransparent = 0; |
jmitc91516 | 0:9140ec6aa604 | 3285 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 3286 | |
jmitc91516 | 0:9140ec6aa604 | 3287 | switch (B1) |
jmitc91516 | 0:9140ec6aa604 | 3288 | { |
jmitc91516 | 0:9140ec6aa604 | 3289 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 3290 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3291 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorIndex = sgl.CurItem.ForeColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 3292 | break; |
jmitc91516 | 0:9140ec6aa604 | 3293 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 3294 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3295 | break; |
jmitc91516 | 0:9140ec6aa604 | 3296 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 3297 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 3298 | break; |
jmitc91516 | 0:9140ec6aa604 | 3299 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 3300 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = (GuiConst_INTCOLOR) |
jmitc91516 | 0:9140ec6aa604 | 3301 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3302 | break; |
jmitc91516 | 0:9140ec6aa604 | 3303 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 3304 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = TmpForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3305 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorIndex = TmpForeColIdx; |
jmitc91516 | 0:9140ec6aa604 | 3306 | break; |
jmitc91516 | 0:9140ec6aa604 | 3307 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 3308 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorTransparent = 1; |
jmitc91516 | 0:9140ec6aa604 | 3309 | break; |
jmitc91516 | 0:9140ec6aa604 | 3310 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 3311 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = |
jmitc91516 | 0:9140ec6aa604 | 3312 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 3313 | break; |
jmitc91516 | 0:9140ec6aa604 | 3314 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 3315 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3316 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3317 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3318 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3319 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 3320 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3321 | else |
jmitc91516 | 0:9140ec6aa604 | 3322 | { |
jmitc91516 | 0:9140ec6aa604 | 3323 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 3324 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorIndex = ColVarPtrIdx; |
jmitc91516 | 0:9140ec6aa604 | 3325 | } |
jmitc91516 | 0:9140ec6aa604 | 3326 | break; |
jmitc91516 | 0:9140ec6aa604 | 3327 | } |
jmitc91516 | 0:9140ec6aa604 | 3328 | sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3329 | sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3330 | sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollMode = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3331 | sgl.ScrollBoxesAry[ScrollBoxIndex].LineMarkerCount = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3332 | for (L = 0; L < sgl.ScrollBoxesAry[ScrollBoxIndex].LineMarkerCount; L++) |
jmitc91516 | 0:9140ec6aa604 | 3333 | { |
jmitc91516 | 0:9140ec6aa604 | 3334 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorIndex[L] = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 3335 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3336 | switch (B1) |
jmitc91516 | 0:9140ec6aa604 | 3337 | { |
jmitc91516 | 0:9140ec6aa604 | 3338 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 3339 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = sgl.CurItem.BackColor; |
jmitc91516 | 0:9140ec6aa604 | 3340 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorIndex[L] = sgl.CurItem.BackColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 3341 | break; |
jmitc91516 | 0:9140ec6aa604 | 3342 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 3343 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3344 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 0; |
jmitc91516 | 0:9140ec6aa604 | 3345 | break; |
jmitc91516 | 0:9140ec6aa604 | 3346 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 3347 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 3348 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 0; |
jmitc91516 | 0:9140ec6aa604 | 3349 | break; |
jmitc91516 | 0:9140ec6aa604 | 3350 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 3351 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = (GuiConst_INTCOLOR) |
jmitc91516 | 0:9140ec6aa604 | 3352 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3353 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 0; |
jmitc91516 | 0:9140ec6aa604 | 3354 | break; |
jmitc91516 | 0:9140ec6aa604 | 3355 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 3356 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = TmpForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3357 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorIndex[L] = TmpForeColIdx; |
jmitc91516 | 0:9140ec6aa604 | 3358 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 0; |
jmitc91516 | 0:9140ec6aa604 | 3359 | break; |
jmitc91516 | 0:9140ec6aa604 | 3360 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 3361 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 1; |
jmitc91516 | 0:9140ec6aa604 | 3362 | break; |
jmitc91516 | 0:9140ec6aa604 | 3363 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 3364 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = |
jmitc91516 | 0:9140ec6aa604 | 3365 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 3366 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 0; |
jmitc91516 | 0:9140ec6aa604 | 3367 | break; |
jmitc91516 | 0:9140ec6aa604 | 3368 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 3369 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3370 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3371 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3372 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3373 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 3374 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3375 | else |
jmitc91516 | 0:9140ec6aa604 | 3376 | { |
jmitc91516 | 0:9140ec6aa604 | 3377 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 3378 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorIndex[L] = ColVarPtrIdx; |
jmitc91516 | 0:9140ec6aa604 | 3379 | } |
jmitc91516 | 0:9140ec6aa604 | 3380 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 0; |
jmitc91516 | 0:9140ec6aa604 | 3381 | break; |
jmitc91516 | 0:9140ec6aa604 | 3382 | } |
jmitc91516 | 0:9140ec6aa604 | 3383 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStructIndex[L] = |
jmitc91516 | 0:9140ec6aa604 | 3384 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3385 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerDrawingOrder[L] = |
jmitc91516 | 0:9140ec6aa604 | 3386 | GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3387 | if (L || (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxType)) |
jmitc91516 | 0:9140ec6aa604 | 3388 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerSize[L] = 0; |
jmitc91516 | 0:9140ec6aa604 | 3389 | else |
jmitc91516 | 0:9140ec6aa604 | 3390 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerSize[L] = 1; |
jmitc91516 | 0:9140ec6aa604 | 3391 | sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[L] = 0; |
jmitc91516 | 0:9140ec6aa604 | 3392 | } |
jmitc91516 | 0:9140ec6aa604 | 3393 | |
jmitc91516 | 0:9140ec6aa604 | 3394 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarType = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3395 | #ifndef GuiConst_SCROLLITEM_BAR_NONE |
jmitc91516 | 0:9140ec6aa604 | 3396 | if (sgl.ScrollBoxesAry[ScrollBoxIndex].BarType != GuiLib_MARKER_NONE) |
jmitc91516 | 0:9140ec6aa604 | 3397 | { |
jmitc91516 | 0:9140ec6aa604 | 3398 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMode = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3399 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarPositionX = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3400 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarPositionY = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3401 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeX = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3402 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeY = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3403 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarStructIndex = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3404 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3405 | switch (B1 & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 3406 | { |
jmitc91516 | 0:9140ec6aa604 | 3407 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 3408 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3409 | break; |
jmitc91516 | 0:9140ec6aa604 | 3410 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 3411 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3412 | break; |
jmitc91516 | 0:9140ec6aa604 | 3413 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 3414 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 3415 | break; |
jmitc91516 | 0:9140ec6aa604 | 3416 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 3417 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = (GuiConst_INTCOLOR) |
jmitc91516 | 0:9140ec6aa604 | 3418 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3419 | break; |
jmitc91516 | 0:9140ec6aa604 | 3420 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 3421 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = TmpBackColor; |
jmitc91516 | 0:9140ec6aa604 | 3422 | break; |
jmitc91516 | 0:9140ec6aa604 | 3423 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 3424 | break; |
jmitc91516 | 0:9140ec6aa604 | 3425 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 3426 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3427 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 3428 | break; |
jmitc91516 | 0:9140ec6aa604 | 3429 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 3430 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3431 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3432 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3433 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3434 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 3435 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3436 | else |
jmitc91516 | 0:9140ec6aa604 | 3437 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 3438 | break; |
jmitc91516 | 0:9140ec6aa604 | 3439 | } |
jmitc91516 | 0:9140ec6aa604 | 3440 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarTransparent = 0; |
jmitc91516 | 0:9140ec6aa604 | 3441 | switch ((B1 & 0x38) >> 3) |
jmitc91516 | 0:9140ec6aa604 | 3442 | { |
jmitc91516 | 0:9140ec6aa604 | 3443 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 3444 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3445 | break; |
jmitc91516 | 0:9140ec6aa604 | 3446 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 3447 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3448 | break; |
jmitc91516 | 0:9140ec6aa604 | 3449 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 3450 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 3451 | break; |
jmitc91516 | 0:9140ec6aa604 | 3452 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 3453 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = (GuiConst_INTCOLOR) |
jmitc91516 | 0:9140ec6aa604 | 3454 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3455 | break; |
jmitc91516 | 0:9140ec6aa604 | 3456 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 3457 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = TmpForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3458 | break; |
jmitc91516 | 0:9140ec6aa604 | 3459 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 3460 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarTransparent = 1; |
jmitc91516 | 0:9140ec6aa604 | 3461 | break; |
jmitc91516 | 0:9140ec6aa604 | 3462 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 3463 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3464 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 3465 | break; |
jmitc91516 | 0:9140ec6aa604 | 3466 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 3467 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3468 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3469 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3470 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3471 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 3472 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3473 | else |
jmitc91516 | 0:9140ec6aa604 | 3474 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 3475 | break; |
jmitc91516 | 0:9140ec6aa604 | 3476 | } |
jmitc91516 | 0:9140ec6aa604 | 3477 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarThickness = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3478 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerLeftOffset = |
jmitc91516 | 0:9140ec6aa604 | 3479 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3480 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerRightOffset = |
jmitc91516 | 0:9140ec6aa604 | 3481 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3482 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerTopOffset = |
jmitc91516 | 0:9140ec6aa604 | 3483 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3484 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBottomOffset = |
jmitc91516 | 0:9140ec6aa604 | 3485 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3486 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarIconPtr = |
jmitc91516 | 0:9140ec6aa604 | 3487 | (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr; |
jmitc91516 | 0:9140ec6aa604 | 3488 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 3489 | sgl.ItemDataPtr++; |
jmitc91516 | 0:9140ec6aa604 | 3490 | #else |
jmitc91516 | 0:9140ec6aa604 | 3491 | sgl.ItemDataPtr += 2; |
jmitc91516 | 0:9140ec6aa604 | 3492 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3493 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerIconFont = |
jmitc91516 | 0:9140ec6aa604 | 3494 | GetItemByte(&sgl.ItemDataPtr) + 1; |
jmitc91516 | 0:9140ec6aa604 | 3495 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerIconOffsetX = |
jmitc91516 | 0:9140ec6aa604 | 3496 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3497 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerIconOffsetY = |
jmitc91516 | 0:9140ec6aa604 | 3498 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3499 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3500 | switch (B1 & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 3501 | { |
jmitc91516 | 0:9140ec6aa604 | 3502 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 3503 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3504 | break; |
jmitc91516 | 0:9140ec6aa604 | 3505 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 3506 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3507 | break; |
jmitc91516 | 0:9140ec6aa604 | 3508 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 3509 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3510 | GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 3511 | break; |
jmitc91516 | 0:9140ec6aa604 | 3512 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 3513 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3514 | (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3515 | break; |
jmitc91516 | 0:9140ec6aa604 | 3516 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 3517 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = TmpBackColor; |
jmitc91516 | 0:9140ec6aa604 | 3518 | break; |
jmitc91516 | 0:9140ec6aa604 | 3519 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 3520 | break; |
jmitc91516 | 0:9140ec6aa604 | 3521 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 3522 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3523 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 3524 | break; |
jmitc91516 | 0:9140ec6aa604 | 3525 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 3526 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3527 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3528 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3529 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3530 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 3531 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3532 | else |
jmitc91516 | 0:9140ec6aa604 | 3533 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 3534 | break; |
jmitc91516 | 0:9140ec6aa604 | 3535 | } |
jmitc91516 | 0:9140ec6aa604 | 3536 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerTransparent = 0; |
jmitc91516 | 0:9140ec6aa604 | 3537 | switch ((B1 & 0x38) >> 3) |
jmitc91516 | 0:9140ec6aa604 | 3538 | { |
jmitc91516 | 0:9140ec6aa604 | 3539 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 3540 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = sgl.CurItem.BackColor; |
jmitc91516 | 0:9140ec6aa604 | 3541 | break; |
jmitc91516 | 0:9140ec6aa604 | 3542 | |
jmitc91516 | 0:9140ec6aa604 | 3543 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 3544 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3545 | break; |
jmitc91516 | 0:9140ec6aa604 | 3546 | |
jmitc91516 | 0:9140ec6aa604 | 3547 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 3548 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3549 | GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 3550 | break; |
jmitc91516 | 0:9140ec6aa604 | 3551 | |
jmitc91516 | 0:9140ec6aa604 | 3552 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 3553 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3554 | (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3555 | break; |
jmitc91516 | 0:9140ec6aa604 | 3556 | |
jmitc91516 | 0:9140ec6aa604 | 3557 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 3558 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = TmpForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3559 | break; |
jmitc91516 | 0:9140ec6aa604 | 3560 | |
jmitc91516 | 0:9140ec6aa604 | 3561 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 3562 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerTransparent = 1; |
jmitc91516 | 0:9140ec6aa604 | 3563 | break; |
jmitc91516 | 0:9140ec6aa604 | 3564 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 3565 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3566 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 3567 | break; |
jmitc91516 | 0:9140ec6aa604 | 3568 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 3569 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3570 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3571 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3572 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3573 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 3574 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3575 | else |
jmitc91516 | 0:9140ec6aa604 | 3576 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 3577 | break; |
jmitc91516 | 0:9140ec6aa604 | 3578 | } |
jmitc91516 | 0:9140ec6aa604 | 3579 | if (sgl.ScrollBoxesAry[ScrollBoxIndex].BarType == GuiLib_MARKER_BITMAP) |
jmitc91516 | 0:9140ec6aa604 | 3580 | { |
jmitc91516 | 0:9140ec6aa604 | 3581 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIndex = |
jmitc91516 | 0:9140ec6aa604 | 3582 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3583 | #ifdef GuiConst_REMOTE_BITMAP_DATA |
jmitc91516 | 0:9140ec6aa604 | 3584 | GuiLib_RemoteDataReadBlock( |
jmitc91516 | 0:9140ec6aa604 | 3585 | (GuiConst_INT32U PrefixRom)GuiStruct_BitmapPtrList[ |
jmitc91516 | 0:9140ec6aa604 | 3586 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIndex], 4, |
jmitc91516 | 0:9140ec6aa604 | 3587 | BitmapHeader); |
jmitc91516 | 0:9140ec6aa604 | 3588 | PixelDataPtr = &BitmapHeader[0] + 2; |
jmitc91516 | 0:9140ec6aa604 | 3589 | #else |
jmitc91516 | 0:9140ec6aa604 | 3590 | PixelDataPtr = (GuiConst_INT8U PrefixRom *)ReadWord(GuiStruct_BitmapPtrList[ |
jmitc91516 | 0:9140ec6aa604 | 3591 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIndex]) + 2; |
jmitc91516 | 0:9140ec6aa604 | 3592 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3593 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapHeight = |
jmitc91516 | 0:9140ec6aa604 | 3594 | (GuiConst_INT16S)*PixelDataPtr; |
jmitc91516 | 0:9140ec6aa604 | 3595 | PixelDataPtr++; |
jmitc91516 | 0:9140ec6aa604 | 3596 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapHeight += |
jmitc91516 | 0:9140ec6aa604 | 3597 | 256*(GuiConst_INT16S)*PixelDataPtr; |
jmitc91516 | 0:9140ec6aa604 | 3598 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3599 | #ifdef GuiConst_BITMAP_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 3600 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIsTransparent = |
jmitc91516 | 0:9140ec6aa604 | 3601 | (B1 & 0x01); |
jmitc91516 | 0:9140ec6aa604 | 3602 | if (sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIsTransparent) |
jmitc91516 | 0:9140ec6aa604 | 3603 | #ifdef GuiConst_COLOR_DEPTH_1 |
jmitc91516 | 0:9140ec6aa604 | 3604 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapTranspColor = |
jmitc91516 | 0:9140ec6aa604 | 3605 | (B1 >> 1) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 3606 | #else |
jmitc91516 | 0:9140ec6aa604 | 3607 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapTranspColor = |
jmitc91516 | 0:9140ec6aa604 | 3608 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3609 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3610 | #else |
jmitc91516 | 0:9140ec6aa604 | 3611 | sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIsTransparent = 0; |
jmitc91516 | 0:9140ec6aa604 | 3612 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3613 | } |
jmitc91516 | 0:9140ec6aa604 | 3614 | } |
jmitc91516 | 0:9140ec6aa604 | 3615 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3616 | |
jmitc91516 | 0:9140ec6aa604 | 3617 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorType = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3618 | #ifndef GuiConst_SCROLLITEM_INDICATOR_NONE |
jmitc91516 | 0:9140ec6aa604 | 3619 | if (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorType != GuiLib_INDICATOR_NONE) |
jmitc91516 | 0:9140ec6aa604 | 3620 | { |
jmitc91516 | 0:9140ec6aa604 | 3621 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMode = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3622 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorPositionX = |
jmitc91516 | 0:9140ec6aa604 | 3623 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3624 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorPositionY = |
jmitc91516 | 0:9140ec6aa604 | 3625 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3626 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorSizeX = |
jmitc91516 | 0:9140ec6aa604 | 3627 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3628 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorSizeY = |
jmitc91516 | 0:9140ec6aa604 | 3629 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3630 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorStructIndex = |
jmitc91516 | 0:9140ec6aa604 | 3631 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3632 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3633 | switch (B1 & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 3634 | { |
jmitc91516 | 0:9140ec6aa604 | 3635 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 3636 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3637 | break; |
jmitc91516 | 0:9140ec6aa604 | 3638 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 3639 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3640 | break; |
jmitc91516 | 0:9140ec6aa604 | 3641 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 3642 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3643 | GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 3644 | break; |
jmitc91516 | 0:9140ec6aa604 | 3645 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 3646 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3647 | (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3648 | break; |
jmitc91516 | 0:9140ec6aa604 | 3649 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 3650 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = TmpBackColor; |
jmitc91516 | 0:9140ec6aa604 | 3651 | break; |
jmitc91516 | 0:9140ec6aa604 | 3652 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 3653 | break; |
jmitc91516 | 0:9140ec6aa604 | 3654 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 3655 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3656 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 3657 | break; |
jmitc91516 | 0:9140ec6aa604 | 3658 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 3659 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3660 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3661 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3662 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3663 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 3664 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3665 | else |
jmitc91516 | 0:9140ec6aa604 | 3666 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 3667 | break; |
jmitc91516 | 0:9140ec6aa604 | 3668 | } |
jmitc91516 | 0:9140ec6aa604 | 3669 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorTransparent = 0; |
jmitc91516 | 0:9140ec6aa604 | 3670 | switch ((B1 & 0x38) >> 3) |
jmitc91516 | 0:9140ec6aa604 | 3671 | { |
jmitc91516 | 0:9140ec6aa604 | 3672 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 3673 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = sgl.CurItem.BackColor; |
jmitc91516 | 0:9140ec6aa604 | 3674 | break; |
jmitc91516 | 0:9140ec6aa604 | 3675 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 3676 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3677 | break; |
jmitc91516 | 0:9140ec6aa604 | 3678 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 3679 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3680 | GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 3681 | break; |
jmitc91516 | 0:9140ec6aa604 | 3682 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 3683 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3684 | (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3685 | break; |
jmitc91516 | 0:9140ec6aa604 | 3686 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 3687 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = TmpForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3688 | break; |
jmitc91516 | 0:9140ec6aa604 | 3689 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 3690 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorTransparent = 1; |
jmitc91516 | 0:9140ec6aa604 | 3691 | break; |
jmitc91516 | 0:9140ec6aa604 | 3692 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 3693 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3694 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 3695 | break; |
jmitc91516 | 0:9140ec6aa604 | 3696 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 3697 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3698 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3699 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3700 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3701 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 3702 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3703 | else |
jmitc91516 | 0:9140ec6aa604 | 3704 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 3705 | break; |
jmitc91516 | 0:9140ec6aa604 | 3706 | } |
jmitc91516 | 0:9140ec6aa604 | 3707 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorThickness = |
jmitc91516 | 0:9140ec6aa604 | 3708 | GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3709 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerLeftOffset = |
jmitc91516 | 0:9140ec6aa604 | 3710 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3711 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerRightOffset = |
jmitc91516 | 0:9140ec6aa604 | 3712 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3713 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerTopOffset = |
jmitc91516 | 0:9140ec6aa604 | 3714 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3715 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBottomOffset = |
jmitc91516 | 0:9140ec6aa604 | 3716 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3717 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorIconPtr = |
jmitc91516 | 0:9140ec6aa604 | 3718 | (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr; |
jmitc91516 | 0:9140ec6aa604 | 3719 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 3720 | sgl.ItemDataPtr++; |
jmitc91516 | 0:9140ec6aa604 | 3721 | #else |
jmitc91516 | 0:9140ec6aa604 | 3722 | sgl.ItemDataPtr += 2; |
jmitc91516 | 0:9140ec6aa604 | 3723 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3724 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerIconFont = |
jmitc91516 | 0:9140ec6aa604 | 3725 | GetItemByte(&sgl.ItemDataPtr) + 1; |
jmitc91516 | 0:9140ec6aa604 | 3726 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerIconOffsetX = |
jmitc91516 | 0:9140ec6aa604 | 3727 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3728 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerIconOffsetY = |
jmitc91516 | 0:9140ec6aa604 | 3729 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3730 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3731 | switch (B1 & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 3732 | { |
jmitc91516 | 0:9140ec6aa604 | 3733 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 3734 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3735 | sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3736 | break; |
jmitc91516 | 0:9140ec6aa604 | 3737 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 3738 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3739 | GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3740 | break; |
jmitc91516 | 0:9140ec6aa604 | 3741 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 3742 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3743 | GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 3744 | break; |
jmitc91516 | 0:9140ec6aa604 | 3745 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 3746 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3747 | (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3748 | break; |
jmitc91516 | 0:9140ec6aa604 | 3749 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 3750 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3751 | TmpBackColor; |
jmitc91516 | 0:9140ec6aa604 | 3752 | break; |
jmitc91516 | 0:9140ec6aa604 | 3753 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 3754 | break; |
jmitc91516 | 0:9140ec6aa604 | 3755 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 3756 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3757 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 3758 | break; |
jmitc91516 | 0:9140ec6aa604 | 3759 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 3760 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3761 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3762 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3763 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3764 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 3765 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3766 | else |
jmitc91516 | 0:9140ec6aa604 | 3767 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 3768 | break; |
jmitc91516 | 0:9140ec6aa604 | 3769 | } |
jmitc91516 | 0:9140ec6aa604 | 3770 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerTransparent = 0; |
jmitc91516 | 0:9140ec6aa604 | 3771 | switch ((B1 & 0x38) >> 3) |
jmitc91516 | 0:9140ec6aa604 | 3772 | { |
jmitc91516 | 0:9140ec6aa604 | 3773 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 3774 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3775 | sgl.CurItem.BackColor; |
jmitc91516 | 0:9140ec6aa604 | 3776 | break; |
jmitc91516 | 0:9140ec6aa604 | 3777 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 3778 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3779 | GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3780 | break; |
jmitc91516 | 0:9140ec6aa604 | 3781 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 3782 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3783 | GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 3784 | break; |
jmitc91516 | 0:9140ec6aa604 | 3785 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 3786 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3787 | (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3788 | break; |
jmitc91516 | 0:9140ec6aa604 | 3789 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 3790 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3791 | TmpForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3792 | break; |
jmitc91516 | 0:9140ec6aa604 | 3793 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 3794 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerTransparent = 1; |
jmitc91516 | 0:9140ec6aa604 | 3795 | break; |
jmitc91516 | 0:9140ec6aa604 | 3796 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 3797 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor = |
jmitc91516 | 0:9140ec6aa604 | 3798 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 3799 | break; |
jmitc91516 | 0:9140ec6aa604 | 3800 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 3801 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3802 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3803 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3804 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3805 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 3806 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3807 | else |
jmitc91516 | 0:9140ec6aa604 | 3808 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 3809 | break; |
jmitc91516 | 0:9140ec6aa604 | 3810 | } |
jmitc91516 | 0:9140ec6aa604 | 3811 | if (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorType == GuiLib_MARKER_BITMAP) |
jmitc91516 | 0:9140ec6aa604 | 3812 | { |
jmitc91516 | 0:9140ec6aa604 | 3813 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapIndex = |
jmitc91516 | 0:9140ec6aa604 | 3814 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3815 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3816 | #ifdef GuiConst_BITMAP_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 3817 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapIsTransparent = |
jmitc91516 | 0:9140ec6aa604 | 3818 | (B1 & 0x01); |
jmitc91516 | 0:9140ec6aa604 | 3819 | if (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapIsTransparent) |
jmitc91516 | 0:9140ec6aa604 | 3820 | #ifdef GuiConst_COLOR_DEPTH_1 |
jmitc91516 | 0:9140ec6aa604 | 3821 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapTranspColor = |
jmitc91516 | 0:9140ec6aa604 | 3822 | (B1 >> 1) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 3823 | #else |
jmitc91516 | 0:9140ec6aa604 | 3824 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapTranspColor = |
jmitc91516 | 0:9140ec6aa604 | 3825 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3826 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3827 | #else |
jmitc91516 | 0:9140ec6aa604 | 3828 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapIsTransparent = 0; |
jmitc91516 | 0:9140ec6aa604 | 3829 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3830 | } |
jmitc91516 | 0:9140ec6aa604 | 3831 | sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorLine = -1; |
jmitc91516 | 0:9140ec6aa604 | 3832 | } |
jmitc91516 | 0:9140ec6aa604 | 3833 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3834 | } |
jmitc91516 | 0:9140ec6aa604 | 3835 | #endif |
jmitc91516 | 0:9140ec6aa604 | 3836 | |
jmitc91516 | 0:9140ec6aa604 | 3837 | #ifdef GuiConst_ITEM_GRAPH_INUSE |
jmitc91516 | 0:9140ec6aa604 | 3838 | if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_GRAPH) |
jmitc91516 | 0:9140ec6aa604 | 3839 | { |
jmitc91516 | 0:9140ec6aa604 | 3840 | GraphIndex = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3841 | sgl.GlobalGraphIndex = GraphIndex; |
jmitc91516 | 0:9140ec6aa604 | 3842 | |
jmitc91516 | 0:9140ec6aa604 | 3843 | sgl.GraphAry[GraphIndex].InUse = GuiLib_GRAPH_STRUCTURE_USED; |
jmitc91516 | 0:9140ec6aa604 | 3844 | sgl.GraphAry[GraphIndex].OriginOffsetX = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3845 | sgl.GraphAry[GraphIndex].OriginOffsetY = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3846 | sgl.GraphAry[GraphIndex].ForeColor = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3847 | sgl.GraphAry[GraphIndex].BackColor = sgl.CurItem.BackColor; |
jmitc91516 | 0:9140ec6aa604 | 3848 | |
jmitc91516 | 0:9140ec6aa604 | 3849 | for (Axis = GuiLib_GRAPHAXIS_X; Axis <= GuiLib_GRAPHAXIS_Y; Axis++) |
jmitc91516 | 0:9140ec6aa604 | 3850 | { |
jmitc91516 | 0:9140ec6aa604 | 3851 | sgl.GraphAry[GraphIndex].GraphAxesCnt[Axis] = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3852 | for (L = 0; L < sgl.GraphAry[GraphIndex].GraphAxesCnt[Axis]; L++) |
jmitc91516 | 0:9140ec6aa604 | 3853 | { |
jmitc91516 | 0:9140ec6aa604 | 3854 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags = 0; |
jmitc91516 | 0:9140ec6aa604 | 3855 | B = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3856 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].Visible = 1; |
jmitc91516 | 0:9140ec6aa604 | 3857 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].Line = B & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 3858 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].LineBetweenAxes = (B >> 7) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 3859 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].LineNegative = (B >> 1) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 3860 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].Arrow = (B >> 2) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 3861 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].TicksMajor = (B >> 3) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 3862 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].TicksMinor = (B >> 4) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 3863 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].Numbers = (B >> 5) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 3864 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersAtOrigo = (B >> 6) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 3865 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].Offset = |
jmitc91516 | 0:9140ec6aa604 | 3866 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3867 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].ArrowLength = |
jmitc91516 | 0:9140ec6aa604 | 3868 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3869 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].ArrowWidth = |
jmitc91516 | 0:9140ec6aa604 | 3870 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3871 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].TicksMajorLength = |
jmitc91516 | 0:9140ec6aa604 | 3872 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3873 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].TicksMajorWidth = |
jmitc91516 | 0:9140ec6aa604 | 3874 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3875 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].TicksMinorLength = |
jmitc91516 | 0:9140ec6aa604 | 3876 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3877 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].TicksMinorWidth = |
jmitc91516 | 0:9140ec6aa604 | 3878 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3879 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersMinValue = |
jmitc91516 | 0:9140ec6aa604 | 3880 | GetItemLong(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3881 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersMinValueOrg = |
jmitc91516 | 0:9140ec6aa604 | 3882 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersMinValue; |
jmitc91516 | 0:9140ec6aa604 | 3883 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersMaxValue = |
jmitc91516 | 0:9140ec6aa604 | 3884 | GetItemLong(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3885 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersMaxValueOrg = |
jmitc91516 | 0:9140ec6aa604 | 3886 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersMaxValue; |
jmitc91516 | 0:9140ec6aa604 | 3887 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersStepMajor = |
jmitc91516 | 0:9140ec6aa604 | 3888 | GetItemLong(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3889 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersStepMinor = |
jmitc91516 | 0:9140ec6aa604 | 3890 | GetItemLong(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3891 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersOffset = |
jmitc91516 | 0:9140ec6aa604 | 3892 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3893 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersAtEnd = |
jmitc91516 | 0:9140ec6aa604 | 3894 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3895 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].FormatFieldWidth = |
jmitc91516 | 0:9140ec6aa604 | 3896 | GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3897 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].FormatDecimals = |
jmitc91516 | 0:9140ec6aa604 | 3898 | GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3899 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].FormatAlignment = |
jmitc91516 | 0:9140ec6aa604 | 3900 | GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3901 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].FormatFormat = |
jmitc91516 | 0:9140ec6aa604 | 3902 | GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3903 | B = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3904 | if (B & 0x01) |
jmitc91516 | 0:9140ec6aa604 | 3905 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags |= GuiLib_BITFLAG_FORMATSHOWSIGN; |
jmitc91516 | 0:9140ec6aa604 | 3906 | else |
jmitc91516 | 0:9140ec6aa604 | 3907 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags &= ~GuiLib_BITFLAG_FORMATSHOWSIGN; |
jmitc91516 | 0:9140ec6aa604 | 3908 | if (B & 0x02) |
jmitc91516 | 0:9140ec6aa604 | 3909 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags |= GuiLib_BITFLAG_FORMATZEROPADDING; |
jmitc91516 | 0:9140ec6aa604 | 3910 | else |
jmitc91516 | 0:9140ec6aa604 | 3911 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags &= ~GuiLib_BITFLAG_FORMATZEROPADDING; |
jmitc91516 | 0:9140ec6aa604 | 3912 | if (B & 0x04) |
jmitc91516 | 0:9140ec6aa604 | 3913 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags |= GuiLib_BITFLAG_FORMATTRAILINGZEROS; |
jmitc91516 | 0:9140ec6aa604 | 3914 | else |
jmitc91516 | 0:9140ec6aa604 | 3915 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags &= ~GuiLib_BITFLAG_FORMATTRAILINGZEROS; |
jmitc91516 | 0:9140ec6aa604 | 3916 | if (B & 0x08) |
jmitc91516 | 0:9140ec6aa604 | 3917 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags |= GuiLib_BITFLAG_FORMATTHOUSANDSSEP; |
jmitc91516 | 0:9140ec6aa604 | 3918 | else |
jmitc91516 | 0:9140ec6aa604 | 3919 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags &= ~GuiLib_BITFLAG_FORMATTHOUSANDSSEP; |
jmitc91516 | 0:9140ec6aa604 | 3920 | sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].Scale = 10000; |
jmitc91516 | 0:9140ec6aa604 | 3921 | } |
jmitc91516 | 0:9140ec6aa604 | 3922 | } |
jmitc91516 | 0:9140ec6aa604 | 3923 | |
jmitc91516 | 0:9140ec6aa604 | 3924 | sgl.GraphAry[GraphIndex].GraphDataSetCnt = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3925 | for (L = 0; L < sgl.GraphAry[GraphIndex].GraphDataSetCnt; L++) |
jmitc91516 | 0:9140ec6aa604 | 3926 | { |
jmitc91516 | 0:9140ec6aa604 | 3927 | sgl.GraphAry[GraphIndex].GraphDataSets[L].DataSize = 0; |
jmitc91516 | 0:9140ec6aa604 | 3928 | sgl.GraphAry[GraphIndex].GraphDataSets[L].DataFirst = 0; |
jmitc91516 | 0:9140ec6aa604 | 3929 | sgl.GraphAry[GraphIndex].GraphDataSets[L].DataCount = 0; |
jmitc91516 | 0:9140ec6aa604 | 3930 | sgl.GraphAry[GraphIndex].GraphDataSets[L].AxisIndexX = 0; |
jmitc91516 | 0:9140ec6aa604 | 3931 | sgl.GraphAry[GraphIndex].GraphDataSets[L].AxisIndexY = 0; |
jmitc91516 | 0:9140ec6aa604 | 3932 | sgl.GraphAry[GraphIndex].GraphDataSets[L].Visible = 1; |
jmitc91516 | 0:9140ec6aa604 | 3933 | sgl.GraphAry[GraphIndex].GraphDataSets[L].Representation = |
jmitc91516 | 0:9140ec6aa604 | 3934 | GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3935 | sgl.GraphAry[GraphIndex].GraphDataSets[L].Width = |
jmitc91516 | 0:9140ec6aa604 | 3936 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3937 | sgl.GraphAry[GraphIndex].GraphDataSets[L].Thickness = |
jmitc91516 | 0:9140ec6aa604 | 3938 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3939 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3940 | switch (B1 & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 3941 | { |
jmitc91516 | 0:9140ec6aa604 | 3942 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 3943 | sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3944 | break; |
jmitc91516 | 0:9140ec6aa604 | 3945 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 3946 | sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3947 | break; |
jmitc91516 | 0:9140ec6aa604 | 3948 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 3949 | sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 3950 | break; |
jmitc91516 | 0:9140ec6aa604 | 3951 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 3952 | sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = (GuiConst_INTCOLOR) |
jmitc91516 | 0:9140ec6aa604 | 3953 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3954 | break; |
jmitc91516 | 0:9140ec6aa604 | 3955 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 3956 | sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = TmpBackColor; |
jmitc91516 | 0:9140ec6aa604 | 3957 | break; |
jmitc91516 | 0:9140ec6aa604 | 3958 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 3959 | break; |
jmitc91516 | 0:9140ec6aa604 | 3960 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 3961 | sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = |
jmitc91516 | 0:9140ec6aa604 | 3962 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 3963 | break; |
jmitc91516 | 0:9140ec6aa604 | 3964 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 3965 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3966 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 3967 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 3968 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 3969 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 3970 | sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3971 | else |
jmitc91516 | 0:9140ec6aa604 | 3972 | sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 3973 | break; |
jmitc91516 | 0:9140ec6aa604 | 3974 | } |
jmitc91516 | 0:9140ec6aa604 | 3975 | sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColorTransparent = 0; |
jmitc91516 | 0:9140ec6aa604 | 3976 | switch ((B1 & 0x38) >> 3) |
jmitc91516 | 0:9140ec6aa604 | 3977 | { |
jmitc91516 | 0:9140ec6aa604 | 3978 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 3979 | sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = sgl.CurItem.BackColor; |
jmitc91516 | 0:9140ec6aa604 | 3980 | break; |
jmitc91516 | 0:9140ec6aa604 | 3981 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 3982 | sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 3983 | break; |
jmitc91516 | 0:9140ec6aa604 | 3984 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 3985 | sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 3986 | break; |
jmitc91516 | 0:9140ec6aa604 | 3987 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 3988 | sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = (GuiConst_INTCOLOR) |
jmitc91516 | 0:9140ec6aa604 | 3989 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 3990 | break; |
jmitc91516 | 0:9140ec6aa604 | 3991 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 3992 | sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = TmpForeColor; |
jmitc91516 | 0:9140ec6aa604 | 3993 | break; |
jmitc91516 | 0:9140ec6aa604 | 3994 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 3995 | sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColorTransparent = 1; |
jmitc91516 | 0:9140ec6aa604 | 3996 | break; |
jmitc91516 | 0:9140ec6aa604 | 3997 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 3998 | sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = |
jmitc91516 | 0:9140ec6aa604 | 3999 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 4000 | break; |
jmitc91516 | 0:9140ec6aa604 | 4001 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 4002 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4003 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 4004 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 4005 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 4006 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 4007 | sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 4008 | else |
jmitc91516 | 0:9140ec6aa604 | 4009 | sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 4010 | break; |
jmitc91516 | 0:9140ec6aa604 | 4011 | } |
jmitc91516 | 0:9140ec6aa604 | 4012 | } |
jmitc91516 | 0:9140ec6aa604 | 4013 | } |
jmitc91516 | 0:9140ec6aa604 | 4014 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4015 | |
jmitc91516 | 0:9140ec6aa604 | 4016 | #ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE |
jmitc91516 | 0:9140ec6aa604 | 4017 | if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_GRAPHICSLAYER) |
jmitc91516 | 0:9140ec6aa604 | 4018 | { |
jmitc91516 | 0:9140ec6aa604 | 4019 | GraphicsLayerIndex = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4020 | sgl.GlobalGraphicsLayerIndex = GraphicsLayerIndex; |
jmitc91516 | 0:9140ec6aa604 | 4021 | |
jmitc91516 | 0:9140ec6aa604 | 4022 | sgl.GraphicsLayerList[GraphicsLayerIndex].InUse = GuiLib_GRAPHICS_LAYER_USED; |
jmitc91516 | 0:9140ec6aa604 | 4023 | sgl.GraphicsLayerList[GraphicsLayerIndex].SizeMode = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4024 | sgl.GraphicsLayerList[GraphicsLayerIndex].InitMode = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4025 | } |
jmitc91516 | 0:9140ec6aa604 | 4026 | |
jmitc91516 | 0:9140ec6aa604 | 4027 | if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_GRAPHICSFILTER) |
jmitc91516 | 0:9140ec6aa604 | 4028 | { |
jmitc91516 | 0:9140ec6aa604 | 4029 | GraphicsFilterIndex = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4030 | sgl.GlobalGraphicsFilterIndex = GraphicsFilterIndex; |
jmitc91516 | 0:9140ec6aa604 | 4031 | |
jmitc91516 | 0:9140ec6aa604 | 4032 | sgl.GraphicsFilterList[GraphicsFilterIndex].InUse = GuiLib_GRAPHICS_FILTER_USED; |
jmitc91516 | 0:9140ec6aa604 | 4033 | sgl.GraphicsFilterList[GraphicsFilterIndex].SourceLayerIndexNo = |
jmitc91516 | 0:9140ec6aa604 | 4034 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4035 | sgl.GraphicsFilterList[GraphicsFilterIndex].DestLayerIndexNo = |
jmitc91516 | 0:9140ec6aa604 | 4036 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4037 | sgl.GraphicsFilterList[GraphicsFilterIndex].ContAtLayerIndexNo = |
jmitc91516 | 0:9140ec6aa604 | 4038 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4039 | for (I = 0; I <= 9; I++) |
jmitc91516 | 0:9140ec6aa604 | 4040 | { |
jmitc91516 | 0:9140ec6aa604 | 4041 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4042 | if (B1 == 0) |
jmitc91516 | 0:9140ec6aa604 | 4043 | { |
jmitc91516 | 0:9140ec6aa604 | 4044 | sgl.GraphicsFilterList[GraphicsFilterIndex].ParVarType[I] = GuiLib_VAR_NONE; |
jmitc91516 | 0:9140ec6aa604 | 4045 | sgl.GraphicsFilterList[GraphicsFilterIndex].ParVarPtr[I] = 0; |
jmitc91516 | 0:9140ec6aa604 | 4046 | sgl.GraphicsFilterList[GraphicsFilterIndex].ParValueNum[I] = |
jmitc91516 | 0:9140ec6aa604 | 4047 | GetItemLong(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4048 | } |
jmitc91516 | 0:9140ec6aa604 | 4049 | else |
jmitc91516 | 0:9140ec6aa604 | 4050 | { |
jmitc91516 | 0:9140ec6aa604 | 4051 | PtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4052 | if (PtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 4053 | PtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 4054 | |
jmitc91516 | 0:9140ec6aa604 | 4055 | sgl.GraphicsFilterList[GraphicsFilterIndex].ParVarType[I] = |
jmitc91516 | 0:9140ec6aa604 | 4056 | ReadByte(GuiStruct_VarTypeList[PtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 4057 | sgl.GraphicsFilterList[GraphicsFilterIndex].ParVarPtr[I] = |
jmitc91516 | 0:9140ec6aa604 | 4058 | (void*)ReadWord(GuiStruct_VarPtrList[PtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 4059 | sgl.GraphicsFilterList[GraphicsFilterIndex].ParValueNum[I] = 0; |
jmitc91516 | 0:9140ec6aa604 | 4060 | } |
jmitc91516 | 0:9140ec6aa604 | 4061 | } |
jmitc91516 | 0:9140ec6aa604 | 4062 | } |
jmitc91516 | 0:9140ec6aa604 | 4063 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4064 | |
jmitc91516 | 0:9140ec6aa604 | 4065 | #ifdef GuiConst_ITEM_CHECKBOX_INUSE |
jmitc91516 | 0:9140ec6aa604 | 4066 | if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_CHECKBOX) |
jmitc91516 | 0:9140ec6aa604 | 4067 | { |
jmitc91516 | 0:9140ec6aa604 | 4068 | sgl.CurItem.CompPars.CompCheckBox.Style = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4069 | sgl.CurItem.CompPars.CompCheckBox.Size = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4070 | switch (sgl.CurItem.CompPars.CompCheckBox.Style) |
jmitc91516 | 0:9140ec6aa604 | 4071 | { |
jmitc91516 | 0:9140ec6aa604 | 4072 | case GuiLib_CHECKBOX_ICON: |
jmitc91516 | 0:9140ec6aa604 | 4073 | sgl.CurItem.CompPars.CompCheckBox.IconPtr = |
jmitc91516 | 0:9140ec6aa604 | 4074 | (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr; |
jmitc91516 | 0:9140ec6aa604 | 4075 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 4076 | sgl.ItemDataPtr++; |
jmitc91516 | 0:9140ec6aa604 | 4077 | #else |
jmitc91516 | 0:9140ec6aa604 | 4078 | sgl.ItemDataPtr += 2; |
jmitc91516 | 0:9140ec6aa604 | 4079 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4080 | sgl.CurItem.CompPars.CompCheckBox.IconFont = GetItemByte(&sgl.ItemDataPtr) + 1; |
jmitc91516 | 0:9140ec6aa604 | 4081 | sgl.CurItem.CompPars.CompCheckBox.IconOffsetX = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4082 | sgl.CurItem.CompPars.CompCheckBox.IconOffsetY = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4083 | break; |
jmitc91516 | 0:9140ec6aa604 | 4084 | case GuiLib_CHECKBOX_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 4085 | sgl.CurItem.CompPars.CompCheckBox.BitmapIndex = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4086 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4087 | #ifdef GuiConst_BITMAP_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 4088 | sgl.CurItem.CompPars.CompCheckBox.BitmapIsTransparent = (B1 & 0x01); |
jmitc91516 | 0:9140ec6aa604 | 4089 | if (sgl.CurItem.CompPars.CompCheckBox.BitmapIsTransparent) |
jmitc91516 | 0:9140ec6aa604 | 4090 | #ifdef GuiConst_COLOR_DEPTH_1 |
jmitc91516 | 0:9140ec6aa604 | 4091 | sgl.CurItem.CompPars.CompCheckBox.BitmapTranspColor = (B1 >> 1) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 4092 | #else |
jmitc91516 | 0:9140ec6aa604 | 4093 | sgl.CurItem.CompPars.CompCheckBox.BitmapTranspColor = |
jmitc91516 | 0:9140ec6aa604 | 4094 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4095 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4096 | #else |
jmitc91516 | 0:9140ec6aa604 | 4097 | sgl.CurItem.CompPars.CompCheckBox.BitmapIsTransparent = 0; |
jmitc91516 | 0:9140ec6aa604 | 4098 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4099 | break; |
jmitc91516 | 0:9140ec6aa604 | 4100 | } |
jmitc91516 | 0:9140ec6aa604 | 4101 | |
jmitc91516 | 0:9140ec6aa604 | 4102 | sgl.CurItem.CompPars.CompCheckBox.MarkStyle = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4103 | if (sgl.CurItem.CompPars.CompCheckBox.MarkStyle != GuiLib_CHECKBOX_MARK_BITMAP) |
jmitc91516 | 0:9140ec6aa604 | 4104 | { |
jmitc91516 | 0:9140ec6aa604 | 4105 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4106 | switch (B1 & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 4107 | { |
jmitc91516 | 0:9140ec6aa604 | 4108 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 4109 | sgl.CurItem.CompPars.CompCheckBox.MarkColor = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 4110 | sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = sgl.CurItem.ForeColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 4111 | break; |
jmitc91516 | 0:9140ec6aa604 | 4112 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 4113 | sgl.CurItem.CompPars.CompCheckBox.MarkColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 4114 | sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4115 | break; |
jmitc91516 | 0:9140ec6aa604 | 4116 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 4117 | sgl.CurItem.CompPars.CompCheckBox.MarkColor = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 4118 | sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4119 | break; |
jmitc91516 | 0:9140ec6aa604 | 4120 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 4121 | sgl.CurItem.CompPars.CompCheckBox.MarkColor = (GuiConst_INTCOLOR) |
jmitc91516 | 0:9140ec6aa604 | 4122 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4123 | sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4124 | break; |
jmitc91516 | 0:9140ec6aa604 | 4125 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 4126 | sgl.CurItem.CompPars.CompCheckBox.MarkColor = TmpBackColor; |
jmitc91516 | 0:9140ec6aa604 | 4127 | sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = TmpBackColIdx; |
jmitc91516 | 0:9140ec6aa604 | 4128 | break; |
jmitc91516 | 0:9140ec6aa604 | 4129 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 4130 | break; |
jmitc91516 | 0:9140ec6aa604 | 4131 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 4132 | sgl.CurItem.CompPars.CompCheckBox.MarkColor = |
jmitc91516 | 0:9140ec6aa604 | 4133 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 4134 | sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4135 | break; |
jmitc91516 | 0:9140ec6aa604 | 4136 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 4137 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4138 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 4139 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 4140 | ColVarPtr = (GuiConst_INTCOLOR*)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 4141 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 4142 | { |
jmitc91516 | 0:9140ec6aa604 | 4143 | sgl.CurItem.CompPars.CompCheckBox.MarkColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 4144 | sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4145 | } |
jmitc91516 | 0:9140ec6aa604 | 4146 | else |
jmitc91516 | 0:9140ec6aa604 | 4147 | { |
jmitc91516 | 0:9140ec6aa604 | 4148 | sgl.CurItem.CompPars.CompCheckBox.MarkColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 4149 | sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = ColVarPtrIdx; |
jmitc91516 | 0:9140ec6aa604 | 4150 | } |
jmitc91516 | 0:9140ec6aa604 | 4151 | break; |
jmitc91516 | 0:9140ec6aa604 | 4152 | } |
jmitc91516 | 0:9140ec6aa604 | 4153 | } |
jmitc91516 | 0:9140ec6aa604 | 4154 | switch (sgl.CurItem.CompPars.CompCheckBox.MarkStyle) |
jmitc91516 | 0:9140ec6aa604 | 4155 | { |
jmitc91516 | 0:9140ec6aa604 | 4156 | case GuiLib_CHECKBOX_MARK_ICON: |
jmitc91516 | 0:9140ec6aa604 | 4157 | sgl.CurItem.CompPars.CompCheckBox.MarkIconPtr = |
jmitc91516 | 0:9140ec6aa604 | 4158 | (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr; |
jmitc91516 | 0:9140ec6aa604 | 4159 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 4160 | sgl.ItemDataPtr++; |
jmitc91516 | 0:9140ec6aa604 | 4161 | #else |
jmitc91516 | 0:9140ec6aa604 | 4162 | sgl.ItemDataPtr += 2; |
jmitc91516 | 0:9140ec6aa604 | 4163 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4164 | sgl.CurItem.CompPars.CompCheckBox.MarkIconFont = |
jmitc91516 | 0:9140ec6aa604 | 4165 | GetItemByte(&sgl.ItemDataPtr) + 1; |
jmitc91516 | 0:9140ec6aa604 | 4166 | sgl.CurItem.CompPars.CompCheckBox.MarkOffsetX = |
jmitc91516 | 0:9140ec6aa604 | 4167 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4168 | sgl.CurItem.CompPars.CompCheckBox.MarkOffsetY = |
jmitc91516 | 0:9140ec6aa604 | 4169 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4170 | break; |
jmitc91516 | 0:9140ec6aa604 | 4171 | case GuiLib_CHECKBOX_MARK_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 4172 | sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIndex = |
jmitc91516 | 0:9140ec6aa604 | 4173 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4174 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4175 | #ifdef GuiConst_BITMAP_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 4176 | sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIsTransparent = (B1 & 0x01); |
jmitc91516 | 0:9140ec6aa604 | 4177 | if (sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIsTransparent) |
jmitc91516 | 0:9140ec6aa604 | 4178 | #ifdef GuiConst_COLOR_DEPTH_1 |
jmitc91516 | 0:9140ec6aa604 | 4179 | sgl.CurItem.CompPars.CompCheckBox.MarkBitmapTranspColor = |
jmitc91516 | 0:9140ec6aa604 | 4180 | (B1 >> 1) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 4181 | #else |
jmitc91516 | 0:9140ec6aa604 | 4182 | sgl.CurItem.CompPars.CompCheckBox.MarkBitmapTranspColor = |
jmitc91516 | 0:9140ec6aa604 | 4183 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4184 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4185 | #else |
jmitc91516 | 0:9140ec6aa604 | 4186 | sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIsTransparent = 0; |
jmitc91516 | 0:9140ec6aa604 | 4187 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4188 | sgl.CurItem.CompPars.CompCheckBox.MarkOffsetX = |
jmitc91516 | 0:9140ec6aa604 | 4189 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4190 | sgl.CurItem.CompPars.CompCheckBox.MarkOffsetY = |
jmitc91516 | 0:9140ec6aa604 | 4191 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4192 | break; |
jmitc91516 | 0:9140ec6aa604 | 4193 | } |
jmitc91516 | 0:9140ec6aa604 | 4194 | } |
jmitc91516 | 0:9140ec6aa604 | 4195 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4196 | |
jmitc91516 | 0:9140ec6aa604 | 4197 | #ifdef GuiConst_ITEM_RADIOBUTTON_INUSE |
jmitc91516 | 0:9140ec6aa604 | 4198 | if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_RADIOBUTTON) |
jmitc91516 | 0:9140ec6aa604 | 4199 | { |
jmitc91516 | 0:9140ec6aa604 | 4200 | sgl.CurItem.CompPars.CompRadioButton.Style = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4201 | sgl.CurItem.CompPars.CompRadioButton.Size = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4202 | sgl.CurItem.CompPars.CompRadioButton.Count = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4203 | sgl.CurItem.CompPars.CompRadioButton.InterDistance = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4204 | switch (sgl.CurItem.CompPars.CompRadioButton.Style) |
jmitc91516 | 0:9140ec6aa604 | 4205 | { |
jmitc91516 | 0:9140ec6aa604 | 4206 | case GuiLib_RADIOBUTTON_ICON: |
jmitc91516 | 0:9140ec6aa604 | 4207 | sgl.CurItem.CompPars.CompRadioButton.IconPtr = |
jmitc91516 | 0:9140ec6aa604 | 4208 | (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr; |
jmitc91516 | 0:9140ec6aa604 | 4209 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 4210 | sgl.ItemDataPtr++; |
jmitc91516 | 0:9140ec6aa604 | 4211 | #else |
jmitc91516 | 0:9140ec6aa604 | 4212 | sgl.ItemDataPtr += 2; |
jmitc91516 | 0:9140ec6aa604 | 4213 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4214 | sgl.CurItem.CompPars.CompRadioButton.IconFont = GetItemByte(&sgl.ItemDataPtr) + 1; |
jmitc91516 | 0:9140ec6aa604 | 4215 | sgl.CurItem.CompPars.CompRadioButton.IconOffsetX = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4216 | sgl.CurItem.CompPars.CompRadioButton.IconOffsetY = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4217 | break; |
jmitc91516 | 0:9140ec6aa604 | 4218 | case GuiLib_RADIOBUTTON_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 4219 | sgl.CurItem.CompPars.CompRadioButton.BitmapIndex = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4220 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4221 | #ifdef GuiConst_BITMAP_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 4222 | sgl.CurItem.CompPars.CompRadioButton.BitmapIsTransparent = (B1 & 0x01); |
jmitc91516 | 0:9140ec6aa604 | 4223 | if (sgl.CurItem.CompPars.CompRadioButton.BitmapIsTransparent) |
jmitc91516 | 0:9140ec6aa604 | 4224 | #ifdef GuiConst_COLOR_DEPTH_1 |
jmitc91516 | 0:9140ec6aa604 | 4225 | sgl.CurItem.CompPars.CompRadioButton.BitmapTranspColor = (B1 >> 1) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 4226 | #else |
jmitc91516 | 0:9140ec6aa604 | 4227 | sgl.CurItem.CompPars.CompRadioButton.BitmapTranspColor = |
jmitc91516 | 0:9140ec6aa604 | 4228 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4229 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4230 | #else |
jmitc91516 | 0:9140ec6aa604 | 4231 | sgl.CurItem.CompPars.CompRadioButton.BitmapIsTransparent = 0; |
jmitc91516 | 0:9140ec6aa604 | 4232 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4233 | break; |
jmitc91516 | 0:9140ec6aa604 | 4234 | } |
jmitc91516 | 0:9140ec6aa604 | 4235 | |
jmitc91516 | 0:9140ec6aa604 | 4236 | sgl.CurItem.CompPars.CompRadioButton.MarkStyle = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4237 | if (sgl.CurItem.CompPars.CompRadioButton.MarkStyle != GuiLib_RADIOBUTTON_MARK_BITMAP) |
jmitc91516 | 0:9140ec6aa604 | 4238 | { |
jmitc91516 | 0:9140ec6aa604 | 4239 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4240 | switch (B1 & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 4241 | { |
jmitc91516 | 0:9140ec6aa604 | 4242 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 4243 | sgl.CurItem.CompPars.CompRadioButton.MarkColor = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 4244 | sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = sgl.CurItem.ForeColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 4245 | break; |
jmitc91516 | 0:9140ec6aa604 | 4246 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 4247 | sgl.CurItem.CompPars.CompRadioButton.MarkColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 4248 | sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4249 | break; |
jmitc91516 | 0:9140ec6aa604 | 4250 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 4251 | sgl.CurItem.CompPars.CompRadioButton.MarkColor = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 4252 | sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4253 | break; |
jmitc91516 | 0:9140ec6aa604 | 4254 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 4255 | sgl.CurItem.CompPars.CompRadioButton.MarkColor = (GuiConst_INTCOLOR) |
jmitc91516 | 0:9140ec6aa604 | 4256 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4257 | sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4258 | break; |
jmitc91516 | 0:9140ec6aa604 | 4259 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 4260 | sgl.CurItem.CompPars.CompRadioButton.MarkColor = TmpBackColor; |
jmitc91516 | 0:9140ec6aa604 | 4261 | sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = TmpBackColIdx; |
jmitc91516 | 0:9140ec6aa604 | 4262 | break; |
jmitc91516 | 0:9140ec6aa604 | 4263 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 4264 | break; |
jmitc91516 | 0:9140ec6aa604 | 4265 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 4266 | sgl.CurItem.CompPars.CompRadioButton.MarkColor = |
jmitc91516 | 0:9140ec6aa604 | 4267 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 4268 | sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4269 | break; |
jmitc91516 | 0:9140ec6aa604 | 4270 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 4271 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4272 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 4273 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 4274 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 4275 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 4276 | { |
jmitc91516 | 0:9140ec6aa604 | 4277 | sgl.CurItem.CompPars.CompRadioButton.MarkColor = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 4278 | sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4279 | } |
jmitc91516 | 0:9140ec6aa604 | 4280 | else |
jmitc91516 | 0:9140ec6aa604 | 4281 | { |
jmitc91516 | 0:9140ec6aa604 | 4282 | sgl.CurItem.CompPars.CompRadioButton.MarkColor = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 4283 | sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = ColVarPtrIdx; |
jmitc91516 | 0:9140ec6aa604 | 4284 | } |
jmitc91516 | 0:9140ec6aa604 | 4285 | break; |
jmitc91516 | 0:9140ec6aa604 | 4286 | } |
jmitc91516 | 0:9140ec6aa604 | 4287 | } |
jmitc91516 | 0:9140ec6aa604 | 4288 | switch (sgl.CurItem.CompPars.CompRadioButton.MarkStyle) |
jmitc91516 | 0:9140ec6aa604 | 4289 | { |
jmitc91516 | 0:9140ec6aa604 | 4290 | case GuiLib_RADIOBUTTON_MARK_ICON: |
jmitc91516 | 0:9140ec6aa604 | 4291 | sgl.CurItem.CompPars.CompRadioButton.MarkIconPtr = |
jmitc91516 | 0:9140ec6aa604 | 4292 | (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr; |
jmitc91516 | 0:9140ec6aa604 | 4293 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 4294 | sgl.ItemDataPtr++; |
jmitc91516 | 0:9140ec6aa604 | 4295 | #else |
jmitc91516 | 0:9140ec6aa604 | 4296 | sgl.ItemDataPtr += 2; |
jmitc91516 | 0:9140ec6aa604 | 4297 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4298 | sgl.CurItem.CompPars.CompRadioButton.MarkIconFont = |
jmitc91516 | 0:9140ec6aa604 | 4299 | GetItemByte(&sgl.ItemDataPtr) + 1; |
jmitc91516 | 0:9140ec6aa604 | 4300 | sgl.CurItem.CompPars.CompRadioButton.MarkOffsetX = |
jmitc91516 | 0:9140ec6aa604 | 4301 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4302 | sgl.CurItem.CompPars.CompRadioButton.MarkOffsetY = |
jmitc91516 | 0:9140ec6aa604 | 4303 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4304 | break; |
jmitc91516 | 0:9140ec6aa604 | 4305 | case GuiLib_RADIOBUTTON_MARK_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 4306 | sgl.CurItem.CompPars.CompRadioButton.MarkBitmapIndex = |
jmitc91516 | 0:9140ec6aa604 | 4307 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4308 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4309 | #ifdef GuiConst_BITMAP_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 4310 | sgl.CurItem.CompPars.CompRadioButton.MarkBitmapIsTransparent = (B1 & 0x01); |
jmitc91516 | 0:9140ec6aa604 | 4311 | if (sgl.CurItem.CompPars.CompRadioButton.MarkBitmapIsTransparent) |
jmitc91516 | 0:9140ec6aa604 | 4312 | #ifdef GuiConst_COLOR_DEPTH_1 |
jmitc91516 | 0:9140ec6aa604 | 4313 | sgl.CurItem.CompPars.CompRadioButton.MarkBitmapTranspColor = |
jmitc91516 | 0:9140ec6aa604 | 4314 | (B1 >> 1) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 4315 | #else |
jmitc91516 | 0:9140ec6aa604 | 4316 | sgl.CurItem.CompPars.CompRadioButton.MarkBitmapTranspColor = |
jmitc91516 | 0:9140ec6aa604 | 4317 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4318 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4319 | #else |
jmitc91516 | 0:9140ec6aa604 | 4320 | sgl.CurItem.CompPars.CompRadioButton.MarkBitmapIsTransparent = 0; |
jmitc91516 | 0:9140ec6aa604 | 4321 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4322 | sgl.CurItem.CompPars.CompRadioButton.MarkOffsetX = |
jmitc91516 | 0:9140ec6aa604 | 4323 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4324 | sgl.CurItem.CompPars.CompRadioButton.MarkOffsetY = |
jmitc91516 | 0:9140ec6aa604 | 4325 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4326 | break; |
jmitc91516 | 0:9140ec6aa604 | 4327 | } |
jmitc91516 | 0:9140ec6aa604 | 4328 | } |
jmitc91516 | 0:9140ec6aa604 | 4329 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4330 | |
jmitc91516 | 0:9140ec6aa604 | 4331 | #ifdef GuiConst_ITEM_BUTTON_INUSE |
jmitc91516 | 0:9140ec6aa604 | 4332 | if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_BUTTON) |
jmitc91516 | 0:9140ec6aa604 | 4333 | { |
jmitc91516 | 0:9140ec6aa604 | 4334 | sgl.CurItem.CompPars.CompButton.Layout = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4335 | |
jmitc91516 | 0:9140ec6aa604 | 4336 | sgl.CurItem.CompPars.CompButton.BodyStyle = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4337 | if ((sgl.CurItem.CompPars.CompButton.BodyStyle == GuiLib_BUTTON_BODY_ICON) || |
jmitc91516 | 0:9140ec6aa604 | 4338 | (sgl.CurItem.CompPars.CompButton.BodyStyle == GuiLib_BUTTON_BODY_BITMAP)) |
jmitc91516 | 0:9140ec6aa604 | 4339 | { |
jmitc91516 | 0:9140ec6aa604 | 4340 | sgl.CurItem.CompPars.CompButton.BodyLikeUp = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4341 | for (I = 0; I < 3; I++) |
jmitc91516 | 0:9140ec6aa604 | 4342 | if ((I == 0) || |
jmitc91516 | 0:9140ec6aa604 | 4343 | ((I == 1) && !(sgl.CurItem.CompPars.CompButton.BodyLikeUp & 0x01)) || |
jmitc91516 | 0:9140ec6aa604 | 4344 | ((I == 2) && !(sgl.CurItem.CompPars.CompButton.BodyLikeUp & 0x02))) |
jmitc91516 | 0:9140ec6aa604 | 4345 | { |
jmitc91516 | 0:9140ec6aa604 | 4346 | switch (sgl.CurItem.CompPars.CompButton.BodyStyle) |
jmitc91516 | 0:9140ec6aa604 | 4347 | { |
jmitc91516 | 0:9140ec6aa604 | 4348 | case GuiLib_BUTTON_BODY_ICON: |
jmitc91516 | 0:9140ec6aa604 | 4349 | sgl.CurItem.CompPars.CompButton.BodyIconPtr[I] = |
jmitc91516 | 0:9140ec6aa604 | 4350 | (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr; |
jmitc91516 | 0:9140ec6aa604 | 4351 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 4352 | sgl.ItemDataPtr++; |
jmitc91516 | 0:9140ec6aa604 | 4353 | #else |
jmitc91516 | 0:9140ec6aa604 | 4354 | sgl.ItemDataPtr += 2; |
jmitc91516 | 0:9140ec6aa604 | 4355 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4356 | sgl.CurItem.CompPars.CompButton.BodyIconFont[I] = |
jmitc91516 | 0:9140ec6aa604 | 4357 | GetItemByte(&sgl.ItemDataPtr) + 1; |
jmitc91516 | 0:9140ec6aa604 | 4358 | sgl.CurItem.CompPars.CompButton.BodyIconOffsetX[I] = |
jmitc91516 | 0:9140ec6aa604 | 4359 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4360 | sgl.CurItem.CompPars.CompButton.BodyIconOffsetY[I] = |
jmitc91516 | 0:9140ec6aa604 | 4361 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4362 | break; |
jmitc91516 | 0:9140ec6aa604 | 4363 | case GuiLib_BUTTON_BODY_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 4364 | sgl.CurItem.CompPars.CompButton.BodyBitmapIndex[I] = |
jmitc91516 | 0:9140ec6aa604 | 4365 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4366 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4367 | #ifdef GuiConst_BITMAP_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 4368 | sgl.CurItem.CompPars.CompButton.BodyBitmapIsTransparent[I] = |
jmitc91516 | 0:9140ec6aa604 | 4369 | (B1 & 0x01); |
jmitc91516 | 0:9140ec6aa604 | 4370 | if (sgl.CurItem.CompPars.CompButton.BodyBitmapIsTransparent[I]) |
jmitc91516 | 0:9140ec6aa604 | 4371 | #ifdef GuiConst_COLOR_DEPTH_1 |
jmitc91516 | 0:9140ec6aa604 | 4372 | sgl.CurItem.CompPars.CompButton.BodyBitmapTranspColor[I] = |
jmitc91516 | 0:9140ec6aa604 | 4373 | (B1 >> 1) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 4374 | #else |
jmitc91516 | 0:9140ec6aa604 | 4375 | sgl.CurItem.CompPars.CompButton.BodyBitmapTranspColor[I] = |
jmitc91516 | 0:9140ec6aa604 | 4376 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4377 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4378 | #else |
jmitc91516 | 0:9140ec6aa604 | 4379 | sgl.CurItem.CompPars.CompButton.BodyBitmapIsTransparent[I] = 0; |
jmitc91516 | 0:9140ec6aa604 | 4380 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4381 | break; |
jmitc91516 | 0:9140ec6aa604 | 4382 | } |
jmitc91516 | 0:9140ec6aa604 | 4383 | } |
jmitc91516 | 0:9140ec6aa604 | 4384 | else |
jmitc91516 | 0:9140ec6aa604 | 4385 | { |
jmitc91516 | 0:9140ec6aa604 | 4386 | switch (sgl.CurItem.CompPars.CompButton.BodyStyle) |
jmitc91516 | 0:9140ec6aa604 | 4387 | { |
jmitc91516 | 0:9140ec6aa604 | 4388 | case GuiLib_BUTTON_BODY_ICON: |
jmitc91516 | 0:9140ec6aa604 | 4389 | sgl.CurItem.CompPars.CompButton.BodyIconPtr[I] = |
jmitc91516 | 0:9140ec6aa604 | 4390 | sgl.CurItem.CompPars.CompButton.BodyIconPtr[0]; |
jmitc91516 | 0:9140ec6aa604 | 4391 | sgl.CurItem.CompPars.CompButton.BodyIconFont[I] = |
jmitc91516 | 0:9140ec6aa604 | 4392 | sgl.CurItem.CompPars.CompButton.BodyIconFont[0]; |
jmitc91516 | 0:9140ec6aa604 | 4393 | sgl.CurItem.CompPars.CompButton.BodyIconOffsetX[I] = |
jmitc91516 | 0:9140ec6aa604 | 4394 | sgl.CurItem.CompPars.CompButton.BodyIconOffsetX[0]; |
jmitc91516 | 0:9140ec6aa604 | 4395 | sgl.CurItem.CompPars.CompButton.BodyIconOffsetY[I] = |
jmitc91516 | 0:9140ec6aa604 | 4396 | sgl.CurItem.CompPars.CompButton.BodyIconOffsetY[0]; |
jmitc91516 | 0:9140ec6aa604 | 4397 | break; |
jmitc91516 | 0:9140ec6aa604 | 4398 | case GuiLib_BUTTON_BODY_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 4399 | sgl.CurItem.CompPars.CompButton.BodyBitmapIndex[I] = |
jmitc91516 | 0:9140ec6aa604 | 4400 | sgl.CurItem.CompPars.CompButton.BodyBitmapIndex[0]; |
jmitc91516 | 0:9140ec6aa604 | 4401 | sgl.CurItem.CompPars.CompButton.BodyBitmapIsTransparent[I] = |
jmitc91516 | 0:9140ec6aa604 | 4402 | sgl.CurItem.CompPars.CompButton.BodyBitmapIsTransparent[0]; |
jmitc91516 | 0:9140ec6aa604 | 4403 | sgl.CurItem.CompPars.CompButton.BodyBitmapTranspColor[I] = |
jmitc91516 | 0:9140ec6aa604 | 4404 | sgl.CurItem.CompPars.CompButton.BodyBitmapTranspColor[0]; |
jmitc91516 | 0:9140ec6aa604 | 4405 | break; |
jmitc91516 | 0:9140ec6aa604 | 4406 | } |
jmitc91516 | 0:9140ec6aa604 | 4407 | } |
jmitc91516 | 0:9140ec6aa604 | 4408 | } |
jmitc91516 | 0:9140ec6aa604 | 4409 | |
jmitc91516 | 0:9140ec6aa604 | 4410 | if (sgl.CurItem.CompPars.CompButton.Layout != GuiLib_BUTTON_LAYOUT_GLYPH) |
jmitc91516 | 0:9140ec6aa604 | 4411 | { |
jmitc91516 | 0:9140ec6aa604 | 4412 | sgl.CurItem.CompPars.CompButton.TextLikeUp = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4413 | for (I = 0; I < 3; I++) |
jmitc91516 | 0:9140ec6aa604 | 4414 | { |
jmitc91516 | 0:9140ec6aa604 | 4415 | if ((I == 0) || |
jmitc91516 | 0:9140ec6aa604 | 4416 | ((I == 1) && !(sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x04)) || |
jmitc91516 | 0:9140ec6aa604 | 4417 | ((I == 2) && !(sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x08))) |
jmitc91516 | 0:9140ec6aa604 | 4418 | { |
jmitc91516 | 0:9140ec6aa604 | 4419 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4420 | switch (B1 & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 4421 | { |
jmitc91516 | 0:9140ec6aa604 | 4422 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 4423 | sgl.CurItem.CompPars.CompButton.TextColor[I] = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 4424 | sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = sgl.CurItem.ForeColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 4425 | break; |
jmitc91516 | 0:9140ec6aa604 | 4426 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 4427 | sgl.CurItem.CompPars.CompButton.TextColor[I] = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 4428 | sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4429 | break; |
jmitc91516 | 0:9140ec6aa604 | 4430 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 4431 | sgl.CurItem.CompPars.CompButton.TextColor[I] = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 4432 | sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4433 | break; |
jmitc91516 | 0:9140ec6aa604 | 4434 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 4435 | sgl.CurItem.CompPars.CompButton.TextColor[I] = |
jmitc91516 | 0:9140ec6aa604 | 4436 | (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4437 | sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4438 | break; |
jmitc91516 | 0:9140ec6aa604 | 4439 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 4440 | sgl.CurItem.CompPars.CompButton.TextColor[I] = TmpBackColor; |
jmitc91516 | 0:9140ec6aa604 | 4441 | sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = TmpBackColIdx; |
jmitc91516 | 0:9140ec6aa604 | 4442 | break; |
jmitc91516 | 0:9140ec6aa604 | 4443 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 4444 | break; |
jmitc91516 | 0:9140ec6aa604 | 4445 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 4446 | sgl.CurItem.CompPars.CompButton.TextColor[I] = |
jmitc91516 | 0:9140ec6aa604 | 4447 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 4448 | sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4449 | break; |
jmitc91516 | 0:9140ec6aa604 | 4450 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 4451 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4452 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 4453 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 4454 | ColVarPtr = (GuiConst_INTCOLOR*)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 4455 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 4456 | { |
jmitc91516 | 0:9140ec6aa604 | 4457 | sgl.CurItem.CompPars.CompButton.TextColor[I] = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 4458 | sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4459 | } |
jmitc91516 | 0:9140ec6aa604 | 4460 | else |
jmitc91516 | 0:9140ec6aa604 | 4461 | { |
jmitc91516 | 0:9140ec6aa604 | 4462 | sgl.CurItem.CompPars.CompButton.TextColor[I] = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 4463 | sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = ColVarPtrIdx; |
jmitc91516 | 0:9140ec6aa604 | 4464 | } |
jmitc91516 | 0:9140ec6aa604 | 4465 | break; |
jmitc91516 | 0:9140ec6aa604 | 4466 | } |
jmitc91516 | 0:9140ec6aa604 | 4467 | |
jmitc91516 | 0:9140ec6aa604 | 4468 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4469 | if (B1 & 0x04) |
jmitc91516 | 0:9140ec6aa604 | 4470 | sgl.CurItem.TextPar[I].BitFlags |= GuiLib_BITFLAG_UNDERLINE; |
jmitc91516 | 0:9140ec6aa604 | 4471 | else |
jmitc91516 | 0:9140ec6aa604 | 4472 | sgl.CurItem.TextPar[I].BitFlags &= ~GuiLib_BITFLAG_UNDERLINE; |
jmitc91516 | 0:9140ec6aa604 | 4473 | B1 = B1 & 0x03; |
jmitc91516 | 0:9140ec6aa604 | 4474 | if (B1 != GuiLib_PS_NOCHANGE) |
jmitc91516 | 0:9140ec6aa604 | 4475 | sgl.CurItem.TextPar[I].Ps = B1; |
jmitc91516 | 0:9140ec6aa604 | 4476 | } |
jmitc91516 | 0:9140ec6aa604 | 4477 | else |
jmitc91516 | 0:9140ec6aa604 | 4478 | { |
jmitc91516 | 0:9140ec6aa604 | 4479 | sgl.CurItem.CompPars.CompButton.TextColor[I] = |
jmitc91516 | 0:9140ec6aa604 | 4480 | sgl.CurItem.CompPars.CompButton.TextColor[0]; |
jmitc91516 | 0:9140ec6aa604 | 4481 | sgl.CurItem.TextPar[I] = sgl.CurItem.TextPar[0]; |
jmitc91516 | 0:9140ec6aa604 | 4482 | } |
jmitc91516 | 0:9140ec6aa604 | 4483 | } |
jmitc91516 | 0:9140ec6aa604 | 4484 | } |
jmitc91516 | 0:9140ec6aa604 | 4485 | |
jmitc91516 | 0:9140ec6aa604 | 4486 | if (sgl.CurItem.CompPars.CompButton.Layout != GuiLib_BUTTON_LAYOUT_TEXT) |
jmitc91516 | 0:9140ec6aa604 | 4487 | { |
jmitc91516 | 0:9140ec6aa604 | 4488 | sgl.CurItem.CompPars.CompButton.GlyphStyle = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4489 | sgl.CurItem.CompPars.CompButton.GlyphLikeUp = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4490 | for (I = 0; I < 3; I++) |
jmitc91516 | 0:9140ec6aa604 | 4491 | if ((I == 0) || |
jmitc91516 | 0:9140ec6aa604 | 4492 | ((I == 1) && !(sgl.CurItem.CompPars.CompButton.GlyphLikeUp & 0x01)) || |
jmitc91516 | 0:9140ec6aa604 | 4493 | ((I == 2) && !(sgl.CurItem.CompPars.CompButton.GlyphLikeUp & 0x02))) |
jmitc91516 | 0:9140ec6aa604 | 4494 | { |
jmitc91516 | 0:9140ec6aa604 | 4495 | switch (sgl.CurItem.CompPars.CompButton.GlyphStyle) |
jmitc91516 | 0:9140ec6aa604 | 4496 | { |
jmitc91516 | 0:9140ec6aa604 | 4497 | case GuiLib_BUTTON_GLYPH_ICON: |
jmitc91516 | 0:9140ec6aa604 | 4498 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4499 | switch (B1 & 0x07) |
jmitc91516 | 0:9140ec6aa604 | 4500 | { |
jmitc91516 | 0:9140ec6aa604 | 4501 | case GuiLib_COLOR_NOCHANGE: |
jmitc91516 | 0:9140ec6aa604 | 4502 | sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = sgl.CurItem.ForeColor; |
jmitc91516 | 0:9140ec6aa604 | 4503 | sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = sgl.CurItem.ForeColorIndex; |
jmitc91516 | 0:9140ec6aa604 | 4504 | break; |
jmitc91516 | 0:9140ec6aa604 | 4505 | case GuiLib_COLOR_FORE: |
jmitc91516 | 0:9140ec6aa604 | 4506 | sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 4507 | sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4508 | break; |
jmitc91516 | 0:9140ec6aa604 | 4509 | case GuiLib_COLOR_BACK: |
jmitc91516 | 0:9140ec6aa604 | 4510 | sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = GuiConst_PIXEL_OFF; |
jmitc91516 | 0:9140ec6aa604 | 4511 | sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4512 | break; |
jmitc91516 | 0:9140ec6aa604 | 4513 | case GuiLib_COLOR_OTHER: |
jmitc91516 | 0:9140ec6aa604 | 4514 | sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = |
jmitc91516 | 0:9140ec6aa604 | 4515 | (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4516 | sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4517 | break; |
jmitc91516 | 0:9140ec6aa604 | 4518 | case GuiLib_COLOR_INVERT: |
jmitc91516 | 0:9140ec6aa604 | 4519 | sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = TmpBackColor; |
jmitc91516 | 0:9140ec6aa604 | 4520 | sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = TmpBackColIdx; |
jmitc91516 | 0:9140ec6aa604 | 4521 | break; |
jmitc91516 | 0:9140ec6aa604 | 4522 | case GuiLib_COLOR_TRANSP: |
jmitc91516 | 0:9140ec6aa604 | 4523 | break; |
jmitc91516 | 0:9140ec6aa604 | 4524 | case GuiLib_COLOR_TABLE: |
jmitc91516 | 0:9140ec6aa604 | 4525 | sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = |
jmitc91516 | 0:9140ec6aa604 | 4526 | GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)]; |
jmitc91516 | 0:9140ec6aa604 | 4527 | sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4528 | break; |
jmitc91516 | 0:9140ec6aa604 | 4529 | case GuiLib_COLOR_VAR: |
jmitc91516 | 0:9140ec6aa604 | 4530 | ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4531 | if (ColVarPtrIdx >= GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 4532 | ColVarPtrIdx = 0; |
jmitc91516 | 0:9140ec6aa604 | 4533 | ColVarPtr = (GuiConst_INTCOLOR*)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]); |
jmitc91516 | 0:9140ec6aa604 | 4534 | if (ColVarPtr == 0) |
jmitc91516 | 0:9140ec6aa604 | 4535 | { |
jmitc91516 | 0:9140ec6aa604 | 4536 | sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = GuiConst_PIXEL_ON; |
jmitc91516 | 0:9140ec6aa604 | 4537 | sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = 0xFFFF; |
jmitc91516 | 0:9140ec6aa604 | 4538 | } |
jmitc91516 | 0:9140ec6aa604 | 4539 | else |
jmitc91516 | 0:9140ec6aa604 | 4540 | { |
jmitc91516 | 0:9140ec6aa604 | 4541 | sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 4542 | sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = ColVarPtrIdx; |
jmitc91516 | 0:9140ec6aa604 | 4543 | } |
jmitc91516 | 0:9140ec6aa604 | 4544 | break; |
jmitc91516 | 0:9140ec6aa604 | 4545 | } |
jmitc91516 | 0:9140ec6aa604 | 4546 | |
jmitc91516 | 0:9140ec6aa604 | 4547 | sgl.CurItem.CompPars.CompButton.GlyphIconPtr[I] = |
jmitc91516 | 0:9140ec6aa604 | 4548 | (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr; |
jmitc91516 | 0:9140ec6aa604 | 4549 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 4550 | sgl.ItemDataPtr++; |
jmitc91516 | 0:9140ec6aa604 | 4551 | #else |
jmitc91516 | 0:9140ec6aa604 | 4552 | sgl.ItemDataPtr += 2; |
jmitc91516 | 0:9140ec6aa604 | 4553 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4554 | sgl.CurItem.CompPars.CompButton.GlyphIconFont[I] = |
jmitc91516 | 0:9140ec6aa604 | 4555 | GetItemByte(&sgl.ItemDataPtr) + 1; |
jmitc91516 | 0:9140ec6aa604 | 4556 | sgl.CurItem.CompPars.CompButton.GlyphIconOffsetX[I] = |
jmitc91516 | 0:9140ec6aa604 | 4557 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4558 | sgl.CurItem.CompPars.CompButton.GlyphIconOffsetY[I] = |
jmitc91516 | 0:9140ec6aa604 | 4559 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4560 | break; |
jmitc91516 | 0:9140ec6aa604 | 4561 | case GuiLib_BUTTON_GLYPH_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 4562 | sgl.CurItem.CompPars.CompButton.GlyphBitmapIndex[I] = |
jmitc91516 | 0:9140ec6aa604 | 4563 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4564 | B1 = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4565 | #ifdef GuiConst_BITMAP_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 4566 | sgl.CurItem.CompPars.CompButton.GlyphBitmapIsTransparent[I] = |
jmitc91516 | 0:9140ec6aa604 | 4567 | (B1 & 0x01); |
jmitc91516 | 0:9140ec6aa604 | 4568 | if (sgl.CurItem.CompPars.CompButton.GlyphBitmapIsTransparent[I]) |
jmitc91516 | 0:9140ec6aa604 | 4569 | #ifdef GuiConst_COLOR_DEPTH_1 |
jmitc91516 | 0:9140ec6aa604 | 4570 | sgl.CurItem.CompPars.CompButton.GlyphBitmapTranspColor[I] = |
jmitc91516 | 0:9140ec6aa604 | 4571 | (B1 >> 1) & 0x01; |
jmitc91516 | 0:9140ec6aa604 | 4572 | #else |
jmitc91516 | 0:9140ec6aa604 | 4573 | sgl.CurItem.CompPars.CompButton.GlyphBitmapTranspColor[I] = |
jmitc91516 | 0:9140ec6aa604 | 4574 | GetItemColor(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4575 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4576 | #else |
jmitc91516 | 0:9140ec6aa604 | 4577 | sgl.CurItem.CompPars.CompButton.GlyphBitmapIsTransparent[I] = 0; |
jmitc91516 | 0:9140ec6aa604 | 4578 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4579 | sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetX[I] = |
jmitc91516 | 0:9140ec6aa604 | 4580 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4581 | sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetY[I] = |
jmitc91516 | 0:9140ec6aa604 | 4582 | GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4583 | break; |
jmitc91516 | 0:9140ec6aa604 | 4584 | } |
jmitc91516 | 0:9140ec6aa604 | 4585 | } |
jmitc91516 | 0:9140ec6aa604 | 4586 | else |
jmitc91516 | 0:9140ec6aa604 | 4587 | { |
jmitc91516 | 0:9140ec6aa604 | 4588 | switch (sgl.CurItem.CompPars.CompButton.GlyphStyle) |
jmitc91516 | 0:9140ec6aa604 | 4589 | { |
jmitc91516 | 0:9140ec6aa604 | 4590 | case GuiLib_BUTTON_GLYPH_ICON: |
jmitc91516 | 0:9140ec6aa604 | 4591 | sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = |
jmitc91516 | 0:9140ec6aa604 | 4592 | sgl.CurItem.CompPars.CompButton.GlyphIconColor[0]; |
jmitc91516 | 0:9140ec6aa604 | 4593 | sgl.CurItem.CompPars.CompButton.GlyphIconPtr[I] = |
jmitc91516 | 0:9140ec6aa604 | 4594 | sgl.CurItem.CompPars.CompButton.GlyphIconPtr[0]; |
jmitc91516 | 0:9140ec6aa604 | 4595 | sgl.CurItem.CompPars.CompButton.GlyphIconFont[I] = |
jmitc91516 | 0:9140ec6aa604 | 4596 | sgl.CurItem.CompPars.CompButton.GlyphIconFont[0]; |
jmitc91516 | 0:9140ec6aa604 | 4597 | sgl.CurItem.CompPars.CompButton.GlyphIconOffsetX[I] = |
jmitc91516 | 0:9140ec6aa604 | 4598 | sgl.CurItem.CompPars.CompButton.GlyphIconOffsetX[0]; |
jmitc91516 | 0:9140ec6aa604 | 4599 | sgl.CurItem.CompPars.CompButton.GlyphIconOffsetY[I] = |
jmitc91516 | 0:9140ec6aa604 | 4600 | sgl.CurItem.CompPars.CompButton.GlyphIconOffsetY[0]; |
jmitc91516 | 0:9140ec6aa604 | 4601 | break; |
jmitc91516 | 0:9140ec6aa604 | 4602 | case GuiLib_BUTTON_GLYPH_BITMAP: |
jmitc91516 | 0:9140ec6aa604 | 4603 | sgl.CurItem.CompPars.CompButton.GlyphBitmapIndex[I] = |
jmitc91516 | 0:9140ec6aa604 | 4604 | sgl.CurItem.CompPars.CompButton.GlyphBitmapIndex[0]; |
jmitc91516 | 0:9140ec6aa604 | 4605 | sgl.CurItem.CompPars.CompButton.GlyphBitmapIsTransparent[I] = |
jmitc91516 | 0:9140ec6aa604 | 4606 | sgl.CurItem.CompPars.CompButton.GlyphBitmapIsTransparent[0]; |
jmitc91516 | 0:9140ec6aa604 | 4607 | sgl.CurItem.CompPars.CompButton.GlyphBitmapTranspColor[I] = |
jmitc91516 | 0:9140ec6aa604 | 4608 | sgl.CurItem.CompPars.CompButton.GlyphBitmapTranspColor[0]; |
jmitc91516 | 0:9140ec6aa604 | 4609 | sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetX[I] = |
jmitc91516 | 0:9140ec6aa604 | 4610 | sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetX[0]; |
jmitc91516 | 0:9140ec6aa604 | 4611 | sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetY[I] = |
jmitc91516 | 0:9140ec6aa604 | 4612 | sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetY[0]; |
jmitc91516 | 0:9140ec6aa604 | 4613 | break; |
jmitc91516 | 0:9140ec6aa604 | 4614 | } |
jmitc91516 | 0:9140ec6aa604 | 4615 | } |
jmitc91516 | 0:9140ec6aa604 | 4616 | } |
jmitc91516 | 0:9140ec6aa604 | 4617 | } |
jmitc91516 | 0:9140ec6aa604 | 4618 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4619 | |
jmitc91516 | 0:9140ec6aa604 | 4620 | #ifdef GuiConst_ITEM_PANEL_INUSE |
jmitc91516 | 0:9140ec6aa604 | 4621 | if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_PANEL) |
jmitc91516 | 0:9140ec6aa604 | 4622 | { |
jmitc91516 | 0:9140ec6aa604 | 4623 | sgl.CurItem.CompPars.CompPanel.Style = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4624 | } |
jmitc91516 | 0:9140ec6aa604 | 4625 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4626 | |
jmitc91516 | 0:9140ec6aa604 | 4627 | if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT + |
jmitc91516 | 0:9140ec6aa604 | 4628 | GuiLib_ITEMBIT_TEXTBLOCK)) || |
jmitc91516 | 0:9140ec6aa604 | 4629 | (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_BUTTON))) |
jmitc91516 | 0:9140ec6aa604 | 4630 | { |
jmitc91516 | 0:9140ec6aa604 | 4631 | if (sgl.CommonByte4 & 0x80) |
jmitc91516 | 0:9140ec6aa604 | 4632 | { |
jmitc91516 | 0:9140ec6aa604 | 4633 | #ifdef GuiConst_LANGUAGE_ALL_ACTIVE |
jmitc91516 | 0:9140ec6aa604 | 4634 | N = GuiConst_LANGUAGE_CNT; |
jmitc91516 | 0:9140ec6aa604 | 4635 | W1 = LanguageIndex; |
jmitc91516 | 0:9140ec6aa604 | 4636 | #else |
jmitc91516 | 0:9140ec6aa604 | 4637 | N = GuiConst_LANGUAGE_ACTIVE_CNT; |
jmitc91516 | 0:9140ec6aa604 | 4638 | W1 = ReadWord(GuiFont_LanguageIndex[LanguageIndex]); |
jmitc91516 | 0:9140ec6aa604 | 4639 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4640 | } |
jmitc91516 | 0:9140ec6aa604 | 4641 | else |
jmitc91516 | 0:9140ec6aa604 | 4642 | { |
jmitc91516 | 0:9140ec6aa604 | 4643 | N = 1; |
jmitc91516 | 0:9140ec6aa604 | 4644 | W1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 4645 | } |
jmitc91516 | 0:9140ec6aa604 | 4646 | |
jmitc91516 | 0:9140ec6aa604 | 4647 | J = 0; |
jmitc91516 | 0:9140ec6aa604 | 4648 | for (I = 0; I < sgl.CurItem.TextCnt; I++) |
jmitc91516 | 0:9140ec6aa604 | 4649 | { |
jmitc91516 | 0:9140ec6aa604 | 4650 | #ifndef GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 4651 | TxtSum1 = 0; |
jmitc91516 | 0:9140ec6aa604 | 4652 | TxtSum2 = 0; |
jmitc91516 | 0:9140ec6aa604 | 4653 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4654 | for (X = 0; X < N; X++) |
jmitc91516 | 0:9140ec6aa604 | 4655 | { |
jmitc91516 | 0:9140ec6aa604 | 4656 | #ifdef GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 4657 | Ti = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4658 | if (X == W1) |
jmitc91516 | 0:9140ec6aa604 | 4659 | { |
jmitc91516 | 0:9140ec6aa604 | 4660 | sgl.CurItem.TextLength[J] = GetRemoteText(Ti); |
jmitc91516 | 0:9140ec6aa604 | 4661 | sgl.CurItem.TextIndex[J] = Ti; |
jmitc91516 | 0:9140ec6aa604 | 4662 | sgl.CurItem.TextPtr[J] = &sgl.GuiLib_RemoteTextBuffer[0]; |
jmitc91516 | 0:9140ec6aa604 | 4663 | } |
jmitc91516 | 0:9140ec6aa604 | 4664 | #else |
jmitc91516 | 0:9140ec6aa604 | 4665 | TxtSize = GetItemByte(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4666 | if (TxtSize == 0xFF) |
jmitc91516 | 0:9140ec6aa604 | 4667 | TxtSize = GetItemWord(&sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4668 | |
jmitc91516 | 0:9140ec6aa604 | 4669 | if (X == W1) |
jmitc91516 | 0:9140ec6aa604 | 4670 | { |
jmitc91516 | 0:9140ec6aa604 | 4671 | sgl.CurItem.TextLength[J] = GuiLib_GET_MIN(TxtSize, GuiConst_MAX_TEXT_LEN); |
jmitc91516 | 0:9140ec6aa604 | 4672 | #ifdef GuiConst_REMOTE_STRUCT_DATA |
jmitc91516 | 0:9140ec6aa604 | 4673 | TxtReadSize = sgl.CurItem.TextLength[J] + 1; |
jmitc91516 | 0:9140ec6aa604 | 4674 | #ifndef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 4675 | TxtReadSize *= 2; |
jmitc91516 | 0:9140ec6aa604 | 4676 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4677 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4678 | } |
jmitc91516 | 0:9140ec6aa604 | 4679 | |
jmitc91516 | 0:9140ec6aa604 | 4680 | TxtSize++; |
jmitc91516 | 0:9140ec6aa604 | 4681 | #ifndef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 4682 | TxtSize *= 2; |
jmitc91516 | 0:9140ec6aa604 | 4683 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4684 | |
jmitc91516 | 0:9140ec6aa604 | 4685 | #ifndef GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 4686 | if (X < W1) |
jmitc91516 | 0:9140ec6aa604 | 4687 | TxtSum1 += TxtSize; |
jmitc91516 | 0:9140ec6aa604 | 4688 | else |
jmitc91516 | 0:9140ec6aa604 | 4689 | TxtSum2 += TxtSize; |
jmitc91516 | 0:9140ec6aa604 | 4690 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4691 | #endif // GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 4692 | } |
jmitc91516 | 0:9140ec6aa604 | 4693 | |
jmitc91516 | 0:9140ec6aa604 | 4694 | #ifndef GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 4695 | #ifdef GuiConst_REMOTE_STRUCT_DATA |
jmitc91516 | 0:9140ec6aa604 | 4696 | sgl.RemoteStructOffset += TxtSum1; |
jmitc91516 | 0:9140ec6aa604 | 4697 | GuiLib_RemoteDataReadBlock( |
jmitc91516 | 0:9140ec6aa604 | 4698 | sgl.RemoteStructOffset, |
jmitc91516 | 0:9140ec6aa604 | 4699 | TxtReadSize, |
jmitc91516 | 0:9140ec6aa604 | 4700 | (GuiConst_INT8U*)&sgl.GuiLib_RemoteStructText); |
jmitc91516 | 0:9140ec6aa604 | 4701 | sgl.CurItem.TextOffset[J] = sgl.RemoteStructOffset; |
jmitc91516 | 0:9140ec6aa604 | 4702 | sgl.CurItem.TextPtr[J] = (GuiConst_TEXT PrefixGeneric *)&sgl.GuiLib_RemoteStructText; |
jmitc91516 | 0:9140ec6aa604 | 4703 | sgl.RemoteStructOffset += TxtSum2; |
jmitc91516 | 0:9140ec6aa604 | 4704 | #else |
jmitc91516 | 0:9140ec6aa604 | 4705 | sgl.ItemDataPtr += TxtSum1; |
jmitc91516 | 0:9140ec6aa604 | 4706 | sgl.CurItem.TextPtr[J] = (GuiConst_TEXT PrefixGeneric *)(sgl.ItemDataPtr); |
jmitc91516 | 0:9140ec6aa604 | 4707 | sgl.ItemDataPtr += TxtSum2; |
jmitc91516 | 0:9140ec6aa604 | 4708 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4709 | #endif // GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 4710 | |
jmitc91516 | 0:9140ec6aa604 | 4711 | #ifdef GuiConst_ITEM_BUTTON_INUSE |
jmitc91516 | 0:9140ec6aa604 | 4712 | if ((sgl.ItemTypeBit2 & GuiLib_ITEMBIT_BUTTON) && |
jmitc91516 | 0:9140ec6aa604 | 4713 | (((I == 0) && (sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x01)) || |
jmitc91516 | 0:9140ec6aa604 | 4714 | ((I == 1) && (sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x02)))) |
jmitc91516 | 0:9140ec6aa604 | 4715 | J++; |
jmitc91516 | 0:9140ec6aa604 | 4716 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4717 | J++; |
jmitc91516 | 0:9140ec6aa604 | 4718 | } |
jmitc91516 | 0:9140ec6aa604 | 4719 | |
jmitc91516 | 0:9140ec6aa604 | 4720 | #ifdef GuiConst_ITEM_BUTTON_INUSE |
jmitc91516 | 0:9140ec6aa604 | 4721 | if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_BUTTON) |
jmitc91516 | 0:9140ec6aa604 | 4722 | { |
jmitc91516 | 0:9140ec6aa604 | 4723 | if (sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x01) |
jmitc91516 | 0:9140ec6aa604 | 4724 | { |
jmitc91516 | 0:9140ec6aa604 | 4725 | sgl.CurItem.TextLength[1] = sgl.CurItem.TextLength[0]; |
jmitc91516 | 0:9140ec6aa604 | 4726 | sgl.CurItem.TextPtr[1] = sgl.CurItem.TextPtr[0]; |
jmitc91516 | 0:9140ec6aa604 | 4727 | |
jmitc91516 | 0:9140ec6aa604 | 4728 | #ifdef GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 4729 | sgl.CurItem.TextIndex[1] = sgl.CurItem.TextIndex[0]; |
jmitc91516 | 0:9140ec6aa604 | 4730 | #else |
jmitc91516 | 0:9140ec6aa604 | 4731 | #ifdef GuiConst_REMOTE_STRUCT_DATA |
jmitc91516 | 0:9140ec6aa604 | 4732 | sgl.CurItem.TextOffset[1] = sgl.CurItem.TextOffset[0]; |
jmitc91516 | 0:9140ec6aa604 | 4733 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4734 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4735 | |
jmitc91516 | 0:9140ec6aa604 | 4736 | } |
jmitc91516 | 0:9140ec6aa604 | 4737 | if (sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x02) |
jmitc91516 | 0:9140ec6aa604 | 4738 | { |
jmitc91516 | 0:9140ec6aa604 | 4739 | sgl.CurItem.TextLength[2] = sgl.CurItem.TextLength[0]; |
jmitc91516 | 0:9140ec6aa604 | 4740 | sgl.CurItem.TextPtr[2] = sgl.CurItem.TextPtr[0]; |
jmitc91516 | 0:9140ec6aa604 | 4741 | |
jmitc91516 | 0:9140ec6aa604 | 4742 | #ifdef GuiConst_REMOTE_TEXT_DATA |
jmitc91516 | 0:9140ec6aa604 | 4743 | sgl.CurItem.TextIndex[2] = sgl.CurItem.TextIndex[0]; |
jmitc91516 | 0:9140ec6aa604 | 4744 | #else |
jmitc91516 | 0:9140ec6aa604 | 4745 | #ifdef GuiConst_REMOTE_STRUCT_DATA |
jmitc91516 | 0:9140ec6aa604 | 4746 | sgl.CurItem.TextOffset[2] = sgl.CurItem.TextOffset[0]; |
jmitc91516 | 0:9140ec6aa604 | 4747 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4748 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4749 | } |
jmitc91516 | 0:9140ec6aa604 | 4750 | } |
jmitc91516 | 0:9140ec6aa604 | 4751 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4752 | } |
jmitc91516 | 0:9140ec6aa604 | 4753 | } |
jmitc91516 | 0:9140ec6aa604 | 4754 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 4755 | static GuiConst_INT16S VarStrCmp( |
jmitc91516 | 0:9140ec6aa604 | 4756 | GuiConst_INT8U PrefixLocate *S1, |
jmitc91516 | 0:9140ec6aa604 | 4757 | GuiConst_INT8U PrefixLocate *S2) |
jmitc91516 | 0:9140ec6aa604 | 4758 | { |
jmitc91516 | 0:9140ec6aa604 | 4759 | GuiConst_INT16S len = 0; |
jmitc91516 | 0:9140ec6aa604 | 4760 | |
jmitc91516 | 0:9140ec6aa604 | 4761 | #ifdef GuiConst_CHARMODE_ANSI |
jmitc91516 | 0:9140ec6aa604 | 4762 | do |
jmitc91516 | 0:9140ec6aa604 | 4763 | { |
jmitc91516 | 0:9140ec6aa604 | 4764 | if ((*S1 == 0) && (*S2 == 0)) |
jmitc91516 | 0:9140ec6aa604 | 4765 | return (0); |
jmitc91516 | 0:9140ec6aa604 | 4766 | |
jmitc91516 | 0:9140ec6aa604 | 4767 | else if (*S1 == 0) |
jmitc91516 | 0:9140ec6aa604 | 4768 | return (-1); |
jmitc91516 | 0:9140ec6aa604 | 4769 | else if (*S2 == 0) |
jmitc91516 | 0:9140ec6aa604 | 4770 | return (1); |
jmitc91516 | 0:9140ec6aa604 | 4771 | else if (*S1 < *S2) |
jmitc91516 | 0:9140ec6aa604 | 4772 | return (-1); |
jmitc91516 | 0:9140ec6aa604 | 4773 | else if (*S1 > *S2) |
jmitc91516 | 0:9140ec6aa604 | 4774 | return (1); |
jmitc91516 | 0:9140ec6aa604 | 4775 | S1++; |
jmitc91516 | 0:9140ec6aa604 | 4776 | S2++; |
jmitc91516 | 0:9140ec6aa604 | 4777 | } |
jmitc91516 | 0:9140ec6aa604 | 4778 | while ((len++) < GuiConst_AUTOREDRAW_MAX_VAR_SIZE); |
jmitc91516 | 0:9140ec6aa604 | 4779 | #else |
jmitc91516 | 0:9140ec6aa604 | 4780 | GuiConst_INT16U T1, T2, T3; |
jmitc91516 | 0:9140ec6aa604 | 4781 | |
jmitc91516 | 0:9140ec6aa604 | 4782 | do |
jmitc91516 | 0:9140ec6aa604 | 4783 | { |
jmitc91516 | 0:9140ec6aa604 | 4784 | T1 = *S1++; |
jmitc91516 | 0:9140ec6aa604 | 4785 | T3 = *S1++; |
jmitc91516 | 0:9140ec6aa604 | 4786 | T1 |= T3 << 8; |
jmitc91516 | 0:9140ec6aa604 | 4787 | |
jmitc91516 | 0:9140ec6aa604 | 4788 | T2 = *S2++; |
jmitc91516 | 0:9140ec6aa604 | 4789 | T3 = *S2++; |
jmitc91516 | 0:9140ec6aa604 | 4790 | T2 |= T3 << 8; |
jmitc91516 | 0:9140ec6aa604 | 4791 | |
jmitc91516 | 0:9140ec6aa604 | 4792 | if (T1 < T2) |
jmitc91516 | 0:9140ec6aa604 | 4793 | return (-1); |
jmitc91516 | 0:9140ec6aa604 | 4794 | else if (T1 > T2) |
jmitc91516 | 0:9140ec6aa604 | 4795 | return (1); |
jmitc91516 | 0:9140ec6aa604 | 4796 | else if (T1 == 0) |
jmitc91516 | 0:9140ec6aa604 | 4797 | return (0); |
jmitc91516 | 0:9140ec6aa604 | 4798 | } |
jmitc91516 | 0:9140ec6aa604 | 4799 | while ((len++) < GuiConst_AUTOREDRAW_MAX_VAR_SIZE); |
jmitc91516 | 0:9140ec6aa604 | 4800 | #endif |
jmitc91516 | 0:9140ec6aa604 | 4801 | return (1); |
jmitc91516 | 0:9140ec6aa604 | 4802 | } |
jmitc91516 | 0:9140ec6aa604 | 4803 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 4804 | void AutoRedraw_Init(void) |
jmitc91516 | 0:9140ec6aa604 | 4805 | { |
jmitc91516 | 0:9140ec6aa604 | 4806 | GuiConst_INT16S I; |
jmitc91516 | 0:9140ec6aa604 | 4807 | |
jmitc91516 | 0:9140ec6aa604 | 4808 | for (I=0;I<GuiConst_MAX_DYNAMIC_ITEMS;I++) |
jmitc91516 | 0:9140ec6aa604 | 4809 | { |
jmitc91516 | 0:9140ec6aa604 | 4810 | sgl.AutoRedraw[I].Next = -1; |
jmitc91516 | 0:9140ec6aa604 | 4811 | sgl.AutoRedraw[I].Prev = -1; |
jmitc91516 | 0:9140ec6aa604 | 4812 | sgl.AutoRedraw[I].Valid = ITEM_NONE; |
jmitc91516 | 0:9140ec6aa604 | 4813 | } |
jmitc91516 | 0:9140ec6aa604 | 4814 | |
jmitc91516 | 0:9140ec6aa604 | 4815 | sgl.AutoRedrawCount = 0; |
jmitc91516 | 0:9140ec6aa604 | 4816 | sgl.AutoRedrawFirst = -1; |
jmitc91516 | 0:9140ec6aa604 | 4817 | sgl.AutoRedrawLast = -1; |
jmitc91516 | 0:9140ec6aa604 | 4818 | sgl.AutoRedrawCount = 0; |
jmitc91516 | 0:9140ec6aa604 | 4819 | sgl.AutoRedrawParent = -1; |
jmitc91516 | 0:9140ec6aa604 | 4820 | sgl.AutoRedrawUpdate = GuiLib_FALSE; |
jmitc91516 | 0:9140ec6aa604 | 4821 | sgl.AutoRedrawInsertPoint = GuiConst_MAX_DYNAMIC_ITEMS; |
jmitc91516 | 0:9140ec6aa604 | 4822 | sgl.AutoRedrawLatest = -1; |
jmitc91516 | 0:9140ec6aa604 | 4823 | |
jmitc91516 | 0:9140ec6aa604 | 4824 | return; |
jmitc91516 | 0:9140ec6aa604 | 4825 | } |
jmitc91516 | 0:9140ec6aa604 | 4826 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 4827 | GuiConst_INT16S AutoRedraw_Reset(void) |
jmitc91516 | 0:9140ec6aa604 | 4828 | { |
jmitc91516 | 0:9140ec6aa604 | 4829 | sgl.AutoRedrawNext = sgl.AutoRedrawFirst; |
jmitc91516 | 0:9140ec6aa604 | 4830 | |
jmitc91516 | 0:9140ec6aa604 | 4831 | return sgl.AutoRedrawNext; |
jmitc91516 | 0:9140ec6aa604 | 4832 | } |
jmitc91516 | 0:9140ec6aa604 | 4833 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 4834 | GuiConst_INT16S AutoRedraw_GetNext(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 4835 | { |
jmitc91516 | 0:9140ec6aa604 | 4836 | GuiConst_INT16S N, result; |
jmitc91516 | 0:9140ec6aa604 | 4837 | |
jmitc91516 | 0:9140ec6aa604 | 4838 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 4839 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 4840 | |
jmitc91516 | 0:9140ec6aa604 | 4841 | result = -1; |
jmitc91516 | 0:9140ec6aa604 | 4842 | |
jmitc91516 | 0:9140ec6aa604 | 4843 | N = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 4844 | while ((N >= 0) && (N < GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 4845 | { |
jmitc91516 | 0:9140ec6aa604 | 4846 | if ((sgl.AutoRedraw[N].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW) |
jmitc91516 | 0:9140ec6aa604 | 4847 | { |
jmitc91516 | 0:9140ec6aa604 | 4848 | result = N; |
jmitc91516 | 0:9140ec6aa604 | 4849 | break; |
jmitc91516 | 0:9140ec6aa604 | 4850 | } |
jmitc91516 | 0:9140ec6aa604 | 4851 | else if (sgl.AutoRedraw[N].Valid == ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 4852 | break; |
jmitc91516 | 0:9140ec6aa604 | 4853 | else |
jmitc91516 | 0:9140ec6aa604 | 4854 | { |
jmitc91516 | 0:9140ec6aa604 | 4855 | N = sgl.AutoRedraw[N].Next; |
jmitc91516 | 0:9140ec6aa604 | 4856 | if ((N < 0) || (N >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 4857 | break; |
jmitc91516 | 0:9140ec6aa604 | 4858 | } |
jmitc91516 | 0:9140ec6aa604 | 4859 | } |
jmitc91516 | 0:9140ec6aa604 | 4860 | |
jmitc91516 | 0:9140ec6aa604 | 4861 | return result; |
jmitc91516 | 0:9140ec6aa604 | 4862 | } |
jmitc91516 | 0:9140ec6aa604 | 4863 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 4864 | GuiConst_INT8S AutoRedraw_ItemIsStruct(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 4865 | { |
jmitc91516 | 0:9140ec6aa604 | 4866 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 4867 | return GuiLib_FALSE; |
jmitc91516 | 0:9140ec6aa604 | 4868 | |
jmitc91516 | 0:9140ec6aa604 | 4869 | if ((sgl.AutoRedraw[I].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW) |
jmitc91516 | 0:9140ec6aa604 | 4870 | { |
jmitc91516 | 0:9140ec6aa604 | 4871 | if ((sgl.AutoRedraw[I].Item.ItemType == GuiLib_ITEM_STRUCTARRAY) || |
jmitc91516 | 0:9140ec6aa604 | 4872 | (sgl.AutoRedraw[I].Item.ItemType == GuiLib_ITEM_STRUCTCOND)) |
jmitc91516 | 0:9140ec6aa604 | 4873 | return GuiLib_TRUE; |
jmitc91516 | 0:9140ec6aa604 | 4874 | else |
jmitc91516 | 0:9140ec6aa604 | 4875 | return GuiLib_FALSE; |
jmitc91516 | 0:9140ec6aa604 | 4876 | } |
jmitc91516 | 0:9140ec6aa604 | 4877 | else |
jmitc91516 | 0:9140ec6aa604 | 4878 | return GuiLib_FALSE; |
jmitc91516 | 0:9140ec6aa604 | 4879 | } |
jmitc91516 | 0:9140ec6aa604 | 4880 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 4881 | GuiConst_INT8S AutoRedraw_GetLevel(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 4882 | { |
jmitc91516 | 0:9140ec6aa604 | 4883 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 4884 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 4885 | |
jmitc91516 | 0:9140ec6aa604 | 4886 | if ((sgl.AutoRedraw[I].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW) |
jmitc91516 | 0:9140ec6aa604 | 4887 | return sgl.AutoRedraw[I].Level; |
jmitc91516 | 0:9140ec6aa604 | 4888 | else |
jmitc91516 | 0:9140ec6aa604 | 4889 | return 0; |
jmitc91516 | 0:9140ec6aa604 | 4890 | } |
jmitc91516 | 0:9140ec6aa604 | 4891 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 4892 | GuiConst_INT16S AutoRedraw_Add(PrefixLocate GuiLib_ItemRec * PrefixLocate Item, GuiConst_INT16S Struct, GuiConst_INT8U Level) |
jmitc91516 | 0:9140ec6aa604 | 4893 | { |
jmitc91516 | 0:9140ec6aa604 | 4894 | GuiConst_INT16S I, N; |
jmitc91516 | 0:9140ec6aa604 | 4895 | |
jmitc91516 | 0:9140ec6aa604 | 4896 | I = -1; |
jmitc91516 | 0:9140ec6aa604 | 4897 | |
jmitc91516 | 0:9140ec6aa604 | 4898 | if (sgl.AutoRedrawCount < GuiConst_MAX_DYNAMIC_ITEMS) |
jmitc91516 | 0:9140ec6aa604 | 4899 | { |
jmitc91516 | 0:9140ec6aa604 | 4900 | |
jmitc91516 | 0:9140ec6aa604 | 4901 | if (sgl.AutoRedrawFirst == -1) |
jmitc91516 | 0:9140ec6aa604 | 4902 | { |
jmitc91516 | 0:9140ec6aa604 | 4903 | I = 0; |
jmitc91516 | 0:9140ec6aa604 | 4904 | sgl.AutoRedrawFirst = 0; |
jmitc91516 | 0:9140ec6aa604 | 4905 | sgl.AutoRedrawLast = -1; |
jmitc91516 | 0:9140ec6aa604 | 4906 | sgl.AutoRedrawNext = 0; |
jmitc91516 | 0:9140ec6aa604 | 4907 | } |
jmitc91516 | 0:9140ec6aa604 | 4908 | else |
jmitc91516 | 0:9140ec6aa604 | 4909 | { |
jmitc91516 | 0:9140ec6aa604 | 4910 | for (N=0;N<GuiConst_MAX_DYNAMIC_ITEMS;N++) |
jmitc91516 | 0:9140ec6aa604 | 4911 | { |
jmitc91516 | 0:9140ec6aa604 | 4912 | if (sgl.AutoRedraw[N].Valid == ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 4913 | { |
jmitc91516 | 0:9140ec6aa604 | 4914 | I = N; |
jmitc91516 | 0:9140ec6aa604 | 4915 | break; |
jmitc91516 | 0:9140ec6aa604 | 4916 | } |
jmitc91516 | 0:9140ec6aa604 | 4917 | } |
jmitc91516 | 0:9140ec6aa604 | 4918 | } |
jmitc91516 | 0:9140ec6aa604 | 4919 | |
jmitc91516 | 0:9140ec6aa604 | 4920 | if (I >= 0) |
jmitc91516 | 0:9140ec6aa604 | 4921 | { |
jmitc91516 | 0:9140ec6aa604 | 4922 | sgl.AutoRedraw[I].Next = -1; |
jmitc91516 | 0:9140ec6aa604 | 4923 | sgl.AutoRedraw[I].Prev = sgl.AutoRedrawLast; |
jmitc91516 | 0:9140ec6aa604 | 4924 | sgl.AutoRedraw[I].Valid = ITEM_AUTOREDRAW; |
jmitc91516 | 0:9140ec6aa604 | 4925 | sgl.AutoRedraw[I].Parent = sgl.AutoRedrawParent; |
jmitc91516 | 0:9140ec6aa604 | 4926 | sgl.AutoRedraw[I].Level = Level; |
jmitc91516 | 0:9140ec6aa604 | 4927 | memcpy(&sgl.AutoRedraw[I].Item, Item, sizeof(GuiLib_ItemRec)); |
jmitc91516 | 0:9140ec6aa604 | 4928 | memcpy(&sgl.AutoRedraw[I].Memory, &sgl.Memory, sizeof(ItemMemory)); |
jmitc91516 | 0:9140ec6aa604 | 4929 | |
jmitc91516 | 0:9140ec6aa604 | 4930 | if ((sgl.AutoRedrawLast >= 0) |
jmitc91516 | 0:9140ec6aa604 | 4931 | && (sgl.AutoRedrawLast < GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 4932 | sgl.AutoRedraw[sgl.AutoRedrawLast].Next = I; |
jmitc91516 | 0:9140ec6aa604 | 4933 | |
jmitc91516 | 0:9140ec6aa604 | 4934 | sgl.AutoRedrawCount++; |
jmitc91516 | 0:9140ec6aa604 | 4935 | sgl.AutoRedrawLast = I; |
jmitc91516 | 0:9140ec6aa604 | 4936 | sgl.AutoRedrawLatest = I; |
jmitc91516 | 0:9140ec6aa604 | 4937 | } |
jmitc91516 | 0:9140ec6aa604 | 4938 | |
jmitc91516 | 0:9140ec6aa604 | 4939 | } |
jmitc91516 | 0:9140ec6aa604 | 4940 | |
jmitc91516 | 0:9140ec6aa604 | 4941 | return I; |
jmitc91516 | 0:9140ec6aa604 | 4942 | } |
jmitc91516 | 0:9140ec6aa604 | 4943 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 4944 | GuiConst_INT16S AutoRedraw_Insert(PrefixLocate GuiLib_ItemRec * PrefixLocate Item, |
jmitc91516 | 0:9140ec6aa604 | 4945 | GuiConst_INT16S Struct, |
jmitc91516 | 0:9140ec6aa604 | 4946 | GuiConst_INT8U Level) |
jmitc91516 | 0:9140ec6aa604 | 4947 | { |
jmitc91516 | 0:9140ec6aa604 | 4948 | GuiConst_INT16S I, N; |
jmitc91516 | 0:9140ec6aa604 | 4949 | |
jmitc91516 | 0:9140ec6aa604 | 4950 | if ((sgl.AutoRedrawFirst == -1) || |
jmitc91516 | 0:9140ec6aa604 | 4951 | (sgl.AutoRedrawInsertPoint >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 4952 | { |
jmitc91516 | 0:9140ec6aa604 | 4953 | return AutoRedraw_Add(Item, Struct, Level); |
jmitc91516 | 0:9140ec6aa604 | 4954 | } |
jmitc91516 | 0:9140ec6aa604 | 4955 | |
jmitc91516 | 0:9140ec6aa604 | 4956 | if (sgl.AutoRedrawCount < GuiConst_MAX_DYNAMIC_ITEMS) |
jmitc91516 | 0:9140ec6aa604 | 4957 | { |
jmitc91516 | 0:9140ec6aa604 | 4958 | I = -1; |
jmitc91516 | 0:9140ec6aa604 | 4959 | |
jmitc91516 | 0:9140ec6aa604 | 4960 | for (N=0;N<GuiConst_MAX_DYNAMIC_ITEMS;N++) |
jmitc91516 | 0:9140ec6aa604 | 4961 | { |
jmitc91516 | 0:9140ec6aa604 | 4962 | if (sgl.AutoRedraw[N].Valid == ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 4963 | { |
jmitc91516 | 0:9140ec6aa604 | 4964 | I = N; |
jmitc91516 | 0:9140ec6aa604 | 4965 | break; |
jmitc91516 | 0:9140ec6aa604 | 4966 | } |
jmitc91516 | 0:9140ec6aa604 | 4967 | } |
jmitc91516 | 0:9140ec6aa604 | 4968 | } |
jmitc91516 | 0:9140ec6aa604 | 4969 | else |
jmitc91516 | 0:9140ec6aa604 | 4970 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 4971 | |
jmitc91516 | 0:9140ec6aa604 | 4972 | if (I >= 0) |
jmitc91516 | 0:9140ec6aa604 | 4973 | { |
jmitc91516 | 0:9140ec6aa604 | 4974 | if (sgl.AutoRedrawInsertPoint < 0) |
jmitc91516 | 0:9140ec6aa604 | 4975 | { |
jmitc91516 | 0:9140ec6aa604 | 4976 | sgl.AutoRedraw[I].Next = sgl.AutoRedrawFirst; |
jmitc91516 | 0:9140ec6aa604 | 4977 | sgl.AutoRedraw[I].Prev = -1; |
jmitc91516 | 0:9140ec6aa604 | 4978 | } |
jmitc91516 | 0:9140ec6aa604 | 4979 | else |
jmitc91516 | 0:9140ec6aa604 | 4980 | { |
jmitc91516 | 0:9140ec6aa604 | 4981 | sgl.AutoRedraw[I].Next = sgl.AutoRedraw[sgl.AutoRedrawInsertPoint].Next; |
jmitc91516 | 0:9140ec6aa604 | 4982 | sgl.AutoRedraw[I].Prev = sgl.AutoRedrawInsertPoint; |
jmitc91516 | 0:9140ec6aa604 | 4983 | sgl.AutoRedraw[sgl.AutoRedraw[I].Prev].Next = I; |
jmitc91516 | 0:9140ec6aa604 | 4984 | } |
jmitc91516 | 0:9140ec6aa604 | 4985 | |
jmitc91516 | 0:9140ec6aa604 | 4986 | if (sgl.AutoRedraw[I].Next != -1) |
jmitc91516 | 0:9140ec6aa604 | 4987 | sgl.AutoRedraw[sgl.AutoRedraw[I].Next].Prev = I; |
jmitc91516 | 0:9140ec6aa604 | 4988 | |
jmitc91516 | 0:9140ec6aa604 | 4989 | sgl.AutoRedraw[I].Valid = ITEM_AUTOREDRAW; |
jmitc91516 | 0:9140ec6aa604 | 4990 | sgl.AutoRedraw[I].Parent = sgl.AutoRedrawParent; |
jmitc91516 | 0:9140ec6aa604 | 4991 | sgl.AutoRedraw[I].Level = Level; |
jmitc91516 | 0:9140ec6aa604 | 4992 | |
jmitc91516 | 0:9140ec6aa604 | 4993 | memcpy(&sgl.AutoRedraw[I].Item, Item, sizeof(GuiLib_ItemRec)); |
jmitc91516 | 0:9140ec6aa604 | 4994 | memcpy(&sgl.AutoRedraw[I].Memory, &sgl.Memory, sizeof(ItemMemory)); |
jmitc91516 | 0:9140ec6aa604 | 4995 | |
jmitc91516 | 0:9140ec6aa604 | 4996 | if (sgl.AutoRedraw[I].Next == -1) |
jmitc91516 | 0:9140ec6aa604 | 4997 | sgl.AutoRedrawLast = I; |
jmitc91516 | 0:9140ec6aa604 | 4998 | |
jmitc91516 | 0:9140ec6aa604 | 4999 | if (sgl.AutoRedraw[I].Prev == -1) |
jmitc91516 | 0:9140ec6aa604 | 5000 | sgl.AutoRedrawFirst = I; |
jmitc91516 | 0:9140ec6aa604 | 5001 | |
jmitc91516 | 0:9140ec6aa604 | 5002 | sgl.AutoRedrawInsertPoint = I; |
jmitc91516 | 0:9140ec6aa604 | 5003 | sgl.AutoRedrawLatest = I; |
jmitc91516 | 0:9140ec6aa604 | 5004 | sgl.AutoRedrawCount++; |
jmitc91516 | 0:9140ec6aa604 | 5005 | } |
jmitc91516 | 0:9140ec6aa604 | 5006 | |
jmitc91516 | 0:9140ec6aa604 | 5007 | return I; |
jmitc91516 | 0:9140ec6aa604 | 5008 | } |
jmitc91516 | 0:9140ec6aa604 | 5009 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5010 | void AutoRedraw_UpdateDrawn(GuiConst_INT16S I, PrefixLocate GuiLib_ItemRec * PrefixLocate Item) |
jmitc91516 | 0:9140ec6aa604 | 5011 | { |
jmitc91516 | 0:9140ec6aa604 | 5012 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5013 | return; |
jmitc91516 | 0:9140ec6aa604 | 5014 | |
jmitc91516 | 0:9140ec6aa604 | 5015 | if (sgl.AutoRedraw[I].Valid != ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5016 | { |
jmitc91516 | 0:9140ec6aa604 | 5017 | sgl.AutoRedraw[I].Item.Drawn = Item->Drawn; |
jmitc91516 | 0:9140ec6aa604 | 5018 | sgl.AutoRedraw[I].Item.DrawnX1 = Item->DrawnX1; |
jmitc91516 | 0:9140ec6aa604 | 5019 | sgl.AutoRedraw[I].Item.DrawnY1 = Item->DrawnY1; |
jmitc91516 | 0:9140ec6aa604 | 5020 | sgl.AutoRedraw[I].Item.DrawnX2 = Item->DrawnX2; |
jmitc91516 | 0:9140ec6aa604 | 5021 | sgl.AutoRedraw[I].Item.DrawnY2 = Item->DrawnY2; |
jmitc91516 | 0:9140ec6aa604 | 5022 | } |
jmitc91516 | 0:9140ec6aa604 | 5023 | |
jmitc91516 | 0:9140ec6aa604 | 5024 | return; |
jmitc91516 | 0:9140ec6aa604 | 5025 | } |
jmitc91516 | 0:9140ec6aa604 | 5026 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5027 | void AutoRedraw_Delete(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 5028 | { |
jmitc91516 | 0:9140ec6aa604 | 5029 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5030 | return; |
jmitc91516 | 0:9140ec6aa604 | 5031 | |
jmitc91516 | 0:9140ec6aa604 | 5032 | if (sgl.AutoRedraw[I].Valid != ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5033 | { |
jmitc91516 | 0:9140ec6aa604 | 5034 | if (sgl.AutoRedrawLast == I) |
jmitc91516 | 0:9140ec6aa604 | 5035 | sgl.AutoRedrawLast = sgl.AutoRedraw[I].Prev; |
jmitc91516 | 0:9140ec6aa604 | 5036 | |
jmitc91516 | 0:9140ec6aa604 | 5037 | if (sgl.AutoRedrawFirst == I) |
jmitc91516 | 0:9140ec6aa604 | 5038 | sgl.AutoRedrawFirst = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 5039 | |
jmitc91516 | 0:9140ec6aa604 | 5040 | if (sgl.AutoRedraw[I].Prev != -1) |
jmitc91516 | 0:9140ec6aa604 | 5041 | sgl.AutoRedraw[sgl.AutoRedraw[I].Prev].Next = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 5042 | |
jmitc91516 | 0:9140ec6aa604 | 5043 | if (sgl.AutoRedraw[I].Next != -1) |
jmitc91516 | 0:9140ec6aa604 | 5044 | sgl.AutoRedraw[sgl.AutoRedraw[I].Next].Prev = sgl.AutoRedraw[I].Prev; |
jmitc91516 | 0:9140ec6aa604 | 5045 | |
jmitc91516 | 0:9140ec6aa604 | 5046 | sgl.AutoRedraw[I].Next = -1; |
jmitc91516 | 0:9140ec6aa604 | 5047 | sgl.AutoRedraw[I].Prev = -1; |
jmitc91516 | 0:9140ec6aa604 | 5048 | sgl.AutoRedraw[I].Valid = ITEM_NONE; |
jmitc91516 | 0:9140ec6aa604 | 5049 | |
jmitc91516 | 0:9140ec6aa604 | 5050 | sgl.AutoRedrawCount--; |
jmitc91516 | 0:9140ec6aa604 | 5051 | } |
jmitc91516 | 0:9140ec6aa604 | 5052 | |
jmitc91516 | 0:9140ec6aa604 | 5053 | return; |
jmitc91516 | 0:9140ec6aa604 | 5054 | } |
jmitc91516 | 0:9140ec6aa604 | 5055 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5056 | GuiConst_INT16S AutoRedraw_DeleteStruct(GuiConst_INT16S Struct_id) |
jmitc91516 | 0:9140ec6aa604 | 5057 | { |
jmitc91516 | 0:9140ec6aa604 | 5058 | GuiConst_INT16S I, N, X; |
jmitc91516 | 0:9140ec6aa604 | 5059 | |
jmitc91516 | 0:9140ec6aa604 | 5060 | I = sgl.AutoRedrawFirst; |
jmitc91516 | 0:9140ec6aa604 | 5061 | |
jmitc91516 | 0:9140ec6aa604 | 5062 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5063 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5064 | |
jmitc91516 | 0:9140ec6aa604 | 5065 | if ((Struct_id < 0) || (Struct_id >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5066 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5067 | |
jmitc91516 | 0:9140ec6aa604 | 5068 | if (sgl.AutoRedraw[Struct_id].Valid == ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5069 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5070 | |
jmitc91516 | 0:9140ec6aa604 | 5071 | while (sgl.AutoRedraw[I].Valid != ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5072 | { |
jmitc91516 | 0:9140ec6aa604 | 5073 | N = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 5074 | if (sgl.AutoRedraw[I].Parent == Struct_id) |
jmitc91516 | 0:9140ec6aa604 | 5075 | { |
jmitc91516 | 0:9140ec6aa604 | 5076 | X = AutoRedraw_DeleteStruct(I); |
jmitc91516 | 0:9140ec6aa604 | 5077 | if ((X >= 0) && (X < GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5078 | N = sgl.AutoRedraw[X].Next; |
jmitc91516 | 0:9140ec6aa604 | 5079 | } |
jmitc91516 | 0:9140ec6aa604 | 5080 | |
jmitc91516 | 0:9140ec6aa604 | 5081 | I = N; |
jmitc91516 | 0:9140ec6aa604 | 5082 | |
jmitc91516 | 0:9140ec6aa604 | 5083 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5084 | break; |
jmitc91516 | 0:9140ec6aa604 | 5085 | } |
jmitc91516 | 0:9140ec6aa604 | 5086 | |
jmitc91516 | 0:9140ec6aa604 | 5087 | sgl.AutoRedrawInsertPoint = sgl.AutoRedraw[Struct_id].Prev; |
jmitc91516 | 0:9140ec6aa604 | 5088 | |
jmitc91516 | 0:9140ec6aa604 | 5089 | AutoRedraw_Delete(Struct_id); |
jmitc91516 | 0:9140ec6aa604 | 5090 | |
jmitc91516 | 0:9140ec6aa604 | 5091 | if (sgl.AutoRedrawInsertPoint >= 0) |
jmitc91516 | 0:9140ec6aa604 | 5092 | return sgl.AutoRedrawInsertPoint; |
jmitc91516 | 0:9140ec6aa604 | 5093 | else |
jmitc91516 | 0:9140ec6aa604 | 5094 | return sgl.AutoRedrawFirst; |
jmitc91516 | 0:9140ec6aa604 | 5095 | } |
jmitc91516 | 0:9140ec6aa604 | 5096 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5097 | void AutoRedraw_Destroy(void) |
jmitc91516 | 0:9140ec6aa604 | 5098 | { |
jmitc91516 | 0:9140ec6aa604 | 5099 | GuiConst_INT16S I; |
jmitc91516 | 0:9140ec6aa604 | 5100 | |
jmitc91516 | 0:9140ec6aa604 | 5101 | for (I=0;I<GuiConst_MAX_DYNAMIC_ITEMS;I++) |
jmitc91516 | 0:9140ec6aa604 | 5102 | { |
jmitc91516 | 0:9140ec6aa604 | 5103 | sgl.AutoRedraw[I].Next = -1; |
jmitc91516 | 0:9140ec6aa604 | 5104 | sgl.AutoRedraw[I].Prev = -1; |
jmitc91516 | 0:9140ec6aa604 | 5105 | sgl.AutoRedraw[I].Valid = ITEM_NONE; |
jmitc91516 | 0:9140ec6aa604 | 5106 | } |
jmitc91516 | 0:9140ec6aa604 | 5107 | |
jmitc91516 | 0:9140ec6aa604 | 5108 | sgl.AutoRedrawCount = 0; |
jmitc91516 | 0:9140ec6aa604 | 5109 | sgl.AutoRedrawFirst = -1; |
jmitc91516 | 0:9140ec6aa604 | 5110 | sgl.AutoRedrawLast = -1; |
jmitc91516 | 0:9140ec6aa604 | 5111 | sgl.AutoRedrawCount = 0; |
jmitc91516 | 0:9140ec6aa604 | 5112 | sgl.AutoRedrawParent = -1; |
jmitc91516 | 0:9140ec6aa604 | 5113 | sgl.AutoRedrawUpdate = GuiLib_FALSE; |
jmitc91516 | 0:9140ec6aa604 | 5114 | sgl.AutoRedrawInsertPoint = GuiConst_MAX_DYNAMIC_ITEMS; |
jmitc91516 | 0:9140ec6aa604 | 5115 | sgl.AutoRedrawLatest = -1; |
jmitc91516 | 0:9140ec6aa604 | 5116 | |
jmitc91516 | 0:9140ec6aa604 | 5117 | return; |
jmitc91516 | 0:9140ec6aa604 | 5118 | } |
jmitc91516 | 0:9140ec6aa604 | 5119 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5120 | PrefixLocate GuiLib_ItemRec *AutoRedraw_GetItem(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 5121 | { |
jmitc91516 | 0:9140ec6aa604 | 5122 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5123 | return NULL; |
jmitc91516 | 0:9140ec6aa604 | 5124 | else |
jmitc91516 | 0:9140ec6aa604 | 5125 | return &sgl.AutoRedraw[I].Item; |
jmitc91516 | 0:9140ec6aa604 | 5126 | } |
jmitc91516 | 0:9140ec6aa604 | 5127 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5128 | PrefixLocate ItemMemory *AutoRedraw_GetItemMemory(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 5129 | { |
jmitc91516 | 0:9140ec6aa604 | 5130 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5131 | return NULL; |
jmitc91516 | 0:9140ec6aa604 | 5132 | else |
jmitc91516 | 0:9140ec6aa604 | 5133 | return &sgl.AutoRedraw[I].Memory; |
jmitc91516 | 0:9140ec6aa604 | 5134 | } |
jmitc91516 | 0:9140ec6aa604 | 5135 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5136 | void AutoRedraw_UpdateOnChange(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 5137 | { |
jmitc91516 | 0:9140ec6aa604 | 5138 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5139 | return; |
jmitc91516 | 0:9140ec6aa604 | 5140 | |
jmitc91516 | 0:9140ec6aa604 | 5141 | if ((sgl.AutoRedraw[I].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW) |
jmitc91516 | 0:9140ec6aa604 | 5142 | { |
jmitc91516 | 0:9140ec6aa604 | 5143 | sgl.AutoRedraw[I].ValueSize = 0; |
jmitc91516 | 0:9140ec6aa604 | 5144 | |
jmitc91516 | 0:9140ec6aa604 | 5145 | if (sgl.AutoRedraw[I].Item.UpdateType == GuiLib_UPDATE_ON_CHANGE) |
jmitc91516 | 0:9140ec6aa604 | 5146 | { |
jmitc91516 | 0:9140ec6aa604 | 5147 | if (sgl.AutoRedraw[I].Item.VarPtr != 0) |
jmitc91516 | 0:9140ec6aa604 | 5148 | { |
jmitc91516 | 0:9140ec6aa604 | 5149 | switch (sgl.AutoRedraw[I].Item.VarType) |
jmitc91516 | 0:9140ec6aa604 | 5150 | { |
jmitc91516 | 0:9140ec6aa604 | 5151 | case GuiLib_VAR_BOOL: |
jmitc91516 | 0:9140ec6aa604 | 5152 | case GuiLib_VAR_UNSIGNED_CHAR: |
jmitc91516 | 0:9140ec6aa604 | 5153 | case GuiLib_VAR_SIGNED_CHAR: |
jmitc91516 | 0:9140ec6aa604 | 5154 | sgl.AutoRedraw[I].ValueSize = 1; |
jmitc91516 | 0:9140ec6aa604 | 5155 | break; |
jmitc91516 | 0:9140ec6aa604 | 5156 | |
jmitc91516 | 0:9140ec6aa604 | 5157 | case GuiLib_VAR_UNSIGNED_INT: |
jmitc91516 | 0:9140ec6aa604 | 5158 | case GuiLib_VAR_SIGNED_INT: |
jmitc91516 | 0:9140ec6aa604 | 5159 | sgl.AutoRedraw[I].ValueSize = 2; |
jmitc91516 | 0:9140ec6aa604 | 5160 | break; |
jmitc91516 | 0:9140ec6aa604 | 5161 | |
jmitc91516 | 0:9140ec6aa604 | 5162 | case GuiLib_VAR_UNSIGNED_LONG: |
jmitc91516 | 0:9140ec6aa604 | 5163 | case GuiLib_VAR_SIGNED_LONG: |
jmitc91516 | 0:9140ec6aa604 | 5164 | case GuiLib_VAR_FLOAT: |
jmitc91516 | 0:9140ec6aa604 | 5165 | sgl.AutoRedraw[I].ValueSize = 4; |
jmitc91516 | 0:9140ec6aa604 | 5166 | break; |
jmitc91516 | 0:9140ec6aa604 | 5167 | |
jmitc91516 | 0:9140ec6aa604 | 5168 | case GuiLib_VAR_DOUBLE: |
jmitc91516 | 0:9140ec6aa604 | 5169 | sgl.AutoRedraw[I].ValueSize = 8; |
jmitc91516 | 0:9140ec6aa604 | 5170 | break; |
jmitc91516 | 0:9140ec6aa604 | 5171 | |
jmitc91516 | 0:9140ec6aa604 | 5172 | case GuiLib_VAR_COLOR: |
jmitc91516 | 0:9140ec6aa604 | 5173 | sgl.AutoRedraw[I].ValueSize = |
jmitc91516 | 0:9140ec6aa604 | 5174 | GuiConst_PIXEL_BYTE_SIZE; |
jmitc91516 | 0:9140ec6aa604 | 5175 | break; |
jmitc91516 | 0:9140ec6aa604 | 5176 | |
jmitc91516 | 0:9140ec6aa604 | 5177 | case GuiLib_VAR_STRING: |
jmitc91516 | 0:9140ec6aa604 | 5178 | sgl.AutoRedraw[I].ValueSize = |
jmitc91516 | 0:9140ec6aa604 | 5179 | GuiLib_AUTOREDRAW_MAX_VAR_SIZE; |
jmitc91516 | 0:9140ec6aa604 | 5180 | break; |
jmitc91516 | 0:9140ec6aa604 | 5181 | |
jmitc91516 | 0:9140ec6aa604 | 5182 | default: |
jmitc91516 | 0:9140ec6aa604 | 5183 | sgl.AutoRedraw[I].ValueSize = 0; |
jmitc91516 | 0:9140ec6aa604 | 5184 | } |
jmitc91516 | 0:9140ec6aa604 | 5185 | if (sgl.AutoRedraw[I].ValueSize > 0) |
jmitc91516 | 0:9140ec6aa604 | 5186 | { |
jmitc91516 | 0:9140ec6aa604 | 5187 | memcpy(&sgl.AutoRedraw[I].Value[0], |
jmitc91516 | 0:9140ec6aa604 | 5188 | sgl.AutoRedraw[I].Item.VarPtr, |
jmitc91516 | 0:9140ec6aa604 | 5189 | sgl.AutoRedraw[I].ValueSize); |
jmitc91516 | 0:9140ec6aa604 | 5190 | } |
jmitc91516 | 0:9140ec6aa604 | 5191 | } |
jmitc91516 | 0:9140ec6aa604 | 5192 | } |
jmitc91516 | 0:9140ec6aa604 | 5193 | } |
jmitc91516 | 0:9140ec6aa604 | 5194 | |
jmitc91516 | 0:9140ec6aa604 | 5195 | return; |
jmitc91516 | 0:9140ec6aa604 | 5196 | } |
jmitc91516 | 0:9140ec6aa604 | 5197 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5198 | GuiConst_INT8S RefreshColorVariable(GuiConst_INTCOLOR PrefixLocate *comp, GuiConst_INT16U idx) |
jmitc91516 | 0:9140ec6aa604 | 5199 | { |
jmitc91516 | 0:9140ec6aa604 | 5200 | GuiConst_INTCOLOR PrefixLocate *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 5201 | GuiConst_INTCOLOR ColVal; |
jmitc91516 | 0:9140ec6aa604 | 5202 | GuiConst_INT8S changed = GuiLib_FALSE; |
jmitc91516 | 0:9140ec6aa604 | 5203 | |
jmitc91516 | 0:9140ec6aa604 | 5204 | if (idx != 0xFFFF) |
jmitc91516 | 0:9140ec6aa604 | 5205 | { |
jmitc91516 | 0:9140ec6aa604 | 5206 | if (idx < GuiStruct_VarPtrCnt) |
jmitc91516 | 0:9140ec6aa604 | 5207 | { |
jmitc91516 | 0:9140ec6aa604 | 5208 | ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[idx]); |
jmitc91516 | 0:9140ec6aa604 | 5209 | if (ColVarPtr != 0) |
jmitc91516 | 0:9140ec6aa604 | 5210 | { |
jmitc91516 | 0:9140ec6aa604 | 5211 | ColVal = *ColVarPtr; |
jmitc91516 | 0:9140ec6aa604 | 5212 | if (*comp != ColVal) |
jmitc91516 | 0:9140ec6aa604 | 5213 | { |
jmitc91516 | 0:9140ec6aa604 | 5214 | *comp = ColVal; |
jmitc91516 | 0:9140ec6aa604 | 5215 | changed = GuiLib_TRUE; |
jmitc91516 | 0:9140ec6aa604 | 5216 | } |
jmitc91516 | 0:9140ec6aa604 | 5217 | } |
jmitc91516 | 0:9140ec6aa604 | 5218 | } |
jmitc91516 | 0:9140ec6aa604 | 5219 | } |
jmitc91516 | 0:9140ec6aa604 | 5220 | |
jmitc91516 | 0:9140ec6aa604 | 5221 | return changed; |
jmitc91516 | 0:9140ec6aa604 | 5222 | } |
jmitc91516 | 0:9140ec6aa604 | 5223 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5224 | GuiConst_INT8S AutoRedraw_VarChanged(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 5225 | { |
jmitc91516 | 0:9140ec6aa604 | 5226 | GuiLib_ItemRecPtr Item; |
jmitc91516 | 0:9140ec6aa604 | 5227 | GuiConst_INT16S VarChange; |
jmitc91516 | 0:9140ec6aa604 | 5228 | GuiConst_INT8S changed; |
jmitc91516 | 0:9140ec6aa604 | 5229 | |
jmitc91516 | 0:9140ec6aa604 | 5230 | changed = GuiLib_FALSE; |
jmitc91516 | 0:9140ec6aa604 | 5231 | |
jmitc91516 | 0:9140ec6aa604 | 5232 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5233 | return changed; |
jmitc91516 | 0:9140ec6aa604 | 5234 | |
jmitc91516 | 0:9140ec6aa604 | 5235 | if ((sgl.AutoRedraw[I].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW) |
jmitc91516 | 0:9140ec6aa604 | 5236 | { |
jmitc91516 | 0:9140ec6aa604 | 5237 | Item = &sgl.AutoRedraw[I].Item; |
jmitc91516 | 0:9140ec6aa604 | 5238 | if (Item->UpdateType == GuiLib_UPDATE_ON_CHANGE) |
jmitc91516 | 0:9140ec6aa604 | 5239 | { |
jmitc91516 | 0:9140ec6aa604 | 5240 | if ((Item->TextPar[0].BitFlags & GuiLib_BITFLAG_INUSE) && |
jmitc91516 | 0:9140ec6aa604 | 5241 | (Item->VarPtr != 0)) |
jmitc91516 | 0:9140ec6aa604 | 5242 | { |
jmitc91516 | 0:9140ec6aa604 | 5243 | VarChange = 0; |
jmitc91516 | 0:9140ec6aa604 | 5244 | if (sgl.AutoRedraw[I].ValueSize > 0) |
jmitc91516 | 0:9140ec6aa604 | 5245 | { |
jmitc91516 | 0:9140ec6aa604 | 5246 | if (Item->VarType == GuiLib_VAR_STRING) |
jmitc91516 | 0:9140ec6aa604 | 5247 | VarChange = VarStrCmp(&sgl.AutoRedraw[I].Value[0], |
jmitc91516 | 0:9140ec6aa604 | 5248 | (GuiConst_INT8U PrefixLocate *)Item->VarPtr); |
jmitc91516 | 0:9140ec6aa604 | 5249 | else |
jmitc91516 | 0:9140ec6aa604 | 5250 | VarChange = |
jmitc91516 | 0:9140ec6aa604 | 5251 | memcmp(&sgl.AutoRedraw[I].Value[0], |
jmitc91516 | 0:9140ec6aa604 | 5252 | Item->VarPtr, |
jmitc91516 | 0:9140ec6aa604 | 5253 | sgl.AutoRedraw[I].ValueSize); |
jmitc91516 | 0:9140ec6aa604 | 5254 | } |
jmitc91516 | 0:9140ec6aa604 | 5255 | if ((sgl.AutoRedraw[I].ValueSize == 0) || (VarChange != 0)) |
jmitc91516 | 0:9140ec6aa604 | 5256 | changed = GuiLib_TRUE; |
jmitc91516 | 0:9140ec6aa604 | 5257 | } |
jmitc91516 | 0:9140ec6aa604 | 5258 | } |
jmitc91516 | 0:9140ec6aa604 | 5259 | else |
jmitc91516 | 0:9140ec6aa604 | 5260 | changed = GuiLib_TRUE; |
jmitc91516 | 0:9140ec6aa604 | 5261 | |
jmitc91516 | 0:9140ec6aa604 | 5262 | changed |= RefreshColorVariable(&Item->ForeColor, Item->ForeColorIndex); |
jmitc91516 | 0:9140ec6aa604 | 5263 | changed |= RefreshColorVariable(&Item->BackColor, Item->BackColorIndex); |
jmitc91516 | 0:9140ec6aa604 | 5264 | changed |= RefreshColorVariable(&Item->BarForeColor, Item->BarForeColorIndex); |
jmitc91516 | 0:9140ec6aa604 | 5265 | changed |= RefreshColorVariable(&Item->BarBackColor, Item->BarBackColorIndex); |
jmitc91516 | 0:9140ec6aa604 | 5266 | |
jmitc91516 | 0:9140ec6aa604 | 5267 | #ifdef GuiConst_ITEM_RADIOBUTTON_INUSE |
jmitc91516 | 0:9140ec6aa604 | 5268 | if (Item->ItemType == GuiLib_ITEM_RADIOBUTTON) |
jmitc91516 | 0:9140ec6aa604 | 5269 | changed |= RefreshColorVariable(&Item->CompPars.CompRadioButton.MarkColor, |
jmitc91516 | 0:9140ec6aa604 | 5270 | Item->CompPars.CompRadioButton.MarkColorIndex); |
jmitc91516 | 0:9140ec6aa604 | 5271 | #endif |
jmitc91516 | 0:9140ec6aa604 | 5272 | #ifdef GuiConst_ITEM_CHECKBOX_INUSE |
jmitc91516 | 0:9140ec6aa604 | 5273 | if (Item->ItemType == GuiLib_ITEM_CHECKBOX) |
jmitc91516 | 0:9140ec6aa604 | 5274 | changed |= RefreshColorVariable(&Item->CompPars.CompCheckBox.MarkColor, |
jmitc91516 | 0:9140ec6aa604 | 5275 | Item->CompPars.CompCheckBox.MarkColorIndex); |
jmitc91516 | 0:9140ec6aa604 | 5276 | #endif |
jmitc91516 | 0:9140ec6aa604 | 5277 | #ifdef GuiConst_ITEM_BUTTON_INUSE |
jmitc91516 | 0:9140ec6aa604 | 5278 | if (Item->ItemType == GuiLib_ITEM_BUTTON) |
jmitc91516 | 0:9140ec6aa604 | 5279 | { |
jmitc91516 | 0:9140ec6aa604 | 5280 | GuiConst_INT32S state; |
jmitc91516 | 0:9140ec6aa604 | 5281 | |
jmitc91516 | 0:9140ec6aa604 | 5282 | if ((sgl.CurItem.VarPtr != 0) && |
jmitc91516 | 0:9140ec6aa604 | 5283 | (sgl.CurItem.VarType != GuiLib_VAR_STRING)) |
jmitc91516 | 0:9140ec6aa604 | 5284 | { |
jmitc91516 | 0:9140ec6aa604 | 5285 | state = ReadVar(Item->VarPtr, Item->VarType); |
jmitc91516 | 0:9140ec6aa604 | 5286 | if ((state < GuiLib_BUTTON_STATE_UP) || |
jmitc91516 | 0:9140ec6aa604 | 5287 | (state > GuiLib_BUTTON_STATE_DISABLED)) |
jmitc91516 | 0:9140ec6aa604 | 5288 | state = GuiLib_BUTTON_STATE_UP; |
jmitc91516 | 0:9140ec6aa604 | 5289 | } |
jmitc91516 | 0:9140ec6aa604 | 5290 | else |
jmitc91516 | 0:9140ec6aa604 | 5291 | state = GuiLib_BUTTON_STATE_UP; |
jmitc91516 | 0:9140ec6aa604 | 5292 | |
jmitc91516 | 0:9140ec6aa604 | 5293 | |
jmitc91516 | 0:9140ec6aa604 | 5294 | changed |= RefreshColorVariable(&Item->CompPars.CompButton.TextColor[state], |
jmitc91516 | 0:9140ec6aa604 | 5295 | Item->CompPars.CompButton.TextColorIndex[state]); |
jmitc91516 | 0:9140ec6aa604 | 5296 | |
jmitc91516 | 0:9140ec6aa604 | 5297 | changed |= RefreshColorVariable(&Item->CompPars.CompButton.GlyphIconColor[state], |
jmitc91516 | 0:9140ec6aa604 | 5298 | Item->CompPars.CompButton.GlyphIconColorIndex[state]); |
jmitc91516 | 0:9140ec6aa604 | 5299 | } |
jmitc91516 | 0:9140ec6aa604 | 5300 | #endif |
jmitc91516 | 0:9140ec6aa604 | 5301 | } |
jmitc91516 | 0:9140ec6aa604 | 5302 | |
jmitc91516 | 0:9140ec6aa604 | 5303 | return changed; |
jmitc91516 | 0:9140ec6aa604 | 5304 | } |
jmitc91516 | 0:9140ec6aa604 | 5305 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5306 | void AutoRedraw_UpdateVar(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 5307 | { |
jmitc91516 | 0:9140ec6aa604 | 5308 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5309 | return; |
jmitc91516 | 0:9140ec6aa604 | 5310 | |
jmitc91516 | 0:9140ec6aa604 | 5311 | if ((sgl.AutoRedraw[I].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW) |
jmitc91516 | 0:9140ec6aa604 | 5312 | { |
jmitc91516 | 0:9140ec6aa604 | 5313 | if (sgl.AutoRedraw[I].Item.UpdateType == GuiLib_UPDATE_ON_CHANGE) |
jmitc91516 | 0:9140ec6aa604 | 5314 | { |
jmitc91516 | 0:9140ec6aa604 | 5315 | if ((sgl.AutoRedraw[I].Item.TextPar[0].BitFlags & GuiLib_BITFLAG_INUSE) && |
jmitc91516 | 0:9140ec6aa604 | 5316 | (sgl.AutoRedraw[I].Item.VarPtr != 0)) |
jmitc91516 | 0:9140ec6aa604 | 5317 | { |
jmitc91516 | 0:9140ec6aa604 | 5318 | if (sgl.AutoRedraw[I].ValueSize > 0) |
jmitc91516 | 0:9140ec6aa604 | 5319 | { |
jmitc91516 | 0:9140ec6aa604 | 5320 | memcpy(&sgl.AutoRedraw[I].Value[0], |
jmitc91516 | 0:9140ec6aa604 | 5321 | sgl.AutoRedraw[I].Item.VarPtr, |
jmitc91516 | 0:9140ec6aa604 | 5322 | sgl.AutoRedraw[I].ValueSize); |
jmitc91516 | 0:9140ec6aa604 | 5323 | } |
jmitc91516 | 0:9140ec6aa604 | 5324 | } |
jmitc91516 | 0:9140ec6aa604 | 5325 | } |
jmitc91516 | 0:9140ec6aa604 | 5326 | } |
jmitc91516 | 0:9140ec6aa604 | 5327 | |
jmitc91516 | 0:9140ec6aa604 | 5328 | return; |
jmitc91516 | 0:9140ec6aa604 | 5329 | } |
jmitc91516 | 0:9140ec6aa604 | 5330 | |
jmitc91516 | 0:9140ec6aa604 | 5331 | #ifdef GuiConst_TEXTBOX_FIELDS_ON |
jmitc91516 | 0:9140ec6aa604 | 5332 | |
jmitc91516 | 0:9140ec6aa604 | 5333 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5334 | GuiConst_INT16S AutoRedraw_InsertTextBox(PrefixLocate GuiLib_ItemRec * PrefixLocate Item, |
jmitc91516 | 0:9140ec6aa604 | 5335 | GuiConst_INT16S Struct, |
jmitc91516 | 0:9140ec6aa604 | 5336 | GuiConst_INT8U Level) |
jmitc91516 | 0:9140ec6aa604 | 5337 | { |
jmitc91516 | 0:9140ec6aa604 | 5338 | GuiConst_INT16S I; |
jmitc91516 | 0:9140ec6aa604 | 5339 | |
jmitc91516 | 0:9140ec6aa604 | 5340 | I = AutoRedraw_Insert(Item, Struct, Level); |
jmitc91516 | 0:9140ec6aa604 | 5341 | |
jmitc91516 | 0:9140ec6aa604 | 5342 | if (I != -1) |
jmitc91516 | 0:9140ec6aa604 | 5343 | sgl.AutoRedraw[I].Valid = ITEM_TEXTBOX; |
jmitc91516 | 0:9140ec6aa604 | 5344 | |
jmitc91516 | 0:9140ec6aa604 | 5345 | return I; |
jmitc91516 | 0:9140ec6aa604 | 5346 | }//------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5347 | void AutoRedraw_SetAsTextBox(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 5348 | { |
jmitc91516 | 0:9140ec6aa604 | 5349 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5350 | return; |
jmitc91516 | 0:9140ec6aa604 | 5351 | |
jmitc91516 | 0:9140ec6aa604 | 5352 | if (sgl.AutoRedraw[I].Valid != ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5353 | sgl.AutoRedraw[I].Valid |= ITEM_TEXTBOX; |
jmitc91516 | 0:9140ec6aa604 | 5354 | |
jmitc91516 | 0:9140ec6aa604 | 5355 | return; |
jmitc91516 | 0:9140ec6aa604 | 5356 | } |
jmitc91516 | 0:9140ec6aa604 | 5357 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5358 | GuiConst_INT16S AutoRedraw_GetTextBox(GuiConst_INT8S T, GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 5359 | { |
jmitc91516 | 0:9140ec6aa604 | 5360 | if (I == -1) |
jmitc91516 | 0:9140ec6aa604 | 5361 | { |
jmitc91516 | 0:9140ec6aa604 | 5362 | I = sgl.AutoRedrawFirst; |
jmitc91516 | 0:9140ec6aa604 | 5363 | |
jmitc91516 | 0:9140ec6aa604 | 5364 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5365 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5366 | } |
jmitc91516 | 0:9140ec6aa604 | 5367 | else |
jmitc91516 | 0:9140ec6aa604 | 5368 | { |
jmitc91516 | 0:9140ec6aa604 | 5369 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5370 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5371 | |
jmitc91516 | 0:9140ec6aa604 | 5372 | if (sgl.AutoRedraw[I].Valid == ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5373 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5374 | |
jmitc91516 | 0:9140ec6aa604 | 5375 | I = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 5376 | |
jmitc91516 | 0:9140ec6aa604 | 5377 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5378 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5379 | } |
jmitc91516 | 0:9140ec6aa604 | 5380 | |
jmitc91516 | 0:9140ec6aa604 | 5381 | while (I != -1) |
jmitc91516 | 0:9140ec6aa604 | 5382 | { |
jmitc91516 | 0:9140ec6aa604 | 5383 | if (sgl.AutoRedraw[I].Valid != ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5384 | { |
jmitc91516 | 0:9140ec6aa604 | 5385 | if ((sgl.AutoRedraw[I].Valid & ITEM_TEXTBOX) == ITEM_TEXTBOX) |
jmitc91516 | 0:9140ec6aa604 | 5386 | { |
jmitc91516 | 0:9140ec6aa604 | 5387 | if (sgl.AutoRedraw[I].Item.CompPars.CompTextBox.ScrollIndex == T) |
jmitc91516 | 0:9140ec6aa604 | 5388 | break; |
jmitc91516 | 0:9140ec6aa604 | 5389 | } |
jmitc91516 | 0:9140ec6aa604 | 5390 | I = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 5391 | } |
jmitc91516 | 0:9140ec6aa604 | 5392 | else |
jmitc91516 | 0:9140ec6aa604 | 5393 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5394 | } |
jmitc91516 | 0:9140ec6aa604 | 5395 | |
jmitc91516 | 0:9140ec6aa604 | 5396 | return I; |
jmitc91516 | 0:9140ec6aa604 | 5397 | } |
jmitc91516 | 0:9140ec6aa604 | 5398 | |
jmitc91516 | 0:9140ec6aa604 | 5399 | #endif // GuiConst_TEXTBOX_FIELDS_ON |
jmitc91516 | 0:9140ec6aa604 | 5400 | #ifdef GuiConst_CURSOR_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 5401 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5402 | GuiConst_INT16S AutoRedraw_InsertCursor(PrefixLocate GuiLib_ItemRec * PrefixLocate Item, |
jmitc91516 | 0:9140ec6aa604 | 5403 | GuiConst_INT16S Struct, |
jmitc91516 | 0:9140ec6aa604 | 5404 | GuiConst_INT8U Level) |
jmitc91516 | 0:9140ec6aa604 | 5405 | { |
jmitc91516 | 0:9140ec6aa604 | 5406 | GuiConst_INT16S I; |
jmitc91516 | 0:9140ec6aa604 | 5407 | |
jmitc91516 | 0:9140ec6aa604 | 5408 | I = AutoRedraw_Insert(Item, Struct, Level); |
jmitc91516 | 0:9140ec6aa604 | 5409 | |
jmitc91516 | 0:9140ec6aa604 | 5410 | if (I != -1) |
jmitc91516 | 0:9140ec6aa604 | 5411 | sgl.AutoRedraw[I].Valid = ITEM_CURSOR; |
jmitc91516 | 0:9140ec6aa604 | 5412 | |
jmitc91516 | 0:9140ec6aa604 | 5413 | return I; |
jmitc91516 | 0:9140ec6aa604 | 5414 | } |
jmitc91516 | 0:9140ec6aa604 | 5415 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5416 | void AutoRedraw_SetAsCursor(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 5417 | { |
jmitc91516 | 0:9140ec6aa604 | 5418 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5419 | return; |
jmitc91516 | 0:9140ec6aa604 | 5420 | |
jmitc91516 | 0:9140ec6aa604 | 5421 | if (sgl.AutoRedraw[I].Valid != ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5422 | sgl.AutoRedraw[I].Valid |= ITEM_CURSOR; |
jmitc91516 | 0:9140ec6aa604 | 5423 | |
jmitc91516 | 0:9140ec6aa604 | 5424 | return; |
jmitc91516 | 0:9140ec6aa604 | 5425 | } |
jmitc91516 | 0:9140ec6aa604 | 5426 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5427 | GuiConst_INT16S AutoRedraw_IsOnlyCursor(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 5428 | { |
jmitc91516 | 0:9140ec6aa604 | 5429 | GuiConst_INT16S ret = GuiLib_FALSE; |
jmitc91516 | 0:9140ec6aa604 | 5430 | |
jmitc91516 | 0:9140ec6aa604 | 5431 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5432 | return ret; |
jmitc91516 | 0:9140ec6aa604 | 5433 | |
jmitc91516 | 0:9140ec6aa604 | 5434 | if (sgl.AutoRedraw[I].Valid == ITEM_CURSOR) |
jmitc91516 | 0:9140ec6aa604 | 5435 | ret = GuiLib_TRUE; |
jmitc91516 | 0:9140ec6aa604 | 5436 | |
jmitc91516 | 0:9140ec6aa604 | 5437 | return ret; |
jmitc91516 | 0:9140ec6aa604 | 5438 | } |
jmitc91516 | 0:9140ec6aa604 | 5439 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5440 | GuiConst_INT16S AutoRedraw_GetCursor(GuiConst_INT8S C, GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 5441 | { |
jmitc91516 | 0:9140ec6aa604 | 5442 | if (I == -1) |
jmitc91516 | 0:9140ec6aa604 | 5443 | { |
jmitc91516 | 0:9140ec6aa604 | 5444 | I = sgl.AutoRedrawFirst; |
jmitc91516 | 0:9140ec6aa604 | 5445 | |
jmitc91516 | 0:9140ec6aa604 | 5446 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5447 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5448 | } |
jmitc91516 | 0:9140ec6aa604 | 5449 | else |
jmitc91516 | 0:9140ec6aa604 | 5450 | { |
jmitc91516 | 0:9140ec6aa604 | 5451 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5452 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5453 | |
jmitc91516 | 0:9140ec6aa604 | 5454 | if (sgl.AutoRedraw[I].Valid == ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5455 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5456 | |
jmitc91516 | 0:9140ec6aa604 | 5457 | I = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 5458 | |
jmitc91516 | 0:9140ec6aa604 | 5459 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5460 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5461 | } |
jmitc91516 | 0:9140ec6aa604 | 5462 | |
jmitc91516 | 0:9140ec6aa604 | 5463 | while (I != -1) |
jmitc91516 | 0:9140ec6aa604 | 5464 | { |
jmitc91516 | 0:9140ec6aa604 | 5465 | if (sgl.AutoRedraw[I].Valid != ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5466 | { |
jmitc91516 | 0:9140ec6aa604 | 5467 | if ((sgl.AutoRedraw[I].Valid & ITEM_CURSOR) == ITEM_CURSOR) |
jmitc91516 | 0:9140ec6aa604 | 5468 | { |
jmitc91516 | 0:9140ec6aa604 | 5469 | if (sgl.AutoRedraw[I].Item.CursorFieldNo == C) |
jmitc91516 | 0:9140ec6aa604 | 5470 | break; |
jmitc91516 | 0:9140ec6aa604 | 5471 | } |
jmitc91516 | 0:9140ec6aa604 | 5472 | I = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 5473 | } |
jmitc91516 | 0:9140ec6aa604 | 5474 | else |
jmitc91516 | 0:9140ec6aa604 | 5475 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5476 | } |
jmitc91516 | 0:9140ec6aa604 | 5477 | |
jmitc91516 | 0:9140ec6aa604 | 5478 | return I; |
jmitc91516 | 0:9140ec6aa604 | 5479 | } |
jmitc91516 | 0:9140ec6aa604 | 5480 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5481 | GuiConst_INT8S AutoRedraw_GetCursorNumber(GuiConst_INT16S I) |
jmitc91516 | 0:9140ec6aa604 | 5482 | { |
jmitc91516 | 0:9140ec6aa604 | 5483 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5484 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5485 | |
jmitc91516 | 0:9140ec6aa604 | 5486 | if (sgl.AutoRedraw[I].Valid & ITEM_CURSOR) |
jmitc91516 | 0:9140ec6aa604 | 5487 | return sgl.AutoRedraw[I].Item.CursorFieldNo; |
jmitc91516 | 0:9140ec6aa604 | 5488 | |
jmitc91516 | 0:9140ec6aa604 | 5489 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5490 | } |
jmitc91516 | 0:9140ec6aa604 | 5491 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5492 | GuiConst_INT16S AutoRedraw_GetFirstCursor(void) |
jmitc91516 | 0:9140ec6aa604 | 5493 | { |
jmitc91516 | 0:9140ec6aa604 | 5494 | GuiConst_INT16S I, result; |
jmitc91516 | 0:9140ec6aa604 | 5495 | GuiConst_INT8S C; |
jmitc91516 | 0:9140ec6aa604 | 5496 | |
jmitc91516 | 0:9140ec6aa604 | 5497 | I = sgl.AutoRedrawFirst; |
jmitc91516 | 0:9140ec6aa604 | 5498 | C = 0x7F; |
jmitc91516 | 0:9140ec6aa604 | 5499 | |
jmitc91516 | 0:9140ec6aa604 | 5500 | result = -1; |
jmitc91516 | 0:9140ec6aa604 | 5501 | |
jmitc91516 | 0:9140ec6aa604 | 5502 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5503 | return result; |
jmitc91516 | 0:9140ec6aa604 | 5504 | |
jmitc91516 | 0:9140ec6aa604 | 5505 | while (I != -1) |
jmitc91516 | 0:9140ec6aa604 | 5506 | { |
jmitc91516 | 0:9140ec6aa604 | 5507 | if (sgl.AutoRedraw[I].Valid != ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5508 | { |
jmitc91516 | 0:9140ec6aa604 | 5509 | if ((sgl.AutoRedraw[I].Valid & ITEM_CURSOR) == ITEM_CURSOR) |
jmitc91516 | 0:9140ec6aa604 | 5510 | { |
jmitc91516 | 0:9140ec6aa604 | 5511 | if (sgl.AutoRedraw[I].Item.CursorFieldNo < C) |
jmitc91516 | 0:9140ec6aa604 | 5512 | { |
jmitc91516 | 0:9140ec6aa604 | 5513 | C = sgl.AutoRedraw[I].Item.CursorFieldNo; |
jmitc91516 | 0:9140ec6aa604 | 5514 | result = I; |
jmitc91516 | 0:9140ec6aa604 | 5515 | } |
jmitc91516 | 0:9140ec6aa604 | 5516 | } |
jmitc91516 | 0:9140ec6aa604 | 5517 | I = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 5518 | } |
jmitc91516 | 0:9140ec6aa604 | 5519 | else |
jmitc91516 | 0:9140ec6aa604 | 5520 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5521 | } |
jmitc91516 | 0:9140ec6aa604 | 5522 | |
jmitc91516 | 0:9140ec6aa604 | 5523 | return result; |
jmitc91516 | 0:9140ec6aa604 | 5524 | } |
jmitc91516 | 0:9140ec6aa604 | 5525 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5526 | GuiConst_INT16S AutoRedraw_GetLastCursor(void) |
jmitc91516 | 0:9140ec6aa604 | 5527 | { |
jmitc91516 | 0:9140ec6aa604 | 5528 | GuiConst_INT16S I, result; |
jmitc91516 | 0:9140ec6aa604 | 5529 | GuiConst_INT8S C; |
jmitc91516 | 0:9140ec6aa604 | 5530 | |
jmitc91516 | 0:9140ec6aa604 | 5531 | I = sgl.AutoRedrawFirst; |
jmitc91516 | 0:9140ec6aa604 | 5532 | C = 0; |
jmitc91516 | 0:9140ec6aa604 | 5533 | |
jmitc91516 | 0:9140ec6aa604 | 5534 | result = -1; |
jmitc91516 | 0:9140ec6aa604 | 5535 | |
jmitc91516 | 0:9140ec6aa604 | 5536 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5537 | return result; |
jmitc91516 | 0:9140ec6aa604 | 5538 | |
jmitc91516 | 0:9140ec6aa604 | 5539 | while (I != -1) |
jmitc91516 | 0:9140ec6aa604 | 5540 | { |
jmitc91516 | 0:9140ec6aa604 | 5541 | if (sgl.AutoRedraw[I].Valid != ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5542 | { |
jmitc91516 | 0:9140ec6aa604 | 5543 | if ((sgl.AutoRedraw[I].Valid & ITEM_CURSOR) == ITEM_CURSOR) |
jmitc91516 | 0:9140ec6aa604 | 5544 | { |
jmitc91516 | 0:9140ec6aa604 | 5545 | if (sgl.AutoRedraw[I].Item.CursorFieldNo > C) |
jmitc91516 | 0:9140ec6aa604 | 5546 | { |
jmitc91516 | 0:9140ec6aa604 | 5547 | C = sgl.AutoRedraw[I].Item.CursorFieldNo; |
jmitc91516 | 0:9140ec6aa604 | 5548 | result = I; |
jmitc91516 | 0:9140ec6aa604 | 5549 | } |
jmitc91516 | 0:9140ec6aa604 | 5550 | } |
jmitc91516 | 0:9140ec6aa604 | 5551 | I = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 5552 | } |
jmitc91516 | 0:9140ec6aa604 | 5553 | else |
jmitc91516 | 0:9140ec6aa604 | 5554 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5555 | } |
jmitc91516 | 0:9140ec6aa604 | 5556 | |
jmitc91516 | 0:9140ec6aa604 | 5557 | return result; |
jmitc91516 | 0:9140ec6aa604 | 5558 | } |
jmitc91516 | 0:9140ec6aa604 | 5559 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5560 | GuiConst_INT16S AutoRedraw_GetNextCursor(GuiConst_INT8S C) |
jmitc91516 | 0:9140ec6aa604 | 5561 | { |
jmitc91516 | 0:9140ec6aa604 | 5562 | GuiConst_INT16S I, result; |
jmitc91516 | 0:9140ec6aa604 | 5563 | GuiConst_INT8S closest; |
jmitc91516 | 0:9140ec6aa604 | 5564 | |
jmitc91516 | 0:9140ec6aa604 | 5565 | I = sgl.AutoRedrawFirst; |
jmitc91516 | 0:9140ec6aa604 | 5566 | closest = 0x7f; |
jmitc91516 | 0:9140ec6aa604 | 5567 | |
jmitc91516 | 0:9140ec6aa604 | 5568 | result = -1; |
jmitc91516 | 0:9140ec6aa604 | 5569 | |
jmitc91516 | 0:9140ec6aa604 | 5570 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5571 | return result; |
jmitc91516 | 0:9140ec6aa604 | 5572 | |
jmitc91516 | 0:9140ec6aa604 | 5573 | while (I != -1) |
jmitc91516 | 0:9140ec6aa604 | 5574 | { |
jmitc91516 | 0:9140ec6aa604 | 5575 | if (sgl.AutoRedraw[I].Valid != ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5576 | { |
jmitc91516 | 0:9140ec6aa604 | 5577 | if ((sgl.AutoRedraw[I].Valid & ITEM_CURSOR) == ITEM_CURSOR) |
jmitc91516 | 0:9140ec6aa604 | 5578 | { |
jmitc91516 | 0:9140ec6aa604 | 5579 | if ((sgl.AutoRedraw[I].Item.CursorFieldNo > C) |
jmitc91516 | 0:9140ec6aa604 | 5580 | && (sgl.AutoRedraw[I].Item.CursorFieldNo <= closest)) |
jmitc91516 | 0:9140ec6aa604 | 5581 | { |
jmitc91516 | 0:9140ec6aa604 | 5582 | closest = sgl.AutoRedraw[I].Item.CursorFieldNo; |
jmitc91516 | 0:9140ec6aa604 | 5583 | result = I; |
jmitc91516 | 0:9140ec6aa604 | 5584 | } |
jmitc91516 | 0:9140ec6aa604 | 5585 | } |
jmitc91516 | 0:9140ec6aa604 | 5586 | I = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 5587 | } |
jmitc91516 | 0:9140ec6aa604 | 5588 | else |
jmitc91516 | 0:9140ec6aa604 | 5589 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5590 | } |
jmitc91516 | 0:9140ec6aa604 | 5591 | |
jmitc91516 | 0:9140ec6aa604 | 5592 | return result; |
jmitc91516 | 0:9140ec6aa604 | 5593 | } |
jmitc91516 | 0:9140ec6aa604 | 5594 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5595 | GuiConst_INT16S AutoRedraw_GetPrevCursor(GuiConst_INT8S C) |
jmitc91516 | 0:9140ec6aa604 | 5596 | { |
jmitc91516 | 0:9140ec6aa604 | 5597 | GuiConst_INT16S I, result; |
jmitc91516 | 0:9140ec6aa604 | 5598 | GuiConst_INT8S closest; |
jmitc91516 | 0:9140ec6aa604 | 5599 | |
jmitc91516 | 0:9140ec6aa604 | 5600 | I = sgl.AutoRedrawFirst; |
jmitc91516 | 0:9140ec6aa604 | 5601 | closest = 0; |
jmitc91516 | 0:9140ec6aa604 | 5602 | |
jmitc91516 | 0:9140ec6aa604 | 5603 | result = -1; |
jmitc91516 | 0:9140ec6aa604 | 5604 | |
jmitc91516 | 0:9140ec6aa604 | 5605 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5606 | return result; |
jmitc91516 | 0:9140ec6aa604 | 5607 | |
jmitc91516 | 0:9140ec6aa604 | 5608 | while (I != -1) |
jmitc91516 | 0:9140ec6aa604 | 5609 | { |
jmitc91516 | 0:9140ec6aa604 | 5610 | if (sgl.AutoRedraw[I].Valid != ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5611 | { |
jmitc91516 | 0:9140ec6aa604 | 5612 | if ((sgl.AutoRedraw[I].Valid & ITEM_CURSOR) == ITEM_CURSOR) |
jmitc91516 | 0:9140ec6aa604 | 5613 | { |
jmitc91516 | 0:9140ec6aa604 | 5614 | if ((sgl.AutoRedraw[I].Item.CursorFieldNo < C) |
jmitc91516 | 0:9140ec6aa604 | 5615 | && (sgl.AutoRedraw[I].Item.CursorFieldNo >= closest)) |
jmitc91516 | 0:9140ec6aa604 | 5616 | { |
jmitc91516 | 0:9140ec6aa604 | 5617 | closest = sgl.AutoRedraw[I].Item.CursorFieldNo; |
jmitc91516 | 0:9140ec6aa604 | 5618 | result = I; |
jmitc91516 | 0:9140ec6aa604 | 5619 | } |
jmitc91516 | 0:9140ec6aa604 | 5620 | } |
jmitc91516 | 0:9140ec6aa604 | 5621 | I = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 5622 | } |
jmitc91516 | 0:9140ec6aa604 | 5623 | else |
jmitc91516 | 0:9140ec6aa604 | 5624 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5625 | } |
jmitc91516 | 0:9140ec6aa604 | 5626 | |
jmitc91516 | 0:9140ec6aa604 | 5627 | return result; |
jmitc91516 | 0:9140ec6aa604 | 5628 | } |
jmitc91516 | 0:9140ec6aa604 | 5629 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5630 | GuiConst_INT16S AutoRedraw_CheckCursorInheritance(GuiConst_INT16S N) |
jmitc91516 | 0:9140ec6aa604 | 5631 | { |
jmitc91516 | 0:9140ec6aa604 | 5632 | GuiConst_INT16S I, J, result; |
jmitc91516 | 0:9140ec6aa604 | 5633 | GuiConst_INT16S cursor_id; |
jmitc91516 | 0:9140ec6aa604 | 5634 | |
jmitc91516 | 0:9140ec6aa604 | 5635 | if (GuiLib_ActiveCursorFieldNo < 0) |
jmitc91516 | 0:9140ec6aa604 | 5636 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5637 | |
jmitc91516 | 0:9140ec6aa604 | 5638 | if ((N < 0) || (N >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5639 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5640 | |
jmitc91516 | 0:9140ec6aa604 | 5641 | if (sgl.AutoRedraw[N].Valid == ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5642 | return -1; |
jmitc91516 | 0:9140ec6aa604 | 5643 | |
jmitc91516 | 0:9140ec6aa604 | 5644 | I = sgl.AutoRedraw[N].Parent; |
jmitc91516 | 0:9140ec6aa604 | 5645 | result = 1; |
jmitc91516 | 0:9140ec6aa604 | 5646 | |
jmitc91516 | 0:9140ec6aa604 | 5647 | while (result == 1) |
jmitc91516 | 0:9140ec6aa604 | 5648 | { |
jmitc91516 | 0:9140ec6aa604 | 5649 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5650 | { |
jmitc91516 | 0:9140ec6aa604 | 5651 | result = -1; |
jmitc91516 | 0:9140ec6aa604 | 5652 | break; |
jmitc91516 | 0:9140ec6aa604 | 5653 | } |
jmitc91516 | 0:9140ec6aa604 | 5654 | |
jmitc91516 | 0:9140ec6aa604 | 5655 | if (sgl.AutoRedraw[I].Valid != ITEM_NONE) |
jmitc91516 | 0:9140ec6aa604 | 5656 | { |
jmitc91516 | 0:9140ec6aa604 | 5657 | if ((sgl.AutoRedraw[I].Valid & ITEM_CURSOR) == ITEM_CURSOR) |
jmitc91516 | 0:9140ec6aa604 | 5658 | { |
jmitc91516 | 0:9140ec6aa604 | 5659 | cursor_id = sgl.AutoRedraw[I].Item.CursorFieldNo; |
jmitc91516 | 0:9140ec6aa604 | 5660 | |
jmitc91516 | 0:9140ec6aa604 | 5661 | if (cursor_id == GuiLib_ActiveCursorFieldNo) |
jmitc91516 | 0:9140ec6aa604 | 5662 | { |
jmitc91516 | 0:9140ec6aa604 | 5663 | result = 0; |
jmitc91516 | 0:9140ec6aa604 | 5664 | break; |
jmitc91516 | 0:9140ec6aa604 | 5665 | } |
jmitc91516 | 0:9140ec6aa604 | 5666 | } |
jmitc91516 | 0:9140ec6aa604 | 5667 | J = sgl.AutoRedraw[I].Parent; |
jmitc91516 | 0:9140ec6aa604 | 5668 | if (J == I) |
jmitc91516 | 0:9140ec6aa604 | 5669 | result = -1; |
jmitc91516 | 0:9140ec6aa604 | 5670 | I = J; |
jmitc91516 | 0:9140ec6aa604 | 5671 | } |
jmitc91516 | 0:9140ec6aa604 | 5672 | else |
jmitc91516 | 0:9140ec6aa604 | 5673 | { |
jmitc91516 | 0:9140ec6aa604 | 5674 | result = -1; |
jmitc91516 | 0:9140ec6aa604 | 5675 | break; |
jmitc91516 | 0:9140ec6aa604 | 5676 | } |
jmitc91516 | 0:9140ec6aa604 | 5677 | |
jmitc91516 | 0:9140ec6aa604 | 5678 | } |
jmitc91516 | 0:9140ec6aa604 | 5679 | |
jmitc91516 | 0:9140ec6aa604 | 5680 | return result; |
jmitc91516 | 0:9140ec6aa604 | 5681 | } |
jmitc91516 | 0:9140ec6aa604 | 5682 | //------------------------------------------------------------------------------ |
jmitc91516 | 0:9140ec6aa604 | 5683 | void AutoRedraw_ResetCursor(void) |
jmitc91516 | 0:9140ec6aa604 | 5684 | { |
jmitc91516 | 0:9140ec6aa604 | 5685 | GuiConst_INT16S I; |
jmitc91516 | 0:9140ec6aa604 | 5686 | |
jmitc91516 | 0:9140ec6aa604 | 5687 | I = sgl.AutoRedrawFirst; |
jmitc91516 | 0:9140ec6aa604 | 5688 | |
jmitc91516 | 0:9140ec6aa604 | 5689 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5690 | return; |
jmitc91516 | 0:9140ec6aa604 | 5691 | |
jmitc91516 | 0:9140ec6aa604 | 5692 | while ((sgl.AutoRedraw[I].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW) |
jmitc91516 | 0:9140ec6aa604 | 5693 | { |
jmitc91516 | 0:9140ec6aa604 | 5694 | sgl.AutoRedraw[I].Item.CursorFieldNo = GuiLib_NO_CURSOR; |
jmitc91516 | 0:9140ec6aa604 | 5695 | |
jmitc91516 | 0:9140ec6aa604 | 5696 | I = sgl.AutoRedraw[I].Next; |
jmitc91516 | 0:9140ec6aa604 | 5697 | if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS)) |
jmitc91516 | 0:9140ec6aa604 | 5698 | break; |
jmitc91516 | 0:9140ec6aa604 | 5699 | } |
jmitc91516 | 0:9140ec6aa604 | 5700 | |
jmitc91516 | 0:9140ec6aa604 | 5701 | return; |
jmitc91516 | 0:9140ec6aa604 | 5702 | } |
jmitc91516 | 0:9140ec6aa604 | 5703 | #endif // GuiConst_CURSOR_SUPPORT_ON |
jmitc91516 | 0:9140ec6aa604 | 5704 |