function url = uigeturl
%UIGETLINK Open URL dialog box.

%----- LGPL --------------------------------------------------------------------
%                                                                               
%   Copyright (C)  Stichting Deltares, 2011.                                     
%                                                                               
%   This library is free software; you can redistribute it and/or                
%   modify it under the terms of the GNU Lesser General Public                   
%   License as published by the Free Software Foundation version 2.1.                         
%                                                                               
%   This library is distributed in the hope that it will be useful,              
%   but WITHOUT ANY WARRANTY; without even the implied warranty of               
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU            
%   Lesser General Public License for more details.                              
%                                                                               
%   You should have received a copy of the GNU Lesser General Public             
%   License along with this library; if not, see <http://www.gnu.org/licenses/>. 
%                                                                               
%   contact: delft3d.support@deltares.nl                                         
%   Stichting Deltares                                                           
%   P.O. Box 177                                                                 
%   2600 MH Delft, The Netherlands                                               
%                                                                               
%   All indications and logos of, and references to, "Delft3D" and "Deltares"    
%   are registered trademarks of Stichting Deltares, and remain the property of  
%   Stichting Deltares. All rights reserved.                                     
%                                                                               
%-------------------------------------------------------------------------------
%   http://www.deltaressystems.com
%   $HeadURL$
%   $Id$

pos = get(0,'screensize');
sz  = [500 70];
pos = floor([pos(3:4)/2-sz/2 sz]);

Fig = qp_uifigure('Select URL to open ...','','SelectURL',pos);
hURL = uicontrol('Parent',Fig, ...
    'FontUnits','pixels', ...
    'Callback','', ...
    'Style','edit', ...
    'Backgroundcolor',[1 1 1], ...
    'Enable','on', ...
    'FontSize',12, ...
    'Horizontalalignment','left', ...
    'Position',[11 41 pos(3)-20 20], ...
    'tag','URL', ...
    'String','http://');
uicontrol('Parent',Fig, ...
    'Callback','delete(gcbf)', ...
    'Style','pushbutton', ...
    'Enable','on', ...
    'Position',[pos(3)-80 11 70 20], ...
    'tag','Cancel', ...
    'String','Cancel');
uicontrol('Parent',Fig, ...
    'Callback','set(gcbf,''Visible'',''off'')', ...
    'Style','pushbutton', ...
    'Enable','on', ...
    'Position',[pos(3)-160 11 70 20], ...
    'tag','Open', ...
    'String','Open');
set(Fig,'Visible','on')

waitfor(Fig,'Visible','off')
if ishandle(Fig)
    url = get(hURL,'string');
else
    url = 0;
end
