Ejemplo n.º 1
0
int statusbar_create(video_canvas_t *canvas)
{
  int i;

  canvas->os->font = OpenDiskFont((struct TextAttr *)&led_font_attr);
  if (canvas->os->font) {
    SetFont(canvas->os->window->RPort, canvas->os->font);
  }
  /* else we use system default font */

  for (i=0; i<b_num; i++) {
#ifndef AMIGAOS4
    canvas->os->pens[i] = ObtainBestPen(canvas->os->window->WScreen->ViewPort.ColorMap, palette[i].red * 0x01010101, palette[i].green * 0x01010101, palette[i].blue * 0x01010101, TAG_DONE);
#else
    canvas->os->pens[i] = ObtainBestPen(canvas->os->window->WScreen->ViewPort.ColorMap, palette[i].red * 0x01010101, palette[i].green * 0x01010101, palette[i].blue * 0x01010101);
#endif
  }

  #define MAXSTR "00: 00.0"
  canvas->os->disk_width = TextLength(canvas->os->window->RPort, MAXSTR, strlen(MAXSTR)) + 14 + 7;
  #undef MAXSTR

  #define MAXSTR "000"
  canvas->os->tape_width = TextLength(canvas->os->window->RPort, MAXSTR, strlen(MAXSTR)) + 28 + 7 ;
  #undef MAXSTR

  canvas->os->has_statusbar = 1;

  statusbar_refresh(REFRESH_ALL);

  return 0;
}
Ejemplo n.º 2
0
status_t
FindTextView::SetMode(find_mode mode)
{
	if (fMode == mode)
		return B_OK;

	if (mode == kHexMode) {
		// convert text to hex mode

		char* hex;
		size_t hexSize;
		if (_GetHexFromData((const uint8*)Text(), TextLength(), &hex, &hexSize)
				< B_OK)
			return B_NO_MEMORY;

		fMode = mode;

		SetText(hex, hexSize);
		free(hex);
	} else {
		// convert hex to ascii

		uint8* data;
		size_t dataSize;
		if (_GetDataFromHex(Text(), TextLength(), &data, &dataSize) < B_OK)
			return B_NO_MEMORY;

		fMode = mode;

		SetText((const char*)data, dataSize);
		free(data);
	}

	return B_OK;
}
Ejemplo n.º 3
0
void
TSigTextView::KeyDown(const char *key, int32 count)
{
	bool	up = false;
	int32	height;
	BRect	r;

	switch (key[0]) {
		case B_HOME:
			Select(0, 0);
			ScrollToSelection();
			break;

		case B_END:
			Select(TextLength(), TextLength());
			ScrollToSelection();
			break;

		case B_PAGE_UP:
			up = true;
		case B_PAGE_DOWN:
			r = Bounds();
			height = (int32)((up ? r.top - r.bottom : r.bottom - r.top) - 25);
			if ((up) && (!r.top))
				break;
			ScrollBy(0, height);
			break;

		default:
			BTextView::KeyDown(key, count);
	}
}
Ejemplo n.º 4
0
void
HyperTextView::InsertHyperText(const char* inText, int32 inLength,
	HyperTextAction* action, const text_run_array* inRuns)
{
	int32 startOffset = TextLength();
	Insert(inText, inLength, inRuns);
	int32 endOffset = TextLength();

	AddHyperTextAction(startOffset, endOffset, action);
}
Ejemplo n.º 5
0
void TexView::GoToLine(int32 index)
{
	if(index < 0 || index > CountLines() || TextLength() <= 0)
		return;
		
	vector<int> eols;
	vector<int> sols;
	
	FillSolEol(sols,eols,0,TextLength()-1);
	Select(sols[index],eols[index]);
}
Ejemplo n.º 6
0
// ---------------------------------------------------------------------------------- RHTML_text_view - Draw -
void RHTMLtextview::Draw(BRect inRect)
{
	BTextView::Draw(inRect);
	if (fTarget->fNumView->Frame().top != fScrollView->ScrollBar(B_VERTICAL)->Value())
	fTarget->fNumView->MoveTo(BPoint(0, 0 - fScrollView->ScrollBar(B_VERTICAL)->Value()));

	if (fTarget->IsEnabled())
		fTarget->fNumView->UpdateNum();
	if (PointAt(TextLength() - 1).y + 50 > fTarget->fNumView->Bounds().bottom)
		fTarget->fNumView->ResizeTo(fTarget->fNumView->Bounds().right, PointAt(TextLength() - 1).y + 50);
}
Ejemplo n.º 7
0
static VOID DrawText(struct RastPort *rport, WORD x, WORD y, STRPTR text, char hotkey, UWORD textcolor, BOOL parse)
{
  ULONG length = strlen(text);
  y += rport->TxBaseline;

  SetAPen(rport, textcolor);
  Move(rport, x, y);

  if(hotkey)
  {
    if(parse)
    {
      char *textpnt = text;
      UWORD delta = 0;
      while(*textpnt != '\0')
      {
        if(*textpnt == '_')
        {
          Text(rport, text, delta);
          x += TextLength(rport, text, delta);
          text = textpnt+1;
          RectFill(rport, x, y+2, x+TextLength(rport, text, 1)-2, y+2);
          Move(rport, x, y);
          break;
        }
        delta++;
        textpnt++;
      }
      Text(rport, text, strlen(text));
    }
    else
    {
      ULONG i=0;
      Text(rport, text, length);

      for(i=0; i != length; i++)
      {
        if(hotkey == ToLower(text[i]))
        {
          ULONG width = TextLength(rport, text, i);
          RectFill(rport, x+width, y+2, x+width+TextLength(rport, &text[i], 1)-2, y+2);
          break;
        }

      }
    }
  }
  else
  {
    Text(rport, text, length);
  }
}
Ejemplo n.º 8
0
void
FindTextView::GetData(BMessage& message)
{
	if (fMode == kHexMode) {
		// convert hex-text to real data
		uint8* data;
		size_t dataSize;
		if (_GetDataFromHex(Text(), TextLength(), &data, &dataSize) != B_OK)
			return;

		message.AddData("data", B_RAW_TYPE, data, dataSize);
		free(data);
	} else
		message.AddData("data", B_RAW_TYPE, Text(), TextLength());
}
Ejemplo n.º 9
0
void TexView::ParseAll(int start,int finish,bool IsInteractive)
{
	BFont font(be_fixed_font);
	font.SetSize(prefs->FontSize);
	
	int text_length = TextLength();
	if(text_length > 0)
	{
		vector<int> eols;
		vector<int> sols;
		FillSolEol(sols,eols,start,finish);
		
		int i;
		int size;
		
		if(!IsInteractive)
		{
			size = text_length;
			vector<rgb_color> colorVec(size,prefs->fg_color);

			for(i=0;i<sols.size();i++)
			{
				ParseLine(sols[i],eols[i],colorVec);		
			}
			
			int offset_size=1;
			vector<int> offsets;
			offsets.push_back(0);
			
			for(i=1;i<size;i++)
			{
				if(colorVec[i-1] != colorVec[i])
				{
					offsets.push_back(i);	
					offset_size++;
				}
			}
			text_run_array* tra = (text_run_array*)malloc(sizeof(text_run_array)*(size));
			tra->count = offset_size;
			for(i=0;i<offset_size;i++)
			{
				tra->runs[i].color=colorVec[offsets[i]];
				tra->runs[i].font=font;
				tra->runs[i].offset=offsets[i];
			}
			SetRunArray(0,text_length-1,tra);
		}		
		else
		{
			int32 start,finish;
			GetSelection(&start,&finish);
			Select(start,start);
			for(i=0;i<sols.size();i++)
			{
				IParseLine(sols[i],eols[i]);		
			}
			Select(start,finish);
		}
	}
}
Ejemplo n.º 10
0
int32 TexView::CountLines()
{
	vector<int> eols;
	vector<int> sols;
	FillSolEol(sols,eols,0,TextLength()-1);	
	return eols.size();
}
// ---------------------------------------------------------
// CMsgBodyControlEditor::DoHandleParsingCompleteL
// ---------------------------------------------------------
//
void CMsgBodyControlEditor::DoHandleParsingCompleteL()
    {
    iTextParsed = ETrue;
    // this needs to be changed so that bottom init can also be set
    if ( iFocusChangedBeforeParseFinish )
        {
        iFocusChangedBeforeParseFinish = EFalse; // just to make sure this is done only once
        if ( iInitTop )
            {
            SetHighlightL( 0, EMsgFocusDown, ETrue ); 
            }
        else
            {
            SetHighlightL( TextLength(), EMsgFocusUp, ETrue ); 
            }
        
        if ( iBaseControlObserver )
            {
            iBaseControlObserver->HandleBaseControlEventRequestL( NULL, 
                                                                  EMsgUpdateScrollbar );
            }
        }
    else
        {
        // In some cases the text view is left to some
        // strange state. Make sure the view is in sync
        // with cursor position.
        SetCursorPosL( CursorPos(), EFalse );
        }
    }
