Hi there...
I like the ArcMenu a lot and it's brilliant, the thing is, you need to have your menu clearly defined even before you write the code, because the ArcMenu_Click method uses positions and there is no way to specify your own key if you want. This poses problems when you are faced with changing your menu as you go. This leads to having to change the code within Click or LongClick methods. The other thing, the ArcMenu only works with an activity and you cant add items to a panel.
After thinking of a way to do this two hours ago, I played around with this class. This is what I have been able to do so far.
1. You can add a menu item with a key and reference the key in the _Click and _LongClick methods. This is achieved by these additional enhancements
Code:
AddItem1(ItemKey As String, ItemImage As Bitmap)
2. This means that your activity's _Click and _LongClick methods also get an upgrage
_Click Method
Code:
ArcMenu_Click(position As Int, key As String)
_LongClick Method
Code:
ArcMenu_LongClick(position As Int, key As String)
3. On another note, whilst I am only using the _Click methods, I also explored about an Arc in a panel. Below is my own version of initializing the menu on my app. My GetPNG method uses LoadBitmapSample from Dir.Assets with 100%x width and 100%y width.
Code:
menu.Initialize(Activity, Me, "ArcMenu", modMashiane.GetPNG("menu_button_anim.png"), modMashiane.GetPNG("menu_button_bg.png"), 50%x, 50%y)
With the additional panel functionality, you can then replace this line with
Code:
menu.Initialize1(Activity, Me, "ArcMenu", modMashiane.GetPNG("menu_button_anim.png"), modMashiane.GetPNG("menu_button_bg.png"), 50%x, 50%y)
and then to add to the panel, you use
Normal way however to panel
Code:
AddItem3(ItemImage As Bitmap)
Add button to Panel with key
Code:
AddItem4(ItemKey As String, ItemImage As Bitmap)
Now with the key in place, I can chop and change my ArcMenu definition without having to worry about the positions
PS: What I did? For each image added, I assigned a tag property using the position of the image and the new key property as a map. For all the code that references the tag property of each image, I then read the map tag and process accordingly. Added Initialize1, AddItem1..4, otherwise the rest of the code is still intact.