// Use Spec0011.utl // Floating menues on the fly Use Base.nui // Item_Property command, Various macros (FOR_EX...), cArray, cSet and cStack classes desktop_section object oSpec0011Arr is a cArray item_property_list item_property integer piMsg.i item_property string psText.i end_item_property_list procedure add_item integer iMsg string sVal local integer iRow get row_count to iRow set piMsg.i iRow to iMsg set psText.i iRow to sVal end_procedure end_object end_desktop_section procedure FLOATMENU_PrepareAddItem global integer iMsg string sVal send add_item to (oSpec0011Arr(self)) iMsg sVal end_procedure #IFDEF IS$WINDOWS class cSpec0011FloatingPopupMenu is a FloatingPopupMenu procedure popup forward send popup send request_destroy_object end_procedure end_class function FLOATMENU_Apply global integer iObj returns integer integer iSelf iArr iRow iMax iObjFM move self to iSelf move (oSpec0011Arr(self)) to iArr get row_count of iArr to iMax move desktop to self object oSpec0011_FM is a cSpec0011FloatingPopupMenu for iRow from 0 to (iMax-1) send add_item (piMsg.i(iArr,iRow)) (psText.i(iArr,iRow)) set aux_value item iRow to iObj loop move self to iObjFM end_object move iSelf to self send delete_data to iArr function_return iObjFM end_function #ELSE /Spec0011_PopupMenu.hdr ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» /Spec0011_PopupMenu.lst º______________________________________________ º º______________________________________________ º º______________________________________________ º º______________________________________________ º º______________________________________________ º º______________________________________________ º /Spec0011_PopupMenu.btn º _____________ _____________ º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ /* object oSpec0011_PopupMenu is a app.ModalClient Spec0011_PopupMenu.hdr set location to 10 25 absolute object oLst is a List Spec0011_PopupMenu.lst set location to 1 0 relative procedure fill_list.i integer iObj local integer iArr iRow iMax send delete_data move (oSpec0011Arr(self)) to iArr get row_count of iArr to iMax for iRow from 0 to (iMax-1) send add_item msg_ok (psText.i(iArr,iRow)) set aux_value item iRow to iObj loop end_procedure end_object object oBtn is a app.Button Spec0011_PopupMenu.btn set location to 7 0 relative item_list on_item t.btn.ok send ok on_item t.btn.cancel send cancel end_item_list end_object procedure popup local integer iRow iMsg iObj local integer iRval iArr iLst ui_accept self to iRval move (oSpec0011Arr(self)) to iArr move (oLst(self)) to iLst if iRval eq msg_ok begin get current_item of iLst to iRow move (piMsg.i(iArr,iRow)) to iMsg move (aux_value(iLst,iRow)) to iObj send delete_data to iArr send iMsg to iObj end send delete_data to iArr end_procedure end_object function FLOATMENU_Apply global integer iObj returns integer send fill_list.i to (oLst(oSpec0011_PopupMenu(self))) iObj function_return (oSpec0011_PopupMenu(self)) end_function #ENDIF