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>
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
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>
/* 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
/* 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
#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;
#define __HTMLDEFS_H__
#include "wx/defs.h"
-#if wxUSE_HTML
+#if wxUSE_HTML
//--------------------------------------------------------------------------------
// ALIGNMENTS
#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"
//--------------------------------------------------------------------------------
#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"
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;
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 );
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( "" );
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 );
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 );
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;
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();
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();
#endif
#include "wx/cursor.h"
+#include "wx/utils.h"
#include "gdk/gdk.h"
gs_savedCursor = g_globalCursor;
wxSetCursor( wxCursor(wxCURSOR_WATCH) );
+
+ wxYield();
}
bool wxIsBusy()
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;
{
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;
decor |= GDK_DECOR_RESIZEH;
}
-
gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);
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;
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
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)
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();
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 );
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. */
if (win->m_isDragging) return TRUE;
+ gdk_window_raise( win->m_widget->window );
+
gdk_pointer_grab( widget->window, FALSE,
(GdkEventMask)
(GDK_BUTTON_PRESS_MASK |
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();
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() );
{
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))
{
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 );
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;
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;
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;
{
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();
{
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;
{
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();
{
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
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 );
{
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 );
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;
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;
}
}
-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)
{
if (m_y < 10) m_y = 10;
}
}
+
+ return TRUE;
}
void wxWindow::PostCreation()
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;
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 );
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( "" );
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 );
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 );
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;
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();
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();
#endif
#include "wx/cursor.h"
+#include "wx/utils.h"
#include "gdk/gdk.h"
gs_savedCursor = g_globalCursor;
wxSetCursor( wxCursor(wxCURSOR_WATCH) );
+
+ wxYield();
}
bool wxIsBusy()
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;
{
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;
decor |= GDK_DECOR_RESIZEH;
}
-
gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);
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;
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
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)
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();
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 );
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. */
if (win->m_isDragging) return TRUE;
+ gdk_window_raise( win->m_widget->window );
+
gdk_pointer_grab( widget->window, FALSE,
(GdkEventMask)
(GDK_BUTTON_PRESS_MASK |
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();
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() );
{
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))
{
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 );
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;
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;
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;
{
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();
{
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;
{
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();
{
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
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 );
{
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 );
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;
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;
}
}
-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)
{
if (m_y < 10) m_y = 10;
}
}
+
+ return TRUE;
}
void wxWindow::PostCreation()
// 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
//-----------------------------------------------------------------------------
-
-
-
-
//-----------------------------------------------------------------------------
// wxHtmlContainerCell
//-----------------------------------------------------------------------------
#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"
/*
#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__