Search found 1059 matches

by JimFairway
Sat Aug 04, 2012 7:11 pm
Forum: C++ Development
Topic: UDP Sockets
Replies: 2
Views: 963

Re: UDP Sockets

Hi,

I've used wxDatagramSocket without issue.

Jim
by JimFairway
Sat May 05, 2012 11:03 pm
Forum: C++ Development
Topic: operator[]
Replies: 12
Views: 3043

Re: operator[]

Hi, The compiler is trying to copy the object "ram" to the object bin[ keyNo ], hence it's looking for the "operator=" method. I think you would have a similar problem for because the compiler doesn't know how to copy a RAM object: ram = bin[ keyNo ]; See: http://www.learncpp.com/cpp-tutorial/911-th...
by JimFairway
Sat Apr 07, 2012 10:14 am
Forum: C++ Development
Topic: How to select a wxGrid row with right click
Replies: 2
Views: 1758

Re: How to select a wxGrid row with right click

Hi Joe, How about catching the wxEVT_GRID_CELL_RIGHT_CLICK event? I modified the sample in /samples/grid/ by adding the following : EVT_GRID_CELL_RIGHT_CLICK( GridFrame::OnCellRightClick ) void GridFrame::OnCellRightClick( wxGridEvent& ev ) { grid->SelectRow(ev.GetRow()); } Hope that's what you're l...
by JimFairway
Sat Mar 03, 2012 8:04 pm
Forum: C++ Development
Topic: Object attributes and events
Replies: 6
Views: 1587

Re: Object attributes and events

Hi, If you're asking why this didn't work: button->Connect(wxEVT_COMMAND_BUTTON_CLICKED,wxCommandEventHandler(App::buttonClicked)); It's different from the code I posted in that you don't specify which object is the sink object for the event. So it defaults to the button itself see: http://docs.wxwi...
by JimFairway
Sat Mar 03, 2012 3:44 pm
Forum: C++ Development
Topic: Object attributes and events
Replies: 6
Views: 1587

Re: Object attributes and events

Hi,

I think you want:

Code: Select all

button->Connect(wxEVT_COMMAND_BUTTON_CLICKED,wxCommandEventHandler(App::buttonClicked),NULL,this);
That tells the button to send its event to the wxApp object.

Hope that helps,

Jim
by JimFairway
Sat Mar 03, 2012 2:46 pm
Forum: C++ Development
Topic: Event when resize has finished?
Replies: 8
Views: 2131

Re: Event when resize has finished?

Yes, I reckon. The event happens when the main loop has nothing left to do.
Worth a shot.

Jim
by JimFairway
Fri Mar 02, 2012 8:44 pm
Forum: C++ Development
Topic: Event when resize has finished?
Replies: 8
Views: 2131

Re: Event when resize has finished?

Hi,

Additionally to David's suggestion, you could catch the wxIdleEvent which is sent after UI activity has settled down.
Check http://docs.wxwidgets.org/stable/wx_wxidleevent.html

Good luck,

Jim
by JimFairway
Wed Feb 29, 2012 8:59 pm
Forum: C++ Development
Topic: sharing wxSocket in same application
Replies: 11
Views: 1990

Re: sharing wxSocket in same application

Hi, Will it work this way If I only block the socket and not whole UI? Not sure what you mean by this. Are you asking if socket should be blocked while you're waiting for a response? If you want to allow the UI to continue to operate, you can turn the socket into half-duplex, 1 send, followed by 1 r...
by JimFairway
Sat Feb 25, 2012 7:07 pm
Forum: C++ Development
Topic: sharing wxSocket in same application
Replies: 11
Views: 1990

Re: sharing wxSocket in same application

Hi, You could keep the history of the messages sent to the server in a list in your program . When a response is received from the server, determine if the response is from the first message. If it is, process the response, if not, check the second and so on. I doubt the server would provide respons...
by JimFairway
Fri Feb 24, 2012 7:56 pm
Forum: C++ Development
Topic: sharing wxSocket in same application
Replies: 11
Views: 1990

Re: sharing wxSocket in same application

Hi, The issue is less one of sharing the socket for send and receive, it's already set up for that. It's more an issue of retaining state, and connecting responses to queries. Is there anything in the response that you can use to connect to a specific command? For example, if the response had some t...
by JimFairway
Fri Feb 24, 2012 12:19 pm
Forum: C++ Development
Topic: sharing wxSocket in same application
Replies: 11
Views: 1990

Re: sharing wxSocket in same application

Hi, Reading and writing are totally independent. I.e. you can write whenever you want, even if you're in the middle of reading something. Are you trying to synchronize a command / response style? E.g. The user enters "Get this data from server", which is sent to the server and then when the response...
by JimFairway
Fri Feb 24, 2012 12:48 am
Forum: C++ Development
Topic: wxFileDialog
Replies: 2
Views: 560

Re: wxFileDialog

Hi,

Have a look at the Dialogs example in your /wx/samples folder.
Check out the generic dialog file, I suppose you could modify the source code to fit your purposes (i.e. take out the navigation controls that allows the user to get to a different folder.

Hope that helps,

Jim
by JimFairway
Fri Feb 24, 2012 12:41 am
Forum: C++ Development
Topic: sharing wxSocket in same application
Replies: 11
Views: 1990

Re: sharing wxSocket in same application

Hi, If you want to re-use the socket, then you have to have some way of making the receiver know the type of data it's receiving. A simple way of doing that is to prepend some special byte sequence before the messages. For example, in the code you posted in method void MainFrame::OnClientReadData if...
by JimFairway
Sat Feb 18, 2012 11:20 pm
Forum: C++ Development
Topic: Access Violation Getting User Input?
Replies: 3
Views: 1038

Re: Access Violation Getting User Input?

Hi,

Beyond what David describes, this code:

Code: Select all

BEGIN_EVENT_TABLE (BasicFrame, wxFrame)
EVT_BUTTON (wxID_EXIT, BasicFrame::OnExit)
END_EVENT_TABLE()
Is better off in your implementation file, rather than your .h file. You're likely to get link errors when you include basic.h into another file.

Jim
by JimFairway
Sat Feb 18, 2012 7:29 pm
Forum: C++ Development
Topic: Simple question (I hope)
Replies: 5
Views: 1282

Re: Simple question (I hope)

Will that also work for checks like 0x0F07 & 0x0004 = true while 0x0F07 & 0x0008 = false
Yes it will...
See the description for bitwise AND here: http://www.cprogramming.com/tutorial/bi ... ators.html

Jim