ScrollView

roarnold

Active Member
Licensed User
Longtime User
I have been looking at scrollview that has one panel but it is 720dip long. I set the scrollview to same. Attached label to anchor the scrollView.

B4X:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim ScrollView1 As ScrollView
   Dim Panel9 As Panel
   
   Dim btn27, btn28, btn29, btn43, btn44, btn45, btn30, btn43, btn44, btn45, btn46, btn47, btn48, btn49, btn50, btn51, btn52, btn53, btn54, btn55, btn56, btn57, btn58, btn59, btn60 As Button
   
   Dim level1button As ImageView 
   Dim level1buttonimage As Bitmap
   Dim level2button As ImageView 
   Dim level2buttonimage As Bitmap
   Dim level3button As ImageView
   Dim level3buttonimage As Bitmap
   
   
   
   Dim Label3, Label4, Label5, lblvisualized, label141, lbllength, lbllength1, lblheight1, lblwidth1, lblvolume1, lblvolumecm, lblrovary, lbllabel, lbllvisualized, lblllength1, lbllvolume1, lbllovolumecm  As Label
   Dim txtvisualized, txtlength, txtabnormal, txtheight, txtwidth, txtvolume, txtfibroids, txtendotk, txtsainfsono, txtabdomonial, txtvolumec1, txtllength, txtlwidth, txtlvolume, txtlvolumec1, lbllvolumecm As EditText
   
   
   
End Sub

Sub Activity_Create(FirstTime As Boolean)
   If FirstTime Then
      Main.hc.Initialize("hc")
      Activity.LoadLayout("adnexa") ' FROM GYN PAGE
   End If
   
      layit
      mscreen
