MCPcopy Create free account
hub / github.com/cinience/RedisStudio / Init

Method Init

DuiLib/Control/UIEdit.cpp:33–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 }
32
33 void CEditWnd::Init(CEditUI* pOwner)
34 {
35 m_pOwner = pOwner;
36 RECT rcPos = CalPos();
37 UINT uStyle = WS_CHILD | ES_AUTOHSCROLL;
38 if( m_pOwner->IsPasswordMode() ) uStyle |= ES_PASSWORD;
39 Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos);
40 HFONT hFont=NULL;
41 int iFontIndex=m_pOwner->GetFont();
42 if (iFontIndex!=-1)
43 hFont=m_pOwner->GetManager()->GetFont(iFontIndex);
44 if (hFont==NULL)
45 hFont=m_pOwner->GetManager()->GetDefaultFontInfo()->hFont;
46
47 SetWindowFont(m_hWnd, hFont, TRUE);
48 Edit_LimitText(m_hWnd, m_pOwner->GetMaxChar());
49 if( m_pOwner->IsPasswordMode() ) Edit_SetPasswordChar(m_hWnd, m_pOwner->GetPasswordChar());
50 Edit_SetText(m_hWnd, m_pOwner->GetText());
51 Edit_SetModify(m_hWnd, FALSE);
52 SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(0, 0));
53 Edit_Enable(m_hWnd, m_pOwner->IsEnabled() == true);
54 Edit_SetReadOnly(m_hWnd, m_pOwner->IsReadOnly() == true);
55 //Styls
56 LONG styleValue = ::GetWindowLong(m_hWnd, GWL_STYLE);
57 styleValue |= pOwner->GetWindowStyls();
58 ::SetWindowLong(GetHWND(), GWL_STYLE, styleValue);
59 ::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE);
60 ::SetFocus(m_hWnd);
61 m_bInit = true;
62 }
63
64 RECT CEditWnd::CalPos()
65 {

Callers 2

OnCreateMethod · 0.45
DoEventMethod · 0.45

Calls 11

IsPasswordModeMethod · 0.80
GetPaintWindowMethod · 0.80
GetManagerMethod · 0.80
GetDefaultFontInfoMethod · 0.80
GetMaxCharMethod · 0.80
GetPasswordCharMethod · 0.80
IsEnabledMethod · 0.80
GetWindowStylsMethod · 0.80
GetFontMethod · 0.45
GetTextMethod · 0.45
IsReadOnlyMethod · 0.45

Tested by

no test coverage detected