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

    r1242 r1246  
    5353        val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gXML_Write", 0 ) 
    5454        Variable/G root:Packages:NIST:VSANS:Globals:gXML_Write = val 
    55          
     55 
     56        // flag to set "Laptop Mode" where the panels are drawn smaller and onscreen 
     57        val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gLaptopMode", 0 ) 
     58        Variable/G root:Packages:NIST:VSANS:Globals:gLaptopMode = val    
    5659         
    5760        // VSANS tab 
     
    123126//              endif 
    124127        endif 
    125          
     128 
     129 
     130        DoAlert 1,"Do you want small panels? (this can be changed later in preferences)" 
     131        if(V_flag == 1) 
     132                // yes 
     133                Variable/G root:Packages:NIST:VSANS:Globals:gLaptopMode = 1 
     134        endif 
    126135// flag to allow adding raw data files with different attenuation (normally not done)    
    127136//      val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gDoAdjustRAW_Atten",0) 
     
    131140        // VSANS ANALYSIS tab 
    132141        /// items for VSANS Analysis 
     142         
     143 
    133144         
    134145         
     
    272283End 
    273284 
     285Function V_LaptopModePref(ctrlName,checked) : CheckBoxControl 
     286        String ctrlName 
     287        Variable checked 
     288         
     289        NVAR gVal = root:Packages:NIST:VSANS:Globals:gLaptopMode 
     290        gVal = checked 
     291End 
     292 
     293 
     294 
     295 
    274296Function V_PrefDoneButtonProc(ctrlName) : ButtonControl 
    275297        String ctrlName 
     
    280302 
    281303Proc VSANSPref_Panel() 
     304        Variable sc=1 
     305         
     306        if(root:Packages:NIST:VSANS:Globals:gLaptopMode == 1) 
     307                sc = 0.7 
     308        endif 
     309 
    282310        PauseUpdate; Silent 1           // building window... 
    283         NewPanel /W=(646,208,1070,468)/K=2 as "VSANS Preference Panel" 
     311        NewPanel /W=(646*sc,208*sc,1070*sc,468*sc)/K=2 as "VSANS Preference Panel" 
    284312        DoWindow/C VSANSPref_Panel 
    285313        ModifyPanel cbRGB=(47748,57192,54093) 
     
    288316////// 
    289317//on main portion of panel, always visible 
    290         Button PrefPanelButtonA,pos={354,12},size={50,20},proc=V_PrefDoneButtonProc,title="Done" 
    291  
    292         TabControl PrefTab,pos={7,49},size={410,202},tabLabel(0)="General",proc=V_PrefTabProc 
     318        Button PrefPanelButtonA,pos={354*sc,12*sc},size={50*sc,20*sc},proc=V_PrefDoneButtonProc,title="Done" 
     319 
     320        TabControl PrefTab,pos={7*sc,49*sc},size={410*sc,202*sc},tabLabel(0)="General",proc=V_PrefTabProc 
    293321        TabControl PrefTab,tabLabel(1)="VSANS",tabLabel(2)="Analysis" 
    294322        TabControl PrefTab,value=1 
     
    296324         
    297325//on tab(0) - General 
    298         CheckBox PrefCtrl_0a,pos={21,96},size={124,14},proc=V_XMLWritePref,title="Use canSAS XML Output" 
     326        CheckBox PrefCtrl_0a,pos={21*sc,96*sc},size={124*sc,14*sc},proc=V_XMLWritePref,title="Use canSAS XML Output" 
    299327        CheckBox PrefCtrl_0a,help={"Checking this will set the default output format to be canSAS XML rather than NIST 6 column"} 
    300328        CheckBox PrefCtrl_0a,value= root:Packages:NIST:VSANS:Globals:gXML_Write 
     329        CheckBox PrefCtrl_0b,pos={21*sc,120*sc},size={124*sc,14*sc},proc=V_LaptopModePref,title="Laptop Mode for Panels" 
     330        CheckBox PrefCtrl_0b,help={"Checking this will draw panels smaller to fit on a 1920x1080 laptop screen"} 
     331        CheckBox PrefCtrl_0b,value= root:Packages:NIST:VSANS:Globals:gLaptopMode 
    301332 
    302333        CheckBox PrefCtrl_0a,disable=1 
     334        CheckBox PrefCtrl_0b,disable=1 
    303335 
    304336 
    305337//on tab(1) - VSANS - initially visible 
    306         CheckBox PrefCtrl_1a,pos={21,80},size={171,14},proc=V_LogScalePrefCheck,title="Use Log scaling for 2D data display" 
     338        CheckBox PrefCtrl_1a,pos={21*sc,80*sc},size={171*sc,14*sc},proc=V_LogScalePrefCheck,title="Use Log scaling for 2D data display" 
    307339        CheckBox PrefCtrl_1a,help={"Checking this will display 2D VSANS data with a logarithmic color scale of neutron counts. If not checked, the color mapping will be linear."} 
    308340        CheckBox PrefCtrl_1a,value= root:Packages:NIST:VSANS:Globals:gLogScalingAsDefault 
     
    310342//      CheckBox PrefCtrl_1b,help={"Checking this will allow DRK correction to be used in reduction protocols. You will need to re-draw the protocol panel for this change to be visible."} 
    311343//      CheckBox PrefCtrl_1b,value= root:Packages:NIST:VSANS:Globals:gAllowDRK 
    312         CheckBox PrefCtrl_1c,pos={21,100},size={137,14},proc=V_UnityTransPref,title="Check for Transmission = 1" 
     344        CheckBox PrefCtrl_1c,pos={21*sc,100*sc},size={137*sc,14*sc},proc=V_UnityTransPref,title="Check for Transmission = 1" 
    313345        CheckBox PrefCtrl_1c,help={"Checking this will check for SAM or EMP Trans = 1 during data correction"} 
    314346        CheckBox PrefCtrl_1c,value= root:Packages:NIST:VSANS:Globals:gDoTransCheck 
    315         SetVariable PrefCtrl_1d,pos={21,130},size={200,15},title="Averaging Bin Width (pixels)" 
     347        SetVariable PrefCtrl_1d,pos={21*sc,130*sc},size={200*sc,15*sc},title="Averaging Bin Width (pixels)" 
    316348        SetVariable PrefCtrl_1d,limits={1,100,1},value= root:Packages:NIST:VSANS:Globals:gBinWidth 
    317         SetVariable PrefCtrl_1e,pos={21,155},size={200,15},title="# Phi Steps (annular avg)" 
     349        SetVariable PrefCtrl_1e,pos={21*sc,155*sc},size={200*sc,15*sc},title="# Phi Steps (annular avg)" 
    318350        SetVariable PrefCtrl_1e,limits={1,360,1},value= root:Packages:NIST:VSANS:Globals:gNPhiSteps 
    319         SetVariable PrefCtrl_1p,pos={21,180},size={200,15},title="Window Transmission" 
     351        SetVariable PrefCtrl_1p,pos={21*sc,180*sc},size={200*sc,15*sc},title="Window Transmission" 
    320352        SetVariable PrefCtrl_1p,limits={0.01,1,0.001},value= root:Packages:NIST:VSANS:Globals:gDownstreamWinTrans 
    321353 
    322354         
    323         CheckBox PrefCtrl_1f title="Do Transmssion Correction?",size={140,14},value=root:Packages:NIST:VSANS:Globals:gDoTransmissionCor,proc=V_DoTransCorrPref 
    324         CheckBox PrefCtrl_1f pos={255,80},help={"TURN OFF ONLY FOR DEBUGGING. This corrects the data for angle dependent transmssion."} 
    325         CheckBox PrefCtrl_1g title="Do Tube Efficiency+Shadowing?",size={140,14},proc=V_DoEfficiencyCorrPref 
    326         CheckBox PrefCtrl_1g value=root:Packages:NIST:VSANS:Globals:gDoTubeShadowCor,pos={255,100},help={"TURN OFF ONLY FOR DEBUGGING. This corrects the data for angle dependent detector efficiency."} 
     355        CheckBox PrefCtrl_1f title="Do Transmssion Correction?",size={140*sc,14*sc},value=root:Packages:NIST:VSANS:Globals:gDoTransmissionCor,proc=V_DoTransCorrPref 
     356        CheckBox PrefCtrl_1f pos={255*sc,80*sc},help={"TURN OFF ONLY FOR DEBUGGING. This corrects the data for angle dependent transmssion."} 
     357        CheckBox PrefCtrl_1g title="Do Tube Efficiency+Shadowing?",size={140*sc,14*sc},proc=V_DoEfficiencyCorrPref 
     358        CheckBox PrefCtrl_1g value=root:Packages:NIST:VSANS:Globals:gDoTubeShadowCor,pos={255*sc,100*sc},help={"TURN OFF ONLY FOR DEBUGGING. This corrects the data for angle dependent detector efficiency."} 
    327359//      CheckBox PrefCtrl_1h title="Adjust RAW attenuation?",size={140,14},proc=V_DoRawAttenAdjPref 
    328360//      CheckBox PrefCtrl_1h value=root:Packages:NIST:VSANS:Globals:gDoAdjustRAW_Atten,pos={255,140},help={"This is normally not done"} 
    329361 
    330         CheckBox PrefCtrl_1i title="Do DIV Correction?",size={140,14},proc=V_DoDIVCorPref 
    331         CheckBox PrefCtrl_1i value=root:Packages:NIST:VSANS:Globals:gDoDIVCor,pos={255,120},help={"TURN OFF ONLY FOR DEBUGGING."} 
    332         CheckBox PrefCtrl_1j title="Do DeadTime Correction?",size={140,14},proc=V_DoDeadTimeCorPref 
    333         CheckBox PrefCtrl_1j value=root:Packages:NIST:VSANS:Globals:gDoDeadTimeCor,pos={255,140},help={"TURN OFF ONLY FOR DEBUGGING."}   
    334         CheckBox PrefCtrl_1k title="Do Solid Angle Correction?",size={140,14},proc=V_DoSolidAngleCorPref 
    335         CheckBox PrefCtrl_1k value=root:Packages:NIST:VSANS:Globals:gDoSolidAngleCor,pos={255,160},help={"TURN OFF ONLY FOR DEBUGGING."} 
    336         CheckBox PrefCtrl_1l title="Do Non-linear Correction?",size={140,14},proc=V_DoNonLinearCorPref,disable=2 
    337         CheckBox PrefCtrl_1l value=root:Packages:NIST:VSANS:Globals:gDoNonLinearCor,pos={255,180},help={"Non-linear correction can't be turned off"} 
    338         CheckBox PrefCtrl_1m title="Do Downstream Window Corr?",size={140,14},proc=V_DoDownstreamWindowCorPref 
    339         CheckBox PrefCtrl_1m value=root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCor,pos={255,200},help={"TURN OFF ONLY FOR DEBUGGING."} 
     362        CheckBox PrefCtrl_1i title="Do DIV Correction?",size={140*sc,14*sc},proc=V_DoDIVCorPref 
     363        CheckBox PrefCtrl_1i value=root:Packages:NIST:VSANS:Globals:gDoDIVCor,pos={255*sc,120*sc},help={"TURN OFF ONLY FOR DEBUGGING."} 
     364        CheckBox PrefCtrl_1j title="Do DeadTime Correction?",size={140*sc,14*sc},proc=V_DoDeadTimeCorPref 
     365        CheckBox PrefCtrl_1j value=root:Packages:NIST:VSANS:Globals:gDoDeadTimeCor,pos={255*sc,140*sc},help={"TURN OFF ONLY FOR DEBUGGING."}     
     366        CheckBox PrefCtrl_1k title="Do Solid Angle Correction?",size={140*sc,14*sc},proc=V_DoSolidAngleCorPref 
     367        CheckBox PrefCtrl_1k value=root:Packages:NIST:VSANS:Globals:gDoSolidAngleCor,pos={255*sc,160*sc},help={"TURN OFF ONLY FOR DEBUGGING."} 
     368        CheckBox PrefCtrl_1l title="Do Non-linear Correction?",size={140*sc,14*sc},proc=V_DoNonLinearCorPref,disable=2 
     369        CheckBox PrefCtrl_1l value=root:Packages:NIST:VSANS:Globals:gDoNonLinearCor,pos={255*sc,180*sc},help={"Non-linear correction can't be turned off"} 
     370        CheckBox PrefCtrl_1m title="Do Downstream Window Corr?",size={140*sc,14*sc},proc=V_DoDownstreamWindowCorPref 
     371        CheckBox PrefCtrl_1m value=root:Packages:NIST:VSANS:Globals:gDoDownstreamWindowCor,pos={255*sc,200*sc},help={"TURN OFF ONLY FOR DEBUGGING."} 
    340372//      CheckBox PrefCtrl_1n title="Do Monitor Normalization?",size={140,14},proc=V_DoMonitorNormPref 
    341373//      CheckBox PrefCtrl_1n value=root:Packages:NIST:VSANS:Globals:gDoMonitorNormalization,pos={255,220},help={"TURN OFF ONLY FOR DEBUGGING."} 
    342         CheckBox PrefCtrl_1o title="Ignore Back Detector?",size={140,14},proc=V_IgnoreDetBPref 
    343         CheckBox PrefCtrl_1o value=root:Packages:NIST:VSANS:Globals:gIgnoreDetB,pos={150,220},help={"Will prevent data from Back detector being written to data files."}                 
     374        CheckBox PrefCtrl_1o title="Ignore Back Detector?",size={140*sc,14*sc},proc=V_IgnoreDetBPref 
     375        CheckBox PrefCtrl_1o value=root:Packages:NIST:VSANS:Globals:gIgnoreDetB,pos={150*sc,220*sc},help={"Will prevent data from Back detector being written to data files."}           
    344376         
    345377//      CheckBox PrefCtrl_1a,disable=1 
     
    355387 
    356388//on tab(2) - Analysis 
    357         GroupBox PrefCtrl_2a pos={21,100},size={1,1},title="nothing to set",fSize=12 
     389        GroupBox PrefCtrl_2a pos={21*sc,100*sc},size={1,1},title="nothing to set",fSize=12 
    358390         
    359391        GroupBox PrefCtrl_2a,disable=1 
    360  
    361392End 
    362393 
Note: See TracChangeset for help on using the changeset viewer.