03-01-2011 10:24 AM
A design question, what is a good implementation of the following?
I've read the Knowledge Base articles "Create custom fields" and "Create a custom layout manager for a screen" and what I want to do is control any arbitrary custom field - in a custom manager.
For example, if I have the following Fields:
I want the second and fifth Fields to have a different margin, padding or width than the first, third and forth Fields, I would do that by layout() and paint() methods for the second and fifth Fields - that should override the custom Manager sublayout() method logic?
Or do I add logic in the custom Manager, I find the fields with the getField() method to get the second and fifth Fields and modify the margin, padding or width with logic in the custom Manager?
Which is the correct place to put the logic?
Solved! Go to Solution.
03-02-2011 04:28 AM
you can do this in the sublayout method of the manager when you assign all fields their size and position.
03-02-2011 06:27 AM
In Method sublayout you have all the options to give position of a component, and if you use paint method for this purpose, you can only alter compont's displaying area/style, but component will use same size.
03-02-2011 08:03 AM
To be absolutely clear, a Manager's sublayout() method logic takes precedence over aa Field's layout() method logic?
03-02-2011 08:07 AM
the field can only work with the space assigned by the manager. how it uses this space is up to the field, it could display itself smaller, for example.
03-02-2011 08:08 AM
Thank you, I appreciate your help - kudos to you.