Revision 23839a6cb5c6ce1890674b83787f024bfdbf0c83 authored by Sergey Linev on 03 March 2015, 16:23:43 UTC, committed by Bertrand Bellenot on 04 March 2015, 08:35:14 UTC
1. Introduce central method where all kind of text drawings
   are handled. At this place decide which kind of rendering -
   plain text, simplify latex or normal MathJax is used
2. Implement correct size adjustment and alignment for
   all kinds of text output (with and without MathJax)
3. Support TMathText class - always MathJax will be used
4. Draw label in TPabeText
5. Avoid concurent calls of JSROOT.AssertPrerequisities

Signed-off-by: Bertrand Bellenot <bertrand.bellenot@cern.ch>
1 parent 3cb3124
Raw File
virtualfunc1.cxx
/* -*- C++ -*- */
/*************************************************************************
 * Copyright(c) 1995~2005  Masaharu Goto (root-cint@cern.ch)
 *
 * For the licensing terms see the file COPYING
 *
 ************************************************************************/
//
// virtual function test
//
#include <stdio.h>
#include <stdlib.h>

class A {
 public:
  int a;
  A(int i) { a=i; }
  virtual void print(void) { printf("a=%d\n",a); }
  virtual void Print(void) { printf("A=%d\n",a); }
};

class B {
 public:
  int b;
  B(int i) { b=i; }
  void print(void) { printf("b=%d\n",b); }
  void Print(void) { printf("B=%d\n",b); }
};

class C: public B, public A {
 public:
  int c;
  C(int i) : B(i+2), A(i+1) { c=i; }
  void print(void) { printf("c=%d\n",c); }
  void Print(void) { printf("C=%d\n",c); }
};

class D: public C {
 public:
  int d;
  D(int i) : C(i+10) { d=i; }
  void print(void) { printf("d=%d\n",d); }
  void Print(void) { printf("D=%d\n",d); }
};

int main()
{
  A aobj=A(1);
  B bobj=B(101);
  C cobj=C(201);
  D dobj=D(301);

  A *pa, /* *pb, */ *pc,*pd;
  B *PB;

  pa = &aobj;
#if 0
  fprintf(stderr,"Intentional error, pb below\n");
  pb = &bobj;
#endif
  PB = &bobj;
  pc = &cobj;
  pd = &dobj;

  pa->print();
  PB->print();
  pc->print();
  pd->print();
  pa->Print();
  PB->Print();
  pc->Print();
  pd->Print();

  return 0;
}
back to top