gambas-source-code/gb.gtk/src/tablerender.h
Benoît Minisini 7dabc871a2 [CONFIGURATION]
* BUG: Do not abort installation if a component written in gambas cannot 
  be installed.
* BUG: Disable colorgcc, libtool does not support it.

[DEVELOPMENT ENVIRONMENT]
* BUG: Print the real size of directory contents when getting information 
  on a project directory.

[WIKI CGI SCRIPT]
* BUG: Some fixes in 'example' section and in view mode.

[INTERPRETER]
* BUG: Fix illegal memory access in locale-aware string comparison.
* BUG: Fix a possible crash in String.UCase() and String.LCase().

[GB.FORM]
* BUG: SidePanel arrow buttons are correctly drawn with gb.gtk now.

[GB.GTK]
* BUG: Fix the Image.MakeTransparent() method.
* BUG: Fix the arrangement of ScrollView container.
* BUG: Fix the memory leak in the Picture class.
* BUG: Remove the Window resize event compression.
* BUG: Gridview cells are correctly refreshed now when their Picture or 
  Font property change.

[GB.NET.CURL]
* BUG: The Status property is correctly set after an error now.

[GB.QT]
* BUG: Correctly clears the internal closed flag when opening a Window.
* BUG: WAIT does not take 100% CPU anymore.

[GB.QT.EXT]
* BUG: In Editor, the cursor could disappear when clicking. Fix that.

[GB.XML]
* BUG: The management of XML nodes was incorrect, and so was redesigned.


git-svn-id: svn://localhost/gambas/trunk@1646 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-10-21 09:28:34 +00:00

157 lines
4.5 KiB
C++

#ifndef __TABLERENDER_H
#define __TABLERENDER_H
#include "gpicture.h"
#include "gfont.h"
#include "gcolor.h"
class gGridView;
typedef struct {
int row;
int col;
} gTablePair;
class gTableData
{
public:
char *text;
char *richText;
char *markup;
gPicture *picture;
gFont *font;
short alignment;
short padding;
gColor bg;
gColor fg;
void setText(const char *vl);
void setRichText(const char *vl);
void setFont(gFont *f) { gFont::assign(&font, f); }
void setPicture(gPicture *p) { gPicture::assign(&picture, p); }
void clear();
gTableData();
~gTableData();
};
class gTable
{
int *colpos;
int *colsize;
int *rowpos;
int *rowsize;
int columns;
int rows;
protected:
GHashTable *data;
GHashTable *seldata;
public:
gTable();
~gTable();
bool doNotInvalidate;
int columnCount ();
int rowCount ();
void setRowCount (int number);
void setColumnCount (int number);
char* getFieldText (int col,int row);
void setFieldText (int col,int row, const char * value);
char* getFieldRichText (int col,int row);
void setFieldRichText (int col,int row, const char * value);
gTableData *getData(int row, int col, bool create = false);
int getColumnPos(int index);
int getRowPos(int index);
int getColumnSize (int position);
void setColumnSize (int position,int value);
int getRowSize (int position);
void setRowSize (int position,int value);
bool getRowSelected (int position);
void setRowSelected (int position,bool value);
void clearField (int col,int row);
gColor getFieldFg (int col,int row);
void setFieldFg (int col,int row,gColor value);
gColor getFieldBg (int col,int row);
void setFieldBg (int col,int row,gColor value);
int getFieldPadding (int col,int row);
void setFieldPadding (int col,int row,int value);
int getFieldAlignment (int col,int row);
void setFieldAlignment (int col,int row,int value);
gPicture *getFieldPicture(int col, int row);
void setFieldPicture(int col, int row, gPicture *value);
gFont *getFieldFont(int col, int row);
void setFieldFont(int col, int row, gFont *value);
bool getFieldSelected (int col,int row);
void setFieldSelected (int col,int row,bool value);
void moveCell(int srow, int scol, int drow, int dcol);
void (*voidCell) (gTableData *fill, int row, int col, void *user);
void *userData;
};
class gTableRender : public gTable
{
public:
gGridView *view;
GtkWidget *sf;
GtkCellRendererText *txt;
GtkCellRendererPixbuf *pix;
int offX;
int offY;
bool grid;
void renderCell(gTableData *data,GdkGC *gc,GdkRectangle *rect,bool sel);
int firstRow, offRow;
int firstCol, offCol;
gTableRender (gGridView *v);
~gTableRender ();
int visibleWidth ();
int visibleHeight ();
int width ();
int height ();
int getOffsetX ();
int getOffsetY ();
bool drawGrid ();
void setOffsetX (int vl);
void setOffsetY (int vl);
void render (GdkRectangle *ar=NULL);
int findVisibleRow(int y);
int findVisibleColumn(int x);
int findColumn(int pos);
int findRow(int pos);
void removeRows(int start, int length);
void insertRows(int start, int length);
void clearSelection ();
void selectRows(int start, int length, bool value);
void queryUpdate (int row,int col);
void setDrawGrid (bool vl);
void setRowSize (int position,int value);
void setRowSelected (int position,bool value);
void setColumnSize (int position,int value);
void clearField (int col,int row);
void setFieldText (int col,int row, const char* value);
void setFieldRichText (int col,int row, const char* value);
void setFieldFg (int col,int row,gColor value);
void setFieldBg (int col,int row,gColor value);
void setFieldPadding (int col,int row,int value);
//void setFieldYPad (int col,int row,int value);
void setFieldSelected (int col,int row,bool value);
void setFieldPicture(int col, int row, gPicture *value);
void setFieldFont(int col, int row, gFont *value);
};
#endif