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


C++ Fl_Input::value方法代码示例

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


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

示例1: ClickedAddWP

	static void ClickedAddWP(Fl_Widget * w, void * userdata)
	{
		WaypointClient* anInstance = (WaypointClient*) userdata;
		Fl_Input_Choice * fromWPChoice = anInstance->frWps;
		Fl_Input_Choice * toWPChoice = anInstance->toWps;

		Fl_Input * theLat = anInstance->latIn;
		Fl_Input * theLon = anInstance->lonIn;
		Fl_Input * theEle = anInstance->eleIn;
		Fl_Input * theName = anInstance->nameIn;

		string lat(theLat->value());
		string lon(theLon->value());
		string ele(theEle->value());
		string name(theName->value());

		Json::Value wp;
		wp["name"] = name;
		wp["lat"] = atof(lat.c_str());
		wp["lon"] = atof(lon.c_str());
		wp["ele"] = atof(ele.c_str());


		if (anInstance->addWaypoint(wp) == true)
		{
			cout << "Added: 		Waypoint(" << name << "); \n" << endl;
		}
		else
		{
			cout << "Error:			Waypoint(" << name << ") could not be added! \n" << endl;
		}

		buildWaypointList(anInstance);
	}
开发者ID:jsd1710,项目名称:SER321-F14-Assignment5,代码行数:34,代码来源:WaypointClient.cpp

示例2: ClickedModifyWP

	static void ClickedModifyWP(Fl_Widget * w, void * userdata)
	{
		WaypointClient* anInstance = (WaypointClient*) userdata;

		Fl_Input * theLat = anInstance->latIn;
		Fl_Input * theLon = anInstance->lonIn;
		Fl_Input * theEle = anInstance->eleIn;
		Fl_Input * theName = anInstance->nameIn;

		string lat(theLat->value());
		string lon(theLon->value());
		string ele(theEle->value());
		string name(theName->value());

		Json::Value wp;
		wp["name"] = name.c_str();
		wp["lat"] = atof(lat.c_str());
		wp["lon"] = atof(lon.c_str());
		wp["ele"] = atof(ele.c_str());

		anInstance->removeWaypoint(name);
		anInstance->addWaypoint(wp);

		cout << "Modified:	" << name << "(" << lat << ", " << lon << ", " << ele << ", " << name << "); \n" << endl;
		buildWaypointList(anInstance);
	}
开发者ID:jsd1710,项目名称:SER321-F14-Assignment5,代码行数:26,代码来源:WaypointClient.cpp

示例3: BrowseColors

static void BrowseColors(Fl_Widget *wdg, void *arg)
{
	ProjectOptionsDlg* dlg = (ProjectOptionsDlg*)arg;
	Fl_Input *inp = dlg->GetColors();
	const char *dir = fl_file_chooser("Colors File", NULL, inp->value());
	if (dir)
		inp->value(dir);
}
开发者ID:travisgoodspeed,项目名称:basicsynth,代码行数:8,代码来源:OptionsDlg.cpp

示例4: field_select_file_cb

static void field_select_file_cb(Fl_Widget *w, void *data)
{
  Fl_Input *input = (Fl_Input*)data;
  int ret = fileChooser(FILE_CHOOSER_SINGLE, "Choose", "", input->value());
  if(ret){
    input->value(fileChooserGetName(0).c_str());
    input->set_changed();
  }
}
开发者ID:iyer-arvind,项目名称:gmsh,代码行数:9,代码来源:fieldWindow.cpp

示例5: button_callback

void button_callback(Fl_Widget* widget, void* data) {
	Pair* pair = (Pair *)data;
	Fl_Button* button = pair->button;
	Fl_Input* input = pair->input;
	button->label(input->value());

	printf(input->value());

}
开发者ID:Anaph,项目名称:code,代码行数:9,代码来源:cpp.cpp

示例6: DirectoryChooser

void DirectoryChooser(Fl_Widget *widget, void *text){
    Fl_Input *dirfield = (Fl_Input *)text;
    char *dir = fl_dir_chooser("Select a directory to use as the startup directory", dirfield->value(), 1);

    if(dir==NULL){
        return;
    }

    dirfield->value(dir);

    dirfield->do_callback();

}
开发者ID:FlyingJester,项目名称:tsconf,代码行数:13,代码来源:tsconf-system.cpp

