Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    layout resize

    I'd like to know two things:

    1. Is there a way to get the width/height of the layout including the scroll-able area?

    2. Is there such a thing as layout resized event that I can add logic into when the layout changes size?

    #2
    1. getScrollHeight()/Width() is the complete scrollable area. Note this doesn't include the border (which does not scroll). See also getVisibleHeight()/Width().

    2. yes, the event is canvas.resized (applies to any Canvas).

    Comment


      #3
      Regarding #2, resized() does not seem to be called, but layoutChildren does. I guess there's a difference between overflow "auto" and overflow "visible"?

      Click on the button to add a child larger than the parent.

      Code:
      
      isc.setAutoDraw(false);
      
      isc.VLayout.create({
      ID:"vlayout1",width:300,height:300,overflow:"auto",autoDraw:true,backgroundColor:"blue",resized:function(){isc.warn('resized');}, layoutChildren: function(){isc.warn('layoutChildren');}
      })
      
      isc.VLayout.create({
      ID:"vlayout2",width:500,height:500
      
      })
      
      isc.Button.create({
      title:"add first child",autoDraw:true, left:500,backgroundColor:"red",click: function(){vlayout2.draw();vlayout1.addChild(vlayout2);vlayout2.show();}
      })

      Comment


        #4
        With overflow:"auto", the layout is not changing size (visible height/width), it's children are.

        Comment


          #5
          ah, I see...this may not work as a general solution for me then.

          I believe I have brought this up before, not 100% sure. Our client is displaying our application in an iframe and they want to automatically resize it when the application has changed in size (height mostly). I have access to the iframe and I can resize it no problem but I'm having trouble finding the hook for WHEN to resize it.

          Comment


            #6
            Terrible setup (we've covered this before) but generally, you'd leave the outermost layout overflow:visible and watch for it to resize.

            Comment

            Working...
            X