]> git.saurik.com Git - wxWidgets.git/commitdiff
Small distrib updates,
authorRobert Roebling <robert@roebling.de>
Tue, 27 Jul 1999 20:23:13 +0000 (20:23 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 27 Jul 1999 20:23:13 +0000 (20:23 +0000)
  tried to find a bug in html which was somewhere else,
  added wxYield() call to wxBeginBusyCursor() which
    should make the cursor appear immediately,
  corrected wxMiniFrame so that clicking on the titlebar
    makes it come to the front
  Used CreateBase() in all controls

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

66 files changed:
docs/gtk/install.txt
docs/gtk/readme.txt
docs/motif2/install.txt
include/wx/gtk/window.h
include/wx/gtk1/window.h
include/wx/html/htmlcell.h
include/wx/html/htmldefs.h
include/wx/html/htmlfilter.h
include/wx/html/htmlhelp.h
src/gtk/bmpbuttn.cpp
src/gtk/button.cpp
src/gtk/checkbox.cpp
src/gtk/choice.cpp
src/gtk/combobox.cpp
src/gtk/cursor.cpp
src/gtk/dialog.cpp
src/gtk/filedlg.cpp
src/gtk/frame.cpp
src/gtk/gauge.cpp
src/gtk/listbox.cpp
src/gtk/mdi.cpp
src/gtk/menu.cpp
src/gtk/minifram.cpp
src/gtk/notebook.cpp
src/gtk/radiobox.cpp
src/gtk/radiobut.cpp
src/gtk/scrolbar.cpp
src/gtk/slider.cpp
src/gtk/spinbutt.cpp
src/gtk/statbmp.cpp
src/gtk/statbox.cpp
src/gtk/statline.cpp
src/gtk/stattext.cpp
src/gtk/tbargtk.cpp
src/gtk/textctrl.cpp
src/gtk/window.cpp
src/gtk1/bmpbuttn.cpp
src/gtk1/button.cpp
src/gtk1/checkbox.cpp
src/gtk1/choice.cpp
src/gtk1/combobox.cpp
src/gtk1/cursor.cpp
src/gtk1/dialog.cpp
src/gtk1/filedlg.cpp
src/gtk1/frame.cpp
src/gtk1/gauge.cpp
src/gtk1/listbox.cpp
src/gtk1/mdi.cpp
src/gtk1/menu.cpp
src/gtk1/minifram.cpp
src/gtk1/notebook.cpp
src/gtk1/radiobox.cpp
src/gtk1/radiobut.cpp
src/gtk1/scrolbar.cpp
src/gtk1/slider.cpp
src/gtk1/spinbutt.cpp
src/gtk1/statbmp.cpp
src/gtk1/statbox.cpp
src/gtk1/statline.cpp
src/gtk1/stattext.cpp
src/gtk1/tbargtk.cpp
src/gtk1/textctrl.cpp
src/gtk1/window.cpp
src/html/htmlcell.cpp
src/html/htmlfilter.cpp
src/html/htmlhelp.cpp

index cbc7f33ed8fa47db5a7f34d8acef5538d5e59d1e..091e743a969084c8d8d721d0402e8f375560ed78 100644 (file)
@@ -27,6 +27,15 @@ make install
 ldconfig
 exit
 
+You may also want to try to edit the wrongly created libtool script
+in your build directory, if you need shared libraries on Unix. The
+wrong entries are something like
+  archive_cmds="\$LD -shared ....
+  archive_expsym_cmds="\$LD -shared ....
+which should be something like
+  archive_cmds="\$CC -shared ....
+  archive_expsym_cmds="\$CC -shared ....
+
 If you want to remove wxWindows on Unix you can do this:
 
 su <type root password>
index 3d7eeeebefe52559e446841b6d534708cb705bd7..4cb90c7518c1e74663cd00683c6fe37b28e5cada 100644 (file)
@@ -26,7 +26,8 @@ at Julian Smart's homepage at:
   
 Information on how to install can be found in the file 
 INSTALL.txt, but if you cannot wait, this should work on
-many systems (when using GTK 1.0 read the INSTALL.txt):
+many systems (when using GTK 1.0 or when not using Linux
+read the INSTALL.txt):
 
 ./configure
 make
index fce5b0210902416e64e7eb2c450423847a1681d3..ecd1befffd8efbc018ec559064ca3b339085e2a0 100644 (file)
@@ -16,6 +16,26 @@ make install
 ldconfig
 exit
 
+On all other Unices (maybe except *BSD), shared libraries are not supported
+out of the box due to the utter stupidity of libtool, so you'll have to do
+this instead:
+
+./configure --enable-static --disable-shared
+make
+su <type root password>
+make install
+ldconfig
+exit
+
+You may also want to try to edit the wrongly created libtool script
+in your build directory, if you need shared libraries on Unix. The
+wrong entries are something like
+  archive_cmds="\$LD -shared ....
+  archive_expsym_cmds="\$LD -shared ....
+which should be something like
+  archive_cmds="\$CC -shared ....
+  archive_expsym_cmds="\$CC -shared ....
+
 If you want to remove wxWindows on Unix you can do this:
 
 su <type root password>
index fbbc2b18c12c42d5f7ea4cef491e55cef0189472..63d0569d6f43d60d015639f8fd6e77348bb5e114 100644 (file)
@@ -120,9 +120,8 @@ public:
     /* For compatibility across platforms (not in event table) */
     void OnIdle(wxIdleEvent& WXUNUSED(event)) {};
 
-    /* used by all classes in the widget creation process */
-    void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
-            const wxSize &size, long style, const wxString &name );
+    /* used by all window classes in the widget creation process */
+    bool PreCreation( wxWindow *parent, const wxPoint &pos, const wxSize &size );
     void PostCreation();
 
     /* internal addition of child windows. differs from class
index fbbc2b18c12c42d5f7ea4cef491e55cef0189472..63d0569d6f43d60d015639f8fd6e77348bb5e114 100644 (file)
@@ -120,9 +120,8 @@ public:
     /* For compatibility across platforms (not in event table) */
     void OnIdle(wxIdleEvent& WXUNUSED(event)) {};
 
