本文整理汇总了C++中Fl_Box::labelcolor方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Box::labelcolor方法的具体用法?C++ Fl_Box::labelcolor怎么用?C++ Fl_Box::labelcolor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Box
的用法示例。
在下文中一共展示了Fl_Box::labelcolor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//constructeur
Fl_Progress_Window() : Fl_Window(238,105,"Progression...")
{
// Progress 1 Label
Fl_Box *label = new Fl_Box(10,10,215,15,"Pourcentage Général:");
label->labelsize(12);
label->labelfont(1);
label->labelcolor((Fl_Color)136);
label->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
//Progress1
progress1 = new Fl_Progress(10,28,215,20,"0%");
progress1->selection_color((Fl_Color)175);
progress1->maximum(100);
progress1->minimum(0);
progress1->labelsize(12);
// Progress filename (label progress 2)
progress_filename = new Fl_Box(10,52,215,15, "Fichier:");
progress_filename->labelsize(12);
progress_filename->labelfont(1);
progress_filename->labelcolor((Fl_Color)136);
progress_filename->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
// Progress 2
progress2 = new Fl_Progress(10,70,215,20,"0%");
progress2->maximum(100);
progress2->minimum(0);
progress2->labelsize(12);
progress2->selection_color((Fl_Color)175);
//fin du window...
this->set_modal();
this->end();
}
示例2: 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();
}
示例3: RebuildMenus
void DiagramWindow::RebuildMenus()
{
// Create the menus, if they don't already exist.
int activeMenuIndex[3];
bool activeSet[3];
if (!m_menus[0])
{
this->begin();
Fl_Box* label = new Fl_Box(ms_menu_minx[0], 0, ms_menu_width, 25, "Structure 1");
label->labelcolor(FL_WHITE);
label = new Fl_Box(ms_menu_minx[1], 0, ms_menu_width, 25, "Structure 2");
label->labelcolor(FL_WHITE);
label = new Fl_Box(ms_menu_minx[2], 0, ms_menu_width, 25, "Structure 3");
label->labelcolor(FL_WHITE);
m_menus[0] = new Fl_Choice(ms_menu_minx[0], 25, ms_menu_width, 25);
m_menus[1] = new Fl_Choice(ms_menu_minx[1], 25, ms_menu_width, 25);
m_menus[2] = new Fl_Choice(ms_menu_minx[2], 25, ms_menu_width, 25);
m_menus[0]->callback(MenuCallback);
m_menus[1]->callback(MenuCallback);
m_menus[2]->callback(MenuCallback);
activeMenuIndex[0] = -1;
activeMenuIndex[1] = -1;
activeMenuIndex[2] = -1;
activeSet[0] = false;
activeSet[1] = false;
activeSet[2] = false;
this->end();
}
else
{
// Cache the current active index, if any
for (int j = 0; j < 3; ++j)
{
activeMenuIndex[j] = (int)m_menus[j]->mvalue()->user_data();
activeSet[j] = false;
}
}
// Remove any unnecessary menu items
for (int i = m_structures.size() + 1; i < m_menuItemsSize; ++i)
{
m_menuItems[i].label(0);
}
// Reallocate if necessary
if ((int)m_structures.size() + 2 > m_menuItemsSize)
{
m_menuItemsSize = m_structures.size() + 2;
free(m_menuItems);
m_menuItems = (Fl_Menu_Item*)malloc(sizeof(Fl_Menu_Item) * m_menuItemsSize);
m_menuItems[0].label("None");
m_menuItems[0].shortcut(0);
m_menuItems[0].user_data((void*)-1);
for (int i = 0; i < m_menuItemsSize; ++i)
{
m_menuItems[i].callback((Fl_Callback*)0);
m_menuItems[i].labeltype(FL_NORMAL_LABEL);
m_menuItems[i].labelsize(m_menus[0]->textsize());
m_menuItems[i].labelcolor(FL_BLACK);
m_menuItems[i].labelfont(m_menus[0]->textfont());
m_menuItems[i].flags = 0;
}
m_menus[0]->menu(m_menuItems);
m_menus[1]->menu(m_menuItems);
m_menus[2]->menu(m_menuItems);
}
// Add entries
StructureManager* structureManager = RNAStructViz::GetInstance()->GetStructureManager();
for (unsigned int ui = 0; ui < m_structures.size(); ++ui)
{
RNAStructure* structure = structureManager->GetStructure(m_structures[ui]);
m_menuItems[ui + 1].label(structure->GetFilename());
m_menuItems[ui + 1].user_data((void*)m_structures[ui]);
m_menuItems[ui + 1].shortcut(0);
for (int j = 0; j < 3; ++j)
{
if (activeMenuIndex[j] == m_structures[ui])
{
m_menus[j]->value(ui + 1);
activeSet[j] = true;
}
}
}
// Reset active entries that have not already been set, and set the last entry to NULL label
m_menuItems[m_structures.size() + 1].label(0);
for (int j = 0; j < 3; ++j)
{
if (!activeSet[j])
{
m_menus[j]->value(m_menuItems);
}
}
//.........这里部分代码省略.........
示例4: 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");
//.........这里部分代码省略.........
示例5: 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();
//.........这里部分代码省略.........