Ejemplo n.º 12
0
static Bool
ExceededMaxLines(Widget w)
{
    XawTextPosition end_of_last_line;
    Bool retval = False;

    if (app_resources.saveLines > 0)
    {
    /*
     * XawTextSourceScan() will return the end of the widget if it cannot
     * find what it is searching for.
     */
	end_of_last_line = XawTextSourceScan (XawTextGetSource (w),
					      (XawTextPosition) 0,
					      XawstEOL, XawsdRight,
					      app_resources.saveLines, TRUE);
	if (TextLength(w) > end_of_last_line)
	    retval = True;
	else
	    retval = False;
    }
    else
	retval = False;
    return retval;
}
Ejemplo n.º 13
0
/**************************************************************************
 MUIM_Draw
**************************************************************************/
IPTR Numericbutton__MUIM_Draw(struct IClass *cl, Object *obj, struct MUIP_Draw *msg)
{
    IPTR  val;
    char *buf;
    int   width;

    DoSuperMethodA(cl,obj,(Msg)msg);

    if (!(msg->flags & (MADF_DRAWOBJECT | MADF_DRAWUPDATE)))
        return FALSE;

    DoMethod(obj,MUIM_DrawBackground,_mleft(obj),_mtop(obj),_mwidth(obj),_mheight(obj),
             _mleft(obj),_mtop(obj),0);

    SetFont(_rp(obj),_font(obj));
    SetABPenDrMd(_rp(obj),_pens(obj)[MPEN_TEXT],_pens(obj)[MPEN_BACKGROUND],JAM1);

    get(obj, MUIA_Numeric_Value, &val);
    buf = (char*)DoMethod(obj,MUIM_Numeric_Stringify,val);
    width = TextLength(_rp(obj),buf,strlen(buf));

    Move(_rp(obj), _mleft(obj) + (_mwidth(obj) - width) / 2,
         _mtop(obj) + _font(obj)->tf_Baseline);

    Text(_rp(obj), buf, strlen(buf));

    return TRUE;
}
Ejemplo n.º 14
0
// Make a text string from the internal data structures.
// The input page_res is deleted.
char* TessBaseAPI::TesseractToText(PAGE_RES* page_res) {
  if (page_res != NULL) {
    int total_length = TextLength(page_res);
    PAGE_RES_IT   page_res_it(page_res);
    char* result = new char[total_length];
    char* ptr = result;
    for (page_res_it.restart_page(); page_res_it.word () != NULL;
         page_res_it.forward()) {
      WERD_RES *word = page_res_it.word();
      WERD_CHOICE* choice = word->best_choice;
      if (choice != NULL) {
        strcpy(ptr, choice->string().string());
        ptr += strlen(ptr);
        if (word->word->flag(W_EOL))
          *ptr++ = '\n';
        else
          *ptr++ = ' ';
      }
    }
    *ptr++ = '\n';
    *ptr = '\0';
    delete page_res;
    return result;
  }
  return NULL;
}
Ejemplo n.º 15
0
static void
NewCurrentClipContents(char *data, int len)
{
    XawTextBlock textBlock;

    SaveClip (text, currentClip);

    /* append new clips at the end */
    while (currentClip && currentClip->next)
	currentClip = currentClip->next;
    /* any trailing clips with no text get overwritten */
    if (strlen (currentClip->clip) != 0)
	currentClip = NewClip (text, currentClip);
    
    textBlock.ptr = data;
    textBlock.firstPos = 0;
    textBlock.length = len;
    textBlock.format = FMT8BIT;
    if (XawTextReplace(text, 0, TextLength (text), &textBlock)) {
#ifdef XKB
	XkbStdBell(XtDisplay(text), XtWindow(text), 0, XkbBI_Info);
#else
	XBell( XtDisplay(text), 0);
#endif
    }
    set_button_state ();
}
Ejemplo n.º 16
0
static void
TextAppend(Widget w, char *s, int len)
{
    long	    last, current;
    XawTextBlock    block;

    current = XawTextGetInsertionPoint (w);
    last = TextLength (w);
    block.ptr = s;
    block.firstPos = 0;
    block.length = len;
    block.format = FMT8BIT;
    /*
     * If saveLines is 1, just replace the entire contents of the widget
     * each time, so the test in ExceededMaxLines() isn't fooled.
     */
    if (app_resources.saveLines == 1)
	TextReplace (w, 0, last, &block);
    else
	TextReplace (w, last, last, &block);
    if (current == last)
	XawTextSetInsertionPoint (w, last + block.length);
    if (ExceededMaxLines(w))
	ScrollLine(w);
}
Ejemplo n.º 17
0
STATIC UWORD GetTextLeft(struct Gadget      *gad,
                         struct BBox        *bbox,
                         struct RastPort    *rp,
                         struct IntuitionBase   *IntuitionBase)
{
    /* Gets left position of text in the string gadget */

