Announcement

Collapse
No announcement yet.

Create xButtons with Raw and Colum

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Create xButtons with Raw and Colum

    Hello everyone.. i was trying to create a numbers of xbutton or button on startup using loop and create object but im having a problem to align the row under after specific count.
    can anyone help me?
    in my example it will create 15 buttons.
    see image attached and apz example or if you have another way to implement it that would be a great help.

    Thank you
    Telco
    Attached Files

  • #2


    Code:
    [ATTACH]n303390[/ATTACH]

    Comment


    • #3
      Thank you herrin

      Comment


      • #4
        Do you have any idea in making it using Loop? thanks

        Comment


        • #5


          Code:
          [ATTACH]n303394[/ATTACH]

          Comment


          • #6
            telco try this, we set x/y for buttons 1 , 6 & 11 then ADD 100

            Code:
            for i = 1, 15 do    
            
                xBtnProperties = {}    
                xBtnProperties.Enabled=true;
                xBtnProperties.Visible=true;
                xBtnProperties.Text="BEAT "..i;
                if i == 1 then
                    xBtnProperties.X=10;
                    xBtnProperties.Y=10;
                    elseif i >= 2 and i <= 5 then        
                
                        new = xButton.GetPos(btn).X+100;
                        xBtnProperties.X=new;
                        xBtnProperties.Y=10;    
                    elseif i == 6 then    
                        xBtnProperties.X=10;
                        xBtnProperties.Y=80;
                        
                    elseif i >= 7 and i <= 10 then
                        
                        
                        new = xButton.GetPos(btn).X+100;
                        xBtnProperties.X=new;
                        xBtnProperties.Y=80;
                    elseif i == 11 then    
                        xBtnProperties.X=10;
                        xBtnProperties.Y=150;    
                        
                    elseif i >= 12 and i <= 15 then
                        
                        new = xButton.GetPos(btn).X+100;
                        xBtnProperties.X=new;
                        xBtnProperties.Y=150;    
                                          
                    end
                
                xBtnProperties.Width=90;
                xBtnProperties.Height=60;
                Page.CreateObject(OBJECT_XBUTTON, "BEAT"..i, xBtnProperties);
                btn = xButton.GetProperties("BEAT"..i).ObjectName;    
             
            end
            Cheers

            Comment


            • #7
              charliechaps thanks for your code.. this is what i am trying to achieve..

              Comment


              • #8
                charliechaps
                Well coded. Efficient, succinct and demonstrative of some nice clean logic.
                Thanks for the contribution.

                Comment

                Working...
                X