View Issue Details

IDProjectCategoryView StatusLast Update
0037026PatchesPatchpublic2020-05-27 00:51
ReporterFTurtle Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version2.1 (SVN) 
Summary0037026: Showing icons in menu 'Window'
DescriptionIn this patch:

1. Adding showing of icons to menu 'Window'
2. Three new icons.
TagsNo tags attached.
Fixed in Revisionr63212
LazTarget-
Widgetset
Attached Files

Activities

FTurtle

2020-05-05 20:15

reporter   ~0122636

screenshot.png (20,054 bytes)   
screenshot.png (20,054 bytes)   
images.zip (7,439 bytes)
patch.diff (5,595 bytes)   
Index: ide/mainbase.pas
===================================================================
--- ide/mainbase.pas	(revision 63114)
+++ ide/mainbase.pas	(working copy)
@@ -1522,6 +1522,58 @@
 
 procedure TMainIDEBase.UpdateWindowMenu;
 
+  function GetIconName(AForm: TWinControl): String;
+  begin
+    if csDesigning in AForm.ComponentState then                        // in designer
+      case AForm.ClassName of
+        'TFrameProxyDesignerForm':       Exit('frame_designer');       // frame
+        'TNonControlProxyDesignerForm':  Exit('datamodule_designer');  // datamodule
+      else
+        Exit('form_designer');           // own form class (TForm1, TForm2, etc.)
+      end;
+
+    case AForm.ClassName of
+      'TCharacterMapDialog':     Exit('');                           // for future icon
+      'TObjectInspectorDlg':     Exit('menu_view_inspector');
+      'TSourceNotebook':         Exit('menu_view_source_editor');
+      'TMessagesView':           Exit('menu_view_messages');
+      'TCodeExplorerView':       Exit('menu_view_code_explorer');
+      'TFPDocEditor':            Exit('');                           // for future icon
+      'TCodeBrowserView':        Exit('menu_view_code_browser');
+      'TUnitDependenciesWindow': Exit('');                           // for future icon
+      'TRestrictionBrowserView': Exit('menu_view_restriction_browser');
+      'TComponentListForm':      Exit('menu_view_components');
+      'TJumpHistoryViewWin':     Exit('menu_view_jump_history');
+      'TMacroListView':          Exit('');                           // for future icon
+      'TProjectGroupEditorForm': Exit('pg_item');
+      'THeapTrcViewForm':        Exit('');                           // for future icon
+      'TIDETodoWindow':          Exit('menu_view_todo');
+      'TAnchorDesigner':         Exit('menu_view_anchor_editor');
+      'TTabOrderDialog':         Exit('tab_order');
+      'TSearchResultsView':      Exit('menu_view_search_results');
+      'TWatchesDlg':             Exit('debugger_watches');
+      'TBreakPointsDlg':         Exit('debugger_breakpoints');
+      'TLocalsDlg':              Exit('');                           // for future icon
+      'TRegistersDlg':           Exit('');                           // for future icon
+      'TCallStackDlg':           Exit('debugger_call_stack');
+      'TThreadsDlg':             Exit('');                           // for future icon
+      'TAssemblerDlg':           Exit('');                           // for future icon
+      'TDbgEventsForm':          Exit('');                           // for future icon
+      'THistoryDialog':          Exit('');                           // for future icon
+      'TDbgOutputForm':          Exit('debugger_output');
+      'TProjectInspectorForm':   Exit('menu_project_inspector');
+      'TPackageEditorForm':      Exit('item_package');
+      'TPkgGraphExplorerDlg':    Exit('pkg_graph');
+      'TDSFieldsEditorFrm':               Exit('');  // for future icon
+      'TDBGridColumnsPropertyEditorForm': Exit('');  // for future icon
+      'TActionListEditor':                Exit('');  // for future icon
+      'TCollectionPropertyEditorForm':    Exit('');  // for future icon
+      'TSeriesEditorForm':                Exit('');  // for future icon
+    else
+      Exit('');
+    end;
+  end;
+
   function GetMenuItem(Index: Integer; ASection: TIDEMenuSection): TIDEMenuItem;
   begin
     Result := RegisterIDEMenuCommand(ASection,'Window'+IntToStr(Index)+ASection.Name,'');
