]> git.saurik.com Git - wxWidgets.git/commitdiff
Added support for frames without borders (such as for
authorRobert Roebling <robert@roebling.de>
Sat, 24 Oct 1998 20:25:36 +0000 (20:25 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 24 Oct 1998 20:25:36 +0000 (20:25 +0000)
  splash screen) with wxSIMPLE_BORDER
  Fixed tooltip bug -> recompile everything
  Added validators to wxListCtrl
  Fixed Create/Realize bug

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

16 files changed:
include/wx/generic/listctrl.h
include/wx/gtk/window.h
include/wx/gtk1/window.h
src/generic/listctrl.cpp
src/gtk/accel.cpp
src/gtk/app.cpp
src/gtk/frame.cpp
src/gtk/menu.cpp
src/gtk/tbargtk.cpp
src/gtk/window.cpp
src/gtk1/accel.cpp
src/gtk1/app.cpp
src/gtk1/frame.cpp
src/gtk1/menu.cpp
src/gtk1/tbargtk.cpp
src/gtk1/window.cpp

index 4fd5c12df3a41830d58081570a9434a223d4c355..63c68081026ef0ca5ea8d72ad22598e337e6bfbd 100644 (file)
@@ -531,13 +531,18 @@ class wxListCtrl: public wxControl
   public:
 
     wxListCtrl(void);
-    wxListCtrl( wxWindow *parent, wxWindowID id,
+    wxListCtrl( wxWindow *parent, wxWindowID id = -1,
       const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      long style = 0, const wxString &name = "listctrl" );
+      long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
+       const wxString &name = "listctrl" )
+    {
+      Create(parent, id, pos, size, style, validator, name);
+    }
     ~wxListCtrl(void);
-    bool Create( wxWindow *parent, wxWindowID id,
+    bool Create( wxWindow *parent, wxWindowID id = -1,
       const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
-      long style = 0, const wxString &name = "listctrl" );
+      long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
+       const wxString &name = "listctrl" );
     void OnSize( wxSizeEvent &event );
     bool GetColumn( int col, wxListItem& item );
     bool SetColumn( int col, wxListItem& item );
index 50556991dcef5719f02f0dfd7010dde250a64eb7..a70b32ae2ad660e4016b6dfdf8619614d6ba12a4 100644 (file)
@@ -280,6 +280,7 @@ public:
   bool                 m_hasVMT;
   bool                 m_sizeSet;
   bool                 m_resizing;
+  GdkGC               *m_scrollGC;
 
 public:
 
index 50556991dcef5719f02f0dfd7010dde250a64eb7..a70b32ae2ad660e4016b6dfdf8619614d6ba12a4 100644 (file)
@@ -280,6 +280,7 @@ public:
   bool                 m_hasVMT;
   bool                 m_sizeSet;
   bool                 m_resizing;
+  GdkGC               *m_scrollGC;
 
 public:
 
index 957a697493c52214b3b6608f1315a4c4a5f0fecc..ed022c17cef3b50b9a4a35da09313cc39653dc89 100644 (file)
@@ -2111,21 +2111,14 @@ wxListCtrl::wxListCtrl(void)
   m_imageListState = (wxImageList *) NULL;
 }
 
-wxListCtrl::wxListCtrl( wxWindow *parent, wxWindowID id, 
-      const wxPoint &pos, const wxSize &size,
-      long style, const wxString &name )
-
-{
-  Create( parent, id, pos, size, style, name );
-}
-
 wxListCtrl::~wxListCtrl(void)
 {
 }
 
 bool wxListCtrl::Create( wxWindow *parent, wxWindowID id, 
       const wxPoint &pos, const wxSize &size,
-      long style, const wxString &name )
+      long style, const wxValidator &validator, 
+      const wxString &name )
 {
   m_imageListNormal = (wxImageList *) NULL;
   m_imageListSmall = (wxImageList *) NULL;
@@ -2140,6 +2133,8 @@ bool wxListCtrl::Create( wxWindow *parent, wxWindowID id,
   
   bool ret = wxControl::Create( parent, id, pos, size, s, name );
   
+  SetValidator( validator );
+  
   m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, s );
   
   if (GetWindowStyleFlag() & wxLC_REPORT)
index 52949c26ea41c352234afafc308a9203d3345175..e101decc7d30ed3ebd1274d3abde90fa3e89b2d8 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        accel.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:
+// Id:          $id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index d65cff17cf4185f0a326c03b8edaa4284db67bd6..f51c92ff70b5cde5de6ec7a15ba0471bdcd92de7 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        app.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling, Julian Smart
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index fbb256de87b16597fbbb798dc1a141086ce93cb1..2f1d7475585a222ace089436ea0bcac131e3f535 100644 (file)
@@ -135,7 +135,10 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
 
   m_title = title;
 
-  m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+  GtkWindowType win_type = GTK_WINDOW_TOPLEVEL;
+  if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP;
+  
+  m_widget = gtk_window_new( win_type );
   if ((size.x != -1) && (size.y != -1))
     gtk_widget_set_usize( m_widget, m_width, m_height );
   if ((pos.x != -1) && (pos.y != -1))
index 7bf133ec47b3b53c81b8eff35166600f161e2633..4852879086a200f51c3acca5822c08f870a2c06e 100644 (file)
@@ -31,13 +31,9 @@ wxMenuBar::wxMenuBar()
 
   m_menus.DeleteContents( TRUE );
 
-  m_widget = gtk_handle_box_new();
-
   m_menubar = gtk_menu_bar_new();
-
-  gtk_container_add( GTK_CONTAINER(m_widget), m_menubar );
-
-  gtk_widget_show( m_menubar );
+  
+  m_widget = GTK_WIDGET(m_menubar);
 
   PostCreation();
 
index 491eea3cd268d64d4630e451e79ccb1357d90e0e..5af767a335151ac35751169244a838bc2e223412 100644 (file)
@@ -2,9 +2,7 @@
 // Name:        tbargtk.cpp
 // Purpose:     GTK toolbar
 // Author:      Robert Roebling
-// Modified by:
-// Created:     01/02/97
-// RCS-ID:
+// RCS-ID:      $Id$
 // Copyright:   (c) Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -113,15 +111,12 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
 
   m_tools.DeleteContents( TRUE );
 
-  m_widget = gtk_handle_box_new();
-
   m_toolbar = GTK_TOOLBAR( gtk_toolbar_new( GTK_ORIENTATION_HORIZONTAL,
                                             GTK_TOOLBAR_ICONS ) );
-  gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
 
-  gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_toolbar) );
-
-  gtk_widget_show( GTK_WIDGET(m_toolbar) );
+  m_widget = GTK_WIDGET(m_toolbar);                                        
+                                           
+  gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
 
   PostCreation();
 
@@ -209,12 +204,6 @@ wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap,
                       (gpointer)tool
                      );
 
-  // VZ: we don't want GDK_NO_EXPOSE events because for some reason our
-  // toolbar buttons get them (it doesn't happen in a standalone GTK+ program
-  // for unknown reasons) and it prevents tooltips from appearing.
-  gtk_widget_set_events( GTK_WIDGET(item),
-                         gtk_widget_get_events( GTK_WIDGET(item) ) &
-                         ~GDK_EXPOSURE_MASK);
   tool->m_item = item;
 
   gtk_signal_connect( GTK_OBJECT(tool->m_item),
index eb9b9dcb84cdf03e0f19737bbdc3bd55a2d2b806..f220749ead717a3c0817dab5a3581f812ef2c2f4 100644 (file)
@@ -913,6 +913,7 @@ wxWindow::wxWindow()
   m_pDropTarget = (wxDropTarget *) NULL;
   m_resizing = FALSE;
   m_hasOwnStyle = FALSE;
+  m_scrollGC = (GdkGC*) NULL;
 }
 
 bool wxWindow::Create( wxWindow *parent, wxWindowID id,
@@ -982,7 +983,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
 
   m_wxwindow = gtk_myfixed_new();
 
-  if (m_wxwindow) GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
+  GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
 
   if (m_windowStyle & wxTAB_TRAVERSAL == wxTAB_TRAVERSAL)
     GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
@@ -1014,7 +1015,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
   gtk_widget_show( m_wxwindow );
 
   PostCreation();
-
+  
   Show( TRUE );
 
   return TRUE;
@@ -1031,6 +1032,8 @@ wxWindow::~wxWindow()
 
   DestroyChildren();
 
+  if (m_scrollGC) gdk_gc_unref( m_scrollGC );
+    
   if (m_wxwindow) gtk_widget_destroy( m_wxwindow );
 
   if (m_widget) gtk_widget_destroy( m_widget );
@@ -1129,11 +1132,7 @@ void wxWindow::PostCreation()
 
   if (m_widget && m_parent) gtk_widget_realize( m_widget );
 
-  if (m_wxwindow)
-  {
-    gtk_widget_realize( m_wxwindow );
-    gdk_gc_set_exposures( m_wxwindow->style->fg_gc[0], TRUE );
-  }
+  if (m_wxwindow) gtk_widget_realize( m_wxwindow );
 
   SetCursor( *wxSTANDARD_CURSOR );
 
@@ -2430,7 +2429,14 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
     int d_y = 0;
     if (dx > 0) d_x = dx;
     if (dy > 0) d_y = dy;
-    gdk_window_copy_area( m_wxwindow->window, m_wxwindow->style->fg_gc[0], d_x, d_y,
+    
+    if (!m_scrollGC)
+    {
+      m_scrollGC = gdk_gc_new( m_wxwindow->window );
+      gdk_gc_set_exposures( m_scrollGC, TRUE );
+    }
+    
+    gdk_window_copy_area( m_wxwindow->window, m_scrollGC, d_x, d_y,
       m_wxwindow->window, s_x, s_y, w, h );
 
     wxRect rect;
index 52949c26ea41c352234afafc308a9203d3345175..e101decc7d30ed3ebd1274d3abde90fa3e89b2d8 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        accel.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:
+// Id:          $id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index d65cff17cf4185f0a326c03b8edaa4284db67bd6..f51c92ff70b5cde5de6ec7a15ba0471bdcd92de7 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        app.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling, Julian Smart
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index fbb256de87b16597fbbb798dc1a141086ce93cb1..2f1d7475585a222ace089436ea0bcac131e3f535 100644 (file)
@@ -135,7 +135,10 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
 
   m_title = title;
 
-  m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+  GtkWindowType win_type = GTK_WINDOW_TOPLEVEL;
+  if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP;
+  
+  m_widget = gtk_window_new( win_type );
   if ((size.x != -1) && (size.y != -1))
     gtk_widget_set_usize( m_widget, m_width, m_height );
   if ((pos.x != -1) && (pos.y != -1))
index 7bf133ec47b3b53c81b8eff35166600f161e2633..4852879086a200f51c3acca5822c08f870a2c06e 100644 (file)
@@ -31,13 +31,9 @@ wxMenuBar::wxMenuBar()
 
   m_menus.DeleteContents( TRUE );
 
-  m_widget = gtk_handle_box_new();
-
   m_menubar = gtk_menu_bar_new();
-
-  gtk_container_add( GTK_CONTAINER(m_widget), m_menubar );
-
-  gtk_widget_show( m_menubar );
+  
+  m_widget = GTK_WIDGET(m_menubar);
 
   PostCreation();
 
index 491eea3cd268d64d4630e451e79ccb1357d90e0e..5af767a335151ac35751169244a838bc2e223412 100644 (file)
@@ -2,9 +2,7 @@
 // Name:        tbargtk.cpp
 // Purpose:     GTK toolbar
 // Author:      Robert Roebling
-// Modified by:
-// Created:     01/02/97
-// RCS-ID:
+// RCS-ID:      $Id$
 // Copyright:   (c) Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -113,15 +111,12 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
 
   m_tools.DeleteContents( TRUE );
 
-  m_widget = gtk_handle_box_new();
-
   m_toolbar = GTK_TOOLBAR( gtk_toolbar_new( GTK_ORIENTATION_HORIZONTAL,
                                             GTK_TOOLBAR_ICONS ) );
-  gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
 
-  gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_toolbar) );
-
-  gtk_widget_show( GTK_WIDGET(m_toolbar) );
+  m_widget = GTK_WIDGET(m_toolbar);                                        
+                                           
+  gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
 
   PostCreation();
 
