当前位置: 首页>>代码示例>>C++>>正文


C++ Fl_Box::color方法代码示例

本文整理汇总了C++中Fl_Box::color方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Box::color方法的具体用法?C++ Fl_Box::color怎么用?C++ Fl_Box::color使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fl_Box的用法示例。


在下文中一共展示了Fl_Box::color方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: window

    window(int x, int y, int w, int h, const char *label = 0)
        : Fl_Window(x, y, w, h, label)
    {
        Fl_Box *o = new Fl_Box(10, 10, 300, 25,
            "Open CSV file to convert to HTML -->");
        o->box(FL_BORDER_BOX);
        o->align(FL_ALIGN_INSIDE | FL_ALIGN_WRAP| FL_ALIGN_CENTER);
        o->color((Fl_Color)215);
        o->labelfont(FL_HELVETICA_BOLD);

        Fl_Button *but = new Fl_Button(320, 10, 80, 25, "Pick Files");
        but->callback(on_pick_button_click, this);

        encode_check = new Fl_Check_Button(10, 40, 280, 25,
            "Escape special HTML characters.");
        encode_check->value(1);

        open_file_check = new Fl_Check_Button(10, 65, 280, 25,
            "Open HTML in browser.");
        open_file_check->value(1);

        Fl_Button *author = new Fl_Button(320, 65, 80, 25, "Mingjie Li");
        author->box(FL_FLAT_BOX);
        author->align(FL_ALIGN_INSIDE | FL_ALIGN_RIGHT);
        author->labelsize(12);
        author->labelcolor(fl_rgb_color(128, 128, 128));
        author->callback(on_author_click, this);
    }
开发者ID:limingjie,项目名称:csv2html,代码行数:28,代码来源:csv2html_gui.cpp

示例2: menubar

/*-----------------------------------main------------------------------*/
int 
main (int argc, char **argv) {

	int h_menu;
	int x, y, w, h;
	int width  = 600;
	int height = 400;

  window = new Fl_Window(width,height);

	h_menu = 30;

  Fl_Menu_Bar menubar (0,0,width,h_menu); 

	menubar.menu(big_menu);
  menubar.callback(test_cb);
	menubar.color(FL_WHITE);
  menubar.selection_color(FL_BLUE);

  window->size_range(300,20);
  window->color(FL_GREEN);

	x = 170;
	y = 20 + h_menu;
	w = width - 190;
	h = height - h_menu - 40;
  Fl_Box *box = new Fl_Box (FL_BORDER_BOX, x,y,w,h, "Hello, World!");  
	box->color(FL_YELLOW);

  window->end();
  window->show(argc, argv);
  window->make_current();

  return Fl::run();
}
开发者ID:gennady-em,项目名称:y-zone,代码行数:36,代码来源:demons.c

示例3: make_window

Fl_Group* SUBnoteharmonic::make_window() {
  { harmonic = new Fl_Group(0, 0, 90, 225);
    harmonic->box(FL_FLAT_BOX);
    harmonic->color(FL_BACKGROUND_COLOR);
    harmonic->selection_color(FL_BACKGROUND_COLOR);
    harmonic->labeltype(FL_NO_LABEL);
    harmonic->labelfont(0);
    harmonic->labelsize(14);
    harmonic->labelcolor(FL_FOREGROUND_COLOR);
    harmonic->user_data((void*)(this));
    harmonic->align(FL_ALIGN_TOP);
    harmonic->when(FL_WHEN_RELEASE);
    { Fl_Slider* o = mag = new Fl_Slider(0, 15, 10, 115);
      mag->tooltip("harmonic\'s magnitude");
      mag->type(4);
      mag->box(FL_FLAT_BOX);
      mag->selection_color((Fl_Color)222);
      mag->maximum(127);
      mag->step(1);
      mag->value(127);
      mag->callback((Fl_Callback*)cb_mag);
      o->value(127-pars->Phmag[n]);
      if (pars->Phmag[n]==0) o->selection_color(0);
    } // Fl_Slider* mag
    { Fl_Slider* o = bw = new Fl_Slider(0, 135, 10, 75);
      bw->tooltip("harmonic\'s bandwidth");
      bw->type(4);
      bw->box(FL_FLAT_BOX);
      bw->selection_color((Fl_Color)222);
      bw->maximum(127);
      bw->step(1);
      bw->value(64);
      bw->callback((Fl_Callback*)cb_bw);
      o->value(127-pars->Phrelbw[n]);
    } // Fl_Slider* bw
    { Fl_Box* o = new Fl_Box(10, 170, 5, 5);
      o->box(FL_FLAT_BOX);
      o->color(FL_DARK2);
      if (n+1==MAX_SUB_HARMONICS) o->hide();
    } // Fl_Box* o
    { Fl_Box* o = new Fl_Box(0, 210, 10, 15, "01");
      o->labelfont(1);
      o->labelsize(9);
      o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
      char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));
    } // Fl_Box* o
    { Fl_Box* o = new Fl_Box(0, 0, 10, 15, "01");
      o->labelfont(1);
      o->labelsize(9);
      o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
      char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));
    } // Fl_Box* o
    harmonic->end();
  } // Fl_Group* harmonic
  return harmonic;
}
开发者ID:ishkabbible,项目名称:ZASF,代码行数:56,代码来源:SUBnoteUI.c

