Esempio n. 1
0
    def register(self):
        #Function to register the module (run the function add to slide)

        #Save the id of the current slide for the module
        self.slide_id = gcs()

        #Ajout du nom du module
        self.name = self.get_name()

        #Create a unique id for this element
        self.id = create_element_id(self)

        #print(elem_id)
        document._slides[self.slide_id].add_module(self.id, self)

        self.positionner = positionner(self.x, self.y, self.width, self.height,
                                       self.id)

        #Add anchors for relative positionning
        self.top = self.positionner.top
        self.bottom = self.positionner.bottom
        self.left = self.positionner.left
        self.right = self.positionner.right
        self.center = self.positionner.center

        #Report width, height from positionner to self.width, self.height
        self.width = self.positionner.width
        self.height = self.positionner.height

        #Add the source of the script that run this module
        start, stop, source = get_command_line(self.name)
        self.call_cmd = source
        self.call_lines = (start, stop)
Esempio n. 2
0
    def register(self):
        #Function to register the module (run the function add to slide)

        #Save the id of the current slide for the module
        self.slide_id = gcs()

        #Ajout du nom du module
        self.name = self.get_name()

        #Create a unique id for this element
        self.id = create_element_id( self )

        #print(elem_id)
        document._slides[self.slide_id].add_module(self.id, self)

        self.positionner = positionner( self.x, self.y , self.width, self.height, self.id)

        #Add anchors for relative positionning
        self.top = self.positionner.top
        self.bottom = self.positionner.bottom
        self.left = self.positionner.left
        self.right = self.positionner.right
        self.center = self.positionner.center

        #Report width, height from positionner to self.width, self.height
        self.width = self.positionner.width
        self.height = self.positionner.height

        #Add the source of the script that run this module
        start, stop, source = get_command_line( self.name )
        self.call_cmd = source
        self.call_lines = (start, stop)
Esempio n. 3
0
def add_to_slide(content, x, y, width, height):
    """
        Function to add a given content to the current slide
    """
    from beampy.geometry import positionner

    elem_id = create_element_id(content)
    #print(elem_id)
    document._contents[gcs()]['element_keys'] += [elem_id]
    document._contents[gcs()]['contents'][elem_id] = content
    content['positionner'] = positionner(x, y, width, height, elem_id)

    #return the positionner for relative placement
    return content['positionner']
Esempio n. 4
0
    def register(self):
        # Function to register the module (run the function add to slide)

        # Save the id of the current slide for the module
        self.slide_id = gcs()

        # Store the list of groups id where the module is finally located (used for html element to
        # resolve final positionning)
        self.groups_id = []

        # Ajout du nom du module
        self.name = self.get_name()

        # Create a unique id for this element
        self.id = create_element_id( self )

        # Store the layers where this module should be printed
        self.layers = [0]
        # Store a boolean to know if this module has been exported to slide store
        self.exported = False

        # Add module to his slide
        document._slides[self.slide_id].add_module(self.id, self)

        self.positionner = positionner( self.x, self.y , self.width, self.height, self.id)

        # Add anchors for relative positionning
        self.top = self.positionner.top
        self.bottom = self.positionner.bottom
        self.left = self.positionner.left
        self.right = self.positionner.right
        self.center = self.positionner.center

        # Report width, height from positionner to self.width, self.height
        self.width = self.positionner.width
        self.height = self.positionner.height

        # Add the source of the script that run this module
        try:
            start, stop, source = get_command_line(self.name)
        except:
            start = 0
            stop = 0
            source = 'None'

        self.call_cmd = source
        self.call_lines = (start, stop)