void CInstallDelete::AddHeader(wxListCtrl* liste) { InsertHeader(liste); m_index_type = liste->InsertColumn(liste->GetColumnCount(), _T("Type")); m_index_name = liste->InsertColumn(liste->GetColumnCount(), _T("Name")); CCommon::AddHeader(liste); CCompTask::AddHeader(liste); }
OGRGMLDataSource::~OGRGMLDataSource() { if( fpOutput != NULL ) { VSIFPrintf( fpOutput, "%s", "</ogr:FeatureCollection>\n" ); InsertHeader(); if( nBoundedByLocation != -1 && sBoundingRect.IsInit() && VSIFSeek( fpOutput, nBoundedByLocation, SEEK_SET ) == 0 ) { VSIFPrintf( fpOutput, " <gml:boundedBy>\n" ); VSIFPrintf( fpOutput, " <gml:Box>\n" ); VSIFPrintf( fpOutput, " <gml:coord><gml:X>%.16g</gml:X>" "<gml:Y>%.16g</gml:Y></gml:coord>\n", sBoundingRect.MinX, sBoundingRect.MinY ); VSIFPrintf( fpOutput, " <gml:coord><gml:X>%.16g</gml:X>" "<gml:Y>%.16g</gml:Y></gml:coord>\n", sBoundingRect.MaxX, sBoundingRect.MaxY ); VSIFPrintf( fpOutput, " </gml:Box>\n" ); VSIFPrintf( fpOutput, " </gml:boundedBy>" ); } if( fpOutput != stdout ) VSIFClose( fpOutput ); } CSLDestroy( papszCreateOptions ); CPLFree( pszName ); for( int i = 0; i < nLayers; i++ ) delete papoLayers[i]; CPLFree( papoLayers ); if( poReader ) delete poReader; }
const INT_PTR ConsoleUI::Message(UINT uType, LPCTSTR pszText) { INT_PTR nResult; // Result from function call // Attempt to lock the console, and default the response code if we cannot if(!LockConsole()) return DefaultUserResponse(uType, false); // Display the icon header and the message text in the console window if(InsertHeader(uType)) BlankLines(); if(WriteText(pszText)) BlankLines(); nResult = PromptUser(uType); // Prompt the user for their response BlankLines(); // Skip a line for neatness UnlockConsole(); // Release the console handle lock return nResult; // Return the user's response }
const INT_PTR ConsoleUI::List(UINT uType, LPCTSTR pszHeader, LPCTSTR *rgszItems, DWORD cItems, LPCTSTR pszFooter) { String strItem; // Item text string object DWORD dwIndex; // Loop index variable INT_PTR nResult; // Result from function call // Attempt to lock the console, and default the response code if we cannot if(!LockConsole()) return DefaultUserResponse(uType, false); // Display the optional faux icon header string, and the list box header text if(InsertHeader(uType)) BlankLines(); if(pszHeader) { if(WriteText(pszHeader)) BlankLines(); } // Loop through the array of list items to display them in the console if(rgszItems) { for(dwIndex = 0; dwIndex < cItems; dwIndex++) { strItem = CONSOLE_BULLET; // Start with the bullet strItem += CONSOLE_SPACE; // Add in a space strItem += rgszItems[dwIndex]; // Finish with the text itself WriteText(strItem, CONSOLE_LIST_LMARGIN); } BlankLines(); // Finish up with a blank line } // Display the optional list box footer text before prompting the user if(pszFooter) { if(WriteText(pszFooter)) BlankLines(); } nResult = PromptUser(uType); // Prompt the user for their response BlankLines(); // Skip a line for neatness UnlockConsole(); // Release the console handle lock return nResult; // Return the user's response }
void LstOdaSrvDetails::LoadDetailsFromServer(Server &In) { DeleteAllItems(); DeleteAllColumns(); if (In.GotResponse() == false) return; // Begin adding data to the control // Set the initial background colour BGItemAlternator = *wxWHITE; InsertColumn(srvdetails_field_name, wxT(""), wxLIST_FORMAT_LEFT, 150); InsertColumn(srvdetails_field_value, wxT(""), wxLIST_FORMAT_LEFT, 150); // Version InsertLine(wxT("Version"), wxString::Format(wxT("%u.%u.%u-r%u"), In.Info.VersionMajor, In.Info.VersionMinor, In.Info.VersionPatch, In.Info.VersionRevision)); InsertLine(wxT("QP Version"), wxString::Format(wxT("%u"), In.Info.VersionProtocol)); // Status of the game InsertLine(wxT(""), wxT("")); InsertHeader(wxT("Game Status"), wxRED, wxWHITE); InsertLine(wxT("Time left"), wxString::Format(wxT("%u"), In.Info.TimeLeft)); if (In.Info.GameType == GT_TeamDeathmatch || In.Info.GameType == GT_CaptureTheFlag) { InsertLine(wxT("Score Limit"), wxString::Format(wxT("%u"), In.Info.ScoreLimit)); } // Patch (BEX/DEH) files InsertLine(wxT(""), wxT("")); InsertHeader(wxT("BEX/DEH Files"), wxRED, wxWHITE); if (In.Info.Patches.size() == 0) { InsertLine(wxT("None"), wxT("")); } else { size_t i = 0; size_t PatchesCount = In.Info.Patches.size(); wxString Current, Next; // A while loop is used to format this correctly while (i < PatchesCount) { Current = stdstr_towxstr(In.Info.Patches[i]); ++i; if (i < PatchesCount) Next = stdstr_towxstr(In.Info.Patches[i]); ++i; InsertLine(Current, Next); Current = wxT(""); Next = wxT(""); } } // Gameplay variables (Cvars, others) InsertLine(wxT(""), wxT("")); InsertHeader(wxT("Game Settings"), wxRED, wxWHITE); // Sort cvars ascending sort(In.Info.Cvars.begin(), In.Info.Cvars.end(), CvarCompare); for (size_t i = 0; i < In.Info.Cvars.size(); ++i) InsertLine(stdstr_towxstr(In.Info.Cvars[i].Name), stdstr_towxstr(In.Info.Cvars[i].Value)); // Resize the columns ResizeNameValueColumns(); }