-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomwidgets_builder.py
58 lines (49 loc) · 3.66 KB
/
customwidgets_builder.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# This file is a part of:
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
# ███▄▄▄▄ ▀█████████▄ ▄████████ ███ ▄██████▄ ▄██████▄ ▄█
# ███▀▀▀██▄ ███ ███ ███ ███ ▀█████████▄ ███ ███ ███ ███ ███
# ███ ███ ███ ███ ███ █▀ ▀███▀▀██ ███ ███ ███ ███ ███
# ███ ███ ▄███▄▄▄██▀ ███ ███ ▀ ███ ███ ███ ███ ███
# ███ ███ ▀▀███▀▀▀██▄ ▀███████████ ███ ███ ███ ███ ███ ███
# ███ ███ ███ ██▄ ███ ███ ███ ███ ███ ███ ███
# ███ ███ ███ ███ ▄█ ███ ███ ███ ███ ███ ███ ███▌ ▄
# ▀█ █▀ ▄█████████▀ ▄████████▀ ▄████▀ ▀██████▀ ▀██████▀ █████▄▄██
# __________________________________________________________________________________
# NBSTool is a tool to work with .nbs (Note Block Studio) files.
# Author: IoeCmcomc (https://github.com/IoeCmcomc)
# Programming language: Python
# License: MIT license
# Source codes are hosted on: GitHub (https://github.com/IoeCmcomc/NBSTool)
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
try:
from pygubu.api.v1 import (
BuilderObject,
register_widget,
)
except ImportError as e:
from pygubu import BuilderObject, register_widget # type: ignore
try:
from customwidgets.wrapmessage import WrapMessage
from customwidgets.checkablelabelframe import CheckableLabelFrame
except ModuleNotFoundError:
from .customwidgets.wrapmessage import WrapMessage
from .customwidgets.checkablelabelframe import CheckableLabelFrame
class WrapMessageBuilder(BuilderObject): # type: ignore
class_ = WrapMessage
OPTIONS_STANDARD = ('anchor', 'background', 'borderwidth', 'cursor', 'font',
'foreground', 'highlightbackground', 'highlightcolor',
'highlightthickness', 'padx', 'pady', 'relief', 'takefocus',
'text', 'textvariable')
OPTIONS_SPECIFIC = ('aspect', 'justify', 'width', 'padding')
properties = OPTIONS_STANDARD + OPTIONS_SPECIFIC
class CheckableLabelFrameBuilder(BuilderObject): # type: ignore
class_ = CheckableLabelFrame
container = True
OPTIONS_STANDARD = ('cursor', 'takefocus', 'style')
OPTIONS_SPECIFIC = ('borderwidth', 'relief', 'padding', 'height', 'width', 'labelanchor', 'text', 'underline', 'variable', 'command')
properties = OPTIONS_STANDARD + OPTIONS_SPECIFIC
register_widget(
'customwidgets.WrapMessage', WrapMessageBuilder, 'WrapMessage', ('tk', 'Custom'))
register_widget(
'customwidgets.CheckableLabelFrame', CheckableLabelFrameBuilder,
'CheckableLabelFrame', ('ttk', 'Custom'))