drag

Border around a form with rounded corner in c++ builder XE

冷暖自知 提交于 2019-12-04 07:45:33
I have made a C++ Builder XE form with rounded corner with the help of the following code BorderStyle = bsNone; void __fastcall TForm1::FormCreate(TObject *Sender) { HRGN frmrgn; frmrgn = CreateRoundRectRgn (0, 0, ClientWidth, ClientHeight,12,12); SetWindowRgn(Handle,frmrgn,true); } It looks cool but the border is missing, I tried many thing but not get good result so please help me to draw border of color RGB(96,96,96) And I want to make whole form dragable. 1. Painting a dark grey border This one's easy, depending on how complex you want the border to look. If you just want an outline in

Restricting a 3D object mouse drag movement to a plane in JavaFX

谁说我不能喝 提交于 2019-12-04 06:59:01
I'm using JavaFX to move 3D cubes around by mouse drag. The cube should stay on the plane spanned by x and z axis. My solution works fairly well, however if I move the cube too fast with my mouse or when it encounters an object with a certain depth (y-Axis), it is assumed, that the mouse is moving on the y-Axis and the cube starts jumping forward or backwards. Is there a way to restrict the mouse to the xz-plane? A more complicated solution would be projecting the y length back to the xz-plane, but I got no clue how. I looked at JavaFX Moving 3D Objects , but couldn't adapt it to my case. My

How to use the mouse joint in Android?

ぐ巨炮叔叔 提交于 2019-12-04 06:14:50
问题 I want to use the MouseJoint in Java for Android. I am new in box2d and cocos2d. I don't know how to use the mouse joint. 回答1: i recomend you to see this tutorial example. Copy from it (sorry i don't like broken links :) ) ... you drag your body with the help of the MouseJoint, it will collide with the other bodys in the world and apply force to them. Box2d - Manual - http://www.box2d.org/manual.html#_Toc258082974 8.10 Mouse Joint The mouse joint is used in the testbed to manipulate bodies

replace mousemove by mousedrag?

我只是一个虾纸丫 提交于 2019-12-04 02:40:59
问题 The title explains it all.I am facing problem when it comes to providing drag event.I tried replacing mousemove by mousedown,may be mousedown fires once and settles down,but it dint help.How can i programmatically do this. In case you want to refer what code i am trying to manipulate you can refer this code .Else ignore it. <script> $(document).ready(function () { $(".toolImage").mouseover(function () { $(this).parent(".toolTip").find(".toolTipDesc").css("display", "block"); }); $(".toolImage

Drag a WPF Form around the desktop

左心房为你撑大大i 提交于 2019-12-04 00:50:00
i am trying to make a c# WPF form where i can drag it around the screen by clicking on it and moving with the mouse. the forms characteristics include being completely transparent and containing only one image. This being said the window style is none and it is not displayed in the taskbar. So essentially all you can see when the app is running is a little image - and ideally i want to be able to drag it around the desktop if i click and hold the left mouse button and move it about. Does anyone know a simple way i can accomplish this or have i overlooked a build in function? Thanks. You can

UIimages move to the center when going to another view

余生颓废 提交于 2019-12-03 21:20:53
I have a drag n drop kind of app. Where you can select images and drag them anywhere on the screen! The problem I'm running into is, when you move to another view, all the images reset to the center, when I return back. For example if I press a button to take me to screen 2, all the "dragged" images I just did, will move back to the center. This only happens when I have AUTOLAYOUT enabled :( I have all my images start out in the center, so I'm guessing its something with autolayout... Any ideas ?! Here's an example of my drag image code. - (IBAction)handlePan:(UIPanGestureRecognizer *

Two divs 50% each. Make middle draggable to make bigger or smaller

别说谁变了你拦得住时间么 提交于 2019-12-03 20:29:45
Alright everyone, is there a way to have 2 divs taking up 50% of the screen and have a bar in the middle so you can drag it and make the left 40% and the right 60% and vice versa. I hope to be able to do this jquery. Here's a method which I quickly wrote, this does not use jQuery though. <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Example Slider</title> <style type="text/css"> #bar1 { position: absolute; background: red; height: 250px; width: 400px; z-index: 1; } #bar2 { position: absolute; background: green; height: 250px; width: 800px; } #slider { position: relative; background

Drag object in Unity 2D

人盡茶涼 提交于 2019-12-03 16:13:16
问题 I have looked for an object dragging script for Unity 2D. I have found a good method on the internet, but it seems it's just working in Unity 3D. It's not good for me as I'm making a 2D game and it's not colliding with the "walls" in that way. I have tried to rewrite it to 2D, but I have crashed into errors, with Vectors. I would be very glad if you could help me rewrite it to 2D. Here's the code what's working in 3D: using UnityEngine; using System.Collections; [RequireComponent(typeof

jquery html 5 dragstart .on('dragstart',function(e){}) e.dataTransfer.setData() doesn't work

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 14:51:11
问题 chrome throw err: Cannot call method 'setData' of undefined, I find the e is not equal to window.event(it havn't propert dataTransfer);both has very big different I find both almost equal in the click event. I used http://code.jquery.com/jquery-latest.js. I don't use drag feature,I just want know why. it is new feature in html 5,jquery still behind of it ?. or jquery team don't want support it?? or some other reason 回答1: In the callback function you get a jQuery wrapper over a native event.

Android: How to drag(move) PopupWindow?

泄露秘密 提交于 2019-12-03 14:40:33
I want to be able to move PopupWindow on touch dragging. I don't want UI to update on the release of the touch. I want PopupWindow to follow my touch. This is something what I am doing: mView = mLayoutInflater.inflate(R.layout.popup, null); mPopupWindow = new PopupWindow(mView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, false); mPopupWindow.showAtLocation(parentView, Gravity.CENTER, -5, 30); mView.setOnTouchListener(new OnTouchListener() { private int dx = 0; private int dy = 0; @Override public boolean onTouch(View view, MotionEvent motionEvent) { switch (motionEvent.getAction()) {