diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-15 18:49:45 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-15 18:49:45 -0400 |
| commit | 518a5ddbf15d50a254c732a80d5907ef8878abe0 (patch) | |
| tree | 48cf259f98994e4570e65c389fcd9824272884ad /new/windows/entry.c | |
| parent | 50ae3ca045e7f5f5744043df0a4506e2f6930bb1 (diff) | |
Split all OS backends into their own folders.
Diffstat (limited to 'new/windows/entry.c')
| -rw-r--r-- | new/windows/entry.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/new/windows/entry.c b/new/windows/entry.c new file mode 100644 index 0000000..2297c28 --- /dev/null +++ b/new/windows/entry.c @@ -0,0 +1,67 @@ +// 8 april 2015 +#include "uipriv_windows.h" + +struct entry { +}; + +static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult) +{ + return FALSE; +} + +static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult) +{ + return FALSE; +} + +static void onWM_DESTROY(uiControl *c) +{ + struct entry *e = (struct entry *) (c->data); + + uiFree(e); +} + +// from http://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx#sizingandspacing +#define entryWidth 107 /* this is actually the shorter progress bar width, but Microsoft only indicates as wide as necessary */ +#define entryHeight 14 + +static void preferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *height) +{ + *width = uiDlgUnitsToX(entryWidth, d->sys->baseX); + *height = uiDlgUnitsToY(entryHeight, d->sys->baseY); +} + +uiControl *uiNewEntry(void) +{ + uiControl *c; + struct entry *e; + uiWindowsNewControlParams p; + + p.dwExStyle = WS_EX_CLIENTEDGE; + p.lpClassName = L"edit"; + p.lpWindowName = L""; + p.dwStyle = ES_AUTOHSCROLL | ES_LEFT | ES_NOHIDESEL | WS_TABSTOP; + p.hInstance = hInstance; + p.useStandardControlFont = TRUE; + p.onWM_COMMAND = onWM_COMMAND; + p.onWM_NOTIFY = onWM_NOTIFY; + p.onWM_DESTROY = onWM_DESTROY; + c = uiWindowsNewControl(&p); + + c->preferredSize = preferredSize; + + e = uiNew(struct entry); + c->data = e; + + return c; +} + +char *uiEntryText(uiControl *c) +{ + return uiWindowsControlText(c); +} + +void uiEntrySetText(uiControl *c, const char *text) +{ + uiWindowsControlSetText(c, text); +} |
