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


C++ wxstr函数代码示例

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


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

示例1: wxComboBox_Create

extern "C" WXEXPORT
wxc_bool wxComboBox_Create(wxComboBox* self, wxWindow* window, int id,
                       wxc_string value,
                       const wxPoint* pos, const wxSize* size,
                       int n, wxc_string choices[], long style,
                       const wxValidator* validator, wxc_string name)
{
    int i;

    if (pos == NULL)
        pos = &wxDefaultPosition;

    if (size == NULL)
        size = &wxDefaultSize;

    if (validator == NULL)
        validator = &wxDefaultValidator;

    if (name.data==NULL)
        name = wxc_string("comboBox");

    wxString* strings = new wxString[n];
    for (i = 0; i < n; ++i)
        strings[i] = wxstr(choices[i]);

    return self->Create(window, id, wxstr(value), *pos, *size,
                        n, strings, style, *validator,
                        wxstr(name))?1:0;
}
开发者ID:HatsuneMiku,项目名称:wxd,代码行数:29,代码来源:combobox.cpp

示例2: wxListBox_Create

extern "C" WXEXPORT
wxc_bool wxListBox_Create(wxListBox* self, wxWindow *parent, wxWindowID id,
					  const wxPoint* pos, const wxSize* size, int n,
					  wxc_string items[], long style,
					  const wxValidator* validator, wxc_string name)
{
	int i;

	if (pos == NULL)
		pos = &wxDefaultPosition;

	if (size == NULL)
		size = &wxDefaultSize;

	if (validator == NULL)
		validator = &wxDefaultValidator;

	if (name.data==NULL)
		name = wxc_string("listbox");

	wxString* strings = NULL;

    if (items != NULL) {
        strings = new wxString[n];
        for (i = 0; i < n; ++i)
            strings[i] = wxstr(items[i]);
    }

	return self->Create(parent, id, *pos, *size, n, strings, style,
						*validator, wxstr(name))?1:0;
}
开发者ID:HatsuneMiku,项目名称:wxd,代码行数:31,代码来源:listbox.cpp

示例3: ReloadSettings

void PaletteWindow::ReloadSettings(Map* map) {
	if(terrain_palette) {
		terrain_palette->SetListType(wxstr(settings.getString(Config::PALETTE_TERRAIN_STYLE)));
		terrain_palette->SetToolbarIconSize(settings.getInteger(Config::USE_LARGE_TERRAIN_TOOLBAR));
	}
	if(doodad_palette) {
		doodad_palette->SetListType(wxstr(settings.getString(Config::PALETTE_DOODAD_STYLE)));
		doodad_palette->SetToolbarIconSize(settings.getInteger(Config::USE_LARGE_DOODAD_SIZEBAR));
	}
	if(house_palette) {
		house_palette->SetMap(map);
		house_palette->SetToolbarIconSize(settings.getInteger(Config::USE_LARGE_HOUSE_SIZEBAR));
	}
	if(waypoint_palette) {
		waypoint_palette->SetMap(map);
	}
	if(item_palette) {
		item_palette->SetListType(wxstr(settings.getString(Config::PALETTE_ITEM_STYLE)));
		item_palette->SetToolbarIconSize(settings.getInteger(Config::USE_LARGE_ITEM_SIZEBAR));
	}
	if(raw_palette) {
		raw_palette->SetListType(wxstr(settings.getString(Config::PALETTE_RAW_STYLE)));
		raw_palette->SetToolbarIconSize(settings.getInteger(Config::USE_LARGE_RAW_SIZEBAR));
	}
	InvalidateContents();
}
开发者ID:Arydia,项目名称:rme,代码行数:26,代码来源:palette_window.cpp

示例4: ASSERT

