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
 layers toolbars
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jrpcguru

USA
254 Posts

Posted - Aug 13 2021 :  19:48:19  Show Profile  Reply
I'm using D10.3 and the latest ImageEn. I was looking forward to your improvements in PDFium and they sure look nice. Thank you! I was also looking forward to improvements with the layer toolbars. So far I haven't had a toolbar disappear under their forms, so that is a very nice improvement. But, no surprise, I do have some questions.

Initially I used ImageEnView1.AutoToolbars := [ ievLayerSelection, ievLayerEditing ]; I quickly discovered that ievLayerEditing caused a huge toolbar to appear when the background layer was selected, even though I had used ImageEnView1.Layers[0].Selectable := False;

That didn't cause much problem since I just removed ievLayerEditing and now the toolbars adjusted themselves to layer type as expected. Except that rich text layers display a layer select toolbar that includes font options which don't work. Font options work correctly in the rich text editing toolbar. I would suggest removing non-functioning buttons from the layer select toolbar for rich text layers.

Apparently the rich text layer is showing the same layer select toolbar as plain text layers. I was surprised but pleased that the rich text options on this toolbar worked on plain text, though they aren't saved if I save the layer properties. (I wouldn't expect them to be saved.) But if the plain text layer is in edit mode, it only offers a right click menu for the clipboard and there is no editing toolbar. I would think it would be nice to have an appropriate editing toolbar so the user interface is similar to what is presented for rich text layers. In my experience, most users do not know about shortcut keys and right click menus, so a missing toolbar might be confusing.

While trying to fix some of these issues, I used IEGlobalSettings().LayerSelectionToolbar.Buttons and updated the values using the LayerNotify event for each layer type. This became important not only to fix the issues above, but also because I found a persistent issue that has frustrated solution for several days. The problem happens intermittently with several layer types, but I focused on the plain text layer since it was most reliable.




Note that tooltip for left three buttons says "Add a colored border"
Clicking the button 3rd from left yields the layers property dialog.
Closing the layers property via OK or Cancel, with or without changing properties, yields this error but the selected property does activate:




The work around proved to be to remove ivbLayersStyle, ivbLayersProps from the list of toolbar buttons and substitute ivbLayersPropsDlg which did the same thing, without errors.

There is where the fun really began. I analyzed your all layers demo and tried to replicate these errors. I tried moving your code to my program but the error still happened. I tried moving my code to the demo and still couldn't generate the error.
I use the ActivateTextEditor, LayerNotify, LayerNotifyEx,ShowDialog events. I blocked them in my program or used them in the demo and couldn't get the error to happen!

I'm hoping you can see why those individual toolbar buttons don't work reliably where ivbLayersPropsDlg does work. For now I've removed the problem buttons. The result is a very worthwhile improvement. Thank you.






J.R.

xequte

38196 Posts

Posted - Aug 13 2021 :  22:59:13  Show Profile  Reply
Hi JR

Thanks for your feedback. With regard to the issues you have raised:

1. ievLayerEditing shows a toolbar even when there is not a layer selection, as it allows addition of layers, etc.

2. "Rich text layers display a layer select toolbar that includes font options which don't work."

Fixed for current beta

3. A/V after using border width button:

I'm not able to reproduce this error. Did you disable *all* the code in any event of your TImageEnView and TImageEnLayerMView (put "Exit" at start of event)?



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

jrpcguru

USA
254 Posts

Posted - Aug 17 2021 :  16:21:15  Show Profile  Reply
Thanks for the quick reply. I originally used Exit to block each of the ImageEnView events that I thought might be the problem. I've now blocked everything and drastically simplified the program. No luck.

I didn't mention that the layer features in my program are on a popup form so that I can have an uncluttered user interface and a large view of the image. I thought perhaps I was doing something wrong transferring the image from the main form to the popup and back, but no luck there either.

I have now added my popup form to the demo program and removed everything from the popup form so it is very simple. I added a menu item to the main form to send the image to the popup form. I also added a menu item on the popup form to load an image and another to add a text layer. Either transferring the image from the main form or loading it directly into the popup still has the same problem. If I remember, the error happened with other layer types, but I've used text layers as a simple and repeatable proxy for testing. And, the error does not happen when I add a text layer to the demo program's main form.

I reliably get the error by creating the text layer, then clicking the toolbar button, 3rd from the left. All I do is check the box for having a border on the layer and close the properties dialog. It always gives the error. If I use the regular layer properties dialog button over to the right on the toolbar, it always works correctly. This seems particularly odd since both buttons are actually displaying the layer properties dialog.

Hopefully the attached modified demo program will let you see the problem and maybe find what is causing it.

There is another hopefully minor issue:

One of the features in my program lets the user create an empty image layer and then paste in an image. If I let the auto toolbar include clipboard features, the Copy to Clipboard button generates an "Invalid floating point operation" when the image layer is empty. I'm guessing that button needs an error trap for an empty layer.

attach/jrpcguru/2021817161542_Layers_AllTypes.zip
3289.42 KB

J.R.
Go to Top of Page

xequte

38196 Posts

Posted - Aug 18 2021 :  20:29:10  Show Profile  Reply
Hi JR

I've fixed the empty bitmap crash issue.

Unfortunately I still cannot reproduce the A/V issue, so presumably it is timing related.

There does not seem any obvious problems in your code.

And, as you say, there is no particular difference between showing the Layer Properties button and the border button, with the exception that the border button selects the Style tab.

Does the Delphi call stack report where the A/V arises (ensure EAccessViolation is not a language exception under Tools > Options, Debugger, Embarcadero Debuggers, Language Exceptions).

You might also try stepping through the ImageEn code to see if you can catch it.



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