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


C++ Fl_Group::resizable方法代码示例

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


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

示例1: addParameter

void onelabGroup::addParameter(onelab::parameter &p)
{
  if(!p.getVisible() || CTX::instance()->solver.showInvisibleParameters) return;

  bool highlight = false;
  Fl_Color c;
  if(getFlColor(p.getAttribute("Highlight"), c)) highlight = true;
  Fl_Tree_Item *n = _tree->add(p.getName().c_str());
  if(!n) return;
  n->labelsize(FL_NORMAL_SIZE + 4);
  _tree->begin();
  int ww = _baseWidth - (n->depth() + 1) * _indent;
  ww *= _widgetLabelRatio; // FIXME CHANGE THIS
  int hh = n->labelsize() + 4;
  Fl_Group *grp = new Fl_Group(1, 1, ww, hh);
  Fl_Widget *widget = _addParameterWidget(p, ww, hh, n, highlight, c);
  grp->end();
  if(!_enableTreeWidgetResize) grp->resizable(0);
  _treeWidgets.push_back(grp);
  widget->copy_label(p.getShortName().c_str());
  std::string help = p.getLabel().size() ? p.getLabel() : p.getShortName();
  if(p.getHelp().size()) help += ":\n" + p.getHelp();
  widget->copy_tooltip(help.c_str());
  n->widget(grp);
  _tree->end();
  if(p.getAttribute("Closed") == "1" && p.getPath().size()) _tree->close(p.getPath().c_str(), 0);
  _tree->redraw();
}
开发者ID:kevinr2763,项目名称:gmsh,代码行数:28,代码来源:onelab2Group.cpp

示例2: AddStructure

void FolderWindow::AddStructure(const char* filename, const int index)
{
    
    Fl_Pack* pack = folderPack;
    pack->begin();
    
    int vertPosn = pack->children() * 30 + pack->y();
    
    Fl_Group* group = new Fl_Group(pack->x(), vertPosn, pack->w(), 30);
    group->begin();
    
    Fl_Button* label = new Fl_Button(pack->x() + 10, vertPosn, pack->w() - 40, 30, filename);
    label->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
    label->callback(FolderWindow::ShowFileCallback);
    label->user_data((void*)index);
    
    Fl_Button* removeButton = new Fl_Button(pack->x() + pack->w() - 20, vertPosn + 5, 20, 20);
    removeButton->callback(FolderWindow::RemoveCallback);
    removeButton->user_data((void*)index);
    removeButton->label("@1+");
    
    //printf("Added file: %s\n",label->label());
    
    group->resizable(label);
    group->end();
    pack->end();
        
    folderScroll->redraw();
}
开发者ID:themize,项目名称:RNAStructViz,代码行数:29,代码来源:FolderWindow.cpp

示例3:

Scheme_Object*
spark_fltk_group::resizable(int argc, Scheme_Object** argv)
{
  DEFAULT_RET_INIT;

  Fl_Group* group = _get_fl_group(argc, argv, 0);
  if (group)
    {
      if (argc == 1)
	{
	  Fl_Widget* w = group->resizable();
	  if (w)
	    {
	      Scheme_Object* tag = 0;
	      MZ_GC_DECL_REG(1);
	      MZ_GC_VAR_IN_REG(0, tag);
	      MZ_GC_REG();
	      tag = scheme_make_integer(FL_WIDGET_TAG);
	      _ret_ = scheme_make_cptr(w, tag);
	      MZ_GC_UNREG();
	    }
	}
      else
	{
	  Fl_Widget* widget = spark_fltk::_get_widget(argc,
						      argv,
						      1);
	  if (widget)
	    {
	      group->resizable(widget);
	      _ret_ = scheme_true;
	    }
	}
    }

  DEFAULT_RET_FINISH;
}
开发者ID:johnwcowan,项目名称:spark-scheme,代码行数:37,代码来源:spark_fltk_group.cpp

示例4: _addSolverMenu

