Exemple #1
0
    def processClick(self):
        #If there is a current hotspot
        if slide._currenthotspot:
            #If action, run it.
            if slide._currenthotspot.has_key('action'):
                if globals.functions.has_key(slide._currenthotspot.get('action')):
                    globals.functions[slide._currenthotspot.get('action')]()
                else:
                    slide._currenthotspot.get('action')()
                return (None, False)
            
            #If draggable hotspot, return the drag function (What's that??)
            if slide._currenthotspot.has_key('drag'):
                return (slide._currenthotspot.get('drag'), False)
            
            #If destination is a slide
            if slide._currenthotspot.has_key('dest'):
                nextslide = slide._currenthotspot.get('dest')
                #If this is a menu or object "return"
                if nextslide == 'return':
                    SlideManager.popSlide()
                    return (None, True)
                else:                    
                    #Destination is a normal slide
                    #Display the new slide, do run entrance functions
                    if globals.currentage is not None:
                        s = globals.currentage.getslide(nextslide)
                    else:
                        s = globals.menuslides[nextslide]
                    
                    if s.is3D():
                        s.yaw_angle = slide._currenthotspot['destOrientation']
                        s.pitch_angle = 0.0
                    
                    if slide._currenthotspot is not None and slide._currenthotspot.has_key('push') and slide._currenthotspot['push']:
                        SlideManager.pushSlide(s)
                    else:
                        SlideManager.replaceTopSlide(s)
                    return (None, True)

        return (None, False)