Le vendredi 28 Octobre 2005 23:20, Marc Weustink a écrit : > jean-marc levecque wrote: > > Great Marc, adding a simple procedure works fine. > > > > I don't really know how to give the modification, or make a patch, so I > > will just describe here: > > > > in ComCtrls, CustomListView, add the public procedure: > > > > procedure ShowSelectedItem(const APartialOK: Boolean); > > Whoops, I now see that a part was missing of my reply. > There is already an Item.MakeVisible(APartial); > > So the only thing ShowSelectedItem would add is > if FSelected <> nil then FSelected.MakeVisible(APartial); > > Don't know, personally I wouldn't add a function for that, maybe someone > can convince me :) > > Marc
Well, I think you are right, just writting ListView.Selected.MakeVisible(APartial) after FindCaption or after checking Selected<> nil makes the item show up I just didn't notice this method exists So, forget my unnecessary additional procedure Thanks for guiding me on the good way > > > and in customlistview.inc, add the implementation: > > > > procedure TCustomListView.ShowSelectedItem(const APartialOK: Boolean); > > begin > > SetItemVisible(FSelected,APartialOK); > > end; > > > > Call this procedure just after ListView.Selected=FindCaption(...... ) > > works fine, and may probably be used to position a list to beginning or > > end by selecting first or last item.. > > Hope this may be usefull to someone else. > > > > Thanks a lot > > > > Le vendredi 28 Octobre 2005 18:12, Marc Weustink a écrit : > >>jean-marc levecque wrote: > >>>Hi, > >>> > >>>Porting an app from delphi, which is ok for the most important parts on > >>>Win and Linux, I just miss a few things which seem not available yet. > >>> One of these is scroll in a list view by progrm, to get an item in the > >>> view when choosen from a combobox by typing the beginning of the > >>> caption for instance (very practical for the end user in big lists). > >>>Searching in the source in customlistview.inc, I can see that procedure > >>>WMVScroll is there,and may be a new public procedure Scroll could be > >>>created to call this procedure, setting ScrollCode to SB_THUMBPOSITION > >>>and a value to Pos to initiate a scroll by program, but I don't know > >>> what to do about the other values of the Msg record. > >>>I have always been a user, not professional, and don't feel good enough > >>>to do this myself. > >>>Thanks for information to guide me. > >> > >>Don't rely on wmscroll for this. What you can use is Item.Visible > >> > >>Marc > >> > >>_________________________________________________________________ > >> To unsubscribe: mail [EMAIL PROTECTED] with > >> "unsubscribe" as the Subject > >> archives at http://www.lazarus.freepascal.org/mailarchives > > > > _________________________________________________________________ > > To unsubscribe: mail [EMAIL PROTECTED] with > > "unsubscribe" as the Subject > > archives at http://www.lazarus.freepascal.org/mailarchives > > _________________________________________________________________ > To unsubscribe: mail [EMAIL PROTECTED] with > "unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
