How to center-align text in Scintilla? -


in application have custom control implements syntax highlighting via scintilla.dll.

there sorts of codes setting style of text in control.

however, i've searched , searched , can't figure out how center-align text in control.

what's scintilla code center-aligning text style?

there no "center-align" command in scintilla.

here do, however, center text:

  1. fetch text control
  2. know style being used
  3. use textwidth (2276) figure width of text using style
  4. use controlwidth /2 - textwidth /2 figure location of left margin
  5. use setmarginleft (2155) move left margin

note default style 32.

you'll have figure code update location every time, however, maybe via callback function.

in autohotkey, this:

guicontrolget, editor guicontrolget, editor, pos textwidth := hwndeditor.2276(32,editor) setplace := (editorw /2) - textwidth /2 hpeditor.2155(0,setplace)