Forum > FV/Textmode IDE

TMemo or TEdit without Frame in a TScroller with different color ... How To ?

(1/1)

paule32:
Hello,
I have a TMemo that I would like to use as Text-Input.
It works, but I get a red background, with a white or cyan Text Color.
That is not what I want !

I have tried to set the Palette, but the color of the TMemo is alway red.
Here, I have using C++ Code, but I think it should do be able to use it
under FPC like under C++:


--- Code: C  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---class PL_dBaseSourceMemoEditor: public TEditor {public:        PL_dBaseSourceMemoEditor(                const TRect& bounds,                TScrollBar * vsb,                TScrollBar * hsb,                TIndicator * ind,  uint32_t len) :                TEditor(bounds,vsb,hsb,ind, len) {        }         TPalette& getPalette() const        {                #define cpdBaseMemoEditor "\x1a\x17"                                static TPalette palette(                cpdBaseMemoEditor, sizeof( cpdBaseMemoEditor)-1 );                                return palette;        }                void handleEvent( TEvent& event ) {                if ( event.what != evKeyDown || event.keyDown.keyCode != kbTab )                TEditor::handleEvent(event);        }}; 
in a TWindow sub class, I use:


--- Code: C  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---auto *memo = new PL_dBaseSourceMemoEditor(        TRect(28,1, 22+22+22+6,21),        vScrollBar,        hScrollBar,        new TIndicator(TRect(40,13,20,24)),65255);insert( memo ); 
Would be great, if someone can help me with this
Thank you !

Navigation

[0] Message Index

Go to full version