fixed sending TButtonControl.OnClick on every change

git-svn-id: trunk@3960 -
This commit is contained in:
mattias 2003-03-25 16:29:53 +00:00
parent fa65a6108c
commit 30f6586797
4 changed files with 47 additions and 17 deletions

View File

@ -650,7 +650,8 @@ begin
// windows // windows
InitLayoutList; InitLayoutList;
FIDEDialogLayoutList:=TIDEDialogLayoutList.Create; FIDEDialogLayoutList:=TIDEDialogLayoutList.Create;
IDEOptionDefs.IDEDialogLayoutList:=FIDEDialogLayoutList; if IDEOptionDefs.IDEDialogLayoutList=nil then
IDEOptionDefs.IDEDialogLayoutList:=FIDEDialogLayoutList;
FMinimizeAllOnMinimizeMain:=false; FMinimizeAllOnMinimizeMain:=false;
// form editor // form editor
@ -732,8 +733,9 @@ begin
FFPCSourceDirHistory.Free; FFPCSourceDirHistory.Free;
FDebuggerFileHistory.Free; FDebuggerFileHistory.Free;
FTestBuildDirHistory.Free; FTestBuildDirHistory.Free;
if IDEOptionDefs.IDEDialogLayoutList=FIDEDialogLayoutList then
IDEOptionDefs.IDEDialogLayoutList:=nil;
FIDEDialogLayoutList.Free; FIDEDialogLayoutList.Free;
IDEOptionDefs.IDEDialogLayoutList:=nil;
fIDEWindowLayoutList.Free; fIDEWindowLayoutList.Free;
FXMLCfg.Free; FXMLCfg.Free;
inherited Destroy; inherited Destroy;
@ -3197,8 +3199,9 @@ begin
end; end;
InputHistories.StoreFileDialogSettings(SaveDialog); InputHistories.StoreFileDialogSettings(SaveDialog);
except except
// ToDo on E: Exception do begin
writeln('ERROR: [TEnvironmentOptionsDialog.SaveDesktopSettingsToFileButtonClick]'); writeln('ERROR: [TEnvironmentOptionsDialog.SaveDesktopSettingsToFileButtonClick] ',E.Message);
end;
end; end;
finally finally
SaveDialog.Free; SaveDialog.Free;

View File

@ -274,8 +274,8 @@ type
property Items[Index: integer]: TIDEDialogLayout read GetItems; property Items[Index: integer]: TIDEDialogLayout read GetItems;
end; end;
const var
IDEDialogLayoutList: TIDEDialogLayoutList = nil; IDEDialogLayoutList: TIDEDialogLayoutList;
implementation implementation
@ -1062,5 +1062,8 @@ begin
Items[i].SaveToXMLConfig(XMLConfig,Path+'/Dialog'+IntToStr(i+1)); Items[i].SaveToXMLConfig(XMLConfig,Path+'/Dialog'+IntToStr(i+1));
end; end;
initialization
IDEDialogLayoutList:=nil;
end. end.

View File

@ -133,7 +133,7 @@ begin
if FState <> OldState then if FState <> OldState then
begin begin
ApplyChanges; ApplyChanges;
Click; if not ClicksDisabled then Click;
end; end;
end; end;
@ -146,10 +146,7 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TCustomCheckBox.Toggle; procedure TCustomCheckBox.Toggle;
begin begin
if GetChecked then SetChecked(not GetChecked);
SetChecked(False)
else
SetChecked(True);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -166,6 +163,18 @@ begin
end; end;
end; end;
{------------------------------------------------------------------------------
procedure TCustomCheckBox.Click;
------------------------------------------------------------------------------}
procedure TCustomCheckBox.Click;
begin
inherited Changed;
inherited Click;
end;
{------------------------------------------------------------------------------
procedure TCustomCheckBox.SetText(const Value: TCaption);
------------------------------------------------------------------------------}
procedure TCustomCheckBox.SetText(const Value: TCaption); procedure TCustomCheckBox.SetText(const Value: TCaption);
var var
ParseStr : String; ParseStr : String;
@ -186,6 +195,9 @@ begin
end; end;
{ {
$Log$ $Log$
Revision 1.12 2003/03/25 16:29:53 mattias
fixed sending TButtonControl.OnClick on every change
Revision 1.11 2003/03/17 20:50:30 mattias Revision 1.11 2003/03/17 20:50:30 mattias
fixed TRadioGroup.ItemIndex=-1 fixed TRadioGroup.ItemIndex=-1

View File

@ -643,16 +643,19 @@ type
procedure SetChecked(Value: Boolean); override; procedure SetChecked(Value: Boolean); override;
procedure SetText(const Value: TCaption); override; procedure SetText(const Value: TCaption); override;
procedure ApplyChanges; virtual; procedure ApplyChanges; virtual;
property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed; procedure Click; override;
property State: TCheckBoxState read GetState write SetState;
public public
constructor Create(TheOwner: TComponent); override; constructor Create(TheOwner: TComponent); override;
public
property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed;
property State: TCheckBoxState read GetState write SetState;
published published
property TabOrder; property TabOrder;
property TabStop; property TabStop;
end; end;
{$IFNDef NewCheckBox} {$IFNDef NewCheckBox}
// Normal checkbox
TCheckBox = class(TCustomCheckBox) TCheckBox = class(TCustomCheckBox)
protected protected
procedure DoAutoSize; Override; procedure DoAutoSize; Override;
@ -689,6 +692,7 @@ type
property OnStartDrag; property OnStartDrag;
end; end;
{$Else NewCheckBox} {$Else NewCheckBox}
// new checkbox
TCBAlignment = (alLeftJustify, alRightJustify); TCBAlignment = (alLeftJustify, alRightJustify);
TCheckBoxStyle = (cbsSystem, cbsCrissCross, cbsCheck); TCheckBoxStyle = (cbsSystem, cbsCrissCross, cbsCheck);
@ -741,8 +745,6 @@ type
property Align; property Align;
Property AutoSize; Property AutoSize;
property WordWrap : Boolean read FWordWrap write FWordWrap; property WordWrap : Boolean read FWordWrap write FWordWrap;
//property OnMouseEnter;
//property OnMouseExit;
property TabStop; property TabStop;
property Anchors; property Anchors;
@ -751,6 +753,8 @@ type
property Font; property Font;
property OnClick; property OnClick;
property OnDblClick; property OnDblClick;
property OnEnter;
property OnExit;
property OnKeyDown; property OnKeyDown;
property OnKeyUp; property OnKeyUp;
property OnKeyPress; property OnKeyPress;
@ -769,6 +773,9 @@ type
end; end;
{$EndIf NewCheckBox} {$EndIf NewCheckBox}
{ TToggleBox }
TToggleBox = class(TCustomCheckBox) TToggleBox = class(TCustomCheckBox)
private private
public public
@ -803,7 +810,7 @@ type
end; end;
{TRadioButton} { TRadioButton }
TRadioButton = class(TCustomCheckBox) TRadioButton = class(TCustomCheckBox)
protected protected
@ -841,7 +848,9 @@ type
property OnStartDrag; property OnStartDrag;
end; end;
{TStaticText}
{ TStaticText }
TStaticBorderStyle = (sbsNone, sbsSingle, sbsSunken); TStaticBorderStyle = (sbsNone, sbsSingle, sbsSunken);
TCustomStaticText = class(TCustomControl) TCustomStaticText = class(TCustomControl)
@ -1395,6 +1404,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.83 2003/03/25 16:29:53 mattias
fixed sending TButtonControl.OnClick on every change
Revision 1.82 2003/03/17 20:53:16 mattias Revision 1.82 2003/03/17 20:53:16 mattias
removed SetRadioButtonGroupMode removed SetRadioButtonGroupMode