End Sub
Sub mscreen
   
      Label3.Initialize("")
      Label3.Text = "OB Reporter Application"      
      Label3.TextColor = Colors.DarkGray
      Label3.TextSize = 14
      Activity.AddView(Label3, 70dip, 0dip, 300dip, 40dip)                               ' this is  header      
      
      Label4.Initialize("")
      Label4.Text = "GYN Adnexa"
      Label4.TextColor = Colors.DarkGray
      Label4.TextSize = 14
      Activity.AddView(Label4, 120dip, 20dip, 300dip, 40dip)
      
      Label5.Initialize("")
      Label5.Text = "@Cyber Storm Technologies Group 2011 - 2013          Partnership with Medicos Now" 
      Label5.TextColor = Colors.DarkGray
      Label5.TextSize = 8      
      Activity.AddView(Label5, 20dip, 470dip, 380dip, 40dip)                               ' this is footer
      
      label141.Initialize("")'  NEED TO SHOW IDMEDREC IN SCREEN
      label141.Text = currentpat.idmedrec
      label141.TextColor = Colors.Black
      label141.TextSize = 8
      Activity.AddView(label141, 10dip, 5dip, 150dip, 30dip)' medrec number to tie report info garthered
      
      Dim cld, cld1 As ColorDrawable         
        Panel9.Initialize ("Panel9")
 '       pnl9.Initialize ("pnl7")
      cld.Initialize ( Colors.RGB( 175, 238, 238) , 5dip )' left, top, width, height 
      Panel9.Background = cld
        Activity.AddView(Panel9, 10dip, 40dip, 320dip, 720dip) 

      lblrovary.Initialize("lblvisualized")
        lblrovary.Text = "Right Ovary: "
      lblrovary.TextColor = Colors.Black
      lblrovary.TextSize = 10
        Activity.AddView(lblrovary, 10dip, 40dip, 100dip, 30dip)
      
        lblvisualized.Initialize("lblvisualized")
        lblvisualized.Text = "Visualized: "
      lblvisualized.TextColor = Colors.Black
        lblvisualized.TextSize = 12
        Activity.AddView(lblvisualized, 10dip, 60dip, 100dip, 30dip) 
      
      btn43.Initialize("btn")
      btn43.tag = "43"
      btn43.Text = "Yes"
      btn43.TextSize = 6
      Activity.AddView(btn43, 150dip, 60dip, 40dip, 30dip)'left, top, width, height
      
      btn44.Initialize("btn")
      btn44.tag = "44"
      btn44.Text = "No"
      btn44.TextSize = 6
        Activity.AddView(btn44, 180dip, 60dip, 40dip, 30dip)
      
      btn45.Initialize("btn")
      btn45.tag = "45"
      btn45.Text = "N/A"
      btn45.TextSize = 6
      Activity.AddView(btn45, 210dip, 60dip, 40dip, 30dip)
      
      
      Dim lbllength As Label
        lbllength.Initialize("lbllength")
        lbllength.Text = "Length: "
      lbllength.TextColor = Colors.Black
        lbllength.TextSize = 12
        Activity.AddView(lbllength, 10dip, 90dip, 100dip, 30dip)
   
      txtlength.Initialize("txtlength")
      txtlength.Hint = "0"
      txtlength.TextSize = 10
      Activity.AddView(txtlength, 150dip, 90dip, 100dip, 30dip) 'done
      
      lbllength1.Initialize("lbllength1")
      lbllength1.Text = "cm"
      lbllength1.TextColor = Colors.Black
      lbllength1.TextSize = 9
      Activity.AddView(lbllength1, 250dip, 103dip, 100dip, 30dip)'left, top, width, height
      
      Dim lblheight As Label
        lblheight.Initialize("lblheight")
        lblheight.Text = "Height: "
      lblheight.TextColor = Colors.Black
        lblheight.TextSize = 12
        Activity.AddView(lblheight, 10dip, 120dip, 100dip, 30dip) ' left, top, width, height 
              
      txtheight.Initialize("txtheight")
        txtheight.Hint = "0" 
      txtheight.TextSize = 10
        Activity.AddView(txtheight, 150dip, 120dip, 100dip, 30dip)'-------------------
      
      lblheight1.Initialize("lblheight1")
      lblheight1.Text = "cm"
      lblheight1.TextColor = Colors.Black
      lblheight1.TextSize = 9
      Activity.AddView(lblheight1, 250dip, 133dip, 100dip, 30dip)'left, top, width, height
      
      Dim lblwidth As Label
        lblwidth.Initialize("lblwidth")
        lblwidth.Text = "Width: "
      lblwidth.TextColor = Colors.Black
        lblwidth.TextSize = 12
        Activity.AddView(lblwidth, 10dip, 150dip, 100dip, 30dip)
      
      txtwidth.Initialize("txtwidth")
      txtwidth.Hint = "0"
      txtwidth.TextSize = 10
      Activity.AddView(txtwidth, 150dip, 150dip, 100dip, 30dip) 'done
      
      lblwidth1.Initialize("lblwidth1")
      lblwidth1.Text = "cm"
      lblwidth1.TextColor = Colors.Black
      lblwidth1.TextSize = 9
      Activity.AddView(lblwidth1, 250dip, 163dip, 100dip, 30dip)'left, top, width, height

      Dim lblvolume As Label
        lblvolume.Initialize("lblvolume")
        lblvolume.Text = "Volume: "
      lblvolume.TextColor = Colors.Black
        lblvolume.TextSize = 12
        Activity.AddView(lblvolume, 10dip, 180dip, 100dip, 30dip)
      
      txtvolume.Initialize("txtvolume")
      txtvolume.Hint = "0"
      txtvolume.TextSize = 10
      Activity.AddView(txtvolume, 150dip, 180dip, 100dip, 30dip)'left, top, width, height

      lblvolume1.Initialize("lblvolume1")
      lblvolume1.Text = "cm" & Chr(179)
      lblvolume1.TextColor = Colors.Black
      lblvolume1.TextSize = 9
      Activity.AddView(lblvolume1, 250dip, 193dip, 100dip, 30dip)'left, top, width, height
       
      Dim lblcysts As Label
        lblcysts.Initialize("lblCysts")
        lblcysts.Text = "Cysts"
      lblcysts.TextColor = Colors.Black
        lblcysts.TextSize = 12
        Activity.AddView(lblcysts, 10dip, 210dip, 100dip, 30dip)
      
      btn46.Initialize("btn")
      btn46.tag = "46"
      btn46.Text = "Yes"
      btn46.TextSize = 6
      Activity.AddView(btn46, 150dip, 210dip, 40dip, 30dip)'left, top, width, height
      
      btn47.Initialize("btn")
      btn47.tag = "47"
      btn47.Text = "No"
      btn47.TextSize = 6
        Activity.AddView(btn47, 180dip, 210dip, 40dip, 30dip)
      
      btn48.Initialize("btn")
      btn48.tag = "48"
      btn48.Text = "N/A"
      btn48.TextSize = 6
      Activity.AddView(btn48, 210dip, 210dip, 40dip, 30dip)
      
      Dim lblcysize As Label
        lblcysize.Initialize("lblcysize")
        lblcysize.Text = "Cyst Size: "
      lblcysize.TextColor = Colors.Black
        lblcysize.TextSize = 12
        Activity.AddView(lblcysize, 10dip, 240dip, 100dip, 30dip)
      
      txtvolumec1.Initialize("txtvolumec1")'------------------------------------------------------------------------------1
      txtvolumec1.Hint = "0"
      txtvolumec1.TextSize = 10
      Activity.AddView(txtvolumec1, 10dip, 270dip, 40dip, 30dip)'left, top, width, height
      
      lblvolumecm.Initialize("lblvolumecm")
      lblvolumecm.Text = "cm" ' & Chr(179)
      lblvolumecm.TextColor = Colors.Black
      lblvolumecm.TextSize = 9
      Activity.AddView(lblvolumecm, 49dip, 283dip, 40dip, 30dip)'left, top, width, height-----------------------------------------
      
      txtvolumec1.Initialize("txtvolumec1")
      txtvolumec1.Hint = "0"
      txtvolumec1.TextSize = 10
      Activity.AddView(txtvolumec1, 140dip, 270dip, 40dip, 30dip)'left, top, width, height
      
      lblvolumecm.Initialize("lblvolumecm")
      lblvolumecm.Text = "cm" ' & Chr(179)
      lblvolumecm.TextColor = Colors.Black
      lblvolumecm.TextSize = 9
      Activity.AddView(lblvolumecm, 179dip, 283dip, 40dip, 30dip)'left, top, width, height----------------------------------------------------2
      
      txtvolumec1.Initialize("txtvolumec1")
      txtvolumec1.Hint = "0"
      txtvolumec1.TextSize = 10
      Activity.AddView(txtvolumec1, 250dip, 270dip, 40dip, 30dip)'left, top, width, height
      
      lblvolumecm.Initialize("lblvolumecm")
      lblvolumecm.Text = "cm" ' & Chr(179)
      lblvolumecm.TextColor = Colors.Black
      lblvolumecm.TextSize = 9
      Activity.AddView(lblvolumecm, 286dip, 283dip, 40dip, 30dip)'left, top, width, height------------------------------------------------------3
      
      Dim lbltube As Label
        lbltube.Initialize("lbltube")
        lbltube.Text = "Tube visualized"
      lbltube.TextColor = Colors.Black
        lbltube.TextSize = 12
        Activity.AddView(lbltube, 10dip, 315dip, 100dip, 30dip)
      
      btn49.Initialize("btn")
      btn49.tag = "49"
      btn49.Text = "Yes"
      btn49.TextSize = 6
      Activity.AddView(btn49, 150dip, 310dip, 40dip, 30dip)'left, top, width, height                           Tube
      
      btn50.Initialize("btn")
      btn50.tag = "50"
      btn50.Text = "No"
      btn50.TextSize = 6
        Activity.AddView(btn50, 180dip, 310dip, 40dip, 30dip)
      
      btn51.Initialize("btn")
      btn51.tag = "51"
      btn51.Text = "N/A"
      btn51.TextSize = 6
      Activity.AddView(btn51, 210dip, 310dip, 40dip, 30dip)' --------------------------------------------------------------------------------------
      
      Dim lblabnorfd As Label
        lblabnorfd.Initialize("lbltube")
        lblabnorfd.Text = "Abnormal findings"
      lblabnorfd.TextColor = Colors.Black
        lblabnorfd.TextSize = 12
        Activity.AddView(lblabnorfd, 10dip, 345dip, 140dip, 30dip)
      
      btn52.Initialize("btn")
      btn52.tag = "52"
      btn52.Text = "Yes"
      btn52.TextSize = 6
      Activity.AddView(btn52, 150dip, 340dip, 40dip, 30dip)'left, top, width, height                           Abnormal findings
      
      btn53.Initialize("btn")
      btn53.tag = "53"
      btn53.Text = "No"
      btn53.TextSize = 6
        Activity.AddView(btn53, 180dip, 340dip, 40dip, 30dip)
      
      btn54.Initialize("btn")
      btn54.tag = "54"
      btn54.Text = "N/A"
      btn54.TextSize = 6
      Activity.AddView(btn54, 210dip, 340dip, 40dip, 30dip)' ----------------------------------------2nd Page
      
      Dim lblline As EditText
      lblline.Initialize("")
      lblline.TextColor = Colors.Black
      Activity.AddView(lblline, 10dip, 370dip, 400dip, 2dip)'   line tom seperate areas
      
      
      
      '------------------------------------------------------------------------------------------------ Second Page Left Ovary
      Dim lbllovary As Label
        lbllovary.Initialize("lbllovary")
        lbllovary.Text = "Left Ovary"
      lbllovary.TextColor = Colors.Black
        lbllovary.TextSize = 12
        Activity.AddView(lbllovary, 10dip, 380dip, 140dip, 30dip)'left, top, width, height
      
      lbllvisualized.Initialize("lblvisualized")
        lbllvisualized.Text = "Visualized: "
      lbllvisualized.TextColor = Colors.Black
        lbllvisualized.TextSize = 12
        Activity.AddView(lbllvisualized, 10dip, 430dip, 140dip, 30dip) 
      
      btn55.Initialize("btn")
      btn55.tag = "55"
      btn55.Text = "Yes"
      btn55.TextSize = 6
      Activity.AddView(btn55, 150dip, 430dip, 40dip, 30dip)'left, top, width, height
      
      btn56.Initialize("btn")
      btn56.tag = "56"
      btn56.Text = "No"
      btn56.TextSize = 6
        Activity.AddView(btn56, 180dip, 430dip, 40dip, 30dip)
      
      btn57.Initialize("btn")
      btn57.tag = "btn57"
      btn57.Text = "N/A"
      btn57.TextSize = 6
      Activity.AddView(btn57, 210dip, 430dip, 40dip, 30dip)
      
      
      Dim lblllength As Label
        lblllength.Initialize("lblllength")
        lblllength.Text = "Length: "
      lblllength.TextColor = Colors.Black
        lblllength.TextSize = 12
        Activity.AddView(lblllength, 10dip, 450dip, 140dip, 30dip)
   
      txtllength.Initialize("txtllength")
      txtllength.Hint = "0"
      txtllength.TextSize = 10
      Activity.AddView(txtllength, 150dip, 450dip, 100dip, 30dip) 'done
      
      lblllength1.Initialize("lbllength1")
      lblllength1.Text = "cm"
      lblllength1.TextColor = Colors.Black
      lblllength1.TextSize = 9
      Activity.AddView(lblllength1, 460dip, 450dip, 100dip, 30dip)'left, top, width, height    
      
      Dim lbllheight As Label
        lbllheight.Initialize("lbllheight")
        lbllheight.Text = "Height: "
      lbllheight.TextColor = Colors.Black
        lblheight.TextSize = 10
        Activity.AddView(lbllheight, 10dip, 480dip, 100dip, 30dip) ' left, top, width, height 
              
      txtheight.Initialize("txtheight")
        txtheight.Hint = "0" 
      txtheight.TextSize = 10
        Activity.AddView(txtheight, 150dip, 480dip, 100dip, 30dip)'-------------------
      
      lblheight1.Initialize("lblheight1")
      lblheight1.Text = "cm"
      lblheight1.TextColor = Colors.Black
      lblheight1.TextSize = 9
      Activity.AddView(lblheight1, 495dip, 480dip, 100dip, 30dip)'left, top, width, height
      
      Dim lbllwidth As Label
        lbllwidth.Initialize("lbllwidth")
        lbllwidth.Text = "Width: "
      lbllwidth.TextColor = Colors.Black
        lbllwidth.TextSize = 10
        Activity.AddView(lbllwidth, 10dip, 510dip, 100dip, 30dip)
      
      txtlwidth.Initialize("txtwidth")
      txtlwidth.Hint = "0"
      txtlwidth.TextSize = 10
      Activity.AddView(txtlwidth, 150dip, 510dip, 100dip, 30dip) 'done
      
      lblwidth1.Initialize("lblwidth1")
      lblwidth1.Text = "cm"
      lblwidth1.TextColor = Colors.Black
      lblwidth1.TextSize = 9
      Activity.AddView(lblwidth1, 565dip, 510dip, 100dip, 30dip)'left, top, width, height

      Dim lbllvolume As Label
        lbllvolume.Initialize("lbllvolume")
        lbllvolume.Text = "Volume: "
      lbllvolume.TextColor = Colors.Black
        lbllvolume.TextSize = 12
        Activity.AddView(lbllvolume, 10dip, 540dip, 100dip, 30dip)
      
      txtlvolume.Initialize("txtlvolume")
      txtlvolume.Hint = "0"
      txtlvolume.TextSize = 10
      Activity.AddView(txtlvolume, 150dip, 450dip, 100dip, 30dip)'left, top, width, height

      lbllvolume1.Initialize("lbllvolume1")
      lbllvolume1.Text = "cm" & Chr(179)
      lbllvolume1.TextColor = Colors.Black
      lbllvolume1.TextSize = 9
      Activity.AddView(lbllvolume1, 565dip, 540dip, 100dip, 30dip)'left, top, width, height
       
      Dim lbllcysts As Label
        lbllcysts.Initialize("lbllCysts")
        lbllcysts.Text = "Cysts"
      lbllcysts.TextColor = Colors.Black
        lbllcysts.TextSize = 12
        Activity.AddView(lbllcysts, 10dip, 570dip, 100dip, 30dip)
      
      btn58.Initialize("btn")
      btn58.tag = "58"
      btn58.Text = "Yes"
      btn58.TextSize = 6
      Activity.AddView(btn58, 150dip, 570dip, 40dip, 30dip)'left, top, width, height
      
      btn59.Initialize("btn")
      btn59.tag = "59"
      btn59.Text = "No"
      btn59.TextSize = 6
        Activity.AddView(btn59, 180dip, 570dip, 40dip, 30dip)
      
      btn60.Initialize("btn")
      btn60.tag = "60"
      btn60.Text = "N/A"
      btn60.TextSize = 6
      Activity.AddView(btn60, 210dip, 570dip, 40dip, 30dip)
      
      Dim lbllcysize As Label
        lbllcysize.Initialize("lbllcysize")
        lbllcysize.Text = "Cyst Size: "
      lbllcysize.TextColor = Colors.Black
        lbllcysize.TextSize = 12
        Activity.AddView(lbllcysize, 10dip, 600dip, 100dip, 30dip)
      
      txtlvolumec1.Initialize("txtlvolumec1")'------------------------------------------------------------------------------1
      txtlvolumec1.Hint = "0"
      txtlvolumec1.TextSize = 10
      Activity.AddView(txtlvolumec1, 10dip, 600dip, 40dip, 30dip)'left, top, width, height
      
      lbllvolumecm.Initialize("lbllvolumecm")
      lbllvolumecm.Text = "cm" ' & Chr(179)
      lbllvolumecm.TextColor = Colors.Black
      lbllvolumecm.TextSize = 9
      Activity.AddView(lbllvolumecm, 665dip, 600dip, 40dip, 30dip)'left, top, width, height-----------------------------------------
      
      txtlvolumec1.Initialize("txtlvolumec1")
      txtlvolumec1.Hint = "0"
      txtlvolumec1.TextSize = 10
      Activity.AddView(txtlvolumec1, 700dip, 600dip, 40dip, 30dip)'left, top, width, height
      
      lbllovolumecm.Initialize("lbllovolumecm")
      lbllovolumecm.Text = "cm" ' & Chr(179)
      lbllovolumecm.TextColor = Colors.Black
      lbllovolumecm.TextSize = 9
      Activity.AddView(lbllovolumecm, 719dip, 600dip, 40dip, 30dip)'left, top, width, height----------------------------------------------------2
      
      txtlvolumec1.Initialize("txtlvolumec1")
      txtlvolumec1.Hint = "0"
      txtlvolumec1.TextSize = 10
      Activity.AddView(txtlvolumec1, 650dip, 630dip, 40dip, 30dip)'left, top, width, height
      
      lblvolumecm.Initialize("lblvolumecm")
      lblvolumecm.Text = "cm" ' & Chr(179)
      lblvolumecm.TextColor = Colors.Black
      lblvolumecm.TextSize = 9
      Activity.AddView(lblvolumecm, 646dip, 630dip, 40dip, 30dip)'left, top, width, height------------------------------------------------------3
      
      Dim lblltube As Label
        lblltube.Initialize("lblltube")
        lblltube.Text = "Tube visualized"
      lblltube.TextColor = Colors.Black
        lblltube.TextSize = 12
        Activity.AddView(lblltube, 10dip, 660dip, 100dip, 30dip)
      
      btn49.Initialize("btn")
      btn49.tag = "49"
      btn49.Text = "Yes"
      btn49.TextSize = 6
      Activity.AddView(btn49, 150dip, 660dip, 40dip, 30dip)'left, top, width, height                           Tube
      
      btn50.Initialize("btn")
      btn50.tag = "50"
      btn50.Text = "No"
      btn50.TextSize = 6
        Activity.AddView(btn50, 180dip, 660dip, 40dip, 30dip)
      
      btn51.Initialize("btn")
      btn51.tag = "51"
      btn51.Text = "N/A"
      btn51.TextSize = 6
      Activity.AddView(btn51, 210dip, 660dip, 40dip, 30dip)' --------------------------------------------------------------------------------------
      
      Dim lbllabnorfd As Label
        lbllabnorfd.Initialize("lbltube")
        lbllabnorfd.Text = "Abnormal findings"
      lbllabnorfd.TextColor = Colors.Black
        lbllabnorfd.TextSize = 12
        Activity.AddView(lbllabnorfd, 10dip, 690dip, 140dip, 30dip)
      
      btn52.Initialize("btn")
      btn52.tag = "52"
      btn52.Text = "Yes"
      btn52.TextSize = 6
      Activity.AddView(btn52, 150dip, 690dip, 40dip, 30dip)'left, top, width, height                           Abnormal findings
      
      btn53.Initialize("btn")
      btn53.tag = "53"
      btn53.Text = "No"
      btn53.TextSize = 6
        Activity.AddView(btn53, 180dip, 690dip, 40dip, 30dip)
      
      btn54.Initialize("btn")
      btn54.tag = "54"
      btn54.Text = "N/A"
      btn54.TextSize = 6
      Activity.AddView(btn54, 210dip, 690dip, 40dip, 30dip)' ----------------------------------------2nd Page
      
      Dim EditText1 As EditText
      EditText1.Initialize("")
      EditText1.TextSize = 8dip
      EditText1.Wrap = True
      EditText1.Hint = "Comment"
      Activity.AddView(EditText1, 10dip, 860dip, 300dip, 80dip) ' COMMENT SECTION
      
      
      
      
      
      btn27.Initialize("btn") 
      btn27.Tag = "27"
      Log(btn27.Tag)
        btn27.Text = "Back"
      btn27.TextSize = 10
        Activity.AddView(btn27,0dip, 0dip, 50dip, 30dip)
      
      btn28.Initialize("btn") 
      btn28.Tag = "28"
      Log(btn28.Tag)
        btn28.Text = "Save"
      btn28.TextSize = 10
        Activity.AddView(btn28,270dip, 0dip, 50dip, 30dip)

