Search found 38 matches

by MichaelWard
Thu Jun 26, 2008 6:43 pm
Forum: C++ Development
Topic: Combo Box and Event Problem.
Replies: 1
Views: 687

Combo Box and Event Problem.

I believe the following is a bug. If not could someone let me know what I am doing incorrectly. Basically I want to use client data with a combo box. I have a Init Function that essentially does this. // Create my data long *pData = new long; *pData = 4; // Add an item to the combo box m_ComboBox->A...
by MichaelWard
Wed Dec 19, 2007 10:30 pm
Forum: C++ Development
Topic: silent cmdline option in a GUI program (Need benedicte here)
Replies: 2
Views: 942

I have not done this in wxWidgets but I have done it in win32. I think you need to think about whether you want a message loop or not. If you start your program with int main(...) you will not have a message loop unless you write one yourself. If you start it using the wxApp etc then it does the mes...
by MichaelWard
Tue Dec 11, 2007 5:24 pm
Forum: C++ Development
Topic: wxTextCtrl and Streams
Replies: 0
Views: 501

wxTextCtrl and Streams

Ok, There have been several topics on this and in various places, however I still have not found a working example that uses the wxStream classes to stream to the wxTextCtrl. Background: I have some information that I want to display to a text control and later write the same information to a file. ...
by MichaelWard
Tue Jun 26, 2007 2:34 pm
Forum: C++ Development
Topic: Separate the net working from the Main GUI thread
Replies: 4
Views: 2083

This does not work for anyone looking on how to handle socket events inside another thread! It will appear to work but it is not doing what you think. The thread will just loop and call sleep. It will not handle any messages. The main thread is actually running when you call the event function. This...
by MichaelWard
Fri Jun 22, 2007 8:55 pm
Forum: C++ Development
Topic: How to use UDP Sockets with wxWidgets
Replies: 4
Views: 2230

Yeah changing it to AnyAddress() solved the problem. I thought I had tried it before. (Probably while I was still trying to get port numbers figured out) However now that I solved the issue with getting the sockets to at least work to some degree, trying to get them to work well is a daunting task. ...
by MichaelWard
Fri Jun 22, 2007 3:02 pm
Forum: C++ Development
Topic: How to use UDP Sockets with wxWidgets
Replies: 4
Views: 2230

I still cannot get sockets with wxWidgets to work. I've stepped through the source code and it does not look like it is binding the address correctly... I can use the following code and it works correctly. ( Windows specific using blocking no error checking etc..) WSAData wsaData; long retval; SOCKE...
by MichaelWard
Thu Jun 21, 2007 7:21 pm
Forum: C++ Development
Topic: How to use UDP Sockets with wxWidgets
Replies: 4
Views: 2230

How to use UDP Sockets with wxWidgets

I am currently using wxWidgets 2.6.3. In this verison the wxDatagram class etc are all considered to be "alpha" but i've read other posts that claim it works and is stable. I've done socket programing using MFC, win32 and java. I am assuming the wxWidget implementation is similiar to the M...
by MichaelWard
Tue Jan 23, 2007 3:27 pm
Forum: C++ Development
Topic: crashing due to memory leaks
Replies: 10
Views: 3104

Giles: I currently dynamically link my wxwidget programs to the wxWidget DLL as opposed to statically linking them. I also link my widgets programs to various other DLL's. Are you trying to link to the wxWidgets DLL that gives you all the classes, or did you create your own DLL with new classes etc ...
by MichaelWard
Mon Jan 08, 2007 2:54 pm
Forum: C++ Development
Topic: How can I know when a wxPanel or a control in it gets focus
Replies: 2
Views: 822

I don't think the Panel can really ever gain focus as a Panel is just a collection of other controls. If you want to catch the focus event of any of the controls inside the panel you have to catch the event for each one of those controls. 1) Write an event handler for each of the controls. or 2) Wri...
by MichaelWard
Thu Dec 28, 2006 10:58 pm
Forum: C++ Development
Topic: wxTreeCtrl - Printing out contents(other than id)
Replies: 12
Views: 2444

Hmm. I am going to assume you understand classes and C++. There however is little to do on the wxWidget Side. wxWidgets allows you to store a pointer for each of the nodes in the tree. This is the wxTreeItemData. All the varioius functions for adding, and getting a node on the tree allow you to pass...
by MichaelWard
Thu Dec 28, 2006 10:08 pm
Forum: C++ Development
Topic: wxTreeCtrl - Printing out contents(other than id)
Replies: 12
Views: 2444

Anyways.... What you do is make a class that is a subclass of wxTreeItemData. IE) enum eFRUIT_TYPE { APPLE = 0, ORANGE = 1 }; class Fruit : public wxTreeItemData { // Constructor , destructor etc public: eFRUIT_TYPE m_Type; wxString str1,str2,str3,str4; // As many String as you need. // Perhaps make...
by MichaelWard
Thu Dec 28, 2006 7:18 pm
Forum: C++ Development
Topic: wxTreeCtrl - Printing out contents(other than id)
Replies: 12
Views: 2444

This is kinda weird. What happens if you have an Apple Tab, and an Orange Tab. Your apple tab has 3 text controls, ie) 3 properties. Your Orange tab control has only 1 text control, 1 property. For some reason you want the tree control to be shared between both of them. What is suppose to happen, if...
by MichaelWard
Thu Dec 28, 2006 7:06 pm
Forum: C++ Development
Topic: What's wrong with this code??
Replies: 2
Views: 790

The reason why you have a memory leak is because you are using the clone() function. Events have a clone function because when you add them to the event handler it clones them so it has its own copy of the event that can be used later to process the event. If this didn't happen then there would be p...
by MichaelWard
Wed Dec 27, 2006 5:59 pm
Forum: C++ Development
Topic: I want set event on click for button but I don't want use...
Replies: 22
Views: 4101

Not sure what you are trying to do here. I think you need to take a look at what you are doing from a high level view. Almost all, I do stress almost all button handlers for buttons are handled in the owner of the button or something else that owns the button. IE) You have a panel with buttons on it...
by MichaelWard
Wed Dec 27, 2006 5:33 pm
Forum: C++ Development
Topic: I want set event on click for button but I don't want use...
Replies: 22
Views: 4101

If you look at the connect function, one of the parameters passed is the buttons ID. When you create GUI objects you should assign them all a unique ID. table[i]->Connect(table[i]->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(Project1Frm::OnButtonClick), NULL, this); You see that the...