selection

How to run getElementsByTagName on children of an element only?

陌路散爱 提交于 2019-12-10 14:49:36
问题 I'm having trouble getting a selector to work properly. I have this HTML: <div.wrapper> <div.ui-controlgroup-controls> <form> <div.ui-btn></div> </form> <div.ui-btn></div> <div.ui-btn></div> <div.ui-btn></div> <div.ui-btn></div> </div> </div> and I'm trying to select the div tags, which are children of ui-controlgroup-controls - which means excluding whats inside the form. This is what I'm trying: // el is my div.wrapper element el.children[0].getElementsByTagName("div"); However this does

QTableView selectionChanged

扶醉桌前 提交于 2019-12-10 12:46:24
问题 I have a QTableView that I need to get the selectionChanged event from. I can't seem to get the connect working. I have: MyWidget.h ... protected slots: void slotLoadTransaction(const QItemSelection & selected, const QItemSelection & deselected); private: QTableView table; ... MyWidget.cpp ... connect( table->selectionModel(), SIGNAL(selectionChanged(const QItemSelection & selected, const QItemSelection & deselected)), this, SLOT(slotLoadTransaction(const QItemSelection & selected, const

Vim/MacVim: when I scroll with mouse, the text cursor moves too!

北战南征 提交于 2019-12-10 12:42:38
问题 I've been getting used to Vim/MacVim for the last few weeks. One of main problems I seem to be having is when I scroll around using the mouse (especially when I'm trying to select large portions of text) the text insertion cursor moves too and doesn't stay where it was (like in TextMate for example). This means I've selected a large piece of text, when I scroll back up to review my selection the cursor will move which messes with the selection that I've made. I do realise I should get used to

How to rotate selected QGraphicsItems around the selection center?

半世苍凉 提交于 2019-12-10 11:35:03
问题 I would like to implement rotation of selected items. I have noticed that there are 2 functions - rotate() which performs an immediate action but does not save the rotation on the item - and setRotation(), which stores rotation() (though it requires a repaint causing event). If I select a single item and rotate it, I can set selectedItem->setRotation(selectedItem->rotation() + deg); This allows the item to store its rotation, and when I need to copy it to another scene, the item retains its

How to use JavaScript selected functionality when particular language is selected in conjunction with ruby?

↘锁芯ラ 提交于 2019-12-10 11:29:30
问题 WHAT AM I TRYING TO ACHIEVE I have a html select box. The select box is responsible for selecting the preferred languages. for instance if a page is displayed in Germany then the select box should display Germany as its preference and likewise for the other languages. WHAT HAVE BEEN DONE SO FAR In application.html.erb I have below code #application.html.erb <select name="language" onChange="location = this.options[this.selectedIndex].value;"> <% @langs.each_pair do |short, long| %> <option

Detect what is selected (highlighted) or clicked within an element on a page?

為{幸葍}努か 提交于 2019-12-10 11:10:41
问题 How would one go about detecting what has been selected on a page in a browser? Example: Click, hold, select 3 words and 1 image on a page, release. Sub-question: How to detect what letter someone clicked on? Without using: A span injector breaking everything up OR a WYSIWYG plugin I'm hoping this isn't just a type of browser interaction you can't detect. There could be many uses, but my goal is a simple 'live' page editor, or at least a way to know what someone is clicking on/selecting aside

Silverlight 3 Datagrid: Get row/item on MouseOver

烂漫一生 提交于 2019-12-10 10:50:00
问题 I have a bound DataGrid and various other controls(external to the datagrid) that show more details about the selectedrow in the datagrid. This is easy to do with databinding or handling the SelectionChanged event on the datagrid. However, how do I do this without requiring the user to select a row - eg on 'mouseover' can I change the selected item or get the row/item 'under' the mouse. 回答1: Try something like this in your container class like UserControl, Grid, StackPanel, etc... public

Python get selected text

谁说胖子不能爱 提交于 2019-12-10 10:37:58
问题 How would I, using Python "catch" text that a user has selecting in, for example, a web browser? The script would idle in the background, and when a certain key combination is pressed, it "gets" the text the user has selected. Think copy & paste, only it copies to my application instead of a clipboard. Thanks! I'd like to point out that this will be for Mac. 回答1: Install xsel sudo apt-get install xclip xsel -y Save this as get-selected.py import os print(os.popen('xsel').read()) Select text

How do I make the caret of a JTextComponent skip selected text?

假如想象 提交于 2019-12-10 10:11:22
问题 the normal behaviour of native text fields in many environments is as follows: Textfield with text "abcdefg". I use the mouse to select "efg" from left to right. The caret is now behind "g". When I move the caret to the left by pressing the cursor left key once, the selection is removed and the caret is right before "e". When I do the same in a JTextField or JTextArea (tested on Mac OS) doing the exact same thing results in the caret being right before "g". I know how I could change that

primefaces datatable row select not work after filtering or sorting

。_饼干妹妹 提交于 2019-12-10 09:45:16
问题 I have a problem with primefaces datatable which implements filtering and sorting and select row(like complexe datatable in primefaces showcases), when i sort or filter in datatable, SelectedElement resolve to null if i select a row, but if i select row without filtering or sorting, select event work perfectly. Sorry for my bad english. My xhtml. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces