/lib/sci.ahk
AutoHotKey | 2820 lines | 490 code | 191 blank | 2139 comment | 21 complexity | 2728862b27df57b342fabef7e1f2edee MD5 | raw file
1; Title: Scintilla Wrapper for AHK 2 3; Group: Helper Functions 4 5/* 6 Function: Add 7 Creates a Scintilla component and adds it to the Parent GUI. 8 9 This function initializes the Scintilla Component. 10 See <http://www.scintilla.org/Steps.html> for more information on how to add the component to a GUI/Control. 11 12 Parameters: 13 SCI_Add(hParent, [x, y, w, h, Styles, MsgHandler, DllPath]) 14 15 hParent - Hwnd of the parent control who will host the Scintilla Component 16 x - x position for the control (default 5) 17 y - y position for the control (default 15) 18 w - Width of the control (default 390) 19 h - Height of the control (default 270) 20 Styles - List of window style variable names separated by spaces. 21 The WS_ prefix for the variables is optional. 22 Full list of Style names can be found at 23 <http://msdn.microsoft.com/en-us/library/ms632600%28v=vs.85%29.aspx>. 24 25 MsgHandler - Name of the function that will handle the window messages sent by the control. 26 This is very useful for when creating personalized lexing or folding for your control. 27 DllPath - Path to the SciLexer.dll file, if omitted the function looks for it in *a_scriptdir*. 28 29 Returns: 30 HWND - Component handle. 31 32 Examples: 33 (start code) 34 ; Add a component with default values. 35 ; It expects scilexer.dll to be on the script's location. 36 ; The default values are calculated to fit optimally on a 400x300 GUI/Control 37 38 Gui +LastFound 39 hwnd:=WinExist() 40 hSci:=SCI_Add(hwnd) 41 Gui, show, w400 h300 42 return 43 44 ;--------------------- 45 ; Add a component with default values. 46 ; It expects scilexer.dll to be on the script's location. 47 ; This script also adds some styles. 48 ; If variables "x,y,w,h" are empty the default values are used. 49 50 Gui +LastFound 51 hwnd:=WinExist() 52 hSci:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_BORDER WS_VISIBLE") 53 Gui, show, w400 h300 54 return 55 56 ;--------------------- 57 ; Add a component embedded in a tab with additional code for 58 ; hiding/showing the component depending on which tab is open. 59 ; If variables "x,w,h" are empty the default values are used. 60 61 Gui, add, Tab2, HWNDhwndtab x0 y0 w400 h300 gtabHandler vtabLast,one|two 62 hSci:=SCI_Add(hwndtab,x,25,w,h,"Child Border Visible","",a_desktop "\scilexer.dll") 63 Gui, show, w400 h300 64 return 65 66 tabHandler: ; Tab Handler for the Scintilla Control 67 Gui, submit, Nohide 68 action := tabLast = "one" ? "Show" : "Hide" ; decide which action to take 69 Control,%action%,,,ahk_id %hSci% 70 return 71 (end) 72*/ 73SCI_Add(hParent, x=5, y=15, w=390, h=270, Styles="", MsgHandler="", DllPath=""){ 74 static WS_OVERLAPPED:=0x00000000,WS_POPUP:=0x80000000,WS_CHILD:=0x40000000,WS_MINIMIZE:=0x20000000 75 ,WS_VISIBLE:=0x10000000,WS_DISABLED:=0x08000000,WS_CLIPSIBLINGS:=0x04000000,WS_CLIPCHILDREN:=0x02000000 76 ,WS_MAXIMIZE:=0x01000000,WS_CAPTION:=0x00C00000,WS_BORDER:=0x00800000,WS_DLGFRAME:=0x00400000 77 ,WS_VSCROLL:=0x00200000,WS_HSCROLL:=0x00100000,WS_SYSMENU:=0x00080000,WS_THICKFRAME:=0x00040000 78 ,WS_GROUP:=0x00020000,WS_TABSTOP:=0x00010000,WS_MINIMIZEBOX:=0x00020000,WS_MAXIMIZEBOX:=0x00010000 79 ,WS_TILED:=0x00000000,WS_ICONIC:=0x20000000,WS_SIZEBOX:=0x00040000,WS_EX_CLIENTEDGE:=0x00000200 80 ,GuiID:=311210,init:=False, NULL:=0 81 82 if !init ; WM_NOTIFY = 0x4E 83 old:=OnMessage(0x4E,"SCI_onNotify"),init:=True,old!="SCI_onNotify" ? SCI("oldNotify", RegisterCallback(old)) 84 85 if !SCIModule:=DllCall("LoadLibrary", "Str", DllPath ? DllPath : "SciLexer.dll") 86 return debug ? A_ThisFunc "> Could not load library: " DllPath : -1 87 88 hStyle := WS_CHILD | (VISIBILITY := InStr(Styles, "Hidden") ? 0 : WS_VISIBLE) | WS_TABSTOP 89 90 if Styles 91 Loop, Parse, Styles, %a_tab%%a_space%, %a_tab%%a_space% 92 hStyle |= %a_loopfield%+0 ? %a_loopfield% : WS_%a_loopfield% ? WS_%a_loopfield% : 0 93 94 hSci:=DllCall("CreateWindowEx" 95 ,Uint ,WS_EX_CLIENTEDGE ; Ex Style 96 ,Str ,"Scintilla" ; Class Name 97 ,Str ,"" ; Window Name 98 ,UInt ,hStyle ; Window Styles 99 ,Int ,x ? x : 5 ; x 100 ,Int ,y ? y : 15 ; y 101 ,Int ,w ? w : 390 ; Width 102 ,Int ,h ? h : 270 ; Height 103 ,UInt ,hParent ; Parent HWND 104 ,UInt ,GuiID ; (HMENU)GuiID 105 ,UInt ,NULL ; hInstance 106 ,UInt ,NULL, "UInt") ; lpParam 107 108 ,SCI(hSci, True) ; used to check if that handle exist. 109 ,SCI_sendEditor(hSci) ; initialize SCI_sendEditor function 110 ,IsFunc(MsgHandler) ? SCI(hSci "MsgHandler", MsgHandler) 111 112 return hSci 113} 114 115/* Group: Text 116 Group of funtions that handle the text in the scintilla component. 117 118 <http://www.scintilla.org/ScintillaDoc.html#TextRetrievalAndModification> 119 120 Each byte in a Scintilla document is followed by an associated byte of styling information. The combination of 121 a character byte and a style byte is called a cell. Style bytes are interpreted an index into an array of 122 styles. 123 124 Style bytes may be split into an index and a set of indicator bits but this use is discouraged and indicators 125 should now use *SCI_INDICATORFILLRANGE* and related calls. The default split is with the index in the low 5 126 bits and 3 high bits as indicators. This allows 32 fundamental styles, which is enough for most languages, and 127 three independent indicators so that, for example, syntax errors, deprecated names and bad indentation could 128 all be displayed at once. The number of bits used for styles can be altered with *SCI_SETSTYLEBITS* up to a 129 maximum of 8 bits. The remaining bits can be used for indicators. 130 131 In this document, 'character' normally refers to a byte even when multi-byte characters are used. Lengths 132 measure the numbers of bytes, not the amount of characters in those bytes. 133 134 Positions within the Scintilla document refer to a character or the gap before that character. The first 135 character in a document is 0, the second 1 and so on. If a document contains nLen characters, the last 136 character is numbered nLen-1. The caret exists between character positions and can be located from before the 137 first character (0) to after the last character (nLen). 138 139 There are places where the caret can not go where two character bytes make up one character. This occurs when a 140 DBCS character from a language like Japanese is included in the document or when line ends are marked with the 141 CP/M standard of a carriage return followed by a line feed. The *INVALID_POSITION* constant (-1) represents an 142 invalid position within the document. 143 144 All lines of text in Scintilla are the same height, and this height is calculated from the largest font in any 145 current style. This restriction is for performance; if lines differed in height then calculations involving 146 positioning of text would require the text to be styled first. 147*/ 148 149; Group: General Text Functions 150 151/* 152 Function: ReplaceSel 153 <http://www.scintilla.org/ScintillaDoc.html#SCI_REPLACESEL> 154 155 The currently selected text between the anchor and the current position is replaced by the 0 terminated text 156 string. If the anchor and current position are the same, the text is inserted at the caret position. The caret 157 is positioned after the inserted text and the caret is scrolled into view. 158 159 Parameters: 160 SCI_ReplaceSel(rStr[, hwnd]) 161 162 rStr - String of text to use for replacing the current selection. 163 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 164 Scintilla components in the same script. The wrapper will remember the last used hwnd, 165 so you can specify it once and only specify it again when you want to operate on a different 166 component. 167 168 Returns: 169 Zero - Nothing is returned by this function. 170 171 Examples: 172 >SCI_ReplaceSel("replace currently selected text with this", hSci) 173*/ 174SCI_ReplaceSel(rStr, hwnd=0){ 175 176 a_isunicode ? (VarSetCapacity(rStrA, StrPut(rStr, "CP0")), StrPut(rStr, &rStrA, "CP0")) 177 return SCI_sendEditor(hwnd, "SCI_REPLACESEL", 0, a_isunicode ? &rStrA : &rStr) 178} 179 180/* 181 Function: Allocate 182 <http://www.scintilla.org/ScintillaDoc.html#SCI_ALLOCATE> 183 184 Allocate a document buffer large enough to store a given number of bytes. The document will not be made 185 smaller than its current contents. 186 187 Parameters: 188 SCI_Allocate(nBytes[, hwnd]) 189 190 nBytes - Number of bytes to allocate for the document buffer. 191 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 192 Scintilla components in the same script. The wrapper will remember the last used hwnd, 193 so you can specify it once and only specify it again when you want to operate on a different 194 component. 195 196 Returns: 197 Zero - Nothing is returned by this function. 198 199 Examples: 200 >SCI_Allocate(1024, hSci) 201*/ 202SCI_Allocate(nBytes, hwnd=0){ 203 204 return SCI_sendEditor(hwnd, "SCI_ALLOCATE", nBytes) 205} 206 207/* 208 Function: AddText 209 <http://www.scintilla.org/ScintillaDoc.html#SCI_ADDTEXT> 210 211 This inserts the first *len* characters from the string *aStr* at the current position. 212 The current position is set at the end of the inserted text, but it is *not* scrolled into view. 213 214 Parameters: 215 SCI_AddText(aStr[, len, hwnd]) 216 217 aStr - The string to be added to the component at current caret position. 218 len - Lenght of the string that will be added to the component. If 0 or blank it will be calculated 219 automatically using StrLen() 220 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 221 Scintilla components in the same script. The wrapper will remember the last used hwnd, 222 so you can specify it once and only specify it again when you want to operate on a different 223 component. 224 225 Returns: 226 Zero - Nothing is returned by this function. 227 228 Examples: 229 (start code) 230 #include ../SCI.ahk 231 232 Gui +LastFound 233 hwnd:=WinExist() 234 hSci1:=SCI_Add(hwnd, x, y, w, h) 235 Gui, show, w400 h300 236 SCI_SetWrapMode(True, hSci1) 237 SCI_AddText(x:="my text",StrLen(x), hSci) 238 return 239 ;--------------------- 240 241 #include ../SCI.ahk 242 243 Gui +LastFound 244 hwnd:=WinExist() 245 hSci1:=SCI_Add(hwnd, x, y, w, h) 246 Gui, show, w400 h300 247 SCI_SetWrapMode(True, hSci1) 248 249 ; stores "This is my truncated text". 250 SCI_AddText("This is my truncated text, this is not added!",25) 251 return 252 ;--------------------- 253 254 #include ../SCI.ahk 255 256 Gui +LastFound 257 hwnd:=WinExist() 258 hSci1:=SCI_Add(hwnd, x, y, w, h) 259 Gui, show, w400 h300 260 SCI_SetWrapMode(True, hSci1) 261 262 ; In this example the whole text is stored because the length is calculated internally. 263 SCI_AddText("This is my truncated text, this is added!") 264 return 265 (end) 266*/ 267SCI_AddText(aStr, len=0, hwnd=0){ 268 269 a_isunicode ? (VarSetCapacity(aStrA, StrPut(aStr, "CP0")), StrPut(aStr, &aStrA, "CP0")) 270 return SCI_sendEditor(hwnd, "SCI_ADDTEXT", len ? len : strLen(aStr), a_isunicode ? &aStrA : &aStr) 271} 272 273; /* needs work 274 ; Function: AddStyledText 275 ; <http://www.scintilla.org/ScintillaDoc.html#SCI_ADDSTYLEDTEXT> 276 277 ; This behaves just like <AddText()>, but inserts styled text. 278 279 ; Parameters: 280 ; SCI_AddText(cell[, len, hwnd]) 281 282 ; cell - The styled string cell to be added to the component at current caret position. 283 ; len - lenght of the string that will be added to the component. If 0 or blank it will be calculated 284 ; automatically using StrLen() 285 ; hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 286 ; Scintilla components in the same script. The wrapper will remember the last used hwnd, 287 ; so you can specify it once and only specify it again when you want to operate on a different 288 ; component. 289 290 ; Returns: 291 ; Zero - Nothing is returned by this function. 292 293 ; Examples: 294; */ 295; SCI_AddStyledText(cell, len=0, hwnd=0){ 296 297 ; a_isunicode ? (VarSetCapacity(cellA, StrPut(cell, "CP0")), StrPut(cell, &cellA, "CP0")) 298 ; return SCI_sendEditor(hwnd, "SCI_ADDSTYLEDTEXT", len ? len : strLen(cell), a_isunicode ? &cellA : &cell) 299; } 300 301/* 302 Function: AppendText 303 <http://www.scintilla.org/ScintillaDoc.html#SCI_APPENDTEXT> 304 305 This adds the first *len* characters from the string *aStr* to the end of the document. 306 The current selection is not changed and the new text is *not* scrolled into view. 307 308 Parameters: 309 SCI_AppendText(aStr[, len, hwnd]) 310 311 aStr - The string to be appended to the end of the current document on the selected component. 312 len - Lenght of the string that will be added to the component. If 0 or blank it will be calculated 313 automatically using StrLen() 314 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 315 Scintilla components in the same script. The wrapper will remember the last used hwnd, 316 so you can specify it once and only specify it again when you want to operate on a different 317 component. 318 319 Returns: 320 Zero - Nothing is returned by this function. 321 322 Examples: 323 (start code) 324 #include ../SCI.ahk 325 326 Gui +LastFound 327 hwnd:=WinExist() 328 hSci1:=SCI_Add(hwnd, x, y, w, h) 329 Gui, show, w400 h300 330 SCI_SetWrapMode(True, hSci1) 331 SCI_AppendText(x:="my text",StrLen(x), hSci) 332 return 333 ;--------------------- 334 335 #include ../SCI.ahk 336 337 Gui +LastFound 338 hwnd:=WinExist() 339 hSci1:=SCI_Add(hwnd, x, y, w, h) 340 Gui, show, w400 h300 341 SCI_SetWrapMode(True, hSci1) 342 343 ; stores "This is my truncated text". 344 SCI_AppendText("This is my truncated text, this is not added!",25) 345 return 346 ;--------------------- 347 348 #include ../SCI.ahk 349 350 Gui +LastFound 351 hwnd:=WinExist() 352 hSci1:=SCI_Add(hwnd, x, y, w, h) 353 Gui, show, w400 h300 354 SCI_SetWrapMode(True, hSci1) 355 356 ; In this example the whole text is stored because the length is calculated internally. 357 SCI_AppendText("This is my truncated text, this is added!") 358 return 359 (end) 360*/ 361SCI_AppendText(aStr, len=0, hwnd=0){ 362 363 a_isunicode ? (VarSetCapacity(aStrA, StrPut(aStr, "CP0")), StrPut(aStr, &aStrA, "CP0")) 364 return SCI_sendEditor(hwnd, "SCI_APPENDTEXT", len ? len : strLen(aStr), a_isunicode ? &aStrA : &aStr) 365} 366 367/* 368 Function: InsertText 369 <http://www.scintilla.org/ScintillaDoc.html#SCI_INSERTTEXT> 370 371 This inserts the text string at position *pos* or at the current position if pos is not specified. 372 If the current position is after the insertion point then it is moved along with its surrounding text 373 but no scrolling is performed. 374 375 Parameters: 376 SCI_InsertText(iStr[, pos,hwnd]) 377 378 iStr - String of text to be inserted. 379 pos - Position where the text is to be inserted. If not specified it defaults to current caret position. 380 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 381 Scintilla components in the same script. The wrapper will remember the last used hwnd, 382 so you can specify it once and only specify it again when you want to operate on a different 383 component. 384 385 Returns: 386 Zero - Nothing is returned by this function. 387 388 Examples: 389*/ 390SCI_InsertText(iStr, pos=-1,hwnd=0){ 391 392 a_isunicode ? (VarSetCapacity(iStrA, StrPut(iStr, "CP0")), StrPut(iStr, &iStrA, "CP0")) 393 return SCI_sendEditor(hwnd, "SCI_INSERTTEXT", pos, a_isunicode ? &iStrA : &iStr) 394} 395 396/* 397 Function: ClearAll 398 <http://www.scintilla.org/ScintillaDoc.html#SCI_CLEARALL> 399 400 Unless the document is read-only, this deletes all the text. 401 402 Parameters: 403 SCI_ClearAll([hwnd]) 404 405 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 406 Scintilla components in the same script. The wrapper will remember the last used hwnd, 407 so you can specify it once and only specify it again when you want to operate on a different 408 component. 409 410 Returns: 411 Zero - Nothing is returned by this function. 412 413 Examples: 414 >SCI_ClearAll(hSci) 415*/ 416SCI_ClearAll(hwnd=0){ 417 418 return SCI_sendEditor(hwnd, "SCI_CLEARALL") 419} 420 421/* 422 Function: ClearDocumentStyle 423 <http://www.scintilla.org/ScintillaDoc.html#SCI_CLEARDOCUMENTSTYLE> 424 425 When wanting to completely restyle the document, for example after choosing a lexer, the 426 *ClearDocumentStyle()* can be used to clear all styling information and reset the folding state. 427 428 Parameters: 429 SCI_ClearDocumentStyle([hwnd]) 430 431 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 432 Scintilla components in the same script. The wrapper will remember the last used hwnd, 433 so you can specify it once and only specify it again when you want to operate on a different 434 component. 435 436 Returns: 437 Zero - Nothing is returned by this function. 438 439 Examples: 440 >SCI_ClearDocumentStyle(hSci) 441*/ 442SCI_ClearDocumentStyle(hwnd=0){ 443 444 return SCI_sendEditor(hwnd, "SCI_CLEARDOCUMENTSTYLE") 445} 446 447; /* needs work 448 ; Function: TargetAsUTF8 449 ; <http://www.scintilla.org/ScintillaDoc.html#SCI_TARGETASUTF8> 450 451 ; This function retrieves the value of the target encoded as UTF-8, so is useful for retrieving text for use in 452 ; other parts of the user interface, such as find and replace dialogs. The length of the encoded text in bytes 453 ; is returned. 454 455 ; Parameters: 456 ; SCI_TargetAsUTF8(tStr[, hwnd]) 457 458 ; tStr - Target string that will be converted to UTF-8 encoding. 459 ; hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 460 ; Scintilla components in the same script. The wrapper will remember the last used hwnd, 461 ; so you can specify it once and only specify it again when you want to operate on a different 462 ; component. 463 464 ; Returns: 465 ; utfLen - Length of the encoded text in bytes. 466 467 ; Example: 468; */ 469; SCI_TargetAsUTF8(tStr, hwnd=0){ 470 471 ; a_isunicode ? (VarSetCapacity(tStrA, StrPut(tStr, "CP0")), StrPut(tStr, &tStrA, "CP0")) 472 ; return SCI_sendEditor(hwnd, "SCI_TARGETASUTF8", 0, a_isunicode ? &tStrA : &tStr) 473; } 474 475; /* needs work 476 ; Function: EncodedFromUTF8 477 ; <http://www.scintilla.org/ScintillaDoc.html#SCI_ENCODEDFROMUTF8> 478 479 ; *EncodedFromUTF8()* converts a UTF-8 string into the document's encoding which is useful for taking the 480 ; results of a find dialog, for example, and receiving a string of bytes that can be searched for in the 481 ; document. Since the text can contain nul bytes, the <SetLengthForEncode()> function can be used to set the 482 ; length that will be converted. If set to -1, the length is determined by finding a nul byte. The length of the 483 ; converted string is returned. 484 485 ; Parameters: 486 ; SCI_EncodedFromUTF8(utf8Str, encStr[, hwnd]) 487 488 ; utf8Str - 489 ; encStr - 490 ; hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 491 ; Scintilla components in the same script. The wrapper will remember the last used hwnd, 492 ; so you can specify it once and only specify it again when you want to operate on a different 493 ; component. 494 495 ; Examples: 496; */ 497; SCI_EncodedFromUTF8(utf8Str, encStr, hwnd=0){ 498 ; return 499; } 500 501; Group: Text Set Functions 502 503/* 504 Function: SetText 505 <http://www.scintilla.org/ScintillaDoc.html#SCI_SETTEXT> 506 507 Replaces all the text in the document with the zero terminated text string you pass in. 508 509 Parameters: 510 SCI_SetText(sStr[, hwnd]) 511 512 sStr - String of text to be set on the Scintilla component. 513 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 514 Scintilla components in the same script. The wrapper will remember the last used hwnd, 515 so you can specify it once and only specify it again when you want to operate on a different 516 component. 517 518 Returns: 519 Zero - Nothing is returned by this function. 520 521 Examples: 522*/ 523SCI_SetText(sStr, hwnd=0){ 524 525 a_isunicode ? (VarSetCapacity(sStrA, StrPut(sStr, "CP0")), StrPut(sStr, &sStrA, "CP0")) 526 return SCI_sendEditor(hwnd, "SCI_SETTEXT", 0, a_isunicode ? &sStrA : &sStr) 527} 528 529/* 530 Function: SetSavePoint 531 <http://www.scintilla.org/ScintillaDoc.html#SCI_SETSAVEPOINT> 532 533 This message tells Scintilla that the current state of the document is unmodified. This is usually done when 534 the file is saved or loaded, hence the name "save point". As Scintilla performs undo and redo operations, it 535 notifies the container that it has entered or left the save point with *SCN_SAVEPOINTREACHED* and 536 *SCN_SAVEPOINTLEFT* notification messages, allowing the container to know if the file should be considered 537 dirty or not. 538 539 Parameters: 540 SCI_SetSavePoint([hwnd]) 541 542 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 543 Scintilla components in the same script. The wrapper will remember the last used hwnd, 544 so you can specify it once and only specify it again when you want to operate on a different 545 component. 546 547 Returns: 548 Zero - Nothing is returned by this function. 549 550 Examples: 551*/ 552SCI_SetSavePoint(hwnd=0){ 553 554 return SCI_sendEditor(hwnd, "SCI_SETSAVEPOINT") 555} 556 557/* 558 Function: SetReadOnly 559 <http://www.scintilla.org/ScintillaDoc.html#SCI_SETREADONLY> 560 561 These messages set and get the read-only flag for the document. If you mark a document as read only, attempts to modify the text cause the *SCN_MODIFYATTEMPTRO* notification. 562 563 Parameters: 564 SCI_SetReadOnly(roMode[, hwnd]) 565 566 roMode - True (1) or False (0). 567 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 568 Scintilla components in the same script. The wrapper will remember the last used hwnd, 569 so you can specify it once and only specify it again when you want to operate on a different 570 component. 571 572 Returns: 573 Zero - Nothing is returned by this function. 574 575 Examples: 576*/ 577SCI_SetReadOnly(roMode, hwnd=0){ 578 579 return SCI_sendEditor(hwnd, "SCI_SETREADONLY", roMode) 580} 581 582/* 583 Function: SetStyleBits 584 <http://www.scintilla.org/ScintillaDoc.html#SCI_SETSTYLEBITS> 585 586 This Routine sets the number of bits in each cell to use for styling, to a maximum of 8 style bits. The remaining bits can be used as indicators. The standard setting is *SCI_SETSTYLEBITS(5)*. The number of styling bits needed by the current lexer can be found with <GetStyleBitsNeeded>. 587 588 Parameters: 589 SCI_SetStyleBits(bits[, hwnd]) 590 591 bits - 592 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 593 Scintilla components in the same script. The wrapper will remember the last used hwnd, 594 so you can specify it once and only specify it again when you want to operate on a different 595 component. 596 597 Returns: 598 Zero - Nothing is returned by this function. 599 600 Examples: 601*/ 602SCI_SetStyleBits(bits, hwnd=0){ 603 604 return SCI_sendEditor(hwnd, "SCI_SETSTYLEBITS", bits) 605} 606 607/* 608 Function: SetLengthForEncode 609 http://www.scintilla.org/ScintillaDoc.html#SCI_SETLENGTHFORENCODE 610 611 <EncodedFromUTF8()> converts a UTF-8 string into the document's encoding which is useful for taking the 612 results of a find dialog, for example, and receiving a string of bytes that can be searched for in the 613 document. Since the text can contain nul bytes, the *SetLengthForEncode()* method can be used to set the 614 length that will be converted. If set to -1, the length is determined by finding a nul byte. The length of the 615 converted string is returned. 616 617 Parameters: 618 SCI_SetLengthForEncode(bytes[, hwnd]) 619 620 bytes - Length of the string that will be converted with <EncodedFromUTF8()> 621 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 622 Scintilla components in the same script. The wrapper will remember the last used hwnd, 623 so you can specify it once and only specify it again when you want to operate on a different 624 component. 625 626 Returns: 627 Zero - Nothing is returned by this function. 628 629 Examples: 630*/ 631SCI_SetLengthForEncode(bytes, hwnd=0){ 632 633 return SCI_sendEditor(hwnd, "SCI_SETLENGTHFORENCODE", bytes) 634} 635 636; Group: Text Get Functions 637 638/* 639 Function: GetText 640 <http://www.scintilla.org/ScintillaDoc.html#SCI_GETTEXT> 641 642 This returns len-1 characters of text from the start of the document plus one terminating 0 character. 643 To collect all the text in a document, use <GetLength()> to get the number of characters in the document 644 (nLen), allocate a character buffer of length nLen+1 bytes, then call *GetText*(nLen+1, vText). 645 If the vText argument is 0 then the length that should be allocated to store the entire document is returned. 646 If you then save the text, you should use <SetSavePoint()> to mark the text as unmodified. 647 648 See also: <GetSelText()>, <GetCurLine()>, <GetLine()>, <GetStyledText()>, <GetTextRange()> 649 650 Parameters: 651 len - 652 vText - 653 654 Returns: 655 656 Examples: 657*/ 658SCI_GetText(len=0, Byref vText=0, hwnd=0){ 659 660 VarSetCapacity(str, len * (a_isunicode ? 2 : 1)), cLen := SCI_sendEditor(hwnd, "SCI_GETTEXT", len, &str) 661 vText := StrGet(&str, "CP0") 662 return cLen 663} 664 665; /* needs work (LineLenght() from selection and information) 666 ; Function: GetLine 667 ; <http://www.scintilla.org/ScintillaDoc.html#SCI_GETLINE> 668 669 ; This fills the buffer defined by text with the contents of the nominated line (lines start at 0). The buffer 670 ; is not terminated by a 0 character. It is up to you to make sure that the buffer is long enough for the text, 671 ; use <LineLength()> for that. The returned value is the number of characters copied to the buffer. 672 ; The returned text includes any end of line characters. If you ask for a line number outside the range of lines 673 ; in the document, 0 characters are copied. If the text argument is 0 then the length that should be allocated 674 ; to store the entire line is returned. 675 676 ; See also: <GetCurLine()>, <GetSelText()>, <GetTextRange()>, <GetStyledText()>, <GetText()> 677 678; */ 679; SCI_GetLine(line, vText, hwnd=0){ 680 681 ; VarSetCapacity(str, SCI_LineLength(hwnd) * (a_isunicode ? 2 : 1)) 682 ; cLen := SCI_sendEditor(hwnd, "SCI_GETLINE", len, &str) 683 ; vText := StrGet(&str, "CP0") 684 ; return cLen 685; } 686 687/* 688 Function: GetReadonly 689 <http://www.scintilla.org/ScintillaDoc.html#SCI_GETREADONLY> 690 691 This function gets the read-only flag for the document. If you mark a document as read only, attempts to 692 modify the text cause the *SCN_MODIFYATTEMPTRO* notification. 693 694 Parameters: 695 696*/ 697SCI_GetReadonly(){ 698 699 return 700} 701 702/* 703 Function: GetTextRange 704 <http://www.scintilla.org/ScintillaDoc.html#SCI_GETTEXTRANGE> 705 706 This collects the text between the positions cpMin and cpMax and copies it to lpstrText (see struct 707 <SCI_TextRange>). If cpMax is -1, text is returned to the end of the document. The text is 0 terminated, so 708 you must supply a buffer that is at least 1 character longer than the number of characters you wish to read. 709 The return value is the length of the returned text not including the terminating 0. 710 711 See also: <SCI_GetSelText()>, <SCI_GetLine()>, <SCI_GetCurLine()>, <SCI_GetStyledText()>, <SCI_GetText()> 712*/ 713SCI_GetTextRange(){ 714} 715 716/* 717 Function: GetCharAt 718 <http://www.scintilla.org/ScintillaDoc.html#SCI_GETCHARAT> 719 720 This returns the character at pos in the document or 0 if pos is negative or past the end of the document. 721*/ 722SCI_GetCharAt(){ 723 724 return 725} 726 727/* 728 Function: GetStyleAt 729 <http://www.scintilla.org/ScintillaDoc.html#SCI_GETSTYLEAT> 730 731 This returns the style at pos in the document, or 0 if pos is negative or past the end of the document. 732*/ 733SCI_GetStyleAt(){ 734 735 return 736} 737 738/* 739 Function: GetStyledText 740 <http://www.scintilla.org/ScintillaDoc.html#SCI_GETSTYLEDTEXT> 741 742 This collects styled text into a buffer using two bytes for each cell, with the character at the lower address 743 of each pair and the style byte at the upper address. Characters between the positions cpMin and cpMax are 744 copied to lpstrText (see struct <SCI_TextRange>). Two 0 bytes are added to the end of the text, so the buffer 745 that lpstrText points at must be at least 2*(cpMax-cpMin)+2 bytes long. No check is made for sensible values 746 of cpMin or cpMax. Positions outside the document return character codes and style bytes of 0. 747 748See also: <GetSelText()>, <GetLine()>, <GetCurLine()>, <GetTextRange()>, <GetText()> 749*/ 750SCI_GetStyledText(){ 751 752 return 753} 754 755/* 756 Function: GetStyleBits 757 <http://www.scintilla.org/ScintillaDoc.html#SCI_GETSTYLEBITS> 758 759 This routine reads back the number of bits in each cell to use for styling, to a maximum of 8 style bits. The 760 remaining bits can be used as indicators. The standard setting is *SetStyleBits(5)*. The number of styling 761 bits needed by the current lexer can be found with <GetStyleBitsNeeded()>. 762*/ 763SCI_GetStyleBits(){ 764 765 return 766} 767 768/* Group: Selection and information 769*/ 770 771/* 772 Function: GetTextLength 773 <http://www.scintilla.org/ScintillaDoc.html#SCI_GETTEXTLENGTH> 774 775 Returns the length of the document in bytes. 776 777 Parameters: 778 SCI_GetTextLength([hwnd]) 779 780 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 781 Scintilla components in the same script. The wrapper will remember the last used hwnd, 782 so you can specify it once and only specify it again when you want to operate on a different 783 component. 784 785 Returns 786 nLen - Length of the document in bytes. 787 788 Examples 789*/ 790SCI_GetTextLength(hwnd=0){ 791 792 return SCI_sendEditor(hwnd, "SCI_GETTEXTLENGTH") 793} 794 795/* 796 Function: GetLength 797 <http://www.scintilla.org/ScintillaDoc.html#SCI_GETLENGTH> 798 799 Returns the length of the document in bytes. 800 801 Parameters: 802 SCI_GetLength([hwnd]) 803 804 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 805 Scintilla components in the same script. The wrapper will remember the last used hwnd, 806 so you can specify it once and only specify it again when you want to operate on a different 807 component. 808 809 Returns 810 nLen - Length of the document in bytes. 811 812 Examples 813*/ 814SCI_GetLength(hwnd=0){ 815 816 return SCI_sendEditor(hwnd, "SCI_GETLENGTH") 817} 818 819/* Group: Style Definition 820 <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition> 821 822 While the style setting messages mentioned above change the style numbers associated with text, these messages 823 define how those style numbers are interpreted visually. There are 256 lexer styles that can be set, numbered 0 824 to *STYLE_MAX* (255). Unless you use *SCI_SETSTYLEBITS* to change the number of style bits, 825 styles 0 to 31 are used to set the text attributes. There are also some predefined numbered styles starting at 826 32, The following *STYLE_** constants are defined: 827 828 - *STYLE_DEFAULT* (32) This style defines the attributes that all styles receive when the 829 *SCI_STYLECLEARALL* message is used. 830 831 - *STYLE_LINENUMBER* (33) This style sets the attributes of the text used to display line numbers in a line 832 number margin. The background colour set for this style also sets the background colour for all margins that do 833 not have any folding mask bits set. That is, any margin for which mask & *SC_MASK_FOLDERS* is 0. See 834 *SCI_SETMARGINMASKN* for more about masks. 835 836 - *STYLE_BRACELIGHT* (34) This style sets the attributes used when highlighting braces with the 837 *SCI_BRACEHIGHLIGHT* message and when highlighting the corresponding indentation with *SCI_SETHIGHLIGHTGUIDE*. 838 839 - *STYLE_BRACEBAD* (35) This style sets the display attributes used when marking an unmatched brace with the 840 *SCI_BRACEBADLIGHT* message. 841 842 - *STYLE_CONTROLCHAR* (36) This style sets the font used when drawing control characters. Only the font, size, 843 bold, italics, and character set attributes are used and not the colour attributes. See also: 844 *SCI_SETCONTROLCHARSYMBOL*. 845 846 - *STYLE_INDENTGUIDE* (37) This style sets the foreground and background colours used when drawing the 847 indentation guides. 848 849 - *STYLE_CALLTIP* (38) Call tips normally use the font attributes defined by *STYLE_DEFAULT*. Use of 850 *SCI_CALLTIPUSESTYLE* causes call tips to use this style instead. Only the font face name, font size, foreground 851 and background colours and character set attributes are used. 852 853 - *STYLE_LASTPREDEFINED* (39) To make it easier for client code to discover the range of styles that are 854 predefined, this is set to the style number of the last predefined style. This is currently set to 39 and the 855 last style with an identifier is 38, which reserves space for one future predefined style. 856 857 - *STYLE_MAX* (255) This is not a style but is the number of the maximum style that can be set. Styles 858 between *STYLE_LASTPREDEFINED* and *STYLE_MAX* would be appropriate if you used *SCI_SETSTYLEBITS* to set more 859 than 5 style bits. 860 861 For each style you can set the font name, size and use of bold, italic and underline, foreground and background colour and the character set. You can also choose to hide text with a given style, display all characters as upper or lower case and fill from the last character on a line to the end of the line (for embedded languages). There is also an experimental attribute to make text read-only. 862 863 It is entirely up to you how you use styles. If you want to use syntax colouring you might use style 0 for white space, style 1 for numbers, style 2 for keywords, style 3 for strings, style 4 for preprocessor, style 5 for operators, and so on. 864*/ 865 866; Group: General Style Functions 867 868/* 869 Function: StyleResetDefault 870 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLERESETDEFAULT> 871 872 This message resets STYLE_DEFAULT to its state when Scintilla was initialised. 873 874 Parameters: 875 SCI_StyleResetDefault([hwnd]) 876 877 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 878 Scintilla components in the same script. The wrapper will remember the last used hwnd, 879 so you can specify it once and only specify it again when you want to operate on a different 880 component. 881 882 Returns: 883 Zero - Nothing is returned by this function. 884 885 Examples: 886 >SCI_StyleResetDefault(hSci) 887*/ 888SCI_StyleResetDefault(hwnd=0){ 889 890 return SCI_sendEditor(hwnd, "SCI_STYLERESETDEFAULT") 891} 892 893/* 894 Function: StyleClearAll 895 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLECLEARALL> 896 897 This message sets all styles to have the same attributes as STYLE_DEFAULT. 898 If you are setting up Scintilla for syntax coloring, it is likely that the lexical styles you set 899 will be very similar. One way to set the styles is to: 900 901 - Set STYLE_DEFAULT to the common features of all styles. 902 - Use SCI_STYLECLEARALL to copy this to all styles. 903 - Set the style attributes that make your lexical styles different. 904 905 Parameters: 906 SCI_StyleClearAll([hwnd]) 907 908 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 909 Scintilla components in the same script. The wrapper will remember the last used hwnd, 910 so you can specify it once and only specify it again when you want to operate on a different 911 component. 912 913 Returns: 914 Zero - Nothing is returned by this function. 915 916 Examples: 917 >SCI_StyleClearAll(hSci) 918*/ 919SCI_StyleClearAll(hwnd=0){ 920 921 return SCI_sendEditor(hwnd, "SCI_STYLECLEARALL") 922} 923 924; Group: Set Style Functions 925 926/* 927 Function: StyleSetFont 928 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETFONT> 929 930 These functions (plus SCI_StyleSetCharacterset) set the font attributes that are used to match 931 the fonts you request to those available. The fName parameter is a zero terminated string holding 932 the name of a font. Under Windows, only the first 32 characters of the name are used and 933 the name is not case sensitive. For internal caching, Scintilla tracks fonts by name 934 and does care about the casing of font names, so please be consistent. 935 936 Parameters: 937 SCI_StyleSetFont(stNumber, fName[, hwnd]) 938 939 stNumber - Style Number on which to operate. 940 There are 256 lexer styles that can be set, numbered 0 to *STYLE_MAX* (255) 941 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 942 fName - Name of the font to apply. 943 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 944 Scintilla components in the same script. The wrapper will remember the last used hwnd, 945 so you can specify it once and only specify it again when you want to operate on a different 946 component. 947 948 Returns: 949 Zero - Nothing is returned by this function. 950 951 Examples: 952 (Start Code) 953 #include ../SCI.ahk 954 955 Gui +LastFound 956 hwnd:=WinExist() 957 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 958 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 959 Gui, show, w400 h570 960 961 ; Each component will have its own font 962 SCI_StyleSetFont("STYLE_DEFAULT", "Courier New", hSci1) 963 SCI_StyleSetFont("STYLE_DEFAULT", "Arial Black", hSci2) 964 return 965 (End) 966*/ 967SCI_StyleSetFont(stNumber, fName, hwnd=0){ 968 969 a_isunicode ? (VarSetCapacity(fNameA, StrPut(fName, "CP0")), StrPut(fName, &fNameA, "CP0")) 970 return SCI_sendEditor(hwnd, "SCI_STYLESETFONT", stNumber, a_isunicode ? &fNameA : &fName) 971} 972 973/* 974 Function: StyleSetSize 975 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETSIZE> 976 977 Parameters: 978 SCI_StyleSetSize(stNumber, fSize[, hwnd]) 979 980 stNumber - Style Number on which to operate. 981 There are 256 lexer styles that can be set, numbered 0 to *STYLE_MAX* (255) 982 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 983 fSize - Size in points of the font to apply. 984 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 985 Scintilla components in the same script. The wrapper will remember the last used hwnd, 986 so you can specify it once and only specify it again when you want to operate on a different 987 component. 988 989 Returns: 990 Zero - Nothing is returned by this function. 991 992 Examples: 993 (Start Code) 994 #include ../SCI.ahk 995 996 Gui +LastFound 997 hwnd:=WinExist() 998 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 999 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 1000 Gui, show, w400 h570 1001 1002 ; Each component will have its own font size 1003 SCI_StyleSetSize("STYLE_DEFAULT", 12, hSci1) 1004 SCI_StyleSetSize("STYLE_DEFAULT", 32, hSci2) 1005 return 1006 (End) 1007*/ 1008SCI_StyleSetSize(stNumber, fSize, hwnd=0){ 1009 1010 return SCI_sendEditor(hwnd, "SCI_STYLESETSIZE", stNumber, fSize) 1011} 1012 1013/* 1014 Function: StyleSetBold 1015 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETBOLD> 1016 1017 Parameters: 1018 SCI_StyleSetBold(stNumber, bMode[, hwnd]) 1019 1020 stNumber - Style Number on which to operate. 1021 There are 256 lexer styles that can be set, numbered 0 to *STYLE_MAX* (255) 1022 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1023 bMode - True (1) or False (0). 1024 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1025 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1026 so you can specify it once and only specify it again when you want to operate on a different 1027 component. 1028 1029 Returns: 1030 Zero - Nothing is returned by this function. 1031 1032 Examples: 1033 (Start Code) 1034 #include ../SCI.ahk 1035 1036 Gui +LastFound 1037 hwnd:=WinExist() 1038 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1039 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 1040 Gui, show, w400 h570 1041 1042 ; Each component will have its own bold status 1043 SCI_StyleSetBold("STYLE_DEFAULT", True, hSci1) 1044 SCI_StyleSetBold("STYLE_DEFAULT", False, hSci2) 1045 return 1046 (End) 1047*/ 1048SCI_StyleSetBold(stNumber, bMode, hwnd=0){ 1049 1050 return SCI_sendEditor(hwnd, "SCI_STYLESETBOLD", stNumber, bMode) 1051} 1052 1053/* 1054 Function: StyleSetItalic 1055 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETITALIC> 1056 1057 Parameters: 1058 SCI_StyleSetItalic(stNumber, iMode[, hwnd]) 1059 1060 stNumber - Style Number on which to operate. 1061 There are 256 lexer styles that can be set, numbered 0 to *STYLE_MAX* (255) 1062 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1063 iMode - True (1) or False (0). 1064 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1065 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1066 so you can specify it once and only specify it again when you want to operate on a different 1067 component. 1068 1069 Returns: 1070 Zero - Nothing is returned by this function. 1071 1072 Examples: 1073 (Start Code) 1074 #include ../SCI.ahk 1075 1076 Gui +LastFound 1077 hwnd:=WinExist() 1078 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1079 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 1080 Gui, show, w400 h570 1081 1082 ; Each component will have its own bold status 1083 SCI_StyleSetItalic("STYLE_DEFAULT", True, hSci1) 1084 SCI_StyleSetItalic("STYLE_DEFAULT", False, hSci2) 1085 return 1086 (End) 1087*/ 1088SCI_StyleSetItalic(stNumber, iMode, hwnd=0){ 1089 1090 return SCI_sendEditor(hwnd, "SCI_STYLESETITALIC", stNumber, iMode) 1091} 1092 1093/* 1094 Function: StyleSetUnderline 1095 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETUNDERLINE> 1096 1097 Parameters: 1098 SCI_StyleSetUnderline(stNumber, uMode[, hwnd]) 1099 1100 stNumber - Style Number on which to operate. 1101 There are 256 lexer styles that can be set, numbered 0 to *STYLE_MAX* (255) 1102 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1103 uMode - True (1) or False (0). 1104 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1105 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1106 so you can specify it once and only specify it again when you want to operate on a different 1107 component. 1108 1109 Returns: 1110 Zero - Nothing is returned by this function. 1111 1112 Note: 1113 - If you set the underline option for the *STYLE_DEFAULT* style 1114 you *have* to call <StyleClearAll()> for the changes to take effect. 1115 1116 Examples: 1117 (Start Code) 1118 #include ../SCI.ahk 1119 1120 Gui +LastFound 1121 hwnd:=WinExist() 1122 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1123 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 1124 Gui, show, w400 h570 1125 1126 ; Each component will have its own underline status 1127 SCI_StyleSetUnderline("STYLE_DEFAULT", True, hSci1) 1128 SCI_StyleClearAll() ; the last hwnd is remembered by the wrapper, so no need to put it here. 1129 SCI_StyleSetUnderline("STYLE_DEFAULT", False, hSci2) 1130 SCI_StyleClearAll() ; the last hwnd is remembered by the wrapper, so no need to put it here. 1131 return 1132 (End) 1133*/ 1134SCI_StyleSetUnderline(stNumber, uMode, hwnd=0){ 1135 1136 return SCI_sendEditor(hwnd, "SCI_STYLESETUNDERLINE", stNumber, uMode) 1137} 1138 1139/* 1140 Function: StyleSetFore 1141 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETFORE> 1142 1143 Sets the foreground color of the specified style number. 1144 1145 Parameters: 1146 SCI_StyleSetFore(stNumber, r, [g, b, hwnd]) 1147 1148 stNumber - Style Number on which to operate. 1149 There are 256 lexer styles that can be set, numbered 0 to *STYLE_MAX* (255) 1150 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1151 r,g,b - Colors are set using the RGB format (Red, Green, Blue). The intensity of each color 1152 is set in the range 0 to 255. 1153 1154 - *Note 1:* If you set all intensities to 255, the color is white. 1155 If you set all intensities to 0, the color is black. 1156 When you set a color, you are making a request. 1157 What you will get depends on the capabilities of the system and the current screen mode. 1158 1159 - *Note 2:* If you omit *g* and *b* you can specify the hex value of the color as 1160 well as one of the many predefined names available. 1161 You can take a look at the available color names with their hex values here: 1162 <http://www.w3schools.com/html/html_colornames.asp>. 1163 1164 - *Note 3:* the parameter *g* can be used to specify the hwnd of the component you want 1165 to control, only if you are using *r* to specify a hex value or a color name. 1166 See the examples below for more information. 1167 1168 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1169 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1170 so you can specify it once and only specify it again when you want to operate on a different 1171 component. 1172 1173 Note: 1174 - If you change the color of the *STYLE_DEFAULT* style 1175 you *have* to call <StyleClearAll()> for the changes to take effect. 1176 This is not true for setting the background color though. 1177 1178 1179 Returns: 1180 Zero - Nothing is returned by this function. 1181 1182 Examples: 1183 (Start Code) 1184 ; This all mean the same 1185 SCI_StyleSetFore("STYLE_DEFAULT", 0xFF0000, hSci) ; using the parameter g to specify the hwnd. 1186 SCI_StyleSetFore("STYLE_DEFAULT", "red", hSci) 1187 SCI_StyleSetFore("STYLE_DEFAULT", 255,0,0, hSci) ; using the last parameter to specify the hwnd. 1188 1189 ; Remember to always call SCI_StyleClearAll() 1190 ; if you are setting the foreground color of the STYLE_DEFAULT style 1191 SCI_StyleClearAll() 1192 1193 ;--------------------- 1194 #include ../SCI.ahk 1195 1196 Gui +LastFound 1197 hwnd:=WinExist() 1198 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1199 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 1200 Gui, show, w400 h570 1201 1202 SCI_StyleSetFore("STYLE_DEFAULT", 0xFF0000, hSci1) 1203 SCI_StyleClearAll() ; the last hwnd is remembered by the wrapper, so no need to put it here. 1204 SCI_StyleSetFore("STYLE_DEFAULT", "blue", hSci2) 1205 SCI_StyleClearAll() ; the last hwnd is remembered by the wrapper, so no need to put it here. 1206 return 1207 (End) 1208*/ 1209SCI_StyleSetFore(stNumber, r, g=0, b=0, hwnd=0){ 1210 1211 SCI(g) ? (hwnd:=g, g:=0) ; check if g contains a valid component handle 1212 r && !g && !b ? (r:=SCI_getHex(r) 1213 ,g:="0x" SubStr(r,5,2) 1214 ,b:="0x" SubStr(r,7,2) 1215 ,r:="0x" SubStr(r,3,2) ; has to be modified last since the others depend on it. 1216 ,r+=0,g+=0,b+=0) 1217 return SCI_sendEditor(hwnd, "SCI_STYLESETFORE", stNumber, r | g << 8 | b << 16) 1218} 1219 1220/* 1221 Function: StyleSetBack 1222 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETBACK> 1223 1224 Sets the Background color of the specified style number. 1225 1226 Parameters: 1227 SCI_StyleSetBack(stNumber, r, [g, b, hwnd]) 1228 1229 stNumber - Style Number on which to operate. 1230 There are 256 lexer styles that can be set, numbered 0 to *STYLE_MAX* (255) 1231 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1232 r,g,b - Colors are set using the RGB format (Red, Green, Blue). The intensity of each color 1233 is set in the range 0 to 255. 1234 1235 - *Note 1:* If you set all intensities to 255, the color is white. 1236 If you set all intensities to 0, the color is black. 1237 When you set a color, you are making a request. 1238 What you will get depends on the capabilities of the system and the current screen mode. 1239 1240 - *Note 2:* If you omit *g* and *b* you can specify the hex value of the color as 1241 well as one of the many predefined names available. 1242 You can take a look at the available color names with their hex values here: 1243 <http://www.w3schools.com/html/html_colornames.asp>. 1244 1245 - *Note 3:* the parameter *g* can be used to specify the hwnd of the component you want 1246 to control, only if you are using *r* to specify a hex value or a color name. 1247 See the examples below for more information. 1248 1249 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1250 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1251 so you can specify it once and only specify it again when you want to operate on a different 1252 component. 1253 1254 Returns: 1255 Zero - Nothing is returned by this function. 1256 1257 Examples: 1258 (Start Code) 1259 ; This all mean the same 1260 SCI_StyleSetBack("STYLE_DEFAULT", 0xFF0000, hSci) ; using the parameter g to specify the hwnd. 1261 SCI_StyleSetBack("STYLE_DEFAULT", "red", hSci) 1262 SCI_StyleSetBack("STYLE_DEFAULT", 255,0,0, hSci) ; using the last parameter to specify the hwnd. 1263 1264 ;--------------------- 1265 #include ../SCI.ahk 1266 1267 Gui +LastFound 1268 hwnd:=WinExist() 1269 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1270 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 1271 Gui, show, w400 h570 1272 1273 SCI_StyleSetBack("STYLE_DEFAULT", 0xFF0000, hSci1) 1274 SCI_StyleSetBack("STYLE_DEFAULT", "blue", hSci2) 1275 return 1276 (End) 1277*/ 1278SCI_StyleSetBack(stNumber, r, g=0, b=0, hwnd=0){ 1279 1280 SCI(g) ? (hwnd:=g, g:=0) ; check if g contains a valid component handle 1281 r && !g && !b ? (r:=SCI_getHex(r) 1282 ,g:="0x" SubStr(r,5,2) 1283 ,b:="0x" SubStr(r,7,2) 1284 ,r:="0x" SubStr(r,3,2) ; has to be modified last since the others depend on it. 1285 ,r+=0,g+=0,b+=0) 1286 return SCI_sendEditor(hwnd, "SCI_STYLESETBACK", stNumber, r | g << 8 | b << 16) 1287} 1288 1289/* 1290 Function: StyleSetEOLFilled 1291 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETEOLFILLED> 1292 1293 If the last character in the line has a style with this attribute set, the remainder of the line 1294 up to the right edge of the window is filled with the background color set for the last character. 1295 1296 Parameters: 1297 SCI_StyleSetEOLFilled(stNumber, eolMode[, hwnd]) 1298 1299 stNumber - Style Number on which to operate. 1300 There are 256 lexer styles that can be set, numbered 0 to *STYLE_MAX* (255) 1301 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1302 eolMode - True or False. 1303 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1304 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1305 so you can specify it once and only specify it again when you want to operate on a different 1306 component. 1307 1308 Returns: 1309 Zero - Nothing is returned by this function. 1310 1311 Examples: 1312 >SCI_StyleSetEOLFilled(STYLE_DEFAULT, 1) 1313 >SCI_StyleSetEOLFilled(0, false) 1314*/ 1315SCI_StyleSetEOLFilled(stNumber, eolMode, hwnd=0){ 1316 1317 return SCI_sendEditor(hwnd, "SCI_STYLESETEOLFILLED", stNumber, eolMode) 1318} 1319 1320/* 1321 Function: StyleSetCase 1322 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETCASE> 1323 1324 The value of cMode determines how text is displayed. 1325 This does not change the stored text, only how it is displayed. 1326 1327 Parameters: 1328 SCI_StyleSetCase(stNumber, cMode[, hwnd]) 1329 1330 stNumber - Style Number on which to operate. 1331 There are 256 lexer styles that can be set, numbered 0 to *STYLE_MAX* (255) 1332 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1333 cMode - We have three case modes available: 1334 - *SC_CASE_MIXED* (0) Display normal case. 1335 - *SC_CASE_UPPER* (1) Display text in upper case. 1336 - *SC_CASE_LOWER* (2) Display text in lower case. 1337 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1338 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1339 so you can specify it once and only specify it again when you want to operate on a different 1340 component. 1341 1342 Note: 1343 - If you set this option for the *STYLE_DEFAULT* style 1344 you *have* to call <StyleClearAll()> for the changes to take effect. 1345 1346 Returns: 1347 Zero - Nothing is returned by this function. 1348 1349 Examples: 1350 (Start Code) 1351 #include ../SCI.ahk 1352 1353 Gui +LastFound 1354 hwnd:=WinExist() 1355 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1356 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 1357 Gui, show, w400 h570 1358 1359 SCI_StyleSetCase("STYLE_DEFAULT", "SC_CASE_UPPER", hSci1) 1360 SCI_StyleClearAll() ; the last hwnd is remembered by the wrapper, so no need to put it here. 1361 SCI_StyleSetCase("STYLE_DEFAULT", "SC_CASE_LOWER", hSci2) 1362 SCI_StyleClearAll() ; the last hwnd is remembered by the wrapper, so no need to put it here. 1363 return 1364 (End) 1365*/ 1366SCI_StyleSetCase(stNumber, cMode, hwnd=0){ 1367 1368 return SCI_sendEditor(hwnd, "SCI_STYLESETCASE", stNumber, cMode) 1369} 1370 1371/* 1372 Function: StyleSetVisible 1373 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETVISIBLE> 1374 1375 Text is normally visible. However, you can completely hide it by giving it a style with the visible set to 0. 1376 This could be used to hide embedded formatting instructions or hypertext keywords in HTML or XML. 1377 1378 Parameters: 1379 SCI_StyleSetVisible(stNumber, vMode[, hwnd]) 1380 1381 stNumber - Style Number on which to operate. 1382 There are 256 lexer styles that can be set, numbered 0 to *STYLE_MAX* (255) 1383 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1384 vMode - True (1) or False (0). 1385 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1386 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1387 so you can specify it once and only specify it again when you want to operate on a different 1388 component. 1389 1390 Note: 1391 - If you set this option for the *STYLE_DEFAULT* style 1392 you *have* to call <StyleClearAll()> for the changes to take effect. 1393 1394 Returns: 1395 Zero - Nothing is returned by this function. 1396 1397 Examples: 1398 (Start Code) 1399 #include ../SCI.ahk 1400 1401 Gui +LastFound 1402 hwnd:=WinExist() 1403 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1404 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 1405 Gui, show, w400 h570 1406 1407 SCI_StyleSetVisible("STYLE_DEFAULT", True, hSci1) 1408 SCI_StyleClearAll() ; the last hwnd is remembered by the wrapper, so no need to put it here. 1409 SCI_StyleSetVisible("STYLE_DEFAULT", False, hSci2) 1410 SCI_StyleClearAll() ; the last hwnd is remembered by the wrapper, so no need to put it here. 1411 return 1412 (End) 1413*/ 1414SCI_StyleSetVisible(stNumber, vMode, hwnd=0){ 1415 1416 return SCI_sendEditor(hwnd, "SCI_STYLESETVISIBLE", stNumber, vMode) 1417} 1418 1419/* 1420 Function: StyleSetChangeable 1421 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETCHANGEABLE> 1422 1423 This is an experimental and incompletely implemented style attribute. 1424 The default setting is changeable set true but when set false it makes text read-only. 1425 1426 You can type text on a control that has this mode set to false but after the text is written 1427 it cannot be modified. 1428 1429 This option also stops the caret from being within not-changeable text but does not prevent 1430 you from selecting non-changeable text by double clicking it or dragging the mouse. 1431 1432 1433 Parameters: 1434 SCI_StyleSetChangeable(stNumber, cMode[, hwnd]) 1435 1436 stNumber - Style Number on which to operate. 1437 There are 256 lexer styles that can be set, numbered 0 to *STYLE_MAX* (255) 1438 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1439 cMode - True (1) or False (0). 1440 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1441 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1442 so you can specify it once and only specify it again when you want to operate on a different 1443 component. 1444 1445 Note: 1446 - If you set this option for the *STYLE_DEFAULT* style 1447 you *have* to call <StyleClearAll()> for the changes to take effect. 1448 1449 Returns: 1450 Zero - Nothing is returned by this function. 1451 1452 Examples: 1453 (Start Code) 1454 #include ../SCI.ahk 1455 1456 Gui +LastFound 1457 hwnd:=WinExist() 1458 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1459 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 1460 Gui, show, w400 h570 1461 1462 SCI_StyleSetChangeable("STYLE_DEFAULT", True, hSci1) 1463 SCI_StyleClearAll() ; the last hwnd is remembered by the wrapper, so no need to put it here. 1464 SCI_StyleSetChangeable("STYLE_DEFAULT", False, hSci2) 1465 SCI_StyleClearAll() ; the last hwnd is remembered by the wrapper, so no need to put it here. 1466 return 1467 (End) 1468*/ 1469SCI_StyleSetChangeable(stNumber, cMode, hwnd=0){ 1470 1471 return SCI_sendEditor(hwnd, "SCI_STYLESETCHANGEABLE", stNumber, cMode) 1472} 1473 1474/* 1475 Function: StyleSetHotspot 1476 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLESETHOTSPOT> 1477 1478 Marks ranges of text that can detect mouse clicks. 1479 The default values are that the cursor changes to a hand over hotspots 1480 and an underline appear to indicate that the text is sensitive to clicking. 1481 This may be used to allow hyperlinks to other documents. 1482 1483 Other options may be changed with the following functions: 1484 - <SetHotSpotActiveFore()> 1485 - <SetHotSpotActiveBack()> 1486 - <SetHotSpotActiveUnderline()> 1487 - <SetHotSpotSingleLine()> 1488 1489 Parameters: 1490 SCI_StyleSetHotspot(stNumber, hMode[, hwnd]) 1491 1492 stNumber - Style Number on which to operate. 1493 There are 256 lexer styles that can be set, numbered 0 to *STYLE_MAX* (255) 1494 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1495 hMode - True (1) or False (0). 1496 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1497 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1498 so you can specify it once and only specify it again when you want to operate on a different 1499 component. 1500 1501 Returns: 1502 Zero - Nothing is returned by this function. 1503 1504 Examples: 1505 (Start Code) 1506 #include ../SCI.ahk 1507 1508 Gui +LastFound 1509 hwnd:=WinExist() 1510 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1511 Gui, show, w400 h300 1512 1513 SCI_StyleSetHotspot("STYLE_DEFAULT", True, hSci1) 1514 SCI_StyleClearAll() 1515 return 1516 (End) 1517*/ 1518SCI_StyleSetHotspot(stNumber, hMode, hwnd=0){ 1519 1520 return SCI_sendEditor(hwnd, "SCI_STYLESETHOTSPOT", stNumber, hMode) 1521} 1522 1523; Group: Get Style Functions 1524 1525/* 1526 Function: StyleGetFont 1527 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETFONT> 1528 1529 Parameters: 1530 SCI_StyleGetFont(stNumber[, hwnd]) 1531 1532 stNumber - Style Number on which to operate. 1533 There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255) 1534 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition.> 1535 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1536 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1537 so you can specify it once and only specify it again when you want to operate on a different 1538 component. 1539 1540 Returns: 1541 fName - Name of the font applied to that style number. 1542 1543 Examples: 1544 (Start Code) 1545 #include ../SCI.ahk 1546 1547 Gui +LastFound 1548 hwnd:=WinExist() 1549 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1550 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 1551 Gui, show, w400 h570 1552 1553 SCI_StyleSetFont("STYLE_DEFAULT", "Arial", hSci1) 1554 SCI_StyleSetFont("STYLE_DEFAULT", "Courier New", hSci2) 1555 msgbox % "Component 1: " SCI_StyleGetFont("STYLE_DEFAULT", hSci1) 1556 msgbox % "Component 2: " SCI_StyleGetFont("STYLE_DEFAULT", hSci2) 1557 return 1558 (End) 1559*/ 1560SCI_StyleGetFont(stNumber, hwnd=0){ 1561 1562 VarSetCapacity(fName,32), SCI_sendEditor(hwnd, "SCI_STYLEGETFONT", stNumber, &fName) 1563 return StrGet(&fName, "cp0") 1564} 1565 1566/* 1567 Function: StyleGetSize 1568 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETSIZE> 1569 1570 Parameters: 1571 SCI_StyleGetSize(stNumber[, hwnd]) 1572 1573 stNumber - Style Number on which to operate. 1574 There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255) 1575 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1576 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1577 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1578 so you can specify it once and only specify it again when you want to operate on a different 1579 component. 1580 1581 Returns: 1582 fSize - Size in points of the font applied to that style number. 1583 1584 Examples: 1585 (Start Code) 1586 #include ../SCI.ahk 1587 1588 Gui +LastFound 1589 hwnd:=WinExist() 1590 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1591 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 1592 Gui, show, w400 h570 1593 1594 SCI_StyleSetSize("STYLE_DEFAULT", 10, hSci1) 1595 SCI_StyleSetSize("STYLE_DEFAULT", 25, hSci2) 1596 msgbox % "Component 1: " SCI_StyleGetSize("STYLE_DEFAULT", hSci1) 1597 msgbox % "Component 2: " SCI_StyleGetSize("STYLE_DEFAULT", hSci2) 1598 return 1599 (End) 1600*/ 1601SCI_StyleGetSize(stNumber, hwnd=0){ 1602 1603 return SCI_sendEditor(hwnd, "SCI_STYLEGETSIZE", stNumber) 1604} 1605 1606/* 1607 Function: StyleGetBold 1608 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETBOLD> 1609 1610 Parameters: 1611 SCI_StyleSetBold(stNumber[, hwnd]) 1612 1613 stNumber - Style Number on which to operate. 1614 There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255) 1615 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1616 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1617 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1618 so you can specify it once and only specify it again when you want to operate on a different 1619 component. 1620 1621 Returns: 1622 bMode - True or False. 1623 1624 Examples: 1625 (Start Code) 1626 #include ../SCI.ahk 1627 1628 Gui +LastFound 1629 hwnd:=WinExist() 1630 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1631 Gui, show, w400 h300 1632 SCI_StyleSetBold("STYLE_DEFAULT", 1, hSci1) 1633 msgbox % SCI_StyleGetBold("STYLE_DEFAULT") 1634 return 1635 (End) 1636*/ 1637SCI_StyleGetBold(stNumber, hwnd=0){ 1638 1639 return SCI_sendEditor(hwnd, "SCI_STYLEGETBOLD", stNumber) 1640} 1641 1642/* 1643 Function: StyleGetItalic 1644 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETITALIC> 1645 1646 Parameters: 1647 SCI_StyleGetItalic(stNumber[, hwnd]) 1648 1649 stNumber - Style Number on which to operate. 1650 There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255) 1651 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1652 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1653 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1654 so you can specify it once and only specify it again when you want to operate on a different 1655 component. 1656 1657 Returns: 1658 iMode - True or False. 1659 1660 Examples: 1661 (Start Code) 1662 #include ../SCI.ahk 1663 1664 Gui +LastFound 1665 hwnd:=WinExist() 1666 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1667 Gui, show, w400 h300 1668 SCI_StyleSetItalic("STYLE_DEFAULT", 1, hSci1) 1669 msgbox % SCI_StyleGetItalic("STYLE_DEFAULT") 1670 return 1671 (End) 1672*/ 1673SCI_StyleGetItalic(stNumber, hwnd=0){ 1674 1675 return SCI_sendEditor(hwnd, "SCI_STYLEGETITALIC", stNumber) 1676} 1677 1678/* 1679 Function: StyleGetUnderline 1680 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETUNDERLINE> 1681 1682 Parameters: 1683 SCI_StyleGetUnderline(stNumber[, hwnd]) 1684 1685 stNumber - Style Number on which to operate. 1686 There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255) 1687 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1688 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1689 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1690 so you can specify it once and only specify it again when you want to operate on a different 1691 component. 1692 1693 Returns: 1694 uMode - True or False. 1695 1696 Examples: 1697 (Start Code) 1698 #include ../SCI.ahk 1699 1700 Gui +LastFound 1701 hwnd:=WinExist() 1702 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1703 Gui, show, w400 h300 1704 SCI_StyleSetUnderline("STYLE_DEFAULT", 1, hSci1) 1705 SCI_StyleClearAll() 1706 msgbox % SCI_StyleGetUnderline("STYLE_DEFAULT") 1707 return 1708 (End) 1709*/ 1710SCI_StyleGetUnderline(stNumber, hwnd=0){ 1711 1712 return SCI_sendEditor(hwnd, "SCI_STYLEGETUNDERLINE", stNumber) 1713} 1714 1715/* 1716 Function: StyleGetFore 1717 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETFORE> 1718 1719 Gets the RGB value stored in the specified style number. 0 if none has been set. 1720 1721 Parameters: 1722 SCI_StyleGetFore(stNumber[, hwnd]) 1723 1724 stNumber - Style Number on which to operate. 1725 There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255) 1726 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1727 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1728 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1729 so you can specify it once and only specify it again when you want to operate on a different 1730 component. 1731 1732 Returns: 1733 RGB - RGB value in the format (red | green << 8 | blue << 16) of the queried style number. 1734 1735 Examples: 1736 (Start Code) 1737 #include ../SCI.ahk 1738 1739 Gui +LastFound 1740 hwnd:=WinExist() 1741 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1742 Gui, show, w400 h300 1743 SCI_StyleSetFore("STYLE_DEFAULT", "darkblue", hSci1) 1744 SCI_StyleClearAll() 1745 msgbox % SCI_StyleGetFore("STYLE_DEFAULT", hSci1) 1746 return 1747 (End) 1748*/ 1749SCI_StyleGetFore(stNumber, hwnd=0){ 1750 1751 return SCI_sendEditor(hwnd, "SCI_STYLEGETFORE", stNumber) 1752} 1753 1754/* 1755 Function: StyleGetBack 1756 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETFORE> 1757 1758 Gets the RGB value stored in the specified style number. 0 if none has been set. 1759 1760 Parameters: 1761 SCI_StyleGetBack(stNumber[, hwnd]) 1762 1763 stNumber - Style Number on which to operate. 1764 There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255) 1765 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1766 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1767 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1768 so you can specify it once and only specify it again when you want to operate on a different 1769 component. 1770 1771 Returns: 1772 RGB - RGB value in the format (red | green << 8 | blue << 16) of the queried style number. 1773 1774 Examples: 1775 (Start Code) 1776 #include ../SCI.ahk 1777 1778 Gui +LastFound 1779 hwnd:=WinExist() 1780 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1781 Gui, show, w400 h300 1782 SCI_StyleSetBack("STYLE_DEFAULT", "blue", hSci1) 1783 msgbox % SCI_StyleGetBack("STYLE_DEFAULT", hSci1) 1784 return 1785 (End) 1786*/ 1787SCI_StyleGetBack(stNumber, hwnd=0){ 1788 1789 return SCI_sendEditor(hwnd, "SCI_STYLEGETBACK", stNumber) 1790} 1791 1792/* 1793 Function: StyleGetEOLFilled 1794 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETEOLFILLED> 1795 1796 Parameters: 1797 SCI_StyleGetEOLFilled(stNumber[, hwnd]) 1798 1799 stNumber - Style Number on which to operate. 1800 There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255) 1801 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1802 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1803 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1804 so you can specify it once and only specify it again when you want to operate on a different 1805 component. 1806 1807 Returns: 1808 eolMode - True or False 1809 1810 Examples: 1811 (Start Code) 1812 ; there is no notizable effect due to the default background being white. 1813 ; if you try this on a style other than the default (making sure the other style has a different 1814 ; background color than the default style) you should be able to see the effect. But you can 1815 ; see that the option has been set correctly. 1816 #include ../SCI.ahk 1817 1818 Gui +LastFound 1819 hwnd:=WinExist() 1820 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1821 Gui, show, w400 h300 1822 SCI_StyleSetEOLFilled("STYLE_DEFAULT", True, hSci1) 1823 msgbox % SCI_StyleGetEOLFilled("STYLE_DEFAULT", hSci1) 1824 return 1825 (End) 1826*/ 1827SCI_StyleGetEOLFilled(stNumber, hwnd=0){ 1828 1829 return SCI_sendEditor(hwnd, "SCI_STYLEGETEOLFILLED", stNumber) 1830} 1831 1832/* 1833 Function: StyleGetCase 1834 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETCASE> 1835 1836 Gets the case mode currently set to the queried style number. 1837 1838 Parameters: 1839 SCI_StyleGetCase(stNumber[, hwnd]) 1840 1841 stNumber - Style Number on which to operate. 1842 There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255) 1843 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1844 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1845 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1846 so you can specify it once and only specify it again when you want to operate on a different 1847 component. 1848 Returns: 1849 cMode - Current case mode of the selected style. The modes can be: 1850 - *SC_CASE_MIXED* (0) Display normal case. 1851 - *SC_CASE_UPPER* (1) Display text in upper case. 1852 - *SC_CASE_LOWER* (2) Display text in lower case. 1853 1854 Examples: 1855 (Start Code) 1856 #include ../SCI.ahk 1857 1858 Gui +LastFound 1859 hwnd:=WinExist() 1860 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1861 Gui, show, w400 h300 1862 SCI_StyleSetCase("STYLE_DEFAULT", "SC_CASE_UPPER", hSci1) 1863 SCI_StyleClearAll() 1864 msgbox % SCI_StyleGetCase("STYLE_DEFAULT", hSci1) 1865 return 1866 (End) 1867*/ 1868SCI_StyleGetCase(stNumber, hwnd=0){ 1869 1870 return SCI_sendEditor(hwnd, "SCI_STYLEGETCASE", stNumber) 1871} 1872 1873/* 1874 Function: StyleGetVisible 1875 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETVISIBLE> 1876 1877 Gets the visibility mode curently assigned to the queried style number. 1878 1879 Parameters: 1880 SCI_StyleGetVisible(stNumber[, hwnd]) 1881 1882 stNumber - Style Number on which to operate. 1883 There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255) 1884 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1885 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1886 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1887 so you can specify it once and only specify it again when you want to operate on a different 1888 component. 1889 Returns: 1890 vMode - True or False. 1891 1892 Examples: 1893 (Start Code) 1894 #include ../SCI.ahk 1895 1896 Gui +LastFound 1897 hwnd:=WinExist() 1898 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1899 Gui, show, w400 h300 1900 SCI_StyleSetVisible("STYLE_DEFAULT", False, hSci1) 1901 SCI_StyleClearAll() 1902 msgbox % SCI_StyleGetVisible("STYLE_DEFAULT", hSci1) 1903 return 1904 (End) 1905*/ 1906SCI_StyleGetVisible(stNumber, hwnd=0){ 1907 1908 return SCI_sendEditor(hwnd, "SCI_STYLEGETVISIBLE", stNumber) 1909} 1910 1911/* 1912 Function: StyleGetChangeable 1913 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETCHANGEABLE> 1914 1915 Gets the status of the queried style number. Returns false if is read only else it returns true. 1916 1917 Parameters: 1918 SCI_StyleGetChangeable(stNumber[, hwnd]) 1919 1920 stNumber - Style Number on which to operate. 1921 There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255) 1922 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1923 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1924 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1925 so you can specify it once and only specify it again when you want to operate on a different 1926 component. 1927 1928 Returns: 1929 cMode - True or False. 1930 1931 Examples: 1932 (Start Code) 1933 #include ../SCI.ahk 1934 1935 Gui +LastFound 1936 hwnd:=WinExist() 1937 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1938 Gui, show, w400 h300 1939 SCI_StyleSetChangeable("STYLE_DEFAULT", False, hSci1) 1940 SCI_StyleClearAll() 1941 msgbox % SCI_StyleGetChangeable("STYLE_DEFAULT", hSci1) 1942 return 1943 (End) 1944*/ 1945SCI_StyleGetChangeable(stNumber, hwnd=0){ 1946 1947 return SCI_sendEditor(hwnd, "SCI_STYLEGETCHANGEABLE", stNumber) 1948} 1949 1950/* 1951 Function: StyleGetHotspot 1952 <http://www.scintilla.org/ScintillaDoc.html#SCI_STYLEGETHOTSPOT> 1953 1954 Gets the status of the queried style number and returns true if the style has the HOTSPOT style set to it 1955 and false if not. 1956 1957 Parameters: 1958 SCI_StyleGetHotspot(stNumber[, hwnd]) 1959 1960 stNumber - Style Number on which to operate. 1961 There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255) 1962 See: <http://www.scintilla.org/ScintillaDoc.html#StyleDefinition>. 1963 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 1964 Scintilla components in the same script. The wrapper will remember the last used hwnd, 1965 so you can specify it once and only specify it again when you want to operate on a different 1966 component. 1967 1968 Returns: 1969 hMode - True or False. 1970 1971 Examples: 1972 (Start Code) 1973 #include ../SCI.ahk 1974 1975 Gui +LastFound 1976 hwnd:=WinExist() 1977 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 1978 Gui, show, w400 h300 1979 SCI_StyleSetHotspot("STYLE_DEFAULT", True, hSci1) 1980 SCI_StyleClearAll() 1981 msgbox % SCI_StyleGetHotspot("STYLE_DEFAULT", hSci1) 1982 return 1983 (End) 1984*/ 1985SCI_StyleGetHotspot(stNumber, hwnd=0){ 1986 1987 return SCI_sendEditor(hwnd, "SCI_STYLEGETHOTSPOT", stNumber) 1988} 1989 1990/* Group: Margins 1991 <http://www.scintilla.org/ScintillaDoc.html#Margins> 1992 1993 There may be up to five margins to the left of the text display, plus a gap either side of the text. Each 1994 margin can be set to display either symbols or line numbers with <SetMarginTypeN()>. The markers that can be 1995 displayed in each margin are set with <SetMarginMaskN()>. Any markers not associated with a visible margin will 1996 be displayed as changes in background colour in the text. A width in pixels can be set for each margin. Margins 1997 with a zero width are ignored completely. You can choose if a mouse click in a margin sends a *SCN_MARGINCLICK* 1998 notification to the container or selects a line of text. 1999 2000 The margins are numbered 0 to 4. Using a margin number outside the valid range has no effect. By default, 2001 margin 0 is set to display line numbers, but is given a width of 0, so it is hidden. Margin 1 is set to display 2002 non-folding symbols and is given a width of 16 pixels, so it is visible. Margin 2 is set to display the folding 2003 symbols, but is given a width of 0, so it is hidden. Of course, you can set the margins to be whatever you wish. 2004 2005 Styled text margins used to show revision and blame information: 2006 2007 (see styledmargin.png) 2008*/ 2009 2010; Group: Margins [Set] 2011 2012/* 2013 Function: SetMarginWidthN 2014 <http://www.scintilla.org/ScintillaDoc.html#SCI_SETMARGINWIDTHN> 2015 2016 These routines set and get the width of a margin in pixels. A margin with zero width is invisible. 2017 By default, Scintilla sets margin 1 for symbols with a width of 16 pixels, 2018 so this is a reasonable guess if you are not sure what would be appropriate. 2019 Line number margins widths should take into account the number of lines in the document and 2020 the line number style. You could use something like SCI_TextWidth("STYLE_LINENUMBER", "_99999") 2021 to get a suitable width. 2022 2023 Parameters: 2024 SCI_SetMarginWidthN(mar, px[, hwnd]) 2025 2026 mar - Numeric value for the margin you wish to modify (0-4). 2027 px - Size of the margin in pixels. 2028 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 2029 Scintilla components in the same script. The wrapper will remember the last used hwnd, 2030 so you can specify it once and only specify it again when you want to operate on a different 2031 component. 2032 2033 Returns: 2034 Zero - Nothing is returned by this function. 2035 2036 Examples: 2037 (Start Code) 2038 #include ../SCI.ahk 2039 2040 Gui +LastFound 2041 hwnd:=WinExist() 2042 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 2043 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 2044 Gui, show, w400 h570 2045 SCI_SetMarginWidthN(0, 40, hSci1) 2046 SCI_SetMarginWidthN(1, 10) 2047 SCI_SetMarginWidthN(1, 5, hSci2) 2048 return 2049 (End) 2050*/ 2051SCI_SetMarginWidthN(mar, px, hwnd=0){ 2052 2053 return SCI_SendEditor(hwnd, "SCI_SETMARGINWIDTHN", mar, px) 2054} 2055 2056; Group: Margins [Get] 2057 2058/* 2059 Function: GetMarginWidthN 2060 <http://www.scintilla.org/ScintillaDoc.html#SCI_GETMARGINWIDTHN> 2061 2062 This is the routine that retrieves the width in pixels of the margin queried. 2063 2064 Parameters: 2065 SCI_GetMarginWidthN(mar[, hwnd]) 2066 2067 mar - Numeric value for the margin you wish to query (0-4). 2068 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 2069 Scintilla components in the same script. The wrapper will remember the last used hwnd, 2070 so you can specify it once and only specify it again when you want to operate on a different 2071 component. 2072 2073 Returns: 2074 wMargin - Width in pixles of the selected margin. 2075 2076 Examples: 2077 (Start Code) 2078 #include ../SCI.ahk 2079 2080 Gui +LastFound 2081 hwnd:=WinExist() 2082 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 2083 Gui, show, w400 h300 2084 SCI_SetMarginWidthN(0, 25, hSci1) 2085 msgbox % SCI_GetMarginWidthN(0) 2086 return 2087 (End) 2088*/ 2089SCI_GetMarginWidthN(mar, hwnd=0){ 2090 2091 return SCI_SendEditor(hwnd, "SCI_GETMARGINWIDTHN", mar) 2092} 2093 2094/* Group: Line Wrapping 2095 <http://www.scintilla.org/ScintillaDoc.html#LineWrapping> 2096 2097 By default, Scintilla does not wrap lines of text. If you enable line wrapping, lines wider than the window 2098 width are continued on the following lines. Lines are broken after space or tab characters or between runs of 2099 different styles. If this is not possible because a word in one style is wider than the window then the break 2100 occurs after the last character that completely fits on the line. The horizontal scroll bar does not appear 2101 when wrap mode is on. 2102 2103 For wrapped lines Scintilla can draw visual flags (little arrows) at end of a a subline of a wrapped line and 2104 at begin of the next subline. These can be enabled individually, but if Scintilla draws the visual flag at the 2105 beginning of the next subline this subline will be indented by one char. Independent from drawing a visual flag 2106 at the begin the subline can have an indention. 2107 2108 Much of the time used by Scintilla is spent on laying out and drawing text. The same text layout calculations 2109 may be performed many times even when the data used in these calculations does not change. To avoid these 2110 unnecessary calculations in some circumstances, the line layout cache can store the results of the 2111 calculations. The cache is invalidated whenever the underlying data, such as the contents or styling of the 2112 document changes. Caching the layout of the whole document has the most effect, making dynamic line wrap as 2113 much as 20 times faster but this requires 7 times the memory required by the document contents plus around 80 2114 bytes per line. 2115 2116 Wrapping is not performed immediately there is a change but is delayed until the display is redrawn. This delay 2117 improves peformance by allowing a set of changes to be performed and then wrapped and displayed once. Because 2118 of this, some operations may not occur as expected. If a file is read and the scroll position moved to a 2119 particular line in the text, such as occurs when a container tries to restore a previous editing session, then 2120 the scroll position will have been determined before wrapping so an unexpected range of text will be displayed. 2121 To scroll to the position correctly, delay the scroll until the wrapping has been performed by waiting for an 2122 initial *SCN_PAINTED* notification. 2123*/ 2124 2125; Group: Line Wrapping [Set] 2126 2127/* 2128 Function: SetWrapMode 2129 <http://www.scintilla.org/ScintillaDoc.html#SCI_SETWRAPMODE> 2130 2131 Enables, disables or changes the wrap mode for the Scintilla component. 2132 2133 Parameters: 2134 SCI_SetWrapMode([wMode, hwnd]) 2135 2136 wMode - Numeric value for the mode (Default 1). The Available modes are: 2137 - *SC_WRAP_NONE* (0) to disable wrapping 2138 - *SC_WRAP_WORD* (1) to enable wrapping on word boundaries. 2139 - *SC_WRAP_CHAR* (2) to enable wrapping between any characters. 2140 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 2141 Scintilla components in the same script. The wrapper will remember the last used hwnd, 2142 so you can specify it once and only specify it again when you want to operate on a different 2143 component. 2144 2145 Returns: 2146 Zero - Nothing is returned by this function. 2147 2148 Examples: 2149 (Start Code) 2150 #include ../SCI.ahk 2151 2152 Gui +LastFound 2153 hwnd:=WinExist() 2154 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 2155 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 2156 Gui, show, w400 h570 2157 SCI_SetWrapMode(True, hSci1) 2158 SCI_SetWrapMode("SC_WRAP_CHAR", hSci2) 2159 return 2160 (End) 2161*/ 2162SCI_SetWrapMode(wMode=1, hwnd=0){ 2163 2164 return SCI_SendEditor(hwnd, "SCI_SETWRAPMODE", wMode) 2165} 2166 2167; Group: Line Wrapping [Get] 2168 2169/* 2170 Function: GetWrapMode 2171 <http://www.scintilla.org/ScintillaDoc.html#SCI_GETWRAPMODE> 2172 2173 Get the current state of the wrap mode for the Scintilla component. 2174 2175 Parameters: 2176 SCI_SetWrapMode([hwnd]) 2177 2178 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 2179 Scintilla components in the same script. The wrapper will remember the last used hwnd, 2180 so you can specify it once and only specify it again when you want to operate on a different 2181 component. 2182 2183 Returns: 2184 wMode - Numeric value of the current mode. The Available modes are: 2185 - *SC_WRAP_NONE* (0) wrapping disabled. 2186 - *SC_WRAP_WORD* (1) wrapping on word boundaries enabled. 2187 - *SC_WRAP_CHAR* (2) wrapping between any characters enabled. 2188 2189 Examples: 2190 (Start Code) 2191 #include ../SCI.ahk 2192 2193 Gui +LastFound 2194 hwnd:=WinExist() 2195 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 2196 hSci2:=SCI_Add(hwnd, x, 290, w, h, "WS_CHILD WS_VISIBLE") 2197 Gui, show, w400 h570 2198 SCI_SetWrapMode(True, hSci1) 2199 SCI_SetWrapMode("SC_WRAP_CHAR", hSci2) 2200 msgbox % SCI_GetWrapMode(hSci1) 2201 msgbox % SCI_GetWrapMode(hSci2) 2202 return 2203 (End) 2204*/ 2205SCI_GetWrapMode(hwnd=0){ 2206 2207 return SCI_sendEditor(hwnd, "SCI_GETWRAPMODE") 2208} 2209 2210/* Group: Lexer 2211 <http://www.scintilla.org/ScintillaDoc.html#Lexer> 2212 2213 If you define the symbol *SCI_LEXER* when building Scintilla, (this is sometimes called the SciLexer version of 2214 Scintilla), lexing support for a wide range of programming languages is included and the messages in this 2215 section are supported. If you want to set styling and fold points for an unsupported language you can either do 2216 this in the container or better still, write your own lexer following the pattern of one of the existing ones. 2217 2218 Scintilla also supports external lexers. These are DLLs (on Windows) or .so modules (on GTK+/Linux) that export 2219 three functions: GetLexerCount, GetLexerName, and GetLexerFactory. See externalLexer.cxx for more. 2220*/ 2221 2222; Group: General Lexer Functions 2223 2224; /* needs work 2225 ; Function: LoadLexerLibrary 2226 ; <http://www.scintilla.org/ScintillaDoc.html#SCI_LOADLEXERLIBRARY> 2227 2228 ; Load a lexer implemented in a shared library. This is a .so file on GTK+/Linux or a .DLL file on Windows. 2229 2230 ; Parameters: 2231 ; SCI_LoadLexerLibrary(lPath[, hwnd]) 2232 2233 ; lPath - Path to the dll lexer to be loaded. 2234 ; hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 2235 ; Scintilla components in the same script. The wrapper will remember the last used hwnd, 2236 ; so you can specify it once and only specify it again when you want to operate on a different 2237 ; component. 2238 2239 ; Returns: 2240 ; Zero - Nothing is returned by this function. 2241 2242 ; Examples: 2243 ; >SCI_LoadLexerLibrary("c:\program files\dll\mylexer.dll") 2244 ; >SCI_LoadLexerLibrary(a_desktop "\mylexer.dll") 2245 2246; */ 2247; SCI_LoadLexerLibrary(lPath, hwnd=0){ 2248 2249 ; a_isunicode ? (VarSetCapacity(lPathA, StrPut(lPath, "CP0")), StrPut(lPath, &lPathA, "CP0")) 2250 ; return SCI_SendEditor(hwnd, "SCI_LOADLEXERLIBRARY", 0, a_isunicode ? &lPathA : &lPath) 2251; } 2252 2253; /* not tested 2254 ; Function: Colorise 2255 ; <http://www.scintilla.org/ScintillaDoc.html#SCI_COLOURISE> 2256 2257 ; This requests the current lexer or the container (if the lexer is set to *SCLEX_CONTAINER*) 2258 ; to style the document between stPos and endPos. If endPos is -1, the document is styled from 2259 ; stPos to the end. 2260 2261 ; Parameters: 2262 ; SCI_Colorise(stPos, endPos[, hwnd]) 2263 2264 ; stPos - Starting position where to begin colorizing. 2265 ; endPos - End position. 2266 ; hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 2267 ; Scintilla components in the same script. The wrapper will remember the last used hwnd, 2268 ; so you can specify it once and only specify it again when you want to operate on a different 2269 ; component. 2270 2271 ; Returns: 2272 ; Zero - Nothing is returned by this function. 2273 2274 ; Examples: 2275 ; >SCI_Colorise(0,-1) 2276; */ 2277; SCI_Colorise(stPos, endPos, hwnd=0){ 2278 2279 ; return SCI_SendEditor(hwnd, "SCI_COLORISE", stPos, endPos) 2280; } 2281 2282; /* not tested 2283 ; Function: ChangeLexerState 2284 ; <http://www.scintilla.org/ScintillaDoc.html#SCI_CHANGELEXERSTATE> 2285 2286 ; Indicate that the internal state of a lexer has changed over a range and therefore there may be 2287 ; a need to redraw. 2288 2289 ; Parameters: 2290 ; SCI_ChangeLexerState(stPos, endPos[, hwnd]) 2291 2292 ; stPos - Starting position where to begin colorizing. 2293 ; endPos - End position. 2294 ; hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 2295 ; Scintilla components in the same script. The wrapper will remember the last used hwnd, 2296 ; so you can specify it once and only specify it again when you want to operate on a different 2297 ; component. 2298 2299 ; Returns: 2300 ; Zero - Nothing is returned by this function. 2301 2302 ; Examples: 2303 ; >SCI_ChangeLexerState(5,10) 2304; */ 2305; SCI_ChangeLexerState(stPos, endPos, hwnd=0){ 2306 2307 ; return SCI_SendEditor(hwnd, "SCI_CHANGELEXERSTATE", stPos, endPos) 2308; } 2309 2310; Group: Lexer [Set] 2311 2312/* 2313 Function: SetLexer 2314 <http://www.scintilla.org/ScintillaDoc.html#SCI_SETLEXER> 2315 2316 You can select the lexer to use with an integer code from the SCLEX_* enumeration in Scintilla.h. 2317 There are two codes in this sequence that do not use lexers: *SCLEX_NULL* to select no lexing action and 2318 *SCLEX_CONTAINER* which sends the *SCN_STYLENEEDED* notification to the container whenever a range of text 2319 needs to be styled. 2320 You cannot use the *SCLEX_AUTOMATIC* value; this identifies additional external lexers that Scintilla assigns 2321 unused lexer numbers to. 2322 2323 Parameters: 2324 SCI_SetLexer(lNumber[, hwnd]) 2325 2326 lNumber - The number of the lexer that you want to use (if you are loading SciLexer.dll) which can be 2327 a number between *SCLEX_CONTAINER* (0) and SCLEX_BLITZMAX (78) the available lexers are: 2328 - SCLEX_CONTAINER (0) 2329 - SCLEX_NULL (1) 2330 - SCLEX_PYTHON (2) 2331 - SCLEX_CPP (3) 2332 - SCLEX_HTML (4) 2333 - SCLEX_XML (5) 2334 - SCLEX_PERL (6) 2335 - SCLEX_SQL (7) 2336 - SCLEX_VB (8) 2337 - SCLEX_PROPERTIES (9) 2338 - SCLEX_ERRORLIST (10) 2339 - SCLEX_MAKEFILE (11) 2340 - SCLEX_BATCH (12) 2341 - SCLEX_XCODE (13) 2342 - SCLEX_LATEX (14) 2343 - SCLEX_LUA (15) 2344 - SCLEX_DIFF (16) 2345 - SCLEX_CONF (17) 2346 - SCLEX_PASCAL (18) 2347 - SCLEX_AVE (19) 2348 - SCLEX_ADA (20) 2349 - SCLEX_LISP (21) 2350 - SCLEX_RUBY (22) 2351 - SCLEX_EIFFEL (23) 2352 - SCLEX_EIFFELKW (24) 2353 - SCLEX_TCL (25) 2354 - SCLEX_NNCRONTAB (26) 2355 - SCLEX_BULLANT (27) 2356 - SCLEX_VBSCRIPT (28) 2357 - SCLEX_BAAN (31) 2358 - SCLEX_MATLAB (32) 2359 - SCLEX_SCRIPTOL (33) 2360 - SCLEX_ASM (34) 2361 - SCLEX_CPPNOCASE (35) 2362 - SCLEX_FORTRAN (36) 2363 - SCLEX_F77 (37) 2364 - SCLEX_CSS (38) 2365 - SCLEX_POV (39) 2366 - SCLEX_LOUT (40) 2367 - SCLEX_ESCRIPT (41) 2368 - SCLEX_PS (42) 2369 - SCLEX_NSIS (43) 2370 - SCLEX_MMIXAL (44) 2371 - SCLEX_CLW (45) 2372 - SCLEX_CLWNOCASE (46) 2373 - SCLEX_LOT (47) 2374 - SCLEX_YAML (48) 2375 - SCLEX_TEX (49) 2376 - SCLEX_METAPOST (50) 2377 - SCLEX_POWERBASIC (51) 2378 - SCLEX_FORTH (52) 2379 - SCLEX_ERLANG (53) 2380 - SCLEX_OCTAVE (54) 2381 - SCLEX_MSSQL (55) 2382 - SCLEX_VERILOG (56) 2383 - SCLEX_KIX (57) 2384 - SCLEX_GUI4CLI (58) 2385 - SCLEX_SPECMAN (59) 2386 - SCLEX_AU3 (60) 2387 - SCLEX_APDL (61) 2388 - SCLEX_BASH (62) 2389 - SCLEX_ASN1 (63) 2390 - SCLEX_VHDL (64) 2391 - SCLEX_CAML (65) 2392 - SCLEX_BLITZBASIC (66) 2393 - SCLEX_PUREBASIC (67) 2394 - SCLEX_HASKELL (68) 2395 - SCLEX_PHPSCRIPT (69) 2396 - SCLEX_TADS3 (70) 2397 - SCLEX_REBOL (71) 2398 - SCLEX_SMALLTALK (72) 2399 - SCLEX_FLAGSHIP (73) 2400 - SCLEX_CSOUND (74) 2401 - SCLEX_FREEBASIC (75) 2402 - SCLEX_INNOSETUP (76) 2403 - SCLEX_OPAL (77) 2404 - SCLEX_BLITZMAX (78) 2405 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 2406 Scintilla components in the same script. The wrapper will remember the last used hwnd, 2407 so you can specify it once and only specify it again when you want to operate on a different 2408 component. 2409 2410 Returns: 2411 Zero - Nothing is returned by this function. 2412 2413 Examples: 2414 (Start Code) 2415 ; The scintilla component will colorize any of the keywords below as blue and bold, using the 2416 ; internal C++ Lexer. 2417 #include ../SCI.ahk 2418 2419 Gui +LastFound 2420 hwnd:=WinExist() 2421 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 2422 Gui, show, w400 h300 2423 SCI_SetWrapMode(True, hSci1) 2424 SCI_SetLexer("SCLEX_CPP") 2425 SCI_StyleClearAll() 2426 2427 SCI_SetKeywords(0, "if else switch case default break goto return for while do continue typedef sizeof NULL new delete throw try catch namespace operator this const_cast static_cast dynamic_cast reinterpret_cast true false using typeid and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq") 2428 2429 SCI_StyleSetFore(5, "blue") 2430 SCI_StyleSetBold(5, True) 2431 return 2432 (End) 2433*/ 2434SCI_SetLexer(lNumber, hwnd=0){ 2435 2436 return SCI_sendEditor(hwnd, "SCI_SETLEXER", lNumber) 2437} 2438 2439/* 2440 Function: SetKeywords 2441 <http://www.scintilla.org/ScintillaDoc.html#SCI_SETKEYWORDS> 2442 2443 Parameters: 2444 SCI_SetKeywords(kSet, kList[, hwnd]) 2445 2446 kSet - kSet can be 0 to 8 (actually 0 to KEYWORDSET_MAX) and selects which keyword list to replace. 2447 kList - is a list of keywords separated by spaces, tabs, "\n" or "\r" or any combination of these. 2448 It is expected that the keywords will be composed of standard ASCII printing characters, 2449 but there is nothing to stop you using any non-separator character codes from 1 to 255 2450 (except common sense). 2451 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 2452 Scintilla components in the same script. The wrapper will remember the last used hwnd, 2453 so you can specify it once and only specify it again when you want to operate on a different 2454 component. 2455 2456 Returns: 2457 Zero - Nothing is returned by this function. 2458 2459 Examples: 2460 (Start Code) 2461 ; The scintilla component will colorize any of the keywords below as blue and bold, using the 2462 ; internal C++ Lexer. 2463 #include ../SCI.ahk 2464 2465 Gui +LastFound 2466 hwnd:=WinExist() 2467 hSci1:=SCI_Add(hwnd, x, y, w, h, "WS_CHILD WS_VISIBLE") 2468 Gui, show, w400 h300 2469 SCI_SetWrapMode(True, hSci1) 2470 SCI_SetLexer("SCLEX_CPP") 2471 SCI_StyleClearAll() 2472 2473 SCI_SetKeywords(0, "if else switch case default break goto return for while do continue typedef sizeof NULL new delete throw try catch namespace operator this const_cast static_cast dynamic_cast reinterpret_cast true false using typeid and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq") 2474 2475 SCI_StyleSetFore(5, "blue") 2476 SCI_StyleSetBold(5, True) 2477 return 2478 (End) 2479*/ 2480SCI_SetKeywords(kSet, kList, hwnd=0){ 2481 2482 a_isunicode ? (VarSetCapacity(kListA, StrPut(kList, "CP0")), StrPut(kList, &kListA, "CP0")) 2483 return SCI_SendEditor(hwnd, "SCI_SETKEYWORDS", kSet, a_isunicode ? &kListA : &kList) 2484} 2485 2486; Group: Lexer [Get] 2487 2488 ; ---- [ INTERNAL FUNCTIONS ] ----- ; 2489 2490SCI(var, val=""){ 2491 static 2492 SCN_STYLENEEDED := 2000 2493 SCN_CHARADDED := 2001 2494 SCN_SAVEPOINTREACHED := 2002 2495 SCN_SAVEPOINTLEFT := 2003 2496 SCN_MODIFYATTEMPTRO := 2004 2497 SCN_KEY := 2005 2498 SCN_DOUBLECLICK := 2006 2499 SCN_UPDATEUI := 2007 2500 SCN_MODIFIED := 2008 2501 SCN_MACRORECORD := 2009 2502 SCN_MARGINCLICK := 2010 2503 SCN_NEEDSHOWN := 2011 2504 SCN_PAINTED := 2013 2505 SCN_USERLISTSELECTION := 2014 2506 SCN_URIDROPPED := 2015 2507 SCN_DWELLSTART := 2016 2508 SCN_DWELLEND := 2017 2509 SCN_ZOOM := 2018 2510 SCN_HOTSPOTCLICK := 2019 2511 SCN_HOTSPOTDOUBLECLICK := 2020 2512 SCN_CALLTIPCLICK := 2021 2513 SCN_AUTOCSELECTION := 2022 2514 2515 lvar := %var%, val != "" ? %var% := val 2516 return lvar 2517} 2518 2519/* 2520 Function : sendEditor 2521 Posts the messages used to modify the control's behaviour. 2522 2523 Parameters: 2524 SCI_sendEditor(hwnd, msg, [wParam, lParam]) 2525 2526 hwnd - The hwnd of the control that you want to operate on. Useful for when you have more than 1 2527 Scintilla components in the same script. The wrapper will remember the last used hwnd, 2528 so you can specify it once and only specify it again when you want to operate on a different 2529 component. 2530 msg - The message to be posted, full list can be found here: 2531 <http://www.scintilla.org/ScintillaDoc.html> 2532 wParam - wParam for the message 2533 lParam - lParam for the message 2534 2535 Returns: 2536 Status code of the DllCall performed. 2537 2538 Examples: 2539 (Start Code) 2540 SCI_sendEditor(hSci1, "SCI_SETMARGINWIDTHN",0,40) ; Set the margin 0 to 40px on the first component. 2541 SCI_sendEditor(0, "SCI_SETWRAPMODE",1,0) ; Set wrap mode to True on the last used component. 2542 SCI_sendEditor(hSci2, "SCI_SETMARGINWIDTHN",0,50) ; Set the margin 0 to 50px on the second component. 2543 (End) 2544*/ 2545SCI_sendEditor(hwnd, msg=0, wParam=0, lParam=0){ 2546 static 2547 2548 hwnd := !hwnd ? oldhwnd : hwnd, oldhwnd := hwnd 2549 if !init 2550 { 2551 INVALID_POSITION:=-1,SCI_START:=2000,SCI_OPTIONAL_START:=3000,SCI_LEXER_START:=4000,SCI_ADDTEXT:=2001 2552 SCI_ADDSTYLEDTEXT:=2002,SCI_INSERTTEXT:=2003,SCI_CLEARALL:=2004,SCI_CLEARDOCUMENTSTYLE:=2005 2553 SCI_GETLENGTH:=2006,SCI_GETCHARAT:=2007,SCI_GETCURRENTPOS:=2008,SCI_GETANCHOR:=2009,SCI_GETSTYLEAT:=2010 2554 SCI_REDO:=2011,SCI_SETUNDOCOLLECTION:=2012,SCI_SELECTALL:=2013,SCI_SETSAVEPOINT:=2014 2555 SCI_GETSTYLEDTEXT:=2015,SCI_CANREDO:=2016,SCI_MARKERLINEFROMHANDLE:=2017,SCI_MARKERDELETEHANDLE:=2018 2556 SCI_GETUNDOCOLLECTION:=2019,SCWS_INVISIBLE:=0,SCWS_VISIBLEALWAYS:=1,SCWS_VISIBLEAFTERINDENT:=2 2557 SCI_GETVIEWWS:=2020,SCI_SETVIEWWS:=2021,SCI_POSITIONFROMPOINT:=2022,SCI_POSITIONFROMPOINTCLOSE:=2023 2558 SCI_GOTOLINE:=2024,SCI_GOTOPOS:=2025,SCI_SETANCHOR:=2026,SCI_GETCURLINE:=2027,SCI_GETENDSTYLED:=2028 2559 SC_EOL_CRLF:=0,SC_EOL_CR:=1,SC_EOL_LF:=2,SCI_CONVERTEOLS:=2029,SCI_GETEOLMODE:=2030,SCI_SETEOLMODE:=2031 2560 SCI_STARTSTYLING:=2032,SCI_SETSTYLING:=2033,SCI_GETBUFFEREDDRAW:=2034,SCI_SETBUFFEREDDRAW:=2035 2561 SCI_SETTABWIDTH:=2036,SCI_GETTABWIDTH:=2121,SC_CP_UTF8:=65001,SC_CP_DBCS:=1,SCI_SETCODEPAGE:=2037 2562 SCI_SETUSEPALETTE:=2039,MARKER_MAX:=31,SC_MARK_CIRCLE:=0,SC_MARK_ROUNDRECT:=1,SC_MARK_ARROW:=2 2563 SC_MARK_SMALLRECT:=3,SC_MARK_SHORTARROW:=4,SC_MARK_EMPTY:=5,SC_MARK_ARROWDOWN:=6,SC_MARK_MINUS:=7 2564 SC_MARK_PLUS:=8,SC_MARK_VLINE:=9,SC_MARK_LCORNER:=10,SC_MARK_TCORNER:=11,SC_MARK_BOXPLUS:=12 2565 SC_MARK_BOXPLUSCONNECTED:=13,SC_MARK_BOXMINUS:=14,SC_MARK_BOXMINUSCONNECTED:=15,SC_MARK_LCORNERCURVE:=16 2566 SC_MARK_TCORNERCURVE:=17,SC_MARK_CIRCLEPLUS:=18,SC_MARK_CIRCLEPLUSCONNECTED:=19,SC_MARK_CIRCLEMINUS:=20 2567 SC_MARK_CIRCLEMINUSCONNECTED:=21,SC_MARK_BACKGROUND:=22,SC_MARK_DOTDOTDOT:=23,SC_MARK_ARROWS:=24 2568 SC_MARK_PIXMAP:=25,SC_MARK_FULLRECT:=26,SC_MARK_CHARACTER:=10000,SC_MARKNUM_FOLDEREND:=25 2569 SC_MARKNUM_FOLDEROPENMID:=26,SC_MARKNUM_FOLDERMIDTAIL:=27,SC_MARKNUM_FOLDERTAIL:=28 2570 SC_MARKNUM_FOLDERSUB:=29,SC_MARKNUM_FOLDER:=30,SC_MARKNUM_FOLDEROPEN:=31,SC_MASK_FOLDERS:=0xFE000000 2571 SCI_MARKERDEFINE:=2040,SCI_MARKERSETFORE:=2041,SCI_MARKERSETBACK:=2042,SCI_MARKERADD:=2043 2572 SCI_MARKERDELETE:=2044,SCI_MARKERDELETEALL:=2045,SCI_MARKERGET:=2046,SCI_MARKERNEXT:=2047 2573 SCI_MARKERPREVIOUS:=2048,SCI_MARKERDEFINEPIXMAP:=2049,SCI_MARKERADDSET:=2466,SCI_MARKERSETALPHA:=2476 2574 SC_MARGIN_SYMBOL:=0,SC_MARGIN_NUMBER:=1,SCI_SETMARGINTYPEN:=2240,SCI_GETMARGINTYPEN:=2241 2575 SCI_SETMARGINWIDTHN:=2242,SCI_GETMARGINWIDTHN:=2243,SCI_SETMARGINMASKN:=2244,SCI_GETMARGINMASKN:=2245 2576 SCI_SETMARGINSENSITIVEN:=2246,SCI_GETMARGINSENSITIVEN:=2247,STYLE_DEFAULT:=32,STYLE_LINENUMBER:=33 2577 STYLE_BRACELIGHT:=34,STYLE_BRACEBAD:=35,STYLE_CONTROLCHAR:=36,STYLE_INDENTGUIDE:=37,STYLE_CALLTIP:=38 2578 STYLE_LASTPREDEFINED:=39,STYLE_MAX:=127,SC_CHARSET_ANSI:=0,SC_CHARSET_DEFAULT:=1,SC_CHARSET_BALTIC:=186 2579 SC_CHARSET_CHINESEBIG5:=136,SC_CHARSET_EASTEUROPE:=238,SC_CHARSET_GB2312:=134,SC_CHARSET_GREEK:=161 2580 SC_CHARSET_HANGUL:=129,SC_CHARSET_MAC:=77,SC_CHARSET_OEM:=255,SC_CHARSET_RUSSIAN:=204 2581 SC_CHARSET_CYRILLIC:=1251,SC_CHARSET_SHIFTJIS:=128,SC_CHARSET_SYMBOL:=2,SC_CHARSET_TURKISH:=162 2582 SC_CHARSET_JOHAB:=130,SC_CHARSET_HEBREW:=177,SC_CHARSET_ARABIC:=178,SC_CHARSET_VIETNAMESE:=163 2583 SC_CHARSET_THAI:=222,SC_CHARSET_8859_15:=1000,SCI_STYLECLEARALL:=2050,SCI_STYLESETFORE:=2051 2584 SCI_STYLESETBACK:=2052,SCI_STYLESETBOLD:=2053,SCI_STYLESETITALIC:=2054,SCI_STYLESETSIZE:=2055 2585 SCI_STYLESETFONT:=2056,SCI_STYLESETEOLFILLED:=2057,SCI_STYLEGETFORE:=2481,SCI_STYLEGETBACK:=2482 2586 SCI_STYLEGETBOLD:=2483,SCI_STYLEGETITALIC:=2484,SCI_STYLEGETSIZE:=2485,SCI_STYLEGETFONT:=2486 2587 SCI_STYLEGETEOLFILLED:=2487,SCI_STYLEGETUNDERLINE:=2488,SCI_STYLEGETCASE:=2489 2588 SCI_STYLEGETCHARACTERSET:=2490,SCI_STYLEGETVISIBLE:=2491,SCI_STYLEGETCHANGEABLE:=2492 2589 SCI_STYLEGETHOTSPOT:=2493,SCI_STYLERESETDEFAULT:=2058,SCI_STYLESETUNDERLINE:=2059,SC_CASE_MIXED:=0 2590 SC_CASE_UPPER:=1,SC_CASE_LOWER:=2,SCI_STYLESETCASE:=2060,SCI_STYLESETCHARACTERSET:=2066 2591 SCI_STYLESETHOTSPOT:=2409,SCI_SETSELFORE:=2067,SCI_SETSELBACK:=2068,SCI_GETSELALPHA:=2477 2592 SCI_SETSELALPHA:=2478,SCI_SETCARETFORE:=2069,SCI_ASSIGNCMDKEY:=2070,SCI_CLEARCMDKEY:=2071 2593 SCI_CLEARALLCMDKEYS:=2072,SCI_SETSTYLINGEX:=2073,SCI_STYLESETVISIBLE:=2074,SCI_GETCARETPERIOD:=2075 2594 SCI_SETCARETPERIOD:=2076,SCI_SETWORDCHARS:=2077,SCI_BEGINUNDOACTION:=2078,SCI_ENDUNDOACTION:=2079 2595 INDIC_MAX:=7,INDIC_PLAIN:=0,INDIC_SQUIGGLE:=1,INDIC_TT:=2,INDIC_DIAGONAL:=3,INDIC_STRIKE:=4 2596 INDIC_HIDDEN:=5,INDIC_BOX:=6,INDIC_ROUNDBOX:=7,INDIC0_MASK:=0x20,INDIC1_MASK:=0x40,INDIC2_MASK:=0x80 2597 INDICS_MASK:=0xE0,SCI_INDICSETSTYLE:=2080,SCI_INDICGETSTYLE:=2081,SCI_INDICSETFORE:=2082 2598 SCI_INDICGETFORE:=2083,SCI_SETWHITESPACEFORE:=2084,SCI_SETWHITESPACEBACK:=2085,SCI_SETSTYLEBITS:=2090 2599 SCI_GETSTYLEBITS:=2091,SCI_SETLINESTATE:=2092,SCI_GETLINESTATE:=2093,SCI_GETMAXLINESTATE:=2094 2600 SCI_GETCARETLINEVISIBLE:=2095,SCI_SETCARETLINEVISIBLE:=2096,SCI_GETCARETLINEBACK:=2097 2601 SCI_SETCARETLINEBACK:=2098,SCI_STYLESETCHANGEABLE:=2099,SCI_AUTOCSHOW:=2100,SCI_AUTOCCANCEL:=2101 2602 SCI_AUTOCACTIVE:=2102,SCI_AUTOCPOSSTART:=2103,SCI_AUTOCCOMPLETE:=2104,SCI_AUTOCSTOPS:=2105 2603 SCI_AUTOCSETSEPARATOR:=2106,SCI_AUTOCGETSEPARATOR:=2107,SCI_AUTOCSELECT:=2108 2604 SCI_AUTOCSETCANCELATSTART:=2110,SCI_AUTOCGETCANCELATSTART:=2111,SCI_AUTOCSETFILLUPS:=2112 2605 SCI_AUTOCSETCHOOSESINGLE:=2113,SCI_AUTOCGETCHOOSESINGLE:=2114,SCI_AUTOCSETIGNORECASE:=2115 2606 SCI_AUTOCGETIGNORECASE:=2116,SCI_USERLISTSHOW:=2117,SCI_AUTOCSETAUTOHIDE:=2118,SCI_AUTOCGETAUTOHIDE:=2119 2607 SCI_AUTOCSETDROPRESTOFWORD:=2270,SCI_AUTOCGETDROPRESTOFWORD:=2271,SCI_REGISTERIMAGE:=2405 2608 SCI_CLEARREGISTEREDIMAGES:=2408,SCI_AUTOCGETTYPESEPARATOR:=2285,SCI_AUTOCSETTYPESEPARATOR:=2286 2609 SCI_AUTOCSETMAXWIDTH:=2208,SCI_AUTOCGETMAXWIDTH:=2209,SCI_AUTOCSETMAXHEIGHT:=2210 2610 SCI_AUTOCGETMAXHEIGHT:=2211,SCI_SETINDENT:=2122,SCI_GETINDENT:=2123,SCI_SETUSETABS:=2124 2611 SCI_GETUSETABS:=2125,SCI_SETLINEINDENTATION:=2126,SCI_GETLINEINDENTATION:=2127 2612 SCI_GETLINEINDENTPOSITION:=2128,SCI_GETCOLUMN:=2129,SCI_SETHSCROLLBAR:=2130,SCI_GETHSCROLLBAR:=2131 2613 SCI_SETINDENTATIONGUIDES:=2132,SCI_GETINDENTATIONGUIDES:=2133,SCI_SETHIGHLIGHTGUIDE:=2134 2614 SCI_GETHIGHLIGHTGUIDE:=2135,SCI_GETLINEENDPOSITION:=2136,SCI_GETCODEPAGE:=2137,SCI_GETCARETFORE:=2138 2615 SCI_GETUSEPALETTE:=2139,SCI_GETREADONLY:=2140,SCI_SETCURRENTPOS:=2141,SCI_SETSELECTIONSTART:=2142 2616 SCI_GETSELECTIONSTART:=2143,SCI_SETSELECTIONEND:=2144,SCI_GETSELECTIONEND:=2145 2617 SCI_SETPRINTMAGNIFICATION:=2146,SCI_GETPRINTMAGNIFICATION:=2147,SC_PRINT_NORMAL:=0 2618 SC_PRINT_INVERTLIGHT:=1,SC_PRINT_BLACKONWHITE:=2,SC_PRINT_COLORONWHITE:=3 2619 SC_PRINT_COLORONWHITEDEFAULTBG:=4,SCI_SETPRINTCOLORMODE:=2148,SCI_GETPRINTCOLORMODE:=2149 2620 SCFIND_WHOLEWORD:=2,SCFIND_MATCHCASE:=4,SCFIND_WORDSTART:=0x00100000,SCFIND_REGEXP:=0x00200000 2621 SCFIND_POSIX:=0x00400000,SCI_FINDTEXT:=2150,SCI_FORMATRANGE:=2151,SCI_GETFIRSTVISIBLELINE:=2152 2622 SCI_GETLINE:=2153,SCI_GETLINECOUNT:=2154,SCI_SETMARGINLEFT:=2155,SCI_GETMARGINLEFT:=2156 2623 SCI_SETMARGINRIGHT:=2157,SCI_GETMARGINRIGHT:=2158,SCI_GETMODIFY:=2159,SCI_SETSEL:=2160 2624 SCI_GETSELTEXT:=2161,SCI_GETTEXTRANGE:=2162,SCI_HIDESELECTION:=2163,SCI_POINTXFROMPOSITION:=2164 2625 SCI_POINTYFROMPOSITION:=2165,SCI_LINEFROMPOSITION:=2166,SCI_POSITIONFROMLINE:=2167,SCI_LINESCROLL:=2168 2626 SCI_SCROLLCARET:=2169,SCI_REPLACESEL:=2170,SCI_SETREADONLY:=2171,SCI_NULL:=2172,SCI_CANPASTE:=2173 2627 SCI_CANUNDO:=2174,SCI_EMPTYUNDOBUFFER:=2175,SCI_UNDO:=2176,SCI_CUT:=2177,SCI_COPY:=2178,SCI_PASTE:=2179 2628 SCI_CLEAR:=2180,SCI_SETTEXT:=2181,SCI_GETTEXT:=2182,SCI_GETTEXTLENGTH:=2183,SCI_GETDIRECTFUNCTION:=2184 2629 SCI_GETDIRECTPOINTER:=2185,SCI_SETOVERTYPE:=2186,SCI_GETOVERTYPE:=2187,SCI_SETCARETWIDTH:=2188 2630 SCI_GETCARETWIDTH:=2189,SCI_SETTARGETSTART:=2190,SCI_GETTARGETSTART:=2191,SCI_SETTARGETEND:=2192 2631 SCI_GETTARGETEND:=2193,SCI_REPLACETARGET:=2194,SCI_REPLACETARGETRE:=2195,SCI_SEARCHINTARGET:=2197 2632 SCI_SETSEARCHFLAGS:=2198,SCI_GETSEARCHFLAGS:=2199,SCI_CALLTIPSHOW:=2200,SCI_CALLTIPCANCEL:=2201 2633 SCI_CALLTIPACTIVE:=2202,SCI_CALLTIPPOSSTART:=2203,SCI_CALLTIPSETHLT:=2204,SCI_CALLTIPSETBACK:=2205 2634 SCI_CALLTIPSETFORE:=2206,SCI_CALLTIPSETFOREHLT:=2207,SCI_CALLTIPUSESTYLE:=2212 2635 SCI_VISIBLEFROMDOCLINE:=2220,SCI_DOCLINEFROMVISIBLE:=2221,SCI_WRAPCOUNT:=2235,SC_FOLDLEVELBASE:=0x400 2636 SC_FOLDLEVELWHITEFLAG:=0x1000,SC_FOLDLEVELHEADERFLAG:=0x2000,SC_FOLDLEVELBOXHEADERFLAG:=0x4000 2637 SC_FOLDLEVELBOXFOOTERFLAG:=0x8000,SC_FOLDLEVELCONTRACTED:=0x10000,SC_FOLDLEVELUNINDENT:=0x20000 2638 SC_FOLDLEVELNUMBERMASK:=0x0FFF,SCI_SETFOLDLEVEL:=2222,SCI_GETFOLDLEVEL:=2223,SCI_GETLASTCHILD:=2224 2639 SCI_GETFOLDPARENT:=2225,SCI_SHOWLINES:=2226,SCI_HIDELINES:=2227,SCI_GETLINEVISIBLE:=2228 2640 SCI_SETFOLDEXPANDED:=2229,SCI_GETFOLDEXPANDED:=2230,SCI_TOGGLEFOLD:=2231,SCI_ENSUREVISIBLE:=2232 2641 SC_FOLDFLAG_LINEBEFORE_EXPANDED:=0x0002,SC_FOLDFLAG_LINEBEFORE_CONTRACTED:=0x0004 2642 SC_FOLDFLAG_LINEAFTER_EXPANDED:=0x0008,SC_FOLDFLAG_LINEAFTER_CONTRACTED:=0x0010 2643 SC_FOLDFLAG_LEVELNUMBERS:=0x0040,SC_FOLDFLAG_BOX:=0x0001,SCI_SETFOLDFLAGS:=2233 2644 SCI_ENSUREVISIBLEENFORCEPOLICY:=2234,SCI_SETTABINDENTS:=2260,SCI_GETTABINDENTS:=2261 2645 SCI_SETBACKSPACEUNINDENTS:=2262,SCI_GETBACKSPACEUNINDENTS:=2263,SC_TIME_FOREVER:=10000000 2646 SCI_SETMOUSEDWELLTIME:=2264,SCI_GETMOUSEDWELLTIME:=2265,SCI_WORDSTARTPOSITION:=2266 2647 SCI_WORDENDPOSITION:=2267,SC_WRAP_NONE:=0,SC_WRAP_WORD:=1,SC_WRAP_CHAR:=2,SCI_SETWRAPMODE:=2268 2648 SCI_GETWRAPMODE:=2269,SC_WRAPVISUALFLAG_NONE:=0x0000,SC_WRAPVISUALFLAG_END:=0x0001 2649 SC_WRAPVISUALFLAG_START:=0x0002,SCI_SETWRAPVISUALFLAGS:=2460,SCI_GETWRAPVISUALFLAGS:=2461 2650 SC_WRAPVISUALFLAGLOC_DEFAULT:=0x0000,SC_WRAPVISUALFLAGLOC_END_BY_TEXT:=0x0001 2651 SC_WRAPVISUALFLAGLOC_START_BY_TEXT:=0x0002,SCI_SETWRAPVISUALFLAGSLOCATION:=2462 2652 SCI_GETWRAPVISUALFLAGSLOCATION:=2463,SCI_SETWRAPSTARTINDENT:=2464,SCI_GETWRAPSTARTINDENT:=2465 2653 SC_CACHE_NONE:=0,SC_CACHE_CARET:=1,SC_CACHE_PAGE:=2,SC_CACHE_DOCUMENT:=3,SCI_SETLAYOUTCACHE:=2272 2654 SCI_GETLAYOUTCACHE:=2273,SCI_SETSCROLLWIDTH:=2274,SCI_GETSCROLLWIDTH:=2275,SCI_TEXTWIDTH:=2276 2655 SCI_SETENDATLASTLINE:=2277,SCI_GETENDATLASTLINE:=2278,SCI_TEXTHEIGHT:=2279,SCI_SETVSCROLLBAR:=2280 2656 SCI_GETVSCROLLBAR:=2281,SCI_APPENDTEXT:=2282,SCI_GETTWOPHASEDRAW:=2283,SCI_SETTWOPHASEDRAW:=2284 2657 SCI_TARGETFROMSELECTION:=2287,SCI_LINESJOIN:=2288,SCI_LINESSPLIT:=2289,SCI_SETFOLDMARGINCOLOR:=2290 2658 SCI_SETFOLDMARGINHICOLOR:=2291,SCI_LINEDOWN:=2300,SCI_LINEDOWNEXTEND:=2301,SCI_LINEUP:=2302 2659 SCI_LINEUPEXTEND:=2303,SCI_CHARLEFT:=2304,SCI_CHARLEFTEXTEND:=2305,SCI_CHARRIGHT:=2306 2660 SCI_CHARRIGHTEXTEND:=2307,SCI_WORDLEFT:=2308,SCI_WORDLEFTEXTEND:=2309,SCI_WORDRIGHT:=2310 2661 SCI_WORDRIGHTEXTEND:=2311,SCI_HOME:=2312,SCI_HOMEEXTEND:=2313,SCI_LINEEND:=2314,SCI_LINEENDEXTEND:=2315 2662 SCI_DOCUMENTSTART:=2316,SCI_DOCUMENTSTARTEXTEND:=2317,SCI_DOCUMENTEND:=2318,SCI_DOCUMENTENDEXTEND:=2319 2663 SCI_PAGEUP:=2320,SCI_PAGEUPEXTEND:=2321,SCI_PAGEDOWN:=2322,SCI_PAGEDOWNEXTEND:=2323 2664 SCI_EDITTOGGLEOVERTYPE:=2324,SCI_CANCEL:=2325,SCI_DELETEBACK:=2326,SCI_TAB:=2327,SCI_BACKTAB:=2328 2665 SCI_NEWLINE:=2329,SCI_FORMFEED:=2330,SCI_VCHOME:=2331,SCI_VCHOMEEXTEND:=2332,SCI_ZOOMIN:=2333 2666 SCI_ZOOMOUT:=2334,SCI_DELWORDLEFT:=2335,SCI_DELWORDRIGHT:=2336,SCI_LINECUT:=2337,SCI_LINEDELETE:=2338 2667 SCI_LINETRANSPOSE:=2339,SCI_LINEDUPLICATE:=2404,SCI_LOWERCASE:=2340,SCI_UPPERCASE:=2341 2668 SCI_LINESCROLLDOWN:=2342,SCI_LINESCROLLUP:=2343,SCI_DELETEBACKNOTLINE:=2344,SCI_HOMEDISPLAY:=2345 2669 SCI_HOMEDISPLAYEXTEND:=2346,SCI_LINEENDDISPLAY:=2347,SCI_LINEENDDISPLAYEXTEND:=2348,SCI_HOMEWRAP:=2349 2670 SCI_HOMEWRAPEXTEND:=2450,SCI_LINEENDWRAP:=2451,SCI_LINEENDWRAPEXTEND:=2452,SCI_VCHOMEWRAP:=2453 2671 SCI_VCHOMEWRAPEXTEND:=2454,SCI_LINECOPY:=2455,SCI_MOVECARETINSIDEVIEW:=2401,SCI_LINELENGTH:=2350 2672 SCI_BRACEHIGHLIGHT:=2351,SCI_BRACEBADLIGHT:=2352,SCI_BRACEMATCH:=2353,SCI_GETVIEWEOL:=2355 2673 SCI_SETVIEWEOL:=2356,SCI_GETDOCPOINTER:=2357,SCI_SETDOCPOINTER:=2358,SCI_SETMODEVENTMASK:=2359 2674 EDGE_NONE:=0,EDGE_LINE:=1,EDGE_BACKGROUND:=2,SCI_GETEDGECOLUMN:=2360,SCI_SETEDGECOLUMN:=2361 2675 SCI_GETEDGEMODE:=2362,SCI_SETEDGEMODE:=2363,SCI_GETEDGECOLOR:=2364,SCI_SETEDGECOLOR:=2365 2676 SCI_SEARCHANCHOR:=2366,SCI_SEARCHNEXT:=2367,SCI_SEARCHPREV:=2368,SCI_LINESONSCREEN:=2370 2677 SCI_USEPOPUP:=2371,SCI_SELECTIONISRECTANGLE:=2372,SCI_SETZOOM:=2373,SCI_GETZOOM:=2374 2678 SCI_CREATEDOCUMENT:=2375,SCI_ADDREFDOCUMENT:=2376,SCI_RELEASEDOCUMENT:=2377,SCI_GETMODEVENTMASK:=2378 2679 SCI_SETFOCUS:=2380,SCI_GETFOCUS:=2381,SCI_SETSTATUS:=2382,SCI_GETSTATUS:=2383 2680 SCI_SETMOUSEDOWNCAPTURES:=2384,SCI_GETMOUSEDOWNCAPTURES:=2385,SC_CURSORNORMAL:=-1,SC_CURSORWAIT:=4 2681 SCI_SETCURSOR:=2386,SCI_GETCURSOR:=2387,SCI_SETCONTROLCHARSYMBOL:=2388,SCI_GETCONTROLCHARSYMBOL:=2389 2682 SCI_WORDPARTLEFT:=2390,SCI_WORDPARTLEFTEXTEND:=2391,SCI_WORDPARTRIGHT:=2392,SCI_WORDPARTRIGHTEXTEND:=2393 2683 VISIBLE_SLOP:=0x01,VISIBLE_STRICT:=0x04,SCI_SETVISIBLEPOLICY:=2394,SCI_DELLINELEFT:=2395 2684 SCI_DELLINERIGHT:=2396,SCI_SETXOFFSET:=2397,SCI_GETXOFFSET:=2398,SCI_CHOOSECARETX:=2399 2685 SCI_GRABFOCUS:=2400,CARET_SLOP:=0x01,CARET_STRICT:=0x04,CARET_JUMPS:=0x10,CARET_EVEN:=0x08 2686 SCI_SETXCARETPOLICY:=2402,SCI_SETYCARETPOLICY:=2403,SCI_SETPRINTWRAPMODE:=2406,SCI_GETPRINTWRAPMODE:=2407 2687 SCI_SETHOTSPOTACTIVEFORE:=2410,SCI_SETHOTSPOTACTIVEBACK:=2411,SCI_SETHOTSPOTACTIVEUNDERLINE:=2412 2688 SCI_SETHOTSPOTSINGLELINE:=2421,SCI_PARADOWN:=2413,SCI_PARADOWNEXTEND:=2414,SCI_PARAUP:=2415 2689 SCI_PARAUPEXTEND:=2416,SCI_POSITIONBEFORE:=2417,SCI_POSITIONAFTER:=2418,SCI_COPYRANGE:=2419 2690 SCI_COPYTEXT:=2420,SC_SEL_STREAM:=0,SC_SEL_RECTANGLE:=1,SC_SEL_LINES:=2,SCI_SETSELECTIONMODE:=2422 2691 SCI_GETSELECTIONMODE:=2423,SCI_GETLINESELSTARTPOSITION:=2424,SCI_GETLINESELENDPOSITION:=2425 2692 SCI_LINEDOWNRECTEXTEND:=2426,SCI_LINEUPRECTEXTEND:=2427,SCI_CHARLEFTRECTEXTEND:=2428 2693 SCI_CHARRIGHTRECTEXTEND:=2429,SCI_HOMERECTEXTEND:=2430,SCI_VCHOMERECTEXTEND:=2431 2694 SCI_LINEENDRECTEXTEND:=2432,SCI_PAGEUPRECTEXTEND:=2433,SCI_PAGEDOWNRECTEXTEND:=2434 2695 SCI_STUTTEREDPAGEUP:=2435,SCI_STUTTEREDPAGEUPEXTEND:=2436,SCI_STUTTEREDPAGEDOWN:=2437 2696 SCI_STUTTEREDPAGEDOWNEXTEND:=2438,SCI_WORDLEFTEND:=2439,SCI_WORDLEFTENDEXTEND:=2440 2697 SCI_WORDRIGHTEND:=2441,SCI_WORDRIGHTENDEXTEND:=2442,SCI_SETWHITESPACECHARS:=2443 2698 SCI_SETCHARSDEFAULT:=2444,SCI_AUTOCGETCURRENT:=2445,SCI_ALLOCATE:=2446,SCI_TARGETASUTF8:=2447 2699 SCI_SETLENGTHFORENCODE:=2448,SCI_ENCODEDFROMUTF8:=2449,SCI_FINDCOLUMN:=2456,SCI_GETCARETSTICKY:=2457 2700 SCI_SETCARETSTICKY:=2458,SCI_TOGGLECARETSTICKY:=2459,SCI_SETPASTECONVERTENDINGS:=2467 2701 SCI_GETPASTECONVERTENDINGS:=2468,SCI_SELECTIONDUPLICATE:=2469,SC_ALPHA_TRANSPARENT:=0 2702 SC_ALPHA_OPAQUE:=255,SC_ALPHA_NOALPHA:=256,SCI_SETCARETLINEBACKALPHA:=2470 2703 SCI_GETCARETLINEBACKALPHA:=2471,SCI_STARTRECORD:=3001,SCI_STOPRECORD:=3002,SCI_SETLEXER:=4001 2704 SCI_GETLEXER:=4002,SCI_COLORISE:=4003,SCI_SETPROPERTY:=4004,KEYWORDSET_MAX:=8,SCI_SETKEYWORDS:=4005 2705 SCI_SETLEXERLANGUAGE:=4006,SCI_LOADLEXERLIBRARY:=4007,SCI_GETPROPERTY:=4008,SCI_GETPROPERTYEXPANDED:=4009 2706 SCI_GETPROPERTYINT:=4010,SCI_GETSTYLEBITSNEEDED:=4011,SC_MOD_INSERTTEXT:=0x1,SC_MOD_DELETETEXT:=0x2 2707 SC_MOD_CHANGESTYLE:=0x4,SC_MOD_CHANGEFOLD:=0x8,SC_PERFORMED_USER:=0x10,SC_PERFORMED_UNDO:=0x20 2708 SC_PERFORMED_REDO:=0x40,SC_MULTISTEPUNDOREDO:=0x80,SC_LASTSTEPINUNDOREDO:=0x100 2709 SC_MOD_CHANGEMARKER:=0x200,SC_MOD_BEFOREINSERT:=0x400,SC_MOD_BEFOREDELETE:=0x800 2710 SC_MULTILINEUNDOREDO:=0x1000,SC_MODEVENTMASKALL:=0x1FFF,SCEN_CHANGE:=768,SCEN_SETFOCUS:=512 2711 SCEN_KILLFOCUS:=256,SCK_DOWN:=300,SCK_UP:=301,SCK_LEFT:=302,SCK_RIGHT:=303,SCK_HOME:=304,SCK_END:=305 2712 SCK_PRIOR:=306,SCK_NEXT:=307,SCK_DELETE:=308,SCK_INSERT:=309,SCK_ESCAPE:=7,SCK_BACK:=8,SCK_TAB:=9 2713 SCK_RETURN:=13,SCK_ADD:=310,SCK_SUBTRACT:=311,SCK_DIVIDE:=312,SCMOD_NORM:=0,SCMOD_SHIFT:=1,SCMOD_CTRL:=2 2714 SCMOD_ALT:=4,SCLEX_CONTAINER:=0,SCLEX_NULL:=1,SCLEX_PYTHON:=2,SCLEX_CPP:=3,SCLEX_HTML:=4,SCLEX_XML:=5 2715 SCLEX_PERL:=6,SCLEX_SQL:=7,SCLEX_VB:=8,SCLEX_PROPERTIES:=9,SCLEX_ERRORLIST:=10,SCLEX_MAKEFILE:=11 2716 SCLEX_BATCH:=12,SCLEX_XCODE:=13,SCLEX_LATEX:=14,SCLEX_LUA:=15,SCLEX_DIFF:=16,SCLEX_CONF:=17 2717 SCLEX_PASCAL:=18,SCLEX_AVE:=19,SCLEX_ADA:=20,SCLEX_LISP:=21,SCLEX_RUBY:=22,SCLEX_EIFFEL:=23 2718 SCLEX_EIFFELKW:=24,SCLEX_TCL:=25,SCLEX_NNCRONTAB:=26,SCLEX_BULLANT:=27,SCLEX_VBSCRIPT:=28 2719 SCLEX_BAAN:=31,SCLEX_MATLAB:=32,SCLEX_SCRIPTOL:=33,SCLEX_ASM:=34,SCLEX_CPPNOCASE:=35 2720 SCLEX_FORTRAN:=36,SCLEX_F77:=37,SCLEX_CSS:=38,SCLEX_POV:=39,SCLEX_LOUT:=40,SCLEX_ESCRIPT:=41 2721 SCLEX_PS:=42,SCLEX_NSIS:=43,SCLEX_MMIXAL:=44,SCLEX_CLW:=45,SCLEX_CLWNOCASE:=46,SCLEX_LOT:=47 2722 SCLEX_YAML:=48,SCLEX_TEX:=49,SCLEX_METAPOST:=50,SCLEX_POWERBASIC:=51,SCLEX_FORTH:=52 2723 SCLEX_ERLANG:=53,SCLEX_OCTAVE:=54,SCLEX_MSSQL:=55,SCLEX_VERILOG:=56,SCLEX_KIX:=57,SCLEX_GUI4CLI:=58 2724 SCLEX_SPECMAN:=59,SCLEX_AU3:=60,SCLEX_APDL:=61,SCLEX_BASH:=62,SCLEX_ASN1:=63,SCLEX_VHDL:=64 2725 SCLEX_CAML:=65,SCLEX_BLITZBASIC:=66,SCLEX_PUREBASIC:=67,SCLEX_HASKELL:=68,SCLEX_PHPSCRIPT:=69 2726 SCLEX_TADS3:=70,SCLEX_REBOL:=71,SCLEX_SMALLTALK:=72,SCLEX_FLAGSHIP:=73,SCLEX_CSOUND:=74 2727 SCLEX_FREEBASIC:=75,SCLEX_INNOSETUP:=76,SCLEX_OPAL:=77,SCLEX_BLITZMAX:=78,SCLEX_AUTOMATIC:=1000,init:=True 2728 } 2729 2730 if !%hwnd%_df 2731 { 2732 SendMessage, SCI_GETDIRECTFUNCTION,0,0,,ahk_id %hwnd% 2733 %hwnd%_df := ErrorLevel 2734 SendMessage, SCI_GETDIRECTPOINTER,0,0,,ahk_id %hwnd% 2735 %hwnd%_dp := ErrorLevel 2736 } 2737 2738 if !msg && !wParam && !lParam ; called only with the hwnd param from SCI_Add 2739 return ; Exit because we did what we needed to do already. 2740 2741 ; The fast way to control Scintilla 2742 return DllCall(%hwnd%_df ; DIRECT FUNCTION 2743 ,"UInt" ,%hwnd%_dp ; DIRECT POINTER 2744 ,"UInt" ,%msg% 2745 ,"Int" ,inStr(wParam, "-") ? wParam : (%wParam%+0 ? %wParam% : wParam) ; handels negative ints 2746 ,"Int" ,%lParam%+0 ? %lParam% : lParam) 2747} 2748 2749/* 2750 Function : getHex 2751 This function converts a color name to its hex value. 2752 2753 The full list of color names supported by this function can be found 2754 here: <http://www.w3schools.com/html/html_colornames.asp> 2755 2756 Parameters: 2757 cName - Real name of the color that you want to convert. 2758 2759 Returns: 2760 hexColor - Hexadecimal representation of the color name provided. 2761 2762 Examples: 2763 >hColor:=SCI_getHex("Black") 2764 >hColor:=SCI_getHex("MediumSpringGreen") 2765 >hColor:=SCI_getHex("DarkBlue") 2766*/ 2767SCI_getHex(cName){ 2768 static 2769 2770 AliceBlue:=0xF0F8FF,AntiqueWhite:=0xFAEBD7,Aqua:=0x00FFFF,Aquamarine:=0x7FFFD4,Azure:=0xF0FFFF,Beige:=0xF5F5DC 2771 Bisque:=0xFFE4C4,Black:=0x000000,BlanchedAlmond:=0xFFEBCD,Blue:=0x0000FF,BlueViolet:=0x8A2BE2,Brown:=0xA52A2A 2772 BurlyWood:=0xDEB887,CadetBlue:=0x5F9EA0,Chartreuse:=0x7FFF00,Chocolate:=0xD2691E,Coral:=0xFF7F50 2773 CornflowerBlue:=0x6495ED,Cornsilk:=0xFFF8DC,Crimson:=0xDC143C,Cyan:=0x00FFFF,DarkBlue:=0x00008B 2774 DarkCyan:=0x008B8B,DarkGoldenRod:=0xB8860B,DarkGray:=0xA9A9A9,DarkGrey:=0xA9A9A9,DarkGreen:=0x006400 2775 DarkKhaki:=0xBDB76B,DarkMagenta:=0x8B008B,DarkOliveGreen:=0x556B2F,Darkorange:=0xFF8C00,DarkOrchid:=0x9932CC 2776 DarkRed:=0x8B0000,DarkSalmon:=0xE9967A,DarkSeaGreen:=0x8FBC8F,DarkSlateBlue:=0x483D8B,DarkSlateGray:=0x2F4F4F 2777 DarkSlateGrey:=0x2F4F4F,DarkTurquoise:=0x00CED1,DarkViolet:=0x9400D3,DeepPink:=0xFF1493,DeepSkyBlue:=0x00BFFF 2778 DimGray:=0x696969,DimGrey:=0x696969,DodgerBlue:=0x1E90FF,FireBrick:=0xB22222,FloralWhite:=0xFFFAF0 2779 ForestGreen:=0x228B22,Fuchsia:=0xFF00FF,Gainsboro:=0xDCDCDC,GhostWhite:=0xF8F8FF,Gold:=0xFFD700 2780 GoldenRod:=0xDAA520,Gray:=0x808080,Grey:=0x808080,Green:=0x008000,GreenYellow:=0xADFF2F,HoneyDew:=0xF0FFF0 2781 HotPink:=0xFF69B4,IndianRed:=0xCD5C5C,Indigo:=0x4B0082,Ivory:=0xFFFFF0,Khaki:=0xF0E68C,Lavender:=0xE6E6FA 2782 LavenderBlush:=0xFFF0F5,LawnGreen:=0x7CFC00,LemonChiffon:=0xFFFACD,LightBlue:=0xADD8E6,LightCoral:=0xF08080 2783 LightCyan:=0xE0FFFF,LightGoldenRodYellow:=0xFAFAD2,LightGray:=0xD3D3D3,LightGrey:=0xD3D3D3,LightGreen:=0x90EE90 2784 LightPink:=0xFFB6C1,LightSalmon:=0xFFA07A,LightSeaGreen:=0x20B2AA,LightSkyBlue:=0x87CEFA 2785 LightSlateGray:=0x778899,LightSlateGrey:=0x778899,LightSteelBlue:=0xB0C4DE,LightYellow:=0xFFFFE0 2786 Lime:=0x00FF00,LimeGreen:=0x32CD32,Linen:=0xFAF0E6,Magenta:=0xFF00FF,Maroon:=0x800000 2787 MediumAquaMarine:=0x66CDAA,MediumBlue:=0x0000CD,MediumOrchid:=0xBA55D3,MediumPurple:=0x9370D8 2788 MediumSeaGreen:=0x3CB371,MediumSlateBlue:=0x7B68EE,MediumSpringGreen:=0x00FA9A,MediumTurquoise:=0x48D1CC 2789 MediumVioletRed:=0xC71585,MidnightBlue:=0x191970,MintCream:=0xF5FFFA,MistyRose:=0xFFE4E1,Moccasin:=0xFFE4B5 2790 NavajoWhite:=0xFFDEAD,Navy:=0x000080,OldLace:=0xFDF5E6,Olive:=0x808000,OliveDrab:=0x6B8E23,Orange:=0xFFA500 2791 OrangeRed:=0xFF4500,Orchid:=0xDA70D6,PaleGoldenRod:=0xEEE8AA,PaleGreen:=0x98FB98,PaleTurquoise:=0xAFEEEE 2792 PaleVioletRed:=0xD87093,PapayaWhip:=0xFFEFD5,PeachPuff:=0xFFDAB9,Peru:=0xCD853F,Pink:=0xFFC0CB,Plum:=0xDDA0DD 2793 PowderBlue:=0xB0E0E6,Purple:=0x800080,Red:=0xFF0000,RosyBrown:=0xBC8F8F,RoyalBlue:=0x4169E1 2794 SaddleBrown:=0x8B4513,Salmon:=0xFA8072,SandyBrown:=0xF4A460,SeaGreen:=0x2E8B57,SeaShell:=0xFFF5EE 2795 Sienna:=0xA0522D,Silver:=0xC0C0C0,SkyBlue:=0x87CEEB,SlateBlue:=0x6A5ACD,SlateGray:=0x708090 2796 SlateGrey:=0x708090,Snow:=0xFFFAFA,SpringGreen:=0x00FF7F,SteelBlue:=0x4682B4,Tan:=0xD2B48C 2797 Teal:=0x008080,Thistle:=0xD8BFD8,Tomato:=0xFF6347,Turquoise:=0x40E0D0,Violet:=0xEE82EE,Wheat:=0xF5DEB3 2798 White:=0xFFFFFF,WhiteSmoke:=0xF5F5F5,Yellow:=0xFFFF00,YellowGreen:=0x9ACD32 2799 2800 StringReplace, cName, cName, %a_space%,,All 2801 if cName is not alpha 2802 { 2803 oldFormat := a_formatinteger 2804 setformat, integer, H 2805 cName += 0 ; Converting integers to hexadecimal in case you tried that... (¬¬) 2806 setformat, integer, %oldFormat% 2807 return cName "" 2808 } 2809 else 2810 return %cName% "" 2811} 2812 2813keywords(x){ 2814 if x=1 2815 return "autotrim blockinput break clipwait continue controlclick controlfocus controlget controlgetfocus controlgetpos controlgettext controlmove controlsend controlsendraw controlsettext coordmode critical detecthiddentext detecthiddenwindows drive driveget drivespacefree edit else endrepeat envadd envdiv envget envmult envset envsub envupdate exit exitapp fileappend filecopy filecopydir filecreatedir filecreateshortcut filedelete filegetattrib filegetshortcut filegetsize filegettime filegetversion fileinstall filemove filemovedir fileread filereadline filerecycle filerecycleempty fileremovedir fileselectfile fileselectfolder filesetattrib filesettime formattime getkeystate gosub goto groupactivate groupadd groupclose groupdeactivate gui guicontrol guicontrolget hideautoitwin hotkey if ifequal ifexist ifgreater ifgreaterorequal ifinstring ifless iflessorequal ifmsgbox ifnotequal ifnotexist ifnotinstring ifwinactive ifwinexist ifwinnotactive ifwinnotexist imagesearch inidelete iniread iniwrite input inputbox keyhistory keywait listhotkeys listlines listvars loop menu mouseclick mouseclickdrag mousegetpos mousemove msgbox onexit outputdebug pause pixelgetcolor pixelsearch postmessage process progress random regdelete regexmatch regexreplace regread regwrite reload repeat return run runas runwait send sendmessage sendraw sendinput setbatchlines setcapslockstate setcontroldelay setdefaultmousespeed setenv setformat setkeydelay setmousedelay setnumlockstate setscrolllockstate setstorecapslockmode settimer settitlematchmode setwindelay setworkingdir shutdown sleep sort soundbeep soundget soundgetwavevolume soundplay soundset soundsetwavevolume splashimage splashtextoff splashtexton splitpath statusbargettext statusbarwait stringcasesense stringgetpos stringleft stringlen stringlower stringmid stringreplace stringright stringsplit stringtrimleft stringtrimright stringupper suspend sysget thread tooltip transform traytip tv_add tv_modify tv_delete tv_getselection tv_getcount tv_getparent tv_getchild tv_getprev tv_getnext tv_gettext tv_get urldownloadtofile winactivate winactivatebottom winclose winget wingetactivestats wingetactivetitle wingetclass wingetpos wingettext wingettitle winhide winkill winmaximize winmenuselectitem winminimize winminimizeall winminimizeallundo winmove winrestore winset winsettitle winshow winwait winwaitactive winwaitclose winwaitnotactive" 2816 else if x=2 2817 return "a_ahkversion a_autotrim a_batchlines a_caretx a_carety a_computername a_controldelay a_cursor a_dd a_ddd a_dddd a_defaultmousespeed a_desktop a_desktopcommon a_detecthiddentext a_detecthiddenwindows a_endchar a_eventinfo a_exitreason a_formatfloat a_formatinteger a_gui a_guicontrol a_guicontrolevent a_guievent a_guiheight a_guiwidth a_guix a_guiy a_hour a_iconfile a_iconhidden a_iconnumber a_icontip a_index a_ipaddress1 a_ipaddress2 a_ipaddress3 a_ipaddress4 a_isadmin a_iscompiled a_issuspended a_keydelay a_language a_linefile a_linenumber a_loopfield a_loopfileattrib a_loopfiledir a_loopfileext a_loopfilefullpath a_loopfilelongpath a_loopfilename a_loopfileshortname a_loopfileshortpath a_loopfilesize a_loopfilesizekb a_loopfilesizemb a_loopfiletimeaccessed a_loopfiletimecreated a_loopfiletimemodified a_loopreadline a_loopregkey a_loopregname a_loopregsubkey a_loopregtimemodified a_loopregtype a_mday a_min a_mm a_mmm a_mmmm a_mon a_mousedelay a_msec a_mydocuments a_now a_nowutc a_numbatchlines a_ostype a_osversion a_priorhotkey a_programfiles a_programs a_programscommon a_screenheight a_screenwidth a_scriptdir a_scriptfullpath a_scriptname a_sec a_space a_startmenu a_startmenucommon a_startup a_startupcommon a_stringcasesense a_tab a_thishotkey a_thismenu a_thismenuitem a_thismenuitempos a_tickcount a_timeidle a_timeidlephysical a_timesincepriorhotkey a_timesincethishotkey a_titlematchmode a_titlematchmodespeed a_username a_wday a_windelay a_windir a_workingdir a_yday a_year a_yweek a_yyyy abort abs acos add ahk_class ahk_group ahk_id ahk_pid alnum alpha alt altdown altsubmit alttab alttabandmenu alttabmenu alttabmenudismiss altup alwaysontop appskey asc asin atan background backspace between bitand bitnot bitor bitshiftleft bitshiftright bitxor blind border bottom browser_back browser_favorites browser_forward browser_home browser_refresh browser_search browser_stop bs button buttons byref cancel capacity capslock caption ceil center check check3 checkbox checked checkedgray choose choosestring chr click clipboard clipboardall close color combobox contains control controllist cos count ctrl ctrlbreak ctrldown ctrlup date datetime days ddl default del delete deleteall delimiter deref destroy digit disable disabled down dropdownlist eject enable enabled end enter error errorlevel esc escape exp exstyle f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12" 2818 else if x=3 2819 return "allowsamelinecomments clipboardtimeout commentflag errorstdout escapechar hotkeyinterval hotkeymodifiertimeout hotstring include installkeybdhook installmousehook maxhotkeysperinterval maxmem maxthreads maxthreadsbuffer maxthreadsperhotkey noenv notrayicon persistent singleinstance usehook winactivateforce" 2820}