need to make a simple Windows app, what languague should I use? - windows

I need to make s very simple app, with a canvas where the user would be able to drag & drop PNG files, drag, scale and rotate them on the canvas and export to XML their name & coordinates.
I'm pretty good at Android(java) programming, but as I just tried plain java with windowsBuilder for the first time, it appeared to be rather inconvenient and probably would take at least a few days to find my way around in it.
So I thought, maybe you could suggest some simple "program maker" style language/ide that could be quickly picked up for such purpose?
Right now I'm thinking of Flash... any other ideas?
Thanks!

I would go with C#, with the .NET framework.
As you already know Java, it shouldn't be that hard, as C# is also an object-oriented language.
They are some differences, of course, and I won't explain them here.
But if you want a real Windows app, it may be your best choice, as you'll then have access to all the Windows features through the .NET framework.
Everything is very well documented.
You can also choose C++ (managed), but it might be a little harder, coming from Java.
About the IDE, simply use VisualStudio (the express edition is free).
Hope this will help.

I learned JavaScript (I know it's not Java, but similar nonetheless and still object oriented) first and then C++. The transition was quite easy since both are more-or-less object oriented. Like Macmade said, Visual Studio is great to begin, but I prefer using gedit and then compiling with G++. It's more forgiving than Visual Studio and you don't have to create a project and whatnot just to start writing the code. With a text editor like gedit and a standalone compiler, G++, it's much easier to just write the code and then build the program.
I'd stay away from Flash. I know AS2/3 pretty well and I can say that C is much easier to code, at least for me. Everyone has their personal preferences, though. One plus to C is you don't have to buy Flash.

Related

How create custom user interface for Windows?

There are many applications for Windows these days that don't use native windows controls, don't have standard window frames and generally look different. What are some recommended techniques for creating such interfaces?
There are good reasons not to. Like that you will most likely not do a better job than Windows does. (Maybe it will look better (in your opinion), but will it behave?). Or that it's not what most users expect. Or that it will look like s**** on Windows 2011.
That said, it's not hard. You simply handle the WM_NC* events like WM_NCPAINT or WM_NCHITTEST. NC stands for Non Client (window area). And of course, there is a trick on Vista/Win7 (you have to announce it to the DWM).
From an implementation aspect, you could employ WPF (Windows Presentation Foundation) assuming you code for .NET :) It has pretty bunch of skinnable controls, that may look like native and may not.
From a design aspect, if your interface isn't going to follow documented standards (like the Windows UI guidelines), it has to be intuitive. I think the new generation of Windows applications will go through a growing phase in a manner similar to the early days of the Web. After a time, some standards or common themes will evolve.
Can you give us some sample applications? Some apps that don't use native windows controls use cross-platform GUI libraries, like Qt for C++ or Tkinker. These maintain the same look across different platforms.
I wouldn't really recommend making your user interface different deliberately. You don't stand to gain much. Your controls are almost always going to be buggier than native controls, and you are requiring the user to learn something new. Now, if you're controls add a large enough value to be worth the users' time it can be okay. But making them get used to different looking buttons is rarely worth it.
I`m not sure if this answer your question.
You can use third party skinning controls like from Infragistics, or SkinSoft for example.
But like Bubba said I`d recommend going for WPF.
Model-View-Controller! It's as valuable here as in web apps or anywhere else. Be sure to keep the part of your program that generates the custom UI separate from the part of your program that flashes the BIOS.
I know this question is 10 years old but none of the answers mention using an option in visual studio, dont know if it existed at the time.
Theres an option to remove the border of the window in visual studio (called borderStyle). Thats the easiest way to do it, using C#. After removing the border, all you have to do is create a new interface. If you're looking to do it in C++, i think you need to use DWM. I will let an example i found here.
https://github.com/melak47/BorderlessWindow
Another example (maybe without DWM? didnt test):
https://social.msdn.microsoft.com/Forums/vstudio/en-US/b98c4c06-9581-44d3-8e5a-4adb2316e653/win32-about-styles-how-can-i-do-a-borderless-window?forum=vclanguage
There is a lot of people disencouraging to do it in this thread but there's no reason to not do it, if you know what you're doing your application can look great.

