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


C++ AddText函数代码示例

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


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

示例1: ShowModuleInfo

VOID ShowModuleInfo(HWND hwnd, PCTSTR pszModulePath) {

   SetWindowText(hwnd, TEXT(""));   // Clear the output box

   CToolhelp thProcesses(TH32CS_SNAPPROCESS);
   PROCESSENTRY32 pe = { sizeof(pe) };
   BOOL fOk = thProcesses.ProcessFirst(&pe);
   AddText(hwnd, TEXT("Pathname: %s\r\n\r\n"), pszModulePath);
   AddText(hwnd, TEXT("Process Information:\r\n"));
   AddText(hwnd, TEXT("     PID    %-*s  Process\r\n"), 
	   s_cchAddress, TEXT("BaseAddr"));

   for (; fOk; fOk = thProcesses.ProcessNext(&pe)) {
      CToolhelp thModules(TH32CS_SNAPMODULE, pe.th32ProcessID);
      MODULEENTRY32 me = { sizeof(me) };
      BOOL fOk = thModules.ModuleFirst(&me);
      for (; fOk; fOk = thModules.ModuleNext(&me)) {
         if (_tcscmp(me.szExePath, pszModulePath) == 0) {
            AddText(hwnd, TEXT("  %08X  %p  %s\r\n"), 
               pe.th32ProcessID, me.modBaseAddr, pe.szExeFile);
         }
      }
   }
}
开发者ID:melvinvarkey,项目名称:ANCI_C_Training,代码行数:24,代码来源:ProcessInfo.cpp

示例2: AddText

LRESULT CAddTaskLinksEdit::OnDocUrlModified(WPARAM wParam, LPARAM lParam)
{
	if (0 == lParam)
		return 0;

	BOOL	bCheck = (BOOL) wParam;
	CString	strUrl = (LPCTSTR) lParam;

	if (bCheck)
		AddText(strUrl);
	else
		RemoveLine(strUrl);

	return 0;
}
开发者ID:techpub,项目名称:archive-code,代码行数:15,代码来源:AddTaskLinksEdit.cpp

示例3: ParseWordList

void ParseWordList (TraverseCtx &Ctx, CXMLElement *pElement)
	{
	int i;

	//	Parse all attributes

	for (i = 0; i < pElement->GetAttributeCount(); i++)
		AddText(Ctx, pElement->GetAttribute(i));

	//	If this has sub-elements, then recurse

	if (pElement->GetContentElementCount())
		{
		for (i = 0; i < pElement->GetContentElementCount(); i++)
			ParseWordList(Ctx, pElement->GetContentElement(i));
		}

	//	Otherwise, add the content 

	else
		{
		AddText(Ctx, pElement->GetContentText(0));
		}
	}
开发者ID:Arkheias,项目名称:Transcendence,代码行数:24,代码来源:Words.cpp

示例4: IngameWindow

iwTrade::iwTrade(const nobBaseWarehouse& wh, const GameWorldViewer& gwv, GameCommandFactory& gcFactory)
    : IngameWindow(wh.CreateGUIID(), (unsigned short) - 2, (unsigned short) - 2, 400, 194, _("Trade"), LOADER.GetImageN("resource", 41)),
      wh(wh), gwv(gwv), gcFactory(gcFactory), possibleSrcWarehouses(gwv.GetPlayer().GetWarehousesForTrading(wh))
{
    // Get title of the player
    SetTitle(_("Trade with %s") + gwv.GetWorld().GetPlayer(wh.GetPlayer()).name);
    // Gebäudebild und dessen Schatten
    AddImage( 0, 100, 144, LOADER.GetNationImage(wh.GetNation(), 250 + 5 * wh.GetBuildingType()));

    const unsigned left_column = 200;

    this->AddComboBox(4, left_column, 84, 160, 18, TC_GREY, NormalFont, 90); // Ware/Figure names
    this->AddText(1, left_column, 30, "Deal in:", COLOR_YELLOW, glArchivItem_Font::DF_LEFT, NormalFont);
    ctrlComboBox* box = this->AddComboBox(2, left_column, 44, 160, 18, TC_GREY, NormalFont, 200); // Ware or figure?
    box->AddString(_("Wares"));
    box->AddString(_("Settlers"));
    this->AddText(3, left_column, 70, "Type:", COLOR_YELLOW, glArchivItem_Font::DF_LEFT, NormalFont);


    // Create possible wares, figures
    for(unsigned i = 0; i < WARE_TYPES_COUNT; ++i)
    {
        // Only add one shield type
        if(GoodType(i) != ConvertShields(GoodType(i)))
            continue;
        // Don't add nothing or empty water
        if(i == GD_NOTHING || i == GD_WATEREMPTY)
            continue;
        wares.push_back(GoodType(i));
    }
    for(unsigned i = 0; i < JOB_TYPES_COUNT; ++i)
    {
        // Can't trade boat carriers
        if(i == JOB_BOATCARRIER)
            continue;
        jobs.push_back(Job(i));
    }

    AddImage(5, left_column + 20, 130, NULL, _("Ware you like to trade"));
    AddEdit(6, left_column + 34, 120, 39 , 20, TC_GREY, NormalFont)->SetNumberOnly(true);
    AddText(7, left_column + 75, 125, "/ 20", COLOR_YELLOW, glArchivItem_Font::DF_LEFT, NormalFont);

    AddTextButton(8, left_column, 150, 150, 22, TC_GREEN2, _("Send"), NormalFont);

    // Choose wares at first
    box->SetSelection(0);
    Msg_ComboSelectItem(2, 0);
}
开发者ID:viksuhor,项目名称:s25client,代码行数:48,代码来源:iwTrade.cpp

