Initial OGComboBox implementation.

Only support for text so far.
This commit is contained in:
Jonathan Schleifer 2011-12-28 20:23:01 +01:00
parent 73e7da5fb7
commit 45380da631
5 changed files with 148 additions and 1 deletions

View file

@ -2,7 +2,6 @@
@interface OGBox: OGWidget
+ box;
- (void)appendChild: (OGWidget*)child
expand: (BOOL)expand
fill: (BOOL)fill

27
headers/OGComboBox.h Normal file
View file

@ -0,0 +1,27 @@
#import "OGWidget.h"
#import "OGComboBoxItem.h"
@class OGComboBox;
@protocol OGComboBoxDelegate <OFObject>
@optional
- (void)comboBoxWasChanged: (OGComboBox*)comboBox;
@end
@protocol OGComboBoxDataSource <OFObject>
- (size_t)numberOfItemsInComboBox: (OGComboBox*)comboBox;
- (OGComboBoxItem*)comboBox: (OGComboBox*)comboBox
itemAtIndex: (size_t)index;
@end
@interface OGComboBox: OGWidget
{
id <OGComboBoxDelegate> delegate;
id <OGComboBoxDataSource> dataSource;
}
@property (assign) id <OGComboBoxDelegate> delegate;
@property (assign) id <OGComboBoxDataSource> dataSource;
+ comboBox;
@end

12
headers/OGComboBoxItem.h Normal file
View file

@ -0,0 +1,12 @@
#import <ObjFW/OFString.h>
@interface OGComboBoxItem: OFObject
{
OFString *label;
}
@property (copy) OFString *label;
+ comboBoxItemWithLabel: (OFString*)label;
- initWithLabel: (OFString*)label;
@end