View Issue Details

IDProjectCategoryView StatusLast Update
0026178LazarusIDEpublic2014-05-19 05:40
ReporterFathony Luthfillah Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3 (SVN) 
Summary0026178: Additions and Override is not searchable
DescriptionI couldn't search the cross-widget compile option via Project-Options's search box.
Steps To ReproduceLazarus 1.2 up, Menu > Project > Project Option.
in searchbox type "Widget".
TagsNo tags attached.
Fixed in Revisionr45087
LazTarget-
Widgetset
Attached Files

Activities

Fathony Luthfillah

2014-05-17 15:51

reporter  

ideopt-tmenu-searchable.patch (1,906 bytes)   
Index: components/ideintf/ideoptionsintf.pas
===================================================================
--- components/ideintf/ideoptionsintf.pas	(revision 45052)
+++ components/ideintf/ideoptionsintf.pas	(working copy)
@@ -314,6 +314,8 @@
 
 implementation
 
+uses Menus;
+
 var
   FIDEEditorGroups: TIDEOptionsGroupList;
 
@@ -529,6 +531,21 @@
     end;
   end;
 
+  function SearchMenu(AControl: TMenuItem): Boolean;
+  var
+    i: Integer;
+  begin
+    Result:=False;
+    if Pos(LowerText, LowerCase(AControl.Caption))>0 then
+       Result := True
+    else
+    for i := 0 to AControl.Count-1 do begin
+      Result := SearchMenu(AControl.Items[i]);
+      if result then
+         exit;
+    end;
+  end;
+
   function SearchListView(AControl: TCustomListView): Boolean;
   begin
     Result:=False;  // ToDo...
@@ -590,7 +607,20 @@
       AWinControl:=TWinControl(AControl);
       for i:=0 to AWinControl.ControlCount-1 do
         if Search(AWinControl.Controls[i]) then      // Recursive call
+        begin
           Result:=True;
+          break;
+        end;
+
+      if not Result then begin
+        for i:=0 to AWinControl.ComponentCount-1 do
+          if AWinControl.Components[i] is TMenu then
+             if SearchMenu(TMenu(AWinControl.Components[i]).Items) then      // Recursive call
+             begin
+               Result:=True;
+               break;
+             end;
+      end;
     end;
   end;
 
Index: ide/frames/compiler_modematrix.pas
===================================================================
--- ide/frames/compiler_modematrix.pas	(revision 45052)
+++ ide/frames/compiler_modematrix.pas	(working copy)
@@ -1089,6 +1089,8 @@
   fCaptionPatternMacroValue:=lisMMValueS;
 
   UpdateButtons;
+
+  self.BMMAddPopupMenuPopup(BMMAddPopupMenu); //x2nie trigger popup to be searchable
 end;
 
 destructor TCompOptModeMatrixFrame.Destroy;
ideopt-tmenu-searchable.patch (1,906 bytes)   

Fathony Luthfillah

2014-05-17 16:00

reporter  

LCLWidgetType.GIF (37,725 bytes)   
LCLWidgetType.GIF (37,725 bytes)   

Fathony Luthfillah

2014-05-17 16:01

reporter  

searchable-tmenu.GIF (28,831 bytes)   
searchable-tmenu.GIF (28,831 bytes)   

Juha Manninen

2014-05-17 19:11

developer   ~0075045

Last edited: 2014-05-18 09:49

View 4 revisions

You have created a non-intuitive GUI experience for a user. The filter finds the menu items but the menu is closed and thus a user does not see them.
Next we would get bug reports about the filter giving false positives.
Currently the GUI + filter is intuitive. The matching text is always bolded so the user can easily spot it.

I admit your hack was clever but it was still a hack. The right solution would be to improve the GUI. I will leave this issue open in case you want to work on it.

There already is a link for Widgetset in the Paths page. The filter finds it. I added another link to the Config and Target page in r45061. It does not really solve the problem though.

Fathony Luthfillah

2014-05-18 06:29

