File size: 8,074 Bytes
40c7241 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | {
"RGB Color": {
"prefix": ["GET_COLOR", "color", "rgb"],
"body": ["GET_COLOR(0x${1:00}, 0x${2:00}, 0x${3:00})"],
"description": "Generate RGB Color from RGB format"
},
"Draw GUI Display Screen": {
"prefix": ["Draw", "GUI", "screen", "display"],
"body": [
"func Draw${1:SreenName}(ctx: &EG_userContext_t) {\n",
"\tGUI_createContext() $$\n",
"\t${2}",
"\tset_font(FONT_DEFAULT) $$",
"\tset_color(COLOR_BLACK, GET_COLOR(255, 255, 255)) $$\n",
"\tlayout(20, 1) $",
"\t{",
"\t\tlabel(\"Hello, World\", GUI_ALIGN_CENTER) $$",
"\t}\n",
"\tlayout(80, 1) $",
"\t{",
"\t\tlist(20, true) $",
"\t\t{",
"\t\t\trow(false, [60, 40]) $",
"\t\t\t{",
"\t\t\t\tlabel(\"param: \", GUI_ALIGN_CENTER) $$\n",
"\t\t\t\tinput_int(variable, minVal, maxVal, GUI_ALIGN_LEFT, isEditable) $$",
"\t\t\t}",
"\t\t}",
"\t}",
"}\n"
],
"description": "Draw GUI Screen"
},
"Empty Draw GUI Display Screen": {
"prefix": ["Draw", "GUI", "screen", "display"],
"body": [
"func Draw${1:SreenName}(ctx: &EG_userContext_t) {\n",
"\tGUI_createContext() $$\n",
"\t${2}",
"}\n"
],
"description": "Draw GUI Screen"
},
"GUI Button Handler": {
"prefix": ["Button", "GUI", "Handler"],
"body": [
"GUI_buttonHandler( BUTTON_${1:ESC/ENTER/LEFT/RIGHT/UP/DOWN}, $(${2:isPressed}) {",
"\tif ${3:isPressed} {",
"\t\t${4}",
"\t}",
"})"
],
"description": "GUI Button Handler"
},
"GUI lebel": {
"prefix": ["label", "GUI"],
"body": [
"label(\"${1:text}\", GUI_ALIGN_${2:LEFT/RIGHT/CENTER}) $$"
],
"description": "label for GUI"
},
"GUI dynamic lebel": {
"prefix": ["label", "dyn", "GUI"],
"body": [
"dyn_label(`${1:text}`, GUI_ALIGN_${2:LEFT/RIGHT/CENTER}) $$"
],
"description": "dynamic label for GUI"
},
"GUI input int": {
"prefix": ["input", "GUI", "int"],
"body": [
"input_int(${1:variable}, ${2:minVal}, ${3:maxVal}, GUI_ALIGN_${4:LEFT/RIGHT/CENTER}, ${5:isEditable}) $$"
],
"description": "input int for GUI"
},
"GUI input float": {
"prefix": ["input", "GUI", "float", "fp32"],
"body": [
"input_float(${1:variable}, ${2:minVal}, ${3:maxVal}, ${4:PercentCount}, GUI_ALIGN_${5:LEFT/RIGHT/CENTER}, ${6:isEditable}) $$"
],
"description": "input int for GUI"
},
"GUI combo_box with vals": {
"prefix": ["input", "GUI", "combo_box", "combo"],
"body": [
"combo_box(${1:variable}, ${2:color}, ${3:[\"label_one\", \"two\"]}, ${4:[val1, val2]}, ${5:isEditable}) $$"
],
"description": "combo box for GUI with array of vals"
},
"GUI combo_box with size": {
"prefix": ["input", "GUI", "combo_box", "combo"],
"body": [
"combo_box(${1:variable}, ${2:color}, ${3:[\"label_one\", \"two\"]}, ${4:elementsCount}, ${5:isEditable}) $$"
],
"description": "combo box for GUI with size"
},
"GUI combo_box": {
"prefix": ["input", "GUI", "combo_box", "combo"],
"body": [
"combo_box(${1:variable}, ${2:color}, ${3:[\"label_one\", \"two\"]}, ${4:isEditable}) $$"
],
"description": "combo box for GUI"
},
"GUI switcher": {
"prefix": ["GUI", "switcher"],
"body": [
"switcher(${1:variable}, ${2:bitPos}) $$"
],
"description": "bit switcher"
},
"GUI fill color": {
"prefix": ["GUI", "fill"],
"body": [
"fill(${1:color}) $$"
],
"description": "GUI fill with color"
},
"GUI_setDraw": {
"prefix": ["GUI", "draw", "GUI_setDraw"],
"body": [
"GUI_setDraw(${1:DrawSceenName})"
],
"description": "GUI set current screen for draw"
},
"GUI set color": {
"prefix": ["GUI", "set_color"],
"body": [
"set_color(${1:textColor}, ${2:backgroundColor}) $$"
],
"description": "GUI set colors for current context"
},
"GUI set font": {
"prefix": ["GUI", "set_font", "font"],
"body": [
"set_font(${1:fontName}) $$"
],
"description": "GUI set font for current context"
},
"GUI draw image": {
"prefix": ["GUI", "draw", "image"],
"body": [
"image(${1:imageName}, ${2:isAspectRatio}) $$"
],
"description": "GUI draw image"
},
"GUI draw button image": {
"prefix": ["GUI", "draw", "button", "image"],
"body": [
"image(${1:imageName}, $(isButtonClick) {",
"\tif isButtonClick {",
"\t\t ${2:toDo...}",
"\t}",
"}, ${4:isAspectRatio}) $$"
],
"description": "GUI draw button image"
},
"GUI draw animation": {
"prefix": ["GUI", "draw", "animation"],
"body": [
"animation(${1:[img1, img2]}, ${2:[duration1, duration2]/duration}, ${3:isEnableAnim}, ${4:firstFrameId}, ${5:lastFrameId}, ${6:isAspectRatio}) $$"
],
"description": "GUI draw animation"
},
"GUI draw button": {
"prefix": ["GUI", "draw", "button"],
"body": [
"button(${1:label}, ${2:bgColor}, ${3:RoundingOfEdges(%)} $(isButtonClick) {",
"\tif isButtonClick {",
"\t\t ${4:toDo...}",
"\t}",
"}) $$"
],
"description": "GUI draw button"
},
"GUI draw list": {
"prefix": ["GUI", "draw", "list"],
"body": [
"list(${1:rowsHight(%)}, ${2:isShowPos}) $",
"{",
"\trow(${3:isHideRow}, ${4:cols/[col1_width(%), col2(%), ...]}) $",
"\t{",
"\t\t${5}",
"\t}",
"}"
],
"description": "GUI draw list"
},
"GUI draw row": {
"prefix": ["GUI", "draw", "row"],
"body": [
"row(${1:isHideRow}, ${2:cols/[col1_width(%), col2(%), ...]}) $",
"{",
"\t${3}",
"}"
],
"description": "GUI draw list row"
},
"GUI set border element": {
"prefix": ["border", "GUI"],
"body": [
"set_borders(${1:color}) $$"
],
"description": "GUI set borders for element (f.e: button)"
},
"GUI set unit for input": {
"prefix": ["unit", "GUI"],
"body": [
"set_unit(${1:\"%\"}) $$"
],
"description": "GUI set unit for input element"
},
"GUI draw layout": {
"prefix": ["layout", "draw", "GUI"],
"body": [
"layout(${1:rowHight(%)}, ${2:colsCount/[col1_width(%), col2(%), ...]}) $",
"{",
"\t${3}",
"}"
],
"description": "GUI set layout"
},
"GUI draw flow layout": {
"prefix": ["flow_layout", "flow", "layout", "draw", "GUI"],
"body": [
"flow_layout(${1:xPos(%)}, ${2:yPos(%)}, ${3:rowHight(%)}, ${4:colsCount/[col1_width(%), col2(%), ...]}) $",
"{",
"\t${3}",
"}"
],
"description": "GUI set flow layout"
},
"GUI draw fixed layout": {
"prefix": ["fixed_layout", "fixed", "layout", "draw", "GUI"],
"body": [
"fixed_layout(${1:xPos(pixels)}, ${2:yPos}, ${3:rowHight}, ${4:colsCount/[col1_width(pixels), col2, ...]}) $",
"{",
"\t${3}",
"}"
],
"description": "GUI set layout with pixels dimension"
},
"GUI draw fixed flow layout": {
"prefix": ["fixed_flow_layout", "fixed", "flow", "layout", "draw", "GUI"],
"body": [
"fixed_flow_layout(${1:xPos(pixels)}, ${2:yPos}, ${3:rowHight}, ${4:colsCount/[col1_width(pixels), col2, ...]}) $",
"{",
"\t${3}",
"}"
],
"description": "GUI set flow layout with pixels dimension"
},
"GUI input is Applied": {
"prefix": ["GUI", "guiCheck", "isApplied"],
"body": [
"ctx.isApplied() {",
"\t${1}",
"}"
],
"description": "GUI check: last input is not canceled"
},
"GUI least one input is Applied": {
"prefix": ["GUI", "guiCheck", "isApplied", "isLeastOne"],
"body": [
"ctx.isLeastOneValueApplied() {",
"\t${1}",
"}"
],
"description": "GUI check: least one input is not canceled"
},
"GUI input value is changed": {
"prefix": ["GUI", "guiCheck", "isChanged"],
"body": [
"ctx.isValueChanged() {",
"\t${1}",
"}"
],
"description": "GUI check: last input value is changed"
},
"GUI least one input value is changed": {
"prefix": ["GUI", "guiCheck", "isChanged", "isLeastOne"],
"body": [
"ctx.isLeastOneValueChanged() {",
"\t${1}",
"}"
],
"description": "GUI check: least one input value is changed"
}
} |