📄 winmenu.test
字号:
update idletasks list [catch {.m1 post 40 40} msg] $msg [destroy .m1]} {0 {} {}}test winMenu-9.1 {TkpMenuNewEntry} { catch {destroy .m1} menu .m1 list [catch {.m1 add command} msg] $msg [destroy .m1]} {0 {} {}}test winMenu-10.1 {TkwinMenuProc} {menuInteractive} { catch {destroy .m1} menu .m1 .m1 add command -label "winMenu-10.1: Hit ESCAPE." list [.m1 post 40 40] [destroy .m1]} {{} {}}# Can't generate a WM_INITMENU without a Tk menu yet.test winMenu-11.1 {TkWinHandleMenuEvent - WM_INITMENU} {menuInteractive} { catch {destroy .m1} catch {unset foo} menu .m1 -postcommand "set foo test" .m1 add command -label "winMenu-11.1: Hit ESCAPE." list [.m1 post 40 40] [set foo] [unset foo] [destroy .m1]} {test test {} {}}test winMenu-11.2 {TkWinHandleMenuEvent - WM_COMMAND} {menuInteractive} { catch {destroy .m1} catch {unset foo} menu .m1 .m1 add checkbutton -variable foo -label "winMenu-11.2: Please select this menu item." list [.m1 post 40 40] [update] [set foo] [unset foo] [destroy .m1]} {{} {} 1 {} {}}# Can't test WM_MENUCHARtest winMenu-11.3 {TkWinHandleMenuEvent - WM_MEASUREITEM} {menuInteractive} { catch {destroy .m1} menu .m1 .m1 add command -label "winMenu-11.3: Hit ESCAPE." list [.m1 post 40 40] [destroy .m1]} {{} {}}test winMenu-11.4 {TkWinHandleMenuEvent - WM_MEASUREITEM} {menuInteractive} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label "winMenu-11.4: Hit ESCAPE" -hidemargin 1 list [.m1 post 40 40] [destroy .m1]} {{} {}}test winMenu-11.5 {TkWinHandleMenuEvent - WM_DRAWITEM} {menuInteractive} { catch {destroy .m1} menu .m1 .m1 add command -label "winMenu-11.5: Hit ESCAPE." list [.m1 post 40 40] [destroy .m1]} {{} {}}test winMenu-11.6 {TkWinHandleMenuEvent - WM_DRAWITEM - item disabled} {menuInteractive} { catch {destroy .m1} menu .m1 .m1 add command -label "winMenu-11.6: Hit ESCAPE." -state disabled list [.m1 post 40 40] [destroy .m1]} {{} {}}test winMenu-11.7 {TkWinHandleMenuEvent - WM_INITMENU - not pending} {menuInteractive} { catch {destroy .m1} menu .m1 -tearoff 0 .m1 add command -label "winMenu-11.7: Hit ESCAPE" update idletasks list [catch {.m1 post 40 40} msg] $msg [destroy .m1]} {0 {} {}}test winMenu-12.1 {TkpSetWindowMenuBar} { catch {destroy .m1} . configure -menu "" menu .m1 .m1 add command -label foo list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [catch {destroy .m1} msg2] $msg2} {0 {} {} 0 {}}test winMenu-12.2 {TkpSetWindowMenuBar} { catch {destroy .m1} . configure -menu "" menu .m1 .m1 add command -label foo . configure -menu .m1 list [catch {. configure -menu ""} msg] $msg [catch {destroy .m1} msg2] $msg2} {0 {} 0 {}}test winMenu-12.3 {TkpSetWindowMenuBar - no update pending} { catch {destroy .m1} . configure -menu "" menu .m1 -tearoff 0 .m1 add command -label foo update idletasks list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1]} {0 {} {} {}}test winMenu-13.1 {TkpSetMainMenubar - nothing to do} {} {}test winMenu-14.1 {GetMenuIndicatorGeometry} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]} {0 {}}test winMenu-14.2 {GetMenuIndicatorGeometry} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo -hidemargin 1 list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]} {0 {}}test winMenu-15.1 {GetMenuAccelGeometry} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo -accel Ctrl+U list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]} {0 {}}test winMenu-15.2 {GetMenuAccelGeometry} { catch {destroy .m1} menu .m1 .m1 add command -label foo list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]} {0 {}}test winMenu-15.3 {GetMenuAccelGeometry} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+U" list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]} {0 {}}test winMenu-16.1 {GetTearoffEntryGeometry} {menuInteractive} { catch {destroy .m1} menu .m1 .m1 add command -label "winMenu-19.1: Hit ESCAPE." list [.m1 post 40 40] [destroy .m1]} {{} {}}test winMenu-17.1 {GetMenuSeparatorGeometry} { catch {destroy .m1} menu .m1 .m1 add separator list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]} {0 {}}# Currently, the only callers to DrawWindowsSystemBitmap want things# centered vertically, and either centered or right aligned horizontally.test winMenu-18.1 {DrawWindowsSystemBitmap - center aligned} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo .m1 invoke foo set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-18.2 {DrawWindowsSystemBitmap - right aligned} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-19.1 {DrawMenuEntryIndicator - not checkbutton or radiobutton} { catch {destroy .m1} menu .m1 .m1 add command -label foo set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-19.2 {DrawMenuEntryIndicator - not selected} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-19.3 {DrawMenuEntryIndicator - checkbutton} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo .m1 invoke foo set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-19.4 {DrawMenuEntryIndicator - radiobutton} { catch {destroy .m1} menu .m1 .m1 add radiobutton -label foo .m1 invoke foo set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-19.5 {DrawMenuEntryIndicator - disabled} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo .m1 invoke foo .m1 entryconfigure foo -state disabled set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-19.6 {DrawMenuEntryIndicator - indicator not on} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo -indicatoron 0 .m1 invoke foo set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-20.1 {DrawMenuEntryAccelerator - disabled} { catch {destroy .m1} menu .m1 -disabledforeground red .m1 add command -label foo -accel "Ctrl+U" -state disabled set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-20.2 {DrawMenuEntryAccelerator - normal text} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+U" set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-20.3 {DrawMenuEntryAccelerator - disabled, no disabledforeground} { catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label foo -accel "Ctrl+U" -state disabled set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-20.4 {DrawMenuEntryAccelerator - cascade, drawArrow true} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-20.5 {DrawMenuEntryAccelerator - cascade, drawArrow false} {menuInteractive} { catch {destroy .m1} menu .m1 .m1 add cascade -label "winMenu-23.5: Hit ESCAPE." list [.m1 post 40 40] [destroy .m1]} {{} {}}test winMenu-21.1 {DrawMenuSeparator} { catch {destroy .m1} menu .m1 .m1 add separator set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-22.1 {DrawMenuUnderline} { catch {destroy .m1} menu .m1 .m1 add command -label foo -underline 0 set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}} test winMenu-23.1 {Don't know how to test MenuKeyBindProc} {} {}test winMenu-24.1 {TkpInitializeMenuBindings called at boot time} {} {}test winMenu-25.1 {DrawMenuEntryLabel - normal} { catch {destroy .m1} menu .m1 .m1 add command -label foo set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-25.2 {DrawMenuEntryLabel - disabled with fg} { catch {destroy .m1} menu .m1 -disabledforeground red .m1 add command -label foo -state disabled set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-25.3 {DrawMenuEntryLabel - disabled with no fg} { catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label foo -state disabled set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-26.1 {TkpComputeMenubarGeometry} { catch {destroy .m1} menu .m1 .m1 add cascade -label File list [. configure -menu .m1] [. configure -menu ""] [destroy .m1]} {{} {} {}}test winMenu-27.1 {DrawTearoffEntry} {menuInteractive} { catch {destroy .m1} menu .m1 .m1 add command -label "winMenu-24.4: Hit ESCAPE." list [.m1 post 40 40] [destroy .m1]} {{} {}}test winMenu-28.1 {TkpConfigureMenuEntry - update pending} { catch {destroy .m1} menu .m1 -tearoff 0 .m1 add command -label Hello list [catch {.m1 add command -label Two} msg] $msg [destroy .m1]} {0 {} {}}test winMenu-28.2 {TkpConfigureMenuEntry - update not pending} { catch {destroy .m1} menu .m1 -tearoff 0 .m1 add command -label One update idletasks list [catch {.m1 add command -label Two} msg] $msg [destroy .m1]} {0 {} {}}test winMenu-29.1 {TkpDrawMenuEntry - gc for active and not strict motif} { catch {destroy .m1} menu .m1 .m1 add command -label foo set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1]} {{} {}}test winMenu-29.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} { catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground red set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1]} {{} {}}test winMenu-29.3 {TkpDrawMenuEntry - gc for active and strict motif} { catch {destroy .m1} menu .m1 set tk_strictMotif 1 .m1 add command -label foo set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0]} {{} {} 0}test winMenu-29.4 {TkpDrawMenuEntry - gc for disabled with disabledfg and custom entry} { catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled -background red set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1]} {{} {}}test winMenu-29.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} { catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled set tearoff [tkTearOffMenu .m1 40 40]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -