Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-10

Bug (whis) at Procedure List : SOLVED, can anyone apply?

15 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Raistware

Could anyone check this code and apply to SVN?

---
diff --git a/ide/procedurelist.pas b/ide/procedurelist.pas
index 9e578af..96d8ba9 100644
--- a/ide/procedurelist.pas
+++ b/ide/procedurelist.pas
@@ -431,7 +431,8 @@ begin
       end;
     end;
   finally
-    cbObjects.ItemIndex := 0;   // select <All> as the default
+    { select <All> as the default }
+    cbObjects.ItemIndex := cbObjects.Items.IndexOf(lisPListAll);
     if cbObjects.Text = '' then
       cbObjects.ItemIndex := 1;
   end;

---

It solved the default item selected on bug on Procedure List. Default selection should be 'All' at local language, but before this change, the selection was allways the first item at list, at english is not a problem, because 'All' usually is the first item at list, but at other languages, like spanish: 'Todo' usually isn't the first this modification the default item will be allways 'All' in local language, solving that bug.

Cheers,
Raul Ferriz

__________ Informaci?n de ESET NOD32 Antivirus, versi?n de la base de firmas de virus 4550 (20091028) __________

ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com

Reply by email

Graeme Geldenhuys
to Raistware
Raistware wrote
Could anyone check this code and apply to SVN?

Sorry Raistware, I don't have write access to the repository, so was hoping somebody else would have picked up on your supplied patch from before.

I created a bug report with the supplied patch - so hopefully now somebody will submit it. Thanks again for solving the problem.

Patch supplied in following bug report.

http://bugs.freepascal.org/view.php?id=14923

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Flávio Etrusco
to Raistware: Could anyone check this code and apply to SVN? --- diff --git a/ide/procedurelist.pas…

(...)

Show quoted text 12 lines
It solved the default item selected on bug on Procedure List. Default selection should be 'All' at local language, but before this change, the selection was allways the first item at list, at english is not a problem, because 'All' usually is the first item at list, but at other languages, like spanish: 'Todo' usually isn't the first item at list. With this modification the default item will be allways 'All' in local language, solving that bug. Cheers, ?Raul Ferriz

Wouldn't the proper fix be always inserting "All" at the first position?

-Fl?vio

Reply by email

Raistware
to Flávio Etrusco

Fl?vio Etrusco escribi?:

Show quoted text 22 lines
(...) > It solved the default item selected on bug on Procedure List. Default > selection should be 'All' at local language, but before this change, the > selection was allways the first item at list, at english is not a problem, > because 'All' usually is the first item at list, but at other languages, > like spanish: 'Todo' usually isn't the first item at list. > With this modification the default item will be allways 'All' in local > language, solving that bug. > > Cheers, > Raul Ferriz > > Wouldn't the proper fix be always inserting "All" at the first position? -Fl?vio

I see no other fix applied ... wich revision?.
The list is sorted, and this is important and desirable while searching for the proper class. So 'All' in all languages aren't at first position.

Anyone can think that disable sorting after inserted all classes and then insert at first positions 'All' and 'None' ... well, that gives lot of more work, and I don't like that solution.

__________ Informaci?n de ESET NOD32 Antivirus, versi?n de la base de firmas de virus 4551 (20091028) __________

ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com

Reply by email

Vincent Snijders
to Raistware
Raistware wrote 10 lines
> > Wouldn't the proper fix be always inserting "All" at the first position? > > -Fl?vio > > > > I see no other fix applied ... wich revision?.

It has not yet been applied. There is no clear consension about the solution yet ;-)

Show quoted text 6 lines
The list is sorted, and this is important and desirable while searching for the proper class. So 'All' in all languages aren't at first position. Anyone can think that disable sorting after inserted all classes and then insert at first positions 'All' and 'None' ... well, that gives lot of more work, and I don't like that solution.

Vincent

Reply by email

Martin
to Raistware: Could anyone check this code and apply to SVN? --- diff --git a/ide/procedurelist.pas…

A much better idea (imho) would be, to add "all" and "none" *after sorting finished.

that way you would not rely on the name of them or anything like that.

  cbObjects.Sorted := true;
  cbObjects.Sorted := false;
  cbObjects.Items.Insert(0, lisPListAll);
  cbObjects.Items.Insert(1, lisPListNone);
Raistware wrote 48 lines
Could anyone check this code and apply to SVN? --- diff --git a/ide/procedurelist.pas b/ide/procedurelist.pas index 9e578af..96d8ba9 100644 --- a/ide/procedurelist.pas +++ b/ide/procedurelist.pas @@ -431,7 +431,8 @@ begin end; end; finally - cbObjects.ItemIndex := 0; // select <All> as the default + { select <All> as the default } + cbObjects.ItemIndex := cbObjects.Items.IndexOf(lisPListAll); if cbObjects.Text = '' then cbObjects.ItemIndex := 1; end; --- It solved the default item selected on bug on Procedure List. Default selection should be 'All' at local language, but before this change, the selection was allways the first item at list, at english is not a problem, because 'All' usually is the first item at list, but at other languages, like spanish: 'Todo' usually isn't the first item at list. With this modification the default item will be allways 'All' in local language, solving that bug. Cheers, Raul Ferriz __________ Informaci?n de ESET NOD32 Antivirus, versi?n de la base de firmas de virus 4550 (20091028) __________ ESET NOD32 Antivirus ha comprobado este mensaje. http://www.eset.com -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Graeme Geldenhuys
to Hans-Peter Diettrich: '-- all --' would automatically sort as the first entry, also indicating that it is a…

2009/10/28 Hans-Peter Diettrich :

'-- all --' would automatically sort as the first entry, also indicating that it is a synthetic entry.

I though that is exactly what '<all>' and '<none>' does as well. Was the non-english translations done correctly? Do the translations also include the '<' and '>' characters? Those extra characters are meant as an indicator that they are not actual classes in the unit.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Raistware
to Graeme Geldenhuys

Graeme Geldenhuys escribi?:

Show quoted text 11 lines
2009/10/28 Hans-Peter Diettrich : > '-- all --' would automatically sort as the first entry, also indicating > that it is a synthetic entry. > I though that is exactly what '<all>' and '<none>' does as well. Was the non-english translations done correctly? Do the translations also include the '<' and '>' characters? Those extra characters are meant as an indicator that they are not actual classes in the unit.

Spanish tranlation are : '<None>' -> 'Ninguno' (wrong translation, should be '<Ninguno>'), '<All>' -> '<Todo>'. But they are sorted as if they didn't have the '<' character. For instance:
Ninguno
TEquipment
<Todo>
TPlayer

If you want that the sort where:
<Todo>
<Ninguno> (after correct translation)
TEquipment
TPlayer

Then the easiest process to accomplish that is inserting '<All>' and '<None>' after the classes methods, and before that disable sorting.

Cheers,
Raul Ferriz
I don't have that patch, for me the order of All and None is irrelevant, because my units tend to have very little methods. The only must have to me was selecting All by default at my local language, and that was easily achieved.

__________ Informaci?n de ESET NOD32 Antivirus, versi?n de la base de firmas de virus 4553 (20091028) __________

ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com

Reply by email

Raistware
to Martin: A much better idea (imho) would be, to add "all" and "none" *after sorting finished.…

Martin escribi?:

Show quoted text 10 lines
A much better idea (imho) would be, to add "all" and "none" *after sorting finished. that way you would not rely on the name of them or anything like that. cbObjects.Sorted := true; cbObjects.Sorted := false; cbObjects.Items.Insert(0, lisPListAll); cbObjects.Items.Insert(1, lisPListNone);

Oops, see this message after sending my own :D.
But yes that is the solution if you want that first items All and None.

__________ Informaci?n de ESET NOD32 Antivirus, versi?n de la base de firmas de virus 4553 (20091028) __________

ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com

Reply by email

Graeme Geldenhuys
to Raistware: Graeme Geldenhuys escribi?: Spanish tranlation are : '<None>' -> 'Ninguno' (wrong…
Raistware wrote
Spanish tranlation are : '<None>' -> 'Ninguno' (wrong translation, should

OK, that is a translation problem then and needs to be fixed.

be '<Ninguno>'), '<All>' -> '<Todo>'. But they are sorted as if they didn't have the '<' character. For instance:

This seems like a bug in sorting algorithm. I'll double check what Unicode.org says about sorting with '<' characters and language text. I'll raise this issue as a new topic in Lazarus mailing list as well.

was selecting All by default at my local language, and that was easily achieved.

OK, what I am going to is create a new patch. My original intention was that <All> and <None> are the first to options in the combobox. (I completely forgot about possible translation issue at the time I implemented it) So I will add all classes and sort them. Then only insert <All> and <None> items at the beginning. This should then work for all languages.

I'll submit the patch later today, so hopefully soon it will be in Lazarus repository.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
Show quoted text 6 lines
On 29/10/2009, Raistware wrote: > > Spanish tranlation are : '<None>' -> 'Ninguno' (wrong translation, > should OK, that is a translation problem then and needs to be fixed.

What about using '<'+resoucestring+'>'?

Mattias

Reply by email

Jürgen Hestermann
to Raistware: Martin escribi?: Oops, see this message after sending my own :D. But yes that is the…
Show quoted text 6 lines
> cbObjects.Sorted := true; > cbObjects.Sorted := false; > cbObjects.Items.Insert(0, lisPListAll); > cbObjects.Items.Insert(1, lisPListNone); Oops, see this message after sending my own :D. But yes that is the solution if you want that first items All and None.

That's only a tedious workaround but if you later add something to your list you would have to remove the first element, set "Sorted" true and back to false, then add the first element again. Not an elegant solution.

I would have expected that a method exists that takes the first and last index and then sorts between these borders. Would be much more flexible than this strict sort-all-or-nothing flag.

Reply by email

Graeme Geldenhuys
to Jürgen Hestermann
J?rgen Hestermann wrote
That's only a tedious workaround but if you later add something to your list you would have to remove the first element, set "Sorted" true and back to false, then add the first element again. Not an elegant solution.

That should never be an issue. Every time you use Procedure List, the combobox is populated from scratch using information retrieved from CodeTools. If the Procedure List window is close, everything is cleared and free.

So where exactly would "adding things later" occur?

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Jürgen Hestermann
to Graeme Geldenhuys
Show quoted text 8 lines
> That's only a tedious workaround but if you later add something to your > list you would have to remove the first element, set "Sorted" true and back > to false, then add the first element again. Not an elegant solution. That should never be an issue. Every time you use Procedure List, the combobox is populated from scratch using information retrieved from CodeTools. If the Procedure List window is close, everything is cleared and free. So where exactly would "adding things later" occur?

Oh yes. I have not read the details. I just had in mind what I experienced with StringLists where it seems that you also have to do such workarounds. Ok, in this case my objection may not be valid. It was meant for list sorting in a more general way (especially StringLists).

Reply by email