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


C++ Form类代码示例

本文整理汇总了C++中Form的典型用法代码示例。如果您正苦于以下问题:C++ Form类的具体用法?C++ Form怎么用?C++ Form使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: LoadImage

void
CropForm::OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId,
		const Tizen::Base::String& operationId,
		const Tizen::App::AppCtrlResult appControlResult,
		const Tizen::Base::Collection::IMap* pResultList)
{
	if (appId.Equals(L"tizen.filemanager", true) && operationId.Equals(L"http://tizen.org/appcontrol/operation/pick", true))
	{
		AppCtrlResult selectResult = appControlResult;
		if (selectResult == APP_CTRL_RESULT_SUCCEEDED)
		{
			//Get the file name
			result r ;
			String filename;
			String* pFilePath ;
			pFilePath = (String*)(Tizen::Base::String*)pResultList->GetValue(String(L"path"));
			LoadImage(pFilePath);
		}
		else
		{
			result r;
			Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
			Form *pForm = (Form*)pFrame->GetControl(MAIN_FORM_NAME, false);
			if(pForm)
			{
				r = pFrame->SetCurrentForm(*pForm);
				pForm->Draw();
				pForm->Show();
				pFrame->RemoveControl(*this);
			}
		}
	}
}
开发者ID:CoCoTeam,项目名称:TizenGameHub,代码行数:33,代码来源:CropForm.cpp

示例2: evaluate_goal

// ----------------------------------------------------------------------------
double AdaptiveLinearVariationalSolver::
evaluate_goal(Form& M, std::shared_ptr<const Function> u) const
{
  dolfin_assert(M.num_coefficients() > 0);
  M.set_coefficient(M.num_coefficients() - 1, u);
  return assemble(M);
}
开发者ID:Rlahuerta,项目名称:dolfin,代码行数:8,代码来源:AdaptiveLinearVariationalSolver.cpp

示例3: WContainerWidget

FormExample::FormExample()
    : WContainerWidget()
{
  WContainerWidget *langLayout = this->addWidget(cpp14::make_unique<WContainerWidget>());
  langLayout->setContentAlignment(AlignmentFlag::Right);
  langLayout->addWidget(cpp14::make_unique<WText>(tr("language")));

  const char *lang[] = { "en", "nl" };

  for (int i = 0; i < 2; ++i) {
    WText *t = langLayout->addWidget(cpp14::make_unique<WText>(lang[i]));
    t->setMargin(5);
    t->clicked().connect(std::bind(&FormExample::changeLanguage, this, t));

    languageSelects_.push_back(t);
  }

  /*
   * Start with the reported locale, if available
   */
  setLanguage(wApp->locale().name());

  Form *form = this->addWidget(cpp14::make_unique<Form>());
  form->setMargin(20);
}
开发者ID:AlexanderKotliar,项目名称:wt,代码行数:25,代码来源:FormExample.C

示例4: syntax_err

// Obtain the name of the RegMask for an InstructForm
const char *ArchDesc::reg_mask(InstructForm &inForm) {
  const char *result = inForm.reduce_result();

  if (result == NULL) {
    syntax_err(inForm._linenum,
               "Did not find result operand or RegMask"
               " for this instruction: %s",
               inForm._ident);
    abort();
  }

  // Instructions producing 'Universe' use RegMask::Empty
  if( strcmp(result,"Universe")==0 ) {
    return "RegMask::Empty";
  }

  // Lookup this result operand and get its register class
  Form *form = (Form*)_globalNames[result];
  if (form == NULL) {
    syntax_err(inForm._linenum,
               "Did not find result operand for result: %s", result);
    abort();
  }
  OperandForm *oper = form->is_operand();
  if (oper == NULL) {
    syntax_err(inForm._linenum, "Form is not an OperandForm:");
    form->dump();
    abort();
  }
  return reg_mask( *oper );
}
开发者ID:WillDignazio,项目名称:hotspot,代码行数:32,代码来源:archDesc.cpp

示例5: main

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QWidget window;

    QLabel* title = new QLabel("Custom widgets on a QListWidget");
    title->setAlignment(Qt::AlignHCenter);

    QListWidget* list = new QListWidget;
    list->addItem("foo");


    for (int i = 0; i < 5; i++){
        QListWidgetItem* item;
        item = new QListWidgetItem(list);
        list->addItem(item);
//        QPushButton* button = new QPushButton("hey");
        Form *f = new Form;
        item->setSizeHint(f->minimumSizeHint());
        list->setItemWidget(item, f);
    }
    list->addItem("bar");

    QVBoxLayout* layout = new QVBoxLayout(&window);
    layout->addWidget(title);
    layout->addWidget(list);
    window.setLayout(layout);

    window.show();

    return a.exec();
}
开发者ID:manashmndl,项目名称:QtCppSolutions,代码行数:32,代码来源:main.cpp

