Search found 2240 matches

by evstevemd
Wed Jul 24, 2019 3:30 pm
Forum: C++ Development
Topic: wxExecute and wxProcess: Dealing with Interactive commands
Replies: 6
Views: 143

Re: wxExecute and wxProcess: Dealing with Interactive commands

Hi, there are input and output streams of the process. process sends to you text strings via its output stream and reads your text input via process input stream. see functions GetInputStream, GetOutputStream of the process. one gives you a stream - with read functions(its what the process is writin...
by evstevemd
Wed Jul 24, 2019 2:07 pm
Forum: C++ Development
Topic: wxTextCtrl caret disapeared
Replies: 3
Views: 87

Re: wxTextCtrl caret disapeared

Add at the end of focus event so that you don't disturb normal procession

Code: Select all

event.Skip();
Your code becomes:

Code: Select all

void MainFrame::OnProductNumberFieldClicked(wxFocusEvent& event) {
	// focus flag
	product_number_got_focus = true;
	event.Skip();
}
by evstevemd
Wed Jul 24, 2019 6:30 am
Forum: C++ Development
Topic: wxExecute and wxProcess: Dealing with Interactive commands
Replies: 6
Views: 143

wxExecute and wxProcess: Dealing with Interactive commands

Hi, I have a working wxExecute/wxProcess code working fine. But am having hard time to deal with interactive commands. Here is an example of such commmand and how it works on terminal rm -rfvi deletedAlready/ examine files in directory deletedAlready/? y remove deletedAlready//1.txt? n remove delete...
by evstevemd
Mon Jul 22, 2019 6:19 pm
Forum: C++ Development
Topic: Save and load data in txt file
Replies: 5
Views: 118

Re: Save and load data in txt file

For general purpose there is wxTextFile
https://wiki.wxwidgets.org/Reading_text_from_a_file
by evstevemd
Thu Jul 18, 2019 8:18 am
Forum: C++ Development
Topic: Creating Socket in secondary thread confusion
Replies: 2
Views: 85

Re: Creating Socket in secondary thread confusion

Hi, Code looks ok for me. Can you provide MCVE for reproducing the behaviour? I have been puzzled for quiet long time only to find I was modifying a copy of source files not the one in project so I was actually changing nothing on actual code I was compiling. Stupid error indeed! :oops: The document...
by evstevemd
Wed Jul 17, 2019 9:44 pm
Forum: C++ Development
Topic: Creating Socket in secondary thread confusion
Replies: 2
Views: 85

Creating Socket in secondary thread confusion

I'm creating wxSocketClient instance and I use block mode as advised m_socket = new wxSocketClient(wxSOCKET_BLOCK|wxSOCKET_WAITALL); m_socket->Notify(false); //disables socket events wxIPV4address addr; addr.AnyAddress(); addr.Service(port); if(m_socket->Connect(addr, true)) { wxPuts(wxString::Forma...
by evstevemd
Wed Jul 17, 2019 8:36 pm
Forum: C++ Development
Topic: Program crash when use insert MySQL query
Replies: 5
Views: 134

Re: Program crash when use insert MySQL query

Hi, The problem is solved. The error was below the code after INSERT Because there's no need for this down after the command insert res = mysql_store_result(conn); row = mysql_fetch_row(res); I apologize for starting issues but do not mind, because I'm new to c ++ code blocks IDE Thx Have you though...
by evstevemd
Tue Jul 16, 2019 7:04 pm
Forum: C++ Development
Topic: Advice on dealing with wxSocket and wxThread
Replies: 6
Views: 124

Re: Advice on dealing with wxSocket and wxThread

Hi,
doublemax wrote:
Tue Jul 16, 2019 4:21 pm
The queue should not be in the thread. I'd put it in an object with longer lifetime, e.g. a wxFrame and pass a pointer to it into the thread ctor.
Got it!
Thank you!
by evstevemd
Tue Jul 16, 2019 4:15 pm
Forum: C++ Development
Topic: Advice on dealing with wxSocket and wxThread
Replies: 6
Views: 124

Re: Advice on dealing with wxSocket and wxThread

Thank you. That is very helpful! One more question the thread class will have to have a getter for wxMessageQueue object so that I can do something like: wxThreadClass : wxThread { //ctor and entry method here public: const SomePayloadQueue& GetQueue() const { return _data_queue; } private: SomePayl...
by evstevemd
Tue Jul 16, 2019 2:26 pm
Forum: C++ Development
Topic: Advice on dealing with wxSocket and wxThread
Replies: 6
Views: 124

Re: Advice on dealing with wxSocket and wxThread

Hi, In principle that looks fine, but you could have used wxMessageQueue, which does more or less the same thing. https://docs.wxwidgets.org/trunk/classwx_message_queue_3_01_t_01_4.html I have read about that class as I was looking for the solution but could not find a way how to use it. Docs does n...
by evstevemd
Tue Jul 16, 2019 1:49 pm
Forum: C++ Development
Topic: Advice on dealing with wxSocket and wxThread
Replies: 6
Views: 124

Advice on dealing with wxSocket and wxThread

I have one design issue that I cannot find solution. I have blocking sockets so I don't want them in the UI thread. So I create dedicated wxThread only to hold sockets. Now Every time application have data it pushes into the socket class. Am not sure how to do that effectively. My first idea was to ...
by evstevemd
Tue Jul 16, 2019 6:03 am
Forum: C++ Development
Topic: Change WxPropertyGrid based on button click
Replies: 9
Views: 189

Re: Change WxPropertyGrid based on button click

gillp28 wrote:
Mon Jul 15, 2019 6:43 pm
Thanks
Did that work?
by evstevemd
Mon Jul 15, 2019 6:16 pm
Forum: C++ Development
Topic: Print Command Output preserving special
Replies: 4
Views: 97

Re: Print Command Output preserving special

Thanks for the link. Very useful indeed.
I will have to tackle the two first, one bit at a time. I'll see where I will end
by evstevemd
Mon Jul 15, 2019 4:42 pm
Forum: C++ Development
Topic: Print Command Output preserving special
Replies: 4
Views: 97

Re: Print Command Output preserving special

As for the non-ascii characters, wxWidgets can display them, the problem is probably the character encoding of the console output. Once you know that (which is probably platform dependent) it should be easy to convert it to Unicode. Knowing encoding I think might be one of most difficult for me. I ...
by evstevemd
Mon Jul 15, 2019 5:41 am
Forum: C++ Development
Topic: Print Command Output preserving special
Replies: 4
Views: 97

Print Command Output preserving special

Does wxWidgets have any widget that can take command output from wxExecute and display it preserving non ASCII characters (like √) and color? I need to print output of command and it prints different colors for different message. I just don't have enough time to make yet another virtual terminal emu...