• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Load函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: s

int StorageObject::Load(char *fName)
{
	IoDataStream s(fName, "r");

	return(Load(s));
}
开发者ID:geomview,项目名称:gv2,代码行数:6,代码来源:StorageObject.cpp


示例2: Load

xmlNodePtr HisBase::GetNodePtr()
{
	Load();
	return node;
}
开发者ID:jlola,项目名称:homeis,代码行数:5,代码来源:HisBase.cpp


示例3:

 IDynamicObject& MemoryCache::Access(const std::string& id)
 {
   return *Load(id).content_;
 }
开发者ID:dhanzhang,项目名称:orthanc,代码行数:4,代码来源:MemoryCache.cpp


示例4: return

bool CSG_MetaData::Create(CSG_File &Stream)
{
	return( Load(Stream) );
}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:4,代码来源:metadata.cpp


示例5: Item

Weapon::Weapon(std::string _id, JsonBox::Value& _v, EntityManager* _manager)
	: Item(_id, _v, _manager)
{
	Load(_v, _manager);
}
开发者ID:utilForever,项目名称:SimpleRPG-Text,代码行数:5,代码来源:Weapon.cpp


示例6: xml

	//Metoda ³aduj¹ca dane
	bool CMonsterTemplate::Load(const std::string &name)
	{
		CXml xml(name, "root" );
		return Load(xml);
	}
开发者ID:karlosos,项目名称:Tertius,代码行数:6,代码来源:CMonsterTemplate.cpp


示例7: m_Name

	Texture::Texture(const String& name, const String& filename)
		: m_Name(name), m_FileName(filename)
	{
		m_TID = Load();
	}
开发者ID:Itay2805,项目名称:Sparky4j-core,代码行数:5,代码来源:Texture.cpp


示例8: switch

