/* * Toggle overwrite mode. */ void ToggleOverwrite( LPCLASSDATA lpcd ) { /* * Toggle overwrite mode. */ lpcd->bOverwrite = ! lpcd->bOverwrite; /* * Destroy the caret if we have focus and * the caret type is not fixed at a block cursor. */ if ( Parser->nCaretType != CARET_BLOCK && lpcd->bHasFocus ) { /* * Destroy... */ DisplayCaret( lpcd, FALSE ); DestroyCaret(); } /* * Update status. */ SendStatusMessage( lpcd ); /* * Create the caret if we have focus and * the caret type is not fixed at a block cursor. */ if ( Parser->nCaretType != CARET_BLOCK && lpcd->bHasFocus ) /* * Create the caret. */ CreateTheCaret( lpcd ); }
LRESULT OnSetFocus( HWND hWnd, WPARAM wParam, LPARAM lParam, LPCLASSDATA lpcd ) { /* * We have the focus. */ lpcd->bHasFocus = TRUE; /* * Compute view. */ SetupViewSize( lpcd ); /* * Make the caret. */ CreateTheCaret( lpcd ); /* * Send a status message. */ SendStatusMessage( lpcd ); /* * Refresh the view. */ if ( HasMark( lpcd )) InvalidateRect( hWnd, NULL, FALSE ); /* * Is the search or replace window active? */ if ( lpcd->hReplaceWnd && ! IsWindowVisible( lpcd->hReplaceWnd )) ShowWindow( lpcd->hReplaceWnd, SW_SHOW ); if ( lpcd->hFindWnd && ! IsWindowVisible( lpcd->hFindWnd )) ShowWindow( lpcd->hFindWnd, SW_SHOW ); return 0; }