comparison m-toolbox/classes/@repogui/buildConnectPanel.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 % BUILDCONNECTPANEL build the connection panel
2 %
3 % M Hewitson 22-09-08
4 %
5 % $Id: buildConnectPanel.m,v 1.5 2011/04/08 08:56:25 hewitson Exp $
6 %
7
8 function buildConnectPanel( mainfig)
9
10 import utils.const.*
11 prefs = getappdata(0, 'LTPDApreferences');
12 utils.helper.msg(msg.PROC1, 'building Connect Panel');
13
14 htab = mainfig.panels(1);
15 backColor = mainfig.Gproperties.Gcol{1};
16
17 Gproperties = mainfig.Gproperties;
18 pmarg = 0.025;
19
20 % Get list of default servers set by ltpda_startup
21 servers = prefs.repository.servers;
22 if isempty(servers)
23 servers = {' '};
24 end
25
26 CommonHeight = 0.06;
27 UseWidth = 0.8;
28
29 % text description field
30 bw = UseWidth;
31 bl = 0.5-bw/2;
32 bh = CommonHeight;
33 bb = 1-2*pmarg-bh;
34 sth = uicontrol(htab, 'Style','text',...
35 'String', 'Select Repository',...
36 'Units', 'normalized', ...
37 'BackgroundColor', backColor, ...
38 'FontWeight','Bold',...
39 'Fontsize', Gproperties.fontsize+2, ...
40 'Position',[bl bb bw bh]);
41
42 % Add hostname drop-down box
43 bw = 0.5-bl-pmarg;
44 bh = CommonHeight;
45 bb = bb - pmarg - bh;
46
47 clsh = uicontrol(htab, ...
48 'Style', 'popupmenu', ...
49 'Units', 'normalized',...
50 'Fontsize', Gproperties.fontsize, ...
51 'BackgroundColor', 'w', ...
52 'String', servers, ...
53 'Position', [bl bb bw bh],...
54 'Tag', 'RepoguiServerList', ...
55 'Callback', {'repogui.cb_select_repo', mainfig});
56
57 % Hostname edit box
58 bl = bl + bw + 2*pmarg;
59 th = uicontrol(htab, ...
60 'Style', 'edit', ...
61 'Units', 'normalized',...
62 'BackgroundColor', 'w', ...
63 'Fontsize', Gproperties.fontsize, ...
64 'String', '', ...
65 'Position', [bl bb bw bh],...
66 'Tag', 'RepoguiServerEdit');
67
68
69 % text description field
70 bw = UseWidth;
71 bl = 0.5-bw/2;
72 bb = bb - 6*pmarg;
73 sth = uicontrol(htab, 'Style','text',...
74 'String', 'Select Database',...
75 'Units', 'normalized', ...
76 'BackgroundColor', backColor, ...
77 'FontWeight','Bold',...
78 'Fontsize', Gproperties.fontsize+2, ...
79 'Position',[bl bb bw bh]);
80
81 % db drop-down box
82 bw = (UseWidth-2*pmarg)/3;
83 bh = CommonHeight;
84 bb = bb - pmarg - bh;
85
86 clsh = uicontrol(htab, ...
87 'Style', 'popupmenu', ...
88 'Units', 'normalized',...
89 'Fontsize', Gproperties.fontsize, ...
90 'BackgroundColor', 'w', ...
91 'String', {'ltpda_test'}, ...
92 'Position', [bl bb bw bh],...
93 'Tag', 'RepoguiDatabaseList', ...
94 'Callback', {'repogui.cb_select_db', mainfig});
95
96 % get DBs button
97 bl = bl + pmarg + bw;
98 pbh = uicontrol(htab,'Style','pushbutton',...
99 'String','Get DBs',...
100 'Callback', {'repogui.cb_get_dbs', mainfig}, ...
101 'Units', 'normalized', ...
102 'Fontsize', Gproperties.fontsize, ...
103 'Position',[bl bb bw bh]);
104
105
106 % db edit field
107 bl = bl + pmarg + bw;
108 th = uicontrol(htab, ...
109 'Style', 'edit', ...
110 'Units', 'normalized',...
111 'BackgroundColor', 'w', ...
112 'Fontsize', Gproperties.fontsize, ...
113 'String', '', ...
114 'Position', [bl bb bw bh],...
115 'Tag', 'RepoguiDatabaseEdit');
116
117 % Connect button
118 bb = bb - 10*pmarg;
119 bl = 0.5-UseWidth/2;
120 bw = UseWidth;
121 pbh = uicontrol(htab,'Style','pushbutton',...
122 'String','Connect',...
123 'Callback', {'repogui.cb_connect', mainfig}, ...
124 'Units', 'normalized', ...
125 'Fontsize', Gproperties.fontsize, ...
126 'Position',[bl bb bw 2*bh],...
127 'Tag','ConnectButton');
128
129
130 end