selection

Firefox select text range

巧了我就是萌 提交于 2019-12-12 18:15:55
问题 A quick question: how do I programatically select the text fragment of the page in FireFox? For example, there's a paragraph of text, user clicks the button and symbols from 10-th to 15-th are selected as if user dragged a mouse in a regular way. 回答1: In Firefox, you can use the Range object, as specified by W3C. <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Range test</title> <style> #trigger { background: lightgreen } </style> </head> <body> <p id="test">This is some (rather

textRange selection MSIE

风格不统一 提交于 2019-12-12 16:20:18
问题 I can easily set the selection on 2+ elements programatically in Firefox, But have had no success with IE so I hope anyone here can help me with this. 回答1: IE doesn't support multiple concurrent selected TextRanges, whether programmatically or manually selected. You can have a ControlRange of multiple selected elements, but not stretches of text. It's possible for other browsers that embed the Web Browser control to support multiple text ranges: Host applications can provide a multiple

Cannot select text in Kendo Sortable with handle

只谈情不闲聊 提交于 2019-12-12 14:33:14
问题 I have a set of sortable widgets, very similar to this demo. JS inits here: var column1Sortable = $(column1Selector).kendoSortable({ filter: ".panel", cursor: "move", handler: ".panel-header", connectWith: column2Selector, change: sortableOnChange, placeholder: sortablePlaceholder, hint: sortableHint }).data("kendoSortable"); var column2Sortable = $(column2Selector).kendoSortable({ filter: ".panel", cursor: "move", handler: ".panel-header", connectWith: column1Selector, change:

C# How to select ListBox item with a RightClick?

∥☆過路亽.° 提交于 2019-12-12 14:22:30
问题 I have tried a lot of methods for this and done hours of research, but it just never seems to work for me. This is my current code, and I don't know why it shouldn't work. private void listBox1_MouseDown(object sender, MouseEventArgs e) { listBox1.SelectedIndex = listBox1.IndexFromPoint(e.X, e.Y); if (e.Button == MouseButtons.Right) { contextMenuStrip1.Show(); } } Also I don't care about the context menu that can be removed I am just looking for a way to make the right mouse button select the

limit selections in a listbox in vb.net

做~自己de王妃 提交于 2019-12-12 12:42:47
问题 I am creating a web control in vb.net that contains a list box. I know that I am able to choose a selection mode of Single or Multiple, but I am interested in limiting a Multiple selection to a predetermined size. For example preventing a user from selecting more than 3 items. I have tried adding a Validator to the list box, which might be a way forward, but was wondering if there was a way of changing the selection mode to something a bit different than just the two specified ones. Any ideas

Intercept jTable selection change events

烈酒焚心 提交于 2019-12-12 12:22:25
问题 I found this forum thread which suggests overriding ListSelectionModel to prevent rows from being selected. I would like to prevent selection changes when there are unsaved changes (external to the table) for the currently selected item UNTIL the user confirms the discard. Something like: public class confirmSelectionChange extends DefaultListSelectionModel { public void setSelectionInterval(int index0, int index1) { if (unsavedChanges()) { super.setSelectionInterval(int index0, int index1);

How to choose non-interruped numbers only?

允我心安 提交于 2019-12-12 11:23:31
问题 I have two vectors: x<-c(0,1,0,2,3,0,1,1,0,2) y<-c("00:01:00","00:02:00","00:03:00","00:04:00","00:05:00", "00:06:00","00:07:00","00:08:00","00:09:00","00:10:00") I need to choose only those in y , where values of x is not interrupted by 0. As a result, I'd like to get a dataframe like this y x 00:04:00 2 00:05:00 3 00:07:00 1 00:08:00 1 We built a script like this, but with a big dataset it takes time. Is there a more elegant solution? And I wonder, why df<-rbind(bbb,df) returns inverted df?

How to get the text of a selection over multiple HTML elements?

不想你离开。 提交于 2019-12-12 11:21:48
问题 Here is my question: When the user makes a selection in an article or in the editing area of a WYSWYG editor widget, the selection can span over multiple elements, like anchors, images, span tags... even block-level elements (but no table in my problem). I know how to retrieve a Range object from the selection, but could not find a reliable solution to get the content text of the Range object. I'm not looking for a solution for IE (its TextRange object has a .text property). Thanks! 回答1: Have

find out which gtk widget has the current selection

会有一股神秘感。 提交于 2019-12-12 11:16:22
问题 I have a collection of GtkEntry widgets, some of which are editable and focusable, and some of which are not. I would like to find out which, if any, of them currently has text selected, in order to implement an Edit->Copy menu item. Is there any way to do this other than iterating over all the widgets until gtk_editable_get_selection_bounds returns true? I am currently sidestepping the issue by calling gtk_clipboard_get(GDK_SELECTION_PRIMARY) but from what the docs say, that's not portable

How to change CSS of selected text using Google Chrome Extension

霸气de小男生 提交于 2019-12-12 11:08:07
问题 I am making an extension for Chrome browser that uses contextMenus to change CSS of the selected text. But I am not able to access the HTML structure i.e. parentNode of the selected text as I can do very easily in this example. var selection = window.getSelection(); If used by default in browser, this returns parentNode of the selected text that I can use to change the CSS later. How to implement this using a Chrome Browser Extension? 回答1: Since that Chrome doesn't let you interact with the