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:
parent
c9cc9a2f3e
commit
43b2d5e7c3
@ -368,7 +368,9 @@ inline RECT wxGetWindowRect(HWND hwnd)
|
||||
RECT rect;
|
||||
|
||||
if ( !::GetWindowRect(hwnd, &rect) )
|
||||
{
|
||||
wxLogLastError(_T("GetWindowRect"));
|
||||
}
|
||||
|
||||
return rect;
|
||||
}
|
||||
@ -378,7 +380,9 @@ inline RECT wxGetClientRect(HWND hwnd)
|
||||
RECT rect;
|
||||
|
||||
if ( !::GetClientRect(hwnd, &rect) )
|
||||
{
|
||||
wxLogLastError(_T("GetClientRect"));
|
||||
}
|
||||
|
||||
return rect;
|
||||
}
|
||||
@ -570,7 +574,9 @@ public:
|
||||
: m_hdc(hdc)
|
||||
{
|
||||
if ( !::SelectClipRgn(hdc, hrgn) )
|
||||
{
|
||||
wxLogLastError(_T("SelectClipRgn"));
|
||||
}
|
||||
}
|
||||
|
||||
~HDCClipper()
|
||||
@ -599,7 +605,9 @@ private:
|
||||
{
|
||||
m_modeOld = ::SetMapMode(hdc, mm);
|
||||
if ( !m_modeOld )
|
||||
{
|
||||
wxLogLastError(_T("SelectClipRgn"));
|
||||
}
|
||||
}
|
||||
|
||||
~HDCMapModeChanger()
|
||||
@ -634,7 +642,9 @@ public:
|
||||
{
|
||||
m_hGlobal = ::GlobalAlloc(flags, size);
|
||||
if ( !m_hGlobal )
|
||||
{
|
||||
wxLogLastError(_T("GlobalAlloc"));
|
||||
}
|
||||
}
|
||||
|
||||
GlobalPtr(size_t size, unsigned flags = GMEM_MOVEABLE)
|
||||
@ -645,7 +655,9 @@ public:
|
||||
~GlobalPtr()
|
||||
{
|
||||
if ( m_hGlobal && ::GlobalFree(m_hGlobal) )
|
||||
{
|
||||
wxLogLastError(_T("GlobalFree"));
|
||||
}
|
||||
}
|
||||
|
||||
// implicit conversion
|
||||
@ -681,7 +693,9 @@ public:
|
||||
// global scope operator with it (and neither with GlobalUnlock())
|
||||
m_ptr = GlobalLock(hGlobal);
|
||||
if ( !m_ptr )
|
||||
{
|
||||
wxLogLastError(_T("GlobalLock"));
|
||||
}
|
||||
}
|
||||
|
||||
// initialize the object, HGLOBAL must not be NULL
|
||||
|
@ -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))
|
||||
|
@ -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) )
|
||||
|
@ -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)
|
||||
|
@ -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 )
|
||||
|
@ -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))
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -541,7 +541,9 @@ void MyFrame::OnLboxSelect(wxCommandEvent& event)
|
||||
}
|
||||
|
||||
if ( !s.empty() )
|
||||
{
|
||||
wxLogMessage(_T("Selected items: %s"), s.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
|
@ -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);
|
||||
|
@ -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))
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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))
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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))
|
||||
|
@ -479,9 +479,13 @@ void wxSplitPath(wxArrayString& aParts, const wxString& path)
|
||||
else if ( strCurrent == wxT("..") ) {
|
||||
// go up one level
|
||||
if ( aParts.size() == 0 )
|
||||
{
|
||||
wxLogWarning(_("'%s' has extra '..', ignored."), path);
|
||||
}
|
||||
else
|
||||
{
|
||||
aParts.erase(aParts.end() - 1);
|
||||
}
|
||||
|
||||
strCurrent.Empty();
|
||||
}
|
||||
|
@ -450,14 +450,17 @@ bool wxFile::Eof() const
|
||||
iRc = wxEof(m_fd);
|
||||
#endif // Windows/Unix
|
||||
|
||||
if ( iRc == 1)
|
||||
{}
|
||||
else if ( iRc == 0 )
|
||||
if ( iRc == 0 )
|
||||
return false;
|
||||
else if ( iRc == wxInvalidOffset )
|
||||
|
||||
if ( iRc == wxInvalidOffset )
|
||||
{
|
||||
wxLogSysError(_("can't determine if the end of file is reached on descriptor %d"), m_fd);
|
||||
else
|
||||
}
|
||||
else if ( iRc != 1 )
|
||||
{
|
||||
wxFAIL_MSG(_T("invalid eof() return value."));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -180,11 +180,15 @@ public:
|
||||
if ( m_hFile == INVALID_HANDLE_VALUE )
|
||||
{
|
||||
if ( mode == Read )
|
||||
{
|
||||
wxLogSysError(_("Failed to open '%s' for reading"),
|
||||
filename.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogSysError(_("Failed to open '%s' for writing"),
|
||||
filename.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1222,7 +1222,9 @@ bool wxICOHandler::SaveFile(wxImage *image,
|
||||
if ( !cStream.Ok() )
|
||||
{
|
||||
if ( verbose )
|
||||
{
|
||||
wxLogError(_("ICO: Error writing the image file!"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // 0
|
||||
|
@ -1874,13 +1874,19 @@ size_t wxZipInputStream::OnSysRead(void *buffer, size_t size)
|
||||
m_lasterror = wxSTREAM_READ_ERROR;
|
||||
|
||||
if (m_entry.GetSize() != TellI())
|
||||
{
|
||||
wxLogError(_("reading zip stream (entry %s): bad length"),
|
||||
m_entry.GetName().c_str());
|
||||
}
|
||||
else if (m_crcAccumulator != m_entry.GetCrc())
|
||||
{
|
||||
wxLogError(_("reading zip stream (entry %s): bad crc"),
|
||||
m_entry.GetName().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_lasterror = wxSTREAM_EOF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,9 @@ wxMutex::wxMutex()
|
||||
wxMutex::~wxMutex()
|
||||
{
|
||||
if (m_locked)
|
||||
{
|
||||
wxLogDebug( "wxMutex warning: destroying a locked mutex (%d locks)", m_locked );
|
||||
}
|
||||
}
|
||||
|
||||
wxMutexError wxMutex::Lock()
|
||||
|
@ -66,7 +66,9 @@ wxMutex::wxMutex()
|
||||
wxMutex::~wxMutex()
|
||||
{
|
||||
if (m_locked > 0)
|
||||
{
|
||||
wxLogDebug( "wxMutex warning: freeing a locked mutex (%d locks)\n", m_locked );
|
||||
}
|
||||
delete p_internal;
|
||||
}
|
||||
|
||||
|
@ -1529,9 +1529,13 @@ void wxHtmlHelpWindow::OnToolbar(wxCommandEvent& event)
|
||||
if (m_Printer == NULL)
|
||||
m_Printer = new wxHtmlEasyPrinting(_("Help Printing"), this);
|
||||
if (!m_HtmlWin->GetOpenedPage())
|
||||
{
|
||||
wxLogWarning(_("Cannot print empty page."));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Printer->PrintFile(m_HtmlWin->GetOpenedPage());
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
@ -543,7 +543,9 @@ void wxWindowMGL::Init()
|
||||
if ( !g_winMng )
|
||||
{
|
||||
if ( !wxTheApp->SetDisplayMode(wxGetDefaultDisplayMode()) )
|
||||
{
|
||||
wxLogFatalError(_("Cannot initialize display."));
|
||||
}
|
||||
}
|
||||
|
||||
// mgl specific:
|
||||
|
@ -307,7 +307,9 @@ bool wxShell(const wxString& command /*=wxEmptyString*/)
|
||||
int result = system(command);
|
||||
|
||||
if (result == -1)
|
||||
{
|
||||
wxLogSysError(_("can't execute '%s'"), command.c_str());
|
||||
}
|
||||
|
||||
return result == 0;
|
||||
}
|
||||
@ -407,7 +409,9 @@ bool wxRedirectableFd::Reopen(const wxString& name, int flags)
|
||||
}
|
||||
|
||||
if (!result)
|
||||
{
|
||||
wxLogSysError(_("error opening '%s'"), name.c_str());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -466,7 +470,9 @@ long wxExecute(wxChar **argv, int flags, wxProcess *process)
|
||||
int result = spawnvp(mode, argv[0], argv);
|
||||
|
||||
if (result == -1)
|
||||
{
|
||||
wxLogSysError(_("can't execute '%s'"), argv[0]);
|
||||
}
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
if (redirect)
|
||||
|
@ -90,7 +90,9 @@ bool wxOpenClipboard()
|
||||
gs_wxClipboardIsOpen = ::OpenClipboard((HWND)win->GetHWND()) != 0;
|
||||
|
||||
if ( !gs_wxClipboardIsOpen )
|
||||
{
|
||||
wxLogSysError(_("Failed to open the clipboard."));
|
||||
}
|
||||
|
||||
return gs_wxClipboardIsOpen;
|
||||
}
|
||||
|
@ -152,7 +152,9 @@ int wxColourDialog::ShowModal()
|
||||
// occurred
|
||||
const DWORD err = CommDlgExtendedError();
|
||||
if ( err )
|
||||
{
|
||||
wxLogError(_("Colour selection dialog failed with error %0lx."), err);
|
||||
}
|
||||
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
@ -183,13 +183,17 @@ public:
|
||||
{
|
||||
m_modeOld = ::SetStretchBltMode(m_hdc, COLORONCOLOR);
|
||||
if ( !m_modeOld )
|
||||
{
|
||||
wxLogLastError(_T("SetStretchBltMode"));
|
||||
}
|
||||
}
|
||||
|
||||
~StretchBltModeChanger()
|
||||
{
|
||||
if ( !::SetStretchBltMode(m_hdc, m_modeOld) )
|
||||
{
|
||||
wxLogLastError(_T("SetStretchBltMode"));
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -340,7 +340,9 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst)
|
||||
static_cast<DEVMODE *>(lockDevMode.Get())
|
||||
);
|
||||
if ( !hDC )
|
||||
{
|
||||
wxLogLastError(_T("CreateDC(printer)"));
|
||||
}
|
||||
|
||||
return (WXHDC) hDC;
|
||||
#endif // PostScript/Windows printing
|
||||
|
@ -883,11 +883,15 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP,
|
||||
{
|
||||
// can't pass a wxWCharBuffer through ( ... )
|
||||
if ( async )
|
||||
{
|
||||
wxLogError(_("Failed to initiate dialup connection: %s"),
|
||||
GetErrorString(dwRet).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogError(_("Failed to establish dialup connection: %s"),
|
||||
GetErrorString(dwRet).c_str());
|
||||
}
|
||||
|
||||
// we should still call RasHangUp() if we got a non 0 connection
|
||||
if ( ms_hRasConnection )
|
||||
|
@ -94,8 +94,10 @@ void wxEnhMetaFile::Init()
|
||||
{
|
||||
m_hMF = (WXHANDLE)::GetEnhMetaFile(m_filename.fn_str());
|
||||
if ( !m_hMF )
|
||||
{
|
||||
wxLogSysError(_("Failed to load metafile from file \"%s\"."),
|
||||
m_filename.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,9 @@ wxGLContext::wxGLContext(wxGLCanvas *win, const wxGLContext* other)
|
||||
if ( other )
|
||||
{
|
||||
if ( !wglShareLists(other->m_glContext, m_glContext) )
|
||||
{
|
||||
wxLogLastError(_T("wglShareLists"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -350,7 +350,9 @@ bool wxIniConfig::DoWriteString(const wxString& szKey, const wxString& szValue)
|
||||
m_strLocalFilename.wx_str()) != 0;
|
||||
|
||||
if ( !bOk )
|
||||
{
|
||||
wxLogLastError(wxT("WritePrivateProfileString"));
|
||||
}
|
||||
|
||||
return bOk;
|
||||
}
|
||||
@ -405,7 +407,9 @@ bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso)
|
||||
NULL, m_strLocalFilename.wx_str()) != 0;
|
||||
|
||||
if ( !bOk )
|
||||
{
|
||||
wxLogLastError(wxT("WritePrivateProfileString"));
|
||||
}
|
||||
|
||||
return bOk;
|
||||
}
|
||||
@ -420,7 +424,9 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey)
|
||||
NULL, m_strLocalFilename.wx_str()) != 0;
|
||||
|
||||
if ( !bOk )
|
||||
{
|
||||
wxLogLastError(wxT("WritePrivateProfileString"));
|
||||
}
|
||||
|
||||
return bOk;
|
||||
}
|
||||
|
@ -362,7 +362,9 @@ void wxListBox::DoSetItemClientData(unsigned int n, void *clientData)
|
||||
wxT("invalid index in wxListBox::SetClientData") );
|
||||
|
||||
if ( ListBox_SetItemData(GetHwnd(), n, clientData) == LB_ERR )
|
||||
{
|
||||
wxLogDebug(wxT("LB_SETITEMDATA failed"));
|
||||
}
|
||||
}
|
||||
|
||||
// Return number of selections and an array of selected integers
|
||||
|
@ -1434,7 +1434,9 @@ void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow)
|
||||
{
|
||||
DWORD err = ::GetLastError();
|
||||
if ( err )
|
||||
{
|
||||
wxLogApiError(_T("SendMessage(WM_MDISETMENU)"), err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,9 @@ UINT GetMenuState(HMENU hMenu, UINT id, UINT flags)
|
||||
info.fMask = MIIM_STATE;
|
||||
// MF_BYCOMMAND is zero so test MF_BYPOSITION
|
||||
if ( !::GetMenuItemInfo(hMenu, id, flags & MF_BYPOSITION ? TRUE : FALSE , & info) )
|
||||
{
|
||||
wxLogLastError(wxT("GetMenuItemInfo"));
|
||||
}
|
||||
return info.fState;
|
||||
}
|
||||
#endif // __WXWINCE__
|
||||
@ -569,7 +571,9 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
||||
mi.fMask = MIM_STYLE;
|
||||
mi.dwStyle = MNS_CHECKORBMP;
|
||||
if ( !(*pfnSetMenuInfo)(GetHmenu(), &mi) )
|
||||
{
|
||||
wxLogLastError(_T("SetMenuInfo(MNS_NOCHECK)"));
|
||||
}
|
||||
}
|
||||
|
||||
// tell the item that it's not really owner-drawn but only
|
||||
@ -1446,9 +1450,13 @@ bool wxMenuBar::AddAdornments(long style)
|
||||
if (style & wxCLOSE_BOX)
|
||||
{
|
||||
if (!CommandBar_AddAdornments((HWND) m_commandBar, 0, 0))
|
||||
{
|
||||
wxLogLastError(wxT("CommandBar_AddAdornments"));
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -580,7 +580,9 @@ bool wxSpinCtrl::Reparent(wxWindowBase *newParent)
|
||||
// destroy the old spin button
|
||||
UnsubclassWin();
|
||||
if ( !::DestroyWindow(GetHwnd()) )
|
||||
{
|
||||
wxLogLastError(wxT("DestroyWindow"));
|
||||
}
|
||||
|
||||
// create and initialize the new one
|
||||
if ( !wxSpinButton::Create(GetParent(), GetId(),
|
||||
|
@ -183,7 +183,7 @@ void wxStatusBar::SetFieldsCount(int nFields, const int *widths)
|
||||
wxStatusBarBase::SetFieldsCount(nFields, widths);
|
||||
|
||||
SetFieldsWidth();
|
||||
|
||||
|
||||
// keep in synch also our m_tooltips array
|
||||
|
||||
// reset all current tooltips
|
||||
@ -236,7 +236,9 @@ void wxStatusBar::SetFieldsWidth()
|
||||
}
|
||||
|
||||
if ( !StatusBar_SetParts(GetHwnd(), m_panes.GetCount(), pWidths) )
|
||||
{
|
||||
wxLogLastError("StatusBar_SetParts");
|
||||
}
|
||||
|
||||
delete [] pWidths;
|
||||
|
||||
@ -309,22 +311,24 @@ void wxStatusBar::UpdateFieldText(int nField)
|
||||
}
|
||||
else
|
||||
{
|
||||
text = wxControl::Ellipsize(text,
|
||||
text = wxControl::Ellipsize(text,
|
||||
*m_pDC,
|
||||
ellmode,
|
||||
maxWidth,
|
||||
wxELLIPSIZE_EXPAND_TAB);
|
||||
|
||||
// update the ellipsization status for this pane; this is used later to
|
||||
// decide whether a tooltip should be shown or not for this pane
|
||||
|
||||
// update the ellipsization status for this pane; this is used later to
|
||||
// decide whether a tooltip should be shown or not for this pane
|
||||
// (if we have wxSTB_SHOW_TIPS)
|
||||
SetEllipsizedFlag(nField, text != GetStatusText(nField));
|
||||
}
|
||||
|
||||
// Set the status text in the native control passing both field number and style.
|
||||
// Set the status text in the native control passing both field number and style.
|
||||
// NOTE: MSDN library doesn't mention that nField and style have to be 'ORed'
|
||||
if ( !StatusBar_SetText(GetHwnd(), nField | style, text.wx_str()) )
|
||||
{
|
||||
wxLogLastError("StatusBar_SetText");
|
||||
}
|
||||
|
||||
if (HasFlag(wxSTB_SHOW_TIPS))
|
||||
{
|
||||
@ -388,7 +392,9 @@ bool wxStatusBar::GetFieldRect(int i, wxRect& rect) const
|
||||
|
||||
RECT r;
|
||||
if ( !::SendMessage(GetHwnd(), SB_GETRECT, i, (LPARAM)&r) )
|
||||
{
|
||||
wxLogLastError("SendMessage(SB_GETRECT)");
|
||||
}
|
||||
|
||||
#if wxUSE_UXTHEME
|
||||
wxUxThemeHandle theme(const_cast<wxStatusBar*>(this), L"Status");
|
||||
@ -514,11 +520,13 @@ void wxStatusBar::SetStatusStyles(int n, const int styles[])
|
||||
}
|
||||
|
||||
// The SB_SETTEXT message is both used to set the field's text as well as
|
||||
// the fields' styles.
|
||||
// the fields' styles.
|
||||
// NOTE: MSDN library doesn't mention that nField and style have to be 'ORed'
|
||||
wxString text = GetStatusText(i);
|
||||
if (!StatusBar_SetText(GetHwnd(), style | i, text.wx_str()))
|
||||
{
|
||||
wxLogLastError("StatusBar_SetText");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1600,7 +1600,9 @@ void wxToolBar::OnEraseBackground(wxEraseEvent& event)
|
||||
// it can also return S_FALSE which seems to simply say that it
|
||||
// didn't draw anything but no error really occurred
|
||||
if ( FAILED(hr) )
|
||||
{
|
||||
wxLogApiError(_T("DrawThemeParentBackground(toolbar)"), hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1623,7 +1625,9 @@ void wxToolBar::OnEraseBackground(wxEraseEvent& event)
|
||||
// it can also return S_FALSE which seems to simply say that it
|
||||
// didn't draw anything but no error really occurred
|
||||
if ( FAILED(hr) )
|
||||
{
|
||||
wxLogApiError(_T("DrawThemeParentBackground(toolbar)"), hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -923,7 +923,9 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler)
|
||||
|
||||
// close unneeded handle
|
||||
if ( !::CloseHandle(pi.hThread) )
|
||||
{
|
||||
wxLogLastError(wxT("CloseHandle(hThread)"));
|
||||
}
|
||||
|
||||
if ( !hThread )
|
||||
{
|
||||
|
@ -611,7 +611,9 @@ wxIcon wxFSVolume::GetIcon(wxFSIconType type) const
|
||||
long rc = SHGetFileInfo(m_volName.wx_str(), 0, &fi, sizeof(fi), flags);
|
||||
m_icons[type].SetHICON((WXHICON)fi.hIcon);
|
||||
if (!rc || !fi.hIcon)
|
||||
{
|
||||
wxLogError(_("Cannot load icon from '%s'."), m_volName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
return m_icons[type];
|
||||
|
@ -564,7 +564,9 @@ wxWindowMSW::~wxWindowMSW()
|
||||
//if (::IsWindow(GetHwnd()))
|
||||
{
|
||||
if ( !::DestroyWindow(GetHwnd()) )
|
||||
{
|
||||
wxLogLastError(wxT("DestroyWindow"));
|
||||
}
|
||||
}
|
||||
|
||||
// remove hWnd <-> wxWindow association
|
||||
@ -1258,7 +1260,9 @@ void wxWindowMSW::AssociateHandle(WXWidget handle)
|
||||
if ( m_hWnd )
|
||||
{
|
||||
if ( !::DestroyWindow(GetHwnd()) )
|
||||
{
|
||||
wxLogLastError(wxT("DestroyWindow"));
|
||||
}
|
||||
}
|
||||
|
||||
WXHWND wxhwnd = (WXHWND)handle;
|
||||
@ -4694,9 +4698,13 @@ bool wxWindowMSW::HandlePaint()
|
||||
{
|
||||
HRGN hRegion = ::CreateRectRgn(0, 0, 0, 0); // Dummy call to get a handle
|
||||
if ( !hRegion )
|
||||
{
|
||||
wxLogLastError(wxT("CreateRectRgn"));
|
||||
}
|
||||
if ( ::GetUpdateRgn(GetHwnd(), hRegion, FALSE) == ERROR )
|
||||
{
|
||||
wxLogLastError(wxT("GetUpdateRgn"));
|
||||
}
|
||||
|
||||
m_updateRegion = wxRegion((WXHRGN) hRegion);
|
||||
|
||||
|
@ -60,7 +60,9 @@ bool wxOpenClipboard()
|
||||
gs_wxClipboardIsOpen = ::OpenClipboard((HWND)win->GetHWND()) != 0;
|
||||
|
||||
if ( !gs_wxClipboardIsOpen )
|
||||
{
|
||||
wxLogSysError(_("Failed to open the clipboard."));
|
||||
}
|
||||
|
||||
return gs_wxClipboardIsOpen;
|
||||
}
|
||||
|
@ -372,7 +372,9 @@ bool wxIniConfig::Write(const wxString& szKey, const wxString& WXUNUSED(szValue)
|
||||
// szValue, m_strLocalFilename) != 0;
|
||||
|
||||
if ( !bOk )
|
||||
{
|
||||
wxLogLastError(wxT("WritePrivateProfileString"));
|
||||
}
|
||||
|
||||
return bOk;
|
||||
}
|
||||
@ -417,7 +419,9 @@ bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso)
|
||||
// NULL, m_strLocalFilename) != 0;
|
||||
|
||||
if ( !bOk )
|
||||
{
|
||||
wxLogLastError(wxT("WritePrivateProfileString"));
|
||||
}
|
||||
|
||||
return bOk;
|
||||
}
|
||||
@ -432,7 +436,9 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey)
|
||||
// NULL, m_strLocalFilename) != 0;
|
||||
|
||||
if ( !bOk )
|
||||
{
|
||||
wxLogLastError(wxT("WritePrivateProfileString"));
|
||||
}
|
||||
|
||||
return bOk;
|
||||
}
|
||||
|
@ -1097,7 +1097,9 @@ void wxMenuBar::Attach(
|
||||
,m_vAccelTable.GetHACCEL()
|
||||
,(HWND)pFrame->GetFrame()
|
||||
))
|
||||
{
|
||||
wxLogLastError(wxT("WinSetAccelTable"));
|
||||
}
|
||||
#endif // wxUSE_ACCEL
|
||||
} // end of wxMenuBar::Attach
|
||||
|
||||
|
@ -124,7 +124,9 @@ wxMutexInternal::~wxMutexInternal()
|
||||
if (m_vMutex)
|
||||
{
|
||||
if (::DosCloseMutexSem(m_vMutex))
|
||||
{
|
||||
wxLogLastError(_T("DosCloseMutexSem(mutex)"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,9 @@ void wxToolTip::Create(
|
||||
,NULL
|
||||
);
|
||||
if (!m_hWnd)
|
||||
{
|
||||
wxLogError(_T("Unable to create tooltip window"));
|
||||
}
|
||||
|
||||
wxColour vColor( wxT("YELLOW") );
|
||||
lColor = (LONG)vColor.GetPixel();
|
||||
|
@ -352,7 +352,9 @@ wxWindowOS2::~wxWindowOS2()
|
||||
if (m_hWnd)
|
||||
{
|
||||
if(!::WinDestroyWindow(GetHWND()))
|
||||
{
|
||||
wxLogLastError(wxT("DestroyWindow"));
|
||||
}
|
||||
//
|
||||
// remove hWnd <-> wxWindow association
|
||||
//
|
||||
|
@ -249,7 +249,9 @@ void wxMDIParentFrame::MacActivate(long timestamp, bool activating)
|
||||
else // schedule ourselves for deactivation
|
||||
{
|
||||
if (s_macDeactivateWindow)
|
||||
{
|
||||
wxLogTrace(TRACE_MDI, wxT("window=%p SHOULD have been deactivated, oh well!"), s_macDeactivateWindow);
|
||||
}
|
||||
wxLogTrace(TRACE_MDI, wxT("Scheduling delayed MDI Parent deactivation"));
|
||||
|
||||
s_macDeactivateWindow = this;
|
||||
@ -402,7 +404,9 @@ void wxMDIChildFrame::MacActivate(long timestamp, bool activating)
|
||||
else // schedule ourselves for deactivation
|
||||
{
|
||||
if (s_macDeactivateWindow)
|
||||
{
|
||||
wxLogTrace(TRACE_MDI, wxT("window=%p SHOULD have been deactivated, oh well!"), s_macDeactivateWindow);
|
||||
}
|
||||
wxLogTrace(TRACE_MDI, wxT("Scheduling delayed deactivation"));
|
||||
|
||||
s_macDeactivateWindow = this;
|
||||
|
@ -1404,7 +1404,9 @@ wxFileType* wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
|
||||
wxString sError;
|
||||
bInfoOpenSuccess = cfdInfo.ReadAsXML(cfdaInDict, &sError);
|
||||
if (!bInfoOpenSuccess)
|
||||
{
|
||||
wxLogDebug(sError);
|
||||
}
|
||||
indictfile.Close();
|
||||
}
|
||||
|
||||
@ -1752,7 +1754,9 @@ wxMimeTypesManagerImpl::Unassociate(wxFileType *pFileType)
|
||||
wxString sError;
|
||||
bInfoOpenSuccess = cfdInfo.ReadAsXML(cfdaInDict, &sError);
|
||||
if (!bInfoOpenSuccess)
|
||||
{
|
||||
wxLogDebug(sError);
|
||||
}
|
||||
indictfile.Close();
|
||||
}
|
||||
|
||||
@ -1853,7 +1857,9 @@ wxMimeTypesManagerImpl::Unassociate(wxFileType *pFileType)
|
||||
wxLogDebug(sPrintOut);
|
||||
|
||||
for (size_t i = 0; i < asExtensions.GetCount(); ++i)
|
||||
{
|
||||
wxLogDebug(asExtensions[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -235,7 +235,9 @@ inline bool wxInitQT ()
|
||||
int nError;
|
||||
//-2093 no dll
|
||||
if ((nError = InitializeQTML(0)) != noErr)
|
||||
{
|
||||
wxLogSysError(wxString::Format(wxT("Couldn't Initialize Quicktime-%i"), nError));
|
||||
}
|
||||
#endif
|
||||
EnterMovies();
|
||||
return true;
|
||||
|
@ -193,7 +193,9 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev)
|
||||
|
||||
//open the HID interface...
|
||||
if ( (*m_ppDevice)->open(m_ppDevice, 0) != S_OK )
|
||||
{
|
||||
wxLogDebug(_T("HID device: open failed"));
|
||||
}
|
||||
|
||||
//
|
||||
//Now the hard part - in order to scan things we need "cookies"
|
||||
@ -316,7 +318,9 @@ void wxHIDDevice::AddCookieInQueue(CFTypeRef Data, int i)
|
||||
//3rd Param flags (none yet)
|
||||
AddCookie(Data, i);
|
||||
if ( (*m_ppQueue)->addElement(m_ppQueue, m_pCookies[i], 0) != S_OK )
|
||||
{
|
||||
wxLogDebug(_T("HID device: adding element failed"));
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -2331,9 +2331,13 @@ wxPGProperty* wxPGProperty::GetItemAtY( unsigned int y,
|
||||
|
||||
/*
|
||||
if ( current )
|
||||
{
|
||||
wxLogDebug(wxT("%s::GetItemAtY(%i) -> %s"),this->GetLabel().c_str(),y,current->GetLabel().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogDebug(wxT("%s::GetItemAtY(%i) -> NULL"),this->GetLabel().c_str(),y);
|
||||
}
|
||||
*/
|
||||
|
||||
return (wxPGProperty*) result;
|
||||
|
@ -3245,10 +3245,14 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
|
||||
{
|
||||
/*
|
||||
if (p)
|
||||
{
|
||||
wxLogDebug(wxT("SelectProperty( %s (%s[%i]) )"),p->m_label.c_str(),
|
||||
p->m_parent->m_label.c_str(),p->GetIndexInParent());
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogDebug(wxT("SelectProperty( NULL, -1 )"));
|
||||
}
|
||||
*/
|
||||
|
||||
if ( m_inDoSelectProperty )
|
||||
|
@ -181,9 +181,13 @@ bool wxRichTextXMLHandler::ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node)
|
||||
|
||||
// note: 0 == wxBITMAP_TYPE_INVALID
|
||||
if (type <= 0 || type >= wxBITMAP_TYPE_MAX)
|
||||
{
|
||||
wxLogWarning("Invalid bitmap type specified for <image> tag: %d", type);
|
||||
}
|
||||
else
|
||||
{
|
||||
imageType = (wxBitmapType)type;
|
||||
}
|
||||
}
|
||||
|
||||
wxString data;
|
||||
|
@ -2456,7 +2456,9 @@ void wxMenuBar::OnDismissMenu(bool dismissMenuBar)
|
||||
void wxMenuBar::OnDismiss()
|
||||
{
|
||||
if ( ReleaseMouseCapture() )
|
||||
{
|
||||
wxLogTrace(_T("mousecapture"), _T("Releasing mouse from wxMenuBar::OnDismiss"));
|
||||
}
|
||||
|
||||
if ( m_current != -1 )
|
||||
{
|
||||
|
@ -690,7 +690,9 @@ PangoContext* wxApp::GetPangoContext()
|
||||
s_pangoContext = pango_x_get_context(dpy);
|
||||
|
||||
if (!PANGO_IS_CONTEXT(s_pangoContext))
|
||||
{
|
||||
wxLogError( wxT("No pango context.") );
|
||||
}
|
||||
}
|
||||
|
||||
return s_pangoContext;
|
||||
|
@ -522,7 +522,9 @@ void wxWindowX11::DoCaptureMouse()
|
||||
msg.Printf(wxT("Failed to grab pointer for window %s"), this->GetClassInfo()->GetClassName());
|
||||
wxLogDebug(msg);
|
||||
if (res == GrabNotViewable)
|
||||
{
|
||||
wxLogDebug( wxT("This is not a viewable window - perhaps not shown yet?") );
|
||||
}
|
||||
|
||||
g_captureWindow = NULL;
|
||||
return;
|
||||
|
@ -388,7 +388,9 @@ void TempDir::RemoveDir(wxString& path)
|
||||
wxRmdir(tmp + wxFileName(dirs[i], wxPATH_UNIX).GetFullPath());
|
||||
|
||||
if (!wxRmdir(m_tmp))
|
||||
{
|
||||
wxLogSysError(_T("can't remove temporary dir '%s'"), m_tmp.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -122,7 +122,7 @@ void LargeFileTest::runTest()
|
||||
// write a large file
|
||||
{
|
||||
auto_ptr<wxOutputStream> out(MakeOutStream(tmpfile.m_name));
|
||||
|
||||
|
||||
// write 'A's at [ 0x7fffffbf, 0x7fffffff [
|
||||
pos = 0x7fffffff - size;
|
||||
CPPUNIT_ASSERT(out->SeekO(pos) == pos);
|
||||
@ -317,7 +317,7 @@ CppUnit::Test *largeFile::suite()
|
||||
|
||||
#ifndef FSCTL_SET_SPARSE
|
||||
|
||||
# ifndef FILE_SPECIAL_ACCESS
|
||||
# ifndef FILE_SPECIAL_ACCESS
|
||||
# define FILE_SPECIAL_ACCESS FILE_ANY_ACCESS
|
||||
# endif
|
||||
# define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, \
|
||||
@ -332,7 +332,7 @@ void GetVolumeInfo(const wxString& path)
|
||||
{
|
||||
// extract the volume 'C:\' or '\\tooter\share\' from the path
|
||||
wxString vol;
|
||||
|
||||
|
||||
if (path.substr(1, 2) == _T(":\\")) {
|
||||
vol = path.substr(0, 3);
|
||||
} else {
|
||||
@ -353,10 +353,12 @@ void GetVolumeInfo(const wxString& path)
|
||||
: vol.c_str();
|
||||
|
||||
if (!::GetVolumeInformation(pVol, NULL, 0, NULL, NULL,
|
||||
&volumeFlags,
|
||||
&volumeFlags,
|
||||
volumeType,
|
||||
WXSIZEOF(volumeType)))
|
||||
{
|
||||
wxLogSysError(_T("GetVolumeInformation() failed"));
|
||||
}
|
||||
|
||||
volumeInfoInit = true;
|
||||
}
|
||||
@ -374,7 +376,7 @@ void MakeSparse(const wxString& path, int fd)
|
||||
|
||||
if (!volumeInfoInit)
|
||||
GetVolumeInfo(path);
|
||||
|
||||
|
||||
if ((volumeFlags & FILE_SUPPORTS_SPARSE_FILES) != 0)
|
||||
if (!::DeviceIoControl((HANDLE)_get_osfhandle(fd),
|
||||
FSCTL_SET_SPARSE,
|
||||
|
@ -400,16 +400,22 @@ void zlibStream::doDecompress_ExternalData(const unsigned char *data, const char
|
||||
break;
|
||||
case wxZLIB_ZLIB:
|
||||
if (!(data_size >= 1 && data[0] == 0x78))
|
||||
{
|
||||
wxLogError(_T("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!"));
|
||||
}
|
||||
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!"));
|
||||
}
|
||||
default:
|
||||
wxLogError(_T("Unknown flag, skipping quick test."));
|
||||
};
|
||||
|
@ -117,7 +117,9 @@ bool TestExec(const wxVector<wxFileName>& programs, long timeout)
|
||||
|
||||
long pid = wxExecute(programs[i].GetFullPath(), wxEXEC_ASYNC, &dt->process);
|
||||
if (pid == 0)
|
||||
{
|
||||
wxLogError("could not run the program '%s'", programs[i].GetFullPath());
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogMessage("started program '%s' (pid %d)...",
|
||||
|
@ -53,10 +53,10 @@ rhhcClient::rhhcClient( bool *isconn_a )
|
||||
|
||||
wxConnectionBase *rhhcClient::OnMakeConnection()
|
||||
{
|
||||
return new rhhcConnection( isconn_2 );
|
||||
return new rhhcConnection( isconn_2 );
|
||||
}
|
||||
|
||||
rhhcConnection::rhhcConnection( bool *isconn_a )
|
||||
rhhcConnection::rhhcConnection( bool *isconn_a )
|
||||
: wxConnection()
|
||||
{
|
||||
isconn_3 = isconn_a;
|
||||
@ -89,8 +89,8 @@ IMPLEMENT_CLASS(wxRemoteHtmlHelpController, wxHelpControllerBase)
|
||||
|
||||
wxRemoteHtmlHelpController::wxRemoteHtmlHelpController(int style )
|
||||
{
|
||||
m_style = style;
|
||||
m_connection = NULL;
|
||||
m_style = style;
|
||||
m_connection = NULL;
|
||||
m_client = NULL;
|
||||
m_pid = 0;
|
||||
isconn_1 = false;
|
||||
@ -113,7 +113,7 @@ wxRemoteHtmlHelpController::wxRemoteHtmlHelpController(int style )
|
||||
m_appname = wxT("./helpview");
|
||||
m_service = wxT("/tmp/") + thename + wxString(wxT("_helpservice"));
|
||||
#else
|
||||
m_appname = wxT("./helpview");
|
||||
m_appname = wxT("./helpview");
|
||||
m_service = wxT("4242");
|
||||
#endif
|
||||
|
||||
@ -154,7 +154,7 @@ wxRemoteHtmlHelpController::~wxRemoteHtmlHelpController()
|
||||
delete m_process;
|
||||
m_process = NULL;
|
||||
}
|
||||
if( m_client )
|
||||
if( m_client )
|
||||
delete m_client; //should be automatic?
|
||||
|
||||
}
|
||||
@ -179,7 +179,7 @@ bool wxRemoteHtmlHelpController::DoConnection()
|
||||
wxLogNull nolog;
|
||||
|
||||
//first try to connect assuming server is running
|
||||
if( !isconn_1 )
|
||||
if( !isconn_1 )
|
||||
m_connection = (rhhcConnection *)m_client->MakeConnection(hostName, m_service, wxT("HELP") );
|
||||
|
||||
//if not, start server
|
||||
@ -201,20 +201,20 @@ bool wxRemoteHtmlHelpController::DoConnection()
|
||||
}
|
||||
|
||||
while ( !isconn_1 )
|
||||
{
|
||||
{
|
||||
//try every second for a while, then leave it to user
|
||||
wxSleep(1);
|
||||
if( nsleep > 4 ) {
|
||||
if ( wxMessageBox( wxT("Failed to make connection to Help server.\nRetry?") ,
|
||||
wxT("wxRemoteHtmlHelpController Error"),
|
||||
wxICON_ERROR | wxYES_NO | wxCANCEL ) != wxYES )
|
||||
{
|
||||
{
|
||||
// no server
|
||||
return false;
|
||||
}
|
||||
}
|
||||
nsleep++;
|
||||
|
||||
|
||||
m_connection = (rhhcConnection *)m_client->MakeConnection(hostName, m_service, wxT("HELP") );
|
||||
}
|
||||
}
|
||||
@ -254,11 +254,11 @@ bool wxRemoteHtmlHelpController::Quit()
|
||||
default:
|
||||
wxFAIL_MSG( _T("unexpected return value") );
|
||||
// fall through
|
||||
|
||||
|
||||
case -1:
|
||||
// cancelled
|
||||
return false;
|
||||
|
||||
|
||||
case wxSIGNONE:
|
||||
case wxSIGHUP:
|
||||
case wxSIGINT:
|
||||
@ -282,9 +282,13 @@ bool wxRemoteHtmlHelpController::Quit()
|
||||
if ( sig == 0 )
|
||||
{
|
||||
if ( wxProcess::Exists(m_pid) )
|
||||
{
|
||||
wxLogStatus(_T("Process %ld is running."), m_pid);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogStatus(_T("No process with pid = %ld."), m_pid);
|
||||
}
|
||||
}
|
||||
else // not SIGNONE
|
||||
{
|
||||
@ -303,7 +307,7 @@ bool wxRemoteHtmlHelpController::Quit()
|
||||
_T("no such process"),
|
||||
_T("unspecified error"),
|
||||
};
|
||||
|
||||
|
||||
// sig = 3, 6, 9 or 12 all kill server with no apparent problem
|
||||
// but give error message on MSW - timout?
|
||||
//
|
||||
@ -321,8 +325,8 @@ void wxRemoteHtmlHelpController::Display(const wxString& helpfile)
|
||||
if( !isconn_1 ) {
|
||||
if( !DoConnection() ) return;
|
||||
}
|
||||
|
||||
if (!m_connection->Execute( helpfile, -1 ) )
|
||||
|
||||
if (!m_connection->Execute( helpfile, -1 ) )
|
||||
wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed"));
|
||||
|
||||
}
|
||||
@ -335,8 +339,8 @@ void wxRemoteHtmlHelpController::Display(const int id)
|
||||
|
||||
wxString intstring;
|
||||
intstring.Printf( "--intstring%d", id );
|
||||
|
||||
if (!m_connection->Execute( intstring, -1 ) )
|
||||
|
||||
if (!m_connection->Execute( intstring, -1 ) )
|
||||
wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed"));
|
||||
|
||||
}
|
||||
@ -349,7 +353,9 @@ bool wxRemoteHtmlHelpController::AddBook(const wxString& book, bool show_wait_ms
|
||||
|
||||
if( isconn_1 ) {
|
||||
if (!m_connection->Poke( wxT("--AddBook"), (char*)book.c_str() ) )
|
||||
{
|
||||
wxLogError(wxT("wxRemoteHtmlHelpController - AddBook Failed"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -370,7 +376,9 @@ void wxRemoteHtmlHelpController::DisplayIndex()
|
||||
{
|
||||
if( isconn_1 ) {
|
||||
if (!m_connection->Poke( wxT("--DisplayIndex"), wxT("") ) )
|
||||
{
|
||||
wxLogError(wxT("wxRemoteHtmlHelpController - DisplayIndex Failed"));
|
||||
}
|
||||
}
|
||||
}
|
||||
bool wxRemoteHtmlHelpController::KeywordSearch(const wxString& keyword)
|
||||
@ -391,7 +399,9 @@ void wxRemoteHtmlHelpController::SetTitleFormat(const wxString& format)
|
||||
|
||||
if( isconn_1 ) {
|
||||
if (!m_connection->Poke( wxT("--SetTitleFormat"), (char*)format.c_str() ) )
|
||||
{
|
||||
wxLogError(wxT("wxRemoteHtmlHelpController - SetTitleFormat Failed"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -399,7 +409,9 @@ void wxRemoteHtmlHelpController::SetTempDir(const wxString& path)
|
||||
{
|
||||
if( isconn_1 ) {
|
||||
if (!m_connection->Poke( wxT("--SetTempDir"), (char*)path.c_str() ) )
|
||||
{
|
||||
wxLogError(wxT("wxRemoteHtmlHelpController - SetTempDir Failed"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,9 @@ bool IfaceCheckApp::Compare()
|
||||
interfaces.GetCount());
|
||||
|
||||
if (!m_strToMatch.IsEmpty())
|
||||
{
|
||||
wxLogMessage("Processing only header files matching '%s' expression.", m_strToMatch);
|
||||
}
|
||||
|
||||
for (unsigned int i=0; i<interfaces.GetCount(); i++)
|
||||
{
|
||||
@ -224,8 +226,10 @@ bool IfaceCheckApp::Compare()
|
||||
(interfaces[i].GetAvailability() & m_gccInterface.GetInterfacePort()) == 0) {
|
||||
|
||||
if (g_verbose)
|
||||
{
|
||||
wxLogMessage("skipping class '%s' since it's not available for the %s port.",
|
||||
interfaces[i].GetName(), m_gccInterface.GetInterfacePortName());
|
||||
}
|
||||
|
||||
continue; // skip this method
|
||||
}
|
||||
@ -299,8 +303,10 @@ int IfaceCheckApp::CompareClasses(const wxClass* iface, const wxClass* api)
|
||||
(m.GetAvailability() & m_gccInterface.GetInterfacePort()) == 0) {
|
||||
|
||||
if (g_verbose)
|
||||
{
|
||||
wxLogMessage("skipping method '%s' since it's not available for the %s port.",
|
||||
m.GetAsString(), m_gccInterface.GetInterfacePortName());
|
||||
}
|
||||
|
||||
continue; // skip this method
|
||||
}
|
||||
@ -355,7 +361,9 @@ int IfaceCheckApp::CompareClasses(const wxClass* iface, const wxClass* api)
|
||||
|
||||
// modify interface header
|
||||
if (FixMethod(iface->GetHeader(), &m, &tmp))
|
||||
{
|
||||
wxLogMessage("Adjusted attributes of '%s' method", m.GetAsString());
|
||||
}
|
||||
|
||||
proceed = false;
|
||||
break;
|
||||
@ -397,7 +405,9 @@ int IfaceCheckApp::CompareClasses(const wxClass* iface, const wxClass* api)
|
||||
// TODO: decide which of these overloads is the most "similar" to m
|
||||
// and eventually modify it
|
||||
if (m_modify)
|
||||
{
|
||||
wxLogWarning("\tmanual fix is required");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -574,7 +584,9 @@ bool IfaceCheckApp::FixMethod(const wxString& header, const wxMethod* iface, con
|
||||
return false;
|
||||
|
||||
if (g_verbose)
|
||||
{
|
||||
wxLogMessage("\tthe final row offset for following methods is %d lines.", nOffset);
|
||||
}
|
||||
|
||||
// update the other method's locations for those methods which belong to the modified header
|
||||
// and are placed _below_ the modified method
|
||||
|
@ -234,8 +234,10 @@ bool wxArgumentType::operator==(const wxArgumentType& m) const
|
||||
(m.m_strDefaultValueForCmp.IsNumber() && m_strDefaultValueForCmp.StartsWith("wx")))
|
||||
{
|
||||
if (g_verbose)
|
||||
{
|
||||
wxLogMessage("Supposing '%s' default value to be the same of '%s'...",
|
||||
m_strDefaultValueForCmp, m.m_strDefaultValueForCmp);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -260,8 +262,10 @@ bool wxArgumentType::operator==(const wxArgumentType& m) const
|
||||
}
|
||||
|
||||
if (g_verbose)
|
||||
{
|
||||
wxLogMessage("Argument type '%s = %s' has different default value from '%s = %s'",
|
||||
m_strType, m_strDefaultValueForCmp, m.m_strType, m.m_strDefaultValueForCmp);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -330,14 +334,18 @@ bool wxMethod::MatchesExceptForAttributes(const wxMethod& m) const
|
||||
GetName() != m.GetName())
|
||||
{
|
||||
if (g_verbose)
|
||||
{
|
||||
wxLogMessage("The method '%s' does not match method '%s'; different names/rettype", GetName(), m.GetName());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_args.GetCount()!=m.m_args.GetCount()) {
|
||||
if (g_verbose)
|
||||
{
|
||||
wxLogMessage("Method '%s' has %d arguments while '%s' has %d arguments",
|
||||
m_strName, m_args.GetCount(), m_strName, m.m_args.GetCount());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -372,7 +380,9 @@ bool wxMethod::operator==(const wxMethod& m) const
|
||||
GetAccessSpecifier() != m.GetAccessSpecifier())
|
||||
{
|
||||
if (g_verbose)
|
||||
{
|
||||
wxLogMessage("The method '%s' does not match method '%s'; different attributes", GetName(), m.GetName());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -1009,8 +1019,10 @@ bool wxXmlGccInterface::Parse(const wxString& filename)
|
||||
// they're never used as return/argument types by wxWidgets methods
|
||||
|
||||
if (g_verbose)
|
||||
{
|
||||
wxLogWarning("Type node '%s' with ID '%s' does not have name attribute",
|
||||
n, child->GetAttribute("id"));
|
||||
}
|
||||
|
||||
types[id] = "TOFIX";
|
||||
}
|
||||
@ -1028,8 +1040,10 @@ bool wxXmlGccInterface::Parse(const wxString& filename)
|
||||
while (toResolveTypes.size()>0)
|
||||
{
|
||||
if (g_verbose)
|
||||
{
|
||||
wxLogMessage("%d types were collected; %d types need yet to be resolved...",
|
||||
types.size(), toResolveTypes.size());
|
||||
}
|
||||
|
||||
for (wxToResolveTypeHashMap::iterator i = toResolveTypes.begin();
|
||||
i != toResolveTypes.end();)
|
||||
@ -1468,7 +1482,9 @@ bool wxXmlDoxygenInterface::ParseCompoundDefinition(const wxString& filename)
|
||||
int nodes = 0;
|
||||
|
||||
if (g_verbose)
|
||||
{
|
||||
wxLogMessage("Parsing %s...", filename);
|
||||
}
|
||||
|
||||
if (!doc.Load(filename)) {
|
||||
wxLogError("can't load %s", filename);
|
||||
@ -1576,10 +1592,14 @@ bool wxXmlDoxygenInterface::ParseCompoundDefinition(const wxString& filename)
|
||||
|
||||
// add a new class
|
||||
if (klass.IsOk())
|
||||
{
|
||||
m_classes.Add(klass);
|
||||
}
|
||||
else if (g_verbose)
|
||||
{
|
||||
wxLogWarning("discarding class '%s' with %d methods...",
|
||||
klass.GetName(), klass.GetMethodCount());
|
||||
}
|
||||
}
|
||||
|
||||
child = child->GetNext();
|
||||
|
Loading…
Reference in New Issue
Block a user