PageRenderTime 77ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/sci.ahk

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