Page 1 of 1

Custom native wxTextCtrl

Posted: Sat Feb 21, 2015 10:23 pm
by TheDelta
Hey there,

I'm trying to give the wxTextCrl a custom skin ( background, text color, caret color, selection color )

I went ahead and though it would be a good idea to start from scratch - so currently I have a nice buggy version of a text ctrl... :oops:

I then tried to simply overwrite wxTextCtrl and use my custom drawing code, apparently what happens is that as soon as I write something, the default version simply draws over my custom draw code :(
( I assume it's because of the native control and it's not possible to overwrite it then )

Does someone know what would be the way to achieve this?
Should I maybe use wxTextCtrlBase and then simply write all wxTextCtrl functions by myself?

Any hints are highly appreciated - painting seems somehow such a big thing in WX apparently :)

Re: Custom native wxTextCtrl

Posted: Sat Feb 21, 2015 11:14 pm
by doublemax
Implementing a whole wxTextCtrl from scratch will be a lot of work. I'd try to use the wxUniversal implementation of wxTextCtrl as a base. It can be found in <wxdir>/src/univ/textctrl.cpp

Re: Custom native wxTextCtrl

Posted: Sat Feb 21, 2015 11:43 pm
by TheDelta
haha yeah seams like a huge task. :(

I'll try my luck with wxRichTextCtrl and I'll see how far I can go with this.

But thanks for the tip with the univ version - I totally forgot about that #-o