From: ewt Date: Wed, 17 Apr 1996 00:38:48 +0000 (+0000) Subject: added textbox widget X-Git-Tag: 0-1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31790a87f389368c149e8419d3d4dc8bea7e3ef0;p=thirdparty%2Fnewt.git added textbox widget --- diff --git a/newt.c b/newt.c index a49cc16..1c7cca4 100644 --- a/newt.c +++ b/newt.c @@ -41,6 +41,8 @@ struct newtColors newtDefaultColorPalette = { "blue", "lightgray", /* label fg, bg */ "red", "lightgray", /* listbox fg, bg */ "lightgray", "red", /* active listbox fg, bg */ + "red", "lightgray", /* textbox fg, bg */ + "lightgray", "red", /* active textbox fg, bg */ }; static struct keymap keymap[] = { @@ -128,6 +130,9 @@ void newtSetColors(struct newtColors colors) { SLtt_set_color(COLORSET_LISTBOX, "", colors.listboxFg, colors.listboxBg); SLtt_set_color(COLORSET_ACTLISTBOX, "", colors.actListboxFg, colors.actListboxBg); + SLtt_set_color(COLORSET_TEXTBOX, "", colors.textboxFg, colors.textboxBg); + SLtt_set_color(COLORSET_ACTTEXTBOX, "", colors.actTextboxFg, + colors.actTextboxBg); } int newtGetKey(void) { diff --git a/newt.h b/newt.h index ae9d874..62e70ae 100644 --- a/newt.h +++ b/newt.h @@ -15,6 +15,8 @@ struct newtColors { char * labelFg, * labelBg; char * listboxFg, * listboxBg; char * actListboxFg, * actListboxBg; + char * textboxFg, * textboxBg; + char * actTextboxFg, * actTextboxBg; }; extern struct newtColors newtDefaultColorPalette; @@ -52,6 +54,12 @@ void newtScrollbarSet(newtComponent co, int where, int total); newtComponent newtListbox(int left, int top, int height, int flags); void newtListboxAddEntry(newtComponent co, char * text); +#define NEWT_TEXTBOX_WRAP (1 << 0) +#define NEWT_TEXTBOX_SCROLL (1 << 1) + +newtComponent newtTextbox(int left, int top, int with, int height, int flags); +void newtTextboxSetText(newtComponent co, const char * text); + newtComponent newtForm(newtComponent vertBar); void newtFormAddComponent(newtComponent form, newtComponent co); void newtFormAddComponents(newtComponent form, ...);