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


C++ Localize函数代码示例

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


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

示例1: Graphics

void CScoreboard::RenderSpectators(float x, float y, float w)
{
    float h = 140.0f;

    // background
    Graphics()->BlendNormal();
    Graphics()->TextureSet(-1);
    Graphics()->QuadsBegin();
    Graphics()->SetColor(0,0,0,0.5f);
    RenderTools()->DrawRoundRect(x, y, w, h, 10.0f);
    Graphics()->QuadsEnd();

    // Headline
    y += 10.0f;
    TextRender()->Text(0, x+10.0f, y, 28.0f, Localize("Spectators"), w-20.0f);

    // spectator names
    y += 30.0f;
    char aBuffer[1024*4];
    aBuffer[0] = 0;
    bool Multiple = false;
    for(int i = 0; i < MAX_CLIENTS; ++i)
    {
        const CNetObj_PlayerInfo *pInfo = m_pClient->m_Snap.m_paPlayerInfos[i];
        if(!pInfo || pInfo->m_Team != TEAM_SPECTATORS)
            continue;

        if(Multiple)
            str_append(aBuffer, ", ", sizeof(aBuffer));
        if(m_IsGameTypeRace)
            if (g_Config.m_ClShowIDs)
            {
                char aId[4];
                str_format(aId,sizeof(aId),"%d:",pInfo->m_ClientID);
                str_append(aBuffer, aId, sizeof(aBuffer));
            }
        str_append(aBuffer, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, sizeof(aBuffer));
        Multiple = true;
    }
    CTextCursor Cursor;
    TextRender()->SetCursor(&Cursor, x+10.0f, y, 22.0f, TEXTFLAG_RENDER);
    Cursor.m_LineWidth = w-20.0f;
    Cursor.m_MaxLines = 4;
    TextRender()->TextEx(&Cursor, aBuffer, -1);
}
开发者ID:RaZeRKawasaki,项目名称:B-GDDRace,代码行数:45,代码来源:scoreboard.cpp

示例2: Graphics

void CScoreboard::RenderLocalTime()
{
	//draw the box
	Graphics()->BlendNormal();
	Graphics()->TextureSet(-1);
	Graphics()->QuadsBegin();
	Graphics()->SetColor(HexToVec4(g_Config.m_hcContainerBackgroundColor));
	RenderTools()->DrawRoundRectExt(0.0f, 180.0f, 190.0f, 75.0f, 15.0f, CUI::CORNER_R);
	Graphics()->QuadsEnd();

	//draw the text
    char aBuf[12];
    time_t rawtime = time(NULL);
    struct tm *timeinfo = localtime(&rawtime);
    strftime(aBuf, sizeof(aBuf), "%I:%M:%S %p", timeinfo);
    TextRender()->Text(0, 10.0f, 190.0f, 20.0f, Localize("LOCAL TIME"), -1);
	TextRender()->Text(0, 40.0f, 215.0f, 20.0f, aBuf, -1);
}
开发者ID:digideskio,项目名称:HClient,代码行数:18,代码来源:scoreboard.cpp

示例3: SetImageList

void CQueueListCtrl::Init()
{
	static const uint16 s_auColHdr[][2] =
	{
		{ LVCFMT_LEFT, 150 },	// QLCOL_USERNAME
		{ LVCFMT_LEFT, 275 },	// QLCOL_FILENAME
		{ LVCFMT_LEFT, 110 },	// QLCOL_FILEPRIORITY
		{ LVCFMT_LEFT, 110 },	// QLCOL_PARTS
		{ LVCFMT_LEFT, 110 },	// QLCOL_PROGRESS
		{ LVCFMT_LEFT,  60 },	// QLCOL_QLRATING
		{ LVCFMT_LEFT,  60 },	// QLCOL_SCORE
		{ LVCFMT_LEFT,  60 },	// QLCOL_SFRATIO
		{ LVCFMT_LEFT,  60 },	// QLCOL_RFRATIO
		{ LVCFMT_LEFT,  60 },	// QLCOL_TIMESASKED
		{ LVCFMT_LEFT, 110 },	// QLCOL_LASTSEEN
		{ LVCFMT_LEFT, 110 },	// QLCOL_ENTEREDQUEUE
		{ LVCFMT_LEFT,  60 },	// QLCOL_BANNED
		{ LVCFMT_LEFT, 150 }	// QLCOL_COUNTRY
	};
	CImageList		ilDummyImageList;

	ilDummyImageList.Create(1, 17,g_App.m_iDfltImageListColorFlags | ILC_MASK, 1, 1);
	SetImageList(&ilDummyImageList, LVSIL_SMALL);
	ilDummyImageList.Detach();

	m_iClientFilter = CLI_FILTER_NONE;

	memzero(m_iColumnMaxWidths, sizeof(m_iColumnMaxWidths));
//	Index of the column being measured. -1 for none.
	m_iMeasuringColumn = -1;

	SetExtendedStyle(LVS_EX_FULLROWSELECT);
	for (unsigned ui = 0; ui < ARRSIZE(s_auColHdr); ui++)
		InsertColumn(ui, _T(""), static_cast<int>(s_auColHdr[ui][0]), static_cast<int>(s_auColHdr[ui][1]), ui);

	Localize();

	LoadSettings(CPreferences::TABLE_QUEUE);
	SetSortProcedure(SortProc);
	if (g_App.m_pPrefs->DoUseSort())
		SortInit(g_App.m_pPrefs->GetQueueSortCol());
	else
		SortInit(g_App.m_pPrefs->GetColumnSortCode(CPreferences::TABLE_QUEUE));
}
开发者ID:rusingineer,项目名称:EmulePlus,代码行数:44,代码来源:QueueListCtrl.cpp

