Create a paint like work area and ability to move them - c++

I like to design a workplace or form(not decided) in VC++ (MFC) or (C++) where I can select and place different objects like car , bike etc and move them programmatically.Each object has its own properties(which is already designed) I have no problem in moving them by changing x,y position.
But my question is how do I place different objects like car , bus on screen and move them to the place I want.I should also able to delete them when needed. As I am new MFC I would like to know how to proceed . Given an right direction I can swim on my own.

Qt is an excellent framework for this kind of thing.

Do not use MFC. Period. That thing is a genuine piece of crap, and every programmer I know absolutely hates it and stays away from it.
If you want to start from scratch, use WINAPI, but that's your choice (depending on if you want to reinvent the wheel.) Read up on input events and DirectDraw (for drawing to a 2D canvas.) Microsoft also has WPF for newer .NET builds, and it has canvas support built it.

Agree that you should not use MFC. Sticking with C++, there is Managed C++ on the .NET platform, or you could go native C++ and use DirectDraw or use OpenGL (which is more cross platform).

Related

How to inspect pop up windows/tool tips/hover effects which are designed to hide/close on mouse move with tools like WinSpy++ or Spy++?

Essentially I'm trying to learn more about the Win32 api, how certain classes/elements are created, destroyed, what items make them up etc.. Dissecting windows if you will for a project of mine.
I'm very curious at the moment what popups/tool tips/hover effects ubiquities to all windows applications are made up of. My main goal is to grab text from any tooltip/hover thingy/WS_POPUP?
If someone knows that is great but I'd also like to have the tools to research it myself.
I'm not even sure what to google to be honest to get me on the right path. I've tried some C++ code to print class names and fetch the text from what I think might be a msgbox but no dice so far.
The MiniSpy tool on Codeproject comes in handy in situations like this because it uses the corner of the spy window as the location, not the mouse.

Can I access the Unity background elements?

I'm not very familiar with Linux, but have some experience with C and C++. I would like to get in touch with some Visual FX and/or UI development (either C or C++). I was wondering if there is a possibility to access the GUI elements of the Desktop on Ubuntu's Unity UI.
What I especially would like to do, is to render animations on the desktop or windows or all over the screen. (particle effects when clicking with the mouse or so).
Can anyone point me in the right direction? (Libraries, Documents, ...)
I think Desktop Effects have to be designed specific for the corresponding Window Manager.
I think unity uses (some sort of) compiz, so you should look into compiz plugin development.
A lot of "i thinks" so i am not really sure if that'll help you, but good luck.
You want to learn a lot more about GTK. There are lot of documentation on line (and some books also). You might code in C++ using GtkMM (but you could consider Qt also). GTK itself is coded in C, with well designed coding style and convention. Looking inside its source code is worthwhile.

Lets draw a spider

I am new to c# and VS, but I am getting it. The application is this: A program in which the end result will draw a spider from options in which the user will define. Lets say there are 100s of options: size and number of body parts, color, connections points to the body, etc.
First question: Should I try to use the library included with VS 2005? Or, is there another environment in which I could "tap into" to get good results (flash, java, etc.)?
Second Question: Could you direct me to information corresponding to your answer from the first question?
Thanks so much, the kids I teach will love it!
Jennifer
Hmm.
This is truly a rough question, not because I don't know how to do it, but because it can often be so ridiculously daunting for beginners. If you use the "standard" Windows Forms C# method of doing it, you'll end up asking yourself, "What the #*(&! is WM_PAINT?" or "Why does my program totally get messed up when I move a window over my picture?!"
There are basically two main technologies that you can use to do drawing in .NET : Windows Forms (what MusiGenesis suggested) and WPF, or Windows Presentation Foundation, which ships with the 3.0 version of Visual Studio. That means that if you download the .NET 3.5 SDK or use Visual Studio 2008, WPF comes with it.
I'd recommend using WPF instead of Windows forms if you're just starting off, because the dirty details of drawing and repainting are largely abstracted. You can also define a lot of your picture as markup, just like a web page, and then manipulate it in code. Good luck and have fun!
Here is a link to some examples of how to draw things with C#:
http://www.geekpedia.com/tutorial50_Drawing-with-Csharp.html
This example uses just the built-in graphics methods of .NET, so you won't need any other libraries.

Need a client-side interactive 2D world map: best map package? Or best C++ graphics/canvas library to make one?