Develop a Qt/GTK-Like Framework

I'm now with a idea to start the development of a bare bones Qt/GTK+-like framework, but I want to know some things before I start the creation of this project:
What is the structure of GTK+ and Qt?
Do I need to develop a window manager to build my own framework?
Some resources to start?
Developing a GUI/Application framework is a significant undertaking. You might want to be very clear about why you need to write yet an other framework.
Both projects you mention are open source. Why not start there?
GTK: git clone git://git.gnome.org/gtk+
Qt: git clone git://gitorious.org/qt/qt.git
Ed You ask what the structure of GTK and Qt are, whether you need to write your own widow manager (answer: no) and how to get started. Answers to at least the first two are in the source code. Don't forget, great practitioners in any field learn by watching others. Reading code is no different.
Writing a GUI/app framework would be a great learning experience, but even a fairly small app framework would be a very big job, and not something you really should tackle until you're fairly expert in writing applications using several other frameworks and widget toolkits.
I did something like this once, back in the early years of this decade. That was after I'd been programming for the Mac for over 15 years, Windows over 10, and had programmed both directly to their native graphics, event, and widget APIs, as well as various object-oriented toolkits for them including PowerPlant, MFC, and MacApp. When I started working on a PalmOS application, I spent a couple of weeks writing a very small app framework modeled on PowerPlant. But I could not have succeeded at all without those decades of broad and deep experience with so many GUI systems.
Doing this for Linux/X11 is even more work. That's because, unlike Mac OS and Windows, neither X11 nor Linux supply built-in user interface widgets, or much in the way of graphics primitives or text layout capabilities. GTK+ is part of the GNOME ecosystem; it provides the widgets, gets its message queue and internal communications from GObject, relies on GDK to abstract and simplify its graphics and event communications with X11, and uses Pango and Cairo for text rendering and layout. I work all through that system, and it probably represents many dozens of person-years of hard work by a lot of really smart people. And I'm sure Qt is very similar.
So if you really want to do this, I would recommend you:
Write programs with a lot of different app and widget toolkits, on multiple operating systems. That will help you learn not just how such systems work, but why they are designed as they are. And it will give you some feeling for what works well, and what works poorly.
Contribute bug fixes or new features to one or more of the various open-source frameworks. GTK+ has a list of tasks for beginners to work on. Another great open-source framework is wxWidgets.
Become an expert-level C/C++ programmer.
When you've done that for a few years, you will have the expertise suitable for tackling your own framework.
That sounds like a major undertaking, at least as a starting project.
Not sure what you mean by "the structure" of e.g. GTK+. You can see the object hierarchy for GTK+, that tells you at least how the implemented objects (GTK+ is an object-oriented API) relate to each other. You can guess how the code can be structured, from that information.
And no, you don't need to write your own window manager; the toolkits mainly concern themselves with what happens inside windows, not with the window management itself. Of course you could decide that your "platform" should have a wider scope, and include a WM.
I think some of the answers here might exaggerate a bit. Obviously making something of the same quality, width and depth as Qt and Gtk is a huge untertaking. But you can make simpler stuff and still learn a lot about how it works. I suggest doing like I did in university. Use OpenGL with Glut. Then you got basic drawing functionality and event system in place already. You then need to create classes for buttons, text fields etc.
If you want to make it really simple then each component just needs to know where it is drawn and have some sort of bounding box where you check whether mouse click are inside or not. You also needs to create some system which makes it possible for buttons, check boxes etc to tell the rest of your code that they were clicked.
This isn't really the rocket science people here make it out to be. Games have made their own very simple GUI toolkits for years. You can try that approach as well. I have modeled a simple GUI tookit on top of a game engine before. Your buttons and textfield could be simply be sprites.
But yeah, if you want to make something that will compete with Gtk+ and Qt, forget about it. That is a team effort over many years.

Is Visual Studio also a good IDE for non .NET languages?

