diff --git a/header/mrpwincontrols.h b/header/mrpwincontrols.h index c08812f..ac85260 100644 --- a/header/mrpwincontrols.h +++ b/header/mrpwincontrols.h @@ -121,7 +121,7 @@ class WinButton : public WinControl class WinLabel : public WinControl { public: - WinLabel(MRPWindow* parent, std::string text); + WinLabel(MRPWindow* parent, std::string text, bool alignright=false); void setText(std::string text); std::string getText(); diff --git a/source/mrpwincontrols.cpp b/source/mrpwincontrols.cpp index 19c2c39..8e0df13 100644 --- a/source/mrpwincontrols.cpp +++ b/source/mrpwincontrols.cpp @@ -225,10 +225,13 @@ bool WinButton::handleMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) return false; } -WinLabel::WinLabel(MRPWindow* parent, std::string text) : WinControl(parent) +WinLabel::WinLabel(MRPWindow* parent, std::string text, bool alignright) : WinControl(parent) { + DWORD styleflags = WS_CHILD | WS_TABSTOP; + if (alignright) + styleflags = WS_CHILD | WS_TABSTOP | SS_RIGHT; #ifdef WIN32 - m_hwnd = CreateWindow("STATIC", "label", WS_CHILD | WS_TABSTOP, 0, 0, 10, 10, parent->getWindowHandle(), + m_hwnd = CreateWindow("STATIC", "label", styleflags, 0, 0, 10, 10, parent->getWindowHandle(), (HMENU)g_control_counter, g_hInst, 0); #else m_hwnd = SWELL_MakeLabel(-1, text.c_str(), g_control_counter, 0, 0, 20, 20, 0); diff --git a/source/xendynamicprocessor.cpp b/source/xendynamicprocessor.cpp index de8a39f..af6854f 100644 --- a/source/xendynamicprocessor.cpp +++ b/source/xendynamicprocessor.cpp @@ -94,7 +94,7 @@ DynamicsProcessorWindow::DynamicsProcessorWindow(HWND parent) : MRPWindow(parent } }; add_control(m_windowsizecombo1); - m_windowsizelabel1 = std::make_shared(this, "Window size"); + m_windowsizelabel1 = std::make_shared(this, "Window size",true); add_control(m_windowsizelabel1); m_slider1 = std::make_shared(this);