Обсуждение: latest wx news

Поиск
Список
Период
Сортировка

latest wx news

От
Andreas Pflug
Дата:
Hi friends,

I reviewed all patches *except* the notebook_comctl.patch. Hiroshi,
please have a look at the new snapshot whether it's obsolete by now or
if we still need it.

Unicode/Clipboard is *fixed* for gtk, and for msw I couldn't reproduce
the problem which might be caused by different win32 apis used. However,
on any new system (MacOSX?) we might get the same problem if more than
one clipboard for text is available.

816019 font inheritance is still an issue. Several gtk controls have
been fixed in the meantime and guess what? they received a line of code
as I suggested for ages... I updated the patch to run against wx cvs
head. I'll try another suggestion to apply them in the next days on
wx-dev, after consuming some sedating substance... Ron, I already
assigned it to you, hoping for your kind assistance :-)

Another patch was necessary (918043) because wxNotebook won't set the
font under GTK at all. This fix should be hopefully quite non-controversal.

Regards,
Andreas

Index: include/wx/generic/statusbr.h
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/include/wx/generic/statusbr.h,v
retrieving revision 1.20
diff -u -r1.20 statusbr.h
--- include/wx/generic/statusbr.h    2004/03/07 17:28:28    1.20
+++ include/wx/generic/statusbr.h    2004/03/17 14:11:34
@@ -115,7 +115,6 @@

   int               m_borderX;
   int               m_borderY;
-  wxFont            m_defaultStatusBarFont;
   wxPen             m_mediumShadowPen;
   wxPen             m_hilightPen;

Index: src/generic/calctrl.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/generic/calctrl.cpp,v
retrieving revision 1.51
diff -u -r1.51 calctrl.cpp
--- src/generic/calctrl.cpp    2003/10/16 10:27:55    1.51
+++ src/generic/calctrl.cpp    2004/03/17 14:11:41
@@ -282,6 +282,8 @@
     // needed to get the arrow keys normally used for the dialog navigation
     SetWindowStyle(style | wxWANTS_CHARS);

+    SetFont(parent->GetFont());
+
     m_date = date.IsValid() ? date : wxDateTime::Today();

     m_lowdate = wxDefaultDateTime;
@@ -322,7 +324,6 @@
     SetSize(pos.x, pos.y, sizeReal.x, sizeReal.y);

     SetBackgroundColour(*wxWHITE);
-    SetFont(*wxSWISS_FONT);

     SetHolidayAttrs();

Index: src/generic/listctrl.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/generic/listctrl.cpp,v
retrieving revision 1.319
diff -u -r1.319 listctrl.cpp
--- src/generic/listctrl.cpp    2004/03/01 22:17:56    1.319
+++ src/generic/listctrl.cpp    2004/03/17 14:11:43
@@ -4621,6 +4621,8 @@
             m_headerWin->Show( FALSE );
         }
     }
+
+    InheritAttributes();

     return TRUE;
 }
Index: src/generic/panelg.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/generic/panelg.cpp,v
retrieving revision 1.66
diff -u -r1.66 panelg.cpp
--- src/generic/panelg.cpp    2003/09/24 00:41:03    1.66
+++ src/generic/panelg.cpp    2004/03/17 14:11:43
@@ -121,7 +121,11 @@
                      long style,
                      const wxString& name)
 {
-    return wxWindow::Create(parent, id, pos, size, style, name);
+    bool rc= wxWindow::Create(parent, id, pos, size, style, name);
+
+    if (rc)
+        SetFont(parent->GetFont());
+    return rc;
 }

 wxPanel::~wxPanel()
Index: src/generic/splitter.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/generic/splitter.cpp,v
retrieving revision 1.91
diff -u -r1.91 splitter.cpp
--- src/generic/splitter.cpp    2004/03/04 23:48:37    1.91
+++ src/generic/splitter.cpp    2004/03/17 14:11:44
@@ -92,6 +92,8 @@

     m_permitUnsplitAlways = (style & wxSP_PERMIT_UNSPLIT) != 0;

+    SetFont(parent->GetFont());
+
     return true;
 }

Index: src/generic/statusbr.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/generic/statusbr.cpp,v
retrieving revision 1.53
diff -u -r1.53 statusbr.cpp
--- src/generic/statusbr.cpp    2004/03/07 15:22:28    1.53
+++ src/generic/statusbr.cpp    2004/03/17 14:11:44
@@ -91,7 +91,7 @@
 #endif
   InitColours();

-  SetFont(m_defaultStatusBarFont);
+  SetFont(parent->GetFont());

   // Set the height according to the font and the border size
   wxClientDC dc(this);
@@ -350,14 +350,12 @@
     SetBackgroundColour(vColour);
     vColour.Set(wxString("BLACK"));
     SetForegroundColour(vColour);
