[Gambas-bugtracker] Bug #2586: mouse.right or left don't have difference...

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Sat Jul 16 09:12:10 CEST 2022


Comment #2 by spheris SPHERIS:

code of application :
Private Sub dpopmenu() 'popup menu on desktop
Dim m0 As Menu
Dim m1 As Menu
Dim m2 As Menu
Dim m3 As Menu
Dim m4 As Menu
Dim m5 As Menu
Dim m6 As Menu
Dim m7 As Menu
Dim m8 As Menu
Dim m9 As Menu
Dim m10 As Menu
Dim m11 As Menu
Dim ac1 As Menu
Dim ac2 As Menu
Dim ac3 As Menu
Dim ac4 As Menu
Dim ac5 As Menu
Dim ac6 As Menu
Dim ac7 As Menu
Dim $f As String
Dim $to As String = ""
Dim $co As New String[]
Dim p As Image
If Mouse.Right Then
m0 = New Menu(Me)
m1 = New Menu(m0) As "m1"
m2 = New Menu(m0) 'space bar
ac1 = New Menu(m0) 'Menu action
ac1.text = "Action"
ac1.Picture = Picture["icon:/16/exec"]
ac2 = New Menu(ac1) As "dm6"
ac2.Text = "Duplicate"
ac2.Picture = Picture["icon:/16/copy"]
ac3 = New Menu(ac1) As "dm9"
'ac3.Text = "Rename " & icview.Current.Text
ac3.Picture = Picture["icon:/16/edit"]
ac4 = New Menu(ac1) As "dm8"
'ac4.Text = "Delete " & icview.Current.Text
ac4.Picture = Picture["icon:/16/delete"]
ac5 = New Menu(ac1) As "nf"
ac5.Text = "Create new folder"
ac5.Picture = Picture["icon:/16/directory"]
ac6 = New Menu(ac1)
ac7 = New Menu(ac1) As "dm3"
ac7.Text = "Get infos"
ac7.Picture = Picture["icon:/16/properties"]

m3 = New Menu(m0)
m3.Text = "Icon view"
m4 = New Menu(m0)
m4.Text = "Mini icon view"
m5 = New Menu(m0) 'space bar
m6 = New Menu(m0)
m6.Text = "Mount"
m7 = New Menu(m6)
m7.Text = "Mount All"
m8 = New Menu(m6)
m8.Text = "Settings.."
m9 = New Menu(m0) 'space bar
m10 = New Menu(m0)
m10.Text = "Add-Ons"
p = Iresize($icon & "addon.xpm", 16)
m10.Picture = p.Picture

For Each $f In Dir($addon)
m11 = New Menu(m10) As "dm5"
m11.Text = $f
$to = File.Load($addon & $f)
$co = Split($to, ";")
p = Iresize($icon & $co[1], 16)
m11.Picture = p.Picture
If m0 Then m0.Popup()

Public Sub Form_MouseDown()

More information about the Bugtracker mailing list