| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281 |
- // <script>
- /*
- =============================================================
- WebIntelligence(r) Report Panel
- Copyright(c) 2001-2003 Business Objects S.A.
- All rights reserved
- Use and support of this software is governed by the terms
- and conditions of the software license agreement and support
- policy of Business Objects S.A. and/or its subsidiaries.
- The Business Objects products and technology are protected
- by the US patent number 5,555,403 and 6,247,008
- File: palette.js
- =============================================================
- */
- _allBOIcons=new Array
- _allBOIconsMenus=new Array
- //_lastUsedColors=new Array
- //_maxUsedColors=8
- _menuType_simple=0
- _menuType_color =1
- _menuType_border=2
- // ================================================================================
- // ================================================================================
- //
- // OBJECT NewLabelWidget (Constructor)
- //
- // Display a simple text. It can be used in a palette for instance
- //
- // ================================================================================
- // ================================================================================
- function NewLabelWidget(id,text,convBlanks)
- // CONSTRUCTOR
- // id [String] the label id for DHTML processing
- // text [String] label text
- // convBlanks [boolean optional] if true, blank are converted into
- {
- var o=newWidget(id)
- o.text=text
- o.convBlanks=convBlanks
- o.getHTML=LabelWidget_getHTML
- o.setDisabled=LabelWidget_setDisabled
- o.dis=false
- return o;
- }
- // ================================================================================
- function LabelWidget_setDisabled(dis)
- // set the widget disabled
- // dis [boolean] if true, disables the widget
- {
- var o=this
- if (o.dis!=dis)
- {
- o.dis=dis
- if (o.layer)
- {
- o.layer.className="iconText"+(dis?"Dis":"")
- }
- }
- }
- // ================================================================================
- function LabelWidget_getHTML()
- // returns [String] the HTML of a label widget
- {
- var o=this
- return '<div id="'+o.id+'" class="icontext'+(o.dis?"Dis":"")+'" style="white-space:nowrap;margin-right:4px;margin-left:4px;cursor:default">'+convStr(o.text,o.convBlanks)+'</div>'
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newIconWidget (Constructor)
- //
- // Display a clickable icon with optional text. It can be used in a palette fo
- // instance. The image can be a sub-part of a bigger image
- // (use dx and dy to define offset)
- //
- // ================================================================================
- // ================================================================================
- function newIconWidget(id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy)
- // CONTRUCTOR
- // id : [String] the icon id for DHTML processing
- // src : [String] the icon image url
- // clickCB : [Function - optional] callback called when clicking
- // text : [String - optional] icon text
- // alt : [String] icon tooltip
- // w : [int] visible image width
- // h : [int] visible image height
- // dx : [int - optional] horizontal offset in the image
- // dy : [int - optional] vertical offset in the image
- // disDx : [int - optional] horizontal offset for disabled state
- // disDy : [int - optional] vertical offset for disabled state
- {
- var o=newWidget(id)
- o.src=src
- o.clickCB=clickCB
- o.text=text
- o.alt=alt
- o.width=null
- o.txtAlign="left"
- o.border=4
- o.txtNoPadding=false
-
- o.allowDblClick=false
-
- if (src)
- {
- o.w=(w!=null)?w:16
- o.h=(h!=null)?h:16
- o.dx=(dx!=null)?dx:0
- o.dy=(dy!=null)?dy:0
- o.disDx=(disDx!=null)?disDx:0
- o.disDy=(disDy!=null)?disDy:0
- }
- else
- {
- o.w=1
- o.h=16
- }
- o.dis=false
- o.disp=true
- o.margin=1
- o.extraHTML=''
-
- o.imgLayer=null
- o.txtLayer=null
-
- o.overCB="IconWidget_overCB"
- o.outCB="IconWidget_outCB"
- o.isDisplayed=IconWidget_isDisplayed
- o.setDisplay=IconWidget_setDisplay
- o.getHTML=IconWidget_getHTML
- o.getTxtWidth=IconWidget_getTxtWidth
- o.index=_allBOIcons.length++
- o.nocheckClass="iconnocheck"
- o.hoverClass="iconhover"
- o.checkClass="iconcheck"
- o.checkhoverClass="iconcheckhover"
- o.currentClass=o.nocheckClass
- o.currentHoverClass=o.hoverClass
- o.setClasses=IconWidget_setClasses
- o.internalUpCB=null
- o.internalDownCB=IconWidget_internalDownCB
- o.internalUpCB=IconWidget_internalUpCB
- o.isHover=false
- o.changeTooltip=IconWidget_changeTooltip
- o.changeText=IconWidget_changeText
- o.changeImg=IconWidget_changeImg
- o.setDisabled=IconWidget_setDisabled
- o.isDisabled=IconWidget_isDisabled
- o.acceptClick=IconWidget_acceptClick
- _allBOIcons[o.index]=o
- o.outEnable=true
- o.setCrs=IconWidget_setCrs
-
- o.oldRes=o.resize
- o.resize=IconWidget_resize
-
- o.iconOldInit=o.init
- o.init=IconWidget_init
-
- return o
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newIconMenuWidget (Constructor)
- //
- // An icon widget that add an arrow part at the right. when clicking on the
- // right part, a menu pops up
- // If no callback is attached, the also pops up when clicking on the left part
- // menu.js must be included to use this component
- //
- // ================================================================================
- // ================================================================================
- function newIconMenuWidget(id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy,isColor,beforeShowCB,menuType)
- // CONSTRUCTOR
- // id : [String] the icon id for DHTML processing
- // src : [String] the icon image url
- // clickCB : [Function - optional] callback called when clicking
- // text : [String - optional] icon text
- // alt : [String] icon tooltip
- // w : [int] visible image width
- // h : [int] visible image height
- // dx : [int - optional] horizontal offset in the image
- // dy : [int - optional] vertical offset in the image
- // disDx : [int - optional] horizontal offset for disabled state
- // disDy : [int - optional] vertical offset for disabled state
- {
- var o=newWidget(id)
-
- if ( typeof(menuType) == 'undefined' )
- menuType=isColor?_menuType_color:_menuType_simple
-
- o.menuItemType = isColor? _isColor:_isNotColor
- o.icon=newIconWidget("iconMenu_icon_"+id,src,IconMenuWidget_iconClickCB,text,alt,w,h,dx,dy,disDx,disDy)
- o.arrow=newIconWidget("iconMenu_arrow_"+id,_skin+"menus.gif",IconMenuWidget_arrowClickCB,null,(_openMenuPart1+(text?text:(alt?alt:""))+_openMenuPart2),7,16,0,81,0,97)
- switch (menuType)
- {
- case _menuType_color:
- o.menu=newMenuColorWidget("iconMenu_menu_"+id,IconMenuWidget_hideCB)
- break
- case _menuType_border:
- o.menu=newMenuBordersWidget("iconMenu_menu_"+id,IconMenuWidget_hideCB,beforeShowCB,IconBordersMenuWidget_internalClickCB)
- break
- default:
- case _menuType_simple:
- o.menu=newMenuWidget("iconMenu_menu_"+id,IconMenuWidget_hideCB,beforeShowCB)
- break
- }
- o.icon.par=o
- o.arrow.par=o
- o.menu.parIcon=o
- o.icon.margin=0
- o.arrow.margin=0
- o.icon.overCB="IconWidget_none"
- o.icon.outCB="IconWidget_none"
- o.arrow.overCB="IconWidget_none"
- o.arrow.outCB="IconWidget_none"
- o.margin=1
- o.spc=0
- o.getHTML=IconMenuWidget_getHTML
- o.clickCB=clickCB
- o.getMenu=IconMenuWidget_getMenu
- o.menIcnOldInit=o.init
- o.init=IconMenuWidget_init
- o.index=_allBOIconsMenus.length++
- _allBOIconsMenus[o.index]=o
-
- o.setDisabled=IconMenuWidget_setDisabled
- o.isDisabled=IconMenuWidget_isDisabled
- o.disableMenu=IconMenuWidget_disableMenu
- o.changeText=IconMenuWidget_changeText
-
- o.imwpResize=o.resize
- o.resize=IconMenuWidget_resize
- o.focus=IconMenuWidget_focus
-
- o.changeArrowTooltip=IconMenuWidget_changeArrowTooltip
-
- o.disp=true
- o.isDisplayed=IconWidget_isDisplayed
- o.setDisplay=IconWidget_setDisplay
-
- return o
- }
- // ================================================================================
- function IconMenuWidget_changeText(s)
- // Change the icon text
- // s [String] : the new text
- {
- this.icon.changeText(s)
- }
- // ================================================================================
- function IconMenuWidget_changeArrowTooltip(tooltip)
- {
- this.arrow.changeTooltip(tooltip,false);
- }
- // ================================================================================
- function IconMenuWidget_resize(w,h)
- {
- var o=this
- if (w!=null)
- w=Math.max(0,w-2*o.margin)
- var d=o.layer.display!="none"
- if (d&_moz&&!_saf)
- o.setDisplay(false)
- o.imwpResize(w,h)
- if (w!=null)
- o.icon.resize(Math.max(0,w-13-o.spc))
- if (d&_moz&&!_saf)
- o.setDisplay(true)
- }
- // ================================================================================
- function IconMenuWidget_setDisabled(dis)
- {
- var o=this
- if (dis) {
- if (o.menu.isShown()) {
- o.menu.show(false)
- }
- IconMenuWidgetOutCB(o.index)
- }
- o.icon.setDisabled(dis)
- o.arrow.setDisabled(dis)
- }
- // ================================================================================
- function IconMenuWidget_isDisabled()
- {
- return (this.icon.dis == true)
- }
- // ================================================================================
- function IconMenuWidget_internalCB()
- {
- var o=this,col=null
- if (o.id!=null)
- {
- col = (o.menuItemType != _isLastUsedColor)? o.id.slice(6) : o.color // "color".length=6
- }
- var icon=o.par.parIcon
- icon.oldColor=icon.curColor
- icon.curColor=col
-
- if (icon.curColor!=null)
- icon.showSample()
-
- if (icon.clickColor)
- icon.clickColor()
- }
- // ================================================================================
- function IconMenuWidget_focus()
- {
- var o=this
- o.arrow.focus()
- }
- // ================================================================================
- function IconMenuWidget_disableMenu(b)
- {
- var o=this
- o.arrow.setDisabled(b)
- o.menu.setDisabled(b)
- }
- // ================================================================================
- function IconMenuWidget_getMenu()
- {
- return this.menu
- }
- // ================================================================================
- function IconWidget_none()
- {
- }
- // ================================================================================
- function IconMenuWidget_init()
- {
- var o=this
- o.menIcnOldInit()
- o.icon.init()
- o.arrow.init()
- o.menu.init()
- var l=o.layer
- l.onmouseover=IconMenuWidget_OverCB
- l.onmouseout=IconMenuWidget_OutCB
- }
- // ================================================================================
- function IconMenuWidget_getHTML()
- {
- var o=this,d=o.disp?"":"display:none;"
- return '<table id="'+o.id+'" cellspacing="0" cellpadding="0" border="0" style="'+d+'margin:'+o.margin+'px"><tr><td>'+o.icon.getHTML()+'</td><td style="padding-left:'+o.spc+'px" width="'+(13+o.spc)+'">'+o.arrow.getHTML()+'</td></table>'
- }
- // ================================================================================
- function IconMenuWidget_OverCB()
- {
- IconMenuWidgetOverCB(getWidget(this).index)
- return true
- }
- // ================================================================================
- function IconMenuWidget_OutCB()
- {
- IconMenuWidgetOutCB(getWidget(this).index)
- }
- // ================================================================================
- function IconMenuWidgetOverCB(i)
- {
- o=_allBOIconsMenus[i]
- IconWidget_overCB(o.icon.index)
- IconWidget_overCB(o.arrow.index)
- }
- // ================================================================================
- function IconMenuWidgetOutCB(i)
- {
- o=_allBOIconsMenus[i]
- if (!o.menu.isShown())
- {
- IconWidget_outCB(o.icon.index)
- IconWidget_outCB(o.arrow.index)
- }
- else
- {
- IconWidget_overCB(o.icon.index)
- IconWidget_overCB(o.arrow.index)
- }
- }
- // ================================================================================
- function IconMenuWidget_iconClickCB()
- {
- var o=this.par
- if (o.clickCB==null)
- {
- var l=o.layer
- var position = getPos2(l);
- o.menu.show(!o.menu.isShown(),position.x,position.y+o.getHeight()+1,null,null,o)
- IconMenuWidgetOverCB(o.index)
- }
- else
- o.clickCB()
- }
- // ================================================================================
- function IconMenuWidget_arrowClickCB()
- {
- var o=this.par,l=o.layer;
- var position = getPos2(l);
- o.menu.show(!o.menu.isShown(),position.x,position.y+o.getHeight()+1,null,null,o)
- IconMenuWidgetOverCB(o.index)
- }
- // ================================================================================
- function IconMenuWidget_hideCB()
- {
- var o=this.parIcon
- if(o.arrow) {
- o.arrow.focus();
- }
- IconMenuWidgetOutCB(o.index)
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newRadioIconMenuWidget (Constructor)
- //
- // like an Icon Widget but behave like radio widget except the button icon only is checked or not
- // menu.js must be included to use this component
- //
- // ================================================================================
- // ================================================================================
- /*
- function newRadioIconMenuWidget(id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy,radioIdx,attachMenuCB)
- // CONSTRUCTOR
- // id : [String] the icon id for DHTML processing
- // src : [String] the icon image url
- // clickCB : [Function - optional] callback called when clicking
- // text : [String - optional] icon text
- // alt : [String] icon tooltip
- // w : [int] visible image width
- // h : [int] visible image height
- // dx : [int - optional] horizontal offset in the image
- // dy : [int - optional] vertical offset in the image
- // disDx : [int - optional] horizontal offset for disabled state
- // disDy : [int - optional] vertical offset for disabled state
- // radioIdx : [int - optional] the index of the selected menuItem
- // attachMenuCB : [Function - optional] callback change dynamically the menu
- {
- var o=newIconMenuWidget(id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy,false)
- o.defDx=dx
- o.defDy=dy
- o.attachMenuCB=null
- if (attachMenuCB) {
- o.attachMenuCB=attachMenuCB
- o.arrow.clickCB=RadioIconMenuWidget_arrowClickCB
- }
- o.attachMenu=RadioIconMenuWidget_attachMenu
- o.updateButton=RadioIconMenuWidget_updateButton
- o.radioIdx=radioIdx?radioIdx:-1
- o.checked=radioIdx?true:false
- return o
- }
- // ================================================================================
- function RadioIconMenuWidget_arrowClickCB()
- {
- var o=this.par,l=o.layer
- o.attachMenuCB()
- o.menu.show(!o.menu.isShown(),getPosScrolled(l).x,getPosScrolled(l).y+o.getHeight()+1,null,null,o)
- IconMenuWidgetOverCB(o.index)
- }
- function RadioIconMenuWidget_updateButton(idx)
- {
- var o=this
- o.icon.dis=false
- if ((idx != null) && (idx > 0)) {
- if (o.radioIdx == idx) return
- o.radioIdx=idx
- o.checked=true
- dx=idx*16
- dy=0
- cn=o.icon.checkClass
- } else {
- o.checked=false
- dx=16
- dy=0
- cn=o.icon.nocheckClass
- o.radioIdx=0
- }
-
- if (o.icon)
- {
- var lyr=o.icon.layer
- if (lyr)
- {
- o.icon.changeImg(dx,dy)
- lyr.className=cn
- }
- }
- if (idx==null) o.setDisabled(true)
- //o.icon.
- }
- // ================================================================================
- function RadioIconMenuWidget_attachMenu(menu)
- // menu [MenuWidget] the menu to be attached
- // return [MenuWidget] the menu to be attached
- {
- var o=this
- o.par=null
- o.menu=menu
- menu.par=null
- menu.container=o
- //menu.par=o
- //menu.zIndex=o.par.zIndex+2
- return menu
- }
- // ================================================================================
- // Icon Color Menu Widget
- // ================================================================================
- function newIconColorMenuWidget(id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy, lastUsedColorsAr)
- {
- var o=newIconMenuWidget(id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy,true)
-
- o.setColor=IconColorMenuWidget_setColor
- o.getColor=IconColorMenuWidget_getColor
-
- o.icon.extraHTML='<div id="colSample_'+o.id+'" style="position:relative;top:-6px;left:2px;width:16px;height:4px;overflow:hidden;margin:0px"></div>'
- o.curColor=null
- o.sampleLayer=null
-
- o.clickColor=clickCB
- o.clickCB=null
-
- o.colOldSetDis=o.setDisabled
- o.setDisabled=IconColorMenuWidget_setDisabled
- o.showSample=IconColorMenuWidget_showSample
- o.changeTooltip=IconColorMenuWidget_changeTooltip
- var m=o.menu
- m.ac=m.addColor
- var cb=IconMenuWidget_internalCB
-
- var c1=m.addCheck("color_-1,-1,-1",_default,cb)
- c1.leftZoneClass="menuLeftPartColor"
- c1.leftZoneSelClass="menuLeftPartSel"
- _colorsArr = new Array()
-
- _colorsArr["0,0,0"]=_black
-
- _colorsArr["148,52,0"]=_brown
- _colorsArr["49,52,0"]=_oliveGreen
- _colorsArr["0,52,0"]=_darkGreen
- _colorsArr["0,52,99"]=_darkTeal
- _colorsArr["0,0,132"]=_navyBlue
- _colorsArr["49,52,148"]=_indigo
- _colorsArr["66,65,66"]=_darkGray
- _colorsArr["132,4,0"]=_darkRed
- _colorsArr["255,101,0"]=_orange
- _colorsArr["123,125,0"]=_darkYellow
- _colorsArr["0,125,0"]=_green
- _colorsArr["0,125,123"]=_teal
- _colorsArr["0,0,255"]=_blue
- _colorsArr["99,101,148"]=_blueGray
- _colorsArr["132,130,132"]=_mediumGray
-
- _colorsArr["255,0,0"]=_red
- _colorsArr["255,195,66"]=_lightOrange
- _colorsArr["148,199,0"]=_lime
- _colorsArr["49,150,99"]=_seaGreen
- _colorsArr["49,199,198"]=_aqua
- _colorsArr["49,101,255"]=_lightBlue
- _colorsArr["132,0,132"]=_violet
- _colorsArr["148,150,148"]=_gray
- _colorsArr["255,0,255"]=_magenta
- _colorsArr["255,199,0"]=_gold
- _colorsArr["255,255,0"]=_yellow
- _colorsArr["0,255,0"]=_brightGreen
- _colorsArr["0,255,255"]=_cyan
- _colorsArr["0,199,255"]=_skyBlue
- _colorsArr["148,52,99"]=_plum
- _colorsArr["198,195,198"]=_lightGray
- _colorsArr["255,178,181"]=_pink
- _colorsArr["255,199,148"]=_tan
- _colorsArr["255,255,206"]=_lightYellow
- _colorsArr["206,255,206"]=_lightGreen
- _colorsArr["206,255,255"]=_lightTurquoise
- _colorsArr["148,199,255"]=_paleBlue
- _colorsArr["198,150,255"]=_lavender
- _colorsArr["255,255,255"]=_white
-
- with (m)
- {
- for (var i in _colorsArr) {
- ac(_colorsArr[i],i,cb)
- }
- }
- if (lastUsedColorsAr)
- {
- m.addLastUsed(_lastUsed,lastUsedColorsAr, cb)
- }
- c1=m.add(null,_moreColors,cb)
- c1.leftZoneClass="menuLeftPartColor"
- c1.leftZoneSelClass="menuLeftPartSel"
-
- return o
- }
- // ================================================================================
- function IconColorMenuWidget_setColor(color)
- {
- var o=this,menu=o.menu
- menu.uncheckAll()
- o.curColor=color
-
- if (color!=null)
- {
- var id="color_"+color
- var items=menu.items
-
- for (var i in items)
- {
- var item=items[i]
- if ((item.menuItemType && (item.menuItemType == _isLastUsedColor) && (color == menu.lastUsedColorsAr[item.idx])) || (item.id==id)){
- item.check(true)
- break
- }
- }
- }
- o.showSample()
- }
- // ================================================================================
- function IconColorMenuWidget_showSample()
- {
- var o=this
- if (o.layer)
- {
- if (o.sampleLayer==null)
- o.sampleLayer=getLayer('colSample_'+o.id)
-
- o.sampleLayer.style.backgroundColor=((o.curColor!='-1,-1,-1')&&(o.curColor!=null)) ? 'rgb('+o.curColor+')' : ''
- }
- }
- // ================================================================================
- function IconColorMenuWidget_setDisabled(dis)
- {
- this.colOldSetDis(dis)
- if (this.layer)
- this.showSample()
- }
- // ================================================================================
- function IconColorMenuWidget_getColor()
- {
- return this.curColor
- }
- // ================================================================================
- function IconColorMenuWidget_changeTooltip(s)
- {
- var o=this
-
- if (s==null) return;
-
- if (o.icon && o.arrow) {
- o.icon.alt=s;
- o.icon.changeTooltip(s)
- o.arrow.changeTooltip(_openMenuPart1+ s +_openMenuPart2)
- }
- }
- */
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newIconCheckWidget (Constructor)
- //
- // Display an icon with check box behaviour. It can be used in a palette for
- // instance. The image can be a sub-part of a bigger image
- // (use dx and dy to define offset)
- //
- // ================================================================================
- // ================================================================================
- function newIconCheckWidget(id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy)
- // CONSTRUCTOR
- // id : [String] the icon id for DHTML processing
- // src : [String] the icon image url
- // clickCB : [Function - optional] callback called when clicking
- // text : [String - optional] icon text
- // alt : [String] icon tooltip
- // w : [int] visible image width
- // h : [int] visible image height
- // dx : [int - optional] horizontal offset in the image
- // dy : [int - optional] vertical offset in the image
- // disDx : [int - optional] horizontal offset for disabled state
- // disDy : [int - optional] vertical offset for disabled state
- {
- var o=newIconWidget(id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy)
- o.checked=false
- o.internalUpCB=IconCheckWidget_internalUpCB
- o.internalDownCB=IconCheckWidget_internalDownCB
- o.check=IconCheckWidget_check
- o.isChecked=IconCheckWidget_isChecked
- //o.setIcon=IconCheckWidget_setIcon
-
- o.oldInit=o.init
- o.init=IconCheckWidget_init
- o.isRadio=false
- return o
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newIconToggleWidget (Constructor)
- //
- // Display an icon with toggle behaviour, ie. if selected a different images is shown. It can be used in a palette for
- // instance. The image can be a sub-part of a bigger image
- // (use dx and dy to define offset)
- //
- // ================================================================================
- // ================================================================================
- /*
- function newIconToggleWidget(id,src,clickCB,text,alt,w,h,dx,dy,togX,togY,disDx,disDy)
- // CONSTRUCTOR
- // id : [String] the icon id for DHTML processing
- // src : [String] the icon image url
- // clickCB : [Function - optional] callback called when clicking
- // text : [String - optional] icon text
- // alt : [String] icon tooltip
- // w : [int] visible image width
- // h : [int] visible image height
- // dx : [int] horizontal offset in the image
- // dy : [int] vertical offset in the image
- // togX : [int] horizontal offset 2nd image
- // togY : [int] vertical offset 2nd image
- // disDx : [int - optional] horizontal offset for disabled state
- // disDy : [int - optional] vertical offset for disabled state
- {
- var o=newIconWidget(id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy)
- o.togX = togX
- o.togY = togY
- o.checked=false
- o.internalUpCB=IconToggleWidget_internalUpCB
- o.internalDownCB=IconToggleWidget_internalDownCB
- o.check=IconToggleWidget_check
- o.isChecked=IconCheckWidget_isChecked
- //o.setIcon=IconCheckWidget_setIcon
-
- o.oldInit=o.init
- o.init=IconCheckWidget_init
- o.isRadio=false
- return o
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newIconRadioWidget (Constructor)
- //
- // Display an icon with radio button behaviour. It can be used in a palette for
- // instance. The image can be a sub-part of a bigger image
- // (use dx and dy to define offset)
- //
- // ================================================================================
- // ================================================================================
- function newIconRadioWidget(id,src,clickCB,text,alt,group,w,h,dx,dy,disDx,disDy)
- // CONSTRUCTOR
- // id : [String] the icon id for DHTML processing
- // src : [String] the icon image url
- // clickCB : [Function - optional] callback called when clicking
- // text : [String - optional] icon text
- // alt : [String] icon tooltip
- // group : [String] icon group - select an icon in a group deselects
- // the other icons
- // w : [int] visible image width
- // h : [int] visible image height
- // dx : [int - optional] horizontal offset in the image
- // dy : [int - optional] vertical offset in the image
- // disDx : [int - optional] horizontal offset for disabled state
- // disDy : [int - optional] vertical offset for disabled state
- {
- var o=newIconCheckWidget(id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy)
- o.group=group
- o.beforeClickCB=IconRadioWidget_uncheckOthers
- o.isRadio=true
- if (_RadioWidget_groups[group]==null)
- _RadioWidget_groups[group]=new Array
- o.groupInstance=_RadioWidget_groups[group]
- var g=o.groupInstance
- o.groupIdx=g.length
- g[g.length]=o
- return o
- }
- */
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newPaletteContainerWidget (Constructor)
- //
- // This object is a container for multiple palettes
- //
- // ================================================================================
- // ================================================================================
- function newPaletteContainerWidget(id,contextMenu,margin)
- // CONSTRUCTOR
- // id : [String] the icon id for DHTML processing
- {
- var o=newWidget(id)
- o.beginHTML=PaletteContainerWidget_beginHTML
- o.endHTML=PaletteContainerWidget_endHTML
- o.add=PaletteContainerWidget_add
- o.palettes=new Array
- o.contextMenu=contextMenu
- o.margin=(margin!=null)?margin:4
- return o
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newPaletteWidget (Constructor)
- //
- // This object is an horizontal palette, designed to be uses in a palette
- // container (see newPaletteContainerWidget)
- //
- // ================================================================================
- // ================================================================================
- function newPaletteWidget(id,height)
- // CONSTRUCTOR
- // id : [String] the icon id for DHTML processing
- // height [int - optional] : minimum palette height
- {
- var o=newWidget(id)
- o.getHTML=PaletteWidget_getHTML
- o.add=PaletteWidget_add
- o.disableChildren=PaletteWidget_disableChildren
- o.items=new Array
- o.oldInit=o.init
- o.init=PaletteWidget_init
- o.beginRightZone=PaletteWidget_beginRightZone
- o.height=height
- o.rightZoneIndex=-1
-
- o.sepCount=0
- o.vertPadding=4
-
- return o
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newPaletteSepWidget (Constructor)
- //
- // This object is a vertical separator used in a palette
- //
- // ================================================================================
- // ================================================================================
- function newPaletteSepWidget(id)
- // CONSTRUCTOR
- // id : [String] the icon id for DHTML processing
- {
- var o=newWidget(id)
- o.getHTML=PaletteSepWidget_getHTML
- o.isSeparator=true
- return o
- }
- // ================================================================================
- function newPaletteVerticalSepWidget(id)
- // CONSTRUCTOR
- // id : [String] the icon id for DHTML processing
- {
- var o=newWidget(id)
- o.getHTML=PaletteVerticalSepWidget_getHTML
- o.isSeparator=true
- return o
- }
- function PaletteVerticalSepWidget_getHTML()
- {
- return img(_skin+"iconsep.gif",6,22,null,' id="'+this.id+'" ')
- }
- // ================================================================================
- function getPaletteSep()
- // returns [String] the HTML of a vertical palette separator
- {
- return img(_skin+"iconsep.gif",6,22)
- }
- // ================================================================================
- function IconRadioWidget_uncheckOthers()
- // PRIVATE
- {
- var g=this.groupInstance,idx=this.groupIdx,len=g.length;
- for (var i=0;i<len;i++)
- {
- if (i!=idx)
- {
- var c=g[i];
- if(c)
- c.check(false);
- }
- }
- }
- // ================================================================================
- function PaletteWidget_beginRightZone()
- // begin the right zone of a palette. All added element will be right-aligned
- // after this call. This function must be called once in a giver palette
- {
- this.rightZoneIndex=this.items.length
- }
- // ================================================================================
- function PaletteSepWidget_getHTML()
- // returns [String] the HTML of a palette separator
- {
- return '<div style="background-image:url('+_skin+'sep.gif);height:2px;padding:0px;margin-top:0px;margin-bottom:0px;margin-left:4px;margin-right:4px">'+getSpace(1,2)+'</div>'
- }
- // ================================================================================
- function PaletteContainerWidget_beginHTML()
- // returns [String] the begining HTML of a palette container widget
- {
- var o=this
- var cm=o.contextMenu?('oncontextmenu="'+_codeWinName+'.PaletteContainerWidget_contextMenu(this,event);return false"'):''
- return '<div '+cm+ 'class="palette" style="overflow:hidden;margin:'+o.margin+'px;" id="'+o.id+'">'
- }
- _delayedMenu=null
- // ================================================================================
- function PaletteContainerWidget_contextMenu(o,e)
- // PRIVATE
- {
- if (_ie)
- e=_curWin.event
- _delayedMenu=getWidget(o).contextMenu
- setTimeout('_delayedMenu.par=null;_delayedMenu.show(true,'+absxpos(e)+','+absypos(e)+')',1)
- }
- // ================================================================================
- function PaletteContainerWidget_endHTML()
- // returns [String] the end HTML of a palette container widget
- {
- return '</div>'
- }
- // ================================================================================
- function PaletteContainerWidget_add(palette)
- // add a palette in a palette container widget. The palette is horizontal
- // and will be displayed at the bottom of the container
- // return [String] the HTML
- {
- this.palettes[this.palettes.length]=palette
- return palette
- }
- // ================================================================================
- function PaletteWidget_getHTML()
- // return [String] the HTML
- {
- var o=this,items=o.items,len=items.length,fields=new Array;j=0
-
- fields[j++]='<table style="position:relative;overflow:hidden" id="'+o.id+'" '+attr("height",o.height)+' cellspacing="0" cellpadding="0" '+(_ie?"":'width="100%"')+'><tbody><tr valign="middle">'
- fields[j++]='<td align="left" style="padding-left:'+o.vertPadding+'px;padding-right:4px"><table cellspacing="0" cellpadding="0"><tbody><tr valign="middle">'
-
- var haveRightZone=false
- for (var i=0;i<len;i++)
- {
- if (i==o.rightZoneIndex)
- {
- fields[j++]='</tr></tbody></table></td><td width="100%" align="right" style="padding-right:'+o.vertPadding+'px"><table cellspacing="0" cellpadding="0"><tbody><tr valign="middle">'
- haveRightZone=true
- }
-
- var it=items[i]
- //fields[j++]='<td>'+(it?it.getHTML():getPaletteSep())+'</td>'
- fields[j++]='<td>'+it.getHTML()+'</td>'
- }
-
- if (!haveRightZone)
- fields[j++]='</tr></tbody></table></td><td width="100%" align="right" style="padding-right:4px"><table cellspacing="0" cellpadding="0"><tbody><tr valign="middle"><td></td>'
-
- fields[j++]='</tr></tbody></table></td></tr></tbody></table>'
- return fields.join("")
- }
- // ================================================================================
- function PaletteWidget_add(item)
- // add an item into a palette. this element is a standard widget, with a valid
- // getHTML function. For layout reasons, use only widget that are nor too high
- // palette [PaletteWidget}
- {
- if(item==null)
- {
- item=newPaletteVerticalSepWidget(this.id+"_palettesep_"+(this.sepCount++))
- }
- this.items[this.items.length]=item
- return item
- }
- // ================================================================================
- function PaletteWidget_disableChildren(dis)
- {
- var items=this.items
- for (var i in items)
- {
- var item=items[i]
- if (item&&(item.isSep!=true))
- item.setDisabled(dis)
- }
- }
- // ================================================================================
- function PaletteWidget_init()
- // inits a palette widget (ie get all layers, style for dynamic management)
- // return [String] the HTML
- {
- this.oldInit()
- var items=this.items
- for (var i in items)
- {
- var item=items[i]
- if (item)
- item.init()
- }
- }
- // ================================================================================
- function IconWidget_isDisplayed()
- {
- return this.disp
- }
- // ================================================================================
- function IconWidget_setDisplay(d)
- {
- var o=this
-
- if (o.css)
- {
- var ds=d?"block":"none"
- if (o.css.display!=ds)
- o.css.display=ds
- }
- o.disp=d
- }
- // ================================================================================
- function IconWidget_getTxtWidth()
- {
- var o=this,w=o.width
- if (w!=null)
- {
- w=w-(o.margin*2) // remove table margin
- w=w-(o.src?o.w+o.border:1) // Image size
- w=w-(o.txtNoPadding?0:((o.src?4:2)+2))
-
- if (_ie)
- w-=2
- else
- w-=2
- return Math.max(0,w)
- }
- else
- return -1
- }
- // ================================================================================
- function IconWidget_init()
- {
- var o=this,dblClick=false
- o.iconOldInit()
- var l=o.layer
-
- //manage focus for 508
- l.tabIndex=o.dis?-1:0
-
- //manage tooltip for 508
- l.title=(o.alt?o.alt:(o.text?o.text:""))
-
- // attach callbacks
- if (o.clickCB)
- {
- l.onclick=IconWidget_upCB
- l.onmousedown=IconWidget_downCB
-
- if (o.allowDblClick&&(_ie||_saf))
- {
- dblClick=true
- addDblClickCB(l,IconWidget_upCB)
- }
- l.onkeydown=IconWidget_keydownCB
- l.onmouseover=IconWidget_realOverCB
- l.onmouseout=IconWidget_realOutCB
- }
- if (!dblClick)
- addDblClickCB(l,IconWidget_retFalse)
- l.onselectstart=IconWidget_retFalse
-
- var d=o.disp?"block":"none"
- if (o.css.display!=d)
- o.css.display=d
- }
- // ================================================================================
- function IconWidget_getHTML()
- // returns [String] the HTML of an icon widget
- {
- var o=this,imgCode=o.src?'<div style="overflow:hidden;height:'+(o.h+o.border)+'px;width:'+(o.w+o.border)+'px;">'+simpleImgOffset(o.src,o.w,o.h,o.dis?o.disDx:o.dx,o.dis?o.disDy:o.dy,'IconImg_'+o.id,null,o.alt,'margin:2px;cursor:'+(o.clickCB ? (!o.acceptClick() ? 'default' : _hand):'default'))+o.extraHTML+'</div>':'<div class="icontext" style="width:1px;height:'+(o.h+o.border)+'px"></div>'
- var txtAtt='style="white-space:nowrap;',txtW=o.getTxtWidth()
- if (txtW>=0)
- txtAtt+='text-overflow:ellipsis;overflow:hidden;width:'+txtW+'px'
- txtAtt+='"'
-
- var d=o.disp?"":"display:none;"
-
- return '<table style="'+d+'height:'+(o.h+o.border+(_moz?2:0))+'px;'+(o.width!=null?"width:"+o.width+"px;":"")+'margin:'+o.margin+'px" id="'+o.id+'" class="' + o.nocheckClass + '" cellspacing="0" cellpadding="0" border="0"><tr valign="middle">'+
- '<td>'+ ((o.clickCB&&_ie)?lnk(imgCode,null,null,null, ' tabIndex="-1"' ):imgCode)+'</td>'+
- (o.text?'<td align="'+o.txtAlign+'" style="padding-left:'+(o.txtNoPadding?0:(o.src?4:2))+'px;padding-right:'+(o.txtNoPadding?0:2)+'px"><div id="IconImg_Txt_'+o.id+'" class="icontext'+(o.dis?"Dis":"")+'" '+txtAtt+'>'+convStr(o.text)+'</div></td>':'')+
- '</tr></table>'
- }
- // ================================================================================
- function IconWidget_realOutCB()
- {
- var o=getWidget(this)
- eval(o.outCB+'('+o.index+')')
- }
- // ================================================================================
- function IconWidget_realOverCB()
- {
- var o=getWidget(this)
- eval(o.overCB+'('+o.index+')')
- return true
- }
- // ================================================================================
- function IconWidget_retFalse()
- // PRIVATE
- {
- return false
- }
- // ================================================================================
- function IconWidget_resize(w,h)
- {
- var o=this
-
- if (o.layer)
- o.oldRes(w,h)
-
- if (o.txtLayer==null)
- o.txtLayer=getLayer("IconImg_Txt_"+o.id)
-
- if (w!=null)
- {
- o.width=w
- var txtW=o.getTxtWidth()
-
- if (o.txtLayer&&(txtW>=0))
- {
- o.txtLayer.style.width=''+txtW+'px'
- }
- }
- if (h!=null)
- {
- o.h=h?(h-o.border):o.h
-
- if (o.txtLayer&&(o.h>=0))
- {
- o.txtLayer.style.height=''+o.h+'px'
- }
-
- }
- }
- // ================================================================================
- function IconWidget_changeTooltip(s,isTemporary)
- // changes the tooltip of an icon widget
- // s : [String] the new tooltip string.
- {
- var o=this
-
- if (s==null) return;
-
- if(!isTemporary)
- o.alt=s;
- if(o.layer)
- o.layer.title=s
- if (o.imgLayer==null)
- o.imgLayer = getLayer('IconImg_'+this.id);
- if (o.imgLayer)
- changeSimpleOffset(o.imgLayer,null,null,null,s)
- }
- // ================================================================================
- function IconWidget_changeText(s)
- // Change the icon text
- // s [String] : the new text
- {
- var o=this
- o.text=s
- if (o.layer)
- {
- if (o.txtLayer==null)
- o.txtLayer=getLayer("IconImg_Txt_"+o.id)
- o.txtLayer.innerHTML=convStr(s)
- }
- }
- function IconWidget_changeImg(dx,dy,src)
- {
- var o=this
- if (src) o.src=src
- if (dx!=null) o.dx=dx
- if (dy!=null) o.dy=dy
- if (o.layer&&(o.imgLayer==null))
- o.imgLayer = getLayer('IconImg_'+this.id);
- if (o.imgLayer)
- changeSimpleOffset(o.imgLayer,dx,dy,o.src)
- }
- // ================================================================================
- function IconWidget_internalDownCB()
- // PRIVATE
- {
- if (!this.dis)
- this.currentHoverClass=this.checkhoverClass
- }
- // ================================================================================
- function IconWidget_internalUpCB()
- // PRIVATE
- {
- if (!this.dis)
- this.currentHoverClass=this.hoverClass
- }
- // ================================================================================
- function IconWidget_setCrs()
- // PRIVATE
- {
- var o=this,crs=(o.clickCB ? (!o.acceptClick() ? 'default' : _hand) : 'default')
- o.css.cursor=crs
- if (o.src)
- {
- if (o.imgLayer==null)
- o.imgLayer = getLayer('IconImg_'+o.id);
- if (o.imgLayer) o.imgLayer.style.cursor=crs
- }
- }
- // ================================================================================
- function IconWidget_downCB()
- // PRIVATE
- {
- var o=getWidget(this)
- if ((o.layer)&&(o.acceptClick()))
- {
- o.internalDownCB()
- o.layer.className=o.currentHoverClass
- }
- if (_ie||_saf)
- return false
- }
- // ================================================================================
- function IconWidget_upCB()
- // PRIVATE
- {
- var o=getWidget(this)
- if ((o.layer)&&(o.acceptClick()))
- {
- o.internalUpCB()
- o.layer.className=o.isHover?o.currentHoverClass:o.currentClass
- o.setCrs()
- setTimeout("delayedClickCB("+o.index+")",1)
- }
- }
- // ================================================================================
- function IconWidget_keydownCB(e)
- {
- if(eventGetKey(e)==13) //enter
- {
- var o=getWidget(this)
- if ((o.layer)&&(o.acceptClick()))
- {
- o.internalUpCB()
- o.layer.className=o.isHover?o.currentHoverClass:o.currentClass
- o.setCrs()
- setTimeout("delayedClickCB("+o.index+")",1)
- }
- eventCancelBubble(e);//be careful ! usefull for dialog box close by Enter keypressed
- }
- }
- // ================================================================================
- function delayedClickCB(index)
- // PRIVATE
- {
- var o=_allBOIcons[index]
- if (o.beforeClickCB)
- o.beforeClickCB()
- if (o.clickCB)
- o.clickCB()
- }
- // ================================================================================
- function IconWidget_overCB(index)
- // PRIVATE
- {
- var o=_allBOIcons[index]
-
- o.setCrs()
-
- if ((o.layer)&&(!o.dis)&&!(o.par && o.par.checked)) // if not button container and it is checked
- {
- o.isHover=true
- o.layer.className=o.currentHoverClass
- }
- }
- // ================================================================================
- function IconWidget_outCB(index)
- // PRIVATE
- {
- var o=_allBOIcons[index]
- if ((o.layer)&&(o.outEnable)&&!(o.par && o.par.checked)) // if not button container and it is checked
- {
- o.isHover=false
- o.layer.className=o.currentClass
- }
- }
- // ================================================================================
- function IconCheckWidget_init()
- // inits an icon check widget (ie get all layers, style for dynamic management)
- {
- var o=this
- o.oldInit()
- o.check(o.checked,true)
- }
- // ================================================================================
- function IconCheckWidget_internalDownCB()
- // PRIVATE
- {
- var o=this
- if (o.acceptClick())
- o.currentHoverClass=o.checked?o.hoverClass:o.checkhoverClass
- }
- // ================================================================================
- function IconCheckWidget_internalUpCB()
- // PRIVATE
- {
- var o=this
- if (o.acceptClick())
- {
- o.checked=o.isRadio?true:!o.checked
- o.currentClass=o.checked?this.checkClass:this.nocheckClass
- o.currentHoverClass=o.checked?this.checkhoverClass:this.hoverClass
- }
- }
- /*
- function IconToggleWidget_internalDownCB()
- // PRIVATE
- {
- var o=this
- if (o.acceptClick()) {
- //o.currentHoverClass=o.checked?o.hoverClass:o.checkhoverClass
- }
- }
- // ================================================================================
- function IconToggleWidget_internalUpCB()
- // PRIVATE
- {
- var o=this
- if (o.acceptClick())
- {
- if (o.layer&&(o.imgLayer==null))
- o.imgLayer = getLayer('IconImg_'+this.id);
- if (!o.imgLayer) return
-
- o.checked=!o.checked
- if (o.checked)
- {
- changeSimpleOffset(o.imgLayer,o.togX,o.togY,o.src)
- } else {
- changeSimpleOffset(o.imgLayer,o.dx,o.dy,o.src)
- }
- }
- }
- */
- // ================================================================================
- function IconCheckWidget_check(checked,force)
- // check or uncheck an icon check widget
- // check : [boolean] specified if the check icon must be checked or not
- // force : [boolean - optional] for internal purpose, do not use it
- {
- var o=this
- if ((o.checked!=checked)||force)
- {
- o.checked=checked
-
- if (o.layer)
- {
- o.layer.className=o.currentClass=o.checked?this.checkClass:this.nocheckClass
- o.currentHoverClass=o.checked?this.checkhoverClass:this.hoverClass
- }
- }
-
- if (o.checked&&o.beforeClickCB)
- {
- if (o.layer)
- o.beforeClickCB()
- }
- }
- // ================================================================================
- /*
- function IconToggleWidget_check(checked,force)
- // check or uncheck an icon check widget
- // check : [boolean] specified if the check icon must be checked or not
- // force : [boolean - optional] for internal purpose, do not use it
- {
- var o=this
- if ((o.checked!=checked)||force)
- {
- o.checked=checked
- if (o.layer&&(o.imgLayer==null))
- o.imgLayer = getLayer('IconImg_'+this.id);
-
- if (!o.imgLayer) return
-
- if (o.checked)
- {
- changeSimpleOffset(o.imgLayer,o.togX,o.togY,o.src)
- } else {
- changeSimpleOffset(o.imgLayer,o.dx,o.dy,o.src)
- }
- }
-
- if (o.checked&&o.beforeClickCB)
- {
- if (o.layer)
- o.beforeClickCB()
- }
- }
- */
- // ================================================================================
- function IconCheckWidget_isChecked()
- // return true if checked
- {
- return this.checked
- }
- // ================================================================================
- function IconWidget_setClasses(nocheck, check, hover, checkhover)
- // set the 4 CSS classes for an icon : check/no check, hover/no
- // nocheck : [String] CSS class name for the no check state
- // check : [String] CSS class name for the check state
- // hover : [String] CSS class name for mouse over on a non checked icon
- // checkhover : [String] CSS class name for mouse over on a checked icon
- {
- var o=this
- o.nocheckClass=nocheck
- o.checkClass=check
- o.hoverClass=hover
- o.checkhoverClass=checkhover
- o.currentClass=o.nocheckClass
- o.currentHoverClass=o.hoverClass
- }
- // ================================================================================
- function IconWidget_setDisabled(dis)
- // set the widget disabled (ie insensitive to mouse or keyboard events)
- // dis : [String] if true, disables the widget
- {
- var o=this
- if (o.dis!=dis)
- {
- o.dis=dis
- if (o.layer)
- {
- o.setCrs()
- if (o.src)
- {
- if (o.imgLayer==null)
- o.imgLayer = getLayer('IconImg_'+this.id);
- changeSimpleOffset(o.imgLayer,dis?o.disDx:o.dx,dis?o.disDy:o.dy)
- }
- if (o.text)
- {
- if (o.txtLayer==null)
- o.txtLayer=getLayer("IconImg_Txt_"+o.id)
- o.txtLayer.className="iconText"+(dis?"Dis":"")
-
- if (dis)
- o.layer.className=o.currentClass
- }
- //manage focus for 508
- o.layer.tabIndex=o.dis?-1:0
- }
- }
- }
- // return treu if the Widget is disabled
- //
- function IconWidget_isDisabled()
- {
- return this.dis?this.dis:false
- }
- function IconWidget_acceptClick()
- {
- var o=this
- if (o.isDisabled()) return false
- if (o.isRadio&&o.checked) return false
- return true
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newCustomCombo (Constructor)
- //
- // This object is a container for multiple palettes
- //
- // ================================================================================
- // ================================================================================
- function newCustomCombo(id,changeCB,noMargin,width,tooltip,url,w,h,dx,dy,disDx,disDy)
- {
- var o=newIconMenuWidget(id,url,null," ",tooltip,w,h,dx,dy,disDx,disDy)
- o.icon.width=width!=null?Math.max(0,width-13):50-(2*o.margin)
-
- o.icon.setClasses("combonocheck", "combocheck", "combohover", "combocheck")
- o.icon.clip
- o.arrow.setClasses("iconnocheck", "combobtnhover", "combobtnhover", "combobtnhover")
-
- o.spc=0
- o.margin=2
-
- if (url==null)
- {
- o.icon.h=12
- o.arrow.h=12
- o.arrow.dy+=2
- o.arrow.disDy+=2
- }
-
- // Private attributes
- o.counter=0
- o.changeCB=changeCB
- o.selectedItem=null
- o.setOldDid=o.setDisabled
- o.disabled=false
- o.ccomboOldInit=o.init
-
- // Public methods
- o.init=CustomCombo_init
- o.add=CustomCombo_add
- o.addSeparator=CustomCombo_addSeparator
- o.addMenuItem=CustomCombo_addMenuItem
- o.select=CustomCombo_select
- o.getSelection=CustomCombo_getSelection
- o.valueShow=CustomCombo_valueShow
-
- o.valueSelect=CustomCombo_valueSelect
- o.setUndefined=CustomCombo_setUndefined
- o.setDisabled=CustomCombo_setDisabled
-
- o.getVisibleItemsCount=CustomCombo_getVisibleItemsCount
-
- // Private methods
- o.selectItem=CustomCombo_selectItem
- o.getItemByIndex=CustomCombo_getItemByIndex
- o.getItemIndex=CustomCombo_getItemIndex
- o.setItemDisabled=CustomCombo_setItemDisabled
- return o
- }
- // ================================================================================
- function CustomCombo_init()
- {
- var o=this
-
- o.ccomboOldInit()
-
- if(o.disabled) o.icon.changeTooltip(o.icon.alt?o.icon.alt:"",true)
- o.arrow.changeTooltip(_openMenuPart1+(o.icon.alt?o.icon.alt:"")+_openMenuPart2)
-
- }
- function CustomCombo_add(s,val,selected)
- {
- var o=this
- var item=o.menu.addCheck(o.id+"_it_"+(o.counter++),s,CustomCombo_internalCB)
-
- item.val=""+val
- item.parCombo=o
- item.isComboVal=true
-
- if ((o.selectedItem==null)||selected)
- o.selectItem(item)
- }
- // ================================================================================
- function CustomCombo_addSeparator()
- {
- this.menu.addSeparator()
- }
- // ================================================================================
- function CustomCombo_addMenuItem(id,text,cb,icon,dx,dy,disabled,disDx,disDy)
- {
- this.menu.add(id,text,cb,icon,dx,dy,disabled,disDx,disDy)
- }
- // ================================================================================
- function CustomCombo_internalCB()
- // PRIVATE
- {
- var o=this,c=o.parCombo
- c.selectItem(o)
- if (c.changeCB)
- c.changeCB()
- }
- // ================================================================================
- function CustomCombo_getItemByIndex(idx)
- // PRIVATE
- {
- var items=this.menu.items
- return ((idx>=0)&&(idx<items.length))?items[idx]:null
- }
- // ================================================================================
- function CustomCombo_getItemIndex(item)
- // PRIVATE
- {
- var items=this.menu.items,len=items.length,j=0
- for (var i=0;i<len;i++)
- {
- var it=items[i]
- if (it.isComboVal)
- {
- if (it.id==item.id)
- return j
-
- j++
- }
- }
- return -1
- }
- // ================================================================================
- function CustomCombo_selectItem(item)
- // PRIVATE
- {
- var o=this
-
- if (o.selectedItem)
- o.selectedItem.check(false)
-
- if (item)
- {
- o.val=item.val
- o.icon.changeText(o.disabled?"":item.text)
- o.selectedItem=item
- item.check(true)
- if(o.disabled)
- o.icon.changeTooltip(o.icon.alt?o.icon.alt:"",true)
- else
- o.icon.changeTooltip(o.icon.alt?(o.icon.alt+' ('+item.text)+')':(item.text),true)
- }
- else
- {
- o.val=null
- o.icon.changeText("")
- o.icon.changeTooltip(o.icon.alt?o.icon.alt:"",true)
- o.selectedItem=null
- }
- }
- // ================================================================================
- function CustomCombo_setDisabled(d)
- {
- var o=this
- if (o.selectedItem)
- o.icon.changeText(d?"":o.selectedItem.text)
- o.disabled=d
- o.setOldDid(d)
- if(d) o.icon.changeTooltip(o.icon.alt?o.icon.alt:"",true)
- }
- // ================================================================================
- function CustomCombo_select(idx)
- // Select an item in the combo
- // idx : item index (only items added by "add" function are taken in account)
- // to allow menus combining combo items and menu action items
- {
- var o=this,item=o.getItemByIndex(idx)
- if (item)
- o.selectItem(item)
- }
- // ================================================================================
- function CustomCombo_setItemDisabled(idx,disabled)
- // Disable a specific item on the combo box
- // idx [int] item index (only items added by "add" function are taken in account)
- // disabled [boolean] disable if true
- {
- var o=this,item=o.getItemByIndex(idx)
- if (item)
- item.setDisabled(disabled)
- }
- // ================================================================================
- function CustomCombo_getSelection()
- {
- var o=this,it=o.selectedItem
- if (it)
- return {index:o.getItemIndex(it),value:it.val}
- else
- return null
- }
- // ================================================================================
- //return true if selection can be done
- function CustomCombo_valueSelect(v)
- {
- v=""+v
- var o=this,items=o.menu.items,len=items.length
- for (var i=0;i<len;i++)
- {
- var it=items[i]
- if ((it.isComboVal)&&(it.val==v)&&(it.isShown) )
- {
- o.selectItem(it)
- return true
- }
- }
-
- return false
- }
- // ================================================================================
- function CustomCombo_valueShow(v,show)
- {
- v=""+v
- var o=this,items=o.menu.items,len=items.length
- for (var i=0;i<len;i++)
- {
- var it=items[i]
- if ((it.isComboVal)&&(it.val==v))
- {
- it.show(show)
- return
- }
- }
- }
- // ================================================================================
- function CustomCombo_setUndefined(u)
- {
- var o=this
- if (u)
- o.selectItem(null)
- }
- // ================================================================================
- //by default, return the count of shown elements of type isComboVal
- function CustomCombo_getVisibleItemsCount()
- {
- var o=this,items=o.menu.items,len=items.length,n=0
- for (var i=0;i<len;i++)
- {
- var it=items[i]
- if ((it.isComboVal)&&(it.isShown))
- {
- n++
- }
- }
- return n;
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newCustomTextFieldWidget (Constructor)
- //
- // This object is a Textfield followed by an IconMenuWidget
- //
- // ================================================================================
- // ================================================================================
- function newComboTextFieldWidget(id,changeCB,maxChar,keyUpCB,enterCB,noMargin,tooltip,width,focusCB,blurCB)
- {
- var o=newTextFieldWidget(id,changeCB,maxChar,keyUpCB,enterCB,noMargin,tooltip,width,focusCB,blurCB)
-
- o.par=null
-
- o.oldInit=o.init
- o.init=ComboTextFieldWidget_init
- o.setContentEditable=ComboTextFieldWidget_setContentEditable
- o.isContentEditable=ComboTextFieldWidget_isContentEditable
- o.getHTML=ComboTextFieldWidget_getHTML
- o.oldSetDisabled=o.setDisabled
- o.setDisabled=ComboTextFieldWidget_setDisabled
-
- return o
- }
- // ================================================================================
- function ComboTextFieldWidget_init()
- {
- var o=this
-
- o.oldInit()
-
- var l=o.layer
- if (l!=null)
- {
- o.setContentEditable(true)
- l.onclick=ComboTextFieldWidget_onClick
- }
- }
- // ================================================================================
- function ComboTextFieldWidget_setContentEditable(d)
- {
- var o=this, l=o.layer
- o.contentEditable=d
- if (l)
- {
- l.contentEditable=d
- l.style.cursor=d?'text':_hand
- l.className=d?'comboEditable':'combo'
- }
- }
- // ================================================================================
- function ComboTextFieldWidget_isContentEditable()
- {
- var o=this
- return o.contentEditable
- }
- // ================================================================================
- function ComboTextFieldWidget_onClick()
- {
- var o=getWidget(this)
-
- if (o.contentEditable)
- return
-
- if (o.par!=null)
- o.par.clickCB()
- }
- // ================================================================================
- function ComboTextFieldWidget_getHTML()
- {
- var o=this
- return '<input'+(o.disabled?' disabled':'')+' oncontextmenu="event.cancelBubble=true;return true" style="'+sty("width",this.width)+(_moz?'margin-top:1px;margin-bottom:1px;padding-left:2px;padding-right:2px;':'')+ (_isQuirksMode ? 'height:18px;' : 'height:14px;') + 'margin-left:'+(this.noMargin?0:10)+'px" onfocus="'+_codeWinName+'.TextFieldWidget_focus(this)" onblur="'+_codeWinName+'.TextFieldWidget_blur(this)" onchange="'+_codeWinName+'.TextFieldWidget_changeCB(event,this)" onkeydown=" return '+_codeWinName+'.TextFieldWidget_keyDownCB(event,this);" onkeyup=" return '+_codeWinName+'.TextFieldWidget_keyUpCB(event,this);" onkeypress=" return '+_codeWinName+'.TextFieldWidget_keyPressCB(event,this);" type="text" '+attr('maxLength',this.maxChar)+' ondragstart="event.cancelBubble=true;return true" onselectstart="event.cancelBubble=true;return true" class="combo" id="'+this.id+'" name="'+this.id+'"'+attr('title',this.tooltip)+' value="">'
- }
- // ================================================================================
- function ComboTextFieldWidget_setDisabled(d)
- {
- var o=this
-
- o.oldSetDisabled(d)
- //o.layer.className=d?'comboDisabled':'combo'
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newTextComboWidget (Constructor)
- //
- // This object is a Textfield followed by an IconMenuWidget
- //
- // ================================================================================
- // ================================================================================
- function newTextComboWidget(id,maxChar,tooltip,w,changeCB,checkCB,beforeShowCB,formName)
- // CONSTRUCTOR
- // id : [String] the icon id for DHTML processing
- // maxChar : [int] text field maximum length
- // tooltip : [String] arrow icon tooltip
- // w : [int] TextComboWidget width
- // changeCB : [Function - optional] callback called when selecting or typing a value
- // checkCB : [Function - optional] callback called when typing a value to check its validity
- // beforeShowCB : [Function - optional] callback called before showing the menu
- // formName : [String - optional] specify a specific ID/Name for using the text fielad inside a form
- {
- var o=newWidget(id)
- // basic widgets
- o.text=newComboTextFieldWidget((formName?formName:"text_"+id),TextComboWidget_checkCB,maxChar,null/*keyUpCB*/,TextComboWidget_enterCB,true,tooltip,w-13)
- o.arrow=newIconWidget("arrow_"+id,_skin+"menus.gif",TextComboWidget_arrowClickCB,null,(_openMenuPart1+(tooltip?tooltip:"")+_openMenuPart2),7,16,0,81,0,97)
- o.menu=newMenuWidget("menu_"+id,TextComboWidget_hideCB,beforeShowCB)
-
- o.arrow.setClasses("iconnocheck", "combobtnhover", "combobtnhover", "combobtnhover")
-
- // set the parent
- o.text.par=o
- o.arrow.par=o
- o.menu.parIcon=o
- // properties
- o.arrow.margin=0
- o.arrow.overCB="IconWidget_none"
- o.arrow.outCB="IconWidget_none"
- o.margin=0
- o.spc=0
-
- o.counter=0
- // to align the text field and arrow icon
- o.arrow.h=12
- o.arrow.dy+=2
- o.arrow.disDy+=2
-
- o.index=_allBOIconsMenus.length++
- _allBOIconsMenus[o.index]=o
- // public methods
- o.menIcnOldInit=o.init
- o.init=TextComboWidget_init
- o.imwpResize=o.resize
- o.resize=TextComboWidget_resize
- o.getHTML=TextComboWidget_getHTML
- o.setDisabled=TextComboWidget_setDisabled
- o.isDisabled=TextComboWidget_isDisabled
-
- o.add=TextComboWidget_add
- o.addSeparator=TextComboWidget_addSeparator
- o.addMenuItem=TextComboWidget_addMenuItem
- o.select=TextComboWidget_select
- o.getSelection=TextComboWidget_getSelection
- o.valueShow=TextComboWidget_valueShow
- o.valueSelect=TextComboWidget_valueSelect
- o.setUndefined=TextComboWidget_setUndefined
- o.setContentEditable=TextComboWidget_setContentEditable
- o.isContentEditable=TextComboWidget_isContentEditable
-
- // private methods
- o.changeCB=changeCB
- o.checkCB=checkCB
- o.clickCB=TextComboWidget_clickCB
- o.selectItem=TextComboWidget_selectItem
- o.getItemByIndex=TextComboWidget_getItemByIndex
- o.getItemIndex=TextComboWidget_getItemIndex
- o.setItemDisabled=TextComboWidget_setItemDisabled
-
- o.text.enterCancelBubble=false
- return o
- }
- // ================================================================================
- function TextComboWidget_init()
- // Initialize the TextIconMenuWidget
- {
- var o=this
- o.menIcnOldInit()
- o.text.init()
- o.arrow.init()
- o.menu.init()
-
- var l=o.layer
- l.onmouseover=TextCombo_OverCB
- l.onmouseout=TextCombo_OutCB
- }
- // ================================================================================
- function TextComboWidget_getHTML()
- // Return the HTML of the TextIconMenuWidget
- {
- var o=this, s=''
-
- s+='<table id="'+o.id+'" cellspacing="0" cellpadding="0" border="0" style="cursor:default;margin:'+o.margin+'px"><tbody><tr>'
- s+='<td>'+o.text.getHTML()+'</td>'
- s+='<td style="padding-left:'+o.spc+'px" width="'+(13+o.spc)+'">'+o.arrow.getHTML()+'</td>'
- s+='</tr></tbody></table>'
-
- return s
- }
- // ================================================================================
- function TextComboWidget_resize(w,h)
- // Resize the TextIconMenuWidget
- {
- var o=this
- if (w!=null)
- w=Math.max(0,w-2*o.margin)
- var d=o.layer.display!="none"
- if (d&_moz&&!_saf)
- o.setDisplay(false)
- o.imwpResize(w,h)
- if (d&_moz&&!_saf)
- o.setDisplay(true)
- }
- // ================================================================================
- function TextComboWidget_add(s,val,selected)
- // Add a new item in the menu
- // s [string] displayed value
- // val [string] internal value
- // selected [boolean] item selected or not
- {
- var o=this
- var item=o.menu.addCheck(o.id+"_it_"+(o.counter++),s,TextComboWidget_internalCB)
-
- item.val=""+val
- item.parCombo=o
- item.isComboVal=true
-
- if ((o.selectedItem==null)||selected)
- o.selectItem(item)
- }
- // ================================================================================
- function TextComboWidget_addSeparator()
- // Add a separator to the menu
- {
- this.menu.addSeparator()
- }
- // ================================================================================
- function TextComboWidget_addMenuItem(id,text,cb,icon,dx,dy,disabled,disDx,disDy)
- // Add a new item to the menu
- {
- this.menu.add(id,text,cb,icon,dx,dy,disabled,disDx,disDy)
- }
- // ================================================================================
- function TextComboWidget_setDisabled(d)
- // Enable/Disable the TextIconMenuWidget
- {
- var o=this
-
- /* if (o.selectedItem)
- o.text.setValue(d?"":o.selectedItem.text)*/
- o.text.setDisabled(d)
- o.arrow.setDisabled(d)
- o.menu.setDisabled(d)
- o.disabled=d
- /* if(d)
- o.icon.changeTooltip(o.icon.alt?o.icon.alt:"",true)*/
- }
- // ================================================================================
- function TextComboWidget_isDisabled()
- {
- var o=this
-
- return o.disabled
- }
- // ================================================================================
- function TextComboWidget_select(idx)
- // Select an item in the TextIconMenuWidget
- // idx : item index (only items added by "add" function are taken in account)
- // to allow menus combining combo items and menu action items
- {
- var o=this,item=o.getItemByIndex(idx)
- if (item)
- o.selectItem(item)
- }
- // ================================================================================
- function TextComboWidget_setItemDisabled(idx,disabled)
- // Disable a specific item on the TextIconMenuWidget
- // idx [int] item index (only items added by "add" function are taken in account)
- // disabled [boolean] disable if true
- {
- var o=this,item=o.getItemByIndex(idx)
- if (item)
- item.setDisabled(disabled)
- }
- // ================================================================================
- function TextComboWidget_getSelection()
- // Return the value selected in the TextIconMenuWidget
- // It is either a value selected from the menu or the
- // value type in the textfield
- {
- var o=this,it=o.selectedItem
- var txt=o.text.getValue()
- if (it)
- return {index:o.getItemIndex(it),value:it.val}
- else
- return {index:-1,value:txt}
- }
- // ================================================================================
- function TextComboWidget_valueSelect(v)
- {
- v=""+v
- var o=this,items=o.menu.items,len=items.length
- for (var i=0;i<len;i++)
- {
- var it=items[i]
- if ((it.isComboVal)&&(it.val==v))
- {
- o.selectItem(it)
- return
- }
- }
- o.text.setValue(v)
- }
- // ================================================================================
- function TextComboWidget_valueShow(v,show)
- {
- v=""+v
- var o=this,items=o.menu.items,len=items.length
- for (var i=0;i<len;i++)
- {
- var it=items[i]
- if ((it.isComboVal)&&(it.val==v))
- {
- it.show(show)
- return
- }
- }
- o.text.setValue(v)
- o.text.show(show)
- }
- // ================================================================================
- function TextComboWidget_setUndefined(u)
- {
- var o=this
- if (u)
- o.selectItem(null)
- }
- // ================================================================================
- function TextComboWidget_setContentEditable(d)
- {
- var o=this
-
- o.text.setContentEditable(d)
- }
- // ================================================================================
- function TextComboWidget_isContentEditable()
- {
- var o=this
-
- return o.text.isContentEditable()
- }
- // ================================================================================
- function TextComboWidget_selectItem(item)
- // PRIVATE
- {
- var o=this
-
- if (o.selectedItem)
- o.selectedItem.check(false)
-
- if (item)
- {
- o.val=item.val
- o.text.setValue(/*o.disabled?"":*/item.text)
- o.selectedItem=item
- item.check(true)
- /* if(o.disabled)
- o.text.changeTooltip(o.icon.alt?o.icon.alt:"",true)
- else
- o.text.changeTooltip(o.icon.alt?(o.icon.alt+' ('+item.text)+')':(item.text),true) */
- }
- else
- {
- o.val=null
- o.text.setValue("")
- // o.text.changeTooltip(o.icon.alt?o.icon.alt:"",true)
- o.selectedItem=null
- }
- }
- // ================================================================================
- function TextComboWidget_getItemByIndex(idx)
- // PRIVATE
- {
- var items=this.menu.items
- return ((idx>=0)&&(idx<items.length))?items[idx]:null
- }
- // ================================================================================
- function TextComboWidget_getItemIndex(item)
- // PRIVATE
- {
- var items=this.menu.items,len=items.length,j=0
- for (var i=0;i<len;i++)
- {
- var it=items[i]
- if (it.isComboVal)
- {
- if (it.id==item.id)
- return j
-
- j++
- }
- }
- return -1
- }
- // ================================================================================
- function TextComboWidget_changeCB()
- // PRIVATE
- {
- var p=this.par
-
- var b=true
- if (p.checkCB)
- b=p.checkCB()
-
- if (!b)
- return
-
- if (p.changeCB)
- p.changeCB()
- }
- // ================================================================================
- function TextComboWidget_enterCB()
- // PRIVATE
- {
- var p=this.par
-
- // 1st : Unselect any selected element from the menu
- if (p.selectedItem)
- {
- p.selectedItem.check(false)
- p.selectedItem=null
- }
-
- //2nd : Call the callBack function
- var b=true
- if (p.checkCB)
- b=p.checkCB()
-
- if (!b)
- return
-
- if (p.changeCB)
- p.changeCB()
- }
- // ================================================================================
- function TextComboWidget_checkCB()
- // PRIVATE
- {
- var p=this.par
-
- if (p.checkCB)
- p.checkCB()
- }
- // ================================================================================
- function TextComboWidget_hideCB()
- // PRIVATE
- {
- var o=this.parIcon;
- if(o.arrow)
- o.arrow.focus();
- TextComboOutCB(o.index)
- }
- // ================================================================================
- function TextComboWidget_arrowClickCB()
- // PRIVATE
- {
- this.par.clickCB()
- }
- // ================================================================================
- function TextComboWidget_clickCB()
- // PRIVATE
- {
- var o=this,l=o.layer
-
- o.menu.show(!o.menu.isShown(),getPosScrolled(l).x,getPosScrolled(l).y+o.getHeight()+1,null,null,o)
- TextComboOverCB(o.index)
- }
- // ================================================================================
- function TextCombo_OverCB()
- // PRIVATE
- {
- TextComboOverCB(getWidget(this).index)
- return true
- }
- // ================================================================================
- function TextComboOverCB(i)
- // PRIVATE
- {
- var o=_allBOIconsMenus[i]
- IconWidget_overCB(o.arrow.index) // Re-use method from IconWidget class
- }
- // ================================================================================
- function TextCombo_OutCB(i)
- // PRIVATE
- {
- TextComboOutCB(getWidget(this).index)
- }
- // ================================================================================
- function TextComboOutCB(i)
- // PRIVATE
- {
- var o=_allBOIconsMenus[i]
- if (!o.menu.isShown())
- IconWidget_outCB(o.arrow.index) // Re-use method from IconWidget class
- else
- IconWidget_overCB(o.arrow.index)
- }
- // ================================================================================
- function TextComboWidget_internalCB()
- // PRIVATE
- {
- var o=this,c=o.parCombo
- c.selectItem(o)
- if (c.changeCB)
- c.changeCB()
- }
- // ================================================================================
- function TextComboWidget_keyUpCB()
- // PRIVATE
- {
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newIconScrollMenuWidget (Constructor)
- //
- // An icon widget that add an arrow part at the right. when clicking on the
- // right part, a menu pops up
- // If no callback is attached, the also pops up when clicking on the left part
- // menu.js must be included to use this component
- //
- // ================================================================================
- // ================================================================================
- /*
- function newIconScrollMenuWidget(id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy,
- changeCB,multi,width,lines,tooltip,dblClickCB,keyUpCB,showLabel,label,convBlanks,beforeShowCB)
- // CONSTRUCTOR
- // id [String] the icon id for DHTML processing
- // src [String] the icon image url
- // clickCB [Function - optional] callback called when clicking
- // text [String - optional] icon text
- // alt [String] icon tooltip
- // w [int] visible image width
- // h [int] visible image height
- // dx [int - optional] horizontal offset in the image
- // dy [int - optional] vertical offset in the image
- // disDx [int - optional] horizontal offset for disabled state
- // disDy [int - optional] vertical offset for disabled state
- // changeCB [Function - optional] calback when selection is changed by the user
- // multi [boolean - optional] if true, multiselection is enabled
- // lines [int] number of visible lines
- // tooltip [String - optional] tooltip for 508
- // dblClickCB [Function - optional] calback when an item is double-clicked
- // keyUpCB [Function - optional] calback when a key
- // showLabel [boolean - optional] if true a label is displayed
- // label [boolean - optional] text of the label
- // convBlanks [int - optional]
- // beforeShowCB [Function - optional] callback called before showing the menu
- {
- var o=newIconMenuWidget(id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy)
- o.menu=newScrollMenuWidget("iconMenu_menu_"+id,changeCB,multi,width,lines,tooltip,dblClickCB,keyUpCB,showLabel,label,convBlanks,beforeShowCB)
- o.add=IconScrollMenu_add
-
- return o
- }
- // ================================================================================
- function IconScrollMenu_add(s,val,sel,id)
- {
- this.menu.add(s,val,sel,id)
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newPaneWidget (Constructor)
- //
- // creates a pane with multiple switchable zones
- //
- //
- // ================================================================================
- // ================================================================================
- function newPaneWidget(id,tooltip,w,h,x,y,changeCB)
- // id [String] the pane id for DHTML processing
- // w [Int - Optional] the pane width (100 px if ommited or null)
- // h [Int - Optional] the pane height (400 px if ommited or null)
- // Returns [PaneWidget] the new instance
- {
- var o=newWidget(id)
- // Private Fields
- o.items=new Array
- o.w=(w==null?100:w)
- o.h=(w==null?400:h)
- o.x=x
- o.y=y
- o.changeCB=changeCB
- o.pal = newPaletteWidget("palette_"+id);
- o.pal.vertPadding=0
- o.panes = new Array;
- o.panemenu = null
- o.selection=-1
- o.topH=_ie?18:17
- o.bottomH=24+(_ie?0:2)
- o.tooltip=tooltip
- o.iframe=newWidget("_iframe"+o.id)
- o.title=newWidget("paneTitleB_"+o.id)
-
- // Methods
- o.add = PaneWidget_add
- o.valueSelect = PaneWidget_valueSelect
- o.valueShow = PaneWidget_valueShow
- o.getSelection = PaneWidget_getSelection
-
- // Standard widget methods
- o.getHTML=PaneWidget_getHTML
- o.oldInit=o.init
- o.init=PaneWidget_init
- o.oldResize=o.resize
- o.resize=PaneWidget_resize
- o.getFrame=PaneWidget_getFrame
- o.resizePalette=PaneWidget_resizePalette
- return o
- }
- // ================================================================================
- function PaneWidget_getSelection()
- {
- var o=this,i=o.selection
- if (i==-1)
- return null
- else
- return {index:i,value:o.panes[i].value}
- }
- // ================================================================================
- function PaneWidget_resize(w,h)
- {
- var o=this
- o.w=w
- o.h=h
- o.oldResize(Math.max(0,w+(_ie?0:-2)),Math.max(0,h+(_ie?0:-2)))
- o.pal.resize(Math.max(0,w-2))
- o.title.resize(Math.max(0,w-2))
- o.iframe.resize(Math.max(0,o.w-2),Math.max(0,o.h-(o.topH+o.bottomH)-3))
- o.resizePalette()
- }
- // ================================================================================
- function PaneWidget_resizePalette()
- // PRIVATE
- {
- var o=this,nbButton=0,panes=o.panes,len=panes.length;maxVisible=Math.floor((o.w-22)/24),j=0,hasMenu=false
-
- for (var i=0;i<len;i++)
- {
- var pane=panes[i],isVis=j<maxVisible,menu=o.menu
- pane.button.setDisplay(pane.shown&&(isVis))
-
- if (menu)
- {
- var menuItem=menu.getItem(i),show=pane.shown&&(!isVis)
- menuItem.show(show)
- if (show)
- hasMenu=true
- }
-
- if (pane.shown) j++
- }
- o.panemenu.setDisplay(hasMenu)
- }
- // ================================================================================
- function PaneWidget_init()
- {
- var o=this
-
- o.oldInit()
- o.pal.init()
- o.panemenu.init()
- o.iframe.init()
- o.title.init()
- }
- // ================================================================================
- function PaneWidget_getFrame()
- {
- return eval("_curWin.frames._iframe"+this.id)
- }
- // ================================================================================
- function PaneWidget_valueShow(value,show)
- {
- var o=this,panes=o.panes,index=-1,pane=null
- for (i=0;i<panes.length;i++)
- {
- pane=panes[i]
- if (pane.value==value)
- {
- index=i
- break
- }
- }
-
- if (pane)
- {
- //pane.button.setDisplay(show)
- o.resizePalette()
- pane.menuItem.show(show)
- pane.shown=show
- }
- }
- // ================================================================================
- function PaneWidget_valueSelect(value)
- {
- var o=this,panes=o.panes,index=-1,pane=null,oldSel=o.selection
- for (i=0;i<panes.length;i++)
- {
- pane=panes[i]
- if (pane.value==value)
- {
- index=i
- break
- }
- }
-
- // Deselect prev
- if (o.selection>=0)
- {
- var oldPane=panes[o.selection]
- if (oldPane)
- {
- oldPane.menuItem.check(false)
- oldPane.button.check(false)
- }
- }
-
- if (index>=0)
- {
- pane.menuItem.check(true)
- pane.button.check(true)
- o.title.setHTML(convStr(pane.name))
- var hasChanged=(o.selection!=index)
- o.selection=index
-
- if (hasChanged)
- {
- if ((oldSel!=-1)&&(o.changeCB))
- o.changeCB()
- frameNav("_iframe"+o.id,pane.url,false,_curWin)
- }
- }
- else
- {
- if (o.selection!=-1)
- {
- o.selection=-1
- frameNav("_iframe"+o.id,_skin+"../../empty.html",false,_curWin)
- }
- }
- }
- // ================================================================================
- function PaneWidget_getHTML()
- {
- var o=this,panes=o.panes,pal=o.pal
-
- if (o.panemenu == null)
- {
- pal.beginRightZone()
- var pm=o.panemenu = newIconWidget("__panemenu_"+o.id,_skin+'panemenu.gif',PaneWidget_buttonCB,null,null,9,16);
- pm.isPaneMenu=true
- pm.parPane=o
- pal.add(pm)
-
- var menu=o.menu = newMenuWidget("panemenu_"+o.id);
- for (var i=0; i<panes.length; i++)
- {
- var pane=panes[i]
- var m=menu.addCheck("m__"+pane.button.id,pane.name,PaneWidget_buttonCB,pane.icon,pane.button.dx,pane.button.dy)
- m.paneElement=pane
- pane.menuItem=m
- }
- }
- o.resizePalette()
-
- var absSty = ((o.x!=null)&&(o.y!=null)) ? "position:absolute;left:"+o.x+"px;top:"+o.y+"px;" : ""
- return '<div class="treeZone" id="'+o.id+'" style="'+absSty+'overflow:hidden;width:'+(o.w+(_ie?0:-2))+'px;height:'+(o.h+(_ie?0:-2))+'px">' +
- '<div class="titlepane" id="paneTitleB_'+o.id+'" style="overflow:hidden;background-image:url('+_skin+'panetitle.gif);height:'+(o.topH)+'px"></div>'+
- '<iframe class="treeZone" style="border-width:0px;border-bottom-width:1px;width:'+Math.max(0,o.w-2)+'px;height:'+(Math.max(0,o.h-(o.topH+o.bottomH)-3))+'px" id="_iframe'+o.id+'" name="iframe_'+o.id+'" title="'+convStr(o.tooltip)+'" frameborder="0" src="'+_skin+'../../empty.html"></iframe>'+
- '<div class="panelzone" id="paneTools_'+o.id+'" style="height:'+o.bottomH+'px">'+pal.getHTML()+'</div>' +
- '</div>'
- }
- // ================================================================================
- function PaneWidget_add(value,name,icon,dx,dy,url)
- {
- newPaneElement(this,this.id+"_item_"+value,value,name,icon,dx,dy,url)
- }
- // ================================================================================
- function PaneWidget_buttonCB()
- {
- var o=this
-
- if (o.isPaneMenu)
- {
- var m = o.parPane.panemenu,l = m.layer
- o.parPane.menu.show(true,getPosScrolled(l).x+m.getWidth()+1,getPosScrolled(l).y+16)
- }
- else
- {
- var paneE = o.paneElement
- paneE.par.valueSelect(paneE.value)
- }
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newPaneElementWidget (Constructor)
- //
- // creates a pane with multiple switchable zones
- //
- //
- // ================================================================================
- // ================================================================================
- function newPaneElement(par,id,value,name,icon,dx,dy,url)
- {
- var o=new Object
-
- o.par=par
- par.panes[par.panes.length]=o
- o.value=value
- o.name=name
- o.icon=icon
- o.button=newIconCheckWidget(id,icon,PaneWidget_buttonCB,null,name,16,16,dx,dy);
- o.button.paneElement=o
- o.url=url
- par.pal.add(o.button)
- o.shown=true
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newButtonMenuWidget (Constructor)
- //
- //
- // ================================================================================
- // ================================================================================
-
- function newButtonMenuWidget(id,label,width,tooltip,beforeShowCB,tabIndex)
- {
- var o=newButtonWidget(id,label,ButtonMenuWidget_clickCB,width,null,tooltip,tabIndex,0,_skin+"menus.gif",7,16,0,81,true,0,97)
-
- o.menu = newMenuWidget("buttonMenu_menu_"+id,null,beforeShowCB);
- o.getMenu=IconMenuWidget_getMenu
-
- return o;
- }
-
- // ================================================================================
- function ButtonMenuWidget_clickCB()
- // PRIVATE
- {
- var o=this,l=o.layer;
- o.menu.show(!o.menu.isShown(),getPosScrolled(l).x,getPosScrolled(l).y+o.getHeight(),null,null,o)
- }
- _scrollW=20
- _scrollH=20
- _margin=2
-
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newIconTableWidgetElem (Constructor)
- //
- // Display a clickable icon with optional text. It can be used in a palette fo
- // instance. The image can be a sub-part of a bigger image
- // (use dx and dy to define offset)
- //
- // ================================================================================
- // ================================================================================
- function newIconTableWidgetElem(parid,id,src,clickCB,text,alt,w,h,dx,dy,disDx,disDy,maxW,maxH)
- {
- var o=newIconRadioWidget(id,src,clickCB,text,alt,"grp_"+parid,w,h,dx,dy,disDx,disDy)
-
- // Properties
- o.txtNoPadding=true
- o.txtAlign='center'
- o.margin=0
-
- o.maxW=maxW
- o.maxH=maxH
-
- o.imgW=w+o.border
- o.imgH=h+o.border
-
- o.txtW=maxW-2*_margin
- // Methods
- o.oldGetHTML=o.getHTML
- o.getHTML=IconTableWidgetElem_getHTML
- o.oldResize=o.resize
- o.resize=IconTableWidgetElem_resize
-
- return o
- }
- // ================================================================================
- function IconTableWidgetElem_getHTML()
- // returns [String] the HTML of an icon widget
- {
- var o=this,imgCode=o.src?'<div style="overflow:hidden;width:'+o.imgW+'px;height:'+o.imgH+'">'+simpleImgOffset(o.src,o.w,o.h,o.dis?o.disDx:o.dx,o.dis?o.disDy:o.dy,'IconImg_'+o.id,null,o.alt,'margin:2px;cursor:'+(o.clickCB ? (!o.acceptClick() ? 'default' : _hand):'default'))+o.extraHTML+'</div>':'<div class="icontext" style="width:1px;"></div>'
- var txtAtt='style="white-space:normal;'
- txtAtt+='text-overflow:ellipsis;overflow:hidden;width:'+o.txtW+'px;'
- txtAtt+='"'
-
- var d=o.disp?"":"display:none;"
-
- return '<table style="'+d+'width:'+o.maxW+'px;height:'+o.maxH+'margin:0px" id="'+o.id+'" class="' + o.nocheckClass + '" cellspacing="0" cellpadding="0" border="0"><tr valign="middle">'+
- '<td align="center">'+ ((o.clickCB&&_ie)?lnk(imgCode,null,null,null, ' tabIndex="-1"' ):imgCode)+'</td></tr><tr>'+
- (o.text?'<td align="center"><div id="IconImg_Txt_'+o.id+'" class="iconTableText'+(o.dis?"Dis":"")+'" '+txtAtt+'>'+convStr(o.text)+'</div></td>':'')+
- '</tr></table>'
- }
- // ================================================================================
- function IconTableWidgetElem_resize(w,h)
- {
- var o=this
-
- if (w!=null)
- o.oldResize(w-2*_margin,null)
- if (h!=null)
- o.oldResize(null,h-2*_margin)
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newIconTableWidget (Constructor)
- //
- // Display a table of clickable icons.
- //
- // ================================================================================
- // ================================================================================
- function newIconTableWidget(id,horiz,w,h)
- // CONTRUCTOR
- // id : [String] the icon id for DHTML processing
- // horiz : [boolean] if true, table is horizontal (1 row and n columns)
- // if false, table is vertical (n rows and 1 column)
- // w : [int] width
- // h : [int] height
- {
- var o=newScrolledZoneWidget(id,0,0,w,h)
-
- // Properties
- o.horiz=horiz
- o.padding=2
- o.icnTblLayer=null
- o.contCSS=null
-
- o.elems=new Array
-
- // Methods
- o.oldInit=o.init
- o.init=IconTableWidget_init
- o.oldResize2=o.resize
- o.resize=IconTableWidget_resize
- o.getHTML=IconTableWidget_getHTML
- o.add=IconTableWidget_add
- o.select=IconTableWidget_select
-
- return o
- }
- // ================================================================================
- function IconTableWidget_init()
- {
- var o=this, len=o.elems.length
-
- //o.oldInit()
-
- for (var i=0;i<len;i++)
- o.elems[i].init()
-
- o.icnTblLayer=getLayer(_codeWinName+'icnTbl'+o.id)
- o.contCSS=o.icnTblLayer.style
- }
- // ================================================================================
- function IconTableWidget_resize(w,h)
- {
- var o=this
-
- //o.oldResize2(w,h)
- if (w!=null)
- {
- if (o.contCSS!=null)
- o.contCSS.width=''+w+'px'
- }
-
- if (h!=null)
- {
- if (o.contCSS!=null)
- o.contCSS.height=''+h+'px'
- }
- }
- // ================================================================================
- function IconTableWidget_getHTML()
- {
- var o=this, s=''
-
- // s+= o.beginHTML()
- s+= '<table id="'+_codeWinName+'icnTbl'+o.id+'" width="'+o.w+'" height="'+o.h+'px" class="iconTableZone" cellspacing="0" cellpadding="0"><tbody>'
- s+= '<tr valign="top"><td>'
-
- s+= '<table cellspacing="0" cellpadding="'+o.padding+'px"><tbody>'
- if (o.horiz)
- {
- s+= '<tr>'
-
- for (var i=0;i<o.elems.length;i++)
- {
- s+= '<td align="center">'
- s+= o.elems[i].getHTML()
- s+= '</td>'
- }
-
- s+= '</tr>'
- }
- else
- {
- for (var i=0;i<o.elems.length;i++)
- {
- s+= '<tr><td align="center">'
- s+= o.elems[i].getHTML()
- s+= '</td></tr>'
- }
- }
- s+= '</tbody></table>'
- s+= '</td><tr>'
-
- s+= '</tbody></table>'
- // s+= o.endHTML()
-
- return s
- }
- // ================================================================================
- function IconTableWidget_add(src,clickCB,text,alt,w,h,dx,dy,disDx,disDy)
- {
- var o=this, len=o.elems.length, icn=null
-
- var maxW=o.horiz?o.h:o.w
- maxW-=2*_margin
- var maxH=maxW
-
- icn=newIconTableWidgetElem(o.id,"iconTable_icon_"+len+o.id,src,clickCB,text,alt,
- w,h,dx,dy,disDx,disDy,maxW,maxH)
- icn.par=this
-
- o.elems[len]=icn
- }
- // ================================================================================
- function IconTableWidget_select(index)
- {
- var o=this
-
- var e=o.elems[index]
- if ( e==null )
- return
-
- e.check(true)
- }
- // ================================================================================
- // Icon Border Menu Widget
- // ================================================================================
- function newIconBordersMenuWidget(id,clickCB,beforeShowCB)
- {
- var o=newIconMenuWidget(id,_skin+'../borders.gif',IconBordersMenuWidget_iconInternalClickCB,null,null,16,16,0,0,0,16,false,beforeShowCB,_menuType_border)
-
- // properties
- o.selectedBorder=new Object
- o.selectedBorder.top=0
- o.selectedBorder.bot=0
- o.selectedBorder.left=0
- o.selectedBorder.right=0
-
- o.lastSelectedBorder=new Object
- o.lastSelectedBorder.top=0
- o.lastSelectedBorder.bot=0
- o.lastSelectedBorder.left=0
- o.lastSelectedBorder.right=0
-
- o.bordersClickCB=clickCB
-
- // methods
- o.getSelectedBorder=IconBordersMenuWidget_getSelectedBorder
- o.getLastSelectedBorder=IconBordersMenuWidget_getLastSelectedBorder
-
- return o
- }
- // ================================================================================
- function IconBordersMenuWidget_getSelectedBorder()
- {
- var o=this
-
- return o.selectedBorder
- }
- // ================================================================================
- function IconBordersMenuWidget_getLastSelectedBorder()
- {
- var o=this
-
- return o.lastSelectedBorder
- }
- // ================================================================================
- function IconBordersMenuWidget_iconInternalClickCB()
- {
- var o=this
-
- o.selectedBorder.top=o.lastSelectedBorder.top
- o.selectedBorder.bot=o.lastSelectedBorder.bot
- o.selectedBorder.left=o.lastSelectedBorder.left
- o.selectedBorder.right=o.lastSelectedBorder.right
-
- if (o.bordersClickCB)
- o.bordersClickCB()
- }
- // ================================================================================
- function IconBordersMenuWidget_internalClickCB()
- {
- var o=this
-
- var top=bot=left=right=-1
-
- switch (o.id)
- {
- case "border_0":
- top=bot=left=right=0
- break;
- case "border_1":
- bot=1
- break;
- case "border_2":
- left=1
- break;
- case "border_3":
- right=1
- break;
- case "border_4":
- bot=2
- break;
- case "border_5":
- bot=3
- break;
- case "border_6":
- top=bot=1
- break;
- case "border_7":
- top=1;bot=2
- break;
- case "border_8":
- top=1;bot=3
- break;
- case "border_9":
- top=bot=left=right=1
- break;
- case "border_10":
- top=bot=left=right=2
- break;
- case "border_11":
- top=bot=left=right=3
- break;
- case "border_12":
- top=bot=left=right=-2
- break;
- }
- // Set the selection
- var pp=o.par.parIcon
-
- pp.selectedBorder.top=top
- pp.selectedBorder.bot=bot
- pp.selectedBorder.left=left
- pp.selectedBorder.right=right
-
- if (o.id!="border_12")
- {
- // Update the menu icon
- pp.icon.changeImg(16*o.idx,0)
-
- // Save the previous border
- pp.lastSelectedBorder.top=top
- pp.lastSelectedBorder.bot=bot
- pp.lastSelectedBorder.left=left
- pp.lastSelectedBorder.right=right
- }
- // Call the menu callback
- if (pp.bordersClickCB)
- pp.bordersClickCB()
- }
- */
|