]> git.saurik.com Git - wxWidgets.git/commitdiff
fix font styles
authorRyan Norton <wxprojects@comcast.net>
Sun, 26 Sep 2004 16:34:12 +0000 (16:34 +0000)
committerRyan Norton <wxprojects@comcast.net>
Sun, 26 Sep 2004 16:34:12 +0000 (16:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29410 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/fontdlg.cpp

index 913ee8015bee00f47d776dcfa33d57ea523845cc..44850225848023fd2ea395f224ec8139a66b093e 100644 (file)
@@ -122,15 +122,13 @@ pascal OSStatus wxFontDialogEventHandler( EventHandlerCallRef inHandlerCallRef,
     theFont.SetFamily(wxDEFAULT);  
 
     //TODOTODO: Get other styles?  Font weight?
-    theFont.SetStyle(0 +
-                     ((fontstyle & bold) ? wxFONTFLAG_BOLD : 0) +
-                     ((fontstyle & italic) ? wxFONTFLAG_ITALIC : 0) +
-                     ((fontstyle & underline) ? wxFONTFLAG_UNDERLINED : 0)
-                     );
+    theFont.SetStyle(((fontstyle & italic) ? wxFONTSTYLE_ITALIC : 0));
     theFont.SetWeight((fontstyle & bold) ? wxBOLD : wxNORMAL);   
+    theFont.SetUnderlined(((fontstyle & underline) ? true : false));
     
     //for debugging
-    //wxPrintf(wxT("FaceName:%s\nSize:%i\n"), theFont.GetFaceName().c_str(), theFont.GetPointSize());
+    //wxPrintf(wxT("FaceName:%s\nSize:%i\nStyle:%i\n"), theFont.GetFaceName().c_str(), theFont.GetPointSize(),
+    //theFont.GetStyle());
     
     //phew!!  We're done - set the chosen font
     theFontData.SetChosenFont(theFont);