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


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

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


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

示例1: updateParameter

void onelabGroup::updateParameter(onelab::string &p)
{
  Fl_Tree_Item *n = _tree->find_item(p.getName().c_str());
  if(!n) {
    addParameter(p);
    return;
  }
  Fl_Group *grp = (Fl_Group *)n->widget();
  // macro button
  if(p.getAttribute("Macro") == "Gmsh"){
    return;
  }

  // non-editable value FIXME
  if(p.getReadOnly()){
    Fl_Output *but = (Fl_Output *)grp->child(0);
    but->value(p.getValue().c_str());
    return;
  }

  // simple string (no menu)
  if(p.getChoices().empty() && p.getKind() != "file"){
    Fl_Input *but = (Fl_Input *)grp->child(0);
    but->value(p.getValue().c_str());
    return;
  }

  // general string input TODO
  Fl_Input_Choice *but = (Fl_Input_Choice *)grp->child(0);
  but->value(p.getValue().c_str());
}
开发者ID:kevinr2763,项目名称:gmsh,代码行数:31,代码来源:onelab2Group.cpp

示例2: updateChannels

void Keyboard::updateChannels(char side) {

	Fl_Group *group;
	gClick   *add;

	if (side == 0)	{
		group = gChannelsL;
		add   = addChannelL;
	}
	else {
		group = gChannelsR;
		add   = addChannelR;
	}

	//printf("[keyboard::updateChannels] side %d has %d widgets\n", side, group->children());

	for (int i=0; i<group->children(); i++) {
		gChannel *gch = (gChannel*) group->child(i);
		gch->position(gch->x(), group->y()+(i*24));
	}
	group->size(group->w(), group->children()*24);
	add->position(add->x(), group->y()+group->h());

	redraw();
}
开发者ID:micahscopes,项目名称:giada,代码行数:25,代码来源:gg_keyboard.cpp

示例3:

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

  Fl_Group* group = _get_fl_group(argc, argv, 0);
  if (group)
    {
      int i = 0;
      if (spark::Utils::int_from_scheme_long(argv[1], i))
	{
	  if (i < 0 || i >= group->children())
	    {
	      DEFAULT_RET_FINISH;
	    }
	  Fl_Widget* w = group->child(i);
	  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();
	    }
	}
    }

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

示例4: sprintf

viewButton *onelabGroup::getViewButton(int num)
{
  char tmp[256];
  sprintf(tmp, "0Post-processing/View%d", num);
  Fl_Tree_Item *n = _tree->find_item(tmp);
  if(n){
    Fl_Group *grp = (Fl_Group*)n->widget();
    return (viewButton*)grp->child(0);
  }
  return 0;
}
开发者ID:kevinr2763,项目名称:gmsh,代码行数:11,代码来源:onelab2Group.cpp

示例5: RemoveCallback

void FolderWindow::RemoveCallback(Fl_Widget* widget, void* userData)
{
    FolderWindow* fwindow = (FolderWindow*)(widget->parent()->parent()->parent()->parent());
    
    Fl_Pack* pack = fwindow->folderPack;
    for(int i = 0; i < pack->children(); ++i)
    {
        Fl_Group* tempGroup = (Fl_Group*)pack->child(i);
        Fl_Button* childButton = (Fl_Button*)tempGroup->child(1); // <--- here
        
        if (childButton == widget)
        {
            RNAStructViz* appInstance = RNAStructViz::GetInstance();
            const std::vector<DiagramWindow*>& diagrams = appInstance->GetDiagramWindows();
            for (unsigned int ui = 0; ui < diagrams.size(); ++ui)
            {
                if(diagrams[ui]->GetFolderIndex() == fwindow->m_folderIndex)
                {
                    diagrams[ui]->RemoveStructure((intptr_t)userData);
                    break;
                }
            }
            const std::vector<StatsWindow*>& stats = appInstance->GetStatsWindows();
            for (unsigned int ui = 0; ui < stats.size(); ++ui)
            {
                if(stats[ui]->GetFolderIndex() == fwindow->m_folderIndex)
                {
                    stats[ui]->RemoveStructure((intptr_t)userData);
                    break;
                }
            }
            Fl_Group* toRemove = (Fl_Group*)pack->child(i); // <--- here
            pack->remove(toRemove);
            fwindow->folderScroll->redraw();
            Fl::delete_widget(toRemove);
            
            appInstance->GetStructureManager()->DecreaseStructCount( 
			                        fwindow->m_folderIndex);
            appInstance->GetStructureManager()->RemoveStructure((intptr_t)userData);
            
            break;
        }
    }
}
开发者ID:gtfold,项目名称:RNAStructViz,代码行数:44,代码来源:FolderWindow.cpp

示例6: header_callback

// callback for header buttons
void header_callback(Fl_Widget*w, void*) {
	Fl_Group* heading = (Fl_Group*)w->parent();
	EDE_Browser* browser = (EDE_Browser*)w->parent()->parent();
	for (int i=heading->children(); i--; )
		if (w == heading->child(i)) { browser->sort(i); break; }
}
开发者ID:edeproject,项目名称:svn,代码行数:7,代码来源:EDE_Browser.cpp

示例7: int

