Exemplo n.º 1
0
void TexView::MessageReceived(BMessage* msg)
{	
	switch(msg->what)
	{		
		case InterfaceConstants::K_UNDO_HIGHLIGHTING:
		{
			int32 start,finish;
			if(msg->FindInt32("start",&start)==B_OK
			&& msg->FindInt32("finish",&finish)==B_OK
			)
			{			
				Select(start,finish);
			}
		}
		break;		
		case InterfaceConstants::K_PARSE_LINE:
		{
			int32 start,finish;
			if(msg->FindInt32("start",&start)==B_OK
			&& msg->FindInt32("finish",&finish)==B_OK
			)
			{	
				int32 sel_start,sel_finish;
				GetSelection(&sel_start,&sel_finish);
				ParseAll(min(sel_start,start),max(sel_finish,finish),true);
			}	
		}
		break;
		case InterfaceConstants::K_ANALYSE_TEXVIEW:
		{		
			int32 start,finish;
			if(msg->FindInt32("start",&start)==B_OK
			&& msg->FindInt32("finish",&finish)==B_OK)
			{			
				ParseAll(start,finish,true);
			}
			
			int32 offset,length;
			if(msg->FindInt32("offset",&offset)==B_OK
			&& msg->FindInt32("length",&length)==B_OK)
			{
				GetSelection(&start,&finish);
				ParseAll(offset,finish,true);			
			}
		}
		break;		
		case B_CUT:
		case B_COPY:
		case B_PASTE:
		{
			BMessage msg(InterfaceConstants::K_UPDATE_CLIPBOARD_MENU_STATUS);
			Window()->PostMessage(&msg,this);
		}
		default:
			BTextView::MessageReceived(msg);
		break;	
	}
}
void CFunctionCollection::SetEmptyDefaultBot() {
  CSLock lock(m_critsec);
  DeleteAll(false, true);
  _title = "NoName";
  // Adding empty standard-functions
  // http://www.maxinmontreal.com/forums/viewtopic.php?f=156&t=16230
  CheckForDefaultFormulaEntries();
  // After setting the bot we should parse it so that OH can evaluate and act
  ParseAll();
  // Parser, function-collection and library initialized 
  // and a ParseAll to come:
  // this is the perfect place to execute the selftest. 
  ExecuteSelftest();
}
Exemplo n.º 3
0
void TexView::SetText(BFile* file,int32 offset,int32 length,const text_run_array* runs = NULL)
{
	BTextView::SetText(file,offset,length,runs);
	ParseAll(offset,length-1,false);
}
Exemplo n.º 4
0
void TexView::UpdateFontSize()
{
	f.SetSize(prefs->FontSize);
	SetFontAndColor(0,TextLength(),&f,B_FONT_ALL,&prefs->fg_color);
	ParseAll(0,TextLength()-1,true);	
}
Exemplo n.º 5
0
void TexView::UpdateColors()
{
	SetFontAndColor(0,TextLength(),&f,B_FONT_ALL,&prefs->fg_color);
	ParseAll(0,TextLength()-1,true);	
}
Exemplo n.º 6
0
void TexView::SetText(const char* text,int32 length,const text_run_array* runs = NULL)
{
	BTextView::SetText(text,length,runs);
	ParseAll(0,length-1,false);
}