BOOL CIrcWnd::PreTranslateMessage(MSG* pMsg) { if(pMsg->message == WM_KEYDOWN && (pMsg->hwnd == GetDlgItem(IDC_INPUTWINDOW)->m_hWnd)) { if (pMsg->wParam == VK_RETURN) { //If we press the enter key, treat is as if we pressed the send button. OnBnClickedChatsend(); return TRUE; } if (pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN) { //If we press page up/down scroll.. m_channelselect.ScrollHistory(pMsg->wParam == VK_DOWN); return TRUE; } if (pMsg->wParam == VK_TAB ) { AutoComplete(); return true; } } OnChatTextChange(); return CResizableDialog::PreTranslateMessage(pMsg); }
BOOL CIrcWnd::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_KEYDOWN) { // Don't handle Ctrl+Tab in this window. It will be handled by main window. if (pMsg->wParam == VK_TAB && GetAsyncKeyState(VK_CONTROL) < 0) return FALSE; if (pMsg->hwnd == m_wndInput) { if (pMsg->wParam == VK_RETURN) { //If we press the enter key, treat is as if we pressed the send button. OnBnClickedIrcSend(); return TRUE; } if (pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN) { //If we press page up/down scroll.. m_wndChanSel.ScrollHistory(pMsg->wParam == VK_DOWN); return TRUE; } if (pMsg->wParam == VK_TAB) { AutoComplete(); return TRUE; } } } OnChatTextChange(); return CResizableDialog::PreTranslateMessage(pMsg); }
BOOL CIrcWnd::OnInitDialog() { CResizableDialog::OnInitDialog(); #ifdef _DEBUG CString strBuff; m_nicklist.GetWindowText(strBuff); ASSERT( strBuff == NICK_LV_PROFILE_NAME ); strBuff.Empty(); m_serverChannelList.GetWindowText(strBuff); ASSERT( strBuff == CHAN_LV_PROFILE_NAME ); #endif m_bConnected = false; m_bLoggedIn = false; Localize(); m_pIrcMain = new CIrcMain(); m_pIrcMain->SetIRCWnd(this); UpdateFonts(&theApp.m_fontHyperText); InitWindowStyles(this); ((CEdit*)GetDlgItem(IDC_INPUTWINDOW))->SetLimitText(MAX_IRC_MSG_LEN); //MORPH START -Added by SiRoB, Splitting Bar [O²] CRect rc,rcSpl; CWnd* pWnd = GetDlgItem(IDC_NICKLIST); pWnd->GetWindowRect(rcSpl); ScreenToClient(rcSpl); GetWindowRect(rc); ScreenToClient(rc); rcSpl.bottom=rc.bottom-10; rcSpl.left=rcSpl.right +3; rcSpl.right=rcSpl.left+4; m_wndSplitterIRC.Create(WS_CHILD | WS_VISIBLE, rcSpl, this, IDC_SPLITTER_IRC); //MORPH END - Added by SiRoB, Splitting Bar [O²] AddAnchor(IDC_BN_IRCCONNECT,BOTTOM_LEFT); AddAnchor(IDC_CLOSECHAT,BOTTOM_LEFT); AddAnchor(IDC_CHATSEND,BOTTOM_RIGHT); AddAnchor(IDC_INPUTWINDOW,BOTTOM_LEFT,BOTTOM_RIGHT); AddAnchor(IDC_NICKLIST,TOP_LEFT,BOTTOM_LEFT); AddAnchor(IDC_TITLEWINDOW,TOP_LEFT,TOP_RIGHT); AddAnchor(IDC_SERVERCHANNELLIST,TOP_LEFT,BOTTOM_RIGHT); AddAnchor(IDC_TAB2,TOP_LEFT, TOP_RIGHT); //MORPH START - Added by SiRoB, Splitting Bar [O²] AddAnchor(m_wndSplitterIRC,TOP_LEFT, BOTTOM_LEFT); int PosStatinit = rcSpl.left; int PosStatnew = thePrefs.GetSplitterbarPositionIRC(); int max = 700; int min = 200; if (thePrefs.GetSplitterbarPositionIRC() > 700) PosStatnew = 700; else if (thePrefs.GetSplitterbarPositionIRC() < 200) PosStatnew = 200; rcSpl.left = PosStatnew; rcSpl.right = PosStatnew+5; m_wndSplitterIRC.MoveWindow(rcSpl); DoResize(PosStatnew-PosStatinit); //MORPH END - Added by SiRoB, Splitting Bar [O²] m_serverChannelList.Init(); m_nicklist.Init(); m_channelselect.Init(); OnChatTextChange(); return true; }
BOOL CIrcWnd::OnInitDialog() { CResizableDialog::OnInitDialog(); m_bConnected = false; m_bLoggedIn = false; m_pIrcMain = new CIrcMain(); m_pIrcMain->SetIRCWnd(this); UpdateFonts(&theApp.m_fontHyperText); InitWindowStyles(this); SetAllIcons(); m_wndInput.SetLimitText(MAX_IRC_MSG_LEN); if (theApp.m_fontChatEdit.m_hObject) { m_wndInput.SendMessage(WM_SETFONT, (WPARAM)theApp.m_fontChatEdit.m_hObject, FALSE); CRect rcEdit; m_wndInput.GetWindowRect(&rcEdit); ScreenToClient(&rcEdit); rcEdit.top -= 2; rcEdit.bottom += 2; m_wndInput.MoveWindow(&rcEdit, FALSE); } CRect rcSpl; m_wndNicks.GetWindowRect(rcSpl); ScreenToClient(rcSpl); rcSpl.left = rcSpl.right + SPLITTER_HORZ_MARGIN; rcSpl.right = rcSpl.left + SPLITTER_HORZ_WIDTH; m_wndSplitterHorz.Create(WS_CHILD | WS_VISIBLE, rcSpl, this, IDC_SPLITTER_IRC); AddAnchor(IDC_BN_IRCCONNECT, BOTTOM_LEFT); AddAnchor(IDC_CLOSECHAT, BOTTOM_LEFT); AddAnchor(IDC_CHATSEND, BOTTOM_RIGHT); AddAnchor(m_wndFormat, BOTTOM_LEFT); AddAnchor(m_wndInput, BOTTOM_LEFT, BOTTOM_RIGHT); AddAnchor(m_wndNicks, TOP_LEFT, BOTTOM_LEFT); AddAnchor(m_wndChanList, TOP_LEFT, BOTTOM_RIGHT); AddAnchor(m_wndChanSel, TOP_LEFT, TOP_RIGHT); AddAnchor(m_wndSplitterHorz, TOP_LEFT, BOTTOM_LEFT); // Vista: Remove the TBSTYLE_TRANSPARENT to avoid flickering (can be done only after the toolbar was initially created with TBSTYLE_TRANSPARENT !?) m_wndFormat.ModifyStyle((theApp.m_ullComCtrlVer >= MAKEDLLVERULL(6, 16, 0, 0)) ? TBSTYLE_TRANSPARENT : 0, TBSTYLE_TOOLTIPS); m_wndFormat.SetExtendedStyle(m_wndFormat.GetExtendedStyle() | TBSTYLE_EX_MIXEDBUTTONS); TBBUTTON atb[5] = {0}; atb[0].iBitmap = 0; atb[0].idCommand = IDC_SMILEY; atb[0].fsState = TBSTATE_ENABLED; atb[0].fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE; atb[0].iString = -1; atb[1].iBitmap = 1; atb[1].idCommand = IDC_BOLD; atb[1].fsState = TBSTATE_ENABLED; atb[1].fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE; atb[1].iString = -1; atb[2].iBitmap = 2; atb[2].idCommand = IDC_UNDERLINE; atb[2].fsState = TBSTATE_ENABLED; atb[2].fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE; atb[2].iString = -1; atb[3].iBitmap = 3; atb[3].idCommand = IDC_COLOUR; atb[3].fsState = TBSTATE_ENABLED; atb[3].fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE; atb[3].iString = -1; atb[4].iBitmap = 4; atb[4].idCommand = IDC_RESET; atb[4].fsState = TBSTATE_ENABLED; atb[4].fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE; atb[4].iString = -1; m_wndFormat.AddButtons(_countof(atb), atb); CSize size; m_wndFormat.GetMaxSize(&size); ::SetWindowPos(m_wndFormat, NULL, 0, 0, size.cx, size.cy, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); int iPosStatInit = rcSpl.left; int iPosStatNew = thePrefs.GetSplitterbarPositionIRC(); if (iPosStatNew > SPLITTER_HORZ_RANGE_MAX) iPosStatNew = SPLITTER_HORZ_RANGE_MAX; else if (iPosStatNew < SPLITTER_HORZ_RANGE_MIN) iPosStatNew = SPLITTER_HORZ_RANGE_MIN; rcSpl.left = iPosStatNew; rcSpl.right = iPosStatNew + SPLITTER_HORZ_WIDTH; if (iPosStatNew != iPosStatInit) { m_wndSplitterHorz.MoveWindow(rcSpl); DoResize(iPosStatNew - iPosStatInit); } Localize(); m_wndChanList.Init(); m_wndNicks.Init(); m_wndNicks.SetColumnWidth(0, LVSCW_AUTOSIZE_USEHEADER); m_wndChanSel.Init(); OnBackcolor(); // Design Settings [eWombat/Stulle] - Max OnChatTextChange(); return true; }