将现场管理器添加到应用程序 BlackBerry 中的主屏幕

发布于 2024-12-10 18:15:58 字数 1725 浏览 0 评论 0原文

我正在使用 OS 5.0 及更高版本的 BlackBerry 应用程序。该应用程序有一个屏幕,在屏幕顶部显示一个 Next 和一个 Previous 按钮。列表字段也显示在该屏幕的这两个按钮的底部

当我单击下一个按钮上一个按钮时,我的列表将更新显示数据。

当我单击下一个/上一个按钮我必须在屏幕中央显示小的 VerticalfieldManager ,并带有标签“请稍候...”,因此在设计此屏幕后,我们如何在另一个管理器上添加更多的字段管理器?

有没有什么方法可以像 iPhone AppDelegate 屏幕一样在应用程序主屏幕上显示该字段?

btnState.setChangeListener(new FieldChangeListener() {

        public void fieldChanged(Field field, int context) 
        {   vfm_Middle.add(lblPleasewait);
            popup = new PopupScreen(manager);
            Thread thread = new Thread()
            {
                public void run() 
                {
                    try
                    {
                        Updatelistfield();
                        stop();
                    }
                    catch (InterruptedException e) 
                    {
                        e.printStackTrace();
                    }
                    super.run();
                }

                public synchronized void stop() 
                {
                    // TODO Auto-generated method stub
                    UiApplication.getUiApplication().invokeLater(new Runnable() {

                        public void run() 
                        {
                            // TODO Auto-generated method stub
                            //popup.delete(vfm_Main);
                            //popup.deleteAll();
                            //vfm_Main.delete(lblPleasewait);
                            //lblPleasewait.setText(null);

                        }
                    });
                }
            };

            thread.start();

        }
    });

I am working with a BlackBerry application for OS 5.0 and later. The application has one screen which displays at the top of screen a Next and a Previous button. and list field also display in this screen at bottom of these both button

When i click on NEXT Button and Previous Button my List will be updated display data..

When i click on NEXT/PREVIOUS Button i have to display small VerticalfieldManager at the center of the screen with Label "Please wait ..." so after design this screen how can we add more field manager in over the another manager ?

Is there any way to display that Field at the application MainScreen like iPhone AppDelegate screen?

btnState.setChangeListener(new FieldChangeListener() {

        public void fieldChanged(Field field, int context) 
        {   vfm_Middle.add(lblPleasewait);
            popup = new PopupScreen(manager);
            Thread thread = new Thread()
            {
                public void run() 
                {
                    try
                    {
                        Updatelistfield();
                        stop();
                    }
                    catch (InterruptedException e) 
                    {
                        e.printStackTrace();
                    }
                    super.run();
                }

                public synchronized void stop() 
                {
                    // TODO Auto-generated method stub
                    UiApplication.getUiApplication().invokeLater(new Runnable() {

                        public void run() 
                        {
                            // TODO Auto-generated method stub
                            //popup.delete(vfm_Main);
                            //popup.deleteAll();
                            //vfm_Main.delete(lblPleasewait);
                            //lblPleasewait.setText(null);

                        }
                    });
                }
            };

            thread.start();

        }
    });

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦巷 2024-12-17 18:15:58

正确的方法是使用阻塞对话框。在 BB API 中,可以按如下方式完成此操作:

VerticalFieldManager manager = new VerticalFieldManager();
manager.add(new LabelField("Please Wait..."));
Screen popup = new PopupScreen(manager);
//Show the pop-up the same way you push a regular screen

这具有阻止 GUI 的优点:如果用户按下菜单或 esc 键,则不会产生任何效果。

如果您想在没有对话框的屏幕上执行此操作,则可以添加一个空的 VerticalFieldManager,当必须显示消息时,您可以用标签填充它。这样,只刷新管理器,而不是更新整个屏幕。但是,您应该编写逻辑,不允许用户按任何按钮或菜单键(或忽略按键)。

The proper way of doing that is with a blocking dialog. In BB API this can be done as follows:

VerticalFieldManager manager = new VerticalFieldManager();
manager.add(new LabelField("Please Wait..."));
Screen popup = new PopupScreen(manager);
//Show the pop-up the same way you push a regular screen

This has the advantage of blocking the GUI: if the user pushes the menu or esc key it doesn't have any effect.

If you want to do it in your screen without dialogs, then you can add an empty VerticalFieldManager which you can fill with a label when the message has to be shown. This way, instead of updating the entire screen, only the Manager is refreshed. But then you should write the logic to not letting the user push any button or menu key (or ignoring key press).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文