Differenze tra le versioni di "GridBox"

Da Gambas-it.org - Wikipedia.
Riga 91: Riga 91:
 
===== KeyGrid =====
 
===== KeyGrid =====
 
  Property Read KeyGrid As KeyGrid (Virtual class)
 
  Property Read KeyGrid As KeyGrid (Virtual class)
 
===== PicCheck =====
 
Property PicCheck As Picture
 
 
===== PicUncheck =====
 
Property PicUncheck As Picture
 
 
===== PopupMenu =====
 
Property PopupMenu As String
 
 
===== Previous =====
 
Property Previous As Control
 
  
 
===== Query =====
 
===== Query =====
Riga 122: Riga 110:
 
  Property Read Rows As Rows (Virtual class)
 
  Property Read Rows As Rows (Virtual class)
  
===== ScreenX =====
 
Property Read ScreenX As Integer
 
 
===== ScreenY =====
 
Property Read ScreenY As Integer
 
 
===== ScrollBar =====
 
Property ScrollBar As Integer
 
 
===== ScrollX =====
 
Property ScrollX As Integer
 
 
===== ScrollY =====
 
Property ScrollY As Integer
 
  
 
===== Table =====
 
===== Table =====
Riga 143: Riga 117:
 
  Property TableName As String
 
  Property TableName As String
  
===== Tag =====
 
Property Tag As Variant
 
  
 
===== TmpConnection =====
 
===== TmpConnection =====
 
  Property Read TmpConnection As Connection
 
  Property Read TmpConnection As Connection
  
===== Tooltip =====
 
Property Tooltip As String
 
 
===== Top =====
 
Property Top As Integer
 
 
===== Tracking =====
 
Property Tracking As Boolean
 
  
 
===== UpdateReording =====
 
===== UpdateReording =====
 
  Property UpdateReording As Boolean
 
  Property UpdateReording As Boolean
  
===== Visible =====
 
Property Visible As Boolean
 
 
===== W =====
 
Property W As Integer
 
 
===== Width =====
 
Property Width As Integer
 
 
===== Window =====
 
Property Read Window As Window
 
 
===== X =====
 
Property X As Integer
 
 
===== Y =====
 
Property Y As Integer
 
  
Action - Background - Border - Children - ClientH - ClientHeight - ClientW - ClientWidth - ClientX - ClientY - Cursor - Design - Drop - Font - Foreground - H - Handle - HasFocus - Height - Hovered - Id - Ignore - Left - Mouse - Name - Next - Parent -
+
Action - Background - Border - Children - ClientH - ClientHeight - ClientW - ClientWidth - ClientX - ClientY - Cursor - Design - Drop - Font - Foreground - H - Handle - HasFocus - Height - Hovered - Id - Ignore - Left - Mouse - Name - Next - Parent - PopupMenu - Previous - ScreenX - ScreenY - ScrollBar - ScrollX - ScrollY - Tag - Tooltip - Top - Tracking - Visible - W - Width - Window - X - Y
  
 
==== Metodi ====
 
==== Metodi ====

Versione delle 17:19, 5 nov 2010

Introduzione

Una GridBox è un componente non ufficiale ma molto valido per chi lavora spesso con i database. Questo componente, tutto made in Gambas-it.org grazie all'ottimo lavoro dell'utente Milio, permette di creare semplicemente una griglia collegata a un database, con pochissime righe di codice, e già pronta con comandi quali: salvataggio, inserimento, eliminazione, modifica.

Una caratteristica interessante di questo componente è la possibilità di mantenere l'integrità dei dati, con l'aiuto di oggetti quali TextBox, ComboBox, CheckBox, ValueBox, ecc, per una corretta modifica/inserimento di record nel DataBase. Altre caratteristiche sono la formattazione dei dati, mantenendo l'integrità del loro valore, formattazioni condizionate in stile foglio di calcolo, colonne di tipo Formula per facilitare calcoli su i vari record, e altro ancora.

Le Classi esportabili

In questo componente abbiamo i seguenti oggetti che si possono utilizzare:

  • GridBox
  • Grid
  • Conditional
  • Cell

Simboli dell'oggetto GridBox

Proprietà

AlwaysEditable
Property AlwaysEditable As Boolean

Imposta la griglia in modo che le celle siano sempre editabili. Usando il Tab o le frecce, il focus verrà spostato solo sulle celle che hanno la proprietà ReadOnly impostata a False.

AutoDataType
Property AutoDataType As Boolean

Imposta in automatico la proprietà DataType delle colonne di tipo Field in base al tipo di dato passatogli dal metodo LoadData.

AutoNew
Property AutoNew As Boolean

Questa proprietà, legata alla proprietà AlwaysEditable, fa in modo che, spostandosi dall'ultima cella editabile dell'ultima riga della griglia, crei in automatico una nuova riga per l'inserimento di un nuovo record.

Busy
Property Busy As Boolean

Questa proprietà serve a impostare la griglia in una fase di attesa. Ritorna utile quando la query da caricare è molto pesante.

Un esempio di utilizzo potrebbe essere questo:

Public Sub Caricodati()
  
  With Me.GridBox1
    .Busy = True
    .LoadData(<Query>)
    .Busy = False
  End With

End
Color
Property Read Color As Color (Virtual class)
ColorRowAlternating
Property ColorRowAlternating As Boolean
Column
Property Column As Integer
Columns
Property Read Columns As Columns (Virtual class)
Connection
Property Connection As Connection
DataMining
Property DataMining As Boolean
Enabled
Property Enabled As Boolean
Expand
Property Expand As Boolean
FieldKey
Property FieldKey As String[]
FieldReordering
Property FieldReordering As String
GridOnly
Property GridOnly As Boolean
Header
Property Header As Integer
KeyActivity
Property KeyActivity As Boolean
KeyGrid
Property Read KeyGrid As KeyGrid (Virtual class)
Query
Property Read Query As String[]
ReadData
Property Read ReadData As Result
ReadOnly
Property ReadOnly As Boolean
Row
Property Row As Integer
RowSelected
Property RowSelected As Integer[]
Rows
Property Read Rows As Rows (Virtual class)


Table
Property Read Table As Table
TableName
Property TableName As String


TmpConnection
Property Read TmpConnection As Connection


UpdateReording
Property UpdateReording As Boolean


Action - Background - Border - Children - ClientH - ClientHeight - ClientW - ClientWidth - ClientX - ClientY - Cursor - Design - Drop - Font - Foreground - H - Handle - HasFocus - Height - Hovered - Id - Ignore - Left - Mouse - Name - Next - Parent - PopupMenu - Previous - ScreenX - ScreenY - ScrollBar - ScrollX - ScrollY - Tag - Tooltip - Top - Tracking - Visible - W - Width - Window - X - Y

Metodi

Eventi

Link utili