Interface

DBKit.SDK.Layout

DBKit.SDK.Layout


Description

The interface a layout offers to the controls on it. DBKit's own layouts implement it: Window and Container in desktop projects, Page, Container and Dialog in web projects.

A control reaches its layout through the Layout method of DBKit.SDK.RowBase, and through this interface it can work with the layout as a whole: get and set the current row, navigate between rows, start a new row, ask about the database schema, and send row events to the other controls. Most methods exist so that DBKit's own controls can do their work; a custom control typically needs only a few of them, such as CurrentRow, UpdateCurrentRow, IsValidColumnName and PrimaryKeyColumnNameForTable.

Methods

Name

Parameters

Returns

Close

ConfirmDeleteRow

deleteRelatedRows As Boolean = True

CurrentRow

DBKit.Row

CurrentRow

Assigns row As DBKit.Row

DBKitControls

DBKit.SDK.RowBase()

EditRow

ForeignKeyColumnName

primaryKeyTable As String

String

GetConfirmCancelButtonCaption

String

GetConfirmContinueButtonCaption

String

GetDatabase

Database

GetDatabaseDisconnectedMessage

String

GetDatabaseReconnectedMessage

String

GetDeleteConfirmExplanation

String

GetDeleteConfirmMessage

String

GetDeleteDialogTitle

String

GetNamesOfColumnsDisplayed

String

GetOrderBy

String

GetParentLayout

Variant

GetRowsListControl

DBKit.SDK.RowsListControl

GetSelectedRowPrimaryKeyValue

String

GetUnsavedChangesDialogExplanation

String

GetUnsavedChangesDialogMessage

String

GetUnsavedChangesDialogTitle

String

HasRowsListControl

Boolean

IsValidColumnName

columnName As String, tableName As String = ""

Boolean

LastRowIndex

Integer

LayoutControls

Iterable

LoadSelectedRow

rc As DBKit.SDK.Layout

LoadSelectedRow

primaryKeyValue As String

MoveFirst

MoveLast

MoveNext

MovePrevious

NewRow

NewRowInSeparateLayout

Boolean

PrimaryKeyColumnNameForTable

tableName As String

String

RaiseDatabaseConnectedEvent

RaiseDatabaseConnectionLostEvent

error As DatabaseException

Boolean

RaiseErrorEventWithException

error As RuntimeException

RefreshFromRow

row As DBKit.Row = Nil

RowsAvailable

RowSet

RowWithPrimaryKey

primaryKey As String, theTableName As String = ""

DBKit.Row

SelectedRowIndex

Integer

SelectedRowIndex

Assigns SRI As Integer

SendEventToSubscribers

theRowEvent As DBKit.SDK.RowEvent

SetFocusToFirstControl

SetTableName

theTableName As String

SQLiteColumnType

columnName As String, SQLiteColumnType As DBKit.SQLiteColumnTypes

SubscribeToAllRowEvents

subscriber As DBKit.SDK.RowBase

TableName

String

UndoRowChanges

UpdateCurrentRow

control As DBKit.SDK.RowDataControl

Method descriptions


DBKit.SDK.Layout.Close

Close()

Closes the layout.


DBKit.SDK.Layout.ConfirmDeleteRow

ConfirmDeleteRow(deleteRelatedRows As Boolean = True)

Asks the user to confirm deleting the current row, using the layout's delete confirmation dialog, and deletes the row if the user confirms. When deleteRelatedRows is True, rows in related tables are deleted as well.


DBKit.SDK.Layout.CurrentRow

CurrentRow() As DBKit.Row

CurrentRow(Assigns row As DBKit.Row)

Returns, or sets, the layout's current row. It is Nil when the layout has no current row. Setting it makes the given row the current row, and the layout's controls display its values.


DBKit.SDK.Layout.DBKitControls

DBKitControls() As DBKit.SDK.RowBase())

Returns the DBKit controls on the layout, each as its RowBase interface.


DBKit.SDK.Layout.EditRow

EditRow()

Puts the layout's current row into edit mode.


DBKit.SDK.Layout.ForeignKeyColumnName

ForeignKeyColumnName(primaryKeyTable As String) As String

