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++:
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:
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 !