示例4: CModeless

void CPartFileConvert::ShowGUI(){

	if (m_convertgui)
		m_convertgui->SetForegroundWindow();
	else {
		m_convertgui= new CModeless();
		m_convertgui->Create( IDD_CONVERTPARTFILES , CWnd::GetDesktopWindow() );//,  );
		InitWindowStyles(m_convertgui);
		m_convertgui->ShowWindow(SW_SHOW);

		m_convertgui->AddAnchor(IDC_CONV_PB_CURRENT, TOP_LEFT, TOP_RIGHT);
		m_convertgui->AddAnchor(IDC_CURJOB, TOP_LEFT, TOP_RIGHT);
		m_convertgui->AddAnchor(IDC_CONV_PB_LABEL, TOP_LEFT, TOP_RIGHT);
		m_convertgui->AddAnchor(IDC_CONV_PROZENT, TOP_RIGHT);
		m_convertgui->AddAnchor(IDC_JOBLIST, TOP_LEFT, BOTTOM_RIGHT);
		m_convertgui->AddAnchor(IDC_ADDITEM, BOTTOM_LEFT);
		m_convertgui->AddAnchor(IDC_RETRY, BOTTOM_LEFT);
		m_convertgui->AddAnchor(IDC_CONVREMOVE, BOTTOM_LEFT);
		m_convertgui->AddAnchor(IDC_HIDECONVDLG, BOTTOM_RIGHT);

		m_convertgui->SetIcon(theApp.LoadIcon(_T("CONVERT"),16,16),FALSE);
		
		// init gui
		m_convertgui->pb_current.SetRange(0,100);
		m_convertgui->joblist.SetExtendedStyle(LVS_EX_FULLROWSELECT);
		m_convertgui->joblist.ModifyStyle(LVS_SINGLESEL,0);


		if (!pfconverting==NULL)  { 
			UpdateGUI(pfconverting);
			UpdateGUI(50,GetResString(IDS_IMP_FETCHSTATUS),true);
		}

		Localize();

		// fill joblist
		ConvertJob* job;
		for(POSITION pos = m_jobs.GetHeadPosition(); pos != NULL; m_jobs.GetNext(pos)){
			job=m_jobs.GetAt(pos);
			m_convertgui->AddJob(job);
			UpdateGUI(job);
		}
	}
}
开发者ID:BackupTheBerlios,项目名称:nextemf,代码行数:44,代码来源:PartFileConvert.cpp

示例5: TranslateLineThreadProc

void TranslateLineThreadProc(void * Data)
{
	char * Text = (char *)Data;

	if (Text[0] == 0)
		return;

	const char * Target = Localize("en");
	if (g_Config.m_ClChatTranslateTarget[0] != 0)
		Target = g_Config.m_ClChatTranslateTarget;

	char * Result = CTranslate::Translate(Text, Target);
	if (!Result)
		return;

	str_format(Text, 1024 - 2, "%s", Result);

	mem_free(Result);
}
开发者ID:kaddyd,项目名称:teeworlds,代码行数:19,代码来源:chat.cpp

示例6: SetName

