Programming scrolling a textarea

Hello

I am fairly new to the development of waterfalls, but have some ideas I want to implement.

I'm fighting for a few days trying to scroll a textarea semi-automatiquement.

I have a ScrollView with a textarea on the inside.

ScrollView {}
ID: scrView
scale double property: 0.5
scrollViewProperties.pinchToZoomEnabled: true
TextArea {}
ID: promptText
text:  
editable: false
textStyle.fontSize: FontSize.XXLarge
textStyle.color: Color.White
scrollMode: TextAreaScrollMode.Stiff
}
gestureHandlers:]
{PinchHandler}
onPinchUpdated: {}
scrView.contentScale = (scale * event.pinchratio)
}
}
]
}

What I want to do is to be able to push a button play, which begins to scroll the text area.

I looked in the forums, but in vain.

Right now I'm trying something like that in my QML:

function startScrolling() {}
While (location< 1000)="">
location = location + 0.5
scrView.scrollToPoint (0, location)
}

}

The text box scrolls, but not smoothly; He's waiting for like 5 seconds and then jump in the fifth line.

Am I missing something?

THX,

Johan

Hello

You send all updates at once while they are processed instantly and only the last is seen. The delay is due to the transformation of all accumulated messages.

From one thread is probably an overdose in this situation and I think that the GUI must be adjusted to the main thread anyway.

I would use a timer. There is a snippet of code to start a timer in QML (search for "QTimer"):

https://developer.BlackBerry.com/Cascades/documentation/dev/integrating_cpp_qml/index.html

Press the button start a timer with small interval, for example 50 msec.

In the onTimeout handler immediately call scrollToPoint or stop the timer if scrolling is done.

Save the current position of a property.

Please note that scrollToPoint scrolls smoothly to the default destination, so if you manually update the position by small steps, you will need to disable scrolling smoothly passing a third parameter:

scrView.scrollToPoint (0, location, ScrollAnimation.None)

Tags: BlackBerry Developers

