Стартовый пул
This commit is contained in:
BIN
bgracontrols/test/test_bgrascript/file.png
Normal file
BIN
bgracontrols/test/test_bgrascript/file.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
BIN
bgracontrols/test/test_bgrascript/test.png
Normal file
BIN
bgracontrols/test/test_bgrascript/test.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
155
bgracontrols/test/test_bgrascript/test_bgrascript.lpi
Normal file
155
bgracontrols/test/test_bgrascript/test_bgrascript.lpi
Normal file
@@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="12"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<CompatibilityMode Value="True"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<Title Value="BGRAScript"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
</XPManifest>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<BuildModes Count="3">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
<Item2 Name="Debug">
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="test_bgrascript"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<IncludeAssertionCode Value="True"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<CodeGeneration>
|
||||
<Checks>
|
||||
<IOChecks Value="True"/>
|
||||
<RangeChecks Value="True"/>
|
||||
<OverflowChecks Value="True"/>
|
||||
<StackChecks Value="True"/>
|
||||
</Checks>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf2Set"/>
|
||||
<UseHeaptrc Value="True"/>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
</Item2>
|
||||
<Item3 Name="Release">
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="test_bgrascript"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="3"/>
|
||||
</Optimizations>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="False"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
</Item3>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="1">
|
||||
<Mode0 Name="default"/>
|
||||
</Modes>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="3">
|
||||
<Item1>
|
||||
<PackageName Value="SynEdit"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="bgracontrols"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item3>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="test_bgrascript.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="umain.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="test_bgrascript"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf2Set"/>
|
||||
</Debugging>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
22
bgracontrols/test/test_bgrascript/test_bgrascript.lpr
Normal file
22
bgracontrols/test/test_bgrascript/test_bgrascript.lpr
Normal file
@@ -0,0 +1,22 @@
|
||||
program test_bgrascript;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, umain
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Title:='BGRAScript';
|
||||
RequireDerivedFormResource := True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
884
bgracontrols/test/test_bgrascript/umain.lfm
Normal file
884
bgracontrols/test/test_bgrascript/umain.lfm
Normal file
@@ -0,0 +1,884 @@
|
||||
object Form1: TForm1
|
||||
Left = 340
|
||||
Height = 628
|
||||
Top = 150
|
||||
Width = 1172
|
||||
Caption = 'BGRAScript'
|
||||
ClientHeight = 628
|
||||
ClientWidth = 1172
|
||||
Color = 15790320
|
||||
OnCreate = FormCreate
|
||||
Position = poDesktopCenter
|
||||
ShowHint = True
|
||||
LCLVersion = '1.2.4.0'
|
||||
inline SynEdit1: TSynEdit
|
||||
Left = 0
|
||||
Height = 343
|
||||
Hint = 'Ctrl + Spacebar to show templates.'
|
||||
Top = 285
|
||||
Width = 1172
|
||||
Align = alBottom
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
Font.Height = -16
|
||||
Font.Name = 'Courier New'
|
||||
Font.Pitch = fpFixed
|
||||
Font.Quality = fqCleartypeNatural
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
Gutter.Width = 61
|
||||
Gutter.MouseActions = <>
|
||||
RightGutter.Width = 0
|
||||
RightGutter.MouseActions = <>
|
||||
Highlighter = SynAnySyn1
|
||||
Keystrokes = <
|
||||
item
|
||||
Command = ecUp
|
||||
ShortCut = 38
|
||||
end
|
||||
item
|
||||
Command = ecSelUp
|
||||
ShortCut = 8230
|
||||
end
|
||||
item
|
||||
Command = ecScrollUp
|
||||
ShortCut = 16422
|
||||
end
|
||||
item
|
||||
Command = ecDown
|
||||
ShortCut = 40
|
||||
end
|
||||
item
|
||||
Command = ecSelDown
|
||||
ShortCut = 8232
|
||||
end
|
||||
item
|
||||
Command = ecScrollDown
|
||||
ShortCut = 16424
|
||||
end
|
||||
item
|
||||
Command = ecLeft
|
||||
ShortCut = 37
|
||||
end
|
||||
item
|
||||
Command = ecSelLeft
|
||||
ShortCut = 8229
|
||||
end
|
||||
item
|
||||
Command = ecWordLeft
|
||||
ShortCut = 16421
|
||||
end
|
||||
item
|
||||
Command = ecSelWordLeft
|
||||
ShortCut = 24613
|
||||
end
|
||||
item
|
||||
Command = ecRight
|
||||
ShortCut = 39
|
||||
end
|
||||
item
|
||||
Command = ecSelRight
|
||||
ShortCut = 8231
|
||||
end
|
||||
item
|
||||
Command = ecWordRight
|
||||
ShortCut = 16423
|
||||
end
|
||||
item
|
||||
Command = ecSelWordRight
|
||||
ShortCut = 24615
|
||||
end
|
||||
item
|
||||
Command = ecPageDown
|
||||
ShortCut = 34
|
||||
end
|
||||
item
|
||||
Command = ecSelPageDown
|
||||
ShortCut = 8226
|
||||
end
|
||||
item
|
||||
Command = ecPageBottom
|
||||
ShortCut = 16418
|
||||
end
|
||||
item
|
||||
Command = ecSelPageBottom
|
||||
ShortCut = 24610
|
||||
end
|
||||
item
|
||||
Command = ecPageUp
|
||||
ShortCut = 33
|
||||
end
|
||||
item
|
||||
Command = ecSelPageUp
|
||||
ShortCut = 8225
|
||||
end
|
||||
item
|
||||
Command = ecPageTop
|
||||
ShortCut = 16417
|
||||
end
|
||||
item
|
||||
Command = ecSelPageTop
|
||||
ShortCut = 24609
|
||||
end
|
||||
item
|
||||
Command = ecLineStart
|
||||
ShortCut = 36
|
||||
end
|
||||
item
|
||||
Command = ecSelLineStart
|
||||
ShortCut = 8228
|
||||
end
|
||||
item
|
||||
Command = ecEditorTop
|
||||
ShortCut = 16420
|
||||
end
|
||||
item
|
||||
Command = ecSelEditorTop
|
||||
ShortCut = 24612
|
||||
end
|
||||
item
|
||||
Command = ecLineEnd
|
||||
ShortCut = 35
|
||||
end
|
||||
item
|
||||
Command = ecSelLineEnd
|
||||
ShortCut = 8227
|
||||
end
|
||||
item
|
||||
Command = ecEditorBottom
|
||||
ShortCut = 16419
|
||||
end
|
||||
item
|
||||
Command = ecSelEditorBottom
|
||||
ShortCut = 24611
|
||||
end
|
||||
item
|
||||
Command = ecToggleMode
|
||||
ShortCut = 45
|
||||
end
|
||||
item
|
||||
Command = ecCopy
|
||||
ShortCut = 16429
|
||||
end
|
||||
item
|
||||
Command = ecPaste
|
||||
ShortCut = 8237
|
||||
end
|
||||
item
|
||||
Command = ecDeleteChar
|
||||
ShortCut = 46
|
||||
end
|
||||
item
|
||||
Command = ecCut
|
||||
ShortCut = 8238
|
||||
end
|
||||
item
|
||||
Command = ecDeleteLastChar
|
||||
ShortCut = 8
|
||||
end
|
||||
item
|
||||
Command = ecDeleteLastChar
|
||||
ShortCut = 8200
|
||||
end
|
||||
item
|
||||
Command = ecDeleteLastWord
|
||||
ShortCut = 16392
|
||||
end
|
||||
item
|
||||
Command = ecUndo
|
||||
ShortCut = 32776
|
||||
end
|
||||
item
|
||||
Command = ecRedo
|
||||
ShortCut = 40968
|
||||
end
|
||||
item
|
||||
Command = ecLineBreak
|
||||
ShortCut = 13
|
||||
end
|
||||
item
|
||||
Command = ecSelectAll
|
||||
ShortCut = 16449
|
||||
end
|
||||
item
|
||||
Command = ecCopy
|
||||
ShortCut = 16451
|
||||
end
|
||||
item
|
||||
Command = ecBlockIndent
|
||||
ShortCut = 24649
|
||||
end
|
||||
item
|
||||
Command = ecLineBreak
|
||||
ShortCut = 16461
|
||||
end
|
||||
item
|
||||
Command = ecInsertLine
|
||||
ShortCut = 16462
|
||||
end
|
||||
item
|
||||
Command = ecDeleteWord
|
||||
ShortCut = 16468
|
||||
end
|
||||
item
|
||||
Command = ecBlockUnindent
|
||||
ShortCut = 24661
|
||||
end
|
||||
item
|
||||
Command = ecPaste
|
||||
ShortCut = 16470
|
||||
end
|
||||
item
|
||||
Command = ecCut
|
||||
ShortCut = 16472
|
||||
end
|
||||
item
|
||||
Command = ecDeleteLine
|
||||
ShortCut = 16473
|
||||
end
|
||||
item
|
||||
Command = ecDeleteEOL
|
||||
ShortCut = 24665
|
||||
end
|
||||
item
|
||||
Command = ecUndo
|
||||
ShortCut = 16474
|
||||
end
|
||||
item
|
||||
Command = ecRedo
|
||||
ShortCut = 24666
|
||||
end
|
||||
item
|
||||
Command = ecGotoMarker0
|
||||
ShortCut = 16432
|
||||
end
|
||||
item
|
||||
Command = ecGotoMarker1
|
||||
ShortCut = 16433
|
||||
end
|
||||
item
|
||||
Command = ecGotoMarker2
|
||||
ShortCut = 16434
|
||||
end
|
||||
item
|
||||
Command = ecGotoMarker3
|
||||
ShortCut = 16435
|
||||
end
|
||||
item
|
||||
Command = ecGotoMarker4
|
||||
ShortCut = 16436
|
||||
end
|
||||
item
|
||||
Command = ecGotoMarker5
|
||||
ShortCut = 16437
|
||||
end
|
||||
item
|
||||
Command = ecGotoMarker6
|
||||
ShortCut = 16438
|
||||
end
|
||||
item
|
||||
Command = ecGotoMarker7
|
||||
ShortCut = 16439
|
||||
end
|
||||
item
|
||||
Command = ecGotoMarker8
|
||||
ShortCut = 16440
|
||||
end
|
||||
item
|
||||
Command = ecGotoMarker9
|
||||
ShortCut = 16441
|
||||
end
|
||||
item
|
||||
Command = ecSetMarker0
|
||||
ShortCut = 24624
|
||||
end
|
||||
item
|
||||
Command = ecSetMarker1
|
||||
ShortCut = 24625
|
||||
end
|
||||
item
|
||||
Command = ecSetMarker2
|
||||
ShortCut = 24626
|
||||
end
|
||||
item
|
||||
Command = ecSetMarker3
|
||||
ShortCut = 24627
|
||||
end
|
||||
item
|
||||
Command = ecSetMarker4
|
||||
ShortCut = 24628
|
||||
end
|
||||
item
|
||||
Command = ecSetMarker5
|
||||
ShortCut = 24629
|
||||
end
|
||||
item
|
||||
Command = ecSetMarker6
|
||||
ShortCut = 24630
|
||||
end
|
||||
item
|
||||
Command = ecSetMarker7
|
||||
ShortCut = 24631
|
||||
end
|
||||
item
|
||||
Command = ecSetMarker8
|
||||
ShortCut = 24632
|
||||
end
|
||||
item
|
||||
Command = ecSetMarker9
|
||||
ShortCut = 24633
|
||||
end
|
||||
item
|
||||
Command = EcFoldLevel1
|
||||
ShortCut = 41009
|
||||
end
|
||||
item
|
||||
Command = EcFoldLevel2
|
||||
ShortCut = 41010
|
||||
end
|
||||
item
|
||||
Command = EcFoldLevel1
|
||||
ShortCut = 41011
|
||||
end
|
||||
item
|
||||
Command = EcFoldLevel1
|
||||
ShortCut = 41012
|
||||
end
|
||||
item
|
||||
Command = EcFoldLevel1
|
||||
ShortCut = 41013
|
||||
end
|
||||
item
|
||||
Command = EcFoldLevel6
|
||||
ShortCut = 41014
|
||||
end
|
||||
item
|
||||
Command = EcFoldLevel7
|
||||
ShortCut = 41015
|
||||
end
|
||||
item
|
||||
Command = EcFoldLevel8
|
||||
ShortCut = 41016
|
||||
end
|
||||
item
|
||||
Command = EcFoldLevel9
|
||||
ShortCut = 41017
|
||||
end
|
||||
item
|
||||
Command = EcFoldLevel0
|
||||
ShortCut = 41008
|
||||
end
|
||||
item
|
||||
Command = EcFoldCurrent
|
||||
ShortCut = 41005
|
||||
end
|
||||
item
|
||||
Command = EcUnFoldCurrent
|
||||
ShortCut = 41003
|
||||
end
|
||||
item
|
||||
Command = EcToggleMarkupWord
|
||||
ShortCut = 32845
|
||||
end
|
||||
item
|
||||
Command = ecNormalSelect
|
||||
ShortCut = 24654
|
||||
end
|
||||
item
|
||||
Command = ecColumnSelect
|
||||
ShortCut = 24643
|
||||
end
|
||||
item
|
||||
Command = ecLineSelect
|
||||
ShortCut = 24652
|
||||
end
|
||||
item
|
||||
Command = ecTab
|
||||
ShortCut = 9
|
||||
end
|
||||
item
|
||||
Command = ecShiftTab
|
||||
ShortCut = 8201
|
||||
end
|
||||
item
|
||||
Command = ecMatchBracket
|
||||
ShortCut = 24642
|
||||
end
|
||||
item
|
||||
Command = ecColSelUp
|
||||
ShortCut = 40998
|
||||
end
|
||||
item
|
||||
Command = ecColSelDown
|
||||
ShortCut = 41000
|
||||
end
|
||||
item
|
||||
Command = ecColSelLeft
|
||||
ShortCut = 40997
|
||||
end
|
||||
item
|
||||
Command = ecColSelRight
|
||||
ShortCut = 40999
|
||||
end
|
||||
item
|
||||
Command = ecColSelPageDown
|
||||
ShortCut = 40994
|
||||
end
|
||||
item
|
||||
Command = ecColSelPageBottom
|
||||
ShortCut = 57378
|
||||
end
|
||||
item
|
||||
Command = ecColSelPageUp
|
||||
ShortCut = 40993
|
||||
end
|
||||
item
|
||||
Command = ecColSelPageTop
|
||||
ShortCut = 57377
|
||||
end
|
||||
item
|
||||
Command = ecColSelLineStart
|
||||
ShortCut = 40996
|
||||
end
|
||||
item
|
||||
Command = ecColSelLineEnd
|
||||
ShortCut = 40995
|
||||
end
|
||||
item
|
||||
Command = ecColSelEditorTop
|
||||
ShortCut = 57380
|
||||
end
|
||||
item
|
||||
Command = ecColSelEditorBottom
|
||||
ShortCut = 57379
|
||||
end>
|
||||
MouseActions = <>
|
||||
MouseTextActions = <>
|
||||
MouseSelActions = <>
|
||||
Lines.Strings = (
|
||||
'{ BGRAScript }'
|
||||
'FillTransparent'
|
||||
''
|
||||
'// "store some values"'
|
||||
'let oneh 100'
|
||||
'let drawmode "dmDrawWithTransparency"'
|
||||
'let blendmode "boTransparent"'
|
||||
'let filename "file.png"'
|
||||
'let color1 "rgba(250,250,250,1)"'
|
||||
'let color2 "rgba(255,255,255,1)"'
|
||||
'GetWidth width'
|
||||
'GetHeight height'
|
||||
''
|
||||
'// "Draw rectangles, lines and bitmap"'
|
||||
'Rectangle 0,0,oneh,oneh,"rgba(0,0,0,0.6)",color1,drawmode'
|
||||
'Rectangle 20,20,80,80,"rgba(0,0,0,0.4)",color2,drawmode'
|
||||
'SetHorizLine 0,10,98,"rgba(0,0,0,.3)"'
|
||||
'SetVertLine 90,1,98,"rgba(0,0,0,.3)"'
|
||||
'BlendBitmap 26,26,"test.png",blendmode'
|
||||
''
|
||||
'// "Save and weird things step 1"'
|
||||
'SaveToFile filename'
|
||||
'Negative'
|
||||
'BlendBitmap 0,oneh,filename,blendmode'
|
||||
''
|
||||
'// "Save and weird things step 2"'
|
||||
'SaveToFile filename'
|
||||
'Negative'
|
||||
'FilterFastBlur 3,"False"'
|
||||
'BlendBitmap oneh,0,filename,blendmode'
|
||||
''
|
||||
'// "Flip the world and save it"'
|
||||
'VerticalFlip 0,0,100,100'
|
||||
'HorizontalFlip 100,100,200,200'
|
||||
'VerticalFlip 100,0,200,100'
|
||||
'HorizontalFlip 100,0,200,100'
|
||||
'SaveToFile filename'
|
||||
'// "goto line (skip all the intermediate lines)"'
|
||||
'goto 47'
|
||||
''
|
||||
'// "Weird things level 3"'
|
||||
'DrawCheckers 200,0,300,300,"rgba(100,100,100,255)","rgba(0,0,0,0)"'
|
||||
'InplaceGrayscaleRect 0,0,100,100'
|
||||
'FilterSmooth "False"'
|
||||
'ApplyBitmapMask filename,100,100,200,200,0,100'
|
||||
''
|
||||
'DrawHorizLine 0,0,width,"rgba(0,0,0,1)"'
|
||||
'DrawVertLine 0,0,height,"rgba(0,0,0,1)"'
|
||||
''
|
||||
'// "Save this in your hard disk (again)"'
|
||||
'SaveToFile filename'
|
||||
'print "End: ''",filename,"'' saved!"'
|
||||
)
|
||||
VisibleSpecialChars = [vscSpace, vscTabAtLast]
|
||||
SelectedColor.FrameEdges = sfeAround
|
||||
SelectedColor.BackPriority = 50
|
||||
SelectedColor.ForePriority = 50
|
||||
SelectedColor.FramePriority = 50
|
||||
SelectedColor.BoldPriority = 50
|
||||
SelectedColor.ItalicPriority = 50
|
||||
SelectedColor.UnderlinePriority = 50
|
||||
SelectedColor.StrikeOutPriority = 50
|
||||
IncrementColor.FrameEdges = sfeAround
|
||||
HighlightAllColor.FrameEdges = sfeAround
|
||||
BracketHighlightStyle = sbhsBoth
|
||||
BracketMatchColor.Background = clNone
|
||||
BracketMatchColor.Foreground = clNone
|
||||
BracketMatchColor.FrameEdges = sfeAround
|
||||
BracketMatchColor.Style = [fsBold]
|
||||
FoldedCodeColor.Background = clNone
|
||||
FoldedCodeColor.Foreground = clGray
|
||||
FoldedCodeColor.FrameColor = clGray
|
||||
FoldedCodeColor.FrameEdges = sfeAround
|
||||
MouseLinkColor.Background = clNone
|
||||
MouseLinkColor.Foreground = clBlue
|
||||
MouseLinkColor.FrameEdges = sfeAround
|
||||
LineHighlightColor.Background = clNone
|
||||
LineHighlightColor.Foreground = clNone
|
||||
LineHighlightColor.FrameEdges = sfeAround
|
||||
inline SynLeftGutterPartList1: TSynGutterPartList
|
||||
object SynGutterMarks1: TSynGutterMarks
|
||||
Width = 24
|
||||
MouseActions = <>
|
||||
end
|
||||
object SynGutterLineNumber1: TSynGutterLineNumber
|
||||
Width = 21
|
||||
MouseActions = <>
|
||||
MarkupInfo.Background = clBtnFace
|
||||
MarkupInfo.Foreground = clNone
|
||||
MarkupInfo.FrameEdges = sfeAround
|
||||
DigitCount = 2
|
||||
ShowOnlyLineNumbersMultiplesOf = 1
|
||||
ZeroStart = False
|
||||
LeadingZeros = False
|
||||
end
|
||||
object SynGutterChanges1: TSynGutterChanges
|
||||
Width = 4
|
||||
MouseActions = <>
|
||||
ModifiedColor = 59900
|
||||
SavedColor = clGreen
|
||||
end
|
||||
object SynGutterSeparator1: TSynGutterSeparator
|
||||
Width = 2
|
||||
MouseActions = <>
|
||||
MarkupInfo.Background = clWhite
|
||||
MarkupInfo.Foreground = clGray
|
||||
MarkupInfo.FrameEdges = sfeAround
|
||||
end
|
||||
object SynGutterCodeFolding1: TSynGutterCodeFolding
|
||||
MouseActions = <>
|
||||
MarkupInfo.Background = clNone
|
||||
MarkupInfo.Foreground = clGray
|
||||
MarkupInfo.FrameEdges = sfeAround
|
||||
MouseActionsExpanded = <>
|
||||
MouseActionsCollapsed = <>
|
||||
end
|
||||
end
|
||||
end
|
||||
object Splitter1: TSplitter
|
||||
Cursor = crVSplit
|
||||
Left = 0
|
||||
Height = 5
|
||||
Top = 280
|
||||
Width = 1172
|
||||
Align = alBottom
|
||||
ResizeAnchor = akBottom
|
||||
end
|
||||
object BGRAGraphicControl1: TBGRAGraphicControl
|
||||
Left = 8
|
||||
Height = 220
|
||||
Hint = 'Click to update.'
|
||||
Top = 56
|
||||
Width = 496
|
||||
OnRedraw = BGRAGraphicControl1Redraw
|
||||
Color = clWhite
|
||||
ColorOpacity = 128
|
||||
Alignment = taCenter
|
||||
OnClick = BGRAGraphicControl1Click
|
||||
Caption = 'BGRAGraphicControl1'
|
||||
end
|
||||
object BGRAVirtualScreen1: TBGRAVirtualScreen
|
||||
Left = 0
|
||||
Height = 50
|
||||
Top = 0
|
||||
Width = 1172
|
||||
OnRedraw = BGRAVirtualScreen1Redraw
|
||||
Align = alTop
|
||||
Alignment = taLeftJustify
|
||||
ChildSizing.LeftRightSpacing = 8
|
||||
ChildSizing.TopBottomSpacing = 8
|
||||
ChildSizing.HorizontalSpacing = 8
|
||||
ChildSizing.VerticalSpacing = 8
|
||||
ChildSizing.Layout = cclTopToBottomThenLeftToRight
|
||||
ClientHeight = 50
|
||||
ClientWidth = 1172
|
||||
Color = clWhite
|
||||
ParentColor = False
|
||||
TabOrder = 2
|
||||
object BCButton1: TBCButton
|
||||
Left = 1026
|
||||
Height = 32
|
||||
Top = 9
|
||||
Width = 137
|
||||
Align = alRight
|
||||
AutoSize = True
|
||||
StateClicked.Background.Color = clBlack
|
||||
StateClicked.Background.ColorOpacity = 255
|
||||
StateClicked.Background.Gradient1.StartColor = 7726591
|
||||
StateClicked.Background.Gradient1.StartColorOpacity = 255
|
||||
StateClicked.Background.Gradient1.DrawMode = dmSet
|
||||
StateClicked.Background.Gradient1.EndColor = 7067903
|
||||
StateClicked.Background.Gradient1.EndColorOpacity = 255
|
||||
StateClicked.Background.Gradient1.ColorCorrection = True
|
||||
StateClicked.Background.Gradient1.GradientType = gtLinear
|
||||
StateClicked.Background.Gradient1.Point1XPercent = 0
|
||||
StateClicked.Background.Gradient1.Point1YPercent = 0
|
||||
StateClicked.Background.Gradient1.Point2XPercent = 0
|
||||
StateClicked.Background.Gradient1.Point2YPercent = 100
|
||||
StateClicked.Background.Gradient1.Sinus = False
|
||||
StateClicked.Background.Gradient2.StartColor = 7067903
|
||||
StateClicked.Background.Gradient2.StartColorOpacity = 255
|
||||
StateClicked.Background.Gradient2.DrawMode = dmSet
|
||||
StateClicked.Background.Gradient2.EndColor = 8515583
|
||||
StateClicked.Background.Gradient2.EndColorOpacity = 255
|
||||
StateClicked.Background.Gradient2.ColorCorrection = True
|
||||
StateClicked.Background.Gradient2.GradientType = gtLinear
|
||||
StateClicked.Background.Gradient2.Point1XPercent = 0
|
||||
StateClicked.Background.Gradient2.Point1YPercent = 0
|
||||
StateClicked.Background.Gradient2.Point2XPercent = 0
|
||||
StateClicked.Background.Gradient2.Point2YPercent = 100
|
||||
StateClicked.Background.Gradient2.Sinus = False
|
||||
StateClicked.Background.Gradient1EndPercent = 50
|
||||
StateClicked.Background.Style = bbsGradient
|
||||
StateClicked.Border.Color = 4170178
|
||||
StateClicked.Border.ColorOpacity = 255
|
||||
StateClicked.Border.LightColor = clGray
|
||||
StateClicked.Border.LightOpacity = 100
|
||||
StateClicked.Border.LightWidth = 1
|
||||
StateClicked.Border.Style = bboSolid
|
||||
StateClicked.Border.Width = 1
|
||||
StateClicked.FontEx.Color = clBlack
|
||||
StateClicked.FontEx.EndEllipsis = False
|
||||
StateClicked.FontEx.FontQuality = fqSystemClearType
|
||||
StateClicked.FontEx.Height = 0
|
||||
StateClicked.FontEx.SingleLine = True
|
||||
StateClicked.FontEx.Shadow = False
|
||||
StateClicked.FontEx.ShadowColor = clBlack
|
||||
StateClicked.FontEx.ShadowColorOpacity = 255
|
||||
StateClicked.FontEx.ShadowRadius = 5
|
||||
StateClicked.FontEx.ShadowOffsetX = 5
|
||||
StateClicked.FontEx.ShadowOffsetY = 5
|
||||
StateClicked.FontEx.Style = []
|
||||
StateClicked.FontEx.TextAlignment = bcaCenter
|
||||
StateClicked.FontEx.WordBreak = False
|
||||
StateHover.Background.Color = clBlack
|
||||
StateHover.Background.ColorOpacity = 255
|
||||
StateHover.Background.Gradient1.StartColor = 12448254
|
||||
StateHover.Background.Gradient1.StartColorOpacity = 255
|
||||
StateHover.Background.Gradient1.DrawMode = dmSet
|
||||
StateHover.Background.Gradient1.EndColor = 8840446
|
||||
StateHover.Background.Gradient1.EndColorOpacity = 255
|
||||
StateHover.Background.Gradient1.ColorCorrection = True
|
||||
StateHover.Background.Gradient1.GradientType = gtLinear
|
||||
StateHover.Background.Gradient1.Point1XPercent = 0
|
||||
StateHover.Background.Gradient1.Point1YPercent = 0
|
||||
StateHover.Background.Gradient1.Point2XPercent = 0
|
||||
StateHover.Background.Gradient1.Point2YPercent = 100
|
||||
StateHover.Background.Gradient1.Sinus = False
|
||||
StateHover.Background.Gradient2.StartColor = 8840446
|
||||
StateHover.Background.Gradient2.StartColorOpacity = 255
|
||||
StateHover.Background.Gradient2.DrawMode = dmSet
|
||||
StateHover.Background.Gradient2.EndColor = 12908798
|
||||
StateHover.Background.Gradient2.EndColorOpacity = 255
|
||||
StateHover.Background.Gradient2.ColorCorrection = True
|
||||
StateHover.Background.Gradient2.GradientType = gtLinear
|
||||
StateHover.Background.Gradient2.Point1XPercent = 0
|
||||
StateHover.Background.Gradient2.Point1YPercent = 0
|
||||
StateHover.Background.Gradient2.Point2XPercent = 0
|
||||
StateHover.Background.Gradient2.Point2YPercent = 100
|
||||
StateHover.Background.Gradient2.Sinus = False
|
||||
StateHover.Background.Gradient1EndPercent = 50
|
||||
StateHover.Background.Style = bbsGradient
|
||||
StateHover.Border.Color = 5362420
|
||||
StateHover.Border.ColorOpacity = 255
|
||||
StateHover.Border.LightColor = clWhite
|
||||
StateHover.Border.LightOpacity = 200
|
||||
StateHover.Border.LightWidth = 1
|
||||
StateHover.Border.Style = bboSolid
|
||||
StateHover.Border.Width = 1
|
||||
StateHover.FontEx.Color = clBlack
|
||||
StateHover.FontEx.EndEllipsis = False
|
||||
StateHover.FontEx.FontQuality = fqSystemClearType
|
||||
StateHover.FontEx.Height = 0
|
||||
StateHover.FontEx.SingleLine = True
|
||||
StateHover.FontEx.Shadow = False
|
||||
StateHover.FontEx.ShadowColor = clBlack
|
||||
StateHover.FontEx.ShadowColorOpacity = 255
|
||||
StateHover.FontEx.ShadowRadius = 5
|
||||
StateHover.FontEx.ShadowOffsetX = 5
|
||||
StateHover.FontEx.ShadowOffsetY = 5
|
||||
StateHover.FontEx.Style = []
|
||||
StateHover.FontEx.TextAlignment = bcaCenter
|
||||
StateHover.FontEx.WordBreak = False
|
||||
StateNormal.Background.Color = clBlack
|
||||
StateNormal.Background.ColorOpacity = 255
|
||||
StateNormal.Background.Gradient1.StartColor = clWhite
|
||||
StateNormal.Background.Gradient1.StartColorOpacity = 255
|
||||
StateNormal.Background.Gradient1.DrawMode = dmSet
|
||||
StateNormal.Background.Gradient1.EndColor = 15855597
|
||||
StateNormal.Background.Gradient1.EndColorOpacity = 255
|
||||
StateNormal.Background.Gradient1.ColorCorrection = True
|
||||
StateNormal.Background.Gradient1.GradientType = gtLinear
|
||||
StateNormal.Background.Gradient1.Point1XPercent = 0
|
||||
StateNormal.Background.Gradient1.Point1YPercent = 0
|
||||
StateNormal.Background.Gradient1.Point2XPercent = 0
|
||||
StateNormal.Background.Gradient1.Point2YPercent = 100
|
||||
StateNormal.Background.Gradient1.Sinus = False
|
||||
StateNormal.Background.Gradient2.StartColor = 13137169
|
||||
StateNormal.Background.Gradient2.StartColorOpacity = 255
|
||||
StateNormal.Background.Gradient2.DrawMode = dmSet
|
||||
StateNormal.Background.Gradient2.EndColor = 15722194
|
||||
StateNormal.Background.Gradient2.EndColorOpacity = 255
|
||||
StateNormal.Background.Gradient2.ColorCorrection = True
|
||||
StateNormal.Background.Gradient2.GradientType = gtLinear
|
||||
StateNormal.Background.Gradient2.Point1XPercent = 0
|
||||
StateNormal.Background.Gradient2.Point1YPercent = 0
|
||||
StateNormal.Background.Gradient2.Point2XPercent = 0
|
||||
StateNormal.Background.Gradient2.Point2YPercent = 100
|
||||
StateNormal.Background.Gradient2.Sinus = False
|
||||
StateNormal.Background.Gradient1EndPercent = 100
|
||||
StateNormal.Background.Style = bbsGradient
|
||||
StateNormal.Border.Color = 13816015
|
||||
StateNormal.Border.ColorOpacity = 255
|
||||
StateNormal.Border.LightColor = clWhite
|
||||
StateNormal.Border.LightOpacity = 255
|
||||
StateNormal.Border.LightWidth = 1
|
||||
StateNormal.Border.Style = bboSolid
|
||||
StateNormal.Border.Width = 1
|
||||
StateNormal.FontEx.Color = clBlack
|
||||
StateNormal.FontEx.EndEllipsis = False
|
||||
StateNormal.FontEx.FontQuality = fqSystemClearType
|
||||
StateNormal.FontEx.Height = 0
|
||||
StateNormal.FontEx.SingleLine = True
|
||||
StateNormal.FontEx.Shadow = False
|
||||
StateNormal.FontEx.ShadowColor = clBlack
|
||||
StateNormal.FontEx.ShadowColorOpacity = 255
|
||||
StateNormal.FontEx.ShadowRadius = 5
|
||||
StateNormal.FontEx.ShadowOffsetX = 5
|
||||
StateNormal.FontEx.ShadowOffsetY = 5
|
||||
StateNormal.FontEx.Style = []
|
||||
StateNormal.FontEx.TextAlignment = bcaCenter
|
||||
StateNormal.FontEx.WordBreak = False
|
||||
Caption = 'Commands'
|
||||
Color = clNone
|
||||
DropDownWidth = 16
|
||||
DropDownArrowSize = 8
|
||||
GlobalOpacity = 255
|
||||
Glyph.Data = {
|
||||
36040000424D3604000000000000360000002800000010000000100000000100
|
||||
2000000000000004000064000000640000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000008F0000
|
||||
008F0000008F0000008F0000008F0000008F0000008F0000008F0000008F0000
|
||||
008F0000008F0000008F0000008F0000008F0000008F0000008F000000B70000
|
||||
00B7000000B7000000B7000000B7000000B7000000B7000000B7000000B70000
|
||||
00B7000000B7000000B7000000B7000000B7000000B7000000B7000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000009F0000
|
||||
009F0000009F0000009F0000009F0000009F0000009F0000009F0000009F0000
|
||||
009F0000009F0000009F0000009F0000009F0000009F0000009F0000009F0000
|
||||
009F0000009F0000009F0000009F0000009F0000009F0000009F0000009F0000
|
||||
009F0000009F0000009F0000009F0000009F0000009F0000009F000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000B70000
|
||||
00B7000000B7000000B7000000B7000000B7000000B7000000B7000000B70000
|
||||
00B7000000B7000000B7000000B7000000B7000000B7000000B70000008F0000
|
||||
008F0000008F0000008F0000008F0000008F0000008F0000008F0000008F0000
|
||||
008F0000008F0000008F0000008F0000008F0000008F0000008F000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = BCButton1Click
|
||||
ParentColor = False
|
||||
Rounding.RoundX = 3
|
||||
Rounding.RoundY = 3
|
||||
Rounding.RoundOptions = []
|
||||
RoundingDropDown.RoundX = 1
|
||||
RoundingDropDown.RoundY = 1
|
||||
RoundingDropDown.RoundOptions = []
|
||||
TextApplyGlobalOpacity = False
|
||||
end
|
||||
end
|
||||
object ListBox1: TListBox
|
||||
Left = 512
|
||||
Height = 220
|
||||
Top = 56
|
||||
Width = 648
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
ItemHeight = 0
|
||||
OnDblClick = ListBox1DblClick
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
end
|
||||
object SynCompletion1: TSynCompletion
|
||||
Position = 0
|
||||
LinesInWindow = 6
|
||||
SelectedColor = clHighlight
|
||||
CaseSensitive = False
|
||||
Width = 500
|
||||
LongLineHintType = sclpNone
|
||||
ShortCut = 16416
|
||||
EndOfTokenChr = '()[].'
|
||||
ExecCommandID = ecSynCompletionExecute
|
||||
Editor = SynEdit1
|
||||
left = 664
|
||||
top = 248
|
||||
end
|
||||
object SynAnySyn1: TSynAnySyn
|
||||
Enabled = False
|
||||
CommentAttri.Foreground = clGreen
|
||||
CommentAttri.FrameEdges = sfeAround
|
||||
Comments = [csPasStyle]
|
||||
DetectPreprocessor = False
|
||||
IdentifierAttri.FrameEdges = sfeAround
|
||||
IdentifierChars = '!"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'
|
||||
KeyAttri.FrameEdges = sfeAround
|
||||
ConstantAttri.FrameEdges = sfeAround
|
||||
ObjectAttri.FrameEdges = sfeAround
|
||||
EntityAttri.FrameEdges = sfeAround
|
||||
VariableAttri.FrameEdges = sfeAround
|
||||
DotAttri.FrameEdges = sfeAround
|
||||
KeyWords.Strings = (
|
||||
'GOTO'
|
||||
'INPUT'
|
||||
'LET'
|
||||
'PRINT'
|
||||
)
|
||||
NumberAttri.Foreground = clMaroon
|
||||
NumberAttri.FrameEdges = sfeAround
|
||||
PreprocessorAttri.FrameEdges = sfeAround
|
||||
SpaceAttri.FrameEdges = sfeAround
|
||||
StringAttri.Foreground = 16744448
|
||||
StringAttri.FrameEdges = sfeAround
|
||||
SymbolAttri.Foreground = 4227327
|
||||
SymbolAttri.FrameEdges = sfeAround
|
||||
StringDelim = sdDoubleQuote
|
||||
Markup = False
|
||||
Entity = False
|
||||
DollarVariables = False
|
||||
ActiveDot = False
|
||||
left = 248
|
||||
top = 112
|
||||
end
|
||||
end
|
100
bgracontrols/test/test_bgrascript/umain.pas
Normal file
100
bgracontrols/test/test_bgrascript/umain.pas
Normal file
@@ -0,0 +1,100 @@
|
||||
unit umain;
|
||||
|
||||
{
|
||||
How to write:
|
||||
- Separate commands by line (only one command in one line)
|
||||
- Separate parameters by single space ' ' or comma ','
|
||||
- All parameters are obligatory
|
||||
- Put strings with double quotes "text"
|
||||
- Put float numbers as strings "1,5"
|
||||
- Comments are threated as the first parameter
|
||||
- Comment with '// comment' and '{ comment }' or '//,comment' and '{,comment}'
|
||||
- Multi line comments not allowed
|
||||
- Use 'let' to store values: "let a 100" "let key value"
|
||||
|
||||
Error handling:
|
||||
- If one line fails and program not crash it will continue running other lines
|
||||
- Empty lines will not run and will not be printed in debug
|
||||
- Wrong number of parameters will not run and will show an error in debug
|
||||
- Wrong command name will not run and will show an error in debug
|
||||
}
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, SynEdit, SynCompletion, SynHighlighterAny, Forms,
|
||||
Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, BGRAGraphicControl,
|
||||
BGRABitmap, BCTypes, BGRAScript, BGRAVirtualScreen, BCButton, bgrabitmaptypes;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
BCButton1: TBCButton;
|
||||
BGRAGraphicControl1: TBGRAGraphicControl;
|
||||
BGRAVirtualScreen1: TBGRAVirtualScreen;
|
||||
ListBox1: TListBox;
|
||||
Splitter1: TSplitter;
|
||||
SynAnySyn1: TSynAnySyn;
|
||||
SynCompletion1: TSynCompletion;
|
||||
SynEdit1: TSynEdit;
|
||||
procedure BCButton1Click(Sender: TObject);
|
||||
procedure BGRAGraphicControl1Click(Sender: TObject);
|
||||
procedure BGRAGraphicControl1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
|
||||
procedure BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure ListBox1DblClick(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.BGRAGraphicControl1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
|
||||
begin
|
||||
BGRAScript.ScriptCommandList(SynEdit1.Lines, Bitmap);
|
||||
end;
|
||||
|
||||
procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
|
||||
begin
|
||||
Bitmap.DrawHorizLine(0,Bitmap.Height-3,Bitmap.Width-1,BGRA(215,215,215,255));
|
||||
Bitmap.DrawHorizLine(0,Bitmap.Height-2,Bitmap.Width-1,BGRA(235,235,235,255));
|
||||
Bitmap.DrawHorizLine(0,Bitmap.Height-1,Bitmap.Width-1,BGRA(240,240,240,255));
|
||||
end;
|
||||
|
||||
procedure TForm1.BGRAGraphicControl1Click(Sender: TObject);
|
||||
begin
|
||||
BGRAGraphicControl1.DiscardBitmap;
|
||||
end;
|
||||
|
||||
procedure TForm1.BCButton1Click(Sender: TObject);
|
||||
begin
|
||||
ListBox1.Visible := not ListBox1.Visible;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
BGRAScript.SynCompletionList(SynCompletion1.ItemList);
|
||||
BGRAScript.SynCompletionList(ListBox1.Items);
|
||||
end;
|
||||
|
||||
procedure TForm1.ListBox1DblClick(Sender: TObject);
|
||||
begin
|
||||
SynEdit1.Lines.Add(ListBox1.GetSelectedText);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
Reference in New Issue
Block a user