mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 03:40:39 +00:00
Fixes galore.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4866 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
23782dbb01
commit
33dbd8054f
10 changed files with 423 additions and 8 deletions
85
Source/GSHelpManagerPanel.m
Normal file
85
Source/GSHelpManagerPanel.m
Normal file
|
@ -0,0 +1,85 @@
|
|||
#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
|
Loading…
Add table
Add a link
Reference in a new issue