Example #1
0
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_;
}
Example #2
0
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());
}
Example #3
0
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);
}
Example #4
0
// 脚本调用原型:
// 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;
}
Example #5
0
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);
	/* 设置初始皮肤 */
}
Example #6
0
void CSDKLoginWithEmailUIGroup::InitWindow(CPaintManagerUI& ui_mgr, CSDKLoginUIMgr* main_frame_)
{
	m_loginWithEmailPage = static_cast<CVerticalLayoutUI* >(ui_mgr.FindControl(_T("panel_Login_With_Email")));
	m_editUserAccount = static_cast<CRichEditUI* >(ui_mgr.FindControl(_T("edit_user_email")));
	m_editUserPassword = static_cast<CRichEditUI* >(ui_mgr.FindControl(_T("edit_user_password")));
	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_;
}
Example #7
0
void CSDKWithoutLoginStartJoinMeetingUIGroup::InitWindow(CPaintManagerUI& ui_mgr, CSDKLoginUIMgr* main_frame_)
{
	m_WithoutLoginStartJoinMeetingPage = static_cast<CVerticalLayoutUI* >(ui_mgr.FindControl(_T("panel_Join_Meeting_Only")));
	m_editMeetingNumber = static_cast<CRichEditUI* >(ui_mgr.FindControl(_T("edit_meeting_number")));
	m_editScreenName = static_cast<CRichEditUI* >(ui_mgr.FindControl(_T("edit_screen_name")));
	m_editMeetingPassword = static_cast<CRichEditUI* >(ui_mgr.FindControl(_T("edit_meeting_password")));
	m_btnJoin = 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_;
	m_withoutLoginJoinMeetingWorkFlow.SetUIEvent(this);
}
Example #8
0
void CSDKRestAPIUserUIGroup::InitWindow(CPaintManagerUI& ui_mgr, CSDKLoginUIMgr* main_frame_)
{
	m_WithoutLoginRestAPIPage = static_cast<CVerticalLayoutUI* >(ui_mgr.FindControl(_T("panel_RestAPI_Without_Login")));
	m_editRestAPIKey = static_cast<CRichEditUI* >(ui_mgr.FindControl(_T("edit_restapi_key")));
	if(m_editRestAPIKey)
		m_editRestAPIKey->SetLimitText(KEY_SECRET_LIMIT_LENGTH_MAX);
	m_editRestAPISecret = static_cast<CRichEditUI* >(ui_mgr.FindControl(_T("edit_restapi_secret")));
	if(m_editRestAPISecret)
		m_editRestAPISecret->SetLimitText(KEY_SECRET_LIMIT_LENGTH_MAX);
	m_editScreenName = static_cast<CRichEditUI* >(ui_mgr.FindControl(_T("edit_restapi_ScreenName")));	
	m_editEmail = static_cast<CRichEditUI* >(ui_mgr.FindControl(_T("edit_restapi_email")));
	m_btnStartMeeting = 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_;
	m_RestAPIUserWorkFlow.SetUIEvent(this);

}
Example #9
0
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();
}
Example #10
0
void CPropertiesWnd::SetUIValue(CMFCPropertyGridProperty* pProp,int nTag)
{
	CControlUI* pControl = m_wndUIProperties.GetCurUI();
	if(pControl == NULL)
		return;

	int nUpdate=UPDATE_REDRAW_CONTROL;
	CString strName=pProp->GetName();
	strName.MakeLower();
	CString strNewVal;
	CString strOldVal;
	strNewVal = pProp->FormatProperty();
	strOldVal = m_wndUIProperties.FormatOrigProperty(pProp);
	if(nTag!=tagName && nTag!=tagText && strName.Find(_T("image"))==-1)
	{
		strNewVal.MakeLower();
		strOldVal.MakeLower();
	}

	switch(nTag)
	{
	case tagName:
		{
			CPaintManagerUI* pManager = g_pMainFrame->GetActiveUIView()->GetPaintManager();
			if(strNewVal.IsEmpty() || pManager->FindControl(strNewVal))
			{
				if(!strNewVal.IsEmpty())
					MessageBox(strNewVal + _T(" 名称已被其他控件使用!"));
				pProp->SetValue((_variant_t)pControl->GetName());
				return;
			}
			else
				pManager->ReapObjects(pControl);

			g_pClassView->RenameUITreeItem(pControl, strNewVal);
			break;
		}
	case tagPos:
	case tagPadding:
		SetPropValue(pControl,tagSize);

		nUpdate=UPDATE_POS;
		break;
	case tagSize:
	case tagMinSize:
	case tagMaxSize:
	case tagMinMax:
		SetUIValue(pProp->GetSubItem(0),-1);
		SetUIValue(pProp->GetSubItem(1),-1);
		SetPropValue(pControl,tagPos);

		nUpdate=UPDATE_POS;
		break;
	case tagFloat:
	case tagColumns:
		nUpdate=UPDATE_POS;
		break;
	case tagVisible:
		nUpdate=UPDATE_REDRAW_PARENT;
		break;
	case tagListHeader:
		if (strNewVal.Compare(_T("false"))==0)
		{
			strNewVal = _T("hidden");
		}
		break;
	case tagAlpha:
		{
			int alpha=_ttoi(strNewVal);
			if (alpha<0)
			{
				strNewVal=_T("0");
				pProp->SetValue((_variant_t)(LONG)0);
			}
			else
			{
				strNewVal=_T("255");
				pProp->SetValue((_variant_t)(LONG)255);
			}
			break;
		}
	}

	CUIDesignerView* pUIView=g_pMainFrame->GetActiveUIView();
	ASSERT(pUIView);
	TNotifyUI Msg;
	UIAttribute oldAttrib = {strName, strOldVal};
	Msg.pSender=pControl;
	Msg.sType=_T("PropertyBeginChanged");
	Msg.wParam=0;
	Msg.lParam=(LPARAM)&oldAttrib;
	pUIView->Notify(Msg);

	pControl->SetAttribute(strName,strNewVal);
	pProp->SetOriginalValue(pProp->GetValue());

	UIAttribute newAttrib = {strName, strNewVal};
	Msg.sType = _T("PropertyEndChanged");
	Msg.lParam = (LPARAM)&newAttrib;
	pUIView->Notify(Msg);

	if(nTag==tagWindowSize)
	{
		Msg.sType=_T("formsize");
		Msg.lParam = NULL;
		pUIView->Notify(Msg);
	}
	else if(nTag == tagName)
	{
		CPaintManagerUI* pManager = pUIView->GetPaintManager();
		pManager->InitControls(pControl);
	}

	CControlUI* pParent=pControl->GetParent();
	if(pParent==NULL)
		pParent=pControl;
	switch(nUpdate)
	{
	case UPDATE_POS:
		pParent->SetPos(pParent->GetPos());

		break;
	case UPDATE_REDRAW_CONTROL:
		pControl->NeedUpdate();

		break;
	case UPDATE_REDRAW_PARENT:
		pParent->NeedUpdate();
	}
}