示例4: make_about_panel

Fl_Window* make_about_panel(const char *copyright) {
  Fl_Window* w;
   {Fl_Window* o = about_panel = new Fl_Window(330, 276, _("About eFluid"));
    w = o;
    o->type(240);
    o->selection_color((Fl_Color)47);
    o->shortcut(0xff1b);
     {Fl_Group* o = display_group = new Fl_Group(0, 0, 330, 240);
       {Fl_Group* o = new Fl_Group(5, 5, 320, 55, _("eFluid"));
        o->box(FL_ENGRAVED_BOX);
        o->label_font(fl_fonts+1);
        o->label_type(FL_EMBOSSED_LABEL);
        o->color((Fl_Color)0xb3b3be00);
        o->label_color((Fl_Color)32);
        o->selection_color((Fl_Color)47);
        o->label_size(40);
        o->align(FL_ALIGN_INSIDE);
        o->end();
      }
       {Fl_Button* o = new Fl_Button(5, 165, 320, 70, _("\302\251""2002-2003\nClick here for more information"));
        o->box(FL_ENGRAVED_BOX);
        o->label_font(fl_fonts+1);
        o->color((Fl_Color)0xb3b3be00);
        o->label_color((Fl_Color)32);
        o->highlight_color((Fl_Color)0x9d9da700);
        o->highlight_label_color((Fl_Color)55);
        o->label_size(14);
        o->callback((Fl_Callback*)cb_2002);
        o->align(FL_ALIGN_WRAP);
      }
       {Fl_Box* o = new Fl_Box(5, 60, 320, 105, _("EFLTK User Interface Designer\nVersion 2.0.3"));
        o->box(FL_ENGRAVED_BOX);
        o->label_font(fl_fonts+1);
        o->label_type(FL_EMBOSSED_LABEL);
        o->color((Fl_Color)0xb3b3be00);
        o->label_color((Fl_Color)32);
        o->selection_color((Fl_Color)47);
        o->label_size(18);
      }
      o->end();
    }
     {Fl_Box* o = copyright_box = new Fl_Box(0, 0, 330, 240);
      o->label_size(10);
      o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP|FL_ALIGN_WRAP);
      o->hide();
      o->label(copyright);
    }
     {Fl_Return_Button* o = new Fl_Return_Button(5, 245, 320, 25, _("OK"));
      o->label_size(10);
      o->shortcut(0xff0d);
      o->callback((Fl_Callback*)cb_OK);
    }
    o->end();
  }
  return  w;
}
开发者ID:GustavoMOG,项目名称:efltk,代码行数:56,代码来源:about_panel.cpp

示例5: AddDividerBox

