forked from erkyrath/Inform7-IDE-Mac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIFPageBarCell.h
70 lines (51 loc) · 2.31 KB
/
IFPageBarCell.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
// IFPageBarCell.h
// Inform-xc2
//
// Created by Andrew Hunter on 06/04/2007.
// Copyright 2007 Andrew Hunter. All rights reserved.
//
#import <Cocoa/Cocoa.h>
//
// A cell that can be placed on the left or right of the IFPageBarView.
//
// These cells can contain an image or text. Additionally, they can contain a drop-down menu or a pop-up
// window. The assumption is that these will be rendered as part of the page bar view.
//
@interface IFPageBarCell : NSActionCell {
BOOL isRight; // True if this cell is to be drawn on the right-hand side
BOOL isHighlighted; // True if this cell is currently highlighted by a click
NSRect trackingFrame; // The frame of this cell reported when the last mouse tracking started
id identifier; // An identifier for this cell
// Pop-up
NSMenu* menu; // The menu for this cell
// Radio
int radioGroup; // The radio group identifier for this cell
// View
NSView* view; // The view for this cell
// Key equivalent
NSString* keyEquivalent; // The key equivalent string for this cell
}
// Initialisation
- (void) setIdentifier: (id) identifier; // Sets the identifier for this cell
- (id) identifier; // Gets the identifier for this cell
- (void) setKeyEquivalent: (NSString*) keyEquivalent; // Sets the key equivalent for this cell
// Drawing the cell
- (void) update; // Forces this cell to refresh
// Acting as a pop-up
- (BOOL) isPopup; // YES if this is a pop-up cell of some kind
- (void) showPopupAtPoint: (NSPoint) pointInWindow; // Request to run the pop-up
- (void) setMenu: (NSMenu*) menu; // The pop-up menu
// Acting as part of a radio group
- (void) setRadioGroup: (int) group; // Sets this cell up as an on/off cell as part of a radio group
- (int) radioGroup; // Retrieves the radio group for this cell
// Acting as a tab (you'll need to implement another control to make this work)
- (void) setView: (NSView*) view; // Set the view to display for this item
- (NSView*) view; // The view to display for this item
@end
//
// Optional methods that may be implemented by a cell in a page bar
//
@interface NSCell(IFPageBarCell)
- (void) setIsRight: (BOOL) isRight; // Whether or not this cell is to be drawn on the right-hand side of the bar
@end