    struct StringInfo   *strinfo = (struct StringInfo *)gad->SpecialInfo;
    UWORD           	 text_left = 0;
    STRPTR          	 dispstr = &(strinfo->Buffer[strinfo->DispPos]);
    UWORD           	 dispstrlen;
    BOOL            	 cursor_at_end;

    cursor_at_end = (strinfo->BufferPos == strinfo->NumChars);

    dispstrlen = strinfo->NumChars - strinfo->DispPos;

    /* Calcluate start offset of gadget text */
    switch (gad->Activation & STRALIGNMASK)
    {
	case GACT_STRINGLEFT:
    	#warning FIXME: is this default: correct?
	default:
            text_left = bbox->Left;
            break;

	case GACT_STRINGCENTER:
            {
        	WORD textwidth = TextLength(rp, dispstr, dispstrlen);

        	if (cursor_at_end) textwidth += TextLength(rp, cursorkey, CURSORKEYLEN);
        	text_left = bbox->Left + ((bbox->Width - textwidth) / 2);
            }
            break;

	case GACT_STRINGRIGHT:
            {
        	WORD textwidth = TextLength(rp, dispstr, dispstrlen);

        	if (cursor_at_end) textwidth += TextLength(rp, cursorkey, CURSORKEYLEN);
        	text_left =  bbox->Left + (bbox->Width - 1 - textwidth);
            }
            break;
    }
    return (text_left);
}
Ejemplo n.º 18
0
// Return the message as raw text
char* HTMLView::GetRawTextMessage() {

	// Copy the text out of the buffer, and into string FullText
	message = (char*)malloc( TextLength() + 1 );
	strcpy( message, Text() );
	
	return message;
}
Ejemplo n.º 19
0
void
URLInputGroup::URLTextView::InsertText(const char* inText, int32 inLength,
	int32 inOffset, const text_run_array* inRuns)
{
	// Filter all line breaks, note that inText is not terminated.
	if (inLength == 1) {
		if (*inText == '\n' || *inText == '\r')
			BTextView::InsertText(" ", 1, inOffset, inRuns);
		else
			BTextView::InsertText(inText, 1, inOffset, inRuns);
	} else {
		BString filteredText(inText, inLength);
		filteredText.ReplaceAll('\n', ' ');
		filteredText.ReplaceAll('\r', ' ');
		BTextView::InsertText(filteredText.String(), inLength, inOffset,
			inRuns);
	}

	// Make the base URL part bold.
	BString text(Text(), TextLength());
	int32 baseUrlStart = text.FindFirst("://");
	if (baseUrlStart >= 0)
		baseUrlStart += 3;
	else
		baseUrlStart = 0;
	int32 baseUrlEnd = text.FindFirst("/", baseUrlStart);
	if (baseUrlEnd < 0)
		baseUrlEnd = TextLength();

	BFont font;
	GetFont(&font);
	const rgb_color black = (rgb_color) { 0, 0, 0, 255 };
	const rgb_color gray = (rgb_color) { 60, 60, 60, 255 };
	if (baseUrlStart > 0)
		SetFontAndColor(0, baseUrlStart, &font, B_FONT_ALL, &gray);
	if (baseUrlEnd > baseUrlStart) {
		font.SetFace(B_BOLD_FACE);
		SetFontAndColor(baseUrlStart, baseUrlEnd, &font, B_FONT_ALL, &black);
	}
	if (baseUrlEnd < TextLength()) {
		font.SetFace(B_REGULAR_FACE);
		SetFontAndColor(baseUrlEnd, TextLength(), &font, B_FONT_ALL, &gray);
	}

	fURLAutoCompleter->TextModified(fUpdateAutoCompleterChoices);
}
Ejemplo n.º 20
0
int char_len (int c)
{
  unsigned char buffer;

  if (c < 0)
    c += 256;
  buffer = (unsigned char) c;
  return TextLength (RastPort, &buffer, 1);
}
Ejemplo n.º 21
0
void
FindTextView::_HexReformat(int32 oldCursor, int32& newCursor)
{
	const char* text = Text();
	int32 textLength = TextLength();
	char* insert = (char*)malloc(textLength * 2);
	if (insert == NULL)
		return;

	newCursor = TextLength();
	int32 out = 0;
	for (int32 i = 0; i < textLength; i++) {
		if (i == oldCursor) {
			// this is the end of the inserted text
			newCursor = out;
		}

		char c = text[i];
		if (c >= 'A' && c <= 'F')
			c += 'a' - 'A';
		if ((c >= 'a' && c <= 'f') || (c >= '0' && c <= '9'))
			insert[out++] = c;

		if ((out % 48) == 47)
			insert[out++] = '\n';
		else if ((out % 3) == 2)
			insert[out++] = ' ';
	}
	insert[out] = '\0';

	DeleteText(0, textLength);

	// InsertText() does not work here, as we need the text
	// to be reformatted as well (newlines, breaks, whatever).
	// IOW the BTextView class is not very nicely done.
	//	BTextView::InsertText(insert, out, 0, NULL);
	fMode = kAsciiMode;
	Insert(0, insert, out);
	fMode = kHexMode;

	free(insert);
}
Ejemplo n.º 22
0
/*** Measure the maximal lenght of a NULL-terminated array of string: ***/
WORD meas_table(UBYTE **strings)
{
	extern struct RastPort RPT;
	register UBYTE **p;
	register WORD  maxlen,len;

	for(p=strings, maxlen=0; *p; p++)
		if(maxlen < (len=TextLength(&RPT,*p,strlen(*p)))) maxlen = len;

	return maxlen;
}
NS_IMETHODIMP
CompositionTransaction::DoTransaction() {
  if (NS_WARN_IF(!mEditorBase)) {
    return NS_ERROR_NOT_INITIALIZED;
  }

  // Fail before making any changes if there's no selection controller
  nsCOMPtr<nsISelectionController> selCon;
  mEditorBase->GetSelectionController(getter_AddRefs(selCon));
  NS_ENSURE_TRUE(selCon, NS_ERROR_NOT_INITIALIZED);

  // Advance caret: This requires the presentation shell to get the selection.
  if (mReplaceLength == 0) {
    ErrorResult rv;
    mTextNode->InsertData(mOffset, mStringToInsert, rv);
    if (NS_WARN_IF(rv.Failed())) {
      return rv.StealNSResult();
    }
    mEditorBase->RangeUpdaterRef().SelAdjInsertText(*mTextNode, mOffset,
                                                    mStringToInsert);
  } else {
    uint32_t replaceableLength = mTextNode->TextLength() - mOffset;
    ErrorResult rv;
    mTextNode->ReplaceData(mOffset, mReplaceLength, mStringToInsert, rv);
    if (NS_WARN_IF(rv.Failed())) {
      return rv.StealNSResult();
    }
    mEditorBase->RangeUpdaterRef().SelAdjDeleteText(mTextNode, mOffset,
                                                    mReplaceLength);
    mEditorBase->RangeUpdaterRef().SelAdjInsertText(*mTextNode, mOffset,
                                                    mStringToInsert);

    // If IME text node is multiple node, ReplaceData doesn't remove all IME
    // text.  So we need remove remained text into other text node.
    if (replaceableLength < mReplaceLength) {
      int32_t remainLength = mReplaceLength - replaceableLength;
      nsCOMPtr<nsINode> node = mTextNode->GetNextSibling();
      while (node && node->IsText() && remainLength > 0) {
        Text* text = static_cast<Text*>(node.get());
        uint32_t textLength = text->TextLength();
        text->DeleteData(0, remainLength, IgnoreErrors());
        mEditorBase->RangeUpdaterRef().SelAdjDeleteText(text, 0, remainLength);
        remainLength -= textLength;
        node = node->GetNextSibling();
      }
    }
  }

  nsresult rv = SetSelectionForRanges();
  NS_ENSURE_SUCCESS(rv, rv);

  return NS_OK;
}
Ejemplo n.º 24
0
// ---------------------------------------------------------------------------------- RHTML_text_view - Undo -
void RHTMLtextview::Undo(BClipboard *clipboard)
{
	fTarget->SetModify(true);
	BString *oldtext=new BString(Text());
	BString *newtext = 0;
	BTextView::Undo(clipboard);
	int32 c, d;
	GetSelection(&c, &d);
	fFileTypes->SetFontAndColor(oldtext, newtext = new BString(Text()), 0, c, d);

	if (fUpdateTimer->IsActive())
		fUpdateTimer->ResetTimer();
	else
		fUpdateTimer->StartTimer(fOptions->ReakcioIdo);

	if (PointAt(TextLength() - 1).y + 50>fTarget->fNumView->Bounds().bottom)
		fTarget->fNumView->ResizeTo(fTarget->fNumView->Bounds().right, PointAt(TextLength() - 1).y + 50);
		
	delete oldtext;
	delete newtext;
}
Ejemplo n.º 25
0
CString CListBox::Text(size_t nItem) const
{
	CString	strText;

	// Allocate space.
	strText.BufferSize(TextLength(nItem)+1);

//	ListBox_GetText(m_hWnd, nItem, strText.Buffer());
	SendMessage(LB_GETTEXT, nItem, reinterpret_cast<LPARAM>(strText.Buffer()));

	return strText;
}
Ejemplo n.º 26
0
int32 TexView::LineAt(int32 offset)
{
	vector<int> sols;
	vector<int> eols;
	FillSolEol(sols,eols,0,TextLength()-1);

	for(int i=0;i<sols.size();i++)
	{
		if(offset >= sols[i] && offset <= eols[i])
			return i;
	}
	return -1;
}
Ejemplo n.º 27
0
/*ARGSUSED*/
static void
Clear(Widget widget, XEvent *event, String *params, Cardinal *num_params)
{
    long	    last;
    XawTextBlock    block;

    last = TextLength (text);
    block.ptr = "";
    block.firstPos = 0;
    block.length = 0;
    block.format = FMT8BIT;
    TextReplace (text, 0, last, &block);
}
Ejemplo n.º 28
0
void
IPAddressControl::_UpdateMark()
{
	if (TextLength() == 0) {
		MarkAsInvalid(!fAllowEmpty);
		return;
	}

	BNetworkAddress address;
	bool success = address.SetTo(fFamily, Text()) == B_OK;

	MarkAsInvalid(!success);
}
Ejemplo n.º 29
0
void TexView::ShiftRight()
{
	int32 start,finish;
	GetSelection(&start,&finish);
	vector<int> sols;
	vector<int> eols;
	FillSolEol(sols,eols,0,TextLength()-1);
	int32 startline=-1;
	int32 endline=-1;
	
	for(int i=0;i<sols.size();i++)
	{

		if(start >= sols[i] && start <= eols[i])
			startline = i;
		if(finish > sols[i] && finish <= eols[i])
			endline = i;
		else if(finish >= sols[i] && finish <= eols[i])
		{	
			endline = i-1;
			if(start == sols[i])
				endline++;
		}
		if(startline >= 0 && endline >= 0)
			break;
	}
	
	if(startline < 0 || endline < 0)
		return;
	
	IsShifting = true;
	int selection_offset = 0;
	int tab_width=3;
	
	
	int sel_start,sel_finish;
	int offset_total=0;
	Select(sols[startline],sols[startline]);
	for(int i=startline;i<=endline;i++)
	{

		int sol = sols[i]+offset_total;
		int eol = eols[i]+offset_total;
		
		Insert(sol,"   ",tab_width);
		offset_total+=tab_width;
	
	}
	Select(sols[startline],eols[endline]+offset_total+1);
	IsShifting = false;
}
Ejemplo n.º 30
0
void
FindTextView::InsertText(const char* text, int32 length, int32 offset,
	const text_run_array* runs)
{
	if (fMode == kHexMode) {
		if (offset > TextLength())
			offset = TextLength();

		BTextView::InsertText(text, length, offset, runs);
			// lets add anything, and then start to filter out
			// (since we have to reformat the whole text)

		int32 start, end;
		GetSelection(&start, &end);

		int32 cursor;
		_HexReformat(offset, cursor);

		if (length == 1 && start == offset)
			Select(cursor + 1, cursor + 1);
	} else
		BTextView::InsertText(text, length, offset, runs);
}