← Back to team overview

kicad-developers team mailing list archive

Re: OSX suggestions.

 

> The most serious issue, which makes KiCAD not work on Mac, is the  
> previously discussed issues related to invalid use of graphics  
> contexts with wxWidgets-2.8. Earlier, it was possible to revert to  
> wxWidgets-2.6, but this old version is not maintained any longer, and  
> fails to build on Leopard.
I've done some investigations and the change that makes the graphics work 
on 2.6 and not on 2.8 is the variable wxMAC_USE_CORE_GRAPHICS in setup.h that changes its status
from 0 in 2.6 to 1 in 2.8.
This setting enables as default CoreGraphics (Quartz) on opposite of the old QuickDraw Routines.
Limitation of the CoreGraphics is the possibility for only one wxDC interact with an entire window.
The sad thing of all that is that in wx 3.0 old QuickDraw Routines will be purged out.

> To fix this properly (i.e. using the native wxWidgets-2.8), I think  
> KiCAD's drawing code should be reorganized to only redraw when  
> triggered from a paint event. My peeks into this so far indicates that  
> this is mainly an issue with statusbar rendering, as well as redraws  
> while reading a design file. The problems are most visible in the  
> pcbnew app.
I've a proposal for the msgpanel.cpp that follows to mitigate that effect.
 
> Another missing piece is making the CMake build system work for the  
> Mac port.
I'vent much experience on CMake, old makefiles should work for a lot in thewhile :)

> Unfortunately, I don't have enough time to spare to dig into these  
> issues, but I'm more than willing to help out testing, discussing,  
> code reviewing etc.
Seems enough ;)

Index: common/msgpanel.cpp
===================================================================
--- common/msgpanel.cpp	(revision 949)
+++ common/msgpanel.cpp	(working copy)
@@ -43,9 +43,9 @@
/*************************************************/
{
wxPaintDC dc( this );
-
- //EraseMsgBox( &dc );
-
+#ifdef __WXMAC__
+ EraseMsgBox( &dc );
+#endif
dc.SetBackground( *wxBLACK_BRUSH );
dc.SetBackgroundMode( wxSOLID );
 
@@ -136,8 +136,11 @@
{
m_Items.push_back( item );
}
-    
+#ifndef __WXMAC__    
showItem( dc, item );
+#else 
+ this->Refresh();
+#endif
}
 
 
@@ -172,9 +175,14 @@
/* Effacement de la fenetre d'affichage des messages de bas d'ecran
*/
{
+#ifndef __WXMAC__
wxClientDC dc( this );
 
EraseMsgBox( &dc );
+#else
+ m_Items.clear();
+ this->Refresh();
+#endif
}
 
 
@@ -200,7 +208,8 @@
DC->DrawRectangle( 0, 0, size.x, size.y );
DC->SetBrush( wxNullBrush );
DC->SetPen( wxNullPen );
-    
+#ifndef __WXMAC__    
m_Items.clear();
+#endif
}






Follow ups

References