-    /* used by all classes in the widget creation process */
-    void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
-            const wxSize &size, long style, const wxString &name );
+    /* used by all window classes in the widget creation process */
+    bool PreCreation( wxWindow *parent, const wxPoint &pos, const wxSize &size );
     void PostCreation();
 
     /* internal addition of child windows. differs from class
index 23293c93b05146a212cc0d68311f0546c6fa8d46..87a3e040d76a678e7f24f36fe17dbbec5166da51 100644 (file)
 #define __HTMLCELL_H__
 
 #ifdef __GNUG__
-#pragma interface
+#pragma interface "htmlcell.h"
 #endif
 
 #include "wx/defs.h"
-#if wxUSE_HTML
 
+#if wxUSE_HTML
 
-#include <wx/html/htmltag.h>
-#include <wx/html/htmldefs.h>
-#include <wx/window.h>
+#include "wx/html/htmltag.h"
+#include "wx/html/htmldefs.h"
+#include "wx/window.h"
 
 class wxHtmlCell;
 class wxHtmlContainerCell;
index 9db261d0897ac9d35de9cd6838d79ad682a30e3e..955b4456fdb3f3986430c0f54d81724d1d404dff 100644 (file)
@@ -11,8 +11,8 @@
 #define __HTMLDEFS_H__
 
 #include "wx/defs.h"
-#if wxUSE_HTML
 
+#if wxUSE_HTML
 
 //--------------------------------------------------------------------------------
 // ALIGNMENTS
index 19c31b9209ef382712f49a67074b6afadfaf3e7d..100b31d8b501e9b0acb1c445ae0428c77b2a713b 100644 (file)
 #define __HTMLFILTER_H__
 
 #ifdef __GNUG__
-#pragma interface
+#pragma interface "htmlfilter.h"
 #endif
 
 #include "wx/defs.h"
+
 #if wxUSE_HTML
 
-#include <wx/filesys.h>
+#include "wx/filesys.h"
 
 
 //--------------------------------------------------------------------------------
index 6e56bc5815a81d493747763bcc986a264e9f649b..509e363c675473391695ece132d8fa87ac5c0baf 100644 (file)
 #define __HTMLHELP_H__
 
 #ifdef __GNUG__
-#pragma interface
+#pragma interface "htmlhelp.h"
 #endif
 
 #include "wx/defs.h"
+
 #if wxUSE_HTML
 
-#include <wx/window.h>
-#include <wx/config.h>
-#include <wx/splitter.h>
-#include <wx/notebook.h>
-#include <wx/listctrl.h>
-#include <wx/html/htmlwin.h>
+#include "wx/window.h"
+#include "wx/config.h"
+#include "wx/splitter.h"
+#include "wx/notebook.h"
+#include "wx/listctrl.h"
+#include "wx/html/htmlwin.h"
 
 
 
index 7bfc477e35f54819d4a66952fbe8d6eae66f1ef9..71975f8af92609db8bb0750db71b830c8d7174a5 100644 (file)
@@ -118,13 +118,12 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
   
-    wxSize newSize = size;
-
-    PreCreation( parent, id, pos, newSize, style, name );
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxBitmapButton creation failed") );
+       return FALSE;
+    }
 
     m_bitmap   = bitmap;
     m_disabled = bitmap;
@@ -142,6 +141,8 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
 
     if (m_bitmap.Ok())
     {
+        wxSize newSize = size;
+
         GdkBitmap *mask = (GdkBitmap *) NULL;
         if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap();
         GtkWidget *pixmap = gtk_pixmap_new( m_bitmap.GetPixmap(), mask );
index ad9b36f8daa54dab65c79a1256feaccd51e9b156..dc7dd01c5919bfdda9081db51e2035542d5747ae 100644 (file)
@@ -75,13 +75,13 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    wxSize newSize = size;
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxButton creation failed") );
+       return FALSE;
+    }
 
-    PreCreation( parent, id, pos, newSize, style, name );
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif // wxUSE_VALIDATORS
 
     m_widget = gtk_button_new_with_label( "" );
     
@@ -92,6 +92,7 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
 
     SetLabel(label);
 
+    wxSize newSize = size;
     if (newSize.x == -1) newSize.x = 15+gdk_string_measure( m_widget->style->font, label.mbc_str() );
     if (newSize.y == -1) newSize.y = 26;
     SetSize( newSize.x, newSize.y );
index 75cf233c65d5abd240121ddd41a4aacf00bfc677..af1d2592c3af9ad5472acf80fbb002d5c74e898d 100644 (file)
@@ -72,11 +72,12 @@ bool wxCheckBox::Create(wxWindow *parent,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
-
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxCheckBox creation failed") );
+       return FALSE;
+    }
 
     wxControl::SetLabel( label );
 
index f8801312bdc13da864966d3ea51dc2e9773b1ad1..ae4a6e9fcef1658468b4239bd92eec2c327291d4 100644 (file)
@@ -38,7 +38,8 @@ extern bool   g_blockEventsOnDrag;
 
 static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *choice )
 {
-    if (g_isIdle) wxapp_install_idle_handler();
+    if (g_isIdle) 
+      wxapp_install_idle_handler();
 
     if (!choice->m_hasVMT) return;
 
@@ -71,11 +72,12 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
     m_acceptsFocus = TRUE;
 #endif
 
-    PreCreation( parent, id, pos, size, style, name );
-
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxChoice creation failed") );
+       return FALSE;
+    }
 
     m_widget = gtk_option_menu_new();
 
index 102ce9b22407b0d01ea54b17f5d21bad48ac5181..da4657688f83f108453de64b3bc3215a16275d99 100644 (file)
@@ -101,11 +101,12 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
-
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxComboBox creation failed") );
+       return FALSE;
+    }
 
     m_widget = gtk_combo_new();
 
index 9335e8c8372fff2291bdcb765a86a9eb49789271..4876e3f8d3fa12d0334a90f38cc8e1626111c423 100644 (file)
@@ -13,6 +13,7 @@
 #endif
 
 #include "wx/cursor.h"
+#include "wx/utils.h"
 
 #include "gdk/gdk.h"
 
@@ -170,6 +171,8 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )
     gs_savedCursor = g_globalCursor;
     
     wxSetCursor( wxCursor(wxCURSOR_WATCH) );
+    
+    wxYield();
 }
 
 bool wxIsBusy()
index fe199dd6de1edf8a47df420f7390e3c30e506be3..bed7d500ffc0419620660708ec89ddf1189231af 100644 (file)
@@ -248,7 +248,12 @@ bool wxDialog::Create( wxWindow *parent,
 
     m_needParent = FALSE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxDialog creation failed") );
+       return FALSE;
+    }
 
     m_insertCallback = (wxInsertChildFunction) wxInsertChildInDialog;
     
index 086a593ef5c586f71864efcd15969c33cd58980d..f2c2c99011a08316a906fbfc4a4bc8152553b35e 100644 (file)
@@ -116,7 +116,13 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
 {
     m_needParent = FALSE;
 
-    PreCreation( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, "filedialog" );
+    if (!PreCreation( parent, pos, wxDefaultSize ) ||
+        !CreateBase( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, wxDefaultValidator, _T("filedialog") ))
+    {
+        wxFAIL_MSG( _T("wxXX creation failed") );
+       return;
+    }
+    
     m_message = message;
     m_path = _T("");
     m_fileName = defaultFileName;
index c0ebd7fe34b48b409a81619ed16aa16ea9880a0a..78247575e79beb37aa4dd13c79b270fe0eaa4dae 100644 (file)
@@ -224,7 +224,6 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
        decor |= GDK_DECOR_RESIZEH;
     }
 
-
     gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
     gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);
 
@@ -361,7 +360,12 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
 
     m_needParent = FALSE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxFrame creation failed") );
+       return FALSE;
+    }
 
     m_title = title;
 
index e176cbe194d8a5bbffe1a02c1c63c44a426f847a..35d9ad6f378f4afb743e0addb9c281468ae6fcc8 100644 (file)
@@ -28,59 +28,60 @@ bool wxGauge::Create( wxWindow *parent, wxWindowID id,  int range,
     const wxPoint& pos, const wxSize& size,
     long style, const wxValidator& validator, const wxString& name )
 {
-  m_needParent = TRUE;
+    m_needParent = TRUE;
   
-  PreCreation( parent, id, pos, size, style, name );
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxGauge creation failed") );
+       return FALSE;
+    }
 
-  m_rangeMax = range;
-  m_gaugePos = 0;
-  m_useProgressBar = TRUE;
+    m_rangeMax = range;
+    m_gaugePos = 0;
+    m_useProgressBar = TRUE;
   
-  m_widget = gtk_progress_bar_new();
+    m_widget = gtk_progress_bar_new();
   
-  m_parent->DoAddChild( this );
+    m_parent->DoAddChild( this );
   
-  PostCreation();
+    PostCreation();
   
-  Show( TRUE );
+    Show( TRUE );
     
-  return TRUE;
+    return TRUE;
 }
 
 void wxGauge::SetRange( int r )
 {
-  m_rangeMax = r;
-  if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
+    m_rangeMax = r;
+    if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
   
-  gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
+    gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
 }
 
 void wxGauge::SetValue( int pos )
 {
-  m_gaugePos = pos;
-  if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
+    m_gaugePos = pos;
+    if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
   
-  gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
+    gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
 }
 
-int wxGauge::GetRange(void) const
+int wxGauge::GetRange() const
 {
-  return m_rangeMax;
+    return m_rangeMax;
 }
 
-int wxGauge::GetValue(void) const
+int wxGauge::GetValue() const
 {
-  return m_gaugePos;
+    return m_gaugePos;
 }
 
 void wxGauge::ApplyWidgetStyle()
 {
-  SetWidgetStyle();
-  gtk_widget_set_style( m_widget, m_widgetStyle );
+    SetWidgetStyle();
+    gtk_widget_set_style( m_widget, m_widgetStyle );
 }
 
 #endif
index 0b62dcb261a6ba7079a93a8dfb900e43c33a7afa..d99c53a4b5cab006589c7f58b69f957267d4acff 100644 (file)
@@ -244,11 +244,12 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
-
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxListBox creation failed") );
+       return FALSE;
+    }
 
     m_widget = gtk_scrolled_window_new( (GtkAdjustment*) NULL, (GtkAdjustment*) NULL );
     if (style & wxLB_ALWAYS_SB)
index 13c558712add7d5d45eff07f9608cb0fe0abe48d..0b98599d59e20200bcb05c71852cb303986a2af3 100644 (file)
@@ -409,7 +409,12 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
 
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
 
-    PreCreation( parent, -1, wxPoint(10,10), wxSize(100,100), style, "wxMDIClientWindow" );
+    if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
+        !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("wxMDIClientWindow") ))
+    {
+        wxFAIL_MSG( _T("wxMDIClientWindow creation failed") );
+       return FALSE;
+    }
 
     m_widget = gtk_notebook_new();
 
index 64c2b57e440be933c59920fbaa41bf5105056b56..b41ead44f43df73fe0b63816993e8e7b9aaa2cf5 100644 (file)
@@ -39,7 +39,12 @@ wxMenuBar::wxMenuBar( long style )
     m_needParent = FALSE;
     m_style = style;
 
-    PreCreation( (wxWindow *) NULL, -1, wxDefaultPosition, wxDefaultSize, style, "menu" );
+    if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) ||
+        !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("menubar") ))
+    {
+        wxFAIL_MSG( _T("wxMenuBar creation failed") );
+       return;
+    }
 
     m_menus.DeleteContents( TRUE );
 
@@ -72,8 +77,13 @@ wxMenuBar::wxMenuBar()
     m_needParent = FALSE;
     m_style = 0;
 
-    PreCreation( (wxWindow *) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, "menu" );
-
+    if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) ||
+        !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("menubar") ))
+    {
+        wxFAIL_MSG( _T("wxMenuBar creation failed") );
+       return;
+    }
+    
     m_menus.DeleteContents( TRUE );
 
     /* GTK 1.2.0 doesn't have gtk_item_factory_get_item(), but GTK 1.2.1 has. */
