<s> """<STR_LIT>""" <EOL> from pyface . qt import QtCore , QtGui <EOL> from traits . api import Bool , HasTraits , provides , Str , Tuple , Unicode <EOL> from pyface . wizard . i_wizard_page import IWizardPage , MWizardPage <EOL> @ provides ( IWizardPage ) <EOL> class WizardPage ( MWizardPage , HasTraits ) : <EOL> """<STR_LIT>""" <EOL> id = Str <EOL> next_id = Str <EOL> last_page = Bool ( False ) <EOL> complete = Bool ( False ) <EOL> heading = Unicode <EOL> subheading = Unicode <EOL> size = Tuple <EOL> def create_page ( self , parent ) : <EOL> """<STR_LIT>""" <EOL> content = self . _create_page_content ( parent ) <EOL> if not isinstance ( content , QtGui . QWizardPage ) : <EOL> wp = _WizardPage ( self ) <EOL> if isinstance ( content , QtGui . QLayout ) : <EOL> wp . setLayout ( content ) <EOL> else : <EOL> assert isinstance ( content , QtGui . QWidget ) <EOL> lay = QtGui . QVBoxLayout ( ) <EOL> lay . addWidget ( content ) <EOL> wp . setLayout ( lay ) <EOL> content = wp <EOL> if self . size : <EOL> width , height = self . size <EOL> if width > <NUM_LIT:0> : <EOL> content . setMinimumWidth ( width ) <EOL> if height > <NUM_LIT:0> : <EOL> content . setMinimumHeight ( height ) <EOL> content . setTitle ( self . heading ) <EOL> content . setSubTitle ( self . subheading ) <EOL> return content <EOL> def _create_page_content ( self , parent ) : <EOL> """<STR_LIT>""" <EOL> control = QtGui . QWidget ( parent ) <EOL> palette = control . palette ( ) <EOL> palette . setColor ( QtGui . QPalette . Window , QtGui . QColor ( '<STR_LIT>' ) ) <EOL> control . setPalette ( palette ) <EOL> control . setAutoFillBackground ( True ) <EOL> return control <EOL> class _WizardPage ( QtGui . QWizardPage ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , page ) : <EOL> """<STR_LIT>""" <EOL> QtGui . QWizardPage . __init__ ( self ) <EOL> self . pyface_wizard = None <EOL> page . on_trait_change ( self . _on_complete_changed , '<STR_LIT>' ) <EOL> self . _page = page <EOL> def initializePage ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . pyface_wizard is not None : <EOL> self . pyface_wizard . next ( ) <EOL> def cleanupPage ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . pyface_wizard is not None : <EOL> self . pyface_wizard . previous ( ) <EOL> def isComplete ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _page . complete <EOL> def _on_complete_changed ( self ) : <EOL> """<STR_LIT>""" <EOL> self . emit ( QtCore . SIGNAL ( '<STR_LIT>' ) ) </s>
