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); } } } }
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; }
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)); } }
LRESULT CAddTaskLinksEdit::OnDocAdded(WPARAM wParam, LPARAM lParam) { if (NULL == m_pDoc) return 0; if (0 == lParam) return 0; CFileHashKey *pKey = (CFileHashKey*) lParam; CAddTaskDoc::SItem item; if (!m_pDoc->GetItem(*pKey, item)) return 0; AddText(item.strLinkText); return 0; }
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); }
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(); }
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); }
/** * 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")); }
void wxHtmlParser::DoParsing(int begin_pos, int end_pos) { if (end_pos <= begin_pos) return; wxHtmlTextPieces& pieces = *m_TextPieces; size_t piecesCnt = pieces.GetCount(); while (begin_pos < end_pos) { while (m_CurTag && m_CurTag->GetBeginPos() < begin_pos) m_CurTag = m_CurTag->GetNextTag(); while (m_CurTextPiece < piecesCnt && pieces[m_CurTextPiece].m_pos < begin_pos) m_CurTextPiece++; if (m_CurTextPiece < piecesCnt && (!m_CurTag || pieces[m_CurTextPiece].m_pos < m_CurTag->GetBeginPos())) { // Add text: AddText(GetEntitiesParser()->Parse( m_Source.Mid(pieces[m_CurTextPiece].m_pos, pieces[m_CurTextPiece].m_lng))); begin_pos = pieces[m_CurTextPiece].m_pos + pieces[m_CurTextPiece].m_lng; m_CurTextPiece++; } else if (m_CurTag) { // Add tag: if (m_CurTag) { if (m_CurTag->HasEnding()) begin_pos = m_CurTag->GetEndPos2(); else begin_pos = m_CurTag->GetBeginPos(); } wxHtmlTag *t = m_CurTag; m_CurTag = m_CurTag->GetNextTag(); AddTag(*t); if (m_stopParsing) return; } else break; } }
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; }
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; } }
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 }
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")); }
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); } }
void MPanelItem::printf(LPCSTR asFormat, ...) { if (!asFormat || !*asFormat) return; va_list args; va_start(args,asFormat); static char szBuffer[1025]; //2010-03-15 для ускорения - их очень много szBuffer[0] = 0; int nLen = vsprintf(szBuffer, asFormat, args); if (nLen > 0) { _ASSERTE(nLen<1023); szBuffer[nLen] = 0; AddText(szBuffer, nLen); } }
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); }
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(); }
//================================================================================================================ 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(); } }
void CHandleSynchronization::ReWriteXMl() { DELETE(iDataBuf); TBuf<100> tempBuf; tempBuf.Zero(); tempBuf.Append(KXMLHEADER); iDataBuf=HBufC::NewL(tempBuf.Length()); iDataBuf->Des().Append(KXMLHEADER); tempBuf.Zero(); tempBuf.Format(KXMLUPTIME,iTimeFlag); iDataBuf = iDataBuf->ReAllocL(iDataBuf->Length() + tempBuf.Length()); iDataBuf->Des().Append(tempBuf); for(TInt i=0;i<iArray.Count();i++) { tempBuf.Zero(); tempBuf.Format(KXMLFIRSTHEADER,iArray[i]->GetID(),&iArray[i]->GetName()); iDataBuf = iDataBuf->ReAllocL(iDataBuf->Length() + tempBuf.Length()); iDataBuf->Des().Append(tempBuf); AddText(iArray[i]); iDataBuf = iDataBuf->ReAllocL(iDataBuf->Length() + iTempBuf->Length()); iDataBuf->Des().Append(*iTempBuf); tempBuf.Zero(); tempBuf.Append(KXMLFIRSTEND); iDataBuf = iDataBuf->ReAllocL(iDataBuf->Length() + tempBuf.Length()); iDataBuf->Des().Append(tempBuf); } tempBuf.Zero(); tempBuf.Append(KXMLEND); iDataBuf = iDataBuf->ReAllocL(iDataBuf->Length() + tempBuf.Length()); iDataBuf->Des().Append(tempBuf); ::WriteFile(iSynFileName,*iDataBuf); }
iwPostWindow::iwPostWindow(GameWorldView& gwv, PostBox& postBox) : IngameWindow(CGI_POSTOFFICE, IngameWindow::posLastOrCenter, Extent(254, 295), _("Post office"), LOADER.GetImageN("resource", 41)), gwv(gwv), postBox(postBox), showAll(true), curCategory(PostCategory::General), curMsg(nullptr), lastHasMissionGoal(true) { AddImageButton(ID_SHOW_ALL, DrawPoint(18, 25), Extent(35, 35), TC_GREY, LOADER.GetImageN("io", 190)); // Viewer: 191 - Papier AddImageButton(ID_SHOW_MIL, DrawPoint(56, 25), Extent(35, 35), TC_GREY, LOADER.GetImageN("io", 30)); // Viewer: 31 - Soldat AddImageButton(ID_SHOW_GEO, DrawPoint(91, 25), Extent(35, 35), TC_GREY, LOADER.GetImageN("io", 20)); // Viewer: 21 - Geologe AddImageButton(ID_SHOW_ECO, DrawPoint(126, 25), Extent(35, 35), TC_GREY, LOADER.GetImageN("io", 28)); // Viewer: 29 - Wage AddImageButton(ID_SHOW_GEN, DrawPoint(161, 25), Extent(35, 35), TC_GREY, LOADER.GetImageN("io", 189)); // Viewer: 190 - Neue Nachricht AddImageButton(ID_SHOW_GOAL, DrawPoint(199, 25), Extent(35, 35), TC_GREY, LOADER.GetImageN("io", 79)); // Viewer: 80 - Notiz AddImage(0, DrawPoint(126, 151), LOADER.GetImageN("io", 228)); AddImageButton(ID_HELP, DrawPoint(18, 242), Extent(30, 35), TC_GREY, LOADER.GetImageN("io", 225)); // Viewer: 226 - Hilfe AddImageButton(ID_GO_START, DrawPoint(51, 246), Extent(30, 26), TC_GREY, LOADER.GetImageN("io", 102)); // Viewer: 103 - Schnell zurück AddImageButton(ID_GO_BACK, DrawPoint(81, 246), Extent(30, 26), TC_GREY, LOADER.GetImageN("io", 103)); // Viewer: 104 - Zurück AddImageButton(ID_GO_FWD, DrawPoint(111, 246), Extent(30, 26), TC_GREY, LOADER.GetImageN("io", 104)); // Viewer: 105 - Vor AddImageButton(ID_GO_END, DrawPoint(141, 246), Extent(30, 26), TC_GREY, LOADER.GetImageN("io", 105)); // Viewer: 106 - Schnell vor // Goto, nur sichtbar wenn Nachricht mit Koordinaten da AddImageButton(ID_GOTO, DrawPoint(181, 246), Extent(30, 26), TC_GREY, LOADER.GetImageN("io", 107))->SetVisible(false); // Mülleimer, nur sichtbar, wenn Nachricht da AddImageButton(ID_DELETE, DrawPoint(211, 246), Extent(30, 26), TC_GREY, LOADER.GetImageN("io", 106))->SetVisible(false); AddText(ID_INFO, DrawPoint(127, 228), "", MakeColor(255, 188, 100, 88), FontStyle::CENTER | FontStyle::BOTTOM, SmallFont) ->SetVisible(false); AddImage(ID_IMG, DrawPoint(127, 155), LOADER.GetImageN("io", 225)); // Multiline-Teil mit drei leeren Zeilen erzeugen ctrlMultiline* text = AddMultiline(ID_TEXT, DrawPoint(126, 141), Extent(200, 0), TC_INVISIBLE, NormalFont, FontStyle::CENTER | FontStyle::BOTTOM | FontStyle::NO_OUTLINE); text->SetNumVisibleLines(4); text->ShowBackground(false); // Button with OK and deny sign (tick and cross) for contracts AddImageButton(ID_ACCEPT, DrawPoint(87, 185), Extent(30, 26), TC_GREEN1, LOADER.GetImageN("io", 32))->SetVisible(false); AddImageButton(ID_DENY, DrawPoint(137, 185), Extent(30, 26), TC_RED1, LOADER.GetImageN("io", 40))->SetVisible(false); FilterMessages(); curMsgId = curMsgIdxs.size(); DisplayPostMessage(); }
void xoMain(xo::SysWnd* wnd) { xo::Doc* doc = wnd->Doc(); int nx = 100; int ny = 100; for (int y = 0; y < ny; y++) { auto line = doc->Root.AddNode(xo::TagDiv); line->StyleParse("width: 100%; height: 4px; margin: 1px; display: block;"); for (int x = 0; x < nx; x++) { auto div = line->AddNode(xo::TagDiv); div->StyleParse("width: 1%; height: 100%; border-radius: 2px; margin: 1px; display: inline;"); div->StyleParsef("background: #%02x%02x%02x%02x", (uint8_t)(x * 5), 0, 0, 255); char txt[2] = "a"; txt[0] = 'a' + x % 26; div->AddText(txt); } } }
void ListPop::PopulateCloneList(gedString actorName) { subItens.Clear(); stackItens.Clear(); UseSubList(); ListActor *listActor = mapActors[actorName]; for(int il = 0; listActor && il < listActor->Count(); il++) { Actor *actor = (*listActor)[il]; if(actor->EditMode()) { AddText(actor->getCloneName()); } } Sort(); ResetWork(); PopulateWorkList(true); }
/** * Konstruktor von @p iwLobbyConnect. * * @author FloSoft */ iwLobbyConnect::iwLobbyConnect(void) : IngameWindow(CGI_LOBBYCONNECT, 0xFFFF, 0xFFFF, 500, 260, _("Connecting to Lobby"), LOADER.GetImageN("resource", 41)) { // Benutzername AddText(0, 20, 40, _("Username:"******"Password:"******"Email Address:"), COLOR_YELLOW, 0, NormalFont); ctrlEdit* email = AddEdit(5, 260, 100, 220, 22, TC_GREEN2, NormalFont); email->SetText(SETTINGS.lobby.email); // Passwort speichern ja/nein AddText(6, 20, 130, _("Save Password?"), COLOR_YELLOW, 0, NormalFont); ctrlOptionGroup* savepassword = AddOptionGroup(10, ctrlOptionGroup::CHECK); savepassword->AddTextButton(0, 260, 130, 105, 22, TC_GREEN2, _("No"), NormalFont); // nein savepassword->AddTextButton(1, 375, 130, 105, 22, TC_GREEN2, _("Yes"), NormalFont); // ja savepassword->SetSelection( (SETTINGS.lobby.save_password ? 1 : 0) ); // ipv6 oder ipv4 benutzen AddText(11, 20, 160, _("Use IPv6:"), COLOR_YELLOW, 0, NormalFont); ctrlOptionGroup* ipv6 = AddOptionGroup(12, ctrlOptionGroup::CHECK); ipv6->AddTextButton(0, 260, 160, 105, 22, TC_GREEN2, _("IPv4"), NormalFont); ipv6->AddTextButton(1, 375, 160, 105, 22, TC_GREEN2, _("IPv6"), NormalFont); ipv6->SetSelection( (SETTINGS.server.ipv6 ? 1 : 0) ); // Verbinden AddTextButton(7, 20, 220, 220, 22, TC_RED1, _("Connect"), NormalFont); // Registrieren AddTextButton(8, 260, 220, 220, 22, TC_GREEN2, _("Register"), NormalFont); // Status AddText(9, 250, 195, "", COLOR_RED, glArchivItem_Font::DF_CENTER, NormalFont); // Lobby-Interface setzen LOBBYCLIENT.SetInterface(this); }
//------------------------------------------------------------------- // Constructor / Destructor //------------------------------------------------------------------- CButton::CButton() { AddSetting(GUIST_float, "buffer_zone"); AddSetting(GUIST_CGUIString, "caption"); AddSetting(GUIST_int, "cell_id"); AddSetting(GUIST_CStrW, "font"); AddSetting(GUIST_CGUISpriteInstance, "sprite"); AddSetting(GUIST_CGUISpriteInstance, "sprite_over"); AddSetting(GUIST_CGUISpriteInstance, "sprite_pressed"); AddSetting(GUIST_CGUISpriteInstance, "sprite_disabled"); AddSetting(GUIST_EAlign, "text_align"); AddSetting(GUIST_EVAlign, "text_valign"); AddSetting(GUIST_CColor, "textcolor"); AddSetting(GUIST_CColor, "textcolor_over"); AddSetting(GUIST_CColor, "textcolor_pressed"); AddSetting(GUIST_CColor, "textcolor_disabled"); AddSetting(GUIST_CStrW, "tooltip"); AddSetting(GUIST_CStr, "tooltip_style"); // Add text AddText(new SGUIText()); }
//================================================================================================================ void MenuEditorSystem::OnMouseMove(WPARAM btnState, int x, int y) { // Start a left button drag of an item if ((btnState & MK_LBUTTON) != 0) { m_SelectedMousePos.x = x; m_SelectedMousePos.y = y; m_leftButtonDown = true; // If applicable, Add a button if (BetterString(m_SelectedButtonImageName) != "") { AddButton(); } // If applicable, Add a text AddText(); } else { m_leftButtonDown = false; } m_MouseMovePos = SnapToGrid(x, y); // Move a button or text display cover if (editType == ET_Button && (action == A_Place || action == A_Move)) { if (m_displaySpriteCover == NULL) { if (BetterString(m_SelectedButtonImageName) != "") { m_displaySpriteCover = new Sprite(m_D3DSystem); m_displaySpriteCover->Initialize(m_mainGameDirectory->m_menu_sprites_path, m_SelectedButtonImageName, XMFLOAT3(m_MouseMovePos.x, m_MouseMovePos.y, 0), 80, 30, PhysicsType::STATIC); } } } }
/**** interpretation ****/ void AddOnListInfo::MessageReceived(BMessage *message) { switch(message->what) { // barre de progression case PROGRESS_START_MSG: case PROGRESS_STOP_MSG: { // recuperer le type de demande :: ou -> ou . if(message->FindInt8(CS_ASK_TYPE,&_typeRequested)!=B_OK) return; BMessenger(_progress).SendMessage(message); // on selectionne le premier if(_listOfInfos->CountItems()>0) _listOfInfos->PlaceOnKeyBuffer(); } break; // on recoit des donnees du handler case ADD_DATAS_LIST: AddDatasList(message); break; // on recoit des donnees en retour d'une completion case ADD_COMPLETION_DATAS: AddCompletionDatas(message); break; // on a choisi un item case ADD_DATAS_TEXT: AddText(message); break; // redirige le message pour afficher le buffer case DISPLAY_BUFFER_MSG: _motherMessenger.SendMessage(message); break; default: BWindow::MessageReceived(message); } }
/** * Konstruktor von @p dskLobby. * * @author FloSoft * @author Devil */ dskLobby::dskLobby() : Desktop(LOADER.GetImageN("setup013", 0)), serverinfo(NULL), servercreate(NULL) { // Version AddVarText(0, 0, 600, _("Return To The Roots - v%s-%s"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont, 2, GetWindowVersion(), GetWindowRevisionShort()); // URL AddText(1, 400, 600, _("http://www.siedler25.org"), COLOR_GREEN, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, NormalFont); // Copyright AddVarText(2, 800, 600, _("© 2005 - %s Settlers Freaks"), COLOR_YELLOW, glArchivItem_Font::DF_RIGHT | glArchivItem_Font::DF_BOTTOM, NormalFont, 1, GetCurrentYear()); // "Zurück" AddTextButton(3, 530, 530, 250, 22, TC_RED1, _("Back"), NormalFont); // "Verbinden" AddTextButton(4, 530, 470, 250, 22, TC_GREEN2, _("Connect"), NormalFont); // "Internet Ranking" AddTextButton(5, 530, 500, 250, 22, TC_GREEN2, _("Internet Ranking"), NormalFont); // "Server hinzufügen" AddTextButton(6, 530, 440, 250, 22, TC_GREEN2, _("Add Server"), NormalFont); // Gameserver-Tabelle - "ID", "Server", "Karte", "Spieler", "Version", "Ping" AddTable(10, 20, 20, 500, 262, TC_GREY, NormalFont, 6, _("ID"), 0, ctrlTable::SRT_NUMBER, _("Server"), 300, ctrlTable::SRT_STRING, _("Map"), 300, ctrlTable::SRT_STRING, _("Player"), 200, ctrlTable::SRT_NUMBER, _("Version"), 100, ctrlTable::SRT_STRING, _("Ping"), 100, ctrlTable::SRT_NUMBER); // Spieler-Tabelle - "Name", "Punkte", "Version" AddTable(11, 530, 20, 250, 410, TC_GREY, NormalFont, 3, _("Name"), 500, ctrlTable::SRT_STRING, _("Points"), 250, ctrlTable::SRT_STRING, _("Version"), 250, ctrlTable::SRT_STRING); // Chatfenster AddChatCtrl(20, 20, 290, 500, 238, TC_GREY, NormalFont); // Chatfenster-Edit AddEdit(21, 20, 530, 500, 22, TC_GREY, NormalFont); AddTimer(30, 5000); UpdateServerList(true); UpdatePlayerList(true); LOBBYCLIENT.SetInterface(this); LOBBYCLIENT.SendServerListRequest(); LOBBYCLIENT.SendPlayerListRequest(); GAMECLIENT.SetInterface(this); }
iwSave::iwSave() : iwSaveLoad(40, _("Save game!")) { AddEdit(1, DrawPoint(20, 390), Extent(510, 22), TC_GREEN2, NormalFont); AddImageButton(2, DrawPoint(540, 386), Extent(40, 40), TC_GREEN2, LOADER.GetImageN("io", 47)); // Autospeicherzeug AddText(3, DrawPoint(20, 350), _("Auto-Save every:"), 0xFFFFFF00, FontStyle{}, NormalFont); ctrlComboBox* combo = AddComboBox(4, DrawPoint(270, 345), Extent(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 ? NUM_AUTO_SAVE_INTERVALS : NUM_AUTO_SAVE_INTERVALS - 1; // Die Intervalle for(unsigned i = 0; i < numIntervalls; ++i) combo->AddString(helpers::toString(AUTO_SAVE_INTERVALS[i]) + " GF"); // 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(); }
/// /// The do all function for translation. /// This automaticaly loads the correct language file on the first call. /// The tag is the english string that is mangled to an xml tag that is /// used to return the translated vr using the XmlParser class. /// extern "C" char * ctrl_gettext(const char * tag) { char * val; char * text; if(!loaded && loadok) // first call { LanguageXMLload(); } if(!loadok) // failed first call { #ifdef DEBUG printf("Not Loaded, TAG: %s\n", tag); #endif return (char *)tag; } // Get the translation val = xmlFile.getValue((char *)textmangler(tag)); if(val == NULL) { #ifdef DEBUG printf("XML TAG <%s> Not Found!\n",textmangler(tag)); printf("<%s>%s</%s>\n",textmangler(tag),tag,textmangler(tag)); #endif return (char *)tag; } #ifdef DEBUG printf("TAG: %s VAL: %s\n", textmangler(tag), val); #endif // allocate new memory and add to list text = strdup(val); AddText(text); return text; }
iwAddons::iwAddons(GlobalGameSettings& ggs, Window* parent, ChangePolicy policy, std::vector<AddonId> addonIds) : IngameWindow(CGI_ADDONS, IngameWindow::posLastOrCenter, Extent(700, 500), _("Addon Settings"), LOADER.GetImageN("resource", 41), true, false, parent), ggs(ggs), policy(policy), addonIds(std::move(addonIds)) { AddText(0, DrawPoint(20, 30), _("Additional features:"), COLOR_YELLOW, FontStyle{}, NormalFont); Extent btSize(200, 22); if(policy != READONLY) AddTextButton(1, DrawPoint(20, GetSize().y - 40), btSize, TC_GREEN2, _("Apply"), NormalFont, _("Apply Changes")); AddTextButton(2, DrawPoint(250, GetSize().y - 40), btSize, TC_RED1, _("Abort"), NormalFont, _("Close Without Saving")); if(policy != READONLY) AddTextButton(3, DrawPoint(480, GetSize().y - 40), btSize, TC_GREY, _("Default"), NormalFont, _("Use S2 Defaults")); // Kategorien ctrlOptionGroup* optiongroup = AddOptionGroup(5, ctrlOptionGroup::CHECK); btSize = Extent(120, 22); // "Alle" optiongroup->AddTextButton(ADDONGROUP_ALL, DrawPoint(20, 50), btSize, TC_GREEN2, _("All"), NormalFont); // "Militär" optiongroup->AddTextButton(ADDONGROUP_MILITARY, DrawPoint(150, 50), btSize, TC_GREEN2, _("Military"), NormalFont); // "Wirtschaft" optiongroup->AddTextButton(ADDONGROUP_ECONOMY, DrawPoint(290, 50), btSize, TC_GREEN2, _("Economy"), NormalFont); // "Spielverhalten" optiongroup->AddTextButton(ADDONGROUP_GAMEPLAY, DrawPoint(430, 50), btSize, TC_GREEN2, _("Gameplay"), NormalFont); // "Sonstiges" optiongroup->AddTextButton(ADDONGROUP_OTHER, DrawPoint(560, 50), btSize, TC_GREEN2, _("Other"), NormalFont); ctrlScrollBar* scrollbar = AddScrollBar(6, DrawPoint(GetSize().x - SCROLLBAR_WIDTH - 20, 90), Extent(SCROLLBAR_WIDTH, GetSize().y - 140), SCROLLBAR_WIDTH, TC_GREEN2, (GetSize().y - 140) / 30 - 1); scrollbar->SetRange(ggs.getNumAddons()); optiongroup->SetSelection(ADDONGROUP_ALL, true); }