forked from erkyrath/Inform7-IDE-Mac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIFSectionalView.h
51 lines (40 loc) · 1.84 KB
/
IFSectionalView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// IFSectionalView.h
// Inform-xc2
//
// Created by Andrew Hunter on 28/08/2006.
// Copyright 2006 Andrew Hunter. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "IFSectionalSection.h"
///
/// Hierarchical view for showing things by section
///
@interface IFSectionalView : NSView {
// Details about the sections
BOOL calculateSizes; // If true, then we need to calculate the size of the sections in this view
BOOL compactStrings; // If true, then we need to compact the strings in this view so that they fit
NSMutableArray* contents; // An array of IFSectionalSections
// Calculated items
NSSize idealSize; // The ideal size for this control
NSMutableArray* tracking; // Array of tracking rectangle tags (NSNumbers)
IFSectionalSection* highlighted; // The section that is curren
// The actions
id target;
SEL selectedItem;
SEL gotoSubsection;
}
// Setting up the contents
- (void) clear; // Removes all of the objects
- (void) addHeading: (NSString*) heading // Adds a bold heading
tag: (id) tag;
- (void) addSection: (NSString*) section // Adds a new section (optionally displaying whether or not it has a subsection)
subSections: (BOOL) hasSubsections
tag: (id) tag;
- (id) highlightedTag; // The tag for the currently highlighted symbol
- (NSSize) idealSize; // The ideal size for this view: it can be resized to have a lower width, but the height must be the same or greater
// = The actions =
- (void) setTarget: (id) target; // Sets the target for messages from this control (this is not retained)
- (void) setSelectedItemAction: (SEL) action; // Sets the action sent when an item is selected
- (void) setGotoSubsectionAction: (SEL) action; // Sets the action sent when we are requested to go to a specific subsection
@end