Пример #1
0
 def _init_child_views(self):
     if not self._children_ready:
         self.gonio_view = InlineGoniometerView(parent=self)
         self.calc_line_view = CalculatedLinePropertiesView(parent=self)
         self.exp_line_view = ExperimentalLinePropertiesView(parent=self)
         self._children_ready = True
Пример #2
0
 def _init_child_views(self):
     if not self._children_ready:
         self.gonio_view = InlineGoniometerView(parent=self)
         self.calc_line_view = CalculatedLinePropertiesView(parent=self)
         self.exp_line_view = ExperimentalLinePropertiesView(parent=self)
         self._children_ready = True
Пример #3
0
class SpecimenView(DialogView, HasChildView):
    title = "Edit Specimen"
    subview_builder = resource_filename(__name__, "../glade/specimen.glade")
    subview_toplevel = "edit_specimen"
    resizable = False

    widget_format = "specimen_%s"

    widget_groups = {
        'full_mode_only': [
            "absorption_align",
            "absorption_lbl",
            "spec_length_lbl",
            "entry_sample_length_align",
            "specimen_display_calculated",
            "specimen_display_stats_in_lbl",
            "specimen_display_phases",
            "vbox_calculated_data_tv",
            "lbl_specimen_calculated",
            "vbox_exclusion_ranges_tv",
            "lbl_tabexclusions",
            "general_separator",
            "specimen_display_residuals",
            "specimen_display_derivatives"
        ]
    }

    gonio_container = widget_format % "goniometer"
    gonio_view = None

    calc_line_container = widget_format % "calc_line"
    calc_line_view = None

    exp_line_container = widget_format % "exp_line"
    exp_line_view = None


    def __init__(self, *args, **kwargs):
        super(SpecimenView, self).__init__(*args, **kwargs)
        self._init_child_views()
        self._add_child_views()

    _children_ready = False
    def _init_child_views(self):
        if not self._children_ready:
            self.gonio_view = InlineGoniometerView(parent=self)
            self.calc_line_view = CalculatedLinePropertiesView(parent=self)
            self.exp_line_view = ExperimentalLinePropertiesView(parent=self)
            self._children_ready = True

    def _add_child_views(self):
        self._init_child_views()

        # Add in-line gonio view:
        top = self.gonio_view.get_top_widget()
        self._add_child_view(top, self[self.gonio_container])

        # Add in-line calculated line properties view:
        top = self.calc_line_view.get_top_widget()
        self._add_child_view(top, self[self.calc_line_container])

        # Add in-line experimental line properties view:
        top = self.exp_line_view.get_top_widget()
        self._add_child_view(top, self[self.exp_line_container])

    def set_layout_mode(self, state):
        super(SpecimenView, self).set_layout_mode(state)
        if self._children_ready:
            self.gonio_view.set_layout_mode(state)
            self.calc_line_view.set_layout_mode(state)
            self.exp_line_view.set_layout_mode(state)


    pass # end of class
Пример #4
0
class SpecimenView(DialogView, HasChildView):
    title = "Edit Specimen"
    subview_builder = resource_filename(__name__, "../glade/specimen.glade")
    subview_toplevel = "edit_specimen"
    resizable = False

    widget_format = "specimen_%s"

    widget_groups = {
        'full_mode_only': [
            "specimen_display_calculated", "specimen_display_stats_in_lbl",
            "specimen_display_phases", "vbox_calculated_data_tv",
            "lbl_specimen_calculated", "vbox_exclusion_ranges_tv",
            "lbl_tabexclusions", "general_separator",
            "specimen_display_residuals", "specimen_display_derivatives"
        ]
    }

    gonio_container = widget_format % "goniometer"
    gonio_view = None

    calc_line_container = widget_format % "calc_line"
    calc_line_view = None

    exp_line_container = widget_format % "exp_line"
    exp_line_view = None

    def __init__(self, *args, **kwargs):
        super(SpecimenView, self).__init__(*args, **kwargs)
        self._init_child_views()
        self._add_child_views()

    _children_ready = False

    def _init_child_views(self):
        if not self._children_ready:
            self.gonio_view = InlineGoniometerView(parent=self)
            self.calc_line_view = CalculatedLinePropertiesView(parent=self)
            self.exp_line_view = ExperimentalLinePropertiesView(parent=self)
            self._children_ready = True

    def _add_child_views(self):
        self._init_child_views()

        # Add in-line gonio view:
        top = self.gonio_view.get_top_widget()
        self._add_child_view(top, self[self.gonio_container])

        # Add in-line calculated line properties view:
        top = self.calc_line_view.get_top_widget()
        self._add_child_view(top, self[self.calc_line_container])

        # Add in-line experimental line properties view:
        top = self.exp_line_view.get_top_widget()
        self._add_child_view(top, self[self.exp_line_container])

    def set_layout_mode(self, state):
        super(SpecimenView, self).set_layout_mode(state)
        if self._children_ready:
            self.gonio_view.set_layout_mode(state)
            self.calc_line_view.set_layout_mode(state)
            self.exp_line_view.set_layout_mode(state)

    pass  # end of class