1 Star 10 Fork 2

nachifur / MulimgViewer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
path_select.py 2.08 KB
一键复制 编辑 原始数据 按行查看 历史
nachifur 提交于 2021-09-14 21:21 . formatter code
import wx
from path_select_gui import PathSelectFrameGui
from utils import get_resource_path
class PathSelectFrame (PathSelectFrameGui):
def __init__(self, parent, UpdateUI, get_type, title="Parallel manual choose input directory"):
super().__init__(parent)
self.title = title
self.UpdateUI = UpdateUI
self.get_type = get_type
self.Bind(wx.EVT_CLOSE, self.close)
self.icon = wx.Icon(get_resource_path(
'mulimgviewer.ico'), wx.BITMAP_TYPE_ICO)
self.SetIcon(self.icon)
def frame_resize(self, event):
self.m_richText1.SetMinSize(
wx.Size((self.Size.Width, self.Size.Height)))
self.Layout()
self.Refresh()
def refresh_txt(self, input_path=None):
if input_path == None:
pass
else:
str_ = ""
for path in input_path:
str_ = str_+path+"\n"
self.m_richText1.Value = str_
def close(self, event):
if self.get_type() == -1:
self.Destroy()
else:
texts = self.m_richText1.Value
strlist = texts.split('\n')
strlist = [i for i in strlist if i != ""]
self.UpdateUI(0, input_path=strlist)
def add_dir(self, event):
if self.m_dirPicker1.GetPath() == "":
pass
else:
texts = self.m_richText1.Value
strlist = texts.split('\n')
strlist = [i for i in strlist if i != ""]
strlist.append(self.m_dirPicker1.GetPath())
str_ = ""
for path in strlist:
str_ = str_+path+"\n"
self.m_richText1.Value = str_
def clear_all_path(self, event):
self.m_richText1.Clear()
def clear_last_path(self, event):
texts = self.m_richText1.Value
strlist = texts.split('\n')
str_ = ""
if strlist[-1] == "":
strlist.pop()
for value in strlist[0:-1]:
str_ += value+"\n"
self.m_richText1.Value = str_
Python
1
https://gitee.com/nachifur/MulimgViewer.git
git@gitee.com:nachifur/MulimgViewer.git
nachifur
MulimgViewer
MulimgViewer
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891