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_RAW_Data_Panel.ipf

    r1242 r1246  
    137137Window VSANS_DataPanel() : Panel 
    138138        PauseUpdate; Silent 1           // building window... 
    139         NewPanel /W=(37,45,1038,719) /K=1 /N=VSANS_Data 
     139 
     140        Variable sc = 1 
     141                         
     142        if(root:Packages:NIST:VSANS:Globals:gLaptopMode == 1) 
     143                sc = 0.7 
     144        endif 
     145         
     146        if(root:Packages:NIST:VSANS:Globals:gLaptopMode==1) 
     147                NewPanel /W=(7,36,700,445) /K=1 /N=VSANS_Data 
     148        else 
     149                NewPanel /W=(37,45,1038,719) /K=1 /N=VSANS_Data 
     150        endif 
     151         
     152 
    140153//      ShowTools/A 
    141154        ModifyPanel cbRGB=(65535,60076,49151) 
     
    147160        SetDrawLayer UserBack 
    148161        SetDrawEnv linethick= 2,dash= 1,fillpat= 0 
    149         DrawRect 200,70,310,160 
     162        DrawRect 200*sc,70*sc,310*sc,160*sc 
    150163        SetDrawEnv linethick= 2,dash= 1,fillpat= 0 
    151         DrawRect 320,70,430,160 
     164        DrawRect 320*sc,70*sc,430*sc,160*sc 
    152165        SetDrawEnv linethick= 2,dash= 1,fillpat= 0 
    153         DrawRect 440,70,535,160 
     166        DrawRect 440*sc,70*sc,535*sc,160*sc 
    154167         
    155168        SetDrawEnv fsize= 18 
    156         DrawText 230,115,"Front" 
     169        DrawText 230*sc,115*sc,"Front" 
    157170        SetDrawEnv fsize= 18 
    158         DrawText 348,115,"Middle" 
     171        DrawText 348*sc,115*sc,"Middle" 
    159172        SetDrawEnv fsize= 18 
    160         DrawText 476,115,"Back" 
     173        DrawText 476*sc,115*sc,"Back" 
    161174         
    162175        ToolsGrid visible=1 
    163176 
    164177 
    165         TabControl tab0,pos={13,41},size={572,617},proc=V_DataTabProc,tabLabel(0)="Front" 
     178        TabControl tab0,pos={sc*13,41*sc},size={sc*572,617*sc},proc=V_DataTabProc,tabLabel(0)="Front" 
    166179        TabControl tab0,tabLabel(1)="Middle",tabLabel(2)="Back",value= 2,focusRing=0 
    167180        TabControl tab0 labelBack=(63535,56076,45151) 
    168181 
    169182// on the side   
    170         Button button_status,pos={607,146},size={70,20},proc=V_StatusButtonProc,title="Status",disable=2 
    171         Button button_IvsQ,pos={689,113},size={70,20},proc=V_IvsQPanelButtonProc,title="I vs. Q" 
    172         Button button_file_m,pos={619,55},size={50,20},proc=V_File_minus_ButtonProc,title="File <" 
    173         Button button_file_p,pos={679,55},size={50,20},proc=V_File_plus_ButtonProc,title="File >" 
    174         Button button_log,pos={689,146},size={70,20},proc=V_LogLinButtonProc,title="isLin",userData="0" 
    175         Button button_tab_p,pos={648,81},size={50,20},proc=V_Tab_p_ButtonProc,title="Tab >" 
    176         Button button_isolate,pos={606,114},size={70,20},proc=V_IsolateButtonProc,title="Isolate" 
    177         Button button_toWork,pos={770,146},size={90,20},proc=V_ToWorkFileButtonProc,title="to WORK" 
    178         Button button_annular,pos={770,114},size={90,20},proc=V_annularAvgButtonProc,title="Annular Avg" 
    179         Button button_SpreadPanels,pos={880,114},size={100,20},proc=V_SpreadPanelButtonProc,title="Spread Panels" 
    180         Button button_RestorePanels,pos={880,146},size={100,20},proc=V_RestorePanelButtonProc,title="Restore Panels" 
    181  
    182         Button button_sensor,pos={607,146+33},size={70,20},proc=V_SensorButtonProc,title="Sensors" 
    183         Button button_mask,pos={689,146+33},size={70,20},proc=V_AvgMaskButtonProc,title="Avg Mask" 
    184  
    185  
    186         TitleBox title_file,pos={606,178+30},fsize=12,size={76,20},variable= root:Packages:NIST:VSANS:Globals:gLastLoadedFile 
    187         TitleBox title_dataPresent,pos={606,210+30},fsize=12,size={76,20},variable= root:Packages:NIST:VSANS:Globals:gCurDispFile 
    188         TitleBox title_status,pos={606,240+30},size={200,200},fsize=12,variable= root:Packages:NIST:VSANS:Globals:gStatusText 
    189          
    190 //      Button button_tagFile,pos={720,412},size={70,20},proc=V_TagFileButtonProc,title="Tag File" 
     183        Button button_status,pos={sc*607,146*sc},size={sc*70,20*sc},proc=V_StatusButtonProc,title="Status",disable=2 
     184        Button button_IvsQ,pos={sc*689,113*sc},size={sc*70,20*sc},proc=V_IvsQPanelButtonProc,title="I vs. Q" 
     185        Button button_file_m,pos={sc*619,55*sc},size={sc*50,20*sc},proc=V_File_minus_ButtonProc,title="File <" 
     186        Button button_file_p,pos={sc*679,55*sc},size={sc*50,20*sc},proc=V_File_plus_ButtonProc,title="File >" 
     187        Button button_log,pos={sc*689,146*sc},size={sc*70,20*sc},proc=V_LogLinButtonProc,title="isLin",userData="0" 
     188        Button button_tab_p,pos={sc*648,81*sc},size={sc*50,20*sc},proc=V_Tab_p_ButtonProc,title="Tab >" 
     189        Button button_isolate,pos={sc*606,114*sc},size={sc*70,20*sc},proc=V_IsolateButtonProc,title="Isolate" 
     190        Button button_toWork,pos={sc*770,146*sc},size={sc*90,20*sc},proc=V_ToWorkFileButtonProc,title="to WORK" 
     191        Button button_annular,pos={sc*770,114*sc},size={sc*90,20*sc},proc=V_annularAvgButtonProc,title="Annular Avg" 
     192        Button button_SpreadPanels,pos={sc*880,114*sc},size={sc*100,20*sc},proc=V_SpreadPanelButtonProc,title="Spread Panels" 
     193        Button button_RestorePanels,pos={sc*880,146*sc},size={sc*100,20*sc},proc=V_RestorePanelButtonProc,title="Restore Panels" 
     194 
     195        Button button_sensor,pos={sc*607,(146+33)*sc},size={sc*70,20*sc},proc=V_SensorButtonProc,title="Sensors" 
     196        Button button_mask,pos={sc*689,(146+33)*sc},size={sc*70,20*sc},proc=V_AvgMaskButtonProc,title="Avg Mask" 
     197 
     198 
     199        TitleBox title_file,pos={sc*606,(178+30)*sc},fsize=12*sc,size={sc*76,20*sc},variable= root:Packages:NIST:VSANS:Globals:gLastLoadedFile 
     200        TitleBox title_dataPresent,pos={sc*606,(210+30)*sc},fsize=12*sc,size={sc*76,20*sc},variable= root:Packages:NIST:VSANS:Globals:gCurDispFile 
     201        TitleBox title_status,pos={sc*606,(240+30)*sc},size={sc*200,200*sc},fsize=12*sc,variable= root:Packages:NIST:VSANS:Globals:gStatusText 
     202         
     203//      Button button_tagFile,pos={sc*720,412*sc},size={sc*70,20*sc},proc=V_TagFileButtonProc,title="Tag File" 
    191204//      Button button_tagFile,disable=2 
    192 //      Button button_saveIQ,pos={603,412},size={120,20},proc=V_SaveIQ_ButtonProc,title="Save I(Q) as ITX" 
    193 //      Button button_BeamCtr,pos={603,566},size={110,20},proc=V_BeamCtrButtonProc,title="Beam Center",disable=2 
    194 //      Button pick_trim,pos={603,450},size={120,20},proc=V_TrimDataProtoButton,title="Trim I(Q) Data" 
     205//      Button button_saveIQ,pos={sc*603,412*sc},size={sc*120,20*sc},proc=V_SaveIQ_ButtonProc,title="Save I(Q) as ITX" 
     206//      Button button_BeamCtr,pos={sc*603,566*sc},size={sc*110,20*sc},proc=V_BeamCtrButtonProc,title="Beam Center",disable=2 
     207//      Button pick_trim,pos={sc*603,450*sc},size={sc*120,20*sc},proc=V_TrimDataProtoButton,title="Trim I(Q) Data" 
    195208//      Button pick_trim,help={"This button will prompt the user for trimming parameters"}       
    196209         
    197210 
    198211// on the tabs, always visible 
    199         TitleBox title_xy,pos={20,65},fsize=12,size={76,20},variable= root:Packages:NIST:VSANS:Globals:gLastLoadedFile 
    200         Slider slider_hi,pos={558,224},size={16,80},proc=V_HiMapSliderProc 
    201         Slider slider_hi,limits={0,1,0},value= 1,ticks= 0 
    202         Slider slider_lo,pos={558,315},size={16,80},proc=V_LowMapSliderProc 
    203         Slider slider_lo,limits={0,1,0},value= 0,ticks= 0 
    204  
    205         SetVariable xpos,pos={22,97},size={50,17},title="X " 
    206         SetVariable xpos,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:gXPos 
     212        TitleBox title_xy,pos={sc*20,65*sc},fsize=12*sc,size={sc*76,20*sc},variable= root:Packages:NIST:VSANS:Globals:gLastLoadedFile 
     213        Slider slider_hi,pos={sc*558,224*sc},size={sc*16,80*sc},proc=V_HiMapSliderProc 
     214        Slider slider_hi,limits={0,1,0*sc},value= 1,ticks= 0 
     215        Slider slider_lo,pos={sc*558,315*sc},size={sc*16,80*sc},proc=V_LowMapSliderProc 
     216        Slider slider_lo,limits={0,1,0*sc},value= 0,ticks= 0 
     217 
     218        SetVariable xpos,pos={sc*22,97*sc},size={sc*50,17*sc},title="X " 
     219        SetVariable xpos,limits={-Inf,Inf,0*sc},value= root:Packages:NIST:VSANS:Globals:gXPos 
    207220        SetVariable xpos,help={"x-position on the detector"},frame=0,noedit=1 
    208         SetVariable ypos,pos={22,121},size={50,17},title="Y " 
    209         SetVariable ypos,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:gYPos 
     221        SetVariable ypos,pos={sc*22,121*sc},size={sc*50,17*sc},title="Y " 
     222        SetVariable ypos,limits={-Inf,Inf,0*sc},value= root:Packages:NIST:VSANS:Globals:gYPos 
    210223        SetVariable ypos,help={"y-position on the detector"},frame=0,noedit=1 
    211         SetVariable counts,pos={22,151},size={150,17},title="Counts " 
    212         SetVariable counts,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:gNCounts 
     224        SetVariable counts,pos={sc*22,151*sc},size={sc*150,17*sc},title="Counts " 
     225        SetVariable counts,limits={-Inf,Inf,0*sc},value= root:Packages:NIST:VSANS:Globals:gNCounts 
    213226        SetVariable counts,help={"Neutron counts"},frame=0,noedit=1 
    214         SetVariable qxval,pos={83,94},size={85,17},title="qX" 
     227        SetVariable qxval,pos={sc*83,94*sc},size={sc*85,17*sc},title="qX" 
    215228        SetVariable qxval,help={"q value in the x-direction on the detector"},frame=0,noedit=1 
    216         SetVariable qxval,format="%+7.5f",limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:gQX 
    217         SetVariable qyval,pos={83,113},size={85,17},title="qY" 
     229        SetVariable qxval,format="%+7.5f",limits={-Inf,Inf,0*sc},value= root:Packages:NIST:VSANS:Globals:gQX 
     230        SetVariable qyval,pos={sc*83,113*sc},size={sc*85,17*sc},title="qY" 
    218231        SetVariable qyval,help={"q value in the y-direction on the detector"},frame=0,noedit=1 
    219         SetVariable qyval,format="%+7.5f",limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:gQY 
    220         SetVariable q_pos,pos={83,132},size={85,17},title="q " 
     232        SetVariable qyval,format="%+7.5f",limits={-Inf,Inf,0*sc},value= root:Packages:NIST:VSANS:Globals:gQY 
     233        SetVariable q_pos,pos={sc*83,132*sc},size={sc*85,17*sc},title="q " 
    221234        SetVariable q_pos,help={"q-value on the detector at (x,y)"},format="%+7.5f" 
    222         SetVariable q_pos,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:gQQ,frame=0,noedit=1 
     235        SetVariable q_pos,limits={-Inf,Inf,0*sc},value= root:Packages:NIST:VSANS:Globals:gQQ,frame=0,noedit=1 
    223236         
    224237        Make/O/D tmp_asdf 
    225238        // for back panels (in pixels)   
    226239//      Display/W=(50,185,545,620)/HOST=# tmp_asdf  
    227         Display/W=(50,185,517,620)/HOST=# tmp_asdf  
     240        Display/W=(50*sc,185*sc,517*sc,620*sc)/HOST=# tmp_asdf  
    228241        RenameWindow #,det_panelsB 
    229242        ModifyGraph mode=2              // mode = 2 = dots 
     
    236249         
    237250        // for middle panels (in pixels?)        
    238         Display/W=(50,185,517,620)/HOST=# tmp_asdf  
     251        Display/W=(50*sc,185*sc,517*sc,620*sc)/HOST=# tmp_asdf  
    239252        RenameWindow #,det_panelsM 
    240253        ModifyGraph mode=2              // mode = 2 = dots 
     
    247260         
    248261        // for front panels (in pixels?)         
    249         Display/W=(50,185,517,620)/HOST=# tmp_asdf  
     262        Display/W=(50*sc,185*sc,517*sc,620*sc)/HOST=# tmp_asdf  
    250263        RenameWindow #,det_panelsF 
    251264        ModifyGraph mode=2              // mode = 2 = dots 
     
    276289 
    277290        Variable hookResult = 0 
     291 
     292        Variable sc = 1 
     293         
     294        NVAR gLaptopMode = root:Packages:NIST:VSANS:Globals:gLaptopMode 
     295                 
     296        if(gLaptopMode == 1) 
     297                sc = 0.7 
     298        endif 
    278299 
    279300        switch(s.eventCode) 
     
    317338//                      if out of bounds, exit now 
    318339//              TODO - currently the values are hard-wired. eliminate this later if the size of the graph changes 
    319                         if(s.mouseLoc.h < 50 || s.mouseLoc.h > 545 || s.mouseLoc.v < 185 || s.mouseLoc.v > 620) 
     340                        if(s.mouseLoc.h < 50*sc || s.mouseLoc.h > 545*sc || s.mouseLoc.v < 185*sc || s.mouseLoc.v > 620*sc) 
    320341                                break 
    321342                        endif    
     
    481502        STRUCT WMTabControlAction &tca 
    482503 
     504 
     505        Variable sc = 1 
     506         
     507        NVAR gLaptopMode = root:Packages:NIST:VSANS:Globals:gLaptopMode 
     508                 
     509        if(gLaptopMode == 1) 
     510                sc = 0.7 
     511        endif 
     512 
    483513        switch( tca.eventCode ) 
    484514                case 2: // mouse up 
     
    546576                                        ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctab= {lo_B,hi_B,ColdWarm,0}          // don't autoscale {*,*,ColdWarm,0} 
    547577                                endif 
    548                                 MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(50,185,517,620) 
    549                                 MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(320,70,430,160) 
    550                                 MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(200,70,310,160) 
     578                                MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(50*sc,185*sc,517*sc,620*sc) 
     579                                MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(320*sc,70*sc,430*sc,160*sc) 
     580                                MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(200*sc,70*sc,310*sc,160*sc) 
    551581 
    552582                                ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctabAutoscale=0,lookup= LookupWave 
     
    603633                                        ModifyImage/W=VSANS_Data#det_panelsM ''#3 ctab= {lo_MR,hi_MR,ColdWarm,0} 
    604634                                endif 
    605                                 MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(50,185,517,620) 
    606                                 MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(440,70,550,160) 
    607                                 MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(200,70,310,160) 
     635                                MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(50*sc,185*sc,517*sc,620*sc) 
     636                                MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(440*sc,70*sc,550*sc,160*sc) 
     637                                MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(200*sc,70*sc,310*sc,160*sc) 
    608638 
    609639                                ModifyImage/W=VSANS_Data#det_panelsM ''#0 ctabAutoscale=0,lookup= LookupWave 
     
    661691                                        ModifyImage/W=VSANS_Data#det_panelsF ''#3 ctab= {lo_FR,hi_FR,ColdWarm,0} 
    662692                                endif 
    663                                 MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(50,185,517,620) 
    664                                 MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(440,70,550,160) 
    665                                 MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(320,70,430,160) 
     693                                MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(50*sc,185*sc,517*sc,620*sc) 
     694                                MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(440*sc,70*sc,550*sc,160*sc) 
     695                                MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(320*sc,70*sc,430*sc,160*sc) 
    666696                                 
    667697                                ModifyImage/W=VSANS_Data#det_panelsF ''#0 ctabAutoscale=0,lookup= LookupWave 
Note: See TracChangeset for help on using the changeset viewer.