IdeIntf: Remember the layout of many property editor windows.

git-svn-id: trunk@55989 -
This commit is contained in:
juha 2017-10-06 10:47:12 +00:00
parent d25418e28d
commit c5ebf982e9
31 changed files with 729 additions and 531 deletions

View File

@ -27,7 +27,7 @@ uses
Classes, SysUtils, contnrs,
// LCL
LCLIntf, LCLType, LCLProc, Forms, Controls, Dialogs, ExtCtrls, StdCtrls,
Graphics, Menus, ComCtrls, DBActns, StdActns, ActnList, Themes,
Graphics, Menus, ComCtrls, DBActns, StdActns, ActnList,
// IDEIntf
ObjInspStrConsts, ComponentEditors, PropEdits, PropEditUtils, IDEWindowIntf,
IDEImagesIntf;
@ -424,6 +424,14 @@ begin
btnDelete.ImageIndex := 1;
btnUp.ImageIndex := 2;
btnDown.ImageIndex := 3;
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TActionListEditor.ActionListEditorClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
CloseAction := caFree;
end;
procedure TActionListEditor.FormShow(Sender: TObject);
@ -736,12 +744,6 @@ begin
ToolBar1.Visible := TAction(Sender).Checked;
end;
procedure TActionListEditor.ActionListEditorClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
CloseAction := caFree;
end;
procedure TActionListEditor.ActionListEditorKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var

View File

@ -10,15 +10,16 @@ object FormActStandard: TFormActStandard
ClientWidth = 330
KeyPreview = True
OnClose = FormActStandardClose
OnCreate = FormCreate
Position = poOwnerFormCenter
LCLVersion = '0.9.27'
LCLVersion = '1.9.0.0'
object LabelHeadLine: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 6
Height = 14
Height = 15
Top = 6
Width = 70
Width = 89
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'LabelHeadLine'
@ -32,15 +33,14 @@ object FormActStandard: TFormActStandard
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = BtnPanel
Left = 6
Height = 422
Top = 23
Height = 420
Top = 24
Width = 318
Anchors = [akTop, akLeft, akRight, akBottom]
AutoExpand = True
BorderSpacing.Left = 6
BorderSpacing.Top = 3
BorderSpacing.Right = 6
DefaultItemHeight = 15
HideSelection = False
HotTrack = True
ReadOnly = True
@ -52,9 +52,17 @@ object FormActStandard: TFormActStandard
end
object BtnPanel: TButtonPanel
Left = 6
Height = 26
Top = 451
Height = 27
Top = 450
Width = 318
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 1
ShowButtons = [pbOK, pbCancel]
ShowBevel = False

View File

@ -25,9 +25,11 @@ unit ActionsEditorStd;
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
ComCtrls, Buttons, ActnList, StdActns, DBActns, LCLType,
LCLProc, ActionsEditor, ObjInspStrConsts, ExtCtrls, ButtonPanel;
Classes, SysUtils,
// LCL
Forms, Controls, StdCtrls, ComCtrls, StdActns, DBActns, ButtonPanel,
// IdeIntf
ActionsEditor, ObjInspStrConsts, IDEWindowIntf;
type
@ -39,6 +41,7 @@ type
BtnPanel: TButtonPanel;
procedure FormActStandardClose(Sender: TObject; var CloseAction: TCloseAction);
procedure btnOKClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure tvActStdListDblClick(Sender: TObject);
private
FResultActionProc: TResultActProc;
@ -58,9 +61,15 @@ implementation
{ TFormActStandard }
procedure TFormActStandard.FormCreate(Sender: TObject);
begin
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TFormActStandard.FormActStandardClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
CloseAction := caFree;
end;

View File

