i have this code that creates a div, adds id and appends the div. I am trying to drag that div but its not working like it should. $("<div class='twin_seat' style='width:120px;display:table-row;'></div>") .attr('id', twinseatsid) .appendTo(cinema) .draggable({ containment: cinema, snap: true, helper: 'clone' }); im using `helpe: clone` because i just want to visually see the element being dragged because when looking at the developer console the div does get dragged but it doesnt stay where it gets dragged to; that's the issue. help please. TIA.

Member Avatar
Member Avatar
+0 forum 1

Hello, im trying to create a page that drag, drop and clone image on the drop plus dynamically add ids to the clones images. i sort of have it except the dynamic id part im not doing it right. $(document).ready(function(){ var cinemascreen = $("#cinema-screen"); var cinema = $("#cinema-wrapper"); var single = $(".single-chair"); var twin = $(".twin-chair"); var four = $(".four-chair"); cinemascreen.draggable({ containment: cinema, scroll: false }); single_chair = 0 $(".single-chair").draggable({ helper: "clone" }); $("#cinema-wrapper").droppable({ accept: ".single-chair", drop: function(event, ui) { $(this).append($(ui.draggable).clone()); var single_chair_id = "A" + single_chair; $("#cinema-wrapper .single-chair").attr('id', single_chair_id); $(single_chair_id).draggable({ containment: 'parent', }); single_chair ++; } }); }); page …

Member Avatar
+0 forum 0

Hi, I am trying to dynamically generate horizontal bars for my project. I would want to make these bars draggable, but I am not able to do so. Could you please tell me how this can be done using javascript/jquery. The code written so far is as follows: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JS Bin</title> <style type="text/css"> canvas { border-bottom: thin solid; } </style> </head> <body> <p id='dothis'>Horizontal Bars</p> <canvas id='myCanvas' width='200px' height='300px' style='border:ipx solid #c3c3c3;'> </canvas> <form onsubmit='return false;'> <input type='text/javascript' id='duration'> <button onclick='input()'>input</button> </form> <script type='text/javascript'> var c = document.getElementById('myCanvas'); var ctx = c.getContext('2d'); ctx.fillStyle = '#FF0000'; …

Member Avatar
Member Avatar
+0 forum 1

The wxPython Phoenix project can be used with Python version 2 and version 3. The project applies pretty much the familiar wxPython code. Here we are testing a dragable borderless frame.

Member Avatar
Member Avatar
+3 forum 2

Hello all. I'm currrently working on a GUI that needs to support dragging some application-specific objects from a selection area onto a work area (JPanel). It's currently working in a "click where to place the object, then click the Add button" mode, but that's not good enough. The obvious approach is to use D&D (Java 6 or later) with a custom DataFlavor for the objects, but I'm struggling to find and decent documentation or examples of how to fit the whole thing together. The Oracle tutorials do a decent job of listing all the classs and methods involved, but not …

Member Avatar
Member Avatar
+2 forum 7

Hey guys I have a page where a user can drag and drop ellements into divs 's and everything works great, but I need the div to only accept 1 element. Check it out [Click Here](http://www.cintascsr.com/test_site/report/) Right now you can drag both pdf docs into one "send to print" div. I need to able to either kick out the existing one or not allow the second ellement to be dropped at all. Any ideas??

Member Avatar
Member Avatar
+0 forum 8

I dont know what goes wrong in this code... Help me here I simply want to save the initial and final positions after dragging the mouse... #include"iostream" #include<glut.h> class point1 { public: point1() { x=0; y=0; } int x; int y; }p[2]; int flag=0; void processMouse(int button, int state, int x, int y); void actmot(int x, int y); int main() { //glClear(GL_COLOR_BUFFER_BIT || GL_DEPTH_BUFFER_BIT); glutMouseFunc(processMouse); glutMotionFunc(actmot); glutMainLoop(); return 0; } void processMouse(int button, int state, int x, int y) { if(button==GLUT_LEFT_BUTTON && state==GLUT_DOWN) { if(flag!=1) { flag=1; p[0].x=x; p[0].y=y; } } else if(button==GLUT_LEFT_BUTTON && state==GLUT_UP) { if (flag==1) { p[1].x=x; …

Member Avatar
Member Avatar
+0 forum 3

Hi all I need to be able to drag and drop multiple files from Outlook into my vb.net application. Using e.data.GetData("FileGroupDescriptor") I can read using an IO.Stream the FileGroupDescriptor and detect the names of the files being dropped. If I then use e.data.GetData("FileContents") using a IO.MemoryStream I can detecty the length of the file contents and then copy the contents of the first file from memory into a file. This works fine for the first file but I can't get to the FileContents of files 2,3,4 etc etc. Is there a mechanism for accessing the index of the FileContents and …

Member Avatar
Member Avatar
+0 forum 3

Greetings... I am a new member to DaniWeb. My Wife's system began its current symptoms about a week ago 08-10-2012. First sporadically, then seemed to escalate exponentially until 08-12-2012 when she could no longer: 1. double-click on her icons in... (we must right-click and choose OPEN) a. the START menu b. desktop c. Quick Launch (which disappears after each reboot after we have clicked to have it display) 2. We could no longer move icons on the desktop to another location until I ran a. regsvr32 ole32.dll and b. regsvr32 /i shell32.dll c. It solved the problem of icon movement, …

Member Avatar
Member Avatar
+0 forum 48

Hi I am busy building a small Python app in which I have two tkinter (ttk) Treeview widgets. I want to be able to drag an item (or multiple selected items) from the one treeview to the other, having the dragged items added to the treeview where they are dropped. At the moment I cannot find any demo code of how to do this. Is there a straight forward way of achieving this? Many thanks in advance.

Member Avatar
+0 forum 0

Hello ,,, i'v started learning Game programming with java before 1 week and now am developing a drag and drop game , and am having a trouble with MouseListener and MouseMotionListener / drag and drop methods / i just wrote a simple code i'v seen on web but i had an error while compiling and don't know what is wrong with the code ,, the whole code : public class mouseDragandDrop extends JFrame implements MouseListener , MouseMotionListener { private boolean drag = false ; private JLabel lbl ; public mouseDragandDrop () { try { lbl = new JLabel ("drag & …

Member Avatar
Member Avatar
+0 forum 1

Hello everyone I created one canvas and draw one line on it I want to move this line using mouse on the canvas How to move line on canvas because using draggable function it cant move so pls help me.

Member Avatar
Member Avatar
+0 forum 2

Hello. I have a piece of code currently where I have a JFrame that I have removed the title bar and borders etc from using .setUndecorated(true). I have tried a number of ways with no success to make this window draggable by it's client area. [CODE] JFrame f = new JFrame("New Frame"); f.setUndecorated(true); f.setVisible(true); f.setBounds(0, 0, 400, 400); [/CODE] What I want in the end is to have a window that has a no-title bar etc so that I can create the frame from scratch and I would like it to be dragged by just clicking anywhere on the window …

Member Avatar
Member Avatar
+0 forum 6

Hi, I'm developing an application which has a treeview and a crystal report viewer. There are a lot of other stuff too, but I want to make the user be able to change the size of the treeview with the mouse (see the picture) [url]http://imageshack.us/photo/my-images/3/mousedrag.png/[/url] how can I do this? thanks in advance..

Member Avatar
Member Avatar
-1 forum 2

how can i crop an image based on the size of my picturebox? my picturebox's size mode is normal, i want to have for example, a 100 x 100 image using a 100 x 100 picture box, also i can drag the the image inside the picturebox so that i can have a focal point, a center of the image that i want to crop on. thanks guys! itll be greatly appreciated.

Member Avatar
Member Avatar
+0 forum 3

how can i zoom an image inside a picturebox? and i also want to know how can i make a picture inside the picturebox draggable while at the same time, it can be zoomed in and out. my goal is to crop an image inside the picturebox and i can zoom and drag the image inside if necessary, thanks :)

Member Avatar
Member Avatar
+0 forum 2

Dear all, i am trying to get my sprite to be dragged around the screen by clicking the mouse, i can get it to attach to the mouse but cannot get it to unattach itself, i coded the if not mouse click then set mouse attach to false but it does not seem to work. Could anybody tell me where i am going wrong?? if(myApp.GetInput().IsMouseButtonDown(sf::Mouse::Left) && !mouseAttached && gameState==playing) //if the left mouse button is pressed and it is not currently attached { if(dist(widthNormalise(myApp.GetInput().GetMouseX()),heightNormalise(myApp.GetInput().GetMouseY()),g1.getPosX(),g1.getPosY())< g1.getRadius()) //if the mouse is over or touching the green draught { mouseAttached=true; pMseTacheddraught=&g1; } if(!myApp.GetInput().IsMouseButtonDown(sf::Mouse::Left)) …

Member Avatar
Member Avatar
+0 forum 2

Hi; In need of some guidance. I have a form which has a list box upon it. with items in it. These items are dragged out of this and a custom control is added to the form. All this works fine. However a new requirement is that there should be a ghost copy to follow the mouse when this is conducted. I have managed to create a new Cursor which is generated dynamically by creating a bitmap of the control, and then adding this through the CustomCursor.CreatCursor() method. When the item is initially clicked in the lstJobs list box the …

Member Avatar
Member Avatar
+0 forum 5

Hi All, I'm building a C# game that will handle drag and drop of images and labels in a visual studio form, but when I drag around a component, the form takes big performance hit. For example, I have some images moving around on the form (pictureboxes) and these stop moving while I'm draging a component around. This is how I implemented the dragging: [CODE] private bool is_dragging = false; private int click_offset_y; private int click_offset_x; private void label1_MouseDown(object sender, MouseEventArgs e) { is_dragging = true; click_offset_x = e.X; click_offset_y = e.Y; } private void label1_MouseMove(object sender, MouseEventArgs e) { …

Member Avatar
Member Avatar
+0 forum 4

Here is my code so far: [CODE] import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; import javax.swing.*; public class Paint extends JFrame { private static PCanvas canvas = new PCanvas(); public Paint() { // Create a panel to group three buttons JPanel p1 = new JPanel(new GridLayout (1, 3)); JButton jbtClear = new JButton("Clear"); JButton jbtFG = new JButton("FG"); JButton jbtBG = new JButton("BG"); jbtClear.setToolTipText("Clears Canvas"); jbtFG.setToolTipText("This changes Foreground Color"); jbtBG.setToolTipText("This changes Background Color"); p1.add(jbtClear); p1.add(jbtFG); p1.add(jbtBG); // Create a panel to group two labels JPanel p2 = new JPanel(new GridLayout (1, 4)); JButton jbtLine = new JButton("Line"); …

Member Avatar
Member Avatar
+0 forum 2

Hi all, I know how to drag and drop an image from one control to another. Code enough out there. It works fine, but I find the user interface a bit poor:'( I want my image to follow the mouse while held down. Found nothing that serves my needs on the web, except sprites, obscure code and what all not. After some (long) experimenting I came up with the following: Make a new forms app with a picturebox with a picture and add these events: [CODE=csharp] private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { //make MouseMove active this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove); …

Member Avatar
Member Avatar
+0 forum 8

The End.