Search found 40 matches

by Ravilj
Sat Mar 04, 2006 11:12 am
Forum: C++ Development
Topic: Processing events in a non-wx derived class
Replies: 3
Views: 1042

kk here it is: modem.h class modem : public wxEvtHandler { public: modem(); ... private: void OnSocketEvent( wxSocketEvent &event ); ... wxSocketClient * m_pSocket; ... DECLARE_EVENT_TABLE() }; modem.cpp ... BEGIN_EVENT_TABLE( modem , wxEvtHandler ) EVT_SOCKET( SOCKET_ID, modem::OnSocketEvent ) END_...
by Ravilj
Sat Mar 04, 2006 10:35 am
Forum: C++ Development
Topic: Processing events in a non-wx derived class
Replies: 3
Views: 1042

Found what I needed in the documentation: Event handling overview - will post the code once I have it working for future reference. Pluggable event handlers In fact, you don't have to derive a new class from a window class if you don't want to. You can derive a new class from wxEvtHandler instead, d...
by Ravilj
Sat Mar 04, 2006 9:55 am
Forum: C++ Development
Topic: Processing events in a non-wx derived class
Replies: 3
Views: 1042

Processing events in a non-wx derived class

Say for instance I have: class modem { public: modem(); ... private: ... wxSocketClient * m_pSocket; ... }; Now I would like to process the socket events in the modem class. Is there anyway of tricking wxWidgets into doing this? I need this class to be quite generic ie: I dont want any gui related o...
by Ravilj
Tue Oct 25, 2005 9:11 am
Forum: C++ Development
Topic: convert bitmap to hexadecimal
Replies: 6
Views: 3919

Are you wanting to create an ascii version of the image?
OR
Does do you want a hex or binary format of each of the R G B values for each pixel? If so then its exaclty as upCASE said it is just a method of representing the data as


17 in decimal = 11 in hex = 10001 in binary
by Ravilj
Mon Oct 17, 2005 3:03 pm
Forum: C++ Development
Topic: Howdo i use opengl and wxWidgets GUI
Replies: 2
Views: 1494

Create a spin control on a dialog or on a panel. Pass a pointer of the openGL canvas to the panel or dialog box. In the openGL canvas class create a member function the increments an angle counter or moves the cube. Setup a spin control event when the spin control changes, it that event occurs call ...
by Ravilj
Sat Oct 15, 2005 11:15 am
Forum: The Code Dump
Topic: Standalone copy of wxImage
Replies: 3
Views: 2520

From wxImage Documentation Copy constructor. wxImage(const wxImage& image) wxImage * m_pOldImg = new wxImage( "image.bmp", wxBITMAP_TYPE_BMP, -1 ); wxImage * m_pNewImg = new wxImage(*m_pOldImg); Yeah thats all very well but if you change the image data of old image it also affects the new image. Si...
by Ravilj
Tue Oct 11, 2005 5:58 pm
Forum: C++ Development
Topic: fail to create a new wxBitmap
Replies: 5
Views: 1667

does your w * h * 3 = sizeof array?
by Ravilj
Sun Oct 09, 2005 5:51 pm
Forum: C++ Development
Topic: wxGLCanvas
Replies: 31
Views: 9631

The NeHe tutorials are a great place to start also download the "Red Book" for basic tutorials on openGL commands and "Blue Book" for references.
by Ravilj
Sun Oct 09, 2005 1:56 am
Forum: C++ Development
Topic: wxGLCanvas
Replies: 31
Views: 9631

Good to hear, what are you planning on making?

*cough* I suggested idle event *cough* :wink:
by Ravilj
Sat Oct 08, 2005 9:50 am
Forum: C++ Development
Topic: wxGLCanvas
Replies: 31
Views: 9631

You will either need to use a timer to generate an event or you will need to use the idle loop event un wxApp as far as I know. What did you change to get it working?
by Ravilj
Thu Oct 06, 2005 11:35 pm
Forum: C++ Development
Topic: EndModal retcode clobbered
Replies: 4
Views: 1933

Could you post some code so we can get an idea. I am using EndModal to return different return codes quite happily.
by Ravilj
Thu Oct 06, 2005 11:20 pm
Forum: C++ Development
Topic: wxGLCanvas
Replies: 31
Views: 9631

It looks ok interms of wxWidgets, you dont initialise your Projection or your Model view matrices in your init function. Maybe use something like this in your initGL function: glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective( 60.0, (GLfloat)canvasWidth / (GLfloat)canvasHeight, 0.1, 8.0)...
by Ravilj
Sat Oct 01, 2005 12:57 pm
Forum: C++ Development
Topic: Disabling all controls on a panel
Replies: 3
Views: 1635

I figured as much, I attempted that a 5am this morning the only problem is I put disable in the constuctor. yeah that was a bit dumb... :P
by Ravilj
Sat Oct 01, 2005 11:19 am
Forum: C++ Development
Topic: Disabling all controls on a panel
Replies: 3
Views: 1635

Disabling all controls on a panel

Is there a quick way of disabling all the controls on the panel? Other then goin through each control and disabling it.

The panel is part of a notebook, is it possible to disable the notebook tab with out removing it from the notebook?
by Ravilj
Wed Sep 28, 2005 2:13 pm
Forum: The Code Dump
Topic: Standalone copy of wxImage
Replies: 3
Views: 2520

Standalone copy of wxImage

The wxImage copy constructor doesn't seem to create a new copy of the image object. I used this code to do so: wxImage * m_pOldImg = new wxImage( "image.bmp", wxBITMAP_TYPE_BMP, -1 ); int dataSize = m_pOldImg->GetWidth( )*m_pOldImg->GetHeight( )*3; unsigned char * NewImgData = ( unsigned char * ) ma...