source: subversion/applications/routing/pyroute-dev/listable.py @ 18454

Last change on this file since 18454 was 18454, checked in by buerste, 10 years ago

-further updates of spaces to tabs

  • Property svn:keywords set to Rev
File size: 1.6 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4"""Interface for things which can be listed
5
6Usage:
7        (base-class for pyroute GUI libraries)
8"""
9
10__version__ = "$Rev: 18454 $"
11__license__ = """This program is free software: you can redistribute it and/or modify
12it under the terms of the GNU General Public License as published by
13the Free Software Foundation, either version 3 of the License, or
14(at your option) any later version.
15
16This program is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License
22along with this program. If not, see <http://www.gnu.org/licenses/>."""
23_debug = 0
24
25
26class listable:
27        """Base-class (interface) for anything that can be listed in a menu"""
28        def numItems(self):
29                """Return how many items are available"""
30                return(0)
31
32        def getItemText(self,n):
33                """Return the label for any item number"""
34                return("-")
35
36        def getItemStatus(self,n):
37                """Return current status for any item number"""
38                return("-")
39
40        def isLocation(self,n):
41                """Return true if the item represents a location"""
42                return(False)
43
44        def getItemLatLon(self,n):
45                """If the item represents a location, return it's position"""
46                return(0,0)
47
48        def getItemClickable(self,n):
49                """If not a location, return true if the item should have a button to click on"""
50                return(False)
51
52        def getItemAction(self,n):
53                """If the item isn't a location, return what happens if it's selected"""
54                return("")
55
Note: See TracBrowser for help on using the repository browser.