line source
% BUILDCONNECTPANEL build the connection panel
%
% M Hewitson 22-09-08
%
% $Id: buildConnectPanel.m,v 1.5 2011/04/08 08:56:25 hewitson Exp $
%
function buildConnectPanel( mainfig)
import utils.const.*
prefs = getappdata(0, 'LTPDApreferences');
utils.helper.msg(msg.PROC1, 'building Connect Panel');
htab = mainfig.panels(1);
backColor = mainfig.Gproperties.Gcol{1};
Gproperties = mainfig.Gproperties;
pmarg = 0.025;
% Get list of default servers set by ltpda_startup
servers = prefs.repository.servers;
if isempty(servers)
servers = {' '};
end
CommonHeight = 0.06;
UseWidth = 0.8;
% text description field
bw = UseWidth;
bl = 0.5-bw/2;
bh = CommonHeight;
bb = 1-2*pmarg-bh;
sth = uicontrol(htab, 'Style','text',...
'String', 'Select Repository',...
'Units', 'normalized', ...
'BackgroundColor', backColor, ...
'FontWeight','Bold',...
'Fontsize', Gproperties.fontsize+2, ...
'Position',[bl bb bw bh]);
% Add hostname drop-down box
bw = 0.5-bl-pmarg;
bh = CommonHeight;
bb = bb - pmarg - bh;
clsh = uicontrol(htab, ...
'Style', 'popupmenu', ...
'Units', 'normalized',...
'Fontsize', Gproperties.fontsize, ...
'BackgroundColor', 'w', ...
'String', servers, ...
'Position', [bl bb bw bh],...
'Tag', 'RepoguiServerList', ...
'Callback', {'repogui.cb_select_repo', mainfig});
% Hostname edit box
bl = bl + bw + 2*pmarg;
th = uicontrol(htab, ...
'Style', 'edit', ...
'Units', 'normalized',...
'BackgroundColor', 'w', ...
'Fontsize', Gproperties.fontsize, ...
'String', '', ...
'Position', [bl bb bw bh],...
'Tag', 'RepoguiServerEdit');
% text description field
bw = UseWidth;
bl = 0.5-bw/2;
bb = bb - 6*pmarg;
sth = uicontrol(htab, 'Style','text',...
'String', 'Select Database',...
'Units', 'normalized', ...
'BackgroundColor', backColor, ...
'FontWeight','Bold',...
'Fontsize', Gproperties.fontsize+2, ...
'Position',[bl bb bw bh]);
% db drop-down box
bw = (UseWidth-2*pmarg)/3;
bh = CommonHeight;
bb = bb - pmarg - bh;
clsh = uicontrol(htab, ...
'Style', 'popupmenu', ...
'Units', 'normalized',...
'Fontsize', Gproperties.fontsize, ...
'BackgroundColor', 'w', ...
'String', {'ltpda_test'}, ...
'Position', [bl bb bw bh],...
'Tag', 'RepoguiDatabaseList', ...
'Callback', {'repogui.cb_select_db', mainfig});
% get DBs button
bl = bl + pmarg + bw;
pbh = uicontrol(htab,'Style','pushbutton',...
'String','Get DBs',...
'Callback', {'repogui.cb_get_dbs', mainfig}, ...
'Units', 'normalized', ...
'Fontsize', Gproperties.fontsize, ...
'Position',[bl bb bw bh]);
% db edit field
bl = bl + pmarg + bw;
th = uicontrol(htab, ...
'Style', 'edit', ...
'Units', 'normalized',...
'BackgroundColor', 'w', ...
'Fontsize', Gproperties.fontsize, ...
'String', '', ...
'Position', [bl bb bw bh],...
'Tag', 'RepoguiDatabaseEdit');
% Connect button
bb = bb - 10*pmarg;
bl = 0.5-UseWidth/2;
bw = UseWidth;
pbh = uicontrol(htab,'Style','pushbutton',...
'String','Connect',...
'Callback', {'repogui.cb_connect', mainfig}, ...
'Units', 'normalized', ...
'Fontsize', Gproperties.fontsize, ...
'Position',[bl bb bw 2*bh],...
'Tag','ConnectButton');
end