1 Pages (3 items)
Weird interaction between copying region and cloning region for custom region - Messages
#1 Posted: 9/25/2023 3:22:18 PM
Hello everyone
I want to ask if anyone knows the reasons and perhaps the solution to the weird interaction that I am currently experiencing. In the Maxima plugin that I am working on right now, a settings form is opened when the user double-clicks on the custom region. When the custom region is out of focus (the user clicks on other places in the worksheet), the form will automatically close. This works fine on the original and on cloned custom regions but not on copied custom regions.
Edit: The only thing I notice does not work in copied custom region is the custom event added during the init of the canvas. The event is OnFocusChanged as written in this post:
https://en.smath.com/forum/yaf_postst23693_Any-ways-to-implement-OnFocusChanged-method-for-RegionHolder-or-RegionEvaluable-class.aspx
I hope someone can clarify me the logic behind cloning and copying in SMath and perhaps help me solve this problem.
Thank you in advance.
Best regards,
Faiz
I want to ask if anyone knows the reasons and perhaps the solution to the weird interaction that I am currently experiencing. In the Maxima plugin that I am working on right now, a settings form is opened when the user double-clicks on the custom region. When the custom region is out of focus (the user clicks on other places in the worksheet), the form will automatically close. This works fine on the original and on cloned custom regions but not on copied custom regions.
Edit: The only thing I notice does not work in copied custom region is the custom event added during the init of the canvas. The event is OnFocusChanged as written in this post:
https://en.smath.com/forum/yaf_postst23693_Any-ways-to-implement-OnFocusChanged-method-for-RegionHolder-or-RegionEvaluable-class.aspx
I hope someone can clarify me the logic behind cloning and copying in SMath and perhaps help me solve this problem.
Thank you in advance.
Best regards,
Faiz
#2 Posted: 9/26/2023 4:45:28 AM
Copy and cloning have the same effect to the user but are processed differently; since the former involves the system Clipboard it is performed through a full serialization/deserialization (ToXml/FromXml methods), whereas the latter can be made on the fly within the program memory itself (Clone method). You should check if everything is initialized correctly in both the paths (look also at the InitLayout method).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Posted: 9/26/2023 4:48:46 AM
WroteCopy and cloning have the same effect to the user but are processed differently; since the former involves the system Clipboard it is performed through a full serialization/deserialization (ToXml/FromXml methods), whereas the latter can be made on the fly within the program memory itself (Clone method). You should check if everything is initialized correctly in both the paths (look also at the InitLayout method).
I realized that copying does not initialize the custom region unlike cloning (since cloning returns new custom region). I think that is the cause of my problem since the addition of the event handler is perfomed during the initialization. Thank you for the explanation.
1 Pages (3 items)
-
New Posts
-
No New Posts