Re: Is there a ready chart plotting view?
Re: Is there a ready chart plotting view?
- Subject: Re: Is there a ready chart plotting view?
- From: Oleg Svirgstin <email@hidden>
- Date: Mon, 31 Mar 2003 13:09:21 +0300
Hi all,
I don't think we need transliterations. We need to know these older
constructions to understand them. To get the ideas.
In some cases it is possible to reuse. With caution. Too many things have
changed.
I enjoyed reading about the NX-days. Thanks to everybody who shed the light
on some of their secrets.
///
And (since somebody mentioned this in the thread): I have bought the book by
Scott Anguish, Erik M. Buck and Donald A. Yacktman in November - and I think
I will soon have to buy a new copy since I use this book too often. I like
this book (I never thought I would tell that of a book written NOT by me...
:)
By the way, my cat loves it too: he likes to put his head on it when going
to sleep. Not a useful advice from him so far, though...
///
Regards
Oleg
Moscow, Russia
>
From: John Anderson <email@hidden>
>
Date: Mon, 31 Mar 2003 03:06:49 -0500
>
To: Cocoa-Dev <email@hidden>
>
Cc: Henry McGilton <email@hidden>, Scott Anguish
>
<email@hidden>, Dave Sopchak <email@hidden>, Oleg Svirgstin
>
<email@hidden>
>
Subject: Re: Is there a ready chart plotting view?
>
>
On Monday, Mar 31, 2003, at 01:44 America/Detroit, Henry McGilton wrote:
>
>
> On Sunday, March 30, 2003, at 09:11 PM, Scott Anguish wrote:
>
>
> And so on. There would be more to the equation than all that, but it
>
> would
>
> be achievable. The question is whether anybody actually needs to
>
> achieve it
>
> at all.
>
>
>
>> You may want to look at it more for inspiration design wise rather
>
>> than anything concrete code wise.
>
>
>
> That's the best bit of advice so far . . .
>
>
>
Henry, thank you for helping us understand a bit of NeXTStep. From
>
what I am looking at, the only real problems with the old code is
>
replacing:
>
>
(1) a few calls to NXStream with NSData.
>
>
(2) generally replacing the PS functions with NSBezierPath methods.
>
>
This means to me that for our purposes (which are almost exactly the
>
same as the author of XYPlotPalette), that the classes, methods,
>
functions, varibles and other parameters; indeed most of the some 50
>
pages of code are re-usable "as is.". And the rest, say less than a
>
third of the code requires, at worst, fairly minor modifications.
>
>
Now that we have our NeXT translation dictionary done (thanks to Scott
>
Anguish and Henry McGilton), the real issue is dealing with the ancient
>
.nib files. I must guess that there is no simple way to resurrect old
>
.nib files because they reference obsolete classes, types and such.
>
However, it does appears that the old versions of Interface builder
>
generated source code files ( *.h and *.m ) directly associated with
>
.nibs. So, I think we have all the information we need to pin done the
>
basic composition and function of the .nib files.
>
>
There are only two .nib files: XYPlotPlatte.nib and
>
XYPlotInspector.nib. XYPlotPlatte.h and XYPlotPlatte.m declare an
>
empty @interface and empty @implementation.
>
>
Here are the "as is" contents of XYPlotInspector.h and
>
XYPlotInspector.m.
>
>
/* Generated by Interface Builder */
>
>
#import <apps/InterfaceBuilder.h>
>
>
@interface XYPlotInspector:IBInspector
>
{
>
id gridSwitch;
>
id borderSwitch;
>
id colorSwitch;
>
id autoMaxMinSet;
>
id xminValue;
>
id xmaxValue;
>
id xincValue;
>
id yminValue;
>
id ymaxValue;
>
id yincValue;
>
id titleLabelForm;
>
id paperTypeSel;
>
id xTitleFontWell;
>
id yTitleFontWell;
>
id mainTitleFontWell;
>
}
>
>
- init;
>
- ok:sender;
>
- revert:sender;
>
>
@end
>
>
>
/* Generated by Interface Builder */
>
>
#import "XYPlotInspector.h"
>
#import "../XYPlotView.subproj/XYPlotView.h"
>
#import "DPFontPanel.h"
>
#import <appkit/appkit.h>
>
>
#import <apps/InterfaceBuilder.h>
>
>
>
@implementation XYPlotInspector
>
>
- init
>
{
>
char path [MAXPATHLEN + 1];
>
id bundle;
>
>
[super init];
>
>
bundle = [NXBundle bundleForClass: [self class]];
>
[bundle getPath: path forResource: "XYPlotInspector" ofType:
>
"nib"];
>
[NXApp loadNibFile: path owner: self withNames: NO
>
fromZone: [self zone]];
>
>
[DPFontPanel new];
>
>
return self;
>
}
>
>
- ok:sender
>
{
>
[object setGrid:[gridSwitch state]];
>
>
[object setBorder:[borderSwitch state]];
>
>
//[object setLogoFlag:[logoSwitch state]];
>
>
[object setColorState:[colorSwitch state]];
>
>
if([autoMaxMinSet state] == 0){
>
[object setXIncValue:[xincValue floatValue]];
>
[object setXMinValue:[xminValue floatValue]];
>
[object setXMaxValue:[xmaxValue floatValue]];
>
[object setYIncValue:[yincValue floatValue]];
>
[object setYMinValue:[yminValue floatValue]];
>
[object setYMaxValue:[ymaxValue floatValue]];
>
[object setAutoMaxMinState:NO];
>
}
>
else
>
[object setAutoMaxMinState:YES];
>
>
[object setXAxisTitle:[titleLabelForm stringValueAt:0]];
>
[object setYAxisTitle:[titleLabelForm stringValueAt:1]];
>
[object setMainTitle:[titleLabelForm stringValueAt:2]];
>
>
[object setXTitleFont:[xTitleFontWell font]];
>
[object setYTitleFont:[yTitleFontWell font]];
>
[object setMainTitleFont:[mainTitleFontWell font]];
>
>
switch([paperTypeSel selectedRow])
>
{
>
case 0:
>
[object setXLinLogState:NO];
>
[object setYLinLogState:NO];
>
[object setAutoPaperState:NO];
>
[object setPaperSwitchRow:0];
>
break;
>
case 1:
>
[object setXLinLogState:NO];
>
[object setYLinLogState:YES];
>
[object setAutoPaperState:NO];
>
[object setPaperSwitchRow:1];
>
break;
>
case 2:
>
[object setXLinLogState:YES];
>
[object setYLinLogState:NO];
>
[object setAutoPaperState:NO];
>
[object setPaperSwitchRow:2];
>
break;
>
case 3:
>
[object setXLinLogState:YES];
>
[object setYLinLogState:YES];
>
[object setAutoPaperState:NO];
>
[object setPaperSwitchRow:3];
>
break;
>
default:
>
[object setAutoPaperState:YES];
>
[object setPaperSwitchRow:4];
>
break;
>
}
>
>
return [super ok:sender]; // Somehow this forces a redraw of the
>
view
>
}
>
>
- revert:sender
>
{
>
// Give the nxyView a pointer to its inspector.
>
//[object setInspector:self];
>
>
[gridSwitch setState:[object gridState]];
>
[borderSwitch setState:[object borderState]];
>
//[logoSwitch setState:[object logoFlag]];
>
[colorSwitch setState:[object colorState]];
>
>
[paperTypeSel setState:1 at:[object paperSwitchRow] :0];
>
>
[autoMaxMinSet setState:[object autoMaxMinState]];
>
>
if([object autoMaxMinState] == 0){
>
[xincValue setFloatValue:[object xIncValue]];
>
[xminValue setFloatValue:[object xMinValue]];
>
[xmaxValue setFloatValue:[object xMaxValue]];
>
[yincValue setFloatValue:[object yIncValue]];
>
[yminValue setFloatValue:[object yMinValue]];
>
[ymaxValue setFloatValue:[object yMaxValue]];
>
}
>
>
[titleLabelForm setStringValue:[object xAxisTitle] at:0];
>
[titleLabelForm setStringValue:[object yAxisTitle] at:1];
>
[titleLabelForm setStringValue:[object mainTitle] at:2];
>
>
[mainTitleFontWell setFont:[object mainTitleFont]];
>
[xTitleFontWell setFont:[object xTitleFont]];
>
[yTitleFontWell setFont:[object yTitleFont]];
>
>
return [super revert:sender];
>
>
}
>
>
- (BOOL)wantsButtons
>
{
>
return NO;
>
}
>
>
>
@end
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.