popupmenu

java: Get row data from popupmenu actionListener event

北战南征 提交于 2019-12-13 06:20:00
问题 I'm having a little scenario here that maybe a duplicate. I have JTable where i show some data, i have a mouselistener that listens for right clicks on the table and displays a popup menu with one menuitem. My goal is that when the user clicks the menuitem, i get the values from the table and feed them into a custom dialog which has some fill in fields, so that the user doesn't have to feed the whole dialog by hand since i will feed the dialog with the values selected on the table. but my

ImageView On click not firing at the 2nd click

五迷三道 提交于 2019-12-13 04:40:20
问题 I want to close a popup menu on clicking a imageview.But it is not working. menuicon.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (f == 1) { f = 0; mPopupMenu.setContentWidth(ContactsActivity.this.getWindowManager() .getDefaultDisplay() .getWidth() / 2); mAdapter.notifyDataSetChanged(); mPopupMenu.setAnchorView(menuicon); mPopupMenu.show(); } else { mPopupMenu.dismiss(); f = 1; } } }); When I click the menuicon first time the popup menu is displaying

Delphi: StringGrid, position and Context Menu

ⅰ亾dé卋堺 提交于 2019-12-12 16:40:26
问题 I'm having a problem with using a TStringGrid and Popup menu I want to know the Row / Column of the cell that was last active when select an item from my Popup menu. However when I click on the popup menu, the StringGrid.Row is returned as -1. I've tried using MouseToCell as part of OnClick, but even after setting SG.Row it still returns as -1 in the PopUp menus routines... I suspect that the problem is the Grid losing the focus. Are there any solutions to this that don't require OnClick

remove popup menu item programmatically

可紊 提交于 2019-12-12 12:19:27
问题 I'm inflating a popup menu in my application. I've created a popmenu xml like below. Song_popup xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" style="@style/ToolBarStyle"> <item android:id="@+id/add_queue" android:title="Add to queue" /> <item android:id="@+id/play_next" android:title="Add to favourite" /> <item android:id="@+id/add_download" android:title="Download" /> </menu> Now i want to remove a item by checking a condition.

Enable/disable menu item in Eclipse plugin

江枫思渺然 提交于 2019-12-12 08:52:50
问题 I've made a pop-up menu with one menu item, I want to enable it only when I do a right click on a tree item of a certain class type otherwise disable it. How can I achieve this? 回答1: You can add a handler that uses activeWhen and associate it with that menu's command id. Here is a handler that makes a command active only when the current selection is not empty, and the selection is an item that can be adapted to an object of type Widget : <extension point="org.eclipse.ui.handlers"> <handler

How do you line up a TPopupMenu so that it accurately positions itself above a button?

笑着哭i 提交于 2019-12-12 07:35:27
问题 I want a popup menu above a button: Delphi wraps the Win32 menu system in a way that seems to preclude every mode or flag that the underlying Win32 API provides that was not in the VCL author's brain on that day. One such example appears to be the TPM_BOTTOMALIGN which can be passed into TrackPopupMenu but, the Delphi wrapper appears to render this not only impossible in the stock VCL, but by injudicious use of private and protected methods, is impossible (at least seems to me to be

how to add Wizards created in New->File->others into popup menus when right click in project explorer

半腔热情 提交于 2019-12-11 09:04:07
问题 I have created a category in File->New->Others say "Enterprise".With some Wizards in it lets say "Instance","Component", etc. Now what i want ,when i right click in Project Explorer and go in New those wizards should be seen their itself. Basically trying to make popup menu of those wizards. So i created popup menus as: <extension point="org.eclipse.ui.menus"> <menuContribution allPopups="true" locationURI="popup:common.new.menu?before=additions"> <command commandId="CommandComponent" label=

Show triangle inside the view that opens a popupmenu (like with a spinner)

ぐ巨炮叔叔 提交于 2019-12-11 02:13:11
问题 I have a ListView which handles onClick events by showing a PopUpMenu . However, I want the user to see the little triangle inside the views that can be clicked. I tried using a Spinner , because that element looks like what I'm after, but I can't set the title of the Spinner to anything other than its options. Of course I could custom make everything but as this is not a new pattern I thought maybe there's already something out there. I just can't find it myself. Example of what I'm after:

How to pass a custom layout to a PopupMenu?

佐手、 提交于 2019-12-10 13:28:41
问题 I want to customize the popupmenu in android, default popup menu gives more space ,so I'm trying to change the custom layout in popup menu but I cant figure out how. image Note: I want to do this small popup design so I go with default popup menu but i want to customize it. findViewById(R.id.menuclick).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { PopupMenu popupMenu = new PopupMenu(Sample1.this, view); popupMenu.setOnMenuItemClickListener(Sample1

unloading items from popup menu error

拈花ヽ惹草 提交于 2019-12-10 11:25:56
问题 i have am getting this error "Unable to unload within this context" when ever i try to unload a menu item from the popupmenu like his For i = mnuTCategory.Count - 1 To 1 Step -1 Unload mnuTCategory(i) Next Is there any way to do this without this error>? Thanks 回答1: In order to be able to remove controls from a Form , when triggered by a ComboBox , you will need to execute the deletion operation through a Timer . So, when the ComboBox event is to be triggered, start (enable) a Timer that when