summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2d2c394)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11351
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
gs_mainEventLoop = new wxEventLoop;
gs_mainEventLoop = new wxEventLoop;
- return gs_mainEventLoop->Run();
+ rt = gs_mainEventLoop->Run();
delete gs_mainEventLoop;
gs_mainEventLoop = NULL;
delete gs_mainEventLoop;
gs_mainEventLoop = NULL;
}
void wxApp::ExitMainLoop()
}
void wxApp::ExitMainLoop()
bool wxApp::Initialized()
{
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);
call OnRun() */
wxTheApp->DeletePendingObjects();
call OnRun() */
wxTheApp->DeletePendingObjects();
- if ( wxTheApp->Initialized() &&
- wxTopLevelWindows.GetCount() != 0 )
+ if ( wxTheApp->Initialized() )
if ( m_globalClippingRegion )
{
if ( m_globalClippingRegion )
{
- m_MGLDC->setClipRegion(m_currentClippingRegion.GetMGLRegion()
+ m_MGLDC->setClipRegion(m_currentClippingRegion.GetMGLRegion()
& *m_globalClippingRegion);
}
else
& *m_globalClippingRegion);
}
else
if ( m_globalClippingRegion )
{
if ( m_globalClippingRegion )
{
- m_MGLDC->setClipRegion(m_currentClippingRegion.GetMGLRegion()
+ m_MGLDC->setClipRegion(m_currentClippingRegion.GetMGLRegion()
& *m_globalClippingRegion);
}
else
& *m_globalClippingRegion);
}
else
wxCHECK_RET( Ok(), wxT("invalid dc") );
m_MGLDC->makeCurrent(); // will go away with MGL6.0
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;
{
int w, h;
wxBrush oldb = m_brush;
void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
{
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);
m_MGLDC->makeCurrent(); // will go away with MGL6.0
DrawAnyText(text, x, y);
wxCoord x, wxCoord y,
double angle)
{
wxCoord x, wxCoord y,
double angle)
{
- if ( m_pen.GetStyle() == wxTRANSPARENT ) return;
m_MGLDC->makeCurrent(); // will go away with MGL6.0
if ( angle == 0 )
m_MGLDC->makeCurrent(); // will go away with MGL6.0
if ( angle == 0 )
wxCHECK_MSG( IsRunning(), FALSE, _T("can't call Dispatch() if not running") );
event_t evt;
wxCHECK_MSG( IsRunning(), FALSE, _T("can't call Dispatch() if not running") );
event_t evt;
- ibool rc = EVT_getNext(&evt, EVT_EVERYEVT);
-
- if ( !rc )
+ ibool rc;
+
+ rc = EVT_getNext(&evt, EVT_EVERYEVT);
+ while ( !rc )
- wxLogError(_T("events queue empty even though Pending() returned true"));
- return FALSE;
+ 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();
}
m_impl->ProcessEvent(&evt);
return m_impl->GetKeepLooping();
}
wxMGLFontLibrary *wxFontsManager::GetFontLibrary(wxFont *font)
{
wxMGLFontFamily *family;
wxMGLFontLibrary *wxFontsManager::GetFontLibrary(wxFont *font)
{
wxMGLFontFamily *family;
+ wxString facename = font->GetFaceName();
- if ( facename )
- family = GetFamily(font->GetFaceName());
+ if ( !facename.IsEmpty() )
+ family = GetFamily(facename);
- if ( family )
- facename = font->GetFaceName();
- else
- facename.Empty();
-
switch (font->GetFamily())
{
case wxSCRIPT:
switch (font->GetFamily())
{
case wxSCRIPT:
wxFont wxSystemSettings::GetSystemFont(int WXUNUSED(index))
{
// FIXME_MGL
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))
}
int wxSystemSettings::GetSystemMetric(int WXUNUSED(index))
// b) the app has plenty of time in wxApp::OnInit to feed wxSystemOptions
// with desired settings
// 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;
bool wxCreateMGL_WM()
{
int mode;
m_wnd = MGL_wmCreateWindow(g_winMng,
parent ? parent->GetHandle() : NULL,
pos.x, pos.y, size.x, size.y);
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;
MGL_wmSetWindowUserData(m_wnd, (void*) this);
MGL_wmSetWindowPainter(m_wnd, wxWindowPainter);
return TRUE;
void wxWindowMGL::Update()
{
void wxWindowMGL::Update()
{
if ( !m_frozen )
MGL_wmUpdateDC(g_winMng);
}
if ( !m_frozen )
MGL_wmUpdateDC(g_winMng);
}
if ( m_frozen )
{
// Don't paint anything if the window is frozen.
if ( m_frozen )
{
// Don't paint anything if the window is frozen.
+ m_refreshAfterThaw = TRUE;
- region_t clip;
- MGL_getClipRegionDC(*dc, &clip);
- m_updateRegion = wxRegion(MGLRegion(&clip));
+ MGLRegion clip;
+ dc->getClipRegion(clip);
+ m_updateRegion = wxRegion(clip);
GetEventHandler()->ProcessEvent(eventPt);
m_paintMGLDC = NULL;
GetEventHandler()->ProcessEvent(eventPt);
m_paintMGLDC = NULL;
+ m_updateRegion.Clear();