Commit ac6ddbc9 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Add support for TXTBIT_ALLOWBEEP.

parent 7f7fdd6c
......@@ -279,6 +279,11 @@ ME_Paragraph *editor_end_para( ME_TextEditor *editor )
return &editor->pBuffer->pLast->member.para;
}
static BOOL editor_beep( ME_TextEditor *editor, UINT type )
{
return editor->props & TXTBIT_ALLOWBEEP && MessageBeep( type );
}
static LRESULT ME_StreamInText(ME_TextEditor *editor, DWORD dwFormat, ME_InStream *stream, ME_Style *style)
{
WCHAR *pText;
......@@ -2281,7 +2286,7 @@ static BOOL paste_special(ME_TextEditor *editor, UINT cf, REPASTESPECIAL *ps, BO
/* Protect read-only edit control from modification */
if (editor->props & TXTBIT_READONLY)
{
if (!check_only) MessageBeep(MB_ICONERROR);
if (!check_only) editor_beep( editor, MB_ICONERROR );
return FALSE;
}
......@@ -2379,7 +2384,7 @@ static BOOL copy_or_cut( ME_TextEditor *editor, BOOL cut )
count -= offs;
hr = editor_copy_or_cut( editor, cut, sel_start, count, NULL );
if (FAILED( hr )) MessageBeep( MB_ICONERROR );
if (FAILED( hr )) editor_beep( editor, MB_ICONERROR );
return SUCCEEDED( hr );
}
......@@ -2422,7 +2427,7 @@ static BOOL handle_enter(ME_TextEditor *editor)
if (editor->props & TXTBIT_READONLY)
{
MessageBeep(MB_ICONERROR);
editor_beep( editor, MB_ICONERROR );
return TRUE;
}
......@@ -2683,7 +2688,7 @@ static LRESULT handle_wm_char( ME_TextEditor *editor, WCHAR wstr, LPARAM flags )
if (editor->props & TXTBIT_READONLY)
{
MessageBeep(MB_ICONERROR);
editor_beep( editor, MB_ICONERROR );
return 0; /* FIXME really 0 ? */
}
......@@ -2737,7 +2742,7 @@ static LRESULT handle_wm_char( ME_TextEditor *editor, WCHAR wstr, LPARAM flags )
if (para_in_table( para ) && cursor.run->nFlags & MERF_ENDPARA && from == to)
{
/* Text should not be inserted at the end of the table. */
MessageBeep(-1);
editor_beep( editor, -1 );
return 0;
}
}
......@@ -2951,7 +2956,8 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
ed->total_rows = 0;
ITextHost_TxGetPropertyBits( ed->texthost, TXTBIT_RICHTEXT | TXTBIT_MULTILINE | TXTBIT_READONLY |
TXTBIT_USEPASSWORD | TXTBIT_HIDESELECTION | TXTBIT_SAVESELECTION |
TXTBIT_AUTOWORDSEL | TXTBIT_VERTICAL | TXTBIT_WORDWRAP | TXTBIT_DISABLEDRAG,
TXTBIT_AUTOWORDSEL | TXTBIT_VERTICAL | TXTBIT_WORDWRAP | TXTBIT_ALLOWBEEP |
TXTBIT_DISABLEDRAG,
&ed->props );
ITextHost_TxGetScrollBars( ed->texthost, &ed->scrollbars );
ed->pBuffer = ME_MakeText();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment