Eskil

Check-in [2d052099ca]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use psmenu with dirdiff window
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2d052099ca9e54af4386d904617d3ed4a9e45b0c34afd149a2454d9c28c14a43
User & Date: peter 2024-09-08 02:23:50.579
Context
2024-09-08
12:48
Improved window browser with menu items. Cleaner exit. check-in: 6a713b1c5a user: peter tags: trunk
02:23
Use psmenu with dirdiff window check-in: 2d052099ca user: peter tags: trunk
02:23
Handle accellerator with state check-in: c7652f29e5 user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/clip.tcl.
148
149
150
151
152
153
154

155
156
157
158
159
160
161

    set ::eskil(wClip1) $t1
    set ::eskil(wClip2) $t2

    bind $t1 <Control-o> [list focus $t2]
    bind $t2 <Control-o> [list focus $t1]


    ttk::frame $top.f
    menubutton $top.f.mf -menu $top.f.mf.m -text "File" -underline 0
    menu $top.f.mf.m
    $top.f.mf.m add command -label "Close" -underline 0 \
            -command [list cleanupAndExit $top]
    $top.f.mf.m add separator
    $top.f.mf.m add command -label "Quit" -underline 0 \







>







148
149
150
151
152
153
154
155
156
157
158
159
160
161
162

    set ::eskil(wClip1) $t1
    set ::eskil(wClip2) $t2

    bind $t1 <Control-o> [list focus $t2]
    bind $t2 <Control-o> [list focus $t1]

    # Have the file menu in top frame to save space
    ttk::frame $top.f
    menubutton $top.f.mf -menu $top.f.mf.m -text "File" -underline 0
    menu $top.f.mf.m
    $top.f.mf.m add command -label "Close" -underline 0 \
            -command [list cleanupAndExit $top]
    $top.f.mf.m add separator
    $top.f.mf.m add command -label "Quit" -underline 0 \
Changes to src/dirdiff.tcl.
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292

1293
1294
1295

1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310

1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326



1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338

1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355

1356
1357
1358
1359

1360
1361


1362
1363
1364
1365
1366
1367
1368
        if {[info exists ::dirdiff(localChanges)]} {
            $tree configure -changelist $::dirdiff(localChanges)
        }

        ttk::frame $win.fe1
        ttk::frame $win.fe2

        menu $win.m
        $hull configure -menu $win.m

        $win.m add cascade -menu $win.m.mf -label "File" -underline 0
        menu $win.m.mf
        $win.m.mf add command -label "Compare" -underline 1 \
                -command [mymethod DoDirCompare] -accelerator "Alt-c"
        bind $win <Alt-c> [mymethod DoDirCompare]
        $win.m.mf add separator
        $win.m.mf add command -label "Close" -underline 0 \

                -command [list cleanupAndExit $win]
        $win.m.mf add separator
        $win.m.mf add command -label "Quit" -underline 0 \

                -command [list cleanupAndExit all]

        $win.m add cascade -menu $win.m.mo -label "Preferences" -underline 0
        menu $win.m.mo
        $win.m.mo add command -label "Prefs..." -command makeDirDiffPrefWin
        $win.m.mo add cascade -label "Check" -menu $win.m.mo.mc

        menu $win.m.mo.mc
        $win.m.mo.mc add radiobutton -variable ::Pref(dir,comparelevel) -value 0 \
                -label "Do not check contents"
        $win.m.mo.mc add radiobutton -variable ::Pref(dir,comparelevel) -value 1 \
                -label "Normal compare"
        $win.m.mo.mc add radiobutton -variable ::Pref(dir,comparelevel) -value 2 \
                -label "Exact compare"
        $win.m.mo.mc add checkbutton -variable ::Pref(dir,ignorekey) \

                -label "Ignore \$Keyword:\$"

        $win.m.mo add command -label "Plugins..." -underline 1 \
                -command [list editPrefPlugins $win 1]
        $win.m.mo add cascade -label "Nice" -menu $win.m.mo.mn
        menu $win.m.mo.mn
        $win.m.mo.mn add radiobutton -variable ::Pref(dir,nice) -value 1 \
                -command [mymethod DoNice] -label 1
        $win.m.mo.mn add radiobutton -variable ::Pref(dir,nice) -value 50 \
                -command [mymethod DoNice] -label 50
        $win.m.mo.mn add radiobutton -variable ::Pref(dir,nice) -value 100 \
                -command [mymethod DoNice] -label 100
        $win.m.mo.mn add radiobutton -variable ::Pref(dir,nice) -value 1000 \
                -command [mymethod DoNice] -label 1000
        $win.m.mo add separator
        $win.m.mo add command -label "Save default" \



                -command [list saveOptions $win]

        $win.m add cascade -label "Tools" -underline 0 -menu $win.m.mt
        menu $win.m.mt
        $win.m.mt add command -label "New Diff Window" -underline 0 \
                -command makeDiffWin
        $win.m.mt add command -label "Clip Diff" -underline 0 \
                -command makeClipDiffWin
        if {$::tcl_platform(platform) eq "windows"} {
            if { ! [catch {package require registry}]} {
                $win.m.mt add separator
                $win.m.mt add command -label "Setup Registry" -underline 6 \

                        -command makeRegistryWin
            }
        }

        $win.m add cascade -label "Help" -underline 0 -menu $win.m.help
        menu $win.m.help
        $win.m.help add command -label "Tutorial" -command makeTutorialWin \
                -underline 0
        $win.m.help add command -label "About" -command makeAboutWin -underline 0

        if {$::eskil(debug)} {
            $win.m add cascade -label "Debug" -menu $win.m.md -underline 0
            menu $win.m.md
            if {$::tcl_platform(platform) eq "windows"} {
                $win.m.md add checkbutton -label "Console" -variable consolestate \
                        -onvalue show -offvalue hide -command {console $consolestate}
                $win.m.md add separator

            }
            $win.m.md add command -label "Reread Source" -underline 0 \
                    -command {EskilRereadSource}
            $win.m.md add separator

            $win.m.md add command -label "Redraw Window" -command {makeDirDiffWin}
        }



        ttk::button $win.bu -image $::img(upup) -command [mymethod UpDir] \
                -underline 0
        addBalloon $win.bu "Up in both."
        bind $win <Alt-u> "$win.bu invoke"

        #catch {font delete myfont}







