selection

Use Javascript to get selected text in Mobile Safari

好久不见. 提交于 2019-12-03 16:29:39
问题 So I'm working on a bookmarklet where it would be ideal for me to grab the content selected by the user using the "loop". Both window.getSelection and document.getSelection are functions that I can call, however, they always return an empty string. I believe the problem is that when you tap on the bookmark icon in Mobile Safari, the selection is released. For example, if you select some text, tap the "+", bookmark or other tab, the selection is unselected even if you cancel. Any thoughts on

View-based NSOutlineview selection gradient

。_饼干妹妹 提交于 2019-12-03 16:07:21
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 reimplement (void)highlightSelectionInClipRect:(NSRect)clipRect , so that each highlighted row could be

javascript, get list of all values in select box

大城市里の小女人 提交于 2019-12-03 14:49:01
问题 I am stumped. I have a form with a dropdown list, and I would like to grab a list of all the values in the list. I pulled the below example from w3 schools (yes, I know it's unreliable, but other solutions on stack overflow seem to be very similar to this). It was not working for me, and I tried plugging it into jsfiddle, but no luck. HTML: <form>Select your favorite fruit: <select id="mySelect"> <option value="a">Apple</option> <option value="o">Orange</option> <option value="p">Pineapple<

Excel VBA: How to Extend a Range Given a Current Selection

你离开我真会死。 提交于 2019-12-03 13:53:30
I want to do something like: E18-(1,1) &":" &E18+(1,1) My intent is to keep the selection of range E18 (value = B) and extend the selection to D16:F20 . If I have a cell's range of E18 and I want to extend the range to D16:F20 , how can I do this? Range(Cells(WorksheetFunction.Max(1, Selection.Row - 1), _ WorksheetFunction.Max(1, Selection.Column - 1)), _ Cells(WorksheetFunction.Min(Selection.Worksheet.Rows.Count, _ Selection.Row + 1), _ WorksheetFunction.Min(Selection.Worksheet.Columns.Count, _ Selection.Column + 1))).Select upd: thanks Siddharth Rout for formating my msg Siddharth Rout You

Android listview no longer highlights selection onclick

a 夏天 提交于 2019-12-03 12:17:21
问题 I have a listview that was showing a yellowtint on items when I touched them. All I've done differently is change the background image in that listview xml , and now it no longer will show me the yellowtint Here is code the list view xml, it is just a textview with a background image: <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="10dp" android

Genetic Algorithm - what is steady state selection?

霸气de小男生 提交于 2019-12-03 12:02:38
问题 I'm doing a final year project on genetic algorithms - specifically of the Dawkins Weasel type. I've done roulette selection and tournament selection, still to do steady state selection, but I'm not sure exactly what it is and references I find online are all pretty vague. Does anyone know how it should be implemented? Any pointers would be great. Many thanks. 回答1: Typically, the run of a genetic algorithm is divided into generations - each generation your selection and reproduction process

What is the modal selection selection mode?

眉间皱痕 提交于 2019-12-03 11:56:08
问题 When setting the selection mode of my ListView to multiple, I came across this constant introduced in Android API level 11: CHOICE_MODE_MULTIPLE_MODAL. The JavaDoc didn't help me out much: public static final int CHOICE_MODE_MULTIPLE_MODAL The list allows multiple choices in a modal selection mode. What is a modal selection mode? Can't find it nowheres. 回答1: This is used to bring up an action mode (a.k.a., contextual action bar) when using action bars. You will see it in apps like Gmail: as

Initial ng-model value not set in select

天涯浪子 提交于 2019-12-03 11:56:03
问题 I have an enum (I code using TypeScript): export enum AddressType { NotSet = 0, Home = 1, Work = 2, Headquarters = 3, Custom = -1, } Then in my controller I have a field named type, into which I set the initial value that should be selected in the select input (I set it to AddressType.Headquarters). Finally, in my HTML I put the following: <select ng-model="Ctrl.type" ng-options="addressType for addressType in Ctrl.getAddressTypes()"></select> Everything seems to work fine except one thing:

DataGridView row: Semi-transparent selection or row border on selection

余生长醉 提交于 2019-12-03 11:35:32
I have a DataGridView where the background of each row is different depending on the data bound item. Though, when I select a row, I can no longer see its original background color. To solve this, I have thought of two solutions: I can make the selections semi-transparent, making it possible to see if two selected rows have different background colors. Or; I can remove the selection colors entirely, and draw a border around the selected rows. What option is easier and how can I do this? It's a WinForm app. Edit: I ended up using some of your code, adrift private void dgv_RowPrePaint(object

WPF DataGrid full row selection

本秂侑毒 提交于 2019-12-03 11:13:10
I'm using WPF and .NET 4.0. Recently in one of my programs I switched from using ListView with GridView to DataGrid. I want to be able to select and highlight the whole row like I was able to do in ListView. In ListView, when I click on the empty space right from the last column, I'm still able to select the row. The whole row is highlighted, not only the cells. In DataGrid however, after setting SelectionMode="Single" and SelectionUnit="FullRow", the row is selectable only when I click on any cell in it, not in the empty space right to the last column. How can I use the highlighting behavior