index ee93f8546cc811b76b80411eb69b59a82d3a4021..9da9393c89f83f676204cbe20f67b835ff026f4f 100644 (file)
@@ -163,6 +163,8 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 
     if (win->m_isDragging) return TRUE;
 
+    gdk_window_raise( win->m_widget->window );
+    
     gdk_pointer_grab( widget->window, FALSE,
                       (GdkEventMask)
                          (GDK_BUTTON_PRESS_MASK |
index 6102168a49b792ab0f3782b6c561837224f36a6c..6cac1f91355ca2468e0ab0bfe18f23ee4e421403 100644 (file)
@@ -220,7 +220,13 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
     m_acceptsFocus = TRUE;
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxNoteBook creation failed") );
+       return FALSE;
+    }
+
 
     m_widget = gtk_notebook_new();
 
index e1977ab2a4fbc6494c796b3e03378cdc6ba9710a..5328d1565d88f02905e80f01fbec69f20faf860a 100644 (file)
@@ -85,11 +85,12 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
-
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxRadioBox creation failed") );
+       return FALSE;
+    }
 
     m_widget = gtk_frame_new( title.mbc_str() );
 
index 35508850609680742173ac2ffc071f934fe70418..f7771f4ea6bbdf19bd8703b8f34a83d5e9bc97b0 100644 (file)
@@ -63,17 +63,14 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
 {
     m_acceptsFocus = TRUE;
     m_needParent = TRUE;
-
-    wxSize newSize = size;
-
-    PreCreation( parent, id, pos, newSize, style, name );
-    
     m_isRadioButton = TRUE;
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
 
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxRadioButton creation failed") );
+       return FALSE;
+    }
 
     if (HasFlag(wxRB_GROUP))
     {
@@ -111,6 +108,7 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
       
     SetLabel(label);
 
+    wxSize newSize = size;
     if (newSize.x == -1) newSize.x = 22+gdk_string_measure( m_widget->style->font, label.mbc_str() );
     if (newSize.y == -1) newSize.y = 26;
     SetSize( newSize.x, newSize.y );
index a2f96c9a3322cfa71e4cce8fc0770b9aaaba2ca6..56cc1d6d5830045d23c8bdecf157f491de83ed05 100644 (file)
@@ -137,11 +137,12 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
   
-    PreCreation( parent, id, pos, size, style, name );
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxScrollBar creation failed") );
+       return FALSE;
+    }
 
     m_oldPos = 0.0;
 
index b2f0bccefc943a4d70b29db19fc091a39566ee89..5d115ba3b87651642e5bc06a620f8110a31d909a 100644 (file)
@@ -98,11 +98,12 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
     m_acceptsFocus = TRUE;
     m_needParent = TRUE;
   
-    PreCreation( parent, id, pos, size, style, name );
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxSlider creation failed") );
+       return FALSE;
+    }
 
     m_oldPos = 0.0;
 
index 4847cc4de5b6f0a2e096479e92fc8d738b265b4d..31a244d6c3a8b62cd20faa427f75b1e2e67d1472 100644 (file)
@@ -98,9 +98,12 @@ bool wxSpinButton::Create(wxWindow *parent,
     if (new_size.y == -1)
         new_size.y = 30;
 
-    PreCreation( parent, id, pos, new_size, style, name );
-
-//  SetValidator( validator );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxXX creation failed") );
+       return FALSE;
+    }
 
     m_oldPos = 0.0;
 
index e46ae8134d89d68019ecf6d159a48d7c5195a18a..f9e6700b8fead69f0477515021ff53e7f8b186c6 100644 (file)
@@ -58,14 +58,19 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
 {
     m_needParent = TRUE;
 
-    wxSize newSize = size;
-
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxXX creation failed") );
+       return FALSE;
+    }
 
     m_bitmap = bitmap;
 
     if (m_bitmap.Ok())
     {
+       wxSize newSize = size;
+
         GdkBitmap *mask = (GdkBitmap *) NULL;
         if ( m_bitmap.GetMask() )
             mask = m_bitmap.GetMask()->GetBitmap();
index 84fd9673ffdb062ef414a56c3d7b72173f728d18..d39006cda7c1591074c0fbf1d62c72cac8aa3079 100644 (file)
@@ -41,7 +41,12 @@ bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label
 {
     m_needParent = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxStaticBox creation failed") );
+       return FALSE;
+    }
 
     m_isStaticBox = TRUE;
     
index 98bb5f04b5c3225cea85e54f7e69f5273ddc5a4a..fda6826dc69b8de5d2bd1688392cd5b5248e568d 100644 (file)
@@ -41,7 +41,12 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id,
 {
     m_needParent = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxStaticLine creation failed") );
+       return FALSE;
+    }
 
     if ( IsVertical() )
         m_widget = gtk_vseparator_new();
index 194fb3da086e2044c8c1b2dbd270160426efd3d6..c0c6dd3e5fa41d7a814ba09138fe650a8d4d0811 100644 (file)
@@ -48,9 +48,12 @@ bool wxStaticText::Create(wxWindow *parent,
 {
     m_needParent = TRUE;
 
-    wxSize newSize = size;
-
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxXX creation failed") );
+       return FALSE;
+    }
 
     // notice that we call the base class version which will just remove the
     // '&' characters from the string, but not set the label's text to it
@@ -77,9 +80,9 @@ bool wxStaticText::Create(wxWindow *parent,
     GtkRequisition req;
     (* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
 
+    wxSize newSize = size;
     if (newSize.x == -1) newSize.x = req.width;
     if (newSize.y == -1) newSize.y = req.height;
-
     SetSize( newSize.x, newSize.y );
 
     m_parent->DoAddChild( this );
index 0a92bc7c371e2664569acdf540b4c09e90e6453e..0f90b72a744d05b447935a8dd19d32b6f82c13cf 100644 (file)
@@ -147,7 +147,12 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
 {
     m_needParent = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxToolBar creation failed") );
+       return FALSE;
+    }
 
     m_tools.DeleteContents( TRUE );
 
index ccb6dce12bcbae5bc5115662c08440c7565dfa58..04809dc1931a3779e3d6896874dea17ab5790a73 100644 (file)
@@ -114,11 +114,13 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxTextCtrl creation failed") );
+       return FALSE;
+    }
 
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif // wxUSE_VALIDATORS
 
     m_vScrollbarVisible = FALSE;
 
index a2d7b7536fcfbeacc016cdc52daf455a7ad37793..bfdc8bcc81d78c1a89a15e77313428a6cf5e7844 100644 (file)
@@ -1821,7 +1821,12 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
                        const wxPoint &pos, const wxSize &size,
                        long style, const wxString &name  )
 {
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxWindow creation failed") );
+       return FALSE;
+    }
 
     m_insertCallback = wxInsertChildInWindow;
 
@@ -2002,27 +2007,22 @@ wxWindow::~wxWindow()
     }
 }
 
-void wxWindow::PreCreation( wxWindow *parent,
-                            wxWindowID id,
-                            const wxPoint &pos,
-                            const wxSize &size,
-                            long style,
-                            const wxString &name )
+bool wxWindow::PreCreation( wxWindow *parent, const wxPoint &pos,  const wxSize &size )
 {
-    wxASSERT_MSG( !m_needParent || parent, _T("Need complete parent.") );
-
-    if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
-    {
-        wxFAIL_MSG(_T("window creation failed"));
-    }
+    wxCHECK_MSG( !m_needParent || parent, FALSE, _T("Need complete parent.") );
 
+    /* this turns -1 into 20 so that a minimal window is
+       visible even although -1,-1 has been given as the
+       size of the window. the same trick is used in other
+       ports and should make debugging easier */
     m_width = WidthDefault(size.x);
     m_height = HeightDefault(size.y);
 
     m_x = (int)pos.x;
     m_y = (int)pos.y;
 
-    if (!parent)  /* some reasonable defaults */
+    /* some reasonable defaults */
+    if (!parent)  
     {
         if (m_x == -1)
         {
@@ -2035,6 +2035,8 @@ void wxWindow::PreCreation( wxWindow *parent,
             if (m_y < 10) m_y = 10;
         }
     }
+    
+    return TRUE;
 }
 
 void wxWindow::PostCreation()
index 7bfc477e35f54819d4a66952fbe8d6eae66f1ef9..71975f8af92609db8bb0750db71b830c8d7174a5 100644 (file)
@@ -118,13 +118,12 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
   
-    wxSize newSize = size;
-
-    PreCreation( parent, id, pos, newSize, style, name );
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxBitmapButton creation failed") );
+       return FALSE;
+    }
 
     m_bitmap   = bitmap;
     m_disabled = bitmap;
@@ -142,6 +141,8 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
 
     if (m_bitmap.Ok())
     {
+        wxSize newSize = size;
+
         GdkBitmap *mask = (GdkBitmap *) NULL;
         if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap();
         GtkWidget *pixmap = gtk_pixmap_new( m_bitmap.GetPixmap(), mask );
index ad9b36f8daa54dab65c79a1256feaccd51e9b156..dc7dd01c5919bfdda9081db51e2035542d5747ae 100644 (file)
@@ -75,13 +75,13 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    wxSize newSize = size;
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxButton creation failed") );
+       return FALSE;
+    }
 
-    PreCreation( parent, id, pos, newSize, style, name );
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif // wxUSE_VALIDATORS
 
     m_widget = gtk_button_new_with_label( "" );
     
@@ -92,6 +92,7 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
 
     SetLabel(label);
 
+    wxSize newSize = size;
     if (newSize.x == -1) newSize.x = 15+gdk_string_measure( m_widget->style->font, label.mbc_str() );
     if (newSize.y == -1) newSize.y = 26;
     SetSize( newSize.x, newSize.y );
index 75cf233c65d5abd240121ddd41a4aacf00bfc677..af1d2592c3af9ad5472acf80fbb002d5c74e898d 100644 (file)
@@ -72,11 +72,12 @@ bool wxCheckBox::Create(wxWindow *parent,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
-
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxCheckBox creation failed") );
+       return FALSE;
+    }
 
     wxControl::SetLabel( label );
 
index f8801312bdc13da864966d3ea51dc2e9773b1ad1..ae4a6e9fcef1658468b4239bd92eec2c327291d4 100644 (file)
@@ -38,7 +38,8 @@ extern bool   g_blockEventsOnDrag;
 
 static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *choice )
 {
-    if (g_isIdle) wxapp_install_idle_handler();
+    if (g_isIdle) 
+      wxapp_install_idle_handler();
 
     if (!choice->m_hasVMT) return;
 
@@ -71,11 +72,12 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
     m_acceptsFocus = TRUE;
 #endif
 
-    PreCreation( parent, id, pos, size, style, name );
-
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxChoice creation failed") );
+       return FALSE;
+    }
 
     m_widget = gtk_option_menu_new();
 
index 102ce9b22407b0d01ea54b17f5d21bad48ac5181..da4657688f83f108453de64b3bc3215a16275d99 100644 (file)
@@ -101,11 +101,12 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
-
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxComboBox creation failed") );
+       return FALSE;
+    }
 
     m_widget = gtk_combo_new();
 
index 9335e8c8372fff2291bdcb765a86a9eb49789271..4876e3f8d3fa12d0334a90f38cc8e1626111c423 100644 (file)
@@ -13,6 +13,7 @@
 #endif
 
 #include "wx/cursor.h"
+#include "wx/utils.h"
 
 #include "gdk/gdk.h"
 
@@ -170,6 +171,8 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )
     gs_savedCursor = g_globalCursor;
     
     wxSetCursor( wxCursor(wxCURSOR_WATCH) );
+    
+    wxYield();
 }
 
 bool wxIsBusy()
index fe199dd6de1edf8a47df420f7390e3c30e506be3..bed7d500ffc0419620660708ec89ddf1189231af 100644 (file)
@@ -248,7 +248,12 @@ bool wxDialog::Create( wxWindow *parent,
 
     m_needParent = FALSE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxDialog creation failed") );
+       return FALSE;
+    }
 
     m_insertCallback = (wxInsertChildFunction) wxInsertChildInDialog;
     
index 086a593ef5c586f71864efcd15969c33cd58980d..f2c2c99011a08316a906fbfc4a4bc8152553b35e 100644 (file)
@@ -116,7 +116,13 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
 {
     m_needParent = FALSE;
 
-    PreCreation( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, "filedialog" );
+    if (!PreCreation( parent, pos, wxDefaultSize ) ||
+        !CreateBase( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, wxDefaultValidator, _T("filedialog") ))
+    {
+        wxFAIL_MSG( _T("wxXX creation failed") );
+       return;
+    }
+    
     m_message = message;
     m_path = _T("");
     m_fileName = defaultFileName;
index c0ebd7fe34b48b409a81619ed16aa16ea9880a0a..78247575e79beb37aa4dd13c79b270fe0eaa4dae 100644 (file)
@@ -224,7 +224,6 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
        decor |= GDK_DECOR_RESIZEH;
     }
 
-
     gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
     gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);
 
@@ -361,7 +360,12 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
 
     m_needParent = FALSE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxFrame creation failed") );
+       return FALSE;
+    }
 
     m_title = title;
 
index e176cbe194d8a5bbffe1a02c1c63c44a426f847a..35d9ad6f378f4afb743e0addb9c281468ae6fcc8 100644 (file)
@@ -28,59 +28,60 @@ bool wxGauge::Create( wxWindow *parent, wxWindowID id,  int range,
     const wxPoint& pos, const wxSize& size,
     long style, const wxValidator& validator, const wxString& name )
 {
-  m_needParent = TRUE;
+    m_needParent = TRUE;
   
-  PreCreation( parent, id, pos, size, style, name );
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxGauge creation failed") );
+       return FALSE;
+    }
 
-  m_rangeMax = range;
-  m_gaugePos = 0;
-  m_useProgressBar = TRUE;
+    m_rangeMax = range;
+    m_gaugePos = 0;
+    m_useProgressBar = TRUE;
   
-  m_widget = gtk_progress_bar_new();
+    m_widget = gtk_progress_bar_new();
   
-  m_parent->DoAddChild( this );
+    m_parent->DoAddChild( this );
   
-  PostCreation();
+    PostCreation();
   
-  Show( TRUE );
+    Show( TRUE );
     
-  return TRUE;
+    return TRUE;
 }
 
 void wxGauge::SetRange( int r )
 {
-  m_rangeMax = r;
-  if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
+    m_rangeMax = r;
+    if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
   
-  gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
+    gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
 }
 
 void wxGauge::SetValue( int pos )
 {
-  m_gaugePos = pos;
-  if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
+    m_gaugePos = pos;
+    if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
   
-  gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
+    gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
 }
 
-int wxGauge::GetRange(void) const
+int wxGauge::GetRange() const
 {
-  return m_rangeMax;
+    return m_rangeMax;
 }
 
-int wxGauge::GetValue(void) const
+int wxGauge::GetValue() const
 {
-  return m_gaugePos;
+    return m_gaugePos;
 }
 
 void wxGauge::ApplyWidgetStyle()
 {
-  SetWidgetStyle();
-  gtk_widget_set_style( m_widget, m_widgetStyle );
+    SetWidgetStyle();
+    gtk_widget_set_style( m_widget, m_widgetStyle );
 }
 
 #endif
index 0b62dcb261a6ba7079a93a8dfb900e43c33a7afa..d99c53a4b5cab006589c7f58b69f957267d4acff 100644 (file)
@@ -244,11 +244,12 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
-
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxListBox creation failed") );
+       return FALSE;
+    }
 
     m_widget = gtk_scrolled_window_new( (GtkAdjustment*) NULL, (GtkAdjustment*) NULL );
     if (style & wxLB_ALWAYS_SB)
index 13c558712add7d5d45eff07f9608cb0fe0abe48d..0b98599d59e20200bcb05c71852cb303986a2af3 100644 (file)
@@ -409,7 +409,12 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
 
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
 
-    PreCreation( parent, -1, wxPoint(10,10), wxSize(100,100), style, "wxMDIClientWindow" );
+    if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
+        !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("wxMDIClientWindow") ))
+    {
+        wxFAIL_MSG( _T("wxMDIClientWindow creation failed") );
+       return FALSE;
+    }
 
     m_widget = gtk_notebook_new();
 
index 64c2b57e440be933c59920fbaa41bf5105056b56..b41ead44f43df73fe0b63816993e8e7b9aaa2cf5 100644 (file)
@@ -39,7 +39,12 @@ wxMenuBar::wxMenuBar( long style )
     m_needParent = FALSE;
     m_style = style;
 