//==== Create & Init Box Divider  ====//
void GroupLayout::AddDividerBox( const string& text, int used_w )
{
    assert( m_Group && m_Screen );

    //==== Add Divider Box ====//
    int dw = FitWidth( used_w, m_ButtonWidth );

    Fl_Box* flbox = new Fl_Box( m_X, m_Y, dw, m_DividerHeight );
    flbox->box( FL_BORDER_BOX );
    flbox->color( ( Fl_Color )12 );
    flbox->labelfont( 1 );
    flbox->labelcolor( FL_BACKGROUND2_COLOR );
    flbox->copy_label( text.c_str() );
    m_Group->add( flbox );
    AddX( dw );

    AddY( m_DividerHeight );
    NewLineX();
}
开发者ID:Mr-Kumar-Abhishek,项目名称:OpenVSP,代码行数:20,代码来源:GroupLayout.cpp

示例6: main

int main(int argc, char **argv) {
  { m_win = new Fl_Double_Window(425, 350, "Calc80");
    m_win->color((Fl_Color)29);
    m_win->labelfont(2);
    m_win->labelsize(11);
    { Fl_Box* o = new Fl_Box(5, 25, 415, 60);
      o->box(FL_RFLAT_BOX);
      o->color((Fl_Color)206);
    } // Fl_Box* o
    { Fl_Button* o = new Fl_Button(245, 297, 55, 47, "0");
      o->box(FL_FLAT_BOX);
      o->down_box(FL_FLAT_BOX);
      o->color(FL_BACKGROUND2_COLOR);
      o->selection_color((Fl_Color)17);
      o->labelsize(15);
      o->callback((Fl_Callback*)cb_all, (void*)(0));
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(305, 297, 55, 47, ".");
      o->box(FL_FLAT_BOX);
      o->shortcut(0x2c);
      o->down_box(FL_FLAT_BOX);
      o->color(FL_BACKGROUND2_COLOR);
      o->selection_color((Fl_Color)17);
      o->labelsize(15);
      o->callback((Fl_Callback*)cb_all, (void*)(10));
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(5, 318, 40, 26, "hyp");
      o->box(FL_FLAT_BOX);
      o->shortcut(0x7a);
      o->down_box(FL_FLAT_BOX);
      o->color(FL_BACKGROUND2_COLOR);
      o->selection_color((Fl_Color)17);
      o->labelsize(15);
      o->callback((Fl_Callback*)cb_all, (void*)(1025));
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(185, 245, 55, 47, "1");
      o->box(FL_FLAT_BOX);
      o->shortcut(0x31);
      o->down_box(FL_FLAT_BOX);
      o->color(FL_BACKGROUND2_COLOR);
      o->selection_color((Fl_Color)17);
      o->labelsize(15);
      o->callback((Fl_Callback*)cb_all, (void*)(1));
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(245, 245, 55, 47, "2");
      o->box(FL_FLAT_BOX);
      o->shortcut(0x32);
      o->down_box(FL_FLAT_BOX);
      o->color(FL_BACKGROUND2_COLOR);
      o->selection_color((Fl_Color)17);
      o->labelsize(15);
      o->callback((Fl_Callback*)cb_all, (void*)(2));
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(305, 245, 55, 47, "3");
      o->box(FL_FLAT_BOX);
      o->shortcut(0x33);
      o->down_box(FL_FLAT_BOX);
      o->color(FL_BACKGROUND2_COLOR);
      o->selection_color((Fl_Color)17);
      o->labelsize(15);
      o->callback((Fl_Callback*)cb_all, (void*)(3));
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(365, 245, 55, 47, "+");
      o->box(FL_FLAT_BOX);
      o->shortcut(0x2b);
      o->down_box(FL_FLAT_BOX);
      o->color(FL_BACKGROUND2_COLOR);
      o->selection_color((Fl_Color)17);
      o->labelsize(15);
      o->callback((Fl_Callback*)cb_all, (void*)(67));
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(185, 193, 55, 47, "4");
      o->box(FL_FLAT_BOX);
      o->shortcut(0x34);
      o->down_box(FL_FLAT_BOX);
      o->color(FL_BACKGROUND2_COLOR);
      o->selection_color((Fl_Color)17);
      o->labelsize(15);
      o->callback((Fl_Callback*)cb_all, (void*)(4));
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(245, 193, 55, 47, "5");
      o->box(FL_FLAT_BOX);
      o->shortcut(0x35);
      o->down_box(FL_FLAT_BOX);
      o->color(FL_BACKGROUND2_COLOR);
      o->selection_color((Fl_Color)17);
      o->labelsize(15);
      o->callback((Fl_Callback*)cb_all, (void*)(5));
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(305, 193, 55, 47, "6");
      o->box(FL_FLAT_BOX);
      o->shortcut(0x36);
      o->down_box(FL_FLAT_BOX);
      o->color(FL_BACKGROUND2_COLOR);
      o->selection_color((Fl_Color)17);
      o->labelsize(15);
      o->callback((Fl_Callback*)cb_all, (void*)(6));
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(365, 193, 55, 47, "-");
      o->box(FL_FLAT_BOX);
//.........这里部分代码省略.........
开发者ID:patrwall,项目名称:calc80,代码行数:101,代码来源:calc80.cpp

示例7:

SciCalc::SciCalc() {
  Fl_Window* w;
   {Fl_Window* o = win = new Fl_Window(181, 262, "eCalc");
    w = o;
    o->label_type(FL_NO_LABEL);
    o->shortcut(0xff1b);
    o->user_data((void*)(this));
    o->align();
     {Fl_Box* o = leddisplay = new Fl_Box(2, 2, 176, 24, "Welcome");
      o->box(FL_THIN_DOWN_BOX);
      o->label_font(fl_fonts+4);
      o->color((Fl_Color)207);
      o->label_color((Fl_Color)59);
      o->label_size(14);
      o->callback((Fl_Callback*)cb_leddisplay);
      o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
    }
     {Fl_Box* o = box_DEGRAD = new Fl_Box(24, 28, 35, 16);
      o->box(FL_THIN_DOWN_BOX);
      o->label_color((Fl_Color)1);
      o->label_size(9);
      o->callback((Fl_Callback*)cb_box_DEGRAD);
      o->align(FL_ALIGN_INSIDE);
    }
     {Fl_Box* o = box_bracket = new Fl_Box(59, 28, 65, 16);
      o->box(FL_THIN_DOWN_BOX);
      o->label_color((Fl_Color)1);
      o->label_size(9);
      o->align(FL_ALIGN_INSIDE);
    }
     {Fl_Box* o = box_M = new Fl_Box(124, 28, 35, 16);
      o->box(FL_THIN_DOWN_BOX);
      o->label_color((Fl_Color)1);
      o->label_size(9);
      o->callback((Fl_Callback*)cb_box_M);
      o->align(FL_ALIGN_INSIDE);
    }
     {Fl_Group* o = new Fl_Group(46, 46, 93, 22);
      o->color((Fl_Color)46);
       {Fl_Button* o = radio_2 = new Fl_Button(3, 3, 20, 15, "2");
        o->type(Fl_Button::RADIO);
        o->label_color((Fl_Color)1);
        o->label_size(10);
        o->shortcut(0x40062);
        o->callback((Fl_Callback*)cb_radio_2);
        o->tooltip("Binary mode");
      }
       {Fl_Button* o = radio_8 = new Fl_Button(24, 3, 21, 15, "8");
        o->type(Fl_Button::RADIO);
        o->label_color((Fl_Color)1);
        o->label_size(10);
        o->shortcut(0x4006f);
        o->callback((Fl_Callback*)cb_radio_8);
        o->tooltip("Octal mode");
      }
       {Fl_Button* o = radio_10 = new Fl_Button(46, 3, 21, 15, "10");
        o->type(Fl_Button::RADIO);
        o->label_color((Fl_Color)1);
        o->label_size(10);
        o->shortcut(0x40064);
        o->value(1);
        o->callback((Fl_Callback*)cb_radio_10);
        o->tooltip("Decimal mode");
      }
       {Fl_Button* o = radio_16 = new Fl_Button(68, 3, 21, 15, "16");
        o->type(Fl_Button::RADIO);
        o->label_color((Fl_Color)1);
        o->label_size(10);
        o->shortcut(0x40068);
        o->callback((Fl_Callback*)cb_radio_16);
        o->tooltip("Hex mode");
      }
      o->end();
    }
     {Fl_Group* o = new Fl_Group(3, 163, 107, 94);
      o->box(FL_BORDER_BOX);
      o->color((Fl_Color)43);
       {Fl_Button* o = but_7 = new Fl_Button(3, 4, 32, 20, "7");
        o->label_font(fl_fonts+1);
        o->label_size(14);
        o->shortcut(0x37);
        o->callback((Fl_Callback*)cb_but_7);
      }
       {Fl_Button* o = but_8 = new Fl_Button(38, 4, 32, 20, "8");
        o->label_font(fl_fonts+1);
        o->label_size(14);
        o->shortcut(0x38);
        o->callback((Fl_Callback*)cb_but_8);
      }
       {Fl_Button* o = but_9 = new Fl_Button(72, 4, 32, 20, "9");
        o->label_font(fl_fonts+1);
        o->label_size(14);
        o->shortcut(0x39);
        o->callback((Fl_Callback*)cb_but_9);
      }
       {Fl_Button* o = but_4 = new Fl_Button(3, 26, 32, 20, "4");
        o->label_font(fl_fonts+1);
        o->label_size(14);
        o->shortcut(0x34);
        o->callback((Fl_Callback*)cb_but_4);
//.........这里部分代码省略.........
开发者ID:GustavoMOG,项目名称:efltk,代码行数:101,代码来源:SciCalc.cpp

示例8: update_calendar

void EDE_Calendar::update_calendar() {
	unsigned int i;
	
	// Find first day of week
	edelib::Date d=active_date_;
	d.set(d.year(), d.month(), 1);
	int day_of_week = d.day_of_week()-1;
	
	// Show/hide first filler
	if (day_of_week>0)
		m_filler[0]->show();
	else
		m_filler[0]->hide();
	
	// Days
	int row=2;
	for (i=0; i<d.days_in_month(); i++) {
		Fl_Box* btn = m_dayButtons[i]; // shortcut
		btn->show();
		
		// Set button color
		Fl_Color daycolor = color(); // base color is the color of calendar

		if (day_of_week==0) // Special color for sunday
			daycolor = fl_color_average(daycolor, FL_BLUE, 0.8);
		
		if (i==(uint)today_date_.day()-1 && d.month()==today_date_.month() && d.year()==today_date_.year()) 
			btn->color(fl_color_average(daycolor, FL_RED, 0.5)); // today
		else if (i==(uint)active_date_.day()-1)
			btn->color(fl_lighter(daycolor));
		else
			btn->color(daycolor);
		
		// Set downbox for active day
		if (i==(uint)active_date_.day()-1)
			btn->box(FL_DOWN_BOX);
		else
			btn->box(FL_FLAT_BOX);

		day_of_week++;
		if (day_of_week==7) { day_of_week=0; row++; }
	}
	
	// Hide remaining buttons
	for (i=d.days_in_month(); i<31; i++)
		m_dayButtons[i]->hide();
	
	// Show/hide second filler
	if (day_of_week<6)
		m_filler[1]->show();
	else
		m_filler[1]->hide();
		
	// Show/hide third filler
	if (row<7)
		m_filler[2]->show();
	else
		m_filler[2]->hide();
	
	// Set title
	static char title[30]; // No month name should be larger than 24 chars, even when localized
			// and we can't show it anyway cause the box is too small
	snprintf (title, 30, "%s, %d", d.month_name(), d.year());
	m_monthNameBox->copy_label(title);
	
	
	// Calculate tooltip (distance between today and active date)
	static char tooltip_str[1024];
	tooltip_str[0] = '\0';
	
	if (today_date_ != active_date_) {
		long dist = date_distance(today_date_, active_date_);
		long weeks = dist/7;
		int wdays = dist%7;
		int months=0;
		int mdays=0;
		int years=0;
		int ymonths=0;
		
		// Find lower date, first part of tooltip
		edelib::Date d1,d2;
		if (today_date_ < active_date_) {
			d1=today_date_;
			d2=active_date_;
			snprintf(tooltip_str, 1023, _("In %ld days"), dist);
		} else {
			d2=today_date_;
			d1=active_date_;
			snprintf(tooltip_str, 1023, _("%ld days ago"), dist);
		}
		
		// If necessary, calculate distance in m/d and y/m/d format
		if (dist>30) {
			months = d2.month() - d1.month() + (d2.year() - d1.year())*12; 
			mdays = d2.day() - d1.day();
			if (mdays<1) {
				mdays += d2.days_in_month();
				months--;
			}
		}
//.........这里部分代码省略.........
开发者ID:GustavoMOG,项目名称:ede,代码行数:101,代码来源:EDE_Calendar.cpp

示例9: make_window

Fl_Double_Window* make_window() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = new Fl_Double_Window(400, 605);
    w = o;
    { undobutton = new Fl_Button(6, 25, 40, 25, "Undo");
      undobutton->down_box(FL_DOWN_BOX);
      undobutton->callback((Fl_Callback*)undo_cb);
    } // Fl_Button* undobutton
    { forceslider = new Fl_Slider(206, 25, 75, 25, "Force");
      forceslider->type(5);
      forceslider->selection_color((Fl_Color)1);
      forceslider->minimum(0.05);
      forceslider->value(0.5);
      forceslider->callback((Fl_Callback*)lerp_cb);
      forceslider->align(Fl_Align(FL_ALIGN_RIGHT));
    } // Fl_Slider* forceslider
    { rgbmode = new Fl_Button(331, 25, 35, 25, "HSB");
      rgbmode->labelsize(12);
      rgbmode->callback((Fl_Callback*)rgbmode_cb);
      rgbmode->align(Fl_Align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
    } // Fl_Button* rgbmode
    { fnamebox = new Fl_Input(31, 60, 355, 25, "File:");
      fnamebox->labeltype(FL_ENGRAVED_LABEL);
      fnamebox->labelsize(12);
      fnamebox->callback((Fl_Callback*)input_cb);
      fnamebox->when(FL_WHEN_ENTER_KEY_ALWAYS);
    } // Fl_Input* fnamebox
    { cshow.hsblbls[0] = new Fl_Box(30, 219, 80, 20, "Hue (L)");
      cshow.hsblbls[0]->box(FL_FLAT_BOX);
      cshow.hsblbls[0]->color((Fl_Color)34);
      cshow.hsblbls[0]->labelfont(1);
      cshow.hsblbls[0]->labelsize(12);
      cshow.hsblbls[0]->labelcolor((Fl_Color)3);
    } // Fl_Box* cshow.hsblbls[0]
    { cshow.hsblbls[1] = new Fl_Box(115, 219, 75, 20, "Sat(M)");
      cshow.hsblbls[1]->box(FL_FLAT_BOX);
      cshow.hsblbls[1]->color((Fl_Color)34);
      cshow.hsblbls[1]->labelfont(1);
      cshow.hsblbls[1]->labelsize(12);
      cshow.hsblbls[1]->labelcolor((Fl_Color)2);
    } // Fl_Box* cshow.hsblbls[1]
    { cshow.hsblbls[2] = new Fl_Box(195, 219, 75, 20, "Bright(R)");
      cshow.hsblbls[2]->box(FL_FLAT_BOX);
      cshow.hsblbls[2]->color((Fl_Color)34);
      cshow.hsblbls[2]->labelfont(1);
      cshow.hsblbls[2]->labelsize(12);
      cshow.hsblbls[2]->labelcolor((Fl_Color)235);
    } // Fl_Box* cshow.hsblbls[2]
    { Fl_Box* o = new Fl_Box(275, 219, 80, 20, "Alpha(shift)");
      o->box(FL_FLAT_BOX);
      o->color((Fl_Color)34);
      o->labelfont(1);
      o->labelsize(12);
      o->labelcolor(FL_BACKGROUND2_COLOR);
    } // Fl_Box* o
    { cmedit = new class CMedit(5, 239, 380, 270);
      cmedit->box(FL_FLAT_BOX);
      cmedit->color(FL_BACKGROUND_COLOR);
      cmedit->selection_color(FL_BACKGROUND_COLOR);
      cmedit->labeltype(FL_NORMAL_LABEL);
      cmedit->labelfont(0);
      cmedit->labelsize(14);
      cmedit->labelcolor(FL_FOREGROUND_COLOR);
      cmedit->align(Fl_Align(FL_ALIGN_CENTER));
      cmedit->when(FL_WHEN_RELEASE);
      Fl_Group::current()->resizable(cmedit);
    } // class CMedit* cmedit
    { cshow.color = new colorpatch(62, 515, 50, 40);
      cshow.color->box(FL_DOWN_BOX);
      cshow.color->color(FL_BACKGROUND_COLOR);
      cshow.color->selection_color(FL_BACKGROUND_COLOR);
      cshow.color->labeltype(FL_NO_LABEL);
      cshow.color->labelfont(0);
      cshow.color->labelsize(14);
      cshow.color->labelcolor(FL_FOREGROUND_COLOR);
      cshow.color->align(Fl_Align(FL_ALIGN_CENTER));
      cshow.color->when(FL_WHEN_RELEASE);
    } // colorpatch* cshow.color
    { cshow.cindex = new Fl_Value_Input(7, 530, 50, 25, "  (index");
      cshow.cindex->box(FL_FLAT_BOX);
      cshow.cindex->color((Fl_Color)16);
      cshow.cindex->maximum(0);
      cshow.cindex->step(1);
      cshow.cindex->textsize(12);
      cshow.cindex->callback((Fl_Callback*)report_cb);
      cshow.cindex->align(Fl_Align(FL_ALIGN_TOP));
    } // Fl_Value_Input* cshow.cindex
    { cshow.hsba = new Fl_Output(117, 530, 120, 25, "HSBA");
      cshow.hsba->box(FL_FLAT_BOX);
      cshow.hsba->color((Fl_Color)16);
      cshow.hsba->textsize(11);
      cshow.hsba->align(Fl_Align(FL_ALIGN_TOP));
    } // Fl_Output* cshow.hsba
    { cshow.rgba = new Fl_Output(247, 530, 125, 25, "rgb");
      cshow.rgba->box(FL_FLAT_BOX);
      cshow.rgba->color((Fl_Color)16);
      cshow.rgba->textsize(11);
      cshow.rgba->align(Fl_Align(FL_ALIGN_TOP));
    } // Fl_Output* cshow.rgba
    { cshow.postscalein = new Fl_Value_Input(317, 570, 65, 25, "* Amax");
//.........这里部分代码省略.........
开发者ID:zding5,项目名称:cmed-Colormap-eDream-NCSA-U-of-I-,代码行数:101,代码来源:cmedpanel.C

示例10: if

InputWindow::InputWindow(int w, int h, const char *label, 
	const char *defaultName, InputWindowType type, int folderIndex) : 
	Fl_Window(MAX(w, 445), h, label), cbUseDefaultNames(NULL), ctFileChooser(NULL), 
	userWindowStatus(OK), fileSelectionIndex(-1)
{	
    string = (char*)malloc(sizeof(char)*90);
    color(GUI_WINDOW_BGCOLOR);
    set_modal();
    windowType = type;
    inputText = (char *) malloc(MAX_BUFFER_SIZE * sizeof(char));

    if(type == InputWindow::FILE_INPUT) {
    	    strncpy(inputText, defaultName, MAX_BUFFER_SIZE - 1);
	    inputText[MAX_BUFFER_SIZE - 1] = '\0';
	    char *extPtr = strrchr(inputText, '.');
	    if(extPtr != NULL) {
	         *extPtr = '\0';
	    }
	    char *filenameStartPtr = strrchr(inputText, '/');
	    int fnameStartPos;
	    if(filenameStartPtr != NULL) {
	         fnameStartPos = filenameStartPtr - inputText;
	    }
	    else {
		 fnameStartPos = 0;
	    }
	    char saveDirInfo[MAX_BUFFER_SIZE];
	    snprintf(saveDirInfo, fnameStartPos + 1, "%s", inputText);
	    sprintf(string, "Export to Directory: %s", saveDirInfo);
	    input = new Fl_Input(25, 50, 235, 30);
	    input->when(FL_WHEN_ENTER_KEY);
	    input->value(filenameStartPtr + 1);
	    Fl_Box *box = new Fl_Box(110, 20, 100, 30, (const char*)string);
	    box->box(FL_NO_BOX);
	    box->align(FL_ALIGN_CENTER);
	    Fl_Box *fileExtBox = new Fl_Box(260,50,30,30,".csv");
	    Fl_Button *button = new Fl_Button(305, 50, 110, 30, "Export to CSV @->");
	    button->callback(InputCallback, (void*)0);
	    button->set_active();
	    input->callback(InputCallback, (void*)0);
	    callback(CloseCallback);
    }
    else if(type == InputWindow::FOLDER_INPUT) {    
	    std::string actualStructName = 
		        ExtractStructureNameFromCTName(defaultName);
            const char *actualStructNameCStr = actualStructName.c_str();
            strncpy(inputText, actualStructNameCStr, actualStructName.size() + 1);
            ConfigParser::nullTerminateString(inputText, actualStructName.size());

	    sprintf(string, "Creating new folder for the CT structure %s", defaultName);
	    input = new Fl_Input(160, 50, 250, 30, "@fileopen  New Folder Name:");
	    input->when(FL_WHEN_ENTER_KEY);
            input->maximum_size(60);
	    input->value(inputText);
	    input->color(GUI_BGCOLOR);
	    input->textcolor(GUI_BTEXT_COLOR);
	    Fl_Box *box = new Fl_Box(50, 1, 350, 40, (const char*) string);
	    box->box(FL_OSHADOW_BOX);
	    box->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_WRAP);
	    box->color(GUI_BGCOLOR);
	    box->labelcolor(GUI_BTEXT_COLOR);
	    Fl_Button *button = new Fl_Button(340, 50, 100, 30, "Add Folder @|>");
	    button->callback(InputCallback, (void*)0);
	    button->labelcolor(GUI_BTEXT_COLOR);
	    button->set_active();
	    input->callback(InputCallback, (void*)0);
	    input->labelcolor(GUI_TEXT_COLOR);
	    const char *cbText = " Use only default names for structure folders";
	    cbUseDefaultNames = new Fl_Check_Button(30, 100, 375, 30, cbText);
	    cbUseDefaultNames->box(FL_ROUND_UP_BOX);
	    cbUseDefaultNames->color(GUI_BGCOLOR);
	    cbUseDefaultNames->labelcolor(GUI_BTEXT_COLOR);
	    cbUseDefaultNames->down_color(GUI_WINDOW_BGCOLOR);
	    cbUseDefaultNames->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CENTER);
	    callback(CloseCallback);
	}
        else { 
	    
	    const char *windowDisplayMsg = "Which CT file structure for the organism\ndo you want to display?";
	    Fl_Box *box = new Fl_Box(75, 5, 300, 40, windowDisplayMsg);
	    box->box(FL_RSHADOW_BOX);
	    box->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_WRAP);
	    box->color(GUI_BGCOLOR);
	    box->labelcolor(GUI_BTEXT_COLOR);
	    Fl_Button *displayButton = new Fl_Button(100, 100, 200, 30, "Display Zoomed Region @|>");
	    displayButton->callback(DisplayCTFileCallback, (void*)0);
	    displayButton->color(GUI_BGCOLOR);
	    displayButton->labelcolor(GUI_BTEXT_COLOR);
	    displayButton->set_active();
	    //displayButton->shortcut(FL_Enter);
	    Fl_Button *cancelButton = new Fl_Button(310, 100, 75, 30, "Cancel @1+");
            cancelButton->callback(CancelCallback); 
	    cancelButton->color(GUI_BGCOLOR);
	    cancelButton->labelcolor(GUI_BTEXT_COLOR);
            
	    ctFileChooser = new Fl_Choice(175, 55, 215, 30, "Choose CT Structure: ");
            ctFileChooser->color(GUI_BGCOLOR);
	    ctFileChooser->labelcolor(GUI_BTEXT_COLOR);

	    StructureManager *structManager = RNAStructViz::GetInstance()->GetStructureManager();
//.........这里部分代码省略.........
开发者ID:gtfold,项目名称:RNAStructViz,代码行数:101,代码来源:InputWindow.cpp


注:本文中的Fl_Box::color方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。