📄 chatwindow.tcl
字号:
} # App menu, only on Mac OS X (see Mac Interface Guidelines) if {![catch {tk windowingsystem} wsystem] && $wsystem == "aqua"} { set applemenu [CreateAppleMenu $mainmenu] $mainmenu add cascade -label "aMSN" -menu $applemenu } set chatmenu [CreateChatMenu $w $mainmenu] set editmenu [CreateEditMenu $w $mainmenu] set viewmenu [CreateViewMenu $w $mainmenu] set actionsmenu [CreateActionsMenu $w $mainmenu] set contactmenu [CreateContactMenu $w $mainmenu] set helpmenu [CreateHelpMenu $w $mainmenu] #no need to call it "file" # http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html $mainmenu add cascade -label "[trans chat]" -menu $chatmenu $mainmenu add cascade -label "[trans edit]" -menu $editmenu $mainmenu add cascade -label "[trans view]" -menu $viewmenu $mainmenu add cascade -label "[trans actions]" -menu $actionsmenu $mainmenu add cascade -label "[trans contact]" -menu $contactmenu $mainmenu add cascade -label "[trans help]" -menu $helpmenu return $mainmenu } ############################################# # CreateAppleMenu $menu # This proc should create the Apple submenu of the chat window # proc CreateAppleMenu { menu } { set applemenu $menu.apple menu $applemenu -tearoff 0 -type normal $applemenu add command -label "[trans about] aMSN" \ -command ::amsn::aboutWindow $applemenu add separator $applemenu add command -label "[trans preferences]..." \ -command Preferences -accelerator "Command-," $applemenu add separator#TODO #might need a "quit AMSN "action here, according to macd guidelines return $applemenu } ############################################# # CreateMsnMenu $menu # This proc should create the Amsn submenu of the chat window # proc CreateChatMenu { w menu } { set chatmenu $menu.msn menu $chatmenu -tearoff 0 -type normal #new chat $chatmenu add command -label "[trans newchat]..." \ -command [list ::amsn::ShowSendMsgList [trans sendmsg] ::amsn::chatUser] if {[OnMac]} { $chatmenu add command -label "[trans close]" \ -command "::ChatWindow::Close $w" -accelerator "Command-W" } #Save $chatmenu add command -label "[trans savetofile]..." \ -command " ChooseFilename \[::ChatWindow::GetOutText \[::ChatWindow::getCurrentTab $w\]\] \[::ChatWindow::getCurrentTab $w\]" #---------------------- $chatmenu add separator #Invite a user to the chat $chatmenu add command -label "[trans invite]..." \ -command "::amsn::ShowInviteList \"[trans invite]\" \[::ChatWindow::getCurrentTab $w\]" #TODO: #powertool should add the "hide window" thing here # if {[catch {tk windowingsystem} wsystem] || $wsystem != "aqua"} {# $chatmenu add command -label "[trans hidewindow]" \# -command "wm state \[winfo toplevel \[::ChatWindow::getCurrentTab $w\]\] withdraw"# } #Add accelerator label to "close" on Mac Version if {![OnMac]} { #---------------------- $chatmenu add separator $chatmenu add command -label "[trans close]" \ -command "::ChatWindow::Close $w" } return $chatmenu } ############################################# # CreateEditMenu $menu # This proc should create the Edit submenu of the chat window # proc CreateEditMenu { w menu } { set editmenu $menu.edit menu $editmenu -tearoff 0 -type normal #Change the accelerator on Mac OS X if {![catch {tk windowingsystem} wsystem] && $wsystem == "aqua"} { $editmenu add command -label "[trans cut]" \ -command "tk_textCut \[::ChatWindow::getCurrentTab $w\]" -accelerator "Command+X" $editmenu add command -label "[trans copy]" \ -command "tk_textCopy \[::ChatWindow::getCurrentTab $w\]" -accelerator "Command+C" $editmenu add command -label "[trans paste]" \ -command "tk_textPaste \[::ChatWindow::getCurrentTab $w\]" -accelerator "Command+V" $editmenu add separator $editmenu add command \-label "[trans find]" \ -command "$w.search show" -accelerator "Command+F" $editmenu add command -label "[trans findnext]" -command "$w.search findnext" -accelerator "Command+G" $editmenu add command -label "[trans findprev]" -command "$w.search findprev" -accelerator "Command+Shift+G" } else { $editmenu add command -label "[trans cut]" \ -command "tk_textCut \[::ChatWindow::getCurrentTab $w\]" -accelerator "Ctrl+X" $editmenu add command -label "[trans copy]" \ -command "tk_textCopy \[::ChatWindow::getCurrentTab $w\]" -accelerator "Ctrl+C" $editmenu add command -label "[trans paste]" \ -command "tk_textPaste \[::ChatWindow::getCurrentTab $w\]" -accelerator "Ctrl+V" $editmenu add separator $editmenu add command -label "[trans find]" \ -command "$w.search show" -accelerator "Ctrl+F" $editmenu add command -label "[trans findnext]" -command "$w.search findnext" -accelerator "F3" $editmenu add command -label "[trans findprev]" -command "$w.search findprev" -accelerator "Shift+F3" } return $editmenu } ############################################# # CreateViewMenu $menu # This proc should create the View submenu of the chat window # proc CreateViewMenu { w menu } { global ${w}_show_picture set viewmenu $menu.view menu $viewmenu -tearoff 0 -type normal #show emoticons check $viewmenu add checkbutton -label "[trans chatsmileys]" \ -onvalue 1 -offvalue 0 -variable [::config::getVar chatsmileys] #show dp check $viewmenu add checkbutton -label "[trans showdisplaypic]" \ -command "::amsn::ShowOrHidePicture \[::ChatWindow::getCurrentTab $w\]"\ -onvalue 1 -offvalue 0 -variable "${w}_show_picture" #---------------------- $viewmenu add separator #chatstyle $viewmenu add cascade -label "[trans style]" -menu [CreateStyleMenu $viewmenu] #textstyle $viewmenu add cascade -label "[trans textsize]" -menu [CreateTextSizeMenu $viewmenu] #---------------------- $viewmenu add separator #Clear $viewmenu add command -label "[trans clear]" -command [list ::ChatWindow::Clear $w] set ${w}_show_picture 0 return $viewmenu } ############################################# # CreateTextSizeMenu $menu # This proc should create the TextSize submenu of the View menu # of the chat window # proc CreateTextSizeMenu { menu } { set textsizemenu $menu.textsize menu $textsizemenu -tearoff 0 -type normal foreach size {" 8" " 6" " 4" " 2" " 1" " 0" " -2" " -4" } { if {$size > 0 } { $textsizemenu add command -label "+$size" -command "change_myfontsize $size" } else { $textsizemenu add command -label "$size" -command "change_myfontsize $size" } } return $textsizemenu } ############################################# # CreateStyleMenu $menu # This proc should create the Style submenu of the View menu # of the chat window # proc CreateStyleMenu { menu } { set stylemenu $menu.style menu $stylemenu -tearoff 0 -type normal $stylemenu add radiobutton -label "[trans msnstyle]" \ -value "msn" -variable [::config::getVar chatstyle] $stylemenu add radiobutton -label "[trans ircstyle]" \ -value "irc" -variable [::config::getVar chatstyle] $stylemenu add radiobutton -label "[trans customstyle]..." \ -value "custom" -variable [::config::getVar chatstyle] \ -command "::amsn::enterCustomStyle" return $stylemenu } ############################################# # CreateActionsMenu $w $menu # This proc should create the Actions submenu of the chat window # proc CreateActionsMenu { w menu } { set actionsmenu $menu.actions menu $actionsmenu -tearoff 0 -type normal $actionsmenu add command -label "[trans sendfile]..." \ -command "::amsn::FileTransferSend \[::ChatWindow::getCurrentTab $w\]" $actionsmenu add command -label "[trans askcam]..." \ -command "::amsn::ShowChatList \"[trans askcam]\" \[::ChatWindow::getCurrentTab $w\] ::MSNCAM::AskWebcamQueue" $actionsmenu add command -label "[trans sendcam]..." \ -command "::amsn::ShowChatList \"[trans sendcam]\" \[::ChatWindow::getCurrentTab $w\] ::MSNCAM::SendInviteQueue" #nudge to add item here return $actionsmenu } ############################################# # Createcontactmenu $menu # This proc should create the Contact submenu of the chat window # proc CreateContactMenu { w menu } { set contactmenu $menu.contact menu $contactmenu -tearoff 0 -type normal #Chat history if {![catch {tk windowingsystem} wsystem] && $wsystem == "aqua"} { $contactmenu add command -label "[trans history]" \ -command "::amsn::ShowChatList \"[trans history]\" \[::ChatWindow::getCurrentTab $w\] ::log::OpenLogWin" \ -accelerator "Command-Option-H" } else { $contactmenu add command -label "[trans history]" \ -command "::amsn::ShowChatList \"[trans history]\" \[::ChatWindow::getCurrentTab $w\] ::log::OpenLogWin" \ -accelerator "Ctrl+H" } #webcam history $contactmenu add command -label "[trans webcamhistory]" \ -command "::amsn::ShowChatList \"[trans webcamhistory]\" \[::ChatWindow::getCurrentTab $w\] ::log::OpenCamLogWin" #received files $contactmenu add command -label "[trans openreceived]..." \ -command {launch_filemanager "[::config::getKey receiveddir]"} #------------------------- $contactmenu add separator #profile $contactmenu add command -label "[trans viewprofile]" \ -command "::amsn::ShowChatList \"[trans viewprofile]\" \[::ChatWindow::getCurrentTab $w\] ::hotmail::viewProfile" #email $contactmenu add command -label "[trans sendmail]..." \ -command "::amsn::ShowChatList \"[trans sendmail]\" \[::ChatWindow::getCurrentTab $w\] launch_mailer" #sms $contactmenu add command -label "[trans sendmobmsg]..." \ -command "::amsn::ShowChatList \"[trans sendmobmsg]\" \[::ChatWindow::getCurrentTab $w\] ::MSNMobile::OpenMobileWindow" #------------------------- $contactmenu add separator #block/unblock $contactmenu add command -label "[trans block]/[trans unblock]" \ -command "::amsn::ShowChatList \"[trans block]/[trans unblock]\" \[::ChatWindow::getCurrentTab $w\] ::amsn::blockUnblockUser" #add to list $contactmenu add command -label "[trans addtocontacts]" \ -command "::amsn::ShowAddList \"[trans addtocontacts]\" \[::ChatWindow::getCurrentTab $w\] ::MSN::addUser" #------------------------- $contactmenu add separator #alarm $contactmenu add command -label "[trans cfgalarm]" \ -command "::amsn::ShowChatList \"[trans cfgalarm]\" \[::ChatWindow::getCurrentTab $w\] ::abookGui::showUserAlarmSettings" #notes $contactmenu add command -label "[trans note]..." \ -command "::amsn::ShowChatList \"[trans note]\" \[::ChatWindow::getCurrentTab $w\] ::notes::Display_Notes" #------------------------- $contactmenu add separator #properties $contactmenu add command -label "[trans properties]" \ -command "::amsn::ShowChatList \"[trans properties]\" \[::ChatWindow::getCurrentTab $w\] ::abookGui::showUserProperties" return $contactmenu } ############################################# # CreateHelpMenu $w $menu # This proc should create the Actions submenu of the chat window # proc CreateHelpMenu { w menu } { set helpmenu $menu.helpmenu menu $helpmenu -tearoff 0 -type normal $helpmenu add command -label "[trans helpcontents]" \ -command "::amsn::showHelpFileWindow HELP [list [trans helpcontents]]" $helpmenu add separator $helpmenu add command -label "[trans about]" -command ::amsn::aboutWindow return $helpmenu } ################################################ # CreateCopyPasteMenu # This proc creates the menu shown when a user right clicks # on the input of the chat window # proc CreateCopyPasteMenu { w } { set menu $w.copypaste menu $menu -tearoff 0 -type normal $menu add command -label [trans cut] \ -command "status_log cut\n;tk_textCut $w" $menu add command -label [trans copy] \ -command "status_log copy\n;tk_textCopy $w" $menu add command -label [trans paste] \ -command "status_log paste\n;tk_textPaste $w" return $menu } ################################################ # CreateCopyMenu # This proc creates the menu shown when a user right clicks # on the output of the chat window # proc CreateCopyMenu { w } { set menu $w.copy menu $menu -tearoff 0 -type normal $menu add command -label [trans copy] \ -command "status_log copy\n;copy 0 $w" return $menu
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -