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