trichview.support
Re: Exporting Component to HTML |
Author |
Message |
Sergey Tkachenko |
Posted: 04/07/2003 11:28:23 The function below searches for the control location. using: procedure TForm1.rvSaveComponentToFile( Sender: TCustomRichView; Path: String; SaveMe: TPersistent; SaveFormat: TRVSaveFormat; var OutStr:String); var RVData: TCustomRVData; ItemNo: Integer; ... begin FindControlLocation(Sender.RVData, TControl(SaveMe), RVData, ItemNo); RVData.GetControlInfo(ItemNo, ...); ... end; function FindControlLocation(RVData: TCustomRVData; Ctrl: TControl; var CtrlRVData: TCustomRVData; var CtrlItemNo: Integer): Boolean; var i,r,c: Integer; table: TRVTableItemInfo; begin Result := False; for i := 0 to RVData.Items.Count-1 do begin if (RVData.GetItemStyle(i)=rvsComponent) and (TRVControlItemInfo(RVData.GetItem(i)).Control=Ctrl) then begin CtrlItemNo := i; CtrlRVData := RVData; exit; end; if (RVData.GetItemStyle(i)=rvsTable) then begin table := TRVTableItemInfo(RVData.GetItem(i)); for r := 0 to table.Rows.Count-1 do for c := 0 to table.Rows[r].Count-1 do if (table.Cells[r,c]<>nil) then begin Result := FindControlLocation(table.Cells[r,c].GetRVData, Ctrl, CtrlRVData, CtrlItemNo); if Result then exit; end; end; end; end; > > Hi, > > I'm using OnSaveComponentToFile to export a component to HTML. When the RichViewEdit > contains more than than one component how do I identify which component has > been passed to this event? > > I would like to use GetControlInfo to get some information about the component, > but how do I identify the ItemNo in this event? > > Thanks > |
Powered by ABC Amber Outlook Express Converter