bool CServerListCtrl::Init()
{
	SetName(_T("ServerListCtrl"));
	ModifyStyle(0,LVS_SINGLESEL|LVS_REPORT);
	ModifyStyle(LVS_SINGLESEL|LVS_LIST|LVS_ICON|LVS_SMALLICON,LVS_REPORT); //here the CListCtrl is set to report-style
	SetExtendedStyle(GetExtendedStyle() | LVS_EX_INFOTIP);

	CToolTipCtrl* tooltip = GetToolTips();
	if (tooltip) {
		m_tooltip->SubclassWindow(*tooltip);
		tooltip->ModifyStyle(0, TTS_NOPREFIX);
		tooltip->SetDelayTime(TTDT_AUTOPOP, 20000);
		tooltip->SetDelayTime(TTDT_INITIAL, thePrefs.GetToolTipDelay()*1000);
	}

	InsertColumn(0, GetResString(IDS_SL_SERVERNAME),LVCFMT_LEFT, 150);
	InsertColumn(1, GetResString(IDS_IP),			LVCFMT_LEFT, 140);
	InsertColumn(2, GetResString(IDS_DESCRIPTION),	LVCFMT_LEFT, 150);
	InsertColumn(3, GetResString(IDS_PING),			LVCFMT_RIGHT, 50);
	InsertColumn(4, GetResString(IDS_UUSERS),		LVCFMT_RIGHT, 50);
	InsertColumn(5, GetResString(IDS_MAXCLIENT),	LVCFMT_RIGHT, 50);
	InsertColumn(6, GetResString(IDS_PW_FILES) ,	LVCFMT_RIGHT, 50);
	InsertColumn(7, GetResString(IDS_PREFERENCE),	LVCFMT_LEFT,  60);
	InsertColumn(8, GetResString(IDS_UFAILED),		LVCFMT_RIGHT, 50);
	InsertColumn(9, GetResString(IDS_STATICSERVER),	LVCFMT_LEFT,  50);
	InsertColumn(10,GetResString(IDS_SOFTFILES),	LVCFMT_RIGHT, 50);
	InsertColumn(11,GetResString(IDS_HARDFILES),	LVCFMT_RIGHT, 50);
	InsertColumn(12,GetResString(IDS_VERSION),		LVCFMT_LEFT,  50);
	InsertColumn(13,GetResString(IDS_IDLOW),		LVCFMT_RIGHT, 50);
	InsertColumn(14,GetResString(IDS_OBFUSCATION)  ,LVCFMT_RIGHT, 50);

	SetAllIcons();
	Localize();
	LoadSettings();

	// Barry - Use preferred sort order from preferences
	SetSortArrow();
	SortItems(SortProc, MAKELONG(GetSortItem(), (GetSortAscending()? 0 : 0x0001)));

	ShowServerCount();

	return true;
} 
开发者ID:LjApps,项目名称:eMule-VeryCD,代码行数:43,代码来源:ServerListCtrl.cpp

示例7: InitWindowStyles