End Sub
Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Sub layit
      
        level1buttonimage.Initialize(File.DirAssets, "homeicon.png")
         level1button.Initialize("level1")
        level1button.Bitmap=level1buttonimage
        Activity.AddView(level1button, 90dip, 430dip, 30dip, 30dip)
             
        level2buttonimage.Initialize(File.DirAssets, "settingsicon.png")' 20dip, 420dip, 380dip, 40dip footer numbers
         level2button.Initialize("level2")
        level2button.Bitmap=level2buttonimage
        Activity.AddView(level2button, 150dip, 430dip, 30dip, 30dip)
        
        level3buttonimage.Initialize(File.DirAssets, "abouticon.png")         
        level3button.Initialize("level3")
        level3button.Bitmap=level3buttonimage
        Activity.AddView(level3button, 210dip, 430dip, 30dip, 30dip)
      
End Sub
Sub btn_Click
      Dim Send As Button
      Send = Sender
    
      Log(Send)
        Select Send.Tag
           Case "27"
            btn27.Initialize("btn") 
            btn27.Tag = "27"
            Log(btn27.Tag)
              btn27.Text = "Back"
            btn27.TextSize = 10
              Activity.AddView(btn27,0dip, 0dip, 50dip, 30dip)
            
           Case "28"
               Log("Save") 
            Chk_Save      '            POPUP GOES HERE
                
                     
         Case "43"   '---------------------------------------------------------------------------------------------------      
'            
               Dim cld0 As ColorDrawable
               btn43.Initialize("btn")
'               cld0.Initialize ( Colors.RGB(34, 139, 34) , 3dip )
               btn43.Gravity = Gravity.CENTER
'               btn31.Background = cld0
               btn43.TextSize = 8
               btn43.TextColor = Colors.Green
                 btn43.Text = "√"
            
               Activity.AddView(btn43, 150dip, 50dip, 40dip, 30dip)
'                
         Case "44"
               Dim cld0 As ColorDrawable
               btn44.Initialize("btn")
               'cld0.Initialize ( Colors.RGB(34, 139, 34) , 5dip )'                            Vizualized
               btn44.Gravity = Gravity.CENTER
               'btn32.Background = cld0
               btn44.TextSize = 8
               btn44.TextColor = Colors.Green
                  btn44.Text = "√"
               Activity.AddView(btn44, 180dip, 50dip, 40dip, 30dip)
'                
         Case "45"  
               Dim cld0 As ColorDrawable
               btn45.Initialize("btn")
               'cld0.Initialize ( Colors.RGB( 34, 139, 34) , 5dip )
               btn45.Gravity = Gravity.CENTER
               'btn33.Background = cld0
               btn45.TextSize = 8
               btn45.TextColor = Colors.Green
                 btn45.Text = "√"
               Activity.AddView(btn45, 210dip, 50dip, 40dip, 30dip)
            
         Case "46" '---------------------------------------------------------------------------------------------------------
