예제 #1
0
void MyPlotter::DrawAxisText(QPainter &painter)
{
	painter.save();
	painter.setPen(axis_text_color_);
	QFont textfont(TEXT_FAMILY_AXIS,axis_text_size_);
	painter.setFont(textfont);
	DrawXText(painter);
	DrawYText(painter);
	painter.restore();
}
예제 #2
0
MenuBase::MenuBase(int X,int Y,int W,int H,const char* l)
: Fl_Widget(X,Y,W,H,l) {
  set_flag(SHORTCUT_LABEL);
  box(FL_UP_BOX);
  when(FL_WHEN_RELEASE_ALWAYS);
  value_ = menu_ = 0;
  alloc = 0;
  selection_color(FL_SELECTION_COLOR);
  textfont(FL_HELVETICA);
  textsize((uchar)FL_NORMAL_SIZE);
  textcolor(FL_FOREGROUND_COLOR);
  down_box(FL_NO_BOX);
}
Fineline_File_Metadata_Browser::Fineline_File_Metadata_Browser(int x, int y, int w, int h) : Fl_Browser(x, y, w, h)
{
   //ctor
   textfont(FL_HELVETICA);
   textsize(10);
   textcolor(FL_DARK_BLUE);

   static int widths[] = { 100, 150, 150, 150, 100, 100, 100, 100, 100, 50, 0 };            // widths for each column
   column_widths(widths);
   column_char('\t');                                                       // tabs as column delimiters
   type(FL_MULTI_BROWSER);

   //resizable();
}
예제 #4
0
void Fl_ToggleTree::draw_label(char* str, int indent, int x, int y, int w, int h) {
  const int* i = column_widths();

  while (w > 6) {    // do each tab-seperated field
    int w1 = w;      // width for this field
    char* e = 0;     // pointer to end of field or null if none
    if (*i) { // find end of field and temporarily replace with 0
      for (e = str; *e && *e != column_char(); e++);
      if (*e) {
        *e = 0; w1 = *i++;
      } else e = 0;
    }
    int size = textsize();
    Fl_Font font = textfont();
    Fl_Color lcol = textcolor();
    Fl_Align align = (Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_CLIP);
    // check for all the @-lines recognized by XForms:
    /*    while (*str == format_char() && *++str && *str != format_char()) {
          switch (*str++) {
          case 'l': case 'L': size = 24; break;
          case 'm': case 'M': size = 18; break;
          case 's': size = 11; break;
          case 'b': font = (Fl_Font)(font|FL_BOLD); break;
          case 'i': font = (Fl_Font)(font|FL_ITALIC); break;
          case 'f': case 't': font = FL_COURIER; break;
          case 'c': align = FL_ALIGN_CENTER; break;
          case 'r': align = FL_ALIGN_RIGHT; break;
          case 'B': 
        fl_color((Fl_Color)strtol(str, &str, 10));
        fl_rectf(x, y, w1, h);
            break;
          case 'C':
        lcol = (Fl_Color)strtol(str, &str, 10);
        break;
          case 'F':
        font = (Fl_Font)strtol(str, &str, 10);
        break;
          case 'N':
        lcol = FL_INACTIVE_COLOR;
        break;
          case 'S':
        size = strtol(str, &str, 10);
        break;
          case '-':
        fl_color(FL_DARK3);
        fl_line(x+3, y+h/2, x+w1-3, y+h/2);
        fl_color(FL_LIGHT3);
        fl_line(x+3, y+h/2+1, x+w1-3, y+h/2+1);
        break;
          case 'u':
          case '_':
        fl_color(lcol);
        fl_line(x+3, y+h-1, x+w1-3, y+h-1);
        break;
          case '.':
        goto BREAK;
          case '@':
        str--; goto BREAK;
          }
        }
      BREAK:
    */
    fl_font(font, size);
    //if (!active_r()) lcol = inactive(lcol);
    //    if (((FL_BLINE*)v)->flags & SELECTED)
    //      lcol = contrast(lcol, selection_color());
    fl_color(lcol);
    fl_draw(str, x + indent, y + 1, w1 - indent, h + 1, align);
    if (!e) break;   // no more fields...
    *e = column_char();   // put the seperator back
    x += w1;
    w -= w1;
    str = e + 1;
    indent = 0;
  }
}