Put braces around all calls to wxLogFunctions() inside an if statement.

This suppresses all the remaining g++ -Wparentheses warnings and uses consistent style everywhere.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-07-20 16:47:54 +00:00
parent c9cc9a2f3e
commit 43b2d5e7c3
79 changed files with 476 additions and 39 deletions

View File

@@ -182,7 +182,9 @@ MyFrame::~MyFrame()
void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event))
{
if (!m_animationCtrl->Play())
{
wxLogError(wxT("Invalid animation"));
}
}
void MyFrame::OnStop(wxCommandEvent& WXUNUSED(event))

View File

@@ -1042,9 +1042,13 @@ void MyFrame::OnComboBoxUpdate( wxCommandEvent& event )
return;
if ( event.GetEventType() == wxEVT_COMMAND_COMBOBOX_SELECTED )
{
wxLogDebug(wxT("EVT_COMBOBOX(id=%i,selection=%i)"),event.GetId(),event.GetSelection());
}
else if ( event.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED )
{
wxLogDebug(wxT("EVT_TEXT(id=%i,string=\"%s\")"),event.GetId(),event.GetString().c_str());
}
}
void MyFrame::OnShowComparison( wxCommandEvent& WXUNUSED(event) )

View File

@@ -1426,7 +1426,7 @@ void MyPanel::OnCombo( wxCommandEvent &event )
{
if (!m_combo)
return;
wxLogMessage(_T("EVT_COMBOBOX: item %d/%d (event/control), string \"%s\"/\"%s\""),
(int)event.GetInt(),
m_combo->GetSelection(),
@@ -1437,16 +1437,20 @@ void MyPanel::OnCombo( wxCommandEvent &event )
void MyPanel::OnComboTextChanged(wxCommandEvent& event)
{
if (m_combo)
{
wxLogMessage(wxT("EVT_TEXT for the combobox: \"%s\" (event) or \"%s\" (control)."),
event.GetString().c_str(),
m_combo->GetValue().c_str());
}
}
void MyPanel::OnComboTextEnter(wxCommandEvent& WXUNUSED(event))
{
if (m_combo)
{
wxLogMessage(_T("Enter pressed in the combobox: value is '%s'."),
m_combo->GetValue().c_str());
}
}
void MyPanel::OnComboButtons( wxCommandEvent &event )
@@ -2033,9 +2037,13 @@ void MyComboBox::OnChar(wxKeyEvent& event)
wxLogMessage(_T("MyComboBox::OnChar"));
if ( event.GetKeyCode() == 'w' )
{
wxLogMessage(_T("MyComboBox: 'w' will be ignored."));
}
else
{
event.Skip();
}
}
void MyComboBox::OnKeyDown(wxKeyEvent& event)
@@ -2043,9 +2051,13 @@ void MyComboBox::OnKeyDown(wxKeyEvent& event)
wxLogMessage(_T("MyComboBox::OnKeyDown"));
if ( event.GetKeyCode() == 'w' )
{
wxLogMessage(_T("MyComboBox: 'w' will be ignored."));
}
else
{
event.Skip();
}
}
void MyComboBox::OnKeyUp(wxKeyEvent& event)

View File

@@ -435,7 +435,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
mainSizer->Add( m_notebook, 1, wxGROW );
mainSizer->Add( m_log, 0, wxGROW );
SetSizerAndFit(mainSizer);
}
@@ -819,7 +819,9 @@ void MyFrame::OnActivated( wxDataViewEvent &event )
wxLogMessage( "wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, Item: %s", title );
if (m_ctrl[0]->IsExpanded( event.GetItem() ))
{
wxLogMessage( "Item: %s is expanded", title );
}
}
void MyFrame::OnSelectionChanged( wxDataViewEvent &event )
@@ -850,15 +852,15 @@ void MyFrame::OnStartEditing( wxDataViewEvent &event )
if (artist == "Ludwig van Beethoven")
{
event.Veto();
if (!m_log)
return;
wxLogMessage( "wxEVT_COMMAND_DATAVIEW_ITEM_START_EDITING vetoed. Artist: %s", artist );
}
else
wxLogMessage( "wxEVT_COMMAND_DATAVIEW_ITEM_START_EDITING not vetoed. Artist: %s", artist );
}
void MyFrame::OnEditingStarted( wxDataViewEvent &event )

