ComboBox

Post Reply
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

ComboBox

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


 
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ComboBox

Post 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 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: ComboBox

Post by Colin Haig »

Hi Antonio

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

Cheers

Colin
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ComboBox

Post 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 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ComboBox

Post 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...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ComboBox

Post 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: ComboBox

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ComboBox

Post by Antonio Linares »

Colin,

What Harbour version are you using ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: ComboBox

Post by Colin Haig »

Hi Antonio

Harbour 3.0.0 (Rev 16951)

Cheers

Colin
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: ComboBox

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ComboBox

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: ComboBox

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ComboBox

Post by Antonio Linares »

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

Antonio Linares
www.fivetechsoft.com
Post Reply