Source Code (Use browser search to find items of interest.)

Class Index

klyx'InsetError (./klyx/src/inseterror.h:24)

class InsetError: public Inset {
public:
	///
	InsetError(LString const & string);
	///
	InsetError();
	///
	~InsetError();
	///
	int Ascent(LyXFont const &font) const;
	///
	int Descent(LyXFont const &font) const;
	///
	int Width(LyXFont const &font) const;
	///
	void Draw(LyXFont font, LyXScreen &scr, int baseline, float &x);
	///
	void Write(FILE *file);
	///
	void Read(LyXLex &lex);
	///
	int Latex(FILE *file, signed char fragile);
	///
	int Latex(LString &file, signed char fragile);
	///
	bool AutoDelete() const;
	/// what appears in the minibuffer when opening
	char const* EditMessage() {return i18n("Opened error");}
	///
	void Edit(int, int);
	///
	unsigned char Editable() const;
	///
	Inset* Clone();
	///
	Inset::Code LyxCode() const { return Inset::NO_CODE; }
	/// We don't want "begin" and "end inset" in lyx-file
	bool DirectWrite() const { return true; };
private:
	///
	LString contents;
};

klyx'InsetError::InsetError() (./klyx/src/inseterror.C:31)

InsetError::InsetError()
{
}


klyx'InsetError::InsetError() (./klyx/src/inseterror.C:35)

InsetError::InsetError(LString const & string)
  : contents(string)
{
}



klyx'InsetError::~InsetError() (./klyx/src/inseterror.C:41)

InsetError::~InsetError()
{
}



klyx'InsetError::Ascent() (./klyx/src/inseterror.C:46)

int InsetError::Ascent(LyXFont const &font) const
{
  LyXFont efont;
  efont.setSize(font.size()).decSize();
  return efont.maxAscent()+1;
}



klyx'InsetError::Descent() (./klyx/src/inseterror.C:54)

int InsetError::Descent(LyXFont const &font) const
{
  LyXFont efont;
  efont.setSize(font.size()).decSize();
  return efont.maxDescent()+1;
}



klyx'InsetError::Width() (./klyx/src/inseterror.C:62)

int InsetError::Width(LyXFont const &font) const
{
  LyXFont efont;
  efont.setSize(font.size()).decSize();
  return 6 + efont.textWidth(i18n("Error"), strlen(i18n("Error")));
}



klyx'InsetError::Draw() (./klyx/src/inseterror.C:70)

void InsetError::Draw(LyXFont font, LyXScreen &scr,
					  int baseline, float &x)
{
  LyXFont efont;
  efont.setSize(font.size()).decSize();
  efont.setLatex(LyXFont::ON);
  
  // Draw as "Error" in a framed box
  x += 1;
  //scr.drawFilledRectangle(int(x), baseline - Ascent(font)+1,
  //			Width(font)-2,Ascent(font)+ Descent(font)-2,
  //			FL_GRAY80);
  scr.fillRectangle(gc_lighted,
					int(x), baseline - Ascent(font)+1,
					Width(font)-2,Ascent(font)+ Descent(font)-2);
  //scr.drawRectangle(int(x), baseline-Ascent(font)+1,
  //		  Width(font)-2, Ascent(font)+Descent(font)-2,
  //		  FL_RED);
  scr.drawRectangle(gc_foot,
					int(x), baseline-Ascent(font)+1,
					Width(font)-2, Ascent(font)+Descent(font)-2); 
  scr.drawString(efont, i18n("Error"), baseline, int(x+2));
  
  x +=  Width(font) - 1;
}



klyx'InsetError::Write() (./klyx/src/inseterror.C:97)

void InsetError::Write(FILE *)
{
}


klyx'InsetError::Read() (./klyx/src/inseterror.C:101)

void InsetError::Read(LyXLex &)
{
}



klyx'InsetError::Latex() (./klyx/src/inseterror.C:106)

int InsetError::Latex(FILE *, signed char /*fragile*/)
{
  return 0;
}



klyx'InsetError::Latex() (./klyx/src/inseterror.C:112)

int InsetError::Latex(LString &, signed char /*fragile*/)
{
  return 0;
}



klyx'InsetError::AutoDelete() (./klyx/src/inseterror.C:118)

bool InsetError::AutoDelete() const
{
  return true;
}



klyx'InsetError::Editable() (./klyx/src/inseterror.C:124)

unsigned char InsetError::Editable() const
{
  return EDITABLE_NO_UNDO;
}


klyx'InsetError::Edit() (./klyx/src/inseterror.C:129)

void InsetError::Edit(int, int)
{
  if( !klyxdialogs->inserterror )
	klyxdialogs->inserterror = new InsertErrorDialog( current_view->getOwner() );

  klyxdialogs->inserterror->setError( contents.c_str() );

  (void)klyxdialogs->inserterror->exec();
}



klyx'InsetError::Clone() (./klyx/src/inseterror.C:140)

Inset* InsetError::Clone()
{
  InsetError *result = new InsetError(contents);
  return result;
}