selection

How to Select particular text in textbox while textbox receives focus

北城以北 提交于 2019-12-02 02:44:30
I am developing one ASP.NET application with VB code.I have one textbox to hold the amount, which contains default value as "0.00". Now the problem is while the textbox gets focus it selects all the text. But i want to select only 0 that is before precision and I do not want to select after precision. Hope someone will help me. Thanks in advance assume you have TextInput you want to select its first character, whenever its selected <input id="MyText" type="text" value="text" onclick="MyText_click()" /> and the script is like this: <script> function MyText_click() { var input = document

How to preserve text selection when opening a jQuery dialog

▼魔方 西西 提交于 2019-12-02 02:40:42
Using jQuery's dialog I came across the following quirk (tested in FF3): User selects text In code, open up a jQuery dialog BUG: the text gets unselected (text could be in a textarea or just an HTML on the page) So, to me it seems like a funny (and annoying) bug or a quirk, but maybe there's a good explanation for that. And what interests me most, is how to preserve this text selection after opening the dialog? Here's some code: function getSelectedText() { var t; if (d.getSelection) t = d.getSelection(); else if(d.selection) t = d.selection.createRange(); if (t.text != undefined) t = t.text;

OnItemSelectedListener() not being called for my spinner

倖福魔咒の 提交于 2019-12-02 02:15:42
问题 Hi i have a spinner that i have hidden using visibility = gone atribute. i call the spinner list using spinner.performclick() , this works fine except for that when selecting an item in the spinner list my onselect listener is never being called. please help:) the only catlog warning being thrown is "window already focused, ignoring focus gain" catagorySpinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parentView, View

no matching function call for selection sort function with templates(C++)

大憨熊 提交于 2019-12-02 02:14:01
问题 I'm playing around with templates and I was wondering why I'm getting a no matching function error using templates. /*selection sort*/ template <typename InputIterator, typename T> void selection_sort(InputIterator first, InputIterator last){ InputIterator min; for(; first != last - 1; ++first){ min = first; for(T i = (first + 1); i != last ; ++i) { if(*first < *min) min = i; } myswap(*first, *min); } } int main(){ int a[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; vector<int> v(a, a+10); selection

OnItemSelectedListener() not being called for my spinner

一笑奈何 提交于 2019-12-02 02:04:35
Hi i have a spinner that i have hidden using visibility = gone atribute. i call the spinner list using spinner.performclick() , this works fine except for that when selecting an item in the spinner list my onselect listener is never being called. please help:) the only catlog warning being thrown is "window already focused, ignoring focus gain" catagorySpinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) { CashDB cdb = new CashDB(getBaseContext()); cdb.open(); Cursor c =

Polygon Selection OpenLayers 3

ε祈祈猫儿з 提交于 2019-12-02 00:44:03
问题 How can you select features with a polygon draw? It can be done with a square box select as per the examples. I'm wondering if there's a way to trigger an event after creating the polygon to go and check for intersections with it and other features. In my case I'm trying to capture datapoints. var select = new ol.interaction.Select(); map.addInteraction(select); var selectedFeatures = select.getFeatures(); // a DragBox interaction used to select features by drawing boxes var dragBox = new ol

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

谁都会走 提交于 2019-12-02 00:39:07
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 will be a way to do this without waiting for the iPhone 3.0 firmware. At first, I thought about using UITextView s selectedIndex property. Unfortunately, when the UITextView is not editable, the following code in the UITextView 's always returns the length of the entire

How to swap clipboard contents for current selection in Visual Studio

醉酒当歌 提交于 2019-12-01 23:46:11
问题 Does anyone know of a simple way to swap whatever is currently in my clipboard with the current mouse selection? So lets say my clipboard has the text Foo in it. On a line of code public void DoBar() { ... I have Bar selected I'd like a simple key combination that changes DoBar() to DoFoo() and leaves me with the text Bar" in the clipboard (so that if I was to press CTRL-V it would paste Bar ). Note: I don't want to have to fiddle with anything graphical (i.e. clipboard switcher, paste ring).

no matching function call for selection sort function with templates(C++)

ぐ巨炮叔叔 提交于 2019-12-01 23:10:57
I'm playing around with templates and I was wondering why I'm getting a no matching function error using templates. /*selection sort*/ template <typename InputIterator, typename T> void selection_sort(InputIterator first, InputIterator last){ InputIterator min; for(; first != last - 1; ++first){ min = first; for(T i = (first + 1); i != last ; ++i) { if(*first < *min) min = i; } myswap(*first, *min); } } int main(){ int a[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; vector<int> v(a, a+10); selection_sort(v.begin(),v.end()); } TemplateRex You have an undeduced template parameter T, so you need 1) move

Caret disappears in Firefox when saving its position with Rangy

我与影子孤独终老i 提交于 2019-12-01 20:11:13
问题 This happens only in Firefox. Important: I am saving the caret's position with rangy.saveSelection(): when click the content editable div on keyup when adding an external html element (as a node) to the content editable div I need the position saved constantly through multiple means to be able to insert html elements on click (I have some tags). When I click in the contentEditable div and the div is empty (first focus, let's say), I cannot see the caret unless I start typing. If the caret is