Custom native wxTextCtrl Topic is solved

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
TheDelta
Earned a small fee
Earned a small fee
Posts: 12
Joined: Sun Sep 15, 2013 10:35 am

Custom native wxTextCtrl

Post 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 :)
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Custom native wxTextCtrl

Post 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
Use the source, Luke!
TheDelta
Earned a small fee
Earned a small fee
Posts: 12
Joined: Sun Sep 15, 2013 10:35 am

Re: Custom native wxTextCtrl

Post 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
Post Reply