Revert "IDE: Build mode dialog revamp". Commit by mistake

git-svn-id: trunk@39303 -
This commit is contained in:
juha 2012-11-18 16:07:03 +00:00
parent 9f051d112c
commit d38f2da57d
3 changed files with 29 additions and 61 deletions

View File

@ -19,16 +19,16 @@ object BuildModesForm: TBuildModesForm
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'BuildModesGroupBox' Caption = 'BuildModesGroupBox'
ClientHeight = 286 ClientHeight = 288
ClientWidth = 592 ClientWidth = 596
TabOrder = 0 TabOrder = 0
object BuildModesStringGrid: TStringGrid object BuildModesStringGrid: TStringGrid
AnchorSideTop.Control = BuildModeAddSpeedButton AnchorSideTop.Control = BuildModeAddSpeedButton
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 0 Left = 0
Height = 264 Height = 266
Top = 22 Top = 22
Width = 592 Width = 596
Align = alBottom Align = alBottom
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
AutoFillColumns = True AutoFillColumns = True
@ -38,19 +38,19 @@ object BuildModesForm: TBuildModesForm
ButtonStyle = cbsCheckboxColumn ButtonStyle = cbsCheckboxColumn
MaxSize = 50 MaxSize = 50
Title.Caption = 'Active' Title.Caption = 'Active'
Width = 196 Width = 197
end end
item item
ButtonStyle = cbsCheckboxColumn ButtonStyle = cbsCheckboxColumn
MaxSize = 50 MaxSize = 50
Title.Caption = 'InSession' Title.Caption = 'InSession'
Width = 196 Width = 197
end end
item item
MaxSize = 500 MaxSize = 500
SizePriority = 100 SizePriority = 100
Title.Caption = 'Title' Title.Caption = 'Title'
Width = 196 Width = 198
end> end>
FixedCols = 0 FixedCols = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll] Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll]
@ -59,9 +59,9 @@ object BuildModesForm: TBuildModesForm
OnSelection = BuildModesStringGridSelection OnSelection = BuildModesStringGridSelection
OnValidateEntry = BuildModesStringGridValidateEntry OnValidateEntry = BuildModesStringGridValidateEntry
ColWidths = ( ColWidths = (
196 197
196 197
196 198
) )
end end
object BuildModeAddSpeedButton: TSpeedButton object BuildModeAddSpeedButton: TSpeedButton
@ -127,19 +127,17 @@ object BuildModesForm: TBuildModesForm
end end
object ButtonPanel1: TButtonPanel object ButtonPanel1: TButtonPanel
Left = 6 Left = 6
Height = 41 Height = 38
Top = 319 Top = 322
Width = 600 Width = 600
OKButton.Name = 'OKButton' OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True OKButton.DefaultCaption = True
OKButton.OnClick = OKButtonClick
HelpButton.Name = 'HelpButton' HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton' CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton' CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True CancelButton.DefaultCaption = True
CancelButton.OnClick = CancelButtonClick
TabOrder = 1 TabOrder = 1
ShowButtons = [pbOK, pbCancel, pbHelp] ShowButtons = [pbOK, pbCancel, pbHelp]
end end

View File

@ -26,7 +26,6 @@ type
BuildModesPopupMenu: TPopupMenu; BuildModesPopupMenu: TPopupMenu;
BuildModesStringGrid: TStringGrid; BuildModesStringGrid: TStringGrid;
ButtonPanel1: TButtonPanel; ButtonPanel1: TButtonPanel;
procedure CancelButtonClick(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure BuildModeDiffSpeedButtonClick(Sender: TObject); procedure BuildModeDiffSpeedButtonClick(Sender: TObject);
@ -41,11 +40,9 @@ type
procedure BuildModesStringGridValidateEntry(Sender: TObject; procedure BuildModesStringGridValidateEntry(Sender: TObject;
aCol, aRow: Integer; const OldValue: string; var NewValue: String); aCol, aRow: Integer; const OldValue: string; var NewValue: String);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure OKButtonClick(Sender: TObject);
private private
// FOnLoadOptionsHook: TOnLoadIDEOptions; FOnLoadOptionsHook: TOnLoadIDEOptions;
// FOnSaveOptionsHook: TOnSaveIDEOptions; FOnSaveOptionsHook: TOnSaveIDEOptions;
fBuildModes: TProjectBuildModes;
FLoadShowSessionFromProject: boolean; FLoadShowSessionFromProject: boolean;
FProject: TProject; FProject: TProject;
FShowSession: boolean; FShowSession: boolean;
@ -67,33 +64,17 @@ type
write FLoadShowSessionFromProject; write FLoadShowSessionFromProject;
function GetSelectedBuildMode: TProjectBuildMode; function GetSelectedBuildMode: TProjectBuildMode;
public public
// property OnLoadIDEOptionsHook: TOnLoadIDEOptions read FOnLoadOptionsHook write FOnLoadOptionsHook; property OnLoadIDEOptionsHook: TOnLoadIDEOptions read FOnLoadOptionsHook write FOnLoadOptionsHook;
// property OnSaveIDEOptionsHook: TOnSaveIDEOptions read FOnSaveOptionsHook write FOnSaveOptionsHook; property OnSaveIDEOptionsHook: TOnSaveIDEOptions read FOnSaveOptionsHook write FOnSaveOptionsHook;
end; end;
function ShowBuildModesDlg(ABuildModes: TProjectBuildModes): TModalResult; var
BuildModesForm: TBuildModesForm;
implementation implementation
{$R *.lfm} {$R *.lfm}
function ShowBuildModesDlg(ABuildModes: TProjectBuildModes): TModalResult;
var
BuildModesForm: TBuildModesForm;
begin
Result := mrCancel;
BuildModesForm := TBuildModesForm.Create(nil);
try
BuildModesForm.fBuildModes.Assign(ABuildModes); // Copy to dialog.
Result := BuildModesForm.ShowModal;
if Result = mrOk then
ABuildModes.Assign(BuildModesForm.fBuildModes); // Copy back from dialog.
finally
BuildModesForm.Free;
end;
end;
{ TBuildModesForm } { TBuildModesForm }
procedure TBuildModesForm.FormCreate(Sender: TObject); procedure TBuildModesForm.FormCreate(Sender: TObject);
@ -131,12 +112,12 @@ begin
FSwitchingMode:=true; FSwitchingMode:=true;
try try
// save changes // save changes
// OnSaveIDEOptionsHook(Self,FProject.CompilerOptions); OnSaveIDEOptionsHook(Self,FProject.CompilerOptions);
// show diff dialog // show diff dialog
ShowBuildModeDiffDialog(GetSelectedBuildMode); ShowBuildModeDiffDialog(GetSelectedBuildMode);
IncreaseBuildMacroChangeStamp; IncreaseBuildMacroChangeStamp;
// load options // load options
// OnLoadIDEOptionsHook(Self,FProject.CompilerOptions); OnLoadIDEOptionsHook(Self,FProject.CompilerOptions);
finally finally
FSwitchingMode:=false; FSwitchingMode:=false;
end; end;
@ -395,12 +376,12 @@ begin
FSwitchingMode:=true; FSwitchingMode:=true;
try try
// save changes // save changes
// OnSaveIDEOptionsHook(Self,FProject.CompilerOptions); OnSaveIDEOptionsHook(Self,FProject.CompilerOptions);
// switch // switch
FProject.ActiveBuildMode:=aMode; FProject.ActiveBuildMode:=aMode;
IncreaseBuildMacroChangeStamp; IncreaseBuildMacroChangeStamp;
// load options // load options
// OnLoadIDEOptionsHook(Self,FProject.CompilerOptions); OnLoadIDEOptionsHook(Self,FProject.CompilerOptions);
finally finally
FSwitchingMode:=false; FSwitchingMode:=false;
end; end;
@ -481,15 +462,5 @@ begin
Result:=FProject.BuildModes[i]; Result:=FProject.BuildModes[i];
end; end;
procedure TBuildModesForm.OKButtonClick(Sender: TObject);
begin
;
end;
procedure TBuildModesForm.CancelButtonClick(Sender: TObject);
begin
;
end;
end. end.

View File

@ -39,7 +39,7 @@ uses
{$ELSE} {$ELSE}
BuildModesEditor, BuildModesEditor,
{$ENDIF} {$ENDIF}
Project; ProjectIntf;
type type
TIDEOptsDlgAction = ( TIDEOptsDlgAction = (
@ -216,11 +216,11 @@ var
{$ENDIF} {$ENDIF}
begin begin
{$IFDEF NewBuildModeWindow} {$IFDEF NewBuildModeWindow}
{ BuildModesForm := TBuildModesForm.Create(nil); BuildModesForm := TBuildModesForm.Create(nil);
try try
BuildModesForm.OnLoadIDEOptionsHook := @LoadIDEOptions; BuildModesForm.OnLoadIDEOptionsHook := @LoadIDEOptions;
BuildModesForm.OnSaveIDEOptionsHook := @SaveIDEOptions; BuildModesForm.OnSaveIDEOptionsHook := @SaveIDEOptions;
Does not really work (?) { Does not really work (?)
ProjectSaveOptions:=Nil; ProjectSaveOptions:=Nil;
Rec := IDEEditorGroups.GetByIndex(GroupProject); Rec := IDEEditorGroups.GetByIndex(GroupProject);
if Rec <> nil then if Rec <> nil then
@ -237,16 +237,15 @@ begin
BuildModesForm.LoadShowSessionFromProject:=false; BuildModesForm.LoadShowSessionFromProject:=false;
BuildModesForm.ShowSession:=ProjectSaveOptions.GetSessionLocation in [pssInIDEConfig,pssInProjectDir]; BuildModesForm.ShowSession:=ProjectSaveOptions.GetSessionLocation in [pssInIDEConfig,pssInProjectDir];
end; end;
}
BuildModesForm.LoadShowSessionFromProject:=false; BuildModesForm.LoadShowSessionFromProject:=false;
BuildModesForm.ShowSession:=True; BuildModesForm.ShowSession:=True;
if BuildModesForm.ShowModal = mrOK then begin end; if BuildModesForm.ShowModal = mrOK then begin
;
end;
finally finally
BuildModesForm.Free; BuildModesForm.Free;
end; end;
}
if ShowBuildModesDlg(Project1.BuildModes) = mrOK then begin
;
end;
{$ENDIF} {$ENDIF}
end; end;