- // ... and put into the upper left hand corner of the table
- m_widget = gtk_table_new(bHasHScrollbar ? 2 : 1, 2, FALSE);
- gtk_table_attach(GTK_TABLE(m_widget), m_text, 0, 1, 0, 1,
- GTK_FILL | GTK_EXPAND,
- GTK_FILL | GTK_EXPAND | GTK_SHRINK,
- 0, 0);
+bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
+ const wxPoint &pos, const wxSize &size,
+ int style, const wxValidator& validator, const wxString &name )
+{
+ m_needParent = TRUE;
+ m_acceptsFocus = TRUE;
+
+ PreCreation( parent, id, pos, size, style, name );
+
+ SetValidator( validator );
+
+ m_vScrollbarVisible = TRUE;
+
+ bool multi_line = (style & wxTE_MULTILINE) != 0;
+ if ( multi_line )
+ {
+ // a multi-line edit control: create a vertical scrollbar by default and
+ // horizontal if requested
+ bool bHasHScrollbar = (style & wxHSCROLL) != 0;
+
+ // create our control...
+ m_text = gtk_text_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
+
+ // ... and put into the upper left hand corner of the table
+ m_widget = gtk_table_new(bHasHScrollbar ? 2 : 1, 2, FALSE);
+ gtk_table_attach( GTK_TABLE(m_widget), m_text, 0, 1, 0, 1,
+ (GtkAttachOptions)(GTK_FILL | GTK_EXPAND | GTK_SHRINK),
+ (GtkAttachOptions)(GTK_FILL | GTK_EXPAND | GTK_SHRINK),
+ 0, 0);