示例#1
0
void	PhotoGraphicsItem::mousePressEvent ( QGraphicsSceneMouseEvent * event )
{
    if (isEnabled() && deleteRect().contains(event->pos()))
    {
        if (scene())
        {
            if (scene()->views().count())
            {
                bool vResult = question(scene()->views().at(0)->parentWidget()
                                      , TRANSLATE("Удалить фото")
                                      , TRANSLATE("Вы действительно хотите удалить фотографию?")
                                                    );
                if (vResult)
                {
                    ((GalleryGrapicsScene*)scene())->remove(id());
                }
            }
        }

    }
    else
    {
        setActive();
    }
}
  //
  // Retrieve
  //
  // Retrieve data from the task, return TRUE if filled
  //
  Bool UnitConstruct::Retrieve(U32 id, RetrievedData &data)
  {
    switch (id)
    {
      case TaskRetrieve::Progress:
      {
        data.f1 = GetProgress();
        data.u1 = GetNameCrc();
        return (TRUE);
      }

      case TaskRetrieve::Info:
      {
        // Are we constructing
        if (inst.Test(0x4E5A04E4)) // "Construct"
        {
          data.s2 = TRANSLATE(("#game.client.hud.tasks.construct.process"));
          return (TRUE);
        }

        if (inst.Test(0xF073DD95)) // "Paused"
        {
          data.s2 = TRANSLATE(("#game.client.hud.tasks.construct.paused"));
          return (TRUE);
        }

        return (FALSE);
      }
    }

    return (GameTask<UnitObjType, UnitObj>::Retrieve(id, data));
  }
