Update of /cvsroot/mahogany/M/include
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3948/include

Modified Files:
        Mdefaults.h Moptions.h guidef.h 
Log Message:
better/more general fix for the font-overriding problem:
 1. added new CreateFontFromDesc() function (and put it new wxMGuiUtils.cpp
    together with EnsureAvailableTextEncoding() which used to be in
    wxMApp.cpp)
 2. default font family and size are now wxDEFAULT/-1
 3. use CreateFontFromDesc() from message view, composer and folder view
    and don't use the returned font if it's invalid


Index: Mdefaults.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/Mdefaults.h,v
retrieving revision 1.259
retrieving revision 1.260
diff -b -u -2 -r1.259 -r1.260
--- Mdefaults.h 15 May 2005 21:16:50 -0000      1.259
+++ Mdefaults.h 19 Aug 2006 13:11:59 -0000      1.260
@@ -16,12 +16,4 @@
 class Profile;
 
-// under Windows 12pt font looks too huge, letters are like in a book for
-// children
-#ifdef OS_WIN
-#  define DEFAULT_FONT_SIZE 10l
-#else
-#  define DEFAULT_FONT_SIZE 12l
-#endif
-
 /** @name Levels of  interaction, do something or not?
 

Index: Moptions.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/Moptions.h,v
retrieving revision 1.105
retrieving revision 1.106
diff -b -u -2 -r1.105 -r1.106
--- Moptions.h  23 Jun 2006 23:27:30 -0000      1.105
+++ Moptions.h  19 Aug 2006 13:11:59 -0000      1.106
@@ -1907,7 +1907,7 @@
 #define   MP_MVIEW_TITLE_FMT_DEFVAL   _("from $from about \"$subject\"")
 /// which font to use
-#define   MP_MVIEW_FONT_DEFVAL         6L
+#define   MP_MVIEW_FONT_DEFVAL         0L
 /// which font size
-#define   MP_MVIEW_FONT_SIZE_DEFVAL         DEFAULT_FONT_SIZE
+#define   MP_MVIEW_FONT_SIZE_DEFVAL         -1
 /// the full font desc (replaces the 2 settings above)
 #define   MP_MVIEW_FONT_DESC_DEFVAL   wxEmptyString
@@ -1945,7 +1945,7 @@
 //@{
 /// which font to use
-#define   MP_FVIEW_FONT_DEFVAL         4L
+#define   MP_FVIEW_FONT_DEFVAL         0L
 /// which font size
-#define   MP_FVIEW_FONT_SIZE_DEFVAL         DEFAULT_FONT_SIZE
+#define   MP_FVIEW_FONT_SIZE_DEFVAL         -1
 /// the full font desc (replaces the 2 settings above)
 #define   MP_FVIEW_FONT_DESC_DEFVAL   wxEmptyString
@@ -2008,7 +2008,7 @@
 //@{
 /// which font to use
-#define   MP_CVIEW_FONT_DEFVAL         6L
+#define   MP_CVIEW_FONT_DEFVAL         0L
 /// which font size
-#define   MP_CVIEW_FONT_SIZE_DEFVAL    DEFAULT_FONT_SIZE
+#define   MP_CVIEW_FONT_SIZE_DEFVAL    -1
 /// the full font desc (replaces the 2 settings above)
 #define   MP_CVIEW_FONT_DESC_DEFVAL   wxEmptyString

Index: guidef.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/guidef.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -b -u -2 -r1.25 -r1.26
--- guidef.h    13 Aug 2004 20:57:56 -0000      1.25
+++ guidef.h    19 Aug 2006 13:11:59 -0000      1.26
@@ -1,13 +1,15 @@
-/*-*- c++ -*-********************************************************
- * guidef.h define the GUI implementation                           *
- *                                                                  *
- * (C) 1997 by Karsten Ballüder ([EMAIL PROTECTED])                 *
- *                                                                  *
- * $Id$
- *
- *******************************************************************/
+///////////////////////////////////////////////////////////////////////////////
+// Project:     M - cross platform e-mail GUI client
+// File name:   guidef.h
+// Purpose:     miscellaneous GUI helpers
+// Author:      Karsten Ballüder, Vadim Zeitlin
+// Created:     1998
+// CVS-ID:      $Id$
+// Copyright:   (c) 1998-2006 Mahogany team
+// Licence:     M license
+///////////////////////////////////////////////////////////////////////////////
 
-#ifndef GUIDEF_H
-#define GUIDEF_H
+#ifndef M_GUIDEF_H_
+#define M_GUIDEF_H_
 
 #ifndef USE_PCH
@@ -64,6 +66,4 @@
   this encoding and the encoding parameter is modified in place.
 
-  Note that this function is implemented in wxMApp.cpp.
-
   @param encoding the encoding to check, may be modified
   @param text the text we want to show in this encoding, may be translated
@@ -74,4 +74,22 @@
                                         bool mayAskUser = false);
 
+/**
+   Create a font from the given native font description or font family and
+   size.
+
+   Notice that if neither of the parameters is specified (description is empty
+   and the other ones are -1), an invalid font is returned and the caller
+   should check for it and avoid using it in this case to avoid overriding the
+   default system font if the user didn't set any specific font to use.
+
+   @param fontDesc opaque string returned by wxFont::GetNativeFontInfoDesc()
+   @param fontSize font size, -1 if not specified
+   @param fontFamily font family, wxFONTFAMILY_DEFAULT if not specified
+   @return font which may be invalid, to be checked by the caller
+ */
+extern wxFont
+CreateFontFromDesc(const String& fontDesc, int fontSize, int fontFamily);
+
+
 // Prevent MEvent dispatch inside wxYield
 extern int g_busyCursorYield;
@@ -87,3 +105,3 @@
 };
 
-#endif // GUIDEF_H
+#endif // M_GUIDEF_H_


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to