From: Jerome Gagnon-V. <ger...@us...> - 2005-03-31 19:51:28
|
Update of /cvsroot/amsn/msn In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5680 Modified Files: chatwindow.tcl Log Message: Now using real sendbutton on Mac OS X Switch buttons for labels in chatwindow, to get a nicer interface on Mac OS X Index: chatwindow.tcl =================================================================== RCS file: /cvsroot/amsn/msn/chatwindow.tcl,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** chatwindow.tcl 31 Mar 2005 19:48:14 -0000 1.136 --- chatwindow.tcl 31 Mar 2005 19:51:17 -0000 1.137 *************** *** 1681,1685 **** -activebackground [::skin::getKey sendbuttonbg] -activeforeground black -text [trans send] \ -font sboldf -highlightthickness 0 -pady 0 -padx 0 -overrelief flat -compound center ! } else { # Standard grey flat button (For Tcl/Tk < 8.4 and Mac OS X) button $sendbutton -text [trans send] -width 6 -borderwidth 1 \ --- 1681,1691 ---- -activebackground [::skin::getKey sendbuttonbg] -activeforeground black -text [trans send] \ -font sboldf -highlightthickness 0 -pady 0 -padx 0 -overrelief flat -compound center ! } elseif { $tcl_platform(os) == "Darwin" } { ! label $sendbutton -image [::skin::loadPixmap sendbutton] \ ! -fg black -bg [::skin::getKey sendbuttonbg] -bd 0 -relief flat \ ! -activebackground [::skin::getKey sendbuttonbg] -activeforeground black -text [trans send] \ ! -font sboldf -highlightthickness 0 -pady 0 -padx 0 -relief flat -compound center ! bind $sendbutton <<Button1>> "::amsn::MessageSend $w $text" ! } else { # Standard grey flat button (For Tcl/Tk < 8.4 and Mac OS X) button $sendbutton -text [trans send] -width 6 -borderwidth 1 \ *************** *** 1697,1701 **** bind $sendbutton <Return> "::amsn::MessageSend $w $text; break" #Don't insert picture if TCL 8.3 or Mac OS X because it's the old-style button ! if { $::tcl_version >= 8.4 && $tcl_platform(os) != "Darwin" } { bind $sendbutton <Enter> "$sendbutton configure -image [::skin::loadPixmap sendbutton_hover]" bind $sendbutton <Leave> "$sendbutton configure -image [::skin::loadPixmap sendbutton]" --- 1703,1707 ---- bind $sendbutton <Return> "::amsn::MessageSend $w $text; break" #Don't insert picture if TCL 8.3 or Mac OS X because it's the old-style button ! if { $::tcl_version >= 8.4 } { bind $sendbutton <Enter> "$sendbutton configure -image [::skin::loadPixmap sendbutton_hover]" bind $sendbutton <Leave> "$sendbutton configure -image [::skin::loadPixmap sendbutton]" *************** *** 1766,1777 **** # Pack My input frame widgets pack $text -side left -expand true -fill both -padx 1 -pady 1 ! #Don't fill y on Mac OS X ! if { ![catch {tk windowingsystem} wsystem] && $wsystem == "aqua" } { ! pack $sendbutton -side left -padx [::skin::getKey chat_sendbutton_padx]\ ! -pady [::skin::getKey chat_sendbutton_pady] ! } else { ! pack $sendbutton -fill y -side left -padx [::skin::getKey chat_sendbutton_padx]\ -pady [::skin::getKey chat_sendbutton_pady] ! } return $input --- 1772,1778 ---- # Pack My input frame widgets pack $text -side left -expand true -fill both -padx 1 -pady 1 ! pack $sendbutton -fill y -side left -padx [::skin::getKey chat_sendbutton_padx]\ -pady [::skin::getKey chat_sendbutton_pady] ! return $input *************** *** 1800,1813 **** ! # Create them along with their respective tooltips ! #Smiley button ! button $smileys -image [::skin::loadPixmap butsmile] -relief flat -padx 0 \ -background [::skin::getKey buttonbarbg] -highlightthickness 0 -borderwidth 0 \ -highlightbackground [::skin::getKey buttonbarbg] -activebackground [::skin::getKey buttonbarbg] set_balloon $smileys [trans insertsmiley] ! ! #Font button ! button $fontsel -image [::skin::loadPixmap butfont] -relief flat -padx 0 \ -background [::skin::getKey buttonbarbg] -highlightthickness 0 -borderwidth 0\ -highlightbackground [::skin::getKey buttonbarbg] -activebackground [::skin::getKey buttonbarbg] --- 1801,1813 ---- ! #Buttons are now labels, to get nicer interface on Mac OS X ! #Smiley button ! label $smileys -image [::skin::loadPixmap butsmile] -relief flat -padx 0 \ -background [::skin::getKey buttonbarbg] -highlightthickness 0 -borderwidth 0 \ -highlightbackground [::skin::getKey buttonbarbg] -activebackground [::skin::getKey buttonbarbg] set_balloon $smileys [trans insertsmiley] ! #Font button ! label $fontsel -image [::skin::loadPixmap butfont] -relief flat -padx 0 \ -background [::skin::getKey buttonbarbg] -highlightthickness 0 -borderwidth 0\ -highlightbackground [::skin::getKey buttonbarbg] -activebackground [::skin::getKey buttonbarbg] *************** *** 1815,1819 **** #Block button ! button $block -image [::skin::loadPixmap butblock] -relief flat -padx 0 \ -background [::skin::getKey buttonbarbg] -highlightthickness 0 -borderwidth 0\ -highlightbackground [::skin::getKey buttonbarbg] -activebackground [::skin::getKey buttonbarbg] --- 1815,1819 ---- #Block button ! label $block -image [::skin::loadPixmap butblock] -relief flat -padx 0 \ -background [::skin::getKey buttonbarbg] -highlightthickness 0 -borderwidth 0\ -highlightbackground [::skin::getKey buttonbarbg] -activebackground [::skin::getKey buttonbarbg] *************** *** 1821,1846 **** #Send file button ! button $sendfile -image [::skin::loadPixmap butsend] -relief flat -padx 0 \ -background [::skin::getKey buttonbarbg] -highlightthickness 0 -borderwidth 0\ -highlightbackground [::skin::getKey buttonbarbg] -activebackground [::skin::getKey buttonbarbg] set_balloon $sendfile [trans sendfile] ! #Invite another contact button ! button $invite -image [::skin::loadPixmap butinvite] -relief flat -padx 0 \ -background [::skin::getKey buttonbarbg] -highlightthickness 0 -borderwidth 0\ -highlightbackground [::skin::getKey buttonbarbg] -activebackground [::skin::getKey buttonbarbg] set_balloon $invite [trans invite] ! # Pack them pack $fontsel $smileys -side left -padx 0 -pady 0 pack $block $sendfile $invite -side right -padx 0 -pady 0 ! ! # Configure our commands for onclick ! $smileys configure -command "::smiley::smileyMenu \[winfo pointerx $w\] \[winfo pointery $w\] $input" ! $fontsel configure -command "after 1 change_myfont [string range $w 1 end]" ! $block configure -command "::amsn::ShowChatList \"[trans block]/[trans unblock]\" $w ::amsn::blockUnblockUser" ! $sendfile configure -command "::amsn::FileTransferSend $w" ! $invite configure -command "::amsn::ShowInviteMenu $w \[winfo pointerx $w\] \[winfo pointery $w\]" ! # Create our bindings bind $smileys <Enter> "$smileys configure -image [::skin::loadPixmap butsmile_hover]" --- 1821,1845 ---- #Send file button ! label $sendfile -image [::skin::loadPixmap butsend] -relief flat -padx 0 \ -background [::skin::getKey buttonbarbg] -highlightthickness 0 -borderwidth 0\ -highlightbackground [::skin::getKey buttonbarbg] -activebackground [::skin::getKey buttonbarbg] set_balloon $sendfile [trans sendfile] ! #Invite another contact button ! label $invite -image [::skin::loadPixmap butinvite] -relief flat -padx 0 \ -background [::skin::getKey buttonbarbg] -highlightthickness 0 -borderwidth 0\ -highlightbackground [::skin::getKey buttonbarbg] -activebackground [::skin::getKey buttonbarbg] set_balloon $invite [trans invite] ! # Pack them pack $fontsel $smileys -side left -padx 0 -pady 0 pack $block $sendfile $invite -side right -padx 0 -pady 0 ! ! bind $smileys <<Button1>> "::smiley::smileyMenu \[winfo pointerx $w\] \[winfo pointery $w\] $input" ! bind $fontsel <<Button1>> "after 1 change_myfont [string range $w 1 end]" ! bind $block <<Button1>> "::amsn::ShowChatList \"[trans block]/[trans unblock]\" $w ::amsn::blockUnblockUser" ! bind $sendfile <<Button1>> "::amsn::FileTransferSend $w" ! bind $invite <<Button1>> "::amsn::ShowInviteMenu $w \[winfo pointerx $w\] \[winfo pointery $w\]" ! # Create our bindings bind $smileys <Enter> "$smileys configure -image [::skin::loadPixmap butsmile_hover]" *************** *** 1850,1853 **** --- 1849,1853 ---- bind $block <Enter> "$block configure -image [::skin::loadPixmap butblock_hover]" bind $block <Leave> "$block configure -image [::skin::loadPixmap butblock]" + bind $sendfile <Enter> "$sendfile configure -image [::skin::loadPixmap butsend_hover]" bind $sendfile <Leave> "$sendfile configure -image [::skin::loadPixmap butsend]" |