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
 Request: TImageEnMView.InsertImage and DoSelectionChanged

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
JonMRobertson Posted - Aug 18 2023 : 08:27:10
Every method of TImageEnMView.InsertImage calls InsertImageEx(idx, imsAlways). Because InsertImage passes imsAlways for TIEMSelectMode, it always selects the image just inserted. I needed a way to prevent this.

Since InsertImageEx has the SelectMode parameter (which defaults to imsNever), this is a minor change request. I solved this by adding a private field in TIECustomMView and a public property in TImageEnMView, then changed each call to InsertImageEx to use the new property value rather than imsAlways. I set the default value of the new property to imsAlways to maintain current behavior.

The other change that I made was to add a condition where InsertItemEx calls DoSelectionChanged, such that it is only called when SelectMode <> imsNever. I added the same condition in TIECustomMView.DoChanged.

Obviously, there may be a better way to implement this request. And there may be scenarios that I have considered.


Thanks,

Jon
4   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 21 2023 : 21:38:36
Hi Jon

You can email me for a beta update to improve this (there will be still be some instances of SelectionChanged to avoid breakage for legacy users, but that should be rare with iemoDontSelectOnAdd).



Nigel
Xequte Software
www.imageen.com
JonMRobertson Posted - Aug 20 2023 : 22:04:37
I solved this in my version although I'm not thrilled with my solution.

Jon
JonMRobertson Posted - Aug 20 2023 : 20:55:22
procedure TIECustomMView.DoChanged() still calls DoSelectionChanged even when iemoDontSelectOnAdd is set.

Jon
xequte Posted - Aug 18 2023 : 22:15:10
Hi Jon

You can email me for a beta that includes the selection option, iemoDontSelectOnAdd, which does this. Also OnSelectionChange if this is used.

Nigel
Xequte Software
www.imageen.com