View Issue Details

IDProjectCategoryView StatusLast Update
0004873JEDI VCL00 JVCL Componentspublic2009-08-05 14:17
ReportermazjacAssigned Toobones 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.37 
Target VersionFixed in Version3.38 
Summary0004873: TJVCheckedComboBox - Items in TextBox should be in same order as the items in the Popup List
DescriptionWhen Items are selected in the TJVCheckedComboBox Popup Windows ListBox, then they are added to the Textbox in the chronological order that they are selected. If an item is deselected and selected it moves to the end of the Textbox string. Again if "Select All" is used from Listbox popup then the Textbox string is reordered. Mildly annoying. See JVTest-NoListOrder.exe

I think that a better solution would be to always order the items in the TextBox in the same order as the items in the ListBox List. See JV-ListOrder.exe. A property could be added to select this (or the old) behaviour.


Additional InformationThe following code changes in (in JVCombobox.pas) orders the items in the TextBox according to the list.
  
procedure TJvCustomCheckedComboBox.ToggleOnOff(Sender: TObject);
var
  I : integer;
  S: string;

begin
  if FListBox.ItemIndex = -1 then
    Exit;
// Orginal Code - moved to else if checked statements
// S:= Text;
  if FListBox.Checked[FListBox.ItemIndex] then
  begin
// Original Code
// if Add(FListBox.Items[FListBox.ItemIndex], S, Delimiter) then
// Replaced by Mark Davis 23/07/2009
      S:= '';
      for I := 0 to FListBox.Count - 1 do
        begin
          if FListBox.Checked[i] then
            begin
              if S <> '' then
                S:= S + FDelimiter;
              S:= S + FListBox.Items[I];
            end;
        end;
      FCheckedCount := FCheckedCount + 1;
// End of Added Code by Mark Davis 23/07/2009
  end
  else
    begin
// Added from above only needs to occur if false
      S:= Text;
  if Remove(FListBox.Items[FListBox.ItemIndex], S, Delimiter) then
    FCheckedCount := FCheckedCount - 1;
    end;
  ChangeText(S);
  Change;
end;
TagsNo tags attached.

Activities

2009-07-23 04:11

 

JVTestProject2.zip (921,064 bytes)

obones

2009-07-23 09:04

administrator   ~0015879

Please provide the zipped sources of both projects

2009-07-24 08:12

 

jvtest.zip (4,898 bytes)

mazjac

2009-07-24 08:12

reporter   ~0015889

I have just upload the source code.

Delphi 2007 Project.
JVCL : 3.37 (3.34 exhibited same problem)

Same source for both projects, one compiled with existing JVCL code, the other with code as noted above.

obones

2009-08-05 14:17

administrator   ~0015934

This is now in SVN, new property OrderedText, defaults to False, that you have to set to True to get your desired behavior.

Issue History

Date Modified Username Field Change
2009-07-23 04:11 mazjac New Issue
2009-07-23 04:11 mazjac File Added: JVTestProject2.zip
2009-07-23 09:04 obones Note Added: 0015879
2009-07-23 09:04 obones Status new => feedback
2009-07-24 08:12 mazjac File Added: jvtest.zip
2009-07-24 08:12 mazjac Note Added: 0015889
2009-08-05 14:17 obones Note Added: 0015934
2009-08-05 14:17 obones Status feedback => resolved
2009-08-05 14:17 obones Fixed in Version => Daily / SVN
2009-08-05 14:17 obones Resolution open => fixed
2009-08-05 14:17 obones Assigned To => obones