Search Results

Search found 5422 results on 217 pages for 'drag lock'.

Page 5/217 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • jquery ui drag and drop + ajax problem

    - by mobster
    I'm making board game and i'm using jquery ui draggable effect for figures. On drag start I send ajax request to other page where I generate droppable places soo the figure can be drag and droped only on those particular places, but the problem is I must move figure twice to take effect. Does anyone know how to solve this problem? I would be very grateful for help.

    Read the article

  • Qt drag & drop button; drop not detecting

    - by Thomas Verbeke
    I'm creating a 2D game in QT and i'm trying to implement a drag & drop into my program. For some reason the drop is not registered: qDebug should print a message on dropping but this doesn't happen. #include "dialog.h" #include "ui_dialog.h" #include "world.h" #include <vector> Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); scene = new QGraphicsScene(this); ui->graphicsView->setScene(scene); MySquare *item; QGraphicsRectItem *enemyItem; World *myWorld = new World(); std::vector<Tile*> tiles = myWorld->createWorld(":/texture.jpg"); int count = 0; foreach (Tile *tile, tiles){ count++; item = new MySquare(tile->getXPos()*4,tile->getYPos()*4,4,4); item->setBrush(QColor(tile->getValue()*255,tile->getValue()*255,tile->getValue()*255)); item->setAcceptDrops(true); scene->addItem(item); } player = new MySquare(10,20,10,10); player->setAcceptDrops(true); scene->addItem(player); //drag & drop part QPushButton *pushButton = new QPushButton("Click Me",this); connect(pushButton,SIGNAL(pressed()),this,SLOT(makeDrag())); setAcceptDrops(true); } void Dialog::makeDrag() { QDrag *dr = new QDrag(this); // The data to be transferred by the drag and drop operation is contained in a QMimeData object QMimeData *data = new QMimeData; data->setText("This is a test"); // Assign ownership of the QMimeData object to the QDrag object. dr->setMimeData(data); // Start the drag and drop operation dr->start(); } mysquare.cpp #include "mysquare.h" MySquare::MySquare(int _x,int _y, int _w, int _h) { isPlayer=false; Pressed=false; setFlag(ItemIsMovable); setFlag(ItemIsFocusable); setAcceptDrops(true); color=Qt::red; color_pressed = Qt::green; x = _x; y = _y; w = _w; h = _h; } QRectF MySquare::boundingRect() const { return QRectF(x,y,w,h); } void MySquare::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { QRectF rec = boundingRect(); QBrush brush(color); if (Pressed){ brush.setColor(color); } else { brush.setColor(color_pressed); } painter->fillRect(rec,brush); painter->drawRect(rec); } void MySquare::mousePressEvent(QGraphicsSceneMouseEvent *event) { Pressed=true; update(); QGraphicsItem::mousePressEvent(event); qDebug() << "mouse Pressed"; } void MySquare::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { Pressed=false; update(); QGraphicsItem::mousePressEvent(event); qDebug() << "mouse Released"; } void MySquare::keyPressEvent(QKeyEvent *event){ int x = pos().x(); int y = pos().y(); //key handling QGraphicsItem::keyPressEvent(event); } void MySquare::dropEvent(QDropEvent *event) { qDebug("dropEvent - square"); // Unpack dropped data and handle it the way you want qDebug("Contents: %s", event->mimeData()->text().toLatin1().data()); } void MySquare::dragMoveEvent(QDragMoveEvent *event){ qDebug("dragMoveEvent - square "); event->accept(); } void MySquare::dragEnterEvent(QDragEnterEvent *event){ event->setAccepted(true); qDebug("dragEnterEvent - square"); event->acceptProposedAction(); } void MySquare::setBrush(QColor _color){ color = _color; color_pressed = _color; update(); //repaint } edit; there is no problem with qDebug() i'm just using it to test them i'm inside the drag events..which i'm not

    Read the article

  • Get the coordinates of a drop event in Javascript?

    - by Sebastián Grignoli
    I made a javascript library that lets me drag a marker from a dragzone to one or more dropzones. The problem is... the mouseup event happens over the marker I'm dragging, no te dropzone. How can I detect in wich dropzone was the marker dropped, and in wich coordinates? Here's my script: http://dl.dropbox.com/u/186012/demos/dragger/drag.html

    Read the article

  • A deadlock was detected while trying to lock variables in SSIS

    Error: 0xC001405C at SQL Log Status: A deadlock was detected while trying to lock variables "User::RowCount" for read/write access. A lock cannot be acquired after 16 attempts. The locks timed out. Have you ever considered variable locking when building your SSIS packages? I expect many people haven’t just because most of the time you never see an error like the one above. I’ll try and explain a few key concepts about variable locking and hopefully you never will see that error. First of all, what is all this variable locking all about? Put simply SSIS variables have to be locked before they can be accessed, and then of course unlocked once you have finished with them. This is baked into SSIS, presumably to reduce the risk of race conditions, but with that comes some additional overhead in that you need to be careful to avoid lock conflicts in some scenarios. The most obvious place you will come across any hint of locking (no pun intended) is the Script Task or Script Component with their ReadOnlyVariables and ReadWriteVariables properties. These two properties allow you to enter lists of variables to be used within the task, or to put it another way, these lists of variables to be locked, so that they are available within the task. During the task pre-execute phase the variables and locked, you then use them during the execute phase when you code is run, and then unlocked for you during the post-execute phase. So by entering the variable names in one of the two list, the locking is taken care of for you, and you just read and write to the Dts.Variables collection that is exposed in the task for the purpose. As you can see in the image above, the variable PackageInt is specified, which means when I write the code inside that task I don’t have to worry about locking at all, as shown below. public void Main() { // Set the variable value to something new Dts.Variables["PackageInt"].Value = 199; // Raise an event so we can play in the event handler bool fireAgain = true; Dts.Events.FireInformation(0, "Script Task Code", "This is the script task raising an event.", null, 0, ref fireAgain); Dts.TaskResult = (int)ScriptResults.Success; } As you can see as well as accessing the variable, hassle free, I also raise an event. Now consider a scenario where I have an event hander as well as shown below. Now what if my event handler uses tries to use the same variable as well? Well obviously for the point of this post, it fails with the error quoted previously. The reason why is clearly illustrated if you consider the following sequence of events. Package execution starts Script Task in Control Flow starts Script Task in Control Flow locks the PackageInt variable as specified in the ReadWriteVariables property Script Task in Control Flow executes script, and the On Information event is raised The On Information event handler starts Script Task in On Information event handler starts Script Task in On Information event handler attempts to lock the PackageInt variable (for either read or write it doesn’t matter), but will fail because the variable is already locked. The problem is caused by the event handler task trying to use a variable that is already locked by the task in Control Flow. Events are always raised synchronously, therefore the task in Control Flow that is raising the event will not regain control until the event handler has completed, so we really do have un-resolvable locking conflict, better known as a deadlock. In this scenario we can easily resolve the problem by managing the variable locking explicitly in code, so no need to specify anything for the ReadOnlyVariables and ReadWriteVariables properties. public void Main() { // Set the variable value to something new, with explicit lock control Variables lockedVariables = null; Dts.VariableDispenser.LockOneForWrite("PackageInt", ref lockedVariables); lockedVariables["PackageInt"].Value = 199; lockedVariables.Unlock(); // Raise an event so we can play in the event handler bool fireAgain = true; Dts.Events.FireInformation(0, "Script Task Code", "This is the script task raising an event.", null, 0, ref fireAgain); Dts.TaskResult = (int)ScriptResults.Success; } Now the package will execute successfully because the variable lock has already been released by the time the event is raised, so no conflict occurs. For those of you with a SQL Engine background this should all sound strangely familiar, and boils down to getting in and out as fast as you can to reduce the risk of lock contention, be that SQL pages or SSIS variables. Unfortunately we cannot always manage the locking ourselves. The Execute SQL Task is very often used in conjunction with variables, either to pass in parameter values or get results out. Either way the task will manage the locking for you, and will fail when it cannot lock the variables it requires. The scenario outlined above is clear cut deadlock scenario, both parties are waiting on each other, so it is un-resolvable. The mechanism used within SSIS isn’t actually that clever, and whilst the message says it is a deadlock, it really just means it tried a few times, and then gave up. The last part of the error message is actually the most accurate in terms of the failure, A lock cannot be acquired after 16 attempts. The locks timed out.  Now this may come across as a recommendation to always manage locking manually in the Script Task or Script Component yourself, but I think that would be an overreaction. It is more of a reminder to be aware that in high concurrency scenarios, especially when sharing variables across multiple objects, locking is important design consideration. Update – Make sure you don’t try and use explicit locking as well as leaving the variable names in the ReadOnlyVariables and ReadWriteVariables lock lists otherwise you’ll get the deadlock error, you cannot lock a variable twice!

    Read the article

  • Mimicking the UltraGridColumnChooser's drag & drop ability

    - by Sören Kuklau
    (Infragistics 2008 Vol. 3, CLR 2.0) Infragistics's UltraGrid comes with a column chooser user control, which is simply a vertical arrangement of columns with checkboxes that toggle a column's hidden state. In addition, it allows you to pick a column and drag it directly to the grid so you don't have to manually position it afterwards. (This is particularly handy when you already have a lot of visible columns and have no clue where the new one ended up.) I'm building my own column chooser based on an UltraTree. Getting the checkboxes to behave the same wasn't an issue, but I haven't found a way to drag a column from the tree to the grid and have it accept it. In my tree, each UltraTreeNode has a Tag with the following struct: Private Structure DraggableGridColumn Public NodeKey As String Public NodeName As String Public ParentKey As String Public Column As UltraGridColumn End Structure I then have an event as follows: Private Sub columnsTree_SelectionDragStart(ByVal sender As Object, ByVal e As System.EventArgs) Handles columnsTree.SelectionDragStart If columnsTree.SelectedNodes.Count <> 1 Then Return End If If Not TypeOf columnsTree.SelectedNodes(0).Tag Is DraggableGridColumn Then Return End If Dim column As UltraGridColumn = CType(columnsTree.SelectedNodes(0).Tag, DraggableGridColumn).Column columnsTree.DoDragDrop(column, DragDropEffects.All) End Sub In the DoDragDrop call, neither column (of type UltraGridColumn) nor column.Header (of type ColumnHeader) get accepted by the grid. I assume I'm sending the wrong type, and/or that the grid expects a special struct with some additional information. Unfortunately, I've also failed to catch an event (both on the column chooser side as well as on the grid side) where Infragistics's normal column chooser does this properly; the normal drag & drop events never seem to fire.

    Read the article

  • Flex - Drag and drop - Drop a subset of multiple items

    - by flanagann
    I'm developing two DataGrid with drag and drop support. Multiple items can be selected from the source data grid, and dropped into the target data grid. I'm using an drag and drop event listener which completes the operation only in certain cases. I'm using event.preventDefault() but it doesn't work, since it stops the drag and drop from all the items. My aim is, for example, finally dropping 2 elements from the total 4 elements that I previously selected. public function onDropPermission(event:DragEvent):void { var sourceGrid:mx.controls.DataGrid = new mx.controls.DataGrid(); sourceGrid = event.dragInitiator as mx.controls.DataGrid; var targetGrid:mx.controls.DataGrid = new mx.controls.DataGrid(); targetGrid = event.target as mx.controls.DataGrid; var i:int; for (i = 0; i < sourceGrid.selectedIndices.length; i++) { var j:int; for (j = 0; j < dataGroupPermissions.length; j++) { var permission:Permission = new Permission; permission = dataGroupPermissions[j] as Permission; if (permission.id == sourceGrid.selectedItems[i].id) { event.preventDefault(); } } } }

    Read the article

  • iPad Orientation Lock Notification?

    - by vakio
    Is there a way to receive a notification when the iPad gets locked? When the lock is set on or off, it does send a receivedRotate: notification, but I need a way to be able to distinguish normal rotations from lock "rotations". The problem is I am rotating things in my view when the rotation changes. When the lock is activated, the iPad sends a receivedRotate: with UIInterfaceOrientationPortrait. I've looked in UIDevice for something like isOrientationLocked, but with no success. Thanks for any clues on this.

    Read the article

  • Using lock(obj) inside a recursive call

    - by Amby
    As per my understanding a lock is not released until the runtime completes the code block of the lock(obj) ( because when the block completes it calls Monitor.Exit(obj). With this understanding i am not able to understand the reason behind the behaviour of the following code. private static string obj = ""; private static void RecurseSome(int number) { Console.WriteLine(number); lock (obj) { RecurseSome(++number); } } //Call: RecurseSome(0) //Output: 0 1 2 3...... stack overflow exception There must be some concept that i am missing. Please help.

    Read the article

  • lock statement not working when there is a loop inside it?

    - by Ngu Soon Hui
    See this code: public class multiply { public Thread myThread; public int Counter { get; private set; } public string name { get; private set; } public void RunConsolePrint() { lock(this) { RunLockCode("lock"); } } private void RunLockCode(string lockCode) { Console.WriteLine("Now thread "+lockCode+" " + name + " has started"); for (int i = 1; i <= Counter; i++) { Console.WriteLine(lockCode+" "+name + ": count has reached " + i + ": total count is " + Counter); } Console.WriteLine("Thread " + lockCode + " " + name + " has finished"); } public multiply(string pname, int pCounter) { name = pname; Counter = pCounter; myThread = new Thread(new ThreadStart(RunConsolePrint)); } } And this is the test run code: static void Main(string[] args) { int counter = 50; multiply m2 = new multiply("Second", counter); multiply m1 = new multiply("First", counter); m1.myThread.Start(); m2.myThread.Start(); Console.ReadLine(); } I would expect that m2 must execute from start to finish before m1 starts executing, or vice versa, because of the lock statement. But the result I found was the call to lock first and lock second was intermingled together, i.e., something like this Now thread lock First has started Now thread lock Second has started lock First: Count has reached 1: total count is 50 lock First: Count has reached 2: total count is 50 lock Second: Count has reached 1: total count is 50 What did I do wrong?

    Read the article

  • Map caps-lock key to middle mouse click

    - by Stefano Palazzo
    Since I rarely use caps-lock, I'd like to map the key to a middle mouse click instead. I would also like to map Alt+Caps Lock to the original function of the caps lock key, should I ever need it. I can map any keyboard shortcut to xdotool click 2, but the Gnome Keyboard Shortcuts dialog won't let me assign a command to the caps-lock key, even with modifiers. I know this is a bit of a strange undertaking; How would I go about doing it?

    Read the article

  • How do I turn off the onscreen keyboard on the lock screen?

    - by Patrick Marchwiak
    The lock screen has an on screen keyboard that I am unable to disable. I don't remember exactly but I believe I turned it on using the "Screen Keyboard" setting in the Universal Access settings. I've tried a number of things all with no effect: Toggling "Screen Keyboard" in Universal Access Toggling "Onscreen keyboard" in the login screen (LightDM) Clicking on the "x" in the upper right corner of the keyboard

    Read the article

  • Map caps-lock key to middle mouse click

    - by Stefano Palazzo
    Since I rarely use caps-lock, I'd like to map the key to a middle mouse click instead. I would also like to map Alt+Caps Lock to the original function of the caps lock key, should I ever need it. I can map any keyboard shortcut to xdotool click 2, but the Gnome Keyboard Shortcuts dialog won't let me assign a command to the caps-lock key, even with modifiers. I know this is a bit of a strange undertaking; How would I go about doing it?

    Read the article

  • C# / WPF / .NET - Drag and drop to Desktop / Explorer

    - by Dänu
    Hey Guys Following my scenario. I got an Application which loads a Filestructure (Folders, Files) from a Database into a WPF ListView. Now I'd like to grab a file from this ListView, drag it over my Desktop (or some open explorer window) and drop it there. Basic Drag and Drop, nothing fancy. This sounds like a "standard" function for a windows application - but google won't help. So how can I achieve this? Interops? Thanks Edit: Thanks for the solution, I still had to do some googling. Here's my complete solution.

    Read the article

  • WPF TreeView drag and drop using preview

    - by imekon
    I'm handling drag and drop events in a TreeView using PreviewMouseDown, PreviewMouseMove and PreviewMouseUp, however, there is an issue. In my PreviewMouseDown handler, I set everything ready in case there's a drag started (detected in the Move event), however I set e.Handled = true. This means that standard selection events don't get generated on my tree! What I want to be able to do in my Up event is to invoke the standard treeview selection changed event - except I cannot call events outside of the tree. So what's the correct way to do this? I have tried using the standard MouseDown, MouseMove and MouseUp events however there's an issue with messing up my multiple selection feature that means I need to use the Preview version of those events.

    Read the article

  • Drag/Drop image url in IE

    - by pierre
    I have a requirement in our web app. to allow users to drag an image from an external site and drop it in a text editor they have open in our app. This is, as you'd expect, to let them embed the image in the document (its a rich text editor). In IE 8 this functionality appears to be broken. If I drag/drop, IE uses a relative URL for the 'src' tag on the image - which means I cannot then download the file and store it since I dont know the full address (eg: '../../imgs/myImage.png') Safari and Firefox do not do this; they provides the fully-qualified address (eg: www.mysite.com/imgs/myImage.png). Is this a bug in IE or just WebKit/Mozilla going the extra mile?

    Read the article

  • C# Drag drop does not work on windows 7

    - by Oskar Kjellin
    I have had a project for quite a while using C# winforms. I implemented a drag-drop function before windows 7 was release. Worked like a charm. However, when using windows 7 it does not work. The event doesn't even get triggered. AllowDrop is set to true. When subscribing to DragEnter it does not get called in windows 7 (not sure about vista). But on XP it works all the way. The program is run with administritave priviliges. Is there any difference in the drag drop in windows 7 vs xp? Don't know if it's relevant, but I'm using x64

    Read the article

  • How can I drag and drop a xaml activity to a WF4 rehosted designer?

    - by Louis Rhys
    I understand that the WorkflowDesigner can receive a dragged item in several ways, for example: By dragging an item from the toolbox and dropping it on the designer: an empty activity of that type will be inserted on the designer at the drop location. One can also drag an activity from the designer and drop it on another location in the designer, the dragged activity will be inserted at the drop location as well. Is it possible that similar to these two drag and drop mechanism, I can drag a xaml activity to the designer? What I have in mind is this, Let's say you have a ListView containing several xaml files. I want to be able to drag one of the ListView items (ie one of the xaml files), and when I drag it over the designer it will act as if I drag something from the toolbox (except the activity will be supplied from the xaml). I know I can create a runtime Activity from the file by using ActivityXamlServices.Load(filename), and I want this activity to be inserted at the drop location. But how to tell the application to understand this when I drag and drop?

    Read the article

  • WPF - Drag from withing DataTemplate

    - by Gustavo Cavalcanti
    I have a ListBox displaying employees with a DataTemplate - it looks very similar to this screenshot. I want to be able to click on the employee photo, drag it and drop it somewhere out of the ListBox. How can I do that? I am not sure how to capture the PreviewMouseLeftButtonDown event of the Image, since it's inside the DataTemplate. Edit: The DataTemplate lives in a separate assembly and the drag/drop logic needs to be in the Window that has the ListBox. Edit2: I am thinking that the right way of doing this is using commands, am I right? Thanks!

    Read the article

  • NSOutlineView with Drag and Drop

    - by bob
    I read the other post here on Outlineviews and DND, but I can't get my program to work. At the bottom of this post is a link to a zip of my project. Its very basic with only an outlineview and button. I want it to receive text files being dropped on it, but something is wrong with my code or connections. I tried following Apple's example code of their NSOutline Drag and Drop, but I'm missing something. 1 difference is my program is a document based program and their example isn't. I set the File's Owner to receive delegate actions, since that's where my code to handle drag and drop is, as well as a button action. Its probably a simple mistake, so could someone please look at it and tell me what I'm doing wrong? Here is a link to the file: http://www.4shared.com/file/or1A7aHk/OutlineDragDrop.html

    Read the article

  • Drag and Drop text - What am I missing?

    - by Harvey
    I am trying to add drag-and-drop text to my Doc-View App. I added the COleDropTarget variable to the view class, registered it in OnCreate(). I added OnDragEnter(), OnDragOver(), OnDragLeave() and OnDrop() to that class as virtual overrides, but none of them are ever called. I previously had added m_pMainWnd-DragAcceptFiles(TRUE); to my App class. I tried commenting out that statement, but no affect. I tried using Spy++ to see where the messages go while I do a drag, but it logs nothing at all while I am dragging the text around in the App. What do I need? Or what else can I try, to narrow down the problem? TIA, Harvey

    Read the article

  • Wicket Drag and drop functionality for adding an image

    - by Marcel
    I'm making a wicket app that can manage some options for a cashdesk app. One of the options is to change the image of a selected Product. The user(manager) can choose from the already present images in the database (SQL) when this option is selected, or add a new image if the desired image is not present. Don't mention the test names and awesome images (it's still in test-fase) I prefer to see the adding of an image achieved by Drag and Drop html5 demo [dnd-upload] (From the desktop into the browser) I'm currently using Wicket-6.2.0 and wicket-dnd 0.5.0 and i can't seem to get this working! All examples I can find are from wicket 2.x or lower. It is possible to use drag and drop in Wicket-6.2, but how do I achieve this? There seems to be some DraggableBehavior in wicket? Any help is welcome! [UPDATE] Upgraded to wicket-dnd 0.6

    Read the article

  • disable text drag and drop

    - by maniek
    There is a common feature of modern browsers where a user can select some text and drag it to an input field. Within the same field it causes moving of text, between different fields it does copying. How do I disable that? If there is no portable way, I am mostly interested in firefox. This is an intranet webapp, so I am also interested in modifying the browser/getting a plugin to do this. Maybe some system-level settings (I`m on windows XP)? I need to keep the default select-copy-paste functionality. The background is I have multiple-field data entry forms, and users often drag something by mistake.

    Read the article

  • WPF Drag and Drop - Get original source info from DragEventArgs

    - by Quinn351
    I am trying write Drag and Drop functionality using MVVM which will allow me to drag PersonModel objects from one ListView to another. This is almost working but I need to be able to get the ItemsSource of the source ListView from the DragEventArgs which I cant figure out how to do. private void OnHandleDrop(DragEventArgs e) { if (e.Data != null && e.Data.GetDataPresent("myFormat")) { var person = e.Data.GetData("myFormat") as PersonModel; //Gets the ItemsSource of the source ListView .. //Gets the ItemsSource of the target ListView and Adds the person to it ((ObservableCollection<PersonModel>)(((ListView)e.Source).ItemsSource)).Add(person); } } Any help would be greatly appreciated. Thanks!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >