Decorate buttons
Author: roger.wallin@abilita.fi (rogerw)
Hi, the code below puts leftaligned pictures on a button of an entity. Each occurrence has it's own picture (=the name of the occurrence-id) or then the picture is missing and then a default picture should be used. Is it possible to do this in a more effective way not having to do the $fileexist-check. Eg. using glyphs or somehow putting a default picture on the button that won't be replaced by the !-char as you try to put a missing picture on the button. I haven't used a lot of pictures so the solution could be easy or then it's not possible to do this in another way.... Regards RogerW. entry DecorateBtns $properties(tran_desc.mnu_tran) = "representation=Uniface·;ImageLabelAlign=left·;imgsize=IMG_xlarge" forentity "mnu_tran" if($fileexists("%%tran_id.mnu_tran%%%.png")=0) tran_desc.mnu_tran="@mnudefault.png·!%%tran_desc.mnu_tran%%%" else tran_desc.mnu_tran="@%%tran_id.mnu_tran%%%.png·!%%tran_desc.mnu_tran%%%" endif endfor end; DecorateBtns ;tran_id is the id of the occurrence and ;tran_desc is the button and the text of the occurrence




