![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Professional Programmer
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2
![]() |
console app with wxWidgets
Hey!
Well, i've decided the best way to learn wxWidgets is to write a test application. So i've decided to write a console app... Not quite sure what i'm gonna do next, but this is how far i've gotten: Might add functionality so the user can type commands in and get something out... I don't know? Any suggestions as to what I should put in? Make my life hard! ![]() I probably wont keep this up for long, but who knows! Good practice!!! ![]() |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
What do you mean by "console app", do you mean you wish to make a Terminal Emulator? I have thought about making one, but I have never been able to figure out/find all the documentation for terminal control codes.
Here is a goal for you: * Be able to start and talk to a simple C/C++ application that takes input from stdin and prints stuff to stdout. * Be able to run a curses based application
__________________
Robotics @ Maryland AUV Team - Software Lead |
|
|
|
|
|
#3 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
Basically copy Terminal.app or Gnome Terminal but be cross platform with wxWidgets.
__________________
Robotics @ Maryland AUV Team - Software Lead |
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Terminal codes used to vary widely, though there were a number of standard ones. Once terminals were built to respond to escape sequences, things became much more standardized. If you can find the information behind the old ANSI.SYS, you'll probably be in tall cotton.
Otherwise, building a shell isn't really that difficult. You can build in some commands and handle others by launching appropriate executables. Giving it the ability to pipe will be dependent upon the underlying OS, though, generally.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
Professional Programmer
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2
![]() |
Thanks guys! Will start working on this! Be slow going since i'm doing R&D for a feature film at the moment! Gonna be a giant pain in the ass!
Will post as soon as I have something more to show! ![]() |
|
|
|
|
|
#6 |
|
Caffeinated Neural Net
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 929
Rep Power: 4
![]() |
@Game_Ender: To expand on DaWei's post, if you're looking for ANSI escape sequences, google for NNANSI. It's an old DOS replacement for ANSI.SYS, and included in the documentation is a list of codes. If you can't find it, I have the list kicking around somewhere, I believe.
I also might have a list of VT52 codes as well, but no guarantees there.
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp |
|
|
|
|
|
#7 |
|
Professional Programmer
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2
![]() |
Coolio!
Just been looking at it, it's gonna be hard since i have no experience with widgets... Need to read up event stuff etc But the sample apps included are helpful! ![]() |
|
|
|
|
|
#8 |
|
Professional Programmer
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2
![]() |
Well, been dicking around with wxKeyEvent and wxTextCtrl...
So far just doing simple tests, got a rudimentary "expression" evaluator up and running, its just plain silly, but just testing you know! It works something like: void MainFrame::OnKey(wxKeyEvent &event)
{
char ch = event.GetKeyCode();
switch(ch)
{
case WXK_RETURN:
{
command.Eval();
textCtrl->Append("\n"); //move to newline
return;
}
}
//append the char input to command and textCtrl
command.Append(ch);
textCtrl->Append(ch);
}Where command is a class type Command, which reads in a command string "expression string" and parses it on request (Command::Eval()) - which then performs the appropriate action... But it works at least! So, I'm now trying to figure out how to get the prompt line, still trying to find out how to start std input into the textCtrl... Anyways, back to this! I've already learnt quite a bit about wxWidgets thus far! ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| wxWidgets problem | rwm | C++ | 6 | May 28th, 2007 10:03 AM |
| Making a C app run without a console | ibbrowne3 | C | 7 | Nov 21st, 2006 12:40 PM |
| Manipulating the console using Windows API | rup | C++ | 2 | Nov 17th, 2006 1:04 PM |
| The Black Art of Video Game Console Design | lostcauz | Book Reviews | 0 | Apr 26th, 2006 7:31 PM |
| console output | matko | C++ | 10 | Sep 26th, 2005 2:14 PM |