|
From: andrew7 <bd...@us...> - 2006-12-18 03:32:31
|
Update of /cvsroot/smartwin/SmartWin/include/smartwin In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20789/include/smartwin Modified Files: WidgetFactory.h Log Message: Add support for subclassProgressBar( unsigned id ); Index: WidgetFactory.h =================================================================== RCS file: /cvsroot/smartwin/SmartWin/include/smartwin/WidgetFactory.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- WidgetFactory.h 5 May 2006 17:14:37 -0000 1.30 +++ WidgetFactory.h 18 Dec 2006 03:32:08 -0000 1.31 @@ -388,6 +388,16 @@ */ WidgetButtonPtr subclassButton( unsigned id ); + + + /// \ingroup SubclassDialog + /// Subclasses a Progress Bar Control from the given resource id. + /** DON'T delete the returned pointer!!!< br > + * Use e.g. the Dialog Designer to design a dialog and subclass the controls with this function. + */ + WidgetProgressBarPtr subclassProgressBar( unsigned id ); + + /// \ingroup SubclassDialog /// Subclasses a Slider Control from the given resource id. /** DON'T delete the returned pointer!!! <br> @@ -707,6 +717,26 @@ return WidgetCreator< WidgetButton >::subclass( this, id ); } + +template< template< class, class > class ContainerWidgetType, class EventHandlerClass, class MessageMapPolicy > +typename WidgetFactory< ContainerWidgetType, EventHandlerClass, MessageMapPolicy >::WidgetProgressBarPtr +WidgetFactory< ContainerWidgetType, EventHandlerClass, MessageMapPolicy >::subclassProgressBar( unsigned id ) +{ + // If this one fizzles you have tried to call this function from a derived + // class which not is derived from MessageMapPolicyDialogWidget, like for + // instance both the MessageMapPolicyNormalWidget and the + // MessageMapPolicyMDIChildWidget classes cannot logically subclass a dialog + // item since they're NOT dialog Widgets therefore they will give you a compile + // error if you try to call this function from Widgets implementing the those + // classes! Only the MessageMapPolicyDialogWidget can logically call this + // function and therefore it's the only one which will not give you a compile + // time error here... + typename MessageMapPolicy::canSubclassControls checker; + return WidgetCreator< WidgetProgressBar >::subclass( this, id ); +} + + + template< template< class, class > class ContainerWidgetType, class EventHandlerClass, class MessageMapPolicy > typename WidgetFactory< ContainerWidgetType, EventHandlerClass, MessageMapPolicy >::WidgetSliderPtr WidgetFactory< ContainerWidgetType, EventHandlerClass, MessageMapPolicy >::subclassSlider( unsigned id ) |