Imported Upstream version 3.2.2
[debian/gnuradio] / grc / gui / Constants.py
1 """
2 Copyright 2008, 2009 Free Software Foundation, Inc.
3 This file is part of GNU Radio
4
5 GNU Radio Companion is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 GNU Radio Companion is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
18 """
19
20 import pygtk
21 pygtk.require('2.0')
22 import gtk
23 import os
24
25 ##default path for the open/save dialogs
26 DEFAULT_FILE_PATH = os.getcwd()
27
28 ##file extensions
29 IMAGE_FILE_EXTENSION = '.png'
30
31 ##name for new/unsaved flow graphs
32 NEW_FLOGRAPH_TITLE = 'untitled'
33
34 ##main window constraints
35 MIN_WINDOW_WIDTH = 600
36 MIN_WINDOW_HEIGHT = 400
37 ##dialog constraints
38 MIN_DIALOG_WIDTH = 500
39 MIN_DIALOG_HEIGHT = 500
40 ##default sizes
41 DEFAULT_BLOCKS_WINDOW_WIDTH = 100
42 DEFAULT_REPORTS_WINDOW_WIDTH = 100
43
44 ##The size of the state saving cache in the flow graph (for undo/redo functionality)
45 STATE_CACHE_SIZE = 42
46
47 ##Shared targets for drag and drop of blocks
48 DND_TARGETS = [('STRING', gtk.TARGET_SAME_APP, 0)]
49
50 #label constraint dimensions
51 LABEL_SEPARATION = 3
52 BLOCK_LABEL_PADDING = 7
53 PORT_LABEL_PADDING = 2
54
55 #port constraint dimensions
56 PORT_SEPARATION = 17
57 PORT_BORDER_SEPARATION = 9
58 PORT_MIN_WIDTH = 20
59
60 #minimal length of connector
61 CONNECTOR_EXTENSION_MINIMAL = 11
62
63 #increment length for connector
64 CONNECTOR_EXTENSION_INCREMENT = 11
65
66 #connection arrow dimensions
67 CONNECTOR_ARROW_BASE = 13
68 CONNECTOR_ARROW_HEIGHT = 17
69
70 #possible rotations in degrees
71 POSSIBLE_ROTATIONS = (0, 90, 180, 270)
72
73 #How close can the mouse get to the window border before mouse events are ignored.
74 BORDER_PROXIMITY_SENSITIVITY = 50
75
76 #How close the mouse can get to the edge of the visible window before scrolling is invoked.
77 SCROLL_PROXIMITY_SENSITIVITY = 30
78
79 #When the window has to be scrolled, move it this distance in the required direction.
80 SCROLL_DISTANCE = 15
81
82 #How close the mouse click can be to a line and register a connection select.
83 LINE_SELECT_SENSITIVITY = 5