Am I correct that you are planning to implement absolute positioning for UI components?
If so you have to do following modification:
1. Introducing screenX variable and setAbsolutePosition(int x, int y) for each component
2. Reimplement methods ScreenCanvas.paintBody(Graphics g) and (maybe) ScreenCanvas.recalcAdjustment().
Method ScreenCanvas.recalcAdjustment recalculate variables to keep focused component visible
Method ScreenCanvas.paintBody calculates component position on the screen and calls paint method for each visible component.
Be accurate calculating scrolling adjustment. (It took significant time for me)
3. Set proper width for each component. (default width is screen width)
Regards,
Gregory Gridin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
First, 2 thumbs up for such a nicely designed project!
Since every UI component is Canvas-based, it is then a graphical object that can render itself anywhere on the screen (parent Canvas).
I see sticking to J2ME way of stacking UI components one on top of the other as a major drawback.
I have been experimenting a little, adding "screenX" variable to Component class, and it looks to me that it can be done.
ggridin, before I jump to changing code that sets focus, do you see any potential problem?
Best Regards,
Srdjan
Srdjan,
Am I correct that you are planning to implement absolute positioning for UI components?
If so you have to do following modification:
1. Introducing screenX variable and setAbsolutePosition(int x, int y) for each component
2. Reimplement methods ScreenCanvas.paintBody(Graphics g) and (maybe) ScreenCanvas.recalcAdjustment().
Method ScreenCanvas.recalcAdjustment recalculate variables to keep focused component visible
Method ScreenCanvas.paintBody calculates component position on the screen and calls paint method for each visible component.
Be accurate calculating scrolling adjustment. (It took significant time for me)
3. Set proper width for each component. (default width is screen width)
Regards,
Gregory Gridin
Hi Gregory,
Yes, that was my idea. Think of Symbian "grid view" main menu with 9 focusable ImageComponents arranged in 3x3 grid.
Srdjan