getVerticalScroll (PopupScreen) still 0?

Hello

IM using a PopupScreen to display options that will be painted by a BitmapField.

Sometimes I have so many options, that the popupscreen scrolls down. With the touchEvent I use getY, but it returns there without the offset of scrolling. So I tried the getVerticalScroll of the screen. But, this method always returns 0?

I build my dialog like this:

public class OptionsDialog extends PopupScreen {
    public OptionsDialog() {
        super(new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL|VerticalFieldManager.VERTICAL_SCROLLBAR));
    }
}

I tried getVerticalScroll and getScreen (.getVerticalScroll).

Funny, getManager returns null?

Am I missing something?

Thanks for your help

Matthias

Try

this.getDelegateManager (.getVerticalScroll).

Tags: BlackBerry Developers

Similar Questions

  • I'm still working on pop filter

    I almost had an application ready to go, but I still want to create a menu (with custom bitmap buttons) that appears when you press an existing custom bitmap button.

    I created a screen with a bitmap background and a vertical field manager who holds my custom bitmap fields button, the code that runs when you press the buttons so I'm not a complete * beep *.  I did a lot of reading of course seems to the PopupScreen to the screen which is simular to simular screen.  So I thought it would be simple.

    I wanted to use the simpler code as I could in the first instance, so I added a quick code, under the case statement, to create a popup screen. I wanted to also give the bottom few color so I can see it and the text to display.

    The line containing the PopupScreen went through a few variations. It's just the last version I try.

    case CustomButtonField.SETTINGS:
                    
    SPC PopupScreen = new PopupScreen();

    VerticalFieldManager cbvfm = new VerticalFieldManager)


                    cbps.add(cbvfm);
                    pushScreen(cbps);

    I am embarrased to say that I can't even get it to build/execute (depends on the syntax i tried) past the first line PopupScreen cbps = new PopupScreen();

    I have search the knowledge base and looked at the FIleSelectorPopup sample. but I still cannot figure out what I am missing.

    Thanks for the assistance!

    Unlike Screen and MainScreen, PopupScreen does not come with an already supplied Manager.  So when you construct it, you must supply it with a Manager (the so called delegate Manager).  Aside from that, it is fairly easy to use.

    Anyway, I think the following variation on your code will work.

    VerticalFieldManager cbvfm = new VerticalFieldManager( )

    PopupScreen cbps = new PopupScreen(cbvfm);

    pushScreen(cbps);

  • Get popupscreen user input and store it in the variable

    Hello world. I have a screen that is pushed to start the application

    pushScreen (new SPScreen());

    In the constructor of the form, I push an extension of popupscreen in the stack to get an int from the user through TextField amount.

    UiApplication.getUiApplication () .pushGlobalScreen (new SplashScreen(), 1, UiEngine.GLOBAL_SHOW_LOWER);

    In the popuupscreen, I store the entry under int amount;

    public void fieldChanged (field field, int context) {}

    name = nameTxt.getText ();

    quantity = Integer.parseInt (amountTxt.getText ());

    Close();

    }

    };

    Now I want int amount; in my screen to shoot the user supplied value and whenever you click on a button Add the amount in total, each time increasing the total amount.

     

    public static int amount;

    total int = 0;

    ...

    amount

    = OptionScreen.amount;

    Total = total + amount;

    No matter how many times you press the Add button it only changes the total amount. For example, if I enter 6 as the quantity and press the button 3 times I want the total 18 years, but the total is still only 6.

    I'm sure there's probably a way to pass a reference to the variable, but I have a similar situation where I have a variable which is accessible by a certain screens and can be changed in multiple screens as well.  I delcare a class called globalVars and put the variable.

    public class globalVars {
    
        public static int total;
    
    }
    

    Do only access you anywhere with globalVars.total.

    Kind regards

    Scott

  • Difficult to get rid of the borders PopupScreen

    I put applyTheme to return nothing and still borders will not disappear.

    public class SplashDownloader extends PopupScreen
    { 
    
        private static GIFEncodedImage _image =  (GIFEncodedImage) GIFEncodedImage.getEncodedImageResource("ajax-loader.gif");
        private int _currentFrame;
        private static int _width=_image.getWidth();
        private static int _height=_image.getHeight();
        private int _xPos=(Display.getWidth() - _width) >> 1, _yPos=(Display.getHeight() - _height) >> 1;
        private AnimatorThread _animatorThread;
        public SplashDownloader() {
            super(new VerticalFieldManager()
            {
    
                 protected void paintBackground(Graphics arg0) {
                    // TODO Auto-generated method stub
                    //super.paintBackground(arg0);
                }
                protected void applyTheme(Graphics arg0, boolean arg1) {
    
                }
    
                protected void sublayout(int maxWidth, int maxHeight) {
                    // TODO Auto-generated method stub
    
                    //super.sublayout(maxWidth, maxHeight);
                    setExtent(_width, _height);
                }
            }, Field.NON_FOCUSABLE);
            setBackground(
                    BackgroundFactory.createSolidTransparentBackground(
                            Color.BLACK, 0)); 
    
            // Start the animation thread.
            _animatorThread = new AnimatorThread(this);
            _animatorThread.start(); 
    
        } 
    
    protected void paintBackground(Graphics graphics) {
            // TODO Auto-generated method stub
            //super.paintBackground(graphics);
        }
        protected void paint(Graphics graphics) {
            for ( int i = 0; i <= _currentFrame; i ++ ) {
                graphics.drawImage(_image.getFrameLeft(i),
                                   _image.getFrameTop(i),
                                   _image.getFrameWidth(i),
                                   _image.getFrameHeight(i),
                                   _image,
                                   i,
                                   0, 0);
            }
        } 
    
        protected void onUndisplay() {
            _animatorThread.stop();
        } 
    
        protected void applyTheme(Graphics arg0, boolean arg1) {
                // TODO Auto-generated method stub
    
            }
        public void stop()
        {
            _animatorThread.stop(); 
    
        }
    
        private class AnimatorThread extends Thread {
            private SplashDownloader _theField;
            private boolean _keepGoing = true;
            private int _totalFrames, _loopCount, _totalLoops;
            public AnimatorThread(SplashDownloader _theScreen) {
                    _theField = _theScreen;
                    _totalFrames = _image.getFrameCount();
                    _totalLoops = _image.getIterations(); 
    
            } 
    
            public synchronized void stop() {
                    _keepGoing = false;
            } 
    
            public void run() {
                    while (_keepGoing) {
                            // Invalidate the field so that it is redrawn.
                            UiApplication.getUiApplication().invokeAndWait(
                              new Runnable() {
                                    public void run() {
                                            _theField.invalidate();
                                    }
                            });
                            try {
                              // Sleep for the current frame delay before
                              // the next frame is drawn.
                              sleep(_image.getFrameDelay(_currentFrame) * 10);
                            } catch (InterruptedException iex) {
                            } // Couldn't sleep.
                            // Increment the frame.
                            ++_currentFrame;
                            if (_currentFrame == _totalFrames) {
                              // Reset back to frame 0
                              // if we have reached the end.
                              _currentFrame = 0;
                              ++_loopCount;
                              // Check if the animation should continue.
                              if (_loopCount == _totalLoops) {
                                _keepGoing = false;
                              }
                            }
                    }
            } 
    
        }
    
    }
    

    BTW, there are three methods applyTheme. I guess the method empty arg takes care of it. Just an info.

        protected void applyTheme() {
    
            // do nothing
        }
    
        protected void applyThemeOnStateChange() {
    
            // do nothing
        }
    
        protected void applyTheme( Graphics graphics, boolean flag ) {
    
            // do nothing
        }
    

    If you're on 4.6.0 + you can also choose to create a class of border or background empty to get rid of the default theme borders. applyTheme() is incomplete.

  • The width is my PopupScreen?

    I've implemented some slightly modified fields and buttons to allow the adjustment of the width. They work great on a screen:

    FixedLabelField ("count Set:",Display.getWidth()/2)); ")

    But what I can call to get the width of the PopupScreen? I tried all sorts of things, but they all come to zero...

    You still add your fields until the screen has its chance to layout itself.

    Create and add them inside of, say, of your PopupScreen onDisplay() (onUiEngineAttached() in 4.3 +).  When you do that, your screen is sure to have been laid out.

  • PopupScreen with AnimatedGIFField

    I am creating a screen using the AnimatedGIFField class and progression custom by extending PopupScreen figure in the Blackberry docs.  The problem is that my screen does not display when I call the method that is supposed to display.

    Here is the code for the screen:

       RichTextField rtf;
        AnimatedGIFField agf;
       // GIFEncodedImage gei = (GIFEncodedImage) EncodedImage.getEncodedImageResource("ajaxloader.gif");
        String progress;
    
        // constructor for progressScreen
        progressScreen(String s)
        {
            super(new HorizontalFieldManager(), Field.NON_FOCUSABLE);
            int[] offset = new int[s.length()];
            byte[] attributes = new byte[s.length()-1];
            Font[] fonts = new Font[] {Font.getDefault().derive(Font.BOLD), Font.getDefault().derive(Font.PLAIN)};
            agf = new AnimatedGIFField(((GIFEncodedImage)GIFEncodedImage.getEncodedImageResource("resources/ajaxloader.gif")), Field.FIELD_RIGHT);
            rtf = new RichTextField(s, offset, attributes, fonts, Field.NON_FOCUSABLE);
            add(rtf);
            add(agf);
        }
    

    Here is the code for the method display:

    // behavior when displaying screen
    
        // method for displaying screen
        public void show()
        {
            UiApplication.getUiApplication().pushModalScreen(this);
        }
    

    I'm sure that I forgot something... one object or a sublayout(), but I cannot know what.

    I replaced the PopupScreen with a call to Status.show (String message, image bitmap Bitmap, int time) to check that it was a problem with my custom PopupScreen and not the surrounding code, and the Status.show () posted correctly.

    Any help would be appreciated.

    "You mean, like this?  Unfortunately, you're close, but still actually running on the event Thread.  'tril.run ();' executes the run method on the same Thread that you use.  What you wanted to write was:

    Tril.Start ();

    Give that a try, and you will start to notice the IllegalStateExceptions.

    "Wouldn't be too big for a dialogue?

    I don't know what you mean by that.

    You might be interested in this review:

    http://www.naviina.EU/WP/BlackBerry/loading-class-for-BlackBerry/#more-607

  • Problem scrolling in PopupScreen

    Hello

    I added a PopupScreen to my application that will display a given text. When the text is displayed, scroll arrow appears indicating that there is more text to be displayed, however it doesn't let me scroll when I click on the down (tests on a BlackBerry with a trackball).

    The text is displayed in a LabelField (which I believe is not Focusable by default), but even when I say new LabelField ("text", Field.FOCUSABLE), it still doesn't let me scroll down. I tried to add other areas (for example, EditFields) and it seems to work. So I think the problem is with the update?

    Can someone tell me why this is? Here is my code:

    package com.kflicks.ui.Screens;
    
    import java.util.Vector;
    
    import net.rim.device.api.system.*;
    import net.rim.device.api.ui.container.*;
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.component.*;
    
    public class SynopsisScreen extends PopupScreen implements KeyListener {
    
        Vector results;
    
        LabelField label;
    
        public SynopsisScreen(String synopsis) {
            super(new VerticalFieldManager(VERTICAL_SCROLL | VERTICAL_SCROLLBAR),
                    Field.FOCUSABLE);
    
            label = new LabelField(synopsis);
            add(label);
        }
    
        public void close() {
            UiApplication.getUiApplication().popScreen(this);
        }
    
        // ///////////////////////////////////
        // / implementation of Keylistener
        // ///////////////////////////////////
        public boolean keyChar(char key, int status, int time) {
            // intercept the ESC key - exit the app on its receipt
            boolean retval = false;
            switch (key) {
            case Characters.ENTER:
                break;
            case Characters.ESCAPE:
                close();
                break;
            default:
                retval = super.keyChar(key, status, time);
            }
            return retval;
        }
    
        /** Implementation of KeyListener.keyDown */
        public boolean keyDown(int keycode, int time) {
            return false;
        }
    
        /** Implementation of KeyListener.keyRepeat */
        public boolean keyRepeat(int keycode, int time) {
            return false;
        }
    
        /** Implementation of KeyListener.keyStatus */
        public boolean keyStatus(int keycode, int time) {
            return false;
        }
    
        /** Implementation of KeyListener.keyUp */
        public boolean keyUp(int keycode, int time) {
            return false;
        }
    }
    

    Try to exchange your LabelField to a RichTextField and see if that solves your problem.

  • The Manager is null in PopupScreen

    Ignore this thread, I just made a stupid mistake in my own code and it had nothing to do with PopupScreen.

    Hi all

    I have the following problem, and I can't believe my eyes... I get off PopupScreen, I pass a new handler instance to the constructor inherited super caller and then on the line following getManager() returns null. (And of course add calls fail). For example:

    public class that dialogue extends PopupScreen implements {FieldChangeListener}

    [....]

    Public dialogue (properties conf, string text [, String String Yes, no, listening to the listener) {}
    Super (new VerticalFieldManager());

    log.log ("Manager ="+ getManager()); say the Manager is null
    This.Listener = listener;
            
    for (int i = 0; i)< text.length;="" i++="" )="">
    Add (new LabelField (text [i], Field.FIELD_HCENTER)); Throws NPE, while the text and the text [i] is NOT null. Without a doubt.
    }

    Has anyone seen anything like this before? I checked some of my first projects and (unsurprisingly), I could do the same thing without guile ay. (In fact it is wrong one could do here, since calling the inherited constructor must be the first statement...) Now, this fails for me on 4.2.1 4.5.0 and 4.7.0.

    At first, I thought that's a few threads question undocumented (I was bringing together the UI in a GUI thread not before calling enterEventDispatcher), but that works in all of my projects and I changed the boot in the end sequence, so who know it happens after the call to enterEventDispatcher. I tried to move it to the thread of the event, but it still does not work as a result. (As I look at the code it shouldn't be there all multithreaded processing issues.) At least as long as it's a java virtrual machine and not only something similar.)

    Laszlo

    ... and how to get away from the problem, sleep and talk (post on the forum) help to solve... I have accidentally overridden method add to be able to add components from the outside to a specific part of the window (just like with the standard dialog box class). Which was to throw the exception when it is called from the constructor as the manager used in there would be initialized later. Sorry, my bad, thanks for your efforts .

  • I changed my Apple ID to my new married name, but somewhere it is still hanging on to my old details

    After getting married, I updated my Apple ID with my new name and e-mail address.  This well it worked and I can access iTunes etc but my iCloud storage is almost full and I tried to connect to improve it but it still shows my old email address and name.  I can't connect to it knowing that I replaced all the details so the old account doesn't really exist, but it will not display my new address.  I went in my Apple ID to see where he was always picking up the old name/e-mail since but there just my new details (as it should) and I don't see where it's always the old details.  How to forget my old data.  I have almost no storage iCloud and have no way to resolve this issue now.

    Thank you very much

    When you update the primary e-mail address on an account, you must then sign and return in everywhere that the account is used: what to do when you have changed your Apple ID email address or password - Apple support

    If you are being invited for the password of the account when you try to disconnect from the iCloud on the device and the computer test: If iCloud asks you the password to your Apple ID - Apple Support previous

  • Problems with still images

    Hi all!

    Since upgrading to FCP 10.2.3, 80% of my images still in the movies and work, the other 20% weird color lines to this topic, see the image below.

    I tried to re - register and again add the media to the event, etc. and also deleted the files generated rendering library that did nothing.

    Thank you

    This means that your gpu is unable to manage these photos. Try to use the smallest size photos if possible. If you don't need to zoom in on them there is no need to use photos that are much larger than the size of the image. Tell us your details specific mac and os and fcpx version.

  • I tried to download macOS Sierra for the last hours on my Mac, but it is still holding still to download. Should I download the El Capitan instead? All sites tell me that I should update my Safari.

    I tried to download macOS Sierra on my macbook pro iOS 10 for a few hours and it still has several hours to go. Should I just download the Capitan instead? All sites tell me that I should update my Safari or I wouldn't even through this disorder.

    You must complete the download of Sierra. It is a very large file and will take some time, especially on a slow Internet connection.

    (145165)

  • Boot Camp is no longer showing as bootable disk but still readable

    Hello

    I recently tried to increase the size of my boot camp partition and I partitioned my internal drive to create a space to be able to use this free space to extend the windows partition in to. However, after you have created this space empty on my drive, the bootcamp windows no longer displays when I hold 'alt' on power. Finder can still read the bootcamp drive and all files seem to always be there. I'm really confused and any help would be greatly appreciated. I really don't want to uninstall boot camp and reinstall again that it would cause a problem for some software licenses.

    Thanks in advance!

    Ryan

    Please after the release of the following OSX Terminal commands.

    diskutil list

    Cs diskutil list

    sudo TPG - vv - r see the/dev/disk0

    sudo fdisk/dev/disk0

    Orders 'sudo' will ask for your password.

    A BC/Windows partition resizing is not supported by Apple officially. Third-party tools must be used very carefully. Don't mix not BC on the same Mac partitioning.

  • can I still add to apple care if the warranty has expired?

    can I still add to apple care if the warranty has expired?

    No, if it is out of warranty, if it is for a Mac: http://www.apple.com/support/products/mac.html

    The AppleCare Protection Plan can be purchased as long as your Mac is still covered by the limited warranty of one year.

  • iPhone 7 more (Black - 128 GB) still "processing Elements"!

    Hello

    I ordered my iPhone more black 7 128 GB on September 9 in Dubai (pre-order day itself) and it showed that the delivery would be from 4 to 10 October. Today IS OCTOBER 4 and my order status is STILL "Of ELEMENTS OF TREATMENT." I don't understand why its always 'treatment Items' in the week of delivery.

    How would it take for the process to go further.

    If someone has an idea, pls let me know!

    Thanks for reading.
    Waiting for answers,
    See you soon!

    Hello

    You will receive a shipment notification when your order has been shipped, and to access the tracking information.

    I'm afraid that no one here can tell you when it will be.

    It is a community of support based on the user.

  • My Apple apps will still work when I switch to El Capitan?

    First of all, I apologize if it is published in an inappropriate category. I wanted to post in Mac applications, but it has been blocked.

    I have a late 2009 13 "MacBook Pro. I soon will be upgrading in El Capitan (saved on a bootable disc) to Snow Leopard (do a clean install on a new SSD). I know that new versions of Safari, iMovie, Garage Band and Photos comes with El Capitan. But my old applications 2009 as iMovie HD, iDVD and others still work when I upgrade?

    As for iTunes? I just checked it and it says that it is currently at version 11.4.

    Are there apps that I have to buy?

    I mean, I know that many people do not really care pictures from iPhoto. If I don't like a photo, can I just transfer on my current version of iPhoto to my Time Machine backup?

    Thank you for your help.

    You can check the compatibility of your applications and your OS here: http://roaringapps.com/apps

Maybe you are looking for