mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-05 09:01:08 +00:00
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:
parent
8dd3d1f27a
commit
030e3d56d6
2 changed files with 25 additions and 6 deletions
|
@ -9,7 +9,13 @@
|
||||||
* Source/NSTabView.m: implementation is at 90%. All delegate
|
* Source/NSTabView.m: implementation is at 90%. All delegate
|
||||||
messages are sent as required (if possible) and tab selection is
|
messages are sent as required (if possible) and tab selection is
|
||||||
now by the spec. Also a small optimization in tab selection makes
|
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
|
* Source/NSMenu.m: redid alot of the insertItem: addItem: methods
|
||||||
to unify under the one primitive method. Did the same for
|
to unify under the one primitive method. Did the same for
|
||||||
removeItem:. Also added all the rest of the NSMenu notifications:
|
removeItem:. Also added all the rest of the NSMenu notifications:
|
||||||
|
|
|
@ -152,6 +152,7 @@
|
||||||
[tab_delegate tabView:self willSelectTabViewItem:tab_selected];
|
[tab_delegate tabView:self willSelectTabViewItem:tab_selected];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tab_selected_item = [tab_items indexOfObject:tab_selected];
|
||||||
[tab_selected _setTabState:NSSelectedTab];
|
[tab_selected _setTabState:NSSelectedTab];
|
||||||
if ([tab_selected view])
|
if ([tab_selected view])
|
||||||
[self addSubview:[tab_selected view]];
|
[self addSubview:[tab_selected view]];
|
||||||
|
@ -161,6 +162,8 @@
|
||||||
{
|
{
|
||||||
[tab_delegate tabView:self didSelectTabViewItem:tab_selected];
|
[tab_delegate tabView:self didSelectTabViewItem:tab_selected];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[self setNeedsDisplay:YES];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,12 +237,13 @@
|
||||||
{
|
{
|
||||||
NSRect cRect = [self frame];
|
NSRect cRect = [self frame];
|
||||||
|
|
||||||
cRect.origin.x = 2;
|
cRect.origin.x = 0;
|
||||||
cRect.origin.y = 2;
|
cRect.origin.y = 0;
|
||||||
cRect.size.height -= 4;
|
cRect.size.height += 1;
|
||||||
cRect.size.width -= 4;
|
cRect.size.width += 1;
|
||||||
|
|
||||||
cRect.size.height -= 21;
|
if (tab_type == NSTopTabsBezelBorder)
|
||||||
|
cRect.size.height -= 21;
|
||||||
|
|
||||||
return cRect;
|
return cRect;
|
||||||
}
|
}
|
||||||
|
@ -276,6 +280,15 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!tab_selected)
|
||||||
|
[self selectFirstTabViewItem:nil];
|
||||||
|
|
||||||
|
if (tab_type == NSNoTabsBezelBorder)
|
||||||
|
{
|
||||||
|
DPSgrestore(ctxt);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (i=0;i<howMany;i++) {
|
for (i=0;i<howMany;i++) {
|
||||||
// where da tab be at?
|
// where da tab be at?
|
||||||
NSSize s;
|
NSSize s;
|
||||||
|
|
Loading…
Reference in a new issue