ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Popup Cut/Copy/Paste menu while editing text.
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

suriyont

USA
18 Posts

Posted - Feb 25 2016 :  12:49:51  Show Profile  Reply
Is there a way to popup a menu which allows user to cut/copy/paste text like windows text editor while in text editor mode?

Thanks,

Suri M.

w2m

USA
1990 Posts

Posted - Feb 25 2016 :  13:25:49  Show Profile  Reply
I created a new project to test the popupmenu. I added a panel with two buttons and aligned the panel to alTop. I added a ImageEnVect and set its alignment to alClient. I added this code:
procedure TForm1.Select1Click(Sender: TObject);
begin
  ImageEnVect1.MouseInteractVt := [miObjectSelect];
end;

procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
  ImageEnVect1.MouseInteractVt := [miPutText];
end;

With this very simple demo, the popupmenu to achieve cut, copy or paste is built in. Just add a text object and enter edit mode by double clicking the text object and then right click and a built in popupmenu will appear to provide these features automatically with no other code. The project uses default ImageEnVect properties and no other code was added to the demo. In addition the vectorial demo also does the same thing, so you must be overriding the popup menu somehow.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

suriyont

USA
18 Posts

Posted - Feb 25 2016 :  14:44:38  Show Profile  Reply
Hi Bill,
Thanks for such a quick reply. I did try your example and it works. What I did different is that I have been using [miPutMemo] because I wanted to have the right look to the object. Memo obj. can be edited like Text obj., but, somehow it does not have right-click while editing the text. I will just have to mimic Text obj. to look like Memo somehow.

Thanks again,



Suri M.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Feb 25 2016 :  14:54:26  Show Profile  Reply
To be consistent ImageEn should consider adding the same popup menu to a memo object.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

suriyont

USA
18 Posts

Posted - Feb 25 2016 :  15:20:07  Show Profile  Reply
Agree. I just realize that text obj. does not have border property. Do you think it is possible to add my own right-click somewhere? I've tried tapping into bunch of on-click events with no avail.

Suri M.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Feb 25 2016 :  15:59:17  Show Profile  Reply
I looked at that, but I do not see a way to do it with a popup menu, but you can have a button panel appear.... there is a demo; however, that shows how to implement it.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

suriyont

USA
18 Posts

Posted - Feb 25 2016 :  20:02:31  Show Profile  Reply
Bill,
Apparently, text editing on memo uses TIETextControl class located in ietext.pas. I ended up tweaking at ietext.pas source file. Then, I assign PopupMenu to undocumented TImageEnVect.MemoEdit(which is TIETextControl) property. Now, it is working.

Thanks again,

Suri M.
Go to Top of Page

xequte

38610 Posts

Posted - Feb 26 2016 :  03:36:28  Show Profile  Reply
Hi Suri

We'll look at adding a popup menu for edit controls in a coming update.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: