Mercurial > hg > ltpda
comparison m-toolbox/m/gui/ltpdv/callbacks/ltpdv_delete_objects.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 function ltpdv_delete_objects(varargin) | |
2 | |
3 % LTPDV_DELETE_OBJECTS delete the selected objects from the object list | |
4 % | |
5 % M Hewitson 22-04-08 | |
6 % | |
7 % $Id: ltpdv_delete_objects.m,v 1.1 2008/05/11 10:38:43 hewitson Exp $ | |
8 % | |
9 | |
10 % Handles | |
11 clearAll = false; | |
12 if nargin == 3 | |
13 myh = varargin{1}; | |
14 mainfig = varargin{end}; | |
15 elseif nargin == 4 | |
16 myh = varargin{1}; | |
17 mainfig = varargin{end-1}; | |
18 if strcmp(varargin{end}, 'all') | |
19 clearAll = true; | |
20 end | |
21 end | |
22 | |
23 % Get selected rows | |
24 rows = getappdata(mainfig, 'ObjectListSelectedRows'); | |
25 | |
26 if clearAll | |
27 % Set new object list | |
28 setappdata(mainfig, 'LTPDAobjects', {}); | |
29 else | |
30 % Get current object list | |
31 objs = getappdata(mainfig, 'LTPDAobjects'); | |
32 | |
33 % Build index list to keep | |
34 a = 1:length(objs); | |
35 idx = a(~ismember(a,rows)); | |
36 % Set new object list | |
37 setappdata(mainfig, 'LTPDAobjects', objs(idx)); | |
38 end | |
39 | |
40 | |
41 % Refresh object list | |
42 ltpdv_refresh_object_list(mainfig); | |
43 | |
44 % END |