void CLoginDlg::DispLatestUser() { try { if( m_SQLDirect.ExecuteSQL("SELECT * FROM uSysInfo")==SQL_SUCCESS) { int nRet=m_SQLDirect.Fetch(); if(!nRet) { m_strUser=m_SQLDirect.GetCol(1); CWnd* pWnd; pWnd=GetDlgItem(IDC_EDT_PWD); //IDC_EDT_USER IDC_EDT_PWD pWnd->SetFocus(); } else { CWnd* pWnd; pWnd=GetDlgItem(IDC_EDT_USER); pWnd->SetFocus(); } } } catch(CDBException *e){ e->ReportError(); EndWaitCursor(); return ; } }
/*virtual*/ void CWnd::OnKey(ui16 nKey) { if ( nKey & BIOS::KEY::KeyDown ) { _ASSERT( m_pFocus == this ); // ja mam focus! CWnd *pFocus = _GetNextActiveWindow(); // cycle items, when there are no more window, jump to first possible if ( !pFocus ) pFocus = _GetFirstActiveWindow(); if (pFocus) { // find first visible window wich can be focused if (pFocus->m_pFirst) pFocus = pFocus->m_pFirst; pFocus->SetFocus(); this->Invalidate(); pFocus->Invalidate(); } } if ( nKey & BIOS::KEY::KeyUp ) { _ASSERT( m_pFocus == this ); CWnd *pFocus = _GetPrevActiveWindow(); // cycle items if ( !pFocus ) pFocus = _GetLastActiveWindow(); if (pFocus) { if (pFocus->GetLast()) pFocus = pFocus->GetLast(); pFocus->SetFocus(); this->Invalidate(); pFocus->Invalidate(); } } if ( nKey & BIOS::KEY::KeyEscape ) { if(m_pParent && m_pParent->m_pParent) { CWnd *pFocus = m_pParent->m_pParent->m_pFirst; if (pFocus) { if (pFocus->GetLast()) pFocus = pFocus->GetLast(); pFocus->SetFocus(); this->Invalidate(); pFocus->Invalidate(); } } } }
BOOL CPropertyPageHost::SetActivePage(int nIndex, BOOL bAndFocus) { if (nIndex < 0 || nIndex >= m_aPages.GetSize()) return FALSE; CPropertyPage* pPage = m_aPages[nIndex].pPage; if (!pPage) return FALSE; CWnd* pFocus = GetFocus(); if (!EnsurePageCreated(nIndex)) return FALSE; // hide the current page provided it's not just about to be reshown BOOL bSamePage = (m_nSelIndex == nIndex); if (!bSamePage) { if (m_nSelIndex != -1) { CPropertyPage* pCurPage = GetActivePage(); ASSERT (pCurPage); if (pCurPage) { pCurPage->ShowWindow(SW_HIDE); pCurPage->OnKillActive(); } } UpdatePageSize(nIndex); pPage->OnSetActive(); pPage->ShowWindow(SW_SHOW); // move the focus to the first dlg ctrl if (bAndFocus) { CWnd* pCtrl = pPage->GetNextDlgTabItem(NULL); if (pCtrl) pCtrl->SetFocus(); } else pFocus->SetFocus(); m_nSelIndex = nIndex; } return TRUE; }
BOOL CMyTab::PreTranslateMessage(MSG* pMsg) { if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB) { BOOL bPrevious = (GetAsyncKeyState(VK_SHIFT) & 0x8000)?TRUE:FALSE; CWnd* pDummy = NULL; CWnd* pFirst = this->GetNextDlgTabItem(pDummy); CWnd* pLast = this->GetNextDlgTabItem(pFirst, TRUE); CWnd* pActive = this->GetFocus(); CWnd* pNext = this->GetNextDlgTabItem(pActive, bPrevious); if( ( ( (pNext == pFirst && !bPrevious) || (bPrevious && pNext == pLast)) || pActive == pNext ) && GetParent()) { if(bPrevious) GetParent()->SetFocus(); else { pNext = AfxGetMainWnd()->GetNextDlgTabItem(GetParent()); if(pNext) pNext->SetFocus(); } return TRUE; } } return CDialog::PreTranslateMessage(pMsg); }
int CRptFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here if( !m_Acct_DlgBar.Create( this, IDD_ACCT_DLGBAR, CBRS_TOP, 1) ) { TRACE("CRptFrame: Failed to create dialog bar\n"); return -1; } CWnd* pAcct = m_Acct_DlgBar.GetDlgItem( IDC_ACCT ); pAcct->SetFocus( ); CWinApp* pApp = AfxGetApp( ); //CFrameWnd* pMainFrame = (CFrameWnd*) (AfxGetApp()->m_pMainWnd); //CJevDoc* pDoc = (CJevDoc*) pMainFrame->GetActiveDocument(); //ASSERT_VALID(pDoc); CJevApp* pJevApp = ((CJevApp*) AfxGetApp()); CJevDoc* pDoc = pJevApp -> m_pActiveJevDoc; int ar = pDoc->njeGetActiveRecord(); CJournalEntry* pJE = pDoc->m_JEArray.GetAtJe( ar ); m_sAcct = pJE->GetCrAcct(); m_Acct_DlgBar.SetDlgItemText( IDC_ACCT, m_sAcct); //GotoDlgCtrl( pAcct ); return 0; }
void CCustomHeadersDlg::OnAddHeader() { CEditHeadersDlg EditDlg( " ",this); if (IDOK == EditDlg.DoModal()) { if ( !EditDlg.m_strHeader.IsEmpty()) { m_lbHeaderList.AddString(EditDlg.m_strHeader); } else { return; } } else { return; } CWnd *pWnd = (CWnd*) GetDlgItem(IDC_ADD_HEADER); if (pWnd) { pWnd->SetFocus(); } UpdateData(); }
void CEkiView::OnSetFocus(CWnd* pOldWnd) { //CView::OnSetFocus(pOldWnd); CWnd* pControl = GetNextDlgTabItem( (CWnd*)NULL , FALSE ) ; pControl->SetFocus() ; }
BOOL COrderByMailDialog::OnInitDialog() { CenterWindow(); CBaseDialog::OnInitDialog(); CMlsPropertyControl::SubclassPropertyControls(this); // Build the product list and get some prices. m_pInfo->GetLRCFromProducts(m_csLRC); m_CodeCtrl.LimitText(12); BOOL fProductsOrdered = GetApp()->Offer()->CountProductFlags(PRODUCT_ITEM_Selected) > 0; CWnd* pWnd = GetDlgItem(IDC_PRINTORDERFORM); if (pWnd != NULL) { pWnd->EnableWindow(fProductsOrdered); } CWnd* pFocus = GetDlgItem(fProductsOrdered ? IDC_PRINTORDERFORM : IDC_ACCESS_CODE); if (pFocus != NULL) { pFocus->SetFocus(); } return pFocus == NULL; }
void CBrushEntityDialog::OnEntities() { int Cur; // Entity button was clicked // Get current entity type from combo box and create one... Cur = m_EntityCombo.GetCurSel (); if (Cur != LB_ERR) { char EntityName[_MAX_PATH]; CWnd *LastView; m_EntityCombo.GetLBText (Cur, EntityName); /* We create a "light" entity as the template entity. In future, we'll have a "template" entity. */ m_pFusionDoc->CreateEntity ("light");//EntityName); LastView = m_pParentCtrl->LastView; if ((LastView != NULL) && ::IsWindow (LastView->m_hWnd)) { LastView->SetFocus (); } } }
void CCatDialog::OnDDBnClicked() { CWnd* box = GetDlgItem(IDC_REGEXP); box->SetFocus(); box->SetWindowText(_T("")); box->SendMessage(WM_KEYDOWN, VK_DOWN, 0x00510001); }
void CServerWnd::OnDDClicked() { CWnd* box = GetDlgItem(IDC_SERVERMETURL); box->SetFocus(); box->SetWindowText(_T("")); box->SendMessage(WM_KEYDOWN, VK_DOWN, 0x00510001); }
void CWndToolbox::DoModal() { BIOS::SYS::Beep(100); /* #ifdef _WIN32 // no enough ram for this on ARM M3 :( ui16 buffer[Width*Height]; BIOS::LCD::GetImage( m_rcClient, buffer ); #endif */ m_bRunning = true; m_bFirst = true; m_bAdcEnabled = BIOS::ADC::Enabled(); BIOS::ADC::Enable(false); if ( MainWnd.m_wndMenuInput.m_wndListTrigger.IsVisible() ) MainWnd.m_wndMenuInput.m_wndListTrigger.Invalidate(); if ( MainWnd.m_wndMenuInput.m_itmTrig.IsVisible() ) MainWnd.m_wndMenuInput.m_itmTrig.Invalidate(); CWnd* pSafeFocus = GetFocus(); SetFocus(); ShowWindow( CWnd::SwShow ); Invalidate(); while ( IsRunning() ) { Sleep(20); } ShowWindow( CWnd::SwHide ); /* #ifdef _WIN32 BIOS::LCD::PutImage( m_rcClient, buffer ); #endif*/ switch ( GetResult() ) { case MenuPauseResume: // Resume / Pause m_bAdcEnabled = !m_bAdcEnabled; break; case MenuManager: m_bAdcEnabled = FALSE; // Load wave BIN break; case MenuReset: Settings.Reset(); break; case -1: break; } UpdateAdc(); pSafeFocus->SetFocus(); CRect rcSafe = m_rcOverlay; m_rcOverlay.Invalidate(); MainWnd.Invalidate(); // to redraw the graph m_rcOverlay = rcSafe; }
void CRuntimeDlg::OnSetFocus(CWnd* pOldWnd) { CDialog::OnSetFocus(pOldWnd); CWnd* pChild = GetWindow(GW_CHILD); if (pChild) pChild->SetFocus(); }
void CComposeFrame::OnSelectAddresses() { CAddrDialog AddressDialog(this); GetComposeBar()->OnAddressTab(); GetComposeBar()->UpdateWindow(); CWnd * pWnd = GetFocus(); AddressDialog.DoModal(); pWnd->SetFocus(); }
BOOL CSmartFieldListBox::OnFinishEdit(BOOL fValidate /*=TRUE*/, BOOL fByReturn /*=FALSE*/) { int nCurSel = GetCurSel(); int nCount = GetCount(); CSmartFieldsDialog* pParent = (CSmartFieldsDialog*)GetParent(); BOOL fModified = m_pEditor->GetEditor()->GetModify(); if (INHERITED::OnFinishEdit(fValidate, fByReturn)) { if (fModified) { /* // Field is valid. // Update the macro in the project. */ if (nCurSel == GetCurSel() && nCount == GetCount()) { /* Get the macro index so we will know which one to update. */ CSmartFieldListBoxItem* pItem = (CSmartFieldListBoxItem*)GetItemData(nCurSel); if (pItem != NULL) { pParent->UpdateFields(TRUE, pItem->Index()); } } } if (fByReturn) { TRACE(">>> Advance to next field! <<<\n"); int nCurSel = GetCurSel(); int nCount = GetCount(); if (nCurSel != nCount-1) { BeginEdit(nCurSel+1); } else { CWnd* pCloseButton = pParent->GetDlgItem(IDC_CLOSE); if (pCloseButton != NULL) { pCloseButton->SetFocus(); } } } return TRUE; } return FALSE; }
BOOL CAboutDlg :: OnInitDialog ( void ) { ASSERT ( this ) ; // Let the normal processing happen. CDialog::OnInitDialog ( ) ; // Do the big icon. m_cBigIcon.SubclassDlgItem ( IDC_BIGICON , this ) ; m_cBigIcon.SizeToContent ( ) ; // Create and set the name font. m_pcFont = new CFont ; BOOL bRet = m_pcFont->CreatePointFont ( 300 , _T ( "Arial" ) ) ; ASSERT ( bRet ) ; if ( TRUE == bRet ) { CWnd * pWnd = GetDlgItem ( IDC_APPNAME ) ; ASSERT ( NULL != pWnd ) ; if ( NULL != pWnd ) { pWnd->SetFont ( m_pcFont ) ; } } m_cRedText.SubclassDlgItem ( IDC_APPNAME , this ) ; // Stick the hint text into the edit control. HRSRC hRes = ::FindResource ( NULL , MAKEINTRESOURCE ( IDR_HINTDATA ) , _T ( "HINTDATA" ) ) ; ASSERT ( NULL != hRes ) ; if ( NULL != hRes ) { LPCTSTR szData = (LPCTSTR)::LoadResource ( NULL , hRes ) ; ASSERT ( NULL != szData ) ; CWnd * pEdit = GetDlgItem ( IDC_HINTS ) ; ASSERT ( NULL != pEdit ) ; pEdit->SetWindowText ( szData ) ; } // Get the hyperlink thing hooked up. //m_cWebLink.m_link = _T ( "www.wintellect.com" ) ; m_cWebLink.SubclassDlgItem ( IDC_HYPERLINK , this ) ; // Put the focus on the OK button. CWnd * pOK = GetDlgItem ( IDOK ) ; ASSERT ( NULL != pOK ) ; pOK->SetFocus ( ) ; return ( FALSE ) ; }
void CNamePage::OnUseName() { // enable the edit control and move to it.... CWnd* pwndEdit = GetDlgItem( IDC_SVRNAME ); if ( pwndEdit ) { pwndEdit->EnableWindow( TRUE ); pwndEdit->SetFocus(); } }
void CTilePanel::OnLButtonDown(UINT nFlags, CPoint point) { // WM_MOUSEWHEEL 메세지를 받기위해서 다른 컨트롤에 포커스를 맞춘다. CWnd *pwnd = GetDlgItem( IDC_STATIC_CHUNKPOS ); pwnd->SetFocus(); m_bDrag = TRUE; GetCursorPos( &m_ptClickPos ); SetCapture(); CPanelBase::OnLButtonDown(nFlags, point); }
BOOL CGroupName::OnInitDialog() { CDialog::OnInitDialog(); CWnd *pWnd = GetDlgItem(IDC_NAME); if(pWnd) pWnd->SetFocus(); return FALSE; }
BOOL CEmailDlg::OnInitDialog() { CDialog::OnInitDialog(); CWnd *wnd = GetDlgItem (IDC_EMAIL); if (wnd != NULL) wnd->SetFocus(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void Splitter::setFocus(void) { Pane *sPane = getPane(mActivedPaneRow, mActivedPaneColumn); if (XPR_IS_NULL(sPane)) return; CWnd *sPaneWnd = sPane->mPaneWnd; if (XPR_IS_NOT_NULL(sPaneWnd)) { sPaneWnd->SetFocus(); } }
void CTabSplitterWnd::OnSetFocus(CWnd* pOldWnd) { CSplitterWnd::OnSetFocus(pOldWnd); // TODO: Add your message handler code here if (m_nCurRow >= 0 && m_nCurCol >= 0) { SetActivePane(m_nCurRow,m_nCurCol); CWnd *pWnd = GetPane(m_nCurRow,m_nCurCol); pWnd->SetFocus(); } }
BOOL CRotateDialog::OnInitDialog() { CDialog::OnInitDialog(); CWnd* firstEdit = GetDlgItem(IDC_ROTATEANGLE); if (firstEdit) { firstEdit->SetFocus(); } return FALSE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
LRESULT COptionsPage::OnWizardNext(void) { CWnd* pWnd; pWnd = GetDlgItem(IDC_EDIT_SOURCE); ASSERT(pWnd != NULL); if (pWnd->GetWindowTextLength() == 0) { AfxMessageBox(IDS_NO_SOURCE, MB_ICONSTOP | MB_OK); pWnd->SetFocus(); return (-1); } pWnd = GetDlgItem(IDC_EDIT_TARGET); ASSERT(pWnd != NULL); if (pWnd->GetWindowTextLength() == 0) { AfxMessageBox(IDS_NO_TARGET, MB_ICONSTOP | MB_OK); pWnd->SetFocus(); return (-1); } m_dtpWrite.GetTime(m_timeWrite); return (__super::OnWizardNext()); }
void CGenEdView::OnActivateEditor (LPARAM, WPARAM) { CWnd *pWnd; assert (m_pServer != NULL); if (m_pServer == NULL) return; pWnd = m_pServer->GetInPlaceWindow (); if (pWnd == NULL) return; pWnd->SetFocus (); }
/****************************************************************************** Function Name : OnClose Input(s) : Output : void Functionality : Member of : CTSExecutorChildFrame Friend of : - Author(s) : Venkatanarayana Makam Date Created : 28/04/2011 Modifications : Code Tag : ******************************************************************************/ void CTSExecutorChildFrame::OnClose() { WINDOWPLACEMENT wndPlcmnt; GetWindowPlacement(&wndPlcmnt); wndPlcmnt.showCmd = SW_HIDE; SetWindowPlacement(&wndPlcmnt); CWnd* pActivateWnd = GetNextWindow(); pActivateWnd->SetForegroundWindow(); pActivateWnd->SetFocus(); ShowWindow(SW_HIDE); }
void CButtonST::OnEnable(BOOL bEnable) { CButton::OnEnable(bEnable); if (bEnable == FALSE) { CWnd* pWnd = GetParent()->GetNextDlgTabItem(this); if (pWnd) pWnd->SetFocus(); else GetParent()->SetFocus(); CancelHover(); } // if } // End of OnEnable
BOOL CDlgDbg::Create(HWND hWndParent, CMgrData *pMgrData) { CWnd *pWnd; m_pMgrData = pMgrData; m_pSock = m_pMgrData->GetUraraSockTCP (); pWnd = CWnd::FromHandle (hWndParent); CDialog::Create (IDD, pWnd); ShowWindow (SW_SHOW); pWnd->SetFocus (); return TRUE; }
void ZListTip::OnMouseMove( UINT uFlags, CPoint pt ) { #ifdef DEBUG_ALL TraceRect( "ZListTip::OnMouseMove rectTitle: ", m_rectTitle ); TracePoint( "ZListTip::OnMouseMove pt: ", pt ); #endif if ( m_rectTitle.PtInRect( pt ) == FALSE ) { #ifdef DEBUG_ALL TracePoint( "ZListTip::OnMouseMove PtInRect: ", pt ); #endif #if 0 if ( GetCapture( ) == this ) ReleaseCapture( ); SetWindowPos( 0, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE ); #else Hide( ); #endif // Forward the message ClientToScreen( &pt ); CWnd *pWnd = WindowFromPoint( pt ); if ( pWnd == this ) pWnd = m_pParentWnd; CWnd *pWndTemp = GetFocus( ); if ( pWndTemp != pWnd ) pWnd->SetFocus( ); zLONG lParam = MAKELONG( pt.x, pt.y ); int nHitTest = (int) pWnd->SendMessage( WM_NCHITTEST, 0, lParam ); if ( nHitTest == HTCLIENT ) { pWnd->ScreenToClient( &pt ); lParam = MAKELONG( pt.x, pt.y ); pWnd->PostMessage( WM_MOUSEMOVE, uFlags, lParam ); } else { pWnd->PostMessage( WM_NCMOUSEMOVE, nHitTest, lParam ); } } }
// Special handling of OnSetFocus and OnSize are required for a container // when an object is being edited in-place. void CMy1553View::OnSetFocus(CWnd* pOldWnd) { COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this); if (pActiveItem != NULL && pActiveItem->GetItemState() == COleClientItem::activeUIState) { // need to set focus to this item if it is in the same view CWnd* pWnd = pActiveItem->GetInPlaceWindow(); if (pWnd != NULL) { pWnd->SetFocus(); // don't call the base class return; } } CView::OnSetFocus(pOldWnd); }