Hi!
What I'm trying is creating a textbox where the user can select a text and then right-click anytime to get a popupmenu (like in the bmxgui).
How can this be done?
What I'm trying is creating a textbox where the user can select a text and then right-click anytime to get a popupmenu (like in the bmxgui).
How can this be done?
SuperStrict Local MyWindow:TGadget=CreateWindow("TextArea Example", 40,40,400,400) Global MyText:TGadget=CreateTextArea(0,0,380,360,MyWindow) Global popmenu:TGadget=CreateMenu("popup",0,Null) CreateMenu("Load",101,popmenu) CreateMenu("Save",102,popmenu) AddTextAreaText(MyText,"The Quick Brown Fox ") AddTextAreaText(MyText,"Jumps Over The Lazy Dog.") Local cursorpos:Int Local SelectedLength:Int Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_GADGETSELECT cursorpos=TextAreaCursor(MyText) SelectedLength=TextAreaSelLen(MyText) Case EVENT_MOUSEDOWN If EventData()=2 PopupWindowMenu Mywindow,popmenu End Select SetStatusText MyWindow, "Text ="+TextAreaText(MyText,cursorpos,SelectedLength) Forever End