<s> '''<STR_LIT>''' <EOL> import wx <EOL> import wx . animate <EOL> from gooey . gui . pubsub import pub <EOL> from gooey . gui . lang import i18n <EOL> from gooey . gui import imageutil , events <EOL> class Footer ( wx . Panel ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , parent , ** kwargs ) : <EOL> wx . Panel . __init__ ( self , parent , ** kwargs ) <EOL> self . SetMinSize ( ( <NUM_LIT:30> , <NUM_LIT> ) ) <EOL> self . cancel_button = None <EOL> self . start_button = None <EOL> self . progress_bar = None <EOL> self . close_button = None <EOL> self . stop_button = None <EOL> self . restart_button = None <EOL> self . buttons = None <EOL> self . layouts = { } <EOL> self . _init_components ( ) <EOL> self . _do_layout ( ) <EOL> for button in self . buttons : <EOL> self . Bind ( wx . EVT_BUTTON , self . dispatch_click , button ) <EOL> def _init_components ( self ) : <EOL> self . cancel_button = self . button ( i18n . _ ( '<STR_LIT>' ) , wx . ID_CANCEL , event_id = int ( events . WINDOW_CANCEL ) ) <EOL> self . stop_button = self . button ( i18n . _ ( '<STR_LIT>' ) , wx . ID_OK , event_id = int ( events . WINDOW_STOP ) ) <EOL> self . start_button = self . button ( i18n . _ ( '<STR_LIT:start>' ) , wx . ID_OK , event_id = int ( events . WINDOW_START ) ) <EOL> self . close_button = self . button ( i18n . _ ( "<STR_LIT>" ) , wx . ID_OK , event_id = int ( events . WINDOW_CLOSE ) ) <EOL> self . restart_button = self . button ( i18n . _ ( '<STR_LIT>' ) , wx . ID_OK , event_id = int ( events . WINDOW_RESTART ) ) <EOL> self . edit_button = self . button ( i18n . _ ( '<STR_LIT>' ) , wx . ID_OK , event_id = int ( events . WINDOW_EDIT ) ) <EOL> self . progress_bar = wx . Gauge ( self , range = <NUM_LIT:100> ) <EOL> self . buttons = [ self . cancel_button , self . start_button , <EOL> self . stop_button , self . close_button , <EOL> self . restart_button , self . edit_button ] <EOL> def _do_layout ( self ) : <EOL> self . stop_button . Hide ( ) <EOL> self . restart_button . Hide ( ) <EOL> v_sizer = wx . BoxSizer ( wx . VERTICAL ) <EOL> h_sizer = wx . BoxSizer ( wx . HORIZONTAL ) <EOL> h_sizer . Add ( self . progress_bar , <NUM_LIT:0> , wx . ALIGN_LEFT | wx . ALIGN_CENTER_VERTICAL | wx . LEFT , <NUM_LIT:20> ) <EOL> self . progress_bar . Hide ( ) <EOL> h_sizer . AddStretchSpacer ( <NUM_LIT:1> ) <EOL> h_sizer . Add ( self . cancel_button , <NUM_LIT:0> , wx . ALIGN_RIGHT | wx . RIGHT , <NUM_LIT:20> ) <EOL> h_sizer . Add ( self . start_button , <NUM_LIT:0> , wx . ALIGN_RIGHT | wx . RIGHT , <NUM_LIT:20> ) <EOL> h_sizer . Add ( self . stop_button , <NUM_LIT:0> , wx . ALIGN_RIGHT | wx . RIGHT , <NUM_LIT:20> ) <EOL> v_sizer . AddStretchSpacer ( <NUM_LIT:1> ) <EOL> v_sizer . Add ( h_sizer , <NUM_LIT:0> , wx . ALIGN_CENTER_VERTICAL | wx . EXPAND ) <EOL> h_sizer . Add ( self . edit_button , <NUM_LIT:0> , wx . ALIGN_RIGHT | wx . RIGHT , <NUM_LIT:10> ) <EOL> h_sizer . Add ( self . restart_button , <NUM_LIT:0> , wx . ALIGN_RIGHT | wx . RIGHT , <NUM_LIT:10> ) <EOL> h_sizer . Add ( self . close_button , <NUM_LIT:0> , wx . ALIGN_RIGHT | wx . RIGHT , <NUM_LIT:20> ) <EOL> self . edit_button . Hide ( ) <EOL> self . restart_button . Hide ( ) <EOL> self . close_button . Hide ( ) <EOL> v_sizer . AddStretchSpacer ( <NUM_LIT:1> ) <EOL> self . SetSizer ( v_sizer ) <EOL> def button ( self , label = None , style = None , event_id = - <NUM_LIT:1> ) : <EOL> return wx . Button ( <EOL> parent = self , <EOL> id = event_id , <EOL> size = ( <NUM_LIT> , <NUM_LIT> ) , <EOL> label = label , <EOL> style = style ) <EOL> def dispatch_click ( self , event ) : <EOL> pub . send_message ( str ( event . GetId ( ) ) ) <EOL> event . Skip ( ) <EOL> def hide_all_buttons ( self ) : <EOL> for button in self . buttons : <EOL> button . Hide ( ) <EOL> def _load_image ( self , img_path , height = <NUM_LIT> ) : <EOL> return imageutil . resize_bitmap ( self , imageutil . _load_image ( img_path ) , height ) </s>
