selection

How do I select all text contained in <pre> using jQuery?

Hi, I have a contentEditable iframe with line numbers and text. The line numbers are contained in a div and all text is in a <pre>-element. It looks like this: <body> <div id="line_numbers"> <div>1</div><div>2</div><div>3</div> </div> <pre> Text </pre> </body> Now, when someone presses Ctrl+A everything is selecte...

How to make datagrid selection and hover effect (blue color) programmatically

Hi everybody, I have two datagrids which should do everything synchronic except the data entry. I already managed to make them scroll synchronic by using the scroll event. My question is now how to select a item of a datagrid only programmatically, and how to get the mouseover effect and underlining the corresponding row with a bright b...

JavaScript selection/range framework

I've been working with selection/range objects, and because to the incredible amount of inconsistencies between browsers for specific selection/range stuff (even more than the DOM) I was wondering if there was a framework that would help me get through them. ...

Replaced ItemsControl with ListBox and the item selection + ListBox height seems broken...

Hello, I have loaded this project into Visual Studio => http://sites.google.com/site/huyphamproject/Home/MyDashBoard.zip I have replaced all ItemsControl declaration in the main xaml file with ListBox so I have a SelectedItem property which I would need to use it with mvvm + datatemplate. When I select now one item in the ListBox-dash...

Blue selection of Datagrid row programmatically

Hi everybody, I have a question I came up with 3 days ago about how to do the blue underlining of a datagrid row programmatically. I thought to have found the solution, with just adding the column and row Indexes to the datagrids editedItemPosition Property. It turned out, that this is just practical if you want to be able to edit the ...

how to stop JPopupMenu show() from visually un-selecting the list item clicked on

Right now when a user right clicks on a selected JList item in my program the resulting JPopupMenu clears the selection (at least visually) until the popup menu is closed. This isn't consistent with the native look and feel of any platform I know of. The item should stay visually selected or have a selected-color border around it. But I ...

Android question, get selection of text from EditText

I'm trying to implement a copy/paste function. How can I get a selection of text from an EditText? EditText et=(EditText)findViewById(R.id.title); blabla onclicklistener on a button: int startSelection=et.getSelectionStart(); int endSelection=et.getSelectionEnd(); Then I'm stuck. Any ideas? ...

Selection ranges in webkit (Safari/Chrome)

Hi, I'm using a content-editable iframe to create a syntax-highlighter in javascript and one of the most important things is to be able to indent code properly. The following code works just as it should in Firefox: // Create one indent character var range = window.getSelection().getRangeAt(0); var newTextNode = document.createTextNod...

Can you turn off selection syncing in WPF's CollectionViewSource?

Hi everyone, I have several CollectionViewSource instances all used on the same ObservableCollection. I also have several controls that need to show filtered versions of the collection (hence the CollectionViewSources). The problem I'm having is that CollectionViewSource forces them to all have the same item selected. Is there some way ...

Disable text selection in QT/WebKit GUI

I'm checking if it would be possible to implement a GUI using HTML through PyQT and WebKit. One of the problem is that using the mouse you can select the text making up the interface. Can this behaviour be disabled? Also, the mouse pointer changes to an insertion caret while over the selectable text. I would like to disable this, withou...

How do I get the selected text from the focused window using native Win32 API?

My app. will be running on the system try monitoring for a hotkey; when the user selects some text in any window and presses a hotkey, how do I obtain the selected text, when I get the WM_HOTKEY message? To capture the text on to the clipboard, I tried sending Ctrl + C using keybd_event() and SendInput() to the active window (GetActiveW...

Determine whether selection has been phisically committed by user input (mouse or kb)

How to determine if selection is made programmatically or by user input. I started to write something but since there is more work I decided to seek for some out-the-box procedure or rely on the community experience. So here is what I wrote (Note that answers in C# are welcommed too): Private Shared Function IsUserSelect() As Boolean ...

How do I get an IResource from an IEditorActionDelegate

I wrote an IEditorActionDelegate to fire from a context menu on a CompilationUnitEditor. From there I want to create a marker at the start line of the selected text. I have an ITextSelection, and an IEditorPart object. How can I get an IResource from those so that I can call resource.createMarker()? Thanks ...

WPF Custom lasso selector ?

Hello, How can I implement a custom lasso selector on InkCanvas ? How to detect involved inks or elements by collecting points generated by mouse move ? Just point me to namespaces & classes that .Net 3.5 provide to help solve the problem ...

user dbl-clicks on a word inside a SPAN or P or DIV; the word is highlighted; how to get the selected word?

Can you get the word the user has double-clicked on? I've tried in a onDblClick eventhandler but selectionStart is undefined there; and the onselect event seems to be available only for TextArea. ...

TreeView selection problem in Silverlight 3

I have a TreeView control from System.Windows.Controls on MainPage. <controls:TreeView x:Name="Tree" SelectedItemChanged="Tree_SelectedItemChanged" /> MainPage ctor looks like this: public MainPage() { InitializeComponent(); for (int i = 0; i < 10; ++i) Tree.Items.Add(new TreeViewI...

C# ListView item selection problem after deleting an item.

Using Visual Studio 2008, .Net 3.5 I have a ListView loaded with a bunch of items. I have a right-click popup for removing an item. After removal of an item, I redraw the list view by re-accessing my primary data, and reset the selected item. However, the selected item does not show as selected. An idea of the code: public ListView m_...

Switching menu items between two lists using buttons in JavaScript

I have this school assignment that I've been working on and am totally stumped as to why it's doing what it's doing. Basically it's a left selection list, 2 middle buttons, and a right selection list. The purpose is to move options between lists. My problem is as follows: a selection is made on left list, the move to right list button is...

Programmatically multiselection update is slow in listbox.

I try to programmatically update the selected items in a listbox, with extended selection mode. Here is how I do it: foreach (var selectedItem in ItemsForSelection) { _myList.SelectedItems.Add(selectedItem); } My problem is, that when the number of the selected items is big, the update is very slow. The root of the problem is tha...

text selection AND bubbling

this is the problem: I'm using javascript and JQuery (not UI) to drag nested objects in my web page. to disable the text selecting I have to return FALSE from the mousedown handler, but this disable also the event bubbling. But I need event bubbling... What can I do?? thanks ...