-    PreCreation( (wxWindow *) NULL, -1, wxDefaultPosition, wxDefaultSize, style, "menu" );
+    if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) ||
+        !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("menubar") ))
+    {
+        wxFAIL_MSG( _T("wxMenuBar creation failed") );
+       return;
+    }
 
     m_menus.DeleteContents( TRUE );
 
@@ -72,8 +77,13 @@ wxMenuBar::wxMenuBar()
     m_needParent = FALSE;
     m_style = 0;
 
-    PreCreation( (wxWindow *) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, "menu" );
-
+    if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) ||
+        !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("menubar") ))
+    {
+        wxFAIL_MSG( _T("wxMenuBar creation failed") );
+       return;
+    }
+    
     m_menus.DeleteContents( TRUE );
 
     /* GTK 1.2.0 doesn't have gtk_item_factory_get_item(), but GTK 1.2.1 has. */
index ee93f8546cc811b76b80411eb69b59a82d3a4021..9da9393c89f83f676204cbe20f67b835ff026f4f 100644 (file)
@@ -163,6 +163,8 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 
     if (win->m_isDragging) return TRUE;
 
+    gdk_window_raise( win->m_widget->window );
+    
     gdk_pointer_grab( widget->window, FALSE,
                       (GdkEventMask)
                          (GDK_BUTTON_PRESS_MASK |
index 6102168a49b792ab0f3782b6c561837224f36a6c..6cac1f91355ca2468e0ab0bfe18f23ee4e421403 100644 (file)
@@ -220,7 +220,13 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
     m_acceptsFocus = TRUE;
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxNoteBook creation failed") );
+       return FALSE;
+    }
+
 
     m_widget = gtk_notebook_new();
 
index e1977ab2a4fbc6494c796b3e03378cdc6ba9710a..5328d1565d88f02905e80f01fbec69f20faf860a 100644 (file)
@@ -85,11 +85,12 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
-
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxRadioBox creation failed") );
+       return FALSE;
+    }
 
     m_widget = gtk_frame_new( title.mbc_str() );
 
index 35508850609680742173ac2ffc071f934fe70418..f7771f4ea6bbdf19bd8703b8f34a83d5e9bc97b0 100644 (file)
@@ -63,17 +63,14 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
 {
     m_acceptsFocus = TRUE;
     m_needParent = TRUE;
-
-    wxSize newSize = size;
-
-    PreCreation( parent, id, pos, newSize, style, name );
-    
     m_isRadioButton = TRUE;
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
 
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxRadioButton creation failed") );
+       return FALSE;
+    }
 
     if (HasFlag(wxRB_GROUP))
     {
@@ -111,6 +108,7 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
       
     SetLabel(label);
 
+    wxSize newSize = size;
     if (newSize.x == -1) newSize.x = 22+gdk_string_measure( m_widget->style->font, label.mbc_str() );
     if (newSize.y == -1) newSize.y = 26;
     SetSize( newSize.x, newSize.y );
index a2f96c9a3322cfa71e4cce8fc0770b9aaaba2ca6..56cc1d6d5830045d23c8bdecf157f491de83ed05 100644 (file)
@@ -137,11 +137,12 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
   
-    PreCreation( parent, id, pos, size, style, name );
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxScrollBar creation failed") );
+       return FALSE;
+    }
 
     m_oldPos = 0.0;
 
index b2f0bccefc943a4d70b29db19fc091a39566ee89..5d115ba3b87651642e5bc06a620f8110a31d909a 100644 (file)
@@ -98,11 +98,12 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
     m_acceptsFocus = TRUE;
     m_needParent = TRUE;
   
-    PreCreation( parent, id, pos, size, style, name );
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxSlider creation failed") );
+       return FALSE;
+    }
 
     m_oldPos = 0.0;
 
index 4847cc4de5b6f0a2e096479e92fc8d738b265b4d..31a244d6c3a8b62cd20faa427f75b1e2e67d1472 100644 (file)
@@ -98,9 +98,12 @@ bool wxSpinButton::Create(wxWindow *parent,
     if (new_size.y == -1)
         new_size.y = 30;
 
-    PreCreation( parent, id, pos, new_size, style, name );
-
-//  SetValidator( validator );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxXX creation failed") );
+       return FALSE;
+    }
 
     m_oldPos = 0.0;
 
