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


C++ stringw::c_str方法代码示例

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


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

示例1: setLabel

void ButtonWidget::setLabel(const irr::core::stringw &label)
{
    // This method should only be called AFTER a widget is added
    assert(m_element != NULL);

    m_element->setText( label.c_str() );
    setText(label);
}
开发者ID:Berulacks,项目名称:stk-code,代码行数:8,代码来源:button_widget.cpp

示例2: setLabel

// -----------------------------------------------------------------------------
void RibbonWidget::setLabel(const int id, irr::core::stringw new_name)
{
    if (m_labels.size() == 0) return; // ignore this call for ribbons without labels
    
    assert(id >= 0);
    assert(id < m_labels.size());
    m_labels[id].setText( new_name.c_str() );
    m_text = new_name;
}
开发者ID:344717871,项目名称:STK_android,代码行数:10,代码来源:ribbon_widget.cpp

示例3: renameCell

// -----------------------------------------------------------------------------
void ListWidget::renameCell(const int row_index, const int col_index, const irr::core::stringw newName, const int icon)
{
    // May only be called AFTER this widget has been add()ed
    assert(m_element != NULL);

    CGUISTKListBox* list = getIrrlichtElement<CGUISTKListBox>();
    assert(list != NULL);

    list->setCell(row_index, col_index, newName.c_str(), icon);

    list->setItemOverrideColor( row_index, EGUI_LBC_TEXT          , video::SColor(255,0,0,0) );
    list->setItemOverrideColor( row_index, EGUI_LBC_TEXT_HIGHLIGHT, video::SColor(255,255,255,255) );
}
开发者ID:himanshuk303,项目名称:stk-code,代码行数:14,代码来源:list_widget.cpp

示例4: addUnlockedPicture

void FeatureUnlockedCutScene::addUnlockedPicture(irr::video::ITexture* picture,
                                                 float w, float h,
                                                 irr::core::stringw msg)
{
    if (picture == NULL)
    {
        Log::warn("FeatureUnlockedCutScene::addUnlockedPicture", "Unlockable has no picture: %s",
            core::stringc(msg.c_str()).c_str());
        picture = irr_driver->getTexture(file_manager->getAsset(FileManager::GUI,"main_help.png"));

    }

    m_unlocked_stuff.push_back( new UnlockedThing(picture, w, h, msg) );
}   // addUnlockedPicture
开发者ID:jubalh,项目名称:stk-code,代码行数:14,代码来源:feature_unlocked.cpp

示例5: addUnlockedPicture

void FeatureUnlockedCutScene::addUnlockedPicture(irr::video::ITexture* picture,
                                                 float w, float h,
                                                 irr::core::stringw msg)
{
    if (picture == NULL)
    {
        std::cerr << "[FeatureUnlockedCutScene::addUnlockedPicture] WARNING: unlockable has no picture : "
                  << core::stringc(msg.c_str()).c_str() << "\n";
        picture = irr_driver->getTexture(file_manager->getAsset(FileManager::GUI,"main_help.png"));

    }

    m_unlocked_stuff.push_back( new UnlockedThing(picture, w, h, msg) );
}   // addUnlockedPicture
开发者ID:clasik,项目名称:stk-code,代码行数:14,代码来源:feature_unlocked.cpp

示例6: setValue

void SpinnerWidget::setValue(irr::core::stringw new_value)
{
    const int size = (int)m_labels.size();
    for (int n=0; n<size; n++)
    {
        if (m_labels[n] == new_value)
        {
            setValue(n);
            return;
        }
    }

    Log::fatal("SpinnerWidget::setValue", "Cannot find element named '%s'",
        irr::core::stringc(new_value.c_str()).c_str());
}
开发者ID:jubalh,项目名称:stk-code,代码行数:15,代码来源:spinner_widget.cpp

示例7: setValue

void SpinnerWidget::setValue(irr::core::stringw new_value)
{
    const int size = (int)m_labels.size();
    for (int n=0; n<size; n++)
    {
        if (m_labels[n] == new_value)
        {
            setValue(n);
            return;
        }
    }

    std::cerr << "ERROR [SpinnerWidget::setValue] : cannot find element named '"
              <<  irr::core::stringc(new_value.c_str()).c_str() << "'\n";
    assert(false);
}
开发者ID:shantanusingh10,项目名称:stk-code,代码行数:16,代码来源:spinner_widget.cpp

示例8: setLabel

