tomwidgets 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. tomwidgets-0.2.0/.gitignore +78 -0
  2. tomwidgets-0.2.0/PKG-INFO +9 -0
  3. tomwidgets-0.2.0/README.md +9 -0
  4. tomwidgets-0.2.0/Widgets.MD +510 -0
  5. tomwidgets-0.2.0/install_pkg.bat +19 -0
  6. tomwidgets-0.2.0/main.py +4 -0
  7. tomwidgets-0.2.0/pyproject.toml +15 -0
  8. tomwidgets-0.2.0/settings.ini +27 -0
  9. tomwidgets-0.2.0/test.py +29 -0
  10. tomwidgets-0.2.0/tomwidgets/Template/Template.py +231 -0
  11. tomwidgets-0.2.0/tomwidgets/Template/TemplateGroup.py +141 -0
  12. tomwidgets-0.2.0/tomwidgets/Template/Template_back.py +616 -0
  13. tomwidgets-0.2.0/tomwidgets/Template/__init__.py +10 -0
  14. tomwidgets-0.2.0/tomwidgets/__init__.py +88 -0
  15. tomwidgets-0.2.0/tomwidgets/examples/__init__.py +44 -0
  16. tomwidgets-0.2.0/tomwidgets/examples/basetool_example.py +310 -0
  17. tomwidgets-0.2.0/tomwidgets/examples/btnbar_example.py +250 -0
  18. tomwidgets-0.2.0/tomwidgets/examples/cmdeditor_example.py +62 -0
  19. tomwidgets-0.2.0/tomwidgets/examples/cmdhistory_example.py +236 -0
  20. tomwidgets-0.2.0/tomwidgets/examples/cmdmgr_example.py +305 -0
  21. tomwidgets-0.2.0/tomwidgets/examples/cmdwin_example.py +78 -0
  22. tomwidgets-0.2.0/tomwidgets/examples/codetool_example.py +30 -0
  23. tomwidgets-0.2.0/tomwidgets/examples/codewin_example.py +269 -0
  24. tomwidgets-0.2.0/tomwidgets/examples/combobar_example.py +232 -0
  25. tomwidgets-0.2.0/tomwidgets/examples/configeditor_example.py +128 -0
  26. tomwidgets-0.2.0/tomwidgets/examples/configwin_example.py +77 -0
  27. tomwidgets-0.2.0/tomwidgets/examples/crawler_example.py +25 -0
  28. tomwidgets-0.2.0/tomwidgets/examples/dictview_example.py +40 -0
  29. tomwidgets-0.2.0/tomwidgets/examples/editbar_example.py +194 -0
  30. tomwidgets-0.2.0/tomwidgets/examples/emoji_example.py +53 -0
  31. tomwidgets-0.2.0/tomwidgets/examples/eventbus_example.py +222 -0
  32. tomwidgets-0.2.0/tomwidgets/examples/folderbar_example.py +177 -0
  33. tomwidgets-0.2.0/tomwidgets/examples/frame_example.py +564 -0
  34. tomwidgets-0.2.0/tomwidgets/examples/icontool_example.py +23 -0
  35. tomwidgets-0.2.0/tomwidgets/examples/infobox_example.py +274 -0
  36. tomwidgets-0.2.0/tomwidgets/examples/inputbar_example.py +214 -0
  37. tomwidgets-0.2.0/tomwidgets/examples/inputbox_example.py +335 -0
  38. tomwidgets-0.2.0/tomwidgets/examples/inputdialog_example.py +263 -0
  39. tomwidgets-0.2.0/tomwidgets/examples/inputlistbar_example.py +88 -0
  40. tomwidgets-0.2.0/tomwidgets/examples/jsoneditor_example.py +139 -0
  41. tomwidgets-0.2.0/tomwidgets/examples/jsonfile_example.py +101 -0
  42. tomwidgets-0.2.0/tomwidgets/examples/menubtn_example.py +219 -0
  43. tomwidgets-0.2.0/tomwidgets/examples/optionbar_example.py +92 -0
  44. tomwidgets-0.2.0/tomwidgets/examples/optionmenu_example.py +236 -0
  45. tomwidgets-0.2.0/tomwidgets/examples/popmenu_example.py +160 -0
  46. tomwidgets-0.2.0/tomwidgets/examples/pyinstall_example.py +22 -0
  47. tomwidgets-0.2.0/tomwidgets/examples/retool_example.py +27 -0
  48. tomwidgets-0.2.0/tomwidgets/examples/segoe_example.py +51 -0
  49. tomwidgets-0.2.0/tomwidgets/examples/singletonbase_example.py +255 -0
  50. tomwidgets-0.2.0/tomwidgets/examples/stapling_example.py +214 -0
  51. tomwidgets-0.2.0/tomwidgets/examples/tabview_example.py +276 -0
  52. tomwidgets-0.2.0/tomwidgets/examples/template_example.py +172 -0
  53. tomwidgets-0.2.0/tomwidgets/examples/templategroup_example.py +411 -0
  54. tomwidgets-0.2.0/tomwidgets/examples/templatewin_example.py +65 -0
  55. tomwidgets-0.2.0/tomwidgets/examples/templatex_example.py +196 -0
  56. tomwidgets-0.2.0/tomwidgets/examples/text_example.py +234 -0
  57. tomwidgets-0.2.0/tomwidgets/examples/textbar_example.py +471 -0
  58. tomwidgets-0.2.0/tomwidgets/examples/textbox_example.py +417 -0
  59. tomwidgets-0.2.0/tomwidgets/examples/texttwo_example.py +78 -0
  60. tomwidgets-0.2.0/tomwidgets/examples/titlebar_example.py +338 -0
  61. tomwidgets-0.2.0/tomwidgets/examples/toolwin_example.py +9 -0
  62. tomwidgets-0.2.0/tomwidgets/examples/urltool_example.py +22 -0
  63. tomwidgets-0.2.0/tomwidgets/examples/visiblebtn_example.py +502 -0
  64. tomwidgets-0.2.0/tomwidgets/examples/wrapbox_example.py +234 -0
  65. tomwidgets-0.2.0/tomwidgets/examples/wrapbtnbar_example.py +250 -0
  66. tomwidgets-0.2.0/tomwidgets/model/Cmd.py +12 -0
  67. tomwidgets-0.2.0/tomwidgets/model/CmdHistory.py +233 -0
  68. tomwidgets-0.2.0/tomwidgets/model/Emoji.py +1990 -0
  69. tomwidgets-0.2.0/tomwidgets/model/Segoe.py +95 -0
  70. tomwidgets-0.2.0/tomwidgets/model/__init__.py +4 -0
  71. tomwidgets-0.2.0/tomwidgets/tools/CodeTool.py +261 -0
  72. tomwidgets-0.2.0/tomwidgets/tools/Crawler.py +252 -0
  73. tomwidgets-0.2.0/tomwidgets/tools/IconTool.py +45 -0
  74. tomwidgets-0.2.0/tomwidgets/tools/PyInstall.py +127 -0
  75. tomwidgets-0.2.0/tomwidgets/tools/RETool.py +509 -0
  76. tomwidgets-0.2.0/tomwidgets/tools/TextTwo.py +498 -0
  77. tomwidgets-0.2.0/tomwidgets/tools/UrlTool.py +226 -0
  78. tomwidgets-0.2.0/tomwidgets/tools/Urls.py +148 -0
  79. tomwidgets-0.2.0/tomwidgets/tools/__init__.py +13 -0
  80. tomwidgets-0.2.0/tomwidgets/util/ClassUtil.py +90 -0
  81. tomwidgets-0.2.0/tomwidgets/util/EventBus.py +48 -0
  82. tomwidgets-0.2.0/tomwidgets/util/JsonFile.py +88 -0
  83. tomwidgets-0.2.0/tomwidgets/util/ModuleUtil.py +24 -0
  84. tomwidgets-0.2.0/tomwidgets/util/__init__.py +10 -0
  85. tomwidgets-0.2.0/tomwidgets/widget/BaseWin.py +278 -0
  86. tomwidgets-0.2.0/tomwidgets/widget/BtnBar.py +346 -0
  87. tomwidgets-0.2.0/tomwidgets/widget/CmdEditor.py +237 -0
  88. tomwidgets-0.2.0/tomwidgets/widget/CmdMgr.py +95 -0
  89. tomwidgets-0.2.0/tomwidgets/widget/CmdWin.py +311 -0
  90. tomwidgets-0.2.0/tomwidgets/widget/CodeWin.py +602 -0
  91. tomwidgets-0.2.0/tomwidgets/widget/ComboBar.py +214 -0
  92. tomwidgets-0.2.0/tomwidgets/widget/Config.py +151 -0
  93. tomwidgets-0.2.0/tomwidgets/widget/ConfigEditor.py +371 -0
  94. tomwidgets-0.2.0/tomwidgets/widget/ConfigWin.py +229 -0
  95. tomwidgets-0.2.0/tomwidgets/widget/DictView.py +198 -0
  96. tomwidgets-0.2.0/tomwidgets/widget/EditBar.py +264 -0
  97. tomwidgets-0.2.0/tomwidgets/widget/FolderBar.py +311 -0
  98. tomwidgets-0.2.0/tomwidgets/widget/InfoBox.py +180 -0
  99. tomwidgets-0.2.0/tomwidgets/widget/InputBar.py +60 -0
  100. tomwidgets-0.2.0/tomwidgets/widget/InputBox.py +170 -0
  101. tomwidgets-0.2.0/tomwidgets/widget/InputListBar.py +244 -0
  102. tomwidgets-0.2.0/tomwidgets/widget/JsonEditor.py +325 -0
  103. tomwidgets-0.2.0/tomwidgets/widget/MenuBtn.py +120 -0
  104. tomwidgets-0.2.0/tomwidgets/widget/OptionBar.py +248 -0
  105. tomwidgets-0.2.0/tomwidgets/widget/PopMenu.py +31 -0
  106. tomwidgets-0.2.0/tomwidgets/widget/Settings.py +135 -0
  107. tomwidgets-0.2.0/tomwidgets/widget/Stapling.py +104 -0
  108. tomwidgets-0.2.0/tomwidgets/widget/TemplateWin.py +414 -0
  109. tomwidgets-0.2.0/tomwidgets/widget/TextBar.py +706 -0
  110. tomwidgets-0.2.0/tomwidgets/widget/Theme.py +298 -0
  111. tomwidgets-0.2.0/tomwidgets/widget/TitleBar.py +337 -0
  112. tomwidgets-0.2.0/tomwidgets/widget/ToolWin.py +334 -0
  113. tomwidgets-0.2.0/tomwidgets/widget/VisibleBtn.py +230 -0
  114. tomwidgets-0.2.0/tomwidgets/widget/WinMgr.py +65 -0
  115. tomwidgets-0.2.0/tomwidgets/widget/WrapBox.py +176 -0
  116. tomwidgets-0.2.0/tomwidgets/widget/WrapBtnBar.py +317 -0
  117. tomwidgets-0.2.0/tomwidgets/widget/__init__.py +65 -0
  118. tomwidgets-0.2.0/tomwidgets/widget/basic/BaseWidget.py +73 -0
  119. tomwidgets-0.2.0/tomwidgets/widget/basic/Button.py +13 -0
  120. tomwidgets-0.2.0/tomwidgets/widget/basic/CheckBox.py +8 -0
  121. tomwidgets-0.2.0/tomwidgets/widget/basic/ComboBox.py +10 -0
  122. tomwidgets-0.2.0/tomwidgets/widget/basic/Dragging.py +62 -0
  123. tomwidgets-0.2.0/tomwidgets/widget/basic/Entry.py +7 -0
  124. tomwidgets-0.2.0/tomwidgets/widget/basic/EventBus.py +48 -0
  125. tomwidgets-0.2.0/tomwidgets/widget/basic/EventHandler.py +36 -0
  126. tomwidgets-0.2.0/tomwidgets/widget/basic/Font.py +6 -0
  127. tomwidgets-0.2.0/tomwidgets/widget/basic/Frame.py +17 -0
  128. tomwidgets-0.2.0/tomwidgets/widget/basic/Image.py +6 -0
  129. tomwidgets-0.2.0/tomwidgets/widget/basic/InputDialog.py +10 -0
  130. tomwidgets-0.2.0/tomwidgets/widget/basic/Label.py +7 -0
  131. tomwidgets-0.2.0/tomwidgets/widget/basic/OptionMenu.py +13 -0
  132. tomwidgets-0.2.0/tomwidgets/widget/basic/ProgressBar.py +7 -0
  133. tomwidgets-0.2.0/tomwidgets/widget/basic/RadioButton.py +9 -0
  134. tomwidgets-0.2.0/tomwidgets/widget/basic/ScrollableFrame.py +21 -0
  135. tomwidgets-0.2.0/tomwidgets/widget/basic/Scrollbar.py +7 -0
  136. tomwidgets-0.2.0/tomwidgets/widget/basic/SegmentedButton.py +8 -0
  137. tomwidgets-0.2.0/tomwidgets/widget/basic/Slider.py +8 -0
  138. tomwidgets-0.2.0/tomwidgets/widget/basic/Switch.py +7 -0
  139. tomwidgets-0.2.0/tomwidgets/widget/basic/Tabview.py +7 -0
  140. tomwidgets-0.2.0/tomwidgets/widget/basic/Text.py +254 -0
  141. tomwidgets-0.2.0/tomwidgets/widget/basic/Textbox.py +215 -0
  142. tomwidgets-0.2.0/tomwidgets/widget/basic/Tk.py +7 -0
  143. tomwidgets-0.2.0/tomwidgets/widget/basic/Toplevel.py +11 -0
  144. tomwidgets-0.2.0/tomwidgets/widget/basic/__init__.py +25 -0
  145. tomwidgets-0.2.0/tomwidgets/widget/theme/theme_gold.json +369 -0
  146. tomwidgets-0.2.0/tools.ini +45 -0
@@ -0,0 +1,78 @@
1
+ # Python specific
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+ MANIFEST
23
+
24
+ # Virtual environments
25
+ .venv/
26
+ venv/
27
+ env/
28
+ ENV/
29
+
30
+ # IDE and editor files
31
+ .vscode/
32
+ .idea/
33
+ *.swp
34
+ *.swo
35
+ *~
36
+
37
+ # OS generated files
38
+ .DS_Store
39
+ .DS_Store?
40
+ ._*
41
+ .Spotlight-V100
42
+ .Trashes
43
+ ehthumbs.db
44
+ Thumbs.db
45
+
46
+ # Logs
47
+ *.log
48
+
49
+ # Environment variables
50
+ .env
51
+ .env.local
52
+ .env.*.local
53
+
54
+ # Testing
55
+ .coverage
56
+ .pytest_cache/
57
+ htmlcov/
58
+
59
+ # Distribution
60
+ *.tar.gz
61
+ *.whl
62
+
63
+ # others
64
+ templates/
65
+ output/
66
+ /test_*
67
+
68
+ sample_config.ini
69
+ example.json
70
+ config.json
71
+ settings.json
72
+ test_templatetool.py
73
+ TEMPLATETOOL_README.md
74
+ template.json
75
+ test_templatewin.py
76
+ verify_template_config.py
77
+ simple_test.py
78
+ sample_template.j2
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: tomwidgets
3
+ Version: 0.2.0
4
+ Summary: Customize widgets and theme tool, based on tkinter
5
+ Author: Thomas Mei
6
+ Requires-Python: >=3.7
7
+ Requires-Dist: customtkinter
8
+ Requires-Dist: jinja2
9
+ Provides-Extra: dev
@@ -0,0 +1,9 @@
1
+ # tomwidgets
2
+
3
+ Toolkit for developing graphical interfaces
4
+
5
+
6
+ # Usage:
7
+
8
+ * Download code
9
+ * run main.py
@@ -0,0 +1,510 @@
1
+ # Widget design
2
+
3
+ ## CodeTool
4
+
5
+ create CodeTool class in tools folder
6
+
7
+ * use BaseWin as base class, use camel case for method and variable, create an example in tomwidgets.examples
8
+ * features
9
+ * manage(open, add, del, update) TemplateGroup
10
+ * show and update configuration for TemplateGroup
11
+ * show and update variables for Template in TemplateGroup
12
+ * manage Template in TemplateGroup
13
+ * render Template in TemplateGroup
14
+ * render all Template in TemplateGroup
15
+ * UI
16
+ * contains a BtnBar, with open and add buttons. Can open a TemplateGroup folder, or create a forlder for TemplateGroup
17
+ * After open TemplateGroup, show a Tabview for each Template in the TemplateGroup
18
+ * In each tab of Tabview, show a TemplateWin for the Template
19
+
20
+ ## TemplateGroup
21
+
22
+ create TemplateGroup.py file in template folder
23
+
24
+ * features
25
+ * init with a folder, and create TempalteX for each file in the folder
26
+ * template.json: configuration file for template group, read or create it when initial
27
+ * rootPath: root target path for all template of the group
28
+ * variables: key and values for all template variables
29
+ * manage(add, create, read, update, delete) a group of TemplateX
30
+ * manage all variables for a group of TemplateX
31
+ * render all TemplateX
32
+
33
+ ## Template
34
+
35
+ Template in Template folder extends Jinja2.Template
36
+
37
+ 1. the creation method has source, filePath arguments, is source is not None, create template from source. If source is None and filePath is not None, create template from filePath. Save filePath as class member
38
+ 2. add a method "variables" to return all variables in template content
39
+ 3. method updateTemplate(self, source: str = None) to update template file
40
+ 4. method saveRenderResult(self, path: str, **kwargs) to save rendered tempalte file to path
41
+
42
+ ## TemplateWin
43
+
44
+ create TemplateWin class in tools folder
45
+
46
+ * use BaseWin as base class, use camel case for method and variable, create an example in tomwidgets.examples
47
+ * dependency
48
+
49
+ * jinja2
50
+ * features
51
+
52
+ * there are two types of template
53
+
54
+ * template-new : create a new file by template
55
+ * template-update : update an existing file
56
+ * open, create, import, delete jinja2 templates
57
+ * configuration for template
58
+
59
+ * add configuration dict to template at begining of template begin with "{#" and end with "#}"
60
+ * key=type, value = [creation, updation]
61
+ * key=target, value = path of folder or file
62
+ * template-new
63
+
64
+ * It is a jinja2 template to generate new file
65
+ * configurations for template
66
+ * template name
67
+ * target folder
68
+ * jinja2 arguments
69
+ * template-update
70
+
71
+ * It is a jinja2 template to update existing file
72
+ * configurations for template
73
+ * template name
74
+ * target folder
75
+ * jinja2 arguments
76
+ * configuration file: template.json
77
+
78
+ * key=home, value=path for template files
79
+ * key=import_folders, value=a list of folders to import template
80
+ * key=groups, value=template group list
81
+ * UI
82
+
83
+ * contains a TitleBar to show tempalte name, default is empty
84
+ * contains a BtnBar with serveral buttons(open, create, import, delete)
85
+ * open - open an existing template
86
+ * create - create a new template
87
+ * import - copy an existing file to template home folder
88
+ * delete - delete current template
89
+ * after load or create or import a template, show InputListBar to input arguments for template
90
+ * configure type and target in InputListBar
91
+ * contains a CodeWin to show template content
92
+
93
+ ## InputListBar
94
+
95
+ create InputListBar class in widgets folder
96
+
97
+ * use basic.Frame, use camel case for method and variable, create an example in tomwidgets.examples
98
+ * in can input values for several arguments
99
+ * UI
100
+ * show InputBar for each arguments
101
+ * show remove button for each InputBar
102
+ * Action
103
+ * set(arguments:dict) - set arguments to InputListBar and show InputBar for each arguments
104
+ * add(arguments:dict) - add arguments to InputListBar and show InputBar for each arguments
105
+ * remove(names:list) - remove names from the arguments list and remove related InputBar
106
+ * confirm() - confirm for the argumetns and generate confirm event by EventHandler
107
+ * cancel() - generate cancel event by EventHandler
108
+ * toggleBtnbar() - show/hide confirm
109
+
110
+ ## BtnBar
111
+
112
+ create tomwidgets.BtnBar class
113
+
114
+ 1. use basic.Frame as base class, use camel case for method and variable, create an example in tomwidgets.examples, create unit test in tomwidgets.tests,
115
+ 2. can add/remove buttons and callbacks
116
+ 3. can add/remove a list of buttons and callbacks
117
+ 4. can modify button text
118
+
119
+ ## ConfigEditor
120
+
121
+ create a ConfigEditor class in widget
122
+
123
+ 1. use basic.Frame as base class, use camel case for method and variable, create an example in tomwidgets.examples, create unit test in tomwidgets.tsts,
124
+ 2. can show all settings in config file
125
+ 3. can edit all settings in config file
126
+ 4. can save changes
127
+ 5. add 2 methods
128
+ addSection
129
+ addOptioncan add new section and option to config file
130
+ add new buttons to invoke new section and option
131
+
132
+ ## MessageBox
133
+
134
+ create a MessageBox class in widget
135
+
136
+ 1. use basic.TopLevel as base class, use camel case for method and variable, create an example in tomwidgets.examples
137
+ 2. show a dialog with title, message and confirm button
138
+
139
+ ## InputBox
140
+
141
+ create a InputBox class
142
+
143
+ * use basic.InputDialog as base class, use camel case for method and variable, create an example in tomwidgets.examples
144
+ * can input string, number, password etc
145
+
146
+ ## VisibleBtn
147
+
148
+ create a VisibleBtn class
149
+
150
+ * use basic.Button as base class, use camel case for method and variable, create an example in tomwidgets.examples
151
+ * can bind a group of widgets
152
+ * can toggle show/hide a group of widgets
153
+
154
+ ## MenuBtn
155
+
156
+ create a MenuBtn class
157
+
158
+ * use basic.Button and PopMenu as base class, use camel case for method and variable, create an example in tomwidgets.examples
159
+ * click it to show menu
160
+
161
+ ## TitleBar
162
+
163
+ create a TitleBar class
164
+
165
+ * use basic.Frame base class, use camel case for method and variable, create an example in tomwidgets.examples
166
+ * add a MenuBtn on left of it
167
+ * add a Label in middle of it
168
+ * add a VisibleBtn at right of it
169
+
170
+ ## TextBar
171
+
172
+ create a TextBar class
173
+
174
+ * use basic.Frame base class, use camel case for method and variable, create an example in tomwidgets.examples
175
+ * add a TitleBar at top of it, the TitleBar can be show or hide
176
+ * add a InputBar as find bar to find text in TextBox and highlight the result
177
+ * add a TextBox as content
178
+ * can add text with size and color to TextBox
179
+ * can change any part of the text to any color and size
180
+ * make it draggable
181
+ * add menu to TextBar.titleBar
182
+ * copy : copy text to clipboard
183
+ * paste
184
+ * cut
185
+ * undo
186
+ * redo
187
+ * strip: clear blank space for each tail of line
188
+ * clear: clear text
189
+ * show PopMenu when right click
190
+
191
+ ## Textbox
192
+
193
+ 1. add new method addText(text, color, size), add text to end of widget
194
+ 2. add new method addText(text, font), add text to end of widget
195
+ 3. add new method changeFont(index1, index2), change font from index1 to index2
196
+
197
+ ## BaseWin
198
+
199
+ BaseWin class
200
+
201
+ * use basic.Frame as base class, use camel case for method and variable, create an example in tomwidgets.examples
202
+ * add a TitleBar at top of it, the TitleBar can be show or hide
203
+ * add menu commands to TitleBar, it include max, min, onTop toggle, system title toggle, stapling, exit
204
+ * add methods:
205
+ * (widgets), it can bind widgets to TitleBar VisibleBtn
206
+
207
+ ## DictView
208
+
209
+ DictView class
210
+
211
+ * use basic.TextBar as base class, use camel case for method and variable, create an example in tomwidgets.examples
212
+ * show dict key and value in format
213
+ key = value
214
+ * can config font and color for key and value
215
+
216
+ ## OptionBar
217
+
218
+ OptionBar class
219
+
220
+ * use basic.Frame as base class, use ca mel case for method and variable, create an example in tomwidgets.examples
221
+ * add basic.Label as title
222
+ * add basic.OptionMenu as options list
223
+ * can change title, color, font ect
224
+ * can raise event after select an option
225
+
226
+ ## WrapBox
227
+
228
+ WrapBox class
229
+
230
+ * use basic.Textbox as base class, use camel case for method and variable, create an example in tomwidgets.examples
231
+ * addWidget method : add a widget to it
232
+ * delWidget method : del a widget from it
233
+ * insertWidget method : insert a widget to it
234
+ * auto wrap the content in it
235
+
236
+ ## WrapBtnBar
237
+
238
+ WrapBtnBar class
239
+
240
+ * extend widget.WrapBox, use camel case for method and variable, create an example in tomwidgets.examples
241
+ * work like widget.BtnBar
242
+
243
+ ## ConfigWin
244
+
245
+ ConfigWin class
246
+
247
+ * extend widget.BaseWin, use camel case for method and variable, create an example in tomwidgets.examples
248
+ * contains a ConfigEditor
249
+
250
+ ## FolderBar
251
+
252
+ FolderBar class
253
+
254
+ * extend widget.OptionBar, use camel case for method and variable, create an example in tomwidgets.examples
255
+ * can show a list of folder
256
+ * include a addBtn, click it to add a folder to folder list
257
+ * include a delBtn, click it to delete a folder from folder list
258
+ * after select a folder, change current folder to it
259
+
260
+ ## ToolWin
261
+
262
+ ToolWin class
263
+
264
+ * extend widget.BaseWin, use camel case for method and variable, create an example in tomwidgets.examples
265
+ * contains a Tabview
266
+ * read data from tools.ini
267
+ * for each section in data, create a tab in Tabview, and create a WrapBox in tab
268
+ * for each option in the section, create a Button in WrapBox, after click the button, run the cmd
269
+
270
+ ## CmdMgr
271
+
272
+ CmdMgr class
273
+
274
+ * It is a singleton class, use camel case for method and variable, create an example in tomwidgets.examples
275
+ * contains a CmdHistory, it can maintain a global cmd history
276
+
277
+ ## EventBus
278
+
279
+ class EventBus
280
+
281
+ * use camel case for method and variable, create an example in tomwidgets.examples
282
+ * it contains 2 methods
283
+ * generateEvent: generate an event to callbacks
284
+ * bindEvent: register a callback for an event
285
+
286
+ ## CmdWin
287
+
288
+ class CmdWin
289
+
290
+ * extends BaseWin. use camel case for method and variable, create an example in tomwidgets.examples
291
+ * contains CmdMgr
292
+ * show TitleBar at top and show FolderBar next.
293
+ * contains a OptionBar to show Cmd.name list in CmdMgr
294
+ * contains a TextBar to show Cmd details
295
+ * after select a Cmd in OptionBar, show details in TextBar
296
+ * contains a BtnBar, it has two Buttons, Run button and Cancel button. Click the Run button to run the selected Cmd again. Click Cancel button to clear the detials for Cmd
297
+
298
+ ## CmdWin
299
+
300
+ CmdBar class
301
+
302
+ * extends basic.Frame. use camel case for method and variable, create an example in tomwidgets.examples
303
+ * contains 2 CmdMgr, one is used to manage cmd list, another one is used to manage cmd execution history
304
+ * The UI
305
+
306
+ * contains a OptionBar to show cmd list in CmdMgr
307
+ * contains a Entry
308
+ * contains a BtnBar, with 2 buttons, Run button and Cancel button.
309
+ * contains a OptionBar, which show the execution history, after select an option in it, show the history in TextBar
310
+ * contains a TextBar.
311
+ * Action
312
+
313
+ * after select a item in OptionBar, show the cmd line in Entry
314
+ * after click Run button, execute the cmd in the Entry and show output in TextBar, and save the cmd and output to history CmdMgr
315
+ * after click Cancel button, clear TextBar
316
+
317
+ ## CmdBar
318
+
319
+ CmdEditor class
320
+
321
+ * It could edit the cmd and input parameter for cmd
322
+ * Each parameter is marked with {} in cmd. such as "dir {path}", the parameter name is path, after user input d:/ for path, the cmd becomes "dir d:/"
323
+ * extends basic.Frame. use camel case for method and variable, create an example in tomwidgets.examples
324
+ * contains a StringVar for cmd text
325
+ * contains a dict for cmd parameters
326
+ * The UI
327
+
328
+ * contains a InputBar to show StringVar for cmd
329
+ * contains a InputBar to show Formatted cmd
330
+ * contains a list of InputBar to input parameter for cmd
331
+ * Action
332
+
333
+ * setCmd: set the cmd StringVar
334
+ * showParameterInput: show InputBar for each parameter in cmd.
335
+ * moveFocusToNextInputBar: if enter in parameter InputBar, move focus to next parameter InputBar
336
+ * after user input value for parameter, format the cmd with value
337
+ * after input enter in inputbar, move focus to next inputbar
338
+ * if there is no parameter in cmd, don't show InputBar for formatted cmd
339
+
340
+ ## RETool
341
+
342
+ RETool class in tools folder
343
+
344
+ * extends BaseWin. use camel case for method and variable, create an example in tomwidgets.examples
345
+ * UI
346
+ * contains an OptionBar to show a list of re pattern, such as r"\d+""
347
+ * contains an InputBar to show selected re pattern
348
+ * contains a BtnBar, and 3 buttons in Btnbar, Join button, Switch Button and Find Button
349
+ * contains a Entry at right of BtnBar
350
+ * contains a Fram as mainFrame
351
+ * in mainFrame, contains two TextBar.
352
+ * Left TextBar is Input bar, can input any text
353
+ * Right TextBar is output bar, can show the RE find result
354
+ * Action
355
+ * In selected pattern, after enter pressed, use re find for the input text and show result in output bar
356
+ * after click Join button, join lines in input, and show result in output
357
+ * after click Switch button, switch text between input and output
358
+ * after click find button, find text in Entry in both input and output and mark the found text color to yellow
359
+
360
+ ## IconTool
361
+
362
+ IconTool class in tools folder
363
+
364
+ * extends BaseWin. use camel case for method and variable, create an example in tomwidgets.examples
365
+ * UI
366
+ * contains Tabview with two tabs, one tab is emoji and another tab is segoe
367
+ * in each tab, contains a TextBar, in emoji tab, show all emoji icon, in segoe tab, show all segoe icon
368
+
369
+ ## PyInstall
370
+
371
+ PyInstall class in tools folder
372
+
373
+ * extends BaseWin. use camel case for method and variable, create an example in tomwidgets.examples
374
+ * UI
375
+ * contains a BtnBar with 2 buttons
376
+ * button 1: create pyproject_example.toml file
377
+ * button 2: create install_pkg_example.bat file, and content is "pip install -e ."
378
+
379
+ ## UrlTool
380
+
381
+ UrlTool class in tools folder
382
+
383
+ * extends BaseWin. use camel case for method and variable, create an example in tomwidgets.examples
384
+ * UI
385
+ * contains a InputBar to input url
386
+ * if url contains {xxx}, show InputBar to input xxx for url
387
+ * contains a InputBar to show formated url
388
+ * contains a BtnBar with 2 buttons
389
+ * button(open) : open url in browser
390
+ * button(clear) : clear text in InputBar
391
+
392
+ ## Urls
393
+
394
+ Urls class in tools folder
395
+
396
+ * extends BaseWin. use camel case for method and variable, create an example in tomwidgets.examples
397
+ * It can read tools.ini, url section, and show all urls in UI
398
+ * UI
399
+ * contains a CheckBox(private)
400
+ * contains a OptionMenu, show all the urls
401
+ * Action
402
+ * after select a url, open it in browser
403
+ * if CheckBox(private) is checked, open url in private mode
404
+
405
+ ## CodeWin
406
+
407
+ CodeWin class in widget folder
408
+
409
+ * extends BaseWin. use camel case for method and variable, create an example in tomwidgets.examples
410
+ * can show code with syntax color, it can support python, kotlin, java, js, ts etc
411
+ * can auto detect code type and show correct syntax color
412
+ * UI
413
+ * contains a OptionBar, it show a list of language(python, kotlin, java, js, ts), after select a language in the list, change the correct syntax color
414
+ * contains a InputBar, can search or replace code
415
+ * contains a TextBar to show code
416
+ * Menu
417
+ * open: open a file
418
+ * save: save the opened file
419
+ * save as: save to a file
420
+
421
+ ## TextTwo
422
+
423
+ TextTwo class in tools folder
424
+
425
+ * extends BaseWin. use camel case for method and variable, create an example in tomwidgets.examples
426
+ * UI
427
+ * contains a search bar, can search and replace text in TextBar
428
+ * contains a horizontal BtnBar
429
+ * contains two TextBar(input TextBar, output TextBar), and a vertical BtnBar between TextBar
430
+ * Action
431
+ * can switch text between input and output
432
+ * can compare text between input and output
433
+ * can search and replace text in input and output
434
+ * can move input to output or move output to input
435
+
436
+ ## Crawler
437
+
438
+ Crawler class in tools folder
439
+
440
+ * extends BaseWin. use camel case for method and variable, create an example in tomwidgets.examples
441
+ * UI
442
+ * contains a Input bar(url bar), input url for crawler
443
+ * contains a Input bar(RE find), to find text in TextTwo
444
+ * contains a BtnBar, with buttons(run, find etc.)
445
+ * contains a TextTwo to show downloaded text in T1
446
+ * Action
447
+ * click run button to download html, and show downloaded text in TextTwo.T1
448
+ * click find to find in TextTwo.T1 with regex, and show find result in TextTwo.T2
449
+
450
+ ## JsonFile
451
+
452
+ JsonFile class util folder
453
+
454
+ * extends EventBus. use camel case for method and variable, create an example in tomwidgets.examples
455
+ * init:
456
+ * path: file path, open it or create it
457
+ * could use key or [] to get item value in json
458
+
459
+ ## JsonEditor
460
+
461
+ create a JsonEditor class in widget
462
+
463
+ 1. use basic.Frame as base class, use camel case for method and variable, create an example in tomwidgets.examples
464
+ 2. use same UI as ConfigEditor
465
+ 3. use JsonFile to manage data
466
+ 4. can show all key, value in json file
467
+ 5. can edit all key, value in json file
468
+ 6. can save changes
469
+ 7. Methods
470
+ 1. add(key, value)
471
+ 2. update(key, value)
472
+ 3. remove(key)
473
+
474
+ ## MessageBox
475
+
476
+ create a MessageBox class in widget
477
+
478
+ 1. use camel case for method and variable, create an example in tomwidgets.examples
479
+ 2. works like tkinter.messagebox
480
+
481
+ ## EditBar
482
+
483
+ create a EditBar class in widget
484
+
485
+ 1. use camel case for method and variable, create an example in tomwidgets.examples
486
+ 2. UI
487
+
488
+ 1. contains a basic.Label as title
489
+ 2. contains a basic.Entry as input box
490
+ 3. contains a widget.BtnBar, and it contains edit, remove buttons
491
+ 3. Action
492
+
493
+ 1. input box is read only
494
+ 2. click edit button to show a dialog to input new value
495
+ 3. click remove button to show a confirm dialog
496
+ 4. arguments of EditBar.__init__
497
+
498
+ title
499
+
500
+ defaultValue
501
+
502
+ readonly
503
+
504
+ editCallback
505
+
506
+ editConfirmCallback
507
+
508
+ removeCallback
509
+
510
+ removeConfirmCallback
@@ -0,0 +1,19 @@
1
+ @REM Install the package in editable mode
2
+ @REM
3
+ @REM Usage:
4
+ @REM build package:
5
+ @REM python -m build
6
+ @REM
7
+ @REM # upload to TestPyPI
8
+ @REM twine upload --repository testpypi dist/*
9
+ @REM
10
+ @REM # upload to PyPI
11
+ @REM twine upload dist/*
12
+ @REM
13
+ @REM dev mode:
14
+ @REM pip install -e .
15
+ @REM
16
+ @REM install local:
17
+ @REM pip install .
18
+ @REM
19
+ pip install -e .
@@ -0,0 +1,4 @@
1
+ from tomwidgets import ToolWin
2
+
3
+ if __name__ == "__main__":
4
+ ToolWin().show()
@@ -0,0 +1,15 @@
1
+ [build-system]
2
+ requires = ["hatchling >= 1.26"]
3
+ build-backend = "hatchling.build"
4
+
5
+
6
+ [project]
7
+ name = "tomwidgets"
8
+ version = "0.2.0"
9
+ description = "Customize widgets and theme tool, based on tkinter"
10
+ authors = [{ name = "Thomas Mei" }]
11
+ requires-python = ">=3.7"
12
+ dependencies = ["customtkinter", "jinja2"]
13
+
14
+ [project.optional-dependencies]
15
+ dev = []
@@ -0,0 +1,27 @@
1
+ [folder]
2
+ c = c:
3
+ d = d:
4
+
5
+ [window]
6
+ installtool_position = 976,849
7
+ tools_position = 815,1430
8
+ cmdwin_position = 327,165
9
+ urltool_position = 1162,385
10
+ basewin_position = 784,1658
11
+ segoetool_position = 678,178
12
+ specifytool_position = -8,1192
13
+ mybasewin_position = 805,228
14
+ configwin_position = 632,1505
15
+ toolwin_position = 1590,0
16
+ mybasetool_position = 503,357
17
+ cmdbarexample_position = 1160,520
18
+ retool_position = -8,1192
19
+ icontool_position = -8,1192
20
+ pyinstall_position = 649,1468
21
+ mediatool_position = 552,309
22
+ urls_position = 1271,831
23
+ codewin_position = 130,130
24
+ texttwo_position = 393,1402
25
+ templatewin_position = -8,-8
26
+ codetool_position = 628,86
27
+
@@ -0,0 +1,29 @@
1
+ import tkinter as tk
2
+
3
+ import tomwidgets.examples
4
+ from tomwidgets import ModuleUtil
5
+ from tomwidgets import Theme
6
+ from tomwidgets import Tk, WrapBox, Button
7
+
8
+
9
+ def test():
10
+ Theme.init()
11
+
12
+ root = Tk()
13
+ root.geometry("600x380")
14
+ root.title("tomwidgets Examples Test")
15
+
16
+ box = WrapBox(root)
17
+ box.pack(side=tk.TOP, fill=tk.BOTH, expand=True)
18
+
19
+ btnInfo = ModuleUtil.getCallable(tomwidgets.examples)
20
+
21
+ for name, attr in btnInfo.items():
22
+ btn = Button(box, text=name.split("_example")[0], command=attr)
23
+ box.addWidget(btn)
24
+
25
+ root.mainloop()
26
+
27
+
28
+ if __name__ == "__main__":
29
+ test()