zephyrchat-cvs Mailing List for zChat (Page 3)
Status: Alpha
Brought to you by:
akosut
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(26) |
Apr
(34) |
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: <ak...@us...> - 2003-03-31 15:18:58
|
Update of /cvsroot/zephyrchat/zchat/zChat/zChat.pbproj
In directory sc8-pr-cvs1:/tmp/cvs-serv9074/zChat/zChat.pbproj
Modified Files:
project.pbxproj
Log Message:
Switch to MIT-style license.
Index: project.pbxproj
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/zChat.pbproj/project.pbxproj,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- project.pbxproj 30 Mar 2003 18:08:42 -0000 1.22
+++ project.pbxproj 31 Mar 2003 15:07:51 -0000 1.23
@@ -892,34 +892,32 @@
settings = {
};
};
- 17B64DAF041BB89600A82A15 = {
- fileEncoding = 30;
+ 17B2379804388EE100A82A15 = {
+ fileEncoding = 4;
isa = PBXFileReference;
- path = CHStackView.m;
+ path = ZCFlippedView.h;
refType = 4;
};
- 17B64DB0041BB89600A82A15 = {
- fileRef = 17B64DAF041BB89600A82A15;
+ 17B2379904388EE100A82A15 = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = ZCFlippedView.m;
+ refType = 4;
+ };
+ 17B2379A04388EE100A82A15 = {
+ fileRef = 17B2379804388EE100A82A15;
isa = PBXBuildFile;
settings = {
};
};
- 17B64DB1041BB8B500A82A15 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = CHStackView.h;
- refType = 4;
- };
- 17B64DB2041BB8B500A82A15 = {
- fileRef = 17B64DB1041BB8B500A82A15;
+ 17B2379B04388EE100A82A15 = {
+ fileRef = 17B2379904388EE100A82A15;
isa = PBXBuildFile;
settings = {
};
};
17B64DB3041BB8CD00A82A15 = {
children = (
- 17B64DB1041BB8B500A82A15,
- 17B64DAF041BB89600A82A15,
1766C3390424ED1D00A82A15,
1766C33A0424ED1D00A82A15,
17EB06E60424FCC100A82A15,
@@ -932,6 +930,8 @@
170A59330436016B00A82A15,
170A59910437653500A82A15,
170A59920437653500A82A15,
+ 17B2379804388EE100A82A15,
+ 17B2379904388EE100A82A15,
);
isa = PBXGroup;
name = Widgets;
@@ -1343,7 +1343,6 @@
171B0C25040AB5C000A82A15,
1724F428040BC4BD00A82A15,
1783D6A2041905E300A82A15,
- 17B64DB2041BB8B500A82A15,
17B64DB9041BBE3F00A82A15,
1766C33B0424ED1D00A82A15,
17EB06E80424FCC100A82A15,
@@ -1354,6 +1353,7 @@
173A344C043389A300A82A15,
170A59340436016B00A82A15,
170A59930437653500A82A15,
+ 17B2379A04388EE100A82A15,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -1411,7 +1411,6 @@
171B0C26040AB5C000A82A15,
29B9732CFDCFA39411CA2CEA,
1783D6A3041905E300A82A15,
- 17B64DB0041BB89600A82A15,
17B64DBA041BBE3F00A82A15,
1766C33C0424ED1D00A82A15,
17EB06E90424FCC100A82A15,
@@ -1422,6 +1421,7 @@
173A344D043389A300A82A15,
170A59350436016B00A82A15,
170A59940437653500A82A15,
+ 17B2379B04388EE100A82A15,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
|
|
From: <ak...@us...> - 2003-03-30 18:40:03
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv14115
Modified Files:
ZCDraggableView.m
Log Message:
Only drag ZCDraggableView if the window affirms isMovableByWindowBackground. This should always be YES, but allow for the possibility of future OS versions changing this, or for someone editing our .nib if they don't like textured windows.
Index: ZCDraggableView.m
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZCDraggableView.m,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ZCDraggableView.m 30 Mar 2003 18:08:42 -0000 1.1
+++ ZCDraggableView.m 30 Mar 2003 18:33:09 -0000 1.2
@@ -3,15 +3,18 @@
@implementation ZCDraggableView
- (void)mouseDown:(NSEvent *)event {
- NSPoint location = [event locationInWindow];
+ if ([[self window] isMovableByWindowBackground]) {
+ NSPoint location = [event locationInWindow];
+
+ while ([event type] != NSLeftMouseUp) {
+ event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask];
+ NSPoint newLoc = [event locationInWindow];
- while ([event type] != NSLeftMouseUp) {
- event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask];
- NSPoint newLoc = [event locationInWindow];
-
- if ([event type] == NSLeftMouseDragged) {
- [[self window] setFrameOrigin:NSMakePoint([[self window] frame].origin.x + (newLoc.x - location.x),
- [[self window] frame].origin.y + (newLoc.y - location.y))];
+ if ([event type] == NSLeftMouseDragged) {
+ [[self window] setFrameOrigin:
+ NSMakePoint([[self window] frame].origin.x + (newLoc.x - location.x),
+ [[self window] frame].origin.y + (newLoc.y - location.y))];
+ }
}
}
}
|
|
From: <ak...@us...> - 2003-03-30 18:08:46
|
Update of /cvsroot/zephyrchat/zchat/zChat/zChat.pbproj
In directory sc8-pr-cvs1:/tmp/cvs-serv4246/zChat.pbproj
Modified Files:
project.pbxproj
Log Message:
Move window by dragging empty area near input field.
Index: project.pbxproj
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/zChat.pbproj/project.pbxproj,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- project.pbxproj 29 Mar 2003 16:37:34 -0000 1.21
+++ project.pbxproj 30 Mar 2003 18:08:42 -0000 1.22
@@ -155,6 +155,30 @@
settings = {
};
};
+ 170A59910437653500A82A15 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = ZCDraggableView.h;
+ refType = 4;
+ };
+ 170A59920437653500A82A15 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = ZCDraggableView.m;
+ refType = 4;
+ };
+ 170A59930437653500A82A15 = {
+ fileRef = 170A59910437653500A82A15;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 170A59940437653500A82A15 = {
+ fileRef = 170A59920437653500A82A15;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
171B0C21040A6DE600A82A15 = {
isa = PBXFrameworkReference;
name = AddressBook.framework;
@@ -906,6 +930,8 @@
173A344B043389A300A82A15,
170A59320436016B00A82A15,
170A59330436016B00A82A15,
+ 170A59910437653500A82A15,
+ 170A59920437653500A82A15,
);
isa = PBXGroup;
name = Widgets;
@@ -1327,6 +1353,7 @@
173A343D0432277E00A82A15,
173A344C043389A300A82A15,
170A59340436016B00A82A15,
+ 170A59930437653500A82A15,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -1394,6 +1421,7 @@
173A343E0432277E00A82A15,
173A344D043389A300A82A15,
170A59350436016B00A82A15,
+ 170A59940437653500A82A15,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
|
|
From: <ak...@us...> - 2003-03-30 18:08:45
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv4246
Added Files:
ZCDraggableView.h ZCDraggableView.m
Log Message:
Move window by dragging empty area near input field.
--- NEW FILE: ZCDraggableView.h ---
/* ZCDraggableView */
#import <Cocoa/Cocoa.h>
@interface ZCDraggableView : NSView
@end
--- NEW FILE: ZCDraggableView.m ---
#import "ZCDraggableView.h"
@implementation ZCDraggableView
- (void)mouseDown:(NSEvent *)event {
NSPoint location = [event locationInWindow];
while ([event type] != NSLeftMouseUp) {
event = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask];
NSPoint newLoc = [event locationInWindow];
if ([event type] == NSLeftMouseDragged) {
[[self window] setFrameOrigin:NSMakePoint([[self window] frame].origin.x + (newLoc.x - location.x),
[[self window] frame].origin.y + (newLoc.y - location.y))];
}
}
}
- (BOOL)mouseDownCanMoveWindow {
/* We do our own window-dragging -- don't let the system do it too! */
return NO;
}
@end
|
|
From: <ak...@us...> - 2003-03-30 18:08:45
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/ChatWindow.nib
In directory sc8-pr-cvs1:/tmp/cvs-serv4246/English.lproj/ChatWindow.nib
Modified Files:
classes.nib info.nib objects.nib
Log Message:
Move window by dragging empty area near input field.
Index: classes.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/ChatWindow.nib/classes.nib,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- classes.nib 27 Mar 2003 20:04:01 -0000 1.6
+++ classes.nib 30 Mar 2003 18:08:42 -0000 1.7
@@ -41,6 +41,7 @@
};
SUPERCLASS = NSWindowController;
},
+ {CLASS = ZCDraggableView; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = ZChatFieldEditor; LANGUAGE = ObjC; SUPERCLASS = NSTextView; }
);
IBVersion = 1;
Index: info.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/ChatWindow.nib/info.nib,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- info.nib 27 Mar 2003 20:04:01 -0000 1.7
+++ info.nib 30 Mar 2003 18:08:42 -0000 1.8
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
- <string>109 63 356 294 0 0 1024 746 </string>
+ <string>100 104 356 294 0 0 1024 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>185</key>
@@ -21,9 +21,9 @@
</array>
<key>IBOpenObjects</key>
<array>
+ <integer>5</integer>
<integer>213</integer>
<integer>228</integer>
- <integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>6I32</string>
Index: objects.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/ChatWindow.nib/objects.nib,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
Binary files /tmp/cvsLNvVXc and /tmp/cvsC1PQEf differ
|
|
From: <ak...@us...> - 2003-03-29 19:21:42
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/PrefsWindow.nib
In directory sc8-pr-cvs1:/tmp/cvs-serv11686/English.lproj/PrefsWindow.nib
Modified Files:
classes.nib info.nib objects.nib
Log Message:
Custom text color support.
Index: classes.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/PrefsWindow.nib/classes.nib,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- classes.nib 9 Mar 2003 02:42:38 -0000 1.3
+++ classes.nib 29 Mar 2003 19:21:39 -0000 1.4
@@ -5,7 +5,9 @@
ACTIONS = {
addServer = id;
changeMyColor = id;
+ changeMyTextColor = id;
changeSenderColor = id;
+ changeSenderTextColor = id;
chatTypeAction = id;
goMessages = id;
goSetup = id;
@@ -20,10 +22,12 @@
"_appearanceView" = NSView;
"_chatType" = NSMatrix;
"_myColor" = NSColorWell;
+ "_myTextColor" = NSColorWell;
"_natAddress" = NSTextField;
"_natInUse" = NSButton;
"_realm" = NSComboBox;
"_senderColor" = NSColorWell;
+ "_senderTextColor" = NSColorWell;
"_serverTable" = NSTableView;
"_setupView" = NSView;
};
Index: info.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/PrefsWindow.nib/info.nib,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- info.nib 25 Mar 2003 17:02:59 -0000 1.5
+++ info.nib 29 Mar 2003 19:21:39 -0000 1.6
@@ -7,9 +7,9 @@
<key>IBEditorPositions</key>
<dict>
<key>104</key>
- <string>261 438 502 155 0 0 1024 746 </string>
+ <string>22 439 502 155 0 0 1024 746 </string>
<key>65</key>
- <string>21 280 501 359 0 0 1024 746 </string>
+ <string>261 335 501 359 0 0 1024 746 </string>
</dict>
<key>IBFramework Version</key>
<string>291.0</string>
@@ -19,9 +19,9 @@
</array>
<key>IBOpenObjects</key>
<array>
- <integer>6</integer>
- <integer>65</integer>
<integer>104</integer>
+ <integer>65</integer>
+ <integer>6</integer>
</array>
<key>IBSystem Version</key>
<string>6I32</string>
Index: objects.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/PrefsWindow.nib/objects.nib,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
Binary files /tmp/cvs3j40Dy and /tmp/cvsinvTTW differ
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv11686
Modified Files:
AKStackedView.m NSAttributedStringAdditions.h
NSAttributedStringAdditions.m ZCChatWindowController.h
ZCChatWindowController.mm ZChatAppController.h
ZChatAppController.mm ZChatFriendInfoController.h
ZChatFriendInfoController.mm ZChatPrefsController.h
ZChatPrefsController.mm
Log Message:
Custom text color support.
Index: AKStackedView.m
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/AKStackedView.m,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- AKStackedView.m 29 Mar 2003 16:37:34 -0000 1.4
+++ AKStackedView.m 29 Mar 2003 19:21:37 -0000 1.5
@@ -70,7 +70,7 @@
- (void)mouseUp:(NSEvent *)event {
if ([event clickCount] == 2 && [_delegate respondsToSelector:@selector(selectViewAction:)]) {
- [self doubleAction:nil];
+ [_delegate selectViewAction:self];
}
}
Index: NSAttributedStringAdditions.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/NSAttributedStringAdditions.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- NSAttributedStringAdditions.h 27 Mar 2003 17:48:27 -0000 1.6
+++ NSAttributedStringAdditions.h 29 Mar 2003 19:21:37 -0000 1.7
@@ -13,8 +13,8 @@
@interface NSAttributedString (ZChatAttributedStringAdditions)
-+ (NSMutableAttributedString *)attributedStringWithZWGCString:(NSString *)zwgcString;
-+ (NSMutableAttributedString *)attributedStringWithZWGCString:(NSString *)zwgcString defaultFont:(NSFont *)defaultFont;
++ (NSMutableAttributedString *)attributedStringWithZWGCString:(NSString *)zwgcString
+ defaultAttributes:(NSDictionary *)defaultAttrs;
- (NSString *)zwgcString;
/*!
Index: NSAttributedStringAdditions.m
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/NSAttributedStringAdditions.m,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- NSAttributedStringAdditions.m 27 Mar 2003 17:48:29 -0000 1.14
+++ NSAttributedStringAdditions.m 29 Mar 2003 19:21:38 -0000 1.15
@@ -27,21 +27,23 @@
@implementation NSAttributedString (ZChatAttributedStringAdditions)
-+ (NSMutableAttributedString *)attributedStringWithZWGCString:(NSString *)zwgcString {
- return [self attributedStringWithZWGCString:zwgcString
- defaultFont:[NSFont systemFontOfSize:[NSFont systemFontSize]]];
-}
-
+ (NSMutableAttributedString *)attributedStringWithZWGCString:(NSString *)zwgcString
- defaultFont:(NSFont *)defaultFont {
+ defaultAttributes:(NSDictionary *)defaultAttrs {
NSMutableAttributedString *result = [[NSMutableAttributedString new] autorelease];
NSMutableArray *stack; /* Stack of NSMutableDictionary representing the current state */
NSScanner *scanner;
NSCharacterSet *stopSet, *cmdSet;
BOOL beeped = FALSE;
- /* Start with font set to default (otherwise bold/etc doesn't seem to work right), no other attributes */
- stack = [NSMutableArray arrayWithObject:[NSMutableDictionary dictionaryWithObject:defaultFont forKey:NSFontAttributeName]];
+ /* Useful values */
+ NSFontManager *fontManager = [NSFontManager sharedFontManager];
+ NSFont *defaultFont = [defaultAttrs objectForKey:NSFontAttributeName];
+
+ /* Must provide a default font */
+ NSParameterAssert(defaultFont != nil);
+
+ /* Start with default attributes */
+ stack = [NSMutableArray arrayWithObject:[defaultAttrs mutableCopy]];
scanner = [NSScanner scannerWithString:zwgcString];
[scanner setCharactersToBeSkipped:[NSCharacterSet characterSetWithRange:NSMakeRange(0, 0)]];
@@ -85,8 +87,7 @@
cmd = @"";
leftBracket = [[scanner string] characterAtIndex:[scanner scanLocation]];
- /* Many parameters deal with the current font and the font manager */
- NSFontManager *fontManager = [NSFontManager sharedFontManager];
+ /* Many parameters deal with the current font */
NSFont *currentFont = [attrs objectForKey:NSFontAttributeName];
if (currentFont == nil) currentFont = defaultFont;
Index: ZCChatWindowController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZCChatWindowController.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- ZCChatWindowController.h 27 Mar 2003 20:03:59 -0000 1.13
+++ ZCChatWindowController.h 29 Mar 2003 19:21:38 -0000 1.14
@@ -82,8 +82,8 @@
* timestamp).
*/
- (NSRange)appendMessage:(NSAttributedString *)message from:(NSString *)sender color:(NSColor *)bgColor
- alignment:(NSTextAlignment)alignment;
-- (NSAttributedString *)pingMessage;
+ textColor:(NSColor *)fgColor alignment:(NSTextAlignment)alignment;
+- (NSAttributedString *)pingMessageWithColor:(NSColor *)textColor;
- (IBAction)sendMessage:(id)sender;
- (void)sendSuccess;
Index: ZCChatWindowController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZCChatWindowController.mm,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- ZCChatWindowController.mm 27 Mar 2003 20:03:59 -0000 1.19
+++ ZCChatWindowController.mm 29 Mar 2003 19:21:38 -0000 1.20
@@ -335,9 +335,10 @@
if (_myDisplayedPing.length == 0
|| NSMaxRange(_myDisplayedPing) != [[_output textStorage] length]) {
[self removeMyPing];
- _myDisplayedPing = [self appendMessage:[self pingMessage]
+ _myDisplayedPing = [self appendMessage:[self pingMessageWithColor:[ZChatApp textColorForMe]]
from:[ZChatApp mySignature]
color:[ZChatApp colorForMe]
+ textColor:[ZChatApp textColorForMe]
alignment:NSNaturalTextAlignment];
}
} else {
@@ -356,9 +357,11 @@
}
}
-- (NSAttributedString *)pingMessage {
+- (NSAttributedString *)pingMessageWithColor:(NSColor *)textColor {
return [[[NSAttributedString alloc] initWithString:NSLocalizedString(@"PING_MESSAGE", nil)
- attributes:nil] autorelease];
+ attributes:
+ [NSDictionary dictionaryWithObject:textColor
+ forKey:NSForegroundColorAttributeName]] autorelease];
}
- (void)sendSuccess {
@@ -368,6 +371,7 @@
[self removeMyPing];
[self appendMessage:[_input attributedStringValue] from:[ZChatApp mySignature]
color:[ZChatApp colorForMe]
+ textColor:[ZChatApp textColorForMe]
alignment:NSNaturalTextAlignment];
[_input setStringValue:@""];
@@ -459,9 +463,10 @@
NSString *senderString = [NSString stringWithSTLString:sender];
[self removePingFrom:senderString];
- NSRange pingRange = [self appendMessage:[self pingMessage]
+ NSRange pingRange = [self appendMessage:[self pingMessageWithColor:[ZChatApp textColorFor:senderString]]
from:[self displayNameFor:senderString]
color:[ZChatApp colorFor:senderString]
+ textColor:[ZChatApp textColorFor:senderString]
alignment:NSNaturalTextAlignment];
[_displayedPings setObject:[NSValue valueWithRange:pingRange] forKey:senderString];
@@ -486,7 +491,10 @@
NSAttributedString *formattedMessage
= [[NSAttributedString attributedStringWithZWGCString:
[NSString stringWithSTLString:message.GetMessage()]
- defaultFont:[NSFont userFontOfSize:12.0]]
+ defaultAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
+ [NSFont userFontOfSize:12.0], NSFontAttributeName,
+ [ZChatApp textColorFor:sender], NSForegroundColorAttributeName,
+ nil]]
unflowWithDefaultFont:[NSFont userFontOfSize:12.0]
fixedFont:[NSFont userFixedPitchFontOfSize:10.0]];
@@ -508,6 +516,7 @@
[self appendMessage:formattedMessage
from:displayName
color:[ZChatApp colorFor:sender]
+ textColor:[ZChatApp textColorFor:sender]
alignment:NSNaturalTextAlignment];
}
}
@@ -538,7 +547,7 @@
}
- (NSRange)appendMessage:(NSAttributedString *)message from:(NSString *)sender color:(NSColor *)bgColor
- alignment:(NSTextAlignment)alignment {
+ textColor:(NSColor *)fgColor alignment:(NSTextAlignment)alignment {
NSTextStorage *text = [_output textStorage];
bool shouldScroll = [[[_output enclosingScrollView] verticalScroller] floatValue] == 1.0;
@@ -575,9 +584,9 @@
range.location = [text length];
/* Add the sender */
- [text appendString:sender attributes:
- [NSDictionary dictionaryWithObject:[NSFont boldSystemFontOfSize:[NSFont systemFontSize]]
- forKey:NSFontAttributeName]];
+ [text appendString:sender attributes:[NSDictionary dictionaryWithObjectsAndKeys:
+ [NSFont boldSystemFontOfSize:[NSFont systemFontSize]], NSFontAttributeName,
+ fgColor, NSForegroundColorAttributeName, nil]];
/* Add some space: If the message is multi-line, add a newline, otherwise just a space */
NSRange lineRange = [[message string] lineRangeForRange:NSMakeRange(0, 0)];
Index: ZChatAppController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatAppController.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- ZChatAppController.h 26 Mar 2003 17:45:03 -0000 1.13
+++ ZChatAppController.h 29 Mar 2003 19:21:38 -0000 1.14
@@ -4,6 +4,7 @@
extern NSString * const kZChatAddressBookProperty;
extern NSString * const kZChatAddressBookColorProperty;
+extern NSString * const kZChatAddressBookTextColorProperty;
extern NSString * const ZChatLoginNotification;
extern NSString * const ZChatLogoutNotification;
@@ -96,6 +97,9 @@
* Returns the background color for the current user.
*/
- (NSColor *)colorForMe;
+
+- (NSColor *)textColorFor:(NSString *)username;
+- (NSColor *)textColorForMe;
- (NSString *)localizedZephyrStatus:(zephyrlib::ZephyrStatus)status;
Index: ZChatAppController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatAppController.mm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- ZChatAppController.mm 26 Mar 2003 17:45:03 -0000 1.16
+++ ZChatAppController.mm 29 Mar 2003 19:21:38 -0000 1.17
@@ -14,6 +14,7 @@
NSString * const kZChatAddressBookProperty = @"edu.stanford.akosut.zchat.ZephyrInstant";
NSString * const kZChatAddressBookColorProperty = @"edu.stanford.akosut.zchat.ZephyrInstant.Color";
+NSString * const kZChatAddressBookTextColorProperty = @"edu.stanford.akosut.zchat.ZephyrInstant.TextColor";
NSString * const ZChatLoginNotification = @"ZChatLoginNotification";
NSString * const ZChatLogoutNotification = @"ZChatLogoutNotification";
@@ -55,6 +56,7 @@
[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:kABStringProperty], kZChatAddressBookProperty,
[NSNumber numberWithInt:kABDataProperty], kZChatAddressBookColorProperty,
+ [NSNumber numberWithInt:kABDataProperty], kZChatAddressBookTextColorProperty,
nil]];
}
@@ -490,6 +492,39 @@
// Use default color
return [NSColor colorWithCalibratedWhite:0.7 alpha:1.0];
+}
+
+- (NSColor *)textColorFor:(NSString *)username {
+ if (username != nil) {
+ ABPerson *person = [self personForUser:username];
+
+ if (person != nil) {
+ NSData *encoded = [person valueForProperty:kZChatAddressBookTextColorProperty];
+ if (encoded != nil && [encoded length] > 0) {
+ return [NSKeyedUnarchiver unarchiveObjectWithData:encoded];
+ }
+ }
+ }
+
+ // Use color stored in preferences
+ NSData *stored = [[NSUserDefaults standardUserDefaults] objectForKey:@"SenderTextColor"];
+ if (stored != nil) {
+ return [NSKeyedUnarchiver unarchiveObjectWithData:stored];
+ }
+
+ // Use default color
+ return [NSColor textColor];
+}
+
+- (NSColor *)textColorForMe {
+ // Use color stored in preferences
+ NSData *stored = [[NSUserDefaults standardUserDefaults] objectForKey:@"MyTextColor"];
+ if (stored != nil) {
+ return [NSKeyedUnarchiver unarchiveObjectWithData:stored];
+ }
+
+ // Use default color
+ return [NSColor textColor];
}
- (IBAction)showPrefsPanel:(id)sender {
Index: ZChatFriendInfoController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendInfoController.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ZChatFriendInfoController.h 26 Mar 2003 22:09:24 -0000 1.1
+++ ZChatFriendInfoController.h 29 Mar 2003 19:21:38 -0000 1.2
@@ -19,7 +19,9 @@
IBOutlet NSButton *_colorCheckbox;
IBOutlet NSTextField *_bgColorLabel;
- IBOutlet NSColorWell *_bgColorWell;
+ IBOutlet NSColorWell *_bgColorWell;
+ IBOutlet NSTextField *_fgColorLabel;
+ IBOutlet NSColorWell *_fgColorWell;
NSString *_user;
ABPerson *_person;
Index: ZChatFriendInfoController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendInfoController.mm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ZChatFriendInfoController.mm 27 Mar 2003 20:04:01 -0000 1.3
+++ ZChatFriendInfoController.mm 29 Mar 2003 19:21:38 -0000 1.4
@@ -37,6 +37,7 @@
- (void)windowDidLoad {
[_usernameField setStringValue:ZephyrUtils::RemoveRealm(_user)];
[_bgColorWell setColor:[ZChatApp colorFor:_user]];
+ [_fgColorWell setColor:[ZChatApp textColorFor:_user]];
if (_person != nil) {
[_detachButton setEnabled:YES];
@@ -47,14 +48,19 @@
if ([_person valueForProperty:kABLastNameProperty] != nil)
[_lastNameField setStringValue:[_person valueForProperty:kABLastNameProperty]];
- if ([_person valueForProperty:kZChatAddressBookColorProperty] != nil) {
+ if ([_person valueForProperty:kZChatAddressBookColorProperty] != nil
+ || [_person valueForProperty:kZChatAddressBookTextColorProperty] != nil) {
[_colorCheckbox setState:NSOnState];
[_bgColorLabel setTextColor:[NSColor textColor]];
[_bgColorWell setEnabled:YES];
+ [_fgColorLabel setTextColor:[NSColor textColor]];
+ [_fgColorWell setEnabled:YES];
} else {
[_colorCheckbox setState:NSOffState];
[_bgColorLabel setTextColor:[NSColor textBackgroundColor]];
[_bgColorWell setEnabled:NO];
+ [_fgColorLabel setTextColor:[NSColor textBackgroundColor]];
+ [_fgColorWell setEnabled:NO];
}
}
}
@@ -104,17 +110,22 @@
- (IBAction)updateColor:(id)sender {
BOOL custom = [_colorCheckbox state] == NSOnState;
[_bgColorLabel setTextColor:custom ? [NSColor textColor] : [NSColor textBackgroundColor]];
+ [_fgColorLabel setTextColor:custom ? [NSColor textColor] : [NSColor textBackgroundColor]];
[_bgColorWell setEnabled:custom];
+ [_fgColorWell setEnabled:custom];
if (custom) {
[self createPersonIfNecessary];
[_person setValue:[NSKeyedArchiver archivedDataWithRootObject:[_bgColorWell color]]
forProperty:kZChatAddressBookColorProperty];
+ [_person setValue:[NSKeyedArchiver archivedDataWithRootObject:[_fgColorWell color]]
+ forProperty:kZChatAddressBookTextColorProperty];
[[ABAddressBook sharedAddressBook] save];
} else {
[_person removeValueForProperty:kZChatAddressBookColorProperty];
+ [_person removeValueForProperty:kZChatAddressBookTextColorProperty];
}
}
@@ -144,7 +155,9 @@
[_colorCheckbox setState:NSOffState];
[_bgColorLabel setTextColor:[NSColor textBackgroundColor]];
+ [_fgColorLabel setTextColor:[NSColor textBackgroundColor]];
[_bgColorWell setEnabled:NO];
+ [_fgColorWell setEnabled:NO];
[_detachButton setEnabled:NO];
[_openABButton setEnabled:NO];
Index: ZChatPrefsController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatPrefsController.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ZChatPrefsController.h 9 Mar 2003 02:42:38 -0000 1.3
+++ ZChatPrefsController.h 29 Mar 2003 19:21:38 -0000 1.4
@@ -20,6 +20,8 @@
IBOutlet NSView *_appearanceView;
IBOutlet NSColorWell *_myColor;
IBOutlet NSColorWell *_senderColor;
+ IBOutlet NSColorWell *_myTextColor;
+ IBOutlet NSColorWell *_senderTextColor;
NSUserDefaults *_defs;
NSDictionary *_sites;
@@ -45,5 +47,7 @@
/* Color */
- (IBAction)changeMyColor:(id)sender;
- (IBAction)changeSenderColor:(id)sender;
+- (IBAction)changeMyTextColor:(id)sender;
+- (IBAction)changeSenderTextColor:(id)sender;
@end
Index: ZChatPrefsController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatPrefsController.mm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- ZChatPrefsController.mm 26 Mar 2003 16:52:09 -0000 1.7
+++ ZChatPrefsController.mm 29 Mar 2003 19:21:38 -0000 1.8
@@ -116,7 +116,9 @@
- (IBAction)goMessages:(id)sender {
/* Colors */
[_myColor setColor:[ZChatApp colorForMe]];
+ [_myTextColor setColor:[ZChatApp textColorForMe]];
[_senderColor setColor:[ZChatApp colorFor:nil]];
+ [_senderTextColor setColor:[ZChatApp textColorFor:nil]];
[self switchToView:_appearanceView title:NSLocalizedString(@"PREFS_MESSAGES", nil)];
}
@@ -223,6 +225,14 @@
- (IBAction)changeSenderColor:(id)sender {
[_defs setObject:[NSKeyedArchiver archivedDataWithRootObject:[sender color]] forKey:@"SenderColor"];
+}
+
+- (IBAction)changeMyTextColor:(id)sender {
+ [_defs setObject:[NSKeyedArchiver archivedDataWithRootObject:[sender color]] forKey:@"MyTextColor"];
+}
+
+- (IBAction)changeSenderTextColor:(id)sender {
+ [_defs setObject:[NSKeyedArchiver archivedDataWithRootObject:[sender color]] forKey:@"SenderTextColor"];
}
|
|
From: <ak...@us...> - 2003-03-29 19:21:41
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendInfo.nib
In directory sc8-pr-cvs1:/tmp/cvs-serv11686/English.lproj/FriendInfo.nib
Modified Files:
classes.nib objects.nib
Log Message:
Custom text color support.
Index: classes.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendInfo.nib/classes.nib,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- classes.nib 26 Mar 2003 22:09:27 -0000 1.1
+++ classes.nib 29 Mar 2003 19:21:38 -0000 1.2
@@ -10,6 +10,8 @@
"_bgColorWell" = NSColorWell;
"_colorCheckbox" = NSButton;
"_detachButton" = NSButton;
+ "_fgColorLabel" = NSTextField;
+ "_fgColorWell" = NSColorWell;
"_firstNameField" = NSTextField;
"_lastNameField" = NSTextField;
"_openABButton" = NSButton;
Index: objects.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendInfo.nib/objects.nib,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
Binary files /tmp/cvszwDWAf and /tmp/cvskSi6Wk differ
|
|
From: <ak...@us...> - 2003-03-29 16:37:37
|
Update of /cvsroot/zephyrchat/zchat/zChat/zChat.pbproj
In directory sc8-pr-cvs1:/tmp/cvs-serv30224/zChat.pbproj
Modified Files:
project.pbxproj
Log Message:
Correctly select friends list when showing locations, using NSMatrix subclass
that ignores all mouse clicks (passes them to the next responder).
Index: project.pbxproj
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/zChat.pbproj/project.pbxproj,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- project.pbxproj 27 Mar 2003 20:04:02 -0000 1.20
+++ project.pbxproj 29 Mar 2003 16:37:34 -0000 1.21
@@ -131,6 +131,30 @@
settings = {
};
};
+ 170A59320436016B00A82A15 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = ZChatLocationMatrix.h;
+ refType = 4;
+ };
+ 170A59330436016B00A82A15 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = ZChatLocationMatrix.m;
+ refType = 4;
+ };
+ 170A59340436016B00A82A15 = {
+ fileRef = 170A59320436016B00A82A15;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 170A59350436016B00A82A15 = {
+ fileRef = 170A59330436016B00A82A15;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
171B0C21040A6DE600A82A15 = {
isa = PBXFrameworkReference;
name = AddressBook.framework;
@@ -880,6 +904,8 @@
173A34380431082500A82A15,
173A344A043389A300A82A15,
173A344B043389A300A82A15,
+ 170A59320436016B00A82A15,
+ 170A59330436016B00A82A15,
);
isa = PBXGroup;
name = Widgets;
@@ -1300,6 +1326,7 @@
173A34390431082500A82A15,
173A343D0432277E00A82A15,
173A344C043389A300A82A15,
+ 170A59340436016B00A82A15,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -1366,6 +1393,7 @@
173A343A0431082500A82A15,
173A343E0432277E00A82A15,
173A344D043389A300A82A15,
+ 170A59350436016B00A82A15,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
|
|
From: <ak...@us...> - 2003-03-29 16:37:37
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib
In directory sc8-pr-cvs1:/tmp/cvs-serv30224/English.lproj/FriendView.nib
Modified Files:
classes.nib info.nib objects.nib
Log Message:
Correctly select friends list when showing locations, using NSMatrix subclass
that ignores all mouse clicks (passes them to the next responder).
Index: classes.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib/classes.nib,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- classes.nib 28 Mar 2003 22:18:33 -0000 1.8
+++ classes.nib 29 Mar 2003 16:37:34 -0000 1.9
@@ -1,7 +1,6 @@
{
IBClasses = (
{
- ACTIONS = {action = id; doubleAction = id; };
CLASS = AKStackedView;
LANGUAGE = ObjC;
OUTLETS = {"_delegate" = id; };
@@ -39,6 +38,7 @@
};
SUPERCLASS = NSWindowController;
},
+ {CLASS = ZChatLocationMatrix; LANGUAGE = ObjC; SUPERCLASS = NSMatrix; },
{CLASS = ZChatLocationTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }
);
IBVersion = 1;
Index: info.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib/info.nib,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- info.nib 28 Mar 2003 22:18:35 -0000 1.9
+++ info.nib 29 Mar 2003 16:37:34 -0000 1.10
@@ -7,9 +7,9 @@
<key>IBEditorPositions</key>
<dict>
<key>526</key>
- <string>349 478 326 75 0 0 1024 746 </string>
+ <string>294 443 326 75 0 0 1024 746 </string>
<key>527</key>
- <string>12 469 324 90 0 0 1024 746 </string>
+ <string>165 509 324 90 0 0 1024 746 </string>
<key>556</key>
<string>349 482 326 67 0 0 1024 746 </string>
</dict>
@@ -17,8 +17,8 @@
<string>291.0</string>
<key>IBOpenObjects</key>
<array>
- <integer>527</integer>
<integer>556</integer>
+ <integer>527</integer>
<integer>526</integer>
</array>
<key>IBSystem Version</key>
Index: objects.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib/objects.nib,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
Binary files /tmp/cvsDKIYlJ and /tmp/cvsQcZBQk differ
|
|
From: <ak...@us...> - 2003-03-29 16:37:37
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv30224
Modified Files:
AKStackedView.h AKStackedView.m
Added Files:
ZChatLocationMatrix.h ZChatLocationMatrix.m
Log Message:
Correctly select friends list when showing locations, using NSMatrix subclass
that ignores all mouse clicks (passes them to the next responder).
--- NEW FILE: ZChatLocationMatrix.h ---
/* ZChatLocationMatrix */
#import <Cocoa/Cocoa.h>
@interface ZChatLocationMatrix : NSMatrix
{
}
@end
--- NEW FILE: ZChatLocationMatrix.m ---
#import "ZChatLocationMatrix.h"
@implementation ZChatLocationMatrix
/* Pass mouse events directly to the next responder. Do not pass go, do not collect $200 */
- (void)mouseDown:(NSEvent *)event {
[[self nextResponder] mouseDown:event];
}
- (void)mouseUp:(NSEvent *)event {
[[self nextResponder] mouseUp:event];
}
@end
Index: AKStackedView.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/AKStackedView.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- AKStackedView.h 28 Mar 2003 22:18:31 -0000 1.2
+++ AKStackedView.h 29 Mar 2003 16:37:33 -0000 1.3
@@ -20,9 +20,6 @@
IBOutlet id <AKStackedViewDelegate> _delegate;
}
-- (IBAction)action:(id)sender;
-- (IBAction)doubleAction:(id)sender;
-
- (void)setDelegate:(id <AKStackedViewDelegate>)delegate;
- (id)delegate;
Index: AKStackedView.m
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/AKStackedView.m,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- AKStackedView.m 28 Mar 2003 22:18:31 -0000 1.3
+++ AKStackedView.m 29 Mar 2003 16:37:34 -0000 1.4
@@ -54,10 +54,6 @@
[[self superview] displayIfNeeded];
}
-- (IBAction)action:(id)sender {
- [self mouseDown:[[sender window] currentEvent]];
-}
-
- (void)mouseDown:(NSEvent *)event {
if (_delegate != nil) {
if ([_delegate selectViewIsSelected:self] && [event modifierFlags] & NSCommandKeyMask) {
@@ -76,10 +72,6 @@
if ([event clickCount] == 2 && [_delegate respondsToSelector:@selector(selectViewAction:)]) {
[self doubleAction:nil];
}
-}
-
-- (IBAction)doubleAction:(id)sender {
- [_delegate selectViewAction:self];
}
- (void)setDelegate:(id <AKStackedViewDelegate>)delegate {
|
|
From: <ak...@us...> - 2003-03-28 23:48:11
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv30689
Modified Files:
ZChatFieldEditor.m
Log Message:
Do nothing when links in the input field are clicked.
Index: ZChatFieldEditor.m
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFieldEditor.m,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ZChatFieldEditor.m 27 Mar 2003 20:04:00 -0000 1.1
+++ ZChatFieldEditor.m 28 Mar 2003 23:48:07 -0000 1.2
@@ -10,4 +10,8 @@
object:self];
}
+- (void)clickedOnLink:(id)link atIndex:(unsigned)charIndex {
+ // Do nothing when links are clicked.
+}
+
@end
|
|
From: <ak...@us...> - 2003-03-28 23:38:49
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib In directory sc8-pr-cvs1:/tmp/cvs-serv26862/English.lproj/FriendView.nib Modified Files: objects.nib Log Message: Prototype cell for location matrix should not be bold. Index: objects.nib =================================================================== RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib/objects.nib,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 Binary files /tmp/cvseeEWTg and /tmp/cvsCGdqun differ |
|
From: <ak...@us...> - 2003-03-28 22:50:00
|
Update of /cvsroot/zephyrchat/zchat/ZephyrLib
In directory sc8-pr-cvs1:/tmp/cvs-serv6508
Modified Files:
ZephyrMgr.cpp
Log Message:
Send acks to the correct server and port.
Index: ZephyrMgr.cpp
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/ZephyrLib/ZephyrMgr.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- ZephyrMgr.cpp 26 Mar 2003 17:58:55 -0000 1.34
+++ ZephyrMgr.cpp 28 Mar 2003 22:49:55 -0000 1.35
@@ -297,7 +297,7 @@
// if this is actually possible. I guess we'll just have to rely on the
// Kerberos-based checksums (which we don't check yet).
#if 0
- if (addr.fHost != GetRemoteAddr()) {
+ if (from->sin_addr.s_addr != GetRemoteAddr()) {
return;
}
#endif
@@ -308,7 +308,7 @@
case zpUNACKED:
case zpACKED:
/* client message */
- ReceiveMessage(packet, from->sin_port, from->sin_addr.s_addr);
+ ReceiveMessage(packet, from->sin_addr.s_addr, from->sin_port);
break;
case zpHMCTL:
@@ -368,7 +368,7 @@
/* We have received a packet. We should first ack it, then
* forward it to the appropriate location or queue.
*/
-
+
// Use the same headers as the original packet, but an empty body.
ZephyrPacket ack(inPacket.mHeaders, vector<string>());
// Switch the type to an ack.
|
|
From: <ak...@us...> - 2003-03-28 22:19:11
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv27034
Modified Files:
AKStackedView.h AKStackedView.m ZChatFriendViewController.h
ZChatFriendViewController.mm
Log Message:
Nearly-complete location list implementation using NSMatrix.
Index: AKStackedView.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/AKStackedView.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- AKStackedView.h 19 Mar 2003 02:46:10 -0000 1.1
+++ AKStackedView.h 28 Mar 2003 22:18:31 -0000 1.2
@@ -20,6 +20,9 @@
IBOutlet id <AKStackedViewDelegate> _delegate;
}
+- (IBAction)action:(id)sender;
+- (IBAction)doubleAction:(id)sender;
+
- (void)setDelegate:(id <AKStackedViewDelegate>)delegate;
- (id)delegate;
Index: AKStackedView.m
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/AKStackedView.m,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- AKStackedView.m 25 Mar 2003 14:53:03 -0000 1.2
+++ AKStackedView.m 28 Mar 2003 22:18:31 -0000 1.3
@@ -54,6 +54,10 @@
[[self superview] displayIfNeeded];
}
+- (IBAction)action:(id)sender {
+ [self mouseDown:[[sender window] currentEvent]];
+}
+
- (void)mouseDown:(NSEvent *)event {
if (_delegate != nil) {
if ([_delegate selectViewIsSelected:self] && [event modifierFlags] & NSCommandKeyMask) {
@@ -70,8 +74,12 @@
- (void)mouseUp:(NSEvent *)event {
if ([event clickCount] == 2 && [_delegate respondsToSelector:@selector(selectViewAction:)]) {
- [_delegate selectViewAction:self];
+ [self doubleAction:nil];
}
+}
+
+- (IBAction)doubleAction:(id)sender {
+ [_delegate selectViewAction:self];
}
- (void)setDelegate:(id <AKStackedViewDelegate>)delegate {
Index: ZChatFriendViewController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendViewController.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- ZChatFriendViewController.h 28 Mar 2003 18:59:54 -0000 1.10
+++ ZChatFriendViewController.h 28 Mar 2003 22:18:32 -0000 1.11
@@ -21,7 +21,7 @@
IBOutlet NSView *_expandedView;
IBOutlet NSTextField *_expandedTitle;
- IBOutlet NSTableView *_locationTable;
+ IBOutlet NSMatrix *_locationMatrix;
NSString *_user;
Index: ZChatFriendViewController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendViewController.mm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- ZChatFriendViewController.mm 28 Mar 2003 18:59:54 -0000 1.18
+++ ZChatFriendViewController.mm 28 Mar 2003 22:18:32 -0000 1.19
@@ -50,6 +50,7 @@
}
- (void)awakeFromNib {
+ [_locationMatrix setDoubleAction:@selector(doubleAction:)];
[self updateNames];
}
@@ -128,16 +129,29 @@
- (void)locateSuccess:(const vector<zephyrlib::ZephyrLocation> &)locations {
*_locations = locations;
+ if (!_locations->empty()) {
+ /* The first row in the matrix is the header */
+ [_locationMatrix renewRows:_locations->size() + 1 columns:3];
+ NSAssert([_locationMatrix numberOfRows] >= 2, @"Location matrix should always have at least two rows");
- [_locationTable reloadData];
- [_expandedView setFrameSize:NSMakeSize([_expandedView frame].size.width,
- [_expandedView frame].size.height - [_locationTable frame].size.height
- + ([_locationTable numberOfRows]
- * ([_locationTable rowHeight]
- + [_locationTable intercellSpacing].height))
- )];
- [_expandedView setNeedsDisplay:YES];
-
+ for (unsigned i = 0; i < _locations->size(); ++i) {
+ ZephyrLocation &location = (*_locations)[i];
+ [[_locationMatrix cellAtRow:i + 1 column:0] setObjectValue:
+ [NSString stringWithSTLString:location.machine_name]];
+ [[_locationMatrix cellAtRow:i + 1 column:1] setObjectValue:
+ [NSString stringWithSTLString:location.terminal]];
+ [[_locationMatrix cellAtRow:i + 1 column:2] setObjectValue:
+ [NSString stringWithSTLString:location.login_time]];
+ }
+
+ [_locationMatrix sizeToCells];
+
+ /* We shouldn't have to hard-code 20. But I'm having a tough time fixing this one */
+ [_expandedView setFrameSize:NSMakeSize(NSWidth([_expandedView frame]),
+ 20 + NSHeight([_locationMatrix frame]))];
+ [_expandedView setNeedsDisplay:YES];
+ }
+
// TODO
_busy = false;
@@ -238,35 +252,6 @@
}
return email;
-}
-
-- (int)numberOfRowsInTableView:(NSTableView *)tableView {
- return _locations->size();
-}
-
-- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row {
- if (tableView == _locationTable) {
- ZephyrLocation &location = (*_locations)[row];
- switch ([[tableView tableColumns] indexOfObject:tableColumn]) {
- case 0:
- return [NSString stringWithSTLString:location.machine_name];
- case 1:
- return [NSString stringWithSTLString:location.terminal];
- case 2:
- return [NSString stringWithSTLString:location.login_time];
- }
- }
-
- return nil;
-}
-
-- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(int)row {
- if (tableView == _locationTable) {
- /* Do not allow expanded view table to be selected */
- return NO;
- }
-
- return YES;
}
@end
|
|
From: <ak...@us...> - 2003-03-28 22:18:43
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib
In directory sc8-pr-cvs1:/tmp/cvs-serv27034/English.lproj/FriendView.nib
Modified Files:
classes.nib info.nib objects.nib
Log Message:
Nearly-complete location list implementation using NSMatrix.
Index: classes.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib/classes.nib,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- classes.nib 28 Mar 2003 18:59:55 -0000 1.7
+++ classes.nib 28 Mar 2003 22:18:33 -0000 1.8
@@ -1,6 +1,7 @@
{
IBClasses = (
{
+ ACTIONS = {action = id; doubleAction = id; };
CLASS = AKStackedView;
LANGUAGE = ObjC;
OUTLETS = {"_delegate" = id; };
@@ -22,7 +23,7 @@
"_collapsedView" = NSView;
"_expandedTitle" = NSTextField;
"_expandedView" = NSView;
- "_locationTable" = NSTableView;
+ "_locationMatrix" = NSMatrix;
"_offlineTitle" = NSTextField;
"_offlineView" = NSView;
};
@@ -37,7 +38,8 @@
"_statusMenu" = NSPopUpButton;
};
SUPERCLASS = NSWindowController;
- }
+ },
+ {CLASS = ZChatLocationTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }
);
IBVersion = 1;
}
Index: info.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib/info.nib,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- info.nib 28 Mar 2003 18:59:55 -0000 1.8
+++ info.nib 28 Mar 2003 22:18:35 -0000 1.9
@@ -3,13 +3,13 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
- <string>95 153 395 294 0 0 1024 746 </string>
+ <string>6 100 395 294 0 0 1024 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>526</key>
<string>349 478 326 75 0 0 1024 746 </string>
<key>527</key>
- <string>78 463 327 157 0 0 1024 746 </string>
+ <string>12 469 324 90 0 0 1024 746 </string>
<key>556</key>
<string>349 482 326 67 0 0 1024 746 </string>
</dict>
@@ -18,8 +18,8 @@
<key>IBOpenObjects</key>
<array>
<integer>527</integer>
- <integer>526</integer>
<integer>556</integer>
+ <integer>526</integer>
</array>
<key>IBSystem Version</key>
<string>6I32</string>
Index: objects.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib/objects.nib,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
Binary files /tmp/cvsHKtobB and /tmp/cvsku6CAa differ
|
|
From: <ak...@us...> - 2003-03-28 19:00:06
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib
In directory sc8-pr-cvs1:/tmp/cvs-serv13042/English.lproj/FriendView.nib
Modified Files:
classes.nib info.nib objects.nib
Log Message:
Initial (minimal) implementation of location display.
Index: classes.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib/classes.nib,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- classes.nib 19 Mar 2003 20:41:19 -0000 1.6
+++ classes.nib 28 Mar 2003 18:59:55 -0000 1.7
@@ -13,7 +13,7 @@
SUPERCLASS = NSObject;
},
{
- ACTIONS = {toggleCollapse = id; };
+ ACTIONS = {showInfo = id; toggleCollapse = id; };
CLASS = ZChatFriendViewController;
LANGUAGE = ObjC;
OUTLETS = {
@@ -22,6 +22,7 @@
"_collapsedView" = NSView;
"_expandedTitle" = NSTextField;
"_expandedView" = NSView;
+ "_locationTable" = NSTableView;
"_offlineTitle" = NSTextField;
"_offlineView" = NSView;
};
Index: info.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib/info.nib,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- info.nib 19 Mar 2003 20:41:19 -0000 1.7
+++ info.nib 28 Mar 2003 18:59:55 -0000 1.8
@@ -3,13 +3,13 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
- <string>83 142 395 294 0 0 1024 746 </string>
+ <string>95 153 395 294 0 0 1024 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>526</key>
<string>349 478 326 75 0 0 1024 746 </string>
<key>527</key>
- <string>39 458 327 157 0 0 1024 746 </string>
+ <string>78 463 327 157 0 0 1024 746 </string>
<key>556</key>
<string>349 482 326 67 0 0 1024 746 </string>
</dict>
@@ -18,8 +18,8 @@
<key>IBOpenObjects</key>
<array>
<integer>527</integer>
- <integer>556</integer>
<integer>526</integer>
+ <integer>556</integer>
</array>
<key>IBSystem Version</key>
<string>6I32</string>
Index: objects.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendView.nib/objects.nib,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
Binary files /tmp/cvsdkauYg and /tmp/cvsCZ4ten differ
|
|
From: <ak...@us...> - 2003-03-28 18:59:59
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv13042
Modified Files:
ZChatFriendViewController.h ZChatFriendViewController.mm
Log Message:
Initial (minimal) implementation of location display.
Index: ZChatFriendViewController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendViewController.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ZChatFriendViewController.h 26 Mar 2003 22:09:25 -0000 1.9
+++ ZChatFriendViewController.h 28 Mar 2003 18:59:54 -0000 1.10
@@ -21,7 +21,8 @@
IBOutlet NSView *_expandedView;
IBOutlet NSTextField *_expandedTitle;
-
+ IBOutlet NSTableView *_locationTable;
+
NSString *_user;
// The current locations -- empty if the person is offline (or unknown)
Index: ZChatFriendViewController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendViewController.mm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- ZChatFriendViewController.mm 26 Mar 2003 22:09:25 -0000 1.17
+++ ZChatFriendViewController.mm 28 Mar 2003 18:59:54 -0000 1.18
@@ -128,6 +128,16 @@
- (void)locateSuccess:(const vector<zephyrlib::ZephyrLocation> &)locations {
*_locations = locations;
+
+ [_locationTable reloadData];
+ [_expandedView setFrameSize:NSMakeSize([_expandedView frame].size.width,
+ [_expandedView frame].size.height - [_locationTable frame].size.height
+ + ([_locationTable numberOfRows]
+ * ([_locationTable rowHeight]
+ + [_locationTable intercellSpacing].height))
+ )];
+ [_expandedView setNeedsDisplay:YES];
+
// TODO
_busy = false;
@@ -228,6 +238,35 @@
}
return email;
+}
+
+- (int)numberOfRowsInTableView:(NSTableView *)tableView {
+ return _locations->size();
+}
+
+- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row {
+ if (tableView == _locationTable) {
+ ZephyrLocation &location = (*_locations)[row];
+ switch ([[tableView tableColumns] indexOfObject:tableColumn]) {
+ case 0:
+ return [NSString stringWithSTLString:location.machine_name];
+ case 1:
+ return [NSString stringWithSTLString:location.terminal];
+ case 2:
+ return [NSString stringWithSTLString:location.login_time];
+ }
+ }
+
+ return nil;
+}
+
+- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(int)row {
+ if (tableView == _locationTable) {
+ /* Do not allow expanded view table to be selected */
+ return NO;
+ }
+
+ return YES;
}
@end
|
|
From: <ak...@us...> - 2003-03-28 18:57:47
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv11819
Modified Files:
ZChatFriendsController.mm
Log Message:
Correctly leave chat button disabled when logged in with no selection.
Index: ZChatFriendsController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendsController.mm,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ZChatFriendsController.mm 26 Mar 2003 22:09:25 -0000 1.14
+++ ZChatFriendsController.mm 28 Mar 2003 18:57:42 -0000 1.15
@@ -113,7 +113,7 @@
- (void)_loginNotification:(NSNotification *)notification {
[_reloadButton setEnabled:YES];
- [_chatButton setEnabled:[self selectedFriends] > 0];
+ [_chatButton setEnabled:[[self selectedFriends] count] > 0];
[self reload:notification];
}
|