-    m_defaultStatusBarFont = *wxSMALL_FONT;
 #else
     m_mediumShadowPen = wxPen("GREY", 1, wxSOLID);
     m_hilightPen = wxPen("WHITE", 1, wxSOLID);
 #endif

 #ifndef __WXPM__
-    m_defaultStatusBarFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
 #endif
 }
Index: src/generic/treectlg.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/generic/treectlg.cpp,v
retrieving revision 1.118
diff -u -r1.118 treectlg.cpp
--- src/generic/treectlg.cpp    2004/03/07 17:28:36    1.118
+++ src/generic/treectlg.cpp    2004/03/17 14:11:45
@@ -781,6 +781,15 @@
     SetForegroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT) );
     SetBackgroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX) );

+    m_normalFont = parent->GetFont();
+    m_boldFont = wxFont(m_normalFont.GetPointSize(),
+                        m_normalFont.GetFamily(),
+                        m_normalFont.GetStyle(),
+                        wxBOLD,
+                        m_normalFont.GetUnderlined(),
+                        m_normalFont.GetFaceName(),
+                        m_normalFont.GetEncoding());
+
 //  m_dottedPen = wxPen( "grey", 0, wxDOT );  too slow under XFree86
     m_dottedPen = wxPen( wxT("grey"), 0, 0 );

cvs server: Diffing src/gtk
Index: src/gtk/gauge.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/gtk/gauge.cpp,v
retrieving revision 1.22
diff -u -r1.22 gauge.cpp
--- src/gtk/gauge.cpp    2004/03/10 01:15:27    1.22
+++ src/gtk/gauge.cpp    2004/03/17 14:11:46
@@ -56,6 +56,7 @@
     m_parent->DoAddChild( this );

     PostCreation();
+    InheritAttributes();
     SetBestSize(size);

     Show( TRUE );
Index: src/gtk/statline.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/gtk/statline.cpp,v
retrieving revision 1.10
diff -u -r1.10 statline.cpp
--- src/gtk/statline.cpp    2003/08/09 12:46:10    1.10
+++ src/gtk/statline.cpp    2004/03/17 14:11:46
@@ -75,6 +75,7 @@
     m_parent->DoAddChild( this );

     PostCreation();
+    InheritAttributes();

     Show( TRUE );

Index: src/gtk/tbargtk.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/gtk/tbargtk.cpp,v
retrieving revision 1.90
diff -u -r1.90 tbargtk.cpp
--- src/gtk/tbargtk.cpp    2003/09/26 19:43:45    1.90
+++ src/gtk/tbargtk.cpp    2004/03/17 14:11:46
@@ -374,7 +374,8 @@
     m_parent->DoAddChild( this );

     PostCreation();
-
+    SetFont(parent->GetFont());
+
     Show( TRUE );

     return TRUE;
Index: src/gtk/treegtk.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/gtk/treegtk.cpp,v
retrieving revision 1.5
diff -u -r1.5 treegtk.cpp
--- src/gtk/treegtk.cpp    2003/08/09 12:46:11    1.5
+++ src/gtk/treegtk.cpp    2004/03/17 14:11:46
@@ -135,6 +135,8 @@
 printf("postcreate\n");
   PostCreation();

+  InheritAttributes();
+
   gtk_widget_realize(GTK_WIDGET(m_tree));

   Show(TRUE);

Index: src/msw/checkbox.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/msw/checkbox.cpp,v
retrieving revision 1.53
diff -u -r1.53 checkbox.cpp
--- src/msw/checkbox.cpp    2004/01/15 13:49:04    1.53
+++ src/msw/checkbox.cpp    2004/03/17 14:11:46
@@ -177,7 +177,7 @@
     if ( !s_checkSize )
     {
         wxScreenDC dc;
-        dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
+        dc.SetFont(GetFont());

         s_checkSize = dc.GetCharHeight();
     }
Index: src/msw/listctrl.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/msw/listctrl.cpp,v
retrieving revision 1.192
diff -u -r1.192 listctrl.cpp
--- src/msw/listctrl.cpp    2004/02/29 23:24:35    1.192
+++ src/msw/listctrl.cpp    2004/03/17 14:11:47
@@ -367,8 +367,8 @@

     // inherit foreground colour but our background should be the same as for
     // listboxes and other such "container" windows and not inherited
+    InheritAttributes();
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
-    SetForegroundColour(GetParent()->GetForegroundColour());

     return TRUE;
 }
Index: src/msw/notebook.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/msw/notebook.cpp,v
retrieving revision 1.111
diff -u -r1.111 notebook.cpp
--- src/msw/notebook.cpp    2004/03/07 20:00:28    1.111
+++ src/msw/notebook.cpp    2004/03/17 14:11:48
@@ -270,6 +270,7 @@
     if ( !MSWCreateControl(WC_TABCONTROL, wxEmptyString, pos, size) )
         return false;