View File

@@ -305,9 +305,13 @@ void MyFrame::OnDial(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnCheck(wxCommandEvent& WXUNUSED(event))
{
if(wxGetApp().GetDialer()->IsOnline())
{
wxLogMessage(wxT("Network is online."));
}
else
{
wxLogMessage(wxT("Network is offline."));
}
}
void MyFrame::OnEnumISPs(wxCommandEvent& WXUNUSED(event))

View File

@@ -627,9 +627,13 @@ void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event))
if ( sig == 0 )
{
if ( wxProcess::Exists(pid) )
{
wxLogStatus(_T("Process %ld is running."), pid);
}
else
{
wxLogStatus(_T("No process with pid = %ld."), pid);
}
}
else // not SIGNONE
{
@@ -965,7 +969,9 @@ void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event))
s_url = filename;
if ( !wxLaunchDefaultBrowser(s_url) )
{
wxLogError(_T("Failed to open URL \"%s\""), s_url.c_str());
}
}
// ----------------------------------------------------------------------------

View File

@@ -541,7 +541,9 @@ void MyFrame::OnLboxSelect(wxCommandEvent& event)
}
if ( !s.empty() )
{
wxLogMessage(_T("Selected items: %s"), s.c_str());
}
}
#if wxUSE_STATUSBAR

View File

