语言

Menu
Sites
Language
Use wheel for scrolling TextBox [Resolved]

Hello at all,

I'm new in this forum, and it's my first question.

 Since the begining that i create my little app, i search and this forum help me very much for that, but this time i have not found a simple solution for do that :- (

I can scroll the texte with my finger, but impossible to do that with the watch wheel

I use this code for fill the textbox (Sorry, impossible to put the code in the code tag of this forum, with FF and IE)

 

tizen.filesystem.resolve("documents",
            function(dir)
            {
                var file = dir.resolve("MyFile.txt");

                file.openStream(
                    "r",
                    function(fs)
                    {
                        var Text = fs.read(file.fileSize);
                        fs.close();
                        var textbox = document.querySelector('.contents');
                        var box = document.querySelector('#textbox');
                        box.innerHTML = Texte ;
                     },
                    function(e)
                    {
                        console.log("Error " + e.message);
                    }, "UTF-8");

            }
        );

 

If someone have a simple solution, because i'm a true beginner, i have my since only one week ;-)

Have a good day

编辑者为: andre bernard 03 4月, 2018

响应

4 回复
Armaan-Ul- Islam

Hello andre bernard, Welcome.

 

# To detect Bezel (Wheel) rotation event you can add a javaScript event listener. Rotation event is defined as 'rotarydetent'.

# Inside the Event Listener function write code for scroll up/down based on clockwise/counterClock rotation.

There's a sample code for this purpose on Tizen Developers:

https://developer.tizen.org/development/guides/web-application/user-interface/tizen-advanced-ui/applications-circular-ui/handling-rotary-events#pagescroll

andre bernard

Hello Armaan-Ul- Islam

Thanks a lot for your help

I take a look immediately

Have a very good day

Armaan-Ul- Islam

You're welcome.

It worked out for you, right?

andre bernard

Hello Armaan-Ul- Islam

Yes, you are the best :-)

Thanks to you i could terminate my little first program
Sincerely, for a beginner it's not really simple to coding on TIZEN, and for the moment, they are not too much examples

And again, the first time i have try in native, and here, it's again more difficult

I thanks you again for your precious help