📄 icomponenteditorthemepanel.pas
字号:
FScheme2IsOverall := False;
FScheme3IsOverall := False;
FScheme4IsOverall := False;
FScheme5IsOverall := False;
FAutoAcceptPreview := False;
FAutoCenterLargeComponent := False;
FScheme1PropertyNames := TStringList.Create;
FScheme2PropertyNames := TStringList.Create;
FScheme3PropertyNames := TStringList.Create;
FScheme4PropertyNames := TStringList.Create;
FScheme5PropertyNames := TStringList.Create;
FScheme1TypeList := TStringList.Create;
FScheme2TypeList := TStringList.Create;
FScheme3TypeList := TStringList.Create;
FScheme4TypeList := TStringList.Create;
FScheme5TypeList := TStringList.Create;
//==============================================
//Preview
//==============================================
FPreviewGroupBox := TiComponentEditorGroupBox.Create(Self);
with FPreviewGroupBox do
begin
Parent := Self;
Caption := 'Preview';
OnMouseUp := OpenMaintenance;
end;
FPreviewScrollBox := TScrollBox.Create(Self);
with FPreviewScrollBox do
begin
Parent := FPreviewGroupBox;
BorderStyle := bsNone;
Left := 5;
Top := 5;
OnResize := ScrollBoxResize;
end;
FPreviewErrorLabel1 := TLabel.Create(Self);
with FPreviewErrorLabel1 do
begin
Parent := FPreviewScrollBox;
Caption := 'Themes Not Installed.';
Alignment := taCenter;
Font.Style := [fsBold];
end;
FPreviewErrorLabel2 := TLabel.Create(Self);
with FPreviewErrorLabel2 do
begin
Parent := FPreviewScrollBox;
Caption := 'Themes are Disabled.';
Alignment := taCenter;
Font.Style := [fsBold];
end;
//==============================================
//Legend & Accept Preview Button
//==============================================
FLegendLabel := TLabel.Create(Self);
with FLegendLabel do
begin
Parent := Self;
AutoSize := True;
Caption := 'Legend';
Font.Style := [fsUnderline];
end;
FPreDefinedShape := TShape.Create(Self);
With FPreDefinedShape do
begin
Parent := Self;
Brush.Color := clRed;
Pen.Color := clBlack;
end;
FUserDefinedShape := TShape.Create(Self);
With FUserDefinedShape do
begin
Parent := Self;
Brush.Color := clBlue;
Pen.Color := clBlack;
end;
FPreDefinedLabel := TLabel.Create(Self);
with FPreDefinedLabel do
begin
Parent := Self;
AutoSize := True;
Caption := 'Pre-Defined (Fixed)';
end;
FUserDefinedLabel := TLabel.Create(Self);
with FUserDefinedLabel do
begin
Parent := Self;
AutoSize := True;
Caption := 'User Defined';
end;
FAcceptPreviewButton := TiComponentEditorButton.Create(Self);
with FAcceptPreviewButton do
begin
Parent := Self;
Caption := '&Accept Preview';
Width := 99;
OnClick := AcceptPreviewButtonClick;
Enabled := False;
end;
//==============================================
//Scheme 1
//==============================================
FScheme1Combo := TiThemeComboBox.Create(Self);
with FScheme1Combo do
begin
Parent := Self;
Width := SchemeComboWidth;
Style := csOwnerDrawFixed;
OnChange := Scheme1ComboChange;
OnDropDown := Scheme1ComboDropDown;
//KYLIX TODO
{$ifndef LINUX}
OnDrawItem := ComboBoxDrawItem;
{$endif}
DropDownCount := 12;
end;
FScheme1ComboLabel := TLabel.Create(Self);
with FScheme1ComboLabel do
begin
Parent := Self;
AutoSize := True;
Caption := FScheme1Title + ':';
end;
FScheme1AddButton := TiComponentEditorButton.Create(Self);
with FScheme1AddButton do
begin
Parent := Self;
Caption := '+';
Font.Size := 12;
Font.Style := [fsBold];
Height := 19;
Width := 21;
OnClick := Scheme1AddButtonClick;
end;
FScheme1DeleteButton := TiComponentEditorButton.Create(Self);
with FScheme1DeleteButton do
begin
Parent := Self;
Caption := '-';
Font.Size := 12;
Font.Style := [fsBold];
Height := 19;
Width := 21;
OnClick := Scheme1DeleteButtonClick;
Enabled := False;
end;
//==============================================
//Scheme 2
//==============================================
FScheme2Combo := TiThemeComboBox.Create(Self);
with FScheme2Combo do
begin
Parent := Self;
Width := FScheme1Combo.Width;
Style := csOwnerDrawFixed;
OnChange := Scheme2ComboChange;
OnDropDown := Scheme2ComboDropDown;
//KYLIX TODO
{$ifndef LINUX}
OnDrawItem := ComboBoxDrawItem;
{$endif}
DropDownCount := 12;
end;
FScheme2ComboLabel := TLabel.Create(Self);
with FScheme2ComboLabel do
begin
Parent := Self;
AutoSize := True;
Caption := FScheme2Title + ':';
end;
FScheme2AddButton := TiComponentEditorButton.Create(Self);
with FScheme2AddButton do
begin
Parent := Self;
Caption := '+';
Font.Size := 12;
Font.Style := [fsBold];
Height := FScheme1AddButton.Height;
Width := FScheme1AddButton.Width;
OnClick := Scheme2AddButtonClick;
end;
FScheme2DeleteButton := TiComponentEditorButton.Create(Self);
with FScheme2DeleteButton do
begin
Parent := Self;
Caption := '-';
Font.Size := 12;
Font.Style := [fsBold];
Height := FScheme1DeleteButton.Height;
Width := FScheme1DeleteButton.Width;
Enabled := False;
OnClick := Scheme2DeleteButtonClick;
end;
//==============================================
//Scheme 3
//==============================================
FScheme3Combo := TiThemeComboBox.Create(Self);
with FScheme3Combo do
begin
Parent := Self;
Width := FScheme1Combo.Width;
Style := csOwnerDrawFixed;
OnChange := Scheme3ComboChange;
OnDropDown := Scheme3ComboDropDown;
//KYLIX TODO
{$ifndef LINUX}
OnDrawItem := ComboBoxDrawItem;
{$endif}
DropDownCount := 12;
end;
FScheme3ComboLabel := TLabel.Create(Self);
with FScheme3ComboLabel do
begin
Parent := Self;
AutoSize := True;
Caption := FScheme3Title + ':';
end;
FScheme3AddButton := TiComponentEditorButton.Create(Self);
with FScheme3AddButton do
begin
Parent := Self;
Caption := '+';
Font.Size := 12;
Font.Style := [fsBold];
Height := FScheme1AddButton.Height;
Width := FScheme1AddButton.Width;
OnClick := Scheme3AddButtonClick;
end;
FScheme3DeleteButton := TiComponentEditorButton.Create(Self);
with FScheme3DeleteButton do
begin
Parent := Self;
Caption := '-';
Font.Size := 12;
Font.Style := [fsBold];
Height := FScheme1DeleteButton.Height;
Width := FScheme1DeleteButton.Width;
Enabled := False;
OnClick := Scheme3DeleteButtonClick;
end;
//==============================================
//Scheme 4
//==============================================
FScheme4Combo := TiThemeComboBox.Create(Self);
with FScheme4Combo do
begin
Parent := Self;
Width := FScheme1Combo.Width;
Style := csOwnerDrawFixed;
OnChange := Scheme4ComboChange;
OnDropDown := Scheme4ComboDropDown;
//KYLIX TODO
{$ifndef LINUX}
OnDrawItem := ComboBoxDrawItem;
{$endif}
DropDownCount := 12;
end;
FScheme4ComboLabel := TLabel.Create(Self);
with FScheme4ComboLabel do
begin
Parent := Self;
AutoSize := True;
Caption := FScheme4Title + ':';
end;
FScheme4AddButton := TiComponentEditorButton.Create(Self);
with FScheme4AddButton do
begin
Parent := Self;
Caption := '+';
Font.Size := 12;
Font.Style := [fsBold];
Height := FScheme1AddButton.Height;
Width := FScheme1AddButton.Width;
OnClick := Scheme4AddButtonClick;
end;
FScheme4DeleteButton := TiComponentEditorButton.Create(Self);
with FScheme4DeleteButton do
begin
Parent := Self;
Caption := '-';
Font.Size := 12;
Font.Style := [fsBold];
Height := FScheme1DeleteButton.Height;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -