bool MyApp::OnInit()
{
// create the main application window
- MyFrame *frame = new MyFrame(_T("Minimal wxWindows App"));
+ MyFrame *frame = new MyFrame(wxT("Minimal wxWindows App"));
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(Minimal_About, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(Minimal_About, wxT("&About...\tF1"), wxT("Show about dialog"));
- menuFile->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(Minimal_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWindows!"));
+ SetStatusText(wxT("Welcome to wxWindows!"));
#endif // wxUSE_STATUSBAR
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
- msg.Printf( _T("This is the About dialog of the minimal sample.\n")
- _T("Welcome to %s"), wxVERSION_STRING);
+ msg.Printf( wxT("This is the About dialog of the minimal sample.\n")
+ wxT("Welcome to %s"), wxVERSION_STRING);
- wxMessageBox(msg, _T("About Minimal"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, wxT("About Minimal"), wxOK | wxICON_INFORMATION, this);
}
m_arrowCursor = new wxCursor(wxCURSOR_ARROW);
wxString name = wxTheApp->GetAppName();
- if (name.Length() <= 0) name = _T("forty");
+ if (name.Length() <= 0) name = wxT("forty");
m_scoreFile = new ScoreFile(name);
m_game = new Game(0, 0, 0);
m_game->Deal();
bool FortyCanvas::OnCloseCanvas()
{
if (m_game->InPlay() &&
- wxMessageBox(_T("Are you sure you want to\nabandon the current game?"),
- _T("Warning"), wxYES_NO | wxICON_QUESTION) == wxNO)
+ wxMessageBox(wxT("Are you sure you want to\nabandon the current game?"),
+ wxT("Warning"), wxYES_NO | wxICON_QUESTION) == wxNO)
{
return false;
}
m_symbolBmap = new wxBitmap(symbols_xpm);
if (!m_symbolBmap->Ok())
{
- ::wxMessageBox(_T("Failed to load bitmap CardSymbols"), _T("Error"));
+ ::wxMessageBox(wxT("Failed to load bitmap CardSymbols"), wxT("Error"));
}
}
if (!m_pictureBmap)
m_pictureBmap = new wxBitmap(Pictures);
if (!m_pictureBmap->Ok())
{
- ::wxMessageBox(_T("Failed to load bitmap CardPictures"), _T("Error"));
+ ::wxMessageBox(wxT("Failed to load bitmap CardPictures"), wxT("Error"));
}
}
wxSize size(668,510);
- if ((argc > 1) && (!wxStrcmp(argv[1],_T("-L"))))
+ if ((argc > 1) && (!wxStrcmp(argv[1],wxT("-L"))))
{
largecards = true;
size = wxSize(1000,750);
FortyFrame* frame = new FortyFrame(
0,
- _T("Forty Thieves"),
+ wxT("Forty Thieves"),
wxDefaultPosition,
size,
largecards
#endif
// set the icon
#ifdef __WXMSW__
- SetIcon(wxIcon(_T("CardsIcon")));
+ SetIcon(wxIcon(wxT("CardsIcon")));
#else
SetIcon(wxIcon(forty_xpm));
#endif
// Make a menu bar
wxMenu* gameMenu = new wxMenu;
- gameMenu->Append(wxID_NEW, wxGetStockLabel(wxID_NEW), _T("Start a new game"));
- gameMenu->Append(SCORES, _T("&Scores..."), _T("Displays scores"));
- gameMenu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT), _T("Exits Forty Thieves"));
+ gameMenu->Append(wxID_NEW, wxGetStockLabel(wxID_NEW), wxT("Start a new game"));
+ gameMenu->Append(SCORES, wxT("&Scores..."), wxT("Displays scores"));
+ gameMenu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT), wxT("Exits Forty Thieves"));
wxMenu* editMenu = new wxMenu;
- editMenu->Append(wxID_UNDO, wxGetStockLabel(wxID_UNDO), _T("Undo the last move"));
- editMenu->Append(wxID_REDO, wxGetStockLabel(wxID_REDO), _T("Redo a move that has been undone"));
+ editMenu->Append(wxID_UNDO, wxGetStockLabel(wxID_UNDO), wxT("Undo the last move"));
+ editMenu->Append(wxID_REDO, wxGetStockLabel(wxID_REDO), wxT("Redo a move that has been undone"));
wxMenu* optionsMenu = new wxMenu;
optionsMenu->Append(RIGHT_BUTTON_UNDO,
- _T("&Right button undo"),
- _T("Enables/disables right mouse button undo and redo"),
+ wxT("&Right button undo"),
+ wxT("Enables/disables right mouse button undo and redo"),
true
);
optionsMenu->Append(HELPING_HAND,
- _T("&Helping hand"),
- _T("Enables/disables hand cursor when a card can be moved"),
+ wxT("&Helping hand"),
+ wxT("Enables/disables hand cursor when a card can be moved"),
true
);
optionsMenu->Append(LARGE_CARDS,
- _T("&Large cards"),
- _T("Enables/disables large cards for high resolution displays"),
+ wxT("&Large cards"),
+ wxT("Enables/disables large cards for high resolution displays"),
true
);
optionsMenu->Check(HELPING_HAND, true);
optionsMenu->Check(LARGE_CARDS, largecards ? true : false);
wxMenu* helpMenu = new wxMenu;
- helpMenu->Append(wxID_HELP_CONTENTS, _T("&Help Contents"), _T("Displays information about playing the game"));
- helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About Forty Thieves"));
+ helpMenu->Append(wxID_HELP_CONTENTS, wxT("&Help Contents"), wxT("Displays information about playing the game"));
+ helpMenu->Append(wxID_ABOUT, wxT("&About..."), wxT("About Forty Thieves"));
m_menuBar = new wxMenuBar;
- m_menuBar->Append(gameMenu, _T("&Game"));
- m_menuBar->Append(editMenu, _T("&Edit"));
- m_menuBar->Append(optionsMenu, _T("&Options"));
- m_menuBar->Append(helpMenu, _T("&Help"));
+ m_menuBar->Append(gameMenu, wxT("&Game"));
+ m_menuBar->Append(editMenu, wxT("&Edit"));
+ m_menuBar->Append(optionsMenu, wxT("&Options"));
+ m_menuBar->Append(helpMenu, wxT("&Help"));
SetMenuBar(m_menuBar);
FortyFrame::About(wxCommandEvent&)
{
wxMessageBox(
- _T("Forty Thieves\n\n")
- _T("A free card game written with the wxWidgets toolkit\n")
- _T("Author: Chris Breeze (c) 1992-2004\n")
- _T("email: chris@breezesys.com"),
- _T("About Forty Thieves"),
+ wxT("Forty Thieves\n\n")
+ wxT("A free card game written with the wxWidgets toolkit\n")
+ wxT("Author: Chris Breeze (c) 1992-2004\n")
+ wxT("email: chris@breezesys.com"),
+ wxT("About Forty Thieves"),
wxOK|wxICON_INFORMATION, this
);
}
file.Open();
for ( htmlText = file.GetFirstLine();
!file.Eof();
- htmlText << file.GetNextLine() << _T("\n") ) ;
+ htmlText << file.GetNextLine() << wxT("\n") ) ;
}
}
}
// Customize the HTML
- htmlText.Replace(wxT("$DATE$"), _T(__DATE__));
+ htmlText.Replace(wxT("$DATE$"), wxT(__DATE__));
wxSize htmlSize(400, 290);
{
if (src == dest)
{
- wxMessageBox(_T("Game::DoMove() src == dest"), _T("Debug message"),
+ wxMessageBox(wxT("Game::DoMove() src == dest"), wxT("Debug message"),
wxOK | wxICON_EXCLAMATION);
}
m_moves[m_moveIndex].src = src;
}
else
{
- wxMessageBox(_T("Game::DoMove() Undo buffer full"), _T("Debug message"),
+ wxMessageBox(wxT("Game::DoMove() Undo buffer full"), wxT("Debug message"),
wxOK | wxICON_EXCLAMATION);
}
// Redraw the score box to update games won
DisplayScore(dc);
- if (wxMessageBox(_T("Do you wish to play again?"),
- _T("Well Done, You have won!"), wxYES_NO | wxICON_QUESTION) == wxYES)
+ if (wxMessageBox(wxT("Do you wish to play again?"),
+ wxT("Well Done, You have won!"), wxYES_NO | wxICON_QUESTION) == wxYES)
{
Deal();
canvas->Refresh();
wxCoord w, h;
{
wxCoord width, height;
- dc.GetTextExtent(_T("Average score:m_x"), &width, &height);
+ dc.GetTextExtent(wxT("Average score:m_x"), &width, &height);
w = width;
h = height;
}
dc.DrawRectangle(x + w, y, 20, 4 * h);
wxString str;
- str.Printf(_T("%d"), m_currentScore);
- dc.DrawText(_T("Score:"), x, y);
+ str.Printf(wxT("%d"), m_currentScore);
+ dc.DrawText(wxT("Score:"), x, y);
dc.DrawText(str, x + w, y);
y += h;
- str.Printf(_T("%d"), m_numGames);
- dc.DrawText(_T("Games played:"), x, y);
+ str.Printf(wxT("%d"), m_numGames);
+ dc.DrawText(wxT("Games played:"), x, y);
dc.DrawText(str, x + w, y);
y += h;
- str.Printf(_T("%d"), m_numWins);
- dc.DrawText(_T("Games won:"), x, y);
+ str.Printf(wxT("%d"), m_numWins);
+ dc.DrawText(wxT("Games won:"), x, y);
dc.DrawText(str, x + w, y);
y += h;
{
average = (2 * (m_currentScore + m_totalScore) + m_numGames ) / (2 * m_numGames);
}
- str.Printf(_T("%d"), average);
- dc.DrawText(_T("Average score:"), x, y);
+ str.Printf(wxT("%d"), average);
+ dc.DrawText(wxT("Average score:"), x, y);
dc.DrawText(str, x + w, y);
}
Pile::Redraw(dc);
wxString str;
- str.Printf(_T("%d "), m_topCard + 1);
+ str.Printf(wxT("%d "), m_topCard + 1);
dc.SetBackgroundMode( wxSOLID );
dc.SetTextBackground(FortyApp::BackgroundColour());
}
else
{
- wxMessageBox(_T("Pack::AddCard() Undo error"), _T("Forty Thieves: Warning"),
+ wxMessageBox(wxT("Pack::AddCard() Undo error"), wxT("Forty Thieves: Warning"),
wxOK | wxICON_EXCLAMATION);
}
card->TurnCard(facedown);
wxWindow* parent,
ScoreFile* file
) :
- wxDialog(parent, wxID_ANY, _T("Player Selection"), wxDefaultPosition),
+ wxDialog(parent, wxID_ANY, wxT("Player Selection"), wxDefaultPosition),
m_scoreFile(file)
{
- wxStaticText* msg = new wxStaticText(this, wxID_ANY, _T("Please select a name or type a new one:"));
+ wxStaticText* msg = new wxStaticText(this, wxID_ANY, wxT("Please select a name or type a new one:"));
wxListBox* list = new wxListBox(
this, ID_LISTBOX,
wxString name = m_textField->GetValue();
if (!name.IsNull() && name.Length() > 0)
{
- if (name.Contains(_T('@')))
+ if (name.Contains(wxT('@')))
{
- wxMessageBox(_T("Names should not contain the '@' character"), _T("Forty Thieves"));
+ wxMessageBox(wxT("Names should not contain the '@' character"), wxT("Forty Thieves"));
}
else
{
}
else
{
- wxMessageBox(_T("Please enter your name"), _T("Forty Thieves"));
+ wxMessageBox(wxT("Please enter your name"), wxT("Forty Thieves"));
}
}
else
average = (2 * score + games) / (2 * games);
}
list->SetCellValue(i,0,players[i]);
- string_value.Printf( _T("%u"), wins );
+ string_value.Printf( wxT("%u"), wins );
list->SetCellValue(i,1,string_value);
- string_value.Printf( _T("%u"), games );
+ string_value.Printf( wxT("%u"), games );
list->SetCellValue(i,2,string_value);
- string_value.Printf( _T("%u"), average );
+ string_value.Printf( wxT("%u"), average );
list->SetCellValue(i,3,string_value);
}
- list->SetColLabelValue(0, _T("Players"));
- list->SetColLabelValue(1, _T("Wins"));
- list->SetColLabelValue(2, _T("Games"));
- list->SetColLabelValue(3, _T("Score"));
+ list->SetColLabelValue(0, wxT("Players"));
+ list->SetColLabelValue(1, wxT("Wins"));
+ list->SetColLabelValue(2, wxT("Games"));
+ list->SetColLabelValue(3, wxT("Score"));
list->SetEditable(false);
list->AutoSizeColumns();
list->AutoSizeRows();
ScoreFile::ScoreFile(const wxString& appName)
{
- m_config = new wxConfig(appName, _T("wxWidgets"), appName, wxEmptyString,
+ m_config = new wxConfig(appName, wxT("wxWidgets"), appName, wxEmptyString,
wxCONFIG_USE_LOCAL_FILE); // only local
}
void ScoreFile::GetPlayerList( wxArrayString &list )
{
- m_config->SetPath(_T("/Players"));
+ m_config->SetPath(wxT("/Players"));
int length = m_config->GetNumberOfGroups();
if (length <= 0) return;
wxString ScoreFile::GetPreviousPlayer() const
{
wxString result;
- m_config->SetPath(_T("/General"));
- m_config->Read(_T("LastPlayer"), &result);
+ m_config->SetPath(wxT("/General"));
+ m_config->Read(wxT("LastPlayer"), &result);
return result;
}
games = wins = score = 0;
- m_config->SetPath(_T("/Players"));
+ m_config->SetPath(wxT("/Players"));
m_config->SetPath(player);
- if (m_config->Read(_T("Score"), &myScore, 0L) &&
- m_config->Read(_T("Games"), &myGames, 0L) &&
- m_config->Read(_T("Wins"), &myWins, 0L) &&
- m_config->Read(_T("Check"), &check, 0L))
+ if (m_config->Read(wxT("Score"), &myScore, 0L) &&
+ m_config->Read(wxT("Games"), &myGames, 0L) &&
+ m_config->Read(wxT("Wins"), &myWins, 0L) &&
+ m_config->Read(wxT("Check"), &check, 0L))
{
if (check != CalcCheck(player, myGames, myWins, myScore))
{
- wxMessageBox(_T("Score file corrupted"), _T("Warning"),
+ wxMessageBox(wxT("Score file corrupted"), wxT("Warning"),
wxOK | wxICON_EXCLAMATION);
}
else
{
if (!player.empty())
{
- m_config->SetPath(_T("/General"));
- m_config->Write(_T("LastPlayer"), wxString(player)); // Without wxString tmp, thinks it's bool in VC++
+ m_config->SetPath(wxT("/General"));
+ m_config->Write(wxT("LastPlayer"), wxString(player)); // Without wxString tmp, thinks it's bool in VC++
- m_config->SetPath(_T("/Players"));
+ m_config->SetPath(wxT("/Players"));
m_config->SetPath(player);
- m_config->Write(_T("Score"), (long)score);
- m_config->Write(_T("Games"), (long)games);
- m_config->Write(_T("Wins"), (long)wins);
- m_config->Write(_T("Check"), CalcCheck(player, games, wins, score));
+ m_config->Write(wxT("Score"), (long)score);
+ m_config->Write(wxT("Games"), (long)games);
+ m_config->Write(wxT("Wins"), (long)wins);
+ m_config->Write(wxT("Check"), CalcCheck(player, games, wins, score));
}
}
bool MyApp::OnInit()
{
// Create the main frame window
- MyFrame *frame = new MyFrame(NULL, _T("Fractal Mountains for wxWidgets"), wxDefaultPosition, wxSize(640, 480));
+ MyFrame *frame = new MyFrame(NULL, wxT("Fractal Mountains for wxWidgets"), wxDefaultPosition, wxSize(640, 480));
// Make a menubar
wxMenu *file_menu = new wxMenu;
file_menu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT));
menuBar = new wxMenuBar;
- menuBar->Append(file_menu, _T("&File"));
+ menuBar->Append(file_menu, wxT("&File"));
frame->SetMenuBar(menuBar);
int width, height;
// causes a crash due to conversion objects not being available
// during initialisation.
#ifndef __WXMAC__
- m_shape.Add( wxString::Format(_T("%i %i"), -width/2, -height/2) );
+ m_shape.Add( wxString::Format(wxT("%i %i"), -width/2, -height/2) );
#endif
for(int j = 0; j < height; j++)
{
// Backing bitmap
wxBitmap *backingBitmap = NULL;
-void PoetryError(const wxChar *, const wxChar *caption=_T("wxPoem Error"));
-void PoetryNotify(const wxChar *Msg, const wxChar *caption=_T("wxPoem"));
+void PoetryError(const wxChar *, const wxChar *caption=wxT("wxPoem Error"));
+void PoetryNotify(const wxChar *Msg, const wxChar *caption=wxT("wxPoem"));
void TryLoadIndex();
bool LoadPoem(const wxChar *, long);
int GetIndex();
dc->SetFont(*m_normalFont);
wxCoord xx;
wxCoord yy;
- dc->GetTextExtent(_T("X"), &xx, &yy);
+ dc->GetTextExtent(wxT("X"), &xx, &yy);
char_height = (int)yy;
if (current_page == 0)
line_ptr = line+3;
m_title = line_ptr;
- m_title << _T(" (cont'd)");
+ m_title << wxT(" (cont'd)");
dc->GetTextExtent(line_ptr, &xx, &yy);
FindMax(&curr_width, (int)xx);
// Write (cont'd)
if (page_break)
{
- const wxChar *cont = _T("(cont'd)");
+ const wxChar *cont = wxT("(cont'd)");
dc->SetFont(* m_normalFont);
if (ask || m_searchString.empty())
{
- wxString s = wxGetTextFromUser( _T("Enter search string"), _T("Search"), m_searchString);
+ wxString s = wxGetTextFromUser( wxT("Enter search string"), wxT("Search"), m_searchString);
if (!s.empty())
{
s.MakeLower();
else
{
last_poem_start = 0;
- PoetryNotify(_T("Search string not found."));
+ PoetryNotify(wxT("Search string not found."));
}
}
}
TheMainWindow = new MainWindow(NULL,
wxID_ANY,
- _T("wxPoem"),
+ wxT("wxPoem"),
wxPoint(XPos, YPos),
wxDefaultSize,
wxCAPTION|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxCLOSE_BOX|wxFULL_REPAINT_ON_RESIZE
}
else
{
- index_filename = _T(DEFAULT_POETRY_IND);
- data_filename = _T(DEFAULT_POETRY_DAT);
+ index_filename = wxT(DEFAULT_POETRY_IND);
+ data_filename = wxT(DEFAULT_POETRY_DAT);
}
TryLoadIndex();
wxWindow(frame, wxID_ANY)
{
m_popupMenu = new wxMenu;
- m_popupMenu->Append(POEM_NEXT, _T("Next poem/page"));
- m_popupMenu->Append(POEM_PREVIOUS, _T("Previous page"));
+ m_popupMenu->Append(POEM_NEXT, wxT("Next poem/page"));
+ m_popupMenu->Append(POEM_PREVIOUS, wxT("Previous page"));
m_popupMenu->AppendSeparator();
- m_popupMenu->Append(POEM_SEARCH, _T("Search"));
- m_popupMenu->Append(POEM_NEXT_MATCH, _T("Next match"));
- m_popupMenu->Append(POEM_COPY, _T("Copy to clipboard"));
- m_popupMenu->Append(POEM_MINIMIZE, _T("Minimize"));
+ m_popupMenu->Append(POEM_SEARCH, wxT("Search"));
+ m_popupMenu->Append(POEM_NEXT_MATCH, wxT("Next match"));
+ m_popupMenu->Append(POEM_COPY, wxT("Copy to clipboard"));
+ m_popupMenu->Append(POEM_MINIMIZE, wxT("Minimize"));
m_popupMenu->AppendSeparator();
- m_popupMenu->Append(POEM_BIGGER_TEXT, _T("Bigger text"));
- m_popupMenu->Append(POEM_SMALLER_TEXT, _T("Smaller text"));
+ m_popupMenu->Append(POEM_BIGGER_TEXT, wxT("Bigger text"));
+ m_popupMenu->Append(POEM_SMALLER_TEXT, wxT("Smaller text"));
m_popupMenu->AppendSeparator();
- m_popupMenu->Append(POEM_ABOUT, _T("About wxPoem"));
+ m_popupMenu->Append(POEM_ABOUT, wxT("About wxPoem"));
m_popupMenu->AppendSeparator();
- m_popupMenu->Append(POEM_EXIT, _T("Exit"));
+ m_popupMenu->Append(POEM_EXIT, wxT("Exit"));
}
MyCanvas::~MyCanvas()
if (file_name == NULL)
return 0;
- wxSprintf(buf, _T("%s.idx"), file_name);
+ wxSprintf(buf, wxT("%s.idx"), file_name);
- index_file = wxFopen(buf, _T("r"));
+ index_file = wxFopen(buf, wxT("r"));
if (index_file == NULL)
return 0;
- wxFscanf(index_file, _T("%ld"), &nitems);
+ wxFscanf(index_file, wxT("%ld"), &nitems);
for (int i = 0; i < nitems; i++)
{
- wxFscanf(index_file, _T("%ld"), &data);
+ wxFscanf(index_file, wxT("%ld"), &data);
poem_index[i] = data;
}
int indexn = (int)(rand() % nitems);
if ((indexn < 0) || (indexn > nitems))
- { PoetryError(_T("No such poem!"));
+ { PoetryError(wxT("No such poem!"));
return -1;
}
else
{
/* TODO: convert this code to use wxConfig
#if wxUSE_RESOURCES
- wxGetResource(_T("wxPoem"), _T("FontSize"), &pointSize);
- wxGetResource(_T("wxPoem"), _T("X"), &XPos);
- wxGetResource(_T("wxPoem"), _T("Y"), &YPos);
+ wxGetResource(wxT("wxPoem"), wxT("FontSize"), &pointSize);
+ wxGetResource(wxT("wxPoem"), wxT("X"), &XPos);
+ wxGetResource(wxT("wxPoem"), wxT("Y"), &YPos);
#endif
*/
}
TheMainWindow->GetPosition(&XPos, &YPos);
/* TODO: convert this code to use wxConfig
#if wxUSE_RESOURCES
- wxWriteResource(_T("wxPoem"), _T("FontSize"), pointSize);
- wxWriteResource(_T("wxPoem"), _T("X"), XPos);
- wxWriteResource(_T("wxPoem"), _T("Y"), YPos);
+ wxWriteResource(wxT("wxPoem"), wxT("FontSize"), pointSize);
+ wxWriteResource(wxT("wxPoem"), wxT("X"), XPos);
+ wxWriteResource(wxT("wxPoem"), wxT("Y"), YPos);
#endif
*/
#endif
if (file_name == NULL)
{
- wxSprintf(error_buf, _T("Error in Poem loading."));
+ wxSprintf(error_buf, wxT("Error in Poem loading."));
PoetryError(error_buf);
return false;
}
- wxSprintf(buf, _T("%s.dat"), file_name);
- data_file = wxFopen(buf, _T("r"));
+ wxSprintf(buf, wxT("%s.dat"), file_name);
+ data_file = wxFopen(buf, wxT("r"));
if (data_file == NULL)
{
- wxSprintf(error_buf, _T("Data file %s not found."), buf);
+ wxSprintf(error_buf, wxT("Data file %s not found."), buf);
PoetryError(error_buf);
return false;
}
if (i == BUFFER_SIZE)
{
- wxSprintf(error_buf, _T("%s"), _T("Poetry buffer exceeded."));
+ wxSprintf(error_buf, wxT("%s"), wxT("Poetry buffer exceeded."));
PoetryError(error_buf);
return false;
}
}
if (data_filename)
- wxSprintf(buf, _T("%s.dat"), data_filename);
+ wxSprintf(buf, wxT("%s.dat"), data_filename);
- file = wxFopen(buf, _T("r"));
+ file = wxFopen(buf, wxT("r"));
if (! (data_filename && file))
{
- wxSprintf(error_buf, _T("Poetry data file %s not found\n"), buf);
+ wxSprintf(error_buf, wxT("Poetry data file %s not found\n"), buf);
PoetryError(error_buf);
return false;
}
index_ok = (LoadIndex(index_filename) != 0);
if (!index_ok || (nitems == 0))
{
- PoetryError(_T("Index file not found; will compile new one"), _T("wxPoem"));
+ PoetryError(wxT("Index file not found; will compile new one"), wxT("wxPoem"));
index_ok = Compile();
}
}
wxChar buf[100];
if (data_filename)
- wxSprintf(buf, _T("%s.dat"), data_filename);
+ wxSprintf(buf, wxT("%s.dat"), data_filename);
- file = wxFopen(buf, _T("r"));
+ file = wxFopen(buf, wxT("r"));
if (! (data_filename && file))
{
- wxSprintf(error_buf, _T("Poetry data file %s not found\n"), buf);
+ wxSprintf(error_buf, wxT("Poetry data file %s not found\n"), buf);
PoetryError(error_buf);
return false;
}
fclose(file);
if (index_filename)
- wxSprintf(buf, _T("%s.idx"), index_filename);
+ wxSprintf(buf, wxT("%s.idx"), index_filename);
- file = wxFopen(buf, _T("w"));
+ file = wxFopen(buf, wxT("w"));
if (! (data_filename && file))
{
- wxSprintf(error_buf, _T("Poetry index file %s cannot be created\n"), buf);
+ wxSprintf(error_buf, wxT("Poetry index file %s cannot be created\n"), buf);
PoetryError(error_buf);
return false;
}
- wxFprintf(file, _T("%ld\n\n"), nitems);
+ wxFprintf(file, wxT("%ld\n\n"), nitems);
for (j = 0; j < nitems; j++)
- wxFprintf(file, _T("%ld\n"), poem_index[j]);
+ wxFprintf(file, wxT("%ld\n"), poem_index[j]);
fclose(file);
- PoetryNotify(_T("Poetry index compiled."));
+ PoetryNotify(wxT("Poetry index compiled."));
return true;
}
{
static wxString s;
s = poem_buffer;
- s.Replace( _T("@P"),wxEmptyString);
- s.Replace( _T("@A "),wxEmptyString);
- s.Replace( _T("@A"),wxEmptyString);
- s.Replace( _T("@T "),wxEmptyString);
- s.Replace( _T("@T"),wxEmptyString);
+ s.Replace( wxT("@P"),wxEmptyString);
+ s.Replace( wxT("@A "),wxEmptyString);
+ s.Replace( wxT("@A"),wxEmptyString);
+ s.Replace( wxT("@T "),wxEmptyString);
+ s.Replace( wxT("@T"),wxEmptyString);
wxTextDataObject *data = new wxTextDataObject( s.c_str() );
if (!wxTheClipboard->SetData( data ))
- wxMessageBox(_T("Error while copying to the clipboard."));
+ wxMessageBox(wxT("Error while copying to the clipboard."));
}
else
{
- wxMessageBox(_T("Error opening the clipboard."));
+ wxMessageBox(wxT("Error opening the clipboard."));
}
wxTheClipboard->Close();
break;
}
break;
case POEM_ABOUT:
- (void)wxMessageBox(_T("wxPoem Version 1.1\nJulian Smart (c) 1995"),
- _T("About wxPoem"), wxOK, TheMainWindow);
+ (void)wxMessageBox(wxT("wxPoem Version 1.1\nJulian Smart (c) 1995"),
+ wxT("About wxPoem"), wxOK, TheMainWindow);
break;
case POEM_EXIT:
// Exit
bool MyApp::OnInit()
{
// create the main application window
- MyFrame *frame = new MyFrame(_T("Minimal wxWindows App"));
+ MyFrame *frame = new MyFrame(wxT("Minimal wxWindows App"));
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(Minimal_About, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(Minimal_About, wxT("&About...\tF1"), wxT("Show about dialog"));
- menuFile->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(Minimal_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWindows!"));
+ SetStatusText(wxT("Welcome to wxWindows!"));
#endif // wxUSE_STATUSBAR
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
- msg.Printf( _T("This is the About dialog of the minimal sample.\n")
- _T("Welcome to %s"), wxVERSION_STRING);
+ msg.Printf( wxT("This is the About dialog of the minimal sample.\n")
+ wxT("Welcome to %s"), wxVERSION_STRING);
- wxMessageBox(msg, _T("About Minimal"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, wxT("About Minimal"), wxOK | wxICON_INFORMATION, this);
}
defined when compiling code which uses wxWidgets as a DLL/shared library}
@itemdef{WXBUILDING,
defined when building wxWidgets itself, whether as a static or shared library}
+@itemdef{wxNO_T,
+ may be predefined to prevent the library from defining _T() macro}
@endDefList
*/
current entry and begins the next. For example:
@code
-wxFFileOutputStream out(_T("test.zip"));
+wxFFileOutputStream out(wxT("test.zip"));
wxZipOutputStream zip(out);
wxTextOutputStream txt(zip);
wxString sep(wxFileName::GetPathSeparator());
-zip.PutNextEntry(_T("entry1.txt"));
-txt << _T("Some text for entry1.txt\n");
+zip.PutNextEntry(wxT("entry1.txt"));
+txt << wxT("Some text for entry1.txt\n");
-zip.PutNextEntry(_T("subdir") + sep + _T("entry2.txt"));
-txt << _T("Some text for subdir/entry2.txt\n");
+zip.PutNextEntry(wxT("subdir") + sep + wxT("entry2.txt"));
+txt << wxT("Some text for subdir/entry2.txt\n");
@endcode
The name of each entry can be a full path, which makes it possible to store
@code
auto_ptr<wxZipEntry> entry;
-wxFFileInputStream in(_T("test.zip"));
+wxFFileInputStream in(wxT("test.zip"));
wxZipInputStream zip(in);
while (entry.reset(zip.GetNextEntry()), entry.get() != NULL)
For example to delete all entries matching the pattern "*.txt":
@code
-auto_ptr<wxFFileInputStream> in(new wxFFileInputStream(_T("test.zip")));
-wxTempFileOutputStream out(_T("test.zip"));
+auto_ptr<wxFFileInputStream> in(new wxFFileInputStream(wxT("test.zip")));
+wxTempFileOutputStream out(wxT("test.zip"));
wxZipInputStream inzip(*in);
wxZipOutputStream outzip(out);
// call CopyEntry for each entry except those matching the pattern
while (entry.reset(inzip.GetNextEntry()), entry.get() != NULL)
- if (!entry->GetName().Matches(_T("*.txt")))
+ if (!entry->GetName().Matches(wxT("*.txt")))
if (!outzip.CopyEntry(entry.release(), inzip))
break;
wxString name = wxZipEntry::GetInternalName(localname);
// open the zip
-wxFFileInputStream in(_T("test.zip"));
+wxFFileInputStream in(wxT("test.zip"));
wxZipInputStream zip(in);
// call GetNextEntry() until the required internal name is found
ZipCatalog cat;
// open the zip
-wxFFileInputStream in(_T("test.zip"));
+wxFFileInputStream in(wxT("test.zip"));
wxZipInputStream zip(in);
// load the zip catalog
@code
// opening another entry without closing the first requires another
// input stream for the same file
-wxFFileInputStream in2(_T("test.zip"));
+wxFFileInputStream in2(wxT("test.zip"));
wxZipInputStream zip2(in2);
if ((it = cat.find(wxZipEntry::GetInternalName(local2))) != cat.end())
zip2.OpenEntry(*it->second);
}
else
{
- wxLogError(_T("can't handle '%s'"), filename.c_str());
+ wxLogError(wxT("can't handle '%s'"), filename.c_str());
}
}
@endcode
@li Specify the source code language and charset as arguments to
wxLocale::AddCatalog. For example:
@code
- locale.AddCatalog(_T("myapp"), wxLANGUAGE_GERMAN, _T("iso-8859-1"));
+ locale.AddCatalog(wxT("myapp"), wxLANGUAGE_GERMAN, wxT("iso-8859-1"));
@endcode
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
- msg.Printf( _T("This is the about dialog of XML resources demo.\n")
- _T("Welcome to %s"), wxVERSION_STRING);
+ msg.Printf( wxT("This is the about dialog of XML resources demo.\n")
+ wxT("Welcome to %s"), wxVERSION_STRING);
wxMessageBox(msg, "About XML resources demo",
wxOK | wxICON_INFORMATION, this);
// restore the old position to be able to test other formats and so on
if ( stream.SeekI(posOld) == wxInvalidOffset )
{
- wxLogDebug(_T("Failed to rewind the stream in wxAnimationDecoder!"));
+ wxLogDebug(wxT("Failed to rewind the stream in wxAnimationDecoder!"));
// reading would fail anyhow as we're not at the right position
return false;
wxString& Item(size_t nIndex) const
{
wxASSERT_MSG( nIndex < m_nCount,
- _T("wxArrayString: index out of bounds") );
+ wxT("wxArrayString: index out of bounds") );
return m_pItems[nIndex];
}
wxString& Last() const
{
wxASSERT_MSG( !IsEmpty(),
- _T("wxArrayString: index out of bounds") );
+ wxT("wxArrayString: index out of bounds") );
return Item(GetCount() - 1);
}
typedef wxString wxArtClient;
typedef wxString wxArtID;
-#define wxART_MAKE_CLIENT_ID_FROM_STR(id) (id + _T("_C"))
-#define wxART_MAKE_CLIENT_ID(id) _T(#id) _T("_C")
+#define wxART_MAKE_CLIENT_ID_FROM_STR(id) (id + wxT("_C"))
+#define wxART_MAKE_CLIENT_ID(id) wxT(#id) wxT("_C")
#define wxART_MAKE_ART_ID_FROM_STR(id) (id)
-#define wxART_MAKE_ART_ID(id) _T(#id)
+#define wxART_MAKE_ART_ID(id) wxT(#id)
// ----------------------------------------------------------------------------
// Art clients
if ( m_data == GetNullData() )
return NULL;
- wxASSERT_MSG( m_data->m_owned, _T("can't release non-owned buffer") );
- wxASSERT_MSG( m_data->m_ref == 1, _T("can't release shared buffer") );
+ wxASSERT_MSG( m_data->m_owned, wxT("can't release non-owned buffer") );
+ wxASSERT_MSG( m_data->m_ref == 1, wxT("can't release shared buffer") );
CharType * const p = m_data->Get();
// Other ways to append to the buffer
void AppendByte(char data)
{
- wxCHECK_RET( m_bufdata->m_data, _T("invalid wxMemoryBuffer") );
+ wxCHECK_RET( m_bufdata->m_data, wxT("invalid wxMemoryBuffer") );
m_bufdata->ResizeIfNeeded(m_bufdata->m_len + 1);
*(((char*)m_bufdata->m_data) + m_bufdata->m_len) = data;
/* ------------------------------------------------------------------------- */
-/* define _T() and related macros */
+/* define wxT() and related macros */
/* ------------------------------------------------------------------------- */
/* BSD systems define _T() to be something different in ctype.h, override it */
#undef _T
#endif
-/* could already be defined by tchar.h (it's quasi standard) */
-#ifndef _T
+/*
+ wxT ("wx text") macro turns a literal string constant into a wide char
+ constant. It is mostly unnecessary with wx 2.9 but defined for
+ compatibility.
+ */
+#ifndef wxT
#if !wxUSE_UNICODE
- #define _T(x) x
+ #define wxT(x) x
#else /* Unicode */
/* use wxCONCAT_HELPER so that x could be expanded if it's a macro */
- #define _T(x) wxCONCAT_HELPER(L, x)
+ #define wxT(x) wxCONCAT_HELPER(L, x)
#endif /* ASCII/Unicode */
-#endif /* !defined(_T) */
+#endif /* !defined(wxT) */
/*
wxS ("wx string") macro can be used to create literals using the same
#define wxS(x) x
#endif
-/* although global macros with such names are normally bad, we want to have */
-/* another name for _T() which should be used to avoid confusion between */
-/* _T() and _() in wxWidgets sources */
-#define wxT(x) _T(x)
+/*
+ _T() is a synonym for wxT() familiar to Windows programmers. As this macro
+ has even higher risk of conflicting with system headers, its use is
+ discouraged and you may predefine wxNO__T to disable it. Additionally, we
+ do it ourselves for Sun CC which is known to use it in its standard headers
+ (see #10660).
+ */
+#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ #ifndef wxNO__T
+ #define wxNO__T
+ #endif
+#endif
+
+#if !defined(_T) && !defined(wxNO__T)
+ #define _T(x) wxT(x)
+#endif
/* a helper macro allowing to make another macro Unicode-friendly, see below */
-#define wxAPPLY_T(x) _T(x)
+#define wxAPPLY_T(x) wxT(x)
/* Unicode-friendly __FILE__, __DATE__ and __TIME__ analogs */
#ifndef __TFILE__
public:
wxDirDialog(wxWindow *parent,
const wxString& message = wxDirSelectorPromptStr,
- const wxString& defaultPath = _T(""),
+ const wxString& defaultPath = wxT(""),
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
/// separates group and entry names (probably shouldn't be changed)
#ifndef wxCONFIG_PATH_SEPARATOR
- #define wxCONFIG_PATH_SEPARATOR _T('/')
+ #define wxCONFIG_PATH_SEPARATOR wxT('/')
#endif
/// introduces immutable entries
// (i.e. the ones which can't be changed from the local config file)
#ifndef wxCONFIG_IMMUTABLE_PREFIX
- #define wxCONFIG_IMMUTABLE_PREFIX _T('!')
+ #define wxCONFIG_IMMUTABLE_PREFIX wxT('!')
#endif
#if wxUSE_CONFIG
void SetContainerWindow(wxWindow *winParent)
{
- wxASSERT_MSG( !m_winParent, _T("shouldn't be called twice") );
+ wxASSERT_MSG( !m_winParent, wxT("shouldn't be called twice") );
m_winParent = winParent;
}
if (Condition) \
{ anyTest; } \
else \
- wxLogInfo(wxString::Format(_T("skipping: %s.%s\n reason: %s equals false\n"), \
+ wxLogInfo(wxString::Format(wxT("skipping: %s.%s\n reason: %s equals false\n"), \
wxString(suiteName, wxConvUTF8).c_str(), \
wxString(#testMethod, wxConvUTF8).c_str(), \
wxString(#Condition, wxConvUTF8).c_str()))
const wxPoint& pt,
wxHelpEvent::Origin origin)
{
- wxCHECK_MSG( window, false, _T("window must not be NULL") );
+ wxCHECK_MSG( window, false, wxT("window must not be NULL") );
m_helptextAtPoint = pt;
m_helptextOrigin = origin;
int AppendItems(const wxArrayStringsAdapter& items, void **clientData)
{
wxASSERT_MSG( GetClientDataType() != wxClientData_Object,
- _T("can't mix different types of client data") );
+ wxT("can't mix different types of client data") );
return AppendItems(items, clientData, wxClientData_Void);
}
wxClientData **clientData)
{
wxASSERT_MSG( GetClientDataType() != wxClientData_Void,
- _T("can't mix different types of client data") );
+ wxT("can't mix different types of client data") );
return AppendItems(items, reinterpret_cast<void **>(clientData),
wxClientData_Object);
void **clientData,
wxClientDataType type)
{
- wxASSERT_MSG( !IsSorted(), _T("can't insert items in sorted control") );
+ wxASSERT_MSG( !IsSorted(), wxT("can't insert items in sorted control") );
wxCHECK_MSG( pos <= GetCount(), wxNOT_FOUND,
- _T("position out of range") );
+ wxT("position out of range") );
// not all derived classes handle empty arrays correctly in
// DoInsertItems() and besides it really doesn't make much sense to do
// this (for append it could correspond to creating an initially empty
// control but why would anybody need to insert 0 items?)
wxCHECK_MSG( !items.IsEmpty(), wxNOT_FOUND,
- _T("need something to insert") );
+ wxT("need something to insert") );
return DoInsertItems(items, pos, clientData, type);
}
void **clientData)
{
wxASSERT_MSG( GetClientDataType() != wxClientData_Object,
- _T("can't mix different types of client data") );
+ wxT("can't mix different types of client data") );
return InsertItems(items, pos, clientData, wxClientData_Void);
}
wxClientData **clientData)
{
wxASSERT_MSG( GetClientDataType() != wxClientData_Void,
- _T("can't mix different types of client data") );
+ wxT("can't mix different types of client data") );
return InsertItems(items, pos,
reinterpret_cast<void **>(clientData),
#include "wx/control.h" // the base class
#include "wx/datetime.h"
-#define wxDatePickerCtrlNameStr _T("datectrl")
+#define wxDatePickerCtrlNameStr wxT("datectrl")
// wxDatePickerCtrl styles
enum
inline bool operator<(const wxDateTime& dt) const
{
- wxASSERT_MSG( IsValid() && dt.IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") );
return GetValue() < dt.GetValue();
}
inline bool operator<=(const wxDateTime& dt) const
{
- wxASSERT_MSG( IsValid() && dt.IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") );
return GetValue() <= dt.GetValue();
}
inline bool operator>(const wxDateTime& dt) const
{
- wxASSERT_MSG( IsValid() && dt.IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") );
return GetValue() > dt.GetValue();
}
inline bool operator>=(const wxDateTime& dt) const
{
- wxASSERT_MSG( IsValid() && dt.IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") );
return GetValue() >= dt.GetValue();
}
inline bool operator==(const wxDateTime& dt) const
{
- wxASSERT_MSG( IsValid() && dt.IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") );
return GetValue() == dt.GetValue();
}
inline bool operator!=(const wxDateTime& dt) const
{
- wxASSERT_MSG( IsValid() && dt.IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") );
return GetValue() != dt.GetValue();
}
inline wxDateTime& wxDateTime::Set(const Tm& tm)
{
- wxASSERT_MSG( tm.IsValid(), _T("invalid broken down date/time") );
+ wxASSERT_MSG( tm.IsValid(), wxT("invalid broken down date/time") );
return Set(tm.mday, (Month)tm.mon, tm.year,
tm.hour, tm.min, tm.sec, tm.msec);
inline wxLongLong wxDateTime::GetValue() const
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime"));
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime"));
return m_time;
}
inline time_t wxDateTime::GetTicks() const
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime"));
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime"));
if ( !IsInStdRange() )
{
return (time_t)-1;
inline bool wxDateTime::IsEqualTo(const wxDateTime& datetime) const
{
- wxASSERT_MSG( IsValid() && datetime.IsValid(), _T("invalid wxDateTime"));
+ wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime"));
return m_time == datetime.m_time;
}
inline bool wxDateTime::IsEarlierThan(const wxDateTime& datetime) const
{
- wxASSERT_MSG( IsValid() && datetime.IsValid(), _T("invalid wxDateTime"));
+ wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime"));
return m_time < datetime.m_time;
}
inline bool wxDateTime::IsLaterThan(const wxDateTime& datetime) const
{
- wxASSERT_MSG( IsValid() && datetime.IsValid(), _T("invalid wxDateTime"));
+ wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime"));
return m_time > datetime.m_time;
}
inline wxDateTime wxDateTime::Add(const wxTimeSpan& diff) const
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime"));
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime"));
return wxDateTime(m_time + diff.GetValue());
}
inline wxDateTime& wxDateTime::Add(const wxTimeSpan& diff)
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime"));
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime"));
m_time += diff.GetValue();
inline wxDateTime wxDateTime::Subtract(const wxTimeSpan& diff) const
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime"));
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime"));
return wxDateTime(m_time - diff.GetValue());
}
inline wxDateTime& wxDateTime::Subtract(const wxTimeSpan& diff)
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime"));
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime"));
m_time -= diff.GetValue();
inline wxTimeSpan wxDateTime::Subtract(const wxDateTime& datetime) const
{
- wxASSERT_MSG( IsValid() && datetime.IsValid(), _T("invalid wxDateTime"));
+ wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime"));
return wxTimeSpan(GetValue() - datetime.GetValue());
}
// common part of Init()s
void InitCommon(wxDC *dc, int style)
{
- wxASSERT_MSG( !m_dc, _T("wxBufferedDC already initialised") );
+ wxASSERT_MSG( !m_dc, wxT("wxBufferedDC already initialised") );
m_dc = dc;
m_style = style;
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc)
{
- wxFAIL_MSG( _T("this is probably wrong") );
+ wxFAIL_MSG( wxT("this is probably wrong") );
m_dc.DoDrawArc(GetX(x1, y1), GetY(x1, y1),
GetX(x2, y2), GetY(x2, y2),
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea)
{
- wxFAIL_MSG( _T("this is probably wrong") );
+ wxFAIL_MSG( wxT("this is probably wrong") );
m_dc.DoDrawEllipticArc(GetX(x, y), GetY(x, y),
GetX(w, h), GetY(w, h),
virtual void DoSetDeviceClippingRegion(const wxRegion& WXUNUSED(region))
{
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
}
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxDebugReportUpload(const wxString& url,
const wxString& input,
const wxString& action,
- const wxString& curl = _T("curl"));
+ const wxString& curl = wxT("curl"));
protected:
virtual bool DoProcess();
#if (defined(__VISUALC__) && defined(__WIN32__))
#define wxLongLong_t __int64
#define wxLongLongSuffix i64
- #define wxLongLongFmtSpec _T("I64")
+ #define wxLongLongFmtSpec wxT("I64")
#elif defined(__BORLANDC__) && defined(__WIN32__) && (__BORLANDC__ >= 0x520)
#define wxLongLong_t __int64
#define wxLongLongSuffix i64
- #define wxLongLongFmtSpec _T("L")
+ #define wxLongLongFmtSpec wxT("L")
#elif (defined(__WATCOMC__) && (defined(__WIN32__) || defined(__DOS__) || defined(__OS2__)))
#define wxLongLong_t __int64
#define wxLongLongSuffix i64
- #define wxLongLongFmtSpec _T("L")
+ #define wxLongLongFmtSpec wxT("L")
#elif defined(__DIGITALMARS__)
#define wxLongLong_t __int64
#define wxLongLongSuffix LL
- #define wxLongLongFmtSpec _T("ll")
+ #define wxLongLongFmtSpec wxT("ll")
#elif defined(__MINGW32__)
#define wxLongLong_t long long
#define wxLongLongSuffix ll
- #define wxLongLongFmtSpec _T("I64")
+ #define wxLongLongFmtSpec wxT("I64")
#elif defined(__MWERKS__)
#if __option(longlong)
#define wxLongLong_t long long
#define wxLongLongSuffix ll
- #define wxLongLongFmtSpec _T("ll")
+ #define wxLongLongFmtSpec wxT("ll")
#else
#error "The 64 bit integer support in CodeWarrior has been disabled."
#error "See the documentation on the 'longlong' pragma."
#define wxLongLong_t long long
#endif /* __WXPALMOS6__ */
#define wxLongLongSuffix ll
- #define wxLongLongFmtSpec _T("ll")
+ #define wxLongLongFmtSpec wxT("ll")
#elif defined(__VISAGECPP__) && __IBMCPP__ >= 400
#define wxLongLong_t long long
#elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \
(defined(__DJGPP__) && __DJGPP__ >= 2)
#define wxLongLong_t long long
#define wxLongLongSuffix ll
- #define wxLongLongFmtSpec _T("ll")
+ #define wxLongLongFmtSpec wxT("ll")
#elif defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
#define wxLongLong_t long
#define wxLongLongSuffix l
- #define wxLongLongFmtSpec _T("l")
+ #define wxLongLongFmtSpec wxT("l")
#define wxLongLongIsLong
#endif
// type only once, as the first parameter, and creating a variable of this type
// called "pfn<name>" initialized with the "name" from the "dynlib"
#define wxDYNLIB_FUNCTION(type, name, dynlib) \
- type pfn ## name = (type)(dynlib).GetSymbol(_T(#name))
+ type pfn ## name = (type)(dynlib).GetSymbol(wxT(#name))
// a more convenient function replacing wxDYNLIB_FUNCTION above
void RefObj() { ++m_objcount; }
void UnrefObj()
{
- wxASSERT_MSG( m_objcount > 0, _T("Too many objects deleted??") );
+ wxASSERT_MSG( m_objcount > 0, wxT("Too many objects deleted??") );
--m_objcount;
}
wxPropagateOnce(wxEvent& event) : m_event(event)
{
wxASSERT_MSG( m_event.m_propagationLevel > 0,
- _T("shouldn't be used unless ShouldPropagate()!") );
+ wxT("shouldn't be used unless ShouldPropagate()!") );
m_event.m_propagationLevel--;
}
// m_loggingOff flag is only used by wxEVT_[QUERY_]END_SESSION, it
// doesn't make sense for wxEVT_CLOSE_WINDOW
wxASSERT_MSG( m_eventType != wxEVT_CLOSE_WINDOW,
- _T("this flag is for end session events only") );
+ wxT("this flag is for end session events only") );
return m_loggingOff;
}
// def ctor
wxFFile() { m_fp = NULL; }
// open specified file (may fail, use IsOpened())
- wxFFile(const wxString& filename, const wxString& mode = _T("r"));
+ wxFFile(const wxString& filename, const wxString& mode = wxT("r"));
// attach to (already opened) file
wxFFile(FILE *lfp) { m_fp = lfp; }
// open/close
// open a file (existing or not - the mode controls what happens)
- bool Open(const wxString& filename, const wxString& mode = _T("r"));
+ bool Open(const wxString& filename, const wxString& mode = wxT("r"));
// closes the opened file (this is a NOP if not opened)
bool Close();
#define wxHAS_LARGE_FFILES
#endif
#else
- #define wxFileOffsetFmtSpec _T("")
+ #define wxFileOffsetFmtSpec wxT("")
#endif
#define wxClose close
#define wxRead ::read
#define wxHAS_LARGE_FFILES
#endif
#else
- #define wxFileOffsetFmtSpec _T("")
+ #define wxFileOffsetFmtSpec wxT("")
#endif
// functions
#define wxClose close
static wxULongLong GetSize(const wxString &file);
// returns the size in a human readable form
- wxString GetHumanReadableSize(const wxString &nullsize = wxGetTranslation(_T("Not available")),
+ wxString GetHumanReadableSize(const wxString &nullsize = wxGetTranslation(wxT("Not available")),
int precision = 1) const;
static wxString GetHumanReadableSize(const wxULongLong &sz,
- const wxString &nullsize = wxGetTranslation(_T("Not available")),
+ const wxString &nullsize = wxGetTranslation(wxT("Not available")),
int precision = 1);
#endif // wxUSE_LONGLONG
virtual wxCalendarDateAttr *GetAttr(size_t day) const
{
- wxCHECK_MSG( day > 0 && day < 32, NULL, _T("invalid day") );
+ wxCHECK_MSG( day > 0 && day < 32, NULL, wxT("invalid day") );
return m_attrs[day - 1];
}
virtual void SetAttr(size_t day, wxCalendarDateAttr *attr)
{
- wxCHECK_RET( day > 0 && day < 32, _T("invalid day") );
+ wxCHECK_RET( day > 0 && day < 32, wxT("invalid day") );
delete m_attrs[day - 1];
m_attrs[day - 1] = attr;
// all actions of single line text controls are supported
// popup/dismiss the choice window
-#define wxACTION_COMBOBOX_POPUP _T("popup")
-#define wxACTION_COMBOBOX_DISMISS _T("dismiss")
+#define wxACTION_COMBOBOX_POPUP wxT("popup")
+#define wxACTION_COMBOBOX_DISMISS wxT("dismiss")
#endif
#define WXGRID_DEFAULT_SCROLLBAR_WIDTH 16
// type names for grid table values
-#define wxGRID_VALUE_STRING _T("string")
-#define wxGRID_VALUE_BOOL _T("bool")
-#define wxGRID_VALUE_NUMBER _T("long")
-#define wxGRID_VALUE_FLOAT _T("double")
-#define wxGRID_VALUE_CHOICE _T("choice")
+#define wxGRID_VALUE_STRING wxT("string")
+#define wxGRID_VALUE_BOOL wxT("bool")
+#define wxGRID_VALUE_NUMBER wxT("long")
+#define wxGRID_VALUE_FLOAT wxT("double")
+#define wxGRID_VALUE_CHOICE wxT("choice")
#define wxGRID_VALUE_TEXT wxGRID_VALUE_STRING
#define wxGRID_VALUE_LONG wxGRID_VALUE_NUMBER
// more than once
void Create(wxGrid *grid)
{
- wxASSERT_MSG( !m_grid, _T("shouldn't be called more than once") );
+ wxASSERT_MSG( !m_grid, wxT("shouldn't be called more than once") );
Init(grid);
}
#if wxUSE_GRID
-#define wxGRID_VALUE_CHOICEINT _T("choiceint")
-#define wxGRID_VALUE_DATETIME _T("datetime")
+#define wxGRID_VALUE_CHOICEINT wxT("choiceint")
+#define wxGRID_VALUE_DATETIME wxT("datetime")
// the default renderer for the cells containing string data
// string representation of our value
wxString GetString() const
- { return wxString::Format(_T("%ld"), m_value); }
+ { return wxString::Format(wxT("%ld"), m_value); }
private:
int m_min,
// set the string values returned by GetValue() for the true and false
// states, respectively
- static void UseStringValues(const wxString& valueTrue = _T("1"),
+ static void UseStringValues(const wxString& valueTrue = wxT("1"),
const wxString& valueFalse = wxEmptyString);
// return true if the given string is equal to the string representation of
{
wxString s = GetText();
if ( s.empty() )
- s = _T('H');
+ s = wxT('H');
return s;
}
void ExtendWidth(wxCoord w)
{
wxASSERT_MSG( m_rectAll.width <= w,
- _T("width can only be increased") );
+ wxT("width can only be increased") );
m_rectAll.width = w;
m_rectLabel.x = m_rectAll.x + (w - m_rectLabel.width) / 2;
bool IsHighlighted() const
{
- wxASSERT_MSG( !IsVirtual(), _T("unexpected call to IsHighlighted") );
+ wxASSERT_MSG( !IsVirtual(), wxT("unexpected call to IsHighlighted") );
return m_highlighted;
}
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
- const wxString &name = _T("listctrlmainwindow") );
+ const wxString &name = wxT("listctrlmainwindow") );
virtual ~wxListMainWindow();
// get the line data for the given index
wxListLineData *GetLine(size_t n) const
{
- wxASSERT_MSG( n != (size_t)-1, _T("invalid line index") );
+ wxASSERT_MSG( n != (size_t)-1, wxT("invalid line index") );
if ( IsVirtual() )
{
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
- const wxString& name = _T("wxSpinCtrl"));
+ const wxString& name = wxT("wxSpinCtrl"));
virtual ~wxSpinCtrlGenericBase();
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
- const wxString& name = _T("wxSpinCtrl"))
+ const wxString& name = wxT("wxSpinCtrl"))
{
m_min = min;
m_max = max;
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"))
+ const wxString& name = wxT("wxSpinCtrl"))
{
Create(parent, id, value, pos, size, style, min, max, initial, name);
}
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"))
+ const wxString& name = wxT("wxSpinCtrl"))
{
return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size,
style, min, max, initial, 1, name);
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
- const wxString& name = _T("wxSpinCtrlDouble"))
+ const wxString& name = wxT("wxSpinCtrlDouble"))
{
m_digits = 0;
Create(parent, id, value, pos, size, style,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
- const wxString& name = _T("wxSpinCtrlDouble"))
+ const wxString& name = wxT("wxSpinCtrlDouble"))
{
return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size,
style, min, max, initial,
void SetSplitMode(int mode)
{
wxASSERT_MSG( mode == wxSPLIT_VERTICAL || mode == wxSPLIT_HORIZONTAL,
- _T("invalid split mode") );
+ wxT("invalid split mode") );
m_splitMode = (wxSplitMode)mode;
}
WX_GL_SAMPLES // 4 for 2x2 antialising supersampling on most graphics cards
};
-#define wxGLCanvasName _T("GLCanvas")
+#define wxGLCanvasName wxT("GLCanvas")
// ----------------------------------------------------------------------------
// wxGLContextBase: OpenGL rendering context
// there is no "right" choice of the checkbox indicators, so allow the user to
// define them himself if he wants
#ifndef wxCHECKLBOX_CHECKED
- #define wxCHECKLBOX_CHECKED _T('x')
- #define wxCHECKLBOX_UNCHECKED _T(' ')
+ #define wxCHECKLBOX_CHECKED wxT('x')
+ #define wxCHECKLBOX_UNCHECKED wxT(' ')
- #define wxCHECKLBOX_STRING _T("[ ] ")
+ #define wxCHECKLBOX_STRING wxT("[ ] ")
#endif
//-----------------------------------------------------------------------------
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
- const wxString& name = _T("wxSpinCtrlGTKBase"));
+ const wxString& name = wxT("wxSpinCtrlGTKBase"));
// wxSpinCtrl(Double) methods call DoXXX functions of the same name
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"))
+ const wxString& name = wxT("wxSpinCtrl"))
{
Create(parent, id, value, pos, size, style, min, max, initial, name);
}
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"))
+ const wxString& name = wxT("wxSpinCtrl"))
{
return wxSpinCtrlGTKBase::Create(parent, id, value, pos, size,
style, min, max, initial, 1, name);
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
- const wxString& name = _T("wxSpinCtrlDouble"))
+ const wxString& name = wxT("wxSpinCtrlDouble"))
{
Create(parent, id, value, pos, size, style,
min, max, initial, inc, name);
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
- const wxString& name = _T("wxSpinCtrlDouble"))
+ const wxString& name = wxT("wxSpinCtrlDouble"))
{
return wxSpinCtrlGTKBase::Create(parent, id, value, pos, size,
style, min, max, initial, inc, name);
// there is no "right" choice of the checkbox indicators, so allow the user to
// define them himself if he wants
#ifndef wxCHECKLBOX_CHECKED
- #define wxCHECKLBOX_CHECKED _T('x')
- #define wxCHECKLBOX_UNCHECKED _T(' ')
+ #define wxCHECKLBOX_CHECKED wxT('x')
+ #define wxCHECKLBOX_UNCHECKED wxT(' ')
- #define wxCHECKLBOX_STRING _T("[ ] ")
+ #define wxCHECKLBOX_STRING wxT("[ ] ")
#endif
//-----------------------------------------------------------------------------
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"))
+ const wxString& name = wxT("wxSpinCtrl"))
{
Create(parent, id, value, pos, size, style, min, max, initial, name);
}
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"));
+ const wxString& name = wxT("wxSpinCtrl"));
void SetValue(const wxString& text);
void SetSelection(long from, long to);
// defines for saving the BMP file in different formats, Bits Per Pixel
// USE: wximage.SetOption( wxIMAGE_OPTION_BMP_FORMAT, wxBMP_xBPP );
-#define wxIMAGE_OPTION_BMP_FORMAT wxString(_T("wxBMP_FORMAT"))
+#define wxIMAGE_OPTION_BMP_FORMAT wxString(wxT("wxBMP_FORMAT"))
// These two options are filled in upon reading CUR file and can (should) be
// specified when saving a CUR file - they define the hotspot of the cursor:
public:
wxBMPHandler()
{
- m_name = _T("Windows bitmap file");
- m_extension = _T("bmp");
+ m_name = wxT("Windows bitmap file");
+ m_extension = wxT("bmp");
m_type = wxBITMAP_TYPE_BMP;
- m_mime = _T("image/x-bmp");
+ m_mime = wxT("image/x-bmp");
}
#if wxUSE_STREAMS
public:
wxICOHandler()
{
- m_name = _T("Windows icon file");
- m_extension = _T("ico");
+ m_name = wxT("Windows icon file");
+ m_extension = wxT("ico");
m_type = wxBITMAP_TYPE_ICO;
- m_mime = _T("image/x-ico");
+ m_mime = wxT("image/x-ico");
}
#if wxUSE_STREAMS
public:
wxCURHandler()
{
- m_name = _T("Windows cursor file");
- m_extension = _T("cur");
+ m_name = wxT("Windows cursor file");
+ m_extension = wxT("cur");
m_type = wxBITMAP_TYPE_CUR;
- m_mime = _T("image/x-cur");
+ m_mime = wxT("image/x-cur");
}
// VS: This handler's meat is implemented inside wxICOHandler (the two
public:
wxANIHandler()
{
- m_name = _T("Windows animated cursor file");
- m_extension = _T("ani");
+ m_name = wxT("Windows animated cursor file");
+ m_extension = wxT("ani");
m_type = wxBITMAP_TYPE_ANI;
- m_mime = _T("image/x-ani");
+ m_mime = wxT("image/x-ani");
}
// which breaks the compilation below
#undef index
-#define wxIMAGE_OPTION_QUALITY wxString(_T("quality"))
-#define wxIMAGE_OPTION_FILENAME wxString(_T("FileName"))
+#define wxIMAGE_OPTION_QUALITY wxString(wxT("quality"))
+#define wxIMAGE_OPTION_FILENAME wxString(wxT("FileName"))
-#define wxIMAGE_OPTION_RESOLUTION wxString(_T("Resolution"))
-#define wxIMAGE_OPTION_RESOLUTIONX wxString(_T("ResolutionX"))
-#define wxIMAGE_OPTION_RESOLUTIONY wxString(_T("ResolutionY"))
+#define wxIMAGE_OPTION_RESOLUTION wxString(wxT("Resolution"))
+#define wxIMAGE_OPTION_RESOLUTIONX wxString(wxT("ResolutionX"))
+#define wxIMAGE_OPTION_RESOLUTIONY wxString(wxT("ResolutionY"))
-#define wxIMAGE_OPTION_RESOLUTIONUNIT wxString(_T("ResolutionUnit"))
+#define wxIMAGE_OPTION_RESOLUTIONUNIT wxString(wxT("ResolutionUnit"))
-#define wxIMAGE_OPTION_MAX_WIDTH wxString(_T("MaxWidth"))
-#define wxIMAGE_OPTION_MAX_HEIGHT wxString(_T("MaxHeight"))
+#define wxIMAGE_OPTION_MAX_WIDTH wxString(wxT("MaxWidth"))
+#define wxIMAGE_OPTION_MAX_HEIGHT wxString(wxT("MaxHeight"))
// constants used with wxIMAGE_OPTION_RESOLUTIONUNIT
//
#include "wx/image.h"
// defines for wxImage::SetOption
-#define wxIMAGE_OPTION_BITSPERSAMPLE wxString(_T("BitsPerSample"))
-#define wxIMAGE_OPTION_SAMPLESPERPIXEL wxString(_T("SamplesPerPixel"))
-#define wxIMAGE_OPTION_COMPRESSION wxString(_T("Compression"))
-#define wxIMAGE_OPTION_IMAGEDESCRIPTOR wxString(_T("ImageDescriptor"))
+#define wxIMAGE_OPTION_BITSPERSAMPLE wxString(wxT("BitsPerSample"))
+#define wxIMAGE_OPTION_SAMPLESPERPIXEL wxString(wxT("SamplesPerPixel"))
+#define wxIMAGE_OPTION_COMPRESSION wxString(wxT("Compression"))
+#define wxIMAGE_OPTION_IMAGEDESCRIPTOR wxString(wxT("ImageDescriptor"))
class WXDLLIMPEXP_CORE wxTIFFHandler: public wxImageHandler
{
bool operator==(const compatibility_iterator& i) const \
{ \
wxASSERT_MSG( m_list && i.m_list, \
- _T("comparing invalid iterators is illegal") ); \
+ wxT("comparing invalid iterators is illegal") ); \
return (m_list == i.m_list) && (m_iter == i.m_iter); \
} \
bool operator!=(const compatibility_iterator& i) const \
long ToLong() const
{
wxASSERT_MSG( (m_ll >= LONG_MIN) && (m_ll <= LONG_MAX),
- _T("wxLongLong to long conversion loss of precision") );
+ wxT("wxLongLong to long conversion loss of precision") );
return wx_truncate_cast(long, m_ll);
}
unsigned long ToULong() const
{
wxASSERT_MSG( m_ll <= LONG_MAX,
- _T("wxULongLong to long conversion loss of precision") );
+ wxT("wxULongLong to long conversion loss of precision") );
return wx_truncate_cast(unsigned long, m_ll);
}
long ToLong() const
{
wxASSERT_MSG( (m_hi == 0l) || (m_hi == -1l),
- _T("wxLongLong to long conversion loss of precision") );
+ wxT("wxLongLong to long conversion loss of precision") );
return (long)m_lo;
}
unsigned long ToULong() const
{
wxASSERT_MSG( m_hi == 0ul,
- _T("wxULongLong to long conversion loss of precision") );
+ wxT("wxULongLong to long conversion loss of precision") );
return (unsigned long)m_lo;
}
inline int wxRound(double x)
{
wxASSERT_MSG( x > INT_MIN - 0.5 && x < INT_MAX + 0.5,
- _T("argument out of supported range") );
+ wxT("argument out of supported range") );
#if defined(HAVE_ROUND)
return int(round(x));
public:
// all string ctors here
- wxString GetType() const { return BeforeFirst(_T('/')); }
- wxString GetSubType() const { return AfterFirst(_T('/')); }
+ wxString GetType() const { return BeforeFirst(wxT('/')); }
+ wxString GetSubType() const { return AfterFirst(wxT('/')); }
void SetSubType(const wxString& subtype)
{
- *this = GetType() + _T('/') + subtype;
+ *this = GetType() + wxT('/') + subtype;
}
bool Matches(const wxMimeType& wildcard)
// after that
void AddDependency(wxClassInfo *dep)
{
- wxCHECK_RET( dep, _T("NULL module dependency") );
+ wxCHECK_RET( dep, wxT("NULL module dependency") );
m_dependencies.Add(dep);
}
// this suffix should be appended to all our Win32 class names to obtain a
// variant registered without CS_[HV]REDRAW styles
- static const wxChar *GetNoRedrawClassSuffix() { return _T("NR"); }
+ static const wxChar *GetNoRedrawClassSuffix() { return wxT("NR"); }
// get the name of the registered Win32 class with the given (unique) base
// name: this function constructs the unique class name using this name as
virtual void DoGetSize(int *w, int *h) const
{
wxASSERT_MSG( m_size.IsFullySpecified(),
- _T("size of this DC hadn't been set and is unknown") );
+ wxT("size of this DC hadn't been set and is unknown") );
if ( w )
*w = m_size.x;
virtual wxGDIRefData *
CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const
{
- wxFAIL_MSG( _T("must be implemented if used") );
+ wxFAIL_MSG( wxT("must be implemented if used") );
return NULL;
}
#define wxGetFormatName(format) wxDataObject::GetFormatName(format)
#else // !Debug
- #define wxGetFormatName(format) _T("")
+ #define wxGetFormatName(format) wxT("")
#endif // Debug/!Debug
// they need to be accessed from wxIDataObject, so made them public,
// or wxIDataObject friend
// the cursor 'name' from the resources under MSW, but will expand to
// something else under GTK. If you don't use it, you will have to use #ifdef
// in the application code.
-#define wxDROP_ICON(name) wxCursor(_T(#name))
+#define wxDROP_ICON(name) wxCursor(wxT(#name))
// ----------------------------------------------------------------------------
// wxDropSource is used to start the drag-&-drop operation on associated
#define IMPLEMENT_IUNKNOWN_METHODS(classname) \
STDMETHODIMP classname::QueryInterface(REFIID riid, void **ppv) \
{ \
- wxLogQueryInterface(_T(#classname), riid); \
+ wxLogQueryInterface(wxT(#classname), riid); \
\
if ( IsIidFromList(riid, ms_aIids, WXSIZEOF(ms_aIids)) ) { \
*ppv = this; \
\
STDMETHODIMP_(ULONG) classname::AddRef() \
{ \
- wxLogAddRef(_T(#classname), m_cRef); \
+ wxLogAddRef(wxT(#classname), m_cRef); \
\
return ++m_cRef; \
} \
\
STDMETHODIMP_(ULONG) classname::Release() \
{ \
- wxLogRelease(_T(#classname), m_cRef); \
+ wxLogRelease(wxT(#classname), m_cRef); \
\
if ( --m_cRef == wxAutoULong(0) ) { \
delete this; \
if ( !::GetWindowRect(hwnd, &rect) )
{
- wxLogLastError(_T("GetWindowRect"));
+ wxLogLastError(wxT("GetWindowRect"));
}
return rect;
if ( !::GetClientRect(hwnd, &rect) )
{
- wxLogLastError(_T("GetClientRect"));
+ wxLogLastError(wxT("GetClientRect"));
}
return rect;
void Init(HDC hdc, HGDIOBJ hgdiobj)
{
- wxASSERT_MSG( !m_hdc, _T("initializing twice?") );
+ wxASSERT_MSG( !m_hdc, wxT("initializing twice?") );
m_hdc = hdc;
void InitGdiobj(HGDIOBJ gdiobj)
{
- wxASSERT_MSG( !m_gdiobj, _T("initializing twice?") );
+ wxASSERT_MSG( !m_gdiobj, wxT("initializing twice?") );
m_gdiobj = gdiobj;
}
{
if ( !::SelectClipRgn(hdc, hrgn) )
{
- wxLogLastError(_T("SelectClipRgn"));
+ wxLogLastError(wxT("SelectClipRgn"));
}
}
m_modeOld = ::SetMapMode(hdc, mm);
if ( !m_modeOld )
{
- wxLogLastError(_T("SelectClipRgn"));
+ wxLogLastError(wxT("SelectClipRgn"));
}
}
m_hGlobal = ::GlobalAlloc(flags, size);
if ( !m_hGlobal )
{
- wxLogLastError(_T("GlobalAlloc"));
+ wxLogLastError(wxT("GlobalAlloc"));
}
}
{
if ( m_hGlobal && ::GlobalFree(m_hGlobal) )
{
- wxLogLastError(_T("GlobalFree"));
+ wxLogLastError(wxT("GlobalFree"));
}
}
m_ptr = GlobalLock(hGlobal);
if ( !m_ptr )
{
- wxLogLastError(_T("GlobalLock"));
+ wxLogLastError(wxT("GlobalLock"));
}
}
DWORD dwLastError = ::GetLastError();
if ( dwLastError != NO_ERROR )
{
- wxLogApiError(_T("GlobalUnlock"), dwLastError);
+ wxLogApiError(wxT("GlobalUnlock"), dwLastError);
}
}
}
{
// we should only be called if we hadn't been initialized yet
wxASSERT_MSG( m_registered == -1,
- _T("calling ClassRegistrar::Register() twice?") );
+ wxT("calling ClassRegistrar::Register() twice?") );
m_registered = ::RegisterClass(&wc) ? 1 : 0;
if ( !IsRegistered() )
{
- wxLogLastError(_T("RegisterClassEx()"));
+ wxLogLastError(wxT("RegisterClassEx()"));
}
else
{
{
if ( !::UnregisterClass(m_clsname.wx_str(), wxhInstance) )
{
- wxLogLastError(_T("UnregisterClass"));
+ wxLogLastError(wxT("UnregisterClass"));
}
}
}
MAX_PATH
) )
{
- wxLogLastError(_T("GetModuleFileName"));
+ wxLogLastError(wxT("GetModuleFileName"));
}
return fullname;
// returns BS_MULTILINE if the label contains new lines or 0 otherwise
inline int GetMultilineStyle(const wxString& label)
{
- return label.find(_T('\n')) == wxString::npos ? 0 : BS_MULTILINE;
+ return label.find(wxT('\n')) == wxString::npos ? 0 : BS_MULTILINE;
}
// update the style of the specified HWND to include or exclude BS_MULTILINE
m_oldColFg = ::SetTextColor(m_hdc, colFg);
if ( m_oldColFg == CLR_INVALID )
{
- wxLogLastError(_T("SetTextColor"));
+ wxLogLastError(wxT("SetTextColor"));
}
}
else
m_oldColBg = ::SetBkColor(m_hdc, colBg);
if ( m_oldColBg == CLR_INVALID )
{
- wxLogLastError(_T("SetBkColor"));
+ wxLogLastError(wxT("SetBkColor"));
}
}
else
: OPAQUE);
if ( !m_oldMode )
{
- wxLogLastError(_T("SetBkMode"));
+ wxLogLastError(wxT("SetBkMode"));
}
}
#endif // WINVER >= 0x0600
{
// maybe we should initialize the struct with some defaults?
- wxLogLastError(_T("SystemParametersInfo(SPI_GETNONCLIENTMETRICS)"));
+ wxLogLastError(wxT("SystemParametersInfo(SPI_GETNONCLIENTMETRICS)"));
}
}
void Init();
// format an integer value as string
- static wxString Format(int n) { return wxString::Format(_T("%d"), n); }
+ static wxString Format(int n) { return wxString::Format(wxT("%d"), n); }
// get the boundig box for the slider and possible labels
wxRect GetBoundingBox() const;
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"))
+ const wxString& name = wxT("wxSpinCtrl"))
{
Create(parent, id, value, pos, size, style, min, max, initial, name);
}
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"));
+ const wxString& name = wxT("wxSpinCtrl"));
// a wxTextCtrl-like method (but we can't have GetValue returning wxString
// because the base class already has one returning int!)
// allocate enough space for the given number of windows
void Create(size_t n)
{
- wxASSERT_MSG( !m_hwnds, _T("Create() called twice?") );
+ wxASSERT_MSG( !m_hwnds, wxT("Create() called twice?") );
m_count = n;
m_hwnds = (HWND *)calloc(n, sizeof(HWND));
// access a given window
HWND& Get(size_t n)
{
- wxASSERT_MSG( n < m_count, _T("subwindow index out of range") );
+ wxASSERT_MSG( n < m_count, wxT("subwindow index out of range") );
return m_hwnds[n];
}
// that it is not reused while this object exists
void Set(size_t n, HWND hwnd, wxWindowID id)
{
- wxASSERT_MSG( n < m_count, _T("subwindow index out of range") );
+ wxASSERT_MSG( n < m_count, wxT("subwindow index out of range") );
m_hwnds[n] = hwnd;
m_ids[n] = id;
void SetFont(const wxFont& font)
{
HFONT hfont = GetHfontOf(font);
- wxCHECK_RET( hfont, _T("invalid font") );
+ wxCHECK_RET( hfont, wxT("invalid font") );
for ( size_t n = 0; n < m_count; n++ )
{
wxString path;
if ( !SHGetPathFromIDList(m_pidl, wxStringBuffer(path, MAX_PATH)) )
{
- wxLogLastError(_T("SHGetPathFromIDList"));
+ wxLogLastError(wxT("SHGetPathFromIDList"));
}
return path;
virtual wxGDIRefData *
CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const
{
- wxFAIL_MSG( _T("must be implemented if used") );
+ wxFAIL_MSG( wxT("must be implemented if used") );
return NULL;
}
* for this combination of CTl3D/FAFA settings
*/
-#define STATIC_CLASS _T("STATIC")
+#define STATIC_CLASS wxT("STATIC")
#define STATIC_FLAGS (SS_TEXT|DT_LEFT|SS_LEFT|WS_VISIBLE)
-#define CHECK_CLASS _T("BUTTON")
+#define CHECK_CLASS wxT("BUTTON")
#define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP)
#define CHECK_IS_FAFA FALSE
-#define RADIO_CLASS _T("BUTTON" )
+#define RADIO_CLASS wxT("BUTTON" )
#define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_VISIBLE)
#define RADIO_SIZE 20
#define RADIO_IS_FAFA FALSE
,int nMin = 0
,int nMax = 100
,int nInitial = 0
- ,const wxString& rsName = _T("wxSpinCtrl")
+ ,const wxString& rsName = wxT("wxSpinCtrl")
)
{
Create(pParent, vId, rsValue, rPos, rSize, lStyle, nMin, nMax, nInitial, rsName);
,int nMin = 0
,int nMax = 100
,int nInitial = 0
- ,const wxString& rsName = _T("wxSpinCtrl")
+ ,const wxString& rsName = wxT("wxSpinCtrl")
);
//
public:
wxDirDialog(wxWindow *parent,
const wxString& message = wxDirSelectorPromptStr,
- const wxString& defaultPath = _T(""),
+ const wxString& defaultPath = wxT(""),
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
#include "wx/window.h"
#if wxUSE_SYSTEM_OPTIONS
- #define wxMAC_WINDOW_PLAIN_TRANSITION _T("mac.window-plain-transition")
+ #define wxMAC_WINDOW_PLAIN_TRANSITION wxT("mac.window-plain-transition")
#endif
//-----------------------------------------------------------------------------
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"))
+ const wxString& name = wxT("wxSpinCtrl"))
{
Init();
Create(parent, id, value, pos, size, style, min, max, initial, name);
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"));
+ const wxString& name = wxT("wxSpinCtrl"));
// wxTextCtrl-like method
void SetSelection(long from, long to);
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"))
+ const wxString& name = wxT("wxSpinCtrl"))
{
Create(parent, id, value, pos, size, style, min, max, initial, name);
}
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"))
+ const wxString& name = wxT("wxSpinCtrl"))
{
SetRange(min, max);
public:
virtual ~wxPaletteBase() { }
- virtual int GetColoursCount() const { wxFAIL_MSG( _T("not implemented") ); return 0; }
+ virtual int GetColoursCount() const { wxFAIL_MSG( wxT("not implemented") ); return 0; }
};
#if defined(__WXPALMOS__)
virtual void DoGetSize(int *w, int *h) const
{
wxASSERT_MSG( m_size.IsFullySpecified(),
- _T("size of this DC hadn't been set and is unknown") );
+ wxT("size of this DC hadn't been set and is unknown") );
if ( w )
*w = m_size.x;
virtual wxGDIRefData *
CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const
{
- wxFAIL_MSG( _T("must be implemented if used") );
+ wxFAIL_MSG( wxT("must be implemented if used") );
return NULL;
}
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"))
+ const wxString& name = wxT("wxSpinCtrl"))
{
Create(parent, id, value, pos, size, style, min, max, initial, name);
}
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS,
int min = 0, int max = 100, int initial = 0,
- const wxString& name = _T("wxSpinCtrl"));
+ const wxString& name = wxT("wxSpinCtrl"));
// a wxTextCtrl-like method (but we can't have GetValue returning wxString
// because the base class already has one returning int!)
// vice versa
wxIcon GetIcon() const
{
- wxASSERT_MSG( m_isIcon, _T("no icon in this wxStaticBitmap") );
+ wxASSERT_MSG( m_isIcon, wxT("no icon in this wxStaticBitmap") );
return *(wxIcon *)m_image;
}
wxBitmap GetBitmap() const
{
- wxASSERT_MSG( !m_isIcon, _T("no bitmap in this wxStaticBitmap") );
+ wxASSERT_MSG( !m_isIcon, wxT("no bitmap in this wxStaticBitmap") );
return *(wxBitmap *)m_image;
}
// backing file is never created and the backing is done with memory.
wxBackingFile(wxInputStream *stream,
size_t bufsize = DefaultBufSize,
- const wxString& prefix = _T("wxbf"));
+ const wxString& prefix = wxT("wxbf"));
wxBackingFile() : m_impl(NULL) { }
~wxBackingFile();
// find the first * in our flag buffer
char *pwidth = strchr(m_szFlags, '*');
- wxCHECK_RET(pwidth, _T("field width must be specified"));
+ wxCHECK_RET(pwidth, wxT("field width must be specified"));
// save what follows the * (the +1 is to skip the asterisk itself!)
strcpy(temp, pwidth+1);
if (!m_bAlignLeft)
for (i = 1; i < (size_t)m_nMinWidth; i++)
- APPEND_CH(_T(' '));
+ APPEND_CH(wxT(' '));
APPEND_CH(val);
if (m_bAlignLeft)
for (i = 1; i < (size_t)m_nMinWidth; i++)
- APPEND_CH(_T(' '));
+ APPEND_CH(wxT(' '));
}
break;
if (!m_bAlignLeft)
{
for (i = len; i < m_nMinWidth; i++)
- APPEND_CH(_T(' '));
+ APPEND_CH(wxT(' '));
}
len = wxMin((unsigned int)len, lenMax-lenCur);
if (m_bAlignLeft)
{
for (i = len; i < m_nMinWidth; i++)
- APPEND_CH(_T(' '));
+ APPEND_CH(wxT(' '));
}
}
break;
// the trace mask used by assorted wxLogTrace() in ftp code, do
// wxLog::AddTraceMask(FTP_TRACE_MASK) to see them in output
-#define FTP_TRACE_MASK _T("ftp")
+#define FTP_TRACE_MASK wxT("ftp")
#endif // wxUSE_PROTOCOL_FTP
~wxRecursionGuard()
{
- wxASSERT_MSG( m_flag > 0, _T("unbalanced wxRecursionGuards!?") );
+ wxASSERT_MSG( m_flag > 0, wxT("unbalanced wxRecursionGuards!?") );
m_flag--;
}
////@begin control identifiers
#define SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
-#define SYMBOL_WXRICHTEXTBULLETSPAGE_TITLE _T("")
+#define SYMBOL_WXRICHTEXTBULLETSPAGE_TITLE wxT("")
#define SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME ID_RICHTEXTBULLETSPAGE
#define SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE wxSize(400, 300)
#define SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION wxDefaultPosition
////@begin control identifiers
#define SYMBOL_WXRICHTEXTFONTPAGE_STYLE wxTAB_TRAVERSAL
-#define SYMBOL_WXRICHTEXTFONTPAGE_TITLE _T("")
+#define SYMBOL_WXRICHTEXTFONTPAGE_TITLE wxT("")
#define SYMBOL_WXRICHTEXTFONTPAGE_IDNAME ID_RICHTEXTFONTPAGE
#define SYMBOL_WXRICHTEXTFONTPAGE_SIZE wxSize(200, 100)
#define SYMBOL_WXRICHTEXTFONTPAGE_POSITION wxDefaultPosition
////@begin control identifiers
#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
-#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_TITLE _T("")
+#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_TITLE wxT("")
#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_IDNAME ID_RICHTEXTINDENTSSPACINGPAGE
#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_SIZE wxSize(400, 300)
#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_POSITION wxDefaultPosition
////@begin control identifiers
#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
-#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_TITLE _T("")
+#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_TITLE wxT("")
#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_IDNAME ID_RICHTEXTLISTSTYLEPAGE
#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE wxSize(400, 300)
#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION wxDefaultPosition
////@begin control identifiers
#define SYMBOL_WXRICHTEXTSTYLEPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
-#define SYMBOL_WXRICHTEXTSTYLEPAGE_TITLE _T("")
+#define SYMBOL_WXRICHTEXTSTYLEPAGE_TITLE wxT("")
#define SYMBOL_WXRICHTEXTSTYLEPAGE_IDNAME ID_RICHTEXTSTYLEPAGE
#define SYMBOL_WXRICHTEXTSTYLEPAGE_SIZE wxSize(400, 300)
#define SYMBOL_WXRICHTEXTSTYLEPAGE_POSITION wxDefaultPosition
////@begin control identifiers
#define SYMBOL_WXRICHTEXTTABSPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL
-#define SYMBOL_WXRICHTEXTTABSPAGE_TITLE _T("")
+#define SYMBOL_WXRICHTEXTTABSPAGE_TITLE wxT("")
#define SYMBOL_WXRICHTEXTTABSPAGE_IDNAME ID_RICHTEXTTABSPAGE
#define SYMBOL_WXRICHTEXTTABSPAGE_SIZE wxSize(400, 300)
#define SYMBOL_WXRICHTEXTTABSPAGE_POSITION wxDefaultPosition
void Clear() { m_itemsSel.Clear(); m_count = 0; m_defaultState = false; }
// must be called when a new item is inserted/added
- void OnItemAdd(unsigned WXUNUSED(item)) { wxFAIL_MSG( _T("TODO") ); }
+ void OnItemAdd(unsigned WXUNUSED(item)) { wxFAIL_MSG( wxT("TODO") ); }
// must be called when an item is deleted
void OnItemDelete(unsigned item);
m_totalProportion = 0;
wxASSERT_MSG( m_orient == wxHORIZONTAL || m_orient == wxVERTICAL,
- _T("invalid value for wxBoxSizer orientation") );
+ wxT("invalid value for wxBoxSizer orientation") );
}
int GetOrientation() const { return m_orient; }
{
wxASSERT_MSG( (flags & wxSOUND_LOOP) == 0 ||
(flags & wxSOUND_ASYNC) != 0,
- _T("sound can only be looped asynchronously") );
+ wxT("sound can only be looped asynchronously") );
return DoPlay(flags);
}
#include "wx/control.h"
#include "wx/event.h"
-#define wxSPIN_BUTTON_NAME _T("wxSpinButton")
+#define wxSPIN_BUTTON_NAME wxT("wxSpinButton")
// ----------------------------------------------------------------------------
// The wxSpinButton is like a small scrollbar than is often placed next
void Resume()
{
wxASSERT_MSG( m_pauseCount > 0,
- _T("Resuming stop watch which is not paused") );
+ wxT("Resuming stop watch which is not paused") );
if ( --m_pauseCount == 0 )
Start(m_pause);
wxCStrData operator-(ptrdiff_t n) const
{
wxASSERT_MSG( n <= (ptrdiff_t)m_offset,
- _T("attempt to construct address before the beginning of the string") );
+ wxT("attempt to construct address before the beginning of the string") );
return wxCStrData(m_str, m_offset - n, m_owned);
}
// get last character
wxUniChar Last() const
{
- wxASSERT_MSG( !empty(), _T("wxString: index out of bounds") );
+ wxASSERT_MSG( !empty(), wxT("wxString: index out of bounds") );
return *rbegin();
}
// get writable last character
wxUniCharRef Last()
{
- wxASSERT_MSG( !empty(), _T("wxString: index out of bounds") );
+ wxASSERT_MSG( !empty(), wxT("wxString: index out of bounds") );
return *rbegin();
}
{
#if WXWIN_COMPATIBILITY_2_8 && !wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8
wxASSERT_MSG( s.IsValid(),
- _T("did you forget to call UngetWriteBuf()?") );
+ wxT("did you forget to call UngetWriteBuf()?") );
#endif
append(s);
// stream-like functions
// insert an int into string
wxString& operator<<(int i)
- { return (*this) << Format(_T("%d"), i); }
+ { return (*this) << Format(wxT("%d"), i); }
// insert an unsigned int into string
wxString& operator<<(unsigned int ui)
- { return (*this) << Format(_T("%u"), ui); }
+ { return (*this) << Format(wxT("%u"), ui); }
// insert a long into string
wxString& operator<<(long l)
- { return (*this) << Format(_T("%ld"), l); }
+ { return (*this) << Format(wxT("%ld"), l); }
// insert an unsigned long into string
wxString& operator<<(unsigned long ul)
- { return (*this) << Format(_T("%lu"), ul); }
+ { return (*this) << Format(wxT("%lu"), ul); }
#if defined wxLongLong_t && !defined wxLongLongIsLong
// insert a long long if they exist and aren't longs
wxString& operator<<(wxLongLong_t ll)
{
- const wxChar *fmt = _T("%") wxLongLongFmtSpec _T("d");
+ const wxChar *fmt = wxT("%") wxLongLongFmtSpec wxT("d");
return (*this) << Format(fmt, ll);
}
// insert an unsigned long long
wxString& operator<<(wxULongLong_t ull)
{
- const wxChar *fmt = _T("%") wxLongLongFmtSpec _T("u");
+ const wxChar *fmt = wxT("%") wxLongLongFmtSpec wxT("u");
return (*this) << Format(fmt , ull);
}
#endif // wxLongLong_t && !wxLongLongIsLong
// insert a float into string
wxString& operator<<(float f)
- { return (*this) << Format(_T("%f"), f); }
+ { return (*this) << Format(wxT("%f"), f); }
// insert a double into string
wxString& operator<<(double d)
- { return (*this) << Format(_T("%g"), d); }
+ { return (*this) << Format(wxT("%g"), d); }
// string comparison
// case-sensitive comparison (returns a value < 0, = 0 or > 0)
CreateConstIterator(last).impl())
{
wxASSERT_MSG( first.m_str == last.m_str,
- _T("pointers must be into the same string") );
+ wxT("pointers must be into the same string") );
}
#endif // WXWIN_COMPATIBILITY_STRING_PTR_AS_ITER
inline wxUniChar wxCStrData::operator*() const
{
if ( m_str->empty() )
- return wxUniChar(_T('\0'));
+ return wxUniChar(wxT('\0'));
else
return (*m_str)[m_offset];
}
// implementation only
#define wxASSERT_VALID_INDEX(i) \
- wxASSERT_MSG( (size_t)(i) <= length(), _T("invalid index in wxString") )
+ wxASSERT_MSG( (size_t)(i) <= length(), wxT("invalid index in wxString") )
// ----------------------------------------------------------------------------
wxStringImpl(const wxStringImpl& stringSrc)
{
wxASSERT_MSG( stringSrc.GetStringData()->IsValid(),
- _T("did you forget to call UngetWriteBuf()?") );
+ wxT("did you forget to call UngetWriteBuf()?") );
if ( stringSrc.empty() ) {
// nothing to do for an empty string
wxStringImpl(const wxStringImpl& str, size_t nPos, size_t nLen)
{
wxASSERT_MSG( str.GetStringData()->IsValid(),
- _T("did you forget to call UngetWriteBuf()?") );
+ wxT("did you forget to call UngetWriteBuf()?") );
Init();
size_t strLen = str.length() - nPos; nLen = strLen < nLen ? strLen : nLen;
InitWith(str.c_str(), nPos, nLen);
wxControl *GetControl() const
{
- wxASSERT_MSG( IsControl(), _T("this toolbar tool is not a control") );
+ wxASSERT_MSG( IsControl(), wxT("this toolbar tool is not a control") );
return m_control;
}
int GetStyle() const { return m_toolStyle; }
wxItemKind GetKind() const
{
- wxASSERT_MSG( IsButton(), _T("only makes sense for buttons") );
+ wxASSERT_MSG( IsButton(), wxT("only makes sense for buttons") );
return m_kind;
}
wxMutexError wxMutex::Lock()
{
wxCHECK_MSG( m_internal, wxMUTEX_INVALID,
- _T("wxMutex::Lock(): not initialized") );
+ wxT("wxMutex::Lock(): not initialized") );
return m_internal->Lock();
}
wxMutexError wxMutex::LockTimeout(unsigned long ms)
{
wxCHECK_MSG( m_internal, wxMUTEX_INVALID,
- _T("wxMutex::Lock(): not initialized") );
+ wxT("wxMutex::Lock(): not initialized") );
return m_internal->Lock(ms);
}
wxMutexError wxMutex::TryLock()
{
wxCHECK_MSG( m_internal, wxMUTEX_INVALID,
- _T("wxMutex::TryLock(): not initialized") );
+ wxT("wxMutex::TryLock(): not initialized") );
return m_internal->TryLock();
}
wxMutexError wxMutex::Unlock()
{
wxCHECK_MSG( m_internal, wxMUTEX_INVALID,
- _T("wxMutex::Unlock(): not initialized") );
+ wxT("wxMutex::Unlock(): not initialized") );
return m_internal->Unlock();
}
wxCondError wxCondition::Wait()
{
wxCHECK_MSG( m_internal, wxCOND_INVALID,
- _T("wxCondition::Wait(): not initialized") );
+ wxT("wxCondition::Wait(): not initialized") );
return m_internal->Wait();
}
wxCondError wxCondition::WaitTimeout(unsigned long milliseconds)
{
wxCHECK_MSG( m_internal, wxCOND_INVALID,
- _T("wxCondition::Wait(): not initialized") );
+ wxT("wxCondition::Wait(): not initialized") );
return m_internal->WaitTimeout(milliseconds);
}
wxCondError wxCondition::Signal()
{
wxCHECK_MSG( m_internal, wxCOND_INVALID,
- _T("wxCondition::Signal(): not initialized") );
+ wxT("wxCondition::Signal(): not initialized") );
return m_internal->Signal();
}
wxCondError wxCondition::Broadcast()
{
wxCHECK_MSG( m_internal, wxCOND_INVALID,
- _T("wxCondition::Broadcast(): not initialized") );
+ wxT("wxCondition::Broadcast(): not initialized") );
return m_internal->Broadcast();
}
wxSemaError wxSemaphore::Wait()
{
wxCHECK_MSG( m_internal, wxSEMA_INVALID,
- _T("wxSemaphore::Wait(): not initialized") );
+ wxT("wxSemaphore::Wait(): not initialized") );
return m_internal->Wait();
}
wxSemaError wxSemaphore::TryWait()
{
wxCHECK_MSG( m_internal, wxSEMA_INVALID,
- _T("wxSemaphore::TryWait(): not initialized") );
+ wxT("wxSemaphore::TryWait(): not initialized") );
return m_internal->TryWait();
}
wxSemaError wxSemaphore::WaitTimeout(unsigned long milliseconds)
{
wxCHECK_MSG( m_internal, wxSEMA_INVALID,
- _T("wxSemaphore::WaitTimeout(): not initialized") );
+ wxT("wxSemaphore::WaitTimeout(): not initialized") );
return m_internal->WaitTimeout(milliseconds);
}
wxSemaError wxSemaphore::Post()
{
wxCHECK_MSG( m_internal, wxSEMA_INVALID,
- _T("wxSemaphore::Post(): not initialized") );
+ wxT("wxSemaphore::Post(): not initialized") );
return m_internal->Post();
}
// ----------------------------------------------------------------------------
// default: delimiters are usual white space characters
-#define wxDEFAULT_DELIMITERS (_T(" \t\r\n"))
+#define wxDEFAULT_DELIMITERS (wxT(" \t\r\n"))
// wxStringTokenizer mode flags which determine its behaviour
enum wxStringTokenizerMode
// the actions supported by this control
// ----------------------------------------------------------------------------
-#define wxACTION_BUTTON_TOGGLE _T("toggle") // press/release the button
-#define wxACTION_BUTTON_PRESS _T("press") // press the button
-#define wxACTION_BUTTON_RELEASE _T("release") // release the button
-#define wxACTION_BUTTON_CLICK _T("click") // generate button click event
+#define wxACTION_BUTTON_TOGGLE wxT("toggle") // press/release the button
+#define wxACTION_BUTTON_PRESS wxT("press") // press the button
+#define wxACTION_BUTTON_RELEASE wxT("release") // release the button
+#define wxACTION_BUTTON_CLICK wxT("click") // generate button click event
// ----------------------------------------------------------------------------
// wxButton: a push button
// the actions supported by wxCheckBox
// ----------------------------------------------------------------------------
-#define wxACTION_CHECKBOX_CHECK _T("check") // SetValue(true)
-#define wxACTION_CHECKBOX_CLEAR _T("clear") // SetValue(false)
-#define wxACTION_CHECKBOX_TOGGLE _T("toggle") // toggle the check state
+#define wxACTION_CHECKBOX_CHECK wxT("check") // SetValue(true)
+#define wxACTION_CHECKBOX_CLEAR wxT("clear") // SetValue(false)
+#define wxACTION_CHECKBOX_TOGGLE wxT("toggle") // toggle the check state
// additionally it accepts wxACTION_BUTTON_PRESS and RELEASE
// actions
// ----------------------------------------------------------------------------
-#define wxACTION_CHECKLISTBOX_TOGGLE _T("toggle")
+#define wxACTION_CHECKLISTBOX_TOGGLE wxT("toggle")
// ----------------------------------------------------------------------------
// wxCheckListBox
// ----------------------------------------------------------------------------
// choose the next/prev/specified (by numArg) item
-#define wxACTION_COMBOBOX_SELECT_NEXT _T("next")
-#define wxACTION_COMBOBOX_SELECT_PREV _T("prev")
-#define wxACTION_COMBOBOX_SELECT _T("select")
+#define wxACTION_COMBOBOX_SELECT_NEXT wxT("next")
+#define wxACTION_COMBOBOX_SELECT_PREV wxT("prev")
+#define wxACTION_COMBOBOX_SELECT wxT("select")
// ----------------------------------------------------------------------------
// the list of actions which apply to all controls (other actions are defined
// in the controls headers)
-#define wxACTION_NONE _T("") // no action to perform
+#define wxACTION_NONE wxT("") // no action to perform
// ----------------------------------------------------------------------------
// wxControl: the base class for all GUI controls
// return the accel char itself or 0 if none
wxChar GetAccelChar() const
{
- return m_indexAccel == -1 ? _T('\0') : (wxChar)m_label[m_indexAccel];
+ return m_indexAccel == -1 ? wxT('\0') : (wxChar)m_label[m_indexAccel];
}
virtual wxWindow *GetInputWindow() const { return (wxWindow*)this; }
// the list of actions which apply to all controls (other actions are defined
// in the controls headers)
-#define wxACTION_NONE _T("") // no action to perform
+#define wxACTION_NONE wxT("") // no action to perform
// ----------------------------------------------------------------------------
// wxInputConsumer: mix-in class for handling wxControlActions (used by
// wxTheme::GetInputHandler()
// ----------------------------------------------------------------------------
-#define wxINP_HANDLER_DEFAULT _T("")
-#define wxINP_HANDLER_BUTTON _T("button")
-#define wxINP_HANDLER_CHECKBOX _T("checkbox")
-#define wxINP_HANDLER_CHECKLISTBOX _T("checklistbox")
-#define wxINP_HANDLER_COMBOBOX _T("combobox")
-#define wxINP_HANDLER_LISTBOX _T("listbox")
-#define wxINP_HANDLER_NOTEBOOK _T("notebook")
-#define wxINP_HANDLER_RADIOBTN _T("radiobtn")
-#define wxINP_HANDLER_SCROLLBAR _T("scrollbar")
-#define wxINP_HANDLER_SLIDER _T("slider")
-#define wxINP_HANDLER_SPINBTN _T("spinbtn")
-#define wxINP_HANDLER_STATUSBAR _T("statusbar")
-#define wxINP_HANDLER_TEXTCTRL _T("textctrl")
-#define wxINP_HANDLER_TOOLBAR _T("toolbar")
-#define wxINP_HANDLER_TOPLEVEL _T("toplevel")
+#define wxINP_HANDLER_DEFAULT wxT("")
+#define wxINP_HANDLER_BUTTON wxT("button")
+#define wxINP_HANDLER_CHECKBOX wxT("checkbox")
+#define wxINP_HANDLER_CHECKLISTBOX wxT("checklistbox")
+#define wxINP_HANDLER_COMBOBOX wxT("combobox")
+#define wxINP_HANDLER_LISTBOX wxT("listbox")
+#define wxINP_HANDLER_NOTEBOOK wxT("notebook")
+#define wxINP_HANDLER_RADIOBTN wxT("radiobtn")
+#define wxINP_HANDLER_SCROLLBAR wxT("scrollbar")
+#define wxINP_HANDLER_SLIDER wxT("slider")
+#define wxINP_HANDLER_SPINBTN wxT("spinbtn")
+#define wxINP_HANDLER_STATUSBAR wxT("statusbar")
+#define wxINP_HANDLER_TEXTCTRL wxT("textctrl")
+#define wxINP_HANDLER_TOOLBAR wxT("toolbar")
+#define wxINP_HANDLER_TOPLEVEL wxT("toplevel")
// ----------------------------------------------------------------------------
// wxInputHandler: maps the events to the actions
// ----------------------------------------------------------------------------
// change the current item
-#define wxACTION_LISTBOX_SETFOCUS _T("setfocus") // select the item
-#define wxACTION_LISTBOX_MOVEDOWN _T("down") // select item below
-#define wxACTION_LISTBOX_MOVEUP _T("up") // select item above
-#define wxACTION_LISTBOX_PAGEDOWN _T("pagedown") // go page down
-#define wxACTION_LISTBOX_PAGEUP _T("pageup") // go page up
-#define wxACTION_LISTBOX_START _T("start") // go to first item
-#define wxACTION_LISTBOX_END _T("end") // go to last item
-#define wxACTION_LISTBOX_FIND _T("find") // find item by 1st letter
+#define wxACTION_LISTBOX_SETFOCUS wxT("setfocus") // select the item
+#define wxACTION_LISTBOX_MOVEDOWN wxT("down") // select item below
+#define wxACTION_LISTBOX_MOVEUP wxT("up") // select item above
+#define wxACTION_LISTBOX_PAGEDOWN wxT("pagedown") // go page down
+#define wxACTION_LISTBOX_PAGEUP wxT("pageup") // go page up
+#define wxACTION_LISTBOX_START wxT("start") // go to first item
+#define wxACTION_LISTBOX_END wxT("end") // go to last item
+#define wxACTION_LISTBOX_FIND wxT("find") // find item by 1st letter
// do something with the current item
-#define wxACTION_LISTBOX_ACTIVATE _T("activate") // activate (choose)
-#define wxACTION_LISTBOX_TOGGLE _T("toggle") // togglee selected state
-#define wxACTION_LISTBOX_SELECT _T("select") // sel this, unsel others
-#define wxACTION_LISTBOX_SELECTADD _T("selectadd") // add to selection
-#define wxACTION_LISTBOX_UNSELECT _T("unselect") // unselect
-#define wxACTION_LISTBOX_ANCHOR _T("selanchor") // anchor selection
+#define wxACTION_LISTBOX_ACTIVATE wxT("activate") // activate (choose)
+#define wxACTION_LISTBOX_TOGGLE wxT("toggle") // togglee selected state
+#define wxACTION_LISTBOX_SELECT wxT("select") // sel this, unsel others
+#define wxACTION_LISTBOX_SELECTADD wxT("selectadd") // add to selection
+#define wxACTION_LISTBOX_UNSELECT wxT("unselect") // unselect
+#define wxACTION_LISTBOX_ANCHOR wxT("selanchor") // anchor selection
// do something with the selection globally (not for single selection ones)
-#define wxACTION_LISTBOX_SELECTALL _T("selectall") // select all items
-#define wxACTION_LISTBOX_UNSELECTALL _T("unselectall") // unselect all items
-#define wxACTION_LISTBOX_SELTOGGLE _T("togglesel") // invert the selection
-#define wxACTION_LISTBOX_EXTENDSEL _T("extend") // extend to item
+#define wxACTION_LISTBOX_SELECTALL wxT("selectall") // select all items
+#define wxACTION_LISTBOX_UNSELECTALL wxT("unselectall") // unselect all items
+#define wxACTION_LISTBOX_SELTOGGLE wxT("togglesel") // invert the selection
+#define wxACTION_LISTBOX_EXTENDSEL wxT("extend") // extend to item
// ----------------------------------------------------------------------------
// wxListBox: a list of selectable items
wxCoord GetPosition() const
{
- wxASSERT_MSG( m_posY != wxDefaultCoord, _T("must call SetHeight first!") );
+ wxASSERT_MSG( m_posY != wxDefaultCoord, wxT("must call SetHeight first!") );
return m_posY;
}
wxCoord GetHeight() const
{
- wxASSERT_MSG( m_height != wxDefaultCoord, _T("must call SetHeight first!") );
+ wxASSERT_MSG( m_height != wxDefaultCoord, wxT("must call SetHeight first!") );
return m_height;
}
// ----------------------------------------------------------------------------
// change the page: to the next/previous/given one
-#define wxACTION_NOTEBOOK_NEXT _T("nexttab")
-#define wxACTION_NOTEBOOK_PREV _T("prevtab")
-#define wxACTION_NOTEBOOK_GOTO _T("gototab")
+#define wxACTION_NOTEBOOK_NEXT wxT("nexttab")
+#define wxACTION_NOTEBOOK_PREV wxT("prevtab")
+#define wxACTION_NOTEBOOK_GOTO wxT("gototab")
// ----------------------------------------------------------------------------
// wxNotebook
// ----------------------------------------------------------------------------
// scroll the bar
-#define wxACTION_SCROLL_START _T("start") // to the beginning
-#define wxACTION_SCROLL_END _T("end") // to the end
-#define wxACTION_SCROLL_LINE_UP _T("lineup") // one line up/left
-#define wxACTION_SCROLL_PAGE_UP _T("pageup") // one page up/left
-#define wxACTION_SCROLL_LINE_DOWN _T("linedown") // one line down/right
-#define wxACTION_SCROLL_PAGE_DOWN _T("pagedown") // one page down/right
+#define wxACTION_SCROLL_START wxT("start") // to the beginning
+#define wxACTION_SCROLL_END wxT("end") // to the end
+#define wxACTION_SCROLL_LINE_UP wxT("lineup") // one line up/left
+#define wxACTION_SCROLL_PAGE_UP wxT("pageup") // one page up/left
+#define wxACTION_SCROLL_LINE_DOWN wxT("linedown") // one line down/right
+#define wxACTION_SCROLL_PAGE_DOWN wxT("pagedown") // one page down/right
// the scrollbar thumb may be dragged
-#define wxACTION_SCROLL_THUMB_DRAG _T("thumbdrag")
-#define wxACTION_SCROLL_THUMB_MOVE _T("thumbmove")
-#define wxACTION_SCROLL_THUMB_RELEASE _T("thumbrelease")
+#define wxACTION_SCROLL_THUMB_DRAG wxT("thumbdrag")
+#define wxACTION_SCROLL_THUMB_MOVE wxT("thumbmove")
+#define wxACTION_SCROLL_THUMB_RELEASE wxT("thumbrelease")
// ----------------------------------------------------------------------------
// wxScrollBar
// our actions are the same as scrollbars
-#define wxACTION_SLIDER_START _T("start") // to the beginning
-#define wxACTION_SLIDER_END _T("end") // to the end
-#define wxACTION_SLIDER_LINE_UP _T("lineup") // one line up/left
-#define wxACTION_SLIDER_PAGE_UP _T("pageup") // one page up/left
-#define wxACTION_SLIDER_LINE_DOWN _T("linedown") // one line down/right
-#define wxACTION_SLIDER_PAGE_DOWN _T("pagedown") // one page down/right
-#define wxACTION_SLIDER_PAGE_CHANGE _T("pagechange")// change page by numArg
-
-#define wxACTION_SLIDER_THUMB_DRAG _T("thumbdrag")
-#define wxACTION_SLIDER_THUMB_MOVE _T("thumbmove")
-#define wxACTION_SLIDER_THUMB_RELEASE _T("thumbrelease")
+#define wxACTION_SLIDER_START wxT("start") // to the beginning
+#define wxACTION_SLIDER_END wxT("end") // to the end
+#define wxACTION_SLIDER_LINE_UP wxT("lineup") // one line up/left
+#define wxACTION_SLIDER_PAGE_UP wxT("pageup") // one page up/left
+#define wxACTION_SLIDER_LINE_DOWN wxT("linedown") // one line down/right
+#define wxACTION_SLIDER_PAGE_DOWN wxT("pagedown") // one page down/right
+#define wxACTION_SLIDER_PAGE_CHANGE wxT("pagechange")// change page by numArg
+
+#define wxACTION_SLIDER_THUMB_DRAG wxT("thumbdrag")
+#define wxACTION_SLIDER_THUMB_MOVE wxT("thumbmove")
+#define wxACTION_SLIDER_THUMB_RELEASE wxT("thumbrelease")
// ----------------------------------------------------------------------------
// wxSlider
// ----------------------------------------------------------------------------
// actions supported by this control
-#define wxACTION_SPIN_INC _T("inc")
-#define wxACTION_SPIN_DEC _T("dec")
+#define wxACTION_SPIN_INC wxT("inc")
+#define wxACTION_SPIN_DEC wxT("dec")
class WXDLLIMPEXP_CORE wxSpinButton : public wxSpinButtonBase,
public wxControlWithArrows
// ----------------------------------------------------------------------------
// cursor movement and also selection and delete operations
-#define wxACTION_TEXT_GOTO _T("goto") // to pos in numArg
-#define wxACTION_TEXT_FIRST _T("first") // go to pos 0
-#define wxACTION_TEXT_LAST _T("last") // go to last pos
-#define wxACTION_TEXT_HOME _T("home")
-#define wxACTION_TEXT_END _T("end")
-#define wxACTION_TEXT_LEFT _T("left")
-#define wxACTION_TEXT_RIGHT _T("right")
-#define wxACTION_TEXT_UP _T("up")
-#define wxACTION_TEXT_DOWN _T("down")
-#define wxACTION_TEXT_WORD_LEFT _T("wordleft")
-#define wxACTION_TEXT_WORD_RIGHT _T("wordright")
-#define wxACTION_TEXT_PAGE_UP _T("pageup")
-#define wxACTION_TEXT_PAGE_DOWN _T("pagedown")
+#define wxACTION_TEXT_GOTO wxT("goto") // to pos in numArg
+#define wxACTION_TEXT_FIRST wxT("first") // go to pos 0
+#define wxACTION_TEXT_LAST wxT("last") // go to last pos
+#define wxACTION_TEXT_HOME wxT("home")
+#define wxACTION_TEXT_END wxT("end")
+#define wxACTION_TEXT_LEFT wxT("left")
+#define wxACTION_TEXT_RIGHT wxT("right")
+#define wxACTION_TEXT_UP wxT("up")
+#define wxACTION_TEXT_DOWN wxT("down")
+#define wxACTION_TEXT_WORD_LEFT wxT("wordleft")
+#define wxACTION_TEXT_WORD_RIGHT wxT("wordright")
+#define wxACTION_TEXT_PAGE_UP wxT("pageup")
+#define wxACTION_TEXT_PAGE_DOWN wxT("pagedown")
// clipboard operations
-#define wxACTION_TEXT_COPY _T("copy")
-#define wxACTION_TEXT_CUT _T("cut")
-#define wxACTION_TEXT_PASTE _T("paste")
+#define wxACTION_TEXT_COPY wxT("copy")
+#define wxACTION_TEXT_CUT wxT("cut")
+#define wxACTION_TEXT_PASTE wxT("paste")
// insert text at the cursor position: the text is in strArg of PerformAction
-#define wxACTION_TEXT_INSERT _T("insert")
+#define wxACTION_TEXT_INSERT wxT("insert")
// if the action starts with either of these prefixes and the rest of the
// string is one of the movement commands, it means to select/delete text from
// the current cursor position to the new one
-#define wxACTION_TEXT_PREFIX_SEL _T("sel")
-#define wxACTION_TEXT_PREFIX_DEL _T("del")
+#define wxACTION_TEXT_PREFIX_SEL wxT("sel")
+#define wxACTION_TEXT_PREFIX_DEL wxT("del")
// mouse selection
-#define wxACTION_TEXT_ANCHOR_SEL _T("anchorsel")
-#define wxACTION_TEXT_EXTEND_SEL _T("extendsel")
-#define wxACTION_TEXT_SEL_WORD _T("wordsel")
-#define wxACTION_TEXT_SEL_LINE _T("linesel")
+#define wxACTION_TEXT_ANCHOR_SEL wxT("anchorsel")
+#define wxACTION_TEXT_EXTEND_SEL wxT("extendsel")
+#define wxACTION_TEXT_SEL_WORD wxT("wordsel")
+#define wxACTION_TEXT_SEL_LINE wxT("linesel")
// undo or redo
-#define wxACTION_TEXT_UNDO _T("undo")
-#define wxACTION_TEXT_REDO _T("redo")
+#define wxACTION_TEXT_UNDO wxT("undo")
+#define wxACTION_TEXT_REDO wxT("redo")
// ----------------------------------------------------------------------------
// wxTextCtrl
wxCoord GetLineHeight() const
{
// this one should be already precalculated
- wxASSERT_MSG( m_heightLine != -1, _T("should have line height") );
+ wxASSERT_MSG( m_heightLine != -1, wxT("should have line height") );
return m_heightLine;
}
#define wxACTION_TOOLBAR_PRESS wxACTION_BUTTON_PRESS
#define wxACTION_TOOLBAR_RELEASE wxACTION_BUTTON_RELEASE
#define wxACTION_TOOLBAR_CLICK wxACTION_BUTTON_CLICK
-#define wxACTION_TOOLBAR_ENTER _T("enter") // highlight the tool
-#define wxACTION_TOOLBAR_LEAVE _T("leave") // unhighlight the tool
+#define wxACTION_TOOLBAR_ENTER wxT("enter") // highlight the tool
+#define wxACTION_TOOLBAR_LEAVE wxT("leave") // unhighlight the tool
// ----------------------------------------------------------------------------
// wxToolBar
// the actions supported by this control
// ----------------------------------------------------------------------------
-#define wxACTION_TOPLEVEL_ACTIVATE _T("activate") // (de)activate the frame
-#define wxACTION_TOPLEVEL_BUTTON_PRESS _T("pressbtn") // press titlebar btn
-#define wxACTION_TOPLEVEL_BUTTON_RELEASE _T("releasebtn") // press titlebar btn
-#define wxACTION_TOPLEVEL_BUTTON_CLICK _T("clickbtn") // press titlebar btn
-#define wxACTION_TOPLEVEL_MOVE _T("move") // move the frame
-#define wxACTION_TOPLEVEL_RESIZE _T("resize") // resize the frame
+#define wxACTION_TOPLEVEL_ACTIVATE wxT("activate") // (de)activate the frame
+#define wxACTION_TOPLEVEL_BUTTON_PRESS wxT("pressbtn") // press titlebar btn
+#define wxACTION_TOPLEVEL_BUTTON_RELEASE wxT("releasebtn") // press titlebar btn
+#define wxACTION_TOPLEVEL_BUTTON_CLICK wxT("clickbtn") // press titlebar btn
+#define wxACTION_TOPLEVEL_MOVE wxT("move") // move the frame
+#define wxACTION_TOPLEVEL_RESIZE wxT("resize") // resize the frame
//-----------------------------------------------------------------------------
// wxTopLevelWindow
// timer is running
void MarkStopped()
{
- wxASSERT_MSG( m_isRunning, _T("stopping non-running timer?") );
+ wxASSERT_MSG( m_isRunning, wxT("stopping non-running timer?") );
m_isRunning = false;
}
#define wxMINOR_VERSION 9
#define wxRELEASE_NUMBER 1
#define wxSUBRELEASE_NUMBER 0
-#define wxVERSION_STRING _T("wxWidgets 2.9.1")
+#define wxVERSION_STRING wxT("wxWidgets 2.9.1")
/* nothing to update below this line when updating the version */
/* ---------------------------------------------------------------------------- */
#define wxMAKE_VERSION_STRING_T(x, y, z) \
wxSTRINGIZE_T(x) wxSTRINGIZE_T(y) wxSTRINGIZE_T(z)
#define wxMAKE_VERSION_DOT_STRING_T(x, y, z) \
- wxSTRINGIZE_T(x) _T(".") wxSTRINGIZE_T(y) _T(".") wxSTRINGIZE_T(z)
+ wxSTRINGIZE_T(x) wxT(".") wxSTRINGIZE_T(y) wxT(".") wxSTRINGIZE_T(z)
/* these are used by src/msw/version.rc and should always be ASCII, not Unicode */
#define wxVERSION_NUM_STRING \
int GetSelection() const
{
wxASSERT_MSG( !HasMultipleSelection(),
- _T("GetSelection() can't be used with wxLB_MULTIPLE") );
+ wxT("GetSelection() can't be used with wxLB_MULTIPLE") );
return m_current;
}
#ifdef _WIN32_WCE
#if _WIN32_WCE <= 211
- #define isspace(c) ((c) == _T(' ') || (c) == _T('\t'))
+ #define isspace(c) ((c) == wxT(' ') || (c) == wxT('\t'))
#endif
#endif /* _WIN32_WCE */
//-----------------------------------------------------------------------------
// cursor movement and also selection and delete operations
-#define wxACTION_TEXT_GOTO _T("goto") // to pos in numArg
-#define wxACTION_TEXT_FIRST _T("first") // go to pos 0
-#define wxACTION_TEXT_LAST _T("last") // go to last pos
-#define wxACTION_TEXT_HOME _T("home")
-#define wxACTION_TEXT_END _T("end")
-#define wxACTION_TEXT_LEFT _T("left")
-#define wxACTION_TEXT_RIGHT _T("right")
-#define wxACTION_TEXT_UP _T("up")
-#define wxACTION_TEXT_DOWN _T("down")
-#define wxACTION_TEXT_WORD_LEFT _T("wordleft")
-#define wxACTION_TEXT_WORD_RIGHT _T("wordright")
-#define wxACTION_TEXT_PAGE_UP _T("pageup")
-#define wxACTION_TEXT_PAGE_DOWN _T("pagedown")
+#define wxACTION_TEXT_GOTO wxT("goto") // to pos in numArg
+#define wxACTION_TEXT_FIRST wxT("first") // go to pos 0
+#define wxACTION_TEXT_LAST wxT("last") // go to last pos
+#define wxACTION_TEXT_HOME wxT("home")
+#define wxACTION_TEXT_END wxT("end")
+#define wxACTION_TEXT_LEFT wxT("left")
+#define wxACTION_TEXT_RIGHT wxT("right")
+#define wxACTION_TEXT_UP wxT("up")
+#define wxACTION_TEXT_DOWN wxT("down")
+#define wxACTION_TEXT_WORD_LEFT wxT("wordleft")
+#define wxACTION_TEXT_WORD_RIGHT wxT("wordright")
+#define wxACTION_TEXT_PAGE_UP wxT("pageup")
+#define wxACTION_TEXT_PAGE_DOWN wxT("pagedown")
// clipboard operations
-#define wxACTION_TEXT_COPY _T("copy")
-#define wxACTION_TEXT_CUT _T("cut")
-#define wxACTION_TEXT_PASTE _T("paste")
+#define wxACTION_TEXT_COPY wxT("copy")
+#define wxACTION_TEXT_CUT wxT("cut")
+#define wxACTION_TEXT_PASTE wxT("paste")
// insert text at the cursor position: the text is in strArg of PerformAction
-#define wxACTION_TEXT_INSERT _T("insert")
+#define wxACTION_TEXT_INSERT wxT("insert")
// if the action starts with either of these prefixes and the rest of the
// string is one of the movement commands, it means to select/delete text from
// the current cursor position to the new one
-#define wxACTION_TEXT_PREFIX_SEL _T("sel")
-#define wxACTION_TEXT_PREFIX_DEL _T("del")
+#define wxACTION_TEXT_PREFIX_SEL wxT("sel")
+#define wxACTION_TEXT_PREFIX_DEL wxT("del")
// mouse selection
-#define wxACTION_TEXT_ANCHOR_SEL _T("anchorsel")
-#define wxACTION_TEXT_EXTEND_SEL _T("extendsel")
-#define wxACTION_TEXT_SEL_WORD _T("wordsel")
-#define wxACTION_TEXT_SEL_LINE _T("linesel")
+#define wxACTION_TEXT_ANCHOR_SEL wxT("anchorsel")
+#define wxACTION_TEXT_EXTEND_SEL wxT("extendsel")
+#define wxACTION_TEXT_SEL_WORD wxT("wordsel")
+#define wxACTION_TEXT_SEL_LINE wxT("linesel")
// undo or redo
-#define wxACTION_TEXT_UNDO _T("undo")
-#define wxACTION_TEXT_REDO _T("redo")
+#define wxACTION_TEXT_UNDO wxT("undo")
+#define wxACTION_TEXT_REDO wxT("redo")
// ----------------------------------------------------------------------------
// wxTextCtrl types
#define WX_XMLRES_CURRENT_VERSION_MINOR 5
#define WX_XMLRES_CURRENT_VERSION_RELEASE 3
#define WX_XMLRES_CURRENT_VERSION_REVISION 0
-#define WX_XMLRES_CURRENT_VERSION_STRING _T("2.5.3.0")
+#define WX_XMLRES_CURRENT_VERSION_STRING wxT("2.5.3.0")
#define WX_XMLRES_CURRENT_VERSION \
(WX_XMLRES_CURRENT_VERSION_MAJOR * 256*256*256 + \
// convert a wxxVariant holding data of this type into a string
void ConvertToString( const wxxVariant& data , wxString &result ) const
- { if ( m_toString ) (*m_toString)( data , result ) ; else wxLogError( wxGetTranslation(_T("String conversions not supported")) ) ; }
+ { if ( m_toString ) (*m_toString)( data , result ) ; else wxLogError( wxGetTranslation(wxT("String conversions not supported")) ) ; }
// convert a string into a wxxVariant holding the corresponding data in this type
void ConvertFromString( const wxString& data , wxxVariant &result ) const
- { if( m_fromString ) (*m_fromString)( data , result ) ; else wxLogError( wxGetTranslation(_T("String conversions not supported")) ) ; }
+ { if( m_fromString ) (*m_fromString)( data , result ) ; else wxLogError( wxGetTranslation(wxT("String conversions not supported")) ) ; }
#if wxUSE_UNICODE
static wxTypeInfo *FindType(const char *typeName) { return FindType( wxString::FromAscii(typeName) ) ; }
// convert a wxxVariant holding data of this type into a long
void ConvertToLong( const wxxVariant& data , long &result ) const
- { if( m_toLong ) (*m_toLong)( data , result ) ; else wxLogError( wxGetTranslation(_T("Long Conversions not supported")) ) ; }
+ { if( m_toLong ) (*m_toLong)( data , result ) ; else wxLogError( wxGetTranslation(wxT("Long Conversions not supported")) ) ; }
// convert a long into a wxxVariant holding the corresponding data in this type
void ConvertFromLong( long data , wxxVariant &result ) const
- { if( m_fromLong ) (*m_fromLong)( data , result ) ; else wxLogError( wxGetTranslation(_T("Long Conversions not supported")) ) ;}
+ { if( m_fromLong ) (*m_fromLong)( data , result ) ; else wxLogError( wxGetTranslation(wxT("Long Conversions not supported")) ) ;}
private :
converterToLong_t m_toLong ;
// Setting a simple property (non-collection)
virtual void SetProperty(wxObject *object, const wxxVariant &value) const
- { if ( m_setter ) m_setter->Set( object , value ) ; else wxLogError( wxGetTranslation(_T("SetProperty called w/o valid setter")) ) ;}
+ { if ( m_setter ) m_setter->Set( object , value ) ; else wxLogError( wxGetTranslation(wxT("SetProperty called w/o valid setter")) ) ;}
// Getting a simple property (non-collection)
virtual void GetProperty(const wxObject *object, wxxVariant &result) const
- { if ( m_getter ) m_getter->Get( object , result ) ; else wxLogError( wxGetTranslation(_T("GetProperty called w/o valid getter")) ) ;}
+ { if ( m_getter ) m_getter->Get( object , result ) ; else wxLogError( wxGetTranslation(wxT("GetProperty called w/o valid getter")) ) ;}
// Adding an element to a collection property
virtual void AddToPropertyCollection(wxObject *object, const wxxVariant &value) const
- { if ( m_adder ) m_adder->Add( object , value ) ; else wxLogError( wxGetTranslation(_T("AddToPropertyCollection called w/o valid adder")) ) ;}
+ { if ( m_adder ) m_adder->Add( object , value ) ; else wxLogError( wxGetTranslation(wxT("AddToPropertyCollection called w/o valid adder")) ) ;}
// Getting a collection property
virtual void GetPropertyCollection( const wxObject *obj, wxxVariantArray &result) const
- { if ( m_collectionGetter ) m_collectionGetter->Get( obj , result) ; else wxLogError( wxGetTranslation(_T("GetPropertyCollection called w/o valid collection getter")) ) ;}
+ { if ( m_collectionGetter ) m_collectionGetter->Get( obj , result) ; else wxLogError( wxGetTranslation(wxT("GetPropertyCollection called w/o valid collection getter")) ) ;}
virtual bool HasSetter() const { return m_setter != NULL ; }
virtual bool HasCollectionGetter() const { return m_collectionGetter != NULL ; }
// Adding an element to a collection property
virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), const wxxVariant &WXUNUSED(value)) const
- { wxLogError( wxGetTranslation(_T("AddToPropertyCollection called on a generic accessor")) ) ;}
+ { wxLogError( wxGetTranslation(wxT("AddToPropertyCollection called on a generic accessor")) ) ;}
// Getting a collection property
virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), wxxVariantArray &WXUNUSED(result)) const
- { wxLogError ( wxGetTranslation(_T("GetPropertyCollection called on a generic accessor")) ) ;}
+ { wxLogError ( wxGetTranslation(wxT("GetPropertyCollection called on a generic accessor")) ) ;}
private :
struct wxGenericPropertyAccessorInternal ;
wxGenericPropertyAccessorInternal* m_data ;
{
if ( ParamCount != m_constructorPropertiesCount )
{
- wxLogError( wxGetTranslation(_T("Illegal Parameter Count for ConstructObject Method")) ) ;
+ wxLogError( wxGetTranslation(wxT("Illegal Parameter Count for ConstructObject Method")) ) ;
return NULL ;
}
wxObject *object = NULL ;
{
if ( ParamCount != m_constructorPropertiesCount )
{
- wxLogError( wxGetTranslation(_T("Illegal Parameter Count for Create Method")) ) ;
+ wxLogError( wxGetTranslation(wxT("Illegal Parameter Count for Create Method")) ) ;
return ;
}
m_constructor->Create( object , Params ) ;
info.SetName(_("My Program"));
info.SetVersion(_("1.2.3 Beta"));
info.SetDescription(_("This program does something great."));
- info.SetCopyright(_T("(C) 2007 Me <my@email.addre.ss>"));
+ info.SetCopyright(wxT("(C) 2007 Me <my@email.addre.ss>"));
wxAboutBox(info);
}
const wxArchiveClassFactory *factory = wxArchiveClassFactory::GetFirst();
while (factory) {
- list << factory->GetProtocol() << _T("\n");
+ list << factory->GetProtocol() << wxT("\n");
factory = factory->GetNext();
}
@endcode
const wxChar *const *p;
for (p = factory->GetProtocols(wxSTREAM_FILEEXT); *p; p++)
- list << *p << _T("\n");
+ list << *p << wxT("\n");
@endcode
*/
virtual const wxChar** GetProtocols(wxStreamProtocolType type = wxSTREAM_PROTOCOL) const = 0;
Don't confuse this macro with _()!
- Note that since wxWidgets 2.9.0 the use of _T() is discouraged just like for wxT().
+ Note that since wxWidgets 2.9.0 the use of _T() is discouraged just like
+ for wxT() and also that this macro may conflict with identifiers defined in
+ standard headers of some compilers (such as Sun CC) so its use should
+ really be avoided.
@header{wx/chartype.h}
*/
long style = wxSP_ARROW_KEYS,
double min = 0, double max = 100,
double initial = 0, double inc = 1,
- const wxString& name = _T("wxSpinCtrlDouble"));
+ const wxString& name = wxT("wxSpinCtrlDouble"));
/**
Creation function called by the spin control constructor.
m_embeddedHtmlHelp.SetHelpWindow(m_embeddedHelpWindow);
m_embeddedHelpWindow->Create(this, wxID_ANY, wxDefaultPosition, GetClientSize(),
wxTAB_TRAVERSAL|wxBORDER_NONE, wxHF_DEFAULT_STYLE);
- m_embeddedHtmlHelp.AddBook(wxFileName(_T("doc.zip")));
+ m_embeddedHtmlHelp.AddBook(wxFileName(wxT("doc.zip")));
@endcode
You should pass the style wxHF_EMBEDDED to the style parameter of
const wxFilterClassFactory *factory = wxFilterClassFactory::GetFirst();
while (factory) {
- list << factory->GetProtocol() << _T("\n");
+ list << factory->GetProtocol() << wxT("\n");
factory = factory->GetNext();
}
@endcode
const wxChar *const *p;
for (p = factory->GetProtocols(wxSTREAM_FILEEXT); *p; p++)
- list << *p << _T("\n");
+ list << *p << wxT("\n");
@endcode
*/
virtual const wxChar * const* GetProtocols(wxStreamProtocolType type = wxSTREAM_PROTOCOL) const = 0;
wxHelpProvider::Set(new wxSimpleHelpProvider());
// create the main application window
- MyFrame *frame = new MyFrame(_T("AccessTest wxWidgets App"),
+ MyFrame *frame = new MyFrame(wxT("AccessTest wxWidgets App"),
wxPoint(50, 50), wxSize(450, 340));
// and show it (the frames, unlike simple controls, are not shown when
// application would exit immediately.
return true;
#else
- wxMessageBox( _T("This sample has to be compiled with wxUSE_ACCESSIBILITY"), _T("Building error"), wxOK);
+ wxMessageBox( wxT("This sample has to be compiled with wxUSE_ACCESSIBILITY"), wxT("Building error"), wxOK);
return false;
#endif // wxUSE_ACCESSIBILITY
}
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(AccessTest_About, _T("&About..."), _T("Show about dialog"));
+ helpMenu->Append(AccessTest_About, wxT("&About..."), wxT("Show about dialog"));
- menuFile->Append(AccessTest_Query, _T("Query"), _T("Query the window hierarchy"));
+ menuFile->Append(AccessTest_Query, wxT("Query"), wxT("Query the window hierarchy"));
menuFile->AppendSeparator();
- menuFile->Append(AccessTest_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(AccessTest_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if 0 // wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWidgets!"));
+ SetStatusText(wxT("Welcome to wxWidgets!"));
#endif // wxUSE_STATUSBAR
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
- msg.Printf( _T("This is the About dialog of the AccessTest sample.\n")
- _T("Welcome to %s"), wxVERSION_STRING);
+ msg.Printf( wxT("This is the About dialog of the AccessTest sample.\n")
+ wxT("Welcome to %s"), wxVERSION_STRING);
- wxMessageBox(msg, _T("About AccessTest"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, wxT("About AccessTest"), wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnQuery(wxCommandEvent& WXUNUSED(event))
// Create the main frame window
- MyFrame* frame = new MyFrame((wxFrame *)NULL, wxID_ANY, _T("Animation Demo"),
+ MyFrame* frame = new MyFrame((wxFrame *)NULL, wxID_ANY, wxT("Animation Demo"),
wxDefaultPosition, wxSize(500, 400),
wxDEFAULT_FRAME_STYLE);
frame->Show(true);
wxMenu *file_menu = new wxMenu;
#if wxUSE_FILEDLG
- file_menu->Append(wxID_OPEN, _T("&Open Animation...\tCtrl+O"), _T("Loads an animation"));
+ file_menu->Append(wxID_OPEN, wxT("&Open Animation...\tCtrl+O"), wxT("Loads an animation"));
#endif // wxUSE_FILEDLG
file_menu->Append(wxID_EXIT);
wxMenu *play_menu = new wxMenu;
- play_menu->Append(ID_PLAY, _T("Play\tCtrl+P"), _T("Play the animation"));
- play_menu->Append(wxID_STOP, _T("Stop\tCtrl+P"), _T("Stop the animation"));
+ play_menu->Append(ID_PLAY, wxT("Play\tCtrl+P"), wxT("Play the animation"));
+ play_menu->Append(wxID_STOP, wxT("Stop\tCtrl+P"), wxT("Stop the animation"));
play_menu->AppendSeparator();
- play_menu->Append(ID_SET_NULL_ANIMATION, _T("Set null animation"),
- _T("Sets the empty animation in the control"));
- play_menu->AppendCheckItem(ID_SET_INACTIVE_BITMAP, _T("Set inactive bitmap"),
- _T("Sets an inactive bitmap for the control"));
- play_menu->AppendCheckItem(ID_SET_NO_AUTO_RESIZE, _T("Set no autoresize"),
- _T("Tells the control not to resize automatically"));
- play_menu->Append(ID_SET_BGCOLOR, _T("Set background colour..."),
- _T("Sets the background colour of the control"));
+ play_menu->Append(ID_SET_NULL_ANIMATION, wxT("Set null animation"),
+ wxT("Sets the empty animation in the control"));
+ play_menu->AppendCheckItem(ID_SET_INACTIVE_BITMAP, wxT("Set inactive bitmap"),
+ wxT("Sets an inactive bitmap for the control"));
+ play_menu->AppendCheckItem(ID_SET_NO_AUTO_RESIZE, wxT("Set no autoresize"),
+ wxT("Tells the control not to resize automatically"));
+ play_menu->Append(ID_SET_BGCOLOR, wxT("Set background colour..."),
+ wxT("Sets the background colour of the control"));
wxMenu *help_menu = new wxMenu;
help_menu->Append(wxID_ABOUT);
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
- menu_bar->Append(play_menu, _T("&Animation"));
- menu_bar->Append(help_menu, _T("&Help"));
+ menu_bar->Append(file_menu, wxT("&File"));
+ menu_bar->Append(play_menu, wxT("&Animation"));
+ menu_bar->Append(help_menu, wxT("&Help"));
// Associate the menu bar with this frame
SetMenuBar(menu_bar);
wxAboutDialogInfo info;
info.SetName(_("wxAnimationCtrl and wxAnimation sample"));
info.SetDescription(_("This sample program demonstrates the usage of wxAnimationCtrl"));
- info.SetCopyright(_T("(C) 2006 Julian Smart"));
+ info.SetCopyright(wxT("(C) 2006 Julian Smart"));
- info.AddDeveloper(_T("Julian Smart"));
- info.AddDeveloper(_T("Guillermo Rodriguez Garcia"));
- info.AddDeveloper(_T("Francesco Montorsi"));
+ info.AddDeveloper(wxT("Julian Smart"));
+ info.AddDeveloper(wxT("Guillermo Rodriguez Garcia"));
+ info.AddDeveloper(wxT("Francesco Montorsi"));
wxAboutBox(info);
}
#if wxUSE_FILEDLG
void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
{
- wxFileDialog dialog(this, _T("Please choose an animation"),
+ wxFileDialog dialog(this, wxT("Please choose an animation"),
wxEmptyString, wxEmptyString, wxT("*.gif;*.ani"), wxFD_OPEN);
if (dialog.ShowModal() == wxID_OK)
{
if (m_animationCtrl->LoadFile(filename))
m_animationCtrl->Play();
else
- wxMessageBox(_T("Sorry, this animation is not a valid format for wxAnimation."));
+ wxMessageBox(wxT("Sorry, this animation is not a valid format for wxAnimation."));
#else
#if 0
wxAnimation temp;
#include "artbrows.h"
#define ART_CLIENT(id) \
- choice->Append(_T(#id), (void*)id);
+ choice->Append(wxT(#id), (void*)id);
#define ART_ICON(id) \
{ \
int ind; \
ind = images->Add(icon); \
else \
ind = 0; \
- list->InsertItem(index, _T(#id), ind); \
+ list->InsertItem(index, wxT(#id), ind); \
list->SetItemData(index, (long)id); \
index++; \
}
END_EVENT_TABLE()
wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent)
- : wxDialog(parent, wxID_ANY, _T("Art resources browser"),
+ : wxDialog(parent, wxID_ANY, wxT("Art resources browser"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
{
FillClients(choice);
subsizer = new wxBoxSizer(wxHORIZONTAL);
- subsizer->Add(new wxStaticText(this, wxID_ANY, _T("Client:")), 0, wxALIGN_CENTER_VERTICAL);
+ subsizer->Add(new wxStaticText(this, wxID_ANY, wxT("Client:")), 0, wxALIGN_CENTER_VERTICAL);
subsizer->Add(choice, 1, wxLEFT, 5);
sizer->Add(subsizer, 0, wxALL | wxEXPAND, 10);
m_list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(250, 300),
wxLC_REPORT | wxSUNKEN_BORDER);
- m_list->InsertColumn(0, _T("wxArtID"));
+ m_list->InsertColumn(0, wxT("wxArtID"));
subsizer->Add(m_list, 1, wxEXPAND | wxRIGHT, 10);
wxSizer *subsub = new wxBoxSizer(wxVERTICAL);
sizer->Add(subsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 10);
- wxButton *ok = new wxButton(this, wxID_OK, _T("Close"));
+ wxButton *ok = new wxButton(this, wxID_OK, wxT("Close"));
ok->SetDefault();
sizer->Add(ok, 0, wxALIGN_RIGHT | wxALL, 10);
return false;
// create the main application window
- MyFrame *frame = new MyFrame(_T("wxArtProvider sample"),
+ MyFrame *frame = new MyFrame(wxT("wxArtProvider sample"),
wxPoint(50, 50), wxSize(450, 340));
frame->Show(true);
return true;
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(wxID_ABOUT, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(wxID_ABOUT, wxT("&About...\tF1"), wxT("Show about dialog"));
- menuFile->AppendCheckItem(ID_PlugProvider, _T("&Plug-in art provider"), _T("Enable custom art provider"));
+ menuFile->AppendCheckItem(ID_PlugProvider, wxT("&Plug-in art provider"), wxT("Enable custom art provider"));
menuFile->AppendSeparator();
#if wxUSE_LOG
- menuFile->Append(ID_Logs, _T("&Logging test"), _T("Show some logging output"));
+ menuFile->Append(ID_Logs, wxT("&Logging test"), wxT("Show some logging output"));
#endif // wxUSE_LOG
- menuFile->Append(ID_Browser, _T("&Resources browser"), _T("Browse all available icons"));
+ menuFile->Append(ID_Browser, wxT("&Resources browser"), wxT("Browse all available icons"));
menuFile->AppendSeparator();
- menuFile->Append(ID_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(ID_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_LOG
void MyFrame::OnLogs(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("Some information."));
- wxLogError(_T("This is an error."));
- wxLogWarning(_T("A warning."));
- wxLogError(_T("Yet another error."));
+ wxLogMessage(wxT("Some information."));
+ wxLogError(wxT("This is an error."));
+ wxLogWarning(wxT("A warning."));
+ wxLogError(wxT("Yet another error."));
wxLog::GetActiveTarget()->Flush();
- wxLogMessage(_T("Check/uncheck 'File/Plug-in art provider' and try again."));
+ wxLogMessage(wxT("Check/uncheck 'File/Plug-in art provider' and try again."));
}
#endif // wxUSE_LOG
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
- msg.Printf( _T("This is the about dialog of wxArtProvider sample.\n")
- _T("Welcome to %s"), wxVERSION_STRING);
+ msg.Printf( wxT("This is the about dialog of wxArtProvider sample.\n")
+ wxT("Welcome to %s"), wxVERSION_STRING);
- wxMessageBox(msg, _T("About wxArtProvider sample"),
+ wxMessageBox(msg, wxT("About wxArtProvider sample"),
wxOK | wxICON_INFORMATION, this);
}
return false;
// Create the main application window
- MyFrame *frame = new MyFrame(_T("Calendar wxWidgets sample")
+ MyFrame *frame = new MyFrame(wxT("Calendar wxWidgets sample")
#ifndef __WXWINCE__
,wxPoint(50, 50), wxSize(450, 340)
#endif
// create a menu bar
wxMenu *menuFile = new wxMenu;
- menuFile->Append(Calendar_File_About, _T("&About...\tCtrl-A"), _T("Show about dialog"));
+ menuFile->Append(Calendar_File_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog"));
menuFile->AppendSeparator();
- menuFile->Append(Calendar_File_ClearLog, _T("&Clear log\tCtrl-L"));
+ menuFile->Append(Calendar_File_ClearLog, wxT("&Clear log\tCtrl-L"));
menuFile->AppendSeparator();
- menuFile->Append(Calendar_File_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(Calendar_File_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
wxMenu *menuCal = new wxMenu;
#ifdef wxHAS_NATIVE_CALENDARCTRL
menuCal->AppendSeparator();
#endif // wxHAS_NATIVE_CALENDARCTRL
menuCal->Append(Calendar_Cal_Monday,
- _T("Monday &first weekday\tCtrl-F"),
- _T("Toggle between Mon and Sun as the first week day"),
+ wxT("Monday &first weekday\tCtrl-F"),
+ wxT("Toggle between Mon and Sun as the first week day"),
true);
- menuCal->Append(Calendar_Cal_Holidays, _T("Show &holidays\tCtrl-H"),
- _T("Toggle highlighting the holidays"),
+ menuCal->Append(Calendar_Cal_Holidays, wxT("Show &holidays\tCtrl-H"),
+ wxT("Toggle highlighting the holidays"),
true);
- menuCal->Append(Calendar_Cal_Special, _T("Highlight &special dates\tCtrl-S"),
- _T("Test custom highlighting"),
+ menuCal->Append(Calendar_Cal_Special, wxT("Highlight &special dates\tCtrl-S"),
+ wxT("Test custom highlighting"),
true);
menuCal->Append(Calendar_Cal_SurroundWeeks,
- _T("Show s&urrounding weeks\tCtrl-W"),
- _T("Show the neighbouring weeks in the prev/next month"),
+ wxT("Show s&urrounding weeks\tCtrl-W"),
+ wxT("Show the neighbouring weeks in the prev/next month"),
true);
menuCal->Append(Calendar_Cal_WeekNumbers,
- _T("Show &week numbers"),
- _T("Toggle week numbers"),
+ wxT("Show &week numbers"),
+ wxT("Toggle week numbers"),
true);
menuCal->AppendSeparator();
menuCal->Append(Calendar_Cal_SeqMonth,
- _T("Toggle month selector st&yle\tCtrl-Y"),
- _T("Use another style for the calendar controls"),
+ wxT("Toggle month selector st&yle\tCtrl-Y"),
+ wxT("Use another style for the calendar controls"),
true);
- menuCal->Append(Calendar_Cal_Month, _T("&Month can be changed\tCtrl-M"),
- _T("Allow changing the month in the calendar"),
+ menuCal->Append(Calendar_Cal_Month, wxT("&Month can be changed\tCtrl-M"),
+ wxT("Allow changing the month in the calendar"),
true);
menuCal->AppendSeparator();
- menuCal->Append(Calendar_Cal_SetDate, _T("Call &SetDate(2005-12-24)"), _T("Set date to 2005-12-24."));
- menuCal->Append(Calendar_Cal_Today, _T("Call &Today()"), _T("Set to the current date."));
+ menuCal->Append(Calendar_Cal_SetDate, wxT("Call &SetDate(2005-12-24)"), wxT("Set date to 2005-12-24."));
+ menuCal->Append(Calendar_Cal_Today, wxT("Call &Today()"), wxT("Set to the current date."));
menuCal->Append(Calendar_Cal_BeginDST, "Call SetDate(GetBeginDST())");
menuCal->AppendSeparator();
- menuCal->AppendCheckItem(Calendar_Cal_Resizable, _T("Make &resizable\tCtrl-R"));
+ menuCal->AppendCheckItem(Calendar_Cal_Resizable, wxT("Make &resizable\tCtrl-R"));
#if wxUSE_DATEPICKCTRL
wxMenu *menuDate = new wxMenu;
menuDate->AppendCheckItem(Calendar_DatePicker_ShowCentury,
- _T("Al&ways show century"));
+ wxT("Al&ways show century"));
menuDate->AppendCheckItem(Calendar_DatePicker_DropDown,
- _T("Use &drop down control"));
+ wxT("Use &drop down control"));
menuDate->AppendCheckItem(Calendar_DatePicker_AllowNone,
- _T("Allow &no date"));
+ wxT("Allow &no date"));
menuDate->AppendCheckItem(Calendar_DatePicker_StartWithNone,
- _T("Start &with no date"));
+ wxT("Start &with no date"));
#if wxUSE_DATEPICKCTRL_GENERIC
menuDate->AppendCheckItem(Calendar_DatePicker_Generic,
- _T("Use &generic version of the control"));
+ wxT("Use &generic version of the control"));
#endif // wxUSE_DATEPICKCTRL_GENERIC
menuDate->AppendSeparator();
- menuDate->Append(Calendar_DatePicker_AskDate, _T("&Choose date...\tCtrl-D"), _T("Show dialog with wxDatePickerCtrl"));
+ menuDate->Append(Calendar_DatePicker_AskDate, wxT("&Choose date...\tCtrl-D"), wxT("Show dialog with wxDatePickerCtrl"));
#endif // wxUSE_DATEPICKCTRL
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(menuCal, _T("&Calendar"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(menuCal, wxT("&Calendar"));
#if wxUSE_DATEPICKCTRL
- menuBar->Append(menuDate, _T("&Date picker"));
+ menuBar->Append(menuDate, wxT("&Date picker"));
#endif // wxUSE_DATEPICKCTRL
menuBar->Check(Calendar_Cal_Monday, true);
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("wxCalendarCtrl sample\n(c) 2000--2008 Vadim Zeitlin"),
- _T("About Calendar"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(wxT("wxCalendarCtrl sample\n(c) 2000--2008 Vadim Zeitlin"),
+ wxT("About Calendar"), wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnClearLog(wxCommandEvent& WXUNUSED(event))
if ( dt.GetDay() == today.GetDay() &&
dt.GetMonth() == today.GetMonth() )
{
- wxMessageBox(_T("Happy birthday!"), _T("Calendar Sample"));
+ wxMessageBox(wxT("Happy birthday!"), wxT("Calendar Sample"));
}
m_panel->SetDate(dt);
- wxLogStatus(_T("Changed the date to your input"));
+ wxLogStatus(wxT("Changed the date to your input"));
}
else
{
- wxLogStatus(_T("No date entered"));
+ wxLogStatus(wxT("No date entered"));
}
}
}
#if wxUSE_DATEPICKCTRL
MyDialog::MyDialog(wxWindow *parent, const wxDateTime& dt, int dtpStyle)
- : wxDialog(parent, wxID_ANY, wxString(_T("Calendar: Choose a date")))
+ : wxDialog(parent, wxID_ANY, wxString(wxT("Calendar: Choose a date")))
{
wxStdDialogButtonSizer *sizerBtns = new wxStdDialogButtonSizer;
sizerBtns->AddButton(new wxButton(this, wxID_OK));
sizerBtns->Realize();
wxSizer *sizerText = new wxBoxSizer(wxHORIZONTAL);
- sizerText->Add(new wxStaticText(this, wxID_ANY, _T("Date in ISO format: ")),
+ sizerText->Add(new wxStaticText(this, wxID_ANY, wxT("Date in ISO format: ")),
wxSizerFlags().Border().Align(wxALIGN_CENTRE_VERTICAL));
m_text = new wxTextCtrl(this, wxID_ANY);
sizerText->Add(m_text, wxSizerFlags().
sizerTop->Add(new wxStaticText
(
this, wxID_ANY,
- _T("Enter your birthday date (not before 20th century):")
+ wxT("Enter your birthday date (not before 20th century):")
),
wxSizerFlags().Border());
return false;
// create and show the main application window
- MyFrame *frame = new MyFrame(_T("Caret wxWidgets sample"),
+ MyFrame *frame = new MyFrame(wxT("Caret wxWidgets sample"),
wxPoint(50, 50), wxSize(450, 340));
frame->Show(true);
// create a menu bar
wxMenu *menuFile = new wxMenu;
- menuFile->Append(Caret_SetBlinkTime, _T("&Blink time...\tCtrl-B"));
- menuFile->Append(Caret_SetFontSize, _T("&Font size...\tCtrl-S"));
- menuFile->Append(Caret_Move, _T("&Move caret\tCtrl-C"));
+ menuFile->Append(Caret_SetBlinkTime, wxT("&Blink time...\tCtrl-B"));
+ menuFile->Append(Caret_SetFontSize, wxT("&Font size...\tCtrl-S"));
+ menuFile->Append(Caret_Move, wxT("&Move caret\tCtrl-C"));
menuFile->AppendSeparator();
- menuFile->Append(Caret_About, _T("&About...\tCtrl-A"), _T("Show about dialog"));
+ menuFile->Append(Caret_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog"));
menuFile->AppendSeparator();
- menuFile->Append(Caret_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(Caret_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(menuFile, _T("&File"));
+ menuBar->Append(menuFile, wxT("&File"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWidgets!"));
+ SetStatusText(wxT("Welcome to wxWidgets!"));
#endif // wxUSE_STATUSBAR
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("The caret wxWidgets sample.\n(c) 1999 Vadim Zeitlin"),
- _T("About Caret"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(wxT("The caret wxWidgets sample.\n(c) 1999 Vadim Zeitlin"),
+ wxT("About Caret"), wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnCaretMove(wxCommandEvent& WXUNUSED(event))
{
long blinkTime = wxGetNumberFromUser
(
- _T("The caret blink time is the time between two blinks"),
- _T("Time in milliseconds:"),
- _T("wxCaret sample"),
+ wxT("The caret blink time is the time between two blinks"),
+ wxT("Time in milliseconds:"),
+ wxT("wxCaret sample"),
wxCaret::GetBlinkTime(), 0, 10000,
this
);
{
wxCaret::SetBlinkTime((int)blinkTime);
m_canvas->CreateCaret();
- wxLogStatus(this, _T("Blink time set to %ld milliseconds."), blinkTime);
+ wxLogStatus(this, wxT("Blink time set to %ld milliseconds."), blinkTime);
}
}
{
long fontSize = wxGetNumberFromUser
(
- _T("The font size also determines the caret size so\nthis demonstrates resizing the caret."),
- _T("Font size (in points):"),
- _T("wxCaret sample"),
+ wxT("The font size also determines the caret size so\nthis demonstrates resizing the caret."),
+ wxT("Font size (in points):"),
+ wxT("wxCaret sample"),
12, 1, 100,
this
);
void MyCanvas::DoMoveCaret()
{
- wxLogStatus(_T("Caret is at (%d, %d)"), m_xCaret, m_yCaret);
+ wxLogStatus(wxT("Caret is at (%d, %d)"), m_xCaret, m_yCaret);
GetCaret()->Move(m_xMargin + m_xCaret * m_widthChar,
m_yMargin + m_yCaret * m_heightChar);
if ( frame && frame->GetStatusBar() )
{
wxString msg;
- msg.Printf(_T("Panel size is (%d, %d)"), m_xChars, m_yChars);
+ msg.Printf(wxT("Panel size is (%d, %d)"), m_xChars, m_yChars);
frame->SetStatusText(msg, 1);
}
#endif // wxUSE_STATUSBAR
{
wxChar ch = CharAt(x, y);
if ( !ch )
- ch = _T(' ');
+ ch = wxT(' ');
line += ch;
}
// My frame constructor
MyFrame::MyFrame()
- : wxFrame(NULL, wxID_ANY, _T("wxCollapsiblePane sample"),
+ : wxFrame(NULL, wxID_ANY, wxT("wxCollapsiblePane sample"),
wxDefaultPosition, wxSize(420, 300),
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{
// Make a menubar
wxMenu *paneMenu = new wxMenu;
- paneMenu->Append(PANE_COLLAPSE, _T("Collapse\tCtrl-C"));
- paneMenu->Append(PANE_EXPAND, _T("Expand\tCtrl-E"));
+ paneMenu->Append(PANE_COLLAPSE, wxT("Collapse\tCtrl-C"));
+ paneMenu->Append(PANE_EXPAND, wxT("Expand\tCtrl-E"));
paneMenu->AppendSeparator();
- paneMenu->Append(PANE_SETLABEL, _T("Set label...\tCtrl-L"));
+ paneMenu->Append(PANE_SETLABEL, wxT("Set label...\tCtrl-L"));
paneMenu->AppendSeparator();
- paneMenu->Append(PANE_SHOWDLG, _T("Show dialog...\tCtrl-S"));
+ paneMenu->Append(PANE_SHOWDLG, wxT("Show dialog...\tCtrl-S"));
paneMenu->AppendSeparator();
paneMenu->Append(PANE_QUIT);
helpMenu->Append(PANE_ABOUT);
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(paneMenu, _T("&Pane"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(paneMenu, wxT("&Pane"));
+ menuBar->Append(helpMenu, wxT("&Help"));
SetMenuBar(menuBar);
m_collPane = new wxCollapsiblePane(this, -1, wxT("test!"));
wxAboutDialogInfo info;
info.SetName(_("wxCollapsiblePane sample"));
info.SetDescription(_("This sample program demonstrates usage of wxCollapsiblePane"));
- info.SetCopyright(_T("(C) 2006 Francesco Montorsi <frm@users.sourceforge.net>"));
+ info.SetCopyright(wxT("(C) 2006 Francesco Montorsi <frm@users.sourceforge.net>"));
wxAboutBox(info);
}
return false;
// create the main application window
- MyFrame *frame = new MyFrame(_T("wxComboCtrl and wxOwnerDrawnComboBox Sample"));
+ MyFrame *frame = new MyFrame(wxT("wxComboCtrl and wxOwnerDrawnComboBox Sample"));
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(ComboControl_About, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(ComboControl_About, wxT("&About...\tF1"), wxT("Show about dialog"));
- fileMenu->Append(ComboControl_Compare, _T("&Compare against wxComboBox..."),
- _T("Show some wxOwnerDrawnComboBoxes side-by-side with native wxComboBoxes."));
+ fileMenu->Append(ComboControl_Compare, wxT("&Compare against wxComboBox..."),
+ wxT("Show some wxOwnerDrawnComboBoxes side-by-side with native wxComboBoxes."));
fileMenu->AppendSeparator();
- fileMenu->Append(ComboControl_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ fileMenu->Append(ComboControl_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(fileMenu, _T("&File"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(fileMenu, wxT("&File"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxMessageBox(wxString::Format(
- _T("Welcome to %s!\n")
- _T("\n")
- _T("This is the wxWidgets wxComboCtrl and wxOwnerDrawnComboBox sample\n")
- _T("running under %s."),
+ wxT("Welcome to %s!\n")
+ wxT("\n")
+ wxT("This is the wxWidgets wxComboCtrl and wxOwnerDrawnComboBox sample\n")
+ wxT("running under %s."),
wxVERSION_STRING,
wxGetOsDescription().c_str()
),
- _T("About wxComboCtrl sample"),
+ wxT("About wxComboCtrl sample"),
wxOK | wxICON_INFORMATION,
this);
}
// of the config file/registry key and must be set before the first call
// to Get() if you want to override the default values (the application
// name is the name of the executable and the vendor name is the same)
- SetVendorName(_T("wxWidgets"));
- SetAppName(_T("conftest")); // not needed, it's the default value
+ SetVendorName(wxT("wxWidgets"));
+ SetAppName(wxT("conftest")); // not needed, it's the default value
wxConfigBase *pConfig = wxConfigBase::Get();
SetTopWindow(frame);
// use our config object...
- if ( pConfig->Read(_T("/Controls/Check"), 1l) != 0 ) {
- wxMessageBox(_T("You can disable this message box by unchecking\n")
- _T("the checkbox in the main window (of course, a real\n")
- _T("program would have a checkbox right here but we\n")
- _T("keep it simple)"), _T("Welcome to wxConfig demo"),
+ if ( pConfig->Read(wxT("/Controls/Check"), 1l) != 0 ) {
+ wxMessageBox(wxT("You can disable this message box by unchecking\n")
+ wxT("the checkbox in the main window (of course, a real\n")
+ wxT("program would have a checkbox right here but we\n")
+ wxT("keep it simple)"), wxT("Welcome to wxConfig demo"),
wxICON_INFORMATION | wxOK);
}
// main frame ctor
MyFrame::MyFrame()
- : wxFrame((wxFrame *) NULL, wxID_ANY, _T("wxConfig Demo"))
+ : wxFrame((wxFrame *) NULL, wxID_ANY, wxT("wxConfig Demo"))
{
SetIcon(wxICON(sample));
// menu
wxMenu *file_menu = new wxMenu;
- file_menu->Append(ConfTest_Delete, _T("&Delete"), _T("Delete config file"));
+ file_menu->Append(ConfTest_Delete, wxT("&Delete"), wxT("Delete config file"));
file_menu->AppendSeparator();
- file_menu->Append(ConfTest_About, _T("&About\tF1"), _T("About this sample"));
+ file_menu->Append(ConfTest_About, wxT("&About\tF1"), wxT("About this sample"));
file_menu->AppendSeparator();
- file_menu->Append(ConfTest_Quit, _T("E&xit\tAlt-X"), _T("Exit the program"));
+ file_menu->Append(ConfTest_Quit, wxT("E&xit\tAlt-X"), wxT("Exit the program"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
+ menu_bar->Append(file_menu, wxT("&File"));
SetMenuBar(menu_bar);
#if wxUSE_STATUSBAR
// child controls
wxPanel *panel = new wxPanel(this);
- (void)new wxStaticText(panel, wxID_ANY, _T("These controls remember their values!"),
+ (void)new wxStaticText(panel, wxID_ANY, wxT("These controls remember their values!"),
wxPoint(10, 10), wxSize(300, 20));
- m_text = new wxTextCtrl(panel, wxID_ANY, _T(""), wxPoint(10, 40), wxSize(300, 20));
- m_check = new wxCheckBox(panel, wxID_ANY, _T("show welcome message box at startup"),
+ m_text = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxPoint(10, 40), wxSize(300, 20));
+ m_check = new wxCheckBox(panel, wxID_ANY, wxT("show welcome message box at startup"),
wxPoint(10, 70), wxSize(300, 20));
// restore the control's values from the config
wxConfigBase *pConfig = wxConfigBase::Get();
// we could write Read("/Controls/Text") as well, it's just to show SetPath()
- pConfig->SetPath(_T("/Controls"));
+ pConfig->SetPath(wxT("/Controls"));
- m_text->SetValue(pConfig->Read(_T("Text"), _T("")));
- m_check->SetValue(pConfig->Read(_T("Check"), 1l) != 0);
+ m_text->SetValue(pConfig->Read(wxT("Text"), wxT("")));
+ m_check->SetValue(pConfig->Read(wxT("Check"), 1l) != 0);
// SetPath() understands ".."
- pConfig->SetPath(_T("../MainFrame"));
+ pConfig->SetPath(wxT("../MainFrame"));
// restore frame position and size
- int x = pConfig->Read(_T("x"), 50),
- y = pConfig->Read(_T("y"), 50),
- w = pConfig->Read(_T("w"), 350),
- h = pConfig->Read(_T("h"), 200);
+ int x = pConfig->Read(wxT("x"), 50),
+ y = pConfig->Read(wxT("y"), 50),
+ w = pConfig->Read(wxT("w"), 350),
+ h = pConfig->Read(wxT("h"), 200);
Move(x, y);
SetClientSize(w, h);
- pConfig->SetPath(_T("/"));
+ pConfig->SetPath(wxT("/"));
wxString s;
- if ( pConfig->Read(_T("TestValue"), &s) )
+ if ( pConfig->Read(wxT("TestValue"), &s) )
{
wxLogStatus(this, wxT("TestValue from config is '%s'"), s.c_str());
}
void MyFrame::OnAbout(wxCommandEvent&)
{
- wxMessageBox(_T("wxConfig demo\n(c) 1998-2001 Vadim Zeitlin"), _T("About"),
+ wxMessageBox(wxT("wxConfig demo\n(c) 1998-2001 Vadim Zeitlin"), wxT("About"),
wxICON_INFORMATION | wxOK);
}
wxConfigBase *pConfig = wxConfigBase::Get();
if ( pConfig == NULL )
{
- wxLogError(_T("No config to delete!"));
+ wxLogError(wxT("No config to delete!"));
return;
}
if ( pConfig->DeleteAll() )
{
- wxLogMessage(_T("Config file/registry key successfully deleted."));
+ wxLogMessage(wxT("Config file/registry key successfully deleted."));
delete wxConfigBase::Set(NULL);
wxConfigBase::DontCreateOnDemand();
}
else
{
- wxLogError(_T("Deleting config file/registry key failed."));
+ wxLogError(wxT("Deleting config file/registry key failed."));
}
}
return;
// save the control's values to the config
- pConfig->Write(_T("/Controls/Text"), m_text->GetValue());
- pConfig->Write(_T("/Controls/Check"), m_check->GetValue());
+ pConfig->Write(wxT("/Controls/Text"), m_text->GetValue());
+ pConfig->Write(wxT("/Controls/Check"), m_check->GetValue());
// save the frame position
int x, y, w, h;
GetClientSize(&w, &h);
GetPosition(&x, &y);
- pConfig->Write(_T("/MainFrame/x"), (long) x);
- pConfig->Write(_T("/MainFrame/y"), (long) y);
- pConfig->Write(_T("/MainFrame/w"), (long) w);
- pConfig->Write(_T("/MainFrame/h"), (long) h);
+ pConfig->Write(wxT("/MainFrame/x"), (long) x);
+ pConfig->Write(wxT("/MainFrame/y"), (long) y);
+ pConfig->Write(wxT("/MainFrame/w"), (long) w);
+ pConfig->Write(wxT("/MainFrame/h"), (long) h);
- pConfig->Write(_T("/TestValue"), wxT("A test value"));
+ pConfig->Write(wxT("/TestValue"), wxT("A test value"));
}
switch ( parser.Parse() )
{
case -1:
- wxLogMessage(_T("Help was given, terminating."));
+ wxLogMessage(wxT("Help was given, terminating."));
break;
case 0:
break;
default:
- wxLogMessage(_T("Syntax error detected, aborting."));
+ wxLogMessage(wxT("Syntax error detected, aborting."));
break;
}
static wxString MakePrintable(const wxChar *s)
{
wxString str(s);
- (void)str.Replace(_T("\t"), _T("\\t"));
- (void)str.Replace(_T("\n"), _T("\\n"));
- (void)str.Replace(_T("\r"), _T("\\r"));
+ (void)str.Replace(wxT("\t"), wxT("\\t"));
+ (void)str.Replace(wxT("\n"), wxT("\\n"));
+ (void)str.Replace(wxT("\r"), wxT("\\r"));
return str;
}
static void ShowCmdLine(const wxCmdLineParser& parser)
{
- wxString s = _T("Command line parsed successfully:\nInput files: ");
+ wxString s = wxT("Command line parsed successfully:\nInput files: ");
size_t count = parser.GetParamCount();
for ( size_t param = 0; param < count; param++ )
}
s << '\n'
- << _T("Verbose:\t") << (parser.Found(_T("v")) ? _T("yes") : _T("no")) << '\n'
- << _T("Quiet:\t") << (parser.Found(_T("q")) ? _T("yes") : _T("no")) << '\n';
+ << wxT("Verbose:\t") << (parser.Found(wxT("v")) ? wxT("yes") : wxT("no")) << '\n'
+ << wxT("Quiet:\t") << (parser.Found(wxT("q")) ? wxT("yes") : wxT("no")) << '\n';
wxString strVal;
long lVal;
double dVal;
wxDateTime dt;
- if ( parser.Found(_T("o"), &strVal) )
- s << _T("Output file:\t") << strVal << '\n';
- if ( parser.Found(_T("i"), &strVal) )
- s << _T("Input dir:\t") << strVal << '\n';
- if ( parser.Found(_T("s"), &lVal) )
- s << _T("Size:\t") << lVal << '\n';
- if ( parser.Found(_T("f"), &dVal) )
- s << _T("Double:\t") << dVal << '\n';
- if ( parser.Found(_T("d"), &dt) )
- s << _T("Date:\t") << dt.FormatISODate() << '\n';
- if ( parser.Found(_T("project_name"), &strVal) )
- s << _T("Project:\t") << strVal << '\n';
+ if ( parser.Found(wxT("o"), &strVal) )
+ s << wxT("Output file:\t") << strVal << '\n';
+ if ( parser.Found(wxT("i"), &strVal) )
+ s << wxT("Input dir:\t") << strVal << '\n';
+ if ( parser.Found(wxT("s"), &lVal) )
+ s << wxT("Size:\t") << lVal << '\n';
+ if ( parser.Found(wxT("f"), &dVal) )
+ s << wxT("Double:\t") << dVal << '\n';
+ if ( parser.Found(wxT("d"), &dt) )
+ s << wxT("Date:\t") << dt.FormatISODate() << '\n';
+ if ( parser.Found(wxT("project_name"), &strVal) )
+ s << wxT("Project:\t") << strVal << '\n';
wxLogMessage(s);
}
{
static const wxChar *cmdlines[] =
{
- _T("arg1 arg2"),
- _T("-a \"-bstring 1\" -c\"string 2\" \"string 3\""),
- _T("literal \\\" and \"\""),
+ wxT("arg1 arg2"),
+ wxT("-a \"-bstring 1\" -c\"string 2\" \"string 3\""),
+ wxT("literal \\\" and \"\""),
};
for ( size_t n = 0; n < WXSIZEOF(cmdlines); n++ )
{
const wxChar *cmdline = cmdlines[n];
- wxPrintf(_T("Parsing: %s\n"), cmdline);
+ wxPrintf(wxT("Parsing: %s\n"), cmdline);
wxArrayString args = wxCmdLineParser::ConvertStringToArgs(cmdline);
size_t count = args.GetCount();
- wxPrintf(_T("\targc = %u\n"), count);
+ wxPrintf(wxT("\targc = %u\n"), count);
for ( size_t arg = 0; arg < count; arg++ )
{
- wxPrintf(_T("\targv[%u] = %s\n"), arg, args[arg].c_str());
+ wxPrintf(wxT("\targv[%u] = %s\n"), arg, args[arg].c_str());
}
}
}
#include "wx/dir.h"
#ifdef __UNIX__
- static const wxChar *ROOTDIR = _T("/");
- static const wxChar *TESTDIR = _T("/usr/local/share");
+ static const wxChar *ROOTDIR = wxT("/");
+ static const wxChar *TESTDIR = wxT("/usr/local/share");
#elif defined(__WXMSW__) || defined(__DOS__) || defined(__OS2__)
- static const wxChar *ROOTDIR = _T("c:\\");
- static const wxChar *TESTDIR = _T("d:\\");
+ static const wxChar *ROOTDIR = wxT("c:\\");
+ static const wxChar *TESTDIR = wxT("d:\\");
#else
#error "don't know where the root directory is"
#endif
bool cont = dir.GetFirst(&filename, filespec, flags);
while ( cont )
{
- wxPrintf(_T("\t%s\n"), filename.c_str());
+ wxPrintf(wxT("\t%s\n"), filename.c_str());
cont = dir.GetNext(&filename);
}
static void TestDirEnum()
{
- wxPuts(_T("*** Testing wxDir::GetFirst/GetNext ***"));
+ wxPuts(wxT("*** Testing wxDir::GetFirst/GetNext ***"));
wxString cwd = wxGetCwd();
if ( !wxDir::Exists(cwd) )
{
- wxPrintf(_T("ERROR: current directory '%s' doesn't exist?\n"), cwd.c_str());
+ wxPrintf(wxT("ERROR: current directory '%s' doesn't exist?\n"), cwd.c_str());
return;
}
wxDir dir(cwd);
if ( !dir.IsOpened() )
{
- wxPrintf(_T("ERROR: failed to open current directory '%s'.\n"), cwd.c_str());
+ wxPrintf(wxT("ERROR: failed to open current directory '%s'.\n"), cwd.c_str());
return;
}
- wxPuts(_T("Enumerating everything in current directory:"));
+ wxPuts(wxT("Enumerating everything in current directory:"));
TestDirEnumHelper(dir);
- wxPuts(_T("Enumerating really everything in current directory:"));
+ wxPuts(wxT("Enumerating really everything in current directory:"));
TestDirEnumHelper(dir, wxDIR_DEFAULT | wxDIR_DOTDOT);
- wxPuts(_T("Enumerating object files in current directory:"));
- TestDirEnumHelper(dir, wxDIR_DEFAULT, _T("*.o*"));
+ wxPuts(wxT("Enumerating object files in current directory:"));
+ TestDirEnumHelper(dir, wxDIR_DEFAULT, wxT("*.o*"));
- wxPuts(_T("Enumerating directories in current directory:"));
+ wxPuts(wxT("Enumerating directories in current directory:"));
TestDirEnumHelper(dir, wxDIR_DIRS);
- wxPuts(_T("Enumerating files in current directory:"));
+ wxPuts(wxT("Enumerating files in current directory:"));
TestDirEnumHelper(dir, wxDIR_FILES);
- wxPuts(_T("Enumerating files including hidden in current directory:"));
+ wxPuts(wxT("Enumerating files including hidden in current directory:"));
TestDirEnumHelper(dir, wxDIR_FILES | wxDIR_HIDDEN);
dir.Open(ROOTDIR);
- wxPuts(_T("Enumerating everything in root directory:"));
+ wxPuts(wxT("Enumerating everything in root directory:"));
TestDirEnumHelper(dir, wxDIR_DEFAULT);
- wxPuts(_T("Enumerating directories in root directory:"));
+ wxPuts(wxT("Enumerating directories in root directory:"));
TestDirEnumHelper(dir, wxDIR_DIRS);
- wxPuts(_T("Enumerating files in root directory:"));
+ wxPuts(wxT("Enumerating files in root directory:"));
TestDirEnumHelper(dir, wxDIR_FILES);
- wxPuts(_T("Enumerating files including hidden in root directory:"));
+ wxPuts(wxT("Enumerating files including hidden in root directory:"));
TestDirEnumHelper(dir, wxDIR_FILES | wxDIR_HIDDEN);
- wxPuts(_T("Enumerating files in non existing directory:"));
- wxDir dirNo(_T("nosuchdir"));
+ wxPuts(wxT("Enumerating files in non existing directory:"));
+ wxDir dirNo(wxT("nosuchdir"));
TestDirEnumHelper(dirNo);
}
wxFileName::SplitPath(dirname, &path, &name, &ext);
if ( !ext.empty() )
- name << _T('.') << ext;
+ name << wxT('.') << ext;
wxString indent;
for ( const wxChar *p = path.c_str(); *p; p++ )
{
if ( wxIsPathSeparator(*p) )
- indent += _T(" ");
+ indent += wxT(" ");
}
- wxPrintf(_T("%s%s\n"), indent.c_str(), name.c_str());
+ wxPrintf(wxT("%s%s\n"), indent.c_str(), name.c_str());
return wxDIR_CONTINUE;
}
static void TestDirTraverse()
{
- wxPuts(_T("*** Testing wxDir::Traverse() ***"));
+ wxPuts(wxT("*** Testing wxDir::Traverse() ***"));
// enum all files
wxArrayString files;
size_t n = wxDir::GetAllFiles(TESTDIR, &files);
- wxPrintf(_T("There are %u files under '%s'\n"), n, TESTDIR);
+ wxPrintf(wxT("There are %u files under '%s'\n"), n, TESTDIR);
if ( n > 1 )
{
- wxPrintf(_T("First one is '%s'\n"), files[0u].c_str());
- wxPrintf(_T(" last one is '%s'\n"), files[n - 1].c_str());
+ wxPrintf(wxT("First one is '%s'\n"), files[0u].c_str());
+ wxPrintf(wxT(" last one is '%s'\n"), files[n - 1].c_str());
}
// enum again with custom traverser
- wxPuts(_T("Now enumerating directories:"));
+ wxPuts(wxT("Now enumerating directories:"));
wxDir dir(TESTDIR);
DirPrintTraverser traverser;
dir.Traverse(traverser, wxEmptyString, wxDIR_DIRS | wxDIR_HIDDEN);
static void TestDirExists()
{
- wxPuts(_T("*** Testing wxDir::Exists() ***"));
+ wxPuts(wxT("*** Testing wxDir::Exists() ***"));
static const wxChar *dirnames[] =
{
- _T("."),
+ wxT("."),
#if defined(__WXMSW__)
- _T("c:"),
- _T("c:\\"),
- _T("\\\\share\\file"),
- _T("c:\\dos"),
- _T("c:\\dos\\"),
- _T("c:\\dos\\\\"),
- _T("c:\\autoexec.bat"),
+ wxT("c:"),
+ wxT("c:\\"),
+ wxT("\\\\share\\file"),
+ wxT("c:\\dos"),
+ wxT("c:\\dos\\"),
+ wxT("c:\\dos\\\\"),
+ wxT("c:\\autoexec.bat"),
#elif defined(__UNIX__)
- _T("/"),
- _T("//"),
- _T("/usr/bin"),
- _T("/usr//bin"),
- _T("/usr///bin"),
+ wxT("/"),
+ wxT("//"),
+ wxT("/usr/bin"),
+ wxT("/usr//bin"),
+ wxT("/usr///bin"),
#endif
};
for ( size_t n = 0; n < WXSIZEOF(dirnames); n++ )
{
- wxPrintf(_T("%-40s: %s\n"),
+ wxPrintf(wxT("%-40s: %s\n"),
dirnames[n],
- wxDir::Exists(dirnames[n]) ? _T("exists")
- : _T("doesn't exist"));
+ wxDir::Exists(dirnames[n]) ? wxT("exists")
+ : wxT("doesn't exist"));
}
}
static void TestDllLoad()
{
#if defined(__WXMSW__)
- static const wxChar *LIB_NAME = _T("kernel32.dll");
- static const wxChar *FUNC_NAME = _T("lstrlenA");
+ static const wxChar *LIB_NAME = wxT("kernel32.dll");
+ static const wxChar *FUNC_NAME = wxT("lstrlenA");
#elif defined(__UNIX__)
// weird: using just libc.so does *not* work!
- static const wxChar *LIB_NAME = _T("/lib/libc.so.6");
- static const wxChar *FUNC_NAME = _T("strlen");
+ static const wxChar *LIB_NAME = wxT("/lib/libc.so.6");
+ static const wxChar *FUNC_NAME = wxT("strlen");
#else
#error "don't know how to test wxDllLoader on this platform"
#endif
- wxPuts(_T("*** testing basic wxDynamicLibrary functions ***\n"));
+ wxPuts(wxT("*** testing basic wxDynamicLibrary functions ***\n"));
wxDynamicLibrary lib(LIB_NAME);
if ( !lib.IsLoaded() )
{
- wxPrintf(_T("ERROR: failed to load '%s'.\n"), LIB_NAME);
+ wxPrintf(wxT("ERROR: failed to load '%s'.\n"), LIB_NAME);
}
else
{
wxStrlenType pfnStrlen = (wxStrlenType)lib.GetSymbol(FUNC_NAME);
if ( !pfnStrlen )
{
- wxPrintf(_T("ERROR: function '%s' wasn't found in '%s'.\n"),
+ wxPrintf(wxT("ERROR: function '%s' wasn't found in '%s'.\n"),
FUNC_NAME, LIB_NAME);
}
else
{
- wxPrintf(_T("Calling %s dynamically loaded from %s "),
+ wxPrintf(wxT("Calling %s dynamically loaded from %s "),
FUNC_NAME, LIB_NAME);
if ( pfnStrlen("foo") != 3 )
{
- wxPrintf(_T("ERROR: loaded function is not wxStrlen()!\n"));
+ wxPrintf(wxT("ERROR: loaded function is not wxStrlen()!\n"));
}
else
{
- wxPuts(_T("... ok"));
+ wxPuts(wxT("... ok"));
}
}
#ifdef __WXMSW__
- static const wxChar *FUNC_NAME_AW = _T("lstrlen");
+ static const wxChar *FUNC_NAME_AW = wxT("lstrlen");
typedef int (wxSTDCALL *wxStrlenTypeAorW)(const wxChar *);
wxStrlenTypeAorW
pfnStrlenAorW = (wxStrlenTypeAorW)lib.GetSymbolAorW(FUNC_NAME_AW);
if ( !pfnStrlenAorW )
{
- wxPrintf(_T("ERROR: function '%s' wasn't found in '%s'.\n"),
+ wxPrintf(wxT("ERROR: function '%s' wasn't found in '%s'.\n"),
FUNC_NAME_AW, LIB_NAME);
}
else
{
- if ( pfnStrlenAorW(_T("foobar")) != 6 )
+ if ( pfnStrlenAorW(wxT("foobar")) != 6 )
{
- wxPrintf(_T("ERROR: loaded function is not wxStrlen()!\n"));
+ wxPrintf(wxT("ERROR: loaded function is not wxStrlen()!\n"));
}
}
#endif // __WXMSW__
static void TestDllListLoaded()
{
- wxPuts(_T("*** testing wxDynamicLibrary::ListLoaded() ***\n"));
+ wxPuts(wxT("*** testing wxDynamicLibrary::ListLoaded() ***\n"));
puts("\nLoaded modules:");
wxDynamicLibraryDetailsArray dlls = wxDynamicLibrary::ListLoaded();
{
wxString val;
if ( !wxGetEnv(var, &val) )
- val = _T("<empty>");
+ val = wxT("<empty>");
else
- val = wxString(_T('\'')) + val + _T('\'');
+ val = wxString(wxT('\'')) + val + wxT('\'');
return val;
}
static void TestEnvironment()
{
- const wxChar *var = _T("wxTestVar");
+ const wxChar *var = wxT("wxTestVar");
- wxPuts(_T("*** testing environment access functions ***"));
+ wxPuts(wxT("*** testing environment access functions ***"));
- wxPrintf(_T("Initially getenv(%s) = %s\n"), var, MyGetEnv(var).c_str());
- wxSetEnv(var, _T("value for wxTestVar"));
- wxPrintf(_T("After wxSetEnv: getenv(%s) = %s\n"), var, MyGetEnv(var).c_str());
- wxSetEnv(var, _T("another value"));
- wxPrintf(_T("After 2nd wxSetEnv: getenv(%s) = %s\n"), var, MyGetEnv(var).c_str());
+ wxPrintf(wxT("Initially getenv(%s) = %s\n"), var, MyGetEnv(var).c_str());
+ wxSetEnv(var, wxT("value for wxTestVar"));
+ wxPrintf(wxT("After wxSetEnv: getenv(%s) = %s\n"), var, MyGetEnv(var).c_str());
+ wxSetEnv(var, wxT("another value"));
+ wxPrintf(wxT("After 2nd wxSetEnv: getenv(%s) = %s\n"), var, MyGetEnv(var).c_str());
wxUnsetEnv(var);
- wxPrintf(_T("After wxUnsetEnv: getenv(%s) = %s\n"), var, MyGetEnv(var).c_str());
- wxPrintf(_T("PATH = %s\n"), MyGetEnv(_T("PATH")).c_str());
+ wxPrintf(wxT("After wxUnsetEnv: getenv(%s) = %s\n"), var, MyGetEnv(var).c_str());
+ wxPrintf(wxT("PATH = %s\n"), MyGetEnv(wxT("PATH")).c_str());
}
#endif // TEST_ENVIRON
static void TestFileRead()
{
- wxPuts(_T("*** wxFile read test ***"));
+ wxPuts(wxT("*** wxFile read test ***"));
- wxFile file(_T("testdata.fc"));
+ wxFile file(wxT("testdata.fc"));
if ( file.IsOpened() )
{
- wxPrintf(_T("File length: %lu\n"), file.Length());
+ wxPrintf(wxT("File length: %lu\n"), file.Length());
- wxPuts(_T("File dump:\n----------"));
+ wxPuts(wxT("File dump:\n----------"));
static const size_t len = 1024;
wxChar buf[len];
size_t nRead = file.Read(buf, len);
if ( nRead == (size_t)wxInvalidOffset )
{
- wxPrintf(_T("Failed to read the file."));
+ wxPrintf(wxT("Failed to read the file."));
break;
}
break;
}
- wxPuts(_T("----------"));
+ wxPuts(wxT("----------"));
}
else
{
- wxPrintf(_T("ERROR: can't open test file.\n"));
+ wxPrintf(wxT("ERROR: can't open test file.\n"));
}
wxPuts(wxEmptyString);
static void TestTextFileRead()
{
- wxPuts(_T("*** wxTextFile read test ***"));
+ wxPuts(wxT("*** wxTextFile read test ***"));
- wxTextFile file(_T("testdata.fc"));
+ wxTextFile file(wxT("testdata.fc"));
if ( file.Open() )
{
- wxPrintf(_T("Number of lines: %u\n"), file.GetLineCount());
- wxPrintf(_T("Last line: '%s'\n"), file.GetLastLine().c_str());
+ wxPrintf(wxT("Number of lines: %u\n"), file.GetLineCount());
+ wxPrintf(wxT("Last line: '%s'\n"), file.GetLastLine().c_str());
wxString s;
- wxPuts(_T("\nDumping the entire file:"));
+ wxPuts(wxT("\nDumping the entire file:"));
for ( s = file.GetFirstLine(); !file.Eof(); s = file.GetNextLine() )
{
- wxPrintf(_T("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str());
+ wxPrintf(wxT("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str());
}
- wxPrintf(_T("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str());
+ wxPrintf(wxT("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str());
- wxPuts(_T("\nAnd now backwards:"));
+ wxPuts(wxT("\nAnd now backwards:"));
for ( s = file.GetLastLine();
file.GetCurrentLine() != 0;
s = file.GetPrevLine() )
{
- wxPrintf(_T("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str());
+ wxPrintf(wxT("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str());
}
- wxPrintf(_T("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str());
+ wxPrintf(wxT("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str());
}
else
{
- wxPrintf(_T("ERROR: can't open '%s'\n"), file.GetName());
+ wxPrintf(wxT("ERROR: can't open '%s'\n"), file.GetName());
}
wxPuts(wxEmptyString);
static void TestFileCopy()
{
- wxPuts(_T("*** Testing wxCopyFile ***"));
+ wxPuts(wxT("*** Testing wxCopyFile ***"));
- static const wxChar *filename1 = _T("testdata.fc");
- static const wxChar *filename2 = _T("test2");
+ static const wxChar *filename1 = wxT("testdata.fc");
+ static const wxChar *filename2 = wxT("test2");
if ( !wxCopyFile(filename1, filename2) )
{
- wxPuts(_T("ERROR: failed to copy file"));
+ wxPuts(wxT("ERROR: failed to copy file"));
}
else
{
- wxFFile f1(filename1, _T("rb")),
- f2(filename2, _T("rb"));
+ wxFFile f1(filename1, wxT("rb")),
+ f2(filename2, wxT("rb"));
if ( !f1.IsOpened() || !f2.IsOpened() )
{
- wxPuts(_T("ERROR: failed to open file(s)"));
+ wxPuts(wxT("ERROR: failed to open file(s)"));
}
else
{
wxString s1, s2;
if ( !f1.ReadAll(&s1) || !f2.ReadAll(&s2) )
{
- wxPuts(_T("ERROR: failed to read file(s)"));
+ wxPuts(wxT("ERROR: failed to read file(s)"));
}
else
{
if ( (s1.length() != s2.length()) ||
(memcmp(s1.c_str(), s2.c_str(), s1.length()) != 0) )
{
- wxPuts(_T("ERROR: copy error!"));
+ wxPuts(wxT("ERROR: copy error!"));
}
else
{
- wxPuts(_T("File was copied ok."));
+ wxPuts(wxT("File was copied ok."));
}
}
}
if ( !wxRemoveFile(filename2) )
{
- wxPuts(_T("ERROR: failed to remove the file"));
+ wxPuts(wxT("ERROR: failed to remove the file"));
}
wxPuts(wxEmptyString);
static void TestTempFile()
{
- wxPuts(_T("*** wxTempFile test ***"));
+ wxPuts(wxT("*** wxTempFile test ***"));
wxTempFile tmpFile;
- if ( tmpFile.Open(_T("test2")) && tmpFile.Write(_T("the answer is 42")) )
+ if ( tmpFile.Open(wxT("test2")) && tmpFile.Write(wxT("the answer is 42")) )
{
if ( tmpFile.Commit() )
- wxPuts(_T("File committed."));
+ wxPuts(wxT("File committed."));
else
- wxPuts(_T("ERROR: could't commit temp file."));
+ wxPuts(wxT("ERROR: could't commit temp file."));
- wxRemoveFile(_T("test2"));
+ wxRemoveFile(wxT("test2"));
}
wxPuts(wxEmptyString);
const wxChar *value; // the value from the file
} fcTestData[] =
{
- { _T("value1"), _T("one") },
- { _T("value2"), _T("two") },
- { _T("novalue"), _T("default") },
+ { wxT("value1"), wxT("one") },
+ { wxT("value2"), wxT("two") },
+ { wxT("novalue"), wxT("default") },
};
static void TestFileConfRead()
{
- wxPuts(_T("*** testing wxFileConfig loading/reading ***"));
+ wxPuts(wxT("*** testing wxFileConfig loading/reading ***"));
- wxFileConfig fileconf(_T("test"), wxEmptyString,
- _T("testdata.fc"), wxEmptyString,
+ wxFileConfig fileconf(wxT("test"), wxEmptyString,
+ wxT("testdata.fc"), wxEmptyString,
wxCONFIG_USE_RELATIVE_PATH);
// test simple reading
- wxPuts(_T("\nReading config file:"));
- wxString defValue(_T("default")), value;
+ wxPuts(wxT("\nReading config file:"));
+ wxString defValue(wxT("default")), value;
for ( size_t n = 0; n < WXSIZEOF(fcTestData); n++ )
{
const FileConfTestData& data = fcTestData[n];
value = fileconf.Read(data.name, defValue);
- wxPrintf(_T("\t%s = %s "), data.name, value.c_str());
+ wxPrintf(wxT("\t%s = %s "), data.name, value.c_str());
if ( value == data.value )
{
- wxPuts(_T("(ok)"));
+ wxPuts(wxT("(ok)"));
}
else
{
- wxPrintf(_T("(ERROR: should be %s)\n"), data.value);
+ wxPrintf(wxT("(ERROR: should be %s)\n"), data.value);
}
}
// test enumerating the entries
- wxPuts(_T("\nEnumerating all root entries:"));
+ wxPuts(wxT("\nEnumerating all root entries:"));
long dummy;
wxString name;
bool cont = fileconf.GetFirstEntry(name, dummy);
while ( cont )
{
- wxPrintf(_T("\t%s = %s\n"),
+ wxPrintf(wxT("\t%s = %s\n"),
name.c_str(),
- fileconf.Read(name.c_str(), _T("ERROR")).c_str());
+ fileconf.Read(name.c_str(), wxT("ERROR")).c_str());
cont = fileconf.GetNextEntry(name, dummy);
}
- static const wxChar *testEntry = _T("TestEntry");
- wxPrintf(_T("\nTesting deletion of newly created \"Test\" entry: "));
- fileconf.Write(testEntry, _T("A value"));
+ static const wxChar *testEntry = wxT("TestEntry");
+ wxPrintf(wxT("\nTesting deletion of newly created \"Test\" entry: "));
+ fileconf.Write(testEntry, wxT("A value"));
fileconf.DeleteEntry(testEntry);
- wxPrintf(fileconf.HasEntry(testEntry) ? _T("ERROR\n") : _T("ok\n"));
+ wxPrintf(fileconf.HasEntry(testEntry) ? wxT("ERROR\n") : wxT("ok\n"));
}
#endif // TEST_FILECONF
wxString vol, path, name, ext;
wxFileName::SplitPath(full, &vol, &path, &name, &ext);
- wxPrintf(_T("'%s'-> vol '%s', path '%s', name '%s', ext '%s'\n"),
+ wxPrintf(wxT("'%s'-> vol '%s', path '%s', name '%s', ext '%s'\n"),
full.c_str(), vol.c_str(), path.c_str(), name.c_str(), ext.c_str());
wxFileName::SplitPath(full, &path, &name, &ext);
- wxPrintf(_T("or\t\t-> path '%s', name '%s', ext '%s'\n"),
+ wxPrintf(wxT("or\t\t-> path '%s', name '%s', ext '%s'\n"),
path.c_str(), name.c_str(), ext.c_str());
- wxPrintf(_T("path is also:\t'%s'\n"), fn.GetPath().c_str());
- wxPrintf(_T("with volume: \t'%s'\n"),
+ wxPrintf(wxT("path is also:\t'%s'\n"), fn.GetPath().c_str());
+ wxPrintf(wxT("with volume: \t'%s'\n"),
fn.GetPath(wxPATH_GET_VOLUME).c_str());
- wxPrintf(_T("with separator:\t'%s'\n"),
+ wxPrintf(wxT("with separator:\t'%s'\n"),
fn.GetPath(wxPATH_GET_SEPARATOR).c_str());
- wxPrintf(_T("with both: \t'%s'\n"),
+ wxPrintf(wxT("with both: \t'%s'\n"),
fn.GetPath(wxPATH_GET_SEPARATOR | wxPATH_GET_VOLUME).c_str());
- wxPuts(_T("The directories in the path are:"));
+ wxPuts(wxT("The directories in the path are:"));
wxArrayString dirs = fn.GetDirs();
size_t count = dirs.GetCount();
for ( size_t n = 0; n < count; n++ )
{
- wxPrintf(_T("\t%u: %s\n"), n, dirs[n].c_str());
+ wxPrintf(wxT("\t%u: %s\n"), n, dirs[n].c_str());
}
}
#endif
static void TestFileNameTemp()
{
- wxPuts(_T("*** testing wxFileName temp file creation ***"));
+ wxPuts(wxT("*** testing wxFileName temp file creation ***"));
static const wxChar *tmpprefixes[] =
{
- _T(""),
- _T("foo"),
- _T(".."),
- _T("../bar"),
+ wxT(""),
+ wxT("foo"),
+ wxT(".."),
+ wxT("../bar"),
#ifdef __UNIX__
- _T("/tmp/foo"),
- _T("/tmp/foo/bar"), // this one must be an error
+ wxT("/tmp/foo"),
+ wxT("/tmp/foo/bar"), // this one must be an error
#endif // __UNIX__
};
if ( path.empty() )
{
// "error" is not in upper case because it may be ok
- wxPrintf(_T("Prefix '%s'\t-> error\n"), tmpprefixes[n]);
+ wxPrintf(wxT("Prefix '%s'\t-> error\n"), tmpprefixes[n]);
}
else
{
- wxPrintf(_T("Prefix '%s'\t-> temp file '%s'\n"),
+ wxPrintf(wxT("Prefix '%s'\t-> temp file '%s'\n"),
tmpprefixes[n], path.c_str());
if ( !wxRemoveFile(path) )
{
- wxLogWarning(_T("Failed to remove temp file '%s'"),
+ wxLogWarning(wxT("Failed to remove temp file '%s'"),
path.c_str());
}
}
static void TestFileGetTimes()
{
- wxFileName fn(_T("testdata.fc"));
+ wxFileName fn(wxT("testdata.fc"));
wxDateTime dtAccess, dtMod, dtCreate;
if ( !fn.GetTimes(&dtAccess, &dtMod, &dtCreate) )
{
- wxPrintf(_T("ERROR: GetTimes() failed.\n"));
+ wxPrintf(wxT("ERROR: GetTimes() failed.\n"));
}
else
{
- static const wxChar *fmt = _T("%Y-%b-%d %H:%M:%S");
+ static const wxChar *fmt = wxT("%Y-%b-%d %H:%M:%S");
- wxPrintf(_T("File times for '%s':\n"), fn.GetFullPath().c_str());
- wxPrintf(_T("Creation: \t%s\n"), dtCreate.Format(fmt).c_str());
- wxPrintf(_T("Last read: \t%s\n"), dtAccess.Format(fmt).c_str());
- wxPrintf(_T("Last write: \t%s\n"), dtMod.Format(fmt).c_str());
+ wxPrintf(wxT("File times for '%s':\n"), fn.GetFullPath().c_str());
+ wxPrintf(wxT("Creation: \t%s\n"), dtCreate.Format(fmt).c_str());
+ wxPrintf(wxT("Last read: \t%s\n"), dtAccess.Format(fmt).c_str());
+ wxPrintf(wxT("Last write: \t%s\n"), dtMod.Format(fmt).c_str());
}
}
#if 0
static void TestFileSetTimes()
{
- wxFileName fn(_T("testdata.fc"));
+ wxFileName fn(wxT("testdata.fc"));
if ( !fn.Touch() )
{
- wxPrintf(_T("ERROR: Touch() failed.\n"));
+ wxPrintf(wxT("ERROR: Touch() failed.\n"));
}
}
#endif
{
static const wxChar *languageNames[] =
{
- _T("DEFAULT"),
- _T("UNKNOWN"),
- _T("ABKHAZIAN"),
- _T("AFAR"),
- _T("AFRIKAANS"),
- _T("ALBANIAN"),
- _T("AMHARIC"),
- _T("ARABIC"),
- _T("ARABIC_ALGERIA"),
- _T("ARABIC_BAHRAIN"),
- _T("ARABIC_EGYPT"),
- _T("ARABIC_IRAQ"),
- _T("ARABIC_JORDAN"),
- _T("ARABIC_KUWAIT"),
- _T("ARABIC_LEBANON"),
- _T("ARABIC_LIBYA"),
- _T("ARABIC_MOROCCO"),
- _T("ARABIC_OMAN"),
- _T("ARABIC_QATAR"),
- _T("ARABIC_SAUDI_ARABIA"),
- _T("ARABIC_SUDAN"),
- _T("ARABIC_SYRIA"),
- _T("ARABIC_TUNISIA"),
- _T("ARABIC_UAE"),
- _T("ARABIC_YEMEN"),
- _T("ARMENIAN"),
- _T("ASSAMESE"),
- _T("AYMARA"),
- _T("AZERI"),
- _T("AZERI_CYRILLIC"),
- _T("AZERI_LATIN"),
- _T("BASHKIR"),
- _T("BASQUE"),
- _T("BELARUSIAN"),
- _T("BENGALI"),
- _T("BHUTANI"),
- _T("BIHARI"),
- _T("BISLAMA"),
- _T("BRETON"),
- _T("BULGARIAN"),
- _T("BURMESE"),
- _T("CAMBODIAN"),
- _T("CATALAN"),
- _T("CHINESE"),
- _T("CHINESE_SIMPLIFIED"),
- _T("CHINESE_TRADITIONAL"),
- _T("CHINESE_HONGKONG"),
- _T("CHINESE_MACAU"),
- _T("CHINESE_SINGAPORE"),
- _T("CHINESE_TAIWAN"),
- _T("CORSICAN"),
- _T("CROATIAN"),
- _T("CZECH"),
- _T("DANISH"),
- _T("DUTCH"),
- _T("DUTCH_BELGIAN"),
- _T("ENGLISH"),
- _T("ENGLISH_UK"),
- _T("ENGLISH_US"),
- _T("ENGLISH_AUSTRALIA"),
- _T("ENGLISH_BELIZE"),
- _T("ENGLISH_BOTSWANA"),
- _T("ENGLISH_CANADA"),
- _T("ENGLISH_CARIBBEAN"),
- _T("ENGLISH_DENMARK"),
- _T("ENGLISH_EIRE"),
- _T("ENGLISH_JAMAICA"),
- _T("ENGLISH_NEW_ZEALAND"),
- _T("ENGLISH_PHILIPPINES"),
- _T("ENGLISH_SOUTH_AFRICA"),
- _T("ENGLISH_TRINIDAD"),
- _T("ENGLISH_ZIMBABWE"),
- _T("ESPERANTO"),
- _T("ESTONIAN"),
- _T("FAEROESE"),
- _T("FARSI"),
- _T("FIJI"),
- _T("FINNISH"),
- _T("FRENCH"),
- _T("FRENCH_BELGIAN"),
- _T("FRENCH_CANADIAN"),
- _T("FRENCH_LUXEMBOURG"),
- _T("FRENCH_MONACO"),
- _T("FRENCH_SWISS"),
- _T("FRISIAN"),
- _T("GALICIAN"),
- _T("GEORGIAN"),
- _T("GERMAN"),
- _T("GERMAN_AUSTRIAN"),
- _T("GERMAN_BELGIUM"),
- _T("GERMAN_LIECHTENSTEIN"),
- _T("GERMAN_LUXEMBOURG"),
- _T("GERMAN_SWISS"),
- _T("GREEK"),
- _T("GREENLANDIC"),
- _T("GUARANI"),
- _T("GUJARATI"),
- _T("HAUSA"),
- _T("HEBREW"),
- _T("HINDI"),
- _T("HUNGARIAN"),
- _T("ICELANDIC"),
- _T("INDONESIAN"),
- _T("INTERLINGUA"),
- _T("INTERLINGUE"),
- _T("INUKTITUT"),
- _T("INUPIAK"),
- _T("IRISH"),
- _T("ITALIAN"),
- _T("ITALIAN_SWISS"),
- _T("JAPANESE"),
- _T("JAVANESE"),
- _T("KANNADA"),
- _T("KASHMIRI"),
- _T("KASHMIRI_INDIA"),
- _T("KAZAKH"),
- _T("KERNEWEK"),
- _T("KINYARWANDA"),
- _T("KIRGHIZ"),
- _T("KIRUNDI"),
- _T("KONKANI"),
- _T("KOREAN"),
- _T("KURDISH"),
- _T("LAOTHIAN"),
- _T("LATIN"),
- _T("LATVIAN"),
- _T("LINGALA"),
- _T("LITHUANIAN"),
- _T("MACEDONIAN"),
- _T("MALAGASY"),
- _T("MALAY"),
- _T("MALAYALAM"),
- _T("MALAY_BRUNEI_DARUSSALAM"),
- _T("MALAY_MALAYSIA"),
- _T("MALTESE"),
- _T("MANIPURI"),
- _T("MAORI"),
- _T("MARATHI"),
- _T("MOLDAVIAN"),
- _T("MONGOLIAN"),
- _T("NAURU"),
- _T("NEPALI"),
- _T("NEPALI_INDIA"),
- _T("NORWEGIAN_BOKMAL"),
- _T("NORWEGIAN_NYNORSK"),
- _T("OCCITAN"),
- _T("ORIYA"),
- _T("OROMO"),
- _T("PASHTO"),
- _T("POLISH"),
- _T("PORTUGUESE"),
- _T("PORTUGUESE_BRAZILIAN"),
- _T("PUNJABI"),
- _T("QUECHUA"),
- _T("RHAETO_ROMANCE"),
- _T("ROMANIAN"),
- _T("RUSSIAN"),
- _T("RUSSIAN_UKRAINE"),
- _T("SAMOAN"),
- _T("SANGHO"),
- _T("SANSKRIT"),
- _T("SCOTS_GAELIC"),
- _T("SERBIAN"),
- _T("SERBIAN_CYRILLIC"),
- _T("SERBIAN_LATIN"),
- _T("SERBO_CROATIAN"),
- _T("SESOTHO"),
- _T("SETSWANA"),
- _T("SHONA"),
- _T("SINDHI"),
- _T("SINHALESE"),
- _T("SISWATI"),
- _T("SLOVAK"),
- _T("SLOVENIAN"),
- _T("SOMALI"),
- _T("SPANISH"),
- _T("SPANISH_ARGENTINA"),
- _T("SPANISH_BOLIVIA"),
- _T("SPANISH_CHILE"),
- _T("SPANISH_COLOMBIA"),
- _T("SPANISH_COSTA_RICA"),
- _T("SPANISH_DOMINICAN_REPUBLIC"),
- _T("SPANISH_ECUADOR"),
- _T("SPANISH_EL_SALVADOR"),
- _T("SPANISH_GUATEMALA"),
- _T("SPANISH_HONDURAS"),
- _T("SPANISH_MEXICAN"),
- _T("SPANISH_MODERN"),
- _T("SPANISH_NICARAGUA"),
- _T("SPANISH_PANAMA"),
- _T("SPANISH_PARAGUAY"),
- _T("SPANISH_PERU"),
- _T("SPANISH_PUERTO_RICO"),
- _T("SPANISH_URUGUAY"),
- _T("SPANISH_US"),
- _T("SPANISH_VENEZUELA"),
- _T("SUNDANESE"),
- _T("SWAHILI"),
- _T("SWEDISH"),
- _T("SWEDISH_FINLAND"),
- _T("TAGALOG"),
- _T("TAJIK"),
- _T("TAMIL"),
- _T("TATAR"),
- _T("TELUGU"),
- _T("THAI"),
- _T("TIBETAN"),
- _T("TIGRINYA"),
- _T("TONGA"),
- _T("TSONGA"),
- _T("TURKISH"),
- _T("TURKMEN"),
- _T("TWI"),
- _T("UIGHUR"),
- _T("UKRAINIAN"),
- _T("URDU"),
- _T("URDU_INDIA"),
- _T("URDU_PAKISTAN"),
- _T("UZBEK"),
- _T("UZBEK_CYRILLIC"),
- _T("UZBEK_LATIN"),
- _T("VIETNAMESE"),
- _T("VOLAPUK"),
- _T("WELSH"),
- _T("WOLOF"),
- _T("XHOSA"),
- _T("YIDDISH"),
- _T("YORUBA"),
- _T("ZHUANG"),
- _T("ZULU"),
+ wxT("DEFAULT"),
+ wxT("UNKNOWN"),
+ wxT("ABKHAZIAN"),
+ wxT("AFAR"),
+ wxT("AFRIKAANS"),
+ wxT("ALBANIAN"),
+ wxT("AMHARIC"),
+ wxT("ARABIC"),
+ wxT("ARABIC_ALGERIA"),
+ wxT("ARABIC_BAHRAIN"),
+ wxT("ARABIC_EGYPT"),
+ wxT("ARABIC_IRAQ"),
+ wxT("ARABIC_JORDAN"),
+ wxT("ARABIC_KUWAIT"),
+ wxT("ARABIC_LEBANON"),
+ wxT("ARABIC_LIBYA"),
+ wxT("ARABIC_MOROCCO"),
+ wxT("ARABIC_OMAN"),
+ wxT("ARABIC_QATAR"),
+ wxT("ARABIC_SAUDI_ARABIA"),
+ wxT("ARABIC_SUDAN"),
+ wxT("ARABIC_SYRIA"),
+ wxT("ARABIC_TUNISIA"),
+ wxT("ARABIC_UAE"),
+ wxT("ARABIC_YEMEN"),
+ wxT("ARMENIAN"),
+ wxT("ASSAMESE"),
+ wxT("AYMARA"),
+ wxT("AZERI"),
+ wxT("AZERI_CYRILLIC"),
+ wxT("AZERI_LATIN"),
+ wxT("BASHKIR"),
+ wxT("BASQUE"),
+ wxT("BELARUSIAN"),
+ wxT("BENGALI"),
+ wxT("BHUTANI"),
+ wxT("BIHARI"),
+ wxT("BISLAMA"),
+ wxT("BRETON"),
+ wxT("BULGARIAN"),
+ wxT("BURMESE"),
+ wxT("CAMBODIAN"),
+ wxT("CATALAN"),
+ wxT("CHINESE"),
+ wxT("CHINESE_SIMPLIFIED"),
+ wxT("CHINESE_TRADITIONAL"),
+ wxT("CHINESE_HONGKONG"),
+ wxT("CHINESE_MACAU"),
+ wxT("CHINESE_SINGAPORE"),
+ wxT("CHINESE_TAIWAN"),
+ wxT("CORSICAN"),
+ wxT("CROATIAN"),
+ wxT("CZECH"),
+ wxT("DANISH"),
+ wxT("DUTCH"),
+ wxT("DUTCH_BELGIAN"),
+ wxT("ENGLISH"),
+ wxT("ENGLISH_UK"),
+ wxT("ENGLISH_US"),
+ wxT("ENGLISH_AUSTRALIA"),
+ wxT("ENGLISH_BELIZE"),
+ wxT("ENGLISH_BOTSWANA"),
+ wxT("ENGLISH_CANADA"),
+ wxT("ENGLISH_CARIBBEAN"),
+ wxT("ENGLISH_DENMARK"),
+ wxT("ENGLISH_EIRE"),
+ wxT("ENGLISH_JAMAICA"),
+ wxT("ENGLISH_NEW_ZEALAND"),
+ wxT("ENGLISH_PHILIPPINES"),
+ wxT("ENGLISH_SOUTH_AFRICA"),
+ wxT("ENGLISH_TRINIDAD"),
+ wxT("ENGLISH_ZIMBABWE"),
+ wxT("ESPERANTO"),
+ wxT("ESTONIAN"),
+ wxT("FAEROESE"),
+ wxT("FARSI"),
+ wxT("FIJI"),
+ wxT("FINNISH"),
+ wxT("FRENCH"),
+ wxT("FRENCH_BELGIAN"),
+ wxT("FRENCH_CANADIAN"),
+ wxT("FRENCH_LUXEMBOURG"),
+ wxT("FRENCH_MONACO"),
+ wxT("FRENCH_SWISS"),
+ wxT("FRISIAN"),
+ wxT("GALICIAN"),
+ wxT("GEORGIAN"),
+ wxT("GERMAN"),
+ wxT("GERMAN_AUSTRIAN"),
+ wxT("GERMAN_BELGIUM"),
+ wxT("GERMAN_LIECHTENSTEIN"),
+ wxT("GERMAN_LUXEMBOURG"),
+ wxT("GERMAN_SWISS"),
+ wxT("GREEK"),
+ wxT("GREENLANDIC"),
+ wxT("GUARANI"),
+ wxT("GUJARATI"),
+ wxT("HAUSA"),
+ wxT("HEBREW"),
+ wxT("HINDI"),
+ wxT("HUNGARIAN"),
+ wxT("ICELANDIC"),
+ wxT("INDONESIAN"),
+ wxT("INTERLINGUA"),
+ wxT("INTERLINGUE"),
+ wxT("INUKTITUT"),
+ wxT("INUPIAK"),
+ wxT("IRISH"),
+ wxT("ITALIAN"),
+ wxT("ITALIAN_SWISS"),
+ wxT("JAPANESE"),
+ wxT("JAVANESE"),
+ wxT("KANNADA"),
+ wxT("KASHMIRI"),
+ wxT("KASHMIRI_INDIA"),
+ wxT("KAZAKH"),
+ wxT("KERNEWEK"),
+ wxT("KINYARWANDA"),
+ wxT("KIRGHIZ"),
+ wxT("KIRUNDI"),
+ wxT("KONKANI"),
+ wxT("KOREAN"),
+ wxT("KURDISH"),
+ wxT("LAOTHIAN"),
+ wxT("LATIN"),
+ wxT("LATVIAN"),
+ wxT("LINGALA"),
+ wxT("LITHUANIAN"),
+ wxT("MACEDONIAN"),
+ wxT("MALAGASY"),
+ wxT("MALAY"),
+ wxT("MALAYALAM"),
+ wxT("MALAY_BRUNEI_DARUSSALAM"),
+ wxT("MALAY_MALAYSIA"),
+ wxT("MALTESE"),
+ wxT("MANIPURI"),
+ wxT("MAORI"),
+ wxT("MARATHI"),
+ wxT("MOLDAVIAN"),
+ wxT("MONGOLIAN"),
+ wxT("NAURU"),
+ wxT("NEPALI"),
+ wxT("NEPALI_INDIA"),
+ wxT("NORWEGIAN_BOKMAL"),
+ wxT("NORWEGIAN_NYNORSK"),
+ wxT("OCCITAN"),
+ wxT("ORIYA"),
+ wxT("OROMO"),
+ wxT("PASHTO"),
+ wxT("POLISH"),
+ wxT("PORTUGUESE"),
+ wxT("PORTUGUESE_BRAZILIAN"),
+ wxT("PUNJABI"),
+ wxT("QUECHUA"),
+ wxT("RHAETO_ROMANCE"),
+ wxT("ROMANIAN"),
+ wxT("RUSSIAN"),
+ wxT("RUSSIAN_UKRAINE"),
+ wxT("SAMOAN"),
+ wxT("SANGHO"),
+ wxT("SANSKRIT"),
+ wxT("SCOTS_GAELIC"),
+ wxT("SERBIAN"),
+ wxT("SERBIAN_CYRILLIC"),
+ wxT("SERBIAN_LATIN"),
+ wxT("SERBO_CROATIAN"),
+ wxT("SESOTHO"),
+ wxT("SETSWANA"),
+ wxT("SHONA"),
+ wxT("SINDHI"),
+ wxT("SINHALESE"),
+ wxT("SISWATI"),
+ wxT("SLOVAK"),
+ wxT("SLOVENIAN"),
+ wxT("SOMALI"),
+ wxT("SPANISH"),
+ wxT("SPANISH_ARGENTINA"),
+ wxT("SPANISH_BOLIVIA"),
+ wxT("SPANISH_CHILE"),
+ wxT("SPANISH_COLOMBIA"),
+ wxT("SPANISH_COSTA_RICA"),
+ wxT("SPANISH_DOMINICAN_REPUBLIC"),
+ wxT("SPANISH_ECUADOR"),
+ wxT("SPANISH_EL_SALVADOR"),
+ wxT("SPANISH_GUATEMALA"),
+ wxT("SPANISH_HONDURAS"),
+ wxT("SPANISH_MEXICAN"),
+ wxT("SPANISH_MODERN"),
+ wxT("SPANISH_NICARAGUA"),
+ wxT("SPANISH_PANAMA"),
+ wxT("SPANISH_PARAGUAY"),
+ wxT("SPANISH_PERU"),
+ wxT("SPANISH_PUERTO_RICO"),
+ wxT("SPANISH_URUGUAY"),
+ wxT("SPANISH_US"),
+ wxT("SPANISH_VENEZUELA"),
+ wxT("SUNDANESE"),
+ wxT("SWAHILI"),
+ wxT("SWEDISH"),
+ wxT("SWEDISH_FINLAND"),
+ wxT("TAGALOG"),
+ wxT("TAJIK"),
+ wxT("TAMIL"),
+ wxT("TATAR"),
+ wxT("TELUGU"),
+ wxT("THAI"),
+ wxT("TIBETAN"),
+ wxT("TIGRINYA"),
+ wxT("TONGA"),
+ wxT("TSONGA"),
+ wxT("TURKISH"),
+ wxT("TURKMEN"),
+ wxT("TWI"),
+ wxT("UIGHUR"),
+ wxT("UKRAINIAN"),
+ wxT("URDU"),
+ wxT("URDU_INDIA"),
+ wxT("URDU_PAKISTAN"),
+ wxT("UZBEK"),
+ wxT("UZBEK_CYRILLIC"),
+ wxT("UZBEK_LATIN"),
+ wxT("VIETNAMESE"),
+ wxT("VOLAPUK"),
+ wxT("WELSH"),
+ wxT("WOLOF"),
+ wxT("XHOSA"),
+ wxT("YIDDISH"),
+ wxT("YORUBA"),
+ wxT("ZHUANG"),
+ wxT("ZULU"),
};
if ( (size_t)lang < WXSIZEOF(languageNames) )
return languageNames[lang];
else
- return _T("INVALID");
+ return wxT("INVALID");
}
static void TestDefaultLang()
{
- wxPuts(_T("*** Testing wxLocale::GetSystemLanguage ***"));
+ wxPuts(wxT("*** Testing wxLocale::GetSystemLanguage ***"));
gs_localeDefault.Init(wxLANGUAGE_ENGLISH);
static const wxChar *langStrings[] =
{
NULL, // system default
- _T("C"),
- _T("fr"),
- _T("fr_FR"),
- _T("en"),
- _T("en_GB"),
- _T("en_US"),
- _T("de_DE.iso88591"),
- _T("german"),
- _T("?"), // invalid lang spec
- _T("klingonese"), // I bet on some systems it does exist...
+ wxT("C"),
+ wxT("fr"),
+ wxT("fr_FR"),
+ wxT("en"),
+ wxT("en_GB"),
+ wxT("en_US"),
+ wxT("de_DE.iso88591"),
+ wxT("german"),
+ wxT("?"), // invalid lang spec
+ wxT("klingonese"), // I bet on some systems it does exist...
};
- wxPrintf(_T("The default system encoding is %s (%d)\n"),
+ wxPrintf(wxT("The default system encoding is %s (%d)\n"),
wxLocale::GetSystemEncodingName().c_str(),
wxLocale::GetSystemEncoding());
{
// FIXME: this doesn't do anything at all under Windows, we need
// to create a new wxLocale!
- wxSetEnv(_T("LC_ALL"), langStr);
+ wxSetEnv(wxT("LC_ALL"), langStr);
}
int lang = gs_localeDefault.GetSystemLanguage();
- wxPrintf(_T("Locale for '%s' is %s.\n"),
- langStr ? langStr : _T("system default"), GetLangName(lang));
+ wxPrintf(wxT("Locale for '%s' is %s.\n"),
+ langStr ? langStr : wxT("system default"), GetLangName(lang));
}
}
static void TestMimeEnum()
{
- wxPuts(_T("*** Testing wxMimeTypesManager::EnumAllFileTypes() ***\n"));
+ wxPuts(wxT("*** Testing wxMimeTypesManager::EnumAllFileTypes() ***\n"));
wxArrayString mimetypes;
size_t count = wxTheMimeTypesManager->EnumAllFileTypes(mimetypes);
- wxPrintf(_T("*** All %u known filetypes: ***\n"), count);
+ wxPrintf(wxT("*** All %u known filetypes: ***\n"), count);
wxArrayString exts;
wxString desc;
wxTheMimeTypesManager->GetFileTypeFromMimeType(mimetypes[n]);
if ( !filetype )
{
- wxPrintf(_T("nothing known about the filetype '%s'!\n"),
+ wxPrintf(wxT("nothing known about the filetype '%s'!\n"),
mimetypes[n].c_str());
continue;
}
for ( size_t e = 0; e < exts.GetCount(); e++ )
{
if ( e > 0 )
- extsAll << _T(", ");
+ extsAll << wxT(", ");
extsAll += exts[e];
}
- wxPrintf(_T("\t%s: %s (%s)\n"),
+ wxPrintf(wxT("\t%s: %s (%s)\n"),
mimetypes[n].c_str(), desc.c_str(), extsAll.c_str());
}
static void TestMimeFilename()
{
- wxPuts(_T("*** Testing MIME type from filename query ***\n"));
+ wxPuts(wxT("*** Testing MIME type from filename query ***\n"));
static const wxChar *filenames[] =
{
- _T("readme.txt"),
- _T("document.pdf"),
- _T("image.gif"),
- _T("picture.jpeg"),
+ wxT("readme.txt"),
+ wxT("document.pdf"),
+ wxT("image.gif"),
+ wxT("picture.jpeg"),
};
for ( size_t n = 0; n < WXSIZEOF(filenames); n++ )
{
const wxString fname = filenames[n];
- wxString ext = fname.AfterLast(_T('.'));
+ wxString ext = fname.AfterLast(wxT('.'));
wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(ext);
if ( !ft )
{
- wxPrintf(_T("WARNING: extension '%s' is unknown.\n"), ext.c_str());
+ wxPrintf(wxT("WARNING: extension '%s' is unknown.\n"), ext.c_str());
}
else
{
wxString desc;
if ( !ft->GetDescription(&desc) )
- desc = _T("<no description>");
+ desc = wxT("<no description>");
wxString cmd;
if ( !ft->GetOpenCommand(&cmd,
wxFileType::MessageParameters(fname, wxEmptyString)) )
- cmd = _T("<no command available>");
+ cmd = wxT("<no command available>");
else
- cmd = wxString(_T('"')) + cmd + _T('"');
+ cmd = wxString(wxT('"')) + cmd + wxT('"');
- wxPrintf(_T("To open %s (%s) do %s.\n"),
+ wxPrintf(wxT("To open %s (%s) do %s.\n"),
fname.c_str(), desc.c_str(), cmd.c_str());
delete ft;
static void TestMimeOverride()
{
- wxPuts(_T("*** Testing wxMimeTypesManager additional files loading ***\n"));
+ wxPuts(wxT("*** Testing wxMimeTypesManager additional files loading ***\n"));
- static const wxChar *mailcap = _T("/tmp/mailcap");
- static const wxChar *mimetypes = _T("/tmp/mime.types");
+ static const wxChar *mailcap = wxT("/tmp/mailcap");
+ static const wxChar *mimetypes = wxT("/tmp/mime.types");
if ( wxFile::Exists(mailcap) )
- wxPrintf(_T("Loading mailcap from '%s': %s\n"),
+ wxPrintf(wxT("Loading mailcap from '%s': %s\n"),
mailcap,
- wxTheMimeTypesManager->ReadMailcap(mailcap) ? _T("ok") : _T("ERROR"));
+ wxTheMimeTypesManager->ReadMailcap(mailcap) ? wxT("ok") : wxT("ERROR"));
else
- wxPrintf(_T("WARN: mailcap file '%s' doesn't exist, not loaded.\n"),
+ wxPrintf(wxT("WARN: mailcap file '%s' doesn't exist, not loaded.\n"),
mailcap);
if ( wxFile::Exists(mimetypes) )
- wxPrintf(_T("Loading mime.types from '%s': %s\n"),
+ wxPrintf(wxT("Loading mime.types from '%s': %s\n"),
mimetypes,
- wxTheMimeTypesManager->ReadMimeTypes(mimetypes) ? _T("ok") : _T("ERROR"));
+ wxTheMimeTypesManager->ReadMimeTypes(mimetypes) ? wxT("ok") : wxT("ERROR"));
else
- wxPrintf(_T("WARN: mime.types file '%s' doesn't exist, not loaded.\n"),
+ wxPrintf(wxT("WARN: mime.types file '%s' doesn't exist, not loaded.\n"),
mimetypes);
wxPuts(wxEmptyString);
static void TestMimeAssociate()
{
- wxPuts(_T("*** Testing creation of filetype association ***\n"));
+ wxPuts(wxT("*** Testing creation of filetype association ***\n"));
wxFileTypeInfo ftInfo(
- _T("application/x-xyz"),
- _T("xyzview '%s'"), // open cmd
- _T(""), // print cmd
- _T("XYZ File"), // description
- _T(".xyz"), // extensions
+ wxT("application/x-xyz"),
+ wxT("xyzview '%s'"), // open cmd
+ wxT(""), // print cmd
+ wxT("XYZ File"), // description
+ wxT(".xyz"), // extensions
wxNullPtr // end of extensions
);
- ftInfo.SetShortDesc(_T("XYZFile")); // used under Win32 only
+ ftInfo.SetShortDesc(wxT("XYZFile")); // used under Win32 only
wxFileType *ft = wxTheMimeTypesManager->Associate(ftInfo);
if ( !ft )
{
- wxPuts(_T("ERROR: failed to create association!"));
+ wxPuts(wxT("ERROR: failed to create association!"));
}
else
{
class wxTestModule : public wxModule
{
protected:
- virtual bool OnInit() { wxPrintf(_T("Load module: %s\n"), GetClassInfo()->GetClassName()); return true; }
- virtual void OnExit() { wxPrintf(_T("Unload module: %s\n"), GetClassInfo()->GetClassName()); }
+ virtual bool OnInit() { wxPrintf(wxT("Load module: %s\n"), GetClassInfo()->GetClassName()); return true; }
+ virtual void OnExit() { wxPrintf(wxT("Unload module: %s\n"), GetClassInfo()->GetClassName()); }
};
class wxTestModuleA : public wxTestModule
#if TEST_INTERACTIVE
static void TestDiskInfo()
{
- wxPuts(_T("*** Testing wxGetDiskSpace() ***"));
+ wxPuts(wxT("*** Testing wxGetDiskSpace() ***"));
for ( ;; )
{
wxChar pathname[128];
- wxPrintf(_T("\nEnter a directory name: "));
+ wxPrintf(wxT("\nEnter a directory name: "));
if ( !wxFgets(pathname, WXSIZEOF(pathname), stdin) )
break;
wxLongLong total, free;
if ( !wxGetDiskSpace(pathname, &total, &free) )
{
- wxPuts(_T("ERROR: wxGetDiskSpace failed."));
+ wxPuts(wxT("ERROR: wxGetDiskSpace failed."));
}
else
{
- wxPrintf(_T("%sKb total, %sKb free on '%s'.\n"),
+ wxPrintf(wxT("%sKb total, %sKb free on '%s'.\n"),
(total / 1024).ToString().c_str(),
(free / 1024).ToString().c_str(),
pathname);
static void TestOsInfo()
{
- wxPuts(_T("*** Testing OS info functions ***\n"));
+ wxPuts(wxT("*** Testing OS info functions ***\n"));
int major, minor;
wxGetOsVersion(&major, &minor);
- wxPrintf(_T("Running under: %s, version %d.%d\n"),
+ wxPrintf(wxT("Running under: %s, version %d.%d\n"),
wxGetOsDescription().c_str(), major, minor);
- wxPrintf(_T("%ld free bytes of memory left.\n"), wxGetFreeMemory().ToLong());
+ wxPrintf(wxT("%ld free bytes of memory left.\n"), wxGetFreeMemory().ToLong());
- wxPrintf(_T("Host name is %s (%s).\n"),
+ wxPrintf(wxT("Host name is %s (%s).\n"),
wxGetHostName().c_str(), wxGetFullHostName().c_str());
wxPuts(wxEmptyString);
static void TestPlatformInfo()
{
- wxPuts(_T("*** Testing wxPlatformInfo functions ***\n"));
+ wxPuts(wxT("*** Testing wxPlatformInfo functions ***\n"));
// get this platform
wxPlatformInfo plat;
- wxPrintf(_T("Operating system family name is: %s\n"), plat.GetOperatingSystemFamilyName().c_str());
- wxPrintf(_T("Operating system name is: %s\n"), plat.GetOperatingSystemIdName().c_str());
- wxPrintf(_T("Port ID name is: %s\n"), plat.GetPortIdName().c_str());
- wxPrintf(_T("Port ID short name is: %s\n"), plat.GetPortIdShortName().c_str());
- wxPrintf(_T("Architecture is: %s\n"), plat.GetArchName().c_str());
- wxPrintf(_T("Endianness is: %s\n"), plat.GetEndiannessName().c_str());
+ wxPrintf(wxT("Operating system family name is: %s\n"), plat.GetOperatingSystemFamilyName().c_str());
+ wxPrintf(wxT("Operating system name is: %s\n"), plat.GetOperatingSystemIdName().c_str());
+ wxPrintf(wxT("Port ID name is: %s\n"), plat.GetPortIdName().c_str());
+ wxPrintf(wxT("Port ID short name is: %s\n"), plat.GetPortIdShortName().c_str());
+ wxPrintf(wxT("Architecture is: %s\n"), plat.GetArchName().c_str());
+ wxPrintf(wxT("Endianness is: %s\n"), plat.GetEndiannessName().c_str());
wxPuts(wxEmptyString);
}
static void TestUserInfo()
{
- wxPuts(_T("*** Testing user info functions ***\n"));
+ wxPuts(wxT("*** Testing user info functions ***\n"));
- wxPrintf(_T("User id is:\t%s\n"), wxGetUserId().c_str());
- wxPrintf(_T("User name is:\t%s\n"), wxGetUserName().c_str());
- wxPrintf(_T("Home dir is:\t%s\n"), wxGetHomeDir().c_str());
- wxPrintf(_T("Email address:\t%s\n"), wxGetEmailAddress().c_str());
+ wxPrintf(wxT("User id is:\t%s\n"), wxGetUserId().c_str());
+ wxPrintf(wxT("User name is:\t%s\n"), wxGetUserName().c_str());
+ wxPrintf(wxT("Home dir is:\t%s\n"), wxGetHomeDir().c_str());
+ wxPrintf(wxT("Email address:\t%s\n"), wxGetEmailAddress().c_str());
wxPuts(wxEmptyString);
}
#ifdef TEST_PATHLIST
#ifdef __UNIX__
- #define CMD_IN_PATH _T("ls")
+ #define CMD_IN_PATH wxT("ls")
#else
- #define CMD_IN_PATH _T("command.com")
+ #define CMD_IN_PATH wxT("command.com")
#endif
static void TestPathList()
{
- wxPuts(_T("*** Testing wxPathList ***\n"));
+ wxPuts(wxT("*** Testing wxPathList ***\n"));
wxPathList pathlist;
- pathlist.AddEnvList(_T("PATH"));
+ pathlist.AddEnvList(wxT("PATH"));
wxString path = pathlist.FindValidPath(CMD_IN_PATH);
if ( path.empty() )
{
- wxPrintf(_T("ERROR: command not found in the path.\n"));
+ wxPrintf(wxT("ERROR: command not found in the path.\n"));
}
else
{
- wxPrintf(_T("Command found in the path as '%s'.\n"), path.c_str());
+ wxPrintf(wxT("Command found in the path as '%s'.\n"), path.c_str());
}
}
static void TestRegExInteractive()
{
- wxPuts(_T("*** Testing RE interactively ***"));
+ wxPuts(wxT("*** Testing RE interactively ***"));
for ( ;; )
{
wxChar pattern[128];
- wxPrintf(_T("\nEnter a pattern: "));
+ wxPrintf(wxT("\nEnter a pattern: "));
if ( !wxFgets(pattern, WXSIZEOF(pattern), stdin) )
break;
wxChar text[128];
for ( ;; )
{
- wxPrintf(_T("Enter text to match: "));
+ wxPrintf(wxT("Enter text to match: "));
if ( !wxFgets(text, WXSIZEOF(text), stdin) )
break;
if ( !re.Matches(text) )
{
- wxPrintf(_T("No match.\n"));
+ wxPrintf(wxT("No match.\n"));
}
else
{
- wxPrintf(_T("Pattern matches at '%s'\n"), re.GetMatch(text).c_str());
+ wxPrintf(wxT("Pattern matches at '%s'\n"), re.GetMatch(text).c_str());
size_t start, len;
for ( size_t n = 1; ; n++ )
break;
}
- wxPrintf(_T("Subexpr %u matched '%s'\n"),
+ wxPrintf(wxT("Subexpr %u matched '%s'\n"),
n, wxString(text + start, len).c_str());
}
}
static void
fmtchk (const wxChar *fmt)
{
- (void) wxPrintf(_T("%s:\t`"), fmt);
+ (void) wxPrintf(wxT("%s:\t`"), fmt);
(void) wxPrintf(fmt, 0x12);
- (void) wxPrintf(_T("'\n"));
+ (void) wxPrintf(wxT("'\n"));
}
static void
fmtst1chk (const wxChar *fmt)
{
- (void) wxPrintf(_T("%s:\t`"), fmt);
+ (void) wxPrintf(wxT("%s:\t`"), fmt);
(void) wxPrintf(fmt, 4, 0x12);
- (void) wxPrintf(_T("'\n"));
+ (void) wxPrintf(wxT("'\n"));
}
static void
fmtst2chk (const wxChar *fmt)
{
- (void) wxPrintf(_T("%s:\t`"), fmt);
+ (void) wxPrintf(wxT("%s:\t`"), fmt);
(void) wxPrintf(fmt, 4, 4, 0x12);
- (void) wxPrintf(_T("'\n"));
+ (void) wxPrintf(wxT("'\n"));
}
/* This page is covered by the following copyright: */
wxChar *prefix = buf;
wxChar tp[20];
- wxPuts(_T("\nFormatted output test"));
- wxPrintf(_T("prefix 6d 6o 6x 6X 6u\n"));
- wxStrcpy(prefix, _T("%"));
+ wxPuts(wxT("\nFormatted output test"));
+ wxPrintf(wxT("prefix 6d 6o 6x 6X 6u\n"));
+ wxStrcpy(prefix, wxT("%"));
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
for (k = 0; k < 2; k++) {
for (l = 0; l < 2; l++) {
- wxStrcpy(prefix, _T("%"));
- if (i == 0) wxStrcat(prefix, _T("-"));
- if (j == 0) wxStrcat(prefix, _T("+"));
- if (k == 0) wxStrcat(prefix, _T("#"));
- if (l == 0) wxStrcat(prefix, _T("0"));
- wxPrintf(_T("%5s |"), prefix);
+ wxStrcpy(prefix, wxT("%"));
+ if (i == 0) wxStrcat(prefix, wxT("-"));
+ if (j == 0) wxStrcat(prefix, wxT("+"));
+ if (k == 0) wxStrcat(prefix, wxT("#"));
+ if (l == 0) wxStrcat(prefix, wxT("0"));
+ wxPrintf(wxT("%5s |"), prefix);
wxStrcpy(tp, prefix);
- wxStrcat(tp, _T("6d |"));
+ wxStrcat(tp, wxT("6d |"));
wxPrintf(tp, DEC);
wxStrcpy(tp, prefix);
- wxStrcat(tp, _T("6o |"));
+ wxStrcat(tp, wxT("6o |"));
wxPrintf(tp, INT);
wxStrcpy(tp, prefix);
- wxStrcat(tp, _T("6x |"));
+ wxStrcat(tp, wxT("6x |"));
wxPrintf(tp, INT);
wxStrcpy(tp, prefix);
- wxStrcat(tp, _T("6X |"));
+ wxStrcat(tp, wxT("6X |"));
wxPrintf(tp, INT);
wxStrcpy(tp, prefix);
- wxStrcat(tp, _T("6u |"));
+ wxStrcat(tp, wxT("6u |"));
wxPrintf(tp, UNS);
- wxPrintf(_T("\n"));
+ wxPrintf(wxT("\n"));
}
}
}
}
- wxPrintf(_T("%10s\n"), PointerNull);
- wxPrintf(_T("%-10s\n"), PointerNull);
+ wxPrintf(wxT("%10s\n"), PointerNull);
+ wxPrintf(wxT("%-10s\n"), PointerNull);
}
static void TestPrintf()
{
- static wxChar shortstr[] = _T("Hi, Z.");
- static wxChar longstr[] = _T("Good morning, Doctor Chandra. This is Hal. \
+ static wxChar shortstr[] = wxT("Hi, Z.");
+ static wxChar longstr[] = wxT("Good morning, Doctor Chandra. This is Hal. \
I am ready for my first lesson today.");
int result = 0;
wxString test_format;
- fmtchk(_T("%.4x"));
- fmtchk(_T("%04x"));
- fmtchk(_T("%4.4x"));
- fmtchk(_T("%04.4x"));
- fmtchk(_T("%4.3x"));
- fmtchk(_T("%04.3x"));
+ fmtchk(wxT("%.4x"));
+ fmtchk(wxT("%04x"));
+ fmtchk(wxT("%4.4x"));
+ fmtchk(wxT("%04.4x"));
+ fmtchk(wxT("%4.3x"));
+ fmtchk(wxT("%04.3x"));
- fmtst1chk(_T("%.*x"));
- fmtst1chk(_T("%0*x"));
- fmtst2chk(_T("%*.*x"));
- fmtst2chk(_T("%0*.*x"));
+ fmtst1chk(wxT("%.*x"));
+ fmtst1chk(wxT("%0*x"));
+ fmtst2chk(wxT("%*.*x"));
+ fmtst2chk(wxT("%0*.*x"));
- wxString bad_format = _T("bad format:\t\"%b\"\n");
+ wxString bad_format = wxT("bad format:\t\"%b\"\n");
wxPrintf(bad_format.c_str());
- wxPrintf(_T("nil pointer (padded):\t\"%10p\"\n"), (void *) NULL);
-
- wxPrintf(_T("decimal negative:\t\"%d\"\n"), -2345);
- wxPrintf(_T("octal negative:\t\"%o\"\n"), -2345);
- wxPrintf(_T("hex negative:\t\"%x\"\n"), -2345);
- wxPrintf(_T("long decimal number:\t\"%ld\"\n"), -123456L);
- wxPrintf(_T("long octal negative:\t\"%lo\"\n"), -2345L);
- wxPrintf(_T("long unsigned decimal number:\t\"%lu\"\n"), -123456L);
- wxPrintf(_T("zero-padded LDN:\t\"%010ld\"\n"), -123456L);
- test_format = _T("left-adjusted ZLDN:\t\"%-010ld\"\n");
+ wxPrintf(wxT("nil pointer (padded):\t\"%10p\"\n"), (void *) NULL);
+
+ wxPrintf(wxT("decimal negative:\t\"%d\"\n"), -2345);
+ wxPrintf(wxT("octal negative:\t\"%o\"\n"), -2345);
+ wxPrintf(wxT("hex negative:\t\"%x\"\n"), -2345);
+ wxPrintf(wxT("long decimal number:\t\"%ld\"\n"), -123456L);
+ wxPrintf(wxT("long octal negative:\t\"%lo\"\n"), -2345L);
+ wxPrintf(wxT("long unsigned decimal number:\t\"%lu\"\n"), -123456L);
+ wxPrintf(wxT("zero-padded LDN:\t\"%010ld\"\n"), -123456L);
+ test_format = wxT("left-adjusted ZLDN:\t\"%-010ld\"\n");
wxPrintf(test_format.c_str(), -123456);
- wxPrintf(_T("space-padded LDN:\t\"%10ld\"\n"), -123456L);
- wxPrintf(_T("left-adjusted SLDN:\t\"%-10ld\"\n"), -123456L);
+ wxPrintf(wxT("space-padded LDN:\t\"%10ld\"\n"), -123456L);
+ wxPrintf(wxT("left-adjusted SLDN:\t\"%-10ld\"\n"), -123456L);
- test_format = _T("zero-padded string:\t\"%010s\"\n");
+ test_format = wxT("zero-padded string:\t\"%010s\"\n");
wxPrintf(test_format.c_str(), shortstr);
- test_format = _T("left-adjusted Z string:\t\"%-010s\"\n");
+ test_format = wxT("left-adjusted Z string:\t\"%-010s\"\n");
wxPrintf(test_format.c_str(), shortstr);
- wxPrintf(_T("space-padded string:\t\"%10s\"\n"), shortstr);
- wxPrintf(_T("left-adjusted S string:\t\"%-10s\"\n"), shortstr);
- wxPrintf(_T("null string:\t\"%s\"\n"), PointerNull);
- wxPrintf(_T("limited string:\t\"%.22s\"\n"), longstr);
-
- wxPrintf(_T("e-style >= 1:\t\"%e\"\n"), 12.34);
- wxPrintf(_T("e-style >= .1:\t\"%e\"\n"), 0.1234);
- wxPrintf(_T("e-style < .1:\t\"%e\"\n"), 0.001234);
- wxPrintf(_T("e-style big:\t\"%.60e\"\n"), 1e20);
- wxPrintf(_T("e-style == .1:\t\"%e\"\n"), 0.1);
- wxPrintf(_T("f-style >= 1:\t\"%f\"\n"), 12.34);
- wxPrintf(_T("f-style >= .1:\t\"%f\"\n"), 0.1234);
- wxPrintf(_T("f-style < .1:\t\"%f\"\n"), 0.001234);
- wxPrintf(_T("g-style >= 1:\t\"%g\"\n"), 12.34);
- wxPrintf(_T("g-style >= .1:\t\"%g\"\n"), 0.1234);
- wxPrintf(_T("g-style < .1:\t\"%g\"\n"), 0.001234);
- wxPrintf(_T("g-style big:\t\"%.60g\"\n"), 1e20);
-
- wxPrintf (_T(" %6.5f\n"), .099999999860301614);
- wxPrintf (_T(" %6.5f\n"), .1);
- wxPrintf (_T("x%5.4fx\n"), .5);
-
- wxPrintf (_T("%#03x\n"), 1);
-
- //wxPrintf (_T("something really insane: %.10000f\n"), 1.0);
+ wxPrintf(wxT("space-padded string:\t\"%10s\"\n"), shortstr);
+ wxPrintf(wxT("left-adjusted S string:\t\"%-10s\"\n"), shortstr);
+ wxPrintf(wxT("null string:\t\"%s\"\n"), PointerNull);
+ wxPrintf(wxT("limited string:\t\"%.22s\"\n"), longstr);
+
+ wxPrintf(wxT("e-style >= 1:\t\"%e\"\n"), 12.34);
+ wxPrintf(wxT("e-style >= .1:\t\"%e\"\n"), 0.1234);
+ wxPrintf(wxT("e-style < .1:\t\"%e\"\n"), 0.001234);
+ wxPrintf(wxT("e-style big:\t\"%.60e\"\n"), 1e20);
+ wxPrintf(wxT("e-style == .1:\t\"%e\"\n"), 0.1);
+ wxPrintf(wxT("f-style >= 1:\t\"%f\"\n"), 12.34);
+ wxPrintf(wxT("f-style >= .1:\t\"%f\"\n"), 0.1234);
+ wxPrintf(wxT("f-style < .1:\t\"%f\"\n"), 0.001234);
+ wxPrintf(wxT("g-style >= 1:\t\"%g\"\n"), 12.34);
+ wxPrintf(wxT("g-style >= .1:\t\"%g\"\n"), 0.1234);
+ wxPrintf(wxT("g-style < .1:\t\"%g\"\n"), 0.001234);
+ wxPrintf(wxT("g-style big:\t\"%.60g\"\n"), 1e20);
+
+ wxPrintf (wxT(" %6.5f\n"), .099999999860301614);
+ wxPrintf (wxT(" %6.5f\n"), .1);
+ wxPrintf (wxT("x%5.4fx\n"), .5);
+
+ wxPrintf (wxT("%#03x\n"), 1);
+
+ //wxPrintf (wxT("something really insane: %.10000f\n"), 1.0);
{
double d = FLT_MIN;
int niter = 17;
while (niter-- != 0)
- wxPrintf (_T("%.17e\n"), d / 2);
+ wxPrintf (wxT("%.17e\n"), d / 2);
fflush (stdout);
}
#ifndef __WATCOMC__
// Open Watcom cause compiler error here
// Error! E173: col(24) floating-point constant too small to represent
- wxPrintf (_T("%15.5e\n"), 4.9406564584124654e-324);
+ wxPrintf (wxT("%15.5e\n"), 4.9406564584124654e-324);
#endif
-#define FORMAT _T("|%12.4f|%12.4e|%12.4g|\n")
+#define FORMAT wxT("|%12.4f|%12.4e|%12.4g|\n")
wxPrintf (FORMAT, 0.0, 0.0, 0.0);
wxPrintf (FORMAT, 1.0, 1.0, 1.0);
wxPrintf (FORMAT, -1.0, -1.0, -1.0);
{
wxChar buf[20];
- int rc = wxSnprintf (buf, WXSIZEOF(buf), _T("%30s"), _T("foo"));
+ int rc = wxSnprintf (buf, WXSIZEOF(buf), wxT("%30s"), wxT("foo"));
- wxPrintf(_T("snprintf (\"%%30s\", \"foo\") == %d, \"%.*s\"\n"),
+ wxPrintf(wxT("snprintf (\"%%30s\", \"foo\") == %d, \"%.*s\"\n"),
rc, WXSIZEOF(buf), buf);
#if 0
wxChar buf2[512];
fp_test ();
- wxPrintf (_T("%e should be 1.234568e+06\n"), 1234567.8);
- wxPrintf (_T("%f should be 1234567.800000\n"), 1234567.8);
- wxPrintf (_T("%g should be 1.23457e+06\n"), 1234567.8);
- wxPrintf (_T("%g should be 123.456\n"), 123.456);
- wxPrintf (_T("%g should be 1e+06\n"), 1000000.0);
- wxPrintf (_T("%g should be 10\n"), 10.0);
- wxPrintf (_T("%g should be 0.02\n"), 0.02);
+ wxPrintf (wxT("%e should be 1.234568e+06\n"), 1234567.8);
+ wxPrintf (wxT("%f should be 1234567.800000\n"), 1234567.8);
+ wxPrintf (wxT("%g should be 1.23457e+06\n"), 1234567.8);
+ wxPrintf (wxT("%g should be 123.456\n"), 123.456);
+ wxPrintf (wxT("%g should be 1e+06\n"), 1000000.0);
+ wxPrintf (wxT("%g should be 10\n"), 10.0);
+ wxPrintf (wxT("%g should be 0.02\n"), 0.02);
{
double x=1.0;
- wxPrintf(_T("%.17f\n"),(1.0/x/10.0+1.0)*x-x);
+ wxPrintf(wxT("%.17f\n"),(1.0/x/10.0+1.0)*x-x);
}
{
wxChar buf[200];
- wxSprintf(buf,_T("%*s%*s%*s"),-1,_T("one"),-20,_T("two"),-30,_T("three"));
+ wxSprintf(buf,wxT("%*s%*s%*s"),-1,wxT("one"),-20,wxT("two"),-30,wxT("three"));
result |= wxStrcmp (buf,
- _T("onetwo three "));
+ wxT("onetwo three "));
- wxPuts (result != 0 ? _T("Test failed!") : _T("Test ok."));
+ wxPuts (result != 0 ? wxT("Test failed!") : wxT("Test ok."));
}
#ifdef wxLongLong_t
{
wxChar buf[200];
- wxSprintf(buf, _T("%07") wxLongLongFmtSpec _T("o"), wxLL(040000000000));
+ wxSprintf(buf, wxT("%07") wxLongLongFmtSpec wxT("o"), wxLL(040000000000));
#if 0
// for some reason below line fails under Borland
- wxPrintf (_T("sprintf (buf, \"%%07Lo\", 040000000000ll) = %s"), buf);
+ wxPrintf (wxT("sprintf (buf, \"%%07Lo\", 040000000000ll) = %s"), buf);
#endif
- if (wxStrcmp (buf, _T("40000000000")) != 0)
+ if (wxStrcmp (buf, wxT("40000000000")) != 0)
{
result = 1;
- wxPuts (_T("\tFAILED"));
+ wxPuts (wxT("\tFAILED"));
}
wxUnusedVar(result);
wxPuts (wxEmptyString);
}
#endif // wxLongLong_t
- wxPrintf (_T("printf (\"%%hhu\", %u) = %hhu\n"), UCHAR_MAX + 2, UCHAR_MAX + 2);
- wxPrintf (_T("printf (\"%%hu\", %u) = %hu\n"), USHRT_MAX + 2, USHRT_MAX + 2);
+ wxPrintf (wxT("printf (\"%%hhu\", %u) = %hhu\n"), UCHAR_MAX + 2, UCHAR_MAX + 2);
+ wxPrintf (wxT("printf (\"%%hu\", %u) = %hu\n"), USHRT_MAX + 2, USHRT_MAX + 2);
- wxPuts (_T("--- Should be no further output. ---"));
+ wxPuts (wxT("--- Should be no further output. ---"));
rfg1 ();
rfg2 ();
wxChar buf[20];
memset (bytes, '\xff', sizeof bytes);
- wxSprintf (buf, _T("foo%hhn\n"), &bytes[3]);
+ wxSprintf (buf, wxT("foo%hhn\n"), &bytes[3]);
if (bytes[0] != '\xff' || bytes[1] != '\xff' || bytes[2] != '\xff'
|| bytes[4] != '\xff' || bytes[5] != '\xff' || bytes[6] != '\xff')
{
- wxPuts (_T("%hhn overwrite more bytes"));
+ wxPuts (wxT("%hhn overwrite more bytes"));
result = 1;
}
if (bytes[3] != 3)
{
- wxPuts (_T("%hhn wrote incorrect value"));
+ wxPuts (wxT("%hhn wrote incorrect value"));
result = 1;
}
}
{
wxChar buf[100];
- wxSprintf (buf, _T("%5.s"), _T("xyz"));
- if (wxStrcmp (buf, _T(" ")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" "));
- wxSprintf (buf, _T("%5.f"), 33.3);
- if (wxStrcmp (buf, _T(" 33")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 33"));
- wxSprintf (buf, _T("%8.e"), 33.3e7);
- if (wxStrcmp (buf, _T(" 3e+08")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 3e+08"));
- wxSprintf (buf, _T("%8.E"), 33.3e7);
- if (wxStrcmp (buf, _T(" 3E+08")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 3E+08"));
- wxSprintf (buf, _T("%.g"), 33.3);
- if (wxStrcmp (buf, _T("3e+01")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T("3e+01"));
- wxSprintf (buf, _T("%.G"), 33.3);
- if (wxStrcmp (buf, _T("3E+01")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T("3E+01"));
+ wxSprintf (buf, wxT("%5.s"), wxT("xyz"));
+ if (wxStrcmp (buf, wxT(" ")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" "));
+ wxSprintf (buf, wxT("%5.f"), 33.3);
+ if (wxStrcmp (buf, wxT(" 33")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 33"));
+ wxSprintf (buf, wxT("%8.e"), 33.3e7);
+ if (wxStrcmp (buf, wxT(" 3e+08")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 3e+08"));
+ wxSprintf (buf, wxT("%8.E"), 33.3e7);
+ if (wxStrcmp (buf, wxT(" 3E+08")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 3E+08"));
+ wxSprintf (buf, wxT("%.g"), 33.3);
+ if (wxStrcmp (buf, wxT("3e+01")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT("3e+01"));
+ wxSprintf (buf, wxT("%.G"), 33.3);
+ if (wxStrcmp (buf, wxT("3E+01")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT("3E+01"));
}
static void
wxString test_format;
prec = 0;
- wxSprintf (buf, _T("%.*g"), prec, 3.3);
- if (wxStrcmp (buf, _T("3")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T("3"));
+ wxSprintf (buf, wxT("%.*g"), prec, 3.3);
+ if (wxStrcmp (buf, wxT("3")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT("3"));
prec = 0;
- wxSprintf (buf, _T("%.*G"), prec, 3.3);
- if (wxStrcmp (buf, _T("3")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T("3"));
+ wxSprintf (buf, wxT("%.*G"), prec, 3.3);
+ if (wxStrcmp (buf, wxT("3")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT("3"));
prec = 0;
- wxSprintf (buf, _T("%7.*G"), prec, 3.33);
- if (wxStrcmp (buf, _T(" 3")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 3"));
+ wxSprintf (buf, wxT("%7.*G"), prec, 3.33);
+ if (wxStrcmp (buf, wxT(" 3")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 3"));
prec = 3;
- test_format = _T("%04.*o");
+ test_format = wxT("%04.*o");
wxSprintf (buf, test_format.c_str(), prec, 33);
- if (wxStrcmp (buf, _T(" 041")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 041"));
+ if (wxStrcmp (buf, wxT(" 041")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 041"));
prec = 7;
- test_format = _T("%09.*u");
+ test_format = wxT("%09.*u");
wxSprintf (buf, test_format.c_str(), prec, 33);
- if (wxStrcmp (buf, _T(" 0000033")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 0000033"));
+ if (wxStrcmp (buf, wxT(" 0000033")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 0000033"));
prec = 3;
- test_format = _T("%04.*x");
+ test_format = wxT("%04.*x");
wxSprintf (buf, test_format.c_str(), prec, 33);
- if (wxStrcmp (buf, _T(" 021")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 021"));
+ if (wxStrcmp (buf, wxT(" 021")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 021"));
prec = 3;
- test_format = _T("%04.*X");
+ test_format = wxT("%04.*X");
wxSprintf (buf, test_format.c_str(), prec, 33);
- if (wxStrcmp (buf, _T(" 021")) != 0)
- wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 021"));
+ if (wxStrcmp (buf, wxT(" 021")) != 0)
+ wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 021"));
}
#endif // TEST_PRINTF
#if 0
static void TestRegConfWrite()
{
- wxConfig *config = new wxConfig(_T("myapp"));
- config->SetPath(_T("/group1"));
- config->Write(_T("entry1"), _T("foo"));
- config->SetPath(_T("/group2"));
- config->Write(_T("entry1"), _T("bar"));
+ wxConfig *config = new wxConfig(wxT("myapp"));
+ config->SetPath(wxT("/group1"));
+ config->Write(wxT("entry1"), wxT("foo"));
+ config->SetPath(wxT("/group2"));
+ config->Write(wxT("entry1"), wxT("bar"));
}
#endif
static void TestRegConfRead()
{
- wxRegConfig *config = new wxRegConfig(_T("myapp"));
+ wxRegConfig *config = new wxRegConfig(wxT("myapp"));
wxString str;
long dummy;
- config->SetPath(_T("/"));
- wxPuts(_T("Enumerating / subgroups:"));
+ config->SetPath(wxT("/"));
+ wxPuts(wxT("Enumerating / subgroups:"));
bool bCont = config->GetFirstGroup(str, dummy);
while(bCont)
{
// I chose this one because I liked its name, but it probably only exists under
// NT
static const wxChar *TESTKEY =
- _T("HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Control\\CrashControl");
+ wxT("HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Control\\CrashControl");
static void TestRegistryRead()
{
- wxPuts(_T("*** testing registry reading ***"));
+ wxPuts(wxT("*** testing registry reading ***"));
wxRegKey key(TESTKEY);
- wxPrintf(_T("The test key name is '%s'.\n"), key.GetName().c_str());
+ wxPrintf(wxT("The test key name is '%s'.\n"), key.GetName().c_str());
if ( !key.Open() )
{
- wxPuts(_T("ERROR: test key can't be opened, aborting test."));
+ wxPuts(wxT("ERROR: test key can't be opened, aborting test."));
return;
}
size_t nSubKeys, nValues;
if ( key.GetKeyInfo(&nSubKeys, NULL, &nValues, NULL) )
{
- wxPrintf(_T("It has %u subkeys and %u values.\n"), nSubKeys, nValues);
+ wxPrintf(wxT("It has %u subkeys and %u values.\n"), nSubKeys, nValues);
}
- wxPrintf(_T("Enumerating values:\n"));
+ wxPrintf(wxT("Enumerating values:\n"));
long dummy;
wxString value;
bool cont = key.GetFirstValue(value, dummy);
while ( cont )
{
- wxPrintf(_T("Value '%s': type "), value.c_str());
+ wxPrintf(wxT("Value '%s': type "), value.c_str());
switch ( key.GetValueType(value) )
{
- case wxRegKey::Type_None: wxPrintf(_T("ERROR (none)")); break;
- case wxRegKey::Type_String: wxPrintf(_T("SZ")); break;
- case wxRegKey::Type_Expand_String: wxPrintf(_T("EXPAND_SZ")); break;
- case wxRegKey::Type_Binary: wxPrintf(_T("BINARY")); break;
- case wxRegKey::Type_Dword: wxPrintf(_T("DWORD")); break;
- case wxRegKey::Type_Multi_String: wxPrintf(_T("MULTI_SZ")); break;
- default: wxPrintf(_T("other (unknown)")); break;
+ case wxRegKey::Type_None: wxPrintf(wxT("ERROR (none)")); break;
+ case wxRegKey::Type_String: wxPrintf(wxT("SZ")); break;
+ case wxRegKey::Type_Expand_String: wxPrintf(wxT("EXPAND_SZ")); break;
+ case wxRegKey::Type_Binary: wxPrintf(wxT("BINARY")); break;
+ case wxRegKey::Type_Dword: wxPrintf(wxT("DWORD")); break;
+ case wxRegKey::Type_Multi_String: wxPrintf(wxT("MULTI_SZ")); break;
+ default: wxPrintf(wxT("other (unknown)")); break;
}
- wxPrintf(_T(", value = "));
+ wxPrintf(wxT(", value = "));
if ( key.IsNumericValue(value) )
{
long val;
key.QueryValue(value, &val);
- wxPrintf(_T("%ld"), val);
+ wxPrintf(wxT("%ld"), val);
}
else // string
{
wxString val;
key.QueryValue(value, val);
- wxPrintf(_T("'%s'"), val.c_str());
+ wxPrintf(wxT("'%s'"), val.c_str());
key.QueryRawValue(value, val);
- wxPrintf(_T(" (raw value '%s')"), val.c_str());
+ wxPrintf(wxT(" (raw value '%s')"), val.c_str());
}
wxPutchar('\n');
wxRegKey key;
- key.SetName(_T("HKEY_CLASSES_ROOT\\.ddf") );
+ key.SetName(wxT("HKEY_CLASSES_ROOT\\.ddf") );
key.Create();
- key = _T("ddxf_auto_file") ;
- key.SetName(_T("HKEY_CLASSES_ROOT\\.flo") );
+ key = wxT("ddxf_auto_file") ;
+ key.SetName(wxT("HKEY_CLASSES_ROOT\\.flo") );
key.Create();
- key = _T("ddxf_auto_file") ;
- key.SetName(_T("HKEY_CLASSES_ROOT\\ddxf_auto_file\\DefaultIcon"));
+ key = wxT("ddxf_auto_file") ;
+ key.SetName(wxT("HKEY_CLASSES_ROOT\\ddxf_auto_file\\DefaultIcon"));
key.Create();
- key = _T("program,0") ;
- key.SetName(_T("HKEY_CLASSES_ROOT\\ddxf_auto_file\\shell\\open\\command"));
+ key = wxT("program,0") ;
+ key.SetName(wxT("HKEY_CLASSES_ROOT\\ddxf_auto_file\\shell\\open\\command"));
key.Create();
- key = _T("program \"%1\"") ;
+ key = wxT("program \"%1\"") ;
- key.SetName(_T("HKEY_CLASSES_ROOT\\.ddf") );
+ key.SetName(wxT("HKEY_CLASSES_ROOT\\.ddf") );
key.DeleteSelf();
- key.SetName(_T("HKEY_CLASSES_ROOT\\.flo") );
+ key.SetName(wxT("HKEY_CLASSES_ROOT\\.flo") );
key.DeleteSelf();
- key.SetName(_T("HKEY_CLASSES_ROOT\\ddxf_auto_file\\DefaultIcon"));
+ key.SetName(wxT("HKEY_CLASSES_ROOT\\ddxf_auto_file\\DefaultIcon"));
key.DeleteSelf();
- key.SetName(_T("HKEY_CLASSES_ROOT\\ddxf_auto_file\\shell\\open\\command"));
+ key.SetName(wxT("HKEY_CLASSES_ROOT\\ddxf_auto_file\\shell\\open\\command"));
key.DeleteSelf();
}
static void TestSocketServer()
{
- wxPuts(_T("*** Testing wxSocketServer ***\n"));
+ wxPuts(wxT("*** Testing wxSocketServer ***\n"));
static const int PORT = 3000;
wxSocketServer *server = new wxSocketServer(addr);
if ( !server->Ok() )
{
- wxPuts(_T("ERROR: failed to bind"));
+ wxPuts(wxT("ERROR: failed to bind"));
return;
}
bool quit = false;
while ( !quit )
{
- wxPrintf(_T("Server: waiting for connection on port %d...\n"), PORT);
+ wxPrintf(wxT("Server: waiting for connection on port %d...\n"), PORT);
wxSocketBase *socket = server->Accept();
if ( !socket )
{
- wxPuts(_T("ERROR: wxSocketServer::Accept() failed."));
+ wxPuts(wxT("ERROR: wxSocketServer::Accept() failed."));
break;
}
- wxPuts(_T("Server: got a client."));
+ wxPuts(wxT("Server: got a client."));
server->SetTimeout(60); // 1 min
while ( !close && socket->IsConnected() )
{
wxString s;
- wxChar ch = _T('\0');
+ wxChar ch = wxT('\0');
for ( ;; )
{
if ( socket->Read(&ch, sizeof(ch)).Error() )
// don't log error if the client just close the connection
if ( socket->IsConnected() )
{
- wxPuts(_T("ERROR: in wxSocket::Read."));
+ wxPuts(wxT("ERROR: in wxSocket::Read."));
}
break;
break;
}
- wxPrintf(_T("Server: got '%s'.\n"), s.c_str());
- if ( s == _T("close") )
+ wxPrintf(wxT("Server: got '%s'.\n"), s.c_str());
+ if ( s == wxT("close") )
{
- wxPuts(_T("Closing connection"));
+ wxPuts(wxT("Closing connection"));
close = true;
}
- else if ( s == _T("quit") )
+ else if ( s == wxT("quit") )
{
close =
quit = true;
- wxPuts(_T("Shutting down the server"));
+ wxPuts(wxT("Shutting down the server"));
}
else // not a special command
{
socket->Write(s.MakeUpper().c_str(), s.length());
socket->Write("\r\n", 2);
- wxPrintf(_T("Server: wrote '%s'.\n"), s.c_str());
+ wxPrintf(wxT("Server: wrote '%s'.\n"), s.c_str());
}
}
if ( !close )
{
- wxPuts(_T("Server: lost a client unexpectedly."));
+ wxPuts(wxT("Server: lost a client unexpectedly."));
}
socket->Destroy();
static void TestSocketClient()
{
- wxPuts(_T("*** Testing wxSocketClient ***\n"));
+ wxPuts(wxT("*** Testing wxSocketClient ***\n"));
- static const wxChar *hostname = _T("www.wxwidgets.org");
+ static const wxChar *hostname = wxT("www.wxwidgets.org");
wxIPV4address addr;
addr.Hostname(hostname);
addr.Service(80);
- wxPrintf(_T("--- Attempting to connect to %s:80...\n"), hostname);
+ wxPrintf(wxT("--- Attempting to connect to %s:80...\n"), hostname);
wxSocketClient client;
if ( !client.Connect(addr) )
{
- wxPrintf(_T("ERROR: failed to connect to %s\n"), hostname);
+ wxPrintf(wxT("ERROR: failed to connect to %s\n"), hostname);
}
else
{
- wxPrintf(_T("--- Connected to %s:%u...\n"),
+ wxPrintf(wxT("--- Connected to %s:%u...\n"),
addr.Hostname().c_str(), addr.Service());
wxChar buf[8192];
// could use simply "GET" here I suppose
wxString cmdGet =
- wxString::Format(_T("GET http://%s/\r\n"), hostname);
+ wxString::Format(wxT("GET http://%s/\r\n"), hostname);
client.Write(cmdGet, cmdGet.length());
- wxPrintf(_T("--- Sent command '%s' to the server\n"),
+ wxPrintf(wxT("--- Sent command '%s' to the server\n"),
MakePrintable(cmdGet).c_str());
client.Read(buf, WXSIZEOF(buf));
- wxPrintf(_T("--- Server replied:\n%s"), buf);
+ wxPrintf(wxT("--- Server replied:\n%s"), buf);
}
}
static wxFTP *ftp;
#ifdef FTP_ANONYMOUS
- static const wxChar *directory = _T("/pub");
- static const wxChar *filename = _T("welcome.msg");
+ static const wxChar *directory = wxT("/pub");
+ static const wxChar *filename = wxT("welcome.msg");
#else
- static const wxChar *directory = _T("/etc");
- static const wxChar *filename = _T("issue");
+ static const wxChar *directory = wxT("/etc");
+ static const wxChar *filename = wxT("issue");
#endif
static bool TestFtpConnect()
{
- wxPuts(_T("*** Testing FTP connect ***"));
+ wxPuts(wxT("*** Testing FTP connect ***"));
#ifdef FTP_ANONYMOUS
- static const wxChar *hostname = _T("ftp.wxwidgets.org");
+ static const wxChar *hostname = wxT("ftp.wxwidgets.org");
- wxPrintf(_T("--- Attempting to connect to %s:21 anonymously...\n"), hostname);
+ wxPrintf(wxT("--- Attempting to connect to %s:21 anonymously...\n"), hostname);
#else // !FTP_ANONYMOUS
static const wxChar *hostname = "localhost";
ftp->SetUser(user);
wxChar password[256];
- wxPrintf(_T("Password for %s: "), password);
+ wxPrintf(wxT("Password for %s: "), password);
wxFgets(password, WXSIZEOF(password), stdin);
password[wxStrlen(password) - 1] = '\0'; // chop off '\n'
ftp->SetPassword(password);
- wxPrintf(_T("--- Attempting to connect to %s:21 as %s...\n"), hostname, user);
+ wxPrintf(wxT("--- Attempting to connect to %s:21 as %s...\n"), hostname, user);
#endif // FTP_ANONYMOUS/!FTP_ANONYMOUS
if ( !ftp->Connect(hostname) )
{
- wxPrintf(_T("ERROR: failed to connect to %s\n"), hostname);
+ wxPrintf(wxT("ERROR: failed to connect to %s\n"), hostname);
return false;
}
else
{
- wxPrintf(_T("--- Connected to %s, current directory is '%s'\n"),
+ wxPrintf(wxT("--- Connected to %s, current directory is '%s'\n"),
hostname, ftp->Pwd().c_str());
ftp->Close();
}
static void TestFtpList()
{
- wxPuts(_T("*** Testing wxFTP file listing ***\n"));
+ wxPuts(wxT("*** Testing wxFTP file listing ***\n"));
// test CWD
if ( !ftp->ChDir(directory) )
{
- wxPrintf(_T("ERROR: failed to cd to %s\n"), directory);
+ wxPrintf(wxT("ERROR: failed to cd to %s\n"), directory);
}
- wxPrintf(_T("Current directory is '%s'\n"), ftp->Pwd().c_str());
+ wxPrintf(wxT("Current directory is '%s'\n"), ftp->Pwd().c_str());
// test NLIST and LIST
wxArrayString files;
if ( !ftp->GetFilesList(files) )
{
- wxPuts(_T("ERROR: failed to get NLIST of files"));
+ wxPuts(wxT("ERROR: failed to get NLIST of files"));
}
else
{
- wxPrintf(_T("Brief list of files under '%s':\n"), ftp->Pwd().c_str());
+ wxPrintf(wxT("Brief list of files under '%s':\n"), ftp->Pwd().c_str());
size_t count = files.GetCount();
for ( size_t n = 0; n < count; n++ )
{
- wxPrintf(_T("\t%s\n"), files[n].c_str());
+ wxPrintf(wxT("\t%s\n"), files[n].c_str());
}
- wxPuts(_T("End of the file list"));
+ wxPuts(wxT("End of the file list"));
}
if ( !ftp->GetDirList(files) )
{
- wxPuts(_T("ERROR: failed to get LIST of files"));
+ wxPuts(wxT("ERROR: failed to get LIST of files"));
}
else
{
- wxPrintf(_T("Detailed list of files under '%s':\n"), ftp->Pwd().c_str());
+ wxPrintf(wxT("Detailed list of files under '%s':\n"), ftp->Pwd().c_str());
size_t count = files.GetCount();
for ( size_t n = 0; n < count; n++ )
{
- wxPrintf(_T("\t%s\n"), files[n].c_str());
+ wxPrintf(wxT("\t%s\n"), files[n].c_str());
}
- wxPuts(_T("End of the file list"));
+ wxPuts(wxT("End of the file list"));
}
- if ( !ftp->ChDir(_T("..")) )
+ if ( !ftp->ChDir(wxT("..")) )
{
- wxPuts(_T("ERROR: failed to cd to .."));
+ wxPuts(wxT("ERROR: failed to cd to .."));
}
- wxPrintf(_T("Current directory is '%s'\n"), ftp->Pwd().c_str());
+ wxPrintf(wxT("Current directory is '%s'\n"), ftp->Pwd().c_str());
}
static void TestFtpDownload()
{
- wxPuts(_T("*** Testing wxFTP download ***\n"));
+ wxPuts(wxT("*** Testing wxFTP download ***\n"));
// test RETR
wxInputStream *in = ftp->GetInputStream(filename);
if ( !in )
{
- wxPrintf(_T("ERROR: couldn't get input stream for %s\n"), filename);
+ wxPrintf(wxT("ERROR: couldn't get input stream for %s\n"), filename);
}
else
{
size_t size = in->GetSize();
- wxPrintf(_T("Reading file %s (%u bytes)..."), filename, size);
+ wxPrintf(wxT("Reading file %s (%u bytes)..."), filename, size);
fflush(stdout);
wxChar *data = new wxChar[size];
if ( !in->Read(data, size) )
{
- wxPuts(_T("ERROR: read error"));
+ wxPuts(wxT("ERROR: read error"));
}
else
{
- wxPrintf(_T("\nContents of %s:\n%s\n"), filename, data);
+ wxPrintf(wxT("\nContents of %s:\n%s\n"), filename, data);
}
delete [] data;
static void TestFtpFileSize()
{
- wxPuts(_T("*** Testing FTP SIZE command ***"));
+ wxPuts(wxT("*** Testing FTP SIZE command ***"));
if ( !ftp->ChDir(directory) )
{
- wxPrintf(_T("ERROR: failed to cd to %s\n"), directory);
+ wxPrintf(wxT("ERROR: failed to cd to %s\n"), directory);
}
- wxPrintf(_T("Current directory is '%s'\n"), ftp->Pwd().c_str());
+ wxPrintf(wxT("Current directory is '%s'\n"), ftp->Pwd().c_str());
if ( ftp->FileExists(filename) )
{
int size = ftp->GetFileSize(filename);
if ( size == -1 )
- wxPrintf(_T("ERROR: couldn't get size of '%s'\n"), filename);
+ wxPrintf(wxT("ERROR: couldn't get size of '%s'\n"), filename);
else
- wxPrintf(_T("Size of '%s' is %d bytes.\n"), filename, size);
+ wxPrintf(wxT("Size of '%s' is %d bytes.\n"), filename, size);
}
else
{
- wxPrintf(_T("ERROR: '%s' doesn't exist\n"), filename);
+ wxPrintf(wxT("ERROR: '%s' doesn't exist\n"), filename);
}
}
static void TestFtpMisc()
{
- wxPuts(_T("*** Testing miscellaneous wxFTP functions ***"));
+ wxPuts(wxT("*** Testing miscellaneous wxFTP functions ***"));
- if ( ftp->SendCommand(_T("STAT")) != '2' )
+ if ( ftp->SendCommand(wxT("STAT")) != '2' )
{
- wxPuts(_T("ERROR: STAT failed"));
+ wxPuts(wxT("ERROR: STAT failed"));
}
else
{
- wxPrintf(_T("STAT returned:\n\n%s\n"), ftp->GetLastResult().c_str());
+ wxPrintf(wxT("STAT returned:\n\n%s\n"), ftp->GetLastResult().c_str());
}
- if ( ftp->SendCommand(_T("HELP SITE")) != '2' )
+ if ( ftp->SendCommand(wxT("HELP SITE")) != '2' )
{
- wxPuts(_T("ERROR: HELP SITE failed"));
+ wxPuts(wxT("ERROR: HELP SITE failed"));
}
else
{
- wxPrintf(_T("The list of site-specific commands:\n\n%s\n"),
+ wxPrintf(wxT("The list of site-specific commands:\n\n%s\n"),
ftp->GetLastResult().c_str());
}
}
static void TestFtpInteractive()
{
- wxPuts(_T("\n*** Interactive wxFTP test ***"));
+ wxPuts(wxT("\n*** Interactive wxFTP test ***"));
wxChar buf[128];
for ( ;; )
{
- wxPrintf(_T("Enter FTP command: "));
+ wxPrintf(wxT("Enter FTP command: "));
if ( !wxFgets(buf, WXSIZEOF(buf), stdin) )
break;
// special handling of LIST and NLST as they require data connection
wxString start(buf, 4);
start.MakeUpper();
- if ( start == _T("LIST") || start == _T("NLST") )
+ if ( start == wxT("LIST") || start == wxT("NLST") )
{
wxString wildcard;
if ( wxStrlen(buf) > 4 )
wildcard = buf + 5;
wxArrayString files;
- if ( !ftp->GetList(files, wildcard, start == _T("LIST")) )
+ if ( !ftp->GetList(files, wildcard, start == wxT("LIST")) )
{
- wxPrintf(_T("ERROR: failed to get %s of files\n"), start.c_str());
+ wxPrintf(wxT("ERROR: failed to get %s of files\n"), start.c_str());
}
else
{
- wxPrintf(_T("--- %s of '%s' under '%s':\n"),
+ wxPrintf(wxT("--- %s of '%s' under '%s':\n"),
start.c_str(), wildcard.c_str(), ftp->Pwd().c_str());
size_t count = files.GetCount();
for ( size_t n = 0; n < count; n++ )
{
- wxPrintf(_T("\t%s\n"), files[n].c_str());
+ wxPrintf(wxT("\t%s\n"), files[n].c_str());
}
- wxPuts(_T("--- End of the file list"));
+ wxPuts(wxT("--- End of the file list"));
}
}
else // !list
{
wxChar ch = ftp->SendCommand(buf);
- wxPrintf(_T("Command %s"), ch ? _T("succeeded") : _T("failed"));
+ wxPrintf(wxT("Command %s"), ch ? wxT("succeeded") : wxT("failed"));
if ( ch )
{
- wxPrintf(_T(" (return code %c)"), ch);
+ wxPrintf(wxT(" (return code %c)"), ch);
}
- wxPrintf(_T(", server reply:\n%s\n\n"), ftp->GetLastResult().c_str());
+ wxPrintf(wxT(", server reply:\n%s\n\n"), ftp->GetLastResult().c_str());
}
}
- wxPuts(_T("\n*** done ***"));
+ wxPuts(wxT("\n*** done ***"));
}
#endif // TEST_INTERACTIVE
static void TestFtpUpload()
{
- wxPuts(_T("*** Testing wxFTP uploading ***\n"));
+ wxPuts(wxT("*** Testing wxFTP uploading ***\n"));
// upload a file
- static const wxChar *file1 = _T("test1");
- static const wxChar *file2 = _T("test2");
+ static const wxChar *file1 = wxT("test1");
+ static const wxChar *file2 = wxT("test2");
wxOutputStream *out = ftp->GetOutputStream(file1);
if ( out )
{
- wxPrintf(_T("--- Uploading to %s ---\n"), file1);
+ wxPrintf(wxT("--- Uploading to %s ---\n"), file1);
out->Write("First hello", 11);
delete out;
}
// send a command to check the remote file
- if ( ftp->SendCommand(wxString(_T("STAT ")) + file1) != '2' )
+ if ( ftp->SendCommand(wxString(wxT("STAT ")) + file1) != '2' )
{
- wxPrintf(_T("ERROR: STAT %s failed\n"), file1);
+ wxPrintf(wxT("ERROR: STAT %s failed\n"), file1);
}
else
{
- wxPrintf(_T("STAT %s returned:\n\n%s\n"),
+ wxPrintf(wxT("STAT %s returned:\n\n%s\n"),
file1, ftp->GetLastResult().c_str());
}
out = ftp->GetOutputStream(file2);
if ( out )
{
- wxPrintf(_T("--- Uploading to %s ---\n"), file1);
+ wxPrintf(wxT("--- Uploading to %s ---\n"), file1);
out->Write("Second hello", 12);
delete out;
}
virtual void Walk(size_t skip = 1, size_t maxdepth = wxSTACKWALKER_MAX_DEPTH)
{
- wxPuts(_T("Stack dump:"));
+ wxPuts(wxT("Stack dump:"));
wxStackWalker::Walk(skip, maxdepth);
}
static void TestStackWalk(const char *argv0)
{
- wxPuts(_T("*** Testing wxStackWalker ***\n"));
+ wxPuts(wxT("*** Testing wxStackWalker ***\n"));
StackDump dump(argv0);
dump.Walk();
static void TestStandardPaths()
{
- wxPuts(_T("*** Testing wxStandardPaths ***\n"));
+ wxPuts(wxT("*** Testing wxStandardPaths ***\n"));
- wxTheApp->SetAppName(_T("console"));
+ wxTheApp->SetAppName(wxT("console"));
wxStandardPathsBase& stdp = wxStandardPaths::Get();
- wxPrintf(_T("Config dir (sys):\t%s\n"), stdp.GetConfigDir().c_str());
- wxPrintf(_T("Config dir (user):\t%s\n"), stdp.GetUserConfigDir().c_str());
- wxPrintf(_T("Data dir (sys):\t\t%s\n"), stdp.GetDataDir().c_str());
- wxPrintf(_T("Data dir (sys local):\t%s\n"), stdp.GetLocalDataDir().c_str());
- wxPrintf(_T("Data dir (user):\t%s\n"), stdp.GetUserDataDir().c_str());
- wxPrintf(_T("Data dir (user local):\t%s\n"), stdp.GetUserLocalDataDir().c_str());
- wxPrintf(_T("Documents dir:\t\t%s\n"), stdp.GetDocumentsDir().c_str());
- wxPrintf(_T("Executable path:\t%s\n"), stdp.GetExecutablePath().c_str());
- wxPrintf(_T("Plugins dir:\t\t%s\n"), stdp.GetPluginsDir().c_str());
- wxPrintf(_T("Resources dir:\t\t%s\n"), stdp.GetResourcesDir().c_str());
- wxPrintf(_T("Localized res. dir:\t%s\n"),
- stdp.GetLocalizedResourcesDir(_T("fr")).c_str());
- wxPrintf(_T("Message catalogs dir:\t%s\n"),
+ wxPrintf(wxT("Config dir (sys):\t%s\n"), stdp.GetConfigDir().c_str());
+ wxPrintf(wxT("Config dir (user):\t%s\n"), stdp.GetUserConfigDir().c_str());
+ wxPrintf(wxT("Data dir (sys):\t\t%s\n"), stdp.GetDataDir().c_str());
+ wxPrintf(wxT("Data dir (sys local):\t%s\n"), stdp.GetLocalDataDir().c_str());
+ wxPrintf(wxT("Data dir (user):\t%s\n"), stdp.GetUserDataDir().c_str());
+ wxPrintf(wxT("Data dir (user local):\t%s\n"), stdp.GetUserLocalDataDir().c_str());
+ wxPrintf(wxT("Documents dir:\t\t%s\n"), stdp.GetDocumentsDir().c_str());
+ wxPrintf(wxT("Executable path:\t%s\n"), stdp.GetExecutablePath().c_str());
+ wxPrintf(wxT("Plugins dir:\t\t%s\n"), stdp.GetPluginsDir().c_str());
+ wxPrintf(wxT("Resources dir:\t\t%s\n"), stdp.GetResourcesDir().c_str());
+ wxPrintf(wxT("Localized res. dir:\t%s\n"),
+ stdp.GetLocalizedResourcesDir(wxT("fr")).c_str());
+ wxPrintf(wxT("Message catalogs dir:\t%s\n"),
stdp.GetLocalizedResourcesDir
(
- _T("fr"),
+ wxT("fr"),
wxStandardPaths::ResourceCat_Messages
).c_str());
}
static void TestFileStream()
{
- wxPuts(_T("*** Testing wxFileInputStream ***"));
+ wxPuts(wxT("*** Testing wxFileInputStream ***"));
- static const wxString filename = _T("testdata.fs");
+ static const wxString filename = wxT("testdata.fs");
{
wxFileOutputStream fsOut(filename);
fsOut.Write("foo", 3);
{
wxFileInputStream fsIn(filename);
- wxPrintf(_T("File stream size: %u\n"), fsIn.GetSize());
+ wxPrintf(wxT("File stream size: %u\n"), fsIn.GetSize());
int c;
while ( (c=fsIn.GetC()) != wxEOF )
{
if ( !wxRemoveFile(filename) )
{
- wxPrintf(_T("ERROR: failed to remove the file '%s'.\n"), filename.c_str());
+ wxPrintf(wxT("ERROR: failed to remove the file '%s'.\n"), filename.c_str());
}
- wxPuts(_T("\n*** wxFileInputStream test done ***"));
+ wxPuts(wxT("\n*** wxFileInputStream test done ***"));
}
static void TestMemoryStream()
{
- wxPuts(_T("*** Testing wxMemoryOutputStream ***"));
+ wxPuts(wxT("*** Testing wxMemoryOutputStream ***"));
wxMemoryOutputStream memOutStream;
- wxPrintf(_T("Initially out stream offset: %lu\n"),
+ wxPrintf(wxT("Initially out stream offset: %lu\n"),
(unsigned long)memOutStream.TellO());
- for ( const wxChar *p = _T("Hello, stream!"); *p; p++ )
+ for ( const wxChar *p = wxT("Hello, stream!"); *p; p++ )
{
memOutStream.PutC(*p);
}
- wxPrintf(_T("Final out stream offset: %lu\n"),
+ wxPrintf(wxT("Final out stream offset: %lu\n"),
(unsigned long)memOutStream.TellO());
- wxPuts(_T("*** Testing wxMemoryInputStream ***"));
+ wxPuts(wxT("*** Testing wxMemoryInputStream ***"));
wxChar buf[1024];
size_t len = memOutStream.CopyTo(buf, WXSIZEOF(buf));
wxMemoryInputStream memInpStream(buf, len);
- wxPrintf(_T("Memory stream size: %u\n"), memInpStream.GetSize());
+ wxPrintf(wxT("Memory stream size: %u\n"), memInpStream.GetSize());
int c;
while ( (c=memInpStream.GetC()) != wxEOF )
{
wxPutchar(c);
}
- wxPuts(_T("\n*** wxMemoryInputStream test done ***"));
+ wxPuts(wxT("\n*** wxMemoryInputStream test done ***"));
}
#endif // TEST_STREAMS
static void TestStopWatch()
{
- wxPuts(_T("*** Testing wxStopWatch ***\n"));
+ wxPuts(wxT("*** Testing wxStopWatch ***\n"));
wxStopWatch sw;
sw.Pause();
- wxPrintf(_T("Initially paused, after 2 seconds time is..."));
+ wxPrintf(wxT("Initially paused, after 2 seconds time is..."));
fflush(stdout);
wxSleep(2);
- wxPrintf(_T("\t%ldms\n"), sw.Time());
+ wxPrintf(wxT("\t%ldms\n"), sw.Time());
- wxPrintf(_T("Resuming stopwatch and sleeping 3 seconds..."));
+ wxPrintf(wxT("Resuming stopwatch and sleeping 3 seconds..."));
fflush(stdout);
sw.Resume();
wxSleep(3);
- wxPrintf(_T("\telapsed time: %ldms\n"), sw.Time());
+ wxPrintf(wxT("\telapsed time: %ldms\n"), sw.Time());
sw.Pause();
- wxPrintf(_T("Pausing agan and sleeping 2 more seconds..."));
+ wxPrintf(wxT("Pausing agan and sleeping 2 more seconds..."));
fflush(stdout);
wxSleep(2);
- wxPrintf(_T("\telapsed time: %ldms\n"), sw.Time());
+ wxPrintf(wxT("\telapsed time: %ldms\n"), sw.Time());
sw.Resume();
- wxPrintf(_T("Finally resuming and sleeping 2 more seconds..."));
+ wxPrintf(wxT("Finally resuming and sleeping 2 more seconds..."));
fflush(stdout);
wxSleep(2);
- wxPrintf(_T("\telapsed time: %ldms\n"), sw.Time());
+ wxPrintf(wxT("\telapsed time: %ldms\n"), sw.Time());
wxStopWatch sw2;
- wxPuts(_T("\nChecking for 'backwards clock' bug..."));
+ wxPuts(wxT("\nChecking for 'backwards clock' bug..."));
for ( size_t n = 0; n < 70; n++ )
{
sw2.Start();
{
if ( sw.Time() < 0 || sw2.Time() < 0 )
{
- wxPuts(_T("\ntime is negative - ERROR!"));
+ wxPuts(wxT("\ntime is negative - ERROR!"));
}
}
fflush(stdout);
}
- wxPuts(_T(", ok."));
+ wxPuts(wxT(", ok."));
}
#include "wx/timer.h"
void TestTimer()
{
- wxPuts(_T("*** Testing wxTimer ***\n"));
+ wxPuts(wxT("*** Testing wxTimer ***\n"));
class MyTimer : public wxTimer
{
virtual void Notify()
{
- wxPrintf(_T("%d"), m_num++);
+ wxPrintf(wxT("%d"), m_num++);
fflush(stdout);
if ( m_num == 10 )
{
- wxPrintf(_T("... exiting the event loop"));
+ wxPrintf(wxT("... exiting the event loop"));
Stop();
wxEventLoop::GetActive()->Exit(0);
- wxPuts(_T(", ok."));
+ wxPuts(wxT(", ok."));
}
fflush(stdout);
static const wxChar *volumeKinds[] =
{
- _T("floppy"),
- _T("hard disk"),
- _T("CD-ROM"),
- _T("DVD-ROM"),
- _T("network volume"),
- _T("other volume"),
+ wxT("floppy"),
+ wxT("hard disk"),
+ wxT("CD-ROM"),
+ wxT("DVD-ROM"),
+ wxT("network volume"),
+ wxT("other volume"),
};
static void TestFSVolume()
{
- wxPuts(_T("*** Testing wxFSVolume class ***"));
+ wxPuts(wxT("*** Testing wxFSVolume class ***"));
wxArrayString volumes = wxFSVolume::GetVolumes();
size_t count = volumes.GetCount();
if ( !count )
{
- wxPuts(_T("ERROR: no mounted volumes?"));
+ wxPuts(wxT("ERROR: no mounted volumes?"));
return;
}
- wxPrintf(_T("%u mounted volumes found:\n"), count);
+ wxPrintf(wxT("%u mounted volumes found:\n"), count);
for ( size_t n = 0; n < count; n++ )
{
wxFSVolume vol(volumes[n]);
if ( !vol.IsOk() )
{
- wxPuts(_T("ERROR: couldn't create volume"));
+ wxPuts(wxT("ERROR: couldn't create volume"));
continue;
}
- wxPrintf(_T("%u: %s (%s), %s, %s, %s\n"),
+ wxPrintf(wxT("%u: %s (%s), %s, %s, %s\n"),
n + 1,
vol.GetDisplayName().c_str(),
vol.GetName().c_str(),
volumeKinds[vol.GetKind()],
- vol.IsWritable() ? _T("rw") : _T("ro"),
- vol.GetFlags() & wxFS_VOL_REMOVABLE ? _T("removable")
- : _T("fixed"));
+ vol.IsWritable() ? wxT("rw") : wxT("ro"),
+ vol.GetFlags() & wxFS_VOL_REMOVABLE ? wxT("removable")
+ : wxT("fixed"));
}
}
wxFontEncoding encoding;
} utf8data[] =
{
- { utf8Invalid, WXSIZEOF(utf8Invalid), _T("iso8859-1"), wxFONTENCODING_ISO8859_1 },
- { utf8koi8r, WXSIZEOF(utf8koi8r), _T("koi8-r"), wxFONTENCODING_KOI8 },
- { utf8iso8859_1, WXSIZEOF(utf8iso8859_1), _T("iso8859-1"), wxFONTENCODING_ISO8859_1 },
+ { utf8Invalid, WXSIZEOF(utf8Invalid), wxT("iso8859-1"), wxFONTENCODING_ISO8859_1 },
+ { utf8koi8r, WXSIZEOF(utf8koi8r), wxT("koi8-r"), wxFONTENCODING_KOI8 },
+ { utf8iso8859_1, WXSIZEOF(utf8iso8859_1), wxT("iso8859-1"), wxFONTENCODING_ISO8859_1 },
};
static void TestUtf8()
{
- wxPuts(_T("*** Testing UTF8 support ***\n"));
+ wxPuts(wxT("*** Testing UTF8 support ***\n"));
char buf[1024];
wchar_t wbuf[1024];
if ( wxConvUTF8.MB2WC(wbuf, (const char *)u8d.text,
WXSIZEOF(wbuf)) == (size_t)-1 )
{
- wxPuts(_T("ERROR: UTF-8 decoding failed."));
+ wxPuts(wxT("ERROR: UTF-8 decoding failed."));
}
else
{
wxCSConv conv(u8d.charset);
if ( conv.WC2MB(buf, wbuf, WXSIZEOF(buf)) == (size_t)-1 )
{
- wxPrintf(_T("ERROR: conversion to %s failed.\n"), u8d.charset);
+ wxPrintf(wxT("ERROR: conversion to %s failed.\n"), u8d.charset);
}
else
{
- wxPrintf(_T("String in %s: %s\n"), u8d.charset, buf);
+ wxPrintf(wxT("String in %s: %s\n"), u8d.charset, buf);
}
}
wxString s(wxConvUTF8.cMB2WC((const char *)u8d.text));
if ( s.empty() )
- s = _T("<< conversion failed >>");
- wxPrintf(_T("String in current cset: %s\n"), s.c_str());
+ s = wxT("<< conversion failed >>");
+ wxPrintf(wxT("String in current cset: %s\n"), s.c_str());
}
static void TestEncodingConverter()
{
- wxPuts(_T("*** Testing wxEncodingConverter ***\n"));
+ wxPuts(wxT("*** Testing wxEncodingConverter ***\n"));
// using wxEncodingConverter should give the same result as above
char buf[1024];
if ( wxConvUTF8.MB2WC(wbuf, (const char *)utf8koi8r,
WXSIZEOF(utf8koi8r)) == (size_t)-1 )
{
- wxPuts(_T("ERROR: UTF-8 decoding failed."));
+ wxPuts(wxT("ERROR: UTF-8 decoding failed."));
}
else
{
wxEncodingConverter ec;
ec.Init(wxFONTENCODING_UNICODE, wxFONTENCODING_KOI8);
ec.Convert(wbuf, buf);
- wxPrintf(_T("The same KOI8-R string using wxEC: %s\n"), buf);
+ wxPrintf(wxT("The same KOI8-R string using wxEC: %s\n"), buf);
}
wxPuts(wxEmptyString);
#include "wx/fs_zip.h"
#include "wx/zipstrm.h"
-static const wxChar *TESTFILE_ZIP = _T("testdata.zip");
+static const wxChar *TESTFILE_ZIP = wxT("testdata.zip");
static void TestZipStreamRead()
{
- wxPuts(_T("*** Testing ZIP reading ***\n"));
+ wxPuts(wxT("*** Testing ZIP reading ***\n"));
- static const wxString filename = _T("foo");
+ static const wxString filename = wxT("foo");
wxFFileInputStream in(TESTFILE_ZIP);
wxZipInputStream istr(in);
wxZipEntry entry(filename);
istr.OpenEntry(entry);
- wxPrintf(_T("Archive size: %u\n"), istr.GetSize());
+ wxPrintf(wxT("Archive size: %u\n"), istr.GetSize());
- wxPrintf(_T("Dumping the file '%s':\n"), filename.c_str());
+ wxPrintf(wxT("Dumping the file '%s':\n"), filename.c_str());
int c;
while ( (c=istr.GetC()) != wxEOF )
{
fflush(stdout);
}
- wxPuts(_T("\n----- done ------"));
+ wxPuts(wxT("\n----- done ------"));
}
static void DumpZipDirectory(wxFileSystem& fs,
const wxString& dir,
const wxString& indent)
{
- wxString prefix = wxString::Format(_T("%s#zip:%s"),
+ wxString prefix = wxString::Format(wxT("%s#zip:%s"),
TESTFILE_ZIP, dir.c_str());
- wxString wildcard = prefix + _T("/*");
+ wxString wildcard = prefix + wxT("/*");
wxString dirname = fs.FindFirst(wildcard, wxDIR);
while ( !dirname.empty() )
{
- if ( !dirname.StartsWith(prefix + _T('/'), &dirname) )
+ if ( !dirname.StartsWith(prefix + wxT('/'), &dirname) )
{
- wxPrintf(_T("ERROR: unexpected wxFileSystem::FindNext result\n"));
+ wxPrintf(wxT("ERROR: unexpected wxFileSystem::FindNext result\n"));
break;
}
- wxPrintf(_T("%s%s\n"), indent.c_str(), dirname.c_str());
+ wxPrintf(wxT("%s%s\n"), indent.c_str(), dirname.c_str());
DumpZipDirectory(fs, dirname,
- indent + wxString(_T(' '), 4));
+ indent + wxString(wxT(' '), 4));
dirname = fs.FindNext();
}
{
if ( !filename.StartsWith(prefix, &filename) )
{
- wxPrintf(_T("ERROR: unexpected wxFileSystem::FindNext result\n"));
+ wxPrintf(wxT("ERROR: unexpected wxFileSystem::FindNext result\n"));
break;
}
- wxPrintf(_T("%s%s\n"), indent.c_str(), filename.c_str());
+ wxPrintf(wxT("%s%s\n"), indent.c_str(), filename.c_str());
filename = fs.FindNext();
}
static void TestZipFileSystem()
{
- wxPuts(_T("*** Testing ZIP file system ***\n"));
+ wxPuts(wxT("*** Testing ZIP file system ***\n"));
wxFileSystem::AddHandler(new wxZipFSHandler);
wxFileSystem fs;
- wxPrintf(_T("Dumping all files in the archive %s:\n"), TESTFILE_ZIP);
+ wxPrintf(wxT("Dumping all files in the archive %s:\n"), TESTFILE_ZIP);
- DumpZipDirectory(fs, _T(""), wxString(_T(' '), 4));
+ DumpZipDirectory(fs, wxT(""), wxString(wxT(' '), 4));
}
#endif // TEST_ZIP
static void TestTimeStatic()
{
- wxPuts(_T("\n*** wxDateTime static methods test ***"));
+ wxPuts(wxT("\n*** wxDateTime static methods test ***"));
// some info about the current date
int year = wxDateTime::GetCurrentYear();
- wxPrintf(_T("Current year %d is %sa leap one and has %d days.\n"),
+ wxPrintf(wxT("Current year %d is %sa leap one and has %d days.\n"),
year,
wxDateTime::IsLeapYear(year) ? "" : "not ",
wxDateTime::GetNumberOfDays(year));
wxDateTime::Month month = wxDateTime::GetCurrentMonth();
- wxPrintf(_T("Current month is '%s' ('%s') and it has %d days\n"),
+ wxPrintf(wxT("Current month is '%s' ('%s') and it has %d days\n"),
wxDateTime::GetMonthName(month, wxDateTime::Name_Abbr).c_str(),
wxDateTime::GetMonthName(month).c_str(),
wxDateTime::GetNumberOfDays(month));
// test time zones stuff
static void TestTimeZones()
{
- wxPuts(_T("\n*** wxDateTime timezone test ***"));
+ wxPuts(wxT("\n*** wxDateTime timezone test ***"));
wxDateTime now = wxDateTime::Now();
- wxPrintf(_T("Current GMT time:\t%s\n"), now.Format(_T("%c"), wxDateTime::GMT0).c_str());
- wxPrintf(_T("Unix epoch (GMT):\t%s\n"), wxDateTime((time_t)0).Format(_T("%c"), wxDateTime::GMT0).c_str());
- wxPrintf(_T("Unix epoch (EST):\t%s\n"), wxDateTime((time_t)0).Format(_T("%c"), wxDateTime::EST).c_str());
- wxPrintf(_T("Current time in Paris:\t%s\n"), now.Format(_T("%c"), wxDateTime::CET).c_str());
- wxPrintf(_T(" Moscow:\t%s\n"), now.Format(_T("%c"), wxDateTime::MSK).c_str());
- wxPrintf(_T(" New York:\t%s\n"), now.Format(_T("%c"), wxDateTime::EST).c_str());
+ wxPrintf(wxT("Current GMT time:\t%s\n"), now.Format(wxT("%c"), wxDateTime::GMT0).c_str());
+ wxPrintf(wxT("Unix epoch (GMT):\t%s\n"), wxDateTime((time_t)0).Format(wxT("%c"), wxDateTime::GMT0).c_str());
+ wxPrintf(wxT("Unix epoch (EST):\t%s\n"), wxDateTime((time_t)0).Format(wxT("%c"), wxDateTime::EST).c_str());
+ wxPrintf(wxT("Current time in Paris:\t%s\n"), now.Format(wxT("%c"), wxDateTime::CET).c_str());
+ wxPrintf(wxT(" Moscow:\t%s\n"), now.Format(wxT("%c"), wxDateTime::MSK).c_str());
+ wxPrintf(wxT(" New York:\t%s\n"), now.Format(wxT("%c"), wxDateTime::EST).c_str());
- wxPrintf(_T("%s\n"), wxDateTime::Now().Format(_T("Our timezone is %Z")).c_str());
+ wxPrintf(wxT("%s\n"), wxDateTime::Now().Format(wxT("Our timezone is %Z")).c_str());
wxDateTime::Tm tm = now.GetTm();
if ( wxDateTime(tm) != now )
{
- wxPrintf(_T("ERROR: got %s instead of %s\n"),
+ wxPrintf(wxT("ERROR: got %s instead of %s\n"),
wxDateTime(tm).Format().c_str(), now.Format().c_str());
}
}
// test some minimal support for the dates outside the standard range
static void TestTimeRange()
{
- wxPuts(_T("\n*** wxDateTime out-of-standard-range dates test ***"));
+ wxPuts(wxT("\n*** wxDateTime out-of-standard-range dates test ***"));
- static const wxChar *fmt = _T("%d-%b-%Y %H:%M:%S");
+ static const wxChar *fmt = wxT("%d-%b-%Y %H:%M:%S");
- wxPrintf(_T("Unix epoch:\t%s\n"),
+ wxPrintf(wxT("Unix epoch:\t%s\n"),
wxDateTime(2440587.5).Format(fmt).c_str());
- wxPrintf(_T("Feb 29, 0: \t%s\n"),
+ wxPrintf(wxT("Feb 29, 0: \t%s\n"),
wxDateTime(29, wxDateTime::Feb, 0).Format(fmt).c_str());
- wxPrintf(_T("JDN 0: \t%s\n"),
+ wxPrintf(wxT("JDN 0: \t%s\n"),
wxDateTime(0.0).Format(fmt).c_str());
- wxPrintf(_T("Jan 1, 1AD:\t%s\n"),
+ wxPrintf(wxT("Jan 1, 1AD:\t%s\n"),
wxDateTime(1, wxDateTime::Jan, 1).Format(fmt).c_str());
- wxPrintf(_T("May 29, 2099:\t%s\n"),
+ wxPrintf(wxT("May 29, 2099:\t%s\n"),
wxDateTime(29, wxDateTime::May, 2099).Format(fmt).c_str());
}
// test DST calculations
static void TestTimeDST()
{
- wxPuts(_T("\n*** wxDateTime DST test ***"));
+ wxPuts(wxT("\n*** wxDateTime DST test ***"));
- wxPrintf(_T("DST is%s in effect now.\n\n"),
- wxDateTime::Now().IsDST() ? wxEmptyString : _T(" not"));
+ wxPrintf(wxT("DST is%s in effect now.\n\n"),
+ wxDateTime::Now().IsDST() ? wxEmptyString : wxT(" not"));
for ( int year = 1990; year < 2005; year++ )
{
- wxPrintf(_T("DST period in Europe for year %d: from %s to %s\n"),
+ wxPrintf(wxT("DST period in Europe for year %d: from %s to %s\n"),
year,
wxDateTime::GetBeginDST(year, wxDateTime::Country_EEC).Format().c_str(),
wxDateTime::GetEndDST(year, wxDateTime::Country_EEC).Format().c_str());
static void TestDateTimeInteractive()
{
- wxPuts(_T("\n*** interactive wxDateTime tests ***"));
+ wxPuts(wxT("\n*** interactive wxDateTime tests ***"));
wxChar buf[128];
for ( ;; )
{
- wxPrintf(_T("Enter a date: "));
+ wxPrintf(wxT("Enter a date: "));
if ( !wxFgets(buf, WXSIZEOF(buf), stdin) )
break;
const wxChar *p = dt.ParseDate(buf);
if ( !p )
{
- wxPrintf(_T("ERROR: failed to parse the date '%s'.\n"), buf);
+ wxPrintf(wxT("ERROR: failed to parse the date '%s'.\n"), buf);
continue;
}
else if ( *p )
{
- wxPrintf(_T("WARNING: parsed only first %u characters.\n"), p - buf);
+ wxPrintf(wxT("WARNING: parsed only first %u characters.\n"), p - buf);
}
- wxPrintf(_T("%s: day %u, week of month %u/%u, week of year %u\n"),
- dt.Format(_T("%b %d, %Y")).c_str(),
+ wxPrintf(wxT("%s: day %u, week of month %u/%u, week of year %u\n"),
+ dt.Format(wxT("%b %d, %Y")).c_str(),
dt.GetDayOfYear(),
dt.GetWeekOfMonth(wxDateTime::Monday_First),
dt.GetWeekOfMonth(wxDateTime::Sunday_First),
dt.GetWeekOfYear(wxDateTime::Monday_First));
}
- wxPuts(_T("\n*** done ***"));
+ wxPuts(wxT("\n*** done ***"));
}
#endif // TEST_INTERACTIVE
static void TestTimeMS()
{
- wxPuts(_T("*** testing millisecond-resolution support in wxDateTime ***"));
+ wxPuts(wxT("*** testing millisecond-resolution support in wxDateTime ***"));
wxDateTime dt1 = wxDateTime::Now(),
dt2 = wxDateTime::UNow();
- wxPrintf(_T("Now = %s\n"), dt1.Format(_T("%H:%M:%S:%l")).c_str());
- wxPrintf(_T("UNow = %s\n"), dt2.Format(_T("%H:%M:%S:%l")).c_str());
- wxPrintf(_T("Dummy loop: "));
+ wxPrintf(wxT("Now = %s\n"), dt1.Format(wxT("%H:%M:%S:%l")).c_str());
+ wxPrintf(wxT("UNow = %s\n"), dt2.Format(wxT("%H:%M:%S:%l")).c_str());
+ wxPrintf(wxT("Dummy loop: "));
for ( int i = 0; i < 6000; i++ )
{
//for ( int j = 0; j < 10; j++ )
{
wxString s;
- s.Printf(_T("%g"), sqrt((float)i));
+ s.Printf(wxT("%g"), sqrt((float)i));
}
if ( !(i % 100) )
wxPutchar('.');
}
- wxPuts(_T(", done"));
+ wxPuts(wxT(", done"));
dt1 = dt2;
dt2 = wxDateTime::UNow();
- wxPrintf(_T("UNow = %s\n"), dt2.Format(_T("%H:%M:%S:%l")).c_str());
+ wxPrintf(wxT("UNow = %s\n"), dt2.Format(wxT("%H:%M:%S:%l")).c_str());
- wxPrintf(_T("Loop executed in %s ms\n"), (dt2 - dt1).Format(_T("%l")).c_str());
+ wxPrintf(wxT("Loop executed in %s ms\n"), (dt2 - dt1).Format(wxT("%l")).c_str());
- wxPuts(_T("\n*** done ***"));
+ wxPuts(wxT("\n*** done ***"));
}
static void TestTimeHolidays()
{
- wxPuts(_T("\n*** testing wxDateTimeHolidayAuthority ***\n"));
+ wxPuts(wxT("\n*** testing wxDateTimeHolidayAuthority ***\n"));
wxDateTime::Tm tm = wxDateTime(29, wxDateTime::May, 2000).GetTm();
wxDateTime dtStart(1, tm.mon, tm.year),
wxDateTimeArray hol;
wxDateTimeHolidayAuthority::GetHolidaysInRange(dtStart, dtEnd, hol);
- const wxChar *format = _T("%d-%b-%Y (%a)");
+ const wxChar *format = wxT("%d-%b-%Y (%a)");
- wxPrintf(_T("All holidays between %s and %s:\n"),
+ wxPrintf(wxT("All holidays between %s and %s:\n"),
dtStart.Format(format).c_str(), dtEnd.Format(format).c_str());
size_t count = hol.GetCount();
for ( size_t n = 0; n < count; n++ )
{
- wxPrintf(_T("\t%s\n"), hol[n].Format(format).c_str());
+ wxPrintf(wxT("\t%s\n"), hol[n].Format(format).c_str());
}
wxPuts(wxEmptyString);
static void TestTimeZoneBug()
{
- wxPuts(_T("\n*** testing for DST/timezone bug ***\n"));
+ wxPuts(wxT("\n*** testing for DST/timezone bug ***\n"));
wxDateTime date = wxDateTime(1, wxDateTime::Mar, 2000);
for ( int i = 0; i < 31; i++ )
{
- wxPrintf(_T("Date %s: week day %s.\n"),
- date.Format(_T("%d-%m-%Y")).c_str(),
+ wxPrintf(wxT("Date %s: week day %s.\n"),
+ date.Format(wxT("%d-%m-%Y")).c_str(),
date.GetWeekDayName(date.GetWeekDay()).c_str());
date += wxDateSpan::Day();
static void TestTimeSpanFormat()
{
- wxPuts(_T("\n*** wxTimeSpan tests ***"));
+ wxPuts(wxT("\n*** wxTimeSpan tests ***"));
static const wxChar *formats[] =
{
- _T("(default) %H:%M:%S"),
- _T("%E weeks and %D days"),
- _T("%l milliseconds"),
- _T("(with ms) %H:%M:%S:%l"),
- _T("100%% of minutes is %M"), // test "%%"
- _T("%D days and %H hours"),
- _T("or also %S seconds"),
+ wxT("(default) %H:%M:%S"),
+ wxT("%E weeks and %D days"),
+ wxT("%l milliseconds"),
+ wxT("(with ms) %H:%M:%S:%l"),
+ wxT("100%% of minutes is %M"), // test "%%"
+ wxT("%D days and %H hours"),
+ wxT("or also %S seconds"),
};
wxTimeSpan ts1(1, 2, 3, 4),
ts2(111, 222, 333);
for ( size_t n = 0; n < WXSIZEOF(formats); n++ )
{
- wxPrintf(_T("ts1 = %s\tts2 = %s\n"),
+ wxPrintf(wxT("ts1 = %s\tts2 = %s\n"),
ts1.Format(formats[n]).c_str(),
ts2.Format(formats[n]).c_str());
}
static void TestTextInputStream()
{
- wxPuts(_T("\n*** wxTextInputStream test ***"));
+ wxPuts(wxT("\n*** wxTextInputStream test ***"));
- wxString filename = _T("testdata.fc");
+ wxString filename = wxT("testdata.fc");
wxFileInputStream fsIn(filename);
if ( !fsIn.Ok() )
{
- wxPuts(_T("ERROR: couldn't open file."));
+ wxPuts(wxT("ERROR: couldn't open file."));
}
else
{
if ( fsIn.Eof() && s.empty() )
break;
- wxPrintf(_T("Line %d: %s\n"), line++, s.c_str());
+ wxPrintf(wxT("Line %d: %s\n"), line++, s.c_str());
}
}
}
void MyDetachedThread::OnExit()
{
- wxLogTrace(_T("thread"), _T("Thread %ld is in OnExit"), GetId());
+ wxLogTrace(wxT("thread"), wxT("Thread %ld is in OnExit"), GetId());
wxCriticalSectionLocker lock(gs_critsect);
if ( !--gs_counter && !m_cancelled )
static void TestDetachedThreads()
{
- wxPuts(_T("\n*** Testing detached threads ***"));
+ wxPuts(wxT("\n*** Testing detached threads ***"));
static const size_t nThreads = 3;
MyDetachedThread *threads[nThreads];
static void TestJoinableThreads()
{
- wxPuts(_T("\n*** Testing a joinable thread (a loooong calculation...) ***"));
+ wxPuts(wxT("\n*** Testing a joinable thread (a loooong calculation...) ***"));
// calc 10! in the background
MyJoinableThread thread(10);
thread.Run();
- wxPrintf(_T("\nThread terminated with exit code %lu.\n"),
+ wxPrintf(wxT("\nThread terminated with exit code %lu.\n"),
(unsigned long)thread.Wait());
}
static void TestThreadSuspend()
{
- wxPuts(_T("\n*** Testing thread suspend/resume functions ***"));
+ wxPuts(wxT("\n*** Testing thread suspend/resume functions ***"));
MyDetachedThread *thread = new MyDetachedThread(15, 'X');
{
thread->Pause();
- wxPuts(_T("\nThread suspended"));
+ wxPuts(wxT("\nThread suspended"));
if ( n > 0 )
{
// don't sleep but resume immediately the first time
wxThread::Sleep(300);
}
- wxPuts(_T("Going to resume the thread"));
+ wxPuts(wxT("Going to resume the thread"));
thread->Resume();
}
- wxPuts(_T("Waiting until it terminates now"));
+ wxPuts(wxT("Waiting until it terminates now"));
// wait until the thread terminates
gs_cond.Wait();
// running when we delete it - deleting a detached thread which already
// terminated will lead to a crash!
- wxPuts(_T("\n*** Testing thread delete function ***"));
+ wxPuts(wxT("\n*** Testing thread delete function ***"));
MyDetachedThread *thread0 = new MyDetachedThread(30, 'W');
thread0->Delete();
- wxPuts(_T("\nDeleted a thread which didn't start to run yet."));
+ wxPuts(wxT("\nDeleted a thread which didn't start to run yet."));
MyDetachedThread *thread1 = new MyDetachedThread(30, 'Y');
thread1->Delete();
- wxPuts(_T("\nDeleted a running thread."));
+ wxPuts(wxT("\nDeleted a running thread."));
MyDetachedThread *thread2 = new MyDetachedThread(30, 'Z');
thread2->Delete();
- wxPuts(_T("\nDeleted a sleeping thread."));
+ wxPuts(wxT("\nDeleted a sleeping thread."));
MyJoinableThread thread3(20);
thread3.Run();
thread3.Delete();
- wxPuts(_T("\nDeleted a joinable thread."));
+ wxPuts(wxT("\nDeleted a joinable thread."));
MyJoinableThread thread4(2);
thread4.Run();
thread4.Delete();
- wxPuts(_T("\nDeleted a joinable thread which already terminated."));
+ wxPuts(wxT("\nDeleted a joinable thread which already terminated."));
wxPuts(wxEmptyString);
}
virtual ExitCode Entry()
{
- wxPrintf(_T("Thread %lu has started running.\n"), GetId());
+ wxPrintf(wxT("Thread %lu has started running.\n"), GetId());
fflush(stdout);
gs_cond.Post();
- wxPrintf(_T("Thread %lu starts to wait...\n"), GetId());
+ wxPrintf(wxT("Thread %lu starts to wait...\n"), GetId());
fflush(stdout);
m_mutex->Lock();
m_condition->Wait();
m_mutex->Unlock();
- wxPrintf(_T("Thread %lu finished to wait, exiting.\n"), GetId());
+ wxPrintf(wxT("Thread %lu finished to wait, exiting.\n"), GetId());
fflush(stdout);
return 0;
// otherwise its difficult to understand which log messages pertain to
// which condition
- //wxLogTrace(_T("thread"), _T("Local condition var is %08x, gs_cond = %08x"),
+ //wxLogTrace(wxT("thread"), wxT("Local condition var is %08x, gs_cond = %08x"),
// condition.GetId(), gs_cond.GetId());
// create and launch threads
}
// wait until all threads run
- wxPuts(_T("Main thread is waiting for the other threads to start"));
+ wxPuts(wxT("Main thread is waiting for the other threads to start"));
fflush(stdout);
size_t nRunning = 0;
nRunning++;
- wxPrintf(_T("Main thread: %u already running\n"), nRunning);
+ wxPrintf(wxT("Main thread: %u already running\n"), nRunning);
fflush(stdout);
}
- wxPuts(_T("Main thread: all threads started up."));
+ wxPuts(wxT("Main thread: all threads started up."));
fflush(stdout);
wxThread::Sleep(500);
#if 1
// now wake one of them up
- wxPrintf(_T("Main thread: about to signal the condition.\n"));
+ wxPrintf(wxT("Main thread: about to signal the condition.\n"));
fflush(stdout);
condition.Signal();
#endif
wxThread::Sleep(200);
// wake all the (remaining) threads up, so that they can exit
- wxPrintf(_T("Main thread: about to broadcast the condition.\n"));
+ wxPrintf(wxT("Main thread: about to broadcast the condition.\n"));
fflush(stdout);
condition.Broadcast();
virtual ExitCode Entry()
{
- wxPrintf(_T("%s: Thread #%d (%ld) starting to wait for semaphore...\n"),
+ wxPrintf(wxT("%s: Thread #%d (%ld) starting to wait for semaphore...\n"),
wxDateTime::Now().FormatTime().c_str(), m_i, (long)GetId());
m_sem->Wait();
- wxPrintf(_T("%s: Thread #%d (%ld) acquired the semaphore.\n"),
+ wxPrintf(wxT("%s: Thread #%d (%ld) acquired the semaphore.\n"),
wxDateTime::Now().FormatTime().c_str(), m_i, (long)GetId());
Sleep(1000);
- wxPrintf(_T("%s: Thread #%d (%ld) releasing the semaphore.\n"),
+ wxPrintf(wxT("%s: Thread #%d (%ld) releasing the semaphore.\n"),
wxDateTime::Now().FormatTime().c_str(), m_i, (long)GetId());
m_sem->Post();
static void TestSemaphore()
{
- wxPuts(_T("*** Testing wxSemaphore class. ***"));
+ wxPuts(wxT("*** Testing wxSemaphore class. ***"));
static const int SEM_LIMIT = 3;
#ifdef TEST_SNGLINST
wxSingleInstanceChecker checker;
- if ( checker.Create(_T(".wxconsole.lock")) )
+ if ( checker.Create(wxT(".wxconsole.lock")) )
{
if ( checker.IsAnotherRunning() )
{
- wxPrintf(_T("Another instance of the program is running, exiting.\n"));
+ wxPrintf(wxT("Another instance of the program is running, exiting.\n"));
return 1;
}
// wait some time to give time to launch another instance
- wxPrintf(_T("Press \"Enter\" to continue..."));
+ wxPrintf(wxT("Press \"Enter\" to continue..."));
wxFgetc(stdin);
}
else // failed to create
{
- wxPrintf(_T("Failed to init wxSingleInstanceChecker.\n"));
+ wxPrintf(wxT("Failed to init wxSingleInstanceChecker.\n"));
}
#endif // TEST_SNGLINST
wxCmdLineParser parser(cmdLineDesc, argc, wxArgv);
- parser.AddOption(_T("project_name"), _T(""), _T("full path to project file"),
+ parser.AddOption(wxT("project_name"), wxT(""), wxT("full path to project file"),
wxCMD_LINE_VAL_STRING,
wxCMD_LINE_OPTION_MANDATORY | wxCMD_LINE_NEEDS_SEPARATOR);
switch ( parser.Parse() )
{
case -1:
- wxLogMessage(_T("Help was given, terminating."));
+ wxLogMessage(wxT("Help was given, terminating."));
break;
case 0:
break;
default:
- wxLogMessage(_T("Syntax error detected, aborting."));
+ wxLogMessage(wxT("Syntax error detected, aborting."));
break;
}
#endif // wxUSE_CMDLINE_PARSER
#endif // TEST_LOCALE
#ifdef TEST_LOG
- wxPuts(_T("*** Testing wxLog ***"));
+ wxPuts(wxT("*** Testing wxLog ***"));
wxString s;
for ( size_t n = 0; n < 8000; n++ )
{
- s << (wxChar)(_T('A') + (n % 26));
+ s << (wxChar)(wxT('A') + (n % 26));
}
- wxLogWarning(_T("The length of the string is %lu"),
+ wxLogWarning(wxT("The length of the string is %lu"),
(unsigned long)s.length());
wxString msg;
- msg.Printf(_T("A very very long message: '%s', the end!\n"), s.c_str());
+ msg.Printf(wxT("A very very long message: '%s', the end!\n"), s.c_str());
// this one shouldn't be truncated
wxPrintf(msg);
// but this one will because log functions use fixed size buffer
// (note that it doesn't need '\n' at the end neither - will be added
// by wxLog anyhow)
- wxLogMessage(_T("A very very long message 2: '%s', the end!"), s.c_str());
+ wxLogMessage(wxT("A very very long message 2: '%s', the end!"), s.c_str());
#endif // TEST_LOG
#ifdef TEST_FILE
#endif // TEST_FTP
#ifdef TEST_MIME
- //wxLog::AddTraceMask(_T("mime"));
+ //wxLog::AddTraceMask(wxT("mime"));
TestMimeEnum();
#if 0
TestMimeOverride();
#ifdef TEST_THREADS
int nCPUs = wxThread::GetCPUCount();
- wxPrintf(_T("This system has %d CPUs\n"), nCPUs);
+ wxPrintf(wxT("This system has %d CPUs\n"), nCPUs);
if ( nCPUs != -1 )
wxThread::SetConcurrency(nCPUs);
#endif
#ifdef TEST_USLEEP
- wxPuts(_T("Sleeping for 3 seconds... z-z-z-z-z..."));
+ wxPuts(wxT("Sleeping for 3 seconds... z-z-z-z-z..."));
wxUsleep(3000);
#endif // TEST_USLEEP
void OnDClick(wxMouseEvent& event)
{
- wxLogMessage(_T("MyButton::OnDClick"));
+ wxLogMessage(wxT("MyButton::OnDClick"));
event.Skip();
}
void OnKeyUp(wxKeyEvent& event);
void OnFocusGot(wxFocusEvent& event)
{
- wxLogMessage(_T("MyComboBox::OnFocusGot"));
+ wxLogMessage(wxT("MyComboBox::OnFocusGot"));
event.Skip();
}
protected:
void OnFocusGot(wxFocusEvent& event)
{
- wxLogMessage(_T("MyRadioBox::OnFocusGot"));
+ wxLogMessage(wxT("MyRadioBox::OnFocusGot"));
event.Skip();
}
void OnFocusLost(wxFocusEvent& event)
{
- wxLogMessage(_T("MyRadioBox::OnFocusLost"));
+ wxLogMessage(wxT("MyRadioBox::OnFocusLost"));
event.Skip();
}
protected:
void OnFocusGot(wxFocusEvent& event)
{
- wxLogMessage(_T("MyChoice::OnFocusGot"));
+ wxLogMessage(wxT("MyChoice::OnFocusGot"));
event.Skip();
}
void OnFocusLost(wxFocusEvent& event)
{
- wxLogMessage(_T("MyChoice::OnFocusLost"));
+ wxLogMessage(wxT("MyChoice::OnFocusLost"));
event.Skip();
}
#endif // wxUSE_HELP
// Create the main frame window
- MyFrame *frame = new MyFrame(_T("Controls wxWidgets App"), x, y);
+ MyFrame *frame = new MyFrame(wxT("Controls wxWidgets App"), x, y);
frame->Show(true);
return true;
m_book = NULL;
m_label = NULL;
- m_text = new wxTextCtrl(this, wxID_ANY, _T("This is the log window.\n"),
+ m_text = new wxTextCtrl(this, wxID_ANY, wxT("This is the log window.\n"),
wxPoint(0, 250), wxSize(100, 50), wxTE_MULTILINE);
m_logTargetOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_text));
wxString choices[] =
{
- _T("This"),
- _T("is"),
- _T("one of my long and"),
- _T("wonderful"),
- _T("examples.")
+ wxT("This"),
+ wxT("is"),
+ wxT("one of my long and"),
+ wxT("wonderful"),
+ wxT("examples.")
};
#ifdef USE_XPM
static const wxChar *s_iconNames[Image_Max] =
{
- _T("list")
- , _T("choice")
- , _T("combo")
- , _T("text")
- , _T("radio")
+ wxT("list")
+ , wxT("choice")
+ , wxT("combo")
+ , wxT("text")
+ , wxT("radio")
#if wxUSE_GAUGE
- , _T("gauge")
+ , wxT("gauge")
#endif // wxUSE_GAUGE
};
m_listbox->SetCursor(*wxCROSS_CURSOR);
- m_lbSelectNum = new wxButton( panel, ID_LISTBOX_SEL_NUM, _T("Select #&2"), wxPoint(180,30), wxSize(140,30) );
- m_lbSelectThis = new wxButton( panel, ID_LISTBOX_SEL_STR, _T("&Select 'This'"), wxPoint(340,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_LISTBOX_CLEAR, _T("&Clear"), wxPoint(180,80), wxSize(140,30) );
- (void)new MyButton( panel, ID_LISTBOX_APPEND, _T("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) );
- (void)new wxButton( panel, ID_LISTBOX_DELETE, _T("D&elete selected item"), wxPoint(180,130), wxSize(140,30) );
- wxButton *button = new MyButton( panel, ID_LISTBOX_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) );
+ m_lbSelectNum = new wxButton( panel, ID_LISTBOX_SEL_NUM, wxT("Select #&2"), wxPoint(180,30), wxSize(140,30) );
+ m_lbSelectThis = new wxButton( panel, ID_LISTBOX_SEL_STR, wxT("&Select 'This'"), wxPoint(340,30), wxSize(140,30) );
+ (void)new wxButton( panel, ID_LISTBOX_CLEAR, wxT("&Clear"), wxPoint(180,80), wxSize(140,30) );
+ (void)new MyButton( panel, ID_LISTBOX_APPEND, wxT("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) );
+ (void)new wxButton( panel, ID_LISTBOX_DELETE, wxT("D&elete selected item"), wxPoint(180,130), wxSize(140,30) );
+ wxButton *button = new MyButton( panel, ID_LISTBOX_FONT, wxT("Set &Italic font"), wxPoint(340,130), wxSize(140,30) );
button->SetDefault();
- m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, _T("&Disable"), wxPoint(20,170) );
+ m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, wxT("&Disable"), wxPoint(20,170) );
m_checkbox->SetValue(false);
button->MoveAfterInTabOrder(m_checkbox);
- (void)new wxCheckBox( panel, ID_CHANGE_COLOUR, _T("&Toggle colour"),
+ (void)new wxCheckBox( panel, ID_CHANGE_COLOUR, wxT("&Toggle colour"),
wxPoint(110,170) );
panel->SetCursor(wxCursor(wxCURSOR_HAND));
- m_book->AddPage(panel, _T("wxListBox"), true, Image_List);
+ m_book->AddPage(panel, wxT("wxListBox"), true, Image_List);
#if wxUSE_CHOICE
panel = new wxPanel(m_book);
SetChoiceClientData(wxT("choice"), m_choiceSorted);
m_choice->SetSelection(2);
- (void)new wxButton( panel, ID_CHOICE_SEL_NUM, _T("Select #&2"), wxPoint(180,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_CHOICE_SEL_STR, _T("&Select 'This'"), wxPoint(340,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_CHOICE_CLEAR, _T("&Clear"), wxPoint(180,80), wxSize(140,30) );
- (void)new wxButton( panel, ID_CHOICE_APPEND, _T("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) );
- (void)new wxButton( panel, ID_CHOICE_DELETE, _T("D&elete selected item"), wxPoint(180,130), wxSize(140,30) );
- (void)new wxButton( panel, ID_CHOICE_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) );
- (void)new wxCheckBox( panel, ID_CHOICE_ENABLE, _T("&Disable"), wxPoint(20,130), wxSize(140,30) );
-
- m_book->AddPage(panel, _T("wxChoice"), false, Image_Choice);
+ (void)new wxButton( panel, ID_CHOICE_SEL_NUM, wxT("Select #&2"), wxPoint(180,30), wxSize(140,30) );
+ (void)new wxButton( panel, ID_CHOICE_SEL_STR, wxT("&Select 'This'"), wxPoint(340,30), wxSize(140,30) );
+ (void)new wxButton( panel, ID_CHOICE_CLEAR, wxT("&Clear"), wxPoint(180,80), wxSize(140,30) );
+ (void)new wxButton( panel, ID_CHOICE_APPEND, wxT("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) );
+ (void)new wxButton( panel, ID_CHOICE_DELETE, wxT("D&elete selected item"), wxPoint(180,130), wxSize(140,30) );
+ (void)new wxButton( panel, ID_CHOICE_FONT, wxT("Set &Italic font"), wxPoint(340,130), wxSize(140,30) );
+ (void)new wxCheckBox( panel, ID_CHOICE_ENABLE, wxT("&Disable"), wxPoint(20,130), wxSize(140,30) );
+
+ m_book->AddPage(panel, wxT("wxChoice"), false, Image_Choice);
#endif // wxUSE_CHOICE
panel = new wxPanel(m_book);
- (void)new wxStaticBox( panel, wxID_ANY, _T("&Box around combobox"),
+ (void)new wxStaticBox( panel, wxID_ANY, wxT("&Box around combobox"),
wxPoint(5, 5), wxSize(150, 100));
- m_combo = new MyComboBox( panel, ID_COMBO, _T("This"),
+ m_combo = new MyComboBox( panel, ID_COMBO, wxT("This"),
wxPoint(20,25), wxSize(120, wxDefaultCoord),
5, choices,
wxTE_PROCESS_ENTER);
- (void)new wxButton( panel, ID_COMBO_SEL_NUM, _T("Select #&2"), wxPoint(180,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_COMBO_SEL_STR, _T("&Select 'This'"), wxPoint(340,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_COMBO_CLEAR, _T("&Clear"), wxPoint(180,80), wxSize(140,30) );
- (void)new wxButton( panel, ID_COMBO_APPEND, _T("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) );
- (void)new wxButton( panel, ID_COMBO_DELETE, _T("D&elete selected item"), wxPoint(180,130), wxSize(140,30) );
- (void)new wxButton( panel, ID_COMBO_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) );
- (void)new wxButton( panel, ID_COMBO_SET_TEXT, _T("Set 'Hi!' at #2"), wxPoint(340,180), wxSize(140,30) );
- (void)new wxCheckBox( panel, ID_COMBO_ENABLE, _T("&Disable"), wxPoint(20,130), wxSize(140,30) );
- m_book->AddPage(panel, _T("wxComboBox"), false, Image_Combo);
+ (void)new wxButton( panel, ID_COMBO_SEL_NUM, wxT("Select #&2"), wxPoint(180,30), wxSize(140,30) );
+ (void)new wxButton( panel, ID_COMBO_SEL_STR, wxT("&Select 'This'"), wxPoint(340,30), wxSize(140,30) );
+ (void)new wxButton( panel, ID_COMBO_CLEAR, wxT("&Clear"), wxPoint(180,80), wxSize(140,30) );
+ (void)new wxButton( panel, ID_COMBO_APPEND, wxT("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) );
+ (void)new wxButton( panel, ID_COMBO_DELETE, wxT("D&elete selected item"), wxPoint(180,130), wxSize(140,30) );
+ (void)new wxButton( panel, ID_COMBO_FONT, wxT("Set &Italic font"), wxPoint(340,130), wxSize(140,30) );
+ (void)new wxButton( panel, ID_COMBO_SET_TEXT, wxT("Set 'Hi!' at #2"), wxPoint(340,180), wxSize(140,30) );
+ (void)new wxCheckBox( panel, ID_COMBO_ENABLE, wxT("&Disable"), wxPoint(20,130), wxSize(140,30) );
+ m_book->AddPage(panel, wxT("wxComboBox"), false, Image_Combo);
wxString choices2[] =
{
- _T("First"), _T("Second"),
+ wxT("First"), wxT("Second"),
/* "Third",
"Fourth", "Fifth", "Sixth",
"Seventh", "Eighth", "Nineth", "Tenth" */
};
panel = new wxPanel(m_book);
- new MyRadioBox(panel, ID_RADIOBOX2, _T("&That"),
+ new MyRadioBox(panel, ID_RADIOBOX2, wxT("&That"),
wxPoint(10,160), wxDefaultSize,
WXSIZEOF(choices2), choices2,
1, wxRA_SPECIFY_ROWS );
- m_radio = new wxRadioBox(panel, ID_RADIOBOX, _T("T&his"),
+ m_radio = new wxRadioBox(panel, ID_RADIOBOX, wxT("T&his"),
wxPoint(10,10), wxDefaultSize,
WXSIZEOF(choices), choices,
1, wxRA_SPECIFY_COLS );
#if wxUSE_HELP
for( unsigned int item = 0; item < WXSIZEOF(choices); ++item )
- m_radio->SetItemHelpText( item, wxString::Format( _T("Help text for \"%s\""), choices[item].c_str() ) );
+ m_radio->SetItemHelpText( item, wxString::Format( wxT("Help text for \"%s\""), choices[item].c_str() ) );
// erase help text for the second item
- m_radio->SetItemHelpText( 1, _T("") );
+ m_radio->SetItemHelpText( 1, wxT("") );
// set default help text for control
- m_radio->SetHelpText( _T("Default helptext for wxRadioBox") );
+ m_radio->SetHelpText( wxT("Default helptext for wxRadioBox") );
#endif // wxUSE_HELP
- (void)new wxButton( panel, ID_RADIOBOX_SEL_NUM, _T("Select #&2"), wxPoint(180,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_RADIOBOX_SEL_STR, _T("&Select 'This'"), wxPoint(180,80), wxSize(140,30) );
- m_fontButton = new wxButton( panel, ID_SET_FONT, _T("Set &more Italic font"), wxPoint(340,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_RADIOBOX_FONT, _T("Set &Italic font"), wxPoint(340,80), wxSize(140,30) );
- (void)new wxCheckBox( panel, ID_RADIOBOX_ENABLE, _T("&Disable"), wxPoint(340,130), wxDefaultSize );
+ (void)new wxButton( panel, ID_RADIOBOX_SEL_NUM, wxT("Select #&2"), wxPoint(180,30), wxSize(140,30) );
+ (void)new wxButton( panel, ID_RADIOBOX_SEL_STR, wxT("&Select 'This'"), wxPoint(180,80), wxSize(140,30) );
+ m_fontButton = new wxButton( panel, ID_SET_FONT, wxT("Set &more Italic font"), wxPoint(340,30), wxSize(140,30) );
+ (void)new wxButton( panel, ID_RADIOBOX_FONT, wxT("Set &Italic font"), wxPoint(340,80), wxSize(140,30) );
+ (void)new wxCheckBox( panel, ID_RADIOBOX_ENABLE, wxT("&Disable"), wxPoint(340,130), wxDefaultSize );
- wxRadioButton *rb = new wxRadioButton( panel, ID_RADIOBUTTON_1, _T("Radiobutton1"), wxPoint(210,170), wxDefaultSize, wxRB_GROUP );
+ wxRadioButton *rb = new wxRadioButton( panel, ID_RADIOBUTTON_1, wxT("Radiobutton1"), wxPoint(210,170), wxDefaultSize, wxRB_GROUP );
rb->SetValue( false );
- (void)new wxRadioButton( panel, ID_RADIOBUTTON_2, _T("&Radiobutton2"), wxPoint(340,170), wxDefaultSize );
- m_book->AddPage(panel, _T("wxRadioBox"), false, Image_Radio);
+ (void)new wxRadioButton( panel, ID_RADIOBUTTON_2, wxT("&Radiobutton2"), wxPoint(340,170), wxDefaultSize );
+ m_book->AddPage(panel, wxT("wxRadioBox"), false, Image_Radio);
#if wxUSE_SLIDER && wxUSE_GAUGE
wxBoxSizer *main_sizer = new wxBoxSizer( wxHORIZONTAL );
panel->SetSizer( main_sizer );
- wxStaticBoxSizer *gauge_sizer = new wxStaticBoxSizer( wxHORIZONTAL, panel, _T("&wxGauge and wxSlider") );
+ wxStaticBoxSizer *gauge_sizer = new wxStaticBoxSizer( wxHORIZONTAL, panel, wxT("&wxGauge and wxSlider") );
main_sizer->Add( gauge_sizer, 0, wxALL, 5 );
wxBoxSizer *sz = new wxBoxSizer( wxVERTICAL );
gauge_sizer->Add( sz );
- wxStaticBox *sb = new wxStaticBox( panel, wxID_ANY, _T("&Explanation"),
+ wxStaticBox *sb = new wxStaticBox( panel, wxID_ANY, wxT("&Explanation"),
wxDefaultPosition, wxDefaultSize ); //, wxALIGN_CENTER );
wxStaticBoxSizer *wrapping_sizer = new wxStaticBoxSizer( sb, wxVERTICAL );
main_sizer->Add( wrapping_sizer, 0, wxALL, 5 );
#ifdef __WXMOTIF__
// No wrapping text in wxStaticText yet :-(
m_wrappingText = new wxStaticText( panel, wxID_ANY,
- _T("Drag the slider!"),
+ wxT("Drag the slider!"),
wxPoint(250,30),
wxSize(240, wxDefaultCoord)
);
#else
m_wrappingText = new wxStaticText( panel, wxID_ANY,
- _T("In order see the gauge (aka progress bar) ")
- _T("control do something you have to drag the ")
- _T("handle of the slider to the right.")
- _T("\n\n")
- _T("This is also supposed to demonstrate how ")
- _T("to use static controls with line wrapping."),
+ wxT("In order see the gauge (aka progress bar) ")
+ wxT("control do something you have to drag the ")
+ wxT("handle of the slider to the right.")
+ wxT("\n\n")
+ wxT("This is also supposed to demonstrate how ")
+ wxT("to use static controls with line wrapping."),
wxDefaultPosition,
wxSize(240, wxDefaultCoord)
);
main_sizer->Add( non_wrapping_sizer, 0, wxALL, 5 );
m_nonWrappingText = new wxStaticText( panel, wxID_ANY,
- _T("This static text has two lines.\nThey do not wrap."),
+ wxT("This static text has two lines.\nThey do not wrap."),
wxDefaultPosition,
wxDefaultSize
);
m_spinbutton->SetValue(initialSpinValue);
#if wxUSE_PROGRESSDLG
- m_btnProgress = new wxButton( panel, ID_BTNPROGRESS, _T("&Show progress dialog"),
+ m_btnProgress = new wxButton( panel, ID_BTNPROGRESS, wxT("&Show progress dialog"),
wxPoint(300, 160) );
#endif // wxUSE_PROGRESSDLG
#endif // wxUSE_SPINBTN
m_spinctrl->SetValue(15);
#endif // wxUSE_SPINCTRL
- m_book->AddPage(panel, _T("wxGauge"), false, Image_Gauge);
+ m_book->AddPage(panel, wxT("wxGauge"), false, Image_Gauge);
#endif // wxUSE_SLIDER && wxUSE_GAUGE
dc.SetPen(*wxRED_PEN);
dc.Clear();
dc.DrawEllipse(5, 5, 90, 90);
- dc.DrawText(_T("Bitmap"), 30, 40);
+ dc.DrawText(wxT("Bitmap"), 30, 40);
dc.SelectObject( wxNullBitmap );
(void)new wxBitmapButton(panel, ID_BITMAP_BTN, bitmap, wxPoint(100, 20));
(void)new wxToggleButton(panel, ID_BITMAP_BTN_ENABLE,
- _T("Enable/disable &bitmap"), wxPoint(100, 140));
+ wxT("Enable/disable &bitmap"), wxPoint(100, 140));
#if defined(__WXMSW__) || defined(__WXMOTIF__)
// test for masked bitmap display
- bitmap = wxBitmap(_T("test2.bmp"), wxBITMAP_TYPE_BMP);
+ bitmap = wxBitmap(wxT("test2.bmp"), wxBITMAP_TYPE_BMP);
if (bitmap.Ok())
{
bitmap.SetMask(new wxMask(bitmap, *wxBLUE));
bmpBtn->SetBitmapFocus(bmp3);
(void)new wxToggleButton(panel, ID_BUTTON_LABEL,
- _T("&Toggle label"), wxPoint(250, 20));
+ wxT("&Toggle label"), wxPoint(250, 20));
- m_label = new wxStaticText(panel, wxID_ANY, _T("Label with some long text"),
+ m_label = new wxStaticText(panel, wxID_ANY, wxT("Label with some long text"),
wxPoint(250, 60), wxDefaultSize,
wxALIGN_RIGHT /*| wxST_NO_AUTORESIZE*/);
m_label->SetForegroundColour( *wxBLUE );
- m_book->AddPage(panel, _T("wxBitmapXXX"));
+ m_book->AddPage(panel, wxT("wxBitmapXXX"));
// sizer
panel = new wxPanel(m_book);
wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer *csizer =
- new wxStaticBoxSizer (new wxStaticBox (panel, wxID_ANY, _T("Show Buttons")), wxHORIZONTAL );
+ new wxStaticBoxSizer (new wxStaticBox (panel, wxID_ANY, wxT("Show Buttons")), wxHORIZONTAL );
wxCheckBox *check1, *check2, *check3, *check4, *check14, *checkBig;
- check1 = new wxCheckBox (panel, ID_SIZER_CHECK1, _T("1"));
+ check1 = new wxCheckBox (panel, ID_SIZER_CHECK1, wxT("1"));
check1->SetValue (true);
csizer->Add (check1);
- check2 = new wxCheckBox (panel, ID_SIZER_CHECK2, _T("2"));
+ check2 = new wxCheckBox (panel, ID_SIZER_CHECK2, wxT("2"));
check2->SetValue (true);
csizer->Add (check2);
- check3 = new wxCheckBox (panel, ID_SIZER_CHECK3, _T("3"));
+ check3 = new wxCheckBox (panel, ID_SIZER_CHECK3, wxT("3"));
check3->SetValue (true);
csizer->Add (check3);
- check4 = new wxCheckBox (panel, ID_SIZER_CHECK4, _T("4"));
+ check4 = new wxCheckBox (panel, ID_SIZER_CHECK4, wxT("4"));
check4->SetValue (true);
csizer->Add (check4);
- check14 = new wxCheckBox (panel, ID_SIZER_CHECK14, _T("1-4"));
+ check14 = new wxCheckBox (panel, ID_SIZER_CHECK14, wxT("1-4"));
check14->SetValue (true);
csizer->Add (check14);
- checkBig = new wxCheckBox (panel, ID_SIZER_CHECKBIG, _T("Big"));
+ checkBig = new wxCheckBox (panel, ID_SIZER_CHECKBIG, wxT("Big"));
checkBig->SetValue (true);
csizer->Add (checkBig);
m_buttonSizer = new wxBoxSizer (wxVERTICAL);
- m_sizerBtn1 = new wxButton(panel, wxID_ANY, _T("Test Button &1 (tab order 1)") );
+ m_sizerBtn1 = new wxButton(panel, wxID_ANY, wxT("Test Button &1 (tab order 1)") );
m_buttonSizer->Add( m_sizerBtn1, 0, wxALL, 10 );
- m_sizerBtn2 = new wxButton(panel, wxID_ANY, _T("Test Button &2 (tab order 3)") );
+ m_sizerBtn2 = new wxButton(panel, wxID_ANY, wxT("Test Button &2 (tab order 3)") );
m_buttonSizer->Add( m_sizerBtn2, 0, wxALL, 10 );
- m_sizerBtn3 = new wxButton(panel, wxID_ANY, _T("Test Button &3 (tab order 2)") );
+ m_sizerBtn3 = new wxButton(panel, wxID_ANY, wxT("Test Button &3 (tab order 2)") );
m_buttonSizer->Add( m_sizerBtn3, 0, wxALL, 10 );
- m_sizerBtn4 = new wxButton(panel, wxID_ANY, _T("Test Button &4 (tab order 4)") );
+ m_sizerBtn4 = new wxButton(panel, wxID_ANY, wxT("Test Button &4 (tab order 4)") );
m_buttonSizer->Add( m_sizerBtn4, 0, wxALL, 10 );
m_sizerBtn3->MoveBeforeInTabOrder(m_sizerBtn2);
m_hsizer->Add (m_buttonSizer);
m_hsizer->Add( 20,20, 1 );
- m_bigBtn = new wxButton(panel, wxID_ANY, _T("Multiline\nbutton") );
+ m_bigBtn = new wxButton(panel, wxID_ANY, wxT("Multiline\nbutton") );
m_hsizer->Add( m_bigBtn , 3, wxGROW|wxALL, 10 );
sizer->Add (m_hsizer, 1, wxGROW);
panel->SetSizer( sizer );
- m_book->AddPage(panel, _T("wxSizer"));
+ m_book->AddPage(panel, wxT("wxSizer"));
// set the sizer for the panel itself
sizer = new wxBoxSizer(wxVERTICAL);
{
if ( s_selCombo != INVALID_SELECTION )
{
- wxLogMessage(_T("EVT_IDLE: combobox selection changed from %d to %d"),
+ wxLogMessage(wxT("EVT_IDLE: combobox selection changed from %d to %d"),
s_selCombo, sel);
}
{
if ( s_selChoice != INVALID_SELECTION )
{
- wxLogMessage(_T("EVT_IDLE: choice selection changed from %d to %d"),
+ wxLogMessage(wxT("EVT_IDLE: choice selection changed from %d to %d"),
s_selChoice, sel);
}
int selOld = event.GetOldSelection();
if ( selOld == 2 )
{
- if ( wxMessageBox(_T("This demonstrates how a program may prevent the\n")
- _T("page change from taking place - if you select\n")
- _T("[No] the current page will stay the third one\n"),
- _T("Control sample"),
+ if ( wxMessageBox(wxT("This demonstrates how a program may prevent the\n")
+ wxT("page change from taking place - if you select\n")
+ wxT("[No] the current page will stay the third one\n"),
+ wxT("Control sample"),
wxICON_QUESTION | wxYES_NO, this) != wxYES )
{
event.Veto();
}
}
- *m_text << _T("Book selection is being changed from ") << selOld
- << _T(" to ") << event.GetSelection()
- << _T(" (current page from book is ")
- << m_book->GetSelection() << _T(")\n");
+ *m_text << wxT("Book selection is being changed from ") << selOld
+ << wxT(" to ") << event.GetSelection()
+ << wxT(" (current page from book is ")
+ << m_book->GetSelection() << wxT(")\n");
}
void MyPanel::OnPageChanged( wxBookCtrlEvent &event )
{
- *m_text << _T("Book selection is now ") << event.GetSelection()
- << _T(" (from book: ") << m_book->GetSelection()
- << _T(")\n");
+ *m_text << wxT("Book selection is now ") << event.GetSelection()
+ << wxT(" (from book: ") << m_book->GetSelection()
+ << wxT(")\n");
}
void MyPanel::OnTestButton(wxCommandEvent& event)
{
- wxLogMessage(_T("Button %c clicked."),
- event.GetId() == ID_BUTTON_TEST1 ? _T('1') : _T('2'));
+ wxLogMessage(wxT("Button %c clicked."),
+ event.GetId() == ID_BUTTON_TEST1 ? wxT('1') : wxT('2'));
}
void MyPanel::OnBmpButton(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("Bitmap button clicked."));
+ wxLogMessage(wxT("Bitmap button clicked."));
}
void MyPanel::OnBmpButtonToggle(wxCommandEvent& event)
{
deselect = !event.IsSelection();
if (deselect)
- m_text->AppendText( _T("ListBox deselection event\n") );
+ m_text->AppendText( wxT("ListBox deselection event\n") );
}
- m_text->AppendText( _T("ListBox event selection string is: '") );
+ m_text->AppendText( wxT("ListBox event selection string is: '") );
m_text->AppendText( event.GetString() );
- m_text->AppendText( _T("'\n") );
+ m_text->AppendText( wxT("'\n") );
// can't use GetStringSelection() with multiple selections, there could be
// more than one of them
if ( !listbox->HasFlag(wxLB_MULTIPLE) && !listbox->HasFlag(wxLB_EXTENDED) )
{
- m_text->AppendText( _T("ListBox control selection string is: '") );
+ m_text->AppendText( wxT("ListBox control selection string is: '") );
m_text->AppendText( listbox->GetStringSelection() );
- m_text->AppendText( _T("'\n") );
+ m_text->AppendText( wxT("'\n") );
}
wxStringClientData *obj = ((wxStringClientData *)event.GetClientObject());
- m_text->AppendText( _T("ListBox event client data string is: '") );
+ m_text->AppendText( wxT("ListBox event client data string is: '") );
if (obj) // BC++ doesn't like use of '? .. : .. ' in this context
m_text->AppendText( obj->GetData() );
else
- m_text->AppendText( wxString(_T("none")) );
+ m_text->AppendText( wxString(wxT("none")) );
- m_text->AppendText( _T("'\n") );
- m_text->AppendText( _T("ListBox control client data string is: '") );
+ m_text->AppendText( wxT("'\n") );
+ m_text->AppendText( wxT("ListBox control client data string is: '") );
obj = (wxStringClientData *)listbox->GetClientObject(event.GetInt());
if (obj)
m_text->AppendText( obj->GetData() );
else
- m_text->AppendText( wxString(_T("none")) );
- m_text->AppendText( _T("'\n") );
+ m_text->AppendText( wxString(wxT("none")) );
+ m_text->AppendText( wxT("'\n") );
}
void MyPanel::OnListBoxDoubleClick( wxCommandEvent &event )
{
- m_text->AppendText( _T("ListBox double click string is: ") );
+ m_text->AppendText( wxT("ListBox double click string is: ") );
m_text->AppendText( event.GetString() );
- m_text->AppendText( _T("\n") );
+ m_text->AppendText( wxT("\n") );
}
void MyPanel::OnListBoxButtons( wxCommandEvent &event )
{
case ID_LISTBOX_ENABLE:
{
- m_text->AppendText(_T("Checkbox clicked.\n"));
+ m_text->AppendText(wxT("Checkbox clicked.\n"));
#if wxUSE_TOOLTIPS
wxCheckBox *cb = (wxCheckBox*)event.GetEventObject();
if (event.GetInt())
- cb->SetToolTip( _T("Click to enable listbox") );
+ cb->SetToolTip( wxT("Click to enable listbox") );
else
- cb->SetToolTip( _T("Click to disable listbox") );
+ cb->SetToolTip( wxT("Click to disable listbox") );
#endif // wxUSE_TOOLTIPS
m_listbox->Enable( event.GetInt() == 0 );
m_lbSelectThis->Enable( event.GetInt() == 0 );
}
case ID_LISTBOX_SEL_STR:
{
- if (m_listbox->FindString(_T("This")) != wxNOT_FOUND)
- m_listbox->SetStringSelection( _T("This") );
- if (m_listboxSorted->FindString(_T("This")) != wxNOT_FOUND)
- m_listboxSorted->SetStringSelection( _T("This") );
+ if (m_listbox->FindString(wxT("This")) != wxNOT_FOUND)
+ m_listbox->SetStringSelection( wxT("This") );
+ if (m_listboxSorted->FindString(wxT("This")) != wxNOT_FOUND)
+ m_listboxSorted->SetStringSelection( wxT("This") );
m_lbSelectNum->WarpPointer( 40, 14 );
break;
}
}
case ID_LISTBOX_APPEND:
{
- m_listbox->Append( _T("Hi kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk!") );
- m_listboxSorted->Append( _T("Hi hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh!") );
+ m_listbox->Append( wxT("Hi kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk!") );
+ m_listboxSorted->Append( wxT("Hi hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh!") );
break;
}
case ID_LISTBOX_DELETE:
wxClientData *dataEvt = event.GetClientObject(),
*dataCtrl = choice->GetClientObject(sel);
- wxLogMessage(_T("EVT_CHOICE: item %d/%d (event/control), ")
- _T("string \"%s\"/\"%s\", ")
- _T("data \"%s\"/\"%s\""),
+ wxLogMessage(wxT("EVT_CHOICE: item %d/%d (event/control), ")
+ wxT("string \"%s\"/\"%s\", ")
+ wxT("data \"%s\"/\"%s\""),
(int)event.GetInt(),
sel,
event.GetString(),
}
case ID_CHOICE_SEL_STR:
{
- m_choice->SetStringSelection( _T("This") );
- m_choiceSorted->SetStringSelection( _T("This") );
+ m_choice->SetStringSelection( wxT("This") );
+ m_choiceSorted->SetStringSelection( wxT("This") );
break;
}
case ID_CHOICE_CLEAR:
}
case ID_CHOICE_APPEND:
{
- m_choice->Append( _T("Hi!") );
- m_choiceSorted->Append( _T("Hi!") );
+ m_choice->Append( wxT("Hi!") );
+ m_choiceSorted->Append( wxT("Hi!") );
break;
}
case ID_CHOICE_DELETE:
if (!m_combo)
return;
- wxLogMessage(_T("EVT_COMBOBOX: item %d/%d (event/control), string \"%s\"/\"%s\""),
+ wxLogMessage(wxT("EVT_COMBOBOX: item %d/%d (event/control), string \"%s\"/\"%s\""),
(int)event.GetInt(),
m_combo->GetSelection(),
event.GetString().c_str(),
{
if (m_combo)
{
- wxLogMessage(_T("Enter pressed in the combobox: value is '%s'."),
+ wxLogMessage(wxT("Enter pressed in the combobox: value is '%s'."),
m_combo->GetValue().c_str());
}
}
}
case ID_COMBO_SEL_STR:
{
- m_combo->SetStringSelection( _T("This") );
+ m_combo->SetStringSelection( wxT("This") );
break;
}
case ID_COMBO_CLEAR:
}
case ID_COMBO_APPEND:
{
- m_combo->Append( _T("Hi!") );
+ m_combo->Append( wxT("Hi!") );
break;
}
case ID_COMBO_DELETE:
void MyPanel::OnRadio( wxCommandEvent &event )
{
- m_text->AppendText( _T("RadioBox selection string is: ") );
+ m_text->AppendText( wxT("RadioBox selection string is: ") );
m_text->AppendText( event.GetString() );
- m_text->AppendText( _T("\n") );
+ m_text->AppendText( wxT("\n") );
}
void MyPanel::OnRadioButton1( wxCommandEvent & WXUNUSED(event) )
{
- wxMessageBox(_T("First wxRadioButton selected."), _T("wxControl sample"));
+ wxMessageBox(wxT("First wxRadioButton selected."), wxT("wxControl sample"));
}
void MyPanel::OnRadioButton2( wxCommandEvent & WXUNUSED(event) )
{
- m_text->AppendText(_T("Second wxRadioButton selected.\n"));
+ m_text->AppendText(wxT("Second wxRadioButton selected.\n"));
}
void MyPanel::OnRadioButtons( wxCommandEvent &event )
break;
case ID_RADIOBOX_SEL_STR:
- m_radio->SetStringSelection( _T("This") );
+ m_radio->SetStringSelection( wxT("This") );
break;
case ID_RADIOBOX_FONT:
void MyPanel::OnUpdateLabel( wxCommandEvent &event )
{
- m_label->SetLabel(event.GetInt() ? _T("Very very very very very long text.")
- : _T("Shorter text."));
+ m_label->SetLabel(event.GetInt() ? wxT("Very very very very very long text.")
+ : wxT("Shorter text."));
}
#if wxUSE_SLIDER
if ( m_spinctrl )
{
wxString s;
- s.Printf( _T("Spin ctrl text changed: now %d (from event: %s)\n"),
+ s.Printf( wxT("Spin ctrl text changed: now %d (from event: %s)\n"),
m_spinctrl->GetValue(), event.GetString().c_str() );
m_text->AppendText(s);
}
if ( m_spinctrl )
{
wxString s;
- s.Printf( _T("Spin ctrl changed: now %d (from event: %d)\n"),
+ s.Printf( wxT("Spin ctrl changed: now %d (from event: %d)\n"),
m_spinctrl->GetValue(), event.GetInt() );
m_text->AppendText(s);
}
if ( m_spinctrl )
{
m_text->AppendText( wxString::Format(
- _T("Spin up: %d (from event: %d)\n"),
+ wxT("Spin up: %d (from event: %d)\n"),
m_spinctrl->GetValue(), event.GetInt() ) );
}
}
if ( m_spinctrl )
{
m_text->AppendText( wxString::Format(
- _T("Spin down: %d (from event: %d)\n"),
+ wxT("Spin down: %d (from event: %d)\n"),
m_spinctrl->GetValue(), event.GetInt() ) );
}
}
void MyPanel::OnSpinUp( wxSpinEvent &event )
{
wxString value;
- value.Printf( _T("Spin control up: current = %d\n"),
+ value.Printf( wxT("Spin control up: current = %d\n"),
m_spinbutton->GetValue());
if ( event.GetPosition() > 17 )
{
- value += _T("Preventing the spin button from going above 17.\n");
+ value += wxT("Preventing the spin button from going above 17.\n");
event.Veto();
}
void MyPanel::OnSpinDown( wxSpinEvent &event )
{
wxString value;
- value.Printf( _T("Spin control down: current = %d\n"),
+ value.Printf( wxT("Spin control down: current = %d\n"),
m_spinbutton->GetValue());
if ( event.GetPosition() < -17 )
{
- value += _T("Preventing the spin button from going below -17.\n");
+ value += wxT("Preventing the spin button from going below -17.\n");
event.Veto();
}
void MyPanel::OnSpinUpdate( wxSpinEvent &event )
{
wxString value;
- value.Printf( _T("%d"), event.GetPosition() );
+ value.Printf( wxT("%d"), event.GetPosition() );
m_spintext->SetValue( value );
- value.Printf( _T("Spin control range: (%d, %d), current = %d\n"),
+ value.Printf( wxT("Spin control range: (%d, %d), current = %d\n"),
m_spinbutton->GetMin(), m_spinbutton->GetMax(),
m_spinbutton->GetValue());
if ( max <= 0 )
{
- wxLogError(_T("You must set positive range!"));
+ wxLogError(wxT("You must set positive range!"));
return;
}
- wxProgressDialog dialog(_T("Progress dialog example"),
- _T("An informative message"),
+ wxProgressDialog dialog(wxT("Progress dialog example"),
+ wxT("An informative message"),
max, // range
this, // parent
wxPD_CAN_ABORT |
wxSleep(1);
if ( i == max )
{
- cont = dialog.Update(i, _T("That's all, folks!"));
+ cont = dialog.Update(i, wxT("That's all, folks!"));
}
else if ( i == max / 2 )
{
- cont = dialog.Update(i, _T("Only a half left (very long message)!"));
+ cont = dialog.Update(i, wxT("Only a half left (very long message)!"));
}
else
{
if ( !cont )
{
- *m_text << _T("Progress dialog aborted!\n");
+ *m_text << wxT("Progress dialog aborted!\n");
}
else
{
- *m_text << _T("Countdown from ") << max << _T(" finished.\n");
+ *m_text << wxT("Countdown from ") << max << wxT(" finished.\n");
}
}
MyPanel::~MyPanel()
{
- //wxLog::RemoveTraceMask(_T("focus"));
+ //wxLog::RemoveTraceMask(wxT("focus"));
delete wxLog::SetActiveTarget(m_logTargetOld);
delete m_book->GetImageList();
MyFrame::MyFrame(const wxChar *title, int x, int y)
: wxFrame(NULL, wxID_ANY, title, wxPoint(x, y), wxSize(700, 450))
{
- SetHelpText( _T("Controls sample demonstrating various widgets") );
+ SetHelpText( wxT("Controls sample demonstrating various widgets") );
// Give it an icon
// The wxICON() macros loads an icon from a resource under Windows
wxMenu *file_menu = new wxMenu;
- file_menu->Append(CONTROLS_CLEAR_LOG, _T("&Clear log\tCtrl-L"));
+ file_menu->Append(CONTROLS_CLEAR_LOG, wxT("&Clear log\tCtrl-L"));
file_menu->AppendSeparator();
- file_menu->Append(CONTROLS_ABOUT, _T("&About\tF1"));
+ file_menu->Append(CONTROLS_ABOUT, wxT("&About\tF1"));
file_menu->AppendSeparator();
- file_menu->Append(CONTROLS_QUIT, _T("E&xit\tAlt-X"), _T("Quit controls sample"));
+ file_menu->Append(CONTROLS_QUIT, wxT("E&xit\tAlt-X"), wxT("Quit controls sample"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
+ menu_bar->Append(file_menu, wxT("&File"));
#if wxUSE_TOOLTIPS
wxMenu *tooltip_menu = new wxMenu;
- tooltip_menu->Append(CONTROLS_SET_TOOLTIP_DELAY, _T("Set &delay\tCtrl-D"));
+ tooltip_menu->Append(CONTROLS_SET_TOOLTIP_DELAY, wxT("Set &delay\tCtrl-D"));
tooltip_menu->AppendSeparator();
- tooltip_menu->Append(CONTROLS_ENABLE_TOOLTIPS, _T("&Toggle tooltips\tCtrl-T"),
- _T("enable/disable tooltips"), true);
+ tooltip_menu->Append(CONTROLS_ENABLE_TOOLTIPS, wxT("&Toggle tooltips\tCtrl-T"),
+ wxT("enable/disable tooltips"), true);
tooltip_menu->Check(CONTROLS_ENABLE_TOOLTIPS, true);
#ifdef __WXMSW__
tooltip_menu->Append(CONTROLS_SET_TOOLTIPS_MAX_WIDTH, "Set maximal &width");
#endif // __WXMSW__
- menu_bar->Append(tooltip_menu, _T("&Tooltips"));
+ menu_bar->Append(tooltip_menu, wxT("&Tooltips"));
#endif // wxUSE_TOOLTIPS
wxMenu *panel_menu = new wxMenu;
- panel_menu->Append(CONTROLS_ENABLE_ALL, _T("&Disable all\tCtrl-E"),
- _T("Enable/disable all panel controls"), true);
- panel_menu->Append(CONTROLS_HIDE_ALL, _T("&Hide all\tCtrl-I"),
- _T("Show/hide thoe whole panel controls"), true);
- panel_menu->Append(CONTROLS_HIDE_LIST, _T("Hide &list ctrl\tCtrl-S"),
- _T("Enable/disable all panel controls"), true);
- panel_menu->Append(CONTROLS_CONTEXT_HELP, _T("&Context help...\tCtrl-H"),
- _T("Get context help for a control"));
- menu_bar->Append(panel_menu, _T("&Panel"));
+ panel_menu->Append(CONTROLS_ENABLE_ALL, wxT("&Disable all\tCtrl-E"),
+ wxT("Enable/disable all panel controls"), true);
+ panel_menu->Append(CONTROLS_HIDE_ALL, wxT("&Hide all\tCtrl-I"),
+ wxT("Show/hide thoe whole panel controls"), true);
+ panel_menu->Append(CONTROLS_HIDE_LIST, wxT("Hide &list ctrl\tCtrl-S"),
+ wxT("Enable/disable all panel controls"), true);
+ panel_menu->Append(CONTROLS_CONTEXT_HELP, wxT("&Context help...\tCtrl-H"),
+ wxT("Get context help for a control"));
+ menu_bar->Append(panel_menu, wxT("&Panel"));
SetMenuBar(menu_bar);
{
wxBusyCursor bc;
- wxMessageDialog dialog(this, _T("This is a control sample"), _T("About Controls"), wxOK );
+ wxMessageDialog dialog(this, wxT("This is a control sample"), wxT("About Controls"), wxOK );
dialog.ShowModal();
}
static long s_delay = 5000;
wxString delay;
- delay.Printf( _T("%ld"), s_delay);
+ delay.Printf( wxT("%ld"), s_delay);
- delay = wxGetTextFromUser(_T("Enter delay (in milliseconds)"),
- _T("Set tooltip delay"),
+ delay = wxGetTextFromUser(wxT("Enter delay (in milliseconds)"),
+ wxT("Set tooltip delay"),
delay,
this);
if ( !delay )
return; // cancelled
- wxSscanf(delay, _T("%ld"), &s_delay);
+ wxSscanf(delay, wxT("%ld"), &s_delay);
wxToolTip::SetDelay(s_delay);
- wxLogStatus(this, _T("Tooltip delay set to %ld milliseconds"), s_delay);
+ wxLogStatus(this, wxT("Tooltip delay set to %ld milliseconds"), s_delay);
}
void MyFrame::OnToggleTooltips(wxCommandEvent& WXUNUSED(event))
wxToolTip::Enable(s_enabled);
- wxLogStatus(this, _T("Tooltips %sabled"), s_enabled ? _T("en") : _T("dis") );
+ wxLogStatus(this, wxT("Tooltips %sabled"), s_enabled ? wxT("en") : wxT("dis") );
}
#ifdef __WXMSW__
void MyFrame::OnIconized( wxIconizeEvent& event )
{
- wxLogMessage(_T("Frame %s"), event.IsIconized() ? _T("iconized")
- : _T("restored"));
+ wxLogMessage(wxT("Frame %s"), event.IsIconized() ? wxT("iconized")
+ : wxT("restored"));
event.Skip();
}
void MyFrame::OnMaximized( wxMaximizeEvent& WXUNUSED(event) )
{
- wxLogMessage(_T("Frame maximized"));
+ wxLogMessage(wxT("Frame maximized"));
}
void MyFrame::OnSize( wxSizeEvent& event )
if ( focus )
{
msg.Printf(
- _T("Focus: %s")
+ wxT("Focus: %s")
#ifdef __WXMSW__
- , _T(", HWND = %08x")
+ , wxT(", HWND = %08x")
#endif
, s_windowFocus->GetName().c_str()
#ifdef __WXMSW__
}
else
{
- msg = _T("No focus");
+ msg = wxT("No focus");
}
#if wxUSE_STATUSBAR
void MyComboBox::OnChar(wxKeyEvent& event)
{
- wxLogMessage(_T("MyComboBox::OnChar"));
+ wxLogMessage(wxT("MyComboBox::OnChar"));
if ( event.GetKeyCode() == 'w' )
{
- wxLogMessage(_T("MyComboBox: 'w' will be ignored."));
+ wxLogMessage(wxT("MyComboBox: 'w' will be ignored."));
}
else
{
void MyComboBox::OnKeyDown(wxKeyEvent& event)
{
- wxLogMessage(_T("MyComboBox::OnKeyDown"));
+ wxLogMessage(wxT("MyComboBox::OnKeyDown"));
if ( event.GetKeyCode() == 'w' )
{
- wxLogMessage(_T("MyComboBox: 'w' will be ignored."));
+ wxLogMessage(wxT("MyComboBox: 'w' will be ignored."));
}
else
{
void MyComboBox::OnKeyUp(wxKeyEvent& event)
{
- wxLogMessage(_T("MyComboBox::OnKeyUp"));
+ wxLogMessage(wxT("MyComboBox::OnKeyUp"));
event.Skip();
}
wxAboutDialogInfo info;
info.SetName(_("DataView sample"));
info.SetDescription(_("This sample demonstrates wxDataViewCtrl"));
- info.SetCopyright(_T("(C) 2007-2009 Robert Roebling"));
+ info.SetCopyright(wxT("(C) 2007-2009 Robert Roebling"));
info.AddDeveloper("Robert Roebling");
info.AddDeveloper("Francesco Montorsi");
public:
MyDebugReport() : wxDebugReportUpload
(
- _T("http://your.url.here/"),
- _T("report:file"),
- _T("action")
+ wxT("http://your.url.here/"),
+ wxT("report:file"),
+ wxT("action")
)
{
}
{
if ( reply.IsEmpty() )
{
- wxLogError(_T("Didn't receive the expected server reply."));
+ wxLogError(wxT("Didn't receive the expected server reply."));
return false;
}
- wxString s(_T("Server replied:\n"));
+ wxString s(wxT("Server replied:\n"));
const size_t count = reply.GetCount();
for ( size_t n = 0; n < count; n++ )
{
- s << _T('\t') << reply[n] << _T('\n');
+ s << wxT('\t') << reply[n] << wxT('\n');
}
- wxLogMessage(_T("%s"), s.c_str());
+ wxLogMessage(wxT("%s"), s.c_str());
return true;
}
{
if ( !wxDebugReportCompress::DoProcess() )
return false;
- wxMailMessage msg(GetReportName() + _T(" crash report"),
- _T("vadim@wxwindows.org"),
+ wxMailMessage msg(GetReportName() + wxT(" crash report"),
+ wxT("vadim@wxwindows.org"),
wxEmptyString, // mail body
wxEmptyString, // from address
GetCompressedFileName(),
- _T("crashreport.zip"));
+ wxT("crashreport.zip"));
return wxEmail::Send(msg);
}
END_EVENT_TABLE()
MyFrame::MyFrame()
- : wxFrame(NULL, wxID_ANY, _T("wxWidgets Debug Report Sample"),
+ : wxFrame(NULL, wxID_ANY, wxT("wxWidgets Debug Report Sample"),
wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxDEFAULT_FRAME_STYLE)
{
m_numLines = 10;
SetIcon(wxICON(sample));
wxMenu *menuFile = new wxMenu;
- menuFile->Append(DebugRpt_Quit, _T("E&xit\tAlt-X"));
+ menuFile->Append(DebugRpt_Quit, wxT("E&xit\tAlt-X"));
wxMenu *menuReport = new wxMenu;
- menuReport->Append(DebugRpt_Crash, _T("Report for &crash\tCtrl-C"),
- _T("Provoke a crash inside the program and create report for it"));
- menuReport->Append(DebugRpt_Current, _T("Report for c&urrent context\tCtrl-U"),
- _T("Create report for the current program context"));
- menuReport->Append(DebugRpt_Paint, _T("Report for &paint handler\tCtrl-P"),
- _T("Provoke a repeatable crash in wxEVT_PAINT handler"));
+ menuReport->Append(DebugRpt_Crash, wxT("Report for &crash\tCtrl-C"),
+ wxT("Provoke a crash inside the program and create report for it"));
+ menuReport->Append(DebugRpt_Current, wxT("Report for c&urrent context\tCtrl-U"),
+ wxT("Create report for the current program context"));
+ menuReport->Append(DebugRpt_Paint, wxT("Report for &paint handler\tCtrl-P"),
+ wxT("Provoke a repeatable crash in wxEVT_PAINT handler"));
menuReport->AppendSeparator();
- menuReport->AppendCheckItem(DebugRpt_Upload, _T("Up&load debug report"),
- _T("You need to configure a web server accepting debug report uploads to use this function"));
+ menuReport->AppendCheckItem(DebugRpt_Upload, wxT("Up&load debug report"),
+ wxT("You need to configure a web server accepting debug report uploads to use this function"));
wxMenu *menuHelp = new wxMenu;
- menuHelp->Append(DebugRpt_About, _T("&About...\tF1"));
+ menuHelp->Append(DebugRpt_About, wxT("&About...\tF1"));
wxMenuBar *mbar = new wxMenuBar();
- mbar->Append(menuFile, _T("&File"));
- mbar->Append(menuReport, _T("&Report"));
- mbar->Append(menuHelp, _T("&Help"));
+ mbar->Append(menuFile, wxT("&File"));
+ mbar->Append(menuReport, wxT("&Report"));
+ mbar->Append(menuHelp, wxT("&Help"));
SetMenuBar(mbar);
CreateStatusBar();
{
wxMessageBox
(
- _T("wxDebugReport sample\n(c) 2005 Vadim Zeitlin <vadim@wxwindows.org>"),
- _T("wxWidgets Debug Report Sample"),
+ wxT("wxDebugReport sample\n(c) 2005 Vadim Zeitlin <vadim@wxwindows.org>"),
+ wxT("wxWidgets Debug Report Sample"),
wxOK | wxICON_INFORMATION,
this
);
// you can also call report->AddFile(...) with your own log files, files
// created using wxRegKey::Export() and so on, here we just add a test
// file containing the date of the crash
- wxFileName fn(report->GetDirectory(), _T("timestamp.my"));
- wxFFile file(fn.GetFullPath(), _T("w"));
+ wxFileName fn(report->GetDirectory(), wxT("timestamp.my"));
+ wxFFile file(fn.GetFullPath(), wxT("w"));
if ( file.IsOpened() )
{
wxDateTime dt = wxDateTime::Now();
- file.Write(dt.FormatISODate() + _T(' ') + dt.FormatISOTime());
+ file.Write(dt.FormatISODate() + wxT(' ') + dt.FormatISOTime());
file.Close();
}
- report->AddFile(fn.GetFullName(), _T("timestamp of this report"));
+ report->AddFile(fn.GetFullName(), wxT("timestamp of this report"));
// can also add an existing file directly, it will be copied
// automatically
#ifdef __WXMSW__
- report->AddFile(_T("c:\\autoexec.bat"), _T("DOS startup file"));
+ report->AddFile(wxT("c:\\autoexec.bat"), wxT("DOS startup file"));
#else
- report->AddFile(_T("/etc/motd"), _T("Message of the day"));
+ report->AddFile(wxT("/etc/motd"), wxT("Message of the day"));
#endif
// calling Show() is not mandatory, but is more polite
{
if ( m_uploadReport )
{
- wxLogMessage(_T("Report successfully uploaded."));
+ wxLogMessage(wxT("Report successfully uploaded."));
}
else
{
- wxLogMessage(_T("Report generated in \"%s\"."),
+ wxLogMessage(wxT("Report generated in \"%s\"."),
report->GetCompressedFileName().c_str());
report->Reset();
}
m_canvasFont = *wxNORMAL_FONT;
// Create the main frame window
- MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets dialogs example"));
+ MyFrame *frame = new MyFrame((wxFrame *) NULL, wxT("wxWidgets dialogs example"));
// Make a menubar
wxMenu *menuDlg = new wxMenu;
- menuDlg->Append(DIALOGS_MESSAGE_BOX, _T("&Message box\tCtrl-M"));
- menuDlg->Append(DIALOGS_MESSAGE_DIALOG, _T("Message dialog\tShift-Ctrl-M"));
+ menuDlg->Append(DIALOGS_MESSAGE_BOX, wxT("&Message box\tCtrl-M"));
+ menuDlg->Append(DIALOGS_MESSAGE_DIALOG, wxT("Message dialog\tShift-Ctrl-M"));
#if wxUSE_COLOURDLG || wxUSE_FONTDLG || wxUSE_CHOICEDLG
wxMenu *choices_menu = new wxMenu;
#if wxUSE_COLOURDLG
- choices_menu->Append(DIALOGS_CHOOSE_COLOUR, _T("&Choose bg colour"));
- choices_menu->Append(DIALOGS_GET_COLOUR, _T("&Choose fg colour"));
+ choices_menu->Append(DIALOGS_CHOOSE_COLOUR, wxT("&Choose bg colour"));
+ choices_menu->Append(DIALOGS_GET_COLOUR, wxT("&Choose fg colour"));
#endif // wxUSE_COLOURDLG
#if wxUSE_FONTDLG
- choices_menu->Append(DIALOGS_CHOOSE_FONT, _T("Choose &font"));
+ choices_menu->Append(DIALOGS_CHOOSE_FONT, wxT("Choose &font"));
#endif // wxUSE_FONTDLG
#if wxUSE_CHOICEDLG
- choices_menu->Append(DIALOGS_SINGLE_CHOICE, _T("&Single choice\tCtrl-C"));
- choices_menu->Append(DIALOGS_MULTI_CHOICE, _T("M&ultiple choice\tCtrl-U"));
+ choices_menu->Append(DIALOGS_SINGLE_CHOICE, wxT("&Single choice\tCtrl-C"));
+ choices_menu->Append(DIALOGS_MULTI_CHOICE, wxT("M&ultiple choice\tCtrl-U"));
#endif // wxUSE_CHOICEDLG
#if wxUSE_REARRANGECTRL
- choices_menu->Append(DIALOGS_REARRANGE, _T("&Rearrange dialog\tCtrl-R"));
+ choices_menu->Append(DIALOGS_REARRANGE, wxT("&Rearrange dialog\tCtrl-R"));
#endif // wxUSE_REARRANGECTRL
#if USE_COLOURDLG_GENERIC || USE_FONTDLG_GENERIC
#endif // USE_COLOURDLG_GENERIC || USE_FONTDLG_GENERIC
#if USE_COLOURDLG_GENERIC
- choices_menu->Append(DIALOGS_CHOOSE_COLOUR_GENERIC, _T("&Choose colour (generic)"));
+ choices_menu->Append(DIALOGS_CHOOSE_COLOUR_GENERIC, wxT("&Choose colour (generic)"));
#endif // USE_COLOURDLG_GENERIC
#if USE_FONTDLG_GENERIC
- choices_menu->Append(DIALOGS_CHOOSE_FONT_GENERIC, _T("Choose &font (generic)"));
+ choices_menu->Append(DIALOGS_CHOOSE_FONT_GENERIC, wxT("Choose &font (generic)"));
#endif // USE_FONTDLG_GENERIC
- menuDlg->Append(wxID_ANY,_T("&Choices and selectors"),choices_menu);
+ menuDlg->Append(wxID_ANY,wxT("&Choices and selectors"),choices_menu);
#endif // wxUSE_COLOURDLG || wxUSE_FONTDLG || wxUSE_CHOICEDLG
wxMenu *entry_menu = new wxMenu;
#if wxUSE_TEXTDLG
- entry_menu->Append(DIALOGS_TEXT_ENTRY, _T("Text &entry\tCtrl-E"));
- entry_menu->Append(DIALOGS_PASSWORD_ENTRY, _T("&Password entry\tCtrl-P"));
+ entry_menu->Append(DIALOGS_TEXT_ENTRY, wxT("Text &entry\tCtrl-E"));
+ entry_menu->Append(DIALOGS_PASSWORD_ENTRY, wxT("&Password entry\tCtrl-P"));
#endif // wxUSE_TEXTDLG
#if wxUSE_NUMBERDLG
- entry_menu->Append(DIALOGS_NUM_ENTRY, _T("&Numeric entry\tCtrl-N"));
+ entry_menu->Append(DIALOGS_NUM_ENTRY, wxT("&Numeric entry\tCtrl-N"));
#endif // wxUSE_NUMBERDLG
- menuDlg->Append(wxID_ANY,_T("&Entry dialogs"),entry_menu);
+ menuDlg->Append(wxID_ANY,wxT("&Entry dialogs"),entry_menu);
#endif // wxUSE_TEXTDLG || wxUSE_NUMBERDLG
#if wxUSE_FILEDLG
wxMenu *filedlg_menu = new wxMenu;
- filedlg_menu->Append(DIALOGS_FILE_OPEN, _T("&Open file\tCtrl-O"));
- filedlg_menu->Append(DIALOGS_FILE_OPEN2, _T("&Second open file\tCtrl-2"));
- filedlg_menu->Append(DIALOGS_FILES_OPEN, _T("Open &files\tCtrl-Q"));
- filedlg_menu->Append(DIALOGS_FILE_SAVE, _T("Sa&ve file\tCtrl-S"));
+ filedlg_menu->Append(DIALOGS_FILE_OPEN, wxT("&Open file\tCtrl-O"));
+ filedlg_menu->Append(DIALOGS_FILE_OPEN2, wxT("&Second open file\tCtrl-2"));
+ filedlg_menu->Append(DIALOGS_FILES_OPEN, wxT("Open &files\tCtrl-Q"));
+ filedlg_menu->Append(DIALOGS_FILE_SAVE, wxT("Sa&ve file\tCtrl-S"));
#if USE_FILEDLG_GENERIC
filedlg_menu->AppendSeparator();
- filedlg_menu->Append(DIALOGS_FILE_OPEN_GENERIC, _T("&Open file (generic)"));
- filedlg_menu->Append(DIALOGS_FILES_OPEN_GENERIC, _T("Open &files (generic)"));
- filedlg_menu->Append(DIALOGS_FILE_SAVE_GENERIC, _T("Sa&ve file (generic)"));
+ filedlg_menu->Append(DIALOGS_FILE_OPEN_GENERIC, wxT("&Open file (generic)"));
+ filedlg_menu->Append(DIALOGS_FILES_OPEN_GENERIC, wxT("Open &files (generic)"));
+ filedlg_menu->Append(DIALOGS_FILE_SAVE_GENERIC, wxT("Sa&ve file (generic)"));
#endif // USE_FILEDLG_GENERIC
- menuDlg->Append(wxID_ANY,_T("&File operations"),filedlg_menu);
+ menuDlg->Append(wxID_ANY,wxT("&File operations"),filedlg_menu);
#endif // wxUSE_FILEDLG
#if wxUSE_DIRDLG
wxMenu *dir_menu = new wxMenu;
- dir_menu->Append(DIALOGS_DIR_CHOOSE, _T("&Choose a directory\tCtrl-D"));
- dir_menu->Append(DIALOGS_DIRNEW_CHOOSE, _T("Choose a directory (with \"Ne&w\" button)\tShift-Ctrl-D"));
- menuDlg->Append(wxID_ANY,_T("&Directory operations"),dir_menu);
+ dir_menu->Append(DIALOGS_DIR_CHOOSE, wxT("&Choose a directory\tCtrl-D"));
+ dir_menu->Append(DIALOGS_DIRNEW_CHOOSE, wxT("Choose a directory (with \"Ne&w\" button)\tShift-Ctrl-D"));
+ menuDlg->Append(wxID_ANY,wxT("&Directory operations"),dir_menu);
#if USE_DIRDLG_GENERIC
dir_menu->AppendSeparator();
- dir_menu->Append(DIALOGS_GENERIC_DIR_CHOOSE, _T("&Choose a directory (generic)"));
+ dir_menu->Append(DIALOGS_GENERIC_DIR_CHOOSE, wxT("&Choose a directory (generic)"));
#endif // USE_DIRDLG_GENERIC
#endif // wxUSE_DIRDLG
wxMenu *info_menu = new wxMenu;
#if wxUSE_STARTUP_TIPS
- info_menu->Append(DIALOGS_TIP, _T("&Tip of the day\tCtrl-T"));
+ info_menu->Append(DIALOGS_TIP, wxT("&Tip of the day\tCtrl-T"));
#endif // wxUSE_STARTUP_TIPS
#if wxUSE_PROGRESSDLG
- info_menu->Append(DIALOGS_PROGRESS, _T("Pro&gress dialog\tCtrl-G"));
+ info_menu->Append(DIALOGS_PROGRESS, wxT("Pro&gress dialog\tCtrl-G"));
#endif // wxUSE_PROGRESSDLG
#if wxUSE_BUSYINFO
- info_menu->Append(DIALOGS_BUSYINFO, _T("&Busy info dialog\tCtrl-B"));
+ info_menu->Append(DIALOGS_BUSYINFO, wxT("&Busy info dialog\tCtrl-B"));
#endif // wxUSE_BUSYINFO
#if wxUSE_LOG_DIALOG
- info_menu->Append(DIALOGS_LOG_DIALOG, _T("&Log dialog\tCtrl-L"));
+ info_menu->Append(DIALOGS_LOG_DIALOG, wxT("&Log dialog\tCtrl-L"));
#endif // wxUSE_LOG_DIALOG
#if wxUSE_MSGDLG
info_menu->Append(DIALOGS_MESSAGE_BOX_WXINFO,
- _T("&wxWidgets information\tCtrl-I"));
+ wxT("&wxWidgets information\tCtrl-I"));
#endif // wxUSE_MSGDLG
- menuDlg->Append(wxID_ANY,_T("&Informative dialogs"),info_menu);
+ menuDlg->Append(wxID_ANY,wxT("&Informative dialogs"),info_menu);
#endif // wxUSE_STARTUP_TIPS || wxUSE_PROGRESSDLG || wxUSE_BUSYINFO || wxUSE_LOG_DIALOG
#if wxUSE_FINDREPLDLG
wxMenu *find_menu = new wxMenu;
- find_menu->AppendCheckItem(DIALOGS_FIND, _T("&Find dialog\tCtrl-F"));
- find_menu->AppendCheckItem(DIALOGS_REPLACE, _T("Find and &replace dialog\tShift-Ctrl-F"));
- menuDlg->Append(wxID_ANY,_T("&Searching"),find_menu);
+ find_menu->AppendCheckItem(DIALOGS_FIND, wxT("&Find dialog\tCtrl-F"));
+ find_menu->AppendCheckItem(DIALOGS_REPLACE, wxT("Find and &replace dialog\tShift-Ctrl-F"));
+ menuDlg->Append(wxID_ANY,wxT("&Searching"),find_menu);
#endif // wxUSE_FINDREPLDLG
wxMenu *dialogs_menu = new wxMenu;
#if USE_MODAL_PRESENTATION
- dialogs_menu->Append(DIALOGS_MODAL, _T("&Modal dialog\tCtrl-W"));
+ dialogs_menu->Append(DIALOGS_MODAL, wxT("&Modal dialog\tCtrl-W"));
#endif // USE_MODAL_PRESENTATION
- dialogs_menu->AppendCheckItem(DIALOGS_MODELESS, _T("Mode&less dialog\tCtrl-Z"));
- dialogs_menu->Append(DIALOGS_CENTRE_SCREEN, _T("Centered on &screen\tShift-Ctrl-1"));
- dialogs_menu->Append(DIALOGS_CENTRE_PARENT, _T("Centered on &parent\tShift-Ctrl-2"));
+ dialogs_menu->AppendCheckItem(DIALOGS_MODELESS, wxT("Mode&less dialog\tCtrl-Z"));
+ dialogs_menu->Append(DIALOGS_CENTRE_SCREEN, wxT("Centered on &screen\tShift-Ctrl-1"));
+ dialogs_menu->Append(DIALOGS_CENTRE_PARENT, wxT("Centered on &parent\tShift-Ctrl-2"));
#if wxUSE_MINIFRAME
- dialogs_menu->Append(DIALOGS_MINIFRAME, _T("&Mini frame"));
+ dialogs_menu->Append(DIALOGS_MINIFRAME, wxT("&Mini frame"));
#endif // wxUSE_MINIFRAME
- dialogs_menu->Append(DIALOGS_ONTOP, _T("Dialog staying on &top"));
- menuDlg->Append(wxID_ANY, _T("&Generic dialogs"), dialogs_menu);
+ dialogs_menu->Append(DIALOGS_ONTOP, wxT("Dialog staying on &top"));
+ menuDlg->Append(wxID_ANY, wxT("&Generic dialogs"), dialogs_menu);
#if USE_SETTINGS_DIALOG
wxMenu *sheet_menu = new wxMenu;
- sheet_menu->Append(DIALOGS_PROPERTY_SHEET, _T("&Standard property sheet\tShift-Ctrl-P"));
- sheet_menu->Append(DIALOGS_PROPERTY_SHEET_TOOLBOOK, _T("&Toolbook sheet\tShift-Ctrl-T"));
+ sheet_menu->Append(DIALOGS_PROPERTY_SHEET, wxT("&Standard property sheet\tShift-Ctrl-P"));
+ sheet_menu->Append(DIALOGS_PROPERTY_SHEET_TOOLBOOK, wxT("&Toolbook sheet\tShift-Ctrl-T"));
if (wxPlatformIs(wxPORT_MAC))
- sheet_menu->Append(DIALOGS_PROPERTY_SHEET_BUTTONTOOLBOOK, _T("Button &Toolbook sheet\tShift-Ctrl-U"));
+ sheet_menu->Append(DIALOGS_PROPERTY_SHEET_BUTTONTOOLBOOK, wxT("Button &Toolbook sheet\tShift-Ctrl-U"));
/*
#ifdef __WXMAC__
- sheet_menu->Append(DIALOGS_PROPERTY_SHEET_BUTTONTOOLBOOK, _T("Button &Toolbook sheet\tShift-Ctrl-U"));
+ sheet_menu->Append(DIALOGS_PROPERTY_SHEET_BUTTONTOOLBOOK, wxT("Button &Toolbook sheet\tShift-Ctrl-U"));
#endif
*/
- menuDlg->Append(wxID_ANY, _T("&Property sheets"), sheet_menu);
+ menuDlg->Append(wxID_ANY, wxT("&Property sheets"), sheet_menu);
#endif // USE_SETTINGS_DIALOG
wxMenu *menuNotif = new wxMenu;
- menuNotif->Append(DIALOGS_REQUEST, _T("&Request user attention\tCtrl-Shift-R"));
+ menuNotif->Append(DIALOGS_REQUEST, wxT("&Request user attention\tCtrl-Shift-R"));
#if wxUSE_NOTIFICATION_MESSAGE
menuNotif->Append(DIALOGS_NOTIFY_AUTO, "&Automatically hidden notification");
menuNotif->Append(DIALOGS_NOTIFY_SHOW, "&Show manual notification");
#endif // wxUSE_NOTIFICATION_MESSAGE
menuDlg->AppendSubMenu(menuNotif, "&User notifications");
- menuDlg->Append(DIALOGS_STANDARD_BUTTON_SIZER_DIALOG, _T("&Standard Buttons Sizer Dialog"));
- menuDlg->Append(DIALOGS_TEST_DEFAULT_ACTION, _T("&Test dialog default action"));
+ menuDlg->Append(DIALOGS_STANDARD_BUTTON_SIZER_DIALOG, wxT("&Standard Buttons Sizer Dialog"));
+ menuDlg->Append(DIALOGS_TEST_DEFAULT_ACTION, wxT("&Test dialog default action"));
menuDlg->AppendSeparator();
- menuDlg->Append(wxID_EXIT, _T("E&xit\tAlt-X"));
+ menuDlg->Append(wxID_EXIT, wxT("E&xit\tAlt-X"));
#if wxUSE_ABOUTDLG
wxMenu *menuHelp = new wxMenu;
- menuHelp->Append(DIALOGS_ABOUTDLG_SIMPLE, _T("&About (simple)...\tF1"));
- menuHelp->Append(DIALOGS_ABOUTDLG_FANCY, _T("About (&fancy)...\tShift-F1"));
- menuHelp->Append(DIALOGS_ABOUTDLG_FULL, _T("About (f&ull)...\tCtrl-F1"));
- menuHelp->Append(DIALOGS_ABOUTDLG_CUSTOM, _T("About (&custom)...\tCtrl-Shift-F1"));
+ menuHelp->Append(DIALOGS_ABOUTDLG_SIMPLE, wxT("&About (simple)...\tF1"));
+ menuHelp->Append(DIALOGS_ABOUTDLG_FANCY, wxT("About (&fancy)...\tShift-F1"));
+ menuHelp->Append(DIALOGS_ABOUTDLG_FULL, wxT("About (f&ull)...\tCtrl-F1"));
+ menuHelp->Append(DIALOGS_ABOUTDLG_CUSTOM, wxT("About (&custom)...\tCtrl-Shift-F1"));
#endif // wxUSE_ABOUTDLG
wxMenuBar *menubar = new wxMenuBar;
- menubar->Append(menuDlg, _T("&Dialogs"));
+ menubar->Append(menuDlg, wxT("&Dialogs"));
#if wxUSE_ABOUTDLG
- menubar->Append(menuHelp, _T("&Help"));
+ menubar->Append(menuHelp, wxT("&Help"));
#endif // wxUSE_ABOUTDLG
frame->SetMenuBar(menubar);
#if wxUSE_NUMBERDLG
void MyFrame::NumericEntry(wxCommandEvent& WXUNUSED(event))
{
- long res = wxGetNumberFromUser( _T("This is some text, actually a lot of text.\n")
- _T("Even two rows of text."),
- _T("Enter a number:"), _T("Numeric input test"),
+ long res = wxGetNumberFromUser( wxT("This is some text, actually a lot of text.\n")
+ wxT("Even two rows of text."),
+ wxT("Enter a number:"), wxT("Numeric input test"),
50, 0, 100, this );
wxString msg;
int icon;
if ( res == -1 )
{
- msg = _T("Invalid number entered or dialog cancelled.");
+ msg = wxT("Invalid number entered or dialog cancelled.");
icon = wxICON_HAND;
}
else
{
- msg.Printf(_T("You've entered %lu"), res );
+ msg.Printf(wxT("You've entered %lu"), res );
icon = wxICON_INFORMATION;
}
- wxMessageBox(msg, _T("Numeric test result"), wxOK | icon, this);
+ wxMessageBox(msg, wxT("Numeric test result"), wxOK | icon, this);
}
#endif // wxUSE_NUMBERDLG
#if wxUSE_TEXTDLG
void MyFrame::PasswordEntry(wxCommandEvent& WXUNUSED(event))
{
- wxString pwd = wxGetPasswordFromUser(_T("Enter password:"),
- _T("Password entry dialog"),
+ wxString pwd = wxGetPasswordFromUser(wxT("Enter password:"),
+ wxT("Password entry dialog"),
wxEmptyString,
this);
if ( !pwd.empty() )
{
wxMessageBox(wxString::Format(wxT("Your password is '%s'"), pwd.c_str()),
- _T("Got password"), wxOK | wxICON_INFORMATION, this);
+ wxT("Got password"), wxOK | wxICON_INFORMATION, this);
}
}
void MyFrame::TextEntry(wxCommandEvent& WXUNUSED(event))
{
wxTextEntryDialog dialog(this,
- _T("This is a small sample\n")
- _T("A long, long string to test out the text entrybox"),
- _T("Please enter a string"),
- _T("Default value"),
+ wxT("This is a small sample\n")
+ wxT("A long, long string to test out the text entrybox"),
+ wxT("Please enter a string"),
+ wxT("Default value"),
wxOK | wxCANCEL);
if (dialog.ShowModal() == wxID_OK)
{
- wxMessageBox(dialog.GetValue(), _T("Got string"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(dialog.GetValue(), wxT("Got string"), wxOK | wxICON_INFORMATION, this);
}
}
#endif // wxUSE_TEXTDLG
#if wxUSE_CHOICEDLG
void MyFrame::SingleChoice(wxCommandEvent& WXUNUSED(event) )
{
- const wxString choices[] = { _T("One"), _T("Two"), _T("Three"), _T("Four"), _T("Five") } ;
+ const wxString choices[] = { wxT("One"), wxT("Two"), wxT("Three"), wxT("Four"), wxT("Five") } ;
wxSingleChoiceDialog dialog(this,
- _T("This is a small sample\n")
- _T("A single-choice convenience dialog"),
- _T("Please select a value"),
+ wxT("This is a small sample\n")
+ wxT("A single-choice convenience dialog"),
+ wxT("Please select a value"),
WXSIZEOF(choices), choices);
dialog.SetSelection(2);
if (dialog.ShowModal() == wxID_OK)
{
- wxMessageDialog dialog2(this, dialog.GetStringSelection(), _T("Got string"));
+ wxMessageDialog dialog2(this, dialog.GetStringSelection(), wxT("Got string"));
dialog2.ShowModal();
}
}
{
const wxString choices[] =
{
- _T("One"), _T("Two"), _T("Three"), _T("Four"), _T("Five"),
- _T("Six"), _T("Seven"), _T("Eight"), _T("Nine"), _T("Ten"),
- _T("Eleven"), _T("Twelve"), _T("Seventeen"),
+ wxT("One"), wxT("Two"), wxT("Three"), wxT("Four"), wxT("Five"),
+ wxT("Six"), wxT("Seven"), wxT("Eight"), wxT("Nine"), wxT("Ten"),
+ wxT("Eleven"), wxT("Twelve"), wxT("Seventeen"),
};
wxArrayInt selections;
const int count = wxGetSelectedChoices(selections,
- _T("This is a small sample\n")
- _T("A multi-choice convenience dialog"),
- _T("Please select a value"),
+ wxT("This is a small sample\n")
+ wxT("A multi-choice convenience dialog"),
+ wxT("Please select a value"),
WXSIZEOF(choices), choices,
this);
if ( count >= 0 )
MyExtraPanel::MyExtraPanel(wxWindow *parent)
: wxPanel(parent)
{
- m_btn = new wxButton(this, -1, _T("Custom Button"));
+ m_btn = new wxButton(this, -1, wxT("Custom Button"));
m_btn->Enable(false);
- m_cb = new wxCheckBox(this, -1, _T("Enable Custom Button"));
+ m_cb = new wxCheckBox(this, -1, wxT("Enable Custom Button"));
m_cb->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED,
wxCommandEventHandler(MyExtraPanel::OnCheckBox), NULL, this);
wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
wxFileDialog dialog
(
this,
- _T("Testing open file dialog"),
+ wxT("Testing open file dialog"),
wxEmptyString,
wxEmptyString,
#ifdef __WXMOTIF__
- _T("C++ files (*.cpp)|*.cpp")
+ wxT("C++ files (*.cpp)|*.cpp")
#else
- _T("C++ files (*.cpp;*.h)|*.cpp;*.h")
+ wxT("C++ files (*.cpp;*.h)|*.cpp;*.h")
#endif
);
{
wxString info;
wxWindow * const extra = dialog.GetExtraControl();
- info.Printf(_T("Full file name: %s\n")
- _T("Path: %s\n")
- _T("Name: %s\n")
- _T("Custom window: %s"),
+ info.Printf(wxT("Full file name: %s\n")
+ wxT("Path: %s\n")
+ wxT("Name: %s\n")
+ wxT("Custom window: %s"),
dialog.GetPath().c_str(),
dialog.GetDirectory().c_str(),
dialog.GetFilename().c_str(),
extra ? static_cast<MyExtraPanel*>(extra)->GetInfo()
: wxString("None"));
- wxMessageDialog dialog2(this, info, _T("Selected file"));
+ wxMessageDialog dialog2(this, info, wxT("Selected file"));
dialog2.ShowModal();
}
}
{
static wxString s_extDef;
wxString path = wxFileSelector(
- _T("Select the file to load"),
+ wxT("Select the file to load"),
wxEmptyString, wxEmptyString,
s_extDef,
wxString::Format
(
- _T("Waveform (*.wav)|*.wav|Plain text (*.txt)|*.txt|All files (%s)|%s"),
+ wxT("Waveform (*.wav)|*.wav|Plain text (*.txt)|*.txt|All files (%s)|%s"),
wxFileSelectorDefaultWildcardStr,
wxFileSelectorDefaultWildcardStr
),
return;
// it is just a sample, would use wxSplitPath in real program
- s_extDef = path.AfterLast(_T('.'));
+ s_extDef = path.AfterLast(wxT('.'));
- wxLogMessage(_T("You selected the file '%s', remembered extension '%s'"),
+ wxLogMessage(wxT("You selected the file '%s', remembered extension '%s'"),
path, s_extDef);
}
{
wxString wildcards =
#ifdef __WXMOTIF__
- _T("C++ files (*.cpp)|*.cpp");
+ wxT("C++ files (*.cpp)|*.cpp");
#else
wxString::Format
(
- _T("All files (%s)|%s|C++ files (*.cpp;*.h)|*.cpp;*.h"),
+ wxT("All files (%s)|%s|C++ files (*.cpp;*.h)|*.cpp;*.h"),
wxFileSelectorDefaultWildcardStr,
wxFileSelectorDefaultWildcardStr
);
#endif
- wxFileDialog dialog(this, _T("Testing open multiple file dialog"),
+ wxFileDialog dialog(this, wxT("Testing open multiple file dialog"),
wxEmptyString, wxEmptyString, wildcards,
wxFD_OPEN|wxFD_MULTIPLE);
size_t count = paths.GetCount();
for ( size_t n = 0; n < count; n++ )
{
- s.Printf(_T("File %d: %s (%s)\n"),
+ s.Printf(wxT("File %d: %s (%s)\n"),
(int)n, paths[n].c_str(), filenames[n].c_str());
msg += s;
}
- s.Printf(_T("Filter index: %d"), dialog.GetFilterIndex());
+ s.Printf(wxT("Filter index: %d"), dialog.GetFilterIndex());
msg += s;
- wxMessageDialog dialog2(this, msg, _T("Selected files"));
+ wxMessageDialog dialog2(this, msg, wxT("Selected files"));
dialog2.ShowModal();
}
}
void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
{
wxFileDialog dialog(this,
- _T("Testing save file dialog"),
+ wxT("Testing save file dialog"),
wxEmptyString,
- _T("myletter.doc"),
- _T("Text files (*.txt)|*.txt|Document files (*.doc;*.ods)|*.doc;*.ods"),
+ wxT("myletter.doc"),
+ wxT("Text files (*.txt)|*.txt|Document files (*.doc;*.ods)|*.doc;*.ods"),
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
dialog.SetFilterIndex(1);
if (dialog.ShowModal() == wxID_OK)
{
- wxLogMessage(_T("%s, filter %d"),
+ wxLogMessage(wxT("%s, filter %d"),
dialog.GetPath().c_str(), dialog.GetFilterIndex());
}
}
wxGenericFileDialog dialog
(
this,
- _T("Testing open file dialog"),
+ wxT("Testing open file dialog"),
wxEmptyString,
wxEmptyString,
- _T("C++ files (*.cpp;*.h)|*.cpp;*.h")
+ wxT("C++ files (*.cpp;*.h)|*.cpp;*.h")
);
dialog.SetExtraControlCreator(&createMyExtraPanel);
if (dialog.ShowModal() == wxID_OK)
{
wxString info;
- info.Printf(_T("Full file name: %s\n")
- _T("Path: %s\n")
- _T("Name: %s"),
+ info.Printf(wxT("Full file name: %s\n")
+ wxT("Path: %s\n")
+ wxT("Name: %s"),
dialog.GetPath().c_str(),
dialog.GetDirectory().c_str(),
dialog.GetFilename().c_str());
- wxMessageDialog dialog2(this, info, _T("Selected file"));
+ wxMessageDialog dialog2(this, info, wxT("Selected file"));
dialog2.ShowModal();
}
}
int buttons = wxSystemOptions::GetOptionInt(wxT("wince.dialog.real-ok-cancel"));
wxSystemOptions::SetOption(wxT("wince.dialog.real-ok-cancel"), 1);
- wxString wildcards = _T("All files (*.*)|*.*|C++ files (*.cpp;*.h)|*.cpp;*.h");
- wxGenericFileDialog dialog(this, _T("Testing open multiple file dialog"),
+ wxString wildcards = wxT("All files (*.*)|*.*|C++ files (*.cpp;*.h)|*.cpp;*.h");
+ wxGenericFileDialog dialog(this, wxT("Testing open multiple file dialog"),
wxEmptyString, wxEmptyString, wildcards,
wxFD_MULTIPLE);
size_t count = paths.GetCount();
for ( size_t n = 0; n < count; n++ )
{
- s.Printf(_T("File %d: %s (%s)\n"),
+ s.Printf(wxT("File %d: %s (%s)\n"),
(int)n, paths[n].c_str(), filenames[n].c_str());
msg += s;
}
- s.Printf(_T("Filter index: %d"), dialog.GetFilterIndex());
+ s.Printf(wxT("Filter index: %d"), dialog.GetFilterIndex());
msg += s;
- wxMessageDialog dialog2(this, msg, _T("Selected files"));
+ wxMessageDialog dialog2(this, msg, wxT("Selected files"));
dialog2.ShowModal();
}
void MyFrame::FileSaveGeneric(wxCommandEvent& WXUNUSED(event) )
{
wxGenericFileDialog dialog(this,
- _T("Testing save file dialog"),
+ wxT("Testing save file dialog"),
wxEmptyString,
- _T("myletter.doc"),
- _T("Text files (*.txt)|*.txt|Document files (*.doc;*.ods)|*.doc;*.ods"),
+ wxT("myletter.doc"),
+ wxT("Text files (*.txt)|*.txt|Document files (*.doc;*.ods)|*.doc;*.ods"),
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
dialog.SetFilterIndex(1);
if (dialog.ShowModal() == wxID_OK)
{
- wxLogMessage(_T("%s, filter %d"),
+ wxLogMessage(wxT("%s, filter %d"),
dialog.GetPath().c_str(), dialog.GetFilterIndex());
}
}
wxString dirHome;
wxGetHomeDir(&dirHome);
- wxDirDialog dialog(this, _T("Testing directory picker"), dirHome, style);
+ wxDirDialog dialog(this, wxT("Testing directory picker"), dirHome, style);
if (dialog.ShowModal() == wxID_OK)
{
- wxLogMessage(_T("Selected path: %s"), dialog.GetPath().c_str());
+ wxLogMessage(wxT("Selected path: %s"), dialog.GetPath().c_str());
}
}
wxString dirHome;
wxGetHomeDir(&dirHome);
- wxGenericDirDialog dialog(this, _T("Testing generic directory picker"), dirHome);
+ wxGenericDirDialog dialog(this, wxT("Testing generic directory picker"), dirHome);
if (dialog.ShowModal() == wxID_OK)
{
- wxMessageDialog dialog2(this, dialog.GetPath(), _T("Selected path"));
+ wxMessageDialog dialog2(this, dialog.GetPath(), wxT("Selected path"));
dialog2.ShowModal();
}
}
void MyFrame::DlgCenteredScreen(wxCommandEvent& WXUNUSED(event))
{
- wxDialog dlg(this, wxID_ANY, _T("Dialog centered on screen"),
+ wxDialog dlg(this, wxID_ANY, wxT("Dialog centered on screen"),
wxDefaultPosition, wxSize(200, 100));
- (new wxButton(&dlg, wxID_OK, _T("Close")))->Centre();
+ (new wxButton(&dlg, wxID_OK, wxT("Close")))->Centre();
dlg.CentreOnScreen();
dlg.ShowModal();
}
void MyFrame::DlgCenteredParent(wxCommandEvent& WXUNUSED(event))
{
- wxDialog dlg(this, wxID_ANY, _T("Dialog centered on parent"),
+ wxDialog dlg(this, wxID_ANY, wxT("Dialog centered on parent"),
wxDefaultPosition, wxSize(200, 100));
- (new wxButton(&dlg, wxID_OK, _T("Close")))->Centre();
+ (new wxButton(&dlg, wxID_OK, wxT("Close")))->Centre();
dlg.CentreOnParent();
dlg.ShowModal();
}
#if wxUSE_MINIFRAME
void MyFrame::MiniFrame(wxCommandEvent& WXUNUSED(event))
{
- wxFrame *frame = new wxMiniFrame(this, wxID_ANY, _T("Mini frame"),
+ wxFrame *frame = new wxMiniFrame(this, wxID_ANY, wxT("Mini frame"),
wxDefaultPosition, wxSize(300, 100),
wxCAPTION | wxCLOSE_BOX);
new wxStaticText(frame,
wxID_ANY,
- _T("Mini frames have slightly different appearance"),
+ wxT("Mini frames have slightly different appearance"),
wxPoint(5, 5));
new wxStaticText(frame,
wxID_ANY,
- _T("from the normal frames but that's the only difference."),
+ wxT("from the normal frames but that's the only difference."),
wxPoint(5, 25));
frame->CentreOnParent();
void MyFrame::DlgOnTop(wxCommandEvent& WXUNUSED(event))
{
- wxDialog dlg(this, wxID_ANY, _T("Dialog staying on top of other windows"),
+ wxDialog dlg(this, wxID_ANY, wxT("Dialog staying on top of other windows"),
wxDefaultPosition, wxSize(300, 100),
wxDEFAULT_DIALOG_STYLE | wxSTAY_ON_TOP);
- (new wxButton(&dlg, wxID_OK, _T("Close")))->Centre();
+ (new wxButton(&dlg, wxID_OK, wxT("Close")))->Centre();
dlg.ShowModal();
}
s_index = rand() % 5;
}
- wxTipProvider *tipProvider = wxCreateFileTipProvider(_T("tips.txt"), s_index);
+ wxTipProvider *tipProvider = wxCreateFileTipProvider(wxT("tips.txt"), s_index);
bool showAtStartup = wxShowTip(this, tipProvider);
if ( showAtStartup )
{
- wxMessageBox(_T("Will show tips on startup"), _T("Tips dialog"),
+ wxMessageBox(wxT("Will show tips on startup"), wxT("Tips dialog"),
wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnRequestUserAttention(wxCommandEvent& WXUNUSED(event))
{
- wxLogStatus(_T("Sleeping for 3 seconds to allow you to switch to another window"));
+ wxLogStatus(wxT("Sleeping for 3 seconds to allow you to switch to another window"));
wxSleep(3);
{
static const int max = 100;
- wxProgressDialog dialog(_T("Progress dialog example"),
- _T("An informative message"),
+ wxProgressDialog dialog(wxT("Progress dialog example"),
+ wxT("An informative message"),
max, // range
this, // parent
wxPD_CAN_ABORT |
if ( i == max )
{
- msg = _T("That's all, folks!");
+ msg = wxT("That's all, folks!");
}
else if ( !determinate )
{
- msg = _T("Testing indeterminate mode");
+ msg = wxT("Testing indeterminate mode");
}
else if ( determinate )
{
- msg = _T("Now in standard determinate mode");
+ msg = wxT("Now in standard determinate mode");
}
// will be set to true if "Skip" button was pressed
if ( !cont )
{
- if ( wxMessageBox(_T("Do you really want to cancel?"),
- _T("Progress dialog question"), // caption
+ if ( wxMessageBox(wxT("Do you really want to cancel?"),
+ wxT("Progress dialog question"), // caption
wxYES_NO | wxICON_QUESTION) == wxYES )
break;
static void InitAboutInfoMinimal(wxAboutDialogInfo& info)
{
- info.SetName(_T("Dialogs Sample"));
+ info.SetName(wxT("Dialogs Sample"));
info.SetVersion(wxVERSION_NUM_DOT_STRING_T);
- info.SetDescription(_T("This sample shows different wxWidgets dialogs"));
- info.SetCopyright(_T("(C) 1998-2006 wxWidgets dev team"));
- info.AddDeveloper(_T("Vadim Zeitlin"));
+ info.SetDescription(wxT("This sample shows different wxWidgets dialogs"));
+ info.SetCopyright(wxT("(C) 1998-2006 wxWidgets dev team"));
+ info.AddDeveloper(wxT("Vadim Zeitlin"));
}
static void InitAboutInfoWebsite(wxAboutDialogInfo& info)
{
InitAboutInfoMinimal(info);
- info.SetWebSite(_T("http://www.wxwidgets.org/"), _T("wxWidgets web site"));
+ info.SetWebSite(wxT("http://www.wxwidgets.org/"), wxT("wxWidgets web site"));
}
static void InitAboutInfoAll(wxAboutDialogInfo& info)
InitAboutInfoWebsite(info);
// we can add a second developer
- info.AddDeveloper(_T("A.N. Other"));
+ info.AddDeveloper(wxT("A.N. Other"));
// or we can add several persons at once like this
static const wxChar *docwriters[] =
{
- _T("First D. Writer"),
- _T("Second One"),
+ wxT("First D. Writer"),
+ wxT("Second One"),
};
info.SetDocWriters(wxArrayString(WXSIZEOF(docwriters), docwriters));
" ...and so on and so forth...\n"
));
- info.AddTranslator(_T("Wun Ngo Wen (Martian)"));
+ info.AddTranslator(wxT("Wun Ngo Wen (Martian)"));
}
void MyFrame::ShowSimpleAboutDialog(wxCommandEvent& WXUNUSED(event))
virtual void DoAddCustomControls()
{
AddControl(new wxStaticLine(this), wxSizerFlags().Expand());
- AddText(_T("Some custom text"));
+ AddText(wxT("Some custom text"));
AddControl(new wxStaticLine(this), wxSizerFlags().Expand());
}
};
{
wxWindowDisabler disableAll;
- wxBusyInfo info(_T("Working, please wait..."), this);
+ wxBusyInfo info(wxT("Working, please wait..."), this);
for ( int i = 0; i < 18; i++ )
{
(
this,
&m_findData,
- _T("Find and replace dialog"),
+ wxT("Find and replace dialog"),
wxFR_REPLACEDIALOG
);
(
this,
&m_findData,
- _T("Find dialog"),
+ wxT("Find dialog"),
// just for testing
wxFR_NOWHOLEWORD
);
static wxString DecodeFindDialogEventFlags(int flags)
{
wxString str;
- str << (flags & wxFR_DOWN ? _T("down") : _T("up")) << _T(", ")
- << (flags & wxFR_WHOLEWORD ? _T("whole words only, ") : _T(""))
- << (flags & wxFR_MATCHCASE ? _T("") : _T("not "))
- << _T("case sensitive");
+ str << (flags & wxFR_DOWN ? wxT("down") : wxT("up")) << wxT(", ")
+ << (flags & wxFR_WHOLEWORD ? wxT("whole words only, ") : wxT(""))
+ << (flags & wxFR_MATCHCASE ? wxT("") : wxT("not "))
+ << wxT("case sensitive");
return str;
}
type == wxEVT_COMMAND_FIND_REPLACE_ALL )
{
wxLogMessage(wxT("Replace %s'%s' with '%s' (flags: %s)"),
- type == wxEVT_COMMAND_FIND_REPLACE_ALL ? _T("all ") : wxT(""),
+ type == wxEVT_COMMAND_FIND_REPLACE_ALL ? wxT("all ") : wxT(""),
event.GetFindString().c_str(),
event.GetReplaceString().c_str(),
DecodeFindDialogEventFlags(event.GetFlags()).c_str());
const wxChar *txt;
if ( dlg == m_dlgFind )
{
- txt = _T("Find");
+ txt = wxT("Find");
idMenu = DIALOGS_FIND;
m_dlgFind = NULL;
}
else if ( dlg == m_dlgReplace )
{
- txt = _T("Replace");
+ txt = wxT("Replace");
idMenu = DIALOGS_REPLACE;
m_dlgReplace = NULL;
}
else
{
- txt = _T("Unknown");
+ txt = wxT("Unknown");
idMenu = wxID_ANY;
- wxFAIL_MSG( _T("unexpected event") );
+ wxFAIL_MSG( wxT("unexpected event") );
}
wxLogMessage(wxT("%s dialog is being closed."), txt);
dc.SetTextForeground(wxGetApp().m_canvasTextColour);
dc.SetBackgroundMode(wxTRANSPARENT);
dc.DrawText(
- _T("wxWidgets common dialogs")
+ wxT("wxWidgets common dialogs")
#if !defined(__SMARTPHONE__)
- _T(" test application")
+ wxT(" test application")
#endif
, 10, 10);
}
// ----------------------------------------------------------------------------
MyModelessDialog::MyModelessDialog(wxWindow *parent)
- : wxDialog(parent, wxID_ANY, wxString(_T("Modeless dialog")))
+ : wxDialog(parent, wxID_ANY, wxString(wxT("Modeless dialog")))
{
wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
- wxButton *btn = new wxButton(this, DIALOGS_MODELESS_BTN, _T("Press me"));
- wxCheckBox *check = new wxCheckBox(this, wxID_ANY, _T("Should be disabled"));
+ wxButton *btn = new wxButton(this, DIALOGS_MODELESS_BTN, wxT("Press me"));
+ wxCheckBox *check = new wxCheckBox(this, wxID_ANY, wxT("Should be disabled"));
check->Disable();
sizerTop->Add(btn, 1, wxEXPAND | wxALL, 5);
void MyModelessDialog::OnButton(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("Button pressed in modeless dialog"), _T("Info"),
+ wxMessageBox(wxT("Button pressed in modeless dialog"), wxT("Info"),
wxOK | wxICON_INFORMATION, this);
}
{
if ( event.CanVeto() )
{
- wxMessageBox(_T("Use the menu item to close this dialog"),
- _T("Modeless dialog"),
+ wxMessageBox(wxT("Use the menu item to close this dialog"),
+ wxT("Modeless dialog"),
wxOK | wxICON_INFORMATION, this);
event.Veto();
// ----------------------------------------------------------------------------
MyModalDialog::MyModalDialog(wxWindow *parent)
- : wxDialog(parent, wxID_ANY, wxString(_T("Modal dialog")))
+ : wxDialog(parent, wxID_ANY, wxString(wxT("Modal dialog")))
{
wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
- m_btnModal = new wxButton(this, wxID_ANY, _T("&Modal dialog..."));
- m_btnModeless = new wxButton(this, wxID_ANY, _T("Mode&less dialog"));
- m_btnDelete = new wxButton(this, wxID_ANY, _T("&Delete button"));
+ m_btnModal = new wxButton(this, wxID_ANY, wxT("&Modal dialog..."));
+ m_btnModeless = new wxButton(this, wxID_ANY, wxT("Mode&less dialog"));
+ m_btnDelete = new wxButton(this, wxID_ANY, wxT("&Delete button"));
sizerTop->Add(m_btnModal, 0, wxALIGN_CENTER | wxALL, 5);
sizerTop->Add(m_btnModeless, 0, wxALIGN_CENTER | wxALL, 5);
else if ( event.GetEventObject() == m_btnModal )
{
#if wxUSE_TEXTDLG
- wxGetTextFromUser(_T("Dummy prompt"),
- _T("Modal dialog called from dialog"),
+ wxGetTextFromUser(wxT("Dummy prompt"),
+ wxT("Modal dialog called from dialog"),
wxEmptyString, this);
#else
- wxMessageBox(_T("Modal dialog called from dialog"));
+ wxMessageBox(wxT("Modal dialog called from dialog"));
#endif // wxUSE_TEXTDLG
}
else if ( event.GetEventObject() == m_btnModeless )
// ----------------------------------------------------------------------------
StdButtonSizerDialog::StdButtonSizerDialog(wxWindow *parent)
- : wxDialog(parent, wxID_ANY, wxString(_T("StdButtonSizer dialog")),
+ : wxDialog(parent, wxID_ANY, wxString(wxT("StdButtonSizer dialog")),
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER),
m_buttonsSizer(NULL)
{
return false;
// Create the main application window
- MyFrame *frame = new MyFrame(_T("Dial-up wxWidgets demo"),
+ MyFrame *frame = new MyFrame(wxT("Dial-up wxWidgets demo"),
wxPoint(50, 50), wxSize(450, 340));
// Show it and tell the application that it's our main window
}
#if wxUSE_STATUSBAR
- frame->SetStatusText(GetDialer()->IsAlwaysOnline() ? _T("LAN") : _T("No LAN"), 2);
+ frame->SetStatusText(GetDialer()->IsAlwaysOnline() ? wxT("LAN") : wxT("No LAN"), 2);
#endif // wxUSE_STATUSBAR
return true;
// create a menu bar
wxMenu *menuFile = new wxMenu;
- menuFile->Append(NetTest_Dial, _T("&Dial\tCtrl-D"), _T("Dial default ISP"));
- menuFile->Append(NetTest_HangUp, _T("&HangUp\tCtrl-H"), _T("Hang up modem"));
+ menuFile->Append(NetTest_Dial, wxT("&Dial\tCtrl-D"), wxT("Dial default ISP"));
+ menuFile->Append(NetTest_HangUp, wxT("&HangUp\tCtrl-H"), wxT("Hang up modem"));
menuFile->AppendSeparator();
- menuFile->Append(NetTest_EnumISP, _T("&Enumerate ISPs...\tCtrl-E"));
- menuFile->Append(NetTest_Check, _T("&Check connection status...\tCtrl-C"));
+ menuFile->Append(NetTest_EnumISP, wxT("&Enumerate ISPs...\tCtrl-E"));
+ menuFile->Append(NetTest_Check, wxT("&Check connection status...\tCtrl-C"));
menuFile->AppendSeparator();
- menuFile->Append(NetTest_About, _T("&About...\tCtrl-A"), _T("Show about dialog"));
+ menuFile->Append(NetTest_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog"));
menuFile->AppendSeparator();
- menuFile->Append(NetTest_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(NetTest_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(menuFile, _T("&File"));
+ menuBar->Append(menuFile, wxT("&File"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
}
else
{
- wxString msg = _T("Known ISPs:\n");
+ wxString msg = wxT("Known ISPs:\n");
for ( size_t n = 0; n < nCount; n++ )
{
msg << names[n] << '\n';
s_isOnline = isOnline;
#if wxUSE_STATUSBAR
- SetStatusText(isOnline ? _T("Online") : _T("Offline"), 1);
+ SetStatusText(isOnline ? wxT("Online") : wxT("Offline"), 1);
#endif // wxUSE_STATUSBAR
}
}
return false;
#ifdef __WXMSW__
- if ( argc == 2 && !wxStricmp(argv[1], _T("/dx")) )
+ if ( argc == 2 && !wxStricmp(argv[1], wxT("/dx")) )
{
- wxSystemOptions::SetOption(_T("msw.display.directdraw"), 1);
+ wxSystemOptions::SetOption(wxT("msw.display.directdraw"), 1);
}
#endif // __WXMSW__
sizer->AddGrowableCol(1);
const wxRect r(display.GetGeometry());
- sizer->Add(new wxStaticText(page, wxID_ANY, _T("Origin: ")));
+ sizer->Add(new wxStaticText(page, wxID_ANY, wxT("Origin: ")));
sizer->Add(new wxStaticText
(
page,
wxID_ANY,
- wxString::Format(_T("(%d, %d)"),
+ wxString::Format(wxT("(%d, %d)"),
r.x, r.y)
));
- sizer->Add(new wxStaticText(page, wxID_ANY, _T("Size: ")));
+ sizer->Add(new wxStaticText(page, wxID_ANY, wxT("Size: ")));
sizer->Add(new wxStaticText
(
page,
wxID_ANY,
- wxString::Format(_T("(%d, %d)"),
+ wxString::Format(wxT("(%d, %d)"),
r.width, r.height)
));
const wxRect rc(display.GetClientArea());
- sizer->Add(new wxStaticText(page, wxID_ANY, _T("Client area: ")));
+ sizer->Add(new wxStaticText(page, wxID_ANY, wxT("Client area: ")));
sizer->Add(new wxStaticText
(
page,
wxID_ANY,
- wxString::Format(_T("(%d, %d)-(%d, %d)"),
+ wxString::Format(wxT("(%d, %d)-(%d, %d)"),
rc.x, rc.y, rc.width, rc.height)
));
- sizer->Add(new wxStaticText(page, wxID_ANY, _T("Name: ")));
+ sizer->Add(new wxStaticText(page, wxID_ANY, wxT("Name: ")));
sizer->Add(new wxStaticText(page, wxID_ANY, display.GetName()));
wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
new MyVideoModeClientData(mode));
}
- sizer->Add(new wxStaticText(page, wxID_ANY, _T("&Modes: ")));
+ sizer->Add(new wxStaticText(page, wxID_ANY, wxT("&Modes: ")));
sizer->Add(choiceModes, 0, wxEXPAND);
- sizer->Add(new wxStaticText(page, wxID_ANY, _T("Current: ")));
+ sizer->Add(new wxStaticText(page, wxID_ANY, wxT("Current: ")));
sizer->Add(new wxStaticText(page, Display_CurrentMode,
VideoModeToText(display.GetCurrentMode())));
// add it to another sizer to have borders around it and button below
- sizerTop->Add(new wxButton(page, Display_ResetMode, _T("&Reset mode")),
+ sizerTop->Add(new wxButton(page, Display_ResetMode, wxT("&Reset mode")),
0, wxALL | wxCENTRE, 5);
#endif // wxUSE_DISPLAY
page->SetSizer(sizerTop);
m_book->AddPage(page,
- wxString::Format(_T("Display %lu"),
+ wxString::Format(wxT("Display %lu"),
(unsigned long)nDpy));
}
wxString MyFrame::VideoModeToText(const wxVideoMode& mode)
{
wxString s;
- s.Printf(_T("%dx%d"), mode.w, mode.h);
+ s.Printf(wxT("%dx%d"), mode.w, mode.h);
if ( mode.bpp )
{
- s += wxString::Format(_T(", %dbpp"), mode.bpp);
+ s += wxString::Format(wxT(", %dbpp"), mode.bpp);
}
if ( mode.refresh )
{
- s += wxString::Format(_T(", %dHz"), mode.refresh);
+ s += wxString::Format(wxT(", %dHz"), mode.refresh);
}
return s;
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("Demo program for wxDisplay class.\n\n(c) 2003-2006 Vadim Zeitlin"),
- _T("About Display Sample"),
+ wxMessageBox(wxT("Demo program for wxDisplay class.\n\n(c) 2003-2006 Vadim Zeitlin"),
+ wxT("About Display Sample"),
wxOK | wxICON_INFORMATION,
this);
}
void MyFrame::OnFromPoint(wxCommandEvent& WXUNUSED(event))
{
#if wxUSE_STATUSBAR
- SetStatusText(_T("Press the mouse anywhere..."));
+ SetStatusText(wxT("Press the mouse anywhere..."));
#endif // wxUSE_STATUSBAR
CaptureMouse();
wxDynamicCast(event.GetEventObject(), wxChoice)->
GetClientObject(event.GetInt()))->mode) )
{
- wxLogError(_T("Changing video mode failed!"));
+ wxLogError(wxT("Changing video mode failed!"));
}
}
int dpy = wxDisplay::GetFromPoint(ptScreen);
if ( dpy == wxNOT_FOUND )
{
- wxLogError(_T("Mouse clicked outside of display!?"));
+ wxLogError(wxT("Mouse clicked outside of display!?"));
}
- wxLogStatus(this, _T("Mouse clicked in display %d (at (%d, %d))"),
+ wxLogStatus(this, wxT("Mouse clicked in display %d (at (%d, %d))"),
dpy, ptScreen.x, ptScreen.y);
ReleaseMouse();
}
- wxLogStatus(this, _T("Display resolution was changed."));
+ wxLogStatus(this, wxT("Display resolution was changed."));
event.Skip();
}
void OnDropURL(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxString& text)
{
// of course, a real program would do something more useful here...
- wxMessageBox(text, _T("wxDnD sample: got URL"),
+ wxMessageBox(text, wxT("wxDnD sample: got URL"),
wxICON_INFORMATION | wxOK);
}
virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def)
{
#if wxUSE_STATUSBAR
- m_frame->SetStatusText(_T("Mouse entered the frame"));
+ m_frame->SetStatusText(wxT("Mouse entered the frame"));
#endif // wxUSE_STATUSBAR
return OnDragOver(x, y, def);
}
virtual void OnLeave()
{
#if wxUSE_STATUSBAR
- m_frame->SetStatusText(_T("Mouse left the frame"));
+ m_frame->SetStatusText(wxT("Mouse left the frame"));
#endif // wxUSE_STATUSBAR
}
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def)
// switch on trace messages
#if wxUSE_LOG
#if defined(__WXGTK__)
- wxLog::AddTraceMask(_T("clipboard"));
+ wxLog::AddTraceMask(wxT("clipboard"));
#elif defined(__WXMSW__)
wxLog::AddTraceMask(wxTRACE_OleCalls);
#endif
return true;
#else
- wxMessageBox( _T("This sample has to be compiled with wxUSE_DRAG_AND_DROP"), _T("Building error"), wxOK);
+ wxMessageBox( wxT("This sample has to be compiled with wxUSE_DRAG_AND_DROP"), wxT("Building error"), wxOK);
return false;
#endif // wxUSE_DRAG_AND_DROP
}
#if wxUSE_DRAG_AND_DROP || wxUSE_CLIPBOARD
DnDFrame::DnDFrame()
- : wxFrame(NULL, wxID_ANY, _T("Drag-and-Drop/Clipboard wxWidgets Sample"),
+ : wxFrame(NULL, wxID_ANY, wxT("Drag-and-Drop/Clipboard wxWidgets Sample"),
wxPoint(10, 100)),
- m_strText(_T("wxWidgets drag & drop works :-)"))
+ m_strText(wxT("wxWidgets drag & drop works :-)"))
{
// frame icon and status bar
// construct menu
wxMenu *file_menu = new wxMenu;
- file_menu->Append(Menu_Drag, _T("&Test drag..."));
- file_menu->AppendCheckItem(Menu_DragMoveDef, _T("&Move by default"));
- file_menu->AppendCheckItem(Menu_DragMoveAllow, _T("&Allow moving"));
+ file_menu->Append(Menu_Drag, wxT("&Test drag..."));
+ file_menu->AppendCheckItem(Menu_DragMoveDef, wxT("&Move by default"));
+ file_menu->AppendCheckItem(Menu_DragMoveAllow, wxT("&Allow moving"));
file_menu->AppendSeparator();
- file_menu->Append(Menu_NewFrame, _T("&New frame\tCtrl-N"));
+ file_menu->Append(Menu_NewFrame, wxT("&New frame\tCtrl-N"));
file_menu->AppendSeparator();
- file_menu->Append(Menu_Quit, _T("E&xit\tCtrl-Q"));
+ file_menu->Append(Menu_Quit, wxT("E&xit\tCtrl-Q"));
#if wxUSE_LOG
wxMenu *log_menu = new wxMenu;
- log_menu->Append(Menu_Clear, _T("Clear\tCtrl-L"));
+ log_menu->Append(Menu_Clear, wxT("Clear\tCtrl-L"));
#endif // wxUSE_LOG
wxMenu *help_menu = new wxMenu;
- help_menu->Append(Menu_Help, _T("&Help..."));
+ help_menu->Append(Menu_Help, wxT("&Help..."));
help_menu->AppendSeparator();
- help_menu->Append(Menu_About, _T("&About"));
+ help_menu->Append(Menu_About, wxT("&About"));
wxMenu *clip_menu = new wxMenu;
- clip_menu->Append(Menu_Copy, _T("&Copy text\tCtrl-C"));
- clip_menu->Append(Menu_Paste, _T("&Paste text\tCtrl-V"));
+ clip_menu->Append(Menu_Copy, wxT("&Copy text\tCtrl-C"));
+ clip_menu->Append(Menu_Paste, wxT("&Paste text\tCtrl-V"));
clip_menu->AppendSeparator();
- clip_menu->Append(Menu_CopyBitmap, _T("Copy &bitmap\tCtrl-Shift-C"));
- clip_menu->Append(Menu_PasteBitmap, _T("Paste b&itmap\tCtrl-Shift-V"));
+ clip_menu->Append(Menu_CopyBitmap, wxT("Copy &bitmap\tCtrl-Shift-C"));
+ clip_menu->Append(Menu_PasteBitmap, wxT("Paste b&itmap\tCtrl-Shift-V"));
#if wxUSE_METAFILE
clip_menu->AppendSeparator();
- clip_menu->Append(Menu_PasteMFile, _T("Paste &metafile\tCtrl-M"));
+ clip_menu->Append(Menu_PasteMFile, wxT("Paste &metafile\tCtrl-M"));
#endif // wxUSE_METAFILE
clip_menu->AppendSeparator();
- clip_menu->Append(Menu_CopyFiles, _T("Copy &files\tCtrl-F"));
+ clip_menu->Append(Menu_CopyFiles, wxT("Copy &files\tCtrl-F"));
clip_menu->AppendSeparator();
- clip_menu->AppendCheckItem(Menu_UsePrimary, _T("Use &primary selection\tCtrl-P"));
+ clip_menu->AppendCheckItem(Menu_UsePrimary, wxT("Use &primary selection\tCtrl-P"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
+ menu_bar->Append(file_menu, wxT("&File"));
#if wxUSE_LOG
- menu_bar->Append(log_menu, _T("&Log"));
+ menu_bar->Append(log_menu, wxT("&Log"));
#endif // wxUSE_LOG
- menu_bar->Append(clip_menu, _T("&Clipboard"));
- menu_bar->Append(help_menu, _T("&Help"));
+ menu_bar->Append(clip_menu, wxT("&Clipboard"));
+ menu_bar->Append(help_menu, wxT("&Help"));
SetMenuBar(menu_bar);
// create the child controls
SetBackgroundColour(*wxWHITE); // labels read better on this background
- wxString strFile(_T("Drop files here!")), strText(_T("Drop text on me"));
+ wxString strFile(wxT("Drop files here!")), strText(wxT("Drop text on me"));
m_ctrlFile = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 1, &strFile,
wxLB_HSCROLL | wxLB_ALWAYS_SB );
wxPaintDC dc(this);
// dc.Clear(); -- this kills wxGTK
- dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL, false, _T("charter") ) );
- dc.DrawText( _T("Drag text from here!"), 100, h-50 );
+ dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL, false, wxT("charter") ) );
+ dc.DrawText( wxT("Drag text from here!"), 100, h-50 );
}
void DnDFrame::OnUpdateUIMoveByDefault(wxUpdateUIEvent& event)
#if wxUSE_DRAG_AND_DROP
wxString strText = wxGetTextFromUser
(
- _T("After you enter text in this dialog, press any mouse\n")
- _T("button in the bottom (empty) part of the frame and \n")
- _T("drag it anywhere - you will be in fact dragging the\n")
- _T("text object containing this text"),
- _T("Please enter some text"), m_strText, this
+ wxT("After you enter text in this dialog, press any mouse\n")
+ wxT("button in the bottom (empty) part of the frame and \n")
+ wxT("drag it anywhere - you will be in fact dragging the\n")
+ wxT("text object containing this text"),
+ wxT("Please enter some text"), m_strText, this
);
m_strText = strText;
void DnDFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("Drag-&-Drop Demo\n")
- _T("Please see \"Help|Help...\" for details\n")
- _T("Copyright (c) 1998 Vadim Zeitlin"),
- _T("About wxDnD"),
+ wxMessageBox(wxT("Drag-&-Drop Demo\n")
+ wxT("Please see \"Help|Help...\" for details\n")
+ wxT("Copyright (c) 1998 Vadim Zeitlin"),
+ wxT("About wxDnD"),
wxICON_INFORMATION | wxOK,
this);
}
void DnDFrame::OnHelp(wxCommandEvent& /* event */)
{
wxMessageDialog dialog(this,
- _T("This small program demonstrates drag & drop support in wxWidgets. The program window\n")
- _T("consists of 3 parts: the bottom pane is for debug messages, so that you can see what's\n")
- _T("going on inside. The top part is split into 2 listboxes, the left one accepts files\n")
- _T("and the right one accepts text.\n")
- _T("\n")
- _T("To test wxDropTarget: open wordpad (write.exe), select some text in it and drag it to\n")
- _T("the right listbox (you'll notice the usual visual feedback, i.e. the cursor will change).\n")
- _T("Also, try dragging some files (you can select several at once) from Windows Explorer (or \n")
- _T("File Manager) to the left pane. Hold down Ctrl/Shift keys when you drop text (doesn't \n")
- _T("work with files) and see what changes.\n")
- _T("\n")
- _T("To test wxDropSource: just press any mouse button on the empty zone of the window and drag\n")
- _T("it to wordpad or any other droptarget accepting text (and of course you can just drag it\n")
- _T("to the right pane). Due to a lot of trace messages, the cursor might take some time to \n")
- _T("change, don't release the mouse button until it does. You can change the string being\n")
- _T("dragged in in \"File|Test drag...\" dialog.\n")
- _T("\n")
- _T("\n")
- _T("Please send all questions/bug reports/suggestions &c to \n")
- _T("Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>"),
- _T("wxDnD Help"));
+ wxT("This small program demonstrates drag & drop support in wxWidgets. The program window\n")
+ wxT("consists of 3 parts: the bottom pane is for debug messages, so that you can see what's\n")
+ wxT("going on inside. The top part is split into 2 listboxes, the left one accepts files\n")
+ wxT("and the right one accepts text.\n")
+ wxT("\n")
+ wxT("To test wxDropTarget: open wordpad (write.exe), select some text in it and drag it to\n")
+ wxT("the right listbox (you'll notice the usual visual feedback, i.e. the cursor will change).\n")
+ wxT("Also, try dragging some files (you can select several at once) from Windows Explorer (or \n")
+ wxT("File Manager) to the left pane. Hold down Ctrl/Shift keys when you drop text (doesn't \n")
+ wxT("work with files) and see what changes.\n")
+ wxT("\n")
+ wxT("To test wxDropSource: just press any mouse button on the empty zone of the window and drag\n")
+ wxT("it to wordpad or any other droptarget accepting text (and of course you can just drag it\n")
+ wxT("to the right pane). Due to a lot of trace messages, the cursor might take some time to \n")
+ wxT("change, don't release the mouse button until it does. You can change the string being\n")
+ wxT("dragged in in \"File|Test drag...\" dialog.\n")
+ wxT("\n")
+ wxT("\n")
+ wxT("Please send all questions/bug reports/suggestions &c to \n")
+ wxT("Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>"),
+ wxT("wxDnD Help"));
dialog.ShowModal();
}
const wxChar *pc;
switch ( result )
{
- case wxDragError: pc = _T("Error!"); break;
- case wxDragNone: pc = _T("Nothing"); break;
- case wxDragCopy: pc = _T("Copied"); break;
- case wxDragMove: pc = _T("Moved"); break;
- case wxDragCancel: pc = _T("Cancelled"); break;
- default: pc = _T("Huh?"); break;
+ case wxDragError: pc = wxT("Error!"); break;
+ case wxDragNone: pc = wxT("Nothing"); break;
+ case wxDragCopy: pc = wxT("Copied"); break;
+ case wxDragMove: pc = wxT("Moved"); break;
+ case wxDragCancel: pc = wxT("Cancelled"); break;
+ default: pc = wxT("Huh?"); break;
}
- SetStatusText(wxString(_T("Drag result: ")) + pc);
+ SetStatusText(wxString(wxT("Drag result: ")) + pc);
#else
wxUnusedVar(result);
#endif // wxUSE_STATUSBAR
void DnDFrame::OnRightDown(wxMouseEvent &event )
{
- wxMenu menu(_T("Dnd sample menu"));
+ wxMenu menu(wxT("Dnd sample menu"));
- menu.Append(Menu_Drag, _T("&Test drag..."));
+ menu.Append(Menu_Drag, wxT("&Test drag..."));
menu.AppendSeparator();
- menu.Append(Menu_About, _T("&About"));
+ menu.Append(Menu_About, wxT("&About"));
PopupMenu( &menu, event.GetX(), event.GetY() );
}
const bool usePrimary = event.IsChecked();
wxTheClipboard->UsePrimarySelection(usePrimary);
- wxLogStatus(_T("Now using %s selection"), usePrimary ? _T("primary")
- : _T("clipboard"));
+ wxLogStatus(wxT("Now using %s selection"), usePrimary ? wxT("primary")
+ : wxT("clipboard"));
}
#if wxUSE_DRAG_AND_DROP
{
// PNG support is not always compiled in under Windows, so use BMP there
#if wxUSE_LIBPNG
- wxFileDialog dialog(this, _T("Open a PNG file"), wxEmptyString, wxEmptyString, _T("PNG files (*.png)|*.png"), 0);
+ wxFileDialog dialog(this, wxT("Open a PNG file"), wxEmptyString, wxEmptyString, wxT("PNG files (*.png)|*.png"), 0);
#else
- wxFileDialog dialog(this, _T("Open a BMP file"), wxEmptyString, wxEmptyString, _T("BMP files (*.bmp)|*.bmp"), 0);
+ wxFileDialog dialog(this, wxT("Open a BMP file"), wxEmptyString, wxEmptyString, wxT("BMP files (*.bmp)|*.bmp"), 0);
#endif
if (dialog.ShowModal() != wxID_OK)
{
- wxLogMessage( _T("Aborted file open") );
+ wxLogMessage( wxT("Aborted file open") );
return;
}
if (dialog.GetPath().empty())
{
- wxLogMessage( _T("Returned empty string.") );
+ wxLogMessage( wxT("Returned empty string.") );
return;
}
if (!wxFileExists(dialog.GetPath()))
{
- wxLogMessage( _T("File doesn't exist.") );
+ wxLogMessage( wxT("File doesn't exist.") );
return;
}
);
if (!image.Ok())
{
- wxLogError( _T("Invalid image file...") );
+ wxLogError( wxT("Invalid image file...") );
return;
}
- wxLogStatus( _T("Decoding image file...") );
+ wxLogStatus( wxT("Decoding image file...") );
wxYield();
wxBitmap bitmap( image );
if ( !wxTheClipboard->Open() )
{
- wxLogError(_T("Can't open clipboard."));
+ wxLogError(wxT("Can't open clipboard."));
return;
}
- wxLogMessage( _T("Creating wxBitmapDataObject...") );
+ wxLogMessage( wxT("Creating wxBitmapDataObject...") );
wxYield();
if ( !wxTheClipboard->AddData(new wxBitmapDataObject(bitmap)) )
{
- wxLogError(_T("Can't copy image to the clipboard."));
+ wxLogError(wxT("Can't copy image to the clipboard."));
}
else
{
- wxLogMessage(_T("Image has been put on the clipboard.") );
- wxLogMessage(_T("You can paste it now and look at it.") );
+ wxLogMessage(wxT("Image has been put on the clipboard.") );
+ wxLogMessage(wxT("You can paste it now and look at it.") );
}
wxTheClipboard->Close();
{
if ( !wxTheClipboard->Open() )
{
- wxLogError(_T("Can't open clipboard."));
+ wxLogError(wxT("Can't open clipboard."));
return;
}
if ( !wxTheClipboard->IsSupported(wxDF_BITMAP) )
{
- wxLogWarning(_T("No bitmap on clipboard"));
+ wxLogWarning(wxT("No bitmap on clipboard"));
wxTheClipboard->Close();
return;
wxBitmapDataObject data;
if ( !wxTheClipboard->GetData(data) )
{
- wxLogError(_T("Can't paste bitmap from the clipboard"));
+ wxLogError(wxT("Can't paste bitmap from the clipboard"));
}
else
{
const wxBitmap& bmp = data.GetBitmap();
- wxLogMessage(_T("Bitmap %dx%d pasted from the clipboard"),
+ wxLogMessage(wxT("Bitmap %dx%d pasted from the clipboard"),
bmp.GetWidth(), bmp.GetHeight());
ShowBitmap(bmp);
}
{
if ( !wxTheClipboard->Open() )
{
- wxLogError(_T("Can't open clipboard."));
+ wxLogError(wxT("Can't open clipboard."));
return;
}
if ( !wxTheClipboard->IsSupported(wxDF_METAFILE) )
{
- wxLogWarning(_T("No metafile on clipboard"));
+ wxLogWarning(wxT("No metafile on clipboard"));
}
else
{
wxMetaFileDataObject data;
if ( !wxTheClipboard->GetData(data) )
{
- wxLogError(_T("Can't paste metafile from the clipboard"));
+ wxLogError(wxT("Can't paste metafile from the clipboard"));
}
else
{
const wxMetaFile& mf = data.GetMetafile();
- wxLogMessage(_T("Metafile %dx%d pasted from the clipboard"),
+ wxLogMessage(wxT("Metafile %dx%d pasted from the clipboard"),
mf.GetWidth(), mf.GetHeight());
ShowMetaFile(mf);
void DnDFrame::OnCopyFiles(wxCommandEvent& WXUNUSED(event))
{
#ifdef __WXMSW__
- wxFileDialog dialog(this, _T("Select a file to copy"), wxEmptyString, wxEmptyString,
- _T("All files (*.*)|*.*"), 0);
+ wxFileDialog dialog(this, wxT("Select a file to copy"), wxEmptyString, wxEmptyString,
+ wxT("All files (*.*)|*.*"), 0);
wxArrayString filenames;
while ( dialog.ShowModal() == wxID_OK )
{
if ( !wxTheClipboard->Open() )
{
- wxLogError(_T("Can't open clipboard."));
+ wxLogError(wxT("Can't open clipboard."));
return;
}
if ( !wxTheClipboard->AddData(new wxTextDataObject(m_strText)) )
{
- wxLogError(_T("Can't copy data to the clipboard"));
+ wxLogError(wxT("Can't copy data to the clipboard"));
}
else
{
- wxLogMessage(_T("Text '%s' put on the clipboard"), m_strText.c_str());
+ wxLogMessage(wxT("Text '%s' put on the clipboard"), m_strText.c_str());
}
wxTheClipboard->Close();
{
if ( !wxTheClipboard->Open() )
{
- wxLogError(_T("Can't open clipboard."));
+ wxLogError(wxT("Can't open clipboard."));
return;
}
if ( !wxTheClipboard->IsSupported(wxDF_TEXT) )
{
- wxLogWarning(_T("No text data on clipboard"));
+ wxLogWarning(wxT("No text data on clipboard"));
wxTheClipboard->Close();
return;
wxTextDataObject text;
if ( !wxTheClipboard->GetData(text) )
{
- wxLogError(_T("Can't paste data from the clipboard"));
+ wxLogError(wxT("Can't paste data from the clipboard"));
}
else
{
- wxLogMessage(_T("Text '%s' pasted from the clipboard"),
+ wxLogMessage(wxT("Text '%s' pasted from the clipboard"),
text.GetText().c_str());
}
{
size_t nFiles = filenames.GetCount();
wxString str;
- str.Printf( _T("%d files dropped"), (int)nFiles);
+ str.Printf( wxT("%d files dropped"), (int)nFiles);
if (m_pOwner != NULL)
{
if ( !m_pos.x || !m_pos.y || !m_size.x || !m_size.y )
{
- wxMessageBox(_T("All sizes and positions should be non null!"),
- _T("Invalid shape"), wxICON_HAND | wxOK, this);
+ wxMessageBox(wxT("All sizes and positions should be non null!"),
+ wxT("Invalid shape"), wxICON_HAND | wxOK, this);
return false;
}
DnDShapeFrame *DnDShapeFrame::ms_lastDropTarget = NULL;
DnDShapeFrame::DnDShapeFrame(wxFrame *parent)
- : wxFrame(parent, wxID_ANY, _T("Shape Frame"))
+ : wxFrame(parent, wxID_ANY, wxT("Shape Frame"))
{
#if wxUSE_STATUSBAR
CreateStatusBar();
#endif // wxUSE_STATUSBAR
wxMenu *menuShape = new wxMenu;
- menuShape->Append(Menu_Shape_New, _T("&New default shape\tCtrl-S"));
- menuShape->Append(Menu_Shape_Edit, _T("&Edit shape\tCtrl-E"));
+ menuShape->Append(Menu_Shape_New, wxT("&New default shape\tCtrl-S"));
+ menuShape->Append(Menu_Shape_Edit, wxT("&Edit shape\tCtrl-E"));
menuShape->AppendSeparator();
- menuShape->Append(Menu_Shape_Clear, _T("&Clear shape\tCtrl-L"));
+ menuShape->Append(Menu_Shape_Clear, wxT("&Clear shape\tCtrl-L"));
wxMenu *menuClipboard = new wxMenu;
- menuClipboard->Append(Menu_ShapeClipboard_Copy, _T("&Copy\tCtrl-C"));
- menuClipboard->Append(Menu_ShapeClipboard_Paste, _T("&Paste\tCtrl-V"));
+ menuClipboard->Append(Menu_ShapeClipboard_Copy, wxT("&Copy\tCtrl-C"));
+ menuClipboard->Append(Menu_ShapeClipboard_Paste, wxT("&Paste\tCtrl-V"));
wxMenuBar *menubar = new wxMenuBar;
- menubar->Append(menuShape, _T("&Shape"));
- menubar->Append(menuClipboard, _T("&Clipboard"));
+ menubar->Append(menuShape, wxT("&Shape"));
+ menubar->Append(menuClipboard, wxT("&Clipboard"));
SetMenuBar(menubar);
#if wxUSE_STATUSBAR
- SetStatusText(_T("Press Ctrl-S to create a new shape"));
+ SetStatusText(wxT("Press Ctrl-S to create a new shape"));
#endif // wxUSE_STATUSBAR
SetDropTarget(new DnDShapeDropTarget(this));
case wxDragNone:
#if wxUSE_STATUSBAR
- SetStatusText(_T("Nothing happened"));
+ SetStatusText(wxT("Nothing happened"));
#endif // wxUSE_STATUSBAR
break;
case wxDragCopy:
- pc = _T("copied");
+ pc = wxT("copied");
break;
case wxDragMove:
- pc = _T("moved");
+ pc = wxT("moved");
if ( ms_lastDropTarget != this )
{
// don't delete the shape if we dropped it on ourselves!
case wxDragCancel:
#if wxUSE_STATUSBAR
- SetStatusText(_T("Drag and drop operation cancelled"));
+ SetStatusText(wxT("Drag and drop operation cancelled"));
#endif // wxUSE_STATUSBAR
break;
}
if ( pc )
{
#if wxUSE_STATUSBAR
- SetStatusText(wxString(_T("Shape successfully ")) + pc);
+ SetStatusText(wxString(wxT("Shape successfully ")) + pc);
#endif // wxUSE_STATUSBAR
}
//else: status text already set
#if wxUSE_STATUSBAR
if ( m_shape )
{
- SetStatusText(_T("You can now drag the shape to another frame"));
+ SetStatusText(wxT("You can now drag the shape to another frame"));
}
#endif // wxUSE_STATUSBAR
}
SetShape(new DnDEllipticShape(wxPoint(10, 10), wxSize(80, 60), *wxRED));
#if wxUSE_STATUSBAR
- SetStatusText(_T("You can now drag the shape to another frame"));
+ SetStatusText(wxT("You can now drag the shape to another frame"));
#endif // wxUSE_STATUSBAR
}
static void ShowBitmap(const wxBitmap& bitmap)
{
- wxFrame *frame = new wxFrame(NULL, wxID_ANY, _T("Bitmap view"));
+ wxFrame *frame = new wxFrame(NULL, wxID_ANY, wxT("Bitmap view"));
#if wxUSE_STATUSBAR
frame->CreateStatusBar();
#endif // wxUSE_STATUSBAR
int w = bitmap.GetWidth(),
h = bitmap.GetHeight();
#if wxUSE_STATUSBAR
- frame->SetStatusText(wxString::Format(_T("%dx%d"), w, h));
+ frame->SetStatusText(wxString::Format(wxT("%dx%d"), w, h));
#endif // wxUSE_STATUSBAR
frame->SetClientSize(w > 100 ? 100 : w, h > 100 ? 100 : h);
static void ShowMetaFile(const wxMetaFile& metafile)
{
- wxFrame *frame = new wxFrame(NULL, wxID_ANY, _T("Metafile view"));
+ wxFrame *frame = new wxFrame(NULL, wxID_ANY, wxT("Metafile view"));
frame->CreateStatusBar();
DnDCanvasMetafile *canvas = new DnDCanvasMetafile(frame);
canvas->SetMetafile(metafile);
wxSize size = metafile.GetSize();
- frame->SetStatusText(wxString::Format(_T("%dx%d"), size.x, size.y));
+ frame->SetStatusText(wxString::Format(wxT("%dx%d"), size.x, size.y));
frame->SetClientSize(size.x > 100 ? 100 : size.x,
size.y > 100 ? 100 : size.y);
}
case SHAPE_DRAG_TEXT:
{
- m_dragImage = new MyDragImage(this, wxString(_T("Dragging some test text")), wxCursor(wxCURSOR_HAND));
+ m_dragImage = new MyDragImage(this, wxString(wxT("Dragging some test text")), wxCursor(wxCURSOR_HAND));
break;
}
case SHAPE_DRAG_ICON:
END_EVENT_TABLE()
MyFrame::MyFrame()
-: wxFrame( (wxFrame *)NULL, wxID_ANY, _T("wxDragImage sample"),
+: wxFrame( (wxFrame *)NULL, wxID_ANY, wxT("wxDragImage sample"),
wxPoint(20,20), wxSize(470,360) )
{
wxMenu *file_menu = new wxMenu();
- file_menu->Append( wxID_ABOUT, _T("&About..."));
- file_menu->AppendCheckItem( TEST_USE_SCREEN, _T("&Use whole screen for dragging"), _T("Use whole screen"));
- file_menu->Append( wxID_EXIT, _T("E&xit"));
+ file_menu->Append( wxID_ABOUT, wxT("&About..."));
+ file_menu->AppendCheckItem( TEST_USE_SCREEN, wxT("&Use whole screen for dragging"), wxT("Use whole screen"));
+ file_menu->Append( wxID_EXIT, wxT("E&xit"));
wxMenuBar *menu_bar = new wxMenuBar();
- menu_bar->Append(file_menu, _T("&File"));
+ menu_bar->Append(file_menu, wxT("&File"));
SetIcon(wxICON(mondrian));
SetMenuBar( menu_bar );
void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) )
{
- (void)wxMessageBox( _T("wxDragImage demo\n")
- _T("Julian Smart (c) 2000"),
- _T("About wxDragImage Demo"),
+ (void)wxMessageBox( wxT("wxDragImage demo\n")
+ wxT("Julian Smart (c) 2000"),
+ wxT("About wxDragImage Demo"),
wxICON_INFORMATION | wxOK );
}
#endif
wxImage image;
- if (image.LoadFile(_T("backgrnd.png"), wxBITMAP_TYPE_PNG))
+ if (image.LoadFile(wxT("backgrnd.png"), wxBITMAP_TYPE_PNG))
{
m_background = wxBitmap(image);
}
MyFrame *frame = new MyFrame();
- wxString rootName(_T("shape0"));
+ wxString rootName(wxT("shape0"));
for (int i = 1; i < 4; i++)
{
// special hack for Unix in-tree sample build, don't do this in real
// programs, use wxStandardPaths instead
pathList.Add(wxFileName(argv[0]).GetPath());
- pathList.Add(_T("."));
- pathList.Add(_T(".."));
- pathList.Add(_T("../.."));
+ pathList.Add(wxT("."));
+ pathList.Add(wxT(".."));
+ pathList.Add(wxT("../.."));
- wxString path = pathList.FindValidPath(_T("pat4.bmp"));
+ wxString path = pathList.FindValidPath(wxT("pat4.bmp"));
if ( !path )
return false;
wxMask* mask4 = new wxMask(*gs_bmp4_mono, *wxBLACK);
gs_bmp4_mono->SetMask(mask4);
- path = pathList.FindValidPath(_T("pat36.bmp"));
+ path = pathList.FindValidPath(wxT("pat36.bmp"));
if ( !path )
return false;
gs_bmp36->LoadFile(path, wxBITMAP_TYPE_BMP);
wxMask* mask36 = new wxMask(*gs_bmp36, *wxBLACK);
gs_bmp36->SetMask(mask36);
- path = pathList.FindValidPath(_T("image.bmp"));
+ path = pathList.FindValidPath(wxT("image.bmp"));
if ( !path )
return false;
gs_bmpNoMask->LoadFile(path, wxBITMAP_TYPE_BMP);
gs_bmpWithMask->LoadFile(path, wxBITMAP_TYPE_BMP);
gs_bmpWithColMask->LoadFile(path, wxBITMAP_TYPE_BMP);
- path = pathList.FindValidPath(_T("mask.bmp"));
+ path = pathList.FindValidPath(wxT("mask.bmp"));
if ( !path )
return false;
gs_bmpMask->LoadFile(path, wxBITMAP_TYPE_BMP);
return false;
// Create the main application window
- MyFrame *frame = new MyFrame(_T("Drawing sample"),
+ MyFrame *frame = new MyFrame(wxT("Drawing sample"),
wxPoint(50, 50), wxSize(550, 340));
// Show it and tell the application that it's our main window
dc.SetBrush(wxBrush(*wxGREEN, wxSOLID));
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
- dc.DrawText(_T("Solid green"), x + 10, y + 10);
+ dc.DrawText(wxT("Solid green"), x + 10, y + 10);
y += HEIGHT;
dc.SetBrush(wxBrush(*wxRED, wxCROSSDIAG_HATCH));
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
- dc.DrawText(_T("Hatched red"), x + 10, y + 10);
+ dc.DrawText(wxT("Hatched red"), x + 10, y + 10);
y += HEIGHT;
dc.SetBrush(wxBrush(*gs_bmpMask));
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
- dc.DrawText(_T("Stipple mono"), x + 10, y + 10);
+ dc.DrawText(wxT("Stipple mono"), x + 10, y + 10);
y += HEIGHT;
dc.SetBrush(wxBrush(*gs_bmpNoMask));
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
- dc.DrawText(_T("Stipple colour"), x + 10, y + 10);
+ dc.DrawText(wxT("Stipple colour"), x + 10, y + 10);
}
void MyCanvas::DrawTestPoly(wxDC& dc)
star[3] = wxPoint(40, 100);
star[4] = wxPoint(140, 150);
- dc.DrawText(_T("You should see two (irregular) stars below, the left one ")
- _T("hatched"), 10, 10);
- dc.DrawText(_T("except for the central region and the right ")
- _T("one entirely hatched"), 10, 30);
- dc.DrawText(_T("The third star only has a hatched outline"), 10, 50);
+ dc.DrawText(wxT("You should see two (irregular) stars below, the left one ")
+ wxT("hatched"), 10, 10);
+ dc.DrawText(wxT("except for the central region and the right ")
+ wxT("one entirely hatched"), 10, 30);
+ dc.DrawText(wxT("The third star only has a hatched outline"), 10, 50);
dc.DrawPolygon(WXSIZEOF(star), star, 0, 30);
dc.DrawPolygon(WXSIZEOF(star), star, 160, 30, wxWINDING_RULE);
dc.DrawText(wxString::Format(wxT("Testing lines of width %d"), width), x + 10, y - 10);
dc.DrawRectangle( x+10, y+10, 100, 190 );
- dc.DrawText(_T("Solid/dot/short dash/long dash/dot dash"), x + 150, y + 10);
+ dc.DrawText(wxT("Solid/dot/short dash/long dash/dot dash"), x + 150, y + 10);
dc.SetPen( wxPen( wxT("black"), width, wxSOLID) );
dc.DrawLine( x+20, y+20, 100, y+20 );
dc.SetPen( wxPen( wxT("black"), width, wxDOT) );
dc.SetPen( wxPen( wxT("black"), width, wxDOT_DASH) );
dc.DrawLine( x+20, y+60, 100, y+60 );
- dc.DrawText(_T("Misc hatches"), x + 150, y + 70);
+ dc.DrawText(wxT("Misc hatches"), x + 150, y + 70);
dc.SetPen( wxPen( wxT("black"), width, wxBDIAGONAL_HATCH) );
dc.DrawLine( x+20, y+70, 100, y+70 );
dc.SetPen( wxPen( wxT("black"), width, wxCROSSDIAG_HATCH) );
dc.SetPen( wxPen( wxT("black"), width, wxVERTICAL_HATCH) );
dc.DrawLine( x+20, y+120, 100, y+120 );
- dc.DrawText(_T("User dash"), x + 150, y + 140);
+ dc.DrawText(wxT("User dash"), x + 150, y + 140);
wxPen ud( wxT("black"), width, wxUSER_DASH );
wxDash dash1[6];
dash1[0] = 8; // Long dash <---------+
{
// set underlined font for testing
dc.SetFont( wxFont(12, wxMODERN, wxNORMAL, wxNORMAL, true) );
- dc.DrawText( _T("This is text"), 110, 10 );
- dc.DrawRotatedText( _T("That is text"), 20, 10, -45 );
+ dc.DrawText( wxT("This is text"), 110, 10 );
+ dc.DrawRotatedText( wxT("That is text"), 20, 10, -45 );
// use wxSWISS_FONT and not wxNORMAL_FONT as the latter can't be rotated
// under Win9x (it is not TrueType)
dc.SetFont( wxFont( 18, wxSWISS, wxNORMAL, wxNORMAL ) );
- dc.DrawText( _T("This is Swiss 18pt text."), 110, 40 );
+ dc.DrawText( wxT("This is Swiss 18pt text."), 110, 40 );
wxCoord length;
wxCoord height;
wxCoord descent;
- dc.GetTextExtent( _T("This is Swiss 18pt text."), &length, &height, &descent );
+ dc.GetTextExtent( wxT("This is Swiss 18pt text."), &length, &height, &descent );
text.Printf( wxT("Dimensions are length %ld, height %ld, descent %ld"), length, height, descent );
dc.DrawText( text, 110, 80 );
wxCoord y = 150;
dc.SetLogicalFunction(wxINVERT);
// text drawing should ignore logical function
- dc.DrawText( _T("There should be a text below"), 110, 150 );
+ dc.DrawText( wxT("There should be a text below"), 110, 150 );
dc.DrawRectangle( 110, y, 100, height );
y += height;
- dc.DrawText( _T("Visible text"), 110, y );
+ dc.DrawText( wxT("Visible text"), 110, y );
dc.DrawRectangle( 110, y, 100, height );
- dc.DrawText( _T("Visible text"), 110, y );
+ dc.DrawText( wxT("Visible text"), 110, y );
dc.DrawRectangle( 110, y, 100, height );
dc.SetLogicalFunction(wxCOPY);
y += height;
dc.DrawRectangle( 110, y, 100, height );
- dc.DrawText( _T("Another visible text"), 110, y );
+ dc.DrawText( wxT("Another visible text"), 110, y );
}
static const struct
void MyCanvas::DrawImages(wxDC& dc, DrawMode mode)
{
- dc.DrawText(_T("original image"), 0, 0);
+ dc.DrawText(wxT("original image"), 0, 0);
dc.DrawBitmap(*gs_bmpNoMask, 0, 20, 0);
- dc.DrawText(_T("with colour mask"), 0, 100);
+ dc.DrawText(wxT("with colour mask"), 0, 100);
dc.DrawBitmap(*gs_bmpWithColMask, 0, 120, true);
- dc.DrawText(_T("the mask image"), 0, 200);
+ dc.DrawText(wxT("the mask image"), 0, 200);
dc.DrawBitmap(*gs_bmpMask, 0, 220, 0);
- dc.DrawText(_T("masked image"), 0, 300);
+ dc.DrawText(wxT("masked image"), 0, 300);
dc.DrawBitmap(*gs_bmpWithMask, 0, 320, true);
int cx = gs_bmpWithColMask->GetWidth(),
dc.SetPen( *wxRED_PEN );
dc.SetBrush( *wxGREEN_BRUSH );
- dc.DrawText(_T("Some circles"), 0, y);
+ dc.DrawText(wxT("Some circles"), 0, y);
dc.DrawCircle(x, y, r);
dc.DrawCircle(x + 2*r, y, r);
dc.DrawCircle(x + 4*r, y, r);
y += 2*r;
- dc.DrawText(_T("And ellipses"), 0, y);
+ dc.DrawText(wxT("And ellipses"), 0, y);
dc.DrawEllipse(x - r, y, 2*r, r);
dc.DrawEllipse(x + r, y, 2*r, r);
dc.DrawEllipse(x + 3*r, y, 2*r, r);
y += 2*r;
- dc.DrawText(_T("And arcs"), 0, y);
+ dc.DrawText(wxT("And arcs"), 0, y);
dc.DrawArc(x - r, y, x + r, y, x, y);
dc.DrawArc(x + 4*r, y, x + 2*r, y, x + 3*r, y);
dc.DrawArc(x + 5*r, y, x + 5*r, y, x + 6*r, y);
dc.SetBrush( *wxTRANSPARENT_BRUSH );
y += 2*r;
- dc.DrawText(_T("Some circles"), 0, y);
+ dc.DrawText(wxT("Some circles"), 0, y);
dc.DrawCircle(x, y, r);
dc.DrawCircle(x + 2*r, y, r);
dc.DrawCircle(x + 4*r, y, r);
y += 2*r;
- dc.DrawText(_T("And ellipses"), 0, y);
+ dc.DrawText(wxT("And ellipses"), 0, y);
dc.DrawEllipse(x - r, y, 2*r, r);
dc.DrawEllipse(x + r, y, 2*r, r);
dc.DrawEllipse(x + 3*r, y, 2*r, r);
y += 2*r;
- dc.DrawText(_T("And arcs"), 0, y);
+ dc.DrawText(wxT("And arcs"), 0, y);
dc.DrawArc(x - r, y, x + r, y, x, y);
dc.DrawArc(x + 4*r, y, x + 2*r, y, x + 3*r, y);
dc.DrawArc(x + 5*r, y, x + 5*r, y, x + 6*r, y);
void MyCanvas::DrawSplines(wxDC& dc)
{
#if wxUSE_SPLINES
- dc.DrawText(_T("Some splines"), 10, 5);
+ dc.DrawText(wxT("Some splines"), 10, 5);
// values are hardcoded rather than randomly generated
// so the output can be compared between native
}
#else
- dc.DrawText(_T("Splines not supported."), 10, 5);
+ dc.DrawText(wxT("Splines not supported."), 10, 5);
#endif
}
// LHS: linear
wxRect r(10, 10, 50, 50);
- dc.DrawText(_T("wxRIGHT"), r.x, r.y);
+ dc.DrawText(wxT("wxRIGHT"), r.x, r.y);
r.Offset(0, TEXT_HEIGHT);
dc.GradientFillLinear(r, *wxWHITE, *wxBLUE, wxRIGHT);
r.Offset(0, r.height + 10);
- dc.DrawText(_T("wxLEFT"), r.x, r.y);
+ dc.DrawText(wxT("wxLEFT"), r.x, r.y);
r.Offset(0, TEXT_HEIGHT);
dc.GradientFillLinear(r, *wxWHITE, *wxBLUE, wxLEFT);
r.Offset(0, r.height + 10);
- dc.DrawText(_T("wxDOWN"), r.x, r.y);
+ dc.DrawText(wxT("wxDOWN"), r.x, r.y);
r.Offset(0, TEXT_HEIGHT);
dc.GradientFillLinear(r, *wxWHITE, *wxBLUE, wxDOWN);
r.Offset(0, r.height + 10);
- dc.DrawText(_T("wxUP"), r.x, r.y);
+ dc.DrawText(wxT("wxUP"), r.x, r.y);
r.Offset(0, TEXT_HEIGHT);
dc.GradientFillLinear(r, *wxWHITE, *wxBLUE, wxUP);
// RHS: concentric
r = wxRect(200, 10, 50, 50);
- dc.DrawText(_T("Blue inside"), r.x, r.y);
+ dc.DrawText(wxT("Blue inside"), r.x, r.y);
r.Offset(0, TEXT_HEIGHT);
dc.GradientFillConcentric(r, *wxBLUE, *wxWHITE);
r.Offset(0, r.height + 10);
- dc.DrawText(_T("White inside"), r.x, r.y);
+ dc.DrawText(wxT("White inside"), r.x, r.y);
r.Offset(0, TEXT_HEIGHT);
dc.GradientFillConcentric(r, *wxWHITE, *wxBLUE);
r.Offset(0, r.height + 10);
- dc.DrawText(_T("Blue in top left corner"), r.x, r.y);
+ dc.DrawText(wxT("Blue in top left corner"), r.x, r.y);
r.Offset(0, TEXT_HEIGHT);
dc.GradientFillConcentric(r, *wxBLUE, *wxWHITE, wxPoint(0, 0));
r.Offset(0, r.height + 10);
- dc.DrawText(_T("Blue in bottom right corner"), r.x, r.y);
+ dc.DrawText(wxT("Blue in bottom right corner"), r.x, r.y);
r.Offset(0, TEXT_HEIGHT);
dc.GradientFillConcentric(r, *wxBLUE, *wxWHITE, wxPoint(r.width, r.height));
void MyCanvas::DrawRegions(wxDC& dc)
{
- dc.DrawText(_T("You should see a red rect partly covered by a cyan one ")
- _T("on the left"), 10, 5);
- dc.DrawText(_T("and 5 smileys from which 4 are partially clipped on the right"),
+ dc.DrawText(wxT("You should see a red rect partly covered by a cyan one ")
+ wxT("on the left"), 10, 5);
+ dc.DrawText(wxT("and 5 smileys from which 4 are partially clipped on the right"),
10, 5 + dc.GetCharHeight());
- dc.DrawText(_T("The second copy should be identical but right part of it ")
- _T("should be offset by 10 pixels."),
+ dc.DrawText(wxT("The second copy should be identical but right part of it ")
+ wxT("should be offset by 10 pixels."),
10, 5 + 2*dc.GetCharHeight());
DrawRegionsHelper(dc, 10, true);
SetIcon(wxICON(mondrian));
wxMenu *menuFile = new wxMenu;
- menuFile->Append(File_ShowDefault, _T("&Default screen\tF1"));
- menuFile->Append(File_ShowText, _T("&Text screen\tF2"));
- menuFile->Append(File_ShowLines, _T("&Lines screen\tF3"));
- menuFile->Append(File_ShowBrushes, _T("&Brushes screen\tF4"));
- menuFile->Append(File_ShowPolygons, _T("&Polygons screen\tF5"));
- menuFile->Append(File_ShowMask, _T("&Mask screen\tF6"));
- menuFile->Append(File_ShowMaskStretch, _T("1/&2 scaled mask\tShift-F6"));
- menuFile->Append(File_ShowOps, _T("&Raster operations screen\tF7"));
- menuFile->Append(File_ShowRegions, _T("Re&gions screen\tF8"));
- menuFile->Append(File_ShowCircles, _T("&Circles screen\tF9"));
+ menuFile->Append(File_ShowDefault, wxT("&Default screen\tF1"));
+ menuFile->Append(File_ShowText, wxT("&Text screen\tF2"));
+ menuFile->Append(File_ShowLines, wxT("&Lines screen\tF3"));
+ menuFile->Append(File_ShowBrushes, wxT("&Brushes screen\tF4"));
+ menuFile->Append(File_ShowPolygons, wxT("&Polygons screen\tF5"));
+ menuFile->Append(File_ShowMask, wxT("&Mask screen\tF6"));
+ menuFile->Append(File_ShowMaskStretch, wxT("1/&2 scaled mask\tShift-F6"));
+ menuFile->Append(File_ShowOps, wxT("&Raster operations screen\tF7"));
+ menuFile->Append(File_ShowRegions, wxT("Re&gions screen\tF8"));
+ menuFile->Append(File_ShowCircles, wxT("&Circles screen\tF9"));
#if wxUSE_GRAPHICS_CONTEXT
- menuFile->Append(File_ShowAlpha, _T("&Alpha screen\tF10"));
+ menuFile->Append(File_ShowAlpha, wxT("&Alpha screen\tF10"));
#endif
- menuFile->Append(File_ShowSplines, _T("&Splines screen\tF11"));
- menuFile->Append(File_ShowGradients, _T("&Gradients screen\tF12"));
+ menuFile->Append(File_ShowSplines, wxT("&Splines screen\tF11"));
+ menuFile->Append(File_ShowGradients, wxT("&Gradients screen\tF12"));
#if wxUSE_GRAPHICS_CONTEXT
- menuFile->Append(File_ShowGraphics, _T("&Graphics screen"));
+ menuFile->Append(File_ShowGraphics, wxT("&Graphics screen"));
#endif
menuFile->AppendSeparator();
- menuFile->AppendCheckItem(File_Clip, _T("&Clip\tCtrl-C"), _T("Clip/unclip drawing"));
+ menuFile->AppendCheckItem(File_Clip, wxT("&Clip\tCtrl-C"), wxT("Clip/unclip drawing"));
#if wxUSE_GRAPHICS_CONTEXT
- menuFile->AppendCheckItem(File_GraphicContext, _T("&Use GraphicContext\tCtrl-Y"), _T("Use GraphicContext"));
+ menuFile->AppendCheckItem(File_GraphicContext, wxT("&Use GraphicContext\tCtrl-Y"), wxT("Use GraphicContext"));
#endif
menuFile->AppendSeparator();
- menuFile->Append(File_About, _T("&About...\tCtrl-A"), _T("Show about dialog"));
+ menuFile->Append(File_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog"));
menuFile->AppendSeparator();
- menuFile->Append(File_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(File_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
wxMenu *menuMapMode = new wxMenu;
- menuMapMode->Append( MapMode_Text, _T("&TEXT map mode") );
- menuMapMode->Append( MapMode_Lometric, _T("&LOMETRIC map mode") );
- menuMapMode->Append( MapMode_Twips, _T("T&WIPS map mode") );
- menuMapMode->Append( MapMode_Points, _T("&POINTS map mode") );
- menuMapMode->Append( MapMode_Metric, _T("&METRIC map mode") );
+ menuMapMode->Append( MapMode_Text, wxT("&TEXT map mode") );
+ menuMapMode->Append( MapMode_Lometric, wxT("&LOMETRIC map mode") );
+ menuMapMode->Append( MapMode_Twips, wxT("T&WIPS map mode") );
+ menuMapMode->Append( MapMode_Points, wxT("&POINTS map mode") );
+ menuMapMode->Append( MapMode_Metric, wxT("&METRIC map mode") );
wxMenu *menuUserScale = new wxMenu;
- menuUserScale->Append( UserScale_StretchHoriz, _T("Stretch &horizontally\tCtrl-H") );
- menuUserScale->Append( UserScale_ShrinkHoriz, _T("Shrin&k horizontally\tCtrl-G") );
- menuUserScale->Append( UserScale_StretchVertic, _T("Stretch &vertically\tCtrl-V") );
- menuUserScale->Append( UserScale_ShrinkVertic, _T("&Shrink vertically\tCtrl-W") );
+ menuUserScale->Append( UserScale_StretchHoriz, wxT("Stretch &horizontally\tCtrl-H") );
+ menuUserScale->Append( UserScale_ShrinkHoriz, wxT("Shrin&k horizontally\tCtrl-G") );
+ menuUserScale->Append( UserScale_StretchVertic, wxT("Stretch &vertically\tCtrl-V") );
+ menuUserScale->Append( UserScale_ShrinkVertic, wxT("&Shrink vertically\tCtrl-W") );
menuUserScale->AppendSeparator();
- menuUserScale->Append( UserScale_Restore, _T("&Restore to normal\tCtrl-0") );
+ menuUserScale->Append( UserScale_Restore, wxT("&Restore to normal\tCtrl-0") );
wxMenu *menuAxis = new wxMenu;
- menuAxis->AppendCheckItem( AxisMirror_Horiz, _T("Mirror horizontally\tCtrl-M") );
- menuAxis->AppendCheckItem( AxisMirror_Vertic, _T("Mirror vertically\tCtrl-N") );
+ menuAxis->AppendCheckItem( AxisMirror_Horiz, wxT("Mirror horizontally\tCtrl-M") );
+ menuAxis->AppendCheckItem( AxisMirror_Vertic, wxT("Mirror vertically\tCtrl-N") );
wxMenu *menuLogical = new wxMenu;
- menuLogical->Append( LogicalOrigin_MoveDown, _T("Move &down\tCtrl-D") );
- menuLogical->Append( LogicalOrigin_MoveUp, _T("Move &up\tCtrl-U") );
- menuLogical->Append( LogicalOrigin_MoveLeft, _T("Move &right\tCtrl-L") );
- menuLogical->Append( LogicalOrigin_MoveRight, _T("Move &left\tCtrl-R") );
+ menuLogical->Append( LogicalOrigin_MoveDown, wxT("Move &down\tCtrl-D") );
+ menuLogical->Append( LogicalOrigin_MoveUp, wxT("Move &up\tCtrl-U") );
+ menuLogical->Append( LogicalOrigin_MoveLeft, wxT("Move &right\tCtrl-L") );
+ menuLogical->Append( LogicalOrigin_MoveRight, wxT("Move &left\tCtrl-R") );
menuLogical->AppendSeparator();
- menuLogical->Append( LogicalOrigin_Set, _T("Set to (&100, 100)\tShift-Ctrl-1") );
- menuLogical->Append( LogicalOrigin_Restore, _T("&Restore to normal\tShift-Ctrl-0") );
+ menuLogical->Append( LogicalOrigin_Set, wxT("Set to (&100, 100)\tShift-Ctrl-1") );
+ menuLogical->Append( LogicalOrigin_Restore, wxT("&Restore to normal\tShift-Ctrl-0") );
wxMenu *menuColour = new wxMenu;
#if wxUSE_COLOURDLG
- menuColour->Append( Colour_TextForeground, _T("Text &foreground...") );
- menuColour->Append( Colour_TextBackground, _T("Text &background...") );
- menuColour->Append( Colour_Background, _T("Background &colour...") );
+ menuColour->Append( Colour_TextForeground, wxT("Text &foreground...") );
+ menuColour->Append( Colour_TextBackground, wxT("Text &background...") );
+ menuColour->Append( Colour_Background, wxT("Background &colour...") );
#endif // wxUSE_COLOURDLG
- menuColour->AppendCheckItem( Colour_BackgroundMode, _T("&Opaque/transparent\tCtrl-B") );
- menuColour->AppendCheckItem( Colour_TextureBackgound, _T("Draw textured back&ground\tCtrl-T") );
+ menuColour->AppendCheckItem( Colour_BackgroundMode, wxT("&Opaque/transparent\tCtrl-B") );
+ menuColour->AppendCheckItem( Colour_TextureBackgound, wxT("Draw textured back&ground\tCtrl-T") );
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(menuMapMode, _T("&Mode"));
- menuBar->Append(menuUserScale, _T("&Scale"));
- menuBar->Append(menuAxis, _T("&Axis"));
- menuBar->Append(menuLogical, _T("&Origin"));
- menuBar->Append(menuColour, _T("&Colours"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(menuMapMode, wxT("&Mode"));
+ menuBar->Append(menuUserScale, wxT("&Scale"));
+ menuBar->Append(menuAxis, wxT("&Axis"));
+ menuBar->Append(menuLogical, wxT("&Origin"));
+ menuBar->Append(menuColour, wxT("&Colours"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWidgets!"));
+ SetStatusText(wxT("Welcome to wxWidgets!"));
#endif // wxUSE_STATUSBAR
m_mapMode = wxMM_TEXT;
wxT("Copyright (c) Robert Roebling 1999")
);
- wxMessageBox(msg, _T("About Drawing"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, wxT("About Drawing"), wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnClip(wxCommandEvent& event)
void OnTest(wxCommandEvent& event)
{
- wxLogMessage(_T("This is the pushed test event handler #%u"), m_level);
+ wxLogMessage(wxT("This is the pushed test event handler #%u"), m_level);
// if we don't skip the event, the other event handlers won't get it:
// try commenting out this line and see what changes
return false;
// create the main application window
- MyFrame *frame = new MyFrame(_T("Event wxWidgets Sample"),
+ MyFrame *frame = new MyFrame(wxT("Event wxWidgets Sample"),
wxPoint(50, 50), wxSize(600, 340));
// and show it (the frames, unlike simple controls, are not shown when
// create a menu bar
wxMenu *menuFile = new wxMenu;
- menuFile->Append(Event_About, _T("&About...\tCtrl-A"), _T("Show about dialog"));
+ menuFile->Append(Event_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog"));
menuFile->AppendSeparator();
- menuFile->Append(Event_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(Event_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
wxMenu *menuEvent = new wxMenu;
#ifdef wxHAS_EVENT_BIND
menuEvent->AppendCheckItem(Event_Bind, "&Bind\tCtrl-B",
"Bind or unbind a dynamic event handler");
#endif // wxHAS_EVENT_BIND
- menuEvent->AppendCheckItem(Event_Connect, _T("&Connect\tCtrl-C"),
- _T("Connect or disconnect the dynamic event handler"));
- menuEvent->Append(Event_Dynamic, _T("&Dynamic event\tCtrl-D"),
- _T("Dynamic event sample - only works after Connect"));
+ menuEvent->AppendCheckItem(Event_Connect, wxT("&Connect\tCtrl-C"),
+ wxT("Connect or disconnect the dynamic event handler"));
+ menuEvent->Append(Event_Dynamic, wxT("&Dynamic event\tCtrl-D"),
+ wxT("Dynamic event sample - only works after Connect"));
menuEvent->AppendSeparator();
- menuEvent->Append(Event_Push, _T("&Push event handler\tCtrl-P"),
- _T("Push event handler for test event"));
- menuEvent->Append(Event_Pop, _T("P&op event handler\tCtrl-O"),
- _T("Pop event handler for test event"));
- menuEvent->Append(Event_Test, _T("Test event\tCtrl-T"),
- _T("Test event processed by pushed event handler"));
+ menuEvent->Append(Event_Push, wxT("&Push event handler\tCtrl-P"),
+ wxT("Push event handler for test event"));
+ menuEvent->Append(Event_Pop, wxT("P&op event handler\tCtrl-O"),
+ wxT("Pop event handler for test event"));
+ menuEvent->Append(Event_Test, wxT("Test event\tCtrl-T"),
+ wxT("Test event processed by pushed event handler"));
menuEvent->AppendSeparator();
- menuEvent->Append(Event_Custom, _T("Fire c&ustom event\tCtrl-U"),
- _T("Generate a custom event"));
+ menuEvent->Append(Event_Custom, wxT("Fire c&ustom event\tCtrl-U"),
+ wxT("Generate a custom event"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(menuEvent, _T("&Event"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(menuEvent, wxT("&Event"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
CreateStatusBar(3);
- SetStatusText(_T("Welcome to wxWidgets event sample"));
- SetStatusText(_T("Dynamic: off"), Status_Dynamic);
- SetStatusText(_T("Push count: 0"), Status_Push);
+ SetStatusText(wxT("Welcome to wxWidgets event sample"));
+ SetStatusText(wxT("Dynamic: off"), Status_Dynamic);
+ SetStatusText(wxT("Push count: 0"), Status_Push);
#endif // wxUSE_STATUSBAR
wxPanel * const panel = new wxPanel(this);
PushEventHandler(new MyEvtHandler(++m_nPush));
#if wxUSE_STATUSBAR
- SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push);
+ SetStatusText(wxString::Format(wxT("Push count: %u"), m_nPush), Status_Push);
#endif // wxUSE_STATUSBAR
}
void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event))
{
- wxCHECK_RET( m_nPush, _T("this command should be disabled!") );
+ wxCHECK_RET( m_nPush, wxT("this command should be disabled!") );
PopEventHandler(true /* delete handler */);
m_nPush--;
#if wxUSE_STATUSBAR
- SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push);
+ SetStatusText(wxString::Format(wxT("Push count: %u"), m_nPush), Status_Push);
#endif // wxUSE_STATUSBAR
}
void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("This is the test event handler in the main frame"));
+ wxLogMessage(wxT("This is the test event handler in the main frame"));
}
void MyFrame::OnUpdateUIPop(wxUpdateUIEvent& event)
void MyFrame::OnProcessCustom(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("Got a custom event!"));
+ wxLogMessage(wxT("Got a custom event!"));
}
}
catch ( int i )
{
- wxLogWarning(_T("Caught an int %d in MyApp."), i);
+ wxLogWarning(wxT("Caught an int %d in MyApp."), i);
}
catch ( MyException& e )
{
- wxLogWarning(_T("Caught MyException(%s) in MyApp."), e.what());
+ wxLogWarning(wxT("Caught MyException(%s) in MyApp."), e.what());
}
catch ( ... )
{
}
catch ( ... )
{
- wxMessageBox(_T("Unhandled exception caught, program will terminate."),
- _T("wxExcept Sample"), wxOK | wxICON_ERROR);
+ wxMessageBox(wxT("Unhandled exception caught, program will terminate."),
+ wxT("wxExcept Sample"), wxOK | wxICON_ERROR);
}
}
void MyApp::OnFatalException()
{
- wxMessageBox(_T("Program has crashed and will terminate."),
- _T("wxExcept Sample"), wxOK | wxICON_ERROR);
+ wxMessageBox(wxT("Program has crashed and will terminate."),
+ wxT("wxExcept Sample"), wxOK | wxICON_ERROR);
}
#ifdef __WXDEBUG__
// frame constructor
MyFrame::MyFrame()
- : wxFrame(NULL, wxID_ANY, _T("Except wxWidgets App"),
+ : wxFrame(NULL, wxID_ANY, wxT("Except wxWidgets App"),
wxPoint(50, 50), wxSize(450, 340))
{
// set the frame icon
#if wxUSE_MENUS
// create a menu bar
wxMenu *menuFile = new wxMenu;
- menuFile->Append(Except_Dialog, _T("Show &dialog\tCtrl-D"));
+ menuFile->Append(Except_Dialog, wxT("Show &dialog\tCtrl-D"));
menuFile->AppendSeparator();
- menuFile->Append(Except_ThrowInt, _T("Throw an &int\tCtrl-I"));
- menuFile->Append(Except_ThrowString, _T("Throw a &string\tCtrl-S"));
- menuFile->Append(Except_ThrowObject, _T("Throw an &object\tCtrl-O"));
+ menuFile->Append(Except_ThrowInt, wxT("Throw an &int\tCtrl-I"));
+ menuFile->Append(Except_ThrowString, wxT("Throw a &string\tCtrl-S"));
+ menuFile->Append(Except_ThrowObject, wxT("Throw an &object\tCtrl-O"));
menuFile->Append(Except_ThrowUnhandled,
- _T("Throw &unhandled exception\tCtrl-U"));
- menuFile->Append(Except_Crash, _T("&Crash\tCtrl-C"));
+ wxT("Throw &unhandled exception\tCtrl-U"));
+ menuFile->Append(Except_Crash, wxT("&Crash\tCtrl-C"));
menuFile->AppendSeparator();
#if wxUSE_ON_FATAL_EXCEPTION
- menuFile->AppendCheckItem(Except_HandleCrash, _T("&Handle crashes\tCtrl-H"));
+ menuFile->AppendCheckItem(Except_HandleCrash, wxT("&Handle crashes\tCtrl-H"));
menuFile->AppendSeparator();
#endif // wxUSE_ON_FATAL_EXCEPTION
#ifdef __WXDEBUG__
- menuFile->Append(Except_ShowAssert, _T("Provoke &assert failure\tCtrl-A"));
+ menuFile->Append(Except_ShowAssert, wxT("Provoke &assert failure\tCtrl-A"));
menuFile->AppendSeparator();
#endif // __WXDEBUG__
- menuFile->Append(Except_Quit, _T("E&xit\tCtrl-Q"), _T("Quit this program"));
+ menuFile->Append(Except_Quit, wxT("E&xit\tCtrl-Q"), wxT("Quit this program"));
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(Except_About, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(Except_About, wxT("&About...\tF1"), wxT("Show about dialog"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR && !defined(__WXWINCE__)
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWidgets!"));
+ SetStatusText(wxT("Welcome to wxWidgets!"));
#endif // wxUSE_STATUSBAR
}
}
catch ( const wxChar *msg )
{
- wxLogMessage(_T("Caught a string \"%s\" in MyFrame"), msg);
+ wxLogMessage(wxT("Caught a string \"%s\" in MyFrame"), msg);
return true;
}
}
catch ( ... )
{
- wxLogWarning(_T("An exception in MyDialog"));
+ wxLogWarning(wxT("An exception in MyDialog"));
Destroy();
throw;
void MyFrame::OnThrowString(wxCommandEvent& WXUNUSED(event))
{
- throw _T("string thrown from MyFrame");
+ throw wxT("string thrown from MyFrame");
}
void MyFrame::OnThrowObject(wxCommandEvent& WXUNUSED(event))
{
- throw MyException(_T("Exception thrown from MyFrame"));
+ throw MyException(wxT("Exception thrown from MyFrame"));
}
void MyFrame::OnThrowUnhandled(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
- msg.Printf( _T("This is the About dialog of the except sample.\n")
- _T("Welcome to %s"), wxVERSION_STRING);
+ msg.Printf( wxT("This is the About dialog of the except sample.\n")
+ wxT("Welcome to %s"), wxVERSION_STRING);
- wxMessageBox(msg, _T("About Except"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, wxT("About Except"), wxOK | wxICON_INFORMATION, this);
}
// ============================================================================
// ============================================================================
MyDialog::MyDialog(wxFrame *parent)
- : wxDialog(parent, wxID_ANY, wxString(_T("Throw exception dialog")))
+ : wxDialog(parent, wxID_ANY, wxString(wxT("Throw exception dialog")))
{
wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
- sizerTop->Add(new wxButton(this, Except_ThrowInt, _T("Throw &int")),
+ sizerTop->Add(new wxButton(this, Except_ThrowInt, wxT("Throw &int")),
0, wxCENTRE | wxALL, 5);
- sizerTop->Add(new wxButton(this, Except_ThrowObject, _T("Throw &object")),
+ sizerTop->Add(new wxButton(this, Except_ThrowObject, wxT("Throw &object")),
0, wxCENTRE | wxALL, 5);
- sizerTop->Add(new wxButton(this, Except_Crash, _T("&Crash")),
+ sizerTop->Add(new wxButton(this, Except_Crash, wxT("&Crash")),
0, wxCENTRE | wxALL, 5);
- sizerTop->Add(new wxButton(this, wxID_CANCEL, _T("&Cancel")),
+ sizerTop->Add(new wxButton(this, wxID_CANCEL, wxT("&Cancel")),
0, wxCENTRE | wxALL, 5);
SetSizerAndFit(sizerTop);
void MyDialog::OnThrowObject(wxCommandEvent& WXUNUSED(event))
{
- throw MyException(_T("Exception thrown from MyDialog"));
+ throw MyException(wxT("Exception thrown from MyDialog"));
}
void MyDialog::OnCrash(wxCommandEvent& WXUNUSED(event))
void DoSend()
{
wxString s(m_textOut->GetValue());
- s += _T('\n');
+ s += wxT('\n');
m_out.Write(s.c_str(), s.length());
m_textOut->Clear();
Exec_Btn_Close
};
-static const wxChar *DIALOG_TITLE = _T("Exec sample");
+static const wxChar *DIALOG_TITLE = wxT("Exec sample");
// ----------------------------------------------------------------------------
// event tables and other macros for wxWidgets
return false;
// Create the main application window
- MyFrame *frame = new MyFrame(_T("Exec wxWidgets sample"),
+ MyFrame *frame = new MyFrame(wxT("Exec wxWidgets sample"),
wxDefaultPosition, wxSize(500, 140));
// Show it and tell the application that it's our main window
// create a menu bar
wxMenu *menuFile = new wxMenu(wxEmptyString, wxMENU_TEAROFF);
- menuFile->Append(Exec_Kill, _T("&Kill process...\tCtrl-K"),
- _T("Kill a process by PID"));
+ menuFile->Append(Exec_Kill, wxT("&Kill process...\tCtrl-K"),
+ wxT("Kill a process by PID"));
menuFile->AppendSeparator();
- menuFile->Append(Exec_ClearLog, _T("&Clear log\tCtrl-L"),
- _T("Clear the log window"));
+ menuFile->Append(Exec_ClearLog, wxT("&Clear log\tCtrl-L"),
+ wxT("Clear the log window"));
menuFile->AppendSeparator();
- menuFile->Append(Exec_BeginBusyCursor, _T("Show &busy cursor\tCtrl-C"));
- menuFile->Append(Exec_EndBusyCursor, _T("Show &normal cursor\tShift-Ctrl-C"));
+ menuFile->Append(Exec_BeginBusyCursor, wxT("Show &busy cursor\tCtrl-C"));
+ menuFile->Append(Exec_EndBusyCursor, wxT("Show &normal cursor\tShift-Ctrl-C"));
menuFile->AppendSeparator();
- menuFile->Append(Exec_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(Exec_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
wxMenu *execMenu = new wxMenu;
- execMenu->Append(Exec_SyncExec, _T("Sync &execution...\tCtrl-E"),
- _T("Launch a program and return when it terminates"));
- execMenu->Append(Exec_SyncNoEventsExec, _T("Sync execution and &block...\tCtrl-B"),
- _T("Launch a program and block until it terminates"));
- execMenu->Append(Exec_AsyncExec, _T("&Async execution...\tCtrl-A"),
- _T("Launch a program and return immediately"));
- execMenu->Append(Exec_Shell, _T("Execute &shell command...\tCtrl-S"),
- _T("Launch a shell and execute a command in it"));
+ execMenu->Append(Exec_SyncExec, wxT("Sync &execution...\tCtrl-E"),
+ wxT("Launch a program and return when it terminates"));
+ execMenu->Append(Exec_SyncNoEventsExec, wxT("Sync execution and &block...\tCtrl-B"),
+ wxT("Launch a program and block until it terminates"));
+ execMenu->Append(Exec_AsyncExec, wxT("&Async execution...\tCtrl-A"),
+ wxT("Launch a program and return immediately"));
+ execMenu->Append(Exec_Shell, wxT("Execute &shell command...\tCtrl-S"),
+ wxT("Launch a shell and execute a command in it"));
execMenu->AppendSeparator();
- execMenu->Append(Exec_Redirect, _T("Capture command &output...\tCtrl-O"),
- _T("Launch a program and capture its output"));
- execMenu->Append(Exec_Pipe, _T("&Pipe through command..."),
- _T("Pipe a string through a filter"));
- execMenu->Append(Exec_POpen, _T("&Open a pipe to a command...\tCtrl-P"),
- _T("Open a pipe to and from another program"));
+ execMenu->Append(Exec_Redirect, wxT("Capture command &output...\tCtrl-O"),
+ wxT("Launch a program and capture its output"));
+ execMenu->Append(Exec_Pipe, wxT("&Pipe through command..."),
+ wxT("Pipe a string through a filter"));
+ execMenu->Append(Exec_POpen, wxT("&Open a pipe to a command...\tCtrl-P"),
+ wxT("Open a pipe to and from another program"));
execMenu->AppendSeparator();
- execMenu->Append(Exec_OpenFile, _T("Open &file...\tCtrl-F"),
- _T("Launch the command to open this kind of files"));
- execMenu->Append(Exec_LaunchFile, _T("La&unch file...\tShift-Ctrl-F"),
- _T("Launch the default application associated with the file"));
- execMenu->Append(Exec_OpenURL, _T("Open &URL...\tCtrl-U"),
- _T("Launch the default browser with the given URL"));
+ execMenu->Append(Exec_OpenFile, wxT("Open &file...\tCtrl-F"),
+ wxT("Launch the command to open this kind of files"));
+ execMenu->Append(Exec_LaunchFile, wxT("La&unch file...\tShift-Ctrl-F"),
+ wxT("Launch the default application associated with the file"));
+ execMenu->Append(Exec_OpenURL, wxT("Open &URL...\tCtrl-U"),
+ wxT("Launch the default browser with the given URL"));
#ifdef __WINDOWS__
execMenu->AppendSeparator();
- execMenu->Append(Exec_DDEExec, _T("Execute command via &DDE...\tCtrl-D"));
- execMenu->Append(Exec_DDERequest, _T("Send DDE &request...\tCtrl-R"));
+ execMenu->Append(Exec_DDEExec, wxT("Execute command via &DDE...\tCtrl-D"));
+ execMenu->Append(Exec_DDERequest, wxT("Send DDE &request...\tCtrl-R"));
#endif
wxMenu *helpMenu = new wxMenu(wxEmptyString, wxMENU_TEAROFF);
- helpMenu->Append(Exec_About, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(Exec_About, wxT("&About...\tF1"), wxT("Show about dialog"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(execMenu, _T("&Exec"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(execMenu, wxT("&Exec"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWidgets exec sample!"));
+ SetStatusText(wxT("Welcome to wxWidgets exec sample!"));
#endif // wxUSE_STATUSBAR
m_timerBg.Start(1000);
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("Exec wxWidgets Sample\n(c) 2000-2002 Vadim Zeitlin"),
- _T("About Exec"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(wxT("Exec wxWidgets Sample\n(c) 2000-2002 Vadim Zeitlin"),
+ wxT("About Exec"), wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event))
{
- long pid = wxGetNumberFromUser(_T("Please specify the process to kill"),
- _T("Enter PID:"),
- _T("Exec question"),
+ long pid = wxGetNumberFromUser(wxT("Please specify the process to kill"),
+ wxT("Enter PID:"),
+ wxT("Exec question"),
m_pidLast,
// we need the full unsigned int range
-INT_MAX, INT_MAX,
static const wxString signalNames[] =
{
- _T("Just test (SIGNONE)"),
- _T("Hangup (SIGHUP)"),
- _T("Interrupt (SIGINT)"),
- _T("Quit (SIGQUIT)"),
- _T("Illegal instruction (SIGILL)"),
- _T("Trap (SIGTRAP)"),
- _T("Abort (SIGABRT)"),
- _T("Emulated trap (SIGEMT)"),
- _T("FP exception (SIGFPE)"),
- _T("Kill (SIGKILL)"),
- _T("Bus (SIGBUS)"),
- _T("Segment violation (SIGSEGV)"),
- _T("System (SIGSYS)"),
- _T("Broken pipe (SIGPIPE)"),
- _T("Alarm (SIGALRM)"),
- _T("Terminate (SIGTERM)"),
+ wxT("Just test (SIGNONE)"),
+ wxT("Hangup (SIGHUP)"),
+ wxT("Interrupt (SIGINT)"),
+ wxT("Quit (SIGQUIT)"),
+ wxT("Illegal instruction (SIGILL)"),
+ wxT("Trap (SIGTRAP)"),
+ wxT("Abort (SIGABRT)"),
+ wxT("Emulated trap (SIGEMT)"),
+ wxT("FP exception (SIGFPE)"),
+ wxT("Kill (SIGKILL)"),
+ wxT("Bus (SIGBUS)"),
+ wxT("Segment violation (SIGSEGV)"),
+ wxT("System (SIGSYS)"),
+ wxT("Broken pipe (SIGPIPE)"),
+ wxT("Alarm (SIGALRM)"),
+ wxT("Terminate (SIGTERM)"),
};
- int sig = wxGetSingleChoiceIndex(_T("How to kill the process?"),
- _T("Exec question"),
+ int sig = wxGetSingleChoiceIndex(wxT("How to kill the process?"),
+ wxT("Exec question"),
WXSIZEOF(signalNames), signalNames,
this);
switch ( sig )
{
default:
- wxFAIL_MSG( _T("unexpected return value") );
+ wxFAIL_MSG( wxT("unexpected return value") );
// fall through
case -1:
{
if ( wxProcess::Exists(pid) )
{
- wxLogStatus(_T("Process %ld is running."), pid);
+ wxLogStatus(wxT("Process %ld is running."), pid);
}
else
{
- wxLogStatus(_T("No process with pid = %ld."), pid);
+ wxLogStatus(wxT("No process with pid = %ld."), pid);
}
}
else // not SIGNONE
wxKillError rc = wxProcess::Kill(pid, (wxSignal)sig);
if ( rc == wxKILL_OK )
{
- wxLogStatus(_T("Process %ld killed with signal %d."), pid, sig);
+ wxLogStatus(wxT("Process %ld killed with signal %d."), pid, sig);
}
else
{
static const wxChar *errorText[] =
{
- _T(""), // no error
- _T("signal not supported"),
- _T("permission denied"),
- _T("no such process"),
- _T("unspecified error"),
+ wxT(""), // no error
+ wxT("signal not supported"),
+ wxT("permission denied"),
+ wxT("no such process"),
+ wxT("unspecified error"),
};
- wxLogStatus(_T("Failed to kill process %ld with signal %d: %s"),
+ wxLogStatus(wxT("Failed to kill process %ld with signal %d: %s"),
pid, sig, errorText[rc]);
}
}
m_pidLast = wxExecute(cmd, wxEXEC_ASYNC, process);
if ( !m_pidLast )
{
- wxLogError(_T("Execution of '%s' failed."), cmd.c_str());
+ wxLogError(wxT("Execution of '%s' failed."), cmd.c_str());
delete process;
}
else
{
- wxLogStatus(_T("Process %ld (%s) launched."), m_pidLast, cmd.c_str());
+ wxLogStatus(wxT("Process %ld (%s) launched."), m_pidLast, cmd.c_str());
m_cmdLast = cmd;
void MyFrame::OnSyncExec(wxCommandEvent& WXUNUSED(event))
{
- wxString cmd = wxGetTextFromUser(_T("Enter the command: "),
+ wxString cmd = wxGetTextFromUser(wxT("Enter the command: "),
DIALOG_TITLE,
m_cmdLast);
if ( !cmd )
return;
- wxLogStatus( _T("'%s' is running please wait..."), cmd.c_str() );
+ wxLogStatus( wxT("'%s' is running please wait..."), cmd.c_str() );
int code = wxExecute(cmd, wxEXEC_SYNC);
- wxLogStatus(_T("Process '%s' terminated with exit code %d."),
+ wxLogStatus(wxT("Process '%s' terminated with exit code %d."),
cmd.c_str(), code);
m_cmdLast = cmd;
void MyFrame::OnSyncNoEventsExec(wxCommandEvent& WXUNUSED(event))
{
- wxString cmd = wxGetTextFromUser(_T("Enter the command: "),
+ wxString cmd = wxGetTextFromUser(wxT("Enter the command: "),
DIALOG_TITLE,
m_cmdLast);
if ( !cmd )
return;
- wxLogStatus( _T("'%s' is running please wait..."), cmd.c_str() );
+ wxLogStatus( wxT("'%s' is running please wait..."), cmd.c_str() );
int code = wxExecute(cmd, wxEXEC_BLOCK);
- wxLogStatus(_T("Process '%s' terminated with exit code %d."),
+ wxLogStatus(wxT("Process '%s' terminated with exit code %d."),
cmd.c_str(), code);
m_cmdLast = cmd;
void MyFrame::OnAsyncExec(wxCommandEvent& WXUNUSED(event))
{
- wxString cmd = wxGetTextFromUser(_T("Enter the command: "),
+ wxString cmd = wxGetTextFromUser(wxT("Enter the command: "),
DIALOG_TITLE,
m_cmdLast);
void MyFrame::OnShell(wxCommandEvent& WXUNUSED(event))
{
- wxString cmd = wxGetTextFromUser(_T("Enter the command: "),
+ wxString cmd = wxGetTextFromUser(wxT("Enter the command: "),
DIALOG_TITLE,
m_cmdLast);
return;
int code = wxShell(cmd);
- wxLogStatus(_T("Shell command '%s' terminated with exit code %d."),
+ wxLogStatus(wxT("Shell command '%s' terminated with exit code %d."),
cmd.c_str(), code);
m_cmdLast = cmd;
}
#endif
}
- wxString cmd = wxGetTextFromUser(_T("Enter the command: "),
+ wxString cmd = wxGetTextFromUser(wxT("Enter the command: "),
DIALOG_TITLE,
m_cmdLast);
return;
bool sync;
- switch ( wxMessageBox(_T("Execute it synchronously?"),
- _T("Exec question"),
+ switch ( wxMessageBox(wxT("Execute it synchronously?"),
+ wxT("Exec question"),
wxYES_NO | wxCANCEL | wxICON_QUESTION, this) )
{
case wxYES:
if ( code != -1 )
{
- ShowOutput(cmd, output, _T("Output"));
- ShowOutput(cmd, errors, _T("Errors"));
+ ShowOutput(cmd, output, wxT("Output"));
+ ShowOutput(cmd, errors, wxT("Errors"));
}
}
else // async exec
MyPipedProcess *process = new MyPipedProcess(this, cmd);
if ( !wxExecute(cmd, wxEXEC_ASYNC, process) )
{
- wxLogError(_T("Execution of '%s' failed."), cmd.c_str());
+ wxLogError(wxT("Execution of '%s' failed."), cmd.c_str());
delete process;
}
void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event))
{
if ( !m_cmdLast )
- m_cmdLast = _T("tr [a-z] [A-Z]");
+ m_cmdLast = wxT("tr [a-z] [A-Z]");
- wxString cmd = wxGetTextFromUser(_T("Enter the command: "),
+ wxString cmd = wxGetTextFromUser(wxT("Enter the command: "),
DIALOG_TITLE,
m_cmdLast);
if ( !cmd )
return;
- wxString input = wxGetTextFromUser(_T("Enter the string to send to it: "),
+ wxString input = wxGetTextFromUser(wxT("Enter the string to send to it: "),
DIALOG_TITLE);
if ( !input )
return;
long pid = wxExecute(cmd, wxEXEC_ASYNC, process);
if ( pid )
{
- wxLogStatus(_T("Process %ld (%s) launched."), pid, cmd.c_str());
+ wxLogStatus(wxT("Process %ld (%s) launched."), pid, cmd.c_str());
AddPipedProcess(process);
}
else
{
- wxLogError(_T("Execution of '%s' failed."), cmd.c_str());
+ wxLogError(wxT("Execution of '%s' failed."), cmd.c_str());
delete process;
}
void MyFrame::OnPOpen(wxCommandEvent& WXUNUSED(event))
{
- wxString cmd = wxGetTextFromUser(_T("Enter the command to launch: "),
+ wxString cmd = wxGetTextFromUser(wxT("Enter the command to launch: "),
DIALOG_TITLE,
m_cmdLast);
if ( cmd.empty() )
wxProcess *process = wxProcess::Open(cmd);
if ( !process )
{
- wxLogError(_T("Failed to launch the command."));
+ wxLogError(wxT("Failed to launch the command."));
return;
}
- wxLogVerbose(_T("PID of the new process: %ld"), process->GetPid());
+ wxLogVerbose(wxT("PID of the new process: %ld"), process->GetPid());
wxOutputStream *out = process->GetOutputStream();
if ( !out )
{
- wxLogError(_T("Failed to connect to child stdin"));
+ wxLogError(wxT("Failed to connect to child stdin"));
return;
}
wxInputStream *in = process->GetInputStream();
if ( !in )
{
- wxLogError(_T("Failed to connect to child stdout"));
+ wxLogError(wxT("Failed to connect to child stdout"));
return;
}
wxString filename;
#if wxUSE_FILEDLG
- filename = wxLoadFileSelector(_T("any"), wxEmptyString, gs_lastFile);
+ filename = wxLoadFileSelector(wxT("any"), wxEmptyString, gs_lastFile);
#else // !wxUSE_FILEDLG
- filename = wxGetTextFromUser(_T("Enter the file name"), _T("exec sample"),
+ filename = wxGetTextFromUser(wxT("Enter the file name"), wxT("exec sample"),
gs_lastFile);
#endif // wxUSE_FILEDLG/!wxUSE_FILEDLG
if ( !AskUserForFileName() )
return;
- wxString ext = gs_lastFile.AfterLast(_T('.'));
+ wxString ext = gs_lastFile.AfterLast(wxT('.'));
wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(ext);
if ( !ft )
{
- wxLogError(_T("Impossible to determine the file type for extension '%s'"),
+ wxLogError(wxT("Impossible to determine the file type for extension '%s'"),
ext.c_str());
return;
}
delete ft;
if ( !ok )
{
- wxLogError(_T("Impossible to find out how to open files of extension '%s'"),
+ wxLogError(wxT("Impossible to find out how to open files of extension '%s'"),
ext.c_str());
return;
}
void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event))
{
- static wxString s_url(_T("http://www.wxwidgets.org/"));
+ static wxString s_url(wxT("http://www.wxwidgets.org/"));
wxString filename = wxGetTextFromUser
(
- _T("Enter the URL"),
- _T("exec sample"),
+ wxT("Enter the URL"),
+ wxT("exec sample"),
s_url,
this
);
if ( !wxLaunchDefaultBrowser(s_url) )
{
- wxLogError(_T("Failed to open URL \"%s\""), s_url.c_str());
+ wxLogError(wxT("Failed to open URL \"%s\""), s_url.c_str());
}
}
bool MyFrame::GetDDEServer()
{
- wxString server = wxGetTextFromUser(_T("Server to connect to:"),
+ wxString server = wxGetTextFromUser(wxT("Server to connect to:"),
DIALOG_TITLE, m_server);
if ( !server )
return false;
m_server = server;
- wxString topic = wxGetTextFromUser(_T("DDE topic:"), DIALOG_TITLE, m_topic);
+ wxString topic = wxGetTextFromUser(wxT("DDE topic:"), DIALOG_TITLE, m_topic);
if ( !topic )
return false;
m_topic = topic;
- wxString cmd = wxGetTextFromUser(_T("DDE command:"), DIALOG_TITLE, m_cmdDde);
+ wxString cmd = wxGetTextFromUser(wxT("DDE command:"), DIALOG_TITLE, m_cmdDde);
if ( !cmd )
return false;
wxConnectionBase *conn = client.MakeConnection(wxEmptyString, m_server, m_topic);
if ( !conn )
{
- wxLogError(_T("Failed to connect to the DDE server '%s'."),
+ wxLogError(wxT("Failed to connect to the DDE server '%s'."),
m_server.c_str());
}
else
{
if ( !conn->Execute(m_cmdDde) )
{
- wxLogError(_T("Failed to execute command '%s' via DDE."),
+ wxLogError(wxT("Failed to execute command '%s' via DDE."),
m_cmdDde.c_str());
}
else
{
- wxLogStatus(_T("Successfully executed DDE command"));
+ wxLogStatus(wxT("Successfully executed DDE command"));
}
}
}
wxConnectionBase *conn = client.MakeConnection(wxEmptyString, m_server, m_topic);
if ( !conn )
{
- wxLogError(_T("Failed to connect to the DDE server '%s'."),
+ wxLogError(wxT("Failed to connect to the DDE server '%s'."),
m_server.c_str());
}
else
{
if ( !conn->Request(m_cmdDde) )
{
- wxLogError(_T("Failed to send request '%s' via DDE."),
+ wxLogError(wxT("Failed to send request '%s' via DDE."),
m_cmdDde.c_str());
}
else
{
- wxLogStatus(_T("Successfully sent DDE request."));
+ wxLogStatus(wxT("Successfully sent DDE request."));
}
}
}
if ( !count )
return;
- m_lbox->Append(wxString::Format(_T("--- %s of '%s' ---"),
+ m_lbox->Append(wxString::Format(wxT("--- %s of '%s' ---"),
title.c_str(), cmd.c_str()));
for ( size_t n = 0; n < count; n++ )
m_lbox->Append(output[n]);
}
- m_lbox->Append(wxString::Format(_T("--- End of %s ---"),
+ m_lbox->Append(wxString::Format(wxT("--- End of %s ---"),
title.Lower().c_str()));
}
void MyProcess::OnTerminate(int pid, int status)
{
- wxLogStatus(m_parent, _T("Process %u ('%s') terminated with exit code %d."),
+ wxLogStatus(m_parent, wxT("Process %u ('%s') terminated with exit code %d."),
pid, m_cmd.c_str(), status);
m_parent->OnAsyncTermination(this);
// this assumes that the output is always line buffered
wxString msg;
- msg << m_cmd << _T(" (stdout): ") << tis.ReadLine();
+ msg << m_cmd << wxT(" (stdout): ") << tis.ReadLine();
m_parent->GetLogListBox()->Append(msg);
// this assumes that the output is always line buffered
wxString msg;
- msg << m_cmd << _T(" (stderr): ") << tis.ReadLine();
+ msg << m_cmd << wxT(" (stderr): ") << tis.ReadLine();
m_parent->GetLogListBox()->Append(msg);
wxSizer *sizerBtns = new wxBoxSizer(wxHORIZONTAL);
sizerBtns->
- Add(new wxButton(panel, Exec_Btn_Send, _T("&Send")), 0, wxALL, 5);
+ Add(new wxButton(panel, Exec_Btn_Send, wxT("&Send")), 0, wxALL, 5);
sizerBtns->
- Add(new wxButton(panel, Exec_Btn_SendFile, _T("&File...")), 0, wxALL, 5);
+ Add(new wxButton(panel, Exec_Btn_SendFile, wxT("&File...")), 0, wxALL, 5);
sizerBtns->
- Add(new wxButton(panel, Exec_Btn_Get, _T("&Get")), 0, wxALL, 5);
+ Add(new wxButton(panel, Exec_Btn_Get, wxT("&Get")), 0, wxALL, 5);
sizerBtns->
- Add(new wxButton(panel, Exec_Btn_Close, _T("&Close")), 0, wxALL, 5);
+ Add(new wxButton(panel, Exec_Btn_Close, wxT("&Close")), 0, wxALL, 5);
sizerTop->Add(sizerBtns, 0, wxCENTRE | wxALL, 5);
sizerTop->Add(m_textIn, 1, wxGROW | wxALL, 5);
void MyPipeFrame::OnBtnSendFile(wxCommandEvent& WXUNUSED(event))
{
#if wxUSE_FILEDLG
- wxFileDialog filedlg(this, _T("Select file to send"));
+ wxFileDialog filedlg(this, wxT("Select file to send"));
if ( filedlg.ShowModal() != wxID_OK )
return;
- wxFFile file(filedlg.GetFilename(), _T("r"));
+ wxFFile file(filedlg.GetFilename(), wxT("r"));
wxString data;
if ( !file.IsOpened() || !file.ReadAll(&data) )
return;
while ( in.CanRead() )
{
wxChar buffer[4096];
- buffer[in.Read(buffer, WXSIZEOF(buffer) - 1).LastRead()] = _T('\0');
+ buffer[in.Read(buffer, WXSIZEOF(buffer) - 1).LastRead()] = wxT('\0');
text->AppendText(buffer);
}
delete m_process;
m_process = NULL;
- wxLogWarning(_T("The other process has terminated, closing"));
+ wxLogWarning(wxT("The other process has terminated, closing"));
DisableInput();
DisableOutput();
#endif
// used as title for several dialog boxes
-static const wxChar SAMPLE_TITLE[] = _T("wxWidgets Font Sample");
+static const wxChar SAMPLE_TITLE[] = wxT("wxWidgets Font Sample");
// ----------------------------------------------------------------------------
// private classes
fontInfo.Printf(wxT("Style: %s, weight: %s, fixed width: %s"),
m_font.GetStyleString().c_str(),
m_font.GetWeightString().c_str(),
- m_font.IsFixedWidth() ? _T("yes") : _T("no"));
+ m_font.IsFixedWidth() ? wxT("yes") : wxT("no"));
dc.DrawText(fontInfo, x, y);
y += hLine;
}
// draw the lines between them
- dc.SetPen(wxPen(wxColour(_T("blue")), 1, wxSOLID));
+ dc.SetPen(wxPen(wxColour(wxT("blue")), 1, wxSOLID));
int l;
// horizontal
GridFrame::GridFrame()
- : wxFrame( (wxFrame *)NULL, wxID_ANY, _T("wxWidgets grid class demo"),
+ : wxFrame( (wxFrame *)NULL, wxID_ANY, wxT("wxWidgets grid class demo"),
wxDefaultPosition,
wxDefaultSize )
{
SetIcon(wxICON(sample));
wxMenu *fileMenu = new wxMenu;
- fileMenu->Append( ID_VTABLE, _T("&Virtual table test\tCtrl-V"));
- fileMenu->Append( ID_BUGS_TABLE, _T("&Bugs table test\tCtrl-B"));
- fileMenu->Append( ID_TABULAR_TABLE, _T("&Tabular table test\tCtrl-T"));
+ fileMenu->Append( ID_VTABLE, wxT("&Virtual table test\tCtrl-V"));
+ fileMenu->Append( ID_BUGS_TABLE, wxT("&Bugs table test\tCtrl-B"));
+ fileMenu->Append( ID_TABULAR_TABLE, wxT("&Tabular table test\tCtrl-T"));
fileMenu->AppendSeparator();
- fileMenu->Append( wxID_EXIT, _T("E&xit\tAlt-X") );
+ fileMenu->Append( wxID_EXIT, wxT("E&xit\tAlt-X") );
wxMenu *viewMenu = new wxMenu;
viewMenu->AppendCheckItem(ID_TOGGLEROWLABELS, "&Row labels");
wxMenu *rowLabelMenu = new wxMenu;
- viewMenu->Append( ID_ROWLABELALIGN, _T("R&ow label alignment"),
+ viewMenu->Append( ID_ROWLABELALIGN, wxT("R&ow label alignment"),
rowLabelMenu,
- _T("Change alignment of row labels") );
+ wxT("Change alignment of row labels") );
- rowLabelMenu->Append( ID_ROWLABELHORIZALIGN, _T("&Horizontal") );
- rowLabelMenu->Append( ID_ROWLABELVERTALIGN, _T("&Vertical") );
+ rowLabelMenu->Append( ID_ROWLABELHORIZALIGN, wxT("&Horizontal") );
+ rowLabelMenu->Append( ID_ROWLABELVERTALIGN, wxT("&Vertical") );
wxMenu *colLabelMenu = new wxMenu;
- viewMenu->Append( ID_COLLABELALIGN, _T("Col l&abel alignment"),
+ viewMenu->Append( ID_COLLABELALIGN, wxT("Col l&abel alignment"),
colLabelMenu,
- _T("Change alignment of col labels") );
+ wxT("Change alignment of col labels") );
- colLabelMenu->Append( ID_COLLABELHORIZALIGN, _T("&Horizontal") );
- colLabelMenu->Append( ID_COLLABELVERTALIGN, _T("&Vertical") );
+ colLabelMenu->Append( ID_COLLABELHORIZALIGN, wxT("&Horizontal") );
+ colLabelMenu->Append( ID_COLLABELVERTALIGN, wxT("&Vertical") );
wxMenu *colMenu = new wxMenu;
- colMenu->Append( ID_SETLABELCOLOUR, _T("Set &label colour...") );
- colMenu->Append( ID_SETLABELTEXTCOLOUR, _T("Set label &text colour...") );
- colMenu->Append( ID_SETLABEL_FONT, _T("Set label fo&nt...") );
- colMenu->Append( ID_GRIDLINECOLOUR, _T("&Grid line colour...") );
- colMenu->Append( ID_SET_CELL_FG_COLOUR, _T("Set cell &foreground colour...") );
- colMenu->Append( ID_SET_CELL_BG_COLOUR, _T("Set cell &background colour...") );
+ colMenu->Append( ID_SETLABELCOLOUR, wxT("Set &label colour...") );
+ colMenu->Append( ID_SETLABELTEXTCOLOUR, wxT("Set label &text colour...") );
+ colMenu->Append( ID_SETLABEL_FONT, wxT("Set label fo&nt...") );
+ colMenu->Append( ID_GRIDLINECOLOUR, wxT("&Grid line colour...") );
+ colMenu->Append( ID_SET_CELL_FG_COLOUR, wxT("Set cell &foreground colour...") );
+ colMenu->Append( ID_SET_CELL_BG_COLOUR, wxT("Set cell &background colour...") );
wxMenu *editMenu = new wxMenu;
- editMenu->Append( ID_INSERTROW, _T("Insert &row") );
- editMenu->Append( ID_INSERTCOL, _T("Insert &column") );
- editMenu->Append( ID_DELETEROW, _T("Delete selected ro&ws") );
- editMenu->Append( ID_DELETECOL, _T("Delete selected co&ls") );
- editMenu->Append( ID_CLEARGRID, _T("Cl&ear grid cell contents") );
+ editMenu->Append( ID_INSERTROW, wxT("Insert &row") );
+ editMenu->Append( ID_INSERTCOL, wxT("Insert &column") );
+ editMenu->Append( ID_DELETEROW, wxT("Delete selected ro&ws") );
+ editMenu->Append( ID_DELETECOL, wxT("Delete selected co&ls") );
+ editMenu->Append( ID_CLEARGRID, wxT("Cl&ear grid cell contents") );
wxMenu *selectMenu = new wxMenu;
- selectMenu->Append( ID_SELECT_UNSELECT, _T("Add new cells to the selection"),
- _T("When off, old selection is deselected before ")
- _T("selecting the new cells"), wxITEM_CHECK );
+ selectMenu->Append( ID_SELECT_UNSELECT, wxT("Add new cells to the selection"),
+ wxT("When off, old selection is deselected before ")
+ wxT("selecting the new cells"), wxITEM_CHECK );
selectMenu->Append( ID_SHOW_SELECTION,
- _T("&Show current selection\tCtrl-Alt-S"));
+ wxT("&Show current selection\tCtrl-Alt-S"));
selectMenu->AppendSeparator();
- selectMenu->Append( ID_SELECT_ALL, _T("Select all"));
- selectMenu->Append( ID_SELECT_ROW, _T("Select row 2"));
- selectMenu->Append( ID_SELECT_COL, _T("Select col 2"));
- selectMenu->Append( ID_SELECT_CELL, _T("Select cell (3, 1)"));
+ selectMenu->Append( ID_SELECT_ALL, wxT("Select all"));
+ selectMenu->Append( ID_SELECT_ROW, wxT("Select row 2"));
+ selectMenu->Append( ID_SELECT_COL, wxT("Select col 2"));
+ selectMenu->Append( ID_SELECT_CELL, wxT("Select cell (3, 1)"));
selectMenu->AppendSeparator();
- selectMenu->Append( ID_DESELECT_ALL, _T("Deselect all"));
- selectMenu->Append( ID_DESELECT_ROW, _T("Deselect row 2"));
- selectMenu->Append( ID_DESELECT_COL, _T("Deselect col 2"));
- selectMenu->Append( ID_DESELECT_CELL, _T("Deselect cell (3, 1)"));
+ selectMenu->Append( ID_DESELECT_ALL, wxT("Deselect all"));
+ selectMenu->Append( ID_DESELECT_ROW, wxT("Deselect row 2"));
+ selectMenu->Append( ID_DESELECT_COL, wxT("Deselect col 2"));
+ selectMenu->Append( ID_DESELECT_CELL, wxT("Deselect cell (3, 1)"));
wxMenu *selectionMenu = new wxMenu;
- selectMenu->Append( ID_CHANGESEL, _T("Change &selection mode"),
+ selectMenu->Append( ID_CHANGESEL, wxT("Change &selection mode"),
selectionMenu,
- _T("Change selection mode") );
+ wxT("Change selection mode") );
- selectionMenu->Append( ID_SELCELLS, _T("Select &cells") );
- selectionMenu->Append( ID_SELROWS, _T("Select &rows") );
- selectionMenu->Append( ID_SELCOLS, _T("Select col&umns") );
- selectionMenu->Append( ID_SELROWSORCOLS, _T("Select rows &or columns") );
+ selectionMenu->Append( ID_SELCELLS, wxT("Select &cells") );
+ selectionMenu->Append( ID_SELROWS, wxT("Select &rows") );
+ selectionMenu->Append( ID_SELCOLS, wxT("Select col&umns") );
+ selectionMenu->Append( ID_SELROWSORCOLS, wxT("Select rows &or columns") );
wxMenu *autosizeMenu = new wxMenu;
- autosizeMenu->Append( ID_SIZE_ROW, _T("Selected &row data") );
- autosizeMenu->Append( ID_SIZE_COL, _T("Selected &column data") );
- autosizeMenu->Append( ID_SIZE_ROW_LABEL, _T("Selected row la&bel") );
- autosizeMenu->Append( ID_SIZE_COL_LABEL, _T("Selected column &label") );
- autosizeMenu->Append( ID_SIZE_LABELS_COL, _T("Column la&bels") );
- autosizeMenu->Append( ID_SIZE_LABELS_ROW, _T("Row label&s") );
- autosizeMenu->Append( ID_SIZE_GRID, _T("Entire &grid") );
+ autosizeMenu->Append( ID_SIZE_ROW, wxT("Selected &row data") );
+ autosizeMenu->Append( ID_SIZE_COL, wxT("Selected &column data") );
+ autosizeMenu->Append( ID_SIZE_ROW_LABEL, wxT("Selected row la&bel") );
+ autosizeMenu->Append( ID_SIZE_COL_LABEL, wxT("Selected column &label") );
+ autosizeMenu->Append( ID_SIZE_LABELS_COL, wxT("Column la&bels") );
+ autosizeMenu->Append( ID_SIZE_LABELS_ROW, wxT("Row label&s") );
+ autosizeMenu->Append( ID_SIZE_GRID, wxT("Entire &grid") );
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append( wxID_ABOUT, _T("&About wxGrid demo") );
+ helpMenu->Append( wxID_ABOUT, wxT("&About wxGrid demo") );
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append( fileMenu, _T("&File") );
- menuBar->Append( viewMenu, _T("&Grid") );
- menuBar->Append( colMenu, _T("&Colours") );
- menuBar->Append( editMenu, _T("&Edit") );
- menuBar->Append( selectMenu, _T("&Select") );
- menuBar->Append( autosizeMenu, _T("&Autosize") );
- menuBar->Append( helpMenu, _T("&Help") );
+ menuBar->Append( fileMenu, wxT("&File") );
+ menuBar->Append( viewMenu, wxT("&Grid") );
+ menuBar->Append( colMenu, wxT("&Colours") );
+ menuBar->Append( editMenu, wxT("&Edit") );
+ menuBar->Append( selectMenu, wxT("&Select") );
+ menuBar->Append( autosizeMenu, wxT("&Autosize") );
+ menuBar->Append( helpMenu, wxT("&Help") );
SetMenuBar( menuBar );
grid->AppendRows(ir);
grid->SetRowSize( 0, 60 );
- grid->SetCellValue( 0, 0, _T("Ctrl+Home\nwill go to\nthis cell") );
+ grid->SetCellValue( 0, 0, wxT("Ctrl+Home\nwill go to\nthis cell") );
- grid->SetCellValue( 0, 1, _T("A long piece of text to demonstrate wrapping.") );
+ grid->SetCellValue( 0, 1, wxT("A long piece of text to demonstrate wrapping.") );
grid->SetCellRenderer(0 , 1, new wxGridCellAutoWrapStringRenderer);
grid->SetCellEditor( 0, 1 , new wxGridCellAutoWrapStringEditor);
- grid->SetCellValue( 0, 2, _T("Blah") );
- grid->SetCellValue( 0, 3, _T("Read only") );
+ grid->SetCellValue( 0, 2, wxT("Blah") );
+ grid->SetCellValue( 0, 3, wxT("Read only") );
grid->SetReadOnly( 0, 3 );
- grid->SetCellValue( 0, 4, _T("Can veto edit this cell") );
+ grid->SetCellValue( 0, 4, wxT("Can veto edit this cell") );
- grid->SetCellValue( 0, 5, _T("Press\nCtrl+arrow\nto skip over\ncells") );
+ grid->SetCellValue( 0, 5, wxT("Press\nCtrl+arrow\nto skip over\ncells") );
grid->SetRowSize( 99, 60 );
- grid->SetCellValue( 99, 99, _T("Ctrl+End\nwill go to\nthis cell") );
- grid->SetCellValue( 1, 0, _T("This default cell will overflow into neighboring cells, but not if you turn overflow off."));
+ grid->SetCellValue( 99, 99, wxT("Ctrl+End\nwill go to\nthis cell") );
+ grid->SetCellValue( 1, 0, wxT("This default cell will overflow into neighboring cells, but not if you turn overflow off."));
grid->SetCellTextColour(1, 2, *wxRED);
grid->SetCellBackgroundColour(1, 2, *wxGREEN);
- grid->SetCellValue( 1, 4, _T("I'm in the middle"));
+ grid->SetCellValue( 1, 4, wxT("I'm in the middle"));
- grid->SetCellValue(2, 2, _T("red"));
+ grid->SetCellValue(2, 2, wxT("red"));
grid->SetCellTextColour(2, 2, *wxRED);
- grid->SetCellValue(3, 3, _T("green on grey"));
+ grid->SetCellValue(3, 3, wxT("green on grey"));
grid->SetCellTextColour(3, 3, *wxGREEN);
grid->SetCellBackgroundColour(3, 3, *wxLIGHT_GREY);
- grid->SetCellValue(4, 4, _T("a weird looking cell"));
+ grid->SetCellValue(4, 4, wxT("a weird looking cell"));
grid->SetCellAlignment(4, 4, wxALIGN_CENTRE, wxALIGN_CENTRE);
grid->SetCellRenderer(4, 4, new MyGridCellRenderer);
attr->SetBackgroundColour(*wxRED);
grid->SetRowAttr(5, attr);
- grid->SetCellValue(2, 4, _T("a wider column"));
+ grid->SetCellValue(2, 4, wxT("a wider column"));
grid->SetColSize(4, 120);
grid->SetColMinimalWidth(4, 120);
grid->SetCellTextColour(5, 8, *wxGREEN);
- grid->SetCellValue(5, 8, _T("Bg from row attr\nText col from cell attr"));
- grid->SetCellValue(5, 5, _T("Bg from row attr Text col from col attr and this text is so long that it covers over many many empty cells but is broken by one that isn't"));
+ grid->SetCellValue(5, 8, wxT("Bg from row attr\nText col from cell attr"));
+ grid->SetCellValue(5, 5, wxT("Bg from row attr Text col from col attr and this text is so long that it covers over many many empty cells but is broken by one that isn't"));
grid->SetColFormatFloat(6);
grid->SetCellValue(0, 6, wxString::Format(wxT("%g"), 3.1415));
const wxString choices[] =
{
- _T("Please select a choice"),
- _T("This takes two cells"),
- _T("Another choice"),
+ wxT("Please select a choice"),
+ wxT("This takes two cells"),
+ wxT("Another choice"),
};
grid->SetCellEditor(4, 0, new wxGridCellChoiceEditor(WXSIZEOF(choices), choices));
grid->SetCellSize(4, 0, 1, 2);
grid->SetCellSize(7, 1, 3, 4);
grid->SetCellAlignment(7, 1, wxALIGN_CENTRE, wxALIGN_CENTRE);
- grid->SetCellValue(7, 1, _T("Big box!"));
+ grid->SetCellValue(7, 1, wxT("Big box!"));
// create a separator-like row: it's grey and it's non-resizeable
grid->DisableRowResize(10);
void GridFrame::OnSetHighlightWidth( wxCommandEvent& WXUNUSED(ev) )
{
- wxString choices[] = { _T("0"), _T("1"), _T("2"), _T("3"), _T("4"), _T("5"), _T("6"), _T("7"), _T("8"), _T("9"), _T("10")};
+ wxString choices[] = { wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7"), wxT("8"), wxT("9"), wxT("10")};
- wxSingleChoiceDialog dlg(this, _T("Choose the thickness of the highlight pen:"),
- _T("Pen Width"), 11, choices);
+ wxSingleChoiceDialog dlg(this, wxT("Choose the thickness of the highlight pen:"),
+ wxT("Pen Width"), 11, choices);
int current = grid->GetCellHighlightPenWidth();
dlg.SetSelection(current);
void GridFrame::OnSetROHighlightWidth( wxCommandEvent& WXUNUSED(ev) )
{
- wxString choices[] = { _T("0"), _T("1"), _T("2"), _T("3"), _T("4"), _T("5"), _T("6"), _T("7"), _T("8"), _T("9"), _T("10")};
+ wxString choices[] = { wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7"), wxT("8"), wxT("9"), wxT("10")};
- wxSingleChoiceDialog dlg(this, _T("Choose the thickness of the highlight pen:"),
- _T("Pen Width"), 11, choices);
+ wxSingleChoiceDialog dlg(this, wxT("Choose the thickness of the highlight pen:"),
+ wxT("Pen Width"), 11, choices);
int current = grid->GetCellHighlightROPenWidth();
dlg.SetSelection(current);
wxString logBuf;
if ( ev.GetRow() != -1 )
{
- logBuf << _T("Left click on row label ") << ev.GetRow();
+ logBuf << wxT("Left click on row label ") << ev.GetRow();
}
else if ( ev.GetCol() != -1 )
{
- logBuf << _T("Left click on col label ") << ev.GetCol();
+ logBuf << wxT("Left click on col label ") << ev.GetCol();
}
else
{
- logBuf << _T("Left click on corner label");
+ logBuf << wxT("Left click on corner label");
}
if ( ev.ShiftDown() )
- logBuf << _T(" (shift down)");
+ logBuf << wxT(" (shift down)");
if ( ev.ControlDown() )
- logBuf << _T(" (control down)");
+ logBuf << wxT(" (control down)");
wxLogMessage( wxT("%s"), logBuf.c_str() );
// you must call event skip if you want default grid processing
void GridFrame::OnCellLeftClick( wxGridEvent& ev )
{
- wxLogMessage(_T("Left click at row %d, col %d"), ev.GetRow(), ev.GetCol());
+ wxLogMessage(wxT("Left click at row %d, col %d"), ev.GetRow(), ev.GetCol());
// you must call event skip if you want default grid processing
// (cell highlighting etc.)
{
const wxGridCellCoordsArray cells(grid->GetSelectedCells());
size_t count = cells.size();
- wxLogMessage(_T("%lu cells selected:"), (unsigned long)count);
+ wxLogMessage(wxT("%lu cells selected:"), (unsigned long)count);
if ( count > countMax )
{
- wxLogMessage(_T("[too many selected cells, ")
- _T("showing only the first %lu]"),
+ wxLogMessage(wxT("[too many selected cells, ")
+ wxT("showing only the first %lu]"),
(unsigned long)countMax);
count = countMax;
}
for ( size_t n = 0; n < count; n++ )
{
const wxGridCellCoords& c = cells[n];
- wxLogMessage(_T(" selected cell %lu: (%d, %d)"),
+ wxLogMessage(wxT(" selected cell %lu: (%d, %d)"),
(unsigned long)n, c.GetCol(), c.GetRow());
}
}
const wxChar *plural, *single;
if ( rows )
{
- plural = _T("rows");
- single = _T("row");
+ plural = wxT("rows");
+ single = wxT("row");
}
else // columns
{
- plural = _T("columns");
- single = _T("column");
+ plural = wxT("columns");
+ single = wxT("column");
}
const wxArrayInt sels((const wxArrayInt)(rows ? grid->GetSelectedRows()
: grid->GetSelectedCols()));
size_t count = sels.size();
- wxLogMessage(_T("%lu %s selected:"),
+ wxLogMessage(wxT("%lu %s selected:"),
(unsigned long)count, plural);
if ( count > countMax )
{
- wxLogMessage(_T("[too many selected %s, ")
- _T("showing only the first %lu]"),
+ wxLogMessage(wxT("[too many selected %s, ")
+ wxT("showing only the first %lu]"),
plural, (unsigned long)countMax);
count = countMax;
}
for ( size_t n = 0; n < count; n++ )
{
- wxLogMessage(_T(" selected %s %lu: %d"),
+ wxLogMessage(wxT(" selected %s %lu: %d"),
single, (unsigned long)n, sels[n]);
}
}
break;
default:
- wxFAIL_MSG( _T("unknown wxGrid selection mode") );
+ wxFAIL_MSG( wxT("unknown wxGrid selection mode") );
break;
}
}
{
wxString logBuf;
if ( ev.Selecting() )
- logBuf << _T("Selected ");
+ logBuf << wxT("Selected ");
else
- logBuf << _T("Deselected ");
- logBuf << _T("cell at row ") << ev.GetRow()
- << _T(" col ") << ev.GetCol()
- << _T(" ( ControlDown: ")<< (ev.ControlDown() ? 'T':'F')
- << _T(", ShiftDown: ")<< (ev.ShiftDown() ? 'T':'F')
- << _T(", AltDown: ")<< (ev.AltDown() ? 'T':'F')
- << _T(", MetaDown: ")<< (ev.MetaDown() ? 'T':'F') << _T(" )");
+ logBuf << wxT("Deselected ");
+ logBuf << wxT("cell at row ") << ev.GetRow()
+ << wxT(" col ") << ev.GetCol()
+ << wxT(" ( ControlDown: ")<< (ev.ControlDown() ? 'T':'F')
+ << wxT(", ShiftDown: ")<< (ev.ShiftDown() ? 'T':'F')
+ << wxT(", AltDown: ")<< (ev.AltDown() ? 'T':'F')
+ << wxT(", MetaDown: ")<< (ev.MetaDown() ? 'T':'F') << wxT(" )");
//Indicate whether this column was moved
if ( ((wxGrid *)ev.GetEventObject())->GetColPos( ev.GetCol() ) != ev.GetCol() )
- logBuf << _T(" *** Column moved, current position: ") << ((wxGrid *)ev.GetEventObject())->GetColPos( ev.GetCol() );
+ logBuf << wxT(" *** Column moved, current position: ") << ((wxGrid *)ev.GetEventObject())->GetColPos( ev.GetCol() );
wxLogMessage( wxT("%s"), logBuf.c_str() );
{
wxString logBuf;
if ( ev.Selecting() )
- logBuf << _T("Selected ");
+ logBuf << wxT("Selected ");
else
- logBuf << _T("Deselected ");
- logBuf << _T("cells from row ") << ev.GetTopRow()
- << _T(" col ") << ev.GetLeftCol()
- << _T(" to row ") << ev.GetBottomRow()
- << _T(" col ") << ev.GetRightCol()
- << _T(" ( ControlDown: ")<< (ev.ControlDown() ? 'T':'F')
- << _T(", ShiftDown: ")<< (ev.ShiftDown() ? 'T':'F')
- << _T(", AltDown: ")<< (ev.AltDown() ? 'T':'F')
- << _T(", MetaDown: ")<< (ev.MetaDown() ? 'T':'F') << _T(" )");
+ logBuf << wxT("Deselected ");
+ logBuf << wxT("cells from row ") << ev.GetTopRow()
+ << wxT(" col ") << ev.GetLeftCol()
+ << wxT(" to row ") << ev.GetBottomRow()
+ << wxT(" col ") << ev.GetRightCol()
+ << wxT(" ( ControlDown: ")<< (ev.ControlDown() ? 'T':'F')
+ << wxT(", ShiftDown: ")<< (ev.ShiftDown() ? 'T':'F')
+ << wxT(", AltDown: ")<< (ev.AltDown() ? 'T':'F')
+ << wxT(", MetaDown: ")<< (ev.MetaDown() ? 'T':'F') << wxT(" )");
wxLogMessage( wxT("%s"), logBuf.c_str() );
ev.Skip();
void GridFrame::OnCellBeginDrag( wxGridEvent& ev )
{
- wxLogMessage(_T("Got request to drag cell at row %d, col %d"),
+ wxLogMessage(wxT("Got request to drag cell at row %d, col %d"),
ev.GetRow(), ev.GetCol());
ev.Skip();
if ( (ev.GetCol() == 4) &&
(ev.GetRow() == 0) &&
- (wxMessageBox(_T("Are you sure you wish to edit this cell"),
- _T("Checking"),wxYES_NO) == wxNO ) ) {
+ (wxMessageBox(wxT("Are you sure you wish to edit this cell"),
+ wxT("Checking"),wxYES_NO) == wxNO ) ) {
ev.Veto();
return;
if ( (ev.GetCol() == 4) &&
(ev.GetRow() == 0) &&
- (wxMessageBox(_T("Are you sure you wish to finish editing this cell"),
- _T("Checking"),wxYES_NO) == wxNO ) ) {
+ (wxMessageBox(wxT("Are you sure you wish to finish editing this cell"),
+ wxT("Checking"),wxYES_NO) == wxNO ) ) {
ev.Veto();
return;
{
static long s_sizeGrid = 10000;
- s_sizeGrid = wxGetNumberFromUser(_T("Size of the table to create"),
- _T("Size: "),
- _T("wxGridDemo question"),
+ s_sizeGrid = wxGetNumberFromUser(wxT("Size of the table to create"),
+ wxT("Size: "),
+ wxT("wxGridDemo question"),
s_sizeGrid,
0, 32000, this);
// ============================================================================
BigGridFrame::BigGridFrame(long sizeGrid)
- : wxFrame(NULL, wxID_ANY, _T("Plugin Virtual Table"),
+ : wxFrame(NULL, wxID_ANY, wxT("Plugin Virtual Table"),
wxDefaultPosition, wxSize(500, 450))
{
m_grid = new wxGrid(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
static const wxString severities[] =
{
- _T("wishlist"),
- _T("minor"),
- _T("normal"),
- _T("major"),
- _T("critical"),
+ wxT("wishlist"),
+ wxT("minor"),
+ wxT("normal"),
+ wxT("major"),
+ wxT("critical"),
};
static struct BugsGridData
bool opened;
} gs_dataBugsGrid [] =
{
- { 18, _T("foo doesn't work"), Sev_Major, 1, _T("wxMSW"), true },
- { 27, _T("bar crashes"), Sev_Critical, 1, _T("all"), false },
- { 45, _T("printing is slow"), Sev_Minor, 3, _T("wxMSW"), true },
- { 68, _T("Rectangle() fails"), Sev_Normal, 1, _T("wxMSW"), false },
+ { 18, wxT("foo doesn't work"), Sev_Major, 1, wxT("wxMSW"), true },
+ { 27, wxT("bar crashes"), Sev_Critical, 1, wxT("all"), false },
+ { 45, wxT("printing is slow"), Sev_Minor, 3, wxT("wxMSW"), true },
+ { 68, wxT("Rectangle() fails"), Sev_Normal, 1, wxT("wxMSW"), false },
};
static const wxChar *headers[Col_Max] =
{
- _T("Id"),
- _T("Summary"),
- _T("Severity"),
- _T("Priority"),
- _T("Platform"),
- _T("Opened?"),
+ wxT("Id"),
+ wxT("Summary"),
+ wxT("Severity"),
+ wxT("Priority"),
+ wxT("Platform"),
+ wxT("Opened?"),
};
// ----------------------------------------------------------------------------
// fall thorugh (TODO should be a list)
case Col_Summary:
- return wxString::Format(_T("%s:80"), wxGRID_VALUE_STRING);
+ return wxString::Format(wxT("%s:80"), wxGRID_VALUE_STRING);
case Col_Platform:
- return wxString::Format(_T("%s:all,MSW,GTK,other"), wxGRID_VALUE_CHOICE);
+ return wxString::Format(wxT("%s:all,MSW,GTK,other"), wxGRID_VALUE_CHOICE);
case Col_Opened:
return wxGRID_VALUE_BOOL;
}
- wxFAIL_MSG(_T("unknown column"));
+ wxFAIL_MSG(wxT("unknown column"));
return wxEmptyString;
}
switch ( col )
{
case Col_Id:
- return wxString::Format(_T("%d"), gd.id);
+ return wxString::Format(wxT("%d"), gd.id);
case Col_Priority:
- return wxString::Format(_T("%d"), gd.prio);
+ return wxString::Format(wxT("%d"), gd.prio);
case Col_Opened:
- return gd.opened ? _T("1") : _T("0");
+ return gd.opened ? wxT("1") : wxT("0");
case Col_Severity:
return severities[gd.severity];
case Col_Id:
case Col_Priority:
case Col_Opened:
- wxFAIL_MSG(_T("unexpected column"));
+ wxFAIL_MSG(wxT("unexpected column"));
break;
case Col_Severity:
if ( n == WXSIZEOF(severities) )
{
- wxLogWarning(_T("Invalid severity value '%s'."),
+ wxLogWarning(wxT("Invalid severity value '%s'."),
value.c_str());
gd.severity = Sev_Normal;
}
return gd.severity;
default:
- wxFAIL_MSG(_T("unexpected column"));
+ wxFAIL_MSG(wxT("unexpected column"));
return -1;
}
}
}
else
{
- wxFAIL_MSG(_T("unexpected column"));
+ wxFAIL_MSG(wxT("unexpected column"));
return false;
}
break;
default:
- wxFAIL_MSG(_T("unexpected column"));
+ wxFAIL_MSG(wxT("unexpected column"));
}
}
}
else
{
- wxFAIL_MSG(_T("unexpected column"));
+ wxFAIL_MSG(wxT("unexpected column"));
}
}
// ----------------------------------------------------------------------------
BugsGridFrame::BugsGridFrame()
- : wxFrame(NULL, wxID_ANY, _T("Bugs table"))
+ : wxFrame(NULL, wxID_ANY, wxT("Bugs table"))
{
wxGrid *grid = new wxGrid(this, wxID_ANY);
wxGridTableBase *table = new BugsGridTable();
#endif // wxUSE_HTML
// Create the main application window
- MyFrame *frame = new MyFrame(_T("HelpDemo wxWidgets App"),
+ MyFrame *frame = new MyFrame(wxT("HelpDemo wxWidgets App"),
wxPoint(50, 50), wxSize(450, 340));
#if !USE_SIMPLE_HELP_PROVIDER
// initialise the help system: this means that we'll use doc.hlp file under
// Windows and that the HTML docs are in the subdirectory doc for platforms
// using HTML help
- if ( !frame->GetHelpController().Initialize(_T("doc")) )
+ if ( !frame->GetHelpController().Initialize(wxT("doc")) )
{
wxLogError(wxT("Cannot initialize the help system, aborting."));
}
#if wxUSE_MS_HTML_HELP && !defined(__WXUNIVERSAL__)
- if( !frame->GetMSHtmlHelpController().Initialize(_T("doc")) )
+ if( !frame->GetMSHtmlHelpController().Initialize(wxT("doc")) )
{
wxLogError(wxT("Cannot initialize the MS HTML Help system."));
}
#if wxUSE_MS_HTML_HELP && wxUSE_WXHTML_HELP && !defined(__WXUNIVERSAL__)
// you need to call Initialize in order to use wxBestHelpController
- if( !frame->GetBestHelpController().Initialize(_T("doc")) )
+ if( !frame->GetBestHelpController().Initialize(wxT("doc")) )
{
wxLogError(wxT("Cannot initialize the best help system, aborting."));
}
#if USE_HTML_HELP
// initialise the advanced HTML help system: this means that the HTML docs are in .htb
// (zipped) form
- if ( !frame->GetAdvancedHtmlHelpController().Initialize(_T("doc")) )
+ if ( !frame->GetAdvancedHtmlHelpController().Initialize(wxT("doc")) )
{
wxLogError(wxT("Cannot initialize the advanced HTML help system, aborting."));
#if 0
// defined(__WXMSW__) && wxUSE_MS_HTML_HELP
wxString path(wxGetCwd());
- if ( !frame->GetMSHtmlHelpController().Initialize(path + _T("\\doc.chm")) )
+ if ( !frame->GetMSHtmlHelpController().Initialize(path + wxT("\\doc.chm")) )
{
wxLogError("Cannot initialize the MS HTML help system, aborting.");
// create a menu bar
wxMenu *menuFile = new wxMenu;
- menuFile->Append(HelpDemo_Help_Index, _T("&Help Index..."));
- menuFile->Append(HelpDemo_Help_Classes, _T("&Help on Classes..."));
- menuFile->Append(HelpDemo_Help_Functions, _T("&Help on Functions..."));
- menuFile->Append(HelpDemo_Help_ContextHelp, _T("&Context Help..."));
- menuFile->Append(HelpDemo_Help_DialogContextHelp, _T("&Dialog Context Help...\tCtrl-H"));
- menuFile->Append(HelpDemo_Help_Help, _T("&About Help Demo..."));
- menuFile->Append(HelpDemo_Help_Search, _T("&Search help..."));
+ menuFile->Append(HelpDemo_Help_Index, wxT("&Help Index..."));
+ menuFile->Append(HelpDemo_Help_Classes, wxT("&Help on Classes..."));
+ menuFile->Append(HelpDemo_Help_Functions, wxT("&Help on Functions..."));
+ menuFile->Append(HelpDemo_Help_ContextHelp, wxT("&Context Help..."));
+ menuFile->Append(HelpDemo_Help_DialogContextHelp, wxT("&Dialog Context Help...\tCtrl-H"));
+ menuFile->Append(HelpDemo_Help_Help, wxT("&About Help Demo..."));
+ menuFile->Append(HelpDemo_Help_Search, wxT("&Search help..."));
#if USE_HTML_HELP
menuFile->AppendSeparator();
- menuFile->Append(HelpDemo_Advanced_Html_Help_Index, _T("Advanced HTML &Help Index..."));
- menuFile->Append(HelpDemo_Advanced_Html_Help_Classes, _T("Advanced HTML &Help on Classes..."));
- menuFile->Append(HelpDemo_Advanced_Html_Help_Functions, _T("Advanced HTML &Help on Functions..."));
- menuFile->Append(HelpDemo_Advanced_Html_Help_Help, _T("Advanced HTML &About Help Demo..."));
- menuFile->Append(HelpDemo_Advanced_Html_Help_Search, _T("Advanced HTML &Search help..."));
- menuFile->Append(HelpDemo_Advanced_Html_Help_Modal, _T("Advanced HTML Help &Modal Dialog..."));
+ menuFile->Append(HelpDemo_Advanced_Html_Help_Index, wxT("Advanced HTML &Help Index..."));
+ menuFile->Append(HelpDemo_Advanced_Html_Help_Classes, wxT("Advanced HTML &Help on Classes..."));
+ menuFile->Append(HelpDemo_Advanced_Html_Help_Functions, wxT("Advanced HTML &Help on Functions..."));
+ menuFile->Append(HelpDemo_Advanced_Html_Help_Help, wxT("Advanced HTML &About Help Demo..."));
+ menuFile->Append(HelpDemo_Advanced_Html_Help_Search, wxT("Advanced HTML &Search help..."));
+ menuFile->Append(HelpDemo_Advanced_Html_Help_Modal, wxT("Advanced HTML Help &Modal Dialog..."));
#endif
#if wxUSE_MS_HTML_HELP && !defined(__WXUNIVERSAL__)
menuFile->AppendSeparator();
- menuFile->Append(HelpDemo_MS_Html_Help_Index, _T("MS HTML &Help Index..."));
- menuFile->Append(HelpDemo_MS_Html_Help_Classes, _T("MS HTML &Help on Classes..."));
- menuFile->Append(HelpDemo_MS_Html_Help_Functions, _T("MS HTML &Help on Functions..."));
- menuFile->Append(HelpDemo_MS_Html_Help_Help, _T("MS HTML &About Help Demo..."));
- menuFile->Append(HelpDemo_MS_Html_Help_Search, _T("MS HTML &Search help..."));
+ menuFile->Append(HelpDemo_MS_Html_Help_Index, wxT("MS HTML &Help Index..."));
+ menuFile->Append(HelpDemo_MS_Html_Help_Classes, wxT("MS HTML &Help on Classes..."));
+ menuFile->Append(HelpDemo_MS_Html_Help_Functions, wxT("MS HTML &Help on Functions..."));
+ menuFile->Append(HelpDemo_MS_Html_Help_Help, wxT("MS HTML &About Help Demo..."));
+ menuFile->Append(HelpDemo_MS_Html_Help_Search, wxT("MS HTML &Search help..."));
#endif
#if wxUSE_MS_HTML_HELP && wxUSE_WXHTML_HELP && !defined(__WXUNIVERSAL__)
menuFile->AppendSeparator();
- menuFile->Append(HelpDemo_Best_Help_Index, _T("Best &Help Index..."));
+ menuFile->Append(HelpDemo_Best_Help_Index, wxT("Best &Help Index..."));
#endif
#ifndef __WXMSW__
#if !wxUSE_HTML
menuFile->AppendSeparator();
- menuFile->Append(HelpDemo_Help_KDE, _T("Use &KDE"));
- menuFile->Append(HelpDemo_Help_GNOME, _T("Use &GNOME"));
- menuFile->Append(HelpDemo_Help_Netscape, _T("Use &Netscape"));
+ menuFile->Append(HelpDemo_Help_KDE, wxT("Use &KDE"));
+ menuFile->Append(HelpDemo_Help_GNOME, wxT("Use &GNOME"));
+ menuFile->Append(HelpDemo_Help_Netscape, wxT("Use &Netscape"));
#endif
#endif
menuFile->AppendSeparator();
- menuFile->Append(HelpDemo_Quit, _T("E&xit"));
+ menuFile->Append(HelpDemo_Quit, wxT("E&xit"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(menuFile, _T("&File"));
+ menuBar->Append(menuFile, wxT("&File"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar();
- SetStatusText(_T("Welcome to wxWidgets!"));
+ SetStatusText(wxT("Welcome to wxWidgets!"));
#endif // wxUSE_STATUSBAR
#if USE_HTML_HELP
m_embeddedHelpWindow->Create(this,
wxID_ANY, wxDefaultPosition, GetClientSize(), wxTAB_TRAVERSAL|wxNO_BORDER, wxHF_DEFAULT_STYLE);
- m_embeddedHtmlHelp.AddBook(wxFileName(_T("doc.zip")));
- m_embeddedHtmlHelp.Display(_T("Introduction"));
+ m_embeddedHtmlHelp.AddBook(wxFileName(wxT("doc.zip")));
+ m_embeddedHtmlHelp.Display(wxT("Introduction"));
#else
// now create some controls
//panel->SetHelpText(wxContextId(300));
// and a static control whose parent is the panel
- wxStaticText* staticText = new wxStaticText(panel, 302, _T("Hello, world!"), wxPoint(10, 10));
+ wxStaticText* staticText = new wxStaticText(panel, 302, wxT("Hello, world!"), wxPoint(10, 10));
staticText->SetHelpText(_("This static text control isn't doing a lot right now."));
#endif
}
case HelpDemo_MS_Html_Help_Search:
case HelpDemo_Best_Help_Search:
{
- wxString key = wxGetTextFromUser(_T("Search for?"),
- _T("Search help for keyword"),
+ wxString key = wxGetTextFromUser(wxT("Search for?"),
+ wxT("Search help for keyword"),
wxEmptyString,
this);
if(! key.IsEmpty())
// These three calls are only used by wxExtHelpController
case HelpDemo_Help_KDE:
- helpController.SetViewer(_T("kdehelp"));
+ helpController.SetViewer(wxT("kdehelp"));
break;
case HelpDemo_Help_GNOME:
- helpController.SetViewer(_T("gnome-help-browser"));
+ helpController.SetViewer(wxT("gnome-help-browser"));
break;
case HelpDemo_Help_Netscape:
- helpController.SetViewer(_T("netscape"), wxHELP_NETSCAPE);
+ helpController.SetViewer(wxT("netscape"), wxHELP_NETSCAPE);
break;
}
}
END_EVENT_TABLE()
MyModalDialog::MyModalDialog(wxWindow *parent)
- : wxDialog(parent, wxID_ANY, wxString(_T("Modal dialog")))
+ : wxDialog(parent, wxID_ANY, wxString(wxT("Modal dialog")))
{
// Add the context-sensitive help button on the caption for the platforms
// which support it (currently MSW only)
wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
- wxButton* btnOK = new wxButton(this, wxID_OK, _T("&OK"));
+ wxButton* btnOK = new wxButton(this, wxID_OK, wxT("&OK"));
btnOK->SetHelpText(_("The OK button confirms the dialog choices."));
- wxButton* btnCancel = new wxButton(this, wxID_CANCEL, _T("&Cancel"));
+ wxButton* btnCancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel"));
btnCancel->SetHelpText(_("The Cancel button cancels the dialog."));
sizerRow->Add(btnOK, 0, wxALIGN_CENTER | wxALL, 5);
void OnLboxSelect(wxCommandEvent& event);
void OnLboxDClick(wxCommandEvent& event)
{
- wxLogMessage(_T("Listbox item %d double clicked."), event.GetInt());
+ wxLogMessage(wxT("Listbox item %d double clicked."), event.GetInt());
}
void OnHtmlLinkClicked(wxHtmlLinkEvent& event);
// frame constructor
MyFrame::MyFrame()
- : wxFrame(NULL, wxID_ANY, _T("HtmlLbox wxWidgets Sample"),
+ : wxFrame(NULL, wxID_ANY, wxT("HtmlLbox wxWidgets Sample"),
wxDefaultPosition, wxSize(500, 500))
{
// set the frame icon
#if wxUSE_MENUS
// create a menu bar
wxMenu *menuFile = new wxMenu;
- menuFile->AppendRadioItem(HtmlLbox_CustomBox, _T("Use custom box"),
- _T("Use a wxHtmlListBox virtual class control"));
- menuFile->AppendRadioItem(HtmlLbox_SimpleBox, _T("Use simple box"),
- _T("Use a wxSimpleHtmlListBox control"));
+ menuFile->AppendRadioItem(HtmlLbox_CustomBox, wxT("Use custom box"),
+ wxT("Use a wxHtmlListBox virtual class control"));
+ menuFile->AppendRadioItem(HtmlLbox_SimpleBox, wxT("Use simple box"),
+ wxT("Use a wxSimpleHtmlListBox control"));
menuFile->AppendSeparator();
- menuFile->Append(HtmlLbox_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(HtmlLbox_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// create our specific menu
wxMenu *menuHLbox = new wxMenu;
menuHLbox->Append(HtmlLbox_SetMargins,
- _T("Set &margins...\tCtrl-G"),
- _T("Change the margins around the items"));
+ wxT("Set &margins...\tCtrl-G"),
+ wxT("Change the margins around the items"));
menuHLbox->AppendCheckItem(HtmlLbox_DrawSeparator,
- _T("&Draw separators\tCtrl-D"),
- _T("Toggle drawing separators between cells"));
+ wxT("&Draw separators\tCtrl-D"),
+ wxT("Toggle drawing separators between cells"));
menuHLbox->AppendSeparator();
menuHLbox->AppendCheckItem(HtmlLbox_ToggleMulti,
- _T("&Multiple selection\tCtrl-M"),
- _T("Toggle multiple selection on/off"));
+ wxT("&Multiple selection\tCtrl-M"),
+ wxT("Toggle multiple selection on/off"));
menuHLbox->AppendSeparator();
- menuHLbox->Append(HtmlLbox_SelectAll, _T("Select &all items\tCtrl-A"));
- menuHLbox->Append(HtmlLbox_UpdateItem, _T("Update &first item\tCtrl-U"));
- menuHLbox->Append(HtmlLbox_GetItemRect, _T("Show &rectangle of item #10\tCtrl-R"));
+ menuHLbox->Append(HtmlLbox_SelectAll, wxT("Select &all items\tCtrl-A"));
+ menuHLbox->Append(HtmlLbox_UpdateItem, wxT("Update &first item\tCtrl-U"));
+ menuHLbox->Append(HtmlLbox_GetItemRect, wxT("Show &rectangle of item #10\tCtrl-R"));
menuHLbox->AppendSeparator();
- menuHLbox->Append(HtmlLbox_SetBgCol, _T("Set &background...\tCtrl-B"));
+ menuHLbox->Append(HtmlLbox_SetBgCol, wxT("Set &background...\tCtrl-B"));
menuHLbox->Append(HtmlLbox_SetSelBgCol,
- _T("Set &selection background...\tCtrl-S"));
+ wxT("Set &selection background...\tCtrl-S"));
menuHLbox->AppendCheckItem(HtmlLbox_SetSelFgCol,
- _T("Keep &foreground in selection\tCtrl-F"));
+ wxT("Keep &foreground in selection\tCtrl-F"));
menuHLbox->AppendSeparator();
- menuHLbox->Append(HtmlLbox_Clear, _T("&Clear\tCtrl-L"));
+ menuHLbox->Append(HtmlLbox_Clear, wxT("&Clear\tCtrl-L"));
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(HtmlLbox_About, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(HtmlLbox_About, wxT("&About...\tF1"), wxT("Show about dialog"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(menuHLbox, _T("&Listbox"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(menuHLbox, wxT("&Listbox"));
+ menuBar->Append(helpMenu, wxT("&Help"));
menuBar->Check(HtmlLbox_DrawSeparator, true);
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWidgets!"));
+ SetStatusText(wxT("Welcome to wxWidgets!"));
#endif // wxUSE_STATUSBAR
// create the child controls
CreateBox();
- wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, _T(""),
+ wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxT(""),
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE);
delete wxLog::SetActiveTarget(new wxLogTextCtrl(text));
(unsigned char)(abs((int)n - 128) % 256));
int level = n % 6 + 1;
- wxString label = wxString::Format(_T("<h%d><font color=%s>")
- _T("Item</font> <b>%lu</b>")
- _T("</h%d>"),
+ wxString label = wxString::Format(wxT("<h%d><font color=%s>")
+ wxT("Item</font> <b>%lu</b>")
+ wxT("</h%d>"),
level,
clr.GetAsString(wxC2S_HTML_SYNTAX).c_str(),
(unsigned long)n, level);
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("This sample shows wxHtmlListBox class.\n")
- _T("\n")
- _T("(c) 2003 Vadim Zeitlin"),
- _T("About HtmlLbox"),
+ wxMessageBox(wxT("This sample shows wxHtmlListBox class.\n")
+ wxT("\n")
+ wxT("(c) 2003 Vadim Zeitlin"),
+ wxT("About HtmlLbox"),
wxOK | wxICON_INFORMATION,
this);
}
{
long margin = wxGetNumberFromUser
(
- _T("Enter the margins to use for the listbox items."),
- _T("Margin: "),
- _T("HtmlLbox: Set the margins"),
+ wxT("Enter the margins to use for the listbox items."),
+ wxT("Margin: "),
+ wxT("HtmlLbox: Set the margins"),
0, 0, 20,
this
);
m_hlbox->Refresh();
#if wxUSE_STATUSBAR
- SetStatusText(_T("Background colour changed."));
+ SetStatusText(wxT("Background colour changed."));
#endif // wxUSE_STATUSBAR
}
}
m_hlbox->Refresh();
#if wxUSE_STATUSBAR
- SetStatusText(_T("Selection background colour changed."));
+ SetStatusText(wxT("Selection background colour changed."));
#endif // wxUSE_STATUSBAR
}
}
void MyFrame::OnLboxSelect(wxCommandEvent& event)
{
- wxLogMessage(_T("Listbox selection is now %d."), event.GetInt());
+ wxLogMessage(wxT("Listbox selection is now %d."), event.GetInt());
if ( m_hlbox->HasMultipleSelection() )
{
if ( first )
first = false;
else
- s << _T(", ");
+ s << wxT(", ");
s << item;
}
if ( !s.empty() )
{
- wxLogMessage(_T("Selected items: %s"), s.c_str());
+ wxLogMessage(wxT("Selected items: %s"), s.c_str());
}
}
#if wxUSE_STATUSBAR
SetStatusText(wxString::Format(
- _T("# items selected = %lu"),
+ wxT("# items selected = %lu"),
(unsigned long)m_hlbox->GetSelectedCount()
));
#endif // wxUSE_STATUSBAR
SetMargins(5, 5);
#ifdef USE_HTML_FILE
- if ( !m_file.Open(_T("results")) )
+ if ( !m_file.Open(wxT("results")) )
{
- wxLogError(_T("Failed to open results file"));
+ wxLogError(wxT("Failed to open results file"));
}
else
{
{
if ( !n && m_firstItemUpdated )
{
- return _T("<h1><b>Just updated</b></h1>");
+ return wxT("<h1><b>Just updated</b></h1>");
}
#ifdef USE_HTML_FILE
(unsigned char)(abs((int)n - 256) % 256),
(unsigned char)(abs((int)n - 128) % 256));
- wxString label = wxString::Format(_T("<h%d><font color=%s>")
- _T("Item</font> <b>%lu</b>")
- _T("</h%d>"),
+ wxString label = wxString::Format(wxT("<h%d><font color=%s>")
+ wxT("Item</font> <b>%lu</b>")
+ wxT("</h%d>"),
level,
clr.GetAsString(wxC2S_HTML_SYNTAX).c_str(),
(unsigned long)n, level);
if ( n == 1 )
{
if ( !m_linkClicked )
- label += _T("<a href='1'>Click here...</a>");
+ label += wxT("<a href='1'>Click here...</a>");
else
- label += _T("<font color='#9999ff'>Clicked here...</font>");
+ label += wxT("<font color='#9999ff'>Clicked here...</font>");
}
return label;
return false;
// create the main application window
- MyFrame *frame = new MyFrame(_T("wxWebKit Sample"));
+ MyFrame *frame = new MyFrame(wxT("wxWebKit Sample"));
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
wxButton* btnReload = new wxButton(myToolbar, ID_RELOAD, _("Reload"));
myToolbar->AddControl(btnReload);
myToolbar->AddSeparator();
- urlText = new wxTextCtrl(myToolbar, ID_URLLIST, _T("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(220, -1), wxTE_PROCESS_ENTER);
+ urlText = new wxTextCtrl(myToolbar, ID_URLLIST, wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(220, -1), wxTE_PROCESS_ENTER);
myToolbar->AddControl(urlText);
myToolbar->AddSeparator();
myToolbar->Realize();
wxBoxSizer* boxSizer = new wxBoxSizer(wxVERTICAL);
panel->SetSizer(boxSizer);
- mySafari = new wxWebKitCtrl(panel, ID_WEBKIT, _T("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(200, 200));
+ mySafari = new wxWebKitCtrl(panel, ID_WEBKIT, wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(200, 200));
boxSizer->Add(mySafari, 1, wxEXPAND);
SetSizer(frameSizer);
frameSizer->Add(panel, 1, wxEXPAND);
#else
- mySafari = new wxWebKitCtrl(this, ID_WEBKIT, _T("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(200, 200));
+ mySafari = new wxWebKitCtrl(this, ID_WEBKIT, wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(200, 200));
#endif
#if wxUSE_STATUSBAR
m_Html->LoadFile(wxFileName(wxT("test.htm")));
m_Html->AddProcessor(m_Processor);
- wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, _T(""),
+ wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxT(""),
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE);
const wxString& url,
wxString *WXUNUSED(redirect)) const
{
- GetRelatedFrame()->SetStatusText(url + _T(" lately opened"),1);
+ GetRelatedFrame()->SetStatusText(url + wxT(" lately opened"),1);
return wxHTML_OPEN;
}
const wxString text = data.GetText();
const size_t maxTextLength = 100;
- wxLogStatus(wxString::Format(_T("Clipboard: '%s%s'"),
+ wxLogStatus(wxString::Format(wxT("Clipboard: '%s%s'"),
wxString(text, maxTextLength).c_str(),
- (text.length() > maxTextLength) ? _T("...")
- : _T("")));
+ (text.length() > maxTextLength) ? wxT("...")
+ : wxT("")));
wxTheClipboard->Close();
return;
}
}
- wxLogStatus(_T("Clipboard: nothing"));
+ wxLogStatus(wxT("Clipboard: nothing"));
}
#endif // wxUSE_CLIPBOARD
wxImage image = bitmap.ConvertToImage();
#if wxUSE_LIBPNG
- if ( !image.SaveFile( dir + _T("test.png"), wxBITMAP_TYPE_PNG ))
+ if ( !image.SaveFile( dir + wxT("test.png"), wxBITMAP_TYPE_PNG ))
{
wxLogError(wxT("Can't save file"));
}
image.Destroy();
- if ( image.LoadFile( dir + _T("test.png") ) )
+ if ( image.LoadFile( dir + wxT("test.png") ) )
my_square = wxBitmap( image );
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.png")) )
+ if ( !image.LoadFile( dir + wxT("horse.png")) )
{
wxLogError(wxT("Can't load PNG image"));
}
my_horse_png = wxBitmap( image );
}
- if ( !image.LoadFile( dir + _T("toucan.png")) )
+ if ( !image.LoadFile( dir + wxT("toucan.png")) )
{
wxLogError(wxT("Can't load PNG image"));
}
#if wxUSE_LIBJPEG
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.jpg")) )
+ if ( !image.LoadFile( dir + wxT("horse.jpg")) )
{
wxLogError(wxT("Can't load JPG image"));
}
colorized_horse_jpeg = wxBitmap( image );
}
- if ( !image.LoadFile( dir + _T("cmyk.jpg")) )
+ if ( !image.LoadFile( dir + wxT("cmyk.jpg")) )
{
- wxLogError(_T("Can't load CMYK JPG image"));
+ wxLogError(wxT("Can't load CMYK JPG image"));
}
else
{
#if wxUSE_GIF
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.gif" )) )
+ if ( !image.LoadFile( dir + wxT("horse.gif" )) )
{
wxLogError(wxT("Can't load GIF image"));
}
#if wxUSE_PCX
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.pcx"), wxBITMAP_TYPE_PCX ) )
+ if ( !image.LoadFile( dir + wxT("horse.pcx"), wxBITMAP_TYPE_PCX ) )
{
wxLogError(wxT("Can't load PCX image"));
}
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.bmp"), wxBITMAP_TYPE_BMP ) )
+ if ( !image.LoadFile( dir + wxT("horse.bmp"), wxBITMAP_TYPE_BMP ) )
{
wxLogError(wxT("Can't load BMP image"));
}
#if wxUSE_XPM
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.xpm"), wxBITMAP_TYPE_XPM ) )
+ if ( !image.LoadFile( dir + wxT("horse.xpm"), wxBITMAP_TYPE_XPM ) )
{
wxLogError(wxT("Can't load XPM image"));
}
my_horse_xpm = wxBitmap( image );
}
- if ( !image.SaveFile( dir + _T("test.xpm"), wxBITMAP_TYPE_XPM ))
+ if ( !image.SaveFile( dir + wxT("test.xpm"), wxBITMAP_TYPE_XPM ))
{
wxLogError(wxT("Can't save file"));
}
#if wxUSE_PNM
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.pnm"), wxBITMAP_TYPE_PNM ) )
+ if ( !image.LoadFile( dir + wxT("horse.pnm"), wxBITMAP_TYPE_PNM ) )
{
wxLogError(wxT("Can't load PNM image"));
}
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse_ag.pnm"), wxBITMAP_TYPE_PNM ) )
+ if ( !image.LoadFile( dir + wxT("horse_ag.pnm"), wxBITMAP_TYPE_PNM ) )
{
wxLogError(wxT("Can't load PNM image"));
}
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse_rg.pnm"), wxBITMAP_TYPE_PNM ) )
+ if ( !image.LoadFile( dir + wxT("horse_rg.pnm"), wxBITMAP_TYPE_PNM ) )
{
wxLogError(wxT("Can't load PNM image"));
}
#if wxUSE_LIBTIFF
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.tif"), wxBITMAP_TYPE_TIF ) )
+ if ( !image.LoadFile( dir + wxT("horse.tif"), wxBITMAP_TYPE_TIF ) )
{
wxLogError(wxT("Can't load TIFF image"));
}
#if wxUSE_LIBTIFF
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.tga"), wxBITMAP_TYPE_TGA ) )
+ if ( !image.LoadFile( dir + wxT("horse.tga"), wxBITMAP_TYPE_TGA ) )
{
wxLogError(wxT("Can't load TGA image"));
}
// demonstrates XPM automatically using the mask when saving
if ( m_bmpSmileXpm.Ok() )
- m_bmpSmileXpm.SaveFile(_T("saved.xpm"), wxBITMAP_TYPE_XPM);
+ m_bmpSmileXpm.SaveFile(wxT("saved.xpm"), wxBITMAP_TYPE_XPM);
#if wxUSE_ICO_CUR
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.ico"), wxBITMAP_TYPE_ICO, 0 ) )
+ if ( !image.LoadFile( dir + wxT("horse.ico"), wxBITMAP_TYPE_ICO, 0 ) )
{
wxLogError(wxT("Can't load first ICO image"));
}
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.ico"), wxBITMAP_TYPE_ICO, 1 ) )
+ if ( !image.LoadFile( dir + wxT("horse.ico"), wxBITMAP_TYPE_ICO, 1 ) )
{
wxLogError(wxT("Can't load second ICO image"));
}
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.ico") ) )
+ if ( !image.LoadFile( dir + wxT("horse.ico") ) )
{
wxLogError(wxT("Can't load best ICO image"));
}
image.Destroy();
- if ( !image.LoadFile( dir + _T("horse.cur"), wxBITMAP_TYPE_CUR ) )
+ if ( !image.LoadFile( dir + wxT("horse.cur"), wxBITMAP_TYPE_CUR ) )
{
wxLogError(wxT("Can't load best ICO image"));
}
yH = 2420 + image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ;
}
- m_ani_images = wxImage::GetImageCount ( dir + _T("horse3.ani"), wxBITMAP_TYPE_ANI );
+ m_ani_images = wxImage::GetImageCount ( dir + wxT("horse3.ani"), wxBITMAP_TYPE_ANI );
if (m_ani_images==0)
{
wxLogError(wxT("No ANI-format images found"));
for (i=0; i < m_ani_images; i++)
{
image.Destroy();
- if (!image.LoadFile( dir + _T("horse3.ani"), wxBITMAP_TYPE_ANI, i ))
+ if (!image.LoadFile( dir + wxT("horse3.ani"), wxBITMAP_TYPE_ANI, i ))
{
wxString tmp = wxT("Can't load image number ");
tmp << i ;
image.Destroy();
// test image loading from stream
- wxFile file(dir + _T("horse.bmp"));
+ wxFile file(dir + wxT("horse.bmp"));
if ( file.IsOpened() )
{
wxFileOffset len = file.Length();
void *data = malloc(dataSize);
if ( file.Read(data, dataSize) != len )
{
- wxLogError(_T("Reading bitmap file failed"));
+ wxLogError(wxT("Reading bitmap file failed"));
}
else
{
wxPaintDC dc( this );
PrepareDC( dc );
- dc.DrawText( _T("Loaded image"), 30, 10 );
+ dc.DrawText( wxT("Loaded image"), 30, 10 );
if (my_square.Ok())
dc.DrawBitmap( my_square, 30, 30 );
- dc.DrawText( _T("Drawn directly"), 150, 10 );
+ dc.DrawText( wxT("Drawn directly"), 150, 10 );
dc.SetBrush( wxBrush( wxT("orange"), wxSOLID ) );
dc.SetPen( *wxBLACK_PEN );
dc.DrawRectangle( 150, 30, 100, 100 );
if (my_anti.Ok())
dc.DrawBitmap( my_anti, 280, 30 );
- dc.DrawText( _T("PNG handler"), 30, 135 );
+ dc.DrawText( wxT("PNG handler"), 30, 135 );
if (my_horse_png.Ok())
{
dc.DrawBitmap( my_horse_png, 30, 150 );
wxRect rect(0,0,100,100);
wxBitmap sub( my_horse_png.GetSubBitmap(rect) );
- dc.DrawText( _T("GetSubBitmap()"), 280, 175 );
+ dc.DrawText( wxT("GetSubBitmap()"), 280, 175 );
dc.DrawBitmap( sub, 280, 195 );
}
- dc.DrawText( _T("JPEG handler"), 30, 365 );
+ dc.DrawText( wxT("JPEG handler"), 30, 365 );
if (my_horse_jpeg.Ok())
dc.DrawBitmap( my_horse_jpeg, 30, 380 );
- dc.DrawText( _T("Green rotated to red"), 280, 365 );
+ dc.DrawText( wxT("Green rotated to red"), 280, 365 );
if (colorized_horse_jpeg.Ok())
dc.DrawBitmap( colorized_horse_jpeg, 280, 380 );
- dc.DrawText( _T("CMYK JPEG image"), 530, 365 );
+ dc.DrawText( wxT("CMYK JPEG image"), 530, 365 );
if (my_cmyk_jpeg.Ok())
dc.DrawBitmap( my_cmyk_jpeg, 530, 380 );
- dc.DrawText( _T("GIF handler"), 30, 595 );
+ dc.DrawText( wxT("GIF handler"), 30, 595 );
if (my_horse_gif.Ok())
dc.DrawBitmap( my_horse_gif, 30, 610 );
- dc.DrawText( _T("PCX handler"), 30, 825 );
+ dc.DrawText( wxT("PCX handler"), 30, 825 );
if (my_horse_pcx.Ok())
dc.DrawBitmap( my_horse_pcx, 30, 840 );
- dc.DrawText( _T("BMP handler"), 30, 1055 );
+ dc.DrawText( wxT("BMP handler"), 30, 1055 );
if (my_horse_bmp.Ok())
dc.DrawBitmap( my_horse_bmp, 30, 1070 );
- dc.DrawText( _T("BMP read from memory"), 280, 1055 );
+ dc.DrawText( wxT("BMP read from memory"), 280, 1055 );
if (my_horse_bmp2.Ok())
dc.DrawBitmap( my_horse_bmp2, 280, 1070 );
- dc.DrawText( _T("PNM handler"), 30, 1285 );
+ dc.DrawText( wxT("PNM handler"), 30, 1285 );
if (my_horse_pnm.Ok())
dc.DrawBitmap( my_horse_pnm, 30, 1300 );
- dc.DrawText( _T("PNM handler (ascii grey)"), 280, 1285 );
+ dc.DrawText( wxT("PNM handler (ascii grey)"), 280, 1285 );
if (my_horse_asciigrey_pnm.Ok())
dc.DrawBitmap( my_horse_asciigrey_pnm, 280, 1300 );
- dc.DrawText( _T("PNM handler (raw grey)"), 530, 1285 );
+ dc.DrawText( wxT("PNM handler (raw grey)"), 530, 1285 );
if (my_horse_rawgrey_pnm.Ok())
dc.DrawBitmap( my_horse_rawgrey_pnm, 530, 1300 );
- dc.DrawText( _T("TIFF handler"), 30, 1515 );
+ dc.DrawText( wxT("TIFF handler"), 30, 1515 );
if (my_horse_tiff.Ok())
dc.DrawBitmap( my_horse_tiff, 30, 1530 );
- dc.DrawText( _T("TGA handler"), 30, 1745 );
+ dc.DrawText( wxT("TGA handler"), 30, 1745 );
if (my_horse_tga.Ok())
dc.DrawBitmap( my_horse_tga, 30, 1760 );
- dc.DrawText( _T("XPM handler"), 30, 1975 );
+ dc.DrawText( wxT("XPM handler"), 30, 1975 );
if (my_horse_xpm.Ok())
dc.DrawBitmap( my_horse_xpm, 30, 2000 );
{
int x = 300, y = 1800;
- dc.DrawText( _T("XBM bitmap"), x, y );
- dc.DrawText( _T("(green on red)"), x, y + 15 );
- dc.SetTextForeground( _T("GREEN") );
- dc.SetTextBackground( _T("RED") );
+ dc.DrawText( wxT("XBM bitmap"), x, y );
+ dc.DrawText( wxT("(green on red)"), x, y + 15 );
+ dc.SetTextForeground( wxT("GREEN") );
+ dc.SetTextBackground( wxT("RED") );
dc.DrawBitmap( my_smile_xbm, x, y + 30 );
dc.SetTextForeground( *wxBLACK );
- dc.DrawText( _T("After wxImage conversion"), x + 120, y );
- dc.DrawText( _T("(red on white)"), x + 120, y + 15 );
+ dc.DrawText( wxT("After wxImage conversion"), x + 120, y );
+ dc.DrawText( wxT("(red on white)"), x + 120, y + 15 );
dc.SetTextForeground( wxT("RED") );
wxImage i = my_smile_xbm.ConvertToImage();
i.SetMaskColour( 255, 255, 255 );
memdc.SetTextForeground( *wxBLACK );
#ifndef __WXGTK20__
// I cannot convince GTK2 to draw into mono bitmaps
- memdc.DrawText( _T("Hi!"), 5, 5 );
+ memdc.DrawText( wxT("Hi!"), 5, 5 );
#endif
memdc.SetBrush( *wxBLACK_BRUSH );
memdc.DrawRectangle( 33,5,20,20 );
{
int x = 300, y = 1900;
- dc.DrawText( _T("Mono bitmap"), x, y );
- dc.DrawText( _T("(red on green)"), x, y + 15 );
+ dc.DrawText( wxT("Mono bitmap"), x, y );
+ dc.DrawText( wxT("(red on green)"), x, y + 15 );
dc.SetTextForeground( wxT("RED") );
dc.SetTextBackground( wxT("GREEN") );
dc.DrawBitmap( mono, x, y + 30 );
dc.SetTextForeground( *wxBLACK );
- dc.DrawText( _T("After wxImage conversion"), x + 120, y );
- dc.DrawText( _T("(red on white)"), x + 120, y + 15 );
+ dc.DrawText( wxT("After wxImage conversion"), x + 120, y );
+ dc.DrawText( wxT("(red on white)"), x + 120, y + 15 );
dc.SetTextForeground( wxT("RED") );
wxImage i = mono.ConvertToImage();
i.SetMaskColour( 255,255,255 );
dc.SetBrush( *wxRED_BRUSH );
dc.DrawRectangle( 20, 2220, 560, 68 );
- dc.DrawText(_T("XPM bitmap"), 30, 2230 );
+ dc.DrawText(wxT("XPM bitmap"), 30, 2230 );
if ( m_bmpSmileXpm.Ok() )
dc.DrawBitmap(m_bmpSmileXpm, 30, 2250, true);
- dc.DrawText(_T("XPM icon"), 110, 2230 );
+ dc.DrawText(wxT("XPM icon"), 110, 2230 );
if ( m_iconSmileXpm.Ok() )
dc.DrawIcon(m_iconSmileXpm, 110, 2250);
wxBitmap to_blit( m_iconSmileXpm );
if (to_blit.Ok())
{
- dc.DrawText( _T("SubBitmap"), 170, 2230 );
+ dc.DrawText( wxT("SubBitmap"), 170, 2230 );
wxBitmap sub = to_blit.GetSubBitmap( wxRect(0,0,15,15) );
if (sub.Ok())
dc.DrawBitmap( sub, 170, 2250, true );
- dc.DrawText( _T("Enlarged"), 250, 2230 );
+ dc.DrawText( wxT("Enlarged"), 250, 2230 );
dc.SetUserScale( 1.5, 1.5 );
dc.DrawBitmap( to_blit, (int)(250/1.5), (int)(2250/1.5), true );
dc.SetUserScale( 2, 2 );
dc.DrawBitmap( to_blit, (int)(300/2), (int)(2250/2), true );
dc.SetUserScale( 1.0, 1.0 );
- dc.DrawText( _T("Blit"), 400, 2230);
+ dc.DrawText( wxT("Blit"), 400, 2230);
wxMemoryDC blit_dc;
blit_dc.SelectObject( to_blit );
dc.Blit( 400, 2250, to_blit.GetWidth(), to_blit.GetHeight(), &blit_dc, 0, 0, wxCOPY, true );
dc.SetUserScale( 1.0, 1.0 );
}
- dc.DrawText( _T("ICO handler (1st image)"), 30, 2290 );
+ dc.DrawText( wxT("ICO handler (1st image)"), 30, 2290 );
if (my_horse_ico32.Ok())
dc.DrawBitmap( my_horse_ico32, 30, 2330, true );
- dc.DrawText( _T("ICO handler (2nd image)"), 230, 2290 );
+ dc.DrawText( wxT("ICO handler (2nd image)"), 230, 2290 );
if (my_horse_ico16.Ok())
dc.DrawBitmap( my_horse_ico16, 230, 2330, true );
- dc.DrawText( _T("ICO handler (best image)"), 430, 2290 );
+ dc.DrawText( wxT("ICO handler (best image)"), 430, 2290 );
if (my_horse_ico.Ok())
dc.DrawBitmap( my_horse_ico, 430, 2330, true );
- dc.DrawText( _T("CUR handler"), 30, 2390 );
+ dc.DrawText( wxT("CUR handler"), 30, 2390 );
if (my_horse_cur.Ok())
{
dc.DrawBitmap( my_horse_cur, 30, 2420, true );
dc.DrawLine (xH,yH-10,xH,yH+10);
}
- dc.DrawText( _T("ANI handler"), 230, 2390 );
+ dc.DrawText( wxT("ANI handler"), 230, 2390 );
for ( int i=0; i < m_ani_images; i++ )
{
if (my_horse_ani[i].Ok())
dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL) );
dc.SetTextForeground( wxT("RED") );
- dc.DrawText( _T("This is anti-aliased Text."), 20, 5 );
- dc.DrawText( _T("And a Rectangle."), 20, 45 );
+ dc.DrawText( wxT("This is anti-aliased Text."), 20, 5 );
+ dc.DrawText( wxT("And a Rectangle."), 20, 45 );
dc.SetBrush( *wxRED_BRUSH );
dc.SetPen( *wxTRANSPARENT_PEN );
int numImages = 1)
{
if ( !wxFrame::Create(parent, wxID_ANY,
- wxString::Format(_T("Image from %s"), desc),
+ wxString::Format(wxT("Image from %s"), desc),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_FRAME_STYLE | wxFULL_REPAINT_ON_RESIZE) )
return false;
wxMenu *menu = new wxMenu;
menu->Append(wxID_SAVE);
menu->AppendSeparator();
- menu->AppendCheckItem(ID_PAINT_BG, _T("&Paint background"),
+ menu->AppendCheckItem(ID_PAINT_BG, wxT("&Paint background"),
"Uncheck this for transparent images");
menu->AppendSeparator();
- menu->Append(ID_RESIZE, _T("&Fit to window\tCtrl-F"));
+ menu->Append(ID_RESIZE, wxT("&Fit to window\tCtrl-F"));
menu->Append(wxID_ZOOM_IN, "Zoom &in\tCtrl-+");
menu->Append(wxID_ZOOM_OUT, "Zoom &out\tCtrl--");
menu->Append(wxID_ZOOM_100, "Reset zoom to &100%\tCtrl-1");
menu->AppendSeparator();
- menu->Append(ID_ROTATE_LEFT, _T("Rotate &left\tCtrl-L"));
- menu->Append(ID_ROTATE_RIGHT, _T("Rotate &right\tCtrl-R"));
+ menu->Append(ID_ROTATE_LEFT, wxT("Rotate &left\tCtrl-L"));
+ menu->Append(ID_ROTATE_RIGHT, wxT("Rotate &right\tCtrl-R"));
wxMenuBar *mbar = new wxMenuBar;
- mbar->Append(menu, _T("&Image"));
+ mbar->Append(menu, wxT("&Image"));
SetMenuBar(mbar);
mbar->Check(ID_PAINT_BG, true);
wxFileName::SplitPath(savefilename, NULL, NULL, &extension);
bool saved = false;
- if ( extension == _T("bmp") )
+ if ( extension == wxT("bmp") )
{
static const int bppvalues[] =
{
const wxString bppchoices[] =
{
- _T("1 bpp color"),
- _T("1 bpp B&W"),
- _T("4 bpp color"),
- _T("8 bpp color"),
- _T("8 bpp greyscale"),
- _T("8 bpp red"),
- _T("8 bpp own palette"),
- _T("24 bpp")
+ wxT("1 bpp color"),
+ wxT("1 bpp B&W"),
+ wxT("4 bpp color"),
+ wxT("8 bpp color"),
+ wxT("8 bpp greyscale"),
+ wxT("8 bpp red"),
+ wxT("8 bpp own palette"),
+ wxT("24 bpp")
};
- int bppselection = wxGetSingleChoiceIndex(_T("Set BMP BPP"),
- _T("Image sample: save file"),
+ int bppselection = wxGetSingleChoiceIndex(wxT("Set BMP BPP"),
+ wxT("Image sample: save file"),
WXSIZEOF(bppchoices),
bppchoices,
this);
}
}
}
- else if ( extension == _T("png") )
+ else if ( extension == wxT("png") )
{
static const int pngvalues[] =
{
const wxString pngchoices[] =
{
- _T("Colour 8bpp"),
- _T("Colour 16bpp"),
- _T("Grey 8bpp"),
- _T("Grey 16bpp"),
- _T("Grey red 8bpp"),
- _T("Grey red 16bpp"),
+ wxT("Colour 8bpp"),
+ wxT("Colour 16bpp"),
+ wxT("Grey 8bpp"),
+ wxT("Grey 16bpp"),
+ wxT("Grey red 8bpp"),
+ wxT("Grey red 16bpp"),
};
- int sel = wxGetSingleChoiceIndex(_T("Set PNG format"),
- _T("Image sample: save file"),
+ int sel = wxGetSingleChoiceIndex(wxT("Set PNG format"),
+ wxT("Image sample: save file"),
WXSIZEOF(pngchoices),
pngchoices,
this);
// these values are taken from OptiPNG with -o3 switch
const wxString compressionChoices[] =
{
- _T("compression = 9, memory = 8, strategy = 0, filter = 0"),
- _T("compression = 9, memory = 9, strategy = 0, filter = 0"),
- _T("compression = 9, memory = 8, strategy = 1, filter = 0"),
- _T("compression = 9, memory = 9, strategy = 1, filter = 0"),
- _T("compression = 1, memory = 8, strategy = 2, filter = 0"),
- _T("compression = 1, memory = 9, strategy = 2, filter = 0"),
- _T("compression = 9, memory = 8, strategy = 0, filter = 5"),
- _T("compression = 9, memory = 9, strategy = 0, filter = 5"),
- _T("compression = 9, memory = 8, strategy = 1, filter = 5"),
- _T("compression = 9, memory = 9, strategy = 1, filter = 5"),
- _T("compression = 1, memory = 8, strategy = 2, filter = 5"),
- _T("compression = 1, memory = 9, strategy = 2, filter = 5"),
+ wxT("compression = 9, memory = 8, strategy = 0, filter = 0"),
+ wxT("compression = 9, memory = 9, strategy = 0, filter = 0"),
+ wxT("compression = 9, memory = 8, strategy = 1, filter = 0"),
+ wxT("compression = 9, memory = 9, strategy = 1, filter = 0"),
+ wxT("compression = 1, memory = 8, strategy = 2, filter = 0"),
+ wxT("compression = 1, memory = 9, strategy = 2, filter = 0"),
+ wxT("compression = 9, memory = 8, strategy = 0, filter = 5"),
+ wxT("compression = 9, memory = 9, strategy = 0, filter = 5"),
+ wxT("compression = 9, memory = 8, strategy = 1, filter = 5"),
+ wxT("compression = 9, memory = 9, strategy = 1, filter = 5"),
+ wxT("compression = 1, memory = 8, strategy = 2, filter = 5"),
+ wxT("compression = 1, memory = 9, strategy = 2, filter = 5"),
};
- int sel = wxGetSingleChoiceIndex(_T("Select compression option (Cancel to use default)\n"),
- _T("PNG Compression Options"),
+ int sel = wxGetSingleChoiceIndex(wxT("Select compression option (Cancel to use default)\n"),
+ wxT("PNG Compression Options"),
WXSIZEOF(compressionChoices),
compressionChoices,
this);
}
}
}
- else if ( extension == _T("cur") )
+ else if ( extension == wxT("cur") )
{
image.Rescale(32,32);
image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, 0);
img = img.Rotate(angle, wxPoint(img.GetWidth() / 2, img.GetHeight() / 2));
if ( !img.Ok() )
{
- wxLogWarning(_T("Rotation failed"));
+ wxLogWarning(wxT("Rotation failed"));
return;
}
void UpdateStatusBar()
{
- wxLogStatus(this, _T("Image size: (%d, %d), zoom %.2f"),
+ wxLogStatus(this, wxT("Image size: (%d, %d), zoom %.2f"),
m_bitmap.GetWidth(),
m_bitmap.GetHeight(),
m_zoom);
};
MyRawBitmapFrame(wxFrame *parent)
- : wxFrame(parent, wxID_ANY, _T("Raw bitmaps (how exciting)")),
+ : wxFrame(parent, wxID_ANY, wxT("Raw bitmaps (how exciting)")),
m_bitmap(SIZE, SIZE, 24),
m_alphaBitmap(SIZE, SIZE, 32)
{
wxAlphaPixelData data( m_alphaBitmap, wxPoint(0,0), wxSize(SIZE, SIZE) );
if ( !data )
{
- wxLogError(_T("Failed to gain raw access to bitmap data"));
+ wxLogError(wxT("Failed to gain raw access to bitmap data"));
return;
}
wxAlphaPixelData::Iterator p(data);
wxSize(REAL_SIZE, REAL_SIZE));
if ( !data )
{
- wxLogError(_T("Failed to gain raw access to bitmap data"));
+ wxLogError(wxT("Failed to gain raw access to bitmap data"));
return;
}
wxNativePixelData data(m_bitmap);
if ( !data )
{
- wxLogError(_T("Failed to gain raw access to bitmap data"));
+ wxLogError(wxT("Failed to gain raw access to bitmap data"));
return;
}
void OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc( this );
- dc.DrawText(_T("This is alpha and raw bitmap test"), 0, BORDER);
- dc.DrawText(_T("This is alpha and raw bitmap test"), 0, SIZE/2 - BORDER);
- dc.DrawText(_T("This is alpha and raw bitmap test"), 0, SIZE - 2*BORDER);
+ dc.DrawText(wxT("This is alpha and raw bitmap test"), 0, BORDER);
+ dc.DrawText(wxT("This is alpha and raw bitmap test"), 0, SIZE/2 - BORDER);
+ dc.DrawText(wxT("This is alpha and raw bitmap test"), 0, SIZE - 2*BORDER);
dc.DrawBitmap( m_alphaBitmap, 0, 0, true /* use mask */ );
- dc.DrawText(_T("Raw bitmap access without alpha"), 0, SIZE+5);
+ dc.DrawText(wxT("Raw bitmap access without alpha"), 0, SIZE+5);
dc.DrawBitmap( m_bitmap, 0, SIZE+5+dc.GetCharHeight());
}
END_EVENT_TABLE()
MyFrame::MyFrame()
- : wxFrame( (wxFrame *)NULL, wxID_ANY, _T("wxImage sample"),
+ : wxFrame( (wxFrame *)NULL, wxID_ANY, wxT("wxImage sample"),
wxPoint(20, 20), wxSize(950, 700) )
{
SetIcon(wxICON(sample));
wxMenuBar *menu_bar = new wxMenuBar();
wxMenu *menuImage = new wxMenu;
- menuImage->Append( ID_NEW, _T("&Show any image...\tCtrl-O"));
- menuImage->Append( ID_INFO, _T("Show image &information...\tCtrl-I"));
+ menuImage->Append( ID_NEW, wxT("&Show any image...\tCtrl-O"));
+ menuImage->Append( ID_INFO, wxT("Show image &information...\tCtrl-I"));
#ifdef wxHAVE_RAW_BITMAP
menuImage->AppendSeparator();
- menuImage->Append( ID_SHOWRAW, _T("Test &raw bitmap...\tCtrl-R"));
+ menuImage->Append( ID_SHOWRAW, wxT("Test &raw bitmap...\tCtrl-R"));
#endif
menuImage->AppendSeparator();
- menuImage->Append( ID_SHOWTHUMBNAIL, _T("Test &thumbnail...\tCtrl-T"),
+ menuImage->Append( ID_SHOWTHUMBNAIL, wxT("Test &thumbnail...\tCtrl-T"),
"Test scaling the image during load (try with JPEG)");
menuImage->AppendSeparator();
- menuImage->Append( ID_ABOUT, _T("&About..."));
+ menuImage->Append( ID_ABOUT, wxT("&About..."));
menuImage->AppendSeparator();
- menuImage->Append( ID_QUIT, _T("E&xit\tCtrl-Q"));
- menu_bar->Append(menuImage, _T("&Image"));
+ menuImage->Append( ID_QUIT, wxT("E&xit\tCtrl-Q"));
+ menu_bar->Append(menuImage, wxT("&Image"));
#if wxUSE_CLIPBOARD
wxMenu *menuClipboard = new wxMenu;
- menuClipboard->Append(wxID_COPY, _T("&Copy test image\tCtrl-C"));
- menuClipboard->Append(wxID_PASTE, _T("&Paste image\tCtrl-V"));
- menu_bar->Append(menuClipboard, _T("&Clipboard"));
+ menuClipboard->Append(wxID_COPY, wxT("&Copy test image\tCtrl-C"));
+ menuClipboard->Append(wxID_PASTE, wxT("&Paste image\tCtrl-V"));
+ menu_bar->Append(menuClipboard, wxT("&Clipboard"));
#endif // wxUSE_CLIPBOARD
SetMenuBar( menu_bar );
wxString filename;
#if wxUSE_FILEDLG
- filename = wxLoadFileSelector(_T("image"), wxEmptyString);
+ filename = wxLoadFileSelector(wxT("image"), wxEmptyString);
if ( !filename.empty() )
{
if ( !image.LoadFile(filename) )
{
- wxLogError(_T("Couldn't load image from '%s'."), filename.c_str());
+ wxLogError(wxT("Couldn't load image from '%s'."), filename.c_str());
return wxEmptyString;
}
if ( !wxTheClipboard->SetData(dobjBmp) )
{
- wxLogError(_T("Failed to copy bitmap to clipboard"));
+ wxLogError(wxT("Failed to copy bitmap to clipboard"));
}
wxTheClipboard->Close();
wxTheClipboard->Open();
if ( !wxTheClipboard->GetData(dobjBmp) )
{
- wxLogMessage(_T("No bitmap data in the clipboard"));
+ wxLogMessage(wxT("No bitmap data in the clipboard"));
}
else
{
- new MyImageFrame(this, _T("Clipboard"), dobjBmp.GetBitmap());
+ new MyImageFrame(this, wxT("Clipboard"), dobjBmp.GetBitmap());
}
wxTheClipboard->Close();
}
void MyFrame::OnThumbnail( wxCommandEvent &WXUNUSED(event) )
{
#if wxUSE_FILEDLG
- wxString filename = wxLoadFileSelector(_T("image"), wxEmptyString, wxEmptyString, this);
+ wxString filename = wxLoadFileSelector(wxT("image"), wxEmptyString, wxEmptyString, this);
if ( filename.empty() )
return;
wxStopWatch sw;
if ( !image.LoadFile(filename) )
{
- wxLogError(_T("Couldn't load image from '%s'."), filename.c_str());
+ wxLogError(wxT("Couldn't load image from '%s'."), filename.c_str());
return;
}
MyImageFrame * const frame = new MyImageFrame(this, filename, image);
wxLogStatus(frame, "Loaded \"%s\" in %ldms", filename, loadTime);
#else
- wxLogError( _T("Couldn't create file selector dialog") );
+ wxLogError( wxT("Couldn't create file selector dialog") );
return;
#endif // wxUSE_FILEDLG
}
}
else if ( num == 9 )
{
- // this message is not translated (not in catalog) because we used _T()
+ // this message is not translated (not in catalog) because we used wxT()
// and not _() around it
- str = _T("You've found a bug in this program!");
+ str = wxT("You've found a bug in this program!");
}
else if ( num == 17 )
{
return false;
// Create the main frame window
- m_frame = new MyFrame(NULL, _T("Client"));
+ m_frame = new MyFrame(NULL, wxT("Client"));
m_frame->Show(true);
return true;
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(wxID_EXIT, _T("&Quit\tCtrl-Q"));
+ file_menu->Append(wxID_EXIT, wxT("&Quit\tCtrl-Q"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
+ menu_bar->Append(file_menu, wxT("&File"));
// Associate the menu bar with the frame
SetMenuBar(menu_bar);
// add the controls to the frame
wxString strs4[] =
{
- IPC_SERVICE, _T("...")
+ IPC_SERVICE, wxT("...")
};
wxString strs5[] =
{
- IPC_HOST, _T("...")
+ IPC_HOST, wxT("...")
};
wxString strs6[] =
{
- IPC_TOPIC, _T("...")
+ IPC_TOPIC, wxT("...")
};
wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
GetTopic()->SetSelection(0);
wxLogTextCtrl *logWindow = new wxLogTextCtrl(GetLog());
delete wxLog::SetActiveTarget(logWindow);
- wxLogMessage(_T("Click on Connect to connect to the server"));
+ wxLogMessage(wxT("Click on Connect to connect to the server"));
EnableControls();
}
m_client = new MyClient;
bool retval = m_client->Connect(hostname, servername, topic);
- wxLogMessage(_T("Client host=\"%s\" port=\"%s\" topic=\"%s\" %s"),
+ wxLogMessage(wxT("Client host=\"%s\" port=\"%s\" topic=\"%s\" %s"),
hostname.c_str(), servername.c_str(), topic.c_str(),
- retval ? _T("connected") : _T("failed to connect"));
+ retval ? wxT("connected") : wxT("failed to connect"));
if (!retval)
{
void MyFrame::OnServername( wxCommandEvent& WXUNUSED(event) )
{
- if (GetServername()->GetStringSelection() == _T("..."))
+ if (GetServername()->GetStringSelection() == wxT("..."))
{
- wxString s = wxGetTextFromUser(_T("Specify the name of the server"),
- _T("Server Name"), wxEmptyString, this);
+ wxString s = wxGetTextFromUser(wxT("Specify the name of the server"),
+ wxT("Server Name"), wxEmptyString, this);
if (!s.IsEmpty() && s != IPC_SERVICE)
{
GetServername()->Insert(s, 0);
void MyFrame::OnHostname( wxCommandEvent& WXUNUSED(event) )
{
- if (GetHostname()->GetStringSelection() == _T("..."))
+ if (GetHostname()->GetStringSelection() == wxT("..."))
{
- wxString s = wxGetTextFromUser(_T("Specify the name of the host (ignored under DDE)"),
- _T("Host Name"), wxEmptyString, this);
+ wxString s = wxGetTextFromUser(wxT("Specify the name of the host (ignored under DDE)"),
+ wxT("Host Name"), wxEmptyString, this);
if (!s.IsEmpty() && s != IPC_HOST)
{
GetHostname()->Insert(s, 0);
void MyFrame::OnTopic( wxCommandEvent& WXUNUSED(event) )
{
- if (GetTopic()->GetStringSelection() == _T("..."))
+ if (GetTopic()->GetStringSelection() == wxT("..."))
{
- wxString s = wxGetTextFromUser(_T("Specify the name of the topic"),
- _T("Topic Name"), wxEmptyString, this);
+ wxString s = wxGetTextFromUser(wxT("Specify the name of the topic"),
+ wxT("Topic Name"), wxEmptyString, this);
if (!s.IsEmpty() && s != IPC_TOPIC)
{
GetTopic()->Insert(s, 0);
void MyFrame::OnStartAdvise(wxCommandEvent& WXUNUSED(event))
{
- m_client->GetConnection()->StartAdvise(_T("something"));
+ m_client->GetConnection()->StartAdvise(wxT("something"));
}
void MyFrame::OnStopAdvise(wxCommandEvent& WXUNUSED(event))
{
- m_client->GetConnection()->StopAdvise(_T("something"));
+ m_client->GetConnection()->StopAdvise(wxT("something"));
}
void MyFrame::OnExecute(wxCommandEvent& WXUNUSED(event))
{
if (m_client->IsConnected())
{
- wxString s = _T("Date");
+ wxString s = wxT("Date");
m_client->GetConnection()->Execute(s);
m_client->GetConnection()->Execute((const char *)s.c_str(), s.length() + 1);
if (m_client->IsConnected())
{
wxString s = wxDateTime::Now().Format();
- m_client->GetConnection()->Poke(_T("Date"), s);
- s = wxDateTime::Now().FormatTime() + _T(" ") + wxDateTime::Now().FormatDate();
- m_client->GetConnection()->Poke(_T("Date"), (const char *)s.c_str(), s.length() + 1);
+ m_client->GetConnection()->Poke(wxT("Date"), s);
+ s = wxDateTime::Now().FormatTime() + wxT(" ") + wxDateTime::Now().FormatDate();
+ m_client->GetConnection()->Poke(wxT("Date"), (const char *)s.c_str(), s.length() + 1);
char bytes[3];
bytes[0] = '1'; bytes[1] = '2'; bytes[2] = '3';
- m_client->GetConnection()->Poke(_T("bytes[3]"), bytes, 3, wxIPC_PRIVATE);
+ m_client->GetConnection()->Poke(wxT("bytes[3]"), bytes, 3, wxIPC_PRIVATE);
}
}
if (m_client->IsConnected())
{
size_t size;
- m_client->GetConnection()->Request(_T("Date"));
- m_client->GetConnection()->Request(_T("Date+len"), &size);
- m_client->GetConnection()->Request(_T("bytes[3]"), &size, wxIPC_PRIVATE);
+ m_client->GetConnection()->Request(wxT("Date"));
+ m_client->GetConnection()->Request(wxT("Date+len"), &size);
+ m_client->GetConnection()->Request(wxT("bytes[3]"), &size, wxIPC_PRIVATE);
}
}
delete m_connection;
m_connection = NULL;
wxGetApp().GetFrame()->EnableControls();
- wxLogMessage(_T("Client disconnected from server"));
+ wxLogMessage(wxT("Client disconnected from server"));
}
}
bool MyConnection::OnAdvise(const wxString& topic, const wxString& item, const void *data,
size_t size, wxIPCFormat format)
{
- Log(_T("OnAdvise"), topic, item, data, size, format);
+ Log(wxT("OnAdvise"), topic, item, data, size, format);
return true;
}
bool MyConnection::OnDisconnect()
{
- wxLogMessage(_T("OnDisconnect()"));
+ wxLogMessage(wxT("OnDisconnect()"));
wxGetApp().GetFrame()->Disconnect();
return true;
}
bool MyConnection::DoExecute(const void *data, size_t size, wxIPCFormat format)
{
- Log(_T("Execute"), wxEmptyString, wxEmptyString, data, size, format);
+ Log(wxT("Execute"), wxEmptyString, wxEmptyString, data, size, format);
bool retval = wxConnection::DoExecute(data, size, format);
if (!retval)
{
- wxLogMessage(_T("Execute failed!"));
+ wxLogMessage(wxT("Execute failed!"));
}
return retval;
}
const void *MyConnection::Request(const wxString& item, size_t *size, wxIPCFormat format)
{
const void *data = wxConnection::Request(item, size, format);
- Log(_T("Request"), wxEmptyString, item, data, size ? *size : wxNO_LEN, format);
+ Log(wxT("Request"), wxEmptyString, item, data, size ? *size : wxNO_LEN, format);
return data;
}
bool MyConnection::DoPoke(const wxString& item, const void *data, size_t size, wxIPCFormat format)
{
- Log(_T("Poke"), wxEmptyString, item, data, size, format);
+ Log(wxT("Poke"), wxEmptyString, item, data, size, format);
return wxConnection::DoPoke(item, data, size, format);
}
// the default service name
#define IPC_SERVICE "4242"
-//#define IPC_SERVICE _T("/tmp/wxsrv424")
+//#define IPC_SERVICE wxT("/tmp/wxsrv424")
// the hostname
#define IPC_HOST "localhost"
wxJoystick stick(wxJOYSTICK1);
if (!stick.IsOk())
{
- wxMessageBox(_T("No joystick detected!"));
+ wxMessageBox(wxT("No joystick detected!"));
return false;
}
#if wxUSE_SOUND
- m_fire.Create(_T("buttonpress.wav"));
+ m_fire.Create(wxT("buttonpress.wav"));
#endif // wxUSE_SOUND
m_minX = stick.GetXMin();
// Create the main frame window
- frame = new MyFrame(NULL, _T("Joystick Demo"), wxDefaultPosition,
+ frame = new MyFrame(NULL, wxT("Joystick Demo"), wxDefaultPosition,
wxSize(500, 400), wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL);
// Give it an icon (this is ignored in MDI mode: uses resources)
#ifdef __WXMSW__
- frame->SetIcon(wxIcon(_T("joyicon")));
+ frame->SetIcon(wxIcon(wxT("joyicon")));
#endif
#ifdef __X__
- frame->SetIcon(wxIcon(_T("joyicon.xbm")));
+ frame->SetIcon(wxIcon(wxT("joyicon.xbm")));
#endif
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(JOYTEST_QUIT, _T("&Exit"));
+ file_menu->Append(JOYTEST_QUIT, wxT("&Exit"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
+ menu_bar->Append(file_menu, wxT("&File"));
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
#if wxUSE_STATUSBAR
wxString buf;
if (event.ButtonDown())
- buf.Printf(_T("Joystick (%d, %d) #%i Fire!"), pt.x, pt.y, event.GetButtonChange());
+ buf.Printf(wxT("Joystick (%d, %d) #%i Fire!"), pt.x, pt.y, event.GetButtonChange());
else
- buf.Printf(_T("Joystick (%d, %d) "), pt.x, pt.y);
+ buf.Printf(wxT("Joystick (%d, %d) "), pt.x, pt.y);
/*
for(int i = 0; i < nButtons; ++i)
// Define my frame constructor
MyFrame::MyFrame()
- : wxFrame(NULL, wxID_ANY, _T("wxWidgets Layout Demo"),
+ : wxFrame(NULL, wxID_ANY, wxT("wxWidgets Layout Demo"),
wxPoint(30,30), wxDefaultSize,
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(LAYOUT_TEST_PROPORTIONS, _T("&Proportions demo...\tF1"));
- file_menu->Append(LAYOUT_TEST_SIZER, _T("Test wx&FlexSizer...\tF2"));
- file_menu->Append(LAYOUT_TEST_NB_SIZER, _T("Test ¬ebook sizers...\tF3"));
- file_menu->Append(LAYOUT_TEST_GB_SIZER, _T("Test &gridbag sizer...\tF4"));
- file_menu->Append(LAYOUT_TEST_SET_MINIMAL, _T("Test Set&ItemMinSize...\tF5"));
- file_menu->Append(LAYOUT_TEST_NESTED, _T("Test nested sizer in a wxPanel...\tF6"));
- file_menu->Append(LAYOUT_TEST_WRAP, _T("Test wrap sizers...\tF7"));
+ file_menu->Append(LAYOUT_TEST_PROPORTIONS, wxT("&Proportions demo...\tF1"));
+ file_menu->Append(LAYOUT_TEST_SIZER, wxT("Test wx&FlexSizer...\tF2"));
+ file_menu->Append(LAYOUT_TEST_NB_SIZER, wxT("Test ¬ebook sizers...\tF3"));
+ file_menu->Append(LAYOUT_TEST_GB_SIZER, wxT("Test &gridbag sizer...\tF4"));
+ file_menu->Append(LAYOUT_TEST_SET_MINIMAL, wxT("Test Set&ItemMinSize...\tF5"));
+ file_menu->Append(LAYOUT_TEST_NESTED, wxT("Test nested sizer in a wxPanel...\tF6"));
+ file_menu->Append(LAYOUT_TEST_WRAP, wxT("Test wrap sizers...\tF7"));
file_menu->AppendSeparator();
- file_menu->Append(LAYOUT_QUIT, _T("E&xit"), _T("Quit program"));
+ file_menu->Append(LAYOUT_QUIT, wxT("E&xit"), wxT("Quit program"));
wxMenu *help_menu = new wxMenu;
- help_menu->Append(LAYOUT_ABOUT, _T("&About"), _T("About layout demo..."));
+ help_menu->Append(LAYOUT_ABOUT, wxT("&About"), wxT("About layout demo..."));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
- menu_bar->Append(help_menu, _T("&Help"));
+ menu_bar->Append(file_menu, wxT("&File"));
+ menu_bar->Append(help_menu, wxT("&Help"));
// Associate the menu bar with the frame
SetMenuBar(menu_bar);
#if wxUSE_STATUSBAR
CreateStatusBar(2);
- SetStatusText(_T("wxWidgets layout demo"));
+ SetStatusText(wxT("wxWidgets layout demo"));
#endif // wxUSE_STATUSBAR
wxPanel* p = new wxPanel(this, wxID_ANY);
// 1) top: create wxStaticText with minimum size equal to its default size
topsizer->Add(
- new wxStaticText( p, wxID_ANY, _T("An explanation (wxALIGN_RIGHT).") ),
+ new wxStaticText( p, wxID_ANY, wxT("An explanation (wxALIGN_RIGHT).") ),
wxSizerFlags().Align(wxALIGN_RIGHT).Border(wxALL & ~wxBOTTOM, 5));
topsizer->Add(
- new wxStaticText( p, wxID_ANY, _T("An explanation (wxALIGN_LEFT).") ),
+ new wxStaticText( p, wxID_ANY, wxT("An explanation (wxALIGN_LEFT).") ),
wxSizerFlags().Align(wxALIGN_LEFT).Border(wxALL & ~wxBOTTOM, 5));
topsizer->Add(
- new wxStaticText( p, wxID_ANY, _T("An explanation (wxALIGN_CENTRE_HORIZONTAL).") ),
+ new wxStaticText( p, wxID_ANY, wxT("An explanation (wxALIGN_CENTRE_HORIZONTAL).") ),
wxSizerFlags().Align(wxALIGN_CENTRE_HORIZONTAL).Border(wxALL & ~wxBOTTOM, 5));
// 2) top: create wxTextCtrl with minimum size (100x60)
topsizer->Add(
- new wxTextCtrl( p, wxID_ANY, _T("My text (wxEXPAND)."), wxDefaultPosition, wxSize(100,60), wxTE_MULTILINE),
+ new wxTextCtrl( p, wxID_ANY, wxT("My text (wxEXPAND)."), wxDefaultPosition, wxSize(100,60), wxTE_MULTILINE),
wxSizerFlags(1).Expand().Border(wxALL, 5));
// 2.5) Gratuitous test of wxStaticBoxSizers
wxBoxSizer *statsizer = new wxStaticBoxSizer(
- new wxStaticBox(p, wxID_ANY, _T("A wxStaticBoxSizer")), wxVERTICAL );
+ new wxStaticBox(p, wxID_ANY, wxT("A wxStaticBoxSizer")), wxVERTICAL );
statsizer->Add(
- new wxStaticText(p, wxID_ANY, _T("And some TEXT inside it")),
+ new wxStaticText(p, wxID_ANY, wxT("And some TEXT inside it")),
wxSizerFlags().Border(wxALL, 30));
topsizer->Add(
statsizer,
// 2.7) And a test of wxGridSizer
wxGridSizer *gridsizer = new wxGridSizer(2, 5, 5);
- gridsizer->Add(new wxStaticText(p, wxID_ANY, _T("Label")),
+ gridsizer->Add(new wxStaticText(p, wxID_ANY, wxT("Label")),
wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL));
- gridsizer->Add(new wxTextCtrl(p, wxID_ANY, _T("Grid sizer demo")),
+ gridsizer->Add(new wxTextCtrl(p, wxID_ANY, wxT("Grid sizer demo")),
wxSizerFlags(1).Align(wxGROW | wxALIGN_CENTER_VERTICAL));
- gridsizer->Add(new wxStaticText(p, wxID_ANY, _T("Another label")),
+ gridsizer->Add(new wxStaticText(p, wxID_ANY, wxT("Another label")),
wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL));
- gridsizer->Add(new wxTextCtrl(p, wxID_ANY, _T("More text")),
+ gridsizer->Add(new wxTextCtrl(p, wxID_ANY, wxT("More text")),
wxSizerFlags(1).Align(wxGROW | wxALIGN_CENTER_VERTICAL));
- gridsizer->Add(new wxStaticText(p, wxID_ANY, _T("Final label")),
+ gridsizer->Add(new wxStaticText(p, wxID_ANY, wxT("Final label")),
wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL));
- gridsizer->Add(new wxTextCtrl(p, wxID_ANY, _T("And yet more text")),
+ gridsizer->Add(new wxTextCtrl(p, wxID_ANY, wxT("And yet more text")),
wxSizerFlags().Align(wxGROW | wxALIGN_CENTER_VERTICAL));
topsizer->Add(
gridsizer,
// 4) bottom: create two centred wxButtons
wxBoxSizer *button_box = new wxBoxSizer( wxHORIZONTAL );
button_box->Add(
- new wxButton( p, wxID_ANY, _T("Two buttons in a box") ),
+ new wxButton( p, wxID_ANY, wxT("Two buttons in a box") ),
wxSizerFlags().Border(wxALL, 7));
button_box->Add(
- new wxButton( p, wxID_ANY, _T("(wxCENTER)") ),
+ new wxButton( p, wxID_ANY, wxT("(wxCENTER)") ),
wxSizerFlags().Border(wxALL, 7));
topsizer->Add(button_box, wxSizerFlags().Center());
void MyFrame::TestFlexSizers(wxCommandEvent& WXUNUSED(event) )
{
- MyFlexSizerFrame *newFrame = new MyFlexSizerFrame(_T("Flex Sizer Test Frame"), 50, 50);
+ MyFlexSizerFrame *newFrame = new MyFlexSizerFrame(wxT("Flex Sizer Test Frame"), 50, 50);
newFrame->Show(true);
}
void MyFrame::TestNotebookSizers(wxCommandEvent& WXUNUSED(event) )
{
- MySizerDialog dialog( this, _T("Notebook Sizer Test Dialog") );
+ MySizerDialog dialog( this, wxT("Notebook Sizer Test Dialog") );
dialog.ShowModal();
}
void MyFrame::TestSetMinimal(wxCommandEvent& WXUNUSED(event) )
{
- MySimpleSizerFrame *newFrame = new MySimpleSizerFrame(_T("Simple Sizer Test Frame"), 50, 50);
+ MySimpleSizerFrame *newFrame = new MySimpleSizerFrame(wxT("Simple Sizer Test Frame"), 50, 50);
newFrame->Show(true);
}
void MyFrame::TestNested(wxCommandEvent& WXUNUSED(event) )
{
- MyNestedSizerFrame *newFrame = new MyNestedSizerFrame(_T("Nested Sizer Test Frame"), 50, 50);
+ MyNestedSizerFrame *newFrame = new MyNestedSizerFrame(wxT("Nested Sizer Test Frame"), 50, 50);
newFrame->Show(true);
}
void MyFrame::TestWrap(wxCommandEvent& WXUNUSED(event) )
{
- MyWrapSizerFrame *newFrame = new MyWrapSizerFrame(_T("Wrap Sizer Test Frame"), 50, 50);
+ MyWrapSizerFrame *newFrame = new MyWrapSizerFrame(wxT("Wrap Sizer Test Frame"), 50, 50);
newFrame->Show(true);
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
{
- (void)wxMessageBox(_T("wxWidgets GUI library layout demo\n"),
- _T("About Layout Demo"), wxOK|wxICON_INFORMATION);
+ (void)wxMessageBox(wxT("wxWidgets GUI library layout demo\n"),
+ wxT("About Layout Demo"), wxOK|wxICON_INFORMATION);
}
void MyFrame::TestGridBagSizer(wxCommandEvent& WXUNUSED(event) )
{
MyGridBagSizerFrame *newFrame = new
- MyGridBagSizerFrame(_T("wxGridBagSizer Test Frame"), 50, 50);
+ MyGridBagSizerFrame(wxT("wxGridBagSizer Test Frame"), 50, 50);
newFrame->Show(true);
}
// ----------------------------------------------------------------------------
MyProportionsFrame::MyProportionsFrame(wxFrame *parent)
- : wxFrame(parent, wxID_ANY, _T("Box Sizer Proportions Demo"))
+ : wxFrame(parent, wxID_ANY, wxT("Box Sizer Proportions Demo"))
{
size_t n;
// lay them out
m_sizer = new wxStaticBoxSizer(wxHORIZONTAL, panel,
- _T("Try changing elements proportions and resizing the window"));
+ wxT("Try changing elements proportions and resizing the window"));
for ( n = 0; n < WXSIZEOF(m_spins); n++ )
m_sizer->Add(m_spins[n], wxSizerFlags().Border());
(
parent,
wxID_ANY,
- wxString::Format(_T("(%d, %d)"), i + 1, j + 1),
+ wxString::Format(wxT("(%d, %d)"), i + 1, j + 1),
wxDefaultPosition,
wxDefaultSize,
wxALIGN_CENTER
// consttuct the first column
wxSizer *sizerCol1 = new wxBoxSizer(wxVERTICAL);
- sizerCol1->Add(new wxStaticText(p, wxID_ANY, _T("Ungrowable:")), 0, wxCENTER | wxTOP, 20);
+ sizerCol1->Add(new wxStaticText(p, wxID_ANY, wxT("Ungrowable:")), 0, wxCENTER | wxTOP, 20);
sizerFlex = new wxFlexGridSizer(3, 3);
InitFlexSizer(sizerFlex, p);
sizerCol1->Add(sizerFlex, 1, wxALL | wxEXPAND, 10);
- sizerCol1->Add(new wxStaticText(p, wxID_ANY, _T("Growable middle column:")), 0, wxCENTER | wxTOP, 20);
+ sizerCol1->Add(new wxStaticText(p, wxID_ANY, wxT("Growable middle column:")), 0, wxCENTER | wxTOP, 20);
sizerFlex = new wxFlexGridSizer(3, 3);
InitFlexSizer(sizerFlex, p);
sizerFlex->AddGrowableCol(1);
sizerCol1->Add(sizerFlex, 1, wxALL | wxEXPAND, 10);
- sizerCol1->Add(new wxStaticText(p, wxID_ANY, _T("Growable middle row:")), 0, wxCENTER | wxTOP, 20);
+ sizerCol1->Add(new wxStaticText(p, wxID_ANY, wxT("Growable middle row:")), 0, wxCENTER | wxTOP, 20);
sizerFlex = new wxFlexGridSizer(3, 3);
InitFlexSizer(sizerFlex, p);
sizerFlex->AddGrowableRow(1);
sizerCol1->Add(sizerFlex, 1, wxALL | wxEXPAND, 10);
- sizerCol1->Add(new wxStaticText(p, wxID_ANY, _T("All growable columns:")), 0, wxCENTER | wxTOP, 20);
+ sizerCol1->Add(new wxStaticText(p, wxID_ANY, wxT("All growable columns:")), 0, wxCENTER | wxTOP, 20);
sizerFlex = new wxFlexGridSizer(3, 3);
InitFlexSizer(sizerFlex, p);
sizerFlex->AddGrowableCol(0, 1);
// the second one
wxSizer *sizerCol2 = new wxBoxSizer(wxVERTICAL);
- sizerCol2->Add(new wxStaticText(p, wxID_ANY, _T("Growable middle row and column:")), 0, wxCENTER | wxTOP, 20);
+ sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Growable middle row and column:")), 0, wxCENTER | wxTOP, 20);
sizerFlex = new wxFlexGridSizer(3, 3);
InitFlexSizer(sizerFlex, p);
sizerFlex->AddGrowableCol(1);
sizerFlex->AddGrowableRow(1);
sizerCol2->Add(sizerFlex, 1, wxALL | wxEXPAND, 10);
- sizerCol2->Add(new wxStaticText(p, wxID_ANY, _T("Same with horz flex direction")), 0, wxCENTER | wxTOP, 20);
+ sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Same with horz flex direction")), 0, wxCENTER | wxTOP, 20);
sizerFlex = new wxFlexGridSizer(3, 3);
InitFlexSizer(sizerFlex, p);
sizerFlex->AddGrowableCol(1);
sizerFlex->SetFlexibleDirection(wxHORIZONTAL);
sizerCol2->Add(sizerFlex, 1, wxALL | wxEXPAND, 10);
- sizerCol2->Add(new wxStaticText(p, wxID_ANY, _T("Same with grow mode == \"none\"")), 0, wxCENTER | wxTOP, 20);
+ sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Same with grow mode == \"none\"")), 0, wxCENTER | wxTOP, 20);
sizerFlex = new wxFlexGridSizer(3, 3);
InitFlexSizer(sizerFlex, p);
sizerFlex->AddGrowableCol(1);
sizerFlex->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_NONE);
sizerCol2->Add(sizerFlex, 1, wxALL | wxEXPAND, 10);
- sizerCol2->Add(new wxStaticText(p, wxID_ANY, _T("Same with grow mode == \"all\"")), 0, wxCENTER | wxTOP, 20);
+ sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Same with grow mode == \"all\"")), 0, wxCENTER | wxTOP, 20);
sizerFlex = new wxFlexGridSizer(3, 3);
InitFlexSizer(sizerFlex, p);
sizerFlex->AddGrowableCol(1);
wxNotebook *notebook = new wxNotebook( this, wxID_ANY );
topsizer->Add( notebook, 1, wxGROW );
- wxButton *button = new wxButton( this, wxID_OK, _T("OK") );
+ wxButton *button = new wxButton( this, wxID_OK, wxT("OK") );
topsizer->Add( button, 0, wxALIGN_RIGHT | wxALL, 10 );
// First page: one big text ctrl
- wxTextCtrl *multi = new wxTextCtrl( notebook, wxID_ANY, _T("TextCtrl."), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
- notebook->AddPage( multi, _T("Page One") );
+ wxTextCtrl *multi = new wxTextCtrl( notebook, wxID_ANY, wxT("TextCtrl."), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
+ notebook->AddPage( multi, wxT("Page One") );
// Second page: a text ctrl and a button
wxPanel *panel = new wxPanel( notebook, wxID_ANY );
- notebook->AddPage( panel, _T("Page Two") );
+ notebook->AddPage( panel, wxT("Page Two") );
wxSizer *panelsizer = new wxBoxSizer( wxVERTICAL );
- wxTextCtrl *text = new wxTextCtrl( panel, wxID_ANY, _T("TextLine 1."), wxDefaultPosition, wxSize(250,wxDefaultCoord) );
+ wxTextCtrl *text = new wxTextCtrl( panel, wxID_ANY, wxT("TextLine 1."), wxDefaultPosition, wxSize(250,wxDefaultCoord) );
panelsizer->Add( text, 0, wxGROW|wxALL, 30 );
- text = new wxTextCtrl( panel, wxID_ANY, _T("TextLine 2."), wxDefaultPosition, wxSize(250,wxDefaultCoord) );
+ text = new wxTextCtrl( panel, wxID_ANY, wxT("TextLine 2."), wxDefaultPosition, wxSize(250,wxDefaultCoord) );
panelsizer->Add( text, 0, wxGROW|wxALL, 30 );
- wxButton *button2 = new wxButton( panel, wxID_ANY, _T("Hallo") );
+ wxButton *button2 = new wxButton( panel, wxID_ANY, wxT("Hallo") );
panelsizer->Add( button2, 0, wxALIGN_RIGHT | wxLEFT|wxRIGHT|wxBOTTOM, 30 );
panel->SetSizer( panelsizer );
// ----------------------------------------------------------------------------
// some simple macros to help make the sample code below more clear
-#define TEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, _T(text))
-#define MLTEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, _T(text), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE)
+#define TEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, wxT(text))
+#define MLTEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, wxT(text), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE)
#define POS(r, c) wxGBPosition(r,c)
#define SPAN(r, c) wxGBSpan(r,c)
-const wxChar gbsDescription[] =_T("\
+const wxChar gbsDescription[] =wxT("\
The wxGridBagSizer is similar to the wxFlexGridSizer except the items are explicitly positioned\n\
in a virtual cell of the layout grid, and column or row spanning is allowed. For example, this\n\
static text is positioned at (0,0) and it spans 7 columns.");
//m_gbs->Add( TEXTCTRL("bad position"), POS(5,3) ); // Test for assert
- m_moveBtn1 = new wxButton(p, GBS_MOVE_BTN1, _T("Move this to (3,6)"));
- m_moveBtn2 = new wxButton(p, GBS_MOVE_BTN2, _T("Move this to (3,6)"));
+ m_moveBtn1 = new wxButton(p, GBS_MOVE_BTN1, wxT("Move this to (3,6)"));
+ m_moveBtn2 = new wxButton(p, GBS_MOVE_BTN2, wxT("Move this to (3,6)"));
m_gbs->Add( m_moveBtn1, POS(10,2) );
m_gbs->Add( m_moveBtn2, POS(10,3) );
- m_hideBtn = new wxButton(p, GBS_HIDE_BTN, _T("Hide this item -->"));
+ m_hideBtn = new wxButton(p, GBS_HIDE_BTN, wxT("Hide this item -->"));
m_gbs->Add(m_hideBtn, POS(12, 3));
- m_hideTxt = new wxTextCtrl(p, wxID_ANY, _T("pos(12,4), size(150, wxDefaultCoord)"),
+ m_hideTxt = new wxTextCtrl(p, wxID_ANY, wxT("pos(12,4), size(150, wxDefaultCoord)"),
wxDefaultPosition, wxSize(150,wxDefaultCoord));
m_gbs->Add( m_hideTxt, POS(12,4) );
- m_showBtn = new wxButton(p, GBS_SHOW_BTN, _T("<-- Show it again"));
+ m_showBtn = new wxButton(p, GBS_SHOW_BTN, wxT("<-- Show it again"));
m_gbs->Add(m_showBtn, POS(12, 5));
m_showBtn->Disable();
if (curPos == wxGBPosition(3,6))
{
m_gbs->SetItemPosition(btn, m_lastPos);
- btn->SetLabel(_T("Move this to (3,6)"));
+ btn->SetLabel(wxT("Move this to (3,6)"));
}
else
{
if ( m_gbs->CheckForIntersection(wxGBPosition(3,6), wxGBSpan(1,1)) )
wxMessageBox(
-_T("wxGridBagSizer will not allow items to be in the same cell as\n\
+wxT("wxGridBagSizer will not allow items to be in the same cell as\n\
another item, so this operation will fail. You will also get an assert\n\
-when compiled in debug mode."), _T("Warning"), wxOK | wxICON_INFORMATION);
+when compiled in debug mode."), wxT("Warning"), wxOK | wxICON_INFORMATION);
if ( m_gbs->SetItemPosition(btn, wxGBPosition(3,6)) )
{
m_lastPos = curPos;
- btn->SetLabel(_T("Move it back"));
+ btn->SetLabel(wxT("Move it back"));
}
}
m_gbs->Layout();
{
wxMenu *menu = new wxMenu;
- menu->Append(ID_SET_SMALL, _T("Make text control small\tF4"));
- menu->Append(ID_SET_BIG, _T("Make text control big\tF5"));
+ menu->Append(ID_SET_SMALL, wxT("Make text control small\tF4"));
+ menu->Append(ID_SET_BIG, wxT("Make text control big\tF5"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(menu, _T("&File"));
+ menu_bar->Append(menu, wxT("&File"));
SetMenuBar( menu_bar );
{
wxMenu *menu = new wxMenu;
- menu->Append(wxID_ABOUT, _T("Do nothing"));
+ menu->Append(wxID_ABOUT, wxT("Do nothing"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(menu, _T("&File"));
+ menu_bar->Append(menu, wxT("&File"));
SetMenuBar( menu_bar );
const wxChar *SMALL_VIRTUAL_VIEW_ITEMS[][2] =
{
- { _T("Cat"), _T("meow") },
- { _T("Cow"), _T("moo") },
- { _T("Crow"), _T("caw") },
- { _T("Dog"), _T("woof") },
- { _T("Duck"), _T("quack") },
- { _T("Mouse"), _T("squeak") },
- { _T("Owl"), _T("hoo") },
- { _T("Pig"), _T("oink") },
- { _T("Pigeon"), _T("coo") },
- { _T("Sheep"), _T("baaah") },
+ { wxT("Cat"), wxT("meow") },
+ { wxT("Cow"), wxT("moo") },
+ { wxT("Crow"), wxT("caw") },
+ { wxT("Dog"), wxT("woof") },
+ { wxT("Duck"), wxT("quack") },
+ { wxT("Mouse"), wxT("squeak") },
+ { wxT("Owl"), wxT("hoo") },
+ { wxT("Pig"), wxT("oink") },
+ { wxT("Pigeon"), wxT("coo") },
+ { wxT("Sheep"), wxT("baaah") },
};
// number of items in icon/small icon view
m_imageListSmall = new wxImageList(16, 16, true);
#ifdef __WXMSW__
- m_imageListNormal->Add( wxIcon(_T("icon1"), wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon(_T("icon2"), wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon(_T("icon3"), wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon(_T("icon4"), wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon(_T("icon5"), wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon(_T("icon6"), wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon(_T("icon7"), wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon(_T("icon8"), wxBITMAP_TYPE_ICO_RESOURCE) );
- m_imageListNormal->Add( wxIcon(_T("icon9"), wxBITMAP_TYPE_ICO_RESOURCE) );
-
- m_imageListSmall->Add( wxIcon(_T("iconsmall"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(wxT("icon1"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(wxT("icon2"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(wxT("icon3"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(wxT("icon4"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(wxT("icon5"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(wxT("icon6"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(wxT("icon7"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(wxT("icon8"), wxBITMAP_TYPE_ICO_RESOURCE) );
+ m_imageListNormal->Add( wxIcon(wxT("icon9"), wxBITMAP_TYPE_ICO_RESOURCE) );
+
+ m_imageListSmall->Add( wxIcon(wxT("iconsmall"), wxBITMAP_TYPE_ICO_RESOURCE) );
#else
m_imageListNormal->Add( wxIcon( toolbrai_xpm ) );
// Make a menubar
wxMenu *menuFile = new wxMenu;
- menuFile->Append(LIST_ABOUT, _T("&About"));
+ menuFile->Append(LIST_ABOUT, wxT("&About"));
menuFile->AppendSeparator();
- menuFile->Append(LIST_QUIT, _T("E&xit\tAlt-X"));
+ menuFile->Append(LIST_QUIT, wxT("E&xit\tAlt-X"));
wxMenu *menuView = new wxMenu;
- menuView->Append(LIST_LIST_VIEW, _T("&List view\tF1"));
- menuView->Append(LIST_REPORT_VIEW, _T("&Report view\tF2"));
- menuView->Append(LIST_ICON_VIEW, _T("&Icon view\tF3"));
- menuView->Append(LIST_ICON_TEXT_VIEW, _T("Icon view with &text\tF4"));
- menuView->Append(LIST_SMALL_ICON_VIEW, _T("&Small icon view\tF5"));
- menuView->Append(LIST_SMALL_ICON_TEXT_VIEW, _T("Small icon &view with text\tF6"));
- menuView->Append(LIST_VIRTUAL_VIEW, _T("&Virtual view\tF7"));
- menuView->Append(LIST_SMALL_VIRTUAL_VIEW, _T("Small virtual vie&w\tF8"));
+ menuView->Append(LIST_LIST_VIEW, wxT("&List view\tF1"));
+ menuView->Append(LIST_REPORT_VIEW, wxT("&Report view\tF2"));
+ menuView->Append(LIST_ICON_VIEW, wxT("&Icon view\tF3"));
+ menuView->Append(LIST_ICON_TEXT_VIEW, wxT("Icon view with &text\tF4"));
+ menuView->Append(LIST_SMALL_ICON_VIEW, wxT("&Small icon view\tF5"));
+ menuView->Append(LIST_SMALL_ICON_TEXT_VIEW, wxT("Small icon &view with text\tF6"));
+ menuView->Append(LIST_VIRTUAL_VIEW, wxT("&Virtual view\tF7"));
+ menuView->Append(LIST_SMALL_VIRTUAL_VIEW, wxT("Small virtual vie&w\tF8"));
menuView->AppendSeparator();
menuView->Append(LIST_SET_ITEMS_COUNT, "Set &number of items");
#ifdef __WXOSX__
menuView->AppendSeparator();
- menuView->AppendCheckItem(LIST_MAC_USE_GENERIC, _T("Mac: Use Generic Control"));
+ menuView->AppendCheckItem(LIST_MAC_USE_GENERIC, wxT("Mac: Use Generic Control"));
#endif
wxMenu *menuList = new wxMenu;
- menuList->Append(LIST_GOTO, _T("&Go to item #3\tCtrl-3"));
- menuList->Append(LIST_FOCUS_LAST, _T("&Make last item current\tCtrl-L"));
- menuList->Append(LIST_TOGGLE_FIRST, _T("To&ggle first item\tCtrl-G"));
- menuList->Append(LIST_DESELECT_ALL, _T("&Deselect All\tCtrl-D"));
- menuList->Append(LIST_SELECT_ALL, _T("S&elect All\tCtrl-A"));
+ menuList->Append(LIST_GOTO, wxT("&Go to item #3\tCtrl-3"));
+ menuList->Append(LIST_FOCUS_LAST, wxT("&Make last item current\tCtrl-L"));
+ menuList->Append(LIST_TOGGLE_FIRST, wxT("To&ggle first item\tCtrl-G"));
+ menuList->Append(LIST_DESELECT_ALL, wxT("&Deselect All\tCtrl-D"));
+ menuList->Append(LIST_SELECT_ALL, wxT("S&elect All\tCtrl-A"));
menuList->AppendSeparator();
- menuList->Append(LIST_SHOW_COL_INFO, _T("Show &column info\tCtrl-C"));
- menuList->Append(LIST_SHOW_SEL_INFO, _T("Show &selected items\tCtrl-S"));
- menuList->Append(LIST_SHOW_VIEW_RECT, _T("Show &view rect"));
+ menuList->Append(LIST_SHOW_COL_INFO, wxT("Show &column info\tCtrl-C"));
+ menuList->Append(LIST_SHOW_SEL_INFO, wxT("Show &selected items\tCtrl-S"));
+ menuList->Append(LIST_SHOW_VIEW_RECT, wxT("Show &view rect"));
#ifdef wxHAS_LISTCTRL_COLUMN_ORDER
- menuList->Append(LIST_SET_COL_ORDER, _T("Se&t columns order\tShift-Ctrl-O"));
- menuList->Append(LIST_GET_COL_ORDER, _T("Sho&w columns order\tCtrl-O"));
+ menuList->Append(LIST_SET_COL_ORDER, wxT("Se&t columns order\tShift-Ctrl-O"));
+ menuList->Append(LIST_GET_COL_ORDER, wxT("Sho&w columns order\tCtrl-O"));
#endif // wxHAS_LISTCTRL_COLUMN_ORDER
menuList->AppendSeparator();
- menuList->Append(LIST_SORT, _T("Sor&t\tCtrl-T"));
+ menuList->Append(LIST_SORT, wxT("Sor&t\tCtrl-T"));
menuList->Append(LIST_FIND, "Test Find() performance");
menuList->AppendSeparator();
- menuList->Append(LIST_ADD, _T("&Append an item\tCtrl-P"));
- menuList->Append(LIST_EDIT, _T("&Edit the item\tCtrl-E"));
- menuList->Append(LIST_DELETE, _T("&Delete first item\tCtrl-X"));
- menuList->Append(LIST_DELETE_ALL, _T("Delete &all items"));
+ menuList->Append(LIST_ADD, wxT("&Append an item\tCtrl-P"));
+ menuList->Append(LIST_EDIT, wxT("&Edit the item\tCtrl-E"));
+ menuList->Append(LIST_DELETE, wxT("&Delete first item\tCtrl-X"));
+ menuList->Append(LIST_DELETE_ALL, wxT("Delete &all items"));
menuList->AppendSeparator();
- menuList->Append(LIST_FREEZE, _T("Free&ze\tCtrl-Z"));
- menuList->Append(LIST_THAW, _T("Tha&w\tCtrl-W"));
+ menuList->Append(LIST_FREEZE, wxT("Free&ze\tCtrl-Z"));
+ menuList->Append(LIST_THAW, wxT("Tha&w\tCtrl-W"));
menuList->AppendSeparator();
- menuList->AppendCheckItem(LIST_TOGGLE_LINES, _T("Toggle &lines\tCtrl-I"));
- menuList->Append(LIST_TOGGLE_MULTI_SEL, _T("&Multiple selection\tCtrl-M"),
- _T("Toggle multiple selection"), true);
+ menuList->AppendCheckItem(LIST_TOGGLE_LINES, wxT("Toggle &lines\tCtrl-I"));
+ menuList->Append(LIST_TOGGLE_MULTI_SEL, wxT("&Multiple selection\tCtrl-M"),
+ wxT("Toggle multiple selection"), true);
wxMenu *menuCol = new wxMenu;
- menuCol->Append(LIST_SET_FG_COL, _T("&Foreground colour..."));
- menuCol->Append(LIST_SET_BG_COL, _T("&Background colour..."));
+ menuCol->Append(LIST_SET_FG_COL, wxT("&Foreground colour..."));
+ menuCol->Append(LIST_SET_BG_COL, wxT("&Background colour..."));
wxMenuBar *menubar = new wxMenuBar;
- menubar->Append(menuFile, _T("&File"));
- menubar->Append(menuView, _T("&View"));
- menubar->Append(menuList, _T("&List"));
- menubar->Append(menuCol, _T("&Colour"));
+ menubar->Append(menuFile, wxT("&File"));
+ menubar->Append(menuView, wxT("&View"));
+ menubar->Append(menuList, wxT("&List"));
+ menubar->Append(menuCol, wxT("&Colour"));
SetMenuBar(menubar);
m_panel = new wxPanel(this, wxID_ANY);
return true;
// "this" == whatever
- wxLogWarning(_T("Can't do this in virtual view, sorry."));
+ wxLogWarning(wxT("Can't do this in virtual view, sorry."));
return false;
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageDialog dialog(this, _T("List test sample\nJulian Smart (c) 1997"),
- _T("About list test"), wxOK|wxCANCEL);
+ wxMessageDialog dialog(this, wxT("List test sample\nJulian Smart (c) 1997"),
+ wxT("About list test"), wxOK|wxCANCEL);
dialog.ShowModal();
}
void MyFrame::OnFreeze(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("Freezing the control"));
+ wxLogMessage(wxT("Freezing the control"));
m_listCtrl->Freeze();
}
void MyFrame::OnThaw(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("Thawing the control"));
+ wxLogMessage(wxT("Thawing the control"));
m_listCtrl->Thaw();
}
break;
default:
- wxFAIL_MSG( _T("unknown listctrl mode") );
+ wxFAIL_MSG( wxT("unknown listctrl mode") );
}
}
{
for ( int i = 0; i < m_numListItems; i++ )
{
- m_listCtrl->InsertItem(i, wxString::Format(_T("Item %d"), i));
+ m_listCtrl->InsertItem(i, wxString::Format(wxT("Item %d"), i));
}
}
// note that under MSW for SetColumnWidth() to work we need to create the
// items with images initially even if we specify dummy image id
wxListItem itemCol;
- itemCol.SetText(_T("Column 1"));
+ itemCol.SetText(wxT("Column 1"));
itemCol.SetImage(-1);
m_listCtrl->InsertColumn(0, itemCol);
- itemCol.SetText(_T("Column 2"));
+ itemCol.SetText(wxT("Column 2"));
itemCol.SetAlign(wxLIST_FORMAT_CENTRE);
m_listCtrl->InsertColumn(1, itemCol);
- itemCol.SetText(_T("Column 3"));
+ itemCol.SetText(wxT("Column 3"));
itemCol.SetAlign(wxLIST_FORMAT_RIGHT);
m_listCtrl->InsertColumn(2, itemCol);
m_listCtrl->InsertItemInReportView(i);
}
- m_logWindow->WriteText(wxString::Format(_T("%d items inserted in %ldms\n"),
+ m_logWindow->WriteText(wxString::Format(wxT("%d items inserted in %ldms\n"),
m_numListItems, sw.Time()));
m_listCtrl->Show();
if ( withText )
{
- m_listCtrl->InsertItem(i, wxString::Format(_T("Label %d"), i),
+ m_listCtrl->InsertItem(i, wxString::Format(wxT("Label %d"), i),
image);
}
else
if ( m_smallVirtual )
{
- m_listCtrl->InsertColumn(0, _T("Animal"));
- m_listCtrl->InsertColumn(1, _T("Sound"));
+ m_listCtrl->InsertColumn(0, wxT("Animal"));
+ m_listCtrl->InsertColumn(1, wxT("Sound"));
m_listCtrl->SetItemCount(WXSIZEOF(SMALL_VIRTUAL_VIEW_ITEMS));
}
else
{
- m_listCtrl->InsertColumn(0, _T("First Column"));
- m_listCtrl->InsertColumn(1, _T("Second Column"));
+ m_listCtrl->InsertColumn(0, wxT("First Column"));
+ m_listCtrl->InsertColumn(1, wxT("Second Column"));
m_listCtrl->SetColumnWidth(0, 150);
m_listCtrl->SetColumnWidth(1, 150);
m_listCtrl->SetItemCount(1000000);
m_listCtrl->SortItems(MyCompareFunction, 0);
- m_logWindow->WriteText(wxString::Format(_T("Sorting %d items took %ld ms\n"),
+ m_logWindow->WriteText(wxString::Format(wxT("Sorting %d items took %ld ms\n"),
m_listCtrl->GetItemCount(),
sw.Time()));
}
void MyFrame::OnShowSelInfo(wxCommandEvent& WXUNUSED(event))
{
int selCount = m_listCtrl->GetSelectedItemCount();
- wxLogMessage(_T("%d items selected:"), selCount);
+ wxLogMessage(wxT("%d items selected:"), selCount);
// don't show too many items
size_t shownCount = 0;
wxLIST_STATE_SELECTED);
while ( item != -1 )
{
- wxLogMessage(_T("\t%ld (%s)"),
+ wxLogMessage(wxT("\t%ld (%s)"),
item, m_listCtrl->GetItemText(item).c_str());
if ( ++shownCount > 10 )
{
- wxLogMessage(_T("\t... more selected items snipped..."));
+ wxLogMessage(wxT("\t... more selected items snipped..."));
break;
}
flags |= wxLC_SINGLE_SEL;
m_logWindow->WriteText(wxString::Format(wxT("Current selection mode: %sle\n"),
- (flags & wxLC_SINGLE_SEL) ? _T("sing") : _T("multip")));
+ (flags & wxLC_SINGLE_SEL) ? wxT("sing") : wxT("multip")));
RecreateList(flags);
}
void MyFrame::OnAdd(wxCommandEvent& WXUNUSED(event))
{
- m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), _T("Appended item"));
+ m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), wxT("Appended item"));
}
void MyFrame::OnEdit(wxCommandEvent& WXUNUSED(event))
}
else
{
- m_logWindow->WriteText(_T("No item to edit"));
+ m_logWindow->WriteText(wxT("No item to edit"));
}
}
}
else
{
- m_logWindow->WriteText(_T("Nothing to delete"));
+ m_logWindow->WriteText(wxT("Nothing to delete"));
}
}
m_listCtrl->DeleteAllItems();
- m_logWindow->WriteText(wxString::Format(_T("Deleting %d items took %ld ms\n"),
+ m_logWindow->WriteText(wxString::Format(wxT("Deleting %d items took %ld ms\n"),
itemCount,
sw.Time()));
}
// Show popupmenu at position
wxMenu menu(wxT("Test"));
- menu.Append(LIST_ABOUT, _T("&About"));
+ menu.Append(LIST_ABOUT, wxT("&About"));
PopupMenu(&menu, event.GetPoint());
wxLogMessage( wxT("OnColumnRightClick at %d."), event.GetColumn() );
if ( event.GetColumn() == 0 )
{
- wxLogMessage(_T("Resizing this column shouldn't work."));
+ wxLogMessage(wxT("Resizing this column shouldn't work."));
event.Veto();
}
void MyListCtrl::OnDeleteItem(wxListEvent& event)
{
- LogEvent(event, _T("OnDeleteItem"));
+ LogEvent(event, wxT("OnDeleteItem"));
wxLogMessage( wxT("Number of items when delete event is sent: %d"), GetItemCount() );
}
void MyListCtrl::OnDeleteAllItems(wxListEvent& event)
{
- LogEvent(event, _T("OnDeleteAllItems"));
+ LogEvent(event, wxT("OnDeleteAllItems"));
}
void MyListCtrl::OnSelected(wxListEvent& event)
{
- LogEvent(event, _T("OnSelected"));
+ LogEvent(event, wxT("OnSelected"));
if ( GetWindowStyle() & wxLC_REPORT )
{
void MyListCtrl::OnDeselected(wxListEvent& event)
{
- LogEvent(event, _T("OnDeselected"));
+ LogEvent(event, wxT("OnDeselected"));
}
void MyListCtrl::OnActivated(wxListEvent& event)
{
- LogEvent(event, _T("OnActivated"));
+ LogEvent(event, wxT("OnActivated"));
}
void MyListCtrl::OnFocused(wxListEvent& event)
{
- LogEvent(event, _T("OnFocused"));
+ LogEvent(event, wxT("OnFocused"));
event.Skip();
}
item = 0;
}
- wxLogMessage(_T("Focusing item %ld"), item);
+ wxLogMessage(wxT("Focusing item %ld"), item);
SetItemState(item, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
EnsureVisible(item);
wxRect r;
if ( !GetItemRect(item, r) )
{
- wxLogError(_T("Failed to retrieve rect of item %ld"), item);
+ wxLogError(wxT("Failed to retrieve rect of item %ld"), item);
break;
}
- wxLogMessage(_T("Bounding rect of item %ld is (%d, %d)-(%d, %d)"),
+ wxLogMessage(wxT("Bounding rect of item %ld is (%d, %d)-(%d, %d)"),
item, r.x, r.y, r.x + r.width, r.y + r.height);
}
break;
wxRect r;
if ( !GetSubItemRect(item, subItem, r) )
{
- wxLogError(_T("Failed to retrieve rect of item %ld column %d"), item, subItem + 1);
+ wxLogError(wxT("Failed to retrieve rect of item %ld column %d"), item, subItem + 1);
break;
}
- wxLogMessage(_T("Bounding rect of item %ld column %d is (%d, %d)-(%d, %d)"),
+ wxLogMessage(wxT("Bounding rect of item %ld column %d is (%d, %d)-(%d, %d)"),
item, subItem + 1,
r.x, r.y, r.x + r.width, r.y + r.height);
}
{
DeleteItem(item);
- wxLogMessage(_T("Item %ld deleted"), item);
+ wxLogMessage(wxT("Item %ld deleted"), item);
// -1 because the indices were shifted by DeleteItem()
item = GetNextItem(item - 1,
//else: fall through
default:
- LogEvent(event, _T("OnListKeyDown"));
+ LogEvent(event, wxT("OnListKeyDown"));
event.Skip();
}
void MyListCtrl::OnChar(wxKeyEvent& event)
{
- wxLogMessage(_T("Got char event."));
+ wxLogMessage(wxT("Got char event."));
switch ( event.GetKeyCode() )
{
wxString where;
switch ( flags )
{
- case wxLIST_HITTEST_ABOVE: where = _T("above"); break;
- case wxLIST_HITTEST_BELOW: where = _T("below"); break;
- case wxLIST_HITTEST_NOWHERE: where = _T("nowhere near"); break;
- case wxLIST_HITTEST_ONITEMICON: where = _T("on icon of"); break;
- case wxLIST_HITTEST_ONITEMLABEL: where = _T("on label of"); break;
- case wxLIST_HITTEST_ONITEMRIGHT: where = _T("right on"); break;
- case wxLIST_HITTEST_TOLEFT: where = _T("to the left of"); break;
- case wxLIST_HITTEST_TORIGHT: where = _T("to the right of"); break;
- default: where = _T("not clear exactly where on"); break;
+ case wxLIST_HITTEST_ABOVE: where = wxT("above"); break;
+ case wxLIST_HITTEST_BELOW: where = wxT("below"); break;
+ case wxLIST_HITTEST_NOWHERE: where = wxT("nowhere near"); break;
+ case wxLIST_HITTEST_ONITEMICON: where = wxT("on icon of"); break;
+ case wxLIST_HITTEST_ONITEMLABEL: where = wxT("on label of"); break;
+ case wxLIST_HITTEST_ONITEMRIGHT: where = wxT("right on"); break;
+ case wxLIST_HITTEST_TOLEFT: where = wxT("to the left of"); break;
+ case wxLIST_HITTEST_TORIGHT: where = wxT("to the right of"); break;
+ default: where = wxT("not clear exactly where on"); break;
}
- wxLogMessage(_T("Right double click %s item %ld, subitem %ld"),
+ wxLogMessage(wxT("Right double click %s item %ld, subitem %ld"),
where.c_str(), item, subitem);
}
void MyListCtrl::LogEvent(const wxListEvent& event, const wxChar *eventName)
{
- wxLogMessage(_T("Item %ld: %s (item text = %s, data = %ld)"),
+ wxLogMessage(wxT("Item %ld: %s (item text = %s, data = %ld)"),
event.GetIndex(), eventName,
event.GetText().c_str(), event.GetData());
}
}
else // "big" virtual control
{
- return wxString::Format(_T("Column %ld of item %ld"), column, item);
+ return wxString::Format(wxT("Column %ld of item %ld"), column, item);
}
}
void MyListCtrl::InsertItemInReportView(int i)
{
wxString buf;
- buf.Printf(_T("This is item %d"), i);
+ buf.Printf(wxT("This is item %d"), i);
long tmp = InsertItem(i, buf, 0);
SetItemData(tmp, i);
- buf.Printf(_T("Col 1, item %d"), i);
+ buf.Printf(wxT("Col 1, item %d"), i);
SetItem(tmp, 1, buf);
- buf.Printf(_T("Item %d in column 2"), i);
+ buf.Printf(wxT("Item %d in column 2"), i);
SetItem(tmp, 2, buf);
}
{
wxMenu menu;
- menu.Append(wxID_ABOUT, _T("&About"));
+ menu.Append(wxID_ABOUT, wxT("&About"));
menu.AppendSeparator();
- menu.Append(wxID_EXIT, _T("E&xit"));
+ menu.Append(wxID_EXIT, wxT("E&xit"));
PopupMenu(&menu, pos.x, pos.y);
}
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(wxID_EXIT, _T("E&xit"));
+ file_menu->Append(wxID_EXIT, wxT("E&xit"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("File"));
+ menu_bar->Append(file_menu, wxT("File"));
frame->SetMenuBar(menu_bar);
// Make a panel with a message
wxPanel *panel = new wxPanel(frame);
- (void)new wxStaticText(panel, wxID_ANY, _T("Hello, this is a minimal debugging wxWidgets program!"), wxPoint(10, 10));
+ (void)new wxStaticText(panel, wxID_ANY, wxT("Hello, this is a minimal debugging wxWidgets program!"), wxPoint(10, 10));
// Show the frame
frame->Show(true);
// My frame constructor
MyFrame::MyFrame(wxFrame *parent):
- wxFrame(parent, wxID_ANY, _T("MemCheck wxWidgets Sample"), wxDefaultPosition, wxSize(400, 200))
+ wxFrame(parent, wxID_ANY, wxT("MemCheck wxWidgets Sample"), wxDefaultPosition, wxSize(400, 200))
{}
// Intercept menu commands
void OnMenuOpen(wxMenuEvent& event)
{
#if USE_LOG_WINDOW
- LogMenuOpenOrClose(event, _T("opened")); event.Skip();
+ LogMenuOpenOrClose(event, wxT("opened")); event.Skip();
#endif
}
void OnMenuClose(wxMenuEvent& event)
{
#if USE_LOG_WINDOW
- LogMenuOpenOrClose(event, _T("closed")); event.Skip();
+ LogMenuOpenOrClose(event, wxT("closed")); event.Skip();
#endif
}
frame->Show(true);
#if wxUSE_STATUSBAR
- frame->SetStatusText(_T("Welcome to wxWidgets menu sample"));
+ frame->SetStatusText(wxT("Welcome to wxWidgets menu sample"));
#endif // wxUSE_STATUSBAR
SetTopWindow(frame);
// Define my frame constructor
MyFrame::MyFrame()
- : wxFrame((wxFrame *)NULL, wxID_ANY, _T("wxWidgets menu sample"))
+ : wxFrame((wxFrame *)NULL, wxID_ANY, wxT("wxWidgets menu sample"))
{
SetIcon(wxICON(sample));
stockSubMenu->Append(wxID_ZOOM_FIT);
stockSubMenu->Append(wxID_ZOOM_IN);
stockSubMenu->Append(wxID_ZOOM_OUT);
- fileMenu->AppendSubMenu(stockSubMenu, _T("&Standard items demo"));
+ fileMenu->AppendSubMenu(stockSubMenu, wxT("&Standard items demo"));
#if USE_LOG_WINDOW
wxMenuItem *item = new wxMenuItem(fileMenu, Menu_File_ClearLog,
- _T("Clear &log\tCtrl-L"));
+ wxT("Clear &log\tCtrl-L"));
#if wxUSE_OWNER_DRAWN || defined(__WXGTK__)
item->SetBitmap(copy_xpm);
#endif
fileMenu->AppendSeparator();
#endif // USE_LOG_WINDOW
- fileMenu->Append(Menu_File_Quit, _T("E&xit\tAlt-X"), _T("Quit menu sample"));
+ fileMenu->Append(Menu_File_Quit, wxT("E&xit\tAlt-X"), wxT("Quit menu sample"));
wxMenu *menubarMenu = new wxMenu;
- menubarMenu->Append(Menu_MenuBar_Append, _T("&Append menu\tCtrl-A"),
- _T("Append a menu to the menubar"));
- menubarMenu->Append(Menu_MenuBar_Insert, _T("&Insert menu\tCtrl-I"),
- _T("Insert a menu into the menubar"));
- menubarMenu->Append(Menu_MenuBar_Delete, _T("&Delete menu\tCtrl-D"),
- _T("Delete the last menu from the menubar"));
- menubarMenu->Append(Menu_MenuBar_Toggle, _T("&Toggle menu\tCtrl-T"),
- _T("Toggle the first menu in the menubar"), true);
+ menubarMenu->Append(Menu_MenuBar_Append, wxT("&Append menu\tCtrl-A"),
+ wxT("Append a menu to the menubar"));
+ menubarMenu->Append(Menu_MenuBar_Insert, wxT("&Insert menu\tCtrl-I"),
+ wxT("Insert a menu into the menubar"));
+ menubarMenu->Append(Menu_MenuBar_Delete, wxT("&Delete menu\tCtrl-D"),
+ wxT("Delete the last menu from the menubar"));
+ menubarMenu->Append(Menu_MenuBar_Toggle, wxT("&Toggle menu\tCtrl-T"),
+ wxT("Toggle the first menu in the menubar"), true);
menubarMenu->AppendSeparator();
- menubarMenu->Append(Menu_MenuBar_Enable, _T("&Enable menu\tCtrl-E"),
- _T("Enable or disable the last menu"), true);
+ menubarMenu->Append(Menu_MenuBar_Enable, wxT("&Enable menu\tCtrl-E"),
+ wxT("Enable or disable the last menu"), true);
menubarMenu->AppendSeparator();
- menubarMenu->Append(Menu_MenuBar_GetLabel, _T("&Get menu label\tCtrl-G"),
- _T("Get the label of the last menu"));
+ menubarMenu->Append(Menu_MenuBar_GetLabel, wxT("&Get menu label\tCtrl-G"),
+ wxT("Get the label of the last menu"));
#if wxUSE_TEXTDLG
- menubarMenu->Append(Menu_MenuBar_SetLabel, _T("&Set menu label\tCtrl-S"),
- _T("Change the label of the last menu"));
+ menubarMenu->Append(Menu_MenuBar_SetLabel, wxT("&Set menu label\tCtrl-S"),
+ wxT("Change the label of the last menu"));
menubarMenu->AppendSeparator();
- menubarMenu->Append(Menu_MenuBar_FindMenu, _T("&Find menu from label\tCtrl-F"),
- _T("Find a menu by searching for its label"));
+ menubarMenu->Append(Menu_MenuBar_FindMenu, wxT("&Find menu from label\tCtrl-F"),
+ wxT("Find a menu by searching for its label"));
#endif
wxMenu* subMenu = new wxMenu;
- subMenu->Append(Menu_SubMenu_Normal, _T("&Normal submenu item"), _T("Disabled submenu item"));
- subMenu->AppendCheckItem(Menu_SubMenu_Check, _T("&Check submenu item"), _T("Check submenu item"));
- subMenu->AppendRadioItem(Menu_SubMenu_Radio1, _T("Radio item &1"), _T("Radio item"));
- subMenu->AppendRadioItem(Menu_SubMenu_Radio2, _T("Radio item &2"), _T("Radio item"));
- subMenu->AppendRadioItem(Menu_SubMenu_Radio3, _T("Radio item &3"), _T("Radio item"));
+ subMenu->Append(Menu_SubMenu_Normal, wxT("&Normal submenu item"), wxT("Disabled submenu item"));
+ subMenu->AppendCheckItem(Menu_SubMenu_Check, wxT("&Check submenu item"), wxT("Check submenu item"));
+ subMenu->AppendRadioItem(Menu_SubMenu_Radio1, wxT("Radio item &1"), wxT("Radio item"));
+ subMenu->AppendRadioItem(Menu_SubMenu_Radio2, wxT("Radio item &2"), wxT("Radio item"));
+ subMenu->AppendRadioItem(Menu_SubMenu_Radio3, wxT("Radio item &3"), wxT("Radio item"));
- menubarMenu->Append(Menu_SubMenu, _T("Submenu"), subMenu);
+ menubarMenu->Append(Menu_SubMenu, wxT("Submenu"), subMenu);
wxMenu *menuMenu = new wxMenu;
- menuMenu->Append(Menu_Menu_Append, _T("&Append menu item\tAlt-A"),
- _T("Append a menu item to the last menu"));
- menuMenu->Append(Menu_Menu_AppendSub, _T("&Append sub menu\tAlt-S"),
- _T("Append a sub menu to the last menu"));
- menuMenu->Append(Menu_Menu_Insert, _T("&Insert menu item\tAlt-I"),
- _T("Insert a menu item in head of the last menu"));
- menuMenu->Append(Menu_Menu_Delete, _T("&Delete menu item\tAlt-D"),
- _T("Delete the last menu item from the last menu"));
+ menuMenu->Append(Menu_Menu_Append, wxT("&Append menu item\tAlt-A"),
+ wxT("Append a menu item to the last menu"));
+ menuMenu->Append(Menu_Menu_AppendSub, wxT("&Append sub menu\tAlt-S"),
+ wxT("Append a sub menu to the last menu"));
+ menuMenu->Append(Menu_Menu_Insert, wxT("&Insert menu item\tAlt-I"),
+ wxT("Insert a menu item in head of the last menu"));
+ menuMenu->Append(Menu_Menu_Delete, wxT("&Delete menu item\tAlt-D"),
+ wxT("Delete the last menu item from the last menu"));
menuMenu->AppendSeparator();
- menuMenu->Append(Menu_Menu_Enable, _T("&Enable menu item\tAlt-E"),
- _T("Enable or disable the last menu item"), true);
- menuMenu->Append(Menu_Menu_Check, _T("&Check menu item\tAlt-C"),
- _T("Check or uncheck the last menu item"), true);
+ menuMenu->Append(Menu_Menu_Enable, wxT("&Enable menu item\tAlt-E"),
+ wxT("Enable or disable the last menu item"), true);
+ menuMenu->Append(Menu_Menu_Check, wxT("&Check menu item\tAlt-C"),
+ wxT("Check or uncheck the last menu item"), true);
menuMenu->AppendSeparator();
- menuMenu->Append(Menu_Menu_GetInfo, _T("Get menu item in&fo\tAlt-F"),
- _T("Show the state of the last menu item"));
+ menuMenu->Append(Menu_Menu_GetInfo, wxT("Get menu item in&fo\tAlt-F"),
+ wxT("Show the state of the last menu item"));
#if wxUSE_TEXTDLG
- menuMenu->Append(Menu_Menu_SetLabel, _T("Set menu item label\tAlt-L"),
- _T("Set the label of a menu item"));
+ menuMenu->Append(Menu_Menu_SetLabel, wxT("Set menu item label\tAlt-L"),
+ wxT("Set the label of a menu item"));
#endif
#if wxUSE_TEXTDLG
menuMenu->AppendSeparator();
- menuMenu->Append(Menu_Menu_FindItem, _T("Find menu item from label"),
- _T("Find a menu item by searching for its label"));
+ menuMenu->Append(Menu_Menu_FindItem, wxT("Find menu item from label"),
+ wxT("Find a menu item by searching for its label"));
#endif
wxMenu *testMenu = new wxMenu;
- testMenu->Append(Menu_Test_Normal, _T("&Normal item"));
+ testMenu->Append(Menu_Test_Normal, wxT("&Normal item"));
testMenu->AppendSeparator();
- testMenu->AppendCheckItem(Menu_Test_Check, _T("&Check item"));
+ testMenu->AppendCheckItem(Menu_Test_Check, wxT("&Check item"));
testMenu->AppendSeparator();
- testMenu->AppendRadioItem(Menu_Test_Radio1, _T("Radio item &1"));
- testMenu->AppendRadioItem(Menu_Test_Radio2, _T("Radio item &2"));
- testMenu->AppendRadioItem(Menu_Test_Radio3, _T("Radio item &3"));
+ testMenu->AppendRadioItem(Menu_Test_Radio1, wxT("Radio item &1"));
+ testMenu->AppendRadioItem(Menu_Test_Radio2, wxT("Radio item &2"));
+ testMenu->AppendRadioItem(Menu_Test_Radio3, wxT("Radio item &3"));
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(Menu_Help_About, _T("&About\tF1"), _T("About menu sample"));
+ helpMenu->Append(Menu_Help_About, wxT("&About\tF1"), wxT("About menu sample"));
wxMenuBar* menuBar = new wxMenuBar( wxMB_DOCKABLE );
- menuBar->Append(fileMenu, _T("&File"));
- menuBar->Append(menubarMenu, _T("Menu&bar"));
- menuBar->Append(menuMenu, _T("&Menu"));
- menuBar->Append(testMenu, _T("&Test"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(fileMenu, wxT("&File"));
+ menuBar->Append(menubarMenu, wxT("Menu&bar"));
+ menuBar->Append(menuMenu, wxT("&Menu"));
+ menuBar->Append(testMenu, wxT("&Test"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// these items should be initially checked
menuBar->Check(Menu_MenuBar_Toggle, true);
wxLog::DisableTimestamp();
m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_textctrl));
- wxLogMessage(_T("Brief explanations: the commands or the \"Menu\" menu ")
- _T("append/insert/delete items to/from the last menu.\n")
- _T("The commands from \"Menubar\" menu work with the ")
- _T("menubar itself.\n\n")
- _T("Right click the band below to test popup menus.\n"));
+ wxLogMessage(wxT("Brief explanations: the commands or the \"Menu\" menu ")
+ wxT("append/insert/delete items to/from the last menu.\n")
+ wxT("The commands from \"Menubar\" menu work with the ")
+ wxT("menubar itself.\n\n")
+ wxT("Right click the band below to test popup menus.\n"));
#endif
#ifdef __POCKETPC__
EnableContextMenu();
wxMenu *MyFrame::CreateDummyMenu(wxString *title)
{
wxMenu *menu = new wxMenu;
- menu->Append(Menu_Dummy_First, _T("&First item\tCtrl-F1"));
+ menu->Append(Menu_Dummy_First, wxT("&First item\tCtrl-F1"));
menu->AppendSeparator();
- menu->AppendCheckItem(Menu_Dummy_Second, _T("&Second item\tCtrl-F2"));
+ menu->AppendCheckItem(Menu_Dummy_Second, wxT("&Second item\tCtrl-F2"));
if ( title )
{
- title->Printf(_T("Dummy menu &%u"), (unsigned)++m_countDummy);
+ title->Printf(wxT("Dummy menu &%u"), (unsigned)++m_countDummy);
}
return menu;
wxMenuItemList::compatibility_iterator node = menu->GetMenuItems().GetLast();
if ( !node )
{
- wxLogWarning(_T("No last item in the last menu!"));
+ wxLogWarning(wxT("No last item in the last menu!"));
return NULL;
}
{
int id = event.GetId();
- wxString msg = wxString::Format(_T("Menu command %d"), id);
+ wxString msg = wxString::Format(wxT("Menu command %d"), id);
// catch all checkable menubar items and also the check item from the popup
// menu
wxMenuItem *item = GetMenuBar()->FindItem(id);
if ( (item && item->IsCheckable()) || id == Menu_Popup_ToBeChecked )
{
- msg += wxString::Format(_T(" (the item is currently %schecked)"),
- event.IsChecked() ? _T("") : _T("not "));
+ msg += wxString::Format(wxT(" (the item is currently %schecked)"),
+ event.IsChecked() ? wxT("") : wxT("not "));
}
wxLogMessage(msg);
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- (void)wxMessageBox(_T("wxWidgets menu sample\n(c) 1999-2001 Vadim Zeitlin"),
- _T("About wxWidgets menu sample"),
+ (void)wxMessageBox(wxT("wxWidgets menu sample\n(c) 1999-2001 Vadim Zeitlin"),
+ wxT("About wxWidgets menu sample"),
wxOK | wxICON_INFORMATION);
}
if ( count == 2 )
{
// don't let delete the first 2 menus
- wxLogError(_T("Can't delete any more menus"));
+ wxLogError(wxT("Can't delete any more menus"));
}
else
{
else
{
// restore it
- mbar->Insert(0, m_menu, _T("&File"));
+ mbar->Insert(0, m_menu, wxT("&File"));
m_menu = NULL;
}
}
wxMenuBar *mbar = GetMenuBar();
size_t count = mbar->GetMenuCount();
- wxCHECK_RET( count, _T("no last menu?") );
+ wxCHECK_RET( count, wxT("no last menu?") );
- wxLogMessage(_T("The label of the last menu item is '%s'"),
+ wxLogMessage(wxT("The label of the last menu item is '%s'"),
mbar->GetMenuLabel(count - 1).c_str());
}
wxMenuBar *mbar = GetMenuBar();
size_t count = mbar->GetMenuCount();
- wxCHECK_RET( count, _T("no last menu?") );
+ wxCHECK_RET( count, wxT("no last menu?") );
wxString label = wxGetTextFromUser
(
- _T("Enter new label: "),
- _T("Change last menu text"),
+ wxT("Enter new label: "),
+ wxT("Change last menu text"),
mbar->GetMenuLabel(count - 1),
this
);
wxMenuBar *mbar = GetMenuBar();
size_t count = mbar->GetMenuCount();
- wxCHECK_RET( count, _T("no last menu?") );
+ wxCHECK_RET( count, wxT("no last menu?") );
wxString label = wxGetTextFromUser
(
- _T("Enter label to search for: "),
- _T("Find menu"),
+ wxT("Enter label to search for: "),
+ wxT("Find menu"),
wxEmptyString,
this
);
if (index == wxNOT_FOUND)
{
- wxLogWarning(_T("No menu with label '%s'"), label.c_str());
+ wxLogWarning(wxT("No menu with label '%s'"), label.c_str());
}
else
{
- wxLogMessage(_T("Menu %d has label '%s'"), index, label.c_str());
+ wxLogMessage(wxT("Menu %d has label '%s'"), index, label.c_str());
}
}
}
void MyFrame::OnDummy(wxCommandEvent& event)
{
- wxLogMessage(_T("Dummy item #%d"), event.GetId() - Menu_Dummy_First + 1);
+ wxLogMessage(wxT("Dummy item #%d"), event.GetId() - Menu_Dummy_First + 1);
}
void MyFrame::OnAppendMenuItem(wxCommandEvent& WXUNUSED(event))
wxMenu *menu = menubar->GetMenu(menubar->GetMenuCount() - 1);
menu->AppendSeparator();
- menu->Append(Menu_Dummy_Third, _T("&Third dummy item\tCtrl-F3"),
- _T("Checkable item"), true);
+ menu->Append(Menu_Dummy_Third, wxT("&Third dummy item\tCtrl-F3"),
+ wxT("Checkable item"), true);
}
void MyFrame::OnAppendSubMenu(wxCommandEvent& WXUNUSED(event))
wxMenu *menu = menubar->GetMenu(menubar->GetMenuCount() - 2);
- menu->Append(Menu_Dummy_Last, _T("&Dummy sub menu"),
- CreateDummyMenu(NULL), _T("Dummy sub menu help"));
+ menu->Append(Menu_Dummy_Last, wxT("&Dummy sub menu"),
+ CreateDummyMenu(NULL), wxT("Dummy sub menu help"));
}
void MyFrame::OnDeleteMenuItem(wxCommandEvent& WXUNUSED(event))
size_t count = menu->GetMenuItemCount();
if ( !count )
{
- wxLogWarning(_T("No items to delete!"));
+ wxLogWarning(wxT("No items to delete!"));
}
else
{
wxMenu *menu = menubar->GetMenu(menubar->GetMenuCount() - 1);
menu->Insert(0, wxMenuItem::New(menu, Menu_Dummy_Fourth,
- _T("Fourth dummy item\tCtrl-F4")));
+ wxT("Fourth dummy item\tCtrl-F4")));
menu->Insert(1, wxMenuItem::New(menu, wxID_SEPARATOR));
}
if ( item )
{
wxString label = item->GetItemLabel();
- wxLogMessage(_T("The label of the last menu item is '%s'"),
+ wxLogMessage(wxT("The label of the last menu item is '%s'"),
label.c_str());
}
}
{
wxString label = wxGetTextFromUser
(
- _T("Enter new label: "),
- _T("Change last menu item text"),
+ wxT("Enter new label: "),
+ wxT("Change last menu item text"),
item->GetItemLabel(),
this
);
- label.Replace( _T("\\t"), _T("\t") );
+ label.Replace( wxT("\\t"), wxT("\t") );
if ( !label.empty() )
{
if ( item )
{
wxString msg;
- msg << _T("The item is ") << (item->IsEnabled() ? _T("enabled")
- : _T("disabled"))
- << _T('\n');
+ msg << wxT("The item is ") << (item->IsEnabled() ? wxT("enabled")
+ : wxT("disabled"))
+ << wxT('\n');
if ( item->IsCheckable() )
{
- msg << _T("It is checkable and ") << (item->IsChecked() ? _T("") : _T("un"))
- << _T("checked\n");
+ msg << wxT("It is checkable and ") << (item->IsChecked() ? wxT("") : wxT("un"))
+ << wxT("checked\n");
}
#if wxUSE_ACCEL
wxAcceleratorEntry *accel = item->GetAccel();
if ( accel )
{
- msg << _T("Its accelerator is ");
+ msg << wxT("Its accelerator is ");
int flags = accel->GetFlags();
if ( flags & wxACCEL_ALT )
- msg << _T("Alt-");
+ msg << wxT("Alt-");
if ( flags & wxACCEL_CTRL )
- msg << _T("Ctrl-");
+ msg << wxT("Ctrl-");
if ( flags & wxACCEL_SHIFT )
- msg << _T("Shift-");
+ msg << wxT("Shift-");
int code = accel->GetKeyCode();
switch ( code )
case WXK_F10:
case WXK_F11:
case WXK_F12:
- msg << _T('F') << code - WXK_F1 + 1;
+ msg << wxT('F') << code - WXK_F1 + 1;
break;
// if there are any other keys wxGetAccelFromString() may return,
break;
}
- wxFAIL_MSG( _T("unknown keyboard accel") );
+ wxFAIL_MSG( wxT("unknown keyboard accel") );
}
delete accel;
}
else
{
- msg << _T("It doesn't have an accelerator");
+ msg << wxT("It doesn't have an accelerator");
}
#endif // wxUSE_ACCEL
wxMenuBar *mbar = GetMenuBar();
size_t count = mbar->GetMenuCount();
- wxCHECK_RET( count, _T("no last menu?") );
+ wxCHECK_RET( count, wxT("no last menu?") );
wxString label = wxGetTextFromUser
(
- _T("Enter label to search for: "),
- _T("Find menu item"),
+ wxT("Enter label to search for: "),
+ wxT("Find menu item"),
wxEmptyString,
this
);
}
if (index == wxNOT_FOUND)
{
- wxLogWarning(_T("No menu item with label '%s'"), label.c_str());
+ wxLogWarning(wxT("No menu item with label '%s'"), label.c_str());
}
else
{
- wxLogMessage(_T("Menu item %d in menu %lu has label '%s'"),
+ wxLogMessage(wxT("Menu item %d in menu %lu has label '%s'"),
index, (unsigned long)menuindex, label.c_str());
}
}
}
else // normal case, shift not pressed
{
- menu.Append(Menu_Help_About, _T("&About"));
- menu.Append(Menu_Popup_Submenu, _T("&Submenu"), CreateDummyMenu(NULL));
- menu.Append(Menu_Popup_ToBeDeleted, _T("To be &deleted"));
- menu.AppendCheckItem(Menu_Popup_ToBeChecked, _T("To be &checked"));
- menu.Append(Menu_Popup_ToBeGreyed, _T("To be &greyed"),
- _T("This menu item should be initially greyed out"));
+ menu.Append(Menu_Help_About, wxT("&About"));
+ menu.Append(Menu_Popup_Submenu, wxT("&Submenu"), CreateDummyMenu(NULL));
+ menu.Append(Menu_Popup_ToBeDeleted, wxT("To be &deleted"));
+ menu.AppendCheckItem(Menu_Popup_ToBeChecked, wxT("To be &checked"));
+ menu.Append(Menu_Popup_ToBeGreyed, wxT("To be &greyed"),
+ wxT("This menu item should be initially greyed out"));
menu.AppendSeparator();
- menu.Append(Menu_File_Quit, _T("E&xit"));
+ menu.Append(Menu_File_Quit, wxT("E&xit"));
menu.Delete(Menu_Popup_ToBeDeleted);
menu.Check(Menu_Popup_ToBeChecked, true);
void MyFrame::OnTestNormal(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("Normal item selected"));
+ wxLogMessage(wxT("Normal item selected"));
}
void MyFrame::OnTestCheck(wxCommandEvent& event)
{
- wxLogMessage(_T("Check item %schecked"),
- event.IsChecked() ? _T("") : _T("un"));
+ wxLogMessage(wxT("Check item %schecked"),
+ event.IsChecked() ? wxT("") : wxT("un"));
}
void MyFrame::OnTestRadio(wxCommandEvent& event)
{
- wxLogMessage(_T("Radio item %d selected"),
+ wxLogMessage(wxT("Radio item %d selected"),
event.GetId() - Menu_Test_Radio1 + 1);
}
void MyFrame::LogMenuOpenOrClose(const wxMenuEvent& event, const wxChar *what)
{
wxString msg;
- msg << _T("A ")
- << ( event.IsPopup() ? _T("popup ") : _T("") )
- << _T("menu has been ")
+ msg << wxT("A ")
+ << ( event.IsPopup() ? wxT("popup ") : wxT("") )
+ << wxT("menu has been ")
<< what
- << _T(".");
+ << wxT(".");
wxLogStatus(this, msg.c_str());
}
CMainWindow::CMainWindow()
{
- LoadAccelTable( _T("MainAccelTable") );
- Create( NULL, _T("Hello Foundation Application"),
- WS_OVERLAPPEDWINDOW, rectDefault, NULL, _T("MainMenu") );
+ LoadAccelTable( wxT("MainAccelTable") );
+ Create( NULL, wxT("Hello Foundation Application"),
+ WS_OVERLAPPEDWINDOW, rectDefault, NULL, wxT("MainMenu") );
}
void CMainWindow::OnPaint()
{
- CString s = _T("Hello, Windows!");
+ CString s = wxT("Hello, Windows!");
CPaintDC dc( this );
CRect rect;
void CMainWindow::OnAbout()
{
- CDialog about( _T("AboutBox"), this );
+ CDialog about( wxT("AboutBox"), this );
about.DoModal();
}
void CMainWindow::OnTest()
{
- wxMessageBox(_T("This is a wxWidgets message box.\nWe're about to create a new wxWidgets frame."), _T("wxWidgets"), wxOK);
+ wxMessageBox(wxT("This is a wxWidgets message box.\nWe're about to create a new wxWidgets frame."), wxT("wxWidgets"), wxOK);
wxGetApp().CreateFrame();
}
wxFrame *MyApp::CreateFrame()
{
- MyChild *subframe = new MyChild(NULL, _T("Canvas Frame"), wxPoint(10, 10), wxSize(300, 300),
+ MyChild *subframe = new MyChild(NULL, wxT("Canvas Frame"), wxPoint(10, 10), wxSize(300, 300),
wxDEFAULT_FRAME_STYLE);
- subframe->SetTitle(_T("wxWidgets canvas frame"));
+ subframe->SetTitle(wxT("wxWidgets canvas frame"));
// Give it a status line
subframe->CreateStatusBar();
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(HELLO_NEW, _T("&New MFC Window"));
- file_menu->Append(HELLO_QUIT, _T("&Close"));
+ file_menu->Append(HELLO_NEW, wxT("&New MFC Window"));
+ file_menu->Append(HELLO_QUIT, wxT("&Close"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
+ menu_bar->Append(file_menu, wxT("&File"));
// Associate the menu bar with the frame
subframe->SetMenuBar(menu_bar);
dc.DrawEllipse(250, 250, 100, 50);
dc.DrawLine(50, 230, 200, 230);
- dc.DrawText(_T("This is a test string"), 50, 230);
+ dc.DrawText(wxT("This is a test string"), 50, 230);
}
// This implements a tiny doodling program! Drag the mouse using
return false;
// Create the main frame window
- MyFrame *frame = new MyFrame(NULL, wxID_ANY, _T("wxWidgets Native Dialog Sample"), wxPoint(0, 0), wxSize(300, 250));
+ MyFrame *frame = new MyFrame(NULL, wxID_ANY, wxT("wxWidgets Native Dialog Sample"), wxPoint(0, 0), wxSize(300, 250));
#if wxUSE_STATUSBAR
// Give it a status line
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(RESOURCE_TEST1, _T("&Dialog box test"), _T("Test dialog box resource"));
- file_menu->Append(RESOURCE_QUIT, _T("E&xit"), _T("Quit program"));
+ file_menu->Append(RESOURCE_TEST1, wxT("&Dialog box test"), wxT("Test dialog box resource"));
+ file_menu->Append(RESOURCE_QUIT, wxT("E&xit"), wxT("Quit program"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
+ menu_bar->Append(file_menu, wxT("&File"));
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
// Make a panel
- frame->panel = new wxWindow(frame, wxID_ANY, wxPoint(0, 0), wxSize(400, 400), 0, _T("MyMainFrame"));
+ frame->panel = new wxWindow(frame, wxID_ANY, wxPoint(0, 0), wxSize(400, 400), 0, wxT("MyMainFrame"));
frame->Show(true);
// Return the main frame window
{
#if ( defined(__WXPM__) || defined(__WXMSW__) ) && !defined(__WXUNIVERSAL__)
MyDialog dialog;
- if (dialog.LoadNativeDialog(this, _T("dialog1")))
+ if (dialog.LoadNativeDialog(this, wxT("dialog1")))
{
dialog.ShowModal();
}
#else
- wxMessageBox(_T("No native dialog support"),_T("Platform limitation"));
+ wxMessageBox(wxT("No native dialog support"),wxT("Platform limitation"));
#endif
}
if ( pageName == MAXIMIZED_BUTTON_PAGE_NAME )
return CreateBigButtonPage(parent);
- wxFAIL_MSG( _T("unknown page name") );
+ wxFAIL_MSG( wxT("unknown page name") );
return NULL;
}
CASE_TOOLBOOK(before toolb after) \
\
default: \
- wxFAIL_MSG( _T("unknown book control type") ); \
+ wxFAIL_MSG( wxT("unknown book control type") ); \
}
int MyFrame::TranslateBookFlag(int nb, int lb, int chb, int tbk, int toolbk) const
if( (flags & flag) == flag )
{
if( !flagStr.empty() )
- flagStr += _T(" | ");
+ flagStr += wxT(" | ");
flagStr += flagName;
}
}
wxString flagsStr;
- AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_NOWHERE, _T("wxBK_HITTEST_NOWHERE") );
- AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONICON, _T("wxBK_HITTEST_ONICON") );
- AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONLABEL, _T("wxBK_HITTEST_ONLABEL") );
- AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONPAGE, _T("wxBK_HITTEST_ONPAGE") );
+ AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_NOWHERE, wxT("wxBK_HITTEST_NOWHERE") );
+ AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONICON, wxT("wxBK_HITTEST_ONICON") );
+ AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONLABEL, wxT("wxBK_HITTEST_ONLABEL") );
+ AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONPAGE, wxT("wxBK_HITTEST_ONPAGE") );
wxLogMessage(wxT("HitTest at (%d,%d): %d: %s"),
pt.x,
m_multi = event.IsChecked();
RecreateBook();
m_sizerFrame->Layout();
- wxLogMessage(_T("Multiline setting works only in wxNotebook."));
+ wxLogMessage(wxT("Multiline setting works only in wxNotebook."));
}
void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event))
const int selPos = currBook->GetSelection();
if ( selPos == wxNOT_FOUND )
{
- wxLogError(_T("Select the parent page first!"));
+ wxLogError(wxT("Select the parent page first!"));
return;
}
const int selPos = currBook->GetSelection();
if ( selPos == wxNOT_FOUND )
{
- wxLogError(_T("Select the parent page first!"));
+ wxLogError(wxT("Select the parent page first!"));
return;
}
{
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING,
- _T("wxNotebook")
+ wxT("wxNotebook")
},
#endif // wxUSE_NOTEBOOK
#if wxUSE_LISTBOOK
{
wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED,
wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING,
- _T("wxListbook")
+ wxT("wxListbook")
},
#endif // wxUSE_LISTBOOK
#if wxUSE_CHOICEBOOK
{
wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED,
wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING,
- _T("wxChoicebook")
+ wxT("wxChoicebook")
},
#endif // wxUSE_CHOICEBOOK
#if wxUSE_TREEBOOK
{
wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED,
wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING,
- _T("wxTreebook")
+ wxT("wxTreebook")
},
#endif // wxUSE_TREEBOOK
#if wxUSE_TOOLBOOK
{
wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED,
wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING,
- _T("wxToolbook")
+ wxT("wxToolbook")
},
#endif // wxUSE_TOOLBOOK
};
) != wxYES )
{
event.Veto();
- veto = _T(" (vetoed)");
+ veto = wxT(" (vetoed)");
}
}
return false;
// Create the main application window
- MyFrame *frame = new MyFrame(_T("OleAuto wxWidgets App"),
+ MyFrame *frame = new MyFrame(wxT("OleAuto wxWidgets App"),
wxPoint(50, 50), wxSize(450, 340));
// Show it and tell the application that it's our main window
// create a menu bar
wxMenu *menuFile = new wxMenu;
- menuFile->Append(OleAuto_Test, _T("&Test Excel Automation..."));
- menuFile->Append(OleAuto_About, _T("&About..."));
+ menuFile->Append(OleAuto_Test, wxT("&Test Excel Automation..."));
+ menuFile->Append(OleAuto_About, wxT("&About..."));
menuFile->AppendSeparator();
- menuFile->Append(OleAuto_Quit, _T("E&xit"));
+ menuFile->Append(OleAuto_Quit, wxT("E&xit"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(menuFile, _T("&File"));
+ menuBar->Append(menuFile, wxT("&File"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWidgets!"));
+ SetStatusText(wxT("Welcome to wxWidgets!"));
#endif // wxUSE_STATUSBAR
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("This is an OLE Automation sample"),
- _T("About OleAuto"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(wxT("This is an OLE Automation sample"),
+ wxT("About OleAuto"), wxOK | wxICON_INFORMATION, this);
}
/* Tests OLE automation by making the active Excel cell bold,
*/
void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("Please ensure Excel is running, then press OK.\nThe active cell should then say 'wxWidgets automation test!' in bold."));
+ wxMessageBox(wxT("Please ensure Excel is running, then press OK.\nThe active cell should then say 'wxWidgets automation test!' in bold."));
wxAutomationObject excelObject, rangeObject;
- if (!excelObject.GetInstance(_T("Excel.Application")))
+ if (!excelObject.GetInstance(wxT("Excel.Application")))
{
// Start Excel if it is not running
- if (!excelObject.CreateInstance(_T("Excel.Application")))
+ if (!excelObject.CreateInstance(wxT("Excel.Application")))
{
- wxMessageBox(_T("Could not create Excel object."));
+ wxMessageBox(wxT("Could not create Excel object."));
return;
}
}
// Ensure that Excel is visible
- if (!excelObject.PutProperty(_T("Visible"), true))
+ if (!excelObject.PutProperty(wxT("Visible"), true))
{
- wxMessageBox(_T("Could not make Excel object visible"));
+ wxMessageBox(wxT("Could not make Excel object visible"));
}
- const wxVariant workbooksCountVariant = excelObject.GetProperty(_T("Workbooks.Count"));
+ const wxVariant workbooksCountVariant = excelObject.GetProperty(wxT("Workbooks.Count"));
if (workbooksCountVariant.IsNull())
{
- wxMessageBox(_T("Could not get workbooks count"));
+ wxMessageBox(wxT("Could not get workbooks count"));
return;
}
const long workbooksCount = workbooksCountVariant;
if (workbooksCount == 0)
{
- const wxVariant workbook = excelObject.CallMethod(_T("Workbooks.Add"));
+ const wxVariant workbook = excelObject.CallMethod(wxT("Workbooks.Add"));
if (workbook.IsNull())
{
- wxMessageBox(_T("Could not create new Workbook"));
+ wxMessageBox(wxT("Could not create new Workbook"));
return;
}
}
- if (!excelObject.PutProperty(_T("ActiveCell.Value"), _T("wxWidgets automation test!")))
+ if (!excelObject.PutProperty(wxT("ActiveCell.Value"), wxT("wxWidgets automation test!")))
{
- wxMessageBox(_T("Could not set active cell value."));
+ wxMessageBox(wxT("Could not set active cell value."));
return;
}
- if (!excelObject.PutProperty(_T("ActiveCell.Font.Bold"), wxVariant(true)) )
+ if (!excelObject.PutProperty(wxT("ActiveCell.Font.Bold"), wxVariant(true)) )
{
- wxMessageBox(_T("Could not put Bold property to active cell."));
+ wxMessageBox(wxT("Could not put Bold property to active cell."));
return;
}
}
// so check that we get a different error than the last time
if ( err == errLast )
{
- wxLogError(_T("OpenGL error state couldn't be reset."));
+ wxLogError(wxT("OpenGL error state couldn't be reset."));
return;
}
errLast = err;
- wxLogError(_T("OpenGL error %d"), err);
+ wxLogError(wxT("OpenGL error %d"), err);
}
}
// function to draw the texture for cube faces
static wxImage DrawDice(int size, unsigned num)
{
- wxASSERT_MSG( num >= 1 && num <= 6, _T("invalid dice index") );
+ wxASSERT_MSG( num >= 1 && num <= 6, wxT("invalid dice index") );
const int dot = size/16; // radius of a single dot
const int gap = 5*size/32; // gap between dots
END_EVENT_TABLE()
MyFrame::MyFrame()
- : wxFrame(NULL, wxID_ANY, _T("wxWidgets OpenGL Cube Sample"))
+ : wxFrame(NULL, wxID_ANY, wxT("wxWidgets OpenGL Cube Sample"))
{
new TestGLCanvas(this);
menu->AppendSeparator();
menu->Append(wxID_CLOSE);
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(menu, _T("&Cube"));
+ menuBar->Append(menu, wxT("&Cube"));
SetMenuBar(menuBar);
// Make a menubar
wxMenu *fileMenu = new wxMenu;
- fileMenu->Append(wxID_EXIT, _T("E&xit"));
+ fileMenu->Append(wxID_EXIT, wxT("E&xit"));
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(fileMenu, _T("&File"));
+ menuBar->Append(fileMenu, wxT("&File"));
SetMenuBar(menuBar);
delete stream;
- wxLogMessage(_T("Loaded %d vertices, %d triangles from '%s'"),
+ wxLogMessage(wxT("Loaded %d vertices, %d triangles from '%s'"),
m_numverts, m_numverts-2, filename.c_str());
// NOTE: for some reason under wxGTK the following is required to avoid that
return false;
OwnerDrawnFrame *pFrame
- = new OwnerDrawnFrame(NULL, _T("wxWidgets Ownerdraw Sample"),
+ = new OwnerDrawnFrame(NULL, wxT("wxWidgets Ownerdraw Sample"),
50, 50, 450, 340);
SetTopWindow(pFrame);
fontBmp(14, wxDEFAULT, wxNORMAL, wxNORMAL, false);
// sorry for my artistic skills...
- wxBitmap bmpBell(_T("bell")),
- bmpSound(_T("sound")),
- bmpNoSound(_T("nosound")),
- bmpInfo(_T("info")),
- bmpInfo_mono(_T("info_mono"));
+ wxBitmap bmpBell(wxT("bell")),
+ bmpSound(wxT("sound")),
+ bmpNoSound(wxT("nosound")),
+ bmpInfo(wxT("info")),
+ bmpInfo_mono(wxT("info_mono"));
// construct submenu
- pItem = new wxMenuItem(sub_menu, Menu_Sub1, _T("Submenu &first"), _T("large"));
+ pItem = new wxMenuItem(sub_menu, Menu_Sub1, wxT("Submenu &first"), wxT("large"));
pItem->SetFont(fontLarge);
sub_menu->Append(pItem);
- pItem = new wxMenuItem(sub_menu, Menu_Sub2, _T("Submenu &second"), _T("italic"),
+ pItem = new wxMenuItem(sub_menu, Menu_Sub2, wxT("Submenu &second"), wxT("italic"),
wxITEM_CHECK);
pItem->SetFont(fontItalic);
sub_menu->Append(pItem);
- pItem = new wxMenuItem(sub_menu, Menu_Sub3, _T("Submenu &third"), _T("underlined"),
+ pItem = new wxMenuItem(sub_menu, Menu_Sub3, wxT("Submenu &third"), wxT("underlined"),
wxITEM_CHECK);
pItem->SetFont(fontUlined);
sub_menu->Append(pItem);
// construct menu
- pItem = new wxMenuItem(file_menu, Menu_Test1, _T("&Uncheckable"), _T("red item"));
+ pItem = new wxMenuItem(file_menu, Menu_Test1, wxT("&Uncheckable"), wxT("red item"));
pItem->SetFont(*wxITALIC_FONT);
pItem->SetTextColour(wxColor(255, 0, 0));
file_menu->Append(pItem);
- pItem = new wxMenuItem(file_menu, Menu_Test2, _T("&Checkable"),
- _T("checkable item"), wxITEM_CHECK);
+ pItem = new wxMenuItem(file_menu, Menu_Test2, wxT("&Checkable"),
+ wxT("checkable item"), wxITEM_CHECK);
pItem->SetFont(*wxSMALL_FONT);
file_menu->Append(pItem);
file_menu->Check(Menu_Test2, true);
- pItem = new wxMenuItem(file_menu, Menu_Test3, _T("&Disabled"), _T("disabled item"));
+ pItem = new wxMenuItem(file_menu, Menu_Test3, wxT("&Disabled"), wxT("disabled item"));
pItem->SetFont(*wxNORMAL_FONT);
file_menu->Append(pItem);
file_menu->Enable(Menu_Test3, false);
file_menu->AppendSeparator();
- pItem = new wxMenuItem(file_menu, Menu_Bitmap, _T("&Bell"),
- _T("check/uncheck me!"), wxITEM_CHECK);
+ pItem = new wxMenuItem(file_menu, Menu_Bitmap, wxT("&Bell"),
+ wxT("check/uncheck me!"), wxITEM_CHECK);
pItem->SetFont(fontBmp);
pItem->SetBitmaps(bmpBell);
file_menu->Append(pItem);
- pItem = new wxMenuItem(file_menu, Menu_Bitmap2, _T("So&und"),
- _T("icon changes!"), wxITEM_CHECK);
+ pItem = new wxMenuItem(file_menu, Menu_Bitmap2, wxT("So&und"),
+ wxT("icon changes!"), wxITEM_CHECK);
pItem->SetFont(fontBmp);
pItem->SetBitmaps(bmpSound, bmpNoSound);
file_menu->Append(pItem);
file_menu->AppendSeparator();
- pItem = new wxMenuItem(file_menu, Menu_Submenu, _T("&Sub menu"), _T(""),
+ pItem = new wxMenuItem(file_menu, Menu_Submenu, wxT("&Sub menu"), wxT(""),
wxITEM_CHECK, sub_menu);
pItem->SetFont(*wxSWISS_FONT);
file_menu->Append(pItem);
file_menu->AppendSeparator();
- pItem = new wxMenuItem(file_menu, Menu_Toggle, _T("&Disable/Enable\tCtrl+D"),
- _T("enables/disables the About-Item"), wxITEM_NORMAL);
+ pItem = new wxMenuItem(file_menu, Menu_Toggle, wxT("&Disable/Enable\tCtrl+D"),
+ wxT("enables/disables the About-Item"), wxITEM_NORMAL);
pItem->SetFont(*wxNORMAL_FONT);
file_menu->Append(pItem);
// Of course Ctrl+RatherLongAccel will not work in this example:
- pAboutItem = new wxMenuItem(file_menu, Menu_About, _T("&About\tCtrl+RatherLongAccel"),
- _T("display program information"), wxITEM_NORMAL);
+ pAboutItem = new wxMenuItem(file_menu, Menu_About, wxT("&About\tCtrl+RatherLongAccel"),
+ wxT("display program information"), wxITEM_NORMAL);
pAboutItem->SetBitmap(bmpInfo);
pAboutItem->SetDisabledBitmap(bmpInfo_mono);
file_menu->Append(pAboutItem);
file_menu->AppendSeparator();
#endif
- pItem = new wxMenuItem(file_menu, Menu_Quit, _T("&Quit"), _T("Normal item"),
+ pItem = new wxMenuItem(file_menu, Menu_Quit, wxT("&Quit"), wxT("Normal item"),
wxITEM_NORMAL);
file_menu->Append(pItem);
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
+ menu_bar->Append(file_menu, wxT("&File"));
SetMenuBar(menu_bar);
}
: wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
{
// set the icon
- SetIcon(wxIcon(_T("mondrian")));
+ SetIcon(wxIcon(wxT("mondrian")));
// create the menu
InitMenu();
const int widths[] = { -1, 60 };
CreateStatusBar(2);
SetStatusWidths(2, widths);
- SetStatusText(_T("no selection"), 0);
+ SetStatusText(wxT("no selection"), 0);
#endif // wxUSE_STATUSBAR
// make a panel with some controls
wxPanel *pPanel = new wxPanel(this);
// check list box
- static const wxChar* aszChoices[] = { _T("Hello"), _T("world"), _T("and"),
- _T("goodbye"), _T("cruel"), _T("world"),
- _T("-------"), _T("owner-drawn"), _T("listbox") };
+ static const wxChar* aszChoices[] = { wxT("Hello"), wxT("world"), wxT("and"),
+ wxT("goodbye"), wxT("cruel"), wxT("world"),
+ wxT("-------"), wxT("owner-drawn"), wxT("listbox") };
wxString *astrChoices = new wxString[WXSIZEOF(aszChoices)];
unsigned int ui;
m_pListBox->Check(2);
// normal (but owner-drawn) listbox
- static const wxChar* aszColors[] = { _T("Red"), _T("Blue"), _T("Pink"),
- _T("Green"), _T("Yellow"),
- _T("Black"), _T("Violet") };
+ static const wxChar* aszColors[] = { wxT("Red"), wxT("Blue"), wxT("Pink"),
+ wxT("Green"), wxT("Yellow"),
+ wxT("Black"), wxT("Violet") };
astrChoices = new wxString[WXSIZEOF(aszColors)];
void OwnerDrawnFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxMessageDialog dialog(this,
- _T("Demo of owner-drawn controls\n"),
- _T("About wxOwnerDrawn"), wxYES_NO | wxCANCEL);
+ wxT("Demo of owner-drawn controls\n"),
+ wxT("About wxOwnerDrawn"), wxYES_NO | wxCANCEL);
dialog.ShowModal();
}
return false;
// create the main application window
- m_frame = new MyFrame(_T("Popup wxWidgets App"));
+ m_frame = new MyFrame(wxT("Popup wxWidgets App"));
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(Minimal_About, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(Minimal_About, wxT("&About...\tF1"), wxT("Show about dialog"));
- menuFile->Append(Minimal_TestDialog, _T("&Test dialog\tAlt-T"), _T("Test dialog"));
- menuFile->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(Minimal_TestDialog, wxT("&Test dialog\tAlt-T"), wxT("Test dialog"));
+ menuFile->Append(Minimal_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWidgets!"));
+ SetStatusText(wxT("Welcome to wxWidgets!"));
#endif // wxUSE_STATUSBAR
wxPanel *panel = new wxPanel(this, -1);
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
- msg.Printf( _T("This is the About dialog of the popup sample.\n")
- _T("Welcome to %s"), wxVERSION_STRING);
+ msg.Printf( wxT("This is the About dialog of the popup sample.\n")
+ wxT("Welcome to %s"), wxVERSION_STRING);
- wxMessageBox(msg, _T("About Popup"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, wxT("About Popup"), wxOK | wxICON_INFORMATION, this);
}
// ----------------------------------------------------------------------------
{
public:
MyFrame()
- : wxFrame(NULL, wxID_ANY, _T("wxWidgets Power Management Sample"),
+ : wxFrame(NULL, wxID_ANY, wxT("wxWidgets Power Management Sample"),
wxDefaultPosition, wxSize(500, 200))
{
- wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, _T(""),
+ wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxT(""),
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxTE_READONLY);
m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(text));
#ifdef wxHAS_POWER_EVENTS
void OnSuspending(wxPowerEvent& event)
{
- wxLogMessage(_T("System suspend starting..."));
- if ( wxMessageBox(_T("Veto suspend?"), _T("Please answer"),
+ wxLogMessage(wxT("System suspend starting..."));
+ if ( wxMessageBox(wxT("Veto suspend?"), wxT("Please answer"),
wxYES_NO, this) == wxYES )
{
event.Veto();
- wxLogMessage(_T("Vetoed suspend."));
+ wxLogMessage(wxT("Vetoed suspend."));
}
}
void OnSuspended(wxPowerEvent& WXUNUSED(event))
{
- wxLogMessage(_T("System is going to suspend."));
+ wxLogMessage(wxT("System is going to suspend."));
}
void OnSuspendCancel(wxPowerEvent& WXUNUSED(event))
{
- wxLogMessage(_T("System suspend was cancelled."));
+ wxLogMessage(wxT("System suspend was cancelled."));
}
void OnResume(wxPowerEvent& WXUNUSED(event))
{
- wxLogMessage(_T("System resumed from suspend."));
+ wxLogMessage(wxT("System resumed from suspend."));
}
#endif // wxHAS_POWER_EVENTS
switch ( m_powerType = powerType )
{
case wxPOWER_SOCKET:
- powerStr = _T("wall");
+ powerStr = wxT("wall");
break;
case wxPOWER_BATTERY:
- powerStr = _T("battery");
+ powerStr = wxT("battery");
break;
default:
- wxFAIL_MSG(_T("unknown wxPowerType value"));
+ wxFAIL_MSG(wxT("unknown wxPowerType value"));
// fall through
case wxPOWER_UNKNOWN:
- powerStr = _T("psychic");
+ powerStr = wxT("psychic");
break;
}
switch ( m_batteryState = batteryState )
{
case wxBATTERY_NORMAL_STATE:
- batteryStr = _T("charged");
+ batteryStr = wxT("charged");
break;
case wxBATTERY_LOW_STATE:
- batteryStr = _T("low");
+ batteryStr = wxT("low");
break;
case wxBATTERY_CRITICAL_STATE:
- batteryStr = _T("critical");
+ batteryStr = wxT("critical");
break;
case wxBATTERY_SHUTDOWN_STATE:
- batteryStr = _T("empty");
+ batteryStr = wxT("empty");
break;
default:
- wxFAIL_MSG(_T("unknown wxBatteryState value"));
+ wxFAIL_MSG(wxT("unknown wxBatteryState value"));
// fall through
case wxBATTERY_UNKNOWN_STATE:
- batteryStr = _T("unknown");
+ batteryStr = wxT("unknown");
break;
}
SetStatusText(wxString::Format(
- _T("System is on %s power, battery state is %s"),
+ wxT("System is on %s power, battery state is %s"),
powerStr.c_str(),
batteryStr.c_str()));
}
// Create the main frame window
// ----------------------------
- MyFrame* frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets Printing Demo"),
+ MyFrame* frame = new MyFrame((wxFrame *) NULL, wxT("wxWidgets Printing Demo"),
wxPoint(0, 0), wxSize(400, 400));
frame->Centre(wxBOTH);
#if wxUSE_STATUSBAR
// Give us a status line
CreateStatusBar(2);
- SetStatusText(_T("Printing demo"));
+ SetStatusText(wxT("Printing demo"));
#endif // wxUSE_STATUSBAR
// Load icon and bitmap
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(wxID_PRINT, _T("&Print..."), _T("Print"));
- file_menu->Append(WXPRINT_PAGE_SETUP, _T("Page Set&up..."), _T("Page setup"));
+ file_menu->Append(wxID_PRINT, wxT("&Print..."), wxT("Print"));
+ file_menu->Append(WXPRINT_PAGE_SETUP, wxT("Page Set&up..."), wxT("Page setup"));
#ifdef __WXMAC__
- file_menu->Append(WXPRINT_PAGE_MARGINS, _T("Page Margins..."), _T("Page margins"));
+ file_menu->Append(WXPRINT_PAGE_MARGINS, wxT("Page Margins..."), wxT("Page margins"));
#endif
- file_menu->Append(wxID_PREVIEW, _T("Print Pre&view"), _T("Preview"));
+ file_menu->Append(wxID_PREVIEW, wxT("Print Pre&view"), wxT("Preview"));
#if wxUSE_ACCEL
// Accelerators
#if defined(__WXMSW__) &&wxTEST_POSTSCRIPT_IN_MSW
file_menu->AppendSeparator();
- file_menu->Append(WXPRINT_PRINT_PS, _T("Print PostScript..."), _T("Print (PostScript)"));
- file_menu->Append(WXPRINT_PAGE_SETUP_PS, _T("Page Setup PostScript..."), _T("Page setup (PostScript)"));
- file_menu->Append(WXPRINT_PREVIEW_PS, _T("Print Preview PostScript"), _T("Preview (PostScript)"));
+ file_menu->Append(WXPRINT_PRINT_PS, wxT("Print PostScript..."), wxT("Print (PostScript)"));
+ file_menu->Append(WXPRINT_PAGE_SETUP_PS, wxT("Page Setup PostScript..."), wxT("Page setup (PostScript)"));
+ file_menu->Append(WXPRINT_PREVIEW_PS, wxT("Print Preview PostScript"), wxT("Preview (PostScript)"));
#endif
file_menu->AppendSeparator();
- file_menu->Append(WXPRINT_ANGLEUP, _T("Angle up\tAlt-U"), _T("Raise rotated text angle"));
- file_menu->Append(WXPRINT_ANGLEDOWN, _T("Angle down\tAlt-D"), _T("Lower rotated text angle"));
+ file_menu->Append(WXPRINT_ANGLEUP, wxT("Angle up\tAlt-U"), wxT("Raise rotated text angle"));
+ file_menu->Append(WXPRINT_ANGLEDOWN, wxT("Angle down\tAlt-D"), wxT("Lower rotated text angle"));
file_menu->AppendSeparator();
- file_menu->Append(wxID_EXIT, _T("E&xit"), _T("Exit program"));
+ file_menu->Append(wxID_EXIT, wxT("E&xit"), wxT("Exit program"));
wxMenu *help_menu = new wxMenu;
- help_menu->Append(wxID_ABOUT, _T("&About"), _T("About this demo"));
+ help_menu->Append(wxID_ABOUT, wxT("&About"), wxT("About this demo"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
- menu_bar->Append(help_menu, _T("&Help"));
+ menu_bar->Append(file_menu, wxT("&File"));
+ menu_bar->Append(help_menu, wxT("&Help"));
// Associate the menu bar with the frame
SetMenuBar(menu_bar);
wxPrintDialogData printDialogData(* g_printData);
wxPrinter printer(&printDialogData);
- MyPrintout printout(this, _T("My printout"));
+ MyPrintout printout(this, wxT("My printout"));
if (!printer.Print(this, &printout, true /*prompt*/))
{
if (wxPrinter::GetLastError() == wxPRINTER_ERROR)
{
- wxLogError(_T("There was a problem printing. Perhaps your current printer is not set correctly?"));
+ wxLogError(wxT("There was a problem printing. Perhaps your current printer is not set correctly?"));
}
else
{
- wxLogMessage(_T("You canceled printing"));
+ wxLogMessage(wxT("You canceled printing"));
}
}
else
if (!preview->IsOk())
{
delete preview;
- wxLogError(_T("There was a problem previewing.\nPerhaps your current printer is not set correctly?"));
+ wxLogError(wxT("There was a problem previewing.\nPerhaps your current printer is not set correctly?"));
return;
}
wxPreviewFrame *frame =
- new wxPreviewFrame(preview, this, _T("Demo Print Preview"), wxPoint(100, 100), wxSize(600, 650));
+ new wxPreviewFrame(preview, this, wxT("Demo Print Preview"), wxPoint(100, 100), wxSize(600, 650));
frame->Centre(wxBOTH);
frame->Initialize();
frame->Show();
void MyFrame::OnPrintPS(wxCommandEvent& WXUNUSED(event))
{
wxPostScriptPrinter printer(g_printData);
- MyPrintout printout(_T("My printout"));
+ MyPrintout printout(wxT("My printout"));
printer.Print(this, &printout, true/*prompt*/);
(*g_printData) = printer.GetPrintData();
wxPrintDialogData printDialogData(* g_printData);
wxPrintPreview *preview = new wxPrintPreview(new MyPrintout, new MyPrintout, &printDialogData);
wxPreviewFrame *frame =
- new wxPreviewFrame(preview, this, _T("Demo Print Preview"), wxPoint(100, 100), wxSize(600, 650));
+ new wxPreviewFrame(preview, this, wxT("Demo Print Preview"), wxPoint(100, 100), wxSize(600, 650));
frame->Centre(wxBOTH);
frame->Initialize();
frame->Show();
void MyFrame::OnPrintAbout(wxCommandEvent& WXUNUSED(event))
{
- (void)wxMessageBox(_T("wxWidgets printing demo\nAuthor: Julian Smart"),
- _T("About wxWidgets printing demo"), wxOK|wxCENTRE);
+ (void)wxMessageBox(wxT("wxWidgets printing demo\nAuthor: Julian Smart"),
+ wxT("About wxWidgets printing demo"), wxOK|wxCENTRE);
}
void MyFrame::OnAngleUp(wxCommandEvent& WXUNUSED(event))
dc->SetBrush(*wxTRANSPARENT_BRUSH);
{ // GetTextExtent demo:
- wxString words[7] = { _T("This "), _T("is "), _T("GetTextExtent "),
- _T("testing "), _T("string. "), _T("Enjoy "), _T("it!") };
+ wxString words[7] = { wxT("This "), wxT("is "), wxT("GetTextExtent "),
+ wxT("testing "), wxT("string. "), wxT("Enjoy "), wxT("it!") };
wxCoord w, h;
long x = 200, y= 250;
wxFont fnt(15, wxSWISS, wxNORMAL, wxNORMAL);
dc->SetFont(wxGetApp().GetTestFont());
- dc->DrawText(_T("Some test text"), 200, 300 );
+ dc->DrawText(wxT("Some test text"), 200, 300 );
// TESTING
dc->DrawLine( (long)leftMarginLogical, (long)bottomMarginLogical,
(long)rightMarginLogical, (long)bottomMarginLogical);
- WritePageHeader(this, dc, _T("A header"), logUnitsFactor);
+ WritePageHeader(this, dc, wxT("A header"), logUnitsFactor);
}
// Writes a header on a page. Margin units are in millimetres.
class MyPrintout: public wxPrintout
{
public:
- MyPrintout(MyFrame* frame, const wxString &title = _T("My printout"))
+ MyPrintout(MyFrame* frame, const wxString &title = wxT("My printout"))
: wxPrintout(title) { m_frame=frame; }
bool OnPrintPage(int page);
wxT("Jaakko Salli"), wxVERSION_STRING
);
- wxMessageBox(msg, _T("About"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, wxT("About"), wxOK | wxICON_INFORMATION, this);
}
// -----------------------------------------------------------------------
wxMenu *CreateRegistryMenu()
{
wxMenu *pMenuNew = new wxMenu;
- pMenuNew->Append(Menu_NewKey, _T("&Key"), _T("Create a new key"));
+ pMenuNew->Append(Menu_NewKey, wxT("&Key"), wxT("Create a new key"));
pMenuNew->AppendSeparator();
- pMenuNew->Append(Menu_NewText, _T("&Text value"), _T("Create a new text value"));
- pMenuNew->Append(Menu_NewBinary, _T("&Binary value"), _T("Create a new binary value"));
+ pMenuNew->Append(Menu_NewText, wxT("&Text value"), wxT("Create a new text value"));
+ pMenuNew->Append(Menu_NewBinary, wxT("&Binary value"), wxT("Create a new binary value"));
wxMenu *pMenuReg = new wxMenu;
- pMenuReg->Append(Menu_New, _T("&New"), pMenuNew);
- pMenuReg->Append(Menu_Delete, _T("&Delete..."), _T("Delete selected key/value"));
+ pMenuReg->Append(Menu_New, wxT("&New"), pMenuNew);
+ pMenuReg->Append(Menu_Delete, wxT("&Delete..."), wxT("Delete selected key/value"));
pMenuReg->AppendSeparator();
- pMenuReg->Append(Menu_GoTo, _T("&Go to...\tCtrl-G"), _T("Go to registry key"));
- pMenuReg->Append(Menu_Expand, _T("&Expand"), _T("Expand current key"));
- pMenuReg->Append(Menu_Collapse, _T("&Collapse"), _T("Collapse current key"));
- pMenuReg->Append(Menu_Toggle, _T("&Toggle"), _T("Toggle current key"));
+ pMenuReg->Append(Menu_GoTo, wxT("&Go to...\tCtrl-G"), wxT("Go to registry key"));
+ pMenuReg->Append(Menu_Expand, wxT("&Expand"), wxT("Expand current key"));
+ pMenuReg->Append(Menu_Collapse, wxT("&Collapse"), wxT("Collapse current key"));
+ pMenuReg->Append(Menu_Toggle, wxT("&Toggle"), wxT("Toggle current key"));
pMenuReg->AppendSeparator();
- pMenuReg->Append(Menu_Refresh, _T("&Refresh"), _T("Refresh the subtree"));
+ pMenuReg->Append(Menu_Refresh, wxT("&Refresh"), wxT("Refresh the subtree"));
pMenuReg->AppendSeparator();
- pMenuReg->Append(Menu_Info, _T("&Properties"),_T("Information about current selection"));
+ pMenuReg->Append(Menu_Info, wxT("&Properties"),wxT("Information about current selection"));
return pMenuReg;
}
return false;
// create the main frame window and show it
- RegFrame *frame = new RegFrame(NULL, _T("wxRegTest"), 50, 50, 600, 350);
+ RegFrame *frame = new RegFrame(NULL, wxT("wxRegTest"), 50, 50, 600, 350);
frame->Show(true);
SetTopWindow(frame);
// set the icon
// ------------
- SetIcon(wxIcon(_T("app_icon")));
+ SetIcon(wxIcon(wxT("app_icon")));
// create menu
// -----------
wxMenu *pMenuFile = new wxMenu;
- pMenuFile->Append(Menu_Test, _T("Te&st"), _T("Test key creation"));
+ pMenuFile->Append(Menu_Test, wxT("Te&st"), wxT("Test key creation"));
pMenuFile->AppendSeparator();
- pMenuFile->Append(Menu_About, _T("&About..."), _T("Show an extraordinarly beautiful dialog"));
+ pMenuFile->Append(Menu_About, wxT("&About..."), wxT("Show an extraordinarly beautiful dialog"));
pMenuFile->AppendSeparator();
- pMenuFile->Append(Menu_Quit, _T("E&xit"), _T("Quit this program"));
+ pMenuFile->Append(Menu_Quit, wxT("E&xit"), wxT("Quit this program"));
wxMenuBar *pMenu = new wxMenuBar;
- pMenu->Append(pMenuFile, _T("&File"));
- pMenu->Append(CreateRegistryMenu(), _T("&Registry"));
+ pMenu->Append(pMenuFile, wxT("&File"));
+ pMenu->Append(CreateRegistryMenu(), wxT("&Registry"));
SetMenuBar(pMenu);
#if DO_REGTEST
void RegFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxMessageDialog dialog(this,
- _T("wxRegistry sample\n")
- _T("(c) 1998, 2000 Vadim Zeitlin"),
- _T("About wxRegTest"), wxOK);
+ wxT("wxRegistry sample\n")
+ wxT("(c) 1998, 2000 Vadim Zeitlin"),
+ wxT("About wxRegTest"), wxOK);
dialog.ShowModal();
}
void RegFrame::OnGoTo(wxCommandEvent& WXUNUSED(event))
{
- static wxString s_location = _T("HKEY_CURRENT_USER\\Software\\wxWidgets");
+ static wxString s_location = wxT("HKEY_CURRENT_USER\\Software\\wxWidgets");
wxString location = wxGetTextFromUser(
- _T("Enter the location to go to:"),
- _T("wxRegTest question"),
+ wxT("Enter the location to go to:"),
+ wxT("wxRegTest question"),
s_location,
this);
if ( m_treeCtrl->IsKeySelected() )
{
m_treeCtrl->CreateNewKey(
- wxGetTextFromUser(_T("Enter the name of the new key")));
+ wxGetTextFromUser(wxT("Enter the name of the new key")));
}
#endif
}
if ( m_treeCtrl->IsKeySelected() )
{
m_treeCtrl->CreateNewTextValue(
- wxGetTextFromUser(_T("Enter the name for the new text value")));
+ wxGetTextFromUser(wxT("Enter the name for the new text value")));
}
#endif
}
if ( m_treeCtrl->IsKeySelected() )
{
m_treeCtrl->CreateNewBinaryValue(
- wxGetTextFromUser(_T("Enter the name for the new binary value")));
+ wxGetTextFromUser(wxT("Enter the name for the new binary value")));
}
#endif
}
RegImageList::RegImageList() : wxImageList(16, 16, true)
{
// should be in sync with enum RegImageList::RegIcon
- static const wxChar *aszIcons[] = { _T("key1"),_T("key2"),_T("key3"),_T("value1"),_T("value2") };
- wxString str = _T("icon_");
+ static const wxChar *aszIcons[] = { wxT("key1"),wxT("key2"),wxT("key3"),wxT("value1"),wxT("value2") };
+ wxString str = wxT("icon_");
for ( unsigned int n = 0; n < WXSIZEOF(aszIcons); n++ )
{
Add(wxIcon(str + aszIcons[n], wxBITMAP_TYPE_ICO_RESOURCE));
// create root keys
// ----------------
- m_pRoot = InsertNewTreeNode(NULL, _T("Registry Root"), RegImageList::Root);
+ m_pRoot = InsertNewTreeNode(NULL, wxT("Registry Root"), RegImageList::Root);
// create popup menu
// -----------------
return;
}
- wxRegKey key1(pNode->Key(), _T("key1"));
+ wxRegKey key1(pNode->Key(), wxT("key1"));
if ( key1.Create() )
{
- wxRegKey key2a(key1, _T("key2a")), key2b(key1, _T("key2b"));
+ wxRegKey key2a(key1, wxT("key2a")), key2b(key1, wxT("key2b"));
if ( key2a.Create() && key2b.Create() )
{
// put some values under the newly created keys
- key1.SetValue(wxT("first_term"), _T("10"));
- key1.SetValue(wxT("second_term"), _T("7"));
- key2a = _T("this is the unnamed value");
+ key1.SetValue(wxT("first_term"), wxT("10"));
+ key1.SetValue(wxT("second_term"), wxT("7"));
+ key2a = wxT("this is the unnamed value");
key2b.SetValue(wxT("sum"), 17);
// refresh tree
TreeNode *pNode = GetNode(event);
if ( pNode->IsRoot() || pNode->Parent()->IsRoot() )
{
- wxLogStatus(_T("This registry key can't be renamed."));
+ wxLogStatus(wxT("This registry key can't be renamed."));
event.Veto();
}
if ( !ok )
{
- wxLogError(_T("Failed to rename '%s' to '%s'."),
+ wxLogError(wxT("Failed to rename '%s' to '%s'."),
m_nameOld.c_str(), name.c_str());
}
#if 0 // MSW tree ctrl doesn't like this at all, it hangs
nameDst << wxString(dst->FullName()).AfterFirst('\\') << '\\'
<< wxString(src->FullName()).AfterLast('\\');
- wxString verb = m_copyOnDrop ? _T("copy") : _T("move");
- wxString what = isKey ? _T("key") : _T("value");
+ wxString verb = m_copyOnDrop ? wxT("copy") : wxT("move");
+ wxString what = isKey ? wxT("key") : wxT("value");
if ( wxMessageBox(wxString::Format
(
nameSrc.c_str(),
nameDst.c_str()
),
- _T("RegTest Confirm"),
+ wxT("RegTest Confirm"),
wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) {
return;
}
{
wxString strItem;
if (str.empty())
- strItem = _T("<default>");
+ strItem = wxT("<default>");
else
strItem = str;
- strItem += _T(" = ");
+ strItem += wxT(" = ");
// determine the appropriate icon
RegImageList::Icon icon;
void RegTreeCtrl::GoTo(const wxString& location)
{
- wxStringTokenizer tk(location, _T("\\"));
+ wxStringTokenizer tk(location, wxT("\\"));
wxTreeItemId id = GetRootItem();
if ( !id.IsOk() )
{
- wxLogError(_T("No such key '%s'."), location.c_str());
+ wxLogError(wxT("No such key '%s'."), location.c_str());
return;
}
return;
}
- wxString what = pCurrent->IsKey() ? _T("key") : _T("value");
+ wxString what = pCurrent->IsKey() ? wxT("key") : wxT("value");
if ( wxMessageBox(wxString::Format
(
wxT("Do you really want to delete this %s?"),
what.c_str()
),
- _T("Confirmation"),
+ wxT("Confirmation"),
wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES )
{
return;
#if 0 // just for debugging
MyDllRenderer()
{
- wxMessageBox(_T("Creating MyDllRenderer"), _T("Renderer Sample"));
+ wxMessageBox(wxT("Creating MyDllRenderer"), wxT("Renderer Sample"));
}
virtual ~MyDllRenderer()
{
- wxMessageBox(_T("Deleting MyDllRenderer"), _T("Renderer Sample"));
+ wxMessageBox(wxT("Deleting MyDllRenderer"), wxT("Renderer Sample"));
}
#endif // 0
};
dc.SetBrush(*wxBLUE_BRUSH);
dc.SetTextForeground(*wxWHITE);
dc.DrawRoundedRectangle(rect, 5);
- dc.DrawLabel(_T("MyRenderer"), wxNullBitmap, rect, wxALIGN_CENTER);
+ dc.DrawLabel(wxT("MyRenderer"), wxNullBitmap, rect, wxALIGN_CENTER);
return rect.width;
}
};
{
wxPaintDC dc(this);
- dc.DrawText(_T("Below is the standard header button drawn"), 10, 10);
- dc.DrawText(_T("using the current renderer:"), 10, 40);
+ dc.DrawText(wxT("Below is the standard header button drawn"), 10, 10);
+ dc.DrawText(wxT("using the current renderer:"), 10, 40);
wxRendererNative& renderer = wxRendererNative::Get();
const wxCoord height = renderer.GetHeaderButtonHeight(this);
MyFrame::MyFrame()
: wxFrame(NULL,
wxID_ANY,
- _T("Render wxWidgets Sample"),
+ wxT("Render wxWidgets Sample"),
wxPoint(50, 50),
wxSize(450, 340))
{
// create a menu bar
wxMenu *menuFile = new wxMenu;
#if wxUSE_DYNLIB_CLASS
- menuFile->Append(Render_Load, _T("&Load renderer...\tCtrl-L"));
- menuFile->Append(Render_Unload, _T("&Unload renderer\tCtrl-U"));
+ menuFile->Append(Render_Load, wxT("&Load renderer...\tCtrl-L"));
+ menuFile->Append(Render_Unload, wxT("&Unload renderer\tCtrl-U"));
#endif // wxUSE_DYNLIB_CLASS
- menuFile->Append(Render_Quit, _T("E&xit\tCtrl-Q"), _T("Quit this program"));
+ menuFile->Append(Render_Quit, wxT("E&xit\tCtrl-Q"), wxT("Quit this program"));
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(Render_About, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(Render_About, wxT("&About...\tF1"), wxT("Show about dialog"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWidgets!"));
+ SetStatusText(wxT("Welcome to wxWidgets!"));
#endif // wxUSE_STATUSBAR
Show();
void MyFrame::OnLoad(wxCommandEvent& WXUNUSED(event))
{
- static wxString s_name = _T("renddll");
+ static wxString s_name = wxT("renddll");
wxString name = wxGetTextFromUser
(
- _T("Name of the renderer to load:"),
- _T("Render wxWidgets Sample"),
+ wxT("Name of the renderer to load:"),
+ wxT("Render wxWidgets Sample"),
s_name,
this
);
wxRendererNative *renderer = wxRendererNative::Load(name);
if ( !renderer )
{
- wxLogError(_T("Failed to load renderer \"%s\"."), name.c_str());
+ wxLogError(wxT("Failed to load renderer \"%s\"."), name.c_str());
}
else // loaded ok
{
m_panel->Refresh();
- wxLogStatus(this, _T("Successfully loaded the renderer \"%s\"."),
+ wxLogStatus(this, wxT("Successfully loaded the renderer \"%s\"."),
name.c_str());
}
}
m_panel->Refresh();
- wxLogStatus(this, _T("Unloaded the previously loaded renderer."));
+ wxLogStatus(this, wxT("Unloaded the previously loaded renderer."));
}
else
{
- wxLogWarning(_T("No renderer to unload."));
+ wxLogWarning(wxT("No renderer to unload."));
}
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("Render sample shows how to use custom renderers.\n")
- _T("\n")
- _T("(c) 2003 Vadim Zeitlin"),
- _T("About Render wxWidgets Sample"),
+ wxMessageBox(wxT("Render sample shows how to use custom renderers.\n")
+ wxT("\n")
+ wxT("(c) 2003 Vadim Zeitlin"),
+ wxT("About Render wxWidgets Sample"),
wxOK | wxICON_INFORMATION, this);
}
#endif
// create the main application window
- MyFrame *frame = new MyFrame(_T("wxRichTextCtrl Sample"), wxID_ANY, wxDefaultPosition, wxSize(700, 600));
+ MyFrame *frame = new MyFrame(wxT("wxRichTextCtrl Sample"), wxID_ANY, wxDefaultPosition, wxSize(700, 600));
m_printing->SetParentWindow(frame);
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(ID_About, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(ID_About, wxT("&About...\tF1"), wxT("Show about dialog"));
- fileMenu->Append(wxID_OPEN, _T("&Open\tCtrl+O"), _T("Open a file"));
- fileMenu->Append(wxID_SAVE, _T("&Save\tCtrl+S"), _T("Save a file"));
- fileMenu->Append(wxID_SAVEAS, _T("&Save As...\tF12"), _T("Save to a new file"));
+ fileMenu->Append(wxID_OPEN, wxT("&Open\tCtrl+O"), wxT("Open a file"));
+ fileMenu->Append(wxID_SAVE, wxT("&Save\tCtrl+S"), wxT("Save a file"));
+ fileMenu->Append(wxID_SAVEAS, wxT("&Save As...\tF12"), wxT("Save to a new file"));
fileMenu->AppendSeparator();
- fileMenu->Append(ID_RELOAD, _T("&Reload Text\tF2"), _T("Reload the initial text"));
+ fileMenu->Append(ID_RELOAD, wxT("&Reload Text\tF2"), wxT("Reload the initial text"));
fileMenu->AppendSeparator();
- fileMenu->Append(ID_PAGE_SETUP, _T("Page Set&up..."), _T("Page setup"));
- fileMenu->Append(ID_PRINT, _T("&Print...\tCtrl+P"), _T("Print"));
- fileMenu->Append(ID_PREVIEW, _T("Print Pre&view"), _T("Print preview"));
+ fileMenu->Append(ID_PAGE_SETUP, wxT("Page Set&up..."), wxT("Page setup"));
+ fileMenu->Append(ID_PRINT, wxT("&Print...\tCtrl+P"), wxT("Print"));
+ fileMenu->Append(ID_PREVIEW, wxT("Print Pre&view"), wxT("Print preview"));
fileMenu->AppendSeparator();
- fileMenu->Append(ID_VIEW_HTML, _T("&View as HTML"), _T("View HTML"));
+ fileMenu->Append(ID_VIEW_HTML, wxT("&View as HTML"), wxT("View HTML"));
fileMenu->AppendSeparator();
- fileMenu->Append(ID_Quit, _T("E&xit\tAlt+X"), _T("Quit this program"));
+ fileMenu->Append(ID_Quit, wxT("E&xit\tAlt+X"), wxT("Quit this program"));
wxMenu* editMenu = new wxMenu;
editMenu->Append(wxID_UNDO, _("&Undo\tCtrl+Z"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(fileMenu, _T("&File"));
- menuBar->Append(editMenu, _T("&Edit"));
- menuBar->Append(formatMenu, _T("F&ormat"));
- menuBar->Append(listsMenu, _T("&Lists"));
- menuBar->Append(insertMenu, _T("&Insert"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(fileMenu, wxT("&File"));
+ menuBar->Append(editMenu, wxT("&Edit"));
+ menuBar->Append(formatMenu, wxT("F&ormat"));
+ menuBar->Append(listsMenu, wxT("&Lists"));
+ menuBar->Append(insertMenu, wxT("&Insert"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
if ( !is_pda )
{
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxRichTextCtrl!"));
+ SetStatusText(wxT("Welcome to wxRichTextCtrl!"));
}
#endif
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
- msg.Printf( _T("This is a demo for wxRichTextCtrl, a control for editing styled text.\n(c) Julian Smart, 2005"));
- wxMessageBox(msg, _T("About wxRichTextCtrl Sample"), wxOK | wxICON_INFORMATION, this);
+ msg.Printf( wxT("This is a demo for wxRichTextCtrl, a control for editing styled text.\n(c) Julian Smart, 2005"));
+ wxMessageBox(msg, wxT("About wxRichTextCtrl Sample"), wxOK | wxICON_INFORMATION, this);
}
// Forward command events to the current rich text control, if any
// Create the main frame window
- frame = new MyFrame(NULL, wxID_ANY, _T("Sash Demo"), wxPoint(0, 0), wxSize(500, 400),
+ frame = new MyFrame(NULL, wxID_ANY, wxT("Sash Demo"), wxPoint(0, 0), wxSize(500, 400),
wxDEFAULT_FRAME_STYLE |
wxNO_FULL_REPAINT_ON_RESIZE |
wxHSCROLL | wxVSCROLL);
// Give it an icon (this is ignored in MDI mode: uses resources)
#ifdef __WXMSW__
- frame->SetIcon(wxIcon(_T("sashtest_icn")));
+ frame->SetIcon(wxIcon(wxT("sashtest_icn")));
#endif
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(SASHTEST_NEW_WINDOW, _T("&New window"));
- file_menu->Append(SASHTEST_TOGGLE_WINDOW, _T("&Toggle window"));
- file_menu->Append(SASHTEST_QUIT, _T("&Exit"));
+ file_menu->Append(SASHTEST_NEW_WINDOW, wxT("&New window"));
+ file_menu->Append(SASHTEST_TOGGLE_WINDOW, wxT("&Toggle window"));
+ file_menu->Append(SASHTEST_QUIT, wxT("&Exit"));
wxMenu *help_menu = new wxMenu;
- help_menu->Append(SASHTEST_ABOUT, _T("&About"));
+ help_menu->Append(SASHTEST_ABOUT, wxT("&About"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
- menu_bar->Append(help_menu, _T("&Help"));
+ menu_bar->Append(file_menu, wxT("&File"));
+ menu_bar->Append(help_menu, wxT("&Help"));
// Associate the menu bar with the frame
frame->SetMenuBar(menu_bar);
wxTextCtrl* textWindow = new wxTextCtrl(win, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE|wxSUNKEN_BORDER);
// wxTE_MULTILINE|wxNO_BORDER);
- textWindow->SetValue(_T("A help window"));
+ textWindow->SetValue(wxT("A help window"));
m_leftWindow1 = win;
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- (void)wxMessageBox(_T("wxWidgets 2.0 Sash Demo\nAuthor: Julian Smart (c) 1998"), _T("About Sash Demo"));
+ (void)wxMessageBox(wxT("wxWidgets 2.0 Sash Demo\nAuthor: Julian Smart (c) 1998"), wxT("About Sash Demo"));
}
void MyFrame::OnToggleWindow(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event))
{
// Make another frame, containing a canvas
- MyChild *subframe = new MyChild(frame, _T("Canvas Frame"),
+ MyChild *subframe = new MyChild(frame, wxT("Canvas Frame"),
wxPoint(10, 10), wxSize(300, 300),
wxDEFAULT_FRAME_STYLE |
wxNO_FULL_REPAINT_ON_RESIZE);
- subframe->SetTitle(wxString::Format(_T("Canvas Frame %d"), winNumber));
+ subframe->SetTitle(wxString::Format(wxT("Canvas Frame %d"), winNumber));
winNumber ++;
// Give it an icon (this is ignored in MDI mode: uses resources)
#ifdef __WXMSW__
- subframe->SetIcon(wxIcon(_T("sashtest_icn")));
+ subframe->SetIcon(wxIcon(wxT("sashtest_icn")));
#endif
#if wxUSE_STATUSBAR
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(SASHTEST_NEW_WINDOW, _T("&New window"));
- file_menu->Append(SASHTEST_CHILD_QUIT, _T("&Close child"));
- file_menu->Append(SASHTEST_QUIT, _T("&Exit"));
+ file_menu->Append(SASHTEST_NEW_WINDOW, wxT("&New window"));
+ file_menu->Append(SASHTEST_CHILD_QUIT, wxT("&Close child"));
+ file_menu->Append(SASHTEST_QUIT, wxT("&Exit"));
wxMenu *option_menu = new wxMenu;
// Dummy option
- option_menu->Append(SASHTEST_REFRESH, _T("&Refresh picture"));
+ option_menu->Append(SASHTEST_REFRESH, wxT("&Refresh picture"));
wxMenu *help_menu = new wxMenu;
- help_menu->Append(SASHTEST_ABOUT, _T("&About"));
+ help_menu->Append(SASHTEST_ABOUT, wxT("&About"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
- menu_bar->Append(option_menu, _T("&Options"));
- menu_bar->Append(help_menu, _T("&Help"));
+ menu_bar->Append(file_menu, wxT("&File"));
+ menu_bar->Append(option_menu, wxT("&Options"));
+ menu_bar->Append(help_menu, wxT("&Help"));
// Associate the menu bar with the frame
subframe->SetMenuBar(menu_bar);
dc.DrawSpline(50, 200, 50, 100, 200, 10);
#endif // wxUSE_SPLINES
dc.DrawLine(50, 230, 200, 230);
- dc.DrawText(_T("This is a test string"), 50, 230);
+ dc.DrawText(wxT("This is a test string"), 50, 230);
wxPoint points[3];
points[0].x = 200; points[0].y = 300;
)
{
m_hasShape = false;
- m_bmp = wxBitmap(_T("star.png"), wxBITMAP_TYPE_PNG);
+ m_bmp = wxBitmap(wxT("star.png"), wxBITMAP_TYPE_PNG);
SetSize(wxSize(m_bmp.GetWidth(), m_bmp.GetHeight()));
SetToolTip(wxT("Right-click to close"));
SetWindowShape();
#include "../sample.xpm"
#endif
-#define WAV_FILE _T("doggrowl.wav")
+#define WAV_FILE wxT("doggrowl.wav")
// ----------------------------------------------------------------------------
// private classes
return false;
// create the main application window
- MyFrame *frame = new MyFrame(_T("wxWidgets Sound Sample"));
+ MyFrame *frame = new MyFrame(wxT("wxWidgets Sound Sample"));
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
SetIcon(wxICON(sample));
wxMenu *menuFile = new wxMenu;
- menuFile->Append(Sound_SelectFile, _T("Select WAV &file...\tCtrl-O"), _T("Select a new wav file to play"));
+ menuFile->Append(Sound_SelectFile, wxT("Select WAV &file...\tCtrl-O"), wxT("Select a new wav file to play"));
#ifdef __WXMSW__
- menuFile->Append(Sound_SelectResource, _T("Select WAV &resource...\tCtrl-R"), _T("Select a new resource to play"));
- menuFile->Append(Sound_SelectMemory, _T("Select WAV &data\tCtrl-M"), _T("Choose to play from memory buffer"));
+ menuFile->Append(Sound_SelectResource, wxT("Select WAV &resource...\tCtrl-R"), wxT("Select a new resource to play"));
+ menuFile->Append(Sound_SelectMemory, wxT("Select WAV &data\tCtrl-M"), wxT("Choose to play from memory buffer"));
#endif // __WXMSW__
- menuFile->Append(Sound_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(Sound_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
wxMenu *playMenu = new wxMenu;
- playMenu->Append(Sound_PlaySync, _T("Play sound &synchronously\tCtrl-S"));
- playMenu->Append(Sound_PlayAsync, _T("Play sound &asynchronously\tCtrl-A"));
- playMenu->Append(Sound_PlayAsyncOnStack, _T("Play sound asynchronously (&object on stack)\tCtrl-K"));
- playMenu->Append(Sound_PlayLoop, _T("&Loop sound\tCtrl-L"));
+ playMenu->Append(Sound_PlaySync, wxT("Play sound &synchronously\tCtrl-S"));
+ playMenu->Append(Sound_PlayAsync, wxT("Play sound &asynchronously\tCtrl-A"));
+ playMenu->Append(Sound_PlayAsyncOnStack, wxT("Play sound asynchronously (&object on stack)\tCtrl-K"));
+ playMenu->Append(Sound_PlayLoop, wxT("&Loop sound\tCtrl-L"));
playMenu->AppendSeparator();
- playMenu->Append(Sound_Stop, _T("&Stop playing\tCtrl-T"));
+ playMenu->Append(Sound_Stop, wxT("&Stop playing\tCtrl-T"));
playMenu->AppendSeparator();
- playMenu->Append(Sound_PlayBell, _T("Play system bell"));
+ playMenu->Append(Sound_PlayBell, wxT("Play system bell"));
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(Sound_About, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(Sound_About, wxT("&About...\tF1"), wxT("Show about dialog"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(playMenu, _T("&Play"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(playMenu, wxT("&Play"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
void MyFrame::NotifyUsingFile(const wxString& name)
{
wxString msg;
- msg << _T("Using sound file: ") << name << _T("\n");
+ msg << wxT("Using sound file: ") << name << wxT("\n");
m_tc->AppendText(msg);
}
void MyFrame::OnSelectFile(wxCommandEvent& WXUNUSED(event))
{
#if wxUSE_FILEDLG
- wxFileDialog dlg(this, _T("Choose a sound file"),
+ wxFileDialog dlg(this, wxT("Choose a sound file"),
wxEmptyString, wxEmptyString,
- _T("WAV files (*.wav)|*.wav"), wxFD_OPEN|wxFD_CHANGE_DIR);
+ wxT("WAV files (*.wav)|*.wav"), wxFD_OPEN|wxFD_CHANGE_DIR);
if ( dlg.ShowModal() == wxID_OK )
{
m_soundFile = dlg.GetPath();
{
m_soundRes = wxGetTextFromUser
(
- _T("Enter resource name:"),
- _T("wxWidgets Sound Sample"),
- _T("FromResource"),
+ wxT("Enter resource name:"),
+ wxT("wxWidgets Sound Sample"),
+ wxT("FromResource"),
this
);
if ( m_soundRes.empty() )
delete m_sound;
m_sound = NULL;
- NotifyUsingFile(_T("Windows WAV resource"));
+ NotifyUsingFile(wxT("Windows WAV resource"));
}
#endif // __WXMSW__
{
m_useMemory = true;
- NotifyUsingFile(_T("embedded sound fragment"));
+ NotifyUsingFile(wxT("embedded sound fragment"));
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
- msg.Printf( _T("This is the About dialog of the sound sample.\n")
- _T("Welcome to %s"), wxVERSION_STRING);
+ msg.Printf( wxT("This is the About dialog of the sound sample.\n")
+ wxT("Welcome to %s"), wxVERSION_STRING);
- wxMessageBox(msg, _T("About"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, wxT("About"), wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnStop(wxCommandEvent& WXUNUSED(event))
wxImage::AddHandler(new wxPNGHandler);
// create the main application window
- MyFrame *frame = new MyFrame(_T("wxSplashScreen sample application"));
+ MyFrame *frame = new MyFrame(wxT("wxSplashScreen sample application"));
wxBitmap bitmap;
bool ok = frame->m_isPda
? bitmap.Ok()
- : bitmap.LoadFile(_T("splash.png"), wxBITMAP_TYPE_PNG);
+ : bitmap.LoadFile(wxT("splash.png"), wxBITMAP_TYPE_PNG);
if (ok)
{
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(wxID_ABOUT, _T("&About...\tF1"), _T("Show about frame"));
+ helpMenu->Append(wxID_ABOUT, wxT("&About...\tF1"), wxT("Show about frame"));
- menuFile->Append(wxID_EXIT, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(wxID_EXIT, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWidgets!"));
+ SetStatusText(wxT("Welcome to wxWidgets!"));
#endif // wxUSE_STATUSBAR
}
bool ok = m_isPda
? bitmap.Ok()
- : bitmap.LoadFile(_T("splash.png"), wxBITMAP_TYPE_PNG);
+ : bitmap.LoadFile(wxT("splash.png"), wxBITMAP_TYPE_PNG);
if (ok)
{
wxWindow *win = splash->GetSplashWindow();
#if wxUSE_MEDIACTRL
- wxMediaCtrl *media = new wxMediaCtrl( win, wxID_EXIT, _T("press.mpg"), wxPoint(2,2));
+ wxMediaCtrl *media = new wxMediaCtrl( win, wxID_EXIT, wxT("press.mpg"), wxPoint(2,2));
media->Play();
#else
wxStaticText *text = new wxStaticText( win,
wxID_EXIT,
- _T("click somewhere\non this image"),
+ wxT("click somewhere\non this image"),
wxPoint(m_isPda ? 0 : 13,
m_isPda ? 0 : 11)
);
// My frame constructor
MyFrame::MyFrame()
- : wxFrame(NULL, wxID_ANY, _T("wxSplitterWindow sample"),
+ : wxFrame(NULL, wxID_ANY, wxT("wxSplitterWindow sample"),
wxDefaultPosition, wxSize(420, 300),
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{
// Make a menubar
wxMenu *splitMenu = new wxMenu;
splitMenu->Append(SPLIT_VERTICAL,
- _T("Split &Vertically\tCtrl-V"),
- _T("Split vertically"));
+ wxT("Split &Vertically\tCtrl-V"),
+ wxT("Split vertically"));
splitMenu->Append(SPLIT_HORIZONTAL,
- _T("Split &Horizontally\tCtrl-H"),
- _T("Split horizontally"));
+ wxT("Split &Horizontally\tCtrl-H"),
+ wxT("Split horizontally"));
splitMenu->Append(SPLIT_UNSPLIT,
- _T("&Unsplit\tCtrl-U"),
- _T("Unsplit"));
+ wxT("&Unsplit\tCtrl-U"),
+ wxT("Unsplit"));
splitMenu->AppendSeparator();
splitMenu->AppendCheckItem(SPLIT_LIVE,
- _T("&Live update\tCtrl-L"),
- _T("Toggle live update mode"));
+ wxT("&Live update\tCtrl-L"),
+ wxT("Toggle live update mode"));
splitMenu->AppendCheckItem(SPLIT_BORDER,
- _T("3D &Border"),
- _T("Toggle wxSP_BORDER flag"));
+ wxT("3D &Border"),
+ wxT("Toggle wxSP_BORDER flag"));
splitMenu->Check(SPLIT_BORDER, true);
splitMenu->AppendCheckItem(SPLIT_3DSASH,
- _T("&3D Sash"),
- _T("Toggle wxSP_3DSASH flag"));
+ wxT("&3D Sash"),
+ wxT("Toggle wxSP_3DSASH flag"));
splitMenu->Check(SPLIT_3DSASH, true);
splitMenu->Append(SPLIT_SETPOSITION,
- _T("Set splitter &position\tCtrl-P"),
- _T("Set the splitter position"));
+ wxT("Set splitter &position\tCtrl-P"),
+ wxT("Set the splitter position"));
splitMenu->Append(SPLIT_SETMINSIZE,
- _T("Set &min size\tCtrl-M"),
- _T("Set minimum pane size"));
+ wxT("Set &min size\tCtrl-M"),
+ wxT("Set minimum pane size"));
splitMenu->Append(SPLIT_SETGRAVITY,
- _T("Set &gravity\tCtrl-G"),
- _T("Set gravity of sash"));
+ wxT("Set &gravity\tCtrl-G"),
+ wxT("Set gravity of sash"));
splitMenu->AppendSeparator();
splitMenu->Append(SPLIT_REPLACE,
- _T("&Replace right window"),
- _T("Replace right window"));
+ wxT("&Replace right window"),
+ wxT("Replace right window"));
splitMenu->AppendSeparator();
- splitMenu->Append(SPLIT_QUIT, _T("E&xit\tAlt-X"), _T("Exit"));
+ splitMenu->Append(SPLIT_QUIT, wxT("E&xit\tAlt-X"), wxT("Exit"));
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(splitMenu, _T("&Splitter"));
+ menuBar->Append(splitMenu, wxT("&Splitter"));
SetMenuBar(menuBar);
m_right->SetBackgroundColour(*wxCYAN);
m_right->SetScrollbars(20, 20, 5, 5);
#else // for testing kbd navigation inside the splitter
- m_left = new wxTextCtrl(m_splitter, wxID_ANY, _T("first text"));
- m_right = new wxTextCtrl(m_splitter, wxID_ANY, _T("second text"));
+ m_left = new wxTextCtrl(m_splitter, wxID_ANY, wxT("first text"));
+ m_right = new wxTextCtrl(m_splitter, wxID_ANY, wxT("second text"));
#endif
// you can also do this to start with a single window
#endif
#if wxUSE_STATUSBAR
- SetStatusText(_T("Min pane size = 0"), 1);
+ SetStatusText(wxT("Min pane size = 0"), 1);
#endif // wxUSE_STATUSBAR
m_replacewindow = NULL;
m_replacewindow = NULL;
#if wxUSE_STATUSBAR
- SetStatusText(_T("Splitter split horizontally"), 1);
+ SetStatusText(wxT("Splitter split horizontally"), 1);
#endif // wxUSE_STATUSBAR
}
m_replacewindow = NULL;
#if wxUSE_STATUSBAR
- SetStatusText(_T("Splitter split vertically"), 1);
+ SetStatusText(wxT("Splitter split vertically"), 1);
#endif // wxUSE_STATUSBAR
}
if ( m_splitter->IsSplit() )
m_splitter->Unsplit();
#if wxUSE_STATUSBAR
- SetStatusText(_T("No splitter"));
+ SetStatusText(wxT("No splitter"));
#endif // wxUSE_STATUSBAR
}
wxString str;
str.Printf( wxT("%d"), m_splitter->GetSashPosition());
#if wxUSE_TEXTDLG
- str = wxGetTextFromUser(_T("Enter splitter position:"), _T(""), str, this);
+ str = wxGetTextFromUser(wxT("Enter splitter position:"), wxT(""), str, this);
#endif
if ( str.empty() )
return;
long pos;
if ( !str.ToLong(&pos) )
{
- wxLogError(_T("The splitter position should be an integer."));
+ wxLogError(wxT("The splitter position should be an integer."));
return;
}
m_splitter->SetSashPosition(pos);
- wxLogStatus(this, _T("Splitter position set to %ld"), pos);
+ wxLogStatus(this, wxT("Splitter position set to %ld"), pos);
}
void MyFrame::OnSetMinSize(wxCommandEvent& WXUNUSED(event) )
wxString str;
str.Printf( wxT("%d"), m_splitter->GetMinimumPaneSize());
#if wxUSE_TEXTDLG
- str = wxGetTextFromUser(_T("Enter minimal size for panes:"), _T(""), str, this);
+ str = wxGetTextFromUser(wxT("Enter minimal size for panes:"), wxT(""), str, this);
#endif
if ( str.empty() )
return;
wxString str;
str.Printf( wxT("%g"), m_splitter->GetSashGravity());
#if wxUSE_TEXTDLG
- str = wxGetTextFromUser(_T("Enter sash gravity (0,1):"), _T(""), str, this);
+ str = wxGetTextFromUser(wxT("Enter sash gravity (0,1):"), wxT(""), str, this);
#endif
if ( str.empty() )
return;
void MySplitterWindow::OnPositionChanged(wxSplitterEvent& event)
{
- wxLogStatus(m_frame, _T("Position has changed, now = %d (or %d)"),
+ wxLogStatus(m_frame, wxT("Position has changed, now = %d (or %d)"),
event.GetSashPosition(), GetSashPosition());
event.Skip();
void MySplitterWindow::OnPositionChanging(wxSplitterEvent& event)
{
- wxLogStatus(m_frame, _T("Position is changing, now = %d (or %d)"),
+ wxLogStatus(m_frame, wxT("Position is changing, now = %d (or %d)"),
event.GetSashPosition(), GetSashPosition());
event.Skip();
void MySplitterWindow::OnDClick(wxSplitterEvent& event)
{
#if wxUSE_STATUSBAR
- m_frame->SetStatusText(_T("Splitter double clicked"), 1);
+ m_frame->SetStatusText(wxT("Splitter double clicked"), 1);
#endif // wxUSE_STATUSBAR
event.Skip();
void MySplitterWindow::OnUnsplitEvent(wxSplitterEvent& event)
{
#if wxUSE_STATUSBAR
- m_frame->SetStatusText(_T("Splitter unsplit"), 1);
+ m_frame->SetStatusText(wxT("Splitter unsplit"), 1);
#endif // wxUSE_STATUSBAR
event.Skip();
dc.DrawLine(0, 0, 100, 200);
dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
- dc.DrawText(_T("Testing"), 50, 50);
+ dc.DrawText(wxT("Testing"), 50, 50);
dc.SetPen(*wxRED_PEN);
dc.SetBrush(*wxGREEN_BRUSH);
return false;
// create the main application window
- MyFrame *frame = new MyFrame(_T("wxStatusBar sample"),
+ MyFrame *frame = new MyFrame(wxT("wxStatusBar sample"),
wxPoint(50, 50), wxSize(450, 340));
// and show it (the frames, unlike simple controls, are not shown when
// create a menu bar
wxMenu *menuFile = new wxMenu;
- menuFile->Append(StatusBar_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(StatusBar_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
wxMenu *statbarMenu = new wxMenu;
wxMenu *statbarStyleMenu = new wxMenu;
- statbarStyleMenu->Append(StatusBar_SetStyleSizeGrip, _T("wxSTB_SIZE_GRIP"), _T("Toggles the wxSTB_SIZE_GRIP style"), true);
- statbarStyleMenu->Append(StatusBar_SetStyleShowTips, _T("wxSTB_SHOW_TIPS"), _T("Toggles the wxSTB_SHOW_TIPS style"), true);
+ statbarStyleMenu->Append(StatusBar_SetStyleSizeGrip, wxT("wxSTB_SIZE_GRIP"), wxT("Toggles the wxSTB_SIZE_GRIP style"), true);
+ statbarStyleMenu->Append(StatusBar_SetStyleShowTips, wxT("wxSTB_SHOW_TIPS"), wxT("Toggles the wxSTB_SHOW_TIPS style"), true);
statbarStyleMenu->AppendSeparator();
- statbarStyleMenu->Append(StatusBar_SetStyleEllipsizeStart, _T("wxSTB_ELLIPSIZE_START"), _T("Toggles the wxSTB_ELLIPSIZE_START style"), true);
- statbarStyleMenu->Append(StatusBar_SetStyleEllipsizeMiddle, _T("wxSTB_ELLIPSIZE_MIDDLE"), _T("Toggles the wxSTB_ELLIPSIZE_MIDDLE style"), true);
- statbarStyleMenu->Append(StatusBar_SetStyleEllipsizeEnd, _T("wxSTB_ELLIPSIZE_END"), _T("Toggles the wxSTB_ELLIPSIZE_END style"), true);
- statbarMenu->Append(StatusBar_SetPaneStyle, _T("Status bar style"), statbarStyleMenu);
+ statbarStyleMenu->Append(StatusBar_SetStyleEllipsizeStart, wxT("wxSTB_ELLIPSIZE_START"), wxT("Toggles the wxSTB_ELLIPSIZE_START style"), true);
+ statbarStyleMenu->Append(StatusBar_SetStyleEllipsizeMiddle, wxT("wxSTB_ELLIPSIZE_MIDDLE"), wxT("Toggles the wxSTB_ELLIPSIZE_MIDDLE style"), true);
+ statbarStyleMenu->Append(StatusBar_SetStyleEllipsizeEnd, wxT("wxSTB_ELLIPSIZE_END"), wxT("Toggles the wxSTB_ELLIPSIZE_END style"), true);
+ statbarMenu->Append(StatusBar_SetPaneStyle, wxT("Status bar style"), statbarStyleMenu);
statbarMenu->AppendSeparator();
- statbarMenu->Append(StatusBar_SetFields, _T("&Set field count\tCtrl-C"),
- _T("Set the number of status bar fields"));
- statbarMenu->Append(StatusBar_SetTexts, _T("&Set field text\tCtrl-T"),
- _T("Set the text to display for each status bar field"));
- statbarMenu->Append(StatusBar_SetFont, _T("&Set field font\tCtrl-F"),
- _T("Set the font to use for rendering status bar fields"));
+ statbarMenu->Append(StatusBar_SetFields, wxT("&Set field count\tCtrl-C"),
+ wxT("Set the number of status bar fields"));
+ statbarMenu->Append(StatusBar_SetTexts, wxT("&Set field text\tCtrl-T"),
+ wxT("Set the text to display for each status bar field"));
+ statbarMenu->Append(StatusBar_SetFont, wxT("&Set field font\tCtrl-F"),
+ wxT("Set the font to use for rendering status bar fields"));
wxMenu *statbarPaneStyleMenu = new wxMenu;
- statbarPaneStyleMenu->Append(StatusBar_SetPaneStyleNormal, _T("&Normal"), _T("Sets the style of the first field to normal (sunken) look"), true);
- statbarPaneStyleMenu->Append(StatusBar_SetPaneStyleFlat, _T("&Flat"), _T("Sets the style of the first field to flat look"), true);
- statbarPaneStyleMenu->Append(StatusBar_SetPaneStyleRaised, _T("&Raised"), _T("Sets the style of the first field to raised look"), true);
- statbarMenu->Append(StatusBar_SetPaneStyle, _T("Field style"), statbarPaneStyleMenu);
+ statbarPaneStyleMenu->Append(StatusBar_SetPaneStyleNormal, wxT("&Normal"), wxT("Sets the style of the first field to normal (sunken) look"), true);
+ statbarPaneStyleMenu->Append(StatusBar_SetPaneStyleFlat, wxT("&Flat"), wxT("Sets the style of the first field to flat look"), true);
+ statbarPaneStyleMenu->Append(StatusBar_SetPaneStyleRaised, wxT("&Raised"), wxT("Sets the style of the first field to raised look"), true);
+ statbarMenu->Append(StatusBar_SetPaneStyle, wxT("Field style"), statbarPaneStyleMenu);
- statbarMenu->Append(StatusBar_ResetFieldsWidth, _T("Reset field widths"),
- _T("Sets all fields to the same width"));
+ statbarMenu->Append(StatusBar_ResetFieldsWidth, wxT("Reset field widths"),
+ wxT("Sets all fields to the same width"));
statbarMenu->AppendSeparator();
- statbarMenu->Append(StatusBar_Toggle, _T("&Toggle Status Bar"),
- _T("Toggle the status bar display"), true);
- statbarMenu->Append(StatusBar_Recreate, _T("&Recreate\tCtrl-R"),
- _T("Toggle status bar format"));
+ statbarMenu->Append(StatusBar_Toggle, wxT("&Toggle Status Bar"),
+ wxT("Toggle the status bar display"), true);
+ statbarMenu->Append(StatusBar_Recreate, wxT("&Recreate\tCtrl-R"),
+ wxT("Toggle status bar format"));
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(StatusBar_About, _T("&About...\tCtrl-A"), _T("Show about dialog"));
+ helpMenu->Append(StatusBar_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(statbarMenu, _T("&Status bar"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(statbarMenu, wxT("&Status bar"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// create default status bar to start with
DoCreateStatusBar(StatBar_Default, wxSTB_DEFAULT_STYLE);
- SetStatusText(_T("Welcome to wxWidgets!"));
+ SetStatusText(wxT("Welcome to wxWidgets!"));
}
MyFrame::~MyFrame()
long nFields = wxGetNumberFromUser
(
- _T("Select the number of fields in the status bar"),
- _T("Fields:"),
- _T("wxWidgets statusbar sample"),
+ wxT("Select the number of fields in the status bar"),
+ wxT("Fields:"),
+ wxT("wxWidgets statusbar sample"),
sb->GetFieldsCount(),
1, 5,
this
if ( widths )
{
if ( widths[n] > 0 )
- s.Printf(_T("fixed (%d)"), widths[n]);
+ s.Printf(wxT("fixed (%d)"), widths[n]);
else
- s.Printf(_T("variable (*%d)"), -widths[n]);
+ s.Printf(wxT("variable (*%d)"), -widths[n]);
}
else
{
- s = _T("default");
+ s = wxT("default");
}
SetStatusText(s, n);
// ----------------------------------------------------------------------------
MyAboutDialog::MyAboutDialog(wxWindow *parent)
- : wxDialog(parent, wxID_ANY, wxString(_T("About statbar")),
+ : wxDialog(parent, wxID_ANY, wxString(wxT("About statbar")),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
wxStaticText *text = new wxStaticText(this, wxID_ANY,
- _T("wxStatusBar sample\n")
- _T("(c) 2000 Vadim Zeitlin"));
+ wxT("wxStatusBar sample\n")
+ wxT("(c) 2000 Vadim Zeitlin"));
- wxButton *btn = new wxButton(this, wxID_OK, _T("&Close"));
+ wxButton *btn = new wxButton(this, wxID_OK, wxT("&Close"));
// create the top status bar without the size grip (default style),
// otherwise it looks weird
wxStatusBar *statbarTop = new wxStatusBar(this, wxID_ANY, 0);
statbarTop->SetFieldsCount(3);
- statbarTop->SetStatusText(_T("This is a top status bar"), 0);
- statbarTop->SetStatusText(_T("in a dialog"), 1);
- statbarTop->SetStatusText(_T("Great, isn't it?"), 2);
+ statbarTop->SetStatusText(wxT("This is a top status bar"), 0);
+ statbarTop->SetStatusText(wxT("in a dialog"), 1);
+ statbarTop->SetStatusText(wxT("Great, isn't it?"), 2);
wxStatusBar *statbarBottom = new wxStatusBar(this, wxID_ANY);
statbarBottom->SetFieldsCount(2);
- statbarBottom->SetStatusText(_T("This is a bottom status bar"), 0);
- statbarBottom->SetStatusText(_T("in a dialog"), 1);
+ statbarBottom->SetStatusText(wxT("This is a bottom status bar"), 0);
+ statbarBottom->SetStatusText(wxT("in a dialog"), 1);
wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
sizerTop->Add(statbarTop, 0, wxGROW);
SetStatusWidths(Field_Max, widths);
#if wxUSE_CHECKBOX
- m_checkbox = new wxCheckBox(this, StatusBar_Checkbox, _T("&Toggle clock"));
+ m_checkbox = new wxCheckBox(this, StatusBar_Checkbox, wxT("&Toggle clock"));
m_checkbox->SetValue(true);
#endif
StyleSetFont (wxSTC_STYLE_DEFAULT, font);
StyleSetForeground (wxSTC_STYLE_DEFAULT, *wxBLACK);
StyleSetBackground (wxSTC_STYLE_DEFAULT, *wxWHITE);
- StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (_T("DARK GREY")));
+ StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY")));
StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE);
- StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour (_T("DARK GREY")));
+ StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY")));
InitializePrefs (DEFAULT_LANGUAGE);
// set visibility
SetYCaretPolicy (wxSTC_CARET_EVEN|wxSTC_VISIBLE_STRICT|wxSTC_CARET_SLOP, 1);
// markers
- MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_DOTDOTDOT, _T("BLACK"), _T("BLACK"));
- MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN, _T("BLACK"), _T("BLACK"));
- MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, _T("BLACK"), _T("BLACK"));
- MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_DOTDOTDOT, _T("BLACK"), _T("WHITE"));
- MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN, _T("BLACK"), _T("WHITE"));
- MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, _T("BLACK"), _T("BLACK"));
- MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, _T("BLACK"), _T("BLACK"));
+ MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_DOTDOTDOT, wxT("BLACK"), wxT("BLACK"));
+ MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN, wxT("BLACK"), wxT("BLACK"));
+ MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK"));
+ MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_DOTDOTDOT, wxT("BLACK"), wxT("WHITE"));
+ MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN, wxT("BLACK"), wxT("WHITE"));
+ MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK"));
+ MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK"));
// miscelaneous
- m_LineNrMargin = TextWidth (wxSTC_STYLE_LINENUMBER, _T("_999999"));
+ m_LineNrMargin = TextWidth (wxSTC_STYLE_LINENUMBER, wxT("_999999"));
m_FoldingMargin = 16;
CmdKeyClear (wxSTC_KEY_TAB, 0); // this is done by the menu accelerator key
SetLayoutCache (wxSTC_CACHE_PAGE);
while (!filepattern.empty()) {
wxString cur = filepattern.BeforeFirst (';');
if ((cur == filename) ||
- (cur == (filename.BeforeLast ('.') + _T(".*"))) ||
- (cur == (_T("*.") + filename.AfterLast ('.')))) {
+ (cur == (filename.BeforeLast ('.') + wxT(".*"))) ||
+ (cur == (wxT("*.") + filename.AfterLast ('.')))) {
return curInfo->name;
}
filepattern = filepattern.AfterFirst (';');
// set margin for line numbers
SetMarginType (m_LineNrID, wxSTC_MARGIN_NUMBER);
- StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (_T("DARK GREY")));
+ StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY")));
StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE);
SetMarginWidth (m_LineNrID, 0); // start out not visible
}
// set common styles
- StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour (_T("DARK GREY")));
- StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour (_T("DARK GREY")));
+ StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour (wxT("DARK GREY")));
+ StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY")));
// initialize settings
if (g_CommonPrefs.syntaxEnable) {
if (g_CommonPrefs.foldEnable) {
SetMarginWidth (m_FoldingID, curInfo->folds != 0? m_FoldingMargin: 0);
SetMarginSensitive (m_FoldingID, curInfo->folds != 0);
- SetProperty (_T("fold"), curInfo->folds != 0? _T("1"): _T("0"));
- SetProperty (_T("fold.comment"),
- (curInfo->folds & mySTC_FOLD_COMMENT) > 0? _T("1"): _T("0"));
- SetProperty (_T("fold.compact"),
- (curInfo->folds & mySTC_FOLD_COMPACT) > 0? _T("1"): _T("0"));
- SetProperty (_T("fold.preprocessor"),
- (curInfo->folds & mySTC_FOLD_PREPROC) > 0? _T("1"): _T("0"));
- SetProperty (_T("fold.html"),
- (curInfo->folds & mySTC_FOLD_HTML) > 0? _T("1"): _T("0"));
- SetProperty (_T("fold.html.preprocessor"),
- (curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? _T("1"): _T("0"));
- SetProperty (_T("fold.comment.python"),
- (curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? _T("1"): _T("0"));
- SetProperty (_T("fold.quotes.python"),
- (curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? _T("1"): _T("0"));
+ SetProperty (wxT("fold"), curInfo->folds != 0? wxT("1"): wxT("0"));
+ SetProperty (wxT("fold.comment"),
+ (curInfo->folds & mySTC_FOLD_COMMENT) > 0? wxT("1"): wxT("0"));
+ SetProperty (wxT("fold.compact"),
+ (curInfo->folds & mySTC_FOLD_COMPACT) > 0? wxT("1"): wxT("0"));
+ SetProperty (wxT("fold.preprocessor"),
+ (curInfo->folds & mySTC_FOLD_PREPROC) > 0? wxT("1"): wxT("0"));
+ SetProperty (wxT("fold.html"),
+ (curInfo->folds & mySTC_FOLD_HTML) > 0? wxT("1"): wxT("0"));
+ SetProperty (wxT("fold.html.preprocessor"),
+ (curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? wxT("1"): wxT("0"));
+ SetProperty (wxT("fold.comment.python"),
+ (curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? wxT("1"): wxT("0"));
+ SetProperty (wxT("fold.quotes.python"),
+ (curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? wxT("1"): wxT("0"));
}
SetFoldFlags (wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED |
wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED);
#if wxUSE_FILEDLG
// get filname
if (!m_filename) {
- wxFileDialog dlg (this, _T("Open file"), wxEmptyString, wxEmptyString,
- _T("Any file (*)|*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
+ wxFileDialog dlg (this, wxT("Open file"), wxEmptyString, wxEmptyString,
+ wxT("Any file (*)|*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
if (dlg.ShowModal() != wxID_OK) return false;
m_filename = dlg.GetPath();
}
// get filname
if (!m_filename) {
- wxFileDialog dlg (this, _T("Save file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"),
+ wxFileDialog dlg (this, wxT("Save file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
if (dlg.ShowModal() != wxID_OK) return false;
m_filename = dlg.GetPath();
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Lexer-ID: "),
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
- text = wxString::Format (_T("%d"), edit->GetLexer());
+ text = wxString::Format (wxT("%d"), edit->GetLexer());
textinfo->Add (new wxStaticText (this, wxID_ANY, text),
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
wxString EOLtype = wxEmptyString;
switch (edit->GetEOLMode()) {
- case wxSTC_EOL_CR: {EOLtype = _T("CR (Unix)"); break; }
- case wxSTC_EOL_CRLF: {EOLtype = _T("CRLF (Windows)"); break; }
- case wxSTC_EOL_LF: {EOLtype = _T("CR (Macintosh)"); break; }
+ case wxSTC_EOL_CR: {EOLtype = wxT("CR (Unix)"); break; }
+ case wxSTC_EOL_CRLF: {EOLtype = wxT("CRLF (Windows)"); break; }
+ case wxSTC_EOL_LF: {EOLtype = wxT("CR (Macintosh)"); break; }
}
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Line endings"),
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
statistic->Add (new wxStaticText (this, wxID_ANY, _("Total lines"),
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
- text = wxString::Format (_T("%d"), edit->GetLineCount());
+ text = wxString::Format (wxT("%d"), edit->GetLineCount());
statistic->Add (new wxStaticText (this, wxID_ANY, text),
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
statistic->Add (new wxStaticText (this, wxID_ANY, _("Total chars"),
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
- text = wxString::Format (_T("%d"), edit->GetTextLength());
+ text = wxString::Format (wxT("%d"), edit->GetTextLength());
statistic->Add (new wxStaticText (this, wxID_ANY, text),
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
statistic->Add (new wxStaticText (this, wxID_ANY, _("Current line"),
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
- text = wxString::Format (_T("%d"), edit->GetCurrentLine());
+ text = wxString::Format (wxT("%d"), edit->GetCurrentLine());
statistic->Add (new wxStaticText (this, wxID_ANY, text),
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
statistic->Add (new wxStaticText (this, wxID_ANY, _("Current pos"),
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
- text = wxString::Format (_T("%d"), edit->GetCurrentPos());
+ text = wxString::Format (wxT("%d"), edit->GetCurrentPos());
statistic->Add (new wxStaticText (this, wxID_ANY, text),
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
public:
//! constructor
- EditPrint (Edit *edit, const wxChar *title = _T(""));
+ EditPrint (Edit *edit, const wxChar *title = wxT(""));
//! event handlers
bool OnPrintPage (int page);
//! style types
const StyleInfo g_StylePrefs [] = {
// mySTC_TYPE_DEFAULT
- {_T("Default"),
- _T("BLACK"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Default"),
+ wxT("BLACK"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_WORD1
- {_T("Keyword1"),
- _T("BLUE"), _T("WHITE"),
- _T(""), 10, mySTC_STYLE_BOLD, 0},
+ {wxT("Keyword1"),
+ wxT("BLUE"), wxT("WHITE"),
+ wxT(""), 10, mySTC_STYLE_BOLD, 0},
// mySTC_TYPE_WORD2
- {_T("Keyword2"),
- _T("DARK BLUE"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Keyword2"),
+ wxT("DARK BLUE"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_WORD3
- {_T("Keyword3"),
- _T("CORNFLOWER BLUE"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Keyword3"),
+ wxT("CORNFLOWER BLUE"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_WORD4
- {_T("Keyword4"),
- _T("CYAN"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Keyword4"),
+ wxT("CYAN"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_WORD5
- {_T("Keyword5"),
- _T("DARK GREY"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Keyword5"),
+ wxT("DARK GREY"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_WORD6
- {_T("Keyword6"),
- _T("GREY"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Keyword6"),
+ wxT("GREY"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_COMMENT
- {_T("Comment"),
- _T("FOREST GREEN"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Comment"),
+ wxT("FOREST GREEN"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_COMMENT_DOC
- {_T("Comment (Doc)"),
- _T("FOREST GREEN"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Comment (Doc)"),
+ wxT("FOREST GREEN"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_COMMENT_LINE
- {_T("Comment line"),
- _T("FOREST GREEN"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Comment line"),
+ wxT("FOREST GREEN"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_COMMENT_SPECIAL
- {_T("Special comment"),
- _T("FOREST GREEN"), _T("WHITE"),
- _T(""), 10, mySTC_STYLE_ITALIC, 0},
+ {wxT("Special comment"),
+ wxT("FOREST GREEN"), wxT("WHITE"),
+ wxT(""), 10, mySTC_STYLE_ITALIC, 0},
// mySTC_TYPE_CHARACTER
- {_T("Character"),
- _T("KHAKI"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Character"),
+ wxT("KHAKI"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_CHARACTER_EOL
- {_T("Character (EOL)"),
- _T("KHAKI"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Character (EOL)"),
+ wxT("KHAKI"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_STRING
- {_T("String"),
- _T("BROWN"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("String"),
+ wxT("BROWN"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_STRING_EOL
- {_T("String (EOL)"),
- _T("BROWN"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("String (EOL)"),
+ wxT("BROWN"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_DELIMITER
- {_T("Delimiter"),
- _T("ORANGE"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Delimiter"),
+ wxT("ORANGE"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_PUNCTUATION
- {_T("Punctuation"),
- _T("ORANGE"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Punctuation"),
+ wxT("ORANGE"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_OPERATOR
- {_T("Operator"),
- _T("BLACK"), _T("WHITE"),
- _T(""), 10, mySTC_STYLE_BOLD, 0},
+ {wxT("Operator"),
+ wxT("BLACK"), wxT("WHITE"),
+ wxT(""), 10, mySTC_STYLE_BOLD, 0},
// mySTC_TYPE_BRACE
- {_T("Label"),
- _T("VIOLET"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Label"),
+ wxT("VIOLET"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_COMMAND
- {_T("Command"),
- _T("BLUE"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Command"),
+ wxT("BLUE"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_IDENTIFIER
- {_T("Identifier"),
- _T("BLACK"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Identifier"),
+ wxT("BLACK"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_LABEL
- {_T("Label"),
- _T("VIOLET"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Label"),
+ wxT("VIOLET"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_NUMBER
- {_T("Number"),
- _T("SIENNA"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Number"),
+ wxT("SIENNA"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_PARAMETER
- {_T("Parameter"),
- _T("VIOLET"), _T("WHITE"),
- _T(""), 10, mySTC_STYLE_ITALIC, 0},
+ {wxT("Parameter"),
+ wxT("VIOLET"), wxT("WHITE"),
+ wxT(""), 10, mySTC_STYLE_ITALIC, 0},
// mySTC_TYPE_REGEX
- {_T("Regular expression"),
- _T("ORCHID"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Regular expression"),
+ wxT("ORCHID"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_UUID
- {_T("UUID"),
- _T("ORCHID"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("UUID"),
+ wxT("ORCHID"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_VALUE
- {_T("Value"),
- _T("ORCHID"), _T("WHITE"),
- _T(""), 10, mySTC_STYLE_ITALIC, 0},
+ {wxT("Value"),
+ wxT("ORCHID"), wxT("WHITE"),
+ wxT(""), 10, mySTC_STYLE_ITALIC, 0},
// mySTC_TYPE_PREPROCESSOR
- {_T("Preprocessor"),
- _T("GREY"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Preprocessor"),
+ wxT("GREY"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_SCRIPT
- {_T("Script"),
- _T("DARK GREY"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Script"),
+ wxT("DARK GREY"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_ERROR
- {_T("Error"),
- _T("RED"), _T("WHITE"),
- _T(""), 10, 0, 0},
+ {wxT("Error"),
+ wxT("RED"), wxT("WHITE"),
+ wxT(""), 10, 0, 0},
// mySTC_TYPE_UNDEFINED
- {_T("Undefined"),
- _T("ORANGE"), _T("WHITE"),
- _T(""), 10, 0, 0}
+ {wxT("Undefined"),
+ wxT("ORANGE"), wxT("WHITE"),
+ wxT(""), 10, 0, 0}
};
// declarations
//============================================================================
-#define APP_NAME _T("STC-Test")
+#define APP_NAME wxT("STC-Test")
#define APP_DESCR _("See http://wxguide.sourceforge.net/")
-#define APP_MAINT _T("Otto Wyss")
-#define APP_VENDOR _T("wxWidgets")
-#define APP_COPYRIGTH _T("(C) 2003 Otto Wyss")
-#define APP_LICENCE _T("wxWidgets")
+#define APP_MAINT wxT("Otto Wyss")
+#define APP_VENDOR wxT("wxWidgets")
+#define APP_COPYRIGTH wxT("(C) 2003 Otto Wyss")
+#define APP_LICENCE wxT("wxWidgets")
-#define APP_VERSION _T("0.1.alpha")
+#define APP_VERSION wxT("0.1.alpha")
#define APP_BUILD __DATE__
-#define APP_WEBSITE _T("http://www.wxWidgets.org")
-#define APP_MAIL _T("mailto://???")
+#define APP_WEBSITE wxT("http://www.wxWidgets.org")
+#define APP_MAIL wxT("mailto://???")
#define NONAME _("<untitled>")
SetVendorName (APP_VENDOR);
g_appname = new wxString ();
g_appname->Append (APP_VENDOR);
- g_appname->Append (_T("-"));
+ g_appname->Append (wxT("-"));
g_appname->Append (APP_NAME);
#if wxUSE_PRINTING_ARCHITECTURE
// set icon and background
SetTitle (*g_appname);
SetIcon (wxICON (mondrian));
- SetBackgroundColour (_T("WHITE"));
+ SetBackgroundColour (wxT("WHITE"));
// about box shown for 1 seconds
AppAbout dlg(this, 1000);
m_edit = new Edit (this, wxID_ANY);
m_edit->SetFocus();
- FileOpen (_T("stctest.cpp"));
+ FileOpen (wxT("stctest.cpp"));
}
AppFrame::~AppFrame () {
if (!m_edit) return;
#if wxUSE_FILEDLG
wxString fname;
- wxFileDialog dlg (this, _T("Open file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"),
+ wxFileDialog dlg (this, wxT("Open file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
if (dlg.ShowModal() != wxID_OK) return;
fname = dlg.GetPath ();
if (!m_edit) return;
#if wxUSE_FILEDLG
wxString filename = wxEmptyString;
- wxFileDialog dlg (this, _T("Save file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
+ wxFileDialog dlg (this, wxT("Save file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
if (dlg.ShowModal() != wxID_OK) return;
filename = dlg.GetPath();
m_edit->SaveFile (filename);
MyCanvas::MyCanvas(MyChild *parent, const wxPoint& pos, const wxSize& size)
: wxScrolledWindow(parent, wxID_ANY, pos, size, wxSUNKEN_BORDER|wxVSCROLL|wxHSCROLL)
{
- SetBackgroundColour(wxColour(_T("WHITE")));
+ SetBackgroundColour(wxColour(wxT("WHITE")));
m_child = parent;
m_index = m_child->GetFrame()->GetCountOfChildren() % 7;
dc.SetBrush(*wxCYAN_BRUSH);
dc.SetPen(*wxRED_PEN);
dc.DrawRectangle(10, 10, 100, 70);
- wB = wxBrush (_T("DARK ORCHID"), wxBRUSHSTYLE_TRANSPARENT);
+ wB = wxBrush (wxT("DARK ORCHID"), wxBRUSHSTYLE_TRANSPARENT);
dc.SetBrush (wB);
dc.DrawRoundedRectangle(50, 50, 100, 70, 20);
- dc.SetBrush (wxBrush(_T("GOLDENROD")) );
+ dc.SetBrush (wxBrush(wxT("GOLDENROD")) );
dc.DrawEllipse(100, 100, 100, 50);
points[0].x = 100; points[0].y = 200;
dc.DrawLine(45,30,55,30);
dc.DrawText(wxT("This is a Swiss-style string"), 50, 30);
wC = dc.GetTextForeground();
- dc.SetTextForeground (_T("FIREBRICK"));
+ dc.SetTextForeground (wxT("FIREBRICK"));
// no effect in msw ??
- dc.SetTextBackground (_T("WHEAT"));
+ dc.SetTextBackground (wxT("WHEAT"));
dc.DrawText(wxT("This is a Red string"), 50, 200);
dc.DrawRotatedText(wxT("This is a 45 deg string"), 50, 200, 45);
dc.DrawRotatedText(wxT("This is a 90 deg string"), 50, 200, 90);
dc.DrawArc ( 270-50, 270-86, 270-86, 270-50, 270,270 );
dc.SetDeviceOrigin(0,0);
- wP.SetColour (_T("CADET BLUE"));
+ wP.SetColour (wxT("CADET BLUE"));
dc.SetPen(wP);
dc.DrawArc ( 75,125, 110, 40, 75, 75 );
- wP.SetColour (_T("SALMON"));
+ wP.SetColour (wxT("SALMON"));
dc.SetPen(wP);
dc.SetBrush(*wxRED_BRUSH);
//top left corner, width and height, start and end angle
wP.SetWidth(3);
dc.SetPen(wP);
//wxTRANSPARENT));
- dc.SetBrush (wxBrush (_T("SALMON")));
+ dc.SetBrush (wxBrush (wxT("SALMON")));
dc.DrawEllipticArc(300, 0,200,100, 0.0,145.0);
//same end point
dc.DrawEllipticArc(300, 50,200,100,90.0,145.0);
case 4:
dc.DrawCheckMark ( 30,30,25,25);
- dc.SetBrush (wxBrush (_T("SALMON"),wxBRUSHSTYLE_TRANSPARENT));
+ dc.SetBrush (wxBrush (wxT("SALMON"),wxBRUSHSTYLE_TRANSPARENT));
dc.DrawCheckMark ( 80,50,75,75);
dc.DrawRectangle ( 80,50,75,75);
#if wxUSE_STATUSBAR
{
if ( m_panel->NavigateIn(flags) )
{
- wxLogStatus(this, _T("Navigation event processed"));
+ wxLogStatus(this, wxT("Navigation event processed"));
}
else
{
- wxLogStatus(this, _T("Navigation event ignored"));
+ wxLogStatus(this, wxT("Navigation event ignored"));
}
}
if ( event.GetKeyCode() == WXK_TAB &&
wxMessageBox
(
- _T("Let the Tab be used for navigation?"),
- _T("wxWidgets TabOrder sample: Tab key pressed"),
+ wxT("Let the Tab be used for navigation?"),
+ wxT("wxWidgets TabOrder sample: Tab key pressed"),
wxICON_QUESTION | wxYES_NO,
this
) != wxYES )
END_EVENT_TABLE()
MyFrame::MyFrame()
- : wxFrame(NULL, wxID_ANY, _T("TabOrder wxWidgets Sample"),
+ : wxFrame(NULL, wxID_ANY, wxT("TabOrder wxWidgets Sample"),
wxDefaultPosition, wxSize(700, 450))
{
SetIcon(wxICON(sample));
menuFile->Append(TabOrder_Quit);
wxMenu *menuNav = new wxMenu;
- menuNav->Append(TabOrder_TabForward, _T("Tab &forward\tCtrl-F"),
- _T("Emulate a <Tab> press"));
- menuNav->Append(TabOrder_TabBackward, _T("Tab &backward\tCtrl-B"),
- _T("Emulate a <Shift-Tab> press"));
+ menuNav->Append(TabOrder_TabForward, wxT("Tab &forward\tCtrl-F"),
+ wxT("Emulate a <Tab> press"));
+ menuNav->Append(TabOrder_TabBackward, wxT("Tab &backward\tCtrl-B"),
+ wxT("Emulate a <Shift-Tab> press"));
wxMenuBar *mbar = new wxMenuBar;
- mbar->Append(menuFile, _T("&File"));
- mbar->Append(menuNav, _T("&Navigate"));
+ mbar->Append(menuFile, wxT("&File"));
+ mbar->Append(menuNav, wxT("&Navigate"));
SetMenuBar(mbar);
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("Tab navigation sample\n(c) 2007 Vadim Zeitlin"),
- _T("About TabOrder wxWidgets Sample"), wxOK, this);
+ wxMessageBox(wxT("Tab navigation sample\n(c) 2007 Vadim Zeitlin"),
+ wxT("About TabOrder wxWidgets Sample"), wxOK, this);
}
void MyFrame::OnTabForward(wxCommandEvent& WXUNUSED(event))
wxString msg;
if ( focus )
{
- msg.Printf(_T("Focus is at %s"), s_windowFocus->GetName().c_str());
+ msg.Printf(wxT("Focus is at %s"), s_windowFocus->GetName().c_str());
}
else
{
- msg = _T("No focus");
+ msg = wxT("No focus");
}
SetStatusText(msg, StatusPane_Focus);
: wxPanel(parent, wxID_ANY)
{
wxNotebook *notebook = new wxNotebook(this, wxID_ANY);
- notebook->AddPage(CreateButtonPage(notebook), _T("Button"));
- notebook->AddPage(CreateTextPage(notebook), _T("Text"));
+ notebook->AddPage(CreateButtonPage(notebook), wxT("Button"));
+ notebook->AddPage(CreateTextPage(notebook), wxT("Text"));
wxSizer *sizerV = new wxBoxSizer(wxVERTICAL);
sizerV->Add(notebook, wxSizerFlags(1).Expand());
wxListBox *lbox = new wxListBox(this, wxID_ANY);
- lbox->AppendString(_T("Just a"));
- lbox->AppendString(_T("simple"));
- lbox->AppendString(_T("listbox"));
+ lbox->AppendString(wxT("Just a"));
+ lbox->AppendString(wxT("simple"));
+ lbox->AppendString(wxT("listbox"));
sizerV->Add(lbox, wxSizerFlags(1).Expand());
SetSizerAndFit(sizerV);
wxPanel *page = new wxPanel(parent);
wxSizer *sizerPage = new wxBoxSizer(wxHORIZONTAL);
- sizerPage->Add(new wxButton(page, wxID_ANY, _T("&First")), flagsBorder);
- sizerPage->Add(new wxStaticText(page, wxID_ANY, _T("[st&atic]")),
+ sizerPage->Add(new wxButton(page, wxID_ANY, wxT("&First")), flagsBorder);
+ sizerPage->Add(new wxStaticText(page, wxID_ANY, wxT("[st&atic]")),
flagsBorder);
- sizerPage->Add(new wxButton(page, wxID_ANY, _T("&Second")), flagsBorder);
+ sizerPage->Add(new wxButton(page, wxID_ANY, wxT("&Second")), flagsBorder);
page->SetSizer(sizerPage);
wxPanel *page = new wxPanel(parent);
wxSizer *sizerH = new wxBoxSizer(wxHORIZONTAL);
- sizerH->Add(new wxStaticText(page, wxID_ANY, _T("&Label:")), flagsBorder);
- sizerH->Add(new MyTabTextCtrl(page, _T("TAB ignored here")), flagsBorder);
+ sizerH->Add(new wxStaticText(page, wxID_ANY, wxT("&Label:")), flagsBorder);
+ sizerH->Add(new MyTabTextCtrl(page, wxT("TAB ignored here")), flagsBorder);
sizerPage->Add(sizerH, wxSizerFlags(1).Expand());
sizerH = new wxBoxSizer(wxHORIZONTAL);
- sizerH->Add(new wxStaticText(page, wxID_ANY, _T("&Another one:")),
+ sizerH->Add(new wxStaticText(page, wxID_ANY, wxT("&Another one:")),
flagsBorder);
- sizerH->Add(new MyTabTextCtrl(page, _T("press Tab here"), wxTE_PROCESS_TAB),
+ sizerH->Add(new MyTabTextCtrl(page, wxT("press Tab here"), wxTE_PROCESS_TAB),
flagsBorder);
sizerPage->Add(sizerH, wxSizerFlags(1).Expand());
(
this,
wxID_ANY,
- _T("Press 'Hide me' to hide this window, Exit to quit.")
+ wxT("Press 'Hide me' to hide this window, Exit to quit.")
), flags);
sizerTop->Add(new wxStaticText
(
this,
wxID_ANY,
- _T("Double-click on the taskbar icon to show me again.")
+ wxT("Double-click on the taskbar icon to show me again.")
), flags);
sizerTop->AddStretchSpacer()->SetMinSize(200, 50);
wxSizer * const sizerBtns = new wxBoxSizer(wxHORIZONTAL);
- sizerBtns->Add(new wxButton(this, wxID_ABOUT, _T("&About")), flags);
- sizerBtns->Add(new wxButton(this, wxID_OK, _T("&Hide")), flags);
- sizerBtns->Add(new wxButton(this, wxID_EXIT, _T("E&xit")), flags);
+ sizerBtns->Add(new wxButton(this, wxID_ABOUT, wxT("&About")), flags);
+ sizerBtns->Add(new wxButton(this, wxID_OK, wxT("&Hide")), flags);
+ sizerBtns->Add(new wxButton(this, wxID_EXIT, wxT("E&xit")), flags);
sizerTop->Add(sizerBtns, flags.Align(wxALIGN_CENTER_HORIZONTAL));
SetSizerAndFit(sizerTop);
wxMenu *MyTaskBarIcon::CreatePopupMenu()
{
wxMenu *menu = new wxMenu;
- menu->Append(PU_RESTORE, _T("&Restore main window"));
+ menu->Append(PU_RESTORE, wxT("&Restore main window"));
menu->AppendSeparator();
- menu->Append(PU_NEW_ICON, _T("&Set New Icon"));
+ menu->Append(PU_NEW_ICON, wxT("&Set New Icon"));
menu->AppendSeparator();
- menu->AppendCheckItem(PU_CHECKMARK, _T("Test &check mark"));
+ menu->AppendCheckItem(PU_CHECKMARK, wxT("Test &check mark"));
menu->AppendSeparator();
wxMenu *submenu = new wxMenu;
- submenu->Append(PU_SUB1, _T("One submenu"));
+ submenu->Append(PU_SUB1, wxT("One submenu"));
submenu->AppendSeparator();
- submenu->Append(PU_SUB2, _T("Another submenu"));
- menu->Append(PU_SUBMAIN, _T("Submenu"), submenu);
+ submenu->Append(PU_SUB2, wxT("Another submenu"));
+ menu->Append(PU_SUBMAIN, wxT("Submenu"), submenu);
#ifndef __WXMAC_OSX__ /*Mac has built-in quit menu*/
menu->AppendSeparator();
- menu->Append(PU_EXIT, _T("E&xit"));
+ menu->Append(PU_EXIT, wxT("E&xit"));
#endif
return menu;
}
static bool ms_logClip;
private:
- static inline wxChar GetChar(bool on, wxChar c) { return on ? c : _T('-'); }
+ static inline wxChar GetChar(bool on, wxChar c) { return on ? c : wxT('-'); }
void LogKeyEvent(const wxChar *name, wxKeyEvent& event) const;
void LogClipEvent(const wxChar *what, wxClipboardTextEvent& event);
#if wxUSE_CLIPBOARD
void OnPasteFromClipboard( wxCommandEvent& WXUNUSED(event) )
{
- wxLogMessage(_T("Pasting text from clipboard."));
+ wxLogMessage(wxT("Pasting text from clipboard."));
m_panel->DoPasteFromClipboard();
}
void OnCopyToClipboard( wxCommandEvent& WXUNUSED(event) )
{
- wxLogMessage(_T("Copying text to clipboard."));
+ wxLogMessage(wxT("Copying text to clipboard."));
m_panel->DoCopyToClipboard();
}
{
if ( !m_panel->m_textrich->LineDown() )
{
- wxLogMessage(_T("Already at the bottom"));
+ wxLogMessage(wxT("Already at the bottom"));
}
}
{
if ( !m_panel->m_textrich->LineUp() )
{
- wxLogMessage(_T("Already at the top"));
+ wxLogMessage(wxT("Already at the top"));
}
}
{
if ( !m_panel->m_textrich->PageDown() )
{
- wxLogMessage(_T("Already at the bottom"));
+ wxLogMessage(wxT("Already at the bottom"));
}
}
{
if ( !m_panel->m_textrich->PageUp() )
{
- wxLogMessage(_T("Already at the top"));
+ wxLogMessage(wxT("Already at the top"));
}
}
void OnSetText(wxCommandEvent& WXUNUSED(event))
{
- m_panel->m_text->SetValue(_T("Hello, world! (what else did you expect?)"));
+ m_panel->m_text->SetValue(wxT("Hello, world! (what else did you expect?)"));
}
void OnChangeText(wxCommandEvent& WXUNUSED(event))
{
- m_panel->m_text->ChangeValue(_T("Changed, not set: no event"));
+ m_panel->m_text->ChangeValue(wxT("Changed, not set: no event"));
}
void OnIdle( wxIdleEvent& event );
// Create the main frame window
MyFrame *frame = new MyFrame((wxFrame *) NULL,
- _T("Text wxWidgets sample"), 50, 50, 700, 550);
+ wxT("Text wxWidgets sample"), 50, 50, 700, 550);
frame->SetSizeHints( 500, 400 );
wxMenu *file_menu = new wxMenu;
- file_menu->Append(TEXT_SAVE, _T("&Save file\tCtrl-S"),
- _T("Save the text control contents to file"));
- file_menu->Append(TEXT_LOAD, _T("&Load file\tCtrl-O"),
- _T("Load the sample file into text control"));
+ file_menu->Append(TEXT_SAVE, wxT("&Save file\tCtrl-S"),
+ wxT("Save the text control contents to file"));
+ file_menu->Append(TEXT_LOAD, wxT("&Load file\tCtrl-O"),
+ wxT("Load the sample file into text control"));
file_menu->AppendSeparator();
- file_menu->Append(TEXT_RICH_TEXT_TEST, _T("Show Rich Text Editor"));
+ file_menu->Append(TEXT_RICH_TEXT_TEST, wxT("Show Rich Text Editor"));
file_menu->AppendSeparator();
- file_menu->Append(TEXT_ABOUT, _T("&About\tAlt-A"));
+ file_menu->Append(TEXT_ABOUT, wxT("&About\tAlt-A"));
file_menu->AppendSeparator();
- file_menu->Append(TEXT_QUIT, _T("E&xit\tAlt-X"), _T("Quit this sample"));
+ file_menu->Append(TEXT_QUIT, wxT("E&xit\tAlt-X"), wxT("Quit this sample"));
wxMenuBar *menu_bar = new wxMenuBar( wxMB_DOCKABLE );
- menu_bar->Append(file_menu, _T("&File"));
+ menu_bar->Append(file_menu, wxT("&File"));
#if wxUSE_TOOLTIPS
wxMenu *tooltip_menu = new wxMenu;
- tooltip_menu->Append(TEXT_TOOLTIPS_SETDELAY, _T("Set &delay\tCtrl-D"));
+ tooltip_menu->Append(TEXT_TOOLTIPS_SETDELAY, wxT("Set &delay\tCtrl-D"));
tooltip_menu->AppendSeparator();
- tooltip_menu->Append(TEXT_TOOLTIPS_ENABLE, _T("&Toggle tooltips\tCtrl-T"),
- _T("enable/disable tooltips"), true);
+ tooltip_menu->Append(TEXT_TOOLTIPS_ENABLE, wxT("&Toggle tooltips\tCtrl-T"),
+ wxT("enable/disable tooltips"), true);
tooltip_menu->Check(TEXT_TOOLTIPS_ENABLE, true);
- menu_bar->Append(tooltip_menu, _T("&Tooltips"));
+ menu_bar->Append(tooltip_menu, wxT("&Tooltips"));
#endif // wxUSE_TOOLTIPS
#if wxUSE_CLIPBOARD
// notice that we use non default accelerators on purpose here to compare
// their behaviour with the built in handling of standard Ctrl/Cmd-C/V
wxMenu *menuClipboard = new wxMenu;
- menuClipboard->Append(TEXT_CLIPBOARD_COPY, _T("&Copy\tCtrl-Shift-C"),
- _T("Copy the selection to the clipboard"));
- menuClipboard->Append(TEXT_CLIPBOARD_PASTE, _T("&Paste\tCtrl-Shift-V"),
- _T("Paste from clipboard to the text control"));
+ menuClipboard->Append(TEXT_CLIPBOARD_COPY, wxT("&Copy\tCtrl-Shift-C"),
+ wxT("Copy the selection to the clipboard"));
+ menuClipboard->Append(TEXT_CLIPBOARD_PASTE, wxT("&Paste\tCtrl-Shift-V"),
+ wxT("Paste from clipboard to the text control"));
menuClipboard->AppendSeparator();
- menuClipboard->AppendCheckItem(TEXT_CLIPBOARD_VETO, _T("Vet&o\tCtrl-Shift-O"),
- _T("Veto all clipboard operations"));
- menu_bar->Append(menuClipboard, _T("&Clipboard"));
+ menuClipboard->AppendCheckItem(TEXT_CLIPBOARD_VETO, wxT("Vet&o\tCtrl-Shift-O"),
+ wxT("Veto all clipboard operations"));
+ menu_bar->Append(menuClipboard, wxT("&Clipboard"));
#endif // wxUSE_CLIPBOARD
wxMenu *menuText = new wxMenu;
- menuText->Append(TEXT_ADD_SOME, _T("&Append some text\tCtrl-A"));
- menuText->Append(TEXT_ADD_FREEZE, _T("&Append text with freeze/thaw\tShift-Ctrl-A"));
- menuText->Append(TEXT_ADD_LINE, _T("Append a new &line\tAlt-Shift-A"));
- menuText->Append(TEXT_REMOVE, _T("&Remove first 10 characters\tCtrl-Y"));
- menuText->Append(TEXT_REPLACE, _T("&Replace characters 4 to 8 with ABC\tCtrl-R"));
- menuText->Append(TEXT_SELECT, _T("&Select characters 4 to 8\tCtrl-I"));
- menuText->Append(TEXT_SET, _T("&Set the first text zone value\tCtrl-E"));
- menuText->Append(TEXT_CHANGE, _T("&Change the first text zone value\tShift-Ctrl-E"));
+ menuText->Append(TEXT_ADD_SOME, wxT("&Append some text\tCtrl-A"));
+ menuText->Append(TEXT_ADD_FREEZE, wxT("&Append text with freeze/thaw\tShift-Ctrl-A"));
+ menuText->Append(TEXT_ADD_LINE, wxT("Append a new &line\tAlt-Shift-A"));
+ menuText->Append(TEXT_REMOVE, wxT("&Remove first 10 characters\tCtrl-Y"));
+ menuText->Append(TEXT_REPLACE, wxT("&Replace characters 4 to 8 with ABC\tCtrl-R"));
+ menuText->Append(TEXT_SELECT, wxT("&Select characters 4 to 8\tCtrl-I"));
+ menuText->Append(TEXT_SET, wxT("&Set the first text zone value\tCtrl-E"));
+ menuText->Append(TEXT_CHANGE, wxT("&Change the first text zone value\tShift-Ctrl-E"));
menuText->AppendSeparator();
- menuText->Append(TEXT_MOVE_ENDTEXT, _T("Move cursor to the end of &text"));
- menuText->Append(TEXT_MOVE_ENDENTRY, _T("Move cursor to the end of &entry"));
- menuText->AppendCheckItem(TEXT_SET_EDITABLE, _T("Toggle &editable state"));
- menuText->AppendCheckItem(TEXT_SET_ENABLED, _T("Toggle e&nabled state"));
+ menuText->Append(TEXT_MOVE_ENDTEXT, wxT("Move cursor to the end of &text"));
+ menuText->Append(TEXT_MOVE_ENDENTRY, wxT("Move cursor to the end of &entry"));
+ menuText->AppendCheckItem(TEXT_SET_EDITABLE, wxT("Toggle &editable state"));
+ menuText->AppendCheckItem(TEXT_SET_ENABLED, wxT("Toggle e&nabled state"));
menuText->Check(TEXT_SET_EDITABLE, true);
menuText->Check(TEXT_SET_ENABLED, true);
menuText->AppendSeparator();
- menuText->Append(TEXT_LINE_DOWN, _T("Scroll text one line down"));
- menuText->Append(TEXT_LINE_UP, _T("Scroll text one line up"));
- menuText->Append(TEXT_PAGE_DOWN, _T("Scroll text one page down"));
- menuText->Append(TEXT_PAGE_UP, _T("Scroll text one page up"));
+ menuText->Append(TEXT_LINE_DOWN, wxT("Scroll text one line down"));
+ menuText->Append(TEXT_LINE_UP, wxT("Scroll text one line up"));
+ menuText->Append(TEXT_PAGE_DOWN, wxT("Scroll text one page down"));
+ menuText->Append(TEXT_PAGE_UP, wxT("Scroll text one page up"));
menuText->AppendSeparator();
- menuText->Append(TEXT_GET_LINE, _T("Get the text of a line of the tabbed multiline"));
- menuText->Append(TEXT_GET_LINELENGTH, _T("Get the length of a line of the tabbed multiline"));
- menu_bar->Append(menuText, _T("Te&xt"));
+ menuText->Append(TEXT_GET_LINE, wxT("Get the text of a line of the tabbed multiline"));
+ menuText->Append(TEXT_GET_LINELENGTH, wxT("Get the length of a line of the tabbed multiline"));
+ menu_bar->Append(menuText, wxT("Te&xt"));
#if wxUSE_LOG
wxMenu *menuLog = new wxMenu;
- menuLog->AppendCheckItem(TEXT_LOG_KEY, _T("Log &key events"));
- menuLog->AppendCheckItem(TEXT_LOG_CHAR, _T("Log &char events"));
- menuLog->AppendCheckItem(TEXT_LOG_MOUSE, _T("Log &mouse events"));
- menuLog->AppendCheckItem(TEXT_LOG_TEXT, _T("Log &text events"));
- menuLog->AppendCheckItem(TEXT_LOG_FOCUS, _T("Log &focus events"));
- menuLog->AppendCheckItem(TEXT_LOG_CLIP, _T("Log clip&board events"));
+ menuLog->AppendCheckItem(TEXT_LOG_KEY, wxT("Log &key events"));
+ menuLog->AppendCheckItem(TEXT_LOG_CHAR, wxT("Log &char events"));
+ menuLog->AppendCheckItem(TEXT_LOG_MOUSE, wxT("Log &mouse events"));
+ menuLog->AppendCheckItem(TEXT_LOG_TEXT, wxT("Log &text events"));
+ menuLog->AppendCheckItem(TEXT_LOG_FOCUS, wxT("Log &focus events"));
+ menuLog->AppendCheckItem(TEXT_LOG_CLIP, wxT("Log clip&board events"));
menuLog->AppendSeparator();
- menuLog->Append(TEXT_CLEAR, _T("&Clear the log\tCtrl-L"),
- _T("Clear the log window contents"));
+ menuLog->Append(TEXT_CLEAR, wxT("&Clear the log\tCtrl-L"),
+ wxT("Clear the log window contents"));
// select only the interesting events by default
MyTextCtrl::ms_logClip =
menuLog->Check(TEXT_LOG_CHAR, MyTextCtrl::ms_logChar);
menuLog->Check(TEXT_LOG_TEXT, MyTextCtrl::ms_logText);
- menu_bar->Append(menuLog, _T("&Log"));
+ menu_bar->Append(menuLog, wxT("&Log"));
#endif // wxUSE_LOG
frame->SetMenuBar(menu_bar);
{
switch ( keycode )
{
- case WXK_BACK: key = _T("BACK"); break;
- case WXK_TAB: key = _T("TAB"); break;
- case WXK_RETURN: key = _T("RETURN"); break;
- case WXK_ESCAPE: key = _T("ESCAPE"); break;
- case WXK_SPACE: key = _T("SPACE"); break;
- case WXK_DELETE: key = _T("DELETE"); break;
- case WXK_START: key = _T("START"); break;
- case WXK_LBUTTON: key = _T("LBUTTON"); break;
- case WXK_RBUTTON: key = _T("RBUTTON"); break;
- case WXK_CANCEL: key = _T("CANCEL"); break;
- case WXK_MBUTTON: key = _T("MBUTTON"); break;
- case WXK_CLEAR: key = _T("CLEAR"); break;
- case WXK_SHIFT: key = _T("SHIFT"); break;
- case WXK_ALT: key = _T("ALT"); break;
- case WXK_CONTROL: key = _T("CONTROL"); break;
- case WXK_MENU: key = _T("MENU"); break;
- case WXK_PAUSE: key = _T("PAUSE"); break;
- case WXK_CAPITAL: key = _T("CAPITAL"); break;
- case WXK_END: key = _T("END"); break;
- case WXK_HOME: key = _T("HOME"); break;
- case WXK_LEFT: key = _T("LEFT"); break;
- case WXK_UP: key = _T("UP"); break;
- case WXK_RIGHT: key = _T("RIGHT"); break;
- case WXK_DOWN: key = _T("DOWN"); break;
- case WXK_SELECT: key = _T("SELECT"); break;
- case WXK_PRINT: key = _T("PRINT"); break;
- case WXK_EXECUTE: key = _T("EXECUTE"); break;
- case WXK_SNAPSHOT: key = _T("SNAPSHOT"); break;
- case WXK_INSERT: key = _T("INSERT"); break;
- case WXK_HELP: key = _T("HELP"); break;
- case WXK_NUMPAD0: key = _T("NUMPAD0"); break;
- case WXK_NUMPAD1: key = _T("NUMPAD1"); break;
- case WXK_NUMPAD2: key = _T("NUMPAD2"); break;
- case WXK_NUMPAD3: key = _T("NUMPAD3"); break;
- case WXK_NUMPAD4: key = _T("NUMPAD4"); break;
- case WXK_NUMPAD5: key = _T("NUMPAD5"); break;
- case WXK_NUMPAD6: key = _T("NUMPAD6"); break;
- case WXK_NUMPAD7: key = _T("NUMPAD7"); break;
- case WXK_NUMPAD8: key = _T("NUMPAD8"); break;
- case WXK_NUMPAD9: key = _T("NUMPAD9"); break;
- case WXK_MULTIPLY: key = _T("MULTIPLY"); break;
- case WXK_ADD: key = _T("ADD"); break;
- case WXK_SEPARATOR: key = _T("SEPARATOR"); break;
- case WXK_SUBTRACT: key = _T("SUBTRACT"); break;
- case WXK_DECIMAL: key = _T("DECIMAL"); break;
- case WXK_DIVIDE: key = _T("DIVIDE"); break;
- case WXK_F1: key = _T("F1"); break;
- case WXK_F2: key = _T("F2"); break;
- case WXK_F3: key = _T("F3"); break;
- case WXK_F4: key = _T("F4"); break;
- case WXK_F5: key = _T("F5"); break;
- case WXK_F6: key = _T("F6"); break;
- case WXK_F7: key = _T("F7"); break;
- case WXK_F8: key = _T("F8"); break;
- case WXK_F9: key = _T("F9"); break;
- case WXK_F10: key = _T("F10"); break;
- case WXK_F11: key = _T("F11"); break;
- case WXK_F12: key = _T("F12"); break;
- case WXK_F13: key = _T("F13"); break;
- case WXK_F14: key = _T("F14"); break;
- case WXK_F15: key = _T("F15"); break;
- case WXK_F16: key = _T("F16"); break;
- case WXK_F17: key = _T("F17"); break;
- case WXK_F18: key = _T("F18"); break;
- case WXK_F19: key = _T("F19"); break;
- case WXK_F20: key = _T("F20"); break;
- case WXK_F21: key = _T("F21"); break;
- case WXK_F22: key = _T("F22"); break;
- case WXK_F23: key = _T("F23"); break;
- case WXK_F24: key = _T("F24"); break;
- case WXK_NUMLOCK: key = _T("NUMLOCK"); break;
- case WXK_SCROLL: key = _T("SCROLL"); break;
- case WXK_PAGEUP: key = _T("PAGEUP"); break;
- case WXK_PAGEDOWN: key = _T("PAGEDOWN"); break;
- case WXK_NUMPAD_SPACE: key = _T("NUMPAD_SPACE"); break;
- case WXK_NUMPAD_TAB: key = _T("NUMPAD_TAB"); break;
- case WXK_NUMPAD_ENTER: key = _T("NUMPAD_ENTER"); break;
- case WXK_NUMPAD_F1: key = _T("NUMPAD_F1"); break;
- case WXK_NUMPAD_F2: key = _T("NUMPAD_F2"); break;
- case WXK_NUMPAD_F3: key = _T("NUMPAD_F3"); break;
- case WXK_NUMPAD_F4: key = _T("NUMPAD_F4"); break;
- case WXK_NUMPAD_HOME: key = _T("NUMPAD_HOME"); break;
- case WXK_NUMPAD_LEFT: key = _T("NUMPAD_LEFT"); break;
- case WXK_NUMPAD_UP: key = _T("NUMPAD_UP"); break;
- case WXK_NUMPAD_RIGHT: key = _T("NUMPAD_RIGHT"); break;
- case WXK_NUMPAD_DOWN: key = _T("NUMPAD_DOWN"); break;
- case WXK_NUMPAD_PAGEUP: key = _T("NUMPAD_PAGEUP"); break;
- case WXK_NUMPAD_PAGEDOWN: key = _T("NUMPAD_PAGEDOWN"); break;
- case WXK_NUMPAD_END: key = _T("NUMPAD_END"); break;
- case WXK_NUMPAD_BEGIN: key = _T("NUMPAD_BEGIN"); break;
- case WXK_NUMPAD_INSERT: key = _T("NUMPAD_INSERT"); break;
- case WXK_NUMPAD_DELETE: key = _T("NUMPAD_DELETE"); break;
- case WXK_NUMPAD_EQUAL: key = _T("NUMPAD_EQUAL"); break;
- case WXK_NUMPAD_MULTIPLY: key = _T("NUMPAD_MULTIPLY"); break;
- case WXK_NUMPAD_ADD: key = _T("NUMPAD_ADD"); break;
- case WXK_NUMPAD_SEPARATOR: key = _T("NUMPAD_SEPARATOR"); break;
- case WXK_NUMPAD_SUBTRACT: key = _T("NUMPAD_SUBTRACT"); break;
- case WXK_NUMPAD_DECIMAL: key = _T("NUMPAD_DECIMAL"); break;
+ case WXK_BACK: key = wxT("BACK"); break;
+ case WXK_TAB: key = wxT("TAB"); break;
+ case WXK_RETURN: key = wxT("RETURN"); break;
+ case WXK_ESCAPE: key = wxT("ESCAPE"); break;
+ case WXK_SPACE: key = wxT("SPACE"); break;
+ case WXK_DELETE: key = wxT("DELETE"); break;
+ case WXK_START: key = wxT("START"); break;
+ case WXK_LBUTTON: key = wxT("LBUTTON"); break;
+ case WXK_RBUTTON: key = wxT("RBUTTON"); break;
+ case WXK_CANCEL: key = wxT("CANCEL"); break;
+ case WXK_MBUTTON: key = wxT("MBUTTON"); break;
+ case WXK_CLEAR: key = wxT("CLEAR"); break;
+ case WXK_SHIFT: key = wxT("SHIFT"); break;
+ case WXK_ALT: key = wxT("ALT"); break;
+ case WXK_CONTROL: key = wxT("CONTROL"); break;
+ case WXK_MENU: key = wxT("MENU"); break;
+ case WXK_PAUSE: key = wxT("PAUSE"); break;
+ case WXK_CAPITAL: key = wxT("CAPITAL"); break;
+ case WXK_END: key = wxT("END"); break;
+ case WXK_HOME: key = wxT("HOME"); break;
+ case WXK_LEFT: key = wxT("LEFT"); break;
+ case WXK_UP: key = wxT("UP"); break;
+ case WXK_RIGHT: key = wxT("RIGHT"); break;
+ case WXK_DOWN: key = wxT("DOWN"); break;
+ case WXK_SELECT: key = wxT("SELECT"); break;
+ case WXK_PRINT: key = wxT("PRINT"); break;
+ case WXK_EXECUTE: key = wxT("EXECUTE"); break;
+ case WXK_SNAPSHOT: key = wxT("SNAPSHOT"); break;
+ case WXK_INSERT: key = wxT("INSERT"); break;
+ case WXK_HELP: key = wxT("HELP"); break;
+ case WXK_NUMPAD0: key = wxT("NUMPAD0"); break;
+ case WXK_NUMPAD1: key = wxT("NUMPAD1"); break;
+ case WXK_NUMPAD2: key = wxT("NUMPAD2"); break;
+ case WXK_NUMPAD3: key = wxT("NUMPAD3"); break;
+ case WXK_NUMPAD4: key = wxT("NUMPAD4"); break;
+ case WXK_NUMPAD5: key = wxT("NUMPAD5"); break;
+ case WXK_NUMPAD6: key = wxT("NUMPAD6"); break;
+ case WXK_NUMPAD7: key = wxT("NUMPAD7"); break;
+ case WXK_NUMPAD8: key = wxT("NUMPAD8"); break;
+ case WXK_NUMPAD9: key = wxT("NUMPAD9"); break;
+ case WXK_MULTIPLY: key = wxT("MULTIPLY"); break;
+ case WXK_ADD: key = wxT("ADD"); break;
+ case WXK_SEPARATOR: key = wxT("SEPARATOR"); break;
+ case WXK_SUBTRACT: key = wxT("SUBTRACT"); break;
+ case WXK_DECIMAL: key = wxT("DECIMAL"); break;
+ case WXK_DIVIDE: key = wxT("DIVIDE"); break;
+ case WXK_F1: key = wxT("F1"); break;
+ case WXK_F2: key = wxT("F2"); break;
+ case WXK_F3: key = wxT("F3"); break;
+ case WXK_F4: key = wxT("F4"); break;
+ case WXK_F5: key = wxT("F5"); break;
+ case WXK_F6: key = wxT("F6"); break;
+ case WXK_F7: key = wxT("F7"); break;
+ case WXK_F8: key = wxT("F8"); break;
+ case WXK_F9: key = wxT("F9"); break;
+ case WXK_F10: key = wxT("F10"); break;
+ case WXK_F11: key = wxT("F11"); break;
+ case WXK_F12: key = wxT("F12"); break;
+ case WXK_F13: key = wxT("F13"); break;
+ case WXK_F14: key = wxT("F14"); break;
+ case WXK_F15: key = wxT("F15"); break;
+ case WXK_F16: key = wxT("F16"); break;
+ case WXK_F17: key = wxT("F17"); break;
+ case WXK_F18: key = wxT("F18"); break;
+ case WXK_F19: key = wxT("F19"); break;
+ case WXK_F20: key = wxT("F20"); break;
+ case WXK_F21: key = wxT("F21"); break;
+ case WXK_F22: key = wxT("F22"); break;
+ case WXK_F23: key = wxT("F23"); break;
+ case WXK_F24: key = wxT("F24"); break;
+ case WXK_NUMLOCK: key = wxT("NUMLOCK"); break;
+ case WXK_SCROLL: key = wxT("SCROLL"); break;
+ case WXK_PAGEUP: key = wxT("PAGEUP"); break;
+ case WXK_PAGEDOWN: key = wxT("PAGEDOWN"); break;
+ case WXK_NUMPAD_SPACE: key = wxT("NUMPAD_SPACE"); break;
+ case WXK_NUMPAD_TAB: key = wxT("NUMPAD_TAB"); break;
+ case WXK_NUMPAD_ENTER: key = wxT("NUMPAD_ENTER"); break;
+ case WXK_NUMPAD_F1: key = wxT("NUMPAD_F1"); break;
+ case WXK_NUMPAD_F2: key = wxT("NUMPAD_F2"); break;
+ case WXK_NUMPAD_F3: key = wxT("NUMPAD_F3"); break;
+ case WXK_NUMPAD_F4: key = wxT("NUMPAD_F4"); break;
+ case WXK_NUMPAD_HOME: key = wxT("NUMPAD_HOME"); break;
+ case WXK_NUMPAD_LEFT: key = wxT("NUMPAD_LEFT"); break;
+ case WXK_NUMPAD_UP: key = wxT("NUMPAD_UP"); break;
+ case WXK_NUMPAD_RIGHT: key = wxT("NUMPAD_RIGHT"); break;
+ case WXK_NUMPAD_DOWN: key = wxT("NUMPAD_DOWN"); break;
+ case WXK_NUMPAD_PAGEUP: key = wxT("NUMPAD_PAGEUP"); break;
+ case WXK_NUMPAD_PAGEDOWN: key = wxT("NUMPAD_PAGEDOWN"); break;
+ case WXK_NUMPAD_END: key = wxT("NUMPAD_END"); break;
+ case WXK_NUMPAD_BEGIN: key = wxT("NUMPAD_BEGIN"); break;
+ case WXK_NUMPAD_INSERT: key = wxT("NUMPAD_INSERT"); break;
+ case WXK_NUMPAD_DELETE: key = wxT("NUMPAD_DELETE"); break;
+ case WXK_NUMPAD_EQUAL: key = wxT("NUMPAD_EQUAL"); break;
+ case WXK_NUMPAD_MULTIPLY: key = wxT("NUMPAD_MULTIPLY"); break;
+ case WXK_NUMPAD_ADD: key = wxT("NUMPAD_ADD"); break;
+ case WXK_NUMPAD_SEPARATOR: key = wxT("NUMPAD_SEPARATOR"); break;
+ case WXK_NUMPAD_SUBTRACT: key = wxT("NUMPAD_SUBTRACT"); break;
+ case WXK_NUMPAD_DECIMAL: key = wxT("NUMPAD_DECIMAL"); break;
default:
{
if ( wxIsprint((int)keycode) )
- key.Printf(_T("'%c'"), (char)keycode);
+ key.Printf(wxT("'%c'"), (char)keycode);
else if ( keycode > 0 && keycode < 27 )
- key.Printf(_("Ctrl-%c"), _T('A') + keycode - 1);
+ key.Printf(_("Ctrl-%c"), wxT('A') + keycode - 1);
else
- key.Printf(_T("unknown (%ld)"), keycode);
+ key.Printf(wxT("unknown (%ld)"), keycode);
}
}
}
#if wxUSE_UNICODE
- key += wxString::Format(_T(" (Unicode: %#04x)"), event.GetUnicodeKey());
+ key += wxString::Format(wxT(" (Unicode: %#04x)"), event.GetUnicodeKey());
#endif // wxUSE_UNICODE
- wxLogMessage( _T("%s event: %s (flags = %c%c%c%c)"),
+ wxLogMessage( wxT("%s event: %s (flags = %c%c%c%c)"),
name,
key.c_str(),
- GetChar( event.ControlDown(), _T('C') ),
- GetChar( event.AltDown(), _T('A') ),
- GetChar( event.ShiftDown(), _T('S') ),
- GetChar( event.MetaDown(), _T('M') ) );
+ GetChar( event.ControlDown(), wxT('C') ),
+ GetChar( event.AltDown(), wxT('A') ),
+ GetChar( event.ShiftDown(), wxT('S') ),
+ GetChar( event.MetaDown(), wxT('M') ) );
}
static wxString GetMouseEventDesc(const wxMouseEvent& ev)
bool dbl, up;
if ( ev.LeftDown() || ev.LeftUp() || ev.LeftDClick() )
{
- button = _T("Left");
+ button = wxT("Left");
dbl = ev.LeftDClick();
up = ev.LeftUp();
}
else if ( ev.MiddleDown() || ev.MiddleUp() || ev.MiddleDClick() )
{
- button = _T("Middle");
+ button = wxT("Middle");
dbl = ev.MiddleDClick();
up = ev.MiddleUp();
}
else if ( ev.RightDown() || ev.RightUp() || ev.RightDClick() )
{
- button = _T("Right");
+ button = wxT("Right");
dbl = ev.RightDClick();
up = ev.RightUp();
}
else
{
- return _T("Unknown mouse event");
+ return wxT("Unknown mouse event");
}
- return wxString::Format(_T("%s mouse button %s"),
+ return wxString::Format(wxT("%s mouse button %s"),
button.c_str(),
- dbl ? _T("double clicked")
- : up ? _T("released") : _T("clicked"));
+ dbl ? wxT("double clicked")
+ : up ? wxT("released") : wxT("clicked"));
}
void MyTextCtrl::OnMouseEvent(wxMouseEvent& ev)
wxString msg;
if ( ev.Entering() )
{
- msg = _T("Mouse entered the window");
+ msg = wxT("Mouse entered the window");
}
else if ( ev.Leaving() )
{
- msg = _T("Mouse left the window");
+ msg = wxT("Mouse left the window");
}
else
{
msg = GetMouseEventDesc(ev);
}
- msg << _T(" at (") << ev.GetX() << _T(", ") << ev.GetY() << _T(") ");
+ msg << wxT(" at (") << ev.GetX() << wxT(", ") << ev.GetY() << wxT(") ");
long pos;
wxTextCtrlHitTestResult rc = HitTest(ev.GetPosition(), &pos);
if ( rc != wxTE_HT_UNKNOWN )
{
- msg << _T("at position ") << pos << _T(' ');
+ msg << wxT("at position ") << pos << wxT(' ');
}
- msg << _T("[Flags: ")
- << GetChar( ev.LeftIsDown(), _T('1') )
- << GetChar( ev.MiddleIsDown(), _T('2') )
- << GetChar( ev.RightIsDown(), _T('3') )
- << GetChar( ev.ControlDown(), _T('C') )
- << GetChar( ev.AltDown(), _T('A') )
- << GetChar( ev.ShiftDown(), _T('S') )
- << GetChar( ev.MetaDown(), _T('M') )
- << _T(']');
+ msg << wxT("[Flags: ")
+ << GetChar( ev.LeftIsDown(), wxT('1') )
+ << GetChar( ev.MiddleIsDown(), wxT('2') )
+ << GetChar( ev.RightIsDown(), wxT('3') )
+ << GetChar( ev.ControlDown(), wxT('C') )
+ << GetChar( ev.AltDown(), wxT('A') )
+ << GetChar( ev.ShiftDown(), wxT('S') )
+ << GetChar( ev.MetaDown(), wxT('M') )
+ << wxT(']');
wxLogMessage(msg);
}
return;
MyTextCtrl *win = (MyTextCtrl *)event.GetEventObject();
- const wxChar *changeVerb = win->IsModified() ? _T("changed")
- : _T("set by program");
+ const wxChar *changeVerb = win->IsModified() ? wxT("changed")
+ : wxT("set by program");
const wxChar *data = (const wxChar *)(win->GetClientData());
if ( data )
{
- wxLogMessage(_T("Text %s in control \"%s\""), changeVerb, data);
+ wxLogMessage(wxT("Text %s in control \"%s\""), changeVerb, data);
}
else
{
- wxLogMessage(_T("Text %s in some control"), changeVerb);
+ wxLogMessage(wxT("Text %s in some control"), changeVerb);
}
}
const wxChar *data = (const wxChar *)(win->GetClientData());
if ( data )
{
- wxLogMessage(_T("Enter pressed in control '%s'"), data);
+ wxLogMessage(wxT("Enter pressed in control '%s'"), data);
}
else
{
- wxLogMessage(_T("Enter pressed in some control"));
+ wxLogMessage(wxT("Enter pressed in some control"));
}
}
void MyTextCtrl::OnTextMaxLen(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("You can't enter more characters into this control."));
+ wxLogMessage(wxT("You can't enter more characters into this control."));
}
void MyTextCtrl::OnTextCut(wxClipboardTextEvent& event)
{
- LogClipEvent(_T("cut to"), event);
+ LogClipEvent(wxT("cut to"), event);
}
void MyTextCtrl::OnTextCopy(wxClipboardTextEvent& event)
{
- LogClipEvent(_T("copied to"), event);
+ LogClipEvent(wxT("copied to"), event);
}
void MyTextCtrl::OnTextPaste(wxClipboardTextEvent& event)
{
- LogClipEvent(_T("pasted from"), event);
+ LogClipEvent(wxT("pasted from"), event);
}
void MyTextCtrl::LogClipEvent(const wxChar *what, wxClipboardTextEvent& event)
{
wxFrame *frame = wxDynamicCast(wxGetTopLevelParent(this), wxFrame);
- wxCHECK_RET( frame, _T("no parent frame?") );
+ wxCHECK_RET( frame, wxT("no parent frame?") );
const bool veto = frame->GetMenuBar()->IsChecked(TEXT_CLIPBOARD_VETO);
if ( !veto )
if ( ms_logClip )
{
- wxLogMessage(_T("Text %s%s the clipboard."),
- veto ? _T("not ") : _T(""), what);
+ wxLogMessage(wxT("Text %s%s the clipboard."),
+ veto ? wxT("not ") : wxT(""), what);
}
}
long start = event.GetURLStart(),
end = event.GetURLEnd();
- wxLogMessage(_T("Mouse event over URL '%s': %s"),
+ wxLogMessage(wxT("Mouse event over URL '%s': %s"),
GetValue().Mid(start, end - start).c_str(),
GetMouseEventDesc(ev).c_str());
}
void MyTextCtrl::OnChar(wxKeyEvent& event)
{
if ( ms_logChar )
- LogKeyEvent( _T("Char"), event);
+ LogKeyEvent( wxT("Char"), event);
event.Skip();
}
void MyTextCtrl::OnKeyUp(wxKeyEvent& event)
{
if ( ms_logKey )
- LogKeyEvent( _T("Key up"), event);
+ LogKeyEvent( wxT("Key up"), event);
event.Skip();
}
long line, column, pos = GetInsertionPoint();
PositionToXY(pos, &column, &line);
- wxLogMessage(_T("Current position: %ld\nCurrent line, column: (%ld, %ld)\nNumber of lines: %ld\nCurrent line length: %ld\nTotal text length: %u (%ld)"),
+ wxLogMessage(wxT("Current position: %ld\nCurrent line, column: (%ld, %ld)\nNumber of lines: %ld\nCurrent line length: %ld\nTotal text length: %u (%ld)"),
pos,
line, column,
(long) GetNumberOfLines(),
wxString sel = GetStringSelection();
- wxLogMessage(_T("Selection: from %ld to %ld."), from, to);
- wxLogMessage(_T("Selection = '%s' (len = %u)"),
+ wxLogMessage(wxT("Selection: from %ld to %ld."), from, to);
+ wxLogMessage(wxT("Selection = '%s' (len = %u)"),
sel.c_str(),
(unsigned int) sel.length());
const wxString text = GetLineText(line);
- wxLogMessage(_T("Current line: \"%s\"; length = %lu"),
+ wxLogMessage(wxT("Current line: \"%s\"; length = %lu"),
text.c_str(), text.length());
}
break;
case WXK_F5:
// insert a blank line
- WriteText(_T("\n"));
+ WriteText(wxT("\n"));
break;
case WXK_F6:
- wxLogMessage(_T("IsModified() before SetValue(): %d"),
+ wxLogMessage(wxT("IsModified() before SetValue(): %d"),
IsModified());
- ChangeValue(_T("ChangeValue() has been called"));
- wxLogMessage(_T("IsModified() after SetValue(): %d"),
+ ChangeValue(wxT("ChangeValue() has been called"));
+ wxLogMessage(wxT("IsModified() after SetValue(): %d"),
IsModified());
break;
case WXK_F7:
- wxLogMessage(_T("Position 10 should be now visible."));
+ wxLogMessage(wxT("Position 10 should be now visible."));
ShowPosition(10);
break;
case WXK_F8:
- wxLogMessage(_T("Control has been cleared"));
+ wxLogMessage(wxT("Control has been cleared"));
Clear();
break;
case WXK_F9:
- WriteText(_T("WriteText() has been called"));
+ WriteText(wxT("WriteText() has been called"));
break;
case WXK_F10:
- AppendText(_T("AppendText() has been called"));
+ AppendText(wxT("AppendText() has been called"));
break;
case WXK_F11:
DiscardEdits();
- wxLogMessage(_T("Control marked as non modified"));
+ wxLogMessage(wxT("Control marked as non modified"));
break;
}
: wxPanel( frame, wxID_ANY, wxPoint(x, y), wxSize(w, h) )
{
#if wxUSE_LOG
- m_log = new wxTextCtrl( this, wxID_ANY, _T("This is the log window.\n"),
+ m_log = new wxTextCtrl( this, wxID_ANY, wxT("This is the log window.\n"),
wxPoint(5,260), wxSize(630,100),
wxTE_MULTILINE | wxTE_READONLY /* | wxTE_RICH */);
// single line text controls
- m_text = new MyTextCtrl( this, wxID_ANY, _T("Single line."),
+ m_text = new MyTextCtrl( this, wxID_ANY, wxT("Single line."),
wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER);
m_text->SetForegroundColour(*wxBLUE);
m_text->SetBackgroundColour(*wxLIGHT_GREY);
- (*m_text) << _T(" Appended.");
+ (*m_text) << wxT(" Appended.");
m_text->SetInsertionPoint(0);
- m_text->WriteText( _T("Prepended. ") );
+ m_text->WriteText( wxT("Prepended. ") );
- m_password = new MyTextCtrl( this, wxID_ANY, _T(""),
+ m_password = new MyTextCtrl( this, wxID_ANY, wxT(""),
wxPoint(10,50), wxSize(140,wxDefaultCoord), wxTE_PASSWORD );
- m_readonly = new MyTextCtrl( this, wxID_ANY, _T("Read only"),
+ m_readonly = new MyTextCtrl( this, wxID_ANY, wxT("Read only"),
wxPoint(10,90), wxSize(140,wxDefaultCoord), wxTE_READONLY );
- m_limited = new MyTextCtrl(this, wxID_ANY, _T("Max 8 ch"),
+ m_limited = new MyTextCtrl(this, wxID_ANY, wxT("Max 8 ch"),
wxPoint(10, 130), wxSize(140, wxDefaultCoord));
m_limited->SetMaxLength(8);
// multi line text controls
- m_horizontal = new MyTextCtrl( this, wxID_ANY, _T("Multiline text control with a horizontal scrollbar.\n"),
+ m_horizontal = new MyTextCtrl( this, wxID_ANY, wxT("Multiline text control with a horizontal scrollbar.\n"),
wxPoint(10,170), wxSize(140,70), wxTE_MULTILINE | wxHSCROLL);
// a little hack to use the command line argument for encoding testing
{
case '2':
m_horizontal->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxNORMAL,
- false, _T(""),
+ false, wxT(""),
wxFONTENCODING_ISO8859_2));
- m_horizontal->AppendText(_T("\256lu\273ou\350k\375 k\371\362 zb\354sile \350e\271tina \253\273"));
+ m_horizontal->AppendText(wxT("\256lu\273ou\350k\375 k\371\362 zb\354sile \350e\271tina \253\273"));
break;
case '1':
m_horizontal->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxNORMAL,
- false, _T(""),
+ false, wxT(""),
wxFONTENCODING_CP1251));
- m_horizontal->AppendText(_T("\317\360\350\342\345\362!"));
+ m_horizontal->AppendText(wxT("\317\360\350\342\345\362!"));
break;
case '8':
m_horizontal->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxNORMAL,
- false, _T(""),
+ false, wxT(""),
wxFONTENCODING_CP1251));
#if wxUSE_UNICODE
m_horizontal->AppendText(L"\x0412\x0430\x0434\x0438\x043c \x0426");
}
else
{
- m_horizontal->AppendText(_T("Text in default encoding"));
+ m_horizontal->AppendText(wxT("Text in default encoding"));
}
m_multitext = new MyTextCtrl( this, wxID_ANY,
- _T("Multi line without vertical scrollbar."),
+ wxT("Multi line without vertical scrollbar."),
wxPoint(180,10), wxSize(200,70), wxTE_MULTILINE | wxTE_NO_VSCROLL );
m_multitext->SetFont(*wxITALIC_FONT);
- (*m_multitext) << _T(" Appended.");
+ (*m_multitext) << wxT(" Appended.");
m_multitext->SetInsertionPoint(0);
- m_multitext->WriteText( _T("Prepended. ") );
+ m_multitext->WriteText( wxT("Prepended. ") );
m_multitext->SetForegroundColour(*wxYELLOW);
m_multitext->SetBackgroundColour(*wxLIGHT_GREY);
#if wxUSE_TOOLTIPS
- m_multitext->SetToolTip(_T("Press Fn function keys here"));
+ m_multitext->SetToolTip(wxT("Press Fn function keys here"));
#endif
- m_tab = new MyTextCtrl( this, 100, _T("Multiline, allow <TAB> processing."),
+ m_tab = new MyTextCtrl( this, 100, wxT("Multiline, allow <TAB> processing."),
wxPoint(180,90), wxSize(200,70), wxTE_MULTILINE | wxTE_PROCESS_TAB );
- m_tab->SetClientData((void *)_T("tab"));
+ m_tab->SetClientData((void *)wxT("tab"));
- m_enter = new MyTextCtrl( this, 100, _T("Multiline, allow <ENTER> processing."),
+ m_enter = new MyTextCtrl( this, 100, wxT("Multiline, allow <ENTER> processing."),
wxPoint(180,170), wxSize(200,70), wxTE_MULTILINE);
- m_enter->SetClientData((void *)_T("enter"));
-
- m_textrich = new MyTextCtrl(this, wxID_ANY, _T("Allows more than 30Kb of text\n")
- _T("(even under broken Win9x)\n")
- _T("and a very very very very very ")
- _T("very very very long line to test ")
- _T("wxHSCROLL style\n")
- _T("\nAnd here is a link in quotation marks to ")
- _T("test wxTE_AUTO_URL: \"http://www.wxwidgets.org\""),
+ m_enter->SetClientData((void *)wxT("enter"));
+
+ m_textrich = new MyTextCtrl(this, wxID_ANY, wxT("Allows more than 30Kb of text\n")
+ wxT("(even under broken Win9x)\n")
+ wxT("and a very very very very very ")
+ wxT("very very very long line to test ")
+ wxT("wxHSCROLL style\n")
+ wxT("\nAnd here is a link in quotation marks to ")
+ wxT("test wxTE_AUTO_URL: \"http://www.wxwidgets.org\""),
wxPoint(450, 10), wxSize(200, 230),
wxTE_RICH | wxTE_MULTILINE | wxTE_AUTO_URL);
m_textrich->SetStyle(0, 10, *wxRED);
m_textrich->SetStyle(30, 40,
wxTextAttr(*wxGREEN, wxNullColour, *wxITALIC_FONT));
m_textrich->SetDefaultStyle(wxTextAttr());
- m_textrich->AppendText(_T("\n\nFirst 10 characters should be in red\n"));
- m_textrich->AppendText(_T("Next 10 characters should be in blue\n"));
- m_textrich->AppendText(_T("Next 10 characters should be normal\n"));
- m_textrich->AppendText(_T("And the next 10 characters should be green and italic\n"));
+ m_textrich->AppendText(wxT("\n\nFirst 10 characters should be in red\n"));
+ m_textrich->AppendText(wxT("Next 10 characters should be in blue\n"));
+ m_textrich->AppendText(wxT("Next 10 characters should be normal\n"));
+ m_textrich->AppendText(wxT("And the next 10 characters should be green and italic\n"));
m_textrich->SetDefaultStyle(wxTextAttr(*wxCYAN, *wxBLUE));
- m_textrich->AppendText(_T("This text should be cyan on blue\n"));
+ m_textrich->AppendText(wxT("This text should be cyan on blue\n"));
m_textrich->SetDefaultStyle(wxTextAttr(*wxBLUE, *wxWHITE));
- m_textrich->AppendText(_T("And this should be in blue and the text you ")
- _T("type should be in blue as well"));
+ m_textrich->AppendText(wxT("And this should be in blue and the text you ")
+ wxT("type should be in blue as well"));
// lay out the controls
if (!wxTheClipboard->Open())
{
#if wxUSE_LOG
- *m_log << _T("Error opening the clipboard.\n");
+ *m_log << wxT("Error opening the clipboard.\n");
#endif // wxUSE_LOG
return;
}
else
{
#if wxUSE_LOG
- *m_log << _T("Successfully opened the clipboard.\n");
+ *m_log << wxT("Successfully opened the clipboard.\n");
#endif // wxUSE_LOG
}
if (wxTheClipboard->IsSupported( data.GetFormat() ))
{
#if wxUSE_LOG
- *m_log << _T("Clipboard supports requested format.\n");
+ *m_log << wxT("Clipboard supports requested format.\n");
#endif // wxUSE_LOG
if (wxTheClipboard->GetData( data ))
{
#if wxUSE_LOG
- *m_log << _T("Successfully retrieved data from the clipboard.\n");
+ *m_log << wxT("Successfully retrieved data from the clipboard.\n");
#endif // wxUSE_LOG
GetFocusedText()->AppendText(data.GetText());
}
else
{
#if wxUSE_LOG
- *m_log << _T("Error getting data from the clipboard.\n");
+ *m_log << wxT("Error getting data from the clipboard.\n");
#endif // wxUSE_LOG
}
}
else
{
#if wxUSE_LOG
- *m_log << _T("Clipboard doesn't support requested format.\n");
+ *m_log << wxT("Clipboard doesn't support requested format.\n");
#endif // wxUSE_LOG
}
wxTheClipboard->Close();
#if wxUSE_LOG
- *m_log << _T("Closed the clipboard.\n");
+ *m_log << wxT("Closed the clipboard.\n");
#endif // wxUSE_LOG
}
if (text.IsEmpty())
{
#if wxUSE_LOG
- *m_log << _T("No text to copy.\n");
+ *m_log << wxT("No text to copy.\n");
#endif // wxUSE_LOG
return;
if (!wxTheClipboard->Open())
{
#if wxUSE_LOG
- *m_log << _T("Error opening the clipboard.\n");
+ *m_log << wxT("Error opening the clipboard.\n");
#endif // wxUSE_LOG
return;
else
{
#if wxUSE_LOG
- *m_log << _T("Successfully opened the clipboard.\n");
+ *m_log << wxT("Successfully opened the clipboard.\n");
#endif // wxUSE_LOG
}
if (!wxTheClipboard->SetData( data ))
{
#if wxUSE_LOG
- *m_log << _T("Error while copying to the clipboard.\n");
+ *m_log << wxT("Error while copying to the clipboard.\n");
#endif // wxUSE_LOG
}
else
{
#if wxUSE_LOG
- *m_log << _T("Successfully copied data to the clipboard.\n");
+ *m_log << wxT("Successfully copied data to the clipboard.\n");
#endif // wxUSE_LOG
}
wxTheClipboard->Close();
#if wxUSE_LOG
- *m_log << _T("Closed the clipboard.\n");
+ *m_log << wxT("Closed the clipboard.\n");
#endif // wxUSE_LOG
}
void MyPanel::DoReplaceText()
{
- GetFocusedText()->Replace(3, 8, _T("ABC"));
+ GetFocusedText()->Replace(3, 8, wxT("ABC"));
}
void MyPanel::DoSelectText()
wxBeginBusyCursor();
wxMessageDialog dialog(this,
- _T("This is a text control sample. It demonstrates the many different\n")
- _T("text control styles, the use of the clipboard, setting and handling\n")
- _T("tooltips and intercepting key and char events.\n")
- _T("\n")
- _T("Copyright (c) 1999, Robert Roebling, Julian Smart, Vadim Zeitlin"),
- _T("About wxTextCtrl Sample"),
+ wxT("This is a text control sample. It demonstrates the many different\n")
+ wxT("text control styles, the use of the clipboard, setting and handling\n")
+ wxT("tooltips and intercepting key and char events.\n")
+ wxT("\n")
+ wxT("Copyright (c) 1999, Robert Roebling, Julian Smart, Vadim Zeitlin"),
+ wxT("About wxTextCtrl Sample"),
wxOK | wxICON_INFORMATION);
dialog.ShowModal();
static long s_delay = 5000;
wxString delay;
- delay.Printf( _T("%ld"), s_delay);
+ delay.Printf( wxT("%ld"), s_delay);
- delay = wxGetTextFromUser(_T("Enter delay (in milliseconds)"),
- _T("Set tooltip delay"),
+ delay = wxGetTextFromUser(wxT("Enter delay (in milliseconds)"),
+ wxT("Set tooltip delay"),
delay,
this);
if ( !delay )
return; // cancelled
- wxSscanf(delay, _T("%ld"), &s_delay);
+ wxSscanf(delay, wxT("%ld"), &s_delay);
wxToolTip::SetDelay(s_delay);
- wxLogStatus(this, _T("Tooltip delay set to %ld milliseconds"), s_delay);
+ wxLogStatus(this, wxT("Tooltip delay set to %ld milliseconds"), s_delay);
}
void MyFrame::OnToggleTooltips(wxCommandEvent& WXUNUSED(event))
wxToolTip::Enable(s_enabled);
- wxLogStatus(this, _T("Tooltips %sabled"), s_enabled ? _T("en") : _T("dis") );
+ wxLogStatus(this, wxT("Tooltips %sabled"), s_enabled ? wxT("en") : wxT("dis") );
}
#endif // tooltips
void MyFrame::OnFileSave(wxCommandEvent& WXUNUSED(event))
{
- if ( m_panel->m_textrich->SaveFile(_T("dummy.txt")) )
+ if ( m_panel->m_textrich->SaveFile(wxT("dummy.txt")) )
{
#if wxUSE_FILE
// verify that the fil length is correct (it wasn't under Win95)
wxFile file(wxT("dummy.txt"));
wxLogStatus(this,
- _T("Successfully saved file (text len = %lu, file size = %ld)"),
+ wxT("Successfully saved file (text len = %lu, file size = %ld)"),
(unsigned long)m_panel->m_textrich->GetValue().length(),
(long) file.Length());
#endif
}
else
- wxLogStatus(this, _T("Couldn't save the file"));
+ wxLogStatus(this, wxT("Couldn't save the file"));
}
void MyFrame::OnFileLoad(wxCommandEvent& WXUNUSED(event))
{
- if ( m_panel->m_textrich->LoadFile(_T("dummy.txt")) )
+ if ( m_panel->m_textrich->LoadFile(wxT("dummy.txt")) )
{
- wxLogStatus(this, _T("Successfully loaded file"));
+ wxLogStatus(this, wxT("Successfully loaded file"));
}
else
{
- wxLogStatus(this, _T("Couldn't load the file"));
+ wxLogStatus(this, wxT("Couldn't load the file"));
}
}
void MyFrame::OnRichTextTest(wxCommandEvent& WXUNUSED(event))
{
- RichTextFrame* frame = new RichTextFrame(this, _T("Rich Text Editor"));
+ RichTextFrame* frame = new RichTextFrame(this, wxT("Rich Text Editor"));
frame->Show(true);
}
wxString msg;
msg.Printf(
#ifdef __WXMSW__
- _T("Focus: wxWindow = %p, HWND = %p"),
+ wxT("Focus: wxWindow = %p, HWND = %p"),
#else
- _T("Focus: wxWindow = %p"),
+ wxT("Focus: wxWindow = %p"),
#endif
s_windowFocus
#ifdef __WXMSW__
}
wxColourDialog dialog(this, &data);
- dialog.SetTitle(_T("Choose the text colour"));
+ dialog.SetTitle(wxT("Choose the text colour"));
if (dialog.ShowModal() == wxID_OK)
{
wxColourData retData = dialog.GetColourData();
}
wxColourDialog dialog(this, &data);
- dialog.SetTitle(_T("Choose the text background colour"));
+ dialog.SetTitle(wxT("Choose the text background colour"));
if (dialog.ShowModal() == wxID_OK)
{
wxColourData retData = dialog.GetColourData();
wxArrayInt tabs;
- wxStringTokenizer tokens(tabsStr, _T(" "));
+ wxStringTokenizer tokens(tabsStr, wxT(" "));
while (tokens.HasMoreTokens())
{
wxString token = tokens.GetNextToken();
wxMenuBar *menuBar = new wxMenuBar;
wxMenu *menuFile = new wxMenu;
- menuFile->Append(THREAD_CLEAR, _T("&Clear log\tCtrl-L"));
+ menuFile->Append(THREAD_CLEAR, wxT("&Clear log\tCtrl-L"));
menuFile->AppendSeparator();
- menuFile->Append(THREAD_QUIT, _T("E&xit\tAlt-X"));
- menuBar->Append(menuFile, _T("&File"));
+ menuFile->Append(THREAD_QUIT, wxT("E&xit\tAlt-X"));
+ menuBar->Append(menuFile, wxT("&File"));
wxMenu *menuThread = new wxMenu;
- menuThread->Append(THREAD_START_THREAD, _T("&Start a new thread\tCtrl-N"));
- menuThread->Append(THREAD_START_THREADS, _T("Start &many threads at once"));
- menuThread->Append(THREAD_STOP_THREAD, _T("S&top the last spawned thread\tCtrl-S"));
+ menuThread->Append(THREAD_START_THREAD, wxT("&Start a new thread\tCtrl-N"));
+ menuThread->Append(THREAD_START_THREADS, wxT("Start &many threads at once"));
+ menuThread->Append(THREAD_STOP_THREAD, wxT("S&top the last spawned thread\tCtrl-S"));
menuThread->AppendSeparator();
- menuThread->Append(THREAD_PAUSE_THREAD, _T("&Pause the last spawned running thread\tCtrl-P"));
- menuThread->Append(THREAD_RESUME_THREAD, _T("&Resume the first suspended thread\tCtrl-R"));
+ menuThread->Append(THREAD_PAUSE_THREAD, wxT("&Pause the last spawned running thread\tCtrl-P"));
+ menuThread->Append(THREAD_RESUME_THREAD, wxT("&Resume the first suspended thread\tCtrl-R"));
menuThread->AppendSeparator();
- menuThread->Append(THREAD_START_WORKER, _T("Start a &worker thread\tCtrl-W"));
- menuThread->Append(THREAD_EXEC_MAIN, _T("&Launch a program from main thread\tF5"));
- menuThread->Append(THREAD_START_GUI_THREAD, _T("Launch a &GUI thread\tF6"));
- menuBar->Append(menuThread, _T("&Thread"));
+ menuThread->Append(THREAD_START_WORKER, wxT("Start a &worker thread\tCtrl-W"));
+ menuThread->Append(THREAD_EXEC_MAIN, wxT("&Launch a program from main thread\tF5"));
+ menuThread->Append(THREAD_START_GUI_THREAD, wxT("Launch a &GUI thread\tF6"));
+ menuBar->Append(menuThread, wxT("&Thread"));
wxMenu *menuHelp = new wxMenu;
- menuHelp->Append(THREAD_SHOWCPUS, _T("&Show CPU count"));
+ menuHelp->Append(THREAD_SHOWCPUS, wxT("&Show CPU count"));
menuHelp->AppendSeparator();
- menuHelp->Append(THREAD_ABOUT, _T("&About..."));
- menuBar->Append(menuHelp, _T("&Help"));
+ menuHelp->Append(THREAD_ABOUT, wxT("&About..."));
+ menuBar->Append(menuHelp, wxT("&Help"));
SetMenuBar(menuBar);
{
static long s_num;
- s_num = wxGetNumberFromUser(_T("How many threads to start: "), _T(""),
- _T("wxThread sample"), s_num, 1, 10000, this);
+ s_num = wxGetNumberFromUser(wxT("How many threads to start: "), wxT(""),
+ wxT("wxThread sample"), s_num, 1, 10000, this);
if ( s_num == -1 )
{
s_num = 10;
}
#if wxUSE_STATUSBAR
- SetStatusText(_T("New thread started."), 1);
+ SetStatusText(wxT("New thread started."), 1);
#endif // wxUSE_STATUSBAR
}
wxGetApp().m_threads.Last()->Delete();
#if wxUSE_STATUSBAR
- SetStatusText(_T("Last thread stopped."), 1);
+ SetStatusText(wxT("Last thread stopped."), 1);
#endif // wxUSE_STATUSBAR
}
}
wxGetApp().m_threads[n]->Resume();
#if wxUSE_STATUSBAR
- SetStatusText(_T("Thread resumed."), 1);
+ SetStatusText(wxT("Thread resumed."), 1);
#endif // wxUSE_STATUSBAR
}
}
wxGetApp().m_threads[n]->Pause();
#if wxUSE_STATUSBAR
- SetStatusText(_T("Thread paused."), 1);
+ SetStatusText(wxT("Thread paused."), 1);
#endif // wxUSE_STATUSBAR
}
}
switch ( nCPUs )
{
case -1:
- msg = _T("Unknown number of CPUs");
+ msg = wxT("Unknown number of CPUs");
break;
case 0:
- msg = _T("WARNING: you're running without any CPUs!");
+ msg = wxT("WARNING: you're running without any CPUs!");
break;
case 1:
- msg = _T("This system only has one CPU.");
+ msg = wxT("This system only has one CPU.");
break;
default:
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
{
wxMessageDialog dialog(this,
- _T("wxWidgets multithreaded application sample\n")
- _T("(c) 1998 Julian Smart, Guilhem Lavaux\n")
- _T("(c) 2000 Robert Roebling\n")
- _T("(c) 1999,2009 Vadim Zeitlin"),
- _T("About wxThread sample"),
+ wxT("wxWidgets multithreaded application sample\n")
+ wxT("(c) 1998 Julian Smart, Guilhem Lavaux\n")
+ wxT("(c) 2000 Robert Roebling\n")
+ wxT("(c) 1999,2009 Vadim Zeitlin"),
+ wxT("About wxThread sample"),
wxOK | wxICON_INFORMATION);
dialog.ShowModal();
m_dlgProgress = new wxProgressDialog
(
- _T("Progress dialog"),
- _T("Wait until the thread terminates or press [Cancel]"),
+ wxT("Progress dialog"),
+ wxT("Wait until the thread terminates or press [Cancel]"),
100,
this,
wxPD_CAN_ABORT |
public:
MyFrame(wxFrame *parent,
wxWindowID id = wxID_ANY,
- const wxString& title = _T("wxToolBar Sample"),
+ const wxString& title = wxT("wxToolBar Sample"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE);
// Create the main frame window
MyFrame* frame = new MyFrame((wxFrame *) NULL, wxID_ANY,
- _T("wxToolBar Sample"),
+ wxT("wxToolBar Sample"),
wxPoint(100, 100), wxSize(550, 300));
frame->Show(true);
#if wxUSE_STATUSBAR
- frame->SetStatusText(_T("Hello, wxWidgets"));
+ frame->SetStatusText(wxT("Hello, wxWidgets"));
#endif
wxInitAllImageHandlers();
// size to fit the biggest icon used anyhow but it doesn't hurt neither
toolBar->SetToolBitmapSize(wxSize(w, h));
- toolBar->AddTool(wxID_NEW, _T("New"),
+ toolBar->AddTool(wxID_NEW, wxT("New"),
toolBarBitmaps[Tool_new], wxNullBitmap, wxITEM_DROPDOWN,
- _T("New file"), _T("This is help for new file tool"));
+ wxT("New file"), wxT("This is help for new file tool"));
wxMenu* menu = new wxMenu;
- menu->Append(wxID_ANY, _T("&First dummy item"));
- menu->Append(wxID_ANY, _T("&Second dummy item"));
+ menu->Append(wxID_ANY, wxT("&First dummy item"));
+ menu->Append(wxID_ANY, wxT("&Second dummy item"));
menu->AppendSeparator();
- menu->Append(wxID_EXIT, _T("Exit"));
+ menu->Append(wxID_EXIT, wxT("Exit"));
toolBar->SetDropdownMenu(wxID_NEW, menu);
- toolBar->AddTool(wxID_OPEN, _T("Open"),
+ toolBar->AddTool(wxID_OPEN, wxT("Open"),
toolBarBitmaps[Tool_open], wxNullBitmap, wxITEM_NORMAL,
- _T("Open file"), _T("This is help for open file tool"));
+ wxT("Open file"), wxT("This is help for open file tool"));
#if USE_CONTROLS_IN_TOOLBAR
// adding a combo to a vertical toolbar is not very smart
if ( !toolBar->IsVertical() )
{
wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, wxEmptyString, wxDefaultPosition, wxSize(100,-1) );
- combo->Append(_T("This"));
- combo->Append(_T("is a"));
- combo->Append(_T("combobox"));
- combo->Append(_T("in a"));
- combo->Append(_T("toolbar"));
- toolBar->AddControl(combo, _T("Combo Label"));
+ combo->Append(wxT("This"));
+ combo->Append(wxT("is a"));
+ combo->Append(wxT("combobox"));
+ combo->Append(wxT("in a"));
+ combo->Append(wxT("toolbar"));
+ toolBar->AddControl(combo, wxT("Combo Label"));
}
#endif // USE_CONTROLS_IN_TOOLBAR
- toolBar->AddTool(wxID_SAVE, _T("Save"), toolBarBitmaps[Tool_save], _T("Toggle button 1"), wxITEM_CHECK);
- toolBar->AddTool(wxID_COPY, _T("Copy"), toolBarBitmaps[Tool_copy], _T("Toggle button 2"), wxITEM_CHECK);
- toolBar->AddTool(wxID_CUT, _T("Cut"), toolBarBitmaps[Tool_cut], _T("Toggle/Untoggle help button"));
- toolBar->AddTool(wxID_PASTE, _T("Paste"), toolBarBitmaps[Tool_paste], _T("Paste"));
+ toolBar->AddTool(wxID_SAVE, wxT("Save"), toolBarBitmaps[Tool_save], wxT("Toggle button 1"), wxITEM_CHECK);
+ toolBar->AddTool(wxID_COPY, wxT("Copy"), toolBarBitmaps[Tool_copy], wxT("Toggle button 2"), wxITEM_CHECK);
+ toolBar->AddTool(wxID_CUT, wxT("Cut"), toolBarBitmaps[Tool_cut], wxT("Toggle/Untoggle help button"));
+ toolBar->AddTool(wxID_PASTE, wxT("Paste"), toolBarBitmaps[Tool_paste], wxT("Paste"));
if ( m_useCustomDisabled )
{
dc.DrawLine(0, 0, w, h);
}
- toolBar->AddTool(wxID_PRINT, _T("Print"), toolBarBitmaps[Tool_print],
+ toolBar->AddTool(wxID_PRINT, wxT("Print"), toolBarBitmaps[Tool_print],
bmpDisabled);
}
else
{
- toolBar->AddTool(wxID_PRINT, _T("Print"), toolBarBitmaps[Tool_print],
- _T("Delete this tool. This is a very long tooltip to test whether it does the right thing when the tooltip is more than Windows can cope with."));
+ toolBar->AddTool(wxID_PRINT, wxT("Print"), toolBarBitmaps[Tool_print],
+ wxT("Delete this tool. This is a very long tooltip to test whether it does the right thing when the tooltip is more than Windows can cope with."));
}
toolBar->AddSeparator();
- toolBar->AddTool(wxID_HELP, _T("Help"), toolBarBitmaps[Tool_help], _T("Help button"), wxITEM_CHECK);
+ toolBar->AddTool(wxID_HELP, wxT("Help"), toolBarBitmaps[Tool_help], wxT("Help button"), wxITEM_CHECK);
if ( !m_pathBmp.empty() )
{
img = img.GetSubImage(wxRect(0, 0, w, h));
toolBar->AddSeparator();
- toolBar->AddTool(wxID_ANY, _T("Custom"), img);
+ toolBar->AddTool(wxID_ANY, wxT("Custom"), img);
}
}
// Make a menubar
wxMenu *tbarMenu = new wxMenu;
tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLE_TOOLBAR,
- _T("Toggle &toolbar\tCtrl-Z"),
- _T("Show or hide the toolbar"));
+ wxT("Toggle &toolbar\tCtrl-Z"),
+ wxT("Show or hide the toolbar"));
tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLE_ANOTHER_TOOLBAR,
- _T("Toggle &another toolbar\tCtrl-A"),
- _T("Show/hide another test toolbar"));
+ wxT("Toggle &another toolbar\tCtrl-A"),
+ wxT("Show/hide another test toolbar"));
tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLE_HORIZONTAL_TEXT,
- _T("Toggle hori&zontal text\tCtrl-H"),
- _T("Show text under/alongside the icon"));
+ wxT("Toggle hori&zontal text\tCtrl-H"),
+ wxT("Show text under/alongside the icon"));
tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLETOOLBARSIZE,
- _T("&Toggle toolbar size\tCtrl-S"),
- _T("Toggle between big/small toolbar"));
+ wxT("&Toggle toolbar size\tCtrl-S"),
+ wxT("Toggle between big/small toolbar"));
tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLETOOLBARROWS,
- _T("Toggle number of &rows\tCtrl-R"),
- _T("Toggle number of toolbar rows between 1 and 2"));
+ wxT("Toggle number of &rows\tCtrl-R"),
+ wxT("Toggle number of toolbar rows between 1 and 2"));
tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLETOOLTIPS,
- _T("Show &tooltips\tCtrl-L"),
- _T("Show tooltips for the toolbar tools"));
+ wxT("Show &tooltips\tCtrl-L"),
+ wxT("Show tooltips for the toolbar tools"));
tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLECUSTOMDISABLED,
- _T("Use c&ustom disabled images\tCtrl-U"),
- _T("Switch between using system-generated and custom disabled images"));
+ wxT("Use c&ustom disabled images\tCtrl-U"),
+ wxT("Switch between using system-generated and custom disabled images"));
tbarMenu->AppendSeparator();
tbarMenu->AppendRadioItem(IDM_TOOLBAR_TOP_ORIENTATION,
- _T("Set toolbar at the top of the window"),
- _T("Set toolbar at the top of the window"));
+ wxT("Set toolbar at the top of the window"),
+ wxT("Set toolbar at the top of the window"));
tbarMenu->AppendRadioItem(IDM_TOOLBAR_LEFT_ORIENTATION,
- _T("Set toolbar at the left of the window"),
- _T("Set toolbar at the left of the window"));
+ wxT("Set toolbar at the left of the window"),
+ wxT("Set toolbar at the left of the window"));
tbarMenu->AppendRadioItem(IDM_TOOLBAR_BOTTOM_ORIENTATION,
- _T("Set toolbar at the bottom of the window"),
- _T("Set toolbar at the bottom of the window"));
+ wxT("Set toolbar at the bottom of the window"),
+ wxT("Set toolbar at the bottom of the window"));
tbarMenu->AppendRadioItem(IDM_TOOLBAR_RIGHT_ORIENTATION,
- _T("Set toolbar at the right edge of the window"),
- _T("Set toolbar at the right edge of the window"));
+ wxT("Set toolbar at the right edge of the window"),
+ wxT("Set toolbar at the right edge of the window"));
tbarMenu->AppendSeparator();
- tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_TEXT, _T("Show &text\tCtrl-Alt-T"));
- tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_ICONS, _T("Show &icons\tCtrl-Alt-I"));
- tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_BOTH, _T("Show &both\tCtrl-Alt-B"));
+ tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_TEXT, wxT("Show &text\tCtrl-Alt-T"));
+ tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_ICONS, wxT("Show &icons\tCtrl-Alt-I"));
+ tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_BOTH, wxT("Show &both\tCtrl-Alt-B"));
tbarMenu->AppendSeparator();
- tbarMenu->Append(IDM_TOOLBAR_BG_COL, _T("Choose bac&kground colour..."));
- tbarMenu->Append(IDM_TOOLBAR_CUSTOM_PATH, _T("Custom &bitmap...\tCtrl-B"));
+ tbarMenu->Append(IDM_TOOLBAR_BG_COL, wxT("Choose bac&kground colour..."));
+ tbarMenu->Append(IDM_TOOLBAR_CUSTOM_PATH, wxT("Custom &bitmap...\tCtrl-B"));
wxMenu *toolMenu = new wxMenu;
- toolMenu->Append(IDM_TOOLBAR_ENABLEPRINT, _T("&Enable print button\tCtrl-E"));
- toolMenu->Append(IDM_TOOLBAR_DELETEPRINT, _T("&Delete print button\tCtrl-D"));
- toolMenu->Append(IDM_TOOLBAR_INSERTPRINT, _T("&Insert print button\tCtrl-I"));
- toolMenu->Append(IDM_TOOLBAR_TOGGLEHELP, _T("Toggle &help button\tCtrl-T"));
- toolMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLESEARCH, _T("Toggle &search field\tCtrl-F"));
+ toolMenu->Append(IDM_TOOLBAR_ENABLEPRINT, wxT("&Enable print button\tCtrl-E"));
+ toolMenu->Append(IDM_TOOLBAR_DELETEPRINT, wxT("&Delete print button\tCtrl-D"));
+ toolMenu->Append(IDM_TOOLBAR_INSERTPRINT, wxT("&Insert print button\tCtrl-I"));
+ toolMenu->Append(IDM_TOOLBAR_TOGGLEHELP, wxT("Toggle &help button\tCtrl-T"));
+ toolMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLESEARCH, wxT("Toggle &search field\tCtrl-F"));
toolMenu->AppendSeparator();
- toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN1, _T("Toggle &1st radio button\tCtrl-1"));
- toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN2, _T("Toggle &2nd radio button\tCtrl-2"));
- toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN3, _T("Toggle &3rd radio button\tCtrl-3"));
+ toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN1, wxT("Toggle &1st radio button\tCtrl-1"));
+ toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN2, wxT("Toggle &2nd radio button\tCtrl-2"));
+ toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN3, wxT("Toggle &3rd radio button\tCtrl-3"));
toolMenu->AppendSeparator();
- toolMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, _T("Change tooltip of \"New\""));
+ toolMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, wxT("Change tooltip of \"New\""));
wxMenu *fileMenu = new wxMenu;
- fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt-X"), _T("Quit toolbar sample") );
+ fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt-X"), wxT("Quit toolbar sample") );
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(wxID_HELP, _T("&About"), _T("About toolbar sample"));
+ helpMenu->Append(wxID_HELP, wxT("&About"), wxT("About toolbar sample"));
wxMenuBar* menuBar = new wxMenuBar( wxMB_DOCKABLE );
- menuBar->Append(fileMenu, _T("&File"));
- menuBar->Append(tbarMenu, _T("&Toolbar"));
- menuBar->Append(toolMenu, _T("Tool&s"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(fileMenu, wxT("&File"));
+ menuBar->Append(tbarMenu, wxT("&Toolbar"));
+ menuBar->Append(toolMenu, wxT("Tool&s"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// Associate the menu bar with the frame
SetMenuBar(menuBar);
m_tbar->SetMargins(4, 4);
- m_tbar->AddRadioTool(IDM_TOOLBAR_OTHER_1, _T("First"), wxBITMAP(new));
- m_tbar->AddRadioTool(IDM_TOOLBAR_OTHER_2, _T("Second"), wxBITMAP(open));
- m_tbar->AddRadioTool(IDM_TOOLBAR_OTHER_3, _T("Third"), wxBITMAP(save));
+ m_tbar->AddRadioTool(IDM_TOOLBAR_OTHER_1, wxT("First"), wxBITMAP(new));
+ m_tbar->AddRadioTool(IDM_TOOLBAR_OTHER_2, wxT("Second"), wxBITMAP(open));
+ m_tbar->AddRadioTool(IDM_TOOLBAR_OTHER_3, wxT("Third"), wxBITMAP(save));
m_tbar->AddSeparator();
- m_tbar->AddTool(wxID_HELP, _T("Help"), wxBITMAP(help));
+ m_tbar->AddTool(wxID_HELP, wxT("Help"), wxBITMAP(help));
m_tbar->Realize();
}
void MyFrame::OnAbout(wxCommandEvent& event)
{
if ( event.IsChecked() )
- m_textWindow->WriteText( _T("Help button down now.\n") );
+ m_textWindow->WriteText( wxT("Help button down now.\n") );
else
- m_textWindow->WriteText( _T("Help button up now.\n") );
+ m_textWindow->WriteText( wxT("Help button up now.\n") );
- (void)wxMessageBox(_T("wxWidgets toolbar sample"), _T("About wxToolBar"));
+ (void)wxMessageBox(wxT("wxWidgets toolbar sample"), wxT("About wxToolBar"));
}
void MyFrame::OnToolLeftClick(wxCommandEvent& event)
{
wxString str;
- str.Printf( _T("Clicked on tool %d\n"), event.GetId());
+ str.Printf( wxT("Clicked on tool %d\n"), event.GetId());
m_textWindow->WriteText( str );
if (event.GetId() == wxID_COPY)
void MyFrame::OnToolRightClick(wxCommandEvent& event)
{
m_textWindow->AppendText(
- wxString::Format(_T("Tool %d right clicked.\n"),
+ wxString::Format(wxT("Tool %d right clicked.\n"),
(int) event.GetInt()));
}
void MyFrame::OnCombo(wxCommandEvent& event)
{
- wxLogStatus(_T("Combobox string '%s' selected"), event.GetString().c_str());
+ wxLogStatus(wxT("Combobox string '%s' selected"), event.GetString().c_str());
}
void MyFrame::DoEnablePrint()
void MyFrame::OnChangeToolTip(wxCommandEvent& WXUNUSED(event))
{
- GetToolBar()->SetToolShortHelp(wxID_NEW, _T("New toolbar button"));
+ GetToolBar()->SetToolShortHelp(wxID_NEW, wxT("New toolbar button"));
}
void MyFrame::OnToolbarStyle(wxCommandEvent& event)
m_nPrint++;
wxToolBarBase *tb = GetToolBar();
- tb->InsertTool(0, wxID_PRINT, _T("New print"),
+ tb->InsertTool(0, wxID_PRINT, wxT("New print"),
wxBITMAP(print), wxNullBitmap,
wxITEM_NORMAL,
- _T("Delete this tool"),
- _T("This button was inserted into the toolbar"));
+ wxT("Delete this tool"),
+ wxT("This button was inserted into the toolbar"));
// must call Realize() after adding a new button
tb->Realize();
void MyFrame::OnToolDropdown(wxCommandEvent& event)
{
wxString str;
- str.Printf( _T("Dropdown on tool %d\n"), event.GetId());
+ str.Printf( wxT("Dropdown on tool %d\n"), event.GetId());
m_textWindow->WriteText( str );
event.Skip();
{
wxTreeItemId idLast = m_treeCtrl->GetLastChild(idRoot);
status = wxString::Format(
- _T("Root/last item is %svisible/%svisible"),
- m_treeCtrl->IsVisible(idRoot) ? _T("") : _T("not "),
+ wxT("Root/last item is %svisible/%svisible"),
+ m_treeCtrl->IsVisible(idRoot) ? wxT("") : wxT("not "),
idLast.IsOk() && m_treeCtrl->IsVisible(idLast)
- ? _T("") : _T("not "));
+ ? wxT("") : wxT("not "));
}
else
- status = _T("No root item");
+ status = wxT("No root item");
SetStatusText(status, 1);
}
wxRect r;
if ( !m_treeCtrl->GetBoundingRect(id, r, true /* text, not full row */) )
{
- wxLogMessage(_T("Failed to get bounding item rect"));
+ wxLogMessage(wxT("Failed to get bounding item rect"));
return;
}
wxTreeItemId item = event.GetItem();
wxString text;
if ( item.IsOk() )
- text << _T('"') << GetItemText(item).c_str() << _T('"');
+ text << wxT('"') << GetItemText(item).c_str() << wxT('"');
else
- text = _T("invalid item");
+ text = wxT("invalid item");
wxLogMessage(wxT("%s(%s)"), name, text.c_str());
}
#define TREE_EVENT_HANDLER(name) \
void MyTreeCtrl::name(wxTreeEvent& event) \
{ \
- LogEvent(_T(#name), event); \
+ LogEvent(wxT(#name), event); \
SetLastItem(wxTreeItemId()); \
event.Skip(); \
}
else if ( itemId == GetRootItem() )
{
// test that it is possible to change the text of the item being edited
- SetItemText(itemId, _T("Editing root item"));
+ SetItemText(itemId, wxT("Editing root item"));
}
}
wxPoint screenpt = ClientToScreen(clientpt);
wxLogMessage(wxT("OnItemMenu for item \"%s\" at screen coords (%i, %i)"),
- item ? item->GetDesc() : _T(""), screenpt.x, screenpt.y);
+ item ? item->GetDesc() : wxT(""), screenpt.x, screenpt.y);
ShowMenu(itemId, clientpt);
event.Skip();
: NULL;
wxLogMessage(wxT("Item \"%s\" right clicked"), item ? item->GetDesc()
- : _T(""));
+ : wxT(""));
event.Skip();
}
EVT_MENU(TYPES_MIME, MyApp::DoMIMEDemo)
END_EVENT_TABLE()
-wxString file_name = _T("test_wx.dat");
-wxString file_name2 = wxString(_T("test_wx2.dat"));
+wxString file_name = wxT("test_wx.dat");
+wxString file_name2 = wxString(wxT("test_wx2.dat"));
bool MyApp::OnInit()
{
return false;
// Create the main frame window
- MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets Types Demo"),
+ MyFrame *frame = new MyFrame((wxFrame *) NULL, wxT("wxWidgets Types Demo"),
wxPoint(50, 50), wxSize(450, 340));
// Give it an icon
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(TYPES_ABOUT, _T("&About"));
+ file_menu->Append(TYPES_ABOUT, wxT("&About"));
file_menu->AppendSeparator();
- file_menu->Append(TYPES_QUIT, _T("E&xit\tAlt-X"));
+ file_menu->Append(TYPES_QUIT, wxT("E&xit\tAlt-X"));
wxMenu *test_menu = new wxMenu;
- test_menu->Append(TYPES_VARIANT, _T("&Variant test"));
- test_menu->Append(TYPES_BYTEORDER, _T("&Byteorder test"));
+ test_menu->Append(TYPES_VARIANT, wxT("&Variant test"));
+ test_menu->Append(TYPES_BYTEORDER, wxT("&Byteorder test"));
#if wxUSE_UNICODE
- test_menu->Append(TYPES_UNICODE, _T("&Unicode test"));
+ test_menu->Append(TYPES_UNICODE, wxT("&Unicode test"));
#endif // wxUSE_UNICODE
- test_menu->Append(TYPES_STREAM, _T("&Stream test"));
- test_menu->Append(TYPES_STREAM2, _T("&Stream seek test"));
- test_menu->Append(TYPES_STREAM3, _T("&Stream error test"));
- test_menu->Append(TYPES_STREAM4, _T("&Stream buffer test"));
- test_menu->Append(TYPES_STREAM5, _T("&Stream peek test"));
- test_menu->Append(TYPES_STREAM6, _T("&Stream ungetch test"));
- test_menu->Append(TYPES_STREAM7, _T("&Stream ungetch test for a buffered stream"));
+ test_menu->Append(TYPES_STREAM, wxT("&Stream test"));
+ test_menu->Append(TYPES_STREAM2, wxT("&Stream seek test"));
+ test_menu->Append(TYPES_STREAM3, wxT("&Stream error test"));
+ test_menu->Append(TYPES_STREAM4, wxT("&Stream buffer test"));
+ test_menu->Append(TYPES_STREAM5, wxT("&Stream peek test"));
+ test_menu->Append(TYPES_STREAM6, wxT("&Stream ungetch test"));
+ test_menu->Append(TYPES_STREAM7, wxT("&Stream ungetch test for a buffered stream"));
test_menu->AppendSeparator();
- test_menu->Append(TYPES_MIME, _T("&MIME database test"));
+ test_menu->Append(TYPES_MIME, wxT("&MIME database test"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, _T("&File"));
- menu_bar->Append(test_menu, _T("&Tests"));
+ menu_bar->Append(file_menu, wxT("&File"));
+ menu_bar->Append(test_menu, wxT("&Tests"));
frame->SetMenuBar(menu_bar);
m_textCtrl = new wxTextCtrl(frame, wxID_ANY, wxEmptyString,
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl << _T("\nTest fstream vs. wxFileStream:\n\n");
+ textCtrl << wxT("\nTest fstream vs. wxFileStream:\n\n");
- textCtrl.WriteText( _T("Writing to ofstream and wxFileOutputStream:\n") );
+ textCtrl.WriteText( wxT("Writing to ofstream and wxFileOutputStream:\n") );
wxSTD ofstream std_file_output( "test_std.dat" );
wxFileOutputStream file_output( file_name );
wxString tmp;
signed int si = 0xFFFFFFFF;
- tmp.Printf( _T("Signed int: %d\n"), si );
+ tmp.Printf( wxT("Signed int: %d\n"), si );
textCtrl.WriteText( tmp );
- text_output << si << _T("\n");
+ text_output << si << wxT("\n");
std_file_output << si << "\n";
unsigned int ui = 0xFFFFFFFF;
- tmp.Printf( _T("Unsigned int: %u\n"), ui );
+ tmp.Printf( wxT("Unsigned int: %u\n"), ui );
textCtrl.WriteText( tmp );
- text_output << ui << _T("\n");
+ text_output << ui << wxT("\n");
std_file_output << ui << "\n";
double d = 2.01234567890123456789;
- tmp.Printf( _T("Double: %f\n"), d );
+ tmp.Printf( wxT("Double: %f\n"), d );
textCtrl.WriteText( tmp );
- text_output << d << _T("\n");
+ text_output << d << wxT("\n");
std_file_output << d << "\n";
float f = (float)0.00001;
- tmp.Printf( _T("Float: %f\n"), f );
+ tmp.Printf( wxT("Float: %f\n"), f );
textCtrl.WriteText( tmp );
- text_output << f << _T("\n");
+ text_output << f << wxT("\n");
std_file_output << f << "\n";
- wxString str( _T("Hello!") );
- tmp.Printf( _T("String: %s\n"), str.c_str() );
+ wxString str( wxT("Hello!") );
+ tmp.Printf( wxT("String: %s\n"), str.c_str() );
textCtrl.WriteText( tmp );
- text_output << str << _T("\n");
+ text_output << str << wxT("\n");
std_file_output << str.ToAscii() << "\n";
std_file_output.close();
- textCtrl.WriteText( _T("\nReading from ifstream:\n") );
+ textCtrl.WriteText( wxT("\nReading from ifstream:\n") );
wxSTD ifstream std_file_input( "test_std.dat" );
std_file_input >> si;
- tmp.Printf( _T("Signed int: %d\n"), si );
+ tmp.Printf( wxT("Signed int: %d\n"), si );
textCtrl.WriteText( tmp );
std_file_input >> ui;
- tmp.Printf( _T("Unsigned int: %u\n"), ui );
+ tmp.Printf( wxT("Unsigned int: %u\n"), ui );
textCtrl.WriteText( tmp );
std_file_input >> d;
- tmp.Printf( _T("Double: %f\n"), d );
+ tmp.Printf( wxT("Double: %f\n"), d );
textCtrl.WriteText( tmp );
std_file_input >> f;
- tmp.Printf( _T("Float: %f\n"), f );
+ tmp.Printf( wxT("Float: %f\n"), f );
textCtrl.WriteText( tmp );
char std_buf[200];
std_file_input >> std_buf;
str = wxString::FromAscii(std_buf);
- tmp.Printf( _T("String: %s\n"), str.c_str() );
+ tmp.Printf( wxT("String: %s\n"), str.c_str() );
textCtrl.WriteText( tmp );
- textCtrl.WriteText( _T("\nReading from wxFileInputStream:\n") );
+ textCtrl.WriteText( wxT("\nReading from wxFileInputStream:\n") );
buf_output.Sync();
wxTextInputStream text_input( file_input );
text_input >> si;
- tmp.Printf( _T("Signed int: %d\n"), si );
+ tmp.Printf( wxT("Signed int: %d\n"), si );
textCtrl.WriteText( tmp );
text_input >> ui;
- tmp.Printf( _T("Unsigned int: %u\n"), ui );
+ tmp.Printf( wxT("Unsigned int: %u\n"), ui );
textCtrl.WriteText( tmp );
text_input >> d;
- tmp.Printf( _T("Double: %f\n"), d );
+ tmp.Printf( wxT("Double: %f\n"), d );
textCtrl.WriteText( tmp );
text_input >> f;
- tmp.Printf( _T("Float: %f\n"), f );
+ tmp.Printf( wxT("Float: %f\n"), f );
textCtrl.WriteText( tmp );
text_input >> str;
- tmp.Printf( _T("String: %s\n"), str.c_str() );
+ tmp.Printf( wxT("String: %s\n"), str.c_str() );
textCtrl.WriteText( tmp );
- textCtrl << _T("\nTest for wxDataStream:\n\n");
+ textCtrl << wxT("\nTest for wxDataStream:\n\n");
- textCtrl.WriteText( _T("Writing to wxDataOutputStream:\n") );
+ textCtrl.WriteText( wxT("Writing to wxDataOutputStream:\n") );
file_output.SeekO( 0 );
wxDataOutputStream data_output( buf_output );
wxInt16 i16 = (unsigned short)0xFFFF;
- tmp.Printf( _T("Signed int16: %d\n"), (int)i16 );
+ tmp.Printf( wxT("Signed int16: %d\n"), (int)i16 );
textCtrl.WriteText( tmp );
data_output.Write16( i16 );
wxUint16 ui16 = 0xFFFF;
- tmp.Printf( _T("Unsigned int16: %u\n"), (unsigned int) ui16 );
+ tmp.Printf( wxT("Unsigned int16: %u\n"), (unsigned int) ui16 );
textCtrl.WriteText( tmp );
data_output.Write16( ui16 );
d = 2.01234567890123456789;
- tmp.Printf( _T("Double: %f\n"), d );
+ tmp.Printf( wxT("Double: %f\n"), d );
textCtrl.WriteText( tmp );
data_output.WriteDouble( d );
- str = _T("Hello!");
- tmp.Printf( _T("String: %s\n"), str.c_str() );
+ str = wxT("Hello!");
+ tmp.Printf( wxT("String: %s\n"), str.c_str() );
textCtrl.WriteText( tmp );
data_output.WriteString( str );
buf_output.Sync();
- textCtrl.WriteText( _T("\nReading from wxDataInputStream:\n") );
+ textCtrl.WriteText( wxT("\nReading from wxDataInputStream:\n") );
file_input.SeekI( 0 );
wxDataInputStream data_input( buf_input );
i16 = data_input.Read16();
- tmp.Printf( _T("Signed int16: %d\n"), (int)i16 );
+ tmp.Printf( wxT("Signed int16: %d\n"), (int)i16 );
textCtrl.WriteText( tmp );
ui16 = data_input.Read16();
- tmp.Printf( _T("Unsigned int16: %u\n"), (unsigned int) ui16 );
+ tmp.Printf( wxT("Unsigned int16: %u\n"), (unsigned int) ui16 );
textCtrl.WriteText( tmp );
d = data_input.ReadDouble();
- tmp.Printf( _T("Double: %f\n"), d );
+ tmp.Printf( wxT("Double: %f\n"), d );
textCtrl.WriteText( tmp );
str = data_input.ReadString();
- tmp.Printf( _T("String: %s\n"), str.c_str() );
+ tmp.Printf( wxT("String: %s\n"), str.c_str() );
textCtrl.WriteText( tmp );
}
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl << _T("\nTesting wxBufferedStream:\n\n");
+ textCtrl << wxT("\nTesting wxBufferedStream:\n\n");
char ch,ch2;
- textCtrl.WriteText( _T("Writing number 0 to 9 to buffered wxFileOutputStream:\n\n") );
+ textCtrl.WriteText( wxT("Writing number 0 to 9 to buffered wxFileOutputStream:\n\n") );
wxFileOutputStream file_output( file_name );
wxBufferedOutputStream buf_output( file_output );
for (ch2 = 0; ch2 < 10; ch2++)
{
file_input.Read( &ch, 1 );
- textCtrl.WriteText( (wxChar)(ch + _T('0')) );
+ textCtrl.WriteText( (wxChar)(ch + wxT('0')) );
}
- textCtrl.WriteText( _T("\n\n\n") );
+ textCtrl.WriteText( wxT("\n\n\n") );
- textCtrl.WriteText( _T("Writing number 0 to 9 to buffered wxFileOutputStream, then\n") );
- textCtrl.WriteText( _T("seeking back to #3 and writing 0:\n\n") );
+ textCtrl.WriteText( wxT("Writing number 0 to 9 to buffered wxFileOutputStream, then\n") );
+ textCtrl.WriteText( wxT("seeking back to #3 and writing 0:\n\n") );
wxFileOutputStream file_output2( file_name2 );
wxBufferedOutputStream buf_output2( file_output2 );
for (ch2 = 0; ch2 < 10; ch2++)
{
file_input2.Read( &ch, 1 );
- textCtrl.WriteText( (wxChar)(ch + _T('0')) );
+ textCtrl.WriteText( (wxChar)(ch + wxT('0')) );
}
- textCtrl.WriteText( _T("\n\n\n") );
+ textCtrl.WriteText( wxT("\n\n\n") );
// now append 2000 bytes to file (bigger than buffer)
buf_output2.SeekO( 0, wxFromEnd );
buf_output2.Write( &ch, 1 );
buf_output2.Sync();
- textCtrl.WriteText( _T("Reading number 0 to 9 from buffered wxFileInputStream, then\n") );
- textCtrl.WriteText( _T("seeking back to #3 and reading the 0:\n\n") );
+ textCtrl.WriteText( wxT("Reading number 0 to 9 from buffered wxFileInputStream, then\n") );
+ textCtrl.WriteText( wxT("seeking back to #3 and reading the 0:\n\n") );
wxFileInputStream file_input3( file_name2 );
wxBufferedInputStream buf_input3( file_input3 );
for (ch2 = 0; ch2 < 10; ch2++)
{
buf_input3.Read( &ch, 1 );
- textCtrl.WriteText( (wxChar)(ch + _T('0')) );
+ textCtrl.WriteText( (wxChar)(ch + wxT('0')) );
}
for (int j = 0; j < 2000; j++)
buf_input3.Read( &ch, 1 );
- textCtrl.WriteText( _T("\n") );
+ textCtrl.WriteText( wxT("\n") );
buf_input3.SeekI( 3 );
buf_input3.Read( &ch, 1 );
- textCtrl.WriteText( (wxChar)(ch + _T('0')) );
- textCtrl.WriteText( _T("\n\n\n") );
+ textCtrl.WriteText( (wxChar)(ch + wxT('0')) );
+ textCtrl.WriteText( wxT("\n\n\n") );
}
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl << _T("\nTesting wxFileInputStream's and wxFFileInputStream's error handling:\n\n");
+ textCtrl << wxT("\nTesting wxFileInputStream's and wxFFileInputStream's error handling:\n\n");
char ch,ch2;
- textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream:\n\n") );
+ textCtrl.WriteText( wxT("Writing number 0 to 9 to wxFileOutputStream:\n\n") );
wxFileOutputStream file_output( file_name );
for (ch = 0; ch < 10; ch++)
// Testing wxFileInputStream
- textCtrl.WriteText( _T("Reading 0 to 10 to wxFileInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading 0 to 10 to wxFileInputStream:\n\n") );
wxFileInputStream file_input( file_name );
for (ch2 = 0; ch2 < 11; ch2++)
{
file_input.Read( &ch, 1 );
- textCtrl.WriteText( _T("Value read: ") );
+ textCtrl.WriteText( wxT("Value read: ") );
textCtrl.WriteText( (wxChar)(ch + '0') );
- textCtrl.WriteText( _T("; stream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("; stream.GetLastError() returns: ") );
switch (file_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
}
- textCtrl.WriteText( _T("\n") );
+ textCtrl.WriteText( wxT("\n") );
- textCtrl.WriteText( _T("Seeking to 0; stream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("Seeking to 0; stream.GetLastError() returns: ") );
file_input.SeekI( 0 );
switch (file_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
- textCtrl.WriteText( _T("\n") );
+ textCtrl.WriteText( wxT("\n") );
file_input.Read( &ch, 1 );
- textCtrl.WriteText( _T("Value read: ") );
- textCtrl.WriteText( (wxChar)(ch + _T('0')) );
- textCtrl.WriteText( _T("; stream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("Value read: ") );
+ textCtrl.WriteText( (wxChar)(ch + wxT('0')) );
+ textCtrl.WriteText( wxT("; stream.GetLastError() returns: ") );
switch (file_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
- textCtrl.WriteText( _T("\n\n") );
+ textCtrl.WriteText( wxT("\n\n") );
// Testing wxFFileInputStream
- textCtrl.WriteText( _T("Reading 0 to 10 to wxFFileInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading 0 to 10 to wxFFileInputStream:\n\n") );
wxFFileInputStream ffile_input( file_name );
for (ch2 = 0; ch2 < 11; ch2++)
{
ffile_input.Read( &ch, 1 );
- textCtrl.WriteText( _T("Value read: ") );
+ textCtrl.WriteText( wxT("Value read: ") );
textCtrl.WriteText( (wxChar)(ch + '0') );
- textCtrl.WriteText( _T("; stream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("; stream.GetLastError() returns: ") );
switch (ffile_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
}
- textCtrl.WriteText( _T("\n") );
+ textCtrl.WriteText( wxT("\n") );
- textCtrl.WriteText( _T("Seeking to 0; stream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("Seeking to 0; stream.GetLastError() returns: ") );
ffile_input.SeekI( 0 );
switch (ffile_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
- textCtrl.WriteText( _T("\n") );
+ textCtrl.WriteText( wxT("\n") );
ffile_input.Read( &ch, 1 );
- textCtrl.WriteText( _T("Value read: ") );
+ textCtrl.WriteText( wxT("Value read: ") );
textCtrl.WriteText( (wxChar)(ch + '0') );
- textCtrl.WriteText( _T("; stream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("; stream.GetLastError() returns: ") );
switch (ffile_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
- textCtrl.WriteText( _T("\n\n") );
+ textCtrl.WriteText( wxT("\n\n") );
// Testing wxFFileInputStream
- textCtrl.WriteText( _T("Reading 0 to 10 to buffered wxFFileInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading 0 to 10 to buffered wxFFileInputStream:\n\n") );
wxFFileInputStream ffile_input2( file_name );
wxBufferedInputStream buf_input( ffile_input2 );
for (ch2 = 0; ch2 < 11; ch2++)
{
buf_input.Read( &ch, 1 );
- textCtrl.WriteText( _T("Value read: ") );
+ textCtrl.WriteText( wxT("Value read: ") );
textCtrl.WriteText( (wxChar)(ch + '0') );
- textCtrl.WriteText( _T("; stream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("; stream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
}
- textCtrl.WriteText( _T("\n") );
+ textCtrl.WriteText( wxT("\n") );
- textCtrl.WriteText( _T("Seeking to 0; stream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("Seeking to 0; stream.GetLastError() returns: ") );
buf_input.SeekI( 0 );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
- textCtrl.WriteText( _T("\n") );
+ textCtrl.WriteText( wxT("\n") );
buf_input.Read( &ch, 1 );
- textCtrl.WriteText( _T("Value read: ") );
+ textCtrl.WriteText( wxT("Value read: ") );
textCtrl.WriteText( (wxChar)(ch + '0') );
- textCtrl.WriteText( _T("; stream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("; stream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
}
wxString msg;
textCtrl.Clear();
- textCtrl << _T("\nTesting wxStreamBuffer:\n\n");
+ textCtrl << wxT("\nTesting wxStreamBuffer:\n\n");
// bigger than buffer
- textCtrl.WriteText( _T("Writing 2000x 1 to wxFileOutputStream.\n\n") );
+ textCtrl.WriteText( wxT("Writing 2000x 1 to wxFileOutputStream.\n\n") );
wxFileOutputStream file_output( file_name );
for (int i = 0; i < 2000; i++)
file_output.Write( &ch, 1 );
}
- textCtrl.WriteText( _T("Opening with a buffered wxFileInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Opening with a buffered wxFileInputStream:\n\n") );
wxFileInputStream file_input( file_name );
wxBufferedInputStream buf_input( file_input );
- textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("wxBufferedInputStream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
- textCtrl.WriteText( _T("\n\n") );
+ textCtrl.WriteText( wxT("\n\n") );
- textCtrl.WriteText( _T("Seeking to position 300:\n\n") );
+ textCtrl.WriteText( wxT("Seeking to position 300:\n\n") );
buf_input.SeekI( 300 );
- textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("wxBufferedInputStream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
- textCtrl.WriteText( _T("\n\n") );
+ textCtrl.WriteText( wxT("\n\n") );
char buf[2000];
- textCtrl.WriteText( _T("Reading 500 bytes:\n\n") );
+ textCtrl.WriteText( wxT("Reading 500 bytes:\n\n") );
buf_input.Read( buf, 500 );
- textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("wxBufferedInputStream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
- textCtrl.WriteText( _T("\n\n") );
+ textCtrl.WriteText( wxT("\n\n") );
- textCtrl.WriteText( _T("Reading another 500 bytes:\n\n") );
+ textCtrl.WriteText( wxT("Reading another 500 bytes:\n\n") );
buf_input.Read( buf, 500 );
- textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("wxBufferedInputStream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
- textCtrl.WriteText( _T("\n\n") );
+ textCtrl.WriteText( wxT("\n\n") );
- textCtrl.WriteText( _T("Reading another 500 bytes:\n\n") );
+ textCtrl.WriteText( wxT("Reading another 500 bytes:\n\n") );
buf_input.Read( buf, 500 );
- textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("wxBufferedInputStream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
- textCtrl.WriteText( _T("\n\n") );
+ textCtrl.WriteText( wxT("\n\n") );
- textCtrl.WriteText( _T("Reading another 500 bytes:\n\n") );
+ textCtrl.WriteText( wxT("Reading another 500 bytes:\n\n") );
buf_input.Read( buf, 500 );
- textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
+ textCtrl.WriteText( wxT("wxBufferedInputStream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
- default: textCtrl.WriteText( _T("Huh?\n") ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( wxT("Huh?\n") ); break;
}
msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
- textCtrl.WriteText( _T("\n\n") );
+ textCtrl.WriteText( wxT("\n\n") );
}
void MyApp::DoStreamDemo5(wxCommandEvent& WXUNUSED(event))
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl << _T("\nTesting wxFileInputStream's Peek():\n\n");
+ textCtrl << wxT("\nTesting wxFileInputStream's Peek():\n\n");
char ch;
wxString str;
- textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream:\n\n") );
+ textCtrl.WriteText( wxT("Writing number 0 to 9 to wxFileOutputStream:\n\n") );
wxFileOutputStream file_output( file_name );
for (ch = 0; ch < 10; ch++)
textCtrl.WriteText( str );
- textCtrl << _T("\n\n\nTesting wxMemoryInputStream's Peek():\n\n");
+ textCtrl << wxT("\n\n\nTesting wxMemoryInputStream's Peek():\n\n");
char buf[] = { 0,1,2,3,4,5,6,7,8,9,10 };
wxMemoryInputStream input( buf, 10 );
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl.WriteText( _T("\nTesting Ungetch():\n\n") );
+ textCtrl.WriteText( wxT("\nTesting Ungetch():\n\n") );
char ch = 0;
wxString str;
- textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream...\n\n") );
+ textCtrl.WriteText( wxT("Writing number 0 to 9 to wxFileOutputStream...\n\n") );
wxFileOutputStream file_output( file_name );
for (ch = 0; ch < 10; ch++)
file_output.Sync();
- textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading char from wxFileInputStream:\n\n") );
wxFileInputStream file_input( file_name );
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading another char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
pos = (size_t)file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Reading yet another char from wxFileInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading yet another char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
pos = (size_t)file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream...\n\n") );
+ textCtrl.WriteText( wxT("Now calling Ungetch( 5 ) from wxFileInputStream...\n\n") );
file_input.Ungetch( 5 );
pos = (size_t)file_input.TellI();
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
pos = (size_t)file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading another char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
pos = (size_t)file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream again...\n\n") );
+ textCtrl.WriteText( wxT("Now calling Ungetch( 5 ) from wxFileInputStream again...\n\n") );
file_input.Ungetch( 5 );
pos = (size_t)file_input.TellI();
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Seeking to pos 3 in wxFileInputStream. This invalidates the writeback buffer.\n\n") );
+ textCtrl.WriteText( wxT("Seeking to pos 3 in wxFileInputStream. This invalidates the writeback buffer.\n\n") );
file_input.SeekI( 3 );
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl.WriteText( _T("\nTesting Ungetch() in buffered input stream:\n\n") );
+ textCtrl.WriteText( wxT("\nTesting Ungetch() in buffered input stream:\n\n") );
char ch = 0;
wxString str;
- textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream...\n\n") );
+ textCtrl.WriteText( wxT("Writing number 0 to 9 to wxFileOutputStream...\n\n") );
wxFileOutputStream file_output( file_name );
for (ch = 0; ch < 10; ch++)
file_output.Sync();
- textCtrl.WriteText( _T("Reading char from wxBufferedInputStream via wxFileInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading char from wxBufferedInputStream via wxFileInputStream:\n\n") );
wxFileInputStream file_input( file_name );
wxBufferedInputStream buf_input( file_input );
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
pos = (size_t)buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Reading yet another char from wxBufferedInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading yet another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
pos = (size_t)buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream...\n\n") );
+ textCtrl.WriteText( wxT("Now calling Ungetch( 5 ) from wxBufferedInputStream...\n\n") );
buf_input.Ungetch( 5 );
pos = (size_t)buf_input.TellI();
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Reading char from wxBufferedInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
pos = (size_t)buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") );
+ textCtrl.WriteText( wxT("Reading another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
pos = (size_t)buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream again...\n\n") );
+ textCtrl.WriteText( wxT("Now calling Ungetch( 5 ) from wxBufferedInputStream again...\n\n") );
buf_input.Ungetch( 5 );
pos = (size_t)buf_input.TellI();
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( _T("Seeking to pos 3 in wxBufferedInputStream. This invalidates the writeback buffer.\n\n") );
+ textCtrl.WriteText( wxT("Seeking to pos 3 in wxBufferedInputStream. This invalidates the writeback buffer.\n\n") );
buf_input.SeekI( 3 );
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl << _T("\nTest wchar_t to char (Unicode to ANSI/Multibyte) converions:");
+ textCtrl << wxT("\nTest wchar_t to char (Unicode to ANSI/Multibyte) converions:");
wxString str;
- str = _T("Robert R\366bling\n");
+ str = wxT("Robert R\366bling\n");
printf( "\n\nConversion with wxConvLocal:\n" );
wxConvCurrent = &wxConvLocal;
void MyApp::DoMIMEDemo(wxCommandEvent& WXUNUSED(event))
{
- static wxString s_defaultExt = _T("xyz");
+ static wxString s_defaultExt = wxT("xyz");
- wxString ext = wxGetTextFromUser(_T("Enter a file extension: "),
- _T("MIME database test"),
+ wxString ext = wxGetTextFromUser(wxT("Enter a file extension: "),
+ wxT("MIME database test"),
s_defaultExt);
if ( !!ext )
{
static const wxFileTypeInfo fallbacks[] =
{
- wxFileTypeInfo(_T("application/xyz"),
- _T("XyZ %s"),
- _T("XyZ -p %s"),
- _T("The one and only XYZ format file"),
- _T("xyz"), _T("123"), wxNullPtr),
- wxFileTypeInfo(_T("text/html"),
- _T("lynx %s"),
- _T("lynx -dump %s | lpr"),
- _T("HTML document (from fallback)"),
- _T("htm"), _T("html"), wxNullPtr),
+ wxFileTypeInfo(wxT("application/xyz"),
+ wxT("XyZ %s"),
+ wxT("XyZ -p %s"),
+ wxT("The one and only XYZ format file"),
+ wxT("xyz"), wxT("123"), wxNullPtr),
+ wxFileTypeInfo(wxT("text/html"),
+ wxT("lynx %s"),
+ wxT("lynx -dump %s | lpr"),
+ wxT("HTML document (from fallback)"),
+ wxT("htm"), wxT("html"), wxNullPtr),
// must terminate the table with this!
wxFileTypeInfo()
wxFileType *filetype = m_mimeDatabase->GetFileTypeFromExtension(ext);
if ( !filetype )
{
- textCtrl << _T("Unknown extension '") << ext << _T("'\n");
+ textCtrl << wxT("Unknown extension '") << ext << wxT("'\n");
}
else
{
filetype->GetMimeType(&type);
filetype->GetDescription(&desc);
- wxString filename = _T("filename");
- filename << _T(".") << ext;
+ wxString filename = wxT("filename");
+ filename << wxT(".") << ext;
wxFileType::MessageParameters params(filename, type);
filetype->GetOpenCommand(&open, params);
- textCtrl << _T("MIME information about extension '") << ext << _T('\n')
- << _T("\tMIME type: ") << ( !type ? wxString("unknown") : type ) << _T('\n')
- << _T("\tDescription: ") << ( !desc ? wxString(wxEmptyString) : desc )
- << _T('\n')
- << _T("\tCommand to open: ") << ( !open ? wxString("no") : open )
- << _T('\n');
+ textCtrl << wxT("MIME information about extension '") << ext << wxT('\n')
+ << wxT("\tMIME type: ") << ( !type ? wxString("unknown") : type ) << wxT('\n')
+ << wxT("\tDescription: ") << ( !desc ? wxString(wxEmptyString) : desc )
+ << wxT('\n')
+ << wxT("\tCommand to open: ") << ( !open ? wxString("no") : open )
+ << wxT('\n');
delete filetype;
}
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl << _T("\nTest byte order macros:\n\n");
+ textCtrl << wxT("\nTest byte order macros:\n\n");
#if wxBYTE_ORDER == wxLITTLE_ENDIAN
- textCtrl << _T("This is a little endian system.\n\n");
+ textCtrl << wxT("This is a little endian system.\n\n");
#else
- textCtrl << _T("This is a big endian system.\n\n");
+ textCtrl << wxT("This is a big endian system.\n\n");
#endif
wxString text;
wxInt32 var = 0xF1F2F3F4;
text = wxEmptyString;
- text.Printf( _T("Value of wxInt32 is now: %#x.\n\n"), var );
+ text.Printf( wxT("Value of wxInt32 is now: %#x.\n\n"), var );
textCtrl.WriteText( text );
text = wxEmptyString;
- text.Printf( _T("Value of swapped wxInt32 is: %#x.\n\n"), wxINT32_SWAP_ALWAYS( var ) );
+ text.Printf( wxT("Value of swapped wxInt32 is: %#x.\n\n"), wxINT32_SWAP_ALWAYS( var ) );
textCtrl.WriteText( text );
text = wxEmptyString;
- text.Printf( _T("Value of wxInt32 swapped on little endian is: %#x.\n\n"), wxINT32_SWAP_ON_LE( var ) );
+ text.Printf( wxT("Value of wxInt32 swapped on little endian is: %#x.\n\n"), wxINT32_SWAP_ON_LE( var ) );
textCtrl.WriteText( text );
text = wxEmptyString;
- text.Printf( _T("Value of wxInt32 swapped on big endian is: %#x.\n\n"), wxINT32_SWAP_ON_BE( var ) );
+ text.Printf( wxT("Value of wxInt32 swapped on big endian is: %#x.\n\n"), wxINT32_SWAP_ON_BE( var ) );
textCtrl.WriteText( text );
}
{
wxTextCtrl& textCtrl = * GetTextCtrl();
- wxVariant var1 = _T("String value");
- textCtrl << _T("var1 = ") << var1.MakeString() << _T("\n");
+ wxVariant var1 = wxT("String value");
+ textCtrl << wxT("var1 = ") << var1.MakeString() << wxT("\n");
// Conversion
wxString str = var1.MakeString();
var1 = 123.456;
- textCtrl << _T("var1 = ") << var1.GetReal() << _T("\n");
+ textCtrl << wxT("var1 = ") << var1.GetReal() << wxT("\n");
// Implicit conversion
double v = var1;
var1 = 9876L;
- textCtrl << _T("var1 = ") << var1.GetLong() << _T("\n");
+ textCtrl << wxT("var1 = ") << var1.GetLong() << wxT("\n");
// Implicit conversion
long l = var1;
wxUnusedVar(v);
wxArrayString stringArray;
- stringArray.Add(_T("one")); stringArray.Add(_T("two")); stringArray.Add(_T("three"));
+ stringArray.Add(wxT("one")); stringArray.Add(wxT("two")); stringArray.Add(wxT("three"));
var1 = stringArray;
- textCtrl << _T("var1 = ") << var1.MakeString() << _T("\n");
+ textCtrl << wxT("var1 = ") << var1.MakeString() << wxT("\n");
var1.ClearList();
var1.Append(wxVariant(1.2345));
- var1.Append(wxVariant(_T("hello")));
+ var1.Append(wxVariant(wxT("hello")));
var1.Append(wxVariant(54321L));
- textCtrl << _T("var1 = ") << var1.MakeString() << _T("\n");
+ textCtrl << wxT("var1 = ") << var1.MakeString() << wxT("\n");
size_t n = var1.GetCount();
size_t i;
for (i = (size_t) 0; i < n; i++)
{
- textCtrl << _T("var1[") << (int) i << _T("] (type ") << var1[i].GetType() << _T(") = ") << var1[i].MakeString() << _T("\n");
+ textCtrl << wxT("var1[") << (int) i << wxT("] (type ") << var1[i].GetType() << wxT(") = ") << var1[i].MakeString() << wxT("\n");
}
var1 = wxVariant(new wxFont(wxSystemSettings::GetFont(wxSYS_OEM_FIXED_FONT)));
- textCtrl << _T("var1 = (wxfont)\"");
+ textCtrl << wxT("var1 = (wxfont)\"");
wxFont* font = wxGetVariantCast(var1,wxFont);
if (font)
{
- textCtrl << font->GetNativeFontInfoDesc() << _T("\"\n");
+ textCtrl << font->GetNativeFontInfoDesc() << wxT("\"\n");
}
else
{
- textCtrl << _T("(null)\"\n");
+ textCtrl << wxT("(null)\"\n");
}
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
{
- wxMessageDialog dialog(this, _T("Tests various wxWidgets types"),
- _T("About Types"), wxYES_NO|wxCANCEL);
+ wxMessageDialog dialog(this, wxT("Tests various wxWidgets types"),
+ wxT("About Types"), wxYES_NO|wxCANCEL);
dialog.ShowModal();
}
// Create a listbox to display the validated data.
m_listbox = new wxListBox(this, wxID_ANY);
- m_listbox->Append(wxString(_T("Try 'File|Test' to see how validators work.")));
+ m_listbox->Append(wxString(wxT("Try 'File|Test' to see how validators work.")));
wxMenu *file_menu = new wxMenu;
// automatically transferred to the variables we specified
// when we created the validators.
m_listbox->Clear();
- m_listbox->Append(wxString(_T("string: ")) + g_data.m_string);
- m_listbox->Append(wxString(_T("string #2: ")) + g_data.m_string2);
+ m_listbox->Append(wxString(wxT("string: ")) + g_data.m_string);
+ m_listbox->Append(wxString(wxT("string #2: ")) + g_data.m_string2);
for(unsigned int i = 0; i < g_data.m_listbox_choices.GetCount(); ++i)
{
int j = g_data.m_listbox_choices[i];
- m_listbox->Append(wxString(_T("listbox choice(s): ")) + g_listbox_choices[j]);
+ m_listbox->Append(wxString(wxT("listbox choice(s): ")) + g_listbox_choices[j]);
}
- wxString checkbox_state(g_data.m_checkbox_state ? _T("checked") : _T("unchecked"));
- m_listbox->Append(wxString(_T("checkbox: ")) + checkbox_state);
- m_listbox->Append(wxString(_T("combobox: ")) + g_data.m_combobox_choice);
- m_listbox->Append(wxString(_T("radiobox: ")) + g_radiobox_choices[g_data.m_radiobox_choice]);
+ wxString checkbox_state(g_data.m_checkbox_state ? wxT("checked") : wxT("unchecked"));
+ m_listbox->Append(wxString(wxT("checkbox: ")) + checkbox_state);
+ m_listbox->Append(wxString(wxT("combobox: ")) + g_data.m_combobox_choice);
+ m_listbox->Append(wxString(wxT("radiobox: ")) + g_radiobox_choices[g_data.m_radiobox_choice]);
}
}
if ( m_frameStatusBar )
{
wxSize sz = GetClientSize();
- SetStatusText(wxString::Format(_T("%dx%d"), sz.x, sz.y), 1);
+ SetStatusText(wxString::Format(wxT("%dx%d"), sz.x, sz.y), 1);
}
#endif // wxUSE_STATUSBAR
#if wxUSE_STATUSBAR
m_frame->SetStatusText(wxString::Format
(
- _T("Page size = %d, pos = %d, max = %d"),
+ wxT("Page size = %d, pos = %d, max = %d"),
GetScrollThumb(wxVERTICAL),
GetScrollPos(wxVERTICAL),
GetScrollRange(wxVERTICAL)
dc.DrawLine(0, y, clientSize.GetWidth(), y);
wxCoord hLine = OnGetRowHeight(line);
- dc.DrawText(wxString::Format(_T("Line %lu"), (unsigned long)line),
+ dc.DrawText(wxString::Format(wxT("Line %lu"), (unsigned long)line),
2, y + (hLine - hText) / 2);
y += hLine;
#if wxUSE_STATUSBAR
m_frame->SetStatusText(wxString::Format
(
- _T("Page size = %d, pos = %d, max = %d"),
+ wxT("Page size = %d, pos = %d, max = %d"),
GetScrollThumb(wxVERTICAL),
GetScrollPos(wxVERTICAL),
GetScrollRange(wxVERTICAL)
dc.DrawLine(x, 0, x, clientSize.GetHeight());
wxCoord wLine = OnGetColumnWidth(line);
- dc.DrawRotatedText(wxString::Format(_T("Line %lu"), (unsigned long)line),
+ dc.DrawRotatedText(wxString::Format(wxT("Line %lu"), (unsigned long)line),
x + (wLine - hText) / 2, clientSize.GetHeight() - 5, 90);
x += wLine;
#if wxUSE_STATUSBAR
m_frame->SetStatusText(wxString::Format
(
- _T("Page size = %d rows %d columns; pos = row: %d, column: %d; max = %d rows, %d columns"),
+ wxT("Page size = %d rows %d columns; pos = row: %d, column: %d; max = %d rows, %d columns"),
GetScrollThumb(wxVERTICAL),
GetScrollThumb(wxHORIZONTAL),
GetScrollPos(wxVERTICAL),
if ( row == rowFirst )
dc.DrawLine(x, 0, x, clientSize.GetHeight());
- dc.DrawText(wxString::Format(_T("Row %lu"), (unsigned long)row),
+ dc.DrawText(wxString::Format(wxT("Row %lu"), (unsigned long)row),
x + 2, y + rowHeight / 2 - hText);
- dc.DrawText(wxString::Format(_T("Col %lu"), (unsigned long)col),
+ dc.DrawText(wxString::Format(wxT("Col %lu"), (unsigned long)col),
x + 2, y + rowHeight / 2);
x += colWidth;
VarScrollFrame::VarScrollFrame()
: wxFrame(NULL,
wxID_ANY,
- _T("VScroll wxWidgets Sample"),
+ wxT("VScroll wxWidgets Sample"),
wxDefaultPosition,
wxSize(400, 350)),
m_scrollWindow(NULL)
// the "About" item should be in the help menu
wxMenu *menuHelp = new wxMenu;
- menuHelp->Append(VScroll_About, _T("&About...\tF1"), _T("Show about dialog"));
+ menuHelp->Append(VScroll_About, wxT("&About...\tF1"), wxT("Show about dialog"));
#ifdef wxHAS_RADIO_MENU_ITEMS
- menuMode->AppendRadioItem(VScroll_VScrollMode, _T("&Vertical\tAlt-V"),
- _T("Vertical scrolling only"));
- menuMode->AppendRadioItem(VScroll_HScrollMode, _T("&Horizontal\tAlt-H"),
- _T("Horizontal scrolling only"));
+ menuMode->AppendRadioItem(VScroll_VScrollMode, wxT("&Vertical\tAlt-V"),
+ wxT("Vertical scrolling only"));
+ menuMode->AppendRadioItem(VScroll_HScrollMode, wxT("&Horizontal\tAlt-H"),
+ wxT("Horizontal scrolling only"));
menuMode->AppendRadioItem(VScroll_HVScrollMode,
- _T("Hori&zontal/Vertical\tAlt-Z"),
- _T("Horizontal and vertical scrolling"));
+ wxT("Hori&zontal/Vertical\tAlt-Z"),
+ wxT("Horizontal and vertical scrolling"));
menuMode->Check(VScroll_VScrollMode, true);
#else
- menuMode->Append(VScroll_VScrollMode, _T("&Vertical\tAlt-V"),
- _T("Vertical scrolling only"));
- menuMode->Append(VScroll_HScrollMode, _T("&Horizontal\tAlt-H"),
- _T("Horizontal scrolling only"));
- menuMode->Append(VScroll_HVScrollMode, _T("Hori&zontal/Vertical\tAlt-Z"),
- _T("Horizontal and vertical scrolling"));
+ menuMode->Append(VScroll_VScrollMode, wxT("&Vertical\tAlt-V"),
+ wxT("Vertical scrolling only"));
+ menuMode->Append(VScroll_HScrollMode, wxT("&Horizontal\tAlt-H"),
+ wxT("Horizontal scrolling only"));
+ menuMode->Append(VScroll_HVScrollMode, wxT("Hori&zontal/Vertical\tAlt-Z"),
+ wxT("Horizontal and vertical scrolling"));
#endif
- menuFile->Append(VScroll_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(VScroll_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(menuMode, _T("&Mode"));
- menuBar->Append(menuHelp, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(menuMode, wxT("&Mode"));
+ menuBar->Append(menuHelp, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText(_T("Welcome to wxWidgets!"));
+ SetStatusText(wxT("Welcome to wxWidgets!"));
int widths[2];
widths[0] = -1;
widths[1] = 100;
void VarScrollFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("VScroll shows how to implement scrolling with\n")
- _T("variable line widths and heights.\n")
- _T("(c) 2003 Vadim Zeitlin"),
- _T("About VScroll"),
+ wxMessageBox(wxT("VScroll shows how to implement scrolling with\n")
+ wxT("variable line widths and heights.\n")
+ wxT("(c) 2003 Vadim Zeitlin"),
+ wxT("About VScroll"),
wxOK | wxICON_INFORMATION,
this);
}
#define NATIVE_OR_GENERIC_CTRLS GENERIC_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(BitmapComboBoxWidgetsPage, _T("BitmapCombobox"),
+IMPLEMENT_WIDGETS_PAGE(BitmapComboBoxWidgetsPage, wxT("BitmapCombobox"),
NATIVE_OR_GENERIC_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS
);
wxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL);
// left pane - style box
- wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
+ wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
// should be in sync with ComboKind_XXX values
static const wxString kinds[] =
{
- _T("default"),
- _T("simple"),
- _T("drop down"),
+ wxT("default"),
+ wxT("simple"),
+ wxT("drop down"),
};
- m_radioKind = new wxRadioBox(this, wxID_ANY, _T("Combobox &kind:"),
+ m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Combobox &kind:"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(kinds), kinds,
1, wxRA_SPECIFY_COLS);
wxSizer *sizerStyle = new wxStaticBoxSizer(box, wxVERTICAL);
- m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, _T("&Sort items"));
- m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, _T("&Read only"));
+ m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Sort items"));
+ m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Read only"));
- wxButton *btn = new wxButton(this, BitmapComboBoxPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, BitmapComboBoxPage_Reset, wxT("&Reset"));
sizerStyle->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 3);
sizerLeft->Add(sizerStyle, 0, wxGROW | wxALIGN_CENTRE_HORIZONTAL);
sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5);
// left pane - other options box
- box = new wxStaticBox(this, wxID_ANY, _T("Demo options"));
+ box = new wxStaticBox(this, wxID_ANY, wxT("Demo options"));
wxSizer *sizerOptions = new wxStaticBoxSizer(box, wxVERTICAL);
- sizerRow = CreateSizerWithSmallTextAndLabel(_T("Control &height:"),
+ sizerRow = CreateSizerWithSmallTextAndLabel(wxT("Control &height:"),
BitmapComboBoxPage_ChangeHeight,
&m_textChangeHeight);
m_textChangeHeight->SetSize(20, wxDefaultCoord);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
- _T("&Change wxBitmapComboBox contents"));
+ wxT("&Change wxBitmapComboBox contents"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
- btn = new wxButton(this, BitmapComboBoxPage_ContainerTests, _T("Run &tests"));
+ btn = new wxButton(this, BitmapComboBoxPage_ContainerTests, wxT("Run &tests"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
#if wxUSE_IMAGE
- btn = new wxButton(this, BitmapComboBoxPage_AddWidgetIcons, _T("Add &widget icons"));
+ btn = new wxButton(this, BitmapComboBoxPage_AddWidgetIcons, wxT("Add &widget icons"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, BitmapComboBoxPage_LoadFromFile, _T("Insert image from &file"));
+ btn = new wxButton(this, BitmapComboBoxPage_LoadFromFile, wxT("Insert image from &file"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, BitmapComboBoxPage_SetFromFile, _T("&Set image from file"));
+ btn = new wxButton(this, BitmapComboBoxPage_SetFromFile, wxT("&Set image from file"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
#endif
- btn = new wxButton(this, BitmapComboBoxPage_AddSeveralWithImages, _T("A&ppend a few strings with images"));
+ btn = new wxButton(this, BitmapComboBoxPage_AddSeveralWithImages, wxT("A&ppend a few strings with images"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, BitmapComboBoxPage_AddSeveral, _T("Append a &few strings"));
+ btn = new wxButton(this, BitmapComboBoxPage_AddSeveral, wxT("Append a &few strings"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, BitmapComboBoxPage_AddMany, _T("Append &many strings"));
+ btn = new wxButton(this, BitmapComboBoxPage_AddMany, wxT("Append &many strings"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(BitmapComboBoxPage_Delete,
- _T("&Delete this item"),
+ wxT("&Delete this item"),
BitmapComboBoxPage_DeleteText,
&m_textDelete);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, BitmapComboBoxPage_DeleteSel, _T("Delete &selection"));
+ btn = new wxButton(this, BitmapComboBoxPage_DeleteSel, wxT("Delete &selection"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, BitmapComboBoxPage_Clear, _T("&Clear"));
+ btn = new wxButton(this, BitmapComboBoxPage_Clear, wxT("&Clear"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
#if wxUSE_IMAGE
switch ( m_radioKind->GetSelection() )
{
default:
- wxFAIL_MSG( _T("unknown combo kind") );
+ wxFAIL_MSG( wxT("unknown combo kind") );
// fall through
case ComboKind_Default:
#ifndef __WXGTK__
m_combobox->SetString(sel, m_textChange->GetValue());
#else
- wxLogMessage(_T("Not implemented in wxGTK"));
+ wxLogMessage(wxT("Not implemented in wxGTK"));
#endif
}
}
if ( !m_textInsert->IsModified() )
{
// update the default string
- m_textInsert->SetValue(wxString::Format(_T("test item %u"), ++s_item));
+ m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
}
int sel = m_combobox->GetSelection();
// "many" means 1000 here
for ( unsigned int n = 0; n < 1000; n++ )
{
- m_combobox->Append(wxString::Format(_T("item #%u"), n));
+ m_combobox->Append(wxString::Format(wxT("item #%u"), n));
}
}
void BitmapComboBoxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event))
{
- m_combobox->Append(_T("First"));
- m_combobox->Append(_T("another one"));
- m_combobox->Append(_T("and the last (very very very very very very very very very very long) one"));
+ m_combobox->Append(wxT("First"));
+ m_combobox->Append(wxT("another one"));
+ m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one"));
}
void BitmapComboBoxWidgetsPage::OnButtonAddSeveralWithImages(wxCommandEvent& WXUNUSED(event))
wxString s = event.GetString();
wxASSERT_MSG( s == m_combobox->GetValue(),
- _T("event and combobox values should be the same") );
+ wxT("event and combobox values should be the same") );
if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER)
{
- wxLogMessage(_T("BitmapCombobox enter pressed (now '%s')"), s.c_str());
+ wxLogMessage(wxT("BitmapCombobox enter pressed (now '%s')"), s.c_str());
}
else
{
- wxLogMessage(_T("BitmapCombobox text changed (now '%s')"), s.c_str());
+ wxLogMessage(wxT("BitmapCombobox text changed (now '%s')"), s.c_str());
}
}
void BitmapComboBoxWidgetsPage::OnComboBox(wxCommandEvent& event)
{
long sel = event.GetInt();
- m_textDelete->SetValue(wxString::Format(_T("%ld"), sel));
+ m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel));
- wxLogMessage(_T("BitmapCombobox item %ld selected"), sel);
+ wxLogMessage(wxT("BitmapCombobox item %ld selected"), sel);
- wxLogMessage(_T("BitmapCombobox GetValue(): %s"), m_combobox->GetValue().c_str() );
+ wxLogMessage(wxT("BitmapCombobox GetValue(): %s"), m_combobox->GetValue().c_str() );
}
void BitmapComboBoxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
void BitmapComboBoxWidgetsPage::OnDropDown(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("Combobox dropped down"));
+ wxLogMessage(wxT("Combobox dropped down"));
}
void BitmapComboBoxWidgetsPage::OnCloseUp(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("Combobox closed up"));
+ wxLogMessage(wxT("Combobox closed up"));
}
#endif // wxUSE_BITMAPCOMBOBOX
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, _T("Button"), FAMILY_CTRLS );
+IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, wxT("Button"), FAMILY_CTRLS );
ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
- wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
+ wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
m_chkBitmapOnly = CreateCheckBoxAndAddToSizer(sizerLeft, "&Bitmap only");
m_chkTextAndBitmap = CreateCheckBoxAndAddToSizer(sizerLeft, "Text &and &bitmap");
- m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Fit exactly"));
- m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Default"));
+ m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Fit exactly"));
+ m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Default"));
sizerLeft->AddSpacer(5);
// should be in sync with enums Button[HV]Align!
static const wxString halign[] =
{
- _T("left"),
- _T("centre"),
- _T("right"),
+ wxT("left"),
+ wxT("centre"),
+ wxT("right"),
};
static const wxString valign[] =
{
- _T("top"),
- _T("centre"),
- _T("bottom"),
+ wxT("top"),
+ wxT("centre"),
+ wxT("bottom"),
};
- m_radioHAlign = new wxRadioBox(this, wxID_ANY, _T("&Horz alignment"),
+ m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(halign), halign);
- m_radioVAlign = new wxRadioBox(this, wxID_ANY, _T("&Vert alignment"),
+ m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(valign), valign);
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
- wxButton *btn = new wxButton(this, ButtonPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, ButtonPage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
- wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Operations"));
+ wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow = CreateSizerWithTextAndButton(ButtonPage_ChangeLabel,
- _T("Change label"),
+ wxT("Change label"),
wxID_ANY,
&m_textLabel);
- m_textLabel->SetValue(_T("&Press me!"));
+ m_textLabel->SetValue(wxT("&Press me!"));
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
break;
default:
- wxFAIL_MSG(_T("unexpected radiobox selection"));
+ wxFAIL_MSG(wxT("unexpected radiobox selection"));
// fall through
case ButtonHAlign_Centre:
break;
default:
- wxFAIL_MSG(_T("unexpected radiobox selection"));
+ wxFAIL_MSG(wxT("unexpected radiobox selection"));
// fall through
case ButtonVAlign_Centre:
showsBitmap = true;
wxBitmapButton *bbtn = new wxBitmapButton(this, ButtonPage_Button,
- CreateBitmap(_T("normal")));
+ CreateBitmap(wxT("normal")));
if ( m_chkUsePressed->GetValue() )
- bbtn->SetBitmapPressed(CreateBitmap(_T("pushed")));
+ bbtn->SetBitmapPressed(CreateBitmap(wxT("pushed")));
if ( m_chkUseFocused->GetValue() )
- bbtn->SetBitmapFocus(CreateBitmap(_T("focused")));
+ bbtn->SetBitmapFocus(CreateBitmap(wxT("focused")));
if ( m_chkUseCurrent->GetValue() )
- bbtn->SetBitmapCurrent(CreateBitmap(_T("hover")));
+ bbtn->SetBitmapCurrent(CreateBitmap(wxT("hover")));
if ( m_chkUseDisabled->GetValue() )
- bbtn->SetBitmapDisabled(CreateBitmap(_T("disabled")));
+ bbtn->SetBitmapDisabled(CreateBitmap(wxT("disabled")));
m_button = bbtn;
}
else // normal button
void ButtonWidgetsPage::OnButton(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("Test button clicked."));
+ wxLogMessage(wxT("Test button clicked."));
}
// ----------------------------------------------------------------------------
dc.SetBackground(wxBrush(*wxCYAN));
dc.Clear();
dc.SetTextForeground(*wxBLACK);
- dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + _T("\n")
- _T("(") + label + _T(" state)"),
+ dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n")
+ wxT("(") + label + wxT(" state)"),
wxArtProvider::GetBitmap(wxART_INFORMATION),
wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20),
wxALIGN_CENTRE);
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
- wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
+ wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
m_chkRight = CreateCheckBoxAndAddToSizer
(
sizerLeft,
- _T("&Right aligned"),
+ wxT("&Right aligned"),
CheckboxPage_ChkRight
);
static const wxString kinds[] =
{
- _T("usual &2-state checkbox"),
- _T("&3rd state settable by program"),
- _T("&user-settable 3rd state"),
+ wxT("usual &2-state checkbox"),
+ wxT("&3rd state settable by program"),
+ wxT("&user-settable 3rd state"),
};
- m_radioKind = new wxRadioBox(this, wxID_ANY, _T("&Kind"),
+ m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("&Kind"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(kinds), kinds,
1);
sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5);
- wxButton *btn = new wxButton(this, CheckboxPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, CheckboxPage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
- wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Operations"));
+ wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
sizerMiddle->Add(CreateSizerWithTextAndButton(CheckboxPage_ChangeLabel,
- _T("Change label"),
+ wxT("Change label"),
wxID_ANY,
&m_textLabel),
0, wxALL | wxGROW, 5);
- sizerMiddle->Add(new wxButton(this, CheckboxPage_Check, _T("&Check it")),
+ sizerMiddle->Add(new wxButton(this, CheckboxPage_Check, wxT("&Check it")),
0, wxALL | wxGROW, 5);
- sizerMiddle->Add(new wxButton(this, CheckboxPage_Uncheck, _T("&Uncheck it")),
+ sizerMiddle->Add(new wxButton(this, CheckboxPage_Uncheck, wxT("&Uncheck it")),
0, wxALL | wxGROW, 5);
sizerMiddle->Add(new wxButton(this, CheckboxPage_PartCheck,
- _T("Put in &3rd state")),
+ wxT("Put in &3rd state")),
0, wxALL | wxGROW, 5);
// right pane
wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL);
- m_checkbox = new wxCheckBox(this, CheckboxPage_Checkbox, _T("&Check me!"));
+ m_checkbox = new wxCheckBox(this, CheckboxPage_Checkbox, wxT("&Check me!"));
sizerRight->Add(0, 0, 1, wxCENTRE);
sizerRight->Add(m_checkbox, 1, wxCENTRE);
sizerRight->Add(0, 0, 1, wxCENTRE);
switch ( m_radioKind->GetSelection() )
{
default:
- wxFAIL_MSG(_T("unexpected radiobox selection"));
+ wxFAIL_MSG(wxT("unexpected radiobox selection"));
// fall through
case CheckboxKind_2State:
void CheckBoxWidgetsPage::OnCheckBox(wxCommandEvent& event)
{
- wxLogMessage(_T("Test checkbox %schecked (value = %d)."),
- event.IsChecked() ? _T("") : _T("un"),
+ wxLogMessage(wxT("Test checkbox %schecked (value = %d)."),
+ event.IsChecked() ? wxT("") : wxT("un"),
(int)m_checkbox->Get3StateValue());
}
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, _T("Choice"),
+IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, wxT("Choice"),
FAMILY_CTRLS | WITH_ITEMS_CTRLS
);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY,
- _T("&Set choice parameters"));
+ wxT("&Set choice parameters"));
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
static const wxString modes[] =
{
- _T("single"),
- _T("extended"),
- _T("multiple"),
+ wxT("single"),
+ wxT("extended"),
+ wxT("multiple"),
};
- m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Sort items"));
+ m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items"));
- wxButton *btn = new wxButton(this, ChoicePage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, ChoicePage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
- _T("&Change choice contents"));
+ wxT("&Change choice contents"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
- btn = new wxButton(this, ChoicePage_Add, _T("&Add this string"));
- m_textAdd = new wxTextCtrl(this, ChoicePage_AddText, _T("test item 0"));
+ btn = new wxButton(this, ChoicePage_Add, wxT("&Add this string"));
+ m_textAdd = new wxTextCtrl(this, ChoicePage_AddText, wxT("test item 0"));
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textAdd, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ChoicePage_AddSeveral, _T("&Insert a few strings"));
+ btn = new wxButton(this, ChoicePage_AddSeveral, wxT("&Insert a few strings"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ChoicePage_AddMany, _T("Add &many strings"));
+ btn = new wxButton(this, ChoicePage_AddMany, wxT("Add &many strings"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
- btn = new wxButton(this, ChoicePage_Change, _T("C&hange current"));
+ btn = new wxButton(this, ChoicePage_Change, wxT("C&hange current"));
m_textChange = new wxTextCtrl(this, ChoicePage_ChangeText, wxEmptyString);
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textChange, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
- btn = new wxButton(this, ChoicePage_Delete, _T("&Delete this item"));
+ btn = new wxButton(this, ChoicePage_Delete, wxT("&Delete this item"));
m_textDelete = new wxTextCtrl(this, ChoicePage_DeleteText, wxEmptyString);
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textDelete, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ChoicePage_DeleteSel, _T("Delete &selection"));
+ btn = new wxButton(this, ChoicePage_DeleteSel, wxT("Delete &selection"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ChoicePage_Clear, _T("&Clear"));
+ btn = new wxButton(this, ChoicePage_Clear, wxT("&Clear"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ChoicePage_ContainerTests, _T("Run &tests"));
+ btn = new wxButton(this, ChoicePage_ContainerTests, wxT("Run &tests"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
// right pane
if ( !m_textAdd->IsModified() )
{
// update the default string
- m_textAdd->SetValue(wxString::Format(_T("test item %u"), ++s_item));
+ m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
}
m_choice->Append(s);
wxArrayString strings;
for ( unsigned int n = 0; n < 1000; n++ )
{
- strings.Add(wxString::Format(_T("item #%u"), n));
+ strings.Add(wxString::Format(wxT("item #%u"), n));
}
m_choice->Append(strings);
}
void ChoiceWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event))
{
wxArrayString items;
- items.Add(_T("First"));
- items.Add(_T("another one"));
- items.Add(_T("and the last (very very very very very very very very very very long) one"));
+ items.Add(wxT("First"));
+ items.Add(wxT("another one"));
+ items.Add(wxT("and the last (very very very very very very very very very very long) one"));
m_choice->Insert(items, 0);
}
void ChoiceWidgetsPage::OnChoice(wxCommandEvent& event)
{
long sel = event.GetSelection();
- m_textDelete->SetValue(wxString::Format(_T("%ld"), sel));
+ m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel));
- wxLogMessage(_T("Choice item %ld selected"), sel);
+ wxLogMessage(wxT("Choice item %ld selected"), sel);
}
void ChoiceWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(ColourPickerWidgetsPage, _T("ColourPicker"),
+IMPLEMENT_WIDGETS_PAGE(ColourPickerWidgetsPage, wxT("ColourPicker"),
PICKER_CTRLS | FAMILY_CTRLS);
ColourPickerWidgetsPage::ColourPickerWidgetsPage(WidgetsBookCtrl *book,
// left pane
wxSizer *boxleft = new wxBoxSizer(wxVERTICAL);
- wxStaticBoxSizer *clrbox = new wxStaticBoxSizer(wxVERTICAL, this, _T("&ColourPicker style"));
- m_chkColourTextCtrl = CreateCheckBoxAndAddToSizer(clrbox, _T("With textctrl"), false);
- m_chkColourShowLabel = CreateCheckBoxAndAddToSizer(clrbox, _T("With label"), false);
+ wxStaticBoxSizer *clrbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&ColourPicker style"));
+ m_chkColourTextCtrl = CreateCheckBoxAndAddToSizer(clrbox, wxT("With textctrl"), false);
+ m_chkColourShowLabel = CreateCheckBoxAndAddToSizer(clrbox, wxT("With label"), false);
boxleft->Add(clrbox, 0, wxALL|wxGROW, 5);
- boxleft->Add(new wxButton(this, PickerPage_Reset, _T("&Reset")),
+ boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")),
0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
Reset(); // set checkboxes state
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, _T("Combobox"),
+IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, wxT("Combobox"),
FAMILY_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS
);
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
- wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
+ wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
// should be in sync with ComboKind_XXX values
static const wxString kinds[] =
{
- _T("default"),
- _T("simple"),
- _T("drop down"),
+ wxT("default"),
+ wxT("simple"),
+ wxT("drop down"),
};
- m_radioKind = new wxRadioBox(this, wxID_ANY, _T("Combobox &kind:"),
+ m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Combobox &kind:"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(kinds), kinds,
1, wxRA_SPECIFY_COLS);
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
- m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Sort items"));
- m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Read only"));
- m_chkFilename = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&File name"));
+ m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items"));
+ m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Read only"));
+ m_chkFilename = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&File name"));
m_chkFilename->Disable(); // not implemented yet
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5);
- wxButton *btn = new wxButton(this, ComboPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, ComboPage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
- _T("&Change combobox contents"));
+ wxT("&Change combobox contents"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow;
sizerRow = CreateSizerWithTextAndButton(ComboPage_SetCurrent,
- _T("Current &selection"),
+ wxT("Current &selection"),
ComboPage_CurText,
&m_textCur);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
wxTextCtrl *text;
- sizerRow = CreateSizerWithTextAndLabel(_T("Insertion Point"),
+ sizerRow = CreateSizerWithTextAndLabel(wxT("Insertion Point"),
ComboPage_InsertionPointText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ComboPage_Insert,
- _T("&Insert this string"),
+ wxT("&Insert this string"),
ComboPage_InsertText,
&m_textInsert);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ComboPage_Add,
- _T("&Add this string"),
+ wxT("&Add this string"),
ComboPage_AddText,
&m_textAdd);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ComboPage_AddSeveral, _T("&Append a few strings"));
+ btn = new wxButton(this, ComboPage_AddSeveral, wxT("&Append a few strings"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ComboPage_AddMany, _T("Append &many strings"));
+ btn = new wxButton(this, ComboPage_AddMany, wxT("Append &many strings"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ComboPage_Change,
- _T("C&hange current"),
+ wxT("C&hange current"),
ComboPage_ChangeText,
&m_textChange);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ComboPage_Delete,
- _T("&Delete this item"),
+ wxT("&Delete this item"),
ComboPage_DeleteText,
&m_textDelete);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ComboPage_DeleteSel, _T("Delete &selection"));
+ btn = new wxButton(this, ComboPage_DeleteSel, wxT("Delete &selection"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ComboPage_Clear, _T("&Clear"));
+ btn = new wxButton(this, ComboPage_Clear, wxT("&Clear"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ComboPage_SetValue,
- _T("SetValue"),
+ wxT("SetValue"),
ComboPage_SetValueText,
&m_textSetValue);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ComboPage_ContainerTests, _T("Run &tests"));
+ btn = new wxButton(this, ComboPage_ContainerTests, wxT("Run &tests"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
switch ( m_radioKind->GetSelection() )
{
default:
- wxFAIL_MSG( _T("unknown combo kind") );
+ wxFAIL_MSG( wxT("unknown combo kind") );
// fall through
case ComboKind_Default:
#ifndef __WXGTK__
m_combobox->SetString(sel, m_textChange->GetValue());
#else
- wxLogMessage(_T("Not implemented in wxGTK"));
+ wxLogMessage(wxT("Not implemented in wxGTK"));
#endif
}
}
if ( !m_textInsert->IsModified() )
{
// update the default string
- m_textInsert->SetValue(wxString::Format(_T("test item %u"), ++s_item));
+ m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
}
if (m_combobox->GetSelection() >= 0)
if ( !m_textAdd->IsModified() )
{
// update the default string
- m_textAdd->SetValue(wxString::Format(_T("test item %u"), ++s_item));
+ m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
}
m_combobox->Append(s);
// "many" means 1000 here
for ( unsigned int n = 0; n < 1000; n++ )
{
- m_combobox->Append(wxString::Format(_T("item #%u"), n));
+ m_combobox->Append(wxString::Format(wxT("item #%u"), n));
}
}
void ComboboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event))
{
- m_combobox->Append(_T("First"));
- m_combobox->Append(_T("another one"));
- m_combobox->Append(_T("and the last (very very very very very very very very very very long) one"));
+ m_combobox->Append(wxT("First"));
+ m_combobox->Append(wxT("another one"));
+ m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one"));
}
void ComboboxWidgetsPage::OnUpdateUIInsertionPointText(wxUpdateUIEvent& event)
{
if (m_combobox)
- event.SetText( wxString::Format(_T("%ld"), m_combobox->GetInsertionPoint()) );
+ event.SetText( wxString::Format(wxT("%ld"), m_combobox->GetInsertionPoint()) );
}
void ComboboxWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event)
wxString s = event.GetString();
wxASSERT_MSG( s == m_combobox->GetValue(),
- _T("event and combobox values should be the same") );
+ wxT("event and combobox values should be the same") );
if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER)
{
- wxLogMessage(_T("Combobox enter pressed (now '%s')"), s.c_str());
+ wxLogMessage(wxT("Combobox enter pressed (now '%s')"), s.c_str());
}
else
{
- wxLogMessage(_T("Combobox text changed (now '%s')"), s.c_str());
+ wxLogMessage(wxT("Combobox text changed (now '%s')"), s.c_str());
}
}
void ComboboxWidgetsPage::OnComboBox(wxCommandEvent& event)
{
long sel = event.GetInt();
- const wxString selstr = wxString::Format(_T("%ld"), sel);
+ const wxString selstr = wxString::Format(wxT("%ld"), sel);
m_textDelete->SetValue(selstr);
m_textCur->SetValue(selstr);
- wxLogMessage(_T("Combobox item %ld selected"), sel);
+ wxLogMessage(wxT("Combobox item %ld selected"), sel);
- wxLogMessage(_T("Combobox GetValue(): %s"), m_combobox->GetValue().c_str() );
+ wxLogMessage(wxT("Combobox GetValue(): %s"), m_combobox->GetValue().c_str() );
}
void ComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
void ComboboxWidgetsPage::OnDropdown(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("Combobox dropped down"));
+ wxLogMessage(wxT("Combobox dropped down"));
}
void ComboboxWidgetsPage::OnCloseup(wxCommandEvent& WXUNUSED(event))
{
- wxLogMessage(_T("Combobox closed up"));
+ wxLogMessage(wxT("Combobox closed up"));
}
#endif //wxUSE_COMBOBOX
const wxDateTime today = wxDateTime::Today();
m_datePicker->SetValue(today);
- m_day->SetValue(wxString::Format(_T("%d"), today.GetDay()));
- m_month->SetValue(wxString::Format(_T("%d"), today.GetMonth()));
- m_year->SetValue(wxString::Format(_T("%d"), today.GetYear()));
+ m_day->SetValue(wxString::Format(wxT("%d"), today.GetDay()));
+ m_month->SetValue(wxString::Format(wxT("%d"), today.GetMonth()));
+ m_year->SetValue(wxString::Format(wxT("%d"), today.GetYear()));
}
void DatePickerWidgetsPage::CreateDatePicker()
}
else
{
- wxLogError(_T("Date is invalid"));
+ wxLogError(wxT("Date is invalid"));
}
}
else
{
- wxLogError(_T("One of inputs is not number"));
+ wxLogError(wxT("One of inputs is not number"));
}
}
static const wxString stdPaths[] =
{
- _T("&none"),
- _T("&config"),
- _T("&data"),
- _T("&documents"),
- _T("&local data"),
- _T("&plugins"),
- _T("&resources"),
- _T("&user config"),
- _T("&user data"),
- _T("&user local data")
+ wxT("&none"),
+ wxT("&config"),
+ wxT("&data"),
+ wxT("&documents"),
+ wxT("&local data"),
+ wxT("&plugins"),
+ wxT("&resources"),
+ wxT("&user config"),
+ wxT("&user data"),
+ wxT("&user local data")
};
enum
0, wxALL | wxALIGN_RIGHT , 5 );
wxSizer *sizerUseFlags =
- new wxStaticBoxSizer(wxVERTICAL, this, _T("&Flags"));
- m_chkDirOnly = CreateCheckBoxAndAddToSizer(sizerUseFlags, _T("wxDIRCTRL_DIR_ONLY"));
- m_chk3D = CreateCheckBoxAndAddToSizer(sizerUseFlags, _T("wxDIRCTRL_3D_INTERNAL"));
- m_chkFirst = CreateCheckBoxAndAddToSizer(sizerUseFlags, _T("wxDIRCTRL_SELECT_FIRST"));
- m_chkLabels = CreateCheckBoxAndAddToSizer(sizerUseFlags, _T("wxDIRCTRL_EDIT_LABELS"));
- m_chkMulti = CreateCheckBoxAndAddToSizer(sizerUseFlags, _T("wxDIRCTRL_MULTIPLE"));
+ new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Flags"));
+ m_chkDirOnly = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_DIR_ONLY"));
+ m_chk3D = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_3D_INTERNAL"));
+ m_chkFirst = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_SELECT_FIRST"));
+ m_chkLabels = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_EDIT_LABELS"));
+ m_chkMulti = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_MULTIPLE"));
sizerLeft->Add(sizerUseFlags, wxSizerFlags().Expand().Border());
wxSizer *sizerFilters =
- new wxStaticBoxSizer(wxVERTICAL, this, _T("&Filters"));
+ new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Filters"));
m_fltr[0] = CreateCheckBoxAndAddToSizer(sizerFilters, wxString::Format(wxT("all files (%s)|%s"),
wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr));
m_fltr[1] = CreateCheckBoxAndAddToSizer(sizerFilters, wxT("C++ files (*.cpp; *.h)|*.cpp;*.h"));
m_fltr[2] = CreateCheckBoxAndAddToSizer(sizerFilters, wxT("PNG images (*.png)|*.png"));
sizerLeft->Add(sizerFilters, wxSizerFlags().Expand().Border());
- wxButton *btn = new wxButton(this, DirCtrlPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, DirCtrlPage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// keep consistency between enum and labels of radiobox
wxCOMPILE_TIME_ASSERT( stdPathMax == WXSIZEOF(stdPaths), EnumForRadioBoxMismatch);
// middle pane
- m_radioStdPath = new wxRadioBox(this, wxID_ANY, _T("Standard path"),
+ m_radioStdPath = new wxRadioBox(this, wxID_ANY, wxT("Standard path"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(stdPaths), stdPaths, 1);
{
wxString path;
- wxTheApp->SetAppName(_T("widgets"));
+ wxTheApp->SetAppName(wxT("widgets"));
wxStandardPathsBase& stdp = wxStandardPaths::Get();
switch ( m_radioStdPath->GetSelection() )
m_dirCtrl->SetPath(path);
if(!m_dirCtrl->GetPath().IsSameAs(path))
{
- wxLogMessage(_T("Selected standard path and path from control do not match!"));
+ wxLogMessage(wxT("Selected standard path and path from control do not match!"));
m_radioStdPath->SetSelection(stdPathUnknown);
}
}
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(DirPickerWidgetsPage, _T("DirPicker"),
+IMPLEMENT_WIDGETS_PAGE(DirPickerWidgetsPage, wxT("DirPicker"),
PICKER_CTRLS | FAMILY_CTRLS);
DirPickerWidgetsPage::DirPickerWidgetsPage(WidgetsBookCtrl *book,
// left pane
wxSizer *boxleft = new wxBoxSizer(wxVERTICAL);
- wxStaticBoxSizer *dirbox = new wxStaticBoxSizer(wxVERTICAL, this, _T("&DirPicker style"));
- m_chkDirTextCtrl = CreateCheckBoxAndAddToSizer(dirbox, _T("With textctrl"), false);
- m_chkDirMustExist = CreateCheckBoxAndAddToSizer(dirbox, _T("Dir must exist"), false);
- m_chkDirChangeDir = CreateCheckBoxAndAddToSizer(dirbox, _T("Change working dir"), false);
+ wxStaticBoxSizer *dirbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&DirPicker style"));
+ m_chkDirTextCtrl = CreateCheckBoxAndAddToSizer(dirbox, wxT("With textctrl"), false);
+ m_chkDirMustExist = CreateCheckBoxAndAddToSizer(dirbox, wxT("Dir must exist"), false);
+ m_chkDirChangeDir = CreateCheckBoxAndAddToSizer(dirbox, wxT("Change working dir"), false);
boxleft->Add(dirbox, 0, wxALL|wxGROW, 5);
- boxleft->Add(new wxButton(this, PickerPage_Reset, _T("&Reset")),
+ boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")),
0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
Reset(); // set checkboxes state
// implementation
// ============================================================================
-IMPLEMENT_WIDGETS_PAGE(EditableListboxWidgetsPage, _T("EditableListbox"), GENERIC_CTRLS);
+IMPLEMENT_WIDGETS_PAGE(EditableListboxWidgetsPage, wxT("EditableListbox"), GENERIC_CTRLS);
EditableListboxWidgetsPage::EditableListboxWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY,
- _T("&Set listbox parameters"));
+ wxT("&Set listbox parameters"));
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
- m_chkAllowNew = CreateCheckBoxAndAddToSizer(sizerLeft, _T("Allow new items"));
- m_chkAllowEdit = CreateCheckBoxAndAddToSizer(sizerLeft, _T("Allow editing items"));
- m_chkAllowDelete = CreateCheckBoxAndAddToSizer(sizerLeft, _T("Allow deleting items"));
- m_chkAllowNoReorder = CreateCheckBoxAndAddToSizer(sizerLeft, _T("Block user reordering"));
+ m_chkAllowNew = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow new items"));
+ m_chkAllowEdit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow editing items"));
+ m_chkAllowDelete = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow deleting items"));
+ m_chkAllowNoReorder = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Block user reordering"));
- wxButton *btn = new wxButton(this, EditableListboxPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, EditableListboxPage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// right pane
0, wxALL | wxEXPAND , 5 );
wxSizer *sizerUseFlags =
- new wxStaticBoxSizer( wxVERTICAL, this, _T( "&Flags" ) );
+ new wxStaticBoxSizer( wxVERTICAL, this, wxT( "&Flags" ) );
- m_chkMultiple = CreateCheckBoxAndAddToSizer( sizerUseFlags, _T( "wxFC_MULTIPLE" ) );
- m_chkNoShowHidden = CreateCheckBoxAndAddToSizer( sizerUseFlags, _T( "wxFC_NOSHOWHIDDEN" ) );
+ m_chkMultiple = CreateCheckBoxAndAddToSizer( sizerUseFlags, wxT( "wxFC_MULTIPLE" ) );
+ m_chkNoShowHidden = CreateCheckBoxAndAddToSizer( sizerUseFlags, wxT( "wxFC_NOSHOWHIDDEN" ) );
sizerLeft->Add( sizerUseFlags, wxSizerFlags().Expand().Border() );
wxSizer *sizerFilters =
- new wxStaticBoxSizer( wxVERTICAL, this, _T( "&Filters" ) );
+ new wxStaticBoxSizer( wxVERTICAL, this, wxT( "&Filters" ) );
m_fltr[0] = CreateCheckBoxAndAddToSizer( sizerFilters, wxString::Format( wxT( "all files (%s)|%s" ),
wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr ) );
m_fltr[1] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "C++ files (*.cpp; *.h)|*.cpp;*.h" ) );
m_fltr[2] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "PNG images (*.png)|*.png" ) );
sizerLeft->Add( sizerFilters, wxSizerFlags().Expand().Border() );
- wxButton *btn = new wxButton( this, FileCtrlPage_Reset, _T( "&Reset" ) );
+ wxButton *btn = new wxButton( this, FileCtrlPage_Reset, wxT( "&Reset" ) );
sizerLeft->Add( btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15 );
// right pane
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(FilePickerWidgetsPage, _T("FilePicker"),
+IMPLEMENT_WIDGETS_PAGE(FilePickerWidgetsPage, wxT("FilePicker"),
PICKER_CTRLS | FAMILY_CTRLS);
FilePickerWidgetsPage::FilePickerWidgetsPage(WidgetsBookCtrl *book,
// left pane
wxSizer *boxleft = new wxBoxSizer(wxVERTICAL);
- static const wxString mode[] = { _T("open"), _T("save") };
- m_radioFilePickerMode = new wxRadioBox(this, wxID_ANY, _T("wxFilePicker mode"),
+ static const wxString mode[] = { wxT("open"), wxT("save") };
+ m_radioFilePickerMode = new wxRadioBox(this, wxID_ANY, wxT("wxFilePicker mode"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(mode), mode);
boxleft->Add(m_radioFilePickerMode, 0, wxALL|wxGROW, 5);
- wxStaticBoxSizer *filebox = new wxStaticBoxSizer(wxVERTICAL, this, _T("&FilePicker style"));
- m_chkFileTextCtrl = CreateCheckBoxAndAddToSizer(filebox, _T("With textctrl"), false);
- m_chkFileOverwritePrompt = CreateCheckBoxAndAddToSizer(filebox, _T("Overwrite prompt"), false);
- m_chkFileMustExist = CreateCheckBoxAndAddToSizer(filebox, _T("File must exist"), false);
- m_chkFileChangeDir = CreateCheckBoxAndAddToSizer(filebox, _T("Change working dir"), false);
+ wxStaticBoxSizer *filebox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&FilePicker style"));
+ m_chkFileTextCtrl = CreateCheckBoxAndAddToSizer(filebox, wxT("With textctrl"), false);
+ m_chkFileOverwritePrompt = CreateCheckBoxAndAddToSizer(filebox, wxT("Overwrite prompt"), false);
+ m_chkFileMustExist = CreateCheckBoxAndAddToSizer(filebox, wxT("File must exist"), false);
+ m_chkFileChangeDir = CreateCheckBoxAndAddToSizer(filebox, wxT("Change working dir"), false);
boxleft->Add(filebox, 0, wxALL|wxGROW, 5);
- boxleft->Add(new wxButton(this, PickerPage_Reset, _T("&Reset")),
+ boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")),
0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
Reset(); // set checkboxes state
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(FontPickerWidgetsPage, _T("FontPicker"),
+IMPLEMENT_WIDGETS_PAGE(FontPickerWidgetsPage, wxT("FontPicker"),
PICKER_CTRLS | FAMILY_CTRLS);
FontPickerWidgetsPage::FontPickerWidgetsPage(WidgetsBookCtrl *book,
// left pane
wxSizer *boxleft = new wxBoxSizer(wxVERTICAL);
- wxStaticBoxSizer *fontbox = new wxStaticBoxSizer(wxVERTICAL, this, _T("&FontPicker style"));
- m_chkFontTextCtrl = CreateCheckBoxAndAddToSizer(fontbox, _T("With textctrl"));
- m_chkFontDescAsLabel = CreateCheckBoxAndAddToSizer(fontbox, _T("Font desc as btn label"));
- m_chkFontUseFontForLabel = CreateCheckBoxAndAddToSizer(fontbox, _T("Use font for label"), false);
+ wxStaticBoxSizer *fontbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&FontPicker style"));
+ m_chkFontTextCtrl = CreateCheckBoxAndAddToSizer(fontbox, wxT("With textctrl"));
+ m_chkFontDescAsLabel = CreateCheckBoxAndAddToSizer(fontbox, wxT("Font desc as btn label"));
+ m_chkFontUseFontForLabel = CreateCheckBoxAndAddToSizer(fontbox, wxT("Use font for label"), false);
boxleft->Add(fontbox, 0, wxALL|wxGROW, 5);
- boxleft->Add(new wxButton(this, PickerPage_Reset, _T("&Reset")),
+ boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")),
0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
Reset(); // set checkboxes state
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, _T("Gauge"), FAMILY_CTRLS );
+IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, wxT("Gauge"), FAMILY_CTRLS );
GaugeWidgetsPage::GaugeWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
- wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
+ wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
- m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Vertical"));
- m_chkSmooth = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Smooth"));
+ m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Vertical"));
+ m_chkSmooth = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Smooth"));
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
- wxButton *btn = new wxButton(this, GaugePage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, GaugePage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
- wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Change gauge value"));
+ wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change gauge value"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxTextCtrl *text;
- wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Current value"),
+ wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"),
GaugePage_CurValueText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(GaugePage_SetValue,
- _T("Set &value"),
+ wxT("Set &value"),
GaugePage_ValueText,
&m_textValue);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(GaugePage_SetRange,
- _T("Set &range"),
+ wxT("Set &range"),
GaugePage_RangeText,
&m_textRange);
- m_textRange->SetValue( wxString::Format(_T("%lu"), m_range) );
+ m_textRange->SetValue( wxString::Format(wxT("%lu"), m_range) );
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, GaugePage_Progress, _T("Simulate &progress"));
+ btn = new wxButton(this, GaugePage_Progress, wxT("Simulate &progress"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, GaugePage_IndeterminateProgress,
- _T("Simulate &indeterminate job"));
+ wxT("Simulate &indeterminate job"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, GaugePage_Clear, _T("&Clear"));
+ btn = new wxButton(this, GaugePage_Clear, wxT("&Clear"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
// right pane
{
static const int INTERVAL = 300;
- wxLogMessage(_T("Launched progress timer (interval = %d ms)"), INTERVAL);
+ wxLogMessage(wxT("Launched progress timer (interval = %d ms)"), INTERVAL);
m_timer = new wxTimer(this,
clicked->GetId() == GaugePage_Progress ? GaugePage_Timer : GaugePage_IndeterminateTimer);
m_timer->Start(INTERVAL);
- clicked->SetLabel(_T("&Stop timer"));
+ clicked->SetLabel(wxT("&Stop timer"));
if (clicked->GetId() == GaugePage_Progress)
FindWindow(GaugePage_IndeterminateProgress)->Disable();
void GaugeWidgetsPage::StopTimer(wxButton *clicked)
{
- wxCHECK_RET( m_timer, _T("shouldn't be called") );
+ wxCHECK_RET( m_timer, wxT("shouldn't be called") );
m_timer->Stop();
delete m_timer;
if (clicked->GetId() == GaugePage_Progress)
{
- clicked->SetLabel(_T("Simulate &progress"));
+ clicked->SetLabel(wxT("Simulate &progress"));
FindWindow(GaugePage_IndeterminateProgress)->Enable();
}
else
{
- clicked->SetLabel(_T("Simulate indeterminate job"));
+ clicked->SetLabel(wxT("Simulate indeterminate job"));
FindWindow(GaugePage_Progress)->Enable();
}
- wxLogMessage(_T("Progress finished."));
+ wxLogMessage(wxT("Progress finished."));
}
// ----------------------------------------------------------------------------
{
StopTimer(b);
- wxLogMessage(_T("Stopped the timer."));
+ wxLogMessage(wxT("Stopped the timer."));
}
}
{
StopTimer(b);
- wxLogMessage(_T("Stopped the timer."));
+ wxLogMessage(wxT("Stopped the timer."));
}
}
else // reached the end
{
wxButton *btn = (wxButton *)FindWindow(GaugePage_Progress);
- wxCHECK_RET( btn, _T("no progress button?") );
+ wxCHECK_RET( btn, wxT("no progress button?") );
StopTimer(btn);
}
void GaugeWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event)
{
- event.SetText( wxString::Format(_T("%d"), m_gauge->GetValue()));
+ event.SetText( wxString::Format(wxT("%d"), m_gauge->GetValue()));
}
#endif
static const wxString alignments[] =
{
- _T("&left"),
- _T("¢re"),
- _T("&right")
+ wxT("&left"),
+ wxT("¢re"),
+ wxT("&right")
};
wxCOMPILE_TIME_ASSERT( WXSIZEOF(alignments) == Align_Max,
AlignMismatch );
- m_radioAlignMode = new wxRadioBox(this, wxID_ANY, _T("alignment"),
+ m_radioAlignMode = new wxRadioBox(this, wxID_ANY, wxT("alignment"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(alignments), alignments);
m_radioAlignMode->SetSelection(1); // start with "centre" selected since
{
default:
case Align_Max:
- wxFAIL_MSG( _T("unknown alignment") );
+ wxFAIL_MSG( wxT("unknown alignment") );
// fall through
case Align_Left:
const char *const icon[])
: WidgetsPage(book, image_list, icon), m_trackedDataObjects(0)
{
- m_items.Add(_T("This"));
- m_items.Add(_T("is"));
- m_items.Add(_T("a"));
- m_items.Add(_T("List"));
- m_items.Add(_T("of"));
- m_items.Add(_T("strings"));
+ m_items.Add(wxT("This"));
+ m_items.Add(wxT("is"));
+ m_items.Add(wxT("a"));
+ m_items.Add(wxT("List"));
+ m_items.Add(wxT("of"));
+ m_items.Add(wxT("strings"));
m_itemsSorted = m_items;
}
{
if ( m_trackedDataObjects )
{
- wxString message = _T("Bug in managing wxClientData: ");
+ wxString message = wxT("Bug in managing wxClientData: ");
if ( m_trackedDataObjects > 0 )
- message << m_trackedDataObjects << _T(" lost objects");
+ message << m_trackedDataObjects << wxT(" lost objects");
else
- message << (-m_trackedDataObjects) << _T(" extra deletes");
+ message << (-m_trackedDataObjects) << wxT(" extra deletes");
wxFAIL_MSG(message);
return false;
}
void ItemContainerWidgetsPage::StartTest(const wxString& label)
{
m_container->Clear();
- wxLogMessage(_T("Test - %s:"), label.c_str());
+ wxLogMessage(wxT("Test - %s:"), label.c_str());
}
void ItemContainerWidgetsPage::EndTest(const wxArrayString& items)
bool ok = count == items.GetCount();
if ( !ok )
{
- wxFAIL_MSG(_T("Item count does not match."));
+ wxFAIL_MSG(wxT("Item count does not match."));
}
else
{
if ( str != items[i] )
{
wxFAIL_MSG(wxString::Format(
- _T("Wrong string \"%s\" at position %d (expected \"%s\")"),
+ wxT("Wrong string \"%s\" at position %d (expected \"%s\")"),
str.c_str(), i, items[i].c_str()));
ok = false;
break;
m_container->Clear();
ok &= VerifyAllClientDataDestroyed();
- wxLogMessage(_T("...%s"), ok ? _T("passed") : _T("failed"));
+ wxLogMessage(wxT("...%s"), ok ? wxT("passed") : wxT("failed"));
}
wxString
ItemContainerWidgetsPage::DumpContainerData(const wxArrayString& expected) const
{
wxString str;
- str << _T("Current content:\n");
+ str << wxT("Current content:\n");
unsigned i;
for ( i = 0; i < m_container->GetCount(); ++i )
{
- str << _T(" - ") << m_container->GetString(i) << _T(" [");
+ str << wxT(" - ") << m_container->GetString(i) << wxT(" [");
if ( m_container->HasClientObjectData() )
{
TrackedClientData *
if ( data )
str << (wxUIntPtr)data;
}
- str << _T("]\n");
+ str << wxT("]\n");
}
- str << _T("Expected content:\n");
+ str << wxT("Expected content:\n");
for ( i = 0; i < expected.GetCount(); ++i )
{
const wxString& item = expected[i];
- str << _T(" - ") << item << _T("[");
+ str << wxT(" - ") << item << wxT("[");
for( unsigned j = 0; j < m_items.GetCount(); ++j )
{
if ( m_items[j] == item )
str << j;
}
- str << _T("]\n");
+ str << wxT("]\n");
}
return str;
{
if ( i > m_items.GetCount() || m_items[i] != str )
{
- wxLogMessage(_T("Client data for '%s' does not match."), str.c_str());
+ wxLogMessage(wxT("Client data for '%s' does not match."), str.c_str());
return false;
}
void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&)
{
m_container = GetContainer();
- wxASSERT_MSG(m_container, _T("Widget must have a test widget"));
+ wxASSERT_MSG(m_container, wxT("Widget must have a test widget"));
- wxLogMessage(_T("wxItemContainer test for %s, %s:"),
+ wxLogMessage(wxT("wxItemContainer test for %s, %s:"),
GetWidget()->GetClassInfo()->GetClassName(),
(m_container->IsSorted() ? "Sorted" : "Unsorted"));
expected_result = m_container->IsSorted() ? MakeArray(m_itemsSorted)
: m_items;
- StartTest(_T("Append one item"));
+ StartTest(wxT("Append one item"));
wxString item = m_items[0];
m_container->Append(item);
EndTest(wxArrayString(1, &item));
- StartTest(_T("Append some items"));
+ StartTest(wxT("Append some items"));
m_container->Append(m_items);
EndTest(expected_result);
- StartTest(_T("Append some items with data objects"));
+ StartTest(wxT("Append some items with data objects"));
wxClientData **objects = new wxClientData *[m_items.GetCount()];
unsigned i;
for ( i = 0; i < m_items.GetCount(); ++i )
EndTest(expected_result);
delete[] objects;
- StartTest(_T("Append some items with data"));
+ StartTest(wxT("Append some items with data"));
void **data = new void *[m_items.GetCount()];
for ( i = 0; i < m_items.GetCount(); ++i )
data[i] = wxUIntToPtr(i);
EndTest(expected_result);
delete[] data;
- StartTest(_T("Append some items with data, one by one"));
+ StartTest(wxT("Append some items with data, one by one"));
for ( i = 0; i < m_items.GetCount(); ++i )
m_container->Append(m_items[i], wxUIntToPtr(i));
EndTest(expected_result);
- StartTest(_T("Append some items with data objects, one by one"));
+ StartTest(wxT("Append some items with data objects, one by one"));
for ( i = 0; i < m_items.GetCount(); ++i )
m_container->Append(m_items[i], CreateClientData(i));
EndTest(expected_result);
if ( !m_container->IsSorted() )
{
- StartTest(_T("Insert in reverse order with data, one by one"));
+ StartTest(wxT("Insert in reverse order with data, one by one"));
for ( unsigned i = m_items.GetCount(); i; --i )
m_container->Insert(m_items[i - 1], 0, wxUIntToPtr(i - 1));
EndTest(expected_result);
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, _T("Listbox"),
+IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, wxT("Listbox"),
FAMILY_CTRLS | WITH_ITEMS_CTRLS
);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY,
- _T("&Set listbox parameters"));
+ wxT("&Set listbox parameters"));
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
static const wxString modes[] =
{
- _T("single"),
- _T("extended"),
- _T("multiple"),
+ wxT("single"),
+ wxT("extended"),
+ wxT("multiple"),
};
- m_radioSelMode = new wxRadioBox(this, wxID_ANY, _T("Selection &mode:"),
+ m_radioSelMode = new wxRadioBox(this, wxID_ANY, wxT("Selection &mode:"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(modes), modes,
1, wxRA_SPECIFY_COLS);
m_chkVScroll = CreateCheckBoxAndAddToSizer
(
sizerLeft,
- _T("Always show &vertical scrollbar")
+ wxT("Always show &vertical scrollbar")
);
m_chkHScroll = CreateCheckBoxAndAddToSizer
(
sizerLeft,
- _T("Show &horizontal scrollbar")
+ wxT("Show &horizontal scrollbar")
);
- m_chkCheck = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Check list box"));
- m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Sort items"));
- m_chkOwnerDraw = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Owner drawn"));
+ m_chkCheck = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Check list box"));
+ m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items"));
+ m_chkOwnerDraw = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Owner drawn"));
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
sizerLeft->Add(m_radioSelMode, 0, wxGROW | wxALL, 5);
- wxButton *btn = new wxButton(this, ListboxPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, ListboxPage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
- _T("&Change listbox contents"));
+ wxT("&Change listbox contents"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
- btn = new wxButton(this, ListboxPage_Add, _T("&Add this string"));
- m_textAdd = new wxTextCtrl(this, ListboxPage_AddText, _T("test item 0"));
+ btn = new wxButton(this, ListboxPage_Add, wxT("&Add this string"));
+ m_textAdd = new wxTextCtrl(this, ListboxPage_AddText, wxT("test item 0"));
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textAdd, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ListboxPage_AddSeveral, _T("&Insert a few strings"));
+ btn = new wxButton(this, ListboxPage_AddSeveral, wxT("&Insert a few strings"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ListboxPage_AddMany, _T("Add &many strings"));
+ btn = new wxButton(this, ListboxPage_AddMany, wxT("Add &many strings"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
- btn = new wxButton(this, ListboxPage_Change, _T("C&hange current"));
+ btn = new wxButton(this, ListboxPage_Change, wxT("C&hange current"));
m_textChange = new wxTextCtrl(this, ListboxPage_ChangeText, wxEmptyString);
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textChange, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
- btn = new wxButton(this, ListboxPage_EnsureVisible, _T("Make item &visible"));
+ btn = new wxButton(this, ListboxPage_EnsureVisible, wxT("Make item &visible"));
m_textEnsureVisible = new wxTextCtrl(this, ListboxPage_EnsureVisibleText, wxEmptyString);
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textEnsureVisible, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
- btn = new wxButton(this, ListboxPage_Delete, _T("&Delete this item"));
+ btn = new wxButton(this, ListboxPage_Delete, wxT("&Delete this item"));
m_textDelete = new wxTextCtrl(this, ListboxPage_DeleteText, wxEmptyString);
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textDelete, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ListboxPage_DeleteSel, _T("Delete &selection"));
+ btn = new wxButton(this, ListboxPage_DeleteSel, wxT("Delete &selection"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ListboxPage_Clear, _T("&Clear"));
+ btn = new wxButton(this, ListboxPage_Clear, wxT("&Clear"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ListboxPage_ContainerTests, _T("Run &tests"));
+ btn = new wxButton(this, ListboxPage_ContainerTests, wxT("Run &tests"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
// right pane
switch ( m_radioSelMode->GetSelection() )
{
default:
- wxFAIL_MSG( _T("unexpected radio box selection") );
+ wxFAIL_MSG( wxT("unexpected radio box selection") );
case LboxSel_Single: flags |= wxLB_SINGLE; break;
case LboxSel_Extended: flags |= wxLB_EXTENDED; break;
if ( !m_textAdd->IsModified() )
{
// update the default string
- m_textAdd->SetValue(wxString::Format(_T("test item %u"), ++s_item));
+ m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
}
m_lbox->Append(s);
// "many" means 1000 here
for ( unsigned int n = 0; n < 1000; n++ )
{
- m_lbox->Append(wxString::Format(_T("item #%u"), n));
+ m_lbox->Append(wxString::Format(wxT("item #%u"), n));
}
}
void ListboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event))
{
wxArrayString items;
- items.Add(_T("First"));
- items.Add(_T("another one"));
- items.Add(_T("and the last (very very very very very very very very very very long) one"));
+ items.Add(wxT("First"));
+ items.Add(wxT("another one"));
+ items.Add(wxT("and the last (very very very very very very very very very very long) one"));
m_lbox->InsertItems(items, 0);
}
void ListboxWidgetsPage::OnListbox(wxCommandEvent& event)
{
long sel = event.GetSelection();
- m_textDelete->SetValue(wxString::Format(_T("%ld"), sel));
+ m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel));
if (event.IsSelection())
{
- wxLogMessage(_T("Listbox item %ld selected"), sel);
+ wxLogMessage(wxT("Listbox item %ld selected"), sel);
}
else
{
- wxLogMessage(_T("Listbox item %ld deselected"), sel);
+ wxLogMessage(wxT("Listbox item %ld deselected"), sel);
}
}
void ListboxWidgetsPage::OnListboxDClick(wxCommandEvent& event)
{
- wxLogMessage( _T("Listbox item %d double clicked"), event.GetInt() );
+ wxLogMessage( wxT("Listbox item %d double clicked"), event.GetInt() );
}
void ListboxWidgetsPage::OnCheckListbox(wxCommandEvent& event)
{
- wxLogMessage( _T("Listbox item %d toggled"), event.GetInt() );
+ wxLogMessage( wxT("Listbox item %d toggled"), event.GetInt() );
}
void ListboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
- wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
+ wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
// must be in sync with Orient enum
wxArrayString orientations;
- orientations.Add(_T("&top"));
- orientations.Add(_T("&bottom"));
- orientations.Add(_T("&left"));
- orientations.Add(_T("&right"));
+ orientations.Add(wxT("&top"));
+ orientations.Add(wxT("&bottom"));
+ orientations.Add(wxT("&left"));
+ orientations.Add(wxT("&right"));
wxASSERT_MSG( orientations.GetCount() == Orient_Max,
- _T("forgot to update something") );
+ wxT("forgot to update something") );
- m_chkImages = new wxCheckBox(this, wxID_ANY, _T("Show &images"));
- m_radioOrient = new wxRadioBox(this, wxID_ANY, _T("&Tab orientation"),
+ m_chkImages = new wxCheckBox(this, wxID_ANY, wxT("Show &images"));
+ m_radioOrient = new wxRadioBox(this, wxID_ANY, wxT("&Tab orientation"),
wxDefaultPosition, wxDefaultSize,
orientations, 1, wxRA_SPECIFY_COLS);
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
sizerLeft->Add(m_radioOrient, 0, wxALL, 5);
- wxButton *btn = new wxButton(this, BookPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, BookPage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
- wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Contents"));
+ wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Contents"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxTextCtrl *text;
- wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Number of pages: "),
+ wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Number of pages: "),
BookPage_NumPagesText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- sizerRow = CreateSizerWithTextAndLabel(_T("Current selection: "),
+ sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection: "),
BookPage_CurSelectText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(BookPage_SelectPage,
- _T("&Select page"),
+ wxT("&Select page"),
BookPage_SelectText,
&m_textSelect);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, BookPage_AddPage, _T("&Add page"));
+ btn = new wxButton(this, BookPage_AddPage, wxT("&Add page"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(BookPage_InsertPage,
- _T("&Insert page at"),
+ wxT("&Insert page at"),
BookPage_InsertText,
&m_textInsert);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(BookPage_RemovePage,
- _T("&Remove page"),
+ wxT("&Remove page"),
BookPage_RemoveText,
&m_textRemove);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, BookPage_DeleteAll, _T("&Delete All"));
+ btn = new wxButton(this, BookPage_DeleteAll, wxT("&Delete All"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
// right pane
switch ( m_radioOrient->GetSelection() )
{
default:
- wxFAIL_MSG( _T("unknown orientation") );
+ wxFAIL_MSG( wxT("unknown orientation") );
// fall through
case Orient_Top:
wxWindow *BookWidgetsPage::CreateNewPage()
{
- return new wxTextCtrl(m_book, wxID_ANY, _T("I'm a book page"));
+ return new wxTextCtrl(m_book, wxID_ANY, wxT("I'm a book page"));
}
// ----------------------------------------------------------------------------
void BookWidgetsPage::OnButtonSelectPage(wxCommandEvent& WXUNUSED(event))
{
int pos = GetTextValue(m_textSelect);
- wxCHECK_RET( IsValidValue(pos), _T("button should be disabled") );
+ wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") );
m_book->SetSelection(pos);
}
void BookWidgetsPage::OnButtonAddPage(wxCommandEvent& WXUNUSED(event))
{
- m_book->AddPage(CreateNewPage(), _T("Added page"), false,
+ m_book->AddPage(CreateNewPage(), wxT("Added page"), false,
GetIconIndex());
}
void BookWidgetsPage::OnButtonInsertPage(wxCommandEvent& WXUNUSED(event))
{
int pos = GetTextValue(m_textInsert);
- wxCHECK_RET( IsValidValue(pos), _T("button should be disabled") );
+ wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") );
- m_book->InsertPage(pos, CreateNewPage(), _T("Inserted page"), false,
+ m_book->InsertPage(pos, CreateNewPage(), wxT("Inserted page"), false,
GetIconIndex());
}
void BookWidgetsPage::OnButtonRemovePage(wxCommandEvent& WXUNUSED(event))
{
int pos = GetTextValue(m_textRemove);
- wxCHECK_RET( IsValidValue(pos), _T("button should be disabled") );
+ wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") );
m_book->DeletePage(pos);
}
void BookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event)
{
if(m_book)
- event.SetText( wxString::Format(_T("%u"), unsigned(m_book->GetPageCount())) );
+ event.SetText( wxString::Format(wxT("%u"), unsigned(m_book->GetPageCount())) );
}
void BookWidgetsPage::OnUpdateUICurSelectText(wxUpdateUIEvent& event)
{
if(m_book)
- event.SetText( wxString::Format(_T("%d"), m_book->GetSelection()) );
+ event.SetText( wxString::Format(wxT("%d"), m_book->GetSelection()) );
}
void BookWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, _T("Notebook"),
+IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, wxT("Notebook"),
FAMILY_CTRLS | BOOK_CTRLS
);
void NotebookWidgetsPage::OnPageChanging(wxNotebookEvent& event)
{
- wxLogMessage(_T("Notebook page changing from %d to %d (currently %d)."),
+ wxLogMessage(wxT("Notebook page changing from %d to %d (currently %d)."),
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
void NotebookWidgetsPage::OnPageChanged(wxNotebookEvent& event)
{
- wxLogMessage(_T("Notebook page changed from %d to %d (currently %d)."),
+ wxLogMessage(wxT("Notebook page changed from %d to %d (currently %d)."),
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
EVT_LISTBOOK_PAGE_CHANGED(wxID_ANY, ListbookWidgetsPage::OnPageChanged)
END_EVENT_TABLE()
-IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, _T("Listbook"),
+IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, wxT("Listbook"),
GENERIC_CTRLS | BOOK_CTRLS
);
void ListbookWidgetsPage::OnPageChanging(wxListbookEvent& event)
{
- wxLogMessage(_T("Listbook page changing from %d to %d (currently %d)."),
+ wxLogMessage(wxT("Listbook page changing from %d to %d (currently %d)."),
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
void ListbookWidgetsPage::OnPageChanged(wxListbookEvent& event)
{
- wxLogMessage(_T("Listbook page changed from %d to %d (currently %d)."),
+ wxLogMessage(wxT("Listbook page changed from %d to %d (currently %d)."),
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
EVT_CHOICEBOOK_PAGE_CHANGED(wxID_ANY, ChoicebookWidgetsPage::OnPageChanged)
END_EVENT_TABLE()
-IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, _T("Choicebook"),
+IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, wxT("Choicebook"),
GENERIC_CTRLS | BOOK_CTRLS
);
void ChoicebookWidgetsPage::OnPageChanging(wxChoicebookEvent& event)
{
- wxLogMessage(_T("Choicebook page changing from %d to %d (currently %d)."),
+ wxLogMessage(wxT("Choicebook page changing from %d to %d (currently %d)."),
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
void ChoicebookWidgetsPage::OnPageChanged(wxChoicebookEvent& event)
{
- wxLogMessage(_T("Choicebook page changed from %d to %d (currently %d)."),
+ wxLogMessage(wxT("Choicebook page changed from %d to %d (currently %d)."),
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
};
-IMPLEMENT_WIDGETS_PAGE(ODComboboxWidgetsPage, _T("OwnerDrawnCombobox"),
+IMPLEMENT_WIDGETS_PAGE(ODComboboxWidgetsPage, wxT("OwnerDrawnCombobox"),
GENERIC_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS
);
wxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL);
// left pane - style box
- wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
+ wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxSizer *sizerStyle = new wxStaticBoxSizer(box, wxVERTICAL);
- m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, _T("&Sort items"));
- m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, _T("&Read only"));
- m_chkDclickcycles = CreateCheckBoxAndAddToSizer(sizerStyle, _T("&Double-click Cycles"));
+ m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Sort items"));
+ m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Read only"));
+ m_chkDclickcycles = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Double-click Cycles"));
sizerStyle->AddSpacer(4);
- m_chkBitmapbutton = CreateCheckBoxAndAddToSizer(sizerStyle, _T("&Bitmap button"));
- m_chkStdbutton = CreateCheckBoxAndAddToSizer(sizerStyle, _T("B&lank button background"));
+ m_chkBitmapbutton = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Bitmap button"));
+ m_chkStdbutton = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("B&lank button background"));
- wxButton *btn = new wxButton(this, ODComboPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, ODComboPage_Reset, wxT("&Reset"));
sizerStyle->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 3);
sizerLeft->Add(sizerStyle, 0, wxGROW | wxALIGN_CENTRE_HORIZONTAL);
// left pane - popup adjustment box
- box = new wxStaticBox(this, wxID_ANY, _T("Adjust &popup"));
+ box = new wxStaticBox(this, wxID_ANY, wxT("Adjust &popup"));
wxSizer *sizerPopupPos = new wxStaticBoxSizer(box, wxVERTICAL);
- sizerRow = CreateSizerWithTextAndLabel(_T("Min. Width:"),
+ sizerRow = CreateSizerWithTextAndLabel(wxT("Min. Width:"),
ODComboPage_PopupMinWidth,
&m_textPopupMinWidth);
m_textPopupMinWidth->SetValue(wxT("-1"));
sizerPopupPos->Add(sizerRow, 0, wxALL | wxGROW, 5);
- sizerRow = CreateSizerWithTextAndLabel(_T("Max. Height:"),
+ sizerRow = CreateSizerWithTextAndLabel(wxT("Max. Height:"),
ODComboPage_PopupHeight,
&m_textPopupHeight);
m_textPopupHeight->SetValue(wxT("-1"));
sizerPopupPos->Add(sizerRow, 0, wxALL | wxGROW, 5);
- m_chkAlignpopupright = CreateCheckBoxAndAddToSizer(sizerPopupPos, _T("Align Right"));
+ m_chkAlignpopupright = CreateCheckBoxAndAddToSizer(sizerPopupPos, wxT("Align Right"));
sizerLeft->Add(sizerPopupPos, 0, wxGROW | wxALIGN_CENTRE_HORIZONTAL | wxTOP, 2);
// left pane - button adjustment box
- box = new wxStaticBox(this, wxID_ANY, _T("Adjust &button"));
+ box = new wxStaticBox(this, wxID_ANY, wxT("Adjust &button"));
wxSizer *sizerButtonPos = new wxStaticBoxSizer(box, wxVERTICAL);
- sizerRow = CreateSizerWithTextAndLabel(_T("Width:"),
+ sizerRow = CreateSizerWithTextAndLabel(wxT("Width:"),
ODComboPage_ButtonWidth,
&m_textButtonWidth);
m_textButtonWidth->SetValue(wxT("-1"));
sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5);
- sizerRow = CreateSizerWithTextAndLabel(_T("VSpacing:"),
+ sizerRow = CreateSizerWithTextAndLabel(wxT("VSpacing:"),
ODComboPage_ButtonSpacing,
&m_textButtonSpacing);
m_textButtonSpacing->SetValue(wxT("0"));
sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5);
- sizerRow = CreateSizerWithTextAndLabel(_T("Height:"),
+ sizerRow = CreateSizerWithTextAndLabel(wxT("Height:"),
ODComboPage_ButtonHeight,
&m_textButtonHeight);
m_textButtonHeight->SetValue(wxT("-1"));
sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5);
- m_chkAlignbutleft = CreateCheckBoxAndAddToSizer(sizerButtonPos, _T("Align Left"));
+ m_chkAlignbutleft = CreateCheckBoxAndAddToSizer(sizerButtonPos, wxT("Align Left"));
sizerLeft->Add(sizerButtonPos, 0, wxGROW | wxALIGN_CENTRE_HORIZONTAL | wxTOP, 2);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
- _T("&Change combobox contents"));
+ wxT("&Change combobox contents"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
- btn = new wxButton(this, ODComboPage_ContainerTests, _T("Run &tests"));
+ btn = new wxButton(this, ODComboPage_ContainerTests, wxT("Run &tests"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- sizerRow = CreateSizerWithTextAndLabel(_T("Current selection"),
+ sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection"),
ODComboPage_CurText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- sizerRow = CreateSizerWithTextAndLabel(_T("Insertion Point"),
+ sizerRow = CreateSizerWithTextAndLabel(wxT("Insertion Point"),
ODComboPage_InsertionPointText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ODComboPage_Insert,
- _T("&Insert this string"),
+ wxT("&Insert this string"),
ODComboPage_InsertText,
&m_textInsert);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ODComboPage_Add,
- _T("&Add this string"),
+ wxT("&Add this string"),
ODComboPage_AddText,
&m_textAdd);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ODComboPage_AddSeveral, _T("&Append a few strings"));
+ btn = new wxButton(this, ODComboPage_AddSeveral, wxT("&Append a few strings"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ODComboPage_AddMany, _T("Append &many strings"));
+ btn = new wxButton(this, ODComboPage_AddMany, wxT("Append &many strings"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ODComboPage_Change,
- _T("C&hange current"),
+ wxT("C&hange current"),
ODComboPage_ChangeText,
&m_textChange);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(ODComboPage_Delete,
- _T("&Delete this item"),
+ wxT("&Delete this item"),
ODComboPage_DeleteText,
&m_textDelete);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ODComboPage_DeleteSel, _T("Delete &selection"));
+ btn = new wxButton(this, ODComboPage_DeleteSel, wxT("Delete &selection"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
- btn = new wxButton(this, ODComboPage_Clear, _T("&Clear"));
+ btn = new wxButton(this, ODComboPage_Clear, wxT("&Clear"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
// right pane
#ifndef __WXGTK__
m_combobox->SetString(sel, m_textChange->GetValue());
#else
- wxLogMessage(_T("Not implemented in wxGTK"));
+ wxLogMessage(wxT("Not implemented in wxGTK"));
#endif
}
}
if ( !m_textInsert->IsModified() )
{
// update the default string
- m_textInsert->SetValue(wxString::Format(_T("test item %u"), ++s_item));
+ m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
}
if (m_combobox->GetSelection() >= 0)
if ( !m_textAdd->IsModified() )
{
// update the default string
- m_textAdd->SetValue(wxString::Format(_T("test item %u"), ++s_item));
+ m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item));
}
m_combobox->Append(s);
// "many" means 1000 here
for ( unsigned int n = 0; n < 1000; n++ )
{
- m_combobox->Append(wxString::Format(_T("item #%u"), n));
+ m_combobox->Append(wxString::Format(wxT("item #%u"), n));
}
}
void ODComboboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event))
{
- m_combobox->Append(_T("First"));
- m_combobox->Append(_T("another one"));
- m_combobox->Append(_T("and the last (very very very very very very very very very very long) one"));
+ m_combobox->Append(wxT("First"));
+ m_combobox->Append(wxT("another one"));
+ m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one"));
}
void ODComboboxWidgetsPage::OnTextPopupWidth(wxCommandEvent& WXUNUSED(event))
void ODComboboxWidgetsPage::OnUpdateUICurText(wxUpdateUIEvent& event)
{
if (m_combobox)
- event.SetText( wxString::Format(_T("%d"), m_combobox->GetSelection()) );
+ event.SetText( wxString::Format(wxT("%d"), m_combobox->GetSelection()) );
}
void ODComboboxWidgetsPage::OnUpdateUIInsertionPointText(wxUpdateUIEvent& event)
{
if (m_combobox)
- event.SetText( wxString::Format(_T("%ld"), m_combobox->GetInsertionPoint()) );
+ event.SetText( wxString::Format(wxT("%ld"), m_combobox->GetInsertionPoint()) );
}
void ODComboboxWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event)
wxString s = event.GetString();
wxASSERT_MSG( s == m_combobox->GetValue(),
- _T("event and combobox values should be the same") );
+ wxT("event and combobox values should be the same") );
if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER)
{
- wxLogMessage(_T("OwnerDrawnCombobox enter pressed (now '%s')"), s.c_str());
+ wxLogMessage(wxT("OwnerDrawnCombobox enter pressed (now '%s')"), s.c_str());
}
else
{
- wxLogMessage(_T("OwnerDrawnCombobox text changed (now '%s')"), s.c_str());
+ wxLogMessage(wxT("OwnerDrawnCombobox text changed (now '%s')"), s.c_str());
}
}
void ODComboboxWidgetsPage::OnComboBox(wxCommandEvent& event)
{
long sel = event.GetInt();
- m_textDelete->SetValue(wxString::Format(_T("%ld"), sel));
+ m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel));
- wxLogMessage(_T("OwnerDrawnCombobox item %ld selected"), sel);
+ wxLogMessage(wxT("OwnerDrawnCombobox item %ld selected"), sel);
- wxLogMessage(_T("OwnerDrawnCombobox GetValue(): %s"), m_combobox->GetValue().c_str() );
+ wxLogMessage(wxT("OwnerDrawnCombobox GetValue(): %s"), m_combobox->GetValue().c_str() );
}
void ODComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event)
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, _T("Radio"),
+IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, wxT("Radio"),
FAMILY_CTRLS | WITH_ITEMS_CTRLS
);
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
- wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
+ wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
static const wxString layoutDir[] =
{
- _T("default"),
- _T("left to right"),
- _T("top to bottom")
+ wxT("default"),
+ wxT("left to right"),
+ wxT("top to bottom")
};
- m_radioDir = new wxRadioBox(this, wxID_ANY, _T("Numbering:"),
+ m_radioDir = new wxRadioBox(this, wxID_ANY, wxT("Numbering:"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(layoutDir), layoutDir,
1, wxRA_SPECIFY_COLS);
#endif // wxRA_LEFTTORIGHT
wxSizer *sizerRow;
- sizerRow = CreateSizerWithTextAndLabel(_T("&Major dimension:"),
+ sizerRow = CreateSizerWithTextAndLabel(wxT("&Major dimension:"),
wxID_ANY,
&m_textMajorDim);
sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5);
- sizerRow = CreateSizerWithTextAndLabel(_T("&Number of buttons:"),
+ sizerRow = CreateSizerWithTextAndLabel(wxT("&Number of buttons:"),
wxID_ANY,
&m_textNumBtns);
sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5);
wxButton *btn;
- btn = new wxButton(this, RadioPage_Update, _T("&Update"));
+ btn = new wxButton(this, RadioPage_Update, wxT("&Update"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 5);
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
- btn = new wxButton(this, RadioPage_Reset, _T("&Reset"));
+ btn = new wxButton(this, RadioPage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
- wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Change parameters"));
+ wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change parameters"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
- sizerRow = CreateSizerWithTextAndLabel(_T("Current selection:"),
+ sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection:"),
wxID_ANY,
&m_textCurSel);
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
sizerRow = CreateSizerWithTextAndButton(RadioPage_Selection,
- _T("&Change selection:"),
+ wxT("&Change selection:"),
wxID_ANY,
&m_textSel);
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
sizerRow = CreateSizerWithTextAndButton(RadioPage_Label,
- _T("&Label for box:"),
+ wxT("&Label for box:"),
wxID_ANY,
&m_textLabel);
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
sizerRow = CreateSizerWithTextAndButton(RadioPage_LabelBtn,
- _T("&Label for buttons:"),
+ wxT("&Label for buttons:"),
wxID_ANY,
&m_textLabelBtns);
sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5);
m_chkEnableItem = CreateCheckBoxAndAddToSizer(sizerMiddle,
- _T("Disable &2nd item"),
+ wxT("Disable &2nd item"),
RadioPage_EnableItem);
m_chkShowItem = CreateCheckBoxAndAddToSizer(sizerMiddle,
- _T("Hide 2nd &item"),
+ wxT("Hide 2nd &item"),
RadioPage_ShowItem);
// right pane
void RadioWidgetsPage::Reset()
{
- m_textMajorDim->SetValue(wxString::Format(_T("%u"), DEFAULT_MAJOR_DIM));
- m_textNumBtns->SetValue(wxString::Format(_T("%u"), DEFAULT_NUM_ENTRIES));
- m_textLabel->SetValue(_T("I'm a radiobox"));
- m_textLabelBtns->SetValue(_T("item"));
+ m_textMajorDim->SetValue(wxString::Format(wxT("%u"), DEFAULT_MAJOR_DIM));
+ m_textNumBtns->SetValue(wxString::Format(wxT("%u"), DEFAULT_NUM_ENTRIES));
+ m_textLabel->SetValue(wxT("I'm a radiobox"));
+ m_textLabelBtns->SetValue(wxT("item"));
m_chkSpecifyRows->SetValue(false);
m_chkEnableItem->SetValue(true);
unsigned long count;
if ( !m_textNumBtns->GetValue().ToULong(&count) )
{
- wxLogWarning(_T("Should have a valid number for number of items."));
+ wxLogWarning(wxT("Should have a valid number for number of items."));
// fall back to default
count = DEFAULT_NUM_ENTRIES;
unsigned long majorDim;
if ( !m_textMajorDim->GetValue().ToULong(&majorDim) )
{
- wxLogWarning(_T("Should have a valid major dimension number."));
+ wxLogWarning(wxT("Should have a valid major dimension number."));
// fall back to default
majorDim = DEFAULT_MAJOR_DIM;
wxString labelBtn = m_textLabelBtns->GetValue();
for ( size_t n = 0; n < count; n++ )
{
- items[n] = wxString::Format(_T("%s %lu"),
+ items[n] = wxString::Format(wxT("%s %lu"),
labelBtn.c_str(), (unsigned long)n + 1);
}
switch ( m_radioDir->GetSelection() )
{
default:
- wxFAIL_MSG( _T("unexpected wxRadioBox layout direction") );
+ wxFAIL_MSG( wxT("unexpected wxRadioBox layout direction") );
// fall through
case RadioDir_Default:
int event_sel = event.GetSelection();
wxUnusedVar(event_sel);
- wxLogMessage(_T("Radiobox selection changed, now %d"), sel);
+ wxLogMessage(wxT("Radiobox selection changed, now %d"), sel);
wxASSERT_MSG( sel == event_sel,
- _T("selection should be the same in event and radiobox") );
+ wxT("selection should be the same in event and radiobox") );
- m_textCurSel->SetValue(wxString::Format(_T("%d"), sel));
+ m_textCurSel->SetValue(wxString::Format(wxT("%d"), sel));
}
void RadioWidgetsPage::OnButtonRecreate(wxCommandEvent& WXUNUSED(event))
if ( !m_textSel->GetValue().ToULong(&sel) ||
(sel >= (size_t)m_radio->GetCount()) )
{
- wxLogWarning(_T("Invalid number specified as new selection."));
+ wxLogWarning(wxT("Invalid number specified as new selection."));
}
else
{
void RadioWidgetsPage::OnUpdateUIEnableItem(wxUpdateUIEvent& event)
{
- event.SetText(m_radio->IsItemEnabled(TEST_BUTTON) ? _T("Disable &2nd item")
- : _T("Enable &2nd item"));
+ event.SetText(m_radio->IsItemEnabled(TEST_BUTTON) ? wxT("Disable &2nd item")
+ : wxT("Enable &2nd item"));
}
void RadioWidgetsPage::OnUpdateUIShowItem(wxUpdateUIEvent& event)
{
- event.SetText(m_radio->IsItemShown(TEST_BUTTON) ? _T("Hide 2nd &item")
- : _T("Show 2nd &item"));
+ event.SetText(m_radio->IsItemShown(TEST_BUTTON) ? wxT("Hide 2nd &item")
+ : wxT("Show 2nd &item"));
}
#endif // wxUSE_RADIOBOX
#define FAMILY_CTRLS GENERIC_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(SearchCtrlWidgetsPage, _T("SearchCtrl"),
+IMPLEMENT_WIDGETS_PAGE(SearchCtrlWidgetsPage, wxT("SearchCtrl"),
FAMILY_CTRLS | EDITABLE_CTRLS | ALL_CTRLS);
SearchCtrlWidgetsPage::SearchCtrlWidgetsPage(WidgetsBookCtrl *book,
{
wxMenu* menu = new wxMenu;
const int SEARCH_MENU_SIZE = 5;
- wxMenuItem* menuItem = menu->Append(wxID_ANY, _T("Recent Searches"), wxT(""), wxITEM_NORMAL);
+ wxMenuItem* menuItem = menu->Append(wxID_ANY, wxT("Recent Searches"), wxT(""), wxITEM_NORMAL);
menuItem->Enable(false);
for ( int i = 0; i < SEARCH_MENU_SIZE; i++ )
{
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, _T("Slider"), FAMILY_CTRLS );
+IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, wxT("Slider"), FAMILY_CTRLS );
SliderWidgetsPage::SliderWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
- wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
+ wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
- m_chkInverse = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Inverse"));
- m_chkTicks = CreateCheckBoxAndAddToSizer(sizerLeft, _T("Show &ticks"));
- m_chkLabels = CreateCheckBoxAndAddToSizer(sizerLeft, _T("Show &labels"));
+ m_chkInverse = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Inverse"));
+ m_chkTicks = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show &ticks"));
+ m_chkLabels = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show &labels"));
static const wxString sides[] =
{
- _T("top"),
- _T("bottom"),
- _T("left"),
- _T("right"),
+ wxT("top"),
+ wxT("bottom"),
+ wxT("left"),
+ wxT("right"),
};
- m_radioSides = new wxRadioBox(this, SliderPage_RadioSides, _T("&Ticks/Labels"),
+ m_radioSides = new wxRadioBox(this, SliderPage_RadioSides, wxT("&Ticks/Labels"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(sides), sides,
1, wxRA_SPECIFY_COLS);
sizerLeft->Add(m_radioSides, 0, wxGROW | wxALL, 5);
m_chkBothSides = CreateCheckBoxAndAddToSizer
- (sizerLeft, _T("&Both sides"), SliderPage_BothSides);
+ (sizerLeft, wxT("&Both sides"), SliderPage_BothSides);
#if wxUSE_TOOLTIPS
- m_chkBothSides->SetToolTip( _T("\"Both sides\" is only supported \nin Win95 and Universal") );
+ m_chkBothSides->SetToolTip( wxT("\"Both sides\" is only supported \nin Win95 and Universal") );
#endif // wxUSE_TOOLTIPS
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
- wxButton *btn = new wxButton(this, SliderPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, SliderPage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
- wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Change slider value"));
+ wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change slider value"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxTextCtrl *text;
- wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Current value"),
+ wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"),
SliderPage_CurValueText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetValue,
- _T("Set &value"),
+ wxT("Set &value"),
SliderPage_ValueText,
&m_textValue);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetMinAndMax,
- _T("&Min and max"),
+ wxT("&Min and max"),
SliderPage_MinText,
&m_textMin);
m_textMax = new wxTextCtrl(this, SliderPage_MaxText, wxEmptyString);
sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5);
- m_textMin->SetValue( wxString::Format(_T("%d"), m_min) );
- m_textMax->SetValue( wxString::Format(_T("%d"), m_max) );
+ m_textMin->SetValue( wxString::Format(wxT("%d"), m_min) );
+ m_textMax->SetValue( wxString::Format(wxT("%d"), m_max) );
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetLineSize,
- _T("Li&ne size"),
+ wxT("Li&ne size"),
SliderPage_LineSizeText,
&m_textLineSize);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetPageSize,
- _T("P&age size"),
+ wxT("P&age size"),
SliderPage_PageSizeText,
&m_textPageSize);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetTickFreq,
- _T("Tick &frequency"),
+ wxT("Tick &frequency"),
SliderPage_TickFreqText,
&m_textTickFreq);
- m_textTickFreq->SetValue(_T("10"));
+ m_textTickFreq->SetValue(wxT("10"));
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetThumbLen,
- _T("Thumb &length"),
+ wxT("Thumb &length"),
SliderPage_ThumbLenText,
&m_textThumbLen);
Reset();
CreateSlider();
- m_textLineSize->SetValue(wxString::Format(_T("%d"), m_slider->GetLineSize()));
- m_textPageSize->SetValue(wxString::Format(_T("%d"), m_slider->GetPageSize()));
+ m_textLineSize->SetValue(wxString::Format(wxT("%d"), m_slider->GetLineSize()));
+ m_textPageSize->SetValue(wxString::Format(wxT("%d"), m_slider->GetPageSize()));
// the 3 panes panes compose the window
sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10);
break;
default:
- wxFAIL_MSG(_T("unexpected radiobox selection"));
+ wxFAIL_MSG(wxT("unexpected radiobox selection"));
// fall through
}
long lineSize;
if ( !m_textLineSize->GetValue().ToLong(&lineSize) )
{
- wxLogWarning(_T("Invalid slider line size"));
+ wxLogWarning(wxT("Invalid slider line size"));
return;
}
if ( m_slider->GetLineSize() != lineSize )
{
- wxLogWarning(_T("Invalid line size in slider."));
+ wxLogWarning(wxT("Invalid line size in slider."));
}
}
long pageSize;
if ( !m_textPageSize->GetValue().ToLong(&pageSize) )
{
- wxLogWarning(_T("Invalid slider page size"));
+ wxLogWarning(wxT("Invalid slider page size"));
return;
}
if ( m_slider->GetPageSize() != pageSize )
{
- wxLogWarning(_T("Invalid page size in slider."));
+ wxLogWarning(wxT("Invalid page size in slider."));
}
}
long freq;
if ( !m_textTickFreq->GetValue().ToLong(&freq) )
{
- wxLogWarning(_T("Invalid slider tick frequency"));
+ wxLogWarning(wxT("Invalid slider tick frequency"));
return;
}
long len;
if ( !m_textThumbLen->GetValue().ToLong(&len) )
{
- wxLogWarning(_T("Invalid slider thumb length"));
+ wxLogWarning(wxT("Invalid slider thumb length"));
return;
}
!m_textMax->GetValue().ToLong(&maxNew) ||
minNew >= maxNew )
{
- wxLogWarning(_T("Invalid min/max values for the slider."));
+ wxLogWarning(wxT("Invalid min/max values for the slider."));
return;
}
if ( m_slider->GetMin() != m_min ||
m_slider->GetMax() != m_max )
{
- wxLogWarning(_T("Invalid range in slider."));
+ wxLogWarning(wxT("Invalid range in slider."));
}
}
long val;
if ( !m_textValue->GetValue().ToLong(&val) || !IsValidValue(val) )
{
- wxLogWarning(_T("Invalid slider value."));
+ wxLogWarning(wxT("Invalid slider value."));
return;
}
void SliderWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event)
{
- event.SetText( wxString::Format(_T("%d"), m_slider->GetValue()) );
+ event.SetText( wxString::Format(wxT("%d"), m_slider->GetValue()) );
}
void SliderWidgetsPage::OnUpdateUIRadioSides(wxUpdateUIEvent& event)
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, _T("Spin"),
+IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, wxT("Spin"),
FAMILY_CTRLS | EDITABLE_CTRLS
);
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
- wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style"));
+ wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
- m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Vertical"));
- m_chkArrowKeys = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Arrow Keys"));
- m_chkWrap = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Wrap"));
+ m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Vertical"));
+ m_chkArrowKeys = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Arrow Keys"));
+ m_chkWrap = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Wrap"));
m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeft,
- _T("Process &Enter"));
+ wxT("Process &Enter"));
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
static const wxString halign[] =
{
- _T("left"),
- _T("centre"),
- _T("right"),
+ wxT("left"),
+ wxT("centre"),
+ wxT("right"),
};
- m_radioAlign = new wxRadioBox(this, wxID_ANY, _T("&Text alignment"),
+ m_radioAlign = new wxRadioBox(this, wxID_ANY, wxT("&Text alignment"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(halign), halign, 1);
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
- wxButton *btn = new wxButton(this, SpinBtnPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, SpinBtnPage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
- _T("&Change spinbtn value"));
+ wxT("&Change spinbtn value"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxTextCtrl *text;
- wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Current value"),
+ wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"),
SpinBtnPage_CurValueText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SpinBtnPage_SetValue,
- _T("Set &value"),
+ wxT("Set &value"),
SpinBtnPage_ValueText,
&m_textValue);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SpinBtnPage_SetMinAndMax,
- _T("&Min and max"),
+ wxT("&Min and max"),
SpinBtnPage_MinText,
&m_textMin);
m_textMax = new wxTextCtrl(this, SpinBtnPage_MaxText, wxEmptyString);
sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5);
- m_textMin->SetValue( wxString::Format(_T("%d"), m_min) );
- m_textMax->SetValue( wxString::Format(_T("%d"), m_max) );
+ m_textMin->SetValue( wxString::Format(wxT("%d"), m_min) );
+ m_textMax->SetValue( wxString::Format(wxT("%d"), m_max) );
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
switch ( m_radioAlign->GetSelection() )
{
default:
- wxFAIL_MSG(_T("unexpected radiobox selection"));
+ wxFAIL_MSG(wxT("unexpected radiobox selection"));
// fall through
case Align_Left:
m_spinbtn->SetRange(m_min, m_max);
m_spinctrl = new wxSpinCtrl(this, SpinBtnPage_SpinCtrl,
- wxString::Format(_T("%d"), val),
+ wxString::Format(wxT("%d"), val),
wxDefaultPosition, wxDefaultSize,
flags | textFlags,
m_min, m_max, val);
m_spinctrldbl = new wxSpinCtrlDouble(this, SpinBtnPage_SpinCtrlDouble,
- wxString::Format(_T("%d"), val),
+ wxString::Format(wxT("%d"), val),
wxDefaultPosition, wxDefaultSize,
flags | textFlags,
m_min, m_max, val, 0.1);
!m_textMax->GetValue().ToLong(&maxNew) ||
minNew > maxNew )
{
- wxLogWarning(_T("Invalid min/max values for the spinbtn."));
+ wxLogWarning(wxT("Invalid min/max values for the spinbtn."));
return;
}
long val;
if ( !m_textValue->GetValue().ToLong(&val) || !IsValidValue(val) )
{
- wxLogWarning(_T("Invalid spinbtn value."));
+ wxLogWarning(wxT("Invalid spinbtn value."));
return;
}
void SpinBtnWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event)
{
- event.SetText( wxString::Format(_T("%d"), m_spinbtn->GetValue()));
+ event.SetText( wxString::Format(wxT("%d"), m_spinbtn->GetValue()));
}
void SpinBtnWidgetsPage::OnSpinBtn(wxSpinEvent& event)
int value = event.GetInt();
wxASSERT_MSG( value == m_spinbtn->GetValue(),
- _T("spinbtn value should be the same") );
+ wxT("spinbtn value should be the same") );
- wxLogMessage(_T("Spin button value changed, now %d"), value);
+ wxLogMessage(wxT("Spin button value changed, now %d"), value);
}
void SpinBtnWidgetsPage::OnSpinBtnUp(wxSpinEvent& event)
{
- wxLogMessage( _T("Spin button value incremented, will be %d (was %d)"),
+ wxLogMessage( wxT("Spin button value incremented, will be %d (was %d)"),
event.GetInt(), m_spinbtn->GetValue() );
}
void SpinBtnWidgetsPage::OnSpinBtnDown(wxSpinEvent& event)
{
- wxLogMessage( _T("Spin button value decremented, will be %d (was %d)"),
+ wxLogMessage( wxT("Spin button value decremented, will be %d (was %d)"),
event.GetInt(), m_spinbtn->GetValue() );
}
int value = event.GetInt();
wxASSERT_MSG( value == m_spinctrl->GetValue(),
- _T("spinctrl value should be the same") );
+ wxT("spinctrl value should be the same") );
- wxLogMessage(_T("Spin control value changed, now %d"), value);
+ wxLogMessage(wxT("Spin control value changed, now %d"), value);
}
void SpinBtnWidgetsPage::OnSpinCtrlDouble(wxSpinDoubleEvent& event)
{
double value = event.GetValue();
- wxLogMessage(_T("Spin control value changed, now %g"), value);
+ wxLogMessage(wxT("Spin control value changed, now %g"), value);
}
void SpinBtnWidgetsPage::OnSpinText(wxCommandEvent& event)
{
- wxLogMessage(_T("Text changed in spin control, now \"%s\""),
+ wxLogMessage(wxT("Text changed in spin control, now \"%s\""),
event.GetString().c_str());
}
// implementation
// ============================================================================
-IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static"),
+IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, wxT("Static"),
(int)wxPlatform(GENERIC_CTRLS).If(wxOS_WINDOWS,NATIVE_CTRLS)
);
static const wxString halign[] =
{
- _T("left"),
- _T("centre"),
- _T("right"),
+ wxT("left"),
+ wxT("centre"),
+ wxT("right"),
};
static const wxString valign[] =
{
- _T("top"),
- _T("centre"),
- _T("bottom"),
+ wxT("top"),
+ wxT("centre"),
+ wxT("bottom"),
};
- m_radioHAlign = new wxRadioBox(this, wxID_ANY, _T("&Horz alignment"),
+ m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(halign), halign, 3);
- m_radioVAlign = new wxRadioBox(this, wxID_ANY, _T("&Vert alignment"),
+ m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(valign), valign, 3);
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
- m_chkEllipsize = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Ellipsize"));
+ m_chkEllipsize = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Ellipsize"));
static const wxString ellipsizeMode[] =
{
- _T("&start"),
- _T("&middle"),
- _T("&end"),
+ wxT("&start"),
+ wxT("&middle"),
+ wxT("&end"),
};
- m_radioEllipsize = new wxRadioBox(this, wxID_ANY, _T("&Ellipsize mode"),
+ m_radioEllipsize = new wxRadioBox(this, wxID_ANY, wxT("&Ellipsize mode"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(ellipsizeMode), ellipsizeMode,
3);
sizerLeft->Add(m_radioEllipsize, 0, wxGROW | wxALL, 5);
- wxButton *btn = new wxButton(this, StaticPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, StaticPage_Reset, wxT("&Reset"));
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
// NB: must be done _before_ calling CreateStatic()
Reset();
- m_textBox->SetValue(_T("This is a box"));
- m_textLabel->SetValue(_T("And this is a\n\tlabel inside the box with a &mnemonic.\n")
- _T("Only this text is affected by the ellipsize settings."));
- m_textLabelWithMarkup->SetValue(_T("Another label, this time <b>decorated</b> ")
- _T("with <u>markup</u>; here you need entities ")
- _T("for the symbols: < > & ' " ")
- _T(" but you can still place &mnemonics..."));
+ m_textBox->SetValue(wxT("This is a box"));
+ m_textLabel->SetValue(wxT("And this is a\n\tlabel inside the box with a &mnemonic.\n")
+ wxT("Only this text is affected by the ellipsize settings."));
+ m_textLabelWithMarkup->SetValue(wxT("Another label, this time <b>decorated</b> ")
+ wxT("with <u>markup</u>; here you need entities ")
+ wxT("for the symbols: < > & ' " ")
+ wxT(" but you can still place &mnemonics..."));
// right pane
wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL);
switch ( m_radioHAlign->GetSelection() )
{
default:
- wxFAIL_MSG(_T("unexpected radiobox selection"));
+ wxFAIL_MSG(wxT("unexpected radiobox selection"));
// fall through
case StaticHAlign_Left:
switch ( m_radioVAlign->GetSelection() )
{
default:
- wxFAIL_MSG(_T("unexpected radiobox selection"));
+ wxFAIL_MSG(wxT("unexpected radiobox selection"));
// fall through
case StaticVAlign_Top:
switch ( m_radioEllipsize->GetSelection() )
{
default:
- wxFAIL_MSG(_T("unexpected radiobox selection"));
+ wxFAIL_MSG(wxT("unexpected radiobox selection"));
// fall through
case StaticEllipsize_Start:
switch ( HitTest(event.GetPosition(), &x, &y) )
{
default:
- wxFAIL_MSG( _T("unexpected HitTest() result") );
+ wxFAIL_MSG( wxT("unexpected HitTest() result") );
// fall through
case wxTE_HT_UNKNOWN:
x = y = -1;
- where = _T("nowhere near");
+ where = wxT("nowhere near");
break;
case wxTE_HT_BEFORE:
- where = _T("before");
+ where = wxT("before");
break;
case wxTE_HT_BELOW:
- where = _T("below");
+ where = wxT("below");
break;
case wxTE_HT_BEYOND:
- where = _T("beyond");
+ where = wxT("beyond");
break;
case wxTE_HT_ON_TEXT:
- where = _T("at");
+ where = wxT("at");
break;
}
- wxLogMessage(_T("Mouse is %s (%ld, %ld)"), where.c_str(), x, y);
+ wxLogMessage(wxT("Mouse is %s (%ld, %ld)"), where.c_str(), x, y);
event.Skip();
}
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
-IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, _T("Text"),
+IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, wxT("Text"),
FAMILY_CTRLS | EDITABLE_CTRLS
);
// left pane
static const wxString modes[] =
{
- _T("single line"),
- _T("multi line"),
+ wxT("single line"),
+ wxT("multi line"),
};
- wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set textctrl parameters"));
- m_radioTextLines = new wxRadioBox(this, wxID_ANY, _T("&Number of lines:"),
+ wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set textctrl parameters"));
+ m_radioTextLines = new wxRadioBox(this, wxID_ANY, wxT("&Number of lines:"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(modes), modes,
1, wxRA_SPECIFY_COLS);
sizerLeft->AddSpacer(5);
m_chkPassword = CreateCheckBoxAndAddToSizer(
- sizerLeft, _T("&Password control"), TextPage_Password
+ sizerLeft, wxT("&Password control"), TextPage_Password
);
m_chkReadonly = CreateCheckBoxAndAddToSizer(
- sizerLeft, _T("&Read-only mode")
+ sizerLeft, wxT("&Read-only mode")
);
m_chkFilename = CreateCheckBoxAndAddToSizer(
- sizerLeft, _T("&Filename control")
+ sizerLeft, wxT("&Filename control")
);
m_chkFilename->Disable(); // not implemented yet
sizerLeft->AddSpacer(5);
static const wxString wrap[] =
{
- _T("no wrap"),
- _T("word wrap"),
- _T("char wrap"),
- _T("best wrap"),
+ wxT("no wrap"),
+ wxT("word wrap"),
+ wxT("char wrap"),
+ wxT("best wrap"),
};
- m_radioWrap = new wxRadioBox(this, wxID_ANY, _T("&Wrap style:"),
+ m_radioWrap = new wxRadioBox(this, wxID_ANY, wxT("&Wrap style:"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(wrap), wrap,
1, wxRA_SPECIFY_COLS);
#ifdef __WXMSW__
static const wxString kinds[] =
{
- _T("plain edit"),
- _T("rich edit"),
- _T("rich edit 2.0"),
+ wxT("plain edit"),
+ wxT("rich edit"),
+ wxT("rich edit 2.0"),
};
- m_radioKind = new wxRadioBox(this, wxID_ANY, _T("Control &kind"),
+ m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Control &kind"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(kinds), kinds,
1, wxRA_SPECIFY_COLS);
sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5);
#endif // __WXMSW__
- wxButton *btn = new wxButton(this, TextPage_Reset, _T("&Reset"));
+ wxButton *btn = new wxButton(this, TextPage_Reset, wxT("&Reset"));
sizerLeft->Add(2, 2, 0, wxGROW | wxALL, 1); // spacer
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
- wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Change contents:"));
+ wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change contents:"));
wxSizer *sizerMiddleUp = new wxStaticBoxSizer(box2, wxVERTICAL);
- btn = new wxButton(this, TextPage_Set, _T("&Set text value"));
+ btn = new wxButton(this, TextPage_Set, wxT("&Set text value"));
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
- btn = new wxButton(this, TextPage_Add, _T("&Append text"));
+ btn = new wxButton(this, TextPage_Add, wxT("&Append text"));
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
- btn = new wxButton(this, TextPage_Insert, _T("&Insert text"));
+ btn = new wxButton(this, TextPage_Insert, wxT("&Insert text"));
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
- btn = new wxButton(this, TextPage_Load, _T("&Load file"));
+ btn = new wxButton(this, TextPage_Load, wxT("&Load file"));
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
- btn = new wxButton(this, TextPage_Clear, _T("&Clear"));
+ btn = new wxButton(this, TextPage_Clear, wxT("&Clear"));
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
- btn = new wxButton(this, TextPage_StreamRedirector, _T("St&ream redirection"));
+ btn = new wxButton(this, TextPage_StreamRedirector, wxT("St&ream redirection"));
sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1);
- wxStaticBox *box4 = new wxStaticBox(this, wxID_ANY, _T("&Info:"));
+ wxStaticBox *box4 = new wxStaticBox(this, wxID_ANY, wxT("&Info:"));
wxSizer *sizerMiddleDown = new wxStaticBoxSizer(box4, wxVERTICAL);
m_textPosCur = CreateInfoText();
wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL);
sizerRow->Add(CreateTextWithLabelSizer
(
- _T("Current pos:"),
+ wxT("Current pos:"),
m_textPosCur
),
0, wxRIGHT, 5);
sizerRow->Add(CreateTextWithLabelSizer
(
- _T("Col:"),
+ wxT("Col:"),
m_textColCur
),
0, wxLEFT | wxRIGHT, 5);
sizerRow->Add(CreateTextWithLabelSizer
(
- _T("Row:"),
+ wxT("Row:"),
m_textRowCur
),
0, wxLEFT, 5);
(
CreateTextWithLabelSizer
(
- _T("Number of lines:"),
+ wxT("Number of lines:"),
m_textLineLast,
- _T("Last position:"),
+ wxT("Last position:"),
m_textPosLast
),
0, wxALL, 5
(
CreateTextWithLabelSizer
(
- _T("Selection: from"),
+ wxT("Selection: from"),
m_textSelFrom,
- _T("to"),
+ wxT("to"),
m_textSelTo
),
0, wxALL, 5
(
CreateTextWithLabelSizer
(
- _T("Range 10..20:"),
+ wxT("Range 10..20:"),
m_textRange
),
0, wxALL, 5
sizerMiddle->Add(sizerMiddleDown, 1, wxGROW | wxTOP, 5);
// right pane
- wxStaticBox *box3 = new wxStaticBox(this, wxID_ANY, _T("&Text:"));
+ wxStaticBox *box3 = new wxStaticBox(this, wxID_ANY, wxT("&Text:"));
m_sizerText = new wxStaticBoxSizer(box3, wxHORIZONTAL);
Reset();
CreateText();
if ( !s_maxWidth )
{
// calc it once only
- GetTextExtent(_T("9999999"), &s_maxWidth, NULL);
+ GetTextExtent(wxT("9999999"), &s_maxWidth, NULL);
}
wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
switch ( m_radioTextLines->GetSelection() )
{
default:
- wxFAIL_MSG( _T("unexpected lines radio box selection") );
+ wxFAIL_MSG( wxT("unexpected lines radio box selection") );
case TextLines_Single:
break;
switch ( m_radioWrap->GetSelection() )
{
default:
- wxFAIL_MSG( _T("unexpected wrap style radio box selection") );
+ wxFAIL_MSG( wxT("unexpected wrap style radio box selection") );
case WrapStyle_None:
flags |= wxTE_DONTWRAP; // same as wxHSCROLL
switch ( m_radioKind->GetSelection() )
{
default:
- wxFAIL_MSG( _T("unexpected kind radio box selection") );
+ wxFAIL_MSG( wxT("unexpected kind radio box selection") );
case TextKind_Plain:
break;
}
else
{
- valueOld = _T("Hello, Universe!");
+ valueOld = wxT("Hello, Universe!");
}
m_text = new WidgetsTextCtrl(this, TextPage_Textctrl, valueOld, flags);
if ( m_textLineLast )
{
m_textLineLast->SetValue(
- wxString::Format(_T("%d"), m_text->GetNumberOfLines()) );
+ wxString::Format(wxT("%d"), m_text->GetNumberOfLines()) );
}
if ( m_textSelFrom && m_textSelTo )
void TextWidgetsPage::OnButtonSet(wxCommandEvent& WXUNUSED(event))
{
m_text->SetValue(m_text->GetWindowStyle() & wxTE_MULTILINE
- ? _T("Here,\nthere and\neverywhere")
- : _T("Yellow submarine"));
+ ? wxT("Here,\nthere and\neverywhere")
+ : wxT("Yellow submarine"));
m_text->SetFocus();
}
{
if ( m_text->GetWindowStyle() & wxTE_MULTILINE )
{
- m_text->AppendText(_T("We all live in a\n"));
+ m_text->AppendText(wxT("We all live in a\n"));
}
- m_text->AppendText(_T("Yellow submarine"));
+ m_text->AppendText(wxT("Yellow submarine"));
}
void TextWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event))
{
- m_text->WriteText(_T("Is there anybody going to listen to my story"));
+ m_text->WriteText(wxT("Is there anybody going to listen to my story"));
if ( m_text->GetWindowStyle() & wxTE_MULTILINE )
{
- m_text->WriteText(_T("\nall about the girl who came to stay"));
+ m_text->WriteText(wxT("\nall about the girl who came to stay"));
}
}
{
// search for the file in several dirs where it's likely to be
wxPathList pathlist;
- pathlist.Add(_T("."));
- pathlist.Add(_T(".."));
- pathlist.Add(_T("../../../samples/widgets"));
+ pathlist.Add(wxT("."));
+ pathlist.Add(wxT(".."));
+ pathlist.Add(wxT("../../../samples/widgets"));
- wxString filename = pathlist.FindValidPath(_T("textctrl.cpp"));
+ wxString filename = pathlist.FindValidPath(wxT("textctrl.cpp"));
if ( !filename )
{
- wxLogError(_T("File textctrl.cpp not found."));
+ wxLogError(wxT("File textctrl.cpp not found."));
}
else // load it
{
if ( !m_text->LoadFile(filename) )
{
// this is not supposed to happen ...
- wxLogError(_T("Error loading file."));
+ wxLogError(wxT("Error loading file."));
}
else
{
long elapsed = sw.Time();
- wxLogMessage(_T("Loaded file '%s' in %lu.%us"),
+ wxLogMessage(wxT("Loaded file '%s' in %lu.%us"),
filename.c_str(), elapsed / 1000,
(unsigned int) elapsed % 1000);
}
return;
}
- wxLogMessage(_T("Text ctrl value changed"));
+ wxLogMessage(wxT("Text ctrl value changed"));
}
void TextWidgetsPage::OnTextEnter(wxCommandEvent& event)
{
- wxLogMessage(_T("Text entered: '%s'"), event.GetString().c_str());
+ wxLogMessage(wxT("Text entered: '%s'"), event.GetString().c_str());
event.Skip();
}
{
#if wxHAS_TEXT_WINDOW_STREAM
wxStreamToTextRedirector redirect(m_text);
- wxString str( _T("Outputed to cout, appears in wxTextCtrl!") );
+ wxString str( wxT("Outputed to cout, appears in wxTextCtrl!") );
wxSTD cout << str << wxSTD endl;
#else
- wxMessageBox(_T("This wxWidgets build does not support wxStreamToTextRedirector"));
+ wxMessageBox(wxT("This wxWidgets build does not support wxStreamToTextRedirector"));
#endif
}
// wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
// middle pane
- wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Operations"));
+ wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations"));
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow = CreateSizerWithTextAndButton(TogglePage_ChangeLabel,
- _T("Change label"),
+ wxT("Change label"),
wxID_ANY,
&m_textLabel);
- m_textLabel->SetValue(_T("&Toggle me!"));
+ m_textLabel->SetValue(wxT("&Toggle me!"));
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
// this sample side by side and it is useful to see which one is which
wxString title;
#if defined(__WXUNIVERSAL__)
- title = _T("wxUniv/");
+ title = wxT("wxUniv/");
#endif
#if defined(__WXMSW__)
- title += _T("wxMSW");
+ title += wxT("wxMSW");
#elif defined(__WXGTK__)
- title += _T("wxGTK");
+ title += wxT("wxGTK");
#elif defined(__WXMAC__)
- title += _T("wxMAC");
+ title += wxT("wxMAC");
#elif defined(__WXMOTIF__)
- title += _T("wxMOTIF");
+ title += wxT("wxMOTIF");
#elif __WXPALMOS5__
- title += _T("wxPALMOS5");
+ title += wxT("wxPALMOS5");
#elif __WXPALMOS6__
- title += _T("wxPALMOS6");
+ title += wxT("wxPALMOS6");
#else
- title += _T("wxWidgets");
+ title += wxT("wxWidgets");
#endif
- wxFrame *frame = new WidgetsFrame(title + _T(" widgets demo"));
+ wxFrame *frame = new WidgetsFrame(title + wxT(" widgets demo"));
frame->Show();
return true;
wxMenuBar *mbar = new wxMenuBar;
wxMenu *menuWidget = new wxMenu;
#if wxUSE_TOOLTIPS
- menuWidget->Append(Widgets_SetTooltip, _T("Set &tooltip...\tCtrl-T"));
+ menuWidget->Append(Widgets_SetTooltip, wxT("Set &tooltip...\tCtrl-T"));
menuWidget->AppendSeparator();
#endif // wxUSE_TOOLTIPS
- menuWidget->Append(Widgets_SetFgColour, _T("Set &foreground...\tCtrl-F"));
- menuWidget->Append(Widgets_SetBgColour, _T("Set &background...\tCtrl-B"));
- menuWidget->Append(Widgets_SetFont, _T("Set f&ont...\tCtrl-O"));
- menuWidget->AppendCheckItem(Widgets_Enable, _T("&Enable/disable\tCtrl-E"));
+ menuWidget->Append(Widgets_SetFgColour, wxT("Set &foreground...\tCtrl-F"));
+ menuWidget->Append(Widgets_SetBgColour, wxT("Set &background...\tCtrl-B"));
+ menuWidget->Append(Widgets_SetFont, wxT("Set f&ont...\tCtrl-O"));
+ menuWidget->AppendCheckItem(Widgets_Enable, wxT("&Enable/disable\tCtrl-E"));
wxMenu *menuBorders = new wxMenu;
- menuBorders->AppendRadioItem(Widgets_BorderDefault, _T("De&fault\tCtrl-Shift-9"));
- menuBorders->AppendRadioItem(Widgets_BorderNone, _T("&None\tCtrl-Shift-0"));
- menuBorders->AppendRadioItem(Widgets_BorderSimple, _T("&Simple\tCtrl-Shift-1"));
- menuBorders->AppendRadioItem(Widgets_BorderDouble, _T("&Double\tCtrl-Shift-2"));
- menuBorders->AppendRadioItem(Widgets_BorderStatic, _T("Stati&c\tCtrl-Shift-3"));
- menuBorders->AppendRadioItem(Widgets_BorderRaised, _T("&Raised\tCtrl-Shift-4"));
- menuBorders->AppendRadioItem(Widgets_BorderSunken, _T("S&unken\tCtrl-Shift-5"));
- menuWidget->AppendSubMenu(menuBorders, _T("Set &border"));
+ menuBorders->AppendRadioItem(Widgets_BorderDefault, wxT("De&fault\tCtrl-Shift-9"));
+ menuBorders->AppendRadioItem(Widgets_BorderNone, wxT("&None\tCtrl-Shift-0"));
+ menuBorders->AppendRadioItem(Widgets_BorderSimple, wxT("&Simple\tCtrl-Shift-1"));
+ menuBorders->AppendRadioItem(Widgets_BorderDouble, wxT("&Double\tCtrl-Shift-2"));
+ menuBorders->AppendRadioItem(Widgets_BorderStatic, wxT("Stati&c\tCtrl-Shift-3"));
+ menuBorders->AppendRadioItem(Widgets_BorderRaised, wxT("&Raised\tCtrl-Shift-4"));
+ menuBorders->AppendRadioItem(Widgets_BorderSunken, wxT("S&unken\tCtrl-Shift-5"));
+ menuWidget->AppendSubMenu(menuBorders, wxT("Set &border"));
menuWidget->AppendSeparator();
menuWidget->AppendCheckItem(Widgets_GlobalBusyCursor,
- _T("Toggle &global busy cursor\tCtrl-Shift-U"));
+ wxT("Toggle &global busy cursor\tCtrl-Shift-U"));
menuWidget->AppendCheckItem(Widgets_BusyCursor,
- _T("Toggle b&usy cursor\tCtrl-U"));
+ wxT("Toggle b&usy cursor\tCtrl-U"));
menuWidget->AppendSeparator();
- menuWidget->Append(wxID_EXIT, _T("&Quit\tCtrl-Q"));
- mbar->Append(menuWidget, _T("&Widget"));
+ menuWidget->Append(wxID_EXIT, wxT("&Quit\tCtrl-Q"));
+ mbar->Append(menuWidget, wxT("&Widget"));
wxMenu *menuTextEntry = new wxMenu;
menuTextEntry->AppendRadioItem(TextEntry_DisableAutoComplete,
- _T("&Disable auto-completion"));
+ wxT("&Disable auto-completion"));
menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteFixed,
- _T("Fixed-&list auto-completion"));
+ wxT("Fixed-&list auto-completion"));
menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteFilenames,
- _T("&Files names auto-completion"));
+ wxT("&Files names auto-completion"));
menuTextEntry->AppendSeparator();
menuTextEntry->Append(TextEntry_SetHint, "Set help &hint");
- mbar->Append(menuTextEntry, _T("&Text"));
+ mbar->Append(menuTextEntry, wxT("&Text"));
SetMenuBar(mbar);
// the lower one only has the log listbox and a button to clear it
#if USE_LOG
wxSizer *sizerDown = new wxStaticBoxSizer(
- new wxStaticBox( m_panel, wxID_ANY, _T("&Log window") ),
+ new wxStaticBox( m_panel, wxID_ANY, wxT("&Log window") ),
wxVERTICAL);
m_lboxLog = new wxListBox(m_panel, wxID_ANY);
wxBoxSizer *sizerBtns = new wxBoxSizer(wxHORIZONTAL);
wxButton *btn;
#if USE_LOG
- btn = new wxButton(m_panel, Widgets_ClearLog, _T("Clear &log"));
+ btn = new wxButton(m_panel, Widgets_ClearLog, wxT("Clear &log"));
sizerBtns->Add(btn);
sizerBtns->Add(10, 0); // spacer
#endif // USE_LOG
- btn = new wxButton(m_panel, Widgets_Quit, _T("E&xit"));
+ btn = new wxButton(m_panel, Widgets_Quit, wxT("E&xit"));
sizerBtns->Add(btn);
sizerDown->Add(sizerBtns, 0, wxALL | wxALIGN_RIGHT, 5);
}
}
- GetMenuBar()->Append(menuPages, _T("&Page"));
+ GetMenuBar()->Append(menuPages, wxT("&Page"));
#if USE_ICONS_IN_BOOK
m_book->AssignImageList(imageList);
#if !USE_TREEBOOK
WidgetsBookCtrl *subBook = wxStaticCast(page, WidgetsBookCtrl);
- wxCHECK_MSG( subBook, NULL, _T("no WidgetsBookCtrl?") );
+ wxCHECK_MSG( subBook, NULL, wxT("no WidgetsBookCtrl?") );
page = subBook->GetCurrentPage();
#endif // !USE_TREEBOOK
void WidgetsFrame::OnSetTooltip(wxCommandEvent& WXUNUSED(event))
{
- static wxString s_tip = _T("This is a tooltip");
+ static wxString s_tip = wxT("This is a tooltip");
wxTextEntryDialog dialog
(
this,
- _T("Tooltip text (may use \\n, leave empty to remove): "),
- _T("Widgets sample"),
+ wxT("Tooltip text (may use \\n, leave empty to remove): "),
+ wxT("Widgets sample"),
s_tip
);
return;
s_tip = dialog.GetValue();
- s_tip.Replace(_T("\\n"), _T("\n"));
+ s_tip.Replace(wxT("\\n"), wxT("\n"));
WidgetsPage *page = CurrentPage();
ctrl2->Refresh();
}
#else
- wxLogMessage(_T("Colour selection dialog not available in current build."));
+ wxLogMessage(wxT("Colour selection dialog not available in current build."));
#endif
}
ctrl2->Refresh();
}
#else
- wxLogMessage(_T("Colour selection dialog not available in current build."));
+ wxLogMessage(wxT("Colour selection dialog not available in current build."));
#endif
}
ctrl2->Refresh();
}
#else
- wxLogMessage(_T("Font selection dialog not available in current build."));
+ wxLogMessage(wxT("Font selection dialog not available in current build."));
#endif
}
case Widgets_BorderDouble: border = wxBORDER_DOUBLE; break;
default:
- wxFAIL_MSG( _T("unknown border style") );
+ wxFAIL_MSG( wxT("unknown border style") );
// fall through
case Widgets_BorderDefault: border = wxBORDER_DEFAULT; break;
{
m_bitmap = wxBitmap(wiztest2_xpm);
- m_checkbox = new wxCheckBox(this, wxID_ANY, _T("&Check me"));
+ m_checkbox = new wxCheckBox(this, wxID_ANY, wxT("&Check me"));
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
mainSizer->Add(
new wxStaticText(this, wxID_ANY,
- _T("You need to check the checkbox\n")
- _T("below before going to the next page\n")),
+ wxT("You need to check the checkbox\n")
+ wxT("below before going to the next page\n")),
0,
wxALL,
5
{
if ( !m_checkbox->GetValue() )
{
- wxMessageBox(_T("Check the checkbox first!"), _T("No way"),
+ wxMessageBox(wxT("Check the checkbox first!"), wxT("No way"),
wxICON_WARNING | wxOK, this);
return false;
// static wxString choices[] = { "forward", "backward", "both", "neither" };
// The above syntax can cause an internal compiler error with gcc.
wxString choices[4];
- choices[0] = _T("forward");
- choices[1] = _T("backward");
- choices[2] = _T("both");
- choices[3] = _T("neither");
+ choices[0] = wxT("forward");
+ choices[1] = wxT("backward");
+ choices[2] = wxT("both");
+ choices[3] = wxT("neither");
- m_radio = new wxRadioBox(this, wxID_ANY, _T("Allow to proceed:"),
+ m_radio = new wxRadioBox(this, wxID_ANY, wxT("Allow to proceed:"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(choices), choices,
1, wxRA_SPECIFY_COLS);
// wizard event handlers
void OnWizardCancel(wxWizardEvent& event)
{
- if ( wxMessageBox(_T("Do you really want to cancel?"), _T("Question"),
+ if ( wxMessageBox(wxT("Do you really want to cancel?"), wxT("Question"),
wxICON_QUESTION | wxYES_NO, this) != wxYES )
{
// not confirmed
if ( !event.GetDirection() && sel == Backward )
return;
- wxMessageBox(_T("You can't go there"), _T("Not allowed"),
+ wxMessageBox(wxT("You can't go there"), wxT("Not allowed"),
wxICON_WARNING | wxOK, this);
event.Veto();
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
mainSizer->Add(
- new wxStaticText(this, wxID_ANY, _T("Try checking the box below and\n")
- _T("then going back and clearing it")),
+ new wxStaticText(this, wxID_ANY, wxT("Try checking the box below and\n")
+ wxT("then going back and clearing it")),
0, // No vertical stretching
wxALL,
5 // Border width
);
- m_checkbox = new wxCheckBox(this, wxID_ANY, _T("&Skip the next page"));
+ m_checkbox = new wxCheckBox(this, wxID_ANY, wxT("&Skip the next page"));
mainSizer->Add(
m_checkbox,
0, // No vertical stretching
#if wxUSE_CHECKLISTBOX
static const wxChar *aszChoices[] =
{
- _T("Zeroth"),
- _T("First"),
- _T("Second"),
- _T("Third"),
- _T("Fourth"),
- _T("Fifth"),
- _T("Sixth"),
- _T("Seventh"),
- _T("Eighth"),
- _T("Nineth")
+ wxT("Zeroth"),
+ wxT("First"),
+ wxT("Second"),
+ wxT("Third"),
+ wxT("Fourth"),
+ wxT("Fifth"),
+ wxT("Sixth"),
+ wxT("Seventh"),
+ wxT("Eighth"),
+ wxT("Nineth")
};
m_checklistbox = new wxCheckListBox
if ( !wxApp::OnInit() )
return false;
- MyFrame *frame = new MyFrame(_T("wxWizard Sample"));
+ MyFrame *frame = new MyFrame(wxT("wxWizard Sample"));
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
// ----------------------------------------------------------------------------
MyWizard::MyWizard(wxFrame *frame, bool useSizer)
- : wxWizard(frame,wxID_ANY,_T("Absolutely Useless Wizard"),
+ : wxWizard(frame,wxID_ANY,wxT("Absolutely Useless Wizard"),
wxBitmap(wiztest_xpm),wxDefaultPosition,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
m_page1 = new wxWizardPageSimple(this);
/* wxStaticText *text = */ new wxStaticText(m_page1, wxID_ANY,
- _T("This wizard doesn't help you\nto do anything at all.\n")
- _T("\n")
- _T("The next pages will present you\nwith more useless controls."),
+ wxT("This wizard doesn't help you\nto do anything at all.\n")
+ wxT("\n")
+ wxT("The next pages will present you\nwith more useless controls."),
wxPoint(5,5)
);
wxDefaultPosition, wxSize(250, 150)) // small frame
{
wxMenu *menuFile = new wxMenu;
- menuFile->Append(Wizard_RunModal, _T("&Run wizard modal...\tCtrl-R"));
- menuFile->Append(Wizard_RunNoSizer, _T("Run wizard &without sizer..."));
- menuFile->Append(Wizard_RunModeless, _T("Run wizard &modeless..."));
+ menuFile->Append(Wizard_RunModal, wxT("&Run wizard modal...\tCtrl-R"));
+ menuFile->Append(Wizard_RunNoSizer, wxT("Run wizard &without sizer..."));
+ menuFile->Append(Wizard_RunModeless, wxT("Run wizard &modeless..."));
menuFile->AppendSeparator();
- menuFile->Append(Wizard_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(Wizard_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
wxMenu *menuOptions = new wxMenu;
- menuOptions->AppendCheckItem(Wizard_LargeWizard, _T("&Scroll Wizard Pages"));
- menuOptions->AppendCheckItem(Wizard_ExpandBitmap, _T("Si&ze Bitmap To Page"));
+ menuOptions->AppendCheckItem(Wizard_LargeWizard, wxT("&Scroll Wizard Pages"));
+ menuOptions->AppendCheckItem(Wizard_ExpandBitmap, wxT("Si&ze Bitmap To Page"));
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(Wizard_About, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(Wizard_About, wxT("&About...\tF1"), wxT("Show about dialog"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(menuOptions, _T("&Options"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(menuOptions, wxT("&Options"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_T("Demo of wxWizard class\n")
- _T("(c) 1999, 2000 Vadim Zeitlin"),
- _T("About wxWizard sample"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(wxT("Demo of wxWizard class\n")
+ wxT("(c) 1999, 2000 Vadim Zeitlin"),
+ wxT("About wxWizard sample"), wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnRunWizard(wxCommandEvent& WXUNUSED(event))
{
if ( wxXmlResource::Get()->Unload(wxT("rc/basicdlg.xrc")) )
{
- wxLogMessage(_T("Basic dialog resource has now been unloaded, you ")
- _T("won't be able to use it before loading it again"));
+ wxLogMessage(wxT("Basic dialog resource has now been unloaded, you ")
+ wxT("won't be able to use it before loading it again"));
}
else
{
- wxLogWarning(_T("Failed to unload basic dialog resource"));
+ wxLogWarning(wxT("Failed to unload basic dialog resource"));
}
}
{
if ( wxXmlResource::Get()->Load(wxT("rc/basicdlg.xrc")) )
{
- wxLogStatus(_T("Basic dialog resource has been loaded."));
+ wxLogStatus(wxT("Basic dialog resource has been loaded."));
}
else
{
- wxLogError(_T("Failed to load basic dialog resource"));
+ wxLogError(wxT("Failed to load basic dialog resource"));
}
}
void MyFrame::OnAboutToolOrMenuCommand(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
- msg.Printf( _T("This is the about dialog of XML resources demo.\n")
- _T("Welcome to %s"), wxVERSION_STRING);
+ msg.Printf( wxT("This is the about dialog of XML resources demo.\n")
+ wxT("Welcome to %s"), wxVERSION_STRING);
wxMessageBox(msg, _("About XML resources demo"), wxOK | wxICON_INFORMATION, this);
}
void wxAuiNotebook::SetSelectionToWindow(wxWindow *win)
{
const int idx = m_tabs.GetIdxFromWindow(win);
- wxCHECK_RET( idx != wxNOT_FOUND, _T("invalid notebook page") );
+ wxCHECK_RET( idx != wxNOT_FOUND, wxT("invalid notebook page") );
// since a tab was clicked, let the parent know that we received
wxAuiTabCtrl* src_tabs = (wxAuiTabCtrl*)evt.GetEventObject();
- wxCHECK_RET( src_tabs, _T("no source object?") );
+ wxCHECK_RET( src_tabs, wxT("no source object?") );
src_tabs->SetCursor(wxCursor(wxCURSOR_ARROW));
// get main index of the page
int main_idx = m_tabs.GetIdxFromWindow(src_page);
- wxCHECK_RET( main_idx != wxNOT_FOUND, _T("no source page?") );
+ wxCHECK_RET( main_idx != wxNOT_FOUND, wxT("no source page?") );
// make a copy of the page info
#endif
{
int main_idx = m_tabs.GetIdxFromWindow(close_wnd);
- wxCHECK_RET( main_idx != wxNOT_FOUND, _T("no page to delete?") );
+ wxCHECK_RET( main_idx != wxNOT_FOUND, wxT("no page to delete?") );
DeletePage(main_idx);
}
// application (otherwise applications would need to handle it)
if ( argc > 1 )
{
- static const wxChar *ARG_PSN = _T("-psn_");
+ static const wxChar *ARG_PSN = wxT("-psn_");
if ( wxStrncmp(argv[1], ARG_PSN, wxStrlen(ARG_PSN)) == 0 )
{
// remove this argument
if([bitmapRep bitsPerPixel]!=bpp)
{
- wxFAIL_MSG( _T("incorrect bitmap type in wxBitmap::GetRawData()") );
+ wxFAIL_MSG( wxT("incorrect bitmap type in wxBitmap::GetRawData()") );
return NULL;
}
data.m_width = [bitmapRep pixelsWide];
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->GetColour();
}
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->GetStyle();
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), 0, wxT("invalid brush") );
return M_BRUSHDATA->GetStipple();
}
int wxGUIEventLoop::Run()
{
// event loops are not recursive, you need to create another loop!
- wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") );
+ wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") );
wxEventLoopActivator activate(this);
void wxGUIEventLoop::Exit(int rc)
{
- wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") );
+ wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") );
m_exitcode = rc;
{
// This check is required by wxGTK but probably not really for wxCocoa
// Keep it here to encourage developers to write cross-platform code
- wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") );
+ wxCHECK_MSG( IsRunning(), false, wxT("can't call Dispatch() if not running") );
NSApplication *cocoaApp = [NSApplication sharedApplication];
// Block to retrieve an event then send it
if(NSEvent *event = [cocoaApp
paths.Empty();
wxString dir(m_dir);
- if ( m_dir.Last() != _T('\\') )
- dir += _T('\\');
+ if ( m_dir.Last() != wxT('\\') )
+ dir += wxT('\\');
size_t count = m_fileNames.GetCount();
for ( size_t n = 0; n < count; n++ )
wxString ext;
wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
if ( !ext.empty() )
- m_fileName << _T('.') << ext;
+ m_fileName << wxT('.') << ext;
}
int wxFileDialog::ShowModal()
{
// this must be a mistake, chances that this is a valid name of another
// key are vanishingly small
- wxLogDebug(_T("Invalid key string \"%s\""), str.c_str());
+ wxLogDebug(wxT("Invalid key string \"%s\""), str.c_str());
return 0;
}
}
- wxASSERT_MSG( keyCode, _T("logic error: should have key code here") );
+ wxASSERT_MSG( keyCode, wxT("logic error: should have key code here") );
if ( flagsOut )
*flagsOut = accelFlags;
{
m_traits = CreateTraits();
- wxASSERT_MSG( m_traits, _T("wxApp::CreateTraits() failed?") );
+ wxASSERT_MSG( m_traits, wxT("wxApp::CreateTraits() failed?") );
}
return m_traits;
wxString progName = wxString::FromAscii(componentName);
wxString msg;
- msg.Printf(_T("Mismatch between the program and library build versions detected.\nThe library used %s,\nand %s used %s."),
+ msg.Printf(wxT("Mismatch between the program and library build versions detected.\nThe library used %s,\nand %s used %s."),
lib.c_str(), progName.c_str(), prog.c_str());
wxLogFatalError(msg.c_str());
const wxString stackTrace = GetAssertStackTrace();
if ( !stackTrace.empty() )
- msg << _T("\n\nCall stack:\n") << stackTrace;
+ msg << wxT("\n\nCall stack:\n") << stackTrace;
#endif // wxUSE_STACKWALKER
return DoShowAssertDialog(msg);
{
m_stackTrace << wxString::Format
(
- _T("[%02d] "),
+ wxT("[%02d] "),
wx_truncate_cast(int, frame.GetLevel())
);
wxString name = frame.GetName();
if ( !name.empty() )
{
- m_stackTrace << wxString::Format(_T("%-40s"), name.c_str());
+ m_stackTrace << wxString::Format(wxT("%-40s"), name.c_str());
}
else
{
- m_stackTrace << wxString::Format(_T("%p"), frame.GetAddress());
+ m_stackTrace << wxString::Format(wxT("%p"), frame.GetAddress());
}
if ( frame.HasSourceLocation() )
{
- m_stackTrace << _T('\t')
+ m_stackTrace << wxT('\t')
<< frame.GetFileName()
- << _T(':')
+ << wxT(':')
<< frame.GetLine();
}
- m_stackTrace << _T('\n');
+ m_stackTrace << wxT('\n');
}
private:
wxT("You can also choose [Cancel] to suppress ")
wxT("further warnings.");
- switch ( ::MessageBox(NULL, msgDlg.wx_str(), _T("wxWidgets Debug Alert"),
+ switch ( ::MessageBox(NULL, msgDlg.wx_str(), wxT("wxWidgets Debug Alert"),
MB_YESNOCANCEL | MB_ICONSTOP ) )
{
case IDYES:
// add the function name, if any
if ( !func.empty() )
- msg << _T(" in ") << func << _T("()");
+ msg << wxT(" in ") << func << wxT("()");
// and the message itself
if ( !msgUser.empty() )
{
- msg << _T(": ") << msgUser;
+ msg << wxT(": ") << msgUser;
}
else // no message given
{
- msg << _T('.');
+ msg << wxT('.');
}
#if wxUSE_THREADS
if ( !s_bNoAsserts )
{
// send it to the normal log destination
- wxLogDebug(_T("%s"), msg.c_str());
+ wxLogDebug(wxT("%s"), msg.c_str());
if ( traits )
{
if ( parser.Found(OPTION_MODE, &modeDesc) )
{
unsigned w, h, bpp;
- if ( wxSscanf(modeDesc.c_str(), _T("%ux%u-%u"), &w, &h, &bpp) != 3 )
+ if ( wxSscanf(modeDesc.c_str(), wxT("%ux%u-%u"), &w, &h, &bpp) != 3 )
{
wxLogError(_("Invalid display mode specification '%s'."), modeDesc.c_str());
return false;
const wxString stackTrace = GetAssertStackTrace();
if ( !stackTrace.empty() )
- msgDlg << _T("\n\nCall stack:\n") << stackTrace;
+ msgDlg << wxT("\n\nCall stack:\n") << stackTrace;
#endif // wxUSE_STACKWALKER
// this message is intentionally not translated -- it is for
wxArtProviderCache::ConstructHashID(const wxArtID& id,
const wxArtClient& client)
{
- return id + _T('-') + client;
+ return id + wxT('-') + client;
}
const wxArtClient& client,
const wxSize& size)
{
- return ConstructHashID(id, client) + _T('-') +
- wxString::Format(_T("%d-%d"), size.x, size.y);
+ return ConstructHashID(id, client) + wxT('-') +
+ wxString::Format(wxT("%d-%d"), size.x, size.y);
}
// ============================================================================
/*static*/ bool wxArtProvider::Pop()
{
- wxCHECK_MSG( sm_providers, false, _T("no wxArtProvider exists") );
- wxCHECK_MSG( !sm_providers->empty(), false, _T("wxArtProviders stack is empty") );
+ wxCHECK_MSG( sm_providers, false, wxT("no wxArtProvider exists") );
+ wxCHECK_MSG( !sm_providers->empty(), false, wxT("wxArtProviders stack is empty") );
delete sm_providers->GetFirst()->GetData();
sm_cache->Clear();
/*static*/ bool wxArtProvider::Remove(wxArtProvider *provider)
{
- wxCHECK_MSG( sm_providers, false, _T("no wxArtProvider exists") );
+ wxCHECK_MSG( sm_providers, false, wxT("no wxArtProvider exists") );
if ( sm_providers->DeleteObject(provider) )
{
const wxSize& size)
{
// safety-check against writing client,id,size instead of id,client,size:
- wxASSERT_MSG( client.Last() == _T('C'), _T("invalid 'client' parameter") );
+ wxASSERT_MSG( client.Last() == wxT('C'), wxT("invalid 'client' parameter") );
- wxCHECK_MSG( sm_providers, wxNullBitmap, _T("no wxArtProvider exists") );
+ wxCHECK_MSG( sm_providers, wxNullBitmap, wxT("no wxArtProvider exists") );
wxString hashId = wxArtProviderCache::ConstructHashID(id, client, size);
wxIconBundle wxArtProvider::DoGetIconBundle(const wxArtID& id, const wxArtClient& client)
{
// safety-check against writing client,id,size instead of id,client,size:
- wxASSERT_MSG( client.Last() == _T('C'), _T("invalid 'client' parameter") );
+ wxASSERT_MSG( client.Last() == wxT('C'), wxT("invalid 'client' parameter") );
- wxCHECK_MSG( sm_providers, wxNullIconBundle, _T("no wxArtProvider exists") );
+ wxCHECK_MSG( sm_providers, wxNullIconBundle, wxT("no wxArtProvider exists") );
wxString hashId = wxArtProviderCache::ConstructHashID(id, client);
switch ( flags & wxICON_MASK )
{
default:
- wxFAIL_MSG(_T("incorrect message box icon flags"));
+ wxFAIL_MSG(wxT("incorrect message box icon flags"));
// fall through
case wxICON_ERROR:
size_t
wxBase64Encode(char *dst, size_t dstLen, const void *src_, size_t srcLen)
{
- wxCHECK_MSG( src_, wxCONV_FAILED, _T("NULL input buffer") );
+ wxCHECK_MSG( src_, wxCONV_FAILED, wxT("NULL input buffer") );
const unsigned char *src = static_cast<const unsigned char *>(src_);
wxBase64DecodeMode mode,
size_t *posErr)
{
- wxCHECK_MSG( src, wxCONV_FAILED, _T("NULL input buffer") );
+ wxCHECK_MSG( src, wxCONV_FAILED, wxT("NULL input buffer") );
unsigned char *dst = static_cast<unsigned char *>(dst_);
size_t *posErr)
{
wxMemoryBuffer buf;
- wxCHECK_MSG( src, buf, _T("NULL input buffer") );
+ wxCHECK_MSG( src, buf, wxT("NULL input buffer") );
if ( srcLen == wxNO_LEN )
srcLen = strlen(src);
*this = wxBitmap(image);
#else
- wxFAIL_MSG(_T("creating bitmaps from XPMs not supported"));
+ wxFAIL_MSG(wxT("creating bitmaps from XPMs not supported"));
#endif // wxUSE_IMAGE && wxUSE_XPM
}
#endif // !(defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__))
switch ( GetWindowStyle() & wxBK_ALIGN_MASK )
{
default:
- wxFAIL_MSG( _T("unexpected alignment") );
+ wxFAIL_MSG( wxT("unexpected alignment") );
// fall through
case wxBK_TOP:
switch ( GetWindowStyle() & wxBK_ALIGN_MASK )
{
default:
- wxFAIL_MSG( _T("unexpected alignment") );
+ wxFAIL_MSG( wxT("unexpected alignment") );
// fall through
case wxBK_TOP:
if ( !page )
{
wxASSERT_MSG( AllowNullPage(),
- _T("Null page in a control that does not allow null pages?") );
+ wxT("Null page in a control that does not allow null pages?") );
continue;
}
int WXUNUSED(imageId))
{
wxCHECK_MSG( page || AllowNullPage(), false,
- _T("NULL page in wxBookCtrlBase::InsertPage()") );
+ wxT("NULL page in wxBookCtrlBase::InsertPage()") );
wxCHECK_MSG( nPage <= m_pages.size(), false,
- _T("invalid page index in wxBookCtrlBase::InsertPage()") );
+ wxT("invalid page index in wxBookCtrlBase::InsertPage()") );
m_pages.Insert(page, nPage);
if ( page )
wxWindow *wxBookCtrlBase::DoRemovePage(size_t nPage)
{
wxCHECK_MSG( nPage < m_pages.size(), NULL,
- _T("invalid page index in wxBookCtrlBase::DoRemovePage()") );
+ wxT("invalid page index in wxBookCtrlBase::DoRemovePage()") );
wxWindow *pageRemoved = m_pages[nPage];
m_pages.RemoveAt(nPage);
wxTopLevelWindow * const
tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
- wxCHECK_MSG( tlw, NULL, _T("button without top level window?") );
+ wxCHECK_MSG( tlw, NULL, wxT("button without top level window?") );
return tlw->SetDefaultItem(this);
}
void Check(wxCmdLineParamType WXUNUSED_UNLESS_DEBUG(typ)) const
{
- wxASSERT_MSG( type == typ, _T("type mismatch in wxCmdLineOption") );
+ wxASSERT_MSG( type == typ, wxT("type mismatch in wxCmdLineOption") );
}
double GetDoubleVal() const
{
m_enableLongOptions = true;
#ifdef __UNIX_LIKE__
- m_switchChars = _T("-");
+ m_switchChars = wxT("-");
#else // !Unix
- m_switchChars = _T("/-");
+ m_switchChars = wxT("/-");
#endif
}
break;
default:
- wxFAIL_MSG( _T("unknown command line entry type") );
+ wxFAIL_MSG( wxT("unknown command line entry type") );
// still fall through
case wxCMD_LINE_NONE:
int flags)
{
wxASSERT_MSG( m_data->FindOption(shortName) == wxNOT_FOUND,
- _T("duplicate switch") );
+ wxT("duplicate switch") );
wxCmdLineOption *option = new wxCmdLineOption(wxCMD_LINE_SWITCH,
shortName, longName, desc,
int flags)
{
wxASSERT_MSG( m_data->FindOption(shortName) == wxNOT_FOUND,
- _T("duplicate option") );
+ wxT("duplicate option") );
wxCmdLineOption *option = new wxCmdLineOption(wxCMD_LINE_OPTION,
shortName, longName, desc,
wxCmdLineParam& param = m_data->m_paramDesc.Last();
wxASSERT_MSG( !(param.flags & wxCMD_LINE_PARAM_MULTIPLE),
- _T("all parameters after the one with wxCMD_LINE_PARAM_MULTIPLE style will be ignored") );
+ wxT("all parameters after the one with wxCMD_LINE_PARAM_MULTIPLE style will be ignored") );
if ( !(flags & wxCMD_LINE_PARAM_OPTIONAL) )
{
wxASSERT_MSG( !(param.flags & wxCMD_LINE_PARAM_OPTIONAL),
- _T("a required parameter can't follow an optional one") );
+ wxT("a required parameter can't follow an optional one") );
}
}
#endif // wxDEBUG_LEVEL
if ( i == wxNOT_FOUND )
i = m_data->FindOptionByLongName(name);
- wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown switch") );
+ wxCHECK_MSG( i != wxNOT_FOUND, false, wxT("unknown switch") );
wxCmdLineOption& opt = m_data->m_options[(size_t)i];
if ( !opt.HasValue() )
if ( i == wxNOT_FOUND )
i = m_data->FindOptionByLongName(name);
- wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown option") );
+ wxCHECK_MSG( i != wxNOT_FOUND, false, wxT("unknown option") );
wxCmdLineOption& opt = m_data->m_options[(size_t)i];
if ( !opt.HasValue() )
return false;
- wxCHECK_MSG( value, false, _T("NULL pointer in wxCmdLineOption::Found") );
+ wxCHECK_MSG( value, false, wxT("NULL pointer in wxCmdLineOption::Found") );
*value = opt.GetStrVal();
if ( i == wxNOT_FOUND )
i = m_data->FindOptionByLongName(name);
- wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown option") );
+ wxCHECK_MSG( i != wxNOT_FOUND, false, wxT("unknown option") );
wxCmdLineOption& opt = m_data->m_options[(size_t)i];
if ( !opt.HasValue() )
return false;
- wxCHECK_MSG( value, false, _T("NULL pointer in wxCmdLineOption::Found") );
+ wxCHECK_MSG( value, false, wxT("NULL pointer in wxCmdLineOption::Found") );
*value = opt.GetLongVal();
if ( i == wxNOT_FOUND )
i = m_data->FindOptionByLongName(name);
- wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown option") );
+ wxCHECK_MSG( i != wxNOT_FOUND, false, wxT("unknown option") );
wxCmdLineOption& opt = m_data->m_options[(size_t)i];
if ( !opt.HasValue() )
return false;
- wxCHECK_MSG( value, false, _T("NULL pointer in wxCmdLineOption::Found") );
+ wxCHECK_MSG( value, false, wxT("NULL pointer in wxCmdLineOption::Found") );
*value = opt.GetDoubleVal();
if ( i == wxNOT_FOUND )
i = m_data->FindOptionByLongName(name);
- wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown option") );
+ wxCHECK_MSG( i != wxNOT_FOUND, false, wxT("unknown option") );
wxCmdLineOption& opt = m_data->m_options[(size_t)i];
if ( !opt.HasValue() )
return false;
- wxCHECK_MSG( value, false, _T("NULL pointer in wxCmdLineOption::Found") );
+ wxCHECK_MSG( value, false, wxT("NULL pointer in wxCmdLineOption::Found") );
*value = opt.GetDateVal();
wxString wxCmdLineParser::GetParam(size_t n) const
{
- wxCHECK_MSG( n < GetParamCount(), wxEmptyString, _T("invalid param index") );
+ wxCHECK_MSG( n < GetParamCount(), wxEmptyString, wxT("invalid param index") );
return m_data->m_parameters[n];
}
// special case: "--" should be discarded and all following arguments
// should be considered as parameters, even if they start with '-' and
// not like options (this is POSIX-like)
- if ( arg == _T("--") )
+ if ( arg == wxT("--") )
{
maybeOption = false;
int optInd = wxNOT_FOUND; // init to suppress warnings
// an option or a switch: find whether it's a long or a short one
- if ( arg.length() >= 3 && arg[0u] == _T('-') && arg[1u] == _T('-') )
+ if ( arg.length() >= 3 && arg[0u] == wxT('-') && arg[1u] == wxT('-') )
{
// a long one
isLong = true;
if ( optInd == wxNOT_FOUND )
{
errorMsg << wxString::Format(_("Unknown long option '%s'"), name.c_str())
- << _T('\n');
+ << wxT('\n');
}
}
else
// Print the argument including leading "--"
name.Prepend( wxT("--") );
errorMsg << wxString::Format(_("Unknown option '%s'"), name.c_str())
- << _T('\n');
+ << wxT('\n');
}
}
// we couldn't find a valid option name in the
// beginning of this string
errorMsg << wxString::Format(_("Unknown option '%s'"), name.c_str())
- << _T('\n');
+ << wxT('\n');
break;
}
if ( p != arg.end() )
{
errorMsg << wxString::Format(_("Unexpected characters following option '%s'."), name.c_str())
- << _T('\n');
+ << wxT('\n');
ok = false;
}
else // no value, as expected
// ... but there is none
errorMsg << wxString::Format(_("Option '%s' requires a value."),
name.c_str())
- << _T('\n');
+ << wxT('\n');
ok = false;
}
{
errorMsg << wxString::Format(_("Separator expected after the option '%s'."),
name.c_str())
- << _T('\n');
+ << wxT('\n');
ok = false;
}
switch ( opt.type )
{
default:
- wxFAIL_MSG( _T("unknown option type") );
+ wxFAIL_MSG( wxT("unknown option type") );
// still fall through
case wxCMD_LINE_VAL_STRING:
{
errorMsg << wxString::Format(_("'%s' is not a correct numeric value for option '%s'."),
value.c_str(), name.c_str())
- << _T('\n');
+ << wxT('\n');
ok = false;
}
{
errorMsg << wxString::Format(_("'%s' is not a correct numeric value for option '%s'."),
value.c_str(), name.c_str())
- << _T('\n');
+ << wxT('\n');
ok = false;
}
{
errorMsg << wxString::Format(_("Option '%s': '%s' cannot be converted to a date."),
name.c_str(), value.c_str())
- << _T('\n');
+ << wxT('\n');
ok = false;
}
else
{
wxASSERT_MSG( currentParam == countParam - 1,
- _T("all parameters after the one with wxCMD_LINE_PARAM_MULTIPLE style are ignored") );
+ wxT("all parameters after the one with wxCMD_LINE_PARAM_MULTIPLE style are ignored") );
// remember that we did have this last repeatable parameter
hadRepeatableParam = true;
else
{
errorMsg << wxString::Format(_("Unexpected parameter '%s'"), arg.c_str())
- << _T('\n');
+ << wxT('\n');
ok = false;
}
errorMsg << wxString::Format(_("The value for the option '%s' must be specified."),
optName.c_str())
- << _T('\n');
+ << wxT('\n');
ok = false;
}
{
errorMsg << wxString::Format(_("The required parameter '%s' was not specified."),
param.description.c_str())
- << _T('\n');
+ << wxT('\n');
ok = false;
}
}
else
{
- wxFAIL_MSG( _T("no wxMessageOutput object?") );
+ wxFAIL_MSG( wxT("no wxMessageOutput object?") );
}
}
}
else
{
- wxFAIL_MSG( _T("no wxMessageOutput object?") );
+ wxFAIL_MSG( wxT("no wxMessageOutput object?") );
}
}
if ( !m_data->m_logo.empty() )
{
- usage << m_data->m_logo << _T('\n');
+ usage << m_data->m_logo << wxT('\n');
}
usage << wxString::Format(_("Usage: %s"), appname.c_str());
// the switch char is usually '-' but this can be changed with
// SetSwitchChars() and then the first one of possible chars is used
- wxChar chSwitch = !m_data->m_switchChars ? _T('-')
+ wxChar chSwitch = !m_data->m_switchChars ? wxT('-')
: m_data->m_switchChars[0u];
bool areLongOptionsEnabled = AreLongOptionsEnabled();
if ( opt.kind != wxCMD_LINE_USAGE_TEXT )
{
- usage << _T(' ');
+ usage << wxT(' ');
if ( !(opt.flags & wxCMD_LINE_OPTION_MANDATORY) )
{
- usage << _T('[');
+ usage << wxT('[');
}
if ( !opt.shortName.empty() )
}
else if ( areLongOptionsEnabled && !opt.longName.empty() )
{
- usage << _T("--") << opt.longName;
+ usage << wxT("--") << opt.longName;
}
else
{
}
else
{
- wxFAIL_MSG( _T("option without neither short nor long name") );
+ wxFAIL_MSG( wxT("option without neither short nor long name") );
}
}
if ( !opt.shortName.empty() )
{
- option << _T(" ") << chSwitch << opt.shortName;
+ option << wxT(" ") << chSwitch << opt.shortName;
}
if ( areLongOptionsEnabled && !opt.longName.empty() )
{
- option << (option.empty() ? _T(" ") : _T(", "))
- << _T("--") << opt.longName;
+ option << (option.empty() ? wxT(" ") : wxT(", "))
+ << wxT("--") << opt.longName;
}
if ( opt.kind != wxCMD_LINE_SWITCH )
{
wxString val;
- val << _T('<') << GetTypeName(opt.type) << _T('>');
- usage << _T(' ') << val;
- option << (!opt.longName ? _T(':') : _T('=')) << val;
+ val << wxT('<') << GetTypeName(opt.type) << wxT('>');
+ usage << wxT(' ') << val;
+ option << (!opt.longName ? wxT(':') : wxT('=')) << val;
}
if ( !(opt.flags & wxCMD_LINE_OPTION_MANDATORY) )
{
- usage << _T(']');
+ usage << wxT(']');
}
}
{
wxCmdLineParam& param = m_data->m_paramDesc[n];
- usage << _T(' ');
+ usage << wxT(' ');
if ( param.flags & wxCMD_LINE_PARAM_OPTIONAL )
{
- usage << _T('[');
+ usage << wxT('[');
}
usage << param.description;
if ( param.flags & wxCMD_LINE_PARAM_MULTIPLE )
{
- usage << _T("...");
+ usage << wxT("...");
}
if ( param.flags & wxCMD_LINE_PARAM_OPTIONAL )
{
- usage << _T(']');
+ usage << wxT(']');
}
}
- usage << _T('\n');
+ usage << wxT('\n');
// set to number of our own options, not counting the standard ones
count = namesOptions.size();
for ( n = 0; n < namesOptions.size(); n++ )
{
if ( n == count )
- usage << _T('\n') << stdDesc;
+ usage << wxT('\n') << stdDesc;
len = namesOptions[n].length();
// desc contains text if name is empty
if (len == 0)
{
- usage << descOptions[n] << _T('\n');
+ usage << descOptions[n] << wxT('\n');
}
else
{
usage << namesOptions[n]
- << wxString(_T(' '), lenMax - len) << _T('\t')
+ << wxString(wxT(' '), lenMax - len) << wxT('\t')
<< descOptions[n]
- << _T('\n');
+ << wxT('\n');
}
}
switch ( type )
{
default:
- wxFAIL_MSG( _T("unknown option type") );
+ wxFAIL_MSG( wxT("unknown option type") );
// still fall through
case wxCMD_LINE_VAL_STRING:
// storeIt is false.
bool wxCommandProcessor::Submit(wxCommand *command, bool storeIt)
{
- wxCHECK_MSG( command, false, _T("no command in wxCommandProcessor::Submit") );
+ wxCHECK_MSG( command, false, wxT("no command in wxCommandProcessor::Submit") );
if ( !DoCommand(*command) )
{
void wxCommandProcessor::Store(wxCommand *command)
{
- wxCHECK_RET( command, _T("no command in wxCommandProcessor::Store") );
+ wxCHECK_RET( command, wxT("no command in wxCommandProcessor::Store") );
if ( (int)m_commands.GetCount() == m_maxNoCommands )
{
void wxColourData::SetCustomColour(int i, const wxColour& colour)
{
- wxCHECK_RET( i >= 0 && i < NUM_CUSTOM, _T("custom colour index out of range") );
+ wxCHECK_RET( i >= 0 && i < NUM_CUSTOM, wxT("custom colour index out of range") );
m_custColours[i] = colour;
}
wxColour wxColourData::GetCustomColour(int i) const
{
wxCHECK_MSG( i >= 0 && i < NUM_CUSTOM, wxColour(0,0,0),
- _T("custom colour index out of range") );
+ wxT("custom colour index out of range") );
return m_custColours[i];
}
bool wxFromString(const wxString& str, wxColourBase *col)
{
- wxCHECK_MSG( col, false, _T("NULL output parameter") );
+ wxCHECK_MSG( col, false, wxT("NULL output parameter") );
if ( str.empty() )
{
{
if ( ms_bAutoCreate && ms_pConfig == NULL ) {
wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
- wxCHECK_MSG( traits, NULL, _T("create wxApp before calling this") );
+ wxCHECK_MSG( traits, NULL, wxT("create wxApp before calling this") );
ms_pConfig = traits->CreateConfig();
}
#define IMPLEMENT_READ_FOR_TYPE(name, type, deftype, extra) \
bool wxConfigBase::Read(const wxString& key, type *val) const \
{ \
- wxCHECK_MSG( val, false, _T("wxConfig::Read(): NULL parameter") ); \
+ wxCHECK_MSG( val, false, wxT("wxConfig::Read(): NULL parameter") ); \
\
if ( !DoRead##name(key, val) ) \
return false; \
type *val, \
deftype defVal) const \
{ \
- wxCHECK_MSG( val, false, _T("wxConfig::Read(): NULL parameter") ); \
+ wxCHECK_MSG( val, false, wxT("wxConfig::Read(): NULL parameter") ); \
\
bool read = DoRead##name(key, val); \
if ( !read ) \
{
long l = *pi;
bool r = Read(key, &l);
- wxASSERT_MSG( l < INT_MAX, _T("int overflow in wxConfig::Read") );
+ wxASSERT_MSG( l < INT_MAX, wxT("int overflow in wxConfig::Read") );
*pi = (int)l;
return r;
}
{
long l = *pi;
bool r = Read(key, &l, defVal);
- wxASSERT_MSG( l < INT_MAX, _T("int overflow in wxConfig::Read") );
+ wxASSERT_MSG( l < INT_MAX, wxT("int overflow in wxConfig::Read") );
*pi = (int)l;
return r;
}
// but can be overridden in the derived ones
bool wxConfigBase::DoReadBool(const wxString& key, bool* val) const
{
- wxCHECK_MSG( val, false, _T("wxConfig::Read(): NULL parameter") );
+ wxCHECK_MSG( val, false, wxT("wxConfig::Read(): NULL parameter") );
long l;
if ( !DoReadLong(key, &l) )
return false;
- wxASSERT_MSG( l == 0 || l == 1, _T("bad bool value in wxConfig::DoReadInt") );
+ wxASSERT_MSG( l == 0 || l == 1, wxT("bad bool value in wxConfig::DoReadInt") );
*val = l != 0;
bool wxConfigBase::DoWriteDouble(const wxString& key, double val)
{
- return DoWriteString(key, wxString::Format(_T("%g"), val));
+ return DoWriteString(key, wxString::Format(wxT("%g"), val));
}
bool wxConfigBase::DoWriteBool(const wxString& key, bool value)
pConfig->SetPath(wxT("MySettings"));
pConfig->SetPath(wxT(".."));
int value;
- pConfig->Read(_T("MainWindowX"), & value);
+ pConfig->Read(wxT("MainWindowX"), & value);
*/
m_strOldPath = m_pContainer->GetPath().wc_str();
if ( *m_strOldPath.c_str() != wxCONFIG_PATH_SEPARATOR )
#endif //WX_PRECOMP
// trace mask for focus messages
-#define TRACE_FOCUS _T("focus")
+#define TRACE_FOCUS wxT("focus")
// ============================================================================
// implementation
bool wxControlContainerBase::DoSetFocus()
{
- wxLogTrace(TRACE_FOCUS, _T("SetFocus on wxPanel 0x%p."),
+ wxLogTrace(TRACE_FOCUS, wxT("SetFocus on wxPanel 0x%p."),
m_winParent->GetHandle());
if (m_inSetFocus)
// (under wxGTK)
wxASSERT_MSG( winParent,
- _T("Setting last focus for a window that is not our child?") );
+ wxT("Setting last focus for a window that is not our child?") );
}
}
if ( win )
{
- wxLogTrace(TRACE_FOCUS, _T("Set last focus to %s(%s)"),
+ wxLogTrace(TRACE_FOCUS, wxT("Set last focus to %s(%s)"),
win->GetClassInfo()->GetClassName(),
win->GetLabel().c_str());
}
else
{
- wxLogTrace(TRACE_FOCUS, _T("No more last focus"));
+ wxLogTrace(TRACE_FOCUS, wxT("No more last focus"));
}
}
const wxWindowList& siblings = btn->GetParent()->GetChildren();
wxWindowList::compatibility_iterator nodeThis = siblings.Find(btn);
- wxCHECK_MSG( nodeThis, NULL, _T("radio button not a child of its parent?") );
+ wxCHECK_MSG( nodeThis, NULL, wxT("radio button not a child of its parent?") );
// Iterate over all previous siblings until we find the next radio button
wxWindowList::compatibility_iterator nodeBefore = nodeThis->GetPrevious();
const wxWindowList& siblings = btn->GetParent()->GetChildren();
wxWindowList::compatibility_iterator nodeThis = siblings.Find(btn);
- wxCHECK_MSG( nodeThis, NULL, _T("radio button not a child of its parent?") );
+ wxCHECK_MSG( nodeThis, NULL, wxT("radio button not a child of its parent?") );
// Iterate over all previous siblings until we find the next radio button
wxWindowList::compatibility_iterator nodeNext = nodeThis->GetNext();
void wxControlContainer::HandleOnFocus(wxFocusEvent& event)
{
- wxLogTrace(TRACE_FOCUS, _T("OnFocus on wxPanel 0x%p, name: %s"),
+ wxLogTrace(TRACE_FOCUS, wxT("OnFocus on wxPanel 0x%p, name: %s"),
m_winParent->GetHandle(),
m_winParent->GetName().c_str() );
bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
{
- wxCHECK_MSG( win, false, _T("wxSetFocusToChild(): invalid window") );
+ wxCHECK_MSG( win, false, wxT("wxSetFocusToChild(): invalid window") );
// wxCHECK_MSG( childLastFocused, false,
- // _T("wxSetFocusToChild(): NULL child poonter") );
+ // wxT("wxSetFocusToChild(): NULL child poonter") );
if ( childLastFocused && *childLastFocused )
{
if ( (*childLastFocused)->GetParent() == win )
{
wxLogTrace(TRACE_FOCUS,
- _T("SetFocusToChild() => last child (0x%p)."),
+ wxT("SetFocusToChild() => last child (0x%p)."),
(*childLastFocused)->GetHandle());
// not SetFocusFromKbd(): we're restoring focus back to the old
#endif // __WXMSW__
wxLogTrace(TRACE_FOCUS,
- _T("SetFocusToChild() => first child (0x%p)."),
+ wxT("SetFocusToChild() => first child (0x%p)."),
child->GetHandle());
if (childLastFocused)
void wxConvAuto::SetFallbackEncoding(wxFontEncoding enc)
{
wxASSERT_MSG( enc != wxFONTENCODING_DEFAULT,
- _T("wxFONTENCODING_DEFAULT doesn't make sense here") );
+ wxT("wxFONTENCODING_DEFAULT doesn't make sense here") );
ms_defaultMBEncoding = enc;
}
break;
default:
- wxFAIL_MSG( _T("unexpected BOM type") );
+ wxFAIL_MSG( wxT("unexpected BOM type") );
// fall through: still need to create something
case BOM_None:
break;
default:
- wxFAIL_MSG( _T("unexpected BOM type") );
+ wxFAIL_MSG( wxT("unexpected BOM type") );
// fall through: still need to create something
case BOM_None:
// Dispatch the help event to the relevant window
bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt)
{
- wxCHECK_MSG( win, false, _T("win parameter can't be NULL") );
+ wxCHECK_MSG( win, false, wxT("win parameter can't be NULL") );
wxHelpEvent helpEvent(wxEVT_HELP, win->GetId(), pt,
wxHelpEvent::Origin_HelpButton);
if ( m_helptextAtPoint != wxDefaultPosition ||
m_helptextOrigin != wxHelpEvent::Origin_Unknown )
{
- wxCHECK_MSG( window, wxEmptyString, _T("window must not be NULL") );
+ wxCHECK_MSG( window, wxEmptyString, wxT("window must not be NULL") );
wxPoint pt = m_helptextAtPoint;
wxHelpEvent::Origin origin = m_helptextOrigin;
// Convenience function for turning context id into wxString
wxString wxContextId(int id)
{
- return wxString::Format(_T("%d"), id);
+ return wxString::Format(wxT("%d"), id);
}
// ----------------------------------------------------------------------------
// the character following MNEMONIC_PREFIX is the accelerator for this
// control unless it is MNEMONIC_PREFIX too - this allows to insert
// literal MNEMONIC_PREFIX chars into the label
- static const wxChar MNEMONIC_PREFIX = _T('&');
+ static const wxChar MNEMONIC_PREFIX = wxT('&');
if ( labelOnly )
{
}
else
{
- wxFAIL_MSG(_T("duplicate accel char in control label"));
+ wxFAIL_MSG(wxT("duplicate accel char in control label"));
}
}
}
void wxItemContainer::Delete(unsigned int pos)
{
- wxCHECK_RET( pos < GetCount(), _T("invalid index") );
+ wxCHECK_RET( pos < GetCount(), wxT("invalid index") );
if ( HasClientObjectData() )
ResetItemClientObject(pos);
wxItemContainer::DoInsertOneItem(const wxString& WXUNUSED(item),
unsigned int WXUNUSED(pos))
{
- wxFAIL_MSG( _T("Must be overridden if DoInsertItemsInLoop() is used") );
+ wxFAIL_MSG( wxT("Must be overridden if DoInsertItemsInLoop() is used") );
return wxNOT_FOUND;
}
break;
default:
- wxFAIL_MSG( _T("unknown client data type") );
+ wxFAIL_MSG( wxT("unknown client data type") );
// fall through
case wxClientData_None:
(year > JDN_0_YEAR) ||
((year == JDN_0_YEAR) && (mon > JDN_0_MONTH)) ||
((year == JDN_0_YEAR) && (mon == JDN_0_MONTH) && (day >= JDN_0_DAY)),
- _T("date out of range - can't convert to JDN")
+ wxT("date out of range - can't convert to JDN")
);
// make the year positive to avoid problems with negative numbers division
if ( !wxStrftime(buf, WXSIZEOF(buf), format, tm) )
{
// if the format is valid, buffer must be too small?
- wxFAIL_MSG(_T("strftime() failed"));
+ wxFAIL_MSG(wxT("strftime() failed"));
buf[0] = '\0';
}
mon = (wxDateTime::Month)(mon + monDiff);
- wxASSERT_MSG( mon >= 0 && mon < MONTHS_IN_YEAR, _T("logic error") );
+ wxASSERT_MSG( mon >= 0 && mon < MONTHS_IN_YEAR, wxT("logic error") );
// NB: we don't check here that the resulting date is valid, this function
// is private and the caller must check it if needed
}
wxASSERT_MSG( mday > 0 && mday <= GetNumOfDaysInMonth(year, mon),
- _T("logic error") );
+ wxT("logic error") );
}
// ----------------------------------------------------------------------------
break;
default:
- wxFAIL_MSG( _T("unknown time zone") );
+ wxFAIL_MSG( wxT("unknown time zone") );
}
}
}
else
{
- wxFAIL_MSG(_T("unknown calendar"));
+ wxFAIL_MSG(wxT("unknown calendar"));
return false;
}
return Now().GetYear();
case Julian:
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
break;
default:
- wxFAIL_MSG(_T("unsupported calendar"));
+ wxFAIL_MSG(wxT("unsupported calendar"));
break;
}
return Now().GetMonth();
case Julian:
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
break;
default:
- wxFAIL_MSG(_T("unsupported calendar"));
+ wxFAIL_MSG(wxT("unsupported calendar"));
break;
}
return IsLeapYear(year) ? 366 : 365;
default:
- wxFAIL_MSG(_T("unsupported calendar"));
+ wxFAIL_MSG(wxT("unsupported calendar"));
break;
}
int year,
wxDateTime::Calendar cal)
{
- wxCHECK_MSG( month < MONTHS_IN_YEAR, 0, _T("invalid month") );
+ wxCHECK_MSG( month < MONTHS_IN_YEAR, 0, wxT("invalid month") );
if ( cal == Gregorian || cal == Julian )
{
}
else
{
- wxFAIL_MSG(_T("unsupported calendar"));
+ wxFAIL_MSG(wxT("unsupported calendar"));
return 0;
}
wxDateTime::NameFlags flags)
{
#ifdef wxHAS_STRFTIME
- wxCHECK_MSG( month != Inv_Month, wxEmptyString, _T("invalid month") );
+ wxCHECK_MSG( month != Inv_Month, wxEmptyString, wxT("invalid month") );
// notice that we must set all the fields to avoid confusing libc (GNU one
// gets confused to a crash if we don't do this)
InitTm(tm);
tm.tm_mon = month;
- return CallStrftime(flags == Name_Abbr ? _T("%b") : _T("%B"), &tm);
+ return CallStrftime(flags == Name_Abbr ? wxT("%b") : wxT("%B"), &tm);
#else // !wxHAS_STRFTIME
return GetEnglishMonthName(month, flags);
#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
/* static */
wxString wxDateTime::GetEnglishWeekDayName(WeekDay wday, NameFlags flags)
{
- wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, _T("invalid weekday") );
+ wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, wxT("invalid weekday") );
static const char *weekdayNames[2][DAYS_PER_400_YEARS] =
{
wxDateTime::NameFlags flags)
{
#ifdef wxHAS_STRFTIME
- wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, _T("invalid weekday") );
+ wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, wxT("invalid weekday") );
// take some arbitrary Sunday (but notice that the day should be such that
// after adding wday to it below we still have a valid date, e.g. don't
(void)mktime(&tm);
// ... and call strftime()
- return CallStrftime(flags == Name_Abbr ? _T("%a") : _T("%A"), &tm);
+ return CallStrftime(flags == Name_Abbr ? wxT("%a") : wxT("%A"), &tm);
#else // !wxHAS_STRFTIME
return GetEnglishWeekDayName(wday, flags);
#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
// assert, even though it is a perfectly legal use.
if ( am )
{
- if (wxStrftime(buffer, WXSIZEOF(buffer), _T("%p"), &tm) > 0)
+ if (wxStrftime(buffer, WXSIZEOF(buffer), wxT("%p"), &tm) > 0)
*am = wxString(buffer);
else
*am = wxString();
if ( pm )
{
tm.tm_hour = 13;
- if (wxStrftime(buffer, WXSIZEOF(buffer), _T("%p"), &tm) > 0)
+ if (wxStrftime(buffer, WXSIZEOF(buffer), wxT("%p"), &tm) > 0)
*pm = wxString(buffer);
else
*pm = wxString();
struct tm tmstruct;
struct tm *tm = wxLocaltime_r(&t, &tmstruct);
- wxString tz = CallStrftime(_T("%Z"), tm);
- if ( tz == _T("WET") || tz == _T("WEST") )
+ wxString tz = CallStrftime(wxT("%Z"), tm);
+ if ( tz == wxT("WET") || tz == wxT("WEST") )
{
ms_country = UK;
}
- else if ( tz == _T("CET") || tz == _T("CEST") )
+ else if ( tz == wxT("CET") || tz == wxT("CEST") )
{
ms_country = Country_EEC;
}
- else if ( tz == _T("MSK") || tz == _T("MSD") )
+ else if ( tz == wxT("MSK") || tz == wxT("MSD") )
{
ms_country = Russia;
}
- else if ( tz == _T("AST") || tz == _T("ADT") ||
- tz == _T("EST") || tz == _T("EDT") ||
- tz == _T("CST") || tz == _T("CDT") ||
- tz == _T("MST") || tz == _T("MDT") ||
- tz == _T("PST") || tz == _T("PDT") )
+ else if ( tz == wxT("AST") || tz == wxT("ADT") ||
+ tz == wxT("EST") || tz == wxT("EDT") ||
+ tz == wxT("CST") || tz == wxT("CDT") ||
+ tz == wxT("MST") || tz == wxT("MDT") ||
+ tz == wxT("PST") || tz == wxT("PDT") )
{
ms_country = USA;
}
if ( !dt.SetToLastWeekDay(Sun, Mar, year) )
{
// weird...
- wxFAIL_MSG( _T("no last Sunday in March?") );
+ wxFAIL_MSG( wxT("no last Sunday in March?") );
}
dt += wxTimeSpan::Hours(1);
if ( !dt.SetToLastWeekDay(Sun, Apr, year) )
{
// weird...
- wxFAIL_MSG( _T("no first Sunday in April?") );
+ wxFAIL_MSG( wxT("no first Sunday in April?") );
}
}
else if ( year > 2006 )
if ( !dt.SetToWeekDay(Sun, 2, Mar, year) )
{
// weird...
- wxFAIL_MSG( _T("no second Sunday in March?") );
+ wxFAIL_MSG( wxT("no second Sunday in March?") );
}
}
else
if ( !dt.SetToWeekDay(Sun, 1, Apr, year) )
{
// weird...
- wxFAIL_MSG( _T("no first Sunday in April?") );
+ wxFAIL_MSG( wxT("no first Sunday in April?") );
}
}
if ( !dt.SetToLastWeekDay(Sun, Oct, year) )
{
// weirder and weirder...
- wxFAIL_MSG( _T("no last Sunday in October?") );
+ wxFAIL_MSG( wxT("no last Sunday in October?") );
}
dt += wxTimeSpan::Hours(1);
if ( !dt.SetToWeekDay(Sun, 1, Nov, year) )
{
// weird...
- wxFAIL_MSG( _T("no first Sunday in November?") );
+ wxFAIL_MSG( wxT("no first Sunday in November?") );
}
}
else
if ( !dt.SetToLastWeekDay(Sun, Oct, year) )
{
// weirder and weirder...
- wxFAIL_MSG( _T("no last Sunday in October?") );
+ wxFAIL_MSG( wxT("no last Sunday in October?") );
}
}
tm2.tm_sec));
}
- wxFAIL_MSG( _T("mktime() failed") );
+ wxFAIL_MSG( wxT("mktime() failed") );
*this = wxInvalidDateTime;
second < 62 &&
minute < 60 &&
millisec < 1000,
- _T("Invalid time in wxDateTime::Set()") );
+ wxT("Invalid time in wxDateTime::Set()") );
// get the current date from system
struct tm tmstruct;
struct tm *tm = GetTmNow(&tmstruct);
- wxDATETIME_CHECK( tm, _T("wxLocaltime_r() failed") );
+ wxDATETIME_CHECK( tm, wxT("wxLocaltime_r() failed") );
// make a copy so it isn't clobbered by the call to mktime() below
struct tm tm1(*tm);
second < 62 &&
minute < 60 &&
millisec < 1000,
- _T("Invalid time in wxDateTime::Set()") );
+ wxT("Invalid time in wxDateTime::Set()") );
ReplaceDefaultYearMonthWithCurrent(&year, &month);
wxDATETIME_CHECK( (0 < day) && (day <= GetNumberOfDays(month, year)),
- _T("Invalid date in wxDateTime::Set()") );
+ wxT("Invalid date in wxDateTime::Set()") );
// the range of time_t type (inclusive)
static const int yearMinInRange = 1970;
time_t ticks = GetTicks();
struct tm tmstruct;
struct tm *tm = wxLocaltime_r(&ticks, &tmstruct);
- wxCHECK_MSG( tm, ULONG_MAX, _T("time can't be represented in DOS format") );
+ wxCHECK_MSG( tm, ULONG_MAX, wxT("time can't be represented in DOS format") );
long year = tm->tm_year;
year -= 80;
wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") );
time_t time = GetTicks();
if ( time != (time_t)-1 )
tm = wxLocaltime_r(&time, &tmstruct);
// should never happen
- wxCHECK_MSG( tm, Tm(), _T("wxLocaltime_r() failed") );
+ wxCHECK_MSG( tm, Tm(), wxT("wxLocaltime_r() failed") );
}
else
{
tm = wxGmtime_r(&time, &tmstruct);
// should never happen
- wxCHECK_MSG( tm, Tm(), _T("wxGmtime_r() failed") );
+ wxCHECK_MSG( tm, Tm(), wxT("wxGmtime_r() failed") );
}
else
{
// CREDIT: code below is by Scott E. Lee (but bugs are mine)
- wxASSERT_MSG( jdn > -2, _T("JDN out of range") );
+ wxASSERT_MSG( jdn > -2, wxT("JDN out of range") );
// calculate the century
long temp = (jdn + JDN_OFFSET) * 4 - 1;
year -= 4800;
// check that the algorithm gave us something reasonable
- wxASSERT_MSG( (0 < month) && (month <= 12), _T("invalid month") );
- wxASSERT_MSG( (1 <= day) && (day < 32), _T("invalid day") );
+ wxASSERT_MSG( (0 < month) && (month <= 12), wxT("invalid month") );
+ wxASSERT_MSG( (1 <= day) && (day < 32), wxT("invalid day") );
// construct Tm from these values
Tm tm;
wxDateTime& wxDateTime::SetYear(int year)
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") );
Tm tm(GetTm());
tm.year = year;
wxDateTime& wxDateTime::SetMonth(Month month)
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") );
Tm tm(GetTm());
tm.mon = month;
wxDateTime& wxDateTime::SetDay(wxDateTime_t mday)
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") );
Tm tm(GetTm());
tm.mday = mday;
wxDateTime& wxDateTime::SetHour(wxDateTime_t hour)
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") );
Tm tm(GetTm());
tm.hour = hour;
wxDateTime& wxDateTime::SetMinute(wxDateTime_t min)
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") );
Tm tm(GetTm());
tm.min = min;
wxDateTime& wxDateTime::SetSecond(wxDateTime_t sec)
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") );
Tm tm(GetTm());
tm.sec = sec;
wxDateTime& wxDateTime::SetMillisecond(wxDateTime_t millisecond)
{
- wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") );
+ wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") );
// we don't need to use GetTm() for this one
m_time -= m_time % 1000l;
Set(tm);
wxASSERT_MSG( IsSameTime(tm),
- _T("Add(wxDateSpan) shouldn't modify time") );
+ wxT("Add(wxDateSpan) shouldn't modify time") );
return *this;
}
wxDateTime::SetToWeekOfYear(int year, wxDateTime_t numWeek, WeekDay wd)
{
wxASSERT_MSG( numWeek > 0,
- _T("invalid week number: weeks are counted from 1") );
+ wxT("invalid week number: weeks are counted from 1") );
// Jan 4 always lies in the 1st week of the year
wxDateTime dt(4, Jan, year);
wxDateTime& wxDateTime::SetToWeekDayInSameWeek(WeekDay weekday, WeekFlags flags)
{
- wxDATETIME_CHECK( weekday != Inv_WeekDay, _T("invalid weekday") );
+ wxDATETIME_CHECK( weekday != Inv_WeekDay, wxT("invalid weekday") );
int wdayDst = weekday,
wdayThis = GetWeekDay();
wxDateTime& wxDateTime::SetToNextWeekDay(WeekDay weekday)
{
- wxDATETIME_CHECK( weekday != Inv_WeekDay, _T("invalid weekday") );
+ wxDATETIME_CHECK( weekday != Inv_WeekDay, wxT("invalid weekday") );
int diff;
WeekDay wdayThis = GetWeekDay();
wxDateTime& wxDateTime::SetToPrevWeekDay(WeekDay weekday)
{
- wxDATETIME_CHECK( weekday != Inv_WeekDay, _T("invalid weekday") );
+ wxDATETIME_CHECK( weekday != Inv_WeekDay, wxT("invalid weekday") );
int diff;
WeekDay wdayThis = GetWeekDay();
Month month,
int year)
{
- wxCHECK_MSG( weekday != Inv_WeekDay, false, _T("invalid weekday") );
+ wxCHECK_MSG( weekday != Inv_WeekDay, false, wxT("invalid weekday") );
// we don't check explicitly that -5 <= n <= 5 because we will return false
// anyhow in such case - but may be should still give an assert for it?
{
int year = GetYear();
wxDATETIME_CHECK( (0 < yday) && (yday <= GetNumberOfDays(year)),
- _T("invalid year day") );
+ wxT("invalid year day") );
bool isLeap = IsLeapYear(year);
for ( Month mon = Jan; mon < Inv_Month; wxNextMonth(mon) )
int wxDateTime::IsDST(wxDateTime::Country country) const
{
wxCHECK_MSG( country == Country_Default, -1,
- _T("country support not implemented") );
+ wxT("country support not implemented") );
// use the C RTL for the dates in the standard range
time_t timet = GetTicks();
struct tm tmstruct;
tm *tm = wxLocaltime_r(&timet, &tmstruct);
- wxCHECK_MSG( tm, -1, _T("wxLocaltime_r() failed") );
+ wxCHECK_MSG( tm, -1, wxT("wxLocaltime_r() failed") );
return tm->tm_isdst;
}
{
if ( dtStart > dtEnd )
{
- wxFAIL_MSG( _T("invalid date range in GetHolidaysInRange") );
+ wxFAIL_MSG( wxT("invalid date range in GetHolidaysInRange") );
return 0u;
}
WXDLLIMPEXP_BASE void wxNextMonth(wxDateTime::Month& m)
{
- wxASSERT_MSG( m < wxDateTime::Inv_Month, _T("invalid month") );
+ wxASSERT_MSG( m < wxDateTime::Inv_Month, wxT("invalid month") );
// no wrapping or the for loop above would never end!
m = (wxDateTime::Month)(m + 1);
WXDLLIMPEXP_BASE void wxPrevMonth(wxDateTime::Month& m)
{
- wxASSERT_MSG( m < wxDateTime::Inv_Month, _T("invalid month") );
+ wxASSERT_MSG( m < wxDateTime::Inv_Month, wxT("invalid month") );
m = m == wxDateTime::Jan ? wxDateTime::Inv_Month
: (wxDateTime::Month)(m - 1);
WXDLLIMPEXP_BASE void wxNextWDay(wxDateTime::WeekDay& wd)
{
- wxASSERT_MSG( wd < wxDateTime::Inv_WeekDay, _T("invalid week day") );
+ wxASSERT_MSG( wd < wxDateTime::Inv_WeekDay, wxT("invalid week day") );
// no wrapping or the for loop above would never end!
wd = (wxDateTime::WeekDay)(wd + 1);
WXDLLIMPEXP_BASE void wxPrevWDay(wxDateTime::WeekDay& wd)
{
- wxASSERT_MSG( wd < wxDateTime::Inv_WeekDay, _T("invalid week day") );
+ wxASSERT_MSG( wd < wxDateTime::Inv_WeekDay, wxT("invalid week day") );
wd = wd == wxDateTime::Sun ? wxDateTime::Inv_WeekDay
: (wxDateTime::WeekDay)(wd - 1);
wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const
{
wxCHECK_MSG( !formatp.empty(), wxEmptyString,
- _T("NULL format in wxDateTime::Format") );
+ wxT("NULL format in wxDateTime::Format") );
wxString format = formatp;
#ifdef __WXOSX__
#ifdef wxHAS_STRFTIME
time_t time = GetTicks();
- if ( (time != (time_t)-1) && !wxStrstr(format, _T("%l")) )
+ if ( (time != (time_t)-1) && !wxStrstr(format, wxT("%l")) )
{
// use strftime()
struct tm tmstruct;
tm = wxLocaltime_r(&time, &tmstruct);
// should never happen
- wxCHECK_MSG( tm, wxEmptyString, _T("wxLocaltime_r() failed") );
+ wxCHECK_MSG( tm, wxEmptyString, wxT("wxLocaltime_r() failed") );
}
else
{
tm = wxGmtime_r(&time, &tmstruct);
// should never happen
- wxCHECK_MSG( tm, wxEmptyString, _T("wxGmtime_r() failed") );
+ wxCHECK_MSG( tm, wxEmptyString, wxT("wxGmtime_r() failed") );
}
else
{
wxString tmp, res, fmt;
for ( wxString::const_iterator p = format.begin(); p != format.end(); ++p )
{
- if ( *p != _T('%') )
+ if ( *p != wxT('%') )
{
// copy as is
res += *p;
// set the default format
switch ( (*++p).GetValue() )
{
- case _T('Y'): // year has 4 digits
- fmt = _T("%04d");
+ case wxT('Y'): // year has 4 digits
+ fmt = wxT("%04d");
break;
- case _T('j'): // day of year has 3 digits
- case _T('l'): // milliseconds have 3 digits
- fmt = _T("%03d");
+ case wxT('j'): // day of year has 3 digits
+ case wxT('l'): // milliseconds have 3 digits
+ fmt = wxT("%03d");
break;
- case _T('w'): // week day as number has only one
- fmt = _T("%d");
+ case wxT('w'): // week day as number has only one
+ fmt = wxT("%d");
break;
default:
// the format is "%02d" (for all the rest) or we have the
// field width preceding the format in which case it will
// override the default format anyhow
- fmt = _T("%02d");
+ fmt = wxT("%02d");
}
bool restart = true;
// start of the format specification
switch ( (*p).GetValue() )
{
- case _T('a'): // a weekday name
- case _T('A'):
+ case wxT('a'): // a weekday name
+ case wxT('A'):
// second parameter should be true for abbreviated names
res += GetWeekDayName(tm.GetWeekDay(),
- *p == _T('a') ? Name_Abbr : Name_Full);
+ *p == wxT('a') ? Name_Abbr : Name_Full);
break;
- case _T('b'): // a month name
- case _T('B'):
+ case wxT('b'): // a month name
+ case wxT('B'):
res += GetMonthName(tm.mon,
- *p == _T('b') ? Name_Abbr : Name_Full);
+ *p == wxT('b') ? Name_Abbr : Name_Full);
break;
- case _T('c'): // locale default date and time representation
- case _T('x'): // locale default date representation
+ case wxT('c'): // locale default date and time representation
+ case wxT('x'): // locale default date representation
#ifdef wxHAS_STRFTIME
//
// the problem: there is no way to know what do these format
year -= 28;
wxASSERT_MSG( year >= 1970 && year < 2000,
- _T("logic error in wxDateTime::Format") );
+ wxT("logic error in wxDateTime::Format") );
// use strftime() to format the same date but in supported
tmAdjusted.tm_mon = tm.mon;
tmAdjusted.tm_year = year - 1900;
tmAdjusted.tm_isdst = 0; // no DST, already adjusted
- wxString str = CallStrftime(*p == _T('c') ? _T("%c")
- : _T("%x"),
+ wxString str = CallStrftime(*p == wxT('c') ? wxT("%c")
+ : wxT("%x"),
&tmAdjusted);
// now replace the replacement year with the real year:
#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
break;
- case _T('d'): // day of a month (01-31)
+ case wxT('d'): // day of a month (01-31)
res += wxString::Format(fmt, tm.mday);
break;
- case _T('H'): // hour in 24h format (00-23)
+ case wxT('H'): // hour in 24h format (00-23)
res += wxString::Format(fmt, tm.hour);
break;
- case _T('I'): // hour in 12h format (01-12)
+ case wxT('I'): // hour in 12h format (01-12)
{
// 24h -> 12h, 0h -> 12h too
int hour12 = tm.hour > 12 ? tm.hour - 12
}
break;
- case _T('j'): // day of the year
+ case wxT('j'): // day of the year
res += wxString::Format(fmt, GetDayOfYear(tz));
break;
- case _T('l'): // milliseconds (NOT STANDARD)
+ case wxT('l'): // milliseconds (NOT STANDARD)
res += wxString::Format(fmt, GetMillisecond(tz));
break;
- case _T('m'): // month as a number (01-12)
+ case wxT('m'): // month as a number (01-12)
res += wxString::Format(fmt, tm.mon + 1);
break;
- case _T('M'): // minute as a decimal number (00-59)
+ case wxT('M'): // minute as a decimal number (00-59)
res += wxString::Format(fmt, tm.min);
break;
- case _T('p'): // AM or PM string
+ case wxT('p'): // AM or PM string
#ifdef wxHAS_STRFTIME
- res += CallStrftime(_T("%p"), &tmTimeOnly);
+ res += CallStrftime(wxT("%p"), &tmTimeOnly);
#else // !wxHAS_STRFTIME
res += (tmTimeOnly.tm_hour > 12) ? wxT("pm") : wxT("am");
#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
break;
- case _T('S'): // second as a decimal number (00-61)
+ case wxT('S'): // second as a decimal number (00-61)
res += wxString::Format(fmt, tm.sec);
break;
- case _T('U'): // week number in the year (Sunday 1st week day)
+ case wxT('U'): // week number in the year (Sunday 1st week day)
res += wxString::Format(fmt, GetWeekOfYear(Sunday_First, tz));
break;
- case _T('W'): // week number in the year (Monday 1st week day)
+ case wxT('W'): // week number in the year (Monday 1st week day)
res += wxString::Format(fmt, GetWeekOfYear(Monday_First, tz));
break;
- case _T('w'): // weekday as a number (0-6), Sunday = 0
+ case wxT('w'): // weekday as a number (0-6), Sunday = 0
res += wxString::Format(fmt, tm.GetWeekDay());
break;
- // case _T('x'): -- handled with "%c"
+ // case wxT('x'): -- handled with "%c"
- case _T('X'): // locale default time representation
+ case wxT('X'): // locale default time representation
// just use strftime() to format the time for us
#ifdef wxHAS_STRFTIME
- res += CallStrftime(_T("%X"), &tmTimeOnly);
+ res += CallStrftime(wxT("%X"), &tmTimeOnly);
#else // !wxHAS_STRFTIME
res += wxString::Format(wxT("%02d:%02d:%02d"),tm.hour, tm.min, tm.sec);
#endif // wxHAS_STRFTIME/!wxHAS_STRFTIME
break;
- case _T('y'): // year without century (00-99)
+ case wxT('y'): // year without century (00-99)
res += wxString::Format(fmt, tm.year % 100);
break;
- case _T('Y'): // year with century
+ case wxT('Y'): // year with century
res += wxString::Format(fmt, tm.year);
break;
- case _T('Z'): // timezone name
+ case wxT('Z'): // timezone name
#ifdef wxHAS_STRFTIME
- res += CallStrftime(_T("%Z"), &tmTimeOnly);
+ res += CallStrftime(wxT("%Z"), &tmTimeOnly);
#endif
break;
default:
// is it the format width?
fmt.Empty();
- while ( *p == _T('-') || *p == _T('+') ||
- *p == _T(' ') || wxIsdigit(*p) )
+ while ( *p == wxT('-') || *p == wxT('+') ||
+ *p == wxT(' ') || wxIsdigit(*p) )
{
fmt += *p;
}
if ( !fmt.empty() )
{
// we've only got the flags and width so far in fmt
- fmt.Prepend(_T('%'));
- fmt.Append(_T('d'));
+ fmt.Prepend(wxT('%'));
+ fmt.Append(wxT('d'));
restart = true;
}
// no, it wasn't the width
- wxFAIL_MSG(_T("unknown format specificator"));
+ wxFAIL_MSG(wxT("unknown format specificator"));
// fall through and just copy it nevertheless
- case _T('%'): // a percent sign
+ case wxT('%'): // a percent sign
res += *p;
break;
case 0: // the end of string
- wxFAIL_MSG(_T("missing format at the end of string"));
+ wxFAIL_MSG(wxT("missing format at the end of string"));
// just put the '%' which was the last char in format
- res += _T('%');
+ res += wxT('%');
break;
}
}
+1, +2, +3, +4, +5, +6, +7, +8, +9, +10, +11, +12, 0
};
- if ( *p < _T('A') || *p > _T('Z') || *p == _T('J') )
+ if ( *p < wxT('A') || *p > wxT('Z') || *p == wxT('J') )
return false;
offset = offsets[*p++ - 'A'];
{
// abbreviation
const wxString tz(p, date.end());
- if ( tz == _T("UT") || tz == _T("UTC") || tz == _T("GMT") )
+ if ( tz == wxT("UT") || tz == wxT("UTC") || tz == wxT("GMT") )
offset = 0;
- else if ( tz == _T("AST") )
+ else if ( tz == wxT("AST") )
offset = AST - GMT0;
- else if ( tz == _T("ADT") )
+ else if ( tz == wxT("ADT") )
offset = ADT - GMT0;
- else if ( tz == _T("EST") )
+ else if ( tz == wxT("EST") )
offset = EST - GMT0;
- else if ( tz == _T("EDT") )
+ else if ( tz == wxT("EDT") )
offset = EDT - GMT0;
- else if ( tz == _T("CST") )
+ else if ( tz == wxT("CST") )
offset = CST - GMT0;
- else if ( tz == _T("CDT") )
+ else if ( tz == wxT("CDT") )
offset = CDT - GMT0;
- else if ( tz == _T("MST") )
+ else if ( tz == wxT("MST") )
offset = MST - GMT0;
- else if ( tz == _T("MDT") )
+ else if ( tz == wxT("MDT") )
offset = MDT - GMT0;
- else if ( tz == _T("PST") )
+ else if ( tz == wxT("PST") )
offset = PST - GMT0;
- else if ( tz == _T("PDT") )
+ else if ( tz == wxT("PDT") )
offset = PDT - GMT0;
else
return false;
const wxString::const_iterator end = date.end();
for ( wxString::const_iterator fmt = format.begin(); fmt != format.end(); ++fmt )
{
- if ( *fmt != _T('%') )
+ if ( *fmt != wxT('%') )
{
if ( wxIsspace(*fmt) )
{
{
switch ( (*fmt).GetValue() )
{
- case _T('Y'): // year has 4 digits
+ case wxT('Y'): // year has 4 digits
width = 4;
break;
- case _T('j'): // day of year has 3 digits
- case _T('l'): // milliseconds have 3 digits
+ case wxT('j'): // day of year has 3 digits
+ case wxT('l'): // milliseconds have 3 digits
width = 3;
break;
- case _T('w'): // week day as number has only one
+ case wxT('w'): // week day as number has only one
width = 1;
break;
// then the format itself
switch ( (*fmt).GetValue() )
{
- case _T('a'): // a weekday name
- case _T('A'):
+ case wxT('a'): // a weekday name
+ case wxT('A'):
{
wday = GetWeekDayFromName
(
haveWDay = true;
break;
- case _T('b'): // a month name
- case _T('B'):
+ case wxT('b'): // a month name
+ case wxT('B'):
{
mon = GetMonthFromName
(
haveMon = true;
break;
- case _T('c'): // locale default date and time representation
+ case wxT('c'): // locale default date and time representation
{
wxDateTime dt;
}
break;
- case _T('d'): // day of a month (01-31)
+ case wxT('d'): // day of a month (01-31)
case 'e': // day of a month (1-31) (GNU extension)
if ( !GetNumericToken(width, input, end, &num) ||
(num > 31) || (num < 1) )
mday = (wxDateTime_t)num;
break;
- case _T('H'): // hour in 24h format (00-23)
+ case wxT('H'): // hour in 24h format (00-23)
if ( !GetNumericToken(width, input, end, &num) || (num > 23) )
{
// no match
hour = (wxDateTime_t)num;
break;
- case _T('I'): // hour in 12h format (01-12)
+ case wxT('I'): // hour in 12h format (01-12)
if ( !GetNumericToken(width, input, end, &num) ||
!num || (num > 12) )
{
hour = (wxDateTime_t)(num % 12); // 12 should be 0
break;
- case _T('j'): // day of the year
+ case wxT('j'): // day of the year
if ( !GetNumericToken(width, input, end, &num) ||
!num || (num > 366) )
{
yday = (wxDateTime_t)num;
break;
- case _T('l'): // milliseconds (0-999)
+ case wxT('l'): // milliseconds (0-999)
if ( !GetNumericToken(width, input, end, &num) )
return false;
msec = (wxDateTime_t)num;
break;
- case _T('m'): // month as a number (01-12)
+ case wxT('m'): // month as a number (01-12)
if ( !GetNumericToken(width, input, end, &num) ||
!num || (num > 12) )
{
mon = (Month)(num - 1);
break;
- case _T('M'): // minute as a decimal number (00-59)
+ case wxT('M'): // minute as a decimal number (00-59)
if ( !GetNumericToken(width, input, end, &num) ||
(num > 59) )
{
min = (wxDateTime_t)num;
break;
- case _T('p'): // AM or PM string
+ case wxT('p'): // AM or PM string
{
wxString am, pm;
GetAmPmStrings(&am, &pm);
}
break;
- case _T('r'): // time as %I:%M:%S %p
+ case wxT('r'): // time as %I:%M:%S %p
{
wxDateTime dt;
if ( !dt.ParseFormat(wxString(input, end),
}
break;
- case _T('R'): // time as %H:%M
+ case wxT('R'): // time as %H:%M
{
const wxDateTime
dt = ParseFormatAt(input, end, wxS("%H:%M"));
}
break;
- case _T('S'): // second as a decimal number (00-61)
+ case wxT('S'): // second as a decimal number (00-61)
if ( !GetNumericToken(width, input, end, &num) ||
(num > 61) )
{
sec = (wxDateTime_t)num;
break;
- case _T('T'): // time as %H:%M:%S
+ case wxT('T'): // time as %H:%M:%S
{
const wxDateTime
dt = ParseFormatAt(input, end, wxS("%H:%M:%S"));
}
break;
- case _T('w'): // weekday as a number (0-6), Sunday = 0
+ case wxT('w'): // weekday as a number (0-6), Sunday = 0
if ( !GetNumericToken(width, input, end, &num) ||
(wday > 6) )
{
wday = (WeekDay)num;
break;
- case _T('x'): // locale default date representation
+ case wxT('x'): // locale default date representation
{
wxString
fmtDate = wxLocale::GetInfo(wxLOCALE_SHORT_DATE_FMT),
break;
- case _T('X'): // locale default time representation
+ case wxT('X'): // locale default time representation
{
wxString fmtTime = wxLocale::GetInfo(wxLOCALE_TIME_FMT),
fmtTimeAlt;
}
break;
- case _T('y'): // year without century (00-99)
+ case wxT('y'): // year without century (00-99)
if ( !GetNumericToken(width, input, end, &num) ||
(num > 99) )
{
year = (num > 30 ? 1900 : 2000) + (wxDateTime_t)num;
break;
- case _T('Y'): // year with century
+ case wxT('Y'): // year with century
if ( !GetNumericToken(width, input, end, &num) )
{
// no match
year = (wxDateTime_t)num;
break;
- case _T('Z'): // timezone name
+ case wxT('Z'): // timezone name
// FIXME: currently we just ignore everything that looks like a
// time zone here
GetAlphaToken(input, end);
break;
- case _T('%'): // a percent sign
- if ( *input++ != _T('%') )
+ case wxT('%'): // a percent sign
+ if ( *input++ != wxT('%') )
{
// no match
return false;
break;
case 0: // the end of string
- wxFAIL_MSG(_T("unexpected format end"));
+ wxFAIL_MSG(wxT("unexpected format end"));
// fall through
}
wxCHECK_MSG( !format.empty(), wxEmptyString,
- _T("NULL format in wxTimeSpan::Format") );
+ wxT("NULL format in wxTimeSpan::Format") );
wxString str;
str.Alloc(format.length());
{
wxChar ch = *pch;
- if ( ch == _T('%') )
+ if ( ch == wxT('%') )
{
// the start of the format specification of the printf() below
- wxString fmtPrefix(_T('%'));
+ wxString fmtPrefix(wxT('%'));
// the number
long n;
switch ( ch )
{
default:
- wxFAIL_MSG( _T("invalid format character") );
+ wxFAIL_MSG( wxT("invalid format character") );
// fall through
- case _T('%'):
+ case wxT('%'):
str += ch;
// skip the part below switch
continue;
- case _T('D'):
+ case wxT('D'):
n = GetDays();
if ( partBiggest < Part_Day )
{
}
break;
- case _T('E'):
+ case wxT('E'):
partBiggest = Part_Week;
n = GetWeeks();
break;
- case _T('H'):
+ case wxT('H'):
n = GetHours();
if ( partBiggest < Part_Hour )
{
digits = 2;
break;
- case _T('l'):
+ case wxT('l'):
n = GetMilliseconds().ToLong();
if ( partBiggest < Part_MSec )
{
digits = 3;
break;
- case _T('M'):
+ case wxT('M'):
n = GetMinutes();
if ( partBiggest < Part_Min )
{
digits = 2;
break;
- case _T('S'):
+ case wxT('S'):
n = GetSeconds().ToLong();
if ( partBiggest < Part_Sec )
{
if ( digits )
{
- fmtPrefix << _T("0") << digits;
+ fmtPrefix << wxT("0") << digits;
}
- str += wxString::Format(fmtPrefix + _T("ld"), n);
+ str += wxString::Format(fmtPrefix + wxT("ld"), n);
}
else
{
wxString curLine;
for ( wxString::const_iterator pc = text.begin(); ; ++pc )
{
- if ( pc == text.end() || *pc == _T('\n') )
+ if ( pc == text.end() || *pc == wxT('\n') )
{
if ( curLine.empty() )
{
if ( !heightLineDefault )
{
// but we don't know it yet - choose something reasonable
- DoGetTextExtent(_T("W"), NULL, &heightLineDefault,
+ DoGetTextExtent(wxT("W"), NULL, &heightLineDefault,
NULL, NULL, font);
}
wxCoord ysrcMask)
{
wxCHECK_MSG( srcWidth && srcHeight && dstWidth && dstHeight, false,
- _T("invalid blit size") );
+ wxT("invalid blit size") );
// emulate the stretching by modifying the DC scale
double xscale = (double)srcWidth/dstWidth,
void wxBufferedDC::UnMask()
{
- wxCHECK_RET( m_dc, _T("no underlying wxDC?") );
- wxASSERT_MSG( m_buffer && m_buffer->IsOk(), _T("invalid backing store") );
+ wxCHECK_RET( m_dc, wxT("no underlying wxDC?") );
+ wxASSERT_MSG( m_buffer && m_buffer->IsOk(), wxT("invalid backing store") );
wxCoord x = 0,
y = 0;
static inline void
HexProperty(wxXmlNode *node, const wxChar *name, unsigned long value)
{
- node->AddAttribute(name, wxString::Format(_T("%08lx"), value));
+ node->AddAttribute(name, wxString::Format(wxT("%08lx"), value));
}
static inline void
NumProperty(wxXmlNode *node, const wxChar *name, unsigned long value)
{
- node->AddAttribute(name, wxString::Format(_T("%lu"), value));
+ node->AddAttribute(name, wxString::Format(wxT("%lu"), value));
}
static inline void
static inline void
HexElement(wxXmlNode *node, const wxChar *name, unsigned long value)
{
- TextElement(node, name, wxString::Format(_T("%08lx"), value));
+ TextElement(node, name, wxString::Format(wxT("%08lx"), value));
}
#endif // wxUSE_CRASHREPORT
{
m_isOk = true;
- wxXmlNode *nodeFrame = new wxXmlNode(wxXML_ELEMENT_NODE, _T("frame"));
+ wxXmlNode *nodeFrame = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("frame"));
m_nodeStack->AddChild(nodeFrame);
- NumProperty(nodeFrame, _T("level"), frame.GetLevel());
+ NumProperty(nodeFrame, wxT("level"), frame.GetLevel());
wxString func = frame.GetName();
if ( !func.empty() )
{
- nodeFrame->AddAttribute(_T("function"), func);
- HexProperty(nodeFrame, _T("offset"), frame.GetOffset());
+ nodeFrame->AddAttribute(wxT("function"), func);
+ HexProperty(nodeFrame, wxT("offset"), frame.GetOffset());
}
if ( frame.HasSourceLocation() )
{
- nodeFrame->AddAttribute(_T("file"), frame.GetFileName());
- NumProperty(nodeFrame, _T("line"), frame.GetLine());
+ nodeFrame->AddAttribute(wxT("file"), frame.GetFileName());
+ NumProperty(nodeFrame, wxT("line"), frame.GetLine());
}
const size_t nParams = frame.GetParamCount();
if ( nParams )
{
- wxXmlNode *nodeParams = new wxXmlNode(wxXML_ELEMENT_NODE, _T("parameters"));
+ wxXmlNode *nodeParams = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("parameters"));
nodeFrame->AddChild(nodeParams);
for ( size_t n = 0; n < nParams; n++ )
{
wxXmlNode *
- nodeParam = new wxXmlNode(wxXML_ELEMENT_NODE, _T("parameter"));
+ nodeParam = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("parameter"));
nodeParams->AddChild(nodeParam);
- NumProperty(nodeParam, _T("number"), n);
+ NumProperty(nodeParam, wxT("number"), n);
wxString type, name, value;
if ( !frame.GetParam(n, &type, &name, &value) )
continue;
if ( !type.empty() )
- TextElement(nodeParam, _T("type"), type);
+ TextElement(nodeParam, wxT("type"), type);
if ( !name.empty() )
- TextElement(nodeParam, _T("name"), name);
+ TextElement(nodeParam, wxT("name"), name);
if ( !value.empty() )
- TextElement(nodeParam, _T("value"), value);
+ TextElement(nodeParam, wxT("value"), value);
}
}
}
wxFileName fn;
fn.AssignTempFileName(appname);
#if wxUSE_DATETIME
- m_dir.Printf(_T("%s%c%s_dbgrpt-%lu-%s"),
+ m_dir.Printf(wxT("%s%c%s_dbgrpt-%lu-%s"),
fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(),
wxGetProcessId(),
- wxDateTime::Now().Format(_T("%Y%m%dT%H%M%S")).c_str());
+ wxDateTime::Now().Format(wxT("%Y%m%dT%H%M%S")).c_str());
#else
- m_dir.Printf(_T("%s%c%s_dbgrpt-%lu"),
+ m_dir.Printf(wxT("%s%c%s_dbgrpt-%lu"),
fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(),
wxGetProcessId());
#endif
if(wxTheApp)
return wxTheApp->GetAppDisplayName();
- return _T("wx");
+ return wxT("wx");
}
void
name = filename;
wxASSERT_MSG( wxFileName(GetDirectory(), name).FileExists(),
- _T("file should exist in debug report directory") );
+ wxT("file should exist in debug report directory") );
}
m_files.Add(name);
const wxString& description)
{
wxASSERT_MSG( !wxFileName(filename).IsAbsolute(),
- _T("filename should be relative to debug report directory") );
+ wxT("filename should be relative to debug report directory") );
wxFileName fn(GetDirectory(), filename);
- wxFFile file(fn.GetFullPath(), _T("w"));
+ wxFFile file(fn.GetFullPath(), wxT("w"));
if ( !file.IsOpened() || !file.Write(text) )
return false;
void wxDebugReport::RemoveFile(const wxString& name)
{
const int n = m_files.Index(name);
- wxCHECK_RET( n != wxNOT_FOUND, _T("No such file in wxDebugReport") );
+ wxCHECK_RET( n != wxNOT_FOUND, wxT("No such file in wxDebugReport") );
m_files.RemoveAt(n);
m_descriptions.RemoveAt(n);
bool wxDebugReport::DoAddSystemInfo(wxXmlNode *nodeSystemInfo)
{
- nodeSystemInfo->AddAttribute(_T("description"), wxGetOsDescription());
+ nodeSystemInfo->AddAttribute(wxT("description"), wxGetOsDescription());
return true;
}
{
const wxDynamicLibraryDetails& info = modules[n];
- wxXmlNode *nodeModule = new wxXmlNode(wxXML_ELEMENT_NODE, _T("module"));
+ wxXmlNode *nodeModule = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("module"));
nodeModules->AddChild(nodeModule);
wxString path = info.GetPath();
if ( path.empty() )
path = info.GetName();
if ( !path.empty() )
- nodeModule->AddAttribute(_T("path"), path);
+ nodeModule->AddAttribute(wxT("path"), path);
void *addr = NULL;
size_t len = 0;
if ( info.GetAddress(&addr, &len) )
{
- HexProperty(nodeModule, _T("address"), wxPtrToUInt(addr));
- HexProperty(nodeModule, _T("size"), len);
+ HexProperty(nodeModule, wxT("address"), wxPtrToUInt(addr));
+ HexProperty(nodeModule, wxT("size"), len);
}
wxString ver = info.GetVersion();
if ( !ver.empty() )
{
- nodeModule->AddAttribute(_T("version"), ver);
+ nodeModule->AddAttribute(wxT("version"), ver);
}
}
if ( !c.code )
return false;
- wxXmlNode *nodeExc = new wxXmlNode(wxXML_ELEMENT_NODE, _T("exception"));
+ wxXmlNode *nodeExc = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("exception"));
nodeContext->AddChild(nodeExc);
- HexProperty(nodeExc, _T("code"), c.code);
- nodeExc->AddAttribute(_T("name"), c.GetExceptionString());
- HexProperty(nodeExc, _T("address"), wxPtrToUInt(c.addr));
+ HexProperty(nodeExc, wxT("code"), c.code);
+ nodeExc->AddAttribute(wxT("name"), c.GetExceptionString());
+ HexProperty(nodeExc, wxT("address"), wxPtrToUInt(c.addr));
#ifdef __INTEL__
- wxXmlNode *nodeRegs = new wxXmlNode(wxXML_ELEMENT_NODE, _T("registers"));
+ wxXmlNode *nodeRegs = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("registers"));
nodeContext->AddChild(nodeRegs);
- HexElement(nodeRegs, _T("eax"), c.regs.eax);
- HexElement(nodeRegs, _T("ebx"), c.regs.ebx);
- HexElement(nodeRegs, _T("ecx"), c.regs.edx);
- HexElement(nodeRegs, _T("edx"), c.regs.edx);
- HexElement(nodeRegs, _T("esi"), c.regs.esi);
- HexElement(nodeRegs, _T("edi"), c.regs.edi);
-
- HexElement(nodeRegs, _T("ebp"), c.regs.ebp);
- HexElement(nodeRegs, _T("esp"), c.regs.esp);
- HexElement(nodeRegs, _T("eip"), c.regs.eip);
-
- HexElement(nodeRegs, _T("cs"), c.regs.cs);
- HexElement(nodeRegs, _T("ds"), c.regs.ds);
- HexElement(nodeRegs, _T("es"), c.regs.es);
- HexElement(nodeRegs, _T("fs"), c.regs.fs);
- HexElement(nodeRegs, _T("gs"), c.regs.gs);
- HexElement(nodeRegs, _T("ss"), c.regs.ss);
-
- HexElement(nodeRegs, _T("flags"), c.regs.flags);
+ HexElement(nodeRegs, wxT("eax"), c.regs.eax);
+ HexElement(nodeRegs, wxT("ebx"), c.regs.ebx);
+ HexElement(nodeRegs, wxT("ecx"), c.regs.edx);
+ HexElement(nodeRegs, wxT("edx"), c.regs.edx);
+ HexElement(nodeRegs, wxT("esi"), c.regs.esi);
+ HexElement(nodeRegs, wxT("edi"), c.regs.edi);
+
+ HexElement(nodeRegs, wxT("ebp"), c.regs.ebp);
+ HexElement(nodeRegs, wxT("esp"), c.regs.esp);
+ HexElement(nodeRegs, wxT("eip"), c.regs.eip);
+
+ HexElement(nodeRegs, wxT("cs"), c.regs.cs);
+ HexElement(nodeRegs, wxT("ds"), c.regs.ds);
+ HexElement(nodeRegs, wxT("es"), c.regs.es);
+ HexElement(nodeRegs, wxT("fs"), c.regs.fs);
+ HexElement(nodeRegs, wxT("gs"), c.regs.gs);
+ HexElement(nodeRegs, wxT("ss"), c.regs.ss);
+
+ HexElement(nodeRegs, wxT("flags"), c.regs.flags);
#endif // __INTEL__
return true;
bool wxDebugReport::AddContext(wxDebugReport::Context ctx)
{
- wxCHECK_MSG( IsOk(), false, _T("use IsOk() first") );
+ wxCHECK_MSG( IsOk(), false, wxT("use IsOk() first") );
// create XML dump of current context
wxXmlDocument xmldoc;
- wxXmlNode *nodeRoot = new wxXmlNode(wxXML_ELEMENT_NODE, _T("report"));
+ wxXmlNode *nodeRoot = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("report"));
xmldoc.SetRoot(nodeRoot);
- nodeRoot->AddAttribute(_T("version"), _T("1.0"));
- nodeRoot->AddAttribute(_T("kind"), ctx == Context_Current ? _T("user")
- : _T("exception"));
+ nodeRoot->AddAttribute(wxT("version"), wxT("1.0"));
+ nodeRoot->AddAttribute(wxT("kind"), ctx == Context_Current ? wxT("user")
+ : wxT("exception"));
// add system information
- wxXmlNode *nodeSystemInfo = new wxXmlNode(wxXML_ELEMENT_NODE, _T("system"));
+ wxXmlNode *nodeSystemInfo = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("system"));
if ( DoAddSystemInfo(nodeSystemInfo) )
nodeRoot->AddChild(nodeSystemInfo);
else
delete nodeSystemInfo;
// add information about the loaded modules
- wxXmlNode *nodeModules = new wxXmlNode(wxXML_ELEMENT_NODE, _T("modules"));
+ wxXmlNode *nodeModules = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("modules"));
if ( DoAddLoadedModules(nodeModules) )
nodeRoot->AddChild(nodeModules);
else
// current context is not very interesting otherwise
if ( ctx == Context_Exception )
{
- wxXmlNode *nodeContext = new wxXmlNode(wxXML_ELEMENT_NODE, _T("context"));
+ wxXmlNode *nodeContext = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("context"));
if ( DoAddExceptionInfo(nodeContext) )
nodeRoot->AddChild(nodeContext);
else
// add stack traceback
#if wxUSE_STACKWALKER
- wxXmlNode *nodeStack = new wxXmlNode(wxXML_ELEMENT_NODE, _T("stack"));
+ wxXmlNode *nodeStack = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("stack"));
XmlStackWalker sw(nodeStack);
#if wxUSE_ON_FATAL_EXCEPTION
if ( ctx == Context_Exception )
// save the entire context dump in a file
- wxFileName fn(m_dir, GetReportName(), _T("xml"));
+ wxFileName fn(m_dir, GetReportName(), wxT("xml"));
if ( !xmldoc.Save(fn.GetFullPath()) )
return false;
bool wxDebugReport::AddDump(Context ctx)
{
- wxCHECK_MSG( IsOk(), false, _T("use IsOk() first") );
+ wxCHECK_MSG( IsOk(), false, wxT("use IsOk() first") );
- wxFileName fn(m_dir, GetReportName(), _T("dmp"));
+ wxFileName fn(m_dir, GetReportName(), wxT("dmp"));
wxCrashReport::SetFileName(fn.GetFullPath());
if ( !(ctx == Context_Exception ? wxCrashReport::Generate()
bool wxDebugReport::DoProcess()
{
wxString msg(_("A debug report has been generated. It can be found in"));
- msg << _T("\n")
- _T("\t") << GetDirectory() << _T("\n\n")
+ msg << wxT("\n")
+ wxT("\t") << GetDirectory() << wxT("\n\n")
<< _("And includes the following files:\n");
wxString name, desc;
msg += _("\nPlease send this report to the program maintainer, thank you!\n");
- wxLogMessage(_T("%s"), msg.c_str());
+ wxLogMessage(wxT("%s"), msg.c_str());
// we have to do this or the report would be deleted, and we don't even
// have any way to ask the user if he wants to keep it from here
return false;
// create the streams
- wxFileName fn(GetDirectory(), GetReportName(), _T("zip"));
- wxFFileOutputStream os(fn.GetFullPath(), _T("wb"));
+ wxFileName fn(GetDirectory(), GetReportName(), wxT("zip"));
+ wxFFileOutputStream os(fn.GetFullPath(), wxT("wb"));
wxZipOutputStream zos(os, 9);
// add all files to the ZIP one
m_inputField(input),
m_curlCmd(curl)
{
- if ( m_uploadURL.Last() != _T('/') )
- m_uploadURL += _T('/');
+ if ( m_uploadURL.Last() != wxT('/') )
+ m_uploadURL += wxT('/');
m_uploadURL += action;
}
wxArrayString output, errors;
int rc = wxExecute(wxString::Format
(
- _T("%s -F %s=@\"%s\" %s"),
+ wxT("%s -F %s=@\"%s\" %s"),
m_curlCmd.c_str(),
m_inputField.c_str(),
GetCompressedFileName().c_str(),
{
for ( size_t n = 0; n < count; n++ )
{
- wxLogWarning(_T("%s"), errors[n].c_str());
+ wxLogWarning(wxT("%s"), errors[n].c_str());
}
}
int flags) const
{
wxCHECK_MSG( IsOpened(), (size_t)-1,
- _T("dir must be opened before traversing it") );
+ wxT("dir must be opened before traversing it") );
// the total number of files found
size_t nFiles = 0;
switch ( sink.OnDir(fulldirname) )
{
default:
- wxFAIL_MSG(_T("unexpected OnDir() return value") );
+ wxFAIL_MSG(wxT("unexpected OnDir() return value") );
// fall through
case wxDIR_STOP:
switch ( sink.OnOpenError(fulldirname) )
{
default:
- wxFAIL_MSG(_T("unexpected OnOpenError() return value") );
+ wxFAIL_MSG(wxT("unexpected OnOpenError() return value") );
// fall through
case wxDIR_STOP:
break;
wxASSERT_MSG( res == wxDIR_CONTINUE,
- _T("unexpected OnFile() return value") );
+ wxT("unexpected OnFile() return value") );
nFiles++;
const wxString& filespec,
int flags)
{
- wxCHECK_MSG( files, (size_t)-1, _T("NULL pointer in wxDir::GetAllFiles") );
+ wxCHECK_MSG( files, (size_t)-1, wxT("NULL pointer in wxDir::GetAllFiles") );
size_t nFiles = 0;
// the static messages created by CreateTextSizer() (used by wxMessageBox,
// for example), we don't want this special meaning, so we need to quote it
wxString text(message);
- text.Replace(_T("&"), _T("&&"));
+ text.Replace(wxT("&"), wxT("&&"));
wxTextSizerWrapper wrapper(this);
bool wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream)
{
- wxFFile file(filename, _T("rb"));
+ wxFFile file(filename, wxT("rb"));
if ( !file.IsOpened() )
return false;
bool wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename)
{
- wxFFile file(filename, _T("wb"));
+ wxFFile file(filename, wxT("wb"));
if ( !file.IsOpened() )
return false;
bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream)
{
- wxFFile file(filename, _T("rb"));
+ wxFFile file(filename, wxT("rb"));
if ( !file.IsOpened() )
return false;
bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename)
{
- wxFFile file(filename, _T("wb"));
+ wxFFile file(filename, wxT("wb"));
if ( !file.IsOpened() )
return false;
/* static */ int wxDisplay::GetFromWindow(const wxWindow *window)
{
- wxCHECK_MSG( window, wxNOT_FOUND, _T("invalid window") );
+ wxCHECK_MSG( window, wxNOT_FOUND, wxT("invalid window") );
return Factory().GetFromWindow(window);
}
wxRect wxDisplay::GetGeometry() const
{
- wxCHECK_MSG( IsOk(), wxRect(), _T("invalid wxDisplay object") );
+ wxCHECK_MSG( IsOk(), wxRect(), wxT("invalid wxDisplay object") );
return m_impl->GetGeometry();
}
wxRect wxDisplay::GetClientArea() const
{
- wxCHECK_MSG( IsOk(), wxRect(), _T("invalid wxDisplay object") );
+ wxCHECK_MSG( IsOk(), wxRect(), wxT("invalid wxDisplay object") );
return m_impl->GetClientArea();
}
wxString wxDisplay::GetName() const
{
- wxCHECK_MSG( IsOk(), wxString(), _T("invalid wxDisplay object") );
+ wxCHECK_MSG( IsOk(), wxString(), wxT("invalid wxDisplay object") );
return m_impl->GetName();
}
wxArrayVideoModes wxDisplay::GetModes(const wxVideoMode& mode) const
{
- wxCHECK_MSG( IsOk(), wxArrayVideoModes(), _T("invalid wxDisplay object") );
+ wxCHECK_MSG( IsOk(), wxArrayVideoModes(), wxT("invalid wxDisplay object") );
return m_impl->GetModes(mode);
}
wxVideoMode wxDisplay::GetCurrentMode() const
{
- wxCHECK_MSG( IsOk(), wxVideoMode(), _T("invalid wxDisplay object") );
+ wxCHECK_MSG( IsOk(), wxVideoMode(), wxT("invalid wxDisplay object") );
return m_impl->GetCurrentMode();
}
bool wxDisplay::ChangeMode(const wxVideoMode& mode)
{
- wxCHECK_MSG( IsOk(), false, _T("invalid wxDisplay object") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid wxDisplay object") );
return m_impl->ChangeMode(mode);
}
// ---------------------------------------------------------------------------
#if defined(__WXPM__) || defined(__EMX__)
- const wxString wxDynamicLibrary::ms_dllext(_T(".dll"));
+ const wxString wxDynamicLibrary::ms_dllext(wxT(".dll"));
#endif
// for MSW/Unix it is defined in platform-specific file
bool wxDynamicLibrary::Load(const wxString& libnameOrig, int flags)
{
- wxASSERT_MSG(m_handle == 0, _T("Library already loaded."));
+ wxASSERT_MSG(m_handle == 0, wxT("Library already loaded."));
// add the proper extension for the DLL ourselves unless told not to
wxString libname = libnameOrig;
void *wxDynamicLibrary::DoGetSymbol(const wxString &name, bool *success) const
{
wxCHECK_MSG( IsLoaded(), NULL,
- _T("Can't load symbol from unloaded library") );
+ wxT("Can't load symbol from unloaded library") );
void *symbol = 0;
switch ( cat )
{
default:
- wxFAIL_MSG( _T("unknown wxDynamicLibraryCategory value") );
+ wxFAIL_MSG( wxT("unknown wxDynamicLibraryCategory value") );
// fall through
case wxDL_MODULE:
case wxDL_LIBRARY:
// library names should start with "lib" under Unix
- nameCanonic = _T("lib");
+ nameCanonic = wxT("lib");
break;
}
#else // !__UNIX__
suffix = wxPlatformInfo::Get().GetPortIdShortName();
}
#if wxUSE_UNICODE
- suffix << _T('u');
+ suffix << wxT('u');
#endif
#ifdef __WXDEBUG__
- suffix << _T('d');
+ suffix << wxT('d');
#endif
if ( !suffix.empty() )
- suffix = wxString(_T("_")) + suffix;
+ suffix = wxString(wxT("_")) + suffix;
#define WXSTRINGIZE(x) #x
#if defined(__UNIX__) && !defined(__EMX__)
#ifdef __WINDOWS__
// Add compiler identification:
#if defined(__GNUG__)
- suffix << _T("_gcc");
+ suffix << wxT("_gcc");
#elif defined(__VISUALC__)
- suffix << _T("_vc");
+ suffix << wxT("_vc");
#elif defined(__WATCOMC__)
- suffix << _T("_wat");
+ suffix << wxT("_wat");
#elif defined(__BORLANDC__)
- suffix << _T("_bcc");
+ suffix << wxT("_bcc");
#endif
#endif
wxPluginLibrary *wxPluginLibrary::RefLib()
{
wxCHECK_MSG( m_linkcount > 0, NULL,
- _T("Library had been already deleted!") );
+ wxT("Library had been already deleted!") );
++m_linkcount;
return this;
bool wxPluginLibrary::UnrefLib()
{
wxASSERT_MSG( m_objcount == 0,
- _T("Library unloaded before all objects were destroyed") );
+ wxT("Library unloaded before all objects were destroyed") );
if ( m_linkcount == 0 || --m_linkcount == 0 )
{
// though, as there is currently no way to Unregister it without it.
wxASSERT_MSG( m_linkcount == 1,
- _T("RegisterModules should only be called for the first load") );
+ wxT("RegisterModules should only be called for the first load") );
for ( const wxClassInfo *info = m_after; info != m_before; info = info->GetNext())
{
{
wxModule *m = wxDynamicCast(info->CreateObject(), wxModule);
- wxASSERT_MSG( m, _T("wxDynamicCast of wxModule failed") );
+ wxASSERT_MSG( m, wxT("wxDynamicCast of wxModule failed") );
m_wxmodules.push_back(m);
wxModule::RegisterModule(m);
{
if( !(*it)->Init() )
{
- wxLogDebug(_T("wxModule::Init() failed for wxPluginLibrary"));
+ wxLogDebug(wxT("wxModule::Init() failed for wxPluginLibrary"));
// XXX: Watch this, a different hash implementation might break it,
// a good hash implementation would let us fix it though.
if ( entry )
{
- wxLogTrace(_T("dll"),
- _T("LoadLibrary(%s): already loaded."), realname.c_str());
+ wxLogTrace(wxT("dll"),
+ wxT("LoadLibrary(%s): already loaded."), realname.c_str());
entry->RefLib();
}
{
(*ms_manifest)[realname] = entry;
- wxLogTrace(_T("dll"),
- _T("LoadLibrary(%s): loaded ok."), realname.c_str());
+ wxLogTrace(wxT("dll"),
+ wxT("LoadLibrary(%s): loaded ok."), realname.c_str());
}
else
{
- wxLogTrace(_T("dll"),
- _T("LoadLibrary(%s): failed to load."), realname.c_str());
+ wxLogTrace(wxT("dll"),
+ wxT("LoadLibrary(%s): failed to load."), realname.c_str());
// we have created entry just above
if ( !entry->UnrefLib() )
{
// ... so UnrefLib() is supposed to delete it
- wxFAIL_MSG( _T("Currently linked library is not loaded?") );
+ wxFAIL_MSG( wxT("Currently linked library is not loaded?") );
}
entry = NULL;
if ( !entry )
{
- wxLogDebug(_T("Attempt to unload library '%s' which is not loaded."),
+ wxLogDebug(wxT("Attempt to unload library '%s' which is not loaded."),
libname.c_str());
return false;
}
- wxLogTrace(_T("dll"), _T("UnloadLibrary(%s)"), realname.c_str());
+ wxLogTrace(wxT("dll"), wxT("UnloadLibrary(%s)"), realname.c_str());
if ( !entry->UnrefLib() )
{
void wxPluginManager::Unload()
{
- wxCHECK_RET( m_entry, _T("unloading an invalid wxPluginManager?") );
+ wxCHECK_RET( m_entry, wxT("unloading an invalid wxPluginManager?") );
for ( wxDLManifest::iterator i = ms_manifest->begin();
i != ms_manifest->end();
int wxEventLoopManual::Run()
{
// event loops are not recursive, you need to create another loop!
- wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") );
+ wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") );
// ProcessIdle() and ProcessEvents() below may throw so the code here should
// be exception-safe, hence we must use local objects for all actions we
void wxEventLoopManual::Exit(int rc)
{
- wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") );
+ wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") );
m_exitcode = rc;
m_shouldExit = true;
wxFileOffset wxFFile::Tell() const
{
wxCHECK_MSG( IsOpened(), wxInvalidOffset,
- _T("wxFFile::Tell(): file is closed!") );
+ wxT("wxFFile::Tell(): file is closed!") );
wxFileOffset rc = wxFtell(m_fp);
if ( rc == wxInvalidOffset )
wxFileOffset wxFFile::Length() const
{
wxCHECK_MSG( IsOpened(), wxInvalidOffset,
- _T("wxFFile::Length(): file is closed!") );
+ wxT("wxFFile::Length(): file is closed!") );
wxFFile& self = *(wxFFile *)this; // const_cast
// seek
wxFileOffset wxFile::Seek(wxFileOffset ofs, wxSeekMode mode)
{
- wxASSERT_MSG( IsOpened(), _T("can't seek on closed file") );
+ wxASSERT_MSG( IsOpened(), wxT("can't seek on closed file") );
wxCHECK_MSG( ofs != wxInvalidOffset || mode != wxFromStart,
wxInvalidOffset,
- _T("invalid absolute file offset") );
+ wxT("invalid absolute file offset") );
int origin;
switch ( mode ) {
default:
- wxFAIL_MSG(_T("unknown seek origin"));
+ wxFAIL_MSG(wxT("unknown seek origin"));
case wxFromStart:
origin = SEEK_SET;
}
else if ( iRc != 1 )
{
- wxFAIL_MSG(_T("invalid eof() return value."));
+ wxFAIL_MSG(wxT("invalid eof() return value."));
}
return true;
#define MAX_PATH 512
#endif
-#define FILECONF_TRACE_MASK _T("fileconf")
+#define FILECONF_TRACE_MASK wxT("fileconf")
// ----------------------------------------------------------------------------
// global functions declarations
bool wxFileConfig::DoReadBinary(const wxString& key, wxMemoryBuffer* buf) const
{
- wxCHECK_MSG( buf, false, _T("NULL buffer") );
+ wxCHECK_MSG( buf, false, wxT("NULL buffer") );
wxString str;
if ( !Read(key, &str) )
wxString strName = path.Name();
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" Writing String '%s' = '%s' to Group '%s'"),
+ wxT(" Writing String '%s' = '%s' to Group '%s'"),
strName.c_str(),
szValue.c_str(),
GetPath().c_str() );
// ... except if it's empty in which case it's a way to force it's creation
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" Creating group %s"),
+ wxT(" Creating group %s"),
m_pCurrentGroup->Name().c_str() );
SetDirty();
if ( pEntry == 0 )
{
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" Adding Entry %s"),
+ wxT(" Adding Entry %s"),
strName.c_str() );
pEntry = m_pCurrentGroup->AddEntry(strName);
}
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" Setting value %s"),
+ wxT(" Setting value %s"),
szValue.c_str() );
pEntry->SetValue(szValue);
bool wxFileConfig::DoWriteLong(const wxString& key, long lValue)
{
- return Write(key, wxString::Format(_T("%ld"), lValue));
+ return Write(key, wxString::Format(wxT("%ld"), lValue));
}
#if wxUSE_BASE64
const wxString& newName)
{
wxASSERT_MSG( oldName.find(wxCONFIG_PATH_SEPARATOR) == wxString::npos,
- _T("RenameEntry(): paths are not supported") );
+ wxT("RenameEntry(): paths are not supported") );
// check that the entry exists
wxFileConfigEntry *oldEntry = m_pCurrentGroup->FindEntry(oldName);
wxFileConfigLineList *wxFileConfig::LineListAppend(const wxString& str)
{
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" ** Adding Line '%s'"),
+ wxT(" ** Adding Line '%s'"),
str.c_str() );
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" head: %s"),
+ wxT(" head: %s"),
((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str()
: wxEmptyString) );
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" tail: %s"),
+ wxT(" tail: %s"),
((m_linesTail) ? (const wxChar*)m_linesTail->Text().c_str()
: wxEmptyString) );
m_linesTail = pLine;
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" head: %s"),
+ wxT(" head: %s"),
((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str()
: wxEmptyString) );
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" tail: %s"),
+ wxT(" tail: %s"),
((m_linesTail) ? (const wxChar*)m_linesTail->Text().c_str()
: wxEmptyString) );
wxFileConfigLineList *pLine)
{
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" ** Inserting Line '%s' after '%s'"),
+ wxT(" ** Inserting Line '%s' after '%s'"),
str.c_str(),
((pLine) ? (const wxChar*)pLine->Text().c_str()
: wxEmptyString) );
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" head: %s"),
+ wxT(" head: %s"),
((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str()
: wxEmptyString) );
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" tail: %s"),
+ wxT(" tail: %s"),
((m_linesTail) ? (const wxChar*)m_linesTail->Text().c_str()
: wxEmptyString) );
}
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" head: %s"),
+ wxT(" head: %s"),
((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str()
: wxEmptyString) );
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" tail: %s"),
+ wxT(" tail: %s"),
((m_linesTail) ? (const wxChar*)m_linesTail->Text().c_str()
: wxEmptyString) );
void wxFileConfig::LineListRemove(wxFileConfigLineList *pLine)
{
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" ** Removing Line '%s'"),
+ wxT(" ** Removing Line '%s'"),
pLine->Text().c_str() );
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" head: %s"),
+ wxT(" head: %s"),
((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str()
: wxEmptyString) );
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" tail: %s"),
+ wxT(" tail: %s"),
((m_linesTail) ? (const wxChar*)m_linesTail->Text().c_str()
: wxEmptyString) );
pNext->SetPrev(pPrev);
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" head: %s"),
+ wxT(" head: %s"),
((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str()
: wxEmptyString) );
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" tail: %s"),
+ wxT(" tail: %s"),
((m_linesTail) ? (const wxChar*)m_linesTail->Text().c_str()
: wxEmptyString) );
// for a normal (i.e. not root) group this method shouldn't be called twice
// unless we are resetting the line
wxASSERT_MSG( !m_pParent || !m_pLine || !pLine,
- _T("changing line for a non-root group?") );
+ wxT("changing line for a non-root group?") );
m_pLine = pLine;
}
wxFileConfigLineList *wxFileConfigGroup::GetGroupLine()
{
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" GetGroupLine() for Group '%s'"),
+ wxT(" GetGroupLine() for Group '%s'"),
Name().c_str() );
if ( !m_pLine )
{
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" Getting Line item pointer") );
+ wxT(" Getting Line item pointer") );
wxFileConfigGroup *pParent = Parent();
if ( pParent )
{
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" checking parent '%s'"),
+ wxT(" checking parent '%s'"),
pParent->Name().c_str() );
wxString strFullName;
{
wxFileConfigLineList *pLine = m_pLastGroup->GetLastGroupLine();
- wxASSERT_MSG( pLine, _T("last group must have !NULL associated line") );
+ wxASSERT_MSG( pLine, wxT("last group must have !NULL associated line") );
return pLine;
}
wxFileConfigLineList *wxFileConfigGroup::GetLastEntryLine()
{
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" GetLastEntryLine() for Group '%s'"),
+ wxT(" GetLastEntryLine() for Group '%s'"),
Name().c_str() );
if ( m_pLastEntry )
{
wxFileConfigLineList *pLine = m_pLastEntry->GetLine();
- wxASSERT_MSG( pLine, _T("last entry must have !NULL associated line") );
+ wxASSERT_MSG( pLine, wxT("last entry must have !NULL associated line") );
return pLine;
}
// the only situation in which a group without its own line can have
// an entry is when the first entry is added to the initially empty
// root pseudo-group
- wxASSERT_MSG( !m_pParent, _T("unexpected for non root group") );
+ wxASSERT_MSG( !m_pParent, wxT("unexpected for non root group") );
// let the group know that it does have a line in the file now
m_pLine = pEntry->GetLine();
{
// update the line of this group
wxFileConfigLineList *line = GetGroupLine();
- wxCHECK_RET( line, _T("a non root group must have a corresponding line!") );
+ wxCHECK_RET( line, wxT("a non root group must have a corresponding line!") );
// +1: skip the leading '/'
- line->SetText(wxString::Format(_T("[%s]"), GetFullName().c_str() + 1));
+ line->SetText(wxString::Format(wxT("[%s]"), GetFullName().c_str() + 1));
// also update all subgroups as they have this groups name in their lines
void wxFileConfigGroup::Rename(const wxString& newName)
{
- wxCHECK_RET( m_pParent, _T("the root group can't be renamed") );
+ wxCHECK_RET( m_pParent, wxT("the root group can't be renamed") );
if ( newName == m_strName )
return;
// other data structures.
bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup)
{
- wxCHECK_MSG( pGroup, false, _T("deleting non existing group?") );
+ wxCHECK_MSG( pGroup, false, wxT("deleting non existing group?") );
wxLogTrace( FILECONF_TRACE_MASK,
- _T("Deleting group '%s' from '%s'"),
+ wxT("Deleting group '%s' from '%s'"),
pGroup->Name().c_str(),
Name().c_str() );
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" (m_pLine) = prev: %p, this %p, next %p"),
+ wxT(" (m_pLine) = prev: %p, this %p, next %p"),
m_pLine ? static_cast<void*>(m_pLine->Prev()) : 0,
static_cast<void*>(m_pLine),
m_pLine ? static_cast<void*>(m_pLine->Next()) : 0 );
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" text: '%s'"),
+ wxT(" text: '%s'"),
m_pLine ? (const wxChar*)m_pLine->Text().c_str()
: wxEmptyString );
size_t nCount = pGroup->m_aEntries.GetCount();
wxLogTrace(FILECONF_TRACE_MASK,
- _T("Removing %lu entries"), (unsigned long)nCount );
+ wxT("Removing %lu entries"), (unsigned long)nCount );
for ( size_t nEntry = 0; nEntry < nCount; nEntry++ )
{
if ( pLine )
{
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" '%s'"),
+ wxT(" '%s'"),
pLine->Text().c_str() );
m_pConfig->LineListRemove(pLine);
}
nCount = pGroup->m_aSubgroups.GetCount();
wxLogTrace( FILECONF_TRACE_MASK,
- _T("Removing %lu subgroups"), (unsigned long)nCount );
+ wxT("Removing %lu subgroups"), (unsigned long)nCount );
for ( size_t nGroup = 0; nGroup < nCount; nGroup++ )
{
if ( pLine )
{
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" Removing line for group '%s' : '%s'"),
+ wxT(" Removing line for group '%s' : '%s'"),
pGroup->Name().c_str(),
pLine->Text().c_str() );
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" Removing from group '%s' : '%s'"),
+ wxT(" Removing from group '%s' : '%s'"),
Name().c_str(),
((m_pLine) ? (const wxChar*)m_pLine->Text().c_str()
: wxEmptyString) );
if ( pGroup == m_pLastGroup )
{
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" Removing last group") );
+ wxT(" Removing last group") );
// our last entry is being deleted, so find the last one which
// stays by going back until we find a subgroup or reach the
else
{
wxLogTrace( FILECONF_TRACE_MASK,
- _T(" No line entry for Group '%s'?"),
+ wxT(" No line entry for Group '%s'?"),
pGroup->Name().c_str() );
}
for ( const wxChar *pc = str.c_str(); *pc != '\0'; pc++ ) {
if ( *pc == wxT('\\') ) {
// we need to test it here or we'd skip past the NUL in the loop line
- if ( *++pc == _T('\0') )
+ if ( *++pc == wxT('\0') )
break;
}
if (s)
while (*s)
{
- if (*s == _T('\\'))
- *s = _T('/');
+ if (*s == wxT('\\'))
+ *s = wxT('/');
#ifdef __WXMSW__
else
*s = wxTolower(*s); // Case INDEPENDENT
while ( wxEndsWithPathSeparator(strPath) )
{
size_t len = strPath.length();
- if ( len == 1 || (len == 3 && strPath[len - 2] == _T(':')) )
+ if ( len == 1 || (len == 3 && strPath[len - 2] == wxT(':')) )
break;
strPath.Truncate(len - 1);
#ifdef __OS2__
// OS/2 can't handle "d:", it wants either "d:\" or "d:."
- if (strPath.length() == 2 && strPath[1u] == _T(':'))
- strPath << _T('.');
+ if (strPath.length() == 2 && strPath[1u] == wxT(':'))
+ strPath << wxT('.');
#endif
#if defined(__WXPALMOS__)
{
#if defined(__WXPALMOS__)
// TODO
- if(buf && sz>0) buf[0] = _T('\0');
+ if(buf && sz>0) buf[0] = wxT('\0');
return buf;
#elif defined(__WXWINCE__)
// TODO
- if(buf && sz>0) buf[0] = _T('\0');
+ if(buf && sz>0) buf[0] = wxT('\0');
return buf;
#else
if ( !buf )
// sense at all to me - empty string is a better error indicator
// (NULL might be even better but I'm afraid this could lead to
// problems with the old code assuming the return is never NULL)
- buf[0] = _T('\0');
+ buf[0] = wxT('\0');
}
else // ok, but we might need to massage the path into the right format
{
#if defined(__OS2__)
if (d[1] == ':')
{
- ::DosSetDefaultDisk(wxToupper(d[0]) - _T('A') + 1);
+ ::DosSetDefaultDisk(wxToupper(d[0]) - wxT('A') + 1);
// do not call DosSetCurrentDir when just changing drive,
// since it requires e.g. "d:." instead of "d:"!
if (d.length() == 2)
{
// we assume that it's not empty
wxCHECK_MSG( !szFile.empty(), false,
- _T("empty file name in wxFindFileInPath"));
+ wxT("empty file name in wxFindFileInPath"));
// skip path separator in the beginning of the file name if present
wxString szFile2;
}
else
{
- wxFAIL_MSG( _T("missing '|' in the wildcard string!") );
+ wxFAIL_MSG( wxT("missing '|' in the wildcard string!") );
}
break;
{
wxString before = descriptions[k].Left(pos);
wxString after = descriptions[k].Mid(pos+filters[k].Len());
- pos = before.Find(_T('('),true);
- if (pos>before.Find(_T(')'),true))
+ pos = before.Find(wxT('('),true);
+ if (pos>before.Find(wxT(')'),true))
{
before = before.Left(pos+1);
before << filters[k];
- pos = after.Find(_T(')'));
- int pos1 = after.Find(_T('('));
+ pos = after.Find(wxT(')'));
+ int pos1 = after.Find(wxT('('));
if (pos != wxNOT_FOUND && (pos<pos1 || pos1==wxNOT_FOUND))
{
before << after.Mid(pos);
FILETIME ftLocal;
if ( !::FileTimeToLocalFileTime(&ftcopy, &ftLocal) )
{
- wxLogLastError(_T("FileTimeToLocalFileTime"));
+ wxLogLastError(wxT("FileTimeToLocalFileTime"));
}
SYSTEMTIME st;
if ( !::FileTimeToSystemTime(&ftLocal, &st) )
{
- wxLogLastError(_T("FileTimeToSystemTime"));
+ wxLogLastError(wxT("FileTimeToSystemTime"));
}
dt->Set(st.wDay, wxDateTime::Month(st.wMonth - 1), st.wYear,
FILETIME ftLocal;
if ( !::SystemTimeToFileTime(&st, &ftLocal) )
{
- wxLogLastError(_T("SystemTimeToFileTime"));
+ wxLogLastError(wxT("SystemTimeToFileTime"));
}
if ( !::LocalFileTimeToFileTime(&ftLocal, ft) )
{
- wxLogLastError(_T("LocalFileTimeToFileTime"));
+ wxLogLastError(wxT("LocalFileTimeToFileTime"));
}
}
break;
default:
- wxFAIL_MSG( _T("Unknown path format") );
+ wxFAIL_MSG( wxT("Unknown path format") );
// !! Fall through !!
case wxPATH_UNIX:
SplitPath(fullname, &volDummy, &pathDummy, &name, &ext, &hasExt, format);
wxASSERT_MSG( volDummy.empty() && pathDummy.empty(),
- _T("the file name shouldn't contain the path") );
+ wxT("the file name shouldn't contain the path") );
SplitPath(fullpath, &volume, &path, &nameDummy, &extDummy, format);
wxASSERT_MSG( nameDummy.empty() && extDummy.empty(),
- _T("the path shouldn't contain file name nor extension") );
+ wxT("the path shouldn't contain file name nor extension") );
Assign(volume, path, name, ext, hasExt, format);
}
{
#ifndef wx_fdopen
*deleteOnClose = false;
- return file->Open(path, _T("w+b"));
+ return file->Open(path, wxT("w+b"));
#else // wx_fdopen
int fd = wxTempOpen(path, deleteOnClose);
if (fd == -1)
if ( !::GetTempFileName(dir.fn_str(), name.fn_str(), 0,
wxStringBuffer(path, MAX_PATH + 1)) )
{
- wxLogLastError(_T("GetTempFileName"));
+ wxLogLastError(wxT("GetTempFileName"));
path.clear();
}
#if defined(HAVE_MKSTEMP)
// scratch space for mkstemp()
- path += _T("XXXXXX");
+ path += wxT("XXXXXX");
// we need to copy the path to the buffer in which mkstemp() can modify it
wxCharBuffer buf(path.fn_str());
#ifdef wx_fdopen
ffileTemp->Attach(wx_fdopen(fdTemp, "r+b"));
#else
- ffileTemp->Open(path, _T("r+b"));
+ ffileTemp->Open(path, wxT("r+b"));
close(fdTemp);
#endif
}
#ifdef HAVE_MKTEMP
// same as above
- path += _T("XXXXXX");
+ path += wxT("XXXXXX");
wxCharBuffer buf = wxConvFile.cWX2MB( path );
if ( !mktemp( (char*)(const char*) buf ) )
for ( size_t n = 0; n < numTries; n++ )
{
// 3 hex digits is enough for numTries == 1000 < 4096
- pathTry = path + wxString::Format(_T("%.03x"), (unsigned int) n);
+ pathTry = path + wxString::Format(wxT("%.03x"), (unsigned int) n);
if ( !wxFileName::FileExists(pathTry) )
{
break;
#elif defined(__WINDOWS__) && !defined(__WXMICROWIN__)
if ( !::GetTempPath(MAX_PATH, wxStringBuffer(dir, MAX_PATH + 1)) )
{
- wxLogLastError(_T("GetTempPath"));
+ wxLogLastError(wxT("GetTempPath"));
}
#elif defined(__WXMAC__) && wxOSX_USE_CARBON
dir = wxMacFindFolder(short(kOnSystemDisk), kTemporaryFolderType, kCreateFolder);
wxString path(dir);
if ( path.Last() == wxFILE_SEP_PATH )
path.RemoveLast();
- path += _T('\0');
+ path += wxT('\0');
SHFILEOPSTRUCT fileop;
wxZeroMemory(fileop);
{
// SHFileOperation may return non-Win32 error codes, so the error
// message can be incorrect
- wxLogApiError(_T("SHFileOperation"), ret);
+ wxLogApiError(wxT("SHFileOperation"), ret);
return false;
}
if ( !dirs.IsEmpty() )
{
wxString dir = dirs[0u];
- if ( !dir.empty() && dir[0u] == _T('~') )
+ if ( !dir.empty() && dir[0u] == wxT('~') )
{
// to make the path absolute use the home directory
curDir.AssignDir(wxGetUserHome(dir.c_str() + 1));
{
wxString dir = m_dirs[0u];
- if (!dir.empty() && dir[0u] == _T('~'))
+ if (!dir.empty() && dir[0u] == wxT('~'))
return true;
}
}
// files)
if ( m_dirs.IsEmpty() && IsDir() )
{
- m_dirs.Add(_T('.'));
+ m_dirs.Add(wxT('.'));
}
}
break;
default:
- wxFAIL_MSG( _T("Unknown wxPATH_XXX style") );
+ wxFAIL_MSG( wxT("Unknown wxPATH_XXX style") );
// fall through
case wxPATH_UNIX:
// under VMS the end of the path is ']', not the path separator used to
// separate the components
- return format == wxPATH_VMS ? wxString(_T(']')) : GetPathSeparators(format);
+ return format == wxPATH_VMS ? wxString(wxT(']')) : GetPathSeparators(format);
}
/* static */
{
// wxString::Find() doesn't work as expected with NUL - it will always find
// it, so test for it separately
- return ch != _T('\0') && GetPathSeparators(format).Find(ch) != wxNOT_FOUND;
+ return ch != wxT('\0') && GetPathSeparators(format).Find(ch) != wxNOT_FOUND;
}
// ----------------------------------------------------------------------------
{
if ( dir.empty() )
{
- wxFAIL_MSG( _T("empty directory passed to wxFileName::InsertDir()") );
+ wxFAIL_MSG( wxT("empty directory passed to wxFileName::InsertDir()") );
return false;
}
{
if ( dir[n] == GetVolumeSeparator() || IsPathSeparator(dir[n]) )
{
- wxFAIL_MSG( _T("invalid directory component in wxFileName") );
+ wxFAIL_MSG( wxT("invalid directory component in wxFileName") );
return false;
}
{
s_triedToLoad = true;
- wxDynamicLibrary dllKernel(_T("kernel32"));
+ wxDynamicLibrary dllKernel(wxT("kernel32"));
- const wxChar* GetLongPathName = _T("GetLongPathName")
+ const wxChar* GetLongPathName = wxT("GetLongPathName")
#if wxUSE_UNICODE
- _T("W");
+ wxT("W");
#else // ANSI
- _T("A");
+ wxT("A");
#endif // Unicode/ANSI
if ( dllKernel.HasSymbol(GetLongPathName) )
if ( (posLastDot != wxString::npos) &&
(posLastDot == 0 ||
IsPathSeparator(fullpath[posLastDot - 1]) ||
- (format == wxPATH_VMS && fullpath[posLastDot - 1] == _T(']'))) )
+ (format == wxPATH_VMS && fullpath[posLastDot - 1] == wxT(']'))) )
{
// dot may be (and commonly -- at least under Unix -- is) the first
// character of the filename, don't treat the entire filename as
// special VMS hack: remove the initial bracket
if ( format == wxPATH_VMS )
{
- if ( (*pstrPath)[0u] == _T('[') )
+ if ( (*pstrPath)[0u] == wxT('[') )
pstrPath->erase(0, 1);
}
}
// check that the styles are not contradictory
wxASSERT_MSG( !(HasFlag(wxFLP_SAVE) && HasFlag(wxFLP_OPEN)),
- _T("can't specify both wxFLP_SAVE and wxFLP_OPEN at once") );
+ wxT("can't specify both wxFLP_SAVE and wxFLP_OPEN at once") );
wxASSERT_MSG( !HasFlag(wxFLP_SAVE) || !HasFlag(wxFLP_FILE_MUST_EXIST),
- _T("wxFLP_FILE_MUST_EXIST can't be used with wxFLP_SAVE" ) );
+ wxT("wxFLP_FILE_MUST_EXIST can't be used with wxFLP_SAVE" ) );
wxASSERT_MSG( !HasFlag(wxFLP_OPEN) || !HasFlag(wxFLP_OVERWRITE_PROMPT),
- _T("wxFLP_OVERWRITE_PROMPT can't be used with wxFLP_OPEN") );
+ wxT("wxFLP_OVERWRITE_PROMPT can't be used with wxFLP_OPEN") );
// create a wxFilePickerWidget or a wxDirPickerWidget...
m_pickerIface = CreatePicker(this, path, message, wildcard);
{
static const wxFileTypeInfo fallbacks[] =
{
- wxFileTypeInfo(_T("image/jpeg"),
+ wxFileTypeInfo(wxT("image/jpeg"),
wxEmptyString,
wxEmptyString,
- _T("JPEG image (from fallback)"),
- _T("jpg"), _T("jpeg"), _T("JPG"), _T("JPEG"), wxNullPtr),
- wxFileTypeInfo(_T("image/gif"),
+ wxT("JPEG image (from fallback)"),
+ wxT("jpg"), wxT("jpeg"), wxT("JPG"), wxT("JPEG"), wxNullPtr),
+ wxFileTypeInfo(wxT("image/gif"),
wxEmptyString,
wxEmptyString,
- _T("GIF image (from fallback)"),
- _T("gif"), _T("GIF"), wxNullPtr),
- wxFileTypeInfo(_T("image/png"),
+ wxT("GIF image (from fallback)"),
+ wxT("gif"), wxT("GIF"), wxNullPtr),
+ wxFileTypeInfo(wxT("image/png"),
wxEmptyString,
wxEmptyString,
- _T("PNG image (from fallback)"),
- _T("png"), _T("PNG"), wxNullPtr),
- wxFileTypeInfo(_T("image/bmp"),
+ wxT("PNG image (from fallback)"),
+ wxT("png"), wxT("PNG"), wxNullPtr),
+ wxFileTypeInfo(wxT("image/bmp"),
wxEmptyString,
wxEmptyString,
- _T("windows bitmap image (from fallback)"),
- _T("bmp"), _T("BMP"), wxNullPtr),
- wxFileTypeInfo(_T("text/html"),
+ wxT("windows bitmap image (from fallback)"),
+ wxT("bmp"), wxT("BMP"), wxNullPtr),
+ wxFileTypeInfo(wxT("text/html"),
wxEmptyString,
wxEmptyString,
- _T("HTML document (from fallback)"),
- _T("htm"), _T("html"), _T("HTM"), _T("HTML"), wxNullPtr),
+ wxT("HTML document (from fallback)"),
+ wxT("htm"), wxT("html"), wxT("HTM"), wxT("HTML"), wxNullPtr),
// must terminate the table with this!
wxFileTypeInfo()
};
else
#endif
{
- if ( ext.IsSameAs(wxT("htm"), false) || ext.IsSameAs(_T("html"), false) )
+ if ( ext.IsSameAs(wxT("htm"), false) || ext.IsSameAs(wxT("html"), false) )
return wxT("text/html");
- if ( ext.IsSameAs(wxT("jpg"), false) || ext.IsSameAs(_T("jpeg"), false) )
+ if ( ext.IsSameAs(wxT("jpg"), false) || ext.IsSameAs(wxT("jpeg"), false) )
return wxT("image/jpeg");
if ( ext.IsSameAs(wxT("gif"), false) )
return wxT("image/gif");
{
// we assume that it's not empty
wxCHECK_MSG( !basename.empty(), false,
- _T("empty file name in wxFileSystem::FindFileInPath"));
+ wxT("empty file name in wxFileSystem::FindFileInPath"));
wxString name;
// skip path separator in the beginning of the file name if present
// check that the styles are not contradictory
wxASSERT_MSG( !(HasFdFlag(wxFD_SAVE) && HasFdFlag(wxFD_OPEN)),
- _T("can't specify both wxFD_SAVE and wxFD_OPEN at once") );
+ wxT("can't specify both wxFD_SAVE and wxFD_OPEN at once") );
wxASSERT_MSG( !HasFdFlag(wxFD_SAVE) ||
(!HasFdFlag(wxFD_MULTIPLE) && !HasFdFlag(wxFD_FILE_MUST_EXIST)),
- _T("wxFD_MULTIPLE or wxFD_FILE_MUST_EXIST can't be used with wxFD_SAVE" ) );
+ wxT("wxFD_MULTIPLE or wxFD_FILE_MUST_EXIST can't be used with wxFD_SAVE" ) );
wxASSERT_MSG( !HasFdFlag(wxFD_OPEN) || !HasFdFlag(wxFD_OVERWRITE_PROMPT),
- _T("wxFD_OVERWRITE_PROMPT can't be used with wxFD_OPEN") );
+ wxT("wxFD_OVERWRITE_PROMPT can't be used with wxFD_OPEN") );
if ( wildCard.empty() || wildCard == wxFileSelectorDefaultWildcardStr )
{
// convert m_wildCard from "*.bar" to "bar files (*.bar)|*.bar"
if ( m_wildCard.Find(wxT('|')) == wxNOT_FOUND )
{
- wxString::size_type nDot = m_wildCard.find(_T("*."));
+ wxString::size_type nDot = m_wildCard.find(wxT("*."));
if ( nDot != wxString::npos )
nDot++;
else
wxString ext;
if ( !extension.empty() )
{
- if ( extension[0u] == _T('.') )
+ if ( extension[0u] == wxT('.') )
ext = extension.substr(1);
else
ext = extension;
{
// names from the columns correspond to these OS:
// Linux Solaris and IRIX HP-UX AIX
- { _T("ISO-8859-1"), _T("ISO8859-1"), _T("iso88591"), _T("8859-1"), wxT("iso_8859_1"), NULL },
- { _T("ISO-8859-2"), _T("ISO8859-2"), _T("iso88592"), _T("8859-2"), NULL },
- { _T("ISO-8859-3"), _T("ISO8859-3"), _T("iso88593"), _T("8859-3"), NULL },
- { _T("ISO-8859-4"), _T("ISO8859-4"), _T("iso88594"), _T("8859-4"), NULL },
- { _T("ISO-8859-5"), _T("ISO8859-5"), _T("iso88595"), _T("8859-5"), NULL },
- { _T("ISO-8859-6"), _T("ISO8859-6"), _T("iso88596"), _T("8859-6"), NULL },
- { _T("ISO-8859-7"), _T("ISO8859-7"), _T("iso88597"), _T("8859-7"), NULL },
- { _T("ISO-8859-8"), _T("ISO8859-8"), _T("iso88598"), _T("8859-8"), NULL },
- { _T("ISO-8859-9"), _T("ISO8859-9"), _T("iso88599"), _T("8859-9"), NULL },
- { _T("ISO-8859-10"), _T("ISO8859-10"), _T("iso885910"), _T("8859-10"), NULL },
- { _T("ISO-8859-11"), _T("ISO8859-11"), _T("iso885911"), _T("8859-11"), NULL },
- { _T("ISO-8859-12"), _T("ISO8859-12"), _T("iso885912"), _T("8859-12"), NULL },
- { _T("ISO-8859-13"), _T("ISO8859-13"), _T("iso885913"), _T("8859-13"), NULL },
- { _T("ISO-8859-14"), _T("ISO8859-14"), _T("iso885914"), _T("8859-14"), NULL },
- { _T("ISO-8859-15"), _T("ISO8859-15"), _T("iso885915"), _T("8859-15"), NULL },
+ { wxT("ISO-8859-1"), wxT("ISO8859-1"), wxT("iso88591"), wxT("8859-1"), wxT("iso_8859_1"), NULL },
+ { wxT("ISO-8859-2"), wxT("ISO8859-2"), wxT("iso88592"), wxT("8859-2"), NULL },
+ { wxT("ISO-8859-3"), wxT("ISO8859-3"), wxT("iso88593"), wxT("8859-3"), NULL },
+ { wxT("ISO-8859-4"), wxT("ISO8859-4"), wxT("iso88594"), wxT("8859-4"), NULL },
+ { wxT("ISO-8859-5"), wxT("ISO8859-5"), wxT("iso88595"), wxT("8859-5"), NULL },
+ { wxT("ISO-8859-6"), wxT("ISO8859-6"), wxT("iso88596"), wxT("8859-6"), NULL },
+ { wxT("ISO-8859-7"), wxT("ISO8859-7"), wxT("iso88597"), wxT("8859-7"), NULL },
+ { wxT("ISO-8859-8"), wxT("ISO8859-8"), wxT("iso88598"), wxT("8859-8"), NULL },
+ { wxT("ISO-8859-9"), wxT("ISO8859-9"), wxT("iso88599"), wxT("8859-9"), NULL },
+ { wxT("ISO-8859-10"), wxT("ISO8859-10"), wxT("iso885910"), wxT("8859-10"), NULL },
+ { wxT("ISO-8859-11"), wxT("ISO8859-11"), wxT("iso885911"), wxT("8859-11"), NULL },
+ { wxT("ISO-8859-12"), wxT("ISO8859-12"), wxT("iso885912"), wxT("8859-12"), NULL },
+ { wxT("ISO-8859-13"), wxT("ISO8859-13"), wxT("iso885913"), wxT("8859-13"), NULL },
+ { wxT("ISO-8859-14"), wxT("ISO8859-14"), wxT("iso885914"), wxT("8859-14"), NULL },
+ { wxT("ISO-8859-15"), wxT("ISO8859-15"), wxT("iso885915"), wxT("8859-15"), NULL },
// although koi8-ru is not strictly speaking the same as koi8-r,
// they are similar enough to make mapping it to koi8 better than
sm_instance = traits->CreateFontMapper();
wxASSERT_MSG( sm_instance,
- _T("wxAppTraits::CreateFontMapper() failed") );
+ wxT("wxAppTraits::CreateFontMapper() failed") );
}
if ( !sm_instance )
// discard the optional quotes
if ( !cs.empty() )
{
- if ( cs[0u] == _T('"') && cs.Last() == _T('"') )
+ if ( cs[0u] == wxT('"') && cs.Last() == wxT('"') )
{
cs = wxString(cs.c_str(), cs.length() - 1);
}
wxFontEncoding wxFontMapperBase::GetEncoding(size_t n)
{
wxCHECK_MSG( n < WXSIZEOF(gs_encodings), wxFONTENCODING_SYSTEM,
- _T("wxFontMapper::GetEncoding(): invalid index") );
+ wxT("wxFontMapper::GetEncoding(): invalid index") );
return gs_encodings[n];
}
s.Printf(wxS("%s-%s-%s-%d-%d"),
font->GetFaceName(),
weight == wxFONTWEIGHT_NORMAL
- ? _T("normal")
+ ? wxT("normal")
: weight == wxFONTWEIGHT_BOLD
- ? _T("bold")
- : _T("light"),
+ ? wxT("bold")
+ : wxT("light"),
font->GetStyle() == wxFONTSTYLE_NORMAL
- ? _T("regular")
- : _T("italic"),
+ ? wxT("regular")
+ : wxT("italic"),
font->GetPointSize(),
font->GetEncoding());
// GetDefaultEncoding() should return something != wxFONTENCODING_DEFAULT
// and, besides, using this value here doesn't make any sense
wxCHECK_RET( encoding != wxFONTENCODING_DEFAULT,
- _T("can't set default encoding to wxFONTENCODING_DEFAULT") );
+ wxT("can't set default encoding to wxFONTENCODING_DEFAULT") );
ms_encodingDefault = encoding;
}
{
long l;
- wxStringTokenizer tokenizer(s, _T(";"));
+ wxStringTokenizer tokenizer(s, wxT(";"));
wxString token = tokenizer.GetNextToken();
//
{
wxString s;
- s.Printf(_T("%d;%d;%d;%d;%d;%d;%s;%d"),
+ s.Printf(wxT("%d;%d;%d;%d;%d;%d;%s;%d"),
0, // version
pointSize,
family,
switch ( GetWeight() )
{
default:
- wxFAIL_MSG( _T("unknown font weight") );
+ wxFAIL_MSG( wxT("unknown font weight") );
// fall through
case wxFONTWEIGHT_NORMAL:
switch ( GetStyle() )
{
default:
- wxFAIL_MSG( _T("unknown font style") );
+ wxFAIL_MSG( wxT("unknown font style") );
// fall through
case wxFONTSTYLE_NORMAL:
// that the different words which compose this facename are
// not different adjectives or other data but rather all parts
// of the facename
- desc << _T(" '") << face << _("'");
+ desc << wxT(" '") << face << _("'");
}
else
- desc << _T(' ') << face;
+ desc << wxT(' ') << face;
}
else // no face name specified
{
int size = GetPointSize();
if ( size != wxNORMAL_FONT->GetPointSize() )
{
- desc << _T(' ') << size;
+ desc << wxT(' ') << size;
}
#if wxUSE_FONTMAP
wxFontEncoding enc = GetEncoding();
if ( enc != wxFONTENCODING_DEFAULT && enc != wxFONTENCODING_SYSTEM )
{
- desc << _T(' ') << wxFontMapper::GetEncodingName(enc);
+ desc << wxT(' ') << wxFontMapper::GetEncodingName(enc);
}
#endif // wxUSE_FONTMAP
wxString toparse(s);
// parse a more or less free form string
- wxStringTokenizer tokenizer(toparse, _T(";, "), wxTOKEN_STRTOK);
+ wxStringTokenizer tokenizer(toparse, wxT(";, "), wxTOKEN_STRTOK);
wxString face;
unsigned long size;
face += " " + token;
continue;
}
- if ( token == _T("underlined") || token == _("underlined") )
+ if ( token == wxT("underlined") || token == _("underlined") )
{
SetUnderlined(true);
}
- else if ( token == _T("light") || token == _("light") )
+ else if ( token == wxT("light") || token == _("light") )
{
SetWeight(wxFONTWEIGHT_LIGHT);
weightfound = true;
}
- else if ( token == _T("bold") || token == _("bold") )
+ else if ( token == wxT("bold") || token == _("bold") )
{
SetWeight(wxFONTWEIGHT_BOLD);
weightfound = true;
}
- else if ( token == _T("italic") || token == _("italic") )
+ else if ( token == wxT("italic") || token == _("italic") )
{
SetStyle(wxFONTSTYLE_ITALIC);
}
// assume it is the face name
if ( !face.empty() )
{
- face += _T(' ');
+ face += wxT(' ');
}
face += token;
bool wxFromString(const wxString& str, wxFontBase *font)
{
- wxCHECK_MSG( font, false, _T("NULL output parameter") );
+ wxCHECK_MSG( font, false, wxT("NULL output parameter") );
if ( str.empty() )
{
{
// name of UTF-8 encoding: no need to use wxFontMapper for it as it's
// unlikely to change
- const wxString utf8(_T("UTF-8"));
+ const wxString utf8(wxT("UTF-8"));
// all fonts are in UTF-8 only if this code is used
if ( !facename.empty() )
encName = GetEncodingName(encoding);
if ( !facename.empty() )
{
- configEntry = facename + _T("_");
+ configEntry = facename + wxT("_");
}
configEntry += encName;
bool interactive)
{
wxCHECK_MSG( encodingAlt, false,
- _T("wxFontEncoding::GetAltForEncoding(): NULL pointer") );
+ wxT("wxFontEncoding::GetAltForEncoding(): NULL pointer") );
wxNativeEncodingInfo info;
if ( !GetAltForEncoding(encoding, &info, facename, interactive) )
wxFontInstance *wxFontFaceBase::GetFontInstance(float ptSize, bool aa)
{
- wxASSERT_MSG( m_refCnt > 0, _T("font library not loaded!") );
+ wxASSERT_MSG( m_refCnt > 0, wxT("font library not loaded!") );
for ( wxFontInstanceList::const_iterator i = m_instances->begin();
i != m_instances->end(); ++i )
{
wxFontFace *f = m_faces[type];
- wxCHECK_MSG( f, NULL, _T("no such face in font bundle") );
+ wxCHECK_MSG( f, NULL, wxT("no such face in font bundle") );
f->Acquire();
{
wxASSERT_MSG( font.GetFaceName().empty() ||
GetName().CmpNoCase(font.GetFaceName()) == 0,
- _T("calling GetFaceForFont for incompatible font") );
+ wxT("calling GetFaceForFont for incompatible font") );
int type = FaceType_Regular;
return GetFace((FaceType)i);
}
- wxFAIL_MSG( _T("no face") );
+ wxFAIL_MSG( wxT("no face") );
return NULL;
}
if ( m_oldStatusText.empty() )
{
// use special value to prevent us from doing this the next time
- m_oldStatusText += _T('\0');
+ m_oldStatusText += wxT('\0');
}
}
if ( !CheckCommand(wxT("QUIT"), '2') )
{
m_lastError = wxPROTO_CONNERR;
- wxLogDebug(_T("Failed to close connection gracefully."));
+ wxLogDebug(wxT("Failed to close connection gracefully."));
}
}
// don't show the passwords in the logs (even in debug ones)
wxString cmd, password;
- if ( command.Upper().StartsWith(_T("PASS "), &password) )
+ if ( command.Upper().StartsWith(wxT("PASS "), &password) )
{
- cmd << _T("PASS ") << wxString(_T('*'), password.length());
+ cmd << wxT("PASS ") << wxString(wxT('*'), password.length());
}
else
{
if ( !m_lastResult.empty() )
{
// separate from last line
- m_lastResult += _T('\n');
+ m_lastResult += wxT('\n');
}
m_lastResult += line;
switch ( chMarker )
{
- case _T(' '):
+ case wxT(' '):
endOfReply = true;
break;
- case _T('-'):
+ case wxT('-'):
firstLine = false;
break;
{
if ( line.compare(0, LEN_CODE, code) == 0 )
{
- if ( chMarker == _T(' ') )
+ if ( chMarker == wxT(' ') )
{
endOfReply = true;
}
if ( badReply )
{
- wxLogDebug(_T("Broken FTP server: '%s' is not a valid reply."),
+ wxLogDebug(wxT("Broken FTP server: '%s' is not a valid reply."),
m_lastResult.c_str());
m_lastError = wxPROTO_PROTERR;
switch ( transferMode )
{
default:
- wxFAIL_MSG(_T("unknown FTP transfer mode"));
+ wxFAIL_MSG(wxT("unknown FTP transfer mode"));
// fall through
case BINARY:
- mode = _T('I');
+ mode = wxT('I');
break;
case ASCII:
- mode = _T('A');
+ mode = wxT('A');
break;
}
- if ( !DoSimpleCommand(_T("TYPE"), mode) )
+ if ( !DoSimpleCommand(wxT("TYPE"), mode) )
{
wxLogError(_("Failed to set FTP transfer mode to %s."),
(transferMode == ASCII ? _("ASCII") : _("binary")));
wxString fullcmd = command;
if ( !arg.empty() )
{
- fullcmd << _T(' ') << arg;
+ fullcmd << wxT(' ') << arg;
}
if ( !CheckCommand(fullcmd, '2') )
{
- wxLogDebug(_T("FTP command '%s' failed."), fullcmd.c_str());
+ wxLogDebug(wxT("FTP command '%s' failed."), fullcmd.c_str());
m_lastError = wxPROTO_NETERR;
return false;
// tree conventions, but they always understand CDUP - should we use it if
// dir == ".."? OTOH, do such servers (still) exist?
- return DoSimpleCommand(_T("CWD"), dir);
+ return DoSimpleCommand(wxT("CWD"), dir);
}
bool wxFTP::MkDir(const wxString& dir)
{
- return DoSimpleCommand(_T("MKD"), dir);
+ return DoSimpleCommand(wxT("MKD"), dir);
}
bool wxFTP::RmDir(const wxString& dir)
{
- return DoSimpleCommand(_T("RMD"), dir);
+ return DoSimpleCommand(wxT("RMD"), dir);
}
wxString wxFTP::Pwd()
{
// the result is at least that long if CheckCommand() succeeded
wxString::const_iterator p = m_lastResult.begin() + LEN_CODE + 1;
- if ( *p != _T('"') )
+ if ( *p != wxT('"') )
{
- wxLogDebug(_T("Missing starting quote in reply for PWD: %s"),
+ wxLogDebug(wxT("Missing starting quote in reply for PWD: %s"),
wxString(p, m_lastResult.end()));
}
else
{
for ( ++p; (bool)*p; ++p ) // FIXME-DMARS
{
- if ( *p == _T('"') )
+ if ( *p == wxT('"') )
{
// check if the quote is doubled
++p;
- if ( !*p || *p != _T('"') )
+ if ( !*p || *p != wxT('"') )
{
// no, this is the end
break;
if ( !*p )
{
- wxLogDebug(_T("Missing ending quote in reply for PWD: %s"),
+ wxLogDebug(wxT("Missing ending quote in reply for PWD: %s"),
m_lastResult.c_str() + LEN_CODE + 1);
}
}
else
{
m_lastError = wxPROTO_PROTERR;
- wxLogDebug(_T("FTP PWD command failed."));
+ wxLogDebug(wxT("FTP PWD command failed."));
}
return path;
int portNew = addrNew.Service();
// We need to break the PORT number in bytes
- addrIP.Replace(_T("."), _T(","));
- addrIP << _T(',')
- << wxString::Format(_T("%d"), portNew >> 8) << _T(',')
- << wxString::Format(_T("%d"), portNew & 0xff);
+ addrIP.Replace(wxT("."), wxT(","));
+ addrIP << wxT(',')
+ << wxString::Format(wxT("%d"), portNew >> 8) << wxT(',')
+ << wxString::Format(wxT("%d"), portNew & 0xff);
// Now we have a value like "10,0,0,1,5,23"
return addrIP;
// addresses because the addrNew has an IP of "0.0.0.0", so we need the
// value in addrLocal
wxString port = GetPortCmdArgument(addrLocal, addrNew);
- if ( !DoSimpleCommand(_T("PORT"), port) )
+ if ( !DoSimpleCommand(wxT("PORT"), port) )
{
m_lastError = wxPROTO_PROTERR;
delete sockSrv;
wxSocketBase *wxFTP::GetPassivePort()
{
- if ( !DoSimpleCommand(_T("PASV")) )
+ if ( !DoSimpleCommand(wxT("PASV")) )
{
m_lastError = wxPROTO_PROTERR;
wxLogError(_("The FTP server doesn't support passive mode."));
return NULL;
}
- size_t addrStart = m_lastResult.find(_T('('));
+ size_t addrStart = m_lastResult.find(wxT('('));
size_t addrEnd = (addrStart == wxString::npos)
? wxString::npos
- : m_lastResult.find(_T(')'), addrStart);
+ : m_lastResult.find(wxT(')'), addrStart);
if ( addrEnd == wxString::npos )
{
// - Unix : result like "ls" command
// - Windows : like "dir" command
// - others : ?
- wxString line(details ? _T("LIST") : _T("NLST"));
+ wxString line(details ? wxT("LIST") : wxT("NLST"));
if ( !wildcard.empty() )
{
- line << _T(' ') << wildcard;
+ line << wxT(' ') << wildcard;
}
if ( !CheckCommand(line, '1') )
{
m_lastError = wxPROTO_PROTERR;
- wxLogDebug(_T("FTP 'LIST' command returned unexpected result from server"));
+ wxLogDebug(wxT("FTP 'LIST' command returned unexpected result from server"));
delete sock;
return false;
}
// will we need to hold this file?
TransferMode oldTransfermode = m_currentTransfermode;
SetTransferMode(BINARY);
- command << _T("SIZE ") << fileName;
+ command << wxT("SIZE ") << fileName;
bool ok = CheckCommand(command, '2');
// 213 is File Status (STD9)
// "SIZE" is not described anywhere..? It works on most servers
int statuscode;
- if ( wxSscanf(GetLastResult().c_str(), _T("%i %i"),
+ if ( wxSscanf(GetLastResult().c_str(), wxT("%i %i"),
&statuscode, &filesize) == 2 )
{
// We've gotten a good reply.
// check if the first character is '-'. This would
// indicate Unix-style (this also limits this function
// to searching for files, not directories)
- if ( fileList[i].Mid(0, 1) == _T("-") )
+ if ( fileList[i].Mid(0, 1) == wxT("-") )
{
if ( wxSscanf(fileList[i].c_str(),
- _T("%*s %*s %*s %*s %i %*s %*s %*s %*s"),
+ wxT("%*s %*s %*s %*s %i %*s %*s %*s %*s"),
&filesize) != 9 )
{
// Hmm... Invalid response
else // Windows-style response (?)
{
if ( wxSscanf(fileList[i].c_str(),
- _T("%*s %*s %i %*s"),
+ wxT("%*s %*s %i %*s"),
&filesize) != 4 )
{
// something bad happened..?
{
wxGBPosition badpos(-1,-1);
wxSizerItemList::compatibility_iterator node = m_children.Item( index );
- wxCHECK_MSG( node, badpos, _T("Failed to find item.") );
+ wxCHECK_MSG( node, badpos, wxT("Failed to find item.") );
wxGBSizerItem* item = (wxGBSizerItem*)node->GetData();
return item->GetPos();
}
bool wxGridBagSizer::SetItemPosition(size_t index, const wxGBPosition& pos)
{
wxSizerItemList::compatibility_iterator node = m_children.Item( index );
- wxCHECK_MSG( node, false, _T("Failed to find item.") );
+ wxCHECK_MSG( node, false, wxT("Failed to find item.") );
wxGBSizerItem* item = (wxGBSizerItem*)node->GetData();
return item->SetPos(pos);
}
{
wxGBSpan badspan(-1,-1);
wxGBSizerItem* item = FindItem(window);
- wxCHECK_MSG( item, badspan, _T("Failed to find item.") );
+ wxCHECK_MSG( item, badspan, wxT("Failed to find item.") );
return item->GetSpan();
}
{
wxGBSpan badspan(-1,-1);
wxGBSizerItem* item = FindItem(sizer);
- wxCHECK_MSG( item, badspan, _T("Failed to find item.") );
+ wxCHECK_MSG( item, badspan, wxT("Failed to find item.") );
return item->GetSpan();
}
{
wxGBSpan badspan(-1,-1);
wxSizerItemList::compatibility_iterator node = m_children.Item( index );
- wxCHECK_MSG( node, badspan, _T("Failed to find item.") );
+ wxCHECK_MSG( node, badspan, wxT("Failed to find item.") );
wxGBSizerItem* item = (wxGBSizerItem*)node->GetData();
return item->GetSpan();
}
bool wxGridBagSizer::SetItemSpan(size_t index, const wxGBSpan& span)
{
wxSizerItemList::compatibility_iterator node = m_children.Item( index );
- wxCHECK_MSG( node, false, _T("Failed to find item.") );
+ wxCHECK_MSG( node, false, wxT("Failed to find item.") );
wxGBSizerItem* item = (wxGBSizerItem*)node->GetData();
return item->SetSpan(span);
}
// ... and we also allow both grey/gray
wxString colNameAlt = colName;
- if ( !colNameAlt.Replace(_T("GRAY"), _T("GREY")) )
+ if ( !colNameAlt.Replace(wxT("GRAY"), wxT("GREY")) )
{
// but in this case it is not necessary so avoid extra search below
colNameAlt.clear();
wxString colName = colour;
colName.MakeUpper();
wxString colNameAlt = colName;
- if ( !colNameAlt.Replace(_T("GRAY"), _T("GREY")) )
+ if ( !colNameAlt.Replace(wxT("GRAY"), wxT("GREY")) )
colNameAlt.clear();
wxStringToColourHashMap::iterator it = m_map->find(colName);
// although on MSW it works even if the window is still hidden, it doesn't
// work in other ports (notably X11-based ones) and documentation mentions
// that SetCurrent() can only be called for a shown window, so check for it
- wxASSERT_MSG( IsShownOnScreen(), _T("can't make hidden GL canvas current") );
+ wxASSERT_MSG( IsShownOnScreen(), wxT("can't make hidden GL canvas current") );
return context.SetCurrent(*static_cast<const wxGLCanvas *>(this));
}
}
/* someone might try to alloc a 2^32-element hash table */
- wxFAIL_MSG( _T("hash table too big?") );
+ wxFAIL_MSG( wxT("hash table too big?") );
/* quiet warning */
return 0;
void wxIconBundle::AddIcon(const wxIcon& icon)
{
- wxCHECK_RET( icon.IsOk(), _T("invalid icon") );
+ wxCHECK_RET( icon.IsOk(), wxT("invalid icon") );
AllocExclusive();
wxIcon wxIconBundle::GetIconByIndex(size_t n) const
{
- wxCHECK_MSG( n < GetIconCount(), wxNullIcon, _T("invalid index") );
+ wxCHECK_MSG( n < GetIconCount(), wxNullIcon, wxT("invalid index") );
return M_ICONBUNDLEDATA->m_icons[n];
}
bool IsMask)
{
- wxCHECK_MSG( image, false, _T("invalid pointer in wxBMPHandler::SaveFile") );
+ wxCHECK_MSG( image, false, wxT("invalid pointer in wxBMPHandler::SaveFile") );
if ( !image->Ok() )
{
switch ( GetResolutionFromOptions(*image, &hres, &vres) )
{
default:
- wxFAIL_MSG( _T("unexpected image resolution units") );
+ wxFAIL_MSG( wxT("unexpected image resolution units") );
// fall through
case wxIMAGE_RESOLUTION_NONE:
{
UnRef();
- wxCHECK_MSG( data, false, _T("NULL data in wxImage::Create") );
+ wxCHECK_MSG( data, false, wxT("NULL data in wxImage::Create") );
m_refData = new wxImageRefData();
{
UnRef();
- wxCHECK_MSG( data, false, _T("NULL data in wxImage::Create") );
+ wxCHECK_MSG( data, false, wxT("NULL data in wxImage::Create") );
m_refData = new wxImageRefData();
// may) we should probably refcount the duplicates.
// also an issue in InsertHandler below.
- wxLogDebug( _T("Adding duplicate image handler for '%s'"),
+ wxLogDebug( wxT("Adding duplicate image handler for '%s'"),
handler->GetName().c_str() );
delete handler;
}
else
{
// see AddHandler for additional comments.
- wxLogDebug( _T("Inserting duplicate image handler for '%s'"),
+ wxLogDebug( wxT("Inserting duplicate image handler for '%s'"),
handler->GetName().c_str() );
delete handler;
}
// restore the old position to be able to test other formats and so on
if ( stream.SeekI(posOld) == wxInvalidOffset )
{
- wxLogDebug(_T("Failed to rewind the stream in wxImageHandler!"));
+ wxLogDebug(wxT("Failed to rewind the stream in wxImageHandler!"));
// reading would fail anyhow as we're not at the right position
return false;
// restore the old position to be able to test other formats and so on
if ( stream.SeekI(posOld) == wxInvalidOffset )
{
- wxLogDebug(_T("Failed to rewind the stream in wxImageHandler!"));
+ wxLogDebug(wxT("Failed to rewind the stream in wxImageHandler!"));
// reading would fail anyhow as we're not at the right position
return false;
wxImageResolution
wxImageHandler::GetResolutionFromOptions(const wxImage& image, int *x, int *y)
{
- wxCHECK_MSG( x && y, wxIMAGE_RESOLUTION_NONE, _T("NULL pointer") );
+ wxCHECK_MSG( x && y, wxIMAGE_RESOLUTION_NONE, wxT("NULL pointer") );
if ( image.HasOption(wxIMAGE_OPTION_RESOLUTIONX) &&
image.HasOption(wxIMAGE_OPTION_RESOLUTIONY) )
return wxIFF_INVFORMAT;
}
- wxLogTrace(_T("iff"), _T("IFF ILBM file recognized"));
+ wxLogTrace(wxT("iff"), wxT("IFF ILBM file recognized"));
dataptr = dataptr + 4; // skip ID
}
}
- wxLogTrace(_T("iff"), _T("Read %d colors from IFF file."),
+ wxLogTrace(wxT("iff"), wxT("Read %d colors from IFF file."),
colors);
dataptr += 8 + chunkLen; // to next chunk
}
}
- wxLogTrace(_T("iff"),
- _T("LoadIFF: %s %dx%d, planes=%d (%d cols), comp=%d"),
+ wxLogTrace(wxT("iff"),
+ wxT("LoadIFF: %s %dx%d, planes=%d (%d cols), comp=%d"),
(fmt==ILBM_NORMAL) ? "Normal ILBM" :
(fmt==ILBM_HAM) ? "HAM ILBM" :
(fmt==ILBM_HAM8) ? "HAM8 ILBM" :
1<<bmhd_bitplanes, bmhd_compression);
if ((fmt==ILBM_NORMAL) || (fmt==ILBM_EHB) || (fmt==ILBM_HAM)) {
- wxLogTrace(_T("iff"),
- _T("Converting CMAP from normal ILBM CMAP"));
+ wxLogTrace(wxT("iff"),
+ wxT("Converting CMAP from normal ILBM CMAP"));
switch(fmt) {
case ILBM_NORMAL: colors = 1 << bmhd_bitplanes; break;
}
} else if ((fmt == ILBM_NORMAL) || (fmt == ILBM_EHB)) {
if (fmt == ILBM_EHB) {
- wxLogTrace(_T("iff"), _T("Doubling CMAP for EHB mode"));
+ wxLogTrace(wxT("iff"), wxT("Doubling CMAP for EHB mode"));
for (int i=0; i<32; i++) {
pal[3*(i + 32) + 0] = pal[3*i + 0] >> 1;
m_image->h = height;
m_image->transparent = bmhd_transcol;
- wxLogTrace(_T("iff"), _T("Loaded IFF picture %s"),
+ wxLogTrace(wxT("iff"), wxT("Loaded IFF picture %s"),
truncated? "truncated" : "completely");
return (truncated? wxIFF_TRUNCATED : wxIFF_OK);
} else {
- wxLogTrace(_T("iff"), _T("Skipping unknown chunk '%c%c%c%c'"),
+ wxLogTrace(wxT("iff"), wxT("Skipping unknown chunk '%c%c%c%c'"),
*dataptr, *(dataptr+1), *(dataptr+2), *(dataptr+3));
dataptr = dataptr + 8 + chunkLen; // skip unknown chunk
// must be opaque then as otherwise we shouldn't be
// using the mask at all
- wxASSERT_MSG( IsOpaque(a), _T("logic error") );
+ wxASSERT_MSG( IsOpaque(a), wxT("logic error") );
// fall through
{
// must be opaque then as otherwise we shouldn't be
// using the mask at all
- wxASSERT_MSG( IsOpaque(a), _T("logic error") );
+ wxASSERT_MSG( IsOpaque(a), wxT("logic error") );
// if we couldn't find a unique colour for the
// mask, we can have real pixels with the same
break;
default:
- wxFAIL_MSG( _T("unsupported image resolution units") );
+ wxFAIL_MSG( wxT("unsupported image resolution units") );
}
if ( resX && resY )
switch ( iColorType )
{
default:
- wxFAIL_MSG( _T("unknown wxPNG_TYPE_XXX") );
+ wxFAIL_MSG( wxT("unknown wxPNG_TYPE_XXX") );
// fall through
case wxPNG_TYPE_COLOUR:
toff_t tofs = wx_truncate_cast(toff_t, ofs);
wxCHECK_MSG( (wxFileOffset)tofs == ofs, (toff_t)-1,
- _T("TIFF library doesn't support large files") );
+ wxT("TIFF library doesn't support large files") );
return tofs;
}
switch ( res )
{
default:
- wxFAIL_MSG( _T("unknown image resolution units") );
+ wxFAIL_MSG( wxT("unknown image resolution units") );
// fall through
case wxIMAGE_RESOLUTION_NONE:
public:
wxDummyConsoleApp() { }
- virtual int OnRun() { wxFAIL_MSG( _T("unreachable code") ); return 0; }
+ virtual int OnRun() { wxFAIL_MSG( wxT("unreachable code") ); return 0; }
virtual bool DoYield(bool, long) { return true; }
wxDECLARE_NO_COPY_CLASS(wxDummyConsoleApp);
if ( ::GetLocaleInfo(lcid, LOCALE_IDEFAULTANSICODEPAGE,
buffer, WXSIZEOF(buffer)) > 0 )
{
- if ( buffer[0] != _T('0') || buffer[1] != _T('\0') )
+ if ( buffer[0] != wxT('0') || buffer[1] != wxT('\0') )
cp = buffer;
//else: this locale doesn't use ANSI code page
}
const LCID lcid = GetLCID();
wxChar buffer[256];
- buffer[0] = _T('\0');
+ buffer[0] = wxT('\0');
if ( !::GetLocaleInfo(lcid, LOCALE_SENGLANGUAGE, buffer, WXSIZEOF(buffer)) )
{
- wxLogLastError(_T("GetLocaleInfo(LOCALE_SENGLANGUAGE)"));
+ wxLogLastError(wxT("GetLocaleInfo(LOCALE_SENGLANGUAGE)"));
return locale;
}
if ( ::GetLocaleInfo(lcid, LOCALE_SENGCOUNTRY,
buffer, WXSIZEOF(buffer)) > 0 )
{
- locale << _T('_') << buffer;
+ locale << wxT('_') << buffer;
}
const wxString cp = wxGetANSICodePageForLocale(lcid);
if ( !cp.empty() )
{
- locale << _T('.') << cp;
+ locale << wxT('.') << cp;
}
return locale;
break;
// not a special character so must be just a separator, treat as is
- if ( *p == _T('%') )
+ if ( *p == wxT('%') )
{
// this one needs to be escaped
- fmtWX += _T('%');
+ fmtWX += wxT('%');
}
fmtWX += *p;
{
// copy constructor would require ref-counted pointer to buffer
- wxFAIL_MSG( _T("Copy constructor of wxConnectionBase not implemented") );
+ wxFAIL_MSG( wxT("Copy constructor of wxConnectionBase not implemented") );
}
}
}
- wxASSERT_MSG( m_count == list.m_count, _T("logic error in wxList::DoCopy") );
+ wxASSERT_MSG( m_count == list.m_count, wxT("logic error in wxList::DoCopy") );
}
wxListBase::~wxListBase()
while ( ll != 0 ) \
{ \
long digit = (ll % 10).ToLong(); \
- result.Prepend((wxChar)(_T('0') - digit)); \
+ result.Prepend((wxChar)(wxT('0') - digit)); \
ll /= 10; \
} \
} \
while ( ll != 0 ) \
{ \
long digit = (ll % 10).ToLong(); \
- result.Prepend((wxChar)(_T('0') + digit)); \
+ result.Prepend((wxChar)(wxT('0') + digit)); \
ll /= 10; \
} \
} \
\
if ( result.empty() ) \
- result = _T('0'); \
+ result = wxT('0'); \
else if ( neg ) \
- result.Prepend(_T('-')); \
+ result.Prepend(wxT('-')); \
\
return result; \
}
\
while ( ll != 0 ) \
{ \
- result.Prepend((wxChar)(_T('0') + (ll % 10).ToULong())); \
+ result.Prepend((wxChar)(wxT('0') + (ll % 10).ToULong())); \
ll /= 10; \
} \
\
if ( result.empty() ) \
- result = _T('0'); \
+ result = wxT('0'); \
\
return result; \
}
return o << ll.ToString();
}
-#define READ_STRING_CHAR(s, idx, len) ((idx!=len) ? (wxChar)s[idx++] : _T('\0'))
+#define READ_STRING_CHAR(s, idx, len) ((idx!=len) ? (wxChar)s[idx++] : wxT('\0'))
WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &o, wxULongLong &ll)
{
int count;
va_list argptr;
va_start(argptr, szFormat);
- buf[WXSIZEOF(buf)-1] = _T('\0');
+ buf[WXSIZEOF(buf)-1] = wxT('\0');
// keep 3 bytes for a \r\n\0
count = wxVsnprintf(buf, WXSIZEOF(buf)-3, szFormat, argptr);
if ( count < 0 )
count = WXSIZEOF(buf)-3;
- buf[count]=_T('\r');
- buf[count+1]=_T('\n');
- buf[count+2]=_T('\0');
+ buf[count]=wxT('\r');
+ buf[count+1]=wxT('\n');
+ buf[count+2]=wxT('\0');
wxMessageOutputDebug dbgout;
dbgout.Printf(buf);
void wxMenuBase::AddSubMenu(wxMenu *submenu)
{
- wxCHECK_RET( submenu, _T("can't add a NULL submenu") );
+ wxCHECK_RET( submenu, wxT("can't add a NULL submenu") );
submenu->SetParent((wxMenu *)this);
}
wxMenuItem* wxMenuBase::FindItemByPosition(size_t position) const
{
wxCHECK_MSG( position < m_items.GetCount(), NULL,
- _T("wxMenu::FindItemByPosition(): invalid menu index") );
+ wxT("wxMenu::FindItemByPosition(): invalid menu index") );
return m_items.Item( position )->GetData();
}
void wxMenuBase::Attach(wxMenuBarBase *menubar)
{
// use Detach() instead!
- wxASSERT_MSG( menubar, _T("menu can't be attached to NULL menubar") );
+ wxASSERT_MSG( menubar, wxT("menu can't be attached to NULL menubar") );
// use IsAttached() to prevent this from happening
- wxASSERT_MSG( !m_menuBar, _T("attaching menu twice?") );
+ wxASSERT_MSG( !m_menuBar, wxT("attaching menu twice?") );
m_menuBar = (wxMenuBar *)menubar;
}
void wxMenuBase::Detach()
{
// use IsAttached() to prevent this from happening
- wxASSERT_MSG( m_menuBar, _T("detaching unattached menu?") );
+ wxASSERT_MSG( m_menuBar, wxT("detaching unattached menu?") );
m_menuBar = NULL;
}
// test now carried out on reading file so test should never get here
if ( !hasFilename && !str.empty()
#ifdef __UNIX__
- && !str.StartsWith(_T("test "))
+ && !str.StartsWith(wxT("test "))
#endif // Unix
) {
str << wxT(" < '") << params.GetFileName() << wxT('\'');
bool wxFileType::GetMimeType(wxString *mimeType) const
{
- wxCHECK_MSG( mimeType, false, _T("invalid parameter in GetMimeType") );
+ wxCHECK_MSG( mimeType, false, wxT("invalid parameter in GetMimeType") );
if ( m_info )
{
bool wxFileType::GetDescription(wxString *desc) const
{
- wxCHECK_MSG( desc, false, _T("invalid parameter in GetDescription") );
+ wxCHECK_MSG( desc, false, wxT("invalid parameter in GetDescription") );
if ( m_info )
{
wxFileType::GetOpenCommand(wxString *openCmd,
const wxFileType::MessageParameters& params) const
{
- wxCHECK_MSG( openCmd, false, _T("invalid parameter in GetOpenCommand") );
+ wxCHECK_MSG( openCmd, false, wxT("invalid parameter in GetOpenCommand") );
if ( m_info )
{
wxFileType::GetPrintCommand(wxString *printCmd,
const wxFileType::MessageParameters& params) const
{
- wxCHECK_MSG( printCmd, false, _T("invalid parameter in GetPrintCommand") );
+ wxCHECK_MSG( printCmd, false, wxT("invalid parameter in GetPrintCommand") );
if ( m_info )
{
if ( GetOpenCommand(&cmd, params) )
{
if ( verbs )
- verbs->Add(_T("Open"));
+ verbs->Add(wxT("Open"));
if ( commands )
commands->Add(cmd);
count++;
if ( GetPrintCommand(&cmd, params) )
{
if ( verbs )
- verbs->Add(_T("Print"));
+ verbs->Add(wxT("Print"));
if ( commands )
commands->Add(cmd);
#elif defined(__UNIX__)
return m_impl->Unassociate(this);
#else
- wxFAIL_MSG( _T("not implemented") ); // TODO
+ wxFAIL_MSG( wxT("not implemented") ); // TODO
return false;
#endif
}
wxUnusedVar(cmd);
wxUnusedVar(verb);
wxUnusedVar(overwriteprompt);
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(wxT("not implemented"));
return false;
#endif
}
if ( sTmp.empty() )
GetOpenCommand(&sTmp, wxFileType::MessageParameters(wxEmptyString, wxEmptyString));
#endif
- wxCHECK_MSG( !sTmp.empty(), false, _T("need the icon file") );
+ wxCHECK_MSG( !sTmp.empty(), false, wxT("need the icon file") );
#if defined (__WXMSW__) || defined(__UNIX__)
return m_impl->SetDefaultIcon (cmd, index);
#else
wxUnusedVar(index);
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(wxT("not implemented"));
return false;
#endif
}
return m_impl->Associate(ftInfo);
#else // other platforms
wxUnusedVar(ftInfo);
- wxFAIL_MSG( _T("not implemented") ); // TODO
+ wxFAIL_MSG( wxT("not implemented") ); // TODO
return NULL;
#endif // platforms
}
else
extWithoutDot = ext;
- wxCHECK_MSG( !ext.empty(), NULL, _T("extension can't be empty") );
+ wxCHECK_MSG( !ext.empty(), NULL, wxT("extension can't be empty") );
wxFileType *ft = m_impl->GetFileTypeFromExtension(extWithoutDot);
#include "wx/listimpl.cpp"
-#define TRACE_MODULE _T("module")
+#define TRACE_MODULE wxT("module")
WX_DEFINE_LIST(wxModuleList)
wxModule * module = node->GetData();
wxASSERT_MSG( module->m_state == State_Initialized,
- _T("not initialized module being cleaned up") );
+ wxT("not initialized module being cleaned up") );
module->Exit();
module->m_state = State_Registered;
}
const size_t len = wx_truncate_cast(size_t, lenFile);
- wxASSERT_MSG( len == lenFile + size_t(0), _T("huge files not supported") );
+ wxASSERT_MSG( len == lenFile + size_t(0), wxT("huge files not supported") );
m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read);
m_i_streambuf->SetBufferIO(len); // create buffer
}
const size_t len = wx_truncate_cast(size_t, lenFile);
- wxASSERT_MSG( (wxFileOffset)len == lenFile, _T("huge files not supported") );
+ wxASSERT_MSG( (wxFileOffset)len == lenFile, wxT("huge files not supported") );
m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read);
m_i_streambuf->SetBufferIO(len); // create buffer
size_t wxMemoryOutputStream::CopyTo(void *buffer, size_t len) const
{
- wxCHECK_MSG( buffer, 0, _T("must have buffer to CopyTo") );
+ wxCHECK_MSG( buffer, 0, wxT("must have buffer to CopyTo") );
if ( len > GetSize() )
len = GetSize();
else
{
// guard againt reentrance once the global has been created
- wxASSERT_MSG(++entry == 1, _T("wxClassInfo::Register() reentrance"));
+ wxASSERT_MSG(++entry == 1, wxT("wxClassInfo::Register() reentrance"));
classTable = sm_classTable;
}
wxASSERT_MSG( classTable->Get(m_className) == NULL,
wxString::Format
(
- _T("Class \"%s\" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?"),
+ wxT("Class \"%s\" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?"),
m_className
)
);
//else: ref count is 1, we are exclusive owners of m_refData anyhow
wxASSERT_MSG( m_refData && m_refData->GetRefCount() == 1,
- _T("wxObject::AllocExclusive() failed.") );
+ wxT("wxObject::AllocExclusive() failed.") );
}
wxObjectRefData *wxObject::CreateRefData() const
{
// if you use AllocExclusive() you must override this method
- wxFAIL_MSG( _T("CreateRefData() must be overridden if called!") );
+ wxFAIL_MSG( wxT("CreateRefData() must be overridden if called!") );
return NULL;
}
wxObject::CloneRefData(const wxObjectRefData * WXUNUSED(data)) const
{
// if you use AllocExclusive() you must override this method
- wxFAIL_MSG( _T("CloneRefData() must be overridden if called!") );
+ wxFAIL_MSG( wxT("CloneRefData() must be overridden if called!") );
return NULL;
}
static const wxChar* const wxOperatingSystemIdNames[] =
{
- _T("Apple Mac OS"),
- _T("Apple Mac OS X"),
+ wxT("Apple Mac OS"),
+ wxT("Apple Mac OS X"),
- _T("Microsoft Windows 9X"),
- _T("Microsoft Windows NT"),
- _T("Microsoft Windows Micro"),
- _T("Microsoft Windows CE"),
+ wxT("Microsoft Windows 9X"),
+ wxT("Microsoft Windows NT"),
+ wxT("Microsoft Windows Micro"),
+ wxT("Microsoft Windows CE"),
- _T("Linux"),
- _T("FreeBSD"),
- _T("OpenBSD"),
- _T("NetBSD"),
+ wxT("Linux"),
+ wxT("FreeBSD"),
+ wxT("OpenBSD"),
+ wxT("NetBSD"),
- _T("SunOS"),
- _T("AIX"),
- _T("HPUX"),
+ wxT("SunOS"),
+ wxT("AIX"),
+ wxT("HPUX"),
- _T("Other Unix"),
- _T("Other Unix"),
+ wxT("Other Unix"),
+ wxT("Other Unix"),
- _T("DOS"),
- _T("OS/2"),
+ wxT("DOS"),
+ wxT("OS/2"),
- _T("PalmOS"),
- _T("PalmOS(Over Linux)"),
+ wxT("PalmOS"),
+ wxT("PalmOS(Over Linux)"),
};
static const wxChar* const wxPortIdNames[] =
{
- _T("wxBase"),
- _T("wxMSW"),
- _T("wxMotif"),
- _T("wxGTK"),
- _T("wxMGL"),
- _T("wxX11"),
- _T("wxOS2"),
- _T("wxMac"),
- _T("wxCocoa"),
- _T("wxWinCE"),
- _T("wxPalmOS"),
- _T("wxDFB")
+ wxT("wxBase"),
+ wxT("wxMSW"),
+ wxT("wxMotif"),
+ wxT("wxGTK"),
+ wxT("wxMGL"),
+ wxT("wxX11"),
+ wxT("wxOS2"),
+ wxT("wxMac"),
+ wxT("wxCocoa"),
+ wxT("wxWinCE"),
+ wxT("wxPalmOS"),
+ wxT("wxDFB")
};
static const wxChar* const wxArchitectureNames[] =
{
- _T("32 bit"),
- _T("64 bit")
+ wxT("32 bit"),
+ wxT("64 bit")
};
static const wxChar* const wxEndiannessNames[] =
{
- _T("Big endian"),
- _T("Little endian"),
- _T("PDP endian")
+ wxT("Big endian"),
+ wxT("Little endian"),
+ wxT("PDP endian")
};
// ----------------------------------------------------------------------------
// corresponding indexes of the string arrays above
static unsigned wxGetIndexFromEnumValue(int value)
{
- wxCHECK_MSG( value, (unsigned)-1, _T("invalid enum value") );
+ wxCHECK_MSG( value, (unsigned)-1, wxT("invalid enum value") );
int n = 0;
while ( !(value & 1) )
n++;
}
- wxASSERT_MSG( value == 1, _T("more than one bit set in enum value") );
+ wxASSERT_MSG( value == 1, wxT("more than one bit set in enum value") );
return n;
}
const wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
if ( !traits )
{
- wxFAIL_MSG( _T("failed to initialize wxPlatformInfo") );
+ wxFAIL_MSG( wxT("failed to initialize wxPlatformInfo") );
m_port = wxPORT_UNKNOWN;
m_usingUniversal = false;
wxString wxPlatformInfo::GetOperatingSystemFamilyName(wxOperatingSystemId os)
{
- const wxChar* string = _T("Unknown");
+ const wxChar* string = wxT("Unknown");
if ( os & wxOS_MAC )
- string = _T("Macintosh");
+ string = wxT("Macintosh");
else if ( os & wxOS_WINDOWS )
- string = _T("Windows");
+ string = wxT("Windows");
else if ( os & wxOS_UNIX )
- string = _T("Unix");
+ string = wxT("Unix");
else if ( os == wxOS_DOS )
- string = _T("DOS");
+ string = wxT("DOS");
else if ( os == wxOS_OS2 )
- string = _T("OS/2");
+ string = wxT("OS/2");
return string;
}
const unsigned idx = wxGetIndexFromEnumValue(os);
wxCHECK_MSG( idx < WXSIZEOF(wxOperatingSystemIdNames), wxEmptyString,
- _T("invalid OS id") );
+ wxT("invalid OS id") );
return wxOperatingSystemIdNames[idx];
}
const unsigned idx = wxGetIndexFromEnumValue(port);
wxCHECK_MSG( idx < WXSIZEOF(wxPortIdNames), wxEmptyString,
- _T("invalid port id") );
+ wxT("invalid port id") );
wxString ret = wxPortIdNames[idx];
const unsigned idx = wxGetIndexFromEnumValue(port);
wxCHECK_MSG( idx < WXSIZEOF(wxPortIdNames), wxEmptyString,
- _T("invalid port id") );
+ wxT("invalid port id") );
wxString ret = wxPortIdNames[idx];
ret = ret.Mid(2).Lower(); // remove 'wx' prefix
default:
// forgot to update the switch after adding a new hit test code?
- wxFAIL_MSG( _T("unexpected HitTest() return value") );
+ wxFAIL_MSG( wxT("unexpected HitTest() return value") );
// fall through
case wxHT_WINDOW_CORNER:
if (!m_previewCanvas)
{
- wxFAIL_MSG(_T("wxPrintPreviewBase::RenderPage: must use wxPrintPreviewBase::SetCanvas to let me know about the canvas!"));
+ wxFAIL_MSG(wxT("wxPrintPreviewBase::RenderPage: must use wxPrintPreviewBase::SetCanvas to let me know about the canvas!"));
return false;
}
default:
case wxKILL_ERROR:
case wxKILL_BAD_SIGNAL:
- wxFAIL_MSG( _T("unexpected wxProcess::Kill() return code") );
+ wxFAIL_MSG( wxT("unexpected wxProcess::Kill() return code") );
// fall through
case wxKILL_NO_PROCESS:
if ( eol == pBuf )
{
// check for case of "\r\n" being split
- if ( result.empty() || result.Last() != _T('\r') )
+ if ( result.empty() || result.Last() != wxT('\r') )
{
// ignore the stray '\n'
eol = NULL;
void wxRadioBoxBase::SetMajorDim(unsigned int majorDim, long style)
{
- wxCHECK_RET( majorDim != 0, _T("major radiobox dimension can't be 0") );
+ wxCHECK_RET( majorDim != 0, wxT("major radiobox dimension can't be 0") );
m_majorDim = majorDim;
break;
default:
- wxFAIL_MSG( _T("unexpected wxDirection value") );
+ wxFAIL_MSG( wxT("unexpected wxDirection value") );
return wxNOT_FOUND;
}
}
wxASSERT_MSG( item < count && item >= 0,
- _T("logic error in wxRadioBox::GetNextItem()") );
+ wxT("logic error in wxRadioBox::GetNextItem()") );
}
// we shouldn't select the non-active items, continue looking for a
// visible and shown one unless we came back to the item we started from in
void wxRadioBoxBase::SetItemToolTip(unsigned int item, const wxString& text)
{
- wxASSERT_MSG( item < GetCount(), _T("Invalid item index") );
+ wxASSERT_MSG( item < GetCount(), wxT("Invalid item index") );
// extend the array to have entries for all our items on first use
if ( !m_itemsTooltips )
// set helptext for a particular item
void wxRadioBoxBase::SetItemHelpText(unsigned int n, const wxString& helpText)
{
- wxCHECK_RET( n < GetCount(), _T("Invalid item index") );
+ wxCHECK_RET( n < GetCount(), wxT("Invalid item index") );
if ( m_itemsHelpTexts.empty() )
{
// retrieve helptext for a particular item
wxString wxRadioBoxBase::GetItemHelpText( unsigned int n ) const
{
- wxCHECK_MSG( n < GetCount(), wxEmptyString, _T("Invalid item index") );
+ wxCHECK_MSG( n < GetCount(), wxEmptyString, wxT("Invalid item index") );
return m_itemsHelpTexts.empty() ? wxString() : m_itemsHelpTexts[n];
}
#else
# define FLAVORS (wxRE_ADVANCED | wxRE_BASIC)
wxASSERT_MSG( (flags & FLAVORS) != FLAVORS,
- _T("incompatible flags in wxRegEx::Compile") );
+ wxT("incompatible flags in wxRegEx::Compile") );
#endif
wxASSERT_MSG( !(flags & ~(FLAVORS | wxRE_ICASE | wxRE_NOSUB | wxRE_NEWLINE)),
- _T("unrecognized flags in wxRegEx::Compile") );
+ wxT("unrecognized flags in wxRegEx::Compile") );
// translate our flags to regcomp() ones
int flagsRE = 0;
// and some more for bracketed subexperessions
for ( const wxChar *cptr = expr.c_str(); *cptr; cptr++ )
{
- if ( *cptr == _T('\\') )
+ if ( *cptr == wxT('\\') )
{
// in basic RE syntax groups are inside \(...\)
- if ( *++cptr == _T('(') && (flags & wxRE_BASIC) )
+ if ( *++cptr == wxT('(') && (flags & wxRE_BASIC) )
{
m_nMatches++;
}
}
- else if ( *cptr == _T('(') && !(flags & wxRE_BASIC) )
+ else if ( *cptr == wxT('(') && !(flags & wxRE_BASIC) )
{
// we know that the previous character is not an unquoted
// backslash because it would have been eaten above, so we
// extended syntax. '(?' is used for extensions by perl-
// like REs (e.g. advanced), and is not valid for POSIX
// extended, so ignore them always.
- if ( cptr[1] != _T('?') )
+ if ( cptr[1] != wxT('?') )
m_nMatches++;
}
}
int flags
WXREGEX_IF_NEED_LEN(size_t len)) const
{
- wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") );
+ wxCHECK_MSG( IsValid(), false, wxT("must successfully Compile() first") );
// translate our flags to regexec() ones
wxASSERT_MSG( !(flags & ~(wxRE_NOTBOL | wxRE_NOTEOL)),
- _T("unrecognized flags in wxRegEx::Matches") );
+ wxT("unrecognized flags in wxRegEx::Matches") );
int flagsRE = 0;
if ( flags & wxRE_NOTBOL )
bool wxRegExImpl::GetMatch(size_t *start, size_t *len, size_t index) const
{
- wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") );
- wxCHECK_MSG( m_nMatches, false, _T("can't use with wxRE_NOSUB") );
- wxCHECK_MSG( m_Matches, false, _T("must call Matches() first") );
- wxCHECK_MSG( index < m_nMatches, false, _T("invalid match index") );
+ wxCHECK_MSG( IsValid(), false, wxT("must successfully Compile() first") );
+ wxCHECK_MSG( m_nMatches, false, wxT("can't use with wxRE_NOSUB") );
+ wxCHECK_MSG( m_Matches, false, wxT("must call Matches() first") );
+ wxCHECK_MSG( index < m_nMatches, false, wxT("invalid match index") );
if ( start )
*start = m_Matches->Start(index);
size_t wxRegExImpl::GetMatchCount() const
{
- wxCHECK_MSG( IsValid(), 0, _T("must successfully Compile() first") );
- wxCHECK_MSG( m_nMatches, 0, _T("can't use with wxRE_NOSUB") );
+ wxCHECK_MSG( IsValid(), 0, wxT("must successfully Compile() first") );
+ wxCHECK_MSG( m_nMatches, 0, wxT("can't use with wxRE_NOSUB") );
return m_nMatches;
}
const wxString& replacement,
size_t maxMatches) const
{
- wxCHECK_MSG( text, wxNOT_FOUND, _T("NULL text in wxRegEx::Replace") );
- wxCHECK_MSG( IsValid(), wxNOT_FOUND, _T("must successfully Compile() first") );
+ wxCHECK_MSG( text, wxNOT_FOUND, wxT("NULL text in wxRegEx::Replace") );
+ wxCHECK_MSG( IsValid(), wxNOT_FOUND, wxT("must successfully Compile() first") );
// the input string
#ifndef WXREGEX_CONVERT_TO_MB
// attempt at optimization: don't iterate over the string if it doesn't
// contain back references at all
bool mayHaveBackrefs =
- replacement.find_first_of(_T("\\&")) != wxString::npos;
+ replacement.find_first_of(wxT("\\&")) != wxString::npos;
if ( !mayHaveBackrefs )
{
{
size_t index = (size_t)-1;
- if ( *p == _T('\\') )
+ if ( *p == wxT('\\') )
{
if ( wxIsdigit(*++p) )
{
}
//else: backslash used as escape character
}
- else if ( *p == _T('&') )
+ else if ( *p == wxT('&') )
{
// treat this as "\0" for compatbility with ed and such
index = 0;
size_t start, len;
if ( !GetMatch(&start, &len, index) )
{
- wxFAIL_MSG( _T("invalid back reference") );
+ wxFAIL_MSG( wxT("invalid back reference") );
// just eat it...
}
if ( !GetMatch(&start, &len) )
{
// we did have match as Matches() returned true above!
- wxFAIL_MSG( _T("internal logic error in wxRegEx::Replace") );
+ wxFAIL_MSG( wxT("internal logic error in wxRegEx::Replace") );
return wxNOT_FOUND;
}
bool wxRegEx::Matches(const wxString& str, int flags) const
{
- wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") );
+ wxCHECK_MSG( IsValid(), false, wxT("must successfully Compile() first") );
return m_impl->Matches(WXREGEX_CHAR(str), flags
WXREGEX_IF_NEED_LEN(str.length()));
bool wxRegEx::GetMatch(size_t *start, size_t *len, size_t index) const
{
- wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") );
+ wxCHECK_MSG( IsValid(), false, wxT("must successfully Compile() first") );
return m_impl->GetMatch(start, len, index);
}
size_t wxRegEx::GetMatchCount() const
{
- wxCHECK_MSG( IsValid(), 0, _T("must successfully Compile() first") );
+ wxCHECK_MSG( IsValid(), 0, wxT("must successfully Compile() first") );
return m_impl->GetMatchCount();
}
const wxString& replacement,
size_t maxMatches) const
{
- wxCHECK_MSG( IsValid(), wxNOT_FOUND, _T("must successfully Compile() first") );
+ wxCHECK_MSG( IsValid(), wxNOT_FOUND, wxT("must successfully Compile() first") );
return m_impl->Replace(pattern, replacement, maxMatches);
}
if (bmp.GetMask())
{
wxImage image = bmp.ConvertToImage();
- wxASSERT_MSG( image.HasMask(), _T("wxBitmap::ConvertToImage doesn't preserve mask?") );
+ wxASSERT_MSG( image.HasMask(), wxT("wxBitmap::ConvertToImage doesn't preserve mask?") );
return DoRegionUnion(*this, image,
image.GetMaskRed(),
image.GetMaskGreen(),
#if defined(__UNIX__) && !defined(__WINDOWS__) && !defined(__WINE__)
// under Unix, if the server name looks like a path, create a AF_UNIX
// socket instead of AF_INET one
- if ( serverName.Find(_T('/')) != wxNOT_FOUND )
+ if ( serverName.Find(wxT('/')) != wxNOT_FOUND )
{
wxUNIXaddress *addr = new wxUNIXaddress;
addr->Filename(serverName);
{
if ( remove(m_filename.fn_str()) != 0 )
{
- wxLogDebug(_T("Stale AF_UNIX file '%s' left."), m_filename.c_str());
+ wxLogDebug(wxT("Stale AF_UNIX file '%s' left."), m_filename.c_str());
}
}
#endif // __UNIX_LIKE__
bool wxSelectSets::SetFD(int fd, int flags)
{
- wxCHECK_MSG( fd >= 0, false, _T("invalid descriptor") );
+ wxCHECK_MSG( fd >= 0, false, wxT("invalid descriptor") );
for ( int n = 0; n < Max; n++ )
{
if ( wxFD_ISSET(fd, (fd_set*) &m_fds[n]) )
{
wxLogTrace(wxSelectDispatcher_Trace,
- _T("Got %s event on fd %d"), ms_names[n], fd);
+ wxT("Got %s event on fd %d"), ms_names[n], fd);
(handler.*ms_handlers[n])();
// callback can modify sets and destroy handler
// this forces that one event can be processed at one time
m_maxFD = fd;
wxLogTrace(wxSelectDispatcher_Trace,
- _T("Registered fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT), (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION);
+ wxT("Registered fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT), (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION);
return true;
}
if ( !wxMappedFDIODispatcher::ModifyFD(fd, handler, flags) )
return false;
- wxASSERT_MSG( fd <= m_maxFD, _T("logic error: registered fd > m_maxFD?") );
+ wxASSERT_MSG( fd <= m_maxFD, wxT("logic error: registered fd > m_maxFD?") );
wxLogTrace(wxSelectDispatcher_Trace,
- _T("Modified fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT) == wxFDIO_OUTPUT, (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION);
+ wxT("Modified fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT) == wxFDIO_OUTPUT, (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION);
return m_sets.SetFD(fd, flags);
}
}
wxLogTrace(wxSelectDispatcher_Trace,
- _T("Removed fd %d, current max: %d"), fd, m_maxFD);
+ wxT("Removed fd %d, current max: %d"), fd, m_maxFD);
return true;
}
wxFDIOHandler * const handler = FindHandler(fd);
if ( !handler )
{
- wxFAIL_MSG( _T("NULL handler in wxSelectDispatcher?") );
+ wxFAIL_MSG( wxT("NULL handler in wxSelectDispatcher?") );
continue;
}
// window item
void wxSizerItem::DoSetWindow(wxWindow *window)
{
- wxCHECK_RET( window, _T("NULL window in wxSizerItem::SetWindow()") );
+ wxCHECK_RET( window, wxT("NULL window in wxSizerItem::SetWindow()") );
m_kind = Item_Window;
m_window = window;
case Item_Max:
default:
- wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") );
+ wxFAIL_MSG( wxT("unexpected wxSizerItem::m_kind") );
}
m_kind = Item_None;
case Item_Max:
default:
- wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") );
+ wxFAIL_MSG( wxT("unexpected wxSizerItem::m_kind") );
}
if (m_flag & wxWEST)
{
if( !wxIsNullDouble(m_ratio) )
{
- wxCHECK_MSG( (m_proportion==0), false, _T("Shaped item, non-zero proportion in wxSizerItem::InformFirstDirection()") );
+ wxCHECK_MSG( (m_proportion==0), false, wxT("Shaped item, non-zero proportion in wxSizerItem::InformFirstDirection()") );
if( direction==wxHORIZONTAL && !wxIsNullDouble(m_ratio) )
{
// Clip size so that we don't take too much
switch ( m_kind )
{
case Item_None:
- wxFAIL_MSG( _T("can't set size of uninitialized sizer item") );
+ wxFAIL_MSG( wxT("can't set size of uninitialized sizer item") );
break;
case Item_Window:
case Item_Max:
default:
- wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") );
+ wxFAIL_MSG( wxT("unexpected wxSizerItem::m_kind") );
}
}
case Item_Max:
default:
- wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") );
+ wxFAIL_MSG( wxT("unexpected wxSizerItem::m_kind") );
}
}
switch ( m_kind )
{
case Item_None:
- wxFAIL_MSG( _T("can't show uninitialized sizer item") );
+ wxFAIL_MSG( wxT("can't show uninitialized sizer item") );
break;
case Item_Window:
case Item_Max:
default:
- wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") );
+ wxFAIL_MSG( wxT("unexpected wxSizerItem::m_kind") );
}
}
case Item_Max:
default:
- wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") );
+ wxFAIL_MSG( wxT("unexpected wxSizerItem::m_kind") );
}
return false;
bool wxSizer::Remove( wxSizer *sizer )
{
- wxASSERT_MSG( sizer, _T("Removing NULL sizer") );
+ wxASSERT_MSG( sizer, wxT("Removing NULL sizer") );
wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
while (node)
{
wxCHECK_MSG( index >= 0 && (size_t)index < m_children.GetCount(),
false,
- _T("Remove index is out of range") );
+ wxT("Remove index is out of range") );
wxSizerItemList::compatibility_iterator node = m_children.Item( index );
- wxCHECK_MSG( node, false, _T("Failed to find child node") );
+ wxCHECK_MSG( node, false, wxT("Failed to find child node") );
delete node->GetData();
m_children.Erase( node );
bool wxSizer::Detach( wxSizer *sizer )
{
- wxASSERT_MSG( sizer, _T("Detaching NULL sizer") );
+ wxASSERT_MSG( sizer, wxT("Detaching NULL sizer") );
wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
while (node)
bool wxSizer::Detach( wxWindow *window )
{
- wxASSERT_MSG( window, _T("Detaching NULL window") );
+ wxASSERT_MSG( window, wxT("Detaching NULL window") );
wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
while (node)
{
wxCHECK_MSG( index >= 0 && (size_t)index < m_children.GetCount(),
false,
- _T("Detach index is out of range") );
+ wxT("Detach index is out of range") );
wxSizerItemList::compatibility_iterator node = m_children.Item( index );
- wxCHECK_MSG( node, false, _T("Failed to find child node") );
+ wxCHECK_MSG( node, false, wxT("Failed to find child node") );
wxSizerItem *item = node->GetData();
bool wxSizer::Replace( wxWindow *oldwin, wxWindow *newwin, bool recursive )
{
- wxASSERT_MSG( oldwin, _T("Replacing NULL window") );
- wxASSERT_MSG( newwin, _T("Replacing with NULL window") );
+ wxASSERT_MSG( oldwin, wxT("Replacing NULL window") );
+ wxASSERT_MSG( newwin, wxT("Replacing with NULL window") );
wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
while (node)
bool wxSizer::Replace( wxSizer *oldsz, wxSizer *newsz, bool recursive )
{
- wxASSERT_MSG( oldsz, _T("Replacing NULL sizer") );
- wxASSERT_MSG( newsz, _T("Replacing with NULL sizer") );
+ wxASSERT_MSG( oldsz, wxT("Replacing NULL sizer") );
+ wxASSERT_MSG( newsz, wxT("Replacing with NULL sizer") );
wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
while (node)
bool wxSizer::Replace( size_t old, wxSizerItem *newitem )
{
- wxCHECK_MSG( old < m_children.GetCount(), false, _T("Replace index is out of range") );
- wxASSERT_MSG( newitem, _T("Replacing with NULL item") );
+ wxCHECK_MSG( old < m_children.GetCount(), false, wxT("Replace index is out of range") );
+ wxASSERT_MSG( newitem, wxT("Replacing with NULL item") );
wxSizerItemList::compatibility_iterator node = m_children.Item( old );
- wxCHECK_MSG( node, false, _T("Failed to find child node") );
+ wxCHECK_MSG( node, false, wxT("Failed to find child node") );
wxSizerItem *item = node->GetData();
node->SetData(newitem);
bool wxSizer::DoSetItemMinSize( wxWindow *window, int width, int height )
{
- wxASSERT_MSG( window, _T("SetMinSize for NULL window") );
+ wxASSERT_MSG( window, wxT("SetMinSize for NULL window") );
// Is it our immediate child?
bool wxSizer::DoSetItemMinSize( wxSizer *sizer, int width, int height )
{
- wxASSERT_MSG( sizer, _T("SetMinSize for NULL sizer") );
+ wxASSERT_MSG( sizer, wxT("SetMinSize for NULL sizer") );
// Is it our immediate child?
{
wxSizerItemList::compatibility_iterator node = m_children.Item( index );
- wxCHECK_MSG( node, false, _T("Failed to find child node") );
+ wxCHECK_MSG( node, false, wxT("Failed to find child node") );
wxSizerItem *item = node->GetData();
wxSizerItem* wxSizer::GetItem( wxWindow *window, bool recursive )
{
- wxASSERT_MSG( window, _T("GetItem for NULL window") );
+ wxASSERT_MSG( window, wxT("GetItem for NULL window") );
wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
while (node)
wxSizerItem* wxSizer::GetItem( wxSizer *sizer, bool recursive )
{
- wxASSERT_MSG( sizer, _T("GetItem for NULL sizer") );
+ wxASSERT_MSG( sizer, wxT("GetItem for NULL sizer") );
wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
while (node)
{
wxCHECK_MSG( index < m_children.GetCount(),
NULL,
- _T("GetItem index is out of range") );
+ wxT("GetItem index is out of range") );
return m_children.Item( index )->GetData();
}
node = node->GetNext();
}
- wxFAIL_MSG( _T("IsShown failed to find sizer item") );
+ wxFAIL_MSG( wxT("IsShown failed to find sizer item") );
return false;
}
node = node->GetNext();
}
- wxFAIL_MSG( _T("IsShown failed to find sizer item") );
+ wxFAIL_MSG( wxT("IsShown failed to find sizer item") );
return false;
}
{
wxCHECK_MSG( index < m_children.GetCount(),
false,
- _T("IsShown index is out of range") );
+ wxT("IsShown index is out of range") );
return m_children.Item( index )->GetData()->IsShown();
}
}
else // 0 columns, 0 rows?
{
- wxFAIL_MSG( _T("grid sizer must have either rows or columns fixed") );
+ wxFAIL_MSG( wxT("grid sizer must have either rows or columns fixed") );
nrows =
ncols = 0;
{
wxSizerItemList::compatibility_iterator node = m_children.Item( i );
- wxASSERT_MSG( node, _T("Failed to find SizerItemList node") );
+ wxASSERT_MSG( node, wxT("Failed to find SizerItemList node") );
SetItemBounds( node->GetData(), x, y, w, h);
}
}
}
- wxFAIL_MSG( _T("column/row is already not growable") );
+ wxFAIL_MSG( wxT("column/row is already not growable") );
}
void wxFlexGridSizer::RemoveGrowableCol( size_t idx )
// discard buffer
#define MAX_DISCARD_SIZE (10 * 1024)
-#define wxTRACE_Socket _T("wxSocket")
+#define wxTRACE_Socket wxT("wxSocket")
// --------------------------------------------------------------------------
// wxWin macros
void wxSocketBase::Shutdown()
{
// we should be initialized
- wxASSERT_MSG( m_countInit > 0, _T("extra call to Shutdown()") );
+ wxASSERT_MSG( m_countInit > 0, wxT("extra call to Shutdown()") );
if ( --m_countInit == 0 )
{
wxSocketManager * const manager = wxSocketManager::Get();
wxSocketFlags flags)
: wxSocketBase(flags, wxSOCKET_SERVER)
{
- wxLogTrace( wxTRACE_Socket, _T("Opening wxSocketServer") );
+ wxLogTrace( wxTRACE_Socket, wxT("Opening wxSocketServer") );
m_impl = wxSocketImpl::Create(*this);
if (!m_impl)
{
- wxLogTrace( wxTRACE_Socket, _T("*** Failed to create m_impl") );
+ wxLogTrace( wxTRACE_Socket, wxT("*** Failed to create m_impl") );
return;
}
delete m_impl;
m_impl = NULL;
- wxLogTrace( wxTRACE_Socket, _T("*** CreateServer() failed") );
+ wxLogTrace( wxTRACE_Socket, wxT("*** CreateServer() failed") );
return;
}
- wxLogTrace( wxTRACE_Socket, _T("wxSocketServer on fd %d"), m_impl->m_fd );
+ wxLogTrace( wxTRACE_Socket, wxT("wxSocketServer on fd %d"), m_impl->m_fd );
}
// --------------------------------------------------------------------------
bool wxSocketBase::GetOption(int level, int optname, void *optval, int *optlen)
{
- wxASSERT_MSG( m_impl, _T("Socket not initialised") );
+ wxASSERT_MSG( m_impl, wxT("Socket not initialised") );
SOCKOPTLEN_T lenreal = *optlen;
if ( getsockopt(m_impl->m_fd, level, optname,
bool
wxSocketBase::SetOption(int level, int optname, const void *optval, int optlen)
{
- wxASSERT_MSG( m_impl, _T("Socket not initialised") );
+ wxASSERT_MSG( m_impl, wxT("Socket not initialised") );
return setsockopt(m_impl->m_fd, level, optname,
static_cast<const char *>(optval), optlen) == 0;
const void* buf,
wxUint32 nBytes )
{
- wxASSERT_MSG( m_impl, _T("Socket not initialised") );
+ wxASSERT_MSG( m_impl, wxT("Socket not initialised") );
m_impl->SetPeer(addr.GetAddress());
Write(buf, nBytes);
#endif
{
#if wxUSE_UNICODE
- wxASSERT_MSG(m_buf.data() != NULL, _T("Could not convert string to UTF8!"));
+ wxASSERT_MSG(m_buf.data() != NULL, wxT("Could not convert string to UTF8!"));
#endif
m_pos = 0;
}
break;
default:
- wxFAIL_MSG( _T("invalid seek mode") );
+ wxFAIL_MSG( wxT("invalid seek mode") );
return wxInvalidOffset;
}
void wxStatusBarBase::SetFieldsCount(int number, const int *widths)
{
- wxCHECK_RET( number > 0, _T("invalid field number in SetFieldsCount") );
+ wxCHECK_RET( number > 0, wxT("invalid field number in SetFieldsCount") );
if ( (size_t)number > m_panes.GetCount() )
{
void wxStatusBarBase::SetStatusWidths(int WXUNUSED_UNLESS_DEBUG(n),
const int widths[])
{
- wxASSERT_MSG( (size_t)n == m_panes.GetCount(), _T("field number mismatch") );
+ wxASSERT_MSG( (size_t)n == m_panes.GetCount(), wxT("field number mismatch") );
if (widths == NULL)
{
void wxStatusBarBase::SetStatusStyles(int WXUNUSED_UNLESS_DEBUG(n),
const int styles[])
{
- wxCHECK_RET( styles, _T("NULL pointer in SetStatusStyles") );
+ wxCHECK_RET( styles, wxT("NULL pointer in SetStatusStyles") );
- wxASSERT_MSG( (size_t)n == m_panes.GetCount(), _T("field number mismatch") );
+ wxASSERT_MSG( (size_t)n == m_panes.GetCount(), wxT("field number mismatch") );
for ( size_t i = 0; i < m_panes.GetCount(); i++ )
m_panes[i].m_nStyle = styles[i];
lineStart = p;
}
- if ( p == text.end() || *p == _T('\n') )
+ if ( p == text.end() || *p == wxT('\n') )
{
DoOutputLine(line);
}
else // not EOL
{
- if ( *p == _T(' ') )
+ if ( *p == wxT(' ') )
lastSpace = p;
line += *p;
virtual void OnNewLine()
{
- m_text += _T('\n');
+ m_text += wxT('\n');
}
private:
wxStandardPaths& wxStandardPathsBase::Get()
{
wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
- wxCHECK_MSG( traits, gs_stdPaths, _T("create wxApp before calling this") );
+ wxCHECK_MSG( traits, gs_stdPaths, wxT("create wxApp before calling this") );
return traits->GetStandardPaths();
}
if ( !component.empty() )
{
const wxChar ch = *(subdir.end() - 1);
- if ( !wxFileName::IsPathSeparator(ch) && ch != _T('.') )
+ if ( !wxFileName::IsPathSeparator(ch) && ch != wxT('.') )
subdir += wxFileName::GetPathSeparator();
subdir += component;
STOCKITEM(wxID_ZOOM_OUT, _("Zoom &Out"))
default:
- wxFAIL_MSG( _T("invalid stock item ID") );
+ wxFAIL_MSG( wxT("invalid stock item ID") );
break;
};
{
wxAcceleratorEntry accel = wxGetStockAccelerator(id);
if (accel.IsOk())
- stockLabel << _T('\t') << accel.ToString();
+ stockLabel << wxT('\t') << accel.ToString();
}
#endif // wxUSE_ACCEL
if (label == stock)
return true;
- stock.Replace(_T("&"), wxEmptyString);
+ stock.Replace(wxT("&"), wxEmptyString);
if (label == stock)
return true;
#endif //def __DARWIN__
-#define TRACE_STRCONV _T("strconv")
+#define TRACE_STRCONV wxT("strconv")
// WC_UTF16 is defined only if sizeof(wchar_t) == 2, otherwise it's supposed to
// be 4 bytes
wxConvBrokenFileNames::wxConvBrokenFileNames(const wxString& charset)
{
- if ( wxStricmp(charset, _T("UTF-8")) == 0 ||
- wxStricmp(charset, _T("UTF8")) == 0 )
+ if ( wxStricmp(charset, wxT("UTF-8")) == 0 ||
+ wxStricmp(charset, wxT("UTF8")) == 0 )
m_conv = new wxMBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_PUA);
else
m_conv = new wxCSConv(charset);
}
else
{
- wxFAIL_MSG( _T("trying to encode undefined Unicode character") );
+ wxFAIL_MSG( wxT("trying to encode undefined Unicode character") );
break;
}
// check for charset that represents wchar_t:
if ( ms_wcCharsetName.empty() )
{
- wxLogTrace(TRACE_STRCONV, _T("Looking for wide char codeset:"));
+ wxLogTrace(TRACE_STRCONV, wxT("Looking for wide char codeset:"));
#if wxUSE_FONTMAP
const wxChar **names = wxFontMapperBase::GetAllEncodingNames(WC_ENC);
static const wxChar *names_static[] =
{
#if SIZEOF_WCHAR_T == 4
- _T("UCS-4"),
+ wxT("UCS-4"),
#elif SIZEOF_WCHAR_T = 2
- _T("UCS-2"),
+ wxT("UCS-2"),
#endif
NULL
};
wxString nameXE(nameCS);
#ifdef WORDS_BIGENDIAN
- nameXE += _T("BE");
+ nameXE += wxT("BE");
#else // little endian
- nameXE += _T("LE");
+ nameXE += wxT("LE");
#endif
- wxLogTrace(TRACE_STRCONV, _T(" trying charset \"%s\""),
+ wxLogTrace(TRACE_STRCONV, wxT(" trying charset \"%s\""),
nameXE.c_str());
m2w = iconv_open(nameXE.ToAscii(), name);
if ( m2w == ICONV_T_INVALID )
{
// try charset w/o bytesex info (e.g. "UCS4")
- wxLogTrace(TRACE_STRCONV, _T(" trying charset \"%s\""),
+ wxLogTrace(TRACE_STRCONV, wxT(" trying charset \"%s\""),
nameCS.c_str());
m2w = iconv_open(nameCS.ToAscii(), name);
wxT("iconv wchar_t charset is \"%s\"%s"),
ms_wcCharsetName.empty() ? wxString("<none>")
: ms_wcCharsetName,
- ms_wcNeedsSwap ? _T(" (needs swap)")
- : _T(""));
+ ms_wcNeedsSwap ? wxT(" (needs swap)")
+ : wxT(""));
}
else // we already have ms_wcCharsetName
{
switch ( len )
{
default:
- wxLogDebug(_T("Unexpected NUL length %d"), len);
+ wxLogDebug(wxT("Unexpected NUL length %d"), len);
self->m_minMBCharWidth = (size_t)-1;
break;
break;
}
- wxASSERT_MSG( s_isWin98Or2k != -1, _T("should be set above") );
+ wxASSERT_MSG( s_isWin98Or2k != -1, wxT("should be set above") );
}
return s_isWin98Or2k == 1;
{
if ( encoding == wxFONTENCODING_MAX || encoding == wxFONTENCODING_DEFAULT )
{
- wxFAIL_MSG( _T("invalid encoding value in wxCSConv ctor") );
+ wxFAIL_MSG( wxT("invalid encoding value in wxCSConv ctor") );
encoding = wxFONTENCODING_SYSTEM;
}
delete conv;
}
- gs_nameCache[encoding] = _T(""); // cache the failure
+ gs_nameCache[encoding] = wxT(""); // cache the failure
}
}
#endif // wxUSE_FONTMAP
// doing this has big chances to lead to a crash when the source buffer is
// destroyed (otherwise assume the caller knows what he does)
wxASSERT_MSG( !buffer.m_destroybuf,
- _T("it's a bad idea to copy this buffer") );
+ wxT("it's a bad idea to copy this buffer") );
m_buffer_start = buffer.m_buffer_start;
m_buffer_end = buffer.m_buffer_end;
}
char *new_start = (char *)realloc(m_buffer_start, new_size);
- wxCHECK_RET( new_size, _T("shrinking buffer shouldn't fail") );
+ wxCHECK_RET( new_size, wxT("shrinking buffer shouldn't fail") );
m_buffer_start = new_start;
m_buffer_end = m_buffer_start + new_size;
// write the buffer contents to the stream (only for write buffers)
bool wxStreamBuffer::FlushBuffer()
{
- wxCHECK_MSG( m_flushable, false, _T("can't flush this buffer") );
+ wxCHECK_MSG( m_flushable, false, wxT("can't flush this buffer") );
// FIXME: what is this check for? (VZ)
if ( m_buffer_pos == m_buffer_start )
wxOutputStream *outStream = GetOutputStream();
- wxCHECK_MSG( outStream, false, _T("should have a stream in wxStreamBuffer") );
+ wxCHECK_MSG( outStream, false, wxT("should have a stream in wxStreamBuffer") );
size_t current = m_buffer_pos - m_buffer_start;
size_t count = outStream->OnSysWrite(m_buffer_start, current);
{
wxOutputStream *outStream = GetOutputStream();
- wxCHECK_RET( outStream, _T("should have a stream in wxStreamBuffer") );
+ wxCHECK_RET( outStream, wxT("should have a stream in wxStreamBuffer") );
// if we don't have buffer at all, just forward this call to the stream,
if ( !HasBuffer() )
char wxStreamBuffer::Peek()
{
wxCHECK_MSG( m_stream && HasBuffer(), 0,
- _T("should have the stream and the buffer in wxStreamBuffer") );
+ wxT("should have the stream and the buffer in wxStreamBuffer") );
if ( !GetDataLeft() )
{
{
wxInputStream *inStream = GetInputStream();
- wxCHECK_MSG( inStream, 0, _T("should have a stream in wxStreamBuffer") );
+ wxCHECK_MSG( inStream, 0, wxT("should have a stream in wxStreamBuffer") );
char c;
if ( !HasBuffer() )
size_t wxStreamBuffer::Read(void *buffer, size_t size)
{
- wxASSERT_MSG( buffer, _T("Warning: Null pointer is about to be used") );
+ wxASSERT_MSG( buffer, wxT("Warning: Null pointer is about to be used") );
/* Clear buffer first */
memset(buffer, 0x00, size);
{
wxInputStream *inStream = GetInputStream();
- wxCHECK_MSG( inStream, 0, _T("should have a stream in wxStreamBuffer") );
+ wxCHECK_MSG( inStream, 0, wxT("should have a stream in wxStreamBuffer") );
readBytes = inStream->OnSysRead(buffer, size);
}
// this should really be called "Copy()"
size_t wxStreamBuffer::Read(wxStreamBuffer *dbuf)
{
- wxCHECK_MSG( m_mode != write, 0, _T("can't read from this buffer") );
+ wxCHECK_MSG( m_mode != write, 0, wxT("can't read from this buffer") );
char buf[BUF_TEMP_SIZE];
size_t nRead,
size_t wxStreamBuffer::Write(const void *buffer, size_t size)
{
- wxASSERT_MSG( buffer, _T("Warning: Null pointer is about to be send") );
+ wxASSERT_MSG( buffer, wxT("Warning: Null pointer is about to be send") );
if (m_stream)
{
{
wxOutputStream *outStream = GetOutputStream();
- wxCHECK_MSG( outStream, 0, _T("should have a stream in wxStreamBuffer") );
+ wxCHECK_MSG( outStream, 0, wxT("should have a stream in wxStreamBuffer") );
// no buffer, just forward the call to the stream
ret = outStream->OnSysWrite(buffer, size);
size_t wxStreamBuffer::Write(wxStreamBuffer *sbuf)
{
- wxCHECK_MSG( m_mode != read, 0, _T("can't write to this buffer") );
- wxCHECK_MSG( sbuf->m_mode != write, 0, _T("can't read from that buffer") );
+ wxCHECK_MSG( m_mode != read, 0, wxT("can't write to this buffer") );
+ wxCHECK_MSG( sbuf->m_mode != write, 0, wxT("can't read from that buffer") );
char buf[BUF_TEMP_SIZE];
size_t nWrite,
break;
default:
- wxFAIL_MSG( _T("invalid seek mode") );
+ wxFAIL_MSG( wxT("invalid seek mode") );
return wxInvalidOffset;
}
return 0;
const size_t len = wx_truncate_cast(size_t, length);
- wxASSERT_MSG( len == length + size_t(0), _T("large files not supported") );
+ wxASSERT_MSG( len == length + size_t(0), wxT("large files not supported") );
return len;
}
size_t wxInputStream::GetWBack(void *buf, size_t size)
{
- wxASSERT_MSG( buf, _T("Warning: Null pointer is about to be used") );
+ wxASSERT_MSG( buf, wxT("Warning: Null pointer is about to be used") );
/* Clear buffer first */
memset(buf, 0x00, size);
size_t wxInputStream::Ungetch(const void *buf, size_t bufsize)
{
- wxASSERT_MSG( buf, _T("Warning: Null pointer is about to be used in Ungetch()") );
+ wxASSERT_MSG( buf, wxT("Warning: Null pointer is about to be used in Ungetch()") );
if ( m_lasterror != wxSTREAM_NO_ERROR && m_lasterror != wxSTREAM_EOF )
{
wxInputStream& wxInputStream::Read(void *buf, size_t size)
{
- wxASSERT_MSG( buf, _T("Warning: Null pointer is about to be read") );
+ wxASSERT_MSG( buf, wxT("Warning: Null pointer is about to be read") );
char *p = (char *)buf;
m_lastcount = 0;
break;
default:
- wxFAIL_MSG( _T("invalid seek mode") );
+ wxFAIL_MSG( wxT("invalid seek mode") );
return wxInvalidOffset;
}
void wxBufferedInputStream::SetInputStreamBuffer(wxStreamBuffer *buffer)
{
- wxCHECK_RET( buffer, _T("wxBufferedInputStream needs buffer") );
+ wxCHECK_RET( buffer, wxT("wxBufferedInputStream needs buffer") );
delete m_i_streambuf;
m_i_streambuf = buffer;
void wxBufferedOutputStream::SetOutputStreamBuffer(wxStreamBuffer *buffer)
{
- wxCHECK_RET( buffer, _T("wxBufferedOutputStream needs buffer") );
+ wxCHECK_RET( buffer, wxT("wxBufferedOutputStream needs buffer") );
delete m_o_streambuf;
m_o_streambuf = buffer;
// and then to UTF-8:
SubstrBufFromMB buf(ConvertStr(wcBuf, wcLen, wxMBConvStrictUTF8()));
// widechar -> UTF-8 conversion isn't supposed to ever fail:
- wxASSERT_MSG( buf.data, _T("conversion to UTF-8 failed") );
+ wxASSERT_MSG( buf.data, wxT("conversion to UTF-8 failed") );
return buf;
}
wxString s;
if ( !s.Alloc(strlen(psz) + str.length()) ) {
- wxFAIL_MSG( _T("out of memory in wxString::operator+") );
+ wxFAIL_MSG( wxT("out of memory in wxString::operator+") );
}
s += str;
s += psz;
wxString s;
if ( !s.Alloc(wxWcslen(pwz) + str.length()) ) {
- wxFAIL_MSG( _T("out of memory in wxString::operator+") );
+ wxFAIL_MSG( wxT("out of memory in wxString::operator+") );
}
s += str;
s += pwz;
wxString s;
if ( !s.Alloc(strlen(psz) + str.length()) ) {
- wxFAIL_MSG( _T("out of memory in wxString::operator+") );
+ wxFAIL_MSG( wxT("out of memory in wxString::operator+") );
}
s = psz;
s += str;
wxString s;
if ( !s.Alloc(wxWcslen(pwz) + str.length()) ) {
- wxFAIL_MSG( _T("out of memory in wxString::operator+") );
+ wxFAIL_MSG( wxT("out of memory in wxString::operator+") );
}
s = pwz;
s += str;
size_t wxString::find_first_of(const wxChar* sz, size_t nStart, size_t n) const
{
- wxASSERT_MSG( nStart <= length(), _T("invalid index") );
+ wxASSERT_MSG( nStart <= length(), wxT("invalid index") );
size_t idx = nStart;
for ( const_iterator i = begin() + nStart; i != end(); ++idx, ++i )
size_t wxString::find_first_not_of(const wxChar* sz, size_t nStart, size_t n) const
{
- wxASSERT_MSG( nStart <= length(), _T("invalid index") );
+ wxASSERT_MSG( nStart <= length(), wxT("invalid index") );
size_t idx = nStart;
for ( const_iterator i = begin() + nStart; i != end(); ++idx, ++i )
}
else
{
- wxASSERT_MSG( nStart <= len, _T("invalid index") );
+ wxASSERT_MSG( nStart <= len, wxT("invalid index") );
}
size_t idx = nStart;
}
else
{
- wxASSERT_MSG( nStart <= len, _T("invalid index") );
+ wxASSERT_MSG( nStart <= len, wxT("invalid index") );
}
size_t idx = nStart;
size_t wxString::find_first_not_of(wxUniChar ch, size_t nStart) const
{
- wxASSERT_MSG( nStart <= length(), _T("invalid index") );
+ wxASSERT_MSG( nStart <= length(), wxT("invalid index") );
size_t idx = nStart;
for ( const_iterator i = begin() + nStart; i != end(); ++idx, ++i )
}
else
{
- wxASSERT_MSG( nStart <= len, _T("invalid index") );
+ wxASSERT_MSG( nStart <= len, wxT("invalid index") );
}
size_t idx = nStart;
{
unsigned char c = (unsigned char)*ascii++;
wxASSERT_MSG( c < 0x80,
- _T("Non-ASCII value passed to FromAscii().") );
+ wxT("Non-ASCII value passed to FromAscii().") );
*dest++ = (wchar_t)c;
}
unsigned char c = (unsigned char)ascii;
- wxASSERT_MSG( c < 0x80, _T("Non-ASCII value passed to FromAscii().") );
+ wxASSERT_MSG( c < 0x80, wxT("Non-ASCII value passed to FromAscii().") );
// NB: the cast to wchar_t causes interpretation of 'ascii' as Latin1 value
return wxString(wxUniChar((wchar_t)c));
wxString dest(*this, nFirst, nCount);
if ( dest.length() != nCount )
{
- wxFAIL_MSG( _T("out of memory in wxString::Mid") );
+ wxFAIL_MSG( wxT("out of memory in wxString::Mid") );
}
return dest;
wxString dest(*this, length() - nCount, nCount);
if ( dest.length() != nCount ) {
- wxFAIL_MSG( _T("out of memory in wxString::Right") );
+ wxFAIL_MSG( wxT("out of memory in wxString::Right") );
}
return dest;
}
wxString dest(*this, 0, nCount);
if ( dest.length() != nCount ) {
- wxFAIL_MSG( _T("out of memory in wxString::Left") );
+ wxFAIL_MSG( wxT("out of memory in wxString::Left") );
}
return dest;
}
{
// if we tried to replace an empty string we'd enter an infinite loop below
wxCHECK_MSG( !strOld.empty(), 0,
- _T("wxString::Replace(): invalid parameter") );
+ wxT("wxString::Replace(): invalid parameter") );
wxSTRING_INVALIDATE_CACHE();
const_iterator i = begin();
- if ( *i == _T('-') || *i == _T('+') )
+ if ( *i == wxT('-') || *i == wxT('+') )
++i;
for ( ; i != end(); ++i )
#endif
#define WX_STRING_TO_X_TYPE_START \
- wxCHECK_MSG( pVal, false, _T("NULL output pointer") ); \
+ wxCHECK_MSG( pVal, false, wxT("NULL output pointer") ); \
DO_IF_NOT_WINCE( errno = 0; ) \
const wxStringCharType *start = wx_str(); \
wxStringCharType *end;
bool wxString::ToLong(long *pVal, int base) const
{
- wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") );
+ wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") );
WX_STRING_TO_X_TYPE_START
long val = wxStrtol(start, &end, base);
bool wxString::ToULong(unsigned long *pVal, int base) const
{
- wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") );
+ wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") );
WX_STRING_TO_X_TYPE_START
unsigned long val = wxStrtoul(start, &end, base);
bool wxString::ToLongLong(wxLongLong_t *pVal, int base) const
{
- wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") );
+ wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") );
WX_STRING_TO_X_TYPE_START
wxLongLong_t val = wxStrtoll(start, &end, base);
bool wxString::ToULongLong(wxULongLong_t *pVal, int base) const
{
- wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") );
+ wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") );
WX_STRING_TO_X_TYPE_START
wxULongLong_t val = wxStrtoull(start, &end, base);
bool wxString::ToCLong(long *pVal, int base) const
{
- wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") );
+ wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") );
WX_STRING_TO_X_TYPE_START
#if (wxUSE_UNICODE_UTF8 || !wxUSE_UNICODE) && defined(wxHAS_XLOCALE_SUPPORT)
bool wxString::ToCULong(unsigned long *pVal, int base) const
{
- wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") );
+ wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") );
WX_STRING_TO_X_TYPE_START
#if (wxUSE_UNICODE_UTF8 || !wxUSE_UNICODE) && defined(wxHAS_XLOCALE_SUPPORT)
// always do it manually
// FIXME: This really seems to be the wrong and would be an off-by-one
// bug except the code above allocates an extra character.
- buf[size] = _T('\0');
+ buf[size] = wxT('\0');
// vsnprintf() may return either -1 (traditional Unix behaviour) or the
// total number of characters which would have been written if the
wxString pattern;
pattern.reserve(wxStrlen(pszMask));
- pattern += _T('^');
+ pattern += wxT('^');
while ( *pszMask )
{
switch ( *pszMask )
{
- case _T('?'):
- pattern += _T('.');
+ case wxT('?'):
+ pattern += wxT('.');
break;
- case _T('*'):
- pattern += _T(".*");
+ case wxT('*'):
+ pattern += wxT(".*");
break;
- case _T('^'):
- case _T('.'):
- case _T('$'):
- case _T('('):
- case _T(')'):
- case _T('|'):
- case _T('+'):
- case _T('\\'):
+ case wxT('^'):
+ case wxT('.'):
+ case wxT('$'):
+ case wxT('('):
+ case wxT(')'):
+ case wxT('|'):
+ case wxT('+'):
+ case wxT('\\'):
// these characters are special in a RE, quote them
// (however note that we don't quote '[' and ']' to allow
// using them for Unix shell like matching)
- pattern += _T('\\');
+ pattern += wxT('\\');
// fall through
default:
pszMask++;
}
- pattern += _T('$');
+ pattern += wxT('$');
// and now use it
return wxRegEx(pattern, wxRE_NOSUB | wxRE_EXTENDED).Matches(c_str());
#if wxUSE_UNICODE_UTF8
const wxStringCharType WXDLLIMPEXP_BASE *wxEmptyStringImpl = "";
#endif
-const wxChar WXDLLIMPEXP_BASE *wxEmptyString = _T("");
+const wxChar WXDLLIMPEXP_BASE *wxEmptyString = wxT("");
#else
#if wxUSE_UNICODE_UTF8
// FIXME-UTF8: get rid of this, have only one wxEmptyString
const wxStringCharType WXDLLIMPEXP_BASE *wxEmptyStringImpl = &g_strEmpty.dummy;
-const wxChar WXDLLIMPEXP_BASE *wxEmptyString = _T("");
+const wxChar WXDLLIMPEXP_BASE *wxEmptyString = wxT("");
#else
const wxStringCharType WXDLLIMPEXP_BASE *wxEmptyString = &g_strEmpty.dummy;
#endif
// if the length is not given, assume the string to be NUL terminated
if ( nLength == npos ) {
- wxASSERT_MSG( nPos <= wxStrlen(psz), _T("index out of bounds") );
+ wxASSERT_MSG( nPos <= wxStrlen(psz), wxT("index out of bounds") );
nLength = wxStrlen(psz + nPos);
}
if ( nLength > 0 ) {
// trailing '\0' is written in AllocBuffer()
if ( !AllocBuffer(nLength) ) {
- wxFAIL_MSG( _T("out of memory in wxStringImpl::InitWith") );
+ wxFAIL_MSG( wxT("out of memory in wxStringImpl::InitWith") );
return;
}
wxStringMemcpy(m_pchData, psz + nPos, nLength);
}
else
{
- wxFAIL_MSG( _T("first must be before last") );
+ wxFAIL_MSG( wxT("first must be before last") );
Init();
}
}
size_type len = length();
if ( !Alloc(len + n) || !CopyBeforeWrite() ) {
- wxFAIL_MSG( _T("out of memory in wxStringImpl::append") );
+ wxFAIL_MSG( wxT("out of memory in wxStringImpl::append") );
return *this;
}
GetStringData()->nDataLength = len + n;
if ( n == 0 ) return *this;
if ( !Alloc(length() + n) || !CopyBeforeWrite() ) {
- wxFAIL_MSG( _T("out of memory in wxStringImpl::insert") );
+ wxFAIL_MSG( wxT("out of memory in wxStringImpl::insert") );
return *this;
}
const size_t lenOld = length();
wxASSERT_MSG( nStart <= lenOld,
- _T("index out of bounds in wxStringImpl::replace") );
+ wxT("index out of bounds in wxStringImpl::replace") );
size_t nEnd = nStart + nLen;
if ( nLen > lenOld - nStart )
{
{
wxStringCharType c(ch);
if ( !AssignCopy(1, &c) ) {
- wxFAIL_MSG( _T("out of memory in wxStringImpl::operator=(wxStringCharType)") );
+ wxFAIL_MSG( wxT("out of memory in wxStringImpl::operator=(wxStringCharType)") );
}
return *this;
}
wxStringImpl& wxStringImpl::operator=(const wxStringCharType *psz)
{
if ( !AssignCopy(wxStrlen(psz), psz) ) {
- wxFAIL_MSG( _T("out of memory in wxStringImpl::operator=(const wxStringCharType *)") );
+ wxFAIL_MSG( wxT("out of memory in wxStringImpl::operator=(const wxStringCharType *)") );
}
return *this;
}
{
wxStringData * const pData = GetStringData();
- wxASSERT_MSG( nLen < pData->nAllocLength, _T("buffer overrun") );
+ wxASSERT_MSG( nLen < pData->nAllocLength, wxT("buffer overrun") );
// the strings we store are always NUL-terminated
- pData->data()[nLen] = _T('\0');
+ pData->data()[nLen] = wxT('\0');
pData->nDataLength = nLen;
pData->Validate(true);
}
}
else
{
- wxFAIL_MSG( _T("trying to encode undefined Unicode character") );
+ wxFAIL_MSG( wxT("trying to encode undefined Unicode character") );
out[0] = 0;
}
wxUniChar::value_type code = 0;
size_t len = GetUtf8CharLength(*i);
- wxASSERT_MSG( len <= 4, _T("invalid UTF-8 sequence length") );
+ wxASSERT_MSG( len <= 4, wxT("invalid UTF-8 sequence length") );
// Char. number range | UTF-8 octet sequence
// (hexadecimal) | (binary)
// extract the lead byte's value bits:
wxASSERT_MSG( ((unsigned char)*i & s_leadMarkerMask[len-1]) ==
s_leadMarkerVal[len-1],
- _T("invalid UTF-8 lead byte") );
+ wxT("invalid UTF-8 lead byte") );
code = (unsigned char)*i & s_leadValueMask[len-1];
// all remaining bytes, if any, are handled in the same way regardless of
for ( ++i ; len > 1; --len, ++i )
{
wxASSERT_MSG( ((unsigned char)*i & 0xC0) == 0x80,
- _T("invalid UTF-8 byte") );
+ wxT("invalid UTF-8 byte") );
code <<= 6;
code |= (unsigned char)*i & 0x3F;
while ( *format )
{
- if ( CopyFmtChar(*format++) == _T('%') )
+ if ( CopyFmtChar(*format++) == wxT('%') )
{
// skip any flags
while ( IsFlagChar(*format) )
CopyFmtChar(*format++);
// and possible width
- if ( *format == _T('*') )
+ if ( *format == wxT('*') )
CopyFmtChar(*format++);
else
SkipDigits(&format);
// precision?
- if ( *format == _T('.') )
+ if ( *format == wxT('.') )
{
CopyFmtChar(*format++);
- if ( *format == _T('*') )
+ if ( *format == wxT('*') )
CopyFmtChar(*format++);
else
SkipDigits(&format);
// and finally we should have the type
switch ( *format )
{
- case _T('S'):
- case _T('s'):
+ case wxT('S'):
+ case wxT('s'):
// all strings were converted into the same form by
// wxArgNormalizer<T>, this form depends on the context
// in which the value is used (scanf/printf/wprintf):
HandleString(*format, size, outConv, outSize);
break;
- case _T('C'):
- case _T('c'):
+ case wxT('C'):
+ case wxT('c'):
HandleChar(*format, size, outConv, outSize);
break;
switch ( outSize )
{
case Size_Long:
- InsertFmtChar(_T('l'));
+ InsertFmtChar(wxT('l'));
break;
case Size_Short:
- InsertFmtChar(_T('h'));
+ InsertFmtChar(wxT('h'));
break;
case Size_Default:
static bool IsFlagChar(CharType ch)
{
- return ch == _T('-') || ch == _T('+') ||
- ch == _T('0') || ch == _T(' ') || ch == _T('#');
+ return ch == wxT('-') || ch == wxT('+') ||
+ ch == wxT('0') || ch == wxT(' ') || ch == wxT('#');
}
void SkipDigits(const CharType **ptpc)
{
- while ( **ptpc >= _T('0') && **ptpc <= _T('9') )
+ while ( **ptpc >= wxT('0') && **ptpc <= wxT('9') )
CopyFmtChar(*(*ptpc)++);
}
// which can be set to affect the behaviour or just this application
// and then for "wx_name" which can be set to change the option globally
wxString var(name);
- var.Replace(_T("."), _T("_")); // '.'s not allowed in env var names
+ var.Replace(wxT("."), wxT("_")); // '.'s not allowed in env var names
wxString appname;
if ( wxTheApp )
appname = wxTheApp->GetAppName();
if ( !appname.empty() )
- val = wxGetenv(_T("wx_") + appname + _T('_') + var);
+ val = wxGetenv(wxT("wx_") + appname + wxT('_') + var);
if ( val.empty() )
- val = wxGetenv(_T("wx_") + var);
+ val = wxGetenv(wxT("wx_") + var);
}
return val;
const wxChar * const *
wxTarClassFactory::GetProtocols(wxStreamProtocolType type) const
{
- static const wxChar *protocols[] = { _T("tar"), NULL };
- static const wxChar *mimetypes[] = { _T("application/x-tar"), NULL };
- static const wxChar *fileexts[] = { _T(".tar"), NULL };
+ static const wxChar *protocols[] = { wxT("tar"), NULL };
+ static const wxChar *mimetypes[] = { wxT("application/x-tar"), NULL };
+ static const wxChar *fileexts[] = { wxT(".tar"), NULL };
static const wxChar *empty[] = { NULL };
switch (type) {
// A table giving the field names and offsets in a tar header block
const wxTarField wxTarHeaderBlock::fields[] =
{
- { _T("name"), 0 }, // 100
- { _T("mode"), 100 }, // 8
- { _T("uid"), 108 }, // 8
- { _T("gid"), 116 }, // 8
- { _T("size"), 124 }, // 12
- { _T("mtime"), 136 }, // 12
- { _T("chksum"), 148 }, // 8
- { _T("typeflag"), 156 }, // 1
- { _T("linkname"), 157 }, // 100
- { _T("magic"), 257 }, // 6
- { _T("version"), 263 }, // 2
- { _T("uname"), 265 }, // 32
- { _T("gname"), 297 }, // 32
- { _T("devmajor"), 329 }, // 8
- { _T("devminor"), 337 }, // 8
- { _T("prefix"), 345 }, // 155
- { _T("unused"), 500 }, // 12
+ { wxT("name"), 0 }, // 100
+ { wxT("mode"), 100 }, // 8
+ { wxT("uid"), 108 }, // 8
+ { wxT("gid"), 116 }, // 8
+ { wxT("size"), 124 }, // 12
+ { wxT("mtime"), 136 }, // 12
+ { wxT("chksum"), 148 }, // 8
+ { wxT("typeflag"), 156 }, // 1
+ { wxT("linkname"), 157 }, // 100
+ { wxT("magic"), 257 }, // 6
+ { wxT("version"), 263 }, // 2
+ { wxT("uname"), 265 }, // 32
+ { wxT("gname"), 297 }, // 32
+ { wxT("devmajor"), 329 }, // 8
+ { wxT("devminor"), 337 }, // 8
+ { wxT("prefix"), 345 }, // 155
+ { wxT("unused"), 500 }, // 12
{ NULL, TAR_BLOCKSIZE }
};
switch (wxFileName::GetFormat(format)) {
case wxPATH_DOS:
{
- wxString name(isDir ? m_Name + _T("\\") : m_Name);
+ wxString name(isDir ? m_Name + wxT("\\") : m_Name);
for (size_t i = 0; i < name.length(); i++)
- if (name[i] == _T('/'))
- name[i] = _T('\\');
+ if (name[i] == wxT('/'))
+ name[i] = wxT('\\');
return name;
}
case wxPATH_UNIX:
- return isDir ? m_Name + _T("/") : m_Name;
+ return isDir ? m_Name + wxT("/") : m_Name;
default:
;
while (!internal.empty() && *internal.begin() == '/')
internal.erase(0, 1);
- while (!internal.empty() && internal.compare(0, 2, _T("./")) == 0)
+ while (!internal.empty() && internal.compare(0, 2, wxT("./")) == 0)
internal.erase(0, 2);
- if (internal == _T(".") || internal == _T(".."))
+ if (internal == wxT(".") || internal == wxT(".."))
internal = wxEmptyString;
return internal;
entry->SetOffset(m_offset);
- entry->SetDateTime(GetHeaderDate(_T("mtime")));
- entry->SetAccessTime(GetHeaderDate(_T("atime")));
- entry->SetCreateTime(GetHeaderDate(_T("ctime")));
+ entry->SetDateTime(GetHeaderDate(wxT("mtime")));
+ entry->SetAccessTime(GetHeaderDate(wxT("atime")));
+ entry->SetCreateTime(GetHeaderDate(wxT("ctime")));
entry->SetTypeFlag(*m_hdr->Get(TAR_TYPEFLAG));
bool isDir = entry->IsDir();
{
wxString path;
- if ((path = GetExtendedHeader(_T("path"))) != wxEmptyString)
+ if ((path = GetExtendedHeader(wxT("path"))) != wxEmptyString)
return path;
path = wxString(m_hdr->Get(TAR_NAME), GetConv());
return path;
const char *prefix = m_hdr->Get(TAR_PREFIX);
- return *prefix ? wxString(prefix, GetConv()) + _T("/") + path : path;
+ return *prefix ? wxString(prefix, GetConv()) + wxT("/") + path : path;
}
wxDateTime wxTarInputStream::GetHeaderDate(const wxString& key) const
return ll;
}
- if (key == _T("mtime"))
+ if (key == wxT("mtime"))
return wxLongLong(m_hdr->GetOctal(TAR_MTIME)) * 1000L;
return wxDateTime();
entry.SetSize(0);
m_large = !SetHeaderNumber(TAR_SIZE, entry.GetSize());
- SetHeaderDate(_T("mtime"), entry.GetDateTime());
+ SetHeaderDate(wxT("mtime"), entry.GetDateTime());
if (entry.GetAccessTime().IsValid())
- SetHeaderDate(_T("atime"), entry.GetAccessTime());
+ SetHeaderDate(wxT("atime"), entry.GetAccessTime());
if (entry.GetCreateTime().IsValid())
- SetHeaderDate(_T("ctime"), entry.GetCreateTime());
+ SetHeaderDate(wxT("ctime"), entry.GetCreateTime());
*m_hdr->Get(TAR_TYPEFLAG) = char(entry.GetTypeFlag());
// an old tar that doesn't understand extended headers will
// extract it as a file, so give these fields reasonable values
// so that the user will have access to read and remove it.
- m_hdr2->SetPath(PaxHeaderPath(_T("%d/PaxHeaders.%p/%f"),
+ m_hdr2->SetPath(PaxHeaderPath(wxT("%d/PaxHeaders.%p/%f"),
entry.GetName(wxPATH_UNIX)), GetConv());
m_hdr2->SetOctal(TAR_MODE, 0600);
strcpy(m_hdr2->Get(TAR_UID), m_hdr->Get(TAR_UID));
wxString wxTarOutputStream::PaxHeaderPath(const wxString& format,
const wxString& path)
{
- wxString d = path.BeforeLast(_T('/'));
- wxString f = path.AfterLast(_T('/'));
+ wxString d = path.BeforeLast(wxT('/'));
+ wxString f = path.AfterLast(wxT('/'));
wxString ret;
if (d.empty())
- d = _T(".");
+ d = wxT(".");
ret.reserve(format.length() + path.length() + 16);
case 'd': ret << d; break;
case 'f': ret << f; break;
case 'p': ret << wxGetProcessId(); break;
- case '%': ret << _T("%"); break;
+ case '%': ret << wxT("%"); break;
}
begin = end + 2;
}
void wxTarOutputStream::SetHeaderPath(const wxString& name)
{
if (!m_hdr->SetPath(name, GetConv()) || (m_pax && !name.IsAscii()))
- SetExtendedHeader(_T("path"), name);
+ SetExtendedHeader(wxT("path"), name);
}
bool wxTarOutputStream::SetHeaderNumber(int id, wxTarNumber n)
wxLongLong ll = datetime.IsValid() ? datetime.GetValue() : wxLongLong(0);
wxLongLong secs = ll / 1000L;
- if (key != _T("mtime")
+ if (key != wxT("mtime")
|| !m_hdr->SetOctal(TAR_MTIME, wxTarNumber(secs.GetValue()))
|| secs <= 0 || secs >= 0x7fffffff)
{
wxString str;
if (ll >= LONG_MIN && ll <= LONG_MAX) {
- str.Printf(_T("%g"), ll.ToLong() / 1000.0);
+ str.Printf(wxT("%g"), ll.ToLong() / 1000.0);
} else {
str = ll.ToString();
str.insert(str.end() - 3, '.');
else {
// if not pax then make a list of fields to report as errors
if (!m_badfit.empty())
- m_badfit += _T(", ");
+ m_badfit += wxT(", ");
m_badfit += key;
}
}
bool wxToolBarToolBase::Toggle(bool toggle)
{
- wxASSERT_MSG( CanBeToggled(), _T("can't toggle this tool") );
+ wxASSERT_MSG( CanBeToggled(), wxT("can't toggle this tool") );
if ( m_toggled == toggle )
return false;
wxObject *clientData)
{
wxCHECK_MSG( pos <= GetToolsCount(), NULL,
- _T("invalid position in wxToolBar::InsertTool()") );
+ wxT("invalid position in wxToolBar::InsertTool()") );
wxToolBarToolBase *tool = CreateTool(id, label, bitmap, bmpDisabled, kind,
clientData, shortHelp, longHelp);
wxToolBarBase::InsertTool(size_t pos, wxToolBarToolBase *tool)
{
wxCHECK_MSG( pos <= GetToolsCount(), NULL,
- _T("invalid position in wxToolBar::InsertTool()") );
+ wxT("invalid position in wxToolBar::InsertTool()") );
if ( !tool || !DoInsertTool(pos, tool) )
{
const wxString& label)
{
wxCHECK_MSG( control, NULL,
- _T("toolbar: can't insert NULL control") );
+ wxT("toolbar: can't insert NULL control") );
wxCHECK_MSG( control->GetParent() == this, NULL,
- _T("control must have toolbar as parent") );
+ wxT("control must have toolbar as parent") );
wxCHECK_MSG( pos <= GetToolsCount(), NULL,
- _T("invalid position in wxToolBar::InsertControl()") );
+ wxT("invalid position in wxToolBar::InsertControl()") );
wxToolBarToolBase *tool = CreateTool(control, label);
if ( !control )
{
- wxFAIL_MSG( _T("NULL control in toolbar?") );
+ wxFAIL_MSG( wxT("NULL control in toolbar?") );
}
else if ( control->GetId() == id )
{
wxToolBarToolBase *wxToolBarBase::InsertSeparator(size_t pos)
{
wxCHECK_MSG( pos <= GetToolsCount(), NULL,
- _T("invalid position in wxToolBar::InsertSeparator()") );
+ wxT("invalid position in wxToolBar::InsertSeparator()") );
wxToolBarToolBase *tool = CreateTool(wxID_SEPARATOR,
wxEmptyString,
bool wxToolBarBase::DeleteToolByPos(size_t pos)
{
wxCHECK_MSG( pos < GetToolsCount(), false,
- _T("invalid position in wxToolBar::DeleteToolByPos()") );
+ wxT("invalid position in wxToolBar::DeleteToolByPos()") );
wxToolBarToolsList::compatibility_iterator node = m_tools.Item(pos);
void wxToolBarBase::UnToggleRadioGroup(wxToolBarToolBase *tool)
{
- wxCHECK_RET( tool, _T("NULL tool in wxToolBarTool::UnToggleRadioGroup") );
+ wxCHECK_RET( tool, wxT("NULL tool in wxToolBarTool::UnToggleRadioGroup") );
if ( !tool->IsButton() || tool->GetKind() != wxITEM_RADIO )
return;
wxToolBarToolsList::compatibility_iterator node = m_tools.Find(tool);
- wxCHECK_RET( node, _T("invalid tool in wxToolBarTool::UnToggleRadioGroup") );
+ wxCHECK_RET( node, wxT("invalid tool in wxToolBarTool::UnToggleRadioGroup") );
wxToolBarToolsList::compatibility_iterator nodeNext = node->GetNext();
while ( nodeNext )
{
wxToolBarToolBase *tool = FindById(id);
- wxCHECK_RET( tool, _T("no such tool in wxToolBar::SetToolClientData") );
+ wxCHECK_RET( tool, wxT("no such tool in wxToolBar::SetToolClientData") );
tool->SetClientData(clientData);
}
bool wxToolBarBase::GetToolState(int id) const
{
wxToolBarToolBase *tool = FindById(id);
- wxCHECK_MSG( tool, false, _T("no such tool") );
+ wxCHECK_MSG( tool, false, wxT("no such tool") );
return tool->IsToggled();
}
bool wxToolBarBase::GetToolEnabled(int id) const
{
wxToolBarToolBase *tool = FindById(id);
- wxCHECK_MSG( tool, false, _T("no such tool") );
+ wxCHECK_MSG( tool, false, wxT("no such tool") );
return tool->IsEnabled();
}
wxString wxToolBarBase::GetToolShortHelp(int id) const
{
wxToolBarToolBase *tool = FindById(id);
- wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") );
+ wxCHECK_MSG( tool, wxEmptyString, wxT("no such tool") );
return tool->GetShortHelp();
}
wxString wxToolBarBase::GetToolLongHelp(int id) const
{
wxToolBarToolBase *tool = FindById(id);
- wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") );
+ wxCHECK_MSG( tool, wxEmptyString, wxT("no such tool") );
return tool->GetLongHelp();
}
bool wxToolBarBase::SetDropdownMenu(int toolid, wxMenu* menu)
{
wxToolBarToolBase * const tool = FindById(toolid);
- wxCHECK_MSG( tool, false, _T("invalid tool id") );
+ wxCHECK_MSG( tool, false, wxT("invalid tool id") );
wxCHECK_MSG( tool->GetKind() == wxITEM_DROPDOWN, false,
- _T("menu can be only associated with drop down tools") );
+ wxT("menu can be only associated with drop down tools") );
tool->SetDropdownMenu(menu);
{
wxChar ch = *i;
switch ( ch ) {
- case _T('\n'):
+ case wxT('\n'):
// Dos/Unix line termination
result += eol;
chLast = 0;
break;
- case _T('\r'):
- if ( chLast == _T('\r') ) {
+ case wxT('\r'):
+ if ( chLast == wxT('\r') ) {
// Mac empty line
result += eol;
}
else {
// just remember it: we don't know whether it is just "\r"
// or "\r\n" yet
- chLast = _T('\r');
+ chLast = wxT('\r');
}
break;
default:
- if ( chLast == _T('\r') ) {
+ if ( chLast == wxT('\r') ) {
// Mac line termination
result += eol;
case wxTextFileType_Unix: nUnix++; break; \
case wxTextFileType_Dos: nDos++; break; \
case wxTextFileType_Mac: nMac++; break; \
- default: wxFAIL_MSG(_T("unknown line terminator")); \
+ default: wxFAIL_MSG(wxT("unknown line terminator")); \
}
size_t n;
bool wxTextCtrlBase::DoSaveFile(const wxString& filename, int WXUNUSED(fileType))
{
#if wxUSE_FFILE
- wxFFile file(filename, _T("w"));
+ wxFFile file(filename, wxT("w"));
if ( file.IsOpened() && file.Write(GetValue()) )
{
// if it worked, save for future calls
case WXK_NUMPAD7:
case WXK_NUMPAD8:
case WXK_NUMPAD9:
- ch = (wxChar)(_T('0') + keycode - WXK_NUMPAD0);
+ ch = (wxChar)(wxT('0') + keycode - WXK_NUMPAD0);
break;
case WXK_MULTIPLY:
case WXK_NUMPAD_MULTIPLY:
- ch = _T('*');
+ ch = wxT('*');
break;
case WXK_ADD:
case WXK_NUMPAD_ADD:
- ch = _T('+');
+ ch = wxT('+');
break;
case WXK_SUBTRACT:
case WXK_NUMPAD_SUBTRACT:
- ch = _T('-');
+ ch = wxT('-');
break;
case WXK_DECIMAL:
case WXK_NUMPAD_DECIMAL:
- ch = _T('.');
+ ch = wxT('.');
break;
case WXK_DIVIDE:
case WXK_NUMPAD_DIVIDE:
- ch = _T('/');
+ ch = wxT('/');
break;
case WXK_DELETE:
}
else
{
- ch = _T('\0');
+ ch = wxT('\0');
}
}
switch ( OpenMode )
{
default:
- wxFAIL_MSG( _T("unknown open mode in wxTextFile::Open") );
+ wxFAIL_MSG( wxT("unknown open mode in wxTextFile::Open") );
// fall through
case ReadAccess :
bool wxTextFile::OnRead(const wxMBConv& conv)
{
// file should be opened
- wxASSERT_MSG( m_file.IsOpened(), _T("can't read closed file") );
+ wxASSERT_MSG( m_file.IsOpened(), wxT("can't read closed file") );
// read the entire file in memory: this is not the most efficient thing to
// do it but there is no good way to avoid it in Unicode build because if
return false;
// if the file is seekable, also check that we're at its beginning
- wxASSERT_MSG( m_file.Tell() == 0, _T("should be at start of file") );
+ wxASSERT_MSG( m_file.Tell() == 0, wxT("should be at start of file") );
char *dst = buf.data();
for ( size_t nRemaining = bufSize; nRemaining > 0; )
}
wxASSERT_MSG( dst - buf.data() == (wxFileOffset)bufSize,
- _T("logic error") );
+ wxT("logic error") );
}
else // file is not seekable
{
m_impl = traits ? traits->CreateTimerImpl(this) : NULL;
if ( !m_impl )
{
- wxFAIL_MSG( _T("No timer implementation for this platform") );
+ wxFAIL_MSG( wxT("No timer implementation for this platform") );
}
}
void wxTimer::SetOwner(wxEvtHandler *owner, int timerid)
{
- wxCHECK_RET( m_impl, _T("uninitialized timer") );
+ wxCHECK_RET( m_impl, wxT("uninitialized timer") );
m_impl->SetOwner(owner, timerid);
}
wxEvtHandler *wxTimer::GetOwner() const
{
- wxCHECK_MSG( m_impl, NULL, _T("uninitialized timer") );
+ wxCHECK_MSG( m_impl, NULL, wxT("uninitialized timer") );
return m_impl->GetOwner();
}
bool wxTimer::Start(int milliseconds, bool oneShot)
{
- wxCHECK_MSG( m_impl, false, _T("uninitialized timer") );
+ wxCHECK_MSG( m_impl, false, wxT("uninitialized timer") );
return m_impl->Start(milliseconds, oneShot);
}
void wxTimer::Stop()
{
- wxCHECK_RET( m_impl, _T("uninitialized timer") );
+ wxCHECK_RET( m_impl, wxT("uninitialized timer") );
if ( m_impl->IsRunning() )
m_impl->Stop();
{
// the base class version generates an event if it has owner - which it
// should because otherwise nobody can process timer events
- wxCHECK_RET( GetOwner(), _T("wxTimer::Notify() should be overridden.") );
+ wxCHECK_RET( GetOwner(), wxT("wxTimer::Notify() should be overridden.") );
m_impl->SendEvent();
}
bool wxTimer::IsRunning() const
{
- wxCHECK_MSG( m_impl, false, _T("uninitialized timer") );
+ wxCHECK_MSG( m_impl, false, wxT("uninitialized timer") );
return m_impl->IsRunning();
}
int wxTimer::GetId() const
{
- wxCHECK_MSG( m_impl, wxID_ANY, _T("uninitialized timer") );
+ wxCHECK_MSG( m_impl, wxID_ANY, wxT("uninitialized timer") );
return m_impl->GetId();
}
int wxTimer::GetInterval() const
{
- wxCHECK_MSG( m_impl, -1, _T("uninitialized timer") );
+ wxCHECK_MSG( m_impl, -1, wxT("uninitialized timer") );
return m_impl->GetInterval();
}
bool wxTimer::IsOneShot() const
{
- wxCHECK_MSG( m_impl, false, _T("uninitialized timer") );
+ wxCHECK_MSG( m_impl, false, wxT("uninitialized timer") );
return m_impl->IsOneShot();
}
// let the caller know about it
#if wxUSE_THREADS
wxASSERT_MSG( wxThread::IsMain(),
- _T("timer can only be started from the main thread") );
+ wxT("timer can only be started from the main thread") );
#endif // wxUSE_THREADS
if ( IsRunning() )
const wxString::const_iterator& from,
const wxString::const_iterator& end)
{
- wxASSERT_MSG( from <= end, _T("invalid index") );
+ wxASSERT_MSG( from <= end, wxT("invalid index") );
for ( wxString::const_iterator i = from; i != end; ++i )
{
const wxString::const_iterator& from,
const wxString::const_iterator& end)
{
- wxASSERT_MSG( from <= end, _T("invalid index") );
+ wxASSERT_MSG( from <= end, wxT("invalid index") );
for ( wxString::const_iterator i = from; i != end; ++i )
{
void wxStringTokenizer::Reinit(const wxString& str)
{
- wxASSERT_MSG( IsOk(), _T("you should call SetString() first") );
+ wxASSERT_MSG( IsOk(), wxT("you should call SetString() first") );
m_string = str;
m_stringEnd = m_string.end();
m_pos = m_string.begin();
- m_lastDelim = _T('\0');
+ m_lastDelim = wxT('\0');
m_hasMoreTokens = MoreTokens_Unknown;
}
bool wxStringTokenizer::DoHasMoreTokens() const
{
- wxCHECK_MSG( IsOk(), false, _T("you should call SetString() first") );
+ wxCHECK_MSG( IsOk(), false, wxT("you should call SetString() first") );
if ( find_first_not_of(m_delims, m_delimsLen, m_pos, m_stringEnd)
!= m_stringEnd )
// up to the end of the string in GetNextToken(), but if it is not
// NUL yet we still have this last token to return even if m_pos is
// already at m_string.length()
- return m_pos < m_stringEnd || m_lastDelim != _T('\0');
+ return m_pos < m_stringEnd || m_lastDelim != wxT('\0');
case wxTOKEN_INVALID:
case wxTOKEN_DEFAULT:
- wxFAIL_MSG( _T("unexpected tokenizer mode") );
+ wxFAIL_MSG( wxT("unexpected tokenizer mode") );
// fall through
case wxTOKEN_STRTOK:
// count the number of (remaining) tokens in the string
size_t wxStringTokenizer::CountTokens() const
{
- wxCHECK_MSG( IsOk(), 0, _T("you should call SetString() first") );
+ wxCHECK_MSG( IsOk(), 0, wxT("you should call SetString() first") );
// VZ: this function is IMHO not very useful, so it's probably not very
// important if its implementation here is not as efficient as it
m_pos = m_stringEnd;
// it wasn't terminated
- m_lastDelim = _T('\0');
+ m_lastDelim = wxT('\0');
}
else // we found a delimiter at pos
{
// skip the token and the trailing delimiter
m_pos = pos + 1;
- m_lastDelim = (pos == m_stringEnd) ? _T('\0') : (wxChar)*pos;
+ m_lastDelim = (pos == m_stringEnd) ? wxT('\0') : (wxChar)*pos;
}
}
while ( !AllowEmpty() && token.empty() );
wxUint32 wxTextInputStream::Read32(int base)
{
- wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") );
+ wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") );
if(!m_input) return 0;
wxString word = ReadWord();
wxInt32 wxTextInputStream::Read32S(int base)
{
- wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") );
+ wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") );
if(!m_input) return 0;
wxString word = ReadWord();
switch ( m_mode )
{
case wxEOL_DOS:
- out << _T("\r\n");
+ out << wxT("\r\n");
continue;
case wxEOL_MAC:
- out << _T('\r');
+ out << wxT('\r');
continue;
default:
- wxFAIL_MSG( _T("unknown EOL mode in wxTextOutputStream") );
+ wxFAIL_MSG( wxT("unknown EOL mode in wxTextOutputStream") );
// fall through
case wxEOL_UNIX:
if ( iterNum == STATIC_SIZE )
{
- wxLogTrace( _T("utf8"), _T("unexpectedly many iterators") );
+ wxLogTrace( wxT("utf8"), wxT("unexpectedly many iterators") );
size_t total = iterNum + 1;
for ( wxStringIteratorNode *it2 = it; it2; it2 = it2->m_next )
{
// we must be cleaned up before wxSocketModule as otherwise deleting
// ms_proxyDefault from our OnExit() won't work (and can actually crash)
- AddDependency(wxClassInfo::FindClass(_T("wxSocketModule")));
+ AddDependency(wxClassInfo::FindClass(wxT("wxSocketModule")));
}
bool wxURLModule::OnInit()
// down the program startup (especially if there is no DNS server
// available, in which case it may take up to 1 minute)
- if ( wxGetenv(_T("HTTP_PROXY")) )
+ if ( wxGetenv(wxT("HTTP_PROXY")) )
{
wxURL::ms_useDefaultProxy = true;
}
{
if ( errno != ERANGE )
{
- wxLogSysError(_T("Failed to get current directory"));
+ wxLogSysError(wxT("Failed to get current directory"));
return wxEmptyString;
}
#if wxUSE_STREAMS
static bool ReadAll(wxInputStream *is, wxArrayString& output)
{
- wxCHECK_MSG( is, false, _T("NULL stream in wxExecute()?") );
+ wxCHECK_MSG( is, false, wxT("NULL stream in wxExecute()?") );
// the stream could be already at EOF or in wxSTREAM_BROKEN_PIPE state
is->Reset();
wxString cmd;
#if wxUSE_MIMETYPE
- wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("html"));
+ wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(wxT("html"));
if ( ft )
{
wxString mt;
{
// fallback to checking for the BROWSER environment variable
if ( !wxGetEnv(wxT("BROWSER"), &cmd) || cmd.empty() )
- cmd << _T(' ') << url;
+ cmd << wxT(' ') << url;
}
ok = ( !cmd.empty() && wxExecute(cmd) );
wxString wxStripMenuCodes(const wxString& in, int flags)
{
- wxASSERT_MSG( flags, _T("this is useless to call without any flags") );
+ wxASSERT_MSG( flags, wxT("this is useless to call without any flags") );
wxString out;
for ( size_t n = 0; n < len; n++ )
{
wxChar ch = in[n];
- if ( (flags & wxStrip_Mnemonics) && ch == _T('&') )
+ if ( (flags & wxStrip_Mnemonics) && ch == wxT('&') )
{
// skip it, it is used to introduce the accel char (or to quote
// itself in which case it should still be skipped): note that it
// can't be the last character of the string
if ( ++n == len )
{
- wxLogDebug(_T("Invalid menu string '%s'"), in.c_str());
+ wxLogDebug(wxT("Invalid menu string '%s'"), in.c_str());
}
else
{
ch = in[n];
}
}
- else if ( (flags & wxStrip_Accel) && ch == _T('\t') )
+ else if ( (flags & wxStrip_Accel) && ch == wxT('\t') )
{
// everything after TAB is accel string, exit the loop
break;
return wxCANCEL;
}
- wxFAIL_MSG( _T("unexpected return code from wxMessageDialog") );
+ wxFAIL_MSG( wxT("unexpected return code from wxMessageDialog") );
return wxCANCEL;
}
{
// don't translate these strings, they're for diagnostics purposes only
wxString msg;
- msg.Printf(_T("wxWidgets Library (%s port)\n")
- _T("Version %d.%d.%d%s%s, compiled at %s %s\n")
- _T("Runtime version of toolkit used is %d.%d.%s\n")
- _T("Copyright (c) 1995-2009 wxWidgets team"),
+ msg.Printf(wxT("wxWidgets Library (%s port)\n")
+ wxT("Version %d.%d.%d%s%s, compiled at %s %s\n")
+ wxT("Runtime version of toolkit used is %d.%d.%s\n")
+ wxT("Copyright (c) 1995-2009 wxWidgets team"),
wxPlatformInfo::Get().GetPortIdName().c_str(),
wxMAJOR_VERSION,
wxMINOR_VERSION,
wxEmptyString,
#endif
#ifdef __WXDEBUG__
- _T(" Debug build"),
+ wxT(" Debug build"),
#else
wxEmptyString,
#endif
wxEmptyString
#endif
);
- wxMessageBox(msg, _T("wxWidgets information"),
+ wxMessageBox(msg, wxT("wxWidgets information"),
wxICON_INFORMATION | wxOK,
parent);
}
#endif
wxFAIL_MSG(
- _T("wxTextValidator can only be used with wxTextCtrl or wxComboBox")
+ wxT("wxTextValidator can only be used with wxTextCtrl or wxComboBox")
);
return NULL;
for ( size_t n = 0; n < count; n++ )
{
if ( n )
- str += _T(';');
+ str += wxT(';');
str += m_value[n];
}
bool wxVariantDataArrayString::Read(wxString& str)
{
- wxStringTokenizer tk(str, _T(";"));
+ wxStringTokenizer tk(str, wxT(";"));
while ( tk.HasMoreTokens() )
{
m_value.Add(tk.GetNextToken());
bool wxVariant::operator==(const wxArrayString& WXUNUSED(value)) const
{
- wxFAIL_MSG( _T("TODO") );
+ wxFAIL_MSG( wxT("TODO") );
return false;
}
// reserved for wxWidgets own usage)
wxASSERT_MSG( id == wxID_ANY || (id >= 0 && id < 32767) ||
(id >= wxID_AUTO_LOWEST && id <= wxID_AUTO_HIGHEST),
- _T("invalid id value") );
+ wxT("invalid id value") );
// generate a new id if the user doesn't care about it
if ( id == wxID_ANY )
bool wxWindowBase::ToggleWindowStyle(int flag)
{
- wxASSERT_MSG( flag, _T("flags with 0 value can't be toggled") );
+ wxASSERT_MSG( flag, wxT("flags with 0 value can't be toggled") );
bool rc;
long style = GetWindowStyleFlag();
void wxWindowBase::DoCentre(int dir)
{
wxCHECK_RET( !(dir & wxCENTRE_ON_SCREEN) && GetParent(),
- _T("this method only implements centering child windows") );
+ wxT("this method only implements centering child windows") );
SetSize(GetRect().CentreIn(GetParent()->GetClientSize(), dir));
}
break;
default:
- wxFAIL_MSG( _T("unexpected wxGetMetricOrDefault() argument") );
+ wxFAIL_MSG( wxT("unexpected wxGetMetricOrDefault() argument") );
rc = 0;
}
}
break;
default:
- wxFAIL_MSG(_T("Unknown border style."));
+ wxFAIL_MSG(wxT("Unknown border style."));
break;
}
break;
default:
- wxFAIL_MSG(_T("unexpected window variant"));
+ wxFAIL_MSG(wxT("unexpected window variant"));
break;
}
{
wxCHECK_RET( (minW == wxDefaultCoord || maxW == wxDefaultCoord || minW <= maxW) &&
(minH == wxDefaultCoord || maxH == wxDefaultCoord || minH <= maxH),
- _T("min width/height must be less than max width/height!") );
+ wxT("min width/height must be less than max width/height!") );
m_minWidth = minW;
m_maxWidth = maxW;
// this should never happen and it will lead to a crash later if it does
// because RemoveChild() will remove only one node from the children list
// and the other(s) one(s) will be left with dangling pointers in them
- wxASSERT_MSG( !GetChildren().Find((wxWindow*)child), _T("AddChild() called twice") );
+ wxASSERT_MSG( !GetChildren().Find((wxWindow*)child), wxT("AddChild() called twice") );
GetChildren().Append((wxWindow*)child);
child->SetParent(this);
handlerCur = handlerNext;
}
- wxFAIL_MSG( _T("where has the event handler gone?") );
+ wxFAIL_MSG( wxT("where has the event handler gone?") );
return false;
}
{
if ( !m_backgroundColour.IsOk() )
{
- wxASSERT_MSG( !m_hasBgCol, _T("we have invalid explicit bg colour?") );
+ wxASSERT_MSG( !m_hasBgCol, wxT("we have invalid explicit bg colour?") );
// get our default background colour
wxColour colBg = GetDefaultAttributes().colBg;
// logic is the same as in GetBackgroundColour()
if ( !m_font.IsOk() )
{
- wxASSERT_MSG( !m_hasFont, _T("we have invalid explicit font?") );
+ wxASSERT_MSG( !m_hasFont, wxT("we have invalid explicit font?") );
wxFont font = GetDefaultAttributes().font;
if ( !font.IsOk() )
// associated wxSizerItem we're going to dereference a dangling
// pointer; so try to detect this as early as possible
wxASSERT_MSG( !sizer || m_containingSizer != sizer,
- _T("Adding a window to the same sizer twice?") );
+ wxT("Adding a window to the same sizer twice?") );
m_containingSizer = sizer;
}
void wxWindowBase::CaptureMouse()
{
- wxLogTrace(_T("mousecapture"), _T("CaptureMouse(%p)"), static_cast<void*>(this));
+ wxLogTrace(wxT("mousecapture"), wxT("CaptureMouse(%p)"), static_cast<void*>(this));
- wxASSERT_MSG( !ms_winCaptureChanging, _T("recursive CaptureMouse call?") );
+ wxASSERT_MSG( !ms_winCaptureChanging, wxT("recursive CaptureMouse call?") );
ms_winCaptureChanging = true;
void wxWindowBase::ReleaseMouse()
{
- wxLogTrace(_T("mousecapture"), _T("ReleaseMouse(%p)"), static_cast<void*>(this));
+ wxLogTrace(wxT("mousecapture"), wxT("ReleaseMouse(%p)"), static_cast<void*>(this));
- wxASSERT_MSG( !ms_winCaptureChanging, _T("recursive ReleaseMouse call?") );
+ wxASSERT_MSG( !ms_winCaptureChanging, wxT("recursive ReleaseMouse call?") );
wxASSERT_MSG( GetCapture() == this,
"attempt to release mouse, but this window hasn't captured it" );
ms_winCaptureChanging = false;
- wxLogTrace(_T("mousecapture"),
- (const wxChar *) _T("After ReleaseMouse() mouse is captured by %p"),
+ wxLogTrace(wxT("mousecapture"),
+ (const wxChar *) wxT("After ReleaseMouse() mouse is captured by %p"),
static_cast<void*>(GetCapture()));
}
// correctly if it loses capture unexpectedly; see the discussion here:
// http://sourceforge.net/tracker/index.php?func=detail&aid=1153662&group_id=9863&atid=109863
// http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/82376
- wxFAIL_MSG( _T("window that captured the mouse didn't process wxEVT_MOUSE_CAPTURE_LOST") );
+ wxFAIL_MSG( wxT("window that captured the mouse didn't process wxEVT_MOUSE_CAPTURE_LOST") );
}
}
wxWindow *wxWindowBase::DoGetSibling(WindowOrder order) const
{
wxCHECK_MSG( GetParent(), NULL,
- _T("GetPrev/NextSibling() don't work for TLWs!") );
+ wxT("GetPrev/NextSibling() don't work for TLWs!") );
wxWindowList& siblings = GetParent()->GetChildren();
wxWindowList::compatibility_iterator i = siblings.Find((wxWindow *)this);
- wxCHECK_MSG( i, NULL, _T("window not a child of its parent?") );
+ wxCHECK_MSG( i, NULL, wxT("window not a child of its parent?") );
if ( order == OrderBefore )
i = i->GetPrevious();
{
// check that we're not a top level window
wxCHECK_RET( GetParent(),
- _T("MoveBefore/AfterInTabOrder() don't work for TLWs!") );
+ wxT("MoveBefore/AfterInTabOrder() don't work for TLWs!") );
// detect the special case when we have nothing to do anyhow and when the
// code below wouldn't work
// find the target window in the siblings list
wxWindowList& siblings = GetParent()->GetChildren();
wxWindowList::compatibility_iterator i = siblings.Find(win);
- wxCHECK_RET( i, _T("MoveBefore/AfterInTabOrder(): win is not a sibling") );
+ wxCHECK_RET( i, wxT("MoveBefore/AfterInTabOrder(): win is not a sibling") );
// unfortunately, when wxUSE_STL == 1 DetachNode() is not implemented so we
// can't just move the node around
// Not needed, included in defs.h
// #include "wx/windowid.h"
-#define wxTRACE_WINDOWID _T("windowid")
+#define wxTRACE_WINDOWID wxT("windowid")
namespace
{
// TODO: implement the scanf() functions
static int vwscanf(const wchar_t *format, va_list argptr)
{
- wxFAIL_MSG( _T("TODO") );
+ wxFAIL_MSG( wxT("TODO") );
return -1;
}
static int vfwscanf(FILE *stream, const wchar_t *format, va_list argptr)
{
- wxFAIL_MSG( _T("TODO") );
+ wxFAIL_MSG( wxT("TODO") );
return -1;
}
// of the function. This doesn't work with %c and %s because of difference
// in size of char and wchar_t, though.
- wxCHECK_MSG( wxStrstr(format, _T("%s")) == NULL, -1,
- _T("incomplete vswscanf implementation doesn't allow %s") );
- wxCHECK_MSG( wxStrstr(format, _T("%c")) == NULL, -1,
- _T("incomplete vswscanf implementation doesn't allow %c") );
+ wxCHECK_MSG( wxStrstr(format, wxT("%s")) == NULL, -1,
+ wxT("incomplete vswscanf implementation doesn't allow %s") );
+ wxCHECK_MSG( wxStrstr(format, wxT("%c")) == NULL, -1,
+ wxT("incomplete vswscanf implementation doesn't allow %c") );
return vsscanf(static_cast<const char*>(wxConvLibc.cWX2MB(ws)),
wxConvLibc.cWX2MB(format), argptr);
I don't see it being used in the wxWidgets sources at present (oct 2007) CE
*/
#pragma message ( "warning ::::: wxVsprintf(wchar_t *str, const wxString& format, va_list argptr) not yet implemented" )
- wxFAIL_MSG( _T("TODO") );
+ wxFAIL_MSG( wxT("TODO") );
return -1;
#else
#if wxUSE_UTF8_LOCALE_ONLY
if ( !wxIsLocaleUtf8() )
{
- wxLogFatalError(_T("This program requires UTF-8 locale to run."));
+ wxLogFatalError(wxT("This program requires UTF-8 locale to run."));
}
#else // !wxUSE_UTF8_LOCALE_ONLY
wxLocaleIsUtf8 = wxIsLocaleUtf8();
template<> void wxStringReadValue(const wxString &s , bool &data )
{
int intdata ;
- wxSscanf(s, _T("%d"), &intdata ) ;
+ wxSscanf(s, wxT("%d"), &intdata ) ;
data = (bool)intdata ;
}
template<> void wxStringWriteValue(wxString &s , const bool &data )
{
- s = wxString::Format(_T("%d"), data ) ;
+ s = wxString::Format(wxT("%d"), data ) ;
}
// char
template<> void wxStringReadValue(const wxString &s , char &data )
{
int intdata ;
- wxSscanf(s, _T("%d"), &intdata ) ;
+ wxSscanf(s, wxT("%d"), &intdata ) ;
data = char(intdata) ;
}
template<> void wxStringWriteValue(wxString &s , const char &data )
{
- s = wxString::Format(_T("%d"), data ) ;
+ s = wxString::Format(wxT("%d"), data ) ;
}
// unsigned char
template<> void wxStringReadValue(const wxString &s , unsigned char &data )
{
int intdata ;
- wxSscanf(s, _T("%d"), &intdata ) ;
+ wxSscanf(s, wxT("%d"), &intdata ) ;
data = (unsigned char)(intdata) ;
}
template<> void wxStringWriteValue(wxString &s , const unsigned char &data )
{
- s = wxString::Format(_T("%d"), data ) ;
+ s = wxString::Format(wxT("%d"), data ) ;
}
// int
template<> void wxStringReadValue(const wxString &s , int &data )
{
- wxSscanf(s, _T("%d"), &data ) ;
+ wxSscanf(s, wxT("%d"), &data ) ;
}
template<> void wxStringWriteValue(wxString &s , const int &data )
{
- s = wxString::Format(_T("%d"), data ) ;
+ s = wxString::Format(wxT("%d"), data ) ;
}
// unsigned int
template<> void wxStringReadValue(const wxString &s , unsigned int &data )
{
- wxSscanf(s, _T("%d"), &data ) ;
+ wxSscanf(s, wxT("%d"), &data ) ;
}
template<> void wxStringWriteValue(wxString &s , const unsigned int &data )
{
- s = wxString::Format(_T("%d"), data ) ;
+ s = wxString::Format(wxT("%d"), data ) ;
}
// long
template<> void wxStringReadValue(const wxString &s , long &data )
{
- wxSscanf(s, _T("%ld"), &data ) ;
+ wxSscanf(s, wxT("%ld"), &data ) ;
}
template<> void wxStringWriteValue(wxString &s , const long &data )
{
- s = wxString::Format(_T("%ld"), data ) ;
+ s = wxString::Format(wxT("%ld"), data ) ;
}
// unsigned long
template<> void wxStringReadValue(const wxString &s , unsigned long &data )
{
- wxSscanf(s, _T("%ld"), &data ) ;
+ wxSscanf(s, wxT("%ld"), &data ) ;
}
template<> void wxStringWriteValue(wxString &s , const unsigned long &data )
{
- s = wxString::Format(_T("%ld"), data ) ;
+ s = wxString::Format(wxT("%ld"), data ) ;
}
// float
template<> void wxStringReadValue(const wxString &s , float &data )
{
- wxSscanf(s, _T("%f"), &data ) ;
+ wxSscanf(s, wxT("%f"), &data ) ;
}
template<> void wxStringWriteValue(wxString &s , const float &data )
{
- s = wxString::Format(_T("%f"), data ) ;
+ s = wxString::Format(wxT("%f"), data ) ;
}
// double
template<> void wxStringReadValue(const wxString &s , double &data )
{
- wxSscanf(s, _T("%lf"), &data ) ;
+ wxSscanf(s, wxT("%lf"), &data ) ;
}
template<> void wxStringWriteValue(wxString &s , const double &data )
{
- s = wxString::Format(_T("%lf"), data ) ;
+ s = wxString::Format(wxT("%lf"), data ) ;
}
// wxString
const wxChar * const *
wxZipClassFactory::GetProtocols(wxStreamProtocolType type) const
{
- static const wxChar *protocols[] = { _T("zip"), NULL };
- static const wxChar *mimetypes[] = { _T("application/zip"), NULL };
- static const wxChar *fileexts[] = { _T(".zip"), _T(".htb"), NULL };
+ static const wxChar *protocols[] = { wxT("zip"), NULL };
+ static const wxChar *mimetypes[] = { wxT("application/zip"), NULL };
+ static const wxChar *fileexts[] = { wxT(".zip"), wxT(".htb"), NULL };
static const wxChar *empty[] = { NULL };
switch (type) {
m_pos(0),
m_ok(false)
{
- wxCHECK_RET(size <= sizeof(m_data), _T("buffer too small"));
+ wxCHECK_RET(size <= sizeof(m_data), wxT("buffer too small"));
m_size = stream.Read(m_data, size).LastRead();
m_ok = m_size == size;
}
switch (wxFileName::GetFormat(format)) {
case wxPATH_DOS:
{
- wxString name(isDir ? m_Name + _T("\\") : m_Name);
+ wxString name(isDir ? m_Name + wxT("\\") : m_Name);
for (size_t i = 0; i < name.length(); i++)
- if (name[i] == _T('/'))
- name[i] = _T('\\');
+ if (name[i] == wxT('/'))
+ name[i] = wxT('\\');
return name;
}
case wxPATH_UNIX:
- return isDir ? m_Name + _T("/") : m_Name;
+ return isDir ? m_Name + wxT("/") : m_Name;
default:
;
while (!internal.empty() && *internal.begin() == '/')
internal.erase(0, 1);
- while (!internal.empty() && internal.compare(0, 2, _T("./")) == 0)
+ while (!internal.empty() && internal.compare(0, 2, wxT("./")) == 0)
internal.erase(0, 2);
- if (internal == _T(".") || internal == _T(".."))
+ if (internal == wxT(".") || internal == wxT(".."))
internal = wxEmptyString;
return internal;
const wxChar * const *
wxZlibClassFactory::GetProtocols(wxStreamProtocolType type) const
{
- static const wxChar *mimes[] = { _T("application/x-deflate"), NULL };
- static const wxChar *encs[] = { _T("deflate"), NULL };
+ static const wxChar *mimes[] = { wxT("application/x-deflate"), NULL };
+ static const wxChar *encs[] = { wxT("deflate"), NULL };
static const wxChar *empty[] = { NULL };
switch (type) {
wxGzipClassFactory::GetProtocols(wxStreamProtocolType type) const
{
static const wxChar *protos[] =
- { _T("gzip"), NULL };
+ { wxT("gzip"), NULL };
static const wxChar *mimes[] =
- { _T("application/gzip"), _T("application/x-gzip"), NULL };
+ { wxT("application/gzip"), wxT("application/x-gzip"), NULL };
static const wxChar *encs[] =
- { _T("gzip"), NULL };
+ { wxT("gzip"), NULL };
static const wxChar *exts[] =
- { _T(".gz"), _T(".gzip"), NULL };
+ { wxT(".gz"), wxT(".gzip"), NULL };
static const wxChar *empty[] =
{ NULL };
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->m_style;
}
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_colour;
}
{
wxString path;
if ( !wxGetEnv("WXDFB_FONTPATH", &path) )
- path = _T(wxINSTALL_PREFIX "/share/wx/fonts");
+ path = wxT(wxINSTALL_PREFIX "/share/wx/fonts");
wxStringTokenizer tkn(path, wxPATH_SEP);
while ( tkn.HasMoreTokens() )
#define KEY(dfb, wx) \
case dfb: \
wxLogTrace(TRACE_EVENTS, \
- _T("key " #dfb " mapped to " #wx)); \
+ wxT("key " #dfb " mapped to " #wx)); \
return wx
// returns translated keycode, i.e. the one for KEYUP/KEYDOWN where 'a'..'z' is
// these are programming errors, assert:
#define DFB_ASSERT(code) \
case code: \
- wxFAIL_MSG( "DirectFB error: " _T(#code) ); \
+ wxFAIL_MSG( "DirectFB error: " wxT(#code) ); \
return false \
DFB_ASSERT(DFB_DEAD);
return 0;
}
if (sizeHi) {
- _ftprintf(stderr, _T("%s: bigger than 2Gb\n"), name);
+ _ftprintf(stderr, wxT("%s: bigger than 2Gb\n"), name);
return 0;
}
/* CreateFileMapping barfs on zero length files */
(LPTSTR) &buf,
0,
NULL)) {
- _ftprintf(stderr, _T("%s: %s"), s, buf);
+ _ftprintf(stderr, wxT("%s: %s"), s, buf);
fflush(stderr);
LocalFree(buf);
}
else
- _ftprintf(stderr, _T("%s: unknown Windows error\n"), s);
+ _ftprintf(stderr, wxT("%s: unknown Windows error\n"), s);
}
int code = XML_GetErrorCode(parser);
const XML_Char *message = XML_ErrorString(code);
if (message)
- _ftprintf(stderr, _T("%s:%d:%ld: %s\n"),
+ _ftprintf(stderr, wxT("%s:%d:%ld: %s\n"),
XML_GetBase(parser),
XML_GetErrorLineNumber(parser),
XML_GetErrorColumnNumber(parser),
message);
else
- _ftprintf(stderr, _T("%s: (unknown message %d)\n"),
+ _ftprintf(stderr, wxT("%s: (unknown message %d)\n"),
XML_GetBase(parser), code);
}
nToRead = READ_MAX;
void *buf = XML_GetBuffer(parser_, nToRead);
if (!buf) {
- _ftprintf(stderr, _T("out of memory\n"));
+ _ftprintf(stderr, wxT("out of memory\n"));
return E_ABORT;
}
DWORD nRead;
0,
NULL)) {
/* The system error messages seem to end with a newline. */
- _ftprintf(stderr, _T("%s: %s"), url, buf);
+ _ftprintf(stderr, wxT("%s: %s"), url, buf);
fflush(stderr);
LocalFree(buf);
}
else
- _ftprintf(stderr, _T("%s: error %x\n"), url, hr);
+ _ftprintf(stderr, wxT("%s: error %x\n"), url, hr);
}
static void
s.reserve(20*count);
for ( size_t n = 0; n < count; n++ )
{
- s << a[n] << (n == count - 1 ? _T("\n") : _T(", "));
+ s << a[n] << (n == count - 1 ? wxT("\n") : wxT(", "));
}
return s;
{
wxString s = GetDescription();
if ( !s.empty() )
- s << _T('\n');
+ s << wxT('\n');
if ( HasDevelopers() )
- s << _T('\n') << _("Developed by ") << AllAsString(GetDevelopers());
+ s << wxT('\n') << _("Developed by ") << AllAsString(GetDevelopers());
if ( HasDocWriters() )
- s << _T('\n') << _("Documentation by ") << AllAsString(GetDocWriters());
+ s << wxT('\n') << _("Documentation by ") << AllAsString(GetDocWriters());
if ( HasArtists() )
- s << _T('\n') << _("Graphics art by ") << AllAsString(GetArtists());
+ s << wxT('\n') << _("Graphics art by ") << AllAsString(GetArtists());
if ( HasTranslators() )
- s << _T('\n') << _("Translations by ") << AllAsString(GetTranslators());
+ s << wxT('\n') << _("Translations by ") << AllAsString(GetTranslators());
return s;
}
m_sizerText = new wxBoxSizer(wxVERTICAL);
wxString nameAndVersion = info.GetName();
if ( info.HasVersion() )
- nameAndVersion << _T(' ') << info.GetVersion();
+ nameAndVersion << wxT(' ') << info.GetVersion();
wxStaticText *label = new wxStaticText(this, wxID_ANY, nameAndVersion);
wxFont fontBig(*wxNORMAL_FONT);
fontBig.SetPointSize(fontBig.GetPointSize() + 2);
void wxGenericAboutDialog::AddControl(wxWindow *win, const wxSizerFlags& flags)
{
- wxCHECK_RET( m_sizerText, _T("can only be called after Create()") );
- wxASSERT_MSG( win, _T("can't add NULL window to about dialog") );
+ wxCHECK_RET( m_sizerText, wxT("can only be called after Create()") );
+ wxASSERT_MSG( win, wxT("can't add NULL window to about dialog") );
m_sizerText->Add(win, flags);
}
node = node->GetNext();
}
- wxFAIL_MSG(_T("deleting inexistent accel from wxAcceleratorTable"));
+ wxFAIL_MSG(wxT("deleting inexistent accel from wxAcceleratorTable"));
}
// ----------------------------------------------------------------------------
// a good reason to add and remove duplicate handlers (and they
// may) we should probably refcount the duplicates.
- wxLogDebug( _T("Adding duplicate animation handler for '%d' type"),
+ wxLogDebug( wxT("Adding duplicate animation handler for '%d' type"),
handler->GetType() );
delete handler;
}
else
{
// see AddHandler for additional comments.
- wxLogDebug( _T("Inserting duplicate animation handler for '%d' type"),
+ wxLogDebug( wxT("Inserting duplicate animation handler for '%d' type"),
handler->GetType() );
delete handler;
}
wxCoord *start,
wxCoord *end) const
{
- wxCHECK_RET( start && end, _T("NULL pointer in GetRectLimits") );
+ wxCHECK_RET( start && end, wxT("NULL pointer in GetRectLimits") );
if ( IsVertical() )
{
{
wxToolBarToolBase *tool = FindById(id);
- wxCHECK_RET( tool, _T("SetToolShortHelp: no such tool") );
+ wxCHECK_RET( tool, wxT("SetToolShortHelp: no such tool") );
// TODO: set tooltip/short help
tool->SetShortHelp(help);
wxRect rect;
- wxCHECK_MSG( tool, rect, _T("GetToolRect: NULL tool") );
+ wxCHECK_MSG( tool, rect, wxT("GetToolRect: NULL tool") );
// ensure that we always have the valid tool position
if ( m_needsLayout )
if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) )
{
CreateYearSpinCtrl();
- m_staticYear = new wxStaticText(GetParent(), wxID_ANY, m_date.Format(_T("%Y")),
+ m_staticYear = new wxStaticText(GetParent(), wxID_ANY, m_date.Format(wxT("%Y")),
wxDefaultPosition, wxDefaultSize,
wxALIGN_CENTRE);
CreateMonthComboBox();
- m_staticMonth = new wxStaticText(GetParent(), wxID_ANY, m_date.Format(_T("%B")),
+ m_staticMonth = new wxStaticText(GetParent(), wxID_ANY, m_date.Format(wxT("%B")),
wxDefaultPosition, wxDefaultSize,
wxALIGN_CENTRE);
}
// created/shown/hidden accordingly
wxASSERT_MSG( (style & wxCAL_SEQUENTIAL_MONTH_SELECTION) ==
(m_windowStyle & wxCAL_SEQUENTIAL_MONTH_SELECTION),
- _T("wxCAL_SEQUENTIAL_MONTH_SELECTION can't be changed after creation") );
+ wxT("wxCAL_SEQUENTIAL_MONTH_SELECTION can't be changed after creation") );
wxControl::SetWindowStyleFlag(style);
}
void wxGenericCalendarCtrl::CreateYearSpinCtrl()
{
m_spinYear = new wxSpinCtrl(GetParent(), wxID_ANY,
- GetDate().Format(_T("%Y")),
+ GetDate().Format(wxT("%Y")),
wxDefaultPosition,
wxDefaultSize,
wxSP_ARROW_KEYS | wxCLIP_SIBLINGS,
if ( AllowYearChange() )
{
if ( !m_userChangedYear )
- m_spinYear->SetValue(m_date.Format(_T("%Y")));
+ m_spinYear->SetValue(m_date.Format(wxT("%Y")));
}
}
{
// don't use wxDate::Format() which prepends 0s
unsigned int day = date.GetDay();
- wxString dayStr = wxString::Format(_T("%u"), day);
+ wxString dayStr = wxString::Format(wxT("%u"), day);
wxCoord width;
dc.GetTextExtent(dayStr, &width, NULL);
break;
default:
- wxFAIL_MSG(_T("unknown border type"));
+ wxFAIL_MSG(wxT("unknown border type"));
}
}
break;
default:
- wxFAIL_MSG(_T("unknown hittest code"));
+ wxFAIL_MSG(wxT("unknown hittest code"));
// fall through
case wxCAL_HITTEST_NOWHERE:
wxDateTime target;
switch ( event.GetKeyCode() )
{
- case _T('+'):
+ case wxT('+'):
case WXK_ADD:
target = m_date + wxDateSpan::Year();
if ( ChangeYear(&target) )
}
break;
- case _T('-'):
+ case wxT('-'):
case WXK_SUBTRACT:
target = m_date - wxDateSpan::Year();
if ( ChangeYear(&target) )
void wxGenericCalendarCtrl::SetHoliday(size_t day)
{
- wxCHECK_RET( day > 0 && day < 32, _T("invalid day in SetHoliday") );
+ wxCHECK_RET( day > 0 && day < 32, wxT("invalid day in SetHoliday") );
wxCalendarDateAttr *attr = GetAttr(day);
if ( !attr )
void wxGenericCalendarCtrl::Mark(size_t day, bool mark)
{
- wxCHECK_RET( day > 0 && day < 32, _T("invalid day in Mark") );
+ wxCHECK_RET( day > 0 && day < 32, wxT("invalid day in Mark") );
const wxCalendarDateAttr& m = wxCalendarDateAttr::GetMark();
if (mark) {
int wxChoicebook::GetPageImage(size_t WXUNUSED(n)) const
{
- wxFAIL_MSG( _T("wxChoicebook::GetPageImage() not implemented") );
+ wxFAIL_MSG( wxT("wxChoicebook::GetPageImage() not implemented") );
return wxNOT_FOUND;
}
bool wxChoicebook::SetPageImage(size_t WXUNUSED(n), int WXUNUSED(imageId))
{
- wxFAIL_MSG( _T("wxChoicebook::SetPageImage() not implemented") );
+ wxFAIL_MSG( wxT("wxChoicebook::SetPageImage() not implemented") );
return false;
}
void wxDataViewMainWindow::OnArrowChar(unsigned int newCurrent, const wxKeyEvent& event)
{
wxCHECK_RET( newCurrent < GetRowCount(),
- _T("invalid item index in OnArrowChar()") );
+ wxT("invalid item index in OnArrowChar()") );
// if there is no selection, we cannot move it anywhere
if (!HasCurrentRow())
// don't use m_linesPerPage directly as it might not be computed yet
const int pageSize = GetCountPerPage();
- wxCHECK_RET( pageSize, _T("should have non zero page size") );
+ wxCHECK_RET( pageSize, wxT("should have non zero page size") );
switch ( event.GetKeyCode() )
{
else // !ctrl, !shift
{
// test in the enclosing if should make it impossible
- wxFAIL_MSG( _T("how did we get here?") );
+ wxFAIL_MSG( wxT("how did we get here?") );
}
}
else // invalid date
{
wxASSERT_MSG( HasDPFlag(wxDP_ALLOWNONE),
- _T("this control must have a valid date") );
+ wxT("this control must have a valid date") );
m_combo->SetText(wxEmptyString);
}
if ( m_combo )
{
wxArrayString allowedChars;
- for ( wxChar c = _T('0'); c <= _T('9'); c++ )
+ for ( wxChar c = wxT('0'); c <= wxT('9'); c++ )
allowedChars.Add(wxString(c, 1));
const wxChar *p2 = m_format.c_str();
const wxString& name)
{
wxASSERT_MSG( !(style & wxDP_SPIN),
- _T("wxDP_SPIN style not supported, use wxDP_DEFAULT") );
+ wxT("wxDP_SPIN style not supported, use wxDP_DEFAULT") );
if ( !wxControl::Create(parent, id, pos, size,
style | wxCLIP_CHILDREN | wxWANTS_CHARS | wxBORDER_NONE,
debugDir = debugDirFilename.GetPath();
#endif
msg << _("A debug report has been generated in the directory\n")
- << _T('\n')
- << _T(" \"") << debugDir << _T("\"\n")
- << _T('\n')
+ << wxT('\n')
+ << wxT(" \"") << debugDir << wxT("\"\n")
+ << wxT('\n')
<< _("The report contains the files listed below. If any of these files contain private information,\nplease uncheck them and they will be removed from the report.\n")
- << _T('\n')
+ << wxT('\n')
<< _("If you wish to suppress this debug report completely, please choose the \"Cancel\" button,\nbut be warned that it may hinder improving the program, so if\nat all possible please do continue with the report generation.\n")
- << _T('\n')
+ << wxT('\n')
<< _(" Thank you and we're sorry for the inconvenience!\n")
- << _T("\n\n"); // just some white space to separate from other stuff
+ << wxT("\n\n"); // just some white space to separate from other stuff
const wxSizerFlags flagsFixed(SizerFlags(0));
const wxSizerFlags flagsExpand(SizerFlags(1));
// ... and the list of files in this debug report with buttons to view them
wxSizer *sizerFileBtns = new wxBoxSizer(wxVERTICAL);
sizerFileBtns->AddStretchSpacer(1);
- sizerFileBtns->Add(new wxButton(this, wxID_VIEW_DETAILS, _T("&View...")),
+ sizerFileBtns->Add(new wxButton(this, wxID_VIEW_DETAILS, wxT("&View...")),
wxSizerFlags().Border(wxBOTTOM));
- sizerFileBtns->Add(new wxButton(this, wxID_OPEN, _T("&Open...")),
+ sizerFileBtns->Add(new wxButton(this, wxID_OPEN, wxT("&Open...")),
wxSizerFlags().Border(wxTOP));
sizerFileBtns->AddStretchSpacer(1);
desc;
if ( m_dbgrpt.GetFile(n, &name, &desc) )
{
- m_checklst->Append(name + _T(" (") + desc + _T(')'));
+ m_checklst->Append(name + wxT(" (") + desc + wxT(')'));
m_checklst->Check(n);
m_files.Add(name);
if ( !notes.empty() )
{
// for now filename fixed, could make it configurable in the future...
- m_dbgrpt.AddText(_T("notes.txt"), notes, _T("user notes"));
+ m_dbgrpt.AddText(wxT("notes.txt"), notes, wxT("user notes"));
}
return true;
void wxDebugReportDialog::OnView(wxCommandEvent& )
{
const int sel = m_checklst->GetSelection();
- wxCHECK_RET( sel != wxNOT_FOUND, _T("invalid selection in OnView()") );
+ wxCHECK_RET( sel != wxNOT_FOUND, wxT("invalid selection in OnView()") );
wxFileName fn(m_dbgrpt.GetDirectory(), m_files[sel]);
wxString str;
void wxDebugReportDialog::OnOpen(wxCommandEvent& )
{
const int sel = m_checklst->GetSelection();
- wxCHECK_RET( sel != wxNOT_FOUND, _T("invalid selection in OnOpen()") );
+ wxCHECK_RET( sel != wxNOT_FOUND, wxT("invalid selection in OnOpen()") );
wxFileName fn(m_dbgrpt.GetDirectory(), m_files[sel]);
if ( !cmd.empty() )
{
#if wxUSE_MIMETYPE
- if ( cmd.find(_T('%')) != wxString::npos )
+ if ( cmd.find(wxT('%')) != wxString::npos )
{
command = wxFileType::ExpandCommand(cmd, fn.GetFullPath());
}
#endif // wxUSE_MIMETYPE
{
// append the file name to the end
- command << cmd << _T(" \"") << fn.GetFullPath() << _T('"');
+ command << cmd << wxT(" \"") << fn.GetFullPath() << wxT('"');
}
}
}
wxART_CMN_DIALOG,
wxSize(16, 16)));
// executable
- if (GetIconID(wxEmptyString, _T("application/x-executable")) == file)
+ if (GetIconID(wxEmptyString, wxT("application/x-executable")) == file)
{
m_smallImageList->Add(wxArtProvider::GetBitmap(wxART_EXECUTABLE_FILE,
wxART_CMN_DIALOG,
wxSize(16, 16)));
- delete m_HashTable->Get(_T("exe"));
- m_HashTable->Delete(_T("exe"));
- m_HashTable->Put(_T("exe"), new wxFileIconEntry(executable));
+ delete m_HashTable->Get(wxT("exe"));
+ m_HashTable->Delete(wxT("exe"));
+ m_HashTable->Put(wxT("exe"), new wxFileIconEntry(executable));
}
/* else put into list by GetIconID
(KDE defines application/x-executable for *.exe and has nice icon)
void CreateColumns()
{
- InsertColumn(0, _T("item"));
+ InsertColumn(0, wxT("item"));
SizeColumns();
}
SetData(data);
wxCHECK_MSG( m_FindReplaceData, false,
- _T("can't create dialog without data") );
+ wxT("can't create dialog without data") );
bool isPda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA);
// __WXWINCE__
#if defined(__UNIX__)
- m_permissions.Printf(_T("%c%c%c%c%c%c%c%c%c"),
- buff.st_mode & wxS_IRUSR ? _T('r') : _T('-'),
- buff.st_mode & wxS_IWUSR ? _T('w') : _T('-'),
- buff.st_mode & wxS_IXUSR ? _T('x') : _T('-'),
- buff.st_mode & wxS_IRGRP ? _T('r') : _T('-'),
- buff.st_mode & wxS_IWGRP ? _T('w') : _T('-'),
- buff.st_mode & wxS_IXGRP ? _T('x') : _T('-'),
- buff.st_mode & wxS_IROTH ? _T('r') : _T('-'),
- buff.st_mode & wxS_IWOTH ? _T('w') : _T('-'),
- buff.st_mode & wxS_IXOTH ? _T('x') : _T('-'));
+ m_permissions.Printf(wxT("%c%c%c%c%c%c%c%c%c"),
+ buff.st_mode & wxS_IRUSR ? wxT('r') : wxT('-'),
+ buff.st_mode & wxS_IWUSR ? wxT('w') : wxT('-'),
+ buff.st_mode & wxS_IXUSR ? wxT('x') : wxT('-'),
+ buff.st_mode & wxS_IRGRP ? wxT('r') : wxT('-'),
+ buff.st_mode & wxS_IWGRP ? wxT('w') : wxT('-'),
+ buff.st_mode & wxS_IXGRP ? wxT('x') : wxT('-'),
+ buff.st_mode & wxS_IROTH ? wxT('r') : wxT('-'),
+ buff.st_mode & wxS_IWOTH ? wxT('w') : wxT('-'),
+ buff.st_mode & wxS_IXOTH ? wxT('x') : wxT('-'));
#elif defined(__WIN32__)
DWORD attribs = ::GetFileAttributes(m_filePath.c_str());
if (attribs != (DWORD)-1)
{
- m_permissions.Printf(_T("%c%c%c%c"),
- attribs & FILE_ATTRIBUTE_ARCHIVE ? _T('A') : _T(' '),
- attribs & FILE_ATTRIBUTE_READONLY ? _T('R') : _T(' '),
- attribs & FILE_ATTRIBUTE_HIDDEN ? _T('H') : _T(' '),
- attribs & FILE_ATTRIBUTE_SYSTEM ? _T('S') : _T(' '));
+ m_permissions.Printf(wxT("%c%c%c%c"),
+ attribs & FILE_ATTRIBUTE_ARCHIVE ? wxT('A') : wxT(' '),
+ attribs & FILE_ATTRIBUTE_READONLY ? wxT('R') : wxT(' '),
+ attribs & FILE_ATTRIBUTE_HIDDEN ? wxT('H') : wxT(' '),
+ attribs & FILE_ATTRIBUTE_SYSTEM ? wxT('S') : wxT(' '));
}
#endif
#endif // defined(__UNIX__) || defined(__WIN32__)
default:
- wxFAIL_MSG( _T("unexpected field in wxFileData::GetEntry()") );
+ wxFAIL_MSG( wxT("unexpected field in wxFileData::GetEntry()") );
}
return s;
if (IsLink())
{
- wxColour dg = wxTheColourDatabase->Find( _T("MEDIUM GREY") );
+ wxColour dg = wxTheColourDatabase->Find( wxT("MEDIUM GREY") );
if ( dg.Ok() )
item.SetTextColour(dg);
}
if ( str.Left( 2 ) == wxT( "*." ) )
{
m_filterExtension = str.Mid( 1 );
- if ( m_filterExtension == _T( ".*" ) )
+ if ( m_filterExtension == wxT( ".*" ) )
m_filterExtension.clear();
}
else
{
parent = GetParentForModalDialog(parent);
- if ( !wxDialog::Create( parent , wxID_ANY , _T("Choose Font") ,
+ if ( !wxDialog::Create( parent , wxID_ANY , wxT("Choose Font") ,
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE,
- _T("fontdialog") ) )
+ wxT("fontdialog") ) )
{
wxFAIL_MSG( wxT("wxFontDialog creation failed") );
return false;
unsigned int i, n;
for ( n = 1; ; n++ )
{
- s += (wxChar) (_T('A') + (wxChar)(col % 26));
+ s += (wxChar) (wxT('A') + (wxChar)(col % 26));
col = col / 26 - 1;
if ( col < 0 )
break;
{
wxCHECK_MSG( (row < GetNumberRows()) && (col < GetNumberCols()),
wxEmptyString,
- _T("invalid row or column index in wxGridStringTable") );
+ wxT("invalid row or column index in wxGridStringTable") );
return m_data[row][col];
}
void wxGridStringTable::SetValue( int row, int col, const wxString& value )
{
wxCHECK_RET( (row < GetNumberRows()) && (col < GetNumberCols()),
- _T("invalid row or column index in wxGridStringTable") );
+ wxT("invalid row or column index in wxGridStringTable") );
m_data[row][col] = value;
}
#ifdef DEBUG_ATTR_CACHE
size_t total = gs_nAttrCacheHits + gs_nAttrCacheMisses;
- wxPrintf(_T("wxGrid attribute cache statistics: "
+ wxPrintf(wxT("wxGrid attribute cache statistics: "
"total: %u, hits: %u (%u%%)\n"),
total, gs_nAttrCacheHits,
total ? (gs_nAttrCacheHits*100) / total : 0);
#if wxUSE_LOG_TRACE
static const wxChar *cursorModes[] =
{
- _T("SELECT_CELL"),
- _T("RESIZE_ROW"),
- _T("RESIZE_COL"),
- _T("SELECT_ROW"),
- _T("SELECT_COL"),
- _T("MOVE_COL"),
+ wxT("SELECT_CELL"),
+ wxT("RESIZE_ROW"),
+ wxT("RESIZE_COL"),
+ wxT("SELECT_ROW"),
+ wxT("SELECT_COL"),
+ wxT("MOVE_COL"),
};
- wxLogTrace(_T("grid"),
- _T("wxGrid cursor mode (mouse capture for %s): %s -> %s"),
- win == m_colWindow ? _T("colLabelWin")
- : win ? _T("rowLabelWin")
- : _T("gridWin"),
+ wxLogTrace(wxT("grid"),
+ wxT("wxGrid cursor mode (mouse capture for %s): %s -> %s"),
+ win == m_colWindow ? wxT("colLabelWin")
+ : win ? wxT("rowLabelWin")
+ : wxT("gridWin"),
cursorModes[m_cursorMode], cursorModes[mode]);
#endif // wxUSE_LOG_TRACE
return;
// this should be checked by the caller!
- wxASSERT_MSG( CanEnableCellControl(), _T("can't enable editing for this cell!") );
+ wxASSERT_MSG( CanEnableCellControl(), wxT("can't enable editing for this cell!") );
// do it before ShowCellEditControl()
m_cellEditCtrlEnabled = enable;
int wxGrid::GetRowSize( int row ) const
{
- wxCHECK_MSG( row >= 0 && row < m_numRows, 0, _T("invalid row index") );
+ wxCHECK_MSG( row >= 0 && row < m_numRows, 0, wxT("invalid row index") );
return GetRowHeight(row);
}
int wxGrid::GetColSize( int col ) const
{
- wxCHECK_MSG( col >= 0 && col < m_numCols, 0, _T("invalid column index") );
+ wxCHECK_MSG( col >= 0 && col < m_numCols, 0, wxT("invalid column index") );
return GetColWidth(col);
}
wxGridCellAttr *attr = NULL;
bool canHave = ((wxGrid*)this)->CanHaveAttributes();
- wxCHECK_MSG( canHave, attr, _T("Cell attributes not allowed"));
- wxCHECK_MSG( m_table, attr, _T("must have a table") );
+ wxCHECK_MSG( canHave, attr, wxT("Cell attributes not allowed"));
+ wxCHECK_MSG( m_table, attr, wxT("must have a table") );
attr = m_table->GetAttr(row, col, wxGridCellAttr::Cell);
if ( !attr )
wxString typeName = wxGRID_VALUE_FLOAT;
if ( (width != -1) || (precision != -1) )
{
- typeName << _T(':') << width << _T(',') << precision;
+ typeName << wxT(':') << width << wxT(',') << precision;
}
SetColFormatCustom(col, typeName);
void wxGrid::SetRowSize( int row, int height )
{
- wxCHECK_RET( row >= 0 && row < m_numRows, _T("invalid row index") );
+ wxCHECK_RET( row >= 0 && row < m_numRows, wxT("invalid row index") );
// if < 0 then calculate new height from label
if ( height < 0 )
void wxGrid::SetColSize( int col, int width )
{
- wxCHECK_RET( col >= 0 && col < m_numCols, _T("invalid column index") );
+ wxCHECK_RET( col >= 0 && col < m_numCols, wxT("invalid column index") );
// if < 0 then calculate new width from label
if ( width < 0 )
{
// the first part of the typename is the "real" type, anything after ':'
// are the parameters for the renderer
- index = FindDataType(typeName.BeforeFirst(_T(':')));
+ index = FindDataType(typeName.BeforeFirst(wxT(':')));
if ( index == wxNOT_FOUND )
{
return wxNOT_FOUND;
editorOld->DecRef();
// do it even if there are no parameters to reset them to defaults
- wxString params = typeName.AfterFirst(_T(':'));
+ wxString params = typeName.AfterFirst(wxT(':'));
renderer->SetParameters(params);
editor->SetParameters(params);
if ( table->CanGetValueAs(row, col, wxGRID_VALUE_NUMBER) )
{
int choiceno = table->GetValueAsLong(row, col);
- text.Printf(_T("%s"), m_choices[ choiceno ].c_str() );
+ text.Printf(wxT("%s"), m_choices[ choiceno ].c_str() );
}
else
{
m_choices.Empty();
- wxStringTokenizer tk(params, _T(','));
+ wxStringTokenizer tk(params, wxT(','));
while ( tk.HasMoreTokens() )
{
m_choices.Add(tk.GetNextToken());
wxCoord max_x = rect.GetWidth();
dc.SetFont(attr.GetFont());
- wxStringTokenizer tk(data , _T(" \n\t\r"));
+ wxStringTokenizer tk(data , wxT(" \n\t\r"));
wxString thisline = wxEmptyString;
while ( tk.HasMoreTokens() )
// space at the end of the line. But it
// is invisible , simplifies the size calculation
// and ensures tokens are separated in the display
- tok += _T(" ");
+ tok += wxT(" ");
dc.GetTextExtent(tok, &x, &y);
if ( curr_x + x > max_x)
{
wxCoord x = 0, y = 0, max_x = 0;
dc.SetFont(attr.GetFont());
- wxStringTokenizer tk(text, _T('\n'));
+ wxStringTokenizer tk(text, wxT('\n'));
while ( tk.HasMoreTokens() )
{
dc.GetTextExtent(tk.GetNextToken(), &x, &y);
wxString text;
if ( table->CanGetValueAs(row, col, wxGRID_VALUE_NUMBER) )
{
- text.Printf(_T("%ld"), table->GetValueAsLong(row, col));
+ text.Printf(wxT("%ld"), table->GetValueAsLong(row, col));
}
else
{
if ( m_precision == -1 )
{
// default width/precision
- m_format = _T("%f");
+ m_format = wxT("%f");
}
else
{
- m_format.Printf(_T("%%.%df"), m_precision);
+ m_format.Printf(wxT("%%.%df"), m_precision);
}
}
else if ( m_precision == -1 )
{
// default precision
- m_format.Printf(_T("%%%d.f"), m_width);
+ m_format.Printf(wxT("%%%d.f"), m_width);
}
else
{
- m_format.Printf(_T("%%%d.%df"), m_width, m_precision);
+ m_format.Printf(wxT("%%%d.%df"), m_width, m_precision);
}
}
}
else
{
- wxString tmp = params.BeforeFirst(_T(','));
+ wxString tmp = params.BeforeFirst(wxT(','));
if ( !tmp.empty() )
{
long width;
}
else
{
- wxLogDebug(_T("Invalid wxGridCellFloatRenderer width parameter string '%s ignored"), params.c_str());
+ wxLogDebug(wxT("Invalid wxGridCellFloatRenderer width parameter string '%s ignored"), params.c_str());
}
}
- tmp = params.AfterFirst(_T(','));
+ tmp = params.AfterFirst(wxT(','));
if ( !tmp.empty() )
{
long precision;
}
else
{
- wxLogDebug(_T("Invalid wxGridCellFloatRenderer precision parameter string '%s ignored"), params.c_str());
+ wxLogDebug(wxT("Invalid wxGridCellFloatRenderer precision parameter string '%s ignored"), params.c_str());
}
}
}
}
else
{
- wxLogDebug( _T("Invalid wxGridCellTextEditor parameter string '%s' ignored"), params.c_str() );
+ wxLogDebug( wxT("Invalid wxGridCellTextEditor parameter string '%s' ignored"), params.c_str() );
}
}
}
wxString sValue = table->GetValue(row, col);
if (! sValue.ToLong(&m_value) && ! sValue.empty())
{
- wxFAIL_MSG( _T("this cell doesn't have numeric value") );
+ wxFAIL_MSG( wxT("this cell doesn't have numeric value") );
return;
}
}
else
{
long tmp;
- if ( params.BeforeFirst(_T(',')).ToLong(&tmp) )
+ if ( params.BeforeFirst(wxT(',')).ToLong(&tmp) )
{
m_min = (int)tmp;
- if ( params.AfterFirst(_T(',')).ToLong(&tmp) )
+ if ( params.AfterFirst(wxT(',')).ToLong(&tmp) )
{
m_max = (int)tmp;
}
}
- wxLogDebug(_T("Invalid wxGridCellNumberEditor parameter string '%s' ignored"), params.c_str());
+ wxLogDebug(wxT("Invalid wxGridCellNumberEditor parameter string '%s' ignored"), params.c_str());
}
}
{
if ( !value.ToDouble(&m_value) )
{
- wxFAIL_MSG( _T("this cell doesn't have float value") );
+ wxFAIL_MSG( wxT("this cell doesn't have float value") );
return;
}
}
bool is_decimal_point = ( strbuf ==
wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER) );
#else
- bool is_decimal_point = ( strbuf == _T(".") );
+ bool is_decimal_point = ( strbuf == wxT(".") );
#endif
if ( wxIsdigit(keycode) || keycode == '+' || keycode == '-'
else
{
long tmp;
- if ( params.BeforeFirst(_T(',')).ToLong(&tmp) )
+ if ( params.BeforeFirst(wxT(',')).ToLong(&tmp) )
{
m_width = (int)tmp;
- if ( params.AfterFirst(_T(',')).ToLong(&tmp) )
+ if ( params.AfterFirst(wxT(',')).ToLong(&tmp) )
{
m_precision = (int)tmp;
}
}
- wxLogDebug(_T("Invalid wxGridCellFloatEditor parameter string '%s' ignored"), params.c_str());
+ wxLogDebug(wxT("Invalid wxGridCellFloatEditor parameter string '%s' ignored"), params.c_str());
}
}
if ( m_precision == -1 && m_width != -1)
{
// default precision
- fmt.Printf(_T("%%%d.f"), m_width);
+ fmt.Printf(wxT("%%%d.f"), m_width);
}
else if ( m_precision != -1 && m_width == -1)
{
// default width
- fmt.Printf(_T("%%.%df"), m_precision);
+ fmt.Printf(wxT("%%.%df"), m_precision);
}
else if ( m_precision != -1 && m_width != -1 )
{
- fmt.Printf(_T("%%%d.%df"), m_width, m_precision);
+ fmt.Printf(wxT("%%%d.%df"), m_width, m_precision);
}
else
{
// default width/precision
- fmt = _T("%f");
+ fmt = wxT("%f");
}
return wxString::Format(fmt, m_value);
const wxString decimalPoint =
wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER);
#else
- const wxString decimalPoint(_T('.'));
+ const wxString decimalPoint(wxT('.'));
#endif
// accept digits, 'e' as in '1e+6', also '-', '+', and '.'
// ----------------------------------------------------------------------------
// the default values for GetValue()
-wxString wxGridCellBoolEditor::ms_stringValues[2] = { _T(""), _T("1") };
+wxString wxGridCellBoolEditor::ms_stringValues[2] = { wxT(""), wxT("1") };
void wxGridCellBoolEditor::Create(wxWindow* parent,
wxWindowID id,
// because we'll still overwrite it with something different and
// this risks to be very surprising for the user code, let them
// know about it
- wxFAIL_MSG( _T("invalid value for a cell with bool editor!") );
+ wxFAIL_MSG( wxT("invalid value for a cell with bool editor!") );
}
}
m_choices.Empty();
- wxStringTokenizer tk(params, _T(','));
+ wxStringTokenizer tk(params, wxT(','));
while ( tk.HasMoreTokens() )
{
m_choices.Add(tk.GetNextToken());
// ----------------------------------------------------------------------------
// Name for map file.
-#define WXEXTHELP_MAPFILE _T("wxhelp.map")
+#define WXEXTHELP_MAPFILE wxT("wxhelp.map")
// Character introducing comments/documentation field in map file.
#define WXEXTHELP_COMMENTCHAR ';'
bool wxExtHelpController::DisplayHelp(const wxString &relativeURL)
{
// construct hte URL to open -- it's just a file
- wxString url(_T("file://") + m_helpDir);
+ wxString url(wxT("file://") + m_helpDir);
url << wxFILE_SEP_PATH << relativeURL;
// use the explicit browser program if specified
return true;
}
- if ( wxExecute(m_BrowserName + _T(' ') + url, wxEXEC_SYNC) != -1 )
+ if ( wxExecute(m_BrowserName + wxT(' ') + url, wxEXEC_SYNC) != -1 )
return true;
}
//else: either no browser explicitly specified or we failed to open it
p++;
// skip empty lines and comments
- if ( *p == _T('\0') || *p == WXEXTHELP_COMMENTCHAR )
+ if ( *p == wxT('\0') || *p == WXEXTHELP_COMMENTCHAR )
return true;
// the line is of the form "num url" so we must have an integer now
if ( ! dirExists )
{
// try without encoding
- const wxString locNameWithoutEncoding = locName.BeforeLast(_T('.'));
+ const wxString locNameWithoutEncoding = locName.BeforeLast(wxT('.'));
if ( !locNameWithoutEncoding.empty() )
{
helpDirLoc = helpDir;
if ( !dirExists )
{
// try without country part
- wxString locNameWithoutCountry = locName.BeforeLast(_T('_'));
+ wxString locNameWithoutCountry = locName.BeforeLast(wxT('_'));
if ( !locNameWithoutCountry.empty() )
{
helpDirLoc = helpDir;
wxHtmlContainerCell *cell = (wxHtmlContainerCell *)m_htmlParser->
Parse(OnGetItemMarkup(n));
- wxCHECK_RET( cell, _T("wxHtmlParser::Parse() returned NULL?") );
+ wxCHECK_RET( cell, wxT("wxHtmlParser::Parse() returned NULL?") );
// set the cell's ID to item's index so that CellCoordsToPhysical()
// can quickly find the item:
- cell->SetId(wxString::Format(_T("%lu"), (unsigned long)n));
+ cell->SetId(wxString::Format(wxT("%lu"), (unsigned long)n));
cell->Layout(GetClientSize().x - 2*GetMargins().x);
CacheItem(n);
wxHtmlCell *cell = m_cache->Get(n);
- wxCHECK_RET( cell, _T("this cell should be cached!") );
+ wxCHECK_RET( cell, wxT("this cell should be cached!") );
wxHtmlRenderingInfo htmlRendInfo;
CacheItem(n);
wxHtmlCell *cell = m_cache->Get(n);
- wxCHECK_MSG( cell, 0, _T("this cell should be cached!") );
+ wxCHECK_MSG( cell, 0, wxT("this cell should be cached!") );
return cell->GetHeight() + cell->GetDescent() + 4;
}
size_t wxHtmlListBox::GetItemForCell(const wxHtmlCell *cell) const
{
- wxCHECK_MSG( cell, 0, _T("no cell") );
+ wxCHECK_MSG( cell, 0, wxT("no cell") );
cell = cell->GetRootCell();
- wxCHECK_MSG( cell, 0, _T("no root cell") );
+ wxCHECK_MSG( cell, 0, wxT("no root cell") );
// the cell's ID contains item index, see CacheItem():
unsigned long n;
if ( !cell->GetId().ToULong(&n) )
{
- wxFAIL_MSG( _T("unexpected root cell's ID") );
+ wxFAIL_MSG( wxT("unexpected root cell's ID") );
return 0;
}
{
wxASSERT_MSG( (bitmap.GetWidth() >= m_width && bitmap.GetHeight() == m_height)
|| (m_width == 0 && m_height == 0),
- _T("invalid bitmap size in wxImageList: this might work ")
- _T("on this platform but definitely won't under Windows.") );
+ wxT("invalid bitmap size in wxImageList: this might work ")
+ wxT("on this platform but definitely won't under Windows.") );
const int index = int(m_images.GetCount());
void wxListItemData::SetPosition( int x, int y )
{
- wxCHECK_RET( m_rect, _T("unexpected SetPosition() call") );
+ wxCHECK_RET( m_rect, wxT("unexpected SetPosition() call") );
m_rect->x = x;
m_rect->y = y;
void wxListItemData::SetSize( int width, int height )
{
- wxCHECK_RET( m_rect, _T("unexpected SetSize() call") );
+ wxCHECK_RET( m_rect, wxT("unexpected SetSize() call") );
if ( width != -1 )
m_rect->width = width;
bool wxListItemData::IsHit( int x, int y ) const
{
- wxCHECK_MSG( m_rect, false, _T("can't be called in this mode") );
+ wxCHECK_MSG( m_rect, false, wxT("can't be called in this mode") );
return wxRect(GetX(), GetY(), GetWidth(), GetHeight()).Contains(x, y);
}
int wxListItemData::GetX() const
{
- wxCHECK_MSG( m_rect, 0, _T("can't be called in this mode") );
+ wxCHECK_MSG( m_rect, 0, wxT("can't be called in this mode") );
return m_rect->x;
}
int wxListItemData::GetY() const
{
- wxCHECK_MSG( m_rect, 0, _T("can't be called in this mode") );
+ wxCHECK_MSG( m_rect, 0, wxT("can't be called in this mode") );
return m_rect->y;
}
int wxListItemData::GetWidth() const
{
- wxCHECK_MSG( m_rect, 0, _T("can't be called in this mode") );
+ wxCHECK_MSG( m_rect, 0, wxT("can't be called in this mode") );
return m_rect->width;
}
int wxListItemData::GetHeight() const
{
- wxCHECK_MSG( m_rect, 0, _T("can't be called in this mode") );
+ wxCHECK_MSG( m_rect, 0, wxT("can't be called in this mode") );
return m_rect->height;
}
void wxListLineData::CalculateSize( wxDC *dc, int spacing )
{
wxListItemDataList::compatibility_iterator node = m_items.GetFirst();
- wxCHECK_RET( node, _T("no subitems at all??") );
+ wxCHECK_RET( node, wxT("no subitems at all??") );
wxListItemData *item = node->GetData();
break;
case wxLC_REPORT:
- wxFAIL_MSG( _T("unexpected call to SetSize") );
+ wxFAIL_MSG( wxT("unexpected call to SetSize") );
break;
default:
- wxFAIL_MSG( _T("unknown mode") );
+ wxFAIL_MSG( wxT("unknown mode") );
break;
}
}
void wxListLineData::SetPosition( int x, int y, int spacing )
{
wxListItemDataList::compatibility_iterator node = m_items.GetFirst();
- wxCHECK_RET( node, _T("no subitems at all??") );
+ wxCHECK_RET( node, wxT("no subitems at all??") );
wxListItemData *item = node->GetData();
break;
case wxLC_REPORT:
- wxFAIL_MSG( _T("unexpected call to SetPosition") );
+ wxFAIL_MSG( wxT("unexpected call to SetPosition") );
break;
default:
- wxFAIL_MSG( _T("unknown mode") );
+ wxFAIL_MSG( wxT("unknown mode") );
break;
}
}
void wxListLineData::SetItem( int index, const wxListItem &info )
{
wxListItemDataList::compatibility_iterator node = m_items.Item( index );
- wxCHECK_RET( node, _T("invalid column index in SetItem") );
+ wxCHECK_RET( node, wxT("invalid column index in SetItem") );
wxListItemData *item = node->GetData();
item->SetItem( info );
void wxListLineData::SetImage( int index, int image )
{
wxListItemDataList::compatibility_iterator node = m_items.Item( index );
- wxCHECK_RET( node, _T("invalid column index in SetImage()") );
+ wxCHECK_RET( node, wxT("invalid column index in SetImage()") );
wxListItemData *item = node->GetData();
item->SetImage(image);
int wxListLineData::GetImage( int index ) const
{
wxListItemDataList::compatibility_iterator node = m_items.Item( index );
- wxCHECK_MSG( node, -1, _T("invalid column index in GetImage()") );
+ wxCHECK_MSG( node, -1, wxT("invalid column index in GetImage()") );
wxListItemData *item = node->GetData();
return item->GetImage();
wxListItemAttr *wxListLineData::GetAttr() const
{
wxListItemDataList::compatibility_iterator node = m_items.GetFirst();
- wxCHECK_MSG( node, NULL, _T("invalid column index in GetAttr()") );
+ wxCHECK_MSG( node, NULL, wxT("invalid column index in GetAttr()") );
wxListItemData *item = node->GetData();
return item->GetAttr();
void wxListLineData::SetAttr(wxListItemAttr *attr)
{
wxListItemDataList::compatibility_iterator node = m_items.GetFirst();
- wxCHECK_RET( node, _T("invalid column index in SetAttr()") );
+ wxCHECK_RET( node, wxT("invalid column index in SetAttr()") );
wxListItemData *item = node->GetData();
item->SetAttr(attr);
void wxListLineData::Draw( wxDC *dc )
{
wxListItemDataList::compatibility_iterator node = m_items.GetFirst();
- wxCHECK_RET( node, _T("no subitems at all??") );
+ wxCHECK_RET( node, wxT("no subitems at all??") );
bool highlighted = IsHighlighted();
// we don't support displaying multiple lines currently (and neither does
// wxMSW FWIW) so just merge all the lines
wxString text(textOrig);
- text.Replace(_T("\n"), _T(" "));
+ text.Replace(wxT("\n"), wxT(" "));
wxCoord w, h;
dc->GetTextExtent(text, &w, &h);
break;
default:
- wxFAIL_MSG( _T("unknown list item format") );
+ wxFAIL_MSG( wxT("unknown list item format") );
break;
}
bool wxListLineData::Highlight( bool on )
{
- wxCHECK_MSG( !IsVirtual(), false, _T("unexpected call to Highlight") );
+ wxCHECK_MSG( !IsVirtual(), false, wxT("unexpected call to Highlight") );
if ( on == m_highlighted )
return false;
switch ( wLabel < cw ? item.GetAlign() : wxLIST_FORMAT_LEFT )
{
default:
- wxFAIL_MSG( _T("unknown list item format") );
+ wxFAIL_MSG( wxT("unknown list item format") );
// fall through
case wxLIST_FORMAT_LEFT:
wxPoint myPos = m_text->GetPosition();
wxSize mySize = m_text->GetSize();
int sx, sy;
- m_text->GetTextExtent(m_text->GetValue() + _T("MM"), &sx, &sy);
+ m_text->GetTextExtent(m_text->GetValue() + wxT("MM"), &sx, &sy);
if (myPos.x + sx > parentSize.x)
sx = parentSize.x - myPos.x;
if (mySize.x > sx)
wxListLineData *wxListMainWindow::GetDummyLine() const
{
- wxASSERT_MSG( !IsEmpty(), _T("invalid line index") );
- wxASSERT_MSG( IsVirtual(), _T("GetDummyLine() shouldn't be called") );
+ wxASSERT_MSG( !IsEmpty(), wxT("invalid line index") );
+ wxASSERT_MSG( IsVirtual(), wxT("GetDummyLine() shouldn't be called") );
wxListMainWindow *self = wxConstCast(this, wxListMainWindow);
dc.SetFont( GetFont() );
wxCoord y;
- dc.GetTextExtent(_T("H"), NULL, &y);
+ dc.GetTextExtent(wxT("H"), NULL, &y);
if ( m_small_image_list && m_small_image_list->GetImageCount() )
{
wxCoord wxListMainWindow::GetLineY(size_t line) const
{
- wxASSERT_MSG( InReportView(), _T("only works in report mode") );
+ wxASSERT_MSG( InReportView(), wxT("only works in report mode") );
return LINE_SPACING + line * GetLineHeight();
}
return GetLine(line)->m_gi->m_rectIcon;
wxListLineData *ld = GetLine(line);
- wxASSERT_MSG( ld->HasImage(), _T("should have an image") );
+ wxASSERT_MSG( ld->HasImage(), wxT("should have an image") );
wxRect rect;
rect.x = HEADER_OFFSET_X;
long wxListMainWindow::HitTestLine(size_t line, int x, int y) const
{
- wxASSERT_MSG( line < GetItemCount(), _T("invalid line in HitTestLine") );
+ wxASSERT_MSG( line < GetItemCount(), wxT("invalid line in HitTestLine") );
wxListLineData *ld = GetLine(line);
else // !virtual
{
wxListLineData *ld = GetLine(line);
- wxCHECK_MSG( ld, false, _T("invalid index in IsHighlighted") );
+ wxCHECK_MSG( ld, false, wxT("invalid index in IsHighlighted") );
return ld->IsHighlighted();
}
else // !virtual
{
wxListLineData *ld = GetLine(line);
- wxCHECK_MSG( ld, false, _T("invalid index in HighlightLine") );
+ wxCHECK_MSG( ld, false, wxT("invalid index in HighlightLine") );
changed = ld->Highlight(highlight);
}
void wxListMainWindow::RefreshLines( size_t lineFrom, size_t lineTo )
{
// we suppose that they are ordered by caller
- wxASSERT_MSG( lineFrom <= lineTo, _T("indices in disorder") );
+ wxASSERT_MSG( lineFrom <= lineTo, wxT("indices in disorder") );
- wxASSERT_MSG( lineTo < GetItemCount(), _T("invalid line range") );
+ wxASSERT_MSG( lineTo < GetItemCount(), wxT("invalid line range") );
if ( InReportView() )
{
{
if ( IsSingleSel() )
{
- wxASSERT_MSG( !on, _T("can't do this in a single selection control") );
+ wxASSERT_MSG( !on, wxT("can't do this in a single selection control") );
// we just have one item to turn off
if ( HasCurrent() && IsHighlighted(m_current) )
le.SetEventObject( GetParent() );
le.m_itemIndex = item;
wxListLineData *data = GetLine(itemEdit);
- wxCHECK_MSG( data, NULL, _T("invalid index in EditLabel()") );
+ wxCHECK_MSG( data, NULL, wxT("invalid index in EditLabel()") );
data->GetItem( 0, le.m_item );
if ( GetParent()->GetEventHandler()->ProcessEvent( le ) && !le.IsAllowed() )
wxListLineData *data = GetLine(itemEdit);
- wxCHECK_MSG( data, false, _T("invalid index in OnRenameAccept()") );
+ wxCHECK_MSG( data, false, wxT("invalid index in OnRenameAccept()") );
data->GetItem( 0, le.m_item );
le.m_item.m_text = value;
le.m_itemIndex = itemEdit;
wxListLineData *data = GetLine(itemEdit);
- wxCHECK_RET( data, _T("invalid index in OnRenameCancelled()") );
+ wxCHECK_RET( data, wxT("invalid index in OnRenameCancelled()") );
data->GetItem( 0, le.m_item );
GetEventHandler()->ProcessEvent( le );
else // !ctrl, !shift
{
// test in the enclosing if should make it impossible
- wxFAIL_MSG( _T("how did we get here?") );
+ wxFAIL_MSG( wxT("how did we get here?") );
}
}
void wxListMainWindow::OnArrowChar(size_t newCurrent, const wxKeyEvent& event)
{
wxCHECK_RET( newCurrent < (size_t)GetItemCount(),
- _T("invalid item index in OnArrowChar()") );
+ wxT("invalid item index in OnArrowChar()") );
size_t oldCurrent = m_current;
// don't use m_linesPerPage directly as it might not be computed yet
const int pageSize = GetCountPerPage();
- wxCHECK_RET( pageSize, _T("should have non zero page size") );
+ wxCHECK_RET( pageSize, wxT("should have non zero page size") );
if (GetLayoutDirection() == wxLayout_RightToLeft)
{
{
wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col );
- wxCHECK_RET( node, _T("invalid column index in SetColumn") );
+ wxCHECK_RET( node, wxT("invalid column index in SetColumn") );
if ( item.m_width == wxLIST_AUTOSIZE_USEHEADER )
item.m_width = GetTextLength( item.m_text );
void wxListMainWindow::SetColumnWidth( int col, int width )
{
wxCHECK_RET( col >= 0 && col < GetColumnCount(),
- _T("invalid column index") );
+ wxT("invalid column index") );
wxCHECK_RET( InReportView(),
- _T("SetColumnWidth() can only be called in report mode.") );
+ wxT("SetColumnWidth() can only be called in report mode.") );
m_dirty = true;
headerWin->m_dirty = true;
wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col );
- wxCHECK_RET( node, _T("no column?") );
+ wxCHECK_RET( node, wxT("no column?") );
wxListHeaderData *column = node->GetData();
wxListLineData *line = GetLine( i );
wxListItemDataList::compatibility_iterator n = line->m_items.Item( col );
- wxCHECK_RET( n, _T("no subitem?") );
+ wxCHECK_RET( n, wxT("no subitem?") );
wxListItemData *itemData = n->GetData();
wxListItem item;
void wxListMainWindow::GetColumn( int col, wxListItem &item ) const
{
wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col );
- wxCHECK_RET( node, _T("invalid column index in GetColumn") );
+ wxCHECK_RET( node, wxT("invalid column index in GetColumn") );
wxListHeaderData *column = node->GetData();
column->GetItem( item );
int wxListMainWindow::GetColumnWidth( int col ) const
{
wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col );
- wxCHECK_MSG( node, 0, _T("invalid column index") );
+ wxCHECK_MSG( node, 0, wxT("invalid column index") );
wxListHeaderData *column = node->GetData();
return column->GetWidth();
{
long id = item.m_itemId;
wxCHECK_RET( id >= 0 && (size_t)id < GetItemCount(),
- _T("invalid item index in SetItem") );
+ wxT("invalid item index in SetItem") );
if ( !IsVirtual() )
{
}
wxCHECK_RET( litem >= 0 && (size_t)litem < GetItemCount(),
- _T("invalid list ctrl item index in SetItem") );
+ wxT("invalid list ctrl item index in SetItem") );
size_t oldCurrent = m_current;
size_t item = (size_t)litem; // safe because of the check above
int wxListMainWindow::GetItemState( long item, long stateMask ) const
{
wxCHECK_MSG( item >= 0 && (size_t)item < GetItemCount(), 0,
- _T("invalid list ctrl item index in GetItemState()") );
+ wxT("invalid list ctrl item index in GetItemState()") );
int ret = wxLIST_STATE_DONTCARE;
void wxListMainWindow::GetItem( wxListItem &item ) const
{
wxCHECK_RET( item.m_itemId >= 0 && (size_t)item.m_itemId < GetItemCount(),
- _T("invalid item index in GetItem") );
+ wxT("invalid item index in GetItem") );
wxListLineData *line = GetLine((size_t)item.m_itemId);
line->GetItem( item.m_col, item );
{
wxCHECK_MSG( subItem == wxLIST_GETSUBITEMRECT_WHOLEITEM || InReportView(),
false,
- _T("GetSubItemRect only meaningful in report view") );
+ wxT("GetSubItemRect only meaningful in report view") );
wxCHECK_MSG( item >= 0 && (size_t)item < GetItemCount(), false,
- _T("invalid item in GetSubItemRect") );
+ wxT("invalid item in GetSubItemRect") );
// ensure that we're laid out, otherwise we could return nonsense
if ( m_dirty )
if ( subItem != wxLIST_GETSUBITEMRECT_WHOLEITEM )
{
wxCHECK_MSG( subItem >= 0 && subItem < GetColumnCount(), false,
- _T("invalid subItem in GetSubItemRect") );
+ wxT("invalid subItem in GetSubItemRect") );
for (int i = 0; i < subItem; i++)
{
long ret = item,
max = GetItemCount();
wxCHECK_MSG( (ret == -1) || (ret < max), -1,
- _T("invalid listctrl index in GetNextItem()") );
+ wxT("invalid listctrl index in GetNextItem()") );
// notice that we start with the next item (or the first one if item == -1)
// and this is intentional to allow writing a simple loop to iterate over
size_t count = GetItemCount();
wxCHECK_RET( (lindex >= 0) && ((size_t)lindex < count),
- _T("invalid item index in DeleteItem") );
+ wxT("invalid item index in DeleteItem") );
size_t index = (size_t)lindex;
void wxListMainWindow::EnsureVisible( long index )
{
wxCHECK_RET( index >= 0 && (size_t)index < GetItemCount(),
- _T("invalid index in EnsureVisible") );
+ wxT("invalid index in EnsureVisible") );
// We have to call this here because the label in question might just have
// been added and its position is not known yet
void wxListMainWindow::InsertItem( wxListItem &item )
{
- wxASSERT_MSG( !IsVirtual(), _T("can't be used with virtual control") );
+ wxASSERT_MSG( !IsVirtual(), wxT("can't be used with virtual control") );
int count = GetItemCount();
- wxCHECK_RET( item.m_itemId >= 0, _T("invalid item index") );
+ wxCHECK_RET( item.m_itemId >= 0, wxT("invalid item index") );
if (item.m_itemId > count)
item.m_itemId = count;
if ( event.GetOrientation() == wxHORIZONTAL && HasHeader() )
{
wxGenericListCtrl* lc = GetListCtrl();
- wxCHECK_RET( lc, _T("no listctrl window?") );
+ wxCHECK_RET( lc, wxT("no listctrl window?") );
if (lc->m_headerWin) // when we use wxLC_NO_HEADER, m_headerWin==NULL
{
void wxListMainWindow::GetVisibleLinesRange(size_t *from, size_t *to)
{
- wxASSERT_MSG( InReportView(), _T("this is for report mode only") );
+ wxASSERT_MSG( InReportView(), wxT("this is for report mode only") );
if ( m_lineFrom == (size_t)-1 )
{
wxASSERT_MSG( IsEmpty() ||
(m_lineFrom <= m_lineTo && m_lineTo < GetItemCount()),
- _T("GetVisibleLinesRange() returns incorrect result") );
+ wxT("GetVisibleLinesRange() returns incorrect result") );
if ( from )
*from = m_lineFrom;
// just like in other ports, an assert will fail if the user doesn't give any type style:
wxASSERT_MSG( (style & wxLC_MASK_TYPE),
- _T("wxListCtrl style should have exactly one mode bit set") );
+ wxT("wxListCtrl style should have exactly one mode bit set") );
if ( !wxControl::Create( parent, id, pos, size, style|wxVSCROLL|wxHSCROLL, validator, name ) )
return false;
void wxGenericListCtrl::SetSingleStyle( long style, bool add )
{
wxASSERT_MSG( !(style & wxLC_VIRTUAL),
- _T("wxLC_VIRTUAL can't be [un]set") );
+ wxT("wxLC_VIRTUAL can't be [un]set") );
long flag = GetWindowStyle();
long wxGenericListCtrl::InsertColumn( long col, wxListItem &item )
{
- wxCHECK_MSG( InReportView(), -1, _T("can't add column in non report mode") );
+ wxCHECK_MSG( InReportView(), -1, wxT("can't add column in non report mode") );
m_mainWin->InsertColumn( col, item );
{
// this is a pure virtual function, in fact - which is not really pure
// because the controls which are not virtual don't need to implement it
- wxFAIL_MSG( _T("wxGenericListCtrl::OnGetItemText not supposed to be called") );
+ wxFAIL_MSG( wxT("wxGenericListCtrl::OnGetItemText not supposed to be called") );
return wxEmptyString;
}
wxGenericListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const
{
wxASSERT_MSG( item >= 0 && item < GetItemCount(),
- _T("invalid item index in OnGetItemAttr()") );
+ wxT("invalid item index in OnGetItemAttr()") );
// no attributes by default
return NULL;
void wxGenericListCtrl::SetItemCount(long count)
{
- wxASSERT_MSG( IsVirtual(), _T("this is for virtual controls only") );
+ wxASSERT_MSG( IsVirtual(), wxT("this is for virtual controls only") );
m_mainWin->SetItemCount(count);
}
#include "wx/datetime.h"
// the suffix we add to the button to show that the dialog can be expanded
-#define EXPAND_SUFFIX _T(" >>")
+#define EXPAND_SUFFIX wxT(" >>")
#define CAN_SAVE_FILES (wxUSE_FILE && wxUSE_FILEDLG)
if ( !wxStrftime(buf, WXSIZEOF(buf), format, wxLocaltime_r(&t, &tm)) )
{
// buffer is too small?
- wxFAIL_MSG(_T("strftime() failed"));
+ wxFAIL_MSG(wxT("strftime() failed"));
}
return wxString(buf);
#else // !wxUSE_DATETIME
// no need to translate these strings as they're not shown to the
// user anyhow (we use wxLC_NO_HEADER style)
- m_listctrl->InsertColumn(0, _T("Message"));
+ m_listctrl->InsertColumn(0, wxT("Message"));
if (hasTimeStamp)
- m_listctrl->InsertColumn(1, _T("Time"));
+ m_listctrl->InsertColumn(1, wxT("Time"));
// prepare the imagelist
static const int ICON_SIZE = 16;
{
#if !wxUSE_SPINCTRL
wxString tmp = m_spinctrl->GetValue();
- if ( wxSscanf(tmp, _T("%ld"), &m_value) != 1 )
+ if ( wxSscanf(tmp, wxT("%ld"), &m_value) != 1 )
EndModal(wxID_CANCEL);
else
#else
void wxOwnerDrawnComboBox::DoDeleteOneItem(unsigned int n)
{
- wxCHECK_RET( IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::Delete") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxOwnerDrawnComboBox::Delete") );
if ( GetSelection() == (int) n )
SetValue(wxEmptyString);
wxString wxOwnerDrawnComboBox::GetString(unsigned int n) const
{
- wxCHECK_MSG( IsValid(n), wxEmptyString, _T("invalid index in wxOwnerDrawnComboBox::GetString") );
+ wxCHECK_MSG( IsValid(n), wxEmptyString, wxT("invalid index in wxOwnerDrawnComboBox::GetString") );
if ( !m_popupInterface )
return m_initChs.Item(n);
{
EnsurePopupControl();
- wxCHECK_RET( IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::SetString") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxOwnerDrawnComboBox::SetString") );
GetVListBoxComboPopup()->SetString(n,s);
}
{
EnsurePopupControl();
- wxCHECK_RET( (n == wxNOT_FOUND) || IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::Select") );
+ wxCHECK_RET( (n == wxNOT_FOUND) || IsValid(n), wxT("invalid index in wxOwnerDrawnComboBox::Select") );
GetVListBoxComboPopup()->SetSelection(n);
m_fromText->Enable(true);
m_toText->Enable(true);
if (m_printDialogData.GetFromPage() > 0)
- m_fromText->SetValue(wxString::Format(_T("%d"), m_printDialogData.GetFromPage()));
+ m_fromText->SetValue(wxString::Format(wxT("%d"), m_printDialogData.GetFromPage()));
if (m_printDialogData.GetToPage() > 0)
- m_toText->SetValue(wxString::Format(_T("%d"), m_printDialogData.GetToPage()));
+ m_toText->SetValue(wxString::Format(wxT("%d"), m_printDialogData.GetToPage()));
if(m_rangeRadioBox)
{
if (m_printDialogData.GetAllPages() || m_printDialogData.GetFromPage() == 0)
}
}
m_noCopiesText->SetValue(
- wxString::Format(_T("%d"), m_printDialogData.GetNoCopies()));
+ wxString::Format(wxT("%d"), m_printDialogData.GetNoCopies()));
m_printToFileCheckBox->SetValue(m_printDialogData.GetPrintToFile());
m_printToFileCheckBox->Enable(m_printDialogData.GetEnablePrintToFile());
li.SetMask( wxLIST_MASK_TEXT );
li.SetId( event.GetIndex() );
m_printerListCtrl->GetItem( li );
- m_printerCommandText->SetValue( _T("lpr -P") + li.GetText() );
+ m_printerCommandText->SetValue( wxT("lpr -P") + li.GetText() );
}
}
wxScrollHelperBase::wxScrollHelperBase(wxWindow *win)
{
- wxASSERT_MSG( win, _T("associated window can't be NULL in wxScrollHelper") );
+ wxASSERT_MSG( win, wxT("associated window can't be NULL in wxScrollHelper") );
m_xScrollPixelsPerLine =
m_yScrollPixelsPerLine =
// but seems to happen sometimes under wxMSW - maybe it's a bug
// there but for now just ignore it
- //wxFAIL_MSG( _T("can't understand where has mouse gone") );
+ //wxFAIL_MSG( wxT("can't understand where has mouse gone") );
return;
}
// change state
static const unsigned MANY_ITEMS = 100;
- wxASSERT_MSG( itemFrom <= itemTo, _T("should be in order") );
+ wxASSERT_MSG( itemFrom <= itemTo, wxT("should be in order") );
// are we going to have more [un]selected items than the other ones?
if ( itemTo - itemFrom > m_count/2 )
while ( i < count )
{
// all following elements must be greater than the one we deleted
- wxASSERT_MSG( m_itemsSel[i] > item, _T("logic error") );
+ wxASSERT_MSG( m_itemsSel[i] > item, wxT("logic error") );
m_itemsSel[i++]--;
}
void wxSpinCtrlGenericBase::SetValue(const wxString& text)
{
- wxCHECK_RET( m_textCtrl, _T("invalid call to wxSpinCtrl::SetValue") );
+ wxCHECK_RET( m_textCtrl, wxT("invalid call to wxSpinCtrl::SetValue") );
double val;
if ( text.ToDouble(&val) && InRange(val) )
bool wxSpinCtrlGenericBase::DoSetValue(double val)
{
- wxCHECK_MSG( m_textCtrl, false, _T("invalid call to wxSpinCtrl::SetValue") );
+ wxCHECK_MSG( m_textCtrl, false, wxT("invalid call to wxSpinCtrl::SetValue") );
if (!InRange(val))
return false;
void wxSpinCtrlGenericBase::SetSelection(long from, long to)
{
- wxCHECK_RET( m_textCtrl, _T("invalid call to wxSpinCtrl::SetSelection") );
+ wxCHECK_RET( m_textCtrl, wxT("invalid call to wxSpinCtrl::SetSelection") );
m_textCtrl->SetSelection(from, to);
}
void wxSplitterWindow::SetSashGravity(double gravity)
{
wxCHECK_RET( gravity >= 0. && gravity <= 1.,
- _T("invalid gravity value") );
+ wxT("invalid gravity value") );
m_sashGravity = gravity;
}
void wxSplitterWindow::Initialize(wxWindow *window)
{
wxASSERT_MSG( (!window || window->GetParent() == this),
- _T("windows in the splitter should have it as parent!") );
+ wxT("windows in the splitter should have it as parent!") );
if (window && !window->IsShown())
window->Show();
return false;
wxCHECK_MSG( window1 && window2, false,
- _T("can not split with NULL window(s)") );
+ wxT("can not split with NULL window(s)") );
wxCHECK_MSG( window1->GetParent() == this && window2->GetParent() == this, false,
- _T("windows in the splitter should have it as parent!") );
+ wxT("windows in the splitter should have it as parent!") );
if (! window1->IsShown())
window1->Show();
void wxStatusBarGeneric::SetFieldsCount(int number, const int *widths)
{
- wxASSERT_MSG( number >= 0, _T("negative number of fields in wxStatusBar?") );
+ wxASSERT_MSG( number >= 0, wxT("negative number of fields in wxStatusBar?") );
// this will result in a call to SetStatusWidths() and thus an update to our
// m_widthsAbs cache
void wxStatusBarGeneric::SetStatusText(const wxString& text, int number)
{
wxCHECK_RET( (number >= 0) && ((size_t)number < m_panes.GetCount()),
- _T("invalid status bar field index") );
+ wxT("invalid status bar field index") );
wxString oldText = GetStatusText(number);
if (oldText != text)
void wxStatusBarGeneric::SetStatusWidths(int n, const int widths_field[])
{
// only set status widths when n == number of statuswindows
- wxCHECK_RET( (size_t)n == m_panes.GetCount(), _T("status bar field count mismatch") );
+ wxCHECK_RET( (size_t)n == m_panes.GetCount(), wxT("status bar field count mismatch") );
wxStatusBarBase::SetStatusWidths(n, widths_field);
bool wxStatusBarGeneric::GetFieldRect(int n, wxRect& rect) const
{
wxCHECK_MSG( (n >= 0) && ((size_t)n < m_panes.GetCount()), false,
- _T("invalid status bar field index") );
+ wxT("invalid status bar field index") );
if (m_widthsAbs.IsEmpty())
return false;
typedef ulong wxTimerTick_t;
- #define wxTimerTickFmtSpec _T("lu")
+ #define wxTimerTickFmtSpec wxT("lu")
#define wxTimerTickPrintfArg(tt) (tt)
#ifdef __DOS__
typedef wxLongLong wxTimerTick_t;
#if wxUSE_LONGLONG_WX
- #define wxTimerTickFmtSpec wxLongLongFmtSpec _T("d")
+ #define wxTimerTickFmtSpec wxLongLongFmtSpec wxT("d")
#define wxTimerTickPrintfArg(tt) (tt.GetValue())
#else // using native wxLongLong
- #define wxTimerTickFmtSpec _T("s")
+ #define wxTimerTickFmtSpec wxT("s")
#define wxTimerTickPrintfArg(tt) (tt.ToString().c_str())
#endif // wx/native long long
bool breakLine = false;
for ( const wxChar *p = text.c_str(); ; p++ )
{
- if ( *p == _T('\n') || *p == _T('\0') )
+ if ( *p == wxT('\n') || *p == wxT('\0') )
{
dc.GetTextExtent(current, &width, &height);
if ( width > widthMax )
current.clear();
breakLine = false;
}
- else if ( breakLine && (*p == _T(' ') || *p == _T('\t')) )
+ else if ( breakLine && (*p == wxT(' ') || *p == wxT('\t')) )
{
// word boundary - break the line here
m_parent->m_textLines.Add(current);
int wxToolbook::GetPageImage(size_t WXUNUSED(n)) const
{
- wxFAIL_MSG( _T("wxToolbook::GetPageImage() not implemented") );
+ wxFAIL_MSG( wxT("wxToolbook::GetPageImage() not implemented") );
return wxNOT_FOUND;
}
wxTreeItemId lastNodeId = tree->GetLastChild(rootId);
wxCHECK_MSG( lastNodeId.IsOk(), false,
- _T("Can't insert sub page when there are no pages") );
+ wxT("Can't insert sub page when there are no pages") );
// now calculate its position (should we save/update it too?)
size_t newPos = tree->GetCount() -
wxPoint myPos = GetPosition();
wxSize mySize = GetSize();
int sx, sy;
- GetTextExtent(GetValue() + _T("M"), &sx, &sy);
+ GetTextExtent(GetValue() + wxT("M"), &sx, &sy);
if (myPos.x + sx > parentSize.x)
sx = parentSize.x - myPos.x;
if (mySize.x > sx)
{
wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem;
- wxCHECK_RET( item, _T("invalid item in wxGenericTreeCtrl::Expand") );
+ wxCHECK_RET( item, wxT("invalid item in wxGenericTreeCtrl::Expand") );
wxCHECK_RET( !HasFlag(wxTR_HIDE_ROOT) || itemId != GetRootItem(),
- _T("can't expand hidden root") );
+ wxT("can't expand hidden root") );
if ( !item->HasPlus() )
return;
void wxGenericTreeCtrl::Collapse(const wxTreeItemId& itemId)
{
wxCHECK_RET( !HasFlag(wxTR_HIDE_ROOT) || itemId != GetRootItem(),
- _T("can't collapse hidden root") );
+ wxT("can't collapse hidden root") );
wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem;
wxTextCtrl *wxGenericTreeCtrl::EditLabel(const wxTreeItemId& item,
wxClassInfo * WXUNUSED(textCtrlClass))
{
- wxCHECK_MSG( item.IsOk(), NULL, _T("can't edit an invalid item") );
+ wxCHECK_MSG( item.IsOk(), NULL, wxT("can't edit an invalid item") );
wxGenericTreeItem *itemEdit = (wxGenericTreeItem *)item.m_pItem;
void wxGenericTreeCtrl::EndEditLabel(const wxTreeItemId& WXUNUSED(item),
bool discardChanges)
{
- wxCHECK_RET( m_textCtrl, _T("not editing label") );
+ wxCHECK_RET( m_textCtrl, wxT("not editing label") );
m_textCtrl->EndEdit(discardChanges);
}
bool wxVListBox::Select(size_t item, bool select)
{
wxCHECK_MSG( m_selStore, false,
- _T("Select() may only be used with multiselection listbox") );
+ wxT("Select() may only be used with multiselection listbox") );
wxCHECK_MSG( item < GetItemCount(), false,
- _T("Select(): invalid item index") );
+ wxT("Select(): invalid item index") );
bool changed = m_selStore->SelectItem(item, select);
if ( changed )
bool wxVListBox::SelectRange(size_t from, size_t to)
{
wxCHECK_MSG( m_selStore, false,
- _T("SelectRange() may only be used with multiselection listbox") );
+ wxT("SelectRange() may only be used with multiselection listbox") );
// make sure items are in correct order
if ( from > to )
}
wxCHECK_MSG( to < GetItemCount(), false,
- _T("SelectRange(): invalid item index") );
+ wxT("SelectRange(): invalid item index") );
wxArrayInt changed;
if ( !m_selStore->SelectRange(from, to, true, &changed) )
bool wxVListBox::DoSelectAll(bool select)
{
wxCHECK_MSG( m_selStore, false,
- _T("SelectAll may only be used with multiselection listbox") );
+ wxT("SelectAll may only be used with multiselection listbox") );
size_t count = GetItemCount();
if ( count )
{
wxASSERT_MSG( current == wxNOT_FOUND ||
(current >= 0 && (size_t)current < GetItemCount()),
- _T("wxVListBox::DoSetCurrent(): invalid item index") );
+ wxT("wxVListBox::DoSetCurrent(): invalid item index") );
if ( current == m_current )
{
void wxVListBox::SendSelectedEvent()
{
wxASSERT_MSG( m_current != wxNOT_FOUND,
- _T("SendSelectedEvent() shouldn't be called") );
+ wxT("SendSelectedEvent() shouldn't be called") );
wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, GetId());
InitEvent(event, m_current);
{
wxCHECK_RET( selection == wxNOT_FOUND ||
(selection >= 0 && (size_t)selection < GetItemCount()),
- _T("wxVListBox::SetSelection(): invalid item index") );
+ wxT("wxVListBox::SetSelection(): invalid item index") );
if ( HasMultipleSelection() )
{
int wxVListBox::GetNextSelected(unsigned long& cookie) const
{
wxCHECK_MSG( m_selStore, wxNOT_FOUND,
- _T("GetFirst/NextSelected() may only be used with multiselection listboxes") );
+ wxT("GetFirst/NextSelected() may only be used with multiselection listboxes") );
while ( cookie < GetItemCount() )
{
wxVarScrollHelperBase::wxVarScrollHelperBase(wxWindow *win)
{
- wxASSERT_MSG( win, _T("associated window can't be NULL in wxVarScrollHelperBase") );
+ wxASSERT_MSG( win, wxT("associated window can't be NULL in wxVarScrollHelperBase") );
#if wxUSE_MOUSEWHEEL
m_sumWheelRotation = 0;
}
// unknown scroll event?
- wxFAIL_MSG( _T("unknown scroll event type?") );
+ wxFAIL_MSG( wxT("unknown scroll event type?") );
return 0;
}
void wxVarScrollHelperBase::RefreshUnits(size_t from, size_t to)
{
- wxASSERT_MSG( from <= to, _T("RefreshUnits(): empty range") );
+ wxASSERT_MSG( from <= to, wxT("RefreshUnits(): empty range") );
// clump the range to just the visible units -- it is useless to refresh
// the other ones
size_t fromColumn, size_t toColumn)
{
wxASSERT_MSG( fromRow <= toRow || fromColumn <= toColumn,
- _T("RefreshRowsColumns(): empty range") );
+ wxT("RefreshRowsColumns(): empty range") );
// clump the range to just the visible units -- it is useless to refresh
// the other ones
wxCoord wxVarVScrollLegacyAdaptor::OnGetLineHeight(size_t WXUNUSED(n)) const
{
- wxFAIL_MSG( _T("OnGetLineHeight() must be overridden if OnGetRowHeight() isn't!") );
+ wxFAIL_MSG( wxT("OnGetLineHeight() must be overridden if OnGetRowHeight() isn't!") );
return -1;
}
void wxWizard::AddBackNextPair(wxBoxSizer *buttonRow)
{
wxASSERT_MSG( m_btnNext && m_btnPrev,
- _T("You must create the buttons before calling ")
- _T("wxWizard::AddBackNextPair") );
+ wxT("You must create the buttons before calling ")
+ wxT("wxWizard::AddBackNextPair") );
// margin between Back and Next buttons
#ifdef __WXMAC__
(event.GetEventObject() == m_btnPrev),
wxT("unknown button") );
- wxCHECK_RET( m_page, _T("should have a valid current page") );
+ wxCHECK_RET( m_page, wxT("should have a valid current page") );
// ask the current page first: notice that we do it before calling
// GetNext/Prev() because the data transfered from the controls of the page
const size_t count = translators.size();
for ( size_t n = 0; n < count; n++ )
{
- transCredits << translators[n] << _T('\n');
+ transCredits << translators[n] << wxT('\n');
}
}
else // no translators explicitely specified
// (1) this variable exists for the sole purpose of specifying the encoding
// of the filenames for GTK+ programs, so use it if it is set
- wxString encName(wxGetenv(_T("G_FILENAME_ENCODING")));
- encName = encName.BeforeFirst(_T(','));
- if (encName.CmpNoCase(_T("@locale")) == 0)
+ wxString encName(wxGetenv(wxT("G_FILENAME_ENCODING")));
+ encName = encName.BeforeFirst(wxT(','));
+ if (encName.CmpNoCase(wxT("@locale")) == 0)
encName.clear();
encName.MakeUpper();
#if wxUSE_INTL
// filenames in this locale too
encName = wxLocale::GetSystemEncodingName().Upper();
// (3) finally use UTF-8 by default
- if (encName.empty() || encName == _T("US-ASCII"))
- encName = _T("UTF-8");
- wxSetEnv(_T("G_FILENAME_ENCODING"), encName);
+ if (encName.empty() || encName == wxT("US-ASCII"))
+ encName = wxT("UTF-8");
+ wxSetEnv(wxT("G_FILENAME_ENCODING"), encName);
}
#else
if (encName.empty())
- encName = _T("UTF-8");
+ encName = wxT("UTF-8");
// if wxUSE_INTL==0 it probably indicates that only "C" locale is supported
// by the program anyhow so prevent GTK+ from calling setlocale(LC_ALL, "")
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->m_style;
}
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_colour;
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
return &M_BRUSHDATA->m_stipple;
}
}
else
{
- wxFAIL_MSG(_T("3state wxCheckBox in unexpected state!"));
+ wxFAIL_MSG(wxT("3state wxCheckBox in unexpected state!"));
}
cb->GTKEnableEvents();
wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid control") );
wxASSERT_MSG( !IsSorted() || (pos == GetCount()),
- _T("In a sorted choice data could only be appended"));
+ wxT("In a sorted choice data could only be appended"));
const int count = items.GetCount();
void wxChoice::DoDeleteOneItem(unsigned int n)
{
wxCHECK_RET( m_widget != NULL, wxT("invalid control") );
- wxCHECK_RET( IsValid(n), _T("invalid index in wxChoice::Delete") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxChoice::Delete") );
GtkComboBox* combobox = GTK_COMBO_BOX( m_widget );
GtkTreeModel* model = gtk_combo_box_get_model( combobox );
// the trace mask we use with wxLogTrace() - call
// wxLog::AddTraceMask(TRACE_CLIPBOARD) to enable the trace messages from here
// (there will be a *lot* of them!)
-#define TRACE_CLIPBOARD _T("clipboard")
+#define TRACE_CLIPBOARD wxT("clipboard")
// ----------------------------------------------------------------------------
// wxClipboardSync: used to perform clipboard operations synchronously
public:
wxClipboardSync(wxClipboard& clipboard)
{
- wxASSERT_MSG( !ms_clipboard, _T("reentrancy in clipboard code") );
+ wxASSERT_MSG( !ms_clipboard, wxT("reentrancy in clipboard code") );
ms_clipboard = &clipboard;
}
static void OnDone(wxClipboard * WXUNUSED_UNLESS_DEBUG(clipboard))
{
wxASSERT_MSG( clipboard == ms_clipboard,
- _T("got notification for alien clipboard") );
+ wxT("got notification for alien clipboard") );
ms_clipboard = NULL;
}
if ( strcmp(wxGtkString(gdk_atom_name(type)), "TARGETS") != 0 )
{
wxLogTrace( TRACE_CLIPBOARD,
- _T("got unsupported clipboard target") );
+ wxT("got unsupported clipboard target") );
return;
}
(guchar*)&(timestamp),
sizeof(timestamp));
wxLogTrace(TRACE_CLIPBOARD,
- _T("Clipboard TIMESTAMP requested, returning timestamp=%u"),
+ wxT("Clipboard TIMESTAMP requested, returning timestamp=%u"),
timestamp);
return;
}
wxDataFormat format( selection_data->target );
wxLogTrace(TRACE_CLIPBOARD,
- _T("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"),
+ wxT("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"),
format.GetId().c_str(),
wxString::FromAscii(wxGtkString(gdk_atom_name(selection_data->target))).c_str(),
wxString::FromAscii(wxGtkString(gdk_atom_name(selection_data->type))).c_str(),
void wxClipboard::GTKOnSelectionReceived(const GtkSelectionData& sel)
{
- wxCHECK_RET( m_receivedData, _T("should be inside GetData()") );
+ wxCHECK_RET( m_receivedData, wxT("should be inside GetData()") );
const wxDataFormat format(sel.target);
- wxLogTrace(TRACE_CLIPBOARD, _T("Received selection %s"),
+ wxLogTrace(TRACE_CLIPBOARD, wxT("Received selection %s"),
format.GetId().c_str());
if ( !m_receivedData->IsSupportedFormat(format) )
if ( strcmp(wxGtkString(gdk_atom_name(type)), "TARGETS") != 0 )
{
wxLogTrace( TRACE_CLIPBOARD,
- _T("got unsupported clipboard target") );
+ wxT("got unsupported clipboard target") );
clipboard->m_sink->QueueEvent( event );
clipboard->m_sink.Release();
if ( !rc )
{
- wxLogTrace(TRACE_CLIPBOARD, _T("Failed to %sset selection owner"),
- set ? _T("") : _T("un"));
+ wxLogTrace(TRACE_CLIPBOARD, wxT("Failed to %sset selection owner"),
+ set ? wxT("") : wxT("un"));
}
return rc;
switch (result)
{
default:
- wxFAIL_MSG(_T("unexpected GtkColorSelectionDialog return code"));
+ wxFAIL_MSG(wxT("unexpected GtkColorSelectionDialog return code"));
// fall through
case GTK_RESPONSE_CANCEL:
else
{
gtype = G_TYPE_STRING;
- // wxFAIL_MSG( _T("non-string columns not supported yet") );
+ // wxFAIL_MSG( wxT("non-string columns not supported yet") );
}
return gtype;
}
else
{
- wxFAIL_MSG( _T("non-string columns not supported yet") );
+ wxFAIL_MSG( wxT("non-string columns not supported yet") );
}
}
void wxWindowDCImpl::DoGetSize( int* width, int* height ) const
{
- wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") );
+ wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") );
m_window->GetSize(width, height);
}
wxCoord wxWindowDCImpl::GetCharHeight() const
{
PangoFontMetrics *metrics = pango_context_get_metrics (m_context, m_fontdesc, pango_context_get_language(m_context));
- wxCHECK_MSG( metrics, -1, _T("failed to get pango font metrics") );
+ wxCHECK_MSG( metrics, -1, wxT("failed to get pango font metrics") );
wxCoord h = PANGO_PIXELS (pango_font_metrics_get_descent (metrics) +
pango_font_metrics_get_ascent (metrics));
wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *win )
: wxWindowDCImpl( owner, win )
{
- wxCHECK_RET( win, _T("NULL window in wxClientDCImpl::wxClientDC") );
+ wxCHECK_RET( win, wxT("NULL window in wxClientDCImpl::wxClientDC") );
#ifdef __WXUNIVERSAL__
wxPoint ptOrigin = win->GetClientAreaOrigin();
void wxClientDCImpl::DoGetSize(int *width, int *height) const
{
- wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") );
+ wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") );
m_window->GetClientSize( width, height );
}
GdkAtom format = drop_target->GtkGetMatchingPair();
// this does happen somehow, see bug 555111
- wxCHECK_MSG( format, FALSE, _T("no matching GdkAtom for format?") );
+ wxCHECK_MSG( format, FALSE, wxT("no matching GdkAtom for format?") );
/*
GdkDragAction action = GDK_ACTION_MOVE;
bool wxGUIEventLoop::Dispatch()
{
- wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") );
+ wxCHECK_MSG( IsRunning(), false, wxT("can't call Dispatch() if not running") );
// gtk_main_iteration() returns TRUE only if gtk_main_quit() was called
return !gtk_main_iteration();
else
{
// this is not supposed to happen!
- wxFAIL_MSG(_T("font is ok but no native font info?"));
+ wxFAIL_MSG(wxT("font is ok but no native font info?"));
}
}
void wxGauge::DoSetGauge()
{
wxASSERT_MSG( 0 <= m_gaugePos && m_gaugePos <= m_rangeMax,
- _T("invalid gauge position in DoSetGauge()") );
+ wxT("invalid gauge position in DoSetGauge()") );
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (m_widget),
m_rangeMax ? ((double)m_gaugePos)/m_rangeMax : 0.0);
void wxGauge::SetValue( int pos )
{
- wxCHECK_RET( pos <= m_rangeMax, _T("invalid value in wxGauge::SetValue()") );
+ wxCHECK_RET( pos <= m_rangeMax, wxT("invalid value in wxGauge::SetValue()") );
m_gaugePos = pos;
const int *attribList,
const wxPalette& WXUNUSED_UNLESS_DEBUG(palette))
{
- wxASSERT_MSG( !palette.IsOk(), _T("palettes not supported") );
+ wxASSERT_MSG( !palette.IsOk(), wxT("palettes not supported") );
m_exposed = false;
m_noExpose = true;
gint* pIntPath = gtk_tree_path_get_indices(path);
- wxCHECK_MSG( pIntPath, wxNOT_FOUND, _T("failed to get iterator path") );
+ wxCHECK_MSG( pIntPath, wxNOT_FOUND, wxT("failed to get iterator path") );
int idx = pIntPath[0];
// and update the model which will refresh the tree too
GtkTreeIter iter;
- wxCHECK_RET( GtkGetIteratorFor(n, &iter), _T("failed to get iterator") );
+ wxCHECK_RET( GtkGetIteratorFor(n, &iter), wxT("failed to get iterator") );
// FIXME: this resets the checked status of a wxCheckListBox item
break;
default:
- wxFAIL_MSG( _T("can't check this item") );
+ wxFAIL_MSG( wxT("can't check this item") );
}
}
{
GTKCreateMsgDialog();
wxCHECK_MSG( m_widget, wxID_CANCEL,
- _T("failed to create GtkMessageDialog") );
+ wxT("failed to create GtkMessageDialog") );
}
// This should be necessary, but otherwise the
switch (result)
{
default:
- wxFAIL_MSG(_T("unexpected GtkMessageDialog return code"));
+ wxFAIL_MSG(wxT("unexpected GtkMessageDialog return code"));
// fall through
case GTK_RESPONSE_CANCEL:
wxT("Can't add a page whose parent is not the notebook!") );
wxCHECK_MSG( position <= GetPageCount(), false,
- _T("invalid page index in wxNotebookPage::InsertPage()") );
+ wxT("invalid page index in wxNotebookPage::InsertPage()") );
// Hack Alert! (Part II): See above in wxNotebook::AddChildGTK
// why this has to be done.
bool wxRegion::DoUnionWithRegion( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+ wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoIntersect( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+ wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoSubtract( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+ wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoXor( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+ wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
if (!m_refData)
{
wxCoord wxRegionIterator::GetX() const
{
- wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") );
return m_rects[m_current].x;
}
wxCoord wxRegionIterator::GetY() const
{
- wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") );
return m_rects[m_current].y;
}
wxCoord wxRegionIterator::GetW() const
{
- wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") );
return m_rects[m_current].width;
}
wxCoord wxRegionIterator::GetH() const
{
- wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") );
return m_rects[m_current].height;
}
void wxScrollHelper::DoScroll( int x_pos, int y_pos )
{
- wxCHECK_RET( m_targetWindow != 0, _T("No target window") );
+ wxCHECK_RET( m_targetWindow != 0, wxT("No target window") );
DoScrollOneDir(wxHORIZONTAL, x_pos, m_xScrollPixelsPerLine, &m_xScrollPosition);
DoScrollOneDir(wxVERTICAL, y_pos, m_yScrollPixelsPerLine, &m_yScrollPosition);
case wxSYS_COLOUR_MAX:
default:
- wxFAIL_MSG( _T("unknown system colour index") );
+ wxFAIL_MSG( wxT("unknown system colour index") );
color = *wxWHITE;
break;
}
eventType = wxEVT_SCROLL_THUMBTRACK;
break;
default:
- wxFAIL_MSG(_T("Unknown GtkScrollType"));
+ wxFAIL_MSG(wxT("Unknown GtkScrollType"));
eventType = wxEVT_NULL;
break;
}
bool WXUNUSED(toggle))
{
// VZ: absolutely no idea about how to do it
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
}
// ----------------------------------------------------------------------------
wxCoord WXUNUSED(y)) const
{
// VZ: GTK+ doesn't seem to have such thing
- wxFAIL_MSG( _T("wxToolBar::FindToolForPosition() not implemented") );
+ wxFAIL_MSG( wxT("wxToolBar::FindToolForPosition() not implemented") );
return NULL;
}
const wxArrayInt& tabs = attr.GetTabs();
- wxString tagname = _T("WXTABS");
+ wxString tagname = wxT("WXTABS");
g_snprintf(buf, sizeof(buf), "WXTABS");
for (size_t i = 0; i < tabs.GetCount(); i++)
- tagname += wxString::Format(_T(" %d"), tabs[i]);
+ tagname += wxString::Format(wxT(" %d"), tabs[i]);
const wxWX2MBbuf buftag = tagname.utf8_str();
//
// TODO: it can be implemented much more efficiently for GTK2
wxASSERT_MSG( IsMultiLine(),
- _T("shouldn't be called for single line controls") );
+ wxT("shouldn't be called for single line controls") );
wxString value = GetValue();
if ( !value.empty() )
gint l = gtk_text_buffer_get_char_count( m_buffer );
wxCHECK_MSG( start >= 0 && end <= l, false,
- _T("invalid range in wxTextCtrl::SetStyle") );
+ wxT("invalid range in wxTextCtrl::SetStyle") );
GtkTextIter starti, endi;
gtk_text_buffer_get_iter_at_offset( m_buffer, &starti, start );
// we should only be called if we have a max len limit at all
GtkEntry *entry = GTK_ENTRY (editable);
- wxCHECK_RET( entry->text_max_length, _T("shouldn't be called") );
+ wxCHECK_RET( entry->text_max_length, wxT("shouldn't be called") );
// check that we don't overflow the max length limit
//
if ( !wxTimerImpl::Start(millisecs, oneShot) )
return false;
- wxASSERT_MSG( !m_sourceId, _T("shouldn't be still running") );
+ wxASSERT_MSG( !m_sourceId, wxT("shouldn't be still running") );
m_sourceId = g_timeout_add(m_milli, timeout_callback, this);
void wxGTKTimerImpl::Stop()
{
- wxASSERT_MSG( m_sourceId, _T("should be running") );
+ wxASSERT_MSG( m_sourceId, wxT("should be running") );
g_source_remove(m_sourceId);
m_sourceId = 0;
if (m_grabbed)
{
- wxFAIL_MSG(_T("Window still grabbed"));
+ wxFAIL_MSG(wxT("Window still grabbed"));
RemoveGrab();
}
bool wxTopLevelWindowGTK::SetShape(const wxRegion& region)
{
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
- _T("Shaped windows must be created with the wxFRAME_SHAPED style."));
+ wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
if ( GTK_WIDGET_REALIZED(m_widget) )
{
break;
default:
- wxFAIL_MSG( _T("unexpected return code from GtkAssertDialog") );
+ wxFAIL_MSG( wxT("unexpected return code from GtkAssertDialog") );
}
gtk_widget_destroy(dialog);
wxString wxGUIAppTraits::GetDesktopEnvironment() const
{
- wxString de = wxSystemOptions::GetOption(_T("gtk.desktop"));
+ wxString de = wxSystemOptions::GetOption(wxT("gtk.desktop"));
#if wxUSE_DETECT_SM
if ( de.empty() )
{
wxString ret;
if (opt->short_name)
- ret << _T("-") << opt->short_name;
+ ret << wxT("-") << opt->short_name;
if (opt->long_name)
{
if (!ret.empty())
- ret << _T(", ");
- ret << _T("--") << opt->long_name;
+ ret << wxT(", ");
+ ret << wxT("--") << opt->long_name;
if (opt->arg_description)
- ret << _T("=") << opt->arg_description;
+ ret << wxT("=") << opt->arg_description;
}
- return _T(" ") + ret;
+ return wxT(" ") + ret;
}
#endif // __WXGTK26__
//-----------------------------------------------------------------------------
// the trace mask used for the focus debugging messages
-#define TRACE_FOCUS _T("focus")
+#define TRACE_FOCUS wxT("focus")
//-----------------------------------------------------------------------------
// missing gdk functions
// set WXTRACE to this to see the key event codes on the console
-#define TRACE_KEYS _T("keyevent")
+#define TRACE_KEYS wxT("keyevent")
// translates an X key symbol to WXK_XXX value
//
KeySym keysym = gdk_event->keyval;
- wxLogTrace(TRACE_KEYS, _T("Key %s event: keysym = %ld"),
- event.GetEventType() == wxEVT_KEY_UP ? _T("release")
- : _T("press"),
+ wxLogTrace(TRACE_KEYS, wxT("Key %s event: keysym = %ld"),
+ event.GetEventType() == wxEVT_KEY_UP ? wxT("release")
+ : wxT("press"),
keysym);
long key_code = wxTranslateKeySymToWXKey(keysym, false /* !isChar */);
Display *dpy = (Display *)wxGetDisplay();
KeyCode keycode = XKeysymToKeycode(dpy, keysym);
- wxLogTrace(TRACE_KEYS, _T("\t-> keycode %d"), keycode);
+ wxLogTrace(TRACE_KEYS, wxT("\t-> keycode %d"), keycode);
KeySym keysymNormalized = XKeycodeToKeysym(dpy, keycode, 0);
}
}
- wxLogTrace(TRACE_KEYS, _T("\t-> wxKeyCode %ld"), key_code);
+ wxLogTrace(TRACE_KEYS, wxT("\t-> wxKeyCode %ld"), key_code);
// sending unknown key events doesn't really make sense
if ( !key_code )
win->m_imData->lastKeyEvent = NULL;
if (intercepted_by_IM)
{
- wxLogTrace(TRACE_KEYS, _T("Key event intercepted by IM"));
+ wxLogTrace(TRACE_KEYS, wxT("Key event intercepted by IM"));
return TRUE;
}
}
if ( key_code )
{
- wxLogTrace(TRACE_KEYS, _T("Char event: %ld"), key_code);
+ wxLogTrace(TRACE_KEYS, wxT("Char event: %ld"), key_code);
event.m_keyCode = key_code;
event.m_uniChar = *pstr;
// Backward compatible for ISO-8859-1
event.m_keyCode = *pstr < 256 ? event.m_uniChar : 0;
- wxLogTrace(TRACE_KEYS, _T("IM sent character '%c'"), event.m_uniChar);
+ wxLogTrace(TRACE_KEYS, wxT("IM sent character '%c'"), event.m_uniChar);
#else
event.m_keyCode = (char)*pstr;
#endif // wxUSE_UNICODE
!GTK_WIDGET_CAN_FOCUS(widget) )
{
wxLogTrace(TRACE_FOCUS,
- _T("Setting focus to a child of %s(%p, %s)"),
+ wxT("Setting focus to a child of %s(%p, %s)"),
GetClassInfo()->GetClassName(), this, GetLabel().c_str());
gtk_widget_child_focus(widget, GTK_DIR_TAB_FORWARD);
}
else
{
wxLogTrace(TRACE_FOCUS,
- _T("Setting focus to %s(%p, %s)"),
+ wxT("Setting focus to %s(%p, %s)"),
GetClassInfo()->GetClassName(), this, GetLabel().c_str());
gtk_widget_grab_focus(widget);
}
/* static */
void wxWindowGTK::GTKSetLayout(GtkWidget *widget, wxLayoutDirection dir)
{
- wxASSERT_MSG( dir != wxLayout_Default, _T("invalid layout direction") );
+ wxASSERT_MSG( dir != wxLayout_Default, wxT("invalid layout direction") );
gtk_widget_set_direction(widget,
dir == wxLayout_RightToLeft ? GTK_TEXT_DIR_RTL
{
if ( flags & wxNavigationKeyEvent::WinChange )
{
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
return false;
}
else // navigate inside the container
{
wxWindow *parent = wxGetTopLevelParent((wxWindow *)this);
- wxCHECK_MSG( parent, false, _T("every window must have a TLW parent") );
+ wxCHECK_MSG( parent, false, wxT("every window must have a TLW parent") );
GtkDirectionType dir;
dir = flags & wxNavigationKeyEvent::IsForward ? GTK_DIR_TAB_FORWARD
GdkWindow *win = windowsThis[n];
if ( !win )
{
- wxFAIL_MSG(_T("NULL window returned by GTKGetWindow()?"));
+ wxFAIL_MSG(wxT("NULL window returned by GTKGetWindow()?"));
continue;
}
return (ScrollDir)dir;
}
- wxFAIL_MSG( _T("event from unknown scrollbar received") );
+ wxFAIL_MSG( wxT("event from unknown scrollbar received") );
return ScrollDir_Max;
}
else
window = GetConnectWidget()->window;
- wxCHECK_RET( window, _T("CaptureMouse() failed") );
+ wxCHECK_RET( window, wxT("CaptureMouse() failed") );
const wxCursor* cursor = &m_cursor;
if (!cursor->Ok())
{
const int dir = ScrollDirFromOrient(orient);
GtkRange* const sb = m_scrollBar[dir];
- wxCHECK_RET( sb, _T("this window is not scrollable") );
+ wxCHECK_RET( sb, wxT("this window is not scrollable") );
if (range <= 0)
{
{
const int dir = ScrollDirFromOrient(orient);
GtkRange * const sb = m_scrollBar[dir];
- wxCHECK_RET( sb, _T("this window is not scrollable") );
+ wxCHECK_RET( sb, wxT("this window is not scrollable") );
// This check is more than an optimization. Without it, the slider
// will not move smoothly while tracking when using wxScrollHelper.
int wxWindowGTK::GetScrollThumb(int orient) const
{
GtkRange * const sb = m_scrollBar[ScrollDirFromOrient(orient)];
- wxCHECK_MSG( sb, 0, _T("this window is not scrollable") );
+ wxCHECK_MSG( sb, 0, wxT("this window is not scrollable") );
return wxRound(sb->adjustment->page_size);
}
int wxWindowGTK::GetScrollPos( int orient ) const
{
GtkRange * const sb = m_scrollBar[ScrollDirFromOrient(orient)];
- wxCHECK_MSG( sb, 0, _T("this window is not scrollable") );
+ wxCHECK_MSG( sb, 0, wxT("this window is not scrollable") );
return wxRound(sb->adjustment->value);
}
int wxWindowGTK::GetScrollRange( int orient ) const
{
GtkRange * const sb = m_scrollBar[ScrollDirFromOrient(orient)];
- wxCHECK_MSG( sb, 0, _T("this window is not scrollable") );
+ wxCHECK_MSG( sb, 0, wxT("this window is not scrollable") );
return wxRound(sb->adjustment->upper);
}
unsigned int i;
for ( i = 0; i < nfds; i++ )
{
- wxASSERT_MSG( ufds[i].fd < FD_SETSIZE, _T("fd out of range") );
+ wxASSERT_MSG( ufds[i].fd < FD_SETSIZE, wxT("fd out of range") );
if ( ufds[i].events & G_IO_IN )
wxFD_SET(ufds[i].fd, &readfds);
#if wxUSE_PALETTE
wxASSERT_MSG( !data.m_palette,
- _T("copying bitmaps palette not implemented") );
+ wxT("copying bitmaps palette not implemented") );
#endif // wxUSE_PALETTE
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->m_style;
}
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_colour;
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
return &M_BRUSHDATA->m_stipple;
}
{
wxCHECK_RET( m_widget != NULL, wxT("invalid choice") );
- wxCHECK_RET( IsValid(n), _T("invalid index in wxChoice::Delete") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxChoice::Delete") );
// if the item to delete is before the selection, and the selection is valid
if (((int)n < m_selection_hack) && (m_selection_hack != wxNOT_FOUND))
if ( strcmp(atom_name, "TARGETS") )
{
wxLogTrace( TRACE_CLIPBOARD,
- _T("got unsupported clipboard target") );
+ wxT("got unsupported clipboard target") );
clipboard->m_waiting = false;
g_free(atom_name);
(guchar*)&(timestamp),
sizeof(timestamp));
wxLogTrace(TRACE_CLIPBOARD,
- _T("Clipboard TIMESTAMP requested, returning timestamp=%u"),
+ wxT("Clipboard TIMESTAMP requested, returning timestamp=%u"),
timestamp);
return;
}
wxDataFormat format( selection_data->target );
wxLogTrace(TRACE_CLIPBOARD,
- _T("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"),
+ wxT("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"),
format.GetId().c_str(),
wxString::FromAscii(gdk_atom_name(selection_data->target)).c_str(),
wxString::FromAscii(gdk_atom_name(selection_data->type)).c_str(),
{
wxChar ch = label[i];
- if ( ch == _T('&') )
+ if ( ch == wxT('&') )
{
if ( i == len - 1 )
{
}
ch = label[++i]; // skip '&' itself
- if ( ch == _T('&') )
+ if ( ch == wxT('&') )
{
// special case: "&&" is not a mnemonic at all but just an
// escaped "&"
if ( (*p == '\r' && *(p+1) == '\n') || !*p )
{
size_t lenPrefix = 5; // strlen("file:")
- if ( filename.Left(lenPrefix).MakeLower() == _T("file:") )
+ if ( filename.Left(lenPrefix).MakeLower() == wxT("file:") )
{
// sometimes the syntax is "file:filename", sometimes it's
// URL-like: "file://filename" - deal with both
- if ( filename[lenPrefix] == _T('/') &&
- filename[lenPrefix + 1] == _T('/') )
+ if ( filename[lenPrefix] == wxT('/') &&
+ filename[lenPrefix + 1] == wxT('/') )
{
// skip the slashes
lenPrefix += 2;
}
else
{
- wxLogDebug(_T("Unsupported URI '%s' in wxFileDataObject"),
+ wxLogDebug(wxT("Unsupported URI '%s' in wxFileDataObject"),
filename.c_str());
}
gint width,
gint height)
{
- wxCHECK_RET( drawable, _T("NULL drawable in gdk_wx_draw_bitmap") );
- wxCHECK_RET( src, _T("NULL src in gdk_wx_draw_bitmap") );
- wxCHECK_RET( gc, _T("NULL gc in gdk_wx_draw_bitmap") );
+ wxCHECK_RET( drawable, wxT("NULL drawable in gdk_wx_draw_bitmap") );
+ wxCHECK_RET( src, wxT("NULL src in gdk_wx_draw_bitmap") );
+ wxCHECK_RET( gc, wxT("NULL gc in gdk_wx_draw_bitmap") );
GdkWindowPrivate *drawable_private;
GdkWindowPrivate *src_private;
void wxWindowDCImpl::DoGetSize( int* width, int* height ) const
{
- wxCHECK_RET( m_owner, _T("GetSize() doesn't work without window") );
+ wxCHECK_RET( m_owner, wxT("GetSize() doesn't work without window") );
m_owner->GetSize(width, height);
}
wxClientDCImpl::wxClientDCImpl(wxDC *owner, wxWindow *win)
: wxWindowDCImpl(owner, win)
{
- wxCHECK_RET( win, _T("NULL window in wxClientDCImpl::wxClientDCImpl") );
+ wxCHECK_RET( win, wxT("NULL window in wxClientDCImpl::wxClientDCImpl") );
#ifdef __WXUNIVERSAL__
wxPoint ptOrigin = win->GetClientAreaOrigin();
void wxClientDCImpl::DoGetSize(int *width, int *height) const
{
- wxCHECK_RET( m_owner, _T("GetSize() doesn't work without window") );
+ wxCHECK_RET( m_owner, wxT("GetSize() doesn't work without window") );
m_owner->GetClientSize( width, height );
}
// the trace mask we use with wxLogTrace() - call
// wxLog::AddTraceMask(TRACE_DND) to enable the trace messages from here
// (there are quite a few of them, so don't enable this by default)
-#define TRACE_DND _T("dnd")
+#define TRACE_DND wxT("dnd")
// global variables because GTK+ DnD want to have the
// mouse event that caused it
GdkAtom format = drop_target->GetMatchingPair();
// this does happen somehow, see bug 555111
- wxCHECK_MSG( format, FALSE, _T("no matching GdkAtom for format?") );
+ wxCHECK_MSG( format, FALSE, wxT("no matching GdkAtom for format?") );
/*
GdkDragAction action = GDK_ACTION_MOVE;
wxGUIEventLoop::~wxGUIEventLoop()
{
- wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") );
+ wxASSERT_MSG( !m_impl, wxT("should have been deleted in Run()") );
}
int wxGUIEventLoop::Run()
{
// event loops are not recursive, you need to create another loop!
- wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") );
+ wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") );
wxEventLoopActivator activate(this);
void wxGUIEventLoop::Exit(int rc)
{
- wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") );
+ wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") );
m_impl->SetExitCode(rc);
bool wxGUIEventLoop::Dispatch()
{
- wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") );
+ wxCHECK_MSG( IsRunning(), false, wxT("can't call Dispatch() if not running") );
gtk_main_iteration();
m_weight = wxFONTWEIGHT_NORMAL;
wxString w = m_nativeFontInfo.GetXFontComponent(wxXLFD_WEIGHT).Upper();
- if ( !w.empty() && w != _T('*') )
+ if ( !w.empty() && w != wxT('*') )
{
// the test below catches all of BOLD, EXTRABOLD, DEMIBOLD, ULTRABOLD
// and BLACK
- if ( ((w[0u] == _T('B') && (!wxStrcmp(w.c_str() + 1, wxT("OLD")) ||
+ if ( ((w[0u] == wxT('B') && (!wxStrcmp(w.c_str() + 1, wxT("OLD")) ||
!wxStrcmp(w.c_str() + 1, wxT("LACK"))))) ||
- wxStrstr(w.c_str() + 1, _T("BOLD")) )
+ wxStrstr(w.c_str() + 1, wxT("BOLD")) )
{
m_weight = wxFONTWEIGHT_BOLD;
}
- else if ( w == _T("LIGHT") || w == _T("THIN") )
+ else if ( w == wxT("LIGHT") || w == wxT("THIN") )
{
m_weight = wxFONTWEIGHT_LIGHT;
}
switch ( wxToupper(m_nativeFontInfo.
GetXFontComponent(wxXLFD_SLANT)[0u]).GetValue() )
{
- case _T('I'): // italique
+ case wxT('I'): // italique
m_style = wxFONTSTYLE_ITALIC;
break;
- case _T('O'): // oblique
+ case wxT('O'): // oblique
m_style = wxFONTSTYLE_SLANT;
break;
// examine the spacing: if the font is monospaced, assume wxTELETYPE
// family for compatibility with the old code which used it instead of
// IsFixedWidth()
- if ( m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING).Upper() == _T('M') )
+ if ( m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING).Upper() == wxT('M') )
{
m_family = wxFONTFAMILY_TELETYPE;
}
registry = m_nativeFontInfo.GetXFontComponent(wxXLFD_REGISTRY).Upper(),
encoding = m_nativeFontInfo.GetXFontComponent(wxXLFD_ENCODING).Upper();
- if ( registry == _T("ISO8859") )
+ if ( registry == wxT("ISO8859") )
{
int cp;
if ( wxSscanf(encoding, wxT("%d"), &cp) == 1 )
m_encoding = (wxFontEncoding)(wxFONTENCODING_ISO8859_1 + cp - 1);
}
}
- else if ( registry == _T("MICROSOFT") )
+ else if ( registry == wxT("MICROSOFT") )
{
int cp;
if ( wxSscanf(encoding, wxT("cp125%d"), &cp) == 1 )
m_encoding = (wxFontEncoding)(wxFONTENCODING_CP1250 + cp);
}
}
- else if ( registry == _T("KOI8") )
+ else if ( registry == wxT("KOI8") )
{
m_encoding = wxFONTENCODING_KOI8;
}
{
wxString size;
if ( pointSize == -1 )
- size = _T('*');
+ size = wxT('*');
else
- size.Printf(_T("%d"), 10*pointSize);
+ size.Printf(wxT("%d"), 10*pointSize);
m_nativeFontInfo.SetXFontComponent(wxXLFD_POINTSIZE, size);
}
switch ( style )
{
case wxFONTSTYLE_ITALIC:
- slant = _T('i');
+ slant = wxT('i');
break;
case wxFONTSTYLE_SLANT:
- slant = _T('o');
+ slant = wxT('o');
break;
default:
- wxFAIL_MSG( _T("unknown font style") );
+ wxFAIL_MSG( wxT("unknown font style") );
// fall through
case wxFONTSTYLE_NORMAL:
- slant = _T('r');
+ slant = wxT('r');
}
m_nativeFontInfo.SetXFontComponent(wxXLFD_SLANT, slant);
switch ( weight )
{
case wxFONTWEIGHT_BOLD:
- boldness = _T("bold");
+ boldness = wxT("bold");
break;
case wxFONTWEIGHT_LIGHT:
- boldness = _T("light");
+ boldness = wxT("light");
break;
default:
- wxFAIL_MSG( _T("unknown font weight") );
+ wxFAIL_MSG( wxT("unknown font weight") );
// fall through
case wxFONTWEIGHT_NORMAL:
// unspecified
- boldness = _T("medium");
+ boldness = wxT("medium");
}
m_nativeFontInfo.SetXFontComponent(wxXLFD_WEIGHT, boldness);
wxString spacing = M_FONTDATA->
m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING);
- return spacing.Upper() == _T('M');
+ return spacing.Upper() == wxT('M');
}
return wxFontBase::IsFixedWidth();
else
{
// this is not supposed to happen!
- wxFAIL_MSG(_T("font is ok but no native font info?"));
+ wxFAIL_MSG(wxT("font is ok but no native font info?"));
}
}
void wxGauge::DoSetGauge()
{
wxASSERT_MSG( 0 <= m_gaugePos && m_gaugePos <= m_rangeMax,
- _T("invalid gauge position in DoSetGauge()") );
+ wxT("invalid gauge position in DoSetGauge()") );
gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget),
m_rangeMax ? ((float)m_gaugePos)/m_rangeMax : 0.);
void wxGauge::SetValue( int pos )
{
- wxCHECK_RET( pos <= m_rangeMax, _T("invalid value in wxGauge::SetValue()") );
+ wxCHECK_RET( pos <= m_rangeMax, wxT("invalid value in wxGauge::SetValue()") );
m_gaugePos = pos;
{
wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
- wxASSERT_MSG( child_frame, _T("child is not a wxMDIChildFrame") );
+ wxASSERT_MSG( child_frame, wxT("child is not a wxMDIChildFrame") );
if (child_frame->m_page == page)
return child_frame;
/* should find it for normal (not popup) menu */
wxASSERT_MSG( (id != -1) || (menu->GetInvokingWindow() != NULL),
- _T("menu item not found in gtk_menu_clicked_callback") );
+ wxT("menu item not found in gtk_menu_clicked_callback") );
if (!menu->IsEnabled(id))
return;
break;
default:
- wxFAIL_MSG( _T("can't check this item") );
+ wxFAIL_MSG( wxT("can't check this item") );
}
}
}
default:
- wxFAIL_MSG( _T("unexpected menu item kind") );
+ wxFAIL_MSG( wxT("unexpected menu item kind") );
// fall through
case wxITEM_NORMAL:
// are you trying to call SetSelection() from a notebook event handler?
// you shouldn't!
wxCHECK_RET( !notebook->m_inSwitchPage,
- _T("gtk_notebook_page_change_callback reentered") );
+ wxT("gtk_notebook_page_change_callback reentered") );
notebook->m_inSwitchPage = true;
if (g_isIdle)
if (sel == -1)
return TRUE;
wxGtkNotebookPage *nb_page = notebook->GetNotebookPage(sel);
- wxCHECK_MSG( nb_page, FALSE, _T("invalid selection in wxNotebook") );
+ wxCHECK_MSG( nb_page, FALSE, wxT("invalid selection in wxNotebook") );
wxNavigationKeyEvent event;
event.SetEventObject( notebook );
while (m_pagesData.GetCount() > 0)
DeletePage( m_pagesData.GetCount()-1 );
- wxASSERT_MSG( GetPageCount() == 0, _T("all pages must have been deleted") );
+ wxASSERT_MSG( GetPageCount() == 0, wxT("all pages must have been deleted") );
InvalidateBestSize();
return wxNotebookBase::DeleteAllPages();
wxT("Can't add a page whose parent is not the notebook!") );
wxCHECK_MSG( position <= GetPageCount(), FALSE,
- _T("invalid page index in wxNotebookPage::InsertPage()") );
+ wxT("invalid page index in wxNotebookPage::InsertPage()") );
// Hack Alert! (Part II): See above in wxInsertChildInNotebook callback
// why this has to be done. NOTE: using gtk_widget_unparent here does not
GdkEvent *WXUNUSED(event),
wxRadioBox *win )
{
- // wxASSERT_MSG( win->m_hasFocus, _T("got focus out without any focus in?") );
+ // wxASSERT_MSG( win->m_hasFocus, wxT("got focus out without any focus in?") );
// Replace with a warning, else we dump core a lot!
// if (!win->m_hasFocus)
- // wxLogWarning(_T("Radiobox got focus out without any focus in.") );
+ // wxLogWarning(wxT("Radiobox got focus out without any focus in.") );
// we might have lost the focus, but may be not - it may have just gone to
// another button in the same radiobox, so we'll check for it in the next
bool wxRegion::DoIntersect( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+ wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoSubtract( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+ wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoXor( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+ wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
if (!m_refData)
{
wxCoord wxRegionIterator::GetX() const
{
- wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") );
return ((wxRIRefData*)m_refData)->m_rects[m_current].x;
}
wxCoord wxRegionIterator::GetY() const
{
- wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") );
return ((wxRIRefData*)m_refData)->m_rects[m_current].y;
}
wxCoord wxRegionIterator::GetW() const
{
- wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") );
return ((wxRIRefData*)m_refData)->m_rects[m_current].width;
}
wxCoord wxRegionIterator::GetH() const
{
- wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") );
return ((wxRIRefData*)m_refData)->m_rects[m_current].height;
}
void wxScrollHelper::DoScroll( int x_pos, int y_pos )
{
- wxCHECK_RET( m_targetWindow != 0, _T("No target window") );
+ wxCHECK_RET( m_targetWindow != 0, wxT("No target window") );
DoScrollOneDir(wxHORIZONTAL, m_win->m_hAdjust, x_pos, m_xScrollPixelsPerLine,
&m_xScrollPosition);
switch ( type )
{
default:
- wxFAIL_MSG( _T("unexpected GTK widget type") );
+ wxFAIL_MSG( wxT("unexpected GTK widget type") );
// fall through
case wxGTK_BUTTON:
switch ( colour )
{
default:
- wxFAIL_MSG( _T("unexpected GTK colour type") );
+ wxFAIL_MSG( wxT("unexpected GTK colour type") );
// fall through
case wxGTK_FG:
case wxSYS_COLOUR_MAX:
default:
- wxFAIL_MSG( _T("unknown system colour index") );
+ wxFAIL_MSG( wxT("unknown system colour index") );
}
return *wxWHITE;
return GTK_TOOLBAR_CHILD_RADIOBUTTON;
default:
- wxFAIL_MSG( _T("unknown toolbar child type") );
+ wxFAIL_MSG( wxT("unknown toolbar child type") );
// fall through
case wxITEM_NORMAL:
if ( !tool->m_item )
{
- wxFAIL_MSG( _T("gtk_toolbar_insert_element() failed") );
+ wxFAIL_MSG( wxT("gtk_toolbar_insert_element() failed") );
return false;
}
bool WXUNUSED(toggle))
{
// VZ: absolutely no idea about how to do it
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
}
// ----------------------------------------------------------------------------
wxCoord WXUNUSED(y)) const
{
// VZ: GTK+ doesn't seem to have such thing
- wxFAIL_MSG( _T("wxToolBar::FindToolForPosition() not implemented") );
+ wxFAIL_MSG( wxT("wxToolBar::FindToolForPosition() not implemented") );
return NULL;
}
// we should only be called if we have a max len limit at all
GtkEntry *entry = GTK_ENTRY (editable);
- wxCHECK_RET( entry->text_max_length, _T("shouldn't be called") );
+ wxCHECK_RET( entry->text_max_length, wxT("shouldn't be called") );
// check that we don't overflow the max length limit
//
if ( loop && !loop->IsYielding() )
{
wxCHECK_RET( gs_gtk_text_draw != wxgtk_text_draw,
- _T("infinite recursion in wxgtk_text_draw aborted") );
+ wxT("infinite recursion in wxgtk_text_draw aborted") );
gs_gtk_text_draw(widget, rect);
}
!GTK_TEXT(m_text)->line_start_cache )
{
// tell the programmer that it didn't work
- wxLogDebug(_T("Can't call SetSelection() before realizing the control"));
+ wxLogDebug(wxT("Can't call SetSelection() before realizing the control"));
return;
}
// possible!
wxASSERT_MSG( (m_windowStyle & wxTE_MULTILINE) && m_updateFont,
- _T("shouldn't be called for single line controls") );
+ wxT("shouldn't be called for single line controls") );
wxString value = GetValue();
if ( !value.empty() )
gint l = gtk_text_get_length( GTK_TEXT(m_text) );
wxCHECK_MSG( start >= 0 && end <= l, false,
- _T("invalid range in wxTextCtrl::SetStyle") );
+ wxT("invalid range in wxTextCtrl::SetStyle") );
gint old_pos = gtk_editable_get_position( GTK_EDITABLE(m_text) );
char *text = gtk_editable_get_chars( GTK_EDITABLE(m_text), start, end );
if ( !wxTimerImpl::Start(millisecs, oneShot) )
return false;
- wxASSERT_MSG( m_tag == -1, _T("shouldn't be still running") );
+ wxASSERT_MSG( m_tag == -1, wxT("shouldn't be still running") );
m_tag = gtk_timeout_add( m_milli, timeout_callback, this );
void wxGTKTimerImpl::Stop()
{
- wxASSERT_MSG( m_tag != -1, _T("should be running") );
+ wxASSERT_MSG( m_tag != -1, wxT("should be running") );
gtk_timeout_remove( m_tag );
m_tag = -1;
{
if (m_grabbed)
{
- wxASSERT_MSG( false, _T("Window still grabbed"));
+ wxASSERT_MSG( false, wxT("Window still grabbed"));
RemoveGrab();
}
if ( g_delayedFocus &&
wxGetTopLevelParent((wxWindow*)g_delayedFocus) == this )
{
- wxLogTrace(_T("focus"),
- _T("Setting focus from wxTLW::OnIdle() to %s(%s)"),
+ wxLogTrace(wxT("focus"),
+ wxT("Setting focus from wxTLW::OnIdle() to %s(%s)"),
g_delayedFocus->GetClassInfo()->GetClassName(),
g_delayedFocus->GetLabel().c_str());
void wxTopLevelWindowGTK::Maximize(bool WXUNUSED(maximize))
{
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
}
bool wxTopLevelWindowGTK::IsMaximized() const
{
- // wxFAIL_MSG( _T("not implemented") );
+ // wxFAIL_MSG( wxT("not implemented") );
// This is an approximation
return false;
void wxTopLevelWindowGTK::Restore()
{
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
}
void wxTopLevelWindowGTK::Iconize( bool iconize )
GdkWindow *window = m_widget->window;
// you should do it later, for example from OnCreate() handler
- wxCHECK_RET( window, _T("frame not created yet - can't iconize") );
+ wxCHECK_RET( window, wxT("frame not created yet - can't iconize") );
XIconifyWindow( GDK_WINDOW_XDISPLAY( window ),
GDK_WINDOW_XWINDOW( window ),
bool wxTopLevelWindowGTK::SetShape(const wxRegion& region)
{
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
- _T("Shaped windows must be created with the wxFRAME_SHAPED style."));
+ wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
GdkWindow *window = NULL;
if (m_wxwindow)
#endif
// the trace mask used for the focus debugging messages
-#define TRACE_FOCUS _T("focus")
+#define TRACE_FOCUS wxT("focus")
//-----------------------------------------------------------------------------
// missing gdk functions
//-----------------------------------------------------------------------------
// set WXTRACE to this to see the key event codes on the console
-#define TRACE_KEYS _T("keyevent")
+#define TRACE_KEYS wxT("keyevent")
// translates an X key symbol to WXK_XXX value
//
KeySym keysym = gdk_event->keyval;
- wxLogTrace(TRACE_KEYS, _T("Key %s event: keysym = %ld"),
- event.GetEventType() == wxEVT_KEY_UP ? _T("release")
- : _T("press"),
+ wxLogTrace(TRACE_KEYS, wxT("Key %s event: keysym = %ld"),
+ event.GetEventType() == wxEVT_KEY_UP ? wxT("release")
+ : wxT("press"),
keysym);
long key_code = wxTranslateKeySymToWXKey(keysym, false /* !isChar */);
Display *dpy = (Display *)wxGetDisplay();
KeyCode keycode = XKeysymToKeycode(dpy, keysym);
- wxLogTrace(TRACE_KEYS, _T("\t-> keycode %d"), keycode);
+ wxLogTrace(TRACE_KEYS, wxT("\t-> keycode %d"), keycode);
KeySym keysymNormalized = XKeycodeToKeysym(dpy, keycode, 0);
}
}
- wxLogTrace(TRACE_KEYS, _T("\t-> wxKeyCode %ld"), key_code);
+ wxLogTrace(TRACE_KEYS, wxT("\t-> wxKeyCode %ld"), key_code);
// sending unknown key events doesn't really make sense
if ( !key_code )
if ( key_code )
{
- wxLogTrace(TRACE_KEYS, _T("Char event: %ld"), key_code);
+ wxLogTrace(TRACE_KEYS, wxT("Char event: %ld"), key_code);
event.m_keyCode = key_code;
g_focusWindow = win;
wxLogTrace(TRACE_FOCUS,
- _T("%s: focus in"), win->GetName().c_str());
+ wxT("%s: focus in"), win->GetName().c_str());
#ifdef HAVE_XIM
if (win->m_ic)
wxapp_install_idle_handler();
wxLogTrace( TRACE_FOCUS,
- _T("%s: focus out"), win->GetName().c_str() );
+ wxT("%s: focus out"), win->GetName().c_str() );
wxWindowGTK *winFocus = wxFindFocusedChild(win);
// it should be focused and will do it later, during the idle
// time, as soon as we can
wxLogTrace(TRACE_FOCUS,
- _T("Delaying setting focus to %s(%s)"),
+ wxT("Delaying setting focus to %s(%s)"),
GetClassInfo()->GetClassName(), GetLabel().c_str());
g_delayedFocus = this;
else
{
wxLogTrace(TRACE_FOCUS,
- _T("Setting focus to %s(%s)"),
+ wxT("Setting focus to %s(%s)"),
GetClassInfo()->GetClassName(), GetLabel().c_str());
gtk_widget_grab_focus (m_widget);
else
{
wxLogTrace(TRACE_FOCUS,
- _T("Can't set focus to %s(%s)"),
+ wxT("Can't set focus to %s(%s)"),
GetClassInfo()->GetClassName(), GetLabel().c_str());
}
}
else
window = GetConnectWidget()->window;
- wxCHECK_RET( window, _T("CaptureMouse() failed") );
+ wxCHECK_RET( window, wxT("CaptureMouse() failed") );
const wxCursor* cursor = &m_cursor;
if (!cursor->Ok())
{
m_chmFileName = archive.GetFullPath();
- wxASSERT_MSG( !m_chmFileName.empty(), _T("empty archive name") );
+ wxASSERT_MSG( !m_chmFileName.empty(), wxT("empty archive name") );
m_archive = NULL;
m_decompressor = NULL;
// if the file could not be located, but was *.hhp, than we create
// the content of the hhp-file on the fly and store it for reading
// by the application
- if ( m_fileName.Find(_T(".hhp")) != wxNOT_FOUND && m_simulateHHP )
+ if ( m_fileName.Find(wxT(".hhp")) != wxNOT_FOUND && m_simulateHHP )
{
// now we open an hhp-file
CreateHHPStream();
// Try to open the #SYSTEM-File and create the HHP File out of it
// see http://bonedaddy.net/pabs3/chmspec/0.1.2/Internal.html#SYSTEM
- if ( ! m_chm->Contains(_T("/#SYSTEM")) )
+ if ( ! m_chm->Contains(wxT("/#SYSTEM")) )
{
#ifdef DEBUG
wxLogDebug("Archive doesn't contain #SYSTEM file");
}
else
{
- file = wxFileName(_T("/#SYSTEM"));
+ file = wxFileName(wxT("/#SYSTEM"));
}
- if ( CreateFileStream(_T("/#SYSTEM")) )
+ if ( CreateFileStream(wxT("/#SYSTEM")) )
{
// New stream for writing a memory area to simulate the
// .hhp-file
wxUint32 dummy = *((wxUint32 *)(structptr+0)) ;
wxUint32 lcid = wxUINT32_SWAP_ON_BE( dummy ) ;
wxString msg ;
- msg.Printf(_T("Language=0x%X\r\n"),lcid) ;
+ msg.Printf(wxT("Language=0x%X\r\n"),lcid) ;
out->Write(msg.c_str() , msg.length() ) ;
}
break ;
free (m_content);
// Now add entries which are missing
- if ( !hhc && m_chm->Contains(_T("*.hhc")) )
+ if ( !hhc && m_chm->Contains(wxT("*.hhc")) )
{
tmp = "Contents File=*.hhc\r\n";
out->Write((const void *) tmp, strlen(tmp));
}
- if ( !hhk && m_chm->Contains(_T("*.hhk")) )
+ if ( !hhk && m_chm->Contains(wxT("*.hhk")) )
{
tmp = "Index File=*.hhk\r\n";
out->Write((const void *) tmp, strlen(tmp));
bool wxChmInputStream::CreateFileStream(const wxString& pattern)
{
wxFileInputStream * fin;
- wxString tmpfile = wxFileName::CreateTempFileName(_T("chmstrm"));
+ wxString tmpfile = wxFileName::CreateTempFileName(wxT("chmstrm"));
if ( tmpfile.empty() )
{
bool wxChmFSHandler::CanOpen(const wxString& location)
{
wxString p = GetProtocol(location);
- return (p == _T("chm")) &&
- (GetProtocol(GetLeftLocation(location)) == _T("file"));
+ return (p == wxT("chm")) &&
+ (GetProtocol(GetLeftLocation(location)) == wxT("file"));
}
wxFSFile* wxChmFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs),
int index;
- if ( GetProtocol(left) != _T("file") )
+ if ( GetProtocol(left) != wxT("file") )
{
wxLogError(_("CHM handler currently supports only local files!"));
return NULL;
// Work around javascript
wxString tmp = wxString(right);
- if ( tmp.MakeLower().Contains(_T("javascipt")) && tmp.Contains(_T("\'")) )
+ if ( tmp.MakeLower().Contains(wxT("javascipt")) && tmp.Contains(wxT("\'")) )
{
- right = right.AfterFirst(_T('\'')).BeforeLast(_T('\''));
+ right = right.AfterFirst(wxT('\'')).BeforeLast(wxT('\''));
}
// now work on the right location
- if (right.Contains(_T("..")))
+ if (right.Contains(wxT("..")))
{
wxFileName abs(right);
- abs.MakeAbsolute(_T("/"));
+ abs.MakeAbsolute(wxT("/"));
right = abs.GetFullPath();
}
// a workaround for absolute links to root
- if ( (index=right.Index(_T("//"))) != wxNOT_FOUND )
+ if ( (index=right.Index(wxT("//"))) != wxNOT_FOUND )
{
right=wxString(right.Mid(index+1));
wxLogWarning(_("Link contained '//', converted to absolute link."));
if ( s )
{
return new wxFSFile(s,
- left + _T("#chm:") + right,
+ left + wxT("#chm:") + right,
wxEmptyString,
GetAnchor(location),
wxDateTime(wxFileModificationTime(left)));
wxString left = GetLeftLocation(spec);
wxString nativename = wxFileSystem::URLToFileName(left).GetFullPath();
- if ( GetProtocol(left) != _T("file") )
+ if ( GetProtocol(left) != wxT("file") )
{
wxLogError(_("CHM handler currently supports only local files!"));
return wxEmptyString;
}
m_chm = new wxChmTools(wxFileName(nativename));
- m_pattern = right.AfterLast(_T('/'));
+ m_pattern = right.AfterLast(wxT('/'));
wxString m_found = m_chm->Find(m_pattern);
// now fake around hhp-files which are not existing in projects...
if (m_found.empty() &&
- m_pattern.Contains(_T(".hhp")) &&
- !m_pattern.Contains(_T(".hhp.cached")))
+ m_pattern.Contains(wxT(".hhp")) &&
+ !m_pattern.Contains(wxT(".hhp.cached")))
{
- m_found.Printf(_T("%s#chm:%s.hhp"),
- left.c_str(), m_pattern.BeforeLast(_T('.')).c_str());
+ m_found.Printf(wxT("%s#chm:%s.hhp"),
+ left.c_str(), m_pattern.BeforeLast(wxT('.')).c_str());
}
return m_found;
{
m_Config = wxConfigBase::Get(false);
if (m_Config != NULL)
- m_ConfigRoot = _T("wxWindows/wxHtmlHelpController");
+ m_ConfigRoot = wxT("wxWindows/wxHtmlHelpController");
}
if (m_FrameStyle & wxHF_DIALOG)
wxChar *endptr = buf + bufsize - 1;
const wxChar *readptr = line;
- while (*readptr != 0 && *readptr != _T('\r') && *readptr != _T('\n') &&
+ while (*readptr != 0 && *readptr != wxT('\r') && *readptr != wxT('\n') &&
writeptr != endptr)
*(writeptr++) = *(readptr++);
*writeptr = 0;
- while (*readptr == _T('\r') || *readptr == _T('\n'))
+ while (*readptr == wxT('\r') || *readptr == wxT('\n'))
readptr++;
if (*readptr == 0)
return NULL;
{
wxString s;
for (int i = 1; i < level; i++)
- s << _T(" ");
+ s << wxT(" ");
s << name;
return s;
}
else
{
if (wxIsAbsolutePath(path)) m_tempPath = path;
- else m_tempPath = wxGetCwd() + _T("/") + path;
+ else m_tempPath = wxGetCwd() + wxT("/") + path;
- if (m_tempPath[m_tempPath.length() - 1] != _T('/'))
- m_tempPath << _T('/');
+ if (m_tempPath[m_tempPath.length() - 1] != wxT('/'))
+ m_tempPath << wxT('/');
}
}
for (wxChar *ch = linebuf; *ch != wxT('\0') && *ch != wxT('='); ch++)
*ch = (wxChar)wxTolower(*ch);
- if (wxStrstr(linebuf, _T("title=")) == linebuf)
- title = linebuf + wxStrlen(_T("title="));
- if (wxStrstr(linebuf, _T("default topic=")) == linebuf)
- start = linebuf + wxStrlen(_T("default topic="));
- if (wxStrstr(linebuf, _T("index file=")) == linebuf)
- index = linebuf + wxStrlen(_T("index file="));
- if (wxStrstr(linebuf, _T("contents file=")) == linebuf)
- contents = linebuf + wxStrlen(_T("contents file="));
- if (wxStrstr(linebuf, _T("charset=")) == linebuf)
- charset = linebuf + wxStrlen(_T("charset="));
+ if (wxStrstr(linebuf, wxT("title=")) == linebuf)
+ title = linebuf + wxStrlen(wxT("title="));
+ if (wxStrstr(linebuf, wxT("default topic=")) == linebuf)
+ start = linebuf + wxStrlen(wxT("default topic="));
+ if (wxStrstr(linebuf, wxT("index file=")) == linebuf)
+ index = linebuf + wxStrlen(wxT("index file="));
+ if (wxStrstr(linebuf, wxT("contents file=")) == linebuf)
+ contents = linebuf + wxStrlen(wxT("contents file="));
+ if (wxStrstr(linebuf, wxT("charset=")) == linebuf)
+ charset = linebuf + wxStrlen(wxT("charset="));
} while (lineptr != NULL);
wxFontEncoding enc = wxFONTENCODING_SYSTEM;
{
const wxChar *p1, *p2;
for (p1 = thepage.c_str(), p2 = m_LastPage.c_str();
- *p1 != 0 && *p1 != _T('#') && *p1 == *p2; p1++, p2++) {}
+ *p1 != 0 && *p1 != wxT('#') && *p1 == *p2; p1++, p2++) {}
m_LastPage = thepage;
- if (*p1 == 0 || *p1 == _T('#'))
+ if (*p1 == 0 || *p1 == wxT('#'))
return false;
}
else m_LastPage = thepage;
static inline bool WHITESPACE(wxChar c)
{
- return c == _T(' ') || c == _T('\n') || c == _T('\r') || c == _T('\t');
+ return c == wxT(' ') || c == wxT('\n') || c == wxT('\r') || c == wxT('\t');
}
// replace continuous spaces by one single space
{
continue;
}
- ch = _T(' ');
+ ch = wxT(' ');
space_counted = true;
}
else
wxChar c = *pBufStr;
if (insideTag)
{
- if (c == _T('>'))
+ if (c == wxT('>'))
{
insideTag = false;
// replace the tag by an empty space
- c = _T(' ');
+ c = wxT(' ');
}
else
continue;
}
- else if (c == _T('<'))
+ else if (c == wxT('<'))
{
wxChar nextCh = *(pBufStr + 1);
- if (nextCh == _T('/') || !WHITESPACE(nextCh))
+ if (nextCh == wxT('/') || !WHITESPACE(nextCh))
{
insideTag = true;
continue;
if (m_WholeWords)
{
// insert ' ' at the beginning and at the end
- keyword.insert( 0, _T(" ") );
- keyword.append( _T(" ") );
- bufStr.insert( 0, _T(" ") );
- bufStr.append( _T(" ") );
+ keyword.insert( 0, wxT(" ") );
+ keyword.append( wxT(" ") );
+ bufStr.insert( 0, wxT(" ") );
+ bufStr.append( wxT(" ") );
}
// remove continuous spaces
for (size_t i = 0; i < len; i++)
{
const wxHtmlHelpDataItem& item = items[i];
- wxASSERT_MSG( item.level < 128, _T("nested index entries too deep") );
+ wxASSERT_MSG( item.level < 128, wxT("nested index entries too deep") );
if (history[item.level] &&
history[item.level]->items[0]->name == item.name)
switch ( mode )
{
default:
- wxFAIL_MSG( _T("unknown help search mode") );
+ wxFAIL_MSG( wxT("unknown help search mode") );
// fall back
case wxHELP_SEARCH_ALL:
if (path != wxEmptyString)
{
oldpath = cfg->GetPath();
- cfg->SetPath(_T("/") + path);
+ cfg->SetPath(wxT("/") + path);
}
m_Cfg.navig_on = cfg->Read(wxT("hcNavigPanel"), m_Cfg.navig_on) != 0;
if (path != wxEmptyString)
{
oldpath = cfg->GetPath();
- cfg->SetPath(_T("/") + path);
+ cfg->SetPath(wxT("/") + path);
}
cfg->Write(wxT("hcNavigPanel"), m_Cfg.navig_on);
0, NULL, wxCB_DROPDOWN | wxCB_READONLY));
sizer->Add(FontSize = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
- wxDefaultSize, wxSP_ARROW_KEYS, 2, 100, 2, _T("wxSpinCtrl")));
+ wxDefaultSize, wxSP_ARROW_KEYS, 2, 100, 2, wxT("wxSpinCtrl")));
topsizer->Add(sizer, 0, wxLEFT|wxRIGHT|wxTOP, 10);
wxString content(_("font size"));
- content = _T("<font size=-2>") + content + _T(" -2</font><br>")
- _T("<font size=-1>") + content + _T(" -1</font><br>")
- _T("<font size=+0>") + content + _T(" +0</font><br>")
- _T("<font size=+1>") + content + _T(" +1</font><br>")
- _T("<font size=+2>") + content + _T(" +2</font><br>")
- _T("<font size=+3>") + content + _T(" +3</font><br>")
- _T("<font size=+4>") + content + _T(" +4</font><br>") ;
+ content = wxT("<font size=-2>") + content + wxT(" -2</font><br>")
+ wxT("<font size=-1>") + content + wxT(" -1</font><br>")
+ wxT("<font size=+0>") + content + wxT(" +0</font><br>")
+ wxT("<font size=+1>") + content + wxT(" +1</font><br>")
+ wxT("<font size=+2>") + content + wxT(" +2</font><br>")
+ wxT("<font size=+3>") + content + wxT(" +3</font><br>")
+ wxT("<font size=+4>") + content + wxT(" +4</font><br>") ;
- content = wxString( _T("<html><body><table><tr><td>") ) +
+ content = wxString( wxT("<html><body><table><tr><td>") ) +
_("Normal face<br>and <u>underlined</u>. ") +
_("<i>Italic face.</i> ") +
_("<b>Bold face.</b> ") +
_("<b><i>Bold italic face.</i></b><br>") +
content +
- wxString( _T("</td><td><tt>") ) +
+ wxString( wxT("</td><td><tt>") ) +
_("Fixed size face.<br> <b>bold</b> <i>italic</i> ") +
_("<b><i>bold italic <u>underlined</u></i></b><br>") +
content +
- _T("</tt></td></tr></table></body></html>");
+ wxT("</tt></td></tr></table></body></html>");
TestWin->SetPage( content );
}
if (!s.empty())
{
wxString ext = s.Right(4).Lower();
- if (ext == _T(".zip") || ext == _T(".htb") ||
+ if (ext == wxT(".zip") || ext == wxT(".htb") ||
#if wxUSE_LIBMSPACK
- ext == _T(".chm") ||
+ ext == wxT(".chm") ||
#endif
- ext == _T(".hhp"))
+ ext == wxT(".hhp"))
{
wxBusyCursor bcur;
m_Data->AddBook(s);
const wxPoint& pos,
const wxMouseEvent& event)
{
- wxCHECK_MSG( window, false, _T("window interface must be provided") );
+ wxCHECK_MSG( window, false, wxT("window interface must be provided") );
#if WXWIN_COMPATIBILITY_2_6
// NB: this hack puts the body of ProcessMouseClick() into OnMouseClick()
void wxHtmlCell::OnMouseClick(wxWindow *, int, int, const wxMouseEvent& event)
{
- wxCHECK_RET( gs_helperOnMouseClick, _T("unexpected call to OnMouseClick") );
+ wxCHECK_RET( gs_helperOnMouseClick, wxT("unexpected call to OnMouseClick") );
wxHtmlWindowInterface *window = gs_helperOnMouseClick->window;
const wxPoint& pos = gs_helperOnMouseClick->pos;
#endif // WXWIN_COMPATIBILITY_2_6
}
}
- wxFAIL_MSG(_T("Cells are in different trees"));
+ wxFAIL_MSG(wxT("Cells are in different trees"));
return false;
}
void wxHtmlContainerCell::OnMouseClick(wxWindow*,
int, int, const wxMouseEvent& event)
{
- wxCHECK_RET( gs_helperOnMouseClick, _T("unexpected call to OnMouseClick") );
+ wxCHECK_RET( gs_helperOnMouseClick, wxT("unexpected call to OnMouseClick") );
wxHtmlWindowInterface *window = gs_helperOnMouseClick->window;
const wxPoint& pos = gs_helperOnMouseClick->pos;
#endif // WXWIN_COMPATIBILITY_2_6
wxScrolledWindow *scrolwin =
wxDynamicCast(m_Wnd->GetParent(), wxScrolledWindow);
wxCHECK_RET( scrolwin,
- _T("widget cells can only be placed in wxHtmlWindow") );
+ wxT("widget cells can only be placed in wxHtmlWindow") );
scrolwin->GetViewStart(&stx, &sty);
m_Wnd->SetSize(absx - wxHTML_SCROLL_STEP * stx,
// tag if we used Content-Type header).
#if wxUSE_UNICODE
int charsetPos;
- if ((charsetPos = file.GetMimeType().Find(_T("; charset="))) != wxNOT_FOUND)
+ if ((charsetPos = file.GetMimeType().Find(wxT("; charset="))) != wxNOT_FOUND)
{
wxString charset = file.GetMimeType().Mid(charsetPos + 10);
wxCSConv conv(charset);
{
wxString hdr;
wxString mime = file.GetMimeType();
- hdr.Printf(_T("<meta http-equiv=\"Content-Type\" content=\"%s\">"), mime.c_str());
+ hdr.Printf(wxT("<meta http-equiv=\"Content-Type\" content=\"%s\">"), mime.c_str());
return hdr+doc;
}
#endif
doc = src;
delete [] src;
- doc.Replace(_T("<"), _T("<"), TRUE);
- doc.Replace(_T(">"), _T(">"), TRUE);
- doc2 = _T("<HTML><BODY><PRE>\n") + doc + _T("\n</PRE></BODY></HTML>");
+ doc.Replace(wxT("<"), wxT("<"), TRUE);
+ doc.Replace(wxT(">"), wxT(">"), TRUE);
+ doc2 = wxT("<HTML><BODY><PRE>\n") + doc + wxT("\n</PRE></BODY></HTML>");
return doc2;
}
// This is true in most case but some page can return:
// "text/html; char-encoding=...."
// So we use Find instead
- return (file.GetMimeType().Find(_T("text/html")) == 0);
+ return (file.GetMimeType().Find(wxT("text/html")) == 0);
}
// DLL options compatibility check:
WX_CHECK_BUILD_OPTIONS("wxHTML")
-const wxChar *wxTRACE_HTML_DEBUG = _T("htmldebug");
+const wxChar *wxTRACE_HTML_DEBUG = wxT("htmldebug");
//-----------------------------------------------------------------------------
// wxHtmlParser helpers
bool wxMetaTagHandler::HandleTag(const wxHtmlTag& tag)
{
- if (tag.GetName() == _T("BODY"))
+ if (tag.GetName() == wxT("BODY"))
{
m_Parser->StopParsing();
return false;
}
- if (tag.HasParam(_T("HTTP-EQUIV")) &&
- tag.GetParam(_T("HTTP-EQUIV")).IsSameAs(_T("Content-Type"), false) &&
- tag.HasParam(_T("CONTENT")))
+ if (tag.HasParam(wxT("HTTP-EQUIV")) &&
+ tag.GetParam(wxT("HTTP-EQUIV")).IsSameAs(wxT("Content-Type"), false) &&
+ tag.HasParam(wxT("CONTENT")))
{
- wxString content = tag.GetParam(_T("CONTENT")).Lower();
- if (content.Left(19) == _T("text/html; charset="))
+ wxString content = tag.GetParam(wxT("CONTENT")).Lower();
+ if (content.Left(19) == wxT("text/html; charset="))
{
*m_retval = content.Mid(19);
m_Parser->StopParsing();
wxHtmlParser::SkipCommentTag(wxString::const_iterator& start,
wxString::const_iterator end)
{
- wxASSERT_MSG( *start == '<', _T("should be called on the tag start") );
+ wxASSERT_MSG( *start == '<', wxT("should be called on the tag start") );
wxString::const_iterator p = start;
bool wxIsCDATAElement(const wxChar *tag)
{
- return (wxStrcmp(tag, _T("SCRIPT")) == 0) ||
- (wxStrcmp(tag, _T("STYLE")) == 0);
+ return (wxStrcmp(tag, wxT("SCRIPT")) == 0) ||
+ (wxStrcmp(tag, wxT("STYLE")) == 0);
}
bool wxIsCDATAElement(const wxString& tag)
{
tagBuffer[i] = (wxChar)wxToupper(*pos);
}
- tagBuffer[i] = _T('\0');
+ tagBuffer[i] = wxT('\0');
Cache()[tg].Name = new wxChar[i+1];
memcpy(Cache()[tg].Name, tagBuffer, (i+1)*sizeof(wxChar));
bool wxHtmlTag::GetParamAsColour(const wxString& par, wxColour *clr) const
{
- wxCHECK_MSG( clr, false, _T("invalid colour argument") );
+ wxCHECK_MSG( clr, false, wxT("invalid colour argument") );
wxString str = GetParam(par);
// handle colours defined in HTML 4.0 first:
- if (str.length() > 1 && str[0] != _T('#'))
+ if (str.length() > 1 && str[0] != wxT('#'))
{
#define HTML_COLOUR(name, r, g, b) \
if (str.IsSameAs(wxS(name), false)) \
{
// if the event wasn't handled, do the default processing here:
- wxASSERT_MSG( cell, _T("can't be called with NULL cell") );
+ wxASSERT_MSG( cell, wxT("can't be called with NULL cell") );
cell->ProcessMouseClick(m_interface, ev.GetPoint(), ev.GetMouseEvent());
}
const wxString txt(SelectionToText());
wxTheClipboard->SetData(new wxTextDataObject(txt));
wxTheClipboard->Close();
- wxLogTrace(_T("wxhtmlselection"),
+ wxLogTrace(wxT("wxhtmlselection"),
_("Copied to clipboard:\"%s\""), txt.c_str());
return true;
// but seems to happen sometimes under wxMSW - maybe it's a bug
// there but for now just ignore it
- //wxFAIL_MSG( _T("can't understand where has mouse gone") );
+ //wxFAIL_MSG( wxT("can't understand where has mouse gone") );
return;
}
unsigned w, h, bpp;
if ( !wxGetEnv(wxT("WXMODE"), &mode) ||
- (wxSscanf(mode.c_str(), _T("%ux%u-%u"), &w, &h, &bpp) != 3) )
+ (wxSscanf(mode.c_str(), wxT("%ux%u-%u"), &w, &h, &bpp) != 3) )
{
w = 640, h = 480, bpp = 16;
}
wxBrush::wxBrush(const wxBitmap &stippleBitmap)
{
- wxCHECK_RET( stippleBitmap.Ok(), _T("invalid bitmap") );
+ wxCHECK_RET( stippleBitmap.Ok(), wxT("invalid bitmap") );
wxCHECK_RET( stippleBitmap.GetWidth() == 8 && stippleBitmap.GetHeight() == 8,
- _T("stipple bitmap must be 8x8") );
+ wxT("stipple bitmap must be 8x8") );
m_refData = new wxBrushRefData();
M_BRUSHDATA->m_colour = *wxBLACK;
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->m_style;
}
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_colour;
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
return &M_BRUSHDATA->m_stipple;
}
{
AllocExclusive();
- wxCHECK_RET( stipple.Ok(), _T("invalid bitmap") );
+ wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") );
wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8,
- _T("stipple bitmap must be 8x8") );
+ wxT("stipple bitmap must be 8x8") );
M_BRUSHDATA->m_stipple = stipple;
wxBitmapToPixPattern(stipple, &(M_BRUSHDATA->m_pixPattern),
if ( gs_cursorsHash->find(cursorId) != gs_cursorsHash->end() )
{
- wxLogTrace(_T("mglcursor"), _T("cursor id %i fetched from cache"), cursorId);
+ wxLogTrace(wxT("mglcursor"), wxT("cursor id %i fetched from cache"), cursorId);
*this = (*gs_cursorsHash)[cursorId];
return;
}
else
{
(*gs_cursorsHash)[cursorId] = *this;
- wxLogTrace(_T("mglcursor"), _T("cursor id %i added to cache (%s)"),
+ wxLogTrace(wxT("mglcursor"), wxT("cursor id %i added to cache (%s)"),
cursorId, cursorname);
}
}
bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
{
- wxCHECK_MSG( col, false, _T("NULL colour parameter in wxDC::GetPixel"));
+ wxCHECK_MSG( col, false, wxT("NULL colour parameter in wxDC::GetPixel"));
uchar r, g, b;
m_MGLDC->unpackColorFast(m_MGLDC->getPixel(XLOG2DEV(x), YLOG2DEV(y)),
pixPattern->p[x][y][2]);
break;
default:
- wxFAIL_MSG(_T("invalid DC depth"));
+ wxFAIL_MSG(wxT("invalid DC depth"));
break;
}
m_MGLDC->setPenPixmapPattern(slot, &pix);
// throw away the trailing slashes
size_t n = m_dirname.length();
- wxCHECK_RET( n, _T("empty dir name in wxDir") );
+ wxCHECK_RET( n, wxT("empty dir name in wxDir") );
while ( n > 0 && m_dirname[--n] == wxFILE_SEP_PATH ) {}
{
#ifdef __DOS__
if ( filespec.empty() )
- m_filespec = _T("*.*");
+ m_filespec = wxT("*.*");
else
#endif
m_filespec = filespec;
const wxString& filespec,
int flags) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
M_DIR->Rewind();
bool wxDir::GetNext(wxString *filename) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
- wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") );
+ wxCHECK_MSG( filename, false, wxT("bad pointer in wxDir::GetNext()") );
return M_DIR->Read(filename);
}
wxGUIEventLoop::~wxGUIEventLoop()
{
- wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") );
+ wxASSERT_MSG( !m_impl, wxT("should have been deleted in Run()") );
}
int wxGUIEventLoop::Run()
{
// event loops are not recursive, you need to create another loop!
- wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") );
+ wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") );
m_impl = new wxEventLoopImpl;
void wxGUIEventLoop::Exit(int rc)
{
- wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") );
+ wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") );
m_impl->SetExitCode(rc);
m_impl->SetKeepLooping(false);
bool wxGUIEventLoop::Dispatch()
{
- wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") );
+ wxCHECK_MSG( IsRunning(), false, wxT("can't call Dispatch() if not running") );
m_impl->Dispatch();
return m_impl->GetKeepLooping();
{
m_font = MGL_loadFontInstance(fontLib, ptSize, 0.0, 0.0, aa);
- wxASSERT_MSG( m_font, _T("cannot create font instance") );
+ wxASSERT_MSG( m_font, wxT("cannot create font instance") );
}
wxFontInstance::~wxFontInstance()
if ( m_refCnt == 1 )
{
- wxCHECK_RET( m_fontLib == NULL, _T("font lib already created") );
+ wxCHECK_RET( m_fontLib == NULL, wxT("font lib already created") );
wxLogTrace("mgl_font", "opening library '%s'", m_fileName.mb_str());
m_fontLib = MGL_openFontLib(m_fileName.fn_str());
if ( m_refCnt == 0 )
{
- wxCHECK_RET( m_fontLib != NULL, _T("font lib not created") );
+ wxCHECK_RET( m_fontLib != NULL, wxT("font lib not created") );
wxLogTrace("mgl_font", "closing library '%s'", m_fileName.mb_str());
MGL_closeFontLib(m_fontLib);
wxFontInstance *wxFontFace::CreateFontInstance(float ptSize, bool aa)
{
- wxASSERT_MSG( m_fontLib, _T("font library not loaded!") );
+ wxASSERT_MSG( m_fontLib, wxT("font library not loaded!") );
return new wxFontInstance(ptSize, aa, m_fontLib);
}
switch ( family )
{
case wxSCRIPT:
- return _T("Script");
+ return wxT("Script");
case wxDECORATIVE:
- return _T("Charter");
+ return wxT("Charter");
case wxROMAN:
- return _T("Times");
+ return wxT("Times");
case wxTELETYPE:
case wxMODERN:
- return _T("Courier");
+ return wxT("Courier");
case wxSWISS:
case wxDEFAULT:
default:
// encoding[;facename]
bool wxNativeEncodingInfo::FromString(const wxString& s)
{
- wxStringTokenizer tokenizer(s, _T(";"));
+ wxStringTokenizer tokenizer(s, wxT(";"));
wxString encid = tokenizer.GetNextToken();
long enc;
s << (long)encoding;
if ( !facename.empty() )
{
- s << _T(';') << facename;
+ s << wxT(';') << facename;
}
return s;
bool wxGetNativeFontEncoding(wxFontEncoding encoding,
wxNativeEncodingInfo *info)
{
- wxCHECK_MSG( info, false, _T("bad pointer in wxGetNativeFontEncoding") );
+ wxCHECK_MSG( info, false, wxT("bad pointer in wxGetNativeFontEncoding") );
if ( encoding == wxFONTENCODING_DEFAULT )
{
wxPen::wxPen(const wxBitmap& stipple, int width)
{
- wxCHECK_RET( stipple.Ok(), _T("invalid bitmap") );
+ wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") );
wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8,
- _T("stipple bitmap must be 8x8") );
+ wxT("stipple bitmap must be 8x8") );
m_refData = new wxPenRefData();
M_PENDATA->m_width = width;
void wxPen::SetStipple(const wxBitmap& stipple)
{
- wxCHECK_RET( stipple.Ok(), _T("invalid bitmap") );
+ wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") );
wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8,
- _T("stipple bitmap must be 8x8") );
+ wxT("stipple bitmap must be 8x8") );
AllocExclusive();
M_PENDATA->m_stipple = stipple;
bool wxRegion::DoIsEqual(const wxRegion& WXUNUSED(region)) const
{
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
return false;
}
return false;
default:
- wxFAIL_MSG( _T("unknown feature") );
+ wxFAIL_MSG( wxT("unknown feature") );
}
return false;
static void wxCaptureScreenshot(bool activeWindowOnly)
{
#ifdef __DOS__
- #define SCREENSHOT_FILENAME _T("sshot%03i.png")
+ #define SCREENSHOT_FILENAME wxT("sshot%03i.png")
#else
- #define SCREENSHOT_FILENAME _T("screenshot-%03i.png")
+ #define SCREENSHOT_FILENAME wxT("screenshot-%03i.png")
#endif
static int screenshot_num = 0;
wxString screenshot;
g_displayDC->savePNGFromDC(screenshot.mb_str(),
r.x, r. y, r.x+r.width, r.y+r.height);
- wxMessageBox(wxString::Format(_T("Screenshot captured: %s"),
+ wxMessageBox(wxString::Format(wxT("Screenshot captured: %s"),
screenshot.c_str()));
}
#ifdef __WXDEBUG__
#define KEY(mgl_key,wx_key) \
case mgl_key: \
- wxLogTrace(_T("keyevents"), \
- _T("key " #mgl_key ", mapped to " #wx_key)); \
+ wxLogTrace(wxT("keyevents"), \
+ wxT("key " #mgl_key ", mapped to " #wx_key)); \
key = wx_key; \
break;
#else
strcmp(loc, "POSIX") == 0 )
{
// we're using C locale, "fix" it
- wxLogDebug(_T("HP-UX fontset hack: forcing locale to en_US.iso88591"));
+ wxLogDebug(wxT("HP-UX fontset hack: forcing locale to en_US.iso88591"));
putenv(fixAll ? "LC_ALL=en_US.iso88591" : "LC_CTYPE=en_US.iso88591");
}
#endif // __HPUX__
// immediate crash inside XOpenIM() (if XIM is used) under IRIX
wxString appname = wxTheApp->GetAppName();
if ( appname.empty() )
- appname = _T("wxapp");
+ appname = wxT("wxapp");
wxString clsname = wxTheApp->GetClassName();
if ( clsname.empty() )
- clsname = _T("wx");
+ clsname = wxT("wx");
// FIXME-UTF8: This code is taken from wxGTK and duplicated here. This
// is just a temporary fix to make wxX11 compile in Unicode
static inline wxCharBuffer GetCacheImageName(WXImage image)
{
- return wxString::Format(_T("wxBitmap_%p"), image).ToAscii();
+ return wxString::Format(wxT("wxBitmap_%p"), image).ToAscii();
}
wxBitmapCache::~wxBitmapCache()
wxGUIEventLoop::~wxGUIEventLoop()
{
- wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") );
+ wxASSERT_MSG( !m_impl, wxT("should have been deleted in Run()") );
}
int wxGUIEventLoop::Run()
{
// event loops are not recursive, you need to create another loop!
- wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") );
+ wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") );
wxEventLoopActivator activate(this);
void wxGUIEventLoop::Exit(int rc)
{
- wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") );
+ wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") );
m_impl->SetExitCode(rc);
m_impl->SetKeepGoing( false );
const size_t count = wxParseCommonDialogsFilter(wild,
wildDescriptions,
wildFilters);
- wxCHECK_MSG( count, _T("*.*"), wxT("wxFileDialog: bad wildcard string") );
- wxCHECK_MSG( count == 1, _T("*.*"), msg );
+ wxCHECK_MSG( count, wxT("*.*"), wxT("wxFileDialog: bad wildcard string") );
+ wxCHECK_MSG( count == 1, wxT("*.*"), msg );
// check for *.txt;*.rtf
- wxStringTokenizer tok2( wildFilters[0], _T(";") );
+ wxStringTokenizer tok2( wildFilters[0], wxT(";") );
wxString wildcard = tok2.GetNextToken();
wxCHECK_MSG( tok2.CountTokens() <= 1, wildcard, msg );
wxString registry = tn.GetNextToken().MakeUpper(),
encoding = tn.GetNextToken().MakeUpper();
- if ( registry == _T("ISO8859") )
+ if ( registry == wxT("ISO8859") )
{
int cp;
if ( wxSscanf(encoding, wxT("%d"), &cp) == 1 )
(wxFontEncoding)(wxFONTENCODING_ISO8859_1 + cp - 1);
}
}
- else if ( registry == _T("MICROSOFT") )
+ else if ( registry == wxT("MICROSOFT") )
{
int cp;
if ( wxSscanf(encoding, wxT("cp125%d"), &cp) == 1 )
(wxFontEncoding)(wxFONTENCODING_CP1250 + cp);
}
}
- else if ( registry == _T("KOI8") )
+ else if ( registry == wxT("KOI8") )
{
M_FONTDATA->m_encoding = wxFONTENCODING_KOI8;
}
XmScaleCallbackStruct *cbs)
{
wxScrollBar *scrollBar = (wxScrollBar*)wxGetWindowFromTable(widget);
- wxCHECK_RET( scrollBar, _T("invalid widget in scrollbar callback") );
+ wxCHECK_RET( scrollBar, wxT("invalid widget in scrollbar callback") );
wxOrientation orientation = (wxOrientation)wxPtrToUInt(clientData);
wxEventType eventType = wxEVT_NULL;
default:
case wxSYS_COLOUR_MAX:
- wxFAIL_MSG( _T("unknown colour") );
+ wxFAIL_MSG( wxT("unknown colour") );
}
return *wxWHITE;
}
ArrowDirection d,
const wxPoint& pos, const wxSize& size )
{
- wxCHECK_MSG( parent, false, _T("must have a valid parent") );
+ wxCHECK_MSG( parent, false, wxT("must have a valid parent") );
int arrow_dir = XmARROW_UP;
wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord WXUNUSED(x),
wxCoord WXUNUSED(y)) const
{
- wxFAIL_MSG( _T("TODO") );
+ wxFAIL_MSG( wxT("TODO") );
return NULL;
}
XmScrollBarCallbackStruct *cbs)
{
wxWindow *win = wxGetWindowFromTable(scrollbar);
- wxCHECK_RET( win, _T("invalid widget in scrollbar callback") );
+ wxCHECK_RET( win, wxT("invalid widget in scrollbar callback") );
wxOrientation orientation = (wxOrientation)wxPtrToUInt(clientData);
wxArrayString * WXUNUSED(commands),
const wxFileType::MessageParameters& WXUNUSED(params)) const
{
- wxFAIL_MSG( _T("wxFileTypeImpl::GetAllCommands() not yet implemented") );
+ wxFAIL_MSG( wxT("wxFileTypeImpl::GetAllCommands() not yet implemented") );
return 0;
}
wxMimeTypesManagerImpl::Initialize(int WXUNUSED(mailcapStyles),
const wxString& WXUNUSED(extraDir))
{
- wxFAIL_MSG( _T("wxMimeTypesManagerImpl::Initialize() not yet implemented") );
+ wxFAIL_MSG( wxT("wxMimeTypesManagerImpl::Initialize() not yet implemented") );
}
void
wxMimeTypesManagerImpl::ClearData()
{
- wxFAIL_MSG( _T("wxMimeTypesManagerImpl::ClearData() not yet implemented") );
+ wxFAIL_MSG( wxT("wxMimeTypesManagerImpl::ClearData() not yet implemented") );
}
// extension -> file type
size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& WXUNUSED(mimetypes))
{
// VZ: don't know anything about this for Mac
- wxFAIL_MSG( _T("wxMimeTypesManagerImpl::EnumAllFileTypes() not yet implemented") );
+ wxFAIL_MSG( wxT("wxMimeTypesManagerImpl::EnumAllFileTypes() not yet implemented") );
return 0;
}
wxFileType *
wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& WXUNUSED(ftInfo))
{
- wxFAIL_MSG( _T("wxMimeTypesManagerImpl::Associate() not yet implemented") );
+ wxFAIL_MSG( wxT("wxMimeTypesManagerImpl::Associate() not yet implemented") );
return NULL;
}
{
wxString s = variable;
if ( value )
- s << _T('=') << value;
+ s << wxT('=') << value;
// transform to ANSI
const char *p = s.mb_str();
{
strDir = szHome;
// when msys sets %HOME% it uses '/' (cygwin uses '\\')
- strDir.Replace(_T("/"), _T("\\"));
+ strDir.Replace(wxT("/"), wxT("\\"));
}
}
wxString prog(wxTheApp->argv[0]);
#ifdef __DJGPP__
// djgpp startup code switches the slashes around, so restore them
- prog.Replace(_T("/"), _T("\\"));
+ prog.Replace(wxT("/"), wxT("\\"));
#endif
// it needs to be a full path to be usable
- if ( prog.compare(1, 2, _T(":\\")) == 0 )
+ if ( prog.compare(1, 2, wxT(":\\")) == 0 )
wxFileName::SplitPath(prog, &strDir, NULL, NULL);
}
if ( strDir.empty() )
{
- strDir = _T(".");
+ strDir = wxT(".");
}
}
//
bool wxGetUserId(wxChar *buf, int n)
{
- const wxChar *user = wxGetenv(_T("UserName"));
+ const wxChar *user = wxGetenv(wxT("UserName"));
if (!user)
- user = wxGetenv(_T("USER"));
+ user = wxGetenv(wxT("USER"));
if (!user)
- user = _T("user");
+ user = wxT("user");
wxStrlcpy(buf, user, n);
return true;
//
bool wxGetHostName(wxChar *buf, int n)
{
- const wxChar *host = wxGetenv(_T("ComputerName"));
+ const wxChar *host = wxGetenv(wxT("ComputerName"));
if (!host)
- host = wxGetenv(_T("HOSTNAME"));
+ host = wxGetenv(wxT("HOSTNAME"));
if (!host)
- host = _T("host");
+ host = wxT("host");
wxStrlcpy(buf, host, n);
return true;
{
wxGetHostName(buf, n);
- const wxChar *domain = wxGetenv(_T("UserDnsDomain"));
+ const wxChar *domain = wxGetenv(wxT("UserDnsDomain"));
if (domain)
- wxStrncat(wxStrncat(buf, _T("."), n), domain, n);
+ wxStrncat(wxStrncat(buf, wxT("."), n), domain, n);
return true;
}
}
else
{
- wxLogDebug(_T("wxKill can only send signals to the current process under MSDOS"));
+ wxLogDebug(wxT("wxKill can only send signals to the current process under MSDOS"));
if (rc)
*rc = wxKILL_NO_PROCESS;
}
{
public:
wxTempFileInStream(const wxString& name)
- : wxFFileInputStream(name, _T("rt"))
+ : wxFFileInputStream(name, wxT("rt"))
{ }
virtual ~wxTempFileInStream()
if (redirect)
{
// close stdin/out/err and reopen them as files
- if (!in.Reopen(_T("NUL"), O_RDONLY | O_TEXT))
+ if (!in.Reopen(wxT("NUL"), O_RDONLY | O_TEXT))
return -1;
- if (!out.Reopen(wxFileName::CreateTempFileName(_T("out")),
+ if (!out.Reopen(wxFileName::CreateTempFileName(wxT("out")),
O_CREAT | O_WRONLY | O_TRUNC | O_TEXT))
return -1;
- if (!err.Reopen(wxFileName::CreateTempFileName(_T("err")),
+ if (!err.Reopen(wxFileName::CreateTempFileName(wxT("err")),
O_CREAT | O_WRONLY | O_TRUNC | O_TEXT))
return -1;
}
#if wxUSE_STREAMS
if (redirect)
process->SetPipeStreams(new wxTempFileInStream(out.Release()),
- new wxFFileOutputStream(_T("NUL"), _T("wt")),
+ new wxFFileOutputStream(wxT("NUL"), wxT("wt")),
new wxTempFileInStream(err.Release()));
#endif // wxUSE_STREAMS
wxString wxGetOsDescription()
{
- wxString osname(_T("DOS"));
+ wxString osname(wxT("DOS"));
return osname;
}
msg << name;
if ( info.HasVersion() )
{
- msg << _T('\n');
+ msg << wxT('\n');
msg << wxString::Format(_("Version %s"), info.GetVersion());
}
- msg << _T("\n\n");
+ msg << wxT("\n\n");
if ( info.HasCopyright() )
- msg << info.GetCopyrightToDisplay() << _T('\n');
+ msg << info.GetCopyrightToDisplay() << wxT('\n');
// add everything remaining
msg << info.GetDescriptionAndCredits();
{
if ( !::FreeConsole() )
{
- wxLogLastError(_T("FreeConsole"));
+ wxLogLastError(wxT("FreeConsole"));
}
}
}
if ( hStderr == INVALID_HANDLE_VALUE || !hStderr )
return false;
- if ( !m_dllKernel32.Load(_T("kernel32.dll")) )
+ if ( !m_dllKernel32.Load(wxT("kernel32.dll")) )
return false;
typedef BOOL (WINAPI *AttachConsole_t)(DWORD dwProcessId);
if ( !::GetConsoleScreenBufferInfo(m_hStderr, &csbi) )
{
- wxLogLastError(_T("GetConsoleScreenBufferInfo"));
+ wxLogLastError(wxT("GetConsoleScreenBufferInfo"));
return false;
}
if ( !::ReadConsoleOutputCharacterA(m_hStderr, buf, WXSIZEOF(buf),
pos, &ret) )
{
- wxLogLastError(_T("ReadConsoleOutputCharacterA"));
+ wxLogLastError(wxT("ReadConsoleOutputCharacterA"));
return false;
}
} while ( wxStrncmp(" ", buf, WXSIZEOF(buf)) != 0 );
if ( !::ReadConsoleOutputCharacterA(m_hStderr, m_data.data(), m_dataLen,
pos, &ret) )
{
- wxLogLastError(_T("ReadConsoleOutputCharacterA"));
+ wxLogLastError(wxT("ReadConsoleOutputCharacterA"));
return false;
}
}
int wxConsoleStderr::GetCommandHistory(wxWxCharBuffer& buf) const
{
// these functions are internal and may only be called by cmd.exe
- static const wxChar *CMD_EXE = _T("cmd.exe");
+ static const wxChar *CMD_EXE = wxT("cmd.exe");
const int len = m_pfnGetConsoleCommandHistoryLength(CMD_EXE);
if ( len )
if ( len2 != len )
{
- wxFAIL_MSG( _T("failed getting history?") );
+ wxFAIL_MSG( wxT("failed getting history?") );
}
}
bool wxConsoleStderr::IsHistoryUnchanged() const
{
- wxASSERT_MSG( m_ok == 1, _T("shouldn't be called if not initialized") );
+ wxASSERT_MSG( m_ok == 1, wxT("shouldn't be called if not initialized") );
// get (possibly changed) command history
wxWxCharBuffer history;
bool wxConsoleStderr::Write(const wxString& text)
{
wxASSERT_MSG( m_hStderr != INVALID_HANDLE_VALUE,
- _T("should only be called if Init() returned true") );
+ wxT("should only be called if Init() returned true") );
// get current position
CONSOLE_SCREEN_BUFFER_INFO csbi;
if ( !::GetConsoleScreenBufferInfo(m_hStderr, &csbi) )
{
- wxLogLastError(_T("GetConsoleScreenBufferInfo"));
+ wxLogLastError(wxT("GetConsoleScreenBufferInfo"));
return false;
}
if ( !::SetConsoleCursorPosition(m_hStderr, csbi.dwCursorPosition) )
{
- wxLogLastError(_T("SetConsoleCursorPosition"));
+ wxLogLastError(wxT("SetConsoleCursorPosition"));
return false;
}
DWORD ret;
- if ( !::FillConsoleOutputCharacter(m_hStderr, _T(' '), m_dataLen,
+ if ( !::FillConsoleOutputCharacter(m_hStderr, wxT(' '), m_dataLen,
csbi.dwCursorPosition, &ret) )
{
- wxLogLastError(_T("FillConsoleOutputCharacter"));
+ wxLogLastError(wxT("FillConsoleOutputCharacter"));
return false;
}
if ( !::WriteConsole(m_hStderr, text.wx_str(), text.length(), &ret, NULL) )
{
- wxLogLastError(_T("WriteConsole"));
+ wxLogLastError(wxT("WriteConsole"));
return false;
}
HRESULT hr = (*pfnDllGetVersion)(&dvi);
if ( FAILED(hr) )
{
- wxLogApiError(_T("DllGetVersion"), hr);
+ wxLogApiError(wxT("DllGetVersion"), hr);
return 0;
}
// depending on the OS version and the presence of the manifest, it can
// be either v5 or v6 and instead of trying to guess it just get the
// handle of the already loaded version
- wxLoadedDLL dllComCtl32(_T("comctl32.dll"));
+ wxLoadedDLL dllComCtl32(wxT("comctl32.dll"));
if ( !dllComCtl32.IsLoaded() )
{
s_verComCtl32 = 0;
if ( !s_verComCtl32 )
{
// InitCommonControlsEx is unique to 4.70 and later
- void *pfn = dllComCtl32.GetSymbol(_T("InitCommonControlsEx"));
+ void *pfn = dllComCtl32.GetSymbol(wxT("InitCommonControlsEx"));
if ( !pfn )
{
// not found, must be 4.00
{
// many symbols appeared in comctl32 4.71, could use any of
// them except may be DllInstall()
- pfn = dllComCtl32.GetSymbol(_T("InitializeFlatSB"));
+ pfn = dllComCtl32.GetSymbol(wxT("InitializeFlatSB"));
if ( !pfn )
{
// not found, must be 4.70
// we're prepared to handle the errors
wxLogNull noLog;
- wxDynamicLibrary dllShell32(_T("shell32.dll"), wxDL_VERBATIM);
+ wxDynamicLibrary dllShell32(wxT("shell32.dll"), wxDL_VERBATIM);
if ( dllShell32.IsLoaded() )
{
s_verShell32 = CallDllGetVersion(dllShell32);
::MessageBox
(
NULL,
- _T("An unhandled exception occurred. Press \"Abort\" to \
+ wxT("An unhandled exception occurred. Press \"Abort\" to \
terminate the program,\r\n\
\"Retry\" to exit the program normally and \"Ignore\" to try to continue."),
- _T("Unhandled exception"),
+ wxT("Unhandled exception"),
MB_ABORTRETRYIGNORE |
MB_ICONERROR|
MB_TASKMODAL
throw;
default:
- wxFAIL_MSG( _T("unexpected MessageBox() return code") );
+ wxFAIL_MSG( wxT("unexpected MessageBox() return code") );
// fall through
case IDRETRY:
// CloneGDIRefData()
wxASSERT_MSG( !data.m_isDIB,
- _T("can't copy bitmap locked for raw access!") );
+ wxT("can't copy bitmap locked for raw access!") );
m_isDIB = false;
m_hasAlpha = data.m_hasAlpha;
wxT("deleting bitmap still selected into wxMemoryDC") );
#if wxUSE_WXDIB
- wxASSERT_MSG( !m_dib, _T("forgot to call wxBitmap::UngetRawData()!") );
+ wxASSERT_MSG( !m_dib, wxT("forgot to call wxBitmap::UngetRawData()!") );
#endif
if ( m_hBitmap)
switch ( transp )
{
default:
- wxFAIL_MSG( _T("unknown wxBitmapTransparency value") );
+ wxFAIL_MSG( wxT("unknown wxBitmapTransparency value") );
case wxBitmapTransparency_None:
// nothing to do, refData->m_hasAlpha is false by default
bool wxBitmap::CopyFromDIB(const wxDIB& dib)
{
- wxCHECK_MSG( dib.IsOk(), false, _T("invalid DIB in CopyFromDIB") );
+ wxCHECK_MSG( dib.IsOk(), false, wxT("invalid DIB in CopyFromDIB") );
#ifdef SOMETIMES_USE_DIB
HBITMAP hbitmap = dib.CreateDDB();
bool wxBitmap::Create(int width, int height, const wxDC& dc)
{
- wxCHECK_MSG( dc.IsOk(), false, _T("invalid HDC in wxBitmap::Create()") );
+ wxCHECK_MSG( dc.IsOk(), false, wxT("invalid HDC in wxBitmap::Create()") );
const wxMSWDCImpl *impl = wxDynamicCast( dc.GetImpl(), wxMSWDCImpl );
bool wxBitmap::CreateFromImage(const wxImage& image, const wxDC& dc)
{
wxCHECK_MSG( dc.IsOk(), false,
- _T("invalid HDC in wxBitmap::CreateFromImage()") );
+ wxT("invalid HDC in wxBitmap::CreateFromImage()") );
const wxMSWDCImpl *impl = wxDynamicCast( dc.GetImpl(), wxMSWDCImpl );
hbitmap = ::CreateBitmap(w, h, 1, 1, data);
if ( !hbitmap )
{
- wxLogLastError(_T("CreateBitmap(mask)"));
+ wxLogLastError(wxT("CreateBitmap(mask)"));
}
else
{
if ( !selectDst )
{
- wxLogLastError(_T("SelectObject(destBitmap)"));
+ wxLogLastError(wxT("SelectObject(destBitmap)"));
}
if ( !::BitBlt(dcDst, 0, 0, rect.width, rect.height,
(HDC)hdc, rect.x, rect.y, SRCCOPY) )
{
- wxLogLastError(_T("BitBlt"));
+ wxLogLastError(wxT("BitBlt"));
}
}
if ( !::BitBlt(dcDst, 0, 0, rect.width, rect.height,
dcSrc, rect.x, rect.y, SRCCOPY) )
{
- wxLogLastError(_T("BitBlt"));
+ wxLogLastError(wxT("BitBlt"));
}
wxMask *mask = new wxMask((WXHBITMAP) hbmpMask);
if ( !GetBitmapData()->m_isDIB )
{
wxCHECK_MSG( !GetBitmapData()->m_dib, NULL,
- _T("GetRawData() may be called only once") );
+ wxT("GetRawData() may be called only once") );
wxDIB *dib = new wxDIB(*this);
if ( !dib->IsOk() )
DIBSECTION ds;
if ( ::GetObject(hDIB, sizeof(ds), &ds) != sizeof(DIBSECTION) )
{
- wxFAIL_MSG( _T("failed to get DIBSECTION from a DIB?") );
+ wxFAIL_MSG( wxT("failed to get DIBSECTION from a DIB?") );
return NULL;
}
// check that the bitmap is in correct format
if ( ds.dsBm.bmBitsPixel != bpp )
{
- wxFAIL_MSG( _T("incorrect bitmap type in wxBitmap::GetRawData()") );
+ wxFAIL_MSG( wxT("incorrect bitmap type in wxBitmap::GetRawData()") );
return NULL;
}
{
#ifndef __WXMICROWIN__
wxCHECK_MSG( bitmap.Ok() && bitmap.GetDepth() == 1, false,
- _T("can't create mask from invalid or not monochrome bitmap") );
+ wxT("can't create mask from invalid or not monochrome bitmap") );
if ( m_maskBitmap )
{
bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
{
#ifndef __WXMICROWIN__
- wxCHECK_MSG( bitmap.Ok(), false, _T("invalid bitmap in wxMask::Create") );
+ wxCHECK_MSG( bitmap.Ok(), false, wxT("invalid bitmap in wxMask::Create") );
if ( m_maskBitmap )
{
// SelectObject() will fail
wxASSERT_MSG( !bitmap.GetSelectedInto(),
- _T("bitmap can't be selected in another DC") );
+ wxT("bitmap can't be selected in another DC") );
HGDIOBJ hbmpSrcOld = ::SelectObject(srcDC, GetHbitmapOf(bitmap));
if ( !hbmpSrcOld )
if ( !::BitBlt(dcDst, 0, 0, bmp.GetWidth(), bmp.GetHeight(),
dcSrc, 0, 0, SRCAND) )
{
- wxLogLastError(_T("BitBlt"));
+ wxLogLastError(wxT("BitBlt"));
}
}
HBITMAP wxInvertMask(HBITMAP hbmpMask, int w, int h)
{
#ifndef __WXMICROWIN__
- wxCHECK_MSG( hbmpMask, 0, _T("invalid bitmap in wxInvertMask") );
+ wxCHECK_MSG( hbmpMask, 0, wxT("invalid bitmap in wxInvertMask") );
// get width/height from the bitmap if not given
if ( !w || !h )
break;
default:
- wxFAIL_MSG( _T("unknown brush style") );
+ wxFAIL_MSG( wxT("unknown brush style") );
// fall through
case wxBRUSHSTYLE_SOLID:
if ( !m_hBrush )
{
- wxLogLastError(_T("CreateXXXBrush()"));
+ wxLogLastError(wxT("CreateXXXBrush()"));
}
}
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->GetColour();
}
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->GetStyle();
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
return M_BRUSHDATA->GetStipple();
}
WXHANDLE wxBrush::GetResourceHandle() const
{
- wxCHECK_MSG( Ok(), FALSE, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), FALSE, wxT("invalid brush") );
return (WXHANDLE)M_BRUSHDATA->GetHBRUSH();
}
// the control unless it already has new lines in its label)
long styleOld = ::GetWindowLong(hwnd, GWL_STYLE),
styleNew;
- if ( label.find(_T('\n')) != wxString::npos )
+ if ( label.find(wxT('\n')) != wxString::npos )
styleNew = styleOld | BS_MULTILINE;
else
styleNew = styleOld & ~BS_MULTILINE;
// value and the label is not set yet when MSWGetStyle() is called
msStyle |= wxMSWButton::GetMultilineStyle(label);
- return MSWCreateControl(_T("BUTTON"), msStyle, pos, size, label, exstyle);
+ return MSWCreateControl(wxT("BUTTON"), msStyle, pos, size, label, exstyle);
}
wxButton::~wxButton()
win = parent;
}
- wxASSERT_MSG( win, _T("button without top level parent?") );
+ wxASSERT_MSG( win, wxT("button without top level parent?") );
wxTopLevelWindow * const tlw = wxDynamicCast(win, wxTopLevelWindow);
- wxASSERT_MSG( tlw, _T("logic error in GetTLWParentIfNotBeingDeleted()") );
+ wxASSERT_MSG( tlw, wxT("logic error in GetTLWParentIfNotBeingDeleted()") );
return tlw;
}
return;
wxWindow * const tlw = wxGetTopLevelParent(btn);
- wxCHECK_RET( tlw, _T("button without top level window?") );
+ wxCHECK_RET( tlw, wxT("button without top level window?") );
::SendMessage(GetHwndOf(tlw), DM_SETDEFID, btn->GetId(), 0L);
// center text horizontally in any case
flags |= DT_CENTER;
- if ( text.find(_T('\n')) != wxString::npos )
+ if ( text.find(wxT('\n')) != wxString::npos )
{
// draw multiline label
}
else
{
- wxLogLastError(_T("GetClassInfoEx(SysMonthCal32)"));
+ wxLogLastError(wxT("GetClassInfoEx(SysMonthCal32)"));
}
}
dt.GetAsMSWSysTime(&st);
if ( !MonthCal_SetCurSel(GetHwnd(), &st) )
{
- wxLogDebug(_T("DateTime_SetSystemtime() failed"));
+ wxLogDebug(wxT("DateTime_SetSystemtime() failed"));
return false;
}
if ( !MonthCal_SetRange(GetHwnd(), flags, st) )
{
- wxLogDebug(_T("MonthCal_SetRange() failed"));
+ wxLogDebug(wxT("MonthCal_SetRange() failed"));
}
return flags != 0;
if ( !MonthCal_SetDayState(GetHwnd(), nMonths, states) )
{
- wxLogLastError(_T("MonthCal_SetDayState"));
+ wxLogLastError(wxT("MonthCal_SetDayState"));
}
}
#define CALL_CARET_API(api, args) \
if ( !api args ) \
- wxLogLastError(_T(#api))
+ wxLogLastError(wxT(#api))
// ===========================================================================
// implementation
break;
default:
- wxFAIL_MSG( _T("unexpected Get3StateValue() return value") );
+ wxFAIL_MSG( wxT("unexpected Get3StateValue() return value") );
// fall through
case wxCHK_UNCHECKED:
if ( !::DrawText(hdc, label.wx_str(), label.length(), &rectLabel,
fmt | DT_CALCRECT) )
{
- wxLogLastError(_T("DrawText(DT_CALCRECT)"));
+ wxLogLastError(wxT("DrawText(DT_CALCRECT)"));
}
}
if ( !::DrawText(hdc, label.wx_str(), label.length(), &rectLabel, fmt) )
{
- wxLogLastError(_T("DrawText()"));
+ wxLogLastError(wxT("DrawText()"));
}
// finally draw the focus
rectLabel.right++;
if ( !::DrawFocusRect(hdc, &rectLabel) )
{
- wxLogLastError(_T("DrawFocusRect()"));
+ wxLogLastError(wxT("DrawFocusRect()"));
}
}
bool wxCheckListBox::IsChecked(unsigned int uiIndex) const
{
- wxCHECK_MSG( IsValid(uiIndex), false, _T("bad wxCheckListBox index") );
+ wxCHECK_MSG( IsValid(uiIndex), false, wxT("bad wxCheckListBox index") );
return GetItem(uiIndex)->IsChecked();
}
void wxCheckListBox::Check(unsigned int uiIndex, bool bCheck)
{
- wxCHECK_RET( IsValid(uiIndex), _T("bad wxCheckListBox index") );
+ wxCHECK_RET( IsValid(uiIndex), wxT("bad wxCheckListBox index") );
GetItem(uiIndex)->Check(bCheck);
}
wxCheckListBoxItem *item = GetItem(selections[i]);
if ( !item )
{
- wxFAIL_MSG( _T("no wxCheckListBoxItem?") );
+ wxFAIL_MSG( wxT("no wxCheckListBoxItem?") );
continue;
}
break;
default:
- wxFAIL_MSG( _T("what should this key do?") );
+ wxFAIL_MSG( wxT("what should this key do?") );
}
// we should send an event as this has been done by the user and
wxASSERT_MSG( !(style & wxCB_DROPDOWN) &&
!(style & wxCB_READONLY) &&
!(style & wxCB_SIMPLE),
- _T("this style flag is ignored by wxChoice, you ")
- _T("probably want to use a wxComboBox") );
+ wxT("this style flag is ignored by wxChoice, you ")
+ wxT("probably want to use a wxComboBox") );
return CreateAndInit(parent, id, pos, size, n, choices, style,
validator, name);
return;
}
- wxLogApiError(_T("GetThemeColor(EDIT, ETS_NORMAL, TMT_FILLCOLOR)"), hr);
+ wxLogApiError(wxT("GetThemeColor(EDIT, ETS_NORMAL, TMT_FILLCOLOR)"), hr);
}
#endif
// longer, check for it to avoid bogus assert failures
if ( !win->IsBeingDeleted() )
{
- wxFAIL_MSG( _T("should have combo as parent") );
+ wxFAIL_MSG( wxT("should have combo as parent") );
}
}
else if ( combo->MSWProcessEditMsg(message, wParam, lParam) )
case WM_GETDLGCODE:
{
- wxCHECK_MSG( win, 0, _T("should have a parent") );
+ wxCHECK_MSG( win, 0, wxT("should have a parent") );
if ( win->GetWindowStyle() & wxTE_PROCESS_ENTER )
{
// this function should not be called for wxCB_READONLY controls, it is
// the callers responsibility to check this
wxASSERT_MSG( !HasFlag(wxCB_READONLY),
- _T("read-only combobox doesn't have any edit control") );
+ wxT("read-only combobox doesn't have any edit control") );
WXHWND hWndEdit = GetEditHWNDIfAvailable();
- wxASSERT_MSG( hWndEdit, _T("combobox without edit control?") );
+ wxASSERT_MSG( hWndEdit, wxT("combobox without edit control?") );
return hWndEdit;
}
wxWindow *wxComboBox::GetEditableWindow()
{
wxASSERT_MSG( !HasFlag(wxCB_READONLY),
- _T("read-only combobox doesn't have any edit control") );
+ wxT("read-only combobox doesn't have any edit control") );
return this;
}
{
wxLogLastError(wxString::Format
(
- _T("CreateWindowEx(\"%s\", flags=%08lx, ex=%08lx)"),
+ wxT("CreateWindowEx(\"%s\", flags=%08lx, ex=%08lx)"),
classname, style, exstyle
));
void Output(const wxChar *format, ...);
// output end of line
- void OutputEndl() { Output(_T("\r\n")); }
+ void OutputEndl() { Output(wxT("\r\n")); }
// the handle of the report file
HANDLE m_hFile;
if ( !ep )
{
- Output(_T("Context for crash report generation not available."));
+ Output(wxT("Context for crash report generation not available."));
return false;
}
TCHAR envFlags[64];
DWORD dwLen = ::GetEnvironmentVariable
(
- _T("WX_CRASH_FLAGS"),
+ wxT("WX_CRASH_FLAGS"),
envFlags,
WXSIZEOF(envFlags)
);
int flagsEnv;
if ( dwLen && dwLen < WXSIZEOF(envFlags) &&
- wxSscanf(envFlags, _T("%d"), &flagsEnv) == 1 )
+ wxSscanf(envFlags, wxT("%d"), &flagsEnv) == 1 )
{
flags = flagsEnv;
}
NULL // no callbacks
) )
{
- Output(_T("MiniDumpWriteDump() failed."));
+ Output(wxT("MiniDumpWriteDump() failed."));
return false;
}
}
else // dbghelp.dll couldn't be loaded
{
- Output(_T("%s"), wxDbgHelpDLL::GetErrorMessage().c_str());
+ Output(wxT("%s"), wxDbgHelpDLL::GetErrorMessage().c_str());
}
#else // !wxUSE_DBGHELP
wxUnusedVar(flags);
wxUnusedVar(ep);
- Output(_T("Support for crash report generation was not included ")
- _T("in this wxWidgets version."));
+ Output(wxT("Support for crash report generation was not included ")
+ wxT("in this wxWidgets version."));
#endif // wxUSE_DBGHELP/!wxUSE_DBGHELP
return false;
if ( !ep )
{
- wxCHECK_RET( wxGlobalSEInformation, _T("no exception info available") );
+ wxCHECK_RET( wxGlobalSEInformation, wxT("no exception info available") );
ep = wxGlobalSEInformation;
}
{
wxString s;
- #define CASE_EXCEPTION( x ) case EXCEPTION_##x: s = _T(#x); break
+ #define CASE_EXCEPTION( x ) case EXCEPTION_##x: s = wxT(#x); break
switch ( code )
{
(
FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_FROM_HMODULE,
- ::GetModuleHandle(_T("NTDLL.DLL")),
+ ::GetModuleHandle(wxT("NTDLL.DLL")),
code,
0,
wxStringBuffer(s, 1024),
0
) )
{
- s.Printf(_T("UNKNOWN_EXCEPTION(%d)"), code);
+ s.Printf(wxT("UNKNOWN_EXCEPTION(%d)"), code);
}
}
wxASSERT_MSG( hotSpotX >= 0 && hotSpotX < image_w &&
hotSpotY >= 0 && hotSpotY < image_h,
- _T("invalid cursor hot spot coordinates") );
+ wxT("invalid cursor hot spot coordinates") );
wxImage imageSized(image); // final image of correct size
break;
default:
- wxLogError( _T("unknown cursor resource type '%d'"), kind );
+ wxLogError( wxT("unknown cursor resource type '%d'"), kind );
hcursor = NULL;
}
{
{ true, NULL }, // wxCURSOR_NONE
{ true, IDC_ARROW }, // wxCURSOR_ARROW
- { false, _T("WXCURSOR_RIGHT_ARROW") }, // wxCURSOR_RIGHT_ARROW
- { false, _T("WXCURSOR_BULLSEYE") }, // wxCURSOR_BULLSEYE
+ { false, wxT("WXCURSOR_RIGHT_ARROW") }, // wxCURSOR_RIGHT_ARROW
+ { false, wxT("WXCURSOR_BULLSEYE") }, // wxCURSOR_BULLSEYE
{ true, IDC_ARROW }, // WXCURSOR_CHAR
// Displays as an I-beam on XP, so use a cursor file
// { true, IDC_CROSS }, // WXCURSOR_CROSS
- { false, _T("WXCURSOR_CROSS") }, // WXCURSOR_CROSS
+ { false, wxT("WXCURSOR_CROSS") }, // WXCURSOR_CROSS
// See special handling below for wxCURSOR_HAND
-// { false, _T("WXCURSOR_HAND") }, // wxCURSOR_HAND
+// { false, wxT("WXCURSOR_HAND") }, // wxCURSOR_HAND
{ true, IDC_HAND }, // wxCURSOR_HAND
{ true, IDC_IBEAM }, // WXCURSOR_IBEAM
{ true, IDC_ARROW }, // WXCURSOR_LEFT_BUTTON
- { false, _T("WXCURSOR_MAGNIFIER") }, // wxCURSOR_MAGNIFIER
+ { false, wxT("WXCURSOR_MAGNIFIER") }, // wxCURSOR_MAGNIFIER
{ true, IDC_ARROW }, // WXCURSOR_MIDDLE_BUTTON
{ true, IDC_NO }, // WXCURSOR_NO_ENTRY
- { false, _T("WXCURSOR_PBRUSH") }, // wxCURSOR_PAINT_BRUSH
- { false, _T("WXCURSOR_PENCIL") }, // wxCURSOR_PENCIL
- { false, _T("WXCURSOR_PLEFT") }, // wxCURSOR_POINT_LEFT
- { false, _T("WXCURSOR_PRIGHT") }, // wxCURSOR_POINT_RIGHT
+ { false, wxT("WXCURSOR_PBRUSH") }, // wxCURSOR_PAINT_BRUSH
+ { false, wxT("WXCURSOR_PENCIL") }, // wxCURSOR_PENCIL
+ { false, wxT("WXCURSOR_PLEFT") }, // wxCURSOR_POINT_LEFT
+ { false, wxT("WXCURSOR_PRIGHT") }, // wxCURSOR_POINT_RIGHT
{ true, IDC_HELP }, // WXCURSOR_QUESTION_ARROW
{ true, IDC_ARROW }, // WXCURSOR_RIGHT_BUTTON
{ true, IDC_SIZENESW }, // WXCURSOR_SIZENESW
{ true, IDC_SIZENWSE }, // WXCURSOR_SIZENWSE
{ true, IDC_SIZEWE }, // WXCURSOR_SIZEWE
{ true, IDC_SIZEALL }, // WXCURSOR_SIZING
- { false, _T("WXCURSOR_PBRUSH") }, // wxCURSOR_SPRAYCAN
+ { false, wxT("WXCURSOR_PBRUSH") }, // wxCURSOR_SPRAYCAN
{ true, IDC_WAIT }, // WXCURSOR_WAIT
{ true, IDC_WAIT }, // WXCURSOR_WATCH
- { false, _T("WXCURSOR_BLANK") }, // wxCURSOR_BLANK
+ { false, wxT("WXCURSOR_BLANK") }, // wxCURSOR_BLANK
{ true, IDC_APPSTARTING }, // wxCURSOR_ARROWWAIT
// no entry for wxCURSOR_MAX
CursorsIdArrayMismatch );
wxCHECK_RET( idCursor > 0 && (size_t)idCursor < WXSIZEOF(stdCursors),
- _T("invalid cursor id in wxCursor() ctor") );
+ wxT("invalid cursor id in wxCursor() ctor") );
const StdCursor& stdCursor = stdCursors[idCursor];
bool deleteLater = !stdCursor.isStd;
// IDC_HAND may not be available on some versions of Windows.
if ( !hcursor && idCursor == wxCURSOR_HAND)
{
- hcursor = ::LoadCursor(wxGetInstance(), _T("WXCURSOR_HAND"));
+ hcursor = ::LoadCursor(wxGetInstance(), wxT("WXCURSOR_HAND"));
deleteLater = true;
}
if ( !hcursor )
{
- wxLogLastError(_T("LoadCursor"));
+ wxLogLastError(wxT("LoadCursor"));
}
else
{
// see comment in wxApp::GetComCtl32Version() explaining the
// use of wxLoadedDLL
- wxLoadedDLL dllComCtl32(_T("comctl32.dll"));
+ wxLoadedDLL dllComCtl32(wxT("comctl32.dll"));
if ( dllComCtl32.IsLoaded() )
{
wxLogNull noLog;
const DWORD rc = ::GetLastError();
if ( rc != ERROR_INSUFFICIENT_BUFFER )
{
- wxLogApiError(_T("GetDateFormat"), rc);
+ wxLogApiError(wxT("GetDateFormat"), rc);
// fall back on wxDateTime, what else to do?
s = wxDateTime::Today().FormatDate();
// representation of todays date because the control must accommodate any
// date and while the widths of all digits are usually about the same, the
// width of the month string varies a lot, so try to account for it
- s += _T("WW");
+ s += wxT("WW");
int x, y;
dc.GetTextExtent(s, &x, &y);
void wxDatePickerCtrl::SetValue(const wxDateTime& dt)
{
wxCHECK_RET( dt.IsValid() || HasFlag(wxDP_ALLOWNONE),
- _T("this control requires a valid date") );
+ wxT("this control requires a valid date") );
SYSTEMTIME st;
if ( dt.IsValid() )
dt.IsValid() ? GDT_VALID : GDT_NONE,
&st) )
{
- wxLogDebug(_T("DateTime_SetSystemtime() failed"));
+ wxLogDebug(wxT("DateTime_SetSystemtime() failed"));
}
// we need to keep only the date part, times don't make sense for this
wxASSERT_MSG( m_date.IsValid() == dt.IsValid() &&
(!dt.IsValid() || dt == m_date),
- _T("bug in wxDatePickerCtrl: m_date not in sync") );
+ wxT("bug in wxDatePickerCtrl: m_date not in sync") );
#endif // wxDEBUG_LEVEL
return m_date;
if ( !DateTime_SetRange(GetHwnd(), flags, st) )
{
- wxLogDebug(_T("DateTime_SetRange() failed"));
+ wxLogDebug(wxT("DateTime_SetRange() failed"));
}
}
m_modeOld = ::SetStretchBltMode(m_hdc, COLORONCOLOR);
if ( !m_modeOld )
{
- wxLogLastError(_T("SetStretchBltMode"));
+ wxLogLastError(wxT("SetStretchBltMode"));
}
}
{
if ( !::SetStretchBltMode(m_hdc, m_modeOld) )
{
- wxLogLastError(_T("SetStretchBltMode"));
+ wxLogLastError(wxT("SetStretchBltMode"));
}
}
const wxChar *m_dllName;
};
-static wxOnceOnlyDLLLoader wxMSIMG32DLL(_T("msimg32"));
+static wxOnceOnlyDLLLoader wxMSIMG32DLL(wxT("msimg32"));
// we must ensure that DLLs are unloaded before the static objects cleanup time
// because we may hit the notorious DllMain() dead lock in this case if wx is
#else // !WinCE
if ( ::ExtSelectClipRgn(GetHdc(), (HRGN)hrgn, RGN_AND) == ERROR )
{
- wxLogLastError(_T("ExtSelectClipRgn"));
+ wxLogLastError(wxT("ExtSelectClipRgn"));
return;
}
LogicalToDeviceY(y + h));
if ( !hrgn )
{
- wxLogLastError(_T("CreateRectRgn"));
+ wxLogLastError(wxT("CreateRectRgn"));
}
else
{
{
WXMICROWIN_CHECK_HDC_RET(false)
- wxCHECK_MSG( col, false, _T("NULL colour parameter in wxMSWDCImpl::GetPixel") );
+ wxCHECK_MSG( col, false, wxT("NULL colour parameter in wxMSWDCImpl::GetPixel") );
// get the color of the pixel
COLORREF pixelcolor = ::GetPixel(GetHdc(), XLOG2DEV(x), YLOG2DEV(y));
{
WXMICROWIN_CHECK_HDC
- wxCHECK_RET( bmp.IsOk(), _T("invalid bitmap in wxMSWDCImpl::DrawBitmap") );
+ wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap in wxMSWDCImpl::DrawBitmap") );
int width = bmp.GetWidth(),
height = bmp.GetHeight();
HGDIOBJ hfont = ::SelectObject(GetHdc(), GetHfontOf(font));
if ( hfont == HGDI_ERROR )
{
- wxLogLastError(_T("SelectObject(font)"));
+ wxLogLastError(wxT("SelectObject(font)"));
}
else // selected ok
{
{
if ( ::SelectObject(GetHdc(), (HPEN) m_oldFont) == HGDI_ERROR )
{
- wxLogLastError(_T("SelectObject(old font)"));
+ wxLogLastError(wxT("SelectObject(old font)"));
}
m_oldFont = 0;
HGDIOBJ hpen = ::SelectObject(GetHdc(), GetHpenOf(pen));
if ( hpen == HGDI_ERROR )
{
- wxLogLastError(_T("SelectObject(pen)"));
+ wxLogLastError(wxT("SelectObject(pen)"));
}
else // selected ok
{
{
if ( ::SelectObject(GetHdc(), (HPEN) m_oldPen) == HGDI_ERROR )
{
- wxLogLastError(_T("SelectObject(old pen)"));
+ wxLogLastError(wxT("SelectObject(old pen)"));
}
m_oldPen = 0;
NULL // [out] previous brush origin
) )
{
- wxLogLastError(_T("SetBrushOrgEx()"));
+ wxLogLastError(wxT("SetBrushOrgEx()"));
}
}
HGDIOBJ hbrush = ::SelectObject(GetHdc(), GetHbrushOf(brush));
if ( hbrush == HGDI_ERROR )
{
- wxLogLastError(_T("SelectObject(brush)"));
+ wxLogLastError(wxT("SelectObject(brush)"));
}
else // selected ok
{
{
if ( ::SelectObject(GetHdc(), (HPEN) m_oldBrush) == HGDI_ERROR )
{
- wxLogLastError(_T("SelectObject(old brush)"));
+ wxLogLastError(wxT("SelectObject(old brush)"));
}
m_oldBrush = 0;
HFONT hfontOld;
if ( font )
{
- wxASSERT_MSG( font->IsOk(), _T("invalid font in wxMSWDCImpl::GetTextExtent") );
+ wxASSERT_MSG( font->IsOk(), wxT("invalid font in wxMSWDCImpl::GetTextExtent") );
hfontOld = (HFONT)::SelectObject(GetHdc(), GetHfontOf(*font));
}
const size_t len = string.length();
if ( !::GetTextExtentPoint32(GetHdc(), string.wx_str(), len, &sizeRect) )
{
- wxLogLastError(_T("GetTextExtentPoint32()"));
+ wxLogLastError(wxT("GetTextExtentPoint32()"));
}
#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)
break;
default:
- wxFAIL_MSG( _T("unknown mapping mode in SetMapMode") );
+ wxFAIL_MSG( wxT("unknown mapping mode in SetMapMode") );
}
}
wxRasterOperationMode rop, bool useMask,
wxCoord xsrcMask, wxCoord ysrcMask)
{
- wxCHECK_MSG( source, false, _T("wxMSWDCImpl::Blit(): NULL wxDC pointer") );
+ wxCHECK_MSG( source, false, wxT("wxMSWDCImpl::Blit(): NULL wxDC pointer") );
WXMICROWIN_CHECK_HDC_RET(false)
dwRop
) )
{
- wxLogLastError(_T("StretchBlt"));
+ wxLogLastError(wxT("StretchBlt"));
}
else
{
if ( !::BitBlt(GetHdc(), xdest, ydest, dstWidth, dstHeight,
hdcSrc, xsrc, ysrc, dwRop) )
{
- wxLogLastError(_T("BitBlt"));
+ wxLogLastError(wxT("BitBlt"));
}
else
{
{
int wTotal = ::GetDeviceCaps(GetHdc(), HORZRES);
- wxCHECK_RET( wTotal, _T("0 width device?") );
+ wxCHECK_RET( wTotal, wxT("0 width device?") );
*w = (wPixels * ::GetDeviceCaps(GetHdc(), HORZSIZE)) / wTotal;
}
{
int hTotal = ::GetDeviceCaps(GetHdc(), VERTRES);
- wxCHECK_RET( hTotal, _T("0 height device?") );
+ wxCHECK_RET( hTotal, wxT("0 height device?") );
*h = (hPixels * ::GetDeviceCaps(GetHdc(), VERTSIZE)) / hTotal;
}
HDC hdcSrc,
const wxBitmap& bmp)
{
- wxASSERT_MSG( bmp.IsOk() && bmp.HasAlpha(), _T("AlphaBlt(): invalid bitmap") );
- wxASSERT_MSG( hdcDst && hdcSrc, _T("AlphaBlt(): invalid HDC") );
+ wxASSERT_MSG( bmp.IsOk() && bmp.HasAlpha(), wxT("AlphaBlt(): invalid bitmap") );
+ wxASSERT_MSG( hdcDst && hdcSrc, wxT("AlphaBlt(): invalid HDC") );
// do we have AlphaBlend() and company in the headers?
#if defined(AC_SRC_OVER) && wxUSE_DYNLIB_CLASS
BLENDFUNCTION);
static AlphaBlend_t
- pfnAlphaBlend = (AlphaBlend_t)wxMSIMG32DLL.GetSymbol(_T("AlphaBlend"));
+ pfnAlphaBlend = (AlphaBlend_t)wxMSIMG32DLL.GetSymbol(wxT("AlphaBlend"));
if ( pfnAlphaBlend )
{
BLENDFUNCTION bf;
return true;
}
- wxLogLastError(_T("AlphaBlend"));
+ wxLogLastError(wxT("AlphaBlend"));
}
#else
wxUnusedVar(hdcSrc);
if ( !::BitBlt(hdcMem, 0, 0, dstWidth, dstHeight, hdcDst, xDst, yDst, SRCCOPY) )
{
- wxLogLastError(_T("BitBlt"));
+ wxLogLastError(wxT("BitBlt"));
}
// combine them with the source bitmap using alpha
dataSrc((wxBitmap &)bmpSrc);
wxCHECK_RET( dataDst && dataSrc,
- _T("failed to get raw data in wxAlphaBlend") );
+ wxT("failed to get raw data in wxAlphaBlend") );
wxAlphaPixelData::Iterator pDst(dataDst),
pSrc(dataSrc);
// and finally blit them back to the destination DC
if ( !::BitBlt(hdcDst, xDst, yDst, dstWidth, dstHeight, hdcMem, 0, 0, SRCCOPY) )
{
- wxLogLastError(_T("BitBlt"));
+ wxLogLastError(wxT("BitBlt"));
}
}
typedef BOOL
(WINAPI *GradientFill_t)(HDC, PTRIVERTEX, ULONG, PVOID, ULONG, ULONG);
static GradientFill_t pfnGradientFill =
- (GradientFill_t)wxMSIMG32DLL.GetSymbol(_T("GradientFill"));
+ (GradientFill_t)wxMSIMG32DLL.GetSymbol(wxT("GradientFill"));
if ( pfnGradientFill )
{
return;
}
- wxLogLastError(_T("GradientFill"));
+ wxLogLastError(wxT("GradientFill"));
}
#endif // wxUSE_DYNLIB_CLASS
{
typedef DWORD (WINAPI *GetLayout_t)(HDC);
static GetLayout_t
- wxDL_INIT_FUNC(s_pfn, GetLayout, wxDynamicLibrary(_T("gdi32.dll")));
+ wxDL_INIT_FUNC(s_pfn, GetLayout, wxDynamicLibrary(wxT("gdi32.dll")));
return s_pfnGetLayout ? s_pfnGetLayout(hdc) : (DWORD)-1;
}
{
typedef DWORD (WINAPI *SetLayout_t)(HDC, DWORD);
static SetLayout_t
- wxDL_INIT_FUNC(s_pfn, SetLayout, wxDynamicLibrary(_T("gdi32.dll")));
+ wxDL_INIT_FUNC(s_pfn, SetLayout, wxDynamicLibrary(wxT("gdi32.dll")));
if ( !s_pfnSetLayout )
return;
wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) :
wxMSWDCImpl( owner )
{
- wxCHECK_RET( window, _T("invalid window in wxWindowDCImpl") );
+ wxCHECK_RET( window, wxT("invalid window in wxWindowDCImpl") );
m_window = window;
m_hDC = (WXHDC) ::GetWindowDC(GetHwndOf(m_window));
void wxWindowDCImpl::DoGetSize(int *width, int *height) const
{
- wxCHECK_RET( m_window, _T("wxWindowDCImpl without a window?") );
+ wxCHECK_RET( m_window, wxT("wxWindowDCImpl without a window?") );
m_window->GetSize(width, height);
}
wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) :
wxWindowDCImpl( owner )
{
- wxCHECK_RET( window, _T("invalid window in wxClientDCImpl") );
+ wxCHECK_RET( window, wxT("invalid window in wxClientDCImpl") );
m_window = window;
m_hDC = (WXHDC)::GetDC(GetHwndOf(window));
void wxClientDCImpl::DoGetSize(int *width, int *height) const
{
- wxCHECK_RET( m_window, _T("wxClientDCImpl without a window?") );
+ wxCHECK_RET( m_window, wxT("wxClientDCImpl without a window?") );
m_window->GetClientSize(width, height);
}
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc )
: wxMSWDCImpl( owner )
{
- wxCHECK_RET( dc, _T("NULL dc in wxMemoryDC ctor") );
+ wxCHECK_RET( dc, wxT("NULL dc in wxMemoryDC ctor") );
CreateCompatible(dc);
);
if ( !hDC )
{
- wxLogLastError(_T("CreateDC(printer)"));
+ wxLogLastError(wxT("CreateDC(printer)"));
}
return (WXHDC) hDC;
DIBSECTION ds;
if ( !::GetObject(dib.GetHandle(), sizeof(ds), &ds) )
{
- wxLogLastError(_T("GetObject(DIBSECTION)"));
+ wxLogLastError(wxT("GetObject(DIBSECTION)"));
return false;
}
wxCoord x, wxCoord y,
bool useMask)
{
- wxCHECK_RET( bmp.Ok(), _T("invalid bitmap in wxPrinterDC::DrawBitmap") );
+ wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") );
int width = bmp.GetWidth(),
height = bmp.GetHeight();
UINT rc = DdeInitialize(&DDEIdInst, callback, APPCLASS_STANDARD, 0L);
if ( rc != DMLERR_NO_ERROR )
{
- DDELogError(_T("Failed to initialize DDE"), rc);
+ DDELogError(wxT("Failed to initialize DDE"), rc);
}
else
{
// deleting them later won't work as DDE won't be initialized any more
wxASSERT_MSG( wxDDEServerObjects.empty() &&
wxDDEClientObjects.empty(),
- _T("all DDE objects should be deleted by now") );
+ wxT("all DDE objects should be deleted by now") );
wxAtomTable.clear();
bool ok = DdeDisconnect(GetHConv()) != 0;
if ( !ok )
{
- DDELogError(_T("Failed to disconnect from DDE server gracefully"));
+ DDELogError(wxT("Failed to disconnect from DDE server gracefully"));
}
SetConnected( false ); // so we don't try and disconnect again
format == wxIPC_UTF8TEXT ||
format == wxIPC_UNICODETEXT,
false,
- _T("wxDDEServer::Execute() supports only text data") );
+ wxT("wxDDEServer::Execute() supports only text data") );
wxMemoryBuffer buffer;
LPBYTE realData = NULL;
// we could implement this in theory but it's not obvious how to pass
// the format information and, basically, why bother -- just use
// Unicode build
- wxFAIL_MSG( _T("UTF-8 text not supported in ANSI build") );
+ wxFAIL_MSG( wxT("UTF-8 text not supported in ANSI build") );
return false;
}
if ( !ok )
{
- DDELogError(_T("DDE execute request failed"));
+ DDELogError(wxT("DDE execute request failed"));
}
return ok;
&result);
if ( !returned_data )
{
- DDELogError(_T("DDE data request failed"));
+ DDELogError(wxT("DDE data request failed"));
return NULL;
}
void *data = GetBufferAtLeast(len);
wxASSERT_MSG(data != NULL,
- _T("Buffer too small in wxDDEConnection::Request") );
+ wxT("Buffer too small in wxDDEConnection::Request") );
(void) DdeGetData(returned_data, (LPBYTE)data, len, 0);
(void) DdeFreeDataHandle(returned_data);
void *data = connection->GetBufferAtLeast(len);
wxASSERT_MSG(data != NULL,
- _T("Buffer too small in _DDECallback (XTYP_EXECUTE)") );
+ wxT("Buffer too small in _DDECallback (XTYP_EXECUTE)") );
DdeGetData(hData, (LPBYTE)data, len, 0);
void *data = connection->GetBufferAtLeast(len);
wxASSERT_MSG(data != NULL,
- _T("Buffer too small in _DDECallback (XTYP_POKE)") );
+ wxT("Buffer too small in _DDECallback (XTYP_POKE)") );
DdeGetData(hData, (LPBYTE)data, len, 0);
void *data = connection->GetBufferAtLeast(len);
wxASSERT_MSG(data != NULL,
- _T("Buffer too small in _DDECallback (XTYP_ADVDATA)") );
+ wxT("Buffer too small in _DDECallback (XTYP_ADVDATA)") );
DdeGetData(hData, (LPBYTE)data, len, 0);
*/
static HSZ DDEAtomFromString(const wxString& s)
{
- wxASSERT_MSG( DDEIdInst, _T("DDE not initialized") );
+ wxASSERT_MSG( DDEIdInst, wxT("DDE not initialized") );
HSZ hsz = DdeCreateStringHandle(DDEIdInst, (wxChar*)s.wx_str(), DDE_CP);
if ( !hsz )
error = DdeGetLastError(DDEIdInst);
}
- wxLogError(s + _T(": ") + DDEGetErrorMsg(error));
+ wxLogError(s + wxT(": ") + DDEGetErrorMsg(error));
}
static wxString DDEGetErrorMsg(UINT error)
{
#define LOAD_SYM_FUNCTION(name) \
wxDbgHelpDLL::name = (wxDbgHelpDLL::name ## _t) \
- dllDbgHelp.GetSymbol(_T(#name)); \
+ dllDbgHelp.GetSymbol(wxT(#name)); \
if ( !wxDbgHelpDLL::name ) \
{ \
- gs_errMsg += _T("Function ") _T(#name) _T("() not found.\n"); \
+ gs_errMsg += wxT("Function ") wxT(#name) wxT("() not found.\n"); \
return false; \
}
// called by Init() if we hadn't done this before
static bool DoInit()
{
- wxDynamicLibrary dllDbgHelp(_T("dbghelp.dll"), wxDL_VERBATIM);
+ wxDynamicLibrary dllDbgHelp(wxT("dbghelp.dll"), wxDL_VERBATIM);
if ( dllDbgHelp.IsLoaded() )
{
if ( BindDbgHelpFunctions(dllDbgHelp) )
return true;
}
- gs_errMsg += _T("\nPlease update your dbghelp.dll version, ")
- _T("at least version 5.1 is needed!\n")
- _T("(if you already have a new version, please ")
- _T("put it in the same directory where the program is.)\n");
+ gs_errMsg += wxT("\nPlease update your dbghelp.dll version, ")
+ wxT("at least version 5.1 is needed!\n")
+ wxT("(if you already have a new version, please ")
+ wxT("put it in the same directory where the program is.)\n");
}
else // failed to load dbghelp.dll
{
- gs_errMsg += _T("Please install dbghelp.dll available free of charge ")
- _T("from Microsoft to get more detailed crash information!");
+ gs_errMsg += wxT("Please install dbghelp.dll available free of charge ")
+ wxT("from Microsoft to get more detailed crash information!");
}
- gs_errMsg += _T("\nLatest dbghelp.dll is available at ")
- _T("http://www.microsoft.com/whdc/ddk/debugging/\n");
+ gs_errMsg += wxT("\nLatest dbghelp.dll is available at ")
+ wxT("http://www.microsoft.com/whdc/ddk/debugging/\n");
return false;
}
/* static */
void wxDbgHelpDLL::LogError(const wxChar *func)
{
- ::OutputDebugString(wxString::Format(_T("dbghelp: %s() failed: %s\r\n"),
+ ::OutputDebugString(wxString::Format(wxT("dbghelp: %s() failed: %s\r\n"),
func, wxSysErrorMsg(::GetLastError())).wx_str());
}
{
if ( !pAddress )
{
- return _T("null");
+ return wxT("null");
}
if ( ::IsBadReadPtr(pAddress, length) != 0 )
{
- return _T("BAD");
+ return wxT("BAD");
}
const BYTE b = *(PBYTE)pAddress;
if ( bt == BASICTYPE_BOOL )
- s = b ? _T("true") : _T("false");
+ s = b ? wxT("true") : wxT("false");
else
- s.Printf(_T("%#04x"), b);
+ s.Printf(wxT("%#04x"), b);
}
else if ( length == 2 )
{
- s.Printf(bt == BASICTYPE_UINT ? _T("%#06x") : _T("%d"),
+ s.Printf(bt == BASICTYPE_UINT ? wxT("%#06x") : wxT("%d"),
*(PWORD)pAddress);
}
else if ( length == 4 )
if ( bt == BASICTYPE_FLOAT )
{
- s.Printf(_T("%f"), *(PFLOAT)pAddress);
+ s.Printf(wxT("%f"), *(PFLOAT)pAddress);
handled = true;
}
const char *pc = *(PSTR *)pAddress;
if ( ::IsBadStringPtrA(pc, NUM_CHARS) == 0 )
{
- s += _T('"');
+ s += wxT('"');
for ( size_t n = 0; n < NUM_CHARS && *pc; n++, pc++ )
{
s += *pc;
}
- s += _T('"');
+ s += wxT('"');
handled = true;
}
if ( !handled )
{
// treat just as an opaque DWORD
- s.Printf(_T("%#x"), *(PDWORD)pAddress);
+ s.Printf(wxT("%#x"), *(PDWORD)pAddress);
}
}
else if ( length == 8 )
{
if ( bt == BASICTYPE_FLOAT )
{
- s.Printf(_T("%lf"), *(double *)pAddress);
+ s.Printf(wxT("%lf"), *(double *)pAddress);
}
else // opaque 64 bit value
{
- s.Printf(_T("%#" wxLongLongFmtSpec _T("x")), *(PDWORD *)pAddress);
+ s.Printf(wxT("%#" wxLongLongFmtSpec wxT("x")), *(PDWORD *)pAddress);
}
}
case SYMBOL_TAG_DATA:
if ( !pVariable )
{
- s = _T("NULL");
+ s = wxT("NULL");
}
else // valid location
{
if ( !s.empty() )
{
- s = GetSymbolName(pSym) + _T(" = ") + s;
+ s = GetSymbolName(pSym) + wxT(" = ") + s;
}
break;
}
if ( !s.empty() )
{
- s = wxString(_T('\t'), level + 1) + s + _T('\n');
+ s = wxString(wxT('\t'), level + 1) + s + wxT('\n');
}
return s;
// special handling for ubiquitous wxString: although the code below works
// for it as well, it shows the wxStringBase class and takes 4 lines
// instead of only one as this branch
- if ( s == _T("wxString") )
+ if ( s == wxT("wxString") )
{
wxString *ps = (wxString *)pVariable;
}
}
- s << _T("(\"") << (p ? p : _T("???")) << _T(")\"");
+ s << wxT("(\"") << (p ? p : wxT("???")) << wxT(")\"");
}
else // any other UDT
#endif // !wxUSE_STD_STRING
return s;
}
- s << _T(" {\n");
+ s << wxT(" {\n");
// Iterate through all children
SYMBOL_INFO sym;
free(children);
- s << wxString(_T('\t'), level + 1) << _T('}');
+ s << wxString(wxT('\t'), level + 1) << wxT('}');
}
return s;
{
static const wxChar *tags[] =
{
- _T("null"),
- _T("exe"),
- _T("compiland"),
- _T("compiland details"),
- _T("compiland env"),
- _T("function"),
- _T("block"),
- _T("data"),
- _T("annotation"),
- _T("label"),
- _T("public symbol"),
- _T("udt"),
- _T("enum"),
- _T("function type"),
- _T("pointer type"),
- _T("array type"),
- _T("base type"),
- _T("typedef"),
- _T("base class"),
- _T("friend"),
- _T("function arg type"),
- _T("func debug start"),
- _T("func debug end"),
- _T("using namespace"),
- _T("vtable shape"),
- _T("vtable"),
- _T("custom"),
- _T("thunk"),
- _T("custom type"),
- _T("managed type"),
- _T("dimension"),
+ wxT("null"),
+ wxT("exe"),
+ wxT("compiland"),
+ wxT("compiland details"),
+ wxT("compiland env"),
+ wxT("function"),
+ wxT("block"),
+ wxT("data"),
+ wxT("annotation"),
+ wxT("label"),
+ wxT("public symbol"),
+ wxT("udt"),
+ wxT("enum"),
+ wxT("function type"),
+ wxT("pointer type"),
+ wxT("array type"),
+ wxT("base type"),
+ wxT("typedef"),
+ wxT("base class"),
+ wxT("friend"),
+ wxT("function arg type"),
+ wxT("func debug start"),
+ wxT("func debug end"),
+ wxT("using namespace"),
+ wxT("vtable shape"),
+ wxT("vtable"),
+ wxT("custom"),
+ wxT("thunk"),
+ wxT("custom type"),
+ wxT("managed type"),
+ wxT("dimension"),
};
wxCOMPILE_TIME_ASSERT( WXSIZEOF(tags) == wxDbgHelpDLL::SYMBOL_TAG_MAX,
if ( tag < WXSIZEOF(tags) )
s = tags[tag];
else
- s.Printf(_T("unrecognized tag (%d)"), tag);
+ s.Printf(wxT("unrecognized tag (%d)"), tag);
return s;
}
{
static const wxChar *kinds[] =
{
- _T("unknown"),
- _T("local"),
- _T("static local"),
- _T("param"),
- _T("object ptr"),
- _T("file static"),
- _T("global"),
- _T("member"),
- _T("static member"),
- _T("constant"),
+ wxT("unknown"),
+ wxT("local"),
+ wxT("static local"),
+ wxT("param"),
+ wxT("object ptr"),
+ wxT("file static"),
+ wxT("global"),
+ wxT("member"),
+ wxT("static member"),
+ wxT("constant"),
};
wxCOMPILE_TIME_ASSERT( WXSIZEOF(kinds) == wxDbgHelpDLL::DATA_MAX,
if ( kind < WXSIZEOF(kinds) )
s = kinds[kind];
else
- s.Printf(_T("unrecognized kind (%d)"), kind);
+ s.Printf(wxT("unrecognized kind (%d)"), kind);
return s;
}
{
static const wxChar *kinds[] =
{
- _T("struct"),
- _T("class"),
- _T("union"),
+ wxT("struct"),
+ wxT("class"),
+ wxT("union"),
};
wxCOMPILE_TIME_ASSERT( WXSIZEOF(kinds) == wxDbgHelpDLL::UDT_MAX,
if ( kind < WXSIZEOF(kinds) )
s = kinds[kind];
else
- s.Printf(_T("unrecognized UDT (%d)"), kind);
+ s.Printf(wxT("unrecognized UDT (%d)"), kind);
return s;
}
{
static const wxChar *types[] =
{
- _T("no type"),
- _T("void"),
- _T("char"),
- _T("wchar"),
- _T(""),
- _T(""),
- _T("int"),
- _T("uint"),
- _T("float"),
- _T("bcd"),
- _T("bool"),
- _T(""),
- _T(""),
- _T("long"),
- _T("ulong"),
- _T(""),
- _T(""),
- _T(""),
- _T(""),
- _T(""),
- _T(""),
- _T(""),
- _T(""),
- _T(""),
- _T(""),
- _T("CURRENCY"),
- _T("DATE"),
- _T("VARIANT"),
- _T("complex"),
- _T("bit"),
- _T("BSTR"),
- _T("HRESULT"),
+ wxT("no type"),
+ wxT("void"),
+ wxT("char"),
+ wxT("wchar"),
+ wxT(""),
+ wxT(""),
+ wxT("int"),
+ wxT("uint"),
+ wxT("float"),
+ wxT("bcd"),
+ wxT("bool"),
+ wxT(""),
+ wxT(""),
+ wxT("long"),
+ wxT("ulong"),
+ wxT(""),
+ wxT(""),
+ wxT(""),
+ wxT(""),
+ wxT(""),
+ wxT(""),
+ wxT(""),
+ wxT(""),
+ wxT(""),
+ wxT(""),
+ wxT("CURRENCY"),
+ wxT("DATE"),
+ wxT("VARIANT"),
+ wxT("complex"),
+ wxT("bit"),
+ wxT("BSTR"),
+ wxT("HRESULT"),
};
wxCOMPILE_TIME_ASSERT( WXSIZEOF(types) == wxDbgHelpDLL::BASICTYPE_MAX,
s = types[bt];
if ( s.empty() )
- s.Printf(_T("unrecognized type (%d)"), bt);
+ s.Printf(wxT("unrecognized type (%d)"), bt);
return s;
}
DoGetTypeInfo(&sym, TI_GET_SYMTAG, &tag);
DoGetTypeInfo(&sym, TI_GET_TYPEID, &ti);
- OutputDebugString(wxString::Format(_T("Type 0x%x: "), sym.TypeIndex));
+ OutputDebugString(wxString::Format(wxT("Type 0x%x: "), sym.TypeIndex));
wxString name = wxDbgHelpDLL::GetSymbolName(&sym);
if ( !name.empty() )
{
- OutputDebugString(wxString::Format(_T("name=\"%s\", "), name.c_str()));
+ OutputDebugString(wxString::Format(wxT("name=\"%s\", "), name.c_str()));
}
DWORD nested;
nested = FALSE;
}
- OutputDebugString(wxString::Format(_T("tag=%s%s"),
- nested ? _T("nested ") : wxEmptyString,
+ OutputDebugString(wxString::Format(wxT("tag=%s%s"),
+ nested ? wxT("nested ") : wxEmptyString,
TagString(tag).c_str()));
if ( tag == wxDbgHelpDLL::SYMBOL_TAG_UDT )
{
wxDbgHelpDLL::UdtKind udtKind;
if ( DoGetTypeInfo(&sym, TI_GET_UDTKIND, &udtKind) )
{
- OutputDebugString(_T(" (") + UdtKindString(udtKind) + _T(')'));
+ OutputDebugString(wxT(" (") + UdtKindString(udtKind) + wxT(')'));
}
}
if ( DoGetTypeInfo(&sym, TI_GET_DATAKIND, &kind) )
{
OutputDebugString(wxString::Format(
- _T(", kind=%s"), KindString(kind).c_str()));
+ wxT(", kind=%s"), KindString(kind).c_str()));
if ( kind == wxDbgHelpDLL::DATA_MEMBER )
{
DWORD ofs = 0;
if ( DoGetTypeInfo(&sym, TI_GET_OFFSET, &ofs) )
{
- OutputDebugString(wxString::Format(_T(" (ofs=0x%x)"), ofs));
+ OutputDebugString(wxString::Format(wxT(" (ofs=0x%x)"), ofs));
}
}
}
wxDbgHelpDLL::BasicType bt = GetBasicType(&sym);
if ( bt )
{
- OutputDebugString(wxString::Format(_T(", type=%s"),
+ OutputDebugString(wxString::Format(wxT(", type=%s"),
TypeString(bt).c_str()));
}
if ( ti != sym.TypeIndex )
{
- OutputDebugString(wxString::Format(_T(", next ti=0x%x"), ti));
+ OutputDebugString(wxString::Format(wxT(", next ti=0x%x"), ti));
}
- OutputDebugString(_T("\r\n"));
+ OutputDebugString(wxT("\r\n"));
}
#endif // NDEBUG
// show dialog modally
int wxDialog::ShowModal()
{
- wxASSERT_MSG( !IsModal(), _T("ShowModal() can't be called twice") );
+ wxASSERT_MSG( !IsModal(), wxT("ShowModal() can't be called twice") );
Show();
void wxDialog::EndModal(int retCode)
{
- wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") );
+ wxASSERT_MSG( IsModal(), wxT("EndModal() called for non modal dialog") );
SetReturnCode(retCode);
// have been called yet)
wxASSERT_MSG( !IsShown() ||
::GetWindow((HWND)m_hGripper, GW_HWNDNEXT) == 0,
- _T("Bug in wxWidgets: gripper should be at the bottom of Z-order") );
+ wxT("Bug in wxWidgets: gripper should be at the bottom of Z-order") );
::DestroyWindow((HWND) m_hGripper);
m_hGripper = 0;
}
void wxDialog::ShowGripper(bool show)
{
- wxASSERT_MSG( m_hGripper, _T("shouldn't be called if we have no gripper") );
+ wxASSERT_MSG( m_hGripper, wxT("shouldn't be called if we have no gripper") );
if ( show )
ResizeGripper();
void wxDialog::ResizeGripper()
{
- wxASSERT_MSG( m_hGripper, _T("shouldn't be called if we have no gripper") );
+ wxASSERT_MSG( m_hGripper, wxT("shouldn't be called if we have no gripper") );
HWND hwndGripper = (HWND)m_hGripper;
typedef DWORD (APIENTRY * RASVALIDATEENTRYNAME)( LPCSTR, LPCSTR );
typedef DWORD (APIENTRY * RASCONNECTIONNOTIFICATION)( HRASCONN, HANDLE, DWORD );
- static const wxChar gs_funcSuffix = _T('A');
+ static const wxChar gs_funcSuffix = wxT('A');
#else // Unicode
typedef DWORD (APIENTRY * RASDIAL)( LPRASDIALEXTENSIONS, LPCWSTR, LPRASDIALPARAMSW, DWORD, LPVOID, LPHRASCONN );
typedef DWORD (APIENTRY * RASENUMCONNECTIONS)( LPRASCONNW, LPDWORD, LPDWORD );
typedef DWORD (APIENTRY * RASVALIDATEENTRYNAME)( LPCWSTR, LPCWSTR );
typedef DWORD (APIENTRY * RASCONNECTIONNOTIFICATION)( HRASCONN, HANDLE, DWORD );
- static const wxChar gs_funcSuffix = _T('W');
+ static const wxChar gs_funcSuffix = wxT('W');
#endif // ASCII/Unicode
// structure passed to the secondary thread
wxDialUpManagerMSW::wxDialUpManagerMSW()
: m_timerStatusPolling(this),
- m_dllRas(_T("RASAPI32"))
+ m_dllRas(wxT("RASAPI32"))
{
// initialize our data
m_autoCheckLevel = 0;
// get the function from rasapi32.dll and abort if it's not found
#define RESOLVE_RAS_FUNCTION(type, name) \
- ms_pfn##name = (type)m_dllRas.GetSymbol( wxString(_T(#name)) \
+ ms_pfn##name = (type)m_dllRas.GetSymbol( wxString(wxT(#name)) \
+ gs_funcSuffix); \
if ( !ms_pfn##name ) \
{ \
// a variant of above macro which doesn't abort if the function is
// not found in the DLL
#define RESOLVE_OPTIONAL_RAS_FUNCTION(type, name) \
- ms_pfn##name = (type)m_dllRas.GetSymbol( wxString(_T(#name)) \
+ ms_pfn##name = (type)m_dllRas.GetSymbol( wxString(wxT(#name)) \
+ gs_funcSuffix);
RESOLVE_RAS_FUNCTION(RASDIAL, RasDial);
{
if ( !SetEvent(m_data->hEventQuit) )
{
- wxLogLastError(_T("SetEvent(RasThreadQuit)"));
+ wxLogLastError(wxT("SetEvent(RasThreadQuit)"));
}
else // sent quit request to the background thread
{
// but we allow multiple instances of wxDialUpManagerMSW so
// we might as well use the ref counted version here too.
- wxDynamicLibrary hDll(_T("WININET"));
+ wxDynamicLibrary hDll(wxT("WININET"));
if ( hDll.IsLoaded() )
{
typedef BOOL (WINAPI *INTERNETGETCONNECTEDSTATE)(LPDWORD, DWORD);
INTERNETGETCONNECTEDSTATE pfnInternetGetConnectedState;
#define RESOLVE_FUNCTION(type, name) \
- pfn##name = (type)hDll.GetSymbol(_T(#name))
+ pfn##name = (type)hDll.GetSymbol(wxT(#name))
RESOLVE_FUNCTION(INTERNETGETCONNECTEDSTATE, InternetGetConnectedState);
break;
default:
- wxFAIL_MSG( _T("unexpected return of WaitForMultipleObjects()") );
+ wxFAIL_MSG( wxT("unexpected return of WaitForMultipleObjects()") );
// fall through
case WAIT_FAILED:
{
// we don't support formats using palettes right now so we only create
// either 24bpp (RGB) or 32bpp (RGBA) bitmaps
- wxASSERT_MSG( depth, _T("invalid image depth in wxDIB::Create()") );
+ wxASSERT_MSG( depth, wxT("invalid image depth in wxDIB::Create()") );
if ( depth < 24 )
depth = 24;
bool wxDIB::Create(const wxBitmap& bmp)
{
- wxCHECK_MSG( bmp.Ok(), false, _T("wxDIB::Create(): invalid bitmap") );
+ wxCHECK_MSG( bmp.Ok(), false, wxT("wxDIB::Create(): invalid bitmap") );
if ( !Create(GetHbitmapOf(bmp)) )
return false;
SRCCOPY
) )
{
- wxLogLastError(_T("BitBlt(DDB -> DIB)"));
+ wxLogLastError(wxT("BitBlt(DDB -> DIB)"));
return false;
}
if ( !GetDIBSection(m_handle, &ds) )
{
// we're sure that our handle is a DIB section, so this should work
- wxFAIL_MSG( _T("GetObject(DIBSECTION) unexpectedly failed") );
+ wxFAIL_MSG( wxT("GetObject(DIBSECTION) unexpectedly failed") );
return false;
}
if ( !m_handle )
{
- wxLogLastError(_T("Loading DIB from file"));
+ wxLogLastError(wxT("Loading DIB from file"));
return false;
}
bool wxDIB::Save(const wxString& filename)
{
- wxCHECK_MSG( m_handle, false, _T("wxDIB::Save(): invalid object") );
+ wxCHECK_MSG( m_handle, false, wxT("wxDIB::Save(): invalid object") );
#if wxUSE_FILE
wxFile file(filename, wxFile::write);
DIBSECTION ds;
if ( !GetDIBSection(m_handle, &ds) )
{
- wxLogLastError(_T("GetObject(hDIB)"));
+ wxLogLastError(wxT("GetObject(hDIB)"));
}
else
{
DIBSECTION ds;
if ( !GetDIBSection(m_handle, &ds) )
{
- wxLogLastError(_T("GetObject(hDIB)"));
+ wxLogLastError(wxT("GetObject(hDIB)"));
return;
}
HBITMAP wxDIB::CreateDDB(HDC hdc) const
{
- wxCHECK_MSG( m_handle, 0, _T("wxDIB::CreateDDB(): invalid object") );
+ wxCHECK_MSG( m_handle, 0, wxT("wxDIB::CreateDDB(): invalid object") );
DIBSECTION ds;
if ( !GetDIBSection(m_handle, &ds) )
{
- wxLogLastError(_T("GetObject(hDIB)"));
+ wxLogLastError(wxT("GetObject(hDIB)"));
return 0;
}
/* static */
HBITMAP wxDIB::ConvertToBitmap(const BITMAPINFO *pbmi, HDC hdc, void *bits)
{
- wxCHECK_MSG( pbmi, 0, _T("invalid DIB in ConvertToBitmap") );
+ wxCHECK_MSG( pbmi, 0, wxT("invalid DIB in ConvertToBitmap") );
// here we get BITMAPINFO struct followed by the actual bitmap bits and
// BITMAPINFO starts with BITMAPINFOHEADER followed by colour info
{
// this really shouldn't happen... it worked the first time, why not
// now?
- wxFAIL_MSG( _T("wxDIB::ConvertFromBitmap() unexpectedly failed") );
+ wxFAIL_MSG( wxT("wxDIB::ConvertFromBitmap() unexpectedly failed") );
return NULL;
}
#if defined(_WIN32_WCE) && _WIN32_WCE < 400
return NULL;
#else
- wxCHECK_MSG( m_handle, NULL, _T("wxDIB::CreatePalette(): invalid object") );
+ wxCHECK_MSG( m_handle, NULL, wxT("wxDIB::CreatePalette(): invalid object") );
DIBSECTION ds;
if ( !GetDIBSection(m_handle, &ds) )
{
- wxLogLastError(_T("GetObject(hDIB)"));
+ wxLogLastError(wxT("GetObject(hDIB)"));
return 0;
}
// going to have biClrUsed of them so add necessary space
LOGPALETTE *pPalette = (LOGPALETTE *)
malloc(sizeof(LOGPALETTE) + (biClrUsed - 1)*sizeof(PALETTEENTRY));
- wxCHECK_MSG( pPalette, NULL, _T("out of memory") );
+ wxCHECK_MSG( pPalette, NULL, wxT("out of memory") );
// initialize the palette header
pPalette->palVersion = 0x300; // magic number, not in docs but works
if ( !hPalette )
{
- wxLogLastError(_T("CreatePalette"));
+ wxLogLastError(wxT("CreatePalette"));
return NULL;
}
bool wxDIB::Create(const wxImage& image)
{
- wxCHECK_MSG( image.Ok(), false, _T("invalid wxImage in wxDIB ctor") );
+ wxCHECK_MSG( image.Ok(), false, wxT("invalid wxImage in wxDIB ctor") );
const int h = image.GetHeight();
const int w = image.GetWidth();
{
if ( !::FindClose(fd) )
{
- wxLogLastError(_T("FindClose"));
+ wxLogLastError(wxT("FindClose"));
}
}
wxString filespec = m_dirname;
if ( !wxEndsWithPathSeparator(filespec) )
{
- filespec += _T('\\');
+ filespec += wxT('\\');
}
if ( !m_filespec )
- filespec += _T("*.*");
+ filespec += wxT("*.*");
else
filespec += m_filespec;
if ( err != ERROR_NO_MORE_FILES )
{
- wxLogLastError(_T("FindNext"));
+ wxLogLastError(wxT("FindNext"));
}
#endif // __WIN32__
//else: not an error, just no more (such) files
attr = GetAttrFromFindData(PTR_TO_FINDDATA);
// don't return "." and ".." unless asked for
- if ( name[0] == _T('.') &&
- ((name[1] == _T('.') && name[2] == _T('\0')) ||
- (name[1] == _T('\0'))) )
+ if ( name[0] == wxT('.') &&
+ ((name[1] == wxT('.') && name[2] == wxT('\0')) ||
+ (name[1] == wxT('\0'))) )
{
if ( !(m_flags & wxDIR_DOTDOT) )
continue;
if ( !name.empty() )
{
// bring to canonical Windows form
- name.Replace(_T("/"), _T("\\"));
+ name.Replace(wxT("/"), wxT("\\"));
- if ( name.Last() == _T('\\') )
+ if ( name.Last() == wxT('\\') )
{
// chop off the last (back)slash
name.Truncate(name.length() - 1);
const wxString& filespec,
int flags) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
M_DIR->Rewind();
bool wxDir::GetNext(wxString *filename) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
- wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") );
+ wxCHECK_MSG( filename, false, wxT("bad pointer in wxDir::GetNext()") );
return M_DIR->Read(filename);
}
#ifdef __WXWINCE__
// FindFirst() is going to fail
wxASSERT_MSG( !dirname.empty(),
- _T("incorrect directory name format in wxGetDirectoryTimes") );
+ wxT("incorrect directory name format in wxGetDirectoryTimes") );
#else
// FindFirst() is going to fail
- wxASSERT_MSG( !dirname.empty() && dirname.Last() != _T('\\'),
- _T("incorrect directory name format in wxGetDirectoryTimes") );
+ wxASSERT_MSG( !dirname.empty() && dirname.Last() != wxT('\\'),
+ wxT("incorrect directory name format in wxGetDirectoryTimes") );
#endif
FIND_STRUCT fs;
m_path = path;
// SHBrowseForFolder doesn't like '/'s nor the trailing backslashes
- m_path.Replace(_T("/"), _T("\\"));
+ m_path.Replace(wxT("/"), wxT("\\"));
if ( !m_path.empty() )
{
- while ( *(m_path.end() - 1) == _T('\\') )
+ while ( *(m_path.end() - 1) == wxT('\\') )
{
m_path.erase(m_path.length() - 1);
}
// but the root drive should have a trailing slash (again, this is just
// the way the native dialog works)
- if ( *(m_path.end() - 1) == _T(':') )
+ if ( *(m_path.end() - 1) == wxT(':') )
{
- m_path += _T('\\');
+ m_path += wxT('\\');
}
}
}
// display functions are found in different DLLs under WinCE and normal Win32
#ifdef __WXWINCE__
-static const wxChar displayDllName[] = _T("coredll.dll");
+static const wxChar displayDllName[] = wxT("coredll.dll");
#else
-static const wxChar displayDllName[] = _T("user32.dll");
+static const wxChar displayDllName[] = wxT("user32.dll");
#endif
// ----------------------------------------------------------------------------
// system option
#if wxUSE_DIRECTDRAW
- if ( wxSystemOptions::GetOptionInt(_T("msw.display.directdraw")) )
+ if ( wxSystemOptions::GetOptionInt(wxT("msw.display.directdraw")) )
{
wxDisplayFactoryDirectDraw *factoryDD = new wxDisplayFactoryDirectDraw;
if ( factoryDD->IsOk() )
WinStruct<MONITORINFOEX> monInfo;
if ( !gs_GetMonitorInfo(m_hmon, (LPMONITORINFO)&monInfo) )
{
- wxLogLastError(_T("GetMonitorInfo"));
+ wxLogLastError(wxT("GetMonitorInfo"));
m_flags = 0;
return;
}
dm.dmDriverExtra = 0;
if ( !::EnumDisplaySettings(deviceName, ENUM_CURRENT_SETTINGS, &dm) )
{
- wxLogLastError(_T("EnumDisplaySettings(ENUM_CURRENT_SETTINGS)"));
+ wxLogLastError(wxT("EnumDisplaySettings(ENUM_CURRENT_SETTINGS)"));
}
else
{
wxDisplayImpl *wxDisplayFactoryMultimon::CreateDisplay(unsigned n)
{
- wxCHECK_MSG( n < m_displays.size(), NULL, _T("invalid display index") );
+ wxCHECK_MSG( n < m_displays.size(), NULL, wxT("invalid display index") );
return new wxDisplayImplMultimon(n, *(m_displays[n]));
}
else // change to the given mode
{
wxCHECK_MSG( mode.GetWidth() && mode.GetHeight(), false,
- _T("at least the width and height must be specified") );
+ wxT("at least the width and height must be specified") );
wxZeroMemory(dm);
dm.dmSize = sizeof(dm);
break;
default:
- wxFAIL_MSG( _T("unexpected ChangeDisplaySettingsEx() return value") );
+ wxFAIL_MSG( wxT("unexpected ChangeDisplaySettingsEx() return value") );
}
return false;
if ( !ms_supportsMultimon )
return;
- m_dllDDraw.Load(_T("ddraw.dll"), wxDL_VERBATIM | wxDL_QUIET);
+ m_dllDDraw.Load(wxT("ddraw.dll"), wxDL_VERBATIM | wxDL_QUIET);
if ( !m_dllDDraw.IsLoaded() )
return;
this,
DDENUM_ATTACHEDSECONDARYDEVICES) != DD_OK )
{
- wxLogLastError(_T("DirectDrawEnumerateEx"));
+ wxLogLastError(wxT("DirectDrawEnumerateEx"));
}
}
wxDisplayImpl *wxDisplayFactoryDirectDraw::CreateDisplay(unsigned n)
{
- wxCHECK_MSG( n < m_displays.size(), NULL, _T("invalid display index") );
+ wxCHECK_MSG( n < m_displays.size(), NULL, wxT("invalid display index") );
wxDisplayInfoDirectDraw *
info = static_cast<wxDisplayInfoDirectDraw *>(m_displays[n]);
if ( FAILED(hr) || !pDD )
{
// what to do??
- wxLogApiError(_T("DirectDrawCreate"), hr);
+ wxLogApiError(wxT("DirectDrawCreate"), hr);
return NULL;
}
if ( FAILED(hr) || !info->m_pDD2 )
{
- wxLogApiError(_T("IDirectDraw::QueryInterface(IDD2)"), hr);
+ wxLogApiError(wxT("IDirectDraw::QueryInterface(IDD2)"), hr);
return NULL;
}
if ( FAILED(hr) )
{
- wxLogApiError(_T("IDirectDraw::EnumDisplayModes"), hr);
+ wxLogApiError(wxT("IDirectDraw::EnumDisplayModes"), hr);
}
return modes;
bool wxDisplayImplDirectDraw::ChangeMode(const wxVideoMode& mode)
{
wxWindow *winTop = wxTheApp->GetTopWindow();
- wxCHECK_MSG( winTop, false, _T("top level window required for DirectX") );
+ wxCHECK_MSG( winTop, false, wxT("top level window required for DirectX") );
HRESULT hr = m_pDD2->SetCooperativeLevel
(
);
if ( FAILED(hr) )
{
- wxLogApiError(_T("IDirectDraw2::SetCooperativeLevel"), hr);
+ wxLogApiError(wxT("IDirectDraw2::SetCooperativeLevel"), hr);
return false;
}
hr = m_pDD2->SetDisplayMode(mode.w, mode.h, mode.bpp, mode.refresh, 0);
if ( FAILED(hr) )
{
- wxLogApiError(_T("IDirectDraw2::SetDisplayMode"), hr);
+ wxLogApiError(wxT("IDirectDraw2::SetDisplayMode"), hr);
return false;
}
#include "wx/msw/private.h"
#include "wx/msw/debughlp.h"
-const wxString wxDynamicLibrary::ms_dllext(_T(".dll"));
+const wxString wxDynamicLibrary::ms_dllext(wxT(".dll"));
// ----------------------------------------------------------------------------
// private classes
static GetModuleHandleEx_t s_pfnGetModuleHandleEx = INVALID_FUNC_PTR;
if ( s_pfnGetModuleHandleEx == INVALID_FUNC_PTR )
{
- wxDynamicLibrary dll(_T("kernel32.dll"), wxDL_VERBATIM);
+ wxDynamicLibrary dll(wxT("kernel32.dll"), wxDL_VERBATIM);
s_pfnGetModuleHandleEx =
- (GetModuleHandleEx_t)dll.RawGetSymbol(_T("GetModuleHandleExA"));
+ (GetModuleHandleEx_t)dll.RawGetSymbol(wxT("GetModuleHandleExA"));
// dll object can be destroyed, kernel32.dll won't be unloaded anyhow
}
// handle it
wxLogNull noLog;
- if ( m_dll.Load(_T("version.dll"), wxDL_VERBATIM) )
+ if ( m_dll.Load(wxT("version.dll"), wxDL_VERBATIM) )
{
// the functions we load have either 'A' or 'W' suffix depending on
// whether we're in ANSI or Unicode build
#endif // UNICODE/ANSI
#define LOAD_VER_FUNCTION(name) \
- m_pfn ## name = (name ## _t)m_dll.GetSymbol(_T(#name SUFFIX)); \
+ m_pfn ## name = (name ## _t)m_dll.GetSymbol(wxT(#name SUFFIX)); \
if ( !m_pfn ## name ) \
{ \
m_dll.Unload(); \
void *pVer;
UINT sizeInfo;
if ( m_pfnVerQueryValue(buf.data(),
- const_cast<wxChar *>(_T("\\")),
+ const_cast<wxChar *>(wxT("\\")),
&pVer,
&sizeInfo) )
{
VS_FIXEDFILEINFO *info = (VS_FIXEDFILEINFO *)pVer;
- ver.Printf(_T("%d.%d.%d.%d"),
+ ver.Printf(wxT("%d.%d.%d.%d"),
HIWORD(info->dwFileVersionMS),
LOWORD(info->dwFileVersionMS),
HIWORD(info->dwFileVersionLS),
¶ms
) )
{
- wxLogLastError(_T("EnumerateLoadedModules"));
+ wxLogLastError(wxT("EnumerateLoadedModules"));
}
}
#endif // wxUSE_DBGHELP
if (!ret)
{
- wxFAIL_MSG( _T("BeginDrag failed.") );
+ wxFAIL_MSG( wxT("BeginDrag failed.") );
return false;
}
wxGDIRefData *wxEnhMetaFile::CreateGDIRefData() const
{
- wxFAIL_MSG( _T("must be implemented if used") );
+ wxFAIL_MSG( wxT("must be implemented if used") );
return NULL;
}
wxGDIRefData *
wxEnhMetaFile::CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const
{
- wxFAIL_MSG( _T("must be implemented if used") );
+ wxFAIL_MSG( wxT("must be implemented if used") );
return NULL;
}
GetMetaFileName(m_filename));
if ( !m_hMF )
{
- wxLogLastError(_T("CopyEnhMetaFile"));
+ wxLogLastError(wxT("CopyEnhMetaFile"));
}
}
else
{
if ( !::DeleteEnhMetaFile(GetEMF()) )
{
- wxLogLastError(_T("DeleteEnhMetaFile"));
+ wxLogLastError(wxT("DeleteEnhMetaFile"));
}
}
}
bool wxEnhMetaFile::Play(wxDC *dc, wxRect *rectBound)
{
- wxCHECK_MSG( Ok(), false, _T("can't play invalid enhanced metafile") );
- wxCHECK_MSG( dc, false, _T("invalid wxDC in wxEnhMetaFile::Play") );
+ wxCHECK_MSG( Ok(), false, wxT("can't play invalid enhanced metafile") );
+ wxCHECK_MSG( dc, false, wxT("invalid wxDC in wxEnhMetaFile::Play") );
RECT rect;
if ( rectBound )
if ( !::PlayEnhMetaFile(GetHdcOf(*msw_impl), GetEMF(), &rect) )
{
- wxLogLastError(_T("PlayEnhMetaFile"));
+ wxLogLastError(wxT("PlayEnhMetaFile"));
return false;
}
ENHMETAHEADER hdr;
if ( !::GetEnhMetaFileHeader(GetEMF(), sizeof(hdr), &hdr) )
{
- wxLogLastError(_T("GetEnhMetaFileHeader"));
+ wxLogLastError(wxT("GetEnhMetaFileHeader"));
}
else
{
bool wxEnhMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height))
{
#if wxUSE_DRAG_AND_DROP && wxUSE_CLIPBOARD
- wxCHECK_MSG( m_hMF, false, _T("can't copy invalid metafile to clipboard") );
+ wxCHECK_MSG( m_hMF, false, wxT("can't copy invalid metafile to clipboard") );
return wxTheClipboard->AddData(new wxEnhMetaFileDataObject(*this));
#else // !wxUSE_DRAG_AND_DROP
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(wxT("not implemented"));
return false;
#endif // wxUSE_DRAG_AND_DROP/!wxUSE_DRAG_AND_DROP
}
pRect, description.wx_str());
if ( !m_hDC )
{
- wxLogLastError(_T("CreateEnhMetaFile"));
+ wxLogLastError(wxT("CreateEnhMetaFile"));
}
}
wxEnhMetaFile *wxEnhMetaFileDCImpl::Close()
{
- wxCHECK_MSG( IsOk(), NULL, _T("invalid wxEnhMetaFileDC") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid wxEnhMetaFileDC") );
HENHMETAFILE hMF = ::CloseEnhMetaFile(GetHdc());
if ( !hMF )
{
- wxLogLastError(_T("CloseEnhMetaFile"));
+ wxLogLastError(wxT("CloseEnhMetaFile"));
return NULL;
}
{
wxEnhMetaFileDCImpl * const
impl = static_cast<wxEnhMetaFileDCImpl *>(GetImpl());
- wxCHECK_MSG( impl, NULL, _T("no wxEnhMetaFileDC implementation") );
+ wxCHECK_MSG( impl, NULL, wxT("no wxEnhMetaFileDC implementation") );
return impl->Close();
}
}
else
{
- wxASSERT_MSG( format == wxDF_METAFILE, _T("unsupported format") );
+ wxASSERT_MSG( format == wxDF_METAFILE, wxT("unsupported format") );
return sizeof(METAFILEPICT);
}
bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
{
- wxCHECK_MSG( m_metafile.Ok(), false, _T("copying invalid enh metafile") );
+ wxCHECK_MSG( m_metafile.Ok(), false, wxT("copying invalid enh metafile") );
HENHMETAFILE hEMF = (HENHMETAFILE)m_metafile.GetHENHMETAFILE();
HENHMETAFILE hEMFCopy = ::CopyEnhMetaFile(hEMF, NULL);
if ( !hEMFCopy )
{
- wxLogLastError(_T("CopyEnhMetaFile"));
+ wxLogLastError(wxT("CopyEnhMetaFile"));
return false;
}
}
else
{
- wxASSERT_MSG( format == wxDF_METAFILE, _T("unsupported format") );
+ wxASSERT_MSG( format == wxDF_METAFILE, wxT("unsupported format") );
// convert to WMF
// first get the buffer size and alloc memory
size_t size = ::GetWinMetaFileBits(hEMF, 0, NULL, MM_ANISOTROPIC, hdc);
- wxCHECK_MSG( size, false, _T("GetWinMetaFileBits() failed") );
+ wxCHECK_MSG( size, false, wxT("GetWinMetaFileBits() failed") );
BYTE *bits = (BYTE *)malloc(size);
// then get the enh metafile bits
if ( !::GetWinMetaFileBits(hEMF, size, bits, MM_ANISOTROPIC, hdc) )
{
- wxLogLastError(_T("GetWinMetaFileBits"));
+ wxLogLastError(wxT("GetWinMetaFileBits"));
free(bits);
free(bits);
if ( !hMF )
{
- wxLogLastError(_T("SetMetaFileBitsEx"));
+ wxLogLastError(wxT("SetMetaFileBitsEx"));
return false;
}
{
hEMF = *(HENHMETAFILE *)buf;
- wxCHECK_MSG( hEMF, false, _T("pasting invalid enh metafile") );
+ wxCHECK_MSG( hEMF, false, wxT("pasting invalid enh metafile") );
}
else
{
- wxASSERT_MSG( format == wxDF_METAFILE, _T("unsupported format") );
+ wxASSERT_MSG( format == wxDF_METAFILE, wxT("unsupported format") );
// convert from WMF
const METAFILEPICT *mfpict = (const METAFILEPICT *)buf;
// first get the buffer size
size_t size = ::GetMetaFileBitsEx(mfpict->hMF, 0, NULL);
- wxCHECK_MSG( size, false, _T("GetMetaFileBitsEx() failed") );
+ wxCHECK_MSG( size, false, wxT("GetMetaFileBitsEx() failed") );
// then get metafile bits
BYTE *bits = (BYTE *)malloc(size);
if ( !::GetMetaFileBitsEx(mfpict->hMF, size, bits) )
{
- wxLogLastError(_T("GetMetaFileBitsEx"));
+ wxLogLastError(wxT("GetMetaFileBitsEx"));
free(bits);
free(bits);
if ( !hEMF )
{
- wxLogLastError(_T("SetWinMetaFileBits"));
+ wxLogLastError(wxT("SetWinMetaFileBits"));
return false;
}
bool wxEnhMetaFileSimpleDataObject::GetDataHere(void *buf) const
{
- wxCHECK_MSG( m_metafile.Ok(), false, _T("copying invalid enh metafile") );
+ wxCHECK_MSG( m_metafile.Ok(), false, wxT("copying invalid enh metafile") );
HENHMETAFILE hEMF = (HENHMETAFILE)m_metafile.GetHENHMETAFILE();
HENHMETAFILE hEMFCopy = ::CopyEnhMetaFile(hEMF, NULL);
if ( !hEMFCopy )
{
- wxLogLastError(_T("CopyEnhMetaFile"));
+ wxLogLastError(wxT("CopyEnhMetaFile"));
return false;
}
{
HENHMETAFILE hEMF = *(HENHMETAFILE *)buf;
- wxCHECK_MSG( hEMF, false, _T("pasting invalid enh metafile") );
+ wxCHECK_MSG( hEMF, false, wxT("pasting invalid enh metafile") );
m_metafile.SetHENHMETAFILE((WXHANDLE)hEMF);
return true;
if ( !ms_msgFindDialog )
{
- wxLogLastError(_T("RegisterWindowMessage(FINDMSGSTRING)"));
+ wxLogLastError(wxT("RegisterWindowMessage(FINDMSGSTRING)"));
}
wxWindow::MSWRegisterMessageHandler
static bool s_blockMsg = false;
#endif // wxUSE_UNICODE_MSLU
- wxASSERT_MSG( nMsg == ms_msgFindDialog, _T("unexpected message received") );
+ wxASSERT_MSG( nMsg == ms_msgFindDialog, wxT("unexpected message received") );
FINDREPLACE *pFR = (FINDREPLACE *)lParam;
}
else
{
- wxFAIL_MSG( _T("unknown find dialog event") );
+ wxFAIL_MSG( wxT("unknown find dialog event") );
return 0;
}
// if it wasn't, delete the dialog ourselves
if ( !::DestroyWindow(GetHwnd()) )
{
- wxLogLastError(_T("DestroyWindow(find dialog)"));
+ wxLogLastError(wxT("DestroyWindow(find dialog)"));
}
}
return true;
}
- wxCHECK_MSG( m_FindReplaceData, false, _T("call Create() first!") );
+ wxCHECK_MSG( m_FindReplaceData, false, wxT("call Create() first!") );
- wxASSERT_MSG( !m_impl, _T("why don't we have the window then?") );
+ wxASSERT_MSG( !m_impl, wxT("why don't we have the window then?") );
m_impl = new wxFindReplaceDialogImpl(this, m_FindReplaceData->GetFlags());
if ( !::ShowWindow(hwnd, SW_SHOW) )
{
- wxLogLastError(_T("ShowWindow(find dialog)"));
+ wxLogLastError(wxT("ShowWindow(find dialog)"));
}
m_hWnd = (WXHWND)hwnd;
paths.Empty();
wxString dir(m_dir);
- if ( m_dir.Last() != _T('\\') )
- dir += _T('\\');
+ if ( m_dir.Last() != wxT('\\') )
+ dir += wxT('\\');
size_t count = m_fileNames.GetCount();
for ( size_t n = 0; n < count; n++ )
wxString ext;
wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
if ( !ext.empty() )
- m_fileName << _T('.') << ext;
+ m_fileName << wxT('.') << ext;
}
void wxFileDialog::DoGetPosition(int *x, int *y) const
{
// this can happen if the default file name is invalid, try without it
// now
- of->lpstrFile[0] = _T('\0');
+ of->lpstrFile[0] = wxT('\0');
success = DoShowCommFileDialog(of, style, &errCode);
}
wxChar ch = m_dir[i];
switch ( ch )
{
- case _T('/'):
+ case wxT('/'):
// convert to backslash
- ch = _T('\\');
+ ch = wxT('\\');
// fall through
- case _T('\\'):
+ case wxT('\\'):
while ( i < len - 1 )
{
wxChar chNext = m_dir[i + 1];
- if ( chNext != _T('\\') && chNext != _T('/') )
+ if ( chNext != wxT('\\') && chNext != wxT('/') )
break;
// ignore the next one, unless it is at the start of a UNC path
size_t items = wxParseCommonDialogsFilter(m_wildCard, wildDescriptions, wildFilters);
- wxASSERT_MSG( items > 0 , _T("empty wildcard list") );
+ wxASSERT_MSG( items > 0 , wxT("empty wildcard list") );
wxString filterBuffer;
i += wxStrlen(&fileNameBuffer[i]) + 1;
}
#else
- wxStringTokenizer toke(fileNameBuffer, _T(" \t\r\n"));
+ wxStringTokenizer toke(fileNameBuffer, wxT(" \t\r\n"));
m_dir = toke.GetNextToken();
m_fileName = toke.GetNextToken();
m_fileNames.Add(m_fileName);
#endif // OFN_EXPLORER
wxString dir(m_dir);
- if ( m_dir.Last() != _T('\\') )
- dir += _T('\\');
+ if ( m_dir.Last() != wxT('\\') )
+ dir += wxT('\\');
m_path = dir + m_fileName;
m_filterIndex = (int)of.nFilterIndex - 1;
bool wxNativeEncodingInfo::FromString(const wxString& s)
{
- wxStringTokenizer tokenizer(s, _T(";"));
+ wxStringTokenizer tokenizer(s, wxT(";"));
wxString encid = tokenizer.GetNextToken();
}
else
{
- if ( wxSscanf(tmp, _T("%u"), &charset) != 1 )
+ if ( wxSscanf(tmp, wxT("%u"), &charset) != 1 )
{
// should be a number!
return false;
// we don't have any choice but to use the raw value
<< (long)encoding
#endif // wxUSE_FONTMAP/!wxUSE_FONTMAP
- << _T(';') << facename;
+ << wxT(';') << facename;
// ANSI_CHARSET is assumed anyhow
if ( charset != ANSI_CHARSET )
{
- s << _T(';') << charset;
+ s << wxT(';') << charset;
}
return s;
bool wxGetNativeFontEncoding(wxFontEncoding encoding,
wxNativeEncodingInfo *info)
{
- wxCHECK_MSG( info, false, _T("bad pointer in wxGetNativeFontEncoding") );
+ wxCHECK_MSG( info, false, wxT("bad pointer in wxGetNativeFontEncoding") );
if ( encoding == wxFONTENCODING_DEFAULT )
{
switch ( cs )
{
default:
- wxFAIL_MSG( _T("unexpected Win32 charset") );
+ wxFAIL_MSG( wxT("unexpected Win32 charset") );
// fall through and assume the system charset
case DEFAULT_CHARSET:
if ( !m_hMenu )
{
- wxFAIL_MSG( _T("failed to create menu bar") );
+ wxFAIL_MSG( wxT("failed to create menu bar") );
return;
}
}
class WXDLLEXPORT wxBMPFileHandler : public wxBitmapHandler
{
public:
- wxBMPFileHandler() : wxBitmapHandler(_T("Windows bitmap file"), _T("bmp"),
+ wxBMPFileHandler() : wxBitmapHandler(wxT("Windows bitmap file"), wxT("bmp"),
wxBITMAP_TYPE_BMP)
{
}
class WXDLLEXPORT wxBMPResourceHandler: public wxBitmapHandler
{
public:
- wxBMPResourceHandler() : wxBitmapHandler(_T("Windows bitmap resource"),
+ wxBMPResourceHandler() : wxBitmapHandler(wxT("Windows bitmap resource"),
wxEmptyString,
wxBITMAP_TYPE_BMP_RESOURCE)
{
int desiredWidth, int desiredHeight)
{
wxIcon *icon = wxDynamicCast(image, wxIcon);
- wxCHECK_MSG( icon, false, _T("wxIconHandler only works with icons") );
+ wxCHECK_MSG( icon, false, wxT("wxIconHandler only works with icons") );
return LoadIcon(icon, name, flags, desiredWidth, desiredHeight);
}
class WXDLLEXPORT wxICOFileHandler : public wxIconHandler
{
public:
- wxICOFileHandler() : wxIconHandler(_T("ICO icon file"),
- _T("ico"),
+ wxICOFileHandler() : wxIconHandler(wxT("ICO icon file"),
+ wxT("ico"),
wxBITMAP_TYPE_ICO)
{
}
class WXDLLEXPORT wxICOResourceHandler: public wxIconHandler
{
public:
- wxICOResourceHandler() : wxIconHandler(_T("ICO resource"),
- _T("ico"),
+ wxICOResourceHandler() : wxIconHandler(wxT("ICO resource"),
+ wxT("ico"),
wxBITMAP_TYPE_ICO_RESOURCE)
{
}
int WXUNUSED(desiredHeight))
{
#if wxUSE_WXDIB
- wxCHECK_MSG( bitmap, false, _T("NULL bitmap in LoadFile") );
+ wxCHECK_MSG( bitmap, false, wxT("NULL bitmap in LoadFile") );
wxDIB dib(name);
const wxPalette * WXUNUSED(pal)) const
{
#if wxUSE_WXDIB
- wxCHECK_MSG( bitmap, false, _T("NULL bitmap in SaveFile") );
+ wxCHECK_MSG( bitmap, false, wxT("NULL bitmap in SaveFile") );
wxDIB dib(*bitmap);
{
// it is not an error, but it might still be useful to be informed
// about it optionally
- wxLogTrace(_T("iconload"),
- _T("No large icons found in the file '%s'."),
+ wxLogTrace(wxT("iconload"),
+ wxT("No large icons found in the file '%s'."),
name.c_str());
}
}
// get the specified small icon from file
if ( !::ExtractIconEx(nameReal.wx_str(), iconIndex, NULL, &hicon, 1) )
{
- wxLogTrace(_T("iconload"),
- _T("No small icons found in the file '%s'."),
+ wxLogTrace(wxT("iconload"),
+ wxT("No small icons found in the file '%s'."),
name.c_str());
}
}
if ( !hicon )
{
- wxLogSysError(_T("Failed to load icon from the file '%s'"),
+ wxLogSysError(wxT("Failed to load icon from the file '%s'"),
name.c_str());
return false;
if ( (desiredWidth != -1 && desiredWidth != size.x) ||
(desiredHeight != -1 && desiredHeight != size.y) )
{
- wxLogTrace(_T("iconload"),
- _T("Returning false from wxICOFileHandler::Load because of the size mismatch: actual (%d, %d), requested (%d, %d)"),
+ wxLogTrace(wxT("iconload"),
+ wxT("Returning false from wxICOFileHandler::Load because of the size mismatch: actual (%d, %d), requested (%d, %d)"),
size.x, size.y,
desiredWidth, desiredHeight);
bool hasSize = desiredWidth != -1 || desiredHeight != -1;
wxASSERT_MSG( !hasSize || (desiredWidth != -1 && desiredHeight != -1),
- _T("width and height should be either both -1 or not") );
+ wxT("width and height should be either both -1 or not") );
// try to load the icon from this program first to allow overriding the
// standard icons (although why one would want to do it considering that
// we're prepared to handler errors so suppress log messages about them
wxLogNull noLog;
- wxDynamicLibrary dllGdip(_T("gdiplus.dll"), wxDL_VERBATIM);
+ wxDynamicLibrary dllGdip(wxT("gdiplus.dll"), wxDL_VERBATIM);
if ( !dllGdip.IsLoaded() )
return false;
return false;
#define wxLOAD_GDIPLUS_FUNC(name, params, args) \
- wxDO_LOAD_FUNC(name, _T("Gdiplus") wxSTRINGIZE_T(name))
+ wxDO_LOAD_FUNC(name, wxT("Gdiplus") wxSTRINGIZE_T(name))
wxFOR_ALL_GDIPLUS_FUNCNAMES(wxLOAD_GDIPLUS_FUNC)
#undef wxLOAD_GDIPLUS_FUNC
#define wxLOAD_GDIP_FUNC(name, params, args) \
- wxDO_LOAD_FUNC(name, _T("Gdip") wxSTRINGIZE_T(name))
+ wxDO_LOAD_FUNC(name, wxT("Gdip") wxSTRINGIZE_T(name))
wxFOR_ALL_GDIP_FUNCNAMES(wxLOAD_GDIP_FUNC)
{
if ( !wglShareLists(other->m_glContext, m_glContext) )
{
- wxLogLastError(_T("wglShareLists"));
+ wxLogLastError(wxT("wglShareLists"));
}
}
}
{
if ( !wglMakeCurrent(win.GetHDC(), m_glContext) )
{
- wxLogLastError(_T("wglMakeCurrent"));
+ wxLogLastError(wxT("wglMakeCurrent"));
return false;
}
return true;
DWORD msflags = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
msflags |= MSWGetStyle(style, &exStyle);
- if ( !MSWCreate(wxApp::GetRegisteredClassName(_T("wxGLCanvas"), -1, CS_OWNDC),
+ if ( !MSWCreate(wxApp::GetRegisteredClassName(wxT("wxGLCanvas"), -1, CS_OWNDC),
NULL, pos, size, msflags, exStyle) )
return false;
if ( !::SetPixelFormat(m_hDC, pixelFormat, &pfd) )
{
- wxLogLastError(_T("SetPixelFormat"));
+ wxLogLastError(wxT("SetPixelFormat"));
return false;
}
}
{
if ( !::SwapBuffers(m_hDC) )
{
- wxLogLastError(_T("SwapBuffers"));
+ wxLogLastError(wxT("SwapBuffers"));
return false;
}
UINT numFormats = 0;
if ( !wglChoosePixelFormatARB(hdc, iAttributes, NULL, 1, &pf, &numFormats) )
{
- wxLogLastError(_T("wglChoosePixelFormatARB"));
+ wxLogLastError(wxT("wglChoosePixelFormatARB"));
return 0;
}
if ( !pixelFormat )
{
- wxLogLastError(_T("ChoosePixelFormat"));
+ wxLogLastError(wxT("ChoosePixelFormat"));
return 0;
}
if ( !::SetPixelFormat(m_hDC, pixelFormat, &pfd) )
{
- wxLogLastError(_T("SetPixelFormat"));
+ wxLogLastError(wxT("SetPixelFormat"));
return 0;
}
const int pixelFormat = ::GetPixelFormat(m_hDC);
if ( !pixelFormat )
{
- wxLogLastError(_T("GetPixelFormat"));
+ wxLogLastError(wxT("GetPixelFormat"));
return false;
}
PIXELFORMATDESCRIPTOR pfd;
if ( !::DescribePixelFormat(m_hDC, pixelFormat, sizeof(pfd), &pfd) )
{
- wxLogLastError(_T("DescribePixelFormat"));
+ wxLogLastError(wxT("DescribePixelFormat"));
return false;
}
if ( !::SelectPalette(m_hDC, GetHpaletteOf(m_palette), FALSE) )
{
- wxLogLastError(_T("SelectPalette"));
+ wxLogLastError(wxT("SelectPalette"));
return false;
}
if ( ::RealizePalette(m_hDC) == GDI_ERROR )
{
- wxLogLastError(_T("RealizePalette"));
+ wxLogLastError(wxT("RealizePalette"));
return false;
}
if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
return false;
- if ( !MSWCreateControl(WC_HEADER, _T(""), pos, size) )
+ if ( !MSWCreateControl(WC_HEADER, wxT(""), pos, size) )
return false;
// special hack for margins when using comctl32.dll v6 or later: the
HDLAYOUT layout = { &rc, &wpos };
if ( !Header_Layout(GetHwnd(), &layout) )
{
- wxLogLastError(_T("Header_Layout"));
+ wxLogLastError(wxT("Header_Layout"));
return wxControl::DoGetBestSize();
}
{
if ( !Header_DeleteItem(GetHwnd(), 0) )
{
- wxLogLastError(_T("Header_DeleteItem"));
+ wxLogLastError(wxT("Header_DeleteItem"));
}
}
if ( ::SendMessage(GetHwnd(), HDM_INSERTITEM,
MSWToNativeIdx(idx), (LPARAM)&hdi) == -1 )
{
- wxLogLastError(_T("Header_InsertItem()"));
+ wxLogLastError(wxT("Header_InsertItem()"));
}
}
if ( !Header_SetOrderArray(GetHwnd(), orderShown.size(), &orderShown[0]) )
{
- wxLogLastError(_T("Header_GetOrderArray"));
+ wxLogLastError(wxT("Header_GetOrderArray"));
}
m_colIndices = order;
if ( !s_htmlHelp )
{
- static wxDynamicLibrary s_dllHtmlHelp(_T("HHCTRL.OCX"), wxDL_VERBATIM);
+ static wxDynamicLibrary s_dllHtmlHelp(wxT("HHCTRL.OCX"), wxDL_VERBATIM);
if ( !s_dllHtmlHelp.IsLoaded() )
{
wxString fullname = loc.GetFileName();
if ( loc.GetIndex() )
{
- fullname << _T(';') << loc.GetIndex();
+ fullname << wxT(';') << loc.GetIndex();
}
//else: 0 is default
// Returns the number of images in the image list.
int wxImageList::GetImageCount() const
{
- wxASSERT_MSG( m_hImageList, _T("invalid image list") );
+ wxASSERT_MSG( m_hImageList, wxT("invalid image list") );
return ImageList_GetImageCount(GetHImageList());
}
// Returns the size (same for all images) of the images in the list
bool wxImageList::GetSize(int WXUNUSED(index), int &width, int &height) const
{
- wxASSERT_MSG( m_hImageList, _T("invalid image list") );
+ wxASSERT_MSG( m_hImageList, wxT("invalid image list") );
return ImageList_GetIconSize(GetHImageList(), &width, &height) != 0;
}
return false;
HDC hDC = GetHdcOf(*msw_impl);
- wxCHECK_MSG( hDC, false, _T("invalid wxDC in wxImageList::Draw") );
+ wxCHECK_MSG( hDC, false, wxT("invalid wxDC in wxImageList::Draw") );
COLORREF clr = CLR_NONE; // transparent by default
if ( solidBackground )
{
wxChar szBuf[1024];
- GetPrivateProfileString(m_strGroup.wx_str(), NULL, _T(""),
+ GetPrivateProfileString(m_strGroup.wx_str(), NULL, wxT(""),
szBuf, WXSIZEOF(szBuf),
m_strLocalFilename.wx_str());
if ( !wxIsEmpty(szBuf) )
return false;
- GetProfileString(m_strGroup.wx_str(), NULL, _T(""), szBuf, WXSIZEOF(szBuf));
+ GetProfileString(m_strGroup.wx_str(), NULL, wxT(""), szBuf, WXSIZEOF(szBuf));
if ( !wxIsEmpty(szBuf) )
return false;
// first look in the private INI file
// NB: the lpDefault param to GetPrivateProfileString can't be NULL
- GetPrivateProfileString(m_strGroup.wx_str(), strKey.wx_str(), _T(""),
+ GetPrivateProfileString(m_strGroup.wx_str(), strKey.wx_str(), wxT(""),
szBuf, WXSIZEOF(szBuf),
m_strLocalFilename.wx_str());
if ( wxIsEmpty(szBuf) ) {
// now look in win.ini
wxString strKey = GetKeyName(path.Name());
GetProfileString(m_strGroup.wx_str(), strKey.wx_str(),
- _T(""), szBuf, WXSIZEOF(szBuf));
+ wxT(""), szBuf, WXSIZEOF(szBuf));
}
if ( wxIsEmpty(szBuf) )
bool wxIniConfig::DoWriteLong(const wxString& szKey, long lValue)
{
- return Write(szKey, wxString::Format(_T("%ld"), lValue));
+ return Write(szKey, wxString::Format(wxT("%ld"), lValue));
}
bool wxIniConfig::DoReadBinary(const wxString& WXUNUSED(key),
return false;
// create the native control
- if ( !MSWCreateControl(_T("LISTBOX"), wxEmptyString, pos, size) )
+ if ( !MSWCreateControl(wxT("LISTBOX"), wxEmptyString, pos, size) )
{
// control creation failed
return false;
msStyle |= LBS_NOINTEGRALHEIGHT;
wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED),
- _T("only one of listbox selection modes can be specified") );
+ wxT("only one of listbox selection modes can be specified") );
if ( style & wxLB_MULTIPLE )
msStyle |= LBS_MULTIPLESEL;
msStyle |= LBS_EXTENDEDSEL;
wxASSERT_MSG( !(style & wxLB_ALWAYS_SB) || !(style & wxLB_NO_SB),
- _T( "Conflicting styles wxLB_ALWAYS_SB and wxLB_NO_SB." ) );
+ wxT( "Conflicting styles wxLB_ALWAYS_SB and wxLB_NO_SB." ) );
if ( !(style & wxLB_NO_SB) )
{
int countSel = ListBox_GetSelCount(GetHwnd());
if ( countSel == LB_ERR )
{
- wxLogDebug(_T("ListBox_GetSelCount failed"));
+ wxLogDebug(wxT("ListBox_GetSelCount failed"));
}
else if ( countSel != 0 )
{
// init without conversion
void Init(LV_ITEM_NATIVE& item)
{
- wxASSERT_MSG( !m_pItem, _T("Init() called twice?") );
+ wxASSERT_MSG( !m_pItem, wxT("Init() called twice?") );
m_pItem = &item;
}
MAP_MODE_STYLE(wxLC_REPORT, LVS_REPORT)
wxASSERT_MSG( nModes == 1,
- _T("wxListCtrl style should have exactly one mode bit set") );
+ wxT("wxListCtrl style should have exactly one mode bit set") );
#undef MAP_MODE_STYLE
wstyle |= LVS_SORTASCENDING;
wxASSERT_MSG( !(style & wxLC_SORT_DESCENDING),
- _T("can't sort in ascending and descending orders at once") );
+ wxT("can't sort in ascending and descending orders at once") );
}
else if ( style & wxLC_SORT_DESCENDING )
wstyle |= LVS_SORTDESCENDING;
{
const int numCols = GetColumnCount();
wxCHECK_MSG( order >= 0 && order < numCols, -1,
- _T("Column position out of bounds") );
+ wxT("Column position out of bounds") );
wxArrayInt indexArray(numCols);
if ( !ListView_GetColumnOrderArray(GetHwnd(), numCols, &indexArray[0]) )
int wxListCtrl::GetColumnOrder(int col) const
{
const int numCols = GetColumnCount();
- wxASSERT_MSG( col >= 0 && col < numCols, _T("Column index out of bounds") );
+ wxASSERT_MSG( col >= 0 && col < numCols, wxT("Column index out of bounds") );
wxArrayInt indexArray(numCols);
if ( !ListView_GetColumnOrderArray(GetHwnd(), numCols, &indexArray[0]) )
return pos;
}
- wxFAIL_MSG( _T("no column with with given order?") );
+ wxFAIL_MSG( wxT("no column with with given order?") );
return -1;
}
const int numCols = GetColumnCount();
wxCHECK_MSG( orders.size() == (size_t)numCols, false,
- _T("wrong number of elements in column orders array") );
+ wxT("wrong number of elements in column orders array") );
return ListView_SetColumnOrderArray(GetHwnd(), numCols, &orders[0]) != 0;
}
{
const long id = info.GetId();
wxCHECK_MSG( id >= 0 && id < GetItemCount(), false,
- _T("invalid item index in SetItem") );
+ wxT("invalid item index in SetItem") );
LV_ITEM item;
wxConvertToMSWListItem(this, info, item);
{
if ( !ListView_SetItem(GetHwnd(), &item) )
{
- wxLogDebug(_T("ListView_SetItem() failed"));
+ wxLogDebug(wxT("ListView_SetItem() failed"));
return false;
}
if ( !::SendMessage(GetHwnd(), LVM_SETITEMSTATE,
(WPARAM)item, (LPARAM)&lvItem) )
{
- wxLogLastError(_T("ListView_SetItemState"));
+ wxLogLastError(wxT("ListView_SetItemState"));
return false;
}
RECT rc;
if ( !ListView_GetViewRect(GetHwnd(), &rc) )
{
- wxLogDebug(_T("ListView_GetViewRect() failed."));
+ wxLogDebug(wxT("ListView_GetViewRect() failed."));
wxZeroMemory(rc);
}
}
else
{
- wxFAIL_MSG( _T("not implemented in this mode") );
+ wxFAIL_MSG( wxT("not implemented in this mode") );
}
return rect;
// completely bogus in this case), so we check item validity ourselves
wxCHECK_MSG( subItem == wxLIST_GETSUBITEMRECT_WHOLEITEM ||
(subItem >= 0 && subItem < GetColumnCount()),
- false, _T("invalid sub item index") );
+ false, wxT("invalid sub item index") );
// use wxCHECK_MSG against "item" too, for coherency with the generic implementation:
wxCHECK_MSG( item >= 0 && item < GetItemCount(), false,
- _T("invalid item in GetSubItemRect") );
+ wxT("invalid item in GetSubItemRect") );
int codeWin;
if ( code == wxLIST_RECT_BOUNDS )
codeWin = LVIR_LABEL;
else
{
- wxFAIL_MSG( _T("incorrect code in GetItemRect() / GetSubItemRect()") );
+ wxFAIL_MSG( wxT("incorrect code in GetItemRect() / GetSubItemRect()") );
codeWin = LVIR_BOUNDS;
}
{
if ( !ListView_DeleteItem(GetHwnd(), (int) item) )
{
- wxLogLastError(_T("ListView_DeleteItem"));
+ wxLogLastError(wxT("ListView_DeleteItem"));
return false;
}
// -1 otherwise.
long wxListCtrl::InsertItem(const wxListItem& info)
{
- wxASSERT_MSG( !IsVirtual(), _T("can't be used with virtual controls") );
+ wxASSERT_MSG( !IsVirtual(), wxT("can't be used with virtual controls") );
LV_ITEM item;
wxConvertToMSWListItem(this, info, item);
{
if ( !ListView_Scroll(GetHwnd(), dx, dy) )
{
- wxLogDebug(_T("ListView_Scroll(%d, %d) failed"), dx, dy);
+ wxLogDebug(wxT("ListView_Scroll(%d, %d) failed"), dx, dy);
return false;
}
wxInternalDataCompareFunc,
(WPARAM) &internalData) )
{
- wxLogDebug(_T("ListView_SortItems() failed"));
+ wxLogDebug(wxT("ListView_SortItems() failed"));
return false;
}
#endif //__WXWINCE__
if ( !::GetCursorPos(ptClick) )
{
- wxLogLastError(_T("GetCursorPos"));
+ wxLogLastError(wxT("GetCursorPos"));
}
// we need to use listctrl coordinates for the event point so this is what
POINT ptClickHeader = *ptClick;
if ( !::ScreenToClient(nmhdr->hwndFrom, &ptClickHeader) )
{
- wxLogLastError(_T("ScreenToClient(listctrl header)"));
+ wxLogLastError(wxT("ScreenToClient(listctrl header)"));
}
if ( !::ScreenToClient(::GetParent(nmhdr->hwndFrom), ptClick) )
{
- wxLogLastError(_T("ScreenToClient(listctrl)"));
+ wxLogLastError(wxT("ScreenToClient(listctrl)"));
}
const int colCount = Header_GetItemCount(nmhdr->hwndFrom);
const int startPos = pFindInfo->iStart;
const int maxPos = GetItemCount();
wxCHECK_MSG( startPos <= maxPos, false,
- _T("bad starting position in LVN_ODFINDITEM") );
+ wxT("bad starting position in LVN_ODFINDITEM") );
int currentPos = startPos;
do
numCols,
&indexArray[0]) )
{
- wxFAIL_MSG( _T("invalid column index array in OnPaint()") );
+ wxFAIL_MSG( wxT("invalid column index array in OnPaint()") );
return;
}
{
// this is a pure virtual function, in fact - which is not really pure
// because the controls which are not virtual don't need to implement it
- wxFAIL_MSG( _T("wxListCtrl::OnGetItemText not supposed to be called") );
+ wxFAIL_MSG( wxT("wxListCtrl::OnGetItemText not supposed to be called") );
return wxEmptyString;
}
wxListItemAttr *wxListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const
{
wxASSERT_MSG( item >= 0 && item < GetItemCount(),
- _T("invalid item index in OnGetItemAttr()") );
+ wxT("invalid item index in OnGetItemAttr()") );
// no attributes by default
return NULL;
void wxListCtrl::SetItemCount(long count)
{
- wxASSERT_MSG( IsVirtual(), _T("this is for virtual controls only") );
+ wxASSERT_MSG( IsVirtual(), wxT("this is for virtual controls only") );
if ( !::SendMessage(GetHwnd(), LVM_SETITEMCOUNT, (WPARAM)count,
LVSICF_NOSCROLL | LVSICF_NOINVALIDATEALL) )
{
- wxLogLastError(_T("ListView_SetItemCount"));
+ wxLogLastError(wxT("ListView_SetItemCount"));
}
m_count = count;
wxASSERT_MSG( m_count == ListView_GetItemCount(GetHwnd()),
switch ( wxGlobalSEHandler(ep) )
{
default:
- wxFAIL_MSG( _T("unexpected wxGlobalSEHandler() return value") );
+ wxFAIL_MSG( wxT("unexpected wxGlobalSEHandler() return value") );
// fall through
case EXCEPTION_EXECUTE_HANDLER:
wxChar fullname[MAX_PATH];
if ( !::GetTempPath(WXSIZEOF(fullname), fullname) )
{
- wxLogLastError(_T("GetTempPath"));
+ wxLogLastError(wxT("GetTempPath"));
// when all else fails...
- wxStrcpy(fullname, _T("c:\\"));
+ wxStrcpy(fullname, wxT("c:\\"));
}
// use PID and date to make the report file name more unique
wxString name = wxString::Format
(
- _T("%s_%s_%lu.dmp"),
+ wxT("%s_%s_%lu.dmp"),
wxTheApp ? (const wxChar*)wxTheApp->GetAppDisplayName().c_str()
- : _T("wxwindows"),
- wxDateTime::Now().Format(_T("%Y%m%dT%H%M%S")).c_str(),
+ : wxT("wxwindows"),
+ wxDateTime::Now().Format(wxT("%Y%m%dT%H%M%S")).c_str(),
::GetCurrentProcessId()
);
msflags &= ~WS_VSCROLL;
msflags &= ~WS_HSCROLL;
- if ( !wxWindow::MSWCreate(wxApp::GetRegisteredClassName(_T("wxMDIFrame")),
+ if ( !wxWindow::MSWCreate(wxApp::GetRegisteredClassName(wxT("wxMDIFrame")),
title.wx_str(),
pos, size,
msflags,
void wxMDIParentFrame::Tile(wxOrientation orient)
{
wxASSERT_MSG( orient == wxHORIZONTAL || orient == wxVERTICAL,
- _T("invalid orientation value") );
+ wxT("invalid orientation value") );
::SendMessage(GetWinHwnd(GetClientWindow()), WM_MDITILE,
orient == wxHORIZONTAL ? MDITILE_HORIZONTAL
MDICREATESTRUCT mcs;
wxString className =
- wxApp::GetRegisteredClassName(_T("wxMDIChildFrame"), COLOR_WINDOW);
+ wxApp::GetRegisteredClassName(wxT("wxMDIChildFrame"), COLOR_WINDOW);
if ( !(style & wxFULL_REPAINT_ON_RESIZE) )
className += wxApp::GetNoRedrawClassSuffix();
if ( !m_hWnd )
{
- wxLogLastError(_T("WM_MDICREATE"));
+ wxLogLastError(wxT("WM_MDICREATE"));
return false;
}
DWORD err = ::GetLastError();
if ( err )
{
- wxLogApiError(_T("SendMessage(WM_MDISETMENU)"), err);
+ wxLogApiError(wxT("SendMessage(WM_MDISETMENU)"), err);
}
}
}
// First get the AMGetErrorText procedure in
// debug mode for more meaningful messages
#if wxDEBUG_LEVEL
- if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) )
+ if ( m_dllQuartz.Load(wxT("quartz.dll"), wxDL_VERBATIM) )
{
m_lpAMGetErrorText = (LPAMGETERRORTEXT)
m_dllQuartz.GetSymbolAorW(wxT("AMGetErrorText"));
{ \
TCHAR sz[5000]; \
mciGetErrorString(nRet, sz, 5000); \
- wxFAIL_MSG(wxString::Format(_T("MCI Error:%s"), sz)); \
+ wxFAIL_MSG(wxString::Format(wxT("MCI Error:%s"), sz)); \
} \
}
#else
// First get the AMGetErrorText procedure in debug
// mode for more meaningful messages
#if wxDEBUG_LEVEL
- if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) )
+ if ( m_dllQuartz.Load(wxT("quartz.dll"), wxDL_VERBATIM) )
{
m_lpAMGetErrorText = (LPAMGETERRORTEXT)
m_dllQuartz.GetSymbolAorW(wxT("AMGetErrorText"));
::GetClientRect((HWND)ctrl->GetHandle(), &rcClient);
m_wndView.Create((HWND)ctrl->GetHandle(), rcClient, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE);
hr = m_wndView.QueryHost(&spHost);
- hr = spHost->CreateControl(CComBSTR(_T("{6BF52A52-394A-11d3-B153-00C04F79FAA6}")), m_wndView, 0);
+ hr = spHost->CreateControl(CComBSTR(wxT("{6BF52A52-394A-11d3-B153-00C04F79FAA6}")), m_wndView, 0);
hr = m_wndView.QueryControl(&m_pWMPPlayer);
if( m_pWMPPlayer->get_settings(&m_pWMPSettings) != 0)
{
WinStruct<SHELLEXECUTEINFO> sei;
sei.lpFile = path.c_str();
- sei.lpVerb = _T("open");
+ sei.lpVerb = wxT("open");
sei.nShow = nShowStyle;
::ShellExecuteEx(&sei);
// the app from starting up under Windows 95/NT 4
typedef BOOL (WINAPI *SetMenuInfo_t)(HMENU, MENUINFO *);
- wxDynamicLibrary dllUser(_T("user32"));
+ wxDynamicLibrary dllUser(wxT("user32"));
wxDYNLIB_FUNCTION(SetMenuInfo_t, SetMenuInfo, dllUser);
if ( pfnSetMenuInfo )
{
mi.dwStyle = MNS_CHECKORBMP;
if ( !(*pfnSetMenuInfo)(GetHmenu(), &mi) )
{
- wxLogLastError(_T("SetMenuInfo(MNS_NOCHECK)"));
+ wxLogLastError(wxT("SetMenuInfo(MNS_NOCHECK)"));
}
}
wxMenuItem* wxMenu::DoAppend(wxMenuItem *item)
{
- wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") );
+ wxCHECK_MSG( item, NULL, wxT("NULL item in wxMenu::DoAppend") );
bool check = false;
}
else
{
- wxFAIL_MSG( _T("where is the radio group start item?") );
+ wxFAIL_MSG( wxT("where is the radio group start item?") );
}
}
}
SetMarginWidth(GetMarginWidth());
// tell the owner drawing code to show the accel string as well
- SetAccelString(m_text.AfterFirst(_T('\t')));
+ SetAccelString(m_text.AfterFirst(wxT('\t')));
#endif // wxUSE_OWNER_DRAWN
}
void wxMenuItem::SetRadioGroupStart(int start)
{
wxASSERT_MSG( !m_isRadioGroupStart,
- _T("should only be called for the next radio items") );
+ wxT("should only be called for the next radio items") );
m_radioGroup.start = start;
}
void wxMenuItem::SetRadioGroupEnd(int end)
{
wxASSERT_MSG( m_isRadioGroupStart,
- _T("should only be called for the first radio item") );
+ wxT("should only be called for the first radio item") );
m_radioGroup.end = end;
}
const wxMenuItemList& items = m_parentMenu->GetMenuItems();
int pos = items.IndexOf(this);
wxCHECK_RET( pos != wxNOT_FOUND,
- _T("menuitem not found in the menu items list?") );
+ wxT("menuitem not found in the menu items list?") );
// get the radio group range
int start,
// (NT4 SP6) and I suspect this could happen to the others as well,
// so don't do it!
wxCHECK_RET( start != -1 && end != -1,
- _T("invalid ::CheckMenuRadioItem() parameter(s)") );
+ wxT("invalid ::CheckMenuRadioItem() parameter(s)") );
if ( !::CheckMenuRadioItem(hmenu,
start, // the first radio group item
pos, // the one to check
MF_BYPOSITION) )
{
- wxLogLastError(_T("CheckMenuRadioItem"));
+ wxLogLastError(wxT("CheckMenuRadioItem"));
}
#endif // __WIN32__
GetMSWId(),
MF_BYCOMMAND | flags) == (DWORD)-1 )
{
- wxFAIL_MSG(_T("CheckMenuItem() failed, item not in the menu?"));
+ wxFAIL_MSG(wxT("CheckMenuItem() failed, item not in the menu?"));
}
}
}
OWNER_DRAWN_ONLY( wxOwnerDrawn::SetName(m_text) );
#if wxUSE_OWNER_DRAWN
// tell the owner drawing code to to show the accel string as well
- SetAccelString(m_text.AfterFirst(_T('\t')));
+ SetAccelString(m_text.AfterFirst(wxT('\t')));
#endif
// the item can be not attached to any menu yet and SetItemLabel() is still
if ( !::PlayMetaFile(GetHdcOf(*dc), (HMETAFILE)
M_METAFILEDATA->m_metafile) )
{
- wxLogLastError(_T("PlayMetaFile"));
+ wxLogLastError(wxT("PlayMetaFile"));
}
}
void wxMetafileDCImpl::DoGetSize(int *width, int *height) const
{
- wxCHECK_RET( m_refData, _T("invalid wxMetafileDC") );
+ wxCHECK_RET( m_refData, wxT("invalid wxMetafileDC") );
if ( width )
*width = M_METAFILEDATA->m_width;
p < (WORD *)&pMFHead ->checksum; ++p)
pMFHead ->checksum ^= *p;
- FILE *fd = wxFopen(filename.fn_str(), _T("rb"));
+ FILE *fd = wxFopen(filename.fn_str(), wxT("rb"));
if (!fd) return false;
wxString tempFileBuf = wxFileName::CreateTempFileName(wxT("mf"));
if (tempFileBuf.empty())
return false;
- FILE *fHandle = wxFopen(tempFileBuf.fn_str(), _T("wb"));
+ FILE *fHandle = wxFopen(tempFileBuf.fn_str(), wxT("wb"));
if (!fHandle)
return false;
fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle);
METAFILEPICT *mfpict = (METAFILEPICT *)buf;
const wxMetafile& mf = GetMetafile();
- wxCHECK_MSG( mf.GetHMETAFILE(), false, _T("copying invalid metafile") );
+ wxCHECK_MSG( mf.GetHMETAFILE(), false, wxT("copying invalid metafile") );
// doesn't seem to work with any other mapping mode...
mfpict->mm = MM_ANISOTROPIC; //mf.GetWindowsMappingMode();
mf.SetHeight(h);
mf.SetHMETAFILE((WXHANDLE)mfpict->hMF);
- wxCHECK_MSG( mfpict->hMF, false, _T("pasting invalid metafile") );
+ wxCHECK_MSG( mfpict->hMF, false, wxT("pasting invalid metafile") );
SetMetafile(mf);
void wxFileTypeImpl::Init(const wxString& strFileType, const wxString& ext)
{
// VZ: does it? (FIXME)
- wxCHECK_RET( !ext.empty(), _T("needs an extension") );
+ wxCHECK_RET( !ext.empty(), wxT("needs an extension") );
if ( ext[0u] != wxT('.') ) {
m_ext = wxT('.');
m_strFileType = strFileType;
if ( !strFileType ) {
- m_strFileType = m_ext.AfterFirst('.') + _T("_auto_file");
+ m_strFileType = m_ext.AfterFirst('.') + wxT("_auto_file");
}
}
wxString wxFileTypeImpl::GetVerbPath(const wxString& verb) const
{
wxString path;
- path << m_strFileType << _T("\\shell\\") << verb << _T("\\command");
+ path << m_strFileType << wxT("\\shell\\") << verb << wxT("\\command");
return path;
}
wxArrayString *commands,
const wxFileType::MessageParameters& params) const
{
- wxCHECK_MSG( !m_ext.empty(), 0, _T("GetAllCommands() needs an extension") );
+ wxCHECK_MSG( !m_ext.empty(), 0, wxT("GetAllCommands() needs an extension") );
if ( m_strFileType.empty() )
{
wxRegKey rkey(wxRegKey::HKCR, m_ext);
if ( !rkey.Exists() || !rkey.QueryValue(wxEmptyString, self->m_strFileType) )
{
- wxLogDebug(_T("Can't get the filetype for extension '%s'."),
+ wxLogDebug(wxT("Can't get the filetype for extension '%s'."),
m_ext.c_str());
return 0;
// enum all subkeys of HKCR\filetype\shell
size_t count = 0;
- wxRegKey rkey(wxRegKey::HKCR, m_strFileType + _T("\\shell"));
+ wxRegKey rkey(wxRegKey::HKCR, m_strFileType + wxT("\\shell"));
long dummy;
wxString verb;
bool ok = rkey.GetFirstKey(verb, dummy);
// we want the open bverb to eb always the first
- if ( verb.CmpNoCase(_T("open")) == 0 )
+ if ( verb.CmpNoCase(wxT("open")) == 0 )
{
if ( verbs )
verbs->Insert(verb, 0);
}
}
- if (!strKey && wxRegKey(wxRegKey::HKCR, m_ext + _T("\\shell")).Exists())
+ if (!strKey && wxRegKey(wxRegKey::HKCR, m_ext + wxT("\\shell")).Exists())
strKey = m_ext;
if ( !strKey && !m_strFileType.empty())
{
wxString fileType = wxFileTypeImplGetCurVer(m_strFileType);
- if (wxRegKey(wxRegKey::HKCR, fileType + _T("\\shell")).Exists())
+ if (wxRegKey(wxRegKey::HKCR, fileType + wxT("\\shell")).Exists())
strKey = fileType;
}
}
strKey << wxT("\\shell\\") << verb;
- wxRegKey key(wxRegKey::HKCR, strKey + _T("\\command"));
+ wxRegKey key(wxRegKey::HKCR, strKey + wxT("\\command"));
wxString command;
if ( key.Open(wxRegKey::Read) ) {
// it's the default value of the key
#if wxUSE_IPC
// look whether we must issue some DDE requests to the application
// (and not just launch it)
- strKey += _T("\\DDEExec");
+ strKey += wxT("\\DDEExec");
wxRegKey keyDDE(wxRegKey::HKCR, strKey);
if ( keyDDE.Open(wxRegKey::Read) ) {
wxString ddeCommand, ddeServer, ddeTopic;
keyDDE.QueryValue(wxEmptyString, ddeCommand);
- ddeCommand.Replace(_T("%1"), _T("%s"));
+ ddeCommand.Replace(wxT("%1"), wxT("%s"));
- wxRegKey keyServer(wxRegKey::HKCR, strKey + _T("\\Application"));
+ wxRegKey keyServer(wxRegKey::HKCR, strKey + wxT("\\Application"));
keyServer.QueryValue(wxEmptyString, ddeServer);
- wxRegKey keyTopic(wxRegKey::HKCR, strKey + _T("\\Topic"));
+ wxRegKey keyTopic(wxRegKey::HKCR, strKey + wxT("\\Topic"));
keyTopic.QueryValue(wxEmptyString, ddeTopic);
if (ddeTopic.empty())
// HACK: we use a special feature of wxExecute which exists
// just because we need it here: it will establish DDE
// conversation with the program it just launched
- command.Prepend(_T("WX_DDE#"));
- command << _T('#') << ddeServer
- << _T('#') << ddeTopic
- << _T('#') << ddeCommand;
+ command.Prepend(wxT("WX_DDE#"));
+ command << wxT('#') << ddeServer
+ << wxT('#') << ddeTopic
+ << wxT('#') << ddeCommand;
}
else
#endif // wxUSE_IPC
wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
{
wxCHECK_MSG( !ftInfo.GetExtensions().empty(), NULL,
- _T("Associate() needs extension") );
+ wxT("Associate() needs extension") );
bool ok;
size_t iExtCount = 0;
wxString ext = ftInfo.GetExtensions()[iExtCount];
wxCHECK_MSG( !ext.empty(), NULL,
- _T("Associate() needs non empty extension") );
+ wxT("Associate() needs non empty extension") );
- if ( ext[0u] != _T('.') )
- extWithDot = _T('.');
+ if ( ext[0u] != wxT('.') )
+ extWithDot = wxT('.');
extWithDot += ext;
// start by setting the HKCR\\.ext entries
if ( filetypeOrig.empty() )
{
// make it up from the extension
- filetype << extWithDot.c_str() + 1 << _T("_file");
+ filetype << extWithDot.c_str() + 1 << wxT("_file");
}
else
{
if ( !mimetype.empty() )
{
// set the MIME type
- ok = key.SetValue(_T("Content Type"), mimetype);
+ ok = key.SetValue(wxT("Content Type"), mimetype);
if ( ok )
{
if ( ok )
{
// and provide a back link to the extension
- keyMIME.SetValue(_T("Extension"), extWithDot);
+ keyMIME.SetValue(wxT("Extension"), extWithDot);
}
}
}
for (iExtCount=1; iExtCount < ftInfo.GetExtensionsCount(); iExtCount++ )
{
ext = ftInfo.GetExtensions()[iExtCount];
- if ( ext[0u] != _T('.') )
- extWithDot = _T('.');
+ if ( ext[0u] != wxT('.') )
+ extWithDot = wxT('.');
extWithDot += ext;
wxRegKey key(wxRegKey::HKCR, extWithDot);
if ( !mimetype.empty() )
{
// set the MIME type
- ok = key.SetValue(_T("Content Type"), mimetype);
+ ok = key.SetValue(wxT("Content Type"), mimetype);
if ( ok )
{
if ( ok )
{
// and provide a back link to the extension
- keyMIME.SetValue(_T("Extension"), extWithDot);
+ keyMIME.SetValue(wxT("Extension"), extWithDot);
}
}
}
bool WXUNUSED(overwriteprompt))
{
wxCHECK_MSG( !m_ext.empty() && !verb.empty(), false,
- _T("SetCommand() needs an extension and a verb") );
+ wxT("SetCommand() needs an extension and a verb") );
if ( !EnsureExtKeyExists() )
return false;
// TODO:
// 1. translate '%s' to '%1' instead of always adding it
// 2. create DDEExec value if needed (undo GetCommand)
- return rkey.Create() && rkey.SetValue(wxEmptyString, cmd + _T(" \"%1\"") );
+ return rkey.Create() && rkey.SetValue(wxEmptyString, cmd + wxT(" \"%1\"") );
}
/* // no longer used
bool wxFileTypeImpl::SetMimeType(const wxString& mimeTypeOrig)
{
- wxCHECK_MSG( !m_ext.empty(), false, _T("SetMimeType() needs extension") );
+ wxCHECK_MSG( !m_ext.empty(), false, wxT("SetMimeType() needs extension") );
if ( !EnsureExtKeyExists() )
return false;
{
// make up a default value for it
wxString cmd;
- wxFileName::SplitPath(GetCommand(_T("open")), NULL, &cmd, NULL);
- mimeType << _T("application/x-") << cmd;
+ wxFileName::SplitPath(GetCommand(wxT("open")), NULL, &cmd, NULL);
+ mimeType << wxT("application/x-") << cmd;
}
else
{
}
wxRegKey rkey(wxRegKey::HKCR, m_ext);
- return rkey.Create() && rkey.SetValue(_T("Content Type"), mimeType);
+ return rkey.Create() && rkey.SetValue(wxT("Content Type"), mimeType);
}
*/
bool wxFileTypeImpl::SetDefaultIcon(const wxString& cmd, int index)
{
- wxCHECK_MSG( !m_ext.empty(), false, _T("SetDefaultIcon() needs extension") );
- wxCHECK_MSG( !m_strFileType.empty(), false, _T("File key not found") );
+ wxCHECK_MSG( !m_ext.empty(), false, wxT("SetDefaultIcon() needs extension") );
+ wxCHECK_MSG( !m_strFileType.empty(), false, wxT("File key not found") );
// the next line fails on a SMBshare, I think because it is case mangled
-// wxCHECK_MSG( !wxFileExists(cmd), false, _T("Icon file not found.") );
+// wxCHECK_MSG( !wxFileExists(cmd), false, wxT("Icon file not found.") );
if ( !EnsureExtKeyExists() )
return false;
- wxRegKey rkey(wxRegKey::HKCR, m_strFileType + _T("\\DefaultIcon"));
+ wxRegKey rkey(wxRegKey::HKCR, m_strFileType + wxT("\\DefaultIcon"));
return rkey.Create() &&
rkey.SetValue(wxEmptyString,
- wxString::Format(_T("%s,%d"), cmd.c_str(), index));
+ wxString::Format(wxT("%s,%d"), cmd.c_str(), index));
}
bool wxFileTypeImpl::SetDescription (const wxString& desc)
{
- wxCHECK_MSG( !m_strFileType.empty(), false, _T("File key not found") );
- wxCHECK_MSG( !desc.empty(), false, _T("No file description supplied") );
+ wxCHECK_MSG( !m_strFileType.empty(), false, wxT("File key not found") );
+ wxCHECK_MSG( !desc.empty(), false, wxT("No file description supplied") );
if ( !EnsureExtKeyExists() )
return false;
bool wxFileTypeImpl::RemoveOpenCommand()
{
- return RemoveCommand(_T("open"));
+ return RemoveCommand(wxT("open"));
}
bool wxFileTypeImpl::RemoveCommand(const wxString& verb)
{
wxCHECK_MSG( !m_ext.empty() && !verb.empty(), false,
- _T("RemoveCommand() needs an extension and a verb") );
+ wxT("RemoveCommand() needs an extension and a verb") );
wxRegKey rkey(wxRegKey::HKCR, GetVerbPath(verb));
bool wxFileTypeImpl::RemoveMimeType()
{
- wxCHECK_MSG( !m_ext.empty(), false, _T("RemoveMimeType() needs extension") );
+ wxCHECK_MSG( !m_ext.empty(), false, wxT("RemoveMimeType() needs extension") );
wxRegKey rkey(wxRegKey::HKCR, m_ext);
return !rkey.Exists() || rkey.DeleteSelf();
bool wxFileTypeImpl::RemoveDefaultIcon()
{
wxCHECK_MSG( !m_ext.empty(), false,
- _T("RemoveDefaultIcon() needs extension") );
+ wxT("RemoveDefaultIcon() needs extension") );
- wxRegKey rkey (wxRegKey::HKCR, m_strFileType + _T("\\DefaultIcon"));
+ wxRegKey rkey (wxRegKey::HKCR, m_strFileType + wxT("\\DefaultIcon"));
return !rkey.Exists() || rkey.DeleteSelf();
}
bool wxFileTypeImpl::RemoveDescription()
{
wxCHECK_MSG( !m_ext.empty(), false,
- _T("RemoveDescription() needs extension") );
+ wxT("RemoveDescription() needs extension") );
wxRegKey rkey (wxRegKey::HKCR, m_strFileType );
return !rkey.Exists() || rkey.DeleteSelf();
// find the static control to replace: normally there are two of them, the
// icon and the text itself so search for all of them and ignore the icon
// ones
- HWND hwndStatic = ::FindWindowEx(GetHwnd(), NULL, _T("STATIC"), NULL);
+ HWND hwndStatic = ::FindWindowEx(GetHwnd(), NULL, wxT("STATIC"), NULL);
if ( ::GetWindowLong(hwndStatic, GWL_STYLE) & SS_ICON )
- hwndStatic = ::FindWindowEx(GetHwnd(), hwndStatic, _T("STATIC"), NULL);
+ hwndStatic = ::FindWindowEx(GetHwnd(), hwndStatic, wxT("STATIC"), NULL);
if ( !hwndStatic )
{
// do create the new control
HWND hwndEdit = ::CreateWindow
(
- _T("EDIT"),
+ wxT("EDIT"),
wxTextBuffer::Translate(text).wx_str(),
WS_CHILD | WS_VSCROLL | WS_VISIBLE |
ES_MULTILINE | ES_READONLY | ES_AUTOVSCROLL,
switch (msAns)
{
default:
- wxFAIL_MSG(_T("unexpected ::MessageBox() return code"));
+ wxFAIL_MSG(wxT("unexpected ::MessageBox() return code"));
// fall through
case IDCANCEL:
wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
{
- wxCHECK_MSG( parent, NULL, _T("must have valid parent for a control") );
+ wxCHECK_MSG( parent, NULL, wxT("must have valid parent for a control") );
wxString str(wxGetWindowClass(hWnd));
str.UpperCase();
}
else
{
- wxLogLastError(_T("GetClassInfoEx(SysTabCtl32)"));
+ wxLogLastError(wxT("GetClassInfoEx(SysTabCtl32)"));
}
}
void wxNotebook::AdjustPageSize(wxNotebookPage *page)
{
- wxCHECK_RET( page, _T("NULL page in wxNotebook::AdjustPageSize") );
+ wxCHECK_RET( page, wxT("NULL page in wxNotebook::AdjustPageSize") );
const wxRect r = GetPageSize();
if ( !r.IsEmpty() )
bool bSelect,
int imageId)
{
- wxCHECK_MSG( pPage != NULL, false, _T("NULL page in wxNotebook::InsertPage") );
+ wxCHECK_MSG( pPage != NULL, false, wxT("NULL page in wxNotebook::InsertPage") );
wxCHECK_MSG( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), false,
- _T("invalid index in wxNotebook::InsertPage") );
+ wxT("invalid index in wxNotebook::InsertPage") );
wxASSERT_MSG( pPage->GetParent() == this,
- _T("notebook pages must have notebook as parent") );
+ wxT("notebook pages must have notebook as parent") );
// add a new tab to the control
// ----------------------------
if ( !::SetBrushOrgEx((HDC)hDC, -rc.left, -rc.top, NULL) )
{
- wxLogLastError(_T("SetBrushOrgEx(notebook bg brush)"));
+ wxLogLastError(wxT("SetBrushOrgEx(notebook bg brush)"));
}
return m_hbrBackground;
if ( !icon.IsOk() )
{
// we really must have some icon
- icon = wxIcon(_T("wxICON_AAA"));
+ icon = wxIcon(wxT("wxICON_AAA"));
}
m_icon->SetIcon(icon);
int flags)
{
wxASSERT_MSG( timeout == wxNotificationMessage::Timeout_Never,
- _T("shouldn't be used") );
+ wxT("shouldn't be used") );
// base class creates the icon for us initially but we could have destroyed
// it in DoClose(), recreate it if this was the case
int flags)
{
wxASSERT_MSG( timeout != wxNotificationMessage::Timeout_Never,
- _T("shouldn't be used") );
+ wxT("shouldn't be used") );
if ( timeout == wxNotificationMessage::Timeout_Auto )
{
break;
default:
- wxLogDebug(_T("unhandled VT_ARRAY type %x in wxConvertOleToVariant"),
+ wxLogDebug(wxT("unhandled VT_ARRAY type %x in wxConvertOleToVariant"),
oleVariant.vt & VT_TYPEMASK);
variant = wxVariant();
ok = false;
#include "wx/msw/dib.h"
#ifndef CFSTR_SHELLURL
-#define CFSTR_SHELLURL _T("UniformResourceLocator")
+#define CFSTR_SHELLURL wxT("UniformResourceLocator")
#endif
// ----------------------------------------------------------------------------
// Work around bug in Wine headers
#if defined(__WINE__) && defined(CFSTR_SHELLURL) && wxUSE_UNICODE
#undef CFSTR_SHELLURL
-#define CFSTR_SHELLURL _T("CFSTR_SHELLURL")
+#define CFSTR_SHELLURL wxT("CFSTR_SHELLURL")
#endif
class CFSTR_SHELLURLDataObject : public wxCustomDataObject
wxString wxURLDataObject::GetURL() const
{
wxString url;
- wxCHECK_MSG( m_dataObjectLast, url, _T("no data in wxURLDataObject") );
+ wxCHECK_MSG( m_dataObjectLast, url, wxT("no data in wxURLDataObject") );
size_t len = m_dataObjectLast->GetDataSize();
wxLogTrace(wxTRACE_OleCalls, wxT("IDropTarget::DragEnter"));
wxASSERT_MSG( m_pIDataObject == NULL,
- _T("drop target must have data object") );
+ wxT("drop target must have data object") );
// show the list of formats supported by the source data object for the
// debugging purposes, this is quite useful sometimes - please don't remove
FORMATETC fmt;
while ( penumFmt->Next(1, &fmt, NULL) == S_OK )
{
- wxLogDebug(_T("Drop source supports format %s"),
+ wxLogDebug(wxT("Drop source supports format %s"),
wxDataObject::GetFormatName(fmt.cfFormat));
}
}
else
{
- wxLogLastError(_T("IDataObject::EnumFormatEtc"));
+ wxLogLastError(wxT("IDataObject::EnumFormatEtc"));
}
#endif // 0
};
// construct the table containing all known interfaces
- #define ADD_KNOWN_IID(name) { &IID_I##name, _T(#name) }
+ #define ADD_KNOWN_IID(name) { &IID_I##name, wxT(#name) }
static const KNOWN_IID aKnownIids[] = {
ADD_KNOWN_IID(AdviseSink),
break;
default:
- wxFAIL_MSG( _T("DrawStateBitmap: unknown wxDSBStates value") );
+ wxFAIL_MSG( wxT("DrawStateBitmap: unknown wxDSBStates value") );
result = FALSE;
}
return PS_NULL;
default:
- wxFAIL_MSG( _T("unknown pen style") );
+ wxFAIL_MSG( wxT("unknown pen style") );
// fall through
#ifdef wxHAVE_EXT_CREATE_PEN
return PS_JOIN_MITER;
default:
- wxFAIL_MSG( _T("unknown pen join style") );
+ wxFAIL_MSG( wxT("unknown pen join style") );
// fall through
case wxJOIN_ROUND:
return PS_ENDCAP_FLAT;
default:
- wxFAIL_MSG( _T("unknown pen cap style") );
+ wxFAIL_MSG( wxT("unknown pen cap style") );
// fall through
case wxCAP_ROUND:
// raise to top of z order
if (!::SetWindowPos(GetHwnd(), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE))
{
- wxLogLastError(_T("SetWindowPos"));
+ wxLogLastError(wxT("SetWindowPos"));
}
// and set it as the foreground window so the mouse can be captured
{
if ( !::GetSystemPowerStatus(sps) )
{
- wxLogLastError(_T("GetSystemPowerStatus()"));
+ wxLogLastError(wxT("GetSystemPowerStatus()"));
return false;
}
return wxPOWER_SOCKET;
default:
- wxLogDebug(_T("Unknown ACLineStatus=%u"), sps.ACLineStatus);
+ wxLogDebug(wxT("Unknown ACLineStatus=%u"), sps.ACLineStatus);
case 255:
break;
}
wxWindowIDRef subid = NewControlId();
- HWND hwndBtn = ::CreateWindow(_T("BUTTON"),
+ HWND hwndBtn = ::CreateWindow(wxT("BUTTON"),
choices[i].wx_str(),
styleBtn,
0, 0, 0, 0, // will be set in SetSize()
// Create a dummy radio control to end the group.
m_dummyId = NewControlId();
- m_dummyHwnd = (WXHWND)::CreateWindow(_T("BUTTON"),
+ m_dummyHwnd = (WXHWND)::CreateWindow(wxT("BUTTON"),
wxEmptyString,
WS_GROUP | BS_AUTORADIOBUTTON | WS_CHILD,
0, 0, 0, 0, GetHwndOf(parent),
if ( HasFlag(wxALIGN_RIGHT) )
msStyle |= BS_LEFTTEXT | BS_RIGHT;
- if ( !MSWCreateControl(_T("BUTTON"), msStyle, pos, size, label, 0) )
+ if ( !MSWCreateControl(wxT("BUTTON"), msStyle, pos, size, label, 0) )
return false;
// for compatibility with wxGTK, the first radio button in a group is
wxWindow * const focus = FindFocus();
wxTopLevelWindow * const
tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
- wxCHECK_RET( tlw, _T("radio button outside of TLW?") );
+ wxCHECK_RET( tlw, wxT("radio button outside of TLW?") );
wxWindow * const focusInTLW = tlw->GetLastFocus();
const wxWindowList& siblings = GetParent()->GetChildren();
wxWindowList::compatibility_iterator nodeThis = siblings.Find(this);
- wxCHECK_RET( nodeThis, _T("radio button not a child of its parent?") );
+ wxCHECK_RET( nodeThis, wxT("radio button not a child of its parent?") );
// this will be set to true in the code below if the focus is in our TLW
// and belongs to one of the other buttons in the same group
{
wxASSERT_MSG( m_isChecked ==
(::SendMessage(GetHwnd(), BM_GETCHECK, 0, 0L) != 0),
- _T("wxRadioButton::m_isChecked is out of sync?") );
+ wxT("wxRadioButton::m_isChecked is out of sync?") );
return m_isChecked;
}
// note that we don't have to check for src < end here as
// *end == 0 so can't be '.'
- if ( src[1] == _T('.') && src[2] == _T('.') &&
+ if ( src[1] == wxT('.') && src[2] == wxT('.') &&
(src + 3 == end || src[3] == wxCONFIG_PATH_SEPARATOR) )
{
if ( !totalSlashes )
// we must have found a slash one way or another!
wxASSERT_MSG( *dst == wxCONFIG_PATH_SEPARATOR,
- _T("error in wxRegConfig::SetPath") );
+ wxT("error in wxRegConfig::SetPath") );
// stay at the same position
dst--;
dst--;
}
- *dst = _T('\0');
+ *dst = wxT('\0');
buf.SetLength(dst - start);
}
for ( ; src < end; src++, dst++ )
{
if ( *src == wxCONFIG_PATH_SEPARATOR )
- *dst = _T('\\');
+ *dst = wxT('\\');
else
*dst = *src;
}
bool wxRegConfig::DoReadString(const wxString& key, wxString *pStr) const
{
- wxCHECK_MSG( pStr, false, _T("wxRegConfig::Read(): NULL param") );
+ wxCHECK_MSG( pStr, false, wxT("wxRegConfig::Read(): NULL param") );
wxConfigPathChanger path(this, key);
bool wxRegConfig::DoReadLong(const wxString& key, long *plResult) const
{
- wxCHECK_MSG( plResult, false, _T("wxRegConfig::Read(): NULL param") );
+ wxCHECK_MSG( plResult, false, wxT("wxRegConfig::Read(): NULL param") );
wxConfigPathChanger path(this, key);
bool wxRegConfig::DoReadBinary(const wxString& key, wxMemoryBuffer *buf) const
{
- wxCHECK_MSG( buf, false, _T("wxRegConfig::Read(): NULL param") );
+ wxCHECK_MSG( buf, false, wxT("wxRegConfig::Read(): NULL param") );
wxConfigPathChanger path(this, key);
if ( bGroupIfEmptyAlso && m_keyLocal.IsEmpty() ) {
wxString strKey = GetPath().AfterLast(wxCONFIG_PATH_SEPARATOR);
- SetPath(_T("..")); // changes m_keyLocal
+ SetPath(wxT("..")); // changes m_keyLocal
return LocalKey().DeleteKey(strKey);
}
}
bool wxRegion::DoOffset(wxCoord x, wxCoord y)
{
- wxCHECK_MSG( M_REGION, false, _T("invalid wxRegion") );
+ wxCHECK_MSG( M_REGION, false, wxT("invalid wxRegion") );
if ( !x && !y )
{
if ( ::OffsetRgn(GetHrgn(), x, y) == ERROR )
{
- wxLogLastError(_T("OffsetRgn"));
+ wxLogLastError(wxT("OffsetRgn"));
return false;
}
break;
default:
- wxFAIL_MSG( _T("unknown region operation") );
+ wxFAIL_MSG( wxT("unknown region operation") );
// fall through
case wxRGN_AND:
break;
default:
- wxFAIL_MSG( _T("unknown region operation") );
+ wxFAIL_MSG( wxT("unknown region operation") );
// fall through
case wxRGN_COPY:
if ( ::CombineRgn(M_REGION, M_REGION, M_REGION_OF(rgn), mode) == ERROR )
{
- wxLogLastError(_T("CombineRgn"));
+ wxLogLastError(wxT("CombineRgn"));
return false;
}
wxCoord wxRegionIterator::GetX() const
{
- wxCHECK_MSG( m_current < m_numRects, 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( m_current < m_numRects, 0, wxT("invalid wxRegionIterator") );
return m_rects[m_current].x;
}
wxCoord wxRegionIterator::GetY() const
{
- wxCHECK_MSG( m_current < m_numRects, 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( m_current < m_numRects, 0, wxT("invalid wxRegionIterator") );
return m_rects[m_current].y;
}
wxCoord wxRegionIterator::GetW() const
{
- wxCHECK_MSG( m_current < m_numRects, 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( m_current < m_numRects, 0, wxT("invalid wxRegionIterator") );
return m_rects[m_current].width;
}
wxCoord wxRegionIterator::GetH() const
{
- wxCHECK_MSG( m_current < m_numRects, 0, _T("invalid wxRegionIterator") );
+ wxCHECK_MSG( m_current < m_numRects, 0, wxT("invalid wxRegionIterator") );
return m_rects[m_current].height;
}
wxString str = bShortPrefix ? aStdKeys[key].szShortName
: aStdKeys[key].szName;
if ( !m_strKey.empty() )
- str << _T("\\") << m_strKey;
+ str << wxT("\\") << m_strKey;
return str;
}
#endif
// it might be unexpected to some that this function doesn't open the key
- wxASSERT_MSG( IsOpened(), _T("key should be opened in GetKeyInfo") );
+ wxASSERT_MSG( IsOpened(), wxT("key should be opened in GetKeyInfo") );
m_dwLastError = ::RegQueryInfoKey
(
bool wxRegKey::Rename(const wxString& szNewName)
{
- wxCHECK_MSG( !m_strKey.empty(), false, _T("registry hives can't be renamed") );
+ wxCHECK_MSG( !m_strKey.empty(), false, wxT("registry hives can't be renamed") );
if ( !Exists() ) {
wxLogError(_("Registry key '%s' does not exist, cannot rename it."),
if ( !ok )
{
- wxLogLastError(_T("ExpandEnvironmentStrings"));
+ wxLogLastError(wxT("ExpandEnvironmentStrings"));
}
}
#endif
return false;
}
- wxFFileOutputStream ostr(filename, _T("w"));
+ wxFFileOutputStream ostr(filename, wxT("w"));
return ostr.Ok() && Export(ostr);
#else
size_t size,
wxRegKey::ValueType type = wxRegKey::Type_Binary)
{
- wxString value(_T("hex"));
+ wxString value(wxT("hex"));
// binary values use just "hex:" prefix while the other ones must indicate
// the real type
if ( type != wxRegKey::Type_Binary )
- value << _T('(') << type << _T(')');
- value << _T(':');
+ value << wxT('(') << type << wxT(')');
+ value << wxT(':');
// write all the rest as comma-separated bytes
value.reserve(3*size + 10);
// the generated files easier to read and compare with the files
// produced by regedit
if ( n )
- value << _T(',');
+ value << wxT(',');
- value << wxString::Format(_T("%02x"), (unsigned char)p[n]);
+ value << wxString::Format(wxT("%02x"), (unsigned char)p[n]);
}
return value;
// quotes and backslashes must be quoted, linefeeds are not
// allowed in string values
rhs.reserve(value.length() + 2);
- rhs = _T('"');
+ rhs = wxT('"');
// there can be no NULs here
bool useHex = false;
{
switch ( (*p).GetValue() )
{
- case _T('\n'):
+ case wxT('\n'):
// we can only represent this string in hex
useHex = true;
break;
- case _T('"'):
- case _T('\\'):
+ case wxT('"'):
+ case wxT('\\'):
// escape special symbol
- rhs += _T('\\');
+ rhs += wxT('\\');
// fall through
default:
if ( useHex )
rhs = FormatAsHex(value, Type_String);
else
- rhs += _T('"');
+ rhs += wxT('"');
}
break;
if ( !QueryValue(name, &value) )
break;
- rhs.Printf(_T("dword:%08x"), (unsigned int)value);
+ rhs.Printf(wxT("dword:%08x"), (unsigned int)value);
}
break;
if ( !::GetScrollInfo(GetHwnd(), SB_CTL, &scrollInfo) )
{
- wxLogLastError(_T("GetScrollInfo"));
+ wxLogLastError(wxT("GetScrollInfo"));
}
trackPos = scrollInfo.nTrackPos;
if ( !::GetScrollInfo(GetHwnd(), SB_CTL, &scrollInfo) )
{
- wxLogLastError(_T("GetScrollInfo"));
+ wxLogLastError(wxT("GetScrollInfo"));
}
return scrollInfo.nPos;
// return ::GetScrollPos((HWND)m_hWnd, SB_CTL);
unsigned int n = index - wxSYS_COLOUR_BTNHIGHLIGHT;
wxASSERT_MSG( n < WXSIZEOF(s_defaultSysColors),
- _T("forgot tp update the default colours array") );
+ wxT("forgot tp update the default colours array") );
colSys = s_defaultSysColors[n];
hasCol = true;
}
else
{
- wxFAIL_MSG( _T("failed to get LOGFONT") );
+ wxFAIL_MSG( wxT("failed to get LOGFONT") );
}
}
else // GetStockObject() failed
{
- wxFAIL_MSG( _T("stock font not found") );
+ wxFAIL_MSG( wxT("stock font not found") );
}
return font;
return 0;
#else // !__WXMICROWIN__
wxCHECK_MSG( index > 0 && (size_t)index < WXSIZEOF(gs_metricsMap), 0,
- _T("invalid metric") );
+ wxT("invalid metric") );
if ( index == wxSYS_DCLICK_MSEC )
{
return ::GetSystemMetrics(SM_TABLETPC) != 0;
default:
- wxFAIL_MSG( _T("unknown system feature") );
+ wxFAIL_MSG( wxT("unknown system feature") );
return false;
}
}
else
{
- wxLogLastError(_T("SystemParametersInfo(SPI_GETICONTITLELOGFONT"));
+ wxLogLastError(wxT("SystemParametersInfo(SPI_GETICONTITLELOGFONT"));
}
}
#endif // __WXWINCE__
};
wxASSERT_MSG( !(style & wxSL_VERTICAL) || !(style & wxSL_HORIZONTAL),
- _T("incompatible slider direction and orientation") );
+ wxT("incompatible slider direction and orientation") );
// initialize everything
m_hMutex = ::CreateMutex(NULL, FALSE, name.t_str());
if ( !m_hMutex )
{
- wxLogLastError(_T("CreateMutex"));
+ wxLogLastError(wxT("CreateMutex"));
return false;
}
bool WasOpened() const
{
wxCHECK_MSG( m_hMutex, false,
- _T("can't be called if mutex creation failed") );
+ wxT("can't be called if mutex creation failed") );
return m_wasOpened;
}
{
if ( !::CloseHandle(m_hMutex) )
{
- wxLogLastError(_T("CloseHandle(mutex)"));
+ wxLogLastError(wxT("CloseHandle(mutex)"));
}
}
}
const wxString& WXUNUSED(path))
{
wxASSERT_MSG( !m_impl,
- _T("calling wxSingleInstanceChecker::Create() twice?") );
+ wxT("calling wxSingleInstanceChecker::Create() twice?") );
// creating unnamed mutex doesn't have the same semantics!
- wxASSERT_MSG( !name.empty(), _T("mutex name can't be empty") );
+ wxASSERT_MSG( !name.empty(), wxT("mutex name can't be empty") );
m_impl = new wxSingleInstanceCheckerImpl;
bool wxSingleInstanceChecker::IsAnotherRunning() const
{
- wxCHECK_MSG( m_impl, false, _T("must call Create() first") );
+ wxCHECK_MSG( m_impl, false, wxT("must call Create() first") );
// if the mutex had been opened, another instance is running - otherwise we
// would have created it
// dependencies on it for all the application using wx even if they don't use
// sockets
#ifdef __WXWINCE__
- #define WINSOCK_DLL_NAME _T("ws2.dll")
+ #define WINSOCK_DLL_NAME wxT("ws2.dll")
#else
- #define WINSOCK_DLL_NAME _T("wsock32.dll")
+ #define WINSOCK_DLL_NAME wxT("wsock32.dll")
#endif
gs_wsock32dll.Load(WINSOCK_DLL_NAME, wxDL_VERBATIM | wxDL_QUIET);
// sanity check
wxASSERT_MSG( spin->m_hwndBuddy == hwndBuddy,
- _T("wxSpinCtrl has incorrect buddy HWND!") );
+ wxT("wxSpinCtrl has incorrect buddy HWND!") );
return spin;
}
sizeText.x -= sizeBtn.x + MARGIN_BETWEEN;
if ( sizeText.x <= 0 )
{
- wxLogDebug(_T("not enough space for wxSpinCtrl!"));
+ wxLogDebug(wxT("not enough space for wxSpinCtrl!"));
}
wxPoint posBtn(pos);
m_hwndBuddy = (WXHWND)::CreateWindowEx
(
exStyle, // sunken border
- _T("EDIT"), // window class
+ wxT("EDIT"), // window class
NULL, // no window title
msStyle, // style (will be shown later)
pos.x, pos.y, // position
// to leave it like this, while we really want to always show the
// current value in the control, so do it manually
::SetWindowText(GetBuddyHwnd(),
- wxString::Format(_T("%d"), val).wx_str());
+ wxString::Format(wxT("%d"), val).wx_str());
}
m_oldValue = GetValue();
int widthText = width - widthBtn - MARGIN_BETWEEN;
if ( widthText <= 0 )
{
- wxLogDebug(_T("not enough space for wxSpinCtrl!"));
+ wxLogDebug(wxT("not enough space for wxSpinCtrl!"));
}
// 1) The buddy window
pSymbol
) )
{
- wxDbgHelpDLL::LogError(_T("SymFromAddr"));
+ wxDbgHelpDLL::LogError(wxT("SymFromAddr"));
return;
}
{
// it is normal that we don't have source info for some symbols,
// notably all the ones from the system DLLs...
- //wxDbgHelpDLL::LogError(_T("SymGetLineFromAddr"));
+ //wxDbgHelpDLL::LogError(wxT("SymGetLineFromAddr"));
return;
}
// address, this is not a real error
if ( ::GetLastError() != ERROR_INVALID_ADDRESS )
{
- wxDbgHelpDLL::LogError(_T("SymSetContext"));
+ wxDbgHelpDLL::LogError(wxT("SymSetContext"));
}
return;
this // data to pass to it
) )
{
- wxDbgHelpDLL::LogError(_T("SymEnumSymbols"));
+ wxDbgHelpDLL::LogError(wxT("SymEnumSymbols"));
}
}
// don't log a user-visible error message here because the stack trace
// is only needed for debugging/diagnostics anyhow and we shouldn't
// confuse the user by complaining that we couldn't generate it
- wxLogDebug(_T("Failed to get stack backtrace: %s"),
+ wxLogDebug(wxT("Failed to get stack backtrace: %s"),
wxDbgHelpDLL::GetErrorMessage().c_str());
return;
}
TRUE // load symbols for all loaded modules
) )
{
- wxDbgHelpDLL::LogError(_T("SymInitialize"));
+ wxDbgHelpDLL::LogError(wxT("SymInitialize"));
return;
}
) )
{
if ( ::GetLastError() )
- wxDbgHelpDLL::LogError(_T("StackWalk"));
+ wxDbgHelpDLL::LogError(wxT("StackWalk"));
break;
}
#if 0
if ( !wxDbgHelpDLL::SymCleanup(hProcess) )
{
- wxDbgHelpDLL::LogError(_T("SymCleanup"));
+ wxDbgHelpDLL::LogError(wxT("SymCleanup"));
}
#endif
}
extern EXCEPTION_POINTERS *wxGlobalSEInformation;
wxCHECK_RET( wxGlobalSEInformation,
- _T("wxStackWalker::WalkFromException() can only be called from wxApp::OnFatalException()") );
+ wxT("wxStackWalker::WalkFromException() can only be called from wxApp::OnFatalException()") );
// don't skip any frames, the first one is where we crashed
WalkFrom(wxGlobalSEInformation, 0, maxDepth);
if( !isIcon )
{
wxASSERT_MSG( wxDynamicCast(&bitmap, wxBitmap),
- _T("not an icon and not a bitmap?") );
+ wxT("not an icon and not a bitmap?") );
const wxBitmap& bmp = (const wxBitmap&)bitmap;
wxMask *mask = bmp.GetMask();
m_isIcon = image->IsKindOf( CLASSINFO(wxIcon) );
// create the native control
- if ( !MSWCreateControl(_T("STATIC"), wxEmptyString, pos, size) )
+ if ( !MSWCreateControl(wxT("STATIC"), wxEmptyString, pos, size) )
{
// control creation failed
return false;
wxIcon wxStaticBitmap::GetIcon() const
{
- wxCHECK_MSG( m_image, wxIcon(), _T("no image in wxStaticBitmap") );
+ wxCHECK_MSG( m_image, wxIcon(), wxT("no image in wxStaticBitmap") );
// we can't ask for an icon if all we have is a bitmap
- wxCHECK_MSG( m_isIcon, wxIcon(), _T("no icon in this wxStaticBitmap") );
+ wxCHECK_MSG( m_isIcon, wxIcon(), wxT("no icon in this wxStaticBitmap") );
return *(wxIcon *)m_image;
}
}
else // we have a bitmap
{
- wxCHECK_MSG( m_image, wxBitmap(), _T("no image in wxStaticBitmap") );
+ wxCHECK_MSG( m_image, wxBitmap(), wxT("no image in wxStaticBitmap") );
return *(wxBitmap *)m_image;
}
AutoHRGN hrgnRect(::CreateRectRgn(left, top, right, bottom));
if ( !hrgnRect )
{
- wxLogLastError(_T("CreateRectRgn()"));
+ wxLogLastError(wxT("CreateRectRgn()"));
return;
}
if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
return false;
- return MSWCreateControl(_T("STATIC"), wxEmptyString, pos, size);
+ return MSWCreateControl(wxT("STATIC"), wxEmptyString, pos, size);
}
WXDWORD wxStaticLine::MSWGetStyle(long style, WXDWORD *exstyle) const
m_hWnd = CreateWindow
(
STATUSCLASSNAME,
- _T(""),
+ wxT(""),
wstyle,
0, 0, 0, 0,
GetHwndOf(parent),
// ----------------------------------------------------------------------------
// used in our wxLogTrace messages
-#define TRACE_MASK _T("stdpaths")
+#define TRACE_MASK wxT("stdpaths")
#ifndef CSIDL_APPDATA
#define CSIDL_APPDATA 0x001a
// start with the newest functions, fall back to the oldest ones
#ifdef __WXWINCE__
- wxString shellDllName(_T("coredll"));
+ wxString shellDllName(wxT("coredll"));
#else
// first check for SHGetFolderPath (shell32.dll 5.0)
- wxString shellDllName(_T("shell32"));
+ wxString shellDllName(wxT("shell32"));
#endif
wxDynamicLibrary dllShellFunctions( shellDllName );
if ( !dllShellFunctions.IsLoaded() )
{
- wxLogTrace(TRACE_MASK, _T("Failed to load %s.dll"), shellDllName.c_str() );
+ wxLogTrace(TRACE_MASK, wxT("Failed to load %s.dll"), shellDllName.c_str() );
}
// don't give errors if the functions are unavailable, we're ready to deal
static const char UNICODE_SUFFIX = 'A';
#endif // Unicode/!Unicode
- wxString funcname(_T("SHGetFolderPath"));
+ wxString funcname(wxT("SHGetFolderPath"));
gs_shellFuncs.pSHGetFolderPath =
(SHGetFolderPath_t)dllShellFunctions.GetSymbol(funcname + UNICODE_SUFFIX);
// then for SHGetSpecialFolderPath (shell32.dll 4.71)
if ( !gs_shellFuncs.pSHGetFolderPath )
{
- funcname = _T("SHGetSpecialFolderPath");
+ funcname = wxT("SHGetSpecialFolderPath");
gs_shellFuncs.pSHGetSpecialFolderPath = (SHGetSpecialFolderPath_t)
dllShellFunctions.GetSymbol(funcname + UNICODE_SUFFIX);
}
#ifndef __WXWINCE__
if ( !::GetWindowsDirectory(wxStringBuffer(dir, MAX_PATH), MAX_PATH) )
{
- wxLogLastError(_T("GetWindowsDirectory"));
+ wxLogLastError(wxT("GetWindowsDirectory"));
}
#else
// TODO: use CSIDL_WINDOWS (eVC4, possibly not eVC3)
int flags)
{
wxCHECK_MSG( m_iconAdded, false,
- _T("can't be used before the icon is created") );
+ wxT("can't be used before the icon is created") );
const HWND hwnd = GetHwndOf(m_win);
#if wxUSE_MENUS
bool wxTaskBarIcon::PopupMenu(wxMenu *menu)
{
- wxASSERT_MSG( m_win != NULL, _T("taskbar icon not initialized") );
+ wxASSERT_MSG( m_win != NULL, wxT("taskbar icon not initialized") );
static bool s_inPopup = false;
: m_count(count)
{
wxASSERT_MSG( m_count == -1 || m_count == -2,
- _T("wrong initial m_updatesCount value") );
+ wxT("wrong initial m_updatesCount value") );
if (m_count != -2)
m_count = 0;
if ( wxRichEditModule::Load(wxRichEditModule::Version_41) )
{
// yes, class name for version 4.1 really is 5.0
- windowClass = _T("RICHEDIT50W");
+ windowClass = wxT("RICHEDIT50W");
}
else if ( wxRichEditModule::Load(wxRichEditModule::Version_2or3) )
{
- windowClass = _T("RichEdit20")
+ windowClass = wxT("RichEdit20")
#if wxUSE_UNICODE
- _T("W");
+ wxT("W");
#else // ANSI
- _T("A");
+ wxT("A");
#endif // Unicode/ANSI
}
else // failed to load msftedit.dll and riched20.dll
{
if ( wxRichEditModule::Load(wxRichEditModule::Version_1) )
{
- windowClass = _T("RICHEDIT");
+ windowClass = wxT("RICHEDIT");
}
else // failed to load any richedit control DLL
{
#if wxUSE_RICHEDIT
wxString classname = wxGetWindowClass(GetHWND());
- if ( classname.IsSameAs(_T("EDIT"), false /* no case */) )
+ if ( classname.IsSameAs(wxT("EDIT"), false /* no case */) )
{
m_verRichEdit = 0;
}
else // rich edit?
{
wxChar c;
- if ( wxSscanf(classname, _T("RichEdit%d0%c"), &m_verRichEdit, &c) != 2 )
+ if ( wxSscanf(classname, wxT("RichEdit%d0%c"), &m_verRichEdit, &c) != 2 )
{
- wxLogDebug(_T("Unknown edit control '%s'."), classname.c_str());
+ wxLogDebug(wxT("Unknown edit control '%s'."), classname.c_str());
m_verRichEdit = 0;
}
// style - convert it to something reasonable
for ( ; *p; p++ )
{
- if ( *p == _T('\r') )
- *p = _T('\n');
+ if ( *p == wxT('\r') )
+ *p = wxT('\n');
}
}
}
// It's okay for EN_UPDATE to not be sent if the selection is empty and
// the text is empty, otherwise warn the programmer about it.
wxASSERT_MSG( ucf.GotUpdate() || ( !HasSelection() && value.empty() ),
- _T("EM_STREAMIN didn't send EN_UPDATE?") );
+ wxT("EM_STREAMIN didn't send EN_UPDATE?") );
if ( eds.dwError )
{
- wxLogLastError(_T("EM_STREAMIN"));
+ wxLogLastError(wxT("EM_STREAMIN"));
}
#if !wxUSE_WCHAR_T
if ( eds.dwError )
{
- wxLogLastError(_T("EM_STREAMOUT"));
+ wxLogLastError(wxT("EM_STREAMOUT"));
}
else // streamed out ok
{
{
// remove the '\r' returned by the rich edit control, the user code
// should never see it
- if ( buf[len - 2] == _T('\r') && buf[len - 1] == _T('\n') )
+ if ( buf[len - 2] == wxT('\r') && buf[len - 1] == wxT('\n') )
{
// richedit 1.0 uses "\r\n" as line terminator, so remove "\r"
// here and "\n" below
- buf[len - 2] = _T('\n');
+ buf[len - 2] = wxT('\n');
len--;
}
- else if ( buf[len - 1] == _T('\r') )
+ else if ( buf[len - 1] == wxT('\r') )
{
// richedit 2.0+ uses only "\r", replace it with "\n"
- buf[len - 1] = _T('\n');
+ buf[len - 1] = wxT('\n');
}
}
#endif // wxUSE_RICHEDIT
// remove the '\n' at the end, if any (this is how this function is
// supposed to work according to the docs)
- if ( buf[len - 1] == _T('\n') )
+ if ( buf[len - 1] == wxT('\n') )
{
len--;
}
switch ( ctrl + shift )
{
default:
- wxFAIL_MSG( _T("how many modifiers have we got?") );
+ wxFAIL_MSG( wxT("how many modifiers have we got?") );
// fall through
case 0:
return false;
default:
- wxFAIL_MSG( _T("unexpected wxTextCtrl::m_updatesCount value") );
+ wxFAIL_MSG( wxT("unexpected wxTextCtrl::m_updatesCount value") );
// fall through
case -1:
SCF_SELECTION, (LPARAM)&cf) != 0;
if ( !ok )
{
- wxLogDebug(_T("SendMessage(EM_SETCHARFORMAT, SCF_SELECTION) failed"));
+ wxLogDebug(wxT("SendMessage(EM_SETCHARFORMAT, SCF_SELECTION) failed"));
}
// now do the paragraph formatting
0, (LPARAM) &pf) != 0;
if ( !ok )
{
- wxLogDebug(_T("SendMessage(EM_SETPARAFORMAT, 0) failed"));
+ wxLogDebug(wxT("SendMessage(EM_SETPARAFORMAT, 0) failed"));
}
}
static const wxChar *dllnames[] =
{
- _T("riched32"),
- _T("riched20"),
- _T("msftedit"),
+ wxT("riched32"),
+ wxT("riched20"),
+ wxT("msftedit"),
};
wxCOMPILE_TIME_ASSERT( WXSIZEOF(dllnames) == Version_Max,
static wxDynamicLibrary s_dllShlwapi;
if ( s_pfnSHAutoComplete == (SHAutoComplete_t)-1 )
{
- if ( !s_dllShlwapi.Load(_T("shlwapi.dll"), wxDL_VERBATIM | wxDL_QUIET) )
+ if ( !s_dllShlwapi.Load(wxT("shlwapi.dll"), wxDL_VERBATIM | wxDL_QUIET) )
{
s_pfnSHAutoComplete = NULL;
}
HRESULT hr = (*s_pfnSHAutoComplete)(GetEditHwnd(), SHACF_FILESYS_ONLY);
if ( FAILED(hr) )
{
- wxLogApiError(_T("SHAutoComplete()"), hr);
+ wxLogApiError(wxT("SHAutoComplete()"), hr);
return false;
}
);
if ( FAILED(hr) )
{
- wxLogApiError(_T("CoCreateInstance(CLSID_AutoComplete)"), hr);
+ wxLogApiError(wxT("CoCreateInstance(CLSID_AutoComplete)"), hr);
return false;
}
m_enumStrings->Release();
if ( FAILED(hr) )
{
- wxLogApiError(_T("IAutoComplete::Init"), hr);
+ wxLogApiError(wxT("IAutoComplete::Init"), hr);
return false;
}
WXDWORD msStyle = MSWGetStyle(style, &exstyle);
msStyle |= wxMSWButton::GetMultilineStyle(label);
- return MSWCreateControl(_T("BUTTON"), msStyle, pos, size, label, exstyle);
+ return MSWCreateControl(wxT("BUTTON"), msStyle, pos, size, label, exstyle);
}
WXDWORD wxToggleButton::MSWGetStyle(long style, WXDWORD *exstyle) const
if ( !m_mutex )
{
- wxLogLastError(_T("CreateMutex()"));
+ wxLogLastError(wxT("CreateMutex()"));
}
}
{
if ( !::CloseHandle(m_mutex) )
{
- wxLogLastError(_T("CloseHandle(mutex)"));
+ wxLogLastError(wxT("CloseHandle(mutex)"));
}
}
}
case WAIT_ABANDONED:
// the previous caller died without releasing the mutex, so even
// though we did get it, log a message about this
- wxLogDebug(_T("WaitForSingleObject() returned WAIT_ABANDONED"));
+ wxLogDebug(wxT("WaitForSingleObject() returned WAIT_ABANDONED"));
// fall through
case WAIT_OBJECT_0:
// fall through
case WAIT_FAILED:
- wxLogLastError(_T("WaitForSingleObject(mutex)"));
+ wxLogLastError(wxT("WaitForSingleObject(mutex)"));
return wxMUTEX_MISC_ERROR;
}
if ( !::ReleaseMutex(m_mutex) )
{
- wxLogLastError(_T("ReleaseMutex()"));
+ wxLogLastError(wxT("ReleaseMutex()"));
return wxMUTEX_MISC_ERROR;
}
#endif
if ( !m_semaphore )
{
- wxLogLastError(_T("CreateSemaphore()"));
+ wxLogLastError(wxT("CreateSemaphore()"));
}
}
{
if ( !::CloseHandle(m_semaphore) )
{
- wxLogLastError(_T("CloseHandle(semaphore)"));
+ wxLogLastError(wxT("CloseHandle(semaphore)"));
}
}
}
return wxSEMA_TIMEOUT;
default:
- wxLogLastError(_T("WaitForSingleObject(semaphore)"));
+ wxLogLastError(wxT("WaitForSingleObject(semaphore)"));
}
return wxSEMA_MISC_ERROR;
}
else
{
- wxLogLastError(_T("ReleaseSemaphore"));
+ wxLogLastError(wxT("ReleaseSemaphore"));
return wxSEMA_MISC_ERROR;
}
}
bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize)
{
wxASSERT_MSG( m_state == STATE_NEW && !m_hThread,
- _T("Create()ing thread twice?") );
+ wxT("Create()ing thread twice?") );
// for compilers which have it, we should use C RTL function for thread
// creation instead of Win32 API one because otherwise we will have memory
#ifdef __WXWINCE__
return false;
#else
- wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") );
+ wxASSERT_MSG( IsMain(), wxT("should only be called from the main thread") );
// ok only for the default one
if ( level == 0 )
DWORD_PTR dwProcMask, dwSysMask;
if ( ::GetProcessAffinityMask(hProcess, &dwProcMask, &dwSysMask) == 0 )
{
- wxLogLastError(_T("GetProcessAffinityMask"));
+ wxLogLastError(wxT("GetProcessAffinityMask"));
return false;
}
// could we set all bits?
if ( level != 0 )
{
- wxLogDebug(_T("bad level %u in wxThread::SetConcurrency()"), level);
+ wxLogDebug(wxT("bad level %u in wxThread::SetConcurrency()"), level);
return false;
}
if ( !pfnSetProcessAffinityMask )
{
- HMODULE hModKernel = ::LoadLibrary(_T("kernel32"));
+ HMODULE hModKernel = ::LoadLibrary(wxT("kernel32"));
if ( hModKernel )
{
pfnSetProcessAffinityMask = (SETPROCESSAFFINITYMASK)
// we've discovered a MT version of Win9x!
wxASSERT_MSG( pfnSetProcessAffinityMask,
- _T("this system has several CPUs but no SetProcessAffinityMask function?") );
+ wxT("this system has several CPUs but no SetProcessAffinityMask function?") );
}
if ( !pfnSetProcessAffinityMask )
if ( pfnSetProcessAffinityMask(hProcess, dwProcMask) == 0 )
{
- wxLogLastError(_T("SetProcessAffinityMask"));
+ wxLogLastError(wxT("SetProcessAffinityMask"));
return false;
}
// although under Windows we can wait for any thread, it's an error to
// wait for a detached one in wxWin API
wxCHECK_MSG( !IsDetached(), rc,
- _T("wxThread::Wait(): can't wait for detached thread") );
+ wxT("wxThread::Wait(): can't wait for detached thread") );
(void)m_internal->WaitForTerminate(m_critsect, &rc);
void wxMSWTimerImpl::Stop()
{
- wxASSERT_MSG( m_id, _T("should be running") );
+ wxASSERT_MSG( m_id, wxT("should be running") );
::KillTimer(wxTimerHiddenWindowModule::GetHWND(), m_id);
void wxProcessTimer(wxMSWTimerImpl& timer)
{
- wxASSERT_MSG( timer.IsRunning(), _T("bogus timer id") );
+ wxASSERT_MSG( timer.IsRunning(), wxT("bogus timer id") );
if ( timer.IsOneShot() )
timer.Stop();
{
if ( !::DestroyWindow(ms_hwnd) )
{
- wxLogLastError(_T("DestroyWindow(wxTimerHiddenWindow)"));
+ wxLogLastError(wxT("DestroyWindow(wxTimerHiddenWindow)"));
}
ms_hwnd = NULL;
{
if ( !::UnregisterClass(ms_className, wxGetInstance()) )
{
- wxLogLastError(_T("UnregisterClass(\"wxTimerHiddenWindow\")"));
+ wxLogLastError(wxT("UnregisterClass(\"wxTimerHiddenWindow\")"));
}
ms_className = NULL;
/* static */
HWND wxTimerHiddenWindowModule::GetHWND()
{
- static const wxChar *HIDDEN_WINDOW_CLASS = _T("wxTimerHiddenWindow");
+ static const wxChar *HIDDEN_WINDOW_CLASS = wxT("wxTimerHiddenWindow");
if ( !ms_hwnd )
{
ms_hwnd = wxCreateHiddenWindow(&ms_className, HIDDEN_WINDOW_CLASS,
wxStaticText* GetStaticText()
{
wxASSERT_MSG( IsControl(),
- _T("only makes sense for embedded control tools") );
+ wxT("only makes sense for embedded control tools") );
return m_staticText;
}
if ( !MSWCreateToolbar(pos, size) )
{
// what can we do?
- wxFAIL_MSG( _T("recreating the toolbar failed") );
+ wxFAIL_MSG( wxT("recreating the toolbar failed") );
return;
}
}
else
{
- wxFAIL_MSG( _T("invalid tool button bitmap") );
+ wxFAIL_MSG( wxT("invalid tool button bitmap") );
}
// also deal with disabled bitmap if we want to use them
break;
default:
- wxFAIL_MSG( _T("unexpected toolbar button kind") );
+ wxFAIL_MSG( wxT("unexpected toolbar button kind") );
button.fsStyle = TBSTYLE_BUTTON;
break;
}
}
const wxToolBarToolBase * const tool = FindById(tbhdr->iItem);
- wxCHECK_MSG( tool, false, _T("drop down message for unknown tool") );
+ wxCHECK_MSG( tool, false, wxT("drop down message for unknown tool") );
wxMenu * const menu = tool->GetDropdownMenu();
if ( !menu )
{
// VZ: AFAIK, the button has to be created either with TBSTYLE_CHECK or
// without, so we really need to delete the button and recreate it here
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
}
void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap )
// didn't draw anything but no error really occurred
if ( FAILED(hr) )
{
- wxLogApiError(_T("DrawThemeParentBackground(toolbar)"), hr);
+ wxLogApiError(wxT("DrawThemeParentBackground(toolbar)"), hr);
}
}
}
// didn't draw anything but no error really occurred
if ( FAILED(hr) )
{
- wxLogApiError(_T("DrawThemeParentBackground(toolbar)"), hr);
+ wxLogApiError(wxT("DrawThemeParentBackground(toolbar)"), hr);
}
}
}
if ( !::SendMessage(GetHwnd(), TB_GETBUTTON,
n, (LPARAM)&tbb) )
{
- wxLogDebug(_T("TB_GETBUTTON failed?"));
+ wxLogDebug(wxT("TB_GETBUTTON failed?"));
continue;
}
if ( !hdcMem )
{
- wxLogLastError(_T("CreateCompatibleDC"));
+ wxLogLastError(wxT("CreateCompatibleDC"));
return bitmap;
}
if ( !bmpInHDC )
{
- wxLogLastError(_T("SelectObject"));
+ wxLogLastError(wxT("SelectObject"));
return bitmap;
}
void wxToolTip::SetMaxWidth(int width)
{
- wxASSERT_MSG( width == -1 || width >= 0, _T("invalid width value") );
+ wxASSERT_MSG( width == -1 || width >= 0, wxT("invalid width value") );
ms_maxWidth = width;
}
if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, &ti) )
{
- wxLogDebug(_T("Failed to create the tooltip '%s'"), m_text.c_str());
+ wxLogDebug(wxT("Failed to create the tooltip '%s'"), m_text.c_str());
return;
}
// find the width of the widest line
int maxWidth = 0;
- wxStringTokenizer tokenizer(m_text, _T("\n"));
+ wxStringTokenizer tokenizer(m_text, wxT("\n"));
while ( tokenizer.HasMoreTokens() )
{
const wxString token = tokenizer.GetNextToken();
{
// replace the '\n's with spaces because otherwise they appear as
// unprintable characters in the tooltip string
- m_text.Replace(_T("\n"), _T(" "));
+ m_text.Replace(wxT("\n"), wxT(" "));
ti.lpszText = const_cast<wxChar *>(m_text.wx_str());
if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, &ti) )
{
- wxLogDebug(_T("Failed to create the tooltip '%s'"), m_text.c_str());
+ wxLogDebug(wxT("Failed to create the tooltip '%s'"), m_text.c_str());
}
}
}
}
// must have it by now!
- wxASSERT_MSG( hwnd, _T("no hwnd for subcontrol?") );
+ wxASSERT_MSG( hwnd, wxT("no hwnd for subcontrol?") );
Add((WXHWND)hwnd);
}
// for some reason, changing the tooltip text directly results in
// repaint of the controls under it, see #10520 -- but this doesn't
// happen if we reset it first
- ti.lpszText = const_cast<wxChar *>(_T(""));
+ ti.lpszText = const_cast<wxChar *>(wxT(""));
(void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti);
ti.lpszText = const_cast<wxChar *>(m_text.wx_str());
if ( !parent )
{
// this flag doesn't make sense then and will be ignored
- wxFAIL_MSG( _T("wxFRAME_FLOAT_ON_PARENT but no parent?") );
+ wxFAIL_MSG( wxT("wxFRAME_FLOAT_ON_PARENT but no parent?") );
}
else
{
return;
}
- wxLogLastError(_T("GetWindowPlacement"));
+ wxLogLastError(wxT("GetWindowPlacement"));
}
//else: normal case
return;
}
- wxLogLastError(_T("GetWindowPlacement"));
+ wxLogLastError(wxT("GetWindowPlacement"));
}
//else: normal case
MF_BYCOMMAND |
(enable ? MF_ENABLED : MF_GRAYED)) == -1 )
{
- wxLogLastError(_T("EnableMenuItem(SC_CLOSE)"));
+ wxLogLastError(wxT("EnableMenuItem(SC_CLOSE)"));
return false;
}
// update appearance immediately
if ( !::DrawMenuBar(GetHwnd()) )
{
- wxLogLastError(_T("DrawMenuBar"));
+ wxLogLastError(wxT("DrawMenuBar"));
}
#endif
#endif // !__WXMICROWIN__
bool wxTopLevelWindowMSW::SetShape(const wxRegion& region)
{
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
- _T("Shaped windows must be created with the wxFRAME_SHAPED style."));
+ wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
// The empty region signifies that the shape should be removed from the
// window.
{
if (::SetWindowRgn(GetHwnd(), NULL, TRUE) == 0)
{
- wxLogLastError(_T("SetWindowRgn"));
+ wxLogLastError(wxT("SetWindowRgn"));
return false;
}
return true;
// Now call the shape API with the new region.
if (::SetWindowRgn(GetHwnd(), hrgn, TRUE) == 0)
{
- wxLogLastError(_T("SetWindowRgn"));
+ wxLogLastError(wxT("SetWindowRgn"));
return false;
}
return true;
static FlashWindowEx_t s_pfnFlashWindowEx = NULL;
if ( !s_pfnFlashWindowEx )
{
- wxDynamicLibrary dllUser32(_T("user32.dll"));
+ wxDynamicLibrary dllUser32(wxT("user32.dll"));
s_pfnFlashWindowEx = (FlashWindowEx_t)
- dllUser32.GetSymbol(_T("FlashWindowEx"));
+ dllUser32.GetSymbol(wxT("FlashWindowEx"));
// we can safely unload user32.dll here, it's going to remain loaded as
// long as the program is running anyhow
if ( pSetLayeredWindowAttributes == (PSETLAYEREDWINDOWATTR)-1 )
{
- wxDynamicLibrary dllUser32(_T("user32.dll"));
+ wxDynamicLibrary dllUser32(wxT("user32.dll"));
// use RawGetSymbol() and not GetSymbol() to avoid error messages under
// Windows 95: there is nothing the user can do about this anyhow
{
// restore focus to the child which was last focused unless we already
// have it
- wxLogTrace(_T("focus"), _T("wxTLW %p activated."), m_hWnd);
+ wxLogTrace(wxT("focus"), wxT("wxTLW %p activated."), m_hWnd);
wxWindow *winFocus = FindFocus();
if ( !winFocus || wxGetTopLevelParent(winFocus) != this )
}
}
- wxLogTrace(_T("focus"),
- _T("wxTLW %p deactivated, last focused: %p."),
+ wxLogTrace(wxT("focus"),
+ wxT("wxTLW %p deactivated, last focused: %p."),
m_hWnd,
m_winLastFocused ? GetHwndOf(m_winLastFocused) : NULL);
{
if ( !::DestroyWindow(ms_hwnd) )
{
- wxLogLastError(_T("DestroyWindow(hidden TLW parent)"));
+ wxLogLastError(wxT("DestroyWindow(hidden TLW parent)"));
}
ms_hwnd = NULL;
{
if ( !::UnregisterClass(ms_className, wxGetInstance()) )
{
- wxLogLastError(_T("UnregisterClass(\"wxTLWHiddenParent\")"));
+ wxLogLastError(wxT("UnregisterClass(\"wxTLWHiddenParent\")"));
}
ms_className = NULL;
{
if ( !ms_className )
{
- static const wxChar *HIDDEN_PARENT_CLASS = _T("wxTLWHiddenParent");
+ static const wxChar *HIDDEN_PARENT_CLASS = wxT("wxTLWHiddenParent");
WNDCLASS wndclass;
wxZeroMemory(wndclass);
if ( !::RegisterClass(&wndclass) )
{
- wxLogLastError(_T("RegisterClass(\"wxTLWHiddenParent\")"));
+ wxLogLastError(wxT("RegisterClass(\"wxTLWHiddenParent\")"));
}
else
{
(HMENU)NULL, wxGetInstance(), NULL);
if ( !ms_hwnd )
{
- wxLogLastError(_T("CreateWindow(hidden TLW parent)"));
+ wxLogLastError(wxT("CreateWindow(hidden TLW parent)"));
}
}
break;
default:
- wxFAIL_MSG( _T("unsupported wxTreeItemIcon value") );
+ wxFAIL_MSG( wxT("unsupported wxTreeItemIcon value") );
}
}
bool wxTreeCtrl::DoGetItem(wxTreeViewItem *tvItem) const
{
wxCHECK_MSG( tvItem->hItem != TVI_ROOT, false,
- _T("can't retrieve virtual root item") );
+ wxT("can't retrieve virtual root item") );
if ( !TreeView_GetItem(GetHwnd(), tvItem) )
{
{
wxCHECK_MSG( parent.IsOk() || !TreeView_GetRoot(GetHwnd()),
wxTreeItemId(),
- _T("can't have more than one root in the tree") );
+ wxT("can't have more than one root in the tree") );
TV_INSERTSTRUCT tvIns;
tvIns.hParent = HITEM(parent);
{
if ( HasFlag(wxTR_HIDE_ROOT) )
{
- wxASSERT_MSG( !m_pVirtualRoot, _T("tree can have only a single root") );
+ wxASSERT_MSG( !m_pVirtualRoot, wxT("tree can have only a single root") );
// create a virtual root item, the parent for all the others
wxTreeItemParam *param = new wxTreeItemParam;
// assert, not check: if the index is invalid, we will append the item
// to the end
- wxASSERT_MSG( index == 0, _T("bad index in wxTreeCtrl::InsertItem") );
+ wxASSERT_MSG( index == 0, wxT("bad index in wxTreeCtrl::InsertItem") );
}
return DoInsertAfter(parent, idPrev, text, image, selectedImage, data);
void wxTreeCtrl::SelectItem(const wxTreeItemId& item, bool select)
{
- wxCHECK_RET( !IsHiddenRoot(item), _T("can't select hidden root item") );
+ wxCHECK_RET( !IsHiddenRoot(item), wxT("can't select hidden root item") );
if ( select == IsSelected(item) )
{
void wxTreeCtrl::EnsureVisible(const wxTreeItemId& item)
{
- wxCHECK_RET( !IsHiddenRoot(item), _T("can't show hidden root item") );
+ wxCHECK_RET( !IsHiddenRoot(item), wxT("can't show hidden root item") );
// no error return
TreeView_EnsureVisible(GetHwnd(), HITEM(item));
if ( !loaded )
{
- wxLoadedDLL dllComCtl32(_T("comctl32.dll"));
+ wxLoadedDLL dllComCtl32(wxT("comctl32.dll"));
if ( dllComCtl32.IsLoaded() )
wxDL_INIT_FUNC(s_pfn, ImageList_Copy, dllComCtl32);
}
{
// normally this is impossible because the m_dragImage is
// deleted once the drag operation is over
- wxASSERT_MSG( !m_dragImage, _T("starting to drag once again?") );
+ wxASSERT_MSG( !m_dragImage, wxT("starting to drag once again?") );
m_dragImage = new wxDragImage(*this, event.m_item);
m_dragImage->BeginDrag(wxPoint(0,0), this);
// missing, we handle this)
wxLogNull noLog;
- wxDynamicLibrary dllWinsock(_T("ws2_32.dll"), wxDL_VERBATIM);
+ wxDynamicLibrary dllWinsock(wxT("ws2_32.dll"), wxDL_VERBATIM);
if ( dllWinsock.IsLoaded() )
{
typedef int (PASCAL *WSAStartup_t)(WORD, WSADATA *);
#define LOAD_WINSOCK_FUNC(func) \
func ## _t \
- pfn ## func = (func ## _t)dllWinsock.GetSymbol(_T(#func))
+ pfn ## func = (func ## _t)dllWinsock.GetSymbol(wxT(#func))
LOAD_WINSOCK_FUNC(WSAStartup);
bool wxGetUserName(wxChar *buf, int maxSize)
{
wxCHECK_MSG( buf && ( maxSize > 0 ), false,
- _T("empty buffer in wxGetUserName") );
+ wxT("empty buffer in wxGetUserName") );
#if defined(__WXWINCE__) && wxUSE_REGKEY
wxLogNull noLog;
wxRegKey key(wxRegKey::HKCU, wxT("ControlPanel\\Owner"));
GetDiskFreeSpaceEx_t
pGetDiskFreeSpaceEx = (GetDiskFreeSpaceEx_t)::GetProcAddress
(
- ::GetModuleHandle(_T("kernel32.dll")),
+ ::GetModuleHandle(wxT("kernel32.dll")),
#if wxUSE_UNICODE
"GetDiskFreeSpaceExW"
#else
&bytesTotal,
NULL) )
{
- wxLogLastError(_T("GetDiskFreeSpaceEx"));
+ wxLogLastError(wxT("GetDiskFreeSpaceEx"));
return false;
}
&lNumberOfFreeClusters,
&lTotalNumberOfClusters) )
{
- wxLogLastError(_T("GetDiskFreeSpace"));
+ wxLogLastError(wxT("GetDiskFreeSpace"));
return false;
}
#else // other compiler
if ( !::SetEnvironmentVariable(var.t_str(), value) )
{
- wxLogLastError(_T("SetEnvironmentVariable"));
+ wxLogLastError(wxT("SetEnvironmentVariable"));
return false;
}
// can also use SendMesageTimeout(WM_CLOSE)
if ( !::PostMessage(params.hwnd, WM_QUIT, 0, 0) )
{
- wxLogLastError(_T("PostMessage(WM_QUIT)"));
+ wxLogLastError(wxT("PostMessage(WM_QUIT)"));
}
}
else // it was an error then
{
- wxLogLastError(_T("EnumWindows"));
+ wxLogLastError(wxT("EnumWindows"));
ok = false;
}
// process terminated
if ( !::GetExitCodeProcess(hProcess, &rc) )
{
- wxLogLastError(_T("GetExitCodeProcess"));
+ wxLogLastError(wxT("GetExitCodeProcess"));
}
break;
default:
- wxFAIL_MSG( _T("unexpected WaitForSingleObject() return") );
+ wxFAIL_MSG( wxT("unexpected WaitForSingleObject() return") );
// fall through
case WAIT_FAILED:
- wxLogLastError(_T("WaitForSingleObject"));
+ wxLogLastError(wxT("WaitForSingleObject"));
// fall through
case WAIT_TIMEOUT:
#if wxUSE_DYNLIB_CLASS
- wxDynamicLibrary dllKernel(_T("kernel32.dll"), wxDL_VERBATIM);
+ wxDynamicLibrary dllKernel(wxT("kernel32.dll"), wxDL_VERBATIM);
// Get procedure addresses.
// We are linking to these functions of Kernel32
// which does not have the Toolhelp32
// functions in the Kernel 32.
lpfCreateToolhelp32Snapshot =
- (CreateToolhelp32Snapshot_t)dllKernel.RawGetSymbol(_T("CreateToolhelp32Snapshot"));
+ (CreateToolhelp32Snapshot_t)dllKernel.RawGetSymbol(wxT("CreateToolhelp32Snapshot"));
lpfProcess32First =
- (Process32_t)dllKernel.RawGetSymbol(_T("Process32First"));
+ (Process32_t)dllKernel.RawGetSymbol(wxT("Process32First"));
lpfProcess32Next =
- (Process32_t)dllKernel.RawGetSymbol(_T("Process32Next"));
+ (Process32_t)dllKernel.RawGetSymbol(wxT("Process32Next"));
#endif // wxUSE_DYNLIB_CLASS
}
break;
default:
- wxFAIL_MSG( _T("unknown wxShutdown() flag") );
+ wxFAIL_MSG( wxT("unknown wxShutdown() flag") );
return false;
}
{
#if wxUSE_DYNLIB_CLASS
// IsDebuggerPresent() is not available under Win95, so load it dynamically
- wxDynamicLibrary dll(_T("kernel32.dll"), wxDL_VERBATIM);
+ wxDynamicLibrary dll(wxT("kernel32.dll"), wxDL_VERBATIM);
typedef BOOL (WINAPI *IsDebuggerPresent_t)();
- if ( !dll.HasSymbol(_T("IsDebuggerPresent")) )
+ if ( !dll.HasSymbol(wxT("IsDebuggerPresent")) )
{
// no way to know, assume no
return false;
}
- return (*(IsDebuggerPresent_t)dll.GetSymbol(_T("IsDebuggerPresent")))() != 0;
+ return (*(IsDebuggerPresent_t)dll.GetSymbol(wxT("IsDebuggerPresent")))() != 0;
#else
return false;
#endif
}
if ( !wxIsEmpty(info.szCSDVersion) )
{
- str << _T(" (") << info.szCSDVersion << _T(')');
+ str << wxT(" (") << info.szCSDVersion << wxT(')');
}
break;
if ( !wxIsEmpty(info.szCSDVersion) )
{
- str << _T(", ") << info.szCSDVersion;
+ str << wxT(", ") << info.szCSDVersion;
}
- str << _T(')');
+ str << wxT(')');
if ( wxIsPlatform64Bit() )
str << _(", 64-bit edition");
}
else
{
- wxFAIL_MSG( _T("GetVersionEx() failed") ); // should never happen
+ wxFAIL_MSG( wxT("GetVersionEx() failed") ); // should never happen
}
return str;
// 32-bit programs run on both 32-bit and 64-bit Windows so check
typedef BOOL (WINAPI *IsWow64Process_t)(HANDLE, BOOL *);
- wxDynamicLibrary dllKernel32(_T("kernel32.dll"));
+ wxDynamicLibrary dllKernel32(wxT("kernel32.dll"));
IsWow64Process_t pfnIsWow64Process =
- (IsWow64Process_t)dllKernel32.RawGetSymbol(_T("IsWow64Process"));
+ (IsWow64Process_t)dllKernel32.RawGetSymbol(wxT("IsWow64Process"));
BOOL wow64 = FALSE;
if ( pfnIsWow64Process )
wxCreateHiddenWindow(LPCTSTR *pclassname, LPCTSTR classname, WNDPROC wndproc)
{
wxCHECK_MSG( classname && pclassname && wndproc, NULL,
- _T("NULL parameter in wxCreateHiddenWindow") );
+ wxT("NULL parameter in wxCreateHiddenWindow") );
// register the class fi we need to first
if ( *pclassname == NULL )
// running processes
if ( !::SetEvent(gs_heventShutdown) )
{
- wxLogDebug(_T("Failed to set shutdown event in wxExecuteModule"));
+ wxLogDebug(wxT("Failed to set shutdown event in wxExecuteModule"));
}
::CloseHandle(gs_heventShutdown);
3000 // long but finite value
) == WAIT_TIMEOUT )
{
- wxLogDebug(_T("Failed to stop all wxExecute monitor threads"));
+ wxLogDebug(wxT("Failed to stop all wxExecute monitor threads"));
}
for ( size_t n = 0; n < numThreads; n++ )
{
if ( !::UnregisterClass(wxMSWEXEC_WNDCLASSNAME, wxGetInstance()) )
{
- wxLogLastError(_T("UnregisterClass(wxExecClass)"));
+ wxLogLastError(wxT("UnregisterClass(wxExecClass)"));
}
gs_classForHiddenWindow = NULL;
gs_heventShutdown = ::CreateEvent(NULL, TRUE, FALSE, NULL);
if ( !gs_heventShutdown )
{
- wxLogDebug(_T("CreateEvent() in wxExecuteThread failed"));
+ wxLogDebug(wxT("CreateEvent() in wxExecuteThread failed"));
}
}
break;
default:
- wxLogDebug(_T("Waiting for the process termination failed!"));
+ wxLogDebug(wxT("Waiting for the process termination failed!"));
}
return 0;
if ( ::GetLastError() != ERROR_BROKEN_PIPE )
{
// unexpected error
- wxLogLastError(_T("PeekNamedPipe"));
+ wxLogLastError(wxT("PeekNamedPipe"));
}
// don't try to continue reading from a pipe if an error occurred or if
NULL // timeout (we don't set it neither)
) )
{
- wxLogLastError(_T("SetNamedPipeHandleState(PIPE_NOWAIT)"));
+ wxLogLastError(wxT("SetNamedPipeHandleState(PIPE_NOWAIT)"));
}
}
// thread -- this could be fixed, but as Unix versions don't support this
// neither I don't want to waste time on this now
wxASSERT_MSG( wxThread::IsMain(),
- _T("wxExecute() can be called only from the main thread") );
+ wxT("wxExecute() can be called only from the main thread") );
#endif // wxUSE_THREADS
wxString command;
// case we execute just <command> and process the rest below
wxString ddeServer, ddeTopic, ddeCommand;
static const size_t lenDdePrefix = 7; // strlen("WX_DDE:")
- if ( cmd.Left(lenDdePrefix) == _T("WX_DDE#") )
+ if ( cmd.Left(lenDdePrefix) == wxT("WX_DDE#") )
{
// speed up the concatenations below
ddeServer.reserve(256);
ddeCommand.reserve(256);
const wxChar *p = cmd.c_str() + 7;
- while ( *p && *p != _T('#') )
+ while ( *p && *p != wxT('#') )
{
command += *p++;
}
}
else
{
- wxFAIL_MSG(_T("invalid WX_DDE command in wxExecute"));
+ wxFAIL_MSG(wxT("invalid WX_DDE command in wxExecute"));
}
- while ( *p && *p != _T('#') )
+ while ( *p && *p != wxT('#') )
{
ddeServer += *p++;
}
}
else
{
- wxFAIL_MSG(_T("invalid WX_DDE command in wxExecute"));
+ wxFAIL_MSG(wxT("invalid WX_DDE command in wxExecute"));
}
- while ( *p && *p != _T('#') )
+ while ( *p && *p != wxT('#') )
{
ddeTopic += *p++;
}
}
else
{
- wxFAIL_MSG(_T("invalid WX_DDE command in wxExecute"));
+ wxFAIL_MSG(wxT("invalid WX_DDE command in wxExecute"));
}
while ( *p )
DUPLICATE_SAME_ACCESS // same access as for src handle
) )
{
- wxLogLastError(_T("DuplicateHandle"));
+ wxLogLastError(wxT("DuplicateHandle"));
}
::CloseHandle(pipeInWrite);
switch ( ::WaitForInputIdle(pi.hProcess, 10000 /* 10 seconds */) )
{
default:
- wxFAIL_MSG( _T("unexpected WaitForInputIdle() return code") );
+ wxFAIL_MSG( wxT("unexpected WaitForInputIdle() return code") );
// fall through
case -1:
- wxLogLastError(_T("WaitForInputIdle() in wxExecute"));
+ wxLogLastError(wxT("WaitForInputIdle() in wxExecute"));
case WAIT_TIMEOUT:
- wxLogDebug(_T("Timeout too small in WaitForInputIdle"));
+ wxLogDebug(wxT("Timeout too small in WaitForInputIdle"));
ok = false;
break;
if ( !ok )
{
- wxLogDebug(_T("Failed to send DDE request to the process \"%s\"."),
+ wxLogDebug(wxT("Failed to send DDE request to the process \"%s\"."),
cmd.c_str());
}
}
}
wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
- wxCHECK_MSG( traits, -1, _T("no wxAppTraits in wxExecute()?") );
+ wxCHECK_MSG( traits, -1, wxT("no wxAppTraits in wxExecute()?") );
void *cookie = NULL;
if ( !(flags & wxEXEC_NODISABLE) )
s_initialized = true;
wxLogNull nolog;
- wxDynamicLibrary dll(_T("shlwapi.dll"));
+ wxDynamicLibrary dll(wxT("shlwapi.dll"));
if ( dll.IsLoaded() )
{
s_pfnSHAutoComplete =
- (SHAutoComplete_t)dll.GetSymbol(_T("SHAutoComplete"));
+ (SHAutoComplete_t)dll.GetSymbol(wxT("SHAutoComplete"));
if ( s_pfnSHAutoComplete )
{
// won't be unloaded until the process termination, no big deal
HRESULT hr = s_pfnSHAutoComplete(hwnd, 0x10 /* SHACF_FILESYS_ONLY */);
if ( FAILED(hr) )
{
- wxLogApiError(_T("SHAutoComplete"), hr);
+ wxLogApiError(wxT("SHAutoComplete"), hr);
return false;
}
WinStruct<SHELLEXECUTEINFO> sei;
sei.lpFile = document.wx_str();
- sei.lpVerb = _T("open");
+ sei.lpVerb = wxT("open");
#ifdef __WXWINCE__
sei.nShow = SW_SHOWNORMAL; // SW_SHOWDEFAULT not defined under CE (#10216)
#else
{
// ShellExecuteEx() opens the URL in an existing window by default so
// we can't use it if we need a new window
- wxRegKey key(wxRegKey::HKCR, scheme + _T("\\shell\\open"));
+ wxRegKey key(wxRegKey::HKCR, scheme + wxT("\\shell\\open"));
if ( !key.Exists() )
{
// try the default browser, it must be registered at least for http URLs
- key.SetName(wxRegKey::HKCR, _T("http\\shell\\open"));
+ key.SetName(wxRegKey::HKCR, wxT("http\\shell\\open"));
}
if ( key.Exists() )
WinStruct<SHELLEXECUTEINFO> sei;
sei.lpFile = url.c_str();
- sei.lpVerb = _T("open");
+ sei.lpVerb = wxT("open");
sei.nShow = SW_SHOWNORMAL;
sei.fMask = SEE_MASK_FLAG_NO_UI; // we give error message ourselves
// we're prepared to handle the errors
wxLogNull noLog;
- if ( !m_dllUxTheme.Load(_T("uxtheme.dll")) )
+ if ( !m_dllUxTheme.Load(wxT("uxtheme.dll")) )
return false;
#define RESOLVE_UXTHEME_FUNCTION(type, funcname) \
- funcname = (type)m_dllUxTheme.GetSymbol(_T(#funcname)); \
+ funcname = (type)m_dllUxTheme.GetSymbol(wxT(#funcname)); \
if ( !funcname ) \
return false
// this error is not fatal, so don't show a message to the user about
// it, otherwise it would appear every time a generic directory picker
// dialog is used and there is a connected network drive
- wxLogLastError(_T("SHGetFileInfo"));
+ wxLogLastError(wxT("SHGetFileInfo"));
}
else
{
::InterlockedExchange(&s_cancelSearch, FALSE); // reset
#if wxUSE_DYNLIB_CLASS
- if (!s_mprLib.IsLoaded() && s_mprLib.Load(_T("mpr.dll")))
+ if (!s_mprLib.IsLoaded() && s_mprLib.Load(wxT("mpr.dll")))
{
#ifdef UNICODE
- s_pWNetOpenEnum = (WNetOpenEnumPtr)s_mprLib.GetSymbol(_T("WNetOpenEnumW"));
- s_pWNetEnumResource = (WNetEnumResourcePtr)s_mprLib.GetSymbol(_T("WNetEnumResourceW"));
+ s_pWNetOpenEnum = (WNetOpenEnumPtr)s_mprLib.GetSymbol(wxT("WNetOpenEnumW"));
+ s_pWNetEnumResource = (WNetEnumResourcePtr)s_mprLib.GetSymbol(wxT("WNetEnumResourceW"));
#else
- s_pWNetOpenEnum = (WNetOpenEnumPtr)s_mprLib.GetSymbol(_T("WNetOpenEnumA"));
- s_pWNetEnumResource = (WNetEnumResourcePtr)s_mprLib.GetSymbol(_T("WNetEnumResourceA"));
+ s_pWNetOpenEnum = (WNetOpenEnumPtr)s_mprLib.GetSymbol(wxT("WNetOpenEnumA"));
+ s_pWNetEnumResource = (WNetEnumResourcePtr)s_mprLib.GetSymbol(wxT("WNetEnumResourceA"));
#endif
- s_pWNetCloseEnum = (WNetCloseEnumPtr)s_mprLib.GetSymbol(_T("WNetCloseEnum"));
+ s_pWNetCloseEnum = (WNetCloseEnumPtr)s_mprLib.GetSymbol(wxT("WNetCloseEnum"));
}
#endif
wxIcon wxFSVolume::GetIcon(wxFSIconType type) const
{
wxCHECK_MSG( type >= 0 && (size_t)type < m_icons.GetCount(), wxNullIcon,
- _T("wxFSIconType::GetIcon(): invalid icon index") );
+ wxT("wxFSIconType::GetIcon(): invalid icon index") );
// Load on demand.
if (m_icons[type].IsNull())
break;
case wxFS_VOL_ICO_MAX:
- wxFAIL_MSG(_T("wxFS_VOL_ICO_MAX is not valid icon type"));
+ wxFAIL_MSG(wxT("wxFS_VOL_ICO_MAX is not valid icon type"));
break;
}
void wxCheckListBox::DoDeleteOneItem(unsigned int n)
{
- wxCHECK_RET( IsValid( n ), _T("invalid index in wxCheckListBox::Delete") );
+ wxCHECK_RET( IsValid( n ), wxT("invalid index in wxCheckListBox::Delete") );
if ( !ListView_DeleteItem(GetHwnd(), n) )
{
- wxLogLastError(_T("ListView_DeleteItem"));
+ wxLogLastError(wxT("ListView_DeleteItem"));
}
m_itemsClientData.RemoveAt(n);
}
bool wxCheckListBox::IsChecked(unsigned int uiIndex) const
{
wxCHECK_MSG( IsValid( uiIndex ), false,
- _T("invalid index in wxCheckListBox::IsChecked") );
+ wxT("invalid index in wxCheckListBox::IsChecked") );
return (ListView_GetCheckState(((HWND)GetHWND()), uiIndex) != 0);
}
void wxCheckListBox::Check(unsigned int uiIndex, bool bCheck)
{
wxCHECK_RET( IsValid( uiIndex ),
- _T("invalid index in wxCheckListBox::Check") );
+ wxT("invalid index in wxCheckListBox::Check") );
ListView_SetCheckState(((HWND)GetHWND()), uiIndex, bCheck)
}
DoDeleteOneItem(n);
}
- wxASSERT_MSG( IsEmpty(), _T("logic error in DoClear()") );
+ wxASSERT_MSG( IsEmpty(), wxT("logic error in DoClear()") );
}
unsigned int wxCheckListBox::GetCount() const
const int bufSize = 513;
wxChar buf[bufSize];
ListView_GetItemText( (HWND)GetHWND(), n, 0, buf, bufSize - 1 );
- buf[bufSize-1] = _T('\0');
+ buf[bufSize-1] = wxT('\0');
wxString str(buf);
return str;
}
void wxCheckListBox::SetString(unsigned int n, const wxString& s)
{
wxCHECK_RET( IsValid( n ),
- _T("invalid index in wxCheckListBox::SetString") );
+ wxT("invalid index in wxCheckListBox::SetString") );
wxChar *buf = new wxChar[s.length()+1];
wxStrcpy(buf, s.c_str());
ListView_SetItemText( (HWND)GetHWND(), n, 0, buf );
wxZeroMemory(newItem);
newItem.iItem = pos + i;
n = ListView_InsertItem( (HWND)GetHWND(), & newItem );
- wxCHECK_MSG( n != -1, -1, _T("Item not added") );
+ wxCHECK_MSG( n != -1, -1, wxT("Item not added") );
SetString( n, items[i] );
m_itemsClientData.Insert(NULL, n);
if(pos == n) return;
POINT ppt;
BOOL ret = ListView_GetItemPosition( (HWND)GetHWND(), n, &ppt );
- wxCHECK_RET( ret == TRUE, _T("Broken DoSetFirstItem") );
+ wxCHECK_RET( ret == TRUE, wxT("Broken DoSetFirstItem") );
ListView_Scroll( (HWND)GetHWND(), 0, 0 );
ListView_Scroll( (HWND)GetHWND(), 0, ppt.y );
}
// sanity check
wxASSERT_MSG( choice->m_hwndBuddy == hwndBuddy,
- _T("wxChoice has incorrect buddy HWND!") );
+ wxT("wxChoice has incorrect buddy HWND!") );
return choice;
}
sizeText.x -= sizeBtn.x + MARGIN_BETWEEN;
if ( sizeText.x <= 0 )
{
- wxLogDebug(_T("not enough space for wxSpinCtrl!"));
+ wxLogDebug(wxT("not enough space for wxSpinCtrl!"));
}
wxPoint posBtn(pos);
m_hwndBuddy = (WXHWND)::CreateWindowEx
(
exStyle, // sunken border
- _T("LISTBOX"), // window class
+ wxT("LISTBOX"), // window class
NULL, // no window title
msStyle, // style (will be shown later)
pos.x, pos.y, // position
int widthText = width - widthBtn - MARGIN_BETWEEN;
if ( widthText <= 0 )
{
- wxLogDebug(_T("not enough space for wxSpinCtrl!"));
+ wxLogDebug(wxT("not enough space for wxSpinCtrl!"));
}
if ( !::MoveWindow(GetBuddyHwnd(), x, y, widthText, height, TRUE) )
paths.Empty();
wxString dir(m_dir);
- if ( m_dir.Last() != _T('\\') )
- dir += _T('\\');
+ if ( m_dir.Last() != wxT('\\') )
+ dir += wxT('\\');
size_t count = m_fileNames.GetCount();
for ( size_t n = 0; n < count; n++ )
wxString ext;
wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
if ( !ext.empty() )
- m_fileName << _T('.') << ext;
+ m_fileName << wxT('.') << ext;
}
int wxFileDialog::ShowModal()
if (!SHCreateMenuBar(&menu_bar))
{
- wxFAIL_MSG( _T("SHCreateMenuBar failed") );
+ wxFAIL_MSG( wxT("SHCreateMenuBar failed") );
return;
}
m_menuBar->SetToolBar(this);
HWND hwndParent = GetHwndOf(GetParent());
- wxCHECK_MSG( hwndParent, false, _T("should have valid parent HWND") );
+ wxCHECK_MSG( hwndParent, false, wxT("should have valid parent HWND") );
#if defined(WINCE_WITHOUT_COMMANDBAR)
// create the menubar.
if ( !SHCreateMenuBar(&mbi) )
{
- wxFAIL_MSG( _T("SHCreateMenuBar failed") );
+ wxFAIL_MSG( wxT("SHCreateMenuBar failed") );
return false;
}
RECT r;
if ( !::SendMessage(GetHwnd(), TB_GETITEMRECT, pos, (LPARAM)&r) )
{
- wxLogLastError(_T("TB_GETITEMRECT"));
+ wxLogLastError(wxT("TB_GETITEMRECT"));
}
int width = r.right - r.left;
break;
default:
- wxFAIL_MSG( _T("unexpected toolbar button kind") );
+ wxFAIL_MSG( wxT("unexpected toolbar button kind") );
// fall through
case wxITEM_NORMAL:
void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(toggle))
{
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
}
#endif
sizeText.x -= sizeBtn.x + MARGIN_BETWEEN;
if ( sizeText.x <= 0 )
{
- wxLogDebug(_T("not enough space for wxSpinCtrl!"));
+ wxLogDebug(wxT("not enough space for wxSpinCtrl!"));
}
wxPoint posBtn(pos);
m_hwndBuddy = (WXHWND)::CreateWindowEx
(
exStyle, // sunken border
- _T("EDIT"), // window class
+ wxT("EDIT"), // window class
valueWin, // no window title
msStyle, // style (will be shown later)
pos.x, pos.y, // position
if ( style & wxSP_WRAP )
spiner_style |= UDS_WRAP;
- if ( !MSWCreateControl(UPDOWN_CLASS, spiner_style, posBtn, sizeBtn, _T(""), 0) )
+ if ( !MSWCreateControl(UPDOWN_CLASS, spiner_style, posBtn, sizeBtn, wxT(""), 0) )
return false;
// subclass the text ctrl to be able to intercept some events
// remove the '\n' at the end, if any (this is how this function is
// supposed to work according to the docs)
- if ( buf[len - 1] == _T('\n') )
+ if ( buf[len - 1] == wxT('\n') )
{
len--;
}
int widthText = width - widthBtn - MARGIN_BETWEEN;
if ( widthText <= 0 )
{
- wxLogDebug(_T("not enough space for wxSpinCtrl!"));
+ wxLogDebug(wxT("not enough space for wxSpinCtrl!"));
}
if ( !::MoveWindow(GetBuddyHwnd(), x, y, widthText, height, TRUE) )
// raise top level parent to top of z order
if (!::SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE))
{
- wxLogLastError(_T("SetWindowPos"));
+ wxLogLastError(wxT("SetWindowPos"));
}
}
/* static */
const wxChar *wxWindowMSW::MSWGetRegisteredClassName()
{
- return wxApp::GetRegisteredClassName(_T("wxWindow"), COLOR_BTNFACE);
+ return wxApp::GetRegisteredClassName(wxT("wxWindow"), COLOR_BTNFACE);
}
// real construction (Init() must have been called before!)
void wxWindowMSW::SetFocus()
{
HWND hWnd = GetHwnd();
- wxCHECK_RET( hWnd, _T("can't set focus to invalid window") );
+ wxCHECK_RET( hWnd, wxT("can't set focus to invalid window") );
#if !defined(__WXWINCE__)
::SetLastError(0);
HWND hwndFocus = ::GetFocus();
if ( hwndFocus != hWnd )
{
- wxLogApiError(_T("SetFocus"), dwRes);
+ wxLogApiError(wxT("SetFocus"), dwRes);
}
}
}
static bool s_initDone = false;
if ( !s_initDone )
{
- wxDynamicLibrary dllUser32(_T("user32.dll"), wxDL_VERBATIM | wxDL_QUIET);
+ wxDynamicLibrary dllUser32(wxT("user32.dll"), wxDL_VERBATIM | wxDL_QUIET);
wxDL_INIT_FUNC(s_pfn, AnimateWindow, dllUser32);
s_initDone = true;
case wxSHOW_EFFECT_MAX:
- wxFAIL_MSG( _T("invalid window show effect") );
+ wxFAIL_MSG( wxT("invalid window show effect") );
return false;
default:
- wxFAIL_MSG( _T("unknown window show effect") );
+ wxFAIL_MSG( wxT("unknown window show effect") );
return false;
}
if ( !(*s_pfnAnimateWindow)(GetHwnd(), timeout, dwFlags) )
{
- wxLogLastError(_T("AnimateWindow"));
+ wxLogLastError(wxT("AnimateWindow"));
return false;
}
{
if ( !::ReleaseCapture() )
{
- wxLogLastError(_T("ReleaseCapture"));
+ wxLogLastError(wxT("ReleaseCapture"));
}
}
if ( !::SetCursorPos(x, y) )
{
- wxLogLastError(_T("SetCursorPos"));
+ wxLogLastError(wxT("SetCursorPos"));
}
}
int wxWindowMSW::GetScrollPos(int orient) const
{
HWND hWnd = GetHwnd();
- wxCHECK_MSG( hWnd, 0, _T("no HWND in GetScrollPos") );
+ wxCHECK_MSG( hWnd, 0, wxT("no HWND in GetScrollPos") );
return GetScrollPosition(hWnd, WXOrientToSB(orient));
}
{
// Most of the time this is not really an error, since the return
// value can also be zero when there is no scrollbar yet.
- // wxLogLastError(_T("GetScrollInfo"));
+ // wxLogLastError(wxT("GetScrollInfo"));
}
maxPos = scrollInfo.nMax;
void wxWindowMSW::SetScrollPos(int orient, int pos, bool refresh)
{
HWND hWnd = GetHwnd();
- wxCHECK_RET( hWnd, _T("SetScrollPos: no HWND") );
+ wxCHECK_RET( hWnd, wxT("SetScrollPos: no HWND") );
WinStruct<SCROLLINFO> info;
info.nPage = 0;
wxUnusedVar(dir);
#else
wxCHECK_RET( GetHwnd(),
- _T("layout direction must be set after window creation") );
+ wxT("layout direction must be set after window creation") );
LONG styleOld = wxGetWindowExStyle(this);
break;
default:
- wxFAIL_MSG(_T("unsupported layout direction"));
+ wxFAIL_MSG(wxT("unsupported layout direction"));
break;
}
#ifdef __WXWINCE__
return wxLayout_Default;
#else
- wxCHECK_MSG( GetHwnd(), wxLayout_Default, _T("invalid window") );
+ wxCHECK_MSG( GetHwnd(), wxLayout_Default, wxT("invalid window") );
return wxHasWindowExStyle(this, WS_EX_LAYOUTRTL) ? wxLayout_RightToLeft
: wxLayout_LeftToRight;
// TODO: get rid of wxTLWHiddenParent special case (currently it's not
// registered by wxApp but using ad hoc code in msw/toplevel.cpp);
// there is also a hidden window class used by sockets &c
- return wxApp::IsRegisteredClassName(str) || str == _T("wxTLWHiddenParent");
+ return wxApp::IsRegisteredClassName(str) || str == wxT("wxTLWHiddenParent");
}
// ----------------------------------------------------------------------------
0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED) )
{
- wxLogLastError(_T("SetWindowPos"));
+ wxLogLastError(wxT("SetWindowPos"));
}
}
}
{
default:
case wxBORDER_DEFAULT:
- wxFAIL_MSG( _T("unknown border style") );
+ wxFAIL_MSG( wxT("unknown border style") );
// fall through
case wxBORDER_NONE:
{
if ( !::UpdateWindow(GetHwnd()) )
{
- wxLogLastError(_T("UpdateWindow"));
+ wxLogLastError(wxT("UpdateWindow"));
}
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE);
if ( !hdwp )
{
- wxLogLastError(_T("DeferWindowPos"));
+ wxLogLastError(wxT("DeferWindowPos"));
}
}
height + heightWin - rectClient.bottom,
TRUE) )
{
- wxLogLastError(_T("MoveWindow"));
+ wxLogLastError(wxT("MoveWindow"));
}
}
}
break;
default:
- wxFAIL_MSG( _T("unknown border style") );
+ wxFAIL_MSG( wxT("unknown border style") );
// fall through
case wxBORDER_NONE:
const wxFont *fontToUse) const
{
wxASSERT_MSG( !fontToUse || fontToUse->Ok(),
- _T("invalid font in GetTextExtent()") );
+ wxT("invalid font in GetTextExtent()") );
HFONT hfontToUse;
if ( fontToUse )
// this should never happen
wxCHECK_MSG( win, 0,
- _T("FindWindowForMouseEvent() returned NULL") );
+ wxT("FindWindowForMouseEvent() returned NULL") );
}
#ifdef __POCKETPC__
if (IsContextMenuEnabled() && message == WM_LBUTTONDOWN)
if ( !len )
{
- wxLogLastError(_T("MultiByteToWideChar()"));
+ wxLogLastError(wxT("MultiByteToWideChar()"));
}
buf[len] = L'\0';
break;
default:
- wxLogDebug(_T("Unknown WM_POWERBROADCAST(%d) event"), wParam);
+ wxLogDebug(wxT("Unknown WM_POWERBROADCAST(%d) event"), wParam);
// fall through
// these messages are currently not mapped to wx events
return false;
wxCHECK_MSG( wxDynamicCast(pMenuItem, wxMenuItem),
- false, _T("MSWOnDrawItem: bad wxMenuItem pointer") );
+ false, wxT("MSWOnDrawItem: bad wxMenuItem pointer") );
// prepare to call OnDrawItem(): notice using of wxDCTemp to prevent
// the DC from being released
return false;
wxCHECK_MSG( wxDynamicCast(pMenuItem, wxMenuItem),
- false, _T("MSWOnMeasureItem: bad wxMenuItem pointer") );
+ false, wxT("MSWOnMeasureItem: bad wxMenuItem pointer") );
size_t w, h;
bool rc = pMenuItem->OnMeasureItem(&w, &h);
// reference bitmap which can tell us what the RGB values change
// to.
wxLogNull logNo; // suppress error if we couldn't load the bitmap
- wxBitmap stdColourBitmap(_T("wxBITMAP_STD_COLOURS"));
+ wxBitmap stdColourBitmap(wxT("wxBITMAP_STD_COLOURS"));
if ( stdColourBitmap.Ok() )
{
// the pixels in the bitmap must correspond to wxSTD_COL_XXX!
wxASSERT_MSG( stdColourBitmap.GetWidth() == wxSTD_COL_MAX,
- _T("forgot to update wxBITMAP_STD_COLOURS!") );
+ wxT("forgot to update wxBITMAP_STD_COLOURS!") );
wxMemoryDC memDC;
memDC.SelectObject(stdColourBitmap);
m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren);
if ( !m_hDWP )
{
- wxLogLastError(_T("BeginDeferWindowPos"));
+ wxLogLastError(wxT("BeginDeferWindowPos"));
}
if (m_hDWP)
useDefer = true;
switch ( wParam )
{
default:
- wxFAIL_MSG( _T("unexpected WM_SIZE parameter") );
+ wxFAIL_MSG( wxT("unexpected WM_SIZE parameter") );
// fall through nevertheless
case SIZE_MAXHIDE:
// do put all child controls in place at once
if ( !::EndDeferWindowPos(hDWP) )
{
- wxLogLastError(_T("EndDeferWindowPos"));
+ wxLogLastError(wxT("EndDeferWindowPos"));
}
// Reset our children's pending pos/size values.
// still don't get move, enter nor leave events.
static wxWindowMSW *FindWindowForMouseEvent(wxWindowMSW *win, int *x, int *y)
{
- wxCHECK_MSG( x && y, win, _T("NULL pointer in FindWindowForMouseEvent") );
+ wxCHECK_MSG( x && y, win, wxT("NULL pointer in FindWindowForMouseEvent") );
// first try to find a non transparent child: this allows us to send events
// to a static text which is inside a static box, for example
{
// see comment in wxApp::GetComCtl32Version() explaining the
// use of wxLoadedDLL
- wxLoadedDLL dllComCtl32(_T("comctl32.dll"));
+ wxLoadedDLL dllComCtl32(wxT("comctl32.dll"));
if ( dllComCtl32.IsLoaded() )
{
s_pfn_TrackMouseEvent = (_TrackMouseEvent_t)
- dllComCtl32.RawGetSymbol(_T("_TrackMouseEvent"));
+ dllComCtl32.RawGetSymbol(wxT("_TrackMouseEvent"));
}
s_initDone = true;
&s_linesPerRotation, 0))
{
// this is not supposed to happen
- wxLogLastError(_T("SystemParametersInfo(GETWHEELSCROLLLINES)"));
+ wxLogLastError(wxT("SystemParametersInfo(GETWHEELSCROLLLINES)"));
// the default is 3, so use it if SystemParametersInfo() failed
s_linesPerRotation = 3;
if ( !::GetCursorPos(&pt) )
#endif
{
- wxLogLastError(_T("GetCursorPos"));
+ wxLogLastError(wxT("GetCursorPos"));
}
// we need to have client coordinates here for symmetry with
// menu creation code
wxMenuItem *item = (wxMenuItem*)mii.dwItemData;
- const wxChar *p = wxStrchr(item->GetItemLabel().wx_str(), _T('&'));
+ const wxChar *p = wxStrchr(item->GetItemLabel().wx_str(), wxT('&'));
while ( p++ )
{
- if ( *p == _T('&') )
+ if ( *p == wxT('&') )
{
// this is not the accel char, find the real one
- p = wxStrchr(p + 1, _T('&'));
+ p = wxStrchr(p + 1, wxT('&'));
}
else // got the accel char
{
else // failed to get the menu text?
{
// it's not fatal, so don't show error, but still log it
- wxLogLastError(_T("GetMenuItemInfo"));
+ wxLogLastError(wxT("GetMenuItemInfo"));
}
}
#endif
&scrollInfo) )
{
// Not necessarily an error, if there are no scrollbars yet.
- // wxLogLastError(_T("GetScrollInfo"));
+ // wxLogLastError(wxT("GetScrollInfo"));
}
event.SetPosition(scrollInfo.nTrackPos);
wxWindowMSW::MSWRegisterMessageHandler(int msg, MSWMessageHandler handler)
{
wxCHECK_MSG( gs_messageHandlers.find(msg) == gs_messageHandlers.end(),
- false, _T("registering handler for the same message twice") );
+ false, wxT("registering handler for the same message twice") );
gs_messageHandlers[msg] = handler;
return true;
{
const MSWMessageHandlers::iterator i = gs_messageHandlers.find(msg);
wxCHECK_RET( i != gs_messageHandlers.end() && i->second == handler,
- _T("unregistering non-registered handler?") );
+ wxT("unregistering non-registered handler?") );
gs_messageHandlers.erase(i);
}
);
if ( !wxTheKeyboardHook )
{
- wxLogLastError(_T("SetWindowsHookEx(wxKeyboardHook)"));
+ wxLogLastError(wxT("SetWindowsHookEx(wxKeyboardHook)"));
}
}
else // uninstall
typedef BOOL (WINAPI *UnregisterFunc1Proc)(UINT, UINT);
UnregisterFunc1Proc procUnregisterFunc;
- hCoreDll = LoadLibrary(_T("coredll.dll"));
+ hCoreDll = LoadLibrary(wxT("coredll.dll"));
if (hCoreDll)
{
- procUnregisterFunc = (UnregisterFunc1Proc)GetProcAddress(hCoreDll, _T("UnregisterFunc1"));
+ procUnregisterFunc = (UnregisterFunc1Proc)GetProcAddress(hCoreDll, wxT("UnregisterFunc1"));
if (procUnregisterFunc)
procUnregisterFunc(modifiers, id);
FreeLibrary(hCoreDll);
if ( !::RegisterHotKey(GetHwnd(), hotkeyId, win_modifiers, keycode) )
{
- wxLogLastError(_T("RegisterHotKey"));
+ wxLogLastError(wxT("RegisterHotKey"));
return false;
}
if ( !::UnregisterHotKey(GetHwnd(), hotkeyId) )
{
- wxLogLastError(_T("UnregisterHotKey"));
+ wxLogLastError(wxT("UnregisterHotKey"));
return false;
}
if ( !ms_hMsgHookProc )
{
- wxLogLastError(_T("SetWindowsHookEx(WH_GETMESSAGE)"));
+ wxLogLastError(wxT("SetWindowsHookEx(WH_GETMESSAGE)"));
return false;
}
{
HBITMAP hBmpInvMask = 0;
- wxCHECK_MSG( hBmpMask, 0, _T("invalid bitmap in wxInvertMask") );
+ wxCHECK_MSG( hBmpMask, 0, wxT("invalid bitmap in wxInvertMask") );
//
// Get width/height from the bitmap if not given
HBITMAP wxCopyBmp( HBITMAP hBmp, bool flip, int nWidth, int nHeight )
{
- wxCHECK_MSG( hBmp, 0, _T("invalid bitmap in wxCopyBmp") );
+ wxCHECK_MSG( hBmp, 0, wxT("invalid bitmap in wxCopyBmp") );
//
// Get width/height from the bitmap if not given
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str());
return false;
}
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str());
}
return bOk;
}
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_vColour;
}
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->m_nStyle;
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
return &(M_BRUSHDATA->m_vStipple);
}
int wxBrush::GetPS() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), 0, wxT("invalid brush") );
return M_BRUSHDATA->m_hBrush;
}
WXHANDLE wxBrush::GetResourceHandle() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), 0, wxT("invalid brush") );
return (WXHANDLE)M_BRUSHDATA->m_hBrush;
} // end of wxBrush::GetResourceHandle
{
wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
- wxCHECK_RET( tlw, _T("button without top level window?") );
+ wxCHECK_RET( tlw, wxT("button without top level window?") );
wxWindow* pWinOldDefault = tlw->GetDefaultItem();
{
wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
- wxCHECK_RET( tlw, _T("button without top level window?") );
+ wxCHECK_RET( tlw, wxT("button without top level window?") );
tlw->SetTmpDefaultItem(NULL);
lSstyle |= CBS_DROPDOWN;
- if (!OS2CreateControl( _T("COMBOBOX")
+ if (!OS2CreateControl( wxT("COMBOBOX")
,lSstyle
))
return false;
if (!pParent)
return false;
- if ((wxStrcmp(zClassname, _T("COMBOBOX"))) == 0)
+ if ((wxStrcmp(zClassname, wxT("COMBOBOX"))) == 0)
zClass = WC_COMBOBOX;
- else if ((wxStrcmp(zClassname, _T("STATIC"))) == 0)
+ else if ((wxStrcmp(zClassname, wxT("STATIC"))) == 0)
zClass = WC_STATIC;
- else if ((wxStrcmp(zClassname, _T("BUTTON"))) == 0)
+ else if ((wxStrcmp(zClassname, wxT("BUTTON"))) == 0)
zClass = WC_BUTTON;
- else if ((wxStrcmp(zClassname, _T("NOTEBOOK"))) == 0)
+ else if ((wxStrcmp(zClassname, wxT("NOTEBOOK"))) == 0)
zClass = WC_NOTEBOOK;
- else if ((wxStrcmp(zClassname, _T("CONTAINER"))) == 0)
+ else if ((wxStrcmp(zClassname, wxT("CONTAINER"))) == 0)
zClass = WC_CONTAINER;
if ((zClass == WC_STATIC) || (zClass == WC_BUTTON))
dwStyle |= DT_MNEMONIC;
//
if (!m_hPS)
{
- (void)wxMessageBox( _T("wxWidgets core library")
+ (void)wxMessageBox( wxT("wxWidgets core library")
,"Using uninitialized DC for measuring text!\n"
,wxICON_INFORMATION
);
vErrorCode = ::WinGetLastError(wxGetInstance());
sError = wxPMErrorToStr(vErrorCode);
// DEBUG
- wxSprintf(zMsg, _T("GpiQueryTextBox for %s: failed with Error: %lx - %s"), rsString.c_str(), vErrorCode, sError.c_str());
- (void)wxMessageBox( _T("wxWidgets core library")
+ wxSprintf(zMsg, wxT("GpiQueryTextBox for %s: failed with Error: %lx - %s"), rsString.c_str(), vErrorCode, sError.c_str());
+ (void)wxMessageBox( wxT("wxWidgets core library")
,zMsg
,wxICON_INFORMATION
);
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Unable to create presentation space. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Unable to create presentation space. Error: %s\n"), sError.c_str());
}
::GpiAssociate(m_hPS, NULLHANDLE);
::GpiAssociate(m_hPS, m_hDC);
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Unable to set current color table (3). Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Unable to set current color table (3). Error: %s\n"), sError.c_str());
}
::GpiCreateLogColorTable( m_hPS
,0L
, int* pnHeight
) const
{
- wxCHECK_RET( m_pCanvas, _T("wxWindowDC without a window?") );
+ wxCHECK_RET( m_pCanvas, wxT("wxWindowDC without a window?") );
m_pCanvas->GetSize( pnWidth
,pnHeight
);
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Unable to set current color table (4). Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Unable to set current color table (4). Error: %s\n"), sError.c_str());
}
::GpiCreateLogColorTable( m_hPS
,0L
, int* pnHeight
) const
{
- wxCHECK_RET( m_pCanvas, _T("wxWindowDC without a window?") );
+ wxCHECK_RET( m_pCanvas, wxT("wxWindowDC without a window?") );
m_pCanvas->GetClientSize( pnWidth
,pnHeight
);
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *pOldDC)
: wxPMDCImpl( owner )
{
- wxCHECK_RET( pOldDC, _T("NULL dc in wxMemoryDC ctor") );
+ wxCHECK_RET( pOldDC, wxT("NULL dc in wxMemoryDC ctor") );
CreateCompatible(pOldDC);
Init();
wxCoord WXUNUSED(vY),
bool WXUNUSED(bUseMask))
{
- wxCHECK_RET( rBmp.Ok(), _T("invalid bitmap in wxPrinterDC::DrawBitmap") );
+ wxCHECK_RET( rBmp.Ok(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") );
// int nWidth = rBmp.GetWidth();
// int nHeight = rBmp.GetHeight();
//
int wxDialog::ShowModal()
{
- wxASSERT_MSG( !IsModal(), _T("wxDialog::ShowModal() reentered?") );
+ wxASSERT_MSG( !IsModal(), wxT("wxDialog::ShowModal() reentered?") );
m_endModalCalled = false;
int nRetCode
)
{
- wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") );
+ wxASSERT_MSG( IsModal(), wxT("EndModal() called for non modal dialog") );
m_endModalCalled = true;
SetReturnCode(nRetCode);
{
if (!::DosFindClose(vFd))
{
- wxLogLastError(_T("DosFindClose"));
+ wxLogLastError(wxT("DosFindClose"));
}
}
if ( !wxEndsWithPathSeparator(sFilespec) )
{
- sFilespec += _T('\\');
+ sFilespec += wxT('\\');
}
- sFilespec += (!m_sFilespec ? _T("*.*") : m_sFilespec.c_str());
+ sFilespec += (!m_sFilespec ? wxT("*.*") : m_sFilespec.c_str());
m_vFinddata = FindFirst( sFilespec
,PTR_TO_FINDDATA
//
// Don't return "." and ".." unless asked for
//
- if ( zName[0] == _T('.') &&
- ((zName[1] == _T('.') && zName[2] == _T('\0')) ||
- (zName[1] == _T('\0'))) )
+ if ( zName[0] == wxT('.') &&
+ ((zName[1] == wxT('.') && zName[2] == wxT('\0')) ||
+ (zName[1] == wxT('\0'))) )
{
if (!(m_nFlags & wxDIR_DOTDOT))
continue;
if ( !name.empty() )
{
// bring to canonical Windows form
- name.Replace(_T("/"), _T("\\"));
+ name.Replace(wxT("/"), wxT("\\"));
- if ( name.Last() == _T('\\') )
+ if ( name.Last() == wxT('\\') )
{
// chop off the last (back)slash
name.Truncate(name.length() - 1);
, int nFlags
) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
M_DIR->Rewind();
M_DIR->SetFileSpec(rsFilespec);
M_DIR->SetFlags(nFlags);
wxString* psFilename
) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
- wxCHECK_MSG( psFilename, false, _T("bad pointer in wxDir::GetNext()") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
+ wxCHECK_MSG( psFilename, false, wxT("bad pointer in wxDir::GetNext()") );
return M_DIR->Read(psFilename);
} // end of wxDir::GetNext
case wxDF_TEXT:
case wxDF_FILENAME:
case wxDF_HTML:
- sMechanism = _T("DRM_OS2FILE");
- sFormat = _T("DRF_TEXT");
+ sMechanism = wxT("DRM_OS2FILE");
+ sFormat = wxT("DRF_TEXT");
break;
case wxDF_OEMTEXT:
- sMechanism = _T("DRM_OS2FILE");
- sFormat = _T("DRF_OEMTEXT");
+ sMechanism = wxT("DRM_OS2FILE");
+ sFormat = wxT("DRF_OEMTEXT");
break;
case wxDF_BITMAP:
- sMechanism = _T("DRM_OS2FILE");
- sFormat = _T("DRF_BITMAP");
+ sMechanism = wxT("DRM_OS2FILE");
+ sFormat = wxT("DRF_BITMAP");
break;
case wxDF_METAFILE:
case wxDF_ENHMETAFILE:
- sMechanism = _T("DRM_OS2FILE");
- sFormat = _T("DRF_METAFILE");
+ sMechanism = wxT("DRM_OS2FILE");
+ sFormat = wxT("DRF_METAFILE");
break;
case wxDF_TIFF:
- sMechanism = _T("DRM_OS2FILE");
- sFormat = _T("DRF_TIFF");
+ sMechanism = wxT("DRM_OS2FILE");
+ sFormat = wxT("DRF_TIFF");
break;
case wxDF_SYLK:
- sMechanism = _T("DRM_OS2FILE");
- sFormat = _T("DRF_SYLK");
+ sMechanism = wxT("DRM_OS2FILE");
+ sFormat = wxT("DRF_SYLK");
break;
case wxDF_DIF:
- sMechanism = _T("DRM_OS2FILE");
- sFormat = _T("DRF_DIF");
+ sMechanism = wxT("DRM_OS2FILE");
+ sFormat = wxT("DRF_DIF");
break;
case wxDF_DIB:
- sMechanism = _T("DRM_OS2FILE");
- sFormat = _T("DRF_DIB");
+ sMechanism = wxT("DRM_OS2FILE");
+ sFormat = wxT("DRF_DIB");
break;
case wxDF_PALETTE:
case wxDF_WAVE:
case wxDF_UNICODETEXT:
case wxDF_LOCALE:
- sMechanism = _T("DRM_OS2FILE");
- sFormat = _T("DRF_UNKNOWN");
+ sMechanism = wxT("DRM_OS2FILE");
+ sFormat = wxT("DRF_UNKNOWN");
break;
case wxDF_PRIVATE:
- sMechanism = _T("DRM_OBJECT");
- sFormat = _T("DRF_UNKNOWN");
+ sMechanism = wxT("DRM_OBJECT");
+ sFormat = wxT("DRF_UNKNOWN");
break;
}
for (i = 0; i < ulItems; i++)
,(void*)pzBuffer
);
- wxStrcpy(zFormats, _T("<DRM_OS2FILE, DRF_UNKNOWN>"));
+ wxStrcpy(zFormats, wxT("<DRM_OS2FILE, DRF_UNKNOWN>"));
wxStrcpy(zContainer, GetDataObject()->GetPreferredFormat().GetId());
hStrRMF = ::DrgAddStrHandle((PSZ)zFormats);
wxGUIEventLoop::~wxGUIEventLoop()
{
- wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") );
+ wxASSERT_MSG( !m_impl, wxT("should have been deleted in Run()") );
}
//////////////////////////////////////////////////////////////////////////////
int wxGUIEventLoop::Run()
{
// event loops are not recursive, you need to create another loop!
- wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") );
+ wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") );
// SendIdleMessage() and Dispatch() below may throw so the code here should
// be exception-safe, hence we must use local objects for all actions we
void wxGUIEventLoop::Exit(int rc)
{
- wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") );
+ wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") );
m_impl->SetExitCode(rc);
bool wxGUIEventLoop::Dispatch()
{
- wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") );
+ wxCHECK_MSG( IsRunning(), false, wxT("can't call Dispatch() if not running") );
QMSG msg;
BOOL bRc = ::WinGetMsg(vHabmain, &msg, (HWND) NULL, 0, 0);
size_t nCount = m_fileNames.GetCount();
rasPaths.Empty();
- if (m_dir.Last() != _T('\\'))
- sDir += _T('\\');
+ if (m_dir.Last() != wxT('\\'))
+ sDir += wxT('\\');
for ( size_t n = 0; n < nCount; n++ )
{
switch (ch)
{
- case _T('/'):
+ case wxT('/'):
//
// Convert to backslash
//
- ch = _T('\\');
+ ch = wxT('\\');
//
// Fall through
//
- case _T('\\'):
+ case wxT('\\'):
while (i < nLen - 1)
{
wxChar chNext = m_dir[i + 1];
- if (chNext != _T('\\') && chNext != _T('/'))
+ if (chNext != wxT('\\') && chNext != wxT('/'))
break;
//
switch (eStyle)
{
default:
- wxFAIL_MSG( _T("unknown font style") );
+ wxFAIL_MSG( wxT("unknown font style") );
// fall through
case wxFONTSTYLE_NORMAL:
switch (eWeight)
{
default:
- wxFAIL_MSG( _T("unknown font weight") );
+ wxFAIL_MSG( wxT("unknown font weight") );
// fall through
case wxFONTWEIGHT_NORMAL:
{
long lVal;
- wxStringTokenizer vTokenizer(rsStr, _T(";"));
+ wxStringTokenizer vTokenizer(rsStr, wxT(";"));
//
// First the version
//
wxString sToken = vTokenizer.GetNextToken();
- if (sToken != _T('0'))
+ if (sToken != wxT('0'))
return false;
sToken = vTokenizer.GetNextToken();
{
wxString sStr;
- sStr.Printf(_T("%d;%ld;%ld;%ld;%d;%d;%d;%d;%d;%ld;%d;%s"),
+ sStr.Printf(wxT("%d;%ld;%ld;%ld;%d;%d;%d;%d;%d;%ld;%d;%s"),
0, // version, in case we want to change the format later
fm.lEmHeight,
fa.lAveCharWidth,
bool wxNativeEncodingInfo::FromString( const wxString& rsStr )
{
- wxStringTokenizer vTokenizer(rsStr, _T(";"));
+ wxStringTokenizer vTokenizer(rsStr, wxT(";"));
wxString sEncid = vTokenizer.GetNextToken();
long lEnc;
}
else
{
- if ( wxSscanf(sTmp, _T("%u"), &charset) != 1 )
+ if ( wxSscanf(sTmp, wxT("%u"), &charset) != 1 )
{
// should be a number!
return FALSE;
{
wxString sStr;
- sStr << (long)encoding << _T(';') << facename;
+ sStr << (long)encoding << wxT(';') << facename;
if (charset != 850)
{
- sStr << _T(';') << charset;
+ sStr << wxT(';') << charset;
}
return sStr;
} // end of wxNativeEncodingInfo::ToString
bool wxGetNativeFontEncoding( wxFontEncoding vEncoding,
wxNativeEncodingInfo* pInfo )
{
- wxCHECK_MSG(pInfo, FALSE, _T("bad pointer in wxGetNativeFontEncoding") );
+ wxCHECK_MSG(pInfo, FALSE, wxT("bad pointer in wxGetNativeFontEncoding") );
if (vEncoding == wxFONTENCODING_DEFAULT)
{
vEncoding = wxFont::GetDefaultEncoding();
switch (pFont->GetWeight())
{
default:
- wxFAIL_MSG(_T("unknown font weight"));
+ wxFAIL_MSG(wxT("unknown font weight"));
// fall through
usWeightClass = FWEIGHT_DONT_CARE;
break;
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Error setting parent for StatusBar. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Error setting parent for StatusBar. Error: %s\n"), sError.c_str());
return;
}
}
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Error setting parent for submenu. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Error setting parent for submenu. Error: %s\n"), sError.c_str());
}
if (!::WinSetOwner(m_hMenu, m_hFrame))
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Error setting parent for submenu. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Error setting parent for submenu. Error: %s\n"), sError.c_str());
}
::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
} // end of wxFrame::InternalSetMenuBar
class WXDLLEXPORT wxBMPFileHandler : public wxBitmapHandler
{
public:
- wxBMPFileHandler() : wxBitmapHandler(_T("Windows bitmap file"), _T("bmp"),
+ wxBMPFileHandler() : wxBitmapHandler(wxT("Windows bitmap file"), wxT("bmp"),
wxBITMAP_TYPE_BMP)
{
}
class WXDLLEXPORT wxBMPResourceHandler: public wxBitmapHandler
{
public:
- wxBMPResourceHandler() : wxBitmapHandler(_T("Windows bitmap resource"),
+ wxBMPResourceHandler() : wxBitmapHandler(wxT("Windows bitmap resource"),
wxEmptyString,
wxBITMAP_TYPE_BMP_RESOURCE)
{
)
{
wxIcon* pIcon = wxDynamicCast(pImage, wxIcon);
- wxCHECK_MSG(pIcon, false, _T("wxIconHandler only works with icons"));
+ wxCHECK_MSG(pIcon, false, wxT("wxIconHandler only works with icons"));
return LoadIcon( pIcon
,rName
class WXDLLEXPORT wxICOFileHandler : public wxIconHandler
{
public:
- wxICOFileHandler() : wxIconHandler(_T("ICO icon file"),
- _T("ico"),
+ wxICOFileHandler() : wxIconHandler(wxT("ICO icon file"),
+ wxT("ico"),
wxBITMAP_TYPE_ICO)
{
}
class WXDLLEXPORT wxICOResourceHandler: public wxIconHandler
{
public:
- wxICOResourceHandler() : wxIconHandler(_T("ICO resource"),
- _T("ico"),
+ wxICOResourceHandler() : wxIconHandler(wxT("ICO resource"),
+ wxT("ico"),
wxBITMAP_TYPE_ICO_RESOURCE)
{
}
n = (int)::WinSendMsg(GetHwnd(), LM_INSERTITEM, (MPARAM)lIndexType, (MPARAM)items[i].wx_str());
if (n < 0)
{
- wxLogLastError(_T("WinSendMsg(LM_INSERTITEM)"));
+ wxLogLastError(wxT("WinSendMsg(LM_INSERTITEM)"));
n = wxNOT_FOUND;
break;
}
break;
default:
- wxFAIL_MSG( _T("wxOS2 does not support more than 10 columns in REPORT view") );
+ wxFAIL_MSG( wxT("wxOS2 does not support more than 10 columns in REPORT view") );
break;
}
}
wxListItem& rInfo
)
{
- wxASSERT_MSG( !IsVirtual(), _T("can't be used with virtual controls") );
+ wxASSERT_MSG( !IsVirtual(), wxT("can't be used with virtual controls") );
PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND()
,rInfo.GetColumn()
,(PVOID)&vInternalData
))
{
- wxLogDebug(_T("CM_SORTRECORD failed"));
+ wxLogDebug(wxT("CM_SORTRECORD failed"));
return false;
}
return true;
{
// this is a pure virtual function, in fact - which is not really pure
// because the controls which are not virtual don't need to implement it
- wxFAIL_MSG( _T("not supposed to be called") );
+ wxFAIL_MSG( wxT("not supposed to be called") );
return wxEmptyString;
} // end of wxListCtrl::OnGetItemText
) const
{
// same as above
- wxFAIL_MSG( _T("not supposed to be called") );
+ wxFAIL_MSG( wxT("not supposed to be called") );
return -1;
} // end of wxListCtrl::OnGetItemImage
) const
{
wxASSERT_MSG( lItem >= 0 && lItem < GetItemCount(),
- _T("invalid item index in OnGetItemAttr()") );
+ wxT("invalid item index in OnGetItemAttr()") );
//
// No attributes by default
long lCount
)
{
- wxASSERT_MSG( IsVirtual(), _T("this is for virtual controls only") );
+ wxASSERT_MSG( IsVirtual(), wxT("this is for virtual controls only") );
//
// Cannot explicitly set the record count in OS/2
wxMenuItem* wxMenu::DoAppend( wxMenuItem* pItem )
{
- wxCHECK_MSG( pItem, NULL, _T("NULL item in wxMenu::DoAppend") );
+ wxCHECK_MSG( pItem, NULL, wxT("NULL item in wxMenu::DoAppend") );
bool bCheck = false;
}
else
{
- wxFAIL_MSG( _T("where is the radio group start item?") );
+ wxFAIL_MSG( wxT("where is the radio group start item?") );
}
}
}
//
// Tell the owner drawing code to to show the accel string as well
//
- SetAccelString(m_text.AfterFirst(_T('\t')));
+ SetAccelString(m_text.AfterFirst(wxT('\t')));
#endif // wxUSE_OWNER_DRAWN
} // end of wxMenuItem::Init
)
{
wxASSERT_MSG( !m_bIsRadioGroupStart
- ,_T("should only be called for the next radio items")
+ ,wxT("should only be called for the next radio items")
);
m_vRadioGroup.m_nStart = nStart;
)
{
wxASSERT_MSG( m_bIsRadioGroupStart
- ,_T("should only be called for the first radio item")
+ ,wxT("should only be called for the first radio item")
);
m_vRadioGroup.m_nEnd = nEnd;
} // end of wxMenuItem::SetRadioGroupEnd
int nPos = rItems.IndexOf(this);
wxCHECK_RET( nPos != wxNOT_FOUND
- ,_T("menuitem not found in the menu items list?")
+ ,wxT("menuitem not found in the menu items list?")
);
//
OWNER_DRAWN_ONLY(wxOwnerDrawn::SetName(m_text));
#if wxUSE_OWNER_DRAWN
if (rText.IsEmpty())
- SetAccelString(m_text.AfterFirst(_T('\t')));
+ SetAccelString(m_text.AfterFirst(wxT('\t')));
else
- SetAccelString(rText.AfterFirst(_T('\t')));
+ SetAccelString(rText.AfterFirst(wxT('\t')));
#endif // wxUSE_OWNER_DRAWN
HWND hMenu = GetHmenuOf(m_parentMenu);
wxLogNull nolog;
wxString strKey;
- if ( wxRegKey(wxRegKey::HKCR, m_ext + _T("\\shell")).Exists() )
+ if ( wxRegKey(wxRegKey::HKCR, m_ext + wxT("\\shell")).Exists() )
strKey = m_ext;
- if ( wxRegKey(wxRegKey::HKCR, m_strFileType + _T("\\shell")).Exists() )
+ if ( wxRegKey(wxRegKey::HKCR, m_strFileType + wxT("\\shell")).Exists() )
strKey = m_strFileType;
if ( !strKey )
}
strKey << wxT("\\shell\\") << verb;
- wxRegKey key(wxRegKey::HKCR, strKey + _T("\\command"));
+ wxRegKey key(wxRegKey::HKCR, strKey + wxT("\\command"));
wxString command;
if ( key.Open() ) {
// it's the default value of the key
#if wxUSE_DDE
// look whether we must issue some DDE requests to the application
// (and not just launch it)
- strKey += _T("\\DDEExec");
+ strKey += wxT("\\DDEExec");
wxRegKey keyDDE(wxRegKey::HKCR, strKey);
if ( keyDDE.Open() ) {
wxString ddeCommand, ddeServer, ddeTopic;
- keyDDE.QueryValue(_T(""), ddeCommand);
- ddeCommand.Replace(_T("%1"), _T("%s"));
+ keyDDE.QueryValue(wxT(""), ddeCommand);
+ ddeCommand.Replace(wxT("%1"), wxT("%s"));
- wxRegKey(wxRegKey::HKCR, strKey + _T("\\Application")).
- QueryValue(_T(""), ddeServer);
- wxRegKey(wxRegKey::HKCR, strKey + _T("\\Topic")).
- QueryValue(_T(""), ddeTopic);
+ wxRegKey(wxRegKey::HKCR, strKey + wxT("\\Application")).
+ QueryValue(wxT(""), ddeServer);
+ wxRegKey(wxRegKey::HKCR, strKey + wxT("\\Topic")).
+ QueryValue(wxT(""), ddeTopic);
// HACK: we use a special feature of wxExecute which exists
// just because we need it here: it will establish DDE
// conversation with the program it just launched
- command.Prepend(_T("WX_DDE#"));
- command << _T('#') << ddeServer
- << _T('#') << ddeTopic
- << _T('#') << ddeCommand;
+ command.Prepend(wxT("WX_DDE#"));
+ command << wxT('#') << ddeServer
+ << wxT('#') << ddeTopic
+ << wxT('#') << ddeCommand;
}
else
#endif // wxUSE_DDE
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str());
return false;
}
if (M_PENDATA->m_nStyle == wxPENSTYLE_TRANSPARENT)
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Can't set Gpi attributes for a LINEBUNDLE. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Can't set Gpi attributes for a LINEBUNDLE. Error: %s\n"), sError.c_str());
return false;
}
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str());
}
return (bool)bOk;
if (HasFlag(wxCLIP_SIBLINGS))
lSstyle |= WS_CLIPSIBLINGS;
- if (!OS2CreateControl( _T("BUTTON")
+ if (!OS2CreateControl( wxT("BUTTON")
,lSstyle
,rPos
,rSize
const wxWindowList& rSiblings = GetParent()->GetChildren();
wxWindowList::compatibility_iterator nodeThis = rSiblings.Find(this);
- wxCHECK_RET(nodeThis, _T("radio button not a child of its parent?"));
+ wxCHECK_RET(nodeThis, wxT("radio button not a child of its parent?"));
//
// If it's not the first item of the group ...
#if 0
if ( ::OffsetRgn(GetHrgn(), x, y) == ERROR )
{
- wxLogLastError(_T("OffsetRgn"));
+ wxLogLastError(wxT("OffsetRgn"));
return false;
}
break;
default:
- wxFAIL_MSG( _T("unknown region operation") );
+ wxFAIL_MSG( wxT("unknown region operation") );
// fall through
case wxRGN_AND:
wxFONTWEIGHT_NORMAL );
break;
default:
- wxFAIL_MSG( _T("stock font not found") );
+ wxFAIL_MSG( wxT("stock font not found") );
return GetFont(wxSYS_ANSI_VAR_FONT);
}
return true;\r
} else {\r
m_anotherRunning = false; // we don't know for sure in this case\r
- wxLogLastError(_T("DosCreateMutexSem"));\r
+ wxLogLastError(wxT("DosCreateMutexSem"));\r
return false;\r
}\r
}\r
{\r
if ( !::DosCloseMutexSem(m_hMutex) )\r
{\r
- wxLogLastError(_T("DosCloseMutexSem"));\r
+ wxLogLastError(wxT("DosCloseMutexSem"));\r
}\r
}\r
}\r
const wxString& WXUNUSED(path))\r
{\r
wxASSERT_MSG( !m_impl,\r
- _T("calling wxSingleInstanceChecker::Create() twice?") );\r
+ wxT("calling wxSingleInstanceChecker::Create() twice?") );\r
\r
// creating unnamed mutex doesn't have the same semantics!\r
- wxASSERT_MSG( !name.empty(), _T("mutex name can't be empty") );\r
+ wxASSERT_MSG( !name.empty(), wxT("mutex name can't be empty") );\r
\r
m_impl = new wxSingleInstanceCheckerImpl;\r
\r
\r
bool wxSingleInstanceChecker::IsAnotherRunning() const\r
{\r
- wxCHECK_MSG( m_impl, false, _T("must call Create() first") );\r
+ wxCHECK_MSG( m_impl, false, wxT("must call Create() first") );\r
\r
return m_impl->IsAnotherRunning();\r
}\r
// sanity check
wxASSERT_MSG( pSpin->m_hWndBuddy == hWndBuddy,
- _T("wxSpinCtrl has incorrect buddy HWND!") );
+ wxT("wxSpinCtrl has incorrect buddy HWND!") );
return pSpin;
} // end of wxSpinCtrl::GetSpinForTextCtrl
if(!bIsIcon )
{
wxASSERT_MSG( wxDynamicCast(&rBitmap, wxBitmap),
- _T("not an icon and not a bitmap?") );
+ wxT("not an icon and not a bitmap?") );
const wxBitmap& rBmp = (const wxBitmap&)rBitmap;
wxMask* pMask = rBmp.GetMask();
if (!nHeightLineDefault)
nHeightLineDefault = nHeightLine;
if (!nHeightLineDefault)
- GetTextExtent(_T("W"), NULL, &nHeightLineDefault);
+ GetTextExtent(wxT("W"), NULL, &nHeightLineDefault);
nHeightTextTotal += nHeightLineDefault;
}
else
// when it is preceded by another '~' in which case it stands for a
// literal tilde
//
- if (*pc == _T('~'))
+ if (*pc == wxT('~'))
{
if (!bLastWasTilde)
{
{
wxStandardPaths *self = const_cast<wxStandardPaths *>(this);
- self->m_prefix = _T("/usr/local");
+ self->m_prefix = wxT("/usr/local");
}
return m_prefix;
}
wxString wxStandardPaths::GetDataDir() const
{
- return GetInstallPrefix() + _T("\\data");
+ return GetInstallPrefix() + wxT("\\data");
}
wxString wxStandardPaths::GetUserDataDir() const
{
- return AppendAppInfo(wxFileName::GetHomeDir() + _T("\\."));
+ return AppendAppInfo(wxFileName::GetHomeDir() + wxT("\\."));
}
wxString wxStandardPaths::GetPluginsDir() const
::WinSendMsg(GetHwnd(), MLM_SETCHANGED, MPFROMLONG(TRUE), 0);
else
// EM controls do not have a SETCHANGED, what can we do??
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
}
//
{
if (::DosCloseMutexSem(m_vMutex))
{
- wxLogLastError(_T("DosCloseMutexSem(mutex)"));
+ wxLogLastError(wxT("DosCloseMutexSem(mutex)"));
}
}
}
ulrc = ::DosCreateMutexSem(NULL, &m_vMutex, 0L, FALSE);
if (ulrc != 0)
{
- wxLogLastError(_T("DosCreateMutexSem()"));
+ wxLogLastError(wxT("DosCreateMutexSem()"));
m_vMutex = NULL;
m_vEvent = NULL;
return;
ulrc = ::DosCreateEventSem(NULL, &m_vEvent, 0L, FALSE);
if ( ulrc != 0)
{
- wxLogLastError(_T("DosCreateEventSem()"));
+ wxLogLastError(wxT("DosCreateEventSem()"));
::DosCloseMutexSem(m_vMutex);
m_vMutex = NULL;
m_vEvent = NULL;
{
if ( ::DosCloseEventSem(m_vEvent) )
{
- wxLogLastError(_T("DosCloseEventSem(semaphore)"));
+ wxLogLastError(wxT("DosCloseEventSem(semaphore)"));
}
if ( ::DosCloseMutexSem(m_vMutex) )
{
- wxLogLastError(_T("DosCloseMutexSem(semaphore)"));
+ wxLogLastError(wxT("DosCloseMutexSem(semaphore)"));
}
else
m_vEvent = NULL;
return wxSEMA_TIMEOUT;
default:
- wxLogLastError(_T("DosWaitEventSem(semaphore)"));
+ wxLogLastError(wxT("DosWaitEventSem(semaphore)"));
return wxSEMA_MISC_ERROR;
}
ulrc = :: DosRequestMutexSem(m_vMutex, ulMilliseconds);
return wxSEMA_OVERFLOW;
if ( ulrc != NO_ERROR && ulrc != ERROR_ALREADY_POSTED )
{
- wxLogLastError(_T("DosPostEventSem(semaphore)"));
+ wxLogLastError(wxT("DosPostEventSem(semaphore)"));
return wxSEMA_MISC_ERROR;
}
bool wxThread::SetConcurrency(size_t level)
{
- wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") );
+ wxASSERT_MSG( IsMain(), wxT("should only be called from the main thread") );
// ok only for the default one
if ( level == 0 )
// although under Windows we can wait for any thread, it's an error to
// wait for a detached one in wxWin API
wxCHECK_MSG( !IsDetached(), (ExitCode)-1,
- _T("can't wait for detached thread") );
+ wxT("can't wait for detached thread") );
ExitCode rc = (ExitCode)-1;
(void)Delete(&rc);
return(rc);
int nRows
)
{
- wxCHECK_RET( nRows != 0, _T("max number of rows must be > 0") );
+ wxCHECK_RET( nRows != 0, wxT("max number of rows must be > 0") );
m_maxCols = (GetToolsCount() + nRows - 1) / nRows;
Refresh();
);
if (!m_hWnd)
{
- wxLogError(_T("Unable to create tooltip window"));
+ wxLogError(wxT("Unable to create tooltip window"));
}
wxColour vColor( wxT("YELLOW") );
//
// Restore focus to the child which was last focused
//
- wxLogTrace(_T("focus"), _T("wxTLW %08lx activated."), m_hWnd);
+ wxLogTrace(wxT("focus"), wxT("wxTLW %08lx activated."), m_hWnd);
wxWindow* pParent = m_pWinLastFocused ? m_pWinLastFocused->GetParent()
: NULL;
pWin = pWin->GetParent();
}
- wxLogTrace(_T("focus"),
- _T("wxTLW %08lx deactivated, last focused: %08lx."),
+ wxLogTrace(wxT("focus"),
+ wxT("wxTLW %08lx deactivated, last focused: %08lx."),
m_hWnd,
m_pWinLastFocused ? GetHwndOf(m_pWinLastFocused)
: NULL);
//
// This flag doesn't make sense then and will be ignored
//
- wxFAIL_MSG( _T("wxFRAME_FLOAT_ON_PARENT but no parent?") );
+ wxFAIL_MSG( wxT("wxFRAME_FLOAT_ON_PARENT but no parent?") );
}
else
{
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Error creating frame. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Error creating frame. Error: %s\n"), sError.c_str());
return false;
}
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Error creating frame. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Error creating frame. Error: %s\n"), sError.c_str());
return false;
}
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Error sizing frame. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Error sizing frame. Error: %s\n"), sError.c_str());
return false;
}
lStyle = ::WinQueryWindowULong( m_hWnd
if (!hMenu)
{
- wxLogLastError(_T("GetSystemMenu"));
+ wxLogLastError(wxT("GetSystemMenu"));
return false;
}
{
if (!::WinDestroyWindow(m_shWnd))
{
- wxLogLastError(_T("DestroyWindow(hidden TLW parent)"));
+ wxLogLastError(wxT("DestroyWindow(hidden TLW parent)"));
}
m_shWnd = NULL;
}
{
if (!m_szClassName)
{
- static const wxChar* zHIDDEN_PARENT_CLASS = _T("wxTLWHiddenParent");
+ static const wxChar* zHIDDEN_PARENT_CLASS = wxT("wxTLWHiddenParent");
if (!::WinRegisterClass( wxGetInstance()
,(PSZ)zHIDDEN_PARENT_CLASS
,sizeof(ULONG)
))
{
- wxLogLastError(_T("RegisterClass(\"wxTLWHiddenParent\")"));
+ wxLogLastError(wxT("RegisterClass(\"wxTLWHiddenParent\")"));
}
else
{
NULL );
if (!m_shWnd)
{
- wxLogLastError(_T("CreateWindow(hidden TLW parent)"));
+ wxLogLastError(wxT("CreateWindow(hidden TLW parent)"));
}
}
return m_shWnd;
#include <netbios.h>
#endif
-static const wxChar WX_SECTION[] = _T("wxWidgets");
-static const wxChar eHOSTNAME[] = _T("HostName");
+static const wxChar WX_SECTION[] = wxT("wxWidgets");
+static const wxChar eHOSTNAME[] = wxT("HostName");
// For the following functions we SHOULD fill in support
// for Windows-NT (which I don't know) as I assume it begin
strcpy(zBuf, zServer);
#else
wxChar* zSysname;
- const wxChar* zDefaultHost = _T("noname");
+ const wxChar* zDefaultHost = wxT("noname");
- if ((zSysname = wxGetenv(_T("SYSTEM_NAME"))) == NULL &&
- (zSysname = wxGetenv(_T("HOSTNAME"))) == NULL)
+ if ((zSysname = wxGetenv(wxT("SYSTEM_NAME"))) == NULL &&
+ (zSysname = wxGetenv(wxT("HOSTNAME"))) == NULL)
{
::PrfQueryProfileString( HINI_PROFILE
,(PSZ)WX_SECTION
,(void*)zBuf
,(ULONG)nMaxSize - 1
);
- zBuf[nMaxSize] = _T('\0');
+ zBuf[nMaxSize] = wxT('\0');
}
else
{
#ifdef USE_NET_API
wxGetUserId( zBuf, nMaxSize );
#else
- wxStrlcpy(zBuf, _T("Unknown User"), nMaxSize);
+ wxStrlcpy(zBuf, wxT("Unknown User"), nMaxSize);
#endif
return true;
}
//
bool wxShell( const wxString& rCommand )
{
- wxChar* zShell = _T("CMD.EXE");
+ wxChar* zShell = wxT("CMD.EXE");
wxString sInputs;
STARTDATA SData = {0};
PSZ PgmTitle = "Command Shell";
SData.PgmTitle = PgmTitle;
SData.PgmName = (char*)zShell;
- sInputs = _T("/C ") + rCommand;
+ sInputs = wxT("/C ") + rCommand;
SData.PgmInputs = (BYTE*)sInputs.wx_str();
SData.TermQ = 0;
SData.Environment = 0;
#ifdef HAVE_UNSETENV
return unsetenv(variable.mb_str()) == 0;
#else
- value = _T(""); // mustn't pass NULL to setenv()
+ value = wxT(""); // mustn't pass NULL to setenv()
#endif
}
return setenv(variable.mb_str(), value, 1 /* overwrite */) == 0;
#elif defined(HAVE_PUTENV)
wxString s = variable;
if ( value )
- s << _T('=') << value;
+ s << wxT('=') << value;
// transform to ANSI
const char *p = s.mb_str();
wxString wxGetOsDescription()
{
- wxString strVer(_T("OS/2"));
+ wxString strVer(wxT("OS/2"));
ULONG ulSysInfo = 0;
if (::DosQuerySysInfo( QSV_VERSION_MINOR,
) == 0L )
{
wxString ver;
- ver.Printf( _T(" ver. %d.%d"),
+ ver.Printf( wxT(" ver. %d.%d"),
int(ulSysInfo / 10),
int(ulSysInfo % 10)
);
// Guests belong in the temp dir
if ( currentUser == "annonymous" )
{
- zHome = wxGetenv(_T("TMP"));
+ zHome = wxGetenv(wxT("TMP"));
if ( !zHome )
- zHome = wxGetenv(_T("TMPDIR"));
+ zHome = wxGetenv(wxT("TMPDIR"));
if ( !zHome )
- zHome = wxGetenv(_T("TEMP"));
+ zHome = wxGetenv(wxT("TEMP"));
if ( zHome && *zHome )
return zHome;
#endif
if (sUser.empty())
{
- if ((zHome = wxGetenv(_T("HOME"))) != NULL)
+ if ((zHome = wxGetenv(wxT("HOME"))) != NULL)
{
home = zHome;
home.Replace("/", "\\");
if (wxDirExists(fn.GetFullPath()) == false)
return false;
- disknum = wxToupper(fn.GetVolume().GetChar(0)) - _T('A') + 1;
+ disknum = wxToupper(fn.GetVolume().GetChar(0)) - wxT('A') + 1;
rc = ::DosQueryFSInfo(disknum, // 1 = A, 2 = B, 3 = C, ...
FSIL_ALLOC, // allocation info
void wxEndBusyCursor()
{
wxCHECK_RET( gs_wxBusyCursorCount > 0
- ,_T("no matching wxBeginBusyCursor() for wxEndBusyCursor()")
+ ,wxT("no matching wxBeginBusyCursor() for wxEndBusyCursor()")
);
if (--gs_wxBusyCursorCount == 0)
}
else
{
- wxFAIL_MSG(_T("pWnd==NULL !!!"));
+ wxFAIL_MSG(wxT("pWnd==NULL !!!"));
return false;//*** temporary?
}
}
// static box
//
wxASSERT_MSG( !wxDynamicCast(pParent, wxStaticBox),
- _T("wxStaticBox can't be used as a window parent!") );
+ wxT("wxStaticBox can't be used as a window parent!") );
#endif // wxUSE_STATBOX
// Ensure groupbox backgrounds are painted
void wxWindowOS2::SetFocus()
{
HWND hWnd = GetHwnd();
- wxCHECK_RET( hWnd, _T("can't set focus to invalid window") );
+ wxCHECK_RET( hWnd, wxT("can't set focus to invalid window") );
if (hWnd)
::WinSetFocus(HWND_DESKTOP, hWnd);
{
wxString Newstr(pWin->GetClassInfo()->GetClassName());
wxString Oldstr(pOldWin->GetClassInfo()->GetClassName());
- wxLogError( _T("Bug! New window of class %s has same HWND %X as old window of class %s"),
+ wxLogError( wxT("Bug! New window of class %s has same HWND %X as old window of class %s"),
Newstr.c_str(),
(int)hWnd,
Oldstr.c_str()
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Error creating frame. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Error creating frame. Error: %s\n"), sError.c_str());
return false;
}
SetSize( nX
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Unable to set current color table (1). Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Unable to set current color table (1). Error: %s\n"), sError.c_str());
}
//
// Set the color table to RGB mode
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Unable to set current color table (2). Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Unable to set current color table (2). Error: %s\n"), sError.c_str());
}
wxCHECK( pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), FALSE );
#define CREATE_STD_ICON(iconId, xpmRc) \
{ \
- wxIconBundle icon(_T(iconId), wxBITMAP_TYPE_ICON_RESOURCE); \
+ wxIconBundle icon(wxT(iconId), wxBITMAP_TYPE_ICON_RESOURCE); \
return icon; \
}
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->GetColour();
}
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->GetStyle();
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
return M_BRUSHDATA->GetStipple();
}
// application (otherwise applications would need to handle it)
if ( argc > 1 )
{
- static const wxChar *ARG_PSN = _T("-psn_");
+ static const wxChar *ARG_PSN = wxT("-psn_");
if ( wxStrncmp(argv[1], ARG_PSN, wxStrlen(ARG_PSN)) == 0 )
{
// remove this argument
// the trace mask we use with wxLogTrace() - call
// wxLog::AddTraceMask(TRACE_CLIPBOARD) to enable the trace messages from here
// (there will be a *lot* of them!)
-#define TRACE_CLIPBOARD _T("clipboard")
+#define TRACE_CLIPBOARD wxT("clipboard")
IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) :
wxWindowDCImpl( owner, window )
{
- wxCHECK_RET( window, _T("invalid window in wxClientDCImpl") );
+ wxCHECK_RET( window, wxT("invalid window in wxClientDCImpl") );
wxPoint origin = window->GetClientAreaOrigin() ;
m_window->GetClientSize( &m_width , &m_height);
if ( !m_window->IsShownOnScreen() )
wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *window ) :
wxWindowDCImpl( owner, window )
{
- wxASSERT_MSG( window->MacGetCGContextRef() != NULL, _T("using wxPaintDC without being in a native paint event") );
+ wxASSERT_MSG( window->MacGetCGContextRef() != NULL, wxT("using wxPaintDC without being in a native paint event") );
wxPoint origin = window->GetClientAreaOrigin() ;
m_window->GetClientSize( &m_width , &m_height);
SetDeviceOrigin( origin.x, origin.y );
void wxPrinterDCImpl::DoGetSize(int *width, int *height) const
{
- wxCHECK_RET( m_ok , _T("GetSize() doesn't work without a valid wxPrinterDC") );
+ wxCHECK_RET( m_ok , wxT("GetSize() doesn't work without a valid wxPrinterDC") );
m_nativePrinterDC->GetSize(width, height ) ;
}
{
// throw away the trailing slashes
size_t n = m_dirname.length();
- wxCHECK_RET( n, _T("empty dir name in wxDir") );
+ wxCHECK_RET( n, wxT("empty dir name in wxDir") );
while ( n > 0 && wxIsPathSeparator(m_dirname[--n]) )
;
if ( m_data )
{
name = m_data->GetName();
- if ( !name.empty() && (name.Last() == _T('/')) )
+ if ( !name.empty() && (name.Last() == wxT('/')) )
{
// chop off the last (back)slash
name.Truncate(name.length() - 1);
const wxString& filespec,
int flags) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
m_data->Rewind();
bool wxDir::GetNext(wxString *filename) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
- wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") );
+ wxCHECK_MSG( filename, false, wxT("bad pointer in wxDir::GetNext()") );
return m_data->Read(filename);
}
{
long l;
- wxStringTokenizer tokenizer(s, _T(";"));
+ wxStringTokenizer tokenizer(s, wxT(";"));
wxString token = tokenizer.GetNextToken();
//
{
wxString s;
- s.Printf(_T("%d;%d;%d;%d;%d;%d;%s;%d"),
+ s.Printf(wxT("%d;%d;%d;%d;%d;%d;%s;%d"),
0, // version
m_pointSize,
m_family,
wxStaticText* itemStaticText8 = new wxStaticText( itemDialog1, wxID_STATIC, _("Size:"), wxDefaultPosition, wxDefaultSize, 0 );
itemFlexGridSizer4->Add(itemStaticText8, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
- m_sizeCtrl = new wxSpinCtrl( itemDialog1, wxID_FONTDIALOG_FONTSIZE, _T("12"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 1, 300, 12 );
+ m_sizeCtrl = new wxSpinCtrl( itemDialog1, wxID_FONTDIALOG_FONTSIZE, wxT("12"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 1, 300, 12 );
m_sizeCtrl->SetHelpText(_("The font size in points."));
if (ShowToolTips())
m_sizeCtrl->SetToolTip(_("The font size in points."));
if ( wxOSXLockFocus(m_view) )
{
m_cgContext = wxOSXGetContextFromCurrentContext();
- wxASSERT_MSG( m_cgContext != NULL, _T("Unable to retrieve drawing context from View"));
+ wxASSERT_MSG( m_cgContext != NULL, wxT("Unable to retrieve drawing context from View"));
}
else
{
wxPoint myPos = m_text->GetPosition();
wxSize mySize = m_text->GetSize();
int sx, sy;
- m_text->GetTextExtent(m_text->GetValue() + _T("MM"), &sx, &sy);
+ m_text->GetTextExtent(m_text->GetValue() + wxT("MM"), &sx, &sy);
if (myPos.x + sx > parentSize.x)
sx = parentSize.x - myPos.x;
if (mySize.x > sx)
if (m_dbImpl)
{
wxColumnList::compatibility_iterator node = m_colsInfo.Item( col );
- wxASSERT_MSG( node, _T("invalid column index in wxMacListCtrlItem") );
+ wxASSERT_MSG( node, wxT("invalid column index in wxMacListCtrlItem") );
wxListItem* column = node->GetData();
long mask = column->GetMask();
if (m_dbImpl)
{
- wxASSERT_MSG( col < (int)m_colsInfo.GetCount(), _T("invalid column index in wxMacListCtrlItem") );
+ wxASSERT_MSG( col < (int)m_colsInfo.GetCount(), wxT("invalid column index in wxMacListCtrlItem") );
long mask = item.GetMask();
{
wxRect wxListCtrl::GetViewRect() const
{
wxASSERT_MSG( !HasFlag(wxLC_REPORT | wxLC_LIST),
- _T("wxListCtrl::GetViewRect() only works in icon mode") );
+ wxT("wxListCtrl::GetViewRect() only works in icon mode") );
if (m_genericImpl)
return m_genericImpl->GetViewRect();
// -1 otherwise.
long wxListCtrl::InsertItem(wxListItem& info)
{
- wxASSERT_MSG( !IsVirtual(), _T("can't be used with virtual controls") );
+ wxASSERT_MSG( !IsVirtual(), wxT("can't be used with virtual controls") );
if (m_genericImpl)
return m_genericImpl->InsertItem(info);
{
// this is a pure virtual function, in fact - which is not really pure
// because the controls which are not virtual don't need to implement it
- wxFAIL_MSG( _T("wxListCtrl::OnGetItemText not supposed to be called") );
+ wxFAIL_MSG( wxT("wxListCtrl::OnGetItemText not supposed to be called") );
return wxEmptyString;
}
wxListItemAttr *wxListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const
{
wxASSERT_MSG( item >= 0 && item < GetItemCount(),
- _T("invalid item index in OnGetItemAttr()") );
+ wxT("invalid item index in OnGetItemAttr()") );
// no attributes by default
return NULL;
void wxListCtrl::SetItemCount(long count)
{
- wxASSERT_MSG( IsVirtual(), _T("this is for virtual controls only") );
+ wxASSERT_MSG( IsVirtual(), wxT("this is for virtual controls only") );
if (m_genericImpl)
{
void wxMacDataBrowserListCtrlControl::MacSetColumnInfo( unsigned int row, unsigned int column, wxListItem* item )
{
wxMacDataItem* dataItem = GetItemFromLine(row);
- wxASSERT_MSG( dataItem, _T("could not obtain wxMacDataItem for row in MacSetColumnInfo. Is row a valid wxListCtrl row?") );
+ wxASSERT_MSG( dataItem, wxT("could not obtain wxMacDataItem for row in MacSetColumnInfo. Is row a valid wxListCtrl row?") );
if (item)
{
wxMacListCtrlItem* listItem = static_cast<wxMacListCtrlItem *>(dataItem);
void wxMacDataBrowserListCtrlControl::MacGetColumnInfo( unsigned int row, unsigned int column, wxListItem& item )
{
wxMacDataItem* dataItem = GetItemFromLine(row);
- wxASSERT_MSG( dataItem, _T("could not obtain wxMacDataItem in MacGetColumnInfo. Is row a valid wxListCtrl row?") );
+ wxASSERT_MSG( dataItem, wxT("could not obtain wxMacDataItem in MacGetColumnInfo. Is row a valid wxListCtrl row?") );
// CS should this guard against dataItem = 0 ? , as item is not a pointer if (item) is not appropriate
//if (item)
{
wxListItem* wxMacListCtrlItem::GetColumnInfo( unsigned int column )
{
- wxASSERT_MSG( HasColumnInfo(column), _T("invalid column index in wxMacListCtrlItem") );
+ wxASSERT_MSG( HasColumnInfo(column), wxT("invalid column index in wxMacListCtrlItem") );
return m_rowItems[column];
}
// Move the region
bool wxRegion::DoOffset(wxCoord x, wxCoord y)
{
- wxCHECK_MSG( M_REGION, false, _T("invalid wxRegion") );
+ wxCHECK_MSG( M_REGION, false, wxT("invalid wxRegion") );
if ( !x && !y )
// nothing to do
//! Union /e region with this.
bool wxRegion::DoCombine(const wxRegion& region, wxRegionOp op)
{
- wxCHECK_MSG( region.Ok(), false, _T("invalid wxRegion") );
+ wxCHECK_MSG( region.Ok(), false, wxT("invalid wxRegion") );
// Don't change shared data
if (!m_refData)
bool wxRegion::DoIsEqual(const wxRegion& WXUNUSED(region)) const
{
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
return false;
}
// case wxSYS_COLOUR_MAX:
default:
resultColor = *wxWHITE;
- // wxCHECK_MSG( index >= wxSYS_COLOUR_MAX, false, _T("unknown system colour index") );
+ // wxCHECK_MSG( index >= wxSYS_COLOUR_MAX, false, wxT("unknown system colour index") );
break ;
}
(((UniChar*)*theText)[actualSize]) = 0 ;
wxMBConvUTF16 converter ;
size_t noChars = converter.MB2WC( NULL , (const char*)*theText , 0 ) ;
- wxASSERT_MSG( noChars != wxCONV_FAILED, _T("Unable to count the number of characters in this string!") );
+ wxASSERT_MSG( noChars != wxCONV_FAILED, wxT("Unable to count the number of characters in this string!") );
ptr = new wxChar[noChars + 1] ;
noChars = converter.MB2WC( ptr , (const char*)*theText , noChars + 1 ) ;
- wxASSERT_MSG( noChars != wxCONV_FAILED, _T("Conversion of string failed!") );
+ wxASSERT_MSG( noChars != wxCONV_FAILED, wxT("Conversion of string failed!") );
ptr[noChars] = 0 ;
HUnlock( theText ) ;
#endif
// there will be an error returned for classic MLTE implementation when the control is
// invisible, but HITextView works correctly, so we don't assert that one
- // wxASSERT_MSG( theErr == noErr, _T("TXNScroll returned an error!") );
+ // wxASSERT_MSG( theErr == noErr, wxT("TXNScroll returned an error!") );
}
void wxMacMLTEControl::SetTXNData( const wxString& st, TXNOffset start, TXNOffset end )
wxMBConvUTF16 converter ;
ByteCount byteBufferLen = converter.WC2MB( NULL, st.wc_str(), 0 ) ;
wxASSERT_MSG( byteBufferLen != wxCONV_FAILED,
- _T("Conversion to UTF-16 unexpectedly failed") );
+ wxT("Conversion to UTF-16 unexpectedly failed") );
UniChar *unibuf = (UniChar*)malloc( byteBufferLen + 2 ) ; // 2 for NUL in UTF-16
converter.WC2MB( (char*)unibuf, st.wc_str(), byteBufferLen + 2 ) ;
TXNSetData( m_txn, kTXNUnicodeTextData, (void*)unibuf, byteBufferLen, start, end ) ;
wxThreadError wxThread::Pause()
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
- _T("a thread can't pause itself") );
+ wxT("a thread can't pause itself") );
wxCriticalSectionLocker lock(m_critsect);
#if wxOSX_USE_NATIVE_TOOLBAR
if (m_macToolbar != NULL)
{
- wxCHECK_MSG( tool->GetControl(), false, _T("control must be non-NULL") );
+ wxCHECK_MSG( tool->GetControl(), false, wxT("control must be non-NULL") );
HIToolbarItemRef item;
HIViewRef viewRef = (HIViewRef) tool->GetControl()->GetHandle() ;
CFDataRef data = CFDataCreate( kCFAllocatorDefault , (UInt8*) &viewRef , sizeof(viewRef) ) ;
thisWindow->GetCaret()->OnKillFocus();
#endif
- wxLogTrace(_T("Focus"), _T("focus lost(%p)"), static_cast<void*>(thisWindow));
+ wxLogTrace(wxT("Focus"), wxT("focus lost(%p)"), static_cast<void*>(thisWindow));
// remove this as soon as posting the synthesized event works properly
static bool inKillFocusEvent = false ;
{
// set focus
// panel wants to track the window which was the last to have focus in it
- wxLogTrace(_T("Focus"), _T("focus set(%p)"), static_cast<void*>(thisWindow));
+ wxLogTrace(wxT("Focus"), wxT("focus set(%p)"), static_cast<void*>(thisWindow));
wxChildFocusEvent eventFocus((wxWindow*)thisWindow);
thisWindow->HandleWindowEvent(eventFocus);
if ( controlPart != kControlFocusNoPart )
{
targetFocusWindow = thisWindow;
- wxLogTrace(_T("Focus"), _T("focus to be set(%p)"), static_cast<void*>(thisWindow));
+ wxLogTrace(wxT("Focus"), wxT("focus to be set(%p)"), static_cast<void*>(thisWindow));
}
else
{
formerFocusWindow = thisWindow;
- wxLogTrace(_T("Focus"), _T("focus to be lost(%p)"), static_cast<void*>(thisWindow));
+ wxLogTrace(wxT("Focus"), wxT("focus to be lost(%p)"), static_cast<void*>(thisWindow));
}
ControlPartCode previousControlPart = 0;
thisWindow->GetCaret()->OnKillFocus();
#endif
- wxLogTrace(_T("Focus"), _T("focus lost(%p)"), static_cast<void*>(thisWindow));
+ wxLogTrace(wxT("Focus"), wxT("focus lost(%p)"), static_cast<void*>(thisWindow));
static bool inKillFocusEvent = false ;
else
{
// panel wants to track the window which was the last to have focus in it
- wxLogTrace(_T("Focus"), _T("focus set(%p)"), static_cast<void*>(thisWindow));
+ wxLogTrace(wxT("Focus"), wxT("focus set(%p)"), static_cast<void*>(thisWindow));
wxChildFocusEvent eventFocus((wxWindow*)thisWindow);
thisWindow->HandleWindowEvent(eventFocus);
break ;
default:
- wxFAIL_MSG(_T("unexpected window variant"));
+ wxFAIL_MSG(wxT("unexpected window variant"));
break ;
}
bool wxCheckListBox::IsChecked(unsigned int n) const
{
wxCHECK_MSG( IsValid(n), false,
- _T("invalid index in wxCheckListBox::IsChecked") );
+ wxT("invalid index in wxCheckListBox::IsChecked") );
return m_checks[n] != 0;
}
void wxCheckListBox::Check(unsigned int n, bool check)
{
wxCHECK_RET( IsValid(n),
- _T("invalid index in wxCheckListBox::Check") );
+ wxT("invalid index in wxCheckListBox::Check") );
// intermediate var is needed to avoid compiler warning with VC++
bool isChecked = m_checks[n] != 0;
int windowStyle = [ m_macWindow styleMask];
if ( metal && !(windowStyle & NSTexturedBackgroundWindowMask) )
{
- wxFAIL_MSG( _T("Metal Style cannot be changed after creation") );
+ wxFAIL_MSG( wxT("Metal Style cannot be changed after creation") );
}
else if ( !metal && (windowStyle & NSTexturedBackgroundWindowMask ) )
{
- wxFAIL_MSG( _T("Metal Style cannot be changed after creation") );
+ wxFAIL_MSG( wxT("Metal Style cannot be changed after creation") );
}
}
}
if (m_macToolbar != NULL)
{
WXWidget view = (WXWidget) tool->GetControl()->GetHandle() ;
- wxCHECK_MSG( view, false, _T("control must be non-NULL") );
+ wxCHECK_MSG( view, false, wxT("control must be non-NULL") );
wxString identifier = wxString::Format(wxT("%ld"), (long) tool);
wxCFStringRef cfidentifier( identifier, wxFont::GetDefaultEncoding() );
break ;
default:
- wxFAIL_MSG(_T("unexpected window variant"));
+ wxFAIL_MSG(wxT("unexpected window variant"));
break ;
}
if ( [m_osxView respondsToSelector:@selector(setControlSize:)] )
if ( receivedFocus )
{
- wxLogTrace(_T("Focus"), _T("focus set(%p)"), static_cast<void*>(thisWindow));
+ wxLogTrace(wxT("Focus"), wxT("focus set(%p)"), static_cast<void*>(thisWindow));
wxChildFocusEvent eventFocus((wxWindow*)thisWindow);
thisWindow->HandleWindowEvent(eventFocus);
thisWindow->GetCaret()->OnKillFocus();
#endif
- wxLogTrace(_T("Focus"), _T("focus lost(%p)"), static_cast<void*>(thisWindow));
+ wxLogTrace(wxT("Focus"), wxT("focus lost(%p)"), static_cast<void*>(thisWindow));
wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId());
event.SetEventObject(thisWindow);
CFMutableDictionaryRef pDictionary = IOServiceMatching(kIOHIDDeviceKey);
if(pDictionary == NULL)
{
- wxLogSysError( _T("IOServiceMatching(kIOHIDDeviceKey) failed") );
+ wxLogSysError( wxT("IOServiceMatching(kIOHIDDeviceKey) failed") );
return false;
}
if( IOServiceGetMatchingServices(m_pPort,
pDictionary, &pIterator) != kIOReturnSuccess )
{
- wxLogSysError(_T("No Matching HID Services"));
+ wxLogSysError(wxT("No Matching HID Services"));
return false;
}
kNilOptions
) != KERN_SUCCESS )
{
- wxLogDebug(_T("IORegistryEntryCreateCFProperties failed"));
+ wxLogDebug(wxT("IORegistryEntryCreateCFProperties failed"));
}
//
//open the HID interface...
if ( (*m_ppDevice)->open(m_ppDevice, 0) != S_OK )
{
- wxLogDebug(_T("HID device: open failed"));
+ wxLogDebug(wxT("HID device: open failed"));
}
//
CFMutableDictionaryRef pDictionary = IOServiceMatching(kIOHIDDeviceKey);
if(pDictionary == NULL)
{
- wxLogSysError( _T("IOServiceMatching(kIOHIDDeviceKey) failed") );
+ wxLogSysError( wxT("IOServiceMatching(kIOHIDDeviceKey) failed") );
return false;
}
if( IOServiceGetMatchingServices(pPort,
pDictionary, &pIterator) != kIOReturnSuccess )
{
- wxLogSysError(_T("No Matching HID Services"));
+ wxLogSysError(wxT("No Matching HID Services"));
return false;
}
AddCookie(Data, i);
if ( (*m_ppQueue)->addElement(m_ppQueue, m_pCookies[i], 0) != S_OK )
{
- wxLogDebug(_T("HID device: adding element failed"));
+ wxLogDebug(wxT("HID device: adding element failed"));
}
}
m_ppQueue = (*m_ppDevice)->allocQueue(m_ppDevice);
if ( !m_ppQueue )
{
- wxLogDebug(_T("HID device: allocQueue failed"));
+ wxLogDebug(wxT("HID device: allocQueue failed"));
return;
}
//Param 2, flags, none yet
if ( (*m_ppQueue)->create(m_ppQueue, 0, 512) != S_OK )
{
- wxLogDebug(_T("HID device: create failed"));
+ wxLogDebug(wxT("HID device: create failed"));
}
}
if ( bestPaper == kPMNoData )
{
const PMPaperMargins margins = { 0.0, 0.0, 0.0, 0.0 };
- wxString id, name(_T("Custom paper"));
- id.Printf(_T("wxPaperCustom%dx%d"), papersize.x, papersize.y);
+ wxString id, name(wxT("Custom paper"));
+ id.Printf(wxT("wxPaperCustom%dx%d"), papersize.x, papersize.y);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if ( PMPaperCreateCustom != NULL)
#if defined( __WXMAC__ ) && wxOSX_USE_CARBON
return AppendAppInfo(wxMacFindFolder((short)kUserDomain, kApplicationSupportFolderType, kCreateFolder));
#else
- return AppendAppInfo(wxFileName::GetHomeDir() + _T("/Library/Application Support"));
+ return AppendAppInfo(wxFileName::GetHomeDir() + wxT("/Library/Application Support"));
#endif
}
ResourceCat category) const
{
return wxStandardPathsBase::
- GetLocalizedResourcesDir(lang, category) + _T(".lproj");
+ GetLocalizedResourcesDir(lang, category) + wxT(".lproj");
}
#endif // wxUSE_STDPATHS
{
struct utsname name;
uname(&name);
- return wxString::Format(_T("Mac OS X (%s %s %s)"),
+ return wxString::Format(wxT("Mac OS X (%s %s %s)"),
wxString::FromAscii(name.sysname).c_str(),
wxString::FromAscii(name.release).c_str(),
wxString::FromAscii(name.machine).c_str());
bool wxGLCanvas::SwapBuffers()
{
WXGLContext context = WXGLGetCurrentContext();
- wxCHECK_MSG(context, false, _T("should have current context"));
+ wxCHECK_MSG(context, false, wxT("should have current context"));
WXGLSwapBuffers(context);
return true;
{
wxASSERT_MSG( (bitmap.GetWidth() == m_width && bitmap.GetHeight() == m_height)
|| (m_width == 0 && m_height == 0),
- _T("invalid bitmap size in wxImageList: this might work ")
- _T("on this platform but definitely won't under Windows.") );
+ wxT("invalid bitmap size in wxImageList: this might work ")
+ wxT("on this platform but definitely won't under Windows.") );
m_images.Append( new wxIcon( bitmap ) );
{
wxASSERT_MSG( (bitmap.GetWidth() >= m_width && bitmap.GetHeight() == m_height)
|| (m_width == 0 && m_height == 0),
- _T("invalid bitmap size in wxImageList: this might work ")
- _T("on this platform but definitely won't under Windows.") );
+ wxT("invalid bitmap size in wxImageList: this might work ")
+ wxT("on this platform but definitely won't under Windows.") );
// Mimic behavior of Windows ImageList_Add that automatically breaks up the added
// bitmap into sub-images of the correct size
if ( receivedFocus )
{
- wxLogTrace(_T("Focus"), _T("focus set(%p)"), static_cast<void*>(thisWindow));
+ wxLogTrace(wxT("Focus"), wxT("focus set(%p)"), static_cast<void*>(thisWindow));
wxChildFocusEvent eventFocus((wxWindow*)thisWindow);
thisWindow->HandleWindowEvent(eventFocus);
thisWindow->GetCaret()->OnKillFocus();
#endif
- wxLogTrace(_T("Focus"), _T("focus lost(%p)"), static_cast<void*>(thisWindow));
+ wxLogTrace(wxT("Focus"), wxT("focus lost(%p)"), static_cast<void*>(thisWindow));
wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId());
event.SetEventObject(thisWindow);
void wxListBox::SetString(unsigned int n, const wxString& s)
{
- wxCHECK_RET( !IsSorted(), _T("can't set string in sorted listbox") );
+ wxCHECK_RET( !IsSorted(), wxT("can't set string in sorted listbox") );
if ( IsSorted() )
(*m_strings.sorted)[n] = s;
wxMenuItem* wxMenu::DoAppend(wxMenuItem *item)
{
- wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") );
+ wxCHECK_MSG( item, NULL, wxT("NULL item in wxMenu::DoAppend") );
bool check = false;
}
else
{
- wxFAIL_MSG( _T("where is the radio group start item?") );
+ wxFAIL_MSG( wxT("where is the radio group start item?") );
}
}
}
{
// next (i.e. second as we must be first) item is
// the separator to hide
- wxASSERT_MSG( pos == 0, _T("should be the menu start") );
+ wxASSERT_MSG( pos == 0, wxT("should be the menu start") );
sepToHide = next;
}
else if ( GetMenuItems().GetCount() == pos + 1 &&
const wxMenuItemList& items = m_parentMenu->GetMenuItems();
int pos = items.IndexOf(this);
wxCHECK_RET( pos != wxNOT_FOUND,
- _T("menuitem not found in the menu items list?") );
+ wxT("menuitem not found in the menu items list?") );
// get the radio group range
int start, end;
bool wxNonOwnedWindow::DoSetShape(const wxRegion& region)
{
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
- _T("Shaped windows must be created with the wxFRAME_SHAPED style."));
+ wxT("Shaped windows must be created with the wxFRAME_SHAPED style."));
// The empty region signifies that the shape
// should be removed from the window.
void wxSpinCtrl::SetTextValue(int val)
{
- wxCHECK_RET( m_text, _T("invalid call to wxSpinCtrl::SetTextValue") );
+ wxCHECK_RET( m_text, wxT("invalid call to wxSpinCtrl::SetTextValue") );
- m_text->SetValue(wxString::Format(_T("%d"), val));
+ m_text->SetValue(wxString::Format(wxT("%d"), val));
// select all text
m_text->SetSelection(0, -1);
void wxSpinCtrl::SetValue(int val)
{
- wxCHECK_RET( m_btn, _T("invalid call to wxSpinCtrl::SetValue") );
+ wxCHECK_RET( m_btn, wxT("invalid call to wxSpinCtrl::SetValue") );
SetTextValue(val);
void wxSpinCtrl::SetValue(const wxString& text)
{
- wxCHECK_RET( m_text, _T("invalid call to wxSpinCtrl::SetValue") );
+ wxCHECK_RET( m_text, wxT("invalid call to wxSpinCtrl::SetValue") );
long val;
if ( text.ToLong(&val) && ((val > INT_MIN) && (val < INT_MAX)) )
void wxSpinCtrl::SetRange(int min, int max)
{
- wxCHECK_RET( m_btn, _T("invalid call to wxSpinCtrl::SetRange") );
+ wxCHECK_RET( m_btn, wxT("invalid call to wxSpinCtrl::SetRange") );
m_btn->SetRange(min, max);
}
break ;
default:
- wxFAIL_MSG(_T("unexpected window variant"));
+ wxFAIL_MSG(wxT("unexpected window variant"));
break ;
}
m_peer->SetData<ControlSize>(kControlEntireControl, kControlSizeTag, &size ) ;
break ;
default:
- wxFAIL_MSG(_T("unexpected window variant"));
+ wxFAIL_MSG(wxT("unexpected window variant"));
break ;
}
#define CALL_CARET_API(api, args) \
if ( !api args ) \
- wxLogLastError(_T(#api))
+ wxLogLastError(wxT(#api))
// ===========================================================================
// implementation
int16_t day = m_dt.GetDay();
int16_t year = m_dt.GetYear();
- //if(!SelectDay(selectDayByDay,&month,&day,&year,_T("Pick date")))
+ //if(!SelectDay(selectDayByDay,&month,&day,&year,wxT("Pick date")))
if(!SelectDay(selectDayByDay,&month,&day,&year, "Pick date"))
return false;
wxDateTime dt(m_dt);
wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) :
wxPalmDCImpl( owner )
{
- wxCHECK_RET( window, _T("invalid window in wxWindowDCImpl") );
+ wxCHECK_RET( window, wxT("invalid window in wxWindowDCImpl") );
}
void wxWindowDCImpl::InitDC()
void wxWindowDCImpl::DoGetSize(int *width, int *height) const
{
- wxCHECK_RET( m_window, _T("wxWindowDCImpl without a window?") );
+ wxCHECK_RET( m_window, wxT("wxWindowDCImpl without a window?") );
m_window->GetSize(width, height);
}
void wxClientDCImpl::DoGetSize(int *width, int *height) const
{
- wxCHECK_RET( m_window, _T("wxClientDCImpl without a window?") );
+ wxCHECK_RET( m_window, wxT("wxClientDCImpl without a window?") );
m_window->GetClientSize(width, height);
}
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc )
: wxPalmDCImpl( owner )
{
- wxCHECK_RET( dc, _T("NULL dc in wxMemoryDC ctor") );
+ wxCHECK_RET( dc, wxT("NULL dc in wxMemoryDC ctor") );
CreateCompatible(dc);
// throw away the trailing slashes
size_t n = m_dirname.length();
- wxCHECK_RET( n, _T("empty dir name in wxDir") );
+ wxCHECK_RET( n, wxT("empty dir name in wxDir") );
while ( n > 0 && m_dirname[--n] == '/' )
;
{
if ( svfs_dir_endfind (m_dir) != 0 )
{
- wxLogLastError(_T("svfs_dir_endfind"));
+ wxLogLastError(wxT("svfs_dir_endfind"));
}
m_dir = NULL;
}
// speed up string concatenation in the loop a bit
wxString path = m_dirname;
- path += _T('/');
+ path += wxT('/');
path.reserve(path.length() + 255);
wxString de_d_name;
if ( m_data )
{
name = M_DIR->GetName();
- if ( !name.empty() && (name.Last() == _T('/')) )
+ if ( !name.empty() && (name.Last() == wxT('/')) )
{
// chop off the last (back)slash
name.Truncate(name.length() - 1);
const wxString& filespec,
int flags) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
M_DIR->Close();
M_DIR->SetFileSpec(filespec);
M_DIR->SetFlags(flags);
bool wxDir::GetNext(wxString *filename) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
- wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
+ wxCHECK_MSG( filename, false, wxT("bad pointer in wxDir::GetNext()") );
return M_DIR->Read(filename);
}
wxMenuItem* wxMenu::DoAppend(wxMenuItem *item)
{
- wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") );
+ wxCHECK_MSG( item, NULL, wxT("NULL item in wxMenu::DoAppend") );
if(!wxMenuBase::DoAppend(item) || !DoInsertOrAppend(item))
{
// wxSL_TOP is ignored - always off
// wxSL_SELRANGE is ignored - always off
// wxSL_VERTICAL is impossible in native form
- wxCHECK_MSG(!(style & wxSL_VERTICAL), false, _T("non vertical slider on PalmOS"));
+ wxCHECK_MSG(!(style & wxSL_VERTICAL), false, wxT("non vertical slider on PalmOS"));
if(!wxControl::Create(parent, id, pos, size, style, validator, name))
return false;
void wxStatusBarPalm::SetFieldsCount(int nFields, const int *widths)
{
// this is a Windows limitation
- wxASSERT_MSG( (nFields > 0) && (nFields < 255), _T("too many fields") );
+ wxASSERT_MSG( (nFields > 0) && (nFields < 255), wxT("too many fields") );
wxStatusBarBase::SetFieldsCount(nFields, widths);
void wxStatusBarPalm::SetStatusText(const wxString& strText, int nField)
{
wxCHECK_RET( (nField >= 0) && (nField < m_nFields),
- _T("invalid statusbar field index") );
+ wxT("invalid statusbar field index") );
SetStatusBufferText(strText,nField);
DrawStatusBar();
wxString wxStatusBarPalm::GetStatusText(int nField) const
{
wxCHECK_MSG( (nField >= 0) && (nField < m_nFields), wxEmptyString,
- _T("invalid statusbar field index") );
+ wxT("invalid statusbar field index") );
wxString text;
return text;
wxString wxGetOsDescription()
{
- wxString strOS = _T("PalmOS");
+ wxString strOS = wxT("PalmOS");
//err = FtrGet(sysFtrCreator, sysFtrNumROMVersion, &romVersion);
//if (romVersion >= 0x02000000) v20 = true;
}
#endif
- ::wxMessageBox(msg, _T("Property Error"));
+ ::wxMessageBox(msg, wxT("Property Error"));
}
// -----------------------------------------------------------------------
wxString msg = m_validationInfo.m_failureMessage;
if ( !msg.length() )
- msg = _T("You have entered invalid value. Press ESC to cancel editing.");
+ msg = wxT("You have entered invalid value. Press ESC to cancel editing.");
DoShowPropertyError(property, msg);
}
chr *name;
char code;
} cnames[] = {
- {_T("NUL"), '\0'},
- {_T("SOH"), '\001'},
- {_T("STX"), '\002'},
- {_T("ETX"), '\003'},
- {_T("EOT"), '\004'},
- {_T("ENQ"), '\005'},
- {_T("ACK"), '\006'},
- {_T("BEL"), '\007'},
- {_T("alert"), '\007'},
- {_T("BS"), '\010'},
- {_T("backspace"), '\b'},
- {_T("HT"), '\011'},
- {_T("tab"), '\t'},
- {_T("LF"), '\012'},
- {_T("newline"), '\n'},
- {_T("VT"), '\013'},
- {_T("vertical-tab"), '\v'},
- {_T("FF"), '\014'},
- {_T("form-feed"), '\f'},
- {_T("CR"), '\015'},
- {_T("carriage-return"), '\r'},
- {_T("SO"), '\016'},
- {_T("SI"), '\017'},
- {_T("DLE"), '\020'},
- {_T("DC1"), '\021'},
- {_T("DC2"), '\022'},
- {_T("DC3"), '\023'},
- {_T("DC4"), '\024'},
- {_T("NAK"), '\025'},
- {_T("SYN"), '\026'},
- {_T("ETB"), '\027'},
- {_T("CAN"), '\030'},
- {_T("EM"), '\031'},
- {_T("SUB"), '\032'},
- {_T("ESC"), '\033'},
- {_T("IS4"), '\034'},
- {_T("FS"), '\034'},
- {_T("IS3"), '\035'},
- {_T("GS"), '\035'},
- {_T("IS2"), '\036'},
- {_T("RS"), '\036'},
- {_T("IS1"), '\037'},
- {_T("US"), '\037'},
- {_T("space"), ' '},
- {_T("exclamation-mark"), '!'},
- {_T("quotation-mark"), '"'},
- {_T("number-sign"), '#'},
- {_T("dollar-sign"), '$'},
- {_T("percent-sign"), '%'},
- {_T("ampersand"), '&'},
- {_T("apostrophe"), '\''},
- {_T("left-parenthesis"), '('},
- {_T("right-parenthesis"), ')'},
- {_T("asterisk"), '*'},
- {_T("plus-sign"), '+'},
- {_T("comma"), ','},
- {_T("hyphen"), '-'},
- {_T("hyphen-minus"), '-'},
- {_T("period"), '.'},
- {_T("full-stop"), '.'},
- {_T("slash"), '/'},
- {_T("solidus"), '/'},
- {_T("zero"), '0'},
- {_T("one"), '1'},
- {_T("two"), '2'},
- {_T("three"), '3'},
- {_T("four"), '4'},
- {_T("five"), '5'},
- {_T("six"), '6'},
- {_T("seven"), '7'},
- {_T("eight"), '8'},
- {_T("nine"), '9'},
- {_T("colon"), ':'},
- {_T("semicolon"), ';'},
- {_T("less-than-sign"), '<'},
- {_T("equals-sign"), '='},
- {_T("greater-than-sign"), '>'},
- {_T("question-mark"), '?'},
- {_T("commercial-at"), '@'},
- {_T("left-square-bracket"), '['},
- {_T("backslash"), '\\'},
- {_T("reverse-solidus"), '\\'},
- {_T("right-square-bracket"), ']'},
- {_T("circumflex"), '^'},
- {_T("circumflex-accent"), '^'},
- {_T("underscore"), '_'},
- {_T("low-line"), '_'},
- {_T("grave-accent"), '`'},
- {_T("left-brace"), '{'},
- {_T("left-curly-bracket"), '{'},
- {_T("vertical-line"), '|'},
- {_T("right-brace"), '}'},
- {_T("right-curly-bracket"), '}'},
- {_T("tilde"), '~'},
- {_T("DEL"), '\177'},
+ {wxT("NUL"), '\0'},
+ {wxT("SOH"), '\001'},
+ {wxT("STX"), '\002'},
+ {wxT("ETX"), '\003'},
+ {wxT("EOT"), '\004'},
+ {wxT("ENQ"), '\005'},
+ {wxT("ACK"), '\006'},
+ {wxT("BEL"), '\007'},
+ {wxT("alert"), '\007'},
+ {wxT("BS"), '\010'},
+ {wxT("backspace"), '\b'},
+ {wxT("HT"), '\011'},
+ {wxT("tab"), '\t'},
+ {wxT("LF"), '\012'},
+ {wxT("newline"), '\n'},
+ {wxT("VT"), '\013'},
+ {wxT("vertical-tab"), '\v'},
+ {wxT("FF"), '\014'},
+ {wxT("form-feed"), '\f'},
+ {wxT("CR"), '\015'},
+ {wxT("carriage-return"), '\r'},
+ {wxT("SO"), '\016'},
+ {wxT("SI"), '\017'},
+ {wxT("DLE"), '\020'},
+ {wxT("DC1"), '\021'},
+ {wxT("DC2"), '\022'},
+ {wxT("DC3"), '\023'},
+ {wxT("DC4"), '\024'},
+ {wxT("NAK"), '\025'},
+ {wxT("SYN"), '\026'},
+ {wxT("ETB"), '\027'},
+ {wxT("CAN"), '\030'},
+ {wxT("EM"), '\031'},
+ {wxT("SUB"), '\032'},
+ {wxT("ESC"), '\033'},
+ {wxT("IS4"), '\034'},
+ {wxT("FS"), '\034'},
+ {wxT("IS3"), '\035'},
+ {wxT("GS"), '\035'},
+ {wxT("IS2"), '\036'},
+ {wxT("RS"), '\036'},
+ {wxT("IS1"), '\037'},
+ {wxT("US"), '\037'},
+ {wxT("space"), ' '},
+ {wxT("exclamation-mark"), '!'},
+ {wxT("quotation-mark"), '"'},
+ {wxT("number-sign"), '#'},
+ {wxT("dollar-sign"), '$'},
+ {wxT("percent-sign"), '%'},
+ {wxT("ampersand"), '&'},
+ {wxT("apostrophe"), '\''},
+ {wxT("left-parenthesis"), '('},
+ {wxT("right-parenthesis"), ')'},
+ {wxT("asterisk"), '*'},
+ {wxT("plus-sign"), '+'},
+ {wxT("comma"), ','},
+ {wxT("hyphen"), '-'},
+ {wxT("hyphen-minus"), '-'},
+ {wxT("period"), '.'},
+ {wxT("full-stop"), '.'},
+ {wxT("slash"), '/'},
+ {wxT("solidus"), '/'},
+ {wxT("zero"), '0'},
+ {wxT("one"), '1'},
+ {wxT("two"), '2'},
+ {wxT("three"), '3'},
+ {wxT("four"), '4'},
+ {wxT("five"), '5'},
+ {wxT("six"), '6'},
+ {wxT("seven"), '7'},
+ {wxT("eight"), '8'},
+ {wxT("nine"), '9'},
+ {wxT("colon"), ':'},
+ {wxT("semicolon"), ';'},
+ {wxT("less-than-sign"), '<'},
+ {wxT("equals-sign"), '='},
+ {wxT("greater-than-sign"), '>'},
+ {wxT("question-mark"), '?'},
+ {wxT("commercial-at"), '@'},
+ {wxT("left-square-bracket"), '['},
+ {wxT("backslash"), '\\'},
+ {wxT("reverse-solidus"), '\\'},
+ {wxT("right-square-bracket"), ']'},
+ {wxT("circumflex"), '^'},
+ {wxT("circumflex-accent"), '^'},
+ {wxT("underscore"), '_'},
+ {wxT("low-line"), '_'},
+ {wxT("grave-accent"), '`'},
+ {wxT("left-brace"), '{'},
+ {wxT("left-curly-bracket"), '{'},
+ {wxT("vertical-line"), '|'},
+ {wxT("right-brace"), '}'},
+ {wxT("right-curly-bracket"), '}'},
+ {wxT("tilde"), '~'},
+ {wxT("DEL"), '\177'},
{NULL, 0}
};
*/
static chr *classNames[] = {
- _T("alnum"), _T("alpha"), _T("ascii"), _T("blank"), _T("cntrl"), _T("digit"), _T("graph"),
- _T("lower"), _T("print"), _T("punct"), _T("space"), _T("upper"), _T("xdigit"), NULL
+ wxT("alnum"), wxT("alpha"), wxT("ascii"), wxT("blank"), wxT("cntrl"), wxT("digit"), wxT("graph"),
+ wxT("lower"), wxT("print"), wxT("punct"), wxT("space"), wxT("upper"), wxT("xdigit"), NULL
};
enum classes {
* Remap lower and upper to alpha if the match is case insensitive.
*/
- if (cases && len == 5 && (wxCRT_StrncmpNative(_T("lower"), np, 5) == 0
- || wxCRT_StrncmpNative(_T("upper"), np, 5) == 0)) {
- np = _T("alpha");
+ if (cases && len == 5 && (wxCRT_StrncmpNative(wxT("lower"), np, 5) == 0
+ || wxCRT_StrncmpNative(wxT("upper"), np, 5) == 0)) {
+ np = wxT("alpha");
}
/*
/* find the name */
len = endp - startp;
np = startp;
- if (cases && len == 5 && (wxCRT_StrncmpNative(_T("lower"), np, 5) == 0 ||
- wxCRT_StrncmpNative(_T("upper"), np, 5) == 0))
- np = _T("alpha");
+ if (cases && len == 5 && (wxCRT_StrncmpNative(wxT("lower"), np, 5) == 0 ||
+ wxCRT_StrncmpNative(wxT("upper"), np, 5) == 0))
+ np = wxT("alpha");
for (cc = cclasses; cc->name != NULL; cc++)
if (wxCRT_StrlenNative(cc->name) == len && wxCRT_StrncmpNative(cc->name, np, len) == 0)
break; /* NOTE BREAK OUT */
// Assume this box only contains paragraphs
wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph);
- wxCHECK_MSG( child, false, _T("Unknown object in layout") );
+ wxCHECK_MSG( child, false, wxT("Unknown object in layout") );
// TODO: what if the child hasn't been laid out (e.g. involved in Undo) but still has 'old' lines
if ( !forceQuickLayout &&
itemBoxSizer19->Add(itemStaticText20, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxArrayString m_symbolCtrlStrings;
- m_symbolCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, _T(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN );
+ m_symbolCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxT(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN );
m_symbolCtrl->SetHelpText(_("The bullet character."));
if (wxRichTextBulletsPage::ShowToolTips())
m_symbolCtrl->SetToolTip(_("The bullet character."));
itemBoxSizer18->Add(itemStaticText24, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_symbolFontCtrlStrings;
- m_symbolFontCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN );
+ m_symbolFontCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxT(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN );
m_symbolFontCtrl->SetHelpText(_("Available fonts."));
if (wxRichTextBulletsPage::ShowToolTips())
m_symbolFontCtrl->SetToolTip(_("Available fonts."));
itemBoxSizer18->Add(itemStaticText27, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_bulletNameCtrlStrings;
- m_bulletNameCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMECTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN );
+ m_bulletNameCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxT(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN );
m_bulletNameCtrl->SetHelpText(_("A standard bullet name."));
if (wxRichTextBulletsPage::ShowToolTips())
m_bulletNameCtrl->SetToolTip(_("A standard bullet name."));
wxStaticText* itemStaticText30 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, _("&Number:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer18->Add(itemStaticText30, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
- m_numberCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, _T("0"), wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 0, 100000, 0 );
+ m_numberCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxT("0"), wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 0, 100000, 0 );
m_numberCtrl->SetHelpText(_("The list item number."));
if (wxRichTextBulletsPage::ShowToolTips())
m_numberCtrl->SetToolTip(_("The list item number."));
wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Font:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
- m_faceTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_FACETEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
+ m_faceTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_FACETEXTCTRL, wxT(""), wxDefaultPosition, wxDefaultSize, 0 );
m_faceTextCtrl->SetHelpText(_("Type a font name."));
if (wxRichTextFontPage::ShowToolTips())
m_faceTextCtrl->SetToolTip(_("Type a font name."));
wxStaticText* itemStaticText10 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer9->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
- m_sizeTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
+ m_sizeTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_sizeTextCtrl->SetHelpText(_("Type a size in points."));
if (wxRichTextFontPage::ShowToolTips())
m_sizeTextCtrl->SetToolTip(_("Type a size in points."));
itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_styleCtrlStrings;
- m_styleCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_STYLECTRL, _T(""), wxDefaultPosition, wxSize(110, -1), m_styleCtrlStrings, wxCB_READONLY );
+ m_styleCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_STYLECTRL, wxT(""), wxDefaultPosition, wxSize(110, -1), m_styleCtrlStrings, wxCB_READONLY );
m_styleCtrl->SetHelpText(_("Select regular or italic style."));
if (wxRichTextFontPage::ShowToolTips())
m_styleCtrl->SetToolTip(_("Select regular or italic style."));
itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_weightCtrlStrings;
- m_weightCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, _T(""), wxDefaultPosition, wxSize(110, -1), m_weightCtrlStrings, wxCB_READONLY );
+ m_weightCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, wxT(""), wxDefaultPosition, wxSize(110, -1), m_weightCtrlStrings, wxCB_READONLY );
m_weightCtrl->SetHelpText(_("Select regular or bold."));
if (wxRichTextFontPage::ShowToolTips())
m_weightCtrl->SetToolTip(_("Select regular or bold."));
itemBoxSizer20->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_underliningCtrlStrings;
- m_underliningCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, _T(""), wxDefaultPosition, wxSize(110, -1), m_underliningCtrlStrings, wxCB_READONLY );
+ m_underliningCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, wxT(""), wxDefaultPosition, wxSize(110, -1), m_underliningCtrlStrings, wxCB_READONLY );
m_underliningCtrl->SetHelpText(_("Select underlining or no underlining."));
if (wxRichTextFontPage::ShowToolTips())
m_underliningCtrl->SetToolTip(_("Select underlining or no underlining."));
wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer22->Add(itemBoxSizer24, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5);
- m_indentLeft = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
+ m_indentLeft = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_indentLeft->SetHelpText(_("The left indent."));
if (wxRichTextIndentsSpacingPage::ShowToolTips())
m_indentLeft->SetToolTip(_("The left indent."));
wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer22->Add(itemBoxSizer27, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5);
- m_indentLeftFirst = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
+ m_indentLeftFirst = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_indentLeftFirst->SetHelpText(_("The first line indent."));
if (wxRichTextIndentsSpacingPage::ShowToolTips())
m_indentLeftFirst->SetToolTip(_("The first line indent."));
wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer22->Add(itemBoxSizer30, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5);
- m_indentRight = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
+ m_indentRight = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_indentRight->SetHelpText(_("The right indent."));
if (wxRichTextIndentsSpacingPage::ShowToolTips())
m_indentRight->SetToolTip(_("The right indent."));
wxBoxSizer* itemBoxSizer43 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer41->Add(itemBoxSizer43, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5);
- m_spacingBefore = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
+ m_spacingBefore = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_spacingBefore->SetHelpText(_("The spacing before the paragraph."));
if (wxRichTextIndentsSpacingPage::ShowToolTips())
m_spacingBefore->SetToolTip(_("The spacing before the paragraph."));
wxBoxSizer* itemBoxSizer46 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer41->Add(itemBoxSizer46, 1, wxGROW|wxALIGN_CENTER_VERTICAL, 5);
- m_spacingAfter = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
+ m_spacingAfter = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 );
if (wxRichTextIndentsSpacingPage::ShowToolTips())
m_spacingAfter->SetToolTip(_("The spacing after the paragraph."));
itemBoxSizer46->Add(m_spacingAfter, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxStaticText* itemStaticText5 = new wxStaticText( itemPanel1, wxID_STATIC, _("&List level:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
- m_levelCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTLISTSTYLEPAGE_LEVEL, _T("1"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 1, 10, 1 );
+ m_levelCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxT("1"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 1, 10, 1 );
m_levelCtrl->SetHelpText(_("Selects the list level to edit."));
if (wxRichTextListStylePage::ShowToolTips())
m_levelCtrl->SetToolTip(_("Selects the list level to edit."));
wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer26->Add(itemBoxSizer28, 0, wxGROW, 5);
wxArrayString m_symbolCtrlStrings;
- m_symbolCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL, _T(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN );
+ m_symbolCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL, wxT(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN );
m_symbolCtrl->SetHelpText(_("The bullet character."));
if (wxRichTextListStylePage::ShowToolTips())
m_symbolCtrl->SetToolTip(_("The bullet character."));
itemBoxSizer26->Add(itemStaticText32, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_symbolFontCtrlStrings;
- m_symbolFontCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN );
+ m_symbolFontCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, wxT(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN );
if (wxRichTextListStylePage::ShowToolTips())
m_symbolFontCtrl->SetToolTip(_("Available fonts."));
itemBoxSizer26->Add(m_symbolFontCtrl, 0, wxGROW|wxALL, 5);
itemBoxSizer26->Add(itemStaticText35, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_bulletNameCtrlStrings;
- m_bulletNameCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN );
+ m_bulletNameCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, wxT(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN );
m_bulletNameCtrl->SetHelpText(_("A standard bullet name."));
if (wxRichTextListStylePage::ShowToolTips())
m_bulletNameCtrl->SetToolTip(_("A standard bullet name."));
wxBoxSizer* itemBoxSizer59 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer57->Add(itemBoxSizer59, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- m_indentLeft = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
+ m_indentLeft = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_indentLeft->SetHelpText(_("The left indent."));
if (wxRichTextListStylePage::ShowToolTips())
m_indentLeft->SetToolTip(_("The left indent."));
wxBoxSizer* itemBoxSizer62 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer57->Add(itemBoxSizer62, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- m_indentLeftFirst = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
+ m_indentLeftFirst = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_indentLeftFirst->SetHelpText(_("The first line indent."));
if (wxRichTextListStylePage::ShowToolTips())
m_indentLeftFirst->SetToolTip(_("The first line indent."));
wxBoxSizer* itemBoxSizer65 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer57->Add(itemBoxSizer65, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- m_indentRight = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
+ m_indentRight = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_indentRight->SetHelpText(_("The right indent."));
if (wxRichTextListStylePage::ShowToolTips())
m_indentRight->SetToolTip(_("The right indent."));
wxBoxSizer* itemBoxSizer76 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer74->Add(itemBoxSizer76, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- m_spacingBefore = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
+ m_spacingBefore = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_spacingBefore->SetHelpText(_("The spacing before the paragraph."));
if (wxRichTextListStylePage::ShowToolTips())
m_spacingBefore->SetToolTip(_("The spacing before the paragraph."));
wxBoxSizer* itemBoxSizer79 = new wxBoxSizer(wxHORIZONTAL);
itemFlexGridSizer74->Add(itemBoxSizer79, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
- m_spacingAfter = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER, _T(""), wxDefaultPosition, wxSize(50, -1), 0 );
+ m_spacingAfter = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 );
m_spacingAfter->SetHelpText(_("The spacing after the paragraph."));
if (wxRichTextListStylePage::ShowToolTips())
m_spacingAfter->SetToolTip(_("The spacing after the paragraph."));
wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Style:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
- m_styleName = new wxTextCtrl( itemPanel1, ID_RICHTEXTSTYLEPAGE_STYLE_NAME, _T(""), wxDefaultPosition, wxSize(300, -1), wxTE_READONLY );
+ m_styleName = new wxTextCtrl( itemPanel1, ID_RICHTEXTSTYLEPAGE_STYLE_NAME, wxT(""), wxDefaultPosition, wxSize(300, -1), wxTE_READONLY );
m_styleName->SetHelpText(_("The style name."));
if (wxRichTextStylePage::ShowToolTips())
m_styleName->SetToolTip(_("The style name."));
itemBoxSizer5->Add(itemStaticText8, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_basedOnStrings;
- m_basedOn = new wxComboBox( itemPanel1, ID_RICHTEXTSTYLEPAGE_BASED_ON, _T(""), wxDefaultPosition, wxDefaultSize, m_basedOnStrings, wxCB_DROPDOWN );
+ m_basedOn = new wxComboBox( itemPanel1, ID_RICHTEXTSTYLEPAGE_BASED_ON, wxT(""), wxDefaultPosition, wxDefaultSize, m_basedOnStrings, wxCB_DROPDOWN );
m_basedOn->SetHelpText(_("The style on which this style is based."));
if (wxRichTextStylePage::ShowToolTips())
m_basedOn->SetToolTip(_("The style on which this style is based."));
itemBoxSizer5->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_nextStyleStrings;
- m_nextStyle = new wxComboBox( itemPanel1, ID_RICHTEXTSTYLEPAGE_NEXT_STYLE, _T(""), wxDefaultPosition, wxDefaultSize, m_nextStyleStrings, wxCB_DROPDOWN );
+ m_nextStyle = new wxComboBox( itemPanel1, ID_RICHTEXTSTYLEPAGE_NEXT_STYLE, wxT(""), wxDefaultPosition, wxDefaultSize, m_nextStyleStrings, wxCB_DROPDOWN );
m_nextStyle->SetHelpText(_("The default style for the next paragraph."));
if (wxRichTextStylePage::ShowToolTips())
m_nextStyle->SetToolTip(_("The default style for the next paragraph."));
itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxArrayString m_fontCtrlStrings;
- m_fontCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_FONT, _T(""), wxDefaultPosition, wxSize(240, -1), m_fontCtrlStrings, wxCB_READONLY );
+ m_fontCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_FONT, wxT(""), wxDefaultPosition, wxSize(240, -1), m_fontCtrlStrings, wxCB_READONLY );
m_fontCtrl->SetHelpText(_("The font from which to take the symbol."));
if (wxSymbolPickerDialog::ShowToolTips())
m_fontCtrl->SetToolTip(_("The font from which to take the symbol."));
#if defined(__UNICODE__)
wxArrayString m_subsetCtrlStrings;
- m_subsetCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_SUBSET, _T(""), wxDefaultPosition, wxDefaultSize, m_subsetCtrlStrings, wxCB_READONLY );
+ m_subsetCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_SUBSET, wxT(""), wxDefaultPosition, wxDefaultSize, m_subsetCtrlStrings, wxCB_READONLY );
m_subsetCtrl->SetHelpText(_("Shows a Unicode subset."));
if (wxSymbolPickerDialog::ShowToolTips())
m_subsetCtrl->SetToolTip(_("Shows a Unicode subset."));
wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Character code:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer12->Add(itemStaticText15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
- m_characterCodeCtrl = new wxTextCtrl( itemDialog1, ID_SYMBOLPICKERDIALOG_CHARACTERCODE, _T(""), wxDefaultPosition, wxSize(140, -1), wxTE_READONLY|wxTE_CENTRE );
+ m_characterCodeCtrl = new wxTextCtrl( itemDialog1, ID_SYMBOLPICKERDIALOG_CHARACTERCODE, wxT(""), wxDefaultPosition, wxSize(140, -1), wxTE_READONLY|wxTE_CENTRE );
m_characterCodeCtrl->SetHelpText(_("The character code."));
if (wxSymbolPickerDialog::ShowToolTips())
m_characterCodeCtrl->SetToolTip(_("The character code."));
{
wxASSERT_MSG( current == wxNOT_FOUND ||
(current >= m_minSymbolValue && current <= m_maxSymbolValue),
- _T("wxSymbolListCtrl::DoSetCurrent(): invalid symbol value") );
+ wxT("wxSymbolListCtrl::DoSetCurrent(): invalid symbol value") );
if ( current == m_current )
{
{
wxCHECK_RET( selection == wxNOT_FOUND ||
(selection >= m_minSymbolValue && selection < m_maxSymbolValue),
- _T("wxSymbolListCtrl::SetSelection(): invalid symbol value") );
+ wxT("wxSymbolListCtrl::SetSelection(): invalid symbol value") );
DoSetCurrent(selection);
}
wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Position (tenths of a mm):"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
- m_tabEditCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTTABSPAGE_TABEDIT, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
+ m_tabEditCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTTABSPAGE_TABEDIT, wxT(""), wxDefaultPosition, wxDefaultSize, 0 );
m_tabEditCtrl->SetHelpText(_("The tab position."));
if (wxRichTextTabsPage::ShowToolTips())
m_tabEditCtrl->SetToolTip(_("The tab position."));
wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer4->Add(itemBoxSizer10, 0, wxGROW, 5);
- wxStaticText* itemStaticText11 = new wxStaticText( itemPanel1, wxID_STATIC, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
+ wxStaticText* itemStaticText11 = new wxStaticText( itemPanel1, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer10->Add(itemStaticText11, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5);
wxButton* itemButton12 = new wxButton( itemPanel1, ID_RICHTEXTTABSPAGE_NEW_TAB, _("&New"), wxDefaultPosition, wxDefaultSize, 0 );
{
case wxCHK_UNCHECKED: status = Status_Unchecked; break;
case wxCHK_CHECKED: status = Status_Checked; break;
- default: wxFAIL_MSG(_T("Unknown checkbox state"));
+ default: wxFAIL_MSG(wxT("Unknown checkbox state"));
case wxCHK_UNDETERMINED: status = Status_3rdState; break;
}
if ( status != m_status )
bool wxCheckListBox::IsChecked(unsigned int item) const
{
wxCHECK_MSG( IsValid(item), false,
- _T("invalid index in wxCheckListBox::IsChecked") );
+ wxT("invalid index in wxCheckListBox::IsChecked") );
return m_checks[item] != 0;
}
void wxCheckListBox::Check(unsigned int item, bool check)
{
wxCHECK_RET( IsValid(item),
- _T("invalid index in wxCheckListBox::Check") );
+ wxT("invalid index in wxCheckListBox::Check") );
// intermediate var is needed to avoid compiler warning with VC++
bool isChecked = m_checks[item] != 0;
void wxComboBox::DoDeleteOneItem(unsigned int n)
{
- wxCHECK_RET( IsValid(n), _T("invalid index in wxComboBox::Delete") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxComboBox::Delete") );
if (GetSelection() == (int)n)
if ( GetTextCtrl() ) GetTextCtrl()->SetValue(wxEmptyString);
wxString wxComboBox::GetString(unsigned int n) const
{
- wxCHECK_MSG( IsValid(n), wxEmptyString, _T("invalid index in wxComboBox::GetString") );
+ wxCHECK_MSG( IsValid(n), wxEmptyString, wxT("invalid index in wxComboBox::GetString") );
return GetLBox()->GetString(n);
}
void wxComboBox::SetString(unsigned int n, const wxString& s)
{
- wxCHECK_RET( IsValid(n), _T("invalid index in wxComboBox::SetString") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxComboBox::SetString") );
GetLBox()->SetString(n, s);
}
void wxComboBox::SetSelection(int n)
{
- wxCHECK_RET( (n == wxNOT_FOUND || IsValid(n)), _T("invalid index in wxComboBox::Select") );
+ wxCHECK_RET( (n == wxNOT_FOUND || IsValid(n)), wxT("invalid index in wxComboBox::Select") );
GetLBox()->SetSelection(n);
{
wxRect rectUpdate = rgnUpdate.GetBox();
- wxLogTrace(_T("scrollbar"),
- _T("%s redraw: update box is (%d, %d)-(%d, %d)"),
- scrollbar->IsVertical() ? _T("vert") : _T("horz"),
+ wxLogTrace(wxT("scrollbar"),
+ wxT("%s redraw: update box is (%d, %d)-(%d, %d)"),
+ scrollbar->IsVertical() ? wxT("vert") : wxT("horz"),
rectUpdate.GetLeft(),
rectUpdate.GetTop(),
rectUpdate.GetRight(),
if ( rgnUpdate.Contains(rectBar) )
{
- wxLogTrace(_T("scrollbar"),
- _T("drawing bar part %d at (%d, %d)-(%d, %d)"),
+ wxLogTrace(wxT("scrollbar"),
+ wxT("drawing bar part %d at (%d, %d)-(%d, %d)"),
nBar + 1,
rectBar.GetLeft(),
rectBar.GetTop(),
wxRect rectArrow = scrollbar->GetScrollbarRect(elem);
if ( rgnUpdate.Contains(rectArrow) )
{
- wxLogTrace(_T("scrollbar"),
- _T("drawing arrow %d at (%d, %d)-(%d, %d)"),
+ wxLogTrace(wxT("scrollbar"),
+ wxT("drawing arrow %d at (%d, %d)-(%d, %d)"),
nArrow + 1,
rectArrow.GetLeft(),
rectArrow.GetTop(),
wxRect rectThumb = scrollbar->GetScrollbarRect(elem);
if ( rectThumb.width && rectThumb.height && rgnUpdate.Contains(rectThumb) )
{
- wxLogTrace(_T("scrollbar"),
- _T("drawing thumb at (%d, %d)-(%d, %d)"),
+ wxLogTrace(wxT("scrollbar"),
+ wxT("drawing thumb at (%d, %d)-(%d, %d)"),
rectThumb.GetLeft(),
rectThumb.GetTop(),
rectThumb.GetRight(),
void wxControlRenderer::DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{
wxASSERT_MSG( x1 == x2 || y1 == y2,
- _T("line must be either horizontal or vertical") );
+ wxT("line must be either horizontal or vertical") );
if ( x1 == x2 )
m_renderer->DrawVerticalLine(m_dc, x1, y1, y2);
int step = gauge->IsVertical() ? sizeStep.y : sizeStep.x;
// we divide by it below!
- wxCHECK_RET( step, _T("invalid wxGauge step") );
+ wxCHECK_RET( step, wxT("invalid wxGauge step") );
// round up to make the progress appear to start faster
int lenTotal = gauge->IsVertical() ? rect.height : rect.width;
m_isShowingModal = true;
- wxASSERT_MSG( !m_windowDisabler, _T("disabling windows twice?") );
+ wxASSERT_MSG( !m_windowDisabler, wxT("disabling windows twice?") );
#if defined(__WXGTK__) || defined(__WXMGL__)
wxBusyCursorSuspender suspender;
void wxDialog::EndModal(int retCode)
{
- wxASSERT_MSG( m_eventLoop, _T("wxDialog is not modal") );
+ wxASSERT_MSG( m_eventLoop, wxT("wxDialog is not modal") );
SetReturnCode(retCode);
void wxListBox::SetString(unsigned int n, const wxString& s)
{
- wxCHECK_RET( !IsSorted(), _T("can't set string in sorted listbox") );
+ wxCHECK_RET( !IsSorted(), wxT("can't set string in sorted listbox") );
if ( IsSorted() )
(*m_strings.sorted)[n] = s;
void wxListBox::DoDeleteOneItem(unsigned int n)
{
wxCHECK_RET( IsValid(n),
- _T("invalid index in wxListBox::Delete") );
+ wxT("invalid index in wxListBox::Delete") );
// do it before removing the index as otherwise the last item will not be
// refreshed (as GetCount() will be decremented)
// sanity check: a single selection listbox can't have more than one item
// selected
wxASSERT_MSG( HasMultipleSelection() || (m_selections.GetCount() < 2),
- _T("multiple selected items in single selection lbox?") );
+ wxT("multiple selected items in single selection lbox?") );
if ( select )
{
int wxListBox::GetSelection() const
{
wxCHECK_MSG( !HasMultipleSelection(), wxNOT_FOUND,
- _T("use wxListBox::GetSelections for ths listbox") );
+ wxT("use wxListBox::GetSelections for ths listbox") );
return m_selections.IsEmpty() ? wxNOT_FOUND : m_selections[0];
}
if ( m_updateCount == -1 )
{
// refresh all
- wxLogTrace(_T("listbox"), _T("Refreshing all"));
+ wxLogTrace(wxT("listbox"), wxT("Refreshing all"));
Refresh();
}
// entire line(s)
CalcScrolledPosition(0, rect.y, NULL, &rect.y);
- wxLogTrace(_T("listbox"), _T("Refreshing items %d..%d (%d-%d)"),
+ wxLogTrace(wxT("listbox"), wxT("Refreshing items %d..%d (%d-%d)"),
m_updateFrom, m_updateFrom + m_updateCount - 1,
rect.GetTop(), rect.GetBottom());
itemLast = itemMax;
// do draw them
- wxLogTrace(_T("listbox"), _T("Repainting items %d..%d"),
+ wxLogTrace(wxT("listbox"), wxT("Repainting items %d..%d"),
itemFirst, itemLast);
DoDrawRange(renderer, itemFirst, itemLast);
int last = first == 0 ? count - 1 : first - 1;
// if this is not true we'd never exit from the loop below!
- wxASSERT_MSG( first < (int)count && last < (int)count, _T("logic error") );
+ wxASSERT_MSG( first < (int)count && last < (int)count, wxT("logic error") );
// precompute it outside the loop
size_t len = prefix.length();
AnchorSelection(item == -1 ? m_current : item);
else if ( action == wxACTION_LISTBOX_SELECTALL ||
action == wxACTION_LISTBOX_SELTOGGLE )
- wxFAIL_MSG(_T("unimplemented yet"));
+ wxFAIL_MSG(wxT("unimplemented yet"));
else
return wxControl::PerformAction(action, numArg, strArg);
{
// pass something into strArg to tell the listbox that it shouldn't
// send the notification message: see PerformAction() above
- lbox->PerformAction(m_actionMouse, item, _T("no"));
+ lbox->PerformAction(m_actionMouse, item, wxT("no"));
}
// else: don't pass invalid index to the listbox
}
if ( nodeOldCurrent )
{
wxMenuItem *item = nodeOldCurrent->GetData();
- wxCHECK_RET( item, _T("no current item?") );
+ wxCHECK_RET( item, wxT("no current item?") );
// if it was the currently opened menu, close it
if ( item->IsSubMenu() && item->GetSubMenu()->IsShown() )
// check that the current item had been properly reset before
wxASSERT_MSG( !m_nodeCurrent ||
m_nodeCurrent == m_menu->GetMenuItems().GetFirst(),
- _T("menu current item preselected incorrectly") );
+ wxT("menu current item preselected incorrectly") );
wxPopupTransientWindow::Popup(focus);
wxPopupMenuWindow *win = menuParent->m_popupMenu;
// if we're shown, the parent menu must be also shown
- wxCHECK_RET( win, _T("parent menu is not shown?") );
+ wxCHECK_RET( win, wxT("parent menu is not shown?") );
if ( !::SetWindowPos(GetHwndOf(win), GetHwnd(),
0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW) )
{
- wxLogLastError(_T("SetWindowPos(HWND_TOP)"));
+ wxLogLastError(wxT("SetWindowPos(HWND_TOP)"));
}
Refresh();
if ( HasOpenSubmenu() )
{
wxMenuItem *item = GetCurrentItem();
- wxCHECK_RET( item && item->IsSubMenu(), _T("where is our open submenu?") );
+ wxCHECK_RET( item && item->IsSubMenu(), wxT("where is our open submenu?") );
wxPopupMenuWindow *win = item->GetSubMenu()->m_popupMenu;
- wxCHECK_RET( win, _T("opened submenu is not opened?") );
+ wxCHECK_RET( win, wxT("opened submenu is not opened?") );
win->Dismiss();
OnSubmenuDismiss( false );
void wxPopupMenuWindow::RefreshItem(wxMenuItem *item)
{
- wxCHECK_RET( item, _T("can't refresh NULL item") );
+ wxCHECK_RET( item, wxT("can't refresh NULL item") );
- wxASSERT_MSG( IsShown(), _T("can't refresh menu which is not shown") );
+ wxASSERT_MSG( IsShown(), wxT("can't refresh menu which is not shown") );
// FIXME: -1 here because of SetLogicalOrigin(1, 1) in DoDraw()
RefreshRect(wxRect(0, item->GetPosition() - 1,
void wxPopupMenuWindow::ClickItem(wxMenuItem *item)
{
- wxCHECK_RET( item, _T("can't click NULL item") );
+ wxCHECK_RET( item, wxT("can't click NULL item") );
wxASSERT_MSG( !item->IsSeparator() && !item->IsSubMenu(),
- _T("can't click this item") );
+ wxT("can't click this item") );
wxMenu* menu = m_menu;
void wxPopupMenuWindow::OpenSubmenu(wxMenuItem *item, InputMethod how)
{
- wxCHECK_RET( item, _T("can't open NULL submenu") );
+ wxCHECK_RET( item, wxT("can't open NULL submenu") );
wxMenu *submenu = item->GetSubMenu();
- wxCHECK_RET( submenu, _T("can only open submenus!") );
+ wxCHECK_RET( submenu, wxT("can only open submenus!") );
// FIXME: should take into account the border width
submenu->Popup(ClientToScreen(wxPoint(0, item->GetPosition())),
{
wxPopupMenuWindow *win = menu->m_popupMenu;
- wxCHECK_MSG( win, false, _T("parent menu not shown?") );
+ wxCHECK_MSG( win, false, wxT("parent menu not shown?") );
pos = ClientToScreen(pos);
if ( win->GetMenuItemFromPoint(win->ScreenToClient(pos)) )
wxPopupMenuWindow *win = menuParent->m_popupMenu;
// if we're shown, the parent menu must be also shown
- wxCHECK_RET( win, _T("parent menu is not shown?") );
+ wxCHECK_RET( win, wxT("parent menu is not shown?") );
win->ProcessMouseMove(win->ScreenToClient(ptScreen));
}
if ( HasOpenSubmenu() )
{
wxMenuItem *item = GetCurrentItem();
- wxCHECK_RET( CanOpen(item), _T("where is our open submenu?") );
+ wxCHECK_RET( CanOpen(item), wxT("where is our open submenu?") );
wxPopupMenuWindow *win = item->GetSubMenu()->m_popupMenu;
- wxCHECK_RET( win, _T("submenu is opened but not shown?") );
+ wxCHECK_RET( win, wxT("submenu is opened but not shown?") );
// only handle this event if the mouse is not inside the submenu
wxPoint pt = ClientToScreen(event.GetPosition());
if ( HasOpenSubmenu() )
{
wxCHECK_MSG( CanOpen(item), false,
- _T("has open submenu but another item selected?") );
+ wxT("has open submenu but another item selected?") );
if ( item->GetSubMenu()->ProcessKeyDown(key) )
return true;
}
else
{
- wxFAIL_MSG( _T("can't get geometry without window") );
+ wxFAIL_MSG( wxT("can't get geometry without window") );
}
}
}
else
{
- wxFAIL_MSG( _T("where is the radio group start item?") );
+ wxFAIL_MSG( wxT("where is the radio group start item?") );
}
}
}
{
wxMenuBase::Attach(menubar);
- wxCHECK_RET( m_menuBar, _T("menubar can't be NULL after attaching") );
+ wxCHECK_RET( m_menuBar, wxT("menubar can't be NULL after attaching") );
// unfortunately, we can't use m_menuBar->GetEventHandler() here because,
// if the menubar is currently showing a menu, its event handler is a
// we're probably going to crash in the caller anyhow, but try to detect
// this error as soon as possible
- wxASSERT_MSG( win, _T("menu without any associated window?") );
+ wxASSERT_MSG( win, wxT("menu without any associated window?") );
// also remember it in this menu so that we don't have to search for it the
// next time
wxRenderer *wxMenu::GetRenderer() const
{
// we're going to crash without renderer!
- wxCHECK_MSG( m_popupMenu, NULL, _T("neither popup nor menubar menu?") );
+ wxCHECK_MSG( m_popupMenu, NULL, wxT("neither popup nor menubar menu?") );
return m_popupMenu->GetRenderer();
}
if ( IsShown() )
{
// this would be a bug in IsShown()
- wxCHECK_RET( m_popupMenu, _T("must have popup window if shown!") );
+ wxCHECK_RET( m_popupMenu, wxT("must have popup window if shown!") );
// recalc geometry to update the item height and such
(void)GetGeometryInfo();
}
else
{
- wxFAIL_MSG( _T("parent menu not shown?") );
+ wxFAIL_MSG( wxT("parent menu not shown?") );
}
// and if we dismiss everything, propagate to parent
}
else // popup menu
{
- wxCHECK_RET( m_invokingWindow, _T("what kind of menu is this?") );
+ wxCHECK_RET( m_invokingWindow, wxT("what kind of menu is this?") );
m_invokingWindow->DismissPopupMenu();
// always keep the focus at the originating window
wxWindow *focus = GetRootWindow();
- wxASSERT_MSG( focus, _T("no window to keep focus on?") );
+ wxASSERT_MSG( focus, wxT("no window to keep focus on?") );
// and show it
m_popupMenu->Popup(focus);
void wxMenu::Dismiss()
{
- wxCHECK_RET( IsShown(), _T("can't dismiss hidden menu") );
+ wxCHECK_RET( IsShown(), wxT("can't dismiss hidden menu") );
m_popupMenu->Dismiss();
}
bool wxMenu::ProcessKeyDown(int key)
{
wxCHECK_MSG( m_popupMenu, false,
- _T("can't process key events if not shown") );
+ wxT("can't process key events if not shown") );
return m_popupMenu->ProcessKeyDown(key);
}
m_indexAccel = wxControl::FindAccelIndex(m_text);
// will be empty if the text contains no TABs - ok
- m_strAccel = m_text.AfterFirst(_T('\t'));
+ m_strAccel = m_text.AfterFirst(wxT('\t'));
}
void wxMenuItem::SetItemLabel(const wxString& text)
const wxMenuItemList& items = m_parentMenu->GetMenuItems();
int pos = items.IndexOf(this);
wxCHECK_RET( pos != wxNOT_FOUND,
- _T("menuitem not found in the menu items list?") );
+ wxT("menuitem not found in the menu items list?") );
// get the radio group range
int start,
void wxMenuItem::SetRadioGroupStart(int start)
{
wxASSERT_MSG( !m_isRadioGroupStart,
- _T("should only be called for the next radio items") );
+ wxT("should only be called for the next radio items") );
m_radioGroup.start = start;
}
void wxMenuItem::SetRadioGroupEnd(int end)
{
wxASSERT_MSG( m_isRadioGroupStart,
- _T("should only be called for the first radio item") );
+ wxT("should only be called for the first radio item") );
m_radioGroup.end = end;
}
void wxMenuBar::Attach(wxFrame *frame)
{
// maybe you really wanted to call Detach()?
- wxCHECK_RET( frame, _T("wxMenuBar::Attach(NULL) called") );
+ wxCHECK_RET( frame, wxT("wxMenuBar::Attach(NULL) called") );
wxMenuBarBase::Attach(frame);
void wxMenuBar::EnableTop(size_t pos, bool enable)
{
- wxCHECK_RET( pos < GetCount(), _T("invalid index in EnableTop") );
+ wxCHECK_RET( pos < GetCount(), wxT("invalid index in EnableTop") );
if ( enable != m_menuInfos[pos].IsEnabled() )
{
bool wxMenuBar::IsEnabledTop(size_t pos) const
{
- wxCHECK_MSG( pos < GetCount(), false, _T("invalid index in IsEnabledTop") );
+ wxCHECK_MSG( pos < GetCount(), false, wxT("invalid index in IsEnabledTop") );
return m_menuInfos[pos].IsEnabled();
}
void wxMenuBar::SetMenuLabel(size_t pos, const wxString& label)
{
- wxCHECK_RET( pos < GetCount(), _T("invalid index in SetMenuLabel") );
+ wxCHECK_RET( pos < GetCount(), wxT("invalid index in SetMenuLabel") );
if ( label != m_menuInfos[pos].GetOriginalLabel() )
{
wxString wxMenuBar::GetMenuLabel(size_t pos) const
{
- wxCHECK_MSG( pos < GetCount(), wxEmptyString, _T("invalid index in GetMenuLabel") );
+ wxCHECK_MSG( pos < GetCount(), wxEmptyString, wxT("invalid index in GetMenuLabel") );
return m_menuInfos[pos].GetOriginalLabel();
}
void wxMenuBar::RefreshItem(size_t pos)
{
wxCHECK_RET( pos != (size_t)-1,
- _T("invalid item in wxMenuBar::RefreshItem") );
+ wxT("invalid item in wxMenuBar::RefreshItem") );
if ( !IsCreated() )
{
wxRect wxMenuBar::GetItemRect(size_t pos) const
{
- wxASSERT_MSG( pos < GetCount(), _T("invalid menu bar item index") );
- wxASSERT_MSG( IsCreated(), _T("can't call this method yet") );
+ wxASSERT_MSG( pos < GetCount(), wxT("invalid menu bar item index") );
+ wxASSERT_MSG( IsCreated(), wxT("can't call this method yet") );
wxRect rect;
rect.x =
void wxMenuBar::SelectMenu(size_t pos)
{
SetFocus();
- wxLogTrace(_T("mousecapture"), _T("Capturing mouse from wxMenuBar::SelectMenu"));
+ wxLogTrace(wxT("mousecapture"), wxT("Capturing mouse from wxMenuBar::SelectMenu"));
CaptureMouse();
DoSelectMenu(pos);
void wxMenuBar::DoSelectMenu(size_t pos)
{
- wxCHECK_RET( pos < GetCount(), _T("invalid menu index in DoSelectMenu") );
+ wxCHECK_RET( pos < GetCount(), wxT("invalid menu index in DoSelectMenu") );
int posOld = m_current;
void wxMenuBar::PopupMenu(size_t pos)
{
- wxCHECK_RET( pos < GetCount(), _T("invalid menu index in PopupCurrentMenu") );
+ wxCHECK_RET( pos < GetCount(), wxT("invalid menu index in PopupCurrentMenu") );
SetFocus();
DoSelectMenu(pos);
}
else // on item
{
- wxLogTrace(_T("mousecapture"), _T("Capturing mouse from wxMenuBar::OnLeftDown"));
+ wxLogTrace(wxT("mousecapture"), wxT("Capturing mouse from wxMenuBar::OnLeftDown"));
CaptureMouse();
// show it as selected
{
// we always maintain a valid current item while we're in modal
// state (i.e. have the capture)
- wxFAIL_MSG( _T("how did we manage to lose current item?") );
+ wxFAIL_MSG( wxT("how did we manage to lose current item?") );
return;
}
void wxMenuBar::PopupCurrentMenu(bool selectFirst)
{
- wxCHECK_RET( m_current != -1, _T("no menu to popup") );
+ wxCHECK_RET( m_current != -1, wxT("no menu to popup") );
// forgot to call DismissMenu()?
- wxASSERT_MSG( !m_menuShown, _T("shouldn't show two menus at once!") );
+ wxASSERT_MSG( !m_menuShown, wxT("shouldn't show two menus at once!") );
// in any case, we should show it - even if we won't
m_shouldShowMenu = true;
void wxMenuBar::DismissMenu()
{
- wxCHECK_RET( m_menuShown, _T("can't dismiss menu if none is shown") );
+ wxCHECK_RET( m_menuShown, wxT("can't dismiss menu if none is shown") );
m_menuShown->Dismiss();
OnDismissMenu();
{
if ( ReleaseMouseCapture() )
{
- wxLogTrace(_T("mousecapture"), _T("Releasing mouse from wxMenuBar::OnDismiss"));
+ wxLogTrace(wxT("mousecapture"), wxT("Releasing mouse from wxMenuBar::OnDismiss"));
}
if ( m_current != -1 )
bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
{
wxCHECK_MSG( !ms_evtLoopPopup, false,
- _T("can't show more than one popup menu at a time") );
+ wxT("can't show more than one popup menu at a time") );
#ifdef __WXMSW__
// we need to change the cursor before showing the menu as, apparently, no
void wxWindow::DismissPopupMenu()
{
- wxCHECK_RET( ms_evtLoopPopup, _T("no popup menu shown") );
+ wxCHECK_RET( ms_evtLoopPopup, wxT("no popup menu shown") );
ms_evtLoopPopup->Exit();
}
wxString wxNotebook::GetPageText(size_t nPage) const
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), wxEmptyString, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), wxEmptyString, wxT("invalid notebook page") );
return m_titles[nPage];
}
bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), false, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("invalid notebook page") );
if ( strText != m_titles[nPage] )
{
int wxNotebook::GetPageImage(size_t nPage) const
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("invalid notebook page") );
return m_images[nPage];
}
bool wxNotebook::SetPageImage(size_t nPage, int nImage)
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), false, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("invalid notebook page") );
wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), false,
- _T("invalid image index in SetPageImage()") );
+ wxT("invalid image index in SetPageImage()") );
if ( nImage != m_images[nPage] )
{
int wxNotebook::DoSetSelection(size_t nPage, int flags)
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("invalid notebook page") );
if ( (size_t)nPage == m_sel )
{
{
size_t nPages = GetPageCount();
wxCHECK_MSG( nPage == nPages || IS_VALID_PAGE(nPage), false,
- _T("invalid notebook page in InsertPage()") );
+ wxT("invalid notebook page in InsertPage()") );
// modify the data
m_pages.Insert(pPage, nPage);
wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), NULL, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), NULL, wxT("invalid notebook page") );
wxNotebookPage *page = m_pages[nPage];
m_pages.RemoveAt(nPage);
void wxNotebook::RefreshTab(int page, bool forceSelected)
{
- wxCHECK_RET( IS_VALID_PAGE(page), _T("invalid notebook page") );
+ wxCHECK_RET( IS_VALID_PAGE(page), wxT("invalid notebook page") );
wxRect rect = GetTabRect(page);
if ( forceSelected || ((size_t)page == m_sel) )
switch ( GetTabOrientation() )
{
default:
- wxFAIL_MSG(_T("unknown tab orientation"));
+ wxFAIL_MSG(wxT("unknown tab orientation"));
// fall through
case wxTOP:
wxRect wxNotebook::GetTabRect(int page) const
{
wxRect rect;
- wxCHECK_MSG( IS_VALID_PAGE(page), rect, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(page), rect, wxT("invalid notebook page") );
// calc the size of this tab and of the preceding ones
wxCoord widthThis, widthBefore;
void wxNotebook::GetTabSize(int page, wxCoord *w, wxCoord *h) const
{
- wxCHECK_RET( w && h, _T("NULL pointer in GetTabSize") );
+ wxCHECK_RET( w && h, wxT("NULL pointer in GetTabSize") );
if ( IsVertical() )
{
void wxNotebook::SetTabSize(const wxSize& sz)
{
- wxCHECK_RET( FixedSizeTabs(), _T("SetTabSize() ignored") );
+ wxCHECK_RET( FixedSizeTabs(), wxT("SetTabSize() ignored") );
if ( IsVertical() )
{
wxSize size;
- wxCHECK_MSG( IS_VALID_PAGE(page), size, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(page), size, wxT("invalid notebook page") );
GetTextExtent(m_titles[page], &size.x, &size.y);
switch ( GetTabOrientation() )
{
default:
- wxFAIL_MSG(_T("unknown tab orientation"));
+ wxFAIL_MSG(wxT("unknown tab orientation"));
// fall through
case wxTOP:
void wxNotebook::ScrollTo(int page)
{
- wxCHECK_RET( IS_VALID_PAGE(page), _T("invalid notebook page") );
+ wxCHECK_RET( IS_VALID_PAGE(page), wxT("invalid notebook page") );
// set the first visible tab and offset (easy)
m_firstVisible = (size_t)page;
void wxNotebook::ScrollLastTo(int page)
{
- wxCHECK_RET( IS_VALID_PAGE(page), _T("invalid notebook page") );
+ wxCHECK_RET( IS_VALID_PAGE(page), wxT("invalid notebook page") );
// go backwards until we find the first tab which can be made visible
// without hiding the given one
ScrollTo(m_firstVisible);
// consitency check: the page we were asked to show should be shown
- wxASSERT_MSG( (size_t)page < m_lastVisible, _T("bug in ScrollLastTo") );
+ wxASSERT_MSG( (size_t)page < m_lastVisible, wxT("bug in ScrollLastTo") );
}
// ----------------------------------------------------------------------------
}
else
{
- wxFAIL_MSG( _T("you must specify wxRA_XXX style!") );
+ wxFAIL_MSG( wxT("you must specify wxRA_XXX style!") );
// use default
style = wxRA_SPECIFY_COLS | wxRA_LEFTTORIGHT;
void wxRadioBox::SetSelection(int n)
{
- wxCHECK_RET( IsValid(n), _T("invalid index in wxRadioBox::SetSelection") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxRadioBox::SetSelection") );
m_selection = n;
void wxRadioBox::SendRadioEvent()
{
- wxCHECK_RET( m_selection != -1, _T("no active radio button") );
+ wxCHECK_RET( m_selection != -1, wxT("no active radio button") );
wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, GetId());
InitCommandEvent(event);
void wxRadioBox::OnRadioButton(wxEvent& event)
{
int n = m_buttons.Index((wxRadioButton *)event.GetEventObject());
- wxCHECK_RET( n != wxNOT_FOUND, _T("click from alien radio button") );
+ wxCHECK_RET( n != wxNOT_FOUND, wxT("click from alien radio button") );
m_selection = n;
wxString wxRadioBox::GetString(unsigned int n) const
{
wxCHECK_MSG( IsValid(n), wxEmptyString,
- _T("invalid index in wxRadioBox::GetString") );
+ wxT("invalid index in wxRadioBox::GetString") );
return m_buttons[n]->GetLabel();
}
void wxRadioBox::SetString(unsigned int n, const wxString& label)
{
- wxCHECK_RET( IsValid(n), _T("invalid index in wxRadioBox::SetString") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxRadioBox::SetString") );
m_buttons[n]->SetLabel(label);
}
bool wxRadioBox::Enable(unsigned int n, bool enable)
{
- wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::Enable") );
+ wxCHECK_MSG( IsValid(n), false, wxT("invalid index in wxRadioBox::Enable") );
return m_buttons[n]->Enable(enable);
}
bool wxRadioBox::IsItemEnabled(unsigned int n) const
{
- wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::IsItemEnabled") );
+ wxCHECK_MSG( IsValid(n), false, wxT("invalid index in wxRadioBox::IsItemEnabled") );
return m_buttons[n]->IsEnabled();
}
bool wxRadioBox::Show(unsigned int n, bool show)
{
- wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::Show") );
+ wxCHECK_MSG( IsValid(n), false, wxT("invalid index in wxRadioBox::Show") );
return m_buttons[n]->Show(show);
}
bool wxRadioBox::IsItemShown(unsigned int n) const
{
- wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::IsItemShown") );
+ wxCHECK_MSG( IsValid(n), false, wxT("invalid index in wxRadioBox::IsItemShown") );
return m_buttons[n]->IsShown();
}
wxScrollArrows::~wxScrollArrows()
{
// it should have been destroyed
- wxASSERT_MSG( !m_captureData, _T("memory leak in wxScrollArrows") );
+ wxASSERT_MSG( !m_captureData, wxT("memory leak in wxScrollArrows") );
}
// ----------------------------------------------------------------------------
void wxScrollBar::SetThumbPosition(int pos)
{
- wxCHECK_RET( pos >= 0 && pos <= m_range, _T("thumb position out of range") );
+ wxCHECK_RET( pos >= 0 && pos <= m_range, wxT("thumb position out of range") );
DoSetThumb(pos);
}
case wxScrollBar::Element_Max:
default:
- wxFAIL_MSG( _T("unknown scrollbar element") );
+ wxFAIL_MSG( wxT("unknown scrollbar element") );
}
return rect;
// this is not supposed to happen as the button can't go up
// without going down previously and then we'd have
// m_winCapture by now
- wxFAIL_MSG( _T("logic error in mouse capturing code") );
+ wxFAIL_MSG( wxT("logic error in mouse capturing code") );
}
}
}
break;
default:
- wxFAIL_MSG(_T("unexpected shaft part in wxScrollThumbTimer"));
+ wxFAIL_MSG(wxT("unexpected shaft part in wxScrollThumbTimer"));
// fall through
case wxScrollThumb::Shaft_Below:
wxScrollThumb::~wxScrollThumb()
{
// it should have been destroyed
- wxASSERT_MSG( !m_captureData, _T("memory leak in wxScrollThumb") );
+ wxASSERT_MSG( !m_captureData, wxT("memory leak in wxScrollThumb") );
}
// ----------------------------------------------------------------------------
int wxScrollThumb::GetThumbPos(const wxMouseEvent& event) const
{
wxCHECK_MSG( m_captureData && m_captureData->m_shaftPart == Shaft_Thumb, 0,
- _T("can't be called when thumb is not dragged") );
+ wxT("can't be called when thumb is not dragged") );
int x = GetMouseCoord(event) - m_captureData->m_ofsMouse;
return m_control->PixelToThumbPos(x);
};
wxCHECK_MSG( index < (int)WXSIZEOF(s_mapSysToThemeCol), wxNullColour,
- _T("invalid wxSystemColour") );
+ wxT("invalid wxSystemColour") );
wxColourScheme::StdColour col = s_mapSysToThemeCol[index];
if ( col == wxColourScheme::MAX )
// this method is protected and we should only call it with normalized
// value!
- wxCHECK_MSG( IsInRange(value), false, _T("invalid slider value") );
+ wxCHECK_MSG( IsInRange(value), false, wxT("invalid slider value") );
m_value = value;
void wxSlider::SetLineSize(int lineSize)
{
- wxCHECK_RET( lineSize >= 0, _T("invalid slider line size") );
+ wxCHECK_RET( lineSize >= 0, wxT("invalid slider line size") );
m_lineSize = lineSize;
}
void wxSlider::SetPageSize(int pageSize)
{
- wxCHECK_RET( pageSize >= 0, _T("invalid slider page size") );
+ wxCHECK_RET( pageSize >= 0, wxT("invalid slider page size") );
m_pageSize = pageSize;
}
void wxSlider::SetThumbLength(int lenPixels)
{
- wxCHECK_RET( lenPixels >= 0, _T("invalid slider thumb size") );
+ wxCHECK_RET( lenPixels >= 0, wxT("invalid slider thumb size") );
// use m_thumbSize here directly and not GetThumbLength() to avoid setting
// it to the default value as we don't need it
void wxSlider::SetTickFreq(int n, int WXUNUSED(dummy))
{
- wxCHECK_RET (n > 0, _T("invalid slider tick frequency"));
+ wxCHECK_RET (n > 0, wxT("invalid slider tick frequency"));
if ( n != m_tickFreq )
{
// there is no sense in trying to calc the labels size if we haven't got
// any, the caller must check for it
- wxCHECK_MSG( HasLabels(), size, _T("shouldn't be called") );
+ wxCHECK_MSG( HasLabels(), size, wxT("shouldn't be called") );
wxCoord w1, h1, w2, h2;
GetTextExtent(FormatValue(m_min), &w1, &h1);
wxString wxSlider::FormatValue(int value) const
{
- return wxString::Format(_T("%d"), value);
+ return wxString::Format(wxT("%d"), value);
}
void wxSlider::DoDraw(wxControlRenderer *renderer)
void wxStatusBarUniv::SetStatusText(const wxString& text, int number)
{
wxCHECK_RET( number >= 0 && (size_t)number < m_panes.GetCount(),
- _T("invalid status bar field index in SetStatusText()") );
+ wxT("invalid status bar field index in SetStatusText()") );
if ( text == GetStatusText(number) )
{
bool wxStatusBarUniv::GetFieldRect(int n, wxRect& rect) const
{
wxCHECK_MSG( n >= 0 && (size_t)n < m_panes.GetCount(), false,
- _T("invalid field index in GetFieldRect()") );
+ wxT("invalid field index in GetFieldRect()") );
// this is a fix for a bug exhibited by the statbar sample: if
// GetFieldRect() is called from the derived class OnSize() handler, then
// it's the caller responsability to check this, if unsure - call
// GetFieldRect() instead
wxCHECK_MSG( !m_widthsAbs.IsEmpty(), rect,
- _T("can't be called if we don't have the widths") );
+ wxT("can't be called if we don't have the widths") );
for ( int i = 0; i <= n; i++ )
{
return Arrow_Down;
default:
- wxFAIL_MSG(_T("unknown arrow direction"));
+ wxFAIL_MSG(wxT("unknown arrow direction"));
}
return Arrow_Max;
break;
default:
- wxFAIL_MSG(_T("unknown border type"));
+ wxFAIL_MSG(wxT("unknown border type"));
// fall through
case wxBORDER_DEFAULT:
break;
#endif
default:
- wxFAIL_MSG(_T("unknown border type"));
+ wxFAIL_MSG(wxT("unknown border type"));
// fall through
case wxBORDER_DEFAULT:
wxRect flat = GetBorderDimensions(wxBORDER_STATIC);
wxASSERT_MSG( raised.x == raised.width && raised.y == raised.height &&
flat.x == flat.width && flat.y == flat.height,
- _T("this code expects uniform borders, you must override GetStatusBarBorders") );
+ wxT("this code expects uniform borders, you must override GetStatusBarBorders") );
// take the larger of flat/raised values:
wxSize border(wxMax(raised.x, flat.x), wxMax(raised.y, flat.y));
// ----------------------------------------------------------------------------
// names of text ctrl commands
-#define wxTEXT_COMMAND_INSERT _T("insert")
-#define wxTEXT_COMMAND_REMOVE _T("remove")
+#define wxTEXT_COMMAND_INSERT wxT("insert")
+#define wxTEXT_COMMAND_REMOVE wxT("remove")
// the value which is never used for text position, even not -1 which is
// sometimes used for some special meaning
// for the first one)
wxTextCoord GetRowStart(wxTextCoord row) const
{
- wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") );
+ wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") );
return row ? m_rowsStart[row - 1] : 0;
}
// be given to us)
wxTextCoord GetRowLength(wxTextCoord row, wxTextCoord lenLine) const
{
- wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") );
+ wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") );
// note that m_rowsStart[row] is the same as GetRowStart(row + 1) (but
// slightly more efficient) and lenLine is the same as the start of the
// return the width of the row in pixels
wxCoord GetRowWidth(wxTextCoord row) const
{
- wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") );
+ wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") );
return m_rowsWidth[row];
}
// return the number of rows
size_t GetRowCount() const
{
- wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") );
+ wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") );
return m_rowsStart.GetCount() + 1;
}
// return the number of additional (i.e. after the first one) rows
size_t GetExtraRowCount() const
{
- wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") );
+ wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") );
return m_rowsStart.GetCount();
}
// return the first row of this line
wxTextCoord GetFirstRow() const
{
- wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") );
+ wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") );
return m_rowFirst;
}
// return the first row of the next line
wxTextCoord GetNextRow() const
{
- wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") );
+ wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") );
return m_rowFirst + m_rowsStart.GetCount() + 1;
}
// this just provides direct access to m_rowsStart aerray for efficiency
wxTextCoord GetExtraRowStart(wxTextCoord row) const
{
- wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") );
+ wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") );
return m_rowsStart[row];
}
: GetRowStart(n + 1);
wxASSERT_MSG( colRowEnd < colNextRowStart,
- _T("this column is not in this row at all!") );
+ wxT("this column is not in this row at all!") );
return colRowEnd == colNextRowStart - 1;
}
}
// caller got it wrong
- wxFAIL_MSG( _T("this column is not in the start of the row!") );
+ wxFAIL_MSG( wxT("this column is not in the start of the row!") );
return false;
}
// we don't use these methods as they don't make sense for us as we need a
// wxTextCtrl to be applied
- virtual bool Do() { wxFAIL_MSG(_T("shouldn't be called")); return false; }
- virtual bool Undo() { wxFAIL_MSG(_T("shouldn't be called")); return false; }
+ virtual bool Do() { wxFAIL_MSG(wxT("shouldn't be called")); return false; }
+ virtual bool Undo() { wxFAIL_MSG(wxT("shouldn't be called")); return false; }
// instead, our command processor uses these methods
virtual bool Do(wxTextCtrl *text) = 0;
// we might support it but it's quite useless and other ports don't
// support it anyhow
wxASSERT_MSG( !(style & wxTE_PASSWORD),
- _T("wxTE_PASSWORD can't be used with multiline ctrls") );
+ wxT("wxTE_PASSWORD can't be used with multiline ctrls") );
}
RecalcFontMetrics();
size_t count = lines.GetCount();
for ( size_t n = 1; n < count; n++ )
{
- self->m_value << _T('\n') << lines[n];
+ self->m_value << wxT('\n') << lines[n];
}
}
!PositionToXY(from, &colStart, &lineStart) ||
!PositionToXY(to, &colEnd, &lineEnd) )
{
- wxFAIL_MSG(_T("invalid range in wxTextCtrl::Replace"));
+ wxFAIL_MSG(wxT("invalid range in wxTextCtrl::Replace"));
return;
}
if ( line > lineStart )
{
// from the previous line
- textOrig += _T('\n');
+ textOrig += wxT('\n');
}
textOrig += linesOld[line];
if ( (size_t)colStart == linesOld[lineStart].length() )
{
// text appended, refresh just enough to show the new text
- widthNewText = GetTextWidth(text.BeforeFirst(_T('\n')));
+ widthNewText = GetTextWidth(text.BeforeFirst(wxT('\n')));
}
else // text inserted, refresh till the end of line
{
for ( const wxChar *p = textNew.c_str(); ; p++ )
{
// end of line/text?
- if ( !*p || *p == _T('\n') )
+ if ( !*p || *p == wxT('\n') )
{
lines.Add(wxString(curLineStart, p));
if ( !*p )
#ifdef WXDEBUG_TEXT_REPLACE
// (3a) all empty tokens should be counted as replacing with "foo" and
// with "foo\n" should have different effects
- wxArrayString lines2 = wxStringTokenize(textNew, _T("\n"),
+ wxArrayString lines2 = wxStringTokenize(textNew, wxT("\n"),
wxTOKEN_RET_EMPTY_ALL);
if ( lines2.IsEmpty() )
}
wxASSERT_MSG( lines.GetCount() == lines2.GetCount(),
- _T("Replace() broken") );
+ wxT("Replace() broken") );
for ( size_t n = 0; n < lines.GetCount(); n++ )
{
- wxASSERT_MSG( lines[n] == lines2[n], _T("Replace() broken") );
+ wxASSERT_MSG( lines[n] == lines2[n], wxT("Replace() broken") );
}
#endif // WXDEBUG_TEXT_REPLACE
#ifdef WXDEBUG_TEXT_REPLACE
// optimized code above should give the same result as straightforward
// computation in the beginning
- wxASSERT_MSG( GetValue() == textTotalNew, _T("error in Replace()") );
+ wxASSERT_MSG( GetValue() == textTotalNew, wxT("error in Replace()") );
#endif // WXDEBUG_TEXT_REPLACE
// update the current position: note that we always put the cursor at the
void wxTextCtrl::SetInsertionPoint(wxTextPos pos)
{
wxCHECK_RET( pos >= 0 && pos <= GetLastPosition(),
- _T("insertion point position out of range") );
+ wxT("insertion point position out of range") );
// don't do anything if it didn't change
if ( pos != m_curPos )
void wxTextCtrl::MoveInsertionPoint(wxTextPos pos)
{
wxASSERT_MSG( pos >= 0 && pos <= GetLastPosition(),
- _T("DoSetInsertionPoint() can only be called with valid pos") );
+ wxT("DoSetInsertionPoint() can only be called with valid pos") );
m_curPos = pos;
PositionToXY(m_curPos, &m_curCol, &m_curRow);
}
// more probable reason of this would be to forget to update m_posLast
- wxASSERT_MSG( pos == m_posLast, _T("bug in GetLastPosition()") );
+ wxASSERT_MSG( pos == m_posLast, wxT("bug in GetLastPosition()") );
#endif // WXDEBUG_TEXT
pos = m_posLast;
{
// take the end of the first line
sel = GetLines()[lineStart].c_str() + colStart;
- sel += _T('\n');
+ sel += wxT('\n');
// all intermediate ones
for ( wxTextCoord line = lineStart + 1; line < lineEnd; line++ )
{
- sel << GetLines()[line] << _T('\n');
+ sel << GetLines()[line] << wxT('\n');
}
// and the start of the last one
OrderPositions(from, to);
wxCHECK_RET( to <= GetLastPosition(),
- _T("invalid range in wxTextCtrl::SetSelection") );
+ wxT("invalid range in wxTextCtrl::SetSelection") );
if ( from != m_selStart || to != m_selEnd )
{
m_selStart = from;
m_selEnd = to;
- wxLogTrace(_T("text"), _T("Selection range is %ld-%ld"),
+ wxLogTrace(wxT("text"), wxT("Selection range is %ld-%ld"),
m_selStart, m_selEnd);
// refresh only the part of text which became (un)selected if
{
if ( IsSingleLine() )
{
- wxASSERT_MSG( line == 0, _T("invalid GetLineLength() parameter") );
+ wxASSERT_MSG( line == 0, wxT("invalid GetLineLength() parameter") );
return m_value.length();
}
else // multiline
{
wxCHECK_MSG( (size_t)line < GetLineCount(), -1,
- _T("line index out of range") );
+ wxT("line index out of range") );
return GetLines()[line].length();
}
{
if ( IsSingleLine() )
{
- wxASSERT_MSG( line == 0, _T("invalid GetLineLength() parameter") );
+ wxASSERT_MSG( line == 0, wxT("invalid GetLineLength() parameter") );
return m_value;
}
if (line == 0 && GetLineCount() == 0) return wxEmptyString ;
wxCHECK_MSG( (size_t)line < GetLineCount(), wxEmptyString,
- _T("line index out of range") );
+ wxT("line index out of range") );
return GetLines()[line];
}
#ifdef WXDEBUG_TEXT
wxASSERT_MSG( XYToPosition(pos - posCur, nLine) == pos,
- _T("XYToPosition() or PositionToXY() broken") );
+ wxT("XYToPosition() or PositionToXY() broken") );
#endif // WXDEBUG_TEXT
return true;
wxCoord xCaret, yCaret;
if ( !PositionToDeviceXY(m_curPos, &xCaret, &yCaret) )
{
- wxFAIL_MSG( _T("Caret can't be beyond the text!") );
+ wxFAIL_MSG( wxT("Caret can't be beyond the text!") );
}
return wxPoint(xCaret, yCaret);
bool wxTextCtrlInsertCommand::Undo(wxTextCtrl *text)
{
- wxCHECK_MSG( CanUndo(), false, _T("impossible to undo insert cmd") );
+ wxCHECK_MSG( CanUndo(), false, wxT("impossible to undo insert cmd") );
// remove the text from where we inserted it
text->Remove(m_from, m_from + m_text.length());
void wxTextCtrl::Undo()
{
// the caller must check it
- wxASSERT_MSG( CanUndo(), _T("can't call Undo() if !CanUndo()") );
+ wxASSERT_MSG( CanUndo(), wxT("can't call Undo() if !CanUndo()") );
m_cmdProcessor->Undo();
}
void wxTextCtrl::Redo()
{
// the caller must check it
- wxASSERT_MSG( CanRedo(), _T("can't call Undo() if !CanUndo()") );
+ wxASSERT_MSG( CanRedo(), wxT("can't call Undo() if !CanUndo()") );
m_cmdProcessor->Redo();
}
case wxTE_HT_BELOW:
*/
default:
- wxFAIL_MSG(_T("unexpected HitTestLine() return value"));
+ wxFAIL_MSG(wxT("unexpected HitTestLine() return value"));
// fall through
case wxTE_HT_ON_TEXT:
// SData().m_colStart, we need an absolute offset into string
SData().m_colLastVisible += SData().m_colStart;
- wxLogTrace(_T("text"), _T("Last visible column/position is %d/%ld"),
+ wxLogTrace(wxT("text"), wxT("Last visible column/position is %d/%ld"),
(int) SData().m_colLastVisible, (long) SData().m_posLastVisible);
}
wxTextCoord col,
wxTextCoord *colRowStart) const
{
- wxASSERT_MSG( WrapLines(), _T("shouldn't be called") );
+ wxASSERT_MSG( WrapLines(), wxT("shouldn't be called") );
const wxWrappedLineData& lineData = WData().m_linesData[line];
*colRowStart = lineData.GetRowStart(row);
// this can't happen, of course
- wxASSERT_MSG( *colRowStart <= col, _T("GetRowInLine() is broken") );
+ wxASSERT_MSG( *colRowStart <= col, wxT("GetRowInLine() is broken") );
}
return row;
void wxTextCtrl::LayoutLines(wxTextCoord lineLast) const
{
- wxASSERT_MSG( WrapLines(), _T("should only be used for line wrapping") );
+ wxASSERT_MSG( WrapLines(), wxT("should only be used for line wrapping") );
// if we were called, some line was dirty and if it was dirty we must have
// had m_rowFirstInvalid set to something too
wxTextCoord lineFirst = WData().m_rowFirstInvalid;
- wxASSERT_MSG( lineFirst != -1, _T("nothing to layout?") );
+ wxASSERT_MSG( lineFirst != -1, wxT("nothing to layout?") );
wxTextCoord rowFirst, rowCur;
if ( lineFirst )
wxCoord *widthReal) const
{
// this function is slow, it shouldn't be called unless really needed
- wxASSERT_MSG( WrapLines(), _T("shouldn't be called") );
+ wxASSERT_MSG( WrapLines(), wxT("shouldn't be called") );
wxString s(text);
wxTextCoord col;
case wxTE_HT_BELOW:
*/
default:
- wxFAIL_MSG(_T("unexpected HitTestLine() return value"));
+ wxFAIL_MSG(wxT("unexpected HitTestLine() return value"));
// fall through
case wxTE_HT_ON_TEXT:
}
// this is not supposed to happen
- wxASSERT_MSG( matchDir, _T("logic error in wxTextCtrl::HitTest") );
+ wxASSERT_MSG( matchDir, wxT("logic error in wxTextCtrl::HitTest") );
if ( matchDir == Match_Right )
col++;
dc.GetTextExtent(text, &width2, NULL);
wxASSERT_MSG( (width1 <= x) && (x < width2),
- _T("incorrect HitTestLine() result") );
+ wxT("incorrect HitTestLine() result") );
}
else // we return last char
{
- wxASSERT_MSG( x >= width1, _T("incorrect HitTestLine() result") );
+ wxASSERT_MSG( x >= width1, wxT("incorrect HitTestLine() result") );
}
}
#endif // WXDEBUG_TEXT
void wxTextCtrl::ShowHorzPosition(wxCoord pos)
{
- wxASSERT_MSG( IsSingleLine(), _T("doesn't work for multiline") );
+ wxASSERT_MSG( IsSingleLine(), wxT("doesn't work for multiline") );
// pos is the logical position to show
void wxTextCtrl::ScrollText(wxTextCoord col)
{
wxASSERT_MSG( IsSingleLine(),
- _T("ScrollText() is for single line controls only") );
+ wxT("ScrollText() is for single line controls only") );
// never scroll beyond the left border
if ( col < 0 )
void wxTextCtrl::RecalcMaxWidth()
{
- wxASSERT_MSG( !IsSingleLine(), _T("only used for multiline") );
+ wxASSERT_MSG( !IsSingleLine(), wxT("only used for multiline") );
MData().m_widthMax = -1;
(void)GetMaxWidth();
}
}
- wxASSERT_MSG( MData().m_widthMax != -1, _T("should have at least 1 line") );
+ wxASSERT_MSG( MData().m_widthMax != -1, wxT("should have at least 1 line") );
return MData().m_widthMax;
}
void wxTextCtrl::UpdateScrollbars()
{
- wxASSERT_MSG( !IsSingleLine(), _T("only used for multiline") );
+ wxASSERT_MSG( !IsSingleLine(), wxT("only used for multiline") );
wxSize size = GetRealTextArea().GetSize();
void wxTextCtrl::RefreshLineRange(wxTextCoord lineFirst, wxTextCoord lineLast)
{
wxASSERT_MSG( lineFirst <= lineLast || !lineLast,
- _T("no lines to refresh") );
+ wxT("no lines to refresh") );
wxRect rect;
// rect.x is already 0
// lineFirst may be beyond the last line only if we refresh till
// the end, otherwise it's illegal
wxASSERT_MSG( lineFirst == GetNumberOfLines() && !lineLast,
- _T("invalid line range") );
+ wxT("invalid line range") );
rowFirst = GetRowAfterLine(lineFirst - 1);
}
void wxTextCtrl::RefreshTextRange(wxTextPos start, wxTextPos end)
{
wxCHECK_RET( start != -1 && end != -1,
- _T("invalid RefreshTextRange() arguments") );
+ wxT("invalid RefreshTextRange() arguments") );
// accept arguments in any order as it is more conenient for the caller
OrderPositions(start, end);
wxString text = GetLineText(line);
wxASSERT_MSG( (size_t)start <= text.length() && count,
- _T("invalid RefreshColRange() parameter") );
+ wxT("invalid RefreshColRange() parameter") );
RefreshPixelRange(line,
GetTextWidth(text.Left((size_t)start)),
if ( rect.y < m_rectText.y )
rect.y = m_rectText.y;
- wxLogTrace(_T("text"), _T("Refreshing (%d, %d)-(%d, %d)"),
+ wxLogTrace(wxT("text"), wxT("Refreshing (%d, %d)-(%d, %d)"),
rect.x, rect.y, rect.x + rect.width, rect.y + rect.height);
Refresh(true, &rect);
{
wxString textShown;
if ( IsPassword() )
- textShown = wxString(_T('*'), text.length());
+ textShown = wxString(wxT('*'), text.length());
else
textShown = text;
if ( (ht == wxTE_HT_BEYOND) || (ht == wxTE_HT_BELOW) )
{
- wxASSERT_MSG( line <= lineEnd, _T("how did we get that far?") );
+ wxASSERT_MSG( line <= lineEnd, wxT("how did we get that far?") );
if ( line == lineEnd )
{
}
// calculate the text coords on screen
- wxASSERT_MSG( colStart >= colRowStart, _T("invalid string part") );
+ wxASSERT_MSG( colStart >= colRowStart, wxT("invalid string part") );
wxCoord ofsStart = GetTextWidth(
textLine.Mid(colRowStart,
colStart - colRowStart));
// do draw the text
renderer->DrawTextLine(dc, text, rectText, selStart, selEnd,
GetStateFlags());
- wxLogTrace(_T("text"), _T("Line %ld: positions %ld-%ld redrawn."),
+ wxLogTrace(wxT("text"), wxT("Line %ld: positions %ld-%ld redrawn."),
line, colStart, colEnd);
}
}
void wxTextCtrl::DoDrawLineWrapMarks(wxDC& dc, const wxRect& rectUpdate)
{
wxASSERT_MSG( WrapLines() && WData().m_widthMark,
- _T("shouldn't be called at all") );
+ wxT("shouldn't be called at all") );
wxRenderer *renderer = GetRenderer();
wxTextPos wxTextCtrl::GetPositionAbove()
{
wxCHECK_MSG( !IsSingleLine(), INVALID_POS_VALUE,
- _T("can't move cursor vertically in a single line control") );
+ wxT("can't move cursor vertically in a single line control") );
// move the cursor up by one ROW not by one LINE: this means that
// we should really use HitTest() and not just go to the same
wxTextPos wxTextCtrl::GetPositionBelow()
{
wxCHECK_MSG( !IsSingleLine(), INVALID_POS_VALUE,
- _T("can't move cursor vertically in a single line control") );
+ wxT("can't move cursor vertically in a single line control") );
// see comments for wxACTION_TEXT_UP
wxPoint pt = GetCaretPosition() - m_rectText.GetPosition();
if ( textChanged )
{
- wxASSERT_MSG( IsEditable(), _T("non editable control changed?") );
+ wxASSERT_MSG( IsEditable(), wxT("non editable control changed?") );
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId());
InitCommandEvent(event);
}
else // interpret <Enter> normally: insert new line
{
- PerformAction(wxACTION_TEXT_INSERT, -1, _T('\n'));
+ PerformAction(wxACTION_TEXT_INSERT, -1, wxT('\n'));
}
}
else if ( keycode < 255 && isprint(keycode) )
{
if ( event.LeftDown() )
{
- wxASSERT_MSG( !m_winCapture, _T("left button going down twice?") );
+ wxASSERT_MSG( !m_winCapture, wxT("left button going down twice?") );
wxTextCtrl *text = wxStaticCast(consumer->GetInputWindow(), wxTextCtrl);
wxString nameDefTheme;
// use the environment variable first
- const wxChar *p = wxGetenv(_T("WXTHEME"));
+ const wxChar *p = wxGetenv(wxT("WXTHEME"));
if ( p )
{
nameDefTheme = p;
case MAX:
default:
- wxFAIL_MSG(_T("invalid standard colour"));
+ wxFAIL_MSG(wxT("invalid standard colour"));
return *wxBLACK;
}
}
break;
default:
- wxFAIL_MSG(_T("unknown rectangle side"));
+ wxFAIL_MSG(wxT("unknown rectangle side"));
}
}
wxBitmap bmpLineWrap(line_wrap_bits, line_wrap_width, line_wrap_height);
if ( !bmpLineWrap.Ok() )
{
- wxFAIL_MSG( _T("Failed to create line wrap XBM") );
+ wxFAIL_MSG( wxT("Failed to create line wrap XBM") );
}
else
{
switch ( dir )
{
default:
- wxFAIL_MSG(_T("invaild notebook tab orientation"));
+ wxFAIL_MSG(wxT("invaild notebook tab orientation"));
// fall through
case wxTOP:
if ( !accel.empty() )
{
// menubar items shouldn't have them
- wxCHECK_RET( geometryInfo, _T("accel strings only valid for menus") );
+ wxCHECK_RET( geometryInfo, wxT("accel strings only valid for menus") );
rect.x = geometryInfo->GetAccelOffset();
rect.SetRight(geometryInfo->GetSize().x);
// draw the submenu indicator
if ( flags & wxCONTROL_ISSUBMENU )
{
- wxCHECK_RET( geometryInfo, _T("wxCONTROL_ISSUBMENU only valid for menus") );
+ wxCHECK_RET( geometryInfo, wxT("wxCONTROL_ISSUBMENU only valid for menus") );
rect.x = geometryInfo->GetSize().x - MENU_RIGHT_MARGIN;
rect.width = MENU_RIGHT_MARGIN;
break;
default:
- wxFAIL_MSG(_T("unknown arrow direction"));
+ wxFAIL_MSG(wxT("unknown arrow direction"));
return;
}
break;
default:
- wxFAIL_MSG(_T("unknown arrow direction"));
+ wxFAIL_MSG(wxT("unknown arrow direction"));
}
dc.DrawPolygon(WXSIZEOF(ptArrow), ptArrow);
break;
default:
- wxFAIL_MSG(_T("unknown arrow direction"));
+ wxFAIL_MSG(wxT("unknown arrow direction"));
return;
}
}
class wxMetalTheme : public wxDelegateTheme
{
public:
- wxMetalTheme() : wxDelegateTheme(_T("win32")), m_renderer(NULL) {}
+ wxMetalTheme() : wxDelegateTheme(wxT("win32")), m_renderer(NULL) {}
~wxMetalTheme() { delete m_renderer; }
protected:
case wxDOWN: arrowDir = Arrow_Down; break;
default:
- wxFAIL_MSG(_T("unknown arrow direction"));
+ wxFAIL_MSG(wxT("unknown arrow direction"));
return;
}
case MAX:
default:
- wxFAIL_MSG(_T("invalid standard colour"));
+ wxFAIL_MSG(wxT("invalid standard colour"));
// fall through
case SHADOW_DARK:
break;
*/
default:
- wxFAIL_MSG(_T("unknown border type"));
+ wxFAIL_MSG(wxT("unknown border type"));
// fall through
case wxBORDER_DEFAULT:
long WXUNUSED(style),
int WXUNUSED(tbarStyle))
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
}
wxSize wxMonoRenderer::GetToolBarButtonSize(wxCoord *WXUNUSED(separator)) const
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
return wxSize();
}
wxSize wxMonoRenderer::GetToolBarMargin() const
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
return wxSize();
}
int WXUNUSED(flags),
int WXUNUSED(indexAccel))
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
}
wxSize wxMonoRenderer::GetTabIndent() const
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
return wxSize();
}
wxSize wxMonoRenderer::GetTabPadding() const
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
return wxSize();
}
wxBitmap *WXUNUSED(bmpPressed),
wxBitmap *WXUNUSED(bmpDisabled))
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
}
#endif // wxUSE_COMBOBOX
int WXUNUSED(flags),
int WXUNUSED(indexAccel))
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
}
void wxMonoRenderer::DrawMenuItem(wxDC& WXUNUSED(dc),
int WXUNUSED(flags),
int WXUNUSED(indexAccel))
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
}
void wxMonoRenderer::DrawMenuSeparator(wxDC& WXUNUSED(dc),
wxCoord WXUNUSED(y),
const wxMenuGeometryInfo& WXUNUSED(geomInfo))
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
}
wxSize wxMonoRenderer::GetMenuBarItemSize(const wxSize& WXUNUSED(sizeText)) const
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
return wxSize();
}
wxMenuGeometryInfo *wxMonoRenderer::GetMenuGeometry(wxWindow *WXUNUSED(win),
const wxMenu& WXUNUSED(menu)) const
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
return NULL;
}
long WXUNUSED(style),
wxRect *WXUNUSED(rectShaft))
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
}
int WXUNUSED(flags),
long WXUNUSED(style))
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
}
void wxMonoRenderer::DrawSliderTicks(wxDC& WXUNUSED(dc),
int WXUNUSED(flags),
long WXUNUSED(style))
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
}
wxCoord wxMonoRenderer::GetSliderDim() const
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
return 0;
}
wxCoord wxMonoRenderer::GetSliderTickLen() const
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
return 0;
}
wxOrientation WXUNUSED(orient),
long WXUNUSED(style)) const
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
return wxRect();
}
int WXUNUSED(lenThumb),
wxOrientation WXUNUSED(orient)) const
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
return wxSize();
}
wxSize wxMonoRenderer::GetProgressBarStep() const
{
- wxFAIL_MSG(_T("TODO"));
+ wxFAIL_MSG(wxT("TODO"));
return wxSize();
}
int WXUNUSED(flags))
{
ArrowDirection arrowDir = GetArrowDirection(dir);
- wxCHECK_RET( arrowDir != Arrow_Max, _T("invalid arrow direction") );
+ wxCHECK_RET( arrowDir != Arrow_Max, wxT("invalid arrow direction") );
wxBitmap& bmp = m_bmpArrows[arrowDir];
if ( !bmp.Ok() )
case MAX:
default:
- wxFAIL_MSG(_T("invalid standard colour"));
+ wxFAIL_MSG(wxT("invalid standard colour"));
return *wxBLACK;
}
}
int indexAccel)
{
wxString label2;
- label2 << _T(' ') << label << _T(' ');
+ label2 << wxT(' ') << label << wxT(' ');
if ( indexAccel != -1 )
{
// adjust it as we prepended a space
switch ( dir )
{
default:
- wxFAIL_MSG(_T("invaild notebook tab orientation"));
+ wxFAIL_MSG(wxT("invaild notebook tab orientation"));
// fall through
case wxTOP:
parentTLW = wxDynamicCast(statbar->GetParent(), wxTopLevelWindow);
wxCHECK_MSG( parentTLW, false,
- _T("the status bar should be a child of a TLW") );
+ wxT("the status bar should be a child of a TLW") );
// a maximized window can't be resized anyhow
if ( !parentTLW->IsMaximized() )
void wxWin32SystemMenuEvtHandler::Attach(wxInputConsumer *consumer)
{
- wxASSERT_MSG( m_wnd == NULL, _T("can't attach the handler twice!") );
+ wxASSERT_MSG( m_wnd == NULL, wxT("can't attach the handler twice!") );
m_wnd = wxStaticCast(consumer->GetInputWindow(), wxTopLevelWindow);
m_wnd->PushEventHandler(this);
{
wxToolBarToolBase *tool = FindById(id);
- wxCHECK_RET( tool, _T("SetToolShortHelp: no such tool") );
+ wxCHECK_RET( tool, wxT("SetToolShortHelp: no such tool") );
tool->SetShortHelp(help);
}
wxRect rect;
- wxCHECK_MSG( tool, rect, _T("GetToolRect: NULL tool") );
+ wxCHECK_MSG( tool, rect, wxT("GetToolRect: NULL tool") );
// ensure that we always have the valid tool position
if ( m_needsLayout )
void wxToolBar::DoLayout()
{
- wxASSERT_MSG( m_needsLayout, _T("why are we called?") );
+ wxASSERT_MSG( m_needsLayout, wxT("why are we called?") );
m_needsLayout = false;
wxCoord *start,
wxCoord *end) const
{
- wxCHECK_RET( start && end, _T("NULL pointer in GetRectLimits") );
+ wxCHECK_RET( start && end, wxT("NULL pointer in GetRectLimits") );
if ( IsVertical() )
{
}
else if ( action == wxACTION_TOOLBAR_PRESS )
{
- wxLogTrace(_T("toolbar"), _T("Button '%s' pressed."), tool->GetShortHelp().c_str());
+ wxLogTrace(wxT("toolbar"), wxT("Button '%s' pressed."), tool->GetShortHelp().c_str());
tool->Invert();
}
else if ( action == wxACTION_TOOLBAR_RELEASE )
{
- wxLogTrace(_T("toolbar"), _T("Button '%s' released."), tool->GetShortHelp().c_str());
+ wxLogTrace(wxT("toolbar"), wxT("Button '%s' released."), tool->GetShortHelp().c_str());
- wxASSERT_MSG( tool->IsInverted(), _T("release unpressed button?") );
+ wxASSERT_MSG( tool->IsInverted(), wxT("release unpressed button?") );
if(tool->IsInverted())
{
}
else if ( action == wxACTION_TOOLBAR_ENTER )
{
- wxCHECK_MSG( tool, false, _T("no tool to enter?") );
+ wxCHECK_MSG( tool, false, wxT("no tool to enter?") );
if ( HasFlag(wxTB_FLAT) && tool->IsEnabled() )
{
}
else if ( action == wxACTION_TOOLBAR_LEAVE )
{
- wxCHECK_MSG( tool, false, _T("no tool to leave?") );
+ wxCHECK_MSG( tool, false, wxT("no tool to leave?") );
if ( HasFlag(wxTB_FLAT) && tool->IsEnabled() )
{
void wxTopLevelWindow::UseNativeDecorations(bool native)
{
- wxASSERT_MSG( !m_windowStyle, _T("must be called before Create()") );
+ wxASSERT_MSG( !m_windowStyle, wxT("must be called before Create()") );
m_usingNativeDecorations = native;
}
{
#if wxUSE_SCROLLBAR
wxASSERT_MSG( pageSize <= range,
- _T("page size can't be greater than range") );
+ wxT("page size can't be greater than range") );
bool hasClientSizeChanged = false;
wxScrollBar *scrollbar = GetScrollbar(orient);
wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal)
{
- wxASSERT_MSG( !dx || !dy, _T("can't be used for diag scrolling") );
+ wxASSERT_MSG( !dx || !dy, wxT("can't be used for diag scrolling") );
// the rect to refresh (which we will calculate)
wxRect rect;
// location
wxSize sizeTotal = rectTotal ? rectTotal->GetSize() : GetClientSize();
- wxLogTrace(_T("scroll"), _T("rect is %dx%d, scroll by %d, %d"),
+ wxLogTrace(wxT("scroll"), wxT("rect is %dx%d, scroll by %d, %d"),
sizeTotal.x, sizeTotal.y, dx, dy);
// the initial and end point of the region we move in client coords
if ( size.x <= 0 || size.y <= 0 )
{
// just redraw everything as nothing of the displayed image will stay
- wxLogTrace(_T("scroll"), _T("refreshing everything"));
+ wxLogTrace(wxT("scroll"), wxT("refreshing everything"));
rect = rectTotal ? *rectTotal : wxRect(0, 0, sizeTotal.x, sizeTotal.y);
}
);
dc.Blit(ptDest, size, &dcMem, wxPoint(0,0));
- wxLogTrace(_T("scroll"),
- _T("Blit: (%d, %d) of size %dx%d -> (%d, %d)"),
+ wxLogTrace(wxT("scroll"),
+ wxT("Blit: (%d, %d) of size %dx%d -> (%d, %d)"),
ptSource.x, ptSource.y,
size.x, size.y,
ptDest.x, ptDest.y);
rect.height = sizeTotal.y;
- wxLogTrace(_T("scroll"), _T("refreshing (%d, %d)-(%d, %d)"),
+ wxLogTrace(wxT("scroll"), wxT("refreshing (%d, %d)-(%d, %d)"),
rect.x, rect.y,
rect.GetRight() + 1, rect.GetBottom() + 1);
}
rect.width = sizeTotal.x;
- wxLogTrace(_T("scroll"), _T("refreshing (%d, %d)-(%d, %d)"),
+ wxLogTrace(wxT("scroll"), wxT("refreshing (%d, %d)-(%d, %d)"),
rect.x, rect.y,
rect.GetRight() + 1, rect.GetBottom() + 1);
}
virtual void Notify()
{
- wxLogTrace(_T("dialup"), wxT("Checking dial up network status."));
+ wxLogTrace(wxT("dialup"), wxT("Checking dial up network status."));
m_dupman->CheckStatus();
}
m_BeaconPort = 80;
#ifdef __SGI__
- m_ConnectCommand = _T("/usr/etc/ppp");
+ m_ConnectCommand = wxT("/usr/etc/ppp");
#elif defined(__LINUX__)
// default values for Debian/GNU linux
- m_ConnectCommand = _T("pon");
- m_HangUpCommand = _T("poff");
+ m_ConnectCommand = wxT("pon");
+ m_HangUpCommand = wxT("poff");
#endif
- wxChar * dial = wxGetenv(_T("WXDIALUP_DIALCMD"));
- wxChar * hup = wxGetenv(_T("WXDIALUP_HUPCMD"));
+ wxChar * dial = wxGetenv(wxT("WXDIALUP_DIALCMD"));
+ wxChar * hup = wxGetenv(wxT("WXDIALUP_HUPCMD"));
SetConnectCommand(dial ? wxString(dial) : m_ConnectCommand,
hup ? wxString(hup) : m_HangUpCommand);
}
break;
default:
- wxFAIL_MSG(_T("Unexpected netDeviceType"));
+ wxFAIL_MSG(wxT("Unexpected netDeviceType"));
}
}
int netDevice = NetDevice_Unknown;
#ifdef __LINUX__
- if (wxFileExists(_T("/proc/net/route")))
+ if (wxFileExists(wxT("/proc/net/route")))
{
// cannot use wxFile::Length because file doesn't support seeking, so
// use stdio directly
{
static const wxChar *ifconfigLocations[] =
{
- _T("/sbin"), // Linux, FreeBSD, Darwin
- _T("/usr/sbin"), // SunOS, Solaris, AIX, HP-UX
- _T("/usr/etc"), // IRIX
- _T("/etc"), // AIX 5
+ wxT("/sbin"), // Linux, FreeBSD, Darwin
+ wxT("/usr/sbin"), // SunOS, Solaris, AIX, HP-UX
+ wxT("/usr/etc"), // IRIX
+ wxT("/etc"), // AIX 5
};
for ( size_t n = 0; n < WXSIZEOF(ifconfigLocations); n++ )
{
wxString path(ifconfigLocations[n]);
- path << _T("/ifconfig");
+ path << wxT("/ifconfig");
if ( wxFileExists(path) )
{
wxLogNull ln; // suppress all error messages
wxASSERT_MSG( m_IfconfigPath.length(),
- _T("can't use ifconfig if it wasn't found") );
+ wxT("can't use ifconfig if it wasn't found") );
wxString tmpfile = wxFileName::CreateTempFileName( wxT("_wxdialuptest") );
wxString cmd = wxT("/bin/sh -c \'");
if (wxFileExists( wxT("SYS$SYSTEM:TCPIP$PING.EXE") ))
m_PingPath = wxT("$SYS$SYSTEM:TCPIP$PING");
#elif defined(__AIX__)
- m_PingPath = _T("/etc/ping");
+ m_PingPath = wxT("/etc/ping");
#elif defined(__SGI__)
- m_PingPath = _T("/usr/etc/ping");
+ m_PingPath = wxT("/usr/etc/ping");
#else
if (wxFileExists( wxT("/bin/ping") ))
m_PingPath = wxT("/bin/ping");
// throw away the trailing slashes
size_t n = m_dirname.length();
- wxCHECK_RET( n, _T("empty dir name in wxDir") );
+ wxCHECK_RET( n, wxT("empty dir name in wxDir") );
while ( n > 0 && m_dirname[--n] == '/' )
;
{
if ( closedir(m_dir) != 0 )
{
- wxLogLastError(_T("closedir"));
+ wxLogLastError(wxT("closedir"));
}
}
}
// speed up string concatenation in the loop a bit
wxString path = m_dirname;
- path += _T('/');
+ path += wxT('/');
path.reserve(path.length() + 255);
wxString de_d_name;
wxDirData::wxDirData(const wxString& WXUNUSED(dirname))
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(wxT("not implemented"));
}
wxDirData::~wxDirData()
if ( m_data )
{
name = M_DIR->GetName();
- if ( !name.empty() && (name.Last() == _T('/')) )
+ if ( !name.empty() && (name.Last() == wxT('/')) )
{
// chop off the last (back)slash
name.Truncate(name.length() - 1);
const wxString& filespec,
int flags) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
M_DIR->Rewind();
bool wxDir::GetNext(wxString *filename) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
- wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") );
+ wxCHECK_MSG( filename, false, wxT("bad pointer in wxDir::GetNext()") );
return M_DIR->Read(filename);
}
bool wxDir::HasSubDirs(const wxString& spec) const
{
- wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") );
if ( spec.empty() )
{
void wxClientDisplayRect(int *x, int *y, int *width, int *height)
{
Display * const dpy = wxGetX11Display();
- wxCHECK_RET( dpy, _T("can't be called before initializing the GUI") );
+ wxCHECK_RET( dpy, wxT("can't be called before initializing the GUI") );
const Atom atomWorkArea = XInternAtom(dpy, "_NET_WORKAREA", True);
if ( atomWorkArea )
format != 32 ||
numItems != 4 )
{
- wxLogDebug(_T("XGetWindowProperty(\"_NET_WORKAREA\") failed"));
+ wxLogDebug(wxT("XGetWindowProperty(\"_NET_WORKAREA\") failed"));
return;
}
wxDllType wxDynamicLibrary::RawLoad(const wxString& libname, int flags)
{
wxASSERT_MSG( !(flags & wxDL_NOW) || !(flags & wxDL_LAZY),
- _T("wxDL_LAZY and wxDL_NOW are mutually exclusive.") );
+ wxT("wxDL_LAZY and wxDL_NOW are mutually exclusive.") );
#ifdef USE_POSIX_DL_FUNCS
// we need to use either RTLD_NOW or RTLD_LAZY because if we call dlopen()
{
wxDynamicLibraryDetails *details = new wxDynamicLibraryDetails;
details->m_path = path;
- details->m_name = path.AfterLast(_T('/'));
+ details->m_name = path.AfterLast(wxT('/'));
details->m_address = start;
details->m_length = (char *)end - (char *)start;
// try to extract the library version from its name
- const size_t posExt = path.rfind(_T(".so"));
+ const size_t posExt = path.rfind(wxT(".so"));
if ( posExt != wxString::npos )
{
- if ( path.c_str()[posExt + 3] == _T('.') )
+ if ( path.c_str()[posExt + 3] == wxT('.') )
{
// assume "libfoo.so.x.y.z" case
details->m_version.assign(path, posExt + 4, wxString::npos);
}
else
{
- size_t posDash = path.find_last_of(_T('-'), posExt);
+ size_t posDash = path.find_last_of(wxT('-'), posExt);
if ( posDash != wxString::npos )
{
// assume "libbar-x.y.z.so" case
#ifdef __LINUX__
// examine /proc/self/maps to find out what is loaded in our address space
- wxFFile file(_T("/proc/self/maps"));
+ wxFFile file(wxT("/proc/self/maps"));
if ( file.IsOpened() )
{
// details of the module currently being parsed
default:
// chop '\n'
buf[strlen(buf) - 1] = '\0';
- wxLogDebug(_T("Failed to parse line \"%s\" in /proc/self/maps."),
+ wxLogDebug(wxT("Failed to parse line \"%s\" in /proc/self/maps."),
buf);
continue;
}
wxASSERT_MSG( start >= endCur,
- _T("overlapping regions in /proc/self/maps?") );
+ wxT("overlapping regions in /proc/self/maps?") );
wxString pathNew = wxString::FromAscii(path);
if ( pathCur.empty() )
{
ep |= EPOLLIN;
wxLogTrace(wxEpollDispatcher_Trace,
- _T("Registered fd %d for input events"), fd);
+ wxT("Registered fd %d for input events"), fd);
}
if ( flags & wxFDIO_OUTPUT )
{
ep |= EPOLLOUT;
wxLogTrace(wxEpollDispatcher_Trace,
- _T("Registered fd %d for output events"), fd);
+ wxT("Registered fd %d for output events"), fd);
}
if ( flags & wxFDIO_EXCEPTION )
{
ep |= EPOLLERR | EPOLLHUP;
wxLogTrace(wxEpollDispatcher_Trace,
- _T("Registered fd %d for exceptional events"), fd);
+ wxT("Registered fd %d for exceptional events"), fd);
}
return ep;
return NULL;
}
wxLogTrace(wxEpollDispatcher_Trace,
- _T("Epoll fd %d created"), epollDescriptor);
+ wxT("Epoll fd %d created"), epollDescriptor);
return new wxEpollDispatcher(epollDescriptor);
}
wxEpollDispatcher::wxEpollDispatcher(int epollDescriptor)
{
- wxASSERT_MSG( epollDescriptor != -1, _T("invalid descriptor") );
+ wxASSERT_MSG( epollDescriptor != -1, wxT("invalid descriptor") );
m_epollDescriptor = epollDescriptor;
}
return false;
}
wxLogTrace(wxEpollDispatcher_Trace,
- _T("Added fd %d (handler %p) to epoll %d"), fd, handler, m_epollDescriptor);
+ wxT("Added fd %d (handler %p) to epoll %d"), fd, handler, m_epollDescriptor);
return true;
}
}
wxLogTrace(wxEpollDispatcher_Trace,
- _T("Modified fd %d (handler: %p) on epoll %d"), fd, handler, m_epollDescriptor);
+ wxT("Modified fd %d (handler: %p) on epoll %d"), fd, handler, m_epollDescriptor);
return true;
}
fd, m_epollDescriptor);
}
wxLogTrace(wxEpollDispatcher_Trace,
- _T("removed fd %d from %d"), fd, m_epollDescriptor);
+ wxT("removed fd %d from %d"), fd, m_epollDescriptor);
return true;
}
wxFDIOHandler * const handler = (wxFDIOHandler *)(p->data.ptr);
if ( !handler )
{
- wxFAIL_MSG( _T("NULL handler in epoll_event?") );
+ wxFAIL_MSG( wxT("NULL handler in epoll_event?") );
continue;
}
#include "wx/unix/private/epolldispatcher.h"
#include "wx/private/selectdispatcher.h"
-#define TRACE_EVENTS _T("events")
+#define TRACE_EVENTS wxT("events")
// ===========================================================================
// wxEventLoop::PipeIOHandler implementation
bool wxNativeEncodingInfo::FromString(const wxString& s)
{
// use ";", not "-" because it may be part of encoding name
- wxStringTokenizer tokenizer(s, _T(";"));
+ wxStringTokenizer tokenizer(s, wxT(";"));
wxString encid = tokenizer.GetNextToken();
long enc;
wxString wxNativeEncodingInfo::ToString() const
{
wxString s;
- s << (long)encoding << _T(';') << xregistry << _T(';') << xencoding;
+ s << (long)encoding << wxT(';') << xregistry << wxT(';') << xencoding;
if ( !facename.empty() )
{
- s << _T(';') << facename;
+ s << wxT(';') << facename;
}
return s;
bool wxNativeFontInfo::FromString(const wxString& s)
{
- wxStringTokenizer tokenizer(s, _T(";"));
+ wxStringTokenizer tokenizer(s, wxT(";"));
// check the version
wxString token = tokenizer.GetNextToken();
- if ( token != _T('0') )
+ if ( token != wxT('0') )
return false;
xFontName = tokenizer.GetNextToken();
wxString wxNativeFontInfo::ToString() const
{
// 0 is the version
- return wxString::Format(_T("%d;%s"), 0, GetXFontName().c_str());
+ return wxString::Format(wxT("%d;%s"), 0, GetXFontName().c_str());
}
bool wxNativeFontInfo::FromUserString(const wxString& s)
wxString wxNativeFontInfo::GetXFontComponent(wxXLFDField field) const
{
- wxCHECK_MSG( field < wxXLFD_MAX, wxEmptyString, _T("invalid XLFD field") );
+ wxCHECK_MSG( field < wxXLFD_MAX, wxEmptyString, wxT("invalid XLFD field") );
if ( !HasElements() )
{
bool wxNativeFontInfo::FromXFontName(const wxString& fontname)
{
// TODO: we should be able to handle the font aliases here, but how?
- wxStringTokenizer tokenizer(fontname, _T("-"));
+ wxStringTokenizer tokenizer(fontname, wxT("-"));
// skip the leading, usually empty field (font name registry)
if ( !tokenizer.HasMoreTokens() )
}
wxString field = tokenizer.GetNextToken();
- if ( !field.empty() && field != _T('*') )
+ if ( !field.empty() && field != wxT('*') )
{
// we're really initialized now
m_isDefault = false;
wxString elt = fontElements[n];
if ( elt.empty() && n != wxXLFD_ADDSTYLE )
{
- elt = _T('*');
+ elt = wxT('*');
}
// const_cast
- ((wxNativeFontInfo *)this)->xFontName << _T('-') << elt;
+ ((wxNativeFontInfo *)this)->xFontName << wxT('-') << elt;
}
}
void
wxNativeFontInfo::SetXFontComponent(wxXLFDField field, const wxString& value)
{
- wxCHECK_RET( field < wxXLFD_MAX, _T("invalid XLFD field") );
+ wxCHECK_RET( field < wxXLFD_MAX, wxT("invalid XLFD field") );
// this class should be initialized with a valid font spec first and only
// then the fields may be modified!
- wxASSERT_MSG( !IsDefault(), _T("can't modify an uninitialized XLFD") );
+ wxASSERT_MSG( !IsDefault(), wxT("can't modify an uninitialized XLFD") );
if ( !HasElements() )
{
// const_cast
if ( !((wxNativeFontInfo *)this)->FromXFontName(xFontName) )
{
- wxFAIL_MSG( _T("can't set font element for invalid XLFD") );
+ wxFAIL_MSG( wxT("can't set font element for invalid XLFD") );
return;
}
default:
// again, unknown but consider normal by default
- case _T('r'):
+ case wxT('r'):
return wxFONTSTYLE_NORMAL;
- case _T('i'):
+ case wxT('i'):
return wxFONTSTYLE_ITALIC;
- case _T('o'):
+ case wxT('o'):
return wxFONTSTYLE_SLANT;
}
}
wxFontWeight wxNativeFontInfo::GetWeight() const
{
const wxString s = GetXFontComponent(wxXLFD_WEIGHT).MakeLower();
- if ( s.find(_T("bold")) != wxString::npos || s == _T("black") )
+ if ( s.find(wxT("bold")) != wxString::npos || s == wxT("black") )
return wxFONTWEIGHT_BOLD;
- else if ( s == _T("light") )
+ else if ( s == wxT("light") )
return wxFONTWEIGHT_LIGHT;
return wxFONTWEIGHT_NORMAL;
{
// and wxWidgets family -- to X foundry, but we have to translate it to
// wxFontFamily somehow...
- wxFAIL_MSG(_T("not implemented")); // GetXFontComponent(wxXLFD_FOUNDRY);
+ wxFAIL_MSG(wxT("not implemented")); // GetXFontComponent(wxXLFD_FOUNDRY);
return wxFONTFAMILY_DEFAULT;
}
wxFontEncoding wxNativeFontInfo::GetEncoding() const
{
// we already have the code for this but need to refactor it first
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
return wxFONTENCODING_MAX;
}
void wxNativeFontInfo::SetPointSize(int pointsize)
{
- SetXFontComponent(wxXLFD_POINTSIZE, wxString::Format(_T("%d"), pointsize));
+ SetXFontComponent(wxXLFD_POINTSIZE, wxString::Format(wxT("%d"), pointsize));
}
void wxNativeFontInfo::SetStyle(wxFontStyle style)
switch ( style )
{
case wxFONTSTYLE_ITALIC:
- s = _T('i');
+ s = wxT('i');
break;
case wxFONTSTYLE_SLANT:
- s = _T('o');
+ s = wxT('o');
break;
case wxFONTSTYLE_NORMAL:
- s = _T('r');
+ s = wxT('r');
default:
- wxFAIL_MSG( _T("unknown wxFontStyle in wxNativeFontInfo::SetStyle") );
+ wxFAIL_MSG( wxT("unknown wxFontStyle in wxNativeFontInfo::SetStyle") );
return;
}
switch ( weight )
{
case wxFONTWEIGHT_BOLD:
- s = _T("bold");
+ s = wxT("bold");
break;
case wxFONTWEIGHT_LIGHT:
- s = _T("light");
+ s = wxT("light");
break;
case wxFONTWEIGHT_NORMAL:
- s = _T("medium");
+ s = wxT("medium");
break;
default:
- wxFAIL_MSG( _T("unknown wxFontWeight in wxNativeFontInfo::SetWeight") );
+ wxFAIL_MSG( wxT("unknown wxFontWeight in wxNativeFontInfo::SetWeight") );
return;
}
void wxNativeFontInfo::SetFamily(wxFontFamily WXUNUSED(family))
{
// wxFontFamily -> X foundry, anyone?
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
// SetXFontComponent(wxXLFD_FOUNDRY, ...);
}
bool wxGetNativeFontEncoding(wxFontEncoding encoding,
wxNativeEncodingInfo *info)
{
- wxCHECK_MSG( info, false, _T("bad pointer in wxGetNativeFontEncoding") );
+ wxCHECK_MSG( info, false, wxT("bad pointer in wxGetNativeFontEncoding") );
if ( encoding == wxFONTENCODING_DEFAULT )
{
bool wxTestFontEncoding(const wxNativeEncodingInfo& info)
{
wxString fontspec;
- fontspec.Printf(_T("-*-%s-*-*-*-*-*-*-*-*-*-*-%s-%s"),
- !info.facename ? _T("*") : info.facename.c_str(),
+ fontspec.Printf(wxT("-*-%s-*-*-*-*-*-*-*-*-*-*-%s-%s"),
+ !info.facename ? wxT("*") : info.facename.c_str(),
info.xregistry.c_str(),
info.xencoding.c_str());
//
// Make sure point size is correct for scale factor.
//
- wxStringTokenizer tokenizer(*xFontName, _T("-"), wxTOKEN_RET_DELIMS);
+ wxStringTokenizer tokenizer(*xFontName, wxT("-"), wxTOKEN_RET_DELIMS);
wxString newFontName;
for(int i = 0; i < 8; i++)
// NULL or we'd crash in wxFont code
if ( !font )
{
- wxFAIL_MSG( _T("this encoding should be available!") );
+ wxFAIL_MSG( wxT("this encoding should be available!") );
font = wxLoadQueryFont(-1,
wxDEFAULT, wxNORMAL, wxNORMAL,
false, wxEmptyString,
- _T("*"), _T("*"),
+ wxT("*"), wxT("*"),
xFontName);
}
}
{
// some X servers will fail to load this font because there are too many
// matches so we must test explicitly for this
- if ( fontspec == _T("-*-*-*-*-*-*-*-*-*-*-*-*-*-*") )
+ if ( fontspec == wxT("-*-*-*-*-*-*-*-*-*-*-*-*-*-*") )
{
return true;
}
break;
default:
- wxFAIL_MSG(_T("unknown font style"));
+ wxFAIL_MSG(wxT("unknown font style"));
// fall back to normal
case wxNORMAL:
wxString sizeSpec;
if ( pointSize == -1 )
{
- sizeSpec = _T('*');
+ sizeSpec = wxT('*');
}
else
{
- sizeSpec.Printf(_T("%d"), pointSize);
+ sizeSpec.Printf(wxT("%d"), pointSize);
}
// construct the X font spec from our data
if ( wxGLCanvas::GetGLXVersion() >= 13 )
{
GLXFBConfig *fbc = gc->GetGLXFBConfig();
- wxCHECK_RET( fbc, _T("invalid GLXFBConfig for OpenGL") );
+ wxCHECK_RET( fbc, wxT("invalid GLXFBConfig for OpenGL") );
m_glContext = glXCreateNewContext( wxGetX11Display(), fbc[0], GLX_RGBA_TYPE,
other ? other->m_glContext : None,
else // GLX <= 1.2
{
XVisualInfo *vi = gc->GetXVisualInfo();
- wxCHECK_RET( vi, _T("invalid visual for OpenGL") );
+ wxCHECK_RET( vi, wxT("invalid visual for OpenGL") );
m_glContext = glXCreateContext( wxGetX11Display(), vi,
other ? other->m_glContext : None,
GL_TRUE );
}
- wxASSERT_MSG( m_glContext, _T("Couldn't create OpenGL context") );
+ wxASSERT_MSG( m_glContext, wxT("Couldn't create OpenGL context") );
}
wxGLContext::~wxGLContext()
return false;
const Window xid = win.GetXWindow();
- wxCHECK2_MSG( xid, return false, _T("window must be shown") );
+ wxCHECK2_MSG( xid, return false, wxT("window must be shown") );
return MakeCurrent(xid, m_glContext);
}
bool
wxGLCanvasX11::ConvertWXAttrsToGL(const int *wxattrs, int *glattrs, size_t n)
{
- wxCHECK_MSG( n >= 16, false, _T("GL attributes buffer too small") );
+ wxCHECK_MSG( n >= 16, false, wxT("GL attributes buffer too small") );
/*
Different versions of GLX API use rather different attributes lists, see
glattrs[i] = None;
- wxASSERT_MSG( i < n, _T("GL attributes buffer too small") );
+ wxASSERT_MSG( i < n, wxT("GL attributes buffer too small") );
}
else // have non-default attributes
{
break;
default:
- wxLogDebug(_T("Unsupported OpenGL attribute %d"),
+ wxLogDebug(wxT("Unsupported OpenGL attribute %d"),
wxattrs[arg - 1]);
continue;
}
// check the GLX version
int glxMajorVer, glxMinorVer;
bool ok = glXQueryVersion(wxGetX11Display(), &glxMajorVer, &glxMinorVer);
- wxASSERT_MSG( ok, _T("GLX version not found") );
+ wxASSERT_MSG( ok, wxT("GLX version not found") );
if (!ok)
s_glxVersion = 10; // 1.0 by default
else
bool wxGLCanvasX11::SwapBuffers()
{
const Window xid = GetXWindow();
- wxCHECK2_MSG( xid, return false, _T("window must be shown") );
+ wxCHECK2_MSG( xid, return false, wxT("window must be shown") );
glXSwapBuffers(wxGetX11Display(), xid);
return true;
#if wxUSE_INTL // try "Name[locale name]" first
wxLocale *locale = wxGetLocale();
if ( locale )
- nIndex = file.pIndexOf(_T("Name[")+locale->GetName()+_T("]="));
+ nIndex = file.pIndexOf(wxT("Name[")+locale->GetName()+wxT("]="));
#endif // wxUSE_INTL
if(nIndex == wxNOT_FOUND)
nIndex = file.pIndexOf( wxT("Name=") );
nIndex = wxNOT_FOUND;
#if wxUSE_INTL // try "Icon[locale name]" first
if ( locale )
- nIndex = file.pIndexOf(_T("Icon[")+locale->GetName()+_T("]="));
+ nIndex = file.pIndexOf(wxT("Icon[")+locale->GetName()+wxT("]="));
#endif // wxUSE_INTL
if(nIndex == wxNOT_FOUND)
nIndex = file.pIndexOf( wxT("Icon=") );
sCmd.Replace(wxT("%i"), nameicon);
sCmd.Replace(wxT("%m"), namemini);
- wxStringTokenizer tokenizer(mimetypes, _T(";"));
+ wxStringTokenizer tokenizer(mimetypes, wxT(";"));
while(tokenizer.HasMoreTokens()) {
wxString mimetype = tokenizer.GetNextToken().Lower();
nIndex = m_aTypes.Index(mimetype);
wxString filename;
// Look into .desktop files
- bool cont = dir.GetFirst(&filename, _T("*.desktop"), wxDIR_FILES);
+ bool cont = dir.GetFirst(&filename, wxT("*.desktop"), wxDIR_FILES);
while (cont)
{
wxFileName p(dirname, filename);
const wxString& path)
{
wxASSERT_MSG( !m_impl,
- _T("calling wxSingleInstanceChecker::Create() twice?") );
+ wxT("calling wxSingleInstanceChecker::Create() twice?") );
// must have the file name to create a lock file
- wxASSERT_MSG( !name.empty(), _T("lock file name can't be empty") );
+ wxASSERT_MSG( !name.empty(), wxT("lock file name can't be empty") );
m_impl = new wxSingleInstanceCheckerImpl;
fullname = wxGetHomeDir();
}
- if ( fullname.Last() != _T('/') )
+ if ( fullname.Last() != wxT('/') )
{
- fullname += _T('/');
+ fullname += wxT('/');
}
fullname << name;
bool wxSingleInstanceChecker::IsAnotherRunning() const
{
- wxCHECK_MSG( m_impl, false, _T("must call Create() first") );
+ wxCHECK_MSG( m_impl, false, wxT("must call Create() first") );
const pid_t lockerPid = m_impl->GetLockerPID();
class wxSoundBackendOSS : public wxSoundBackend
{
public:
- wxString GetName() const { return _T("Open Sound System"); }
+ wxString GetName() const { return wxT("Open Sound System"); }
int GetPriority() const { return 10; }
bool IsAvailable() const;
bool HasNativeAsyncPlayback() const { return false; }
{
if (status->m_stopRequested)
{
- wxLogTrace(_T("sound"), _T("playback stopped"));
+ wxLogTrace(wxT("sound"), wxT("playback stopped"));
close(dev);
return true;
}
// Reset the dsp
if (ioctl(dev, SNDCTL_DSP_RESET, 0) < 0)
{
- wxLogTrace(_T("sound"), _T("unable to reset dsp"));
+ wxLogTrace(wxT("sound"), wxT("unable to reset dsp"));
return false;
}
tmp = data->m_bitsPerSample;
if (ioctl(dev, SNDCTL_DSP_SAMPLESIZE, &tmp) < 0)
{
- wxLogTrace(_T("sound"), _T("IOCTL failure (SNDCTL_DSP_SAMPLESIZE)"));
+ wxLogTrace(wxT("sound"), wxT("IOCTL failure (SNDCTL_DSP_SAMPLESIZE)"));
return false;
}
if (tmp != data->m_bitsPerSample)
{
- wxLogTrace(_T("sound"),
- _T("Unable to set DSP sample size to %d (wants %d)"),
+ wxLogTrace(wxT("sound"),
+ wxT("Unable to set DSP sample size to %d (wants %d)"),
data->m_bitsPerSample, tmp);
m_needConversion = true;
}
tmp = stereo;
if (ioctl(dev, SNDCTL_DSP_STEREO, &tmp) < 0)
{
- wxLogTrace(_T("sound"), _T("IOCTL failure (SNDCTL_DSP_STEREO)"));
+ wxLogTrace(wxT("sound"), wxT("IOCTL failure (SNDCTL_DSP_STEREO)"));
return false;
}
if (tmp != stereo)
{
- wxLogTrace(_T("sound"), _T("Unable to set DSP to %s."), stereo? _T("stereo"):_T("mono"));
+ wxLogTrace(wxT("sound"), wxT("Unable to set DSP to %s."), stereo? wxT("stereo"):wxT("mono"));
m_needConversion = true;
}
tmp = data->m_samplingRate;
if (ioctl(dev, SNDCTL_DSP_SPEED, &tmp) < 0)
{
- wxLogTrace(_T("sound"), _T("IOCTL failure (SNDCTL_DSP_SPEED)"));
+ wxLogTrace(wxT("sound"), wxT("IOCTL failure (SNDCTL_DSP_SPEED)"));
return false;
}
if (tmp != data->m_samplingRate)
// file rates for something that we can't hear anyways.
if (data->m_samplingRate - tmp > (tmp * .01) ||
tmp - data->m_samplingRate > (tmp * .01)) {
- wxLogTrace(_T("sound"),
- _T("Unable to set DSP sampling rate to %d (wants %d)"),
+ wxLogTrace(wxT("sound"),
+ wxT("Unable to set DSP sampling rate to %d (wants %d)"),
data->m_samplingRate, tmp);
m_needConversion = true;
}
// the sampling rate, etc.
if (ioctl(dev, SNDCTL_DSP_GETBLKSIZE, &m_DSPblkSize) < 0)
{
- wxLogTrace(_T("sound"), _T("IOCTL failure (SNDCTL_DSP_GETBLKSIZE)"));
+ wxLogTrace(wxT("sound"), wxT("IOCTL failure (SNDCTL_DSP_GETBLKSIZE)"));
return false;
}
return true;
m_data->DecRef();
m_adapt->m_playing = false;
m_adapt->m_mutexRightToPlay.Unlock();
- wxLogTrace(_T("sound"), _T("terminated async playback thread"));
+ wxLogTrace(wxT("sound"), wxT("terminated async playback thread"));
return 0;
}
#endif
wxThread *th = new wxSoundAsyncPlaybackThread(this, data, flags);
th->Create();
th->Run();
- wxLogTrace(_T("sound"), _T("launched async playback thread"));
+ wxLogTrace(wxT("sound"), wxT("launched async playback thread"));
return true;
#else
wxLogError(_("Unable to play sound asynchronously."));
void wxSoundSyncOnlyAdaptor::Stop()
{
- wxLogTrace(_T("sound"), _T("asking audio to stop"));
+ wxLogTrace(wxT("sound"), wxT("asking audio to stop"));
#if wxUSE_THREADS
// tell the player thread (if running) to stop playback ASAP:
// our request to interrupt playback):
m_mutexRightToPlay.Lock();
m_mutexRightToPlay.Unlock();
- wxLogTrace(_T("sound"), _T("audio was stopped"));
+ wxLogTrace(wxT("sound"), wxT("audio was stopped"));
#endif
}
bool WXUNUSED_UNLESS_DEBUG(isResource))
{
wxASSERT_MSG( !isResource,
- _T("Loading sound from resources is only supported on Windows") );
+ wxT("Loading sound from resources is only supported on Windows") );
Free();
ms_backend = wxCreateSoundBackendSDL();
#else
wxString dllname;
- dllname.Printf(_T("%s/%s"),
+ dllname.Printf(wxT("%s/%s"),
wxDynamicLibrary::GetPluginsDirectory().c_str(),
wxDynamicLibrary::CanonicalizePluginName(
- _T("sound_sdl"), wxDL_PLUGIN_BASE).c_str());
- wxLogTrace(_T("sound"),
- _T("trying to load SDL plugin from '%s'..."),
+ wxT("sound_sdl"), wxDL_PLUGIN_BASE).c_str());
+ wxLogTrace(wxT("sound"),
+ wxT("trying to load SDL plugin from '%s'..."),
dllname.c_str());
wxLogNull null;
ms_backendSDL = new wxDynamicLibrary(dllname, wxDL_NOW);
if (!ms_backend->HasNativeAsyncPlayback())
ms_backend = new wxSoundSyncOnlyAdaptor(ms_backend);
- wxLogTrace(_T("sound"),
- _T("using backend '%s'"), ms_backend->GetName().c_str());
+ wxLogTrace(wxT("sound"),
+ wxT("using backend '%s'"), ms_backend->GetName().c_str());
}
}
{
if (ms_backend)
{
- wxLogTrace(_T("sound"), _T("unloading backend"));
+ wxLogTrace(wxT("sound"), wxT("unloading backend"));
Stop();
bool wxSound::DoPlay(unsigned flags) const
{
- wxCHECK_MSG( IsOk(), false, _T("Attempt to play invalid wave data") );
+ wxCHECK_MSG( IsOk(), false, wxT("Attempt to play invalid wave data") );
EnsureBackend();
wxSoundPlaybackStatus status;
m_data(NULL), m_evtHandler(NULL) {}
virtual ~wxSoundBackendSDL();
- wxString GetName() const { return _T("Simple DirectMedia Layer"); }
+ wxString GetName() const { return wxT("Simple DirectMedia Layer"); }
int GetPriority() const { return 9; }
bool IsAvailable() const;
bool HasNativeAsyncPlayback() const { return true; }
private:
void OnNotify(wxSoundBackendSDLNotification& WXUNUSED(event))
{
- wxLogTrace(_T("sound"),
- _T("received playback status change notification"));
+ wxLogTrace(wxT("sound"),
+ wxT("received playback status change notification"));
m_backend->FinishedPlayback();
}
wxSoundBackendSDL *m_backend;
return false;
}
wxConstCast(this, wxSoundBackendSDL)->m_initialized = true;
- wxLogTrace(_T("sound"), _T("initialized SDL audio subsystem"));
+ wxLogTrace(wxT("sound"), wxT("initialized SDL audio subsystem"));
return true;
}
m_spec.callback = wx_sdl_audio_callback;
m_spec.userdata = (void*)this;
- wxLogTrace(_T("sound"), _T("opening SDL audio..."));
+ wxLogTrace(wxT("sound"), wxT("opening SDL audio..."));
if (SDL_OpenAudio(&m_spec, NULL) >= 0)
{
#if wxUSE_LOG_DEBUG
char driver[256];
SDL_AudioDriverName(driver, 256);
- wxLogTrace(_T("sound"), _T("opened audio, driver '%s'"),
+ wxLogTrace(wxT("sound"), wxT("opened audio, driver '%s'"),
wxString(driver, wxConvLocal).c_str());
#endif
m_audioOpen = true;
if (m_audioOpen)
{
SDL_CloseAudio();
- wxLogTrace(_T("sound"), _T("closed audio"));
+ wxLogTrace(wxT("sound"), wxT("closed audio"));
m_audioOpen = false;
}
}
}
SDL_LockAudio();
- wxLogTrace(_T("sound"), _T("playing new sound"));
+ wxLogTrace(wxT("sound"), wxT("playing new sound"));
m_playing = true;
m_pos = 0;
m_loop = (flags & wxSOUND_LOOP);
// wait until playback finishes if called in sync mode:
if (!(flags & wxSOUND_ASYNC))
{
- wxLogTrace(_T("sound"), _T("waiting for sample to finish"));
+ wxLogTrace(wxT("sound"), wxT("waiting for sample to finish"));
while (m_playing && m_data == data)
{
#if wxUSE_THREADS
wxMutexGuiEnter();
#endif
}
- wxLogTrace(_T("sound"), _T("sample finished"));
+ wxLogTrace(wxT("sound"), wxT("sample finished"));
}
return true;
// format is: "module(funcname+offset) [address]" but the part in
// parentheses can be not present
wxString syminfo = wxString::FromAscii(m_syminfo);
- const size_t posOpen = syminfo.find(_T('('));
+ const size_t posOpen = syminfo.find(wxT('('));
if ( posOpen != wxString::npos )
{
- const size_t posPlus = syminfo.find(_T('+'), posOpen + 1);
+ const size_t posPlus = syminfo.find(wxT('+'), posOpen + 1);
if ( posPlus != wxString::npos )
{
- const size_t posClose = syminfo.find(_T(')'), posPlus + 1);
+ const size_t posClose = syminfo.find(wxT(')'), posPlus + 1);
if ( posClose != wxString::npos )
{
if ( m_name.empty() )
name = wxString::FromAscii(g_buf);
name.RemoveLast(); // trailing newline
- if ( name == _T("??") )
+ if ( name == wxT("??") )
name.clear();
}
else
{
- wxLogDebug(_T("cannot read addr2line output for stack frame #%lu"),
+ wxLogDebug(wxT("cannot read addr2line output for stack frame #%lu"),
(unsigned long)i);
return false;
}
filename = wxString::FromAscii(g_buf);
filename.RemoveLast();
- const size_t posColon = filename.find(_T(':'));
+ const size_t posColon = filename.find(wxT(':'));
if ( posColon != wxString::npos )
{
// parse line number (it's ok if it fails, this will just leave
// remove line number from 'filename'
filename.erase(posColon);
- if ( filename == _T("??") )
+ if ( filename == wxT("??") )
filename.clear();
}
else
{
- wxLogDebug(_T("Unexpected addr2line format: \"%s\" - ")
- _T("the semicolon is missing"),
+ wxLogDebug(wxT("Unexpected addr2line format: \"%s\" - ")
+ wxT("the semicolon is missing"),
filename.c_str());
}
}
wxString wxStandardPaths::GetConfigDir() const
{
- return _T("/sys$manager");
+ return wxT("/sys$manager");
}
wxString wxStandardPaths::GetDataDir() const
{
- return AppendAppInfo(GetInstallPrefix() + _T("/sys$share"));
+ return AppendAppInfo(GetInstallPrefix() + wxT("/sys$share"));
}
wxString wxStandardPaths::GetLocalDataDir() const
{
- return AppendAppInfo(_T("/sys$manager"));
+ return AppendAppInfo(wxT("/sys$manager"));
}
wxString wxStandardPaths::GetUserDataDir() const
wxString wxStandardPaths::GetConfigDir() const
{
- return _T("/etc");
+ return wxT("/etc");
}
wxString wxStandardPaths::GetDataDir() const
{
- return AppendAppInfo(GetInstallPrefix() + _T("/share"));
+ return AppendAppInfo(GetInstallPrefix() + wxT("/share"));
}
wxString wxStandardPaths::GetLocalDataDir() const
{
- return AppendAppInfo(_T("/etc"));
+ return AppendAppInfo(wxT("/etc"));
}
wxString wxStandardPaths::GetUserDataDir() const
{
- return AppendAppInfo(wxFileName::GetHomeDir() + _T("/."));
+ return AppendAppInfo(wxFileName::GetHomeDir() + wxT("/."));
}
wxString wxStandardPaths::GetPluginsDir() const
{
- return AppendAppInfo(GetInstallPrefix() + _T("/lib"));
+ return AppendAppInfo(GetInstallPrefix() + wxT("/lib"));
}
wxString
if ( category != ResourceCat_Messages )
return wxStandardPathsBase::GetLocalizedResourcesDir(lang, category);
- return GetInstallPrefix() + _T("/share/locale/") + lang + _T("/LC_MESSAGES");
+ return GetInstallPrefix() + wxT("/share/locale/") + lang + wxT("/LC_MESSAGES");
}
wxString wxStandardPaths::GetDocumentsDir() const
{
public:
wxTaskBarIconAreaBase()
- : wxFrame(NULL, wxID_ANY, _T("systray icon"),
+ : wxFrame(NULL, wxID_ANY, wxT("systray icon"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_FRAME_STYLE | wxFRAME_NO_TASKBAR |
wxSIMPLE_BORDER | wxFRAME_SHAPED) {}
if (!IsProtocolSupported())
{
- wxLogTrace(_T("systray"),
- _T("using legacy KDE1,2 and GNOME 1.2 methods"));
+ wxLogTrace(wxT("systray"),
+ wxT("using legacy KDE1,2 and GNOME 1.2 methods"));
SetLegacyWMProperties();
}
}
void wxTaskBarIconArea::OnSizeChange(wxSizeEvent& WXUNUSED(event))
{
- wxLogTrace(_T("systray"), _T("icon size changed to %i x %i"),
+ wxLogTrace(wxT("systray"), wxT("icon size changed to %i x %i"),
GetSize().x, GetSize().y);
// rescale or reposition the icon as needed:
wxBitmap bmp(m_bmp);
static const wxThread::ExitCode EXITCODE_CANCELLED = (wxThread::ExitCode)-1;
// trace mask for wxThread operations
-#define TRACE_THREADS _T("thread")
+#define TRACE_THREADS wxT("thread")
// you can get additional debugging messages for the semaphore operations
-#define TRACE_SEMA _T("semaphore")
+#define TRACE_SEMA wxT("semaphore")
// ----------------------------------------------------------------------------
// private functions
break;
default:
- wxFAIL_MSG( _T("unknown mutex type") );
+ wxFAIL_MSG( wxT("unknown mutex type") );
// fall through
case wxMUTEX_DEFAULT:
case EDEADLK:
// only error checking mutexes return this value and so it's an
// unexpected situation -- hence use assert, not wxLogDebug
- wxFAIL_MSG( _T("mutex deadlock prevented") );
+ wxFAIL_MSG( wxT("mutex deadlock prevented") );
return wxMUTEX_DEAD_LOCK;
case EINVAL:
- wxLogDebug(_T("pthread_mutex_[timed]lock(): mutex not initialized"));
+ wxLogDebug(wxT("pthread_mutex_[timed]lock(): mutex not initialized"));
break;
case ETIMEDOUT:
return wxMUTEX_NO_ERROR;
default:
- wxLogApiError(_T("pthread_mutex_[timed]lock()"), err);
+ wxLogApiError(wxT("pthread_mutex_[timed]lock()"), err);
}
return wxMUTEX_MISC_ERROR;
return wxMUTEX_BUSY;
case EINVAL:
- wxLogDebug(_T("pthread_mutex_trylock(): mutex not initialized."));
+ wxLogDebug(wxT("pthread_mutex_trylock(): mutex not initialized."));
break;
case 0:
return wxMUTEX_NO_ERROR;
default:
- wxLogApiError(_T("pthread_mutex_trylock()"), err);
+ wxLogApiError(wxT("pthread_mutex_trylock()"), err);
}
return wxMUTEX_MISC_ERROR;
return wxMUTEX_UNLOCKED;
case EINVAL:
- wxLogDebug(_T("pthread_mutex_unlock(): mutex not initialized."));
+ wxLogDebug(wxT("pthread_mutex_unlock(): mutex not initialized."));
break;
case 0:
return wxMUTEX_NO_ERROR;
default:
- wxLogApiError(_T("pthread_mutex_unlock()"), err);
+ wxLogApiError(wxT("pthread_mutex_unlock()"), err);
}
return wxMUTEX_MISC_ERROR;
if ( !m_isOk )
{
- wxLogApiError(_T("pthread_cond_init()"), err);
+ wxLogApiError(wxT("pthread_cond_init()"), err);
}
}
int err = pthread_cond_destroy(&m_cond);
if ( err != 0 )
{
- wxLogApiError(_T("pthread_cond_destroy()"), err);
+ wxLogApiError(wxT("pthread_cond_destroy()"), err);
}
}
}
int err = pthread_cond_wait(&m_cond, GetPMutex());
if ( err != 0 )
{
- wxLogApiError(_T("pthread_cond_wait()"), err);
+ wxLogApiError(wxT("pthread_cond_wait()"), err);
return wxCOND_MISC_ERROR;
}
return wxCOND_NO_ERROR;
default:
- wxLogApiError(_T("pthread_cond_timedwait()"), err);
+ wxLogApiError(wxT("pthread_cond_timedwait()"), err);
}
return wxCOND_MISC_ERROR;
int err = pthread_cond_signal(&m_cond);
if ( err != 0 )
{
- wxLogApiError(_T("pthread_cond_signal()"), err);
+ wxLogApiError(wxT("pthread_cond_signal()"), err);
return wxCOND_MISC_ERROR;
}
int err = pthread_cond_broadcast(&m_cond);
if ( err != 0 )
{
- wxLogApiError(_T("pthread_cond_broadcast()"), err);
+ wxLogApiError(wxT("pthread_cond_broadcast()"), err);
return wxCOND_MISC_ERROR;
}
if ( (initialcount < 0 || maxcount < 0) ||
((maxcount > 0) && (initialcount > maxcount)) )
{
- wxFAIL_MSG( _T("wxSemaphore: invalid initial or maximal count") );
+ wxFAIL_MSG( wxT("wxSemaphore: invalid initial or maximal count") );
m_isOk = false;
}
while ( m_count == 0 )
{
wxLogTrace(TRACE_SEMA,
- _T("Thread %p waiting for semaphore to become signalled"),
+ wxT("Thread %p waiting for semaphore to become signalled"),
wxThread::GetCurrentId());
if ( m_cond.Wait() != wxCOND_NO_ERROR )
return wxSEMA_MISC_ERROR;
wxLogTrace(TRACE_SEMA,
- _T("Thread %p finished waiting for semaphore, count = %lu"),
+ wxT("Thread %p finished waiting for semaphore, count = %lu"),
wxThread::GetCurrentId(), (unsigned long)m_count);
}
m_count++;
wxLogTrace(TRACE_SEMA,
- _T("Thread %p about to signal semaphore, count = %lu"),
+ wxT("Thread %p about to signal semaphore, count = %lu"),
wxThread::GetCurrentId(), (unsigned long)m_count);
return m_cond.Signal() == wxCOND_NO_ERROR ? wxSEMA_NO_ERROR
#if wxUSE_LOG_TRACE
static const wxChar *stateNames[] =
{
- _T("NEW"),
- _T("RUNNING"),
- _T("PAUSED"),
- _T("EXITED"),
+ wxT("NEW"),
+ wxT("RUNNING"),
+ wxT("PAUSED"),
+ wxT("EXITED"),
};
- wxLogTrace(TRACE_THREADS, _T("Thread %p: %s => %s."),
+ wxLogTrace(TRACE_THREADS, wxT("Thread %p: %s => %s."),
GetId(), stateNames[m_state], stateNames[state]);
#endif // wxUSE_LOG_TRACE
{
wxThreadInternal *pthread = thread->m_internal;
- wxLogTrace(TRACE_THREADS, _T("Thread %p started."), THR_ID(pthread));
+ wxLogTrace(TRACE_THREADS, wxT("Thread %p started."), THR_ID(pthread));
// associate the thread pointer with the newly created thread so that
// wxThread::This() will work
{
// call the main entry
wxLogTrace(TRACE_THREADS,
- _T("Thread %p about to enter its Entry()."),
+ wxT("Thread %p about to enter its Entry()."),
THR_ID(pthread));
wxTRY
pthread->m_exitcode = thread->Entry();
wxLogTrace(TRACE_THREADS,
- _T("Thread %p Entry() returned %lu."),
+ wxT("Thread %p Entry() returned %lu."),
THR_ID(pthread), wxPtrToUInt(pthread->m_exitcode));
}
wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
void wxThreadInternal::Wait()
{
- wxCHECK_RET( !m_isDetached, _T("can't wait for a detached thread") );
+ wxCHECK_RET( !m_isDetached, wxT("can't wait for a detached thread") );
// if the thread we're waiting for is waiting for the GUI mutex, we will
// deadlock so make sure we release it temporarily
wxMutexGuiLeave();
wxLogTrace(TRACE_THREADS,
- _T("Starting to wait for thread %p to exit."),
+ wxT("Starting to wait for thread %p to exit."),
THR_ID(this));
// to avoid memory leaks we should call pthread_join(), but it must only be
wxT("thread must first be paused with wxThread::Pause().") );
wxLogTrace(TRACE_THREADS,
- _T("Thread %p goes to sleep."), THR_ID(this));
+ wxT("Thread %p goes to sleep."), THR_ID(this));
// wait until the semaphore is Post()ed from Resume()
m_semSuspend.Wait();
if ( IsReallyPaused() )
{
wxLogTrace(TRACE_THREADS,
- _T("Waking up thread %p"), THR_ID(this));
+ wxT("Waking up thread %p"), THR_ID(this));
// wake up Pause()
m_semSuspend.Post();
else
{
wxLogTrace(TRACE_THREADS,
- _T("Thread %p is not yet really paused"), THR_ID(this));
+ wxT("Thread %p is not yet really paused"), THR_ID(this));
}
SetState(STATE_RUNNING);
// it has 0 size but still can be read from)
wxLogNull nolog;
- wxFFile file(_T("/proc/cpuinfo"));
+ wxFFile file(wxT("/proc/cpuinfo"));
if ( file.IsOpened() )
{
// slurp the whole file
if ( file.ReadAll(&s) )
{
// (ab)use Replace() to find the number of "processor: num" strings
- size_t count = s.Replace(_T("processor\t:"), _T(""));
+ size_t count = s.Replace(wxT("processor\t:"), wxT(""));
if ( count > 0 )
{
return count;
}
- wxLogDebug(_T("failed to parse /proc/cpuinfo"));
+ wxLogDebug(wxT("failed to parse /proc/cpuinfo"));
}
else
{
- wxLogDebug(_T("failed to read /proc/cpuinfo"));
+ wxLogDebug(wxT("failed to read /proc/cpuinfo"));
}
}
#endif // different ways to get number of CPUs
int rc = thr_setconcurrency(level);
if ( rc != 0 )
{
- wxLogSysError(rc, _T("thr_setconcurrency() failed"));
+ wxLogSysError(rc, wxT("thr_setconcurrency() failed"));
}
return rc == 0;
struct sched_param sp;
if ( pthread_attr_getschedparam(&attr, &sp) != 0 )
{
- wxFAIL_MSG(_T("pthread_attr_getschedparam() failed"));
+ wxFAIL_MSG(wxT("pthread_attr_getschedparam() failed"));
}
sp.sched_priority = min_prio + (prio*(max_prio - min_prio))/100;
if ( pthread_attr_setschedparam(&attr, &sp) != 0 )
{
- wxFAIL_MSG(_T("pthread_attr_setschedparam(priority) failed"));
+ wxFAIL_MSG(wxT("pthread_attr_setschedparam(priority) failed"));
}
}
#endif // HAVE_THREAD_PRIORITY_FUNCTIONS
// this will make the threads created by this process really concurrent
if ( pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) != 0 )
{
- wxFAIL_MSG(_T("pthread_attr_setscope(PTHREAD_SCOPE_SYSTEM) failed"));
+ wxFAIL_MSG(wxT("pthread_attr_setscope(PTHREAD_SCOPE_SYSTEM) failed"));
}
#endif // HAVE_PTHREAD_ATTR_SETSCOPE
{
if ( pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) != 0 )
{
- wxFAIL_MSG(_T("pthread_attr_setdetachstate(DETACHED) failed"));
+ wxFAIL_MSG(wxT("pthread_attr_setdetachstate(DETACHED) failed"));
}
// never try to join detached threads
if ( pthread_attr_destroy(&attr) != 0 )
{
- wxFAIL_MSG(_T("pthread_attr_destroy() failed"));
+ wxFAIL_MSG(wxT("pthread_attr_destroy() failed"));
}
if ( rc != 0 )
wxThreadError wxThread::Pause()
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
- _T("a thread can't pause itself") );
+ wxT("a thread can't pause itself") );
wxCriticalSectionLocker lock(m_critsect);
wxThreadError wxThread::Resume()
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
- _T("a thread can't resume itself") );
+ wxT("a thread can't resume itself") );
wxCriticalSectionLocker lock(m_critsect);
switch ( state )
{
case STATE_PAUSED:
- wxLogTrace(TRACE_THREADS, _T("Thread %p suspended, resuming."),
+ wxLogTrace(TRACE_THREADS, wxT("Thread %p suspended, resuming."),
GetId());
m_internal->Resume();
return wxTHREAD_NO_ERROR;
case STATE_EXITED:
- wxLogTrace(TRACE_THREADS, _T("Thread %p exited, won't resume."),
+ wxLogTrace(TRACE_THREADS, wxT("Thread %p exited, won't resume."),
GetId());
return wxTHREAD_NO_ERROR;
default:
- wxLogDebug(_T("Attempt to resume a thread which is not paused."));
+ wxLogDebug(wxT("Attempt to resume a thread which is not paused."));
return wxTHREAD_MISC_ERROR;
}
wxThread::ExitCode wxThread::Wait()
{
wxCHECK_MSG( This() != this, (ExitCode)-1,
- _T("a thread can't wait for itself") );
+ wxT("a thread can't wait for itself") );
wxCHECK_MSG( !m_isDetached, (ExitCode)-1,
- _T("can't wait for detached thread") );
+ wxT("can't wait for detached thread") );
m_internal->Wait();
wxThreadError wxThread::Delete(ExitCode *rc)
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
- _T("a thread can't delete itself") );
+ wxT("a thread can't delete itself") );
bool isDetached = m_isDetached;
wxThreadError wxThread::Kill()
{
wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR,
- _T("a thread can't kill itself") );
+ wxT("a thread can't kill itself") );
switch ( m_internal->GetState() )
{
void wxThread::Exit(ExitCode status)
{
wxASSERT_MSG( This() == this,
- _T("wxThread::Exit() can only be called in the context of the same thread") );
+ wxT("wxThread::Exit() can only be called in the context of the same thread") );
if ( m_isDetached )
{
// terminate the thread (pthread_exit() never returns)
pthread_exit(status);
- wxFAIL_MSG(_T("pthread_exit() failed"));
+ wxFAIL_MSG(wxT("pthread_exit() failed"));
}
// also test whether we were paused
bool wxThread::TestDestroy()
{
wxASSERT_MSG( This() == this,
- _T("wxThread::TestDestroy() can only be called in the context of the same thread") );
+ wxT("wxThread::TestDestroy() can only be called in the context of the same thread") );
m_critsect.Enter();
if ( m_internal->GetState() != STATE_EXITED &&
m_internal->GetState() != STATE_NEW )
{
- wxLogDebug(_T("The thread %ld is being destroyed although it is still running! The application may crash."),
+ wxLogDebug(wxT("The thread %ld is being destroyed although it is still running! The application may crash."),
(long)GetId());
}
if ( nThreadsBeingDeleted > 0 )
{
wxLogTrace(TRACE_THREADS,
- _T("Waiting for %lu threads to disappear"),
+ wxT("Waiting for %lu threads to disappear"),
(unsigned long)nThreadsBeingDeleted);
// have to wait until all of them disappear
gs_nThreadsBeingDeleted++;
- wxLogTrace(TRACE_THREADS, _T("%lu thread%s waiting to be deleted"),
+ wxLogTrace(TRACE_THREADS, wxT("%lu thread%s waiting to be deleted"),
(unsigned long)gs_nThreadsBeingDeleted,
- gs_nThreadsBeingDeleted == 1 ? _T("") : _T("s"));
+ gs_nThreadsBeingDeleted == 1 ? wxT("") : wxT("s"));
}
static void DeleteThread(wxThread *This)
// or wxThreadModule::OnExit() would deadlock
wxMutexLocker locker( *gs_mutexDeleteThread );
- wxLogTrace(TRACE_THREADS, _T("Thread %p auto deletes."), This->GetId());
+ wxLogTrace(TRACE_THREADS, wxT("Thread %p auto deletes."), This->GetId());
delete This;
wxCHECK_RET( gs_nThreadsBeingDeleted > 0,
- _T("no threads scheduled for deletion, yet we delete one?") );
+ wxT("no threads scheduled for deletion, yet we delete one?") );
- wxLogTrace(TRACE_THREADS, _T("%lu threads remain scheduled for deletion."),
+ wxLogTrace(TRACE_THREADS, wxT("%lu threads remain scheduled for deletion."),
(unsigned long)gs_nThreadsBeingDeleted - 1);
if ( !--gs_nThreadsBeingDeleted )
#if wxUSE_LONGLONG
return usec.ToString();
#else // wxUsecClock_t == double
- return wxString::Format(_T("%.0f"), usec);
+ return wxString::Format(wxT("%.0f"), usec);
#endif
}
for ( node = m_timers.begin(); node != m_timers.end(); ++node )
{
wxASSERT_MSG( (*node)->m_timer != s->m_timer,
- _T("adding the same timer twice?") );
+ wxT("adding the same timer twice?") );
if ( (*node)->m_expiration > s->m_expiration )
break;
}
}
- wxFAIL_MSG( _T("removing inexistent timer?") );
+ wxFAIL_MSG( wxT("removing inexistent timer?") );
}
bool wxTimerScheduler::GetNext(wxUsecClock_t *remaining) const
if ( m_timers.empty() )
return false;
- wxCHECK_MSG( remaining, false, _T("NULL pointer") );
+ wxCHECK_MSG( remaining, false, wxT("NULL pointer") );
*remaining = (*m_timers.begin())->m_expiration - wxGetLocalTimeUsec();
if ( *remaining < 0 )
wxUnixTimerImpl::~wxUnixTimerImpl()
{
- wxASSERT_MSG( !m_isRunning, _T("must have been stopped before") );
+ wxASSERT_MSG( !m_isRunning, wxT("must have been stopped before") );
}
// ============================================================================
default:
// this goes against Unix98 docs so log it
- wxLogDebug(_T("unexpected kill(2) return value %d"), err);
+ wxLogDebug(wxT("unexpected kill(2) return value %d"), err);
// something else...
*rc = wxKILL_ERROR;
switch ( flags )
{
case wxSHUTDOWN_POWEROFF:
- level = _T('0');
+ level = wxT('0');
break;
case wxSHUTDOWN_REBOOT:
- level = _T('6');
+ level = wxT('6');
break;
case wxSHUTDOWN_LOGOFF:
return false;
default:
- wxFAIL_MSG( _T("unknown wxShutdown() flag") );
+ wxFAIL_MSG( wxT("unknown wxShutdown() flag") );
return false;
}
return false;
default:
- wxFAIL_MSG(_T("unexpected select() return value"));
+ wxFAIL_MSG(wxT("unexpected select() return value"));
// still fall through
case 1:
if ( !command )
{
// just an interactive shell
- cmd = _T("xterm");
+ cmd = wxT("xterm");
}
else
{
// execute command in a shell
- cmd << _T("/bin/sh -c '") << command << _T('\'');
+ cmd << wxT("/bin/sh -c '") << command << wxT('\'');
}
return cmd;
bool wxShell(const wxString& command, wxArrayString& output)
{
- wxCHECK_MSG( !command.empty(), false, _T("can't exec shell non interactively") );
+ wxCHECK_MSG( !command.empty(), false, wxT("can't exec shell non interactively") );
return wxExecute(wxMakeShellCommand(command), output);
}
// don't know what yet, so for now just warn the user (this is the least we
// can do) about it
wxASSERT_MSG( wxThread::IsMain(),
- _T("wxExecute() can be called only from the main thread") );
+ wxT("wxExecute() can be called only from the main thread") );
#endif // wxUSE_THREADS
#if defined(__WXCOCOA__) || ( defined(__WXOSX_MAC__) && wxOSX_USE_COCOA_OR_CARBON )
FILE *f = popen(cmd.ToAscii(), "r");
if ( !f )
{
- wxLogSysError(_T("Executing \"%s\" failed"), cmd.c_str());
+ wxLogSysError(wxT("Executing \"%s\" failed"), cmd.c_str());
return wxEmptyString;
}
pclose(f);
- if ( !s.empty() && s.Last() == _T('\n') )
+ if ( !s.empty() && s.Last() == wxT('\n') )
s.RemoveLast();
return s;
#elif defined(HAVE_PUTENV)
wxString s = variable;
if ( value )
- s << _T('=') << value;
+ s << wxT('=') << value;
// transform to ANSI
const wxWX2MBbuf p = s.mb_str();
ok &= sigaction(SIGSEGV, &act, &s_handlerSEGV) == 0;
if ( !ok )
{
- wxLogDebug(_T("Failed to install our signal handler."));
+ wxLogDebug(wxT("Failed to install our signal handler."));
}
s_savedHandlers = true;
ok &= sigaction(SIGSEGV, &s_handlerSEGV, NULL) == 0;
if ( !ok )
{
- wxLogDebug(_T("Failed to uninstall our signal handler."));
+ wxLogDebug(wxT("Failed to uninstall our signal handler."));
}
s_savedHandlers = false;
wxMAKE_ATOM(_NET_WM_STATE_FULLSCREEN, disp);
if (wxQueryWMspecSupport(disp, root, _NET_WM_STATE_FULLSCREEN))
{
- wxLogTrace(_T("fullscreen"),
- _T("detected _NET_WM_STATE_FULLSCREEN support"));
+ wxLogTrace(wxT("fullscreen"),
+ wxT("detected _NET_WM_STATE_FULLSCREEN support"));
return wxX11_FS_WMSPEC;
}
// kwin doesn't understand any other method:
if (wxKwinRunning(disp, root))
{
- wxLogTrace(_T("fullscreen"), _T("detected kwin"));
+ wxLogTrace(wxT("fullscreen"), wxT("detected kwin"));
return wxX11_FS_KDE;
}
// finally, fall back to ICCCM heuristic method:
- wxLogTrace(_T("fullscreen"), _T("unknown WM, using _WIN_LAYER"));
+ wxLogTrace(wxT("fullscreen"), wxT("unknown WM, using _WIN_LAYER"));
return wxX11_FS_GENERIC;
}
if ( IsModifierKey(iKey) ) // If iKey is a modifier key, use a different method
{
XModifierKeymap *map = XGetModifierMapping(pDisplay);
- wxCHECK_MSG( map, false, _T("failed to get X11 modifiers map") );
+ wxCHECK_MSG( map, false, wxT("failed to get X11 modifiers map") );
for (int i = 0; i < 8; ++i)
{
if (res >= 0 && errors.GetCount() == 0)
{
wxString cmd = output[0];
- cmd << _T(' ') << url;
+ cmd << wxT(' ') << url;
if (wxExecute(cmd))
return true;
}
int argCOrig = argC;
for ( int i = 0; i < argCOrig; i++ )
{
- if (wxStrcmp( argV[i], _T("-display") ) == 0)
+ if (wxStrcmp( argV[i], wxT("-display") ) == 0)
{
if (i < (argC - 1))
{
argC -= 2;
}
}
- else if (wxStrcmp( argV[i], _T("-geometry") ) == 0)
+ else if (wxStrcmp( argV[i], wxT("-geometry") ) == 0)
{
if (i < (argC - 1))
{
argV[i++] = NULL;
int w, h;
- if (wxSscanf(argV[i], _T("%dx%d"), &w, &h) != 2)
+ if (wxSscanf(argV[i], wxT("%dx%d"), &w, &h) != 2)
{
wxLogError( _("Invalid geometry specification '%s'"),
wxString(argV[i]).c_str() );
argC -= 2;
}
}
- else if (wxStrcmp( argV[i], _T("-sync") ) == 0)
+ else if (wxStrcmp( argV[i], wxT("-sync") ) == 0)
{
syncDisplay = true;
argV[i] = NULL;
argC--;
}
- else if (wxStrcmp( argV[i], _T("-iconic") ) == 0)
+ else if (wxStrcmp( argV[i], wxT("-iconic") ) == 0)
{
g_showIconic = true;
#if !wxUSE_NANOX
case GraphicsExpose:
{
- wxLogTrace( _T("expose"), _T("GraphicsExpose from %s"), win->GetName().c_str());
+ wxLogTrace( wxT("expose"), wxT("GraphicsExpose from %s"), win->GetName().c_str());
win->GetUpdateRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y,
event->xgraphicsexpose.width, event->xgraphicsexpose.height);
g_prevFocus = wxWindow::FindFocus();
g_nextFocus = win;
- wxLogTrace( _T("focus"), _T("About to call SetFocus on %s of type %s due to button press"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
+ wxLogTrace( wxT("focus"), wxT("About to call SetFocus on %s of type %s due to button press"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
// Record the fact that this window is
// getting the focus, because we'll need to
(event->xfocus.mode == NotifyNormal))
#endif
{
- wxLogTrace( _T("focus"), _T("FocusIn from %s of type %s"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
+ wxLogTrace( wxT("focus"), wxT("FocusIn from %s of type %s"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
extern wxWindow* g_GettingFocus;
if (g_GettingFocus && g_GettingFocus->GetParent() == win)
// Ignore this, this can be a spurious FocusIn
// caused by a child having its focus set.
g_GettingFocus = NULL;
- wxLogTrace( _T("focus"), _T("FocusIn from %s of type %s being deliberately ignored"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
+ wxLogTrace( wxT("focus"), wxT("FocusIn from %s of type %s being deliberately ignored"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
return true;
}
else
(event->xfocus.mode == NotifyNormal))
#endif
{
- wxLogTrace( _T("focus"), _T("FocusOut from %s of type %s"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
+ wxLogTrace( wxT("focus"), wxT("FocusOut from %s of type %s"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
wxFocusEvent focusEvent(wxEVT_KILL_FOCUS, win->GetId());
focusEvent.SetEventObject(win);
Window wxGetWindowParent(Window window)
{
- wxASSERT_MSG( window, _T("invalid window") );
+ wxASSERT_MSG( window, wxT("invalid window") );
return (Window) 0;
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->m_style;
}
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_colour;
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, _T("invalid brush") );
+ wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
return &M_BRUSHDATA->m_stipple;
}
// the trace mask we use with wxLogTrace() - call
// wxLog::AddTraceMask(TRACE_CLIPBOARD) to enable the trace messages from here
// (there will be a *lot* of them!)
-static const wxChar *TRACE_CLIPBOARD = _T("clipboard");
+static const wxChar *TRACE_CLIPBOARD = wxT("clipboard");
#endif // __WXDEBUG__
if ( strcmp(gdk_atom_name(type), "TARGETS") )
{
wxLogTrace( TRACE_CLIPBOARD,
- _T("got unsupported clipboard target") );
+ wxT("got unsupported clipboard target") );
clipboard->m_waiting = false;
return;
if ( (*p == '\r' && *(p+1) == '\n') || !*p )
{
size_t lenPrefix = 5; // strlen("file:")
- if ( filename.Left(lenPrefix).MakeLower() == _T("file:") )
+ if ( filename.Left(lenPrefix).MakeLower() == wxT("file:") )
{
// sometimes the syntax is "file:filename", sometimes it's
// URL-like: "file://filename" - deal with both
- if ( filename[lenPrefix] == _T('/') &&
- filename[lenPrefix + 1] == _T('/') )
+ if ( filename[lenPrefix] == wxT('/') &&
+ filename[lenPrefix + 1] == wxT('/') )
{
// skip the slashes
lenPrefix += 2;
}
else
{
- wxLogDebug(_T("Unsupported URI '%s' in wxFileDataObject"),
+ wxLogDebug(wxT("Unsupported URI '%s' in wxFileDataObject"),
filename.c_str());
}
void wxWindowDCImpl::DoGetSize( int* width, int* height ) const
{
- wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") );
+ wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") );
m_window->GetSize(width, height);
}
wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window )
: wxWindowDCImpl( owner, window )
{
- wxCHECK_RET( window, _T("NULL window in wxClientDC::wxClientDC") );
+ wxCHECK_RET( window, wxT("NULL window in wxClientDC::wxClientDC") );
m_x11window = (WXWindow*) window->GetClientAreaWindow();
void wxClientDCImpl::DoGetSize(int *width, int *height) const
{
- wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") );
+ wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") );
m_window->GetClientSize( width, height );
}
// display
wxDCModule()
{
- AddDependency(wxClassInfo::FindClass(_T("wxX11DisplayModule")));
+ AddDependency(wxClassInfo::FindClass(wxT("wxX11DisplayModule")));
}
bool OnInit() { wxInitGCPool(); return true; }
wxGUIEventLoop::~wxGUIEventLoop()
{
- wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") );
+ wxASSERT_MSG( !m_impl, wxT("should have been deleted in Run()") );
}
int wxGUIEventLoop::Run()
{
// event loops are not recursive, you need to create another loop!
- wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") );
+ wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") );
m_impl = new wxEventLoopImpl;
void wxGUIEventLoop::Exit(int rc)
{
- wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") );
+ wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") );
m_impl->SetExitCode(rc);
m_impl->m_keepGoing = false;
break;
default:
- wxFAIL_MSG(_T("unknown Pango font weight"));
+ wxFAIL_MSG(wxT("unknown Pango font weight"));
// fall through
case PANGO_WEIGHT_NORMAL:
m_weight = wxFONTWEIGHT_NORMAL;
wxString w = m_nativeFontInfo.GetXFontComponent(wxXLFD_WEIGHT).Upper();
- if ( !w.empty() && w != _T('*') )
+ if ( !w.empty() && w != wxT('*') )
{
// the test below catches all of BOLD, EXTRABOLD, DEMIBOLD, ULTRABOLD
// and BLACK
- if ( ((w[0u] == _T('B') && (!wxStrcmp(w.c_str() + 1, wxT("OLD")) ||
+ if ( ((w[0u] == wxT('B') && (!wxStrcmp(w.c_str() + 1, wxT("OLD")) ||
!wxStrcmp(w.c_str() + 1, wxT("LACK"))))) ||
- wxStrstr(w.c_str() + 1, _T("BOLD")) )
+ wxStrstr(w.c_str() + 1, wxT("BOLD")) )
{
m_weight = wxFONTWEIGHT_BOLD;
}
- else if ( w == _T("LIGHT") || w == _T("THIN") )
+ else if ( w == wxT("LIGHT") || w == wxT("THIN") )
{
m_weight = wxFONTWEIGHT_LIGHT;
}
switch ( wxToupper( m_nativeFontInfo.
GetXFontComponent(wxXLFD_SLANT)[0u]).GetValue() )
{
- case _T('I'): // italique
+ case wxT('I'): // italique
m_style = wxFONTSTYLE_ITALIC;
break;
- case _T('O'): // oblique
+ case wxT('O'): // oblique
m_style = wxFONTSTYLE_SLANT;
break;
// examine the spacing: if the font is monospaced, assume wxTELETYPE
// family for compatibility with the old code which used it instead of
// IsFixedWidth()
- if ( m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING).Upper() == _T('M') )
+ if ( m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING).Upper() == wxT('M') )
{
m_family = wxFONTFAMILY_TELETYPE;
}
registry = m_nativeFontInfo.GetXFontComponent(wxXLFD_REGISTRY).Upper(),
encoding = m_nativeFontInfo.GetXFontComponent(wxXLFD_ENCODING).Upper();
- if ( registry == _T("ISO8859") )
+ if ( registry == wxT("ISO8859") )
{
int cp;
if ( wxSscanf(encoding, wxT("%d"), &cp) == 1 )
m_encoding = (wxFontEncoding)(wxFONTENCODING_ISO8859_1 + cp - 1);
}
}
- else if ( registry == _T("MICROSOFT") )
+ else if ( registry == wxT("MICROSOFT") )
{
int cp;
if ( wxSscanf(encoding, wxT("cp125%d"), &cp) == 1 )
m_encoding = (wxFontEncoding)(wxFONTENCODING_CP1250 + cp);
}
}
- else if ( registry == _T("KOI8") )
+ else if ( registry == wxT("KOI8") )
{
m_encoding = wxFONTENCODING_KOI8;
}
pango_font_description_set_style( desc, PANGO_STYLE_OBLIQUE );
break;
default:
- wxFAIL_MSG( _T("unknown font style") );
+ wxFAIL_MSG( wxT("unknown font style") );
// fall through
case wxFONTSTYLE_NORMAL:
pango_font_description_set_style( desc, PANGO_STYLE_NORMAL );
wxString registry = tn.GetNextToken().MakeUpper(),
encoding = tn.GetNextToken().MakeUpper();
- if ( registry == _T("ISO8859") )
+ if ( registry == wxT("ISO8859") )
{
int cp;
if ( wxSscanf(encoding, wxT("%d"), &cp) == 1 )
(wxFontEncoding)(wxFONTENCODING_ISO8859_1 + cp - 1);
}
}
- else if ( registry == _T("MICROSOFT") )
+ else if ( registry == wxT("MICROSOFT") )
{
int cp;
if ( wxSscanf(encoding, wxT("cp125%d"), &cp) == 1 )
(wxFontEncoding)(wxFONTENCODING_CP1250 + cp);
}
}
- else if ( registry == _T("KOI8") )
+ else if ( registry == wxT("KOI8") )
{
M_FONTDATA->m_encoding = wxFONTENCODING_KOI8;
}
wxString spacing = M_FONTDATA->
m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING);
- return spacing.Upper() == _T('M');
+ return spacing.Upper() == wxT('M');
}
// Unreaceable code for now
// return wxFontBase::IsFixedWidth();
bool wxRegion::DoUnionWithRegion( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+ wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoIntersect( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+ wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoSubtract( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+ wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoXor( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+ wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
if (!m_refData)
{
{
if (xevent->type == MapNotify)
{
- wxLogDebug(_T("Window was mapped"));
+ wxLogDebug(wxT("Window was mapped"));
}
if (xevent->type == MapNotify && !xevent->xmap.override_redirect &&
(client = (Window) FindAClientWindow((WXWindow) xevent->xmap.window, sm_name)))
{
- wxLogDebug(_T("Found a client window, about to reparent"));
+ wxLogDebug(wxT("Found a client window, about to reparent"));
wxASSERT(sm_toReparent->GetParent() == NULL);
sm_toReparent->SetHandle((WXWindow) client);
xevent->xmap.override_redirect &&
xevent->xmap.window)
{
- wxLogDebug(_T("Found an override redirect window, about to reparent"));
+ wxLogDebug(wxT("Found an override redirect window, about to reparent"));
sm_toReparent->SetHandle((WXWindow) xevent->xmap.window);
sm_newParent->AddChild(sm_toReparent);
wxASSERT(sm_toReparent->GetParent() == NULL);
if (wxWindowIsVisible(xwindow))
{
- wxLogTrace( _T("focus"), _T("wxWindowX11::SetFocus: %s"), GetClassInfo()->GetClassName());
+ wxLogTrace( wxT("focus"), wxT("wxWindowX11::SetFocus: %s"), GetClassInfo()->GetClassName());
// XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime );
XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToNone, CurrentTime );
m_needsInputFocus = false;
wxWinModule()
{
// we must be cleaned up before the display is closed
- AddDependency(wxClassInfo::FindClass(_T("wxX11DisplayModule")));
+ AddDependency(wxClassInfo::FindClass(wxT("wxX11DisplayModule")));
}
virtual bool OnInit();
GetID(),
GetAnimation(wxT("animation")),
GetPosition(), GetSize(),
- GetStyle(_T("style"), wxAC_DEFAULT_STYLE),
+ GetStyle(wxT("style"), wxAC_DEFAULT_STYLE),
GetName());
// if no inactive-bitmap has been provided, GetBitmap() will return wxNullBitmap
GetID(),
GetColour(wxT("value"), *wxBLACK),
GetPosition(), GetSize(),
- GetStyle(_T("style"), wxCLRP_DEFAULT_STYLE),
+ GetStyle(wxT("style"), wxCLRP_DEFAULT_STYLE),
wxDefaultValidator,
GetName());
GetID(),
label,
GetPosition(), GetSize(),
- GetStyle(_T("style"), wxCP_DEFAULT_STYLE),
+ GetStyle(wxT("style"), wxCP_DEFAULT_STYLE),
wxDefaultValidator,
GetName());
- ctrl->Collapse(GetBool(_T("collapsed")));
+ ctrl->Collapse(GetBool(wxT("collapsed")));
SetupWindow(ctrl);
wxCollapsiblePane *old_par = m_collpane;
GetID(),
wxDefaultDateTime,
GetPosition(), GetSize(),
- GetStyle(_T("style"), wxDP_DEFAULT | wxDP_SHOWCENTURY),
+ GetStyle(wxT("style"), wxDP_DEFAULT | wxDP_SHOWCENTURY),
wxDefaultValidator,
GetName());
GetParamValue(wxT("value")),
GetText(wxT("message")),
GetPosition(), GetSize(),
- GetStyle(_T("style"), wxDIRP_DEFAULT_STYLE),
+ GetStyle(wxT("style"), wxDIRP_DEFAULT_STYLE),
wxDefaultValidator,
GetName());
GetText(wxT("defaultdirectory")),
GetText(wxT("defaultfilename")),
GetParamValue(wxT("wildcard")),
- GetStyle(_T("style"), wxFC_DEFAULT_STYLE),
+ GetStyle(wxT("style"), wxFC_DEFAULT_STYLE),
GetPosition(),
GetSize(),
GetName());
GetText(wxT("message")),
GetParamValue(wxT("wildcard")),
GetPosition(), GetSize(),
- GetStyle(_T("style"), wxFLP_DEFAULT_STYLE),
+ GetStyle(wxT("style"), wxFLP_DEFAULT_STYLE),
wxDefaultValidator,
GetName());
GetID(),
f,
GetPosition(), GetSize(),
- GetStyle(_T("style"), wxFNTP_DEFAULT_STYLE),
+ GetStyle(wxT("style"), wxFNTP_DEFAULT_STYLE),
wxDefaultValidator,
GetName());
GetID(),
GetPosition(), GetSize(),
strList,
- GetStyle(_T("style"), wxHLB_DEFAULT_STYLE),
+ GetStyle(wxT("style"), wxHLB_DEFAULT_STYLE),
wxDefaultValidator,
GetName());
// this style doesn't exist since wx 2.9.0 but we still support it (by
// ignoring it silently) in XRC files to avoid unimportant warnings when
// using XRC produced by old tools
- AddStyle(_T("wxTE_AUTO_SCROLL"), 0);
+ AddStyle(wxT("wxTE_AUTO_SCROLL"), 0);
AddWindowStyles();
}
tree->Create(m_parentAsWindow,
GetID(),
GetPosition(), GetSize(),
- GetStyle(_T("style"), wxTR_DEFAULT_STYLE),
+ GetStyle(wxT("style"), wxTR_DEFAULT_STYLE),
wxDefaultValidator,
GetName());
wxObject *wxUnknownWidgetXmlHandler::DoCreateResource()
{
wxASSERT_MSG( m_instance == NULL,
- _T("'unknown' controls can't be subclassed, use wxXmlResource::AttachUnknownControl") );
+ wxT("'unknown' controls can't be subclassed, use wxXmlResource::AttachUnknownControl") );
wxPanel *panel =
new wxUnknownControlContainer(m_parentAsWindow,
bool wxXmlResource::Unload(const wxString& filename)
{
wxASSERT_MSG( !wxIsWild(filename),
- _T("wildcards not supported by wxXmlResource::Unload()") );
+ wxT("wildcards not supported by wxXmlResource::Unload()") );
wxString fnd = ConvertFileNameToURL(filename);
#if wxUSE_FILESYSTEM
const bool isArchive = IsArchive(fnd);
if ( isArchive )
- fnd += _T("#zip:");
+ fnd += wxT("#zip:");
#endif // wxUSE_FILESYSTEM
bool unloaded = false;
if (modif)
{
- wxLogTrace(_T("xrc"), _T("opening file '%s'"), rec->File);
+ wxLogTrace(wxT("xrc"), wxT("opening file '%s'"), rec->File);
wxInputStream *stream = NULL;
if (!name.empty())
{
#define SYSCLR(clr) \
- if (name == _T(#clr)) return wxSystemSettings::GetColour(clr);
+ if (name == wxT(#clr)) return wxSystemSettings::GetColour(clr);
SYSCLR(wxSYS_COLOUR_SCROLLBAR)
SYSCLR(wxSYS_COLOUR_BACKGROUND)
SYSCLR(wxSYS_COLOUR_DESKTOP)
if (!name.empty())
{
#define SYSFNT(fnt) \
- if (name == _T(#fnt)) return wxSystemSettings::GetFont(fnt);
+ if (name == wxT(#fnt)) return wxSystemSettings::GetFont(fnt);
SYSFNT(wxSYS_OEM_FIXED_FONT)
SYSFNT(wxSYS_ANSI_FIXED_FONT)
SYSFNT(wxSYS_ANSI_VAR_FONT)
TempDir::TempDir()
{
- wxString tmp = wxFileName::CreateTempFileName(_T("arctest-"));
+ wxString tmp = wxFileName::CreateTempFileName(wxT("arctest-"));
if (!tmp.empty()) {
wxRemoveFile(tmp);
m_original = wxGetCwd();
void TempDir::RemoveDir(wxString& path)
{
wxCHECK_RET(!m_tmp.empty() && path.substr(0, m_tmp.length()) == m_tmp,
- _T("remove '") + path + _T("' fails safety check"));
+ wxT("remove '") + path + wxT("' fails safety check"));
const wxChar *files[] = {
- _T("text/empty"),
- _T("text/small"),
- _T("bin/bin1000"),
- _T("bin/bin4095"),
- _T("bin/bin4096"),
- _T("bin/bin4097"),
- _T("bin/bin16384"),
- _T("zero/zero5"),
- _T("zero/zero1024"),
- _T("zero/zero32768"),
- _T("zero/zero16385"),
- _T("zero/newname"),
- _T("newfile"),
+ wxT("text/empty"),
+ wxT("text/small"),
+ wxT("bin/bin1000"),
+ wxT("bin/bin4095"),
+ wxT("bin/bin4096"),
+ wxT("bin/bin4097"),
+ wxT("bin/bin16384"),
+ wxT("zero/zero5"),
+ wxT("zero/zero1024"),
+ wxT("zero/zero32768"),
+ wxT("zero/zero16385"),
+ wxT("zero/newname"),
+ wxT("newfile"),
};
const wxChar *dirs[] = {
- _T("text/"), _T("bin/"), _T("zero/"), _T("empty/")
+ wxT("text/"), wxT("bin/"), wxT("zero/"), wxT("empty/")
};
wxString tmp = m_tmp + wxFileName::GetPathSeparator();
if (!wxRmdir(m_tmp))
{
- wxLogSysError(_T("can't remove temporary dir '%s'"), m_tmp.c_str());
+ wxLogSysError(wxT("can't remove temporary dir '%s'"), m_tmp.c_str());
}
}
// It should be possible to create a directory entry just by supplying
// a name that looks like a directory, or alternatively any old name
// can be identified as a directory using SetIsDir or PutNextDirEntry
- bool setIsDir = name.Last() == _T('/') && (choices & 1);
+ bool setIsDir = name.Last() == wxT('/') && (choices & 1);
if (setIsDir)
name.erase(name.length() - 1);
// provide some context for the error message so that we know which
// iteration of the loop we were on
- string error_entry((_T(" '") + name + _T("'")).mb_str());
+ string error_entry((wxT(" '") + name + wxT("'")).mb_str());
string error_context(" failed for entry" + error_entry);
if ((choices & 2) || testEntry.IsText()) {
testEntry.GetLength()));
}
- if (it->first.Last() != _T('/')) {
+ if (it->first.Last() != wxT('/')) {
// for non-dirs write the data
arc->Write(testEntry.GetData(), testEntry.GetSize());
CPPUNIT_ASSERT_MESSAGE("LastWrite check" + error_context,
if ((m_options & PipeOut) == 0) {
wxFileName fn(tmpdir.GetName());
- fn.SetExt(_T("arc"));
+ fn.SetExt(wxT("arc"));
wxString tmparc = fn.GetPath(wxPATH_GET_SEPARATOR) + fn.GetFullName();
// call the archiver to create an archive file
else {
// for the non-seekable test, have the archiver output to "-"
// and read the archive via a pipe
- PFileInputStream in(wxString::Format(archiver, _T("-")));
+ PFileInputStream in(wxString::Format(archiver, wxT("-")));
if (in.Ok())
out.Write(in);
}
auto_ptr<OutputStreamT> arcOut(m_factory->NewStream(out));
EntryT *pEntry;
- const wxString deleteName = _T("bin/bin1000");
- const wxString renameFrom = _T("zero/zero1024");
- const wxString renameTo = _T("zero/newname");
- const wxString newName = _T("newfile");
+ const wxString deleteName = wxT("bin/bin1000");
+ const wxString renameFrom = wxT("zero/zero1024");
+ const wxString renameTo = wxT("zero/newname");
+ const wxString newName = wxT("newfile");
const char *newData = "New file added as a test\n";
arcOut->CopyArchiveMetaData(*arcIn);
// provide some context for the error message so that we know which
// iteration of the loop we were on
- string error_entry((_T(" '") + name + _T("'")).mb_str());
+ string error_entry((wxT(" '") + name + wxT("'")).mb_str());
string error_context(" failed for entry" + error_entry);
if (name == deleteName) {
// provide some context for the error message so that we know which
// iteration of the loop we were on
- string error_entry((_T(" '") + name + _T("'")).mb_str());
+ string error_entry((wxT(" '") + name + wxT("'")).mb_str());
string error_context(" failed for entry" + error_entry);
TestEntries::iterator it = m_testEntries.find(name);
"arc->GetLength() == entry->GetSize()" + error_context,
arc->GetLength() == entry->GetSize());
- if (name.Last() != _T('/'))
+ if (name.Last() != wxT('/'))
{
CPPUNIT_ASSERT_MESSAGE("!IsDir" + error_context,
!entry->IsDir());
if ((m_options & PipeIn) == 0) {
wxFileName fn(tmpdir.GetName());
- fn.SetExt(_T("arc"));
+ fn.SetExt(wxT("arc"));
wxString tmparc = fn.GetPath(wxPATH_GET_SEPARATOR) + fn.GetFullName();
if (m_options & Stub)
else {
// for the non-seekable test, have the archiver extract "-" and
// feed it the archive via a pipe
- PFileOutputStream out(wxString::Format(unarchiver, _T("-")));
+ PFileOutputStream out(wxString::Format(unarchiver, wxT("-")));
if (out.Ok())
out.Write(in);
}
bool isDir = wxDirExists(path);
if (isDir)
- name += _T("/");
+ name += wxT("/");
// provide some context for the error message so that we know which
// iteration of the loop we were on
- string error_entry((_T(" '") + name + _T("'")).mb_str());
+ string error_entry((wxT(" '") + name + wxT("'")).mb_str());
string error_context(" failed for entry" + error_entry);
TestEntries::iterator it = m_testEntries.find(name);
#endif
// the names of two entries to read
- const wxChar *name = _T("text/small");
- const wxChar *name2 = _T("bin/bin1000");
+ const wxChar *name = wxT("text/small");
+ const wxChar *name2 = wxT("bin/bin1000");
// open them
typename ArchiveCatalog::iterator j;
{
auto_ptr<wxArchiveOutputStream> arc(m_factory->NewStream(out));
- arc->PutNextDirEntry(_T("dir"));
- arc->PutNextEntry(_T("file"));
- arc->Write(_T("foo"), 3);
+ arc->PutNextDirEntry(wxT("dir"));
+ arc->PutNextEntry(wxT("file"));
+ arc->Write(wxT("foo"), 3);
}
void CorruptionTestCase::ExtractArchive(wxInputStream& in)
string TestId::MakeId()
{
m_seed = (m_seed * 171) % 30269;
- return string(wxString::Format(_T("%-6d"), m_seed).mb_str());
+ return string(wxString::Format(wxT("%-6d"), m_seed).mb_str());
}
: CppUnit::TestSuite("archive/" + name),
m_name(name.c_str(), *wxConvCurrent)
{
- m_name = _T("wx") + m_name.Left(1).Upper() + m_name.Mid(1).Lower();
- m_path.AddEnvList(_T("PATH"));
- m_archivers.push_back(_T(""));
- m_unarchivers.push_back(_T(""));
+ m_name = wxT("wx") + m_name.Left(1).Upper() + m_name.Mid(1).Lower();
+ m_path.AddEnvList(wxT("PATH"));
+ m_archivers.push_back(wxT(""));
+ m_unarchivers.push_back(wxT(""));
}
// add the command for an external archiver to the list, testing for it in
bool ArchiveTestSuite::IsInPath(const wxString& cmd)
{
- wxString c = cmd.BeforeFirst(_T(' '));
+ wxString c = cmd.BeforeFirst(wxT(' '));
#ifdef __WXMSW__
- c += _T(".exe");
+ c += wxT(".exe");
#endif
return !m_path.FindValidPath(c).empty();
}
for (int options = 0; options <= PipeIn; options += PipeIn)
{
- wxObject *pObj = wxCreateDynamicObject(m_name + _T("ClassFactory"));
+ wxObject *pObj = wxCreateDynamicObject(m_name + wxT("ClassFactory"));
wxArchiveClassFactory *factory;
factory = wxDynamicCast(pObj, wxArchiveClassFactory);
wxString descr;
if (genericInterface)
- descr << _T("wxArchive (") << type << _T(")");
+ descr << wxT("wxArchive (") << type << wxT(")");
else
descr << type;
if (!archiver.empty()) {
- const wxChar *fn = (options & PipeOut) != 0 ? _T("-") : _T("file");
- descr << _T(" (") << wxString::Format(archiver, fn) << _T(")");
+ const wxChar *fn = (options & PipeOut) != 0 ? wxT("-") : wxT("file");
+ descr << wxT(" (") << wxString::Format(archiver, fn) << wxT(")");
}
if (!unarchiver.empty()) {
- const wxChar *fn = (options & PipeIn) != 0 ? _T("-") : _T("file");
- descr << _T(" (") << wxString::Format(unarchiver, fn) << _T(")");
+ const wxChar *fn = (options & PipeIn) != 0 ? wxT("-") : wxT("file");
+ descr << wxT(" (") << wxString::Format(unarchiver, fn) << wxT(")");
}
wxString optstr;
if ((options & PipeIn) != 0)
- optstr += _T("|PipeIn");
+ optstr += wxT("|PipeIn");
if ((options & PipeOut) != 0)
- optstr += _T("|PipeOut");
+ optstr += wxT("|PipeOut");
if ((options & Stub) != 0)
- optstr += _T("|Stub");
+ optstr += wxT("|Stub");
if (!optstr.empty())
- optstr = _T(" (") + optstr.substr(1) + _T(")");
+ optstr = wxT(" (") + optstr.substr(1) + wxT(")");
descr << optstr;
tartest::tartest()
: ArchiveTestSuite("tar")
{
- AddArchiver(_T("tar cf %s *"));
- AddUnArchiver(_T("tar xf %s"));
+ AddArchiver(wxT("tar cf %s *"));
+ AddUnArchiver(wxT("tar xf %s"));
}
CppUnit::Test *tartest::makeTest(
void ZipTestCase::OnCreateArchive(wxZipOutputStream& zip)
{
- m_comment << _T("Comment for test ") << m_id;
+ m_comment << wxT("Comment for test ") << m_id;
zip.SetComment(m_comment);
}
switch ((m_id + m_count) % 5) {
case 0:
{
- wxString comment = _T("Comment for ") + entry->GetName();
+ wxString comment = wxT("Comment for ") + entry->GetName();
entry->SetComment(comment);
// lowercase the expected result, and the notifier should do
// the same for the zip entries when ModifyArchive() runs
{
// provide some context for the error message so that we know which
// iteration of the loop we were on
- wxString name = _T(" '") + entry.GetName() + _T("'");
+ wxString name = wxT(" '") + entry.GetName() + wxT("'");
string error_entry(name.mb_str());
string error_context(" failed for entry" + error_entry);
{
TestOutputStream out(m_options);
- wxString testdata = _T("test data to pipe through zip");
- wxString cmd = _T("echo ") + testdata + _T(" | zip -q - -");
+ wxString testdata = wxT("test data to pipe through zip");
+ wxString cmd = wxT("echo ") + testdata + wxT(" | zip -q - -");
{
PFileInputStream in(cmd);
ziptest::ziptest()
: ArchiveTestSuite("zip")
{
- AddArchiver(_T("zip -qr %s *"));
- AddUnArchiver(_T("unzip -q %s"));
+ AddArchiver(wxT("zip -qr %s *"));
+ AddUnArchiver(wxT("unzip -q %s"));
}
ArchiveTestSuite *ziptest::makeSuite()
// The gnuwin32 build of infozip does work for this, e.g.:
// C:\>echo test data to pipe through zip | zip -q > foo.zip
// doesn't produce a valid zip, so disabled for now.
- if (IsInPath(_T("zip")))
+ if (IsInPath(wxT("zip")))
for (int options = 0; options <= PipeIn; options += PipeIn) {
- string name = Description(_T("ZipPipeTestCase"), options,
- false, _T(""), _T("zip -q - -"));
+ string name = Description(wxT("ZipPipeTestCase"), options,
+ false, wxT(""), wxT("zip -q - -"));
addTest(new ZipPipeTestCase(name, options));
}
#endif
void ArraysTestCase::wxStringArrayTest()
{
wxArrayString a1;
- a1.Add(_T("thermit"));
- a1.Add(_T("condor"));
- a1.Add(_T("lion"), 3);
- a1.Add(_T("dog"));
- a1.Add(_T("human"));
- a1.Add(_T("alligator"));
-
- CPPUNIT_ASSERT( COMPARE_8_VALUES( a1 , _T("thermit") ,
- _T("condor") ,
- _T("lion") ,
- _T("lion") ,
- _T("lion") ,
- _T("dog") ,
- _T("human") ,
- _T("alligator") ) );
+ a1.Add(wxT("thermit"));
+ a1.Add(wxT("condor"));
+ a1.Add(wxT("lion"), 3);
+ a1.Add(wxT("dog"));
+ a1.Add(wxT("human"));
+ a1.Add(wxT("alligator"));
+
+ CPPUNIT_ASSERT( COMPARE_8_VALUES( a1 , wxT("thermit") ,
+ wxT("condor") ,
+ wxT("lion") ,
+ wxT("lion") ,
+ wxT("lion") ,
+ wxT("dog") ,
+ wxT("human") ,
+ wxT("alligator") ) );
CPPUNIT_ASSERT( COMPARE_COUNT( a1 , 8 ) );
wxArrayString a2(a1);
- CPPUNIT_ASSERT( COMPARE_8_VALUES( a2 , _T("thermit") ,
- _T("condor") ,
- _T("lion") ,
- _T("lion") ,
- _T("lion") ,
- _T("dog") ,
- _T("human") ,
- _T("alligator") ) );
+ CPPUNIT_ASSERT( COMPARE_8_VALUES( a2 , wxT("thermit") ,
+ wxT("condor") ,
+ wxT("lion") ,
+ wxT("lion") ,
+ wxT("lion") ,
+ wxT("dog") ,
+ wxT("human") ,
+ wxT("alligator") ) );
CPPUNIT_ASSERT( COMPARE_COUNT( a2 , 8 ) );
wxSortedArrayString a3(a1);
- CPPUNIT_ASSERT( COMPARE_8_VALUES( a3 , _T("alligator") ,
- _T("condor") ,
- _T("dog") ,
- _T("human") ,
- _T("lion") ,
- _T("lion") ,
- _T("lion") ,
- _T("thermit") ) );
+ CPPUNIT_ASSERT( COMPARE_8_VALUES( a3 , wxT("alligator") ,
+ wxT("condor") ,
+ wxT("dog") ,
+ wxT("human") ,
+ wxT("lion") ,
+ wxT("lion") ,
+ wxT("lion") ,
+ wxT("thermit") ) );
CPPUNIT_ASSERT( COMPARE_COUNT( a3 , 8 ) );
wxSortedArrayString a4;
for (wxArrayString::iterator it = a1.begin(), en = a1.end(); it != en; ++it)
a4.Add(*it);
- CPPUNIT_ASSERT( COMPARE_8_VALUES( a4 , _T("alligator") ,
- _T("condor") ,
- _T("dog") ,
- _T("human") ,
- _T("lion") ,
- _T("lion") ,
- _T("lion") ,
- _T("thermit") ) );
+ CPPUNIT_ASSERT( COMPARE_8_VALUES( a4 , wxT("alligator") ,
+ wxT("condor") ,
+ wxT("dog") ,
+ wxT("human") ,
+ wxT("lion") ,
+ wxT("lion") ,
+ wxT("lion") ,
+ wxT("thermit") ) );
CPPUNIT_ASSERT( COMPARE_COUNT( a4 , 8 ) );
a1.RemoveAt(2,3);
- CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , _T("thermit") ,
- _T("condor") ,
- _T("dog") ,
- _T("human") ,
- _T("alligator") ) );
+ CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , wxT("thermit") ,
+ wxT("condor") ,
+ wxT("dog") ,
+ wxT("human") ,
+ wxT("alligator") ) );
CPPUNIT_ASSERT( COMPARE_COUNT( a1 , 5 ) );
a2 = a1;
- CPPUNIT_ASSERT( COMPARE_5_VALUES( a2 , _T("thermit") ,
- _T("condor") ,
- _T("dog") ,
- _T("human") ,
- _T("alligator") ) );
+ CPPUNIT_ASSERT( COMPARE_5_VALUES( a2 , wxT("thermit") ,
+ wxT("condor") ,
+ wxT("dog") ,
+ wxT("human") ,
+ wxT("alligator") ) );
CPPUNIT_ASSERT( COMPARE_COUNT( a2 , 5 ) );
a1.Sort(false);
- CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , _T("alligator") ,
- _T("condor") ,
- _T("dog") ,
- _T("human") ,
- _T("thermit") ) );
+ CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , wxT("alligator") ,
+ wxT("condor") ,
+ wxT("dog") ,
+ wxT("human") ,
+ wxT("thermit") ) );
CPPUNIT_ASSERT( COMPARE_COUNT( a1 , 5 ) );
a1.Sort(true);
- CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , _T("thermit") ,
- _T("human") ,
- _T("dog") ,
- _T("condor") ,
- _T("alligator") ) );
+ CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , wxT("thermit") ,
+ wxT("human") ,
+ wxT("dog") ,
+ wxT("condor") ,
+ wxT("alligator") ) );
CPPUNIT_ASSERT( COMPARE_COUNT( a1 , 5 ) );
a1.Sort(&StringLenCompare);
- CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , _T("dog") ,
- _T("human") ,
- _T("condor") ,
- _T("thermit") ,
- _T("alligator") ) );
+ CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , wxT("dog") ,
+ wxT("human") ,
+ wxT("condor") ,
+ wxT("thermit") ,
+ wxT("alligator") ) );
CPPUNIT_ASSERT( COMPARE_COUNT( a1 , 5 ) );
- CPPUNIT_ASSERT( a1.Index( _T("dog") ) == 0 );
- CPPUNIT_ASSERT( a1.Index( _T("human") ) == 1 );
- CPPUNIT_ASSERT( a1.Index( _T("humann") ) == wxNOT_FOUND );
- CPPUNIT_ASSERT( a1.Index( _T("condor") ) == 2 );
- CPPUNIT_ASSERT( a1.Index( _T("thermit") ) == 3 );
- CPPUNIT_ASSERT( a1.Index( _T("alligator") ) == 4 );
+ CPPUNIT_ASSERT( a1.Index( wxT("dog") ) == 0 );
+ CPPUNIT_ASSERT( a1.Index( wxT("human") ) == 1 );
+ CPPUNIT_ASSERT( a1.Index( wxT("humann") ) == wxNOT_FOUND );
+ CPPUNIT_ASSERT( a1.Index( wxT("condor") ) == 2 );
+ CPPUNIT_ASSERT( a1.Index( wxT("thermit") ) == 3 );
+ CPPUNIT_ASSERT( a1.Index( wxT("alligator") ) == 4 );
wxArrayString a5;
- CPPUNIT_ASSERT( a5.Add( _T("x"), 1 ) == 0 );
- CPPUNIT_ASSERT( a5.Add( _T("a"), 3 ) == 1 );
+ CPPUNIT_ASSERT( a5.Add( wxT("x"), 1 ) == 0 );
+ CPPUNIT_ASSERT( a5.Add( wxT("a"), 3 ) == 1 );
- CPPUNIT_ASSERT( COMPARE_4_VALUES( a5, _T("x") ,
- _T("a") ,
- _T("a") ,
- _T("a") ) );
+ CPPUNIT_ASSERT( COMPARE_4_VALUES( a5, wxT("x") ,
+ wxT("a") ,
+ wxT("a") ,
+ wxT("a") ) );
a5.assign(a1.end(), a1.end());
CPPUNIT_ASSERT( a5.empty() );
}
wxArrayString emptyArray;
- wxString string = wxJoin(emptyArray, _T(';'));
+ wxString string = wxJoin(emptyArray, wxT(';'));
CPPUNIT_ASSERT( string.empty() );
- CPPUNIT_ASSERT( wxSplit(string, _T(';')).empty() );
+ CPPUNIT_ASSERT( wxSplit(string, wxT(';')).empty() );
- CPPUNIT_ASSERT_EQUAL( 2, wxSplit(_T(";"), _T(';')).size() );
+ CPPUNIT_ASSERT_EQUAL( 2, wxSplit(wxT(";"), wxT(';')).size() );
}
void ArraysTestCase::wxObjArrayTest()
{
{
ArrayBars bars;
- Bar bar(_T("first bar in general, second bar in array (two copies!)"));
+ Bar bar(wxT("first bar in general, second bar in array (two copies!)"));
CPPUNIT_ASSERT_EQUAL( 0, bars.GetCount() );
CPPUNIT_ASSERT_EQUAL( 1, Bar::GetNumber() );
- bars.Add(new Bar(_T("first bar in array")));
+ bars.Add(new Bar(wxT("first bar in array")));
bars.Add(bar, 2);
CPPUNIT_ASSERT_EQUAL( 3, bars.GetCount() );
// DLL options compatibility check:
WX_CHECK_BUILD_OPTIONS("wxHTML")
-const wxChar *wxTRACE_HTML_DEBUG = _T("htmldebug");
+const wxChar *wxTRACE_HTML_DEBUG = wxT("htmldebug");
//-----------------------------------------------------------------------------
// wx28HtmlParser helpers
bool wxMetaTagHandler::HandleTag(const wx28HtmlTag& tag)
{
- if (tag.GetName() == _T("BODY"))
+ if (tag.GetName() == wxT("BODY"))
{
m_Parser->StopParsing();
return false;
}
- if (tag.HasParam(_T("HTTP-EQUIV")) &&
- tag.GetParam(_T("HTTP-EQUIV")).IsSameAs(_T("Content-Type"), false) &&
- tag.HasParam(_T("CONTENT")))
+ if (tag.HasParam(wxT("HTTP-EQUIV")) &&
+ tag.GetParam(wxT("HTTP-EQUIV")).IsSameAs(wxT("Content-Type"), false) &&
+ tag.HasParam(wxT("CONTENT")))
{
- wxString content = tag.GetParam(_T("CONTENT")).Lower();
- if (content.Left(19) == _T("text/html; charset="))
+ wxString content = tag.GetParam(wxT("CONTENT")).Lower();
+ if (content.Left(19) == wxT("text/html; charset="))
{
*m_retval = content.Mid(19);
m_Parser->StopParsing();
bool wxIsCDATAElement(const wxChar *tag)
{
- return (wxStrcmp(tag, _T("SCRIPT")) == 0) ||
- (wxStrcmp(tag, _T("STYLE")) == 0);
+ return (wxStrcmp(tag, wxT("SCRIPT")) == 0) ||
+ (wxStrcmp(tag, wxT("STYLE")) == 0);
}
wx28HtmlTagsCache::wx28HtmlTagsCache(const wxString& source)
{
tagBuffer[i] = (wxChar)wxToupper(src[pos]);
}
- tagBuffer[i] = _T('\0');
+ tagBuffer[i] = wxT('\0');
m_Cache[tg].Name = new wxChar[i+1];
memcpy(m_Cache[tg].Name, tagBuffer, (i+1)*sizeof(wxChar));
bool wx28HtmlTag::GetParamAsColour(const wxString& par, wxColour *clr) const
{
- wxCHECK_MSG( clr, false, _T("invalid colour argument") );
+ wxCHECK_MSG( clr, false, wxT("invalid colour argument") );
wxString str = GetParam(par);
// handle colours defined in HTML 4.0 first:
- if (str.length() > 1 && str[0] != _T('#'))
+ if (str.length() > 1 && str[0] != wxT('#'))
{
#define HTML_COLOUR(name, r, g, b) \
if (str.IsSameAs(wxT(name), false)) \
#include "wx/log.h"
static const wxChar *testconfig =
-_T("[root]\n")
-_T("entry=value\n")
-_T("[root/group1]\n")
-_T("[root/group1/subgroup]\n")
-_T("subentry=subvalue\n")
-_T("subentry2=subvalue2\n")
-_T("[root/group2]\n")
+wxT("[root]\n")
+wxT("entry=value\n")
+wxT("[root/group1]\n")
+wxT("[root/group1/subgroup]\n")
+wxT("subentry=subvalue\n")
+wxT("subentry2=subvalue2\n")
+wxT("[root/group2]\n")
;
// ----------------------------------------------------------------------------
wxStringInputStream sis(testconfig);
wxFileConfig fc(sis);
- CPPUNIT_ASSERT( ChangePath(fc, _T("")) == _T("") );
- CPPUNIT_ASSERT( ChangePath(fc, _T("/")) == _T("") );
- CPPUNIT_ASSERT( ChangePath(fc, _T("root")) == _T("/root") );
- CPPUNIT_ASSERT( ChangePath(fc, _T("/root")) == _T("/root") );
- CPPUNIT_ASSERT( ChangePath(fc, _T("/root/group1/subgroup")) == _T("/root/group1/subgroup") );
- CPPUNIT_ASSERT( ChangePath(fc, _T("/root/group2")) == _T("/root/group2") );
+ CPPUNIT_ASSERT( ChangePath(fc, wxT("")) == wxT("") );
+ CPPUNIT_ASSERT( ChangePath(fc, wxT("/")) == wxT("") );
+ CPPUNIT_ASSERT( ChangePath(fc, wxT("root")) == wxT("/root") );
+ CPPUNIT_ASSERT( ChangePath(fc, wxT("/root")) == wxT("/root") );
+ CPPUNIT_ASSERT( ChangePath(fc, wxT("/root/group1/subgroup")) == wxT("/root/group1/subgroup") );
+ CPPUNIT_ASSERT( ChangePath(fc, wxT("/root/group2")) == wxT("/root/group2") );
}
void FileConfigTestCase::AddEntries()
{
wxFileConfig fc;
- wxVERIFY_FILECONFIG( _T(""), fc );
+ wxVERIFY_FILECONFIG( wxT(""), fc );
- fc.Write(_T("/Foo"), _T("foo"));
- wxVERIFY_FILECONFIG( _T("Foo=foo\n"), fc );
+ fc.Write(wxT("/Foo"), wxT("foo"));
+ wxVERIFY_FILECONFIG( wxT("Foo=foo\n"), fc );
- fc.Write(_T("/Bar/Baz"), _T("baz"));
- wxVERIFY_FILECONFIG( _T("Foo=foo\n[Bar]\nBaz=baz\n"), fc );
+ fc.Write(wxT("/Bar/Baz"), wxT("baz"));
+ wxVERIFY_FILECONFIG( wxT("Foo=foo\n[Bar]\nBaz=baz\n"), fc );
fc.DeleteAll();
- wxVERIFY_FILECONFIG( _T(""), fc );
+ wxVERIFY_FILECONFIG( wxT(""), fc );
- fc.Write(_T("/Bar/Baz"), _T("baz"));
- wxVERIFY_FILECONFIG( _T("[Bar]\nBaz=baz\n"), fc );
+ fc.Write(wxT("/Bar/Baz"), wxT("baz"));
+ wxVERIFY_FILECONFIG( wxT("[Bar]\nBaz=baz\n"), fc );
- fc.Write(_T("/Foo"), _T("foo"));
- wxVERIFY_FILECONFIG( _T("Foo=foo\n[Bar]\nBaz=baz\n"), fc );
+ fc.Write(wxT("/Foo"), wxT("foo"));
+ wxVERIFY_FILECONFIG( wxT("Foo=foo\n[Bar]\nBaz=baz\n"), fc );
}
void
size_t nEntries,
...)
{
- wxConfigPathChanger change(&fc, wxString(path) + _T("/"));
+ wxConfigPathChanger change(&fc, wxString(path) + wxT("/"));
CPPUNIT_ASSERT( fc.GetNumberOfEntries() == nEntries );
size_t nGroups,
...)
{
- wxConfigPathChanger change(&fc, wxString(path) + _T("/"));
+ wxConfigPathChanger change(&fc, wxString(path) + wxT("/"));
CPPUNIT_ASSERT( fc.GetNumberOfGroups() == nGroups );
wxStringInputStream sis(testconfig);
wxFileConfig fc(sis);
- CheckGroupEntries(fc, _T(""), 0);
- CheckGroupEntries(fc, _T("/root"), 1, _T("entry"));
- CheckGroupEntries(fc, _T("/root/group1"), 0);
- CheckGroupEntries(fc, _T("/root/group1/subgroup"),
- 2, _T("subentry"), _T("subentry2"));
+ CheckGroupEntries(fc, wxT(""), 0);
+ CheckGroupEntries(fc, wxT("/root"), 1, wxT("entry"));
+ CheckGroupEntries(fc, wxT("/root/group1"), 0);
+ CheckGroupEntries(fc, wxT("/root/group1/subgroup"),
+ 2, wxT("subentry"), wxT("subentry2"));
}
void FileConfigTestCase::GetGroups()
wxStringInputStream sis(testconfig);
wxFileConfig fc(sis);
- CheckGroupSubgroups(fc, _T(""), 1, _T("root"));
- CheckGroupSubgroups(fc, _T("/root"), 2, _T("group1"), _T("group2"));
- CheckGroupSubgroups(fc, _T("/root/group1"), 1, _T("subgroup"));
- CheckGroupSubgroups(fc, _T("/root/group2"), 0);
+ CheckGroupSubgroups(fc, wxT(""), 1, wxT("root"));
+ CheckGroupSubgroups(fc, wxT("/root"), 2, wxT("group1"), wxT("group2"));
+ CheckGroupSubgroups(fc, wxT("/root/group1"), 1, wxT("subgroup"));
+ CheckGroupSubgroups(fc, wxT("/root/group2"), 0);
}
void FileConfigTestCase::HasEntry()
wxStringInputStream sis(testconfig);
wxFileConfig fc(sis);
- CPPUNIT_ASSERT( !fc.HasEntry(_T("root")) );
- CPPUNIT_ASSERT( fc.HasEntry(_T("root/entry")) );
- CPPUNIT_ASSERT( fc.HasEntry(_T("/root/entry")) );
- CPPUNIT_ASSERT( fc.HasEntry(_T("root/group1/subgroup/subentry")) );
- CPPUNIT_ASSERT( !fc.HasEntry(_T("")) );
- CPPUNIT_ASSERT( !fc.HasEntry(_T("root/group1")) );
- CPPUNIT_ASSERT( !fc.HasEntry(_T("subgroup/subentry")) );
- CPPUNIT_ASSERT( !fc.HasEntry(_T("/root/no_such_group/entry")) );
- CPPUNIT_ASSERT( !fc.HasGroup(_T("/root/no_such_group")) );
+ CPPUNIT_ASSERT( !fc.HasEntry(wxT("root")) );
+ CPPUNIT_ASSERT( fc.HasEntry(wxT("root/entry")) );
+ CPPUNIT_ASSERT( fc.HasEntry(wxT("/root/entry")) );
+ CPPUNIT_ASSERT( fc.HasEntry(wxT("root/group1/subgroup/subentry")) );
+ CPPUNIT_ASSERT( !fc.HasEntry(wxT("")) );
+ CPPUNIT_ASSERT( !fc.HasEntry(wxT("root/group1")) );
+ CPPUNIT_ASSERT( !fc.HasEntry(wxT("subgroup/subentry")) );
+ CPPUNIT_ASSERT( !fc.HasEntry(wxT("/root/no_such_group/entry")) );
+ CPPUNIT_ASSERT( !fc.HasGroup(wxT("/root/no_such_group")) );
}
void FileConfigTestCase::HasGroup()
wxStringInputStream sis(testconfig);
wxFileConfig fc(sis);
- CPPUNIT_ASSERT( fc.HasGroup(_T("root")) );
- CPPUNIT_ASSERT( fc.HasGroup(_T("root/group1")) );
- CPPUNIT_ASSERT( fc.HasGroup(_T("root/group1/subgroup")) );
- CPPUNIT_ASSERT( fc.HasGroup(_T("root/group2")) );
- CPPUNIT_ASSERT( !fc.HasGroup(_T("")) );
- CPPUNIT_ASSERT( !fc.HasGroup(_T("root/group")) );
- CPPUNIT_ASSERT( !fc.HasGroup(_T("root//subgroup")) );
- CPPUNIT_ASSERT( !fc.HasGroup(_T("foot/subgroup")) );
- CPPUNIT_ASSERT( !fc.HasGroup(_T("foot")) );
+ CPPUNIT_ASSERT( fc.HasGroup(wxT("root")) );
+ CPPUNIT_ASSERT( fc.HasGroup(wxT("root/group1")) );
+ CPPUNIT_ASSERT( fc.HasGroup(wxT("root/group1/subgroup")) );
+ CPPUNIT_ASSERT( fc.HasGroup(wxT("root/group2")) );
+ CPPUNIT_ASSERT( !fc.HasGroup(wxT("")) );
+ CPPUNIT_ASSERT( !fc.HasGroup(wxT("root/group")) );
+ CPPUNIT_ASSERT( !fc.HasGroup(wxT("root//subgroup")) );
+ CPPUNIT_ASSERT( !fc.HasGroup(wxT("foot/subgroup")) );
+ CPPUNIT_ASSERT( !fc.HasGroup(wxT("foot")) );
}
void FileConfigTestCase::Binary()
wxStringInputStream sis(testconfig);
wxFileConfig fc(sis);
- CPPUNIT_ASSERT( !fc.DeleteEntry(_T("foo")) );
+ CPPUNIT_ASSERT( !fc.DeleteEntry(wxT("foo")) );
- CPPUNIT_ASSERT( fc.DeleteEntry(_T("root/group1/subgroup/subentry")) );
- wxVERIFY_FILECONFIG( _T("[root]\n")
- _T("entry=value\n")
- _T("[root/group1]\n")
- _T("[root/group1/subgroup]\n")
- _T("subentry2=subvalue2\n")
- _T("[root/group2]\n"),
+ CPPUNIT_ASSERT( fc.DeleteEntry(wxT("root/group1/subgroup/subentry")) );
+ wxVERIFY_FILECONFIG( wxT("[root]\n")
+ wxT("entry=value\n")
+ wxT("[root/group1]\n")
+ wxT("[root/group1/subgroup]\n")
+ wxT("subentry2=subvalue2\n")
+ wxT("[root/group2]\n"),
fc );
// group should be deleted now as well as it became empty
- wxConfigPathChanger change(&fc, _T("root/group1/subgroup/subentry2"));
- CPPUNIT_ASSERT( fc.DeleteEntry(_T("subentry2")) );
- wxVERIFY_FILECONFIG( _T("[root]\n")
- _T("entry=value\n")
- _T("[root/group1]\n")
- _T("[root/group2]\n"),
+ wxConfigPathChanger change(&fc, wxT("root/group1/subgroup/subentry2"));
+ CPPUNIT_ASSERT( fc.DeleteEntry(wxT("subentry2")) );
+ wxVERIFY_FILECONFIG( wxT("[root]\n")
+ wxT("entry=value\n")
+ wxT("[root/group1]\n")
+ wxT("[root/group2]\n"),
fc );
}
wxStringInputStream sis(testconfig);
wxFileConfig fc(sis);
- CPPUNIT_ASSERT( !fc.DeleteGroup(_T("foo")) );
+ CPPUNIT_ASSERT( !fc.DeleteGroup(wxT("foo")) );
- CPPUNIT_ASSERT( fc.DeleteGroup(_T("root/group1")) );
- wxVERIFY_FILECONFIG( _T("[root]\n")
- _T("entry=value\n")
- _T("[root/group2]\n"),
+ CPPUNIT_ASSERT( fc.DeleteGroup(wxT("root/group1")) );
+ wxVERIFY_FILECONFIG( wxT("[root]\n")
+ wxT("entry=value\n")
+ wxT("[root/group2]\n"),
fc );
// notice trailing slash: it should be ignored
- CPPUNIT_ASSERT( fc.DeleteGroup(_T("root/group2/")) );
- wxVERIFY_FILECONFIG( _T("[root]\n")
- _T("entry=value\n"),
+ CPPUNIT_ASSERT( fc.DeleteGroup(wxT("root/group2/")) );
+ wxVERIFY_FILECONFIG( wxT("[root]\n")
+ wxT("entry=value\n"),
fc );
- CPPUNIT_ASSERT( fc.DeleteGroup(_T("root")) );
+ CPPUNIT_ASSERT( fc.DeleteGroup(wxT("root")) );
CPPUNIT_ASSERT( Dump(fc).empty() );
}
wxStringInputStream sis(testconfig);
wxFileConfig fc(sis);
- fc.SetPath(_T("root"));
- CPPUNIT_ASSERT( fc.RenameEntry(_T("entry"), _T("newname")) );
- wxVERIFY_FILECONFIG( _T("[root]\n")
- _T("newname=value\n")
- _T("[root/group1]\n")
- _T("[root/group1/subgroup]\n")
- _T("subentry=subvalue\n")
- _T("subentry2=subvalue2\n")
- _T("[root/group2]\n"),
+ fc.SetPath(wxT("root"));
+ CPPUNIT_ASSERT( fc.RenameEntry(wxT("entry"), wxT("newname")) );
+ wxVERIFY_FILECONFIG( wxT("[root]\n")
+ wxT("newname=value\n")
+ wxT("[root/group1]\n")
+ wxT("[root/group1/subgroup]\n")
+ wxT("subentry=subvalue\n")
+ wxT("subentry2=subvalue2\n")
+ wxT("[root/group2]\n"),
fc );
- fc.SetPath(_T("group1/subgroup"));
- CPPUNIT_ASSERT( !fc.RenameEntry(_T("entry"), _T("newname")) );
- CPPUNIT_ASSERT( !fc.RenameEntry(_T("subentry"), _T("subentry2")) );
-
- CPPUNIT_ASSERT( fc.RenameEntry(_T("subentry"), _T("subentry1")) );
- wxVERIFY_FILECONFIG( _T("[root]\n")
- _T("newname=value\n")
- _T("[root/group1]\n")
- _T("[root/group1/subgroup]\n")
- _T("subentry2=subvalue2\n")
- _T("subentry1=subvalue\n")
- _T("[root/group2]\n"),
+ fc.SetPath(wxT("group1/subgroup"));
+ CPPUNIT_ASSERT( !fc.RenameEntry(wxT("entry"), wxT("newname")) );
+ CPPUNIT_ASSERT( !fc.RenameEntry(wxT("subentry"), wxT("subentry2")) );
+
+ CPPUNIT_ASSERT( fc.RenameEntry(wxT("subentry"), wxT("subentry1")) );
+ wxVERIFY_FILECONFIG( wxT("[root]\n")
+ wxT("newname=value\n")
+ wxT("[root/group1]\n")
+ wxT("[root/group1/subgroup]\n")
+ wxT("subentry2=subvalue2\n")
+ wxT("subentry1=subvalue\n")
+ wxT("[root/group2]\n"),
fc );
}
wxStringInputStream sis(testconfig);
wxFileConfig fc(sis);
- CPPUNIT_ASSERT( fc.RenameGroup(_T("root"), _T("foot")) );
- wxVERIFY_FILECONFIG( _T("[foot]\n")
- _T("entry=value\n")
- _T("[foot/group1]\n")
- _T("[foot/group1/subgroup]\n")
- _T("subentry=subvalue\n")
- _T("subentry2=subvalue2\n")
- _T("[foot/group2]\n"),
+ CPPUNIT_ASSERT( fc.RenameGroup(wxT("root"), wxT("foot")) );
+ wxVERIFY_FILECONFIG( wxT("[foot]\n")
+ wxT("entry=value\n")
+ wxT("[foot/group1]\n")
+ wxT("[foot/group1/subgroup]\n")
+ wxT("subentry=subvalue\n")
+ wxT("subentry2=subvalue2\n")
+ wxT("[foot/group2]\n"),
fc );
// renaming a path doesn't work, it must be the immediate group
- CPPUNIT_ASSERT( !fc.RenameGroup(_T("foot/group1"), _T("group2")) );
+ CPPUNIT_ASSERT( !fc.RenameGroup(wxT("foot/group1"), wxT("group2")) );
- fc.SetPath(_T("foot"));
+ fc.SetPath(wxT("foot"));
// renaming to a name of existing group doesn't work
- CPPUNIT_ASSERT( !fc.RenameGroup(_T("group1"), _T("group2")) );
+ CPPUNIT_ASSERT( !fc.RenameGroup(wxT("group1"), wxT("group2")) );
// try exchanging the groups names and then restore them back
- CPPUNIT_ASSERT( fc.RenameGroup(_T("group1"), _T("groupTmp")) );
- wxVERIFY_FILECONFIG( _T("[foot]\n")
- _T("entry=value\n")
- _T("[foot/groupTmp]\n")
- _T("[foot/groupTmp/subgroup]\n")
- _T("subentry=subvalue\n")
- _T("subentry2=subvalue2\n")
- _T("[foot/group2]\n"),
+ CPPUNIT_ASSERT( fc.RenameGroup(wxT("group1"), wxT("groupTmp")) );
+ wxVERIFY_FILECONFIG( wxT("[foot]\n")
+ wxT("entry=value\n")
+ wxT("[foot/groupTmp]\n")
+ wxT("[foot/groupTmp/subgroup]\n")
+ wxT("subentry=subvalue\n")
+ wxT("subentry2=subvalue2\n")
+ wxT("[foot/group2]\n"),
fc );
- CPPUNIT_ASSERT( fc.RenameGroup(_T("group2"), _T("group1")) );
- wxVERIFY_FILECONFIG( _T("[foot]\n")
- _T("entry=value\n")
- _T("[foot/groupTmp]\n")
- _T("[foot/groupTmp/subgroup]\n")
- _T("subentry=subvalue\n")
- _T("subentry2=subvalue2\n")
- _T("[foot/group1]\n"),
+ CPPUNIT_ASSERT( fc.RenameGroup(wxT("group2"), wxT("group1")) );
+ wxVERIFY_FILECONFIG( wxT("[foot]\n")
+ wxT("entry=value\n")
+ wxT("[foot/groupTmp]\n")
+ wxT("[foot/groupTmp/subgroup]\n")
+ wxT("subentry=subvalue\n")
+ wxT("subentry2=subvalue2\n")
+ wxT("[foot/group1]\n"),
fc );
- CPPUNIT_ASSERT( fc.RenameGroup(_T("groupTmp"), _T("group2")) );
- wxVERIFY_FILECONFIG( _T("[foot]\n")
- _T("entry=value\n")
- _T("[foot/group2]\n")
- _T("[foot/group2/subgroup]\n")
- _T("subentry=subvalue\n")
- _T("subentry2=subvalue2\n")
- _T("[foot/group1]\n"),
+ CPPUNIT_ASSERT( fc.RenameGroup(wxT("groupTmp"), wxT("group2")) );
+ wxVERIFY_FILECONFIG( wxT("[foot]\n")
+ wxT("entry=value\n")
+ wxT("[foot/group2]\n")
+ wxT("[foot/group2/subgroup]\n")
+ wxT("subentry=subvalue\n")
+ wxT("subentry2=subvalue2\n")
+ wxT("[foot/group1]\n"),
fc );
- CPPUNIT_ASSERT( fc.RenameGroup(_T("group1"), _T("groupTmp")) );
- wxVERIFY_FILECONFIG( _T("[foot]\n")
- _T("entry=value\n")
- _T("[foot/group2]\n")
- _T("[foot/group2/subgroup]\n")
- _T("subentry=subvalue\n")
- _T("subentry2=subvalue2\n")
- _T("[foot/groupTmp]\n"),
+ CPPUNIT_ASSERT( fc.RenameGroup(wxT("group1"), wxT("groupTmp")) );
+ wxVERIFY_FILECONFIG( wxT("[foot]\n")
+ wxT("entry=value\n")
+ wxT("[foot/group2]\n")
+ wxT("[foot/group2/subgroup]\n")
+ wxT("subentry=subvalue\n")
+ wxT("subentry2=subvalue2\n")
+ wxT("[foot/groupTmp]\n"),
fc );
- CPPUNIT_ASSERT( fc.RenameGroup(_T("group2"), _T("group1")) );
- wxVERIFY_FILECONFIG( _T("[foot]\n")
- _T("entry=value\n")
- _T("[foot/group1]\n")
- _T("[foot/group1/subgroup]\n")
- _T("subentry=subvalue\n")
- _T("subentry2=subvalue2\n")
- _T("[foot/groupTmp]\n"),
+ CPPUNIT_ASSERT( fc.RenameGroup(wxT("group2"), wxT("group1")) );
+ wxVERIFY_FILECONFIG( wxT("[foot]\n")
+ wxT("entry=value\n")
+ wxT("[foot/group1]\n")
+ wxT("[foot/group1/subgroup]\n")
+ wxT("subentry=subvalue\n")
+ wxT("subentry2=subvalue2\n")
+ wxT("[foot/groupTmp]\n"),
fc );
- CPPUNIT_ASSERT( fc.RenameGroup(_T("groupTmp"), _T("group2")) );
- wxVERIFY_FILECONFIG( _T("[foot]\n")
- _T("entry=value\n")
- _T("[foot/group1]\n")
- _T("[foot/group1/subgroup]\n")
- _T("subentry=subvalue\n")
- _T("subentry2=subvalue2\n")
- _T("[foot/group2]\n"),
+ CPPUNIT_ASSERT( fc.RenameGroup(wxT("groupTmp"), wxT("group2")) );
+ wxVERIFY_FILECONFIG( wxT("[foot]\n")
+ wxT("entry=value\n")
+ wxT("[foot/group1]\n")
+ wxT("[foot/group1/subgroup]\n")
+ wxT("subentry=subvalue\n")
+ wxT("subentry2=subvalue2\n")
+ wxT("[foot/group2]\n"),
fc );
}
void FileConfigTestCase::CreateSubgroupAndEntries()
{
wxFileConfig fc;
- fc.Write(_T("sub/sub_first"), _T("sub_one"));
- fc.Write(_T("first"), _T("one"));
+ fc.Write(wxT("sub/sub_first"), wxT("sub_one"));
+ fc.Write(wxT("first"), wxT("one"));
- wxVERIFY_FILECONFIG( _T("first=one\n")
- _T("[sub]\n")
- _T("sub_first=sub_one\n"),
+ wxVERIFY_FILECONFIG( wxT("first=one\n")
+ wxT("[sub]\n")
+ wxT("sub_first=sub_one\n"),
fc );
}
void FileConfigTestCase::CreateEntriesAndSubgroup()
{
wxFileConfig fc;
- fc.Write(_T("first"), _T("one"));
- fc.Write(_T("second"), _T("two"));
- fc.Write(_T("sub/sub_first"), _T("sub_one"));
-
- wxVERIFY_FILECONFIG( _T("first=one\n")
- _T("second=two\n")
- _T("[sub]\n")
- _T("sub_first=sub_one\n"),
+ fc.Write(wxT("first"), wxT("one"));
+ fc.Write(wxT("second"), wxT("two"));
+ fc.Write(wxT("sub/sub_first"), wxT("sub_one"));
+
+ wxVERIFY_FILECONFIG( wxT("first=one\n")
+ wxT("second=two\n")
+ wxT("[sub]\n")
+ wxT("sub_first=sub_one\n"),
fc );
}
static void EmptyConfigAndWriteKey()
{
- wxFileConfig fc(_T("deleteconftest"));
+ wxFileConfig fc(wxT("deleteconftest"));
- const wxString groupPath = _T("/root");
+ const wxString groupPath = wxT("/root");
if ( fc.Exists(groupPath) )
{
// this crashes on second call of this function
- CPPUNIT_ASSERT( fc.Write(groupPath + _T("/entry"), _T("value")) );
+ CPPUNIT_ASSERT( fc.Write(groupPath + wxT("/entry"), wxT("value")) );
}
void FileConfigTestCase::DeleteLastGroup()
// clean up
wxLogNull noLogging;
- (void) ::wxRemoveFile(wxFileConfig::GetLocalFileName(_T("deleteconftest")));
+ (void) ::wxRemoveFile(wxFileConfig::GetLocalFileName(wxT("deleteconftest")));
}
void FileConfigTestCase::DeleteAndRecreateGroup()
{
static const wxChar *confInitial =
- _T("[First]\n")
- _T("Value1=Foo\n")
- _T("[Second]\n")
- _T("Value2=Bar\n");
+ wxT("[First]\n")
+ wxT("Value1=Foo\n")
+ wxT("[Second]\n")
+ wxT("Value2=Bar\n");
wxStringInputStream sis(confInitial);
wxFileConfig fc(sis);
- fc.DeleteGroup(_T("Second"));
- wxVERIFY_FILECONFIG( _T("[First]\n")
- _T("Value1=Foo\n"),
+ fc.DeleteGroup(wxT("Second"));
+ wxVERIFY_FILECONFIG( wxT("[First]\n")
+ wxT("Value1=Foo\n"),
fc );
- fc.Write(_T("Second/Value2"), _T("New"));
- wxVERIFY_FILECONFIG( _T("[First]\n")
- _T("Value1=Foo\n")
- _T("[Second]\n")
- _T("Value2=New\n"),
+ fc.Write(wxT("Second/Value2"), wxT("New"));
+ wxVERIFY_FILECONFIG( wxT("[First]\n")
+ wxT("Value1=Foo\n")
+ wxT("[Second]\n")
+ wxT("Value2=New\n"),
fc );
}
void FileConfigTestCase::AddToExistingRoot()
{
static const wxChar *confInitial =
- _T("[Group]\n")
- _T("value1=foo\n");
+ wxT("[Group]\n")
+ wxT("value1=foo\n");
wxStringInputStream sis(confInitial);
wxFileConfig fc(sis);
- fc.Write(_T("/value1"), _T("bar"));
+ fc.Write(wxT("/value1"), wxT("bar"));
wxVERIFY_FILECONFIG(
- _T("value1=bar\n")
- _T("[Group]\n")
- _T("value1=foo\n"),
+ wxT("value1=bar\n")
+ wxT("[Group]\n")
+ wxT("value1=foo\n"),
fc
);
}
wxString Format() const
{
wxString s;
- s.Printf(_T("%02d:%02d:%02d %10s %02d, %4d%s"),
+ s.Printf(wxT("%02d:%02d:%02d %10s %02d, %4d%s"),
hour, min, sec,
wxDateTime::GetMonthName(month).c_str(),
day,
abs(wxDateTime::ConvertYearToBC(year)),
- year > 0 ? _T("AD") : _T("BC"));
+ year > 0 ? wxT("AD") : wxT("BC"));
return s;
}
wxString FormatDate() const
{
wxString s;
- s.Printf(_T("%02d-%s-%4d%s"),
+ s.Printf(wxT("%02d-%s-%4d%s"),
day,
wxDateTime::GetMonthName(month, wxDateTime::Name_Abbr).c_str(),
abs(wxDateTime::ConvertYearToBC(year)),
- year > 0 ? _T("AD") : _T("BC"));
+ year > 0 ? wxT("AD") : wxT("BC"));
return s;
}
};
wxString s, which;
switch ( nWeek < -1 ? -nWeek : nWeek )
{
- case 1: which = _T("first"); break;
- case 2: which = _T("second"); break;
- case 3: which = _T("third"); break;
- case 4: which = _T("fourth"); break;
- case 5: which = _T("fifth"); break;
+ case 1: which = wxT("first"); break;
+ case 2: which = wxT("second"); break;
+ case 3: which = wxT("third"); break;
+ case 4: which = wxT("fourth"); break;
+ case 5: which = wxT("fifth"); break;
- case -1: which = _T("last"); break;
+ case -1: which = wxT("last"); break;
}
if ( nWeek < -1 )
{
- which += _T(" from end");
+ which += wxT(" from end");
}
- s.Printf(_T("The %s %s of %s in %d"),
+ s.Printf(wxT("The %s %s of %s in %d"),
which.c_str(),
wxDateTime::GetWeekDayName(wday).c_str(),
wxDateTime::GetMonthName(month).c_str(),
break;
case CompareNone:
- wxFAIL_MSG( _T("unexpected") );
+ wxFAIL_MSG( wxT("unexpected") );
break;
}
}
// special cases
wxDateTime dt;
- CPPUNIT_ASSERT( dt.ParseDate(_T("today")) );
+ CPPUNIT_ASSERT( dt.ParseDate(wxT("today")) );
CPPUNIT_ASSERT_EQUAL( wxDateTime::Today(), dt );
for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ )
{
TempFile tmp; // put first
wxFile file;
- tmp.m_name = wxFileName::CreateTempFileName(_T("wxft"), &file);
+ tmp.m_name = wxFileName::CreateTempFileName(wxT("wxft"), &file);
TestFd(file, true);
file.Close();
} data[] =
{
// simple case:
- { _T("http://www.root.cz/index.html"),
- _T("http"), _T(""), _T("//www.root.cz/index.html"), _T("")},
+ { wxT("http://www.root.cz/index.html"),
+ wxT("http"), wxT(""), wxT("//www.root.cz/index.html"), wxT("")},
// anchors:
- { _T("http://www.root.cz/index.html#lbl"),
- _T("http"), _T(""), _T("//www.root.cz/index.html"), _T("lbl")},
+ { wxT("http://www.root.cz/index.html#lbl"),
+ wxT("http"), wxT(""), wxT("//www.root.cz/index.html"), wxT("lbl")},
// file is default protocol:
- { _T("testfile.html"),
- _T("file"), _T(""), _T("testfile.html"), _T("")},
+ { wxT("testfile.html"),
+ wxT("file"), wxT(""), wxT("testfile.html"), wxT("")},
// stacked protocols:
- { _T("file:myzipfile.zip#zip:index.htm"),
- _T("zip"), _T("file:myzipfile.zip"), _T("index.htm"), _T("")},
+ { wxT("file:myzipfile.zip#zip:index.htm"),
+ wxT("zip"), wxT("file:myzipfile.zip"), wxT("index.htm"), wxT("")},
// changes to ':' parsing often break things:
- { _T("file:a#b:foo"),
- _T("b"), _T("file:a"), _T("foo"), _T("")}
+ { wxT("file:a#b:foo"),
+ wxT("b"), wxT("file:a"), wxT("foo"), wxT("")}
};
UrlTester tst;
void FileSystemTestCase::FileNameToUrlConversion()
{
#ifdef __WINDOWS__
- wxFileName fn1(_T("\\\\server\\share\\path\\to\\file"));
+ wxFileName fn1(wxT("\\\\server\\share\\path\\to\\file"));
wxString url1 = wxFileSystem::FileNameToURL(fn1);
CPPUNIT_ASSERT( fn1.SameAs(wxFileSystem::URLToFileName(url1)) );
static const wxChar *charsets[] =
{
// some valid charsets
- _T("us-ascii" ),
- _T("iso8859-1" ),
- _T("iso-8859-12" ),
- _T("koi8-r" ),
- _T("utf-7" ),
- _T("cp1250" ),
- _T("windows-1252"),
+ wxT("us-ascii" ),
+ wxT("iso8859-1" ),
+ wxT("iso-8859-12" ),
+ wxT("koi8-r" ),
+ wxT("utf-7" ),
+ wxT("cp1250" ),
+ wxT("windows-1252"),
// and now some bogus ones
- _T("" ),
- _T("cp1249" ),
- _T("iso--8859-1" ),
- _T("iso-8859-19" ),
+ wxT("" ),
+ wxT("cp1249" ),
+ wxT("iso--8859-1" ),
+ wxT("iso-8859-19" ),
};
static const wxChar *names[] =
{
// some valid charsets
- _T("default" ),
- _T("iso-8859-1" ),
- _T("iso-8859-12" ),
- _T("koi8-r" ),
- _T("utf-7" ),
- _T("windows-1250"),
- _T("windows-1252"),
+ wxT("default" ),
+ wxT("iso-8859-1" ),
+ wxT("iso-8859-12" ),
+ wxT("koi8-r" ),
+ wxT("utf-7" ),
+ wxT("windows-1250"),
+ wxT("windows-1252"),
// and now some bogus ones
- _T("default" ),
- _T("unknown--1" ),
- _T("unknown--1" ),
- _T("unknown--1" ),
+ wxT("default" ),
+ wxT("unknown--1" ),
+ wxT("unknown--1" ),
+ wxT("unknown--1" ),
};
static const wxChar *descriptions[] =
{
// some valid charsets
- _T("Default encoding" ),
- _T("Western European (ISO-8859-1)" ),
- _T("Indian (ISO-8859-12)" ),
- _T("KOI8-R" ),
- _T("Unicode 7 bit (UTF-7)" ),
- _T("Windows Central European (CP 1250)"),
- _T("Windows Western European (CP 1252)"),
+ wxT("Default encoding" ),
+ wxT("Western European (ISO-8859-1)" ),
+ wxT("Indian (ISO-8859-12)" ),
+ wxT("KOI8-R" ),
+ wxT("Unicode 7 bit (UTF-7)" ),
+ wxT("Windows Central European (CP 1250)"),
+ wxT("Windows Western European (CP 1252)"),
// and now some bogus ones
- _T("Default encoding" ),
- _T("Unknown encoding (-1)" ),
- _T("Unknown encoding (-1)" ),
- _T("Unknown encoding (-1)" ),
+ wxT("Default encoding" ),
+ wxT("Unknown encoding (-1)" ),
+ wxT("Unknown encoding (-1)" ),
+ wxT("Unknown encoding (-1)" ),
};
wxFontMapperBase& fmap = *wxFontMapperBase::Get();
// I've put in some checks, such as this which will flag up any platforms
// where this is not the case:
//
-// CPPUNIT_ASSERT(wxString::Format(_T("%hs"), "test") == _T("test"));
+// CPPUNIT_ASSERT(wxString::Format(wxT("%hs"), "test") == wxT("test"));
//
// For compilers that support precompilation, includes "wx/wx.h".
void FormatConverterTestCase::format_d()
{
doTest("d", "d", "d", "d", "d");
- CPPUNIT_ASSERT(wxString::Format(_T("%d"), 255) == _T("255"));
- CPPUNIT_ASSERT(wxString::Format(_T("%05d"), 255) == _T("00255"));
- CPPUNIT_ASSERT(wxString::Format(_T("% 5d"), 255) == _T(" 255"));
- CPPUNIT_ASSERT(wxString::Format(_T("% 5d"), -255) == _T(" -255"));
- CPPUNIT_ASSERT(wxString::Format(_T("%-5d"), -255) == _T("-255 "));
- CPPUNIT_ASSERT(wxString::Format(_T("%+5d"), 255) == _T(" +255"));
- CPPUNIT_ASSERT(wxString::Format(_T("%*d"), 5, 255) == _T(" 255"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%d"), 255) == wxT("255"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%05d"), 255) == wxT("00255"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("% 5d"), 255) == wxT(" 255"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("% 5d"), -255) == wxT(" -255"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%-5d"), -255) == wxT("-255 "));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%+5d"), 255) == wxT(" +255"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%*d"), 5, 255) == wxT(" 255"));
}
void FormatConverterTestCase::format_hd()
{
doTest("hd", "hd", "hd", "hd", "hd");
short s = 32767;
- CPPUNIT_ASSERT(wxString::Format(_T("%hd"), s) == _T("32767"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%hd"), s) == wxT("32767"));
}
void FormatConverterTestCase::format_ld()
{
doTest("ld", "ld", "ld", "ld", "ld");
long l = 2147483647L;
- CPPUNIT_ASSERT(wxString::Format(_T("%ld"), l) == _T("2147483647"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%ld"), l) == wxT("2147483647"));
}
void FormatConverterTestCase::format_s()
{
doTest("s", "ls", "s", "ls", "s");
- CPPUNIT_ASSERT(wxString::Format(_T("%s!"), _T("test")) == _T("test!"));
- CPPUNIT_ASSERT(wxString::Format(_T("%6s!"), _T("test")) == _T(" test!"));
- CPPUNIT_ASSERT(wxString::Format(_T("%-6s!"), _T("test")) == _T("test !"));
- CPPUNIT_ASSERT(wxString::Format(_T("%.6s!"), _T("test")) == _T("test!"));
- CPPUNIT_ASSERT(wxString::Format(_T("%6.4s!"), _T("testing")) == _T(" test!"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%s!"), wxT("test")) == wxT("test!"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%6s!"), wxT("test")) == wxT(" test!"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%-6s!"), wxT("test")) == wxT("test !"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%.6s!"), wxT("test")) == wxT("test!"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%6.4s!"), wxT("testing")) == wxT(" test!"));
}
void FormatConverterTestCase::format_hs()
{
doTest("hs", "hs", "s", "ls", "s");
- CPPUNIT_ASSERT(wxString::Format(wxString(_T("%hs!")), "test") == _T("test!"));
- CPPUNIT_ASSERT(wxString::Format(wxString(_T("%6hs!")), "test") == _T(" test!"));
- CPPUNIT_ASSERT(wxString::Format(wxString(_T("%-6hs!")), "test") == _T("test !"));
- CPPUNIT_ASSERT(wxString::Format(wxString(_T("%.6hs!")), "test") == _T("test!"));
- CPPUNIT_ASSERT(wxString::Format(wxString(_T("%6.4hs!")), "testing") == _T(" test!"));
+ CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%hs!")), "test") == wxT("test!"));
+ CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%6hs!")), "test") == wxT(" test!"));
+ CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%-6hs!")), "test") == wxT("test !"));
+ CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%.6hs!")), "test") == wxT("test!"));
+ CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%6.4hs!")), "testing") == wxT(" test!"));
}
void FormatConverterTestCase::format_ls()
{
doTest("ls", "ls", "s", "ls", "s");
- CPPUNIT_ASSERT(wxString::Format(_T("%ls!"), L"test") == _T("test!"));
- CPPUNIT_ASSERT(wxString::Format(_T("%6ls!"), L"test") == _T(" test!"));
- CPPUNIT_ASSERT(wxString::Format(_T("%-6ls!"), L"test") == _T("test !"));
- CPPUNIT_ASSERT(wxString::Format(_T("%.6ls!"), L"test") == _T("test!"));
- CPPUNIT_ASSERT(wxString::Format(_T("%6.4ls!"), L"testing") == _T(" test!"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%ls!"), L"test") == wxT("test!"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%6ls!"), L"test") == wxT(" test!"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%-6ls!"), L"test") == wxT("test !"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%.6ls!"), L"test") == wxT("test!"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%6.4ls!"), L"testing") == wxT(" test!"));
}
void FormatConverterTestCase::format_c()
{
doTest("c", "lc", "lc", "lc", "c");
- CPPUNIT_ASSERT(wxString::Format(_T("%c"), _T('x')) == _T("x"));
- CPPUNIT_ASSERT(wxString::Format(_T("%2c"), _T('x')) == _T(" x"));
- CPPUNIT_ASSERT(wxString::Format(_T("%-2c"), _T('x')) == _T("x "));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%c"), wxT('x')) == wxT("x"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%2c"), wxT('x')) == wxT(" x"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%-2c"), wxT('x')) == wxT("x "));
}
void FormatConverterTestCase::format_hc()
{
doTest("hc", "hc", "lc", "lc", "c");
- CPPUNIT_ASSERT(wxString::Format(wxString(_T("%hc")), 'x') == _T("x"));
- CPPUNIT_ASSERT(wxString::Format(wxString(_T("%2hc")), 'x') == _T(" x"));
- CPPUNIT_ASSERT(wxString::Format(wxString(_T("%-2hc")), 'x') == _T("x "));
+ CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%hc")), 'x') == wxT("x"));
+ CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%2hc")), 'x') == wxT(" x"));
+ CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%-2hc")), 'x') == wxT("x "));
}
void FormatConverterTestCase::format_lc()
{
doTest("lc", "lc", "lc", "lc", "c");
- CPPUNIT_ASSERT(wxString::Format(_T("%lc"), L'x') == _T("x"));
- CPPUNIT_ASSERT(wxString::Format(_T("%2lc"), L'x') == _T(" x"));
- CPPUNIT_ASSERT(wxString::Format(_T("%-2lc"), L'x') == _T("x "));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%lc"), L'x') == wxT("x"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%2lc"), L'x') == wxT(" x"));
+ CPPUNIT_ASSERT(wxString::Format(wxT("%-2lc"), L'x') == wxT("x "));
}
const char *expectedWcharWindows)
{
static const wxChar *flag_width[] =
- { _T(""), _T("*"), _T("10"), _T("-*"), _T("-10"), NULL };
+ { wxT(""), wxT("*"), wxT("10"), wxT("-*"), wxT("-10"), NULL };
static const wxChar *precision[] =
- { _T(""), _T(".*"), _T(".10"), NULL };
+ { wxT(""), wxT(".*"), wxT(".10"), NULL };
static const wxChar *empty[] =
- { _T(""), NULL };
+ { wxT(""), NULL };
// no precision for %c or %C
- const wxChar **precs = wxTolower(input[wxStrlen(input)-1]) == _T('c') ?
+ const wxChar **precs = wxTolower(input[wxStrlen(input)-1]) == wxT('c') ?
empty : precision;
- wxString fmt(_T("%"));
+ wxString fmt(wxT("%"));
// try the test for a variety of combinations of flag, width and precision
for (const wxChar **prec = precs; *prec; prec++)
// on windows, wxScanf() string needs no modifications
result = wxScanfConvertFormatW(input.wc_str());
- msg = _T("input: '") + input +
- _T("', result (scanf): '") + result +
- _T("', expected: '") + expectedScanf + _T("'");
+ msg = wxT("input: '") + input +
+ wxT("', result (scanf): '") + result +
+ wxT("', expected: '") + expectedScanf + wxT("'");
CPPUNIT_ASSERT_MESSAGE(string(msg.mb_str()), result == expectedScanf);
#endif // !__WINDOWS__
#if wxUSE_UNICODE_UTF8
result = (const char*)wxFormatString(input);
- msg = _T("input: '") + input +
- _T("', result (UTF-8): '") + result +
- _T("', expected: '") + expectedUtf8 + _T("'");
+ msg = wxT("input: '") + input +
+ wxT("', result (UTF-8): '") + result +
+ wxT("', expected: '") + expectedUtf8 + wxT("'");
CPPUNIT_ASSERT_MESSAGE(string(msg.mb_str()), result == expectedUtf8);
#endif // wxUSE_UNICODE_UTF8
wxString expectedWchar(expectedWcharUnix);
#endif
- msg = _T("input: '") + input +
- _T("', result (wchar_t): '") + result +
- _T("', expected: '") + expectedWchar + _T("'");
+ msg = wxT("input: '") + input +
+ wxT("', result (wchar_t): '") + result +
+ wxT("', expected: '") + expectedWchar + wxT("'");
CPPUNIT_ASSERT_MESSAGE(string(msg.mb_str()), result == expectedWchar);
#endif // wxUSE_UNICODE && !wxUSE_UTF8_LOCALE_ONLY
}
for ( i = 0; i < COUNT/2; ++i )
CPPUNIT_ASSERT( hash.Get(i) == NULL);
- hash2.Put(_T("foo"), &o + 1);
- hash2.Put(_T("bar"), &o + 2);
- hash2.Put(_T("baz"), &o + 3);
+ hash2.Put(wxT("foo"), &o + 1);
+ hash2.Put(wxT("bar"), &o + 2);
+ hash2.Put(wxT("baz"), &o + 3);
- CPPUNIT_ASSERT(hash2.Get(_T("moo")) == NULL);
- CPPUNIT_ASSERT(hash2.Get(_T("bar")) == &o + 2);
+ CPPUNIT_ASSERT(hash2.Get(wxT("moo")) == NULL);
+ CPPUNIT_ASSERT(hash2.Get(wxT("bar")) == &o + 2);
- hash2.Put(_T("bar"), &o + 0);
+ hash2.Put(wxT("bar"), &o + 0);
- CPPUNIT_ASSERT(hash2.Get(_T("bar")) == &o + 2);
+ CPPUNIT_ASSERT(hash2.Get(wxT("bar")) == &o + 2);
}
// and now some corner-case testing; 3 and 13 hash to the same bucket
{
wxStringHashSet set1;
- set1.insert( _T("abc") );
+ set1.insert( wxT("abc") );
CPPUNIT_ASSERT( set1.size() == 1 );
- set1.insert( _T("bbc") );
- set1.insert( _T("cbc") );
+ set1.insert( wxT("bbc") );
+ set1.insert( wxT("cbc") );
CPPUNIT_ASSERT( set1.size() == 3 );
- set1.insert( _T("abc") );
+ set1.insert( wxT("abc") );
CPPUNIT_ASSERT( set1.size() == 3 );
int dummy;
MyStruct tmp;
- tmp.ptr = &dummy; tmp.str = _T("ABC");
+ tmp.ptr = &dummy; tmp.str = wxT("ABC");
set2.insert( tmp );
tmp.ptr = &dummy + 1;
set2.insert( tmp );
- tmp.ptr = &dummy; tmp.str = _T("CDE");
+ tmp.ptr = &dummy; tmp.str = wxT("CDE");
set2.insert( tmp );
CPPUNIT_ASSERT( set2.size() == 2 );
CPPUNIT_ASSERT( it != set2.end() );
CPPUNIT_ASSERT( it->ptr == &dummy );
- CPPUNIT_ASSERT( it->str == _T("ABC") );
+ CPPUNIT_ASSERT( it->str == wxT("ABC") );
}
{
{
wxListBazs list1;
- list1.Append(new Baz(_T("first")));
- list1.Append(new Baz(_T("second")));
+ list1.Append(new Baz(wxT("first")));
+ list1.Append(new Baz(wxT("second")));
CPPUNIT_ASSERT( list1.GetCount() == 2 );
CPPUNIT_ASSERT( Baz::GetNumber() == 2 );
for ( size_t n = 0; n < WXSIZEOF(testLongs); n++ )
{
wxLongLong a = testLongs[n];
- s1 = wxString::Format(_T("%ld"), testLongs[n]);
+ s1 = wxString::Format(wxT("%ld"), testLongs[n]);
s2 = a.ToString();
CPPUNIT_ASSERT( s1 == s2 );
}
wxLongLong a(0x12345678, 0x87654321);
- CPPUNIT_ASSERT( a.ToString() == _T("1311768467139281697") );
+ CPPUNIT_ASSERT( a.ToString() == wxT("1311768467139281697") );
a.Negate();
- CPPUNIT_ASSERT( a.ToString() == _T("-1311768467139281697") );
+ CPPUNIT_ASSERT( a.ToString() == wxT("-1311768467139281697") );
wxLongLong llMin(-2147483647L - 1L, 0);
- CPPUNIT_ASSERT( llMin.ToString() == _T("-9223372036854775808") );
+ CPPUNIT_ASSERT( llMin.ToString() == wxT("-9223372036854775808") );
#if wxUSE_LONGLONG_WX
wxLongLongWx a1(a.GetHi(), a.GetLo());
- CPPUNIT_ASSERT( a1.ToString() == _T("-1311768467139281697") );
+ CPPUNIT_ASSERT( a1.ToString() == wxT("-1311768467139281697") );
a1.Negate();
- CPPUNIT_ASSERT( a1.ToString() == _T("1311768467139281697") );
+ CPPUNIT_ASSERT( a1.ToString() == wxT("1311768467139281697") );
#endif
#if wxUSE_LONGLONG_NATIVE
wxLongLongNative a2(a.GetHi(), a.GetLo());
- CPPUNIT_ASSERT( a2.ToString() == _T("-1311768467139281697") );
+ CPPUNIT_ASSERT( a2.ToString() == wxT("-1311768467139281697") );
a2.Negate();
- CPPUNIT_ASSERT( a2.ToString() == _T("1311768467139281697") );
+ CPPUNIT_ASSERT( a2.ToString() == wxT("1311768467139281697") );
#endif
}
void ConvAutoTestCase::Empty()
{
- TestFirstChar("", _T('\0'));
+ TestFirstChar("", wxT('\0'));
}
void ConvAutoTestCase::Short()
{
- TestFirstChar("1", _T('1'));
+ TestFirstChar("1", wxT('1'));
}
void ConvAutoTestCase::None()
{
- TestFirstChar("Hello world", _T('H'));
+ TestFirstChar("Hello world", wxT('H'));
}
void ConvAutoTestCase::UTF32LE()
{
- TestFirstChar("\xff\xfe\0\0A\0\0\0", _T('A'));
+ TestFirstChar("\xff\xfe\0\0A\0\0\0", wxT('A'));
}
void ConvAutoTestCase::UTF32BE()
{
- TestFirstChar("\0\0\xfe\xff\0\0\0B", _T('B'));
+ TestFirstChar("\0\0\xfe\xff\0\0\0B", wxT('B'));
}
void ConvAutoTestCase::UTF16LE()
{
- TestFirstChar("\xff\xfeZ\0", _T('Z'));
+ TestFirstChar("\xff\xfeZ\0", wxT('Z'));
}
void ConvAutoTestCase::UTF16BE()
{
- TestFirstChar("\xfe\xff\0Y", _T('Y'));
+ TestFirstChar("\xfe\xff\0Y", wxT('Y'));
}
void ConvAutoTestCase::UTF8()
const unsigned char* bytes = (unsigned char*)data;
wxString result;
- result.Printf( _T("static const unsigned char %s[%i] = \n{"), name, (int)len );
+ result.Printf( wxT("static const unsigned char %s[%i] = \n{"), name, (int)len );
for ( size_t i = 0; i < len; i++ )
{
if ( i != 0 )
{
- result.append( _T(",") );
+ result.append( wxT(",") );
}
if ((i%16)==0)
{
- result.append( _T("\n ") );
+ result.append( wxT("\n ") );
}
- wxString byte = wxString::Format( _T("0x%02x"), bytes[i] );
+ wxString byte = wxString::Format( wxT("0x%02x"), bytes[i] );
result.append(byte);
}
- result.append( _T("\n};\n") );
+ result.append( wxT("\n};\n") );
return result;
}
void MBConvTestCase::BufSize()
{
- wxCSConv conv1251(_T("CP1251"));
+ wxCSConv conv1251(wxT("CP1251"));
CPPUNIT_ASSERT( conv1251.IsOk() );
const char *cp1251text =
"\313\301\326\305\324\323\321 \325\304\301\336\316\331\315";
// test in the other direction too, using an encoding with multibyte NUL
- wxCSConv convUTF16(_T("UTF-16LE"));
+ wxCSConv convUTF16(wxT("UTF-16LE"));
CPPUNIT_ASSERT( convUTF16.IsOk() );
const wchar_t *utf16text = L"Hello";
void parseFlags(const wxString& flags);
void doTest(int flavor);
static wxString quote(const wxString& arg);
- const wxChar *convError() const { return _T("<cannot convert>"); }
+ const wxChar *convError() const { return wxT("<cannot convert>"); }
// assertions - adds some information about the test that failed
void fail(const wxString& msg) const;
badconv = badconv || *m_expected.rbegin() == convError();
}
- failIf(badconv, _T("cannot convert to default character encoding"));
+ failIf(badconv, wxT("cannot convert to default character encoding"));
// the flags need further parsing...
parseFlags(m_flags);
#ifndef wxHAS_REGEX_ADVANCED
- failIf(!m_basic && !m_extended, _T("advanced regexs not available"));
+ failIf(!m_basic && !m_extended, wxT("advanced regexs not available"));
#endif
}
// anything else we must skip the test
default:
fail(wxString::Format(
- _T("requires unsupported flag '%c'"), *p));
+ wxT("requires unsupported flag '%c'"), *p));
}
}
}
// 'e' - test that the pattern fails to compile
if (m_mode == 'e') {
- failIf(re.IsValid(), _T("compile succeeded (should fail)"));
+ failIf(re.IsValid(), wxT("compile succeeded (should fail)"));
return;
}
- failIf(!re.IsValid(), _T("compile failed"));
+ failIf(!re.IsValid(), wxT("compile failed"));
bool matches = re.Matches(m_data, m_matchFlags);
// 'f' or 'p' - test that the pattern does not match
if (m_mode == 'f' || m_mode == 'p') {
- failIf(matches, _T("match succeeded (should fail)"));
+ failIf(matches, wxT("match succeeded (should fail)"));
return;
}
// otherwise 'm' or 'i' - test the pattern does match
- failIf(!matches, _T("match failed"));
+ failIf(!matches, wxT("match failed"));
if (m_compileFlags & wxRE_NOSUB)
return;
// check wxRegEx has correctly counted the number of subexpressions
wxString msg;
- msg << _T("GetMatchCount() == ") << re.GetMatchCount()
- << _T(", expected ") << m_expected.size();
+ msg << wxT("GetMatchCount() == ") << re.GetMatchCount()
+ << wxT(", expected ") << m_expected.size();
failIf(m_expected.size() != re.GetMatchCount(), msg);
for (size_t i = 0; i < m_expected.size(); i++) {
size_t start, len;
msg.clear();
- msg << _T("wxRegEx::GetMatch failed for match ") << i;
+ msg << wxT("wxRegEx::GetMatch failed for match ") << i;
failIf(!re.GetMatch(&start, &len, i), msg);
// m - check the match returns the strings given
if (start < INT_MAX)
result = m_data.substr(start, len);
else
- result = _T("");
+ result = wxT("");
}
// i - check the match returns the offsets given
else if (m_mode == 'i')
{
if (start > INT_MAX)
- result = _T("-1 -1");
+ result = wxT("-1 -1");
else if (start + len > 0)
- result << start << _T(" ") << start + len - 1;
+ result << start << wxT(" ") << start + len - 1;
else
- result << start << _T(" -1");
+ result << start << wxT(" -1");
}
msg.clear();
- msg << _T("match(") << i << _T(") == ") << quote(result)
- << _T(", expected == ") << quote(m_expected[i]);
+ msg << wxT("match(") << i << wxT(") == ") << quote(result)
+ << wxT(", expected == ") << quote(m_expected[i]);
failIf(result != m_expected[i], msg);
}
}
wxString str;
wxArrayString::const_iterator it;
- str << (wxChar)m_mode << _T(" ") << m_id << _T(" ") << m_flags << _T(" ")
- << quote(m_pattern) << _T(" ") << quote(m_data);
+ str << (wxChar)m_mode << wxT(" ") << m_id << wxT(" ") << m_flags << wxT(" ")
+ << quote(m_pattern) << wxT(" ") << quote(m_data);
for (it = m_expected.begin(); it != m_expected.end(); ++it)
- str << _T(" ") << quote(*it);
+ str << wxT(" ") << quote(*it);
if (str.length() > 77)
- str = str.substr(0, 74) + _T("...");
+ str = str.substr(0, 74) + wxT("...");
- str << _T("\n ") << msg;
+ str << wxT("\n ") << msg;
// no lossy convs so using utf8
CPPUNIT_FAIL(string(str.mb_str(wxConvUTF8)));
//
wxString RegExTestCase::quote(const wxString& arg)
{
- const wxChar *needEscape = _T("\a\b\t\n\v\f\r\"\\");
- const wxChar *escapes = _T("abtnvfr\"\\");
+ const wxChar *needEscape = wxT("\a\b\t\n\v\f\r\"\\");
+ const wxChar *escapes = wxT("abtnvfr\"\\");
wxString str;
for (size_t i = 0; i < arg.length(); i++) {
const wxChar *p = wxStrchr(needEscape, ch);
if (p)
- str += wxString::Format(_T("\\%c"), escapes[p - needEscape]);
+ str += wxString::Format(wxT("\\%c"), escapes[p - needEscape]);
else if (wxIscntrl(ch))
- str += wxString::Format(_T("\\%03o"), ch);
+ str += wxString::Format(wxT("\\%03o"), ch);
else
str += (wxChar)ch;
}
return str.length() == arg.length() && str.find(' ') == wxString::npos ?
- str : _T("\"") + str + _T("\"");
+ str : wxT("\"") + str + wxT("\"");
}
name, mode, id, flags, pattern, data, expected_results));
}
catch (Exception& e) {
- wxLogInfo(wxString::Format(_T("skipping: %s\n %s\n"),
+ wxLogInfo(wxString::Format(wxT("skipping: %s\n %s\n"),
wxString(name.c_str(), wxConvUTF8).c_str(),
wxString(e.what(), wxConvUTF8).c_str()));
}
CPPUNIT_ASSERT_MESSAGE("match failed", ok);
wxStringTokenizer tkz(wxString(m_expected, *wxConvCurrent),
- _T("\t"), wxTOKEN_RET_EMPTY);
+ wxT("\t"), wxTOKEN_RET_EMPTY);
size_t i;
for (i = 0; i < re.GetMatchCount() && tkz.HasMoreTokens(); i++) {
wxString result = re.GetMatch(m_text, i);
wxString msgstr;
- msgstr.Printf(_T("\\%d == '%s' (expected '%s')"),
+ msgstr.Printf(wxT("\\%d == '%s' (expected '%s')"),
(int)i, result.c_str(), expected.c_str());
CPPUNIT_ASSERT_MESSAGE((const char*)msgstr.mb_str(),
size_t nRepl = re.Replace(&text, m_repl);
wxString msgstr;
- msgstr.Printf(_T("returns '%s' (expected '%s')"), text.c_str(), m_expected.c_str());
+ msgstr.Printf(wxT("returns '%s' (expected '%s')"), text.c_str(), m_expected.c_str());
CPPUNIT_ASSERT_MESSAGE((const char*)msgstr.mb_str(), text == m_expected);
- msgstr.Printf(_T("matches %d times (expected %d)"), (int)nRepl, (int)m_count);
+ msgstr.Printf(wxT("matches %d times (expected %d)"), (int)nRepl, (int)m_count);
CPPUNIT_ASSERT_MESSAGE((const char*)msgstr.mb_str(), nRepl == m_count);
}
int flags /*=wxRE_DEFAULT*/)
{
addTest(new RegExCompileTestCase(
- (_T("/") + Conv(pattern) + _T("/") + FlagStr(flags)).mb_str(),
+ (wxT("/") + Conv(pattern) + wxT("/") + FlagStr(flags)).mb_str(),
Conv(pattern), correct, flags));
}
{
wxString name;
- name << _T("'") << Conv(text) << _T("' =~ /") << Conv(pattern) << _T("/")
+ name << wxT("'") << Conv(text) << wxT("' =~ /") << Conv(pattern) << wxT("/")
<< FlagStr(flags);
- name.Replace(_T("\n"), _T("\\n"));
+ name.Replace(wxT("\n"), wxT("\\n"));
addTest(new RegExMatchTestCase(name.mb_str(), Conv(pattern),
Conv(text), expected, flags));
{
wxString name;
- name << _T("'") << Conv(text) << _T("' =~ s/") << Conv(pattern) << _T("/")
- << Conv(replacement) << _T("/g") << FlagStr(flags);
- name.Replace(_T("\n"), _T("\\n"));
+ name << wxT("'") << Conv(text) << wxT("' =~ s/") << Conv(pattern) << wxT("/")
+ << Conv(replacement) << wxT("/g") << FlagStr(flags);
+ name.Replace(wxT("\n"), wxT("\\n"));
addTest(new RegExReplaceTestCase(
name.mb_str(), Conv(pattern), Conv(text),
switch (flags & (1 << i)) {
case 0: break;
#ifdef wxHAS_REGEX_ADVANCED
- case wxRE_ADVANCED: str += _T(" | wxRE_ADVANCED"); break;
+ case wxRE_ADVANCED: str += wxT(" | wxRE_ADVANCED"); break;
#endif
- case wxRE_BASIC: str += _T(" | wxRE_BASIC"); break;
- case wxRE_ICASE: str += _T(" | wxRE_ICASE"); break;
- case wxRE_NOSUB: str += _T(" | wxRE_NOSUB"); break;
- case wxRE_NEWLINE: str += _T(" | wxRE_NEWLINE"); break;
- case wxRE_NOTBOL: str += _T(" | wxRE_NOTBOL"); break;
- case wxRE_NOTEOL: str += _T(" | wxRE_NOTEOL"); break;
+ case wxRE_BASIC: str += wxT(" | wxRE_BASIC"); break;
+ case wxRE_ICASE: str += wxT(" | wxRE_ICASE"); break;
+ case wxRE_NOSUB: str += wxT(" | wxRE_NOSUB"); break;
+ case wxRE_NEWLINE: str += wxT(" | wxRE_NEWLINE"); break;
+ case wxRE_NOTBOL: str += wxT(" | wxRE_NOTBOL"); break;
+ case wxRE_NOTEOL: str += wxT(" | wxRE_NOTEOL"); break;
default: wxFAIL; break;
}
}
- return _T(" (") + str.Mid(3) + _T(")");
+ return wxT(" (") + str.Mid(3) + wxT(")");
}
// register in the unnamed registry so that these tests are run by default
{
if (m_pCurrentIn)
{
- wxFAIL_MSG(_T("Error in test case, the previouse input stream needs to be delete first!"));
+ wxFAIL_MSG(wxT("Error in test case, the previouse input stream needs to be delete first!"));
}
m_pCurrentIn = DoCreateInStream();
{
if (m_pCurrentOut)
{
- wxFAIL_MSG(_T("Error in test case, the previouse output stream needs to be delete first!"));
+ wxFAIL_MSG(wxT("Error in test case, the previouse output stream needs to be delete first!"));
}
m_pCurrentOut = DoCreateOutStream();
static
wxFloat64 TestFloatRW(wxFloat64 fValue)
{
- wxFileOutputStream* pFileOutput = new wxFileOutputStream( _T("mytext.dat") );
+ wxFileOutputStream* pFileOutput = new wxFileOutputStream( wxT("mytext.dat") );
wxDataOutputStream* pDataOutput = new wxDataOutputStream( *pFileOutput );
*pDataOutput << fValue;
delete pDataOutput;
delete pFileOutput;
- wxFileInputStream* pFileInput = new wxFileInputStream( _T("mytext.dat") );
+ wxFileInputStream* pFileInput = new wxFileInputStream( wxT("mytext.dat") );
wxDataInputStream* pDataInput = new wxDataInputStream( *pFileInput );
wxFloat64 fInFloat;
ValueArray InValues(Size);
{
- wxFileOutputStream FileOutput( _T("mytext.dat") );
+ wxFileOutputStream FileOutput( wxT("mytext.dat") );
wxDataOutputStream DataOutput( FileOutput );
(DataOutput.*pfnWriter)(Values, Size);
}
{
- wxFileInputStream FileInput( _T("mytext.dat") );
+ wxFileInputStream FileInput( wxT("mytext.dat") );
wxDataInputStream DataInput( FileInput );
(DataInput.*pfnReader)(&*InValues.begin(), InValues.size());
T InValue;
{
- wxFileOutputStream FileOutput( _T("mytext.dat") );
+ wxFileOutputStream FileOutput( wxT("mytext.dat") );
wxDataOutputStream DataOutput( FileOutput );
DataOutput << Value;
}
{
- wxFileInputStream FileInput( _T("mytext.dat") );
+ wxFileInputStream FileInput( wxT("mytext.dat") );
wxDataInputStream DataInput( FileInput );
DataInput >> InValue;
#define DATABUFFER_SIZE 1024
-static const wxString FILENAME_FFILEINSTREAM = _T("ffileinstream.test");
-static const wxString FILENAME_FFILEOUTSTREAM = _T("ffileoutstream.test");
+static const wxString FILENAME_FFILEINSTREAM = wxT("ffileinstream.test");
+static const wxString FILENAME_FFILEOUTSTREAM = wxT("ffileoutstream.test");
///////////////////////////////////////////////////////////////////////////////
// The test case
#define DATABUFFER_SIZE 1024
-static const wxString FILENAME_FILEINSTREAM = _T("fileinstream.test");
-static const wxString FILENAME_FILEOUTSTREAM = _T("fileoutstream.test");
+static const wxString FILENAME_FILEINSTREAM = wxT("fileinstream.test");
+static const wxString FILENAME_FILEOUTSTREAM = wxT("fileoutstream.test");
///////////////////////////////////////////////////////////////////////////////
// The test case
{
// self deleting temp file
struct TmpFile {
- TmpFile() : m_name(wxFileName::CreateTempFileName(_T("wxlfs-"))) { }
+ TmpFile() : m_name(wxFileName::CreateTempFileName(wxT("wxlfs-"))) { }
~TmpFile() { if (!m_name.empty()) wxRemoveFile(m_name); }
wxString m_name;
} tmpfile;
if (!HasLFS()) {
haveLFS = false;
wxString n(getName().c_str(), *wxConvCurrent);
- wxLogInfo(n + _T(": No large file support, testing up to 2GB only"));
+ wxLogInfo(n + wxT(": No large file support, testing up to 2GB only"));
}
else if (IsFAT(tmpfile.m_name)) {
fourGigLimit = true;
wxString n(getName().c_str(), *wxConvCurrent);
- wxLogInfo(n + _T(": FAT volumes are limited to 4GB files"));
+ wxLogInfo(n + wxT(": FAT volumes are limited to 4GB files"));
}
// size of the test blocks
wxOutputStream *LargeFileTest_wxFFile::MakeOutStream(const wxString& name) const
{
- wxFFile file(name, _T("w"));
+ wxFFile file(name, wxT("w"));
CPPUNIT_ASSERT(file.IsOpened());
FILE *fp = file.fp();
file.Detach();
// extract the volume 'C:\' or '\\tooter\share\' from the path
wxString vol;
- if (path.substr(1, 2) == _T(":\\")) {
+ if (path.substr(1, 2) == wxT(":\\")) {
vol = path.substr(0, 3);
} else {
- if (path.substr(0, 2) == _T("\\\\")) {
- size_t i = path.find(_T('\\'), 2);
+ if (path.substr(0, 2) == wxT("\\\\")) {
+ size_t i = path.find(wxT('\\'), 2);
if (i != wxString::npos && i > 2) {
- size_t j = path.find(_T('\\'), ++i);
+ size_t j = path.find(wxT('\\'), ++i);
if (j != i)
- vol = path.substr(0, j) + _T("\\");
+ vol = path.substr(0, j) + wxT("\\");
}
}
}
volumeType,
WXSIZEOF(volumeType)))
{
- wxLogSysError(_T("GetVolumeInformation() failed"));
+ wxLogSysError(wxT("GetVolumeInformation() failed"));
}
volumeInfoInit = true;
{
if (!volumeInfoInit)
GetVolumeInfo(path);
- return wxString(volumeType).Upper().find(_T("FAT")) != wxString::npos;
+ return wxString(volumeType).Upper().find(wxT("FAT")) != wxString::npos;
}
void MakeSparse(const wxString& path, int fd)
{
if (!volumeInfoInit) {
wxFile file;
- wxString path = wxFileName::CreateTempFileName(_T("wxlfs-"), &file);
+ wxString path = wxFileName::CreateTempFileName(wxT("wxlfs-"), &file);
MakeSparse(path, file.fd());
wxRemoveFile(path);
}
m_str.reserve(LEN);
for ( size_t n = 0; n < LEN; n++ )
{
- m_str += wxChar(_T('A') + n % (_T('Z') - _T('A') + 1));
+ m_str += wxChar(wxT('A') + n % (wxT('Z') - wxT('A') + 1));
}
}
TestFile::TestFile()
{
wxFile file;
- m_name = wxFileName::CreateTempFileName(_T("wxtest"), &file);
+ m_name = wxFileName::CreateTempFileName(wxT("wxtest"), &file);
file.Write("Before", 6);
}
void TextStreamTestCase::Endline()
{
- wxFileOutputStream* pOutFile = new wxFileOutputStream(_T("test.txt"));
+ wxFileOutputStream* pOutFile = new wxFileOutputStream(wxT("test.txt"));
wxTextOutputStream* pOutText = new wxTextOutputStream(*pOutFile);
- *pOutText << _T("Test text") << endl
- << _T("More Testing Text (There should be newline before this)");
+ *pOutText << wxT("Test text") << endl
+ << wxT("More Testing Text (There should be newline before this)");
delete pOutText;
delete pOutFile;
- wxFileInputStream* pInFile = new wxFileInputStream(_T("test.txt"));
+ wxFileInputStream* pInFile = new wxFileInputStream(wxT("test.txt"));
char szIn[9 + NEWLINELEN];
static void DoTestRoundTrip(const T *values, size_t numValues)
{
{
- wxFileOutputStream fileOut(_T("test.txt"));
+ wxFileOutputStream fileOut(wxT("test.txt"));
wxTextOutputStream textOut(fileOut);
for ( size_t n = 0; n < numValues; n++ )
}
{
- wxFileInputStream fileIn(_T("test.txt"));
+ wxFileInputStream fileIn(wxT("test.txt"));
wxTextInputStream textIn(fileIn);
T value;
#define DATABUFFER_SIZE 1024
-static const wxString FILENAME_GZ = _T("zlibtest.gz");
+static const wxString FILENAME_GZ = wxT("zlibtest.gz");
///////////////////////////////////////////////////////////////////////////////
// The test case
/* Example code on how to produce test data...
{
- wxFFileOutputStream fstream_out(_T("gentest.cpp"));
+ wxFFileOutputStream fstream_out(wxT("gentest.cpp"));
wxTextOutputStream out( fstream_out );
genExtTestData(out, "zlib data created with wxWidgets 2.5.x [March 27], wxZLIB_NO_HEADER, zlib 1.1.4", wxZLIB_NO_HEADER);
if (fail_pos != DATABUFFER_SIZE || !bWasEOF)
{
wxString msg;
- msg << _T("Wrong data item at pos ") << fail_pos
- << _T(" (Org_val ") << GetDataBuffer()[fail_pos]
- << _T(" != Zlib_val ") << last_value
- << _T("), with compression level ") << compress_level;
+ msg << wxT("Wrong data item at pos ") << fail_pos
+ << wxT(" (Org_val ") << GetDataBuffer()[fail_pos]
+ << wxT(" != Zlib_val ") << last_value
+ << wxT("), with compression level ") << compress_level;
CPPUNIT_FAIL(string(msg.mb_str()));
}
}
case wxZLIB_ZLIB:
if (!(data_size >= 1 && data[0] == 0x78))
{
- wxLogError(_T("zlib data seems to not be zlib data!"));
+ wxLogError(wxT("zlib data seems to not be zlib data!"));
}
break;
case wxZLIB_GZIP:
if (!(data_size >= 2 && data[0] == 0x1F && data[1] == 0x8B))
{
- wxLogError(_T("gzip data seems to not be gzip data!"));
+ wxLogError(wxT("gzip data seems to not be gzip data!"));
}
break;
case wxZLIB_AUTO:
if (!(data_size >= 1 && data[0] == 0x78) ||
!(data_size >= 2 && data[0] == 0x1F && data[1] == 0x8B))
{
- wxLogError(_T("Data seems to not be zlib or gzip data!"));
+ wxLogError(wxT("Data seems to not be zlib or gzip data!"));
}
default:
- wxLogError(_T("Unknown flag, skipping quick test."));
+ wxLogError(wxT("Unknown flag, skipping quick test."));
};
// Creat the needed streams.
memstream_out.CopyTo(data, size);
}
- out << _T("void zlibStream::Decompress_wxXXXData()") << _T("\n");
- out << _T("{") << _T("\n") << _T(" const unsigned char data[] = {");
+ out << wxT("void zlibStream::Decompress_wxXXXData()") << wxT("\n");
+ out << wxT("{") << wxT("\n") << wxT(" const unsigned char data[] = {");
size_t i;
for (i = 0; i < size; i++)
{
if (i+1 != size)
- out << wxString::Format(_T("%d,"), data[i]);
+ out << wxString::Format(wxT("%d,"), data[i]);
else
- out << wxString::Format(_T("%d"), data[i]);
+ out << wxString::Format(wxT("%d"), data[i]);
}
delete [] data;
- out << _T("};") << _T("\n");
- out << _T(" const char *value = \"") << wxString(buf, wxConvUTF8) << _T("\";") << _T("\n");
- out << _T(" const size_t data_size = sizeof(data);") << _T("\n");
- out << _T(" const size_t value_size = strlen(value);") << _T("\n");
- out << _T(" doDecompress_ExternalData(data, value, data_size, value_size);") << _T("\n");
- out << _T("}") << _T("\n");
+ out << wxT("};") << wxT("\n");
+ out << wxT(" const char *value = \"") << wxString(buf, wxConvUTF8) << wxT("\";") << wxT("\n");
+ out << wxT(" const size_t data_size = sizeof(data);") << wxT("\n");
+ out << wxT(" const size_t value_size = strlen(value);") << wxT("\n");
+ out << wxT(" doDecompress_ExternalData(data, value, data_size, value_size);") << wxT("\n");
+ out << wxT("}") << wxT("\n");
}
void CrtTestCase::SetGetEnv()
{
-#define TESTVAR_NAME _T("WXTESTVAR")
+#define TESTVAR_NAME wxT("WXTESTVAR")
wxString val;
- wxSetEnv(TESTVAR_NAME, _T("value"));
+ wxSetEnv(TESTVAR_NAME, wxT("value"));
CPPUNIT_ASSERT( wxGetEnv(TESTVAR_NAME, &val) );
CPPUNIT_ASSERT_EQUAL( "value", val );
CPPUNIT_ASSERT_EQUAL( "value", wxString(wxGetenv(TESTVAR_NAME)) );
- wxSetEnv(TESTVAR_NAME, _T("something else"));
+ wxSetEnv(TESTVAR_NAME, wxT("something else"));
CPPUNIT_ASSERT( wxGetEnv(TESTVAR_NAME, &val) );
CPPUNIT_ASSERT_EQUAL( "something else", val );
CPPUNIT_ASSERT_EQUAL( "something else", wxString(wxGetenv(TESTVAR_NAME)) );
void StdStringTestCase::StdConstructors()
{
- wxString s1(_T("abcdefgh")),
- s2(_T("abcdefghijklm"), 8),
- s3(_T("abcdefghijklm")),
- s4(8, _T('a'));
+ wxString s1(wxT("abcdefgh")),
+ s2(wxT("abcdefghijklm"), 8),
+ s3(wxT("abcdefghijklm")),
+ s4(8, wxT('a'));
wxString s5(s1),
s6(s3, 0, 8),
s7(s3.begin(), s3.begin() + 8);
wxString s8(s1, 4, 8);
- CPPUNIT_ASSERT_EQUAL( _T("abcdefgh"), s1 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcdefgh"), s1 );
CPPUNIT_ASSERT_EQUAL( s1, s2 );
- CPPUNIT_ASSERT_EQUAL( _T("aaaaaaaa"), s4 );
- CPPUNIT_ASSERT_EQUAL( _T("abcdefgh"), s5 );
+ CPPUNIT_ASSERT_EQUAL( wxT("aaaaaaaa"), s4 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcdefgh"), s5 );
CPPUNIT_ASSERT_EQUAL( s1, s6 );
CPPUNIT_ASSERT_EQUAL( s1, s7 );
- CPPUNIT_ASSERT_EQUAL( _T("efgh"), s8 );
+ CPPUNIT_ASSERT_EQUAL( wxT("efgh"), s8 );
const char *pc = s1.c_str();
CPPUNIT_ASSERT_EQUAL( "bcd", wxString(pc + 1, pc + 4) );
{
wxString s1, s2, s3, s4, s5, s6, s7, s8;
- s1 = s2 = s3 = s4 = s5 = s6 = _T("abc");
- s1.append(_T("def"));
- s2.append(_T("defgh"), 3);
- s3.append(wxString(_T("abcdef")), 3, 6);
+ s1 = s2 = s3 = s4 = s5 = s6 = wxT("abc");
+ s1.append(wxT("def"));
+ s2.append(wxT("defgh"), 3);
+ s3.append(wxString(wxT("abcdef")), 3, 6);
s4.append(s1);
- s5.append(3, _T('a'));
+ s5.append(3, wxT('a'));
s5.append(2, 'x');
s5.append(1, (unsigned char)'y');
s6.append(s1.begin() + 3, s1.end());
- CPPUNIT_ASSERT_EQUAL( _T("abcdef"), s1 );
- CPPUNIT_ASSERT_EQUAL( _T("abcdef"), s2 );
- CPPUNIT_ASSERT_EQUAL( _T("abcdef"), s3 );
- CPPUNIT_ASSERT_EQUAL( _T("abcabcdef"), s4 );
- CPPUNIT_ASSERT_EQUAL( _T("abcaaaxxy"), s5 );
- CPPUNIT_ASSERT_EQUAL( _T("abcdef"), s6 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcdef"), s1 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcdef"), s2 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcdef"), s3 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcabcdef"), s4 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcaaaxxy"), s5 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcdef"), s6 );
const char *pc = s1.c_str() + 2;
s7.append(pc, pc + 4);
s8.append(pw, pw + 4);
CPPUNIT_ASSERT_EQUAL( "cdef", s8 );
- s7 = s8 = wxString(_T("null\0time"), 9);
+ s7 = s8 = wxString(wxT("null\0time"), 9);
- s7.append(_T("def"));
- s8.append(_T("defgh"), 3);
+ s7.append(wxT("def"));
+ s8.append(wxT("defgh"), 3);
- CPPUNIT_ASSERT_EQUAL( wxString(_T("null\0timedef"), 12), s7 );
- CPPUNIT_ASSERT_EQUAL( wxString(_T("null\0timedef"), 12), s8 );
+ CPPUNIT_ASSERT_EQUAL( wxString(wxT("null\0timedef"), 12), s7 );
+ CPPUNIT_ASSERT_EQUAL( wxString(wxT("null\0timedef"), 12), s8 );
}
void StdStringTestCase::StdAssign()
{
wxString s1, s2, s3, s4, s5, s6, s7, s8;
- s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = _T("abc");
- s1.assign(_T("def"));
- s2.assign(_T("defgh"), 3);
- s3.assign(wxString(_T("abcdef")), 3, 6);
+ s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = wxT("abc");
+ s1.assign(wxT("def"));
+ s2.assign(wxT("defgh"), 3);
+ s3.assign(wxString(wxT("abcdef")), 3, 6);
s4.assign(s1);
- s5.assign(3, _T('a'));
+ s5.assign(3, wxT('a'));
s6.assign(s1.begin() + 1, s1.end());
- CPPUNIT_ASSERT_EQUAL( _T("def"), s1 );
- CPPUNIT_ASSERT_EQUAL( _T("def"), s2 );
- CPPUNIT_ASSERT_EQUAL( _T("def"), s3 );
- CPPUNIT_ASSERT_EQUAL( _T("def"), s4 );
- CPPUNIT_ASSERT_EQUAL( _T("aaa"), s5 );
- CPPUNIT_ASSERT_EQUAL( _T("ef"), s6 );
+ CPPUNIT_ASSERT_EQUAL( wxT("def"), s1 );
+ CPPUNIT_ASSERT_EQUAL( wxT("def"), s2 );
+ CPPUNIT_ASSERT_EQUAL( wxT("def"), s3 );
+ CPPUNIT_ASSERT_EQUAL( wxT("def"), s4 );
+ CPPUNIT_ASSERT_EQUAL( wxT("aaa"), s5 );
+ CPPUNIT_ASSERT_EQUAL( wxT("ef"), s6 );
const char *pc = s1.c_str();
s7.assign(pc, pc + 2);
{
wxString s1, s2, s3, s4, s5, s6, s7, s8;
- s1 = _T("abcdefgh");
- s2 = _T("abcdefgh");
- s3 = _T("abc");
- s4 = _T("abcdefghi");
- s5 = _T("aaa");
- s6 = _T("zzz");
+ s1 = wxT("abcdefgh");
+ s2 = wxT("abcdefgh");
+ s3 = wxT("abc");
+ s4 = wxT("abcdefghi");
+ s5 = wxT("aaa");
+ s6 = wxT("zzz");
CPPUNIT_ASSERT( s1.compare(s2) == 0 );
CPPUNIT_ASSERT( s1.compare(s3) > 0 );
CPPUNIT_ASSERT( s1.compare(s5) > 0 );
CPPUNIT_ASSERT( s1.compare(s6) < 0 );
CPPUNIT_ASSERT( s1.compare(1, 12, s1) > 0);
- CPPUNIT_ASSERT( s1.compare(_T("abcdefgh")) == 0);
- CPPUNIT_ASSERT( s1.compare(1, 7, _T("bcdefgh")) == 0);
- CPPUNIT_ASSERT( s1.compare(1, 7, _T("bcdefgh"), 7) == 0);
+ CPPUNIT_ASSERT( s1.compare(wxT("abcdefgh")) == 0);
+ CPPUNIT_ASSERT( s1.compare(1, 7, wxT("bcdefgh")) == 0);
+ CPPUNIT_ASSERT( s1.compare(1, 7, wxT("bcdefgh"), 7) == 0);
}
void StdStringTestCase::StdErase()
{
wxString s1, s2, s3, s4, s5, s6, s7;
- s1 = _T("abcdefgh");
- s2 = _T("abcdefgh");
- s3 = _T("abc");
- s4 = _T("abcdefghi");
- s5 = _T("aaa");
- s6 = _T("zzz");
- s7 = _T("zabcdefg");
+ s1 = wxT("abcdefgh");
+ s2 = wxT("abcdefgh");
+ s3 = wxT("abc");
+ s4 = wxT("abcdefghi");
+ s5 = wxT("aaa");
+ s6 = wxT("zzz");
+ s7 = wxT("zabcdefg");
s1.erase(1, 1);
s2.erase(4, 12);
wxString::iterator it2 = s4.erase(s4.begin() + 4, s4.begin() + 6);
wxString::iterator it3 = s7.erase(s7.begin() + 4, s7.begin() + 8);
- CPPUNIT_ASSERT_EQUAL( _T("acdefgh"), s1 );
- CPPUNIT_ASSERT_EQUAL( _T("abcd"), s2 );
- CPPUNIT_ASSERT_EQUAL( _T("ac"), s3 );
- CPPUNIT_ASSERT_EQUAL( _T("abcdghi"), s4 );
- CPPUNIT_ASSERT_EQUAL( _T("zabc"), s7 );
- CPPUNIT_ASSERT( *it == _T('c') );
- CPPUNIT_ASSERT( *it2 == _T('g') );
+ CPPUNIT_ASSERT_EQUAL( wxT("acdefgh"), s1 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcd"), s2 );
+ CPPUNIT_ASSERT_EQUAL( wxT("ac"), s3 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcdghi"), s4 );
+ CPPUNIT_ASSERT_EQUAL( wxT("zabc"), s7 );
+ CPPUNIT_ASSERT( *it == wxT('c') );
+ CPPUNIT_ASSERT( *it2 == wxT('g') );
CPPUNIT_ASSERT( it3 == s7.end() );
}
{
// 0 1 2
// 01234567890123456789012345
- wxString s1 = _T("abcdefgABCDEFGabcABCabcABC");
- wxString s2 = _T("gAB");
+ wxString s1 = wxT("abcdefgABCDEFGabcABCabcABC");
+ wxString s2 = wxT("gAB");
- CPPUNIT_ASSERT( s1.find(_T('A')) == 7u );
- CPPUNIT_ASSERT( s1.find(_T('A'), 7) == 7u );
- CPPUNIT_ASSERT( s1.find(_T('Z')) == wxString::npos );
- CPPUNIT_ASSERT( s1.find(_T('C'), 22) == 25u );
+ CPPUNIT_ASSERT( s1.find(wxT('A')) == 7u );
+ CPPUNIT_ASSERT( s1.find(wxT('A'), 7) == 7u );
+ CPPUNIT_ASSERT( s1.find(wxT('Z')) == wxString::npos );
+ CPPUNIT_ASSERT( s1.find(wxT('C'), 22) == 25u );
- CPPUNIT_ASSERT( s1.find(_T("gAB")) == 6u );
- CPPUNIT_ASSERT( s1.find(_T("gAB"), 7) == wxString::npos );
- CPPUNIT_ASSERT( s1.find(_T("gAB"), 6) == 6u );
+ CPPUNIT_ASSERT( s1.find(wxT("gAB")) == 6u );
+ CPPUNIT_ASSERT( s1.find(wxT("gAB"), 7) == wxString::npos );
+ CPPUNIT_ASSERT( s1.find(wxT("gAB"), 6) == 6u );
- CPPUNIT_ASSERT( s1.find(_T("gABZZZ"), 2, 3) == 6u );
- CPPUNIT_ASSERT( s1.find(_T("gABZZZ"), 7, 3) == wxString::npos );
+ CPPUNIT_ASSERT( s1.find(wxT("gABZZZ"), 2, 3) == 6u );
+ CPPUNIT_ASSERT( s1.find(wxT("gABZZZ"), 7, 3) == wxString::npos );
CPPUNIT_ASSERT( s1.find(s2) == 6u );
CPPUNIT_ASSERT( s1.find(s2, 7) == wxString::npos );
// 0 1 2
// 0123456 78901234567 8901234567
- //wxString _s1 = _T("abcdefg\0ABCDEFGabc\0ABCabcABC");
- //wxString _s2 = _T("g\0AB");
- wxString _s1 = _T("abcdefgABCDEFGabcABCabcABC");
- wxString _s2 = _T("gAB");
+ //wxString _s1 = wxT("abcdefg\0ABCDEFGabc\0ABCabcABC");
+ //wxString _s2 = wxT("g\0AB");
+ wxString _s1 = wxT("abcdefgABCDEFGabcABCabcABC");
+ wxString _s2 = wxT("gAB");
_s1.insert(7, 1, '\0');
_s1.insert(18, 1, '\0');
_s2.insert(1, 1, '\0');
- CPPUNIT_ASSERT( _s1.find(_T('A')) == 8u );
- CPPUNIT_ASSERT( _s1.find(_T('A'), 8) == 8u );
- CPPUNIT_ASSERT( _s1.find(_T('Z')) == wxString::npos );
- CPPUNIT_ASSERT( _s1.find(_T('C'), 22) == 27u );
+ CPPUNIT_ASSERT( _s1.find(wxT('A')) == 8u );
+ CPPUNIT_ASSERT( _s1.find(wxT('A'), 8) == 8u );
+ CPPUNIT_ASSERT( _s1.find(wxT('Z')) == wxString::npos );
+ CPPUNIT_ASSERT( _s1.find(wxT('C'), 22) == 27u );
- CPPUNIT_ASSERT( _s1.find(_T("AB")) == 8u );
- CPPUNIT_ASSERT( _s1.find(_T("AB"), 26) == wxString::npos );
- CPPUNIT_ASSERT( _s1.find(_T("AB"), 23) == 25u );
+ CPPUNIT_ASSERT( _s1.find(wxT("AB")) == 8u );
+ CPPUNIT_ASSERT( _s1.find(wxT("AB"), 26) == wxString::npos );
+ CPPUNIT_ASSERT( _s1.find(wxT("AB"), 23) == 25u );
- CPPUNIT_ASSERT( _s1.find(_T("ABZZZ"), 2, 2) == 8u );
- CPPUNIT_ASSERT( _s1.find(_T("ABZZZ"), 26, 2) == wxString::npos );
+ CPPUNIT_ASSERT( _s1.find(wxT("ABZZZ"), 2, 2) == 8u );
+ CPPUNIT_ASSERT( _s1.find(wxT("ABZZZ"), 26, 2) == wxString::npos );
CPPUNIT_ASSERT( _s1.find(_s2) == 6u );
CPPUNIT_ASSERT( _s1.find(_s2, 7) == wxString::npos );
{
// 0 1 2 3
// 01234567890123456789012345678901234
- wxString s1 = _T("aaaaaabcdefghlkjiaaaaaabcdbcdbcdbcd");
- wxString s2 = _T("aaaaaa");
+ wxString s1 = wxT("aaaaaabcdefghlkjiaaaaaabcdbcdbcdbcd");
+ wxString s2 = wxT("aaaaaa");
- CPPUNIT_ASSERT( s1.find_first_not_of(_T('a')) == 6u );
- CPPUNIT_ASSERT( s1.find_first_not_of(_T('a'), 7) == 7u );
- CPPUNIT_ASSERT( s2.find_first_not_of(_T('a')) == wxString::npos );
+ CPPUNIT_ASSERT( s1.find_first_not_of(wxT('a')) == 6u );
+ CPPUNIT_ASSERT( s1.find_first_not_of(wxT('a'), 7) == 7u );
+ CPPUNIT_ASSERT( s2.find_first_not_of(wxT('a')) == wxString::npos );
- CPPUNIT_ASSERT( s1.find_first_not_of(_T("abde"), 4) == 7u );
- CPPUNIT_ASSERT( s1.find_first_not_of(_T("abde"), 7) == 7u );
- CPPUNIT_ASSERT( s1.find_first_not_of(_T("abcdefghijkl")) == wxString::npos );
+ CPPUNIT_ASSERT( s1.find_first_not_of(wxT("abde"), 4) == 7u );
+ CPPUNIT_ASSERT( s1.find_first_not_of(wxT("abde"), 7) == 7u );
+ CPPUNIT_ASSERT( s1.find_first_not_of(wxT("abcdefghijkl")) == wxString::npos );
- CPPUNIT_ASSERT( s1.find_first_not_of(_T("abcdefghi"), 0, 4) == 9u );
+ CPPUNIT_ASSERT( s1.find_first_not_of(wxT("abcdefghi"), 0, 4) == 9u );
- CPPUNIT_ASSERT( s1.find_first_of(_T('c')) == 7u );
- CPPUNIT_ASSERT( s1.find_first_of(_T('v')) == wxString::npos );
- CPPUNIT_ASSERT( s1.find_first_of(_T('c'), 10) == 24u );
+ CPPUNIT_ASSERT( s1.find_first_of(wxT('c')) == 7u );
+ CPPUNIT_ASSERT( s1.find_first_of(wxT('v')) == wxString::npos );
+ CPPUNIT_ASSERT( s1.find_first_of(wxT('c'), 10) == 24u );
- CPPUNIT_ASSERT( s1.find_first_of(_T("ijkl")) == 13u );
- CPPUNIT_ASSERT( s1.find_first_of(_T("ddcfg"), 17) == 24u );
- CPPUNIT_ASSERT( s1.find_first_of(_T("ddcfga"), 17, 5) == 24u );
+ CPPUNIT_ASSERT( s1.find_first_of(wxT("ijkl")) == 13u );
+ CPPUNIT_ASSERT( s1.find_first_of(wxT("ddcfg"), 17) == 24u );
+ CPPUNIT_ASSERT( s1.find_first_of(wxT("ddcfga"), 17, 5) == 24u );
}
void StdStringTestCase::StdFindLast()
{
// 0 1 2 3
// 01234567890123456789012345678901234
- wxString s1 = _T("aaaaaabcdefghlkjiaaaaaabcdbcdbcdbcd");
- wxString s2 = _T("aaaaaa");
+ wxString s1 = wxT("aaaaaabcdefghlkjiaaaaaabcdbcdbcdbcd");
+ wxString s2 = wxT("aaaaaa");
- CPPUNIT_ASSERT( s2.find_last_not_of(_T('a')) == wxString::npos );
- CPPUNIT_ASSERT( s1.find_last_not_of(_T('d')) == 33u );
- CPPUNIT_ASSERT( s1.find_last_not_of(_T('d'), 25) == 24u );
+ CPPUNIT_ASSERT( s2.find_last_not_of(wxT('a')) == wxString::npos );
+ CPPUNIT_ASSERT( s1.find_last_not_of(wxT('d')) == 33u );
+ CPPUNIT_ASSERT( s1.find_last_not_of(wxT('d'), 25) == 24u );
- CPPUNIT_ASSERT( s1.find_last_not_of(_T("bcd")) == 22u );
- CPPUNIT_ASSERT( s1.find_last_not_of(_T("abc"), 24) == 16u );
+ CPPUNIT_ASSERT( s1.find_last_not_of(wxT("bcd")) == 22u );
+ CPPUNIT_ASSERT( s1.find_last_not_of(wxT("abc"), 24) == 16u );
- CPPUNIT_ASSERT( s1.find_last_not_of(_T("abcdefghijklmnopqrstuv"), 24, 3) == 16u );
+ CPPUNIT_ASSERT( s1.find_last_not_of(wxT("abcdefghijklmnopqrstuv"), 24, 3) == 16u );
- CPPUNIT_ASSERT( s2.find_last_of(_T('c')) == wxString::npos );
- CPPUNIT_ASSERT( s1.find_last_of(_T('a')) == 22u );
- CPPUNIT_ASSERT( s1.find_last_of(_T('b'), 24) == 23u );
+ CPPUNIT_ASSERT( s2.find_last_of(wxT('c')) == wxString::npos );
+ CPPUNIT_ASSERT( s1.find_last_of(wxT('a')) == 22u );
+ CPPUNIT_ASSERT( s1.find_last_of(wxT('b'), 24) == 23u );
- CPPUNIT_ASSERT( s1.find_last_of(_T("ijklm")) == 16u );
- CPPUNIT_ASSERT( s1.find_last_of(_T("ijklma"), 33, 4) == 16u );
- CPPUNIT_ASSERT( s1.find_last_of(_T("a"), 17) == 17u );
+ CPPUNIT_ASSERT( s1.find_last_of(wxT("ijklm")) == 16u );
+ CPPUNIT_ASSERT( s1.find_last_of(wxT("ijklma"), 33, 4) == 16u );
+ CPPUNIT_ASSERT( s1.find_last_of(wxT("a"), 17) == 17u );
// 0 1 2 3
// 012345 67890123456789 01234567890123456
-// wxString s1 = _T("aaaaaa\0bcdefghlkjiaa\0aaaabcdbcdbcdbcd");
-// wxString s2 = _T("aaaaaa\0");
+// wxString s1 = wxT("aaaaaa\0bcdefghlkjiaa\0aaaabcdbcdbcdbcd");
+// wxString s2 = wxT("aaaaaa\0");
s1.insert(6,1,'\0');
s1.insert(20,1,'\0');
s2.insert(6,1,'\0');
- CPPUNIT_ASSERT( s2.find_last_not_of(_T('a')) == 6u );
- CPPUNIT_ASSERT( s1.find_last_not_of(_T('d')) == 35u );
- CPPUNIT_ASSERT( s1.find_last_not_of(_T('d'), 27) == 26u );
+ CPPUNIT_ASSERT( s2.find_last_not_of(wxT('a')) == 6u );
+ CPPUNIT_ASSERT( s1.find_last_not_of(wxT('d')) == 35u );
+ CPPUNIT_ASSERT( s1.find_last_not_of(wxT('d'), 27) == 26u );
- CPPUNIT_ASSERT( s1.find_last_not_of(_T("bcd")) == 24u );
- CPPUNIT_ASSERT( s1.find_last_not_of(_T("abc"), 26) == 20u );
+ CPPUNIT_ASSERT( s1.find_last_not_of(wxT("bcd")) == 24u );
+ CPPUNIT_ASSERT( s1.find_last_not_of(wxT("abc"), 26) == 20u );
- CPPUNIT_ASSERT( s1.find_last_not_of(_T("abcdefghijklmnopqrstuv"), 26, 3) == 20u );
+ CPPUNIT_ASSERT( s1.find_last_not_of(wxT("abcdefghijklmnopqrstuv"), 26, 3) == 20u );
- CPPUNIT_ASSERT( s2.find_last_of(_T('c')) == wxString::npos );
- CPPUNIT_ASSERT( s1.find_last_of(_T('a')) == 24u );
- CPPUNIT_ASSERT( s1.find_last_of(_T('b'), 26) == 25u );
+ CPPUNIT_ASSERT( s2.find_last_of(wxT('c')) == wxString::npos );
+ CPPUNIT_ASSERT( s1.find_last_of(wxT('a')) == 24u );
+ CPPUNIT_ASSERT( s1.find_last_of(wxT('b'), 26) == 25u );
- CPPUNIT_ASSERT( s1.find_last_of(_T("ijklm")) == 17u );
- CPPUNIT_ASSERT( s1.find_last_of(_T("ijklma"), 35, 4) == 17u );
- CPPUNIT_ASSERT( s1.find_last_of(_T("a"), 18) == 18u );
+ CPPUNIT_ASSERT( s1.find_last_of(wxT("ijklm")) == 17u );
+ CPPUNIT_ASSERT( s1.find_last_of(wxT("ijklma"), 35, 4) == 17u );
+ CPPUNIT_ASSERT( s1.find_last_of(wxT("a"), 18) == 18u );
}
void StdStringTestCase::StdInsert()
{
wxString s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
- s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = _T("aaaa");
- s9 = s10 = _T("cdefg");
+ s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = wxT("aaaa");
+ s9 = s10 = wxT("cdefg");
- s1.insert(1, _T("cc") );
- s2.insert(2, _T("cdef"), 3);
+ s1.insert(1, wxT("cc") );
+ s2.insert(2, wxT("cdef"), 3);
s3.insert(2, s10);
s4.insert(2, s10, 3, 7);
- s5.insert(1, 2, _T('c'));
- s6.insert(s6.begin() + 3, _T('X'));
+ s5.insert(1, 2, wxT('c'));
+ s6.insert(s6.begin() + 3, wxT('X'));
s7.insert(s7.begin(), s9.begin(), s9.end() - 1);
- s8.insert(s8.begin(), 2, _T('c'));
-
- CPPUNIT_ASSERT_EQUAL( _T("accaaa") , s1 );
- CPPUNIT_ASSERT_EQUAL( _T("aacdeaa") , s2 );
- CPPUNIT_ASSERT_EQUAL( _T("aacdefgaa"), s3 );
- CPPUNIT_ASSERT_EQUAL( _T("aafgaa") , s4 );
- CPPUNIT_ASSERT_EQUAL( _T("accaaa") , s5 );
- CPPUNIT_ASSERT_EQUAL( _T("aaaXa") , s6 );
- CPPUNIT_ASSERT_EQUAL( _T("cdefaaaa") , s7 );
- CPPUNIT_ASSERT_EQUAL( _T("ccaaaa") , s8 );
-
- s1 = s2 = s3 = _T("aaaa");
- s1.insert(0, _T("ccc"), 2);
- s2.insert(4, _T("ccc"), 2);
-
- CPPUNIT_ASSERT_EQUAL( _T("ccaaaa"), s1 );
- CPPUNIT_ASSERT_EQUAL( _T("aaaacc"), s2 );
+ s8.insert(s8.begin(), 2, wxT('c'));
+
+ CPPUNIT_ASSERT_EQUAL( wxT("accaaa") , s1 );
+ CPPUNIT_ASSERT_EQUAL( wxT("aacdeaa") , s2 );
+ CPPUNIT_ASSERT_EQUAL( wxT("aacdefgaa"), s3 );
+ CPPUNIT_ASSERT_EQUAL( wxT("aafgaa") , s4 );
+ CPPUNIT_ASSERT_EQUAL( wxT("accaaa") , s5 );
+ CPPUNIT_ASSERT_EQUAL( wxT("aaaXa") , s6 );
+ CPPUNIT_ASSERT_EQUAL( wxT("cdefaaaa") , s7 );
+ CPPUNIT_ASSERT_EQUAL( wxT("ccaaaa") , s8 );
+
+ s1 = s2 = s3 = wxT("aaaa");
+ s1.insert(0, wxT("ccc"), 2);
+ s2.insert(4, wxT("ccc"), 2);
+
+ CPPUNIT_ASSERT_EQUAL( wxT("ccaaaa"), s1 );
+ CPPUNIT_ASSERT_EQUAL( wxT("aaaacc"), s2 );
}
void StdStringTestCase::StdReplace()
{
wxString s1, s2, s3, s4, s5, s6, s7, s8, s9;
- s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = _T("QWERTYUIOP");
- s9 = _T("werty");
+ s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = wxT("QWERTYUIOP");
+ s9 = wxT("werty");
- s1.replace(3, 4, _T("rtyu"));
- s1.replace(8, 7, _T("opopop"));
- s2.replace(10, 12, _T("WWWW"));
+ s1.replace(3, 4, wxT("rtyu"));
+ s1.replace(8, 7, wxT("opopop"));
+ s2.replace(10, 12, wxT("WWWW"));
s3.replace(1, 5, s9);
s4.replace(1, 4, s9, 0, 4);
s5.replace(1, 2, s9, 1, 12);
s6.replace(0, 123, s9, 0, 123);
s7.replace(2, 7, s9);
- CPPUNIT_ASSERT_EQUAL( _T("QWErtyuIopopop"), s1 );
- CPPUNIT_ASSERT_EQUAL( _T("QWERTYUIOPWWWW"), s2 );
- CPPUNIT_ASSERT_EQUAL( _T("QwertyUIOP") , s3 );
- CPPUNIT_ASSERT_EQUAL( _T("QwertYUIOP") , s4 );
- CPPUNIT_ASSERT_EQUAL( _T("QertyRTYUIOP") , s5 );
+ CPPUNIT_ASSERT_EQUAL( wxT("QWErtyuIopopop"), s1 );
+ CPPUNIT_ASSERT_EQUAL( wxT("QWERTYUIOPWWWW"), s2 );
+ CPPUNIT_ASSERT_EQUAL( wxT("QwertyUIOP") , s3 );
+ CPPUNIT_ASSERT_EQUAL( wxT("QwertYUIOP") , s4 );
+ CPPUNIT_ASSERT_EQUAL( wxT("QertyRTYUIOP") , s5 );
CPPUNIT_ASSERT_EQUAL( s9, s6 );
- CPPUNIT_ASSERT_EQUAL( _T("QWwertyP"), s7 );
+ CPPUNIT_ASSERT_EQUAL( wxT("QWwertyP"), s7 );
}
void StdStringTestCase::StdRFind()
{
// 0 1 2
// 01234567890123456789012345
- wxString s1 = _T("abcdefgABCDEFGabcABCabcABC");
- wxString s2 = _T("gAB");
- wxString s3 = _T("ab");
+ wxString s1 = wxT("abcdefgABCDEFGabcABCabcABC");
+ wxString s2 = wxT("gAB");
+ wxString s3 = wxT("ab");
- CPPUNIT_ASSERT( s1.rfind(_T('A')) == 23u );
- CPPUNIT_ASSERT( s1.rfind(_T('A'), 7) == 7u );
- CPPUNIT_ASSERT( s1.rfind(_T('Z')) == wxString::npos );
- CPPUNIT_ASSERT( s1.rfind(_T('C'), 22) == 19u );
+ CPPUNIT_ASSERT( s1.rfind(wxT('A')) == 23u );
+ CPPUNIT_ASSERT( s1.rfind(wxT('A'), 7) == 7u );
+ CPPUNIT_ASSERT( s1.rfind(wxT('Z')) == wxString::npos );
+ CPPUNIT_ASSERT( s1.rfind(wxT('C'), 22) == 19u );
- CPPUNIT_ASSERT( s1.rfind(_T("cAB")) == 22u );
- CPPUNIT_ASSERT( s1.rfind(_T("cAB"), 15) == wxString::npos );
- CPPUNIT_ASSERT( s1.rfind(_T("cAB"), 21) == 16u );
+ CPPUNIT_ASSERT( s1.rfind(wxT("cAB")) == 22u );
+ CPPUNIT_ASSERT( s1.rfind(wxT("cAB"), 15) == wxString::npos );
+ CPPUNIT_ASSERT( s1.rfind(wxT("cAB"), 21) == 16u );
- CPPUNIT_ASSERT( s1.rfind(_T("gABZZZ"), 7, 3) == 6u );
- CPPUNIT_ASSERT( s1.rfind(_T("gABZZZ"), 5, 3) == wxString::npos );
+ CPPUNIT_ASSERT( s1.rfind(wxT("gABZZZ"), 7, 3) == 6u );
+ CPPUNIT_ASSERT( s1.rfind(wxT("gABZZZ"), 5, 3) == wxString::npos );
CPPUNIT_ASSERT( s1.rfind(s2) == 6u );
CPPUNIT_ASSERT( s1.rfind(s2, 5) == wxString::npos );
// 0 1 2
// 01234 56789012 345678901234567
-// wxString s1 = _T("abcde\0fgABCDE\0FGabcABCabcABC");
-// wxString s2 = _T("gAB");
-// wxString s3 = _T("ab");
+// wxString s1 = wxT("abcde\0fgABCDE\0FGabcABCabcABC");
+// wxString s2 = wxT("gAB");
+// wxString s3 = wxT("ab");
s1.insert(5,1,'\0');
s1.insert(13,1,'\0');
- CPPUNIT_ASSERT( s1.rfind(_T('A')) == 25u );
- CPPUNIT_ASSERT( s1.rfind(_T('A'), 8) == 8u );
- CPPUNIT_ASSERT( s1.rfind(_T('Z')) == wxString::npos );
- CPPUNIT_ASSERT( s1.rfind(_T('C'), 22) == 21u );
+ CPPUNIT_ASSERT( s1.rfind(wxT('A')) == 25u );
+ CPPUNIT_ASSERT( s1.rfind(wxT('A'), 8) == 8u );
+ CPPUNIT_ASSERT( s1.rfind(wxT('Z')) == wxString::npos );
+ CPPUNIT_ASSERT( s1.rfind(wxT('C'), 22) == 21u );
- CPPUNIT_ASSERT( s1.rfind(_T("cAB")) == 24u );
- CPPUNIT_ASSERT( s1.rfind(_T("cAB"), 15) == wxString::npos );
- CPPUNIT_ASSERT( s1.rfind(_T("cAB"), 21) == 18u );
+ CPPUNIT_ASSERT( s1.rfind(wxT("cAB")) == 24u );
+ CPPUNIT_ASSERT( s1.rfind(wxT("cAB"), 15) == wxString::npos );
+ CPPUNIT_ASSERT( s1.rfind(wxT("cAB"), 21) == 18u );
- CPPUNIT_ASSERT( s1.rfind(_T("gABZZZ"), 8, 3) == 7u );
- CPPUNIT_ASSERT( s1.rfind(_T("gABZZZ"), 5, 3) == wxString::npos );
+ CPPUNIT_ASSERT( s1.rfind(wxT("gABZZZ"), 8, 3) == 7u );
+ CPPUNIT_ASSERT( s1.rfind(wxT("gABZZZ"), 5, 3) == wxString::npos );
}
void StdStringTestCase::StdResize()
{
wxString s1, s2, s3, s4;
- s1 = s2 = s3 = s4 = _T("abcABCdefDEF");
+ s1 = s2 = s3 = s4 = wxT("abcABCdefDEF");
s1.resize( 12 );
s2.resize( 10 );
- s3.resize( 14, _T(' ') );
- s4.resize( 14, _T('W') );
+ s3.resize( 14, wxT(' ') );
+ s4.resize( 14, wxT('W') );
- CPPUNIT_ASSERT_EQUAL( _T("abcABCdefDEF"), s1 );
- CPPUNIT_ASSERT_EQUAL( _T("abcABCdefD"), s2 );
- CPPUNIT_ASSERT_EQUAL( _T("abcABCdefDEF "), s3 );
- CPPUNIT_ASSERT_EQUAL( _T("abcABCdefDEFWW"), s4 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefDEF"), s1 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefD"), s2 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefDEF "), s3 );
+ CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefDEFWW"), s4 );
wxString s =
wxString::FromUTF8("\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82");
void StdStringTestCase::StdRiter()
{
- const wxString s(_T("fozbar"));
+ const wxString s(wxT("fozbar"));
wxString::const_reverse_iterator ri(s.rbegin());
- CPPUNIT_ASSERT( _T('r') == *ri );
- CPPUNIT_ASSERT( _T('a') == *++ri );
- CPPUNIT_ASSERT( _T('r') == *--ri );
+ CPPUNIT_ASSERT( wxT('r') == *ri );
+ CPPUNIT_ASSERT( wxT('a') == *++ri );
+ CPPUNIT_ASSERT( wxT('r') == *--ri );
ri = s.rend();
ri--;
- CPPUNIT_ASSERT( _T('f') == *ri );
+ CPPUNIT_ASSERT( wxT('f') == *ri );
--ri;
- CPPUNIT_ASSERT( _T('o') == *ri );
+ CPPUNIT_ASSERT( wxT('o') == *ri );
wxString::const_iterator i = ri.base();
- CPPUNIT_ASSERT( _T('z') == *i );
+ CPPUNIT_ASSERT( wxT('z') == *i );
}
void StdStringTestCase::StdSubstr()
{
- wxString s1 = _T("abcdefgABCDEFG");
+ wxString s1 = wxT("abcdefgABCDEFG");
CPPUNIT_ASSERT( s1.substr( 0, 14 ) == s1 );
- CPPUNIT_ASSERT( s1.substr( 1, 13 ) == _T("bcdefgABCDEFG") );
- CPPUNIT_ASSERT( s1.substr( 1, 20 ) == _T("bcdefgABCDEFG") );
- CPPUNIT_ASSERT( s1.substr( 14, 30 ) == _T("") );
+ CPPUNIT_ASSERT( s1.substr( 1, 13 ) == wxT("bcdefgABCDEFG") );
+ CPPUNIT_ASSERT( s1.substr( 1, 20 ) == wxT("bcdefgABCDEFG") );
+ CPPUNIT_ASSERT( s1.substr( 14, 30 ) == wxT("") );
s1.insert(3,1,'\0');
s1.insert(8,1,'\0');
CPPUNIT_ASSERT( s1.substr( 0, 17 ) == s1 );
CPPUNIT_ASSERT( s1.substr( 1, 17 ) == s2 );
CPPUNIT_ASSERT( s1.substr( 1, 20 ) == s2 );
- CPPUNIT_ASSERT( s1.substr( 17, 30 ) == _T("") );
+ CPPUNIT_ASSERT( s1.substr( 17, 30 ) == wxT("") );
}
#if wxUSE_STD_STRING
for (int i = 0; i < 2; ++i)
{
- a = _T("Hello");
- b = _T(" world");
- c = _T("! How'ya doin'?");
+ a = wxT("Hello");
+ b = wxT(" world");
+ c = wxT("! How'ya doin'?");
a += b;
a += c;
- c = _T("Hello world! What's up?");
+ c = wxT("Hello world! What's up?");
CPPUNIT_ASSERT( c != a );
}
}
for (int i = 0; i < 2; ++i)
{
- wxStrcpy (a, _T("Hello"));
- wxStrcpy (b, _T(" world"));
- wxStrcpy (c, _T("! How'ya doin'?"));
+ wxStrcpy (a, wxT("Hello"));
+ wxStrcpy (b, wxT(" world"));
+ wxStrcpy (c, wxT("! How'ya doin'?"));
wxStrcat (a, b);
wxStrcat (a, c);
- wxStrcpy (c, _T("Hello world! What's up?"));
+ wxStrcpy (c, wxT("Hello world! What's up?"));
CPPUNIT_ASSERT( wxStrcmp (c, a) != 0 );
}
}
void StringTestCase::Format()
{
wxString s1,s2;
- s1.Printf(_T("%03d"), 18);
- CPPUNIT_ASSERT( s1 == wxString::Format(_T("%03d"), 18) );
- s2.Printf(_T("Number 18: %s\n"), s1.c_str());
- CPPUNIT_ASSERT( s2 == wxString::Format(_T("Number 18: %s\n"), s1.c_str()) );
+ s1.Printf(wxT("%03d"), 18);
+ CPPUNIT_ASSERT( s1 == wxString::Format(wxT("%03d"), 18) );
+ s2.Printf(wxT("Number 18: %s\n"), s1.c_str());
+ CPPUNIT_ASSERT( s2 == wxString::Format(wxT("Number 18: %s\n"), s1.c_str()) );
static const size_t lengths[] = { 1, 512, 1024, 1025, 2048, 4096, 4097 };
for ( size_t n = 0; n < WXSIZEOF(lengths); n++ )
{
const size_t len = lengths[n];
- wxString s(_T('Z'), len);
- CPPUNIT_ASSERT_EQUAL( len, wxString::Format(_T("%s"), s.c_str()).length());
+ wxString s(wxT('Z'), len);
+ CPPUNIT_ASSERT_EQUAL( len, wxString::Format(wxT("%s"), s.c_str()).length());
}
}
void StringTestCase::Extraction()
{
- wxString s(_T("Hello, world!"));
+ wxString s(wxT("Hello, world!"));
- CPPUNIT_ASSERT( wxStrcmp( s.c_str() , _T("Hello, world!") ) == 0 );
- CPPUNIT_ASSERT( wxStrcmp( s.Left(5).c_str() , _T("Hello") ) == 0 );
- CPPUNIT_ASSERT( wxStrcmp( s.Right(6).c_str() , _T("world!") ) == 0 );
- CPPUNIT_ASSERT( wxStrcmp( s(3, 5).c_str() , _T("lo, w") ) == 0 );
- CPPUNIT_ASSERT( wxStrcmp( s.Mid(3).c_str() , _T("lo, world!") ) == 0 );
- CPPUNIT_ASSERT( wxStrcmp( s.substr(3, 5).c_str() , _T("lo, w") ) == 0 );
- CPPUNIT_ASSERT( wxStrcmp( s.substr(3).c_str() , _T("lo, world!") ) == 0 );
+ CPPUNIT_ASSERT( wxStrcmp( s.c_str() , wxT("Hello, world!") ) == 0 );
+ CPPUNIT_ASSERT( wxStrcmp( s.Left(5).c_str() , wxT("Hello") ) == 0 );
+ CPPUNIT_ASSERT( wxStrcmp( s.Right(6).c_str() , wxT("world!") ) == 0 );
+ CPPUNIT_ASSERT( wxStrcmp( s(3, 5).c_str() , wxT("lo, w") ) == 0 );
+ CPPUNIT_ASSERT( wxStrcmp( s.Mid(3).c_str() , wxT("lo, world!") ) == 0 );
+ CPPUNIT_ASSERT( wxStrcmp( s.substr(3, 5).c_str() , wxT("lo, w") ) == 0 );
+ CPPUNIT_ASSERT( wxStrcmp( s.substr(3).c_str() , wxT("lo, world!") ) == 0 );
#if wxUSE_UNICODE
static const char *germanUTF8 = "Oberfl\303\244che";
if ( result ) \
CPPUNIT_ASSERT_EQUAL(correct_rest, rest)
- TEST_STARTS_WITH( _T("Hello"), _T(", world!"), true );
- TEST_STARTS_WITH( _T("Hello, "), _T("world!"), true );
- TEST_STARTS_WITH( _T("Hello, world!"), _T(""), true );
- TEST_STARTS_WITH( _T("Hello, world!!!"), _T(""), false );
- TEST_STARTS_WITH( _T(""), _T("Hello, world!"), true );
- TEST_STARTS_WITH( _T("Goodbye"), _T(""), false );
- TEST_STARTS_WITH( _T("Hi"), _T(""), false );
+ TEST_STARTS_WITH( wxT("Hello"), wxT(", world!"), true );
+ TEST_STARTS_WITH( wxT("Hello, "), wxT("world!"), true );
+ TEST_STARTS_WITH( wxT("Hello, world!"), wxT(""), true );
+ TEST_STARTS_WITH( wxT("Hello, world!!!"), wxT(""), false );
+ TEST_STARTS_WITH( wxT(""), wxT("Hello, world!"), true );
+ TEST_STARTS_WITH( wxT("Goodbye"), wxT(""), false );
+ TEST_STARTS_WITH( wxT("Hi"), wxT(""), false );
#undef TEST_STARTS_WITH
if ( result ) \
CPPUNIT_ASSERT_EQUAL(correct_rest, rest)
- TEST_ENDS_WITH( _T(""), _T("Hello, world!"), true );
- TEST_ENDS_WITH( _T("!"), _T("Hello, world"), true );
- TEST_ENDS_WITH( _T(", world!"), _T("Hello"), true );
- TEST_ENDS_WITH( _T("ello, world!"), _T("H"), true );
- TEST_ENDS_WITH( _T("Hello, world!"), _T(""), true );
- TEST_ENDS_WITH( _T("very long string"), _T(""), false );
- TEST_ENDS_WITH( _T("?"), _T(""), false );
- TEST_ENDS_WITH( _T("Hello, world"), _T(""), false );
- TEST_ENDS_WITH( _T("Gello, world!"), _T(""), false );
+ TEST_ENDS_WITH( wxT(""), wxT("Hello, world!"), true );
+ TEST_ENDS_WITH( wxT("!"), wxT("Hello, world"), true );
+ TEST_ENDS_WITH( wxT(", world!"), wxT("Hello"), true );
+ TEST_ENDS_WITH( wxT("ello, world!"), wxT("H"), true );
+ TEST_ENDS_WITH( wxT("Hello, world!"), wxT(""), true );
+ TEST_ENDS_WITH( wxT("very long string"), wxT(""), false );
+ TEST_ENDS_WITH( wxT("?"), wxT(""), false );
+ TEST_ENDS_WITH( wxT("Hello, world"), wxT(""), false );
+ TEST_ENDS_WITH( wxT("Gello, world!"), wxT(""), false );
#undef TEST_ENDS_WITH
}
#define TEST_TRIM( str , dir , result ) \
CPPUNIT_ASSERT( wxString(str).Trim(dir) == result )
- TEST_TRIM( _T(" Test "), true, _T(" Test") );
- TEST_TRIM( _T(" "), true, _T("") );
- TEST_TRIM( _T(" "), true, _T("") );
- TEST_TRIM( _T(""), true, _T("") );
+ TEST_TRIM( wxT(" Test "), true, wxT(" Test") );
+ TEST_TRIM( wxT(" "), true, wxT("") );
+ TEST_TRIM( wxT(" "), true, wxT("") );
+ TEST_TRIM( wxT(""), true, wxT("") );
- TEST_TRIM( _T(" Test "), false, _T("Test ") );
- TEST_TRIM( _T(" "), false, _T("") );
- TEST_TRIM( _T(" "), false, _T("") );
- TEST_TRIM( _T(""), false, _T("") );
+ TEST_TRIM( wxT(" Test "), false, wxT("Test ") );
+ TEST_TRIM( wxT(" "), false, wxT("") );
+ TEST_TRIM( wxT(" "), false, wxT("") );
+ TEST_TRIM( wxT(""), false, wxT("") );
#undef TEST_TRIM
}
void StringTestCase::Find()
{
#define TEST_FIND( str , start , result ) \
- CPPUNIT_ASSERT( wxString(str).find(_T("ell"), start) == result );
+ CPPUNIT_ASSERT( wxString(str).find(wxT("ell"), start) == result );
- TEST_FIND( _T("Well, hello world"), 0, 1 );
- TEST_FIND( _T("Well, hello world"), 6, 7 );
- TEST_FIND( _T("Well, hello world"), 9, wxString::npos );
+ TEST_FIND( wxT("Well, hello world"), 0, 1 );
+ TEST_FIND( wxT("Well, hello world"), 6, 7 );
+ TEST_FIND( wxT("Well, hello world"), 9, wxString::npos );
#undef TEST_FIND
}
CPPUNIT_ASSERT_EQUAL( result, s ); \
}
- TEST_REPLACE( _T("012-AWORD-XYZ"), 4, 5, _T("BWORD"), _T("012-BWORD-XYZ") );
- TEST_REPLACE( _T("increase"), 0, 2, _T("de"), _T("decrease") );
- TEST_REPLACE( _T("wxWindow"), 8, 0, _T("s"), _T("wxWindows") );
- TEST_REPLACE( _T("foobar"), 3, 0, _T("-"), _T("foo-bar") );
- TEST_REPLACE( _T("barfoo"), 0, 6, _T("foobar"), _T("foobar") );
+ TEST_REPLACE( wxT("012-AWORD-XYZ"), 4, 5, wxT("BWORD"), wxT("012-BWORD-XYZ") );
+ TEST_REPLACE( wxT("increase"), 0, 2, wxT("de"), wxT("decrease") );
+ TEST_REPLACE( wxT("wxWindow"), 8, 0, wxT("s"), wxT("wxWindows") );
+ TEST_REPLACE( wxT("foobar"), 3, 0, wxT("-"), wxT("foo-bar") );
+ TEST_REPLACE( wxT("barfoo"), 0, 6, wxT("foobar"), wxT("foobar") );
#define TEST_NULLCHARREPLACE( o , olen, pos , len , replacement , r, rlen ) \
CPPUNIT_ASSERT_EQUAL( wxString(r,rlen), s ); \
}
- TEST_NULLCHARREPLACE( _T("null\0char"), 9, 5, 1, _T("d"),
- _T("null\0dhar"), 9 );
+ TEST_NULLCHARREPLACE( wxT("null\0char"), 9, 5, 1, wxT("d"),
+ wxT("null\0dhar"), 9 );
#define TEST_WXREPLACE( o , olen, olds, news, all, r, rlen ) \
{ \
CPPUNIT_ASSERT_EQUAL( wxString(r,rlen), s ); \
}
- TEST_WXREPLACE( _T("null\0char"), 9, _T("c"), _T("de"), true,
- _T("null\0dehar"), 10 );
+ TEST_WXREPLACE( wxT("null\0char"), 9, wxT("c"), wxT("de"), true,
+ wxT("null\0dehar"), 10 );
- TEST_WXREPLACE( _T("null\0dehar"), 10, _T("de"), _T("c"), true,
- _T("null\0char"), 9 );
+ TEST_WXREPLACE( wxT("null\0dehar"), 10, wxT("de"), wxT("c"), true,
+ wxT("null\0char"), 9 );
TEST_WXREPLACE( "life", 4, "f", "", false, "lie", 3 );
TEST_WXREPLACE( "life", 4, "f", "", true, "lie", 3 );
#define TEST_MATCH( s1 , s2 , result ) \
CPPUNIT_ASSERT( wxString(s1).Matches(s2) == result )
- TEST_MATCH( _T("foobar"), _T("foo*"), true );
- TEST_MATCH( _T("foobar"), _T("*oo*"), true );
- TEST_MATCH( _T("foobar"), _T("*bar"), true );
- TEST_MATCH( _T("foobar"), _T("??????"), true );
- TEST_MATCH( _T("foobar"), _T("f??b*"), true );
- TEST_MATCH( _T("foobar"), _T("f?b*"), false );
- TEST_MATCH( _T("foobar"), _T("*goo*"), false );
- TEST_MATCH( _T("foobar"), _T("*foo"), false );
- TEST_MATCH( _T("foobarfoo"), _T("*foo"), true );
- TEST_MATCH( _T(""), _T("*"), true );
- TEST_MATCH( _T(""), _T("?"), false );
+ TEST_MATCH( wxT("foobar"), wxT("foo*"), true );
+ TEST_MATCH( wxT("foobar"), wxT("*oo*"), true );
+ TEST_MATCH( wxT("foobar"), wxT("*bar"), true );
+ TEST_MATCH( wxT("foobar"), wxT("??????"), true );
+ TEST_MATCH( wxT("foobar"), wxT("f??b*"), true );
+ TEST_MATCH( wxT("foobar"), wxT("f?b*"), false );
+ TEST_MATCH( wxT("foobar"), wxT("*goo*"), false );
+ TEST_MATCH( wxT("foobar"), wxT("*foo"), false );
+ TEST_MATCH( wxT("foobarfoo"), wxT("*foo"), true );
+ TEST_MATCH( wxT(""), wxT("*"), true );
+ TEST_MATCH( wxT(""), wxT("?"), false );
#undef TEST_MATCH
}
void StringTestCase::CaseChanges()
{
- wxString s1(_T("Hello!"));
+ wxString s1(wxT("Hello!"));
wxString s1u(s1);
wxString s1l(s1);
s1u.MakeUpper();
s1l.MakeLower();
- CPPUNIT_ASSERT_EQUAL( _T("HELLO!"), s1u );
- CPPUNIT_ASSERT_EQUAL( _T("hello!"), s1l );
+ CPPUNIT_ASSERT_EQUAL( wxT("HELLO!"), s1u );
+ CPPUNIT_ASSERT_EQUAL( wxT("hello!"), s1l );
wxString s2u, s2l;
s2u.MakeUpper();
bool contains;
} containsData[] =
{
- { _T(""), _T(""), true },
- { _T(""), _T("foo"), false },
- { _T("foo"), _T(""), true },
- { _T("foo"), _T("f"), true },
- { _T("foo"), _T("o"), true },
- { _T("foo"), _T("oo"), true },
- { _T("foo"), _T("ooo"), false },
- { _T("foo"), _T("oooo"), false },
- { _T("foo"), _T("fooo"), false },
+ { wxT(""), wxT(""), true },
+ { wxT(""), wxT("foo"), false },
+ { wxT("foo"), wxT(""), true },
+ { wxT("foo"), wxT("f"), true },
+ { wxT("foo"), wxT("o"), true },
+ { wxT("foo"), wxT("oo"), true },
+ { wxT("foo"), wxT("ooo"), false },
+ { wxT("foo"), wxT("oooo"), false },
+ { wxT("foo"), wxT("fooo"), false },
};
for ( size_t n = 0; n < WXSIZEOF(containsData); n++ )
bool IsOk() const { return !(flags & Number_Invalid); }
} longData[] =
{
- { _T("1"), 1, Number_Ok },
- { _T("0"), 0, Number_Ok },
- { _T("a"), 0, Number_Invalid },
- { _T("12345"), 12345, Number_Ok },
- { _T("--1"), 0, Number_Invalid },
+ { wxT("1"), 1, Number_Ok },
+ { wxT("0"), 0, Number_Ok },
+ { wxT("a"), 0, Number_Invalid },
+ { wxT("12345"), 12345, Number_Ok },
+ { wxT("--1"), 0, Number_Invalid },
- { _T("-1"), -1, Number_Signed | Number_Long },
+ { wxT("-1"), -1, Number_Signed | Number_Long },
// this is surprizing but consistent with strtoul() behaviour
- { _T("-1"), ULONG_MAX, Number_Unsigned | Number_Long },
+ { wxT("-1"), ULONG_MAX, Number_Unsigned | Number_Long },
// this must overflow, even with 64 bit long
- { _T("922337203685477580711"), 0, Number_Invalid },
+ { wxT("922337203685477580711"), 0, Number_Invalid },
#ifdef wxLongLong_t
- { _T("2147483648"), wxLL(2147483648), Number_LongLong },
- { _T("-2147483648"), wxLL(-2147483648), Number_LongLong | Number_Signed },
- { _T("9223372036854775808"), wxULL(9223372036854775808), Number_LongLong |
+ { wxT("2147483648"), wxLL(2147483648), Number_LongLong },
+ { wxT("-2147483648"), wxLL(-2147483648), Number_LongLong | Number_Signed },
+ { wxT("9223372036854775808"), wxULL(9223372036854775808), Number_LongLong |
Number_Unsigned },
#endif // wxLongLong_t
};
bool ok;
} doubleData[] =
{
- { _T("1"), 1, true },
- { _T("1.23"), 1.23, true },
- { _T(".1"), .1, true },
- { _T("1."), 1, true },
- { _T("1.."), 0, false },
- { _T("0"), 0, true },
- { _T("a"), 0, false },
- { _T("12345"), 12345, true },
- { _T("-1"), -1, true },
- { _T("--1"), 0, false },
- { _T("-3E-5"), -3E-5, true },
- { _T("-3E-abcde5"), 0, false },
+ { wxT("1"), 1, true },
+ { wxT("1.23"), 1.23, true },
+ { wxT(".1"), .1, true },
+ { wxT("1."), 1, true },
+ { wxT("1.."), 0, false },
+ { wxT("0"), 0, true },
+ { wxT("a"), 0, false },
+ { wxT("12345"), 12345, true },
+ { wxT("-1"), -1, true },
+ { wxT("--1"), 0, false },
+ { wxT("-3E-5"), -3E-5, true },
+ { wxT("-3E-abcde5"), 0, false },
};
// test ToCDouble() first:
static const struct ToDoubleData doubleData2[] =
{
- { _T("1"), 1, true },
- { _T("1,23"), 1.23, true },
- { _T(",1"), .1, true },
- { _T("1,"), 1, true },
- { _T("1,,"), 0, false },
- { _T("0"), 0, true },
- { _T("a"), 0, false },
- { _T("12345"), 12345, true },
- { _T("-1"), -1, true },
- { _T("--1"), 0, false },
- { _T("-3E-5"), -3E-5, true },
- { _T("-3E-abcde5"), 0, false },
+ { wxT("1"), 1, true },
+ { wxT("1,23"), 1.23, true },
+ { wxT(",1"), .1, true },
+ { wxT("1,"), 1, true },
+ { wxT("1,,"), 0, false },
+ { wxT("0"), 0, true },
+ { wxT("a"), 0, false },
+ { wxT("12345"), 12345, true },
+ { wxT("-1"), -1, true },
+ { wxT("--1"), 0, false },
+ { wxT("-3E-5"), -3E-5, true },
+ { wxT("-3E-abcde5"), 0, false },
};
for ( n = 0; n < WXSIZEOF(doubleData2); n++ )
{
// check that buffer can be used to write into the string
wxString s;
- wxStrcpy(wxStringBuffer(s, 10), _T("foo"));
+ wxStrcpy(wxStringBuffer(s, 10), wxT("foo"));
CPPUNIT_ASSERT_EQUAL(3, s.length());
- CPPUNIT_ASSERT(_T('f') == s[0u]);
- CPPUNIT_ASSERT(_T('o') == s[1]);
- CPPUNIT_ASSERT(_T('o') == s[2]);
+ CPPUNIT_ASSERT(wxT('f') == s[0u]);
+ CPPUNIT_ASSERT(wxT('o') == s[1]);
+ CPPUNIT_ASSERT(wxT('o') == s[2]);
{
// also check that the buffer initially contains the original string
// contents
wxStringBuffer buf(s, 10);
- CPPUNIT_ASSERT_EQUAL( _T('f'), buf[0] );
- CPPUNIT_ASSERT_EQUAL( _T('o'), buf[1] );
- CPPUNIT_ASSERT_EQUAL( _T('o'), buf[2] );
- CPPUNIT_ASSERT_EQUAL( _T('\0'), buf[3] );
+ CPPUNIT_ASSERT_EQUAL( wxT('f'), buf[0] );
+ CPPUNIT_ASSERT_EQUAL( wxT('o'), buf[1] );
+ CPPUNIT_ASSERT_EQUAL( wxT('o'), buf[2] );
+ CPPUNIT_ASSERT_EQUAL( wxT('\0'), buf[3] );
}
{
wxStringBufferLength buf(s, 10);
- CPPUNIT_ASSERT_EQUAL( _T('f'), buf[0] );
- CPPUNIT_ASSERT_EQUAL( _T('o'), buf[1] );
- CPPUNIT_ASSERT_EQUAL( _T('o'), buf[2] );
- CPPUNIT_ASSERT_EQUAL( _T('\0'), buf[3] );
+ CPPUNIT_ASSERT_EQUAL( wxT('f'), buf[0] );
+ CPPUNIT_ASSERT_EQUAL( wxT('o'), buf[1] );
+ CPPUNIT_ASSERT_EQUAL( wxT('o'), buf[2] );
+ CPPUNIT_ASSERT_EQUAL( wxT('\0'), buf[3] );
// and check that it can be used to write only the specified number of
// characters to the string
- wxStrcpy(buf, _T("barrbaz"));
+ wxStrcpy(buf, wxT("barrbaz"));
buf.SetLength(4);
}
CPPUNIT_ASSERT_EQUAL(4, s.length());
- CPPUNIT_ASSERT(_T('b') == s[0u]);
- CPPUNIT_ASSERT(_T('a') == s[1]);
- CPPUNIT_ASSERT(_T('r') == s[2]);
- CPPUNIT_ASSERT(_T('r') == s[3]);
+ CPPUNIT_ASSERT(wxT('b') == s[0u]);
+ CPPUNIT_ASSERT(wxT('a') == s[1]);
+ CPPUNIT_ASSERT(wxT('r') == s[2]);
+ CPPUNIT_ASSERT(wxT('r') == s[3]);
// check that creating buffer of length smaller than string works, i.e. at
// least doesn't crash (it would if we naively copied the entire original
}
gs_testData[] =
{
- { _T(""), _T(" "), wxTOKEN_DEFAULT, 0 },
- { _T(""), _T(" "), wxTOKEN_RET_EMPTY, 0 },
- { _T(""), _T(" "), wxTOKEN_RET_EMPTY_ALL, 0 },
- { _T(""), _T(" "), wxTOKEN_RET_DELIMS, 0 },
- { _T(":"), _T(":"), wxTOKEN_RET_EMPTY, 1 },
- { _T(":"), _T(":"), wxTOKEN_RET_DELIMS, 1 },
- { _T(":"), _T(":"), wxTOKEN_RET_EMPTY_ALL, 2 },
- { _T("::"), _T(":"), wxTOKEN_RET_EMPTY, 1 },
- { _T("::"), _T(":"), wxTOKEN_RET_DELIMS, 1 },
- { _T("::"), _T(":"), wxTOKEN_RET_EMPTY_ALL, 3 },
-
- { _T("Hello, world"), _T(" "), wxTOKEN_DEFAULT, 2 },
- { _T("Hello, world "), _T(" "), wxTOKEN_DEFAULT, 2 },
- { _T("Hello, world"), _T(","), wxTOKEN_DEFAULT, 2 },
- { _T("Hello, world!"), _T(",!"), wxTOKEN_DEFAULT, 2 },
- { _T("Hello,, world!"), _T(",!"), wxTOKEN_DEFAULT, 3 },
- { _T("Hello,, world!"), _T(",!"), wxTOKEN_STRTOK, 2 },
- { _T("Hello, world!"), _T(",!"), wxTOKEN_RET_EMPTY_ALL, 3 },
-
- { _T("username:password:uid:gid:gecos:home:shell"),
- _T(":"), wxTOKEN_DEFAULT, 7 },
-
- { _T("1:2::3:"), _T(":"), wxTOKEN_DEFAULT, 4 },
- { _T("1:2::3:"), _T(":"), wxTOKEN_RET_EMPTY, 4 },
- { _T("1:2::3:"), _T(":"), wxTOKEN_RET_EMPTY_ALL, 5 },
- { _T("1:2::3:"), _T(":"), wxTOKEN_RET_DELIMS, 4 },
- { _T("1:2::3:"), _T(":"), wxTOKEN_STRTOK, 3 },
-
- { _T("1:2::3::"), _T(":"), wxTOKEN_DEFAULT, 4 },
- { _T("1:2::3::"), _T(":"), wxTOKEN_RET_EMPTY, 4 },
- { _T("1:2::3::"), _T(":"), wxTOKEN_RET_EMPTY_ALL, 6 },
- { _T("1:2::3::"), _T(":"), wxTOKEN_RET_DELIMS, 4 },
- { _T("1:2::3::"), _T(":"), wxTOKEN_STRTOK, 3 },
-
- { _T("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_DEFAULT, 4 },
- { _T("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_STRTOK, 4 },
- { _T("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_RET_EMPTY, 6 },
- { _T("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_RET_EMPTY_ALL, 9 },
-
- { _T("01/02/99"), _T("/-"), wxTOKEN_DEFAULT, 3 },
- { _T("01-02/99"), _T("/-"), wxTOKEN_RET_DELIMS, 3 },
+ { wxT(""), wxT(" "), wxTOKEN_DEFAULT, 0 },
+ { wxT(""), wxT(" "), wxTOKEN_RET_EMPTY, 0 },
+ { wxT(""), wxT(" "), wxTOKEN_RET_EMPTY_ALL, 0 },
+ { wxT(""), wxT(" "), wxTOKEN_RET_DELIMS, 0 },
+ { wxT(":"), wxT(":"), wxTOKEN_RET_EMPTY, 1 },
+ { wxT(":"), wxT(":"), wxTOKEN_RET_DELIMS, 1 },
+ { wxT(":"), wxT(":"), wxTOKEN_RET_EMPTY_ALL, 2 },
+ { wxT("::"), wxT(":"), wxTOKEN_RET_EMPTY, 1 },
+ { wxT("::"), wxT(":"), wxTOKEN_RET_DELIMS, 1 },
+ { wxT("::"), wxT(":"), wxTOKEN_RET_EMPTY_ALL, 3 },
+
+ { wxT("Hello, world"), wxT(" "), wxTOKEN_DEFAULT, 2 },
+ { wxT("Hello, world "), wxT(" "), wxTOKEN_DEFAULT, 2 },
+ { wxT("Hello, world"), wxT(","), wxTOKEN_DEFAULT, 2 },
+ { wxT("Hello, world!"), wxT(",!"), wxTOKEN_DEFAULT, 2 },
+ { wxT("Hello,, world!"), wxT(",!"), wxTOKEN_DEFAULT, 3 },
+ { wxT("Hello,, world!"), wxT(",!"), wxTOKEN_STRTOK, 2 },
+ { wxT("Hello, world!"), wxT(",!"), wxTOKEN_RET_EMPTY_ALL, 3 },
+
+ { wxT("username:password:uid:gid:gecos:home:shell"),
+ wxT(":"), wxTOKEN_DEFAULT, 7 },
+
+ { wxT("1:2::3:"), wxT(":"), wxTOKEN_DEFAULT, 4 },
+ { wxT("1:2::3:"), wxT(":"), wxTOKEN_RET_EMPTY, 4 },
+ { wxT("1:2::3:"), wxT(":"), wxTOKEN_RET_EMPTY_ALL, 5 },
+ { wxT("1:2::3:"), wxT(":"), wxTOKEN_RET_DELIMS, 4 },
+ { wxT("1:2::3:"), wxT(":"), wxTOKEN_STRTOK, 3 },
+
+ { wxT("1:2::3::"), wxT(":"), wxTOKEN_DEFAULT, 4 },
+ { wxT("1:2::3::"), wxT(":"), wxTOKEN_RET_EMPTY, 4 },
+ { wxT("1:2::3::"), wxT(":"), wxTOKEN_RET_EMPTY_ALL, 6 },
+ { wxT("1:2::3::"), wxT(":"), wxTOKEN_RET_DELIMS, 4 },
+ { wxT("1:2::3::"), wxT(":"), wxTOKEN_STRTOK, 3 },
+
+ { wxT("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_DEFAULT, 4 },
+ { wxT("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_STRTOK, 4 },
+ { wxT("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_RET_EMPTY, 6 },
+ { wxT("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_RET_EMPTY_ALL, 9 },
+
+ { wxT("01/02/99"), wxT("/-"), wxTOKEN_DEFAULT, 3 },
+ { wxT("01-02/99"), wxT("/-"), wxTOKEN_RET_DELIMS, 3 },
};
// helper function returning the string showing the index for which the test
// fails in the diagnostic message
static std::string Nth(size_t n)
{
- return std::string(wxString::Format(_T("for loop index %lu"),
+ return std::string(wxString::Format(wxT("for loop index %lu"),
(unsigned long)n).mb_str());
}
void TokenizerTestCase::GetPosition()
{
- DoTestGetPosition(_T("foo"), _T("_"), 3, 0);
- DoTestGetPosition(_T("foo_bar"), _T("_"), 4, 7, 0);
- DoTestGetPosition(_T("foo_bar_"), _T("_"), 4, 8, 0);
+ DoTestGetPosition(wxT("foo"), wxT("_"), 3, 0);
+ DoTestGetPosition(wxT("foo_bar"), wxT("_"), 4, 7, 0);
+ DoTestGetPosition(wxT("foo_bar_"), wxT("_"), 4, 8, 0);
}
// helper for GetString(): the parameters are the same as for DoTestGetPosition
void TokenizerTestCase::GetString()
{
- DoTestGetString(_T("foo"), _T("_"), 3, 0);
- DoTestGetString(_T("foo_bar"), _T("_"), 4, 7, 0);
- DoTestGetString(_T("foo_bar_"), _T("_"), 4, 8, 0);
+ DoTestGetString(wxT("foo"), wxT("_"), 3, 0);
+ DoTestGetString(wxT("foo_bar"), wxT("_"), 4, 7, 0);
+ DoTestGetString(wxT("foo_bar_"), wxT("_"), 4, 8, 0);
}
void TokenizerTestCase::LastDelimiter()
{
- wxStringTokenizer tkz(_T("a+-b=c"), _T("+-="));
+ wxStringTokenizer tkz(wxT("a+-b=c"), wxT("+-="));
tkz.GetNextToken();
- CPPUNIT_ASSERT_EQUAL( _T('+'), tkz.GetLastDelimiter() );
+ CPPUNIT_ASSERT_EQUAL( wxT('+'), tkz.GetLastDelimiter() );
tkz.GetNextToken();
- CPPUNIT_ASSERT_EQUAL( _T('-'), tkz.GetLastDelimiter() );
+ CPPUNIT_ASSERT_EQUAL( wxT('-'), tkz.GetLastDelimiter() );
tkz.GetNextToken();
- CPPUNIT_ASSERT_EQUAL( _T('='), tkz.GetLastDelimiter() );
+ CPPUNIT_ASSERT_EQUAL( wxT('='), tkz.GetLastDelimiter() );
tkz.GetNextToken();
- CPPUNIT_ASSERT_EQUAL( _T('\0'), tkz.GetLastDelimiter() );
+ CPPUNIT_ASSERT_EQUAL( wxT('\0'), tkz.GetLastDelimiter() );
}
void TokenizerTestCase::StrtokCompat()
CPPUNIT_ASSERT( a == a );
CPPUNIT_ASSERT( a == 'a' );
- CPPUNIT_ASSERT( a == _T('a') );
+ CPPUNIT_ASSERT( a == wxT('a') );
CPPUNIT_ASSERT( a == wxUniChar('a') );
- CPPUNIT_ASSERT( a == wxUniChar(_T('a')) );
+ CPPUNIT_ASSERT( a == wxUniChar(wxT('a')) );
CPPUNIT_ASSERT( a != b );
CPPUNIT_ASSERT( a != 'b' );
- CPPUNIT_ASSERT( a != _T('b') );
+ CPPUNIT_ASSERT( a != wxT('b') );
CPPUNIT_ASSERT( a != wxUniChar('b') );
- CPPUNIT_ASSERT( a != wxUniChar(_T('b')) );
+ CPPUNIT_ASSERT( a != wxUniChar(wxT('b')) );
CPPUNIT_ASSERT( a < b );
CPPUNIT_ASSERT( a < 'b' );
- CPPUNIT_ASSERT( a < _T('b') );
+ CPPUNIT_ASSERT( a < wxT('b') );
CPPUNIT_ASSERT( a < wxUniChar('b') );
- CPPUNIT_ASSERT( a < wxUniChar(_T('b')) );
+ CPPUNIT_ASSERT( a < wxUniChar(wxT('b')) );
CPPUNIT_ASSERT( a <= b );
CPPUNIT_ASSERT( a <= 'b' );
- CPPUNIT_ASSERT( a <= _T('b') );
+ CPPUNIT_ASSERT( a <= wxT('b') );
CPPUNIT_ASSERT( a <= wxUniChar('b') );
- CPPUNIT_ASSERT( a <= wxUniChar(_T('b')) );
+ CPPUNIT_ASSERT( a <= wxUniChar(wxT('b')) );
CPPUNIT_ASSERT( a <= a );
CPPUNIT_ASSERT( a <= 'a' );
- CPPUNIT_ASSERT( a <= _T('a') );
+ CPPUNIT_ASSERT( a <= wxT('a') );
CPPUNIT_ASSERT( a <= wxUniChar('a') );
- CPPUNIT_ASSERT( a <= wxUniChar(_T('a')) );
+ CPPUNIT_ASSERT( a <= wxUniChar(wxT('a')) );
CPPUNIT_ASSERT( b > a );
CPPUNIT_ASSERT( b > 'a' );
- CPPUNIT_ASSERT( b > _T('a') );
+ CPPUNIT_ASSERT( b > wxT('a') );
CPPUNIT_ASSERT( b > wxUniChar('a') );
- CPPUNIT_ASSERT( b > wxUniChar(_T('a')) );
+ CPPUNIT_ASSERT( b > wxUniChar(wxT('a')) );
CPPUNIT_ASSERT( b >= a );
CPPUNIT_ASSERT( b >= 'a' );
- CPPUNIT_ASSERT( b >= _T('a') );
+ CPPUNIT_ASSERT( b >= wxT('a') );
CPPUNIT_ASSERT( b >= wxUniChar('a') );
- CPPUNIT_ASSERT( b >= wxUniChar(_T('a')) );
+ CPPUNIT_ASSERT( b >= wxUniChar(wxT('a')) );
CPPUNIT_ASSERT( b >= b );
CPPUNIT_ASSERT( b >= 'b' );
- CPPUNIT_ASSERT( b >= _T('b') );
+ CPPUNIT_ASSERT( b >= wxT('b') );
CPPUNIT_ASSERT( b >= wxUniChar('b') );
- CPPUNIT_ASSERT( b >= wxUniChar(_T('b')) );
+ CPPUNIT_ASSERT( b >= wxUniChar(wxT('b')) );
CPPUNIT_ASSERT( b - a == 1 );
CPPUNIT_ASSERT( a - b == -1 );
wxString sa = "a";
const wxString sb = "b";
char c1 = 'a';
- wchar_t c2 = _T('a');
+ wchar_t c2 = wxT('a');
wxUniChar c3 = 'a';
CPPUNIT_ASSERT( sa == 'a');
StringConversionData("\xc2", NULL),
};
- wxCSConv conv(_T("utf-8"));
+ wxCSConv conv(wxT("utf-8"));
for ( size_t n = 0; n < WXSIZEOF(utf8data); n++ )
{
const StringConversionData& d = utf8data[n];
// test passing literals:
s.Printf("%s %i", "foo", 42);
CPPUNIT_ASSERT( s == "foo 42" );
- s.Printf("%s %s %i", _T("bar"), "=", 11);
+ s.Printf("%s %s %i", wxT("bar"), "=", 11);
// test passing c_str():
CPPUNIT_ASSERT( s == "bar = 11" );
s2.Printf("(%s)", s.c_str());
CPPUNIT_ASSERT( s2 == "(bar = 11)" );
- s2.Printf(_T("[%s](%s)"), s.c_str(), "str");
+ s2.Printf(wxT("[%s](%s)"), s.c_str(), "str");
CPPUNIT_ASSERT( s2 == "[bar = 11](str)" );
s2.Printf("%s mailbox", wxString("Opening").c_str());
CPPUNIT_ASSERT( s2 == "Opening mailbox" );
// test passing wxString directly:
- s2.Printf(_T("[%s](%s)"), s, "str");
+ s2.Printf(wxT("[%s](%s)"), s, "str");
CPPUNIT_ASSERT( s2 == "[bar = 11](str)" );
// test passing wxCharBufferType<T>:
s = "FooBar";
- s2.Printf(_T("(%s)"), s.mb_str());
+ s2.Printf(wxT("(%s)"), s.mb_str());
CPPUNIT_ASSERT( s2 == "(FooBar)" );
- s2.Printf(_T("value=%s;"), s.wc_str());
+ s2.Printf(wxT("value=%s;"), s.wc_str());
CPPUNIT_ASSERT( s2 == "value=FooBar;" );
// this tests correct passing of wxCStrData constructed from string
// literal:
bool cond = true;
- s2.Printf(_T("foo %s"), !cond ? s.c_str() : _T("bar"));
+ s2.Printf(wxT("foo %s"), !cond ? s.c_str() : wxT("bar"));
}
void VarArgTestCase::CharPrintf()
{
int nchar;
- wxSnprintf(buf, MAX_TEST_LEN, _T("%d %s%n\n"), 3, _T("bears"), &nchar);
+ wxSnprintf(buf, MAX_TEST_LEN, wxT("%d %s%n\n"), 3, wxT("bears"), &nchar);
CPPUNIT_ASSERT_EQUAL( 7, nchar );
}
// format and gcc would warn about this otherwise
r = wxUnsafeSnprintf(buffer, size,
- _T("unicode string/char: %ls/%lc -- ansi string/char: %hs/%hc"),
+ wxT("unicode string/char: %ls/%lc -- ansi string/char: %hs/%hc"),
L"unicode", L'U', "ansi", 'A');
wxString expected =
wxString(wxT("unicode string/char: unicode/U -- ansi string/char: ansi/A")).Left(size - 1);
// Prepare messages so that it is possible to see from the error which
// test was running.
wxString errStr, overflowStr;
- errStr << _T("No.: ") << ++count << _T(", expected: ") << expectedLen
- << _T(" '") << expectedString << _T("', result: ");
- overflowStr << errStr << _T("buffer overflow");
- errStr << n << _T(" '") << buf << _T("'");
+ errStr << wxT("No.: ") << ++count << wxT(", expected: ") << expectedLen
+ << wxT(" '") << expectedString << wxT("', result: ");
+ overflowStr << errStr << wxT("buffer overflow");
+ errStr << n << wxT(" '") << buf << wxT("'");
// turn them into std::strings
std::string errMsg(errStr.mb_str());
CPPUNIT_ASSERT_EQUAL( (size_t)3, f.GetLineCount() );
CPPUNIT_ASSERT_EQUAL( wxTextFileType_Dos, f.GetLineType(0) );
CPPUNIT_ASSERT_EQUAL( wxTextFileType_None, f.GetLineType(2) );
- CPPUNIT_ASSERT_EQUAL( wxString(_T("bar")), f.GetLine(1) );
- CPPUNIT_ASSERT_EQUAL( wxString(_T("baz")), f.GetLastLine() );
+ CPPUNIT_ASSERT_EQUAL( wxString(wxT("bar")), f.GetLine(1) );
+ CPPUNIT_ASSERT_EQUAL( wxString(wxT("baz")), f.GetLastLine() );
}
void TextFileTestCase::ReadUnix()
CPPUNIT_ASSERT_EQUAL( (size_t)3, f.GetLineCount() );
CPPUNIT_ASSERT_EQUAL( wxTextFileType_Unix, f.GetLineType(0) );
CPPUNIT_ASSERT_EQUAL( wxTextFileType_None, f.GetLineType(2) );
- CPPUNIT_ASSERT_EQUAL( wxString(_T("bar")), f.GetLine(1) );
- CPPUNIT_ASSERT_EQUAL( wxString(_T("baz")), f.GetLastLine() );
+ CPPUNIT_ASSERT_EQUAL( wxString(wxT("bar")), f.GetLine(1) );
+ CPPUNIT_ASSERT_EQUAL( wxString(wxT("baz")), f.GetLastLine() );
}
void TextFileTestCase::ReadMac()
CPPUNIT_ASSERT_EQUAL( (size_t)3, f.GetLineCount() );
CPPUNIT_ASSERT_EQUAL( wxTextFileType_Mac, f.GetLineType(0) );
CPPUNIT_ASSERT_EQUAL( wxTextFileType_None, f.GetLineType(2) );
- CPPUNIT_ASSERT_EQUAL( wxString(_T("bar")), f.GetLine(1) );
- CPPUNIT_ASSERT_EQUAL( wxString(_T("baz")), f.GetLastLine() );
+ CPPUNIT_ASSERT_EQUAL( wxString(wxT("bar")), f.GetLine(1) );
+ CPPUNIT_ASSERT_EQUAL( wxString(wxT("baz")), f.GetLastLine() );
}
void TextFileTestCase::ReadMixed()
CPPUNIT_ASSERT_EQUAL( wxTextFileType_Mac, f.GetLineType(0) );
CPPUNIT_ASSERT_EQUAL( wxTextFileType_Dos, f.GetLineType(1) );
CPPUNIT_ASSERT_EQUAL( wxTextFileType_Unix, f.GetLineType(2) );
- CPPUNIT_ASSERT_EQUAL( wxString(_T("foo")), f.GetFirstLine() );
- CPPUNIT_ASSERT_EQUAL( wxString(_T("bar")), f.GetLine(1) );
- CPPUNIT_ASSERT_EQUAL( wxString(_T("baz")), f.GetLastLine() );
+ CPPUNIT_ASSERT_EQUAL( wxString(wxT("foo")), f.GetFirstLine() );
+ CPPUNIT_ASSERT_EQUAL( wxString(wxT("bar")), f.GetLine(1) );
+ CPPUNIT_ASSERT_EQUAL( wxString(wxT("baz")), f.GetLastLine() );
}
#if wxUSE_UNICODE
wxInputStream* is = urlProblem.GetInputStream();
CPPUNIT_ASSERT(is != NULL);
- wxFile fOut(_T("test.html"), wxFile::write);
+ wxFile fOut(wxT("test.html"), wxFile::write);
wxASSERT(fOut.IsOpened());
char buf[1001];
// If the development version, go up a directory.
#ifdef __WXMSW__
- if ((m_appDir.Right(5).CmpNoCase(_T("DEBUG")) == 0) ||
- (m_appDir.Right(11).CmpNoCase(_T("DEBUGSTABLE")) == 0) ||
- (m_appDir.Right(7).CmpNoCase(_T("RELEASE")) == 0) ||
- (m_appDir.Right(13).CmpNoCase(_T("RELEASESTABLE")) == 0)
+ if ((m_appDir.Right(5).CmpNoCase(wxT("DEBUG")) == 0) ||
+ (m_appDir.Right(11).CmpNoCase(wxT("DEBUGSTABLE")) == 0) ||
+ (m_appDir.Right(7).CmpNoCase(wxT("RELEASE")) == 0) ||
+ (m_appDir.Right(13).CmpNoCase(wxT("RELEASESTABLE")) == 0)
)
m_appDir = wxPathOnly(m_appDir);
#endif
}
// create the main application window
- wxEmulatorFrame *frame = new wxEmulatorFrame(_T("wxEmulator"),
+ wxEmulatorFrame *frame = new wxEmulatorFrame(wxT("wxEmulator"),
wxPoint(50, 50), wxSize(450, 340));
#if wxUSE_STATUSBAR
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(Emulator_About, _T("&About...\tF1"), _T("Show about dialog"));
+ helpMenu->Append(Emulator_About, wxT("&About...\tF1"), wxT("Show about dialog"));
- menuFile->Append(Emulator_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
+ menuFile->Append(Emulator_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T("&File"));
- menuBar->Append(helpMenu, _T("&Help"));
+ menuBar->Append(menuFile, wxT("&File"));
+ menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
void wxEmulatorFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
- msg.Printf( _T("wxEmulator is an environment for testing embedded X11 apps.\n"));
+ msg.Printf( wxT("wxEmulator is an environment for testing embedded X11 apps.\n"));
- wxMessageBox(msg, _T("About wxEmulator"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, wxT("About wxEmulator"), wxOK | wxICON_INFORMATION, this);
}
void wxEmulatorFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
wxFileName::SplitPath(filename, & path, & name, & ext);
ext.MakeLower();
- if (ext == _T("jpg") || ext == _T("jpeg"))
+ if (ext == wxT("jpg") || ext == wxT("jpeg"))
return wxBITMAP_TYPE_JPEG;
- if (ext == _T("gif"))
+ if (ext == wxT("gif"))
return wxBITMAP_TYPE_GIF;
- if (ext == _T("bmp"))
+ if (ext == wxT("bmp"))
return wxBITMAP_TYPE_BMP;
- if (ext == _T("png"))
+ if (ext == wxT("png"))
return wxBITMAP_TYPE_PNG;
- if (ext == _T("pcx"))
+ if (ext == wxT("pcx"))
return wxBITMAP_TYPE_PCX;
- if (ext == _T("tif") || ext == _T("tiff"))
+ if (ext == wxT("tif") || ext == wxT("tiff"))
return wxBITMAP_TYPE_TIF;
return wxBITMAP_TYPE_INVALID;
if ( !s.empty() )
{
wxString ext = s.Right(4).Lower();
- if (ext == _T(".zip") || ext == _T(".htb") || ext == _T(".hhp"))
+ if (ext == wxT(".zip") || ext == wxT(".htb") || ext == wxT(".hhp"))
{
wxBusyCursor bcur;
wxFileName fileName(s);
#else
#define CREATE_STD_ICON(iconId, xpmRc) \
{ \
- wxIcon icon(_T(iconId)); \
+ wxIcon icon(wxT(iconId)); \
wxBitmap bmp; \
bmp.CopyFromIcon(icon); \
return bmp; \
switch ( sig )
{
default:
- wxFAIL_MSG( _T("unexpected return value") );
+ wxFAIL_MSG( wxT("unexpected return value") );
// fall through
case -1:
{
if ( wxProcess::Exists(m_pid) )
{
- wxLogStatus(_T("Process %ld is running."), m_pid);
+ wxLogStatus(wxT("Process %ld is running."), m_pid);
}
else
{
- wxLogStatus(_T("No process with pid = %ld."), m_pid);
+ wxLogStatus(wxT("No process with pid = %ld."), m_pid);
}
}
else // not SIGNONE
wxKillError rc = wxProcess::Kill(m_pid, (wxSignal)sig);
if ( rc == wxKILL_OK )
{
- wxLogStatus(_T("Process %ld killed with signal %d."), m_pid, sig);
+ wxLogStatus(wxT("Process %ld killed with signal %d."), m_pid, sig);
}
else
{
static const wxChar *errorText[] =
{
- _T(""), // no error
- _T("signal not supported"),
- _T("permission denied"),
- _T("no such process"),
- _T("unspecified error"),
+ wxT(""), // no error
+ wxT("signal not supported"),
+ wxT("permission denied"),
+ wxT("no such process"),
+ wxT("unspecified error"),
};
// sig = 3, 6, 9 or 12 all kill server with no apparent problem
// but give error message on MSW - timout?
//
- //wxLogError(_T("Failed to kill process %ld with signal %d: %s"),
+ //wxLogError(wxT("Failed to kill process %ld with signal %d: %s"),
// m_pid, sig, errorText[rc]);
}
}
for (int i = 1; i < argc; i++)
{
wxHtmlHelpData data;
- wxPrintf(_T("Processing %s...\n"), argv[i]);
+ wxPrintf(wxT("Processing %s...\n"), argv[i]);
data.SetTempDir(wxPathOnly(argv[i]));
data.AddBook(argv[i]);
}
}
/* static */
-wxString AutoCaptureMechanism::default_dir = _T("screenshots");
+wxString AutoCaptureMechanism::default_dir = wxT("screenshots");
/* static */
wxString AutoCaptureMechanism::GetDefaultDirectoryAbsPath()
// Somehow wxScreenDC.Blit() doesn't work under Mac for now. Here is a trick.
#ifdef __WXMAC__
- // wxExecute(_T("screencapture -x ") + tempfile, wxEXEC_SYNC);
+ // wxExecute(wxT("screencapture -x ") + tempfile, wxEXEC_SYNC);
char captureCommand[80] =""; // a reasonable max size is 80
sprintf(captureCommand, "sleep %d;%s", delay, "screencapture -x /tmp/wx_screen_capture.png");
wxBitmap fullscreen;
do
{
- fullscreen = wxBitmap(_T("/tmp/wx_screen_capture.png"), wxBITMAP_TYPE_PNG);
+ fullscreen = wxBitmap(wxT("/tmp/wx_screen_capture.png"), wxBITMAP_TYPE_PNG);
}
while(!fullscreen.IsOk());
{
// no manual specification for the control name
// or name adjustment is disabled globally
- if (ctrl.name == _T("") || m_flag & AJ_DisableNameAdjust)
+ if (ctrl.name == wxT("") || m_flag & AJ_DisableNameAdjust)
{
// Get its name from wxRTTI
ctrl.name = ctrl.ctrl->GetClassInfo()->GetClassName();
// cut off "wx" and change the name into lowercase.
// e.g. wxButton will have a name of "button" at the end
- ctrl.name.StartsWith(_T("wx"), &(ctrl.name));
+ ctrl.name.StartsWith(wxT("wx"), &(ctrl.name));
ctrl.name.MakeLower();
// take the screenshot
wxStaticText* l[4];
for (int i = 0; i < 4; ++i)
- l[i] = new wxStaticText(parent, wxID_ANY, _T(" "));
+ l[i] = new wxStaticText(parent, wxID_ANY, wxT(" "));
m_grid->Add(l[0]);
- m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
+ m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(l[1]);
- m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
+ m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(ctrl, 1, wxEXPAND);
- m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
+ m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(l[2]);
- m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
+ m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(l[3]);
sizer->Add(m_grid);
Please read the document of enum AdjustFlags, and notice that this flag could be enabled/
disabled by global flag GlobalAdjustFlags.
*/
- void RegisterControl(wxWindow * ctrl, wxString name = _T(""), int flag = AJ_Normal)
+ void RegisterControl(wxWindow * ctrl, wxString name = wxT(""), int flag = AJ_Normal)
{
m_controlList.push_back(Control(ctrl, name, flag));
}
*/
void RegisterControl(wxWindow * ctrl, int flag)
{
- RegisterControl(ctrl, _T(""), flag);
+ RegisterControl(ctrl, wxT(""), flag);
}
/**
*/
void RegisterPageTurn()
{
- m_controlList.push_back(Control(0, _T(""), AJ_TurnPage));
+ m_controlList.push_back(Control(0, wxT(""), AJ_TurnPage));
}
/**
fileMenu = new wxMenu();
wxMenuItem* m_menuSeeScr;
- m_menuSeeScr = new wxMenuItem( fileMenu, wxID_ZOOM_IN, wxString( _("&Open screenshots folder...") ) + _T('\t') + _T("Ctrl+O"), _("Opens the directory where the screenshots are saved."), wxITEM_NORMAL );
+ m_menuSeeScr = new wxMenuItem( fileMenu, wxID_ZOOM_IN, wxString( _("&Open screenshots folder...") ) + wxT('\t') + wxT("Ctrl+O"), _("Opens the directory where the screenshots are saved."), wxITEM_NORMAL );
fileMenu->Append( m_menuSeeScr );
fileMenu->AppendSeparator();
wxMenuItem* m_menuFileQuit;
- m_menuFileQuit = new wxMenuItem( fileMenu, wxID_EXIT, wxString( _("&Quit") ) + _T('\t') + _T("Alt+F4"), _("Quits the application."), wxITEM_NORMAL );
+ m_menuFileQuit = new wxMenuItem( fileMenu, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("Alt+F4"), _("Quits the application."), wxITEM_NORMAL );
fileMenu->Append( m_menuFileQuit );
mbar->Append( fileMenu, _("&File") );
captureMenu = new wxMenu();
wxMenuItem* m_menuCapFullScreen;
- m_menuCapFullScreen = new wxMenuItem( captureMenu, idMenuCapFullScreen, wxString( _("&Full Screen") ) + _T('\t') + _T("Ctrl+Alt+F"), _("Takes a screenshot of the entire screen."), wxITEM_NORMAL );
+ m_menuCapFullScreen = new wxMenuItem( captureMenu, idMenuCapFullScreen, wxString( _("&Full Screen") ) + wxT('\t') + wxT("Ctrl+Alt+F"), _("Takes a screenshot of the entire screen."), wxITEM_NORMAL );
captureMenu->Append( m_menuCapFullScreen );
wxMenuItem* m_menuCapAll;
- m_menuCapAll = new wxMenuItem( captureMenu, idMenuCapAll, wxString( _("Capture All") ) + _T('\t') + _T("Ctrl+Alt+A"), _("Takes screenshots for all controls automatically."), wxITEM_NORMAL );
+ m_menuCapAll = new wxMenuItem( captureMenu, idMenuCapAll, wxString( _("Capture All") ) + wxT('\t') + wxT("Ctrl+Alt+A"), _("Takes screenshots for all controls automatically."), wxITEM_NORMAL );
captureMenu->Append( m_menuCapAll );
mbar->Append( captureMenu, _("&Capture") );
//Help Menu
helpMenu = new wxMenu();
wxMenuItem* m_menuHelpAbout;
- m_menuHelpAbout = new wxMenuItem( helpMenu, wxID_ABOUT, wxString( _("&About...") ) + _T('\t') + _T("F1"), _("Shows info about this application."), wxITEM_NORMAL );
+ m_menuHelpAbout = new wxMenuItem( helpMenu, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("F1"), _("Shows info about this application."), wxITEM_NORMAL );
helpMenu->Append( m_menuHelpAbout );
mbar->Append( helpMenu, _("&Help") );
m_radioBtn2->SetToolTip( _("wxRadioButton") );
fgSizer1->Add( m_radioBtn2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
- m_bpButton1 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( _T("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
+ m_bpButton1 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( wxT("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
m_bpButton1->SetToolTip( _("wxBitmapButton") );
m_bpButton1->SetToolTip( _("wxBitmapButton") );
fgSizer1->Add( m_bpButton1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
- m_bitmap1 = new wxStaticBitmap( m_panel1, wxID_ANY, wxBitmap( _T("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 );
+ m_bitmap1 = new wxStaticBitmap( m_panel1, wxID_ANY, wxBitmap( wxT("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 );
m_bitmap1->SetToolTip( _("wxStaticBitmap") );
fgSizer1->Add( m_bitmap1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
- m_gauge1 = new wxGauge( m_panel1, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL, wxDefaultValidator, _T("_Gauge") );
+ m_gauge1 = new wxGauge( m_panel1, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL, wxDefaultValidator, wxT("_Gauge") );
m_gauge1->SetValue( 50 );
m_gauge1->SetToolTip( _("wxGauge") );
fgSizer1->Add( m_gauge1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 );
m_toggleBtn2->SetToolTip( _("wxToggleButton") );
fgSizer1->Add( m_toggleBtn2, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 );
- m_hyperlink1 = new wxHyperlinkCtrl( m_panel1, wxID_ANY, _("www.wxwidgets.org"), _T("http://www.wxwidgets.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
+ m_hyperlink1 = new wxHyperlinkCtrl( m_panel1, wxID_ANY, _("www.wxwidgets.org"), wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_hyperlink1->SetToolTip( _("wxHyperlinkCtrl") );
fgSizer1->Add( m_hyperlink1, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 );
- m_spinCtrl1 = new wxSpinCtrl( m_panel1, wxID_ANY, _T("5"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 );
+ m_spinCtrl1 = new wxSpinCtrl( m_panel1, wxID_ANY, wxT("5"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 );
m_spinCtrl1->SetToolTip( _("wxSpinCtrl") );
fgSizer1->Add( m_spinCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_animationCtrl1 = new wxAnimationCtrl(m_panel2, wxID_ANY);
m_animationCtrl1->SetToolTip(_("wxAnimationCtrl"));
- if (m_animationCtrl1->LoadFile(_T("bitmaps/throbber.gif")))
+ if (m_animationCtrl1->LoadFile(wxT("bitmaps/throbber.gif")))
m_animationCtrl1->Play();
fgSizer2->Add( m_animationCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
//wxCollapsiblePane 1
- m_collPane1 = new wxCollapsiblePane(m_panel2, -1, _T("Collapsed"));
+ m_collPane1 = new wxCollapsiblePane(m_panel2, -1, wxT("Collapsed"));
wxWindow *win = m_collPane1->GetPane();
m_collPane1->SetToolTip(_("wxCollapsiblePane"));
wxBoxSizer * collbSizer = new wxBoxSizer(wxVERTICAL);
- wxStaticText* m_collSText = new wxStaticText(win, -1, _T("You can place"));
- wxButton* m_collBut = new wxButton(win, -1, _T("anything"));
- wxTextCtrl* m_collText = new wxTextCtrl(win, -1, _T("inside a wxCollapsiblePane"));
+ wxStaticText* m_collSText = new wxStaticText(win, -1, wxT("You can place"));
+ wxButton* m_collBut = new wxButton(win, -1, wxT("anything"));
+ wxTextCtrl* m_collText = new wxTextCtrl(win, -1, wxT("inside a wxCollapsiblePane"));
collbSizer->Add( m_collSText, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
collbSizer->Add( m_collBut, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
collbSizer->Add( m_collText, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
fgSizer2->Add( m_collPane1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
//wxCollapsiblePane 2
- m_collPane2 = new wxCollapsiblePane(m_panel2, -1, _T("Expanded"));
+ m_collPane2 = new wxCollapsiblePane(m_panel2, -1, wxT("Expanded"));
wxWindow *win2 = m_collPane2->GetPane();
m_collPane2->SetToolTip(_("wxCollapsiblePane"));
wxBoxSizer * collbSizer2 = new wxBoxSizer(wxVERTICAL);
- wxStaticText* m_collSText2 = new wxStaticText(win2, -1, _T("You can place"));
- wxButton* m_collBut2 = new wxButton(win2, -1, _T("anything"));
- wxTextCtrl* m_collText2 = new wxTextCtrl(win2, -1, _T("inside a wxCollapsiblePane"));
+ wxStaticText* m_collSText2 = new wxStaticText(win2, -1, wxT("You can place"));
+ wxButton* m_collBut2 = new wxButton(win2, -1, wxT("anything"));
+ wxTextCtrl* m_collText2 = new wxTextCtrl(win2, -1, wxT("inside a wxCollapsiblePane"));
collbSizer2->Add( m_collSText2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
collbSizer2->Add( m_collBut2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
collbSizer2->Add( m_collText2, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
bSizer2->Add( m_textCtrl2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 20 );
m_richText1 = new wxRichTextCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0|wxVSCROLL|wxHSCROLL|wxNO_BORDER|wxWANTS_CHARS );
- m_richText1->LoadFile(_T("richtext.xml"));
+ m_richText1->LoadFile(wxT("richtext.xml"));
m_richText1->SetToolTip( _("wxRichTextCtrl") );
m_richText1->SetMinSize( wxSize( 200,200 ) );
bSizer2->Add( m_richText1, 0, wxALL, 20 );
m_fontPicker1->SetToolTip( _("wxFontPickerCtrl") );
fgSizer5->Add( m_fontPicker1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 20 );
- m_filePicker1 = new wxFilePickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a file"), _T("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE, wxDefaultValidator, _T("_FilePickerCtrl") );
+ m_filePicker1 = new wxFilePickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE, wxDefaultValidator, wxT("_FilePickerCtrl") );
#if defined(__WXMSW__)
const wxString a_file = "C:\\Windows\\explorer.exe";
#else
m_datePicker1->SetToolTip( _("wxDatePickerCtrl") );
fgSizer5->Add( m_datePicker1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
- m_genericDirCtrl1 = new wxGenericDirCtrl( m_panel4, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, wxEmptyString, 0, _T("_GenericDirCtrl") );
+ m_genericDirCtrl1 = new wxGenericDirCtrl( m_panel4, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, wxEmptyString, 0, wxT("_GenericDirCtrl") );
m_genericDirCtrl1->ShowHidden( false );
m_genericDirCtrl1->SetToolTip( _("wxGenericDirCtrl") );
m_genericDirCtrl1->SetMinSize( wxSize( -1,150 ) );
fgSizer5->Add( m_genericDirCtrl1, 1, wxEXPAND|wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
- m_dirPicker1 = new wxDirPickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE, wxDefaultValidator, _T("_DirPickerCtrl") );
+ m_dirPicker1 = new wxDirPickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE, wxDefaultValidator, wxT("_DirPickerCtrl") );
#if defined(__WXMSW__)
const wxString a_dir = "C:\\Windows";
#else
fgSizer4->Add( 0, 120, 1, wxEXPAND, 5 );
m_bmpComboBox1 = new wxBitmapComboBox(m_panel5, wxID_ANY,_("Item1"));
- m_bmpComboBox1->Append(_("Item1"), wxBitmap(_T("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
- m_bmpComboBox1->Append(_("Item2"), wxBitmap(_T("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
- m_bmpComboBox1->Append(_("Item3"), wxBitmap(_T("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
- m_bmpComboBox1->Append(_("Item4"), wxBitmap(_T("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
+ m_bmpComboBox1->Append(_("Item1"), wxBitmap(wxT("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
+ m_bmpComboBox1->Append(_("Item2"), wxBitmap(wxT("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
+ m_bmpComboBox1->Append(_("Item3"), wxBitmap(wxT("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
+ m_bmpComboBox1->Append(_("Item4"), wxBitmap(wxT("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->SetToolTip(_("wxBitmapComboBox"));
fgSizer4->Add( m_bmpComboBox1, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 20 );
m_comboCtrl1->SetPopupControl(popupList);
m_comboCtrl1->SetPopupMaxHeight(80);
- m_comboCtrl1->SetText(_T("wxComboCtrl"));
+ m_comboCtrl1->SetText(wxT("wxComboCtrl"));
m_comboCtrl1->SetToolTip(_("wxComboCtrl"));
// Populate using wxListView methods
- popupList->InsertItem(popupList->GetItemCount(),_T("wxComboCtrl"));
- popupList->InsertItem(popupList->GetItemCount(),_T("with"));
- popupList->InsertItem(popupList->GetItemCount(),_T("wxListView"));
- popupList->InsertItem(popupList->GetItemCount(),_T("popup"));
- popupList->InsertItem(popupList->GetItemCount(),_T("Item1"));
- popupList->InsertItem(popupList->GetItemCount(),_T("Item2"));
- popupList->InsertItem(popupList->GetItemCount(),_T("Item3"));
+ popupList->InsertItem(popupList->GetItemCount(),wxT("wxComboCtrl"));
+ popupList->InsertItem(popupList->GetItemCount(),wxT("with"));
+ popupList->InsertItem(popupList->GetItemCount(),wxT("wxListView"));
+ popupList->InsertItem(popupList->GetItemCount(),wxT("popup"));
+ popupList->InsertItem(popupList->GetItemCount(),wxT("Item1"));
+ popupList->InsertItem(popupList->GetItemCount(),wxT("Item2"));
+ popupList->InsertItem(popupList->GetItemCount(),wxT("Item3"));
popupList->Select(0, true);
fgSizer4->Add( m_comboCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 );
m_comboCtrl2->SetPopupControl(popupTree);
m_comboCtrl2->SetPopupMaxHeight(80);
- m_comboCtrl2->SetText(_T("wxComboCtrl"));
+ m_comboCtrl2->SetText(wxT("wxComboCtrl"));
m_comboCtrl2->SetToolTip(_("wxComboCtrl"));
//Add a root and some nodes using wxTreeCtrl methods
info.SetName(_("Automatic Screenshot Generator"));
info.SetVersion(_("1.0"));
info.SetDescription(_("This utility automatically creates screenshots of wxWidgets controls for use in wxWidgets documentation."));
- info.SetCopyright(_T("(C) 2008 Utensil Candel"));
+ info.SetCopyright(wxT("(C) 2008 Utensil Candel"));
wxAboutBox(info);
}
wxBitmap fullscreen(1, 1);
AutoCaptureMechanism::Capture(&fullscreen, 0, 0, screenWidth, screenHeight);
- AutoCaptureMechanism::Save(&fullscreen, _T("fullscreen"));
+ AutoCaptureMechanism::Save(&fullscreen, wxT("fullscreen"));
wxMessageBox(_("A screenshot of the entire screen was saved as:\n\n ")
- + AutoCaptureMechanism::GetDefaultDirectoryAbsPath() + _T("fullscreen.png"),
+ + AutoCaptureMechanism::GetDefaultDirectoryAbsPath() + wxT("fullscreen.png"),
_("Full screen capture"), wxICON_INFORMATION|wxOK, this);
}
case wxYES:
{
wxArrayString files;
- wxDir::GetAllFiles(dir, &files, _T("*.png"), wxDIR_FILES);
+ wxDir::GetAllFiles(dir, &files, wxT("*.png"), wxDIR_FILES);
// remove all PNG files from the screenshots folder
int n = files.GetCount();
auto_cap.RegisterControl(m_radioBtn2, AJ_UnionEnd);
auto_cap.RegisterControl(m_bpButton1);
auto_cap.RegisterControl(m_bitmap1);
- auto_cap.RegisterControl(m_gauge1, _T("wxGauge"));
+ auto_cap.RegisterControl(m_gauge1, wxT("wxGauge"));
auto_cap.RegisterControl(m_slider1);
auto_cap.RegisterControl(m_toggleBtn1, AJ_Union);
auto_cap.RegisterControl(m_toggleBtn2, AJ_UnionEnd);
- auto_cap.RegisterControl(m_hyperlink1, _T("wxHyperlinkCtrl"));
+ auto_cap.RegisterControl(m_hyperlink1, wxT("wxHyperlinkCtrl"));
auto_cap.RegisterControl(m_spinCtrl1, AJ_RegionAdjust);
auto_cap.RegisterControl(m_spinBtn1);
auto_cap.RegisterControl(m_scrollBar1);
auto_cap.RegisterControl(m_radioBox1);
auto_cap.RegisterControl(m_staticBox1);
auto_cap.RegisterControl(m_treeCtrl1);
- auto_cap.RegisterControl(m_listCtrl1, _T("wxListCtrl"));
+ auto_cap.RegisterControl(m_listCtrl1, wxT("wxListCtrl"));
auto_cap.RegisterControl(m_animationCtrl1);
- auto_cap.RegisterControl(m_collPane1, _T("wxCollapsiblePane"), AJ_Union);
+ auto_cap.RegisterControl(m_collPane1, wxT("wxCollapsiblePane"), AJ_Union);
auto_cap.RegisterControl(m_collPane2, AJ_UnionEnd);
auto_cap.RegisterPageTurn();
auto_cap.RegisterPageTurn();
- auto_cap.RegisterControl(m_colourPicker1, _T("wxColourPickerCtrl"));
- auto_cap.RegisterControl(m_fontPicker1, _T("wxFontPickerCtrl"));
- auto_cap.RegisterControl(m_filePicker1, _T("wxFilePickerCtrl"), AJ_RegionAdjust);
- auto_cap.RegisterControl(m_calendar1, _T("wxCalendarCtrl"), AJ_RegionAdjust);
- auto_cap.RegisterControl(m_datePicker1, _T("wxDatePickerCtrl"));
- auto_cap.RegisterControl(m_genericDirCtrl1, _T("wxGenericDirCtrl"));
- auto_cap.RegisterControl(m_dirPicker1, _T("wxDirPickerCtrl"), AJ_RegionAdjust);
+ auto_cap.RegisterControl(m_colourPicker1, wxT("wxColourPickerCtrl"));
+ auto_cap.RegisterControl(m_fontPicker1, wxT("wxFontPickerCtrl"));
+ auto_cap.RegisterControl(m_filePicker1, wxT("wxFilePickerCtrl"), AJ_RegionAdjust);
+ auto_cap.RegisterControl(m_calendar1, wxT("wxCalendarCtrl"), AJ_RegionAdjust);
+ auto_cap.RegisterControl(m_datePicker1, wxT("wxDatePickerCtrl"));
+ auto_cap.RegisterControl(m_genericDirCtrl1, wxT("wxGenericDirCtrl"));
+ auto_cap.RegisterControl(m_dirPicker1, wxT("wxDirPickerCtrl"), AJ_RegionAdjust);
auto_cap.RegisterPageTurn();
wxXmlNode* children;
while (node)
{
- if (node->GetName() == _T("object")
- && node->GetAttribute(_T("class"),&classValue)
- && node->GetAttribute(_T("name"),&nameValue))
+ if (node->GetName() == wxT("object")
+ && node->GetAttribute(wxT("class"),&classValue)
+ && node->GetAttribute(wxT("name"),&nameValue))
{
m_wdata.Add(XRCWidgetData(nameValue,classValue));
}
const wxXmlNode* node) :
m_className(className) , m_parentClassName(parentClassName)
{
- if ( className == _T("wxMenu") )
+ if ( className == wxT("wxMenu") )
{
- m_ancestorClassNames.insert(_T("wxMenu"));
- m_ancestorClassNames.insert(_T("wxMenuBar"));
+ m_ancestorClassNames.insert(wxT("wxMenu"));
+ m_ancestorClassNames.insert(wxT("wxMenuBar"));
}
- else if ( className == _T("wxMDIChildFrame") )
+ else if ( className == wxT("wxMDIChildFrame") )
{
- m_ancestorClassNames.insert(_T("wxMDIParentFrame"));
+ m_ancestorClassNames.insert(wxT("wxMDIParentFrame"));
}
- else if( className == _T("wxMenuBar") ||
- className == _T("wxStatusBar") ||
- className == _T("wxToolBar") )
+ else if( className == wxT("wxMenuBar") ||
+ className == wxT("wxStatusBar") ||
+ className == wxT("wxToolBar") )
{
- m_ancestorClassNames.insert(_T("wxFrame"));
+ m_ancestorClassNames.insert(wxT("wxFrame"));
}
else
{
- m_ancestorClassNames.insert(_T("wxWindow"));
+ m_ancestorClassNames.insert(wxT("wxWindow"));
}
BrowseXmlNode(node->GetChildren());
bool CanBeUsedWithXRCCTRL(const wxString& name)
{
- if (name == _T("tool") ||
- name == _T("data") ||
- name == _T("unknown") ||
- name == _T("notebookpage") ||
- name == _T("separator") ||
- name == _T("sizeritem") ||
- name == _T("wxMenu") ||
- name == _T("wxMenuBar") ||
- name == _T("wxMenuItem") ||
- name.EndsWith(_T("Sizer")) )
+ if (name == wxT("tool") ||
+ name == wxT("data") ||
+ name == wxT("unknown") ||
+ name == wxT("notebookpage") ||
+ name == wxT("separator") ||
+ name == wxT("sizeritem") ||
+ name == wxT("wxMenu") ||
+ name == wxT("wxMenuBar") ||
+ name == wxT("wxMenuItem") ||
+ name.EndsWith(wxT("Sizer")) )
{
return false;
}
void GenerateHeaderCode(wxFFile& file)
{
- file.Write(_T("class ") + m_className + _T(" : public ") + m_parentClassName
- + _T(" {\nprotected:\n"));
+ file.Write(wxT("class ") + m_className + wxT(" : public ") + m_parentClassName
+ + wxT(" {\nprotected:\n"));
size_t i;
for(i=0;i<m_wdata.GetCount();++i)
{
if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue;
if( w.GetName().Length() == 0 ) continue;
file.Write(
- _T(" ") + w.GetClass() + _T("* ") + w.GetName()
- + _T(";\n"));
+ wxT(" ") + w.GetClass() + wxT("* ") + w.GetName()
+ + wxT(";\n"));
}
- file.Write(_T("\nprivate:\n void InitWidgetsFromXRC(wxWindow *parent){\n")
- _T(" wxXmlResource::Get()->LoadObject(this,parent,_T(\"")
+ file.Write(wxT("\nprivate:\n void InitWidgetsFromXRC(wxWindow *parent){\n")
+ wxT(" wxXmlResource::Get()->LoadObject(this,parent,wxT(\"")
+ m_className
- + _T("\"), _T(\"")
+ + wxT("\"), wxT(\"")
+ m_parentClassName
- + _T("\"));\n"));
+ + wxT("\"));\n"));
for(i=0;i<m_wdata.GetCount();++i)
{
const XRCWidgetData& w = m_wdata.Item(i);
if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue;
if( w.GetName().Length() == 0 ) continue;
- file.Write( _T(" ")
+ file.Write( wxT(" ")
+ w.GetName()
- + _T(" = XRCCTRL(*this,\"")
+ + wxT(" = XRCCTRL(*this,\"")
+ w.GetName()
- + _T("\",")
+ + wxT("\",")
+ w.GetClass()
- + _T(");\n"));
+ + wxT(");\n"));
}
- file.Write(_T(" }\n"));
+ file.Write(wxT(" }\n"));
- file.Write( _T("public:\n"));
+ file.Write( wxT("public:\n"));
if ( m_ancestorClassNames.size() == 1 )
{
file.Write
(
m_className +
- _T("(") +
+ wxT("(") +
*m_ancestorClassNames.begin() +
- _T(" *parent=NULL){\n") +
- _T(" InitWidgetsFromXRC((wxWindow *)parent);\n")
- _T(" }\n")
- _T("};\n")
+ wxT(" *parent=NULL){\n") +
+ wxT(" InitWidgetsFromXRC((wxWindow *)parent);\n")
+ wxT(" }\n")
+ wxT("};\n")
);
}
else
{
- file.Write(m_className + _T("(){\n") +
- _T(" InitWidgetsFromXRC(NULL);\n")
- _T(" }\n")
- _T("};\n"));
+ file.Write(m_className + wxT("(){\n") +
+ wxT(" InitWidgetsFromXRC(NULL);\n")
+ wxT(" }\n")
+ wxT("};\n"));
for ( StringSet::const_iterator it = m_ancestorClassNames.begin();
it != m_ancestorClassNames.end();
++it )
{
- file.Write(m_className + _T("(") + *it + _T(" *parent){\n") +
- _T(" InitWidgetsFromXRC((wxWindow *)parent);\n")
- _T(" }\n")
- _T("};\n"));
+ file.Write(m_className + wxT("(") + *it + wxT(" *parent){\n") +
+ wxT(" InitWidgetsFromXRC((wxWindow *)parent);\n")
+ wxT(" }\n")
+ wxT("};\n"));
}
}
}
else
{
if (flagCPP)
- parOutput = _T("resource.cpp");
+ parOutput = wxT("resource.cpp");
else if (flagPython)
- parOutput = _T("resource.py");
+ parOutput = wxT("resource.py");
else
- parOutput = _T("resource.xrs");
+ parOutput = wxT("resource.xrs");
}
}
if (!parOutput.empty())
parOutput = fn.GetFullPath();
parOutputPath = wxPathOnly(parOutput);
}
- if (!parOutputPath) parOutputPath = _T(".");
+ if (!parOutputPath) parOutputPath = wxT(".");
if (!cmdline.Found("n", &parFuncname))
- parFuncname = _T("InitXmlResource");
+ parFuncname = wxT("InitXmlResource");
for (size_t i = 0; i < cmdline.GetParamCount(); i++)
{
wxString XmlResApp::GetInternalFileName(const wxString& name, const wxArrayString& flist)
{
wxString name2 = name;
- name2.Replace(_T(":"), _T("_"));
- name2.Replace(_T("/"), _T("_"));
- name2.Replace(_T("\\"), _T("_"));
- name2.Replace(_T("*"), _T("_"));
- name2.Replace(_T("?"), _T("_"));
+ name2.Replace(wxT(":"), wxT("_"));
+ name2.Replace(wxT("/"), wxT("_"));
+ name2.Replace(wxT("\\"), wxT("_"));
+ name2.Replace(wxT("*"), wxT("_"));
+ name2.Replace(wxT("?"), wxT("_"));
- wxString s = wxFileNameFromPath(parOutput) + _T("$") + name2;
+ wxString s = wxFileNameFromPath(parOutput) + wxT("$") + name2;
if (wxFileExists(s) && flist.Index(s) == wxNOT_FOUND)
{
for (int i = 0;; i++)
{
- s.Printf(wxFileNameFromPath(parOutput) + _T("$%03i-") + name2, i);
+ s.Printf(wxFileNameFromPath(parOutput) + wxT("$%03i-") + name2, i);
if (!wxFileExists(s) || flist.Index(s) != wxNOT_FOUND)
break;
}
for (size_t i = 0; i < parFiles.GetCount(); i++)
{
if (flagVerbose)
- wxPrintf(_T("processing ") + parFiles[i] + _T("...\n"));
+ wxPrintf(wxT("processing ") + parFiles[i] + wxT("...\n"));
wxXmlDocument doc;
if (!doc.Load(parFiles[i]))
{
- wxLogError(_T("Error parsing file ") + parFiles[i]);
+ wxLogError(wxT("Error parsing file ") + parFiles[i]);
retCode = 1;
continue;
}
wxXmlNode* node = (doc.GetRoot())->GetChildren();
wxString classValue,nameValue;
while(node){
- if(node->GetName() == _T("object")
- && node->GetAttribute(_T("class"),&classValue)
- && node->GetAttribute(_T("name"),&nameValue)){
+ if(node->GetName() == wxT("object")
+ && node->GetAttribute(wxT("class"),&classValue)
+ && node->GetAttribute(wxT("name"),&nameValue)){
aXRCWndClassData.Add(
XRCWndClassData(nameValue,classValue,node)
const wxString name = node->GetName();
// Any bitmaps (bitmap2 is used for disabled toolbar buttons):
- if ( name == _T("bitmap") || name == _T("bitmap2") )
+ if ( name == wxT("bitmap") || name == wxT("bitmap2") )
return true;
- if ( name == _T("icon") )
+ if ( name == wxT("icon") )
return true;
// wxBitmapButton:
wxXmlNode *parent = node->GetParent();
if (parent != NULL &&
- parent->GetAttribute(_T("class"), _T("")) == _T("wxBitmapButton") &&
- (name == _T("focus") ||
- name == _T("disabled") ||
- name == _T("hover") ||
- name == _T("selected")))
+ parent->GetAttribute(wxT("class"), wxT("")) == wxT("wxBitmapButton") &&
+ (name == wxT("focus") ||
+ name == wxT("disabled") ||
+ name == wxT("hover") ||
+ name == wxT("selected")))
return true;
// wxBitmap or wxIcon toplevel resources:
- if ( name == _T("object") )
+ if ( name == wxT("object") )
{
- wxString klass = node->GetAttribute(_T("class"), wxEmptyString);
- if (klass == _T("wxBitmap") ||
- klass == _T("wxIcon") ||
- klass == _T("data") )
+ wxString klass = node->GetAttribute(wxT("class"), wxEmptyString);
+ if (klass == wxT("wxBitmap") ||
+ klass == wxT("wxIcon") ||
+ klass == wxT("data") )
return true;
}
// URLs in wxHtmlWindow:
- if ( name == _T("url") &&
+ if ( name == wxT("url") &&
parent != NULL &&
- parent->GetAttribute(_T("class"), _T("")) == _T("wxHtmlWindow") )
+ parent->GetAttribute(wxT("class"), wxT("")) == wxT("wxHtmlWindow") )
{
// FIXME: this is wrong for e.g. http:// URLs
return true;
fullname = inputPath + wxFILE_SEP_PATH + n->GetContent();
if (flagVerbose)
- wxPrintf(_T("adding ") + fullname + _T("...\n"));
+ wxPrintf(wxT("adding ") + fullname + wxT("...\n"));
wxString filename = GetInternalFileName(n->GetContent(), flist);
n->SetContent(filename);
wxString files;
for (size_t i = 0; i < flist.GetCount(); i++)
- files += flist[i] + _T(" ");
+ files += flist[i] + wxT(" ");
files.RemoveLast();
if (flagVerbose)
- wxPrintf(_T("compressing ") + parOutput + _T("...\n"));
+ wxPrintf(wxT("compressing ") + parOutput + wxT("...\n"));
wxString cwd = wxGetCwd();
wxSetWorkingDirectory(parOutputPath);
- int execres = wxExecute(_T("zip -9 -j ") +
- wxString(flagVerbose ? _T("\"") : _T("-q \"")) +
- parOutput + _T("\" ") + files, true);
+ int execres = wxExecute(wxT("zip -9 -j ") +
+ wxString(flagVerbose ? wxT("\"") : wxT("-q \"")) +
+ parOutput + wxT("\" ") + files, true);
wxSetWorkingDirectory(cwd);
if (execres == -1)
{
- wxLogError(_T("Unable to execute zip program. Make sure it is in the path."));
- wxLogError(_T("You can download it at http://www.cdrom.com/pub/infozip/"));
+ wxLogError(wxT("Unable to execute zip program. Make sure it is in the path."));
+ wxLogError(wxT("You can download it at http://www.cdrom.com/pub/infozip/"));
retCode = 1;
return;
}
wxASSERT_MSG( static_cast<wxFileOffset>(lng) == offset,
wxT("Huge file not supported") );
- snum.Printf(_T("%i"), num);
- output.Printf(_T("static size_t xml_res_size_") + snum + _T(" = %i;\n"), lng);
- output += _T("static unsigned char xml_res_file_") + snum + _T("[] = {\n");
+ snum.Printf(wxT("%i"), num);
+ output.Printf(wxT("static size_t xml_res_size_") + snum + wxT(" = %i;\n"), lng);
+ output += wxT("static unsigned char xml_res_file_") + snum + wxT("[] = {\n");
// we cannot use string literals because MSVC is dumb wannabe compiler
// with arbitrary limitation to 2048 strings :(
for (size_t i = 0, linelng = 0; i < lng; i++)
{
- tmp.Printf(_T("%i"), buffer[i]);
- if (i != 0) output << _T(',');
+ tmp.Printf(wxT("%i"), buffer[i]);
+ if (i != 0) output << wxT(',');
if (linelng > 70)
{
linelng = 0;
- output << _T("\n");
+ output << wxT("\n");
}
output << tmp;
linelng += tmp.Length()+1;
delete[] buffer;
- output += _T("};\n\n");
+ output += wxT("};\n\n");
return output;
}
size_t i;
if (flagVerbose)
- wxPrintf(_T("creating C++ source file ") + parOutput + _T("...\n"));
+ wxPrintf(wxT("creating C++ source file ") + parOutput + wxT("...\n"));
file.Write(""
"//\n"
wxString mime;
wxString ext = wxFileName(flist[i]).GetExt();
- if ( ext.Lower() == _T("xrc") )
- mime = _T("text/xml");
+ if ( ext.Lower() == wxT("xrc") )
+ mime = wxT("text/xml");
#if wxUSE_MIMETYPE
else
{
#endif // wxUSE_MIMETYPE
s.Printf(" XRC_ADD_FILE(wxT(\"XRC_resource/" + flist[i] +
- "\"), xml_res_file_%i, xml_res_size_%i, _T(\"%s\"));\n",
+ "\"), xml_res_file_%i, xml_res_size_%i, wxT(\"%s\"));\n",
i, i, mime.c_str());
file.Write(s);
}
void XmlResApp::GenCPPHeader()
{
wxString fileSpec = ((parOutput.BeforeLast('.')).AfterLast('/')).AfterLast('\\');
- wxString heaFileName = fileSpec + _T(".h");
+ wxString heaFileName = fileSpec + wxT(".h");
wxFFile file(heaFileName, wxT("wt"));
file.Write(
wxASSERT_MSG( static_cast<wxFileOffset>(lng) == offset,
wxT("Huge file not supported") );
- snum.Printf(_T("%i"), num);
+ snum.Printf(wxT("%i"), num);
output = " xml_res_file_" + snum + " = '''\\\n";
unsigned char *buffer = new unsigned char[lng];
linelng = 0;
}
else if (c < 32 || c > 127 || c == '\'')
- tmp.Printf(_T("\\x%02x"), c);
+ tmp.Printf(wxT("\\x%02x"), c);
else if (c == '\\')
- tmp = _T("\\\\");
+ tmp = wxT("\\\\");
else
tmp = (wxChar)c;
if (linelng > 70)
{
linelng = 0;
- output << _T("\\\n");
+ output << wxT("\\\n");
}
output << tmp;
linelng += tmp.Length();
delete[] buffer;
- output += _T("'''\n\n");
+ output += wxT("'''\n\n");
return output;
}
size_t i;
if (flagVerbose)
- wxPrintf(_T("creating Python source file ") + parOutput + _T("...\n"));
+ wxPrintf(wxT("creating Python source file ") + parOutput + wxT("...\n"));
file.Write(
"#\n"
for (size_t i = 0; i < parFiles.GetCount(); i++)
{
if (flagVerbose)
- wxPrintf(_T("processing ") + parFiles[i] + _T("...\n"));
+ wxPrintf(wxT("processing ") + parFiles[i] + wxT("...\n"));
wxXmlDocument doc;
if (!doc.Load(parFiles[i]))
{
- wxLogError(_T("Error parsing file ") + parFiles[i]);
+ wxLogError(wxT("Error parsing file ") + parFiles[i]);
retCode = 1;
continue;
}
n->GetType() == wxXML_CDATA_SECTION_NODE) &&
// ...it is textnode...
(
- node/*not n!*/->GetName() == _T("label") ||
- (node/*not n!*/->GetName() == _T("value") &&
+ node/*not n!*/->GetName() == wxT("label") ||
+ (node/*not n!*/->GetName() == wxT("value") &&
!n->GetContent().IsNumber()) ||
- node/*not n!*/->GetName() == _T("help") ||
- node/*not n!*/->GetName() == _T("longhelp") ||
- node/*not n!*/->GetName() == _T("tooltip") ||
- node/*not n!*/->GetName() == _T("htmlcode") ||
- node/*not n!*/->GetName() == _T("title") ||
- node/*not n!*/->GetName() == _T("item")
+ node/*not n!*/->GetName() == wxT("help") ||
+ node/*not n!*/->GetName() == wxT("longhelp") ||
+ node/*not n!*/->GetName() == wxT("tooltip") ||
+ node/*not n!*/->GetName() == wxT("htmlcode") ||
+ node/*not n!*/->GetName() == wxT("title") ||
+ node/*not n!*/->GetName() == wxT("item")
))
// ...and known to contain translatable string
{
if (!flagGettext ||
- node->GetAttribute(_T("translate"), _T("1")) != _T("0"))
+ node->GetAttribute(wxT("translate"), wxT("1")) != wxT("0"))
{
arr.push_back
(