www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@mbcwidgets/@itemList/sortList.m

    function obj = sortList(obj, sortcol)
%SORTLIST Sort the items in the list
%
%  SORTLIST(OBJ, SORTORDER) sorts the items that are currently in the list.
%  SORTORDER specifies which column is used first to sort the list and in
%  which order.  
%
%  For example:
%
%    obj.sortList([1 2]) sorts by Item string and then Type in ascending
%    order.
%
%    obj.sortList([2 -1]) sorts by type in ascending order and then by item
%    in descending order.
%  

%  Copyright 2000-2006 The MathWorks, Inc. and Ford Global Technologies, Inc.


for n = sortcol(end:-1:1)
    obj.Display.Peer.setSortBy( abs(n)-1, sign(n) );
end