HELP margin and image insertion
Posted: Wed Nov 08, 2006 10:22 am
Hi there,
I am going to insert text on the left margin at specified row. I have searched the demo and find the following way to do that
procedure TForm1.RVStyle1DrawCheckpoint(Sender: TRVStyle; Canvas: TCanvas;
X, Y, ItemNo, XShift: Integer; RaiseEvent: Boolean; Control: TControl;
var DoDefault: Boolean);
begin
if RaiseEvent then
Canvas.Pen.Color := Sender.CheckpointEvColor
else
Canvas.Pen.Color := Sender.CheckpointColor;
Canvas.TextOut( ... );
DoDefault := False;
end;
However, in this case, the text is drawn as a graphics rather than a pure text. Any straightforward way to show text (a single letter in my case) in margin as a pure text?
By the way, I would like to show several imaged buttons on the richview (not richviewedit). I try to use richview.InsertControl to so do, but seems not ok. Would you please show me a piece of code to do
1) Insert an imaged button at current position in the content of richview and have a function to response button's click
2) Insert an imaged button at the RIGHT margin located at the same row of the current position and have a function to response button's click. In my case, more than one imaged-button is inserted at the margin space. Is it possible to have such buttons scoll when the richview is scrolled vertically?
Again, I found it is not allowed to clear RichView within MouseUp Event. Firstly, I add a table to the RichView and response to the MouseUp Event, if one click the specified row of the table then clear the RichView, including the table itself, and add something new to the richview???
Thanks in advance.
I am going to insert text on the left margin at specified row. I have searched the demo and find the following way to do that
procedure TForm1.RVStyle1DrawCheckpoint(Sender: TRVStyle; Canvas: TCanvas;
X, Y, ItemNo, XShift: Integer; RaiseEvent: Boolean; Control: TControl;
var DoDefault: Boolean);
begin
if RaiseEvent then
Canvas.Pen.Color := Sender.CheckpointEvColor
else
Canvas.Pen.Color := Sender.CheckpointColor;
Canvas.TextOut( ... );
DoDefault := False;
end;
However, in this case, the text is drawn as a graphics rather than a pure text. Any straightforward way to show text (a single letter in my case) in margin as a pure text?
By the way, I would like to show several imaged buttons on the richview (not richviewedit). I try to use richview.InsertControl to so do, but seems not ok. Would you please show me a piece of code to do
1) Insert an imaged button at current position in the content of richview and have a function to response button's click
2) Insert an imaged button at the RIGHT margin located at the same row of the current position and have a function to response button's click. In my case, more than one imaged-button is inserted at the margin space. Is it possible to have such buttons scoll when the richview is scrolled vertically?
Again, I found it is not allowed to clear RichView within MouseUp Event. Firstly, I add a table to the RichView and response to the MouseUp Event, if one click the specified row of the table then clear the RichView, including the table itself, and add something new to the richview???
Thanks in advance.