Search found 539 matches
- Mon Apr 20, 2020 7:42 pm
- Forum: C++ Development
- Topic: wxPanel on another panel, repaint using a lot CPU
- Replies: 14
- Views: 1871
Re: wxPanel on another panel, repaint using a lot CPU
wxBufferedPaintDC bpdc(this); bpdc.SetDeviceClippingRegion(GetUpdateRegion()); Here you should definitely use the wxBufferedPaintDC overload that takes a wxBitmap &buffer as paramter. This buffer bitmap should be static and only get (re-) created when the client size changes. This should save s...
- Mon Apr 20, 2020 9:22 am
- Forum: C++ Development
- Topic: wxPanel on another panel, repaint using a lot CPU
- Replies: 14
- Views: 1871
Re: wxPanel on another panel, repaint using a lot CPU
I meant a real, complete wxFrame, an independent toplevel window for the tooltip, that you position at the correct coordinates. Cool idea, tried it, but it leads to ~20% higher cpu load than wxPanel. Only with wxFrame it is not the wxPaintEvent of the underlying panel but SetPosition and SetSizeHin...
- Mon Apr 20, 2020 7:00 am
- Forum: C++ Development
- Topic: wxPanel on another panel, repaint using a lot CPU
- Replies: 14
- Views: 1871
Re: wxPanel on another panel, repaint using a lot CPU
Are you drawing individual circles? The biggest part of cpu usage comes from wxDc::DrawBitmap on a wxBufferedPaintDC. The circles are already painted on a wxBitmap earlier. Additionally, you can update only the "dirty" rectangles. Check the code snippet using GetUpdateRegion() from here: ...
- Sun Apr 19, 2020 8:38 am
- Forum: C++ Development
- Topic: wxPanel on another panel, repaint using a lot CPU
- Replies: 14
- Views: 1871
Re: wxPanel on another panel, repaint using a lot CPU
There must be drawing issue somewhere. Can I make drawing faster (less CPU hungry) by somehow not having to draw the whole background on every little mouse movement? Maybe using https://docs.wxwidgets.org/3.1.2/classwx_d_c_clipper.html ? Also, are you sure you cannot use a wx(Rich)ToolTip instead o...
- Fri Apr 17, 2020 10:44 am
- Forum: C++ Development
- Topic: wxSpinCtrlDouble with comma
- Replies: 6
- Views: 849
Re: wxSpinCtrlDouble with comma
My general idea was that you let wxLocale handle the control and use these two functions to control the content of the PDFs. But apparently that's not an option. I understand, that is certainly the cleanest option, but like I said a LOT of work in my specific case. This works, it is kind of dirty b...
- Fri Apr 17, 2020 10:16 am
- Forum: C++ Development
- Topic: wxSpinCtrlDouble with comma
- Replies: 6
- Views: 849
Re: wxSpinCtrlDouble with comma
Can you reverse this? That would make more sense to me. That is what would make a lot of work, and only for a comma/dot in this one control. And what do you mean with "language of the pdf"? My app can be in one of four languages and create pdfs in some other of these languages. I don't kn...
- Fri Apr 17, 2020 9:23 am
- Forum: C++ Development
- Topic: wxSpinCtrlDouble with comma
- Replies: 6
- Views: 849
Re: wxSpinCtrlDouble with comma
I see what you mean, in my first post I used a minimal sample without wxLocale to be able to post code quickly. It does work as expected in my full app with wxLocale. The specific problem is, I have two possible languages in my app: the language of the app and the language of pdfs created by the app...
- Fri Apr 17, 2020 8:31 am
- Forum: C++ Development
- Topic: wxSpinCtrlDouble with comma
- Replies: 6
- Views: 849
wxSpinCtrlDouble with comma
hello everyone, when it comes to floating point numbers there always is the problem of internationalization. I want users to be able to use their numbers block to enter a floating point number, in Germany that means typing a comma instead of a dot. I could check every keyboard entry for a comma and ...
- Thu Apr 16, 2020 9:34 am
- Forum: C++ Development
- Topic: wxTextCtrl SelectAll() when clicking on it
- Replies: 9
- Views: 1195
Re: wxTextCtrl SelectAll() when clicking on it
much more elegant, thanx again!
- Tue Apr 14, 2020 8:57 pm
- Forum: C++ Development
- Topic: wxPanel on another panel, repaint using a lot CPU
- Replies: 14
- Views: 1871
- Tue Apr 14, 2020 8:45 pm
- Forum: C++ Development
- Topic: wxTextCtrl SelectAll() when clicking on it
- Replies: 9
- Views: 1195
Re: wxTextCtrl SelectAll() when clicking on it
Using CallAfter() for SetSelection() instead when idle seems easier, it did not work? WAY better, because onIdle is called over and over and makes it impossible to enter values by keyboard with more than one number, because the selection is refreshed over and over. now it is perfect. :D :D class My...
- Tue Apr 14, 2020 8:20 pm
- Forum: C++ Development
- Topic: wxPanel on another panel, repaint using a lot CPU
- Replies: 14
- Views: 1871
wxPanel on another panel, repaint using a lot CPU
I have a custom wxPanel to show infos about whatever is under the cursor (the orange panel) panelOnBtmp.jpg this is a wxPanel and I copy all the underlying bitmaps every time the mouse moves and the panel with it. This uses a lot of CPU, but when I do not copy the bitmaps while the mouse is moving, ...
- Tue Apr 14, 2020 8:12 pm
- Forum: C++ Development
- Topic: wxTextCtrl SelectAll() when clicking on it
- Replies: 9
- Views: 1195
Re: wxTextCtrl SelectAll() when clicking on it
How about using wxFocusEvent instead of the mouse event? Yes! And some weird tip from some other post about the timing of the event and that the selection should occur when idle: class MySpinCtrl : public wxSpinCtrl { public: MySpinCtrl(wxWindow* par) : wxSpinCtrl(par, wxID_ANY, wxEmptyString, wxDe...
- Tue Apr 14, 2020 7:16 pm
- Forum: C++ Development
- Topic: wxTextCtrl SelectAll() when clicking on it
- Replies: 9
- Views: 1195
Re: wxTextCtrl SelectAll() when clicking on it
that is a little embarrasing, thank you. this was only a more simple test for doing the same thing with wxSpinCtrl, seems to be different there? onLeftUp is not called and I do not know how to reach the wxTextCtrl component? class MySpinCtrl : public wxSpinCtrl { public: MySpinCtrl(wxWindow* par) : ...
- Tue Apr 14, 2020 6:27 pm
- Forum: C++ Development
- Topic: wxTextCtrl SelectAll() when clicking on it
- Replies: 9
- Views: 1195
wxTextCtrl SelectAll() when clicking on it
hello everyone, I cannot get a wxTextCtrl to select its content when clicking on it. It works only once. I use wxMSW 3.1.3. class MyTextCtrl : public wxTextCtrl { public: MyTextCtrl(wxWindow* par, wxString val) : wxTextCtrl(par, wxID_ANY, val, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER) { ...