Having trouble using setText() for RichTextField and other GUI issues.
I'm having trouble with two things of immediate concern
1.) I cannot figure out how to read in text from a file, at least to able to read in line breaks like
"bla bla bla bal
bla bla bla bla"
and also to be able to set the text. It's complaining that I cannot convert from std::String to System::String. What does the L label stand for?
2.) I don't know how to reference and load other forms in a form. For instance if I have window1 and I want it to have a button that will open window/form 2, how do I do that? I think the click action or whatever is the equivalent of a java ActionListener. Anyway, I've tried that without success. Right now, I'm working on the readin.
Re: Having trouble using setText() for RichTextField and other GUI issues.
What about the text thing? How do I handle that? I need to know how to handle it if the text is being set from text being read in from a file.
What is C#? I never coded in C#. The best I can make of C# is that it's an enhanced version of C++, or so I think I've heard.
I don't know any code in C#. I've learned some of how the C++ GUI elements work by looking at the code from elements it generated with the visual part and have used to make my own elements that were auto-generated.
Also, what does this symbol mean when it comes after a class, I know a pointer is * but what is ^ ?
Re: Having trouble using setText() for RichTextField and other GUI issues.
Originally Posted by jedipenguin
I need to know how to handle it if the text is being set from text being read in from a file.
This question looks somewhat cryptic...
The link in my first answer shows how to load text file to RichTextBox - this was your question.
If you want to work with .NET, use C#. This language is good for any programmer with previous C/C++/Java experience, it is default choice for .NET programming.
C++/CLI is used for managed-unmanaged interoperability. If you don't know what is this, or if you don't need this feature, this means, you don't need C++/CLI. goToC#
Re: Having trouble using setText() for RichTextField and other GUI issues.
I'm using forms as I don't know how to work the visual C++ part for the other things and also, I suppose I could use it for the Win 32 API, but the problem is that I could only add what they have and not be able to write any of my own. (Also, I don't think I got it to work that well on Win 32 for Visual anyway. What is .NET?
As for the C++ GUI stuff, which should be similar in C#, whatever that is, if it really is based off of C++, anyway, in part I wanted to learn GUI programming, in part because I'm taking a graphics course and it's in C++ and unfortunately, as I said, though I now get the basics a little bit better now, pointers and references are the things that confuse me the most, and when and when not to use the keyword "new" or now, some new thing called "gcnew".
I normally don't use the keyword "new" now as it invovles annoying deletion later (or annoying memory leaks if I forget to delete!!!).
I'm using RichTextBox because that kind of thing, going with forms, was the only one that I can manage to get the visual builder to work on, or at least somewhat figure out how to work it. I don't know what .NET is and how this fits into all of this. I thought that .NET was internet or something as in something called ASP.NET
I'm suspecting to some degree that, kind of like Java ME, there is no "standard" API for C++ GUIs. Am I correct in that assumption?
Re: Having trouble using setText() for RichTextField and other GUI issues.
So, you are working with C++ and looking for GUI toolkit to make user interface?
You can use Windows API, MFC, WTL (Windows-specific), or cross-platform Qt, wxWidgets. Using .NET Windows Forms GUI is not the best choice, especially if you don't know what is .NET and don't need it at all...
[...] I don't know what .NET is and how this fits into all of this. I thought that .NET was internet or something as in something called ASP.NET
I'm suspecting to some degree that, kind of like Java ME, there is no "standard" API for C++ GUIs. Am I correct in that assumption?
System::String is a .NET framework type (called System.String in at least most of the other .NET languages) and has nothing to do with the native C++ documented and discussed on cplusplus.com. And it should be noted that, despite the similar name and for large parts identical syntax, C++ and C++/CLI are distinct programming languages.
And yes, the definition of the language C++ and its standard library doesn't even remotely touch any GUI thematics. Instead this is the responsibility of a bunch of additional GUI frameworks/libraries, some of which have been mentioned by Alex F, built upon the C++ standard, but otherwise independent from it..
Bookmarks