SonG0han
01-26-2008, 05:14 AM
The List with key codes include mousebuttons like 2 for Right Mouse Button but it does not seem to work if you want to show a popupwindow on rightclick on a tree object or input object.
In the manual e_Type is used for the page On Mouse Button Event, but it should only appear if you rightclick specific objects.
Is there a way to do this?
Example:
if e_Key == 2 then
tblMenu = {};
tblMenu[1] ={};
tblMenu[1].Text = "&New Menu";
tblMenu[1].ID = 100;
tblMenu[1].Checked = false;
tblMenu[1].Enabled = true;
tblMenu[1].SubMenu = {};
tblMenu[1].SubMenu[1] = {};
tblMenu[1].SubMenu[1].Text = "&SubItem 1";
tblMenu[1].SubMenu[1].ID = 101;
tblMenu[1].SubMenu[1].Checked = false;
tblMenu[1].SubMenu[1].Enabled = true;
tblMenu[1].SubMenu[2] = {};
tblMenu[1].SubMenu[2].Text = "S&ubItem 2";
tblMenu[1].SubMenu[2].ID = 102;
tblMenu[1].SubMenu[2].Checked = false;
tblMenu[1].SubMenu[2].Enabled = true;
nRes = Application.ShowPopupMenu(e_X, e_Y, tblMenu, TPM_LEFTALIGN, TPM_TOPALIGN, true, true);
if(nRes == 0)then
Dialog.Message("Menu Result","Cancelled");
else
Dialog.Message("Menu Result","Menu ID selected = "..nRes);
end
end
In the manual e_Type is used for the page On Mouse Button Event, but it should only appear if you rightclick specific objects.
Is there a way to do this?
Example:
if e_Key == 2 then
tblMenu = {};
tblMenu[1] ={};
tblMenu[1].Text = "&New Menu";
tblMenu[1].ID = 100;
tblMenu[1].Checked = false;
tblMenu[1].Enabled = true;
tblMenu[1].SubMenu = {};
tblMenu[1].SubMenu[1] = {};
tblMenu[1].SubMenu[1].Text = "&SubItem 1";
tblMenu[1].SubMenu[1].ID = 101;
tblMenu[1].SubMenu[1].Checked = false;
tblMenu[1].SubMenu[1].Enabled = true;
tblMenu[1].SubMenu[2] = {};
tblMenu[1].SubMenu[2].Text = "S&ubItem 2";
tblMenu[1].SubMenu[2].ID = 102;
tblMenu[1].SubMenu[2].Checked = false;
tblMenu[1].SubMenu[2].Enabled = true;
nRes = Application.ShowPopupMenu(e_X, e_Y, tblMenu, TPM_LEFTALIGN, TPM_TOPALIGN, true, true);
if(nRes == 0)then
Dialog.Message("Menu Result","Cancelled");
else
Dialog.Message("Menu Result","Menu ID selected = "..nRes);
end
end