Thread: Challenge to write a program

  1. #31
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Oh gawd... when will you understand that none of us without lots of research know how to write your button for you? Why in the world should anyone here go out of their way to research and relearn an outdated way of programming that very few people use anymore just so you can copy it and turn it in for homework? ESPECIALLY when all you do is insult us and treat us as though we are a bunch of jerks who take great pleasure in withholding information from newbies who are just asking questions?

    We're sorry that you have a crappy teacher, but I'm beginning to think that if you treat him the way you treat us, then I'm sure he's done everything he can to help you and you probably just jumped all over him because he didn't write all your programs for you.

    So for the last time, we don't know how to make your button. Lots of information has been given in this thread (especially the functions WaltP gave) that will lead you in the right direction. Play around with them, search the internet about them, whatever. But if you start to understand them then I guarantee you'll be able to write your program.

  2. #32
    Normal vector Carlos's Avatar
    Join Date
    Sep 2001
    Location
    Budapest
    Posts
    463
    Amen!

  3. #33
    Registered User
    Join Date
    May 2003
    Posts
    21
    PJYelton... i get the fact that you cant help me i got that ages ago, and thats not an insult to you ok.

    this post got moved to the DOS programming forum so that maybe someone who is into DOS programming will be able to help me out.

    and i do not STEAL any codes to use in assignments, thats just not right, its cheating yourself and i dont like cheats.

    attached is one of two hand outs that we were given. they are just .cpp files that were printed out for us to copy. maybe then you'll get what i mean about our teacher. buttexmp.cpp is a banner and 3 buttons. decoptsc.cpp is a decimal to hex and oct convertor. (i'll put the other atachment in a diff post)

    if someone could make head or tail of them, especially the button bits, coz ive tried believe me

    and as for insults, im sorry, i could do worse , but you dont get how stressful this has all been.

    im not askin anyone to to any research at all, i'm just askin if someone happens to know how to do what i'd like to know to do could u let me know.

    and for the last time i have been searching on the internet... i've not stopped lookin actually since we was given the task

    i really feel like breaking down in tears at the moment but i refuse to
    * Curiouser & Curiouser *

  4. #34
    Registered User
    Join Date
    May 2003
    Posts
    21
    other attachment
    * Curiouser & Curiouser *

  5. #35
    Open to suggestions Brighteyes's Avatar
    Join Date
    Mar 2003
    Posts
    204
    >and who said i am starting programming? i have been doing it since september...
    Less than a year is the same thing as 'just started' in my opinion.

    >if someone could make head or tail of them, especially the button bits, coz ive tried believe me
    I understood it. It simply draws a button and handles button features manually. Have you tried walking through this code in a debugger to see exactly how it does this?

    >but you dont get how stressful this has all been
    To be perfectly frank, we don't care how stressful your life is. We volunteer our knowledge and help, so we at least expect courtesy in return. If we aren't treated well, we withhold help and you get nothing but stony silence or flames.
    p.s. What the alphabet would look like without q and r.

  6. #36
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Ummm... that code you gave us is actually a hell of a lot better than what you would likely get from any of us. Its commented and very direct. Why can't you use his code to play around with? Anything anybody else who writes for you would just use the exact same code. You keep asking for people to give you code but you've had the code all the time. Like Brighteyes said, go through it line by line, changing things, seeing what happens, exactly what you've wanted all along except that its your tutors code and not ours.

  7. #37
    Registered User
    Join Date
    May 2003
    Posts
    21
    where would i get a debugger then? coz i tried takein out just the bits of code to draw a simple banner box and i cant get the fill bit right

    that was a bit harsh bright eyes, surely everyone has stressful days at work or uni or just generally in their life? i'm sure there are times when u personaly feel so run down u cant think straight?

    the comments are not very helpful to me tho. theres too much code to go throught it bit by bit and change each piece.

    i tried to cut out just the button bits, and it jsut doesnt want to play at all.
    * Curiouser & Curiouser *

  8. #38
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164
    I'm going to be honest with you, Twisted. If you have never been taught how to use the graphics your instructor wants you to use, and he gave no examples that you can type in and execute, he's not much of an instructor. If he DID give you examples, YOU need to type them in to understand what's happening, and change them to see how the parameters change what each function does.

    As far as a drop-down box, I've seen them programmed, but I've never made one. I believe it requires defining windows on top of the current window so you can control the scrolling.

    Now to draw a button,
    Code:
    1) define the upper left and lower right screen coordinates (x1,y1) & (x2,y2) of the button
    2) load the coordinates into a polygram structure as defined by the fillpoly() function
    3) Set the color to your button
    4) call the fillpoly() function
    5) Adding a 3d effect like I did on bombsearch reqires additional lines of different 
       colors be draw across the edges from 
          (x1,y1) to (x1,y2)  in color 1
          (x1,y2) to (x2,y2)   in color 1
          (x2,y2) to (x2,y1)   in color 2
          (x2,y1) to (x1,y1)   in color 2
       with the line() function.  Switch the line colors to get the pressed effect.
    6) write the caption on the button using 
        settextstyle()
        settextjustify()
        setcolor()
        outtextxy()
    
    That's the basic idea I used, and I did it after years of programming experience. I didn't do anything this complicated my first year. To be honest, my first year, graphics were barely invented :-)

    HTH
    Walt

  9. #39
    Registered User
    Join Date
    May 2003
    Posts
    21
    that helped quite a bit there WaltP, just not to sure on the
    fillpolly(); function, im used to using drawbox();

    as ive not used the fillpolly(); could u explain what it does please?

    and ive attached the source code of some boxes i drew using ur idea with the diff lines on the bottom and right hand side to make it look more 3D, thought it looked pretty cool! (not got onto the depressing buttons yet, one step at a time!)

    one problem at the mo... it seems to fill the whoooole screen grey(light grey i think) after my little splash screen thingy, but i dont know why its doin it!

    (i know its called button instead of box,oops! got all excited when it worked gave it the wrong title!)
    * Curiouser & Curiouser *

  10. #40
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164
    Originally posted by Twisted.alice
    that helped quite a bit there WaltP, just not to sure on the
    fillpolly(); function, im used to using drawbox();

    as ive not used the fillpolly(); could u explain what it does please?
    If draws and fills a polygon based on the parameters given as per step 2. You need to look it up and learn how to use it.

  11. #41
    Registered User
    Join Date
    May 2003
    Posts
    21
    I think i found a thing about it, kinda understand it, but it was used to draw a strange shape thing, so i think i'd be best to stick to the drawbox coz i think i understand that...

    but i'm sure i'll need the poly functions if i wana draw a triangle

    but as to why the screen 'background' goes gray after my splash screen function, i have no clue!
    * Curiouser & Curiouser *

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 01-01-2007, 07:36 AM
  2. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  3. Hints to write a program
    By Bnchs400 in forum C++ Programming
    Replies: 28
    Last Post: 04-05-2006, 05:35 AM
  4. Can I write & read file in same program?
    By chad03 in forum C Programming
    Replies: 2
    Last Post: 08-04-2003, 08:39 AM