A widget for displaying and editing the contents of a table
|
bla
C# Example |
using System; using Gtk; using Womb; using Womb.Gtk; void DisplayEmployees (DB db) { Employee emp; Window win; AtomTab emp_tab; win = new Window (); emp = new Employee (db); emp_tab = new AtomTab (emp, true); win.Add (emp_tab); emp_tab.Refresh (); win.ShowAll (); } |
See Also: Inherited members from Gtk.TreeView.
AutoCommit
|
bool . Whether to automatically save changes to database |
Item [string] [read-only] | AtomTabColumn . Returns a column |
Item [Womb.Atom] [read-only] | ArrayList . Get a list of atoms matching an example |
Item [string, object] [read-only] | ArrayList . Get a list of atoms matching a single criteria |
Item [string, string, bool] [read-only] | ArrayList . Get a list of atoms with a tag matching a substring |
Item [Womb.Atom, bool, bool] [read-only] | ArrayList . Get a list of atoms matching an example |
NumColumns [read-only] | int . Number of columns |
NumRows [read-only] | int . Number of rows |
SelectedAtom [read-only] | Womb.Atom . Currently selected atom |
SelectedRow [read-only] | AtomTabRow . Currently selected row |
AppendAtom
(Womb.Atom) Appends an atom to the view and writes it to database immediately |
|
AppendAtom
(Womb.Atom, bool) Appends an atom to the view |
|
Clear
() Clear the view |
|
CreateFinder
() Create a table finder object |
|
GetEnumerator
() To be added. |
|
Refresh
() Refresh contents of table |
|
Refresh
(string) Refresh contents of table |
|
RemoveAtom
(Womb.Atom) Remove an atom from table |
|
SelectFirst
() Select first row in the table |
|
ToHtml
() Emit HTML for table contents |
|
WipeAtom
(Womb.Atom) Remove an atom from table and database |
AtomActivated
|
A row has been activated |
DataChanged
|
Data has changed in the table |
RefreshDone
|
Asynchronous refresh has finished. |
RefreshStart
|
Asynchronous refresh has started |
Creates a new tab
Asynchronous refresh has started
Asynchronous refresh has finished.
A row has been activated
Data has changed in the table
Refresh contents of table
Refresh contents of table
Appends an atom to the view and writes it to database immediately
Appends an atom to the view
Remove an atom from table
Remove an atom from table and database
Clear the view
Select first row in the table
Create a table finder object
To be added.
Emit HTML for table contents
Number of rows
Number of columns
Currently selected atom
Currently selected row
Because Womb.Gtk.AtomTabRow is a value type, getting this property when there are no selected rows will throw a Exception
You can prevent this by wrapping the call, in a try block, like:
C# Example |
AtomTabRow row; bool have_row = true; try { row = view.SelectedRow; } catch { have_row = false; } if (have_row) // do stuff here |
FIXME: make this method return AtomTabRow? instead and get rid of this workaround
Whether to automatically save changes to database
Returns a column
Use this indexer to set properties on columns directly
C# Example |
tab ["id"].Editable = false; tab ["salary"].BgColor = "yellow"; |
Get a list of atoms matching a single criteria
Get a list of atoms with a tag matching a substring
Get a list of atoms matching an example
This method does a Query-by-Example search on all atoms in the table. You provide an example atom with some fields set to the values you want to match, and this method will return a list of all atoms that match the values in those fields.
C# Example |
void DoSearch (AtomTab tab) { MyAtom example = new MyAtom (db); ArrayList result; example.id = 7; example.salary = 4; result = tab [example, false, false]; // now result contains references to all atoms whose id is 7 and salary is 4 } |
Get a list of atoms matching an example