StrokesPlus.net Forum
»
Bugs or Issues
»
Known Issues
»
Can’t implement menu with X1 mouse button.
Rank: Member
Groups: Approved
Joined: 5/16/2021(UTC) Posts: 10
|
I decided to show a menu with X1 button. But script for gesture don’t work after inserted to X1 Click Enabled: 1) PopupMenuInfo – tried to show menu at left upper point of screen, but close it with id=0. 2) PopupMenuInfoEx – shows the menu but doesn’t perform any actin argument for item (). Code:popupMenuInfoEx.MenuItems.Add(new PopupMenuItem("c# search", `sp.SendString("c# | .NET "); `));
also I tried to remove gesture from action and checked Modifier button X1, it doesn’t work too.
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,382 Location: Tampa, FL Thanks: 28 times Was thanked: 431 time(s) in 364 post(s)
|
So you see the menu but if you click on an item with the left button, nothing happens? Does the menu item go away when you click?
Are you consuming the X1 click event?
|
|
|
|
Rank: Member
Groups: Approved
Joined: 5/16/2021(UTC) Posts: 10
|
1) PopupMenuInfo – menu shown at the correct point. ( I fixed location) but it is auto closed in a moment and shows message box with id = 0 (twice) Consume click event doesn't affect. Code:var popupMenuInfo = new PopupMenuInfo();
popupMenuInfo.Items.Add("ItemA");
popupMenuInfo.Items.Add("ItemB");
popupMenuInfo.Items.Add("Cancel");
popupMenuInfo.Location = sp.GetCurrentMousePoint();
popupMenuInfo.Callback = "PopupMenuMainCallback";
var res = sp.ShowPopupMenu(popupMenuInfo);
Load Code:function PopupMenuMainCallback(id) {
if (id == 1) {
sp.SendString("Value-1");
sp.SendKeys('~');
} else if (id == 2) {
sp.SendString("Value-2");
sp.SendKeys('~');
} else {
sp.MessageBox(""+id, "Selected Menu Item");
}
}
2. PopupMenuInfoEx after clicking on menu item menu closed but text is not inserted in textbox (notepad) Consume click event doesn't affect. Code:var popupMenuInfoEx = new PopupMenuInfoEx(sp.GetCurrentMousePoint());
popupMenuInfoEx.MenuItems.Add(new PopupMenuItem("ItemA", `sp.SendString("Value-1"); sp.SendKeys('~');`));
popupMenuInfoEx.MenuItems.Add(new PopupMenuItem("ItemB", `sp.SendString("Value-2"); sp.SendKeys('~');`));
popupMenuInfoEx.MenuItems.Add(new PopupMenuItem("c# search", `sp.SendString("c# | .NET "); `));
popupMenuInfoEx.MenuItems.Add(new PopupMenuItem("Close Popup", ""));
sp.ShowPopupMenuEx(popupMenuInfoEx);
These scripts work ok attached to gestures.
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,382 Location: Tampa, FL Thanks: 28 times Was thanked: 431 time(s) in 364 post(s)
|
Click has two events, down and up, so if you don't qualify the event, it will get called twice which may explain the issue.
On phone, so not nice format, but wrap in
if(click.Down) { ...script }
Or !click.Down to trigger on X1 release.
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,382 Location: Tampa, FL Thanks: 28 times Was thanked: 431 time(s) in 364 post(s)
|
The popupinfo object only holds one instance in the action engine, so the second call is replacing the first quickly, and the menu item objects are dereferenced, which would explain why nothing happens.
|
|
|
|
Rank: Member
Groups: Approved
Joined: 5/16/2021(UTC) Posts: 10
|
Yes, if(click.Down) { ...script } fixed both cases.
|
|
|
|
StrokesPlus.net Forum
»
Bugs or Issues
»
Known Issues
»
Can’t implement menu with X1 mouse button.
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close