@@ -1537,7 +1589,7 @@
   EditorCur: TSourceEditor;
   P: TIDEPackage;
   aSection: TIDEMenuSection;
-  s: String;
+  s, IconName: String;
 begin
   itmWindowLists.Clear;
   itmCenterWindowLists.Clear;
@@ -1578,6 +1630,8 @@
   begin
     // in the 'bring to front' list
     CurMenuItem := GetMenuItem(i, itmWindowLists);
+    IconName:=GetIconName(TWinControl(WindowsList[i]));
+    CurMenuItem.ResourceName:=IconName;
     if EnvironmentOptions.Desktop.IDENameForDesignedFormList
     and IsFormDesign(TWinControl(WindowsList[i])) then
       CurMenuItem.Caption:=TCustomForm(WindowsList[i]).Name
@@ -1588,6 +1642,7 @@
     CurMenuItem.OnClick:=@mnuWindowItemClick;
     // in the 'center' list
     CurMenuItem := GetMenuItem(i, itmCenterWindowLists);
+    CurMenuItem.ResourceName:=IconName;
     if EnvironmentOptions.Desktop.IDENameForDesignedFormList
     and IsFormDesign(TWinControl(WindowsList[i])) then
       CurMenuItem.Caption:=TCustomForm(WindowsList[i]).Name
Index: images/copyright.txt
===================================================================
--- images/copyright.txt	(revision 63114)
+++ images/copyright.txt	(working copy)
@@ -57,6 +57,9 @@
 	tab_order.png
 
 items directory:
+	datamodule_designer.png    (used 'tdatasource.png' created by Roland Hahn)
+	form_designer.png
+	frame_designer.png
 	item_form.png
 	item_project.png
 	item_project_source.png
Index: images/laz_images_list.txt
===================================================================
--- images/laz_images_list.txt	(revision 63114)
+++ images/laz_images_list.txt	(working copy)
@@ -456,6 +456,15 @@
 designer/tab_order.png
 designer/tab_order_150.png
 designer/tab_order_200.png
+items/datamodule_designer.png
+items/datamodule_designer_150.png
+items/datamodule_designer_200.png
+items/form_designer.png
+items/form_designer_150.png
+items/form_designer_200.png
+items/frame_designer.png
+items/frame_designer_150.png
+items/frame_designer_200.png
 items/item_character.png
 items/item_character_150.png
 items/item_character_200.png
patch.diff (5,595 bytes)   

Juha Manninen

2020-05-22 22:51

developer   ~0123007

Thanks for the patch. I applied it after some changes.
I used ImageIndex from the IDE command when available. Please take a look.

FTurtle

2020-05-23 17:48

reporter   ~0123014

Thank you.

Issue History

Date Modified Username Field Change
2020-05-05 20:14 FTurtle New Issue
2020-05-05 20:15 FTurtle Note Added: 0122636
2020-05-05 20:15 FTurtle File Added: screenshot.png
2020-05-05 20:15 FTurtle File Added: images.zip
2020-05-05 20:15 FTurtle File Added: patch.diff
2020-05-22 20:24 Juha Manninen Assigned To => Juha Manninen
2020-05-22 20:24 Juha Manninen Status new => assigned
2020-05-22 22:51 Juha Manninen Status assigned => resolved
2020-05-22 22:51 Juha Manninen Resolution open => fixed
2020-05-22 22:51 Juha Manninen Fixed in Revision => r63212
2020-05-22 22:51 Juha Manninen LazTarget => -
2020-05-22 22:51 Juha Manninen Note Added: 0123007
2020-05-23 17:48 FTurtle Status resolved => closed
2020-05-23 17:48 FTurtle Note Added: 0123014