Ignore:
Timestamp:
Mar 19, 2020 4:35:21 PM (2 years ago)
Author:
srkline
Message:

A large number of changes to the size of panels to enable "Laptop Mode" where all of the panels and controls are scaled down so that they fit on screen and are still in correct proportion. For the laptop I'm using for testing, the resolution is 1920x1080. For this, a scaling of 0.7 seems to work. The on/off of the "laptop Mode" is controlled by a checkbox in the preference panel (under the General tab).

There are still more panels to update in the next commit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_PatchFiles.ipf

    r1243 r1246  
    122122// 
    123123Proc V_Patch_Panel() 
     124 
     125        Variable sc = 1 
     126                         
     127        if(root:Packages:NIST:VSANS:Globals:gLaptopMode == 1) 
     128                sc = 0.7 
     129        endif 
     130         
    124131        PauseUpdate; Silent 1      // building window... 
    125         NewPanel /W=(533,50,1140,588)/K=2 as "Patch Raw VSANS Data Files" 
     132        NewPanel /W=(533*sc,50*sc,1140*sc,588*sc)/K=1 as "Patch Raw VSANS Data Files" 
    126133        DoWindow/C V_Patch_Panel 
    127134//      ShowTools/A 
     
    132139        ModifyPanel fixedSize=1 
    133140        SetDrawLayer UserBack 
    134         DrawLine 7,30,422,30 
    135  
    136          
    137         SetVariable PathDisplay,pos={77,7},size={310,13},title="Path" 
     141        DrawLine 7*sc,30*sc,422*sc,30*sc 
     142 
     143         
     144        SetVariable PathDisplay,pos={sc*77,7*sc},size={sc*310,13*sc},title="Path" 
    138145        SetVariable PathDisplay,help={"This is the path to the folder that will be used to find the SANS data while patching. If no files appear in the popup, make sure that this folder is set correctly"} 
    139         SetVariable PathDisplay,font="Courier",fSize=10 
     146        SetVariable PathDisplay,font="Courier",fSize=10*sc 
    140147        SetVariable PathDisplay,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Patch:gCatPathStr 
    141         Button PathButton,pos={2,3},size={70,20},proc=V_PickPathButton,title="Pick Path" 
     148        Button PathButton,pos={sc*2,3*sc},size={sc*70,20*sc},proc=V_PickPathButton,title="Pick Path" 
    142149        Button PathButton,help={"Select the folder containing the raw SANS data files"} 
    143         Button helpButton,pos={400,3},size={25,20},proc=V_ShowPatchHelp,title="?" 
     150        Button helpButton,pos={sc*400,3*sc},size={sc*25,20*sc},proc=V_ShowPatchHelp,title="?" 
    144151        Button helpButton,help={"Show the help file for patching raw data headers"} 
    145         PopupMenu PatchPopup,pos={4,37},size={156,19},proc=V_PatchPopMenuProc,title="File(s) to Patch" 
     152        PopupMenu PatchPopup,pos={sc*4,37*sc},size={sc*156,19*sc},proc=V_PatchPopMenuProc,title="File(s) to Patch" 
    146153        PopupMenu PatchPopup,help={"The displayed file is the one that will be edited. The entire list will be edited if \"Change All..\" is selected. \r If no items, or the wrong items appear, click on the popup to refresh. \r List items are selected from the file based on MatchString"} 
    147154        PopupMenu PatchPopup,mode=1,popvalue="none",value= #"root:Packages:NIST:VSANS:Globals:Patch:gPatchList" 
    148155 
    149         Button CHButton,pos={314,37},size={110,20},proc=V_ChangeHeaderButtonProc,title="Change Header" 
     156        Button CHButton,pos={sc*314,37*sc},size={sc*110,20*sc},proc=V_ChangeHeaderButtonProc,title="Change Header" 
    150157        Button CHButton,help={"This will change the checked values (ONLY) in the single file selected in the popup."} 
    151         SetVariable PMStr,pos={6,63},size={174,13},proc=V_SetMatchStrProc,title="Match String" 
     158        SetVariable PMStr,pos={sc*6,63*sc},size={sc*174,13*sc},proc=V_SetMatchStrProc,title="Match String" 
    152159        SetVariable PMStr,help={"Enter the search string to narrow the list of files. \"*\" is the wildcard character. After entering, \"pop\" the menu to refresh the file list."} 
    153         SetVariable PMStr,font="Courier",fSize=10 
     160        SetVariable PMStr,font="Courier",fSize=10*sc 
    154161        SetVariable PMStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Patch:gPatchMatchStr 
    155         Button ChAllButton,pos={245,60},size={180,20},proc=V_ChAllHeadersButtonProc,title="Change All Headers in List" 
     162        Button ChAllButton,pos={sc*245,60*sc},size={sc*180,20*sc},proc=V_ChAllHeadersButtonProc,title="Change All Headers in List" 
    156163        Button ChAllButton,help={"This will change the checked values (ONLY) in ALL of the files in the popup list, not just the top file. If the \"change\" checkbox for the item is not checked, nothing will be changed for that item."} 
    157         Button DoneButton,pos={450,60},size={110,20},proc=V_DoneButtonProc,title="Done Patching" 
     164        Button DoneButton,pos={sc*450,60*sc},size={sc*110,20*sc},proc=V_DoneButtonProc,title="Done Patching" 
    158165        Button DoneButton,help={"When done Patching files, this will close this control panel."} 
    159         CheckBox check0,pos={18,80},size={40,15},title="Run #",value= 1,mode=1,proc=V_MatchCheckProc 
    160         CheckBox check1,pos={78,80},size={40,15},title="Text",value= 0,mode=1,proc=V_MatchCheckProc 
    161         CheckBox check2,pos={138,80},size={40,15},title="Group_ID",value= 0,mode=1,proc=V_MatchCheckProc 
    162  
    163         SetVariable curStr,pos={50,112},size={350,20},title="File Label:" 
     166        CheckBox check0,pos={sc*18,80*sc},size={sc*40,15*sc},title="Run #",value= 1,mode=1,proc=V_MatchCheckProc 
     167        CheckBox check1,pos={sc*78,80*sc},size={sc*40,15*sc},title="Text",value= 0,mode=1,proc=V_MatchCheckProc 
     168        CheckBox check2,pos={sc*138,80*sc},size={sc*40,15*sc},title="Group_ID",value= 0,mode=1,proc=V_MatchCheckProc 
     169 
     170        SetVariable curStr,pos={sc*50,112*sc},size={sc*350,20*sc},title="File Label:" 
    164171        SetVariable curStr,help={"Label of current file in popup list"} 
    165         SetVariable curStr,font="Courier",fSize=10 
     172        SetVariable curStr,font="Courier",fSize=10*sc 
    166173        SetVariable curStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Patch:gPatchCurLabel 
    167174         
    168         PopupMenu popup_0,pos={450,112},size={109,20},title="Detector Panel",proc=V_PatchPopMenuProc 
     175        PopupMenu popup_0,pos={sc*450,112*sc},size={sc*109,20*sc},title="Detector Panel",proc=V_PatchPopMenuProc 
    169176        PopupMenu popup_0,mode=1,popvalue="FL",value= #"\"FL;FR;FT;FB;ML;MR;MT;MB;B;\"" 
    170177 
    171178 
    172         TabControl PatchTab,pos={20,140},size={570,380} 
     179        TabControl PatchTab,pos={sc*20,140*sc},size={sc*570,380*sc} 
    173180        TabControl PatchTab,tabLabel(0)="Control",tabLabel(1)="Reduction",tabLabel(2)="Sample" 
    174181        TabControl PatchTab,tabLabel(3)="Instrument",tabLabel(4)="Detectors",tabLabel(5)="PolSANS" 
     
    176183 
    177184 
    178         ListBox list0,pos={30,170.00},size={550.00,330},proc=V_PatchListBoxProc,frame=1 
    179         ListBox list0,fSize=10,userColumnResize= 1,listWave=PP_ListWave,selWave=PP_SelWave,titleWave=PP_TitleWave 
     185        ListBox list0,pos={sc*30,170.00*sc},size={sc*550.00,330*sc},proc=V_PatchListBoxProc,frame=1 
     186        ListBox list0,fSize=10*sc,userColumnResize= 1,listWave=PP_ListWave,selWave=PP_SelWave,titleWave=PP_TitleWave 
    180187        ListBox list0,mode=2,widths={30,200} 
    181188 
     
    186193// TODO: add functions for these, make the intent a popup (since it's an enumerated type) 
    187194 
    188 //      PopupMenu popup_1,pos={42,base+14*step},size={109,20},title="File intent" 
     195//      PopupMenu popup_1,pos={sc*42,base+14*step*sc},size={sc*109,20*sc},title="File intent" 
    189196//      PopupMenu popup_1,mode=1,popvalue="SCATTER",value= #"\"SCATTER;EMPTY;BLOCKED BEAM;TRANS;EMPTY BEAM;\"" 
    190197 
     
    17101717        PauseUpdate; Silent 1           // building window... 
    17111718 
    1712  
    1713         NewPanel /W=(600,400,1000,1000)/N=DeadtimePanel /K=1 
     1719        Variable sc = 1 
     1720                         
     1721        if(root:Packages:NIST:VSANS:Globals:gLaptopMode == 1) 
     1722                sc = 0.7 
     1723        endif 
     1724 
     1725        NewPanel /W=(600*sc,400*sc,1000*sc,1000*sc)/N=DeadtimePanel /K=1 
    17141726//      ShowTools/A 
    17151727        ModifyPanel cbRGB=(16266,47753,2552,23355) 
    17161728 
    17171729        SetDrawLayer UserBack 
    1718         DrawText 85,99,"Current Values" 
    1719         DrawText 21,258,"Write to all files (inlcusive)" 
    1720         SetDrawEnv fsize= 14,fstyle= 1 
    1721         DrawText 209,30,"Dead Time Constants" 
    1722         DrawText 20,133,"Run Number(s)" 
    1723          
    1724         PopupMenu popup_0,pos={20,40},size={109,20},title="Detector Panel" 
     1730        SetDrawEnv fsize= 14*sc,fstyle= 1 
     1731        DrawText 85*sc,99*sc,"Current Values" 
     1732        SetDrawEnv fsize= 14*sc,fstyle= 1 
     1733        DrawText 18*sc,258*sc,"Write to all files (inlcusive)" 
     1734        SetDrawEnv fsize= 14*sc,fstyle= 1 
     1735        DrawText 209*sc,30*sc,"Dead Time Constants" 
     1736        SetDrawEnv fsize= 14*sc,fstyle= 1 
     1737        DrawText 18*sc,133*sc,"Run Number(s)" 
     1738         
     1739        PopupMenu popup_0,pos={sc*20,40*sc},size={sc*109,20*sc},title="Detector Panel" 
    17251740        PopupMenu popup_0,mode=1,popvalue="FL",value= #"\"FL;FR;FT;FB;ML;MR;MT;MB;\"" 
    17261741         
    1727         Button button0,pos={20,81},size={50.00,20.00},proc=V_ReadDTButtonProc,title="Read" 
    1728         Button button0_1,pos={20,220},size={50.00,20.00},proc=V_WriteDTButtonProc,title="Write" 
    1729         Button button0_2,pos={18.00,336.00},size={140.00,20.00},proc=V_GeneratePerfDTButton,title="Perfect Dead Time" 
    1730         Button button0_3,pos={18.00,370.00},size={140.00,20.00},proc=V_LoadCSVDTButton,title="Load Dead Time CSV" 
    1731         Button button0_4,pos={18.00,400.00},size={140.00,20.00},proc=V_WriteCSVDTButton,title="Write Dead Time CSV" 
    1732          
    1733         SetVariable setvar0,pos={20,141},size={100.00,14.00},title="first" 
     1742        Button button0,pos={sc*20,81*sc},size={sc*50.00,20.00*sc},proc=V_ReadDTButtonProc,title="Read" 
     1743        Button button0_1,pos={sc*20,220*sc},size={sc*50.00,20.00*sc},proc=V_WriteDTButtonProc,title="Write" 
     1744        Button button0_2,pos={sc*18.00,336.00*sc},size={sc*140.00,20.00*sc},proc=V_GeneratePerfDTButton,title="Perfect Dead Time" 
     1745        Button button0_3,pos={sc*18.00,370.00*sc},size={sc*140.00,20.00*sc},proc=V_LoadCSVDTButton,title="Load Dead Time CSV" 
     1746        Button button0_4,pos={sc*18.00,400.00*sc},size={sc*140.00,20.00*sc},proc=V_WriteCSVDTButton,title="Write Dead Time CSV" 
     1747         
     1748        SetVariable setvar0,pos={sc*20,141*sc},size={sc*100.00,14.00*sc},title="first" 
    17341749        SetVariable setvar0,value= root:Packages:NIST:VSANS:Globals:Patch:gFileNum_Lo 
    1735         SetVariable setvar1,pos={20.00,167},size={100.00,14.00},title="last" 
     1750        SetVariable setvar1,pos={sc*20.00,167*sc},size={sc*100.00,14.00*sc},title="last" 
    17361751        SetVariable setvar1,value= root:Packages:NIST:VSANS:Globals:Patch:gFileNum_Hi 
    17371752 
    17381753 
    17391754// display the wave      
    1740         Edit/W=(180,40,380,550)/HOST=#  root:Packages:NIST:VSANS:Globals:Patch:deadTimeWave 
    1741         ModifyTable width(Point)=40 
    1742         ModifyTable width(root:Packages:NIST:VSANS:Globals:Patch:deadTimeWave)=120 
     1755        Edit/W=(180*sc,40*sc,380*sc,550*sc)/HOST=#  root:Packages:NIST:VSANS:Globals:Patch:deadTimeWave 
     1756        ModifyTable width(Point)=30 
     1757        ModifyTable width(root:Packages:NIST:VSANS:Globals:Patch:deadTimeWave)=80 
    17431758        RenameWindow #,T0 
    17441759        SetActiveSubwindow ## 
     
    20142029        PauseUpdate; Silent 1           // building window... 
    20152030 
    2016  
    2017         NewPanel /W=(600,400,1200,1000)/N=CalibrationPanel /K=1 
     2031        Variable sc = 1 
     2032                         
     2033        if(root:Packages:NIST:VSANS:Globals:gLaptopMode == 1) 
     2034                sc = 0.7 
     2035        endif 
     2036 
     2037        NewPanel /W=(600*sc,400*sc,1200*sc,1000*sc)/N=CalibrationPanel /K=1 
    20182038//      ShowTools/A 
    20192039        ModifyPanel cbRGB=(16266,47753,2552,23355) 
    20202040 
    20212041        SetDrawLayer UserBack 
    2022         DrawText 85,99,"Current Values" 
    2023         DrawText 21,258,"Write to all files (inlcusive)" 
    2024         SetDrawEnv fsize= 14,fstyle= 1 
    2025         DrawText 227,28,"Quadratic Calibration Constants per Tube" 
    2026         DrawText 20,133,"Run Number(s)" 
    2027                  
    2028         PopupMenu popup_0,pos={20,40},size={109,20},title="Detector Panel" 
     2042        SetDrawEnv fsize= 14*sc,fstyle= 1 
     2043        DrawText 85*sc,99*sc,"Current Values" 
     2044        SetDrawEnv fsize= 14*sc,fstyle= 1 
     2045        DrawText 18*sc,258*sc,"Write to all files (inlcusive)" 
     2046        SetDrawEnv fsize= 14*sc,fstyle= 1 
     2047        DrawText 227*sc,28*sc,"Quadratic Calibration Constants per Tube" 
     2048        SetDrawEnv fsize= 14*sc,fstyle= 1 
     2049        DrawText 18*sc,133*sc,"Run Number(s)" 
     2050                 
     2051        PopupMenu popup_0,pos={sc*20,40*sc},size={sc*109,20*sc},title="Detector Panel" 
    20292052        PopupMenu popup_0,mode=1,popvalue="FL",value= #"\"FL;FR;FT;FB;ML;MR;MT;MB;\"" 
    20302053         
    2031         Button button0,pos={20,81},size={50.00,20.00},proc=V_ReadCalibButtonProc,title="Read" 
    2032         Button button0_1,pos={20,220},size={50.00,20.00},proc=V_WriteCalibButtonProc,title="Write" 
    2033         Button button0_2,pos={18.00,336.00},size={140.00,20.00},proc=V_GeneratePerfCalibButton,title="Perfect Calibration" 
    2034         Button button0_3,pos={18.00,370.00},size={140.00,20.00},proc=V_LoadCSVCalibButton,title="Load Calibration CSV" 
    2035         Button button0_4,pos={18.00,400.00},size={140.00,20.00},proc=V_WriteCSVCalibButton,title="Write Calibration CSV" 
    2036                  
    2037         SetVariable setvar0,pos={20,141},size={100.00,14.00},title="first" 
     2054        Button button0,pos={sc*20,81*sc},size={sc*50.00,20.00*sc},proc=V_ReadCalibButtonProc,title="Read" 
     2055        Button button0_1,pos={sc*20,220*sc},size={sc*50.00,20.00*sc},proc=V_WriteCalibButtonProc,title="Write" 
     2056        Button button0_2,pos={sc*18.00,336.00*sc},size={sc*140.00,20.00*sc},proc=V_GeneratePerfCalibButton,title="Perfect Calibration" 
     2057        Button button0_3,pos={sc*18.00,370.00*sc},size={sc*140.00,20.00*sc},proc=V_LoadCSVCalibButton,title="Load Calibration CSV" 
     2058        Button button0_4,pos={sc*18.00,400.00*sc},size={sc*140.00,20.00*sc},proc=V_WriteCSVCalibButton,title="Write Calibration CSV" 
     2059                 
     2060        SetVariable setvar0,pos={sc*20,141*sc},size={sc*100.00,14.00*sc},title="first" 
    20382061        SetVariable setvar0,value= root:Packages:NIST:VSANS:Globals:Patch:gFileNum_Lo 
    2039         SetVariable setvar1,pos={20.00,167},size={100.00,14.00},title="last" 
     2062        SetVariable setvar1,pos={sc*20.00,167*sc},size={sc*100.00,14.00*sc},title="last" 
    20402063        SetVariable setvar1,value= root:Packages:NIST:VSANS:Globals:Patch:gFileNum_Hi 
    20412064 
    20422065 
    20432066// display the wave      
    2044         Edit/W=(180,40,580,550)/HOST=#  root:Packages:NIST:VSANS:Globals:Patch:calibrationWave 
    2045         ModifyTable width(Point)=40 
    2046         ModifyTable width(root:Packages:NIST:VSANS:Globals:Patch:calibrationWave)=110 
     2067        Edit/W=(180*sc,40*sc,580*sc,550*sc)/HOST=#  root:Packages:NIST:VSANS:Globals:Patch:calibrationWave 
     2068        ModifyTable width(Point)=30 
     2069        ModifyTable width(root:Packages:NIST:VSANS:Globals:Patch:calibrationWave)=70 
    20472070        // the elements() command transposes the view in the table, but does not transpose the wave 
    20482071        ModifyTable elements(root:Packages:NIST:VSANS:Globals:Patch:calibrationWave) = (-3, -2) 
     
    23802403        PauseUpdate; Silent 1           // building window... 
    23812404 
    2382  
    2383         NewPanel /W=(600,400,1150,800)/N=Patch_XY_Panel /K=1 
     2405        Variable sc = 1 
     2406                         
     2407        if(root:Packages:NIST:VSANS:Globals:gLaptopMode == 1) 
     2408                sc = 0.7 
     2409        endif 
     2410 
     2411        NewPanel /W=(600*sc,400*sc,1150*sc,800*sc)/N=Patch_XY_Panel /K=1 
    23842412//      ShowTools/A 
    23852413         
     
    23872415 
    23882416        SetDrawLayer UserBack 
    2389         DrawText 85,99,"Current Values" 
    2390         DrawText 21,258,"Write to all files (inlcusive)" 
    2391         SetDrawEnv fsize= 14,fstyle= 1 
    2392         DrawText 262,30,"Beam Center [cm]" 
    2393         DrawText 20,133,"Run Number(s)" 
    2394          
    2395         Button button0,pos={20,81},size={50.00,20.00},proc=V_ReadXYButtonProc,title="Read" 
    2396         Button button0_1,pos={20,220},size={50.00,20.00},proc=V_WriteXYButtonProc,title="Write" 
    2397         SetVariable setvar0,pos={20,141},size={100.00,14.00},title="first" 
     2417        SetDrawEnv fsize= 14*sc,fstyle= 1 
     2418        DrawText 85*sc,99*sc,"Current Values" 
     2419        SetDrawEnv fsize= 14*sc,fstyle= 1 
     2420        DrawText 18*sc,258*sc,"Write to all files(inlcusive)" 
     2421        SetDrawEnv fsize= 14*sc,fstyle= 1 
     2422        DrawText 20*sc,133*sc,"Run Number(s)" 
     2423        DrawText 262*sc,30*sc,"Beam Center [cm]" 
     2424 
     2425         
     2426        Button button0,pos={sc*20,81*sc},size={sc*50.00,20.00*sc},proc=V_ReadXYButtonProc,title="Read" 
     2427        Button button0_1,pos={sc*20,220*sc},size={sc*50.00,20.00*sc},proc=V_WriteXYButtonProc,title="Write" 
     2428        SetVariable setvar0,pos={sc*20,141*sc},size={sc*100.00,14.00*sc},title="first" 
    23982429        SetVariable setvar0,value= root:Packages:NIST:VSANS:Globals:Patch:gFileNum_Lo 
    2399         SetVariable setvar1,pos={20.00,167},size={100.00,14.00},title="last" 
     2430        SetVariable setvar1,pos={sc*20.00,167*sc},size={sc*100.00,14.00*sc},title="last" 
    24002431        SetVariable setvar1,value= root:Packages:NIST:VSANS:Globals:Patch:gFileNum_Hi 
    24012432 
     
    24032434        SetDataFolder root:Packages:NIST:VSANS:Globals:Patch 
    24042435// display the wave      
    2405         Edit/W=(180,40,500,370)/HOST=#  panelW,xCtr_cm,yCtr_cm 
     2436        Edit/W=(180*sc,40*sc,500*sc,370*sc)/HOST=#  panelW,xCtr_cm,yCtr_cm 
    24062437        ModifyTable width(Point)=0 
    2407         ModifyTable width(panelW)=80 
    2408         ModifyTable width(xCtr_cm)=100 
    2409         ModifyTable width(yCtr_cm)=100 
     2438        ModifyTable width(panelW)=50 
     2439        ModifyTable width(xCtr_cm)=60 
     2440        ModifyTable width(yCtr_cm)=60 
    24102441        RenameWindow #,T0 
    24112442        SetActiveSubwindow ## 
Note: See TracChangeset for help on using the changeset viewer.