diff options
| author | Arisotura <thetotalworm@gmail.com> | 2020-05-29 21:36:26 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-29 21:36:26 +0200 | 
| commit | 0cadd4bd12bc824d010396c855fa450774e6f619 (patch) | |
| tree | 7f404a52ff372a1e2e785db2b8cf11736f2f3212 /src/libui_sdl/libui/windows/label.cpp | |
| parent | cd7487d53f8207277fc44f7983513fe6892a3409 (diff) | |
| parent | 8ddd82ca2c7c8844a1d3c2cc7418d03976c9c52e (diff) | |
Merge pull request #635 from Arisotura/qt
Qt
Diffstat (limited to 'src/libui_sdl/libui/windows/label.cpp')
| -rw-r--r-- | src/libui_sdl/libui/windows/label.cpp | 57 | 
1 files changed, 0 insertions, 57 deletions
| diff --git a/src/libui_sdl/libui/windows/label.cpp b/src/libui_sdl/libui/windows/label.cpp deleted file mode 100644 index d74b7d1..0000000 --- a/src/libui_sdl/libui/windows/label.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// 11 april 2015 -#include "uipriv_windows.hpp" - -struct uiLabel { -	uiWindowsControl c; -	HWND hwnd; -}; - -uiWindowsControlAllDefaults(uiLabel) - -// via http://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx#sizingandspacing -#define labelHeight 8 - -static void uiLabelMinimumSize(uiWindowsControl *c, int *width, int *height) -{ -	uiLabel *l = uiLabel(c); -	uiWindowsSizing sizing; -	int y; - -	*width = uiWindowsWindowTextWidth(l->hwnd); -	y = labelHeight; -	uiWindowsGetSizing(l->hwnd, &sizing); -	uiWindowsSizingDlgUnitsToPixels(&sizing, NULL, &y); -	*height = y; -} - -char *uiLabelText(uiLabel *l) -{ -	return uiWindowsWindowText(l->hwnd); -} - -void uiLabelSetText(uiLabel *l, const char *text) -{ -	uiWindowsSetWindowText(l->hwnd, text); -	// changing the text might necessitate a change in the label's size -	uiWindowsControlMinimumSizeChanged(uiWindowsControl(l)); -} - -uiLabel *uiNewLabel(const char *text) -{ -	uiLabel *l; -	WCHAR *wtext; - -	uiWindowsNewControl(uiLabel, l); - -	wtext = toUTF16(text); -	l->hwnd = uiWindowsEnsureCreateControlHWND(0, -		L"static", wtext, -		// SS_LEFTNOWORDWRAP clips text past the end; SS_NOPREFIX avoids accelerator translation -		// controls are vertically aligned to the top by default (thanks Xeek in irc.freenode.net/#winapi) -		SS_LEFTNOWORDWRAP | SS_NOPREFIX, -		hInstance, NULL, -		TRUE); -	uiFree(wtext); - -	return l; -} |