cursor

Moving the mouse pointer in C++ fails on Linux

流过昼夜 提交于 2019-12-24 01:12:39
问题 I'm using the following code to hide and show the mouse cursor: XDefineCursor( m_display, m_window, show ? None : m_hiddenCursor ); XFlush( m_display ); That works fine. However, when I run this: XWarpPointer( m_display, None, m_window, 0, 0, 0, 0, x, y ); XFlush( m_display ); The mouse doesn't move at all. Simply nothing happens. SetMousePos, which I'm using for Windows, works fine. 回答1: It's been a while, but doesn't XWarpPointer make a relative move of the cursor using the passed offsets?

Enhanced crosshair cursor possible?

风格不统一 提交于 2019-12-24 00:57:36
问题 I have found this question (as a few others), but this is the one I have implemented so far: Crosshair cursor with additional lines in C# As it states, I can use a stock cursor "cross" directly in the IDE. This is a really good way to do things. The answer specified in the answer above draws a cross on the screen at the given width / height. Eg: private Cursor crossCursor(Pen pen, Brush brush, int x, int y) { var pic = new Bitmap(x, y); Graphics gr = Graphics.FromImage(pic); var pathX = new

Android EditText change focus after validation and showing the error in a Dialog

谁说胖子不能爱 提交于 2019-12-24 00:39:05
问题 I have a simple Activity with 3 EditText fields. User, Pass, Confirmation After typing something in the User field and the person clicks next on the keyboard, I have a setOnFocusChangeListener on there that will validate the input. If the validation fails a Dialog opens with a message and an OK button. After the Dialog is closed I tried a requestFocus on my User EditText in many variations, by releasing it on Pass, by trying to release on User again, by requesting than clearing and requesting

Access cursor by column name dynamically

僤鯓⒐⒋嵵緔 提交于 2019-12-23 21:20:21
问题 Can I access a cursor's column dynamically? I mean by name? something like this: declare v_cursor := select * from emp; begin FOR reg IN v_cursor LOOP dbms_output.put_line(**reg['column_name_as_string']**); end loop; end; I know the bold part is not PL/SQL, but I'm looking for something like that and can't find it anywhere. Thanks! 回答1: You can use the package DBMS_SQL to create and access cursors with dynamic queries. However it's not really straightforward to access a column by name because

'builtin_function_or_method' object has no attribute 'execute' for cursor.ececute(statement) [closed]

半城伤御伤魂 提交于 2019-12-23 20:23:37
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . c = sqlite3.connect(history_db) cursor = c.cursor select_statement = "SELECT urls.urls,urls.Visit_count FROM urls,Visits WHERE urls.id=visits.urls;" cursor.execute(select_statement) results = c.cursor.fetchcall() print(results) The code above when executed gives an error something like Traceback (most recent

Change cursor position in textbox in C# Windows

江枫思渺然 提交于 2019-12-23 19:53:37
问题 I have a winform which load MDI child winform. All textboxs in child winform always have cursor stay at left side and I can't move it to another position, except I choose all text and re-input. How can I enable this to make cursor can stay at any position by using mouse? 回答1: In the following example the cursor will be positioned after the second character in each textbox of the form. The focus will be on the last one, but by pressing the TAB key repeatedly, you can verify that the cursor

Start position for a reused t- sql cursor?

落花浮王杯 提交于 2019-12-23 15:44:45
问题 I'm working on a stored procedure that uses a cursor on a temporary table (I have read a bit about why cursors are undesirable, but in this situation I believe I still need to use one). In my procedure I need to step through the rows of the table twice. Having declared the cursor, already stepped through the temporary table once and closed the cursor, would the position of the cursor remain at the end of the table when re-opened or does it reposition itself to the initial starting position

HTML5 How to tell when IndexedDB cursor is at end

懵懂的女人 提交于 2019-12-23 13:13:06
问题 I am iterating thru an indexedDB data store, adding data to a JavaScript array. How can I tell when the cursor is at the end, so I can sort the array and act on it? onsuccess is called when a row has been retrieved from the cursor - is there another callback when the entire cursor has been navigated? 回答1: The result ( event.target.result ) of a successful cursor request is either a cursor object or null. If event.target.result is set, it's the cursor, and you can access event.target.result

How to override CursorAdapter bindView

旧巷老猫 提交于 2019-12-23 11:44:02
问题 I'm trying to display information from a Cursor in a ListView , each row contains a ImageView and a TextView . I have a CustomCursorAdapter extending CursorAdapter , in bindView I evaluate the data from the cursor and based on that set the views image and text. When I run the app the ListView displayes the correct amount of rows, but they are empty. I know I have missed something when overriding bindView, but I'm not sure what. Any help would be greatly appreciated. private class

How to override CursorAdapter bindView

人走茶凉 提交于 2019-12-23 11:43:02
问题 I'm trying to display information from a Cursor in a ListView , each row contains a ImageView and a TextView . I have a CustomCursorAdapter extending CursorAdapter , in bindView I evaluate the data from the cursor and based on that set the views image and text. When I run the app the ListView displayes the correct amount of rows, but they are empty. I know I have missed something when overriding bindView, but I'm not sure what. Any help would be greatly appreciated. private class