void HousePalettePanel::SelectTown(size_t index)
{
	ASSERT(town_choice->GetCount() >= index);

	if(map == nullptr || town_choice->GetCount() == 0) {
		// No towns :(
		add_house_button->Enable(false);
	} else {
		Town* what_town = reinterpret_cast<Town*>(town_choice->GetClientData(index));

		// Clear the old houselist
		house_list->Clear();

		for(HouseMap::iterator house_iter = map->houses.begin(); house_iter != map->houses.end(); ++house_iter) {
			if(what_town) {
				if(house_iter->second->townid == what_town->getID()) {
					house_list->Append(wxstr(house_iter->second->getDescription()), house_iter->second);
				}
			} else {
				// "No Town" selected!
				if(map->towns.getTown(house_iter->second->townid) == nullptr) {
					// The town doesn't exist
					house_list->Append(wxstr(house_iter->second->getDescription()), house_iter->second);
				}
			}
		}

		// Select first house
		SelectHouse(0);
		town_choice->SetSelection(index);
		add_house_button->Enable(what_town != nullptr);
		ASSERT(what_town == nullptr || add_house_button->IsEnabled() || !IsEnabled());
	}
}
开发者ID:Codex-NG,项目名称:rme,代码行数:34,代码来源:palette_house.cpp

示例5: wxFileSelectorEx_func

extern "C" WXEXPORT
wxString* wxFileSelectorEx_func(wxc_string message,
               wxc_string default_path,
               wxc_string default_filename,
               int *indexDefaultExtension,
               wxc_string wildcard,
               int flags,
               wxWindow *parent,
               int x, int y)
{
	wxString wxmessage, wxwildcard;
	if (message.data==NULL)
		wxmessage = wxString(wxFileSelectorPromptStr);
	else
		wxmessage = wxstr(message);
	if (wildcard.data==NULL)
		wxwildcard = wxString(wxFileSelectorDefaultWildcardStr);
	else
		wxwildcard = wxstr(wildcard);
	return new wxString(wxFileSelectorEx(wxmessage,
	    wxstr(default_path),
	    wxstr(default_filename),
	    indexDefaultExtension,
	    wxwildcard,
	    flags, parent, x, y));
}
开发者ID:HatsuneMiku,项目名称:wxd,代码行数:26,代码来源:filedialog.cpp

示例6: delete

void MainFrame::OnUpdateReceived(wxCommandEvent& event) 
{
	std::string data = *(std::string*)event.GetClientData();
	delete (std::string*)event.GetClientData();
	size_t first_colon = data.find(':');
	size_t second_colon = data.find(':', first_colon+1);

	if(first_colon == std::string::npos || second_colon == std::string::npos) 
		return;

	std::string update = data.substr(0, first_colon);
	std::string verstr = data.substr(first_colon+1, second_colon-first_colon-1);
	std::string url = (second_colon == data.size()? "" : data.substr(second_colon+1));

	if(update == "yes") 
	{
		int ret = gui.PopupDialog(
			wxT("Update Notice"),
			wxString(wxT("There is a newd update available (")) << wxstr(verstr) << 
			wxT("). Do you want to go to the website and download it?"),
			wxYES | wxNO,
			wxT("I don't want any update notices"),
			Config::AUTOCHECK_FOR_UPDATES
			);
		if(ret == wxID_YES)
			::wxLaunchDefaultBrowser(wxstr(url),  wxBROWSER_NEW_WINDOW);
	}
}
开发者ID:LaloHao,项目名称:rme,代码行数:28,代码来源:application.cpp

示例7: wxToolBar_AddRadioTool

extern "C" WXEXPORT
wxToolBarToolBase* wxToolBar_AddRadioTool(wxToolBar* self, int toolid, wxc_string label, const wxBitmap* bitmap, const wxBitmap* bmpDisabled, wxc_string shortHelp, wxc_string longHelp, wxObject *data)
{
    if (bmpDisabled == NULL)
        bmpDisabled = &wxNullBitmap;

    return self->AddRadioTool(toolid, wxstr(label), *bitmap, *bmpDisabled, wxstr(shortHelp), wxstr(longHelp), data);
}
开发者ID:vrichomme,项目名称:wxd,代码行数:8,代码来源:toolbar.cpp

示例8: wxNumberEntryDialog_ctor

extern "C" WXEXPORT
wxNumberEntryDialog* wxNumberEntryDialog_ctor(wxWindow* parent, wxc_string message,
        wxc_string prompt, wxc_string caption, long value, long min, long max, wxPoint* pos)
{
    return new _NumberEntryDialog(parent, wxstr(message),
            wxstr(prompt),
            wxstr(caption),
            value, min, max, *pos);
}
开发者ID:HatsuneMiku,项目名称:wxd,代码行数:9,代码来源:numdialog.cpp

示例9: wxGetNumberFromUser_func

extern "C" WXEXPORT
long wxGetNumberFromUser_func(wxc_string message, wxc_string prompt, wxc_string caption,
                                     long value, long min, long max, wxWindow* parent, wxPoint* pos)
{
    return wxGetNumberFromUser(wxstr(message),
                        wxstr(prompt),
                        wxstr(caption),
                        value, min, max, parent, *pos);
}
开发者ID:HatsuneMiku,项目名称:wxd,代码行数:9,代码来源:numdialog.cpp

示例10: wxFileDialog_ctor

extern "C" WXEXPORT
wxFileDialog* wxFileDialog_ctor(wxWindow* parent, wxc_string message, 
            wxc_string defaultDir, wxc_string defaultFile, 
            wxc_string wildcard, long style, const wxPoint* pos)
{
    return new _FileDialog(parent, wxstr(message), 
                           wxstr(defaultDir), 
                           wxstr(defaultFile), 
                           wxstr(wildcard), style, *pos);
}
开发者ID:HatsuneMiku,项目名称:wxd,代码行数:10,代码来源:filedialog.cpp

示例11: wxstr

CreatureType* CreatureType::loadFromXML(pugi::xml_node node, wxArrayString& warnings)
{
	pugi::xml_attribute attribute;
	if (!(attribute = node.attribute("type"))) {
		warnings.push_back(wxT("Couldn't read type tag of creature node."));
		return nullptr;
	}

	const std::string& tmpType = attribute.as_string();
	if (tmpType != "monster" && tmpType != "npc") {
		warnings.push_back(wxT("Invalid type tag of creature node \"") + wxstr(tmpType) + wxT("\""));
		return nullptr;
	}

	if (!(attribute = node.attribute("name"))) {
		warnings.push_back(wxT("Couldn't read name tag of creature node."));
		return nullptr;
	}

	CreatureType* ct = newd CreatureType();
	ct->name = attribute.as_string();
	ct->isNpc = tmpType == "npc";

	if ((attribute = node.attribute("looktype"))) {
		ct->outfit.lookType = pugi::cast<int32_t>(attribute.value());
		if(gui.gfx.getCreatureSprite(ct->outfit.lookType) == nullptr) {
			warnings.push_back(wxT("Invalid creature \"") + wxstr(ct->name) + wxT("\" look type #") + std::to_string(ct->outfit.lookType));
		}
	}

	if ((attribute = node.attribute("lookitem"))) {
		ct->outfit.lookItem = pugi::cast<int32_t>(attribute.value());
	}

	if ((attribute = node.attribute("lookaddon"))) {
		ct->outfit.lookAddon = pugi::cast<int32_t>(attribute.value());
	}

	if ((attribute = node.attribute("lookhead"))) {
		ct->outfit.lookHead = pugi::cast<int32_t>(attribute.value());
	}

	if ((attribute = node.attribute("lookbody"))) {
		ct->outfit.lookBody = pugi::cast<int32_t>(attribute.value());
	}

	if ((attribute = node.attribute("looklegs"))) {
		ct->outfit.lookLegs = pugi::cast<int32_t>(attribute.value());
	}

	if ((attribute = node.attribute("lookfeet"))) {
		ct->outfit.lookFeet = pugi::cast<int32_t>(attribute.value());
	}
	return ct;
}
开发者ID:LaloHao,项目名称:rme,代码行数:55,代码来源:creatures.cpp

示例12: wxSaveFileSelector_func

// Ask for filename to save
extern "C" WXEXPORT
wxString* wxSaveFileSelector_func(wxc_string what,
                   wxc_string extension,
                   wxc_string default_name,
                   wxWindow *parent)
{
	return new wxString(wxSaveFileSelector(wxstr(what),
	    wxstr(extension),
	    wxstr(default_name),
	    parent));
}
开发者ID:HatsuneMiku,项目名称:wxd,代码行数:12,代码来源:filedialog.cpp

示例13: wxTextCtrl_Create

extern "C" WXEXPORT
wxc_bool wxTextCtrl_Create(wxTextCtrl* self, wxWindow *parent, wxWindowID id, wxc_string value, const wxPoint *pos, const wxSize *size, long style, const wxValidator* validator, wxc_string name)
{
    if (pos == NULL)
        pos = &wxDefaultPosition;

    if (size == NULL)
        size = &wxDefaultSize;

    if (validator == NULL)
        validator = &wxDefaultValidator;

    return self->Create(parent, id, wxstr(value), *pos, *size, style, *validator, wxstr(name))?1:0;
}
开发者ID:vrichomme,项目名称:wxd,代码行数:14,代码来源:textctrl.cpp

示例14: wxstr

void Application::FixVersionDiscrapencies() 
{
	// Here the registry should be fixed, if the version has been changed
	if(settings.getInteger(Config::VERSION_ID) < MAKE_VERSION_ID(1, 0, 5)) 
	{
		settings.setInteger(Config::USE_MEMCACHED_SPRITES_TO_SAVE, 0);
	}

	if(settings.getInteger(Config::VERSION_ID) < __RME_VERSION_ID__ && ClientVersion::getLatestVersion() != nullptr)
	{
		settings.setInteger(Config::DEFAULT_CLIENT_VERSION, ClientVersion::getLatestVersion()->getID());
	}

	wxString ss = wxstr(settings.getString(Config::SCREENSHOT_DIRECTORY));
	if(ss.empty())
	{
		ss = wxStandardPaths::Get().GetDocumentsDir();
#ifdef __WINDOWS__
		ss += wxT("/My Pictures/RME/");
#endif
	}
	settings.setString(Config::SCREENSHOT_DIRECTORY, nstr(ss));

	// Set registry to newest version
	settings.setInteger(Config::VERSION_ID, __RME_VERSION_ID__);
}
开发者ID:LaloHao,项目名称:rme,代码行数:26,代码来源:application.cpp

示例15: wxCheckListBox_ctor2

extern "C" WXEXPORT
wxCheckListBox* wxCheckListBox_ctor2(wxWindow* parent, wxWindowID id, const wxPoint* pos, const wxSize* size, 
	int nStrings, wxc_string choices[], long style, const wxValidator* validator, wxc_string name)
{
	if (pos == NULL)
		pos = &wxDefaultPosition;

	if (size == NULL)
		size = &wxDefaultSize;

	if (validator == NULL)
		validator = &wxDefaultValidator;

	if (name.data==NULL)
		name = wxc_string("checklistbox");

	wxString* strings = NULL;

	if (choices != NULL) 
	{
		strings = new wxString[nStrings];
		for (int i = 0; i < nStrings; ++i)
			strings[i] = wxstr(choices[i]);
    	}
	
	return new _CheckListBox(parent, id, *pos, *size, nStrings, strings, style, *validator, wxstr(name));
}
开发者ID:HatsuneMiku,项目名称:wxd,代码行数:27,代码来源:listbox.cpp


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