Hello all.
I'm working on an application with SSP1.3 and GUIX Studio 5.3.3.7.
In my application I have created a window with a text_input field, when I touch it, I call another window in which I show a keyboard to enter the data. My problem is that, once the data is entered, I can not return to the initial window. Can someone help me?
Next I show the function from which I call the keyboard screen and the function in which the entered data is validated and should call window2
UINT window2_handler(GX_WINDOW *widget, GX_EVENT *event_ptr)
{
volatile UINT result, niLong;
volatile uint32_t nlVal, nlAd1,nlAd2;
volatile char *ncPunt1, *ncPunt2, ncVal, *ncPunt3;
result = gx_window_event_process(widget, event_ptr);
switch (event_ptr->gx_event_type)
{
case GX_SIGNAL(ID_BOTON_RET_1, GX_EVENT_CLICKED):
show_window((GX_WINDOW*)&window1, (GX_WIDGET*)widget, true);
break;
case GX_SIGNAL(ID_CAMPO2, GX_EVENT_CLICKED):
ncPunt2=sDatos.acNombre;
ncPunt1=sDatos.acBuferT;
memcpy(ncPunt1,ncPunt2,16);
niLong=sizeof sDrivers.p_widget;
memcpy(&sDrivers.p_widget,widget,niLong);
niLong=sizeof sDrivers.p_window;
memcpy(&sDrivers.p_window,&window2,niLong);
nlVal=keyboard.keyboard_keyboard_input_field.gx_single_line_text_input_buffer;
ncPunt1=sDatos.acBuferT;
memcpy(nlVal,ncPunt1,LONGCAD);
ncVal=strlen(ncPunt1);
keyboard.keyboard_keyboard_input_field.gx_single_line_text_input_string_size=ncVal;
sDatos.niTeclado=1;
// Show keyboard
vChangeKeyb(widget, event_ptr);
if (sDatos.niRecogiendo>0)
break;
// Guarda dato recogido
ncPunt2=sDatos.acNombre;
ncPunt1=sDatos.acBuferT;
memcpy(ncPunt2,ncPunt1,16);
break;
default:
gx_window_event_process(widget, event_ptr);
break;
}
return result;
}
UINT input_field_event_process(GX_SINGLE_LINE_TEXT_INPUT *text_input, GX_EVENT *event_ptr)
{
volatile uint16_t niLong, niLong2, niVal, niPos, niPos2;
volatile uint32_t functionPtr, status;
// volatile char acBufer[10];
if (event_ptr ->gx_event_type == GX_SIGNAL(IDB_BACKSPACE, GX_EVENT_CLICKED))
{
gx_single_line_text_input_backspace(text_input);
return 0;
}
if (event_ptr ->gx_event_type == GX_SIGNAL(IDB_LET_NUM, GX_EVENT_CLICKED))
{
if (sDatos.niTeclado==0) {
sDatos.niTeclado=1;
} else {
sDatos.niTeclado=0;
}
vChangeKeyb();
return 0;
}
if (event_ptr ->gx_event_type == GX_SIGNAL(IDB_VALIDATE, GX_EVENT_CLICKED))
{
// Inicializa cadena
for (niVal=0;niVal<LONGCAD;niVal++)
sDatos.acBuferT[niVal]=0;
niPos = text_input->gx_single_line_text_input_xoffset;
niPos2 = text_input->gx_single_line_text_input_yoffset;
niLong2 = text_input->gx_single_line_text_input_buffer_size;
niLong = text_input->gx_single_line_text_input_string_size;
if (niLong>0 && niLong<LONGCAD) {
for (niVal=0;niVal<niLong;niVal++) {
sDatos.acBuferT[niVal]=text_input->gx_single_line_text_input_buffer[niVal];
}
}
sDatos.niRecogiendo=0;
/// from here I should go back to window2
return 0;
}
return gx_single_line_text_input_event_process(text_input, event_ptr);
}