View Issue Details

IDProjectCategoryView StatusLast Update
0037976PatchesPatchpublic2020-10-24 15:45
ReporterFTurtle Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version2.1 (SVN) 
Summary0037976: Two new toolbutton commands for ToDo list
DescriptionAdded two new toolbutton commands:
- 'Insert a ToDo/Done/Note'
- 'View ToDo List'

See screenshot.png

Discussion at forum:
https://forum.lazarus.freepascal.org/index.php/topic,51888.0.html

TagsNo tags attached.
Fixed in Revisionr64063
LazTarget-
Widgetset
Attached Files

Activities

FTurtle

2020-10-24 05:48

reporter  

patch.diff (2,320 bytes)   
Index: components/todolist/tododlg.pas
===================================================================
--- components/todolist/tododlg.pas	(revision 64060)
+++ components/todolist/tododlg.pas	(working copy)
@@ -37,7 +37,7 @@
   LCLType, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
   Buttons, ButtonPanel, Menus, Spin, XMLPropStorage,
   // IdeIntf
-  IDECommands, MenuIntf, PackageIntf, SrcEditorIntf, IDEWindowIntf, LazIDEIntf,
+  IDECommands, MenuIntf, ToolBarIntf, PackageIntf, SrcEditorIntf, IDEWindowIntf, LazIDEIntf,
   // TodoList
   ToDoList, ToDoListStrConsts, ToDoListCore;
 
@@ -92,6 +92,8 @@
 var
   Key: TIDEShortCut;
   Cat: TIDECommandCategory;
+  MenuCmd: TIDEMenuCommand;
+  ButtonCmd: TIDEButtonCommand;
 begin
   // mattias: move icon resource item_todo to package
   // mattias: add menu item to package editor
@@ -107,8 +109,10 @@
   RegisterIDEMenuCommand(SrcEditMenuSectionFirstStatic, 'InsertToDo',
     lisTDDInsertToDo,nil,nil,InsertToDoCmd,'item_todo');
   // add a menu item in the Edit / Insert Text section
-  RegisterIDEMenuCommand(itmSourceInsertions,'itmSourceInsertTodo',lisTDDInsertToDo,
+  MenuCmd:=RegisterIDEMenuCommand(itmSourceInsertions,'itmSourceInsertTodo',lisTDDInsertToDo,
     nil,nil,InsertToDoCmd,'item_todo');
+  ButtonCmd:=RegisterIDEButtonCommand(InsertToDoCmd);    // toolbutton
+  ButtonCmd.ImageIndex:=MenuCmd.ImageIndex;
 
   // register shortcut for view todo list
   Key := IDEShortCut(VK_UNKNOWN,[],VK_UNKNOWN,[]);
@@ -117,12 +121,14 @@
     Key,nil,@ViewToDoList);
 
   // add a menu item in the view menu
-  RegisterIDEMenuCommand(itmViewMainWindows, 'ViewToDoList',
-    lisToDoList, nil, nil, ViewToDoListCmd, 'item_todo');
+  MenuCmd:=RegisterIDEMenuCommand(itmViewMainWindows, 'ViewToDoList',
+    lisToDoList, nil, nil, ViewToDoListCmd, 'menu_view_todo');
+  ButtonCmd:=RegisterIDEButtonCommand(ViewToDoListCmd);    // toolbutton
+  ButtonCmd.ImageIndex:=MenuCmd.ImageIndex;
 
   // add a menu item in the package editor
   RegisterIDEMenuCommand(PkgEditMenuSectionMisc, 'ViewPkgToDoList',
-    lisToDoList, nil, nil, ViewToDoListCmd, 'item_todo');
+    lisToDoList, nil, nil, ViewToDoListCmd, 'menu_view_todo');
 
   // register window creator
   IDEWindowCreators.Add(ToDoWindowName,@CreateIDEToDoWindow,nil,'250','250','','');
patch.diff (2,320 bytes)   
screenshot.png (10,900 bytes)   
screenshot.png (10,900 bytes)   

Juha Manninen

2020-10-24 13:32

developer   ~0126507

Applied, thanks.

FTurtle

2020-10-24 15:45

reporter   ~0126513

Thank you.

Issue History

Date Modified Username Field Change
2020-10-24 05:48 FTurtle New Issue
2020-10-24 05:48 FTurtle File Added: patch.diff
2020-10-24 05:48 FTurtle File Added: screenshot.png
2020-10-24 12:11 Juha Manninen Assigned To => Juha Manninen
2020-10-24 12:11 Juha Manninen Status new => assigned
2020-10-24 13:32 Juha Manninen Status assigned => resolved
2020-10-24 13:32 Juha Manninen Resolution open => fixed
2020-10-24 13:32 Juha Manninen Fixed in Revision => r64063
2020-10-24 13:32 Juha Manninen LazTarget => -
2020-10-24 13:32 Juha Manninen Note Added: 0126507
2020-10-24 15:45 FTurtle Status resolved => closed
2020-10-24 15:45 FTurtle Note Added: 0126513