I insert some fields by using 'InputMergeField' function to a document. I want to know if the user clicks on the fields. but the event 'OnTextObjectMouseDown' does not fire when user clicks between the begin position and end position of that field. when user clicks on the begin position or end position, this event works as expected. how to fire the 'OntextObjectMouseDown' event when user clicks between the begin and end?
procedure TWPRepTest.WPRichText1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var pobj: TWPTextObj;
par: TParagraph;
posinpar: Integer;
s : string;
begin
if Button = mbRight then
begin
pobj := WPRichText1.CodeInsideOf(x, y, wpobjMergeField, par, posinpar);
if pobj <> nil then
begin
s := pobj.Name;
if InputQuery('Field Properties', 'Name', s) then
pobj.Name := s;
end;
end;
end;
i want to make one menu item visible when right click on such a field, so i add code to 'OnTextObjMouseDown' Event, when i right click the field, sometimes the event fires but sometimes not. I think it is the same as another problem, that is when mouse move over the field, the cursor not always switch to a hand.
@littlegg:
i want to make one menu item visible when right click on such a field, so i add code to 'OnTextObjMouseDown' Event, when i right click the field, sometimes the event fires but sometimes not. I think it is the same as another problem, that is when mouse move over the field, the cursor not always switch to a hand.
From Version 5.20.5 the cursor positioning algorithm was slightly change to check for clicks on textobjects better. Itr does not use the margin it uese for regular characters. For regular characters this margin is required to make selection with the mouse and positioning of the cursor easier so [](http://www.wpcubed.com/forum/viewtopic.php?t=2074) is solved.
Julian
#7♥ 0
This category is archived. No new posts are possible.