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


C++ TRANSLATE函数代码示例

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


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

示例1: question

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();
    }
}
开发者ID:Arox,项目名称:makler,代码行数:25,代码来源:photographicsitem.cpp

示例2: switch

  //
  // 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));
  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:37,代码来源:tasks_unitconstruct.cpp

示例3: rect1

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;
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:29,代码来源:pet_rooms.cpp

示例4: canMine

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;
}
开发者ID:nox-wizard,项目名称:noxwizard,代码行数:25,代码来源:extractionskills.cpp

示例5: SetText

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;
}
开发者ID:HaikuArchives,项目名称:CapitalBe,代码行数:26,代码来源:CurrencyBox.cpp

示例6: checkReq

/*!
\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;
}
开发者ID:BackupTheBerlios,项目名称:hypnos-svn,代码行数:34,代码来源:addmenu.cpp

示例7: BWindow

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();	
}
开发者ID:HaikuArchives,项目名称:CapitalBe,代码行数:60,代码来源:BudgetWindow.cpp

示例8: print_entry

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);  
}
开发者ID:KerwinMa,项目名称:restcomm-ios-sdk,代码行数:27,代码来源:replace_goption.c

示例9: switch

  //
  // 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));
  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:30,代码来源:tasks_unitrecycle.cpp

示例10: ItemDroppedOnTrainer

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;
}
开发者ID:nox-wizard,项目名称:noxwizard,代码行数:55,代码来源:dragdrop.cpp

示例11: loadFrame

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;
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:13,代码来源:music_slider_speed.cpp

示例12: DeleteAllItems

  //
  // 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)));
    }
  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:17,代码来源:common_teamlistbox.cpp

示例13: BColumnListView

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));
}
开发者ID:HaikuArchives,项目名称:CapitalBe,代码行数:33,代码来源:BudgetWindow.cpp

示例14: ItemDroppedOnGuard

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;
}
开发者ID:nox-wizard,项目名称:noxwizard,代码行数:50,代码来源:dragdrop.cpp

示例15: playMovie

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;
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:15,代码来源:head_smash_lever.cpp


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