示例#3
0
bool CPetRooms::setupControl(CPetControl *petControl) {
	_petControl = petControl;
	if (!petControl)
		return false;

	Rect rect1(0, 0, 470, TRANSLATE(15, 32));
	rect1.moveTo(32, TRANSLATE(445, 439));
	_text.setBounds(rect1);
	_text.setHasBorder(false);

	Rect rect2(0, 0, 81, 81);
	_plinth.setBounds(rect2);
	_plinth.translate(494, 374);

	_chevLeftOnDim = petControl->getHiddenObject("3PetChevLeftOnDim");
	_chevLeftOffDim = petControl->getHiddenObject("3PetChevLeftOffDim");
	_chevRightOnDim = petControl->getHiddenObject("3PetChevRightOnDim");
	_chevRightOffDim = petControl->getHiddenObject("3PetChevRightOffDim");
	_chevLeftOnLit = petControl->getHiddenObject("3PetChevLeftOnLit");
	_chevLeftOffLit = petControl->getHiddenObject("3PetChevLeftOffLit");
	_chevRightOnLit = petControl->getHiddenObject("3PetChevRightOnLit");
	_chevRightOffLit = petControl->getHiddenObject("3PetChevRightOffLit");

	_glyphs.setup(6, this);
	_glyphs.setFlags(GFLAG_16);
	_glyphItem.setup(petControl, &_glyphs);
	_glyphItem.setFlag(1);
	return true;
}
示例#4
0
static LOGICAL canMine( P_CHAR pc, P_ITEM weapon )
{

	VALIDATEPCR(pc,false);
	
	if( !ISVALIDPI(weapon) && ( pc->CountItemsByType(ITYPE_MINING) <= 0 ) )
			pc->sysmsg( TRANSLATE("You must have a pickaxe or shovel in hand in order to mine."));
	else
	{
		if ( (ISVALIDPI(weapon) && ( weapon->getType() == ITYPE_MINING )) || (pc->CountItemsByType(ITYPE_MINING) > 0 ))
		// Let's see if he has a shovel in his pack
		{
			if (pc->isMounting())
				pc->sysmsg( TRANSLATE("You cant mine while on a horse!"));
			else
				if( !pc->IsGM() && (ores.stamina<0) && (abs( ores.stamina )>pc->stm) )
					pc->sysmsg( TRANSLATE("You are too tired to mine."));
				else
					return true;
					
		}
	}

	return false;
}
示例#5
0
bool CurrencyBox::Validate(bool alert)
{
	if(strlen(Text())<1)
		SetText("0");

	Fixed amount;
	if(gCurrentLocale.StringToCurrency(Text(),amount)!=B_OK)
	{
		if(alert)
		{
			ShowAlert(TRANSLATE("Capital Be didn't understand the amount."),
						TRANSLATE("There may be a typo or the wrong kind of currency symbol "
						"for this account."));
			MakeFocus(true);
		}
		return false;
	}
	else
	{
		BString string;
		gCurrentLocale.CurrencyToString(amount,string);
		SetText(string.String());
	}
	
	return true;
}
示例#6
0
/*!
\brief Check if the player is skilled enough and have requested items
\return bool can or can't 
\param pc the player
\param inMenu if write a sysmessage on error
\todo Add message if haven't enough item..
*/
bool cMakeItem::checkReq( P_CHAR pc, bool inMenu, cRawItem* def )
{

    if( pc->IsGM() ) 
		return true;

    if( (skillToCheck!=INVALID) && (pc->skill[skillToCheck]<minskill) ) {
        if( !inMenu ) 
			pc->sysmsg(TRANSLATE("You're not enough skilled"));
        return false;
    }

	for( int i=0; i<2; ++i ) {
        cRawItem& raw = reqitems[i];
		if( raw.id!=0 ) {
			bool have = ( def!=NULL )? (def[i].number>=raw.number) : ( pc->CountItems( raw.id, raw.color)>= raw.number );
			if( !have ) {
				if( !inMenu )
					pc->sysmsg(TRANSLATE("You've not enough resources"));
				return false;
			}
        }
    }


    return true;
}
示例#7
0
BudgetWindow::BudgetWindow(const BRect &frame)
 :	BWindow(frame,TRANSLATE("Budget"), B_DOCUMENT_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS),
 	fIncomeGrid(13,0),
 	fSpendingGrid(13,0)
{
	fBackView = new BView("background",B_WILL_DRAW);
	BLayoutBuilder::Group<>(this, B_VERTICAL, 0.0f)
		.SetInsets(0)
		.Add(fBackView)
	.End();
	fBackView->SetViewColor(240,240,240);

	fBar = new BMenuBar("menubar");
	fBar->AddItem(new BMenuItem(TRANSLATE("Recalculate All"),new BMessage(M_BUDGET_RECALCULATE)));
	fBar->AddItem(new BMenuItem(TRANSLATE("Set All to Zero"),new BMessage(M_BUDGET_ZERO)));

	BuildBudgetSummary();
	BuildStatsAndEditor();
	BuildCategoryList();

	BFont font;
	BLayoutBuilder::Group<>(fCatBox, B_VERTICAL, 0.0f)
		.SetInsets(10, font.Size() * 1.3, 10, 10)
		.Add(fAmountLabel)
		.Add(fAmountBox)
		.AddGrid(B_USE_DEFAULT_SPACING, 1.0f)
			.Add(fMonthly, 0, 0)
			.Add(fWeekly, 1, 0)
			.Add(fQuarterly, 0, 1)
			.Add(fAnnually, 1, 1)
		.End()	
	.End();
	fAmountBox->SetText("");

	fAmountBox->GetFilter()->SetMessenger(new BMessenger(this));

	if(gDatabase.CountBudgetEntries()==0)
		GenerateBudget(false);

	RefreshBudgetGrid();
	RefreshCategories();
	RefreshBudgetSummary();
	fCategoryList->MakeFocus(true);
	
	BLayoutBuilder::Group<>(fBackView, B_VERTICAL, 0.0f)
		.SetInsets(0)
		.Add(fBar)
		.AddGroup(B_VERTICAL)
			.SetInsets(10, 10, 10, 10)
			.AddGroup(B_HORIZONTAL)
				.Add(fCategoryList)
				.AddGroup(B_VERTICAL)
					.Add(fCatBox)
					.Add(fCatStat)
				.End()
			.End()
			.Add(fBudgetSummary)
		.End()
	.End();	
}
static void
print_entry (GOptionGroup       *group,
	     gint                max_length,
	     const GOptionEntry *entry)
{
  GString *str;

  if (entry->flags & G_OPTION_FLAG_HIDDEN)
    return;

  if (entry->long_name[0] == 0)
    return;

  str = g_string_new (NULL);
  
  if (entry->short_name)
    g_string_append_printf (str, "  -%c, --%s", entry->short_name, entry->long_name);
  else
    g_string_append_printf (str, "  --%s", entry->long_name);
  
  if (entry->arg_description)
    g_string_append_printf (str, "=%s", TRANSLATE (group, entry->arg_description));
  
  g_print ("%-*s %s\n", max_length + 4, str->str,
	   entry->description ? TRANSLATE (group, entry->description) : "");
  g_string_free (str, TRUE);  
}
  //
  // Retrieve
  //
  // Retrieve data from the task, return TRUE if filled
  //
  Bool UnitRecycle::Retrieve(U32 id, RetrievedData &data)
  {
    switch (id)
    {
      case TaskRetrieve::Progress:
        data.u1 = GetNameCrc();
        data.f1 = GetProgress();
        return (TRUE);

      case TaskRetrieve::Info:
      {
        if (inst.Test(0xB9EBA067)) // "Decycle"
        {
          data.s2 = TRANSLATE(("#game.client.hud.tasks.recycle.cancel"));
        }
        else
        {
          data.s2 = TRANSLATE(("#game.client.hud.tasks.recycle.process"));
        }
        return (TRUE);
      }
    }

    return (GameTask<UnitObjType, UnitObj>::Retrieve(id, data));
  }
示例#10
0
static bool ItemDroppedOnTrainer(NXWCLIENT ps, PKGx08 *pp, P_ITEM pi)
{
	if (ps == NULL) return false;
	VALIDATEPIR(pi, false);
	NXWSOCKET  s = ps->toInt();
	P_CHAR pc = ps->currChar();
	VALIDATEPCR(pc,false);
	P_CHAR pc_t = pointers::findCharBySerial(pp->Tserial);
	VALIDATEPCR(pc_t,false);

	if( pi->getId() == ITEMID_GOLD )
	{ // They gave the NPC gold
		UI08 sk=pc_t->trainingplayerin;
		pc_t->talk( s, TRANSLATE("I thank thee for thy payment. That should give thee a good start on thy way. Farewell!"),0);

		int sum = pc->getSkillSum();
		int delta = pc_t->getTeachingDelta(pc, sk, sum);

		if(pi->amount>delta) // Paid too much
		{
			pi->amount-=delta;

			Sndbounce5(s);
			if (ps->isDragging())
			{
				ps->resetDragging();
				item_bounce5(s,pi);
			}
		}
		else
		{
			if(pi->amount < delta)		// Gave less gold
				delta = pi->amount;		// so adjust skillgain
			pi->Delete();
		}
		pc->baseskill[sk]+=delta;
		Skills::updateSkillLevel(pc, sk);
		updateskill(s,sk);

		pc->trainer=-1;
		pc_t->trainingplayerin=0xFF;
		pc->playSFX( itemsfx(pi->getId()) );
	}
	else // Did not give gold
	{
		pc_t->talk( s, TRANSLATE("I am sorry, but I can only accept gold."),0);
		Sndbounce5(s);
		if (ps->isDragging())
		{
			ps->resetDragging();
			item_bounce5(s,pi);
		}
	}//if items[i]=gold
	return true;
}
示例#11
0
bool CMusicSliderSpeed::MusicSettingChangedMsg(CMusicSettingChangedMsg *msg) {
	if (_enabled) {
		if (++_controlVal > _controlMax)
			_controlVal = 0;

		loadFrame(3 - _controlVal);
		playSound(TRANSLATE("z#54.wav", "z#585.wav"), 50);
	} else {
		playSound(TRANSLATE("z#46.wav", "z#577.wav"));
	}

	return true;
}
  //
  // BuildSideList
  //
  void SideListBox::BuildSideList()
  {
    DeleteAllItems();

    if (random)
    {
      AddTextItem("Random", TRANSLATE(("#game.sides.random")));
    }

    for (NBinTree<Sides::Side>::Iterator sides(&Sides::GetSides()); *sides; sides++)
    {
      AddTextItem((*sides)->GetName().str, TRANSLATE(((*sides)->GetDescription().str)));
    }
  }
示例#13
0
void BudgetWindow::BuildCategoryList(void)
{
	rgb_color white = {255,255,255,255};

	fCategoryList = new BColumnListView("categorylist",
										B_WILL_DRAW | B_NAVIGABLE,B_FANCY_BORDER, true);
	fCategoryList->SetSortingEnabled(false);
	fCategoryList->SetSelectionMessage(new BMessage(M_SELECT_CATEGORY));
	fCategoryList->AddColumn(new BStringColumn(TRANSLATE("Category"),
											fCategoryList->StringWidth(TRANSLATE("Category"))+20,
											10,300,B_TRUNCATE_END),0);
	fCategoryList->AddColumn(new BStringColumn(TRANSLATE("Amount"),
											fCategoryList->StringWidth(TRANSLATE("Amount"))+20,
											10,300,B_TRUNCATE_END,B_ALIGN_RIGHT),1);
	fCategoryList->AddColumn(new BStringColumn(TRANSLATE("Frequency"),
											fCategoryList->StringWidth(TRANSLATE("Frequency"))+20,
											10,300,B_TRUNCATE_END,B_ALIGN_RIGHT),2);
	fCategoryList->SetColumnFlags(B_ALLOW_COLUMN_RESIZE);

	fIncomeRow = new BRow();
	fCategoryList->AddRow(fIncomeRow);
	fSpendingRow = new BRow();
	fCategoryList->AddRow(fSpendingRow);
	fIncomeRow->SetField(new BStringField(TRANSLATE("Income")),0);
	fSpendingRow->SetField(new BStringField(TRANSLATE("Spending")),0);

	fCategoryList->SetColor(B_COLOR_BACKGROUND,white);
	fCategoryList->SetColor(B_COLOR_SELECTION,GetColor(BC_SELECTION_FOCUS));
	fCategoryList->SetColor(B_COLOR_NON_FOCUS_SELECTION,GetColor(BC_SELECTION_NOFOCUS));
	fCategoryList->SetColor(B_COLOR_SEPARATOR_BORDER,white);
	fCategoryList->SetColor(B_COLOR_SEPARATOR_LINE,white);
	fCategoryList->SetColor(B_COLOR_HEADER_BACKGROUND,GetColor(BC_GRID_HEADER));
}
示例#14
0
static bool ItemDroppedOnGuard(NXWCLIENT ps, PKGx08 *pp, P_ITEM pi)
{
	if (ps == NULL)
		return false;
	VALIDATEPIR(pi, false);
	char temp[TEMP_STR_SIZE]; //xan -> this overrides the global temp var
	NXWSOCKET  s=ps->toInt();
	P_CHAR pc = ps->currChar();
	VALIDATEPCR(pc,false);

	P_CHAR pc_t=pointers::findCharBySerial(pp->Tserial); //the guard
	VALIDATEPCR(pc_t,false);
	// Search for the key word "the head of"
	if( strstr( pi->getCurrentNameC(), "the head of" ) ) //!!! Wrong! it must check the ItemID, not the name :(
	{
		// This is a head of someone, see if the owner has a bounty on them
		P_CHAR own=pointers::findCharBySerial(pi->getOwnerSerial32());
		VALIDATEPCR(own,false);

		if( own->questBountyReward > 0 )
		{
			// Give the person the bounty assuming that they are not the
			// same person as the reward is for
			if( pc->getSerial32() != own->getSerial32() )
			{
				// give them the gold for bringing the villan to justice
				addgold( s, own->questBountyReward );
				pc->playSFX( goldsfx( own->questBountyReward ) );

				// Now thank them for their hard work
				sprintf( temp, TRANSLATE("Excellent work! You have brought us the head of %s. Here is your reward of %d gold coins."),
					own->getCurrentNameC(), own->questBountyReward );
				pc_t->talk( s, temp, 0);

				// Delete the Bounty from the bulletin board
				BountyDelete(own );

				// xan : increment fame & karma :)
				pc->modifyFame( ServerScp::g_nBountyFameGain );
				pc->IncreaseKarma(ServerScp::g_nBountyKarmaGain);
			}
			else
				pc_t->talk( s, TRANSLATE("You can not claim that prize scoundrel. You are lucky I don't strike you down where you stand!"),0);

			// Delete the item
			pi->Delete();
		}
	}
	return true;
}
示例#15
0
bool CHeadSmashLever::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
	if (_enabled) {
		playMovie(0, 14, 0);
		playSound(TRANSLATE("z#54.wav", "z#585.wav"));
		int soundHandle = playSound(TRANSLATE("z#45.wav", "z#576.wav"));
		queueSound(TRANSLATE("z#49.wav", "z#580.wav"), soundHandle);
		_ticks = getTicksCount();
		_fieldE4 = true;
	} else {
		playMovie(0);
		playSound(TRANSLATE("z#56.wav", "z#587.wav"));
	}

	return true;
}
示例#16
0
void BudgetWindow::RefreshCategories(void)
{
	fCategoryList->Clear();
	fIncomeRow = new BRow();
	fCategoryList->AddRow(fIncomeRow);
	fSpendingRow = new BRow();
	fCategoryList->AddRow(fSpendingRow);
	fIncomeRow->SetField(new BStringField(TRANSLATE("Income")),0);
	fSpendingRow->SetField(new BStringField(TRANSLATE("Spending")),0);

	CppSQLite3Query query = gDatabase.DBQuery("select category,amount,period,isexpense from "
											"budgetlist order by category",
											"BudgetWindow::RefreshCategories");
	float maxwidth=fCategoryList->StringWidth("Category");
	while(!query.eof())
	{
		BString cat = DeescapeIllegalCharacters(query.getStringField(0));
		Fixed amount;
		amount.SetPremultiplied(query.getInt64Field(1));
		BudgetPeriod period = (BudgetPeriod)query.getIntField(2);

		BRow *row = new BRow();

		if(query.getIntField(3)==0)
			fCategoryList->AddRow(row,fIncomeRow);
		else
			fCategoryList->AddRow(row,fSpendingRow);

		row->SetField(new BStringField(cat.String()),0);

		BString amountstr;
		gDefaultLocale.CurrencyToString(amount.AbsoluteValue(),amountstr);
		amountstr.Truncate(amountstr.FindFirst(gDefaultLocale.CurrencyDecimal()));
		amountstr.RemoveFirst(gDefaultLocale.CurrencySymbol());

		row->SetField(new BStringField(amountstr.String()),1);

		float tempwidth = fCategoryList->StringWidth(cat.String());
		maxwidth = MAX(tempwidth,maxwidth);

		row->SetField(new BStringField(BudgetPeriodToString(period).String()),2);

		query.nextRow();
	}
	fCategoryList->ColumnAt(0)->SetWidth(maxwidth+30);
	fCategoryList->ExpandOrCollapse(fIncomeRow,true);
	fCategoryList->ExpandOrCollapse(fSpendingRow,true);
}
示例#17
0
bool CBrain::UseWithOtherMsg(CUseWithOtherMsg *msg) {
	CBrainSlot *slot = dynamic_cast<CBrainSlot *>(msg->_other);
	if (!slot)
		return CCarry::UseWithOtherMsg(msg);

	if (isEquals("CentralCore")) {
		setVisible(false);
		petMoveToHiddenRoom();
		CAddHeadPieceMsg headpieceMsg(getName());
		headpieceMsg.execute("CentralCoreSlot");
	} else if (!slot->_occupied && slot->getName() != "CentralCoreSlot") {
		// Brain card goes into vacant slot
		setVisible(false);
		petMoveToHiddenRoom();
		CAddHeadPieceMsg headpieceMsg(getName());
		headpieceMsg.execute(msg->_other);
		playSound(TRANSLATE("z#116.wav", "z#647.wav"));
		setPosition(Point(0, 0));
		setVisible(false);
		_pieceAdded = true;
	} else {
		// Trying to put brain card into an already occupied slot
		petAddToInventory();
	}

	return true;
}
示例#18
0
  //
  // Update
  //
  // Update slot information
  //
  void SaveLoad::Update()
  {
    // Find the slot list
    if (ICListBox *list = IFace::Find<ICListBox>("List", this))
    {
      // Set the names of the slots
      for (NList<IControl>::Iterator i(&list->GetItems()); *i; i++)
      {
        SaveGame::Info info;

        // Get the information for this slot
        SaveGame::GetInfo((*i)->Name(), info);

        // Set the text string of the control
        if (info.valid)
        {
          (*i)->SetTextString(Utils::Ansi2Unicode(info.description), TRUE);
        }
        else
        {
          (*i)->SetTextString(TRANSLATE(("#shell.win.options.saveload.empty")), TRUE);
        }
      }      
    }
  }
//
// Event handling
//
U32 DifficultyList::HandleEvent(Event &e)
{
    // Rebuild
    if (e.type == IFace::EventID())
    {
        switch (e.subType)
        {
        case IFace::NOTIFY:
        {
            // Do specific handling
            switch (e.iface.p1)
            {
            case ICListBoxMsg::Rebuild:

                // Clear any current items
                DeleteAllItems();

                // Add each existing difficulty setting
                for (NList<Difficulty::Setting>::Iterator i(&Difficulty::GetSettings()); *i; i++)
                {
                    AddTextItem
                    (
                        (*i)->GetName().str, TRANSLATE(((*i)->GetDescription().str))
                    );
                }
                break;
            }
        }
        }
    }
    return (ICListBox::HandleEvent(e));
}
示例#20
0
BOOL CPositionUsersDlg::OnInitDialog()
{
    CDialog::OnInitDialog();

    TRANSLATE(*this, IDD);

    users_t::const_iterator ite;
    int i=0;
    for(ite=m_users.begin();ite != m_users.end();ite++)
    {
        if(ite->first != TT_GetMyUserID(ttInst))
        {
            CUserButton* pBtn = new CUserButton();
            CRect rect;
            rect.left = 20;
            rect.right = rect.left + 35;
            rect.top = 20;
            rect.bottom = rect.top + 20;
            pBtn->Create( ite->second.szNickname, WS_CHILD|WS_VISIBLE|WS_TABSTOP, rect, this, 9001+i);  // give a unique ID (not strictly necessary)
            i++;
            pBtn->m_nBtnID = ite->second.nUserID;
            pBtn->SetFont(GetFont());

            m_mapUserBtn[ite->second.nUserID] = pBtn;
        }
    }

    PositionUsers();

    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}
示例#21
0
BOOL CChangeStatusDlg::OnInitDialog()
{
    CDialog::OnInitDialog();

    TRANSLATE(*this, IDD);

    switch(m_nStatusMode & STATUSMODE_MASK)
    {
    case STATUSMODE_AVAILABLE : 
        m_wndOnline.SetCheck(TRUE);
        OnBnClickedRadioOnline();
        break;
    case STATUSMODE_AWAY : 
        m_wndAway.SetCheck(TRUE);
        OnBnClickedRadioAway();
        break;
    case STATUSMODE_QUESTION :
        m_wndQuestion.SetCheck(TRUE);
        OnBnClickedRadioQuestion();
        break;
    }

    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}
示例#22
0
static gint
calculate_max_length (GOptionGroup *group)
{
  GOptionEntry *entry;
  gint i, len, max_length;

  max_length = 0;

  for (i = 0; i < group->n_entries; i++)
    {
      entry = &group->entries[i];

      if (entry->flags & G_OPTION_FLAG_HIDDEN)
	continue;

      len = g_utf8_strlen (entry->long_name, -1);
      
      if (entry->short_name)
	len += 4;
      
      if (!NO_ARG (entry) && entry->arg_description)
	len += 1 + g_utf8_strlen (TRANSLATE (group, entry->arg_description), -1);
      
      max_length = MAX (max_length, len);
    }

  return max_length;
}
  //
  // BuildRuleSetList
  //
  void RuleSetListBox::BuildRuleSetList()
  {
    ICListBox::Rebuild *rebuild = PreRebuild();

    DeleteAllItems();

    if (!pub)
    {
      // Add the 'no rule' option
      AddTextItem("None", NULL);
    }

    const NBinTree<Mods::Mod> *mods = Mods::GetMods(Mods::Types::RuleSet);
    if (mods)
    {
      for (NBinTree<Mods::Mod>::Iterator mod(mods); *mod; ++mod)
      {
        if (!(pub && (*mod)->IsPrivate()))
        {
          AddTextItem((*mod)->GetName().str, TRANSLATE(((*mod)->GetDescription().str)));
        }
      }
    }

    PostRebuild(&rebuild);
  }
