2002-08-17 05:27:34 +00:00
|
|
|
#ifndef __ruamoko_InputLine_h
|
|
|
|
#define __ruamoko_InputLine_h
|
2002-08-15 21:00:51 +00:00
|
|
|
|
2002-08-20 21:19:53 +00:00
|
|
|
#include "Object.h"
|
2002-08-16 21:54:21 +00:00
|
|
|
|
2002-08-15 21:00:51 +00:00
|
|
|
struct _inputline_t = {}; // opaque type :)
|
|
|
|
typedef _inputline_t [] inputline_t;
|
|
|
|
|
|
|
|
@extern inputline_t (integer lines, integer size, integer prompt) InputLine_Create;
|
|
|
|
@extern void (inputline_t il, void [] data) InputLine_SetUserData;
|
|
|
|
@extern void (inputline_t il, integer width) InputLine_SetWidth;
|
|
|
|
@extern void (inputline_t il) InputLine_Destroy;
|
2002-08-28 16:02:43 +00:00
|
|
|
@extern void (inputline_t il, integer save) InputLine_Clear;
|
2002-08-15 21:00:51 +00:00
|
|
|
@extern void (inputline_t il, integer ch) InputLine_Process;
|
2002-08-20 21:19:53 +00:00
|
|
|
@extern void (inputline_t il) InputLine_Draw;
|
2002-08-15 21:00:51 +00:00
|
|
|
@extern void (inputline_t il, string str) InputLine_SetText;
|
|
|
|
@extern string (inputline_t il) InputLine_GetText;
|
|
|
|
|
2002-08-20 21:19:53 +00:00
|
|
|
struct il_data_t = {
|
|
|
|
integer x, y;
|
|
|
|
BOOL cursor;
|
|
|
|
};
|
|
|
|
|
|
|
|
@class Rect;
|
|
|
|
|
2002-08-17 05:27:34 +00:00
|
|
|
@interface InputLine: Object
|
2002-08-15 21:00:51 +00:00
|
|
|
{
|
2002-08-20 21:19:53 +00:00
|
|
|
il_data_t control;
|
2002-08-17 05:27:34 +00:00
|
|
|
inputline_t il;
|
2002-08-15 21:00:51 +00:00
|
|
|
}
|
2002-08-17 05:27:34 +00:00
|
|
|
|
|
|
|
- (id) initWithBounds: (Rect)aRect promptCharacter: (integer)char;
|
|
|
|
//-initAt:(Point)p HistoryLines:(integer)l LineSize:(integer)s PromptChar:(integer)prompt;
|
|
|
|
- (void) free;
|
|
|
|
|
|
|
|
- (void) setWidth: (integer)width;
|
|
|
|
- (void) draw: (BOOL)cursor;
|
|
|
|
|
|
|
|
- (void) processInput: (integer)key;
|
|
|
|
|
|
|
|
- (id) setText: (string)text;
|
|
|
|
- (string) text;
|
|
|
|
|
2002-08-15 21:00:51 +00:00
|
|
|
@end
|
|
|
|
|
2002-08-17 05:27:34 +00:00
|
|
|
#endif //__ruamoko_inputline_h
|