I have the following code and it seems to pass the IDE test but the compiler gives the following error
[dcc32 Error] TmsFlowChart.pas(436): E2010 Incompatible types: 'TVertAlign' and 'TcxAlignmentVert'
The code sample is
procedure TTmsCharts.DrawSelectedProperty1Click(Sender: TObject);
Var
sSelItm, sValue, sObj : String;
Diagram : tAtdiagram;
MyBlock: TCustomDiagramBlock;
{MyTxtAlign : TVertAlign;}
begin
Begin
sObj := ProdPropertiesF.cxDBLabel2.Caption;
sSelItm := ProdPropertiesF.cxDBLabel4.caption;
sValue := ProdPropertiesF.cxDBLabel5.caption;
showmessage('Item '+sSelItm+' Obj = '+sObj+' value= '+sValue);
if sSelItm <> '' then
begin
MyBlock := TFlowTerminalBlock.Create(atDiagram1.Owner);
with MyBlock do
begin
Left := 10;
Top := 10;
Width := 300;
height :=50;
Color := clMoneyGreen;
TextCells[0].text := 'Prop = '+sSelItm;
TextCells[0].Alignment := taLeftJustify;
TextCells[0].VertAlign := VaTop;
TextCells.Add();
TextCells[1].text := 'Value = '+sValue;
TextCells.Add();
TextCells[2].Text := 'Obj= '+sObj;
{TextCells[1].Clip := True;
TextCells[2].Clip := True;}
Diagram := atDiagram1;
end;
end
else
showmessage('You need to select a Node in the Properties list first');
end;
the eror line is
TextCells[0].VertAlign := VaTop;
Can someone from TMS please explain how I can get around this as we use both TMS and devexpress extensively
Hi all
Wagner Landgraf solved this for me with the following code
"the position of text cells is defined by their Left, Top, Width and Height properties (or BoundsRect), not by VertAlign. The latter just defines how the text aligns inside the text cell.
The bounds of text cells should be, by default, indicated as percent values of the block. So to have three text cells stacking on top of each other filling the full block area, you should do something like this:
TextCells[0].BoundsRect := Square(0, 0, 100, 33);
TextCells[1].BoundsRect := Square(0, 33, 100, 66);
TextCells[2].BoundsRect := Square(0, 66, 100, 100);