Skip to content

Commit

Permalink
Small fixes on the GUI widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
nellyabbani committed Jun 15, 2020
1 parent fe2abdc commit 4f69fa4
Show file tree
Hide file tree
Showing 11 changed files with 477 additions and 270 deletions.
50 changes: 48 additions & 2 deletions gui/matRad_InfoWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,45 @@
h96 = uicontrol(...
'Parent',h94,...
'Units','normalized',...
'String','v3.0.0',...
...%'String','v3.0.0',...
'Style','text',...
'Position',[0.227106227106227 0.752808988764045 0.523809523809524 0.191011235955056],...
'BackgroundColor',[0.501960784313725 0.501960784313725 0.501960784313725],...
'Tag','text15',...
'FontSize',8,...
'FontWeight','bold');

h97 = uicontrol(...
'Parent',h94,...
'Units','normalized',...
'String','github.com/e0404/matRad',...
...%'String','github.com/e0404/matRad',...
'Style','text',...
'Position',[0.0384615384615385 0.528089887640449 0.942307692307693 0.168539325842697],...
'BackgroundColor',[0.501960784313725 0.501960784313725 0.501960784313725],...
'Tag','text31',...
'FontSize',8,...
'FontWeight','bold' );

this.createHandles();
handles=this.handles;
%Alter matRad Version string positioning
vString = matRad_version();
vPos = get(handles.text15,'Position');
urlPos = get(handles.text31,'Position');
btnPos = get(handles.btnAbout,'Position');

%vPos([1 3]) = urlPos([1 3]);
vPos([1 3]) = [0 1];
vPos(4) = vPos(4)*1.25;
btnPos(2) = 0.05;
urlPos(2) = btnPos(2)+btnPos(4)+0.05;
vPos(2) = urlPos(2) + urlPos(4) + 0.05;
vPos(4) = 0.98 - vPos(2);

set(handles.btnAbout,'Position',btnPos);
set(handles.text31,'String','www.matRad.org','Position',urlPos,'Enable','inactive','ButtonDownFcn', @(~,~) web('www.matrad.org','-browser'));
set(handles.text15,'String',vString,'Position',vPos);
this.handles=handles;
end
end

Expand All @@ -67,6 +90,29 @@
function btnAbout_Callback(this, hObject, event)
handles = this.handles;
msgbox({'https://github.com/e0404/matRad/' 'email: [email protected]'},'About');
% handles.eduMode = logical(parsedInput.eduMode);
% [~,matRadVer] = matRad_version;
%
% msg{1} = ['matRad ''' matRadVer.name '''']; %Name
% if handles.eduMode
% msg{1} = [msg{1} ' Educational'];
% end
% msg{end+1} = sprintf('v%d.%d.%d',matRadVer.major,matRadVer.minor,matRadVer.patch); %Version Number
% if isdeployed
% msg{end+1} = 'Standalone Version';
% elseif ~isempty(matRadVer.branch) && ~isempty(matRadVer.commitID)
% msg{end+1} = sprintf('Git: Branch %s, commit %s',matRadVer.branch,matRadVer.commitID(1:8));
% end
%
% [env,envver] = matRad_getEnvironment();
% msg{end+1} = sprintf('Environment: %s v%s %s',env,envver,version('-release'));
%
% msg{end+1} = 'Web: www.matrad.org';
% msg{end+1} = 'E-Mail: [email protected]';
%
% msgbox(msg,'About matRad');


this.handles = handles;
end
end
Expand Down
11 changes: 9 additions & 2 deletions gui/matRad_LogoWidget.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@

methods (Access = protected)
function this = createLayout(this)
mfile = which(mfilename);
[filepath] = fileparts(mfile);
%mfile = which(mfilename);
%[filepath] = fileparts(mfile);

if isdeployed
filepath = [ctfroot filesep 'matRad'];
else
filepath = fileparts(mfilename('fullpath'));
end

h1 = this.widgetHandle;

Expand Down Expand Up @@ -225,6 +231,7 @@
set(f, 'AlphaData', alpha);


this.createHandles();
%{
h8 = get(h7,'title');
Expand Down
23 changes: 18 additions & 5 deletions gui/matRad_MainGUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
properties
guiHandle
lastStoragePath = []
env
end

properties (Access = private)
Expand Down Expand Up @@ -136,6 +137,7 @@
'Clipping','off',...
'Position',[0.00451321727917473 0.810499359795134 0.430045132172792 0.170294494238156],...
'FontName','Helvetica',...
'FontSize',8,...
'FontWeight','bold' );

p2 = uipanel(...
Expand All @@ -146,6 +148,7 @@
'Clipping','off',...
'Position',[0.00451321727917473 0.527528809218956 0.430689877498388 0.272727272727273],...
'FontName','Helvetica',...
'FontSize',8,...
'FontWeight','bold');

p3 = uipanel(...
Expand All @@ -156,6 +159,7 @@
'Clipping','off',...
'Position',[0.00451321727917473 0.257362355953905 0.430689877498388 0.259923175416133],...
'FontName','Helvetica',...
'FontSize',8,...
'FontWeight','bold' );

p4 = uipanel(...
Expand All @@ -166,6 +170,7 @@
'Clipping','off',...
'Position',[0.00451321727917473 0.0460947503201024 0.430689877498388 0.203585147247119],...
'FontName','Helvetica',...
'FontSize',8,...
'FontWeight','bold');

p5 = uipanel(...
Expand All @@ -175,6 +180,7 @@
'Tag','uipanel_colormapOptions',...
'Clipping','off',...
'Position',[0.896397105097545 0.434330299089727 0.0991189427312775 0.456],...
'FontSize',8,...
'FontWeight','bold');

p6 = uipanel(...
Expand All @@ -184,6 +190,7 @@
'Tag','uipanel10',...
'Clipping','off',...
'Position',[0.896397105097545 0.175812743823147 0.0991189427312775 0.254291287386216],...
'FontSize',8,...
'FontWeight','bold');

p7 = uipanel(...
Expand All @@ -193,6 +200,7 @@
'Tag','uipanel12',...
'Clipping','off',...
'Position',[0.896276240708709 0.0448143405889885 0.0991189427312775 0.12932138284251],...
'FontSize',8,...
'FontWeight','bold');

p8 = uipanel(...
Expand All @@ -202,6 +210,7 @@
'Tag','uipanel11',...
'Clipping','off',...
'Position',[0.437782076079949 0.0460947503201025 0.451321727917473 0.842509603072983],...
'FontSize',8,...
'FontWeight','bold');

p9 = uipanel(...
Expand All @@ -210,10 +219,12 @@
'Tag','uipanel13',...
'Clipping','off',...
'Position',[0.44 0.89 0.55 0.1],...
'FontSize',8,...
'FontWeight','bold',...
'HighLightColor',[0.501960784313725 0.501960784313725 0.501960784313725],...
'BorderType','none');

[obj.env, ~] = matRad_getEnvironment();

obj.WorkflowWidget = matRad_WorkflowWidget(p1);
obj.PlanWidget = matRad_PlanWidget(p2);
Expand All @@ -228,9 +239,7 @@
obj.InfoWidget = matRad_InfoWidget(p7); % does not need a listener
obj.LogoWidget = matRad_LogoWidget(p9); % does not need a listener

[env, ~] = matRad_getEnvironment();

switch env
switch obj.env
case 'MATLAB'
obj.eventListeners.workflow = addlistener(obj.WorkflowWidget,'workspaceChanged',@(src,hEvent) updateWidgets(obj,src,hEvent));
obj.eventListeners.plan = addlistener(obj.PlanWidget,'workspaceChanged',@(src,hEvent) updateWidgets(obj,src,hEvent));
Expand Down Expand Up @@ -264,8 +273,9 @@
% update button states
obj.updateButtons();

% % change color of toobar the first time GUI is started
% % change color of toobar the first time GUI is started
% hToolbar = findall(obj.guiHandle,'tag','uitoolbar1')
% this command is not working
% jToolbar = get(get(hToolbar,'JavaContainer'),'ComponentPeer')
% jToolbar.setBorderPainted(false);
% color = java.awt.Color.gray;
Expand Down Expand Up @@ -298,7 +308,10 @@

function this = updateButtons(this)
disp(['Plot Changed ' datestr(now,'HH:MM:SS.FFF')]);

if strcmp(this.env,'OCTAVE')
return
end

%set(findobj(this.guiHandle,'tag','uitoggletool8'),'State',get(this.ViewingWidget.cBarHandle,'visible'));
set(findobj(this.guiHandle,'tag','toolbarPan'),'State',get(this.ViewingWidget.panHandle,'Enable'));
set(findobj(this.guiHandle,'tag','toolbarCursor'),'State',get(this.ViewingWidget.dcmHandle,'Enable'));
Expand Down
Loading

0 comments on commit 4f69fa4

Please sign in to comment.