uint32 GameBase::EngineMessageFn(uint32 messageID, void *pData, float fData)
{
	switch(messageID)
	{
        case MID_ACTIVATING:
		{
			g_pCommonLT->SetObjectFlags(m_hObject, OFT_User, USRFLG_GAMEBASE_ACTIVE, USRFLG_GAMEBASE_ACTIVE);
		}
		break;

		case MID_DEACTIVATING:
		{
			g_pCommonLT->SetObjectFlags(m_hObject, OFT_User, 0, USRFLG_GAMEBASE_ACTIVE);
		}
		break;

        case MID_PRECREATE:
		{
            uint32 dwRet = BaseClass::EngineMessageFn(messageID, pData, fData);

			int nInfo = (int)fData;
			if (nInfo == PRECREATE_WORLDFILE || nInfo == PRECREATE_STRINGPROP || nInfo == PRECREATE_NORMAL)
			{
				ObjectCreateStruct* pocs = (ObjectCreateStruct*)pData;
				if( !ReadProp( pocs ))
					return 0;
			}

			return dwRet;
		}
		break;

		case MID_OBJECTCREATED:
		{
			if( fData != OBJECTCREATED_SAVEGAME )
			{
				ObjectCreated( reinterpret_cast<const GenericPropList*>(pData) );
			}
		}
		break;

		case MID_MODELSTRINGKEY:
		{
			HandleModelString( (ArgList*)pData );
		}
		break;


		case MID_SAVEOBJECT:
		{
			Save((ILTMessage_Write*)pData);
		}
		break;

		case MID_LOADOBJECT:
		{
			Load((ILTMessage_Read*)pData);
		}
		break;

		default:
		break;
	}

	return BaseClass::EngineMessageFn(messageID, pData, fData);
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:66,代码来源:GameBase.cpp


示例9: MessageBox

// Dialog box handling functions
void
vncProperties::Show(BOOL show, BOOL usersettings)
{
	if (show)
	{
		if (!m_allowproperties)
		{
			// If the user isn't allowed to override the settings then tell them
			MessageBox(NULL, NO_OVERRIDE_ERR, "WinVNC Error", MB_OK | MB_ICONEXCLAMATION);
			return;
		}

		// Verify that we know who is logged on
		if (usersettings) {
			char username[UNLEN+1];
			if (!vncService::CurrentUser(username, sizeof(username)))
				return;
			if (strcmp(username, "") == 0) {
				MessageBox(NULL, NO_CURRENT_USER_ERR, "WinVNC Error", MB_OK | MB_ICONEXCLAMATION);
				return;
			}
		} else {
			// We're trying to edit the default local settings - verify that we can
			HKEY hkLocal, hkDefault;
			BOOL canEditDefaultPrefs = 1;
			DWORD dw;
			if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
				WINVNC_REGISTRY_KEY,
				0, REG_NONE, REG_OPTION_NON_VOLATILE,
				KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS)
				canEditDefaultPrefs = 0;
			else if (RegCreateKeyEx(hkLocal,
				"Default",
				0, REG_NONE, REG_OPTION_NON_VOLATILE,
				KEY_WRITE | KEY_READ, NULL, &hkDefault, &dw) != ERROR_SUCCESS)
				canEditDefaultPrefs = 0;
			if (hkLocal) RegCloseKey(hkLocal);
			if (hkDefault) RegCloseKey(hkDefault);

			if (!canEditDefaultPrefs) {
				MessageBox(NULL, CANNOT_EDIT_DEFAULT_PREFS, "WinVNC Error", MB_OK | MB_ICONEXCLAMATION);
				return;
			}
		}

		// Now, if the dialog is not already displayed, show it!
		if (!m_dlgvisible)
		{
			if (usersettings)
				vnclog.Print(LL_INTINFO, VNCLOG("show per-user Properties\n"));
			else
				vnclog.Print(LL_INTINFO, VNCLOG("show default system Properties\n"));

			// Load in the settings relevant to the user or system
			Load(usersettings);

			for (;;)
			{
				m_returncode_valid = FALSE;

				// Do the dialog box
				int result = DialogBoxParam(hAppInstance,
				    MAKEINTRESOURCE(IDD_PROPERTIES), 
				    NULL,
				    (DLGPROC) DialogProc,
				    (LONG) this);

				if (!m_returncode_valid)
				    result = IDCANCEL;

				vnclog.Print(LL_INTINFO, VNCLOG("dialog result = %d\n"), result);

				if (result == -1)
				{
					// Dialog box failed, so quit
					PostQuitMessage(0);
					return;
				}

				// We're allowed to exit if the password is not empty
				char passwd[MAXPWLEN];
				m_server->GetPassword(passwd);
				{
				    vncPasswd::ToText plain(passwd);
				    if ((strlen(plain) != 0) || !m_server->AuthRequired())
					break;
				}

				vnclog.Print(LL_INTERR, VNCLOG("warning - empty password\n"));

				// The password is empty, so if OK was used then redisplay the box,
				// otherwise, if CANCEL was used, close down WinVNC
				if (result == IDCANCEL)
				{
				    vnclog.Print(LL_INTERR, VNCLOG("no password - QUITTING\n"));
				    PostQuitMessage(0);
				    return;
				}

//.........这里部分代码省略.........
开发者ID:Haxinos,项目名称:metasploit,代码行数:101,代码来源:vncproperties.cpp


示例10: SettingsPane

GeneralView::GeneralView(SettingsHost* host)
	:
	SettingsPane("general", host)
{
	BFont statusFont;

	// Set a smaller font for the status label
	statusFont.SetSize(be_plain_font->Size() * 0.8);

	// Status button and label
	fServerButton = new BButton("server", kStartServer, new BMessage(kServer));
	fStatusLabel = new BStringView("status", kStopped);
	fStatusLabel->SetFont(&statusFont);

	// Update status label and server button
	if (_IsServerRunning()) {
		fServerButton->SetLabel(kStopServer);
		fStatusLabel->SetText(kStarted);
	} else {
		fServerButton->SetLabel(kStartServer);
		fStatusLabel->SetText(kStopped);
	}

	// Autostart
	fAutoStart = new BCheckBox("autostart",
		B_TRANSLATE("Enable notifications at startup"),
		new BMessage(kSettingChanged));

	// Display time
	fTimeout = new BTextControl(B_TRANSLATE("Hide notifications from screen"
		" after"), NULL, new BMessage(kSettingChanged));
	BStringView* displayTimeLabel = new BStringView("dt_label",
		B_TRANSLATE("seconds of inactivity"));

	// Default position
	// TODO: Here will come a screen representation with the four corners clickable

	// Load settings
	Load();

	// Calculate inset
	float inset = ceilf(be_plain_font->Size() * 0.7f);

	SetLayout(new BGroupLayout(B_VERTICAL));
	AddChild(BGroupLayoutBuilder(B_VERTICAL, inset)
		.AddGroup(B_HORIZONTAL, inset)
			.Add(fServerButton)
			.Add(fStatusLabel)
			.AddGlue()
		.End()

		.AddGroup(B_VERTICAL, inset)
			.Add(fAutoStart)
			.AddGroup(B_HORIZONTAL)
				.AddGroup(B_HORIZONTAL, 2)
					.Add(fTimeout)
					.Add(displayTimeLabel)
				.End()
			.End()
		.End()

		.AddGlue()
	);
}
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:64,代码来源:GeneralView.cpp


示例11: Load

//==============================================================================
// Brief  : エフェクト取得処理
// Return : CEffect*						: エフェクトクラス
// Arg    : const TCHAR* pNameFile			: ファイル名
//==============================================================================
CEffect* CManagerEffect::Get( const TCHAR* pNameFile )
{
	// 読み込み
	return m_pBufferItem[ Load( pNameFile ) ]->GetEffect();
}
开发者ID:mxt819,项目名称:H405,代码行数:10,代码来源:ManagerEffect.cpp


示例12: Initialize

// Constructor
Scanner::Scanner(string fileName)
{
	Initialize();
	Load(fileName);
}
开发者ID:Zanion,项目名称:Logo320Turtles,代码行数:6,代码来源:Scanner.cpp


示例13: dlg

void CImportDialog::Show()
{
    wxFileDialog dlg(m_parent, _("Select file to import settings from"), _T(""),
                     _T("FileZilla.xml"), _T("XML files (*.xml)|*.xml"),
                     wxFD_OPEN | wxFD_FILE_MUST_EXIST);
    dlg.CenterOnParent();

    if (dlg.ShowModal() != wxID_OK)
        return;

    wxFileName fn(dlg.GetPath());
    const wxString& path = fn.GetPath();
    const wxString& settings = wxGetApp().GetSettingsDir();
    if (path == settings)
    {
        wxMessageBox(_("You cannot import settings from FileZilla's own settings directory."), _("Error importing"), wxICON_ERROR, m_parent);
        return;
    }

    TiXmlDocument* xmlDocument = new TiXmlDocument();
    xmlDocument->SetCondenseWhiteSpace(false);

    if (!LoadXmlDocument(xmlDocument, dlg.GetPath()))
    {
        delete xmlDocument;
        wxMessageBox(_("Cannot load file, not a valid XML file."), _("Error importing"), wxICON_ERROR, m_parent);
        return;
    }

    TiXmlElement* fz3Root = xmlDocument->FirstChildElement("FileZilla3");
    TiXmlElement* fz2Root = xmlDocument->FirstChildElement("FileZilla");

    if (fz3Root)
    {
        bool settings = fz3Root->FirstChildElement("Settings") != 0;
        bool queue = fz3Root->FirstChildElement("Queue") != 0;
        bool sites = fz3Root->FirstChildElement("Servers") != 0;

        if (settings || queue || sites)
        {
            Load(m_parent, _T("ID_IMPORT"));
            if (!queue)
                XRCCTRL(*this, "ID_QUEUE", wxCheckBox)->Hide();
            if (!sites)
                XRCCTRL(*this, "ID_SITEMANAGER", wxCheckBox)->Hide();
            if (!settings)
                XRCCTRL(*this, "ID_SETTINGS", wxCheckBox)->Hide();
            Fit();

            if (ShowModal() != wxID_OK)
            {
                delete xmlDocument;
                return;
            }

            if (queue && XRCCTRL(*this, "ID_QUEUE", wxCheckBox)->IsChecked())
            {
                m_pQueueView->ImportQueue(fz3Root->FirstChildElement("Queue"), true);
            }

            if (sites && XRCCTRL(*this, "ID_SITEMANAGER", wxCheckBox)->IsChecked())
            {
                ImportSites(fz3Root->FirstChildElement("Servers"));
            }

            if (settings && XRCCTRL(*this, "ID_SETTINGS", wxCheckBox)->IsChecked())
            {
                COptions::Get()->Import(fz3Root->FirstChildElement("Settings"));
                wxMessageBox(_("The settings have been imported. You have to restart FileZilla for all settings to have effect."), _("Import successful"), wxOK, this);
            }

            wxMessageBox(_("The selected categories have been imported."), _("Import successful"), wxOK, this);

            delete xmlDocument;
            return;
        }
    }
    else if (fz2Root)
    {
        bool sites_fz2 = fz2Root->FirstChildElement("Sites") != 0;
        if (sites_fz2)
        {
            int res = wxMessageBox(_("The file you have selected contains site manager data from a previous version of FileZilla.\nDue to differences in the storage format, only host, port, username and password will be imported.\nContinue with the import?"),
                                   _("Import data from older version"), wxICON_QUESTION | wxYES_NO);

            if (res == wxYES)
                ImportLegacySites(fz2Root->FirstChildElement("Sites"));

            delete xmlDocument;
            return;
        }
    }

    delete xmlDocument;

    wxMessageBox(_("File does not contain any importable data."), _("Error importing"), wxICON_ERROR, m_parent);
}
开发者ID:ErichKrause,项目名称:filezilla,代码行数:97,代码来源:import.cpp


示例14: Load

//******************************************************************************
// Public Interface
//******************************************************************************
void PLAYER::Update(float DeltaTime)
{
    if(Data == null) {
        Load(DataName);
    }
}
开发者ID:dougfrazer,项目名称:asp,代码行数:9,代码来源:player.cpp


示例15: Load

void ae3d::Texture2D::LoadFromAtlas( const FileSystem::FileContentsData& atlasTextureData, const FileSystem::FileContentsData& atlasMetaData, const char* textureName, TextureWrap aWrap, TextureFilter aFilter, float aAnisotropy )
{
    Load( atlasTextureData, aWrap, aFilter, mipmaps, aAnisotropy );

    const std::string metaStr = std::string( std::begin( atlasMetaData.data ), std::end( atlasMetaData.data ) );
    std::stringstream metaStream( metaStr );

    if (atlasMetaData.path.find( ".xml" ) == std::string::npos && atlasMetaData.path.find( ".XML" ) == std::string::npos)
    {
        System::Print("Atlas meta data path %s could not be opened!", atlasMetaData.path.c_str());
        return;
    }

    std::string line;

    while (std::getline( metaStream, line ))
    {
        if (line.find( "<Image Name" ) == std::string::npos)
        {
            continue;
        }

        std::vector< std::string > tokens;
        Tokenize( line, tokens, "\"" );
        bool found = false;
        
        for (std::size_t t = 0; t < tokens.size(); ++t)
        {
            if (tokens[ t ].find( "Name" ) != std::string::npos)
            {
                if (tokens[ t + 1 ] == textureName)
                {
                    found = true;
                }
            }
            
            if (!found)
            {
                continue;
            }

            if (tokens[ t ].find( "XPos" ) != std::string::npos)
            {
                scaleOffset.z = std::stoi( tokens[ t + 1 ] ) / static_cast<float>(width);
            }
            else if (tokens[ t ].find( "YPos" ) != std::string::npos)
            {
                scaleOffset.w = std::stoi( tokens[ t + 1 ] ) / static_cast<float>(height);
            }
            else if (tokens[ t ].find( "Width" ) != std::string::npos)
            {
                const int w = std::stoi( tokens[ t + 1 ] );
                scaleOffset.x = 1.0f / (static_cast<float>(width) / static_cast<float>(w));
                width = w;
            }
            else if (tokens[ t ].find( "Height" ) != std::string::npos)
            {
                const int h = std::stoi( tokens[ t + 1 ] );
                scaleOffset.y = 1.0f / (static_cast<float>(height) / static_cast<float>(h));
                height = h;
            }
        }
    
        if (found)
        {
            return;
        }
    }
}
开发者ID:souxiaosou,项目名称:aether3d,代码行数:69,代码来源:Texture2D_GL45.cpp


示例16: Load

//---------------------------------------------------------------------------
void Preferences::OnRejected()
{
    Load();
}
开发者ID:hsoerensen,项目名称:qctools,代码行数:5,代码来源:preferences.cpp


示例17: MemPhysical

void HiresTexture::Prefetch()
{
  Common::SetCurrentThreadName("Prefetcher");

  size_t size_sum = 0;
  size_t sys_mem = MemPhysical();
  size_t recommended_min_mem = 2 * size_t(1024 * 1024 * 1024);
  // keep 2GB memory for system stability if system RAM is 4GB+ - use half of memory in other cases
  size_t max_mem =
      (sys_mem / 2 < recommended_min_mem) ? (sys_mem / 2) : (sys_mem - recommended_min_mem);
  u32 starttime = Common::Timer::GetTimeMs();
  for (const auto& entry : s_textureMap)
  {
    const std::string& base_filename = entry.first;

    if (base_filename.find("_mip") == std::string::npos)
    {
      {
        // try to get this mutex first, so the video thread is allow to get the real mutex faster
        std::unique_lock<std::mutex> lk(s_textureCacheAquireMutex);
      }
      std::unique_lock<std::mutex> lk(s_textureCacheMutex);

      auto iter = s_textureCache.find(base_filename);
      if (iter == s_textureCache.end())
      {
        // unlock while loading a texture. This may result in a race condition where we'll load a
        // texture twice,
        // but it reduces the stuttering a lot. Notice: The loading library _must_ be thread safe
        // now.
        // But bad luck, SOIL isn't, so TODO: remove SOIL usage here and use libpng directly
        // Also TODO: remove s_textureCacheAquireMutex afterwards. It won't be needed as the main
        // mutex will be locked rarely
        // lk.unlock();
        std::unique_ptr<HiresTexture> texture = Load(base_filename, 0, 0);
        // lk.lock();
        if (texture)
        {
          std::shared_ptr<HiresTexture> ptr(std::move(texture));
          iter = s_textureCache.insert(iter, std::make_pair(base_filename, ptr));
        }
      }
      if (iter != s_textureCache.end())
      {
        for (const Level& l : iter->second->m_levels)
        {
          size_sum += l.data_size;
        }
      }
    }

    if (s_textureCacheAbortLoading.IsSet())
    {
      return;
    }

    if (size_sum > max_mem)
    {
      g_Config.bCacheHiresTextures = false;

      OSD::AddMessage(
          StringFromFormat(
              "Custom Textures prefetching after %.1f MB aborted, not enough RAM available",
              size_sum / (1024.0 * 1024.0)),
          10000);
      return;
    }
  }
  u32 stoptime = Common::Timer::GetTimeMs();
  OSD::AddMessage(StringFromFormat("Custom Textures loaded, %.1f MB in %.1f s",
                                   size_sum / (1024.0 * 1024.0), (stoptime - starttime) / 1000.0),
                  10000);
}
开发者ID:CarlKenner,项目名称:dolphin,代码行数:73,代码来源:HiresTextures.cpp


示例18: _tcslen


//.........这里部分代码省略.........
				continue;
			}
			
		} else if ( SwitchMatch(args[j], _T("emulate3fuzz") )) {
			if (++j == i) {
				ArgError(_T("No fuzz specified"));
				continue;
			}
			if (_stscanf(args[j], _T("%d"), &m_Emul3Fuzz) != 1) {
				ArgError(_T("Invalid fuzz specified"));
				continue;
			}
			
		} else if ( SwitchMatch(args[j], _T("disableclipboard") )) {
			m_DisableClipboard = true;
		}
#ifdef UNDER_CE
		// Manual setting of palm vs hpc aspect ratio for dialog boxes.
		else if ( SwitchMatch(args[j], _T("hpc") )) {
			m_palmpc = false;
		} else if ( SwitchMatch(args[j], _T("palm") )) {
			m_palmpc = true;
		} else if ( SwitchMatch(args[j], _T("slow") )) {
			m_slowgdi = true;
		} 
#endif
		else if ( SwitchMatch(args[j], _T("delay") )) {
			if (++j == i) {
				ArgError(_T("No delay specified"));
				continue;
			}
			if (_stscanf(args[j], _T("%d"), &m_delay) != 1) {
				ArgError(_T("Invalid delay specified"));
				continue;
			}
			
		} else if ( SwitchMatch(args[j], _T("loglevel") )) {
			if (++j == i) {
				ArgError(_T("No loglevel specified"));
				continue;
			}
			if (_stscanf(args[j], _T("%d"), &m_logLevel) != 1) {
				ArgError(_T("Invalid loglevel specified"));
				continue;
			}
			
		} else if ( SwitchMatch(args[j], _T("console") )) {
			m_logToConsole = true;
		} else if ( SwitchMatch(args[j], _T("logfile") )) {
			if (++j == i) {
				ArgError(_T("No logfile specified"));
				continue;
			}
			if (_stscanf(args[j], _T("%s"), &m_logFilename) != 1) {
				ArgError(_T("Invalid logfile specified"));
				continue;
			} else {
				m_logToFile = true;
			}
		} else if ( SwitchMatch(args[j], _T("config") )) {
			if (++j == i) {
				ArgError(_T("No config file specified"));
				continue;
			}
			// The GetPrivateProfile* stuff seems not to like some relative paths
			_fullpath(m_configFilename, args[j], _MAX_PATH);
			if (_access(m_configFilename, 04)) {
				ArgError(_T("Can't open specified config file for reading."));
				PostQuitMessage(1);
				continue;
			} else {
				Load(m_configFilename);
				m_configSpecified = true;
			}
		} else if ( SwitchMatch(args[j], _T("register") )) {
			Register();
			PostQuitMessage(0);
		} else {
			TCHAR phost[256];
			if (!ParseDisplay(args[j], phost, 255, &m_port)) {
				ShowUsage(_T("Invalid VNC server specified."));
				PostQuitMessage(1);
			} else {
				_tcscpy(m_host, phost);
				m_connectionSpecified = true;
			}
		}
	}       
	
	if (m_scale_num != 1 || m_scale_den != 1) 			
		m_scaling = true;

	// reduce scaling factors by greatest common denominator
	if (m_scaling) {
		FixScaling();
	}
	// tidy up
	delete [] cmd;
	delete [] args;
}
开发者ID:lubing521,项目名称:important-files,代码行数:101,代码来源:VNCOptions.cpp


