editors/Viewer.py
changeset 1252 18cd1357e8d3
parent 1251 d9ed42e44a50
child 1259 8350222a81c3
equal deleted inserted replaced
1251:d9ed42e44a50 1252:18cd1357e8d3
  2370             self.RefreshVisibleElements()
  2370             self.RefreshVisibleElements()
  2371             step.Refresh()
  2371             step.Refresh()
  2372         dialog.Destroy()
  2372         dialog.Destroy()
  2373 
  2373 
  2374     def AddNewTransition(self, bbox):
  2374     def AddNewTransition(self, bbox):
  2375         dialog = SFCTransitionDialog(self.ParentWindow, self.Controler, self.GetDrawingMode() == FREEDRAWING_MODE)
  2375         dialog = SFCTransitionDialog(self.ParentWindow, self.Controler, self.TagName, self.GetDrawingMode() == FREEDRAWING_MODE)
  2376         dialog.SetPreviewFont(self.GetFont())
  2376         dialog.SetPreviewFont(self.GetFont())
  2377         dialog.SetTransitions(self.Controler.GetEditedElementTransitions(self.TagName, self.Debug))
  2377         dialog.SetMinElementSize((bbox.width, bbox.height))
  2378         if dialog.ShowModal() == wx.ID_OK:
  2378         if dialog.ShowModal() == wx.ID_OK:
  2379             id = self.GetNewId()
  2379             id = self.GetNewId()
  2380             values = dialog.GetValues()
  2380             values = dialog.GetValues()
  2381             transition = SFC_Transition(self, values["type"], values["value"], values["priority"], id)
  2381             transition = SFC_Transition(self, values["type"], values["value"], values["priority"], id)
  2382             transition.SetPosition(bbox.x, bbox.y)
  2382             transition.SetPosition(bbox.x, bbox.y)
  2654             self.RefreshScrollBars()
  2654             self.RefreshScrollBars()
  2655             self.RefreshVisibleElements()
  2655             self.RefreshVisibleElements()
  2656             step.Refresh(rect)
  2656             step.Refresh(rect)
  2657         
  2657         
  2658     def EditTransitionContent(self, transition):
  2658     def EditTransitionContent(self, transition):
  2659         dialog = SFCTransitionDialog(self.ParentWindow, self.Controler, self.GetDrawingMode() == FREEDRAWING_MODE)
  2659         dialog = SFCTransitionDialog(self.ParentWindow, self.Controler, self.TagName, self.GetDrawingMode() == FREEDRAWING_MODE)
  2660         dialog.SetPreviewFont(self.GetFont())
  2660         dialog.SetPreviewFont(self.GetFont())
  2661         dialog.SetTransitions(self.Controler.GetEditedElementTransitions(self.TagName, self.Debug))
  2661         dialog.SetMinElementSize(transition.GetSize())
  2662         dialog.SetValues({"type":transition.GetType(),"value":transition.GetCondition(), "priority":transition.GetPriority()})
  2662         dialog.SetValues({"type":transition.GetType(),"value":transition.GetCondition(), "priority":transition.GetPriority()})
  2663         dialog.SetElementSize(transition.GetSize())
       
  2664         if dialog.ShowModal() == wx.ID_OK:
  2663         if dialog.ShowModal() == wx.ID_OK:
  2665             values = dialog.GetValues()
  2664             values = dialog.GetValues()
  2666             rect = transition.GetRedrawRect(1, 1)
  2665             rect = transition.GetRedrawRect(1, 1)
  2667             transition.SetType(values["type"],values["value"])
  2666             transition.SetType(values["type"],values["value"])
  2668             transition.SetPriority(values["priority"])
  2667             transition.SetPriority(values["priority"])