Page 1 of 1
ComboBox
Posted: Fri Feb 15, 2013 2:56 am
by Colin Haig
Hi All
In the code below should the combobox show cComboVar ("B") it always displays "A"
Colin
Code: Select all
#include "FiveLinux.ch"
function main()
local oWnd,oCombo,aItems := {"A","B","C"},cComboVar := "B"
DEFINE WINDOW oWnd ;
SIZE 800,600
@10,10 COMBOBOX oCombo VAR cComboVar of oWnd ITEMS aItems
ACTIVATE WINDOW oWnd CENTERED ;
VALID MsgYesNo( "Are you sure ?" )
return(nil)
Re: ComboBox
Posted: Sat Feb 16, 2013 9:12 am
by Antonio Linares
Colin,
In Class TComboBox Method New() you have to swap these lines:
::SetItems( aItems )
::SetText( Eval( bSetGet ) )
with such change is working fine
Re: ComboBox
Posted: Sun Feb 17, 2013 11:58 pm
by Colin Haig
Hi Antonio
Thanks - combobox working ok - any update on the problems with gets.
Cheers
Colin
Re: ComboBox
Posted: Mon Feb 18, 2013 1:50 pm
by Antonio Linares
Colin,
We have traced it and Method GotFocus() is called, but the calls to ::SetCurPos() or ::SetSel() don't work from within the method. Called externally, they are fine.
I have done lots of tests.
I have search the web for some hints, but found nothing yet. In the menatime I have asked Rafa Carmona for a hint as he is used to GTK+ also
Re: ComboBox
Posted: Mon Feb 18, 2013 5:02 pm
by Antonio Linares
Colin,
In FiveLinux/source/winapi/gets.c I have replaced:
Code: Select all
gtk_signal_connect( GTK_OBJECT( hWnd ), "focus_in_event",
G_CALLBACK( GotFocusEvent ), NULL );
with:
Code: Select all
gtk_signal_connect_after( GTK_OBJECT( hWnd ), "focus_in_event",
G_CALLBACK( GotFocusEvent ), NULL );
but it seems as it does not work as expected. I keep searching...
Re: ComboBox
Posted: Tue Feb 19, 2013 11:01 pm
by Antonio Linares
Problem solved!
This line made the trick:
Code: Select all
g_object_set( gtk_widget_get_settings( hWnd ),
"gtk-entry-select-on-focus", FALSE, NULL );
I am going to provide a new FiveLinux download with this change
Re: ComboBox
Posted: Wed Feb 20, 2013 5:31 am
by Colin Haig
Hi Antonio
I downloaded the latest version and copied the libs to the right location and recompiled but the
following error occurs on compiling and linking.
/home/colin/fivelinux/lib/libfivec.a(lnx.o): In function `button_press_event':
lnx.c:(.text+0xaad): undefined reference to `hb_extIsNil'
collect2: ld returned 1 exit status
Thanks for the great effort with this.
Regards
Colin
Re: ComboBox
Posted: Wed Feb 20, 2013 2:30 pm
by Antonio Linares
Colin,
What Harbour version are you using ?
Re: ComboBox
Posted: Wed Feb 20, 2013 11:19 pm
by Colin Haig
Hi Antonio
Harbour 3.0.0 (Rev 16951)
Cheers
Colin
Re: ComboBox
Posted: Thu Feb 21, 2013 12:03 am
by Colin Haig
Hi Antonio
Hi downloaded the version on your site and still get the same error.
Harbour 3.2.0dev (Rev 18412)
Cheers
Colin
Re: ComboBox
Posted: Thu Feb 21, 2013 7:27 am
by Antonio Linares
Colin,
It seems to me as you are using a wrong header file somewhere.
Please search for hb_extIsNil in all Harbour source code (and header files) and in FiveLinux sources. I don't find it.
Thats why I guess that we are not using the same header files.
Re: ComboBox
Posted: Thu Feb 21, 2013 9:02 am
by Colin Haig
Hi Antonio
The error appears to point to this file.
/fivewin/source/internal/lnx.c
home/colin/fivelinux/lib/libfivec.a(lnx.o): In function `button_press_event':
lnx.c:(.text+0xaad): undefined reference to `hb_extIsNil'
Code: Select all
gboolean button_press_event( GtkWidget * hWnd, GdkEventButton * event )
{
if( event->button == 1 )
{
hb_vmPushSymbol( pFLH );
hb_vmPushNil();
hb_vmPushLong( WM_LBUTTONDOWN ); // nMsg
hb_vmPushLong( ( HB_ULONG ) event->y ); // nWParam
hb_vmPushLong( ( HB_ULONG ) event->x ); // nLParam
hb_vmPushLong( ( HB_ULONG ) gtk_object_get_data( GTK_OBJECT( hWnd ), "WP" ) );
hb_vmFunction( 4 );
}
return ! HB_ISNIL( -1 ); // FALSE invokes default behavior
Cheers
Colin
Re: ComboBox
Posted: Wed Feb 27, 2013 8:10 am
by Antonio Linares
Solved on TeamViewer, simply updating everything from the SVN repositories and rebuilding everything