[6.10] Right-click on EditorGadget doesn't show pop-up menu regarding text

Just starting out? Need help? Post your questions and find answers here.
User avatar
marcoagpinto
Addict
Addict
Posts: 1076
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

[6.10] Right-click on EditorGadget doesn't show pop-up menu regarding text

Post by marcoagpinto »

Heya,

Not sure if this should be a “bug” or a “feature request”.

If you right-click on the scroll bar of a ListIconGadget you get a pop-up menu with some options.

However, if you right-click on an editor gadget you get no options such as “copy”, “paste”, “cut”, blah blah.

Could it be done?

Thanks!
AZJIO
Addict
Addict
Posts: 2225
Joined: Sun May 14, 2017 1:48 am

Re: [6.10] Right-click on EditorGadget doesn't show pop-up menu regarding text

Post by AZJIO »

Code: Select all

Define Point.POINT
#MenuR = 0
#Window = 0
#Gadget = 0
If OpenWindow(#Window, 0, 0, 800, 600, "Пример...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
	EditorGadget(#Gadget , 0 ,0 , 800, 600)
	SetGadgetText(#Gadget , "Hey, let's copy and paste me. Use the context menu")
	If CreatePopupMenu(#MenuR)
		MenuItem(0, "Copy"  +Chr(9)+"Ctrl+C")
		MenuItem(1, "Paste"  +Chr(9)+"Ctrl+V")
	EndIf
	Repeat
		Select WaitWindowEvent()
			Case #WM_RBUTTONUP
				GetCursorPos_(@Point)
				If WindowFromPoint_(PeekQ(Point)) = GadgetID(#Gadget)
					DisplayPopupMenu(#MenuR, WindowID(#Window))
				EndIf
			Case #PB_Event_Menu
				Select EventMenu()
					Case 0
						SendMessage_(GadgetID(#Gadget), #WM_COPY, 0, 0)
					Case 1
						SendMessage_(GadgetID(#Gadget), #WM_PASTE, 0, 0)
				EndSelect
			Case #PB_Event_CloseWindow
				CloseWindow(#Window)
				End
		EndSelect
	ForEver
EndIf
Scintilla

Code: Select all

SendMessage_(ScintillaHandle, #SCI_PASTE, 0, 0)
SendMessage_(ScintillaHandle, #SCI_COPY, 0, 0)
Post Reply