Page 1 of 1

rvActionInsertTable1.ShowTableSizeDialog working with TdxBar

Posted: Wed Dec 30, 2009 1:16 pm
by peter_brooks
Hello,

I am trying to use rvActionInsertTable1.ShowTableSizeDialog with TdxBarLargeButton (from Developer Express ExpressBars). ShowTableSizeDialog method is overloaded with TControl and TRect. Neither of them is available to TdxBarLargeButton. How can I implement this? Please help.

Posted: Wed Dec 30, 2009 2:55 pm
by Stefaan
In C++ :

Code: Select all

void __fastcall TfrmEditor::btnInsertTableClick(TObject *Sender)
{
	TdxBarItemLink* itemLink = ((TdxBarItem*) Sender)->ClickItemLink;
	Types::TRect rect = itemLink->ItemRect;
	TPoint leftTop(rect.Left, rect.Top);
	TPoint rightBottom(rect.Right, rect.Bottom);
	leftTop = itemLink->BarControl->ClientToScreen(leftTop);
	rightBottom = itemLink->BarControl->ClientToScreen(rightBottom);
	rvActionInsertTable1->ShowTableSizeDialog(rvEditor->RichViewEdit, Types::TRect(leftTop, rightBottom));
}

Posted: Wed Dec 30, 2009 3:12 pm
by peter_brooks
BTW, I am using Delphi. Can you please define it as Delphi Code.

Posted: Wed Dec 30, 2009 3:23 pm
by Stefaan
Delphi code untested:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  itemLink: TdxBarItemLink;
  rect: TRect;
  leftTop, rightBottom: TPoint;
begin
  itemLink := TdxBarItem(Sender).ClickItemLink;
  rect := itemLink.ItemRect;
  leftTop := Point(rect.Left, rect.Top);
  rightBottom := Point(rect.Right, rect.Bottom);
  leftTop := itemLink.BarControl.ClientToScreen(leftTop);
  rightBottom := itemLink.BarControl.ClientToScreen(rightBottom);
  rvActionInsertTable1.ShowTableSizeDialog(rvEditor.RichViewEdit, Rect(leftTop, rightBottom));
end;