focus fixes, reduced lpi size

git-svn-id: trunk@3749 -
This commit is contained in:
mattias 2002-12-28 12:42:38 +00:00
parent c36de31dd9
commit 3a628d7a0e
4 changed files with 55 additions and 13 deletions

View File

@ -63,7 +63,7 @@ type
FDebugger: TDebugger; FDebugger: TDebugger;
public public
constructor Create(AOWner: TComponent; const AWatch: TDBGWatch; constructor Create(AOWner: TComponent; const AWatch: TDBGWatch;
const ADebugger: TDebugger); //reintroduce; const ADebugger: TDebugger); overload;
destructor Destroy; override; destructor Destroy; override;
published published
// publish some properties until fpcbug #1888 is fixed // publish some properties until fpcbug #1888 is fixed

View File

@ -575,26 +575,26 @@ end;
procedure TUnitInfo.SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string); procedure TUnitInfo.SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
var AFilename:string; var AFilename:string;
begin begin
XMLConfig.SetValue(Path+'CursorPos/X',fCursorPos.X); XMLConfig.SetDeleteValue(Path+'CursorPos/X',fCursorPos.X,-1);
XMLConfig.SetValue(Path+'CursorPos/Y',fCursorPos.Y); XMLConfig.SetDeleteValue(Path+'CursorPos/Y',fCursorPos.Y,-1);
XMLConfig.SetValue(Path+'EditorIndex/Value',fEditorIndex); XMLConfig.SetDeleteValue(Path+'EditorIndex/Value',fEditorIndex,-1);
AFilename:=Filename; AFilename:=Filename;
if Assigned(fOnLoadSaveFilename) then if Assigned(fOnLoadSaveFilename) then
fOnLoadSaveFilename(AFilename,false); fOnLoadSaveFilename(AFilename,false);
XMLConfig.SetValue(Path+'Filename/Value',AFilename); XMLConfig.SetValue(Path+'Filename/Value',AFilename);
XMLConfig.SetValue(Path+'FormName/Value',fFormName); XMLConfig.SetDeleteValue(Path+'FormName/Value',fFormName,'');
XMLConfig.SetValue(Path+'HasResources/Value',fHasResources); XMLConfig.SetDeleteValue(Path+'HasResources/Value',fHasResources,false);
XMLConfig.SetValue(Path+'IsPartOfProject/Value',fIsPartOfProject); XMLConfig.SetDeleteValue(Path+'IsPartOfProject/Value',fIsPartOfProject,false);
XMLConfig.SetValue(Path+'Loaded/Value',fLoaded); XMLConfig.SetDeleteValue(Path+'Loaded/Value',fLoaded,false);
XMLConfig.SetValue(Path+'ReadOnly/Value',fReadOnly); XMLConfig.SetDeleteValue(Path+'ReadOnly/Value',fReadOnly,false);
AFilename:=FResourceFilename; AFilename:=FResourceFilename;
if Assigned(fOnLoadSaveFilename) then if Assigned(fOnLoadSaveFilename) then
fOnLoadSaveFilename(AFilename,false); fOnLoadSaveFilename(AFilename,false);
XMLConfig.SetValue(Path+'ResourceFilename/Value',AFilename); XMLConfig.SetDeleteValue(Path+'ResourceFilename/Value',AFilename,'');
XMLConfig.SetValue(Path+'SyntaxHighlighter/Value' XMLConfig.SetValue(Path+'SyntaxHighlighter/Value'
,LazSyntaxHighlighterNames[fSyntaxHighlighter]); ,LazSyntaxHighlighterNames[fSyntaxHighlighter]);
XMLConfig.SetValue(Path+'TopLine/Value',fTopLine); XMLConfig.SetDeleteValue(Path+'TopLine/Value',fTopLine,-1);
XMLConfig.SetValue(Path+'UnitName/Value',fUnitName); XMLConfig.SetDeleteValue(Path+'UnitName/Value',fUnitName,'');
fBreakpoints.SaveToXMLConfig(XMLConfig,Path); fBreakpoints.SaveToXMLConfig(XMLConfig,Path);
end; end;
@ -2101,6 +2101,9 @@ end.
{ {
$Log$ $Log$
Revision 1.87 2002/12/28 12:42:38 mattias
focus fixes, reduced lpi size
Revision 1.86 2002/11/16 13:56:20 mattias Revision 1.86 2002/11/16 13:56:20 mattias
project now notices, if compiler options changed project now notices, if compiler options changed

View File

@ -265,6 +265,7 @@ type
procedure CloseModal; procedure CloseModal;
procedure DoCreate; procedure DoCreate;
procedure DoDestroy; procedure DoDestroy;
procedure SetActive(AValue: Boolean);
procedure SetActiveControl(AWinControl: TWinControl); procedure SetActiveControl(AWinControl: TWinControl);
procedure SetBorderStyle(Value : TFORMBorderStyle); procedure SetBorderStyle(Value : TFORMBorderStyle);
procedure SetDesigner(Value : TIDesigner); procedure SetDesigner(Value : TIDesigner);

View File

@ -225,7 +225,8 @@ Procedure TCustomForm.SetFocus;
Begin Begin
//writeln('[TCustomForm.SetFocus] A ',Classname); //writeln('[TCustomForm.SetFocus] A ',Classname);
//if not(Visible and Enabled) then Exit; //if not(Visible and Enabled) then Exit;
CNSendMessage(LM_SETFOCUS,Self,nil); if HandleAllocated then
CNSendMessage(LM_SETFOCUS,Self,nil);
//writeln('[TCustomForm.SetFocus] END ',Classname); //writeln('[TCustomForm.SetFocus] END ',Classname);
end; end;
@ -259,6 +260,11 @@ begin
NewFocusControl := FActiveControl NewFocusControl := FActiveControl
else else
NewFocusControl := Self; NewFocusControl := Self;
{$IFDEF VerboseFocus}
writeln('TCustomForm.SetWindowFocus ',Name,':',Classname ,
' NewFocusControl=',NewFocusControl.Name,':',NewFocusControl.ClassName,
' HndAlloc=',NewFocusControl.HandleAllocated);
{$ENDIF}
if not NewFocusControl.HandleAllocated then exit; if not NewFocusControl.HandleAllocated then exit;
LCLLinux.SetFocus(NewFocusControl.Handle); LCLLinux.SetFocus(NewFocusControl.Handle);
if GetFocus = NewFocusControl.Handle then if GetFocus = NewFocusControl.Handle then
@ -303,6 +309,11 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TCustomForm.WMActivate(var Message : TLMActivate); procedure TCustomForm.WMActivate(var Message : TLMActivate);
begin begin
{$IFDEF VerboseFocus}
writeln('TCustomForm.WMActivate ',Name,':',ClassName,' ',Message.Active);
{$ENDIF}
if (FormStyle <> fsMDIForm) or (csDesigning in ComponentState) then
SetActive(Message.Active {<> WA_INACTIVE});
Activate; Activate;
end; end;
@ -435,6 +446,23 @@ begin
if Assigned(FOnDestroy) then FOnDestroy(Self); if Assigned(FOnDestroy) then FOnDestroy(Self);
end; end;
{------------------------------------------------------------------------------
procedure TCustomForm.SetActive(AValue: Boolean);
------------------------------------------------------------------------------}
procedure TCustomForm.SetActive(AValue: Boolean);
begin
FActive := AValue;
//if FActiveOleControl <> nil then
// FActiveOleControl.Perform(CM_DOCWINDOWACTIVATE, Ord(Value), 0);
if FActive then
begin
if (ActiveControl = nil) and not (csDesigning in ComponentState) then
ActiveControl := FindNextControl(nil, True, True, False);
//MergeMenu(True);
SetWindowFocus;
end;
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
Method: TCustomForm.DoHide Method: TCustomForm.DoHide
Params: none Params: none
@ -768,6 +796,13 @@ Begin
RaiseGDBException(SCannotFocus); RaiseGDBException(SCannotFocus);
// EInvalidOperation.Create(SCannotFocus); // EInvalidOperation.Create(SCannotFocus);
FActiveControl := AWinControl; FActiveControl := AWinControl;
{$IFDEF VerboseFocus}
write('TCustomForm.SetActiveControl ',Name,':',ClassName,' ');
if FActiveControl<>nil then
writeln('FActiveControl=',FActiveControl.Name,':',FActiveControl.ClassName)
else
writeln('FActiveControl=nil');
{$ENDIF}
if not (csLoading in ComponentState) then if not (csLoading in ComponentState) then
begin begin
if FActive then SetWindowFocus; if FActive then SetWindowFocus;
@ -1225,6 +1260,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.80 2002/12/28 12:42:38 mattias
focus fixes, reduced lpi size
Revision 1.79 2002/12/28 11:29:47 mattias Revision 1.79 2002/12/28 11:29:47 mattias
xmlcfg deletion, focus fixes xmlcfg deletion, focus fixes