mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 10:49:16 +02:00
MG: fixed non AutoCheck menuitems and editor bookmark popupmenu
git-svn-id: trunk@2941 -
This commit is contained in:
parent
760e69253a
commit
2719ecdfd2
@ -458,7 +458,8 @@ type
|
|||||||
SrcPopUpMenu : TPopupMenu;
|
SrcPopUpMenu : TPopupMenu;
|
||||||
StatusBar : TStatusBar;
|
StatusBar : TStatusBar;
|
||||||
SetBookmarkMenuItem : TMenuItem;
|
SetBookmarkMenuItem : TMenuItem;
|
||||||
property OnAddJumpPoint: TOnAddJumpPoint
|
GotoBookmarkMenuItem : TMenuItem;
|
||||||
|
property OnAddJumpPoint: TOnAddJumpPoint
|
||||||
read FOnAddJumpPoint write FOnAddJumpPoint;
|
read FOnAddJumpPoint write FOnAddJumpPoint;
|
||||||
property OnCloseClicked : TNotifyEvent read FOnCloseClicked write FOnCloseClicked;
|
property OnCloseClicked : TNotifyEvent read FOnCloseClicked write FOnCloseClicked;
|
||||||
property OnDeleteLastJumpPoint: TNotifyEvent
|
property OnDeleteLastJumpPoint: TNotifyEvent
|
||||||
@ -2252,6 +2253,7 @@ end;
|
|||||||
procedure TSourceNotebook.SrcPopUpMenuPopup(Sender: TObject);
|
procedure TSourceNotebook.SrcPopUpMenuPopup(Sender: TObject);
|
||||||
var
|
var
|
||||||
ASrcEdit: TSourceEditor;
|
ASrcEdit: TSourceEditor;
|
||||||
|
i: integer;
|
||||||
begin
|
begin
|
||||||
if not (Sender is TPopupMenu) then exit;
|
if not (Sender is TPopupMenu) then exit;
|
||||||
ASrcEdit:=FindSourceEditorWithEditorComponent(TPopupMenu(Sender).PopupComponent);
|
ASrcEdit:=FindSourceEditorWithEditorComponent(TPopupMenu(Sender).PopupComponent);
|
||||||
@ -2259,6 +2261,10 @@ begin
|
|||||||
ReadOnlyMenuItem.Checked:=ASrcEdit.ReadOnly;
|
ReadOnlyMenuItem.Checked:=ASrcEdit.ReadOnly;
|
||||||
ShowLineNumbersMenuItem.Checked:=
|
ShowLineNumbersMenuItem.Checked:=
|
||||||
ASrcEdit.EditorComponent.Gutter.ShowLineNumbers;
|
ASrcEdit.EditorComponent.Gutter.ShowLineNumbers;
|
||||||
|
for i:=0 to 9 do begin
|
||||||
|
SetBookmarkMenuItem[i].Checked:=(FindBookmark(i)<>nil);
|
||||||
|
GotoBookmarkMenuItem[i].Checked:=SetBookmarkMenuItem[i].Checked;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TSourceNotebook.BuildPopupMenu;
|
Procedure TSourceNotebook.BuildPopupMenu;
|
||||||
@ -2312,10 +2318,10 @@ Begin
|
|||||||
SetBookmarkMenuItem.Add(SubMenuItem);
|
SetBookmarkMenuItem.Add(SubMenuItem);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
MenuItem := TMenuItem.Create(Self);
|
GotoBookmarkMenuItem := TMenuItem.Create(Self);
|
||||||
MenuItem.Name:='GotoBookmarkMenuItem';
|
GotoBookmarkMenuItem.Name:='GotoBookmarkMenuItem';
|
||||||
MenuItem.Caption := '&Goto Bookmark';
|
GotoBookmarkMenuItem.Caption := '&Goto Bookmark';
|
||||||
SrcPopupMenu.Items.Add(MenuItem);
|
SrcPopupMenu.Items.Add(GotoBookmarkMenuItem);
|
||||||
|
|
||||||
for I := 0 to 9 do
|
for I := 0 to 9 do
|
||||||
Begin
|
Begin
|
||||||
@ -2323,7 +2329,7 @@ Begin
|
|||||||
SubmenuItem.Name:='GotoBookmark'+IntToStr(I)+'MenuItem';
|
SubmenuItem.Name:='GotoBookmark'+IntToStr(I)+'MenuItem';
|
||||||
SubMenuItem.Caption := 'Bookmark '+inttostr(i);
|
SubMenuItem.Caption := 'Bookmark '+inttostr(i);
|
||||||
SubMenuItem.OnClick := @BookmarkGotoClicked;
|
SubMenuItem.OnClick := @BookmarkGotoClicked;
|
||||||
MenuItem.Add(SubMenuItem);
|
GotoBookmarkMenuItem.Add(SubMenuItem);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
SrcPopupMenu.Items.Add(Seperator);
|
SrcPopupMenu.Items.Add(Seperator);
|
||||||
@ -2804,16 +2810,16 @@ var
|
|||||||
ActEdit,AnEdit:TSourceEditor;
|
ActEdit,AnEdit:TSourceEditor;
|
||||||
Begin
|
Begin
|
||||||
MenuItem := TMenuItem(SetBookmarkMenuItem.Items[Value]);
|
MenuItem := TMenuItem(SetBookmarkMenuItem.Items[Value]);
|
||||||
if not MenuItem.Checked then begin
|
|
||||||
MenuItem.Checked := true;
|
|
||||||
MenuItem.Caption := MenuItem.Caption + '*';
|
|
||||||
end;
|
|
||||||
ActEdit:=GetActiveSE;
|
ActEdit:=GetActiveSE;
|
||||||
|
|
||||||
AnEdit:=FindBookmark(Value);
|
AnEdit:=FindBookmark(Value);
|
||||||
if AnEdit<>nil then AnEdit.EditorComponent.ClearBookMark(Value);
|
if AnEdit<>nil then begin
|
||||||
|
AnEdit.EditorComponent.ClearBookMark(Value);
|
||||||
|
end;
|
||||||
ActEdit.EditorComponent.SetBookMark(Value,
|
ActEdit.EditorComponent.SetBookMark(Value,
|
||||||
ActEdit.EditorComponent.CaretX,ActEdit.EditorComponent.CaretY);
|
ActEdit.EditorComponent.CaretX,ActEdit.EditorComponent.CaretY);
|
||||||
|
MenuItem.Checked := true;
|
||||||
|
GotoBookmarkMenuItem[Value].Checked:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{This is called from outside to set a bookmark}
|
{This is called from outside to set a bookmark}
|
||||||
@ -3143,7 +3149,7 @@ begin
|
|||||||
BookMarkGoto(Command - ecGotoMarker0);
|
BookMarkGoto(Command - ecGotoMarker0);
|
||||||
|
|
||||||
ecSetMarker0..ecSetMarker9:
|
ecSetMarker0..ecSetMarker9:
|
||||||
BookMarkToggle(Command - ecSetMarker0);
|
BookMarkSet(Command - ecSetMarker0);
|
||||||
|
|
||||||
ecJumpBack:
|
ecJumpBack:
|
||||||
HistoryJump(Self,jhaBack);
|
HistoryJump(Self,jhaBack);
|
||||||
|
@ -289,7 +289,8 @@ end;
|
|||||||
|
|
||||||
Draws the requested image on the given canvas.
|
Draws the requested image on the given canvas.
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TCustomImageList.Draw(Canvas: TCanvas; X, Y, Index: Integer; Enabled: Boolean);
|
procedure TCustomImageList.Draw(Canvas: TCanvas; X, Y, Index: Integer;
|
||||||
|
Enabled: Boolean);
|
||||||
var
|
var
|
||||||
aBitmap : TBitmap;
|
aBitmap : TBitmap;
|
||||||
begin
|
begin
|
||||||
@ -839,6 +840,9 @@ end;
|
|||||||
{
|
{
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.12 2002/08/22 13:45:58 lazarus
|
||||||
|
MG: fixed non AutoCheck menuitems and editor bookmark popupmenu
|
||||||
|
|
||||||
Revision 1.11 2002/06/08 17:16:02 lazarus
|
Revision 1.11 2002/06/08 17:16:02 lazarus
|
||||||
MG: added close buttons and images to TNoteBook and close buttons to source editor
|
MG: added close buttons and images to TNoteBook and close buttons to source editor
|
||||||
|
|
||||||
|
@ -62,12 +62,14 @@ end;
|
|||||||
Creates the handle ( = object).
|
Creates the handle ( = object).
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TMenu.CreateHandle;
|
procedure TMenu.CreateHandle;
|
||||||
|
var i: integer;
|
||||||
begin
|
begin
|
||||||
InterfaceObject.IntSendMessage3(LM_CREATE, Self, nil); // CreateComponent(nil);
|
InterfaceObject.IntSendMessage3(LM_CREATE, Self, nil); // CreateComponent(nil);
|
||||||
// initiate creation of subitems
|
// initiate creation of subitems
|
||||||
// Note: FItems is a MenuItem, by using Createhandle all subitems will be
|
// Note: FItems is a MenuItem, by using Createhandle all subitems will be
|
||||||
// created.
|
// created.
|
||||||
FItems.CreateHandle;
|
for i:=0 to Items.Count-1 do
|
||||||
|
Items[i].HandleNeeded;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -168,6 +170,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.12 2002/08/22 13:45:58 lazarus
|
||||||
|
MG: fixed non AutoCheck menuitems and editor bookmark popupmenu
|
||||||
|
|
||||||
Revision 1.11 2002/08/12 15:32:29 lazarus
|
Revision 1.11 2002/08/12 15:32:29 lazarus
|
||||||
MG: started enhanced menuitem
|
MG: started enhanced menuitem
|
||||||
|
|
||||||
|
@ -66,26 +66,32 @@ end;
|
|||||||
Creates the handle ( = object).
|
Creates the handle ( = object).
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TMenuItem.CreateHandle;
|
procedure TMenuItem.CreateHandle;
|
||||||
var
|
var i: Integer;
|
||||||
n: Integer;
|
|
||||||
begin
|
begin
|
||||||
|
InterfaceObject.IntSendMessage3(LM_CREATE, Self, nil);
|
||||||
|
if FItems<>nil then begin
|
||||||
|
for i := 0 to Count - 1 do begin
|
||||||
|
Items[i].HandleNeeded;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
if Parent <> nil then
|
if Parent <> nil then
|
||||||
begin
|
begin
|
||||||
Parent.HandleNeeded;
|
Parent.HandleNeeded;
|
||||||
if Parent.HandleAllocated and (not HandleAllocated) then
|
if Parent.HandleAllocated then
|
||||||
InterfaceObject.IntSendMessage3(LM_CREATE, Self, nil);
|
InterfaceObject.IntSendMessage3(LM_ATTACHMENU, Self, nil);
|
||||||
if HandleAllocated then
|
if HandleAllocated then begin
|
||||||
begin
|
|
||||||
if ShortCut <> 0 then ShortCutChanged(0, Shortcut);
|
if ShortCut <> 0 then ShortCutChanged(0, Shortcut);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if (FItems <> nil) and ((Parent = nil) or Parent.HandleAllocated)
|
{
|
||||||
|
if (FItems <> nil) and ((Parent = nil) or Parent.HandleAllocated)
|
||||||
then begin
|
then begin
|
||||||
for n := 0 to FItems.Count - 1 do
|
for n := 0 to FItems.Count - 1 do
|
||||||
begin
|
begin
|
||||||
InterfaceObject.IntSendMessage3(LM_ATTACHMENU, TObject(FItems[n]), nil);
|
InterfaceObject.IntSendMessage3(LM_ATTACHMENU, TObject(FItems[n]), nil);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -420,7 +426,7 @@ procedure TMenuItem.RecreateHandle;
|
|||||||
begin
|
begin
|
||||||
if not HandleAllocated then exit;
|
if not HandleAllocated then exit;
|
||||||
DestroyHandle;
|
DestroyHandle;
|
||||||
CreateHandle;
|
HandleNeeded;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -916,6 +922,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.26 2002/08/22 13:45:58 lazarus
|
||||||
|
MG: fixed non AutoCheck menuitems and editor bookmark popupmenu
|
||||||
|
|
||||||
Revision 1.25 2002/08/15 13:37:57 lazarus
|
Revision 1.25 2002/08/15 13:37:57 lazarus
|
||||||
MG: started menuitem icon, checked, radio and groupindex
|
MG: started menuitem icon, checked, radio and groupindex
|
||||||
|
|
||||||
@ -1019,6 +1028,9 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.26 2002/08/22 13:45:58 lazarus
|
||||||
|
MG: fixed non AutoCheck menuitems and editor bookmark popupmenu
|
||||||
|
|
||||||
Revision 1.25 2002/08/15 13:37:57 lazarus
|
Revision 1.25 2002/08/15 13:37:57 lazarus
|
||||||
MG: started menuitem icon, checked, radio and groupindex
|
MG: started menuitem icon, checked, radio and groupindex
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ type
|
|||||||
property Parent: TMenuItem read GetParent;
|
property Parent: TMenuItem read GetParent;
|
||||||
function IsCheckItem: boolean; virtual;
|
function IsCheckItem: boolean; virtual;
|
||||||
published
|
published
|
||||||
property AutoCheck: boolean read FAutoCheck write SetAutoCheck;
|
property AutoCheck: boolean read FAutoCheck write SetAutoCheck default False;
|
||||||
property Caption: String
|
property Caption: String
|
||||||
read FCaption write SetCaption stored IsCaptionStored;
|
read FCaption write SetCaption stored IsCaptionStored;
|
||||||
property Checked: Boolean
|
property Checked: Boolean
|
||||||
@ -463,6 +463,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.26 2002/08/22 13:45:57 lazarus
|
||||||
|
MG: fixed non AutoCheck menuitems and editor bookmark popupmenu
|
||||||
|
|
||||||
Revision 1.25 2002/08/17 07:57:05 lazarus
|
Revision 1.25 2002/08/17 07:57:05 lazarus
|
||||||
MG: added TPopupMenu.OnPopup and SourceEditor PopupMenu checks
|
MG: added TPopupMenu.OnPopup and SourceEditor PopupMenu checks
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user