Page 1 of 1

Change TabStops to customize indent function

Posted: Sun Feb 16, 2003 10:10 pm
by BackupUser
Code updated for 5.20+

Restored from previous forum. Originally posted by Eddy.

My 2nd contribution :)
usefull for IDE development

Code: Select all

;**********************************************
    SIZE_TAB = 100 *15 ; 100px = 1500 twip

    pf.PARAFORMAT
    pf\cbSize = SizeOf(PARAFORMAT)
    pf\dwMask = #PFM_TABSTOPS
    pf\cTabCount = #MAX_TAB_STOPS

    For i = 0 To pf\cTabCount-1 ; Set tab stops every SIZE_TAB
     pf\rgxTabs[i] = (i+1) * SIZE_TAB
    Next
    SendMessage_(*MyGadget,#EM_SETPARAFORMAT,#MAX_TAB_STOPS,@pf)
;**********************************************



;To specify TAB_SIZE With spaces width..:)
;**********************************************
    StartDrawing(WindowOutput(0))
    DrawingFont(FontID(0))
    SIZE_TAB = TextWidth(Space(EditorTabSize)) *15
    StopDrawing() 
special thanks to PLOUF

-> sig removed

Posted: Mon Feb 17, 2003 11:09 am
by BackupUser
Restored from previous forum. Originally posted by plouf.

offcource dont forget to StopDrawing() after you started it
i.e. here, after
SIZE_TAB = TextLength(Space(EditorTabSize)) *15
:)

Christos

Posted: Mon Feb 17, 2003 11:39 pm
by BackupUser
Restored from previous forum. Originally posted by Eddy.

yes

PB BB IDE