mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 05:39:14 +02:00
Changes to facilitate the toggle between form and unit
Shane git-svn-id: trunk@418 -
This commit is contained in:
parent
b3dd5353c5
commit
5b266eec73
22
ide/main.pp
22
ide/main.pp
@ -206,6 +206,7 @@ type
|
|||||||
Procedure OnSrcNotebookFileClose(Sender : TObject);
|
Procedure OnSrcNotebookFileClose(Sender : TObject);
|
||||||
Procedure OnSrcNotebookSaveAll(Sender : TObject);
|
Procedure OnSrcNotebookSaveAll(Sender : TObject);
|
||||||
Procedure OnSrcNotebookToggleFormUnit(Sender : TObject);
|
Procedure OnSrcNotebookToggleFormUnit(Sender : TObject);
|
||||||
|
Procedure OnSrcNotebookEditorVisibleChanged(Sender : TObject);
|
||||||
Procedure OnSrcNotebookProcessCommand(Sender: TObject; Command: integer;
|
Procedure OnSrcNotebookProcessCommand(Sender: TObject; Command: integer;
|
||||||
var Handled: boolean);
|
var Handled: boolean);
|
||||||
procedure OnSrcNoteBookShowUnitInfo(Sender: TObject);
|
procedure OnSrcNoteBookShowUnitInfo(Sender: TObject);
|
||||||
@ -570,6 +571,8 @@ begin
|
|||||||
SourceNotebook.OnToggleFormUnitClicked := @OnSrcNotebookToggleFormUnit;
|
SourceNotebook.OnToggleFormUnitClicked := @OnSrcNotebookToggleFormUnit;
|
||||||
SourceNotebook.OnProcessUserCommand := @OnSrcNotebookProcessCommand;
|
SourceNotebook.OnProcessUserCommand := @OnSrcNotebookProcessCommand;
|
||||||
SourceNotebook.OnShowUnitInfo := @OnSrcNoteBookShowUnitInfo;
|
SourceNotebook.OnShowUnitInfo := @OnSrcNoteBookShowUnitInfo;
|
||||||
|
SourceNotebook.OnEditorVisibleChanged := @OnSrcNotebookEditorVisibleChanged;
|
||||||
|
|
||||||
|
|
||||||
// find / replace dialog
|
// find / replace dialog
|
||||||
itmSearchFind.OnClick := @SourceNotebook.FindClicked;
|
itmSearchFind.OnClick := @SourceNotebook.FindClicked;
|
||||||
@ -1246,7 +1249,6 @@ end;
|
|||||||
|
|
||||||
Procedure TMainIDE.mnuToggleFormUnitClicked(Sender : TObject);
|
Procedure TMainIDE.mnuToggleFormUnitClicked(Sender : TObject);
|
||||||
Begin
|
Begin
|
||||||
writeln('Toggle form clicked');
|
|
||||||
FCodeLastActivated:=not FCodeLastActivated;
|
FCodeLastActivated:=not FCodeLastActivated;
|
||||||
DoBringToFrontFormOrUnit;
|
DoBringToFrontFormOrUnit;
|
||||||
end;
|
end;
|
||||||
@ -2068,6 +2070,7 @@ CheckHeap('TMainIDE.DoNewEditorUnit L '+IntToStr(GetMem_Cnt));
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
NewSrcEdit:=SourceNotebook.GetActiveSE;
|
NewSrcEdit:=SourceNotebook.GetActiveSE;
|
||||||
NewSrcEdit.SyntaxHighlighterType:=NewUnitInfo.SyntaxHighlighter;
|
NewSrcEdit.SyntaxHighlighterType:=NewUnitInfo.SyntaxHighlighter;
|
||||||
|
NewUnitInfo.Form := CInterface.Control; //added sxm 2001-11-12
|
||||||
Project.InsertEditorIndex(SourceNotebook.NoteBook.PageIndex);
|
Project.InsertEditorIndex(SourceNotebook.NoteBook.PageIndex);
|
||||||
NewUnitInfo.EditorIndex:=SourceNotebook.NoteBook.PageIndex;
|
NewUnitInfo.EditorIndex:=SourceNotebook.NoteBook.PageIndex;
|
||||||
|
|
||||||
@ -3927,11 +3930,14 @@ begin
|
|||||||
SourceNoteBook.NoteBook.PageIndex);
|
SourceNoteBook.NoteBook.PageIndex);
|
||||||
if (ActiveUnitInfo<>nil) then
|
if (ActiveUnitInfo<>nil) then
|
||||||
AForm:=TCustomForm(ActiveUnitInfo.Form);
|
AForm:=TCustomForm(ActiveUnitInfo.Form);
|
||||||
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if AForm<>nil then
|
if AForm<>nil then
|
||||||
begin
|
begin
|
||||||
|
// AForm.BringToFront;
|
||||||
AForm.Hide;
|
AForm.Hide;
|
||||||
AForm.Show;
|
AForm.Show;
|
||||||
end;
|
end;
|
||||||
@ -4541,6 +4547,16 @@ begin
|
|||||||
DoJumpToCompilerMessage(TMessagesView(sender).SelectedMessageIndex,True);
|
DoJumpToCompilerMessage(TMessagesView(sender).SelectedMessageIndex,True);
|
||||||
end;
|
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
|
initialization
|
||||||
{ $I mainide.lrs}
|
{ $I mainide.lrs}
|
||||||
{$I images/laz_images.lrs}
|
{$I images/laz_images.lrs}
|
||||||
@ -4553,6 +4569,10 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$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
|
Revision 1.141 2001/11/12 16:56:04 lazarus
|
||||||
MG: CLIPBOARD
|
MG: CLIPBOARD
|
||||||
|
|
||||||
|
@ -226,6 +226,7 @@ type
|
|||||||
FOnProcessUserCommand: TOnProcessUserCommand;
|
FOnProcessUserCommand: TOnProcessUserCommand;
|
||||||
FOnUserCommandProcessed: TOnProcessUserCommand;
|
FOnUserCommandProcessed: TOnProcessUserCommand;
|
||||||
FOnShowUnitInfo: TNotifyEvent;
|
FOnShowUnitInfo: TNotifyEvent;
|
||||||
|
FOnEditorVisibleChanged: TNotifyEvent;
|
||||||
|
|
||||||
// PopupMenu
|
// PopupMenu
|
||||||
Procedure BuildPopupMenu;
|
Procedure BuildPopupMenu;
|
||||||
@ -346,6 +347,8 @@ type
|
|||||||
read FOnUserCommandProcessed write FOnUserCommandProcessed;
|
read FOnUserCommandProcessed write FOnUserCommandProcessed;
|
||||||
property OnShowUnitInfo: TNotifyEvent
|
property OnShowUnitInfo: TNotifyEvent
|
||||||
read FOnShowUnitInfo write FOnShowUnitInfo;
|
read FOnShowUnitInfo write FOnShowUnitInfo;
|
||||||
|
property OnEditorVisibleChanged: TNotifyEvent
|
||||||
|
read FOnEditorVisibleChanged write FOnEditorVisibleChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{Goto dialog}
|
{Goto dialog}
|
||||||
@ -2746,6 +2749,8 @@ Begin
|
|||||||
begin
|
begin
|
||||||
TempEditor.FocusEditor;
|
TempEditor.FocusEditor;
|
||||||
UpdateStatusBar;
|
UpdateStatusBar;
|
||||||
|
if Assigned(FOnEditorVisibleChanged) then
|
||||||
|
FOnEditorVisibleChanged(sender);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -324,6 +324,10 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$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
|
Revision 1.22 2001/11/12 16:56:08 lazarus
|
||||||
MG: CLIPBOARD
|
MG: CLIPBOARD
|
||||||
|
|
||||||
|
@ -99,7 +99,8 @@ procedure GTKAPIWidgetClient_DrawCaret(Client: PGTKAPIWidgetClient); forward;
|
|||||||
function GTKAPIWidgetClient_Timer(Client: Pointer): gint; cdecl;
|
function GTKAPIWidgetClient_Timer(Client: Pointer): gint; cdecl;
|
||||||
// returning 0 would stop the timer, 1 will restart it
|
// returning 0 would stop the timer, 1 will restart it
|
||||||
begin
|
begin
|
||||||
if PGTKAPIWidgetClient(Client)^.Caret.Timer=0 then begin
|
try
|
||||||
|
if PGTKAPIWidgetClient(Client)^.Caret.Timer<=0 then begin
|
||||||
Result := 0;
|
Result := 0;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -108,6 +109,14 @@ begin
|
|||||||
Result := 1
|
Result := 1
|
||||||
else
|
else
|
||||||
Result := 0;
|
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;
|
end;
|
||||||
|
|
||||||
procedure GTKAPIWidgetClient_Realize(Widget: PGTKWidget); cdecl;
|
procedure GTKAPIWidgetClient_Realize(Widget: PGTKWidget); cdecl;
|
||||||
@ -635,6 +644,10 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$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
|
Revision 1.15 2001/10/25 13:21:06 lazarus
|
||||||
Added an IFDEF for VER1_1
|
Added an IFDEF for VER1_1
|
||||||
Shane
|
Shane
|
||||||
|
Loading…
Reference in New Issue
Block a user