Archived

This topic is now archived and is closed to further replies.

GUI Programming

This topic is 5504 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Do you know any good tutorials about GUI Programming, specially about working with (and picking) shapes and objects in a program? As an example, consider a paint program as Corel where you can pick a line and move it from one place to another.. Thansk in advance, Andre "- To begin with, said the Cat, a dog''s not mad. You grant that? - I suppose so, said Alice. - Well, then, - the Cat went on - you see, a dog growls when it''s angry, and wags its tail when it''s pleased. Now I growl when I''m pleased, and wag my tail when I''m angry. Therefore I''m mad."

Share this post


Link to post
Share on other sites
With due respect Andre, your question is a bit too broad to expect a good response. How about some background info?

Fill in the blanks:

OS:
GDI, O_GL, DX:
2D viewport, 3D viewport:
Windowed App, FullScreen App:
Programming Language:

Dreddnafious Maelstrom

"If I have seen further, it was by standing on the shoulders of Giants"

Sir Isaac Newton

Share this post


Link to post
Share on other sites
quote:
Original post by Dreddnafious Maelstrom
With due respect Andre, your question is a bit too broad to expect a good response. How about some background info?

I disagree with your assertion. I think the question is good as is, it just happens to be more theoretical than practical.

Tutorials about GUI programming are just like tutorials about graphics programming - they''ll either use certain technologies or abstract the specific base technologies away (and I have a book that''s written that way, so this isn''t speculation).

Andre:
Sorry, can''t help you.

Share this post


Link to post
Share on other sites
Take for example a paint program (windowed app, gui based) that you could draw some primitives (lines, rects, circles). But, after you draw it, you could left click on it and drag it to another place, resize the line, etc... like when you insert a picture or an autoform in microsoft word, or when you draw in corel.

As for the programming language, C++ or pascal would be a must...

Thanks a lot...

Share this post


Link to post
Share on other sites
it''s called vector drawing. and basically, i think, each shapes is an object. So you can drag them around, change their properties, resize etc. OOP is the answer.


My compiler generates one error message: "does not compile."

Share this post


Link to post
Share on other sites
What you''re asking about is basically point-in-shape checking, which in turn is basically just collision detection in game-programming terms. To check if a point''s in a circle you use Pythagoras, to check if a point''s in a rectangle you use 4 line checks, and so on. In general terms, this will mean that your GUI elements probably want a function that, given a point, will return true if the point is within that element''s shape and false otherwise.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
actually, what I am looking for is something like that:

[link]http://www.cs.umbc.edu/~ian/guipF96/project3.html[/link]

"Like Project 2, a shape can be drawn by selecting a shape tool and dragging the mouse across the screen, using rubber-band drawing to display it as it is being drawn. Unlike Project 2, once a shape has been drawn it may be modified. In particular, it may be moved by grabbing and dragging it with the middle mouse button, it''s color attributes may be changed or it can be deleted. Any shape may be selected by picking it with the left mouse button. Selected shapes are highlighted by displaying their control points, which are small black squares located at the four corners of the shape''s bounding box."

I would like to use this kind of approach on my map editors...

any tutorials, help?

Thanks

Andre

"- To begin with, said the Cat, a dog''s not mad. You grant that?
- I suppose so, said Alice.
- Well, then, - the Cat went on - you see, a dog growls when it''s angry, and wags its tail when it''s pleased. Now I growl when I''m pleased, and wag my tail when I''m angry. Therefore I''m mad."

Share this post


Link to post
Share on other sites