[Gambas-devel] Print gambas source code

Charlie Reinl na2492 at ...16...
Mon Oct 18 22:37:03 CEST 2004


>
>Hi Charlie
>
>You are right - but this is just a first cut. I would also like to color
>the source like in the editor, bold keywords.
>
>Kind Regards
>Carsten
>
>On Sun, 2004-10-17 at 23:06, Charlie wrote:
>
>> Carsten Olsen schrieb:
>>
>> >Okay - Sow here is the first release of print source code.
>> >
>> >I have added a new button for print source on the FEditor.form
>> >(image-file print-source.png) and FEditor.class. Print i maintain in
>> >CPrintSource.class. All 4 files are attached in zip-file.
>> >
>> >Kind Regards
>> >
>> >Carsten Olsen
>> >
>> >
>> >
>> Salut Carsten,
>>
>> looks good.
>>
>> Would be nice to see a stored Font for printing,
>> and a parameter to switch the line-numbers On/Off (also stored).
>>
>> As something like add. printing setup, or as box after printer.setup.
>>
>> Hope Benoît is online!
>>
>> Amicalement
>> Charlie

Salut Carsten,

for your color work, till 0.99 you can find it out with Analyze.
but may be that can change.

'Analyze results
DIM sParts AS String[]
DIM iParts AS Integer[]
                   ' where sWorkString is a <editor>.line
                    ' Analyze current line
                    ppEditor.Analyze(sWorkString)
                    sParts = GambasEditor.Symbols
                    iParts = GambasEditor.Types
                        FOR ni = 0 TO sParts.Count - 1
                            PRINT sParts[nI], iParts[nI], GetColorsName(iParts[nI])

                        NEXT

FUNCTION GetColorsName(iType AS Integer) AS String
DIM sOut AS String
    WITH ppEditor
        SELECT CASE iType
            CASE .Colors.Background ' 0
                sOut = "Background"
            CASE .Colors.Normal ' 1
                sOut = "Normal"
            CASE .Colors.Keyword ' 2
                sOut = "Keyword"
            CASE .Colors.Function ' 3
                sOut = "Function"
            CASE .Colors.Operator ' 4
                sOut = "Operator"
            CASE .Colors.Symbol ' 5
                sOut = "Symbol"
            CASE .Colors.Number ' 6
                sOut = "Number"
            CASE .Colors.String ' 7
                sOut = "String"
            CASE .Colors.Comment ' 8
                sOut = "Comment"
            CASE .Colors.Breakpoint ' 9
                sOut = "Breakpoint"
            CASE .Colors.Current ' 10
                sOut = "Current"
            CASE .Colors.DataType ' 11
                sOut = "DataType"
            CASE .Colors.Highlight ' 12
                sOut = "Highlight"
            CASE .Colors.Selection ' 13
                sOut = "Selection"
            CASE ELSE
                sOut = "?? iType = " & iType
        END SELECT
    END WITH
    RETURN sOut
END
Amicalement
Charlie

* Gesendet mit / Sent by: FEN-Webmail * http://www.fen-net.de *




More information about the Devel mailing list