reporter   ~0075055

I am not the creator of that "non-intuitive GUI".

What I did is just make a correct link between:
1) search-box (plus func/event to filter which page contain the text searched)
and
2) to the pages to be searched (plus the page content).
in this case I make TPopupMenu's content also searchable.

I don't touch any widgetset code. AFAIK, TMenuItem is not related to widgetset subject.

Juha Manninen

2014-05-18 11:19

developer   ~0075061

> I am not the creator of that "non-intuitive GUI".

I meant "non-intuitive GUI experience". When you include hidden popup menuitems in filter results, the user experience is counter-intuitive.

There are (at least) 2 ways to go with the GUI:
1. Make a dedicated GUI only for adding LCLWidgetType. A Label, a ComboBox and an "Add" button would suffice then.
  Other options and IDE macros would still be added using the popup menu.

2. Move all items from the popup menu into a new GUI pane with RadioButtons, Edits, ComboBox and whatever. All combinations I have in mind are a little clumsy and messy but it is doable.

Choice 1. may be better because LCLWidgetType is clearly the most wanted IDE macro. Most people don't care about other IDE macros.
On the other hand, choice 1. creates a little illogical GUI. All IDE macros are added using a popup menu except for one.

Maybe you come up with something nice. The selected "Stored in project ..." section should also be more apparent.
Yet, it is important to remember that this page is complex by definition because it offers so many choices. The fundamental complexity will not go away whatever you do.

Fathony Luthfillah

2014-05-18 15:34

reporter   ~0075087

Juha, you can close this report now as rejected.
We can start over with another discussion in forum later.

Juha Manninen

2014-05-19 00:59

developer   ~0075101

Last edited: 2014-05-19 01:02

View 2 revisions

I added a dedicated button for LCLWidgetType. The filter also finds it, thus this issue is solved.

I hope you understand the usability problems your solution would have caused. At least for me they were obvious and clear.

Fathony Luthfillah

2014-05-19 04:45

reporter   ~0075102

Thank you

Fathony Luthfillah

2014-05-19 05:40

reporter   ~0075103

the patch is not used, but the bug is resolved: I can search "Additional & Override" by type 'widget' in the search box.

Issue History

Date Modified Username Field Change
2014-05-17 15:51 Fathony Luthfillah New Issue
2014-05-17 15:51 Fathony Luthfillah File Added: ideopt-tmenu-searchable.patch
2014-05-17 15:56 Zeljan Rikalo Assigned To => Juha Manninen
2014-05-17 15:56 Zeljan Rikalo Status new => assigned
2014-05-17 16:00 Fathony Luthfillah File Added: LCLWidgetType.GIF
2014-05-17 16:01 Fathony Luthfillah File Added: searchable-tmenu.GIF
2014-05-17 19:11 Juha Manninen Note Added: 0075045
2014-05-17 19:13 Juha Manninen Note Edited: 0075045 View Revisions
2014-05-17 19:14 Juha Manninen Note Edited: 0075045 View Revisions
2014-05-18 06:29 Fathony Luthfillah Note Added: 0075055
2014-05-18 09:49 Juha Manninen Note Edited: 0075045 View Revisions
2014-05-18 11:19 Juha Manninen Note Added: 0075061
2014-05-18 15:34 Fathony Luthfillah Note Added: 0075087
2014-05-19 00:59 Juha Manninen Fixed in Revision => r45087
2014-05-19 00:59 Juha Manninen LazTarget => -
2014-05-19 00:59 Juha Manninen Note Added: 0075101
2014-05-19 00:59 Juha Manninen Status assigned => resolved
2014-05-19 00:59 Juha Manninen Resolution open => fixed
2014-05-19 01:02 Juha Manninen Note Edited: 0075101 View Revisions
2014-05-19 04:45 Fathony Luthfillah Note Added: 0075102
2014-05-19 05:40 Fathony Luthfillah Note Added: 0075103
2014-05-19 05:40 Fathony Luthfillah Status resolved => closed