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

📄 rm_hilit.pas

📁 report machine 2.3 功能强大
💻 PAS
字号:

{*****************************************}
{                                         }
{         Report Machine v2.0             }
{       Highlight attributes dialog       }
{                                         }
{*****************************************}

unit RM_hilit;

interface

{$I RM.inc}

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons, RM_Const, ExtCtrls, RM_common;

type
  TRMHilightForm = class(TForm)
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    chkFontBold: TCheckBox;
    chkFontItalic: TCheckBox;
    chkFontUnderline: TCheckBox;
    btnOK: TButton;
    btnCancel: TButton;
    RB1: TRadioButton;
    RB2: TRadioButton;
    GroupBox3: TGroupBox;
    Edit1: TEdit;
    btnExpr: TSpeedButton;
    procedure RB1Click(Sender: TObject);
    procedure btnExprClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    FBtnFontColor: TRMColorPickerButton;
    FBtnBackColor: TRMColorPickerButton;
    procedure OnColorChangeEvent(Sender: TObject);
    procedure Localize;
  public
    { Public declarations }
    FontColor, FillColor: TColor;
  end;

implementation

uses RM_Class, RM_Utils, RM_DlgExpr;

{$R *.DFM}

procedure TRMHilightForm.Localize;
begin
	Font.Name := RMLoadStr(SRMDefaultFontName);
  Font.Size := StrToInt(RMLoadStr(SRMDefaultFontSize));
  Font.Charset := StrToInt(RMLoadStr(SCharset));

  Caption := RMLoadStr(rmRes + 520);
  GroupBox3.Caption := RMLoadStr(rmRes + 521);
  GroupBox1.Caption := RMLoadStr(rmRes + 522);
  chkFontBold.Caption := RMLoadStr(rmRes + 524);
  chkFontItalic.Caption := RMLoadStr(rmRes + 525);
  chkFontUnderline.Caption := RMLoadStr(rmRes + 526);
  GroupBox2.Caption := RMLoadStr(rmRes + 527);
  RB1.Caption := RMLoadStr(rmRes + 529);
  RB2.Caption := RMLoadStr(rmRes + 530);
  btnExpr.Hint := RMLoadStr(rmRes + 061);
  btnOK.Caption := RMLoadStr(SOk);
  btnCancel.Caption := RMLoadStr(SCancel);
end;

procedure TRMHilightForm.FormShow(Sender: TObject);
begin
	FBtnFontColor.CurrentColor := FontColor;
  FBtnBackColor.CurrentColor := FillColor;
  if FillColor = clNone then
    RB1.Checked := True
  else
    RB2.Checked := True;
  RB1Click(nil);
end;

procedure TRMHilightForm.RB1Click(Sender: TObject);
begin
  FBtnBackColor.Enabled := RB2.Checked;
  if RB1.Checked then FillColor := clNone;
end;

procedure TRMHilightForm.btnExprClick(Sender: TObject);
var
  expr: string;
begin
  expr := '';
  if RM_DlgExpr.RMGetExpression('', expr, nil) then
  begin
		if expr <> '' then
    	Edit1.Text := expr;
  end;
end;

procedure TRMHilightForm.FormCreate(Sender: TObject);
begin
	Localize;
	FBtnFontColor := TRMColorPickerButton.Create(Self);
  with FBtnFontColor do
  begin
		Parent := GroupBox1;
    Flat := False;
		SetBounds(122, 48, 110, 25);
    Caption := RMLoadStr(rmRes + 523);
    ColorType := rmptFont;
    OnColorChange := OnColorChangeEvent;
  end;
	FBtnBackColor := TRMColorPickerButton.Create(Self);
  with FBtnBackColor do
  begin
		Parent := GroupBox2;
    Flat := False;
		SetBounds(122, 32, 110, 25);
    Caption := RMLoadStr(rmRes + 528);
    ColorType := rmptHighlight;
    OnColorChange := OnColorChangeEvent;
  end;
end;

procedure TRMHilightForm.OnColorChangeEvent(Sender: TObject);
begin
	if Sender = FBtnFontColor then
  	FontColor := FBtnFontColor.CurrentColor
  else
    FillColor := FBtnBackColor.CurrentColor;
end;

end.

⌨️ 快捷键说明

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