Thread: Application Design Help Needed?

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    2

    Application Design Help Needed?

    Hey everyone,

    I'm new to the CBoard. When I was in college I took a course on C and on C ++. I have recently been confronted about converting / recreating an existing what we believe was written in "clairion" to be able to run on a windows based machine or alternatevily linux. Myself I believe in order to have a multi-platform application, it will either need to be written in C or C++. Visual Basic up until this point was my primary language. I'm a little rusty on what I need to do to even create the initial interface with this project.

    I've attached a screenshot of the original program. I need to be able to do something like that.

    When I select on Customers and hit enter it goes to the customer screen and so forth.

    Another minor concern of mine was the ability to enhance by adding graphics and possibilty of mouse control within it the program.

    Any Help or advice with this will be greatly appreciated. Thanks and hope to talk to u soon.

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    You can create a program that looks like that in either Windows graphics mode, or in Windows console mode. Both modes may include different background and foreground colors, but your choices for colors are much less in console mode. Both modes can include mouse support.

    Usually you have the main() function call the menu() function, and then the other functions are called from that menu() function.

    If you want to jump into the world of Windows graphical programming, then use that mode, if not, you can use the console (text based) mode.

    ifdef's are used at the beginning of the program, to allow it to run on either a Linux or Windows, computer.

    The choices are entirely up to you, and yes, either C or C++ will handle this, nicely. Again, it's your choice.

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    2
    Ive downloaded the program Code:Blocks 8.02, how would I create a application using the windows graphic mode?

    Right now I'm testing my code from a console application... And which option brings the most simplicity to the programmer to design a app such as the one I'm inquiring about?

    Would it be possible to help me with the syntax that creates a menu, hit <enter> on desired menu option, then it goes to next menu and so on?

    (Basically the syntax to call the menu() function from the main() function would really help)

    Once Again Thanks for the help

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by neumee View Post
    Ive downloaded the program Code:Blocks 8.02, how would I create a application using the windows graphic mode?

    Right now I'm testing my code from a console application... And which option brings the most simplicity to the programmer to design a app such as the one I'm inquiring about?

    Would it be possible to help me with the syntax that creates a menu, hit <enter> on desired menu option, then it goes to next menu and so on?

    (Basically the syntax to call the menu() function from the main() function would really help)

    Once Again Thanks for the help
    Code:
    //all functions' prototypes
    int invoices(void);
    int unpaidInvoices(void);
    int menu(void);
    void printHeader(void);
    void printMain(void);
    
    //etc., one prototype for each function except main
    
    int main(void)   {
       menu();
       //maybe some code here
       return 0;    //indicates normal termination of program
    }
    
    int menu(void)   {
       char choice;
       do   {
          //this is the main menu function that you program will always loop back to after  
          //every selection the user makes.   
    
          system("cls");
          printHeader();
          printMain();
       
          //you get the user's choice, which may be based on the mouse position when it's    
          //clicked, or the cursor's position when you hit enter on the keyboard, or
          //perhaps just a letter or number the user enters: that's all up to you.
    
          choice = tolower(choice);
          switch(choice)   {
             case 'i': invoices(); break;
             case 'u': unpaidInvoices(); break;
             //all your other cases go here, each followed by a break statement.
    
             default: printf("That choice is not available, please choose again");
          }
       }while(choice != 'q');
    
       return 0;
    }
    If you don't know how to code the "get choice" part of it, I'd get a small code snippet or program from a code depot site and use it as a template. I program almost entirely in console mode and do it like this:

    Main Menu

    Invoice
    Unpaid Invoices
    etc.

    Cursor goes to a fixed spot on the menu screen using gotoxy(x, y). Then
    Enter Your Choice: <<this is the fixed spot>>

    User enters their choice of letter. Frequently, I'll highlight the first letter of each word choice, so it's easy for them to see what they want (yellow or Cyan shows up well).

    If there are many entries, I'll do it this way:

    1) Invoice
    2) Unpaid Invoices
    etc.

    Enter Your Numbered Selection: <<this is the fixed spot>>

    User enters a number, instead of a letter.

    Note:

    This is a large program that you've decided to write up. If you don't know how to even call a function, this program is out of your programming league, atm. If you don't REALLY want to work your buttinski off learning all this, I'd recommend going to Rent-A-Coder and negotiating for a coder to write it, for you. (Don't give them more $$$ than they've earned in code that you can run and see it's correct, at any time. That's true with all contractors in general.)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Changing focus in an MFC Application
    By rangalo in forum Windows Programming
    Replies: 2
    Last Post: 06-20-2005, 06:21 AM
  2. MFC run application by clicking on file...
    By dug in forum Windows Programming
    Replies: 4
    Last Post: 12-02-2004, 04:33 AM
  3. Cprog tutorial: Design Patterns
    By maes in forum C++ Programming
    Replies: 7
    Last Post: 10-11-2004, 01:41 AM
  4. application design
    By codec in forum C++ Programming
    Replies: 2
    Last Post: 05-25-2004, 03:30 AM