示例19: m_Width

	Texture::Texture(uint width, uint height, uint bits)
		: m_Width(width), m_Height(height), m_Bits(24), m_FileName("NULL")
	{
		m_TID = Load();
	}
开发者ID:Itay2805,项目名称:Sparky4j-core,代码行数:5,代码来源:Texture.cpp


示例20: _T

bool CWelcomeDialog::Run(wxWindow* parent, bool force /*=false*/, bool delay /*=false*/)
{
	const wxString ownVersion = CBuildInfo::GetVersion();
	wxString greetingVersion = COptions::Get()->GetOption(OPTION_GREETINGVERSION);

	wxString const resources = COptions::Get()->GetOption(OPTION_GREETINGRESOURCES);
	COptions::Get()->SetOption(OPTION_GREETINGRESOURCES, _T(""));

	if (!force) {
		if (COptions::Get()->GetOptionVal(OPTION_DEFAULT_KIOSKMODE) == 2) {
			if (delay)
				delete this;
			return true;
		}

		if (!greetingVersion.empty() &&
			CBuildInfo::ConvertToVersionNumber(ownVersion.c_str()) <= CBuildInfo::ConvertToVersionNumber(greetingVersion.c_str()))
		{
			// Been there done that
			if (delay)
				delete this;
			return true;
		}
		COptions::Get()->SetOption(OPTION_GREETINGVERSION, ownVersion.ToStdWstring());

		if (greetingVersion.empty() && !COptions::Get()->GetOptionVal(OPTION_DEFAULT_KIOSKMODE))
			COptions::Get()->SetOption(OPTION_PROMPTPASSWORDSAVE, 1);
	}

	if (!Load(parent, _T("ID_WELCOME"))) {
		if (delay) {
			delete this;
		}
		return false;
	}

	InitFooter(force ? wxString() : resources);

	xrc_call(*this, "ID_FZVERSION", &wxStaticText::SetLabel, _T("FileZilla ") + CBuildInfo::GetVersion());

	wxString const url = _T("https://welcome.filezilla-project.org/welcome?type=client&category=%s&version=") + ownVersion;

	if (!greetingVersion.empty()) {
		xrc_call(*this, "ID_LINK_NEWS", &wxHyperlinkCtrl::SetURL, wxString::Format(url, _T("news")) + _T("&oldversion=") + greetingVersion);
		xrc_call(*this, "ID_LINK_NEWS", &wxHyperlinkCtrl::SetLabel, wxString::Format(_("New features and improvements in %s"), CBuildInfo::GetVersion()));
	}
	else {
		xrc_call(*this, "ID_LINK_NEWS", &wxHyperlinkCtrl::Hide);
		xrc_call(*this, "ID_HEADING_NEWS", &wxStaticText::Hide);
	}

	xrc_call(*this, "ID_DOCUMENTATION_BASIC", &wxHyperlinkCtrl::SetURL, wxString::Format(url, _T("documentation_basic")));
	xrc_call(*this, "ID_DOCUMENTATION_NETWORK", &wxHyperlinkCtrl::SetURL, wxString::Format(url, _T("documentation_network")));
	xrc_call(*this, "ID_DOCUMENTATION_MORE", &wxHyperlinkCtrl::SetURL, wxString::Format(url, _T("documentation_more")));
	xrc_call(*this, "ID_SUPPORT_FORUM", &wxHyperlinkCtrl::SetURL, wxString::Format(url, _T("support_forum")));
	xrc_call(*this, "ID_SUPPORT_MORE", &wxHyperlinkCtrl::SetURL, wxString::Format(url, _T("support_more")));

#ifdef FZ_WINDOWS
	// Add phone support link in official Windows builds builds...
	if (CBuildInfo::GetBuildType() == _T("official")) {
		auto lang = wxGetLocale() ? wxGetLocale()->GetName() : wxString();
		// but only in English...
		if (lang.StartsWith(_T("en"))) {
			auto const now = fz::datetime::now();
			// while the build is fresh...
			if ((now - CBuildInfo::GetBuildDate()).get_days() < 60) {
				// and only for US and Canada, so limit by timezone
				auto ref = fz::datetime(now.format("%Y%m%d%H%M%S", fz::datetime::utc), fz::datetime::utc);
				auto offset = fz::datetime(ref.format("%Y%m%d%H%M%S", fz::datetime::utc), fz::datetime::local);
				auto diff = (ref - offset).get_hours();
				if (diff >= -9 && diff <= -3) {
					auto sizer = xrc_call(*this, "ID_SUPPORT_MORE", &wxWindow::GetContainingSizer);
					if (sizer) {
						auto link = new wxHyperlinkCtrl(sizer->GetContainingWindow(), wxID_ANY, _T("Phone support"), _T("https://filezilla-project.org/phone_support.php"));
						sizer->Insert(0, link);
					}
				}
			}
		}
	}
#endif

	Layout();

	GetSizer()->Fit(this);

	if (delay) {
		m_delayedShowTimer.SetOwner(this);
		m_delayedShowTimer.Start(10, true);
	}
	else
		ShowModal();

	return true;
}
开发者ID:zedfoxus,项目名称:filezilla-client,代码行数:95,代码来源:welcome_dialog.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LoadBMP函数代码示例发布时间:2022-05-30
下一篇:
C++ LnkMsg函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap