FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Antonio: Idea for combobox
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Antonio: Idea for combobox
Posted: Wed Feb 10, 2016 07:18 AM

Similar to xBrowse we can use arrays ::aEditListBound and ::aEditListTxt to split visual text and the bounded text for the variable!?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Idea for combobox
Posted: Wed Feb 10, 2016 08:52 AM

Günther,

I see what you mean, but we should design it carefully not to break backwards compatibility

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Antonio: Idea for combobox
Posted: Thu Feb 18, 2016 06:00 PM
byte-one wrote:Similar to xBrowse we can use arrays ::aEditListBound and ::aEditListTxt to split visual text and the bounded text for the variable!?

Please try DbCombo.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Idea for combobox
Posted: Sat Feb 20, 2016 10:45 AM

Is this class to use only with arrays and without any DB?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Antonio: Idea for combobox
Posted: Sat Feb 20, 2016 10:54 AM

No db is really needed. (When the class was first made it used dbf only).
Now we can use it with arrays or recordsets too

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Antonio: Idea for combobox
Posted: Sat Feb 20, 2016 11:28 AM
Please try this
Code (fw): Select all Collapse
#include "fivewin.ch"
#include "dbcombo.ch"

function Main()

   local aMonths  := {}
   local n, c
   local nVar  := 100
   local cMth
   local oDlg

   for n := 1 to 12
      c  := NToCMonth( n )
      AAdd( aMonths, { Upper( Left( c, 3 ) ), c } )
   next

   cMth  := aMonths[ 2, 1 ]

   DEFINE DIALOG oDlg SIZE 400,400 PIXEL TRUEPIXEL

   @ 20,20 GET nVar SIZE 100,20 PIXEL OF oDlg

   @ 80,20 DBCOMBO cMth SIZE 200,600 PIXEL OF oDlg ;
      ALIAS aMonths ITEMFIELD 1 LISTFIELD 2


   @ 120,20 BUTTON "TEST" SIZE 60,24 PIXEL OF oDlg ACTION MsgInfo( cMth )

   ACTIVATE DIALOG oDlg CENTERED

return nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Idea for combobox
Posted: Sat Feb 20, 2016 03:20 PM

Oh, thanks! Perfect for me!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Antonio: Idea for combobox
Posted: Sat Feb 20, 2016 06:03 PM
byte-one wrote:Oh, thanks! Perfect for me!

I forgot to give one caution.
If the first column is numeric, the values have to be in serial from 1 to n. If not we may get wrong results. Works perfectly if the 1st column is character value.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion