get and set the position of the scrollbar of a canvas

Hi Flexperts,

I need to track the position of the vertical scroll bar in my application. The scroll bar is created by a VBox in a canvas and the following attributes:
verticalScrollPolicy = "off" horizontalScrollPolicy = "off".

How can I track and define its position? I tried to put the ' scroll = "{myScroll (event)}" "hoping to catch these events, but the event did not get routed to the service!"

Thank you in advance for your help!
student_it

Thank you for following up! I found everything that I was wrong. The "scroll" attribute works as advertised in this app. I was just confused by ScrollEvent what VBox or of the DataGrid, I should be listening to. And there is good API in the ListBase to allow manipulation of the scroll positions.

Tags: Flex

Similar Questions

  • Get and set the value to allow selected rolling Shuffle and facing page

    Hello world

    I work with the page and spread,

    For now, I want to value page spead shuffle and type of document.

    but I just find the function to get and set the value for the Document Pages allow Shuffle using the

    InterfacePtr < IPageLayoutPrefs > iPageLayoutPrefs (static_cast < IPageLayoutPrefs * > (: QueryPreferences (IID_IPAGELAYOUTPREFERENCES, iDocument)))

    It has no function to set and get the value of enable selected rolling Shuffle and facing page

    No one knows about it?

    I thank in advance

    There is no code for this example in the SDK or internet. Just understand and apply the concept.

    Find the code for the shuffle spread and together following spread shuffle...

    // Get active spread
    UIDRef GetActiveSpread() {
        UIDRef spreadRef = UIDRef::gNull;
    
        InterfacePtr layoutData(Utils()->QueryFrontLayoutData());
        if(layoutData) {
      spreadRef = layoutData->GetSpreadRef();
      }
    
      return spreadRef;
    }
    
    // Get spread shuffle of passed in spread
    bool16 GetSpreadShuffle(UIDRef& spreadRef) {
        InterfacePtr spread(spreadRef, UseDefaultIID());
        if(!spread)
      return kFalse;
    
      InterfacePtr iBoolData(spread, IID_IISLANDSPREAD);
        if(iBoolData) {
            return iBoolData->GetBool();
        }
    
        return kFalse;
    }
    
    // Set spread shuffle of passed in spread
    // @param bValue: kTrue = no shuffle, kFalse = allow shuffle
    ErrorCode SetSpreadShuffle(UIDRef spreadRef, bool16 bValue) {
        ErrorCode status = kFailure;
    
        InterfacePtr spreadCmd(CmdUtils::CreateCommand(kSetIslandSpreadCmdBoss));
        if(!spreadCmd)
            return status;
    
        spreadCmd->SetItemList(UIDList(spreadRef));
    
        InterfacePtr iBoolData(spreadCmd, UseDefaultIID());
        if(iBoolData) {
            iBoolData->Set(bValue);
        }
    
        status = CmdUtils::ProcessCommand(spreadCmd);
        return status;
    }
    
  • How to get and set the length and the width of the content of the layer?

    How to get and set the length and the width of the content of the layer

    All layers are packed not equal. a layer as adjustment have no limits. Layer to smart object can have two different sizes. The size of the object and the size of the object may be transformed. All smart object layers have an associated transform. To transform a smart object layers you need to work with the size of the object the generated pixels fot the layer. Text layer can be resized with a transform or by changing the font size. Pixelated layers are resize via a transformation.  The script method is resize.  When you resize the number of pixelsits made by interpolation. You can specify what method to use or set Photoshop interpolation preferably by default.

    There is also a bug in Photoshop scripts if you pause the story said make a selection and use resize. Photoshop will properly support up to a State before where you suspended history. This bug seems to be in all versions of Photoshop.

    If you look ate the script in my bug report, you should get a good idea of how to resize a layer.

    Photoshop: Bug Script resize the rear paper folded to a history State

  • Get and set a Position of the pre-numbered WPF legend

    I'm creating a WPF application that displays a chart of data (several courses) and adds several annotations programmatically. The user has the ability to drag the annotation (InteractionMode = AnnotationInteractionModes.DragLabel) labels. I need to be able to record the new position of the label and load it later.

    I use the NationalInstruments.Controls.PointAnnotation a NationalInstruments.Controls.Graph object.

    I thought it would be reflected in the LabelAlignment, but that does not change the value that I set when I initially create the annotation of.

    Here's how I add the annotations on the graph:

    /// 
            /// Add the annotations to the graph
            /// 
            /// 
            /// 
            /// 
            private void DisplayAnnotations(DataHandler dataHandler, DateTime StartDate, DateTime EndDate)
            {
                PointAnnotation tmpAnnotation = new PointAnnotation();
                //Iterate through all the annotations in the source data set
                foreach (Post_Job_Charting.Annotation dataPointAnnotation in dataHandler.Annotations)
                {
                    TimeSpan DateDiff = EndDate - StartDate;
                    TimeSpan HalfWay = new TimeSpan(StartDate.AddSeconds(DateDiff.TotalSeconds / 2.0).Ticks);
    
                    //Only add annotations that are in the visible data range
                    if (dataPointAnnotation.Date >= StartDate && dataPointAnnotation.Date <= EndDate)
                    {
                        tmpAnnotation = new PointAnnotation();
                        tmpAnnotation.HorizontalPosition = dataPointAnnotation.Date;
                        tmpAnnotation.VerticalPosition = dataPointAnnotation.Value;
                        tmpAnnotation.Label = dataPointAnnotation.Text;
    
                        if (dataPointAnnotation.Date.Ticks < HalfWay.Ticks) { tmpAnnotation.LabelAlignment = new AnnotationLabelAlignment(BoundsAlignment.None, 0, -25); }
                        else { tmpAnnotation.LabelAlignment = new AnnotationLabelAlignment(BoundsAlignment.None, -75, -25); }
                        tmpAnnotation.InteractionMode = AnnotationInteractionModes.DragLabel;
    
                        //Show/Hide the annotation
                        if (dataPointAnnotation.Display) { tmpAnnotation.Visibility = System.Windows.Visibility.Visible; }
                        else { tmpAnnotation.Visibility = System.Windows.Visibility.Hidden; }
    
                        //Tag the annotation so I can find it later
                        tmpAnnotation.Tag = dataPointAnnotation.ID;
    
                        //Display annotation on the graph
                        niGraph.Children.Add(tmpAnnotation);
                    }
                }
            }
    

    Once I have the position of the label, I need to be able to reset the label to this post, but let's start first of all, I need to get this job.

    Any help you can offer would be greatly appreciated.

    Best regards

    -Marcel

    There is no property on the annotation of point that sets the position of the label. I created a task to look by adding this.

    However, you can monitor the changes using a custom BoundsAlignment application that registers the new offset as it is updated:

    public sealed class RecordingBoundsAlignment : BoundsAlignment {
            public Vector LastOffset { get; private set; }

    public override Point AdjustPosition( AlignmentArgs args ) {
                LastOffset = new Vector( args.XOffset, args.YOffset );

    return None.AdjustPosition( args );
            }
        }

    When you create the annotation, you use an instance of the alignment of the record, and when you want to store the position you will be able to read the value of the recorder:

    tmpAnnotation.LabelAlignment = new AnnotationLabelAlignment(
            new RecordingBoundsAlignment( ),
            initialXOffset,
            initialYOffset );

    // ...

    var recorder = (RecordingBoundsAlignment)tmpAnnotation.LabelAlignment.Alignment;
        Save( recorder.LastOffset );

  • Get and set the Master Volume

    My app plays an mp3 file, but it depends on the master volume, can I get the general volume level currently, when the player is playing reset it and change to the normal level later?

    Hello

    In fact I don't know how to set the volume using the waterfall, but I have another way.

    You can use native code

    Try this

    #include "applicationui.hpp"
    
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    
    ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
            QObject(app) {
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
        qml->setContextProperty("app", this);
        AbstractPane *root = qml->createRootObject();
        app->setScene(root);
    
        float val = 100; // Volume level between 0 to 100
        audiomixer_set_output_level(AUDIOMIXER_OUTPUT_SPEAKER, val);
    }
    

  • How to get and set the size of the pool AM in life

    Hi, I want to get and programmatically, set the following parameters:


    ------------------------------------------------------------------------------

    Size of the initial Pool (jbo.ampool.initpoolsize)

    Maximum Pool size ( jbo.ampool.maxpoolsize )

    Referenced Pool size ( jbo.recyclethreshold )

    The maximum lifetime of Instance ( jbo.ampool.timetolive )

    --------------------------------------------


    In AMImpl or other place?


    Is it methods?


    Thank you.

    To get information about the pool, you can use code like this in your applicationModuleImpl

    help to dump pool statistics to log

    private void dumpAMPoolStatistics() {}

    Download the pool manager

    PoolMgr poolMgr = PoolMgr.getInstance ();

    get the managed pools

    Key of the poolMgr = enumeration. getResourcePoolKeys();

    If (key! = null) {}

    If (keys.hasMoreElements ()) {}

    can handle several pools, we will get the name of first successful

    String poolname = (String) keys.nextElement ();

    System.out.println ("pool of AM name:" + poolname);

    get the AM pool

    ApplicationPool pool =

    PoolMgr (ApplicationPool). getResourcePool (poolname);

    Journal of diagnostic AM pool

    PrintWriter out = new PrintWriter (System.out, true);

    pool. dumpPoolStatistics (new PrintWriter (out));

    out. Flush();

    }

    }

    }

    Or read Getting Application Module pool statistics to help with setting the size

    I'm not sure you can change the settings at run time. As far as I know, the pool bed settings only when it is first created.

    Timo

  • How to manage the getter and setter in flex?

    I want to create getter and setter for a shared variable ways. How to create aid may be related?

    and how to call the accessor get and Set of a class of model?

    for ex:

    (1) in the IDMLEditor.mxml file

    [Bindable] public var currentDoc:IdmlDocument = null;

    private var _currentDoc:String;

    [Bindable]

    public function get currentDoc (): {IdmlDocument}

    return currentDoc;

    }

    public function set currentDoc (idmlDoc:IdmlDocument) {}

    this.currentDoc = idmlDoc;

    }

    (2) how to get from EditorModel.as?

    public class {EditorModel}

    [Bindable] public var currentDoc:IdmlDocument = null;

    You don't need to use underscore (_) to access the variable in the getter, setter class. You can immediately access the variable by using the name of the method

    myClass.currentDoc

    That's all

  • How focus a JavaFX Group properly and set the pivot (reverse) by using translations in 3D space?

    Description:

    I m referring to the Oracle tutorial http://docs.Oracle.com/JavaFX/2/transformations/jfxpub-transformations.htm using the transformations.zip source code, which is available for download on this page. I Don t understand why they Center the xylophone in space 3D like this and why they calculate the pivot (reverse) using translations. So they are creating a large number of groups, including rectangles, representing the xylophone, in addition to finally to a group called "cam".    

    class Cam extends Group {     
         Translate t  = new Translate();     
         Translate p  = new Translate();     
         Translate ip = new Translate();     
         Rotate rx = new Rotate();     
         { rx.setAxis(Rotate.X_AXIS); }     
         Rotate ry = new Rotate();     
         { ry.setAxis(Rotate.Y_AXIS); }     
         Rotate rz = new Rotate();     
         { rz.setAxis(Rotate.Z_AXIS); }     
         Scale s = new Scale();     
         public Cam() { 
              super(); getTransforms().addAll(t, p, rx, rz, ry, s, ip); 
         }     
    }    
    
    final Cam camOffset = new Cam();    
    final Cam cam = new Cam();    
    ...    
    camOffset.getChildren().add(cam);    
    ...    
    final Scene scene = new Scene(camOffset, 800, 600, true);    
    ... 
    

    The Group "cam" is added to another group called "camOffset", which is added to the 'scene' as root the node.

    Until there , everything is understandable to me, but there is a method, called "frameCam (.)" which calls 4 other methods: ""

    public void setCamOffset(final Cam camOffset, final Scene scene) {         
         double width = scene.getWidth();         
         double height = scene.getHeight();         
         camOffset.t.setX(width/2.0);         
         camOffset.t.setY(height/2.0);     
    }    
    
    //=========================================================================    
    // setCamScale    
    //=========================================================================    
    
    public void setCamScale(final Cam cam, final Scene scene) {        
         final Bounds bounds = cam.getBoundsInLocal();         
         final double pivotX = bounds.getMinX() + bounds.getWidth()/2;         
         final double pivotY = bounds.getMinY() + bounds.getHeight()/2;         
         final double pivotZ = bounds.getMinZ() + bounds.getDepth()/2;         
         double width = scene.getWidth();         
         double height = scene.getHeight();         
         double scaleFactor = 1.0;         
         double scaleFactorY = 1.0;         
         double scaleFactorX = 1.0;         
    if (bounds.getWidth() > 0.0001) {            
         scaleFactorX = width / bounds.getWidth(); // / 2.0;        
    }        
    if (bounds.getHeight() > 0.0001) {            
         scaleFactorY = height / bounds.getHeight(); //  / 1.5;         
    }        
    if (scaleFactorX > scaleFactorY) {            
         scaleFactor = scaleFactorY;         
    } else {            
         scaleFactor = scaleFactorX;         
    }        
         cam.s.setX(scaleFactor);         
         cam.s.setY(scaleFactor);         
         cam.s.setZ(scaleFactor);     
    }    
    
    //=========================================================================    
    // setCamPivot    
    //=========================================================================    
    
    public void setCamPivot(final Cam cam) {        
         final Bounds bounds = cam.getBoundsInLocal();         
         final double pivotX = bounds.getMinX() + bounds.getWidth()/2;         
         final double pivotY = bounds.getMinY() + bounds.getHeight()/2;        
        final double pivotZ = bounds.getMinZ() + bounds.getDepth()/2;         
    
    //*1*        
         cam.p.setX(pivotX);         
         cam.p.setY(pivotY);         
         cam.p.setZ(pivotZ);         
    //*1*        
    
    //*2*        
         cam.ip.setX(-pivotX);         
         cam.ip.setY(-pivotY);         
         cam.ip.setZ(-pivotZ);         
    //*2*     }    
    
    //=========================================================================    
    // setCamTranslate    
    //=========================================================================    
    
    public void setCamTranslate(final Cam cam) {        
         final Bounds bounds = cam.getBoundsInLocal();         
         final double pivotX = bounds.getMinX() + bounds.getWidth()/2;         
         final double pivotY = bounds.getMinY() + bounds.getHeight()/2;         
         cam.t.setX(-pivotX);         
         cam.t.setY(-pivotY);     
    } 
    

    If the method ' setCamScale (...) 'is understandable,' setCamOffset (...) ' puts the root node ('camOffset') in the center of the screen, but I Don t understand the 2 following methods at all. Of course, the child ("cam") is not centered, by putting just the root node ('camOffset') in the center of the screen, but how they focus the xylophone / "cam" and set the pivot, using translations:

    Questions:

    1. Why they use 3 different translations (', 'ip', 'p')?
    2. Referring to ' setCamPivot (...) ': Why they are the first translation of 'cam.p' to "pivotX", 'pivotY' and 'pivotZ' and then 'cam.ip' to '-pivotX', '-pivotY' and '-pivotZ' (marked in the source code with * 1 * and * 2 *)? Should he not just put the Group at his position, where it has been positioned before, as if the method has never been called? That would be my guess, because I expect that an object is placed in the same position as before, if I first move with the values X, Y, Z and then return with the same values - X, - Y, - Z in the opposite direction.
    3. Even with the method ' setCamTranslate (...) ' ': Why use another translation "cam.t", moving the Group ("cam") with the same values "-pivotX', '-pivotY' (and not '-pivotZ'), which they used in the"setCamPivot (...) method `?

    Annotations:

    Of course it works, the xylophone is located in the center of the screen and could turn perfectly, without change of rotation point / pivot point, but I Don t understand how they did it. I read everything about layoutBound, boundsInLocal, boundsInParent, blogs about page layout and page layout goes into javaFX https://blogs.oracle.com/jfxprg/entry/the_peculiarities_of_javafx_layout and http://amyfowlersblog.wordpress.com/2011/06/02/javafx2-0-layout-a-class-tour/ and finally a large number of questions to stackoverflow, but I still Don t understand the meaning behind the methods stated.

    Before the call of ' frameCam (...) ', they ask:

    double halfSceneWidth = 375;  // scene.getWidth()/2.0;     
    double halfSceneHeight = 275;  // scene.getHeight()/2.0;    
    cam.p.setX(halfSceneWidth);    
    cam.ip.setX(-halfSceneWidth);    
    cam.p.setY(halfSceneHeight);    
    cam.ip.setY(-halfSceneHeight); 
    

    I deleted these lines, because it doesn't change anything.

    The base in place, is that there are three defined different rotations, one around each axis. Of course, these could be combined into a single rotation, but doing so would make the geometry in the mouse dragging very complex managers. As it is, the degree of rotation around each axis can be calculated and changed independently.

    In general, the rotations are defined by an angle, an axis and a (pivot) point. The axis is a 3D vector and goes through the pivot point; the rotation is around this axis through that point.

    In the configuration in the example, the pivot of each of the individual rotations is set to the default (0,0,0). Because we really want the rotation to be around the center of the group, not the original, the Group translates first point appropriate pivot (ip), the rotations are applied then (around (0,0,0) after translation by ip), then the group is reflected in its location of origin (p). These operations are not commutative, yes show ip, then the rotation, then p is not the same as when you run ip, then p, then the rotation (in the second, ip and p would cancel and rotation would be about (0,0,0) instead of around the Center).

    For good measure, there is a scale, that is also applied after ip (so that scaling occurs from the Center, not the original) and then a final translation.

    The final effect is that there is a lot of transformations that can be controlled independently. There is a scale (s), a rotation about each axis (rx, ry, rz), and a translation (t). The p in translations and its inverse ip are just "housekeeping" to ensure that rotation and scaling are done from the center of the screen, instead of (0,0,0).

    So:

    1. Why they use 3 different translations (', 'ip', 'p')?

    p and ip are translations for the rotation and scaling are done from the Center and not to the origin. t is a general translation, the user sees.

    Referring to ' setCamPivot (...) ': Why they are the first translation of 'cam.p' to "pivotX", 'pivotY' and 'pivotZ' and then 'cam.ip' to '-pivotX', '-pivotY' and '-pivotZ' (marked in the source code with * 1 * and * 2 *)? Should he not just put the Group at his position, where it has been positioned before, as if the method has never been called?

    He puts the group to its original position, but other changes are between p and ip. These transformations behave differently (in a planned way) because the group is translated when they are applied.

    Even with the method ' setCamTranslate (...) ' ': Why use another translation "cam.t", moving the Group ("cam") with the same values "-pivotX', '-pivotY' (and not '-pivotZ'), which they used in the"setCamPivot (...) method `?

    The t values are changed in the mouse Manager (with alt-middle mouse button-drag, which I can't test actually using my trackpad...). As you have noted, the effect of p and IP translation cancel out, so we end up with t, which can be changed by the user. They could have combined t and p a single transformation, but updated since the mouse Manager would have been more delicate, and the intent of the code would be less clear.

  • Create bookmark and set the Page Destination Script

    Greetings,

    I created a batch Script that will create children bookmarks and set the destination page.

    Bookmarks are listed in the script in the order in which they appear in ascending order.  (for example, Name1, name2, Name3, name4)

    However, once the script is run, the bookmarks are inserted in descending order. for example (Name3, name4, Name1, name2).

    Can someone advise please how do I get the script to create bookmarks in ascending order, as noted in the script?

    var bm =
    this.bookmarkRoot.createChild ("Name1", "this.pageNum = 0");
    this.bookmarkRoot.createChild ("Name2", "this.pageNum = 1");
    this.bookmarkRoot.createChild ("Name3", "this.pageNum = 2");
    this.bookmarkRoot.createChild ("Conjoint4", "this.pageNum = 3");

    var bm = this.bookmarkRoot.children [0];

    BM. Color = color.red;

    The script should also be changed to all bookmarks in red color.  The script for color bookmarks only works on the first bookmark.  Any intervention on changing the script for this would be most appreciated as well?

    Thank you.

    Use something like this:

    var bm;

    this.bookmarkRoot.createChild ("Bill Smith","this.pageNum = 0", 0);

    BM = this.bookmarkRoot.children [0];

    BM. Color = color.red;

    this.bookmarkRoot.createChild ("David Smith", "this.pageNum = 1", 1 ");

    BM = this.bookmarkRoot.children [1];

    BM. Color = color.red;

  • How can I enter BIOS compaq610 screen and set the date, time

    How can I enter BIOS compaq610 screen and set the date, time

    Hello

    See Page 94 or Page 100 (according to what's relevant) of your & Maintenance Guide.

    Kind regards

    DP - K

  • How to get and install the file txtsetup.oem for xp

    need to know how to get and install the txtsetup.oem file to install xp

    Hello

    The easiest way would be to visit the website of the manufacturer of the motherboard. This would normally have downloads for any RAID drivers required for the loading of Windows XP. The download can be an "executable" who writes a disk for you. It can be also something like a zip file with all files inside that must be extracted and copied to a floppy disk.

    If your PC is not a floppy drive, life becomes quite complicated.

    Please mark this as useful or response if applicable.

    Tricky

  • Can any can give Live or online app Development on QNX IDE support and setting the goal as device Bb10. run the application etc?

    Can any can give Live or online app Development on QNX IDE support and setting the goal as device Bb10. run the application etc?

    The best way is to start basic: https://developer.blackberry.com/cascades/documentation/getting_started/index.html

  • PANTONE + does not match the previous Pantone spot color chart. I have several customers who are using spot colors in logos etc and now these colors are a mess. Can I get and use the old color for Illustrator books?

    PANTONE + does not match the previous Pantone spot color chart. I have several customers who are using spot colors in logos etc and now these colors are a mess. Can I get and use the old color for Illustrator books?

    Well, the spot color has not changed, but the way they were simulated four-color changed, they now use color management to get to the nearest ink possible task.

    Here is some info:

    https://helpx.Adobe.com/Illustrator/KB/PANTONE-plus.html

  • I need something to smooth out grainy photos and set the color.  I have several photos that I need to use which has a blue cast on them.  Photoshop will remove the color blue?  I need an answer immediately.

    I need something to smooth out grainy photos and set the color.  I have several photos that I need to use which has a blue cast on them.  Photoshop will remove the color blue?  I need an answer immediately.

    Yes, photoshop can remove noise and remove color casts

  • Can I buy 5 LightRoom and set the language for the Portuguese (Brazilian)?

    Can I buy 5 LightRoom and set the language for the Portuguese (Brazilian)?

    Yes, https://www.adobe.com/cfusion/tdrc/index.cfm?product=photoshop_lightroom

Maybe you are looking for

  • Review of the model M40-237

    Hi friends, You want to get an idea on the model of Satellite-M40-237. Is this good?

  • Windows xp routing table problem

    I'm having a problem with windows routing tables on the pc at my workplace.These computers are running windows xp sp3 and the problem occurs when I change the default gateway the PCs are on subnet 10.181.1.0/24 with d/g 10.181.1.11.with this configur

  • Cannot access Windows Live Mail: 'album photo editing.

    Try to send a picture, watch box 'edition photo album' message and I can't get out of this to access my box. It also means that I can't send e-mails from the photo. [Original title: cannot access Windows Live Mail]

  • ADR Dst and SRC Addr filter

    WHT is the syntax of the format/specify IP addresses in the filter Src Addr and Dst ADR filter fileds any signature? If I can put a subnet, several subnets, etc.? examples of syntax? I can't put the $ is white, I discovered.

  • BlackBerry Smartphones East Asian language support

    Hi all I just got a new Torch 9800 and I have until now very happy with it. The only thing that I found quite annoying in comparison with the iPhone I had before is that I don't know how I can install any support for entry of East Asian languages (Ch