tagging release
[dasher.git] / Src / Win32 / ModuleControlString.cpp
blobc3b787529efdc202cff7063a8a6b7b35d430d51a
1 #include "ModuleControlString.h"
3 int CModuleControlString::GetHeightRequest() {
4 return 14;
7 void CModuleControlString::Initialise(CDasherInterfaceBase *pInterface) {
8 std::wstring strText;
9 WinUTF8::UTF8string_to_wstring(pInterface->GetStringParameter(m_iId), strText);
10 SendMessage(m_hEntry, WM_SETTEXT, 0, (LPARAM)strText.c_str());
13 void CModuleControlString::Apply(CDasherInterfaceBase *pInterface) {
14 TCHAR tcBuffer[256];
15 SendMessage(m_hEntry, WM_GETTEXT, 100, (LPARAM)tcBuffer);
17 std::string strUTF8Text;
18 WinUTF8::wstring_to_UTF8string(tcBuffer, strUTF8Text);
20 pInterface->SetStringParameter(m_iId, strUTF8Text);
23 void CModuleControlString::CreateChild(HWND hParent) {
24 m_hEntry = CreateWindowEx(WS_EX_CONTROLPARENT | WS_EX_CLIENTEDGE, TEXT("EDIT"), NULL,
25 WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 0, 0, 0, hParent, NULL, WinHelper::hInstApp, NULL);
27 HGDIOBJ hGuiFont;
28 hGuiFont = GetStockObject(DEFAULT_GUI_FONT);
30 SendMessage(m_hEntry, WM_SETFONT, (WPARAM)hGuiFont, (LPARAM)true);
33 void CModuleControlString::LayoutChild(RECT &sRect) {
34 ::MoveWindow(m_hEntry, sRect.left, sRect.top, sRect.right - sRect.left, sRect.bottom - sRect.top, TRUE);