FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveLinux / FiveDroid (Android) ComboBox
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
ComboBox
Posted: Fri Feb 15, 2013 02:56 AM
Hi All

In the code below should the combobox show cComboVar ("B") it always displays "A"

Colin
Code (fw): Select all Collapse
#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)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: ComboBox
Posted: Sat Feb 16, 2013 09:12 AM

Colin,

In Class TComboBox Method New() you have to swap these lines:

::SetItems( aItems )
::SetText( Eval( bSetGet ) )

with such change is working fine :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: ComboBox
Posted: Sun Feb 17, 2013 11:58 PM

Hi Antonio

Thanks - combobox working ok - any update on the problems with gets.

Cheers

Colin

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: ComboBox
Posted: Mon Feb 18, 2013 01:50 PM

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 :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: ComboBox
Posted: Mon Feb 18, 2013 05:02 PM
Colin,

In FiveLinux/source/winapi/gets.c I have replaced:

Code (fw): Select all Collapse
   gtk_signal_connect( GTK_OBJECT( hWnd ), "focus_in_event",
                             G_CALLBACK( GotFocusEvent ), NULL );


with:

Code (fw): Select all Collapse
   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...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: ComboBox
Posted: Tue Feb 19, 2013 11:01 PM
Problem solved! :-)

This line made the trick:

Code (fw): Select all Collapse
   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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: ComboBox
Posted: Wed Feb 20, 2013 05:31 AM

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 tohb_extIsNil'
collect2: ld returned 1 exit status

Thanks for the great effort with this.

Regards

Colin

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: ComboBox
Posted: Wed Feb 20, 2013 02:30 PM

Colin,

What Harbour version are you using ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: ComboBox
Posted: Wed Feb 20, 2013 11:19 PM

Hi Antonio

Harbour 3.0.0 (Rev 16951)

Cheers

Colin

Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: ComboBox
Posted: Thu Feb 21, 2013 12:03 AM

Hi Antonio

Hi downloaded the version on your site and still get the same error.

Harbour 3.2.0dev (Rev 18412)

Cheers

Colin

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: ComboBox
Posted: Thu Feb 21, 2013 07:27 AM

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.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: ComboBox
Posted: Thu Feb 21, 2013 09:02 AM
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 (fw): Select all Collapse
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: ComboBox
Posted: Wed Feb 27, 2013 08:10 AM

Solved on TeamViewer, simply updating everything from the SVN repositories and rebuilding everything :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion