wxTextCtrl "hard" maximum

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
arnoldemu
In need of some credit
In need of some credit
Posts: 7
Joined: Mon Dec 29, 2014 12:59 pm

wxTextCtrl "hard" maximum

Post by arnoldemu » Mon Oct 17, 2016 7:10 am

Hi,

I can set a max text length on a wxTextCtrl with SetMaxLength. I see this as setting a "soft" maximum limit - i.e. the limit defined by the wxTextCtrl itself and which I can control directly.

Some OSes have a maximum supported "hard" limit for a wxTextCtrl. e.g. in the documentation it says:

"Use rich text control under MSW, this allows to have more than 64KB of text in the control. This style is ignored under other platforms. "

Is there a way to query the "hard" limit for each OS?

(I have a dialog where a user can drag and drop a text file into a wxTextCtrl and I want to tell them if they have dragged in a file that is too large to show in a wxTextCtrl).

Thanks.

Manolo
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 696
Joined: Mon Apr 30, 2012 11:07 pm

Re: wxTextCtrl "hard" maximum

Post by Manolo » Mon Oct 17, 2016 4:23 pm

Some limits I know of:
MSWin XP: 32K
MSWin with "Rich text" style: No limit for multiline control
GTK2/3 : 64K

For larger amounts of text perhaps you need to implement your own [scrolled] window.

Post Reply