📄 unit2.dfm
字号:
object Form1: TForm1
Left = 182
Top = 78
Width = 803
Height = 561
Caption = 'Demo del componente CustomizeGrid...'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object splVertical1: TSplitter
Left = 535
Top = 0
Width = 5
Height = 534
Cursor = crHSplit
Align = alRight
Beveled = True
end
object pnlDerecha: TPanel
Left = 540
Top = 0
Width = 255
Height = 534
Align = alRight
BevelOuter = bvNone
TabOrder = 0
DesignSize = (
255
534)
object lblFlatStile: TLabel
Left = 24
Top = 78
Width = 109
Height = 13
Caption = 'Estilo para alternativas:'
end
object lblColores: TLabel
Left = 40
Top = 108
Width = 41
Height = 13
Caption = 'Colores: '
end
object chkActivar: TCheckBox
Left = 8
Top = 8
Width = 169
Height = 17
Caption = #191'Activar el componente?'
Checked = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
State = cbChecked
TabOrder = 0
OnClick = chkActivarClick
end
object rgEventos: TRadioGroup
Left = 8
Top = 200
Width = 241
Height = 185
Anchors = [akLeft, akTop, akRight]
Caption = 'Eventos del componente '
Items.Strings = (
'Pintar una o varias celdas de color'
'Pintar una columna de color'
'Pintar una columna pulsada (t'#237'tulo)'
'Pintar filas por colores (segun campo)'
'Imagenes en celdas (campo) - LoadFromFile'
'Imagenes en celdas (campo) - ImageList'
'Imagenes en celdas (campo) - Recursos')
TabOrder = 2
OnClick = rgEventosClick
end
object nbCodigos: TNotebook
Left = 8
Top = 392
Width = 217
Height = 129
PageIndex = 5
TabOrder = 3
Visible = False
object TPage
Left = 0
Top = 0
Caption = '0'
object mmcodigo0: TMemo
Left = 0
Top = 0
Width = 217
Height = 129
Align = alClient
Lines.Strings = (
'procedure TForm1.cdbg1PaintCell(FieldName: String; Field: TField' +
'; var CellColor: TColor; var ChangeColor: Boolean);'
'begin'
' // Pintar'
' if (FieldName = '#39'Company'#39') and (not (Field.IsNull)) then begin'
' if (Field.AsString[1] = '#39'M'#39') then begin'
' ChangeColor := True;'
' CellColor := clRed;'
' end;'
' end;'
'end;')
TabOrder = 0
WordWrap = False
end
end
object TPage
Left = 0
Top = 0
Caption = '1'
object mmcodigo1: TMemo
Left = 0
Top = 0
Width = 217
Height = 129
Align = alClient
Lines.Strings = (
'procedure TForm1.cdbg1PaintColumn(FieldName: String; Field: TFie' +
'ld; DataCol: Integer; Column: TColumn; var ColColor: TColor;'
' var ChangeColor: Boolean);'
'begin'
' // Para la columna 1'
' if DataCol = 1 then begin'
' ChangeColor := True;'
' ColColor := clSkyBlue;'
' end;'
'end;')
TabOrder = 0
WordWrap = False
end
end
object TPage
Left = 0
Top = 0
Caption = '2'
object mmcodigo2: TMemo
Left = 0
Top = 0
Width = 217
Height = 129
Align = alClient
Lines.Strings = (
'procedure TForm1.cdbg1PaintColumn(FieldName: String; Field: TFie' +
'ld; DataCol: Integer; Column: TColumn; var ColColor: TColor; ' +
'var ChangeColor: Boolean);'
'begin'
' // Para la columna 1'
' if DataCol = 1 then begin'
' ChangeColor := True;'
' ColColor := clSkyBlue;'
' end;'
'end;')
TabOrder = 0
WordWrap = False
end
end
object TPage
Left = 0
Top = 0
Caption = '3'
object mmcodigo3: TMemo
Left = 0
Top = 0
Width = 217
Height = 129
Align = alClient
Lines.Strings = (
'procedure TForm1.cdbg1PaintRow(DS: TDataSet; var RowColor: TColo' +
'r; var ChangeColor: Boolean);'
'begin'
' // Filas con CustNo par, en rojo, las impares en azul'
' if (Odd(DS.FieldByName('#39'CustNo'#39').AsInteger)) then begin'
' ChangeColor := True;'
' RowColor := clBlue;'
' end'
' else begin'
' ChangeColor := True;'
' RowColor := clRed;'
' end;'
'end;')
TabOrder = 0
WordWrap = False
end
end
object TPage
Left = 0
Top = 0
Caption = '4'
object mmcodigo4: TMemo
Left = 0
Top = 0
Width = 217
Height = 129
Align = alClient
Lines.Strings = (
'procedure TForm1.cdbg1PaintCellImage(FieldName: String; Field: T' +
'Field;'
' var Bitmap: TBitmap; var Change: Boolean);'
'begin'
' // Para la columna pulsada'
' if (FieldName = '#39'Country'#39') then begin'
' // Es una de los "conocidos"'
' if AnsiCompareText(Field.AsString, '#39'Canada'#39') = 0 then begi' +
'n'
' Bitmap.LoadFromFile('#39'C:\Proyectos\Delphi6\Ejemplos GERMA' +
'N\__COMPONENTES__\Demos\Demo_Grid\Flags\Canada.bmp'#39');'
' Change := True;'
' end'
' else if AnsiCompareText(Field.AsString, '#39'Bahamas'#39') = 0 the' +
'n begin'
' Bitmap.LoadFromFile('#39'C:\Proyectos\Delphi6\Ejemplos GERMA' +
'N\__COMPONENTES__\Demos\Demo_Grid\Flags\Bahamas.bmp'#39');'
' Change := True;'
' end'
' else if AnsiCompareText(Field.AsString, '#39'U.S.A.'#39') = 0 then' +
' begin'
' Bitmap.LoadFromFile('#39'C:\Proyectos\Delphi6\Ejemplos GERMA' +
'N\__COMPONENTES__\Demos\Demo_Grid\Flags\US.bmp'#39');'
' Change := True;'
' end;'
' end;'
'end;')
TabOrder = 0
WordWrap = False
end
end
object TPage
Left = 0
Top = 0
Caption = '5'
object mmcodigo5: TMemo
Left = 0
Top = 0
Width = 217
Height = 129
Align = alClient
Lines.Strings = (
'procedure TForm1.cdbg1PaintCellImage(FieldName: String; Field: T' +
'Field; var Bitmap: TBitmap; var Change: Boolean);'
'begin'
' // Para la columna pulsada'
' if (FieldName = '#39'Country'#39') then begin'
' // Es una de los "conocidos"'
' if AnsiCompareText(Field.AsString, '#39'Canada'#39') = 0 then begi' +
'n'
' ilFlags.GetBitmap(0, Bitmap);'
' Change := True;'
' end'
' else if AnsiCompareText(Field.AsString, '#39'Bahamas'#39') = 0 the' +
'n begin'
' ilFlags.GetBitmap(1, Bitmap);'
' Change := True;'
' end'
' else if AnsiCompareText(Field.AsString, '#39'U.S.A.'#39') = 0 then' +
' begin'
' ilFlags.GetBitmap(2, Bitmap);'
' Change := True;'
' end;'
' end;'
'end;')
TabOrder = 0
WordWrap = False
end
end
object TPage
Left = 0
Top = 0
Caption = '6'
object mmcodigo6: TMemo
Left = 0
Top = 0
Width = 217
Height = 129
Align = alClient
Lines.Strings = (
'procedure TForm1.cdbg1PaintCellImage(FieldName: String; Field: T' +
'Field;'
' var Bitmap: TBitmap; var Change: Boolean);'
'begin'
' // Para la columna pulsada'
' if (FieldName = '#39'Country'#39') then begin'
' // proteccion'
' try'
' // Cargar el recurso'
' Bitmap.LoadFromResourceName(HInstance, Field.AsString);'
' Change := True;'
' except'
' // si no encuentra el recurso no hacemos nada, no pintar' +
#225' la imagen'
' end;'
' end;'
'end;')
TabOrder = 0
WordWrap = False
end
end
end
object cbbTema: TComboBox
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -