2020년 4월 3일 금요일

[IronPython] StyledText Example (Scintilla)


1. StyledText Example


import clr
clr.AddReference("System.Windows.Forms")
clr.AddReference("System.Drawing")
clr.AddReferenceToFileAndPath("ScintillaNET.dll")

import System
from System.Windows.Forms import Application, Form
from System.Windows.Forms import Button, AnchorStyles
from System.Drawing import Size, Point

import ScintillaNET
from ScintillaNET import WrapMode
from ScintillaNET import IndentView
from ScintillaNET import MarginType

class IForm(Form):
    def __init__(self):
        self.Text = 'StyledText Demo'        
        self.Size = Size(640,480)
              
        stc = ScintillaNET.Scintilla()
        stc.Text = "StyledText"
        stc.Parent = self
        stc.Location = Point(0, 0)
        #stc.Size = self.Size
        stc.Dock = System.Windows.Forms.DockStyle.Fill
        
        stc.WrapMode = WrapMode.None;
        stc.IndentationGuides = IndentView.LookBoth
        
        nums = stc.Margins[0]
        nums.Width = 30
        nums.Type = MarginType.Number
        nums.Sensitive = True
        nums.Mask = 0
        
        self.CenterToScreen()

   
Application.Run(IForm())


댓글 없음:

댓글 쓰기