- Visual SVN Server 최신버전 받기 (Version 2.0.8)
http://www.visualsvn.com/server/download/
- 설치 과정
-- Repository
-end
- Query 실행후 동적으로 컬럼 추가
(cxGridDBTableView1.DataController as IcxCustomGridDataController).DeleteAllItems;
(cxGridDBTableView1.DataController as IcxCustomGridDataController).CreateAllItems(true);
cxGridDBTableView1.ApplyBestFit();
- [Enter] 키로 Cell 이동
cxGrid1TableView1.OptionsBehavior.FocusCellOnCycle := true;
cxGrid1TableView1.OptionsBehavior.FocusCellOnTab := true;
cxGrid1TableView1.OptionsBehavior.FocusFirstCellOnNewRecord := true;
cxGrid1TableView1.OptionsBehavior.GoToNextCellOnEnter := true;
- 속성
| 속성명 | 자료형 | 설명 |
| OptionsBehavior.CopyCaptionsToClipboard | Boolean | 클립보드에 복사할 때 캡션도 복사할지 여부 |
| OptionsSelection.CellMultiSelect | Boolean | Cell 다중 선택 여부 |
| OptionsSelection.CellSelect | Boolean | Cell별로 선택 가능 여부 |
| OptionsSelection.MultiSelect | Boolean | Row 다중 선택 여부 |
- TcxCustomDataSource
TDatasetFieldModel=class(TcxCustomDataSource)
private
DatasetAnalyzer : TDatasetAnalyzer;
protected
function GetRecordCount: Integer; override;
function GetValue(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): Variant; override;
public
constructor Create;
destructor Destroy; override;
end;
implementation
{ TDatasetFieldModel }
constructor TDatasetFieldModel.Create;
begin
inherited Create;
DatasetAnalyzer := TDatasetAnalyzer.Create(TDatasetField);
end;
destructor TDatasetFieldModel.Destroy;
begin
DatasetAnalyzer.Free;
inherited Destroy;
end;
function TDatasetFieldModel.GetRecordCount: Integer;
begin
Result := DatasetAnalyzer.Count;
end;
function TDatasetFieldModel.GetValue(ARecordHandle: TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): Variant;
var
AColumnId: Integer;
theField : TDatasetField;
begin
result := Variants.Null;
AColumnId := GetDefaultItemID(Integer(AItemHandle));
if Integer(ARecordHandle) < Self.GetRecordCount then begin
theField := (DatasetAnalyzer.Items[Integer(ARecordHandle)] as TDatasetField);
if Assigned(theField) then begin
case AColumnId of
0 : Result := theField.FieldName;
1 : Result := theField.DataTypeStr;
2 : Result := theField.Size;
end;
end;
end;
end;
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
DatasetFieldModel := TDatasetFieldModel.Create;
cxGrid1TableView1.DataController.CustomDataSource := DatasetFieldModel;
end;
procedure TForm1.ListBox1Click(Sender: TObject);
begin
if ListBox1.ItemIndex >= 0 then begin
Table1.Active := false;
Table1.TableName := ListBox1.Items.Strings[ListBox1.ItemIndex];
Table1.Active := true;
DatasetFieldModel.DatasetAnalyzer.Analyzer(Table1);
DatasetFieldModel.DataChanged;
end;
end;- 옵션
cxGrid1TableView1.OptionsView.GroupByBox := false; cxGrid1TableView1.OptionsData.Editing := false; // 읽기전용
- ??
procedure TCreateTableFrm.Col1GetProperties( Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; var AProperties: TcxCustomEditProperties); var rowData : TRowObject; begin rowData := TRowObject(CustomGridModel.RowDataList.Items[ARecord.Index]); ... end;
- 수정중인 Cell 바로 적용
cxGrid1TableView1.DataController.PostEditingData;
- end -
참조
http://delphigeist.blogspot.com/2009/11/saveload-controls-from-inifile-using.html
uses
inifiles;
procedure TForm1.FormCreate(Sender: TObject);
var
IniFile : TiniFile;
begin
//
IniFile := TiniFile.Create(ChangeFileExt(Application.ExeName,'.ini'));
try
isDEBUG := IniFile.ReadBool('INFO', 'DEBUG', false);
finally
IniFile.Free;
end;
end;
procedure TForm1.FormDestroy(Sender: TObject);
var
IniFile : TiniFile;
begin
//
IniFile := TiniFile.Create(ChangeFileExt(Application.ExeName,'.ini'));
try
IniFile.WriteBool('INFO', 'DEBUG', isDEBUG);
finally
IniFile.Free;
end;
end;
uses
Dialogs;
function MessageDlg(const Msg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; HelpCtx: Longint; DefaultButton: TMsgDlgBtn): Integer; overload;
TMsgDlgType = (
mtWarning,
mtError,
mtInformation,
mtConfirmation,
mtCustom
);
TMsgDlgBtn = (
mbYes,
mbNo,
mbOK,
mbCancel,
mbAbort,
mbRetry,
mbIgnore,
mbAll,
mbNoToAll,
mbYesToAll,
mbHelp,
mbClose
);
if MessageDlg('종료 할래?', mtConfirmation, [mbYes, mbNo], 0, mbYes) = mrYes then begin
Close;
end;
1. 이벤트 핸들러 생성
Type
TAddConnectionInfoEvent = procedure(AConnInfo : TConnectionInfo) of object;
2. 이벤트 속성으로 정의
Type
TERDModel=class
private
fOnAddConnectionInfo : TAddConnectionInfoEvent;
public
procedure AddConnectionInfo(aConnectionInfo : TConnectionInfo);
property OnAddConnectionInfo : TAddConnectionInfoEvent read fOnAddConnectionInfo write fOnAddConnectionInfo;
end;
3. 이벤트 호출
procedure TERDModel.AddConnectionInfo(aConnectionInfo : TConnectionInfo);
begin
if Assigned(OnAddConnectionInfo ) then OnAddConnectionInfo(aConnectionInfo);
end;
4. 호출될 이벤트 구현
Type
TErdMainFm=class(TLocalForm)
private
procedure ERDModelAddConnection(AConnInfo : TConnectionInfo);
end;
implementation
procedure TErdMainFm.ERDModelAddConnection(AConnInfo : TConnectionInfo);
begin
ShowMessage('나 호출되었어요.');
end;
5. 이벤트 등록
procedure TErdMainFm.FormCreate(Sender: TObject);
var
ERDModel : TERDModel;
begin
ERDModel := TERDModel.Create();
ERDModel.OnAddConnectionInfo := ERDModelAddConnection;
end;
다운받는곳 : Soft Gems Homepage (http://www.soft-gems.net/)
속성
VT.TreeOptions.SelectionOptions := [toDisableDrawSelection,toExtendedFocus,toMiddleClickSelect,toMultiSelect,toRightClickSelect{,toCenterScrollIntoView}];
이벤트
OnFocusChanged
procedure Xxx.VTFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex);
var
Data: PAlignData;
begin
// Data := Sender.GetNodeData(Node);
end;
OnGetImageIndex
procedure Xxx.VTGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode; Kind: TVTImageKind;
Column: TColumnIndex; var Ghosted: Boolean; var Index: Integer);
var
Data: PAlignData;
begin
if Kind in [ikNormal, ikSelected] then begin
Data := Sender.GetNodeData(Node);
Index := Data.ImageIndex;
end;
end;
OnGetNodeDataSize
OnGetText
Node 찾기
function TTreeWorkspace.FindSubNode(ParentNode : PVirtualNode; name : String): PVirtualNode;
var
Run: PVirtualNode;
NodeData : PWorkspaceData;
begin
Result := nil;
Run := ParentNode.FirstChild;
while Assigned(Run) do begin
NodeData := PWorkspaceData(Self.GetNodeData(Run));
if (NodeData.Title=name) then begin
result := Run;
Exit;
end;
Run := Run.NextSibling;
end;
end;
정렬하기
호출
Self.Sort(TeamNode, 0, Self.Header.SortDirection, true);
constructor TTreeWorkspace.Create(AOwner: TComponent; aImageList : TImageList);
begin
inherited Create(AOwner);
Self.OnCompareNodes := TreeCompareNodes;
end;
procedure TTreeWorkspace.TreeCompareNodes(Sender: TBaseVirtualTree; Node1, Node2: PVirtualNode; Column: TColumnIndex;
var Result: Integer);
var
NodeData1 : PWorkspaceData;
NodeData2 : PWorkspaceData;
begin
NodeData1 := Sender.GetNodeData(Node1);
NodeData2 := Sender.GetNodeData(Node2);
Result := 0;
if NodeData1.Title > NodeData2.Title then
Result := 1;
end;