do not block program-invoked edits when read-only
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10381 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -808,6 +808,7 @@ BTextView::MakeFocus(bool focusState)
|
|||||||
void
|
void
|
||||||
BTextView::MessageReceived(BMessage *message)
|
BTextView::MessageReceived(BMessage *message)
|
||||||
{
|
{
|
||||||
|
// TODO: block input if not editable (Andrew)
|
||||||
CALLED();
|
CALLED();
|
||||||
// was this message dropped?
|
// was this message dropped?
|
||||||
if (message->WasDropped()) {
|
if (message->WasDropped()) {
|
||||||
@@ -999,8 +1000,6 @@ void
|
|||||||
BTextView::SetText(const char *inText, const text_run_array *inRuns)
|
BTextView::SetText(const char *inText, const text_run_array *inRuns)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
if (!fEditable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
CancelInputMethod();
|
CancelInputMethod();
|
||||||
|
|
||||||
@@ -1041,9 +1040,6 @@ BTextView::SetText(const char *inText, int32 inLength, const text_run_array *inR
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
if (!fEditable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
CancelInputMethod();
|
CancelInputMethod();
|
||||||
|
|
||||||
// hide the caret/unhilite the selection
|
// hide the caret/unhilite the selection
|
||||||
@@ -1082,9 +1078,6 @@ BTextView::SetText(BFile *inFile, int32 inOffset, int32 inLength,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
if (!fEditable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
CancelInputMethod();
|
CancelInputMethod();
|
||||||
|
|
||||||
if (!inFile)
|
if (!inFile)
|
||||||
@@ -1149,7 +1142,7 @@ BTextView::Insert(int32 startOffset, const char *inText, int32 inLength,
|
|||||||
CancelInputMethod();
|
CancelInputMethod();
|
||||||
|
|
||||||
// do we really need to do anything?
|
// do we really need to do anything?
|
||||||
if (!fEditable || inLength < 1)
|
if (inLength < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// hide the caret/unhilite the selection
|
// hide the caret/unhilite the selection
|
||||||
@@ -1206,9 +1199,6 @@ void
|
|||||||
BTextView::Delete(int32 startOffset, int32 endOffset)
|
BTextView::Delete(int32 startOffset, int32 endOffset)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
if (!fEditable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// anything to delete?
|
// anything to delete?
|
||||||
if (startOffset == endOffset)
|
if (startOffset == endOffset)
|
||||||
return;
|
return;
|
||||||
@@ -1328,9 +1318,6 @@ void
|
|||||||
BTextView::Cut(BClipboard *clipboard)
|
BTextView::Cut(BClipboard *clipboard)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
if (!fEditable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
CancelInputMethod();
|
CancelInputMethod();
|
||||||
if (fUndo) {
|
if (fUndo) {
|
||||||
delete fUndo;
|
delete fUndo;
|
||||||
@@ -1383,9 +1370,6 @@ BTextView::Paste(BClipboard *clipboard)
|
|||||||
CALLED();
|
CALLED();
|
||||||
CancelInputMethod();
|
CancelInputMethod();
|
||||||
|
|
||||||
if (!fEditable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
BMessage *clip = NULL;
|
BMessage *clip = NULL;
|
||||||
|
|
||||||
if (clipboard->Lock()) {
|
if (clipboard->Lock()) {
|
||||||
@@ -1426,8 +1410,6 @@ void
|
|||||||
BTextView::Clear()
|
BTextView::Clear()
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
if (!fEditable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
delete fUndo;
|
delete fUndo;
|
||||||
fUndo = new _BClearUndoBuffer_(this);
|
fUndo = new _BClearUndoBuffer_(this);
|
||||||
@@ -1573,10 +1555,6 @@ BTextView::SetFontAndColor(const BFont *inFont, uint32 inMode,
|
|||||||
const rgb_color *inColor)
|
const rgb_color *inColor)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
if (!fEditable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
CancelInputMethod();
|
CancelInputMethod();
|
||||||
|
|
||||||
BFont newFont = *inFont;
|
BFont newFont = *inFont;
|
||||||
@@ -1602,9 +1580,6 @@ BTextView::SetFontAndColor(int32 startOffset, int32 endOffset,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
if (!fEditable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
BFont newFont = *inFont;
|
BFont newFont = *inFont;
|
||||||
NormalizeFont(&newFont);
|
NormalizeFont(&newFont);
|
||||||
|
|
||||||
@@ -1647,9 +1622,6 @@ BTextView::SetRunArray(int32 startOffset, int32 endOffset,
|
|||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
if (!fEditable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
CancelInputMethod();
|
CancelInputMethod();
|
||||||
|
|
||||||
// pin offsets at reasonable values
|
// pin offsets at reasonable values
|
||||||
@@ -2749,7 +2721,8 @@ BTextView::InsertText(const char *inText, int32 inLength, int32 inOffset,
|
|||||||
const text_run_array *inRuns)
|
const text_run_array *inRuns)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
if (!fEditable || inLength < 1)
|
// why add nothing?
|
||||||
|
if (inLength < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: Pin offset/lenght
|
// TODO: Pin offset/lenght
|
||||||
@@ -2777,10 +2750,6 @@ void
|
|||||||
BTextView::DeleteText(int32 fromOffset, int32 toOffset)
|
BTextView::DeleteText(int32 fromOffset, int32 toOffset)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
if (!fEditable)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// sanity checking
|
// sanity checking
|
||||||
if (fromOffset >= toOffset || fromOffset < 0 || toOffset < 0)
|
if (fromOffset >= toOffset || fromOffset < 0 || toOffset < 0)
|
||||||
return;
|
return;
|
||||||
@@ -3206,6 +3175,7 @@ BTextView::HandlePageKey(uint32 inPageKey)
|
|||||||
void
|
void
|
||||||
BTextView::HandleAlphaKey(const char *bytes, int32 numBytes)
|
BTextView::HandleAlphaKey(const char *bytes, int32 numBytes)
|
||||||
{
|
{
|
||||||
|
// TODO: block input if not editable (Andrew)
|
||||||
if (fUndo) {
|
if (fUndo) {
|
||||||
_BTypingUndoBuffer_ *undoBuffer = dynamic_cast<_BTypingUndoBuffer_ *>(fUndo);
|
_BTypingUndoBuffer_ *undoBuffer = dynamic_cast<_BTypingUndoBuffer_ *>(fUndo);
|
||||||
if (!undoBuffer) {
|
if (!undoBuffer) {
|
||||||
@@ -4386,6 +4356,7 @@ BTextView::CountProperties(BMessage *specifier, int32 form,
|
|||||||
void
|
void
|
||||||
BTextView::HandleInputMethodChanged(BMessage *message)
|
BTextView::HandleInputMethodChanged(BMessage *message)
|
||||||
{
|
{
|
||||||
|
// TODO: block input if not editable (Andrew)
|
||||||
if (!fInline)
|
if (!fInline)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user