|
From: Geisschaes <gei...@us...> - 2005-06-12 16:19:25
|
Update of /cvsroot/macattrick/macattrick In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25634 Added Files: ValueToColorTransformer.h ValueToColorTransformer.m Log Message: playertable adjusted, no vertical scrollbar needed anymore --- NEW FILE: ValueToColorTransformer.m --- //---- license ---------------------------------------------------------------// // // // Macattrick: a Manager Assistant Tool for the online Game Hattrick.org // // Copyright (C) 2004 Roman Bertolami // // // // this file is part of Macattrick application // // http://sourceforge.net/macattrick // // // // Macattrick is free software; you can redistribute it and/or // // modify it under the terms of the GNU General Public License // // as published by the Free Software Foundation; either version 2 // // of the License, or (at your option) any later version. // // // // Macattrick is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place - Suite 330, // // Boston, MA 02111-1307, USA. // // // // Macattrick, Copyright (C) 2004 Roman Bertolami // // Macattrick comes with ABSOLUTELY NO WARRANTY! // // // //---- eo licence ------------------------------------------------------------// #import "ValueToColorTransformer.h" @implementation ValueToColorTransformer + (Class)transformedValueClass { return [NSColor class]; } + (BOOL)allowsReverseTransformation { return NO; } - (id)transformedValue:(id)value { if (value == nil) return [NSColor blackColor]; int val = [value intValue]; if(val > 0) return [NSColor greenColor]; if(val < 0) return [NSColor redColor]; return [NSColor blackColor]; } @end --- NEW FILE: ValueToColorTransformer.h --- //---- license ---------------------------------------------------------------// // // // Macattrick: a Manager Assistant Tool for the online Game Hattrick.org // // Copyright (C) 2004 Roman Bertolami // // // // this file is part of Macattrick application // // http://sourceforge.net/macattrick // // // // Macattrick is free software; you can redistribute it and/or // // modify it under the terms of the GNU General Public License // // as published by the Free Software Foundation; either version 2 // // of the License, or (at your option) any later version. // // // // Macattrick is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place - Suite 330, // // Boston, MA 02111-1307, USA. // // // // Macattrick, Copyright (C) 2004 Roman Bertolami // // Macattrick comes with ABSOLUTELY NO WARRANTY! // // // //---- eo licence ------------------------------------------------------------// #import <Cocoa/Cocoa.h> @interface ValueToColorTransformer : NSValueTransformer { } + (Class)transformedValueClass; + (BOOL)allowsReverseTransformation; - (id)transformedValue:(id)value; @end |