// ----------------------------------------------------------------------------
void RibbonWidget::setLabel(const unsigned int id, irr::core::stringw new_name)
{
    if (m_element == NULL)
    {
        // before adding
        m_children[id].setText(new_name);
    }
    else
    {
        // after adding
        // ignore this call for ribbons without labels
        if (m_labels.size() == 0) return;

        assert(id < m_labels.size());
        m_labels[id].setText(new_name.c_str());
        //m_text = new_name;
    }
}   // setLabel
开发者ID:Elderme,项目名称:stk-code,代码行数:19,代码来源:ribbon_widget.cpp

示例9: w_gettext

/**
 * \param original Message to translate
 * \param context  Optional, can be set to differentiate 2 strings that are identical
 *                 in English but could be different in other languages
 */
const wchar_t* Translations::w_gettext(const char* original, const char* context)
{
    if (original[0] == '\0') return L"";

#if TRANSLATE_VERBOSE
    Log::info("Translations", "Translating %s", original);
#endif

    const std::string& original_t = (context == NULL ?
                                     m_dictionary.translate(original) :
                                     m_dictionary.translate_ctxt(context, original));

    if (original_t == original)
    {
        static irr::core::stringw converted_string;
        converted_string = StringUtils::utf8ToWide(original);

#if TRANSLATE_VERBOSE
        std::wcout << L"  translation : " << converted_string << std::endl;
#endif
        return converted_string.c_str();
    }

    // print
    //for (int n=0;; n+=4)

    static core::stringw original_tw;
    original_tw = StringUtils::utf8ToWide(original_t);

    const wchar_t* out_ptr = original_tw.c_str();
    if (REMOVE_BOM) out_ptr++;

#if TRANSLATE_VERBOSE
    std::wcout << L"  translation : " << out_ptr << std::endl;
#endif

    return out_ptr;
}
开发者ID:TheDudeWithThreeHands,项目名称:A-StreamKart,代码行数:43,代码来源:translation.cpp

示例10: doInit

void MessageDialog::doInit(irr::core::stringw msg, MessageDialogType type,
                           IConfirmDialogListener* listener, bool own_listener)
{
    loadFromFile("confirm_dialog.stkgui");

    m_listener = listener;
    m_own_listener = own_listener;
    
    LabelWidget* message = getWidget<LabelWidget>("title");
    message->setText( msg.c_str(), false );

    // If the dialog is a simple 'OK' dialog, then hide the "Yes" button and
    // change "Cancel" to "OK"
    if (type == MessageDialog::MESSAGE_DIALOG_OK)
    {
        ButtonWidget* yesbtn = getWidget<ButtonWidget>("confirm");
        yesbtn->setVisible(false);

        ButtonWidget* cancelbtn = getWidget<ButtonWidget>("cancel");
        cancelbtn->setText(_("OK"));
        cancelbtn->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
    }
}
开发者ID:kiennguyen1994,项目名称:game-programming-cse-hcmut-2012,代码行数:23,代码来源:message_dialog.cpp

示例11: getDescription

 /** Returns the description of this achievement. */
 irr::core::stringw getDescription() const { return _(m_description.c_str()); }
开发者ID:Cav098,项目名称:stk-code-fix_1797,代码行数:2,代码来源:achievement_info.hpp

示例12: getName

 /** Returns the name of this achievement. */
 irr::core::stringw getName() const { return _LTR(m_name.c_str()); }
开发者ID:Cav098,项目名称:stk-code-fix_1797,代码行数:2,代码来源:achievement_info.hpp

示例13: isRTLText

 bool               isRTLText(const irr::core::stringw &str) { return isRTLText(str.c_str()); }
开发者ID:PlasmaPower,项目名称:stk-code,代码行数:1,代码来源:translation.hpp

示例14: selectItemWithLabel

void ListWidget::selectItemWithLabel(const irr::core::stringw& name)
{
    CGUISTKListBox* list = getIrrlichtElement<CGUISTKListBox>();
    assert(list != NULL);
    return list->setSelectedByCellText( name.c_str() );
}
开发者ID:himanshuk303,项目名称:stk-code,代码行数:6,代码来源:list_widget.cpp

示例15: stringw_to_stdstring

std::string stringw_to_stdstring(irr::core::stringw sw)
{
    std::stringstream ss;
        ss << sw.c_str();
        return ss.str();
}
开发者ID:Turupawn,项目名称:FighterAndroid,代码行数:6,代码来源:Input.cpp


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