diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-16 20:33:28 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-16 20:33:28 -0400 |
| commit | e34c561ed5bedeb180437ec165882b98d70d38c1 (patch) | |
| tree | d095e5db16d7a23e883526c8c1d3c524639c97cf /new/ui_windows.h | |
| parent | de9d72299fb89a8b6cdc8963cd6b6ae708a81e80 (diff) | |
Split the rewrite into a new repository.
Diffstat (limited to 'new/ui_windows.h')
| -rw-r--r-- | new/ui_windows.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/new/ui_windows.h b/new/ui_windows.h deleted file mode 100644 index 806cac1..0000000 --- a/new/ui_windows.h +++ /dev/null @@ -1,59 +0,0 @@ -// 7 april 2015 - -/* -This file assumes that you have included <windows.h> and "ui.h" beforehand. It provides API-specific functions for interfacing with foreign controls in Windows. -*/ - -#ifndef __UI_UI_WINDOWS_H__ -#define __UI_UI_WINDOWS_H__ - -// Correctness macros. -#define uiControlHWND(c) ((HWND) uiControlHandle(c)) -#define uiParentHWND(p) ((HWND) uiParentHandle(p)) - -// uiWindowsNewControl() initializes the given uiControl with the given Windows API control inside. -// You will need to provide the preferredSize() method yourself. -typedef struct uiWindowsNewControlParams uiWindowsNewControlParams; -struct uiWindowsNewControlParams { - // These match the CreateWindowExW() function. - DWORD dwExStyle; - LPCWSTR lpClassName; - LPCWSTR lpWindowName; - DWORD dwStyle; // WS_CHILD and WS_VISIBLE are automatically applied. - HINSTANCE hInstance; - - // Set this to non-FALSE to use the standard control font used by other ui controls. - BOOL useStandardControlFont; - - // These are called when the control sends a WM_COMMAND or WM_NOTIFY (respectively) to its parent. - // ui redirects the message back and calls these functions. - // Store the result in *lResult and return any non-FALSE value (such as TRUE) to return the given result; return FALSE to pass the notification up to your window procedure. - // Note that these are only issued if they come from the uiControl itself; notifications from children of the uiControl (such as a header control) will be received normally. - BOOL (*onWM_COMMAND)(uiControl *c, WORD code, LRESULT *lResult); - BOOL (*onWM_NOTIFY)(uiControl *c, NMHDR *nm, LRESULT *lResult); - // This is called in WM_DESTROY. - void (*onWM_DESTROY)(uiControl *c); -}; -void uiWindowsNewControl(uiControl *c, uiWindowsNewControlParams *p); - -// This contains the Windows-specific parts of the uiSizing structure. -// baseX and baseY are the dialog base units. -// internalLeading is the standard control font's internal leading; labels in uiForms use this for correct Y positioning. -struct uiSizingSys { - int baseX; - int baseY; - LONG internalLeading; -}; -// Use these in your preferredSize() implementation with baseX and baseY. -#define uiDlgUnitsToX(dlg, baseX) MulDiv((dlg), baseX, 4) -#define uiDlgUnitsToY(dlg, baseY) MulDiv((dlg), baseY, 8) - -// and use this if you need the text of the window width -extern intmax_t uiWindowsWindowTextWidth(HWND hwnd); - -// these functions get and set the window text for such a uiControl -// the value returned should be freed with uiFreeText() -extern char *uiWindowsControlText(uiControl *); -extern void uiWindowsControlSetText(uiControl *, const char *); - -#endif |
