oForm=createobject('myForm') oForm.Show Read events Define class myForm as Form Add Object myMenu as myMenu with name = 'myMenu' procedure load Define popup mypop multiselect Define bar 1 of mypop prompt 'Color1' color RGB(0,0,0,192,192,192), RGB(0,0,0,0,255,255) Define bar 2 of mypop prompt 'Color2' color RGB(0,0,0,192,192,192), RGB(0,0,0,255,0,255) Define bar 3 of mypop prompt 'Color3' color RGB(0,0,0,192,192,192), RGB(0,0,0,255,255,0) Define bar 4 of mypop prompt 'Color4' color RGB(0,0,0,192,192,192), RGB(0,0,0,0,255,0) Define bar 5 of mypop prompt 'Done' color RGB(0,0,0,192,192,192), RGB(0,0,0,192,192,192) Endproc Procedure queryunload Clear events Endproc Procedure rightclick With this.myMenu .Move(min(mcol(wontop(),3), this.width-.width), ; min(mrow(wontop(),3),this.height-.height)) .visible = .t. Endwith Endproc Enddefine Define class myMenu as container SpecialEffect = 0 BorderWidth = 1 Visible = .f. Add object ColorCoded as myColorSel with left = 2, top=1 Add object myComm as myComm with left = 2 Procedure init With this .myComm.Top = .ColorCoded.height .Height = .myComm.Top+.myComm.height+1 .width = .ColorCoded.width+4 Endwith Endproc Enddefine Define class myColorSel as Listbox SpecialEffect=1 BorderColor=rgb(192,192,192) Procedure init With this .RowSourceType = 9 .Rowsource = 'mypop' .Height = .ListCount * FontMetric(1)+sysmetric(4)*2-1 Endwith Endproc Enddefine Define class myComm as commandbutton Caption='\<Done' Procedure click This.parent.visible = .f. Endproc EnddefineCetin