void onelabGroup::_addSolverMenu(int num)
{
  std::ostringstream path;
  path << "0Solver/View" << num;
  Fl_Tree_Item *n = _tree->add(path.str().c_str());
  int ww = _baseWidth - (n->depth() + 1) * _indent;
  int hh = n->labelsize() + 4;
  _tree->begin();
  Fl_Group *grp = new Fl_Group(1, 1, ww, hh);
  new solverButton(1, 1, ww, hh, num, _tree->color());
  grp->end();
  if(!_enableTreeWidgetResize) grp->resizable(0);
  _treeWidgets.push_back(grp);
  n->widget(grp);
  _tree->end();
}
开发者ID:kevinr2763,项目名称:gmsh,代码行数:16,代码来源:onelab2Group.cpp

示例5: callback

ChannelChatTab::ChannelChatTab(int x, int y, int w, int h, std::string const & channelName,
                         ITabs& iTabs, Model & model, ChatSettingsDialog & chatSettingsDialog):
    Fl_Tile(x,y,w,h),
    iTabs_(iTabs),
    model_(model),
    chatSettingsDialog_(chatSettingsDialog),
    channelName_(channelName),
    logFile_("channel_" + channelName)
{
    callback(ChannelChatTab::callbackSplit, this);

    // make tab name unique
    std::string const tabName("#"+channelName);
    copy_label(tabName.c_str());

    // left side (text and input)
    int const leftW = 0.75*w;
    Fl_Group * left = new Fl_Group(x, y, leftW, h);
    int const ih = FL_NORMAL_SIZE*2; // input height
    text_ = new TextDisplay2(x, y, leftW, h-ih, &logFile_);
    input_ = new ChatInput(x, y+h-ih, leftW, ih);
    input_->connectText( boost::bind(&ChannelChatTab::onInput, this, _1) );
    input_->connectComplete( boost::bind(&ChannelChatTab::onComplete, this, _1, _2, _3, _4) );
    left->resizable(text_);
    left->end();

    // right side (user list)
    int const rightW = w - leftW;
    userList_ = new UserList(x+leftW, y, rightW, h, model_, iTabs_);

    // setup split
    position(userList_->x(), 0, iTabs.getSplitPos(), 0);

    end();

    chatSettingsDialog_.connectChatSettingsChanged( boost::bind(&ChannelChatTab::initChatSettings, this) );
    initChatSettings();

    // model signals
    model_.connectChannelTopicSignal( boost::bind(&ChannelChatTab::topic, this, _1, _2, _3, _4) );
    model_.connectChannelMessageSignal( boost::bind(&ChannelChatTab::message, this, _1, _2) );
    model_.connectChannelClients( boost::bind(&ChannelChatTab::clients, this, _1, _2) );
    model_.connectUserJoinedChannel( boost::bind(&ChannelChatTab::userJoined, this, _1, _2) );
    model_.connectUserLeftChannel( boost::bind(&ChannelChatTab::userLeft, this, _1, _2, _3) );
    model_.connectSaidChannel( boost::bind(&ChannelChatTab::said, this, _1, _2, _3) );
}
开发者ID:cleanrock,项目名称:flobby,代码行数:46,代码来源:ChannelChatTab.cpp

示例6: TuileParamWidget

SwitchParamWidget::SwitchParamWidget(TuileWidget* widget, 
                                        MidiOscSwitchTuile* switchTuile):
                                            TuileParamWidget(widget,
                                                             switchTuile),
                                            m_switchTuile(switchTuile) {

    m_selectInput = new Fl_Simple_Counter(0, 0, 50, 20, "Selected Child");
    m_selectInput->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
    m_selectInput->callback(statTuileSwitchInputs,this);
    m_selectInput->labelsize(12);
    m_selectInput->step(1);
    m_selectInput->bounds(0,10);
    Fl_Group *tmpGroup = new Fl_Group(0,0,80,20,"");
    tmpGroup->end();
    tmpGroup->add(m_selectInput);
    tmpGroup->resizable(false);
    add(tmpGroup);
    end();
}
开发者ID:scrime,项目名称:LiveTuiles,代码行数:19,代码来源:SwitchParamWidget.cpp

示例7: AddStructure