示例#24
0
TypeApartment::TypeApartment(QWidget *parent) :
    MainWidget(parent),
    ui(new Ui::TypeApartment),
    mId(-1),
    mIdObjects(-1)
{
    ui->setupUi(this);
    ui->label_2->setProperty("title", "true");
    //ui->mpRooms->setVisible(false);
    //ui->label_7->setVisible(false);

    QStringList vDicts;
    vDicts << "apartment" << "material" << "fund";

    QList<QComboBox*> vBoxes;
    vBoxes << ui->mpApartment << ui->mpMaterial << ui->mpFond;
    for (int i =0; i < vDicts.count(); ++i)
    {
        ResponseType vQuery = execQuery(
                    QString("SELECT id, \"name\" FROM static_dictionaries WHERE parent IN (SELECT id FROM static_dictionaries WHERE parent is NULL AND \"name\" = '%1')")
                     .arg(vDicts.at(i)));
        ResponseRecordType vRecord;
        vBoxes[i]->addItem(TRANSLATE("не выбрано"), -1);
        foreach (vRecord, vQuery)
        {
            vBoxes[i]->addItem(vRecord["name"].toString(), vRecord["id"].toInt());
        }
    }
示例#25
0
BOOL CWindowPage::OnInitDialog()
{
    CPropertyPage::OnInitDialog();

    TRANSLATE(*this, IDD);

    m_wndSpinTextLen.SetRange32(1, TT_STRLEN);

    //convert font to LOGFONT
    ConvertFont(m_Font, m_lf);

    ShowFont();

    CStringList strings;
    GetLanguageFiles(strings);
    strings.AddHead(_T(""));

    for(POSITION pos=strings.GetHeadPosition();pos!=NULL;)
        m_wndLanguages.AddString(strings.GetNext(pos));

    if(!m_szLanguage.IsEmpty())
        m_wndLanguages.SelectString(-1, m_szLanguage);

    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}
示例#26
0
/* warning: addr must be aligned. The ram page is not masked as dirty
   and the code inside is not invalidated. It is useful if the dirty
   bits are used to track modified PTEs */
void glue(address_space_stl_notdirty, SUFFIX)(ARG1_DECL,
    hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result)
{
    uint8_t *ptr;
    MemoryRegion *mr;
    hwaddr l = 4;
    hwaddr addr1;
    MemTxResult r;
    uint8_t dirty_log_mask;
    bool release_lock = false;

    RCU_READ_LOCK();
    mr = TRANSLATE(addr, &addr1, &l, true);
    if (l < 4 || !IS_DIRECT(mr, true)) {
        release_lock |= prepare_mmio_access(mr);

        r = memory_region_dispatch_write(mr, addr1, val, 4, attrs);
    } else {
        ptr = MAP_RAM(mr, addr1);
        stl_p(ptr, val);

        dirty_log_mask = memory_region_get_dirty_log_mask(mr);
        dirty_log_mask &= ~(1 << DIRTY_MEMORY_CODE);
        cpu_physical_memory_set_dirty_range(memory_region_get_ram_addr(mr) + addr,
                                            4, dirty_log_mask);
        r = MEMTX_OK;
    }
    if (result) {
        *result = r;
    }
    if (release_lock) {
        qemu_mutex_unlock_iothread();
    }
    RCU_READ_UNLOCK();
}
示例#27
0
uint32_t glue(address_space_ldub, SUFFIX)(ARG1_DECL,
    hwaddr addr, MemTxAttrs attrs, MemTxResult *result)
{
    uint8_t *ptr;
    uint64_t val;
    MemoryRegion *mr;
    hwaddr l = 1;
    hwaddr addr1;
    MemTxResult r;
    bool release_lock = false;

    RCU_READ_LOCK();
    mr = TRANSLATE(addr, &addr1, &l, false);
    if (!IS_DIRECT(mr, false)) {
        release_lock |= prepare_mmio_access(mr);

        /* I/O case */
        r = memory_region_dispatch_read(mr, addr1, &val, 1, attrs);
    } else {
        /* RAM case */
        ptr = MAP_RAM(mr, addr1);
        val = ldub_p(ptr);
        r = MEMTX_OK;
    }
    if (result) {
        *result = r;
    }
    if (release_lock) {
        qemu_mutex_unlock_iothread();
    }
    RCU_READ_UNLOCK();
    return val;
}
示例#28
0
    //
    // Constructor
    //
    Text::Text(Cineractive *cineractive, FScope *fScope, S32 priority)
    : StepHoldPrim(cineractive, fScope, priority),
      text(NULL)
    {
      // Font
      const char *name = StdLoad::TypeString(fScope, "Font", "System");

      if ((font = FontSys::GetFont(Crc::CalcStr(name))) == NULL)
      {
        ERR_FATAL(("Font not found [%s] for Cineractive Text", name))
      }

      // Text
      FScope *sScope;

      if ((sScope = fScope->GetFunction("Text", FALSE)) != NULL)
      {
        SetText(TRANSLATE((StdLoad::TypeString(sScope))));
      }

      // Position
      if ((sScope = fScope->GetFunction("Pos", FALSE)) != NULL)
      {
        x = StdLoad::TypeF32(sScope);
        y = StdLoad::TypeF32(sScope);
      }
      else
      {
        x = 0.5F;
        y = 0.5F;
      }

      // Color
      StdLoad::TypeColor(fScope, "Color", clr, Color(255L, 255L, 255L, 255L));
    }
示例#29
0
void glue(address_space_stb, SUFFIX)(ARG1_DECL,
    hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result)
{
    uint8_t *ptr;
    MemoryRegion *mr;
    hwaddr l = 1;
    hwaddr addr1;
    MemTxResult r;
    bool release_lock = false;

    RCU_READ_LOCK();
    mr = TRANSLATE(addr, &addr1, &l, true);
    if (!IS_DIRECT(mr, true)) {
        release_lock |= prepare_mmio_access(mr);
        r = memory_region_dispatch_write(mr, addr1, val, 1, attrs);
    } else {
        /* RAM case */
        ptr = MAP_RAM(mr, addr1);
        stb_p(ptr, val);
        INVALIDATE(mr, addr1, 1);
        r = MEMTX_OK;
    }
    if (result) {
        *result = r;
    }
    if (release_lock) {
        qemu_mutex_unlock_iothread();
    }
    RCU_READ_UNLOCK();
}
示例#30
0
BOOL CMediaStorageDlg::OnInitDialog()
{
    CDialog::OnInitDialog();

    TRANSLATE(*this, IDD);

    int i = m_wndAFF.AddString(_T("Wave-format"));
    m_wndAFF.SetItemData(i, AFF_WAVE_FORMAT);
    i = m_wndAFF.AddString(_T("Ogg-format"));
    m_wndAFF.SetItemData(i, AFF_CHANNELCODEC_FORMAT);
    i = m_wndAFF.AddString(_T("MP3-format (16 kbit)"));
    m_wndAFF.SetItemData(i, AFF_MP3_16KBIT_FORMAT);
    i = m_wndAFF.AddString(_T("MP3-format (32 kbit)"));
    m_wndAFF.SetItemData(i, AFF_MP3_32KBIT_FORMAT);
    i = m_wndAFF.AddString(_T("MP3-format (64 kbit)"));
    m_wndAFF.SetItemData(i, AFF_MP3_64KBIT_FORMAT);
    i = m_wndAFF.AddString(_T("MP3-format (128 kbit)"));
    m_wndAFF.SetItemData(i, AFF_MP3_128KBIT_FORMAT);
    i = m_wndAFF.AddString(_T("MP3-format (256 kbit)"));
    m_wndAFF.SetItemData(i, AFF_MP3_256KBIT_FORMAT);
    m_wndAFF.SetCurSel(0);

    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}