ComboBox

ComboBox

Postby Colin Haig » Fri Feb 15, 2013 2:56 am

Hi All

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

Colin
Code: Select all  Expand view

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


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

Re: ComboBox

Postby Antonio Linares » Sat Feb 16, 2013 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 35348
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ComboBox

Postby Colin Haig » Sun Feb 17, 2013 11:58 pm

Hi Antonio

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

Cheers

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

Re: ComboBox

Postby Antonio Linares » Mon Feb 18, 2013 1: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
User avatar
Antonio Linares
Site Admin
 
Posts: 35348
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ComboBox

Postby Antonio Linares » Mon Feb 18, 2013 5:02 pm

Colin,

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

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


with:

Code: Select all  Expand view
  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: 35348
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ComboBox

Postby Antonio Linares » Tue Feb 19, 2013 11:01 pm

Problem solved! :-)

This line made the trick:

Code: Select all  Expand view
  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
User avatar
Antonio Linares
Site Admin
 
Posts: 35348
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ComboBox

Postby Colin Haig » Wed Feb 20, 2013 5: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 to `hb_extIsNil'
collect2: ld returned 1 exit status

Thanks for the great effort with this.

Regards

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

Re: ComboBox

Postby Antonio Linares » Wed Feb 20, 2013 2:30 pm

Colin,

What Harbour version are you using ?
regards, saludos

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

Re: ComboBox

Postby Colin Haig » Wed Feb 20, 2013 11:19 pm

Hi Antonio

Harbour 3.0.0 (Rev 16951)

Cheers

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

Re: ComboBox

Postby Colin Haig » 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
Colin Haig
 
Posts: 307
Joined: Mon Oct 10, 2005 5:10 am

Re: ComboBox

Postby Antonio Linares » Thu Feb 21, 2013 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 35348
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ComboBox

Postby Colin Haig » Thu Feb 21, 2013 9: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: Select all  Expand view

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
Colin Haig
 
Posts: 307
Joined: Mon Oct 10, 2005 5:10 am

Re: ComboBox

Postby Antonio Linares » Wed Feb 27, 2013 8:10 am

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

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


Return to FiveLinux / FiveDroid (Android)

Who is online

Users browsing this forum: No registered users and 1 guest