void
HTMLImageElement::UnbindFromTree(bool aDeep, bool aNullParent)
{
  if (mForm) {
    if (aNullParent || !FindAncestorForm(mForm)) {
      ClearForm(true);
    } else {
      UnsetFlags(MAYBE_ORPHAN_FORM_ELEMENT);
    }
  }

  if (mInDocResponsiveContent) {
    nsIDocument* doc = GetOurOwnerDoc();
    MOZ_ASSERT(doc);
    if (doc) {
      doc->RemoveResponsiveContent(this);
      mInDocResponsiveContent = false;
    }
  }

  if (GetParent() &&
      GetParent()->IsHTMLElement(nsGkAtoms::picture) &&
      HTMLPictureElement::IsPictureEnabled()) {
    // Being removed from picture re-triggers selection, even if we
    // weren't using a <source> peer
    if (aNullParent) {
      QueueImageLoadTask(true);
    }
  }

  nsImageLoadingContent::UnbindFromTree(aDeep, aNullParent);
  nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}
Example #2
0
void ItemPageUI::OnSaveItem()
{
	Item item;
	auto nameIter = m_fieldList.find(reinterpret_cast<int>(HashedString::hash_name("BaseItemComponent")));
	item.name = UtilityFormFunctions::GetTextFromWidget(nameIter->second[0].second);
	
	for (int i = 0; i < m_componentNames.size(); ++i)
	{
		Component newComp;
		newComp.name = m_componentNames[i];
		int compID = reinterpret_cast<int>(HashedString::hash_name(newComp.name.c_str()));
		auto fieldIter = m_fieldList.find(compID);
		for (int j = 0; j < fieldIter->second.size(); ++j)
		{
			Field newField;
			newField.name = fieldIter->second[j].first->GetText();
			newField.value = UtilityFormFunctions::GetTextFromWidget(fieldIter->second[j].second);
			newComp.fields.push_back(newField);
		}

		auto listIter = m_listEntryList.find(compID);
		if (listIter != m_listEntryList.end())
		{
			auto compList = listIter->second;
			List newList;
			newList.name = compList[0][0].first->GetText();
			newList.entryName = UtilityFormFunctions::GetTextFromWidget(compList[0][0].second);
			auto it = compList.begin();
			it++;
			for (; it != compList.end(); ++it)
			{
				ListEntry newListEntry;
				for (int j = 0; j < it->second.size(); ++j)
				{
					Field entryField;
					entryField.name = it->second[j].first->GetText();
					entryField.value = UtilityFormFunctions::GetTextFromWidget(it->second[j].second);
					newListEntry.fields.push_back(entryField);
				}
				newList.entries.push_back(newListEntry);
			}
			newComp.lists.push_back(newList);
		}
		item.components.push_back(newComp);
	}

	m_itemList->SetItemByID(reinterpret_cast<int>(HashedString::hash_name(item.name.c_str())), item);
	
	while (m_itemComboBox->GetItemCount() > 0)
		m_itemComboBox->RemoveItem(0);
	ClearForm();
	PopulateComboBox();
	m_saveItemButton->Show(true);
}
void
RegistrationForm::on_submitRegPushButton_clicked()
{
    if (!ValidateForm())
    {
        QMessageBox msgBox;
        QFont msgBoxFont;
        msgBoxFont.setPointSize(14);
        msgBoxFont.setBold(true);
        msgBox.setWindowTitle("Notice");
        msgBox.setFont(msgBoxFont);
        msgBox.setText("Please enter all required fields");
        msgBox.exec();
        return;
    }
    // All fields have been validated.
    // Create line to be appended file
    QString curLine; // Note: performance here is terrible:
    curLine += ui.firstNameLineEdit->text()
        + "," + ui.lastNameLineEdit->text()
        + "," + ui.gradeComboBox->currentText()
        + "," + ui.schoolLineEdit->text()
        + "," + ui.teenEmailLineEdit->text()
        + "," + ui.parentEmailLineEdit->text()
        + "," + ui.homePhoneLineEdit->text()
        + "," + ui.teenCellLineEdit->text()
        + "," + ui.birthdayLineEdit->text()
        + "," + ui.doyouhaveFacebookComboBox->currentText();
    // Append line to file
    if (!AppendLineToFile(&curLine))
    {
        QMessageBox msgBox;
        QFont msgBoxFont;
        msgBoxFont.setPointSize(14);
        msgBoxFont.setBold(true);
        msgBox.setWindowTitle("Error!");
        msgBox.setFont(msgBoxFont);
        msgBox.setText("Unable to write file: Please get nearest core member!");
        msgBox.exec();
        return;
    }
    // Clear form
    ClearForm();
    // Display "You're done!" box.
    QMessageBox msgBox;
    QFont msgBoxFont;
    msgBoxFont.setPointSize(14);
    msgBoxFont.setBold(true);
    msgBox.setWindowTitle("Contragulations!");
    msgBox.setFont(msgBoxFont);
    msgBox.setText("You have successfully registered!");
    msgBox.exec();
    return;
}
void
HTMLImageElement::UnbindFromTree(bool aDeep, bool aNullParent)
{
    if (mForm) {
        if (aNullParent || !FindAncestorForm(mForm)) {
            ClearForm(true);
        } else {
            UnsetFlags(MAYBE_ORPHAN_FORM_ELEMENT);
        }
    }

    nsImageLoadingContent::UnbindFromTree(aDeep, aNullParent);
    nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}