@@ -209,12 +204,6 @@ wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap,
                       (gpointer)tool
                      );
 
-  // VZ: we don't want GDK_NO_EXPOSE events because for some reason our
-  // toolbar buttons get them (it doesn't happen in a standalone GTK+ program
-  // for unknown reasons) and it prevents tooltips from appearing.
-  gtk_widget_set_events( GTK_WIDGET(item),
-                         gtk_widget_get_events( GTK_WIDGET(item) ) &
-                         ~GDK_EXPOSURE_MASK);
   tool->m_item = item;
 
   gtk_signal_connect( GTK_OBJECT(tool->m_item),
index eb9b9dcb84cdf03e0f19737bbdc3bd55a2d2b806..f220749ead717a3c0817dab5a3581f812ef2c2f4 100644 (file)
@@ -913,6 +913,7 @@ wxWindow::wxWindow()
   m_pDropTarget = (wxDropTarget *) NULL;
   m_resizing = FALSE;
   m_hasOwnStyle = FALSE;
+  m_scrollGC = (GdkGC*) NULL;
 }
 
 bool wxWindow::Create( wxWindow *parent, wxWindowID id,
@@ -982,7 +983,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
 
   m_wxwindow = gtk_myfixed_new();
 
-  if (m_wxwindow) GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
+  GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
 
   if (m_windowStyle & wxTAB_TRAVERSAL == wxTAB_TRAVERSAL)
     GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
@@ -1014,7 +1015,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
   gtk_widget_show( m_wxwindow );
 
   PostCreation();
-
+  
   Show( TRUE );
 
   return TRUE;
@@ -1031,6 +1032,8 @@ wxWindow::~wxWindow()
 
   DestroyChildren();
 
+  if (m_scrollGC) gdk_gc_unref( m_scrollGC );
+    
   if (m_wxwindow) gtk_widget_destroy( m_wxwindow );
 
   if (m_widget) gtk_widget_destroy( m_widget );
@@ -1129,11 +1132,7 @@ void wxWindow::PostCreation()
 
   if (m_widget && m_parent) gtk_widget_realize( m_widget );
 
-  if (m_wxwindow)
-  {
-    gtk_widget_realize( m_wxwindow );
-    gdk_gc_set_exposures( m_wxwindow->style->fg_gc[0], TRUE );
-  }
+  if (m_wxwindow) gtk_widget_realize( m_wxwindow );
 
   SetCursor( *wxSTANDARD_CURSOR );
 
@@ -2430,7 +2429,14 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
     int d_y = 0;
     if (dx > 0) d_x = dx;
     if (dy > 0) d_y = dy;
-    gdk_window_copy_area( m_wxwindow->window, m_wxwindow->style->fg_gc[0], d_x, d_y,
+    
+    if (!m_scrollGC)
+    {
+      m_scrollGC = gdk_gc_new( m_wxwindow->window );
+      gdk_gc_set_exposures( m_scrollGC, TRUE );
+    }
+    
+    gdk_window_copy_area( m_wxwindow->window, m_scrollGC, d_x, d_y,
       m_wxwindow->window, s_x, s_y, w, h );
 
     wxRect rect;