index e46ae8134d89d68019ecf6d159a48d7c5195a18a..f9e6700b8fead69f0477515021ff53e7f8b186c6 100644 (file)
@@ -58,14 +58,19 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
 {
     m_needParent = TRUE;
 
-    wxSize newSize = size;
-
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxXX creation failed") );
+       return FALSE;
+    }
 
     m_bitmap = bitmap;
 
     if (m_bitmap.Ok())
     {
+       wxSize newSize = size;
+
         GdkBitmap *mask = (GdkBitmap *) NULL;
         if ( m_bitmap.GetMask() )
             mask = m_bitmap.GetMask()->GetBitmap();
index 84fd9673ffdb062ef414a56c3d7b72173f728d18..d39006cda7c1591074c0fbf1d62c72cac8aa3079 100644 (file)
@@ -41,7 +41,12 @@ bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label
 {
     m_needParent = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxStaticBox creation failed") );
+       return FALSE;
+    }
 
     m_isStaticBox = TRUE;
     
index 98bb5f04b5c3225cea85e54f7e69f5273ddc5a4a..fda6826dc69b8de5d2bd1688392cd5b5248e568d 100644 (file)
@@ -41,7 +41,12 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id,
 {
     m_needParent = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxStaticLine creation failed") );
+       return FALSE;
+    }
 
     if ( IsVertical() )
         m_widget = gtk_vseparator_new();
index 194fb3da086e2044c8c1b2dbd270160426efd3d6..c0c6dd3e5fa41d7a814ba09138fe650a8d4d0811 100644 (file)
@@ -48,9 +48,12 @@ bool wxStaticText::Create(wxWindow *parent,
 {
     m_needParent = TRUE;
 
-    wxSize newSize = size;
-
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxXX creation failed") );
+       return FALSE;
+    }
 
     // notice that we call the base class version which will just remove the
     // '&' characters from the string, but not set the label's text to it
@@ -77,9 +80,9 @@ bool wxStaticText::Create(wxWindow *parent,
     GtkRequisition req;
     (* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
 
+    wxSize newSize = size;
     if (newSize.x == -1) newSize.x = req.width;
     if (newSize.y == -1) newSize.y = req.height;
-
     SetSize( newSize.x, newSize.y );
 
     m_parent->DoAddChild( this );
index 0a92bc7c371e2664569acdf540b4c09e90e6453e..0f90b72a744d05b447935a8dd19d32b6f82c13cf 100644 (file)
@@ -147,7 +147,12 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
 {
     m_needParent = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxToolBar creation failed") );
+       return FALSE;
+    }
 
     m_tools.DeleteContents( TRUE );
 
index ccb6dce12bcbae5bc5115662c08440c7565dfa58..04809dc1931a3779e3d6896874dea17ab5790a73 100644 (file)
@@ -114,11 +114,13 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxTextCtrl creation failed") );
+       return FALSE;
+    }
 
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif // wxUSE_VALIDATORS
 
     m_vScrollbarVisible = FALSE;
 
index a2d7b7536fcfbeacc016cdc52daf455a7ad37793..bfdc8bcc81d78c1a89a15e77313428a6cf5e7844 100644 (file)
@@ -1821,7 +1821,12 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
                        const wxPoint &pos, const wxSize &size,
                        long style, const wxString &name  )
 {
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxWindow creation failed") );
+       return FALSE;
+    }
 
     m_insertCallback = wxInsertChildInWindow;
 
@@ -2002,27 +2007,22 @@ wxWindow::~wxWindow()
     }
 }
 
-void wxWindow::PreCreation( wxWindow *parent,
-                            wxWindowID id,
-                            const wxPoint &pos,
-                            const wxSize &size,
-                            long style,
-                            const wxString &name )
+bool wxWindow::PreCreation( wxWindow *parent, const wxPoint &pos,  const wxSize &size )
 {
-    wxASSERT_MSG( !m_needParent || parent, _T("Need complete parent.") );
-
-    if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
-    {
-        wxFAIL_MSG(_T("window creation failed"));
-    }
+    wxCHECK_MSG( !m_needParent || parent, FALSE, _T("Need complete parent.") );
 
+    /* this turns -1 into 20 so that a minimal window is
+       visible even although -1,-1 has been given as the
+       size of the window. the same trick is used in other
+       ports and should make debugging easier */
     m_width = WidthDefault(size.x);
     m_height = HeightDefault(size.y);
 
     m_x = (int)pos.x;
     m_y = (int)pos.y;
 
-    if (!parent)  /* some reasonable defaults */
+    /* some reasonable defaults */
+    if (!parent)  
     {
         if (m_x == -1)
         {
@@ -2035,6 +2035,8 @@ void wxWindow::PreCreation( wxWindow *parent,
             if (m_y < 10) m_y = 10;
         }
     }
+    
+    return TRUE;
 }
 
 void wxWindow::PostCreation()
index 945753865ba87fb2533a5ef9e9c9c7a117ccab71..1019e1367f40f05afd369add34c89e53714cc00b 100644 (file)
@@ -6,14 +6,12 @@
 // Licence:     wxWindows Licence
 /////////////////////////////////////////////////////////////////////////////
 
-
 #ifdef __GNUG__
-#pragma implementation
+#pragma implementation "htmlcell.h"
 #endif
 
-#include <wx/wxprec.h>
+#include "wx/wxprec.h"
 
-#include "wx/defs.h"
 #if wxUSE_HTML
 
 #ifdef __BORDLANDC__
 #endif
 
 #ifndef WXPRECOMP
-#include <wx/wx.h>
+#include "wx/wx.h"
 #endif
 
-#include <wx/html/htmlcell.h>
-#include <wx/html/htmlwin.h>
+#include "wx/html/htmlcell.h"
+#include "wx/html/htmlwin.h"
 #include <stdlib.h>
 
 
-
-
 //-----------------------------------------------------------------------------
 // wxHtmlCell
 //-----------------------------------------------------------------------------
@@ -71,10 +67,6 @@ void wxHtmlWordCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2)
 
 
 
-
-
-
-
 //-----------------------------------------------------------------------------
 // wxHtmlContainerCell
 //-----------------------------------------------------------------------------
index ba3f0a84e49b38020ea5393980f112eecd6a8ff6..1bdccd5b17cc061ef6f6f62fa48a5eecd794221c 100644 (file)
@@ -8,12 +8,11 @@
 
 
 #ifdef __GNUG__
-#pragma implementation
+#pragma implementation "htmlfilter.h"
 #endif
 
-#include <wx/wxprec.h>
+#include "wx/wxprec.h"
 
-#include "wx/defs.h"
 #if wxUSE_HTML
 
 #ifdef __BORDLANDC__
 #endif
 
 #ifndef WXPRECOMP
-#include <wx/wx.h>
+#include "wx/wx.h"
 #endif
 
-#include <wx/html/htmlfilter.h>
-#include <wx/html/htmlwin.h>
+#include "wx/html/htmlfilter.h"
+#include "wx/html/htmlwin.h"
 
 
 /*
index a208ea5caf064bc7007ddce0d83d2d534bf7182d..0f8c8c90841979d0177dd99b274d2ddd1ccd8140 100644 (file)
@@ -7,12 +7,11 @@
 
 
 #ifdef __GNUG__
-#pragma implementation
+#pragma implementation "htmlhelp.h"
 #endif
 
-#include <wx/wxprec.h>
+#include "wx/wxprec.h"
 
-#include "wx/defs.h"
 #if wxUSE_HTML
 
 #ifdef __BORDLANDC__