Text fields using C++

Started by
10 comments, last by deepdene 19 years, 1 month ago
Hello again gentlemen, patrons, and developers. I have yet another problem to share with you. I've successfully implemented saving and loading in my program, and now I want to allow files to be loaded and saved using more than one file name. I need to know two things: 1: What command is available to obtain information pertaining to the files in a directory? 2: How can I implement a graphical text-field for inputting filenames? All I know is cin, which uses the console. Thank you very much for your time. Edit: Sorry everyone - To make things clearer, I'm using the SDL API.
Advertisement
2 questions
1. how long have you been programming

2. can you use plain english?

assuming you have just finished fstream.h, you have a ways ahead of you before you will be on graphics.
Pertaining to the first question, use FindFirstFile.
To do text fields, you're going to need to use another library, learn Win32 or something similar.
Quote:Original post by Nahrix
Hello again gentlemen, patrons, and developers. I have yet another problem to share with you. I've successfully implemented saving and loading in my program, and now I want to allow files to be loaded and saved using more than one file name. I need to know two things:

1: What command is available to obtain information pertaining to the files in a directory?

2: How can I implement a graphical text-field for inputting filenames? All I know is cin, which uses the console.

Thank you very much for your time.


1. That's operating system-specific, to the best of my knowledge. Apparently it's getting rolled into C++0x though. In the meantime, consult POSIX and the MS knowledge base for OS-dependent crap.

2. That's also operating system-specific. What GUI API are you using? I recommend FLTK, though I suppose Win32 is fine.
Quote:Original post by game mercenary
2 questions
1. how long have you been programming

2. can you use plain english?

assuming you have just finished fstream.h, you have a ways ahead of you before you will be on graphics.


I'm not sure I understand the nature of your reply - be it serious or sarcastic. Nonetheless, I will attempt to explain my situation further.

1: I have been programming since I was three. Specifically, though, I have been programming C++ since I was eighteen. I am twenty-one now. As well, I am in the middle of a somewhat-complicated 2D simulation using the SDL API. I'm capable of grasping the basics of graphical programming by now, but I am no expert.

2: I have used cin in text-based programs to obtain C-style strings from the user. What I need now is the equvilant of Java's textfield, since I'm running a win32 window instead of a console. As well, I need to obtain a list of files in a directory, perhaps in array or vector format, to list the available map files which can be loaded.

Edit: I would like to appologise if I'm not making enough sense. My knowledge of graphical API's are limited to the basics of SDL, and I'm using what information I have to explain my situation to the best of my ability. Please excuse any explanation that doesn't use proper terminology.
my bad, I mistook you for a beginner, heh.... you are more experienced than me
Quote:assuming you have just finished fstream.h, you have a ways ahead of you before you will be on graphics.


Givin his journal, I don't think this will be a problem.

Nahrix, if your using SDL, you probably will still be able to use Win32 API functions. Try MSDN and see If you can find any info on text fields. There is also a windows programming site that has some good info. I'll look it up and see if the site has anything.

Hope this helps.
-----------------------------Play Stompy's Revenge! Now!
Here are some good windows tutorials that have info on making a save/load window and such.
-----------------------------Play Stompy's Revenge! Now!
Does the win32 API need any sort of library implementation equivilant to SDL, or is it out-of-the-box with Visual Studio 6?
I don't believe you need any additional lib files to use the functions.
-----------------------------Play Stompy's Revenge! Now!

This topic is closed to new replies.

Advertisement