I know how to get a reference to the Data Tree window. Once I have that reference I need to know how to select the Fields radio button on the Layout tab in code
I was able to use the CreateFields and CreateLabels properties of the TppDataTreeWindow class to select these radio buttons in code. Here is the code I used.
uses ppDsgner, ppToolWn, ppIDE;
procedure TForm1.ppDesigner1Show(Sender: TObject); var liIndex: Integer; lToolBarManager: TppToolBarManager; lToolWindow: TppDataTreeWindow; begin
for liIndex := 0 to lToolBarManager.ToolbarCount - 1 do begin if lToolBarManager.Toolbars[liIndex] is TppDataTreeWindow then lToolWindow := TppDataTreeWindow(lToolBarManager.Toolbars[liIndex]); end;
if lToolWindow <> nil then begin lToolWindow.CreateFields := True; lToolWindow.CreateLabels := False; end;
Comments
I was able to use the CreateFields and CreateLabels properties of the
TppDataTreeWindow class to select these radio buttons in code. Here is the
code I used.
uses
ppDsgner,
ppToolWn,
ppIDE;
procedure TForm1.ppDesigner1Show(Sender: TObject);
var
liIndex: Integer;
lToolBarManager: TppToolBarManager;
lToolWindow: TppDataTreeWindow;
begin
lToolBarManager := TppDesignerWindow(ppDesigner1.Form).ToolbarManager;
lToolWindow := nil;
for liIndex := 0 to lToolBarManager.ToolbarCount - 1 do
begin
if lToolBarManager.Toolbars[liIndex] is TppDataTreeWindow then
lToolWindow := TppDataTreeWindow(lToolBarManager.Toolbars[liIndex]);
end;
if lToolWindow <> nil then
begin
lToolWindow.CreateFields := True;
lToolWindow.CreateLabels := False;
end;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com