Class
DBKit.ImageViewer
DBKit.ImageViewer
Description
Displays and edits the image stored in a column of the current row of the database table to which it has been assigned.
Only the members declared by DBKit.ImageViewer itself are described here; for the inherited members, see the parent classes.
Properties
Name |
Type |
Read-Only |
Shared |
|---|---|---|---|
Methods
Name |
Parameters |
Returns |
Shared |
|---|---|---|---|
✓ |
|||
✓ |
|||
Events
Name |
Parameters |
Returns |
|---|---|---|
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
Enumerations
DBKit.ImageViewer.ImageFormats
ImageFormats
Specifies the format used when saving the image.
Formats
BMP
GIF
JPEG
PNG
TIFF
DBKit.ImageViewer.ImageQualityLevels
ImageQualityLevels
Specifies the quality level used when saving the image.
Levels
Default
Maximum
High
Medium
Low
Minimum
Property descriptions
DBKit.ImageViewer.ColumnName
ColumnName As String
The name of the database column whose value this control displays and edits.
If blank, the control's name is used as the column name. The name may be qualified with a table name (for example "tablename.columnname") when the control shows a column from a related table.
Tip
Instead of setting this property, you can name the control the same as the database column. DBKit first looks at the ColumnName property; if it is blank, it then uses the name of the control itself.
DBKit.ImageViewer.CopyMenuItemCaption
CopyMenuItemCaption As String
The caption of the Copy item in the control's contextual menu.
The default is "Copy".
DBKit.ImageViewer.CutMenuItemCaption
CutMenuItemCaption As String
The caption of the Cut item in the control's contextual menu.
The default is "Cut".
DBKit.ImageViewer.DisplayName
DisplayName As String
A user-friendly name for the control, shown to the user in place of the column name (for example in the InvalidValueMessage).
If blank, the column name is de-camelcased automatically (for example "FirstName" becomes "First Name").
DBKit.ImageViewer.Editable
Editable As Boolean
If True, the user can change the image displayed by the control, for example by dragging and dropping an image onto it.
DBKit.ImageViewer.Image
Image As Picture
The image displayed by the control.
DBKit.ImageViewer.ImageFormat
ImageFormat As ImageFormats
The format used when saving the image.
The default is BMP.
DBKit.ImageViewer.ImageQuality
ImageQuality As ImageQualityLevels
The quality level used when saving the image.
The default is Default.
DBKit.ImageViewer.InvalidValueMessage
InvalidValueMessage As String
The message displayed when the control is mandatory but has no image. Use <$1> as a placeholder for the control's display name.
The default is "<$1> must have an image."
DBKit.ImageViewer.Mandatory
Mandatory As Boolean
If True, the control must contain an image before the row can be saved. When a row with an empty mandatory control is saved, the InvalidValueMessage is displayed and the save is cancelled.
The default is False.
DBKit.ImageViewer.PasteMenuItemCaption
PasteMenuItemCaption As String
The caption of the Paste item in the control's contextual menu.
The default is "Paste".
Method descriptions
DBKit.ImageViewer.Clear
Clear()
Clears the image displayed by the control.
This method is only supported while the row is being edited by the user.
DBKit.ImageViewer.Copy
Copy()
Copies the image to the clipboard.
DBKit.ImageViewer.Cut
Cut()
Copies the image to the clipboard and clears it.
This method is only supported while the row is being edited by the user.
DBKit.ImageViewer.ImageFormatForColumn
ImageFormatForColumn(Parent As Object, columnName As String) As ImageFormats
Returns the ImageFormat of the DBKit.ImageViewer on Parent (a DesktopWindow or DesktopContainer) whose ColumnName matches columnName.
Important
This method is only available in desktop projects.
DBKit.ImageViewer.ImageQualityForColumn
ImageQualityForColumn(Parent As Object, columnName As String) As ImageQualityLevels
Returns the ImageQuality of the DBKit.ImageViewer on Parent (a DesktopWindow or DesktopContainer) whose ColumnName matches columnName.
Important
This method is only available in desktop projects.
DBKit.ImageViewer.Paste
Paste()
Pastes the image from the clipboard.
This method is only supported while the row is being edited by the user.
DBKit.ImageViewer.PictureFormat
PictureFormat() As Picture.Formats
Returns the Picture.Formats value corresponding to the control's ImageFormat.
DBKit.ImageViewer.PictureQuality
PictureQuality() As Integer
Returns the picture quality constant (such as Picture.QualityDefault) corresponding to the control's ImageQuality.
DBKit.ImageViewer.TableName
TableName() As String
Returns the name of the database table for this control: the table name of the control's layout.
Event descriptions
DBKit.ImageViewer.RowChanged
RowChanged(row As DBKit.Row)
The current row (passed to the event) has been changed.
DBKit.ImageViewer.RowCreated
RowCreated(row As DBKit.Row)
A new row (passed to the event) was just created and is now the current row.
DBKit.ImageViewer.RowDeleted
RowDeleted(row As DBKit.Row)
The current row (passed to the event) has been deleted.
DBKit.ImageViewer.RowEditing
RowEditing(row As DBKit.Row)
The current row (passed to the event) is being edited by the user.
DBKit.ImageViewer.RowLoaded
RowLoaded(row As DBKit.Row)
The current row (passed to the event) has been loaded.
DBKit.ImageViewer.RowNotSelected
RowNotSelected
There is no row currently selected.
DBKit.ImageViewer.RowSaved
RowSaved(row As DBKit.Row)
The current row (passed to the event) has been saved.
DBKit.ImageViewer.RowSaving
RowSaving(row As DBKit.Row)
The current row (passed to this event) is about to be saved.
DBKit.ImageViewer.RowUndone
RowUndone(row As DBKit.Row)
The changes made to the current row (passed to this event) have been undone.
Notes
In web projects, when Editable is True, clicking the control opens a file dialog so the user can choose an image to upload. Editable is True while the row is being edited.
Localize the control's user-facing text (InvalidValueMessage) the standard Xojo way: assign a dynamic constant to each property and provide translations for as many languages as you need, or localize the property values directly.
Compatibility
Project Types |
Desktop, Web |
Operating Systems |
All |
See also
DesktopImageViewer (desktop) and WebImageViewer (web) parent classes; DBKit.Row class.