Thread: How to draw a chart like spreadsheet in C

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    85

    Question How to draw a chart like spreadsheet in C

    Hi people,
    I try to create a Inventory program in C with
    final output display in a chart like below:
    ___________________________________________
    | Stock Name | StockID | Price | Quantity |
    ------------------------------------------
    | Shampoo | SP999 | 3.75 | 100 |
    -------------------------------------------
    | Candy | CD3333 | 0.20 | 400 |
    -------------------------------------------
    | | | | |
    -------------------------------------------
    | | | | |
    -------------------------------------------

    What graphic functions I can use to make a perfect
    drawing the chart(not broken lines as above)?
    Can I use the functions like: drawline(), drawrectangle(), or gotoxy()..etc.
    in order to make to draw the chart perfectly?

    I really appreciate your help or your idea.
    DV007
    Last edited by dv007; 05-29-2002 at 02:04 PM.

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    I have a program the Borland made called TCalc that was like a spreadsheet program - it's a perfect example and should answer a lot of questions - I have the source code edition. I'll ZIP it and post it here tomorrow, but I've gotta run - so I can help you tomorrow, but it least you know theres hope.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    85
    Thanks for a clue, Sean. Talk with ya tomorrow.

    DV007
    /****************************************
    * SWYM = MWYS *
    * Say What You Mean. Mean What You Say. *
    ****************************************

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Hope this helps. the .prj only works on Borland Turbo C++ 3.0 for DOS, but it's only an organization thing - it's not any of the source code. I hope you have WinZIP because this is zipped with that, and the doc is for Windows other than that, just start with tcacl.c, and you should be able to figure it out from there.

  5. #5
    Registered User red_baron's Avatar
    Join Date
    May 2002
    Posts
    274
    maybe this might help
    http://www.cprogramming.com/cboard/s...threadid=18827
    go to the bottom of the page i posted my table creating function.
    ¿Red Baron?

    "Imagination is more important than knowledge"
    -Albert Einstein (1879-1955)

    Check out my games!

    [code] /* dont forget code tags! */ [/code]

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Let me know if that works. I tried compiling it and it just came up with errors one every line.

  7. #7
    Registered User
    Join Date
    May 2002
    Posts
    85
    Yup Sean, I got a lot of errors when I compiled it. I have traced all source code and it looks
    fine to me. But when I compiled with Borland C/C++
    v5.1 compiler, it showed many errors. By using it
    as reference, I have been trying to write my own code. I still working on this program.
    Thank you anyway.
    DV007

  8. #8
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    I'd like to see it. Email it to me when you're finished.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Which is the better way to draw?
    By g4j31a5 in forum Game Programming
    Replies: 16
    Last Post: 01-22-2007, 11:56 PM
  2. draw function HELP!!!
    By sunoflight77 in forum C++ Programming
    Replies: 1
    Last Post: 05-10-2005, 11:28 PM
  3. How to draw Excel horizontal bar chart?
    By CLearner in forum C Programming
    Replies: 2
    Last Post: 11-09-2004, 11:16 PM
  4. ray casting
    By lambs4 in forum Game Programming
    Replies: 62
    Last Post: 01-09-2003, 06:57 PM
  5. Draw Shapes.
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 08-19-2002, 09:22 AM