Search found 32 matches

by prophet
Tue Jan 17, 2006 11:14 am
Forum: C++ Development
Topic: Problem on wxTextattr.setflags
Replies: 2
Views: 1014

Hmm, yeah. I noticed the same problem today,


anyway knows what is going wrong?
by prophet
Fri Dec 09, 2005 10:45 pm
Forum: C++ Development
Topic: Querying width of toolbars
Replies: 2
Views: 934

Maybe you can try GetClientSize(), it's strange it always returns the same size....
by prophet
Fri Dec 09, 2005 10:42 pm
Forum: C++ Development
Topic: no appropriate default constructor available
Replies: 2
Views: 1309

I think it's because you don't have a constructor without any parameters (or all default parameters.

Customer::Customer()
{
...
}
by prophet
Mon Nov 14, 2005 9:58 pm
Forum: C++ Development
Topic: wxSocketEvent::GetSocket .. clean up?
Replies: 4
Views: 1343

First of all, you should Destroy() the socket. Second, you probably don't want to destroy the socket in the event handler. If you do, the socket will be closed. The GetSocket() call will return a reference to an existing socket. It does not create a new socket that must be destroyed. I hope this is ...
by prophet
Mon Nov 14, 2005 8:22 am
Forum: The Code Dump
Topic: wx auto_ptr
Replies: 7
Views: 4206

Jamie wrote:

Code: Select all

#include <boost/shared_ptr.hpp>
boost::shared_ptr<wxMessageDialog> ptr(new wxMessageDialog(..), mem_fun(&wxMessageDialog::Destroy));
It's a shame wxWidgets doesn't use boost or even real STL......
I agree, thx for the code sample btw.
by prophet
Fri Nov 11, 2005 1:20 pm
Forum: C++ Development
Topic: Parser
Replies: 10
Views: 2702

Hi, Looked at it but it contains templates, which from the portability point of view is a no no (hence I am using wx toolset). regards Templates are very portable, i think wx is also moving toward templates and stl. VS6 has alot of problems with c++, it uses very old c++ standards, microsoft's newe...
by prophet
Fri Nov 11, 2005 12:40 pm
Forum: The Code Dump
Topic: wx auto_ptr
Replies: 7
Views: 4206

word. Some template in there should support specifying such stuff, but I'm not too familiar with boost. You're probably right, one of the parameters for the template class is possibly a destruction functor. I should look in too that. I tried using boost once with mingw and wx, but it didn't turn ou...
by prophet
Wed Nov 09, 2005 10:20 am
Forum: The Code Dump
Topic: wxNim - rather simple game
Replies: 4
Views: 3814

Action packed and stunning graphics ;-)
by prophet
Wed Nov 09, 2005 9:19 am
Forum: The Code Dump
Topic: wx auto_ptr
Replies: 7
Views: 4206

leio wrote:consider using boost::shared_ptr :lol:
I wouldn't recommend that, cos the shared_ptr calls delete in it's destructor ;-)
by prophet
Tue Nov 08, 2005 12:00 pm
Forum: The Code Dump
Topic: wx auto_ptr
Replies: 7
Views: 4206

wx auto_ptr

Consider using the following template: template<class wxtype> class wx_ptr { wxtype *object; public: wx_ptr(wxtype *my_object = NULL) : object(my_object) { } ~wx_ptr() { if(object != NULL) object->Destroy(); } void operator=(wx_ptr &other_ptr) { if(this == &other_ptr) return; if(object != NU...
by prophet
Tue Nov 08, 2005 11:57 am
Forum: C++ Development
Topic: Are strings hard-coded in wxWidgets!?
Replies: 13
Views: 3626

I've always wondered if it were possible to dump the translation files as resources into a Windows exe file, and load them from there and use them. Maybe would involve a wxMemoryBuffer on the way, or similar, but is this a workable idea (for C++, at least)? Yeah, maybe you can write a wxFileSystem ...
by prophet
Tue Nov 08, 2005 11:21 am
Forum: C++ Development
Topic: wxWidgets memory management
Replies: 10
Views: 2860

Yeah, something similar can be done for wxMutex. Which is what wxMutexLocker does, but than in the form of a template.

Maybe i should add this to the wiki.
by prophet
Tue Nov 08, 2005 11:15 am
Forum: C++ Development
Topic: Are strings hard-coded in wxWidgets!?
Replies: 13
Views: 3626

I wrote a patch one to allow wxwidgets to read language files from a wxfilesystem. I have all my resources in a zip file, distributed with the application. Now i just add a wxfilesystem url to let wxwidgets load the language files from the zip file. The patch is here: http://sourceforge.net/tracker/...
by prophet
Tue Nov 08, 2005 10:57 am
Forum: C++ Development
Topic: wxWidgets memory management
Replies: 10
Views: 2860

Consider using the following template: template<class wxtype> class wx_ptr { wxtype *object; public: wx_ptr(wxtype *my_object = NULL) : object(my_object) { } ~wx_ptr() { if(object != NULL) object->Destroy(); } void operator=(wx_ptr &other_ptr) { if(this == &other_ptr) return; if(object != NU...
by prophet
Sat Jan 08, 2005 8:51 pm
Forum: General Development
Topic: Is there a wxFile end of line method?
Replies: 9
Views: 3275

Yes, there is.

Maybe you should read the documentation first