iOS Question Back button by code

Discussion in 'iOS Questions' started by Marco Maria Vilucchi, May 16, 2018 at 5:41 PM.

  1. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    Hi all,
    I need to have:
    Code:
    NavControl.NavigationBarVisible = False
        NavControl.ToolBarVisible = 
    False
    but I need a back button....
    and I need a back button with customer icon.

    Whitch is the comman for back command?
    Thanks
    Marco
     
  2. JanPRO

    JanPRO Well-Known Member Licensed User

    Hi,
    You can't disable the NavigationBar and have a BackButton at the same time, as the button is part of the navigationbar. However, you can implement your own BackButton ....

    Jan
     
  3. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    ok
    Which command I need to use?
     
  4. JanPRO

    JanPRO Well-Known Member Licensed User

    Hi,
    There is not this one command you can solve your problem with ;)

    With your "own BackButton" I mean: Use a label, imageview, etc. and just open the previous page when the user click on it.

    Jan
     
    MarcoRome likes this.
  5. Erel

    Erel Administrator Staff Member Licensed User

    I think that you are looking for:
    Code:
    NavControl.RemoveCurrentPage
     
  6. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    Well
    I tried two methods.
    In both methods I call first time page regioni with:
    Code:
    Main.PGRE.Initialize
    where
    Code:
    Public PGRE As Regioni
    I have this page:
    upload_2018-5-17_7-47-20.png

    Then I go to next page (with a choice) and I have this page:

    upload_2018-5-17_7-42-47.png

    From here I want go back to Regioni Page.

    In both method I use a back button (top left button) to return to Regioni page.

    First method
    Back button use:
    Code:
    Main.NavControl.RemoveCurrentPage
    I have this page:
    upload_2018-5-17_7-48-58.png

    correct, but when from here I go to next page again I have this:

    upload_2018-5-17_7-43-57.png

    no more google maps....

    Second method
    Back button use:
    Code:
    Main.PGRE.Initialize
    like first time.
    But I have this page:
    upload_2018-5-17_7-51-37.png

    Page regioni use this code:

    Code:
    'Class module
    Sub Class_Globals
        
    Private Messaggio As String
        
    Private PageReg As Page
        
    Private TableViewRegione As TableView
        
    Dim contarighe As Int   
        
    Dim tstru As String   
        
    Private lbTReg As Label
        
    Private btTReg As Button
        
    Dim waitForAnimation As Timer
        
    Private hd As HUD
        
    Dim reqManager As DBRequestManager
        
    Public result As DBResult
        
    Public testata As ImageView
        
    Public tvtop As Int
    End Sub

    'Initializes the object. You can add parameters to this method if needed.
    Public Sub Initialize
        
    Log("Starting Regioni ========================")
        reqManager.Initialize(Me, Main.UrlDati)
        
        hd.ProgressDialogShow(
    "Attendere...")
        
    '    Log("main.ITEE:" & Main.ITEE)
        Dim cmd1 As DBCommand
        cmd1.Initialize
        cmd1.Name = 
    "get_Getregioniconv"
        cmd1.Parameters = 
    Array As Object(Main.ITEE)
        reqManager.ExecuteQuery(cmd1, 
    0"selreg")

    End Sub

    Sub JobDone (Job1 As HttpJob)
    '    Log("qui")
        Log("JobName = " & Job1.JobName & ", Success = " & Job1.Success)
        
    If Job1.Success = True Then

            
    If Job1.JobName = "DBRequest" Then     

    '            Public result As DBResult = reqManager.HandleJob(Job)
                result = reqManager.HandleJob(Job1)
                
    If result.Tag = "selreg" Then

                    SelezionaRegione

                
    End If
                
            
    End If
        
    Else
            
    Log("Error: " & Job1.ErrorMessage)
            hd.ToastMessageShow(
    "Error: " & Job1.ErrorMessage, True)
        
    End If
        Job1.Release
        hd.ProgressDialogHide
    End Sub

    Sub SelezionaRegione
        Messaggio=
    "SelezionaRegione ITEE=" & Main.ITEE
    '    Log(Messaggio)
        
        TableViewRegione.Initialize(
    "TableViewRegione"False)
        TableViewRegione.Color=
    Colors.Transparent
        PageReg.Initialize(
    "PageReg")
        PageReg.RootPanel.LoadLayout(
    "baser")
        
        tvtop=testata.Top+testata.Height
        PageReg.RootPanel.AddView(TableViewRegione, 
    0, tvtop, 100%x100%y)
        contarighe = 
    0

        waitForAnimation.Initialize(
    "waitForAnimation"500)
        waitForAnimation.Enabled = 
    True
        
    End Sub

    Sub waitForAnimation_tick
        waitForAnimation.Enabled = 
    False
        
    For Each records() As Object In result.rows
            TableViewRegione.RowHeight = 
    50 'must set RowHeight before adding custom views.
            Dim tc1 As TableCell = TableViewRegione.AddSingleLine("")
            tc1.ShowSelection = 
    False
            tc1.CustomView = CreateItemReg
              
    Dim name As String = records(0'or records(result.Columns.Get("name"))
            lbTReg.Text=name
            btTReg.BringToFront
            contarighe=contarighe+
    1
            
    Log ("contarighe " & contarighe & " name " & name )
        
    Next

        Main.NavControl.ShowPage(PageReg)
        
    If contarighe=0 Then
            
    Msgbox2("Msg","Nessuna Struttura selezionata","Rotarian Gourmet",Array("OK"))
        
    End If

    End Sub

    Private Sub PageReg_Appear
        
    Log("Appear")
    End Sub

    Private Sub CreateItemReg As Panel
        
    Dim p As Panel
        p.Initialize(
    "")
        p.Width = 
    100%x
        p.Height = TableViewRegione.RowHeight
        p.LoadLayout(
    "treg")
        p.Color=
    Colors.Transparent
        
    Return p
    End Sub

    Sub btTReg_Click
        
    Dim btn As Button = Sender
        
    Dim no As NativeObject = btn
        
    Dim Parent As Panel = no.GetField("superview"'get the button's parent
        Dim lb0 As Label = Parent.GetView(0'blTStru
        Main.treg=lb0.text
    '    Log ("treg:" & Main.treg)

        Main.PGEC.Initialize

    End Sub
    I have also the log that show both first time and second time (go back with Main.PGRE.Initialize)
    Log is the same in both cases, page is filled, but page doesn't appear.

    Code:
    Application_Start
    Application_Active
    JobName = DBRequest, Success = 
    true
    Class (b4i_httpjob) instance released.
    Main.RotLingua IT
    BTRistoranti
    Starting Regioni ========================
    JobName = DBRequest, Success = 
    true
    Class (b4i_httpjob) instance released.
    contarighe 
    1 name Lombardia
    contarighe 
    2 name Veneto
    contarighe 
    3 name Piemonte
    contarighe 
    4 name Emilia Romagna
    contarighe 
    5 name Lazio
    contarighe 
    6 name Toscana
    contarighe 
    7 name Campania
    contarighe 
    8 name Sicilia
    Appear
    JobName = DBRequest, Success = 
    true
    Class (b4i_httpjob) instance released.
    Back
    Class (b4i_dbrequestmanager) instance released.
    Starting Regioni ========================
    JobName = DBRequest, Success = 
    true
    Class (b4i_httpjob) instance released.
    contarighe 
    1 name Lombardia
    contarighe 
    2 name Veneto
    contarighe 
    3 name Piemonte
    contarighe 
    4 name Emilia Romagna
    contarighe 
    5 name Lazio
    contarighe 
    6 name Toscana
    contarighe 
    7 name Campania
    contarighe 
    8 name Sicilia
    Appear
    Where is my mistake?
    Thanks for your support
    Marco
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    1. You are not using DBRequestManager correctly. See the tutorial.

    2. Where is the code that shows the page with the map?
     
  8. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    Here is the code that show tha page with the map
    Code:
    'Class module
    Sub Class_Globals
        
    Private Messaggio As String
        
    Private PageList As Page
        
    Private TableViewEleReg As TableView
        
    Dim contarighe As Int   
        
    Dim tstru As String   
        
    Private lbTReg As Label
        
    Private btTReg As Button
        
    Dim waitForAnimation As Timer
        
    Private hd As HUD
        
    Dim reqManager As DBRequestManager
        
    Public result As DBResult
        
    Private gmap As GoogleMap
        
    Private ApiKey As String = Main.WorkApiKey
        
    Private lisBTback As Button
        
    Private lisBTforw As Button
        
    Private lisPNmap As Panel
        
    Dim Foto1, FotoMed, P1, P2, P3, Prh As Bitmap
        
    Dim Buffer() As Byte
        
    Dim ImageInStream As InputStream
        
    Private btDettaglio As Button

        
    Private rht As Label
        
    Private rh As ImageView
        
    Private Foto As ImageView
        
    Private tid As Label
        
    Private Nome As Label
        
    Private Indi As Label
        
    Private Star1 As ImageView
        
    Private Star2 As ImageView
        
    Private Star3 As ImageView
        
    Private Star4 As ImageView
        
    Private Star5 As ImageView
        
    Private ic1 As ImageView
        
    Private ic2 As ImageView
        
    Private ic3 As ImageView
        
    Private ic4 As ImageView
        
    Private ic5 As ImageView
        
    Private ic6 As ImageView
        
    Private ic7 As ImageView
        
    Private ic8 As ImageView
        
    Private ic9 As ImageView
        
    Private ic10 As ImageView
        
    Private ic11 As ImageView
        
    Private ic12 As ImageView
        
    Private ic13 As ImageView
        
    Private btDettaglio As Button
        
    Private btTReg As Button
        
    Public testata As ImageView
        
    Public tvtop As Int
        
    End Sub

    'Initializes the object. You can add parameters to this method if needed.
    Public Sub Initialize
        reqManager.Initialize(Me, Main.UrlDati)

        Main.SceltaRegione=Main.treg
        Main.TipoRicerca=Main.tstru

        Messaggio=
    "BTTReg Hai scelto ITEE:" & Main.ITEE & " tstru: " & tstru & " treg: " & Main.treg
    '    Log(Messaggio)
    '    Msgbox(Messaggio, "")
        
        PageList.Initialize(
    "PageList")
        PageList.Title = ML.listaconv_title
        PageList.RootPanel.LoadLayout(
    "listaconv")
        tvtop=testata.Top+testata.Height

        gmap.Initialize(
    "gmap", ApiKey)
        lisPNmap.AddView(gmap, 
    00100%X100%y)
    '    gmap.MapType = gmap.MAP_TYPE_TERRAIN
    '    gmap.MapType = gmap.MAP_TYPE_SATELLITE
    '    gmap.MapType = gmap.MAP_TYPE_HYBRID
        gmap.MapType = gmap.MAP_TYPE_NORMAL
    '    gmap.MapType = gmap.MAP_TYPE_NONE
        gmap.GetUiSettings.CompassEnabled = True
        gmap.GetUiSettings.MyLocationButtonEnabled = 
    True
        gmap.MyLocationEnabled = 
    True

        
    Dim mylat As Double
        
    Dim myll As LatLng
        
    Dim mylon As Double
        
        mylat=gmap.MyLocation.Latitude
        mylon=gmap.MyLocation.Longitude
    '    Log("MyLat: " & mylat)
    '    Log("MyLon: " & mylon)
        
        
        
    Dim c As CameraPosition
        

    '    c.Initialize2(32, 35, gmap.CameraPosition.Zoom + 2, 315, 45)
    '    c.Initialize2(41.619403, 12.466623, gmap.CameraPosition.Zoom + 5, 315, 45)
    '    gmap.AnimateCamera(c)

    '    NavControl.ShowPage(PageList)

        hd.ProgressDialogShow(
    "Attendere...")
        
    If Main.SceltaRegione<>"" Then
            
    Dim cmd1 As DBCommand
            cmd1.Initialize
            Messaggio=
    "TipoRicerca:" & Main.TipoRicerca & "-"
    '        Log(Messaggio)
            Messaggio="ML.combobox_Ristoranti:" & ML.combobox_Ristoranti & "-"
    '        Log(Messaggio)
            Messaggio="ML.combobox_Alberghi:" & ML.combobox_Alberghi & "-"
    '        Log(Messaggio)
            If Main.TipoRicerca=ML.combobox_Ristoranti Then
    '            Log ("1")
                cmd1.Name = "select_ristoreg"
                cmd1.Parameters = 
    Array As Object(Main.SceltaRegione, Main.ITEE)
                reqManager.ExecuteQuery(cmd1, 
    0"select_risto")
            
    Else If Main.TipoRicerca=ML.combobox_Alberghi Then
    '            Log ("2")
                cmd1.Name = "select_hotelreg"
                cmd1.Parameters = 
    Array As Object(Main.SceltaRegione, Main.ITEE)
                reqManager.ExecuteQuery(cmd1, 
    0"select_hotel")
            
    Else
    '            Log ("3")
                cmd1.Name = "select_ristoreg"
                cmd1.Parameters = 
    Array As Object(Main.SceltaRegione, Main.ITEE)
                reqManager.ExecuteQuery(cmd1, 
    0"select_tutto")
            
    End If
        
    Else
            
    Dim cmd1 As DBCommand
            cmd1.Initialize
            
    If Main.TipoRicerca=ML.combobox_Ristoranti Then
                cmd1.Name = 
    "select_ristocom"
                cmd1.Parameters = 
    Array As Object(Main.SceltaComune)
                reqManager.ExecuteQuery(cmd1, 
    0"select_risto")
            
    Else If Main.TipoRicerca=ML.combobox_Alberghi Then
                cmd1.Name = 
    "select_hotelcom"
                cmd1.Parameters = 
    Array As Object(Main.SceltaComune, Main.ITEE)
                reqManager.ExecuteQuery(cmd1, 
    0"select_hotel")
            
    Else
                cmd1.Name = 
    "select_ristocom"
                cmd1.Parameters = 
    Array As Object(Main.SceltaComune, Main.ITEE)
                reqManager.ExecuteQuery(cmd1, 
    0"select_tutto")
            
    End If
        
    End If

    End Sub

    Sub JobDone (Job1 As HttpJob)
    '    Log("qui")
        Log("JobName = " & Job1.JobName & ", Success = " & Job1.Success)
        
    If Job1.Success = True Then

            
    If Job1.JobName = "DBRequest" Then     

                result = reqManager.HandleJob(Job1)
                
    If result.Tag = "select_risto" Then
    ' ELENCO DEI RISTORANTI
                    P3.Initialize(File.DirAssets,"s3.png")
                    P2.Initialize(
    File.DirAssets,"s2.png")
                    P1.Initialize(
    File.DirAssets,"s1.png")
                    Prh.Initialize(
    File.DirAssets,"r.png")
    '                reqManager.PrintTable(result)
                    TableViewEleReg.Initialize("TableViewEleReg"False)
                    TableViewEleReg.Color=
    Colors.Transparent
                    PageList.RootPanel.AddView(TableViewEleReg, 
    0, tvtop, 100%x100%y)
                    contarighe = 
    0

                    ElencoRistoranti
                    Main.NavControl.ShowPage(PageList)

                    
    If contarighe=0 Then
                        
    Msgbox2("Msg","Nessuna Struttura selezionata","Rotarian Gourmet",Array("OK"))
                    
    End If
                    
                
    Else If result.Tag = "select_hotel" Then
    ' ELENCO DEGLI ALBERGHI
                    P3.Initialize(File.DirAssets,"s3.png")
                    P2.Initialize(
    File.DirAssets,"s2.png")
                    P1.Initialize(
    File.DirAssets,"s1.png")
                    Prh.Initialize(
    File.DirAssets,"h.png")
    '                reqManager.PrintTable(result)
                    TableViewEleReg.Initialize("TableViewEleReg"False)
                    TableViewEleReg.Color=
    Colors.Transparent
                    PageList.RootPanel.AddView(TableViewEleReg, 
    0, tvtop, 100%x100%y)
                    contarighe = 
    0

                    ElencoAlberghi
                    Main.NavControl.ShowPage(PageList)

                    
    If contarighe=0 Then
                        
    Msgbox2("Msg","Nessuna Struttura selezionata","Rotarian Gourmet",Array("OK"))
                    
    End If
                    
                
    Else If result.Tag = "select_tutto" Then
    ' ELENCO DI RISTORANTI E ALBERGHI PARTE 1
                    P3.Initialize(File.DirAssets,"s3.png")
                    P2.Initialize(
    File.DirAssets,"s2.png")
                    P1.Initialize(
    File.DirAssets,"s1.png")
                    Prh.Initialize(
    File.DirAssets,"r.png")
    '                reqManager.PrintTable(result)
                    TableViewEleReg.Initialize("TableViewEleReg"False)
                    TableViewEleReg.Color=
    Colors.Transparent
                    PageList.RootPanel.AddView(TableViewEleReg, 
    0, tvtop, 100%x100%y)
                    contarighe = 
    0

                    ElencoRistoranti

                    Job1.Release

                    
    Dim cmd2 As DBCommand
                    cmd2.Initialize
                    
    If Main.SceltaRegione<>"" Then
                        cmd2.name = 
    "select_hotelreg"
                        cmd2.Parameters = 
    Array As Object(Main.SceltaRegione, Main.ITEE)
                        reqManager.ExecuteQuery(cmd2, 
    0"select_all")
                    
    Else
                        cmd2.name = 
    "select_hotelcom"
                        cmd2.Parameters = 
    Array As Object(Main.SceltaComune, Main.ITEE)
                        reqManager.ExecuteQuery(cmd2, 
    0"select_all")
                    
    End If
                    
                
    Else If result.Tag = "select_all" Then
    ' ELENCO DI RISTORANTI E ALBERGHI PARTE 2
                    P3.Initialize(File.DirAssets,"s3.png")
                    P2.Initialize(
    File.DirAssets,"s2.png")
                    P1.Initialize(
    File.DirAssets,"s1.png")
                    Prh.Initialize(
    File.DirAssets,"h.png")
    '                reqManager.PrintTable(result)

                    ElencoAlberghi
                    Main.NavControl.ShowPage(PageList)

                    
    If contarighe=0 Then
                        
    Msgbox2("Msg","Nessuna Struttura selezionata","Rotarian Gourmet",Array("OK"))
                    
    End If
                
    End If   
                
                
                
                
                
                
                
            
    End If
        
    Else
            
    Log("Error: " & Job1.ErrorMessage)
            hd.ToastMessageShow(
    "Error: " & Job1.ErrorMessage, True)
        
    End If
        Job1.Release
        hd.ProgressDialogHide
    End Sub

    Sub ElencoRistoranti

        
    For Each records() As Object In result.rows
            contarighe=contarighe+
    1
            
    Dim idrist As String = records(0'or records(result.Columns.Get("name"))
            Dim denominazione As String = records(1)
            
    Dim indirizzo As String = records(2)
            
    Dim civico As String = records(3)
            
    Dim comune As String = records(4)
            
    Dim provincia As String = records(5)
            
    Dim regione As String = records(6)
            
    Dim frazione As String = records(7)
            
    Dim telcell As String = records(8)
            
    Dim telfisso As String = records(9)
            
    Dim email As String = records(10)
            
    Dim dataiscr As String = records(11)
            
    Dim bloccato As String = records(12)
            
    Dim sito As String = records(13)
            
    Dim giardino As Boolean = records(14)
            
    Dim parco As Boolean = records(15)
            
    Dim bambini As Boolean = records(16)
            
    Dim ariacond As Boolean = records(17)
            
    Dim wifi As Boolean = records(18)
            
    Dim park As Boolean = records(19)
            
    Dim parkchiuso As Boolean = records(20)
            
    Dim garage As Boolean = records(21)
            
    Dim cartecred As Boolean = records(22)
            
    Dim stelle As String
            
    If records(23)=Null Then
                stelle=
    0
            
    Else
                stelle=records(
    23)
            
    End If
            
    Dim tranquillo As String = records(24)
            
    Dim vista As String = records(25)
            
    Dim vini As Boolean = records(26)
            
    Dim medaglia As String = records(27)
            
    Dim descrizione As String = records(28)
            
    Dim lat As String = records(29)
            
    Dim lon As String = records(30)
            
    Dim descrizioneen As String = records(32)
    '        Dim stato As String = records(33)

    '        Log("idrist " & idrist )
    '        Log("denominazione " & denominazione )
    '        Log("indirizzo " & indirizzo )
    '        Log("civico " & civico )
    '        Log("comune " & comune )
    '        Log("provincia " & provincia )
    '        Log("regione: " & regione )
    '        Log("frazione: " & frazione )
    '        Log("telcell: " & telcell )
    '        Log("telfisso: " & telfisso )
    '        Log("email: " & email )
    '        Log("dataiscr: " & dataiscr )
    '        Log("blocato: " & blocato )
    '        Log("sito: " & sito )
    '        Log("giardino: " & giardino )
    '        Log("parco: " & parco )
    '        Log("bambini: " & bambini )
    '        Log("ariacond: " & ariacond )
    '        Log("wifi: " & wifi )
    '        Log("park: " & park )
    '        Log("parkchiuso: " & parkchiuso )
    '        Log("garage: " & garage )
    '        Log("cartecred: " & cartecred )
    '        Log("stelle: " & stelle )
    '        Log("tranquillo: " & tranquillo )
    '        Log("vista: " & vista )
    '        Log("vini: " & vini )
    '        Log("medaglia: " & medaglia )
    '        Log("descrizione: " & descrizione )
    '        Log("lat: " & lat )
    '        Log("lon: " & lon )
    '        Log("descrizioneen: " & descrizioneen )
    '        Log("stato: " & stato )

    ' Marker GMAP
            Dim m As Marker
            
    If (lat="null" Or lon="null"Then
            
    Else   
                m = gmap.AddMarker2(lat, lon, denominazione, 
    Colors.Red)
    ' change the camera position
                Dim c As CameraPosition
                c.Initialize2(lat, lon, gmap.CameraPosition.Zoom + 
    500)
    '            c.Initialize2(lat, lon, gmap.CameraPosition.Zoom + 5, 315, 45)
                gmap.AnimateCamera(c)
            
    End If

    ' Foto Ristorante
            Foto1=LoadBitmap(File.DirAssets, "logo1.png")
    '        Log ("1 " & Foto1)
            Try
                
    If records(31)<>Null Then
                    Buffer = records(
    31)
                    Buffer=records(result.Columns.Get(
    "FOTO"))
    '                Log("Buffer len: " & Buffer.Length)
                    ImageInStream.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
    '                Dim vv As ImageView
    '                vv.Initialize("vv")
                    Foto1.Initialize2(ImageInStream)
    '                vv.Bitmap = Foto1
                    ImageInStream.Close
    '                Log ("vv " & vv)
    '                Log ("2 " & Foto1)
                Else   
                    Foto1.Initialize(
    File.DirAssets,"logo1.png")
    '                Log ("3 " & Foto1)
                End If
            
    Catch
                Foto1.Initialize(
    File.DirAssets,"logo1.png")
    '            Log ("4 " & Foto1)
            End Try
    '            Log ("5 " & Foto1)

    ' Load mappa dettaglio (item)
    ' Riga 1: Nominativo e Stelle
    ' Riga 2: Foto e Indirizzo
    ' Riga 3: Foto e Icone possibilità struttura
            TableViewEleReg.RowHeight = 75 'must set RowHeight before adding custom views.
            Dim tc1 As TableCell = TableViewEleReg.AddSingleLine("")
            tc1.ShowSelection = 
    False
            tc1.CustomView = CreateItem
                        
    ' Riga 1: Nominativo e Stelle
            Nome.Text=denominazione
            Star1.Bitmap=P1
            Star2.Bitmap=P1
            Star3.Bitmap=P1
            Star4.Bitmap=P1
            Star5.Bitmap=P1
            rh.Bitmap=Prh
            rht.Text=
    "r"
            tid.Text=idrist
            
    If stelle>0 Then Star5.Bitmap=P3
            
    If stelle>1 Then Star4.Bitmap=P3
            
    If stelle>2 Then Star3.Bitmap=P3
            
    If stelle>3 Then Star2.Bitmap=P3
            
    If stelle>4 Then Star1.Bitmap=P3
    ' Riga 2: Foto e Indirizzo
            Foto.Bitmap = Foto1
            
    Dim Riga1 As String = indirizzo & ", " & civico & " " & comune
            Indi.Text=Riga1
    ' Riga 3: dopo Foto Icone possibilità struttura
            Main.picvuota.Initialize(File.DirAssets,"icvuota.png")
            Main.picpiu.Initialize(
    File.DirAssets,"icpiu.png")
            Main.pariacondizionata.Initialize(
    File.DirAssets,"icariacondizionata.png")
            Main.pascensore.Initialize(
    File.DirAssets,"icascensore.png")
            Main.pbambini.Initialize(
    File.DirAssets,"icbambini.png")
            Main.pcartavini.Initialize(
    File.DirAssets,"iccartavini.png")
            Main.pcartedicredito.Initialize(
    File.DirAssets,"iccartedicredito.png")
            Main.pgarage.Initialize(
    File.DirAssets,"icgarage.png")
            Main.pgiardino.Initialize(
    File.DirAssets,"icgiardino.png")
            Main.pgolf.Initialize(
    File.DirAssets,"icgolf.png")
            Main.ppalestra.Initialize(
    File.DirAssets,"icpalestra.png")
            Main.pparcheggio.Initialize(
    File.DirAssets,"icparcheggio.png")
            Main.pparcheggiochiuso.Initialize(
    File.DirAssets,"icparcheggiochiuso.png")
            Main.pparco.Initialize(
    File.DirAssets,"icparco.png")
            Main.ppastiingiardino.Initialize(
    File.DirAssets,"icpastiingiardino.png")
            Main.ppiscinacoperta.Initialize(
    File.DirAssets,"icpiscinacoperta.png")
            Main.ppiscinascoperta.Initialize(
    File.DirAssets,"icpiscinascoperta.png")
            Main.psauna.Initialize(
    File.DirAssets,"icsauna.png")
            Main.pspa.Initialize(
    File.DirAssets,"icspa.png")
            Main.pspiaggiaattrezzata.Initialize(
    File.DirAssets,"icspiaggiaattrezzata.png")
            Main.ptennis.Initialize(
    File.DirAssets,"ictennis.png")
            Main.pterme.Initialize(
    File.DirAssets,"icterme.png")
            Main.pwifi.Initialize(
    File.DirAssets,"icwifi.png")
            
            ic1.Bitmap=Main.picvuota
            ic2.Bitmap=Main.picvuota
            ic3.Bitmap=Main.picvuota
            ic4.Bitmap=Main.picvuota
            ic5.Bitmap=Main.picvuota
            ic6.Bitmap=Main.picvuota
            ic7.Bitmap=Main.picvuota
            ic8.Bitmap=Main.picvuota
            ic9.Bitmap=Main.picvuota
            ic10.Bitmap=Main.picvuota
            ic11.Bitmap=Main.picvuota
            ic12.Bitmap=Main.picvuota
            ic13.Bitmap=Main.picvuota
            
            
    Dim nico As Int = 12
            
    Dim tabico(13As Bitmap
            tabico(
    0)=Main.picvuota
            tabico(
    1)=Main.picvuota
            tabico(
    2)=Main.picvuota
            tabico(
    3)=Main.picvuota
            tabico(
    4)=Main.picvuota
            tabico(
    5)=Main.picvuota
            tabico(
    6)=Main.picvuota
            tabico(
    7)=Main.picvuota
            tabico(
    8)=Main.picvuota
            tabico(
    9)=Main.picvuota
            tabico(
    10)=Main.picvuota
            tabico(
    11)=Main.picvuota
            tabico(
    12)=Main.picvuota
            
            
    Dim indico As Int = 0
            
    If giardino Then
                tabico(indico) = Main.pgiardino
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If parco Then
                tabico(indico) = Main.pparco
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If bambini Then
                tabico(indico) = Main.pbambini
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If ariacond Then
                tabico(indico) = Main.pariacondizionata
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If wifi Then
                tabico(indico) = Main.pwifi
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If park Then
                tabico(indico) = Main.pparcheggio
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If parkchiuso Then
                tabico(indico) = Main.pparcheggiochiuso
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If garage Then
                tabico(indico) = Main.pgarage
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If cartecred Then
                tabico(indico) = Main.pcartedicredito
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If vini Then
                tabico(indico) = Main.pcartavini
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
            
            ic1.Bitmap=tabico(
    0)
            ic2.Bitmap=tabico(
    1)
            ic3.Bitmap=tabico(
    2)
            ic4.Bitmap=tabico(
    3)
            ic5.Bitmap=tabico(
    4)
            ic6.Bitmap=tabico(
    5)
            ic7.Bitmap=tabico(
    6)
            ic8.Bitmap=tabico(
    7)
            ic9.Bitmap=tabico(
    8)
            ic10.Bitmap=tabico(
    9)
            ic11.Bitmap=tabico(
    10)
            ic12.Bitmap=tabico(
    11)
            ic13.Bitmap=tabico(
    12)

            btDettaglio.BringToFront
            lisBTback.BringToFront           
            lisBTforw.BringToFront           
                        
    '                    Dim den As TableCell = TableViewEleReg.AddSingleLine(denominazione)
    '                    Dim NomeGrassetto As AttributedString
    '                    NomeGrassetto.Initialize(denominazione, Font.CreateNewBold(22), Colors.RGB(50, 50, 233))
    '                    den.Text = NomeGrassetto
    '
    '                    'create an item and customize it
    '                    Dim tc As TableCell = TableViewEleReg.AddTwoLines("First line", "") 'the second line will be soon added
    '                    Dim s As AttributedString
    '                    Dim Riga1 As String = indirizzo & ", " & civico & " " & comune
    '                    s.Initialize(Riga1, Font.DEFAULT, Colors.Red)
    '                    tc.Text = s
    '                    tc.Bitmap = Foto1
    '                    tc.IndentationLevel = 0
    '                    Dim ColoredTitle As AttributedString
    '                    ColoredTitle.Initialize("Second line", Font.CreateNew(19), Rnd(0x80000000, -1))
    '                    tc.DetailText = ColoredTitle
                        
        
    Next

    End Sub

    Sub ElencoAlberghi

        
    For Each records() As Object In result.rows
            contarighe=contarighe+
    1
            
    Dim idrist As String = records(0'or records(result.Columns.Get("name"))
            Dim denominazione As String = records(1)
            
    Dim indirizzo As String = records(2)
            
    Dim civico As String = records(3)
            
    Dim comune As String = records(4)
            
    Dim provincia As String = records(5)
            
    Dim regione As String = records(6)
            
    Dim frazione As String = records(7)
            
    Dim telcell As String = records(8)
            
    Dim telfisso As String = records(9)
            
    Dim email As String = records(10)
            
    Dim dataiscr As String = records(11)
            
    Dim bloccato As String = records(12)
            
    Dim sito As String = records(13)
            
    Dim giardino As Boolean = records(23)
            
    Dim parco As Boolean = records(24)
            
    Dim bambini As Boolean = records(26)
            
    Dim ariacond As Boolean = records(28)
            
    Dim wifi As Boolean = records(29)
            
    Dim park As Boolean = records(30)
            
    Dim parkchiuso As Boolean = records(31)
            
    Dim garage As Boolean = records(32)
            
    Dim cartecred As Boolean = records(33)
            
    Dim stelle As String
            
    If records(34)=Null Then
                stelle=
    0
            
    Else
                stelle=records(
    34)
            
    End If
            
    Dim tranquillo As String = records(35)
            
    Dim vista As String = records(36)
            
    Dim vini As Boolean = records(37)
            
    Dim medaglia As String = records(38)
            
    Dim descrizione As String = records(39)
            
    Dim lat As String = records(40)
            
    Dim lon As String = records(41)
            
    Dim hpasti_giardino As Boolean = records(14)
            
    Dim hsauna As Boolean = records(15)
            
    Dim hcura_termale As Boolean = records(16)
            
    Dim hcentro_wellness As Boolean = records(17)
            
    Dim hpalestra As Boolean = records(18)
            
    Dim htennis As Boolean = records(19)
            
    Dim hpiscina_coperta As Boolean = records(20)
            
    Dim hpiscina_scoperta As Boolean = records(21)
            
    Dim hspiaggia_attrezzata As Boolean = records(22)
            
    Dim hgolf As Boolean = records(25)
            
    Dim hascensore As Boolean = records(27)
            
    Dim descrizioneen As String = records(43)
    '         Dim stato As String = records(44)

    '        Log("idrist " & idrist )
    '        Log("denominazione " & denominazione )
    '        Log("indirizzo " & indirizzo )
    '        Log("civico " & civico )
    '        Log("comune " & comune )
    '        Log("provincia " & provincia )
    '        Log("regione: " & regione )
    '        Log("frazione: " & frazione )
    '        Log("telcell: " & telcell )
    '        Log("telfisso: " & telfisso )
    '        Log("email: " & email )
    '        Log("dataiscr: " & dataiscr )
    '        Log("bloccato: " & bloccato )
    '        Log("sito: " & sito )
    '        Log("giardino: " & giardino )
    '        Log("parco: " & parco )
    '        Log("bambini: " & bambini )
    '        Log("ariacond: " & ariacond )
    '        Log("wifi: " & wifi )
    '        Log("park: " & park )
    '        Log("parkchiuso: " & parkchiuso )
    '        Log("garage: " & garage )
    '        Log("cartecred: " & cartecred )
    '        Log("stelle: " & stelle )
    '        Log("tranquillo: " & tranquillo )
    '        Log("vista: " & vista )
    '        Log("vini: " & vini )
    '        Log("medaglia: " & medaglia )
    '        Log("descrizione: " & descrizione )
    '        Log("lat: " & lat )
    '        Log("lon: " & lon )
    '        Log("hsauna: " & hsauna )
    '        Log("hpasti: " & hpasti_giardino )
    '        Log("hcura_termale: " & hcura_termale )
    '        Log("hcentro_wellness: " & hcentro_wellness )
    '        Log("hpalestra: " & hpalestra )
    '        Log("htennis: " & htennis )
    '        Log("hpiscina_coperta: " & hpiscina_coperta )
    '        Log("hpiscina_scoperta: " & hpiscina_scoperta )
    '        Log("hspiaggia_attrezzata: " & hspiaggia_attrezzata )
    '        Log("hgolf: " & hgolf )
    '        Log("hascensore: " & hascensore )
    '        Log("descrizioneen: " & descrizioneen )
    '        Log("stato: " & stato )

    ' Marker GMAP
            Dim m As Marker
            m = gmap.AddMarker2(lat, lon, denominazione, 
    Colors.Green)

    ' change the camera position
            Dim c As CameraPosition
            c.Initialize2(lat, lon, gmap.CameraPosition.Zoom + 
    500)
    '        c.Initialize2(lat, lon, gmap.CameraPosition.Zoom + 5, 315, 45)
            gmap.AnimateCamera(c)

    ' Foto Albergo
            Foto1=LoadBitmap(File.DirAssets, "logo1.png")
    '        Log ("1 " & Foto1)
            Try
                
    If records(42)<>Null Then
                    Buffer = records(
    42)
                    Buffer=records(result.Columns.Get(
    "FOTO"))
    '                Log("Buffer len: " & Buffer.Length)
                    ImageInStream.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
    '                Dim vv As ImageView
    '                vv.Initialize("vv")
                    Foto1.Initialize2(ImageInStream)
    '                vv.Bitmap = Foto1
                    ImageInStream.Close
    '                Log ("vv " & vv)
    '                Log ("2 " & Foto1)
                Else   
                    Foto1.Initialize(
    File.DirAssets,"logo1.png")
    '                Log ("3 " & Foto1)
                End If
            
    Catch
                Foto1.Initialize(
    File.DirAssets,"logo1.png")
    '            Log ("4 " & Foto1)
            End Try
    '            Log ("5 " & Foto1)

    ' Load mappa dettaglio (item)
    ' Riga 1: Nominativo e Stelle
    ' Riga 2: Foto e Indirizzo
    ' Riga 3: Foto e Icone possibilità struttura
            TableViewEleReg.RowHeight = 75 'must set RowHeight before adding custom views.
            Dim tc1 As TableCell = TableViewEleReg.AddSingleLine("")
            tc1.ShowSelection = 
    False
            tc1.CustomView = CreateItem
    ' Riga 1: Nominativo e Stelle
            Nome.Text=denominazione
            Star1.Bitmap=P1
            Star2.Bitmap=P1
            Star3.Bitmap=P1
            Star4.Bitmap=P1
            Star5.Bitmap=P1
            rh.Bitmap=Prh
            rht.Text=
    "h"
            tid.Text=idrist
            
    If stelle>0 Then Star5.Bitmap=P3
            
    If stelle>1 Then Star4.Bitmap=P3
            
    If stelle>2 Then Star3.Bitmap=P3
            
    If stelle>3 Then Star2.Bitmap=P3
            
    If stelle>4 Then Star1.Bitmap=P3
    ' Riga 2: Foto e Indirizzo
            Foto.Bitmap = Foto1
            
    Dim Riga1 As String = indirizzo & ", " & civico & " " & comune
            Indi.Text=Riga1
    ' Riga 3: dopo Foto Icone possibilità struttura
            Main.picvuota.Initialize(File.DirAssets,"icvuota.png")
            Main.picpiu.Initialize(
    File.DirAssets,"icpiu.png")
            Main.pariacondizionata.Initialize(
    File.DirAssets,"icariacondizionata.png")
            Main.pascensore.Initialize(
    File.DirAssets,"icascensore.png")
            Main.pbambini.Initialize(
    File.DirAssets,"icbambini.png")
            Main.pcartavini.Initialize(
    File.DirAssets,"iccartavini.png")
            Main.pcartedicredito.Initialize(
    File.DirAssets,"iccartedicredito.png")
            Main.pgarage.Initialize(
    File.DirAssets,"icgarage.png")
            Main.pgiardino.Initialize(
    File.DirAssets,"icgiardino.png")
            Main.pgolf.Initialize(
    File.DirAssets,"icgolf.png")
            Main.ppalestra.Initialize(
    File.DirAssets,"icpalestra.png")
            Main.pparcheggio.Initialize(
    File.DirAssets,"icparcheggio.png")
            Main.pparcheggiochiuso.Initialize(
    File.DirAssets,"icparcheggiochiuso.png")
            Main.pparco.Initialize(
    File.DirAssets,"icparco.png")
            Main.ppastiingiardino.Initialize(
    File.DirAssets,"icpastiingiardino.png")
            Main.ppiscinacoperta.Initialize(
    File.DirAssets,"icpiscinacoperta.png")
            Main.ppiscinascoperta.Initialize(
    File.DirAssets,"icpiscinascoperta.png")
            Main.psauna.Initialize(
    File.DirAssets,"icsauna.png")
            Main.pspa.Initialize(
    File.DirAssets,"icspa.png")
            Main.pspiaggiaattrezzata.Initialize(
    File.DirAssets,"icspiaggiaattrezzata.png")
            Main.ptennis.Initialize(
    File.DirAssets,"ictennis.png")
            Main.pterme.Initialize(
    File.DirAssets,"icterme.png")
            Main.pwifi.Initialize(
    File.DirAssets,"icwifi.png")
            

            ic1.Bitmap=Main.picvuota
            ic2.Bitmap=Main.picvuota
            ic3.Bitmap=Main.picvuota
            ic4.Bitmap=Main.picvuota
            ic5.Bitmap=Main.picvuota
            ic6.Bitmap=Main.picvuota
            ic7.Bitmap=Main.picvuota
            ic8.Bitmap=Main.picvuota
            ic9.Bitmap=Main.picvuota
            ic10.Bitmap=Main.picvuota
            ic11.Bitmap=Main.picvuota
            ic12.Bitmap=Main.picvuota
            ic13.Bitmap=Main.picvuota
            
            
    Dim nico As Int = 12
            
    Dim tabico(13As Bitmap
            tabico(
    0)=Main.picvuota
            tabico(
    1)=Main.picvuota
            tabico(
    2)=Main.picvuota
            tabico(
    3)=Main.picvuota
            tabico(
    4)=Main.picvuota
            tabico(
    5)=Main.picvuota
            tabico(
    6)=Main.picvuota
            tabico(
    7)=Main.picvuota
            tabico(
    8)=Main.picvuota
            tabico(
    9)=Main.picvuota
            tabico(
    10)=Main.picvuota
            tabico(
    11)=Main.picvuota
            tabico(
    12)=Main.picvuota
            
            
    Dim indico As Int = 0
            
    If giardino Then
                tabico(indico) = Main.pgiardino
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If parco Then
                tabico(indico) = Main.pparco
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If bambini Then
                tabico(indico) = Main.pbambini
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If ariacond Then
                tabico(indico) = Main.pariacondizionata
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If wifi Then
                tabico(indico) = Main.pwifi
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If park Then
                tabico(indico) = Main.pparcheggio
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If parkchiuso Then
                tabico(indico) = Main.pparcheggiochiuso
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If garage Then
                tabico(indico) = Main.pgarage
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If cartecred Then
                tabico(indico) = Main.pcartedicredito
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If vini Then
                tabico(indico) = Main.pcartavini
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If hpasti_giardino Then
                tabico(indico) = Main.ppastiingiardino
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If hsauna Then
                tabico(indico) = Main.psauna
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If hcura_termale Then
                tabico(indico) = Main.pterme
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If hcentro_wellness Then
                tabico(indico) = Main.pspa
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If hpalestra Then
                tabico(indico) = Main.ppalestra
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If htennis Then
                tabico(indico) = Main.ptennis
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If hpiscina_coperta Then
                tabico(indico) = Main.ppiscinacoperta
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If hpiscina_scoperta Then
                tabico(indico) = Main.ppiscinascoperta
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If hspiaggia_attrezzata Then
                tabico(indico) = Main.pspiaggiaattrezzata
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If hgolf Then
                tabico(indico) = Main.pgolf
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If
            
    If hascensore Then
                tabico(indico) = Main.pascensore
                
    If indico>=nico Then
                    tabico(indico) = Main.picpiu
                
    Else   
                    indico=indico+
    1
                
    End If   
            
    End If

            ic1.Bitmap=tabico(
    0)
            ic2.Bitmap=tabico(
    1)
            ic3.Bitmap=tabico(
    2)
            ic4.Bitmap=tabico(
    3)
            ic5.Bitmap=tabico(
    4)
            ic6.Bitmap=tabico(
    5)
            ic7.Bitmap=tabico(
    6)
            ic8.Bitmap=tabico(
    7)
            ic9.Bitmap=tabico(
    8)
            ic10.Bitmap=tabico(
    9)
            ic11.Bitmap=tabico(
    10)
            ic12.Bitmap=tabico(
    11)
            ic13.Bitmap=tabico(
    12)

            btDettaglio.BringToFront
            lisBTback.BringToFront           
            lisBTforw.BringToFront           
        
    Next

    End Sub

    Private Sub CreateItem As Panel
        
    Dim p As Panel
        p.Initialize(
    "")
        p.Width = 
    100%x
        p.Height = TableViewEleReg.RowHeight
        p.LoadLayout(
    "t")
        p.Color=
    Colors.Transparent
        
    Return p
    End Sub

    Sub lisBTback_Click
    '    Log("Back click")
    '    Log("lisPNmap.left: " & lisPNmap.Left)
    '    Log("lisPNmap.width: " & lisPNmap.width)
    '    Log("lisBTback.left: " & lisBTback.left)
    '    Log("lisBTforw.left: " & lisBTforw.left)
    '    Log("pagelist.width: " & PageList.RootPanel.Width)
        If lisPNmap.Left=0dip Then
    '        panel completo nessuna azione
    '        Log("panel completo nessuna azione")
        Else If lisPNmap.Left<PageList.RootPanel.Width Then
    '        da panel parziale a panel completo
    '        Log("da panel parziale a panel completo")
            lisPNmap.Left=0
            lisPNmap.width=PageList.RootPanel.Width
            lisBTback.visible=
    False
            lisBTforw.left=
    0
            lisBTforw.visible=
    True
            lisPNmap.visible=
    True
            lisPNmap.BringToFront
            lisBTback.BringToFront
            lisBTforw.BringToFront
    '        Log("lisPNmap.left dopo: " & lisPNmap.Left)
    '        Log("lisPNmap.width dopo: " & lisPNmap.width)
    '        Log("lisBTback.left dopo: " & lisBTback.left)
    '        Log("lisBTforw.left dopo: " & lisBTforw.left)
        Else
    '        da panel nascosto a panel parziale
    '        Log("da panel nascosto a panel parziale")
            lisPNmap.Left=PageList.RootPanel.Width*0.3
            lisPNmap.width=PageList.RootPanel.Width*
    0.7
            lisBTback.visible=
    True
            lisBTback.Left=PageList.RootPanel.Width*
    0.3-lisBTback.Width
            lisBTforw.left=PageList.RootPanel.Width*
    0.3
            lisBTforw.visible=
    True
            lisPNmap.visible=
    True
            lisPNmap.BringToFront
            lisBTback.BringToFront
            lisBTforw.BringToFront
    '        Log("lisPNmap.left dopo: " & lisPNmap.Left)
    '        Log("lisPNmap.width dopo: " & lisPNmap.width)
    '        Log("lisBTback.left dopo: " & lisBTback.left)
    '        Log("lisBTforw.left dopo: " & lisBTforw.left)
        End If
    End Sub

    Sub lisBTforw_Click
    '    Log("Forw click")
    '    Log("lisPNmap.left: " & lisPNmap.Left)
    '    Log("lisPNmap.width: " & lisPNmap.width)
    '    Log("lisBTback.left: " & lisBTback.left)
    '    Log("lisBTforw.left: " & lisBTforw.left)
    '    Log("pagelist.width: " & PageList.RootPanel.Width)

        
    If lisPNmap.Left=0dip Then
    '        da panel completo a panel parziale
    '        Log("da panel completo a panel parziale")
            lisPNmap.Left=PageList.RootPanel.Width*0.3
            lisPNmap.width=PageList.RootPanel.Width*
    0.7
            lisBTback.visible=
    True
            lisBTback.Left=PageList.RootPanel.Width*
    0.3-lisBTback.Width
            lisBTforw.left=PageList.RootPanel.Width*
    0.3
            lisBTforw.visible=
    True
            lisPNmap.visible=
    True
            lisPNmap.BringToFront
            lisBTback.BringToFront
            lisBTforw.BringToFront
    '        Log("lisPNmap.left dopo: " & lisPNmap.Left)
    '        Log("lisPNmap.width dopo: " & lisPNmap.width)
    '        Log("lisBTback.left dopo: " & lisBTback.left)
    '        Log("lisBTforw.left dopo: " & lisBTforw.left)
        Else If lisPNmap.Left<PageList.RootPanel.Width Then
    '        da panel parziale a panel nascosto
    '        Log("da panel parziale a panel nascosto")
            lisPNmap.Left=PageList.RootPanel.Width
            lisPNmap.width=
    0
            lisBTback.visible=
    True
            lisBTback.left=PageList.RootPanel.Width-lisBTback.Width
            lisBTforw.visible=
    False
            lisPNmap.visible=
    True
            lisPNmap.BringToFront
            lisBTback.BringToFront
            lisBTforw.BringToFront
    '        Log("lisPNmap.left dopo: " & lisPNmap.Left)
    '        Log("lisPNmap.width dopo: " & lisPNmap.width)
    '        Log("lisBTback.left dopo: " & lisBTback.left)
    '        Log("lisBTforw.left dopo: " & lisBTforw.left)
        Else
    '        panel nascosto nessuna azione
    '        Log("panel nascosto nessuna azione")
        End If
        
    End Sub

    Sub btDettaglio_Click
        
    Dim btn As Button = Sender
        
    Dim no As NativeObject = btn
        
    Dim Parent As Panel = no.GetField("superview"'get the button's parent
        Dim lb0 As Label = Parent.GetView(0'tid
        Dim lb1 As Label = Parent.GetView(1'rht
        Dim lb2 As Label = Parent.GetView(4'this is the text field index (based on the order in the layout file).
        Dim lb3 As Label = Parent.GetView(5)
    '    Msgbox("Indi: " & lb3.Text , "Name = " & lb0.Text & CRLF & " " & lb1.Text & " " & lb2.Text)
        Main.idstru=lb0.text
        Main.tipostru=lb1.text
    '    Log ("tipostru:" & main.tipostru)
    '    Log ("idstru:" & main.idstru)

        Main.PGDT.Initialize

    End Sub

    Sub PageList_BarButtonClick (Tag As String)
        
    If Tag="helpico" Then

            Main.PGHE.Initialize
        
        
    End If
    End Sub

    Sub BTBack_Click
        
    Log("Back")
        
    Log("Main.tstru " & Main.tstru)
    '    Main.PGRE.Initialize
        Main.NavControl.RemoveCurrentPage
    End Sub
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    I'm not sure that posting a code snippet this large will yield anything useful.
     
  10. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    Sorry,
    tell me what I can do to show you the code
     
  11. Erel

    Erel Administrator Staff Member Licensed User

  12. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    I use this code fot map
    Code:
    gmap.Initialize("gmap", ApiKey)
        lisPNmap.AddView(gmap, 
    00100%X100%y)
    '    gmap.MapType = gmap.MAP_TYPE_TERRAIN
    '    gmap.MapType = gmap.MAP_TYPE_SATELLITE
    '    gmap.MapType = gmap.MAP_TYPE_HYBRID
        gmap.MapType = gmap.MAP_TYPE_NORMAL
    '    gmap.MapType = gmap.MAP_TYPE_NONE
        gmap.GetUiSettings.CompassEnabled = True
        gmap.GetUiSettings.MyLocationButtonEnabled = 
    True
        gmap.MyLocationEnabled = 
    True

        
    Dim mylat As Double
        
    Dim myll As LatLng
        
    Dim mylon As Double
        
        mylat=gmap.MyLocation.Latitude
        mylon=gmap.MyLocation.Longitude
    and this code for marker

    Code:
    ' Marker GMAP
            Dim m As Marker
            
    If (lat="null" Or lon="null"Then
            
    Else   
                m = gmap.AddMarker2(lat, lon, denominazione, 
    Colors.Red)
    ' change the camera position
                Dim c As CameraPosition
                c.Initialize2(lat, lon, gmap.CameraPosition.Zoom + 
    500)
    '            c.Initialize2(lat, lon, gmap.CameraPosition.Zoom + 5, 315, 45)
                gmap.AnimateCamera(c)
            
    End If
     
  13. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    maybe the mistake is that I have every class modules?
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    Maybe you are not resizing the map correctly.

    Watch this tutorial:
     
  15. Marco Maria Vilucchi

    Marco Maria Vilucchi Active Member Licensed User

    I saw tutorial, thanks.
    But I use same code to show map the first and the second time.
    Why first time can I see map and second time no?
    I don't know what I can do.....
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    Remember that %x and %y are only correct inside Page_Resize event. In all other cases it might work and it might not.
     
Loading...