Esempio n. 1
0
 def _OnFillColorChanged(self, evt: wx.Event):
     """Callback for the fill color control."""
     fill = evt.GetColour()
     nodes = get_nodes_by_idx(self._nodes, self._selected_idx)
     self._self_changes = True
     self.controller.start_group()
     for node in nodes:
         if on_msw():
             self.controller.set_node_fill_rgb(self.net_index, node.index,
                                               fill)
         else:
             # we can set both the RGB and the alpha at the same time
             self.controller.set_node_fill_rgb(self.net_index, node.index,
                                               fill)
             self.controller.set_node_fill_alpha(self.net_index, node.index,
                                                 fill.Alpha())
     self.controller.end_group()
Esempio n. 2
0
 def _OnFillColorChanged(self, evt: wx.Event):
     """Callback for the fill color control."""
     fill = evt.GetColour()
     reactions = [
         r for r in self._reactions if r.index in self._selected_idx
     ]
     self._self_changes = True
     self.controller.start_group()
     for rxn in reactions:
         if on_msw():
             self.controller.set_reaction_fill_rgb(self.net_index,
                                                   rxn.index, fill)
         else:
             # we can set both the RGB and the alpha at the same time
             self.controller.set_reaction_fill_rgb(self.net_index,
                                                   rxn.index, fill)
             self.controller.set_reaction_fill_alpha(
                 self.net_index, rxn.index, fill.Alpha())
     self.controller.end_group()