@@ -82,7 +82,9 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
#if wxUSE_LIBPNG
if ( !image.SaveFile( dir + _T("test.png"), wxBITMAP_TYPE_PNG ))
{
wxLogError(wxT("Can't save file"));
}
image.Destroy();
@@ -92,14 +94,22 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.png")) )
{
wxLogError(wxT("Can't load PNG image"));
}
else
{
my_horse_png = wxBitmap( image );
}
if ( !image.LoadFile( dir + _T("toucan.png")) )
{
wxLogError(wxT("Can't load PNG image"));
}
else
{
my_toucan = wxBitmap(image);
}
my_toucan_flipped_horiz = wxBitmap(image.Mirror(true));
my_toucan_flipped_vert = wxBitmap(image.Mirror(false));
@@ -116,7 +126,9 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.jpg")) )
{
wxLogError(wxT("Can't load JPG image"));
}
else
{
my_horse_jpeg = wxBitmap( image );
@@ -129,87 +141,129 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
}
if ( !image.LoadFile( dir + _T("cmyk.jpg")) )
{
wxLogError(_T("Can't load CMYK JPG image"));
}
else
{
my_cmyk_jpeg = wxBitmap(image);
}
#endif // wxUSE_LIBJPEG
#if wxUSE_GIF
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.gif" )) )
{
wxLogError(wxT("Can't load GIF image"));
}
else
{
my_horse_gif = wxBitmap( image );
}
#endif
#if wxUSE_PCX
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.pcx"), wxBITMAP_TYPE_PCX ) )
{
wxLogError(wxT("Can't load PCX image"));
}
else
{
my_horse_pcx = wxBitmap( image );
}
#endif
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.bmp"), wxBITMAP_TYPE_BMP ) )
{
wxLogError(wxT("Can't load BMP image"));
}
else
{
my_horse_bmp = wxBitmap( image );
}
#if wxUSE_XPM
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.xpm"), wxBITMAP_TYPE_XPM ) )
{
wxLogError(wxT("Can't load XPM image"));
}
else
{
my_horse_xpm = wxBitmap( image );
}
if ( !image.SaveFile( dir + _T("test.xpm"), wxBITMAP_TYPE_XPM ))
{
wxLogError(wxT("Can't save file"));
}
#endif
#if wxUSE_PNM
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.pnm"), wxBITMAP_TYPE_PNM ) )
{
wxLogError(wxT("Can't load PNM image"));
}
else
{
my_horse_pnm = wxBitmap( image );
}
image.Destroy();
if ( !image.LoadFile( dir + _T("horse_ag.pnm"), wxBITMAP_TYPE_PNM ) )
{
wxLogError(wxT("Can't load PNM image"));
}
else
{
my_horse_asciigrey_pnm = wxBitmap( image );
}
image.Destroy();
if ( !image.LoadFile( dir + _T("horse_rg.pnm"), wxBITMAP_TYPE_PNM ) )
{
wxLogError(wxT("Can't load PNM image"));
}
else
{
my_horse_rawgrey_pnm = wxBitmap( image );
}
#endif
#if wxUSE_LIBTIFF
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.tif"), wxBITMAP_TYPE_TIF ) )
{
wxLogError(wxT("Can't load TIFF image"));
}
else
{
my_horse_tiff = wxBitmap( image );
}
#endif
#if wxUSE_LIBTIFF
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.tga"), wxBITMAP_TYPE_TGA ) )
{
wxLogError(wxT("Can't load TGA image"));
}
else
{
my_horse_tga = wxBitmap( image );
}
#endif
CreateAntiAliasedBitmap();
@@ -225,28 +279,42 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.ico"), wxBITMAP_TYPE_ICO, 0 ) )
{
wxLogError(wxT("Can't load first ICO image"));
}
else
{
my_horse_ico32 = wxBitmap( image );
}
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.ico"), wxBITMAP_TYPE_ICO, 1 ) )
{
wxLogError(wxT("Can't load second ICO image"));
}
else
{
my_horse_ico16 = wxBitmap( image );
}
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.ico") ) )
{
wxLogError(wxT("Can't load best ICO image"));
}
else
{
my_horse_ico = wxBitmap( image );
}
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.cur"), wxBITMAP_TYPE_CUR ) )
{
wxLogError(wxT("Can't load best ICO image"));
}
else
{
my_horse_cur = wxBitmap( image );
@@ -256,9 +324,13 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
m_ani_images = wxImage::GetImageCount ( dir + _T("horse3.ani"), wxBITMAP_TYPE_ANI );
if (m_ani_images==0)
{
wxLogError(wxT("No ANI-format images found"));
}
else
{
my_horse_ani = new wxBitmap [m_ani_images];
}
int i;
for (i=0; i < m_ani_images; i++)
@@ -286,14 +358,20 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
size_t dataSize = (size_t)len;
void *data = malloc(dataSize);
if ( file.Read(data, dataSize) != len )
{
wxLogError(_T("Reading bitmap file failed"));
}
else
{
wxMemoryInputStream mis(data, dataSize);
if ( !image.LoadFile(mis) )
{
wxLogError(wxT("Can't load BMP image from stream"));
}
else
{
my_horse_bmp2 = wxBitmap( image );
}
}
free(data);

View File

@@ -245,8 +245,10 @@ bool MyApp::OnInit()
// Initialize the catalogs we'll be using
const wxLanguageInfo* pInfo = wxLocale::GetLanguageInfo(m_lang);
if (!m_locale.AddCatalog("internat"))
{
wxLogError(_("Couldn't find/load the 'internat' catalog for locale '%s'."),
pInfo ? pInfo->GetLocaleName() : _("unknown"));
}
// Now try to add wxstd.mo so that loading "NOTEXIST.ING" file will produce
// a localized error message:
@@ -427,9 +429,13 @@ void MyFrame::OnTestLocaleAvail(wxCommandEvent& WXUNUSED(event))
}
if ( wxLocale::IsAvailable(info->Language) )
{
wxLogMessage(_("Locale \"%s\" is available."), s_locale.c_str());
}
else
{
wxLogWarning(_("Locale \"%s\" is not available."), s_locale.c_str());
}
}
void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))

View File

@@ -319,7 +319,9 @@ bool MyConnection::DoExecute(const void *data, size_t size, wxIPCFormat format)
Log("Execute", wxEmptyString, wxEmptyString, data, size, format);
bool retval = wxConnection::DoExecute(data, size, format);
if (!retval)
{
wxLogMessage("Execute failed!");
}
return retval;
}

