📄 propchg.cpp
字号:
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnShowAccelerator(
BOOL fPropertyFlag) //@parm TRUE = show accelerator
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnShowAccelerator");
// Get the new accelerator character
HRESULT hr = UpdateAccelerator();
// Update the view - we update even in the face of an error return.
// The point is that errors will be rare (non-existent?) and the update
// will work even in the face of the error so why bother conditionalizing
// the execution.
NeedViewUpdate(TRUE);
return hr;
}
/*
* CTxtEdit::OnUsePassword (fPropertyFlag)
*
* @mfunc
* Update use-password property
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnUsePassword(
BOOL fPropertyFlag) //@parm TRUE = use password character
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnUsePassword");
Assert((DWORD)fPropertyFlag <= 1); // Be sure it's C boolean
_fUsePassword = fPropertyFlag;
_pdp->UpdateView(); // State changed so update view
return S_OK;
}
/*
* CTxtEdit::OnTxHideSelectionChange (fHideSelection)
*
* @mfunc
* Notify text services that hide-selection property changed
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnTxHideSelectionChange(
BOOL fHideSelection) //@parm TRUE = hide selection
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnTxHideSelectionChange");
_fHideSelection = fHideSelection;
if(_fFocus) // If we have the focus, don't
return S_OK; // change the current selection
// display status
CTxtSelection * psel = GetSel();
if(psel)
psel->ShowSelection(!fHideSelection);
if (!_fInPlaceActive)
{
TxInvalidateRect(NULL, FALSE); // Since _fInPlaceActive = FALSE,
TxUpdateWindow(); // this only tells user.exe to
} // send a WM_PAINT message
return S_OK;
}
/*
* CTxtEdit::OnSaveSelection (fPropertyFlag)
*
* @mfunc
* Notify text services that save-selection property changed
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnSaveSelection(
BOOL fPropertyFlag) //@parm TRUE = save selection when inactive
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnSaveSelection");
return S_OK;
}
/*
* CTxtEdit::OnAutoWordSel (fPropertyFlag)
*
* @mfunc
* Notify text services that auto-word-selection property changed
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnAutoWordSel(
BOOL fPropertyFlag) //@parm TRUE = auto word selection on
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnAutoWordSel");
// We call back to the host when we need to know, so we don't bother doing
// anything in response to this notification.
return S_OK;
}
/*
* CTxtEdit::OnTxVerticalChange (fVertical)
*
* @mfunc
* Notify text services that vertical property changed
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnTxVerticalChange(
BOOL fVertical) //@parm TRUE - text vertically oriented.
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnTxVerticalChange");
// We pretend like something actually happened.
GetCallMgr()->SetChangeEvent(CN_GENERIC);
return S_OK;
}
/*
* CTxtEdit::OnClientRectChange (fPropertyFlag)
*
* @mfunc
* Notify text services that client rectangle changed
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnClientRectChange(
BOOL fPropertyFlag) //@parm Ignored for this property
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnClientRectChange");
// It is unclear whether we need to actually do anything for this
// notification. Logically, the change of this property is followed
// closely by some kind of operation which will cause the display
// cache to be updated anyway. The old code is left here as an
// example of what might be done if it turns out we need to do
// anything. For now, we will simply return S_OK to this notification.
#if 0
if (_fInPlaceActive)
{
RECT rc;
if(_phost->TxGetClientRect(&rc) == NOERROR )
{
_pdp->OnClientRectChange(rc);
}
return S_OK;
}
return NeedViewUpdate(fPropertyFlag);
#endif // 0
// With a client rect change we do need to update the caret when
// we get redrawn even if the basic information did not change.
_pdp->SetUpdateCaret();
return S_OK;
}
/*
* CTxtEdit::OnCharFormatChange (fPropertyFlag)
*
* @mfunc
* Update default CCharFormat
*
* @rdesc
* S_OK - update successfully processed.
*/
HRESULT CTxtEdit::OnCharFormatChange(
BOOL fPropertyFlag ) //@parm Not used
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnCharFormatChange");
CCharFormat CF;
HRESULT hr = TxGetDefaultCharFormat(&CF);
if(hr == NOERROR)
{
// OnSetCharFormat handles updating the view.
hr = OnSetCharFormat(0, &CF, NULL) ? NOERROR : E_FAIL;
}
return hr;
}
/*
* CTxtEdit::OnParaFormatChange (fPropertyFlag)
*
* @mfunc
* Update default CParaFormat
*
* @rdesc
* S_OK - update successfully processed
*
* @devnote
* Because Forms^3 doesn't set cbSize correctly, we limit this API
* to PARAFORMAT (until they fix it).
*/
HRESULT CTxtEdit::OnParaFormatChange(
BOOL fPropertyFlag ) //@parm Not used
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnParaFormatChange");
CParaFormat PF;
HRESULT hr = TxGetDefaultParaFormat(&PF);
if( hr == NOERROR )
{
// OnSetParaFormat handles updating the view.
hr = OnSetParaFormat(SPF_SETDEFAULT, &PF, NULL)
? NOERROR : E_FAIL;
}
return hr;
}
/*
* CTxtEdit::NeedViewUpdate (fPropertyFlag)
*
* @mfunc
* Notify text services that view of data changed
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::NeedViewUpdate(
BOOL fPropertyFlag )
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::NeedViewUpdate");
_pdp->UpdateView();
return S_OK;
}
/*
* CTxtEdit::OnTxBackStyleChange (fPropertyFlag)
*
* @mfunc
* Notify text services that background style changed
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnTxBackStyleChange(
BOOL fPropertyFlag ) //@parm Ignored for this property
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnTxBackStyleChange");
_fTransparent = (TxGetBackStyle() == TXTBACK_TRANSPARENT);
TxInvalidateRect(NULL, FALSE);
return S_OK;
}
/*
* CTxtEdit::OnAllowBeep (fPropertyFlag)
*
* @mfunc
* Notify text services that beep property changed
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnAllowBeep(
BOOL fPropertyFlag) //@parm New state of property
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnAllowBeep");
_fAllowBeep = fPropertyFlag;
return S_OK;
}
/*
* CTxtEdit::OnMaxLengthChange (fPropertyFlag)
*
* @mfunc
* Notify text services that max-length property changed
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnMaxLengthChange(
BOOL fPropertyFlag) //@parm New state of property
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnMaxLengthChange");
// Query host for max text length
DWORD length = INFINITE;
_phost->TxGetMaxLength(&length);
_cchTextMost = length;
return S_OK;
}
/*
* CTxtEdit::OnWordWrapChange (fPropertyFlag)
*
* @mfunc
* Notify text services that word-wrap property changed
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnWordWrapChange(
BOOL fPropertyFlag) //@parm TRUE = do word wrap
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnWordWrapChange");
_pdp->SetWordWrap(fPropertyFlag);
// Update was successful so we need the screen updated at some point
_pdp->UpdateView();
return S_OK;
}
/*
* CTxtEdit::OnDisableDrag (fPropertyFlag)
*
* @mfunc
* Notify text services that disable drag property changed
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnDisableDrag(
BOOL fPropertyFlag) //@parm New state of property
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnDisableDrag");
_fDisableDrag = fPropertyFlag;
return S_OK;
}
/*
* CTxtEdit::OnScrollChange (fPropertyFlag)
*
* @mfunc
* Notify text services scroll property change
*
* @rdesc
* S_OK - Notification successfully processed.
*/
HRESULT CTxtEdit::OnScrollChange(
BOOL fPropertyFlag) //@parm New state of property
{
TRACEBEGIN(TRCSUBSYSTS, TRCSCOPEINTERN, "CTxtEdit::OnScrollChange");
// Tell the display that scroll bars for sure need to be updated
_pdp->SetViewChanged();
// Tell the display to update itself.
_pdp->UpdateView();
return S_OK;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -