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

📄 keywordframe.pas

📁 一个可以把源代码以语法高亮的形式转换成HTML格式或RTF格式。
💻 PAS
字号:
unit KeyWordFrame;

{*******************************************
 * brief: 关键字的模板
 * autor: linzhenqun
 * date: 2005-11-01
 * email: linzhengqun@163.com
 * blog: http://blog.csdn.net/linzhengqun
 * 
********************************************}

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, FontFrame;

type
  TFrameKeyWord = class(TFrame)
    GroupBox1: TGroupBox;
    KWFontFrame: TFrameFont;
    GroupBox2: TGroupBox;
    KeyWords: TMemo;
    procedure KeyWordsKeyPress(Sender: TObject; var Key: Char);
    procedure KeyWordsChange(Sender: TObject);
  private
    { Private declarations }
  public
    constructor Create(AOwner: TComponent); override;
    { Public declarations }
    procedure getLangRes;
  end;

implementation
uses
  CommonUtils ;//, gnugettext;
{$R *.dfm}


procedure TFrameKeyWord.getLangRes;
begin
  GroupBox1.Caption := pubGet(306);
  //GroupBox2.Caption := pubGet(400);
  KeyWords.Hint := pubGet(505); 
end;

constructor TFrameKeyWord.Create(AOwner: TComponent);
begin
  inherited;
  //ToDo: ranslateComponent(self);  多语言支持
  getLangRes;
end;

procedure TFrameKeyWord.KeyWordsKeyPress(Sender: TObject; var Key: Char);
begin
  //  if IsSymbol(Key) or (Key = #32) then
  //    Key := #0;
  // 开头文字只能是字母与下划线
  if (TCustomMemo(KeyWords).CaretPos.X=0) and 
       (Not (Key in ['A'..'Z','a'..'z','_',#13])) then  
    Key :=#0;    
end;

procedure TFrameKeyWord.KeyWordsChange(Sender: TObject);
begin                  //'关键字列表'
  GroupBox2.Caption := pubGet(400) +'('+IntToStr(KeyWords.Lines.Count)+')';  
end;

end.

⌨️ 快捷键说明

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