Search found 204 matches

by papayrus
Fri Jul 27, 2012 10:56 pm
Forum: C++ Development
Topic: How to Clear TextCtrl on Click?
Replies: 32
Views: 12187

Re: How to Clear TextCtrl on Click?

I cannot get this to work. It will compile but nothing happens when I click in the TextCtrl. This is what I put for the connect Connect(ID_TEXTCTRL1,wxEVT_LEFT_DOWN,(wxObjectEventFunction)&ClearFrame::OnTextCtrl1Clicked); This is what I put in the .h private: void OnTextCtrl1Clicked(wxMouseEvent& WX...
by papayrus
Fri Jul 27, 2012 9:11 pm
Forum: C++ Development
Topic: How to Clear TextCtrl on Click?
Replies: 32
Views: 12187

Re: How to Clear TextCtrl on Click?

OK I am downloading this one now With DOS line endings (for Windows): 7z or zip. I got the ZIP one it's only 25.9mb.

I need to go back through this thread again I still never got it to work where I can click in the TextCtrl and clear the text thats appended.
by papayrus
Fri Jul 27, 2012 8:54 pm
Forum: C++ Development
Topic: How to Clear TextCtrl on Click?
Replies: 32
Views: 12187

Re: How to Clear TextCtrl on Click?

So is this right? I download the Windows installer: exe of wxwidgets. Then I just install that. Then I look in the directory that was installed and the sln is in there? Then I just double click it to load it into VS 2008 and build it and it will build it and thats it? wxBen 2010 is great I use it fo...
by papayrus
Fri Jul 27, 2012 1:16 pm
Forum: C++ Development
Topic: How to Clear TextCtrl on Click?
Replies: 32
Views: 12187

Re: How to Clear TextCtrl on Click?

wxBen that link says content not found. Anyway will go for the 2008 version it has sp1 already integrated as well. One problem though now I have to learn how to get wxWidgets in to 2008 haha. I am using wxpack but as of now it's an older version wxWidgets2.8 so since they don't have wxpack for that ...
by papayrus
Tue Jul 24, 2012 6:56 pm
Forum: C++ Development
Topic: Help Reading and Saving to Text File.
Replies: 57
Views: 11062

Re: Help Reading and Saving to Text File.

doublemax wrote:Sorry, the method is called FileExists()
Works great and don't need to close any steams or anything. I like it better than ifstream.
by papayrus
Tue Jul 24, 2012 5:29 pm
Forum: C++ Development
Topic: Help Reading and Saving to Text File.
Replies: 57
Views: 11062

Re: Help Reading and Saving to Text File.

Nothing. If you don't know what the const means there, it's time to read up on C++ ;) if( !wxFileName::Exists( wxT("..\\rev.ini") ) ) { // file does not exist } Yes these are the things I don't understand for example where it says stuff like this. static wxFileName FileName(const wxString& file, wx...
by papayrus
Tue Jul 24, 2012 4:49 pm
Forum: C++ Development
Topic: Help Reading and Saving to Text File.
Replies: 57
Views: 11062

Re: Help Reading and Saving to Text File.

doublemax wrote:Use wxFileName::FileExists():
http://docs.wxwidgets.org/stable/wx_wxf ... fileexists
What am I supposed to put where it says const?
by papayrus
Tue Jul 24, 2012 3:51 pm
Forum: C++ Development
Topic: Help Reading and Saving to Text File.
Replies: 57
Views: 11062

Re: Help Reading and Saving to Text File.

I decided to have it detect if rev.ini was there can you tell me if this is the best way to do it. In the else statement in order to close the stream I put the myfile.close line first other wise it will not let me write to rev.ini. It works but was wondering if that is a good way to do it. ifstream ...
by papayrus
Mon Jul 23, 2012 6:14 pm
Forum: C++ Development
Topic: How to Clear TextCtrl on Click?
Replies: 32
Views: 12187

Re: How to Clear TextCtrl on Click?

Any idea if there is any way to get the 2003 version from microsoft all I can find is the 2010 version.
by papayrus
Mon Jul 23, 2012 5:52 pm
Forum: C++ Development
Topic: Help Reading and Saving to Text File.
Replies: 57
Views: 11062

Re: Help Reading and Saving to Text File.

tfile.Open(_("..\\REV\\rev.ini")); This should work though. So does the actual changing of the ini-file work now? Yes it does work great and so does using the .. Not sure why it did not work when I tried it before I think I compiled my copy and then ran my final haha. Now I am trying to figure out ...
by papayrus
Mon Jul 23, 2012 5:31 pm
Forum: C++ Development
Topic: Help Reading and Saving to Text File.
Replies: 57
Views: 11062

Re: Help Reading and Saving to Text File.

Is is better to set the directory as wxGetWorkingDirectory or as wxGetCwd() Neither ;) Use wxStandardPaths and create absolute paths whenever possible. http://docs.wxwidgets.org/stable/wx_wxstandardpaths.html Nice did not see those before. But what I am trying to do is go backwards one directory. f...
by papayrus
Mon Jul 23, 2012 5:23 pm
Forum: C++ Development
Topic: Help Reading and Saving to Text File.
Replies: 57
Views: 11062

Re: Help Reading and Saving to Text File.

doublemax wrote:In the log window that pops up, click on "details". Then you see all the output lines.
Yep I saw that. I have a question I hear people argue about. Is is better to set the directory as wxGetWorkingDirectory or as wxGetCwd()
by papayrus
Mon Jul 23, 2012 4:47 pm
Forum: C++ Development
Topic: Help Reading and Saving to Text File.
Replies: 57
Views: 11062

Re: Help Reading and Saving to Text File.

doublemax wrote:

Code: Select all

if( line.StartsWith( wxT("PlayerName =") ) );
Remove the ; at the end.
That worked but wxlogmessage pops up shows the last line of the code line 43 in the message box. Is does not say interesting line found. I take it that it is supposed to do that?
by papayrus
Mon Jul 23, 2012 4:32 pm
Forum: C++ Development
Topic: Help Reading and Saving to Text File.
Replies: 57
Views: 11062

Re: Help Reading and Saving to Text File.

Oh yeah, forgot about stupid compilers ;) Try this: wxLogMessage( wxT("Line %d: %s"), n, line.c_str()); It pops up interresting line found looks like it shows all the lines in the text then when I open the rev.ini it is nothing but this, I think it's replacing all the lines in the file with PlayerN...
by papayrus
Mon Jul 23, 2012 4:24 pm
Forum: C++ Development
Topic: Help Reading and Saving to Text File.
Replies: 57
Views: 11062

Re: Help Reading and Saving to Text File.

Just to add it compiles fine I get this warning though warning: cannot pass objects of non-POD type `class wxString' through `...'; call will abort at runtime| ||=== Build finished: 0 errors, 1 warnings (0 minutes, 7 seconds) ===| It just crashed when I click the button no wxlog message though it ju...