Example #1
0
BOOL CListCtrlPage::OnInitDialog()
{
	CCtrldemoApp	*pApp;
	CRect			rect;
	UINT			rgIndicators[] = {ID_SEPARATOR, ID_INDICATOR_CAPS, ID_INDICATOR_NUM};

	CPropertyPage::OnInitDialog();  // let the base class do the default work
	UpdateData(TRUE/*bSaveAndValidate*/);  // bring the information from the dialog.
	pApp = (CCtrldemoApp *)AfxGetApp();
	srand((unsigned) time(NULL));  // start the random number generator
	m_pimagelist = new CImageList();		
	m_pimagelistSmall = new CImageList();
	ASSERT(m_pimagelist != NULL && m_pimagelistSmall != NULL);    // no serious allocation failure checking
	m_pimagelist->Create(32, 32, TRUE/*bMask*/,	LISTICONCOUNT/*nInitial*/, 4/*nGrow*/);
	m_pimagelistSmall->Create(16, 16, TRUE/*bMask*/, LISTICONCOUNT, 4);
	m_pimagelist->Add(pApp->LoadIcon(IDI_ICONLIST1));
	m_pimagelist->Add(pApp->LoadIcon(IDI_ICONLIST2));
	m_pimagelist->Add(pApp->LoadIcon(IDI_ICONLIST3));
	m_pimagelist->Add(pApp->LoadIcon(IDI_ICONLIST4));
	m_pimagelistSmall->Add(pApp->LoadIcon(IDI_ICONLIST1));
	m_pimagelistSmall->Add(pApp->LoadIcon(IDI_ICONLIST2));
	m_pimagelistSmall->Add(pApp->LoadIcon(IDI_ICONLIST3));
	m_pimagelistSmall->Add(pApp->LoadIcon(IDI_ICONLIST4));

	FillListCtrl();
	GetDlgItem(IDC_ALIGN)->EnableWindow(FALSE);  // default is  report mode Does not support this
	GetDlgItem(IDC_AUTOARRANGE)->EnableWindow(FALSE);
	return FALSE;  // there is no change in any control focus stuff here.
}
Example #2
0
void CMDIView::OnInitialUpdate() 
{
	CView::OnInitialUpdate();
	InitListCtrl(m_pList);
	FillListCtrl(m_pList);
	UpdateWindow();
}
Example #3
0
BOOL CMDecodePage::OnInitDialog() 
{
	CDialog::OnInitDialog();

	m_vlist.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
	m_vlist.EnableToolTips(TRUE);
	InitListCtrl(&m_vlist);
	FillListCtrl(&m_vlist);
	
	m_alist.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
	m_alist.EnableToolTips(TRUE);
	InitListCtrl(&m_alist);
	
	m_avlist.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
	m_avlist.EnableToolTips(TRUE);
	InitListCtrlAV(&m_avlist);
	FillListCtrlAV(&m_avlist);

	for(int i = 0; i < m_str_codecs.GetCount(); i++)
		m_codecs.AddString(m_str_codecs[i]);
	m_codecs.SetCurSel(inner);
	
	InitFromConfig();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Example #4
0
BOOL CMyPropertyPage1::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	m_List.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
	InitListCtrl(&m_List);
	FillListCtrl(&m_List);
	return TRUE;
}
Example #5
0
/////////////////////////////////////////////////////////////////////////////
// CUserManagePage message handlers
BOOL CUserManagePage::OnInitDialog()
{
	CPropertyPage::OnInitDialog();
	UpdateData(TRUE);
	ModifyHeaderItems();
	FillListCtrl();
	DWORD style=m_listctrl.GetExtendedStyle();
	m_listctrl.SetExtendedStyle(style|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
	return TRUE;
}
Example #6
0
void CUserManagePage::OnBnClickedConfirm()
{
	// TODO: 在此添加控件通知处理程序代码
	char sqlbuf[512];
	CString groupname;
	m_box_role.GetWindowTextW(groupname);
	CString user;
	m_box_user.GetWindowTextW(user);
	string str_group = WChar2Ansi((LPCWSTR)groupname);
	string str_user  = WChar2Ansi((LPCWSTR)user);
	sprintf_s(sqlbuf, "update user set usergroupid = (select groupid from usergroup where groupname = '%s') where username = '******'",str_group.c_str(),str_user.c_str());
	if(CDbsource::GetDB().Update(sqlbuf))
	{
	   ::SetDlgItemTextW(this->m_hWnd,IDC_MSG,_T("执行成功."));
	   FillListCtrl();
	}
}
Example #7
0
void CListCtrlPage::RenewListCtrl(long lStyle, BOOL bSetBits)
{
	long	lStyleOld;
	CRect	rect;

	lStyleOld = GetWindowLong(m_listctrl.m_hWnd, GWL_STYLE);
	lStyleOld &= ~lStyle;
	if (bSetBits)
		lStyleOld |= lStyle;

	m_listctrl.GetWindowRect(&rect);
	ScreenToClient(&rect);
	m_listctrl.DestroyWindow();
	m_listctrl.Create(lStyleOld, rect, this, IDC_LISTVIEW1);
	m_listctrl.SetImageList(m_pimagelist, LVSIL_NORMAL);
	m_listctrl.SetImageList(m_pimagelistSmall, LVSIL_SMALL);
	m_listctrl.GetWindowRect(&rect);
	FillListCtrl();
}