Returns the name of the column in the layout's table that refers to the primary key of primaryKeyTable.


DBKit.SDK.Layout.GetConfirmCancelButtonCaption

GetConfirmCancelButtonCaption() As String

Returns the caption the layout's confirmation dialogs use for their Cancel button.


DBKit.SDK.Layout.GetConfirmContinueButtonCaption

GetConfirmContinueButtonCaption() As String

Returns the caption the layout's confirmation dialogs use for their Continue button.


DBKit.SDK.Layout.GetDatabase

GetDatabase() As Database

Returns the database the layout is connected to.


DBKit.SDK.Layout.GetDatabaseDisconnectedMessage

GetDatabaseDisconnectedMessage() As String

Returns the message the layout shows when its connection to the database is lost.


DBKit.SDK.Layout.GetDatabaseReconnectedMessage

GetDatabaseReconnectedMessage() As String

Returns the message the layout shows when its connection to the database has been reestablished.


DBKit.SDK.Layout.GetDeleteConfirmExplanation

GetDeleteConfirmExplanation() As String

Returns the explanation text of the layout's delete confirmation dialog.


DBKit.SDK.Layout.GetDeleteConfirmMessage

GetDeleteConfirmMessage() As String

Returns the message of the layout's delete confirmation dialog.


DBKit.SDK.Layout.GetDeleteDialogTitle

GetDeleteDialogTitle() As String

Returns the title of the layout's delete confirmation dialog.


DBKit.SDK.Layout.GetNamesOfColumnsDisplayed

GetNamesOfColumnsDisplayed() As String

Returns the names of the columns the layout's controls display, separated by commas.


DBKit.SDK.Layout.GetOrderBy

GetOrderBy() As String

Returns the ordering used by the layout's query, as an ORDER BY clause.


DBKit.SDK.Layout.GetParentLayout

GetParentLayout() As Variant

Returns the layout this layout was opened from, or Nil if it was not opened from another layout.


DBKit.SDK.Layout.GetRowsListControl

GetRowsListControl() As DBKit.SDK.RowsListControl

Returns the layout's rows list control, or Nil if the layout does not have one. See also HasRowsListControl.


DBKit.SDK.Layout.GetSelectedRowPrimaryKeyValue

GetSelectedRowPrimaryKeyValue() As String

Returns the primary key value of the row selected in the layout's rows list control.


DBKit.SDK.Layout.GetUnsavedChangesDialogExplanation

GetUnsavedChangesDialogExplanation() As String

Returns the explanation text of the dialog the layout shows when it is closed with unsaved changes.


DBKit.SDK.Layout.GetUnsavedChangesDialogMessage

GetUnsavedChangesDialogMessage() As String

Returns the message of the dialog the layout shows when it is closed with unsaved changes.


DBKit.SDK.Layout.GetUnsavedChangesDialogTitle

GetUnsavedChangesDialogTitle() As String

Returns the title of the dialog the layout shows when it is closed with unsaved changes.


DBKit.SDK.Layout.HasRowsListControl

HasRowsListControl() As Boolean

Returns True if the layout has a rows list control, such as a DBKit.Table.


DBKit.SDK.Layout.IsValidColumnName

IsValidColumnName(columnName As String, tableName As String = "") As Boolean

Returns True if columnName is a column of the given table. When tableName is empty, the layout's own table is meant. A control uses this to check a column name against the database schema without reaching into DBKit's internals.


DBKit.SDK.Layout.LastRowIndex

LastRowIndex() As Integer

Returns the index of the last of the rows available to the layout.


DBKit.SDK.Layout.LayoutControls

LayoutControls() As Iterable

Returns all of the controls on the layout, DBKit controls and ordinary controls alike.


DBKit.SDK.Layout.LoadSelectedRow

LoadSelectedRow(rc As DBKit.SDK.Layout)

LoadSelectedRow(primaryKeyValue As String)

Makes a row the layout's current row: either the row selected in another layout, or the row of the layout's table whose primary key is primaryKeyValue.


DBKit.SDK.Layout.MoveFirst

MoveFirst()

Makes the first of the layout's rows the current row.


DBKit.SDK.Layout.MoveLast

MoveLast()

Makes the last of the layout's rows the current row.


DBKit.SDK.Layout.MoveNext

MoveNext()

Makes the row after the current row the current row.


DBKit.SDK.Layout.MovePrevious

MovePrevious()

Makes the row before the current row the current row.


DBKit.SDK.Layout.NewRow

NewRow()

Creates a new row for the layout's table and makes it the current row, in edit mode.


DBKit.SDK.Layout.NewRowInSeparateLayout

NewRowInSeparateLayout() As Boolean

Returns True if the layout creates new rows in a separate layout rather than in place.


DBKit.SDK.Layout.PrimaryKeyColumnNameForTable

PrimaryKeyColumnNameForTable(tableName As String) As String

Returns the name of the primary key column of the given table. A control uses this to work with a table's primary key without reaching into DBKit's internals.


DBKit.SDK.Layout.RaiseDatabaseConnectedEvent

RaiseDatabaseConnectedEvent()

Raises the layout's DatabaseConnected event.


DBKit.SDK.Layout.RaiseDatabaseConnectionLostEvent

RaiseDatabaseConnectionLostEvent(error As DatabaseException) As Boolean

Raises the layout's DatabaseDisconnected event. Returns True if the event handler took over recovering from the lost connection itself; when it returns False, DBKit handles the recovery.


DBKit.SDK.Layout.RaiseErrorEventWithException

RaiseErrorEventWithException(error As RuntimeException)

Raises the layout's Error event, passing error to it.


DBKit.SDK.Layout.RefreshFromRow

RefreshFromRow(row As DBKit.Row = Nil)

Refreshes the layout's controls from row. When row is Nil, the layout's current row is used.


DBKit.SDK.Layout.RowsAvailable

RowsAvailable() As RowSet

Returns the rows produced by the layout's query.


DBKit.SDK.Layout.RowWithPrimaryKey

RowWithPrimaryKey(primaryKey As String, theTableName As String = "") As DBKit.Row

Returns the row whose primary key is primaryKey, loading it if necessary. When theTableName is empty, the layout's own table is meant.


DBKit.SDK.Layout.SelectedRowIndex

SelectedRowIndex() As Integer

SelectedRowIndex(Assigns SRI As Integer)

Returns, or sets, the index of the selected row in the layout's rows list control. It is -1 when no row is selected.


DBKit.SDK.Layout.SendEventToSubscribers

SendEventToSubscribers(theRowEvent As DBKit.SDK.RowEvent)

Sends theRowEvent to every control subscribed to the layout's row events. See SubscribeToAllRowEvents.


DBKit.SDK.Layout.SetFocusToFirstControl

SetFocusToFirstControl()

Moves the focus to the first control on the layout.


DBKit.SDK.Layout.SetTableName

SetTableName(theTableName As String)

Sets the name of the table the layout works with. DBKit uses this when it creates a layout for a table at runtime.


DBKit.SDK.Layout.SQLiteColumnType

SQLiteColumnType(columnName As String, SQLiteColumnType As DBKit.SQLiteColumnTypes)

Declares that a SQLite column is to be treated as a date or a datetime. SQLite does not distinguish the two in its schema, so DBKit cannot tell from the database alone which controls and editing a column needs.


DBKit.SDK.Layout.SubscribeToAllRowEvents

SubscribeToAllRowEvents(subscriber As DBKit.SDK.RowBase)

Subscribes a control to the layout's row events, so that its HandleRowEvent method is called for every row event the layout sends.


DBKit.SDK.Layout.TableName

TableName() As String

Returns the name of the table the layout works with.


DBKit.SDK.Layout.UndoRowChanges

UndoRowChanges()

Undoes the unsaved changes to the layout's current row, restoring the values it has in the database.


DBKit.SDK.Layout.UpdateCurrentRow

UpdateCurrentRow(control As DBKit.SDK.RowDataControl)

Reads the given control's value into the layout's current row. A control whose value the user can change calls this, passing itself, as soon as its value changes; see the Notes on the DBKit.SDK.RowDataControl page.

Compatibility

Project Types

Desktop, Web

Operating Systems

All