'            
               Dim cld0 As ColorDrawable
               btn46.Initialize("btn")
               'cld0.Initialize ( Colors.RGB(34, 139, 34) , 5dip )
               btn46.Gravity = Gravity.CENTER
               'btn46.Background = cld0
               btn46.TextSize = 8
               btn46.TextColor = Colors.Green
                 btn46.Text = "√"
            
               Activity.AddView(btn46, 150dip, 200dip, 40dip, 30dip)
'                
         Case "47"
               Dim cld0 As ColorDrawable
               btn47.Initialize("btn")
               'cld0.Initialize ( Colors.RGB( 34, 139, 34) , 5dip )'                             cysts
               btn47.Gravity = Gravity.CENTER
               'btn47.Background = cld0
               btn47.TextSize = 8
               btn47.TextColor = Colors.Green
                  btn47.Text = "√"
                Activity.AddView(btn47, 180dip, 200dip, 40dip, 30dip)'
'                
         Case "48"  
               Dim cld0 As ColorDrawable
               btn48.Initialize("btn")
               'cld0.Initialize ( Colors.RGB( 34, 139, 34) , 5dip )
               btn48.Gravity = Gravity.CENTER
               'btn48.Background = cld0
               btn48.TextSize = 8
               btn48.TextColor = Colors.Green
                 btn48.Text = "√"
               Activity.AddView(btn48, 210dip, 200dip, 40dip, 30dip)
               
         Case "49" '---------------------------------------------------------------------------------------------------------
