Android Question RSPopupMenu

Terradrones

Active Member
Hi All

I need help please.

I have Icons on my screen and when the Surveyor taps on any of them, a Popupmenu appears, from which a further selection can be made. I use the RSPopupmenu library for this, which I like very much.

If the Selection list is short, then the menu works fine. For instance selecting the "Fix" icon when using a Dumpy Level, the selections are:

Collimation
Backsight
Intermediate
Foresight
Levelbook

If however the Surveyor selects "Setout", then the popup menu displays:

Batterboards
Earthworks
Surface
Coords
Strings
TIN Model..etc.

What I need are submenus under each of those selections. For instances if the User clicks on "Strings", then "Define, Load, Setout, Checks" should appear.

I have tried to use the "AddsubMenu2" option, but I am doing something wrong.

Could anybody please show me in code how to do it.
 

teddybear

Well-Known Member
Licensed User
Post your code or upload your project.zip
 
Upvote 0

Terradrones

Active Member
Hi, here is my code:

B4X:
[/
Sub ImageView2_Click
    'Setting Out
    Dim PopupMenu As RSPopupMenu
    PopupMenu.Initialize("PopupMenu1", ImageView2)
    PopupMenu.AddMenuItem2(0,0, 0, "Bulk")
    'The following menus must be Submenus under "Bulk"
    PopupMenu.AddSubMenuItem2(0,0, 0, "B\Boards")
    PopupMenu.AddsubMenuItem2(0,1, 1, "Plot")
    PopupMenu.AddsubMenuItem2(0,2, 2, "Float")
    PopupMenu.AddsubMenuItem2(0,3, 3, "E\Checks")
    
    PopupMenu.AddMenuItem2(1,0, 0, "Surface")
    'The following menus must be Submenus under "Surface"
    PopupMenu.AddSubMenuItem2(1,0, 0, "Surface")
    PopupMenu.AddsubMenuItem2(1,1, 1, "CrossFalls")
    PopupMenu.AddsubMenuItem2(1,2, 2, "Widths")
    PopupMenu.AddsubMenuItem2(1,3, 3, "Edge Shifts")
    PopupMenu.AddsubMenuItem2(1,4, 4, "Shoulders")
    PopupMenu.Show
End Sub
]

This is the what I am getting:
[ATTACH type="full"]130047[/ATTACH]
 

Attachments

  • Screenshot_20220606-123748.png
    Screenshot_20220606-123748.png
    137.8 KB · Views: 130
Upvote 0
Top