Jump to content

draggable shapes


gcue
 Share

Recommended Posts

I see that its possible to drag images and listview items. But is it possible to create a simple shapes like squares, rectangles and circles and make them dragable within a gui? (trying to avoid the clutter of image files)

then i can save the coordinates of each item and refer to them later

i am trying to create a workspace designer which can be saved then later refered to

thanks =)

Link to comment
Share on other sites

Might be an idea to refer to the inner workings of CyberSlug's GUIBuilder. It may be old, but it most likely what you're after.

TheSaint has an updated version that can be found here:

http://www.autoitscript.com/forum/index.php?showtopic=14505&view=findpost&p=641872

Cheers,

Brett

Link to comment
Share on other sites

I did similar project in my work in other programming language but principles are the same no matter of programming language and it uses mainly Win32 API calls anyway.

In my project I draw on label control rectangles (and other stuff like axis etc) representing orders from database, it has different colors based on state of order and many other information drew on it.

The princip of dragging is that I can calculate order number from mouse coordinates because it has rectangle shape and in case of mouse_down event I do painting of that order around mouse pointer until mouse is released.

I use inner bitmap with all orders painted on it and in wm_paint event I do BitBlt from inner bitmap (DC) to label (its DC).

In fact I do also horizontal/vertical scrolling myself so I use more helper inner bitmaps and ScrollDC API calls on them according H/V scrollbar position. See attached screenshot.

post-6483-12700532993845_thumb.png

Edited by Zedna
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...