mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
Lots of fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4844 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
44dc7234b5
commit
6ef83b3719
12 changed files with 352 additions and 214 deletions
18
ChangeLog
18
ChangeLog
|
@ -1,3 +1,21 @@
|
|||
1999-09-07 Michael Hanni <mhanni@sprintmail.com>
|
||||
|
||||
* Source/NSInterfaceStyle.m: added support for
|
||||
GSWindowMakerInterfaceStyle.
|
||||
* Headers/NSInterfaceStyle.h: added enum
|
||||
GSWindowMakerInterfaceStyle.
|
||||
* Source/NSMenu.m: implemented NSInterfaceStyle based window maker
|
||||
like menus. i.e. they line up with the menu item selected.
|
||||
try 'defaults write NSGlobalDomain NSMenuInterfaceStyle
|
||||
GSWindowMakerInterfaceStyle'
|
||||
* Source/NSTabView.m: some modifications to make tabs on the
|
||||
bottom look a little better.
|
||||
* Source/NSAttributedString.m: turned off fixParagraphAttributes,
|
||||
was causing Text Network to crash. (Most likely my fault.)
|
||||
* Source/NSLayoutManager.m: lots of code... nothing exciting.
|
||||
* Images/*: somehow I triggered CVS to touch everything in here,
|
||||
oops.
|
||||
|
||||
Tue Sep 7 6:50:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSScrollView.m: ([-setContentView:]) prohibit illegal settings.
|
||||
|
|
|
@ -36,7 +36,14 @@ typedef enum {
|
|||
NSNoInterfaceStyle = 0,
|
||||
NSNextStepInterfaceStyle = 1,
|
||||
NSMacintoshInterfaceStyle = 2,
|
||||
NSWindows95InterfaceStyle = 3
|
||||
NSWindows95InterfaceStyle = 3,
|
||||
|
||||
/*
|
||||
* GNUstep specific. Blame: Michael Hanni.
|
||||
*/
|
||||
|
||||
GSWindowMakerInterfaceStyle = 4
|
||||
|
||||
} NSInterfaceStyle;
|
||||
|
||||
extern NSString *NSInterfaceStyleDefault;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; if not, write to the Free
|
||||
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
|
||||
GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT)
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -412,7 +412,7 @@ documentAttributes: (NSDictionary**)dict
|
|||
- (void) fixAttributesInRange: (NSRange)range
|
||||
{
|
||||
[self fixFontAttributeInRange: range];
|
||||
[self fixParagraphStyleAttributeInRange: range];
|
||||
// [self fixParagraphStyleAttributeInRange: range];
|
||||
[self fixAttachmentAttributeInRange: range];
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@ styleFromString(NSString* str)
|
|||
return NSMacintoshInterfaceStyle;
|
||||
if ([str isEqualToString: @"NSWindows95InterfaceStyle"])
|
||||
return NSWindows95InterfaceStyle;
|
||||
if ([str isEqualToString: @"GSWindowMakerInterfaceStyle"])
|
||||
return GSWindowMakerInterfaceStyle;
|
||||
return NSNoInterfaceStyle;
|
||||
}
|
||||
|
||||
|
|
|
@ -169,8 +169,8 @@ static NSComparisonResult aSort(GSIArrayItem i0, GSIArrayItem i1)
|
|||
|
||||
position = GSIArrayInsertionPosition(_runs, (GSIArrayItem)aKey, aSort);
|
||||
|
||||
NSLog(@"key: %d aObject: %d position: %d", aKey->glyphRange.location,
|
||||
aObject->glyphRange.location, position);
|
||||
// NSLog(@"key: %d aObject: %d position: %d", aKey->glyphRange.location,
|
||||
//aObject->glyphRange.location, position);
|
||||
|
||||
if (position > 0)
|
||||
{
|
||||
|
@ -179,18 +179,18 @@ aObject->glyphRange.location, position);
|
|||
if (anKey->glyphRange.location == aObject->glyphRange.location)
|
||||
{
|
||||
// GSIArrayInsertSorted(_runs, (GSIArrayItem)anObject, aSort);
|
||||
NSLog(@"=========> duplicated item.");
|
||||
// NSLog(@"=========> duplicated item.");
|
||||
GSIArraySetItemAtIndex(_runs, (GSIArrayItem)anObject, position-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"=========> not duplicated item.");
|
||||
// NSLog(@"=========> not duplicated item.");
|
||||
GSIArrayInsertItem(_runs, (GSIArrayItem)anObject, position);
|
||||
}
|
||||
}
|
||||
else if (position == 0)
|
||||
{
|
||||
NSLog(@"=========> first item (zero index).");
|
||||
// NSLog(@"=========> first item (zero index).");
|
||||
GSIArrayInsertItem(_runs, (GSIArrayItem)anObject, position);
|
||||
// GSIArrayInsertSorted(_runs, (GSIArrayItem)anObject, aSort);
|
||||
// [self insertObject:anObject atIndex:position];
|
||||
|
@ -198,7 +198,7 @@ aObject->glyphRange.location, position);
|
|||
else
|
||||
NSLog(@"dead. VERY DEAD DEAD DEAD DEAD.");
|
||||
|
||||
NSLog(@"==> %d item(s)", GSIArrayCount(_runs));
|
||||
// NSLog(@"==> %d item(s)", GSIArrayCount(_runs));
|
||||
}
|
||||
|
||||
- (void)insertObject:(id)anObject
|
||||
|
@ -536,16 +536,19 @@ textContainer(s) in containerRuns.", [containerRuns count]);
|
|||
{
|
||||
GSTextContainerLayoutInfo *aNewLine = [containerRuns objectAtIndex:i];
|
||||
|
||||
/*
|
||||
NSLog(@"glyphRangeForTextContainer: (%d, %d)",
|
||||
aNewLine->glyphRange.location,
|
||||
aNewLine->glyphRange.length);
|
||||
*/
|
||||
|
||||
if ([aNewLine->textContainer isEqual:aTextContainer])
|
||||
{
|
||||
/*
|
||||
NSLog(@"glyphRangeForWantedTextContainer: (%d, %d)",
|
||||
aNewLine->glyphRange.location,
|
||||
aNewLine->glyphRange.length);
|
||||
|
||||
*/
|
||||
return aNewLine->glyphRange;
|
||||
}
|
||||
}
|
||||
|
@ -927,7 +930,7 @@ info->lineFragmentRect.size.height);
|
|||
|
||||
firstPosition = [fragmentRuns indexOfObjectContainingLocation:glyphRange.location];
|
||||
lastPosition = [fragmentRuns
|
||||
indexOfObjectContainingLocation:(glyphRange.location+glyphRange.length-2)];
|
||||
indexOfObjectContainingLocation:(glyphRange.location+glyphRange.length-3)];
|
||||
|
||||
NSLog(@"glyphRange: (%d, %d) position1: %d position2: %d",
|
||||
glyphRange.location, glyphRange.length, firstPosition, lastPosition);
|
||||
|
@ -936,13 +939,16 @@ glyphRange.location, glyphRange.length, firstPosition, lastPosition);
|
|||
{
|
||||
if (lastPosition == -1)
|
||||
{
|
||||
lastPosition = [fragmentRuns count]; // FIXME
|
||||
lastPosition = [fragmentRuns count] - 1; // FIXME
|
||||
NSLog(@"fixed lastPosition: %d", lastPosition);
|
||||
}
|
||||
|
||||
for (i = firstPosition; i < lastPosition; i++)
|
||||
for (i = firstPosition; i <= lastPosition; i++)
|
||||
{
|
||||
GSLineLayoutInfo *aLine = [fragmentRuns objectAtIndex:i];
|
||||
NSRect aRect = aLine->lineFragmentRect;
|
||||
aRect.size.height -= 4;
|
||||
|
||||
/*
|
||||
NSLog(@"drawRange: (%d, %d) inRect (%f, %f) (%f, %f)",
|
||||
aLine->glyphRange.location,
|
||||
|
@ -952,6 +958,8 @@ aLine->lineFragmentRect.origin.y,
|
|||
aLine->lineFragmentRect.size.width,
|
||||
aLine->lineFragmentRect.size.height);
|
||||
*/
|
||||
|
||||
NSEraseRect (aRect);
|
||||
[_textStorage drawRange:aLine->glyphRange inRect:aLine->lineFragmentRect];
|
||||
}
|
||||
}
|
||||
|
@ -1015,13 +1023,15 @@ Ghiradelli chocolate to he who puts all the pieces together :) */
|
|||
{
|
||||
NSSize cSize = [aContainer containerSize];
|
||||
float i = 0.0;
|
||||
NSMutableArray *lines = [NSMutableArray new];
|
||||
NSMutableArray *lineStarts = [NSMutableArray new];
|
||||
NSMutableArray *lineEnds = [NSMutableArray new];
|
||||
int indexToAdd;
|
||||
_GNUTextScanner *lineScanner;
|
||||
_GNUTextScanner *paragraphScanner;
|
||||
BOOL lastLineForContainerReached = NO;
|
||||
NSString *aString;
|
||||
int previousScanLocation;
|
||||
int previousParagraphLocation;
|
||||
int endScanLocation;
|
||||
int startIndex;
|
||||
NSRect firstProposedRect;
|
||||
|
@ -1038,9 +1048,11 @@ Ghiradelli chocolate to he who puts all the pieces together :) */
|
|||
NSRange currentStringRange;
|
||||
NSRange trailingSpacesRange;
|
||||
NSRange leadingNlRange;
|
||||
NSRange trailingNlRange;
|
||||
NSSize lSize;
|
||||
float lineWidth = 0.0;
|
||||
float ourLines = 0.0;
|
||||
int beginLineIndex = 0;
|
||||
|
||||
NSLog(@"rebuilding Layout at index: %d.\n", glyphIndex);
|
||||
|
||||
|
@ -1075,23 +1087,30 @@ Ghiradelli chocolate to he who puts all the pieces together :) */
|
|||
|
||||
while (![paragraphScanner isAtEnd])
|
||||
{
|
||||
// leadingNlRange=[paragraphScanner scanSetCharacters];
|
||||
paragraphRange = [paragraphScanner scanNonSetCharacters];
|
||||
leadingNlRange=[paragraphScanner scanSetCharacters];
|
||||
previousParagraphLocation = [paragraphScanner scanLocation];
|
||||
beginLineIndex = previousParagraphLocation;
|
||||
lineWidth = 0.0;
|
||||
|
||||
if (leadingNlRange.length)
|
||||
currentStringRange = NSUnionRange (leadingNlRange,paragraphRange);
|
||||
leadingNlRange=[paragraphScanner scanSetCharacters];
|
||||
paragraphRange = [paragraphScanner scanNonSetCharacters];
|
||||
trailingNlRange=[paragraphScanner scanSetCharacters];
|
||||
|
||||
// NSLog(@"leadingNlRange: (%d, %d)", leadingNlRange.location, leadingNlRange.length);
|
||||
|
||||
// if (leadingNlRange.length)
|
||||
// paragraphRange = NSUnionRange (leadingNlRange,paragraphRange);
|
||||
// if (trailingNlRange.length)
|
||||
// paragraphRange = NSUnionRange (trailingNlRange,paragraphRange);
|
||||
|
||||
NSLog(@"paragraphRange: (%d, %d)", paragraphRange.location, paragraphRange.length);
|
||||
|
||||
NSLog(@"======> begin paragraph");
|
||||
|
||||
lineScanner = [_GNUTextScanner scannerWithString:[[_textStorage string] substringWithRange:paragraphRange]
|
||||
set:selectionWordGranularitySet invertedSet:invSelectionWordGranularitySet];
|
||||
|
||||
while(![lineScanner isAtEnd])
|
||||
{
|
||||
previousScanLocation = [lineScanner scanLocation];
|
||||
|
||||
// snack next word
|
||||
leadingSpacesRange = [lineScanner scanSetCharacters]; // leading spaces: only first time
|
||||
currentStringRange = [lineScanner scanNonSetCharacters];
|
||||
|
@ -1104,16 +1123,28 @@ Ghiradelli chocolate to he who puts all the pieces together :) */
|
|||
|
||||
lSize = [_textStorage sizeRange:currentStringRange];
|
||||
|
||||
if (lineWidth + lSize.width < cSize.width)
|
||||
// lSize = [_textStorage sizeRange:
|
||||
//NSMakeRange(currentStringRange.location+paragraphRange.location+startIndex,
|
||||
//currentStringRange.length)];
|
||||
|
||||
if ((lineWidth + lSize.width) < cSize.width)
|
||||
{
|
||||
if ([lineScanner isAtEnd])
|
||||
{
|
||||
NSLog(@"we are at end before finishing a line: %d.\n", [lineScanner scanLocation]);
|
||||
[lines addObject:[NSNumber numberWithInt:(int)[lineScanner scanLocation] + paragraphRange.location]];
|
||||
NSLog(@"scanLocation = %d, previousParagraphLocation = %d, beginLineIndex = %d",
|
||||
[lineScanner scanLocation],
|
||||
previousParagraphLocation,
|
||||
beginLineIndex);
|
||||
[lineStarts addObject: [NSNumber
|
||||
numberWithInt:beginLineIndex]];
|
||||
[lineEnds addObject: [NSNumber
|
||||
numberWithInt:(int)[lineScanner scanLocation] + previousParagraphLocation - (beginLineIndex)]];
|
||||
lineWidth = 0.0;
|
||||
}
|
||||
|
||||
lineWidth += lSize.width;
|
||||
NSLog(@"lineWidth: %f", lineWidth);
|
||||
//NSLog(@"lineWidth: %f", lineWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1124,13 +1155,22 @@ Ghiradelli chocolate to he who puts all the pieces together :) */
|
|||
}
|
||||
|
||||
[lineScanner setScanLocation:previousScanLocation];
|
||||
indexToAdd = previousScanLocation + paragraphRange.location;
|
||||
indexToAdd = previousScanLocation + previousParagraphLocation
|
||||
- (beginLineIndex);
|
||||
|
||||
NSLog(@"previousScanLocation = %d, previousParagraphLocation = %d, beginLineIndex = %d indexToAdd = %d",
|
||||
previousScanLocation,
|
||||
previousParagraphLocation,
|
||||
beginLineIndex,
|
||||
indexToAdd);
|
||||
|
||||
ourLines += 14.0;
|
||||
lineWidth = 0;
|
||||
lineWidth = 0.0;
|
||||
|
||||
NSLog(@"indexToAdd: %d\tourLines: %f", indexToAdd, ourLines);
|
||||
|
||||
[lines addObject:[NSNumber numberWithInt:indexToAdd]];
|
||||
[lineStarts addObject: [NSNumber
|
||||
numberWithInt:beginLineIndex]];
|
||||
[lineEnds addObject:[NSNumber numberWithInt:indexToAdd]];
|
||||
beginLineIndex = previousScanLocation + previousParagraphLocation;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1138,7 +1178,7 @@ Ghiradelli chocolate to he who puts all the pieces together :) */
|
|||
break;
|
||||
}
|
||||
|
||||
endScanLocation = [lineScanner scanLocation] + paragraphRange.location;
|
||||
endScanLocation = [paragraphScanner scanLocation];
|
||||
|
||||
NSLog(@"endScanLocation: %d", endScanLocation);
|
||||
|
||||
|
@ -1151,14 +1191,18 @@ Ghiradelli chocolate to he who puts all the pieces together :) */
|
|||
|
||||
// step 2. break the lines up and assign rects to them.
|
||||
|
||||
for (i=0;i<[lines count];i++)
|
||||
for (i=0;i<[lineStarts count];i++)
|
||||
{
|
||||
NSRect aRect, bRect;
|
||||
float padding = [aContainer lineFragmentPadding];
|
||||
NSRange ourRange;
|
||||
|
||||
NSLog(@"\t\t===> %d", [[lines objectAtIndex:i] intValue]);
|
||||
// NSLog(@"\t\t===> %d", [[lines objectAtIndex:i] intValue]);
|
||||
|
||||
ourRange = NSMakeRange ([[lineStarts objectAtIndex: i] intValue],
|
||||
[[lineEnds objectAtIndex: i] intValue]);
|
||||
|
||||
/*
|
||||
if (i == 0)
|
||||
{
|
||||
ourRange = NSMakeRange (startIndex,
|
||||
|
@ -1170,7 +1214,10 @@ Ghiradelli chocolate to he who puts all the pieces together :) */
|
|||
[[lines objectAtIndex:i] intValue] - [[lines objectAtIndex:i-1]
|
||||
intValue]);
|
||||
}
|
||||
|
||||
*/
|
||||
NSLog(@"line: %@|", [[_textStorage string]
|
||||
substringWithRange:ourRange]);
|
||||
|
||||
firstProposedRect = NSMakeRect (0, i * 14, cSize.width, 14);
|
||||
|
||||
// ask our textContainer to fix our lineFragment.
|
||||
|
@ -1204,7 +1251,8 @@ intValue]);
|
|||
// didCompleteLayoutForTextContainer:[textContainers objectAtIndex:i]
|
||||
// atEnd:YES];
|
||||
|
||||
[lines release];
|
||||
[lineStarts release];
|
||||
[lineEnds release];
|
||||
|
||||
return endScanLocation;
|
||||
}
|
||||
|
|
|
@ -489,14 +489,17 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
|
|||
{
|
||||
NSRect frame;
|
||||
NSRect submenuFrame;
|
||||
NSWindow *win_link;
|
||||
|
||||
if (![self isFollowTransient])
|
||||
{
|
||||
frame = [aWindow frame];
|
||||
win_link = aWindow;
|
||||
}
|
||||
else
|
||||
{
|
||||
frame = [bWindow frame];
|
||||
win_link = bWindow;
|
||||
}
|
||||
|
||||
if (aSubmenu)
|
||||
|
@ -506,9 +509,20 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
|
|||
else
|
||||
submenuFrame = NSZeroRect;
|
||||
|
||||
return NSMakePoint (frame.origin.x + frame.size.width + 1,
|
||||
frame.origin.y + frame.size.height
|
||||
- submenuFrame.size.height);
|
||||
if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) == GSWindowMakerInterfaceStyle)
|
||||
{
|
||||
NSRect aRect = [menu_view rectOfItemAtIndex:[self indexOfItemWithTitle:[aSubmenu title]]];
|
||||
NSPoint subOrigin = [win_link convertBaseToScreen: NSMakePoint(aRect.origin.x, aRect.origin.y)];
|
||||
|
||||
return NSMakePoint (frame.origin.x + frame.size.width + 1,
|
||||
subOrigin.y - (submenuFrame.size.height - 41));
|
||||
}
|
||||
else
|
||||
{
|
||||
return NSMakePoint (frame.origin.x + frame.size.width + 1,
|
||||
frame.origin.y + frame.size.height
|
||||
- submenuFrame.size.height);
|
||||
}
|
||||
}
|
||||
|
||||
- (NSMenu *) supermenu
|
||||
|
@ -837,6 +851,12 @@ NSArray* array;
|
|||
}
|
||||
}
|
||||
|
||||
- (void) _rightMouseDisplay
|
||||
{
|
||||
// TODO: implement this method
|
||||
;
|
||||
}
|
||||
|
||||
- (void) display
|
||||
{
|
||||
if (menu_changed)
|
||||
|
|
|
@ -309,204 +309,234 @@
|
|||
|
||||
if (tab_type == NSBottomTabsBezelBorder)
|
||||
{
|
||||
for (i=0;i<howMany;i++) {
|
||||
// where da tab be at?
|
||||
NSSize s;
|
||||
NSRect r;
|
||||
NSPoint iP;
|
||||
NSTabViewItem *anItem = [tab_items objectAtIndex:i];
|
||||
NSTabState itemState;
|
||||
for (i=0;i<howMany;i++)
|
||||
{
|
||||
// where da tab be at?
|
||||
NSSize s;
|
||||
NSRect r;
|
||||
NSPoint iP;
|
||||
NSTabViewItem *anItem = [tab_items objectAtIndex:i];
|
||||
NSTabState itemState;
|
||||
|
||||
itemState = [anItem tabState];
|
||||
itemState = [anItem tabState];
|
||||
|
||||
s = [anItem sizeOfLabel:NO];
|
||||
s = [anItem sizeOfLabel:NO];
|
||||
|
||||
if (i == 0) {
|
||||
if (i == 0)
|
||||
{
|
||||
int iFlex = 0;
|
||||
iP.x = rect.origin.x;
|
||||
iP.y = rect.origin.y;
|
||||
|
||||
iP.x = rect.origin.x;
|
||||
iP.y = rect.origin.y;
|
||||
if (itemState == NSSelectedTab)
|
||||
{
|
||||
iP.y += 1;
|
||||
[[NSImage imageNamed:@"common_TabDownSelectedLeft.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
iP.y -= 1;
|
||||
iFlex = 1;
|
||||
}
|
||||
else if (itemState == NSBackgroundTab)
|
||||
{
|
||||
iP.y += 1;
|
||||
[[NSImage imageNamed:@"common_TabDownUnSelectedLeft.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
iP.y -= 1;
|
||||
}
|
||||
else
|
||||
NSLog(@"Not finished yet. Luff ya.\n");
|
||||
|
||||
if (itemState == NSSelectedTab) {
|
||||
iP.y += 1;
|
||||
[[NSImage imageNamed:@"common_TabDownSelectedLeft.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
}
|
||||
else if (itemState == NSBackgroundTab)
|
||||
[[NSImage imageNamed:@"common_TabDownUnSelectedLeft.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
else
|
||||
NSLog(@"Not finished yet. Luff ya.\n");
|
||||
r.origin.x = rect.origin.x + 13;
|
||||
r.origin.y = rect.origin.y + 2;
|
||||
r.size.width = s.width;
|
||||
r.size.height = 15 + iFlex;
|
||||
|
||||
r.origin.x = rect.origin.x + 13;
|
||||
r.origin.y = rect.origin.y + 2;
|
||||
r.size.width = s.width;
|
||||
r.size.height = 15;
|
||||
DPSsetlinewidth(ctxt,1);
|
||||
DPSsetgray(ctxt,1);
|
||||
DPSmoveto(ctxt, r.origin.x, r.origin.y-1);
|
||||
DPSrlineto(ctxt, r.size.width, 0);
|
||||
DPSstroke(ctxt);
|
||||
|
||||
DPSsetlinewidth(ctxt,1);
|
||||
DPSsetgray(ctxt,1);
|
||||
DPSmoveto(ctxt, r.origin.x, r.origin.y-1);
|
||||
DPSrlineto(ctxt, r.size.width, 0);
|
||||
DPSstroke(ctxt);
|
||||
[anItem drawLabel:NO inRect:r];
|
||||
|
||||
[anItem drawLabel:NO inRect:r];
|
||||
|
||||
previousRect = r;
|
||||
previousState = itemState;
|
||||
} else {
|
||||
iP.x = previousRect.origin.x + previousRect.size.width;
|
||||
iP.y = rect.origin.y;
|
||||
|
||||
if (itemState == NSSelectedTab) {
|
||||
iP.y += 1;
|
||||
[[NSImage
|
||||
imageNamed:@"common_TabDownUnSelectedToSelectedJunction.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
}
|
||||
else if (itemState == NSBackgroundTab) {
|
||||
if (previousState == NSSelectedTab) {
|
||||
iP.y += 1;
|
||||
[[NSImage
|
||||
imageNamed:@"common_TabDownSelectedToUnSelectedJunction.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
iP.y -= 1;
|
||||
previousRect = r;
|
||||
previousState = itemState;
|
||||
} else {
|
||||
[[NSImage
|
||||
imageNamed:@"common_TabDownUnSelectedJunction.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
}
|
||||
}
|
||||
else
|
||||
NSLog(@"Not finished yet. Luff ya.\n");
|
||||
int iFlex = 0;
|
||||
iP.x = previousRect.origin.x + previousRect.size.width;
|
||||
iP.y = rect.origin.y;
|
||||
|
||||
r.origin.x = iP.x + 13;
|
||||
r.origin.y = rect.origin.y + 2;
|
||||
r.size.width = s.width;
|
||||
r.size.height = 15;
|
||||
if (itemState == NSSelectedTab)
|
||||
{
|
||||
iP.y += 1;
|
||||
iFlex = 1;
|
||||
[[NSImage imageNamed:@"common_TabDownUnSelectedToSelectedJunction.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
iP.y -= 1;
|
||||
}
|
||||
else if (itemState == NSBackgroundTab)
|
||||
{
|
||||
if (previousState == NSSelectedTab)
|
||||
{
|
||||
iP.y += 1;
|
||||
[[NSImage imageNamed:@"common_TabDownSelectedToUnSelectedJunction.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
iP.y -= 1;
|
||||
iFlex = -1;
|
||||
} else {
|
||||
// iP.y += 1;
|
||||
[[NSImage imageNamed:@"common_TabDownUnSelectedJunction.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
//iP.y -= 1;
|
||||
iFlex = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
NSLog(@"Not finished yet. Luff ya.\n");
|
||||
|
||||
r.origin.x = iP.x + 13;
|
||||
r.origin.y = rect.origin.y + 2;
|
||||
r.size.width = s.width;
|
||||
r.size.height = 15 + iFlex; // was 15
|
||||
|
||||
DPSsetlinewidth(ctxt,1);
|
||||
DPSsetgray(ctxt,1);
|
||||
DPSmoveto(ctxt, r.origin.x, r.origin.y - 1);
|
||||
DPSrlineto(ctxt, r.size.width, 0);
|
||||
DPSstroke(ctxt);
|
||||
iFlex = 0;
|
||||
|
||||
[anItem drawLabel:NO inRect:r];
|
||||
DPSsetlinewidth(ctxt,1);
|
||||
DPSsetgray(ctxt,1);
|
||||
DPSmoveto(ctxt, r.origin.x, r.origin.y - 1);
|
||||
DPSrlineto(ctxt, r.size.width, 0);
|
||||
DPSstroke(ctxt);
|
||||
|
||||
previousRect = r;
|
||||
previousState = itemState;
|
||||
}
|
||||
[anItem drawLabel:NO inRect:r];
|
||||
|
||||
previousRect = r;
|
||||
previousState = itemState;
|
||||
}
|
||||
|
||||
if (i == howMany-1) {
|
||||
iP.x += s.width + 13;
|
||||
if (i == howMany-1)
|
||||
{
|
||||
iP.x += s.width + 13;
|
||||
|
||||
if ([anItem tabState] == NSSelectedTab)
|
||||
[[NSImage imageNamed:@"common_TabDownSelectedRight.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
else if ([anItem tabState] == NSBackgroundTab)
|
||||
[[NSImage imageNamed:@"common_TabDownUnSelectedRight.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
else
|
||||
NSLog(@"Not finished yet. Luff ya.\n");
|
||||
}
|
||||
if ([anItem tabState] == NSSelectedTab)
|
||||
[[NSImage imageNamed:@"common_TabDownSelectedRight.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
else if ([anItem tabState] == NSBackgroundTab)
|
||||
{
|
||||
// iP.y += 1;
|
||||
[[NSImage imageNamed:@"common_TabDownUnSelectedRight.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
// iP.y -= 1;
|
||||
}
|
||||
else
|
||||
NSLog(@"Not finished yet. Luff ya.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (tab_type == NSTopTabsBezelBorder)
|
||||
{
|
||||
for (i=0;i<howMany;i++)
|
||||
{
|
||||
// where da tab be at?
|
||||
NSSize s;
|
||||
NSRect r;
|
||||
NSPoint iP;
|
||||
NSTabViewItem *anItem = [tab_items objectAtIndex:i];
|
||||
NSTabState itemState;
|
||||
|
||||
itemState = [anItem tabState];
|
||||
|
||||
s = [anItem sizeOfLabel:NO];
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
iP.x = rect.origin.x;
|
||||
iP.y = rect.size.height;
|
||||
|
||||
if (itemState == NSSelectedTab)
|
||||
{
|
||||
iP.y -= 1;
|
||||
[[NSImage imageNamed:@"common_TabSelectedLeft.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
}
|
||||
else if (itemState == NSBackgroundTab)
|
||||
[[NSImage imageNamed:@"common_TabUnSelectedLeft.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
else
|
||||
NSLog(@"Not finished yet. Luff ya.\n");
|
||||
|
||||
for (i=0;i<howMany;i++) {
|
||||
// where da tab be at?
|
||||
NSSize s;
|
||||
NSRect r;
|
||||
NSPoint iP;
|
||||
NSTabViewItem *anItem = [tab_items objectAtIndex:i];
|
||||
NSTabState itemState;
|
||||
r.origin.x = rect.origin.x + 13;
|
||||
r.origin.y = rect.size.height;
|
||||
r.size.width = s.width;
|
||||
r.size.height = 15;
|
||||
|
||||
DPSsetlinewidth(ctxt,1);
|
||||
DPSsetgray(ctxt,1);
|
||||
DPSmoveto(ctxt, r.origin.x, r.origin.y+16);
|
||||
DPSrlineto(ctxt, r.size.width, 0);
|
||||
DPSstroke(ctxt);
|
||||
|
||||
[anItem drawLabel:NO inRect:r];
|
||||
|
||||
previousRect = r;
|
||||
previousState = itemState;
|
||||
} else {
|
||||
iP.x = previousRect.origin.x + previousRect.size.width;
|
||||
iP.y = rect.size.height;
|
||||
|
||||
itemState = [anItem tabState];
|
||||
if (itemState == NSSelectedTab)
|
||||
{
|
||||
iP.y -= 1;
|
||||
[[NSImage imageNamed:@"common_TabUnSelectToSelectedJunction.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
}
|
||||
else if (itemState == NSBackgroundTab)
|
||||
{
|
||||
if (previousState == NSSelectedTab)
|
||||
{
|
||||
iP.y -= 1;
|
||||
[[NSImage imageNamed:@"common_TabSelectedToUnSelectedJunction.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
iP.y += 1;
|
||||
} else {
|
||||
[[NSImage imageNamed:@"common_TabUnSelectedJunction.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
}
|
||||
}
|
||||
else
|
||||
NSLog(@"Not finished yet. Luff ya.\n");
|
||||
|
||||
s = [anItem sizeOfLabel:NO];
|
||||
r.origin.x = iP.x + 13;
|
||||
r.origin.y = rect.size.height;
|
||||
r.size.width = s.width;
|
||||
r.size.height = 15;
|
||||
|
||||
if (i == 0) {
|
||||
DPSsetlinewidth(ctxt,1);
|
||||
DPSsetgray(ctxt,1);
|
||||
DPSmoveto(ctxt, r.origin.x, r.origin.y+16);
|
||||
DPSrlineto(ctxt, r.size.width, 0);
|
||||
DPSstroke(ctxt);
|
||||
|
||||
[anItem drawLabel:NO inRect:r];
|
||||
|
||||
previousRect = r;
|
||||
previousState = itemState;
|
||||
}
|
||||
|
||||
iP.x = rect.origin.x;
|
||||
iP.y = rect.size.height;
|
||||
|
||||
if (itemState == NSSelectedTab) {
|
||||
iP.y -= 1;
|
||||
[[NSImage imageNamed:@"common_TabSelectedLeft.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
}
|
||||
else if (itemState == NSBackgroundTab)
|
||||
[[NSImage imageNamed:@"common_TabUnSelectedLeft.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
else
|
||||
NSLog(@"Not finished yet. Luff ya.\n");
|
||||
|
||||
r.origin.x = rect.origin.x + 13;
|
||||
r.origin.y = rect.size.height;
|
||||
r.size.width = s.width;
|
||||
r.size.height = 15;
|
||||
|
||||
DPSsetlinewidth(ctxt,1);
|
||||
DPSsetgray(ctxt,1);
|
||||
DPSmoveto(ctxt, r.origin.x, r.origin.y+16);
|
||||
DPSrlineto(ctxt, r.size.width, 0);
|
||||
DPSstroke(ctxt);
|
||||
|
||||
[anItem drawLabel:NO inRect:r];
|
||||
|
||||
previousRect = r;
|
||||
previousState = itemState;
|
||||
} else {
|
||||
iP.x = previousRect.origin.x + previousRect.size.width;
|
||||
iP.y = rect.size.height;
|
||||
|
||||
if (itemState == NSSelectedTab) {
|
||||
iP.y -= 1;
|
||||
[[NSImage imageNamed:@"common_TabUnSelectToSelectedJunction.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
}
|
||||
else if (itemState == NSBackgroundTab) {
|
||||
if (previousState == NSSelectedTab) {
|
||||
iP.y -= 1;
|
||||
[[NSImage imageNamed:@"common_TabSelectedToUnSelectedJunction.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
iP.y += 1;
|
||||
} else {
|
||||
[[NSImage imageNamed:@"common_TabUnSelectedJunction.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
}
|
||||
}
|
||||
else
|
||||
NSLog(@"Not finished yet. Luff ya.\n");
|
||||
|
||||
r.origin.x = iP.x + 13;
|
||||
r.origin.y = rect.size.height;
|
||||
r.size.width = s.width;
|
||||
r.size.height = 15;
|
||||
|
||||
DPSsetlinewidth(ctxt,1);
|
||||
DPSsetgray(ctxt,1);
|
||||
DPSmoveto(ctxt, r.origin.x, r.origin.y+16);
|
||||
DPSrlineto(ctxt, r.size.width, 0);
|
||||
DPSstroke(ctxt);
|
||||
|
||||
[anItem drawLabel:NO inRect:r];
|
||||
|
||||
previousRect = r;
|
||||
previousState = itemState;
|
||||
}
|
||||
|
||||
if (i == howMany-1) {
|
||||
iP.x += s.width + 13;
|
||||
|
||||
if ([anItem tabState] == NSSelectedTab)
|
||||
[[NSImage imageNamed:@"common_TabSelectedRight.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
else if ([anItem tabState] == NSBackgroundTab)
|
||||
[[NSImage imageNamed:@"common_TabUnSelectedRight.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
else
|
||||
NSLog(@"Not finished yet. Luff ya.\n");
|
||||
if (i == howMany-1)
|
||||
{
|
||||
iP.x += s.width + 13;
|
||||
|
||||
if ([anItem tabState] == NSSelectedTab)
|
||||
[[NSImage imageNamed:@"common_TabSelectedRight.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
else if ([anItem tabState] == NSBackgroundTab)
|
||||
[[NSImage imageNamed:@"common_TabUnSelectedRight.tiff"]
|
||||
compositeToPoint:iP operation: NSCompositeSourceOver];
|
||||
else
|
||||
NSLog(@"Not finished yet. Luff ya.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DPSgrestore(ctxt);
|
||||
}
|
||||
|
@ -539,7 +569,9 @@ imageNamed:@"common_TabDownUnSelectedJunction.tiff"]
|
|||
[self selectTabViewItem:anItem];
|
||||
}
|
||||
|
||||
[self setNeedsDisplay:YES];
|
||||
// [self setNeedsDisplay:YES];
|
||||
|
||||
[window update];
|
||||
|
||||
return [super hitTest:aPoint];
|
||||
}
|
||||
|
|
|
@ -939,12 +939,23 @@ container, returning the modified location. */
|
|||
[textStorage replaceCharactersInRange:[self selectedRange]
|
||||
withAttributedString:(NSAttributedString *)aString];
|
||||
|
||||
[self sizeToFit]; // ScrollView interaction
|
||||
|
||||
[self setSelectedRange:NSMakeRange([self
|
||||
selectedRange].location+[aString length],0)];
|
||||
|
||||
[self display];
|
||||
[window update];
|
||||
[self textDidChange: nil]; // broadcast notification
|
||||
|
||||
NSLog(@"%@", [textStorage string]);
|
||||
}
|
||||
|
||||
- (void)sizeToFit
|
||||
{
|
||||
NSLog(@"sizeToFit called.\n");
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)aRect
|
||||
{
|
||||
if(tv_backGroundColor)
|
||||
|
|
Loading…
Reference in a new issue