'            
               Dim cld0 As ColorDrawable
               btn49.Initialize("btn")
               'cld0.Initialize ( Colors.RGB(34, 139, 34) , 5dip )
               btn49.Gravity = Gravity.CENTER
               'btn49.Background = cld0
               btn49.TextSize = 8
               btn49.TextColor = Colors.Green
                 btn49.Text = "√"
               Activity.AddView(btn49, 150dip, 200dip, 40dip, 30dip)
'                
         Case "50"
               Dim cld0 As ColorDrawable
               btn50.Initialize("btn")
               'cld0.Initialize ( Colors.RGB( 34, 139, 34) , 5dip )'                             tube vis
               btn50.Gravity = Gravity.CENTER
               'btn50.Background = cld0
               btn50.TextSize = 8
               btn50.TextColor = Colors.Green
                  btn50.Text = "√"
                Activity.AddView(btn50, 180dip, 200dip, 40dip, 30dip)'
'                
         Case "51"  
               Dim cld0 As ColorDrawable
               btn51.Initialize("btn")
               'cld0.Initialize ( Colors.RGB( 34, 139, 34) , 5dip )
               btn51.Gravity = Gravity.CENTER
               'btn51.Background = cld0
               btn51.TextSize = 8
               btn51.TextColor = Colors.Green
                 btn51.Text = "√"
               Activity.AddView(btn51, 210dip, 200dip, 40dip, 30dip)
               
               
               
         Case "52" '---------------------------------------------------------------------------------------------------------
