本文整理汇总了C++中CEditUI::GetManager方法的典型用法代码示例。如果您正苦于以下问题:C++ CEditUI::GetManager方法的具体用法?C++ CEditUI::GetManager怎么用?C++ CEditUI::GetManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEditUI
的用法示例。
在下文中一共展示了CEditUI::GetManager方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
void CEditWnd::Init(CEditUI* pOwner)
{
m_pOwner = pOwner;
RECT rcPos = CalPos();
UINT uStyle = WS_CHILD | ES_AUTOHSCROLL;
if( m_pOwner->IsPasswordMode() ) uStyle |= ES_PASSWORD;
Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos);
HFONT hFont=NULL;
int iFontIndex=m_pOwner->GetFont();
if (iFontIndex!=-1)
hFont=m_pOwner->GetManager()->GetFont(iFontIndex);
if (hFont==NULL)
hFont=m_pOwner->GetManager()->GetDefaultFontInfo()->hFont;
SetWindowFont(m_hWnd, hFont, TRUE);
Edit_LimitText(m_hWnd, m_pOwner->GetMaxChar());
if( m_pOwner->IsPasswordMode() ) Edit_SetPasswordChar(m_hWnd, m_pOwner->GetPasswordChar());
Edit_SetText(m_hWnd, m_pOwner->GetText());
Edit_SetModify(m_hWnd, FALSE);
SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(0, 0));
Edit_Enable(m_hWnd, m_pOwner->IsEnabled() == true);
Edit_SetReadOnly(m_hWnd, m_pOwner->IsReadOnly() == true);
//Styls
LONG styleValue = ::GetWindowLong(m_hWnd, GWL_STYLE);
styleValue |= pOwner->GetWindowStyls();
::SetWindowLong(GetHWND(), GWL_STYLE, styleValue);
::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE);
::SetFocus(m_hWnd);
m_bInit = true;
}
示例2: Init
void CEditWnd::Init(CEditUI* pOwner)
{
m_pOwner = pOwner;
RECT rcPos = CalPos();
UINT uStyle = WS_CHILD | ES_AUTOHSCROLL;
if (m_pOwner->IsPasswordMode()) uStyle |= ES_PASSWORD;
Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos);
SetWindowFont(m_hWnd, m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->hFont, TRUE);
Edit_LimitText(m_hWnd, m_pOwner->GetMaxChar());
if (m_pOwner->IsPasswordMode()) Edit_SetPasswordChar(m_hWnd, m_pOwner->GetPasswordChar());
Edit_SetText(m_hWnd, m_pOwner->GetText());
Edit_SetModify(m_hWnd, FALSE);
SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(0, 0));
Edit_Enable(m_hWnd, m_pOwner->IsEnabled() == true);
Edit_SetReadOnly(m_hWnd, m_pOwner->IsReadOnly() == true);
::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE);
::SetFocus(m_hWnd);
m_bInit = true;
}
示例3: OnFinalMessage
void CEditWnd::OnFinalMessage(HWND hWnd)
{
m_pOwner->Invalidate();
// Clear reference and die
if( m_hBkBrush != NULL ) ::DeleteObject(m_hBkBrush);
if (m_pOwner->GetManager()->IsLayered()) {
m_pOwner->GetManager()->RemovePaintChildWnd(hWnd);
}
m_pOwner->m_pWindow = NULL;
delete this;
}
示例4: OnEditChanged
LRESULT CEditWnd::OnEditChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
if( !m_bInit ) return 0;
if( m_pOwner == NULL ) return 0;
// Copy text back
int cchLen = ::GetWindowTextLength(m_hWnd) + 1;
LPTSTR pstr = static_cast<LPTSTR>(_alloca(cchLen * sizeof(TCHAR)));
ASSERT(pstr);
if( pstr == NULL ) return 0;
::GetWindowText(m_hWnd, pstr, cchLen);
m_pOwner->m_sText = pstr;
m_pOwner->GetManager()->SendNotify(m_pOwner, DUI_MSGTYPE_TEXTCHANGED);
if( m_pOwner->GetManager()->IsLayered() ) m_pOwner->Invalidate();
return 0;
}
示例5: HandleMessage
LRESULT CEditWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT lRes = 0;
BOOL bHandled = TRUE;
if( uMsg == WM_KILLFOCUS ) lRes = OnKillFocus(uMsg, wParam, lParam, bHandled);
else if( uMsg == OCM_COMMAND ) {
if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_CHANGE ) lRes = OnEditChanged(uMsg, wParam, lParam, bHandled);
else if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_UPDATE ) {
RECT rcClient;
::GetClientRect(m_hWnd, &rcClient);
::InvalidateRect(m_hWnd, &rcClient, FALSE);
}
}
else if( uMsg == WM_KEYDOWN && TCHAR(wParam) == VK_RETURN ) {
m_pOwner->GetManager()->SendNotify(m_pOwner, _T("return"));
}
else if( uMsg == OCM__BASE + WM_CTLCOLOREDIT || uMsg == OCM__BASE + WM_CTLCOLORSTATIC ) {
if( m_pOwner->GetNativeEditBkColor() == 0xFFFFFFFF ) return NULL;
::SetBkMode((HDC)wParam, TRANSPARENT);
DWORD dwTextColor = m_pOwner->GetTextColor();
::SetTextColor((HDC)wParam, RGB(GetBValue(dwTextColor),GetGValue(dwTextColor),GetRValue(dwTextColor)));
if( m_hBkBrush == NULL ) {
DWORD clrColor = m_pOwner->GetNativeEditBkColor();
m_hBkBrush = ::CreateSolidBrush(RGB(GetBValue(clrColor), GetGValue(clrColor), GetRValue(clrColor)));
}
return (LRESULT)m_hBkBrush;
}
else if( uMsg == WM_CHAR && TCHAR(wParam) == VK_RETURN && (0 == (::GetWindowLong(m_hWnd,GWL_STYLE) & ES_MULTILINE)))
{
//È¥µô°´RETURN¼üʱ ßË ÉùÏì by rz.li 2013/01/10
}
else bHandled = FALSE;
if( !bHandled ) return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
return lRes;
}
示例6: CalPos
RECT CEditWnd::CalPos()
{
CDuiRect rcPos = m_pOwner->GetPos();
RECT rcInset = m_pOwner->GetTextPadding();
rcPos.left += rcInset.left;
rcPos.top += rcInset.top;
rcPos.right -= rcInset.right;
rcPos.bottom -= rcInset.bottom;
LONG lEditHeight = m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->tm.tmHeight;
if( lEditHeight < rcPos.GetHeight() ) {
rcPos.top += (rcPos.GetHeight() - lEditHeight) / 2;
rcPos.bottom = rcPos.top + lEditHeight;
}
return rcPos;
}
示例7: OnEdit
LRESULT CEditWnd::OnEdit(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
if (m_pOwner->m_pAutoCompleteMode == None)
{
return 0;
}
if (m_AutoCompleteThread)
{
TerminateThread(m_AutoCompleteThread, NULL);
CloseHandle(m_AutoCompleteThread);
m_AutoCompleteThread = NULL;
}
m_AutoCompleteThread = CreateThread(NULL, NULL, m_AutoCompleteProc, this, NULL, NULL);
m_pOwner->GetManager()->SendNotify(m_pOwner, _T("edit"));
return 0;
}
示例8: HandleMessage
LRESULT CEditWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT lRes = 0;
BOOL bHandled = TRUE;
if( uMsg == WM_CREATE ) {
if( m_pOwner->GetManager()->IsLayered() ) {
::SetTimer(m_hWnd, DEFAULT_TIMERID, ::GetCaretBlinkTime(), NULL);
}
bHandled = FALSE;
}
else if( uMsg == WM_KILLFOCUS ) lRes = OnKillFocus(uMsg, wParam, lParam, bHandled);
else if( uMsg == OCM_COMMAND ) {
if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_CHANGE ) lRes = OnEditChanged(uMsg, wParam, lParam, bHandled);
else if( GET_WM_COMMAND_CMD(wParam, lParam) == EN_UPDATE ) {
RECT rcClient;
::GetClientRect(m_hWnd, &rcClient);
::InvalidateRect(m_hWnd, &rcClient, FALSE);
}
}
else if( uMsg == WM_KEYDOWN && TCHAR(wParam) == VK_RETURN ) {
m_pOwner->GetManager()->SendNotify(m_pOwner, DUI_MSGTYPE_RETURN);
}
else if( uMsg == OCM__BASE + WM_CTLCOLOREDIT || uMsg == OCM__BASE + WM_CTLCOLORSTATIC ) {
if (m_pOwner->GetManager()->IsLayered() && !m_pOwner->GetManager()->IsPainting()) {
m_pOwner->GetManager()->AddPaintChildWnd(m_hWnd);
}
if( m_pOwner->GetNativeEditBkColor() == 0xFFFFFFFF ) return NULL;
::SetBkMode((HDC)wParam, TRANSPARENT);
DWORD dwTextColor = m_pOwner->GetTextColor();
::SetTextColor((HDC)wParam, RGB(GetBValue(dwTextColor),GetGValue(dwTextColor),GetRValue(dwTextColor)));
if( m_hBkBrush == NULL ) {
DWORD clrColor = m_pOwner->GetNativeEditBkColor();
m_hBkBrush = ::CreateSolidBrush(RGB(GetBValue(clrColor), GetGValue(clrColor), GetRValue(clrColor)));
}
return (LRESULT)m_hBkBrush;
}
else if( uMsg == WM_PAINT) {
if (m_pOwner->GetManager()->IsLayered()) {
m_pOwner->GetManager()->AddPaintChildWnd(m_hWnd);
}
bHandled = FALSE;
}
else if( uMsg == WM_PRINT ) {
if (m_pOwner->GetManager()->IsLayered()) {
lRes = CWindowWnd::HandleMessage(uMsg, wParam, lParam);
if( m_pOwner->IsEnabled() && m_bDrawCaret ) { // todo:ÅжÏÊÇ·ñenabled
RECT rcClient;
::GetClientRect(m_hWnd, &rcClient);
POINT ptCaret;
::GetCaretPos(&ptCaret);
RECT rcCaret = { ptCaret.x, ptCaret.y, ptCaret.x, ptCaret.y+rcClient.bottom-rcClient.top };
CRenderEngine::DrawLine((HDC)wParam, rcCaret, 1, 0xFF000000);
}
return lRes;
}
bHandled = FALSE;
}
else if( uMsg == WM_TIMER ) {
if (wParam == DEFAULT_TIMERID) {
m_bDrawCaret = !m_bDrawCaret;
RECT rcClient;
::GetClientRect(m_hWnd, &rcClient);
::InvalidateRect(m_hWnd, &rcClient, FALSE);
return 0;
}
bHandled = FALSE;
}
else bHandled = FALSE;
if( !bHandled ) return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
return lRes;
}