int firstChar; /* first character position being shown */
newtEntryFilter filter;
void * filterData;
+ int cs;
+ int csDisabled;
};
static int previous_char(const char *buf, int pos);
en->cursorPosition = 0;
}
+ en->cs = NEWT_COLORSET_ENTRY;
+ en->csDisabled = NEWT_COLORSET_DISENTRY;
+
return co;
}
if (!co->isMapped) return;
if (en->flags & NEWT_FLAG_DISABLED)
- SLsmg_set_color(NEWT_COLORSET_DISENTRY);
+ SLsmg_set_color(en->csDisabled);
else
- SLsmg_set_color(NEWT_COLORSET_ENTRY);
+ SLsmg_set_color(en->cs);
if (en->flags & NEWT_FLAG_HIDDEN) {
newtGotorc(co->top, co->left);
newtGotorc(row, col);
}
+void newtEntrySetColors(newtComponent co, int normal, int disabled) {
+ struct entry * en = co->data;
+
+ en->cs = normal;
+ en->csDisabled = disabled;
+ entryDraw(co);
+}
+
static void entryDestroy(newtComponent co) {
struct entry * en = co->data;
en->filter = filter;
en->filterData = data;
}
+
+int newtEntryGetCursorPosition (newtComponent co) {
+ struct entry * en = co->data;
+
+ return en->cursorPosition;
+}
+
+void newtEntrySetCursorPosition (newtComponent co, int position) {
+ struct entry * en = co->data;
+
+ en->cursorPosition = position;
+}