'            
               Dim cld0 As ColorDrawable
               btn52.Initialize("btn")
               'cld0.Initialize ( Colors.RGB(34, 139, 34) , 5dip )
               btn52.Gravity = Gravity.CENTER
               'btn52.Background = cld0
               btn52.TextSize = 8
               btn52.TextColor = Colors.Green
                 btn52.Text = "√"
            
               Activity.AddView(btn52, 150dip, 200dip, 40dip, 30dip)
'                
         Case "53"
               Dim cld0 As ColorDrawable
               btn53.Initialize("btn")
               'cld0.Initialize ( Colors.RGB( 34, 139, 34) , 5dip )'                            abnormal find
               btn53.Gravity = Gravity.CENTER
               'btn53.Background = cld0
               btn53.TextSize = 8
               btn53.TextColor = Colors.Green
                  btn53.Text = "√"
                Activity.AddView(btn53, 180dip, 200dip, 40dip, 30dip)'
'                
         Case "54"  
               Dim cld0 As ColorDrawable
               btn54.Initialize("btn")
               'cld0.Initialize ( Colors.RGB( 34, 139, 34) , 5dip )
               btn54.Gravity = Gravity.CENTER
               'btn54.Background = cld0
               btn54.TextSize = 8
               btn54.TextColor = Colors.Green
                 btn54.Text = "√"
               Activity.AddView(btn54, 210dip, 200dip, 40dip, 30dip)      
               
               
            
         Return
      End Select
