mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-23 06:20:47 +00:00
Add canvas view
This commit is contained in:
parent
6bbb1fb4db
commit
42102b9aee
3 changed files with 62 additions and 1 deletions
8
GormCore/GormCanvasView.h
Normal file
8
GormCore/GormCanvasView.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
/* All rights reserved */
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
@interface GormCanvasView : NSView
|
||||
{
|
||||
}
|
||||
@end
|
51
GormCore/GormCanvasView.m
Normal file
51
GormCore/GormCanvasView.m
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* All rights reserved */
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
#include "GormCanvasView.h"
|
||||
|
||||
@implementation GormCanvasView
|
||||
|
||||
- (void)drawRect:(NSRect)dirtyRect
|
||||
{
|
||||
NSRectFill(dirtyRect);
|
||||
|
||||
for (int i = 1; i < [self bounds].size.height / 10; i++)
|
||||
{
|
||||
if (i % 10 == 0)
|
||||
{
|
||||
[[NSColor colorWithSRGBRed:100/255.0 green:149/255.0 blue:237/255.0 alpha:0.3] set];
|
||||
}
|
||||
else if (i % 5 == 0)
|
||||
{
|
||||
[[NSColor colorWithSRGBRed:100/255.0 green:149/255.0 blue:237/255.0 alpha:0.2] set];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[NSColor colorWithSRGBRed:100/255.0 green:149/255.0 blue:237/255.0 alpha:0.1] set];
|
||||
}
|
||||
|
||||
[NSBezierPath strokeLineFromPoint: NSMakePoint(0, i * 10 - 0.5)
|
||||
toPoint: NSMakePoint([self bounds].size.width, i * 10 - 0.5)];
|
||||
}
|
||||
|
||||
for (int i = 1; i < [self bounds].size.width / 10; i++)
|
||||
{
|
||||
if (i % 10 == 0)
|
||||
{
|
||||
[[NSColor colorWithSRGBRed:100/255.0 green:149/255.0 blue:237/255.0 alpha:0.3] set];
|
||||
}
|
||||
else if (i % 5 == 0)
|
||||
{
|
||||
[[NSColor colorWithSRGBRed:100/255.0 green:149/255.0 blue:237/255.0 alpha:0.2] set];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[NSColor colorWithSRGBRed:100/255.0 green:149/255.0 blue:237/255.0 alpha:0.1] set];
|
||||
}
|
||||
|
||||
[NSBezierPath strokeLineFromPoint: NSMakePoint(i * 10 - 0.5, 0)
|
||||
toPoint: NSMakePoint(i * 10 - 0.5, [self bounds].size.height)];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
|
@ -34,7 +34,7 @@
|
|||
#include <GNUstepGUI/GSNibContainer.h>
|
||||
|
||||
@class GormClassManager, GormClassEditor, GormObjectProxy, GormFilesOwner,
|
||||
GormFilePrefsManager, GormDocumentWindow;
|
||||
GormFilePrefsManager, GormDocumentWindow, GormCanvasView;
|
||||
|
||||
/*
|
||||
* Trivial classes for connections from objects to their editors, and from
|
||||
|
@ -74,6 +74,8 @@
|
|||
id objectsView;
|
||||
id soundsView;
|
||||
id imagesView;
|
||||
id canvasWindow;
|
||||
GormCanvasView *canvasView;
|
||||
BOOL isActive;
|
||||
BOOL isDocumentOpen;
|
||||
NSMenu *savedMenu;
|
||||
|
|
Loading…
Reference in a new issue