View File

@@ -376,7 +376,9 @@ bool BenchConnection::OnPoke(const wxString& topic,
if ( m_advise )
{
if ( !Advise(item, m_item) )
{
wxLogMessage("Failed to advise client about the change.");
}
}
return true;

View File

@@ -434,7 +434,9 @@ bool MyConnection::DoExecute(const void *data, size_t size, wxIPCFormat format)
Log(_T("Execute"), wxEmptyString, wxEmptyString, data, size, format);
bool retval = wxConnection::DoExecute(data, size, format);
if (!retval)
{
wxLogMessage(_T("Execute failed!"));
}
return retval;
}

View File

@@ -731,7 +731,9 @@ void MyFrame::OnSetColOrder(wxCommandEvent& WXUNUSED(event))
order[1] = 0;
order[2] = 1;
if ( m_listCtrl->SetColumnsOrder(order) )
{
wxLogMessage("Column order set to %s", DumpIntArray(order));
}
}
void MyFrame::OnGetColOrder(wxCommandEvent& WXUNUSED(event))

View File

@@ -355,9 +355,13 @@ void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event))
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?"));
}
else
{
wxLogMessage(_T("You canceled printing"));
}
}
else
{

View File

@@ -59,10 +59,14 @@ void MyFrame::OnPropertyGridChange(wxPropertyGridEvent &event)
wxPGProperty* p = event.GetProperty();
if ( p )
{
wxLogVerbose("OnPropertyGridChange(%s, value=%s)",
p->GetName().c_str(), p->GetValueAsString().c_str());
}
else
{
wxLogVerbose("OnPropertyGridChange(NULL)");
}
}
void MyFrame::OnPropertyGridChanging(wxPropertyGridEvent &event)

View File