@ -17,8 +17,13 @@ unit ChangeParentDlg;
interface
uses
Classes, SysUtils, strutils, FileUtil, ListFilterEdit, PropEditUtils,
IDEImagesIntf, Forms, Controls, Graphics, Dialogs, StdCtrls, ButtonPanel;
Classes, SysUtils, strutils,
// LCL
Forms, Controls, StdCtrls, ButtonPanel,
// LazControls
ListFilterEdit,
// IdeIntf
ObjInspStrConsts, PropEditUtils, IDEImagesIntf, IDEWindowIntf;
type
@ -64,8 +69,6 @@ function ShowChangeParentDlg(ASelection: TPersistentSelectionList;
implementation
uses LCLIntf, ObjInspStrConsts;
{$R *.lfm}
{ TChangeParentDlg }
@ -105,6 +108,7 @@ begin
chShowClasses.Caption := oisShowClasses;
TIDEImages.AssignImage(ListFilterEdit.Glyph, 'btnfiltercancel');
IDEDialogLayoutList.ApplyLayout(Self);
end;
{$HINTS OFF}
@ -113,6 +117,7 @@ begin
FSavedHeight := Height;
FSavedWidth := Width;
FSavedShowClasses := chShowClasses.Checked;
IDEDialogLayoutList.SaveLayout(Self);
end;
{$HINTS ON}

View File

@ -9,17 +9,18 @@ object CheckGroupEditorDlg: TCheckGroupEditorDlg
Caption = 'CheckGroupEditorDlg'
ClientHeight = 300
ClientWidth = 608
OnClose = FormClose
OnCreate = FormCreate
LCLVersion = '0.9.27'
LCLVersion = '1.9.0.0'
object ColumnsLabel: TLabel
AnchorSideLeft.Control = FCheck
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = DuplicateCheckBox
AnchorSideTop.Side = asrBottom
Left = 372
Height = 18
Top = 76
Width = 93
Height = 15
Top = 74
Width = 85
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'ColumnsLabel'
@ -30,7 +31,7 @@ object CheckGroupEditorDlg: TCheckGroupEditorDlg
AnchorSideTop.Control = ToolBar
AnchorSideBottom.Control = BtnPanel
Left = 6
Height = 220
Height = 229
Top = 32
Width = 360
Align = alLeft
@ -58,7 +59,7 @@ object CheckGroupEditorDlg: TCheckGroupEditorDlg
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 372
Height = 22
Height = 20
Top = 48
Width = 230
Anchors = [akTop, akLeft, akRight]
@ -75,8 +76,8 @@ object CheckGroupEditorDlg: TCheckGroupEditorDlg
AnchorSideTop.Control = ColumnsLabel
AnchorSideTop.Side = asrBottom
Left = 375
Height = 23
Top = 97
Height = 29
Top = 92
Width = 34
BorderSpacing.Left = 3
BorderSpacing.Top = 3
@ -93,8 +94,8 @@ object CheckGroupEditorDlg: TCheckGroupEditorDlg
AnchorSideBottom.Control = ColumnsEdit
AnchorSideBottom.Side = asrBottom
Left = 409
Height = 23
Top = 97
Height = 29
Top = 92
Width = 17
Anchors = [akTop, akLeft, akBottom]
Associate = ColumnsEdit
@ -114,63 +115,63 @@ object CheckGroupEditorDlg: TCheckGroupEditorDlg
Left = 1
Top = 2
Caption = 'tbAdd'
OnClick = AddItem
ParentShowHint = False
ShowHint = True
OnClick = AddItem
end
object tbDelete: TToolButton
Left = 24
Top = 2
Caption = 'tbDelete'
OnClick = DeleteItem
ParentShowHint = False
ShowHint = True
OnClick = DeleteItem
end
object ToolButton3: TToolButton
Left = 47
Height = 22
Top = 2
Width = 3
Caption = 'ToolButton3'
Style = tbsDivider
end
object tbUp: TToolButton
Left = 50
Left = 52
Top = 2
Caption = 'tbUp'
OnClick = MoveUpItem
ParentShowHint = False
ShowHint = True
OnClick = MoveUpItem
end
object tbDown: TToolButton
Left = 73
Left = 75
Top = 2
Caption = 'tbDown'
OnClick = MoveDownItem
ParentShowHint = False
ShowHint = True
OnClick = MoveDownItem
end
object ToolButton6: TToolButton
Left = 96
Left = 98
Height = 22
Top = 2
Width = 3
Caption = 'ToolButton6'
Style = tbsDivider
end
object tbEdit: TToolButton
Left = 99
Left = 103
Top = 2
Caption = 'tbEdit'
OnClick = ModifyItem
ParentShowHint = False
ShowHint = True
OnClick = ModifyItem
end
object LabelDisable: TLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Side = asrBottom
Left = 122
Height = 18
Left = 126
Height = 15
Top = 2
Width = 85
Width = 77
Caption = 'LabelDisable'
Font.Color = clHighlight
ParentColor = False
@ -179,9 +180,17 @@ object CheckGroupEditorDlg: TCheckGroupEditorDlg
end
object BtnPanel: TButtonPanel
Left = 6
Height = 36
Top = 258
Height = 27
Top = 267
Width = 596
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 5
ShowBevel = False
end

View File

@ -11,9 +11,12 @@ unit CheckGroupEditorDlg;
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls, Buttons, Menus, ComCtrls,
ObjInspStrConsts, IDEImagesIntf, ButtonPanel;
Classes, SysUtils,
// LCL
Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, Buttons, Menus,
ComCtrls, ButtonPanel,
// IdeIntf
ObjInspStrConsts, IDEImagesIntf, IDEWindowIntf;
type
@ -41,6 +44,7 @@ type
procedure ColumnsEditChange(Sender: TObject);
procedure CreateItems(Sender: TObject);
procedure DeleteItem(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure ItemClick(Sender: TObject; Index: integer);
procedure ModifyItem(Sender: TObject);
@ -84,6 +88,40 @@ end;
{ TCheckGroupEditorDlg }
procedure TCheckGroupEditorDlg.FormCreate(Sender: TObject);
begin
ToolBar.Images := IDEImages.Images_16;
tbAdd.ImageIndex := IDEImages.LoadImage('laz_add');
tbDelete.ImageIndex := IDEImages.LoadImage('laz_delete');
tbUp.ImageIndex := IDEImages.LoadImage('arrow_up');
tbDown.ImageIndex := IDEImages.LoadImage('arrow_down');
tbEdit.ImageIndex := IDEImages.LoadImage('laz_edit');
Caption := cgCheckGroupEditor;
FItemIndex := -1;
ColumnsLabel.Caption := cgColumns;
DuplicateCheckBox.Caption := cgCheckDuplicate;
LabelDisable.Caption := cgDisable;
BtnPanel.CloseButton.Caption := sccsTrEdtApply;
BtnPanel.CloseButton.Kind := bkCustom;
BtnPanel.CloseButton.Glyph := nil;
BtnPanel.CloseButton.ModalResult := mrNone;
BtnPanel.CloseButton.OnClick := @ApplyCheck;
tbAdd.Hint := clbAdd;
tbDelete.Hint := clbDeleteHint;
tbUp.Hint := clbUp;
tbDown.Hint := clbDown;
tbEdit.Hint := clbModify;
Change;
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TCheckGroupEditorDlg.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TCheckGroupEditorDlg.AddItem(Sender:TObject);
var
strItem: string;
@ -127,34 +165,6 @@ begin
end;
end;
procedure TCheckGroupEditorDlg.FormCreate(Sender: TObject);
begin
ToolBar.Images := IDEImages.Images_16;
tbAdd.ImageIndex := IDEImages.LoadImage('laz_add');
tbDelete.ImageIndex := IDEImages.LoadImage('laz_delete');
tbUp.ImageIndex := IDEImages.LoadImage('arrow_up');
tbDown.ImageIndex := IDEImages.LoadImage('arrow_down');
tbEdit.ImageIndex := IDEImages.LoadImage('laz_edit');
Caption := cgCheckGroupEditor;
FItemIndex := -1;
ColumnsLabel.Caption := cgColumns;
DuplicateCheckBox.Caption := cgCheckDuplicate;
LabelDisable.Caption := cgDisable;
BtnPanel.CloseButton.Caption := sccsTrEdtApply;
BtnPanel.CloseButton.Kind := bkCustom;
BtnPanel.CloseButton.Glyph := nil;
BtnPanel.CloseButton.ModalResult := mrNone;
BtnPanel.CloseButton.OnClick := @ApplyCheck;
tbAdd.Hint := clbAdd;
tbDelete.Hint := clbDeleteHint;
tbUp.Hint := clbUp;
tbDown.Hint := clbDown;
tbEdit.Hint := clbModify;
Change;
end;
procedure TCheckGroupEditorDlg.MoveUpItem(Sender:TObject);
var
itemtmp: string;

View File

@ -10,12 +10,13 @@ object CheckListBoxEditorDlg: TCheckListBoxEditorDlg
ClientWidth = 445
Constraints.MinHeight = 100
Constraints.MinWidth = 200
OnClose = FormClose
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '0.9.29'
LCLVersion = '1.9.0.0'
object FCheck: TCheckListBox
Left = 0
Height = 232
Height = 231
Top = 24
Width = 445
Align = alClient
@ -49,34 +50,34 @@ object CheckListBoxEditorDlg: TCheckListBoxEditorDlg
end
object ToolButton3: TToolButton
Left = 47
Height = 22
Top = 2
Width = 4
Caption = 'ToolButton3'
Style = tbsDivider
end
object tbUp: TToolButton
Left = 51
Left = 52
Top = 2
Action = actMoveUp
ParentShowHint = False
ShowHint = True
end
object tbDown: TToolButton
Left = 74
Left = 75
Top = 2
Action = actMoveDown
ParentShowHint = False
ShowHint = True
end
object ToolButton6: TToolButton
Left = 97
Left = 98
Height = 22
Top = 2
Width = 4
Caption = 'ToolButton6'
Style = tbsDivider
end
object tbEdit: TToolButton
Left = 101
Left = 103
Top = 2
Action = actEdit
ParentShowHint = False
@ -85,9 +86,17 @@ object CheckListBoxEditorDlg: TCheckListBoxEditorDlg
end
object BtnPanel: TButtonPanel
Left = 6
Height = 26
Top = 262
Height = 27
Top = 261
Width = 433
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 2
ShowBevel = False
end

View File

@ -11,9 +11,12 @@ unit CheckListboxEditorDlg;
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, CheckLst,
ExtCtrls, Buttons, ComCtrls, ButtonPanel, IDEImagesIntf, ObjInspStrConsts,
LCLType, ActnList;
Classes, SysUtils,
// LCL
LCLType, Forms, Controls, Dialogs, CheckLst, Buttons, ComCtrls, ButtonPanel,
ActnList,
// IdeIntf
IDEImagesIntf, ObjInspStrConsts, IDEWindowIntf;
type
@ -43,14 +46,13 @@ type
procedure actMoveDownExecute(Sender: TObject);
procedure actMoveUpExecute(Sender: TObject);
procedure FCheckClick(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure ApplyCheck(Sender: TObject);
private
{ private declarations }
FModified: Boolean;
procedure Change;
public
{ public declarations }
property Modified: Boolean read FModified write FModified;
end;
@ -78,6 +80,41 @@ end;
{ TCheckListBoxEditorDlg }
procedure TCheckListBoxEditorDlg.FormCreate(Sender: TObject);
begin
ToolBar.Images := IDEImages.Images_16;
actAdd.ImageIndex := IDEImages.LoadImage('laz_add');
actDel.ImageIndex := IDEImages.LoadImage('laz_delete');
actMoveUp.ImageIndex := IDEImages.LoadImage('arrow_up');
actMoveDown.ImageIndex := IDEImages.LoadImage('arrow_down');
actEdit.ImageIndex := IDEImages.LoadImage('laz_edit');
Caption := clbCheckListBoxEditor;
BtnPanel.OKButton.Caption := oisOk;
BtnPanel.CancelButton.Caption := oisCancel;
BtnPanel.HelpButton.Caption := cActionListEditorHelpCategory;
BtnPanel.CloseButton.Kind := bkCustom;
BtnPanel.CloseButton.LoadGlyphFromStock(idButtonYes);
BtnPanel.CloseButton.Caption := sccsTrEdtApply;
BtnPanel.CloseButton.OnClick := @ApplyCheck;
actAdd.Hint := clbAdd;
actDel.Hint := clbDeleteHint;
actMoveUp.Hint := clbUp;
actMoveDown.Hint := clbDown;
actEdit.Hint := clbModify;
actMoveUp.ShortCut := scCtrl or VK_UP;
actMoveDown.ShortCut := scCtrl or VK_DOWN;
Modified := False;
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TCheckListBoxEditorDlg.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TCheckListBoxEditorDlg.actAddExecute(Sender: TObject);
var
strItem: string;
@ -152,35 +189,6 @@ begin
Change;
end;
procedure TCheckListBoxEditorDlg.FormCreate(Sender: TObject);
begin
ToolBar.Images := IDEImages.Images_16;
actAdd.ImageIndex := IDEImages.LoadImage('laz_add');
actDel.ImageIndex := IDEImages.LoadImage('laz_delete');
actMoveUp.ImageIndex := IDEImages.LoadImage('arrow_up');
actMoveDown.ImageIndex := IDEImages.LoadImage('arrow_down');
actEdit.ImageIndex := IDEImages.LoadImage('laz_edit');
Caption := clbCheckListBoxEditor;
BtnPanel.OKButton.Caption := oisOk;
BtnPanel.CancelButton.Caption := oisCancel;
BtnPanel.HelpButton.Caption := cActionListEditorHelpCategory;
BtnPanel.CloseButton.Kind := bkCustom;
BtnPanel.CloseButton.LoadGlyphFromStock(idButtonYes);
BtnPanel.CloseButton.Caption := sccsTrEdtApply;
BtnPanel.CloseButton.OnClick := @ApplyCheck;
actAdd.Hint := clbAdd;
actDel.Hint := clbDeleteHint;
actMoveUp.Hint := clbUp;
actMoveDown.Hint := clbDown;
actEdit.Hint := clbModify;
actMoveUp.ShortCut := scCtrl or VK_UP;
actMoveDown.ShortCut := scCtrl or VK_DOWN;
Modified := False;
end;
procedure TCheckListBoxEditorDlg.ApplyCheck(Sender:TObject);
begin
if Assigned(FCheck) then

View File

@ -11,10 +11,11 @@ object CollectionPropertyEditorForm: TCollectionPropertyEditorForm
ClientWidth = 190
Constraints.MinHeight = 100
Constraints.MinWidth = 190
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
Position = poDefaultPosOnly
LCLVersion = '1.7'
LCLVersion = '1.9.0.0'
object ToolBar1: TToolBar
Left = 0
Height = 42
@ -42,8 +43,8 @@ object CollectionPropertyEditorForm: TCollectionPropertyEditorForm
end
object DividerToolButton: TToolButton
Left = 89
Height = 40
Top = 2
Width = 5
Caption = 'DividerToolButton'
Style = tbsDivider
end

View File

@ -5,7 +5,12 @@ unit CollectionPropEditForm;
interface
uses
Classes, SysUtils, Forms, ComCtrls, StdCtrls, ActnList, LCLType;
Classes, SysUtils,
// LCL
LCLType, LCLProc, Forms, Controls, Dialogs, ComCtrls, StdCtrls, ActnList,
// IdeIntf
ObjInspStrConsts, PropEditUtils, IDEImagesIntf, IDEWindowIntf;
type
{ TCollectionPropertyEditorForm }
@ -27,6 +32,7 @@ type
procedure actDelExecute(Sender: TObject);
procedure actMoveUpDownExecute(Sender: TObject);
procedure CollectionListBoxClick(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
@ -60,8 +66,7 @@ implementation
{$R *.lfm}
uses
Controls, Dialogs, LCLProc, IDEImagesIntf, ObjInspStrConsts, PropEdits,
PropEditUtils;
PropEdits;
type
TPersistentAccess = class(TPersistent)
@ -86,6 +91,13 @@ begin
actDel.Hint := oiColEditDelete;
actMoveUp.Hint := oiColEditUp;
actMoveDown.Hint := oiColEditDown;
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TCollectionPropertyEditorForm.FormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TCollectionPropertyEditorForm.FormDestroy(Sender: TObject);

View File

@ -9,8 +9,9 @@ object DSFieldsEditorFrm: TDSFieldsEditorFrm
ClientHeight = 334
ClientWidth = 257
OnClose = FieldsEditorFrmClose
OnCreate = FormCreate
OnDestroy = FieldsEditorFrmDestroy
LCLVersion = '0.9.29'
LCLVersion = '1.9.0.0'
object FieldsListBox: TListBox
Left = 0
Height = 302
@ -48,47 +49,47 @@ object DSFieldsEditorFrm: TDSFieldsEditorFrm
end
object ToolButton4: TToolButton
Left = 69
Height = 30
Top = 2
Width = 4
Caption = 'ToolButton4'
Style = tbsDivider
end
object tbNewFld: TToolButton
Left = 73
Left = 74
Top = 2
Action = NewActn
end
object ToolButton5: TToolButton
Left = 107
Left = 108
Height = 30
Top = 2
Width = 4
Caption = 'ToolButton5'
Style = tbsDivider
end
object tbMoveUp: TToolButton
Left = 111
Left = 113
Top = 2
Action = MoveUpActn
end
object tbMoveDown: TToolButton
Left = 145
Left = 147
Top = 2
Action = MoveDownActn
end
object ToolButton8: TToolButton
Left = 179
Left = 181
Height = 30
Top = 2
Width = 4
Caption = 'ToolButton8'
Style = tbsDivider
end
object tbSelect: TToolButton
Left = 183
Left = 186
Top = 2
Action = SelectAllActn
end
object tbUnselect: TToolButton
Left = 217
Left = 220
Top = 2
Action = UnselectAllActn
end

View File

@ -16,10 +16,12 @@ unit fieldseditor;
interface
uses
Classes, SysUtils, TypInfo, LCLProc, Forms, Controls, Menus, Graphics,
Dialogs, ComCtrls, db, ActnList, StdCtrls, ObjInspStrConsts, ComponentEditors,
PropEdits, PropEditUtils, LCLType, ExtCtrls, NewField, FieldsList,
types;
Classes, SysUtils, types, db,
// LCL
LCLType, Forms, Controls, Menus, Dialogs, ComCtrls, ActnList, StdCtrls,
// IdeIntf
ObjInspStrConsts, ComponentEditors, PropEdits, PropEditUtils,
NewField, FieldsList, IDEImagesIntf, IDEWindowIntf;
type
@ -67,6 +69,7 @@ type
ARect: TRect; {%H-}State: TOwnerDrawState);
procedure FieldsListBoxKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormCreate(Sender: TObject);
procedure NewActnExecute(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
procedure MoveDownActnExecute(Sender: TObject);
@ -74,7 +77,6 @@ type
procedure SelectAllActnExecute(Sender: TObject);
procedure UnselectAllActnExecute(Sender: TObject);
protected
{ protected declarations }
procedure DoSelected(All: boolean);
procedure SelectionChanged(AOrderChanged: Boolean = false);
procedure OnComponentRenamed(AComponent: TComponent);
@ -83,7 +85,6 @@ type
procedure OnSetSelection(const ASelection: TPersistentSelectionList);
procedure OnPersistentAdded(APersistent: TPersistent; Select: boolean);
private
{ private declarations }
LinkDataset: TDataset;
FDesigner: TComponentEditorDesigner;
FComponentEditor: TFieldsComponentEditor;
@ -94,7 +95,6 @@ type
procedure RefreshFieldsListBox(SelectAllNew: boolean);
function FindChild(ACandidate: TPersistent; out AIndex: Integer): Boolean;
public
{ public declarations }
constructor Create(AOwner: TComponent; ADataset: TDataset;
ADesigner: TComponentEditorDesigner); reintroduce;
destructor Destroy; override;
@ -115,30 +115,8 @@ implementation
{$R *.lfm}
uses
IDEImagesIntf;
{ TDSFieldsEditorFrm }
procedure TDSFieldsEditorFrm.AddFieldsActnExecute(Sender: TObject);
var FieldsList: TFieldsListFrm;
begin
try
FieldsList := TFieldsListFrm.Create(Self, LinkDataset, Designer);
except
on E:Exception do begin
ShowMessage(fesNoFields+^M+fesCheckDSet+^M^M+E.Message);
exit;
end;
end;
try
FieldsList.ShowModal;
finally
FieldsList.Free;
end;
SelectionChanged;
end;
constructor TDSFieldsEditorFrm.Create(AOwner: TComponent; ADataset: TDataset;
ADesigner: TComponentEditorDesigner);
begin
@ -192,6 +170,37 @@ begin
inherited Destroy;
end;
procedure TDSFieldsEditorFrm.FormCreate(Sender: TObject);
begin
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TDSFieldsEditorFrm.FieldsEditorFrmClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
CloseAction := caFree;
end;
procedure TDSFieldsEditorFrm.AddFieldsActnExecute(Sender: TObject);
var FieldsList: TFieldsListFrm;
begin
try
FieldsList := TFieldsListFrm.Create(Self, LinkDataset, Designer);
except
on E:Exception do begin
ShowMessage(fesNoFields+^M+fesCheckDSet+^M^M+E.Message);
exit;
end;
end;
try
FieldsList.ShowModal;
finally
FieldsList.Free;
end;
SelectionChanged;
end;
procedure TDSFieldsEditorFrm.DeleteFieldsActnExecute(Sender: TObject);
var
PreActive: boolean;
@ -207,12 +216,6 @@ begin
LinkDataSet.Active := True;
end;
procedure TDSFieldsEditorFrm.FieldsEditorFrmClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
CloseAction := caFree;
end;
procedure TDSFieldsEditorFrm.FieldsEditorFrmDestroy(Sender: TObject);
begin
if GlobalDesignHook = Nil then

View File

@ -7,7 +7,9 @@ object FieldsListFrm: TFieldsListFrm
Caption = 'FieldsListFrm'
ClientHeight = 271
ClientWidth = 173
LCLVersion = '1.7'
OnClose = FormClose
OnCreate = FormCreate
LCLVersion = '1.9.0.0'
object BitBtnOk: TBitBtn
Left = 9
Height = 25

View File

@ -32,8 +32,11 @@ unit fieldslist;
interface
uses
Classes, SysUtils, Forms, Dialogs,
Buttons, DB, StdCtrls, ObjInspStrConsts, ComponentEditors;
Classes, SysUtils, DB,
// LCL
Forms, Dialogs, Buttons, StdCtrls,
// IdeIntf
ObjInspStrConsts, ComponentEditors, IDEWindowIntf;
type
@ -44,8 +47,9 @@ type
BitBtnCancel: TBitBtn;
ListBox1: TListBox;
procedure BitBtnOkClick(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
FDesigner: TComponentEditorDesigner;
LinkDataset: TDataset;
protected
@ -53,7 +57,6 @@ type
procedure SelectAll; virtual;
procedure DoShow; override;
public
{ public declarations }
constructor Create(AOwner: TComponent; ADataset: TDataset;
ADesigner: TComponentEditorDesigner); reintroduce;
end;
@ -67,6 +70,16 @@ implementation
{ TFieldsListFrm }
procedure TFieldsListFrm.FormCreate(Sender: TObject);
begin
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TFieldsListFrm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TFieldsListFrm.BitBtnOkClick(Sender: TObject);
var
i: integer;

View File

@ -7,13 +7,14 @@ object FileFilterPropEditForm: TFileFilterPropEditForm
Caption = 'Filter editor'
ClientHeight = 318
ClientWidth = 473
OnClose = FormClose
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '1.1'
LCLVersion = '1.9.0.0'
object ButtonPanel1: TButtonPanel
Left = 6
Height = 40
Top = 272
Height = 35
Top = 277
Width = 461
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
@ -32,7 +33,7 @@ object FileFilterPropEditForm: TFileFilterPropEditForm
AnchorSideRight.Control = MoveUpBtn
AnchorSideBottom.Control = ButtonPanel1
Left = 3
Height = 263
Height = 268
Top = 3
Width = 429
Anchors = [akTop, akLeft, akRight, akBottom]

View File

@ -5,8 +5,11 @@ unit FileFilterPropEditor;
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ButtonPanel,
IDEImagesIntf, Grids, Buttons, ObjInspStrConsts;
Classes, SysUtils,
// LCL
Forms, Controls, ButtonPanel, Grids, Buttons,
// IdeIntf
ObjInspStrConsts, IDEImagesIntf, IDEWindowIntf;
type
@ -17,6 +20,7 @@ type
MoveDownBtn: TSpeedButton;
MoveUpBtn: TSpeedButton;
StringGrid1: TStringGrid;
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure MoveUpBtnClick(Sender: TObject);
procedure MoveDownBtnClick(Sender: TObject);
@ -49,6 +53,13 @@ begin
TIDEImages.AssignImage(MoveDownBtn.Glyph, 'arrow_down');
MoveUpBtn.Hint := rscdMoveUp;
MoveDownBtn.Hint := rscdMoveDown;
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TFileFilterPropEditForm.FormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TFileFilterPropEditForm.MoveUpBtnClick(Sender: TObject);

View File

@ -14,7 +14,9 @@ interface
uses
Classes, SysUtils, RTTIUtils, TypInfo,
// LCL
Forms, StdCtrls, Buttons, ExtCtrls, ButtonPanel,
// IdeIntf
IDEWindowIntf, IDEImagesIntf, ObjInspStrConsts;
type
@ -71,6 +73,26 @@ implementation
{ TSelectPropertiesForm }
procedure TSelectPropertiesForm.SelectPropertiesFormCreate(Sender: TObject);
begin
BAdd.Caption:=ilesAdd;
TIDEImages.AssignImage(BAdd.Glyph, 'laz_add');
BDelete.Caption:=oisDelete;
TIDEImages.AssignImage(BDelete.Glyph, 'laz_delete');
BClear.Caption:=oisClear;
TIDEImages.AssignImage(BClear.Glyph, 'menu_clean');
LComponents.Caption:=oisBtnComponents;
LProperties.Caption:=oisBtnProperties;
LLBSelected.Caption:=oisSelectedProperties;
IDEDialogLayoutList.ApplyLayout(Self,485,460);
end;
procedure TSelectPropertiesForm.SelectPropertiesFormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TSelectPropertiesForm.SetPropComponent(const AValue: TComponent);
begin
if FPropComponent=AValue then exit;
@ -89,26 +111,6 @@ begin
AddSelectedProperties;
end;
procedure TSelectPropertiesForm.SelectPropertiesFormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TSelectPropertiesForm.SelectPropertiesFormCreate(Sender: TObject);
begin
BAdd.Caption:=ilesAdd;
TIDEImages.AssignImage(BAdd.Glyph, 'laz_add');
BDelete.Caption:=oisDelete;
TIDEImages.AssignImage(BDelete.Glyph, 'laz_delete');
BClear.Caption:=oisClear;
TIDEImages.AssignImage(BClear.Glyph, 'menu_clean');
LComponents.Caption:=oisBtnComponents;
LProperties.Caption:=oisBtnProperties;
LLBSelected.Caption:=oisSelectedProperties;
IDEDialogLayoutList.ApplyLayout(Self,485,460);
end;
procedure TSelectPropertiesForm.BAddClick(Sender: TObject);
begin
AddSelectedProperties;

View File

@ -9,25 +9,26 @@ object GraphicPropertyEditorForm: TGraphicPropertyEditorForm
ClientWidth = 436
Constraints.MinHeight = 180
Constraints.MinWidth = 200
OnClose = FormClose
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '1.7'
LCLVersion = '1.9.0.0'
object GroupBox1: TGroupBox
Left = 6
Height = 334
Height = 336
Top = 6
Width = 424
Align = alClient
BorderSpacing.Around = 6
Caption = 'Picture'
ClientHeight = 315
ClientHeight = 309
ClientWidth = 420
TabOrder = 0
object ScrollBox: TScrollBox
AnchorSideRight.Control = GroupBox1
AnchorSideBottom.Control = GroupBox1
Left = 6
Height = 303
Height = 297
Top = 6
Width = 322
HorzScrollBar.Page = 100
@ -36,8 +37,8 @@ object GraphicPropertyEditorForm: TGraphicPropertyEditorForm
VertScrollBar.Tracking = True
Align = alClient
BorderSpacing.Around = 6
ClientHeight = 301
ClientWidth = 320
ClientHeight = 293
ClientWidth = 318
ParentShowHint = False
ShowHint = True
TabOrder = 0
@ -54,17 +55,17 @@ object GraphicPropertyEditorForm: TGraphicPropertyEditorForm
end
object LoadSaveBtnPanel: TPanel
Left = 334
Height = 315
Height = 309
Top = 0
Width = 86
Align = alRight
BevelOuter = bvNone
ClientHeight = 315
ClientHeight = 309
ClientWidth = 86
TabOrder = 1
object LoadButton: TButton
Left = 6
Height = 29
Height = 25
Top = 6
Width = 74
Action = FileOpenAction
@ -80,8 +81,8 @@ object GraphicPropertyEditorForm: TGraphicPropertyEditorForm
AnchorSideRight.Control = LoadButton
AnchorSideRight.Side = asrBottom
Left = 6
Height = 29
Top = 41
Height = 25
Top = 37
Width = 74
Action = FileSaveAction
Align = alTop
@ -96,8 +97,8 @@ object GraphicPropertyEditorForm: TGraphicPropertyEditorForm
AnchorSideRight.Control = LoadButton
AnchorSideRight.Side = asrBottom
Left = 6
Height = 29
Top = 76
Height = 25
Top = 68
Width = 74
Action = ClearAction
Align = alTop
@ -112,8 +113,8 @@ object GraphicPropertyEditorForm: TGraphicPropertyEditorForm
AnchorSideRight.Control = LoadButton
AnchorSideRight.Side = asrBottom
Left = 6
Height = 29
Top = 111
Height = 25
Top = 99
Width = 74
Action = CopyAction
Anchors = [akTop, akLeft, akRight]
@ -128,8 +129,8 @@ object GraphicPropertyEditorForm: TGraphicPropertyEditorForm
AnchorSideRight.Control = LoadButton
AnchorSideRight.Side = asrBottom
Left = 6
Height = 29
Top = 146
Height = 25
Top = 130
Width = 74
Action = PasteAction
Anchors = [akTop, akLeft, akRight]
@ -141,8 +142,8 @@ object GraphicPropertyEditorForm: TGraphicPropertyEditorForm
end
object OkCancelButtonPanel: TButtonPanel
Left = 6
Height = 29
Top = 346
Height = 27
Top = 348
Width = 424
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True

View File

@ -17,9 +17,12 @@ unit GraphicPropEdit;
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls, Buttons, ButtonPanel, ExtDlgs, ActnList, StdActns, Clipbrd,
IDEDialogs, ObjInspStrConsts;
Classes, SysUtils,
// LCL
Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, ButtonPanel, ExtDlgs,
ActnList, StdActns, Clipbrd,
// IdeIntf
IDEDialogs, ObjInspStrConsts, IDEWindowIntf;
type
@ -46,6 +49,7 @@ type
ScrollBox: TScrollBox;
procedure CopyActionExecute(Sender: TObject);
procedure CopyActionUpdate(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure ImagePreviewPaintBackground({%H-}ASender: TObject; ACanvas: TCanvas;
ARect: TRect);
procedure PasteActionExecute(Sender: TObject);
@ -90,6 +94,13 @@ begin
OpenDialog.Title:=oisPEOpenImageFile;
SaveDialog.Title:=oisPESaveImageAs;
ImagePreview.OnPictureChanged:=@PictureChanged;
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TGraphicPropertyEditorForm.FormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TGraphicPropertyEditorForm.ClearActionExecute(Sender: TObject);

View File

@ -9,30 +9,31 @@ object ImageListEditorDlg: TImageListEditorDlg
ClientWidth = 616
Constraints.MinHeight = 345
Constraints.MinWidth = 520
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
Position = poScreenCenter
LCLVersion = '1.7'
LCLVersion = '1.9.0.0'
object GroupBoxR: TGroupBox
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = BtnPanel
Left = 376
Height = 335
Height = 334
Top = 6
Width = 234
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
Caption = 'Selected Image'
ClientHeight = 315
ClientHeight = 307
ClientWidth = 230
TabOrder = 1
object LabelTransparent: TLabel
Left = 110
Height = 15
Top = 208
Width = 98
Top = 200
Width = 111
Anchors = [akLeft, akBottom]
BorderSpacing.Around = 6
Caption = 'Transparent Color:'
@ -47,7 +48,7 @@ object ImageListEditorDlg: TImageListEditorDlg
end
object Preview: TScrollBox
Left = 6
Height = 167
Height = 159
Top = 32
Width = 217
HorzScrollBar.Page = 1
@ -62,7 +63,7 @@ object ImageListEditorDlg: TImageListEditorDlg
object RadioGroup: TRadioGroup
Left = 7
Height = 105
Top = 205
Top = 197
Width = 96
Anchors = [akLeft, akBottom]
AutoFill = True
@ -76,7 +77,7 @@ object ImageListEditorDlg: TImageListEditorDlg
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 85
ClientHeight = 78
ClientWidth = 92
Enabled = False
ItemIndex = 0
@ -93,8 +94,8 @@ object ImageListEditorDlg: TImageListEditorDlg
AnchorSideTop.Control = LabelTransparent
AnchorSideTop.Side = asrBottom
Left = 110
Height = 22
Top = 229
Height = 29
Top = 221
Width = 96
Selected = clFuchsia
Style = [cbStandardColors, cbExtendedColors, cbIncludeDefault, cbCustomColor, cbPrettyNames]
@ -109,25 +110,24 @@ object ImageListEditorDlg: TImageListEditorDlg
AnchorSideTop.Control = Owner
AnchorSideBottom.Control = BtnPanel
Left = 6
Height = 335
Height = 334
Top = 6
Width = 364
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Around = 6
Caption = 'Images'
ClientHeight = 315
ClientHeight = 307
ClientWidth = 360
TabOrder = 0
object TreeView: TTreeView
AnchorSideLeft.Control = GroupBoxL
AnchorSideTop.Control = GroupBoxL
Left = 6
Height = 304
Height = 296
Top = 6
Width = 186
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
DefaultItemHeight = 18
HideSelection = False
Images = ImageList
ReadOnly = True
@ -281,8 +281,8 @@ object ImageListEditorDlg: TImageListEditorDlg
end
object BtnPanel: TButtonPanel
Left = 6
Height = 26
Top = 347
Height = 27
Top = 346
Width = 604
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True

View File

@ -27,9 +27,12 @@ unit ImageListEditor;
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls,
StdCtrls, Buttons, ExtCtrls, Menus, LCLProc, ColorBox, ExtDlgs,
IDEDialogs, PropEdits, ComponentEditors, ObjInspStrConsts, ButtonPanel;
Classes, SysUtils, Math,
// LCL
LCLProc, Forms, Controls, Graphics, GraphType, Dialogs, ComCtrls, StdCtrls,
ExtCtrls, ExtDlgs, ColorBox, Buttons, ButtonPanel,
// IdeIntf
IDEDialogs, PropEdits, ComponentEditors, ObjInspStrConsts, IDEWindowIntf;
type
TGlyphAdjustment = (gaNone, gaStretch, gaCrop, gaCenter);
@ -72,6 +75,7 @@ type
procedure btnSaveAllClick(Sender: TObject);
procedure BtnSaveClick(Sender: TObject);
procedure ColorBoxTransparentClick(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure PreviewPaint(Sender: TObject);
@ -106,9 +110,6 @@ type
implementation
uses
Math, GraphType;
{$R *.lfm}
function EditImageList(AImageList: TImageList): Boolean;
@ -221,6 +222,13 @@ begin
OpenDialog.Title := sccsILEdtOpenDialog;
SaveDialog.Title := sccsILEdtSaveDialog;
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TImageListEditorDlg.FormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TImageListEditorDlg.FormDestroy(Sender: TObject);

View File

@ -8,20 +8,21 @@ object StringGridEditorDlg: TStringGridEditorDlg
ClientWidth = 520
Constraints.MinHeight = 270
Constraints.MinWidth = 340
OnClose = FormClose
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '0.9.29'
LCLVersion = '1.9.0.0'
object GroupBox: TGroupBox
AnchorSideBottom.Control = BtnOK
Left = 6
Height = 276
Height = 275
Top = 6
Width = 508
Align = alClient
Anchors = [akRight]
BorderSpacing.Around = 6
Caption = 'String Grid'
ClientHeight = 258
ClientHeight = 248
ClientWidth = 504
TabOrder = 0
object LabelMove: TLabel
@ -32,8 +33,8 @@ object StringGridEditorDlg: TStringGridEditorDlg
AnchorSideRight.Control = GroupBox
AnchorSideRight.Side = asrBottom
Left = 417
Height = 14
Top = 181
Height = 29
Top = 187
Width = 87
Alignment = taCenter
Anchors = [akTop, akLeft, akRight]
@ -48,9 +49,11 @@ object StringGridEditorDlg: TStringGridEditorDlg
AnchorSideRight.Control = ArrowUp
Left = 421
Height = 26
Top = 129
Top = 135
Width = 26
Anchors = [akTop, akRight]
Constraints.MinHeight = 8
Constraints.MinWidth = 8
OnClick = SwapRowCol
end
object ArrowRight: TArrow
@ -60,9 +63,11 @@ object StringGridEditorDlg: TStringGridEditorDlg
AnchorSideTop.Side = asrBottom
Left = 473
Height = 26
Top = 129
Top = 135
Width = 26
ArrowType = atRight
Constraints.MinHeight = 8
Constraints.MinWidth = 8
OnClick = SwapRowCol
end
object ArrowDown: TArrow
@ -72,9 +77,11 @@ object StringGridEditorDlg: TStringGridEditorDlg
AnchorSideTop.Side = asrBottom
Left = 447
Height = 26
Top = 155
Top = 161
Width = 26
ArrowType = atDown
Constraints.MinHeight = 8
Constraints.MinWidth = 8
OnClick = SwapRowCol
end
object ArrowUp: TArrow
@ -84,16 +91,18 @@ object StringGridEditorDlg: TStringGridEditorDlg
AnchorSideTop.Side = asrBottom
Left = 447
Height = 26
Top = 103
Top = 109
Width = 26
ArrowType = atUp
BorderSpacing.Top = 10
Constraints.MinHeight = 8
Constraints.MinWidth = 8
OnClick = SwapRowCol
end
object StringGrid: TStringGrid
AnchorSideRight.Control = LoadSavePanel
Left = 6
Height = 246
Height = 236
Top = 6
Width = 405
Align = alLeft
@ -110,20 +119,20 @@ object StringGridEditorDlg: TStringGridEditorDlg
AnchorSideRight.Control = GroupBox
AnchorSideRight.Side = asrBottom
Left = 417
Height = 93
Height = 99
Top = 0
Width = 87
Anchors = [akTop, akRight]
AutoSize = True
BevelOuter = bvNone
ClientHeight = 93
ClientHeight = 99
ClientWidth = 87
TabOrder = 5
TabOrder = 1
object BtnLoad: TButton
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Side = asrBottom
Left = 6
Height = 23
Height = 25
Top = 6
Width = 75
Align = alTop
@ -137,8 +146,8 @@ object StringGridEditorDlg: TStringGridEditorDlg
object BtnSave: TButton
AnchorSideTop.Side = asrBottom
Left = 6
Height = 23
Top = 35
Height = 25
Top = 37
Width = 75
Align = alTop
AutoSize = True
@ -150,8 +159,8 @@ object StringGridEditorDlg: TStringGridEditorDlg
object BtnClean: TButton
AnchorSideTop.Side = asrBottom
Left = 6
Height = 23
Top = 64
Height = 25
Top = 68
Width = 75
Align = alTop
AutoSize = True
@ -164,20 +173,20 @@ object StringGridEditorDlg: TStringGridEditorDlg
end
object BtnPanel: TPanel
Left = 0
Height = 38
Top = 288
Height = 39
Top = 287
Width = 520
Align = alBottom
AutoSize = True
BevelOuter = bvNone
ClientHeight = 38
ClientHeight = 39
ClientWidth = 520
TabOrder = 1
object BtnHelp: TBitBtn
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 439
Height = 26
Height = 27
Top = 6
Width = 75
Align = alRight
@ -186,13 +195,12 @@ object StringGridEditorDlg: TStringGridEditorDlg
Caption = '&Help'
Constraints.MinWidth = 75
Kind = bkHelp
NumGlyphs = 0
TabOrder = 0
end
object BtnApply: TBitBtn
AnchorSideBottom.Side = asrBottom
Left = 358
Height = 26
Height = 27
Top = 6
Width = 75
Align = alRight
@ -200,16 +208,15 @@ object StringGridEditorDlg: TStringGridEditorDlg
BorderSpacing.Around = 6
Caption = '&Apply'
Constraints.MinWidth = 75
NumGlyphs = 0
OnClick = BtnApplyClick
TabOrder = 1
end
object BtnCancel: TBitBtn
AnchorSideBottom.Side = asrBottom
Left = 275
Height = 26
Left = 269
Height = 27
Top = 6
Width = 77
Width = 83
Align = alRight
AutoSize = True
BorderSpacing.Around = 6
@ -217,13 +224,12 @@ object StringGridEditorDlg: TStringGridEditorDlg
Constraints.MinWidth = 75
Kind = bkCancel
ModalResult = 2
NumGlyphs = 0
TabOrder = 2
end
object BtnOK: TBitBtn
AnchorSideBottom.Side = asrBottom
Left = 194
Height = 26
Left = 188
Height = 27
Top = 6
Width = 75
Align = alRight
@ -234,7 +240,6 @@ object StringGridEditorDlg: TStringGridEditorDlg
Default = True
Kind = bkOK
ModalResult = 1
NumGlyphs = 0
TabOrder = 3
end
end

View File

@ -11,9 +11,11 @@ unit LazStringGridEdit;
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
Arrow, StdCtrls, Buttons, Grids, ExtCtrls,
ObjInspStrConsts;
Classes, SysUtils,
// LCL
Forms, Controls, Dialogs, Arrow, StdCtrls, Buttons, Grids, ExtCtrls,
// IdeIntf
ObjInspStrConsts, IDEWindowIntf;
type
@ -42,6 +44,7 @@ type
procedure BtnCleanClick(Sender: TObject);
procedure BtnLoadClick(Sender: TObject);
procedure BtnSaveClick(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure StringGridPrepareCanvas({%H-}sender: TObject; Col, Row: Integer;
{%H-}aState: TGridDrawState);
@ -89,6 +92,34 @@ end;
{ TStringGridEditorDlg }
procedure TStringGridEditorDlg.FormCreate(Sender: TObject);
begin
Caption := sccsSGEdtCaption;
GroupBox.Caption := sccsSGEdtGrp;
BtnClean.Caption := sccsSGEdtClean;
BtnApply.Caption := sccsSGEdtApply;
BtnLoad.Caption := sccsSGEdtLoad;
BtnSave.Caption := sccsSGEdtSave;
LabelMove.Caption := sccsSGEdtMoveRowsCols;
BtnHelp.Caption:=cActionListEditorHelpCategory;
BtnCancel.Caption:=oiStdActDataSetCancel1Hint;
BtnOK.Caption:=oisOk2;
OpenDialog.Title := sccsSGEdtOpenDialog;
SaveDialog.Title := sccsSGEdtSaveDialog;
StringGrid.ExtendedColSizing := True;
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TStringGridEditorDlg.FormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TStringGridEditorDlg.BtnApplyClick(Sender: TObject);
begin
SaveToGrid;
@ -115,27 +146,6 @@ begin
end;
end;
procedure TStringGridEditorDlg.FormCreate(Sender: TObject);
begin
Caption := sccsSGEdtCaption;
GroupBox.Caption := sccsSGEdtGrp;
BtnClean.Caption := sccsSGEdtClean;
BtnApply.Caption := sccsSGEdtApply;
BtnLoad.Caption := sccsSGEdtLoad;
BtnSave.Caption := sccsSGEdtSave;
LabelMove.Caption := sccsSGEdtMoveRowsCols;
BtnHelp.Caption:=cActionListEditorHelpCategory;
BtnCancel.Caption:=oiStdActDataSetCancel1Hint;
BtnOK.Caption:=oisOk2;
OpenDialog.Title := sccsSGEdtOpenDialog;
SaveDialog.Title := sccsSGEdtSaveDialog;
StringGrid.ExtendedColSizing := True;
end;
procedure TStringGridEditorDlg.StringGridPrepareCanvas(sender: TObject; Col,
Row: Integer; aState: TGridDrawState);
begin

View File

@ -10,21 +10,22 @@ object ListViewItemsEditorForm: TListViewItemsEditorForm
ClientWidth = 525
Constraints.MinHeight = 200
Constraints.MinWidth = 400
OnClose = FormClose
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '0.9.31'
LCLVersion = '1.9.0.0'
object GroupBox1: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideBottom.Control = ButtonPanel
Left = 6
Height = 256
Height = 255
Top = 6
Width = 295
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Around = 6
Caption = 'Items'
ClientHeight = 238
ClientHeight = 228
ClientWidth = 291
TabOrder = 0
object TreeView1: TTreeView
@ -33,14 +34,13 @@ object ListViewItemsEditorForm: TListViewItemsEditorForm
AnchorSideBottom.Control = GroupBox1
AnchorSideBottom.Side = asrBottom
Left = 5
Height = 228
Height = 218
Top = 5
Width = 160
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 5
BorderSpacing.Top = 5
BorderSpacing.Bottom = 5
DefaultItemHeight = 15
HideSelection = False
ReadOnly = True
TabOrder = 0
@ -107,22 +107,22 @@ object ListViewItemsEditorForm: TListViewItemsEditorForm
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ButtonPanel
Left = 307
Height = 256
Height = 255
Top = 6
Width = 212
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
Caption = 'Item Properties'
ClientHeight = 238
ClientHeight = 228
ClientWidth = 208
TabOrder = 1
object LabelCaption: TLabel
AnchorSideLeft.Control = GroupBox2
AnchorSideTop.Control = GroupBox2
Left = 6
Height = 14
Height = 15
Top = 6
Width = 42
Width = 51
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'Caption:'
@ -134,9 +134,9 @@ object ListViewItemsEditorForm: TListViewItemsEditorForm
AnchorSideTop.Control = edtText
AnchorSideTop.Side = asrBottom
Left = 6
Height = 14
Top = 49
Width = 66
Height = 15
Top = 58
Width = 79
BorderSpacing.Top = 6
Caption = 'Image Index:'
FocusControl = edtIndexImg
@ -147,9 +147,9 @@ object ListViewItemsEditorForm: TListViewItemsEditorForm
AnchorSideTop.Control = edtIndexImg
AnchorSideTop.Side = asrBottom
Left = 6
Height = 14
Top = 92
Width = 62
Height = 15
Top = 110
Width = 73
BorderSpacing.Top = 6
Caption = 'State Index:'
FocusControl = edtIndexState
@ -162,8 +162,8 @@ object ListViewItemsEditorForm: TListViewItemsEditorForm
AnchorSideRight.Control = GroupBox2
AnchorSideRight.Side = asrBottom
Left = 6
Height = 21
Top = 22
Height = 29
Top = 23
Width = 197
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 2
@ -176,8 +176,8 @@ object ListViewItemsEditorForm: TListViewItemsEditorForm
AnchorSideTop.Control = LabelImageIndex
AnchorSideTop.Side = asrBottom
Left = 6
Height = 21
Top = 65
Height = 29
Top = 75
Width = 48
BorderSpacing.Top = 2
OnEditingDone = edtIndexStateEditingDone
@ -188,8 +188,8 @@ object ListViewItemsEditorForm: TListViewItemsEditorForm
AnchorSideTop.Control = LabelStateIndex
AnchorSideTop.Side = asrBottom
Left = 6
Height = 21
Top = 108
Height = 29
Top = 127
Width = 48
BorderSpacing.Top = 2
OnEditingDone = edtIndexStateEditingDone
@ -198,14 +198,18 @@ object ListViewItemsEditorForm: TListViewItemsEditorForm
end
object ButtonPanel: TButtonPanel
Left = 6
Height = 26
Top = 268
Height = 27
Top = 267
Width = 513
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CloseButton.OnClick = btnApplyClick
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 2
ShowBevel = False
end

View File

@ -27,9 +27,11 @@ unit ListViewPropEdit;
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls,
Buttons, ExtCtrls, Menus, PropEdits, ComponentEditors, LCLProc, ButtonPanel,
ObjInspStrConsts;
Classes, SysUtils,
// LCL
Forms, Controls, ComCtrls, StdCtrls, Buttons, ButtonPanel,
// IdeIntf
PropEdits, ComponentEditors, ObjInspStrConsts, IDEWindowIntf;
type
{ TListViewItemsEditorForm }
@ -50,6 +52,7 @@ type
TreeView1: TTreeView;
procedure BtnNewItemClick(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure TreeView1SelectionChanged(Sender: TObject);
procedure btnApplyClick(Sender: TObject);
@ -104,6 +107,37 @@ end;
{ TListViewItemsEditorForm }
procedure TListViewItemsEditorForm.FormCreate(Sender: TObject);
begin
Caption := sccsLvEdtCaption;
GroupBox1.Caption := sccsLvEdtGrpLCaption;
GroupBox2.Caption := sccsLvEdtGrpRCaption;
BtnNewItem.Caption := sccsLvEdtNewItem;
BtnNewSubItem.Caption := sccsLvEdtNewSubItem;
BtnDelete.Caption := sccsLvEdtDelete;
ButtonPanel.HelpButton.Caption := oisHelp;
ButtonPanel.OKButton.Caption := oisOK;
ButtonPanel.CancelButton.Caption := oisCancel;
ButtonPanel.CloseButton.Caption := sccsLvEdtApply;
ButtonPanel.CloseButton.Kind := bkCustom;
ButtonPanel.CloseButton.Glyph := nil;
ButtonPanel.CloseButton.ModalResult := mrNone;
LabelCaption.Caption := sccsLvEdtLabelCaption;
LabelImageIndex.Caption := sccsLvEdtLabelImageIndex;
LabelStateIndex.Caption := sccsLvEdtLabelStateIndex;
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TListViewItemsEditorForm.FormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TListViewItemsEditorForm.BtnNewItemClick(Sender: TObject);
var
S: String;
@ -131,30 +165,6 @@ begin
TreeView1.Selected.Text := edtText.Text;
end;
procedure TListViewItemsEditorForm.FormCreate(Sender: TObject);
begin
Caption := sccsLvEdtCaption;
GroupBox1.Caption := sccsLvEdtGrpLCaption;
GroupBox2.Caption := sccsLvEdtGrpRCaption;
BtnNewItem.Caption := sccsLvEdtNewItem;
BtnNewSubItem.Caption := sccsLvEdtNewSubItem;
BtnDelete.Caption := sccsLvEdtDelete;
ButtonPanel.HelpButton.Caption := oisHelp;
ButtonPanel.OKButton.Caption := oisOK;
ButtonPanel.CancelButton.Caption := oisCancel;
ButtonPanel.CloseButton.Caption := sccsLvEdtApply;
ButtonPanel.CloseButton.Kind := bkCustom;
ButtonPanel.CloseButton.Glyph := nil;
ButtonPanel.CloseButton.ModalResult := mrNone;
LabelCaption.Caption := sccsLvEdtLabelCaption;
LabelImageIndex.Caption := sccsLvEdtLabelImageIndex;
LabelStateIndex.Caption := sccsLvEdtLabelStateIndex;
end;
procedure TListViewItemsEditorForm.TreeView1SelectionChanged(
Sender: TObject);
begin

View File

@ -9,16 +9,17 @@ object MaskEditorForm: TMaskEditorForm
Caption = 'Input Mask Editor'
ClientHeight = 287
ClientWidth = 507
OnClose = FormClose
OnCreate = MaskEditorFormCreate
Position = poScreenCenter
LCLVersion = '0.9.29'
LCLVersion = '1.9.0.0'
object InputMaskLabel: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 6
Height = 14
Height = 15
Top = 6
Width = 58
Width = 70
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = '&Input Mask:'
@ -29,9 +30,9 @@ object MaskEditorForm: TMaskEditorForm
AnchorSideLeft.Control = SampleMasksListBox
AnchorSideTop.Control = Owner
Left = 201
Height = 14
Height = 15
Top = 6
Width = 71
Width = 90
BorderSpacing.Top = 6
Caption = '&Sample Masks:'
ParentColor = False
@ -41,9 +42,9 @@ object MaskEditorForm: TMaskEditorForm
AnchorSideTop.Control = InputMaskEdit
AnchorSideTop.Side = asrBottom
Left = 6
Height = 14
Top = 50
Width = 103
Height = 15
Top = 59
Width = 127
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'Character for Blanks:'
@ -55,8 +56,8 @@ object MaskEditorForm: TMaskEditorForm
AnchorSideTop.Control = InputMaskLabel
AnchorSideTop.Side = asrBottom
Left = 6
Height = 21
Top = 23
Height = 29
Top = 24
Width = 189
BorderSpacing.Left = 6
BorderSpacing.Top = 3
@ -73,8 +74,8 @@ object MaskEditorForm: TMaskEditorForm
AnchorSideBottom.Control = LoadSampleMasksButton
AnchorSideBottom.Side = asrBottom
Left = 201
Height = 191
Top = 23
Height = 211
Top = 24
Width = 300
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 6
@ -92,7 +93,7 @@ object MaskEditorForm: TMaskEditorForm
AnchorSideTop.Side = asrBottom
Left = 6
Height = 25
Top = 189
Top = 210
Width = 75
BorderSpacing.Around = 6
Caption = '&Masks...'
@ -106,8 +107,8 @@ object MaskEditorForm: TMaskEditorForm
AnchorSideRight.Control = InputMaskEdit
AnchorSideRight.Side = asrBottom
Left = 6
Height = 21
Top = 67
Height = 29
Top = 77
Width = 189
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -121,9 +122,9 @@ object MaskEditorForm: TMaskEditorForm
AnchorSideTop.Control = CharactersForBlanksEdit
AnchorSideTop.Side = asrBottom
Left = 6
Height = 17
Top = 94
Width = 130
Height = 20
Top = 112
Width = 169
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'Save &Literal Characters'
@ -138,7 +139,7 @@ object MaskEditorForm: TMaskEditorForm
AnchorSideRight.Side = asrBottom
Left = 6
Height = 66
Top = 117
Top = 138
Width = 189
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
@ -152,10 +153,10 @@ object MaskEditorForm: TMaskEditorForm
object TestInputLabel: TLabel
AnchorSideLeft.Control = TestInputPanel
AnchorSideTop.Control = TestInputPanel
Left = 6
Height = 14
Top = 6
Width = 55
Left = 8
Height = 15
Top = 8
Width = 63
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = '&Test Input:'
@ -167,10 +168,10 @@ object MaskEditorForm: TMaskEditorForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = TestInputPanel
AnchorSideRight.Side = asrBottom
Left = 6
Height = 21
Top = 23
Width = 177
Left = 8
Height = 29
Top = 26
Width = 173
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 3
@ -185,10 +186,18 @@ object MaskEditorForm: TMaskEditorForm
AnchorSideTop.Control = LoadSampleMasksButton
AnchorSideTop.Side = asrBottom
Left = 6
Height = 61
Top = 220
Height = 40
Top = 241
Width = 495
Anchors = [akTop, akLeft, akRight, akBottom]
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 6
ShowButtons = [pbOK, pbCancel, pbHelp]
end

View File

@ -18,9 +18,13 @@ unit MaskPropEdit;
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
StdCtrls, Buttons, ExtCtrls, LazUTF8, LazFileUtils, MaskEdit, LazIDEIntf,
PropEdits, ComponentEditors, ObjInspStrConsts, ButtonPanel;
Classes, SysUtils,
// LCL
Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, ButtonPanel, MaskEdit,
// LazUtils
LazUTF8, LazFileUtils,
// IdeIntf
LazIDEIntf, PropEdits, ComponentEditors, ObjInspStrConsts, IDEWindowIntf;
type
@ -40,6 +44,7 @@ type
TestMaskEdit: TMaskEdit;
OpenDialog1: TOpenDialog;
TestInputPanel: TPanel;
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure LoadSampleMasksButtonClick(Sender: TObject);
procedure SampleMasksListBoxDrawItem(Control: TWinControl; Index: Integer;
ARect: TRect; {%H-}State: TOwnerDrawState);
@ -126,6 +131,32 @@ end;
{ TMaskEditorForm }
procedure TMaskEditorForm.MaskEditorFormCreate(Sender: TObject);
var
aDemFile: string;
begin
LoadSampleMasksButton.Caption := oisMasks;
SaveLiteralCheckBox.Caption := oisSaveLiteralCharacters;
InputMaskLabel.Caption := oisInputMask;
SampleMasksLabel.Caption := oisSampleMasks;
CharactersForBlanksLabel.Caption := oisCharactersForBlanks;
TestInputLabel.Caption := oisTestInput;
if LazarusIDE<>nil then
aDemFile:=LazarusIDE.GetPrimaryConfigPath
else
aDemFile:=ExtractFileDir(ParamStrUTF8(0));
aDemFile:=CleanAndExpandDirectory(aDemFile)+'maskeditmasks.txt';
if FileExistsUTF8(aDemFile) then
LoadDEMFile(aDemFile);
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TMaskEditorForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TMaskEditorForm.LoadSampleMasksButtonClick(Sender: TObject);
begin
OpenDialog1.InitialDir:=ExtractFileDir(ParamStrUTF8(0));
@ -236,26 +267,6 @@ begin
end;
end;
procedure TMaskEditorForm.MaskEditorFormCreate(Sender: TObject);
var
aDemFile: string;
begin
LoadSampleMasksButton.Caption := oisMasks;
SaveLiteralCheckBox.Caption := oisSaveLiteralCharacters;
InputMaskLabel.Caption := oisInputMask;
SampleMasksLabel.Caption := oisSampleMasks;
CharactersForBlanksLabel.Caption := oisCharactersForBlanks;
TestInputLabel.Caption := oisTestInput;
if LazarusIDE<>nil then
aDemFile:=LazarusIDE.GetPrimaryConfigPath
else
aDemFile:=ExtractFileDir(ParamStrUTF8(0));
aDemFile:=CleanAndExpandDirectory(aDemFile)+'maskeditmasks.txt';
if FileExistsUTF8(aDemFile) then
LoadDEMFile(aDemFile);
end;
function TMaskEditorForm.GetEditMask: string;
begin
Result:=ConstructEditMask;

View File

@ -9,10 +9,11 @@ object NewFieldFrm: TNewFieldFrm
Caption = 'Dialog'
ClientHeight = 439
ClientWidth = 383
OnClose = FormClose
OnCreate = FormCreate
ParentFont = True
Position = poScreenCenter
LCLVersion = '1.5'
LCLVersion = '1.9.0.0'
object Panel2: TPanel
Left = 0
Height = 145
@ -30,14 +31,14 @@ object NewFieldFrm: TNewFieldFrm
Width = 365
Anchors = [akTop, akLeft, akRight]
Caption = 'Field properties'
ClientHeight = 115
ClientHeight = 105
ClientWidth = 361
TabOrder = 0
object Label1: TLabel
Left = 6
Height = 15
Top = 11
Width = 35
Width = 40
Caption = '&Name:'
FocusControl = EditName
ParentColor = False
@ -46,7 +47,7 @@ object NewFieldFrm: TNewFieldFrm
Left = 6
Height = 15
Top = 59
Width = 30
Width = 32
Caption = '&Type:'
FocusControl = SelectType
ParentColor = False
@ -55,14 +56,14 @@ object NewFieldFrm: TNewFieldFrm
Left = 6
Height = 15
Top = 83
Width = 25
Width = 29
Caption = '&Size:'
FocusControl = EditSize
ParentColor = False
end
object EditName: TEdit
Left = 158
Height = 25
Height = 29
Top = 8
Width = 168
OnChange = EditNameChange
@ -75,7 +76,7 @@ object NewFieldFrm: TNewFieldFrm
Height = 29
Top = 56
Width = 168
ItemHeight = 0
ItemHeight = 21
Items.Strings = (
'String'
'Integer'
@ -98,7 +99,7 @@ object NewFieldFrm: TNewFieldFrm
end
object EditSize: TEdit
Left = 158
Height = 25
Height = 29
Top = 80
Width = 168
Color = clBtnFace
@ -109,14 +110,14 @@ object NewFieldFrm: TNewFieldFrm
Left = 6
Height = 15
Top = 35
Width = 102
Width = 113
Caption = 'Co&mponent Name:'
FocusControl = EditCompName
ParentColor = False
end
object EditCompName: TEdit
Left = 158
Height = 25
Height = 29
Top = 32
Width = 168
OnChange = EditCompNameChange
@ -144,14 +145,14 @@ object NewFieldFrm: TNewFieldFrm
Width = 365
Anchors = [akTop, akLeft, akRight, akBottom]
Caption = 'Lookup definition'
ClientHeight = 112
ClientHeight = 102
ClientWidth = 361
TabOrder = 0
object Label4: TLabel
Left = 6
Height = 15
Top = 10
Width = 54
Width = 58
Caption = '&Key fields'
FocusControl = SelectKeyFields
ParentColor = False
@ -160,7 +161,7 @@ object NewFieldFrm: TNewFieldFrm
Left = 6
Height = 15
Top = 58
Width = 67
Width = 75
Caption = 'L&ookup keys'
FocusControl = SelectLookupKeys
ParentColor = False
@ -169,7 +170,7 @@ object NewFieldFrm: TNewFieldFrm
Left = 6
Height = 15
Top = 82
Width = 69
Width = 75
Caption = '&Result Fields'
FocusControl = SelectResultField
ParentColor = False
@ -178,16 +179,16 @@ object NewFieldFrm: TNewFieldFrm
Left = 6
Height = 15
Top = 34
Width = 43
Width = 47
Caption = 'Dataset'
ParentColor = False
end
object SelectKeyFields: TComboBox
Left = 158
Height = 27
Height = 29
Top = 7
Width = 168
ItemHeight = 0
ItemHeight = 21
OnChange = SelectKeyFieldsChange
ParentShowHint = False
ShowHint = True
@ -195,21 +196,21 @@ object NewFieldFrm: TNewFieldFrm
end
object SelectLookupKeys: TComboBox
Left = 158
Height = 27
Height = 29
Top = 55
Width = 168
Enabled = False
ItemHeight = 0
ItemHeight = 21
OnChange = SelectLookupKeysChange
TabOrder = 2
end
object SelectResultField: TComboBox
Left = 158
Height = 27
Height = 29
Top = 79
Width = 168
Enabled = False
ItemHeight = 0
ItemHeight = 21
OnChange = SelectResultFieldChange
TabOrder = 3
end
@ -218,7 +219,7 @@ object NewFieldFrm: TNewFieldFrm
Height = 29
Top = 31
Width = 168
ItemHeight = 0
ItemHeight = 15
OnChange = DataSetsComboChange
ParentShowHint = False
ShowHint = True
@ -266,7 +267,7 @@ object NewFieldFrm: TNewFieldFrm
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 3
ClientHeight = 31
ClientHeight = 21
ClientWidth = 365
Columns = 3
ItemIndex = 0
@ -281,8 +282,8 @@ object NewFieldFrm: TNewFieldFrm
end
object ButtonPanel1: TButtonPanel
Left = 6
Height = 36
Top = 397
Height = 35
Top = 398
Width = 371
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True

View File

@ -16,9 +16,11 @@ unit NewField;
interface
uses
Classes, Math, SysUtils, LCLIntf, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, Buttons, ButtonPanel, DB, ObjInspStrConsts,
ComponentEditors, PropEdits, PropEditUtils, TypInfo;
Classes, SysUtils, TypInfo, Math, DB,
// LCL
Forms, Dialogs, Graphics, Controls, ExtCtrls, StdCtrls, ButtonPanel,
// IdeIntf
ObjInspStrConsts, ComponentEditors, PropEdits, IDEWindowIntf;
type
@ -52,6 +54,7 @@ type
procedure DataSetsComboChange(Sender: TObject);
procedure EditCompNameChange(Sender: TObject);
procedure EditNameChange(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure OKBtnClick(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
procedure SelectKeyFieldsChange(Sender: TObject);
@ -120,21 +123,7 @@ begin
if F <> '' then AList.Add(F);
end;
function TNewFieldFrm.CreateField(fType: TFieldType; FName: string): TField;
begin
Result := Nil;
if DefaultFieldClasses[fType] <> Nil then begin
Result := DefaultFieldClasses[fType].Create(LinkDataSet.Owner);
Result.FieldName := fName;
Result.Name := PersistentName;
try
if (EditSize.Enabled) and (Trim(EditSize.Text)<> '') then
Result.Size := StrToInt(EditSize.Text);
except
end;
Result.DataSet := LinkDataSet;
end;
end;
{ TNewFieldFrm }
constructor TNewFieldFrm.Create(AOwner: TComponent; ADataset: TDataset;
ADesigner: TComponentEditorDesigner);
@ -147,26 +136,11 @@ begin
UpdateLookupDatasets(Self);
end;
procedure TNewFieldFrm.DataSetsComboChange(Sender: TObject);
destructor TNewFieldFrm.Destroy;
begin
UpdateResultFields;
SetButtons;
end ;
procedure TNewFieldFrm.EditCompNameChange(Sender: TObject);
begin
SetButtons;
inherited Destroy;
end;
procedure TNewFieldFrm.EditNameChange(Sender: TObject);
begin
if Trim(EditName.Text) <> '' then
PersistentName := CreateFieldName(LinkDataset.Name + EditName.Text)
else
PersistentName := '';
SetButtons;
end ;
procedure TNewFieldFrm.FormCreate(Sender: TObject);
var i: integer;
begin
@ -212,8 +186,50 @@ begin
RadioGroup1.ItemIndex := 0;
RadioGroup1Click(Nil);
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TNewFieldFrm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
function TNewFieldFrm.CreateField(fType: TFieldType; FName: string): TField;
begin
Result := Nil;
if DefaultFieldClasses[fType] <> Nil then begin
Result := DefaultFieldClasses[fType].Create(LinkDataSet.Owner);
Result.FieldName := fName;
Result.Name := PersistentName;
try
if (EditSize.Enabled) and (Trim(EditSize.Text)<> '') then
Result.Size := StrToInt(EditSize.Text);
except
end;
Result.DataSet := LinkDataSet;
end;
end;
procedure TNewFieldFrm.DataSetsComboChange(Sender: TObject);
begin
UpdateResultFields;
SetButtons;
end ;
procedure TNewFieldFrm.EditCompNameChange(Sender: TObject);
begin
SetButtons;
end;
procedure TNewFieldFrm.EditNameChange(Sender: TObject);
begin
if Trim(EditName.Text) <> '' then
PersistentName := CreateFieldName(LinkDataset.Name + EditName.Text)
else
PersistentName := '';
SetButtons;
end ;
procedure TNewFieldFrm.UpdateLookupDatasets(Sender: TObject);
var
sText: string;
@ -476,11 +492,6 @@ begin
Result := False;
end;
destructor TNewFieldFrm.Destroy;
begin
inherited Destroy;
end;
function TNewFieldFrm.CreateFieldName(BaseName: String): String ;
var
i: integer;

View File

@ -10,21 +10,22 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
ClientWidth = 635
Constraints.MinHeight = 240
Constraints.MinWidth = 400
OnClose = FormClose
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '1.1'
LCLVersion = '1.9.0.0'
object GroupBox1: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideBottom.Control = BtnOK
Left = 6
Height = 273
Height = 276
Top = 6
Width = 420
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
Caption = 'Items'
ClientHeight = 253
ClientHeight = 249
ClientWidth = 416
TabOrder = 0
object TreeView1: TTreeView
@ -33,7 +34,7 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideBottom.Control = GroupBox1
AnchorSideBottom.Side = asrBottom
Left = 5
Height = 243
Height = 239
Top = 5
Width = 240
Anchors = [akTop, akLeft, akRight, akBottom]
@ -167,22 +168,22 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = BtnOK
Left = 432
Height = 273
Height = 276
Top = 6
Width = 197
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
Caption = 'Item Properties'
ClientHeight = 253
ClientHeight = 249
ClientWidth = 193
TabOrder = 1
object LabelText: TLabel
AnchorSideLeft.Control = GroupBox2
AnchorSideTop.Control = GroupBox2
Left = 6
Height = 18
Height = 15
Top = 6
Width = 37
Width = 29
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'Text:'
@ -194,9 +195,9 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideTop.Control = edtText
AnchorSideTop.Side = asrBottom
Left = 6
Height = 18
Height = 15
Top = 58
Width = 95
Width = 79
BorderSpacing.Top = 6
Caption = 'Image Index:'
FocusControl = edtIndexImg
@ -207,9 +208,9 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideTop.Control = edtIndexImg
AnchorSideTop.Side = asrBottom
Left = 6
Height = 18
Height = 15
Top = 110
Width = 113
Width = 93
BorderSpacing.Top = 6
Caption = 'Selected index:'
FocusControl = edtIndexSel
@ -220,9 +221,9 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideTop.Control = edtIndexSel
AnchorSideTop.Side = asrBottom
Left = 6
Height = 18
Height = 15
Top = 162
Width = 90
Width = 73
BorderSpacing.Top = 6
Caption = 'State Index:'
FocusControl = edtIndexState
@ -235,8 +236,8 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideRight.Control = GroupBox2
AnchorSideRight.Side = asrBottom
Left = 6
Height = 26
Top = 26
Height = 29
Top = 23
Width = 182
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 2
@ -249,8 +250,8 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideTop.Control = LabelImageIndex
AnchorSideTop.Side = asrBottom
Left = 6
Height = 26
Top = 78
Height = 29
Top = 75
Width = 48
BorderSpacing.Top = 2
OnEditingDone = edtIndexStateEditingDone
@ -261,8 +262,8 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideTop.Control = LabelSelectedIndex
AnchorSideTop.Side = asrBottom
Left = 6
Height = 26
Top = 130
Height = 29
Top = 127
Width = 48
BorderSpacing.Top = 2
OnEditingDone = edtIndexStateEditingDone
@ -273,8 +274,8 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideTop.Control = LabelStateIndex
AnchorSideTop.Side = asrBottom
Left = 6
Height = 26
Top = 182
Height = 29
Top = 179
Width = 48
BorderSpacing.Top = 2
OnEditingDone = edtIndexStateEditingDone
@ -285,9 +286,9 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideRight.Control = BtnCancel
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 304
Height = 30
Top = 285
Left = 303
Height = 27
Top = 288
Width = 75
Anchors = [akRight, akBottom]
AutoSize = True
@ -303,10 +304,10 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideRight.Control = BtnApply
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 385
Height = 30
Top = 285
Width = 82
Left = 384
Height = 27
Top = 288
Width = 83
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
@ -323,8 +324,8 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 473
Height = 28
Top = 287
Height = 26
Top = 289
Width = 75
Anchors = [akRight, akBottom]
AutoSize = True
@ -341,8 +342,8 @@ object TreeViewItemsEditorForm: TTreeViewItemsEditorForm
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 554
Height = 32
Top = 283
Height = 27
Top = 288
Width = 75
Anchors = [akRight, akBottom]
AutoSize = True

View File

@ -18,9 +18,11 @@ unit TreeViewPropEdit;
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Buttons,
PropEdits, Componenteditors, StdCtrls, ComCtrls, IDEImagesIntf,
ObjInspStrConsts, ExtCtrls;
Classes, SysUtils,
// LCL
Forms, Dialogs, Buttons, Controls, StdCtrls, ComCtrls,
// IdeIntf
PropEdits, Componenteditors, ObjInspStrConsts, IDEImagesIntf, IDEWindowIntf;
type
@ -53,6 +55,7 @@ type
TreeView1: TTreeView;
procedure BtnNewItemClick(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure MoveUpBtnClick(Sender: TObject);
procedure MoveDownBtnClick(Sender: TObject);
@ -109,28 +112,6 @@ end;
{ TTreeViewItemsEditorForm }
procedure TTreeViewItemsEditorForm.BtnNewItemClick(Sender: TObject);
var
S: String;
begin
S := sccsTrEdtItem + IntToStr(TreeView1.Items.Count);
if (Sender as TComponent).Tag = 1 then
TreeView1.Selected := TreeView1.Items.Add(TreeView1.Selected, S)
else
TreeView1.Selected := TreeView1.Items.AddChild(TreeView1.Selected, S);
GroupBox2.Enabled := TreeView1.Items.Count > 0;
edtText.SetFocus;
edtText.SelectAll;
end;
procedure TTreeViewItemsEditorForm.Edit1Change(Sender: TObject);
begin
if Assigned(TreeView1.Selected) then
TreeView1.Selected.Text := edtText.Text;
end;
procedure TTreeViewItemsEditorForm.FormCreate(Sender: TObject);
begin
Caption := sccsTrEdtCaption;
@ -152,9 +133,38 @@ begin
LabelImageIndex.Caption := sccsTrEdtLabelImageIndex;
LabelSelectedIndex.Caption := sccsTrEdtLabelSelIndex;
LabelStateIndex.Caption := sccsTrEdtLabelStateIndex;
OpenDialog1.Title := sccsTrEdtOpenDialog;
SaveDialog1.Title := sccsTrEdtSaveDialog;
IDEDialogLayoutList.ApplyLayout(Self);
end;
procedure TTreeViewItemsEditorForm.FormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
IDEDialogLayoutList.SaveLayout(Self);
end;
procedure TTreeViewItemsEditorForm.BtnNewItemClick(Sender: TObject);
var
S: String;
begin
S := sccsTrEdtItem + IntToStr(TreeView1.Items.Count);
if (Sender as TComponent).Tag = 1 then
TreeView1.Selected := TreeView1.Items.Add(TreeView1.Selected, S)
else
TreeView1.Selected := TreeView1.Items.AddChild(TreeView1.Selected, S);
GroupBox2.Enabled := TreeView1.Items.Count > 0;
edtText.SetFocus;
edtText.SelectAll;
end;
procedure TTreeViewItemsEditorForm.Edit1Change(Sender: TObject);
begin
if Assigned(TreeView1.Selected) then
TreeView1.Selected.Text := edtText.Text;
end;
procedure TTreeViewItemsEditorForm.MoveUpBtnClick(Sender: TObject);