From: Zak P. <ref...@us...> - 2001-03-11 03:50:59
|
Update of /cvsroot/rswitch/rswitch In directory usw-pr-cvs1:/tmp/cvs-serv12061 Modified Files: MainConfigDlg.cpp AddEditDlg.cpp Log Message: many changes - fixed the editing of channels, and added saving to the registry Index: MainConfigDlg.cpp =================================================================== RCS file: /cvsroot/rswitch/rswitch/MainConfigDlg.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** MainConfigDlg.cpp 2000/12/05 05:42:36 1.2 --- MainConfigDlg.cpp 2001/03/11 03:52:50 1.3 *************** *** 19,22 **** --- 19,25 ---- // $Log$ + // Revision 1.3 2001/03/11 03:52:50 refinersfire + // many changes - fixed the editing of channels, and added saving to the registry + // // Revision 1.2 2000/12/05 05:42:36 bcrochet // * Added member pointer to hotkeylist *************** *** 85,107 **** m_pHotKeyList = &(GetMainFrame()->GetHotKeyList()); ! HotKeyList::iterator i; ! for ( i = m_pHotKeyList->begin(); i != m_pHotKeyList->end(); i++ ) { LV_ITEM lvItem; lvItem.mask = LVIF_TEXT | LVIF_PARAM; ! lvItem.iItem = 0; lvItem.iSubItem = 0; - //CString modString = GetModifierString( (*i).GetModifiers() ); - //CString virtString = GetVirtKeyString( (*i).GetVirtKey() ); - //modString += " + "; - //modString += virtString; - //lvItem.pszText = ToLpstr( modString ); lvItem.pszText = LPSTR_TEXTCALLBACK; ! lvItem.lParam = (LPARAM)m_pHotKeyList->size() - 1; ! m_ctrlHotkeyList.InsertItem(&lvItem); ! lvItem.iSubItem = 1; ! //lvItem.pszText = ToLpstr( (*i).GetServerName() + "/" + (*i).GetChannelName() ); lvItem.pszText = LPSTR_TEXTCALLBACK; ! m_ctrlHotkeyList.SetItem(&lvItem); } --- 88,109 ---- m_pHotKeyList = &(GetMainFrame()->GetHotKeyList()); ! ! long listSize = m_pHotKeyList->size(); ! ! for (long i = 0; i < listSize; i++ ) { LV_ITEM lvItem; lvItem.mask = LVIF_TEXT | LVIF_PARAM; ! lvItem.iItem = i; lvItem.iSubItem = 0; lvItem.pszText = LPSTR_TEXTCALLBACK; ! lvItem.lParam = (LPARAM)i; ! ! m_ctrlHotkeyList.InsertItem(&lvItem); ! ! lvItem.iSubItem = 1; lvItem.pszText = LPSTR_TEXTCALLBACK; ! ! m_ctrlHotkeyList.SetItem(&lvItem); } *************** *** 154,177 **** CHotKeyEntry newEntry( dlg.m_wModifiers, dlg.m_wVirtualKeyCode, dlg.m_sServerName, dlg.m_sChannel ); m_pHotKeyList->push_back( newEntry ); LV_ITEM lvItem; lvItem.mask = LVIF_TEXT | LVIF_PARAM; lvItem.iItem = m_ctrlHotkeyList.GetItemCount(); lvItem.iSubItem = 0; - //CString modString = GetModifierString( dlg.m_wModifiers ); - //CString virtString = GetVirtKeyString( dlg.m_wVirtualKeyCode ); - //modString += " + "; - //modString += virtString; - //lvItem.pszText = ToLpstr( modString ); lvItem.pszText = LPSTR_TEXTCALLBACK; lvItem.lParam = (LPARAM)m_pHotKeyList->size() - 1; m_ctrlHotkeyList.InsertItem(&lvItem); lvItem.iSubItem = 1; - //CString ipaddr; - //ipaddr.Format( "%s %s/%s", - // dlg.m_sFunction, - // dlg.m_sServerName, - // dlg.m_sChannel - // ); - //lvItem.pszText = ToLpstr( ipaddr ); lvItem.pszText = LPSTR_TEXTCALLBACK; m_ctrlHotkeyList.SetItem(&lvItem); --- 156,169 ---- CHotKeyEntry newEntry( dlg.m_wModifiers, dlg.m_wVirtualKeyCode, dlg.m_sServerName, dlg.m_sChannel ); m_pHotKeyList->push_back( newEntry ); + LV_ITEM lvItem; lvItem.mask = LVIF_TEXT | LVIF_PARAM; lvItem.iItem = m_ctrlHotkeyList.GetItemCount(); lvItem.iSubItem = 0; lvItem.pszText = LPSTR_TEXTCALLBACK; lvItem.lParam = (LPARAM)m_pHotKeyList->size() - 1; m_ctrlHotkeyList.InsertItem(&lvItem); + lvItem.iSubItem = 1; lvItem.pszText = LPSTR_TEXTCALLBACK; m_ctrlHotkeyList.SetItem(&lvItem); *************** *** 187,190 **** --- 179,183 ---- return; } + CHotKeyEntry& entry = (*m_pHotKeyList)[m_ctrlHotkeyList.GetNextSelectedItem( pos )]; CAddEditDlg dlg(_T("Edit Hotkey"), entry ); *************** *** 193,197 **** --- 186,196 ---- entry.SetChannelName( dlg.m_sChannel ); entry.SetServerName( dlg.m_sServerName ); + entry.SetModifiers(dlg.m_wModifiers); + entry.SetVirtKey(dlg.m_wVirtualKeyCode); + //TODO: Type doesn't work yet + // entry.SetHotKeyType(dlg.m_sChannel); + m_ctrlHotkeyList.Update(m_ctrlHotkeyList.GetNextSelectedItem(pos)); } + } Index: AddEditDlg.cpp =================================================================== RCS file: /cvsroot/rswitch/rswitch/AddEditDlg.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** AddEditDlg.cpp 2000/12/05 05:45:12 1.2 --- AddEditDlg.cpp 2001/03/11 03:52:50 1.3 *************** *** 19,22 **** --- 19,25 ---- // $Log$ + // Revision 1.3 2001/03/11 03:52:50 refinersfire + // many changes - fixed the editing of channels, and added saving to the registry + // // Revision 1.2 2000/12/05 05:45:12 bcrochet // Too many to list. *************** *** 63,66 **** --- 66,71 ---- //}}AFX_DATA_INIT m_sTitle = title; + m_wVirtualKeyCode = hotKeyEntry.GetVirtKey(); + m_wModifiers = hotKeyEntry.GetModifiers(); } *************** *** 108,116 **** CDialog::OnInitDialog(); ! GetMainFrame()->EnableAllHotkeys(false); SetWindowText( m_sTitle ); m_ctrlFunction.SetCurSel(0); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE --- 113,123 ---- CDialog::OnInitDialog(); ! //GetMainFrame()->EnableAllHotkeys(false); SetWindowText( m_sTitle ); m_ctrlFunction.SetCurSel(0); + m_ctrlHotkey.SetHotKey(m_wVirtualKeyCode, m_wModifiers); + return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE *************** *** 120,124 **** { m_ctrlHotkey.GetHotKey( m_wVirtualKeyCode, m_wModifiers ); ! GetMainFrame()->EnableAllHotkeys(true); CDialog::OnOK(); --- 127,131 ---- { m_ctrlHotkey.GetHotKey( m_wVirtualKeyCode, m_wModifiers ); ! //GetMainFrame()->EnableAllHotkeys(true); CDialog::OnOK(); |