text.h

00001 /***************************************************************************
00002                           text.h  -  description
00003                              -------------------
00004     begin                : Mon Mar 1 2004
00005     copyright            : (C) 2004 by Dynacube Team
00006     email                : 
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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

Generated on Thu Jul 27 23:52:27 2006 for Dynacube by  doxygen 1.4.7