本文整理汇总了C++中wxLogTrace函数的典型用法代码示例。如果您正苦于以下问题:C++ wxLogTrace函数的具体用法?C++ wxLogTrace怎么用?C++ wxLogTrace使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wxLogTrace函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxLogTrace
wxFontRefData::~wxFontRefData()
{
wxLogTrace("mgl_font", "destructing fntrefdata %p, library is %p", this, m_library);
if ( m_library )
m_library->DecRef();
}
示例2: wxLogTrace
S3D::SGTYPES S3D::ReadTag( std::istream& aFile, std::string& aName )
{
char schar;
aFile.get( schar );
if( '[' != schar )
{
#ifdef DEBUG
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * [INFO] corrupt data; missing left bracket at position ";
ostr << aFile.tellg();
wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
#endif
return S3D::SGTYPE_END;
}
std::string name;
aFile.get( schar );
while( ']' != schar && aFile.good() )
{
name.push_back( schar );
aFile.get( schar );
}
if( schar != ']' )
{
#ifdef DEBUG
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * [INFO] corrupt data; could not find right bracket";
wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
#endif
return S3D::SGTYPE_END;
}
aName = name;
size_t upos = name.find( '_' );
if( std::string::npos == upos )
{
#ifdef DEBUG
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * [INFO] corrupt data; no underscore in name '";
ostr << name << "'";
wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
#endif
return S3D::SGTYPE_END;
}
name = name.substr( 0, upos );
S3D::SGTYPES types[S3D::SGTYPE_END] = {
SGTYPE_TRANSFORM,
SGTYPE_APPEARANCE,
SGTYPE_COLORS,
SGTYPE_COLORINDEX,
SGTYPE_FACESET,
SGTYPE_COORDS,
SGTYPE_COORDINDEX,
SGTYPE_NORMALS,
SGTYPE_SHAPE
};
for( int i = 0; i < S3D::SGTYPE_END; ++i )
{
if( !name.compare( S3D::GetNodeTypeName( types[i] ) ) )
return types[i];
}
#ifdef DEBUG
do {
std::ostringstream ostr;
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
ostr << " * [INFO] corrupt data; no node type matching '";
ostr << name << "'";
wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
} while( 0 );
#endif
return S3D::SGTYPE_END;
}
示例3: wxLogTrace
void PNS_KICAD_IFACE::UpdateNet( int aNetCode )
{
wxLogTrace( "PNS", "Update-net %d", aNetCode );
}
示例4: CheckForAutoSaveFile
bool SCH_EDIT_FRAME::LoadOneEEFile( SCH_SCREEN* aScreen, const wxString& aFullFileName, bool append )
{
char name1[256];
bool itemLoaded = false;
SCH_ITEM* item;
wxString msgDiag; // Error and log messages
char* line;
wxFileName fn;
if( aScreen == NULL )
return false;
if( aFullFileName.IsEmpty() )
return false;
fn = aFullFileName;
CheckForAutoSaveFile( fn, SchematicBackupFileExtension );
wxLogTrace( traceAutoSave, wxT( "Loading schematic file " ) + aFullFileName );
aScreen->SetCurItem( NULL );
if( !append )
aScreen->SetFileName( aFullFileName );
wxString fname = Prj().AbsolutePath( aFullFileName );
#ifdef __WINDOWS__
fname.Replace( wxT("/"), wxT("\\") );
#else
fname.Replace( wxT("\\"), wxT("/") );
#endif
FILE* f = wxFopen( fname, wxT( "rt" ) );
if( !f )
{
msgDiag.Printf( _( "Failed to open '%s'" ), GetChars( aFullFileName ) );
DisplayError( this, msgDiag );
return false;
}
// reader now owns the open FILE.
FILE_LINE_READER reader( f, aFullFileName );
msgDiag.Printf( _( "Loading '%s'" ), GetChars( aScreen->GetFileName() ) );
PrintMsg( msgDiag );
if( !reader.ReadLine()
|| strncmp( (char*)reader + 9, SCHEMATIC_HEAD_STRING,
sizeof( SCHEMATIC_HEAD_STRING ) - 1 ) != 0 )
{
msgDiag.Printf( _( "'%s' is NOT an Eeschema file!" ), GetChars( aFullFileName ) );
DisplayError( this, msgDiag );
return false;
}
line = reader.Line();
// get the file version here.
char *strversion = line + 9 + sizeof( SCHEMATIC_HEAD_STRING );
// Skip blanks
while( *strversion && *strversion < '0' )
strversion++;
int version = atoi( strversion );
if( version > EESCHEMA_VERSION )
{
msgDiag.Printf( _(
"'%s' was created by a more recent version of Eeschema and may not"
" load correctly. Please consider updating!" ),
GetChars( aFullFileName )
);
DisplayInfoMessage( this, msgDiag );
}
#if 0
// Compile it if the new version is unreadable by previous Eeschema versions
else if( version < EESCHEMA_VERSION )
{
MsgDiag = aFullFileName + _( " was created by an older version of \
Eeschema. It will be stored in the new file format when you save this file \
again." );
DisplayInfoMessage( this, MsgDiag );
}
示例5: wxLogTrace
CWidgetUsage::~CWidgetUsage()
{
wxLogTrace(wxT("Function Start/End"), wxT("CWidgetUsage::~CWidgetUsage - Function Begin"));
wxLogTrace(wxT("Function Start/End"), wxT("CWidgetUsage::~CWidgetUsage - Function End"));
}
示例6: wxLogTrace
// once we get signaled to read, actuall event reading occurs
void wxFSWSourceHandler::OnReadWaiting()
{
wxLogTrace(wxTRACE_FSWATCHER, "--- OnReadWaiting ---");
m_service->ReadEvents();
}
示例7: wxLogTrace
// set data functions
STDMETHODIMP wxIDataObject::SetData(FORMATETC *pformatetc,
STGMEDIUM *pmedium,
BOOL fRelease)
{
wxLogTrace(wxTRACE_OleCalls, wxT("wxIDataObject::SetData"));
switch ( pmedium->tymed )
{
case TYMED_GDI:
m_pDataObject->SetData(wxDF_BITMAP, 0, &pmedium->hBitmap);
break;
case TYMED_ENHMF:
m_pDataObject->SetData(wxDF_ENHMETAFILE, 0, &pmedium->hEnhMetaFile);
break;
case TYMED_ISTREAM:
// check if this format is supported
if ( !m_pDataObject->IsSupported(pformatetc->cfFormat,
wxDataObject::Set) )
{
// As this is not a supported format (content data), assume it
// is system data and save it.
return SaveSystemData(pformatetc, pmedium, fRelease);
}
break;
case TYMED_MFPICT:
// fall through - we pass METAFILEPICT through HGLOBAL
case TYMED_HGLOBAL:
{
wxDataFormat format = pformatetc->cfFormat;
format = HtmlFormatFixup(format);
// check if this format is supported
if ( !m_pDataObject->IsSupported(format, wxDataObject::Set) ) {
// As above, assume that unsupported format must be system
// data and just save it.
return SaveSystemData(pformatetc, pmedium, fRelease);
}
// copy data
const void *pBuf = GlobalLock(pmedium->hGlobal);
if ( pBuf == NULL ) {
wxLogLastError(wxT("GlobalLock"));
return E_OUTOFMEMORY;
}
// we've got a problem with SetData() here because the base
// class version requires the size parameter which we don't
// have anywhere in OLE data transfer - so we need to
// synthetise it for known formats and we suppose that all data
// in custom formats starts with a DWORD containing the size
size_t size;
switch ( format )
{
case wxDF_HTML:
case CF_TEXT:
case CF_OEMTEXT:
size = strlen((const char *)pBuf);
break;
#if !(defined(__BORLANDC__) && (__BORLANDC__ < 0x500))
case CF_UNICODETEXT:
#if ( defined(__BORLANDC__) && (__BORLANDC__ > 0x530) )
size = std::wcslen((const wchar_t *)pBuf) * sizeof(wchar_t);
#else
size = wxWcslen((const wchar_t *)pBuf) * sizeof(wchar_t);
#endif
break;
#endif
case CF_BITMAP:
#ifndef __WXWINCE__
case CF_HDROP:
// these formats don't use size at all, anyhow (but
// pass data by handle, which is always a single DWORD)
size = 0;
break;
#endif
case CF_DIB:
// the handler will calculate size itself (it's too
// complicated to do it here)
size = 0;
break;
#ifndef __WXWINCE__
case CF_METAFILEPICT:
size = sizeof(METAFILEPICT);
break;
#endif
default:
pBuf = m_pDataObject->
GetSizeFromBuffer(pBuf, &size, format);
size -= m_pDataObject->GetBufferOffset(format);
}
bool ok = m_pDataObject->SetData(format, size, pBuf);
//.........这里部分代码省略.........
示例8: wxLogQueryInterface
WXDLLEXPORT void wxLogQueryInterface(const wxChar *szInterface, REFIID riid)
{
wxLogTrace(wxTRACE_OleCalls, wxT("%s::QueryInterface (iid = %s)"),
szInterface, GetIidName(riid).c_str());
}
示例9: wxLogAddRef
WXDLLEXPORT void wxLogAddRef(const wxChar *szInterface, ULONG cRef)
{
wxLogTrace(wxTRACE_OleCalls, wxT("After %s::AddRef: m_cRef = %d"), szInterface, cRef + 1);
}
示例10: getView
ITEM* TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int aLayer, bool aIgnorePads,
const std::vector<ITEM*> aAvoidItems)
{
int tl = getView()->GetTopLayer();
if( aLayer > 0 )
tl = aLayer;
static const int candidateCount = 5;
ITEM* prioritized[candidateCount];
int dist[candidateCount];
for( int i = 0; i < candidateCount; i++ )
{
prioritized[i] = 0;
dist[i] = std::numeric_limits<int>::max();
}
ITEM_SET candidates = m_router->QueryHoverItems( aWhere );
for( ITEM* item : candidates.Items() )
{
if( !item->IsRoutable() )
continue;
if( !IsCopperLayer( item->Layers().Start() ) )
continue;
if( std::find( aAvoidItems.begin(), aAvoidItems.end(), item ) != aAvoidItems.end() )
continue;
// fixme: this causes flicker with live loop removal...
//if( item->Parent() && !item->Parent()->ViewIsVisible() )
// continue;
if( aNet <= 0 || item->Net() == aNet )
{
if( item->OfKind( ITEM::VIA_T | ITEM::SOLID_T ) )
{
if( item->OfKind( ITEM::SOLID_T ) && aIgnorePads )
continue;
int itemDist = ( item->Shape()->Centre() - aWhere ).SquaredEuclideanNorm();
if( !prioritized[2] || itemDist < dist[2] )
{
prioritized[2] = item;
dist[2] = itemDist;
}
if( item->Layers().Overlaps( tl ) && itemDist < dist[0] )
{
prioritized[0] = item;
dist[0] = itemDist;
}
}
else
{
if( !prioritized[3] )
prioritized[3] = item;
if( item->Layers().Overlaps( tl ) )
prioritized[1] = item;
}
}
// Allow unconnected items as last resort in RM_MarkObstacles mode
else if ( item->Net() == 0 && m_router->Settings().Mode() == RM_MarkObstacles )
{
if( item->OfKind( ITEM::SOLID_T ) && aIgnorePads )
continue;
if( item->Layers().Overlaps( tl ) )
prioritized[4] = item;
}
}
ITEM* rv = NULL;
for( int i = 0; i < candidateCount; i++ )
{
ITEM* item = prioritized[i];
if( displayOptions()->m_ContrastModeDisplay )
if( item && !item->Layers().Overlaps( tl ) )
item = NULL;
if( item && ( aLayer < 0 || item->Layers().Overlaps( aLayer ) ) )
{
rv = item;
break;
}
}
if( rv )
{
wxLogTrace( "PNS", "%s, layer : %d, tl: %d", rv->KindStr().c_str(), rv->Layers().Start(), tl );
}
return rv;
}
示例11: wxLogTrace
bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) {
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCGUIApp::SetActiveGUI - Function Begin"));
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCGUIApp::SetActiveGUI - GUI Selection: '%d', Show: %d'"), iGUISelection, (int)bShowWindow);
CBOINCBaseFrame* pNewFrame = NULL;
CBOINCBaseFrame* pOldFrame = m_pFrame;
wxInt32 iTop = 0;
wxInt32 iLeft = 0;
wxInt32 iHeight = 0;
wxInt32 iWidth = 0;
// Create the new window
if ((iGUISelection != m_iGUISelected) || !m_pFrame) {
// Retrieve the desired window state before creating the
// desired frames
if (BOINC_ADVANCEDGUI == iGUISelection) {
m_pConfig->SetPath(wxT("/"));
m_pConfig->Read(wxT("YPos"), &iTop, 30);
m_pConfig->Read(wxT("XPos"), &iLeft, 30);
m_pConfig->Read(wxT("Width"), &iWidth, 800);
m_pConfig->Read(wxT("Height"), &iHeight, 600);
// Guard against a rare situation where registry values are zero
if (iWidth < 50) iWidth = 800;
if (iHeight < 50) iHeight = 600;
} else {
m_pConfig->SetPath(wxT("/Simple"));
m_pConfig->Read(wxT("YPos"), &iTop, 30);
m_pConfig->Read(wxT("XPos"), &iLeft, 30);
// We don't save Simple View's width & height since it's
// window is not resizable, so don't try to read them
#ifdef __WXMAC__
// m_pConfig->Read(wxT("Width"), &iWidth, 409);
// m_pConfig->Read(wxT("Height"), &iHeight, 561);
iWidth = 409;
iHeight = 561;
#else
// m_pConfig->Read(wxT("Width"), &iWidth, 416);
// m_pConfig->Read(wxT("Height"), &iHeight, 570);
iWidth = 416;
iHeight = 570;
#endif
}
// Make sure that the new window is going to be visible
// on a screen
#ifdef __WXMAC__
if (!IsWindowOnScreen(iLeft, iTop, iWidth, iHeight)) {
iTop = iLeft = 30;
}
#else
// If either co-ordinate is less then 0 then set it equal to 0 to ensure
// it displays on the screen.
if ( iLeft < 0 ) iLeft = 30;
if ( iTop < 0 ) iTop = 30;
// Read the size of the screen
wxInt32 iMaxWidth = wxSystemSettings::GetMetric( wxSYS_SCREEN_X );
wxInt32 iMaxHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );
// Max sure that it doesn't go off to the right or bottom
if ( iLeft + iWidth > iMaxWidth ) iLeft = iMaxWidth - iWidth;
if ( iTop + iHeight > iMaxHeight ) iTop = iMaxHeight - iHeight;
#endif
// Create the main window
//
if (BOINC_ADVANCEDGUI == iGUISelection) {
// Initialize the advanced gui window
pNewFrame = new CAdvancedFrame(
m_pSkinManager->GetAdvanced()->GetApplicationName(),
m_pSkinManager->GetAdvanced()->GetApplicationIcon(),
m_pSkinManager->GetAdvanced()->GetApplicationIcon32(),
wxPoint(iLeft, iTop),
wxSize(iWidth, iHeight)
);
} else {
// Initialize the simple gui window
pNewFrame = new CSimpleFrame(
m_pSkinManager->GetAdvanced()->GetApplicationName(),
m_pSkinManager->GetAdvanced()->GetApplicationIcon(),
m_pSkinManager->GetAdvanced()->GetApplicationIcon32(),
wxPoint(iLeft, iTop),
wxSize(iWidth, iHeight)
);
}
wxASSERT(pNewFrame);
if (pNewFrame) {
SetTopWindow(pNewFrame);
// Store the new frame for future use
m_pFrame = pNewFrame;
// Hide the old one if it exists. We must do this
// after updating m_pFrame to prevent Mac OSX from
//.........这里部分代码省略.........
示例12: wxSetFocusToChild
bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
{
wxCHECK_MSG( win, false, wxT("wxSetFocusToChild(): invalid window") );
// wxCHECK_MSG( childLastFocused, false,
// wxT("wxSetFocusToChild(): NULL child poonter") );
if ( childLastFocused && *childLastFocused )
{
// It might happen that the window got reparented
if ( (*childLastFocused)->GetParent() == win )
{
// And it also could have become hidden in the meanwhile
// We want to focus on the deepest widget visible
wxWindow *deepestVisibleWindow = NULL;
while ( *childLastFocused )
{
if ( (*childLastFocused)->IsShown() )
{
if ( !deepestVisibleWindow )
deepestVisibleWindow = *childLastFocused;
}
else
deepestVisibleWindow = NULL;
*childLastFocused = (*childLastFocused)->GetParent();
}
if ( deepestVisibleWindow )
{
*childLastFocused = deepestVisibleWindow;
wxLogTrace(TRACE_FOCUS,
wxT("SetFocusToChild() => last child (0x%p)."),
(*childLastFocused)->GetHandle());
// not SetFocusFromKbd(): we're restoring focus back to the old
// window and not setting it as the result of a kbd action
(*childLastFocused)->SetFocus();
return true;
}
}
else
{
// it doesn't count as such any more
*childLastFocused = NULL;
}
}
// set the focus to the first child who wants it
wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst();
while ( node )
{
wxWindow *child = node->GetData();
node = node->GetNext();
// skip special windows:
if ( !win->IsClientAreaChild(child) )
continue;
if ( child->CanAcceptFocusFromKeyboard() && !child->IsTopLevel() )
{
#if defined(__WXMSW__) && wxUSE_RADIOBTN
// If a radiobutton is the first focusable child, search for the
// selected radiobutton in the same group
wxRadioButton* btn = wxDynamicCast(child, wxRadioButton);
if (btn)
{
wxRadioButton* selected = wxGetSelectedButtonInGroup(btn);
if (selected)
child = selected;
}
#endif // __WXMSW__
wxLogTrace(TRACE_FOCUS,
wxT("SetFocusToChild() => first child (0x%p)."),
child->GetHandle());
if (childLastFocused)
*childLastFocused = child;
child->SetFocusFromKbd();
return true;
}
}
return false;
}
示例13: wxDateTime
//.........这里部分代码省略.........
if (BSLERR_SUCCESS != rc) return;
if (!pSyncProfile) return;
rc = m_pHost->FindRPCProfile(CLASSINFO(CRPCSyncState)->GetClassName(), &pRPCProfile);
if (BSLERR_SUCCESS != rc) return;
if (!pRPCProfile) return;
uiInterval = pSyncProfile->GetValue();
if (!uiInterval) return;
dtRPCCompletedDate = pRPCProfile->GetLastRequestTime() + pRPCProfile->GetTotalDuration();
rc = m_pHost->EnumerateProjects(oProjects);
if (BSLERR_SUCCESS != rc) return;
rc = m_pHost->EnumerateApps(oApps);
if (BSLERR_SUCCESS != rc) return;
rc = m_pHost->EnumerateAppVersions(oAppVersions);
if (BSLERR_SUCCESS != rc) return;
rc = m_pHost->EnumerateTasks(oTasks);
if (BSLERR_SUCCESS != rc) return;
rc = m_pHost->EnumerateTaskInstances(oTaskInstances);
if (BSLERR_SUCCESS != rc) return;
for (iterProjects = oProjects.begin(); iterProjects != oProjects.end(); ++iterProjects)
{
pProject = *iterProjects;
// An item is deemed expired if it wasn't refreshed the last time the synchronize
// RPC was called.
//
dtExpirationDate =
pProject->GetLastModifiedTime() +
wxTimeSpan(0, 0, uiInterval, 0) +
wxTimeSpan(0, 0, 0, 250);
if ((m_dtNow > dtExpirationDate) && (dtRPCCompletedDate > dtExpirationDate))
{
// Sanity Check: Make sure that no task instances refer to this project
bTaskInstanceFound = false;
for (iterTaskInstances = oTaskInstances.begin(); iterTaskInstances != oTaskInstances.end(); ++iterTaskInstances)
{
pTaskInstance = *iterTaskInstances;
if (pTaskInstance->GetProjectHandle() == pProject->GetProjectHandle())
{
bTaskInstanceFound = true;
}
}
// Sanity Check: Make sure that no tasks refer to this project
bTaskFound = false;
for (iterTasks = oTasks.begin(); iterTasks != oTasks.end(); ++iterTasks)
{
pTask = *iterTasks;
if (pTask->GetProjectHandle() == pProject->GetProjectHandle())
{
bTaskFound = true;
}
}
// Sanity Check: Make sure that no app versions refer to this project
bAppVersionFound = false;
for (iterAppVersions = oAppVersions.begin(); iterAppVersions != oAppVersions.end(); ++iterAppVersions)
{
pAppVersion = *iterAppVersions;
if (pAppVersion->GetProjectHandle() == pProject->GetProjectHandle())
{
bAppVersionFound = true;
}
}
// Sanity Check: Make sure that no apps refer to this project
bAppFound = false;
for (iterApps = oApps.begin(); iterApps != oApps.end(); ++iterApps)
{
pApp = *iterApps;
if (pApp->GetProjectHandle() == pProject->GetProjectHandle())
{
bAppFound = true;
}
}
if (!bTaskInstanceFound && !bTaskFound && !bAppVersionFound && !bAppFound)
{
wxLogTrace(wxT("Function Status"),
wxT("CGarbageCollector::RecycleProjects - Recycle '%p', dtNow: '%s', dtExpirationDate: '%s', dtRPCCompletedDate: '%s'"),
pApp,
m_dtNow.Format(wxT("%H:%M:%S.%l")).c_str(),
dtRPCCompletedDate.Format(wxT("%H:%M:%S.%l")).c_str(),
dtExpirationDate.Format(wxT("%H:%M:%S.%l")).c_str()
);
m_pHost->DeleteProject(pProject);
}
}
}
}
示例14: wxLogTrace
long wxTaskBarIconEx::WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wParam, long lParam )
{
wxLogTrace(wxT("Function Start/End"), wxT("wxTaskBarIconEx::WindowProc - Function Begin"));
wxEventType eventType = 0;
long lReturnValue = 0;
if ( WM_CLOSE == msg )
{
wxLogTrace(wxT("Function Status"), wxT("wxTaskBarIconEx::WindowProc - WM_CLOSE Detected"));
wxCloseEvent eventClose(wxEVT_CLOSE_WINDOW);
ProcessEvent(eventClose);
if ( !eventClose.GetSkipped() )
lReturnValue = DefWindowProc((HWND) hWnd, msg, wParam, lParam);
else
lReturnValue = 0;
}
else if ( WM_TASKBARCREATED == msg )
{
wxLogTrace(wxT("Function Status"), wxT("wxTaskBarIconEx::WindowProc - WM_TASKBARCREATED Detected"));
eventType = wxEVT_TASKBAR_CREATED;
}
else if ( WM_TASKBARSHUTDOWN == msg )
{
wxLogTrace(wxT("Function Status"), wxT("wxTaskBarIconEx::WindowProc - WM_TASKBARSHUTDOWN Detected"));
eventType = wxEVT_TASKBAR_SHUTDOWN;
}
if (msg != sm_taskbarMsg)
lReturnValue = DefWindowProc((HWND) hWnd, msg, wParam, lParam);
if ( 0 == eventType )
{
switch (lParam)
{
case WM_LBUTTONDOWN:
eventType = wxEVT_TASKBAR_LEFT_DOWN;
break;
case WM_LBUTTONUP:
eventType = wxEVT_TASKBAR_LEFT_UP;
break;
case WM_RBUTTONDOWN:
eventType = wxEVT_TASKBAR_RIGHT_DOWN;
break;
case WM_RBUTTONUP:
eventType = wxEVT_TASKBAR_RIGHT_UP;
break;
case WM_LBUTTONDBLCLK:
eventType = wxEVT_TASKBAR_LEFT_DCLICK;
break;
case WM_RBUTTONDBLCLK:
eventType = wxEVT_TASKBAR_RIGHT_DCLICK;
break;
case WM_MOUSEMOVE:
eventType = wxEVT_TASKBAR_MOVE;
break;
case WM_CONTEXTMENU:
eventType = wxEVT_TASKBAR_CONTEXT_MENU;
break;
case NIN_SELECT:
eventType = wxEVT_TASKBAR_SELECT;
break;
case NIN_KEYSELECT:
eventType = wxEVT_TASKBAR_KEY_SELECT;
break;
case NIN_BALLOONSHOW:
eventType = wxEVT_TASKBAR_BALLOON_SHOW;
break;
case NIN_BALLOONHIDE:
eventType = wxEVT_TASKBAR_BALLOON_HIDE;
break;
case NIN_BALLOONTIMEOUT:
eventType = wxEVT_TASKBAR_BALLOON_TIMEOUT;
break;
case NIN_BALLOONUSERCLICK:
eventType = wxEVT_TASKBAR_BALLOON_USERCLICK;
break;
}
}
if (eventType)
{
wxTaskBarIconExEvent event(eventType, this);
ProcessEvent(event);
lReturnValue = 0;
//.........这里部分代码省略.........
示例15: ProcessNativeEvent
void ProcessNativeEvent(const inotify_event& inevt)
{
wxLogTrace(wxTRACE_FSWATCHER, InotifyEventToString(inevt));
// after removing inotify watch we get IN_IGNORED for it, but the watch
// will be already removed from our list at that time
if (inevt.mask & IN_IGNORED)
{
return;
}
// get watch entry for this event
wxFSWatchEntryDescriptors::iterator it = m_watchMap.find(inevt.wd);
wxCHECK_RET(it != m_watchMap.end(),
"Watch descriptor not present in the watch map!");
wxFSWatchEntry& watch = *(it->second);
int nativeFlags = inevt.mask;
int flags = Native2WatcherFlags(nativeFlags);
// check out for error/warning condition
if (flags & wxFSW_EVENT_WARNING || flags & wxFSW_EVENT_ERROR)
{
wxString errMsg = GetErrorDescription(Watcher2NativeFlags(flags));
wxFileSystemWatcherEvent event(flags, errMsg);
SendEvent(event);
}
// filter out ignored events and those not asked for.
// we never filter out warnings or exceptions
else if ((flags == 0) || !(flags & watch.GetFlags()))
{
return;
}
// renames
else if (nativeFlags & IN_MOVE)
{
wxInotifyCookies::iterator it = m_cookies.find(inevt.cookie);
if ( it == m_cookies.end() )
{
int size = sizeof(inevt) + inevt.len;
inotify_event* e = (inotify_event*) operator new (size);
memcpy(e, &inevt, size);
wxInotifyCookies::value_type val(e->cookie, e);
m_cookies.insert(val);
}
else
{
inotify_event& oldinevt = *(it->second);
wxFileSystemWatcherEvent event(flags);
if ( inevt.mask & IN_MOVED_FROM )
{
event.SetPath(GetEventPath(watch, inevt));
event.SetNewPath(GetEventPath(watch, oldinevt));
}
else
{
event.SetPath(GetEventPath(watch, oldinevt));
event.SetNewPath(GetEventPath(watch, inevt));
}
SendEvent(event);
m_cookies.erase(it);
delete &oldinevt;
}
}
// every other kind of event
else
{
wxFileName path = GetEventPath(watch, inevt);
wxFileSystemWatcherEvent event(flags, path, path);
SendEvent(event);
}
}