summaryrefslogtreecommitdiff
path: root/new/windows/entry.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-16 20:33:28 -0400
committerPietro Gagliardi <[email protected]>2015-04-16 20:33:28 -0400
commite34c561ed5bedeb180437ec165882b98d70d38c1 (patch)
treed095e5db16d7a23e883526c8c1d3c524639c97cf /new/windows/entry.c
parentde9d72299fb89a8b6cdc8963cd6b6ae708a81e80 (diff)
Split the rewrite into a new repository.
Diffstat (limited to 'new/windows/entry.c')
-rw-r--r--new/windows/entry.c69
1 files changed, 0 insertions, 69 deletions
diff --git a/new/windows/entry.c b/new/windows/entry.c
deleted file mode 100644
index 22c108a..0000000
--- a/new/windows/entry.c
+++ /dev/null
@@ -1,69 +0,0 @@
-// 8 april 2015
-#include "uipriv_windows.h"
-
-struct entry {
- uiEntry e;
-};
-
-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;
-
- 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);
-}
-
-static char *getText(uiEntry *e)
-{
- return uiWindowsControlText(uiControl(e));
-}
-
-static void setText(uiEntry *e, const char *text)
-{
- uiWindowsControlSetText(uiControl(e), text);
-}
-
-uiEntry *uiNewEntry(void)
-{
- struct entry *e;
- uiWindowsNewControlParams p;
-
- e = uiNew(struct entry);
-
- 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;
- uiWindowsNewControl(uiControl(e), &p);
-
- uiControl(e)->PreferredSize = preferredSize;
-
- uiEntry(e)->Text = getText;
- uiEntry(e)->SetText = setText;
-
- return uiEntry(e);
-}