void
HTMLImageElement::UnbindFromTree(bool aDeep, bool aNullParent)
{
  if (mForm) {
    if (aNullParent || !FindAncestorForm(mForm)) {
      ClearForm(true);
    } else {
      UnsetFlags(MAYBE_ORPHAN_FORM_ELEMENT);
    }
  }

  if (aNullParent &&
      nsINode::GetParentNode()->Tag() == nsGkAtoms::picture &&
      HTMLPictureElement::IsPictureEnabled()) {
    // Being removed from picture re-triggers selection, even if we
    // weren't using a <source> peer
    QueueImageLoadTask();
  }

  nsImageLoadingContent::UnbindFromTree(aDeep, aNullParent);
  nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}
Example #6
0
void ItemPageUI::GenerateForm(Item& item)
{
	ClearForm();
	vector<string> itemCompNames;
	for(int i = 0; i < item.components.size(); ++i)
	{
		m_itemEditBox->Pack(GenerateComponentForm(item.components[i]), false);
		itemCompNames.push_back(item.components[i].name);
	}
	vector<string>::iterator search;
	for (ComponentMap::iterator it = m_components.begin(); it != m_components.end(); it++)
	{
		search = std::find(itemCompNames.begin(), itemCompNames.end(), it->second.name);
		if (search == itemCompNames.end())
			m_itemCompComboBox->AppendItem(it->second.name);
		else
			itemCompNames.erase(search);
	}

	m_addCompBox->Show();
	m_saveItemButton->Show();
}
void __fastcall TForm1::Button2Click(TObject *Sender)
{
  auth_answer a;
  int res = 8000;

  ClearForm();
  memset(&a,0,sizeof(a));

  if(close_day_){
    res = close_day_(&a);

    if(a.Check){
      Memo1->Text = a.Check;
      GlobalFree(a.Check);
    }
    else
      StaticText1->Caption = AnsiString("ќшибка ") + a.RCode;
  }
  else{
    StaticText1->Caption = "close_day() not found";
  }
}
void __fastcall TForm1::SimulatePayment()
{
  auth_answer a;
  int res;

  ClearForm();
  memset(&a,0,sizeof(a));
  a.TType = 1;
  a.Amount = LabeledEdit1->Text.ToInt();

  if(card_authorize_){
    Button3->Enabled = True;
    res = card_authorize_(0, &a);
    StaticText1->Caption = a.AMessage;
    Button3->Enabled = False;
  }
  else
    StaticText1->Caption = "card_authorize() not found";
  if(a.Check){
    Memo1->Text = a.Check;
    GlobalFree(a.Check);
  }
}
void NewJournalCreator::PrimaryConfig(){

    QListWidgetItem *coversheet= ui->DatabaseType->item(0);
    QListWidgetItem *sqlite_db= ui->DatabaseType->item(1);
    QListWidgetItem *mysql_db= ui->DatabaseType->item(2);

    coversheet->setToolTip("<p>Display the cover sheet/introduction page.</p>");
    sqlite_db->setToolTip("<p>Create an empty SQLite-based journal.</p>");
    mysql_db->setToolTip("<p>Create an empty MySQL-based journal.</p>");


    QPushButton *okButton=ui->buttonBox->button(QDialogButtonBox::Ok);
    okButton->setEnabled(false);

    // hide question mark button in title bar when running on Windows
    this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);

    // Create stacked widget
    stack=new QStackedWidget(this);

    stack->addWidget(c=new JournalCreatorCoverPage(this));
    stack->addWidget(s=new SQLiteJournalPage(this));
    stack->addWidget(m=new MySQLJournalPage(this));

    ui->PageArea->setWidget(stack);
    ui->PageArea->setWidgetResizable(true);
    ui->PageArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    ui->PageArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);


    stack->setCurrentIndex(0);
    ui->DatabaseType->setCurrentRow(0);

    // Force the new journal to be set as default if RoboJournal is in First Run mode. This guarantees that
    // there will always be a default journal no matter what.
    if(Buffer::firstrun){
        ui->SetAsDefault->setChecked(true);
        ui->SetAsDefault->setEnabled(false);
    }

    // limit how much the form width can be compressed. New for 0.5, 7/2/13.
    ui->PageArea->setMinimumWidth(s->width());

    // Certain events on the MySQL and SQLite pages muct be controlled by signals/slots because that is
    // the best way to communicate across classes.

    //The MySQL page tells this class to unlock the OK button
    connect(m, SIGNAL(unlockOK()), this, SLOT(unlockOKButton()));

    //The MySQL page tells this class to [re]lock the OK button
    connect(m, SIGNAL(unlockNotOK()), this, SLOT(lockOKButton()));

    // Clicking the Restore Defaults button in this class tells the MySQL page to reset the form if MySQL page is active
    connect(this, SIGNAL(Clear_MySQL()), m, SLOT(ClearForm()));

    //The SQLite page tells this class to unlock the OK button
    connect(s, SIGNAL(unlockOK()), this, SLOT(unlockOKButton()));

    //The SQLite page tells this class to [re]lock the OK button
    connect(s, SIGNAL(unlockNotOK()), this, SLOT(lockOKButton()));

    // Clicking the Restore Defaults button in this class tells the SQLite page to reset the form if SQLite page is active
    connect(this, SIGNAL(Clear_SQLite()), s, SLOT(ClearForm()));

    ui->buttonBox->setContentsMargins(9,3,9,9);
    ui->SetAsDefault->setContentsMargins(9,0,0,0);

    // Hide SQlite option in version 0.5 (2/16/14).
    sqlite_db->setHidden(true);

    // Bugfix: Set min height to be equal to the mysql page (6/7/14)
    this->setMinimumHeight(m->height());
}