Fundamental Redesign of the View and Controller
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
#import "MPSumFunction.h"
|
||||
|
||||
@interface MPExpressionView (MPCursor)
|
||||
@property (nonatomic, strong) NSTimer *cursorTimer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPExpressionView
|
||||
@@ -49,8 +49,9 @@
|
||||
|
||||
- (void)initializeObjects
|
||||
{
|
||||
MPExpressionStorage *expressionStorage = [[MPExpressionStorage alloc] initWithElements:@[@"12345", [[MPSumFunction alloc] init], [[MPSumFunction alloc] init]]];
|
||||
MPExpressionStorage *expressionStorage = [[MPExpressionStorage alloc] initWithExpressionView:self elements:@[@"12345", [[MPSumFunction alloc] init], [[MPSumFunction alloc] init]]];
|
||||
_expressionStorage = expressionStorage;
|
||||
_caretLocation = [[NSIndexPath alloc] initWithIndex:0];
|
||||
}
|
||||
|
||||
#pragma mark Properties
|
||||
@@ -60,9 +61,25 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)setExpressionStorage:(MPExpressionStorage *)expressionStorage
|
||||
- (BOOL)acceptsFirstResponder
|
||||
{
|
||||
_expressionStorage = expressionStorage;
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)canBecomeKeyView
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark Event Handling
|
||||
- (void)keyDown:(NSEvent *)theEvent
|
||||
{
|
||||
[self interpretKeyEvents:@[theEvent]];
|
||||
}
|
||||
|
||||
- (void)moveRight:(id)sender
|
||||
{
|
||||
[self.expressionStorage deleteElementsInRange:NSMakeRange(0, 1)];
|
||||
}
|
||||
|
||||
#pragma mark Drawing Methods
|
||||
|
||||
Reference in New Issue
Block a user