Initial OGComboBox implementation.
Only support for text so far.
This commit is contained in:
parent
73e7da5fb7
commit
45380da631
5 changed files with 148 additions and 1 deletions
|
@ -2,7 +2,6 @@
|
|||
|
||||
@interface OGBox: OGWidget
|
||||
+ box;
|
||||
|
||||
- (void)appendChild: (OGWidget*)child
|
||||
expand: (BOOL)expand
|
||||
fill: (BOOL)fill
|
||||
|
|
27
headers/OGComboBox.h
Normal file
27
headers/OGComboBox.h
Normal 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
12
headers/OGComboBoxItem.h
Normal 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
|
Reference in a new issue