Page 1 of 1

DCCOMBOBOX LIST Array position

Posted: Fri Jun 07, 2019 7:38 am
by Victorio
Hi,
I have DCCOMBOBOX with browse array.
In normal I selecting from all values in array.
But I want also browse all values but position default position cursor to other than first value . Is it possible ?

Or how can I prevent selecting only some values but see all, or filter values that show in LIST but their index must be same as in full array.

For example my array is :
arr:{Alfa,Beta,Gama,Delta}

and want show/select only arr[2] and. arr[3]

I cannot create several arrays because on other place of program I am using indexing from main array.

Re: DCCOMBOBOX LIST Array position

Posted: Fri Jun 07, 2019 12:18 pm
by Auge_Ohr
Victorio wrote:Hi,
For example my array is :
arr:{Alfa,Beta,Gama,Delta}

and want show/select only arr[2] and. arr[3]
if you set "a Filter" Result will always reduce.

what about Color to show all matching Element ? try Ownerdraw / Customdraw to paint Color

Re: DCCOMBOBOX LIST Array position

Posted: Tue Jun 11, 2019 12:16 am
by Victorio
Jimmy , I do not understand, how can I apply filter ?
list of values for DCCOMBOBOX (eXpress++) are in array.
I am interesting, how can leave array as is, and only filter items, which user see in dccombobox but this have not FILTER parameter.

Other way is reprogramming all, but this need more time.

Re: DCCOMBOBOX LIST Array position

Posted: Tue Jun 11, 2019 12:32 am
by Wolfgang Ciriack
I think using a 2-dim Subarray {{"Beta",2},{"Gamma",3}} with the name and position of origin array is the best choice.

Re: DCCOMBOBOX LIST Array position

Posted: Tue Jun 11, 2019 12:47 am
by Tom
IMHO, combos don't support multi-dim arrays.

Victorio, a combo box is a limited control. Maybe a better solution for your issue is an array browse or a protected DCGET with a combo, something like this. If you want to "filter" data in a combo, you have to revise the data source and reset the control to the new source. If you want to get array positions as the result, you have to search for the selected value in the data source - and so on.

Re: DCCOMBOBOX LIST Array position

Posted: Tue Jun 11, 2019 12:54 am
by Victorio
I realize select parameter with 3 arrays / 3 comboboxes,
with 3 arrays

when select first value from combobox, I open second combobox and show array with index as value from 1 array. etc.

at this moment I got idea, realize all with menu, where it can I control better ...

here is part from comboboxes as now I have

