本文整理汇总了C++中CPaintManagerUI类的典型用法代码示例。如果您正苦于以下问题:C++ CPaintManagerUI类的具体用法?C++ CPaintManagerUI怎么用?C++ CPaintManagerUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CPaintManagerUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ViCbAddCtrl
// BOOL ViCbAddCtrl(HANDLE hCtrl, HANDLE hParent)
SQInteger ViCbAddCtrl(HSQUIRRELVM v)
{
SQInteger nargs = sq_gettop(v);
SQInteger hCtrl = 0;
SQInteger hParent = 0;
CContainerUI* pParentCtrl = NULL;
CScriptMgr* pMgr = NULL;
CPaintManagerUI* pPM = NULL;
CControlUI* pCtrl = NULL;
SQBool bRet = FALSE;
if (!v || 2 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 3)) {goto _Exit_;}
sq_getinteger(v, 2, &hCtrl);
sq_getinteger(v, 3, &hParent);
pCtrl = QiHwHandleToCtrl(hCtrl);
pParentCtrl = (CContainerUI*)QiHwHandleToCtrl(hParent);
if (!pCtrl) {goto _Exit_;}
if (NULL == pParentCtrl) {
pMgr = (CScriptMgr*)sq_getforeignptr(v);
if (!pMgr) {goto _Exit_;}
pPM = pMgr->GetManager();
if (!pPM) {goto _Exit_;}
pParentCtrl = (CContainerUI*)pPM->GetRoot();
}
if (!pParentCtrl || !pParentCtrl->IsContainer()) {goto _Exit_;}
bRet = (SQBool)pParentCtrl->Add(pCtrl);
_Exit_:
sq_pushbool(v, bRet);
return 1;
}
示例2: VwUpdateLayout
// void VwUpdateLayout(HWND hWnd)
SQInteger VwUpdateLayout(HSQUIRRELVM v)
{
SQInteger nargs = sq_gettop(v);
SQInteger nWnd = 0;
HWND hWnd = NULL;
CPaintManagerUI* pPM = NULL;
if (!v || 1 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
sq_getinteger(v, 2, &nWnd);
if (-1 == nWnd) {
CScriptMgr* pMgr = (CScriptMgr*)sq_getforeignptr(v);
if (!pMgr) {goto _Exit_;}
pPM = pMgr->GetManager();
if (!pPM) {goto _Exit_;}
} else {
pPM = QiHwHandleToWin(nWnd)->pWinObj->GetPM();
if (!pPM) {goto _Exit_;}
}
pPM->UpdateLayout();
_Exit_:
return 1;
}
示例3: VwGetPosHight
// int VwGetPosHight(VApiHandle hWnd)
SQInteger VwGetPosHight(HSQUIRRELVM v)
{
SQInteger nargs = sq_gettop(v);
SQInteger nWnd = 0;
WinMgrItem* pWin = NULL;
HWND hWnd = NULL;
SQInteger nRet = 0;
RECT rc = {0};
if (!v || 1 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
sq_getinteger(v, 2, &nWnd);
if (-1 == nWnd) {
CScriptMgr* pMgr = (CScriptMgr*)sq_getforeignptr(v);
if (!pMgr) {goto _Exit_;}
CPaintManagerUI* pPM = pMgr->GetManager();
if (!pPM) {goto _Exit_;}
hWnd = pPM->GetPaintWindow();
} else {
hWnd = QiHwHandleToWin(nWnd)->pWinObj->GetHWND();
}
::GetWindowRect(hWnd, &rc);
nRet = rc.bottom - rc.top;
_Exit_:
sq_pushinteger(v, nRet);
return 1;
}
示例4: GetPaintMgr
void CNotice::TypeInit(TNotifyUI& msg)
{
CPaintManagerUI* pPaintMgrUI = GetPaintMgr();
ASSERT(pPaintMgrUI);
CTextUI* pLabel = static_cast<CTextUI*>(pPaintMgrUI->FindControl(noticeView::kUser));
if(pLabel){
pLabel->SetText(m_strText);
}
int iWidth = GetSystemMetrics(SM_CXSCREEN);
int iHeight = GetSystemMetrics(SM_CYSCREEN);//计算的屏幕客户工作区域
MONITORINFO oMonitor = {};
oMonitor.cbSize = sizeof(oMonitor);
::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
CDuiRect rcWork = oMonitor.rcWork;
RECT rcWnd;
SIZE szInit = GetPaintMgr()->GetInitSize();
rcWnd.right = rcWork.right-1;
rcWnd.left = rcWnd.right-szInit.cx;
rcWnd.bottom = rcWork.bottom -1;
rcWnd.top = rcWnd.bottom-szInit.cy;
// MoveWindow(&rcWnd);
HWND hWnd = GetForegroundWindow();
SetWindowPos(HWND_TOPMOST,&rcWnd,SWP_NOACTIVATE);
SetForegroundWindow(hWnd);
/* 设置初始皮肤 */
}
示例5: UIAdd
void CALLBACK CUICommandHistory::UIAdd(TiXmlNode* pNode)
{
TiXmlElement* pElement = pNode->ToElement();
CStringA strParentName = pElement->Attribute("parentname");
pElement->RemoveAttribute("parentname");
if(strParentName.IsEmpty())
return;
CUIDesignerView* pUIView = g_pMainFrame->GetActiveUIView();
CPaintManagerUI* pManager = pUIView->GetPaintManager();
CControlUI* pParentControl = pManager->FindControl(StringConvertor::Utf8ToWide(strParentName));
if(pParentControl == NULL)
return;
TiXmlDocument xmlDoc;
TiXmlDeclaration Declaration("1.0","utf-8","yes");
xmlDoc.InsertEndChild(Declaration);
TiXmlElement* pRootElem = new TiXmlElement("UIAdd");
pRootElem->InsertEndChild(*pElement);
xmlDoc.InsertEndChild(*pRootElem);
TiXmlPrinter printer;
xmlDoc.Accept(&printer);
delete pRootElem;
CDialogBuilder builder;
CControlUI* pRoot=builder.Create(StringConvertor::Utf8ToWide(printer.CStr()), (UINT)0, NULL, pManager);
if(pRoot)
pUIView->RedoUI(pRoot, pParentControl);
}
示例6: UIModify
void CALLBACK CUICommandHistory::UIModify(TiXmlNode* pNode)
{
TiXmlElement* pElement = pNode->ToElement();
CStringA strName = pElement->Attribute("myname");
pElement->RemoveAttribute("myname");
if(strName.IsEmpty())
return;
CPaintManagerUI* pManager = g_pMainFrame->GetActiveUIView()->GetPaintManager();
CControlUI* pControl = pManager->FindControl(StringConvertor::Utf8ToWide(strName));
TiXmlAttribute* pAttrib = pElement->FirstAttribute();
if(pControl == NULL)
return;
while(pAttrib)
{
if(strcmp(pAttrib->Name(), "name") == 0)
{
pManager->ReapObjects(pControl);
g_pClassView->RenameUITreeItem(pControl, StringConvertor::Utf8ToWide(pAttrib->Value()));
pControl->SetAttribute(StringConvertor::Utf8ToWide(pAttrib->Name())
, StringConvertor::Utf8ToWide(pAttrib->Value()));
pManager->InitControls(pControl);
}
else
pControl->SetAttribute(StringConvertor::Utf8ToWide(pAttrib->Name())
, StringConvertor::Utf8ToWide(pAttrib->Value()));
pAttrib = pAttrib->Next();
}
CControlUI* pParent = pControl->GetParent();
if(pParent == NULL)
pParent = pControl;
pParent->SetPos(pParent->GetPos());
}
示例7: ViHwFindControl
// 脚本调用原型:
// VApiHandle VApiHwFindControl(HANDLE hWnd, string CtrlName);
SQInteger ViHwFindControl(HSQUIRRELVM v)
{
VApiHandle hRet = 0;
const SQChar* szCtrlName = NULL;
SQInteger nargs = sq_gettop(v);
SQInteger nWnd = 0;
HANDLE hWnd = NULL;
CScriptMgr* pMgr = NULL;
CPaintManagerUI* pPM = NULL;
if (!v || 2 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
if (OT_STRING != sq_gettype(v, 3)) {goto _Exit_;}
sq_getinteger(v, 2, &nWnd);
sq_getstring(v, 3, &szCtrlName);
if (-1 == nWnd) {
pMgr = (CScriptMgr*)sq_getforeignptr(v);
if (!pMgr) {goto _Exit_;}
pPM = pMgr->GetManager();
} else {
pPM = QiHwHandleToWin(nWnd)->pWinObj->GetPM();
}
if (!pPM) {goto _Exit_;}
// fixbug - 未验证pm合法性
hRet = QiHwCtrlToHandle(pPM->FindControl(szCtrlName));
_Exit_:
sq_pushinteger(v, hRet);
return 1;
}
示例8: VwSetWindowPos
// void VwSetWindowPos(HWND hWnd, HWND hWndlnsertAfter,int X, int Y, int cx, int cy, UNIT Flags)
SQInteger VwSetWindowPos(HSQUIRRELVM v)
{
SQInteger uIDEvent = 0;
SQInteger nargs = sq_gettop(v);
SQInteger nWnd = 0;
SQInteger nWndlnsertAfter = NULL;
HWND hWnd = NULL;
HWND hWndlnsertAfter = NULL;
int X = 0;
int Y = 0;
int cx = 0;
int cy = 0;
UINT uFlags = 0;
if (!v || 7 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 3)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 4) && OT_FLOAT != sq_gettype(v, 4)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 5) && OT_FLOAT != sq_gettype(v, 5)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 6) && OT_FLOAT != sq_gettype(v, 6)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 7) && OT_FLOAT != sq_gettype(v, 7)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 8)) {goto _Exit_;}
sq_getinteger(v, 2, &nWnd);
sq_getinteger(v, 3, &nWndlnsertAfter);
sq_getinteger(v, 4, &X);
sq_getinteger(v, 5, &Y);
sq_getinteger(v, 6, &cx);
sq_getinteger(v, 7, &cy);
sq_getinteger(v, 8, (SQInteger*)&uFlags);
if (-1 == nWnd) {
CScriptMgr* pMgr = (CScriptMgr*)sq_getforeignptr(v);
if (!pMgr) {goto _Exit_;}
CPaintManagerUI* pPM = pMgr->GetManager();
if (!pPM) {goto _Exit_;}
hWnd = pPM->GetPaintWindow();
} else {
hWnd = QiHwHandleToWin(nWnd)->pWinObj->GetHWND();
}
if (HWND_TOP == (HWND)nWndlnsertAfter ||
HWND_BOTTOM == (HWND)nWndlnsertAfter ||
HWND_TOPMOST == (HWND)nWndlnsertAfter ||
HWND_TOPMOST == (HWND)nWndlnsertAfter) {
hWndlnsertAfter = (HWND)nWndlnsertAfter;
} else {
hWndlnsertAfter = QiHwHandleToWin(nWndlnsertAfter)->pWinObj->GetHWND();
}
::SetWindowPos(hWnd, hWndlnsertAfter, X, Y, cx, cy, uFlags);
//::MoveWindow( hWnd, X, Y, cx, cy, TRUE);
_Exit_:
return 0;
}
示例9: InitWindow
void CSDKLoginWithSSOUIGroup::InitWindow(CPaintManagerUI& ui_mgr, CSDKLoginUIMgr* main_frame_)
{
m_loginWithSSOPage = static_cast<CVerticalLayoutUI* >(ui_mgr.FindControl(_T("panel_Login_With_SSO")));
m_editSSOtoken = static_cast<CRichEditUI* >(ui_mgr.FindControl(_T("edit_sso_token")));
m_login_bottom = static_cast<CVerticalLayoutUI* >(ui_mgr.FindControl(_T("panel_Login_Buttom")));
m_btnLogin = static_cast<CButtonUI* >(ui_mgr.FindControl(_T("btn_login")));
m_chkRemember = static_cast<CCheckBoxUI* >(ui_mgr.FindControl(_T("chk_remember_me")));
m_parentFrame = main_frame_;
}
示例10: UIDelete
void CALLBACK CUICommandHistory::UIDelete(TiXmlNode* pNode)
{
TiXmlElement* pElement = pNode->ToElement();
CStringA strName = pElement->Attribute("myname");
if(strName.IsEmpty())
return;
CUIDesignerView* pUIView = g_pMainFrame->GetActiveUIView();
CPaintManagerUI* pManager = pUIView->GetPaintManager();
CControlUI* pControl = pManager->FindControl(StringConvertor::Utf8ToWide(strName));
if(pControl == NULL)
return;
CControlUI* pParent=pControl->GetParent();
HTREEITEM hDelete=(HTREEITEM)(((ExtendedAttributes*)pControl->GetTag())->hItem);
g_pClassView->RemoveUITreeItem(hDelete);
pUIView->DeleteUI(pControl);
if(pParent)
pParent->NeedUpdate();
}
示例11: VwSnapShot
// HANDLE VwSnapShot(VApiHandle hWnd)
SQInteger VwSnapShot(HSQUIRRELVM v)
{
SQInteger nargs = sq_gettop(v);
SQInteger nWnd = 0;
HWND hWnd = NULL;
CUIImage* pImg = NULL;
CScriptMgr* pMgr = NULL;
CPaintManagerUI* pPM = NULL;
BOOL bIsAlphaWin = NULL;
VApiHandle hRet = NULL;
CUIRect rt;
if (!v || 1 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
sq_getinteger(v, 2, &nWnd);
if (-1 == nWnd) {
pMgr = (CScriptMgr*)sq_getforeignptr(v);
if (!pMgr) {goto _Exit_;}
pPM = pMgr->GetManager();
if (!pPM) {goto _Exit_;}
hWnd = pPM->GetPaintWindow();
} else {
hWnd = QiHwHandleToWin(nWnd)->pWinObj->GetHWND();
}
::GetWindowRect(hWnd, &rt);
bIsAlphaWin = pPM->IsAlphaWin();
pImg = new CUIImage();
pImg->Create(pPM->GetPaintDC(), rt.GetWidth(), rt.GetHeight(), 0, TRUE);
::PrintWindow(hWnd, pImg->GetDC(), 0);
::SendMessage(hWnd, WM_PRINT, (WPARAM)pImg->GetDC(), PRF_NONCLIENT | PRF_CLIENT | PRF_ERASEBKGND | PRF_CHILDREN);
hRet = QiHwObjToHandle(pImg);
_Exit_:
sq_pushinteger(v, hRet);
return 1;
}
示例12: VwSetLayeredWindowAttributes
//BOOL VwSetLayeredWindowAttributes(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags);
SQInteger VwSetLayeredWindowAttributes(HSQUIRRELVM v)
{
SQInteger uIDEvent = 0;
SQInteger nargs = sq_gettop(v);
SQInteger nWnd = 0;
HWND hWnd = NULL;
COLORREF crKey = 0;
int bAlpha = 0;
DWORD dwFlags = 0;
if (!v || 4 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 3)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 4)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 5)) {goto _Exit_;}
sq_getinteger(v, 2, &nWnd);
sq_getinteger(v, 3, (SQInteger*)&crKey);
sq_getinteger(v, 4, (SQInteger*)&bAlpha);
sq_getinteger(v, 5, (SQInteger*)&dwFlags);
if (-1 == nWnd) {
CScriptMgr* pMgr = (CScriptMgr*)sq_getforeignptr(v);
if (!pMgr) {goto _Exit_;}
CPaintManagerUI* pPM = pMgr->GetManager();
if (!pPM) {goto _Exit_;}
hWnd = pPM->GetPaintWindow();
} else {
hWnd = QiHwHandleToWin(nWnd)->pWinObj->GetHWND();
}
//::SetWindowLong(hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) ^ WS_EX_LAYERED);
::SetLayeredWindowAttributes(hWnd, crKey, (BYTE)bAlpha, dwFlags);
::RedrawWindow(hWnd, NULL, NULL,
RDW_ERASE | RDW_INVALIDATE |
RDW_FRAME | RDW_ALLCHILDREN);
_Exit_:
return 1;
}
示例13: VwKillTimer
// BOOL VwKillTimer(SQInteger uIDEvent)
SQInteger VwKillTimer(HSQUIRRELVM v)
{
SQUserPointer uIDEvent = 0;
SQInteger nargs = sq_gettop(v);
if (!v || 1 + 1 != nargs) {goto _Exit_;}
if (OT_USERPOINTER != sq_gettype(v, 2)) {goto _Exit_;}
sq_getuserpointer(v, 2, &uIDEvent);
CScriptMgr* pMgr = (CScriptMgr*)sq_getforeignptr(v);
if (!pMgr) {goto _Exit_;}
CPaintManagerUI* pPM = pMgr->GetManager();
if (!pPM) {goto _Exit_;}
::KillTimer(pPM->GetPaintWindow(), (UINT_PTR)uIDEvent);
delete (SetTimerParam*)uIDEvent;
_Exit_:
sq_pushbool(v, TRUE);
return 1;
}
示例14: _VwSetTimerInternal
SQInteger _VwSetTimerInternal(HSQUIRRELVM v, TIMERPROC lpTimerFunc)
{
SQInteger nargs = sq_gettop(v);
SQInteger Handle = 0;
SQInteger uElapse = 0;
LPCTSTR pstrFunc = NULL;
SetTimerParam* pTimerParam = NULL;
SQUserPointer nRet = NULL;
if (!v || 3 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
if (OT_STRING != sq_gettype(v, 3)) {goto _Exit_;}
if (OT_INSTANCE != sq_gettype(v, 4)) {goto _Exit_;}
sq_getinteger(v, 2, &uElapse);
sq_getstring(v, 3, &pstrFunc);
pTimerParam = new SetTimerParam();
pTimerParam->v = v;
pTimerParam->sFunc = pstrFunc;
sq_getstackobj(v, 4, &pTimerParam->Obj);
CScriptMgr* pMgr = (CScriptMgr*)sq_getforeignptr(v);
if (!pMgr) {goto _Exit_;}
CPaintManagerUI* pPM = pMgr->GetManager();
if (!pPM) {goto _Exit_;}
if (NULL != ::SetTimer(pPM->GetPaintWindow(), (UINT_PTR)pTimerParam, uElapse, lpTimerFunc)) {
nRet = (SQUserPointer)pTimerParam;
} else {
nRet = NULL;
}
_Exit_:
sq_pushuserpointer(v, nRet);
return 1;
}
示例15: VwCreateWin
// HANDLE VwCreateWin(
// VApiHandle hWndParent, int X, int Y, int nWidth, int nHeight,
// WCHAR* wszRegName, WCHAR* wszNewName, BOOL bIsAlpha)
SQInteger VwCreateWin(HSQUIRRELVM v)
{
SQInteger nargs = sq_gettop(v);
SQInteger nWndParent = 0;
HWND hWndParent = NULL;
CUIImage* pImg = NULL;
CScriptMgr* pMgr = NULL;
CPaintManagerUI* pPM = NULL;
int X = 0;
int Y = 0;
int nWidth = 0;
int nHeight = 0;
const SQChar* pwszRegName = NULL;
const SQChar* pwszNewName = NULL;
WCHAR wszNewName[60] = {0};
SQBool bIsAlphaWin = NULL;
WinMgrItem* pWinMgrIt = NULL;
HWND hWnd = NULL;
CWindowWnd* pWinObj = NULL;
SQInteger nRet = 0;
CMarkupNode* pRootXm = NULL;
if (!v || 8 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 3)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 4)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 5)) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 6)) {goto _Exit_;}
if (OT_STRING != sq_gettype(v, 7)) {goto _Exit_;}
if (OT_STRING != sq_gettype(v, 8)) {goto _Exit_;}
if (OT_BOOL != sq_gettype(v, 9)) {goto _Exit_;}
sq_getinteger(v, 2, &nWndParent);
sq_getinteger(v, 3, &X);
sq_getinteger(v, 4, &Y);
sq_getinteger(v, 5, &nWidth);
sq_getinteger(v, 6, &nHeight);
sq_getstring(v, 7, &pwszRegName);
//sq_getinteger(v, 8, &wszNewName);
sq_getbool(v, 9, &bIsAlphaWin);
swprintf_s(wszNewName, 60, L"%x", ::GetTickCount());
if (nWndParent) {
hWndParent = QiHwHandleToWin(nWndParent)->pWinObj->GetHWND();
}
pMgr = (CScriptMgr*)sq_getforeignptr(v);
if (!pMgr) {goto _Exit_;}
pPM = pMgr->GetManager();
if (!pPM || !pPM->GetWinMgr()) {goto _Exit_;}
pWinMgrIt = pPM->GetWinMgr()->FindWinByName(pwszRegName);
if (!pWinMgrIt) {goto _Exit_;}
// 新建立个模板,因为需要可重复用以前的名字
pRootXm = new CMarkupNode(*pWinMgrIt->pWinXML);
pWinObj = new CWindowTemplate(pWinMgrIt->pWinObj);
pWinObj->GetPM()->SetWinMgr(pPM->GetWinMgr());
pWinObj->SetDefaultResource(pRootXm);
pWinMgrIt = pPM->GetWinMgr()->AddOneWin(pWinObj,
wszNewName, pRootXm, X, Y, nWidth,
nHeight, pWinMgrIt->dwStyle, pWinMgrIt->dwExStyle, &pWinMgrIt->ExInfo);
if (!bIsAlphaWin) {
hWnd = pWinObj->Create(hWndParent, pwszNewName,
pWinMgrIt->dwStyle, pWinMgrIt->dwExStyle,
X, Y, nWidth, nHeight, 0);
} else {
hWnd = pWinObj->CreateAlphaWin(hWndParent, pwszNewName,
pWinMgrIt->dwStyle | WS_EX_LAYERED, pWinMgrIt->dwExStyle,
X, Y, nWidth, nHeight);
}
if (!hWnd) {goto _Exit_;}
nRet = QiHwObjToHandle(pWinMgrIt);
_Exit_:
sq_pushinteger(v, nRet);
return 1;
}