FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour New combo class : TxCombox
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM
New combo class : TxCombox
Posted: Mon Jul 21, 2014 02:03 PM
A comboclass which uses multidimensional array’s or ADO tables as data source.
We have also to tell the program which column (number or name) must update the get (from te combox)

A little example (Array from code) , leaving only what is relevant

Code (fw): Select all Collapse
Arr := {{" ","Empty"},{"M", "Monday"}, {"T", "Tuesday"},{"W","Wednesday"}} 
TXCOMBOX oCombox ;
    ARRAY Arr;
    HEADERS "Day" ;     // Second column receive default !
    SIZES 35                // Second column receive default !
WITH OBJECT oCombox
    REDEFINE GET oGet VAR inp ID 180 OF oDlg PICTURE "!"//UPDATE
    :MakeGetBox(oGet,"Day")
END


Using a ADO Table :

Code (fw): Select all Collapse
oRs := AdoUse(g:Con,"Gemeente")  // Fields gemeente , postnr , alfabetic

TXCOMBOX ComboAdo RECSET oRs;
     FIELDS "Postnr","Gemeente","Alfabetic";
     HEADER "Postcode","City";
     COLSIZES  50,150

REDEFINE GET oGet VAR Postcode....
ComboAdo:MakeGetBox(oGet,"PostCode")


ADDITINAL possibilty's :

1) The combox array can be built from DBF

Code (fw): Select all Collapse
TXCOMBOX ComboArr ;   // All the fields from the dbf are included   gemeente , postnr
                                     // FIELDS Gemeente , postnr is als possible
     HEADERS "City" , "Postcode" ;
     ALIAS GEMEENTE;
     COLSIZES 150 , 40
COmboArr:BuildArr()
REDEFINE GET oGet VAR Postcode....
ComboArr:MakeGetBox(oGet,"PostCode")


2) We can link a Comboget to other control's as :

Code (fw): Select all Collapse
REDEFINE oSay .....
oGet TXLINK TO oSay COL "City" , ....
TxMakelink(oGet)


The osay will be updated from the oget with column city

3) Using Filters

Each txcombox can have a filter like :
Code (fw): Select all Collapse
   Combo:bFilter    := {||c := "1*","Postnr LIKE " + c}}
   // c can also be a value from another get
   // a get can determine the combo arrays or ors from the other get's


4) Also available in xbrowse , example :
Code (fw): Select all Collapse
WITH OBJECT oBrw:oCol("CLient")
    :nEditType := EDIT_GET_BUTTON
    ComboCl:MakeGetBox(oBrw:oCol("CLIENT"))
END
TXLINK oBrw:oCol("Client") TO oBrw:oCol("Country") COL "Country"


Code and demo's are available

You can try as link : https://www.mediafire.com/?7cx5ppjklv3hxrq

Frank Demont
test
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: New combo class : TxCombox
Posted: Wed Jul 23, 2014 04:21 AM
Frank,

many thanks for sharing it :-)

I have posted it here so it does not get lost:
https://bitbucket.org/fivetech/fivewin-contributions/downloads/FrankDemont_Class_TXComboX.zip
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM
Re: New combo class : TxCombox
Posted: Sun Aug 03, 2014 07:23 AM
Hello,

New version : Data source can also be a dbf-file.

Example :

Code (fw): Select all Collapse
  TXCOMBOX g:ComboGemDbf    ;   // All the fields from the dbf are included   gemeente , postnr
      HEADERS "City" , "PostCode" ;
      ALIAS GEMEENTE ; //COLSIZES 150 , 40;
      DBFCOMBO ORDERS "Alfabetic","postnr"


If intrested , let me know
test

Continue the discussion