Skip to content

Commit 976480a

Browse files
committed
First upload of library samples
First upload of library samples
0 parents  commit 976480a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+445
-0
lines changed
8.76 KB
Loading
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import tkinter as tk
2+
from PIL import Image, ImageTk
3+
4+
from GIMPy_Widget_UI import Btn_S1 as bts1
5+
import ttkbootstrap as ttk
6+
7+
def btn_s1_command_rx(value):
8+
print(value)
9+
10+
if __name__ == "__main__":
11+
root = ttk.Window(themename="superhero")
12+
root.title("Button - Style 1")
13+
passive_ui = Image.open("Passive_UI.png").convert("RGBA")
14+
imagesize = passive_ui.size
15+
controls_file_loc = 'Buttons_Demo_Position.txt'
16+
base_photo = ImageTk.PhotoImage(passive_ui)
17+
image_width, image_height = imagesize
18+
# Create a canvas and add the image
19+
canvas = tk.Canvas(root, width=image_width, height=image_height)
20+
canvas.create_image(0, 0, anchor=tk.NW, image=base_photo, tags='baseImage')
21+
canvas.place(x=0, y=0)
22+
canvas.pack()
23+
24+
25+
btn_Africa = bts1("African_Map", canvas,
26+
bts1.str_to_coordinates(controls_file_loc, 'African_Map', 4),
27+
command=btn_s1_command_rx)
28+
btn_Aus = bts1("Au_Map", canvas,
29+
bts1.str_to_coordinates(controls_file_loc, 'Au_Map', 4),
30+
command=btn_s1_command_rx)
31+
32+
btn_round = bts1("Round_Btn", canvas,
33+
bts1.str_to_coordinates(controls_file_loc, 'Round_Btn', 4),
34+
command=btn_s1_command_rx)
35+
36+
btn_silver = bts1("Silver_Btn", canvas,
37+
bts1.str_to_coordinates(controls_file_loc, 'Silver_Btn', 4),
38+
command=btn_s1_command_rx, press_drag_color=(255, 180, 50))
39+
40+
root.mainloop()
12.3 MB
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Button:African_Map:[(123, 103)]:[(84, 8), (83, 9), (80, 9), (79, 10), (77, 10), (76, 11), (64, 11), (63, 12), (59, 12), (58, 13), (56, 13), (54, 15), (53, 15), (52, 16), (51, 16), (50, 17), (49, 17), (47, 19), (47, 20), (45, 22), (45, 23), (44, 24), (44, 25), (42, 27), (42, 28), (36, 34), (35, 34), (34, 35), (33, 35), (32, 36), (31, 36), (30, 37), (29, 37), (25, 41), (24, 41), (23, 42), (23, 43), (22, 44), (22, 46), (21, 47), (21, 49), (20, 50), (20, 53), (19, 54), (19, 61), (20, 62), (20, 74), (19, 75), (19, 80), (20, 81), (20, 85), (21, 86), (21, 88), (22, 89), (22, 91), (23, 92), (23, 93), (26, 96), (26, 97), (28, 99), (28, 100), (35, 107), (37, 107), (39, 109), (41, 109), (42, 110), (44, 110), (45, 111), (47, 111), (48, 112), (64, 112), (65, 111), (67, 111), (68, 110), (71, 110), (72, 109), (74, 109), (75, 108), (77, 108), (78, 107), (79, 107), (80, 108), (81, 108), (82, 109), (84, 109), (85, 110), (87, 110), (88, 111), (89, 111), (90, 112), (92, 112), (94, 114), (94, 123), (95, 124), (95, 127), (96, 128), (96, 130), (97, 131), (97, 132), (101, 136), (101, 137), (102, 138), (102, 139), (105, 142), (105, 143), (106, 144), (106, 156), (104, 158), (104, 159), (103, 160), (103, 161), (102, 162), (102, 164), (101, 165), (101, 174), (102, 175), (102, 178), (103, 179), (103, 180), (104, 181), (104, 182), (105, 183), (105, 184), (106, 185), (106, 186), (110, 190), (110, 191), (111, 192), (111, 194), (112, 195), (112, 200), (113, 201), (113, 204), (114, 205), (114, 210), (115, 211), (115, 213), (116, 214), (116, 215), (117, 216), (117, 217), (118, 218), (118, 219), (123, 224), (125, 224), (126, 225), (127, 225), (128, 226), (131, 226), (132, 227), (147, 227), (148, 226), (151, 226), (152, 225), (154, 225), (155, 224), (157, 224), (159, 222), (160, 222), (164, 218), (164, 217), (165, 216), (165, 215), (167, 213), (167, 211), (168, 210), (168, 207), (169, 206), (169, 204), (172, 201), (173, 201), (178, 196), (178, 194), (179, 193), (179, 189), (180, 188), (180, 185), (181, 184), (181, 182), (186, 177), (187, 177), (188, 176), (189, 176), (190, 175), (191, 175), (193, 173), (193, 172), (194, 171), (194, 170), (195, 169), (195, 158), (194, 157), (194, 154), (193, 153), (193, 148), (192, 147), (192, 140), (193, 139), (193, 136), (198, 131), (198, 130), (202, 126), (203, 126), (208, 121), (209, 121), (217, 113), (217, 112), (218, 111), (218, 110), (220, 108), (220, 107), (221, 106), (221, 104), (222, 103), (222, 101), (223, 100), (223, 97), (224, 96), (224, 91), (225, 90), (225, 85), (224, 84), (224, 82), (218, 82), (217, 83), (215, 83), (214, 84), (212, 84), (211, 85), (202, 85), (199, 82), (199, 81), (198, 80), (198, 79), (197, 79), (196, 78), (195, 78), (187, 70), (187, 69), (186, 68), (186, 67), (182, 63), (182, 62), (180, 60), (180, 59), (178, 57), (178, 55), (175, 52), (175, 51), (173, 49), (173, 48), (172, 47), (172, 46), (170, 44), (170, 42), (169, 41), (169, 30), (168, 29), (168, 28), (167, 28), (166, 27), (158, 27), (157, 28), (148, 28), (147, 27), (144, 27), (143, 26), (142, 26), (141, 25), (140, 25), (139, 24), (136, 24), (135, 23), (134, 23), (133, 24), (131, 24), (129, 26), (129, 27), (125, 31), (124, 31), (123, 30), (122, 30), (121, 29), (120, 29), (118, 27), (117, 27), (116, 26), (115, 26), (113, 24), (111, 24), (110, 23), (108, 23), (106, 21), (106, 20), (105, 19), (105, 10), (103, 10), (102, 9), (85, 9)]
2+
Button:Au_Map:[(258, 285)]:[(312, 171), (311, 172), (310, 172), (309, 173), (309, 175), (308, 176), (308, 179), (307, 180), (307, 183), (306, 184), (306, 186), (305, 187), (305, 190), (304, 191), (304, 213), (303, 214), (303, 215), (302, 216), (302, 217), (297, 222), (295, 222), (294, 221), (293, 221), (289, 217), (289, 216), (286, 213), (285, 213), (284, 212), (283, 212), (282, 211), (281, 211), (280, 210), (279, 210), (278, 209), (276, 209), (275, 208), (274, 208), (270, 204), (270, 203), (275, 198), (276, 198), (277, 197), (277, 190), (279, 188), (280, 188), (280, 182), (279, 181), (273, 181), (272, 182), (263, 182), (262, 181), (261, 181), (260, 180), (259, 180), (258, 179), (257, 179), (255, 177), (254, 177), (253, 176), (251, 176), (250, 175), (249, 175), (248, 174), (243, 174), (243, 176), (242, 177), (243, 178), (243, 179), (244, 179), (246, 181), (246, 182), (244, 184), (237, 184), (236, 185), (234, 185), (230, 189), (229, 189), (228, 190), (228, 191), (227, 192), (227, 193), (226, 194), (226, 195), (225, 196), (225, 197), (224, 198), (224, 200), (223, 201), (223, 203), (220, 206), (219, 205), (218, 205), (211, 198), (209, 198), (208, 197), (204, 197), (203, 198), (202, 198), (197, 203), (196, 203), (195, 204), (194, 204), (189, 209), (189, 210), (188, 211), (188, 213), (187, 214), (187, 218), (186, 219), (186, 221), (184, 223), (181, 220), (177, 220), (176, 221), (176, 222), (175, 223), (175, 226), (176, 227), (176, 230), (175, 231), (175, 233), (170, 238), (163, 238), (162, 239), (162, 240), (161, 241), (161, 242), (158, 245), (149, 245), (148, 246), (147, 246), (145, 248), (144, 248), (143, 249), (142, 249), (141, 250), (139, 250), (138, 251), (136, 251), (130, 257), (130, 258), (129, 259), (129, 262), (128, 263), (127, 262), (123, 262), (120, 265), (120, 266), (119, 267), (119, 269), (118, 270), (118, 277), (119, 278), (119, 281), (120, 282), (120, 284), (124, 288), (124, 289), (125, 290), (125, 291), (124, 292), (123, 292), (122, 291), (122, 290), (121, 289), (121, 288), (120, 289), (119, 288), (119, 290), (118, 291), (118, 295), (119, 296), (119, 298), (121, 300), (121, 301), (123, 303), (123, 304), (125, 306), (125, 307), (126, 308), (126, 309), (127, 310), (127, 311), (128, 312), (128, 314), (129, 315), (129, 318), (130, 319), (130, 321), (131, 322), (131, 323), (132, 324), (132, 326), (133, 327), (133, 328), (134, 329), (134, 330), (135, 331), (135, 333), (136, 334), (136, 335), (137, 336), (137, 339), (138, 340), (138, 349), (134, 353), (134, 358), (135, 359), (135, 360), (139, 364), (160, 364), (166, 358), (167, 358), (169, 356), (170, 356), (171, 355), (172, 355), (173, 354), (194, 354), (195, 353), (196, 353), (198, 351), (198, 350), (199, 349), (199, 348), (200, 347), (200, 346), (204, 342), (205, 342), (206, 341), (208, 341), (209, 340), (211, 340), (212, 339), (213, 339), (214, 338), (217, 338), (218, 337), (221, 337), (222, 336), (225, 336), (226, 335), (231, 335), (232, 334), (238, 334), (239, 333), (242, 333), (243, 334), (247, 334), (248, 335), (251, 335), (252, 336), (253, 336), (255, 338), (256, 338), (262, 344), (262, 345), (263, 346), (263, 348), (264, 349), (264, 350), (265, 351), (265, 352), (266, 353), (266, 354), (268, 356), (272, 356), (273, 355), (273, 353), (275, 351), (275, 350), (277, 348), (277, 347), (278, 346), (278, 345), (280, 343), (281, 344), (281, 347), (280, 348), (280, 349), (281, 350), (281, 351), (284, 351), (285, 350), (286, 350), (287, 351), (286, 352), (286, 354), (285, 355), (285, 356), (282, 359), (281, 359), (281, 361), (280, 362), (281, 363), (281, 365), (284, 365), (285, 364), (286, 364), (288, 362), (290, 362), (295, 367), (295, 375), (296, 376), (296, 378), (297, 379), (297, 380), (299, 382), (300, 382), (301, 383), (302, 383), (303, 384), (309, 384), (310, 385), (311, 385), (315, 389), (320, 389), (323, 386), (325, 386), (329, 390), (339, 390), (339, 389), (346, 382), (348, 382), (349, 381), (358, 381), (360, 379), (360, 377), (361, 376), (361, 365), (362, 364), (362, 362), (363, 361), (363, 360), (366, 357), (366, 356), (368, 354), (368, 351), (373, 346), (374, 346), (374, 345), (375, 344), (375, 342), (376, 341), (376, 340), (379, 337), (380, 337), (383, 334), (383, 326), (384, 325), (384, 324), (385, 323), (385, 322), (386, 321), (386, 306), (387, 305), (387, 303), (388, 302), (388, 292), (387, 292), (385, 290), (386, 289), (386, 283), (381, 283), (379, 281), (379, 279), (378, 278), (378, 276), (377, 275), (377, 273), (376, 272), (375, 272), (374, 271), (372, 271), (370, 269), (370, 268), (369, 267), (369, 266), (368, 265), (367, 265), (366, 264), (365, 264), (364, 263), (365, 262), (365, 254), (363, 252), (360, 252), (358, 250), (358, 248), (357, 247), (357, 246), (356, 246), (353, 243), (353, 242), (352, 241), (352, 239), (351, 238), (350, 238), (349, 237), (348, 237), (347, 236), (346, 236), (345, 235), (344, 235), (339, 230), (339, 228), (338, 227), (338, 225), (337, 224), (337, 221), (336, 220), (336, 218), (335, 217), (335, 215), (332, 212), (332, 202), (331, 201), (331, 200), (330, 200), (328, 198), (327, 198), (322, 193), (322, 192), (321, 191), (321, 187), (320, 186), (320, 185), (319, 184), (319, 181), (318, 180), (318, 179), (317, 178), (317, 176), (316, 175), (316, 173), (315, 172), (313, 172)]
3+
Button:Silver_Btn:[(311, 118)]:[(262, 95), (261, 96), (258, 96), (257, 97), (256, 97), (255, 98), (254, 98), (252, 100), (251, 100), (250, 101), (250, 102), (248, 104), (248, 105), (247, 106), (247, 107), (246, 108), (246, 111), (245, 112), (245, 126), (246, 127), (246, 130), (247, 131), (247, 132), (248, 133), (248, 134), (250, 136), (250, 137), (251, 138), (252, 138), (254, 140), (255, 140), (256, 141), (258, 141), (259, 142), (365, 142), (366, 141), (368, 141), (369, 140), (370, 140), (372, 138), (373, 138), (374, 137), (374, 136), (376, 134), (376, 133), (377, 132), (377, 130), (378, 129), (378, 109), (377, 108), (377, 106), (376, 105), (376, 104), (374, 102), (374, 101), (373, 100), (372, 100), (370, 98), (369, 98), (368, 97), (367, 97), (366, 96), (363, 96), (362, 95)]
4+
Button:Round_Btn:[(312, 47)]:[(308, 22), (307, 23), (304, 23), (303, 24), (302, 24), (301, 25), (300, 25), (299, 26), (298, 26), (296, 28), (295, 28), (293, 30), (293, 31), (291, 33), (291, 34), (290, 35), (290, 36), (289, 37), (289, 38), (288, 39), (288, 42), (287, 43), (287, 52), (288, 53), (288, 56), (289, 57), (289, 58), (290, 59), (290, 60), (291, 61), (291, 62), (293, 64), (293, 65), (295, 67), (296, 67), (298, 69), (299, 69), (300, 70), (301, 70), (302, 71), (304, 71), (305, 72), (320, 72), (321, 71), (323, 71), (324, 70), (325, 70), (326, 69), (327, 69), (329, 67), (330, 67), (332, 65), (332, 64), (334, 62), (334, 61), (335, 60), (335, 59), (336, 58), (336, 56), (337, 55), (337, 40), (336, 39), (336, 37), (335, 36), (335, 35), (334, 34), (334, 33), (332, 31), (332, 30), (330, 28), (329, 28), (327, 26), (326, 26), (325, 25), (324, 25), (323, 24), (322, 24), (321, 23), (318, 23), (317, 22)]
7.66 KB
Loading
279 KB
Loading
8.76 KB
Loading
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import re
2+
import tkinter as tk
3+
from PIL import Image, ImageTk, ImageDraw
4+
from enum import Enum
5+
from GIMPy_Widget_UI import Btn_S2 as bts2
6+
from GIMPy_Widget_UI import Draw_Over_Under
7+
import ttkbootstrap as ttk
8+
9+
def command_test(value):
10+
print(f"Command test called {value}")
11+
12+
13+
if __name__ == "__main__":
14+
root = ttk.Window(themename='solar')
15+
root.title("Button - Style 2")
16+
passive_ui = (Image.open("Passive_UI.png").convert("RGBA"))
17+
btns_imagesize = passive_ui.size
18+
btns_position_file_loc = 'Buttons_Demo_Position.txt'
19+
20+
base_photo = ImageTk.PhotoImage(passive_ui)
21+
btns_image_width, btns_image_height = btns_imagesize
22+
# Create a canvas and add the image
23+
canvas = tk.Canvas(root, width=btns_image_width, height=btns_image_height)
24+
canvas.create_image(0, 0, anchor=tk.NW, image=base_photo, tags='baseImage')
25+
canvas.place(x=0, y=0)
26+
canvas.pack()
27+
28+
btn1 = bts2("African_Map", canvas, btns_imagesize,
29+
bts2.str_to_coordinates(btns_position_file_loc,'African_Map', 4), passive_ui,
30+
drawmode=Draw_Over_Under.UNDER, color_selected=(100, 50, 50, 255), command=command_test)
31+
btn2 = bts2("Au_Map", canvas, btns_imagesize,
32+
bts2.str_to_coordinates(btns_position_file_loc,'Au_Map', 4), passive_ui,
33+
drawmode=Draw_Over_Under.OVER, color_selected=(50, 50, 50, 180), command=command_test)
34+
35+
btn3 = bts2("Round_Btn", canvas, btns_imagesize,
36+
bts2.str_to_coordinates(btns_position_file_loc,'Round_Btn', 4), passive_ui,
37+
drawmode=Draw_Over_Under.OVER, color_selected=(150, 250, 180, 255), command=command_test)
38+
39+
btn4 = bts2("Silver_Btn", canvas, btns_imagesize,
40+
bts2.str_to_coordinates(btns_position_file_loc,'Silver_Btn', 4), passive_ui,
41+
drawmode=Draw_Over_Under.UNDER, color_selected=(214, 100, 150, 185), command=command_test)
42+
43+
root.mainloop()
12.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)