10359 : onDblClick Event in phSchema

Question

Hi,
how can I use the onDblClick Event in phSchema.
I would like to open a new window if i dblclick on an schematimeitem.

Answer

you can access the currently active SchemaTime (the latest clicked) with the ActiveDataEntity property:

  if Assigned(phSchema1.ActiveDataEntity) then
  begin
    phSchema1.RemoveSchemaTime(phSchema1.ActiveDataEntity);
  end;

Or you can use the info about clicked column and time:

var
  aphSchemaTime:TphDataEntity_SchemaTime;
begin
  if phSchema1.MouseDownColumn<>nil then
  begin
    aphSchemaTime:=phSchema1.AddSchemaTime(0);
    aphSchemaTime.Start:=phSchema1.MouseDownDateTime-1;
    aphSchemaTime.Stop:=phSchema1.MouseDownDateTime-1;
    aphSchemaTime.Col:=phSchema1.MouseDownColumn.ListIndex;
    aphSchemaTime.BackColor:=Random(65000);
  end;

 

Leave a Reply