End Sub
Sub level1_Click
   Activity.Finish                            'Home
   Activity.RequestFocus
   Activity.LoadLayout("3SelectionList")
   Return True    
End Sub

Sub level2_Click
   Activity.Finish                            'Settings
   Activity.RequestFocus
   StartActivity("settings")   
End Sub

Sub level3_Click

   Activity.Finish                           'About
   Activity.LoadLayout("about")
   StartActivity("about")    
End Sub      
Sub Chk_Save
            Dim pnl6 As Panel
                pnl6.Initialize(pnl6)
            Dim cld As ColorDrawable
             cld.Initialize ( Colors.RGB( 135, 206, 250) , 5dip )

             pnl6.Background = cld 
   

            Dim lbl As Label
             lbl.Initialize(lbl)
             lbl.TextColor = Colors.Black '(pnl6.Color)
             lbl.Text = "     Sure you want to" & CRLF & "      Save this File?"
            
             
            Activity.AddView(pnl6, 80dip, 110dip, 180dip, 100dip)
            Activity.AddView(lbl, 90dip, 120dip, 200dip, 150dip)
            
            btn29.Initialize("bttn") 
            btn29.Tag = "29"
            btn29.Text = "No"
            btn29.TextSize = 10
            Activity.AddView(btn29, 90dip, 160dip, 60dip, 40dip)' left, top, width, height
               
            btn30.Initialize("bttn") 
            btn30.Tag = "30"
            Log(btn30.Tag)
             btn30.Text = "Yes"
            btn30.TextSize = 10
            Activity.AddView(btn30, 180dip, 160dip, 60dip, 40dip)
End Sub
Sub ScrollView1_ScrollChanged(Position As Int)
   Label3.Text = Position
   ScrollView1.Panel9.Height = 720dip
   ScrollView1.Panel9.AddView(Panel9, 10dip, 40dip, 320dip, 720dip) 
   ScrollView1.RemoveView
   Panel9.AddView(ScrollView1,10dip, 40dip, 320dip, 720dip)
   ScrollView1.SendToBack
   
   
End Sub
Sub PanelEvent_Click
Dim p As Panel
    p = Sender
End Sub
'
'Created by Ron Arnold on 02/18/13.
'Copyright (c) 2011 - 2013 __Cyber Storm Technologies Group__. All rights reserved.


When Compiling I receive the following error:

Parsing code. 0.15
Compiling code. Error
Error compiling program.
Error description: Unknown member: panel9
Occurred on line: 791
ScrollView1.Panel9.Height = 720dip
Word: panel9


THe Panel9 is declared as is the ScrollView.

:BangHead:

R
 

stevel05

Expert
Licensed User
Longtime User
A ScrollView has it's own panel that you access as:

B4X:
ScrollView1.Panel

It's height is set in the initialization

B4X:
ScrollView1.Initialize2(150%y,"SV")

and you can change is as

B4X:
Scrollview1.Panel.Height = 150%y
 
Upvote 0

roarnold

Active Member
Licensed User
Longtime User
Question:

Do I have to change all this work from panel to scrollview? I have the panel sitting on the scrollview with all the labels and such in the panel.

Thks,
R
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
It depends how you've added the views to Panel9, If you've done it in code, you can just change Panel9 to ScrollView1.Panel and add them directly, if you've done it through the designer you can add panel9 to the ScrollView panel like this:

B4X:
ScrollView1.Panel.AddView(Panel9,0,0,ScrollView1.Panel.Width,ScrollView1.Panel.Height)

If you subsequently change the size of the scrollview panel, you will probably need to change the size of Panel9 as well.
 
Upvote 0
Top