Home » U++ Library support » U++ Library : Other (not classified elsewhere) » subclassing LineEdit is ugly
Re: subclassing LineEdit is ugly [message #2368 is a reply to message #2366] |
Sun, 09 April 2006 22:11   |
 |
mirek
Messages: 14266 Registered: November 2005
|
Ultimate Member |
|
|
hojtsy wrote on Sun, 09 April 2006 15:46 | I am trying to subclass LineEdit, to create some kind of terminal window, where the user can only enter after the last character of the text.
|
Well, I would rather solved that by putting LineEdit to readonly mode, used it as child of my real Ctrl and feeded characters from outside (using Insert/Remove). See how Console is done in TheIDE.... (but maybe look for pre-603 version, adding HYDRA support made it much more complicated).
Quote: |
It seems quite much possible, but the resulting code would have lot of copy-paste from library code. It would be much easier to subclass LineEdit after the following desired modifications:
1) make these methods virtual, so that I can replace them:
PlaceCaretNoG
InsertChar
DeleteChar
Backspace
AlignChar
2) Extract to a new virtual method this last part of LineEdit::Key, so that I can replace this code in a subclass.
|
Ah, well, but where this should stop? Should we make all methods everywhere public and virtual? 
Quote: |
Additionally please correct the error in the quoted code that WhenBar hotkeys are not working in read-only LineEdits.
|
[/quote]
Hopefuly fixed.
Mirek
|
|
|
Goto Forum:
Current Time: Fri Jul 18 10:43:55 CEST 2025
Total time taken to generate the page: 0.03897 seconds
|