More and more fun stuff, NSTabView kicks arse now. :-)

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4655 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Michael Silva 1999-07-26 08:06:36 +00:00
parent b4761532b1
commit 3e619beded
2 changed files with 25 additions and 6 deletions

View file

@ -9,7 +9,13 @@
* Source/NSTabView.m: implementation is at 90%. All delegate
messages are sent as required (if possible) and tab selection is
now by the spec. Also a small optimization in tab selection makes
sure we don't reselect tabs that are already selected.
sure we don't reselect tabs that are already selected. Also, when
drawRect is called, if no tab is selected the first tab becomes
selected. Further, we properly keep the value of the index of the
currently selected item. I also fixed the drawing code for use
NSTabView without displaying tabs. The result of this can be seen
in core/Testing/GNUstepInstaller.app. Tidied (- contentRect) to
return something a little closer to the full rect.
* Source/NSMenu.m: redid alot of the insertItem: addItem: methods
to unify under the one primitive method. Did the same for
removeItem:. Also added all the rest of the NSMenu notifications:

View file

@ -152,6 +152,7 @@
[tab_delegate tabView:self willSelectTabViewItem:tab_selected];
}
tab_selected_item = [tab_items indexOfObject:tab_selected];
[tab_selected _setTabState:NSSelectedTab];
if ([tab_selected view])
[self addSubview:[tab_selected view]];
@ -161,6 +162,8 @@
{
[tab_delegate tabView:self didSelectTabViewItem:tab_selected];
}
[self setNeedsDisplay:YES];
}
}
@ -234,12 +237,13 @@
{
NSRect cRect = [self frame];
cRect.origin.x = 2;
cRect.origin.y = 2;
cRect.size.height -= 4;
cRect.size.width -= 4;
cRect.origin.x = 0;
cRect.origin.y = 0;
cRect.size.height += 1;
cRect.size.width += 1;
cRect.size.height -= 21;
if (tab_type == NSTopTabsBezelBorder)
cRect.size.height -= 21;
return cRect;
}
@ -276,6 +280,15 @@
break;
}
if (!tab_selected)
[self selectFirstTabViewItem:nil];
if (tab_type == NSNoTabsBezelBorder)
{
DPSgrestore(ctxt);
return;
}
for (i=0;i<howMany;i++) {
// where da tab be at?
NSSize s;