Right click menu on EditorGadget!
-
- Addict
- Posts: 841
- Joined: Mon Jun 07, 2004 7:10 pm
Right click menu on EditorGadget!
Stringgadget has it, a right click menu where you can undo, cut, paste, etc...
How can I get this menu for the editor gadget.
I'm 100% sure it's Windows API.
How can I get this menu for the editor gadget.
I'm 100% sure it's Windows API.
- utopiomania
- Addict
- Posts: 1655
- Joined: Tue May 10, 2005 10:00 pm
- Location: Norway
The snippets below are taken from a simple editor I posted here:
http://www.purebasic.fr/english/viewtopic.php?t=18024
In the OpenMainWindow() procedure:
In the event handler:
http://www.purebasic.fr/english/viewtopic.php?t=18024
In the OpenMainWindow() procedure:
Code: Select all
;;;;
;EditorGadgets popup menu
If CreatePopupMenu(#IdPopUp)
;Edit main menu items
MenuItem(#IdFileOpen, TxtFileOpen)
MenuItem(#IdFileSave, TxtFileSave)
MenuItem(#IdFileSaveAs, TxtFileSaveAs)
MenuBar()
MenuItem(#IdEditUndo, TxtEditUndo)
MenuItem(#IdEditAll, TxtEditAll)
MenuBar()
MenuItem(#IdEditCut, TxtEditCut)
MenuItem(#IdEditCopy, TxtEditCopy)
MenuItem(#IdEditPaste, TxtEditPaste)
MenuItem(#IdEditClear, TxtEditClear)
MenuItem(#IdEditView, TxtEditView)
MenuBar()
MenuItem(#IdEditFind, TxtEditFind)
MenuItem(#IdEditRepl, TxtEditRepl)
MenuBar()
MenuItem(#IdFilePrint, TxtFilePrint)
MenuItem(#IdFileExplore, TxtFileExplore)
MenuBar()
MenuItem(#IdFileExit, TxtFileExit)
MenuItem(#IdFileExitSave, TxtFileExitSave)
Else
;Create popup menu error
ProcedureReturn 0
EndIf
;;;;
Code: Select all
;;;;
;Mouseclick Event
Case #WM_RBUTTONDOWN
;Right mouseclick, open editorgadget popup menu
Select GetGadgetState(#Idpanel)
Case 0
;Tab 0, templates editorgadget right clicked
DisplayPopupMenu(#IdPopUp, PanelWinID(#IdPanel, 0))
Case 1
;Tab 1, html source editorgadget right clicked
DisplayPopupMenu(#IdPopUp, PanelWinID(#IdPanel, 1))
EndSelect
;;;;;
Re: Right click menu on EditorGadget!
@Bonne: You don't have to bump on the same day... have some patience.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
-
- Addict
- Posts: 841
- Joined: Mon Jun 07, 2004 7:10 pm
-
- Addict
- Posts: 841
- Joined: Mon Jun 07, 2004 7:10 pm
Been experimenting with this (and others) and am wondering if there's any way to have a right click apply to an editorgadget ONLY.
Seems when I try this method, no matter how I "segment" it, the right click menu applies to everything on the window. What I would like is a right click menu applying to the editor gadget but not the other items.
Anyone know if it's possible with PureBasic?
cheers
Seems when I try this method, no matter how I "segment" it, the right click menu applies to everything on the window. What I would like is a right click menu applying to the editor gadget but not the other items.
Anyone know if it's possible with PureBasic?
cheers
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact: