def __init__(self, parent, giface, data, id=wx.ID_ANY, title=_("Reprojection"), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER): self.parent = parent # GMFrame self._giface = giface # used to add layers wx.Dialog.__init__(self, parent, id, title, style=style, name="MultiImportDialog") self.panel = wx.Panel(parent=self, id=wx.ID_ANY) # list of layers columns = [_('Layer id'), _('Name for output GRASS map')] self.layerBox = StaticBox(parent=self.panel, id=wx.ID_ANY) self.layerSizer = wx.StaticBoxSizer(self.layerBox, wx.HORIZONTAL) self.list = GListCtrl(parent=self.panel) for i in range(len(columns)): self.list.InsertColumn(i, columns[i]) width = (65, 180) for i in range(len(width)): self.list.SetColumnWidth(col=i, width=width[i]) self.list.LoadData(data) self.list.SelectAll(True) self.labelText = StaticText(parent=self.panel, id=wx.ID_ANY, label=_( "Projection of following layers do not match with projection of current location. ")) label = _("Layers to be reprojected") self.layerBox.SetLabel(" %s - %s " % (label, _("right click to (un)select all"))) # # buttons # # cancel self.btn_close = Button(parent=self.panel, id=wx.ID_CANCEL) # run self.btn_run = Button( parent=self.panel, id=wx.ID_OK, label=_("&Import && reproject")) self.btn_run.SetToolTip(_("Reproject selected layers")) self.btn_run.SetDefault() self.doLayout()
def __init__(self, parent): GListCtrl.__init__(self, parent) # load extensions self.InsertColumn(0, _("Extension")) self.LoadData()
class ReprojectionDialog(wx.Dialog): """ """ def __init__(self, parent, giface, data, id=wx.ID_ANY, title=_("Reprojection"), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER): self.parent = parent # GMFrame self._giface = giface # used to add layers wx.Dialog.__init__(self, parent, id, title, style=style, name="MultiImportDialog") self.panel = wx.Panel(parent=self, id=wx.ID_ANY) # list of layers columns = [_('Layer id'), _('Name for output GRASS map')] self.layerBox = StaticBox(parent=self.panel, id=wx.ID_ANY) self.layerSizer = wx.StaticBoxSizer(self.layerBox, wx.HORIZONTAL) self.list = GListCtrl(parent=self.panel) for i in range(len(columns)): self.list.InsertColumn(i, columns[i]) width = (65, 180) for i in range(len(width)): self.list.SetColumnWidth(col=i, width=width[i]) self.list.LoadData(data) self.list.SelectAll(True) self.labelText = StaticText( parent=self.panel, id=wx.ID_ANY, label= _("Projection of following layers do not match with projection of current location. " )) label = _("Layers to be reprojected") self.layerBox.SetLabel(" %s - %s " % (label, _("right click to (un)select all"))) # # buttons # # cancel self.btn_close = Button(parent=self.panel, id=wx.ID_CANCEL) # run self.btn_run = Button(parent=self.panel, id=wx.ID_OK, label=_("&Import && reproject")) self.btn_run.SetToolTip(_("Reproject selected layers")) self.btn_run.SetDefault() self.doLayout() def doLayout(self): """Do layout""" dialogSizer = wx.BoxSizer(wx.VERTICAL) dialogSizer.Add(self.labelText, flag=wx.ALL | wx.EXPAND, border=5) self.layerSizer.Add(self.list, proportion=1, flag=wx.ALL | wx.EXPAND, border=5) dialogSizer.Add(self.layerSizer, proportion=1, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=5) # # buttons # btnsizer = wx.BoxSizer(orient=wx.HORIZONTAL) btnsizer.Add(self.btn_close, proportion=0, flag=wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER, border=10) btnsizer.Add(self.btn_run, proportion=0, flag=wx.RIGHT | wx.ALIGN_CENTER, border=10) dialogSizer.Add(btnsizer, proportion=0, flag=wx.BOTTOM | wx.ALIGN_RIGHT, border=10) self.panel.SetSizer(dialogSizer) dialogSizer.Fit(self.panel) self.Layout() def GetData(self, checked): return self.list.GetData(checked)
def __init__(self, parent): GListCtrl.__init__(self, parent) # load extensions self.InsertColumn(0, _('Extension')) self.LoadData()