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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Version 7 TIETextLayer Editor Is Active

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
w2m Posted - Apr 12 2017 : 12:37:18
Is there a procedure to determine if a TIETextLayer is active... in edit mode?
In an app I am working on, a layer is deleted by pressing the delete key. But if the TIETextLayer is editing (or is in edit mode) and the Delete key is pressed the layer is deleted instead of deleting a character. A means is needed to determine if the editor is active so that this can be accounted for when pressing the Delete key in edit mode.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Apr 14 2017 : 19:31:40
Hi Bill

I did not make any changes that should cause that, so I expect it is some slight change in the way you are testing it.

The text editor is a control (owned by the TImageEnView), so they KeyDown event should occur within the text editor control, and not within the TImageEnView, i.e. you should not see the TImageEnView.OnKeyDown event when typing into a text layer in edit mode.




Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Apr 13 2017 : 09:53:02
Hi Nigel,

I managed to get the updates from GIT and when deleting a character when editing a text layer and pressing the DEL key the OnKeyDown event is no longer executed. If the text layer is not editing then OnKeyDown executes and the layer is removed. So it looks like you are handling this automatically in the text editing code. As a result if ImageEnView.LayersEditingLayer > -1 then
Exit; is not even needed.
procedure TForm1.ImageEnViewKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  case Key of
    VK_DELETE:
      begin
        if ImageEnView.LayersEditingLayer > -1 then
          Exit;
        ImageEnView.LayersRemove(ImageEnView.LayersCurrent);
        ImageEnView.LayersDrawTo(ImageEnMView1.IEBitmap);
        ImageEnMView1.UpdateImage(ImageEnMView1.SelectedImage);
        ImageEnMView1.Update;
        ImageEnView.Proc.ClearAllUndo;
        UpdateGUI;
        UpdateLayers;
        UpdateStatusBar;
      end;
  end;
end;

So now with the update I can delete a character without deleting the layer and if the layer is not being edited the selected layer is removed when DEL is pressed. This is perfect now.

Am I correct?

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
xequte Posted - Apr 12 2017 : 22:57:53
Hi Bill

Please see the latest push to the Git repository. I have added: TImageEnView.LayersEditingLayer.

// When closing, check if user is editing a layer and prompt to save the changes
procedure Tfmain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  if ImageEnView1.LayersEditingLayer > -1 then
    if MessageDlg( 'Save changes to text?', mtConfirmation, [ mbYes,mbNo ], 0 ) = mrYes then
      ImageEnView1.LayersCancelEditor( True );
end;




Nigel
Xequte Software
www.xequte.com
nigel@xequte.com