@@ -614,7 +614,9 @@ EventWorker::OnSocketEvent(wxSocketEvent& pEvent) {
//wxLogMessage(wxT("EventWorker: got connection"));
wxLogMessage(wxT("%s: starting writing message (2 bytes for signature and %d bytes of data to write)"),CreateIdent(m_localaddr).c_str(),m_outsize-2);
if (!m_clientSocket->GetLocal(m_localaddr))
{
wxLogError(_("Cannot get peer data for socket %p"),m_clientSocket);
}
m_currentType = WorkerEvent::SENDING;
wxLogDebug(wxT("%s: CONNECTING"),CreateIdent(m_localaddr).c_str());
SendEvent(false);

View File

@@ -618,7 +618,9 @@ void MyFrame::OnTestURL(wxCommandEvent& WXUNUSED(event))
// Get the data
wxStringOutputStream sout;
if ( data->Read(sout).GetLastError() != wxSTREAM_EOF )
{
wxLogError("Error reading the input stream.");
}
wxLogMessage("Text retrieved from URL \"%s\" follows:\n%s",
urlname, sout.GetString());

View File

@@ -220,10 +220,14 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, wxID_ANY,
IPaddress addrReal;
if ( !m_server->GetLocal(addrReal) )
{
wxLogMessage("ERROR: couldn't get the address we bound to");
}
else
{
wxLogMessage("Server listening at %s:%u",
addrReal.IPAddress(), addrReal.Service());
}
// Setup the event handler and subscribe to connection events
m_server->SetEventHandler(*this, SERVER_ID);
@@ -387,10 +391,14 @@ void MyFrame::OnServerEvent(wxSocketEvent& event)
{
IPaddress addr;
if ( !sock->GetPeer(addr) )
{
wxLogMessage("New connection from unknown client accepted.");
}
else
{
wxLogMessage("New client connection from %s:%u accepted",
addr.IPAddress(), addr.Service());
}
}
else
{

View File

@@ -100,9 +100,13 @@ private:
void DoNavigate(int flags)
{
if ( m_panel->NavigateIn(flags) )
{
wxLogStatus(this, _T("Navigation event processed"));
}
else
{
wxLogStatus(this, _T("Navigation event ignored"));
}
}
wxPanel *m_panel;

View File

@@ -223,25 +223,33 @@ public:
void OnScrollLineDown(wxCommandEvent& WXUNUSED(event))
{
if ( !m_panel->m_textrich->LineDown() )
{
wxLogMessage(_T("Already at the bottom"));
}
}
void OnScrollLineUp(wxCommandEvent& WXUNUSED(event))
{
if ( !m_panel->m_textrich->LineUp() )
{
wxLogMessage(_T("Already at the top"));
}
}
void OnScrollPageDown(wxCommandEvent& WXUNUSED(event))
{
if ( !m_panel->m_textrich->PageDown() )
{
wxLogMessage(_T("Already at the bottom"));
}
}
void OnScrollPageUp(wxCommandEvent& WXUNUSED(event))
{
if ( !m_panel->m_textrich->PageUp() )
{
wxLogMessage(_T("Already at the top"));
}
}
void OnGetLine(wxCommandEvent& WXUNUSED(event))
@@ -788,7 +796,9 @@ void MyTextCtrl::OnMouseEvent(wxMouseEvent& ev)
void MyTextCtrl::OnSetFocus(wxFocusEvent& event)
{
if ( ms_logFocus )
{
wxLogMessage( wxT("%p got focus."), this);
}
event.Skip();
}
@@ -796,7 +806,9 @@ void MyTextCtrl::OnSetFocus(wxFocusEvent& event)
void MyTextCtrl::OnKillFocus(wxFocusEvent& event)
{
if ( ms_logFocus )
{
wxLogMessage( wxT("%p lost focus"), this);
}
event.Skip();
}
@@ -1491,9 +1503,13 @@ void MyFrame::OnFileSave(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnFileLoad(wxCommandEvent& WXUNUSED(event))
{
if ( m_panel->m_textrich->LoadFile(_T("dummy.txt")) )
{
wxLogStatus(this, _T("Successfully loaded file"));
}
else
{
wxLogStatus(this, _T("Couldn't load the file"));
}
}
void MyFrame::OnRichTextTest(wxCommandEvent& WXUNUSED(event))

View File

@@ -802,10 +802,14 @@ void MyFrame::DoShowFirstOrLast(TreeFunc0_t pfn, const wxString& label)
const wxTreeItemId item = (m_treeCtrl->*pfn)();
if ( !item.IsOk() )
{
wxLogMessage("There is no %s item", label);
}
else
{
wxLogMessage("The %s item is \"%s\"",
label, m_treeCtrl->GetItemText(item));
}
}
void MyFrame::DoShowRelativeItem(TreeFunc1_t pfn, const wxString& label)
@@ -825,10 +829,14 @@ void MyFrame::DoShowRelativeItem(TreeFunc1_t pfn, const wxString& label)
wxTreeItemId new_item = (m_treeCtrl->*pfn)(item);
if ( !new_item.IsOk() )
{
wxLogMessage("There is no %s item", label);
}
else
{
wxLogMessage("The %s item is \"%s\"",
label, m_treeCtrl->GetItemText(new_item));
}
}
void MyFrame::OnScrollTo(wxCommandEvent& WXUNUSED(event))
@@ -1588,12 +1596,16 @@ void MyTreeCtrl::OnRMouseDClick(wxMouseEvent& event)
{
wxTreeItemId id = HitTest(event.GetPosition());
if ( !id )
{
wxLogMessage(wxT("No item under mouse"));
}
else
{
MyTreeItemData *item = (MyTreeItemData *)GetItemData(id);
if ( item )
{
wxLogMessage(wxT("Item '%s' under mouse"), item->GetDesc());
}
}
event.Skip();

View File

@@ -803,9 +803,13 @@ void BitmapComboBoxWidgetsPage::OnComboText(wxCommandEvent& event)
_T("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());
}
else
{
wxLogMessage(_T("BitmapCombobox text changed (now '%s')"), s.c_str());
}
}
void BitmapComboBoxWidgetsPage::OnComboBox(wxCommandEvent& event)

View File

@@ -618,9 +618,13 @@ void ComboboxWidgetsPage::OnComboText(wxCommandEvent& event)
_T("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());
}
else
{
wxLogMessage(_T("Combobox text changed (now '%s')"), s.c_str());
}
}
void ComboboxWidgetsPage::OnComboBox(wxCommandEvent& event)

View File

@@ -593,9 +593,13 @@ void ListboxWidgetsPage::OnListbox(wxCommandEvent& event)
m_textDelete->SetValue(wxString::Format(_T("%ld"), sel));
if (event.IsSelection())
{
wxLogMessage(_T("Listbox item %ld selected"), sel);
}
else
{
wxLogMessage(_T("Listbox item %ld deselected"), sel);
}
}
void ListboxWidgetsPage::OnListboxDClick(wxCommandEvent& event)

View File

@@ -761,9 +761,13 @@ void ODComboboxWidgetsPage::OnComboText(wxCommandEvent& event)
_T("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());
}
else
{
wxLogMessage(_T("OwnerDrawnCombobox text changed (now '%s')"), s.c_str());
}
}
void ODComboboxWidgetsPage::OnComboBox(wxCommandEvent& event)

View File

@@ -541,8 +541,12 @@ void StaticWidgetsPage::OnButtonLabelWithMarkupText(wxCommandEvent& WXUNUSED(eve
void StaticWidgetsPage::OnMouseEvent(wxMouseEvent& event)
{
if ( event.GetEventObject() == m_statText )
{
wxLogMessage("Clicked on static text");
}
else
{
wxLogMessage("Clicked on static box");
}
}

View File

@@ -904,9 +904,13 @@ void WidgetsFrame::OnDisableAutoComplete(wxCommandEvent& WXUNUSED(event))
wxCHECK_RET( entry, "menu item should be disabled" );
if ( entry->AutoComplete(wxArrayString()) )
{
wxLogMessage("Disabled auto completion.");
}
else
{
wxLogMessage("AutoComplete() failed.");
}
}
void WidgetsFrame::OnAutoCompleteFixed(wxCommandEvent& WXUNUSED(event))
@@ -926,9 +930,13 @@ void WidgetsFrame::OnAutoCompleteFixed(wxCommandEvent& WXUNUSED(event))
completion_choices.push_back("this string is for test");
if ( entry->AutoComplete(completion_choices) )
{
wxLogMessage("Enabled auto completion of a set of fixed strings.");
}
else
{
wxLogMessage("AutoComplete() failed.");
}
}
void WidgetsFrame::OnAutoCompleteFilenames(wxCommandEvent& WXUNUSED(event))
@@ -937,9 +945,13 @@ void WidgetsFrame::OnAutoCompleteFilenames(wxCommandEvent& WXUNUSED(event))
wxCHECK_RET( entry, "menu item should be disabled" );
if ( entry->AutoCompleteFileNames() )
{
wxLogMessage("Enable auto completion of file names.");
}
else
{
wxLogMessage("AutoCompleteFileNames() failed.");
}
}
void WidgetsFrame::OnSetHint(wxCommandEvent& WXUNUSED(event))
@@ -956,9 +968,13 @@ void WidgetsFrame::OnSetHint(wxCommandEvent& WXUNUSED(event))
s_hint = hint;
if ( entry->SetHint(hint) )
{
wxLogMessage("Set hint to \"%s\".", hint);
}
else
{
wxLogMessage("Text hints not supported.");
}
}
#endif // wxUSE_MENUS

View File

@@ -136,18 +136,26 @@ MyFrame::MyFrame(wxWindow* parent)
void MyFrame::OnUnloadResourceMenuCommand(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"));
}
else
{
wxLogWarning(_T("Failed to unload basic dialog resource"));
}
}
void MyFrame::OnReloadResourceMenuCommand(wxCommandEvent& WXUNUSED(event))
{
if ( wxXmlResource::Get()->Load(wxT("rc/basicdlg.xrc")) )
{
wxLogStatus(_T("Basic dialog resource has been loaded."));
}
else
{
wxLogError(_T("Failed to load basic dialog resource"));
}
}
void MyFrame::OnExitToolOrMenuCommand(wxCommandEvent& WXUNUSED(event))