I'm a bit in IDE trouble, and I'm not alone I have noticed, still I haven't found an answer on many of my questions.
I would very much stop using different editors and become very good at one (on windows), adhering the pragmatic adage : "Learn one editor (ide) well". I' m willing to put in a lot of effort, to gain on the long term.
I have programmed (java) with Intellij and Eclipse, and am progamming c# now. (VS08 was at first very disappoing for me, till so at SOF mentioned Resharper and now I'm very happy with it, especially since I started writing macros for further adjustments)
For all purpose editors, VIM and EMACS come to mind, but I'm afraid they just cannot compete against VS08/Resharper when it comes to C#, which I'm using a lot on this moment. Further, it isn't clear to me if they support refactoring (after installing packages for the language in question?)
But since VS08/Resharper is so powerfull for c#, I would like to give VS a serious chance. But for that it should have support for langauges that don't compile to CIL.
hence my question : Is Visual Studio a good tool for non .NET languages?
(and like asked on the side : how about refactoring in VIM/EMACS?)
VS is IMO, better then average editor but not something you can't live without.
If you like your editor to open as fast as Notepad with bunch of features, try EditPlus (on the down side it uses older RegExp implementation but on the plus side it can be made to be portable.
If you would like total extensibility, fast startup, inovative fatures, integrated reposity etc.. try E-Editor, windows port of Mac TextMate.
VIM is ofc superb, but ... long learning curve may be a problem and some people can't find themselves in 2 mode editors.
About Resharper... mhm... almost all of its non-code analytic features may be integrated in mentioned editors. For its suggestive features I doubt there is alternative. I disabled it for the moment because I tend to let Resharper fill in my holes so it can be a double bladed sword - sonner or latter I will totally stop thinking about some things like, can this variable be null or can I move its declaration. I run resharper once I finished some working procedure or at the very end to polish the code.
I personaly use EditPlus for all of the NON MS languages, but E-Editor got my attention recently.
I tend to avoid using IDEs outside of the languages they are designed. A dedicated IDE can include class libraries, function references, code completion utilities, etc. out of the box.
Once you step outside that, however, you have a clunky and resource hungry text-editor. You might as well use a text editor in that case just to keep your workstation nimble.
It might be better not to learn one IDE well, but rather a text editor. I've used jEdit for years for several reasons: It's multiplatform, includes syntax highlighting for lots of languages, and can be feature-extended with plugins. It's become one of my standard tools, but it's only one in the box.
How about VI mode for VS? I think Eclipse has one too.
You'll just have to learn vi-related commands, but will be able to work in, C# (with VS), Java (with Eclipse), C++ (with VS or Eclipse), scripting languages (with vi), ...
"I would very much stop using different editors and become very good at one (on windows),"
Why?
"adhering the pragmatic adage : "Learn one editor (ide) well". " Really? How is this pragmatic?
After 30 years in this business, my lesson learned is "tools come and go."
Once upon a time we had big fights over vi vs emacs. Not vim with syntax coloring, but plain-text-vi on black-and-white monitors.
Why narrow your world to one tool? How will you cope with innovation if your tool is not the new state-of-the-art?
As far as C/C++ goes, Visual Studio is considered the gold standard (well, Visual Studio + VAX if you really want to get specific). It's not perfect, and it's certainly not as good as the C# tools it has, but it's still a damn sight better than anything else out there, on any platform. (Assuming you didn't want C99 support.)
Of course it doesn't really do non-.NET other than those two.
I think that there is good specialization at the moment. VS is the clear candidate for .Net, with Resharper and DevExpress as great augmentation for increased productivity.
Currently we use Aptana for the "Web 2.0" stuff - CSS/jQuery/MooTools, and that has been a great environment as well. I have avoided the Intellisense in VS 08 for jQuery and do prototyping in HTML/CSS/JS in Apatana, then do all the Domain design in VS. Works for us pretty well.
It is good for C/C++ but it is not comparable with what you get for C# or VB.Net ( i don't think it support other languages )
for javascript intelisense is still limited

Easier than Visual Basic 6?

Some years ago I used to program in VB6, I really liked it because it was very simply and fast, when VB.net came out, I abandoned it because they changed a lot of things.
I wonder if after all this years there's a new language or IDE that helps programming in an easier and faster way than VB6.
I'm not very interested in academic/personal issues like, very high performance, great movility through OSs, open source, etc. I would like to know if there's is something to program small and medium desktop apps. in an very easy and fast way.
Excuse me if my english isn't very clear.
Edit answering Nicholas:
Well, I must admit that I didn't try VB.Net too much, I was a little disappointed because I would had to learn a lot of new things and I've had learned VB6 not so long before (in that moment).
VB.Net is the natural progression of VB6, and has a lot of free tools and resources online to get started. Microsoft even provides a free development environment as well as a free database for development/bundling in your applications.
Check out this website for information and download links on all the free Microsoft software.
Also, you said you tried VB.Net and didn't like it-- I'd be curious to know why? Yes, there's a little learning curve, but the abundance of getting started information on the internet surely can help that. I was a bit overwhelmed by .NET at first (particularly ASP.Net) not seeing the value in switching/learning a new language.
I always felt Microsoft Access was far and away the best for this kind of requirement.
edit - I realize this isn't a politically correct answer. But the total package of a built in DB, a great GUI development package, a great report generator (far superior to crystal reports, for example), the easy development of tables and queries, all put in one friendly package, make it nearly trivial to develop with. For rapid development, it's the best I've used.
FWIW, I do Java, C++, C, VB4/6, ASP, JSP, Perl, PHP, CSS/ DHTML, JavaScript, Pascal, Fortran, Kenemy and Kurtz Basic, BAL, unix shell scripting, Oracle, mySql, RPG III, COBOL, some proprietary stuff, various macros, various distributed technology, Job control language, CPL, etc. etc. I got out of developing in Access because of scalability limitations.
Powerbasic may be to your liking -
http://www.powerbasic.com/
One of the easiest languages to learn and use is Python.
FLEX / AS3 / MXML / AIR (tnx le dorfier) comes very close to that VB6 feel from many years ago. But understands stuff like CSS and produces output that works in browsers on any platform (or desktop with AIR). You write code and run it, the coding cycle is very fast. And AS3 is at least as powerful as VB6 ever was, plus there are myriad add-ons and libraries to support all sorts of applications, all the major web-services, database interface, animation, video, 3D, auto-generation of PHP code, etc.etc.etc...
And Flex Builder 3 is free for students and educators.
alt text http://www.infoworld.com/infoworld/img/17TC-adobe-flex-builder.jpg
Python or Ruby.
Dynamic languages has a number of advantages (and disadvantages) but for what you propose they seem perfect.
I would recommend python or ruby bindings of a high level toolkit as a perfect environment. For instance Qt library gives most functionality you would need and dynamic languages let you easy experimentation
Microsoft has a new dialect of BASIC called Small Basic. From the website:
Small Basic is ... a small and easy to learn
programming language in a friendly and
inviting development environment,
Small Basic makes programming a
breeze. ...
Small Basic derives its inspiration
from the original BASIC programming
language, and is based on the
Microsoft .NET platform. It is really
small with just 15 keywords ...
The Small Basic development
environment ...provides
powerful modern environment features
like Intellisenseâ„¢ ...
The first two versions of VB.NET had serious shortcomings compared to Visual Basic 6. However most of these issues has been fixed since Visual Studio 2005. Today, for new projects, I feel that everything that made VB6 so easy to use is available with VB.NET plus you get new language constructs, and the .NET framework. There also refactoring, and the VB Power Pak which brings back the older simple to use print engine.
Of course there is a learning curve involved. But no more than the leap from QuickBASIC/PDS to VB 1. If you have to maintain or transfer an older project then the differences between VB6 and VB.NET are much more serious.
Finally there is the Mono Project which support the VB compiler. This provides a degree of relative immunity from Microsoft deciding to break backwards again.
You could try FreeBASIC.
It's syntax is very similar to that of VB and it is an actively worked on open-source project, it is also portable across different platforms.
You can grab a download here and there are several exemplary works that can be found here.
If it already wasn't done I'd recommend python. It's one of the easiest languages to learn.
My first language was Pascal and I think it's also one of the easiest languages and with Delphi getting popular again I think it's a very good alternative to VB6.
I've always found Delphi to be easier than VB despite popular belief.
take a look at Lua
very small core language, the whole documentation is a single (very readable) webpage. you can easily learn the basics in a weekend.
very good (small) books with good tips.
very helpful community.
very fast, both with the standard bytecode VM, and the JIT.
used a lot in games, both because it's fast and easy to embed in the application, and because it's easy to explain to players interested in extending the game.
readable sources.
MIT license, use for whatever you like, no strings attached.
Perhaps Clarion is what you're looking for? Personally, I don't have much experience with it, but you can build some nice apps with virtually no coding skills.
I think C# is a very good language to program GUI apps quick and easy.
While this might not be a complete answer to your question, I would recommend spending some time learning a more complex language (Objective-C, Java, C#, etc). With the experience you learn with OOP design patters etc, in the future you won't have to shop around for the "easiest" language to program with.
visual basic.NET is much more easier and have complete features than VB6 as I've experienced.
I recently messed around with Microsoft Lightswitch and found it extremely VB like. Very fast for binding to a database and generating forms, grids, etc.
More than 10 years after this question was asked, the best answer is...
...to continue using the VB6 programming language.
VB6 still works on Windows 10 and Windows Server 2019. Just as it has since Windows 98.
Microsoft's support policy for VB6 is here VB6 support policy

Developer Setup for Starting Out with Cocoa/Mac Programming

I'd like to start experimenting with Cocoa and programming for Mac OSX. I'm not terribly concerned with Objective C syntax/constructs/bheaviors at this point, but more curious as to an efficient setup on in terms of an editor and/or IDE that will get me going quickly. Is there any IDE even remotely similar to Visual Studio (since that's where I've spent most of my time over the last 7 years) in terms of it's solution/project concept? Any other tools, tips, suggestions and/or resources to get up and experimenting quickly?
I'd like to avoid a lot of the intro stuff and get into things like "If you want to create an Mac desktop application, you can use Acme IDE and set up your project like this."
I was afraid Xcode was going to be the answer! :P I tried playing around with that -- literally just getting it off the DVD and just diving in with no idea what to expect (before I even knew that you used Objective C as the language). I figured, the wise guy that I am, that I could just sort of fumble around and get a simple app working ... wrong.
#Andrew - Thanks for the insight on those config settings. Based on my Xcode first impression, I think those may help.
I'd suggest you pick a fun little product and dive in. If you're looking for a book I'd suggest Cocoa Programming for Max OSX which is a very good introduction both to Objective-C and Cocoa.
XCode is pretty much the de facto IDE and free with OSX. It should be on your original install DVD. It's good but not as good as Visual Studio (sorry, it's really not).
As a long-time VS user I found the default XCode config a little odd and hard to adjust to, particularly the way a new floating window would open for every sourcefile. Some tweaks I found particularly helpful;
Settings/General -> All-In-One (unifies editor/debugger window)
Settings/General -> Open counterparts in same editor (single-window edit)
Settings/Debugging - "In Editor Debugger Controls"
Settings/Debugging - "Auto Clear Debug Console"
Settings/Key-binding - lots of binding to match VS (Ctrl+F5/Shift+F5,Shift+Home, Shift+End etc)
I find the debugger has some annoying issues such as breakpoints not correctly mapping to lines and exceptions aren't immediately trapped by the debugger. Nothing deal-breaking but a bit cumbersome.
I would recommend that you make use of the new property syntax that was introduced for Objective-C 2.0. They make for a heck of a lot less typing in many many places. They're limited to OSX 10.5 only though (yeah, language features are tied to OS versions which is a bit odd).
Also don't be fooled into downplaying the differences between C/C++ and Objective-C. They're very much related but ARE different languages. Try and start Objective-C without thinking about how you'd do X,Y,Z in C/C++. It'll make it a lot easier.
The first document to read and digest is the Mem management guide, understand this before moving on. This is a great guide to objective-c too. Infact the developer site at Apple is very good - but you would probably want to read the Hillegas book first.
In regards to Xcode vs Visual Studio - they are different. I wouldn't say one is better than the other - Windows developers come over from VS and expect it to be the same. This is just an arrogant attitude and please don't fall into this crowd. Having used VS since the AppStudio days and Xcode for a year or so now, both have strengths and weaknesses. Xcode is something that out of the box (and especially when coming from VS) doesn't seem that good, but once you start using and understanding it - it becomes very powerful.
Also, there are a lot more tools included with Xcode et al, such as Instruments and Shark that you simply can't get with VS, unless you open your wallet, and even then IMHO aren't as good.
Anyway, good luck. I still enjoy C#, but Objective-C/Cocoa somehow makes programming fun again once you get into it...
Don't bother digging up your OSX DVD as they've released a new version (3.1) of XCode since then.
First, you'll want to join Apple Developer Connection (it's free, and you need it to access their version of MSDN) - it uses your Apple ID so if you've ever had one for the itunes store etc, it's that same username/password
Once you've done that, click on downloads, then click on developer tools, to view this page, and go for the XCode 3.1 Developer DVD
One other suggestion: If you have feature or enhancement requests, or bugs that you've run into, be sure to file them at Apple's Bug Reporter. It's the best way for developers to communicate their needs to Apple, because every issue is tracked through the system.
You might try the demo of textmate and see how you like it for working with objective-c or any other type of text really. It will import xcode project settings so you can still compile and run from textmate rather than having to go back to xcode.
Xcode is the standard for editing source files, though you can use another editor in conjunction with the command line xcodebuild tool if you really want. I used Vim for all my Cocoa editing before finally giving in to Xcode. It's not the greatest IDE in the world, but it gets the job done, and the recent 3.x releases have had some nice improvements.
The real power tool of Cocoa development is Interface Builder. IB does not generate source code like many UI tools. Instead it manipulates real Cocoa views, controls, and objects which it then bundles into an archive (nib) that is loaded by your program at runtime. Most Cocoa programs use at least one nib file, and often many more.
No matter what IDE/editor combination you choose for hacking on source files, I recommend using IB where you can. Even if you're not a fan of other UI layout/generation tools, I suggest keeping an open mind, giving "the Cocoa way" a chance and at least learning what Interface Builder can do for your development process.
AFAIK, pretty much every OS X developer uses Xcode.
That, and Interface Builder for creating the GUIs.
FWIW, try to get hold of a copy of Hillegas's book, as it's a great introductory tutorial, and the reference Docs Apple provides really aren't. (They are generally very good reference docs, however).
Cocoa is huge. The hardest part of learning how to write apps on Mac is learning Cocoa. By the way. You do not need to know ObjC (though it helps tons). You can write Cocoa apps with Python or Ruby (right in the IDE).
I agree VS is a better IDE then Xcode. But if you throw in Interface Builder and all the other tools, I'm not so sure. Mac development is not about 1 giant IDE for everything. But VS is "kinder" on the developer then Xcode is.
Also if you want to do cross platform apps look at RealBasic. A fine tool (Basic though. But it runs on Linux too.) You'd be surprised how many Mac apps are written with RB.
I've heard the books currently out there are pretty out of date. The whole ecosystem seems to evolve very fast with dramatic changes made in every OS release.
He wrote a tutorial which pulls together some Apple documentation and other tutorials which should get you started. I think it covers the basics of using the IDE, writing simple apps, and then goes on to more advanced stuff.
I've been dabbling in Cocoa for the past couple years, and recently picked up Fritz Anderson's "Xcode 3 Unleashed." Highly recommended for getting into Xcode — especially with some of the big changes 3.0/Leopard brought.
Don't forget Hillegass' defacto Cocoa bible, "Cocoa Programming for Mac OS X - Third Edition."
#peter I don't know why you had trouble with getting a simple app working, right off the bat without doing anything your app gets a lot of benefits from the Cocoa framework. If you mean you were trying to do stuff like connect a button to an action and have it print a alert on screen or something like that then yes I could see where your going with it being difficult.
The problem for me starting with Cocoa many years back is that it was so different from anything else that it had a little bit of a learning curve. Whereas many other systems are compile time oriented Cocoa is very dynamic and runtime oriented. Once you get past learning how actions hook up to classes it just becomes a matter of learning how the Cocoa frameworks work.

Resources