示例5: IngameWindow

iwPostWindow::iwPostWindow(GameWorldViewer& gwv)
    : IngameWindow(CGI_POSTOFFICE, 0xFFFF, 0xFFFF, 254, 295, _("Post office"), LOADER.GetImageN("resource", 41)), gwv(gwv)
{
    AddImageButton( 0, 18, 25, 35, 35, TC_GREY, LOADER.GetImageN("io", 190));   // Viewer: 191 - Papier
    AddImageButton( 1, 56, 25, 35, 35, TC_GREY, LOADER.GetImageN("io", 30));    // Viewer:  31 - Soldat
    AddImageButton( 2, 91, 25, 35, 35, TC_GREY, LOADER.GetImageN("io", 20));    // Viewer:  21 - Geologe
    AddImageButton( 3, 126, 25, 35, 35, TC_GREY, LOADER.GetImageN("io", 28));   // Viewer:  29 - Wage
    AddImageButton( 4, 161, 25, 35, 35, TC_GREY, LOADER.GetImageN("io", 189));  // Viewer: 190 - Neue Nachricht
    AddImageButton( 5, 199, 25, 35, 35, TC_GREY, LOADER.GetImageN("io", 79));   // Viewer:  80 - Notiz
    AddImage(  6, 126, 151, LOADER.GetImageN("io", 228));
    AddImageButton( 7, 18, 242, 30, 35, TC_GREY, LOADER.GetImageN("io", 225));  // Viewer: 226 - Hilfe
    AddImageButton( 8, 51, 246, 30, 26, TC_GREY, LOADER.GetImageN("io", 102));  // Viewer: 103 - Schnell zurück
    AddImageButton( 9, 81, 246, 30, 26, TC_GREY, LOADER.GetImageN("io", 103));  // Viewer: 104 - Zurück
    AddImageButton(10, 111, 246, 30, 26, TC_GREY, LOADER.GetImageN("io", 104)); // Viewer: 105 - Vor
    AddImageButton(11, 141, 246, 30, 26, TC_GREY, LOADER.GetImageN("io", 105)); // Viewer: 106 - Schnell vor


    gotoButton = AddImageButton(14, 181, 246, 30, 26, TC_GREY, LOADER.GetImageN("io", 107)); // Goto, nur sichtbar wenn Nachricht mit Koordinaten da
    gotoButton->SetVisible(false);
    deleteButton = AddImageButton(15, 211, 246, 30, 26, TC_GREY, LOADER.GetImageN("io", 106)); // Mülleimer, nur sichtbar, wenn Nachricht da
    deleteButton->SetVisible(false);



    postMsgInfos = AddText(18, 127, 228, "", MakeColor(255, 188, 100, 88), glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, SmallFont);
    postMsgInfos->SetVisible(false);

    postImage = AddImage(13, 127, 155, LOADER.GetImageN("io", 225));

    // Multiline-Teil mit drei leeren Zeilen erzeugen
    ctrlMultiline* text = AddMultiline(12, 126, 141, 200, 50, TC_INVISIBLE, NormalFont, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM | glArchivItem_Font::DF_NO_OUTLINE);
    text->EnableBox(false);
    text->AddString("", COLOR_WINDOWBROWN, false);
    text->AddString("", COLOR_WINDOWBROWN, false);
    text->AddString("", COLOR_WINDOWBROWN, false);

    SetMessageText(_("No letters!"));

    acceptButton = AddImageButton(16, 87, 185, 30, 26, TC_GREEN1, LOADER.GetImageN("io", 32)); // Button mit Haken, zum Annehmen von Verträgen
    acceptButton->SetVisible(false);
    declineButton = AddImageButton(17, 137, 185, 30, 26, TC_RED1, LOADER.GetImageN("io", 40)); // Button mit Kreuz, zum Ablehnen von Verträgen
    declineButton->SetVisible(false);

    currentMessage = 0;
    DisplayPostMessage();

    lastSize = GameClient::inst().GetPostMessages().size();
}
开发者ID:MarcusSt,项目名称:s25client,代码行数:48,代码来源:iwPostWindow.cpp

示例6: Actor

ActorTip::ActorTip(const gedString *tip)
	: Actor(ACTOR_TIP_NAME, NULL, CANVAS, Text::GetDimensions(*tip).Width() + 6, Text::GetDimensions(*tip).Height() + 4, true)
{
	getImage()->SetZDepth(CURSOR_DEPTH - 1);

	int x = GameControl::Get()->getMouseX() + 20, 
		y = GameControl::Get()->getMouseY() + 20, 
		width = Width(), 
		height = Height();

	if(x + width > GameControl::Get()->Width())
		x -= x + width - GameControl::Get()->Width();

	if(y + height > GameControl::Get()->Height())
		y -= y + height - GameControl::Get()->Height();

	getImage()->SetPos(x, y);

	
	//Draw
	KrRGBA *pixels = getCanvasResource()->Pixels(), colorBack, colorBlack;

	colorBack.c.red		= 255;
	colorBack.c.green	= 255;
	colorBack.c.blue	= 225;
	colorBack.c.alpha	= 255;

	colorBlack.Set(0, 0, 0);

	//Fill background
	int i;
	for(i = 0; i < width; i++)
	{
		for(int j = 0; j < height; j++)
		{
			if(i == 0 || j == 0 || i == width-1 || j == height - 1)
				pixels[ j*width + i ] = colorBlack;
			else
				pixels[ j*width + i ] = colorBack;
		}
	}

	//Text
	AddText(*tip, 3, 2);

	SetTransparency(.1);
}
开发者ID:cubemoon,项目名称:game-editor,代码行数:47,代码来源:ActorTip.cpp

示例7: IngameWindow

/**
 *  Konstruktor von @p iwBuildingSite.
 *
 *  @author OLiver
 */
iwBuildingSite::iwBuildingSite(GameWorldViewer *const gwv, const noBuildingSite *const buildingsite) 
: IngameWindow(buildingsite->CreateGUIID(), 0xFFFE, 0xFFFE, 226, 194, _(BUILDING_NAMES[buildingsite->GetBuildingType()]), LOADER.GetImageN("resource", 41)),
	gwv(gwv), buildingsite(buildingsite)
{
	// Bild des Gebäudes
	AddImage(0, 113, 130, buildingsite->GetBuildingImage());
	// Gebäudename 
	AddText(1, 113, 44, _("Order of building site"), COLOR_YELLOW, glArchivItem_Font::DF_CENTER, NormalFont);

	// Hilfe
	AddImageButton( 2,  16, 147, 30, 32, TC_GREY, LOADER.GetImageN("io",  21));
	// Gebäude abbrennen
	AddImageButton( 3,  50, 147, 34, 32, TC_GREY, LOADER.GetImageN("io",  23));

	// "Gehe Zu Ort"
	AddImageButton( 4, 179, 147, 30, 32, TC_GREY, LOADER.GetImageN("io", 107), _("Go to place"));
}
开发者ID:MiyaxinPittahai,项目名称:s25rttr,代码行数:22,代码来源:iwBuildingSite.cpp

示例8: DrawHidden

