comparison m-toolbox/classes/@repogui/buildMainFig.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 % BUILDMAINFIG build the main repo gui figure
2 %
3 % M Hewitson 22-09-08
4 %
5 % $Id: buildMainFig.m,v 1.4 2009/05/15 14:59:12 nicola Exp $
6 %
7 function mainfig = buildMainFig(mainfig, varargin)
8
9 warning off MATLAB:uitab:DeprecatedFunction
10 warning off MATLAB:uitabgroup:DeprecatedFunction
11
12 % Some initial setup
13 import utils.const.*
14 prefs = getappdata(0, 'LTPDApreferences');
15 utils.helper.msg(msg.PROC1, 'building Main Figure');
16
17 Screen = get(0,'screensize');
18 wsize = prefs.repository.winsize;
19 mainfig.Gproperties.Screen = Screen;
20 mainfig.Gproperties.Gwidth = wsize(1);
21 mainfig.Gproperties.Gheight = wsize(2);
22 mainfig.Gproperties.Gborder = 10;
23 mainfig.Gproperties.fontsize = prefs.repository.fontsize;
24
25 l = (0.5-mainfig.Gproperties.Gwidth/2);
26 b = (0.5-mainfig.Gproperties.Gheight/2);
27 w = mainfig.Gproperties.Gwidth;
28 h = mainfig.Gproperties.Gheight;
29 mainfig.Gproperties.Gposition = [l b w h];
30
31 % mainfig.Gproperties.Gcol{1} = [150 180 200]/255;
32 % mainfig.Gproperties.Gcol{2} = [200 200 180]/255;
33 % mainfig.Gproperties.Gcol{3} = [180 150 200]/255;
34 % mainfig.Gproperties.Gcol{4} = [150 200 180]/255;
35
36 mainfig.Gproperties.Gcol{1} = [1 1 1];
37 mainfig.Gproperties.Gcol{2} = [1 1 1];
38 mainfig.Gproperties.Gcol{3} = [1 1 1];
39 mainfig.Gproperties.Gcol{4} = [1 1 1];
40 mainfig.Gproperties.Gcol{5} = [1 1 1];
41
42 if ~isempty(varargin) && ishandle(varargin{1})
43 mainfig.handle = varargin{1};
44 set(mainfig.handle, 'Tag', 'REPOGUImainfig');
45 set(mainfig.handle, 'Units', 'normalized');
46 else
47 % Initialize and hide the GUI as it is being constructed.
48 mainfig.handle = figure('Name', 'LTPDA Repository GUI',...
49 'NumberTitle', 'off',...
50 'Visible','off',...
51 'Units','normalized',...
52 'Position',mainfig.Gproperties.Gposition,...
53 'Toolbar', 'none',...
54 'MenuBar', 'none',...
55 'Color', 'w',...
56 'Resize', 'on',...
57 'Tag', 'REPOGUImainfig');
58 end
59
60
61 % Set mainfig callbacks
62 set(mainfig.handle, 'CloseRequestFcn', {'repogui.cb_mainfigClose', mainfig});
63
64
65 % Setup GUI elements
66
67 %----------- Status bar
68
69 Hmargin = 0.0;
70 Vmargin = 0.0;
71
72 %-- Status bar
73 Sleft = .01;
74 Sbottom = .01;
75 Swidth = 1-0.02;
76 Sheight = 0.10-0.02;
77 uicontrol(mainfig.handle,'Style','text',...
78 'String','not connected',...
79 'TooltipString','Current status',...
80 'Units','normalized',...
81 'Fontsize', mainfig.Gproperties.fontsize+1,...
82 'BackgroundColor', [.9 .9 .9],...
83 'ForegroundColor', 'r', ...
84 'HorizontalAlignment', 'center',...
85 'Max', 100,...
86 'Position',[Sleft Sbottom Swidth Sheight],...
87 'Tag', 'RepoguiStatusTxt');
88
89 %------------------------------------------------------------------------
90 %------------------------------------------------------------------------
91 %----------- TAB PANEL
92 %------------------------------------------------------------------------
93 %------------------------------------------------------------------------
94 PanLeft = Hmargin;
95 Tleft = PanLeft + Hmargin;
96 Theight = 1-2*Vmargin -0.1 - 0.01;
97 Tbottom = 0.1;
98 Twidth = 1;
99
100 htab = uitabgroup('v0', 'Parent', mainfig.handle, ...
101 'Units','normalized',...
102 'Position',[Tleft Tbottom Twidth Theight],...
103 'BackgroundColor', mainfig.Gproperties.Gcol{1}, ...
104 'SelectionChangeFcn', {'repogui.cb_tabChanged', mainfig});
105 t1 = uitab('v0', htab, 'title', ' Connect ');
106 t2 = uitab('v0', htab, 'title', ' Submit ');
107 t3 = uitab('v0', htab, 'title', ' Query ');
108 t3b= uitab('v0', htab, 'title', ' High Level Queries ');
109 t4 = uitab('v0', htab, 'title', ' Retrieve ');
110
111
112 % Set app data
113 mainfig.panels = [t1 t2 t3 t4 t3b];
114 end