void FolderWindow::AddStructure(const char* filename, const int index)
{
    
    Fl_Pack* pack = folderPack;
    pack->begin();
    
    int vertPosn = pack->children() * NAVBUTTONS_BHEIGHT; //+ pack->y() + 15;
    
    Fl_Group* group = new Fl_Group(pack->x(), vertPosn, pack->w(), NAVBUTTONS_BHEIGHT);
    group->begin();
    
    Fl_Button* label = new Fl_Button(pack->x() + 10, vertPosn, pack->w() - 40, 30, filename);
    label->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
    label->callback(FolderWindow::ShowFileCallback);
    label->user_data((void*)index);
    label->labelcolor(GUI_BTEXT_COLOR);
    char labelWithIcon[MAX_BUFFER_SIZE];

    std::string spaceBuffer = string("                                                    ");
    int curLabelLen = 0;
    char filePrefix[MAX_BUFFER_SIZE];
    size_t fileNameBytes = strlen(filename);
    snprintf(filePrefix, MAX_BUFFER_SIZE, "%-.20s%s", filename, 
	     fileNameBytes > MAX_FOLDER_LABEL_CHARS ? "..." : "");
    snprintf(labelWithIcon, MAX_BUFFER_SIZE - 1, "@filenew   %s%s", 
	     filePrefix, spaceBuffer.substr(0, 
             MAX(0, MAX_FOLDER_LABEL_CHARS - ((int ) strlen(filePrefix)))).c_str());
    //strcat(labelWithIcon, "   @|>");
    label->copy_label(labelWithIcon);
    label->tooltip(filename); 
    
    Fl_Button* removeButton = new Fl_Button(pack->x() + pack->w() - 20, vertPosn + 5, 20, 20);
    removeButton->callback(FolderWindow::RemoveCallback);
    removeButton->user_data((void*)index);
    removeButton->label("@1+");
    removeButton->labelcolor(GUI_TEXT_COLOR);
    
    group->resizable(label);
    group->end();
    pack->end();
        
    folderScroll->redraw();
}
开发者ID:gtfold,项目名称:RNAStructViz,代码行数:43,代码来源:FolderWindow.cpp

示例8: CBaseLuaWidget

CLuaDirSelector::CLuaDirSelector(const char *desc, const char *val) : CBaseLuaWidget(desc)
{
    const int dirinputh = 35, buttonh = 25;
    
    // Group for placing widgets next to eachother
    Fl_Group *dirgroup = new Fl_Group(0, 0, 0, dirinputh);
    dirgroup->resizable(NULL);
    GetGroup()->add(dirgroup);
    
    m_pDirInput = new Fl_File_Input(0, 0, 0, dirinputh);
    m_pDirInput->callback(InputChangedCB, this);
    
    if (val && *val)
        m_pDirInput->value(val);
    
    m_pBrowseButton = new Fl_Button(0, (dirinputh-buttonh)/2, 0, buttonh, GetTranslation("Browse"));
    m_pBrowseButton->callback(BrowseCB, this);
    
    dirgroup->end();
}
开发者ID:BackupTheBerlios,项目名称:nixstaller-svn,代码行数:20,代码来源:luadirselector.cpp

示例9: _addViewMenu

void onelabGroup::_addViewMenu(int num)
{
  std::ostringstream path;
  path << "0Post-processing/View" << num;
  Fl_Tree_Item *n;
  if((n = _tree->find_item(path.str().c_str())) != NULL) { // check if the item already exists
    _tree->remove(n);
  }
  n = _tree->add(path.str().c_str());
  int ww = _baseWidth - (n->depth() + 1) * _indent;
  int hh = n->labelsize() + 4;
  _tree->begin();
  Fl_Group *grp = new Fl_Group(1, 1, ww, hh);
  new viewButton(1, 1, ww, hh, num, _tree->color());
  grp->end();
  if(!_enableTreeWidgetResize) grp->resizable(0);
  _treeWidgets.push_back(grp);
  n->widget(grp);
  _tree->end();
}
开发者ID:kevinr2763,项目名称:gmsh,代码行数:20,代码来源:onelab2Group.cpp

示例10: createBottomBar

Fl_Group* gdSampleEditor::createBottomBar(int x, int y, int h)
{
  Fl_Group* g = new Fl_Group(8, waveTools->y()+waveTools->h()+8, w()-16, h);
  g->begin();
    Fl_Group* previewBox = createPreviewBox(g->x(), g->y(), g->h());

    geBox* divisor1 = new geBox(previewBox->x()+previewBox->w()+8, g->y(), 1, g->h());
    divisor1->box(FL_BORDER_BOX);

    Fl_Group* opTools = createOpTools(divisor1->x()+divisor1->w()+12, g->y(), g->h());

    geBox* divisor2 = new geBox(opTools->x()+opTools->w()+8, g->y(), 1, g->h());
    divisor2->box(FL_BORDER_BOX);

    createInfoBox(divisor2->x()+divisor2->w()+8, g->y(), g->h());

  g->end();
  g->resizable(0);

  return g;
}
开发者ID:monocasual,项目名称:giada,代码行数:21,代码来源:sampleEditor.cpp