NODESIZE CNodeHex64::Draw( const PVIEWINFO View, int x, int y )
{
    int tx;
    NODESIZE DrawSize;
    const UCHAR* Data;

    if (m_bHidden)
        return DrawHidden( View, x, y );

    Data = (const UCHAR*)(View->Data + m_Offset);
    AddSelection( View, 0, y, g_FontHeight );
    AddDelete( View, x, y );
    AddTypeDrop( View, x, y );
    //AddAdd(View,x,y);

    tx = x + TXOFFSET + 16;
    tx = AddAddressOffset( View, tx, y );

    if (g_bText)
    {
        CStringA AsciiMemory = GetStringFromMemoryA( (const char*)Data, 8 ) + " ";
        tx = AddText( View, tx, y, g_clrChar, HS_NONE, "%s", AsciiMemory.GetBuffer( ) );
    }

    tx = AddText( View, tx, y, g_clrHex, 0, _T( "%0.2X" ), Data[0] ) + g_FontWidth;
    tx = AddText( View, tx, y, g_clrHex, 1, _T( "%0.2X" ), Data[1] ) + g_FontWidth;
    tx = AddText( View, tx, y, g_clrHex, 2, _T( "%0.2X" ), Data[2] ) + g_FontWidth;
    tx = AddText( View, tx, y, g_clrHex, 3, _T( "%0.2X" ), Data[3] ) + g_FontWidth;
    tx = AddText( View, tx, y, g_clrHex, 4, _T( "%0.2X" ), Data[4] ) + g_FontWidth;
    tx = AddText( View, tx, y, g_clrHex, 5, _T( "%0.2X" ), Data[5] ) + g_FontWidth;
    tx = AddText( View, tx, y, g_clrHex, 6, _T( "%0.2X" ), Data[6] ) + g_FontWidth;
    tx = AddText( View, tx, y, g_clrHex, 7, _T( "%0.2X" ), Data[7] ) + g_FontWidth;
    tx = AddComment( View, tx, y );

    DrawSize.x = tx;
    DrawSize.y = y + g_FontHeight;
    return DrawSize;
}
开发者ID:dude719,项目名称:Reclass-2015,代码行数:38,代码来源:CNodeHex64.cpp

示例9: begin_pos

void wxHtmlParser::DoParsing(const wxString::const_iterator& begin_pos_,
                             const wxString::const_iterator& end_pos)
{
    wxString::const_iterator begin_pos(begin_pos_);

    if (end_pos <= begin_pos)
        return;

    wxHtmlTextPieces& pieces = *m_TextPieces;
    size_t piecesCnt = pieces.size();

    while (begin_pos < end_pos)
    {
        while (m_CurTag && m_CurTag->GetBeginIter() < begin_pos)
            m_CurTag = m_CurTag->GetNextTag();
        while (m_CurTextPiece < piecesCnt &&
               pieces[m_CurTextPiece].m_start < begin_pos)
            m_CurTextPiece++;

        if (m_CurTextPiece < piecesCnt &&
            (!m_CurTag ||
             pieces[m_CurTextPiece].m_start < m_CurTag->GetBeginIter()))
        {
            // Add text:
            AddText(GetEntitiesParser()->Parse(
                       wxString(pieces[m_CurTextPiece].m_start,
                                pieces[m_CurTextPiece].m_end)));
            begin_pos = pieces[m_CurTextPiece].m_end;
            m_CurTextPiece++;
        }
        else if (m_CurTag)
        {
            if (m_CurTag->HasEnding())
                begin_pos = m_CurTag->GetEndIter2();
            else
                begin_pos = m_CurTag->GetBeginIter();
            wxHtmlTag *t = m_CurTag;
            m_CurTag = m_CurTag->GetNextTag();
            AddTag(*t);
            if (m_stopParsing)
                return;
        }
        else break;
    }
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:45,代码来源:htmlpars.cpp

示例10: braces

bool cbStyledTextCtrl::DoSelectionBraceCompletion(const wxChar& ch)
{
    if (GetLastSelectedText().IsEmpty())
        return false; // nothing changed
    const wxString braces(wxT("([{<'\")]}>'\""));
    const int braceAIdx = braces.Find(ch, true); // from end (so caret is placed after quotes)
    if (braceAIdx == wxNOT_FOUND)
        return false; // nothing changed
    const int braceBIdx = (braceAIdx + (braces.Length() / 2)) % braces.Length();
    BeginUndoAction();
    DeleteBack();
    if (braceAIdx < braceBIdx)
        InsertText(GetCurrentPos(), braces[braceAIdx] + GetLastSelectedText() + braces[braceBIdx]);
    else
        AddText(braces[braceBIdx] + GetLastSelectedText() + braces[braceAIdx]);
    EndUndoAction();
    return true; // succeeded
}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:18,代码来源:cbstyledtextctrl.cpp

示例11: IngameWindow

iwBuildingSite::iwBuildingSite(GameWorldView& gwv, const noBuildingSite* const buildingsite)
    : IngameWindow(buildingsite->CreateGUIID(), IngameWindow::posAtMouse, Extent(226, 194),
                   _(BUILDING_NAMES[buildingsite->GetBuildingType()]), LOADER.GetImageN("resource", 41)),
      gwv(gwv), buildingsite(buildingsite)
{
    // Bild des Gebäudes
    AddImage(0, DrawPoint(113, 130), buildingsite->GetBuildingImage());
    // Gebäudename
    AddText(1, DrawPoint(113, 44), _("Order of building site"), COLOR_YELLOW, FontStyle::CENTER, NormalFont);

    // Hilfe
    AddImageButton(2, DrawPoint(16, 147), Extent(30, 32), TC_GREY, LOADER.GetImageN("io", 225), _("Help"));
    // Gebäude abbrennen
    AddImageButton(3, DrawPoint(50, 147), Extent(34, 32), TC_GREY, LOADER.GetImageN("io", 23), _("Demolish house"));

    // "Gehe Zu Ort"
    AddImageButton(4, DrawPoint(179, 147), Extent(30, 32), TC_GREY, LOADER.GetImageN("io", 107), _("Go to place"));
}
开发者ID:Return-To-The-Roots,项目名称:s25client,代码行数:18,代码来源:iwBuildingSite.cpp

示例12: va_start

void MPanelItem::printf(LPCWSTR asFormat, ...)
{
	if (!asFormat || !*asFormat)
		return;
		
    va_list args;
    va_start(args,asFormat);
    wchar_t szBuffer[1025]; szBuffer[0] = 0;
    
    int nLen = vswprintf(szBuffer, 1024, asFormat, args);
    
    if (nLen > 0) {
    	_ASSERTE(nLen<1023);
    	szBuffer[nLen] = 0;

		AddText(szBuffer, nLen);
	}
}
开发者ID:kleopatra999,项目名称:FarPlugins,代码行数:18,代码来源:PanelItem.cpp

示例13: ReaderThread

DWORD WINAPI ReaderThread(PVOID pvParam) {

   int nThreadNum = PtrToUlong(pvParam);
   HWND hWndLB = GetDlgItem(g_hWnd, IDC_SERVERS);

   for (int nRequestNum = 1; !g_fShutdown; nRequestNum++) {

      if (!ConsumeElement(nThreadNum, nRequestNum, hWndLB))
         return(0);

      Sleep(2500);   // Wait before reading another element
   }
   
   // g_fShutdown has been set during Sleep
   // --> Show that the current thread is exiting
   AddText(hWndLB, TEXT("[%d] bye bye"), nThreadNum);

   return(0);
}
开发者ID:Jeanhwea,项目名称:WindowsViaCPP,代码行数:19,代码来源:Queue.cpp

示例14: iwSaveLoad

iwSave::iwSave() : iwSaveLoad(40, _("Save game!"))
{
    AddEdit(1, 20, 390, 510, 22, TC_GREEN2, NormalFont);
    AddImageButton(2, 540, 386, 40, 40, TC_GREEN2, LOADER.GetImageN("io", 47));

    // Autospeicherzeug
    AddText(3, 20, 350, _("Auto-Save every:"), 0xFFFFFF00, 0, NormalFont);
    ctrlComboBox* combo = AddComboBox(4, 270, 345, 130, 22, TC_GREEN2, NormalFont, 100);

    /// Combobox füllen
    combo->AddString(_("Disabled")); // deaktiviert
    
    // Last entry is only for debugging
    const unsigned numIntervalls = SETTINGS.global.debugMode ? AUTO_SAVE_INTERVALS_COUNT : AUTO_SAVE_INTERVALS_COUNT - 1;

    // Die Intervalle
    for(unsigned i = 0; i < numIntervalls; ++i)
    {
        char str[64];
        sprintf(str, "%u GF", AUTO_SAVE_INTERVALS[i]);
        combo->AddString(str);
    }

    // Richtigen Eintrag auswählen
    bool found = false;
    for(unsigned i = 0; i < numIntervalls; ++i)
    {
        if(SETTINGS.interface.autosave_interval == AUTO_SAVE_INTERVALS[i])
        {
            combo->SetSelection(i + 1);
            found = true;
            break;
        }
    }

    // Ungültig oder 0 --> Deaktiviert auswählen
    if(!found)
        combo->SetSelection(0);

    // Tabelle ausfüllen beim Start
    RefreshTable();
}
开发者ID:vader1986,项目名称:s25client,代码行数:42,代码来源:iwSave.cpp

示例15: AddButton

//================================================================================================================
void MenuEditorSystem::OnMouseDown(WPARAM btnState, int x, int y)
{
	// Start a left button drag of an item
	if ((btnState & MK_LBUTTON) != 0)
	{
		m_leftButtonDown = true;
		
		m_SelectedMousePos.x = x;
		m_SelectedMousePos.y = y;
		
		// If applicable, Add a button
		if (BetterString(m_SelectedButtonImageName) != "")
		{
			AddButton();
		}
		
		// If applicable, Add a text
		AddText();
	}
}
开发者ID:henriyl,项目名称:ZShadeSandboxOld,代码行数:21,代码来源:MenuEditorSystem.cpp


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