ArrayArrayArrayArrayArrayArrayArrayArrayArray
Statistics: Posted by 23fx23 — 17 Dec 2011, 20:34 Statistics: Posted by Fléau — 17 Dec 2011, 11:44 Statistics: Posted by Fléau — 16 Dec 2011, 20:38 Statistics: Posted by 23fx23 — 23 Nov 2011, 21:00 Statistics: Posted by Fléau — 23 Nov 2011, 20:14 CODE: Statistics: Posted by 23fx23 — 23 Nov 2011, 12:11
]]>
]]>
it would be great if you give us the entire code again,
but i prefer you give me (fleau) the lines to be replaced (i'd like to understand
)
thanks.
edit: working on preset rating with something like 'concat string' and symbols,
will post it there if it works.
]]>
yes the array used to store the colors got it's max size initialized on init procedure, so must re- init the script if changed to update.
Reload works well for everything exept stuff that chged in init, ie keeping same in outs and sizes, but changing a part of processing code.
well it's actually possible to to the reverse way: feed matrix bmp out to 'draw objects' bmp in, then use the draw object module to overlay 'stars' (wich would more be circles or squares) in each cells, but then it needs a bit more complex script as it has to virtually reproduce the matrix splitted cells on draw module that will receive the mouse infos, plus the scrolling system...
I think martin is overbusy but he once said he was thinking about a way to implement gfx arrays directly on matrix.
(if so an idea is using a bmp in able to read as a frame sequence (like faders) so we can do whatever shape and animation we want,
matrix could then spread the animation for each cell, and display correct frame per cell remaping according to value array.
and if done in black and white, then the independant cell color would have their luma multiplied (classic multiply mode in gfx softs) so ie a fader with black bg and white fader on yellow cell would display a yellow fader on black bg, and with a single animation sequence we could get multiples colors, and faders,knobs, whatever kind of animation could be done easily..
i may have a look if i find time (hard actually) to do the other technique draw stuff, cause it can be also used to display faders in each cells, wich would be quite cool. i already made such patch, but only for 1D non scrollable matrix, will try to extend..
]]>
If the matrix had some more inputs than colors: like bitmaps, this patch would be wonderfull
(you could put some "stars" to give a 'rank') but color is enough.
(Merci 23fx23, tu m'enlèves une énorme épine du pied,
merci aussi pour ce très bon patch et la rapidité de ta réponse ( nay7 too).
]]>// MX_ComboBox______________________23fx 13/05/2k10// /////////////////////////////////////////////////////////////// Matrix based combo box with inertia ///////////////////////////////////////////////////////////////const COLBAZE=4473924;////////////////////////////////////////////////////////var num,toAll,clear,Msdwn,ScrollIn,Mxsize,nbcols,cellscap,arrayout,colorsout,colorsmem,colorin,bordersout,colorout,maxscroll,ID_CLIC,presetout : Tparameter;var pmnum,page,raj,idclic,scrolin,mscroll: integer;var MSD: boolean;var commain, txtin, go: tparameter;var SL1,SLout: tstringlist;var WAITING_NM,OK : boolean;var L,scroll,NB_COLS,NB_ROWS,NBPRESETS: integer;///////////////////////////////////////////////////////////////////////Procedure Init;var i: integer;var s: string;BEGINNBPRESETS:= 512; num := CreateParam('num',PtDataField) ;setIsOutput(num,false); setdontsave(num,false); Msdwn:= CreateParam('msdwn',PtDataField);setIsOutput(msdwn,false); toAll:= CreateParam('toAll',PtDataField);setIsOutput(toAll,false); clear:= CreateParam('clear',PtDataField);setIsOutput(clear,false); commain:= createparam('commain',pttextfield); setisoutput(commain,false); setdontsave(commain,false); txtin:= createparam('txtin',pttextfield);setisoutput(txtin,false); go:= createparam('dbclick',ptdatafield);setisoutput(go,false); ScrollIn:= createparam('ScrollIn',ptdatafield);setisoutput(ScrollIn,false); MXsize:= createparam('Mxsize',ptdatafield);setisoutput(Mxsize,false); NBCOLS:= createparam('NBCOLS',ptdatafield);setisoutput(NBCOLS,false); colorin:= createparam('COLORIN',ptdatafield);setisoutput(COLORIN,false); ID_CLIC := CreateParam('ID_CLIC',PtDataField) ;setIsOutput(ID_CLIC,false); cellscap:= createparam('cellscap',pttextfield);setisinput(cellscap,false); Arrayout:= createparam('arrayout',ptArray);setisinput(arrayout,false); setlength(arrayout,16); colorsOut:= createparam('colorsout',ptArray);setisinput(colorsout,false); setlength(colorsout,16); setMax(colorsOut,MAXINT); colorsMEM:= createparam('colorsMEM',ptArray);setisinput(colorsMEM,false); setlength(colorsMEM,nbpresets); setdontsave(colorsout,false); setMax(colorsMEM,MAXINT); setdontsave(colorsMEM,false); bordersOut:= createparam('bordersout',ptArray);setisinput(bordersout,false); setlength(bordersout,16); setMax(bordersOut,MAXINT);colorout:= createparam('COLOROUT',ptdatafield);setisinput(COLOROUT,false); maxscroll:= createparam('maxscroll',ptdatafield);setisinput(maxscroll,false); presetout:= createparam('presetout',ptdatafield);setisinput(presetout,false); SL1:=Tstringlist.create;SLOUT:=Tstringlist.create; (WAITING_NM):= FALSE; MSD:=false;OK:=true;page:=0;scroll:=0;L:=16;raj:=0;s:='0'; for i:=0 to nbpresets-1 do begin setdataArrayvalue(colorsmem,i,COLBAZE); s:= S+','+intToStr(i+1); end;setstringvalue(cellscap,S);sendinternalMsg('SET_STRING_VALUE','LIST','comma text',S);END;/////////////////////////////////////////Procedure destroy;begin SL1.free; slout.free end;//////////////////////////////////////////////////////////////////Procedure callBack(n : integer);var i: integer;var nblines: single;BEGINif (n=toall) and (getvalue(toall)=1) then begin for i:=0 to maxi(nbpresets,L)-1 do begin setdataArrayvalue(colorsmem,i,getvalue(colorin)); U_CELLS(pmnum); end;end;if (n=id_clic) then begin if getvalue(id_clic)>-1 then begin IDCLIC:= trunc(getvalue(id_clic)); end;end;if (n=ScrollIn) or (n=mxsize) or (n=NBCOLS) or (n=commain) then begin OK:=FALSE; SL1.commatext:= getstringvalue(commain); nbpresets:=SL1.count; NB_COLS:= trunc(getvalue(NBCOLS)); L:= trunc(getvalue(Mxsize)); NB_ROWS:= L div NB_COLS; setLength(arrayout,L); setLength(colorsout,L); setLength(bordersout,L); scrolin:= maxi(0,trunc(mscroll-(getvalue(scrollin)))); scroll:= scrolin*NB_COLS; U_CAPS; U_CELLS(pmnum); nblines:=nbpresets/nb_cols; if nblines<>trunc(nblines) then begin raj:= 1; end else begin raj:=0;end; Mscroll:=(NBpresets div NB_COLS)-NB_ROWS+(raj); setvalue(maxscroll,mscroll); end;if (n=colorin) then begin setdataarrayvalue(colorsMEM,pmnum,getvalue(colorin));U_CELLS(pmnum); end;if (n=go)and (getvalue(go)=1) then begin WAITING_NM:=TRUE; end;if (n=commain) then begin SL1.commatext:= getstringvalue(commain); nbpresets:=SL1.count;U_comma; U_CAPS; U_CELLS(pmnum); U_SEL(pmnum); end;if (n=txtin) AND (WAITING_NM) then begin SL1.strings[scroll+idclic]:= getstringvalue(txtin);U_comma; (WAITING_NM):= FALSE; U_CAPS; end; if (n=msdwn) then begin MSD:=getvalue(msdwn)=1; if (MSD) then begin OK:=TRUE; end; if (not MSD) AND (OK) then begin U_SEL(scroll+idclic); U_SEL_COLOR(scroll+idclic); end; end; if (n=num) and (getvalue(num)>-1)then begin SL1.commatext:= getstringvalue(commain); pmnum:= trunc(getvalue(num)); U_CELLS(pmnum);U_SEL(pmnum);U_SEL_COLOR(pmnum); end;END;//////////////////////////////////////////Procedure U_SEL(ID:integer);begin if (scroll+idclic)<SL1.count then beginSendInternalMsg('SET_TARGET_PATCH','SENDER_PATCH');SendInternalMsg('SET_VALUE','LIST','1',FloatToStr(ID));SendInternalMsg('SET_STRING_VALUE','TXT','NAME',SL1.strings[ID]);SendInternalMsg('SET_STRING_VALUE','SELECTED','CAPTION',FloatToStr(ID));end;end;//////////////////////////////////////////////////////////Procedure U_comma;beginSendInternalMsg('SET_TARGET_PATCH','SENDER_PATCH');sendinternalMsg('SET_STRING_VALUE','LIST','comma text',SL1.commatext);end;//////////////////////////////////////////////////////////Procedure U_CAPS;var i:integer;beginSLOUT.clear;for i:= 0 to L-1 do begin if (i+scroll) < Sl1.count then begin SLout.add(sl1.strings[i+scroll]); end else begin SLout.add('-');end; end;setstringvalue(cellscap,Slout.commatext);end;//ucaps//////////////Procedure U_SEL_COLOR(ID:integer);beginSendInternalMsg('SET_TARGET_PATCH','SENDER_PATCH');SendInternalMsg('SET_VALUE','COLOR','color',floatToStr(getdataarrayvalue(colorsmem,ID))); end;//////////////////////////////////////////////////////////Procedure U_CELLS(ID:integer);var i,j, val:integer;beginif (ID>=(scroll)) and (ID<(scroll+L)) then begin val:=16777215 end else begin val:=colbaze;end;for i:= 0 to L-1 do begin if i<>((id-scroll) ) then begin setdataarrayvalue(arrayout,i,0); setdataArrayvalue(bordersout,i,getdataarrayvalue(colorsmem,i+scroll)); end else begin setdataarrayvalue(arrayout,i,1); setdataarrayvalue(bordersout,i,val); end;end;for j:=0 to L-1 do begin if (j+scroll)< nbpresets then begin setdataArrayvalue(colorsout,j,getdataarrayvalue(colorsmem,j+scroll)); end else begin setdataArrayvalue(colorsout,j,colbaze);end;end;end;//ucaps//////////////
]]>
Statistics: Posted by nay-seven — 23 Nov 2011, 09:13

