A Gtk_Sheet is a table like the one you can find in most spreadsheets. Each cell can contain some text or any kind of widgets.
Widget Hierarchy |
---|
GObject (see section Package Glib.Object) Gtk_Object (see section Package Gtk.Object) \___ Gtk_Widget (see section Package Gtk.Widget) \___ Gtk_Container (see section Package Gtk.Container) \___ Gtk_Sheet (see section Package Gtk.Extra.Sheet) |
Signals |
---|
Types |
---|
type Gtk_Sheet_Border is new Integer; | |
Mask that indicates which borders should be visible in a cell.
| |
type Gtk_Sheet_Child is new Gdk.C_Proxy; | |
A widget insert in the sheet.
This structure includes both a widget pointer and the position in the
table in which it is put.
| |
type Sheet_State is (Sheet_Normal, Sheet_Row_Selected, Sheet_Column_Selected, Sheet_Range_Selected); | |
The state of the selection.
pragma Convention (C, Sheet_State);
|
Subprograms |
---|
Creation and modification | ||
procedure Gtk_New (Sheet : out Gtk_Sheet; Rows : in Guint; Columns : in Guint; Title : in UTF8_String := ""; Entry_Type : in Gtk_Type := GType_Invalid); | ||
Create a new sheet with a specific number of rows and columns. | ||
procedure Gtk_New_Browser (Sheet : out Gtk_Sheet; Rows : in Guint; Columns : in Guint; Title : in UTF8_String := ""); | ||
Create a new sheet browser with a specific number of rows and columns. | ||
procedure Initialize_Browser (Sheet : access Gtk_Sheet_Record'Class; Rows : in Guint; Columns : in Guint; Title : in UTF8_String := ""); | ||
Internal initialization function. | ||
function Get_Type return Gtk.Gtk_Type; | ||
Return the internal value associated with a Gtk_Sheet.
| ||
procedure Set_Hadjustment (Sheet : access Gtk_Sheet_Record; Adjustment : access Gtk_Adjustment_Record'Class); | ||
Change the horizontal adjustment. | ||
procedure Set_Vadjustment (Sheet : access Gtk_Sheet_Record; Adjustment : access Gtk_Adjustment_Record'Class); | ||
Change the vertical adjustment. | ||
function Get_Vadjustment (Sheet : access Gtk_Sheet_Record) return Gtk.Adjustment.Gtk_Adjustment; | ||
Return the adjustment used to indicate the range of visible rows.
| ||
function Get_Hadjustment (Sheet : access Gtk_Sheet_Record) return Gtk.Adjustment.Gtk_Adjustment; | ||
Return the adjustment used to indicate the range of visible columns.
| ||
procedure Change_Entry (Sheet : access Gtk_Sheet_Record; Entry_Type : in Gtk_Type); | ||
Change the type of widget used to interactively modify the value of | ||
function Get_Entry (Sheet : access Gtk_Sheet_Record) return Gtk.Widget.Gtk_Widget; | ||
Return the entry used to modify the content of the cells.
| ||
procedure Set_Title (Sheet : access Gtk_Sheet_Record; Title : in UTF8_String); | ||
Change the title of the sheet.
| ||
procedure Freeze (Sheet : access Gtk_Sheet_Record); | ||
Freeze all visual updates of the sheet, until you thaw it. | ||
procedure Thaw (Sheet : access Gtk_Sheet_Record); | ||
Thaw the sheet, so that visual updates occur again. | ||
procedure Moveto (Sheet : access Gtk_Sheet_Record; Row : in Gint; Column : in Gint; Row_Align : in Gfloat; Col_Align : in Gfloat); | ||
Scroll the viewing area to (Row, Column). | ||
procedure Set_Background (Sheet : access Gtk_Sheet_Record; Color : Gdk.Color.Gdk_Color); | ||
Change the background color of the cells.
| ||
procedure Set_Grid (Sheet : access Gtk_Sheet_Record; Color : Gdk.Color.Gdk_Color); | ||
Set the color to use for the grid.
| ||
procedure Show_Grid (Sheet : access Gtk_Sheet_Record; Show : Boolean); | ||
Whether the grid should be made visible
| ||
function Grid_Visible (Sheet : access Gtk_Sheet_Record) return Boolean; | ||
Whether the grid is currently visible
| ||
Selection and Clipping | ||
function Get_State (Sheet : access Gtk_Sheet_Record) return Sheet_State; | ||
Return the status of the selection in the sheet.
| ||
function Get_Range (Sheet : access Gtk_Sheet_Record) return Gtk_Sheet_Range; | ||
Return the selected range.
| ||
procedure Get_Visible_Range (Sheet : access Gtk_Sheet_Record; The_Range : out Gtk_Sheet_Range); | ||
Return the range visible on the screen.
| ||
procedure Set_Selection_Mode (Sheet : access Gtk_Sheet_Record; Mode : in Gtk.Enums.Gtk_Selection_Mode); | ||
Change the selection mode.
| ||
procedure Select_Column (Sheet : access Gtk_Sheet_Record; Column : in Gint); | ||
Replace the current selection with a specific column. | ||
procedure Select_Row (Sheet : access Gtk_Sheet_Record; Row : in Gint); | ||
Replace the current selection with a specific row. | ||
procedure Set_Autoresize (Sheet : access Gtk_Sheet_Record; Autoresize : Boolean); | ||
Whether cells should automatically resize to fit their contents
| ||
function Autoresize (Sheet : access Gtk_Sheet_Record) return Boolean; | ||
Whether cells automatically resize to fit their contents
| ||
procedure Set_Autoscroll (Sheet : access Gtk_Sheet_Record; Autoscroll : Boolean); | ||
Whether the sheet should automatically scroll to show the active cell at | ||
function Autoscroll (Sheet : access Gtk_Sheet_Record) return Boolean; | ||
Whether the sheet automatically scrolls to show the active cell at all | ||
procedure Set_Clip_Text (Sheet : access Gtk_Sheet_Record; Clip : Boolean); | ||
Set when the text contained in the cells is automatically clipped to | ||
function Clip_Text (Sheet : access Gtk_Sheet_Record) return Boolean; | ||
Whether the text contained in the cells is automatically clipped to | ||
procedure Set_Justify_Entry (Sheet : access Gtk_Sheet_Record; Justify_Entry : Boolean); | ||
Set when the justification attribute for entries should be taken into | ||
function Justify_Entry (Sheet : access Gtk_Sheet_Record) return Boolean; | ||
Whether the justification attribute is used for entries
| ||
procedure Set_Locked (Sheet : access Gtk_Sheet_Record; Locked : Boolean); | ||
If Locked is true, the cells are no longer editable
| ||
function Locked (Sheet : access Gtk_Sheet_Record) return Boolean; | ||
Whether cells are currently read-only
| ||
procedure Select_Range (Sheet : access Gtk_Sheet_Record; The_Range : in Gtk_Sheet_Range); | ||
Select a new range of cells.
| ||
procedure Unselect_Range (Sheet : access Gtk_Sheet_Record); | ||
Unselect a specific range of cells. | ||
procedure Clip_Range (Sheet : access Gtk_Sheet_Record; The_Range : in Gtk_Sheet_Range); | ||
Create a new clip range, which is copied to the clipboard | ||
procedure Unclip_Range (Sheet : access Gtk_Sheet_Record); | ||
Destroy the clip area.
| ||
function In_Clip (Sheet : access Gtk_Sheet_Record) return Boolean; | ||
Whether a range was copied to the clipboard
| ||
function Set_Active_Cell (Sheet : access Gtk_Sheet_Record; Row : in Gint; Column : in Gint) return Boolean; | ||
Set active cell where the entry will be displayed. | ||
procedure Get_Active_Cell (Sheet : access Gtk_Sheet_Record; Row : out Gint; Column : out Gint); | ||
Return the coordinates of the active cell. | ||
Columns | ||
procedure Set_Column_Title (Sheet : access Gtk_Sheet_Record; Column : in Gint; Title : in UTF8_String); | ||
Modify the title of a column. | ||
function Get_Column_Title (Sheet : access Gtk_Sheet_Record; Column : Gint) return UTF8_String; | ||
Return the title of a specific column.
| ||
procedure Set_Column_Titles_Height (Sheet : access Gtk_Sheet_Record; Height : Guint); | ||
Modify the height of the row in which the column titles appear.
| ||
procedure Column_Button_Add_Label (Sheet : access Gtk_Sheet_Record; Column : in Gint; Label : in UTF8_String); | ||
Modify the label of the button that appears at the top of each column.
| ||
function Column_Button_Get_Label (Sheet : access Gtk_Sheet_Record; Column : Gint) return UTF8_String; | ||
Return the label for the button that appears at the top of each column
| ||
procedure Column_Button_Justify (Sheet : access Gtk_Sheet_Record; Column : in Gint; Justification : in Gtk.Enums.Gtk_Justification); | ||
Modify the justification for the label in the column button.
| ||
procedure Show_Column_Titles (Sheet : access Gtk_Sheet_Record); | ||
Show the row in which the column titles appear.
| ||
procedure Hide_Column_Titles (Sheet : access Gtk_Sheet_Record); | ||
Hide the row in which the column titles appear.
| ||
function Column_Titles_Visible (Sheet : access Gtk_Sheet_Record) return Boolean; | ||
Whether a special row is added at the top to show the title of the | ||
procedure Columns_Set_Sensitivity (Sheet : access Gtk_Sheet_Record; Sensitive : in Boolean); | ||
Modify the sensitivity of all the columns. | ||
procedure Column_Set_Sensitivity (Sheet : access Gtk_Sheet_Record; Column : in Gint; Sensitive : in Boolean); | ||
Modify the sensitivity of a specific column and its title button. | ||
procedure Column_Set_Visibility (Sheet : access Gtk_Sheet_Record; Column : in Gint; Visible : in Boolean); | ||
Change the visibility of a column.
| ||
procedure Columns_Set_Resizable (Sheet : access Gtk_Sheet_Record; Resizable : Boolean); | ||
Whether columns are resizable
| ||
function Columns_Resizable (Sheet : access Gtk_Sheet_Record) return Boolean; | ||
Whether columns are resizable
| ||
procedure Column_Label_Set_Visibility (Sheet : access Gtk_Sheet_Record; Column : in Gint; Visible : in Boolean := True); | ||
Change the visibility of the label in a given column.
| ||
procedure Columns_Labels_Set_Visibility (Sheet : access Gtk_Sheet_Record; Visible : Boolean := True); | ||
Change the visibility for all the column labels.
| ||
procedure Set_Column_Width (Sheet : access Gtk_Sheet_Record; Column : in Gint; Width : in Guint); | ||
Modify the width in pixels of a specific column.
| ||
function Get_Column_Width (Sheet : access Gtk_Sheet_Record; Column : in Gint) return Gint; | ||
Return the width in pixels of the Column-nth in Sheet.
| ||
procedure Add_Column (Sheet : access Gtk_Sheet_Record; Ncols : in Guint); | ||
Add some empty columns at the end of the sheet.
| ||
procedure Insert_Columns (Sheet : access Gtk_Sheet_Record; Col : in Guint; Ncols : in Guint); | ||
Add Ncols empty columns just before the columns number Col.
| ||
procedure Delete_Columns (Sheet : access Gtk_Sheet_Record; Col : in Guint; Ncols : in Guint); | ||
Delete Ncols columns starting from Col.
| ||
procedure Column_Set_Justification (Sheet : access Gtk_Sheet_Record; Column : in Gint; Justification : in Gtk.Enums.Gtk_Justification); | ||
Set the default justification for the cells in the specific column.
| ||
function Get_Columns_Count (Sheet : access Gtk_Sheet_Record) return Guint; | ||
Return the maximum column number of the displayed cells.
| ||
Rows | ||
procedure Set_Row_Title (Sheet : access Gtk_Sheet_Record; Row : in Gint; Title : in UTF8_String); | ||
Modify the title of a row. | ||
function Get_Row_Title (Sheet : access Gtk_Sheet_Record; Row : Gint) return UTF8_String; | ||
Return the title of a specific row.
| ||
procedure Set_Row_Titles_Width (Sheet : access Gtk_Sheet_Record; Width : Guint); | ||
Modify the width of the column that has the row titles.
| ||
procedure Row_Button_Add_Label (Sheet : access Gtk_Sheet_Record; Row : in Gint; Label : in UTF8_String); | ||
Modify the label of the button that appears on the left of each row.
| ||
function Row_Button_Get_Label (Sheet : access Gtk_Sheet_Record; Row : Gint) return UTF8_String; | ||
Return the label for the button that appears on the left of each row.
| ||
procedure Row_Button_Justify (Sheet : access Gtk_Sheet_Record; Row : in Gint; Justification : in Gtk.Enums.Gtk_Justification); | ||
Modify the justification for the label of the row button.
| ||
procedure Show_Row_Titles (Sheet : access Gtk_Sheet_Record); | ||
Show the column in which the row titles appear.
| ||
procedure Hide_Row_Titles (Sheet : access Gtk_Sheet_Record); | ||
Hide the column in which the row titles appear.
| ||
function Row_Titles_Visible (Sheet : access Gtk_Sheet_Record) return Boolean; | ||
Whether a special column is added to the left to show the title of the | ||
procedure Rows_Set_Sensitivity (Sheet : access Gtk_Sheet_Record; Sensitive : in Boolean); | ||
Modify the sensitivity of all the rows. | ||
procedure Row_Set_Sensitivity (Sheet : access Gtk_Sheet_Record; Row : in Gint; Sensitive : in Boolean); | ||
Modify the sensitivity of a specific row and its title button. | ||
procedure Row_Set_Visibility (Sheet : access Gtk_Sheet_Record; Row : in Gint; Visible : in Boolean); | ||
Modify the visibility of a specific row
| ||
procedure Row_Label_Set_Visibility (Sheet : access Gtk_Sheet_Record; Row : in Gint; Visible : in Boolean := True); | ||
Change the visibility of the label in a given Row.
| ||
procedure Rows_Labels_Set_Visibility (Sheet : access Gtk_Sheet_Record; Visible : Boolean := True); | ||
Change the visibility for all the row labels.
| ||
procedure Rows_Set_Resizable (Sheet : access Gtk_Sheet_Record; Resizable : Boolean); | ||
Whether rows are resizable
| ||
function Rows_Resizable (Sheet : access Gtk_Sheet_Record) return Boolean; | ||
Whether rows are resizable
| ||
procedure Set_Row_Height (Sheet : access Gtk_Sheet_Record; Row : in Gint; Height : in Guint); | ||
Set the height in pixels of a specific row.
| ||
function Get_Row_Height (Sheet : access Gtk_Sheet_Record; Row : in Gint) return Gint; | ||
Return the height in pixels of the Row-th row in Sheet.
| ||
procedure Add_Row (Sheet : access Gtk_Sheet_Record; Nrows : in Guint); | ||
Append Nrows row at the end of the sheet.
| ||
procedure Insert_Rows (Sheet : access Gtk_Sheet_Record; Row : in Guint; Nrows : in Guint); | ||
Add Nrows empty rows just before the row number Row.
| ||
procedure Delete_Rows (Sheet : access Gtk_Sheet_Record; Row : in Guint; Nrows : in Guint); | ||
Delete Nrows rows starting from Row.
| ||
function Get_Rows_Count (Sheet : access Gtk_Sheet_Record) return Guint; | ||
Return the maximum row number of displayed cells.
| ||
Range | ||
function Range_Get_Type return Gtk.Gtk_Type; | ||
Return the internal value associate with a Gtk_Sheet_Range
| ||
procedure Range_Clear (Sheet : access Gtk_Sheet_Record; The_Range : in Gtk_Sheet_Range); | ||
Clear the content of the range.
| ||
procedure Range_Delete (Sheet : access Gtk_Sheet_Record; The_Range : in Gtk_Sheet_Range); | ||
Clear the content of the range and delete all the links (user_data)
| ||
procedure Range_Set_Background (Sheet : access Gtk_Sheet_Record; The_Range : in Gtk_Sheet_Range; Color : in Gdk.Color.Gdk_Color); | ||
Set the background color for the cells in a specific range.
| ||
procedure Range_Set_Foreground (Sheet : access Gtk_Sheet_Record; The_Range : in Gtk_Sheet_Range; Color : in Gdk.Color.Gdk_Color); | ||
Set the foreground color for the cells in a specific range.
| ||
procedure Range_Set_Justification (Sheet : access Gtk_Sheet_Record; The_Range : in Gtk_Sheet_Range; Justification : in Gtk.Enums.Gtk_Justification); | ||
Set the text justification for the cells in the range.
| ||
procedure Range_Set_Editable (Sheet : access Gtk_Sheet_Record; The_Range : in Gtk_Sheet_Range; Editable : in Boolean); | ||
Set whether the cells in the range are editable.
| ||
procedure Range_Set_Visible (Sheet : access Gtk_Sheet_Record; The_Range : in Gtk_Sheet_Range; Visible : in Boolean); | ||
Set whether the cells in the range are visible.
| ||
procedure Range_Set_Border (Sheet : access Gtk_Sheet_Record; The_Range : in Gtk_Sheet_Range; Mask : in Gtk_Sheet_Border; Width : in Guint; Line_Style : in Gdk.GC.Gdk_Line_Style); | ||
Set the style of the border for the cells in the range.
| ||
procedure Range_Set_Border_Color (Sheet : access Gtk_Sheet_Record; The_Range : in Gtk_Sheet_Range; Color : in Gdk.Color.Gdk_Color); | ||
Change the color for the borders of the cells in the range.
| ||
procedure Range_Set_Font (Sheet : access Gtk_Sheet_Record; The_Range : in Gtk_Sheet_Range; Font : Pango.Font.Pango_Font_Description); | ||
Change the font of the cells in the range.
| ||
Cells | ||
procedure Set_Cell (Sheet : access Gtk_Sheet_Record; Row : in Gint; Col : in Gint; Justification : in Gtk.Enums.Gtk_Justification; Text : in UTF8_String); | ||
Set the cell contents. | ||
procedure Set_Cell_Text (Sheet : access Gtk_Sheet_Record; Row : in Gint; Col : in Gint; Text : in UTF8_String); | ||
Set the cell contents. | ||
function Cell_Get_Text (Sheet : access Gtk_Sheet_Record; Row : in Gint; Col : in Gint) return UTF8_String; | ||
Return the text put in a specific cell. | ||
procedure Cell_Clear (Sheet : access Gtk_Sheet_Record; Row : in Gint; Col : in Gint); | ||
Clear the contents of the cell.
| ||
procedure Cell_Delete (Sheet : access Gtk_Sheet_Record; Row : in Gint; Col : in Gint); | ||
Clear the contents of the cell and remove the user data associated | ||
function Cell_Get_State (Sheet : access Gtk_Sheet_Record; Row : in Gint; Col : in Gint) return Gtk.Enums.Gtk_State_Type; | ||
Return the state of the cell (normal or selected).
| ||
procedure Get_Pixel_Info (Sheet : access Gtk_Sheet_Record; X : in Gint; Y : in Gint; Row : out Gint; Column : out Gint); | ||
Return the row and column matching a given pixel on the screen. | ||
procedure Get_Cell_Area (Sheet : access Gtk_Sheet_Record; Row : in Gint; Column : in Gint; Area : out Gdk.Rectangle.Gdk_Rectangle); | ||
Get the area of the screen that a cell is mapped to. | ||
Children | ||
A Gtk_Sheet can contain some children, attached to some specific | ||
procedure Put (Sheet : access Gtk_Sheet_Record; Widget : access Gtk.Widget.Gtk_Widget_Record'Class; X : in Gint; Y : in Gint); | ||
Put a new child at a specific location (in pixels) in the sheet.
| ||
procedure Attach (Sheet : access Gtk_Sheet_Record; Widget : access Gtk.Widget.Gtk_Widget_Record'Class; Row : Gint; Col : Gint; Xoptions : Gtk.Enums.Gtk_Attach_Options := Expand or Fill; Yoptions : Gtk.Enums.Gtk_Attach_Options := Expand or Fill; Xpadding : Gint := 0; Ypadding : Gint := 0); | ||
Attach a child to a specific Cell in the sheet. | ||
procedure Attach_Floating (Sheet : access Gtk_Sheet_Record; Widget : access Gtk.Widget.Gtk_Widget_Record'Class; Row : Gint; Col : Gint); | ||
Attach a child at the current location or (Row, Col). | ||
procedure Move_Child (Sheet : access Gtk_Sheet_Record; Widget : access Gtk.Widget.Gtk_Widget_Record'Class; X : in Gint; Y : in Gint); | ||
Move a child of the table to a specific location in pixels. | ||
function Get_Child_At (Sheet : access Gtk_Sheet_Record; Row : in Gint; Col : in Gint) return Gtk_Sheet_Child; | ||
Return the widget associated with the cell.
| ||
function Get_Widget (Child : Gtk_Sheet_Child) return Gtk.Widget.Gtk_Widget; | ||
Return the widget in the child.
| ||
procedure Button_Attach (Sheet : access Gtk_Sheet_Record; Widget : access Gtk.Widget.Gtk_Widget_Record'Class; Row : Gint; Col : Gint); | ||
Attach a new button in the row or column title. | ||
Links / User_Data | ||
You can associate any kind of data with a cell, just like you | ||
procedure Link_Cell (Sheet : access Gtk_Sheet_Record; Row : in Gint; Col : in Gint; Link : in Data_Type); | ||
Associate some user specific data with a given cell.
| ||
function Get_Link (Sheet : access Gtk_Sheet_Record; Row : in Gint; Col : in Gint) return Data_Type_Access; | ||
Return the user data associated with the cell. | ||
procedure Remove_Link (Sheet : access Gtk_Sheet_Record; Row : in Gint; Col : in Gint); | ||
Delete the user data associated with the cell.
|