|
-
July 23rd, 2003, 11:18 AM
#1
Simple Box and storing contents...
Hey again guys. I'm editing an exisiting program and all is well (for an overview, visit this thread:: http://www.codeguru.com/forum/showth...hreadid=254783 )
Anyway, I want to add an option to change the TIME INTERVAL so that the save function in the thread posted saves at the time entered by the user . Like for example:
let's say that the user clicks on File --> Set Time Interval and then a box appears so that the user can enter the time interval (let's say 5 seconds, 10 seconds, etc...)
Now, How do I do that? I already edited the resources and stuff so the Set Time Interval already appears in the program (of course it does nothing! ).
^
|
Question: How do I create an input box that stores only numbers?
Now, when I get this number, I want to be able to use it in the function on the thread link mentioned before and use the number as a timer for the StartSave function, how do I do this?
Any help will be great! I think it's not difficult for most of you guys cause you guys seems to know a lot.!
-
July 23rd, 2003, 11:27 AM
#2
In the resource editor, click on the edit and open the styles tab. There is a style "number", click it! You also can set this style programmatically, but it's generally easier to do it in the resource editor.
You may want to consider using a different control like a spinner, dropdown combo or even a slider bar. With any of these you have the built in capability to "enforce" min/max values, formating and some visual appeal.
As for updating the thread, there are several methods, but generally, set a semaphore around the save interval var, get it when you want to update or access. and release when done. (Sketchy, sorry).
bytz
--This signature left intentionally blank--
-
July 23rd, 2003, 11:35 AM
#3
I think that was a very good post but .... I'm a newbie so I didn't understand most of what you just posted.
I did check the number style in the resource area though.
Now I don't even know how to make a simple dialog box like that so that the user enters their number selection so I think that a: "a spinner, dropdown combo or even a slider bar" is going to be even more difficult for me but if you have links or something, you can throw them at me for me to read!
-
July 23rd, 2003, 11:43 AM
#4
You're really asking how to program for Windows. Take yourself down to a good local bookshop and browse through the MFC programming books. It's usually the quickest route.
-
July 23rd, 2003, 11:53 AM
#5
Well.. where I live we don't have local bookstores like that and the ones that are there doesn't offer a great programming selection . The nearest "good" bookstore is like an 1hr and a half (yes ... it sucks.!). But I think this fall I will buy a lot of books because I only have 3 classes next semester!
-
July 23rd, 2003, 12:00 PM
#6
Well, if you want to order one from Amazon, the one I'd recommend for a beginner is called "Beginning Visual C++" by Ivor Horton. Good luck.
-
July 23rd, 2003, 02:16 PM
#7
Well, I'll look into that later but if right now someone can help me, that would be best!!!
-
July 24th, 2003, 09:47 AM
#8
Well guys, haven't found anything good yet.
-
July 24th, 2003, 10:48 AM
#9
Let's try this slowly... if you have an edit box you are most likely are either creating it on a window (like CMyView) or on a dialog. From your comments about resources, I assumed that you were showing a dialog to change the interval, if that's not the case, you should look at the Create method for CEdit, in the styles or in ES_NUMBER to the current styles.
As for the other controls (dropdown, spinner, slider, etc), no, they are not significantly harder to use than an edit, besides "the jorney is the reward!" It would hurt to try something new!
When you are on the www.codeguru.com home page, there are a number of article sections on the left under the discussion board... you should browse through and read them (pick and choice, based on your desire for knowledge and needs). Also Codeproject has a number of begininng articles. Most if not all of these articles have attached sample code. There are other sites that you can find on the web that discuss begining windows programming.
Good Luck.
bytz
--This signature left intentionally blank--
-
July 24th, 2003, 11:49 AM
#10
Let's try this slowly... if you have an edit box you are most likely are either creating it on a window (like CMyView) or on a dialog.
No. I don't even have an edit box (I haven't created it yet!).
I'll look through the articles and see what I can find! 
Thanks.
-
July 24th, 2003, 12:23 PM
#11
In response to selecting the File/Set time menu (although, I would tend to put this menu option under something other than File), you'll probably want to create a dialog that the user can adjust the interval on. To do this, click on the resource tab in VS, and right click to add a dialog. You should now have a blank dialog to work with. If you add an edit box to it and rightclick & select properties, you'll notice that one of the check boxes is Number. You could very easily add a slider or spin control as well. Double clicking on the dialog should invoke the Class wizard and that will generate skeleton code for you to fill in.
bytz
--This signature left intentionally blank--
-
July 24th, 2003, 08:59 PM
#12
I will get into this tommorow!
Thanks for the tip!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|