// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+// ===========================================================================
+// declarations
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// headers
+// ---------------------------------------------------------------------------
+
#ifdef __GNUG__
#pragma implementation "fontdlg.h"
#endif
-#include "wx/mac/fontdlg.h"
-#include "wx/cmndata.h"
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+ #include "wx/cmndata.h"
+#endif
+
+#include "wx/mac/fontdlg.h"
+
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog)
#endif
#include "wx/mac/private.h"
+//Mac OSX 10.2+ only
#if defined( __WXMAC__ ) && TARGET_API_MAC_OSX && ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 )
#include <ATSUnicode.h>
#include "wx/msgdlg.h"
+//color isn't working in carbon impl
+#define ISCOLORWORKING 0
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+// ---------------------------------------------------------------------------
+// Carbon event callback(s)
+// ---------------------------------------------------------------------------
+
pascal OSStatus wxFontDialogEventHandler( EventHandlerCallRef inHandlerCallRef,
EventRef event, void* pData)
{
FMFontFamily fontfamily;
FMFontStyle fontstyle;
FMFontSize fontsize;
+#if ISCOLORWORKING
RGBColor fontcolor;
+#endif
status = GetEventParameter (event, kEventParamFMFontFamily,
typeFMFontFamily, NULL,
check_noerr (status);
+#if ISCOLORWORKING
status = GetEventParameter (event, kEventParamFontColor,
typeRGBColor, NULL,
sizeof( RGBColor ), NULL, &fontcolor);
check_noerr (status);
+#endif
//now do the conversion to the wx font data
wxFontData theFontData;
wxFont theFont;
-
+
+#if ISCOLORWORKING
//set color
wxColour theColor;
theColor.Set(&(WXCOLORREF&)fontcolor);
theFontData.SetColour(theColor);
+#endif
//set size
theFont.SetPointSize(fontsize);
DEFINE_ONE_SHOT_HANDLER_GETTER( wxFontDialogEventHandler );
-//---------------------------
-// Class implementation
-//---------------------------
+// ---------------------------------------------------------------------------
+// wxFontDialog
+// ---------------------------------------------------------------------------
wxFontDialog::wxFontDialog() :
m_dialogParent(NULL), m_pEventHandlerRef(NULL)
while(FPIsFontPanelVisible())
{
//yeild so we can get events
- ::wxSafeYield(m_dialogParent, false);
+ wxTheApp->Yield(false);
}
}
else
#else
//10.2+ only
-
-//
-// no native implementation
-//
+// ---------------------------------------------------------------------------
+// wxFontDialog stub for mac OS's without a native font dialog
+// ---------------------------------------------------------------------------
wxFontDialog::wxFontDialog()
{
Create(parent, data);
}
+wxFontDialog::~wxFontDialog()
+{
+ // empty
+}
+
void wxFontDialog::SetData(wxFontData& fontdata)
{
m_fontData = fontdata;