- VERSION 4.07.24.EP

- Se agregó nuevamente el scrollview a "agregaPreguntaAbierta", para que cuando sean muchas preguntas, no se salga de la pantalla el panel.
This commit is contained in:
Jose Alberto Guerra Ugalde
2024-07-25 13:44:10 -06:00
parent 731a37ccb4
commit abb1c48b3c
5 changed files with 38 additions and 26 deletions

View File

@@ -745,7 +745,7 @@ Sub B4XPage_Appear
Next Next
End If End If
Log("AQUI ESTOY") ' Log("AQUI ESTOY")
Else Else
End If End If
@@ -753,7 +753,7 @@ Sub B4XPage_Appear
'AQUI CAMBIAR 'AQUI CAMBIAR
Private s3 As Cursor=B4XPages.MainPage.skmt.ExecQuery2("select * FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and PE_RECALCULO <> ? OR PE_RECALCULO <> ? OR PE_RECALCULO IS NOT NULL",Array As String("","null")) Private s3 As Cursor=B4XPages.MainPage.skmt.ExecQuery2("select * FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and PE_RECALCULO <> ? OR PE_RECALCULO <> ? OR PE_RECALCULO IS NOT NULL",Array As String("","null"))
LogColor(s3.RowCount,Colors.Yellow) ' LogColor(s3.RowCount,Colors.Yellow)
If s3.RowCount > 0 Then If s3.RowCount > 0 Then
c=B4XPages.MainPage.skmt.ExecQuery("select CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_MTOCOMPRA,CAT_CL_NUM_SERIEFISICO from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)") c=B4XPages.MainPage.skmt.ExecQuery("select CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_MTOCOMPRA,CAT_CL_NUM_SERIEFISICO from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
@@ -847,8 +847,7 @@ Sub B4XPage_Appear
End Sub End Sub
Sub GPS_LocationChanged (Location1 As Location) Sub GPS_LocationChanged (Location1 As Location)
' LogColor($"Entrando a Cliente.GPS_LocationChanged"$, Colors.red)
LogColor($"Entrando a Cliente.GPS_LocationChanged"$, Colors.red)
If Tracker.FLP.GetLastKnownLocation.IsInitialized And Tracker.FLP.GetLastKnownLocation.Latitude <> 0 Then If Tracker.FLP.GetLastKnownLocation.IsInitialized And Tracker.FLP.GetLastKnownLocation.Latitude <> 0 Then
B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastKnownLocation.Latitude B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastKnownLocation.Latitude
B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastKnownLocation.Longitude B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastKnownLocation.Longitude
@@ -1087,11 +1086,11 @@ Sub gest_Click
' If ALMACEN = "4" Or ALMACEN = "36" Then ' If ALMACEN = "4" Or ALMACEN = "36" Then
' Log(Subs.traeAlmacen) ' Log(Subs.traeAlmacen)
' Log($"${cuest.encuestaIniciada} - ${cuest.clienteConCuestionario(Subs.traeCliente)}"$) Log($"${cuest.encuestaIniciada} - ${cuest.clienteConCuestionario(Subs.traeCliente)}"$)
' If Not(cuest.encuestaIniciada) And Not(cuest.clienteConCuestionario(Subs.traeCliente)) Then If Not(cuest.encuestaIniciada) And Not(cuest.clienteConCuestionario(Subs.traeCliente)) Then
' cuest.agregaPreguntaCheckbox("1", "¿Qué productos de Kileo Perro encuentras en esta tienda?", Array As String("Pedigree Adulto", "Pedigree Cachorro", "Pedigree Razas Pequeñas", "Champ", "PAL","DOG CHOW ADULTO","DOG CHOW CACHORRO","DOG CHOW RAZAS PEQUEÑAS","Campeon","Ganador","Poder canino","Perron","Silverkan","Woow","Chapetes","Dyno","Beriscan","Nogacan","Nutrescan","Fidus","Amigo Gourmet","Otros","Ninguno de los anteriores")) cuest.agregaPreguntaCheckbox("1", "¿Qué productos de Kileo Perro encuentras en esta tienda?", Array As String("Pedigree Adulto", "Pedigree Cachorro", "Pedigree Razas Pequeñas", "Champ", "PAL","DOG CHOW ADULTO","DOG CHOW CACHORRO","DOG CHOW RAZAS PEQUEÑAS","Campeon","Ganador","Poder canino","Perron","Silverkan","Woow","Chapetes","Dyno","Beriscan","Nogacan","Nutrescan","Fidus","Amigo Gourmet","Otros","Ninguno de los anteriores"))
' Return False Return False
' End If End If
If TOMAR_FOTO = 0 Then If TOMAR_FOTO = 0 Then
Cuestionario Cuestionario

View File

@@ -167,6 +167,8 @@ Sub agregaPreguntaAbierta(id As String, pregunta As String, ids As List, respues
Log("Iniciamos PreguntaAbierta") Log("Iniciamos PreguntaAbierta")
Log(ids) Log(ids)
Log(respuestas) Log(respuestas)
Private sv_cuest As ScrollView
sv_cuest.Initialize(500dip)
encuestaIniciada = True encuestaIniciada = True
vPreguntaActual = id vPreguntaActual = id
bAceptarPregunta.Initialize("bAceptarPregunta") bAceptarPregunta.Initialize("bAceptarPregunta")
@@ -178,6 +180,11 @@ Sub agregaPreguntaAbierta(id As String, pregunta As String, ids As List, respues
panelSombra.Background = cd panelSombra.Background = cd
Private panelX As Panel 'Panel de la pregunta. Private panelX As Panel 'Panel de la pregunta.
panelX.Initialize("pQuest") panelX.Initialize("pQuest")
Private sv_cuest As ScrollView
sv_cuest.Initialize(100dip)
Private panel2 As Panel 'Panel de la pregunta.
panel2.Initialize("panel2")
panel2.Color = Colors.Yellow
panelActual = panelX panelActual = panelX
Private lbl As Label 'Etiqueta de la pregunta. Private lbl As Label 'Etiqueta de la pregunta.
lbl.Initialize("") lbl.Initialize("")
@@ -201,23 +208,29 @@ Sub agregaPreguntaAbierta(id As String, pregunta As String, ids As List, respues
labelX(p).As(B4XView).SetTextAlignment("CENTER", "CENTER") labelX(p).As(B4XView).SetTextAlignment("CENTER", "CENTER")
et(p).SetTextSizeAnimated(0, 14) et(p).SetTextSizeAnimated(0, 14)
et(p).Tag = CreateMap("id":id, "pregunta":pregunta, "panel":panelSombra, "idRespuesta":ids.Get(p)) et(p).Tag = CreateMap("id":id, "pregunta":pregunta, "panel":panelSombra, "idRespuesta":ids.Get(p))
' Log($"Agregamos ET ${p}"$)
panelX.AddView(labelX(p), 10dip, (70 * (p + 1)), (panelX.Width * 0.75), 60) 'Agregamos la etiqueta al panel.
panelX.AddView(et(p), (labelX(p).Width + 10), (70 * (p + 1)), (panelX.Width * 0.2), 60) 'Agregamos el edittext al panel.
et(p).Text = ""
labelX(p).Text = respuestas.Get(p) labelX(p).Text = respuestas.Get(p)
Private newTop As Int = lbl.top + lbl.Height + 20 'Si es el primer radio, lo ponemos en top = alto de la "pregunta" + 10. et(p).Text = ""
Log($"Agregamos ET ${labelX(p).text} - ${(70*p)}"$)
sv_cuest.panel.AddView(labelX(p), 0, (70 * p), (panelX.Width * 0.72), 60) 'Agregamos la etiqueta al panel.
sv_cuest.panel.AddView(et(p), (labelX(p).Width + 5), (70 * p), (panelX.Width * 0.2), 60) 'Agregamos el edittext al panel.
Private newTop As Int = 0 'lbl.top + lbl.Height + 20 'Si es el primer radio, lo ponemos en top = alto de la "pregunta" + 10.
If p <> 0 Then newTop = et(p - 1).Top + et(p - 1).Height + 5 'Calculamos el Top del radio de acuerdo al top y alto del radio anterior. If p <> 0 Then newTop = et(p - 1).Top + et(p - 1).Height + 5 'Calculamos el Top del radio de acuerdo al top y alto del radio anterior.
et(p).Top = newTop et(p).Top = newTop
labelX(p).Top = newTop labelX(p).Top = newTop
Next Next
bAceptarPregunta.Text = "Continuar" bAceptarPregunta.Text = "Continuar"
' panelX.AddView(bAceptarPregunta, 10, newTop + r(respuestas.Size - 1).Height + 20, 150dip, 50dip) 'Ponemos el boton de continuar despues del ultimo radio. panelX.AddView(sv_cuest, 10, lbl.top + 45dip, (panelX.Width * 0.95), 300dip)
panelX.AddView(bAceptarPregunta, 10, newTop + 80 + 15, 150dip, 50dip) 'Ponemos el boton de continuar despues del ultimo radio. sv_cuest.panel.Height = newTop + 40dip
panelX.Height = newTop + 80dip + 35dip 'Calculamos el alto del panel de acuerdo al Top del boton.
If panelX.Height > (Root2.Height * 0.7) Then ' Si el panel es mayor al 70%, lo regresamos al 70%.
panelX.Height = Root2.Height * 0.7
End If
panelX.AddView(bAceptarPregunta, 10, (panelX.Height - 55dip), 150dip, 50dip) 'Ponemos el boton de continuar despues del ultimo radio.
bAceptarPregunta.Left = (panelX.Width / 2) - (bAceptarPregunta.Width / 2) bAceptarPregunta.Left = (panelX.Width / 2) - (bAceptarPregunta.Width / 2)
panelX.Height = bAceptarPregunta.Top + bAceptarPregunta.Height + 15dip 'Calculamos el alto del panel de acuerdo al Top del boton. sv_cuest.Height = panelX.Height - (lbl.Top + lbl.Height) - 55dip
panelX.left = (Root2.Width / 2) - (panelX.Width / 2) panelX.left = (Root2.Width / 2) - (panelX.Width / 2)
panelX.top = (Root2.Height / 3) - (panelX.Height / 2) panelX.top = (Root2.Height / 2) - (panelX.Height / 2) 'Centramos verticalmente el panel.
If respuestas.Size < 10 Then panelX.top = (Root2.Height / 3) - (panelX.Height / 2) ' Si hay mas de 9 productos en la lista, ponemos el panel a 1/3 de altura
panelSombra.Width = Root2.Width panelSombra.Width = Root2.Width
panelSombra.Height = Root2.Height panelSombra.Height = Root2.Height
panelSombra.Elevation = 100dip panelSombra.Elevation = 100dip

View File

@@ -190,7 +190,7 @@ Version=12.8
#Region Project Attributes #Region Project Attributes
#ApplicationLabel: Guna V3.1 #ApplicationLabel: Guna V3.1
#VersionCode: 1 #VersionCode: 1
#VersionName: 4.07.15.E_PR2_ENCPED #VersionName: 4.07.24.EP
'SupportedOrientations possible values: unspecified, landscape or portrait. 'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait #SupportedOrientations: portrait
#CanInstallToExternalStorage: False #CanInstallToExternalStorage: False

View File

@@ -53,7 +53,7 @@ ModuleClosedNodes1=5,7,8,9,10,11,12,13,14
ModuleClosedNodes10= ModuleClosedNodes10=
ModuleClosedNodes11= ModuleClosedNodes11=
ModuleClosedNodes12=6 ModuleClosedNodes12=6
ModuleClosedNodes13=2,8,10,14 ModuleClosedNodes13=
ModuleClosedNodes14= ModuleClosedNodes14=
ModuleClosedNodes15= ModuleClosedNodes15=
ModuleClosedNodes16= ModuleClosedNodes16=
@@ -67,12 +67,12 @@ ModuleClosedNodes22=1
ModuleClosedNodes23= ModuleClosedNodes23=
ModuleClosedNodes24= ModuleClosedNodes24=
ModuleClosedNodes3= ModuleClosedNodes3=
ModuleClosedNodes4=12,14,15,16 ModuleClosedNodes4=
ModuleClosedNodes5=7 ModuleClosedNodes5=7
ModuleClosedNodes6=6,8,9,10 ModuleClosedNodes6=8,9,10
ModuleClosedNodes7= ModuleClosedNodes7=
ModuleClosedNodes8= ModuleClosedNodes8=
ModuleClosedNodes9= ModuleClosedNodes9=
NavigationStack=C_TicketsDia,B4XPage_Appear,60,0,C_Nota,Class_Globals,0,0,C_Nota,B4XPage_Appear,94,5,C_Principal,Class_Globals,0,0,C_Principal,resdia_Click,2117,0,C_Principal,JobDone,1415,0,C_Principal,cargar_Click,797,0,C_Principal,e_ruta_EnterPressed,1907,0,C_Cliente,Cuestionario,3928,0,C_Cliente,GPS_LocationChanged,882,0 NavigationStack=C_Cliente,B4XPage_Created,450,0,C_Cuestionario,Class_Globals,5,0,C_Cuestionario,Initialize,18,0,C_Cuestionario,B4XPage_Created,31,0,C_Cliente,GPS_LocationChanged,842,0,C_Cliente,gest_Click,1082,0,C_Cliente,cuest_preguntaContestada,4240,0,C_Cliente,Cuestionario,3977,0,C_Cuestionario,agregaPreguntaCheckbox,72,0,C_Cuestionario,agregaPreguntaRadio,120,0,Visual Designer,cliente.bal,-100,1,C_Cuestionario,agregaPreguntaAbierta,186,6,Main,Process_Globals,21,0
SelectedBuild=0 SelectedBuild=0
VisibleModules=22,2,23,13,14,4,6,9,12,5 VisibleModules=22,2,23,13,14,4,6,9,12,5,24

View File

@@ -191,7 +191,7 @@ Sub flp_LocationChanged (Location1 As Location)
'/////// '///////
Dim coords As String = Location1.Latitude&","&Location1.Longitude&","&formatoFecha(Location1.Time) Dim coords As String = Location1.Latitude&","&Location1.Longitude&","&formatoFecha(Location1.Time)
' Log("Loc changed : "&Location1.Latitude&","&Location1.Longitude&"|"&B4XPages.MainPage.usuario&"|") ' Log("Loc changed : "&Location1.Latitude&","&Location1.Longitude&"|"&B4XPages.MainPage.usuario&"|")
Log("Mandamos Ubicacion") ' Log("Mandamos Ubicacion")
Log(FirebaseMessaging.locRequest) Log(FirebaseMessaging.locRequest)
' Solo mandamos la ubicacion si la precision es menor a XX mts ' Solo mandamos la ubicacion si la precision es menor a XX mts
If Location1.Accuracy < 100 Then If Location1.Accuracy < 100 Then
@@ -201,7 +201,7 @@ Sub flp_LocationChanged (Location1 As Location)
B4XPages.MainPage.cliente.LA_GPS.Text = "CON UBICACION GPS" B4XPages.MainPage.cliente.LA_GPS.Text = "CON UBICACION GPS"
B4XPages.MainPage.cliente.LA_GPS.TextColor = Colors.blue B4XPages.MainPage.cliente.LA_GPS.TextColor = Colors.blue
End If End If
LogColor(Location1.Latitude, Colors.red) ' LogColor(Location1.Latitude, Colors.red)
CallSub2(Starter, "GPS_LocationChanged", Location1) CallSub2(Starter, "GPS_LocationChanged", Location1)
' CallSub2(gestion, "GPS_LocationChanged", Location1) ' CallSub2(gestion, "GPS_LocationChanged", Location1)
CallSub2(B4XPages.GetPage("Cliente"), "GPS_LocationChanged", Location1) CallSub2(B4XPages.GetPage("Cliente"), "GPS_LocationChanged", Location1)