| 1 |
@interface CocoaTabFrame : NSTabView <NSTabViewDelegate> { |
| 2 |
@public |
| 3 |
phoenix::TabFrame* tabFrame; |
| 4 |
} |
| 5 |
-(id) initWith:(phoenix::TabFrame&)tabFrame; |
| 6 |
-(void) tabView:(NSTabView*)tabView didSelectTabViewItem:(NSTabViewItem*)tabViewItem; |
| 7 |
@end |
| 8 |
|
| 9 |
@interface CocoaTabFrameItem : NSTabViewItem { |
| 10 |
@public |
| 11 |
phoenix::TabFrame* tabFrame; |
| 12 |
CocoaTabFrame* cocoaTabFrame; |
| 13 |
} |
| 14 |
-(id) initWith:(phoenix::TabFrame&)tabFrame; |
| 15 |
-(NSSize) sizeOfLabel:(BOOL)shouldTruncateLabel; |
| 16 |
-(void) drawLabel:(BOOL)shouldTruncateLabel inRect:(NSRect)tabRect; |
| 17 |
@end |
| 18 |
|
| 19 |
namespace phoenix { |
| 20 |
|
| 21 |
struct pTabFrame : public pWidget { |
| 22 |
TabFrame& tabFrame; |
| 23 |
CocoaTabFrame* cocoaTabFrame = nullptr; |
| 24 |
vector<CocoaTabFrameItem*> tabs; |
| 25 |
|
| 26 |
void append(string text, const image& image); |
| 27 |
void remove(unsigned selection); |
| 28 |
void setEnabled(bool enabled); |
| 29 |
void setGeometry(Geometry geometry); |
| 30 |
void setImage(unsigned selection, const image& image); |
| 31 |
void setSelection(unsigned selection); |
| 32 |
void setText(unsigned selection, string text); |
| 33 |
void setVisible(bool visible); |
| 34 |
|
| 35 |
pTabFrame(TabFrame& tabFrame) : pWidget(tabFrame), tabFrame(tabFrame) {} |
| 36 |
void constructor(); |
| 37 |
void destructor(); |
| 38 |
void synchronizeLayout(); |
| 39 |
}; |
| 40 |
|
| 41 |
} |