BOOL CDlgRaspressKP::OnInitDialog() { CDialog::OnInitDialog(); m_Dat.InitDate(); m_EdFam.SetMode(5); m_EdKPNum.SetMode(5); // m_EdKPNum.SetMode(0, 1, 10); DBW.FillEmplArray(m_EdFam.lpEmpl, 41); m_List1.ModifyStyle(LVS_NOCOLUMNHEADER, LVS_REPORT | LVS_SHOWSELALWAYS | WS_VISIBLE | WS_BORDER | WS_CHILD, 0); m_List1.SetExtendedStyle( LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT | LVS_EX_FLATSB ); m_List2.ModifyStyle(LVS_NOCOLUMNHEADER, LVS_REPORT | LVS_SHOWSELALWAYS | WS_VISIBLE | WS_BORDER | WS_CHILD, 0); m_List2.SetExtendedStyle( LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT | LVS_EX_FLATSB ); RefreshKPList(); RefreshRightList(); char cText[64] = ""; itoa(m_List1.GetItemCount(), cText, 10); m_Num1.SetWindowText(cText); iStarted = 1; return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CDlgRaspressKP::OnBnClickedButton2() { /* m_EdFam.EnableWindow(1); m_ButFam.EnableWindow(1);*/ if( iEdFocused ) { // AfxMessageBox("dont f**k with me!"); return; } RefreshKPList(); RefreshRightList(); m_List1.RedrawWindow(); }
BOOL CUser_ModifyGroup::OnInitDialog() { CDialog::OnInitDialog(); g_SetWndStaticText(this); CRect rect; GetDlgItem(IDC_RLIST_FRAME)->GetClientRect(&rect); GetDlgItem(IDC_RLIST_FRAME)->ClientToScreen(&rect); ScreenToClient(&rect); BOOL bCreate = m_rightList.Create(WS_VISIBLE | WS_TABSTOP | WS_CHILD | WS_BORDER | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_HASLINES | TVS_DISABLEDRAGDROP, rect, this, 0x1005); SetWindowLong(m_rightList.m_hWnd, GWL_STYLE, TVS_CHECKBOXES); m_rightList.ShowWindow(SW_SHOW); if (!m_user_info || !m_dev) { return TRUE; } int i; CString strRight; for (i = 0; i < m_user_info->dwRightNum; i++) { HTREEITEM hRoot; strRight.Format("%d: %s : %s", m_user_info->rightList[i].dwID, m_user_info->rightList[i].name, m_user_info->rightList[i].memo); hRoot = m_rightList.InsertItem(strRight, 0, 0, TVI_ROOT); m_rightList.SetItemData(hRoot, m_user_info->rightList[i].dwID); // m_userList.Expand(hRoot, TVE_EXPAND); } RefreshRightList(m_user_info->groupList[m_gpIdx].dwRightNum, m_user_info->groupList[m_gpIdx].rights); GetDlgItem(IDC_GPNAME_OLD_EDIT)->SetWindowText(m_user_info->groupList[m_gpIdx].name); GetDlgItem(IDC_GPNAME_NEW_EDIT)->SetWindowText(m_user_info->groupList[m_gpIdx].name); GetDlgItem(IDC_GPMEMO_OLD_EDIT)->SetWindowText(m_user_info->groupList[m_gpIdx].memo); GetDlgItem(IDC_GPMEMO_NEW_EDIT)->SetWindowText(m_user_info->groupList[m_gpIdx].memo); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }