mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 10:20:58 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4866 72102866-910b-0410-8b05-ffd578937521
85 lines
1.7 KiB
Objective-C
85 lines
1.7 KiB
Objective-C
#import <AppKit/AppKit.h>
|
|
#import <AppKit/GSHelpManagerPanel.h>
|
|
|
|
@implementation GSHelpManagerPanel
|
|
{
|
|
id textView;
|
|
}
|
|
|
|
static GSHelpManagerPanel* _GSsharedGSHelpPanel;
|
|
|
|
+sharedHelpManagerPanel
|
|
{
|
|
if(!_GSsharedGSHelpPanel)
|
|
_GSsharedGSHelpPanel = [[GSHelpManagerPanel alloc] init];
|
|
return _GSsharedGSHelpPanel;
|
|
}
|
|
|
|
/* This window should not be destroyed... So we don't allow it to! */
|
|
-retain
|
|
{
|
|
return self;
|
|
}
|
|
|
|
-release
|
|
{
|
|
return self;
|
|
}
|
|
|
|
-autorelease
|
|
{
|
|
return self;
|
|
}
|
|
|
|
-init
|
|
{
|
|
NSScrollView* scrollView;
|
|
NSRect scrollViewRect = {{0, 0}, {470, 150}};
|
|
NSRect winRect = {{100, 100}, {470, 150}};
|
|
NSColor* backColor;
|
|
unsigned int style = NSTitledWindowMask | NSClosableWindowMask
|
|
| NSMiniaturizableWindowMask | NSResizableWindowMask;
|
|
|
|
[self initWithContentRect:winRect
|
|
styleMask:style
|
|
backing:NSBackingStoreRetained
|
|
defer:NO];
|
|
[self setRepresentedFilename: @"Help"];
|
|
[self setDocumentEdited: NO];
|
|
|
|
scrollView = [[NSScrollView alloc] initWithFrame:scrollViewRect];
|
|
[scrollView setHasHorizontalScroller:NO];
|
|
[scrollView setHasVerticalScroller:YES];
|
|
[scrollView setAutoresizingMask: NSViewHeightSizable];
|
|
|
|
textView = [NSText new];
|
|
[textView setEditable: NO];
|
|
[textView setRichText: YES];
|
|
[textView setSelectable: YES];
|
|
[textView setFrame:[[scrollView contentView] frame]];
|
|
backColor = [NSColor colorWithCalibratedWhite:0.85 alpha:1.0]; // off white
|
|
[textView setBackgroundColor:backColor];
|
|
[scrollView setDocumentView:textView];
|
|
[[self contentView] addSubview: scrollView];
|
|
|
|
[self setTitle:@"Help"];
|
|
|
|
return self;
|
|
}
|
|
|
|
-(void)setHelpText: (NSAttributedString*) helpText
|
|
{
|
|
[textView setText: [helpText string]];
|
|
}
|
|
|
|
-(BOOL) isFloatingPanel
|
|
{
|
|
return YES;
|
|
}
|
|
|
|
-(void) close
|
|
{
|
|
[NSApp stopModal];
|
|
[super close];
|
|
}
|
|
@end
|