textarea.h

00001                 /***************************************************************************
00002                           textarea.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  #ifndef __TEXTAREA_H
00018  #define __TEXTAREA_H
00019 
00020  #ifdef __cplusplus
00021    extern "C"
00022    {
00023      #include "common/ktypes.h"
00024      #include "common/stdlib.h"
00025      #include "gui/graphics.h"
00026      #include "common/string.h"
00027      #include "dev/keyboard/keyboard.h"
00028    }
00029  #else
00030       #include "common/ktypes.h"
00031       #include "common/stdlib.h"
00032       #include "gui/graphics.h"
00033       #include "common/string.h"
00034       #include "dev/keyboard/keyboard.h"
00035  #endif
00036 
00037  #include "gui/components/component.h"
00038  #include "gui/components/window.h"
00039  #include "gui/components/frame.h"
00040 
00041  #define MIN_TEXTAREA_WIDTH 20
00042  #define MIN_TEXTAREA_HEIGHT 60
00043  #define TEXTAREA_COLOR   0xFFFF
00044 
00045  #define TEXTAREA_ROWS  100
00046  #define TEXTAREA_COLS  400
00047 
00048  #define Y_OFFSET 3
00049  #define X_OFFSET 2
00050 
00051  class textarea:public component
00052  {
00053    public :
00054    char txt[TEXTAREA_ROWS][TEXTAREA_COLS+1];
00055    DW st_row;
00056    DW st_col;
00057    DW visi_rows;
00058    DW visi_cols;
00059    DW cur_x,cur_y;
00060    DW sel_stx,sel_sty,sel_enx,sel_eny;
00061    DW max_row;
00062    bool is_sel;
00063 
00064    void textarea_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);
00065    void setText(char *text);
00066    void getText(char *text);
00067    void paint();
00068    void react(DW _x,DW _y);
00069    SDW  ptcmp(DW x1,DW y1,DW x2,DW y2);
00070    void keyPress(DW state,DW ch);
00071    void updateCursor();
00072    void copy();
00073    void cut();
00074    void paste();
00075  };
00076 
00077 
00078  #endif

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