示例11: GLWindow

VDBWindow::VDBWindow() : Fl_Window(640+180,480,"vdb") {
	gl = new GLWindow(0, 0, w() - 180, h());
	
	Fl_Group * group = new Fl_Group(640,0,180,h());
	
	point_size = new Fl_Slider(640+10, 20, 160, 20, "Point Size");
	setupSlider(point_size,1,5,5,this);
	filter_value = new Fl_Slider(640+10, 60, 160 , 20, "Filter");
	setupSlider(filter_value,0,1,1,this);
	
	color_by = new Fl_Choice(640+30, 100, 110, 20, "Color By");
	color_by->align(FL_ALIGN_TOP);
	color_by->add("vdb_color",0,color_by_wrapper,this);
	color_by->add("vdb_label",0,color_by_wrapper,this);
	color_by->value(0);
	makePretty(color_by);
	
	clear_button = new Fl_Button(640+130, h() - 40, 40, 30, "Clear");
	clear_button->callback(clear_wrapper,gl);
	makePretty(clear_button);
	
	makePretty(this);
	for(int i = 0; i < N_CATEGORY_COLORS; i++) {
		Fl::set_color(i+8,category_colors[i][0],category_colors[i][1],category_colors[i][2]);
	}
	
	static int column_widths[] = { 30, 100, 0 };
	Fl_Browser * b = gl->legend = new Fl_Browser(640+10,130, 160, h() - 130 - 50);
	b->column_widths(column_widths);
	b->format_char('@');
	b->column_char('\t');
	b->hide();
	group->end();
	group->resizable(NULL);
	
	this->resizable(gl);
	this->size_range(500,480);
	
	this->end();
};
开发者ID:Mx7f,项目名称:vdb,代码行数:40,代码来源:VDBWindow.cpp

示例12: createUpperBar

Fl_Group* gdSampleEditor::createUpperBar()
{
  using namespace giada::m;

  Fl_Group* g = new Fl_Group(G_GUI_OUTER_MARGIN, G_GUI_OUTER_MARGIN, w()-16, G_GUI_UNIT);
  g->begin();
    grid    = new geChoice(g->x(), g->y(), 50, G_GUI_UNIT);
    snap    = new geCheck(grid->x()+grid->w()+4, g->y()+3, 12, 12, "Snap");
    sep1    = new geBox(snap->x()+snap->w()+4, g->y(), 506, G_GUI_UNIT);
    zoomOut = new geButton(sep1->x()+sep1->w()+4, g->y(), G_GUI_UNIT, G_GUI_UNIT, "", zoomOutOff_xpm, zoomOutOn_xpm);
    zoomIn  = new geButton(zoomOut->x()+zoomOut->w()+4, g->y(), G_GUI_UNIT, G_GUI_UNIT, "", zoomInOff_xpm, zoomInOn_xpm);
  g->end();
  g->resizable(sep1);

  grid->add("(off)");
  grid->add("2");
  grid->add("3");
  grid->add("4");
  grid->add("6");
  grid->add("8");
  grid->add("16");
  grid->add("32");
  grid->add("64");
  if (conf::sampleEditorGridVal == 0)
    grid->value(0);
  else 
    grid->value(grid->find_item(u::string::iToString(conf::sampleEditorGridVal).c_str()));
  grid->callback(cb_changeGrid, (void*)this);

  snap->value(conf::sampleEditorGridOn);
  snap->callback(cb_enableSnap, (void*)this);

  /* TODO - redraw grid if != (off) */

  zoomOut->callback(cb_zoomOut, (void*)this);
  zoomIn->callback(cb_zoomIn, (void*)this);

  return g;
}
开发者ID:monocasual,项目名称:giada,代码行数:39,代码来源:sampleEditor.cpp

示例13: _addMenu

