Antonio: Idea for combobox

Antonio: Idea for combobox

Postby byte-one » Wed Feb 10, 2016 7: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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Idea for combobox

Postby Antonio Linares » Wed Feb 10, 2016 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42074
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Antonio: Idea for combobox

Postby nageswaragunupudi » Thu Feb 18, 2016 6: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Idea for combobox

Postby byte-one » 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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Idea for combobox

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Idea for combobox

Postby nageswaragunupudi » Sat Feb 20, 2016 11:28 am

Please try this
Code: Select all  Expand view
#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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Idea for combobox

Postby byte-one » Sat Feb 20, 2016 3:20 pm

Oh, thanks! Perfect for me!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Idea for combobox

Postby nageswaragunupudi » Sat Feb 20, 2016 6: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests