示例#1
0
    def InsertPictures(self, pics, position=None, autopath=False):
        logging.debug("InsertPictures(pos=%s)", position)
        if position is None:
            position = self.lvPics.GetItemCount()

        self.lvPics.Freeze()
        for pic in pics:
            if autopath:
                actAp = ActionAutoPath(pic, self.__project.GetAspect())
                actAp.Execute()

            self.lvPics.InsertPicture(position, pic)
            position += 1

            pic.AddObserver(self)
        self.lvPics.Thaw()
        if len(self.lvPics.GetSelected()) == 0:
            self.lvPics.Select(0)

        self.SetChanged(True)

        self.pnlAddPics.Show(self.lvPics.GetItemCount() == 0)
        self.panelTop.Show(self.lvPics.GetItemCount() != 0)
        self.Layout()

        self.lvPics.SetFocus()
示例#2
0
 def OnMotionRandom(self):
     for pic in self.lvPics.GetSelectedPictures():
         actAp = ActionAutoPath(pic, self.__project.GetAspect())
         actAp.Execute()