BOOL CPPgDisplay::OnInitDialog()
{
	CPropertyPage::OnInitDialog();
	InitWindowStyles(this);

	// Barry - Controls depth of 3d colour shading
	CSliderCtrl *slider3D = (CSliderCtrl*)GetDlgItem(IDC_3DDEPTH);
	slider3D->SetRange(0, 5, true);
	slider3D->SetPos(thePrefs.Get3DDepth());
	slider3D->SetTicFreq(1);
	DrawPreview();


	LoadSettings();
	Localize();

	return TRUE;  // return TRUE unless you set the focus to a control
				  // EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:acat,项目名称:emule,代码行数:19,代码来源:PPgDisplay.cpp

示例8: time_get

void CHud::RenderTeambalanceWarning()
{
	// render prompt about team-balance
	bool Flash = time_get()/(time_freq()/2)%2 == 0;
	if(m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_TEAMS)
	{
		int TeamDiff = m_pClient->m_Snap.m_aTeamSize[TEAM_RED]-m_pClient->m_Snap.m_aTeamSize[TEAM_BLUE];
		if (g_Config.m_ClWarningTeambalance && (TeamDiff >= 2 || TeamDiff <= -2))
		{
			const char *pText = Localize("Please balance teams!");
			if(Flash)
				TextRender()->TextColor(1,1,0.5f,1);
			else
				TextRender()->TextColor(0.7f,0.7f,0.2f,1.0f);
			TextRender()->Text(0x0, 5, 50, 6, pText, -1);
			TextRender()->TextColor(1,1,1,1);
		}
	}
}
开发者ID:paaszczak,项目名称:teeworlds-neural-network,代码行数:19,代码来源:hud.cpp

示例9: Localize

BOOL CPPgNextEMF::OnInitDialog()
{
//==>WiZaRd AntiLeechClass [cyrex2001]
#ifdef ANTI_LEECH_CLASS
	m_bEnableAntiNickThief = thePrefs.m_bAntiNickThief;
	m_bEnableAntiModThief = thePrefs.m_bAntiModThief;
	m_iClientBanTime = (int) (thePrefs.m_iClientBanTime);
#endif //WiZaRd AntiLeechClass
//<==WiZaRd AntiLeechClass [cyrex2001]

//==>SNAFU [shadow2004]
#ifdef SNAFU
	m_bSnafu = thePrefs.m_bSnafu;
#endif
//<==SNAFU [shadow2004]

//==> Emulate others by WiZaRd & Spike [shadow2004]
#ifdef EMULATE
	EmuMLDonkey      = thePrefs.EmuMLDonkey;
	EmueDonkey       = thePrefs.EmueDonkey;
	EmueDonkeyHybrid = thePrefs.EmueDonkeyHybrid;
	EmuShareaza      = thePrefs.EmuShareaza;
#endif
//<== Emulate others by WiZaRd & Spike [shadow2004]

//==> Chunk Selection Patch by Xman [shadow2004]
#ifdef CSP
	m_iEnableCSP	= thePrefs.m_iEnableCSP;
#endif
//<== Chunk Selection Patch by Xman [shadow2004]

//==> Linear Prio [shadow2004]
#ifdef LINPRIO
	m_bAutoSetResumeOrder = thePrefs.m_bAutoSetResumeOrder;
#endif
//<== Linear Prio [shadow2004]

	CPropertyPage::OnInitDialog();
	Localize();
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:BackupTheBerlios,项目名称:nextemf,代码行数:42,代码来源:PPgNextEMF.cpp

示例10: InitImageList

int CTbcShare::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CToolBarCtrlZ::OnCreate(lpCreateStruct) == -1)
		return -1;

	// TODO:  在此添加您专用的创建代码
	theWndMgr.m_pTbcShare = this;

	int	i = 0;

	InitImageList();

	AddSingleString(GetResString(IDS_OPEN));
	AddSingleString(GetResString(IDS_OPENFOLDER));
	AddSingleString(GetResString(IDS_RENAME));
	AddSingleString(GetResString(IDS_DELETE_FILE));
	AddSingleString(GetResString(IDS_SF_RELOAD));


	TBBUTTON	tbb[BUTTON_COUNT];
	CString		str;

	tbb[0].idCommand = MP_OPEN;
	tbb[1].idCommand = MP_OPENFOLDER;
	tbb[2].idCommand = MP_RENAME;
	tbb[3].idCommand = MP_REMOVE;
	tbb[4].idCommand = MP_REFRESH;

	for (i = 0; i < BUTTON_COUNT; i++)
	{
		tbb[i].iString = i;
		tbb[i].iBitmap = i;
		tbb[i].fsState = 0;
		tbb[i].fsStyle = TBSTYLE_BUTTON | BTNS_AUTOSIZE;
	}
	AddButtons(BUTTON_COUNT, tbb);

	EnableButton(MP_REFRESH);

	Localize();
	return 0;
}
开发者ID:litaobj,项目名称:easymule,代码行数:42,代码来源:TbcShare.cpp

示例11: AboutDialogBase

AboutDialog::AboutDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name)
: AboutDialogBase(parent, id, title, pos, size, style) {
  iconBitmap->SetBitmap(wxBitmap(FilePaths::GetBaseSkinDirectory() + _T("/ApplicationIcon48.png"), wxBITMAP_TYPE_PNG));
  
  wxFont linkLabelFont(linkLabel->GetFont());
  linkLabelFont.SetUnderlined(true);
  linkLabel->SetFont(linkLabelFont);
  linkLabel->SetForegroundColour(wxColour(0,0,255));
  linkLabel->SetCursor(wxCursor(wxCURSOR_HAND));
  linkLabel->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(AboutDialog::OnLinkLabelMouseDown), NULL, this);

  wxFont contactLabelFont(linkLabel->GetFont());
  contactLabelFont.SetUnderlined(true);
  contactLabel2->SetFont(contactLabelFont);
  contactLabel2->SetForegroundColour(wxColour(0,0,255));
  contactLabel2->SetCursor(wxCursor(wxCURSOR_HAND));
  contactLabel2->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(AboutDialog::OnContactLabelMouseDown), NULL, this);
  
  Localize();
}
开发者ID:tanaga9,项目名称:appetizer,代码行数:20,代码来源:AboutDialog.cpp

示例12: Localize