void onelabGroup::_addMenu(const std::string &path, Fl_Callback *callback, void *data)
{
  Fl_Tree_Item *n = _tree->add(path.c_str());
  _tree->begin();
  int ww = _baseWidth - (n->depth() + 1) * _indent;
  int hh = n->labelsize() + 4;
  Fl_Group *grp = new Fl_Group(1, 1, ww, hh);
  Fl_Button *but = new Fl_Button(1, 1, ww, hh);
  but->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
  but->callback(callback, data);
  but->box(FL_FLAT_BOX);
  but->color(_tree->color());
  but->selection_color(_tree->color());
  grp->end();
  if(!_enableTreeWidgetResize) grp->resizable(0);
  _treeWidgets.push_back(grp);
  std::string label = path;
  std::string::size_type last = path.find_last_of('/');
  if(last != std::string::npos) label = path.substr(last + 1);
  but->copy_label(label.c_str());
  n->widget(grp);
  _tree->end();
}
开发者ID:kevinr2763,项目名称:gmsh,代码行数:23,代码来源:onelab2Group.cpp

示例14: createOpTools

Fl_Group* gdSampleEditor::createOpTools(int x, int y, int h)
{
  Fl_Group* g = new Fl_Group(x, y, 572, h);
  g->begin();
  g->resizable(0);
    volumeTool = new geVolumeTool(g->x(), g->y(), ch);
    boostTool  = new geBoostTool(volumeTool->x()+volumeTool->w()+4, g->y(), ch);
    panTool    = new gePanTool(boostTool->x()+boostTool->w()+4, g->y(), ch);
   
    pitchTool = new gePitchTool(g->x(), panTool->y()+panTool->h()+8, ch);

    rangeTool = new geRangeTool(g->x(), pitchTool->y()+pitchTool->h()+8, ch);
    shiftTool = new geShiftTool(rangeTool->x()+rangeTool->w()+4, pitchTool->y()+pitchTool->h()+8, ch);
    reload    = new geButton(g->x()+g->w()-70, shiftTool->y(), 70, 20, "Reload");
  g->end();

  if (ch->wave->isLogical()) // Logical samples (aka takes) cannot be reloaded.
    reload->deactivate();

  reload->callback(cb_reload, (void*)this);

  return g;
}
开发者ID:monocasual,项目名称:giada,代码行数:23,代码来源:sampleEditor.cpp

示例15: CBaseLuaWidget

CLuaCFGMenu::CLuaCFGMenu(const char *desc) : CBaseLuaWidget(desc)
{
    m_ColumnWidths[0] = m_ColumnWidths[1] = 0;
    
    const int inputh = 25, dirinputh = 35, inputspacing = 10;
    GetGroup()->begin();
    
    m_pVarListView = new Fl_Hold_Browser(0, 0, 0, GroupHeight() - (inputspacing+dirinputh));
    m_pVarListView->callback(SelectionCB, this);
    
    m_pInputField = new Fl_Input(0, 0, 0, inputh);
    m_pInputField->callback(InputChangedCB, this);
    m_pInputField->when(FL_WHEN_CHANGED);
    m_pInputField->hide();
    
    m_pChoiceMenu = new Fl_Choice(0, 0, 0, inputh);
    m_pChoiceMenu->callback(ChoiceChangedCB, this);
    m_pChoiceMenu->hide();
    
    // Group for placing widgets next to eachother
    Fl_Group *dirgroup = new Fl_Group(0, 0, 0, dirinputh);
    dirgroup->resizable(NULL);
    
    m_pDirInput = new Fl_File_Input(0, 0, 0, dirinputh);
    m_pDirInput->callback(InputChangedCB, this);
    m_pDirInput->when(FL_WHEN_CHANGED);
    m_pDirInput->hide();
    
    m_pBrowseButton = new Fl_Button(0, (dirinputh-inputh) / 2, 0, inputh, GetTranslation("Browse"));
    SetButtonWidth(m_pBrowseButton);
    m_pBrowseButton->callback(BrowseCB, this);
    m_pBrowseButton->hide();
    
    dirgroup->end();
    
    GetGroup()->end();
}
开发者ID:BackupTheBerlios,项目名称:nixstaller-svn,代码行数:37,代码来源:luacfgmenu.cpp


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