+    InheritAttributes();
     SetBackgroundColour(wxColour(::GetSysColor(COLOR_BTNFACE)));

     return true;
Index: src/msw/radiobut.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/msw/radiobut.cpp,v
retrieving revision 1.48
diff -u -r1.48 radiobut.cpp
--- src/msw/radiobut.cpp    2004/01/15 13:49:06    1.48
+++ src/msw/radiobut.cpp    2004/03/17 14:11:48
@@ -271,7 +271,7 @@
     if ( !s_radioSize )
     {
         wxScreenDC dc;
-        dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
+        dc.SetFont(GetFont());

         s_radioSize = dc.GetCharHeight();
     }
Index: src/msw/statbr95.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/msw/statbr95.cpp,v
retrieving revision 1.51
diff -u -r1.51 statbr95.cpp
--- src/msw/statbr95.cpp    2003/08/24 14:30:23    1.51
+++ src/msw/statbr95.cpp    2004/03/17 14:11:48
@@ -118,6 +118,7 @@
     SubclassWin(m_hWnd);

     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));
+    SetFont(parent->GetFont());

     return TRUE;
 }
Index: src/msw/tabctrl.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/msw/tabctrl.cpp,v
retrieving revision 1.31
diff -u -r1.31 tabctrl.cpp
--- src/msw/tabctrl.cpp    2004/02/07 14:47:48    1.31
+++ src/msw/tabctrl.cpp    2004/03/17 14:11:48
@@ -116,7 +116,7 @@

   SubclassWin((WXHWND) hWndTabCtrl);

-  SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
+  InheritAttributes();

   return TRUE;
 }
Index: src/msw/tbar95.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/msw/tbar95.cpp,v
retrieving revision 1.123
diff -u -r1.123 tbar95.cpp
--- src/msw/tbar95.cpp    2004/02/25 10:44:49    1.123
+++ src/msw/tbar95.cpp    2004/03/17 14:11:53
@@ -241,8 +241,8 @@
         return FALSE;

     // set up the colors and fonts
+    InheritAttributes();
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));
-    SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));

     return TRUE;
 }
Index: include/wx/gtk/notebook.h
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/include/wx/gtk/notebook.h,v
retrieving revision 1.48
diff -c -r1.48 notebook.h
*** include/wx/gtk/notebook.h    2004/01/22 14:46:00    1.48
--- include/wx/gtk/notebook.h    2004/03/17 14:12:12
***************
*** 107,112 ****
--- 107,115 ----
  #endif

      void ApplyWidgetStyle();
+
+     // set all page's font
+     bool SetFont(const wxFont& font);

      // report if window belongs to notebook
      bool IsOwnGtkWindow( GdkWindow *window );
Index: src/gtk/notebook.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/gtk/notebook.cpp,v
retrieving revision 1.102
diff -c -r1.102 notebook.cpp
*** src/gtk/notebook.cpp    2004/02/22 21:05:54    1.102
--- src/gtk/notebook.cpp    2004/03/17 14:12:13
***************
*** 24,35 ****
--- 24,38 ----
  #include "wx/intl.h"
  #include "wx/log.h"
  #include "wx/bitmap.h"
+ #include "wx/fontutil.h"

  #include "wx/gtk/private.h"
  #include "wx/gtk/win_gtk.h"

  #include <gdk/gdkkeysyms.h>

+ #include "wx/msgdlg.h"
+
  // ----------------------------------------------------------------------------
  // events
  // ----------------------------------------------------------------------------
***************
*** 69,86 ****
--- 72,144 ----
      m_image = -1;
      m_page = (GtkNotebookPage *) NULL;
      m_box = (GtkWidget *) NULL;
+     m_labelStyle=NULL;
+   }
+   ~wxGtkNotebookPage()
+   {
+       if (m_labelStyle)
+         gtk_style_unref( m_labelStyle );
    }
+   bool SetFont(const wxFont& font);

    wxString           m_text;
    int                m_image;
    GtkNotebookPage   *m_page;
    GtkLabel          *m_label;
    GtkWidget         *m_box;     // in which the label and image are packed
+   GtkStyle          *m_labelStyle;
  };

+
+ bool  wxGtkNotebookPage::SetFont(const wxFont& font)
+ {
+     if (!m_label)
+         return false;
+
+     if (m_labelStyle)
+     {
+         GtkStyle *remake = gtk_style_copy( m_labelStyle );
+
+ #ifndef __WXGTK20__
+         remake->klass = m_labelStyle->klass;
+ #endif
+
+         gtk_style_unref( m_labelStyle );
+         m_labelStyle = remake;
+     }
+     else
+     {
+         GtkStyle *def = gtk_rc_get_style( GTK_WIDGET(m_label) );
+
+         if (!def)
+             def = gtk_widget_get_default_style();
+
+         m_labelStyle = gtk_style_copy( def );
+
+         // FIXME: no more klass in 2.0
+ #ifndef __WXGTK20__
+         m_labelStyle->klass = def->klass;
+ #endif
+     }
+
+ #ifdef __WXGTK20__
+     pango_font_description_free( m_labelStyle->font_desc );
+     m_labelStyle->font_desc = pango_font_description_copy( font.GetNativeFontInfo()->description );
+ #else
+     gdk_font_unref( m_labelStyle->font );
+     m_labelStyle->font = gdk_font_ref( font.GetInternalFont( 1.0 ) );
+ #endif
+
+     gtk_widget_set_style( GTK_WIDGET(m_label), m_labelStyle );
+
+     return true;
+ }
+
+
  #include "wx/listimpl.cpp"
  WX_DEFINE_LIST(wxGtkNotebookPagesList);

+
  //-----------------------------------------------------------------------------
  // "switch_page"
  //-----------------------------------------------------------------------------
***************
*** 655,664 ****
--- 713,724 ----
      }

      /* set the label text */
+
      nb_page->m_text = text;
      if (nb_page->m_text.IsEmpty()) nb_page->m_text = wxT("");

      nb_page->m_label = GTK_LABEL( gtk_label_new(wxGTK_CONV(nb_page->m_text)) );
+     nb_page->SetFont(GetFont());
      gtk_box_pack_end( GTK_BOX(nb_page->m_box), GTK_WIDGET(nb_page->m_label), FALSE, FALSE, m_padding );

      /* show the label */
***************
*** 791,796 ****
--- 851,869 ----
  {
      return ((m_widget->window == window) ||
              (NOTEBOOK_PANEL(m_widget) == window));
+ }
+
+ bool  wxNotebook::SetFont(const wxFont& font)
+ {
+     bool rc=wxNotebookBase::SetFont(font);
+
+     if (rc)
+     {
+         size_t i;
+         for (i=0 ; i < m_pagesData.GetCount() ; i++)
+             GetNotebookPage(i)->SetFont(font);
+     }
+     return rc;
  }

  //-----------------------------------------------------------------------------

Re: latest wx news

От
Hiroshi Saito
Дата:
----- Original Message -----
From: "Andreas Pflug" <pgadmin@pse-consulting.de>

> Hi friends,
>
> I reviewed all patches *except* the notebook_comctl.patch. Hiroshi,
> please have a look at the new snapshot whether it's obsolete by now or
> if we still need it.

Hi Andreas.

I am sleeping sickly from yesterday.:-(
A small virus is very dangerous.!!

Since headache was also left, it is seen now.
It seems that a state is slightly good although seen in view of CVS co.
The problem which a background penetrates is solved.
However, wxNB_BOTTOM was not repaired.*sigh*
http://cre-ent.skcapi.co.jp/~saito/pgadmin3/pgAdmin3-20040317.png

Sorry thing is one.
QueryBuilder stopped functioning by WXMSW from my former proposal.:-(
Still, correspondence of GTK is not bright.
Now, this patch is required because of WXMSW.
It seems that it can be operated at least.
http://cre-ent.skcapi.co.jp/~saito/pgadmin3/pgAdmin3-20040317_QB.png

regards,
Hiroshi Saito

Вложения

Re: latest wx news

От
Hiroshi Saito
Дата:
Hi Ron.

From: "Ron" <ron@debian.org>

> On Thu, Mar 18, 2004 at 12:14:55PM +0900, Hiroshi Saito wrote:
> > However, wxNB_BOTTOM was not repaired.*sigh*
> > http://cre-ent.skcapi.co.jp/~saito/pgadmin3/pgAdmin3-20040317.png
>
> This is still documented to not work with XP.  Is it even possible

FWIW, This is, after applying patch.
http://cre-ent.skcapi.co.jp/~saito/pgadmin3/pgAdmin3-20040317_2.png

> on that platform?

Windows-XP Home Edition Pervice pack1
(Japanese)

>
>   Ron

regards
Hiroshi Saito

Re: latest wx news

От
Ron
Дата:
On Thu, Mar 18, 2004 at 12:14:55PM +0900, Hiroshi Saito wrote:
> However, wxNB_BOTTOM was not repaired.*sigh*
> http://cre-ent.skcapi.co.jp/~saito/pgadmin3/pgAdmin3-20040317.png

This is still documented to not work with XP.  Is it even possible
on that platform?

  Ron