void CHud::RenderStartCountdown()
{
	if(m_pClient->m_Snap.m_pGameData->m_GameStateFlags&GAMESTATEFLAG_STARTCOUNTDOWN)
	{
		const char *pText = Localize("Game starts in");
		float FontSize = 20.0f;
		float w = TextRender()->TextWidth(0, FontSize, pText, -1);
		TextRender()->Text(0, 150*Graphics()->ScreenAspect()+-w/2, 50, FontSize, pText, -1);

		if(m_pClient->m_Snap.m_pGameData->m_GameStateEndTick == 0)
			return;
		
		FontSize = 16.0f;
		char aBuf[32];
		int Seconds = (m_pClient->m_Snap.m_pGameData->m_GameStateEndTick-Client()->GameTick()+SERVER_TICK_SPEED-1)/SERVER_TICK_SPEED;
		str_format(aBuf, sizeof(aBuf), "%d", Seconds);
		w = TextRender()->TextWidth(0, FontSize, aBuf, -1);
		TextRender()->Text(0, 150*Graphics()->ScreenAspect()+-w/2, 75, FontSize, aBuf, -1);
	}
}
开发者ID:Mailaender,项目名称:teeworlds,代码行数:20,代码来源:hud.cpp

示例13: Client

void CHud::RenderSpectatorNotification()
{
	if(m_pClient->m_aClients[m_pClient->m_LocalClientID].m_Team == TEAM_SPECTATORS &&
		m_pClient->m_TeamChangeTime + 5.0f >= Client()->LocalTime())
	{
		// count non spectators
		int NumPlayers = 0;
		for(int i = 0; i < MAX_CLIENTS; i++)
			if(m_pClient->m_aClients[i].m_Active && m_pClient->m_aClients[i].m_Team != TEAM_SPECTATORS)
				NumPlayers++;

		if(NumPlayers > 0)
		{
			const char *pText = Localize("Click on a player or a flag to follow it");
			float FontSize = 16.0f;
			float w = TextRender()->TextWidth(0, FontSize, pText, -1, -1.0f);
			TextRender()->Text(0, 150 * Graphics()->ScreenAspect() + -w / 2, 30, FontSize, pText, -1.0f);
		}
	}
}
开发者ID:BotoX,项目名称:teeworlds,代码行数:20,代码来源:hud.cpp

示例14: SetPrefsKey

void CDownloadClientsCtrl::Init()
{
	SetPrefsKey(_T("DownloadClientsCtrl"));
	SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);

	InsertColumn(0,	GetResString(IDS_QL_USERNAME),		LVCFMT_LEFT,  DFLT_CLIENTNAME_COL_WIDTH);
	InsertColumn(1,	GetResString(IDS_CD_CSOFT),			LVCFMT_LEFT,  DFLT_CLIENTSOFT_COL_WIDTH);
	InsertColumn(2,	GetResString(IDS_FILE),				LVCFMT_LEFT,  DFLT_FILENAME_COL_WIDTH);
	InsertColumn(3,	GetResString(IDS_DL_SPEED),			LVCFMT_RIGHT, DFLT_DATARATE_COL_WIDTH);
	InsertColumn(4, GetResString(IDS_AVAILABLEPARTS),	LVCFMT_LEFT,  DFLT_PARTSTATUS_COL_WIDTH);
	InsertColumn(5,	GetResString(IDS_CL_TRANSFDOWN),	LVCFMT_RIGHT, DFLT_SIZE_COL_WIDTH);
	InsertColumn(6,	GetResString(IDS_CL_TRANSFUP),		LVCFMT_RIGHT, DFLT_SIZE_COL_WIDTH);
	InsertColumn(7,	GetResString(IDS_META_SRCTYPE),		LVCFMT_LEFT,  100);

	SetAllIcons();
	Localize();
	LoadSettings();
	SetSortArrow();
	SortItems(SortProc, GetSortItem() + (GetSortAscending() ? 0 : 100));
}
开发者ID:HackLinux,项目名称:eMule-Mirror,代码行数:20,代码来源:DownloadClientsCtrl.cpp

示例15: Localize

void CMuleToolbarCtrl::OnTbnToolbarChange(NMHDR* /*pNMHDR*/, LRESULT* pResult)
{
	CString config;
	for (int i = 0; i < GetButtonCount();i++)
	{
		TBBUTTON buttoninfo;
		if (GetButton(i, &buttoninfo))
			config.AppendFormat(_T("%02i"), (buttoninfo.idCommand != 0) ? buttoninfo.idCommand - IDC_TOOLBARBUTTON : 99);
	}

	thePrefs.SetToolbarSettings(config);
	Localize();

	theApp.emuledlg->ShowConnectionState();

	SetAllButtonsWidth();
	AutoSize();

	*pResult = 0;
}
开发者ID:dalinhuang,项目名称:dmibox,代码行数:20,代码来源:MuleToolBarCtrl.cpp


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