* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import wx from cscience import datastore from cscience.framework import Template from cscience.GUI import dialogs, events from cscience.GUI.Editors import MemoryFrame EditTemplateField = dialogs.field_dialog("Template Field", "Key") class TemplateListCtrl(wx.ListCtrl): cols = ["name", "field_type", "iskey"] labels = ["Name", "Type", "Is Key?"] def __init__(self, *args, **kwargs): self._template = None if "style" in kwargs: style = kwargs["style"] else: style = 0 kwargs["style"] = style | wx.LC_REPORT | wx.LC_VIRTUAL | wx.LC_SINGLE_SEL super(TemplateListCtrl, self).__init__(*args, **kwargs)
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import wx from cscience import datastore from cscience.framework import Template from cscience.GUI import dialogs, events from cscience.GUI.Editors import MemoryFrame datastore = datastore.Datastore() EditTemplateField = dialogs.field_dialog('Template Field', 'Key') class TemplateListCtrl(wx.ListCtrl): cols = ['name', 'field_type', 'iskey'] labels = ['Name', 'Type', 'Is Key?'] def __init__(self, *args, **kwargs): self._template = None if 'style' in kwargs: style = kwargs['style'] else: style = 0 kwargs['style'] = style | wx.LC_REPORT | wx.LC_VIRTUAL | \ wx.LC_SINGLE_SEL super(TemplateListCtrl, self).__init__(*args, **kwargs)
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import wx from cscience import datastore from cscience.framework import Template from cscience.GUI import dialogs, events from cscience.GUI.Editors import MemoryFrame datastore = datastore.Datastore() EditTemplateField = dialogs.field_dialog('Template Field', 'Key', ('int', 'float', 'string')) class TemplateListCtrl(wx.ListCtrl): cols = ['name', 'field_type', 'iskey'] labels = ['Name', 'Type', 'Is Key?'] def __init__(self, *args, **kwargs): self._template = None if 'style' in kwargs: style = kwargs['style'] else: style = 0 kwargs['style'] = style | wx.LC_REPORT | wx.LC_VIRTUAL | \ wx.LC_SINGLE_SEL super(TemplateListCtrl, self).__init__(*args, **kwargs)
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import wx import wx.lib.agw.hypertreelist as HTL from cscience import datastore from cscience.framework import Attribute from cscience.GUI import dialogs, events from cscience.GUI.Editors import MemoryFrame AddAttribute = dialogs.field_dialog('Attribute', 'Output') datastore = datastore.Datastore() class AttributeListCtrl(wx.ListCtrl): cols = ['name', 'type_', 'unit', 'output'] labels = ['Attribute', 'Type', 'Unit', 'Output?'] def __init__(self, *args, **kwargs): if 'style' in kwargs: style = kwargs['style'] else: style = 0 kwargs['style'] = style | wx.LC_VIRTUAL | wx.TL_SINGLE super(AttributeListCtrl, self).__init__(*args, **kwargs) self.InsertColumn(0, 'Attribute')