var
MyColor:TColor;
MyColor :=$00C4A4;
with Font do
begin
Name:='Segoe UI';
Size:=11;
Color: = MyColor;
end;
Declare a variable of TColor and then in all the text and labels use that variable:
Код:var MyColor:TColor;
Код:MyColor :=$00C4A4;
Код:with Font do begin Name:='Segoe UI'; Size:=11; Color: = MyColor; end;
Может так.
Код:#define MyColor "$00C4A4" // потом в коде with Font do begin Name:='Segoe UI'; Size:=11; Color:={#MyColor}; end;
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
[Code]
var
NewSpeedButton1: TNewSpeedButton;
procedure InitializeWizard();
begin
NewSpeedButton1 := TNewSpeedButton.Create(WizardForm);
with NewSpeedButton1 do
begin
Parent := WizardForm;
Left := ScaleX(152);
Top := ScaleY(327);
Width := ScaleX(80);
Height := ScaleY(23);
Caption := '3453434';
Font.Color := clRed;
Font.Height := -11;
Font.Name := 'Tahoma';
Font.Style := [];
ParentFont := False;
end;
end;
А что-то подобное есть для TNewCheckBox и TNewRadioButton ?
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
[Code]
var
CheckBox: TNewCheckBox;
CheckBoxLbl: TLabel;
procedure CheckBoxClick( Sender: TObject );
begin
if CheckBox.Checked = True then
CheckBox.Checked := False else
CheckBox.Checked := True;
end;
procedure RedesignWizardForm;
begin
///////////////////////////////////
WizardForm.WelcomeLabel2.Height := WizardForm.WelcomeLabel2.Height - 60;
///////////////////////////////////
CheckBox := TNewCheckBox.Create(WizardForm);
CheckBox.SetBounds(ScaleX(232), ScaleY(256), ScaleX(18), ScaleY(18));
CheckBox.Parent := WizardForm.WelcomePage;
CheckBoxLbl := TLabel.Create(WizardForm);
CheckBoxLbl.Parent := WizardForm.WelcomePage;
CheckBoxLbl.SetBounds(ScaleX(250), ScaleY(257), ScaleX(160), ScaleY(19));
CheckBoxLbl.Caption := 'Текст для чекбокса';
CheckBoxLbl.Font.Color := clGreen;
CheckBoxLbl.OnClick := @CheckBoxClick;
CheckBoxlbl.OnDblClick := @CheckBoxClick;
end;
procedure InitializeWizard();
begin
RedesignWizardForm;
end;
Как ГЛОБАЛЬНО поменять цвет шрифта
[Setup]
AppName=App
AppverName=App v1.0
DefaultDirName={pf}\App
OutputDir=.
[Code]
Procedure InitializeWizard();
begin
WizardForm.Font.Color:=clGreen;
WizardForm.WelcomeLabel1.Font.Color := clGreen;
WizardForm.NextButton.Font.Color := clGreen;
WizardForm.CancelButton.Font.Color := clGreen;
WizardForm.BackButton.Font.Color := clGreen;
WizardForm.PageNameLabel.Font.color := clGreen;
WizardForm.DirBrowseButton.Font.Color := clgreen;
//и так далее
end;
var
CheckListBox: TNewCheckListBox;
BTN: TBitmapImage;
function CheckListBoxChecked(int: integer): boolean;
begin
if (int >= 0) and (int < CheckListBox.ItemCount) then
Result:= CheckListBox.Checked[int]
else
Result:= false;
end;
procedure ListBoxClick(Sender: TObject);
begin
if CheckListBox.Checked[0] then
CheckListBox.Font.Color := $2222b2 else CheckListBox.Font.Color := clBlack;
end;
procedure InitializeWizard;
begin
BTN := TBitmapImage.Create(WizardForm);
BTN.Bitmap.LoadFromResourceName(HInstance, '_IS_BTN');
CheckListBox := TNewCheckListBox.Create(WizardForm);
with CheckListBox do begin
Parent := WizardForm.SelectDirPage;
SetBounds(ScaleX(0), ScaleY(130), ScaleX(200), ScaleY(20));
AddCheckBoxEx('Создать ярлык на рабочем столе', '', 0, True, True, True, True, nil, True);
WantTabs := True;
ShowLines := True;
Font.Color := $2222b2;
Color := WizardForm.Color;
BorderStyle := bsNone;
OnClickCheck := @ListBoxClick;
LoadBtnBmpFromBitmap(BTN.Bitmap);
end;
end;