Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

RXRichEdit problem

Posted on 2000-05-12
3
449 Views
Last Modified: 2008-03-10
I am using the RxRichEdit control. Everything works fine except that if the control is read only, the OLE object can still be activated or edited. What can be the problem and what callback I should change so that it can't be activated or edited or context menu produced on it?
0
Comment
Question by:skanade
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
rene100 earned 100 total points
ID: 2806720
Hi

Change the following lines:

procedure TRxCustomRichEdit.PopupVerbClick(Sender: TObject);
var
  ReObject: TReObject;
begin
  if (Assigned(FRichEditOle)) and (ReadOnly=false) then begin
    FillChar(ReObject, SizeOf(ReObject), 0);
    ReObject.cbStruct := SizeOf(ReObject);

(add the (ReadOnly=false))

hope this helps

regards
rene
0
 

Author Comment

by:skanade
ID: 2807139
Taking hint from your code, I was also able to remove the popup menu. But, the object can still be selected, resized and opened for editing with double-click. How to disable that in read only mode?

Thanks.
0
 
LVL 2

Expert Comment

by:rene100
ID: 2807509
i think open/edit can be prevented by add/change the following lines:

procedure TRxCustomRichEdit.WMRButtonUp(var Message: TWMLButtonUP);
begin
if (stObject in SelectionType) and (ReadOnly=True) then
    Message.Msg:=0;
inherited;
end;

procedure TRxCustomRichEdit.WMLButtonDblClk(var Message: TWMLButtonDblClk);
begin
if (stObject in SelectionType) and (ReadOnly=True) then
    Message.Msg:=0;
inherited;
end;

but it's still possible to resize&select the object....

rene
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question