本文整理汇总了C++中wxLogLastError函数的典型用法代码示例。如果您正苦于以下问题:C++ wxLogLastError函数的具体用法?C++ wxLogLastError怎么用?C++ wxLogLastError使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wxLogLastError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxLogLastError
// The wxWindow destructor will take care of deleting the submenus.
wxMenu::~wxMenu()
{
// we should free Windows resources only if Windows doesn't do it for us
// which happens if we're attached to a menubar or a submenu of another
// menu
if ( m_hMenu && !IsAttached() && !GetParent() )
{
if ( !::DestroyMenu(GetHmenu()) )
{
wxLogLastError(wxT("DestroyMenu"));
}
}
#if wxUSE_ACCEL
// delete accels
WX_CLEAR_ARRAY(m_accels);
#endif // wxUSE_ACCEL
delete m_radioData;
}
示例2: EnableMenuItem
void wxMenuItem::Enable(bool enable)
{
if ( m_isEnabled == enable )
return;
if ( m_parentMenu )
{
long rc = EnableMenuItem(GetHMenuOf(m_parentMenu),
GetMSWId(),
MF_BYCOMMAND |
(enable ? MF_ENABLED : MF_GRAYED));
if ( rc == -1 )
{
wxLogLastError(wxT("EnableMenuItem"));
}
}
wxMenuItemBase::Enable(enable);
}
示例3: wxMSWActivatePID
// This is used by wxProcess::Activate().
extern
bool wxMSWActivatePID(long pid)
{
wxFindByPidParams params;
params.pid = (DWORD)pid;
if ( ::EnumWindows(wxEnumFindByPidProc, (LPARAM)¶ms) != 0 )
{
// No windows corresponding to this PID were found.
return false;
}
if ( !::BringWindowToTop(params.hwnd) )
{
wxLogLastError(wxS("BringWindowToTop"));
return false;
}
return true;
}
示例4: GetSize
bool wxSpinCtrl::Reparent(wxWindowBase *newParent)
{
// Reparenting both the updown control and its buddy does not seem to work:
// they continue to be connected somehow, but visually there is no feedback
// on the buddy edit control. To avoid this problem, we reparent the buddy
// window normally, but we recreate the updown control and reassign its
// buddy.
if ( !wxWindowBase::Reparent(newParent) )
return false;
newParent->GetChildren().DeleteObject(this);
// preserve the old values
const wxSize size = GetSize();
int value = GetValue();
const wxRect btnRect = wxRectFromRECT(wxGetWindowRect(GetHwnd()));
// destroy the old spin button
UnsubclassWin();
if ( !::DestroyWindow(GetHwnd()) )
{
wxLogLastError(wxT("DestroyWindow"));
}
// create and initialize the new one
if ( !wxSpinButton::Create(GetParent(), GetId(),
btnRect.GetPosition(), btnRect.GetSize(),
GetWindowStyle(), GetName()) )
return false;
SetValue(value);
SetRange(m_min, m_max);
SetInitialSize(size);
// associate it with the buddy control again
::SetParent(GetBuddyHwnd(), GetHwndOf(GetParent()));
(void)::SendMessage(GetHwnd(), UDM_SETBUDDY, (WPARAM)GetBuddyHwnd(), 0);
return true;
}
示例5: wglCreateContext
wxGLContext::wxGLContext(wxGLCanvas *win, const wxGLContext* other)
{
if ( s_wglContextAttribs[0] == 0 ) // create legacy context
{
m_glContext = wglCreateContext(win->GetHDC());
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGL context") );
}
else // create a context using attributes
{
// We need to create a temporary context to get the
// wglCreateContextAttribsARB function
HGLRC tempContext = wglCreateContext(win->GetHDC());
wxCHECK_RET( tempContext, wxT("Couldn't create OpenGL context") );
wglMakeCurrent(win->GetHDC(), tempContext);
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB
= (PFNWGLCREATECONTEXTATTRIBSARBPROC)
wglGetProcAddress("wglCreateContextAttribsARB");
wglMakeCurrent(win->GetHDC(), NULL);
wglDeleteContext(tempContext);
if ( !wglCreateContextAttribsARB )
{
wxLogError(_("Core OpenGL profile is not supported by the OpenGL driver."));
return;
}
m_glContext = wglCreateContextAttribsARB(
win->GetHDC(), 0, s_wglContextAttribs);
wxCHECK_RET( m_glContext,
wxT("Couldn't create core profile OpenGL context") );
}
if ( other )
{
if ( !wglShareLists(other->m_glContext, m_glContext) )
{
wxLogLastError(wxT("wglShareLists"));
}
}
}
示例6: wxPMTextToLabel
wxMenu* wxMenuBar::Replace(
size_t nPos
, wxMenu* pMenu
, const wxString& rTitle
)
{
SHORT nId;
wxString sTitle = wxPMTextToLabel(rTitle);
wxMenu* pMenuOld = wxMenuBarBase::Replace( nPos
,pMenu
,sTitle
);
nId = SHORT1FROMMR(::WinSendMsg((HWND)m_hMenu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(nPos), (MPARAM)0));
if (nId == MIT_ERROR)
{
wxLogLastError(wxT("LogLastError"));
return NULL;
}
if (!pMenuOld)
return NULL;
m_titles[nPos] = sTitle;
if (IsAttached())
{
::WinSendMsg((HWND)m_hMenu, MM_REMOVEITEM, MPFROM2SHORT(nId, TRUE), (MPARAM)0);
::WinSendMsg((HWND)m_hMenu, MM_INSERTITEM, (MPARAM)&pMenu->m_vMenuData, (MPARAM)sTitle.wx_str());
#if wxUSE_ACCEL
if (pMenuOld->HasAccels() || pMenu->HasAccels())
{
//
// Need to rebuild accell table
//
RebuildAccelTable();
}
#endif // wxUSE_ACCEL
Refresh();
}
return pMenuOld;
} // end of wxMenuBar::Replace
示例7: wxASSERT_MSG
void wxMemoryDC::SelectObject(const wxBitmap& bitmap)
{
// select old bitmap out of the device context
if ( m_oldBitmap )
{
::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap);
if ( m_selectedBitmap.Ok() )
{
#ifdef __WXDEBUG__
m_selectedBitmap.SetSelectedInto(NULL);
#endif
m_selectedBitmap = wxNullBitmap;
}
}
// check for whether the bitmap is already selected into a device context
wxASSERT_MSG( !bitmap.GetSelectedInto() ||
(bitmap.GetSelectedInto() == this),
wxT("Bitmap is selected in another wxMemoryDC, delete the first wxMemoryDC or use SelectObject(NULL)") );
m_selectedBitmap = bitmap;
WXHBITMAP hBmp = m_selectedBitmap.GetHBITMAP();
if ( !hBmp )
return;
#ifdef __WXDEBUG__
m_selectedBitmap.SetSelectedInto(this);
#endif
hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp);
if ( !hBmp )
{
wxLogLastError(wxT("SelectObject(memDC, bitmap)"));
wxFAIL_MSG(wxT("Couldn't select a bitmap into wxMemoryDC"));
}
else if ( !m_oldBitmap )
{
m_oldBitmap = hBmp;
}
}
示例8: MSGetMenuItemPos
void wxMenuItem::Enable(bool enable)
{
if ( m_isEnabled == enable )
return;
const int itemPos = MSGetMenuItemPos();
if ( itemPos != -1 )
{
long rc = EnableMenuItem(GetHMenuOf(m_parentMenu),
itemPos,
MF_BYPOSITION |
(enable ? MF_ENABLED : MF_GRAYED));
if ( rc == -1 )
{
wxLogLastError(wxT("EnableMenuItem"));
}
}
wxMenuItemBase::Enable(enable);
}
示例9: GetHwnd
WXHBRUSH wxNotebook::MSWGetBgBrushForChild(WXHDC hDC, wxWindow *child)
{
if ( m_hbrBackground )
{
// before drawing with the background brush, we need to position it
// correctly
RECT rc;
::GetWindowRect(GetHwndOf(child), &rc);
::MapWindowPoints(NULL, GetHwnd(), (POINT *)&rc, 1);
if ( !::SetBrushOrgEx((HDC)hDC, -rc.left, -rc.top, NULL) )
{
wxLogLastError(wxT("SetBrushOrgEx(notebook bg brush)"));
}
return m_hbrBackground;
}
return wxNotebookBase::MSWGetBgBrushForChild(hDC, child);
}
示例10: wxLogLastError
//
// The wxWindow destructor will take care of deleting the submenus.
//
wxMenu::~wxMenu()
{
//
// We should free PM resources only if PM doesn't do it for us
// which happens if we're attached to a menubar or a submenu of another
// menu
if (!IsAttached() && !GetParent())
{
if (!::WinDestroyWindow((HWND)GetHmenu()) )
{
wxLogLastError(wxT("WinDestroyWindow"));
}
}
#if wxUSE_ACCEL
//
// Delete accels
//
WX_CLEAR_ARRAY(m_vAccels);
#endif // wxUSE_ACCEL
} // end of wxMenu::~wxMenu
示例11: GetHwnd
wxString wxChoice::GetString(unsigned int n) const
{
int len = (int)::SendMessage(GetHwnd(), CB_GETLBTEXTLEN, n, 0);
wxString str;
if ( len != CB_ERR && len > 0 )
{
if ( ::SendMessage
(
GetHwnd(),
CB_GETLBTEXT,
n,
(LPARAM)(wxChar *)wxStringBuffer(str, len)
) == CB_ERR )
{
wxLogLastError(wxT("SendMessage(CB_GETLBTEXT)"));
}
}
return str;
}
示例12: wxLogLastError
wxSemaError wxSemaphoreInternal::Post()
{
#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 300)
if ( !::ReleaseSemaphore(m_semaphore, 1, NULL /* ptr to previous count */) )
{
if ( GetLastError() == ERROR_TOO_MANY_POSTS )
{
return wxSEMA_OVERFLOW;
}
else
{
wxLogLastError(wxT("ReleaseSemaphore"));
return wxSEMA_MISC_ERROR;
}
}
return wxSEMA_NO_ERROR;
#else
return wxSEMA_MISC_ERROR;
#endif
}
示例13: notifyData
bool gcTaskBarIcon::RemoveIcon()
{
#ifdef WIN32
if (!m_iconAdded)
return false;
m_iconAdded = false;
NotifyIconData notifyData(GetHwndOf(m_win));
bool ok = wxShellNotifyIcon(NIM_DELETE, ¬ifyData) != 0;
if ( !ok )
{
wxLogLastError(wxT("wxShellNotifyIcon(NIM_DELETE)"));
}
return ok;
#else
return false;
#endif
}
示例14: wxLogLastError
bool wxMSWEventLoopBase::GetNextMessage(WXMSG* msg)
{
const BOOL rc = ::GetMessage(msg, NULL, 0, 0);
if ( rc == 0 )
{
// got WM_QUIT
return false;
}
if ( rc == -1 )
{
// should never happen, but let's test for it nevertheless
wxLogLastError(wxT("GetMessage"));
// still break from the loop
return false;
}
return true;
}
示例15: wxLogLastError
void wxApp::WakeUpIdle()
{
//
// Send the top window a dummy message so idle handler processing will
// start up again. Doing it this way ensures that the idle handler
// wakes up in the right thread (see also wxWakeUpMainThread() which does
// the same for the main app thread only)
//
wxWindow* pTopWindow = wxTheApp->GetTopWindow();
if (pTopWindow)
{
if ( !::WinPostMsg(GetHwndOf(pTopWindow), WM_NULL, (MPARAM)0, (MPARAM)0))
{
//
// Should never happen
//
wxLogLastError(wxT("PostMessage(WM_NULL)"));
}
}
} // end of wxWakeUpIdle