示例6: dump

 void dump() {
   reset();
   Form *cur;
   for(; (cur =  iter()) != NULL; ) {
     cur->dump();
   };
 }
开发者ID:641252154,项目名称:HotSpot-JVM-Linux-x86-Research,代码行数:7,代码来源:forms.hpp

示例7: output

 void output(FILE* fp) {
   reset();
   Form *cur;
   for( ; (cur =  iter()) != NULL; ) {
     cur->output(fp);
   };
 }
开发者ID:641252154,项目名称:HotSpot-JVM-Linux-x86-Research,代码行数:7,代码来源:forms.hpp

示例8: buildMList

// Recursive call for construction of match lists
void ArchDesc::buildMList(MatchNode *node, const char *rootOp,
                          const char *resultOp, Predicate *pred,
                          const char *cost) {
  const char *leftstr, *rightstr;
  const char *resultop;
  const char *opcode;
  MatchNode  *mnode;
  Form       *form;

  leftstr = rightstr = NULL;
  // Do not process leaves of the Match Tree if they are not ideal
  if ((node) && (node->_lChild == NULL) && (node->_rChild == NULL) &&
      ((form = (Form *)_globalNames[node->_opType]) != NULL) &&
      (!form->ideal_only())) {
    return;
  }

  // Identify index position among ideal operands
  intptr_t    index     = _last_opcode;
  const char *indexStr  = node ? node->_opType : (char *) " ";
  index            = (intptr_t)_idealIndex[indexStr];
  if (index == 0) {
    fprintf(stderr, "error: operand \"%s\" not found\n", indexStr);
    assert(0, "fatal error");
  }

  // Build MatchLists for children
  // Check each child for an internal operand name, and use that name
  // for the parent's matchlist entry if it exists
  mnode = node->_lChild;
  if (mnode) {
    buildMList(mnode, NULL, NULL, NULL, NULL);
    leftstr = mnode->_internalop ? mnode->_internalop : mnode->_opType;
  }
  mnode = node->_rChild;
  if (mnode) {
    buildMList(mnode, NULL, NULL, NULL, NULL);
    rightstr = mnode->_internalop ? mnode->_internalop : mnode->_opType;
  }
  // Grab the string for the opcode of this list entry
  if (rootOp == NULL) {
    opcode = (node->_internalop) ? node->_internalop : node->_opType;
  } else {
    opcode = rootOp;
  }
  // Grab the string for the result of this list entry
  if (resultOp == NULL) {
    resultop = (node->_internalop) ? node->_internalop : node->_opType;
  }
  else resultop = resultOp;
  // Search for an identical matchlist entry already on the list
  if ((_mlistab[index] == NULL) || (_mlistab[index] &&
                                    !_mlistab[index]->search(opcode, resultop, leftstr, rightstr, pred))) {
    // Place this match rule at front of list
    MatchList *mList =
      new MatchList(_mlistab[index],pred,cost,
                    opcode, resultop, leftstr, rightstr);
    _mlistab[index] = mList;
  }
}
开发者ID:WillDignazio,项目名称:hotspot,代码行数:61,代码来源:archDesc.cpp

示例9:

void	OfficeBlock::doBureaucracy(const std::string& form_name, const std::string& target) const
{
	if (this->_intern && this->_b_sign && this->_b_exec)
	{
		Form 	*f = this->_intern->makeForm(form_name, target);
		if (f)
		{
			std::cout << "Intern make a form of type \"" << form_name << "\": " << *f;
			f->beSigned(*this->_b_sign);
			std::cout << "Bureaucrat " << this->_b_sign->getName() << " signed the form " << f->getName() << std::endl;
			f->execute(*this->_b_exec);
			std::cout << "Bureaucrat " << this->_b_exec->getName() << " execute the form " << f->getName() << std::endl;
			delete f;
		} else {
			std::cerr << "Intern can't make a Form of type \"" << form_name << "\"" << std::endl;
		}
	} else {
		if (!this->_intern)
			std::cerr << "An Intern is required in OfficeBlock" << std::endl;
		if (!this->_b_sign)
			std::cerr << "An Bureaucrat is required in OfficeBlock to sign the form" << std::endl;
		if (!this->_b_exec)
			std::cerr << "An Bureaucrat is required in OfficeBlock to execute the form" << std::endl;
	}
}
开发者ID:alex8092,项目名称:cpp,代码行数:25,代码来源:OfficeBlock.cpp

