void MemberManagerForm::OnQueryTeamMembers(const std::string& tid, int member_count, const std::list<nim::TeamMemberProperty>& team_member_info_list)
{
	for (auto& team_member_info : team_member_info_list)
	{
		if (user_id_ == team_member_info.GetAccountID())
		{
			user_type_ = team_member_info.GetUserType();
			if (user_type_ == nim::kNIMTeamUserTypeCreator)
			{
				((Option*)FindControl(L"owner"))->Selected(true);
			}
			else if (user_type_ == nim::kNIMTeamUserTypeManager)
			{
				((Option*)FindControl(L"manager"))->Selected(true);
			}
			else if (user_type_ == nim::kNIMTeamUserTypeNomal)
			{
				((Option*)FindControl(L"member"))->Selected(true);
			}

			std::string team_card = team_member_info.GetNick();
			re_team_card_->SetUTF8Text(team_card);
			team_card_ = team_card;

			break;
		}
	}
}
Beispiel #2
0
LRESULT YSkinWindow::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	sLog("YSkinWindow::OnCreate");
	ModifyStyle(WS_CAPTION,WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
	if(!RegisterSkin(_T("changeskinwin.xml"),0,this))
		return 0;

	GetPaintMgr()->AddNotifier(this);
	RECT rcClient;
	::GetClientRect(*this, &rcClient);
	::SetWindowPos(*this, NULL, rcClient.left, rcClient.top, rcClient.right - rcClient.left, \
		rcClient.bottom - rcClient.top, SWP_FRAMECHANGED);

	FindControl(_pSkinLayout,_T("tabs"));
	FindControl(_pSysSkinLayout,_T("SysSkinLayout"));
	FindControl(_pMySkinLayout,_T("MySkinLayout"));

	FindControl(_pWebSkin,_T("web_skin"));

	ASSERT(_pWebSkin&&_pSysSkinLayout&&_pSkinLayout&&_pMySkinLayout);

	_pSkinJsHandler = new CSkinJsHandler(_pWebSkin);

	this->InitJsHandler(_pSkinJsHandler);

	_pWebSkin->SetWebBrowserEventHandler(_pSkinJsHandler);

	theMainWin->BroadCast();

	LoadSysSkin();
	LoadMySkin();


	return 0;
}
void
MsnPkgDlg::RegisterControls()
{
	pkg_list                   = (ListBox*) FindControl(320);
	nav_list                   = (ListBox*) FindControl(330);

	for (int i = 0; i < 5; i++)
	threat[i]         = FindControl(251 + i);

	RegisterMsnControls(this);

	if (pkg_list)
	REGISTER_CLIENT(EID_SELECT, pkg_list, MsnPkgDlg, OnPackage);

	if (commit)
	REGISTER_CLIENT(EID_CLICK, commit, MsnPkgDlg, OnCommit);

	if (cancel)
	REGISTER_CLIENT(EID_CLICK, cancel, MsnPkgDlg, OnCancel);

	if (sit_button)
	REGISTER_CLIENT(EID_CLICK, sit_button, MsnPkgDlg, OnTabButton);

	if (pkg_button)
	REGISTER_CLIENT(EID_CLICK, pkg_button, MsnPkgDlg, OnTabButton);

	if (nav_button)
	REGISTER_CLIENT(EID_CLICK, nav_button, MsnPkgDlg, OnTabButton);

	if (wep_button)
	REGISTER_CLIENT(EID_CLICK, wep_button, MsnPkgDlg, OnTabButton);
}
Beispiel #4
0
void RtsForm::ShowStartUI(bool creater)
{
	need_ack_ = !creater;
	if (creater)
	{
		ShowTip(L"正在邀请对方,请稍后");
	} 
	else
	{
		ShowTip(L"邀请你加入白板");
		show_endmsg_ = true;
	}
	Control* accept = FindControl(L"btn_accept");
	accept->SetVisible(!creater);
	Control* reject = FindControl(L"btn_reject");
	reject->SetVisible(!creater);
	Control* cancel = FindControl(L"btn_cancel");
	cancel->SetVisible(creater);

	if (creater)
	{
		nim::Rts::StartChannelCallback cb = nbase::Bind(&RtsForm::OnStartRtsCb, this, session_id_, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4);
		nim::Rts::StartChannel(type_, uid_, nbase::UTF16ToUTF8(L"白板通话邀请test"), "rts custom info", cb);
	}
	auto closure = nbase::Bind(&RtsForm::NoActiveTimer, this);
	nbase::ThreadManager::PostDelayedTask(kThreadUI, closure, nbase::TimeDelta::FromSeconds(40));
}
Beispiel #5
0
void RtsForm::ShowBoardUI()
{
	Box* status_page = (Box*)FindControl(L"status_page");
	status_page->SetVisible(false);
	Box* board_page = (Box*)FindControl(L"board_page");
	board_page->SetVisible(true);
}
UIControl* AutotestingSystemLua::FindControl(UIControl* srcControl, const String &controlName)
{
	if(UIControlSystem::Instance()->GetLockInputCounter() > 0) return NULL;

	if(srcControl)
	{
		int32 index = atoi(controlName.c_str());
		if(Format("%d",index) != controlName)
		{
			// not number
			return srcControl->FindByName(controlName);
		}
		else
		{
			// number
			UIList* list = dynamic_cast<UIList*>(srcControl);
			if(list)
			{
				return FindControl(list, index);
			}
			else
			{
				return FindControl(srcControl, index);
			}
		}
	}
	return NULL;
}
void
CmdMissionsDlg::RegisterControls()
{
    lst_missions   = (ListBox*)   FindControl(401);
    txt_desc       =              FindControl(402);
    btn_accept     = (Button*)    FindControl(403);

    RegisterCmdControls(this);

    if (btn_save)
    REGISTER_CLIENT(EID_CLICK,  btn_save,    CmdMissionsDlg, OnSave);

    if (btn_exit)
    REGISTER_CLIENT(EID_CLICK,  btn_exit,    CmdMissionsDlg, OnExit);

    for (int i = 0; i < 5; i++) {
        if (btn_mode[i])
        REGISTER_CLIENT(EID_CLICK,  btn_mode[i], CmdMissionsDlg, OnMode);
    }

    if (lst_missions) {
        REGISTER_CLIENT(EID_SELECT, lst_missions, CmdMissionsDlg, OnMission);
    }

    if (btn_accept) {
        btn_accept->SetEnabled(false);
        REGISTER_CLIENT(EID_CLICK, btn_accept, CmdMissionsDlg, OnAccept);
    }
}
void
LoadDlg::RegisterControls()
{
	title    = FindControl(100);
	activity = FindControl(101);
	progress = (Slider*) FindControl(102);
}
void ChatroomFrontpage::OnWndSizeMax(bool max)
{
	if (!m_pRoot)
		return;

	FindControl(L"maxbtn")->SetVisible(!max);
	FindControl(L"restorebtn")->SetVisible(max);
}
void
CmpLoadDlg::RegisterControls()
{
	img_title    = (ImageBox*) FindControl(100);
	lbl_title    =             FindControl(200);
	lbl_activity =             FindControl(101);
	lbl_progress = (Slider*)   FindControl(102);
}
void
MsnSelectDlg::RegisterControls()
{
	btn_accept     = (Button*) FindControl(  1);
	btn_cancel     = (Button*) FindControl(  2);

	if (btn_accept) {
		btn_accept->SetEnabled(false);
		REGISTER_CLIENT(EID_CLICK,       btn_accept, MsnSelectDlg, OnAccept);
	}

	if (btn_cancel) {
		REGISTER_CLIENT(EID_CLICK,       btn_cancel, MsnSelectDlg, OnCancel);
	}

	btn_mod        = (Button*) FindControl(300);
	btn_new        = (Button*) FindControl(301);
	btn_edit       = (Button*) FindControl(302);
	btn_del        = (Button*) FindControl(303);

	if (btn_mod)
	REGISTER_CLIENT(EID_CLICK,       btn_mod,    MsnSelectDlg, OnMod);

	if (btn_new)
	REGISTER_CLIENT(EID_CLICK,       btn_new,    MsnSelectDlg, OnNew);

	if (btn_edit)
	REGISTER_CLIENT(EID_CLICK,       btn_edit,   MsnSelectDlg, OnEdit);

	if (btn_del) {
		REGISTER_CLIENT(EID_CLICK,       btn_del,    MsnSelectDlg, OnDel);
		REGISTER_CLIENT(EID_USER_1,      btn_del,    MsnSelectDlg, OnDelConfirm);
	}

	description    = FindControl(200);

	cmb_campaigns  = (ComboBox*)  FindControl(201);
	lst_campaigns  = (ListBox*)   FindControl(203);
	lst_missions   = (ListBox*)   FindControl(202);

	if (cmb_campaigns) {
		REGISTER_CLIENT(EID_SELECT,      cmb_campaigns, MsnSelectDlg, OnCampaignSelect);
	}

	if (lst_campaigns) {
		REGISTER_CLIENT(EID_SELECT,      lst_campaigns, MsnSelectDlg, OnCampaignSelect);

		lst_campaigns->SetSelectedStyle(ListBox::LIST_ITEM_STYLE_FILLED_BOX);
		lst_campaigns->SetLeading(4);
	}

	if (lst_missions) {
		REGISTER_CLIENT(EID_SELECT,      lst_missions, MsnSelectDlg, OnMissionSelect);

		lst_missions->SetSelectedStyle(ListBox::LIST_ITEM_STYLE_FILLED_BOX);
		lst_missions->SetLeading(4);
	}
}
void SessionForm::CheckTeamType(nim::NIMTeamType type)
{
	bool show = (type == nim::kNIMTeamTypeAdvanced);

	Control* split = FindControl(L"frame_mid_split");
	split->SetVisible(show);
	Control* frame_right = FindControl(L"frame_right");
	frame_right->SetVisible(show);
}
Beispiel #13
0
void
CmdMsgDlg::RegisterControls()
{
    title   = FindControl(100);
    message = FindControl(101);

    apply   = (Button*) FindControl(1);
    REGISTER_CLIENT(EID_CLICK, apply, CmdMsgDlg, OnApply);
}
void
CmpCompleteDlg::RegisterControls()
{
    img_title    = (ImageBox*) FindControl(100);
    lbl_info     =             FindControl(101);
    btn_close    = (Button*)   FindControl(1);

    REGISTER_CLIENT(EID_CLICK, btn_close, CmpCompleteDlg, OnClose);
}
void
AwardShowDlg::RegisterControls()
{
    lbl_name     =              FindControl(203);
    lbl_info     =              FindControl(201);
    img_rank     = (ImageBox*)  FindControl(202);

    btn_close    = (Button*) FindControl(1);
    REGISTER_CLIENT(EID_CLICK, btn_close, AwardShowDlg, OnClose);
}
void
MsnEditNavDlg::RegisterControls()
{
	btn_accept     = (Button*) FindControl(  1);
	btn_cancel     = (Button*) FindControl(  2);
	btn_sit        = (Button*) FindControl(301);
	btn_pkg        = (Button*) FindControl(302);
	btn_map        = (Button*) FindControl(303);

	txt_name       = (EditBox*)  FindControl(201);
	cmb_type       = (ComboBox*) FindControl(202);
	cmb_system     = (ComboBox*) FindControl(203);
	cmb_region     = (ComboBox*) FindControl(204);

	if (btn_accept)
	REGISTER_CLIENT(EID_CLICK,    btn_accept, MsnEditNavDlg, OnCommit);

	if (btn_cancel)
	REGISTER_CLIENT(EID_CLICK,    btn_cancel, MsnEditNavDlg, OnCancel);

	if (btn_sit)
	REGISTER_CLIENT(EID_CLICK,    btn_sit,    MsnEditNavDlg, OnTabButton);

	if (btn_pkg)
	REGISTER_CLIENT(EID_CLICK,    btn_pkg,    MsnEditNavDlg, OnTabButton);

	if (btn_map)
	REGISTER_CLIENT(EID_CLICK,    btn_map,    MsnEditNavDlg, OnTabButton);

	if (cmb_system)
	REGISTER_CLIENT(EID_SELECT,   cmb_system, MsnEditNavDlg, OnSystemSelect);
}
Beispiel #17
0
void SessionForm::InitWindow()
{
	m_pRoot->AttachBubbledEvent(ui::kEventAll, nbase::Bind(&SessionForm::OnNotify, this, std::placeholders::_1));
	m_pRoot->AttachBubbledEvent(ui::kEventClick, nbase::Bind(&SessionForm::OnClicked, this, std::placeholders::_1));

	merge_list_ = static_cast<ListBox*>(FindControl(L"merge_list"));
	session_box_tab_ = static_cast<TabBox*>(FindControl(L"session_box_tab"));

	merge_list_->AttachSelect(nbase::Bind(&SessionForm::OnMergeItemSelected, this, std::placeholders::_1));
	
	InitDragDrop();
}
void
MsnWepDlg::RegisterControls()
{
	lbl_element    = FindControl(601);
	lbl_type       = FindControl(602);
	lbl_weight     = FindControl(603);
	loadout_list   = (ListBox*)  FindControl(604);
	beauty         = (ImageBox*) FindControl(300);
	player_desc    =             FindControl(301);

	if (loadout_list)
	REGISTER_CLIENT(EID_SELECT, loadout_list, MsnWepDlg, OnLoadout);

	for (int i = 0; i < 8; i++) {
		lbl_desc[i] = FindControl(500 + i*10);
		lbl_station[i] = FindControl(401 + i);

		for (int n = 0; n < 8; n++) {
			btn_load[i][n] = (Button*) FindControl(500 + i*10 + n + 1);

			if (btn_load[i][n]) {
				if (i == 0) {
					if (n == 0)
					btn_load[i][n]->GetPicture(led_off);
					else if (n == 1)
					btn_load[i][n]->GetPicture(led_on);
				}

				btn_load[i][n]->SetPicture(led_off);
				btn_load[i][n]->SetPictureLocation(4); // centered
				REGISTER_CLIENT(EID_CLICK, btn_load[i][n], MsnWepDlg, OnMount);
			}
		}
	}

	RegisterMsnControls(this);

	if (commit)
	REGISTER_CLIENT(EID_CLICK, commit, MsnWepDlg, OnCommit);

	if (cancel)
	REGISTER_CLIENT(EID_CLICK, cancel, MsnWepDlg, OnCancel);

	if (sit_button)
	REGISTER_CLIENT(EID_CLICK, sit_button, MsnWepDlg, OnTabButton);

	if (pkg_button)
	REGISTER_CLIENT(EID_CLICK, pkg_button, MsnWepDlg, OnTabButton);

	if (nav_button)
	REGISTER_CLIENT(EID_CLICK, nav_button, MsnWepDlg, OnTabButton);

	if (wep_button)
	REGISTER_CLIENT(EID_CLICK, wep_button, MsnWepDlg, OnTabButton);
}
Beispiel #19
0
void
ExitDlg::RegisterControls()
{
    if (apply)
    return;

    credits = (RichTextBox*) FindControl(201);

    apply   = (Button*) FindControl(1);
    REGISTER_CLIENT(EID_CLICK, apply, ExitDlg, OnApply);

    cancel  = (Button*) FindControl(2);
    REGISTER_CLIENT(EID_CLICK, cancel, ExitDlg, OnCancel);
}
void CustomMsgForm::InitWindow()
{
	if (nim_ui::UserConfig::GetInstance()->GetDefaultIcon() > 0)
		SetIcon(nim_ui::UserConfig::GetInstance()->GetDefaultIcon());

	SetTaskbarTitle(L"自定义消息通知");
	m_pRoot->AttachBubbledEvent(ui::kEventClick, nbase::Bind(&CustomMsgForm::OnClicked, this, std::placeholders::_1));

	richedit_apns_ = (RichEdit*)FindControl(L"re_apns");
	richedit_msg_ = (RichEdit*)FindControl(L"re_msg");
	richedit_attach_ = (RichEdit*)FindControl(L"re_attach");
	rec_name_ = (Label*)FindControl(L"receiver");
	msg_mode_ = (CheckBox*)FindControl(L"msg_mode");
}
void
CmpSceneDlg::RegisterControls()
{
    mov_scene      =                 FindControl(101);
    subtitles_box  = (RichTextBox*)  FindControl(102);

    if (mov_scene) {
        CameraDirector* cam_dir = CameraDirector::GetInstance();
        cam_view = new(__FILE__,__LINE__) CameraView(mov_scene, cam_dir->GetCamera(), 0);
        if (cam_view)
            mov_scene->AddView(cam_view);

        disp_view = DisplayView::GetInstance();
    }
}
Beispiel #22
0
void RtsForm::ShowHeader()
{
	std::wstring name = UserService::GetInstance()->GetUserName(uid_);
	Label* friend_name = (Label*)FindControl(L"friend_name");
	friend_name->SetText(name);

	std::wstring title_text = L"与" + name + L"的白板";
	SetTaskbarTitle(title_text);
	Label* title = (Label*)FindControl(L"title");
	title->SetText(title_text);

	std::wstring photo = PhotoService::GetInstance()->GetUserPhoto(uid_);
	Button* headicon = (Button*)FindControl(L"headicon");
	headicon->SetBkImage(photo);
}
void MsgRecordForm::InitWindow()
{
	if (nim_ui::UserConfig::GetInstance()->GetDefaultIcon()>0)
	{
		SetIcon(nim_ui::UserConfig::GetInstance()->GetDefaultIcon());
	}
	
	m_pRoot->AttachBubbledEvent(ui::kEventAll, nbase::Bind(&MsgRecordForm::Notify, this, std::placeholders::_1));
	m_pRoot->AttachBubbledEvent(ui::kEventClick, nbase::Bind(&MsgRecordForm::OnClicked, this, std::placeholders::_1));

	label_title_ = (Label*) FindControl(L"title");
	btn_max_restore_ = (Button*) FindControl(L"btn_max_restore");

	msg_list_ = (ListBox*) FindControl(L"msg_list");
}
void
CmdIntelDlg::RegisterControls()
{
	lst_news = (ListBox*)      FindControl(401);
	txt_news = (RichTextBox*)  FindControl(402);
	img_news = (ImageBox*)     FindControl(403);
	mov_news =                 FindControl(404);
	btn_play = (Button*)       FindControl(405);

	RegisterCmdControls(this);

	if (btn_save)
	REGISTER_CLIENT(EID_CLICK,  btn_save,    CmdIntelDlg, OnSave);

	if (btn_exit)
	REGISTER_CLIENT(EID_CLICK,  btn_exit,    CmdIntelDlg, OnExit);

	if (btn_play)
	REGISTER_CLIENT(EID_CLICK,  btn_play,    CmdIntelDlg, OnPlay);

	for (int i = 0; i < 5; i++) {
		if (btn_mode[i])
		REGISTER_CLIENT(EID_CLICK,  btn_mode[i], CmdIntelDlg, OnMode);
	}

	if (lst_news) {
		REGISTER_CLIENT(EID_SELECT, lst_news,    CmdIntelDlg, OnNews);
	}

	if (img_news) {
		img_news->GetPicture(bmp_default);
	}

	if (mov_news) {
		CameraDirector* cam_dir = CameraDirector::GetInstance();
		cam_view = new(__FILE__,__LINE__) CameraView(mov_news, cam_dir->GetCamera(), 0);
		if (cam_view)
		mov_news->AddView(cam_view);

		dsp_view = DisplayView::GetInstance();
		if (dsp_view) {
			dsp_view->SetWindow(mov_news);
			mov_news->AddView(dsp_view);
		}

		mov_news->Hide();
	}
}
LRESULT CShareWin::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	ModifyStyle(WS_CAPTION,WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
	if(!RegisterSkin(_T("share-window.xml")))
		return 0;
	GetPaintMgr()->AddNotifier(this);

	FindControl(ui._title,_T("title"));
	FindControl(ui._edit,_T("input"));
	FindControl(ui._textlen,_T("textlen"));
	FindControl(ui._sharebtn,_T("sharebtn"));
	theMainWin->BroadCast();

	_nTimerId = SetTimer(1,1000);
	return 0;
}
Beispiel #26
0
void LinkForm::SwitchTo( LinkPage lp )
{
	Control* tip = FindControl(L"link_tip_page");
	tip->SetVisible(lp == LINK_TIP);

	Control* ing = FindControl(L"link_ing_page");
	ing->SetVisible(lp == LINK_ING);

	Control* success = FindControl(L"link_success_page");
	success->SetVisible(lp == LINK_SUCCESS);

	if(lp == LINK_TIP)
	{
		timer_.Cancel();
	}
}
Beispiel #27
0
bool GWindow::Attach(GViewI *p)
{
	bool Status = false;

	ThreadCheck();
	
	{		
		// Do a rough layout of child windows
		Pour();

		// Setup default button...
		if (!_Default)
		{
			_Default = FindControl(IDOK);
		}
		if (_Default)
		{
			_Default->Invalidate();
		}
		
		// Call on create
		OnCreate();

		// Add icon
		if (d->Icon)
		{
			SetIcon(d->Icon);
			d->Icon.Empty();
		}
		
		Status = true;
	}
	
	return Status;
}
void PersonalCenterForm::InitRoomManageList()
{
	for (int i = 0; i < 2; i++)
	{
		ui::HBox* item = (ui::HBox*)ui::GlobalManager::CreateBox(L"chatroom/room_manage_item.xml");
		ui::VBox* room_manage_list = (ui::VBox*)FindControl(L"room_manage_list");
		room_manage_list->AddAt(item, room_manage_list->GetCount() - 1);
	}
}
Beispiel #29
0
void RtsForm::DelayClose()
{
	closing_ = true;
	talking_ = false;
	Box* ack_box = (Box*)FindControl(L"ack_box");
	ack_box->SetVisible(false);
	auto closure = nbase::Bind(&RtsForm::Close, this, IDOK);
	nbase::ThreadManager::PostDelayedTask(kThreadUI, closure, nbase::TimeDelta::FromSeconds(2));
}
Beispiel #30
0
LRESULT WindowImplBase::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
    if (m_bFrameWnd) {
        bHandled = FALSE;
        return 0;
    }

    SIZE szRoundCorner = m_PaintManager.GetRoundCorner();
