// ... 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);
+ 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);
// put the horizontal scrollbar in the lower left hand corner
if (bHasHScrollbar)
{
GtkWidget *hscrollbar = gtk_hscrollbar_new(GTK_TEXT(m_text)->hadj);
gtk_table_attach(GTK_TABLE(m_widget), hscrollbar, 0, 1, 1, 2,
- GTK_EXPAND | GTK_FILL,
+ (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
GTK_FILL,
0, 0);
gtk_widget_show(hscrollbar);
GtkWidget *vscrollbar = gtk_vscrollbar_new(GTK_TEXT(m_text)->vadj);
gtk_table_attach(GTK_TABLE(m_widget), vscrollbar, 1, 2, 0, 1,
GTK_FILL,
- GTK_EXPAND | GTK_FILL | GTK_SHRINK,
+ (GtkAttachOptions)(GTK_EXPAND | GTK_FILL | GTK_SHRINK),
0, 0);
gtk_widget_show( vscrollbar );
}
if (newSize.y == -1) newSize.y = 26;
SetSize( newSize.x, newSize.y );
+ m_parent->AddChild( this );
+
+ (m_parent->m_insertCallback)( m_parent, this );
+
PostCreation();
if (bMultiLine)
{
gint tmp = 0;
gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &tmp );
+ SetInsertionPointEnd();
}
if (style & wxTE_READONLY)
Show( TRUE );
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
return TRUE;
}
pos = gtk_text_get_length( GTK_TEXT(m_text) );
else
pos = GTK_ENTRY(m_text)->text_length;
- SetInsertionPoint( pos-1 );
+ SetInsertionPoint((pos-1)>0 ? (pos-1):0);
}
void wxTextCtrl::SetEditable( bool editable )
return (window == GTK_ENTRY(m_text)->text_area);
}
-void wxTextCtrl::SetFont( const wxFont &font )
+void wxTextCtrl::SetFont( const wxFont &WXUNUSED(font) )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
- wxControl::SetFont( font );
+ // doesn't work
+}
+
+void wxTextCtrl::SetForegroundColour( const wxColour &WXUNUSED(colour) )
+{
+ wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
// doesn't work
}
gdk_window_set_background( window, m_backgroundColour.GetColor() );
gdk_window_clear( window );
}
+}
+
+void wxTextCtrl::ApplyWidgetStyle()
+{
+ if (m_windowStyle & wxTE_MULTILINE)
+ {
+ }
else
{
+ SetWidgetStyle();
gtk_widget_set_style( m_text, m_widgetStyle );
}
}