Search found 67 matches

by boxcarmiba
Tue May 08, 2007 5:02 pm
Forum: C++ Development
Topic: deriving reference counted classes... needing help
Replies: 3
Views: 905

any idea why the documentation says this? cause this was the source of all my confusion... Reference counting can be implemented easily using wxObject and wxObjectRefData classes. First , derive a new class from wxObjectRefData and put there the memory-consuming data. Then derive a new class from wx...
by boxcarmiba
Tue May 08, 2007 4:18 pm
Forum: C++ Development
Topic: deriving reference counted classes... needing help
Replies: 3
Views: 905

deriving reference counted classes... needing help

I'm trying to derive my own reference counted class, but i'm finding the overview provided in the documentation a little sketchy. i've tired looking at headers for some of the built-in wx classes that use it, but they're all loaded up with extra stuff that makes it difficult for me to follow. So pre...
by boxcarmiba
Wed Mar 14, 2007 10:46 pm
Forum: C++ Development
Topic: wxMessageDialog and wxTimer... why doesn't this work?
Replies: 4
Views: 1054

the Notify method in the base class is virtual, but there's no necessity for the inherting method to make Notify virtual.

Anyway, as I mentioned previously, diagnostics confirm that the Notify method is executing... it's just that the wxMessageDialog box is not going away.
by boxcarmiba
Wed Mar 14, 2007 8:22 pm
Forum: C++ Development
Topic: wxMessageDialog and wxTimer... why doesn't this work?
Replies: 4
Views: 1054

well i guess the problem must be with wxMessageDialog, and perhaps more precisely with the ShowModal() method.

As you suggested I tried deriving only one class and the other class as a member for both instances and neither worked. oh well... i guess another approach is needed.
by boxcarmiba
Wed Mar 14, 2007 5:20 pm
Forum: C++ Development
Topic: wxMessageDialog and wxTimer... why doesn't this work?
Replies: 4
Views: 1054

wxMessageDialog and wxTimer... why doesn't this work?

Simply wanted to create an instance of wxMessageDialog that if a button has not been clicked within a set period of time the message dialog would disappear... so i created the following: class c_timedMessageDialog : public wxMessageDialog, public wxTimer { public: c_timedMessageDialog( wxWindow* par...
by boxcarmiba
Mon Feb 19, 2007 2:37 am
Forum: Platform Related Issues
Topic: trouble with VC 8.0, wxSocket and event Connect function
Replies: 6
Views: 1709

There's an even cooler fix I found when searching on the internet... and that is to simply chain the typecasts from wxObjectEventFunction through to the most recently derived level. e.g. i have a custom derived event class called myEvent and so i would rewrite the connect call as: Connect( wxID_ANY,...
by boxcarmiba
Fri Feb 16, 2007 8:28 pm
Forum: Compiler / Linking / IDE Related
Topic: Question about Sockets in wxMSW
Replies: 0
Views: 514

Question about Sockets in wxMSW

In my application in wxMAC and wxGTK, in response to a wxSOCKET_INPUT event, I perform two reads. The first reads 2 bytes from a packet that it has been sent, which (according to design) says how bytes there are in the entire packet. I then allot a buffer of this size and perform a 2nd read to fill ...
by boxcarmiba
Fri Feb 16, 2007 12:40 am
Forum: Compiler / Linking / IDE Related
Topic: wxLogDebug and Access Violations
Replies: 0
Views: 535

wxLogDebug and Access Violations

I have the following in my code: wxLogDebug( "%s%s%s", "test", __FILE__, __LINE__ ); anyone know why VC++8.0 won't stop complaning about... "unhandled exception at .... Access violation reading location ...." this has driven me crazy. i'm no longer sane or rational. Any...
by boxcarmiba
Wed Feb 14, 2007 4:14 pm
Forum: Platform Related Issues
Topic: trouble with VC 8.0, wxSocket and event Connect function
Replies: 6
Views: 1709

Well I've managed to figure it out... originally my code was of the form: class sktClass : public wxEvtHandler, public classOne, public classTwo { public: void sktEvtHandler( wxSocketEvent& event ); void funcWhereIcallConnect(); }; and the VC8 compiler objected to my line of code: Connect( wxID_...
by boxcarmiba
Tue Feb 13, 2007 7:19 pm
Forum: Compiler / Linking / IDE Related
Topic: xcode problems compilling minimal app
Replies: 1
Views: 814

xcode problems compilling minimal app

Platform: xcode 2.4.1 wxWidgets 2.8.0

used supplied .xcodeproj file to succesfully compile wxWidgets 2.8.0

used supplied .xcodeproj file to compile minimal application, which returned the following errors:

Building target
by boxcarmiba
Tue Feb 13, 2007 4:00 pm
Forum: Platform Related Issues
Topic: trouble with VC 8.0, wxSocket and event Connect function
Replies: 6
Views: 1709

I tried that, and the compiler returns the following error:

..\skt.cpp(45) : error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'wxObjectEventFunction'
None of the functions with this name in scope match the target type
by boxcarmiba
Tue Feb 13, 2007 3:13 pm
Forum: Platform Related Issues
Topic: trouble with VC 8.0, wxSocket and event Connect function
Replies: 6
Views: 1709

trouble with VC 8.0, wxSocket and event Connect function

PLATFORM: Windows XP, VC 8.0, wxWidgets 2.8 I have this line in my application: Connect( wxID_ANY, wxEVT_SOCKET, (wxObjectEventFunction)&c_skt::onSocketEvent); the compiler gives this error: z:\r0.5\skt.cpp(45) : error C2440: 'type cast' : cannot convert from 'void (__thiscall c_skt::* )(wxSocke...
by boxcarmiba
Tue Feb 06, 2007 11:46 pm
Forum: Platform Related Issues
Topic: Forcing scroll of wxTextCtrl
Replies: 1
Views: 817

Try this: void methodToWriteToTextControl( wxString displayString ) { wxString str; int index; textCtrlPtr->SetInsertionPointEnd(); for( index = 0; index < displayString.Len(); ++index ) { str = displayString.Mid( index, 1 ); textCtrlPtr->WriteText( str ); } textCtrlPtr->ShowPosition( textStrlPtr->G...
by boxcarmiba
Tue Feb 06, 2007 11:45 pm
Forum: C++ Development
Topic: Scrolling issues with wxTextCtrl + wxMac + wxWidgets 2.8.0
Replies: 2
Views: 963

I'm running 2.8 on an intel Mac and the ::wxYield() did nothing for me.... however, this DID work... and it works on wxGTK too, i'd be interested in knowing if it works on wxMSW as well. void methodToWriteToTextControl( wxString displayString ) { wxString str; int index; textCtrlPtr->SetInsertionPoi...
by boxcarmiba
Sun Feb 04, 2007 3:10 pm
Forum: C++ Development
Topic: Can't connect Socket Events
Replies: 9
Views: 2076

Yes, that's basically right. You limit the kind of events that are generated with the SetNotify() method. e.g. if you only want to respond to connection lost and socket input you would write: socket->SetNotify( wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG ); given that in the above example you've specif...