Changeset 97


Ignore:
Timestamp:
Aug 2, 2018, 3:33:02 PM (6 years ago)
Author:
chronos
Message:
  • Added: Syntax highlighting.
Location:
trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormAbout.lfm

    r96 r97  
    11object FormAbout: TFormAbout
    2   Left = 562
     2  Left = 656
    33  Height = 301
    4   Top = 277
     4  Top = 379
    55  Width = 515
    66  Caption = 'About'
  • trunk/Forms/UFormMain.pas

    r96 r97  
    202202    DockInit;
    203203    Core.PersistentForm1.Load(Self, True);
    204     Core.ThemeManager.UseTheme(Self)
     204    Core.ThemeManager.UseTheme(Self);
     205    FormSourceCode.UpdateTheme;
    205206  end;
    206207end;
     
    249250  if Core.Project.Openned then
    250251    raise Exception.Create(SCloseProjectFirst);
    251   FormSourceCode.MemoSource.Lines.LoadFromFile(FileName);
     252  FormSourceCode.SynEdit1.Lines.LoadFromFile(FileName);
    252253  Core.LastOpenedList.AddItem(FileName);
    253254  Core.Project.FileName := FileName;
     
    343344  Caption := Title;
    344345  AProjectSave.Enabled := Core.Project.Modified;
    345   FormSourceCode.MemoSource.Enabled := Core.Project.Openned;
     346  FormSourceCode.SynEdit1.Enabled := Core.Project.Openned;
    346347  AProjectClose.Enabled := Core.Project.Openned;
    347348  AProjectSaveAs.Enabled := Core.Project.Openned;
     
    371372procedure TFormMain.UpdateStatusBar;
    372373begin
    373   StatusBarMain.Panels[0].Text := IntToStr(FormSourceCode.MemoSource.CaretPos.X) +
    374     ', ' + IntToStr(FormSourceCode.MemoSource.CaretPos.Y);
     374  StatusBarMain.Panels[0].Text := IntToStr(FormSourceCode.SynEdit1.CaretXY.X) +
     375    ', ' + IntToStr(FormSourceCode.SynEdit1.CaretXY.Y);
    375376end;
    376377
     
    418419  DebugStep := Core.CurrentTarget.DebugSteps.SearchByTargetPos(FormTargetCode.MemoTarget.SelStart);
    419420  if Assigned(DebugStep) then begin
    420     FormSourceCode.MemoSource.SelStart := DebugStep.SourcePosition;
     421    FormSourceCode.SynEdit1.SelStart := DebugStep.SourcePosition;
    421422    PageControlMain.TabIndex := 0;
    422423  end;
     
    427428  DebugStep: TDebugStep;
    428429begin
    429   DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.MemoSource.SelStart);
     430  DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEdit1.SelStart);
    430431  if Assigned(DebugStep) then begin
    431432    FormTargetCode.MemoTarget.SelStart := DebugStep.TargetPosition;
     
    484485      end;
    485486      Core.ThemeManager.UseTheme(Self);
     487      FormSourceCode.UpdateTheme;
    486488    end;
    487489  finally
     
    495497  try
    496498    AProgramStop.Execute;
    497     SourceCode := FormSourceCode.MemoSource.Text;
     499    SourceCode := FormSourceCode.SynEdit1.Text;
    498500    ProjectFileName := Core.Project.FileName;
    499501    ProgramName := ExtractFileNameOnly(Core.Project.FileName);
     
    517519  BreakPoint: TBreakPoint;
    518520begin
    519   DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.MemoSource.SelStart);
     521  DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEdit1.SelStart);
    520522  if Assigned(DebugStep) then begin
    521523    BreakPoint := Core.CurrentTarget.BreakPoints.SearchByTargetPos(DebugStep.TargetPosition);
     
    550552  if Core.CurrentTarget.State = rsStopped then begin
    551553    if not Core.CurrentTarget.Compiled then AProgramCompile.Execute;
    552     DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.MemoSource.SelStart);
     554    DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEdit1.SelStart);
    553555    Core.CurrentTarget.BreakPoints.SetSystem(DebugStep.TargetPosition);
    554556    AProgramRun.Execute;
    555557  end else begin
    556     DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.MemoSource.SelStart);
     558    DebugStep := Core.CurrentTarget.DebugSteps.SearchBySourcePos(FormSourceCode.SynEdit1.SelStart);
    557559    Core.CurrentTarget.RunToCursor(DebugStep.TargetPosition);
    558560  end;
     
    564566begin
    565567  DebugStep := Core.CurrentTarget.DebugSteps.SearchByTargetPos(Core.CurrentTarget.ExecutionPosition);
    566   FormSourceCode.MemoSource.SelStart := DebugStep.SourcePosition;
     568  FormSourceCode.SynEdit1.SelStart := DebugStep.SourcePosition;
    567569  FormTargetCode.MemoTarget.SelStart := DebugStep.TargetPosition;
    568   if PageControlMain.TabIndex = 0 then FormSourceCode.MemoSource.SetFocus;
     570  if PageControlMain.TabIndex = 0 then FormSourceCode.SynEdit1.SetFocus;
    569571  if PageControlMain.TabIndex = 1 then FormTargetCode.MemoTarget.SetFocus;
    570572end;
     
    612614    AProgramStop.Execute;
    613615    Core.Project.Openned := False;
    614     FormSourceCode.MemoSource.Clear;
     616    FormSourceCode.SynEdit1.Clear;
    615617    UpdateInterface;
    616618  end;
     
    622624  if Core.Project.Openned then Exit;
    623625  Core.Project.FileName := 'Examples' + DirectorySeparator + SNewProject + '.b';
    624   FormSourceCode.MemoSource.Clear;
     626  FormSourceCode.SynEdit1.Clear;
    625627  Core.Project.Openned := True;
    626628  Core.CurrentTarget.Compiled := False;
     
    652654  SaveDialog1.FileName := Core.Project.FileName;
    653655  if SaveDialog1.Execute then begin
    654     FormSourceCode.MemoSource.Lines.SaveToFile(SaveDialog1.FileName);
     656    FormSourceCode.SynEdit1.Lines.SaveToFile(SaveDialog1.FileName);
    655657    Core.Project.FileName := SaveDialog1.FileName;
    656658    Core.LastOpenedList.AddItem(SaveDialog1.FileName);
     
    663665begin
    664666  if Core.Project.Modified and FileExistsUTF8(Core.Project.FileName) then begin
    665     FormSourceCode.MemoSource.Lines.SaveToFile(Core.Project.FileName);
     667    FormSourceCode.SynEdit1.Lines.SaveToFile(Core.Project.FileName);
    666668    Core.Project.Modified := False;
    667669    UpdateInterface;
  • trunk/Forms/UFormSourceCode.lfm

    r88 r97  
    11object FormSourceCode: TFormSourceCode
    2   Left = 627
    3   Height = 240
    4   Top = 182
    5   Width = 320
     2  Left = 459
     3  Height = 491
     4  Top = 278
     5  Width = 560
    66  Caption = 'Source code'
    7   ClientHeight = 240
    8   ClientWidth = 320
    9   LCLVersion = '1.6.4.0'
    10   object MemoSource: TMemo
     7  ClientHeight = 491
     8  ClientWidth = 560
     9  DesignTimePPI = 120
     10  OnCreate = FormCreate
     11  LCLVersion = '1.8.2.0'
     12  inline SynEdit1: TSynEdit
    1113    Left = 0
    12     Height = 240
     14    Height = 491
    1315    Top = 0
    14     Width = 320
     16    Width = 560
    1517    Align = alClient
    16     Font.Height = -12
     18    Font.Height = -13
    1719    Font.Name = 'Courier New'
    18     OnChange = MemoSourceChange
     20    Font.Pitch = fpFixed
     21    Font.Quality = fqNonAntialiased
     22    ParentColor = False
     23    ParentFont = False
     24    PopupMenu = PopupMenuSource
     25    TabOrder = 0
    1926    OnKeyDown = MemoSourceKeyDown
    2027    OnKeyPress = MemoSourceKeyPress
    2128    OnKeyUp = MemoSourceKeyUp
    2229    OnMouseDown = MemoSourceMouseDown
    23     ParentFont = False
    24     PopupMenu = PopupMenuSource
    25     ScrollBars = ssAutoBoth
    26     TabOrder = 0
     30    Gutter.Width = 59
     31    Gutter.MouseActions = <>
     32    RightGutter.Width = 0
     33    RightGutter.MouseActions = <>
     34    Keystrokes = <   
     35      item
     36        Command = ecUp
     37        ShortCut = 38
     38      end   
     39      item
     40        Command = ecSelUp
     41        ShortCut = 8230
     42      end   
     43      item
     44        Command = ecScrollUp
     45        ShortCut = 16422
     46      end   
     47      item
     48        Command = ecDown
     49        ShortCut = 40
     50      end   
     51      item
     52        Command = ecSelDown
     53        ShortCut = 8232
     54      end   
     55      item
     56        Command = ecScrollDown
     57        ShortCut = 16424
     58      end   
     59      item
     60        Command = ecLeft
     61        ShortCut = 37
     62      end   
     63      item
     64        Command = ecSelLeft
     65        ShortCut = 8229
     66      end   
     67      item
     68        Command = ecWordLeft
     69        ShortCut = 16421
     70      end   
     71      item
     72        Command = ecSelWordLeft
     73        ShortCut = 24613
     74      end   
     75      item
     76        Command = ecRight
     77        ShortCut = 39
     78      end   
     79      item
     80        Command = ecSelRight
     81        ShortCut = 8231
     82      end   
     83      item
     84        Command = ecWordRight
     85        ShortCut = 16423
     86      end   
     87      item
     88        Command = ecSelWordRight
     89        ShortCut = 24615
     90      end   
     91      item
     92        Command = ecPageDown
     93        ShortCut = 34
     94      end   
     95      item
     96        Command = ecSelPageDown
     97        ShortCut = 8226
     98      end   
     99      item
     100        Command = ecPageBottom
     101        ShortCut = 16418
     102      end   
     103      item
     104        Command = ecSelPageBottom
     105        ShortCut = 24610
     106      end   
     107      item
     108        Command = ecPageUp
     109        ShortCut = 33
     110      end   
     111      item
     112        Command = ecSelPageUp
     113        ShortCut = 8225
     114      end   
     115      item
     116        Command = ecPageTop
     117        ShortCut = 16417
     118      end   
     119      item
     120        Command = ecSelPageTop
     121        ShortCut = 24609
     122      end   
     123      item
     124        Command = ecLineStart
     125        ShortCut = 36
     126      end   
     127      item
     128        Command = ecSelLineStart
     129        ShortCut = 8228
     130      end   
     131      item
     132        Command = ecEditorTop
     133        ShortCut = 16420
     134      end   
     135      item
     136        Command = ecSelEditorTop
     137        ShortCut = 24612
     138      end   
     139      item
     140        Command = ecLineEnd
     141        ShortCut = 35
     142      end   
     143      item
     144        Command = ecSelLineEnd
     145        ShortCut = 8227
     146      end   
     147      item
     148        Command = ecEditorBottom
     149        ShortCut = 16419
     150      end   
     151      item
     152        Command = ecSelEditorBottom
     153        ShortCut = 24611
     154      end   
     155      item
     156        Command = ecToggleMode
     157        ShortCut = 45
     158      end   
     159      item
     160        Command = ecCopy
     161        ShortCut = 16429
     162      end   
     163      item
     164        Command = ecPaste
     165        ShortCut = 8237
     166      end   
     167      item
     168        Command = ecDeleteChar
     169        ShortCut = 46
     170      end   
     171      item
     172        Command = ecCut
     173        ShortCut = 8238
     174      end   
     175      item
     176        Command = ecDeleteLastChar
     177        ShortCut = 8
     178      end   
     179      item
     180        Command = ecDeleteLastChar
     181        ShortCut = 8200
     182      end   
     183      item
     184        Command = ecDeleteLastWord
     185        ShortCut = 16392
     186      end   
     187      item
     188        Command = ecUndo
     189        ShortCut = 32776
     190      end   
     191      item
     192        Command = ecRedo
     193        ShortCut = 40968
     194      end   
     195      item
     196        Command = ecLineBreak
     197        ShortCut = 13
     198      end   
     199      item
     200        Command = ecSelectAll
     201        ShortCut = 16449
     202      end   
     203      item
     204        Command = ecCopy
     205        ShortCut = 16451
     206      end   
     207      item
     208        Command = ecBlockIndent
     209        ShortCut = 24649
     210      end   
     211      item
     212        Command = ecLineBreak
     213        ShortCut = 16461
     214      end   
     215      item
     216        Command = ecInsertLine
     217        ShortCut = 16462
     218      end   
     219      item
     220        Command = ecDeleteWord
     221        ShortCut = 16468
     222      end   
     223      item
     224        Command = ecBlockUnindent
     225        ShortCut = 24661
     226      end   
     227      item
     228        Command = ecPaste
     229        ShortCut = 16470
     230      end   
     231      item
     232        Command = ecCut
     233        ShortCut = 16472
     234      end   
     235      item
     236        Command = ecDeleteLine
     237        ShortCut = 16473
     238      end   
     239      item
     240        Command = ecDeleteEOL
     241        ShortCut = 24665
     242      end   
     243      item
     244        Command = ecUndo
     245        ShortCut = 16474
     246      end   
     247      item
     248        Command = ecRedo
     249        ShortCut = 24666
     250      end   
     251      item
     252        Command = ecGotoMarker0
     253        ShortCut = 16432
     254      end   
     255      item
     256        Command = ecGotoMarker1
     257        ShortCut = 16433
     258      end   
     259      item
     260        Command = ecGotoMarker2
     261        ShortCut = 16434
     262      end   
     263      item
     264        Command = ecGotoMarker3
     265        ShortCut = 16435
     266      end   
     267      item
     268        Command = ecGotoMarker4
     269        ShortCut = 16436
     270      end   
     271      item
     272        Command = ecGotoMarker5
     273        ShortCut = 16437
     274      end   
     275      item
     276        Command = ecGotoMarker6
     277        ShortCut = 16438
     278      end   
     279      item
     280        Command = ecGotoMarker7
     281        ShortCut = 16439
     282      end   
     283      item
     284        Command = ecGotoMarker8
     285        ShortCut = 16440
     286      end   
     287      item
     288        Command = ecGotoMarker9
     289        ShortCut = 16441
     290      end   
     291      item
     292        Command = ecSetMarker0
     293        ShortCut = 24624
     294      end   
     295      item
     296        Command = ecSetMarker1
     297        ShortCut = 24625
     298      end   
     299      item
     300        Command = ecSetMarker2
     301        ShortCut = 24626
     302      end   
     303      item
     304        Command = ecSetMarker3
     305        ShortCut = 24627
     306      end   
     307      item
     308        Command = ecSetMarker4
     309        ShortCut = 24628
     310      end   
     311      item
     312        Command = ecSetMarker5
     313        ShortCut = 24629
     314      end   
     315      item
     316        Command = ecSetMarker6
     317        ShortCut = 24630
     318      end   
     319      item
     320        Command = ecSetMarker7
     321        ShortCut = 24631
     322      end   
     323      item
     324        Command = ecSetMarker8
     325        ShortCut = 24632
     326      end   
     327      item
     328        Command = ecSetMarker9
     329        ShortCut = 24633
     330      end   
     331      item
     332        Command = EcFoldLevel1
     333        ShortCut = 41009
     334      end   
     335      item
     336        Command = EcFoldLevel2
     337        ShortCut = 41010
     338      end   
     339      item
     340        Command = EcFoldLevel3
     341        ShortCut = 41011
     342      end   
     343      item
     344        Command = EcFoldLevel4
     345        ShortCut = 41012
     346      end   
     347      item
     348        Command = EcFoldLevel5
     349        ShortCut = 41013
     350      end   
     351      item
     352        Command = EcFoldLevel6
     353        ShortCut = 41014
     354      end   
     355      item
     356        Command = EcFoldLevel7
     357        ShortCut = 41015
     358      end   
     359      item
     360        Command = EcFoldLevel8
     361        ShortCut = 41016
     362      end   
     363      item
     364        Command = EcFoldLevel9
     365        ShortCut = 41017
     366      end   
     367      item
     368        Command = EcFoldLevel0
     369        ShortCut = 41008
     370      end   
     371      item
     372        Command = EcFoldCurrent
     373        ShortCut = 41005
     374      end   
     375      item
     376        Command = EcUnFoldCurrent
     377        ShortCut = 41003
     378      end   
     379      item
     380        Command = EcToggleMarkupWord
     381        ShortCut = 32845
     382      end   
     383      item
     384        Command = ecNormalSelect
     385        ShortCut = 24654
     386      end   
     387      item
     388        Command = ecColumnSelect
     389        ShortCut = 24643
     390      end   
     391      item
     392        Command = ecLineSelect
     393        ShortCut = 24652
     394      end   
     395      item
     396        Command = ecTab
     397        ShortCut = 9
     398      end   
     399      item
     400        Command = ecShiftTab
     401        ShortCut = 8201
     402      end   
     403      item
     404        Command = ecMatchBracket
     405        ShortCut = 24642
     406      end   
     407      item
     408        Command = ecColSelUp
     409        ShortCut = 40998
     410      end   
     411      item
     412        Command = ecColSelDown
     413        ShortCut = 41000
     414      end   
     415      item
     416        Command = ecColSelLeft
     417        ShortCut = 40997
     418      end   
     419      item
     420        Command = ecColSelRight
     421        ShortCut = 40999
     422      end   
     423      item
     424        Command = ecColSelPageDown
     425        ShortCut = 40994
     426      end   
     427      item
     428        Command = ecColSelPageBottom
     429        ShortCut = 57378
     430      end   
     431      item
     432        Command = ecColSelPageUp
     433        ShortCut = 40993
     434      end   
     435      item
     436        Command = ecColSelPageTop
     437        ShortCut = 57377
     438      end   
     439      item
     440        Command = ecColSelLineStart
     441        ShortCut = 40996
     442      end   
     443      item
     444        Command = ecColSelLineEnd
     445        ShortCut = 40995
     446      end   
     447      item
     448        Command = ecColSelEditorTop
     449        ShortCut = 57380
     450      end   
     451      item
     452        Command = ecColSelEditorBottom
     453        ShortCut = 57379
     454      end>
     455    MouseActions = <>
     456    MouseTextActions = <>
     457    MouseSelActions = <>
     458    VisibleSpecialChars = [vscSpace, vscTabAtLast]
     459    SelectedColor.BackPriority = 50
     460    SelectedColor.ForePriority = 50
     461    SelectedColor.FramePriority = 50
     462    SelectedColor.BoldPriority = 50
     463    SelectedColor.ItalicPriority = 50
     464    SelectedColor.UnderlinePriority = 50
     465    SelectedColor.StrikeOutPriority = 50
     466    BracketHighlightStyle = sbhsBoth
     467    BracketMatchColor.Background = clNone
     468    BracketMatchColor.Foreground = clNone
     469    BracketMatchColor.Style = [fsBold]
     470    FoldedCodeColor.Background = clNone
     471    FoldedCodeColor.Foreground = clGray
     472    FoldedCodeColor.FrameColor = clGray
     473    MouseLinkColor.Background = clNone
     474    MouseLinkColor.Foreground = clBlue
     475    LineHighlightColor.Background = clNone
     476    LineHighlightColor.Foreground = clNone
     477    OnChange = MemoSourceChange
     478    inline SynLeftGutterPartList1: TSynGutterPartList
     479      object SynGutterMarks1: TSynGutterMarks
     480        Width = 24
     481        MouseActions = <>
     482      end
     483      object SynGutterLineNumber1: TSynGutterLineNumber
     484        Width = 17
     485        MouseActions = <>
     486        MarkupInfo.Background = clBtnFace
     487        MarkupInfo.Foreground = clNone
     488        DigitCount = 2
     489        ShowOnlyLineNumbersMultiplesOf = 1
     490        ZeroStart = False
     491        LeadingZeros = False
     492      end
     493      object SynGutterChanges1: TSynGutterChanges
     494        Width = 4
     495        MouseActions = <>
     496        ModifiedColor = 59900
     497        SavedColor = clGreen
     498      end
     499      object SynGutterSeparator1: TSynGutterSeparator
     500        Width = 2
     501        MouseActions = <>
     502        MarkupInfo.Background = clWhite
     503        MarkupInfo.Foreground = clGray
     504      end
     505      object SynGutterCodeFolding1: TSynGutterCodeFolding
     506        AutoSize = False
     507        Width = 12
     508        MouseActions = <>
     509        MarkupInfo.Background = clNone
     510        MarkupInfo.Foreground = clGray
     511        MouseActionsExpanded = <>
     512        MouseActionsCollapsed = <>
     513      end
     514    end
    27515  end
    28516  object PopupMenuSource: TPopupMenu
    29517    Images = Core.ImageListMain
    30518    left = 128
    31     top = 112
     519    top = 128
    32520    object MenuItem23: TMenuItem
    33521      Action = FormMain.ABreakpointToggle
     
    38526    object MenuItem21: TMenuItem
    39527      Action = AGenerateNumber
     528    end
     529    object MenuItem29: TMenuItem
     530      Action = FormMain.AShowTargetPosition
    40531      Bitmap.Data = {
    41532        36040000424D3604000000000000360000002800000010000000100000000100
     
    75566      }
    76567    end
    77     object MenuItem29: TMenuItem
    78       Action = FormMain.AShowTargetPosition
    79       Bitmap.Data = {
    80         36040000424D3604000000000000360000002800000010000000100000000100
    81         2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
    82         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    83         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    84         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    85         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    86         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    87         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    88         FF000000008B000000B7FFFFFF000000008B000000FF000000FF000000FF0000
    89         008BFFFFFF00000000B7000000FF000000B7FFFFFF00FFFFFF00FFFFFF00FFFF
    90         FF000000008B000000B7FFFFFF0000000063000000FF00000063FFFFFF00FFFF
    91         FF0000000063000000B700000020000000FF00000063FFFFFF00FFFFFF00FFFF
    92         FF000000008B000000B7FFFFFF00FFFFFF00000000FF000000FF00000020FFFF
    93         FF00FFFFFF00FFFFFF00FFFFFF00000000FF0000008BFFFFFF00FFFFFF00FFFF
    94         FF000000008B000000B7FFFFFF00FFFFFF0000000040000000FF000000B7FFFF
    95         FF00FFFFFF00FFFFFF00FFFFFF00000000FF00000063FFFFFF00FFFFFF00FFFF
    96         FF000000008B000000B7FFFFFF00FFFFFF00FFFFFF000000008B000000FF0000
    97         0040FFFFFF00FFFFFF00000000FF00000040FFFFFF00FFFFFF00000000200000
    98         00B70000008B000000B7FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF0000
    99         008BFFFFFF00FFFFFF0000000020000000FF00000020FFFFFF00000000200000
    100         00FF000000FF000000B7FFFFFF00FFFFFF00FFFFFF00FFFFFF000000008B0000
    101         008BFFFFFF00FFFFFF00FFFFFF00000000FF00000040FFFFFF00FFFFFF000000
    102         0040000000FF000000B7FFFFFF0000000063000000B7FFFFFF00000000B70000
    103         0063000000630000008B00000020000000FF00000020FFFFFF00FFFFFF00FFFF
    104         FF0000000063000000B7FFFFFF00FFFFFF00000000FF000000FF000000B7FFFF
    105         FF00FFFFFF00000000FF000000FF0000008BFFFFFF00FFFFFF00FFFFFF00FFFF
    106         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    107         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    108         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    109         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    110         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    111         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    112         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    113         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
    114       }
    115     end
    116568    object MenuItem36: TMenuItem
    117569      Action = AShrinkSource
     
    122574    object MenuItem2: TMenuItem
    123575      Action = ACopyToClipboard
    124       Bitmap.Data = {
    125         36040000424D3604000000000000360000002800000010000000100000000100
    126         2000000000000004000064000000640000000000000000000000000000000000
    127         0000000000000000000000000000000000000000000000000000000000000000
    128         0000000000000000000000000000000000000000000000000000000000000000
    129         00000000000000000000000000000000000000000000840000FF840000FF8400
    130         00FF840000FF840000FF840000FF840000FF840000FF840000FF000000000000
    131         00000000000000000000000000000000000000000000840000FFFFFFFFFFFFFF
    132         FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FF000000000000
    133         00000000000000000000000000000000000000000000840000FFFFFFFFFF0000
    134         00FF000000FF000000FF000000FF000000FFFFFFFFFF840000FF000000000000
    135         00FF000000FF000000FF000000FF000000FF000000FF840000FFFFFFFFFFFFFF
    136         FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FF000000000000
    137         00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF0000
    138         00FF000000FF000000FF000000FF000000FFFFFFFFFF840000FF000000000000
    139         00FFFFFFFFFF000000FF000000FF000000FF000000FF840000FFFFFFFFFFFFFF
    140         FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FF000000000000
    141         00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF0000
    142         00FF000000FFFFFFFFFF840000FF840000FF840000FF840000FF000000000000
    143         00FFFFFFFFFF000000FF000000FF000000FF000000FF840000FFFFFFFFFFFFFF
    144         FFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF840000FF00000000000000000000
    145         00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFFFFFF
    146         FFFFFFFFFFFFFFFFFFFF840000FF840000FF0000000000000000000000000000
    147         00FFFFFFFFFF000000FF000000FFFFFFFFFF000000FF840000FF840000FF8400
    148         00FF840000FF840000FF840000FF000000000000000000000000000000000000
    149         00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFF000000FF0000
    150         0000000000000000000000000000000000000000000000000000000000000000
    151         00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF000000FF000000000000
    152         0000000000000000000000000000000000000000000000000000000000000000
    153         00FF000000FF000000FF000000FF000000FF000000FF00000000000000000000
    154         0000000000000000000000000000000000000000000000000000000000000000
    155         0000000000000000000000000000000000000000000000000000000000000000
    156         0000000000000000000000000000000000000000000000000000000000000000
    157         0000000000000000000000000000000000000000000000000000000000000000
    158         0000000000000000000000000000000000000000000000000000
    159       }
    160576    end
    161577    object MenuItem3: TMenuItem
    162578      Action = APasteFromClipboard
    163       Bitmap.Data = {
    164         36040000424D3604000000000000360000002800000010000000100000000100
    165         2000000000000004000064000000640000000000000000000000FF00FF00FF00
    166         FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    167         FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    168         FF00FF00FF00FF00FF00FF00FF00FF00FF00840000FF840000FF840000FF8400
    169         00FF840000FF840000FF840000FF840000FF840000FF840000FFFF00FF000000
    170         00FF000000FF000000FF000000FF000000FF840000FFFFFFFFFFFFFFFFFFFFFF
    171         FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FF000000FF8484
    172         84FF008484FF848484FF008484FF848484FF840000FFFFFFFFFF000000FF0000
    173         00FF000000FF000000FF000000FF000000FFFFFFFFFF840000FF000000FF0084
    174         84FF848484FF008484FF848484FF008484FF840000FFFFFFFFFFFFFFFFFFFFFF
    175         FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF840000FF000000FF8484
    176         84FF008484FF848484FF008484FF848484FF840000FFFFFFFFFF000000FF0000
    177         00FF000000FFFFFFFFFF840000FF840000FF840000FF840000FF000000FF0084
    178         84FF848484FF008484FF848484FF008484FF840000FFFFFFFFFFFFFFFFFFFFFF
    179         FFFFFFFFFFFFFFFFFFFF840000FFFFFFFFFF840000FFFF00FF00000000FF8484
    180         84FF008484FF848484FF008484FF848484FF840000FFFFFFFFFFFFFFFFFFFFFF
    181         FFFFFFFFFFFFFFFFFFFF840000FF840000FFFF00FF00FF00FF00000000FF0084
    182         84FF848484FF008484FF848484FF008484FF840000FF840000FF840000FF8400
    183         00FF840000FF840000FF840000FF000000FFFF00FF00FF00FF00000000FF8484
    184         84FF008484FF848484FF008484FF848484FF008484FF848484FF008484FF8484
    185         84FF008484FF848484FF008484FF000000FFFF00FF00FF00FF00000000FF0084
    186         84FF848484FF000000FF000000FF000000FF000000FF000000FF000000FF0000
    187         00FF000000FF848484FF848484FF000000FFFF00FF00FF00FF00000000FF8484
    188         84FF848484FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    189         FF00000000FF848484FF008484FF000000FFFF00FF00FF00FF00000000FF0084
    190         84FF848484FF008484FF000000FF00FFFFFF000000FF000000FF00FFFFFF0000
    191         00FF848484FF008484FF848484FF000000FFFF00FF00FF00FF00FF00FF000000
    192         00FF000000FF000000FF000000FF000000FF00FFFFFF00FFFFFF000000FF0000
    193         00FF000000FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00
    194         FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF000000FFFF00
    195         FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    196         FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    197         FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    198       }
    199579    end
    200580    object MenuItem6: TMenuItem
    201581      Action = ACutToClipboard
    202       Bitmap.Data = {
    203         36040000424D3604000000000000360000002800000010000000100000000100
    204         2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
    205         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    206         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    207         FF00FFFFFF00FFFFFF00800000FF800000FFFFFFFF00FFFFFF00FFFFFF00FFFF
    208         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    209         FF00FFFFFF00800000FFFFFFFF00FFFFFF00800000FFFFFFFF00FFFFFF008000
    210         00FF800000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    211         FF00FFFFFF00800000FFFFFFFF00FFFFFF00800000FFFFFFFF00800000FFFFFF
    212         FF00FFFFFF00800000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    213         FF00FFFFFF00800000FFFFFFFF00FFFFFF00800000FFFFFFFF00800000FFFFFF
    214         FF00FFFFFF00800000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    215         FF00FFFFFF00FFFFFF00800000FF800000FF800000FFFFFFFF00800000FFFFFF
    216         FF00FFFFFF00800000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    217         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00800000FFFFFFFF00800000FF8000
    218         00FF800000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    219         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00800000FF000000FF800000FFFFFF
    220         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    221         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FFFFFFFF00FFFF
    222         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    223         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FFFFFF
    224         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    225         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FFFFFFFF00000000FFFFFF
    226         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    227         FF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FFFFFFFF00000000FF0000
    228         00FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    229         FF00FFFFFF00FFFFFF00FFFFFF00000000FFFFFFFF00FFFFFF00FFFFFF000000
    230         00FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    231         FF00FFFFFF00FFFFFF00FFFFFF00000000FFFFFFFF00FFFFFF00FFFFFF000000
    232         00FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    233         FF00FFFFFF00FFFFFF00FFFFFF00000000FFFFFFFF00FFFFFF00FFFFFF000000
    234         00FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    235         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
    236         FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
    237       }
    238582    end
    239583    object MenuItem4: TMenuItem
    240584      Action = AClear
    241       Bitmap.Data = {
    242         36040000424D3604000000000000360000002800000010000000100000000100
    243         2000000000000004000064000000640000000000000000000000000000000000
    244         0000000000000000000000000000000000000000000000000000000000000000
    245         0000000000000000000000000000000000000000000000000000000000000000
    246         0000000000000000000000000000000000000000000000000000000000000000
    247         0000000000000000000000000000000000000000000000000000000000000000
    248         0000000000000000000000000000000000000000000000000000000000000000
    249         00000000000000000000000000003A3AE2FFC0C0C0FF00000000000000000000
    250         0000000000003A3AE2FFC0C0C0FF000000000000000000000000000000000000
    251         0000000000000000000000000000000000000000000000000000000000000000
    252         00003A3AE2FF3A3AE2FF3A3AE2FFC0C0C0FF0000000000000000000000000000
    253         000000000000000000003A3AE2FFC0C0C0FF0000000000000000000000000000
    254         00003A3AE2FF3A3AE2FF3A3AE2FFC0C0C0FF0000000000000000000000000000
    255         0000000000003A3AE2FFC0C0C0FF000000000000000000000000000000000000
    256         0000000000003838E0FF3838E0FF3838E0FFC0C0C0FF00000000000000000000
    257         00003838E0FF3838E0FFC0C0C0FF000000000000000000000000000000000000
    258         000000000000000000003535DDFF3535DDFF3535DDFFC0C0C0FF000000003535
    259         DDFF3535DDFFC0C0C0FF00000000000000000000000000000000000000000000
    260         00000000000000000000000000003232DAFF3232DAFF3232DAFF3232DAFF3232
    261         DAFFC0C0C0FF0000000000000000000000000000000000000000000000000000
    262         0000000000000000000000000000000000002F2FD7FF2F2FD7FF2F2FD7FFC0C0
    263         C0FF000000000000000000000000000000000000000000000000000000000000
    264         00000000000000000000000000002C2CD4FF2C2CD4FF2C2CD4FF2C2CD4FF2C2C
    265         D4FFC0C0C0FF0000000000000000000000000000000000000000000000000000
    266         000000000000000000002929D1FF2929D1FF2929D1FFC0C0C0FF000000002929
    267         D1FFC0C0C0FF0000000000000000000000000000000000000000000000000000
    268         00002626CEFF2626CEFF2626CEFF2626CEFFC0C0C0FF00000000000000000000
    269         00002626CEFF2626CEFFC0C0C0FF000000000000000000000000000000002020
    270         C8FF2020C8FF2020C8FF2020C8FFC0C0C0FF0000000000000000000000000000
    271         0000000000002020C8FF2020C8FFC0C0C0FF0000000000000000000000001818
    272         C0FF1818C0FFC0C0C0FF00000000000000000000000000000000000000000000
    273         000000000000000000001818C0FF1818C0FFC0C0C0FF00000000000000000000
    274         0000000000000000000000000000000000000000000000000000000000000000
    275         0000000000000000000000000000000000000000000000000000
    276       }
    277585    end
    278586    object MenuItem5: TMenuItem
     
    333641    end
    334642  end
     643  object SynJavaSyn1: TSynJavaSyn
     644    DefaultFilter = 'Soubory Java (*.java)|*.java'
     645    Enabled = False
     646    left = 405
     647    top = 263
     648  end
    335649end
  • trunk/Forms/UFormSourceCode.pas

    r88 r97  
    66
    77uses
    8   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   Menus, ActnList, strutils;
     8  Classes, SysUtils, FileUtil, SynEdit, SynHighlighterIni, Forms, Controls,
     9  Graphics, Dialogs, StdCtrls, Menus, ActnList, strutils, SynEditTypes,
     10  SynEditHighlighter, SynHighlighterAny, SynHighlighterJava, UBFHighlighter;
    1011
    1112type
     
    2324    AGenerateNumber: TAction;
    2425    ActionList1: TActionList;
    25     MemoSource: TMemo;
    2626    MenuItem1: TMenuItem;
    2727    MenuItem2: TMenuItem;
     
    3636    MenuItem6: TMenuItem;
    3737    PopupMenuSource: TPopupMenu;
     38    SynEdit1: TSynEdit;
     39    SynJavaSyn1: TSynJavaSyn;
    3840    procedure AClearExecute(Sender: TObject);
    3941    procedure ACopyToClipboardExecute(Sender: TObject);
     
    4446    procedure ASelectAllExecute(Sender: TObject);
    4547    procedure AShrinkSourceExecute(Sender: TObject);
     48    procedure FormCreate(Sender: TObject);
    4649    procedure MemoSourceChange(Sender: TObject);
    4750    procedure MemoSourceKeyDown(Sender: TObject; var Key: Word;
     
    5356      Shift: TShiftState; X, Y: Integer);
    5457  private
     58    BFHighlighter: TSynBrainFuckHl;
    5559  public
    5660    procedure UpdateInterface;
     61    procedure UpdateTheme;
    5762  end;
    5863
     
    6267
    6368implementation
     69
     70{$R *.lfm}
    6471
    6572uses
     
    7077  SEnterNumber = 'Enter number';
    7178
    72 
    73 {$R *.lfm}
    7479
    7580{ TFormSourceCode }
     
    8691    for I := 0 to Number - 1 do
    8792      NumberText := NumberText + '+';
    88     MemoSource.SelText := NumberText;
     93    SynEdit1.SelText := NumberText;
    8994  end;
    9095end;
     
    9297procedure TFormSourceCode.APasteFromClipboardExecute(Sender: TObject);
    9398begin
    94   MemoSource.PasteFromClipboard;
     99  SynEdit1.PasteFromClipboard;
    95100end;
    96101
    97102procedure TFormSourceCode.ASelectAllExecute(Sender: TObject);
    98103begin
    99   MemoSource.SelectAll;
     104  SynEdit1.SelectAll;
    100105end;
    101106
     
    109114  IndentText = '  ';
    110115begin
    111   Source := MemoSource.Text;
     116  Source := SynEdit1.Text;
    112117  NewSource := '';
    113118  Indent := 0;
     
    125130      NewSource := NewSource + Source[I];
    126131  end;
    127   MemoSource.Text := NewSource;
     132  SynEdit1.Text := NewSource;
    128133end;
    129134
    130135procedure TFormSourceCode.ACopyToClipboardExecute(Sender: TObject);
    131136begin
    132   MemoSource.CopyToClipboard;
     137  SynEdit1.CopyToClipboard;
    133138end;
    134139
    135140procedure TFormSourceCode.ACutToClipboardExecute(Sender: TObject);
    136141begin
    137   MemoSource.CutToClipboard;
     142  SynEdit1.CutToClipboard;
    138143end;
    139144
    140145procedure TFormSourceCode.AClearExecute(Sender: TObject);
    141146begin
    142   MemoSource.Clear;
     147  SynEdit1.Clear;
    143148end;
    144149
     
    149154  I: Integer;
    150155begin
    151   Source := MemoSource.Text;
     156  Source := SynEdit1.Text;
    152157  Pos := 1;
    153158  for I := 1 to Length(Source) do begin
     
    158163  end;
    159164  SetLength(Source, Pos - 1);
    160   MemoSource.Text := Source;
     165  SynEdit1.Text := Source;
     166end;
     167
     168procedure TFormSourceCode.FormCreate(Sender: TObject);
     169begin
     170  BFHighlighter := TSynBrainFuckHl.Create(nil);
     171  SynEdit1.Highlighter := BFHighlighter;
    161172end;
    162173
     
    164175begin
    165176
     177end;
     178
     179procedure TFormSourceCode.UpdateTheme;
     180const
     181  clLightBlue = TColor($FF8080);
     182  clLightGreen = TColor($80FF80);
     183  clLightRed = TColor($8080FF);
     184begin
     185  if Core.ThemeManager.Theme.Name = 'Dark' then begin
     186    BFHighlighter.IoAttri.Foreground := clWhite;
     187    BFHighlighter.LoopAttri.Foreground := clLightRed;
     188    BFHighlighter.PointerAttri.Foreground := clLightBlue;
     189    BFHighlighter.MemoryAttri.Foreground := clLightGreen;
     190  end else begin
     191    BFHighlighter.IoAttri.Foreground := clBlack;
     192    BFHighlighter.LoopAttri.Foreground := clRed;
     193    BFHighlighter.PointerAttri.Foreground := clBlue;
     194    BFHighlighter.MemoryAttri.Foreground := clGreen;
     195  end;
    166196end;
    167197
  • trunk/Languages/LazFuck.cs.po

    r96 r97  
    495495msgstr "ZdrojovÜ kód"
    496496
    497 #: tformsourcecode.menuitem1.caption
    498 msgctxt "tformsourcecode.menuitem1.caption"
    499 msgid "-"
    500 msgstr "-"
    501 
    502497#: tformtargetcode.aformatcode.caption
    503498msgid "Format code"
     
    748743msgid "Unsupported command"
    749744msgstr "NepodporovanÃœ příkaz"
     745
  • trunk/Languages/LazFuck.po

    r96 r97  
    450450msgstr ""
    451451
    452 #: tformsourcecode.menuitem1.caption
    453 msgctxt "TFORMSOURCECODE.MENUITEM1.CAPTION"
    454 msgid "-"
    455 msgstr ""
    456 
    457452#: tformtargetcode.aformatcode.caption
    458453msgid "Format code"
  • trunk/LazFuck.lpi

    r93 r97  
    9494      </Item6>
    9595    </RequiredPackages>
    96     <Units Count="26">
     96    <Units Count="27">
    9797      <Unit0>
    9898        <Filename Value="LazFuck.lpr"/>
     
    241241        <IsPartOfProject Value="True"/>
    242242      </Unit25>
     243      <Unit26>
     244        <Filename Value="UBFHighlighter.pas"/>
     245        <IsPartOfProject Value="True"/>
     246        <UnitName Value="UBFHighlighter"/>
     247      </Unit26>
    243248    </Units>
    244249  </ProjectOptions>
Note: See TracChangeset for help on using the changeset viewer.