tilføje en knap til legende bar din form

, tilføje en knap til at beskrive bar af den form, har jeg skabt et element, der giver dig mulighed for at tilføje knapper til legende bar din form.her er den kode,.,,, ____________ kode ______________, enhed titlebutton;,,, grænseflade, anvender, vinduer, beskeder, sysutils, klasser, grafik, kontrol, formularer, dialoger,,,,,,,, wm_mouseleave = $b014 konstant,,,,,,, tchangedproperty = (cpdown, cpallowallup, cpgroupindex);,,,, ttitlebutton = klasse (tcomponent), private, fbuttonrect: trect;,, fpressed, ffocused: boolean,,, fbuttoncaption: string,,, fwidth: heltal,, fleft: heltal,, fvisible: boolean,,, fhintshow: boolean;,, fhint: thintwindow;,, fhinttext: string,,, fgroupindex: heltal,, fdown: boolean,,, fallowallup: boolean,,, fparent: tform;,, fparentwidth: heltal,, ficonwidth: heltal,, fcallinheritedevent: boolean,,, fdefaultwidth: heltal.,, fdefaultheight: heltal,, ffont: tfont;,, ficon: ticon;,, fborder3d, fborderthickness: heltal,, fbuttondown: tnotifyevent;,, fbuttonmove: tmousemoveevent;,, fbuttonup: tnotifyevent;,, pmsghandler: twndmethod;,, ppaint: tnotifyevent;,, presize: tnotifyevent,,, gtmp1, gtmp2, gtmp3: boolean,,, procedure initializevariables;,, procedure iconchange (afsender: tobject);,, procedure setbuttonwidth (awidth: heltal);,, procedure setbuttonleft (avenstre: heltal);,, procedure setbuttoncaption (acaption: string);,, procedure setbuttonfont (afont: tfont), procedure setbuttonvisible (avisible: boolean);,, procedure seticon (aicon: ticon);,, procedure setdown (adown: boolean);,, procedure setallowallup (aallowallup: boolean);,, procedure setgroupindex (agroupindex: heltal);,, procedure updateproperties (achangedproperty: tchangedproperty), beskyttet, er proceduren messagehandler (var - mng: tmessage);,, procedure captionpaint (var - mng: tmessage);,, procedure captionmousemove (var - mng: tmessage);,, procedure captionmousedown (var mng: tmessage);,, procedure captionmouseup (var - mng: tmessage);,, procedure captionrightmousedown (var - mng: tmessage);,, procedure captiondoubleclick (var - mng: tmessage);,, procedure captionactivate (var - mng: tmessage);,, procedure captionhittest (var - mng: tmessage);,, procedure captionchange (var - mng: tmessage);,, procedure parentmousemove (var - mng: tmessage);,, procedure parentmouseup (var - mng: tmessage), ellerprocedure buttonup (var - mng: tmessage);,, procedure parentpaint (afsender: tobject);,, procedure parentresize (afsender: tobject);,, procedure displaysettingchange (var - mng: tmessage);,, procedure indlades gearvalg;, offentlig, konstruktøren skabe (aowner: tcomponent); -,,, - ødelægger ødelægge; gearvalg;,, der er offentliggjort, ejendom, bredde: hele læs fwidth skrive setbuttonwidth;,, ejendom holdning: hele læs fleft skrive setbuttonleft;,, ejendom overskrift: string læse fbuttoncaption skrive setbuttoncaption;,, ejendom skrifttype: tfont læse ffont skrive setbuttonfont;,, ejendom ikon: ticon læse ficon skrive seticon;,, ejendom tiptext: string læse fhinttext skrive fhinttext;,, ejendom, synlige: boolean læse fvisible skrive setbuttonvisible;,, ejendom allowallup: boolean læse fallowallup skrive setallowallup;,, ejendom: boolean læse fdown skrive setdown;,, ejendom groupindex: hele læs fgroupindex skrive setgroupindex;,, ejendom onmousedown: tnotifyevent læse fbuttondown skrive fbuttondown;,, ejendom onmousemove: tmousemoveevent læse fbuttonmove skrive fbuttonmove;,, ejendom onmouseup tnotifyevent læse: fbuttonup skrive fbuttonup,,,,,,,, ttb_setbuttonup = konstant, wm_user + 1, procedure register,,, gennemførelse,,, konstruktøren ttitlebutton. skabe (aowner: tcomponent), begynder, arvede,,, fparent: = (ejer som tform);,, ffont: = tfont. skabe;,, fhint: = thintwindow. skabe (selvstændige), ficon: = ticon. skabe,,,,,,, ttitlebutton.destr destructoroy;,, begin,, if assigned(ficon) then,, ficon.free;,, if assigned(ffont) then,, ffont.free;,, if assigned(fhint) then,, fhint.free;,, inherited;,, end;,,, procedure TTitleButton.loaded;,, begin,, inherited;,, initializevariables;,, end;,,, procedure TTitleButton.UpdateProperties(achangedproperty:TChangedProperty);,, var,, amsg:tmessage;,, begin,, amsg.Msg:=TTB_SETBUTTONUP;,, amsg.WParam:=integer(self);,, amsg.LParamlo:=fgroupindex;,, amsg.LParamHi:=word(achangedproperty);,, amsg.Result:=0;,, fparent.perform(amsg.msg,amsg.wparam,amsg.lparam);,, end;,,, procedure TTitleButton.initializevariables;,, begin,, if assigned(fparent.WindowProc) then,, pmsghandler:=fparent.WindowProc;,, fparent.WindowProc:=messagehandler;,, if (csdesigning i componentstate), begynder, hvis tildelt (fparent. onpaint) så, ppaint: = fparent. onpaint;,, hvis det er blevet tildelt (fparent. onresize) så, presize: = fparent. onresize;,, fparent. onpaint: = parentpaint;,, fparent. onresize: = parentresize,,,,,, fparentwidth: = fparent. bredde;,, zeromemory (@ fbuttonrect, 7 (fbuttonrect), fpressed: = falske,, ffocused: = falske,, fhintshow: = falske,, ficonwidth: = 16;,, ficon. gennemsigtig: = sandt,,, ficon. onchange: = iconchange;,, fhint. farve: = clinfobk;,, fcallinheritedevent: = falske,, fdefaultwidth: = getsystemmetrics (sm_cxsize), hvis fwidth, fwidth: = fdefaultwidth;,, fdefaultheight: = getsystemmetrics (sm_cysize);,, fborder3d: = getsystemmetrics (sm_cyedge);,, fborderthickness:= getsystemmetrics (sm_cysizeframe);,, gtmp3: = falske,,,,,,, procedure ttitlebutton. iconchange (afsender: tobject), begynder, parentpaint (fparent);,,,,,, procedure ttitlebutton. messagehandler (var - mng: tmessage), begynder, hvis csdesigning i componentstate så begynde, hvis mng. mng = ttb_setbuttonup så, begynder, buttonup (msg), hvis (tildelt (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg);,,,,,, pmsghandler (msg);,,,, ellers begynder, hvis mng. mng = wm_ncpaint så, begynder, captionpaint (msg), hvis (tildelt (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg);,,,, andre, hvis mng. mng = wm_nclbuttondown så, begynder, captionmouse(msg), hvis (tildelt (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg);,,,, andre, hvis mng. mng = wm_ncmousemove så, begynder, captionmousemove (msg), hvis (tildelt (pmsghandler)) og (fcallinheritedevent),, pmsghandler (msg);,,,, andre, hvis mng. mng = wm_nclbuttonup så, begynder, captionmouseup (msg), hvis (tildelt (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg);,,,, andre, hvis mng. mng = wm_ncactivate,, begynder, captionactivate (msg), hvis (tildelt (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg);,,,, andre, hvis mng. mng = wm_nchittest så, begynder, captionhittest (msg), hvis(tildelt (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg);,,,, andre, hvis mng. mng = wm_lbuttonup så, begynder, parentmouseup (msg), hvis (tildelt (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg),,, ende, ellers hvis mng. mng = wm_mousemove så, begynder, parentmousemove (msg), hvis (tildelt (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg);,,,, andre, hvis mng. mng = wm_ncrbuttondown så, begynder, captionrightmousedown (msg),,, hvis (tildelt (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg);,,,, andre, hvis mng. mng = wm_nclbuttondblclk så, begynder, captiondoubleclick (msg), hvis (assigned (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg);,,,, andre, hvis mng. mng = wm_nclbuttondblclk så, begynder, captiondoubleclick (msg), hvis (tildelt (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg),,,,, andre, hvis mng. mng = wm_settext så, begynder, captionchange (msg), hvis (tildelt (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg);,,,, andre, hvis mng. mng = wm_settingchange så, begynder, displaysettingchange (msg);,, hvis (tildelt (pmsghandler)) og (fcallinheritedevent) så, pmsghandler (msg);,,,, andre, hvis mng. mng = ttb_setbuttonup så, begynder, buttonup (msg), hvis (tildelt (pmsghandler)) and (fcallinheritedevent) then,, pmsghandler(msg);,, end,, else if msg.Msg=WM_MOUSELEAVE then,, begin,, fhint.ReleaseHandle;,, pmsghandler(msg);,, end,, else,, pmsghandler(msg);,, end;,, end;,,, procedure TTitleButton.CaptionPaint(var msg:tmessage);,, begin,, fcallinheritedevent:=true;,, if fvisible=false then,, exit;,, invalidaterect(fparent.handle,@fbuttonrect,false);,, end;,,, procedure TTitleButton.CaptionMouseMove(var msg:tmessage);,, var,, pt:tpoint;,, tmpstate:tshiftstate;,, fhintwidth:integer;,, begin,, fcallinheritedevent:=true;,, if fvisible=false then,, exit;,, gtmp1:=fpressed;,, gtmp2:=ffocused;,, pt.x:=msg.LParamLo-fparent.left;,, pt.y:=msg.LParamHi-fparent.top;,, if PtInRect(fbuttonrect,pt) then,, begin,, ffocused:=true;,, fhintwidth:=fhint.Canvas.TextWidth(fhinttext);,, if (fhintshow=false) and (length(trim(fhinttext))<>0) then,, fhint.ActivateHint(rect(mouse.cursorpos.x,mouse.cursorpos.y+10,mouse.cursorpos.x+fhintwidth+7,mouse.cursorpos.y+25),fhinttext);,, fhintshow:=true;,, if assigned(fbuttonmove) then,, fbuttonmove(fparent,tmpstate,pt.x,pt.y);,, end,, else,, begin,, ffocused:=false;,, fhint.ReleaseHandle;,, fhintshow:=false;,, end;,, fcallinheritedevent:=true;,, end;,,, procedure TTitleButton.CaptionMouseDown(var msg:tmessage);,, var,, pt:tpoint;,, tmp1:boolean;,, callevent:boolean;,, begin,, callevent:=false;,, fcallinheritedevent:=true;,, if fvisible=false then,, exit;,, fhintshow:=false;,, fhint.releasehandle;,, setforegroundwindow(fparent.handle);,, tmp1:=fpressed;,, pt.x:=msg.LParamLo-fparent.left;,, pt.y:=msg.LParamhi-fparent.top;,, if ptinrect(fbuttonrect,pt) then,, begin,, gtmp3:=true;,, if fgroupindex=0 then,, begin,, callevent:=true;,, end,, else,, begin,, if not(fdown) then,, if assigned(fbuttondown) then,, fbuttondown(fparent);,, end;,, fpressed:=true;,, ffocused:=true;,, setcapture(fparent.handle);,, end,, else,, begin,, fpressed:=false;,, ffocused:=false;,, end;,, if (tmp1<>fpressed) then,, fcallinheritedevent:=false;,, gtmp1:=fpressed;,, gtmp2:=ffocused;,, parentpaint(fparent);, , , if (callevent) and assigned(fbuttondown) then,, fbuttondown(fparent);,, end;,,, procedure TTitleButton.CaptionMouseUp(var msg:tmessage);,, var,, pt:Tpoint;,, tmp1,tmp2:boolean;,, begin,, fcallinheritedevent:=true;,, if fvisible=false then,, exit;,, releasecapture;,, tmp1:=fpressed;,, tmp2:=ffocused;,, pt.x:=msg.LParamLo-fparent.left;,, pt.y:=msg.LParamhi-fparent.top;,, if (ptinrect(fbuttonrect,pt)) and (ffocused = true) then,, fpressed:=false,, else,, ffocused:=false;,, if ((tmp1<>fpressed) or (tmp2<>ffocused)) and (fallowallup and fdown) then,, invalidaterect(fparent.handle,@fbuttonrect,true);,, fcallinheritedevent:=true;,, end;,,, procedure TTitleButton.CaptionRightMouseDown(var msg:tmessage);,, var,, pt:tpoint;,, begin,, fcallinheritedevent:=true;,, if fvisible=false then,, exit;,, fhint.releasehandle;,, pt.x:=msg.LParamlo-fparent.left;,, pt.y:=msg.LParamHi-fparent.top;,, if not ptinrect(fbuttonrect,pt) then,, fcallinheritedevent:=true,, else,, fcallinheritedevent:=false;,, end;,,, procedure TTitleButton.CaptionDoubleClick(var msg:tmessage);,, var,, pt:tpoint;,, begin,, fcallinheritedevent:=true;,, if fvisible=false then,, exit;,, pt.x:=msg.LParamlo-fparent.left;,, pt.y:=msg.LParamhi-fparent.top;,, if not(ptinrect(fbuttonrect,pt)) then,, fcallinheritedevent:=true,, else,, begin,, fcallinheritedevent:=false;,, fparent.perform(WM_NCLBUTTONDOWN,msg.wparam,msg.LParam);,, end;,, end;,,,, procedure TTitleButton.CaptionActivate(var msg:tmessage);,, begin,, fcallinheritedevent:=true;,, if not visible then,, exit;,, invalidaterect(fparent.handle,@fbuttonrect,false);,, end;,,, procedure TTitleButton.CaptionHitTest(var msg:Tmessage);,, var,, tmp:boolean;,, pt:tpoint;,, begin,, fcallinheritedevent:=true;,, if fvisible=false then,, exit;,, if fpressed then,, begin,, tmp:=ffocused;,, pt.x:=msg.LParamlo-fparent.left;,, pt.y:=msg.LParamhi-fparent.top;,, if ptinrect(fbuttonrect,pt) then,, begin,, ffocused:=true,, end,, else,, ffocused:=false;,, if ffocused<>tmp then,, invalidaterect(fparent.handle,@fbuttonrect,false);,, end;,, if ffocused=false then,, fhint.releasehandle;,, gtmp1:=fpressed;,, gtmp2:=ffocused;,, fcallinheritedevent:=true;,, end;,,, procedure TTitleButton.CaptionChange(var msg:Tmessage);,, begin,, fcallinheritedevent:=true;,, if not fvisible then,, exit;,, invalidaterect(fparent.handle,@fbuttonrect,false);,, end;,,, procedure TTitleButton.ButtonUp(var msg:tmessage);,, var,, sender:ttitlebutton;,, tmp:boolean;,, begin,, tmp:=fdown;,, fcallinheritedevent:=true;,, sender:=(tcomponent(msg.WParam) as ttitlebutton);,, if (sender<>self) and (msg.LParamLo=fgroupindex) then,, begin,, if tchangedproperty(msg.lparamhi)=cpdown then,, fdown:=false;,, fallowallup:=sender.fallowallup;,, if tmp<>fdown then,, invalidaterect(fparent.handle,@fbuttonrect,false);,, end;,, end;,,, procedure TTitleButton.ParentMouseMove(var msg:tmessage);,, var,, pt:tpoint;,, tmppt:tpoint;,, tmprect:trect;,, tmpstate:Tshiftstate;,, begin,, fcallinheritedevent:=true;,, if fvisible=false then,, exit;,, ffocused:=false;,, pt.x:=msg.lparamlo;,, pt.y:=msg.lparamhi-fparent.top;,, tmppt:=pt;,, tmppt.x:=tmppt.x+4;,, tmppt.y:=65536-tmppt.y-fparent.top;,, tmprect:=fbuttonrect;,, inflaterect(tmprect,1,1);,, if ptinrect(tmprect,tmppt) then,, begin,, ffocused:=true;,, if assigned(fbuttonmove) then,, fbuttonmove(fparent,tmpstate,tmppt.x,tmppt.y);,, if (gtmp1<>fpressed) or (gtmp2<>ffocused) then//if fpressed then,, begin,, invalidaterect(fparent.handle,@fbuttonrect,false);,, gtmp1:=fpressed;,, gtmp2:=ffocused;,, end;,, end;,, if (gtmp1<>fpressed) or (gtmp2<>ffocused) then,, begin,, invalidaterect(fparent.handle,@fbuttonrect,false);,, gtmp1:=fpressed;,, gtmp2:=ffocused;,, end;,, fhintshow:=false;,, fhint.releasehandle;,, end;,,,, procedure TTitleButton.ParentMouseUp(var msg:tmessage);,, var,, pt:tpoint;,, tmp:tpoint;,, tmprect:trect;,, tmpcallevent:boolean;,, begin,, fcallinheritedevent:=true;,, if fvisible=false then,, exit;,, tmpcallevent:=false;,, fhint.ReleaseHandle;,, fhintshow:=true;,, ReleaseCapture;,, fpressed:=false;,, pt.x:=msg.lParamlo;,, pt.y:=msg.lParamhi-fparent.top;,, tmp:=pt;,, tmp.x:=tmp.x+4;,, tmp.y:=65536-tmp.y;,, tmp.y:=tmp.y-fparent.top;,, tmprect:=fbuttonrect;,, inflaterect(tmprect,0,2);,, if tmp.y<(fparent.top+fparent.Height) then,, pt:=tmp;,, if (ptinrect(tmprect,pt)) and (ffocused) and (gtmp3) then,, begin,, if fgroupindex<>0 then,, begin,, if fallowallup=true then,, fdown:=not(fdown),, else,, fdown:=true;,, gtmp3:=false;,, updateproperties(cpdown);,, if not(fdown) then,, tmpcallevent:=true;,, end,, else,, tmpcallevent:=true;,, parentpaint(fparent);,, if (tmpcallevent=true) and assigned(fbuttonup) then,, fbuttonup(fparent);,, end,, else,, gtmp3:=false;,, fcallinheritedevent:=true;,, end;,,, procedure TTitleButton.parentpaint(sender:tobject);,, var,, ButtonCanvas:TCanvas;,, textrect:trect;,, iconrect:trect;,, tmpwidth:integer;,, begin,, if fvisible=false then,, begin,, if assigned(ppaint)then,, ppaint(sender);,, exit;,, end;,, if not(csdesigning in componentstate) then,, begin,, if fwidth, fwidth:=fdefaultwidth;,, if fleft=0 then,, fleft:=fwidth+1;,, fbuttonrect.left:=fparent.width-fleft-(3*fdefaultwidth)-(fborder3d+fborderthickness);,, fbuttonrect.right:=fbuttonrect.left+fwidth;,, fbuttonrect.top:=fborder3d+fborderthickness;,, fbuttonrect.bottom:=fbuttonrect.top+fdefaultheight-(2*fborder3d);,, ButtonCanvas:=tcanvas.Create;,, ButtonCanvas.Handle:=getwindowdc(fparent.handle);,, fillrect(buttoncanvas.Handle,fbuttonrect,HBRUSH(COLOR_BTNFACE+1));,, tmpwidth:=fdefaultheight-2;,, iconrect.left:=fbuttonrect.left;,, iconrect.top:=fbuttonrect.top;,, iconrect.right:=iconrect.left+tmpwidth;,, iconrect.bottom:=fbuttonrect.top+fdefaultheight-2*fborder3d;,, if ficon.handle<>0 then,, subtractrect(textrect,fbuttonrect,iconrect),, else,, textrect:=fbuttonrect;,, if (ffocused and fpressed) or fdown then,, begin,, drawedge(ButtonCanvas.Handle,fbuttonrect,EDGE_SUNKEN,BF_SOFT or BF_RECT);,, textrect.left:=textrect.left+2;,, textrect.Top:=textrect.Top+1;,, textrect.right:=textrect.right-1;,, iconrect.left:=iconrect.left+3;,, iconrect.top:=iconrect.top+2;,, end;,, if (not(fpressed) or not(ffocused)) and ikke (fdown), begynder, drawedge (buttoncanvas. klare, fbuttonrect, edge_raised, bf_soft eller bf_rect);,, textrect. venstre: = textrect. venstre + 1, textrect. ret: = textrect. right-1;,, iconrect. top: = iconrect. top + 1,, iconrect. venstre: = iconrect. venstre + 2,,,,,, buttoncanvas. børste. stil: = bsclear;,, buttoncanvas. skrifttype. tildele (ffont), hvis ficon. klare < > 0, begynder, drawiconex (buttoncanvas. klare, iconrect. venstre + 1, iconrect. top + 1, ficon. klare, tmpwidth-5, fdefaultheight-8,0,0, di_normal), hvis længde (trim (fbuttoncaption) > 0,, drawtextex (buttoncanvas. klare, pchar (fbuttoncaption), længde (fbuttoncaption), textrect, dt_left eller dt_singleline eller dt_vcenter eller dt_end_ellipsis eller dt_path_ellipsiseller dt_modifystring, nul),,,,,,, drawtext (buttoncanvas. klare, pchar (fbuttoncaption), længde (fbuttoncaption), textrect, dt_center eller dt_singleline eller dt_vcenter eller dt_end_ellipsis eller dt_path_ellipsis eller dt_modifystring);,, buttoncanvas. gratis;,, hvis det er blevet tildelt (ppaint) så, ppaint (afsender);,,,,,,,,, procedure ttitlebutton. parentresize (afsender: tobject), begynder, fcallinheritedevent: = sandt;,, hvis fvisible = falsk, så begynder, hvis tildelt (presize) så, presize (afsender), udgang,,,,,, parentpaint (afsender);,, hvis det er blevet tildelt (presize) så, presize (selv),,,,,,,, procedure ttitlebutton. displaysettingchange (var - mng: tmessage), begynder, fcallinheritedevent: = sandt;,, hvis fvisible = falske så, exit;,, fdefaultwidth:=GetSystemMetrics(SM_CXSIZE);,, if fwidth, fwidth:=fdefaultwidth;,, fdefaultheight:=GetSystemMetrics(SM_CYSIZE);,, fborder3d:=GetSystemMetrics(SM_CYEDGE);,, fborderthickness:=GetSystemMetrics(SM_CYSIZEFRAME);,, parentpaint(fparent);,, msg.result:=0;,, end;,,, procedure TTitleButton.setbuttonwidth(awidth:integer);,, begin,, if awidth>0 then,, fwidth:=awidth,, else,, fwidth:=fdefaultwidth;,, parentpaint(fparent);,, end;,,, procedure TTitleButton.setbuttonleft(aleft:integer);,, begin,, if (aleft, fleft:=aleft;,, parentpaint(fparent);,, end;,,, procedure TTitleButton.setbuttoncaption(acaption:string);,, begin,, fbuttoncaption:=acaption;,, parentpaint(fparent);,, end;,,, procedure TTitleButton.setbuttonfont(afont:tfont);,, begin,, ffont.assign(afont);,, parentpaint(fparent);,, end;,,, procedure TTitleButton.seticon(aicon:ticon);,, begin,, ficon.assign(aicon);,, parentpaint(fparent);,, end;,,, procedure TTitleButton.setbuttonvisible(avisible:boolean);,, begin,, fvisible:=avisible;,, fparent.perform(WM_NCACTIVATE,integer(true),0);,, end;,,,, procedure TTitleButton.setdown(adown:boolean);,, var,, tmp:boolean;,, begin,, tmp:=fdown;,, if csloading in componentstate then,, fdown:=adown,, else,, begin,, if fdown<>adown then,, begin,, if fgroupindex=0 then,, fdown:=false,, else,, begin,, if fallowallup=true then,, fdown:=adown,, else,, fdown:=true;,, end;,, end;,, end;,, if tmp<>fdown then,, updateproperties(cpdown);,,, end;,,, procedure TTitleButton.setallowallup(aallowallup:boolean);,, var,, tmp:boolean;,, begin,, fcallinheritedevent:=true;,, tmp:=fallowallup;,, if csloading in componentstate then,, fallowallup:=aallowallup,, else,, begin,, if fgroupindex<>0 then,, fallowallup:=aallowallup;,, if tmp<>fallowallup then,, updateproperties(cpallowallup);,, end;,, end;,,,, procedure TTitleButton.setgroupindex(agroupindex:integer);,, var,, tmp:integer;,, begin,, tmp:=fgroupindex;,, if csloading in componentstate then,, fgroupindex:=agroupindex,, else,, begin,, if agroupindex >=65535 then,, agroupindex:=0;,, if (agroupindex>= 0),, fgroupindex: = agroupindex;,, hvis fgroupindex = 0, begynder, fallowallup: = falske,, fdown: = falske,,,,,,, hvis tmp < > fgroupindex så, updateproperties (cpgroupindex);,,,,,.,,, procedure register, begynder, registercomponents (mit komponenter, [ttitlebutton]);,,,,,,,,,.,, _____________ ende af kode _____________,,, - koden til en pas - fil og registrere det.



Previous:
Next Page: