summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-02-04 00:23:03 (GMT)
committerhobbs <hobbs>2004-02-04 00:23:03 (GMT)
commitddbf41804636015e174c51c243ef250fe5a5d8cb (patch)
treeef5480755b9c91dc499fcb8382610a72781c10bd
parent9b95eacd124700b0b7bf9a0a1e69bb1fb7e079c5 (diff)
downloadtk-ddbf41804636015e174c51c243ef250fe5a5d8cb.zip
tk-ddbf41804636015e174c51c243ef250fe5a5d8cb.tar.gz
tk-ddbf41804636015e174c51c243ef250fe5a5d8cb.tar.bz2
* library/menu.tcl (::tk::MbPost): make menubuttons that post
above or below reverse direction when not enough space is available.
-rw-r--r--ChangeLog30
-rw-r--r--library/menu.tcl13
2 files changed, 29 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index d70bea8..49130e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/menu.tcl (::tk::MbPost): make menubuttons that post
+ above or below reverse direction when not enough space is available.
+
2004-01-28 Pat Thoyts <patthoyts@users.sourceforge.net>
* win/tkWinCursor.c: Backported fix for bug #776646 which makes
@@ -5,28 +10,29 @@
2003-01-27 Daniel Steffen <das@users.sourceforge.net>
- * macosx/Wish.pbproj/project.pbxproj: removed erroneous reference
- to mkpsenc.tcl in bundle resources phase (mkpsenc.tcl is already
- part of the copy files phase to Resources/Scripts).
+ * macosx/Wish.pbproj/project.pbxproj: removed erroneous reference
+ to mkpsenc.tcl in bundle resources phase (mkpsenc.tcl is already
+ part of the copy files phase to Resources/Scripts).
- * macosx/Makefile: added support for 'xcodebuild' on Mac OS X 10.3.
+ * macosx/Makefile: added support for 'xcodebuild' on Mac OS X 10.3.
2003-12-31 Daniel Steffen <das@users.sourceforge.net>
- * macosx/Wish.pbproj/project.pbxproj: added missing private headers
- to installed Tk.framework, so that tkInt.h can be included
- sucessfully from Tk.framework/PrivateHeaders.
+ * macosx/Wish.pbproj/project.pbxproj: added missing private headers
+ to installed Tk.framework, so that tkInt.h can be included
+ sucessfully from Tk.framework/PrivateHeaders.
* generic/tkPort.h: corrected include of tkMacOSXPort.h
2003-12-17 Jim Ingham <jingham@apple.com>
- * macosx/tkMacOSXScrlbr.c: Reworking Vince's fix to [Bug 842952].
- This version is clearer, and works helps keep the mouse better pinned to the
- scrollbar. I also removed the glitch where the scrollbar would jump get
- its middle over the mouse when you first moved it.
+ * macosx/tkMacOSXScrlbr.c: Reworking Vince's fix to [Bug 842952].
+ This version is clearer, and works helps keep the mouse better
+ pinned to the scrollbar. I also removed the glitch where the
+ scrollbar would jump get its middle over the mouse when you first
+ moved it.
Import from TOT.
-
+
2003-12-11 David Gravereaux <davygrvy@pobox.com>
* win/winMain.c: Backed-out yesterdays change. Reverted to 1.15 for
diff --git a/library/menu.tcl b/library/menu.tcl
index 21dd22d..c6d65bf 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -4,7 +4,7 @@
# It also implements keyboard traversal of menus and implements a few
# other utility procedures related to menus.
#
-# RCS: @(#) $Id: menu.tcl,v 1.18 2002/08/31 06:12:28 das Exp $
+# RCS: @(#) $Id: menu.tcl,v 1.18.2.1 2004/02/04 00:23:04 hobbs Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -280,11 +280,20 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
above {
set x [winfo rootx $w]
set y [expr {[winfo rooty $w] - [winfo reqheight $menu]}]
+ # if we go offscreen to the top, show as 'below'
+ if {$y < 0} {
+ set y [expr {[winfo rooty $w] + [winfo height $w]}]
+ }
PostOverPoint $menu $x $y
}
below {
set x [winfo rootx $w]
set y [expr {[winfo rooty $w] + [winfo height $w]}]
+ # if we go offscreen to the bottom, show as 'above'
+ set mh [winfo reqheight $menu]
+ if {($y + $mh) > [winfo screenheight $w]} {
+ set y [expr {[winfo rooty $w] - $mh}]
+ }
PostOverPoint $menu $x $y
}
left {
@@ -336,7 +345,7 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
PostOverPoint $menu $x $y [MenuFindName $menu [$w cget -text]]
} else {
PostOverPoint $menu [winfo rootx $w] [expr {[winfo rooty $w]+[winfo height $w]}]
- }
+ }
}
}
} msg]} {