Search found 49 matches

by Kvaz1r
Mon Apr 22, 2019 6:22 am
Forum: C++ Development
Topic: I need a very simple example to know how to use threads with wxGauge
Replies: 9
Views: 137

Re: I need a very simple example to know how to use threads with wxGauge

while (!TestDestroy()) { wxQueueEvent(m_frame, new wxThreadEvent(wxEVT_PROGRESSBAR_UPDATE)); } The problem is that the "thread_ThreadUpdate" method is executed continuously and the thread doesn't move to the next method "thread_ThreadFinished", Why? Why it should finished? Your operation only check...
by Kvaz1r
Sat Apr 20, 2019 6:36 pm
Forum: C++ Development
Topic: Read access violation when closing my app
Replies: 5
Views: 72

Re: Read access violation when closing my app

Thank you. I hope you give me a page from the documentation which confirms your talking. It's popular question so wxWidgets developers puted answer into special FAQ. Who deletes all the windows I create? All windows and controls in wxWidgets programs are created using new but you shouldn’t use dele...
by Kvaz1r
Sat Apr 20, 2019 2:34 pm
Forum: C++ Development
Topic: I need a very simple example to know how to use threads with wxGauge
Replies: 9
Views: 137

Re: I need a very simple example to know how to use threads with wxGauge

As far I know it's better do not use GUI stuff from others thread. So just send message(event) from worker thread and set value for your wxGauge.
I guess you can find something similar in thread sample.
by Kvaz1r
Mon Apr 15, 2019 2:28 pm
Forum: C++ Development
Topic: How to resize the "Sizer" dynamically (at runtime)
Replies: 5
Views: 70

Re: How to resize the "Sizer" dynamically (at runtime)

I'm not quite sure but you can try set new size after label changes via:

Code: Select all

this->SetSize(this->GetBestSize());
for your window.
by Kvaz1r
Thu Apr 11, 2019 4:18 pm
Forum: C++ Development
Topic: closing wxProgressDialog with a wxThread
Replies: 17
Views: 215

Re: closing wxProgressDialog with a wxThread

mael15 wrote:
Thu Apr 11, 2019 2:22 pm
i think my problem is stuck between wxThread and wxProgressDialog, so the sample does not seem to help.
Did you check thread sample? It's contain an example with wxProgressDialog.
by Kvaz1r
Wed Apr 10, 2019 9:50 am
Forum: C++ Development
Topic: How to get differences in days between two dates?
Replies: 2
Views: 53

Re: How to get differences in days between two dates?

Great it works, thank you.
by Kvaz1r
Wed Apr 10, 2019 8:40 am
Forum: C++ Development
Topic: How to get differences in days between two dates?
Replies: 2
Views: 53

How to get differences in days between two dates?

According to the documentation GetTotalDays/0 count only days and weeks. So this code : wxDateTime dt1,dt2; wxString::const_iterator end; dt1.ParseFormat("10.04.2019", "%d.%m.%Y", &end); dt2.ParseFormat("09.03.2019", "%d.%m.%Y", &end); dt1.DiffAsDateSpan(dt2).GetTotalDays() will give 1 as result. Is...
by Kvaz1r
Wed Mar 27, 2019 8:04 am
Forum: Compiler / Linking / IDE Related
Topic: Use wxFileDialog in wxFormbuilder (?)
Replies: 5
Views: 152

Re: Use wxFileDialog in wxFormbuilder (?)

You are right, sorry about that. I am very inattentive.
by Kvaz1r
Mon Mar 25, 2019 4:24 pm
Forum: C++ Development
Topic: Use a backgroud image for a dialog
Replies: 6
Views: 106

Re: Use a backgroud image for a dialog

Remove wxImagePanel and move all painting to your dialog or use panel as dialog (I'm not sure about this, but guess it's also possible).

But, what exactly do you want to achieve? Maybe here XY problem.
by Kvaz1r
Mon Mar 25, 2019 3:58 pm
Forum: Compiler / Linking / IDE Related
Topic: Use wxFileDialog in wxFormbuilder (?)
Replies: 5
Views: 152

Re: Use wxFileDialog in wxFormbuilder (?)

You can do it via wfFB. wxFileDialog located in "Additional" tab at eight position if count from left to right.
by Kvaz1r
Mon Mar 25, 2019 11:15 am
Forum: C++ Development
Topic: Use a backgroud image for a dialog
Replies: 6
Views: 106

Re: Use a backgroud image for a dialog

You need to handle wxPaintEvent for your dialog. If I missed something in your question it would be better provide MCVE for reproducing the behaviour.
by Kvaz1r
Tue Mar 19, 2019 4:12 pm
Forum: C++ Development
Topic: Writing to binary file crashes application
Replies: 6
Views: 101

Re: Writing to binary file crashes application

It would be much better to have full code for reproducing the error. Can you provide MCVE?
by Kvaz1r
Tue Mar 19, 2019 1:14 pm
Forum: wxCode
Topic: draw a specific area in the wxChartPanel
Replies: 4
Views: 115

Re: draw a specific area in the wxChartPanel

Unfortunately I don't know other options except change source code of the library and implement area chart manually :)
by Kvaz1r
Tue Mar 19, 2019 11:47 am
Forum: C++ Development
Topic: How to manually validate wxTextCtrl value
Replies: 15
Views: 256

Re: How to manually validate wxTextCtrl value

I agree the behaviour looks like a bug. As for now you can use something like this(I a bit adapted code from above): #include <wx/wx.h> #include <wx/valnum.h> class MyDialog : public wxDialog { public: MyDialog() : wxDialog(NULL, wxID_ANY, "Test") { //m_textData = "123"; m_floatValue = 123; wxBoxSiz...