@@ -1006,6 +1006,7 @@ def saveObs():
1006
1006
top .option_add ('*TCombobox*Listbox*Background' ,colors ['bg' ])
1007
1007
top .option_add ('*TCombobox*Listbox*Foreground' ,colors ['text' ])
1008
1008
style = ttk .Style (top )
1009
+ style .theme_use ('alt' )
1009
1010
style .map ('TCombobox' ,selectbackground = [('readonly' ,colors ['bg' ])])
1010
1011
style .map ('TCombobox' ,fieldbackground = [('readonly' ,colors ['bg' ])])
1011
1012
style .map ('TCombobox' ,foreground = [('readonly' ,colors ['text' ])])
@@ -1705,6 +1706,7 @@ def saveSet():
1705
1706
top .option_add ('*TCombobox*Listbox*Background' ,colors ['bg' ])
1706
1707
top .option_add ('*TCombobox*Listbox*Foreground' ,colors ['text' ])
1707
1708
style = ttk .Style (top )
1709
+ style .theme_use ('alt' )
1708
1710
style .map ('TCombobox' ,selectbackground = [('readonly' ,colors ['bg' ])])
1709
1711
style .map ('TCombobox' ,fieldbackground = [('readonly' ,colors ['bg' ])])
1710
1712
style .map ('TCombobox' ,foreground = [('readonly' ,colors ['text' ])])
@@ -2289,6 +2291,8 @@ def obsselect(evt):
2289
2291
root .option_add ('*TCombobox*Listbox*Foreground' ,colors ['text' ])
2290
2292
root .option_add ('*TCombobox*Listbox*Background' ,colors ['bg' ])
2291
2293
style = ttk .Style ()
2294
+ style .theme_use ('alt' )
2295
+ #style.map('TCombobox',background=[('readonly',colors['bg'])])
2292
2296
style .map ('TCombobox' ,selectbackground = [('readonly' ,colors ['bg' ])])
2293
2297
style .map ('TCombobox' ,fieldbackground = [('readonly' ,colors ['bg' ])])
2294
2298
style .map ('TCombobox' ,foreground = [('readonly' ,colors ['text' ])])
@@ -2327,28 +2331,36 @@ def obsselect(evt):
2327
2331
Text1 .configure (width = 256 )
2328
2332
Text1 .configure (wrap = tk .WORD )
2329
2333
2330
- #TODO focus color?, disabled color?
2334
+ #TODO focus color?
2331
2335
Button3_2 = tk .Button (Labelframe0 )
2332
2336
Button3_2 .place (relx = 0.05 ,rely = 0.95 ,height = 24 ,width = 47 )
2333
2337
Button3_2 .configure (command = AddObj )
2334
2338
Button3_2 .configure (text = 'Add' )
2335
- Button3_2 .configure (background = colors ['bg ' ])
2339
+ Button3_2 .configure (background = colors ['window ' ])
2336
2340
Button3_2 .configure (fg = colors ['text' ])
2341
+ Button3_2 .configure (activebackground = colors ['window' ])
2342
+ Button3_2 .configure (activeforeground = colors ['text' ])
2337
2343
2338
2344
Button2 = tk .Button (Labelframe0 )
2339
2345
Button2 .place (relx = 0.35 ,rely = 0.95 ,height = 24 ,width = 47 )
2340
2346
Button2 .configure (command = EditObj )
2341
2347
Button2 .configure (text = 'Edit' )
2342
- Button2 .configure (background = colors ['bg ' ])
2348
+ Button2 .configure (background = colors ['window ' ])
2343
2349
Button2 .configure (fg = colors ['text' ])
2350
+ Button2 .configure (disabledforeground = colors ['text_dis' ])
2351
+ Button2 .configure (activebackground = colors ['window' ])
2352
+ Button2 .configure (activeforeground = colors ['text' ])
2344
2353
Button2 .configure (state = tk .DISABLED )
2345
2354
2346
2355
Button3 = tk .Button (Labelframe0 )
2347
2356
Button3 .place (relx = 0.65 ,rely = 0.95 ,height = 24 ,width = 47 )
2348
2357
Button3 .configure (command = DelObj )
2349
2358
Button3 .configure (text = 'Delete' )
2350
- Button3 .configure (background = colors ['bg ' ])
2359
+ Button3 .configure (background = colors ['window ' ])
2351
2360
Button3 .configure (fg = colors ['text' ])
2361
+ Button3 .configure (disabledforeground = colors ['text_dis' ])
2362
+ Button3 .configure (activebackground = colors ['window' ])
2363
+ Button3 .configure (activeforeground = colors ['text' ])
2352
2364
Button3 .configure (state = tk .DISABLED )
2353
2365
2354
2366
#pozorovania
@@ -2386,32 +2398,44 @@ def obsselect(evt):
2386
2398
Button4 .place (relx = 0.02 ,rely = 0.95 ,height = 24 ,width = 47 )
2387
2399
Button4 .configure (command = AddObs )
2388
2400
Button4 .configure (text = 'Add' )
2389
- Button4 .configure (background = colors ['bg ' ])
2401
+ Button4 .configure (background = colors ['window ' ])
2390
2402
Button4 .configure (fg = colors ['text' ])
2403
+ Button4 .configure (disabledforeground = colors ['text_dis' ])
2404
+ Button4 .configure (activebackground = colors ['window' ])
2405
+ Button4 .configure (activeforeground = colors ['text' ])
2391
2406
Button4 .configure (state = tk .DISABLED )
2392
2407
2393
2408
Button5 = tk .Button (Labelframe1 )
2394
2409
Button5 .place (relx = 0.28 ,rely = 0.95 ,height = 24 ,width = 47 )
2395
2410
Button5 .configure (command = EditObs )
2396
2411
Button5 .configure (text = 'Edit' )
2397
- Button5 .configure (background = colors ['bg ' ])
2412
+ Button5 .configure (background = colors ['window ' ])
2398
2413
Button5 .configure (fg = colors ['text' ])
2414
+ Button5 .configure (disabledforeground = colors ['text_dis' ])
2415
+ Button5 .configure (activebackground = colors ['window' ])
2416
+ Button5 .configure (activeforeground = colors ['text' ])
2399
2417
Button5 .configure (state = tk .DISABLED )
2400
2418
2401
2419
Button6 = tk .Button (Labelframe1 )
2402
2420
Button6 .place (relx = 0.53 ,rely = 0.95 ,height = 24 ,width = 47 )
2403
2421
Button6 .configure (command = DelObs )
2404
2422
Button6 .configure (text = 'Delete' )
2405
- Button6 .configure (background = colors ['bg ' ])
2423
+ Button6 .configure (background = colors ['window ' ])
2406
2424
Button6 .configure (fg = colors ['text' ])
2425
+ Button6 .configure (disabledforeground = colors ['text_dis' ])
2426
+ Button6 .configure (activebackground = colors ['window' ])
2427
+ Button6 .configure (activeforeground = colors ['text' ])
2407
2428
Button6 .configure (state = tk .DISABLED )
2408
2429
2409
2430
Button7 = tk .Button (Labelframe1 )
2410
2431
Button7 .place (relx = 0.78 ,rely = 0.95 ,height = 24 ,width = 47 )
2411
2432
Button7 .configure (command = ShowImg )
2412
2433
Button7 .configure (state = tk .DISABLED )
2413
- Button7 .configure (background = colors ['bg ' ])
2434
+ Button7 .configure (background = colors ['window ' ])
2414
2435
Button7 .configure (fg = colors ['text' ])
2436
+ Button7 .configure (disabledforeground = colors ['text_dis' ])
2437
+ Button7 .configure (activebackground = colors ['window' ])
2438
+ Button7 .configure (activeforeground = colors ['text' ])
2415
2439
Button7 .configure (text = 'Image' )
2416
2440
2417
2441
#obrazky a datum
@@ -2433,8 +2457,10 @@ def obsselect(evt):
2433
2457
Button1 = tk .Button (root )
2434
2458
Button1 .place (relx = 0.92 ,rely = 0.02 ,height = 24 ,width = 55 )
2435
2459
Button1 .configure (command = NowTime )
2436
- Button1 .configure (background = colors ['bg ' ])
2460
+ Button1 .configure (background = colors ['window ' ])
2437
2461
Button1 .configure (fg = colors ['text' ])
2462
+ Button1 .configure (activebackground = colors ['window' ])
2463
+ Button1 .configure (activeforeground = colors ['text' ])
2438
2464
Button1 .configure (text = 'Now' )
2439
2465
2440
2466
frame2 = tk .Frame (root )
@@ -2456,6 +2482,10 @@ def obsselect(evt):
2456
2482
fileM = tk .Menu (Popupmenu1 ,tearoff = 0 )
2457
2483
fileM .configure (background = colors ['window' ])
2458
2484
fileM .configure (fg = colors ['text' ])
2485
+ if colors ['text' ]== 'red' :
2486
+ fileM .configure (activebackground = colors ['select_bg' ])
2487
+ fileM .configure (activeforeground = colors ['select_text' ])
2488
+ #fileM.configure(inactiveselectbackground=colors['select_bg'])
2459
2489
Popupmenu1 .add_cascade (menu = fileM ,label = 'File' )
2460
2490
fileM .add_command (command = NewFile ,label = 'New' ,accelerator = 'Ctrl+N' )
2461
2491
root .bind ('<Control-n>' ,NewFile )
@@ -2471,11 +2501,19 @@ def obsselect(evt):
2471
2501
import_export = tk .Menu (Popupmenu1 ,tearoff = 0 )
2472
2502
import_export .configure (background = colors ['window' ])
2473
2503
import_export .configure (fg = colors ['text' ])
2504
+ if colors ['text' ]== 'red' :
2505
+ import_export .configure (activebackground = colors ['select_bg' ])
2506
+ import_export .configure (activeforeground = colors ['select_text' ])
2507
+ #import_export.configure(inactiveselectbackground=colors['select_bg'])
2474
2508
Popupmenu1 .add_cascade (menu = import_export ,label = 'Import/Export' )
2475
2509
2476
2510
importMenu = tk .Menu (import_export ,tearoff = 0 )
2477
2511
importMenu .configure (background = colors ['window' ])
2478
2512
importMenu .configure (fg = colors ['text' ])
2513
+ if colors ['text' ]== 'red' :
2514
+ importMenu .configure (activebackground = colors ['select_bg' ])
2515
+ importMenu .configure (activeforeground = colors ['select_text' ])
2516
+ #importMenu.configure(inactiveselectbackground=colors['select_bg'])
2479
2517
import_export .add_cascade (menu = importMenu ,label = 'Import Objects' )
2480
2518
importMenu .add_command (label = 'from APT' ,state = tk .DISABLED )
2481
2519
importMenu .add_command (label = 'from AstroPlanner' ,state = tk .DISABLED )
@@ -2489,6 +2527,11 @@ def obsselect(evt):
2489
2527
exportObj = tk .Menu (import_export ,tearoff = 0 )
2490
2528
exportObj .configure (background = colors ['window' ])
2491
2529
exportObj .configure (fg = colors ['text' ])
2530
+ if colors ['text' ]== 'red' :
2531
+ exportObj .configure (activebackground = colors ['select_bg' ])
2532
+ exportObj .configure (activeforeground = colors ['select_text' ])
2533
+ #exportObj.configure(inactiveselectbackground=colors['select_bg'])
2534
+ exportObj .configure (disabledforeground = colors ['text_dis' ])
2492
2535
import_export .add_cascade (menu = exportObj ,label = 'Export Selected Objects' ,state = tk .DISABLED )
2493
2536
exportObj .add_command (label = 'to APT' ,command = aptE )
2494
2537
exportObj .add_command (label = 'to Excel' ,command = excelE )
@@ -2500,13 +2543,23 @@ def obsselect(evt):
2500
2543
exportObs = tk .Menu (import_export ,tearoff = 0 )
2501
2544
exportObs .configure (background = colors ['window' ])
2502
2545
exportObs .configure (fg = colors ['text' ])
2546
+ if colors ['text' ]== 'red' :
2547
+ exportObs .configure (activebackground = colors ['select_bg' ])
2548
+ exportObs .configure (activeforeground = colors ['select_text' ])
2549
+ #exportObs.configure(inactiveselectbackground=colors['select_bg'])
2550
+ exportObs .configure (disabledforeground = colors ['text_dis' ])
2503
2551
import_export .add_cascade (menu = exportObs ,label = 'Export Observations of Object' ,state = tk .DISABLED )
2504
2552
exportObs .add_command (label = 'to Excel' ,command = excelObsE )
2505
2553
exportObs .add_command (label = 'to Text File' ,command = textObsE )
2506
2554
2507
2555
exportObsAll = tk .Menu (import_export ,tearoff = 0 )
2508
2556
exportObsAll .configure (background = colors ['window' ])
2509
2557
exportObsAll .configure (fg = colors ['text' ])
2558
+ if colors ['text' ]== 'red' :
2559
+ exportObsAll .configure (activebackground = colors ['select_bg' ])
2560
+ exportObsAll .configure (activeforeground = colors ['select_text' ])
2561
+ #exportObsAll.configure(inactiveselectbackground=colors['select_bg'])
2562
+ exportObsAll .configure (disabledforeground = colors ['text_dis' ])
2510
2563
import_export .add_cascade (menu = exportObsAll ,label = 'Export All Observations' ,state = tk .DISABLED )
2511
2564
exportObsAll .add_command (label = 'to Excel' ,command = excelObsAllE )
2512
2565
exportObsAll .add_command (label = 'to Text File' ,command = textObsAllE )
0 commit comments