27 #include "NCWidgetFactory.h"
28 #include <yui/YUIException.h>
30 #define YUILogComponent "ncurses"
31 #include <yui/YUILog.h>
32 #include "YNCursesUI.h"
57 NCWidgetFactory::createDialog( YDialogType dialogType, YDialogColorMode colorMode )
63 YUI_CHECK_NEW( dialog );
74 NCWidgetFactory::createPushButton( YWidget * parent,
const std::string & label )
77 YUI_CHECK_NEW( pushButton );
85 NCWidgetFactory::createLabel( YWidget * parent,
86 const std::string & text,
90 NCLabel * label =
new NCLabel( parent, text, isHeading, isOutputField );
91 YUI_CHECK_NEW( label );
98 NCWidgetFactory::createInputField( YWidget * parent,
const std::string & label,
bool passwordMode )
101 YUI_CHECK_NEW( inputField );
108 NCWidgetFactory::createCheckBox( YWidget * parent,
const std::string & label,
bool isChecked )
111 YUI_CHECK_NEW( checkBox );
118 NCWidgetFactory::createRadioButton( YWidget * parent,
const std::string & label,
bool checked )
121 YUI_CHECK_NEW( radioButton );
127 if ( radioButton->buttonGroup() )
128 radioButton->buttonGroup()->addRadioButton( radioButton );
135 NCWidgetFactory::createComboBox( YWidget * parent,
const std::string & label,
bool editable )
138 YUI_CHECK_NEW( comboBox );
145 NCWidgetFactory::createSelectionBox( YWidget * parent,
const std::string & label )
148 YUI_CHECK_NEW( selectionBox );
155 NCWidgetFactory::createTree( YWidget * parent,
const std::string & label,
bool multiselection,
bool recursiveselection )
157 NCTree * tree =
new NCTree( parent, label, multiselection, recursiveselection );
158 YUI_CHECK_NEW( tree );
165 NCWidgetFactory::createTable( YWidget * parent, YTableHeader * tableHeader,
bool multiSelection )
167 NCTable *table =
new NCTable( parent, tableHeader, multiSelection );
168 YUI_CHECK_NEW( table );
175 NCWidgetFactory::createProgressBar( YWidget * parent,
const std::string & label,
int maxValue )
178 YUI_CHECK_NEW( progressBar );
185 NCWidgetFactory::createBusyIndicator( YWidget * parent,
const std::string & label,
int timeout)
188 YUI_CHECK_NEW( busyIndicator );
190 return busyIndicator;
195 NCWidgetFactory::createRichText( YWidget * parent,
const std::string & text,
bool plainTextMode )
198 YUI_CHECK_NEW( richText );
209 NCWidgetFactory::createIntField( YWidget * parent,
const std::string & label,
int minVal,
int maxVal,
int initialVal )
212 YUI_CHECK_NEW( intField );
219 NCWidgetFactory::createMenuButton( YWidget * parent,
const std::string & label )
222 YUI_CHECK_NEW( menuButton );
229 NCWidgetFactory::createMenuBar( YWidget * parent )
232 YUI_CHECK_NEW( menuBar );
239 NCWidgetFactory::createMultiLineEdit( YWidget * parent,
const std::string & label )
242 YUI_CHECK_NEW( multiLineEdit );
244 return multiLineEdit;
249 NCWidgetFactory::createLogView( YWidget * parent,
const std::string & label,
int visibleLines,
int storedLines )
252 YUI_CHECK_NEW( logView );
259 NCWidgetFactory::createMultiSelectionBox( YWidget * parent,
const std::string & label )
262 YUI_CHECK_NEW( multiSelectionBox );
264 return multiSelectionBox;
269 NCWidgetFactory::createItemSelector( YWidget * parent,
bool enforceSingleSelection )
272 YUI_CHECK_NEW( itemSelector );
279 NCWidgetFactory::createCustomStatusItemSelector( YWidget * parent,
const YItemCustomStatusVector & customStates )
282 YUI_CHECK_NEW( itemSelector );
294 NCWidgetFactory::createSpacing( YWidget * parent, YUIDimension dim,
bool stretchable, YLayoutSize_t size )
297 YUI_CHECK_NEW( spacing );
304 NCWidgetFactory::createLayoutBox( YWidget * parent, YUIDimension dim )
307 YUI_CHECK_NEW( layoutBox );
314 NCWidgetFactory::createButtonBox( YWidget * parent )
317 YUI_CHECK_NEW( buttonBox );
324 NCWidgetFactory::createEmpty( YWidget * parent )
327 YUI_CHECK_NEW( empty );
334 NCWidgetFactory::createAlignment( YWidget * parent,
335 YAlignmentType horAlignment,
336 YAlignmentType vertAlignment )
339 YUI_CHECK_NEW( alignment );
346 NCWidgetFactory::createSquash( YWidget * parent,
bool horSquash,
bool vertSquash )
349 YUI_CHECK_NEW( squash );
356 NCWidgetFactory::createFrame( YWidget * parent,
const std::string & label )
359 YUI_CHECK_NEW( frame );
366 NCWidgetFactory::createCheckBoxFrame( YWidget * parent,
const std::string & label,
bool checked )
369 YUI_CHECK_NEW( checkBoxFrame );
371 return checkBoxFrame;
376 NCWidgetFactory::createRadioButtonGroup( YWidget * parent )
379 YUI_CHECK_NEW( radioButtonGroup );
381 return radioButtonGroup;
386 NCWidgetFactory::createReplacePoint( YWidget * parent )
389 YUI_CHECK_NEW( replacePoint );
396 NCWidgetFactory::createImage( YWidget * parent,
const std::string & imageFileName,
bool animated )
399 YUI_CHECK_NEW( image );
406 NCWidgetFactory::createPackageSelector( YWidget * parent,
long modeFlags )
421 NCWidgetFactory::createPkgSpecial( YWidget * parent,
const std::string & subwidget )