|
1 | 1 | #Version: |
2 | | -#0.8.0 |
| 2 | +#0.9.0 |
3 | 3 | ### |
4 | 4 | import os ### Librairie #4 |
5 | 5 | import csv ### .py & Librairie #5 |
@@ -229,10 +229,38 @@ def Update(Numéro): |
229 | 229 | canvas.create_text((s_screen_width/scnd_colonne), (670), text=N7_2,fill=s_font_color, font=s_font_family) ##7 |
230 | 230 | else: ##7 |
231 | 231 | canvas.create_text((s_screen_width/scnd_colonne), (640), text=BaseDeMots[Numéro][7],fill=s_font_color, font=s_font_family) ##7 |
232 | | -#### |
| 232 | + |
| 233 | + ################################################################################################################################# |
| 234 | + # Update color of screenshot button if screenshot is found |
| 235 | + |
| 236 | + if ImageRelated(Only_Return_True_if_there_is_an_image=True)==True: |
| 237 | + btn7 = Button(root, text =Language[8], activebackground=s_button_color_active,bg=s_button_color_unactive_scr,fg=s_button_texte_color_scr,height=s_button_height, width=s_button_width,borderwidth = 0,command =ImageRelated) #Bouton#// Screenshots |
| 238 | + btn7.place(rely=0, relx=0, x=0, y=150,anchor=W) #old y=100 (v0.8.0) -> 150 (v0.9.0) | Change oder of buttons |
| 239 | + else: |
| 240 | + btn7 = Button(root, text =Language[8], activebackground=s_button_color_active,bg=s_button_color_unactive,fg=s_button_texte_color,height=s_button_height, width=s_button_width,borderwidth = 0,command =ImageRelated) #Bouton#// Screenshots |
| 241 | + btn7.place(rely=0, relx=0, x=0, y=150,anchor=W) #old y=100 (v0.8.0) -> 150 (v0.9.0) | Change oder of buttons |
| 242 | + |
| 243 | + ### |
| 244 | + if ImageNext(Only_Return_True_if_there_is_an_image=True)==True: |
| 245 | + btn8 = Button(root, text =Language[9], activebackground=s_button_color_active,bg=s_button_color_unactive_scr,fg=s_button_texte_color_scr,height=s_button_height, width=s_button_width,borderwidth = 0,command =ImageNext) #Bouton#// Next Image |
| 246 | + btn8.place(rely=0, relx=0, x=0, y=100,anchor=W) #old y=150 (v0.8.0) -> 100 (v0.9.0) | Change oder of buttons |
| 247 | + else: |
| 248 | + btn8 = Button(root, text =Language[9], activebackground=s_button_color_active,bg=s_button_color_unactive,fg=s_button_texte_color,height=s_button_height, width=s_button_width,borderwidth = 0,command =ImageNext) #Bouton#// Next Image |
| 249 | + btn8.place(rely=0, relx=0, x=0, y=100,anchor=W) #old y=150 (v0.8.0) -> 100 (v0.9.0) | Change oder of buttons |
| 250 | + ### |
| 251 | + """ #Not working |
| 252 | + if ImageBack(Only_Return_True_if_there_is_an_image=True)==True: |
| 253 | + btn9 = Button(root, text =Language[10], activebackground=s_button_color_active,bg=s_button_color_unactive_scr,fg=s_button_texte_color_scr,height=s_button_height, width=s_button_width,borderwidth = 0,command =ImageBack) #Bouton#// Back Image |
| 254 | + btn9.place(rely=0, relx=0, x=0, y=200,anchor=W) |
| 255 | + else: |
| 256 | + btn9 = Button(root, text =Language[10], activebackground=s_button_color_active,bg=s_button_color_unactive,fg=s_button_texte_color,height=s_button_height, width=s_button_width,borderwidth = 0,command =ImageBack) #Bouton#// Back Image |
| 257 | + btn9.place(rely=0, relx=0, x=0, y=200,anchor=W) |
| 258 | + """ |
| 259 | + |
| 260 | +#### |
233 | 261 |
|
234 | 262 | ######### Images ######### |
235 | | -def ImageRelated(): |
| 263 | +def ImageRelated(Only_Return_True_if_there_is_an_image=False): |
236 | 264 | global ListScrennshot |
237 | 265 | global ImageNum |
238 | 266 | global Activated |
@@ -280,52 +308,66 @@ def ImageRelated(): |
280 | 308 | Activated=False |
281 | 309 | print(Final,"Final") |
282 | 310 | else: #If there is a screenshot |
283 | | - print('Found a screenshot for this word') |
284 | | - print(Final,"Final") |
285 | | - img = PhotoImage(file=path+Final[0]) |
286 | | - if adjust_screenshot_size==True: |
287 | | - img = img.zoom(2) |
288 | | - img=img.subsample(3) |
289 | | - canvas2=canvas.create_image(s_screen_width/3,s_screen_height/3, image=img) |
290 | | - canvas.create_image() |
291 | | - Activated=True |
292 | | - return Activated |
| 311 | + if Only_Return_True_if_there_is_an_image==False: |
| 312 | + print('Found a screenshot for this word') |
| 313 | + print(Final,"Final") |
| 314 | + img = PhotoImage(file=path+Final[0]) |
| 315 | + if adjust_screenshot_size==True: |
| 316 | + img = img.zoom(2) |
| 317 | + img=img.subsample(3) |
| 318 | + canvas2=canvas.create_image(s_screen_width/3,s_screen_height/3, image=img) |
| 319 | + canvas.create_image() |
| 320 | + Activated=True |
| 321 | + return Activated |
| 322 | + else: |
| 323 | + return True |
293 | 324 | ### End of ImageRelated() |
294 | | -def ImageNext(): |
| 325 | +def ImageNext(Only_Return_True_if_there_is_an_image=False): |
295 | 326 | global ImageNum |
296 | 327 | global Activated |
297 | 328 | if Activated==True: |
298 | 329 | path = Screenshots_Folder_Path |
299 | 330 | dir_list = os.listdir(path) |
300 | | - if len(Final)>ImageNum+1: |
301 | | - print('ok Next') |
302 | | - ImageNum+=1 |
303 | | - img = PhotoImage(file=path+Final[ImageNum]) |
304 | | - if adjust_screenshot_size==True: |
305 | | - img = img.zoom(2) |
306 | | - img=img.subsample(3) |
307 | | - canvas2=canvas.create_image(s_screen_width/3,s_screen_height/3, anchor=CENTER, image=img) |
308 | | - canvas.create_image() |
| 331 | + if Only_Return_True_if_there_is_an_image==False: |
| 332 | + if len(Final)>ImageNum+1: |
| 333 | + print('ok Next') |
| 334 | + ImageNum+=1 |
| 335 | + img = PhotoImage(file=path+Final[ImageNum]) |
| 336 | + if adjust_screenshot_size==True: |
| 337 | + img = img.zoom(2) |
| 338 | + img=img.subsample(3) |
| 339 | + canvas2=canvas.create_image(s_screen_width/3,s_screen_height/3, anchor=CENTER, image=img) |
| 340 | + canvas.create_image() |
| 341 | + else: |
| 342 | + ImageRelated() |
309 | 343 | else: |
310 | | - ImageRelated() |
| 344 | + if len(Final)>ImageNum+1: |
| 345 | + return True |
| 346 | + else: |
| 347 | + return False |
311 | 348 | ### End of ImageNext() |
312 | | -def ImageBack(): |
| 349 | +def ImageBack(Only_Return_True_if_there_is_an_image=False): |
313 | 350 | global ImageNum |
314 | 351 | global Activated |
315 | 352 | if Activated==True: |
316 | 353 | path = Screenshots_Folder_Path |
317 | 354 | dir_list = os.listdir(path) |
318 | | - if ImageNum>0: |
319 | | - print('ok Back') |
320 | | - ImageNum-=1 |
321 | | - img = PhotoImage(file=path+Final[ImageNum]) |
322 | | - if adjust_screenshot_size==True: |
323 | | - img = img.zoom(2) |
324 | | - img=img.subsample(3) |
325 | | - canvas2=canvas.create_image(s_screen_width/3,s_screen_height/3, anchor=CENTER, image=img) |
326 | | - canvas.create_image() |
327 | | - else: |
328 | | - ImageRelated() |
| 355 | + if Only_Return_True_if_there_is_an_image==False: |
| 356 | + if ImageNum>0: |
| 357 | + print('ok Back') |
| 358 | + ImageNum-=1 |
| 359 | + img = PhotoImage(file=path+Final[ImageNum]) |
| 360 | + if adjust_screenshot_size==True: |
| 361 | + img = img.zoom(2) |
| 362 | + img=img.subsample(3) |
| 363 | + canvas2=canvas.create_image(s_screen_width/3,s_screen_height/3, anchor=CENTER, image=img) |
| 364 | + canvas.create_image() |
| 365 | + else: |
| 366 | + ImageRelated() |
| 367 | + else: |
| 368 | + if ImageNum>0: |
| 369 | + return True |
| 370 | + |
329 | 371 | ### End of ImageBack() |
330 | 372 | ######### Images ######### |
331 | 373 |
|
@@ -392,13 +434,10 @@ def ImageBack(): |
392 | 434 | btn5 = Button(root, text =Language[6], activebackground=s_button_color_active,bg=s_button_color_unactive,fg=s_button_texte_color,height=s_button_height, width=s_button_width,borderwidth = 0,command =GitHubLink) #Bouton#// About |
393 | 435 | btn5.pack(side='bottom') |
394 | 436 |
|
395 | | -btn7 = Button(root, text =Language[8], activebackground=s_button_color_active,bg=s_button_color_unactive,fg=s_button_texte_color,height=s_button_height, width=s_button_width,borderwidth = 0,command =ImageRelated) #Bouton#// About |
396 | | -btn7.place(rely=0, relx=0, x=0, y=100,anchor=W) |
397 | | - |
398 | | -btn8 = Button(root, text =Language[9], activebackground=s_button_color_active,bg=s_button_color_unactive,fg=s_button_texte_color,height=s_button_height, width=s_button_width,borderwidth = 0,command =ImageNext) #Bouton#// About |
399 | | -btn8.place(rely=0, relx=0, x=0, y=150,anchor=W) |
400 | | - |
401 | | -btn9 = Button(root, text =Language[10], activebackground=s_button_color_active,bg=s_button_color_unactive,fg=s_button_texte_color,height=s_button_height, width=s_button_width,borderwidth = 0,command =ImageBack) #Bouton#// About |
| 437 | +#btn7# (old place) now line 236 and after |
| 438 | +#btn8# (old place) now line 23. and after |
| 439 | +#btn9# Line 238 and after not working |
| 440 | +btn9 = Button(root, text =Language[10], activebackground=s_button_color_active,bg=s_button_color_unactive,fg=s_button_texte_color,height=s_button_height, width=s_button_width,borderwidth = 0,command =ImageBack) #Bouton#// Back Image |
402 | 441 | btn9.place(rely=0, relx=0, x=0, y=200,anchor=W) |
403 | 442 |
|
404 | 443 | if super_mode==True: |
|
0 commit comments