Search found 144 matches

by Tapsa
Tue Feb 09, 2016 4:36 pm
Forum: C++ Development
Topic: How to change wxListCtrl selected item appearance?
Replies: 2
Views: 440

How to change wxListCtrl selected item appearance?

I tried using virtual wxListItemAttr* OnGetItemAttr(long item) const; that returns pointer to my wxListItemAttr(*wxWHITE, *wxCYAN, *wxNORMAL_FONT); but it seems to affect only the items that are not selected. I want to change the selected item background to be always blue, not only when the list has...
by Tapsa
Mon Jan 25, 2016 7:05 pm
Forum: C++ Development
Topic: How to make scrolling wxScrolledWindow smoother?
Replies: 11
Views: 1914

Re: How to make scrolling wxScrolledWindow smoother?

All right then. 30% is huge amount. If only changing the search function from O(n) to O(log n) or better would take most of that 30% away, I think it's worth doing so.
by Tapsa
Mon Jan 25, 2016 4:40 pm
Forum: C++ Development
Topic: How to make scrolling wxScrolledWindow smoother?
Replies: 11
Views: 1914

Re: How to make scrolling wxScrolledWindow smoother?

I actually added idle event handler recently. It shows wxMessageBox and uses SetFocus if one boolean is true. Not connecting it has no effect. In your test if you scrolled really fast and then before the end stopped scrolling or reversed scrolling, did the scrolling stop immediately or after some ti...
by Tapsa
Mon Jan 25, 2016 8:35 am
Forum: C++ Development
Topic: How to make scrolling wxScrolledWindow smoother?
Replies: 11
Views: 1914

Re: How to make scrolling wxScrolledWindow smoother?

It's not the most complex page. I had it uploaded before and easily available to link. That particular page has so few items that I only get flickering when resizing the whole window. These issues are quite insignificant on my high end PC, but many users have old laptops. It would be nice to improve...
by Tapsa
Sun Jan 24, 2016 10:38 pm
Forum: C++ Development
Topic: How to make scrolling wxScrolledWindow smoother?
Replies: 11
Views: 1914

Re: How to make scrolling wxScrolledWindow smoother?

If this kind of look can be achieved using wxGrid or wxDataViewCtrl and scrolling performance increases clearly, I can try them. https://pslhya-ch3302.files.1drv.com/y3mDWYGQLcKKMz5_zF4Z0hXelWYCoAM1dDxRaM372BlEhDpPFZJdDS8PJichBW9_dWDCP1lJSotIlJ2nNj_FMINgriSHsEQjcroYvX6YVA6hyth49C-R0-qEwXMDvL03i4eVDy...
by Tapsa
Sun Jan 24, 2016 6:56 pm
Forum: C++ Development
Topic: How to make scrolling wxScrolledWindow smoother?
Replies: 11
Views: 1914

Re: How to make scrolling wxScrolledWindow smoother?

Sounds pretty much like my problem. Clicking oh the scroll bar arrows works just fine though. But using mouse wheel it indeed makes Desktop Window Manager use CPU massively. My PC has Win 10, but this also happens on Win 7. I also experience noticeable lag in another scrolled window that has 300 tex...
by Tapsa
Sun Jan 24, 2016 4:00 pm
Forum: C++ Development
Topic: How to make scrolling wxScrolledWindow smoother?
Replies: 11
Views: 1914

How to make scrolling wxScrolledWindow smoother?

I have some wxScrolledWindows with hundreds of controls in them. When using mouse wheel to scroll, the CPU usage reaches 100 % and stays until scrolling stops. So far I tried catching mouse scrolling event and only processing them if at least 200 ms had passed. That reduced the CPU usage to under 50...
by Tapsa
Sat Jan 23, 2016 6:48 pm
Forum: C++ Development
Topic: How to make \n appear in wxTextCtrl?
Replies: 8
Views: 861

Re: How to make \n appear in wxTextCtrl?

Thank you. I had lots to do so took a while before testing this.
Apparently Resource Hacker and Resource Tuner both replace 0x0A with \n.
by Tapsa
Sat Jan 23, 2016 5:00 pm
Forum: C++ Development
Topic: How to make \n appear in wxTextCtrl?
Replies: 8
Views: 861

Re: How to make \n appear in wxTextCtrl?

Using hex viewer I can see "42 00 6C 00 6F 00 63 00 6B 00 0A 00 50 00 72 00 69 00 6E 00 74 00 69 00 6E 00 67 00" so yes it has 0A aka new line.
by Tapsa
Sat Jan 23, 2016 4:49 pm
Forum: C++ Development
Topic: How to make \n appear in wxTextCtrl?
Replies: 8
Views: 861

Re: How to make \n appear in wxTextCtrl?

They are strings loaded from DLL. I would rather have them shown as they are.
Block\nPrinting
by Tapsa
Sat Jan 23, 2016 4:18 pm
Forum: C++ Development
Topic: How to make \n appear in wxTextCtrl?
Replies: 8
Views: 861

How to make \n appear in wxTextCtrl?

I have constructed wxTextCtrls using: wxTextCtrl(parent, wxID_ANY, "", wxDefaultPosition, dimensions, wxTE_MULTILINE) \n in the strings is neither converted to actual new line nor displayed in any way. It is completely omitted in the wxTextCtrl. How can I make it appear as \n or as new line? I'm usi...
by Tapsa
Tue Sep 08, 2015 5:43 pm
Forum: C++ Development
Topic: How to connect wxThread events?
Replies: 6
Views: 796

Re: How to connect wxThread events?

:D all right
by Tapsa
Tue Sep 08, 2015 5:10 pm
Forum: C++ Development
Topic: How to connect wxThread events?
Replies: 6
Views: 796

Re: How to connect wxThread events?

Apparently I can do all of my execution inside Entry() and call Refresh() from there. No need to connect anything. I also have only 2 functions now. One that creates the thread and one that executes it. There is still slight lag caused by Refresh(), but maybe it is unavoidable.
by Tapsa
Tue Sep 08, 2015 3:47 pm
Forum: C++ Development
Topic: How to hide image reading errors?
Replies: 1
Views: 368

How to hide image reading errors?

I am loading JPEG images using: wxString types = "*.jpg"; wxDir::GetAllFiles(dir_pixs, &pixs, types); if(!pixs.IsEmpty()) { int pix = rng() % pixs.GetCount(); pic = wxImage(pixs[pix], wxBITMAP_TYPE_JPEG); mirror->Refresh(); } if(pic.IsOk()) { dc.DrawBitmap(wxBitmap(pic), centerX - picX, centerY - pi...
by Tapsa
Tue Sep 08, 2015 11:33 am
Forum: C++ Development
Topic: How to connect wxThread events?
Replies: 6
Views: 796

Re: How to connect wxThread events?

Yes indeed. Maybe I can use wxIdleEvent then. But is it necessary to use some macros with wxThread?