示例7: cb_setFilterKernalSize

void ImpressionistUI::cb_setFilterKernalSize(Fl_Widget *o, void *v) {
    ImpressionistUI *pUI = (ImpressionistUI*)o->user_data();
    int width = atoi(pUI->m_filterWidthInput->value());
    int height = atoi(pUI->m_filterHeightInput->value());
    if (width <= 0 || height <= 0) {
        fl_message("Width or Height cannot be less than 0");
        return;
    } else {
        pUI->m_filterSizeDialog->hide();
        pUI->m_nFilterWidth = width;
        pUI->m_nFilterHeight = height;
        pUI->m_filterKernalDialog = new Fl_Window(60 + 30 * width + 10 * (width - 1), 60 + 30 * width + 10 * (width - 1) + 50, "Filter Kernal");
        pUI->m_filterKernalEntries.clear();
        for (int j = 0; j < height; j++) {
            for (int i = 0; i < width; i++) {
                Fl_Input *filterEntry = new Fl_Input(60 + 30 * i + 10 * i, 30 * j + 10 * j, 30, 30, "");
                filterEntry->value("1.0");
                pUI->m_filterKernalEntries.push_back(filterEntry);
            }
        }
        pUI->m_applyFilterKernalButton = new Fl_Button(0, 60 + 30 * width + 10 * (width - 1) + 20, 50, 20, "Apply");
        pUI->m_applyFilterKernalButton->user_data((void *)(pUI));
        pUI->m_applyFilterKernalButton->callback(cb_applyFilterKernal);
        pUI->m_filterKernalDialog->end();
        pUI->m_filterKernalDialog->show();
    }
}
开发者ID:cychiuae,项目名称:comp4411-project1-impressionist,代码行数:27,代码来源:ImpressionistUI.cpp

示例8: 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

示例9: button_cb

void WidgetTable::button_cb(Fl_Widget *w, void * p)
{
	fprintf(stderr, "BUTTON: %s\n", (const char*)w->label());



	WidgetTable * myTable = static_cast<WidgetTable*>(p);		//WidgetTable * myTable = (WidgetTable*)(p);
	UserInterface * myUserInterface = static_cast<UserInterface*>(myTable->ptr_to_UserInterface);		//UserInterface * myUserInterface = (UserInterface*)(myTable->ptr_to_UserInterface);

	int  myRow = 8, myColumn = 8;
	
	//std::stringstream buffer;


	Fl_Widget * myWidget = myTable->GetElement(myRow, myColumn);
	Fl_Input * myCell = dynamic_cast<Fl_Input*>(myWidget);

	myWidget = myTable->GetElement(myRow, myColumn);
	
	My_fl_button * myFlButton = (My_fl_button*)w;

	std::cout << std::endl << myFlButton->x_pos << std::endl;
	std::cout << myFlButton->y_pos << std::endl;

	myCell = dynamic_cast<Fl_Input*>(myWidget);

	myCell->value("try");
	myUserInterface->textDisplayString << "button pressed" << std::endl;
	myUserInterface->textBuffer->text((myUserInterface->textDisplayString).str().c_str());

	myTable->printInTable(6, 6, "text", myTable);

}
开发者ID:pytton,项目名称:fluidUI.new,代码行数:33,代码来源:UserInterface.cpp

示例10: curframe_cb

static void curframe_cb(Fl_Widget *w, void *v) {
  Fl_Input *inp = (Fl_Input *)w;
  VMDApp *app = (VMDApp *)v;
  int val = atoi(inp->value());
  int max = app->molecule_numframes(app->molecule_top());
  if (val < 0) val = 0;
  if (val >= max) val = max-1;
  app->animation_set_frame(val);
}
开发者ID:VictorMion,项目名称:vmd-cvs-github,代码行数:9,代码来源:MainFltkMenu.C

示例11: printInTable

