wxMGL bugfixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11351 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -226,10 +226,12 @@ bool wxApp::SendIdleEvents(wxWindow* win)
|
||||
|
||||
int wxApp::MainLoop()
|
||||
{
|
||||
int rt;
|
||||
gs_mainEventLoop = new wxEventLoop;
|
||||
return gs_mainEventLoop->Run();
|
||||
rt = gs_mainEventLoop->Run();
|
||||
delete gs_mainEventLoop;
|
||||
gs_mainEventLoop = NULL;
|
||||
return rt;
|
||||
}
|
||||
|
||||
void wxApp::ExitMainLoop()
|
||||
@@ -239,7 +241,9 @@ void wxApp::ExitMainLoop()
|
||||
|
||||
bool wxApp::Initialized()
|
||||
{
|
||||
return (GetTopWindow() != NULL);
|
||||
// FIXME_MGL -- only for now because we don't have wxFrame/wxDialog yet
|
||||
return TRUE;
|
||||
//return (wxTopLevelWindows.GetCount() != 0);
|
||||
}
|
||||
|
||||
bool wxApp::Pending()
|
||||
@@ -481,8 +485,7 @@ int wxEntry(int argc, char *argv[])
|
||||
call OnRun() */
|
||||
wxTheApp->DeletePendingObjects();
|
||||
|
||||
if ( wxTheApp->Initialized() &&
|
||||
wxTopLevelWindows.GetCount() != 0 )
|
||||
if ( wxTheApp->Initialized() )
|
||||
{
|
||||
wxTheApp->OnRun();
|
||||
|
||||
|
@@ -334,9 +334,7 @@ void wxDC::Clear()
|
||||
wxCHECK_RET( Ok(), wxT("invalid dc") );
|
||||
|
||||
m_MGLDC->makeCurrent(); // will go away with MGL6.0
|
||||
m_MGLDC->clearDevice();
|
||||
if ( m_backgroundBrush.GetStyle() != wxSOLID &&
|
||||
m_backgroundBrush.GetStyle() != wxTRANSPARENT )
|
||||
if ( m_backgroundBrush.GetStyle() != wxTRANSPARENT )
|
||||
{
|
||||
int w, h;
|
||||
wxBrush oldb = m_brush;
|
||||
@@ -717,7 +715,6 @@ void wxDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,d
|
||||
|
||||
void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
||||
{
|
||||
if ( m_pen.GetStyle() == wxTRANSPARENT ) return;
|
||||
m_MGLDC->makeCurrent(); // will go away with MGL6.0
|
||||
DrawAnyText(text, x, y);
|
||||
|
||||
@@ -811,7 +808,6 @@ void wxDC::DoDrawRotatedText(const wxString& text,
|
||||
wxCoord x, wxCoord y,
|
||||
double angle)
|
||||
{
|
||||
if ( m_pen.GetStyle() == wxTRANSPARENT ) return;
|
||||
m_MGLDC->makeCurrent(); // will go away with MGL6.0
|
||||
|
||||
if ( angle == 0 )
|
||||
|
@@ -157,20 +157,18 @@ bool wxEventLoop::Dispatch()
|
||||
wxCHECK_MSG( IsRunning(), FALSE, _T("can't call Dispatch() if not running") );
|
||||
|
||||
event_t evt;
|
||||
ibool rc = EVT_getNext(&evt, EVT_EVERYEVT);
|
||||
ibool rc;
|
||||
|
||||
if ( !rc )
|
||||
rc = EVT_getNext(&evt, EVT_EVERYEVT);
|
||||
while ( !rc )
|
||||
{
|
||||
wxLogError(_T("events queue empty even though Pending() returned true"));
|
||||
wxUsleep(1000);
|
||||
if ( !m_impl->GetKeepLooping() )
|
||||
return FALSE;
|
||||
rc = EVT_getNext(&evt, EVT_EVERYEVT);
|
||||
}
|
||||
|
||||
// FIXME_MGL -- there must be some way to programatically exit
|
||||
// the loop, like WM_QUIT under Windows -- perhaps we need custom
|
||||
// event to indicate this??
|
||||
|
||||
m_impl->ProcessEvent(&evt);
|
||||
|
||||
return m_impl->GetKeepLooping();
|
||||
}
|
||||
|
||||
|
@@ -323,20 +323,17 @@ bool wxMGLFontFamily::HasFace(int type) const
|
||||
wxMGLFontLibrary *wxFontsManager::GetFontLibrary(wxFont *font)
|
||||
{
|
||||
wxMGLFontFamily *family;
|
||||
wxString facename;
|
||||
int type;
|
||||
wxString facename = font->GetFaceName();
|
||||
|
||||
if ( facename )
|
||||
family = GetFamily(font->GetFaceName());
|
||||
if ( !facename.IsEmpty() )
|
||||
family = GetFamily(facename);
|
||||
else
|
||||
family = NULL;
|
||||
if ( family )
|
||||
facename = font->GetFaceName();
|
||||
else
|
||||
facename.Empty();
|
||||
|
||||
if ( !family )
|
||||
{
|
||||
facename.Empty();
|
||||
switch (font->GetFamily())
|
||||
{
|
||||
case wxSCRIPT:
|
||||
|
@@ -24,7 +24,7 @@ wxColour wxSystemSettings::GetSystemColour(int WXUNUSED(index))
|
||||
wxFont wxSystemSettings::GetSystemFont(int WXUNUSED(index))
|
||||
{
|
||||
// FIXME_MGL
|
||||
return wxFont(12, wxMODERN, wxNORMAL, wxNORMAL);
|
||||
return wxFont(12, wxSWISS, wxNORMAL, wxNORMAL);
|
||||
}
|
||||
|
||||
int wxSystemSettings::GetSystemMetric(int WXUNUSED(index))
|
||||
|
@@ -98,6 +98,7 @@ enum
|
||||
// b) the app has plenty of time in wxApp::OnInit to feed wxSystemOptions
|
||||
// with desired settings
|
||||
|
||||
// FIXME_MGL -- move to app.cpp??
|
||||
bool wxCreateMGL_WM()
|
||||
{
|
||||
int mode;
|
||||
@@ -262,6 +263,7 @@ bool wxWindowMGL::Create(wxWindow *parent,
|
||||
m_wnd = MGL_wmCreateWindow(g_winMng,
|
||||
parent ? parent->GetHandle() : NULL,
|
||||
pos.x, pos.y, size.x, size.y);
|
||||
MGL_wmShowWindow(m_wnd, m_isShown);
|
||||
MGL_wmSetWindowUserData(m_wnd, (void*) this);
|
||||
MGL_wmSetWindowPainter(m_wnd, wxWindowPainter);
|
||||
return TRUE;
|
||||
@@ -702,7 +704,6 @@ void wxWindowMGL::Refresh(bool WXUNUSED(eraseBack), const wxRect *rect)
|
||||
|
||||
void wxWindowMGL::Update()
|
||||
{
|
||||
Refresh();
|
||||
if ( !m_frozen )
|
||||
MGL_wmUpdateDC(g_winMng);
|
||||
}
|
||||
@@ -725,12 +726,13 @@ void wxWindowMGL::HandlePaint(MGLDevCtx *dc)
|
||||
if ( m_frozen )
|
||||
{
|
||||
// Don't paint anything if the window is frozen.
|
||||
m_refreshAfterThaw = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
region_t clip;
|
||||
MGL_getClipRegionDC(*dc, &clip);
|
||||
m_updateRegion = wxRegion(MGLRegion(&clip));
|
||||
MGLRegion clip;
|
||||
dc->getClipRegion(clip);
|
||||
m_updateRegion = wxRegion(clip);
|
||||
m_paintMGLDC = dc;
|
||||
|
||||
{
|
||||
@@ -749,6 +751,7 @@ void wxWindowMGL::HandlePaint(MGLDevCtx *dc)
|
||||
GetEventHandler()->ProcessEvent(eventPt);
|
||||
|
||||
m_paintMGLDC = NULL;
|
||||
m_updateRegion.Clear();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user