Mercurial > hg > ltpda
comparison m-toolbox/classes/@repogui2/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.4 2011/04/08 08:56:36 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 | |
16 Gproperties = mainfig.Gproperties; | |
17 pmarg = 0.025; | |
18 | |
19 % Get list of default servers set by ltpda_startup | |
20 servers = prefs.repository.servers; | |
21 | |
22 CommonHeight = 0.06; | |
23 UseWidth = 0.8; | |
24 | |
25 % text description field | |
26 bw = UseWidth; | |
27 bl = 0.5-bw/2; | |
28 bh = CommonHeight; | |
29 bb = 1-2*pmarg-bh; | |
30 sth = uicontrol(htab, 'Style','text',... | |
31 'String', 'Select Repository',... | |
32 'Units', 'normalized', ... | |
33 'BackgroundColor', 'w', ... | |
34 'Fontsize', Gproperties.fontsize+2, ... | |
35 'Position',[bl bb bw bh]); | |
36 | |
37 % Add hostname drop-down box | |
38 bw = 0.5-bl-pmarg; | |
39 bh = CommonHeight; | |
40 bb = bb - pmarg - bh; | |
41 | |
42 clsh = uicontrol(htab, ... | |
43 'Style', 'popupmenu', ... | |
44 'Units', 'normalized',... | |
45 'Fontsize', Gproperties.fontsize, ... | |
46 'BackgroundColor', 'w', ... | |
47 'String', servers, ... | |
48 'Position', [bl bb bw bh],... | |
49 'Tag', 'RepoguiServerList', ... | |
50 'Callback', {'repogui2.cb_select_repo', mainfig}); | |
51 | |
52 % Hostname edit box | |
53 bl = bl + bw + 2*pmarg; | |
54 th = uicontrol(htab, ... | |
55 'Style', 'edit', ... | |
56 'Units', 'normalized',... | |
57 'BackgroundColor', 'w', ... | |
58 'Fontsize', Gproperties.fontsize, ... | |
59 'String', '', ... | |
60 'Position', [bl bb bw bh],... | |
61 'Tag', 'RepoguiServerEdit'); | |
62 | |
63 | |
64 % text description field | |
65 bw = UseWidth; | |
66 bl = 0.5-bw/2; | |
67 bb = bb - 6*pmarg; | |
68 sth = uicontrol(htab, 'Style','text',... | |
69 'String', 'Select Database',... | |
70 'Units', 'normalized', ... | |
71 'BackgroundColor', 'w', ... | |
72 'Fontsize', Gproperties.fontsize+2, ... | |
73 'Position',[bl bb bw bh]); | |
74 | |
75 % db drop-down box | |
76 bw = (UseWidth-2*pmarg)/3; | |
77 bh = CommonHeight; | |
78 bb = bb - pmarg - bh; | |
79 | |
80 clsh = uicontrol(htab, ... | |
81 'Style', 'popupmenu', ... | |
82 'Units', 'normalized',... | |
83 'Fontsize', Gproperties.fontsize, ... | |
84 'BackgroundColor', 'w', ... | |
85 'String', {'ltpda_test'}, ... | |
86 'Position', [bl bb bw bh],... | |
87 'Tag', 'RepoguiDatabaseList', ... | |
88 'Callback', {'repogui2.cb_select_db', mainfig}); | |
89 | |
90 % get DBs button | |
91 bl = bl + pmarg + bw; | |
92 pbh = uicontrol(htab,'Style','pushbutton',... | |
93 'String','Get DBs',... | |
94 'Callback', {'repogui2.cb_get_dbs', mainfig}, ... | |
95 'Units', 'normalized', ... | |
96 'Fontsize', Gproperties.fontsize, ... | |
97 'Position',[bl bb bw bh]); | |
98 | |
99 | |
100 % db edit field | |
101 bl = bl + pmarg + bw; | |
102 th = uicontrol(htab, ... | |
103 'Style', 'edit', ... | |
104 'Units', 'normalized',... | |
105 'BackgroundColor', 'w', ... | |
106 'Fontsize', Gproperties.fontsize, ... | |
107 'String', '', ... | |
108 'Position', [bl bb bw bh],... | |
109 'Tag', 'RepoguiDatabaseEdit'); | |
110 | |
111 % Connect button | |
112 bb = bb - 10*pmarg; | |
113 bl = 0.5-UseWidth/2; | |
114 bw = UseWidth; | |
115 pbh = uicontrol(htab,'Style','pushbutton',... | |
116 'String','Connect',... | |
117 'Callback', {'repogui2.cb_connect', mainfig}, ... | |
118 'Units', 'normalized', ... | |
119 'Fontsize', Gproperties.fontsize, ... | |
120 'Position',[bl bb bw 2*bh]); | |
121 | |
122 | |
123 end |