selection

Detecting single vs multiple selections in Delphi TStringGrid

人盡茶涼 提交于 2019-12-05 10:03:38
This is a follow up to my previous question Delphi TStringGrid multi select, determining selected rows regarding Delphi String Grids. It's a different question. I was looking more closely at the ONSelectCell Event TSelectCellEvent = procedure (Sender: TObject; ACol, ARow: Longint; var CanSelect: Boolean) of object; I noticed that the TStringGrid.Selection.Top,Bottom properties are not necessarily accurate (within the event itself). Basically, if someone goes from selecting multiple rows to just one row, the selection.* properties do not get updated, whereas if one selects multiple rows, they

Change background selection color of ListView?

佐手、 提交于 2019-12-05 07:54:17
How can I change the selection color on a ListView? By default, when the user selects an item it shows a blue background. I want to change this to dark gray, or something... Thanks for the help! Grammarian ObjectListView -- a wrapper around a WinForm ListView -- has properties to let you control the background and foreground color of the selected rows. It uses the technique that Obalix suggested, but it has already done the hard work for you. So, with a little effort, you can produce something like this: The "Feel Good Inc" row show a custom foreground and background for selection. If you

UIWebView Text Highlighting solution

自古美人都是妖i 提交于 2019-12-05 06:48:34
问题 Has anyone found a solution for highlighting user-selected blocks of text in a UIWebView? I have a partial solution in place, however I have been unable to get it to work when the selection includes multiple elements in the DOM. In that case, I can find and highlight the first element in the selection, but javascript seems unable to tell me where the end of the selection is in this case. It may be that I just don't understand the selection objects completely. It's difficult to find good

how to select a word in android webview?

匆匆过客 提交于 2019-12-05 03:06:18
问题 I want to implement this function: when user longpress a word in webview, I can get the word to do something, I search and found that: 1. android 2.3+'s webview sdk do provide this function which when long press, it highlights the word and brings up the start and end selection cursor. but under 2.3 it only provides the emulateshift function to select words and paste to clipboard, which is very ugly. does anybody can ever get the cursor while click on the text field of the webview? I can't

Get the selected text of a web page in google chrome extension

妖精的绣舞 提交于 2019-12-05 02:34:41
问题 I am developing a Google Chrome extension. When a popup is clicked, I would like the input box present in the popup.html file to contain the selected text of the current webpage. Example textbox: <input id="searchBox" type="text" /> When text is selected in a webpage, the textbox should contain the selected word. I tried with chrome.extension.getBackgroundPage().getSelection() but it is not working. 回答1: There was a thread about this on google groups: how to get HTML code from selection? var

How to search pandas data frame by index value and value in any column

风流意气都作罢 提交于 2019-12-05 01:26:35
问题 I am trying to select data, read in from a file, represented by the values one and zero. I want to be able to select rows from a list of values and at the same time select for any column in which each of the selected rows has a value of one. To make it more complex I also want to select rows from a list of values where all values in a column for these rows is zero. Is this possible? Ultimately if another method besides pandas data frame would work better I would be willing to try that. To be

Keep text selected when focus input

感情迁移 提交于 2019-12-05 00:54:30
This question has already been asked but until now there is no working answer so I am tempting to open it again hopefully we can find a hack to it. I have a contentEditable paragraph and a text input, when I select some text and click the input, the selection is gone. So I've tried to save the selection on input mousedown and to restore it back on mouseup and yeah it works ( as expected in firefox) But... in chrome the input lose focus :( See it in action ( use chrome ) : https://jsfiddle.net/mody5/noygdhdu/ this is the code I've used : HTML <p contenteditable="true"> Select something up here

Set spinner width to current item width

点点圈 提交于 2019-12-05 00:34:46
问题 By default the spinner width is set to fit the largest item in the dropdown but I want it to be the same width as the selected item. <android.widget.Spinner android:id="@+id/tab_spinner" android:layout_width="wrap_content" android:layout_height="match_parent" android:entries="@array/countries" /> As you can see in the right side image, the spinner is way too long, because of the long item in the list. How can I resize it to the selected item width ? 回答1: By default, Spinner will try to

View-based NSOutlineview selection gradient

烈酒焚心 提交于 2019-12-05 00:30:17
问题 I'm still struggling with the view-based NSOutlineView in my little Cocoa application. I'm trying model my OutlineView after the finder one. When the Finder OutlineView loses focus (e.g. clicking any folder on the right side), the selected row (e.g. Desktop) stays selected with the bright blue gradient and does not change to the inactive blue-grey gradient. I'd like to duplicate this behaviour in my application. In a not view-based OutlineView I was able to subclass NSOutlineView and

ListBox with single select and also unselect on click…?

我是研究僧i 提交于 2019-12-04 22:53:52
I need a listbox that selects on first click and un-selects on second click, so that only zero or one item is selected at any time. The select/unselect is implemented in the listbox (with SelectionMode="Single") when you hold down crtl, but unfortunately, none of my users can be expected to know that. With SelectionMode="Multiple" we have the exact functionality I want, except that you can select more than one item... More background: I want the user to first choose which installation to log into, then to give credentials (and some other choices) To achieve this I have used a listbox with