The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



SuppressPaint


Unit:SDL_chemgrph
Class:TChemGraph
Declaration:property SuppressPaint: boolean;

Changing any element of the structure will trigger the repaint process. This considerably slows down the application when changing any elements programmatically. It is therefore recommended to temporarily switch off repainting when more than one item is changed programmatically.

The example below shows how to deal with such situations. The colors of all atoms of the structure CG1 are changed to clNavy after switching off the repaint mechanism. When completed the repainting is enabled again (enabling the repainting automatically refreshes the structure display).

Example: How to temporarily switch off the repaint mechanism.
var
  i : longint;

begin
CG1.SuppressPaint := true;
for i:=1 to CG1.Structure.NAtoms do
  CG1.Structure.AtColor[i] := clNavy';
CG1.SuppressPaint := false;
end;


Last Update: 2023-Dec-14