#if defined(WIN32) && !defined(UNDER_CE)
    if( !::IsIconic(*this) && (szRoundCorner.cx != 0 || szRoundCorner.cy != 0) ) {
        CDuiRect rcWnd;
        ::GetWindowRect(*this, &rcWnd);
        rcWnd.Offset(-rcWnd.left, -rcWnd.top);
        rcWnd.right++;
        rcWnd.bottom++;
        HRGN hRgn = ::CreateRoundRectRgn(rcWnd.left, rcWnd.top, rcWnd.right, rcWnd.bottom, szRoundCorner.cx, szRoundCorner.cy);
        ::SetWindowRgn(*this, hRgn, TRUE);
        ::DeleteObject(hRgn);
    }
#endif

    if (wParam != m_dwWindowPosState
            && (wParam==SIZE_MAXIMIZED || wParam==SIZE_RESTORED)
            && GetManager()->GetRoot())
    {
        CControlUI* btnmax = FindControl(_T("maxbtn"));
        CControlUI* btnrestore = FindControl(_T("restorebtn"));
        if (btnmax && btnrestore) {
            if (wParam == SIZE_MAXIMIZED) {
                btnmax->SetVisible(false);
                btnrestore->SetVisible(true);
            }
            else {
                btnmax->SetVisible(true);
                btnrestore->SetVisible(false);
            }
        }
    }

    m_dwWindowPosState = wParam;

    bHandled = FALSE;
    return 0;
}