BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-02-2007, 12:23 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Feb 2007
Model: 8100
Carrier: T-Mobile
Posts: 54
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Screenshot Included :: Having trouble with cursor movement in editing fields.

Please Login to Remove!

Hi all,

I have a FlowFieldManager which contains two HorizontalFieldManagers. Each of the HorizontalFieldManager's width is restricted to 120 pixels. Inside each HorizontalFieldManager I have one EditField. With this layout, I have two fields on one "line".
The first EditField's initial value is "abc", and the second EditField's value is "def".

Here is the issue. When I move the roller ball to the right, the cursor jumps directly from the "a" in field 1 to the "d" in field 2. Continuing right movement, the cursor correctly goes thru the "e", then "f" in field 2.

I cannot get the cursor to iterate thru the "b" and "c" of field one, even when editing the field by trying to add characters between the "b" and "c".

Also, as the cursor moves, it "erases" the background colors of the two HorizontalFieldManagers.

I'm looking for how to keep the background color intact, and allow for full cursor movement across all characters of field 1 and field 2.

Here's a screenshot depicting the issues.


Below is the actual class code.

Any and all help greatly appreciated !

Code:
public class Sandbox extends UiApplication
{
 public static void main(String[] args)
 {
  Sandbox theApp = new Sandbox();
  theApp.enterEventDispatcher();
 }

 public Sandbox()
 {
  MainScreen screen = new SandboxScreen();
  pushScreen(screen);
 }
}

final class SandboxScreen extends MainScreen
{

 public SandboxScreen()
 {
   super(MainScreen.DEFAULT_MENU | MainScreen.DEFAULT_CLOSE);
  MenuItem menuItem = BBLogger.getShowLogMenuItem();
  addMenuItem(menuItem);

  FlowFieldManager ffm = new FlowFieldManager();

  HorizontalFieldManager hfm1 = new HorizontalFieldManager(
    HorizontalFieldManager.FOCUSABLE)
  {
   public void paint(Graphics graphics)
   {
    graphics.setBackgroundColor(Color.LIGHTCORAL);
    graphics.clear();
    super.paint(graphics);
   }

   public int getPreferredWidth()
   {
    return 120;
   }

   protected void sublayout(int maxWidth, int maxHeight)
   {
    super.sublayout(120, maxHeight);
    getExtent().setSize(120, getExtent().height);
   }
  };

  HorizontalFieldManager hfm2 = new HorizontalFieldManager(
    HorizontalFieldManager.FOCUSABLE)
  {
   public void paint(Graphics graphics)
   {
    graphics.setBackgroundColor(Color.LIGHTSKYBLUE);
    graphics.clear();
    super.paint(graphics);
   }

   public int getPreferredWidth()
   {
    return 120;
   }

   protected void sublayout(int maxWidth, int maxHeight)
   {
    super.sublayout(120, maxHeight);
    getExtent().setSize(120, getExtent().height);
   }
  };

  hfm1.add(new BasicEditField("", "abc"));
  hfm2.add(new BasicEditField("", "def"));

  ffm.add(hfm1);
  ffm.add(hfm2);

  add(ffm);
 }

 public boolean onClose()
 {
  System.exit(0);
  return true;
 }

 public boolean keyChar(char key, int status, int time)
 {
  switch (key)
  {
  case Characters.ESCAPE:
   onClose();
   return true;
  }
  return super.keyChar(key, status, time);
 }
}

Last edited by mdwheaton : 05-02-2007 at 05:43 PM.
Offline  
Old 05-02-2007, 05:45 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Feb 2007
Model: 8100
Carrier: T-Mobile
Posts: 54
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Added a screenshot.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.