rvActionInsertTable1.ShowTableSizeDialog working with TdxBar

General TRichView support forum. Please post your questions here
Post Reply
peter_brooks
Posts: 6
Joined: Mon Sep 05, 2005 3:33 pm

rvActionInsertTable1.ShowTableSizeDialog working with TdxBar

Post 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.
Stefaan
Posts: 30
Joined: Mon Feb 16, 2009 11:36 am

Post 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));
}
peter_brooks
Posts: 6
Joined: Mon Sep 05, 2005 3:33 pm

Post by peter_brooks »

BTW, I am using Delphi. Can you please define it as Delphi Code.
Stefaan
Posts: 30
Joined: Mon Feb 16, 2009 11:36 am

Post 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;
Post Reply