00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __TEXT_H
00019 #define __TEXT_H
00020
00021 #ifdef __cplusplus
00022 extern "C"
00023 {
00024 #include "common/ktypes.h"
00025 #include "common/stdlib.h"
00026 #include "gui/graphics.h"
00027 #include "common/string.h"
00028 #include "dev/keyboard/keyboard.h"
00029 }
00030 #else
00031 #include "common/ktypes.h"
00032 #include "common/stdlib.h"
00033 #include "gui/graphics.h"
00034 #include "common/string.h"
00035 #include "dev/keyboard/keyboard.h"
00036 #endif
00037
00038 #include "gui/components/component.h"
00039 #include "gui/components/window.h"
00040 #include "gui/components/frame.h"
00041 #include "gui/utility.h"
00042 #include "gui/components/cursor.h"
00043 #include "gui/components/clipboard.h"
00044
00045 #define MIN_TEXT_WIDTH 10
00046 #define MIN_TEXT_HEIGHT 12
00047 #define TEXT_COLOR 0xFFFF
00048
00049 #define CHAR_WIDTH 5
00050 #define CHAR_HEIGHT 7
00051
00052 #define Y_OFFSET 3
00053 #define X_OFFSET 2
00054
00055 #define TEXT_MAX 1024
00056
00057 class text:public component
00058 {
00059 public :
00060 char txt[TEXT_MAX];
00061 DW total_chars, allow_chars;
00062 DW start;
00063 DW curs;
00064 DW sel_st,sel_en;
00065 bool is_sel;
00066
00067 void text_init(DW _id,DW _parent_id,DW _cnt_type,void *_cnt_ptr,DW _alias_id,DW _x,DW _y,DW _width,DW _height,DD _style,char *_txt);
00068 void setText(char *text);
00069 void getText(char *text);
00070 void paint();
00071 void update_cursor(DW no);
00072 void react(DW _x,DW _y);
00073 void keyPress(DW state,DW ch);
00074 void copy();
00075 void cut();
00076 void paste();
00077 };
00078
00079
00080 #endif