selection

Character offset in an Internet Explorer TextRange

As far as I can tell there's no simple way of retrieving a character offset from a TextRange object in Internet Explorer. The W3C Range object has a node, and the offset into the text within that node. IE seems to just have pixel offsets. There are methods to create, extend and compare ranges, so it would be possible to write an algorith...

Identifying the right engineer

I've spent quite a lot of time searching for the "right" engineer for a testing/development position. It's a very high-stress, high-visibility environment with changing priorities and tight deadlines. The associated responsibilities have been somewhat neglected for several years and upper management doesn't understand the process and p...

How do I highlight a selection made programmatically in a Winforms TextBox

I've not gone into much research here, but the intuitive thing is not working: private void SerachButton1_Click(object sender, EventArgs e) { String serchTerm = searchTerm1.Text; String text = usualTextBox.Text; Int32 index = text.IndexOf(serchTerm); if (index >= 0) { usualTextBox.Select(index, serchTerm.Length);...

ListView FocusedItem Becomes NULL

When the program runs, there is a series of ListView forms. We populated one of them with items (as strings) and we check whether the state of selection has changed. Once it's changed, we grab the text of the selected item using FocusedItem.Text. The first time works just fine but when another selection is made, the selected item returns...

Transforming selected text with a hotkey

I have this code: myVariable which I want to change into trace("myVariable: " + myVariable); using a direct hotkey like "alt-f12" to do it. I.e not using "ctrl-space" and arrow buttons. is it possible in eclipse? ...

Get selected text and selected nodes on a page?

When selecting a block of text (possibly spanning across many DOM nodes), is it possible to extract the selected text and nodes using Javascript? Imagine this HTML code: <h1>Hello World</h1><p>Hi <b>there!</b></p> If the user initiated a mouseDown event starting at "World..." and then a mouseUp even right after "there!", I'm hoping i...

Collapsed selection in Opera

Hello, I am not able to get the selection object's start and end offsets in Opera (v9.50) when the selection is collapsed (i.e. just point and click instead of highlighting text). This is my simple test code, which works in FF and Safari but does not work in Opera. <html> <head> <script type="text/javascript"> function showSelect...

WPF ListView Inactive Selection Color

I'm creating a WPF application where several ListView selections are made in a row (similar to the iTunes browser). The problem is that the default inactive selection color is too light. (see below) How can I change this color so my inactive listview looks like this? (see below) Solution Override the default SystemColor with a Style...

JavaScript - Textarea Selection

The Problem I am working on an in-browser editor within a textarea. I have started looking for some information on dealing with textarea selection and found this jQuery plugin that does some simple manipulation. However, it doesn't explain what's going on. The Question Where can I find a good resource on Textarea Selection in JavaSc...

unicode implementation: many fonts, or one large font?

Hi all, I'm internationalizing an application into many different languages, and the following languages must be supported: English Spanish German French Russian Mandarin Chinese Thai We're also probably going to add support for: Hindi Portuguese Any other language people at work speak and can translate easily Should I install d...

Computing the statistical mode

Hi all, I'm currently trying to verify whether or not, given an unsorted array A of length N and an integer k, whether there exists some element that occurs n/k times or more. My thinking for this problem was to compute the mode and then compare this to n/k. However, I don't know how to compute this mode quickly. My final result needs t...

How to implement: two views coordinating same selection in Eclipse RCP?

I have multiple views in an eclipse RCP application: 1) map view with push pin icons 2) list view of all push pins 3) a view displaying the push pin properties I also have a model object with a get/setActivePushPin acessor methods. How do I properly coordinate the push pin selection? When I select a push pin on either the map or list...

Table cell selection in IE7 and FF3

I'm trying to implement html table row selection in IE7 and FF3. When user clicks on the row with ctrl key, he can select separate rows. When he clicks with shift key he can select rows range (so in other words: I'm trying to implement items selection like in the select box or in file explorer). I have javascript for highlighting selec...

limit selections in a listbox in vb.net

Hi all, 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, w...

Paragraph selection offset in IE

I need to split a span into two spans wherever the user clicks. The following jQuery works fine in Firefox: $(function () { $('span.sentence').click(add_sentence); }); function add_sentence() { var selection = window.getSelection(); if (selection) { var anchor, t1, t2; anchor = selection.anchorNode; parent_...

WPF - How to combine DataTrigger and Trigger?

NOTE I have asked the related question: How to combine DataTrigger and EventTrigger? I have a list box containing several items. The item's class implements INotifyPropertyChanged and has a property IsAvailable. I use that property to indicate unavailable options in the list using a different colour. However, if a selected item i...

Determining the selected InlineUIContainer in a WPF RichTextBox

Hi, I'd like to determine if there is an InlineUIContainer (or BlockUIContainer) at the current Caret position in a WPF RichTextBox. Currently I have a RichTextBox as follows; <RichTextBox SelectionChanged="RichTextBox_SelectionChanged"> <FlowDocument> <Paragraph> <Run>Some text before</Run> ...

Selecting items in a listbox using C#

Hi, I am using two listbox controls in my wpf window that are identical (identical = itemsource of both the listbox is same and so they look same) and the selection mode on both the listboxes is set to Multiple. Lets call the listboxes LB1 and LB2 for the time being, now when I click an item in LB1, I want the same item in LB2 to get se...

(iPhone) selectedRange for a non-editable UITextView (or other methods of click handling?)

Hello all, I'm using an UITextView to hold static content (in Chinese, which means that the characters are all fixed width). I want to let users click on a character in the text and bring up dictionary information for that character. I know all of the issues surrounding the lack of copy and paste and all that, but I'm hoping that there ...

Reverse selecting text programmatically in a richtextbox (vb.net)

Hi, I have a form with a richtextbox and a scrollbar. I want to be able to keep appending text to the textbox without loosing my selection. I can save the selectionstart and selectionlength before I append the text and set it back and it works. The problem is when it comes to reverse selecting. The best I could do is set back the selecti...