diff --git a/ChangeLog b/ChangeLog index 9065009b5..2f200fa5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +1999-07-27 Michael Hanni + + * Source/NSTabView.m: added code to allow tabs on the bottom of a + tabview. Also made the space that the tabs themselves are draw in + from 20 pixels to 16 (which is the exact space needed.) + * Images/common_TabDownSelectedLeft.tiff + common_TabDownSelectedRight.tiff + common_TabDownSelectedToUnSelectedJunction.tiff + common_TabDownUnSelectedJunction.tiff + common_TabDownUnSelectedLeft.tiff + common_TabDownUnSelectedRight.tiff + common_TabDownUnSelectedToSelectedJunction.tiff: + place keeper images for bottom tabs. These really need to be + redrawn. + * Source/NSMenu.m: removed isTornOff: from frontend and it is in + the backend where it should be. + * Source/NSMenuView.m: added code that does quite a bit of the + transient menu code. + + The event code needs to be finessed so that the transient menu is + not allowed to remain on screen unless the mouse button stays down. + 1999-07-26 Michael Hanni * Source/NSTableView.m: added much more code to this diff --git a/Headers/gnustep/gui/NSMenu.h b/Headers/gnustep/gui/NSMenu.h index 59db02c41..ff890cf68 100644 --- a/Headers/gnustep/gui/NSMenu.h +++ b/Headers/gnustep/gui/NSMenu.h @@ -52,6 +52,9 @@ BOOL menu_changed; BOOL menu_is_tornoff; + // Private. + BOOL menu_follow_transient; + // Reserved for back-end use void *be_menu_reserved; } diff --git a/Headers/gnustep/gui/NSTabView.h b/Headers/gnustep/gui/NSTabView.h index 76be11d3f..a0a4b6965 100644 --- a/Headers/gnustep/gui/NSTabView.h +++ b/Headers/gnustep/gui/NSTabView.h @@ -31,6 +31,7 @@ typedef enum { NSTopTabsBezelBorder, + NSBottomTabsBezelBorder, NSNoTabsBezelBorder, NSNoTabsLineBorder, NSNoTabsNoBorder diff --git a/Images/GNUmakefile b/Images/GNUmakefile index ca3dda1c1..3bc3d0e69 100644 --- a/Images/GNUmakefile +++ b/Images/GNUmakefile @@ -58,6 +58,13 @@ common_SwitchOn.tiff \ common_SwitchOff.tiff \ common_SliderHoriz.tiff \ common_SliderVert.tiff \ +common_TabDownSelectedLeft.tiff \ +common_TabDownSelectedRight.tiff \ +common_TabDownSelectedToUnSelectedJunction.tiff \ +common_TabDownUnSelectedJunction.tiff \ +common_TabDownUnSelectedLeft.tiff \ +common_TabDownUnSelectedRight.tiff \ +common_TabDownUnSelectedToSelectedJunction.tiff \ common_TabSelectedLeft.tiff \ common_TabSelectedRight.tiff \ common_TabSelectedToUnSelectedJunction.tiff \ diff --git a/Images/common_TabDownSelectedLeft.tiff b/Images/common_TabDownSelectedLeft.tiff new file mode 100644 index 000000000..ff68d375a Binary files /dev/null and b/Images/common_TabDownSelectedLeft.tiff differ diff --git a/Images/common_TabDownSelectedRight.tiff b/Images/common_TabDownSelectedRight.tiff new file mode 100644 index 000000000..fdcaef8f1 Binary files /dev/null and b/Images/common_TabDownSelectedRight.tiff differ diff --git a/Images/common_TabDownSelectedToUnSelectedJunction.tiff b/Images/common_TabDownSelectedToUnSelectedJunction.tiff new file mode 100644 index 000000000..e5bd30ff3 Binary files /dev/null and b/Images/common_TabDownSelectedToUnSelectedJunction.tiff differ diff --git a/Images/common_TabDownUnSelectedJunction.tiff b/Images/common_TabDownUnSelectedJunction.tiff new file mode 100644 index 000000000..fd7d4f2b7 Binary files /dev/null and b/Images/common_TabDownUnSelectedJunction.tiff differ diff --git a/Images/common_TabDownUnSelectedLeft.tiff b/Images/common_TabDownUnSelectedLeft.tiff new file mode 100644 index 000000000..220c700de Binary files /dev/null and b/Images/common_TabDownUnSelectedLeft.tiff differ diff --git a/Images/common_TabDownUnSelectedRight.tiff b/Images/common_TabDownUnSelectedRight.tiff new file mode 100644 index 000000000..52a1a42cd Binary files /dev/null and b/Images/common_TabDownUnSelectedRight.tiff differ diff --git a/Images/common_TabDownUnSelectedToSelectedJunction.tiff b/Images/common_TabDownUnSelectedToSelectedJunction.tiff new file mode 100644 index 000000000..012194d9f Binary files /dev/null and b/Images/common_TabDownUnSelectedToSelectedJunction.tiff differ diff --git a/Source/NSMenu.m b/Source/NSMenu.m index ce88b7485..9dab3840b 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -354,10 +354,12 @@ static NSZone *menuZone = NULL; return menu_supermenu && [menu_supermenu attachedMenu] == self; } +/* - (BOOL) isTornOff { return menu_is_tornoff; } +*/ - (NSPoint) locationForSubmenu: (NSMenu *)aSubmenu { diff --git a/Source/NSMenuView.m b/Source/NSMenuView.m index 73925d301..470aaf335 100644 --- a/Source/NSMenuView.m +++ b/Source/NSMenuView.m @@ -153,6 +153,8 @@ static float GSMenuBarHeight = 25.0; // a guess. if ([anItem hasSubmenu] && ![[anItem target] isTornOff]) [[anItem target] close]; + else if ([anItem hasSubmenu] && [[anItem target] isTornOff]) + [[anItem target] closeTransient]; [anItem setState: 0]; menuv_highlightedItemIndex = -1; @@ -167,6 +169,8 @@ static float GSMenuBarHeight = 25.0; // a guess. if ([anItem hasSubmenu] && ![[anItem target] isTornOff]) [[anItem target] close]; + else if ([anItem hasSubmenu] && [[anItem target] isTornOff]) + [[anItem target] closeTransient]; [anItem setState: 0]; } @@ -185,6 +189,8 @@ static float GSMenuBarHeight = 25.0; // a guess. if ([anItem hasSubmenu] && ![[anItem target] isTornOff]) [[anItem target] display]; + else if ([anItem hasSubmenu] && [[anItem target] isTornOff]) + [[anItem target] displayTransient]; } // set ivar to new index @@ -688,7 +694,8 @@ cell do the following */ while (!finished) { // Recursive menu close & deselect. - if ([aMenu supermenu] && ![aMenu isTornOff]) +// if ([aMenu supermenu] && ![aMenu isTornOff]) + if ([aMenu supermenu]) { [[[aMenu supermenu] menuView] setHighlightedItemIndex: -1]; aMenu = [aMenu supermenu]; @@ -712,7 +719,7 @@ cell do the following */ /* If the mouse is released and there is no highlighted cell */ - else if (menuv_highlightedItemIndex == -1) + else if (menuv_highlightedItemIndex == -1 && menuv_popb) { NSLog(@"This is the popupbutton close if not selected test.\n"); diff --git a/Source/NSTabView.m b/Source/NSTabView.m index 1baadb28b..af221c150 100644 --- a/Source/NSTabView.m +++ b/Source/NSTabView.m @@ -235,15 +235,24 @@ - (NSRect)contentRect { - NSRect cRect = [self bounds]; + NSRect cRect = [self frame]; cRect.origin.x = 0; - cRect.origin.y = 0; - cRect.size.height += 1; - cRect.size.width += 1; +// cRect.size.height += 1; +// cRect.size.width += 1; if (tab_type == NSTopTabsBezelBorder) - cRect.size.height -= 21; + { + cRect.origin.y = 0; + cRect.size.height -= 16; + } + + if (tab_type == NSBottomTabsBezelBorder) + { + NSLog(@"hehehe. %f", cRect.origin.y); + cRect.size.height -= 8; + cRect.origin.y = 8; + } return cRect; } @@ -265,10 +274,17 @@ switch (tab_type) { case NSTopTabsBezelBorder: - rect.size.height -= 20; + rect.size.height -= 16; NSDrawButton(rect, rect); borderThickness = 2; break; + case NSBottomTabsBezelBorder: + rect.size.height -= 16; + rect.origin.y += 16; + NSDrawButton(rect, rect); + rect.origin.y -= 16; + borderThickness = 2; + break; case NSNoTabsBezelBorder: NSDrawButton(rect, rect); borderThickness = 2; @@ -291,6 +307,110 @@ return; } + if (tab_type == NSBottomTabsBezelBorder) + { + for (i=0;i