Skip to content

Commit

Permalink
* Added rescaling to generalSettings, should make the cells wide enou…
Browse files Browse the repository at this point in the history
…gh typically to display all characters in the widest string/number.

Closes #14
  • Loading branch information
janlav committed Mar 1, 2016
1 parent 94f0fab commit 3c482b0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/gui/generalSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ function generalSettings_OpeningFcn(hObject, eventdata, handles, varargin)
dataAlloc(7,1:length(tmp7))=tmp7;
set(handles.InputNames,'Data',dataAlloc);
set(handles.InputNames,'ColumnEditable',true(ones(1,maxAlloc)));
tmp7=cell([1,maxAlloc]);
set(handles.InputNames,'ColumnWidth',cellfun(@(x)('auto'),tmp7,'UniformOutput', false));
tmp7=num2cell(max(2+max(cellfun(@(x)length(x),dataAlloc)),10)); % max width + 2 per col. or 10
fontsize=0.65*get(handles.InputNames,'Fontsize'); % assume width is ~65% of height
set(handles.InputNames,'ColumnWidth',cellfun(@(x)(x*fontsize),tmp7,'UniformOutput', false));
tmp8=cell([1,maxAlloc]);
tmp8=cellfun(@(x){'char'},tmp8);
set(handles.InputNames,'ColumnFormat',tmp8);
Expand Down Expand Up @@ -815,6 +816,9 @@ function InputNames_CellEditCallback(hObject, eventdata, handles)
theData(3:7,1:size(parameterData,2))=parameterData;
set(hObject,'Data',theData);
set(hObject,'ColumnEditable',true(ones(1,size(theData,2))));
tmp7=num2cell(max(2+max(cellfun(@(x)length(x),theData)),10)); % max width + 2 per col. or 10
fontsize=0.65*get(handles.InputNames,'Fontsize'); % assume width is ~65% of height
set(handles.InputNames,'ColumnWidth',cellfun(@(x)(x*fontsize),tmp7,'UniformOutput', false));
tmp2=cell([1,tmp]);
set(handles.InputNames,'ColumnFormat',cellfun(@(x){'char'},tmp2));

Expand Down

0 comments on commit 3c482b0

Please sign in to comment.