From 152b981e2411516e98254b5399ff31ba9332eb1b Mon Sep 17 00:00:00 2001 From: Kim Wittenburg Date: Wed, 17 Dec 2014 22:06:16 +0100 Subject: [PATCH] Added MPExpressionView Delegate Prototype (not in use yet) --- MathKit/MPExpressionView.h | 41 +++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/MathKit/MPExpressionView.h b/MathKit/MPExpressionView.h index c7b7ab4..d978e60 100644 --- a/MathKit/MPExpressionView.h +++ b/MathKit/MPExpressionView.h @@ -10,10 +10,11 @@ -@class MPExpressionView, MPExpressionStorage, MPRangePath; +@class MPExpressionView, MPExpressionStorage, MPFunction, MPRangePath; +//@protocol MPExpressionViewDelegate; -@interface MPExpressionView : NSView +@interface MPExpressionView : NSView #pragma mark Creation Methods @@ -23,6 +24,8 @@ @property (readonly, nonatomic, strong) MPExpressionStorage *expressionStorage; +//@property (nonatomic, weak) id delegate; + @property (nonatomic, strong) MPRangePath *selection; @property (nonatomic, strong) NSError *mathError; @@ -31,8 +34,40 @@ @property (nonatomic, weak) id target; @property (nonatomic) SEL action; +//@property (nonatomic) BOOL editable; +//@property (nonatomic) BOOL selectable; + #pragma mark Actions +// Radians - Degrees +- (IBAction)switchToRadians:(id)sender; +- (IBAction)switchToDegrees:(id)sender; - (IBAction)switchRadiansDegrees:(id)sender; -- (IBAction)showFunctions:(id)sender; +// Functions +- (IBAction)toggleFunctionsPopover:(id)sender; @end + + +//@protocol MPExpressionViewDelegate +//@optional +// +//#pragma mark Editing +//- (MPRangePath *)expressionView:(MPExpressionView *)expressionView willChangeSelectionFromRangePath:(MPRangePath *)oldSelection toRangePath:(MPRangePath *)newSelection; +//- (void)expressionView:(MPExpressionView *)expressionView didChangeSelectionFromRangePath:(MPRangePath *)oldSelection toRangePath:(MPRangePath *)newSelection; +// +//- (BOOL)expressionView:(MPExpressionView *)expressionView shouldChangeSymbolsInRangePath:(MPRangePath *)rangePath replacementElements:(NSArray *)replacement; +//- (BOOL)expressionView:(MPExpressionView *)expressionView shouldInsertFunction:(MPFunction *)function replacingRangePath:(MPRangePath *)currentSelection; +//- (void)expressionViewDidChange:(MPExpressionView *)expressionView; +// +//- (BOOL)expressionViewShouldBeginEditing:(MPExpressionView *)expressionView; +//- (BOOL)expressionViewShouldEndEditing:(MPExpressionView *)expressionView; +//- (void)expressionViewDidBeginEditing:(MPExpressionView *)expressionView; +//- (void)expressionDidEndEditing:(MPExpressionView *)expressionView; +// +//// TODO: Errors... +//#pragma mark Evaluation +// +//- (BOOL)expressionViewShouldEvaluate:(MPExpressionView *)expressionView; +//- (void)expressionViewDidEvaluate:(MPExpressionView *)expressionView; +// +//@end \ No newline at end of file