Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » How to get a widget's display size ?
How to get a widget's display size ? [message #1815480] Thu, 03 October 2019 10:20 Go to next message
Michel R is currently offline Michel RFriend
Messages: 46
Registered: April 2015
Member
Hello,

As a follow up of my previous question about display methods on an AbstractImageField, I need now to know the size of the widget associated with the field.

See https://www.eclipse.org/forums/index.php?t=msg&th=1100770&goto=1815401&#msg_1815401

Unfortunately, the solution given by Beat (option 2) could work nicely for most cases (the rotation values or zoom levels I need have only a few discrete values), but I have a problem with the AutoFit fonction, because when it is activated I do not know the actual zoom level. If the user uses AutoFit then some "Zoom In" function, I need to know the current zoom value to select the next zoom level to apply using a css class. Mixing a CSS scale transform with the autoFit implementation (max-width and max-height = 100%) does not work of course.

To know this zoom level I need the actual image size and the display size.

I can find the size of the image object, but I don't see anything to retrieve the widget's current size... Unfortunately it is not fixed.

So how can I get this size ?

Thank you.
Michel
Re: How to get a widget's display size ? [message #1815527 is a reply to message #1815480] Fri, 04 October 2019 08:21 Go to previous messageGo to next message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 205
Registered: November 2010
Senior Member
Field sizes are not available in the Java part of your application (it is only a model, not the presentation).

In JavaScript, any DOM element can be measured using scout.graphics.size($component)

Regards,
Beat
Re: How to get a widget's display size ? [message #1815571 is a reply to message #1815527] Sat, 05 October 2019 18:55 Go to previous message
Michel R is currently offline Michel RFriend
Messages: 46
Registered: April 2015
Member
Thank you Beat. It means that the only graphic method that is implemented in AbstractImageField (autoFit) results in a state which is not manageable from the Java layers... I am not lucky.
Michel
Previous Topic:How to use AbstractImageField doRotate(), etc. methods ?
Next Topic:Job Manager - Showing all scheduled jobs
Goto Forum:
  


Current Time: Fri Apr 26 22:27:05 GMT 2024

Powered by FUDForum. Page generated in 0.03228 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top