- m_needParent = TRUE;
-
- PreCreation( parent, id, pos, size, style, name );
-
- SetValidator( validator );
-
- m_rangeMax = range;
- m_gaugePos = 0;
- m_useProgressBar = TRUE;
-
- m_widget = gtk_progress_bar_new();
-
- m_parent->DoAddChild( this );
-
- PostCreation();
-
- Show( TRUE );
+ m_needParent = TRUE;
+
+ if (!PreCreation( parent, pos, size ) ||
+ !CreateBase( parent, id, pos, size, style, validator, name ))
+ {
+ wxFAIL_MSG( wxT("wxGauge creation failed") );
+ return FALSE;
+ }
+
+ m_rangeMax = range;
+
+ m_widget = gtk_progress_bar_new();
+ if ( style & wxGA_VERTICAL )
+ {
+ gtk_progress_bar_set_orientation( GTK_PROGRESS_BAR(m_widget),
+ GTK_PROGRESS_BOTTOM_TO_TOP );
+ }
+
+ m_parent->DoAddChild( this );
+
+ PostCreation(size);
+ SetBestSize(size);