selection

Datagrid selects the wrong custom cell in my datagrid

爱⌒轻易说出口 提交于 2019-12-24 21:40:10
问题 I am working on a problem since a week soon, but I still couldn't make it work as expected. I have a DataGrid which has HBox with a CheckBox an a Label as itemRenderer (see Code below). When I tap in to the Cell the standard itemEditor pops up and lets you enter the content of the label. Thats the standard behavior. I works fine except for 2 problems: If I enter to much text, the horizontal srollbar pops up, and the cell is filled with that scrollbar. As you see I tried to set the

C++ Selection Sort of an Array of String Objects

眉间皱痕 提交于 2019-12-24 20:25:22
问题 I'm trying to implement a selection sort function for an array of user inputted string objects. Am I on the right path as far as arguments go. Thanks void selectionSort(char ARRAY[], int size) { int startScan, minIndex, minValue; for (startScan = 0; startScan < (size - 1); startScan++) { minIndex = startScan; minValue = ARRAY[startScan]; for (int index = startScan + 1; index < size; index++) { if (ARRAY[index] < minValue) { minValue = ARRAY[index]; minIndex = index; } } ARRAY[minIndex] =

How to select text in an input after a change in Angular at the right time?

孤人 提交于 2019-12-24 17:29:12
问题 I have an input box. When the text changes, I need to select the text. I understand that there are many events going on and I need to wait for them to finish. I put in a timeout and it works. However I don't want to rely on a constant time. Is there any way how to select the text when Angular is finished changing the text? Example HTML: <input type="text" value="{{txt}}"> <button ng-click="select()">Press</button> Example JS: angular.module('MyApp', []).controller('MyCtrl', function ($scope,

iframeElm.contentWindow.document.selection not working for <iframe> in IE if set focus on other input after making selection in the iframe

那年仲夏 提交于 2019-12-24 15:49:31
问题 This is similar but different question about how to set html in the selection of the iframe's editable content. One sample found is: http://jsfiddle.net/HMRMv/1/, but it can also be used to show the problem. On IE, in the sample if you select the text in iframe and then do the click, it will work. But after select the text in the iframe's editable content and than clicking on other pane, you will see the highlight disappear and the 'click' on the button will do nothing. Look like the: var

UWP gridview item selection style [duplicate]

删除回忆录丶 提交于 2019-12-24 13:35:13
问题 This question already has answers here : uwp win10 Listview SelectedItem Style (3 answers) Closed 3 years ago . I want to change the selection style or color of the gridview item. when an item is selected, I want to show a thicker border or a highlight color or any type of change like that. what is the simplest way to achieve this 回答1: Please check this example: I have my page like this: <Page x:Class="App3.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x=

Randomly select x number of elements from a list

独自空忆成欢 提交于 2019-12-24 12:49:03
问题 I am trying to write a code that will randomly select between 1 and 4 elements of a list 50 times. The list I am working with is ['nu', 'ne', 'na', 'ku', 'ke', 'ka'] . So essentially, I want it to output something like nukuna ke keka nuka nane nanenu nu nukekanu kunu ... 50 times 回答1: In Python: import random input = [...] # Your input strings output = '' random.seed() # Seed the random generator for i in range(0,len(input)): N = 1+random.randrange(4) # Choose a random number between 1 and 4

Copy only selected rows without not-selected rows between in RowHeaderSelect mode

狂风中的少年 提交于 2019-12-24 11:58:09
问题 I'm looking for a possibility in C# in Windows Forms Application to be able to: Select multiple, full rows at a time. Include unselected rows between the selected ones. Then copy them to the clipboard without empty spaces (which are left for the unselected rows). The DataGridViewSelectionMode.FullRowSelect doesn't cut it as I also need to be able to select independent cells. I need to enable the same behaviour in row copying as the DataGridViewSelectionMode.FullRowSelect has but for the

Delphi: draw selections and mouse-hover effects on ListViewDrawItem

醉酒当歌 提交于 2019-12-24 11:14:52
问题 I have a code from here: Delphi: Canvas.FillRect in List View to paint rows (I use OwnerDraw). Therefore I need to draw selections and mouse-hover effects. And to draw a normal column resizing effect... I have a code to move items up and down: procedure TForm1.ListViewDragDrop(Sender, Source: TObject; X, Y: Integer); var DragItem, DropItem, CurrentItem, NextItem: TListItem; begin if Sender = Source then with TListView(Sender) do begin DropItem := GetItemAt(X, Y); CurrentItem := Selected;

GTK+3 render rectangle with selection background color

依然范特西╮ 提交于 2019-12-24 06:51:51
问题 How is it possible to render a rectangle with the background color of selections in GTK+3. I cannot find any API to do that: static gboolean draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data) { auto state=reinterpret_cast<State*>(data); auto width = gtk_widget_get_allocated_width (widget); auto height = gtk_widget_get_allocated_height (widget); auto context = gtk_widget_get_style_context (widget); gtk_render_background(context,cr,0,0,width,height); cairo_rectangle(cr,0,height*(1.0

JTable not returning selected row correctly

☆樱花仙子☆ 提交于 2019-12-24 05:44:08
问题 I am working with an extension of the DefaultTableModel as follows: This is the NEW AchievementTableModel after updating it to reflect input from some answers. public AchievementTableModel(Object[][] c, Object[] co) { super(c,co); } public boolean isCellEditable(int r, int c) {return false;} public void replace(Object[][] c, Object[] co) { setDataVector(convertToVector(c), convertToVector(co)); fireTableDataChanged(); } My GUI is a JTable that has the following properties: if(table==null)