26 #include "NCWidgetFactory.h"
27 #include <yui/YUIException.h>
29 #define YUILogComponent "ncurses"
30 #include <yui/YUILog.h>
31 #include "YNCursesUI.h"
55 NCWidgetFactory::createDialog( YDialogType dialogType, YDialogColorMode colorMode )
57 yuiDebug() <<
"Flush input buffer - new dialog" << std::endl;
61 YUI_CHECK_NEW( dialog );
72 NCWidgetFactory::createPushButton( YWidget * parent,
const std::string & label )
75 YUI_CHECK_NEW( pushButton );
83 NCWidgetFactory::createLabel( YWidget * parent,
84 const std::string & text,
88 NCLabel * label =
new NCLabel( parent, text, isHeading, isOutputField );
89 YUI_CHECK_NEW( label );
97 NCWidgetFactory::createInputField( YWidget * parent,
const std::string & label,
bool passwordMode )
100 YUI_CHECK_NEW( inputField );
108 NCWidgetFactory::createCheckBox( YWidget * parent,
const std::string & label,
bool isChecked )
111 YUI_CHECK_NEW( checkBox );
119 NCWidgetFactory::createRadioButton( YWidget * parent,
const std::string & label,
bool checked )
122 YUI_CHECK_NEW( radioButton );
128 if ( radioButton->buttonGroup() )
129 radioButton->buttonGroup()->addRadioButton( radioButton );
137 NCWidgetFactory::createComboBox( YWidget * parent,
const std::string & label,
bool editable )
140 YUI_CHECK_NEW( comboBox );
148 NCWidgetFactory::createSelectionBox( YWidget * parent,
const std::string & label )
151 YUI_CHECK_NEW( selectionBox );
159 NCWidgetFactory::createTree( YWidget * parent,
const std::string & label,
bool multiselection,
bool recursiveselection )
161 NCTree * tree =
new NCTree( parent, label, multiselection, recursiveselection );
162 YUI_CHECK_NEW( tree );
170 NCWidgetFactory::createTable( YWidget * parent, YTableHeader * tableHeader,
bool multiSelection )
172 NCTable *table =
new NCTable( parent, tableHeader, multiSelection );
173 YUI_CHECK_NEW( table );
181 NCWidgetFactory::createProgressBar( YWidget * parent,
const std::string & label,
int maxValue )
184 YUI_CHECK_NEW( progressBar );
190 NCWidgetFactory::createBusyIndicator( YWidget * parent,
const std::string & label,
int timeout)
193 YUI_CHECK_NEW( busyIndicator );
195 return busyIndicator;
199 NCWidgetFactory::createRichText( YWidget * parent,
const std::string & text,
bool plainTextMode )
202 YUI_CHECK_NEW( richText );
212 NCWidgetFactory::createIntField( YWidget * parent,
const std::string & label,
int minVal,
int maxVal,
int initialVal )
215 YUI_CHECK_NEW( intField );
223 NCWidgetFactory::createMenuButton( YWidget * parent,
const std::string & label )
226 YUI_CHECK_NEW( menuButton );
234 NCWidgetFactory::createMultiLineEdit( YWidget * parent,
const std::string & label )
237 YUI_CHECK_NEW( multiLineEdit );
239 return multiLineEdit;
243 NCWidgetFactory::createLogView( YWidget * parent,
const std::string & label,
int visibleLines,
int storedLines )
246 YUI_CHECK_NEW( logView );
254 NCWidgetFactory::createMultiSelectionBox( YWidget * parent,
const std::string & label )
257 YUI_CHECK_NEW( multiSelectionBox );
259 return multiSelectionBox;
268 NCWidgetFactory::createSpacing( YWidget * parent, YUIDimension dim,
bool stretchable, YLayoutSize_t size )
271 YUI_CHECK_NEW( spacing );
277 NCWidgetFactory::createLayoutBox( YWidget * parent, YUIDimension dim )
280 YUI_CHECK_NEW( layoutBox );
287 NCWidgetFactory::createButtonBox( YWidget * parent )
290 YUI_CHECK_NEW( buttonBox );
297 NCWidgetFactory::createEmpty( YWidget * parent )
300 YUI_CHECK_NEW( empty );
308 NCWidgetFactory::createAlignment( YWidget * parent,
309 YAlignmentType horAlignment,
310 YAlignmentType vertAlignment )
313 YUI_CHECK_NEW( alignment );
320 NCWidgetFactory::createSquash( YWidget * parent,
bool horSquash,
bool vertSquash )
323 YUI_CHECK_NEW( squash );
331 NCWidgetFactory::createFrame( YWidget * parent,
const std::string & label )
334 YUI_CHECK_NEW( frame );
342 NCWidgetFactory::createCheckBoxFrame( YWidget * parent,
const std::string & label,
bool checked )
345 YUI_CHECK_NEW( checkBoxFrame );
347 return checkBoxFrame;
353 NCWidgetFactory::createRadioButtonGroup( YWidget * parent )
356 YUI_CHECK_NEW( radioButtonGroup );
358 return radioButtonGroup;
364 NCWidgetFactory::createReplacePoint( YWidget * parent )
367 YUI_CHECK_NEW( replacePoint );
373 NCWidgetFactory::createImage( YWidget * parent,
const std::string & imageFileName,
bool animated )
376 YUI_CHECK_NEW( image );
383 NCWidgetFactory::createPackageSelector( YWidget * parent,
long modeFlags )
398 NCWidgetFactory::createPkgSpecial( YWidget * parent,
const std::string & subwidget )
virtual YWidget * createPkgSpecial(YWidget *parent, const std::string &subwidget)
NCPackageSelectorPluginStub * packageSelectorPlugin()
virtual YPackageSelector * createPackageSelector(YWidget *parent, long modeFlags)