Klaus
Nombre de messages : 12331 Age : 75 Localisation : Ile de France Date d'inscription : 29/12/2009
| Sujet: Re: [Résolu] Un bug avec la dernière version de KGF Dim 14 Juil 2019 - 7:38 | |
| Mais oui, c'est bien sûr... La fonction a changé de nom ! Elle s'appelle maintenant SetMultiSelectionLimitOfIconListBox ! D'ailleurs, c'est comme ça dans la doc... EDITVoici le programme de démo: - Code:
-
' test_IconComboBox.bas
label creer, supprimer, UserEvent, creerL, supprimerL, selectionL, changeL3, selectL3
dim res%, ICB%, IL%, ILB%, no%, s$, WParam%, LParam%, index%, UserICB%, UserILB% dim no_DoIcons%, no_DoIndent%, options%, no_memo%, no_Multi%, no_Limite% dim cFond% : cFond% = hex("FFFFFF") : ' blanc dim cFont% : cFont% = hex("000000") : ' noir dim cSelect% : cSelect% = hex("FF0000") : ' bleu
' dim ilb$ : ilb$ = "KGF.ilb" dim ilb$ : ilb$ = "MonTest_32x32.ilb"
dll_on "KGF.dll" width 0,700
on_user_event UserEvent
no% = no% + 1 : memo no% : no_memo% = no% : hide no% : bar_both no%
no% = no% + 1 : check no% : top no%,10 : no_DoIcons% = no% : caption no%,"Afficher icônes" no% = no% + 1 : check no% : top no%,10 : left no%,130 : no_DoIndent% = no% : caption no%,"Indentation" no% = no% + 1 : check no% : top no%,10 : left no%,260 : no_Multi% = no% : width no%,120 : caption no%,"Sélection multiple" no% = no% + 1 : alpha no% : top no%,10 : left no%,390 : caption no%,"Limite de sélection:" no% = no% + 1 : spin no% : top no%,10 : left no%,490 : no_Limite% = no% : width no%,60 : min no%,0
no% = no% + 1 : button no% : top no%,40 : caption no%,"Créer" : on_click no%,creer no% = no% + 1 : button no% : top no%,40 : left no%,width(no%-1) : caption no%,"Supprimer" : on_click no%,supprimer
no% = no% + 1 : button no% : top no%,40 : left no%,left(no%-1)+width(no%-1)+100 : caption no%,"Créer" : on_click no%,creerL no% = no% + 1 : button no% : top no%,40 : left no%,left(no%-1)+width(no%-1) : caption no%,"Supprimer" : on_click no%,supprimerL no% = no% + 1 : button no% : top no%,40 : left no%,left(no%-1)+width(no%-1) : caption no%,"Sélection" : on_click no%,selectionL no% = no% + 1 : button no% : top no%,40 : left no%,left(no%-1)+width(no%-1) : caption no%,"Change ligne 3" : on_click no%,changeL3 no% = no% + 1 : button no% : top no%,40 : left no%,left(no%-1)+width(no%-1) : caption no%,"Clic ligne 3" : on_click no%,selectL3
' IL% = dll_call2("CreateImageList",16,16) IL% = dll_call2("CreateImageList",32,32) res% = dll_call2("LoadImageList",IL%,adr(ilb$)) end
UserEvent: if bin_and(user_event_wparam,hex("FF000000"))=hex("09000000") : ' IconComboBox if bin_and(user_event_wparam,hex("00FF0000"))<>hex("00010000") then return index% = bin_and(user_event_wparam,hex("0000FFFF")) UserICB% = user_event_lparam : ' ici, on a l'identifiant de l'objet ayant généré l'évènement ! s$ = string$(50," ") res% = dll_call3("GetItemOfIconComboBox",ICB%,index%,adr(s$)) s$ = trim$(s$) message "clic dans IconComboBox ligne "+str$(index%)+" = "+s$ return end_if if bin_and(user_event_wparam,hex("FF000000"))=hex("0A000000") : ' IconListBox if bin_and(user_event_wparam,hex("00FF0000"))<>hex("00010000") then return index% = bin_and(user_event_wparam,hex("0000FFFF")) UserILB% = user_event_lparam : ' ici, on a l'identifiant de l'objet ayant généré l'évènement ! s$ = string$(50," ") res% = dll_call3("GetItemOfIconListBox",ILB%,index%,adr(s$)) s$ = trim$(s$) message "clic dans IconListBox ligne "+str$(index%)+" = "+s$ return end_if return
creer: if ICB%<>0 then return options% = 0 if checked(no_DoIcons%)=1 then options% = options% + 1 if checked(no_DoIndent%)=1 then options% = options% + 2 ICB% = dll_call3("CreateIconComboBox",handle(0),IL%,options%) res% = dll_call5("LocateIconComboBox",ICB%,20,80,200,0) if 1=2 transp% = hex("FFFFFF") s$ = "Déjeuner" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),1,1,0,0) s$ = "Hors-d'oeuvres" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),4,1,0,1) s$ = "Pâté de campagne" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),7,1,0,2) s$ = "Radis/Beurre" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),10,1,0,2) s$ = "Plats" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),13,1,0,1) s$ = "Steak/frites" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),16,1,0,2) s$ = "Dîner" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),19,1,0,0) else s$ = "Déjeuner" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),2,1,0,0) s$ = "Hors-d'oeuvres" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),1,0,0,1) s$ = "Pâté de campagne" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),0,1,0,2) : ' pas d'icône ! s$ = "Radis/Beurre" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),1,0,0,2) s$ = "Plats" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),2,1,0,1) s$ = "Steak/frites" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),1,0,0,2) s$ = "Dîner" res% = dll_call6("AddItemToIconComboBox",ICB%,adr(s$),2,1,0,0) end_if res% = dll_call4("SetColorsForIconComboBox",ICB%,cFond%,cFont%,cSelect%)
return
supprimer: ICB% = dll_call1("DeleteIconComboBox",ICB%) return
creerL: if ILB%<>0 then return options% = 0 if checked(no_DoIcons%)=1 then options% = options% + 1 if checked(no_DoIndent%)=1 then options% = options% + 2 ILB% = dll_call3("CreateIconListBox",handle(0),IL%,options%) res% = dll_call5("LocateIconListBox",ILB%,240,80,200,300) res% = dll_call2("SetMultiSelectionLimitOfIconListBox",ILB%,position(no_Limite%)) if 1=2 transp% = hex("FFFFFF") s$ = "Déjeuner" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),1,1,0,0) s$ = "Hors-d'oeuvres" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),4,1,0,1) s$ = "Pâté de campagne" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),7,1,0,2) s$ = "Radis/Beurre" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),10,1,0,2) s$ = "Plats" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),13,1,0,1) s$ = "Steak/frites" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),16,1,0,2) s$ = "Dîner" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),19,1,0,0) else s$ = "Déjeuner" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),2,1,0,0) s$ = "Hors-d'oeuvres" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),1,0,0,1) s$ = "Pâté de campagne" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),0,1,0,2) : ' pas d'icône ! s$ = "Radis/Beurre" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),1,0,0,2) s$ = "Plats" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),2,1,0,1) s$ = "Steak/frites" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),1,0,0,2) s$ = "Dîner" res% = dll_call6("AddItemToIconListBox",ILB%,adr(s$),2,1,0,0) end_if
res% = dll_call4("SetColorsForIconListBox",ILB%,cFond%,cFont%,cSelect%) res% = dll_call2("OptionsForIconListBox",ILB%,checked(no_Multi%)) return supprimerL: ILB% = dll_call1("DeleteIconListBox",ILB%) return
selectionL: res% = dll_call2("GetAllSelectedItemsFromIconListBox",ILB%,handle(no_memo%)) message text$(no_memo%) return changeL3: res% = dll_call6("ChangeElementIconInIconListBox",ILB%,3,1,0,0,2) s$ = "Oeuf dur - mayonnaise" res% = dll_call3("ChangeElementTextInIconListBox",ILB%,3,adr(s$)) return SelectL3: res% = dll_call2("SelectItemOfIconListBox",ILB%,3) return
| |
|