Similar Questions

  • Automatically scroll a TextArea component

    Hi all

    Is there a way to get a component TextArea to scroll automatically when the text is added to it?

    I had a quick glance but have not found anything that works.

    Thank you

    Brien

    where my_ta is the name of the TextArea (AS2) component

    my_ta.vPosition = my_ta.maxVPosition;

    for AS3:
    

    my_ta.verticalScrollPosition = my_ta.maxVerticalScrollPosition;

  • Finder - right scrolling automatically snaps back to the left

    Hello

    I use Yosemite on a Mac Book pro. Recently, I noticed a problem with my finder. I have 'column view' enabled. When I scroll to the right to see the items more far in my tree, rather than stay where I scroll finder window cling all the way back to the left, showing the folders at the root of the drive. So, I actually don't see not all folders deeper in my directory structure.  I can't understand why this is happening. I hope someone can help out me!

    UPDATE: I discovered another problem which could be related. If I go to any program - safari, word, etc. and scroll all the way to the right, if I move the mouse over the program it will automatically scroll to the left. If I point the program, scrolling stops.

    Thank you!

    Ben

    SOLVED!

    It turns out that I needed to do something stupid - was enough to unplug and plug in my wireless mouse. Haha I've tried everything, * but * that. Go figure.

    Ben

  • My touchpad scroll function does not work in Firefox 4

    4 years Dell Inspiron 1520 with a Synaptics touchpad, running XP. Just downloaded FF4 last night, now discovered that my scrolling on the touchpad function no longer works. It's very irritating. If no fix is available, how to go back to the previous version of FF?

    Try running Firefox in questions to troubleshoot Firefox in Safe Mode. If it works properly in this configuration, then one of your modules is the culprit.

    By the way, I recommend you visit the Plugins check page and update your plugins. You are potentially expose your system to attack with some versions you have installed at the moment. Their update can also solve the problem with your touchpad.

    In case the previous steps do not resolve the problem for you, you can return to the previous version and secure that 3.6.16 as follows.

    1. Go to Download Firefox v3.6.16 and download it to your desktop.
    2. Then go to add/remove programs, scroll down to Mozilla Firefox and remove it, choosing to keep your bookmarks, etc., the customizations (don't tick the box).
    3. Reboot and delete the folder called Mozilla Firefox at this location: C:\Program Files\Mozilla Firefox
    4. Finally, run the downloaded installation file.
  • I recently downloaded and installed the graphics software "GIMP". Now I can't uninstall it by using uninstall selection program. Is there another way I can uninstall unwanted software?

    I uninstall 'Gimp '?

    I uninstall 'Gimp '?

    What if...

    you click on the Start button > click on all programs > scroll down and find Gimp > until it clicks > y at - there an option to uninstall in the menu drop-down?

  • Cannot access Word or Powerpoint in my Start Menu "all programs"?

    I downloaded and paid for microsoft office 2010 student. I have a sony vaio notebook, and it works with windows 7. However after that I downloaded and then entered my product key, everything was working fine, but recently, Microsoft Word and Microsoft Powerpoint have not shown in the section programs ALL in my Start menu. I know that both programs are still on my computer, because I can still access the files that use these programs to run, and the programs, then perform perfectly well. It's just that I can't access these programs without having to open a previously saved document, then move and clicking new blank document. In addition, microsoft exel works quite well and it is in my Start menu and I can access it easily, but the other two, word and powerpoint, aren't there, HELP PLEASE?

    Start button > all programs > scroll down to find Microsoft Office, click on it > now find them?
    If Yes, you can do one or both the following:

    1. right click on the word > Pin to the Start Menu
    2. right click on the word > Send to > desktop (create shortcut)

    Do the same with PowerPoint.

    For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • I have the problem that my pc does not run the program or we can dosent run any program and always give environment problem so now what should I do?

    I m using windows 7 ultimate service pack 1

    Restore the Type Associations by default Windows 7 file Extension:
    http://www.SevenForums.com/tutorials/19449-default-file-type-associations-restore.html

    Change the programs that Windows uses by default:
    http://Windows.Microsoft.com/en-us/Windows7/change-which-programs-Windows-uses-by-default
    Open default programs by clicking the Start button, click default programs.
    Associate a type of file or Protocol with a program / scroll down the list until you find
    your (.xxx) file extension you want to associate with your application.

    There is also the Microsoft Fix it Solution Center
    http://support.Microsoft.com/FixIt

    Also: Microsoft Fix it Solution Center
    http://support.Microsoft.com/GP/cp_fixit_main/en-us#TAB8

    In the list on the left, click on the "Windows" tab and then on the right road to the bottom of the list until see you if your problem is listed.

    J W Stuart: http://www.pagestart.com

  • I would handle the scroll button in the Hbox container IE

    I would handle the scroll button in the Hbox container IE...

    a button '+' and '-', when I click on '+' the page to scroll upward in a container (IE Hbox) and when I click on '-' the amine of the page down

    How should I do?

    Thank you

    When you click on your buttons, change the verticalScrollPosition and horizontalScrollPosition properties.

    http://blog.flexexamples.com/2009/11/02/auto-scrolling-the-contents-of-a-vgroup-container-au-Flex-4 /.

    http://blog.flexexamples.com/2008/11/27/auto-scrolling-a-textarea-control-in-Flex/

    If this post answers your question or assistance, please mark it as such.

    Greg Lafrance - Flex 2 and 3 certified ACE

    www.ChikaraDev.com

    Training Flex and Support Services

  • Disable the mouse wheel on a scrolling text box?

    I'm quite familiar with Actionscript, and this has baffled me completely. What I'm trying to do is prevent people from scrolling a TextArea with their mouse wheel, as the text box is inside a ScrollPane and now scrolling allows to scroll the other (double scroll). Initially, I tried:

    tArea.textField.mouseWheelEnabled = false;

    However, it did not work. After some research, I found some suggestions to replace the function childrenCreated of my class that extends the text box, ala

    override protected function childrenCreated (): void {}
    super.childrenCreated ();
    textField.mouseWheelEnabled = false;

    }

    but this won't work in Actionscript 2. Finally, after some research, I found some suggestions to intercept and disable events, ala


    this.addEventListener (ScrollEvent.SCROLL, this.disableScrollHandler);
    textField.addEventListener (MouseEvent.MOUSE_WHEEL, disableMouseHandler, true);
    verticalScrollBar.addEventListener (MouseEvent.MOUSE_WHEEL, disableMouseHandler, true);
    addEventListener (MouseEvent.MOUSE_WHEEL, disableMouseHandler, true);
    textField.addEventListener (MouseEvent.CLICK, disableMouseHandler, true);
    verticalScrollBar.addEventListener (MouseEvent.CLICK, disableMouseHandler, true);
    this.addEventListener (MouseEvent.CLICK, disableMouseHandler, true);
    .
    .
    .
    function disableMouseHandler(event:MouseEvent):void {}
    trace ("disableClickHandler");
    Event.preventDefault ();
    event.stopPropagation ();
    }
    function disableScrollHandler(event:ScrollEvent):void {}
    trace ("disableClickHandler");
    Event.preventDefault ();
    event.stopPropagation ();
    }

    But this has not as well. I have something wrong? Is it just not possible? What is the problem here?

    Thank you
    Stephen M.

    Strange... in order to make it work I had to do both methods, that is to say in my TextArea subclass, I put

    textField.mouseWheelEnabled = false;

    and I created a listener to stop the spread of the mouse wheel event:

    addEventListener (MouseEvent.MOUSE_WHEEL, disableMouseHandler, true);
    ...
    function disableMouseHandler(event:MouseEvent):void {}
    event.stopPropagation ();
    }

    It does not exactly what I need it to do, as it make sure the ScrollPane does not receive the scroll event either, but I can ignore it or find a workaround.

  • I can not run the most recent version. I get a window saying firefox.exe is not a Win32 file

    I can install the 5.0.1 version but it won't work. I got this version works when someone elso was using my computer. I don't know how it happened, but the calculation froze and I couldn't run Firefox afterwards. I got Firefox to my computer. Downloaded the latest version once again and I tried to run it. I've done several times without success

    It seems that the installation is corrupt.

    Follow these steps.

    1. Go to Download Firefox 5.0.1 and download the installer to your desktop. If necessary, use Internet Explorer to download, but in this case, choose "Save" when you see the prompt. Do not choose "Run"
    2. Then go to add/remove programs, scroll down to "Mozilla Firefox" and delete it, choosing to keep your bookmarks, customizations, etc. (don't tick the box).
    3. Reboot and delete the folder called "Mozilla Firefox" at this location: C:\Program Files\Mozilla Firefox
    4. Finally, run the installation file downloaded previously on the desktop.

    Your bookmarks, etc., customizations are stored in a different location and will become available to you even once you complete the installation.

    As a precaution, make a backup of your bookmarks as follows:

    1. Press CTRL + SHIFT + B to open the Bookmarks Manager.
    2. Click on the link to import and backup and then click on HTML Export and save the file somewhere.

    You can use this file at any time to restore your bookmarks if that proved necessary. Simply reverse the procedure and choose "Import HTML" instead.

    NB. If you use a download accelerator, turn it off before trying to download Firefox. These utilities are a common cause of corrupt files, in which case you get the error message you mentioned.

    If this suggestion solves the problem for you, please click the button solved next to this post after logging in to the forum. This will help others looking for a solution to the same problem.

    Thank you.

  • Re my Acer XP: How can I tell if I have installed Firefox 4? I went through the motions three times and have not been told that I managed. When I look at "About Firefox" tells me that I still have version 3.6. What gives

    That's about all. If you would like more information I'll need some advice from you, such as specific questions. Thank you.

    Follow these steps.

    1. Go to Download Firefox 4.0.1 and download the installer to your desktop.
    2. Then go to add/remove programs, scroll down to "Mozilla Firefox" and delete it, choosing to keep your bookmarks, customizations, etc. (don't tick the box).
    3. Reboot and delete the folder called "Mozilla Firefox" at this location: C:\Program Files\Mozilla Firefox
    4. Finally, run the installation file downloaded previously on the desktop.

    Your bookmarks, etc., customizations are stored in a different location and will become available to you even once you complete the installation.

    After completing the installation, go to the Plugins check page and update if necessary.

  • -It crashes sometimes, but the biggest problem is that it will not allow an update. It will never connect to update server.

    He tells me that I have to update Firefox, then when I click on the button to tell it to update, it will enter in the window that says "connect to Server", but it never does. Usually I then terminates the process after 5 or 10 minutes; but once he went long enough she came back with a window that says it failed (or something to that effect).

    Follow these steps:

    1. Go to Download Firefox 4.0.1 and download the installer to your desktop.
    2. Then go to add/remove programs, scroll down to "Mozilla Firefox" and delete it, choosing to keep your bookmarks, customizations, etc. (don't tick the box).
    3. Reboot and delete the folder called "Mozilla Firefox" at this location: C:\Program Files\Mozilla Firefox
    4. Finally, run the installation file downloaded previously on the desktop.

    Your bookmarks, etc., customizations are stored in a different location and will become available to you even once you complete the installation.

    After completing the installation, go to the Plugins check page and update if necessary.

  • I use software that is not compatible with FF 4. I am able to download a previous version and delete FF4?

    I have a software that is not compatible with FF4. I would like to revert to a previous version of FF. Perhaps 3.x. Is it possible and how can I do this if it is. It will probably be a short-term situation until the software is updated for compatibility.

    To return to the previous secure version which is 3.6.17, follow these steps:

    1. Go to Download Firefox v3.6.17 and upload it to the office.
    2. Then go to add/remove programs, scroll down to "Mozilla Firefox" and delete it, choosing to keep your bookmarks, customizations, etc. (don't tick the box).
    3. Reboot and delete the folder called "Mozilla Firefox" at this location: C:\Program Files\Mozilla Firefox
    4. Finally, run the installation file downloaded previously on the desktop.

    Your bookmarks, etc., customizations are stored in a different location and will become available to you even once you complete the installation.

    After completing the installation, go to the Plugins check page and update if necessary.

  • Hello. I installed the latest version of Firefox and I don't like. How can I go on back to the previous version (3.6.3 I think)? Thanks, Geoff

    I think the latest version is very slow when you access web pages. I want to return to the previous version to see if it's better. How can I go about changing back?

    To return to the previous secure version which is 3.6.17, follow these steps:

    1. Go to Download Firefox v3.6.17 and upload it to the office.
    2. Then go to add/remove programs, scroll down to "Mozilla Firefox" and delete it, choosing to keep your bookmarks, etc., the customizations (don't tick the box).
    3. Reboot and delete the folder called "Mozilla Firefox" at this location: C:\Program Files\Mozilla Firefox
    4. Finally, run the installation file downloaded previously on the desktop.

    Your bookmarks, etc., customizations are stored in a different location and will become available to you even once you complete the installation.

    After completing the installation, go to the Plugins check page and update if necessary.

    However, before go you that route, here are some tips to make it look like the previous version of FF4.

    • Right-click on an empty part of the toolbar tab and click "Tabs on top" to remove the check mark. Tabs later reappears under the search bar.
    • Repeat the same steps, but click on the top of the page, one called 'Menu bar '. This will restore the text at the top links.
    • To rearrange the layout, repeat the same steps and choose "Customize". A Panel opens and who remains on the screen, you can move elements like toolbars, buttons etc. around and place them anywhere you want. You can also drag anything there that you don't like Panel and add anything you want by dragging it out of there.
    • To replace the status bar at the bottom of the page, install this add-on: https://addons.mozilla.org/en-US/firefox/addon/status-4-evar/
  • How do I backup since version 5.0 (beta) for version 4.0.1?

    I would like to help the Firefox version that I used until a few minutes before; while I can enjoy the use of the different Add - ons that version 5.0 is not currently supports.

    1. Go to Download Firefox 4.0.1 and download the installer on the desktop.
    2. Then go to add/remove programs, scroll down to "Mozilla Firefox" and delete it, choosing to keep your bookmarks, etc., the customizations (don't tick the box).
    3. Reboot and delete the folder called "Mozilla Firefox" at this location: C:\Program Files\Mozilla Firefox
    4. Finally, run the installation file downloaded previously on the desktop.

    Your bookmarks, etc., customizations are stored in a different location and will become available to you even once you complete the installation.

    After completing the installation, go to the Plugins check page and update, as appropriate.

Maybe you are looking for