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

    r1242 r1246  
    10431043// 
    10441044Window V_ProtocolPanel() 
     1045 
     1046        Variable sc = 1 
     1047                         
     1048        if(root:Packages:NIST:VSANS:Globals:gLaptopMode == 1) 
     1049                sc = 0.7 
     1050        endif 
     1051 
    10451052        PauseUpdate; Silent 1           // building window... 
    1046         NewPanel /W=(1280,332,1630,932) /K=1 as "VSANS Reduction Protocol" 
    1047         ModifyPanel cbRGB=(56589,50441,50159), fixedSize=1 
     1053        NewPanel /W=(1180*sc,332*sc,1530*sc,932*sc) /K=1 as "VSANS Reduction Protocol" 
     1054        ModifyPanel cbRGB=(56589,50441,50159)//, fixedSize=1 
    10481055        SetDrawLayer UserBack 
    1049         DrawLine 3,65,301,65 
    1050         DrawLine 3,157,301,157 
    1051         DrawLine 3,208,301,208 
    1052         DrawLine 3,257,301,257 
    1053         DrawLine 3,305,301,305 
    1054         DrawLine 3,350,301,350 
    1055         DrawLine 3,445,301,445 
    1056         DrawLine 3,513,301,513 
    1057         DrawLine 3,396,301,396 
    1058  
    1059 // 
    1060         Button button_help,pos={300,2},size={25,20},proc=V_ShowProtoHelp,title="?" 
     1056        DrawLine 3,65*sc,301*sc,65*sc 
     1057        DrawLine 3,157*sc,301*sc,157*sc 
     1058        DrawLine 3,208*sc,301*sc,208*sc 
     1059        DrawLine 3,257*sc,301*sc,257*sc 
     1060        DrawLine 3,305*sc,301*sc,305*sc 
     1061        DrawLine 3,350*sc,301*sc,350*sc 
     1062        DrawLine 3,445*sc,301*sc,445*sc 
     1063        DrawLine 3,513*sc,301*sc,513*sc 
     1064        DrawLine 3,396*sc,301*sc,396*sc 
     1065 
     1066// 
     1067        Button button_help,pos={sc*300,2*sc},size={sc*25,20*sc},proc=V_ShowProtoHelp,title="?" 
    10611068        Button button_help,help={"Show the help file for setting up a reduction protocol"} 
    1062         Button button_quest,pos={20,2},size={150,20},proc=V_ProtocolQuestionnaire,title="Questions" 
    1063         Button button_quest,help={"Run through the questionnaire for setting up a reduction protocol"} 
    1064         Button button_quest,disable=2 
    1065  
    1066  
    1067         PopupMenu popup_sam,pos={85,68},size={51,23},proc=V_SAMFilePopMenuProc 
     1069//      Button button_quest,pos={sc*20,2*sc},size={sc*150,20*sc},proc=V_ProtocolQuestionnaire,title="Questions" 
     1070//      Button button_quest,help={"Run through the questionnaire for setting up a reduction protocol"} 
     1071//      Button button_quest,disable=2 
     1072 
     1073 
     1074        PopupMenu popup_sam,pos={sc*85,68*sc},size={sc*51,23*sc},proc=V_SAMFilePopMenuProc 
    10681075        PopupMenu popup_sam,mode=1,value= #"V_getSAMList()"      
    1069         PopupMenu popup_bkg,pos={85,164},size={51,23},proc=V_BKGFilePopMenuProc 
     1076        PopupMenu popup_bkg,pos={sc*85,164*sc},size={sc*51,23*sc},proc=V_BKGFilePopMenuProc 
    10701077        PopupMenu popup_bkg,mode=1,value= #"V_getBGDList()" 
    1071         PopupMenu popup_emp,pos={85,213},size={51,23},proc=V_EMPFilePopMenuProc 
     1078        PopupMenu popup_emp,pos={sc*85,213*sc},size={sc*51,23*sc},proc=V_EMPFilePopMenuProc 
    10721079        PopupMenu popup_emp,mode=1,value= #"V_getEMPList()" 
    1073         PopupMenu popup_div,pos={85,263},size={51,23},proc=V_DIVFilePopMenuProc 
     1080        PopupMenu popup_div,pos={sc*85,263*sc},size={sc*51,23*sc},proc=V_DIVFilePopMenuProc 
    10741081        PopupMenu popup_div,mode=1,value= #"V_getDIVList()" 
    1075         PopupMenu popup_msk,pos={85,356},size={51,23},proc=V_MSKFilePopMenuProc 
     1082        PopupMenu popup_msk,pos={sc*85,356*sc},size={sc*51,23*sc},proc=V_MSKFilePopMenuProc 
    10761083        PopupMenu popup_msk,mode=1,value= #"V_getMSKList()"      
    10771084                 
    10781085                 
    1079         CheckBox prot_check,pos={6,163},size={74,14},title="Background" 
     1086        CheckBox prot_check,pos={sc*6,163*sc},size={sc*74,14*sc},title="Background" 
    10801087        CheckBox prot_check,help={"If checked, the specified background file will be included in the data reduction. If the file name is \"ask\", then the user will be prompted for the file"} 
    10811088        CheckBox prot_check,value= 1 
    1082         CheckBox prot_check_1,pos={6,215},size={71,14},title="Empty Cell" 
     1089        CheckBox prot_check_1,pos={sc*6,215*sc},size={sc*71,14*sc},title="Empty Cell" 
    10831090        CheckBox prot_check_1,help={"If checked, the specified empty cell file will be included in the data reduction. If the file name is \"ask\", then the user will be prompted for the file"} 
    10841091        CheckBox prot_check_1,value= 1 
    1085         CheckBox prot_check_2,pos={6,263},size={72,14},title="Sensitivity" 
     1092        CheckBox prot_check_2,pos={sc*6,263*sc},size={sc*72,14*sc},title="Sensitivity" 
    10861093        CheckBox prot_check_2,help={"If checked, the specified detector sensitivity file will be included in the data reduction. If the file name is \"ask\", then the user will be prompted for the file"} 
    10871094        CheckBox prot_check_2,value= 1 
    1088         CheckBox prot_check_3,pos={6,356},size={43,14},title="Mask" 
     1095        CheckBox prot_check_3,pos={sc*6,356*sc},size={sc*43,14*sc},title="Mask" 
    10891096        CheckBox prot_check_3,help={"If checked, the specified mask file will be included in the data reduction. If the file name is \"ask\", then the user will be prompted for the file"} 
    10901097        CheckBox prot_check_3,value= 1 
    1091         CheckBox prot_check_4,pos={6,70},size={53,14},title="Sample" 
     1098        CheckBox prot_check_4,pos={sc*6,70*sc},size={sc*53,14*sc},title="Sample" 
    10921099        CheckBox prot_check_4,help={"If checked, the specified sample file will be included in the data reduction. If the file name is \"ask\", then the user will be prompted for the file"} 
    10931100        CheckBox prot_check_4,value= 1 
    1094         CheckBox prot_check_5,pos={6,399},size={56,14},title="Average" 
     1101        CheckBox prot_check_5,pos={sc*6,399*sc},size={sc*56,14*sc},title="Average" 
    10951102        CheckBox prot_check_5,help={"If checked, the specified averaging will be performed at the end of the data reduction."} 
    10961103        CheckBox prot_check_5,value= 1   
    1097         CheckBox prot_check_9,pos={6,310},size={59,14},title="Absolute" 
     1104        CheckBox prot_check_9,pos={sc*6,310*sc},size={sc*59,14*sc},title="Absolute" 
    10981105        CheckBox prot_check_9,help={"If checked, absolute calibration will be included in the data reduction. If the parameter list is \"ask\", then the user will be prompted for absolue parameters"} 
    10991106        CheckBox prot_check_9,value= 1 
    11001107         
    11011108 
    1102 //      Button pick_sam,pos={214,28},size={70,20},proc=V_PickSAMButton,title="set SAM" 
     1109//      Button pick_sam,pos={sc*214,28*sc},size={sc*70,20*sc},proc=V_PickSAMButton,title="set SAM" 
    11031110//      Button pick_sam,help={"This button will set the file selected in the File Catalog table to be the sample file"}  
    1104 //      Button pick_bgd,pos={214,75},size={70,20},proc=V_PickBGDButton,title="set BGD" 
     1111//      Button pick_bgd,pos={sc*214,75*sc},size={sc*70,20*sc},proc=V_PickBGDButton,title="set BGD" 
    11051112//      Button pick_bgd,help={"This button will set the file selected in the File Catalog table to be the background file."} 
    1106 //      Button pick_emp,pos={214,125},size={70,20},proc=V_PickEMPButton,title="set EMP" 
     1113//      Button pick_emp,pos={sc*214,125*sc},size={sc*70,20*sc},proc=V_PickEMPButton,title="set EMP" 
    11071114//      Button pick_emp,help={"This button will set the file selected in the File Catalog table to be the empty cell file."} 
    1108 //      Button pick_DIV,pos={214,173},size={70,20},proc=V_PickDIVButton,title="set DIV" 
     1115//      Button pick_DIV,pos={sc*214,173*sc},size={sc*70,20*sc},proc=V_PickDIVButton,title="set DIV" 
    11091116//      Button pick_DIV,help={"This button will set the file selected in the File Catalog table to be the sensitivity file."} 
    1110         Button pick_ABS,pos={264,308},size={80,20},proc=V_SetABSParamsButton,title="set ABS MF" 
     1117        Button pick_ABS,pos={sc*264,308*sc},size={sc*80,20*sc},proc=V_SetABSParamsButton,title="set ABS MF" 
    11111118        Button pick_ABS,help={"This button will prompt the user for absolute scaling parameters"}        
    11121119         
    1113         Button pick_ABS_B,pos={264,330},size={80,20},proc=V_SetABSParamsButton,title="set ABS B" 
     1120        Button pick_ABS_B,pos={sc*264,330*sc},size={sc*80,20*sc},proc=V_SetABSParamsButton,title="set ABS B" 
    11141121        Button pick_ABS_B,help={"This button will prompt the user for absolute scaling parameters"}      
    1115 //      Button pick_MASK,pos={214,266},size={70,20},proc=V_PickMASKButton,title="set MASK" 
     1122//      Button pick_MASK,pos={sc*214,266*sc},size={sc*70,20*sc},proc=V_PickMASKButton,title="set MASK" 
    11161123//      Button pick_MASK,help={"This button will set the file selected in the File Catalog table to be the mask file."} 
    11171124 
    11181125 
    1119         Button pick_AVE,pos={188,401},size={150,20},proc=V_SetAverageParamsButtonProc,title="set AVERAGE params" 
     1126        Button pick_AVE,pos={sc*188,401*sc},size={sc*150,20*sc},proc=V_SetAverageParamsButtonProc,title="set AVERAGE params" 
    11201127        Button pick_AVE,help={"Prompts the user for the type of 1-D averaging to perform, as well as saving options"} 
    11211128 
    11221129         
    1123         Button pick_trim,pos={264,454},size={70,20},proc=V_TrimDataProtoButton,title="Trim" 
     1130        Button pick_trim,pos={sc*264,454*sc},size={sc*70,20*sc},proc=V_TrimDataProtoButton,title="Trim" 
    11241131        Button pick_trim,help={"This button will prompt the user for trimming parameters"}       
    11251132         
    11261133         
    1127         SetVariable samStr,pos={6,90},size={250,15},title="file:" 
     1134        SetVariable samStr,pos={sc*6,90*sc},size={sc*250,15*sc},title="file:" 
    11281135        SetVariable samStr,help={"Filename of the sample file(s) to be used in the data reduction"} 
    11291136        SetVariable samStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gSAM            
    1130         SetVariable bgdStr,pos={7,186},size={250,15},title="file:" 
     1137        SetVariable bgdStr,pos={sc*7,186*sc},size={sc*250,15*sc},title="file:" 
    11311138        SetVariable bgdStr,help={"Filename of the background file(s) to be used in the data reduction"} 
    11321139        SetVariable bgdStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gBGD 
    1133         SetVariable empStr,pos={8,236},size={250,15},title="file:" 
     1140        SetVariable empStr,pos={sc*8,236*sc},size={sc*250,15*sc},title="file:" 
    11341141        SetVariable empStr,help={"Filename of the empty cell file(s) to be used in the data reduction"} 
    11351142        SetVariable empStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gEMP 
    1136         SetVariable divStr,pos={9,285},size={250,15},title="file:" 
     1143        SetVariable divStr,pos={sc*9,285*sc},size={sc*250,15*sc},title="file:" 
    11371144        SetVariable divStr,help={"Filename of the detector sensitivity file to be used in the data reduction"} 
    11381145        SetVariable divStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gDIV 
    1139         SetVariable maskStr,pos={9,377},size={250,15},title="file:" 
     1146        SetVariable maskStr,pos={sc*9,377*sc},size={sc*250,15*sc},title="file:" 
    11401147        SetVariable maskStr,help={"Filename of the mask file to be used in the data reduction"} 
    11411148        SetVariable maskStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gMASK 
    1142         SetVariable absStr,pos={7,331},size={250,15},title="parameters:" 
     1149        SetVariable absStr,pos={sc*7,331*sc},size={sc*250,15*sc},title="parameters:" 
    11431150        SetVariable absStr,help={"Keyword-string of values necessary for absolute scaling of data. Remaining parameters are taken from the sample file."} 
    11441151        SetVariable absStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gAbsStr 
    1145         SetVariable aveStr,pos={9,424},size={250,15},title="parameters:" 
     1152        SetVariable aveStr,pos={sc*9,424*sc},size={sc*250,15*sc},title="parameters:" 
    11461153        SetVariable aveStr,help={"Keyword-string of choices used for averaging and saving the 1-D data files"} 
    11471154        SetVariable aveStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gAVE 
    11481155 
    1149         SetVariable begStr,pos={9,464},size={250,15},title="Beg Trim:" 
     1156        SetVariable begStr,pos={sc*9,464*sc},size={sc*250,15*sc},title="Beg Trim:" 
    11501157        SetVariable begStr,help={"Keyword-string of choices used for averaging and saving the 1-D data files"} 
    11511158        SetVariable begStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gBegPtsStr 
    1152         SetVariable endStr,pos={9,484},size={250,15},title="End Trim:" 
     1159        SetVariable endStr,pos={sc*9,484*sc},size={sc*250,15*sc},title="End Trim:" 
    11531160        SetVariable endStr,help={"Keyword-string of choices used for averaging and saving the 1-D data files"} 
    11541161        SetVariable endStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gEndPtsStr 
     
    11581165        //only show DRK if user wants to see it  
    11591166        //if global = 1,then show => set disable = 0 
    1160 //      CheckBox prot_check_6,pos={6,363},size={113,14},proc=DrkCheckProc,title="Use DRK correction" 
     1167//      CheckBox prot_check_6,pos={sc*6,363*sc},size={sc*113,14*sc},proc=DrkCheckProc,title="Use DRK correction" 
    11611168//      CheckBox prot_check_6,help={"If checked, the selected file will be used for DRK correction. Typically this is NOT checked"} 
    11621169//      CheckBox prot_check_6,value= 0,disable = (!root:Packages:NIST:gAllowDRK) 
    1163 //      SetVariable drkStr,pos={120,363},size={150,15},title="." 
    1164 //      SetVariable drkStr,help={"DRK detector count file"},disable = (!root:Packages:NIST:gAllowDRK) 
     1170//      SetVariable drkStr,pos={sc*120,363*sc},size={sc*150,15*sc},title="." 
     1171//      SetVariable drkStr,help={"DRK detector count file"*sc},disable = (!root:Packages:NIST:gAllowDRK) 
    11651172//      SetVariable drkStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gDRK 
    11661173 
    11671174 
    1168         Button export_button, size={120,20},pos={125,540},title="Export to Data",proc=V_ExportFileProtocol 
     1175        Button export_button, size={sc*120,20*sc},pos={sc*125,540*sc},title="Export to Data",proc=V_ExportFileProtocol 
    11691176        Button export_button, help={"Exports the protocol to data file on disk for Importing into another experiment"} 
    1170         Button import_button, size={120,20},pos={125,562},title="Import from Data",proc=V_ImportFileProtocol 
     1177        Button import_button, size={sc*120,20*sc},pos={sc*125,562*sc},title="Import from Data",proc=V_ImportFileProtocol 
    11711178        Button import_button,help={"Imports a protocol from a data file on disk for use in this experiment"} 
    1172         Button recallProt,pos={7,540},size={107,20},proc=V_RecallProtocolButton,title="Recall Protocol" 
     1179        Button recallProt,pos={sc*7,540*sc},size={sc*107,20*sc},proc=V_RecallProtocolButton,title="Recall Protocol" 
    11731180        Button recallProt,help={"Resets the panel to the file choices in  a previously saved protocol"} 
    1174         Button del_protocol,pos={7,562},size={110,20},proc=V_DeleteProtocolButton,title="Delete Protocol" 
     1181        Button del_protocol,pos={sc*7,562*sc},size={sc*110,20*sc},proc=V_DeleteProtocolButton,title="Delete Protocol" 
    11751182        Button del_protocol,help={"Use this to delete a previously saved protocol."} 
    1176         Button done_protocol,pos={285,562},size={45,20},proc=V_DoneProtocolButton,title="Done" 
     1183        Button done_protocol,pos={sc*285,562*sc},size={sc*45,20*sc},proc=V_DoneProtocolButton,title="Done" 
    11771184        Button done_protocol,help={"This button will close the panel. The panel can be recalled at any time from the SANS menu."} 
    1178         Button saveProtocol,pos={7,518},size={100,20},proc=V_SaveProtocolButton,title="Save Protocol" 
     1185        Button saveProtocol,pos={sc*7,518*sc},size={sc*100,20*sc},proc=V_SaveProtocolButton,title="Save Protocol" 
    11791186        Button saveProtocol,help={"Saves the cerrent selections in the panel to a protocol which can be later recalled"} 
    1180         Button ReduceOne,pos={240,518},size={100,20},proc=V_ReduceOneButton,title="Reduce A File" 
     1187        Button ReduceOne,pos={sc*240,518*sc},size={sc*100,20*sc},proc=V_ReduceOneButton,title="Reduce A File" 
    11811188        Button ReduceOne,help={"Using the panel selections, the specified sample file will be reduced. If none is specified, the user will be prompted for a sample file"} 
    11821189 
     
    26822689Function V_SelectABS_XYBox(x1,x2,y1,y2) 
    26832690        Variable &x1,&x2,&y1,&y2 
     2691 
     2692 
     2693        Variable sc = 1 
     2694         
     2695        NVAR gLaptopMode = root:Packages:NIST:VSANS:Globals:gLaptopMode 
     2696                 
     2697        if(gLaptopMode == 1) 
     2698                sc = 0.7 
     2699        endif 
    26842700         
    26852701        Variable err=0 
     
    26882704        Variable/G root:V_left,root:V_right,root:V_bottom,root:V_top    //must be global for auto-update 
    26892705        DoWindow/F SANS_Data 
    2690         NewPanel/K=2 /W=(139,341,382,432) as "Select the primary beam" 
     2706        NewPanel/K=2 /W=(139*sc,341*sc,382*sc,432*sc) as "Select the primary beam" 
    26912707        DoWindow/C junkWindow 
    26922708        AutoPositionWindow/E/M=1/R=SANS_Data 
    26932709         
    2694         Drawtext 21,20 ,"Select the primary beam with the" 
    2695         DrawText 21,40, "marquee and press continue" 
    2696         Button button0,pos={80,58},size={92,20},title="Continue" 
     2710        Drawtext 21*sc,20*sc ,"Select the primary beam with the" 
     2711        DrawText 21*sc,40*sc, "marquee and press continue" 
     2712        Button button0,pos={sc*80,58*sc},size={sc*92,20*sc},title="Continue" 
    26972713        Button button0,proc=V_UserSelectBox_Continue 
    26982714         
     
    27252741 
    27262742Function V_UseStdOrEmpForABS() 
    2727                  
    2728         NewPanel/K=2 /W=(139,341,402,448) as "Absolute Scaling" 
     2743         
     2744        Variable sc = 1 
     2745         
     2746        NVAR gLaptopMode = root:Packages:NIST:VSANS:Globals:gLaptopMode 
     2747                 
     2748        if(gLaptopMode == 1) 
     2749                sc = 0.7 
     2750        endif    
     2751         
     2752        NewPanel/K=2 /W=(139*sc,341*sc,402*sc,448*sc) as "Absolute Scaling" 
    27292753        DoWindow/C junkABSWindow 
    27302754        ModifyPanel cbRGB=(57346,65535,49151) 
    27312755        SetDrawLayer UserBack 
    27322756        SetDrawEnv fstyle= 1 
    2733         DrawText 21,20,"Method of absolute calibration" 
    2734         Button button0,pos={52,33},size={150,20},proc=V_UserSelectABS_Continue,title="Empty Beam Flux" 
    2735         Button button1,pos={52,65},size={150,20},proc=V_UserSelectABS_Continue,title="Secondary Standard" 
     2757        DrawText 21*sc,20*sc,"Method of absolute calibration" 
     2758        Button button0,pos={sc*52,33*sc},size={sc*150,20*sc},proc=V_UserSelectABS_Continue,title="Empty Beam Flux" 
     2759        Button button1,pos={sc*52,65*sc},size={sc*150,20*sc},proc=V_UserSelectABS_Continue,title="Secondary Standard" 
    27362760         
    27372761        PauseForUser junkABSWindow 
Note: See TracChangeset for help on using the changeset viewer.