• What Do You Need Help With? V6
    7,544 replies, posted
[QUOTE=mobrockers2;40332213]What is your problem with including? That's what is for.[/QUOTE] Wouldn't it make my project look a bit messy if I was including classes completely unrelated to the class I'm working on except for one function in it?
[QUOTE=Meatpuppet;40332243]Wouldn't it make my project look a bit messy if I was including classes completely unrelated to the class I'm working on except for one function in it?[/QUOTE] No? You're using a function in the class, its related.
[QUOTE=mobrockers2;40332265]No? You're using a function in the class, its related.[/QUOTE] I don't know what class I should put it in though.
[QUOTE=Meatpuppet;40332243]Wouldn't it make my project look a bit messy if I was including classes completely unrelated to the class I'm working on except for one function in it?[/QUOTE] [QUOTE=Meatpuppet;40332409]I don't know what class I should put it in though.[/QUOTE] Oh wow, there's actually a person even more perfectionistic than me!
[QUOTE=ShaunOfTheLive;40332469]Oh wow, there's actually a person even more perfectionistic than me![/QUOTE] it's just that i'm going to be showing this project as part of my college application and i don't want to mess anything up :(
[QUOTE=Meatpuppet;40332409]I don't know what class I should put it in though.[/QUOTE] Me neither :) Give us a list of classes and we might be able to help. Just the names assuming they have names that give an indication of the contents.
It doesn't have to part of any class, it could be in a util.cpp file or something
[QUOTE=mobrockers2;40332553]Me neither :) Give us a list of classes and we might be able to help. Just the names assuming they have names that give an indication of the contents.[/QUOTE] I just have window.h and text.h right now, but I think I might go with account's idea. Can I just do #include loadShader.cpp ?
Okay so I just started Visual Basic programming this semester at college, and now we are on our final project and I am kind of stumped. I am making a small program about League of Legends character stats and such, and I have it so you can select and item to "purchase" and it adds the stats to the currently selected champion's stats. In addition to that I wanted to have it so whatever passive that item has will be displayed in a textbox to show how many passives the items you picked have. I have it so if you buy an item it will display the passive, but I can't figure out how to remove just that line without removing all the others. Does anyone know how I can do this?
[QUOTE=Gubbygub;40333460]Okay so I just started Visual Basic programming this semester at college, and now we are on our final project and I am kind of stumped. I am making a small program about League of Legends character stats and such, and I have it so you can select and item to "purchase" and it adds the stats to the currently selected champion's stats. In addition to that I wanted to have it so whatever passive that item has will be displayed in a textbox to show how many passives the items you picked have. I have it so if you buy an item it will display the passive, but I can't figure out how to remove just that line without removing all the others. Does anyone know how I can do this?[/QUOTE] Store the passive strings in an array/list and then assign the textbox string to the strings in the array. This way you can just delete the string you want from the array instead of having to find it in one long string.
[QUOTE=reevezy67;40333564]Store the passive strings in an array/list and then assign the textbox string to the strings in the array. This way you can just delete the string you want from the array instead of having to find it in one long string.[/QUOTE] Ok, thanks for that, its a little more complex than anything we have done so far, its only an intro level course, but I have the book to use for reference. The way you said it seems a lot easier than anything I have done so far. I'll let you know if it works, cheers!
If that's too hard you could use this. An array is much more manageable but in an entry level class it shouldn't lose you any points. [URL]http://msdn.microsoft.com/en-AU/library/txha70f6(v=vs.80).aspx[/URL] Just grabbing stuff from msdn as I don't have any experience with VB.
[QUOTE=reevezy67;40333708]If that's too hard you could use this. An array is much more manageable but in an entry level class it shouldn't lose you any points. [URL]http://msdn.microsoft.com/en-AU/library/txha70f6(v=vs.80).aspx[/URL] Just grabbing stuff from msdn as I don't have any experience with VB.[/QUOTE] Ok that one looks much simpler as I am already lost with the array. Also that msdn website looks like a goldmine of information. Still can't get it to work... shouldn't this be working? [IMG]http://i.imgur.com/KBCkd32.png[/IMG] I have the whole part that its looking at instead of ""Books and Chapters and Pages" as the text that is in my textbox, and the portion it is replacing as the text I want removed. What am I doing wrong here? Do I maybe have it in the wrong section? I'm declaring all this under the button that is supposed to remove the text.
I would assume that is correct. Did you assign passive1remove to Teemo.txtPassives.Text? Teemo.txtPassives.Text = passive1remove
[QUOTE=reevezy67;40334224]I would assume that is correct. Did you assign passive1remove to Teemo.txtPassives.Text? Teemo.txtPassives.Text = passive1remove[/QUOTE] That did it right there! You are a life saver!
How would I go about making small notification boxes like steam gives you when a friend comes online, or like outlook gives you when you get an email? (I'm using C++ on windows.)
[QUOTE=Meatpuppet;40332695]I just have window.h and text.h right now, but I think I might go with account's idea. Can I just do #include loadShader.cpp ?[/QUOTE] util.hpp: [cpp]#ifdef UTIL_HPP //or whatever header guards you use #define UTIL_HPP void loadShader(file arguments); #endif[/cpp] Include there where you need the function. And of course define it in util.cpp. [editline]19th April 2013[/editline] [QUOTE=dylanb5123;40337810]How would I go about making small notification boxes like steam gives you when a friend comes online, or like outlook gives you when you get an email? (I'm using C++ on windows.)[/QUOTE] If you use C++/CLI (for WPF) look at replicating [url]http://www.codeproject.com/Articles/22876/WPF-Taskbar-Notifier-A-WPF-Taskbar-Notification-Wi[/url]. The plain C++ way for creating GUIs in Windows seems to be MFC; take a look at this if you want to use MFC: [url]http://www.codeproject.com/Articles/2562/Taskbar-Notification-dialog[/url] And if you're fine with a 3rd party toolkit, I suggest you take a look at Qt and [url]https://qt-project.org/doc/qt-5.0/qtwidgets/qsystemtrayicon.html#showMessage[/url].
[QUOTE=ZeekyHBomb;40340230]util.hpp: [cpp]#ifdef UTIL_HPP //or whatever header guards you use #define UTIL_HPP void loadShader(file arguments); #endif[/cpp] Include there where you need the function. And of course define it in util.cpp. [/QUOTE] If I recall correctly, you don't have to have a util.cpp. Just define it in the header straight away.
Then you have to mark it static to avoid symbol-duplication (errors at link-time due to multiple definitions of the same symbol), which would result in a copy of that function in each file that includes the header, which, depending on the size of the function, might not be optimal.
Does anyone know how to parse an array to Lua from C#, and then vice versa Table to Array using the Lua interface?
[QUOTE=dylanb5123;40337810]How would I go about making small notification boxes like steam gives you when a friend comes online, or like outlook gives you when you get an email? (I'm using C++ on windows.)[/QUOTE] You mean toast notifications? Usually it's just another window, but Windows 8 has an API that uses XML to create these things (supports images).
[QUOTE=jrj996;40340950]Does anyone know how to parse an array to Lua from C#, and then vice versa Table to Array using the Lua interface?[/QUOTE] Something like [cpp]LuaTable table = new LuaTable(...); for(int idx = 0; idx < array.Length; ++idx) { table[idx] = array[idx]; } table.push(...);[/cpp] For C# -> Lua. [cpp]Array array = Array.CreateInstance(Object, table.Count); table.CopyTo(array, 0);[/cpp] For Lua -> C#. There may be more idiomatic ways to do that, I only know a little bit of C#.
So in C#, is it possible to make a constant filename for use with saveFileDialog? For example, when my fileSaveDialog box pops up, the user enters a number, and when its saved that number is added to the end of the constant file name. For example, user enters 123456789 and the saved file is called abc.123456789.CSV How could I do this?
Add an event for [url=http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.fileok.aspx]FileDialog.FileOk[/url] and modify the FileName-property there.
Your a good man thanks [editline]19th April 2013[/editline] Okay I got it working but it lets you overwrite that text, is there a way I could make it so that the text doesn't appear in the save dialog box, and you just enter in the park you want saved at the end of it?
What's the code you have? Either the documentation for the event is wrong (or I interpret it incorrectly) or you're setting the FileName before ShowDialog().
[QUOTE=ZeekyHBomb;40340703]Then you have to mark it static to avoid symbol-duplication (errors at link-time due to multiple definitions of the same symbol), which would result in a copy of that function in each file that includes the header, which, depending on the size of the function, might not be optimal.[/QUOTE] Right. Forgot about that part.
Not sure how to fix it buddy :S [CODE] private void retrieveInput_Click(object sender, EventArgs e) { int howMany; howMany = Convert.ToInt32(howManyCVR.Text); howMany = int.Parse(howManyCVR.Text); Boolean lessThanThousand = true; saveFileDialog1.Filter = "CSV files (*.csv)|*.csv"; saveFileDialog1.Title = "Save a CSV file"; DialogResult result = new DialogResult(); saveFileDialog1.FileName = "Testing..."; if (howMany > 999 || howMany < 1) { MessageBox.Show("Please enter a number between 1 and less than 1000"); this.Refresh(); lessThanThousand = false; } if (lessThanThousand) { result = saveFileDialog1.ShowDialog(); if (saveFileDialog1.FileName != "" && result == System.Windows.Forms.DialogResult.OK) { file.createCSV(howMany, saveFileDialog1.FileName, versionNumber); this.Close(); } } }[/CODE]
After constructing saveFileDialog1, do [code]saveFileDialog1.FileOk += delegate(object o, CustomEventArgs e) { saveFileDialog1.FileName = "abc." + saveFileDialog1.FileName; }[/code] And remove the saveFileDialog1.FileName = "Testing..."; from retrieveInput_Click. If you're using the dialog only in that one place you could also set the FileName like in the delegate after ShowDialog() in retrieveInput_Click.
[QUOTE=ZeekyHBomb;40342461]After constructing saveFileDialog1, do [code]saveFileDialog1.FileOk += delegate(object o, CustomEventArgs e) { saveFileDialog1.FileName = "abc." + saveFileDialog1.FileName; }[/code] And remove the saveFileDialog1.FileName = "Testing..."; from retrieveInput_Click. If you're using the dialog only in that one place you could also set the FileName like in the delegate after ShowDialog() in retrieveInput_Click.[/QUOTE] Is this what you mean? [CODE] private void retrieveInput_Click(object sender, EventArgs e) { DialogResult result = new DialogResult(); int howMany; howMany = Convert.ToInt32(howManyCVR.Text); howMany = int.Parse(howManyCVR.Text); Boolean lessThanThousand = true; saveFileDialog1.Filter = "CSV files (*.csv)|*.csv"; saveFileDialog1.Title = "Save a CSV file"; if (howMany > 999 || howMany < 1) { MessageBox.Show("Please enter a number between 1 and less than 1000"); this.Refresh(); lessThanThousand = false; } if (lessThanThousand) { result = saveFileDialog1.ShowDialog(); saveFileDialog1.FileName = "test." + saveFileDialog1.FileName; if (saveFileDialog1.FileName != "" && result == System.Windows.Forms.DialogResult.OK) { file.createCSV(howMany, saveFileDialog1.FileName, versionNumber); this.Close(); } } }[/CODE] Because it doesn't work, crashes the program :S
Sorry, you need to Log In to post a reply to this thread.