⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fjveditortest.dfm

📁 jvcl driver development envionment
💻 DFM
📖 第 1 页 / 共 5 页
字号:
          '    i, j : integer;'
          '    Sym : set of char;'
          '  begin'
          '    Result := false;'
          
            '    if (Length(St) = 0) or ((Length(St) = 1) and (St[1]='#39'$'#39')) th' +
            'en exit;'
          '    Sym := StConstSymbols10;'
          '    if (St[1] = '#39'-'#39') or (St[1] = '#39'$'#39') then begin'
          '      if Length(St) = 1 then exit'
          '      else j := 2;'
          '      if St[1] = '#39'$'#39' then Sym := StConstSymbols;'
          '    end else j := 1;'
          '    for i := j to Length(St) do'
          '      if not (St[i] in Sym) then exit;'
          '    Result := true;'
          '  end;'
          ''
          'var'
          '  F : boolean;'
          '  L : integer;'
          '  FC : TColor;'
          '  FS : TFontStyles;'
          'begin'
          '  Parser.pcProgram := PChar(Line);'
          '  Parser.pcPos := Parser.pcProgram;'
          '  L := Sender.Tag;'
          '  if (L = 1) and (Length(Line) > 0) and (Line[1] = '#39'#'#39') then'
          '  begin'
          '    FC := clGreen;'
          '    FS := Sender.Font.Style;'
          '  end else'
          '  begin'
          '    FC := clOlive; {'#228#235#255' '#239#240#232#236#229#247#224#237#232#233'}'
          '    FS := [fsItalic];'
          '  end;'
          '  Attrs[1].FC := FC;'
          '  Attrs[1].Style := FS;'
          '  Attrs[1].BC := Sender.Color;'
          '  for i := 1 to 100 do'
          '     Move(Attrs[1], Attrs[i], sizeof(Attrs[1]));'
          
            '  if (L = 1) and (Length(Line) > 0) and (Line[1] = '#39'#'#39') then exi' +
            't;'
          '  try'
          '    Token := Parser.Token;'
          '    while Token <> '#39#39' do begin'
          '      F := true;'
          '      case L of'
          
            '        0 : if IsDelphiKeyWord(Token) then SetColor(clBlack, Sen' +
            'der.Color, [fsBold]) else F := false;'
          
            '        1 : if IsBuilderKeyWord(Token) then SetColor(clBlack, Se' +
            'nder.Color, [fsBold]) else F := false;'
          
            '        2 : if IsSQLKeyWord(Token) then SetColor(clBlack, Sender' +
            '.Color, [fsBold]) else F := false;'
          '        else F := false;'
          '      end;'
          '      if F then {Ok}'
          '      else if (Length(Token) = 1) and (Token[1] in Symbols) then'
          '        SetColor(clBlue, Sender.Color, [])'
          '      else if IsIntConstant(Token) or IsRealConstant(Token) then'
          '        SetColor(clNavy, Sender.Color, [])'
          '      else if IsStringConstant(Token) then'
          '        SetColor(clPurple, Sender.Color, [])'
          '      else'
          '        SetColor(clBlack, Sender.Color, []);'
          '      Token := Parser.Token;'
          '    end;'
          '  except'
          ''
          '  end;'
          'end;'
          ''
          'procedure TJvEditor .FormCreate(Sender: TObject);'
          'begin'
          '  Parser := TJvIParser.Create;'
          'end;'
          ''
          'procedure TJvEditor .FormDestroy(Sender: TObject);'
          'begin'
          '  Parser.Free;'
          'end;'
          ''
          
            'procedure TJvEditor .RAEditorPaintGutter(Sender: TJvEditor; Canv' +
            'as: TCanvas);'
          '  procedure Draw(Y, ImageIndex : integer);'
          '  var'
          '    Ro : integer;'
          '    R : TRect;'
          '  begin'
          '    if Y <> -1 then'
          '      with Sender do begin'
          '        Ro := Y - TopRow;'
          '        R := CalcCellRect(0, Ro);'
          '        GutterImages.Draw(Canvas,'
          
            '          GutterWidth -GutterRightMargin -GutterImages.Width{R.L' +
            'eft},'
          
            '          R.Top + (CellRect.Height - GutterImages.Height) div 2 ' +
            '+1,'
          '          ImageIndex);'
          '      end;'
          '  end;'
          'var'
          '  i  : integer;'
          'begin'
          '  for i := 0 to 9 do'
          '    if Sender.BookmarksSet[i] then'
          '      Draw(Sender.Bookmarks[i].Y, i);'
          'end;'
          ''
          'procedure TJvEditor .PageControl1Change(Sender: TObject);'
          'begin'
          
            '  Parser.Style := TIParserStyle(not(PageControl1.ActivePage.Page' +
            'Index=0));'
          '  JvEditor.Refresh;'
          '  RAEditor1.Refresh;'
          '  RAEditor2.Refresh;'
          '  RAEditor3.Refresh;'
          'end;'
          ''
          'procedure TJvEditor .PageControl1Enter(Sender: TObject);'
          'begin'
          '  (PageControl1.ActivePage.Controls[0] as TWinControl).SetFocus;'
          'end;'
          ''
          
            'procedure TJvEditor .RAEditorCompletionDrawItem(Control: TWinCon' +
            'trol;'
          '  Index: Integer; Rect: TRect; State: TOwnerDrawState);'
          'var'
          '  Offset, W : Integer;'
          '  S : string;'
          '  ImageIndex : integer;'
          'begin'
          '  Offset := 3;'
          
            '  with Control as TListBox, (Control.Owner as TJvEditor).Complet' +
            'ion do'
          '  begin'
          '    Canvas.FillRect(Rect);'
          '    case Mode of'
          '      cmIdentifers :'
          '        begin'
          
            '          ImageIndex := StrToInt(Trim(SubStr(Items[Index], 2, '#39'^' +
            #39'))) - 1;'
          
            '          ilCompletions.Draw(Canvas, Rect.Left + 2, Rect.Top, Im' +
            'ageIndex);'
          
            '          Canvas.TextOut(Rect.Left + 3*Offset + ilCompletions.Wi' +
            'dth, Rect.Top +2, SubStr(Items[Index], 0, '#39'^'#39'));'
          '          S := Trim(SubStr(Items[Index], 1, '#39'^'#39'));'
          '          W := Canvas.TextWidth(S);'
          
            '          Canvas.TextOut(Rect.Right - 2*Offset - W, Rect.Top +2,' +
            ' S);'
          '        end;'
          '      cmTemplates :'
          '        begin'
          
            '          Canvas.TextOut(Rect.Left + Offset, Rect.Top +2, SubStr' +
            '(Items[Index], 1, '#39'^'#39'));'
          '          Canvas.Font.Style := [fsBold];'
          '          S := SubStr(Items[Index], 0, '#39'^'#39');'
          '          W := Canvas.TextWidth(S);'
          
            '          Canvas.TextOut(Rect.Right - 2*Offset - W, Rect.Top +2,' +
            ' S);'
          '        end;'
          '    end;'
          '  end;  '
          'end;'
          ''
          'end.')
        GutterWidth = 30
        RightMarginVisible = False
        RightMargin = 0
        RightMarginColor = clSilver
        Completion.Enabled = True
        Completion.ItemHeight = 16
        Completion.Interval = 800
        Completion.ListBoxStyle = lbOwnerDrawFixed
        Completion.Templates.Strings = (
          'arrayd==array declaration (var)==array[0..|] of ;'
          'arrayc==array declaration (const)==array[0..|] of = ();'
          'cases==case statement==case | of/n  : ;/n  : ;/nend;/n'
          
            'casee==case statement (with else)==case | of/n  : ;/n  : ;/nelse' +
            ' ;/nend;/n'
          
            'classf==class declaration (all parts)==T| = class(T)/nprivate/n/' +
            'nprotected/n/npublic/n/npublished/n/nend;/n'
          'classd==class declaration (no parts)==T| = class(T)/n/nend;/n'
          
            'classc==class declaration (with Create/Destroy overrides)==T| = ' +
            'class(T)/nprivate/n/nprotected/n/npublic/n  constructor Create; ' +
            'override;/n  destructor Destroy; override;/npublished/n/nend;/n'
          'fors==for (no begin/end)==for | :=  to  do/n'
          'forb==for statement==for | :=  to  do/nbegin/n/nend;/n')
        Completion.CaretChar = '|'
        Completion.CRLF = '/n'
        Completion.Separator = '=='
        TabStops = '3 5'
        SmartTab = False
        BracketHighlighting.Active = True
        BracketHighlighting.WordPairs.Strings = (
          'begin=end'
          'repeat=until'
          'for=do'
          'if=then'
          'property=;'
          'record=end'
          'case=end'
          'array=of'
          'with=do'
          'try=except'
          'try=finally')
        SelForeColor = clHighlightText
        SelBackColor = clHighlight
        OnPaintGutter = RAEditorPaintGutter
        OnCompletionDrawItem = RAEditorCompletionDrawItem
        Align = alClient
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -13
        Font.Name = 'Courier New'
        Font.Style = []
        ParentColor = False
        ParentFont = False
        TabStop = True
        UseDockManager = False
        Colors.Comment.Style = [fsItalic]
        Colors.Comment.ForeColor = clOlive
        Colors.Comment.BackColor = clWindow
        Colors.Number.ForeColor = clNavy
        Colors.Number.BackColor = clWindow
        Colors.Strings.ForeColor = clPurple
        Colors.Strings.BackColor = clWindow
        Colors.Symbol.ForeColor = clBlue
        Colors.Symbol.BackColor = clWindow
        Colors.Reserved.Style = [fsBold]
        Colors.Reserved.ForeColor = clBlack
        Colors.Reserved.BackColor = clWindow
        Colors.Identifier.ForeColor = clBlack
        Colors.Identifier.BackColor = clWindow
        Colors.Preproc.ForeColor = clGreen
        Colors.Preproc.BackColor = clWindow
        Colors.FunctionCall.ForeColor = clWindowText
        Colors.FunctionCall.BackColor = clWindow
        Colors.Declaration.ForeColor = clWindowText
        Colors.Declaration.BackColor = clWindow
        Colors.Statement.Style = [fsBold]
        Colors.Statement.ForeColor = clWindowText
        Colors.Statement.BackColor = clWindow
        Colors.PlainText.ForeColor = clWindowText
        Colors.PlainText.BackColor = clWindow
      end
    end
    object TabSheet2: TTabSheet
      Caption = 'Builder'
      object RAEditor1: TJvHLEditor
        Tag = 1
        Left = 0
        Top = 0
        Width = 533
        Height = 318
        Cursor = crIBeam
        Lines.Strings = (
          
            '//--------------------------------------------------------------' +
            '-------------'
          '#include <vcl\vcl.h>'
          '#pragma hdrstop'
          ''
          '#include "eCaseDoc.h"'
          '#include "fDM.h"'
          '#include "Pickdate.h"'
          '#include "vscount.h"'
          '#include "varticle.h"'
          '#include "Russset.h"'
          '#include "vscriptc.h"'
          '#include "Clshow.h"'
          '#include "taskcfg.h"'
          '#include "fdmb.h"'
          '#include "Acond_b.h"'
          '#include "errex.h"'
          
            '//--------------------------------------------------------------' +
            '-------------'
          '#pragma link "Grids"'
          '#pragma resource "*.dfm"'
          'TEditCaseDoc *EditCaseDoc;'
          
            '//--------------------------------------------------------------' +
            '-------------'
          '__fastcall TEditCaseDoc::TEditCaseDoc(TComponent* Owner)'
          '  : TForm(Owner)'
          '{'
          '  NeedFilter = !DM->tSubCount->Filtered;'
          '  if (NeedFilter) {'
          '    DM->tSubCount->Filter="STAT <> '#39'm'#39'";'
          '    DM->tSubCount->Filtered = true;'
          '    DM->tSubCount->Refresh();'

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -