]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/fontdlgg.cpp
clean - reformatting
[wxWidgets.git] / src / generic / fontdlgg.cpp
index fc558e213130db3f79716e41b6704d961b655599..61e9a9a30e06415d3d163b426c86b6b5b7f15d43 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "fontdlgg.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -52,7 +48,9 @@
 class WXDLLEXPORT wxFontPreviewer : public wxWindow
 {
 public:
-    wxFontPreviewer(wxWindow *parent) : wxWindow(parent, wxID_ANY) {}
+    wxFontPreviewer(wxWindow *parent, const wxSize& sz = wxDefaultSize) : wxWindow(parent, wxID_ANY, wxDefaultPosition, sz)
+    {
+    }
 
 private:
     void OnPaint(wxPaintEvent& event);
@@ -78,7 +76,7 @@ void wxFontPreviewer::OnPaint(wxPaintEvent& WXUNUSED(event))
     {
         dc.SetFont(font);
         // Calculate vertical centre
-        long w, h;
+        long w = 0, h = 0;
         dc.GetTextExtent( wxT("X"), &w, &h);
         dc.SetTextForeground(GetForegroundColour());
         dc.SetClippingRegion(2, 2, size.x-4, size.y-4);
@@ -305,8 +303,12 @@ void wxGenericFontDialog::CreateWidgets()
     {
         wxStaticText* itemStaticText15 = new wxStaticText( this, wxID_STATIC, _("C&olour:"), wxDefaultPosition, wxDefaultSize, 0 );
         itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
+        
+        wxSize colourSize = wxDefaultSize;
+        if (is_pda)
+            colourSize.x = 100;
 
-        wxChoice* itemChoice16 = new wxChoice( this, wxID_FONT_COLOUR, wxDefaultPosition, wxDefaultSize, NUM_COLS, wxColourDialogNames, 0 );
+        wxChoice* itemChoice16 = new wxChoice( this, wxID_FONT_COLOUR, wxDefaultPosition, colourSize, NUM_COLS, wxColourDialogNames, 0 );
         itemChoice16->SetHelpText(_("The font colour."));
         if (ShowToolTips())
             itemChoice16->SetToolTip(_("The font colour."));
@@ -336,11 +338,12 @@ void wxGenericFontDialog::CreateWidgets()
         itemBoxSizer20->Add(itemCheckBox21, 0, wxALIGN_LEFT|wxALL, 5);
     }
 
-    itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
+    if (!is_pda)
+        itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
 
     wxStaticText* itemStaticText23 = new wxStaticText( this, wxID_STATIC, _("Preview:"), wxDefaultPosition, wxDefaultSize, 0 );
     itemBoxSizer3->Add(itemStaticText23, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
-
+    
     wxFontPreviewer* itemWindow24 = new wxFontPreviewer( this );
     m_previewer = itemWindow24;
     itemWindow24->SetHelpText(_("Shows the font preview."));
@@ -405,11 +408,13 @@ void wxGenericFontDialog::CreateWidgets()
 
     pointSizeChoice->SetSelection(dialogFont.GetPointSize()-1);
 
-    GetSizer()->SetItemMinSize(m_previewer, 430, 100);
+#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
+    GetSizer()->SetItemMinSize(m_previewer, is_pda ? 100 : 430, is_pda ? 40 : 100);
     GetSizer()->SetSizeHints(this);
     GetSizer()->Fit(this);    
 
     Centre(wxBOTH);
+#endif
 
     delete[] families;
     delete[] styles;