static void
joy_handler(
	void *			UNUSED( user_arg )
)
{
	MMRESULT result;
	JOYINFOEX joyinfo;
	int i;
	signed int joy[4];
	signed int rollA, pitchA, collA, yawA;
	
	joyinfo.dwSize=sizeof(joyinfo);
	joyinfo.dwFlags=JOY_RETURNALL;
	result=joyGetPosEx(joystickID, &joyinfo);

	if( result != JOYERR_NOERROR )
	{
		gui->joy_status->value( 0 );
		return;
	}

/* need WIN32 equivalent for this log statement */
/*	if(0) cout
		<< ( e.type & JS_EVENT_AXIS ? "axis: "
		:  e.type & JS_EVENT_BUTTON ? "button: "
		: "UNKNOWN" )
		<< int(e.number)
		<< "="
		<< e.value
		<< endl; */


	if(0) {
		cout<< "axis: "<< "X"<< "="<< joyinfo.dwXpos<< endl;
		cout<<"axis: Y="<<joyinfo.dwYpos<<endl;
		cout<<"axis: Z="<<joyinfo.dwZpos<<endl;
		cout<<"axis: R="<<joyinfo.dwRpos<<endl;
	}
		

	joy[0]=(signed int) joyinfo.dwXpos - 32000;
	joy[1]=(signed int) joyinfo.dwYpos - 32000;
	joy[2]=(signed int) joyinfo.dwZpos - 32000;
	joy[3]=(signed int) joyinfo.dwRpos - 32000;
	
	rollA=(int)gui->rollAxes->value();
	pitchA=(int)gui->pitchAxes->value();
	collA=(int)gui->collAxes->value();
	yawA=(int)gui->yawAxes->value();

	joy_roll=joy[rollA];
	joy_pitch=joy[pitchA];
	joy_yaw=joy[yawA];
	joy_throttle=joy[collA];

	handle_axis(0,joy_roll);  // roll
	handle_axis(1,joy_pitch);  // pitch
	handle_axis(2,joy_throttle);  // coll
	handle_axis(3,joy_yaw);  // yaw

	gui->rollSlider->value(joy[0]);
	gui->pitchSlider->value(joy[1]);
	gui->collSlider->value(joy[2]);
	gui->yawSlider->value(joy[3]);

	if( joyinfo.dwFlags & JOY_RETURNBUTTONS )
	{
		for (i=0; i <= 6; ++i) {
			Fl_Group *g = gui->buttons;

			Fl_Button *b = (Fl_Button*) g->child( i );
			if (joyinfo.dwButtons & JOY_BUTTON_FLAG(i) )
				b->value( 1 );
			else b->value( 0 );
			joy_button[i] = joyinfo.dwButtons & JOY_BUTTON_FLAG(i) ;	
		}
	}

	Fl::add_timeout(.01,joy_handler);
	
	return;
}
开发者ID:anjdreas,项目名称:Helicopter-Autopilot-Simulator,代码行数:82,代码来源:Joystick.cpp

示例8: add

Fl_Widget* Fl_Menu_::add(
const char *text,
int shortcut,
Fl_Callback *cb,
void *data,
int flags
)
{
    Fl_Group* group = this;

    int bufsize = strlen(text)+1;
    ARRAY(char, buf, bufsize);

    int flags1 = 0;
    const char* item;
    for (;;)                     /* do all the supermenus: */
    {

        // leading slash makes us assumme it is a filename:
        if (*text == '/') {item = text; break;}

        // leading underscore causes divider line:
        if (*text == '_') {text++; flags1 = FL_MENU_DIVIDER;}

        // copy to buf, changing \x to x:
        char *q = buf; 
        const char *p;
        for (p=text; *p && *p != '/'; *q++ = *p++) if (p[0]=='\\' && p[1]) p++;
        *q = 0;
        item = buf;

        // if not followed by slash it is not a menu title:
        if (*p != '/') break;

        // point at the next text:
        text = p+1;

        // find a matching menu title:
        for (int n = group->children();;)
        {
            if (!n)              // create a new menu
            {
                if (find_flag) return 0;
                group = (Fl_Group*)append(group,item,FL_SUBMENU|flags1);
                break;
            }
            Fl_Widget* w = group->child(--n);
            if(w->is_group() && !w->label().empty() && !compare(w->label().c_str(), item))
            {
                group = (Fl_Group*)w;
                break;
            }
        }
        flags1 = 0;
    }

    // find a matching menu item:
    Fl_Widget* o = 0;
    if (replace_flag | find_flag) for (int n = group->children(); n--;)
    {
        Fl_Widget* w = group->child(n);		
        if(!w->label().empty() && !compare(w->label().c_str(), item) )// && !w->is_group()) //Finding groups are also allowed!
        {
            if (find_flag) return w;
            o = w;
            fl_menu_replaced = true;
            goto REPLACED;
        }
    }
    if (find_flag) return 0;
    o = append(group, item, flags|flags1);
    fl_menu_replaced = false;

    REPLACED:
    /* fill it in */
    o->shortcut(shortcut);
    if (cb) o->callback(cb);
    o->user_data(data);
    relayout();
    return o;
}
开发者ID:GustavoMOG,项目名称:efltk,代码行数:81,代码来源:Fl_Menu_add.cpp


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