Search found 26 matches

by Double Trouble
Tue Jun 17, 2008 5:53 pm
Forum: C++ Development
Topic: wxfile, wxtextfile, something... just help me!
Replies: 7
Views: 955

Re: wxfile, wxtextfile, something... just help me!

My task is simple: I need to open a text file and write some stuff to it. I was able to do this in the command line with fstream but now in wxwidgets, I am having a lot of trouble. Can somebody help me here? Bonus Awesomeness (Not required): If you can show me how to follow the following pseudo cod...
by Double Trouble
Tue Jun 17, 2008 5:38 pm
Forum: C++ Development
Topic: Problem with wxTextFile!
Replies: 4
Views: 681

Problem with wxTextFile!

Hi! I'm gonna describe my problem the best I can. Let's say my program reads a word (a line) from a text file. The word is 4 characters long. If the next word I read (to the same variable) is shorter (say 3 characters) I still get the fourth character left on the end from the last word. And the same...
by Double Trouble
Tue Jun 17, 2008 1:22 pm
Forum: C++ Development
Topic: Help - Read lines from text file! [SOLVED]
Replies: 9
Views: 1119

wxTextFile did the thing!

Code: Select all

wxTextFile file;
file.Open(wxT("text.txt"));
wxString line = file.GetLine(1);

wxStaticText *st = new wxStaticText(panel, wxID_ANY, line);
Thanks for all the help! \:D/
by Double Trouble
Tue Jun 17, 2008 12:09 pm
Forum: C++ Development
Topic: Help - Read lines from text file! [SOLVED]
Replies: 9
Views: 1119

for wxFileInputStream you need to include wfstream.h for wxTextFile textfile.h Thanks a lot! It works perfect now! Here is my code: wxFileInputStream input(wxT("text.txt")); wxTextInputStream text( input ); wxString line; text >> line; wxStaticText *st = new wxStaticText(panel, wxID_ANY, line); One...
by Double Trouble
Tue Jun 17, 2008 10:04 am
Forum: C++ Development
Topic: Help - Read lines from text file! [SOLVED]
Replies: 9
Views: 1119

Try including the appropriate header for wxFileInputStream (it's written in the docs at the wxFileInputStream page) also, in unicode builds, you'll need to put wxT() around the string literal : wxT("text.txt") Thank you for the answer! Of course I am including <wx/txtstrm.h> already! :) I didn't kn...
by Double Trouble
Tue Jun 17, 2008 12:05 am
Forum: C++ Development
Topic: Help - Read lines from text file! [SOLVED]
Replies: 9
Views: 1119

Re: Help - Read lines from text file! (wxFileInputStream?)

If I just add this line to my program

wxFileInputStream input( "text.txt" );

I get the following errors:

Error 1 error C2065: 'wxFileInputStream' : undeclared identifier
Error 2 error C2146: syntax error : missing ';' before identifier 'input'
Error 3 error C3861: 'input': identifier not found
by Double Trouble
Mon Jun 16, 2008 11:35 pm
Forum: C++ Development
Topic: Help - Read lines from text file! [SOLVED]
Replies: 9
Views: 1119

"doesn't seem to work to well" is not a proper way to describe a problem... I know that and I'm sorry but the reason is I'm totally new to WxWidgets and with programming I've learned that the best way (for me) to learn is to see examples and analyzing and experimenting with them. So therefore I'd b...
by Double Trouble
Mon Jun 16, 2008 10:13 pm
Forum: C++ Development
Topic: Help - Read lines from text file! [SOLVED]
Replies: 9
Views: 1119

Help - Read lines from text file! [SOLVED]

Hi everyone! I'd appreciate some help on this one! :) What I'm trying to do is to read specific lines from a text file, say nouns_places.txt. It's Unicode UTF-8 encoding. nouns_places.txt 家 いえ home 学校 がっこう school . . . I want my program to read the lines 1 or 5 for example. Later on I'd want my prog...
by Double Trouble
Mon Jun 16, 2008 3:07 pm
Forum: C++ Development
Topic: Beginner - Icon trouble! [SOLVED]
Replies: 3
Views: 1200

The problem is now solved with help from BrianHV @ #wxwidgets. The solution was that I had to call wxInitAllImageHandlers() in OnInit!

Thanks!
by Double Trouble
Sun Jun 15, 2008 9:12 pm
Forum: C++ Development
Topic: Beginner - Icon trouble! [SOLVED]
Replies: 3
Views: 1200

What exactly is your problem? It is nice that you list code and point out it missed an XPM, but what is your problem? - Jorgen When I run the program, there is no icon! Like this: http://pici.se/pictures/HXDCkpqeP.png When I would like to have an icon up to left like this: http://zetcode.com/tutori...
by Double Trouble
Sun Jun 15, 2008 7:30 pm
Forum: C++ Development
Topic: Beginner - Icon trouble! [SOLVED]
Replies: 3
Views: 1200

Beginner - Icon trouble! [SOLVED]

Hi! I'm a complete beginner with WxWidgets. I just build it yesterday but so far I really like what I see! I followed this tutorial, just for fun trying to create an icon: http://zetcode.com/tutorials/wxwidgetstutorial/firstprograms/ I don't have the web.xpm so I just grabbed another xpm-file (mondr...