Changes to facilitate the toggle between form and unit

Shane

git-svn-id: trunk@418 -
This commit is contained in:
lazarus 2001-11-13 18:50:10 +00:00
parent b3dd5353c5
commit 5b266eec73
4 changed files with 45 additions and 3 deletions

View File

@ -206,6 +206,7 @@ type
Procedure OnSrcNotebookFileClose(Sender : TObject);
Procedure OnSrcNotebookSaveAll(Sender : TObject);
Procedure OnSrcNotebookToggleFormUnit(Sender : TObject);
Procedure OnSrcNotebookEditorVisibleChanged(Sender : TObject);
Procedure OnSrcNotebookProcessCommand(Sender: TObject; Command: integer;
var Handled: boolean);
procedure OnSrcNoteBookShowUnitInfo(Sender: TObject);
@ -570,6 +571,8 @@ begin
SourceNotebook.OnToggleFormUnitClicked := @OnSrcNotebookToggleFormUnit;
SourceNotebook.OnProcessUserCommand := @OnSrcNotebookProcessCommand;
SourceNotebook.OnShowUnitInfo := @OnSrcNoteBookShowUnitInfo;
SourceNotebook.OnEditorVisibleChanged := @OnSrcNotebookEditorVisibleChanged;
// find / replace dialog
itmSearchFind.OnClick := @SourceNotebook.FindClicked;
@ -1246,7 +1249,6 @@ end;
Procedure TMainIDE.mnuToggleFormUnitClicked(Sender : TObject);
Begin
writeln('Toggle form clicked');
FCodeLastActivated:=not FCodeLastActivated;
DoBringToFrontFormOrUnit;
end;
@ -2068,6 +2070,7 @@ CheckHeap('TMainIDE.DoNewEditorUnit L '+IntToStr(GetMem_Cnt));
{$ENDIF}
NewSrcEdit:=SourceNotebook.GetActiveSE;
NewSrcEdit.SyntaxHighlighterType:=NewUnitInfo.SyntaxHighlighter;
NewUnitInfo.Form := CInterface.Control; //added sxm 2001-11-12
Project.InsertEditorIndex(SourceNotebook.NoteBook.PageIndex);
NewUnitInfo.EditorIndex:=SourceNotebook.NoteBook.PageIndex;
@ -3927,11 +3930,14 @@ begin
SourceNoteBook.NoteBook.PageIndex);
if (ActiveUnitInfo<>nil) then
AForm:=TCustomForm(ActiveUnitInfo.Form);
end;
end;
if AForm<>nil then
begin
// AForm.BringToFront;
AForm.Hide;
AForm.Show;
end;
@ -4541,6 +4547,16 @@ begin
DoJumpToCompilerMessage(TMessagesView(sender).SelectedMessageIndex,True);
end;
Procedure TMainIDE.OnSrcNotebookEditorVisibleChanged(Sender : TObject);
var
NewSrcEdit : TSourceEditor;
begin
if SourceNotebook.Notebook = nil then Exit;
NewSrcEdit:=SourceNotebook.GetActiveSE;
ToggleFormSpeedBtn.Enabled := Assigned(NewSrcEdit.Control);
end;
initialization
{ $I mainide.lrs}
{$I images/laz_images.lrs}
@ -4553,6 +4569,10 @@ end.
{ =============================================================================
$Log$
Revision 1.142 2001/11/13 18:50:08 lazarus
Changes to facilitate the toggle between form and unit
Shane
Revision 1.141 2001/11/12 16:56:04 lazarus
MG: CLIPBOARD

View File

@ -226,6 +226,7 @@ type
FOnProcessUserCommand: TOnProcessUserCommand;
FOnUserCommandProcessed: TOnProcessUserCommand;
FOnShowUnitInfo: TNotifyEvent;
FOnEditorVisibleChanged: TNotifyEvent;
// PopupMenu
Procedure BuildPopupMenu;
@ -346,7 +347,9 @@ type
read FOnUserCommandProcessed write FOnUserCommandProcessed;
property OnShowUnitInfo: TNotifyEvent
read FOnShowUnitInfo write FOnShowUnitInfo;
end;
property OnEditorVisibleChanged: TNotifyEvent
read FOnEditorVisibleChanged write FOnEditorVisibleChanged;
end;
{Goto dialog}
@ -2746,6 +2749,8 @@ Begin
begin
TempEditor.FocusEditor;
UpdateStatusBar;
if Assigned(FOnEditorVisibleChanged) then
FOnEditorVisibleChanged(sender);
end;
end;

View File

@ -324,6 +324,10 @@ end.
{ =============================================================================
$Log$
Revision 1.23 2001/11/13 18:50:10 lazarus
Changes to facilitate the toggle between form and unit
Shane
Revision 1.22 2001/11/12 16:56:08 lazarus
MG: CLIPBOARD

View File

@ -99,7 +99,8 @@ procedure GTKAPIWidgetClient_DrawCaret(Client: PGTKAPIWidgetClient); forward;
function GTKAPIWidgetClient_Timer(Client: Pointer): gint; cdecl;
// returning 0 would stop the timer, 1 will restart it
begin
if PGTKAPIWidgetClient(Client)^.Caret.Timer=0 then begin
try
if PGTKAPIWidgetClient(Client)^.Caret.Timer<=0 then begin
Result := 0;
exit;
end;
@ -108,6 +109,14 @@ begin
Result := 1
else
Result := 0;
except
Writeln('------Exception in GTKAPIWidgetClient_Timer------');
writeln('Client = ',longint(Client));
if Assigned(Client) then
begin
writeln('Timer is ',Longint(PGTKAPIWidgetClient(Client)^.Caret.Timer));
end;
end;
end;
procedure GTKAPIWidgetClient_Realize(Widget: PGTKWidget); cdecl;
@ -635,6 +644,10 @@ end.
{ =============================================================================
$Log$
Revision 1.16 2001/11/13 18:50:10 lazarus
Changes to facilitate the toggle between form and unit
Shane
Revision 1.15 2001/10/25 13:21:06 lazarus
Added an IFDEF for VER1_1
Shane