0

I am currently in the end stages of development of a console program in C++. The issue I am having is my program requires that the user be able indicate where they want to perform function on a large, dynamic grid (aprox 50x50). The console implementation I have designed is very clunky, and difficult to use. It would also be nice for the user if I had a drop down box or similar functionality for IO.

It was recommended to me that I design the front end in C# or HTML5. I have limited, basic experience with C#, and no experience with HTML5. I am also still relatively new to C++. I would appreciate being pointed in the right direction.

  • 4
    That is very difficult to answer without knowing what kind of API your program provides. Can you issue commands to it or can you use headers and just build a GUI on top of it? – pmr Aug 20 '12 at 07:51
  • I don't completely understand what you mean, but yes, I can just issue commands to it. For example, it is set up so I can go `User("name")` `Object.getUser()`. How would I build a GUI on top of it? –  Aug 20 '12 at 15:11

3 Answers3

1

If your program is written in a style like most source code management systems, your front-end can use the system function or process pipelines (alternatively good old popen) to issue commands and deal with them. If you cannot do something like this you can have a look at your code and check out how tied the actual logic is with the representation of things on the command line. If it deeply tied together (e.g. your compute() function pads strings to the correct length for printing), you need to refactor. If it isn't your probably can just build a GUI with any GUI tool-kit on top of the already existing code.

Community
  • 1
  • 1
pmr
  • 58,701
  • 10
  • 113
  • 156
  • It isn't tied together like that at all. Do you think you could point me in the right direction for more information on the `system` function or process pipelines? And would C# be a good choice to interact with the C++? –  Aug 20 '12 at 17:40
  • @Kyryx My only experience with GUI Toolkits is `Qt` which I was quite happy with for basic stuff like your example. I added links for your other requests. – pmr Aug 20 '12 at 20:49
0

I will recommend you simple GUI. Creating GUI in the QT is very easy, there is a lot of basic tutorials. after download and install : http://qt.nokia.com/products/ there is directory called "example".

Other solution for me is another application which will save data in some reasonable format like .xml and there you can load it in your program like ./MyComplicatedApplication MyData.xml

I would not mess up with C#, why two different languages? It will be harder in the maintenance. Be aware that writing GUI in the QT is not really harder than in C# and it will be cross-platform code.

CyberGuy
  • 2,783
  • 1
  • 21
  • 31
  • The reason I initially chose C# was because I don't really care about being cross platform. This program is designed as a utility application on Windows. –  Aug 20 '12 at 15:18
0

You could use a DataGridView in managed C++, the .NET API it's identical (for practical purpose) among languages. DataGridView exposes a large array of methods/objects, just because it's a very useful/used interface. So you could find it somewhat difficult, but the basic usage can be very simple.

CapelliC
  • 59,646
  • 5
  • 47
  • 90