示例10:

void UITransform::transformForm2Object(Form& form, SkillsInformation& info)
{
	info.setCategoryId( form.getText("Category Id"));
	info.setSkillDescription( form.getText("Skill Description"));
	info.setSkillId( form.getText("Skill Id"));
	info.setSkillName(form.getText("Skill Name"));
	info.setStatus( form.getText("Skill Status"));
}
开发者ID:RKM22,项目名称:HRSapp,代码行数:8,代码来源:UITransform.cpp

示例11: Form

Form* Form::create(const char* id, Theme::Style* style, Layout::Type layoutType)
{
	Form* form = new Form();
	form->_id = id ? id : "";
	form->_layout = createLayout(layoutType);
	form->initialize("Form", style, NULL);
	return form;
}
开发者ID:dtbinh,项目名称:Game3D,代码行数:8,代码来源:Form.cpp

示例12: main

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Form w;

    w.show();
    return a.exec();
}
开发者ID:choudhariashish,项目名称:Pluto,代码行数:8,代码来源:main.cpp

示例13: main

int main(int argc, char *argv[])
{
  QApplication app(argc, argv);
  Form form;

  form.show();
  return app.exec();
}
开发者ID:NahomKidane,项目名称:QtExamples,代码行数:8,代码来源:main.cpp

示例14: setMultiTouch

void FormsSample::initialize()
{
    setMultiTouch(true);
    setVsync(false);

    _formSelect = Form::create("res/common/forms/formSelect.form");
    _formSelect->setFocus();

    RadioButton* form0Button = static_cast<RadioButton*>(_formSelect->getControl("form0"));
    form0Button->addListener(this, Control::Listener::CLICK);

    RadioButton* form1Button = static_cast<RadioButton*>(_formSelect->getControl("form1"));
    form1Button->addListener(this, Control::Listener::CLICK);

    RadioButton* form2Button = static_cast<RadioButton*>(_formSelect->getControl("form2"));
    form2Button->addListener(this, Control::Listener::CLICK);
    
    RadioButton* form3Button = static_cast<RadioButton*>(_formSelect->getControl("form3"));
    form3Button->addListener(this, Control::Listener::CLICK);

    RadioButton* form4Button = static_cast<RadioButton*>(_formSelect->getControl("form4"));
    form4Button->addListener(this, Control::Listener::CLICK);
    
    RadioButton* form5Button = static_cast<RadioButton*>(_formSelect->getControl("form5"));
    form5Button->addListener(this, Control::Listener::CLICK);
    for (unsigned int i = 0; i < _formFiles.size(); i++)
    {
		Form* form = Form::create(_formFiles[i]);
        form->setEnabled(false);
        _forms.push_back(form);
    }
    _formIndex = 0;

    // Create a form programmatically.
    createSampleForm();

    Button* button = static_cast<Button*>(_forms[0]->getControl("testButton"));
    button->setFocus();

    // Create a scene with a camera node.
    Camera* camera = Camera::createPerspective(45.0f, (float)getWidth() / (float)getHeight(), 0.25f, 100.0f);
    _scene = Scene::create();
    Node* cameraNode = _scene->addNode("Camera");
    cameraNode->setCamera(camera);
    _scene->setActiveCamera(camera);
    SAFE_RELEASE(camera);
    _formNodeParent = _scene->addNode("FormParent");
    _formNode = Node::create("Form");
    _formNodeParent->addChild(_formNode);
    
    formChanged();

    _gamepad = getGamepad(0);
    // This is needed because the virtual gamepad is shared between all samples.
    // SamplesGame always ensures the virtual gamepad is disabled when a sample is exited.
    if (_gamepad && _gamepad->isVirtual())
        _gamepad->getForm()->setEnabled(true);
}
开发者ID:,项目名称:,代码行数:58,代码来源:

示例15: main

int main( int argc, char ** argv )
{
	QApplication a(argc, argv);
	Form f;

	f.show();

	return a.exec();
}
开发者ID:Cnotinfor,项目名称:CnotiMind,代码行数:9,代码来源:main.cpp


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