2 questions- tab host and trig functions

abane94

New Member
Licensed User
Longtime User
so i tried using the tab host with pictures and when that did not work at all itried without but the tabs were huge and only two would show up(out of 3), on one page all three showed up but the one was under neath

example pic below

B4X:
sub globals
Dim TabHost1 As TabHost
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("homescreen1")
   
   TabHost1.Initialize("TabHost1")
   Activity.AddView(TabHost1, 0, 0, 320, 480)
   
   Dim bpmH, bmpHS, bmpE, bmpES, bmpR, bmpRS As Bitmap
   'bmpH = LoadBitmap(File.DirAssets, "HomeIcon.png")
   'bmpHS = LoadBitmap(File.DirAssets, "HomeIcon-Selected.png")
   
   'bmpE = LoadBitmap(File.DirAssets, "ExpensesIcon.png")
   'bmpES = LoadBitmap(File.DirAssets, "ExpensesIcon-Selected.png")
   
   'bmpR = LoadBitmap(File.DirAssets, "ReportIcon.png")
'bmpRS = LoadBitmap(File.DirAssets, "ReportIcon-Selected.png")
   
   'TabHost1.AddTabWithIcon ("Home", bmpH, bmpHS, "homescreen1.bal") 'load the layout file of each page
   'TabHost1.AddTabWithIcon ("Expense", bmpE, bmpES, "Expenses.bal") 'load the layout file of each page
   'TabHost1.AddTabWithIcon ("Report", bmpR, bmpRS, "Report.bal") 'load the layout file of each page
   'TabHost1.AddTab("Expences", "Expences") 
   'TabHost1.AddTab("Report", "Report")
   tabhost1.AddTab ("H", "homescreen1.bal")
   tabhost1.AddTab ("E", "expenses.bal")
   tabhost1.AddTab ("R", "report.bal")
End Sub
this is all the code i have in the project so far


and the next is with some functions that keep returning syntax errors
B4X:
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'takes the parameters of 3 sides to do a munipulated form of the law of co-sine
    '
    'returns an angle in radians
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Sub LawOfCos(ByVal dblSide1 As Double, ByVal dblSide2 As Double, ByVal dblSide3 As Double) As Double
        Dim dblAnswer As Double

        dblAnswer = ((dblSide2 dblside2) + (dblSide3 *dblside3) - (dblSide1 *dblside1)) / (2 * dblSide2 * dblSide3)
        Return ACos(dblAnswer)
    End Sub
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'takes the parameters of 1 sides and 2 angles to do the law of sine
    '
    'returns a side
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Sub LawOfSin(ByVal dblAng1 As Double, ByVal dblSide1 As Double, ByVal dblAng2 As Double) As Double
        Dim dblAnswer As Double
        Dim dblSin1 As Double
        Dim dblSin2 As Double

        dblSin1 = Sin(dblAng1)
        dblSin2 = Sin(dblAng2)
        dblAnswer = (dblSide1 * dblSin2) / dblSin1
        Return dblAnswer
    End Sub
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'Does a conversion form radians
    '
    'Returns degrees
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Sub  RadsToDegs(ByVal dblRads As Double) As Double
        Return (dblRads * (180 / Pi))
    End Sub
      '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'Does a conversion form degrees
    '
    'Returns radians
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Sub DegToRads(byval dblDegs As Double) As Double
      Return ((Pi / 180) * dblDegs)
   End Sub
the law of cos and the degstorad dont work but the radstodegs does


if you can help that would be great and thx
 

Attachments

  • help pic.jpg
    help pic.jpg
    33 KB · Views: 224
Top