Added Password and Search Entries. Now for the implementation.
This commit is contained in:
parent
6ebdc96b93
commit
d0be2979e4
|
@ -45,6 +45,8 @@ static void openTestWindow(uiBox *(*mkf)(void))
|
||||||
// TODO nonscrolling and scrolling areas?
|
// TODO nonscrolling and scrolling areas?
|
||||||
BA(uiNewFontButton());
|
BA(uiNewFontButton());
|
||||||
BA(uiNewColorButton());
|
BA(uiNewColorButton());
|
||||||
|
BA(uiNewPasswordEntry());
|
||||||
|
BA(uiNewSearchEntry());
|
||||||
|
|
||||||
uiControlShow(uiControl(w));
|
uiControlShow(uiControl(w));
|
||||||
}
|
}
|
||||||
|
@ -54,11 +56,21 @@ static void buttonClicked(uiButton *b, void *data)
|
||||||
openTestWindow((uiBox *(*)(void)) data);
|
openTestWindow((uiBox *(*)(void)) data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void entryChanged(uiEntry *e, void *data)
|
||||||
|
{
|
||||||
|
char *text;
|
||||||
|
|
||||||
|
text = uiEntryText(e);
|
||||||
|
printf("%s entry changed: %s\n", (const char *) data, text);
|
||||||
|
uiFreeText(text);
|
||||||
|
}
|
||||||
|
|
||||||
uiBox *makePage13(void)
|
uiBox *makePage13(void)
|
||||||
{
|
{
|
||||||
uiBox *page13;
|
uiBox *page13;
|
||||||
uiRadioButtons *rb;
|
uiRadioButtons *rb;
|
||||||
uiButton *b;
|
uiButton *b;
|
||||||
|
uiEntry *e;
|
||||||
|
|
||||||
page13 = newVerticalBox();
|
page13 = newVerticalBox();
|
||||||
|
|
||||||
|
@ -81,5 +93,13 @@ uiBox *makePage13(void)
|
||||||
uiButtonOnClicked(b, buttonClicked, uiNewVerticalBox);
|
uiButtonOnClicked(b, buttonClicked, uiNewVerticalBox);
|
||||||
uiBoxAppend(page13, uiControl(b), 0);
|
uiBoxAppend(page13, uiControl(b), 0);
|
||||||
|
|
||||||
|
e = uiNewPasswordEntry();
|
||||||
|
uiEntryOnChanged(e, entryChanged, "password");
|
||||||
|
uiBoxAppend(page13, uiControl(e), 0);
|
||||||
|
|
||||||
|
e = uiNewSearchEntry();
|
||||||
|
uiEntryOnChanged(e, entryChanged, "search");
|
||||||
|
uiBoxAppend(page13, uiControl(e), 0);
|
||||||
|
|
||||||
return page13;
|
return page13;
|
||||||
}
|
}
|
||||||
|
|
2
ui.h
2
ui.h
|
@ -136,6 +136,8 @@ _UI_EXTERN void uiEntryOnChanged(uiEntry *e, void (*f)(uiEntry *e, void *data),
|
||||||
_UI_EXTERN int uiEntryReadOnly(uiEntry *e);
|
_UI_EXTERN int uiEntryReadOnly(uiEntry *e);
|
||||||
_UI_EXTERN void uiEntrySetReadOnly(uiEntry *e, int readonly);
|
_UI_EXTERN void uiEntrySetReadOnly(uiEntry *e, int readonly);
|
||||||
_UI_EXTERN uiEntry *uiNewEntry(void);
|
_UI_EXTERN uiEntry *uiNewEntry(void);
|
||||||
|
_UI_EXTERN uiEntry *uiNewPasswordEntry(void);
|
||||||
|
_UI_EXTERN uiEntry *uiNewSearchEntry(void);
|
||||||
|
|
||||||
typedef struct uiLabel uiLabel;
|
typedef struct uiLabel uiLabel;
|
||||||
#define uiLabel(this) ((uiLabel *) (this))
|
#define uiLabel(this) ((uiLabel *) (this))
|
||||||
|
|
Loading…
Reference in New Issue