Menu

Using X coordinate for UI components

2005-12-07
2013-04-19
  • Nobody/Anonymous

    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

     
    • Gregory Gridin

      Gregory Gridin - 2005-12-07

      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

       
    • srdjan21000

      srdjan21000 - 2005-12-20

      Hi Gregory,

      Yes, that was my idea. Think of Symbian "grid view" main menu with 9 focusable ImageComponents arranged in 3x3 grid.

      Srdjan

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.