代码拉取完成,页面将自动刷新
"""
选择操作
展示几何变换、绘制图形、添加图标、添加滤镜、视觉效果等操作供用户选择
并根据用户选择,切换活动窗口内容
# lzq #
"""
from tkinter import *
from PIL import Image, ImageTk
import UI
class OperationFrame(Frame):
lastHeight = 0
canv = None
varFrm = None
logo = None
def __init__(self, canv, master=None):
self.canv=canv
Frame.__init__(self, master, relief=RAISED, borderwidth=2, bg=UI.bg, width=105, height=655)
logo = Image.open("img\\logo.jpg").resize((102,85))
self.logo = ImageTk.PhotoImage(logo)
Label(self, image=self.logo, width=105, height=90).place(x=0,y=0)
Label(self, text=UI.soft_name,
bitmap=UI.viewBmp, compound='left',
width=UI.leftWidth-10, height=18
).place(x=0,y=90)
self.lastHeight = 115
for key in UI.varFrms:
self.addFunction(key, UI.varFrms[key])
pass
#self.addButton()
def addFunction(self, funcName, funcFrm):
bcolor = UI.bg
fcolor = UI.fg
pw = UI.leftWidth-12
ph = 25
f = UI.font
dy = ph+8
btn = Button(self, text=funcName,
bg=bcolor, fg=fcolor,
bitmap=UI.viewBmp, compound='left',
width=pw, height=ph,
font=f,
command=lambda:self.replace(funcFrm))
btn.place(x=0, y=self.lastHeight)
self.lastHeight += dy
pass
def replace(self, newFrm):
"""
替换右侧的操作面板
"""
self.canv.unbind("<Button-1>")
self.canv.unbind("<ButtonPress-1>")
self.canv.unbind("<B1-Motion>")
self.canv.unbind("<ButtonRelease-1>")
self.canv.unbind("<Double-Button-1>")
if self.varFrm is not None:
self.varFrm.close()
newFrm.show()
self.varFrm = newFrm
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。