CustomButtonField не выбирается - PullRequest
       9

CustomButtonField не выбирается

0 голосов
/ 12 апреля 2010

Я не могу выбрать настраиваемое поле

Вот мой код: -

 public MenuScreen() 
{
    super(Screen.DEFAULT_CLOSE);
         verticalOffset=Display.getWidth();
         menuBackgroundImage=Bitmap.getBitmapResource("com/greetings/Images/MenuBackground.jpg");
         categories=new CustomSmallButton(Bitmap.getBitmapResource("com/greetings/ButtonImage/categoryon.png"),Bitmap.getBitmapResource("com/greetings/ButtonImage/categoryoff.png"),0);
         categories.setChangeListener(this);
         help=new CustomSmallButton(Bitmap.getBitmapResource("com/greetings/ButtonImage/helpon.png"),Bitmap.getBitmapResource("com/greetings/ButtonImage/helpoff.png"),0);
         help.setChangeListener(this);
         developer=new CustomSmallButton(Bitmap.getBitmapResource("com/greetings/ButtonImage/aboutuson.png"),Bitmap.getBitmapResource("com/greetings/ButtonImage/aboutuspoff.png"),0);
         developer.setChangeListener(this);


    VerticalFieldManager manager = new VerticalFieldManager()
    {
          protected void sublayout(int width, int height)
      {
              width=fwidth;
              height=fHeight;
              super.sublayout(width,height);
              setPositionChild(categories, width-240, height-350);
              setPositionChild(help, width-240, height-290);
              setPositionChild(developer, width-240, height-230);
              setExtent(width, height);
      }
    };
    manager.setBackground(BackgroundFactory.createBitmapBackground(menuBackgroundImage));
    manager.add(categories);
    manager.add(help);
    manager.add(developer);
    add(manager);

}
public void fieldChanged(Field field, int context) {
    if(field==categories)
    {
        templateCategories=new TemplateCategories(2);
    UiApplication.getUiApplication().pushScreen(templateCategories);

    }

    if(field== help)
    {
        helpScreen=new HelpScreen();
        UiApplication.getUiApplication().pushScreen(helpScreen);
    }

    if(field == developer)
    {
        developerScreen=new DeveloperScreen();
        UiApplication.getUiApplication().pushScreen(developerScreen);
    }

}

когда я нажимаю кнопку помощи или разработчика, он не выбирает.

1 Ответ

0 голосов
/ 13 апреля 2010

переопределить

protected void drawFocus(Graphics graphics,boolean on) {
                                //code for custom focus like draw onFocusbitmap
                                super.drawFocus(graphics, on);
                            }

в вашем классе CustomSmallButton

...