黑莓Torch模拟器和EditField中的问题 [英] Blackberry Torch Simulator and EditField Problem

查看:191
本文介绍了黑莓Torch模拟器和EditField中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

黑莓Torch正显示出一些奇怪的行为。我已经子类EditField中只为视觉花式。在主应用程序,我实例化这些自定义EditFields 2,设置样式位 EditField.FILTER_REAL_NUMERIC ,以限制输入数字。然后,这些EditFields被放置在一个定制的GridFieldManager一些标签字段这是未聚焦的一起。

The Blackberry Torch is showing some wierd behaviour. I have subclassed EditField only for visual stylings. In the main application, I instantiate 2 of these custom EditFields and set the style bit to EditField.FILTER_REAL_NUMERIC in order to limit input to numbers. These EditFields are then placed in a custom GridFieldManager along with some label fields which are un-focusable.

如果我接触(在模拟器)直接在一个这些EditFields,显示完整的QWERTY键盘。在这一点上,如果我碰,要么不具备对焦EditFields的,显示正确的键盘。如果我使用触控板滚动聚焦的领域也是如此;显示正确的键盘。

If I touch (in the simulator) directly on one these EditFields, the full qwerty key pad is displayed. At this point, if I touch either of the EditFields that do not have focus, the correct key pad is displayed. The same is true if I use the trackpad to scroll the focusable fields; the correct key pad is displayed.

这是一个已知的问题,还是没忘记的事?

Is this a known issue, or did forget something?

请注意:我不知道这是否是火炬设备上的问题,因为我的办公室还没有一个火炬装置

NOTE: I have no idea if this is an issue on Torch device, since my office does not yet have a Torch device.

更新:它看起来像这样涉及到管理此领域的定制GridFieldManager。这种定制code仅用于确定在何处的重点应该去:

UPDATE: It looks like this related to the custom GridFieldManager that manages this field. This custom code is only for determining where focus should go:

public ExGridFieldManager(int rows, int columns, long style) {
        super(rows, columns, style );
    } // END contructor -----------------------------------------------------------------

    /* PROTECTED METHODS ----------------------------------------------------------------------- */

    // handle focus gain on container
    protected void onFocus( int direction )
    {
        if ( direction > 0 )    // focus came from previous field
        {
            for(int i = 0; i < this.getFieldCount(); i++)
            {
                if (this.getField(i).isFocusable())
                {
                    this.getField(i).setFocus();
                    return;
                }
            }
        }
        else if ( direction < 0 ) // catch case where focus came from following field
        {
            for(int i = this.getFieldCount() - 1; i >= 0 ; i--)
            {
                if (this.getField(i).isFocusable())
                {
                    this.getField(i).setFocus();
                    return;
                }
            }
        }
    } // END onFocus() ------------------------------------------------------------------

    protected void paint( Graphics g ) {
        super.paint(g);
    } // END paint() --------------------------------------------------------------------

    // catch touch on a given inside this manager and set focus appropriately
    protected boolean touchEvent( TouchEvent event ) {
        int index; // for holding index of field where touchEvent ocurred

        if ( event.getEvent() == TouchEvent.CLICK ) {
            index = this.getFieldAtLocation( event.getX(1), event.getY(1) );

            if ( index > -1 )
                this.getField(index).setFocus();
        }
        return false;
    } // END touchEvent() ---------------------------------------------------------------

    /* PUBLIC METHODS -------------------------------------------------------------------------- */

    // determines when this manager should and should not recieve focus
    public boolean isFocusable()
    {
        for(int i = 0; i< this.getFieldCount(); i++)
        {
            if (this.getField(i).isFocusable())
            {
                return true;
            }
        }
        return false;
    } // END isFocusable() --------------------------------------------------------------
} // END class ====================================================================================

更新2:我瞄准黑莓OS 5.0版

UPDATE 2: I am targeting Blackberry OS version 5.0.

推荐答案

的问题是与GridFieldManager在黑莓OS 5.0。我发现了一个自定义的<一个href=\"http://www.assembla.com/$c$c/psu-edu-sweng500/subversion/nodes/trunk/rimapp/src/com/thinkingblackberry/GridFieldManager.java\"相对=nofollow>这里,直接从 net.rim.device.api.ui.Manager ,即固定的问题。

The problem was with the GridFieldManager in Blackberry OS 5.0. I found a custom one here, subclassed directly from net.rim.device.api.ui.Manager, that fixed the issue.

这篇关于黑莓Torch模拟器和EditField中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