Code: Select all

		* pole pre výber údajového súboru
        	aArray2:={ ;
                	"C-PARCELY                      ", ;
                	"E-PARCELY                      ", ;
                	"LISTY VLASTNÍCTVA              ", ;
                	"LISTY VLASTNÍCTVA-VŠETKY SÚBORY", ;
                	"VLASTNÍCI/ÚČASTNÍCI            ", ;
                	"NÁJOMCOVIA                     ", ;
                	"PRÁVNE VZŤAHY                  ", ;
                	"BYTY A NEBYTOVÉ PRIESTORY      ", ;
                	"STAVBY NA POZEMKU              ", ;
                	"VŠETKY SÚBORY                  "  ;
                	}

		* pole pre výber hľadaného údaju
		aArray3:=	{;
				{"PARCELA č: 99999/999/9" , ;
                         	"PARCELA č. 99999 + PODLOMENIA" , ;
                         	"ZMENA VÝMERY" , ;
                         	"ZMENA DRUHU POZEMKU" , ;
                         	"VŠETKY ZMENY"  ;
                        	},;	
				{"PARCELA č: 99999/999/9 , pôv.k.ú.: 99" , ;
                         	"PARCELA č. 99999 , pôv.k.ú.: 99 + PODLOMENIA" , ;
                         	"ZMENA VÝMERY" , ;
                         	"ZMENA DRUHU POZEMKU" , ;
                         	"VŠETKY ZMENY"  ;
                        	},;
				{"LIST VLASTNÍCTVA č: 99999" , ;
                         	"VŠETKY ZMENY"  ;
                        	},;
				{"LIST VLASTNÍCTVA č: 99999" ;
				} ,;
				{"LIST VLASTNÍCTVA C.: 99999" , ;
                         	"MENO VLASTNÍKA : AAAAAA" , ;
                         	"IČO / ROD.Č.: 9999999999" , ;
                         	"ROD.Č. BSM  : +9999999999" , ;
                         	"VŠETKY ZMENY"  ;
                        	},;
				{"EVIDENČNÝ LIST Č.: 99999" , ;
                         	"MENO NÁJOMCU : AAAAAA" , ;
                         	"IČO / ROD.Č.: +9999999999" , ;
                         	"VŠETKY ZMENY"  ;
                        	},;
				{"LIST VLASTNÍCTVA Č.  : 99999" , ;
                         	"TEXT V PRÁVNOM VZŤAHU: AAAAAA" , ;
                         	"VŠETKY ZMENY"  ;
                        	},;
				{"LIST VLASTNICTVA Č.: 99999 (iba do 1.1.1997!)" , ;
                         	"IDENTIFIKAČNÉ ČÍSLO PRIESTORU (ICP) : 99999" , ;			 
                         	"VŠETKY ZMENY"  ;
                        	},;
				{"LIST VLASTNÍCTVA Č.: 99999 (iba zmeny do cca 1.12.1999 !)" , ;
                         	"LIST VLASTNÍCTVA Č.: 99999 (zmeny po cca 1.12.1999 !)" , ;
                         	"ID.ČÍSLO STAVBY  Č.: 999999" , ;
                         	"SÚPISNÉ ČÍSLO STAVBY : 999999" , ;
                         	"ČÍSLO PARCELY : 99999/999/9" , ;
                         	"VŠETKY ZMENY"  ;
                        	},;
				{"POLOŽKA VZ : 99999 / 99" , ;
                         	"VŠEOBECNÝ TEXT : AAAAAA" , ;
                         	"LIST VLASTNÍCTVA : 99999" , ;
                         	"VŠETKY ZMENY"  ;
                        	};
				}

		* predvolenie defaultnej hodnoty, toto by si program mohol aj pamätať
		cSelect2:= 'C-PARCELY'
		cSelect3:= 'PARCELA č: 99999/999/9'
		aArray3p:= aArray3[1]

		p[1]:=1
		q[1]:=1

	aktriadok+=6
        @ aktriadok,5 DCSAY 'Výber údajového súboru' SAYSIZE 0 

	aktriadok++

        @ aktriadok, 10 DCCOMBOBOX cSelect2 TYPE XBPCOMBO_SIMPLE ;
               LIST aArray2 ;
               SIZE 60, 10*kpixy   ;
            	ITEMSELECTED {|a,b,o|q:=o:xbpListBox:getdata(),aArray3p:=aArray3[q[1]],cSelect3:=aArray3p[1],;
                           DC_VarToListBox(oComboBox3),;   // toto stačí na prepojenie
                           DC_GetRefresh(GetList,'CSELECTION7')} ;
            	ITEMMARKED {|a,b,o|q:=o:xbpListBox:getdata(),aArray3p:=aArray3[q[1]],cSelect3:=aArray3p[1],;
                           DC_VarToListBox(oComboBox3),;   // toto stačí na prepojenie
                           DC_GetRefresh(GetList,'CSELECTION7')}

***********************************************************************************
* zadanie 3.podmienky - Vyhľadávací kľúč, podmieneny výber podľa údajového súboru
***********************************************************************************
        @ aktriadok-1,70 DCSAY 'Výber vyhľadávacieho kľúča' SAYSIZE 0

        @ aktriadok, 75 DCCOMBOBOX cSelect3 TYPE XBPCOMBO_SIMPLE ;
                LIST aArray3p ;
                SIZE 60, 10*kpixy  ;
		OBJECT oCombobox3 ;
		ID 'CSELECTION7' ;
            	ITEMSELECTED {|a,b,m|r:=m:xbpListBox:getdata()} ;  // toto stačí na prepojenie
            	ITEMMARKED {|a,b,m|r:=m:xbpListBox:getdata()}   // toto stačí na prepojenie

DCGETOPTIONS ABORTQUERY MSG {||prerusit:=.T.} CLOSEQUERY MSG {||prerusit:=.T.} ;
        FONT fontbt SAYFONT fontbt GETFONT fontbt ;
        SAYWIDTH 0 ;
	ALWAYSONTOP ;
	RESIZE RESIZEDEFAULT DCGUI_RESIZE_AUTORESIZE_SCALEFONT 

DCREAD GUI ADDBUTTONS FIT MODAL CLEAREVENTS TO lOk ;
        TITLE "NASTAVENIE PARAMETROV VYHĽADÁVANIA V RETRODATABÁZACH" OPTIONS GetOptions ;
	EVAL {|o|SetAppWindow(o),DC_Getrefresh()} ;
	HANDLER myHandlercombo			

*ošetrenie hodnôt, ak prerušenie
if empty(q[1])
	q[1]:=11
	cSelect2:=""
endif
if empty(r[1])
	r[1]:=1
	cSelect3:=""
endif