I need a 2d political map of the world on which I will draw icons, text, and lines that move around. Users will interact with the map, placing and moving the icons, and they will zoom in and out of the map.
The Google Maps interface isn't very far from what I need, but this is NOT web related; it's a Windows MFC application and I want to talk to a C++ API for a map that lives in the application, not a web interface. Ideally I don't want a separate server, either, and any server MUST run locally (not on the Internet). What canned map package or graphics library should I use to do this? I have no graphics programming experience.
This is strictly 2D, so I don't think something like Google Earth or WorldWind would be appropriate. Good vector graphics support would be cool, and easy drawing of bitmaps is important.
All the canned options seem web oriented. SDL is about all I know of for flexible canvas programming, but it seems like making my own map would be a lot of work for what is probably a common problem. Is there anything higher level? Maybe there's a way to interact with an adobe Flash object? I'm fairly clueless.
Perhaps:
http://www.codeplex.com/SharpMap
ESRI MapObjects
http://www.esri.com/software/mapobjects/index.html
ESRI MapObjects LT
http://www.esri.com/software/mapobjectslt/index.html
See
http://www.esri.com/software/mapobjectslt/about/mo_vs_lt.html
for a comparison of the two MapObjects feature sets.
ESRI may have a replacement to the MapObjects libraries
You could extend your search by using the term GIS (Geographic Information System). I'm sure its gonna be easier. There's a lot of stuff out there on that subject.
Here's a page I found: http://www.ucancode.net/Gis-Source-Code.htm
or: http://opensourcegis.org/
You might want to try the Mapnik C++/Python GIS Toolkit.
You can take a look at the Marble Widget, which is part of KDE's Marble project. There are Windows binaries for this, too, but they might be dependent on Qt.
Yes, Marble has also the advantage that it provides kind of a ready made solution in a single control (called "widget" in Qt's technical terms).
The dependency on Qt (which is the only dependency btw.) might also be seen as an advantage: Qt's upcoming version is licensed under the LGPL, so even if you plan to use this in a proprietary application then there shouldn't be any real worries. And of course Qt and Marble are cross-plattform and provide an API that is very intuitive and easy to understand. Unlike common GIS solutions the Marble API and the usage of the widget is rather focused on people who don't know much about GIS. So its usage is quite easy to understand even if you feel scared by technical terms used in GIS.
Marble offers several interfaces to programming:
You can either create your own Marble plugins and paint inside those or you can subclass the MarbleWidget control. For a simple HelloWorld application see:
http://techbase.kde.org/Projects/Marble/MarbleCPlusPlus

C/C++ strip chart

Just a quick question.
I'm looking for a simple strip chart (aka. graphing) control similar to the windows task manager 'Performance' view. And have found a few, but they all rely on MFC or .NET :(
Am hoping that someone here might have or know where to get a simple strip chart Win32 control that is not MFC.
Thanks.
If you have to go the roll-your-own route look at the polyline GDI call. That can draw the entire line for you in one call.
I work on a system that draws charts with custom code (no 3rd party controls, all win32 GDI). It sounds really hard, but it isn't that bad.
A little math to map the points from your coordinate space to the device context, drawing gridlines/backgrounds, and Ployline. Done! ;)
Heck you can use GDI mapping modes to make the math easy (but I wouldn't).
If you have found a good MFC control, maybe your best approach would be to convert the code yourself to pure Win32 - MFC is a thin wrapper around the Win32 API after all. Out of interest, what is the name of the MFC control you found?
Few months ago I have also experienced the same issue: trying to find an existing implementation of a performance monitoring library, which looks similar to windows task manager. However because I couldn't find any existing library that works on multi-platforms (not dependent to MFC or .NET), to I decided to create my own library :-)
Today I just released the beta version of this library, and made it available as an open source project.
Check this out here: http://code.google.com/p/qw-performance-monitoring/
Let me know if this is useful. I am still doing some testing, to make sure that every features in this library work in Mac, Linux, and Windows. Once I am done with the testing, I will release the stable release. For the current time, enjoy using this beta version :-)
I don't think there is a standard one in the Win32 common controls library. You'll either have to use someone else's widget library, or roll your own using GDI to draw the graphs. It probably isn't too difficult to roll your own - just create a bitmap control, and set the image every time your data updates to a graph that you draw in memory.
Look at this amazing open source library: http://mctrl.sourceforge.net