void WidgetTable::printInTable(int row, int col, std::string text, WidgetTable * myWidgetPointer)//this causes trouble
{
	WidgetTable * myTable = myWidgetPointer;
	Fl_Widget * myWidget = (Fl_Widget*) (myTable->GetElement(row, col));
	Fl_Input * myCell = (Fl_Input*)(myWidget);
	std::stringstream buffer;
	buffer << text;
	myCell->value(buffer.str().c_str());
}
开发者ID:pytton,项目名称:fluidUI.new,代码行数:9,代码来源:UserInterface.cpp

示例12: load

void IconChooser::load(const char* dir) {
	/* copy directory name to input box and internal String so it can be reused later */
	path->value(dir);
	start = dir;

	list<String> lst;
	if(!dir_list(dir, lst, true))
		return;

	load_from_list(lst);
}
开发者ID:edeproject,项目名称:svn,代码行数:11,代码来源:IconChooser.cpp

示例13: uiBasis

uiBasis:: uiBasis( Fl_Group &tabs, const BasisInfo  &bi ) :
name( bi.name ),
group( new Fl_Group( tabs.x(), tabs.y()+24, tabs.w(), tabs.h()-24, bi.name.c_str() ) ),
input()
{
    //--------------------------------------------------------------------------
    // record the new tab
    //--------------------------------------------------------------------------
    tabs.add(group);
    group->labelfont( FL_COURIER );
    group->labelsize( 14 );
  
    
    
    static const int bh = 23;
    
    //--------------------------------------------------------------------------
    // create the parameters
    //--------------------------------------------------------------------------
    const int    h     = group->h();
    const size_t nb    = bi.param.size();
    const int    hfree = h - nb * bh;
    const int    hskip = hfree/(nb+1);
    
    int       y = group->y();
    const int x = group->x() + 8;

    for( size_t i=1; i <= nb; ++i )
    {
        y += hskip;
        const string &param = bi.param[i];
        Fl_Input *box = new Fl_Input(x,y,100,bh,param.c_str());
        box->input_type(FL_FLOAT_INPUT);
        box->labeltype( FL_NORMAL_LABEL );
        box->align(FL_ALIGN_RIGHT);
        box->labelfont(FL_HELVETICA);
        box->labelsize(12);
        box->textsize(12);
        box->textfont(FL_HELVETICA);
        group->add(box);
        box->value("0.0");
        y += bh;
        input.push_back(box);
        box->callback(ChangeCB);
        box->when(FL_WHEN_RELEASE);
    }
    
    
    
}
开发者ID:ybouret,项目名称:convivial2,代码行数:50,代码来源:basis.cpp

示例14: onelab_connect_remote_server_cb

void onelab_connect_remote_server_cb(Fl_Widget *w, void *data)
{
  Fl_Input *serverAddr = (Fl_Input *)data;
  std::string address = serverAddr->value();
  std::size_t colon = address.find(":");
  GmshNetworkClient *c = OnelabDatabase::instance()->useAsNetworkClient(
    ip4_inet_pton(address.substr(0, colon).c_str()),
    atoi(address.substr(colon+1, address.size()-colon-1).c_str()),
    "GUI");
  if(c == NULL) {
    Msg::Error("Unable to connect ONELAB server (%s)", address.c_str());
    Msg::Exit(1);
  }
  else if(FlGui::available()) // FIXME
    c->setCallback(FlGui::instance()->onelab);
}
开发者ID:kevinr2763,项目名称:gmsh,代码行数:16,代码来源:OnelabWindow.cpp

示例15: onelab_listen_unix_cb

void onelab_listen_unix_cb(Fl_Widget *w, void *data)
{
  Fl_Check_Button *checkbutton = (Fl_Check_Button *)w;
  Fl_Input *sockUNIX = (Fl_Input *)data;
  if(checkbutton->value() == 1) {
    sockUNIX->deactivate();
    CTX::instance()->onelab.unixSock = sockUNIX->value();
    std::size_t colon = CTX::instance()->onelab.unixSock.find(":");
    std::ostringstream tmp;
    tmp << CTX::instance()->homeDir << CTX::instance()->onelab.unixSock;
    OnelabServer::instance()->listenOnUnix(tmp.str().c_str());
  }
  else {
    sockUNIX->activate();
    OnelabServer::instance()->stopUnix();
  }
}
开发者ID:kevinr2763,项目名称:gmsh,代码行数:17,代码来源:OnelabWindow.cpp


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