Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS Smooth Controls Pack
Using the fill editor at runtime

For the TMS smooth controls series of components, a fill property is used that allows to set the fill characteristics of the various graphic elements in the controls. The controls come with a special fill edit dialog that is used at design time to allow the designer to customize fills for the components. This fill editor can be used at runtime as well. To do this, add the unit AdvSmoothFillEditor to the uses clause and add for example to edit the fill of a TAdvSmoothPanel on the form, following code:
procedure TForm2.Button1Click(Sender: TObject);
var
  fd: TAdvSmoothFillEditorDialog;
begin
  fd := TAdvSmoothFillEditorDialog.Create(self);

  try
    fd.Fill := AdvSmoothPanel1.Fill;

    if fd.Execute then
      AdvSmoothPanel1.Fill.Assign(fd.Fill);
  finally
    fd.Free;
  end;
end;
The code to execute the fill editor at runtime in C++ is:
TAdvSmoothFillEditorDialog* editor = new TAdvSmoothFillEditorDialog(this);
editor->Fill = AdvSmoothPanel1->Fill;
editor->Execute();