Home > m > gui > ltpdaRepoGUI > repogui.m

repogui

PURPOSE ^

REPOGUI a GUI to interact with an LTPDA Repository.

SYNOPSIS ^

function varargout = repogui(varargin)

DESCRIPTION ^

 REPOGUI a GUI to interact with an LTPDA Repository.

 M Hewitson

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function varargout = repogui(varargin)
0002 
0003 % REPOGUI a GUI to interact with an LTPDA Repository.
0004 %
0005 % M Hewitson
0006 %
0007 
0008 % addpath('callbacks');
0009 
0010 %% Check if I exist already
0011 id = findobj('Tag', 'LTPDARepomainfig');
0012 if ~isempty(id)
0013   figure(id)
0014   return
0015 end
0016 
0017 %% Some initial setup
0018 
0019 
0020 
0021 Gproperties.Gcol    = [240 240 240]/255;
0022 Gproperties.Gwidth  = 800;
0023 Gproperties.Gheight = 600;
0024 Gproperties.Gborder = 10;
0025 fontsize = getappdata(0, 'ltpda_repo_gui_fontsize');
0026 
0027 Gproperties.Screen   = get(0,'screensize');
0028 Gproperties.Gposition = [Gproperties.Screen(3)/2-Gproperties.Gwidth/2 ...
0029   Gproperties.Screen(4)/2-Gproperties.Gheight/2 ...
0030   Gproperties.Gwidth...
0031   Gproperties.Gheight];
0032 
0033 %  Initialize and hide the GUI as it is being constructed.
0034 mainfig = figure('Name', 'LTPDA Repository GUI',...
0035   'NumberTitle', 'off',...
0036   'Visible','off',...
0037   'Position',Gproperties.Gposition,...
0038   'Color', Gproperties.Gcol,...
0039   'Toolbar', 'none',...
0040   'MenuBar', 'none',...
0041   'Resize', 'off',...
0042   'Tag', 'LTPDARepomainfig');
0043 
0044 % Set mainfig callbacks
0045 set(mainfig, 'CloseRequestFcn', {'cb_mainfigClose', mainfig});
0046 
0047 % Set Application data
0048 setappdata(mainfig, 'Gproperties', Gproperties);
0049 setappdata(mainfig, 'connection', []);
0050 setappdata(mainfig, 'Nconditions', 0);
0051 setappdata(mainfig, 'tableSelected', 1);
0052 
0053 %% Add components
0054 
0055 Tleft   = Gproperties.Gborder/Gproperties.Gwidth;
0056 Theight = 1-2*Gproperties.Gborder/Gproperties.Gheight;
0057 Tbottom = (1 - Gproperties.Gborder/Gproperties.Gheight - Theight);
0058 Twidth  = 1-2*Gproperties.Gborder/Gproperties.Gwidth;
0059 
0060 htab = uitabpanel(...
0061   'Parent',mainfig,...
0062   'Style','lefttop',...
0063   'Units','normalized',...
0064   'Position',[Tleft Tbottom Twidth Theight],...
0065   'Fontsize', fontsize,...
0066   'FrameBackgroundColor',Gproperties.Gcol,...
0067   'FrameBorderType','etchedout',...
0068   'Title',{'Connection','Submit','Query', 'Retrieve'},...%, 'Quick Look'},...
0069   'HorizontalAlignment','left',...
0070   'FontWeight','bold',...
0071   'TitleBackgroundColor',Gproperties.Gcol,...
0072   'TitleForegroundColor','k',...
0073   'TitleHighlightColor', [1 0 0],...
0074   'PanelBackgroundColor',Gproperties.Gcol,...
0075   'PanelBorderType','line');
0076 
0077 hpanel = getappdata(htab,'panels');
0078 setappdata(mainfig, 'panels', hpanel);
0079 
0080 %-------- Connection Panel -------------
0081 cp = create_connection_panel(hpanel(1), Gproperties);
0082 %-------- Submit Panel -------------
0083 sp = create_submit_panel(hpanel(2), Gproperties);
0084 %-------- Query Panel -------------
0085 qp = create_query_panel(hpanel(3), Gproperties);
0086 %-------- Query Panel -------------
0087 rp = create_retrieve_panel(hpanel(4), Gproperties);
0088 %-------- Quick Look Panel -------------
0089 % rp = create_quicklook_panel(hpanel(5), Gproperties);
0090 
0091 
0092 %% Start the GUI
0093 
0094 % Make the GUI visible.
0095 set(mainfig,'Visible','on')
0096 
0097 h = findobj(mainfig, 'Tag', 'statusTxt');
0098 get(h, 'String')
0099 
0100 end
0101 
0102 %--------------------------------------------------------------------------
0103 % Create the quick look panel
0104 %
0105 function panel = create_quicklook_panel(panel, Gproperties)
0106 
0107 Ppos    = get(panel, 'Position');
0108 mainfig = findobj('Tag', 'LTPDARepomainfig');
0109 
0110 %-- Text string
0111 Sleft   = 10;
0112 Sheight = 20;
0113 Sbottom = Ppos(2) + Ppos(4) - 20 - Gproperties.Gborder - Sheight;
0114 Swidth  = 200;
0115 fontsize = getappdata(0, 'ltpda_repo_gui_fontsize');
0116 sth = uicontrol(panel,'Style','text',...
0117   'String','LTPDA Objects',...
0118   'Fontsize', fontsize,...
0119   'BackgroundColor', Gproperties.Gcol,...
0120   'HorizontalAlignment', 'center',...
0121   'Position',[Sleft Sbottom Swidth Sheight]);
0122 
0123 %-- Workspace list of LTPDA objects
0124 Lleft   = 10;
0125 Lheight = 350;
0126 Lbottom = Ppos(2) + Ppos(4) - 40 - Gproperties.Gborder - Lheight;
0127 Lwidth  = Swidth;
0128 
0129 lbh = uicontrol(panel,'Style','listbox',...
0130   'String',{' '},...
0131   'Value',1,...
0132   'BackgroundColor', 'w',...
0133   'Fontsize', fontsize,...
0134   'Max', 1000,...
0135   'Position',[Lleft Lbottom Lwidth Lheight],...
0136   'Tag', 'workspaceObjsListQL');
0137 
0138 % Set callback
0139 set(lbh, 'Callback', {'cb_workspaceObjsListQL', lbh, mainfig});
0140 
0141 % fill list
0142 objs = getWorkspaceObjs();
0143 setWorkspaceObjsListQL(objs);
0144 
0145 %-- Refresh button
0146 pos     = get(lbh, 'Position');
0147 Bleft   = Lleft;
0148 Bheight = 20;
0149 Bwidth  = 100;
0150 Bbottom = pos(2) - Bheight - 10;
0151 pbh = uicontrol(panel,'Style','pushbutton','String','Refresh list',...
0152   'Position',[Bleft Bbottom Bwidth Bheight ],...
0153   'Tag', 'refreshListBtnQL');
0154 set(pbh, 'Callback', {'cb_refreshObjsListQL', pbh, mainfig});
0155 
0156 
0157 %-- Info panel
0158 pos = get(lbh, 'Position');
0159 Sleft   = 10 + pos(1) + pos(3);
0160 Sheight = 150;
0161 Sbottom = Ppos(2) + Ppos(4) - 40 - Gproperties.Gborder - Sheight;
0162 Swidth  = 550;
0163 iph = uicontrol(panel,'Style','edit',...
0164   'String','',...
0165   'Fontsize', fontsize,...
0166   'BackgroundColor', 'w',...
0167   'ForegroundColor', 'b',...
0168   'HorizontalAlignment', 'left',...
0169   'Enable', 'on',...
0170   'Max', 1000,...
0171   'Position',[Sleft Sbottom Swidth Sheight],...
0172   'Tag', 'ltpdaObjInfoQL');
0173 
0174 %-- Text string
0175 pos = get(iph, 'Position');
0176 Sheight = 20;
0177 Sbottom = pos(2) - Sheight - 20;
0178 Swidth  = 300;
0179 sth = uicontrol(panel,'Style','text',...
0180   'String','Class Methods',...
0181   'Fontsize', fontsize,...
0182   'BackgroundColor', Gproperties.Gcol,...
0183   'HorizontalAlignment', 'left',...
0184   'Position',[Sleft Sbottom Swidth Sheight]);
0185 
0186 %-- List of class methods
0187 pos = get(lbh, 'Position');
0188 Lleft   = pos(1) + pos(3) + 10;
0189 Lheight = 150;
0190 Lbottom = pos(2);
0191 Lwidth  = 150;
0192 
0193 lbh = uicontrol(panel,'Style','listbox',...
0194   'String',{' '},...
0195   'Value',1,...
0196   'BackgroundColor', 'w',...
0197   'Fontsize', fontsize,...
0198   'Max', 1000,...
0199   'Position',[Lleft Lbottom Lwidth Lheight],...
0200   'Tag', 'classMethodList');
0201 
0202 % Set callback
0203 set(lbh, 'Callback', {'cb_classMethodList', lbh, mainfig});
0204 
0205 % fill list
0206 fillClassMethodsList();
0207 
0208 %------------ Help panel
0209 pos = get(lbh, 'Position');
0210 Sleft   = pos(1) + pos(3) + 10;
0211 Sheight = 150;
0212 Sbottom = pos(2);
0213 Swidth  = 550;
0214 sth = uicontrol(panel,'Style','edit',...
0215   'String','',...
0216   'Fontsize', fontsize,...
0217   'BackgroundColor', 'w',...
0218   'ForegroundColor', 'b',...
0219   'HorizontalAlignment', 'left',...
0220   'Enable', 'on',...
0221   'Max', 1000,...
0222   'Position',[Sleft Sbottom Swidth Sheight],...
0223   'Tag', 'methodInfoPanel');
0224 
0225 
0226 end
0227 
0228 %--------------------------------------------------------------------------
0229 % Create the retrieve panel
0230 %
0231 function panel = create_retrieve_panel(panel, Gproperties)
0232 
0233 Ppos    = get(panel, 'Position');
0234 mainfig = findobj('Tag', 'LTPDARepomainfig');
0235 
0236 %-- Text string
0237 Sleft   = 10;
0238 Sheight = 20;
0239 Sbottom = Ppos(2) + Ppos(4) - 20 - Gproperties.Gborder - Sheight;
0240 Swidth  = 300;
0241 fontsize = getappdata(0, 'ltpda_repo_gui_fontsize');
0242 Osth = uicontrol(panel,'Style','text',...
0243   'String','Retrieve object IDs',...
0244   'Fontsize', fontsize,...
0245   'BackgroundColor', Gproperties.Gcol,...
0246   'HorizontalAlignment', 'left',...
0247   'Position',[Sleft Sbottom Swidth Sheight]);
0248 
0249 %-- ID entry
0250 pos     = get(Osth, 'Position');
0251 Sleft   = 10;
0252 Sheight = 250;
0253 Swidth  = 250;
0254 Sbottom = pos(2) - 20 - Sheight;
0255 
0256 sth = uicontrol(panel,'Style','edit',...
0257   'String','',...
0258   'Fontsize', fontsize,...
0259   'BackgroundColor', 'w',...
0260   'Max', 10,...
0261   'HorizontalAlignment', 'left',...
0262   'Position',[Sleft Sbottom Swidth Sheight],...
0263   'Tag', 'retrieveIDsTxt');
0264 
0265 %-- Prefix entry
0266 pos     = get(sth, 'Position');
0267 Sleft   = 10;
0268 Sheight = 20;
0269 Sbottom = pos(2) - 20 - Sheight;
0270 Swidth  = 50;
0271 sth = uicontrol(panel,'Style','text',...
0272   'String','Prefix',...
0273   'Fontsize', fontsize,...
0274   'BackgroundColor', Gproperties.Gcol,...
0275   'HorizontalAlignment', 'left',...
0276   'Position',[Sleft Sbottom Swidth Sheight]);
0277 
0278 
0279 Sleft   = Sleft + Swidth + 20;
0280 Sheight = 20;
0281 Swidth  = 150;
0282 sth = uicontrol(panel,'Style','edit',...
0283   'String','obj',...
0284   'Fontsize', fontsize,...
0285   'BackgroundColor', 'w',...
0286   'HorizontalAlignment', 'left',...
0287   'Position',[Sleft Sbottom Swidth Sheight],...
0288   'Tag', 'objPrefixTxt');
0289 
0290 %-- Append obj type
0291 pos = get(sth, 'Position');
0292 Sleft   = 10;
0293 Swidth  = 150;
0294 Sheight = 20;
0295 Sbottom = pos(2) - 20 - Sheight;
0296 cbh = uicontrol(panel,'Style','checkbox',...
0297   'String','Append object type',...
0298   'Fontsize', fontsize,...
0299   'BackgroundColor', Gproperties.Gcol,...
0300   'Value',1,'Position',[Sleft Sbottom Swidth Sheight],...
0301   'Tag', 'appendObjTypeChk');
0302 
0303 %-- Retrieve Btn
0304 
0305 Bleft   = 10;
0306 Bheight = 20;
0307 Bwidth  = 100;
0308 Bbottom = Ppos(2) + 10;
0309 pbh = uicontrol(panel,'Style','pushbutton','String','Retrieve',...
0310   'Position',[Bleft Bbottom Bwidth Bheight ],...
0311   'Fontsize', fontsize,...
0312   'Fontweight', 'bold',...
0313   'Tag', 'retrieveBtn');
0314 set(pbh, 'Callback', {'cb_retrieveBtn', pbh, mainfig});
0315 
0316 
0317 
0318 end
0319 
0320 %--------------------------------------------------------------------------
0321 % Create the Query panel
0322 %
0323 function panel = create_query_panel(panel, Gproperties)
0324 
0325 Ppos    = get(panel, 'Position');
0326 mainfig = findobj('Tag', 'LTPDARepomainfig');
0327 
0328 %-- Build conditions
0329 buildConditions(panel);
0330 
0331 end
0332 
0333 %--------------------------------------------------------------------------
0334 % Create the submit panel
0335 %
0336 function panel = create_submit_panel(panel, Gproperties)
0337 
0338 Ppos    = get(panel, 'Position');
0339 mainfig = findobj('Tag', 'LTPDARepomainfig');
0340 
0341 %-- Text string
0342 Sleft   = 10;
0343 Sheight = 20;
0344 Sbottom = Ppos(2) + Ppos(4) - 20 - Gproperties.Gborder - Sheight;
0345 Swidth  = 200;
0346 fontsize = getappdata(0, 'ltpda_repo_gui_fontsize');
0347 sth = uicontrol(panel,'Style','text',...
0348   'String','LTPDA Objects',...
0349   'Fontsize', fontsize,...
0350   'BackgroundColor', Gproperties.Gcol,...
0351   'HorizontalAlignment', 'center',...
0352   'Position',[Sleft Sbottom Swidth Sheight]);
0353 
0354 %-- Workspace list of LTPDA objects
0355 Lleft   = 10;
0356 Lheight = 350;
0357 Lbottom = Ppos(2) + Ppos(4) - 40 - Gproperties.Gborder - Lheight;
0358 Lwidth  = Swidth;
0359 
0360 lbh = uicontrol(panel,'Style','listbox',...
0361   'String',{' '},...
0362   'Value',1,...
0363   'BackgroundColor', 'w',...
0364   'Fontsize', fontsize,...
0365   'Max', 1000,...
0366   'Position',[Lleft Lbottom Lwidth Lheight],...
0367   'Tag', 'workspaceObjsList');
0368 
0369 % Set callback
0370 set(lbh, 'Callback', {'cb_workspaceObjsList', lbh, mainfig});
0371 
0372 % fill list
0373 objs = getWorkspaceObjs();
0374 setWorkspaceObjsList(objs);
0375 
0376 %-- Refresh button
0377 pos     = get(lbh, 'Position');
0378 Bleft   = Lleft;
0379 Bheight = 20;
0380 Bwidth  = 100;
0381 Bbottom = pos(2) - Bheight - 10;
0382 pbh = uicontrol(panel,'Style','pushbutton','String','Refresh list',...
0383   'Position',[Bleft Bbottom Bwidth Bheight ],...
0384   'Tag', 'refreshListBtn');
0385 set(pbh, 'Callback', {'cb_refreshObjsList', pbh, mainfig});
0386 
0387 
0388 %-- Info panel
0389 pos = get(lbh, 'Position');
0390 Sleft   = 10 + pos(1) + pos(3);
0391 Sheight = 150;
0392 Sbottom = Ppos(2) + Ppos(4) - 40 - Gproperties.Gborder - Sheight;
0393 Swidth  = 440;
0394 sth = uicontrol(panel,'Style','text',...
0395   'String','',...
0396   'Fontsize', fontsize,...
0397   'BackgroundColor', 'w',...
0398   'ForegroundColor', 'b',...
0399   'HorizontalAlignment', 'left',...
0400   'Position',[Sleft Sbottom Swidth Sheight],...
0401   'Tag', 'ltpdaObjInfo');
0402 
0403 
0404 %-- experiment title
0405 pos     = get(sth, 'Position');
0406 Sheight = 20;
0407 Swidth  = 150;
0408 Sbottom = pos(2) - 20 - Sheight;
0409 
0410 sth = uicontrol(panel,'Style','text',...
0411   'String','Experiment Title',...
0412   'Fontsize', fontsize,...
0413   'BackgroundColor', Gproperties.Gcol,...
0414   'HorizontalAlignment', 'left',...
0415   'Position',[Sleft Sbottom Swidth Sheight]);
0416 
0417 Tleft   = Sleft + Swidth + 20;
0418 Theight = 20;
0419 Twidth  = 270;
0420 Tbottom = Sbottom;
0421 
0422 sth = uicontrol(panel,'Style','edit',...
0423   'String','',...
0424   'Fontsize', fontsize,...
0425   'BackgroundColor', 'w',...
0426   'HorizontalAlignment', 'left',...
0427   'Position',[Tleft Tbottom Twidth Theight],...
0428   'Tag', 'experimentTitle');
0429 
0430 %-- experiment description
0431 Sbottom = Sbottom - 20 - Theight;
0432 
0433 sth = uicontrol(panel,'Style','text',...
0434   'String','Experiment description',...
0435   'Fontsize', fontsize,...
0436   'BackgroundColor', Gproperties.Gcol,...
0437   'HorizontalAlignment', 'left',...
0438   'Position',[Sleft Sbottom Swidth Sheight]);
0439 
0440 Extra = 60;
0441 Tbottom = Sbottom + 20 - Theight - Extra;
0442 Theight = Theight + Extra;
0443 sth = uicontrol(panel,'Style','edit',...
0444   'String','',...
0445   'Fontsize', fontsize,...
0446   'BackgroundColor', 'w',...
0447   'Max', 100,...
0448   'HorizontalAlignment', 'left',...
0449   'Position',[Tleft Tbottom Twidth Theight],...
0450   'Tag', 'experimentDescription');
0451 
0452 %-- reference ids
0453 Sbottom = Sbottom - 20 - Theight;
0454 
0455 sth = uicontrol(panel,'Style','text',...
0456   'String','Reference IDs',...
0457   'Fontsize', fontsize,...
0458   'BackgroundColor', Gproperties.Gcol,...
0459   'HorizontalAlignment', 'left',...
0460   'Position',[Sleft Sbottom Swidth Sheight]);
0461 
0462 Theight = 20;
0463 Tbottom = Sbottom + 20 - Theight;
0464 sth = uicontrol(panel,'Style','edit',...
0465   'String','',...
0466   'Fontsize', fontsize,...
0467   'BackgroundColor', 'w',...
0468   'Max', 1,...
0469   'HorizontalAlignment', 'left',...
0470   'Position',[Tleft Tbottom Twidth Theight],...
0471   'Tag', 'referenceIDs');
0472 
0473 %-- additional comments
0474 Sbottom = Sbottom - 20 - Theight;
0475 
0476 sth = uicontrol(panel,'Style','text',...
0477   'String','Additional Comments',...
0478   'Fontsize', fontsize,...
0479   'BackgroundColor', Gproperties.Gcol,...
0480   'HorizontalAlignment', 'left',...
0481   'Position',[Sleft Sbottom Swidth Sheight]);
0482 
0483 Extra = 30;
0484 Tbottom = Sbottom + 20 - Theight - Extra;
0485 Theight = Theight + Extra;
0486 sth = uicontrol(panel,'Style','edit',...
0487   'String','',...
0488   'Fontsize', fontsize,...
0489   'BackgroundColor', 'w',...
0490   'Max', 100,...
0491   'HorizontalAlignment', 'left',...
0492   'Position',[Tleft Tbottom Twidth Theight],...
0493   'Tag', 'additionalComments');
0494 
0495 %-- additional authors
0496 Sbottom = Sbottom - 20 - Theight;
0497 
0498 sth = uicontrol(panel,'Style','text',...
0499   'String','Additional Authors',...
0500   'Fontsize', fontsize,...
0501   'BackgroundColor', Gproperties.Gcol,...
0502   'HorizontalAlignment', 'left',...
0503   'Position',[Sleft Sbottom Swidth Sheight]);
0504 
0505 Extra = 0;
0506 Tbottom = Sbottom + 20 - Theight - Extra;
0507 Theight = Theight + Extra;
0508 sth = uicontrol(panel,'Style','edit',...
0509   'String','',...
0510   'Fontsize', fontsize,...
0511   'BackgroundColor', 'w',...
0512   'Max', 100,...
0513   'HorizontalAlignment', 'left',...
0514   'Position',[Tleft Tbottom Twidth Theight],...
0515   'Tag', 'additionalAuthors');
0516 
0517 
0518 %-- Submit Btn
0519 
0520 pos     = get(lbh, 'Position');
0521 Bleft   = Lleft;
0522 Bheight = 20;
0523 Bwidth  = 100;
0524 Bbottom = Ppos(2) + 10;
0525 pbh = uicontrol(panel,'Style','pushbutton','String','Submit',...
0526   'Position',[Bleft Bbottom Bwidth Bheight ],...
0527   'Fontsize', fontsize,...
0528   'Fontweight', 'bold',...
0529   'Tag', 'submitBtn');
0530 set(pbh, 'Callback', {'cb_submitBtn', pbh, mainfig});
0531 
0532 
0533 
0534 end
0535 
0536 
0537 %--------------------------------------------------------------------------
0538 % Create the server connection panel
0539 %
0540 function panel = create_connection_panel(panel, Gproperties)
0541 
0542 
0543 % %-- Panel
0544 % Pleft   = Gproperties.Gborder/Gproperties.Gheight;
0545 % Pbottom = Gproperties.Gborder/Gproperties.Gheight;
0546 % Pwidth  = 1-2*Gproperties.Gborder/Gproperties.Gwidth;
0547 % Pheight = 0.4;
0548 %
0549 % hp = uipanel('Parent', mainfig,...
0550 %              'Title', 'Server Connection',...
0551 %              'FontSize', 14,...
0552 %              'BackgroundColor', Gproperties.Gcol,...
0553 %              'Position', [Pleft Pbottom Pwidth Pheight],...
0554 %              'BorderType', 'etchedout', ...
0555 %              'HighlightColor', [0.1 0.9 0.1]);
0556 
0557 Ppos    = get(panel, 'Position');
0558 mainfig = findobj('Tag', 'LTPDARepomainfig');
0559 
0560 %-- Server selection
0561 Sleft   = 10;
0562 Sbottom = Ppos(2) + Ppos(4) - 40-Gproperties.Gborder;
0563 Swidth  = 150;
0564 Sheight = 20;
0565 fontsize = getappdata(0, 'ltpda_repo_gui_fontsize');
0566 
0567 pmh = uicontrol(panel,'Style','popupmenu',...
0568   'String',{'localhost','130.75.117.67'},...
0569   'Fontsize', fontsize,...
0570   'BackgroundColor', Gproperties.Gcol,...
0571   'Value',1,'Position',[Sleft Sbottom Swidth Sheight],...
0572   'Tag', 'serverSelect');
0573 set(pmh, 'Callback', {'cb_serverSelect', pmh, mainfig});
0574 
0575 %-- Server Txt entry
0576 Tleft   = Sleft + Swidth + 10;
0577 Tbottom = Sbottom;
0578 Twidth  = 200;
0579 Theight = 20;
0580 
0581 eth = uicontrol(panel,'Style','edit',...
0582   'String','localhost',...
0583   'Fontsize', fontsize,...
0584   'BackgroundColor', 'w',...
0585   'Position',[Tleft Tbottom Twidth Theight],...
0586   'Tag', 'serverTxt');
0587 
0588 %-- Text string
0589 sth = uicontrol(panel,'Style','text',...
0590   'String','Server hostname',...
0591   'Fontsize', fontsize,...
0592   'BackgroundColor', Gproperties.Gcol,...
0593   'HorizontalAlignment', 'left',...
0594   'Position',[Tleft+Twidth+10 Tbottom 120 Theight]);
0595 
0596 %-- Database selection
0597 pmh = uicontrol(panel,'Style','popupmenu',...
0598   'String',{'ltpda','utp','test'},...
0599   'Fontsize', fontsize,...
0600   'BackgroundColor', Gproperties.Gcol,...
0601   'Value',1,'Position',[Sleft Sbottom-Sheight-10 Swidth Sheight],...
0602   'Tag', 'dbSelect');
0603 set(pmh, 'Callback', {'cb_dbSelect', pmh, mainfig});
0604 
0605 %-- Database Txt entry
0606 eth = uicontrol(panel,'Style','edit',...
0607   'String','ltpda',...
0608   'Fontsize', fontsize,...
0609   'BackgroundColor', 'w',...
0610   'Position',[Tleft Tbottom-Theight-10 Twidth Theight],...
0611   'Tag', 'databaseTxt');
0612 
0613 %-- Text string
0614 sth = uicontrol(panel,'Style','text',...
0615   'String','Database',...
0616   'Fontsize', fontsize,...
0617   'BackgroundColor', Gproperties.Gcol,...
0618   'HorizontalAlignment', 'left',...
0619   'Position',[Tleft+Twidth+10 Tbottom-Theight-10 120 Theight]);
0620 
0621 %-- Available DBs button
0622 pos     = get(sth, 'Position');
0623 Bleft   = pos(1) + pos(3) + 20;
0624 Bbottom = pos(2);
0625 Bwidth  = 100;
0626 Bheight = 20;
0627 pbh = uicontrol(panel,'Style','pushbutton','String','Get DBs',...
0628   'Position',[Bleft Bbottom Bwidth Bheight ],...
0629   'Tag', 'getDbsBtn');
0630 set(pbh, 'Callback', {'cb_getDBs', pbh, mainfig});
0631 
0632 %-- Login Btn
0633 pos     = get(pmh, 'Position');
0634 Bleft   = pos(1);
0635 Bbottom = pos(2) - pos(4) - 20;
0636 Bwidth  = 100;
0637 Bheight = 20;
0638 
0639 pbh = uicontrol(panel,'Style','pushbutton','String','Connect',...
0640   'Position',[Bleft Bbottom Bwidth Bheight ],...
0641   'Tag', 'connectBtn');
0642 set(pbh, 'Callback', {'cb_connectBtn', pbh, mainfig});
0643 
0644 %-- Status Txt
0645 Sleft   = Bleft;
0646 Sbottom = Ppos(2)+40;
0647 Swidth  = 60;
0648 Sheight = 20;
0649 
0650 sth = uicontrol(panel,'Style','text',...
0651   'String','Status:',...
0652   'Fontsize', fontsize,...
0653   'BackgroundColor', Gproperties.Gcol,...
0654   'HorizontalAlignment', 'left',...
0655   'Position',[Sleft Sbottom Swidth Sheight]);
0656 
0657 pos = get(sth, 'Position');
0658 Sleft   = Sleft + Swidth + 20;
0659 Swidth  = Ppos(3) - pos(2) - pos(3) - Gproperties.Gborder;
0660 Sheight = 60;
0661 Sbottom = Ppos(2) + 10;
0662 sth = uicontrol(panel,'Style','text',...
0663   'String','not connected',...
0664   'Fontsize', fontsize,...
0665   'BackgroundColor', 'w',...
0666   'HorizontalAlignment', 'left',...
0667   'Max', 100,...
0668   'Position',[Sleft Sbottom Swidth Sheight],...
0669   'Tag', 'statusTxt');
0670 
0671 
0672 end
0673

Generated on Tue 22-Jan-2008 10:39:13 by m2html © 2003