Statistics: Posted by Fléau — 22 Nov 2011, 21:49
Statistics: Posted by 23fx23 — 17 Dec 2011, 20:34
Statistics: Posted by Fléau — 17 Dec 2011, 11:44
Statistics: Posted by Fléau — 16 Dec 2011, 20:38
Statistics: Posted by 23fx23 — 23 Nov 2011, 21:00
Statistics: Posted by Fléau — 23 Nov 2011, 20:14
CODE:
// MX_ComboBox______________________23fx 13/05/2k10// /////////////////////////////////////////////////////////////// Matrix based combo box with inertia ///////////////////////////////////////////////////////////////const COLBAZE=4473924;////////////////////////////////////////////////////////var num,toAll,clear,Msdwn,ScrollIn,Mxsize,nbcols,cellscap,arrayout,colorsout,colorsmem,colorin,bordersout,colorout,maxscroll,ID_CLIC,presetout : Tparameter;var pmnum,page,raj,idclic,scrolin,mscroll: integer;var MSD: boolean;var commain, txtin, go: tparameter;var SL1,SLout: tstringlist;var WAITING_NM,OK : boolean;var L,scroll,NB_COLS,NB_ROWS,NBPRESETS: integer;///////////////////////////////////////////////////////////////////////Procedure Init;var i: integer;var s: string;BEGINNBPRESETS:= 512; num := CreateParam('num',PtDataField) ;setIsOutput(num,false); setdontsave(num,false); Msdwn:= CreateParam('msdwn',PtDataField);setIsOutput(msdwn,false); toAll:= CreateParam('toAll',PtDataField);setIsOutput(toAll,false); clear:= CreateParam('clear',PtDataField);setIsOutput(clear,false); commain:= createparam('commain',pttextfield); setisoutput(commain,false); setdontsave(commain,false); txtin:= createparam('txtin',pttextfield);setisoutput(txtin,false); go:= createparam('dbclick',ptdatafield);setisoutput(go,false); ScrollIn:= createparam('ScrollIn',ptdatafield);setisoutput(ScrollIn,false); MXsize:= createparam('Mxsize',ptdatafield);setisoutput(Mxsize,false); NBCOLS:= createparam('NBCOLS',ptdatafield);setisoutput(NBCOLS,false); colorin:= createparam('COLORIN',ptdatafield);setisoutput(COLORIN,false); ID_CLIC := CreateParam('ID_CLIC',PtDataField) ;setIsOutput(ID_CLIC,false); cellscap:= createparam('cellscap',pttextfield);setisinput(cellscap,false); Arrayout:= createparam('arrayout',ptArray);setisinput(arrayout,false); setlength(arrayout,16); colorsOut:= createparam('colorsout',ptArray);setisinput(colorsout,false); setlength(colorsout,16); setMax(colorsOut,MAXINT); colorsMEM:= createparam('colorsMEM',ptArray);setisinput(colorsMEM,false); setlength(colorsMEM,nbpresets); setdontsave(colorsout,false); setMax(colorsMEM,MAXINT); setdontsave(colorsMEM,false); bordersOut:= createparam('bordersout',ptArray);setisinput(bordersout,false); setlength(bordersout,16); setMax(bordersOut,MAXINT);colorout:= createparam('COLOROUT',ptdatafield);setisinput(COLOROUT,false); maxscroll:= createparam('maxscroll',ptdatafield);setisinput(maxscroll,false); presetout:= createparam('presetout',ptdatafield);setisinput(presetout,false); SL1:=Tstringlist.create;SLOUT:=Tstringlist.create; (WAITING_NM):= FALSE; MSD:=false;OK:=true;page:=0;scroll:=0;L:=16;raj:=0;s:='0'; for i:=0 to nbpresets-1 do begin setdataArrayvalue(colorsmem,i,COLBAZE); s:= S+','+intToStr(i+1); end;setstringvalue(cellscap,S);sendinternalMsg('SET_STRING_VALUE','LIST','comma text',S);END;/////////////////////////////////////////Procedure destroy;begin SL1.free; slout.free end;//////////////////////////////////////////////////////////////////Procedure callBack(n : integer);var i: integer;var nblines: single;BEGINif (n=toall) and (getvalue(toall)=1) then begin for i:=0 to maxi(nbpresets,L)-1 do begin setdataArrayvalue(colorsmem,i,getvalue(colorin)); U_CELLS(pmnum); end;end;if (n=id_clic) then begin if getvalue(id_clic)>-1 then begin IDCLIC:= trunc(getvalue(id_clic)); end;end;if (n=ScrollIn) or (n=mxsize) or (n=NBCOLS) or (n=commain) then begin OK:=FALSE; SL1.commatext:= getstringvalue(commain); nbpresets:=SL1.count; NB_COLS:= trunc(getvalue(NBCOLS)); L:= trunc(getvalue(Mxsize)); NB_ROWS:= L div NB_COLS; setLength(arrayout,L); setLength(colorsout,L); setLength(bordersout,L); scrolin:= maxi(0,trunc(mscroll-(getvalue(scrollin)))); scroll:= scrolin*NB_COLS; U_CAPS; U_CELLS(pmnum); nblines:=nbpresets/nb_cols; if nblines<>trunc(nblines) then begin raj:= 1; end else begin raj:=0;end; Mscroll:=(NBpresets div NB_COLS)-NB_ROWS+(raj); setvalue(maxscroll,mscroll); end;if (n=colorin) then begin setdataarrayvalue(colorsMEM,pmnum,getvalue(colorin));U_CELLS(pmnum); end;if (n=go)and (getvalue(go)=1) then begin WAITING_NM:=TRUE; end;if (n=commain) then begin SL1.commatext:= getstringvalue(commain); nbpresets:=SL1.count;U_comma; U_CAPS; U_CELLS(pmnum); U_SEL(pmnum); end;if (n=txtin) AND (WAITING_NM) then begin SL1.strings[scroll+idclic]:= getstringvalue(txtin);U_comma; (WAITING_NM):= FALSE; U_CAPS; end; if (n=msdwn) then begin MSD:=getvalue(msdwn)=1; if (MSD) then begin OK:=TRUE; end; if (not MSD) AND (OK) then begin U_SEL(scroll+idclic); U_SEL_COLOR(scroll+idclic); end; end; if (n=num) and (getvalue(num)>-1)then begin SL1.commatext:= getstringvalue(commain); pmnum:= trunc(getvalue(num)); U_CELLS(pmnum);U_SEL(pmnum);U_SEL_COLOR(pmnum); end;END;//////////////////////////////////////////Procedure U_SEL(ID:integer);begin if (scroll+idclic)<SL1.count then beginSendInternalMsg('SET_TARGET_PATCH','SENDER_PATCH');SendInternalMsg('SET_VALUE','LIST','1',FloatToStr(ID));SendInternalMsg('SET_STRING_VALUE','TXT','NAME',SL1.strings[ID]);SendInternalMsg('SET_STRING_VALUE','SELECTED','CAPTION',FloatToStr(ID));end;end;//////////////////////////////////////////////////////////Procedure U_comma;beginSendInternalMsg('SET_TARGET_PATCH','SENDER_PATCH');sendinternalMsg('SET_STRING_VALUE','LIST','comma text',SL1.commatext);end;//////////////////////////////////////////////////////////Procedure U_CAPS;var i:integer;beginSLOUT.clear;for i:= 0 to L-1 do begin if (i+scroll) < Sl1.count then begin SLout.add(sl1.strings[i+scroll]); end else begin SLout.add('-');end; end;setstringvalue(cellscap,Slout.commatext);end;//ucaps//////////////Procedure U_SEL_COLOR(ID:integer);beginSendInternalMsg('SET_TARGET_PATCH','SENDER_PATCH');SendInternalMsg('SET_VALUE','COLOR','color',floatToStr(getdataarrayvalue(colorsmem,ID))); end;//////////////////////////////////////////////////////////Procedure U_CELLS(ID:integer);var i,j, val:integer;beginif (ID>=(scroll)) and (ID<(scroll+L)) then begin val:=16777215 end else begin val:=colbaze;end;for i:= 0 to L-1 do begin if i<>((id-scroll) ) then begin setdataarrayvalue(arrayout,i,0); setdataArrayvalue(bordersout,i,getdataarrayvalue(colorsmem,i+scroll)); end else begin setdataarrayvalue(arrayout,i,1); setdataarrayvalue(bordersout,i,val); end;end;for j:=0 to L-1 do begin if (j+scroll)< nbpresets then begin setdataArrayvalue(colorsout,j,getdataarrayvalue(colorsmem,j+scroll)); end else begin setdataArrayvalue(colorsout,j,colbaze);end;end;end;//ucaps//////////////Statistics: Posted by 23fx23 — 23 Nov 2011, 12:11
Statistics: Posted by nay-seven — 23 Nov 2011, 09:13

Statistics: Posted by Fléau — 22 Nov 2011, 21:49