|

<
<
|
|
<
|
<
<
>
|
<
<
>
|
|
|
<
|
<
|
<
|
|
<
|
<
|
<
>
|
|
<
|
|
<
<
<
<
<
<
<
|
|
<
<
>
>
>
|
|
|
<
|
<
<
|
|
|
<
<
>
|
|
|
|
<
|
|
<
|
|
|
|
<
|
|
|
<
>
|
<
|
<
>
|
|
>
>







1276
1277
1278
1279
1280
1281
1282
1283
1284


1285
1286

1287


1288
1289


1290
1291
1292
1293

1294

1295

1296
1297

1298

1299

1300
1301
1302

1303
1304







1305
1306


1307
1308
1309
1310
1311
1312

1313


1314
1315
1316


1317
1318
1319
1320
1321

1322
1323

1324
1325
1326
1327

1328
1329
1330

1331
1332

1333

1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
        if {[info exists ::dirdiff(localChanges)]} {
            $tree configure -changelist $::dirdiff(localChanges)
        }

        ttk::frame $win.fe1
        ttk::frame $win.fe2

        # Need to do this manually with snit
        $hull configure -menu $win.m


        psmenu::psmenu $win {
            "&File" {

                "C&ompare" -cmd "[mymethod DoDirCompare]" -acc "Alt-c"


                ---
                "&Close" -cmd "cleanupAndExit $win"


                ---
                "&Quit" -cmd "cleanupAndExit all"
            }
            "&Preferences" {

                "Prefs..." -cmd makeDirDiffPrefWin

                "Check" {

                    _Radio -var ::Pref(dir,comparelevel) {
                        "Do not check contents" -value 0

                        "Normal compare" -value 1

                        "Exact compare" -value 2

                    }
                    "Ignore \$Keyword:\$" -var ::Pref(dir,ignorekey)
                }

                "P&lugins..." -cmd "editPrefPlugins $win 1"
                "Nice" {







                    _Radio -var ::Pref(dir,nice) -cmd "[mymethod DoNice]" {
                        1 50 100 1000


                    }
                }
                ---
                "Save default" -cmd "saveOptions $win"
            }
            "&Tools" {

                "&New Diff Window" -cmd makeDiffWin


                "&Clip Diff" -cmd makeClipDiffWin
                if {$::tcl_platform(platform) eq "windows"} {
                    if { ! [catch {package require registry}]} {


                        ---
                        "Setup &Registry" -cmd makeRegistryWin
                    }
                }
            }

            "&Help" {
                "&Tutorial" -cmd makeTutorialWin

                "&About"    -cmd makeAboutWin
            }
            if {$::eskil(debug)} {
                "&Debug" {

                    if {$::tcl_platform(platform) eq "windows"} {
                        "Console" -var consolestate \
                                -onvalue show -offvalue hide -cmd "console \\$consolestate"

                        ---
                    }

                    "&Reread Source" -cmd {EskilRereadSource}

                    ---
                    "Redraw Window" -cmd {makeDirDiffWin}
                }
            }
        } $win

        ttk::button $win.bu -image $::img(upup) -command [mymethod UpDir] \
                -underline 0
        addBalloon $win.bu "Up in both."
        bind $win <Alt-u> "$win.bu invoke"

        #catch {font delete myfont}