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

    r1243 r1246  
    118118// 
    119119Proc V_MaskEditorPanel() 
     120        Variable sc = 1 
     121                         
     122        if(root:Packages:NIST:VSANS:Globals:gLaptopMode == 1) 
     123                sc = 0.7 
     124        endif 
     125 
    120126        PauseUpdate; Silent 1           // building window... 
    121127 
    122         Display /W=(662,418,1300,960)/N=MaskEditPanel    /K=1 
     128        Display /W=(662*sc,418*sc,1300*sc,960*sc)/N=MaskEditPanel        /K=1 
    123129 
    124130        ShowTools rect 
    125         ControlBar 100 
    126                  
    127         PopupMenu popup_0,pos={18,40},size={109,20},proc=V_SetMaskPanelPopMenuProc,title="Detector Panel" 
     131        ControlBar 100*sc 
     132                 
     133        PopupMenu popup_0,pos={sc*18,40*sc},size={sc*109,20*sc},proc=V_SetMaskPanelPopMenuProc,title="Detector Panel" 
    128134        PopupMenu popup_0,mode=1,popvalue="FL",value= #"\"FL;FR;FT;FB;ML;MR;MT;MB;B;\"" 
    129         PopupMenu popup_2,pos={18,10},size={109,20},title="Data Source"//,proc=SetFldrPopMenuProc 
     135        PopupMenu popup_2,pos={sc*18,10*sc},size={sc*109,20*sc},title="Data Source"//,proc=SetFldrPopMenuProc 
    130136        PopupMenu popup_2,mode=1,popvalue="RAW",value= #"\"RAW;SAM;ABS;VCALC;\"" 
    131137 
    132         SetVariable setvar0,pos={226,32},size={112,23},title="tube number" 
     138        SetVariable setvar0,pos={sc*226,32*sc},size={sc*112,23*sc},title="tube number" 
    133139        SetVariable setvar0,limits={0,127,1},value=root:Packages:NIST:VSANS:Globals:Mask:gMaskTube 
    134         Button button_0,pos={226,58},size={50.00,20.00},proc=V_AddToMaskButtonProc,title="Add" 
    135         Button button_1,pos={288,58},size={50.00,20.00},proc=V_RemoveFromMaskButtonProc,title="Del" 
    136         Button button_2,pos={496,41},size={90.00,20.00},proc=V_ToggleMaskButtonProc,title="Toggle" 
    137         Button button_3,pos={506,66},size={80.00,20.00},proc=V_SaveMaskButtonProc,title="Save" 
    138         CheckBox check_0,pos={174,35},size={37.00,15.00},proc=V_DrawMaskRadioCheckProc,title="Row" 
     140        Button button_0,pos={sc*226,58*sc},size={sc*50.00,20.00*sc},proc=V_AddToMaskButtonProc,title="Add" 
     141        Button button_1,pos={sc*288,58*sc},size={sc*50.00,20.00*sc},proc=V_RemoveFromMaskButtonProc,title="Del" 
     142        Button button_2,pos={sc*496,41*sc},size={sc*90.00,20.00*sc},proc=V_ToggleMaskButtonProc,title="Toggle" 
     143        Button button_3,pos={sc*506,66*sc},size={sc*80.00,20.00*sc},proc=V_SaveMaskButtonProc,title="Save" 
     144        CheckBox check_0,pos={sc*174,35*sc},size={sc*37.00,15.00*sc},proc=V_DrawMaskRadioCheckProc,title="Row" 
    139145        CheckBox check_0,value= 0,mode=1 
    140         CheckBox check_1,pos={174,58},size={32.00,15.00},proc=V_DrawMaskRadioCheckProc,title="Col" 
     146        CheckBox check_1,pos={sc*174,58*sc},size={sc*32.00,15.00*sc},proc=V_DrawMaskRadioCheckProc,title="Col" 
    141147        CheckBox check_1,value= 1,mode=1 
    142148 
    143         Button button_5,pos={18,70.00},size={70.00,20.00},proc=V_MaskToolsButton,title="Tools" 
    144         Button button_6,pos={380,33},size={90.00,20.00},proc=V_AddShapeToMaskButtonProc,title="Add Shape" 
    145         Button button_7,pos={380,58},size={90.00,20.00},proc=V_AddShapeToMaskButtonProc,title="Del Shape" 
    146         Button button_8,pos={556.00,14.00},size={30.00,20.00},proc=V_DrawMaskHelpButtonProc,title="?" 
    147  
    148         GroupBox group0,pos={163.00,5.00},size={188.00,90.00},title="Mask Tubes" 
    149         GroupBox group1,pos={365.00,5.00},size={122.00,90.00},title="Mask Shapes" 
     149        Button button_5,pos={sc*18,70.00*sc},size={sc*70.00,20.00*sc},proc=V_MaskToolsButton,title="Tools" 
     150        Button button_6,pos={sc*380,33*sc},size={sc*90.00,20.00*sc},proc=V_AddShapeToMaskButtonProc,title="Add Shape" 
     151        Button button_7,pos={sc*380,58*sc},size={sc*90.00,20.00*sc},proc=V_AddShapeToMaskButtonProc,title="Del Shape" 
     152        Button button_8,pos={sc*556.00,14.00*sc},size={sc*30.00,20.00*sc},proc=V_DrawMaskHelpButtonProc,title="?" 
     153 
     154        GroupBox group0,pos={sc*163.00,5.00*sc},size={sc*188.00,90.00*sc},title="Mask Tubes" 
     155        GroupBox group1,pos={sc*365.00,5.00*sc},size={sc*122.00,90.00*sc},title="Mask Shapes" 
    150156 
    151157        SetWindow MaskEditPanel, hook(MyHook)=V_MaskWindowHook 
     
    11171123 
    11181124Proc V_Display_Det_Panels() 
     1125 
     1126        Variable sc = 1 
     1127                         
     1128        if(root:Packages:NIST:VSANS:Globals:gLaptopMode == 1) 
     1129                sc = 0.7 
     1130        endif 
     1131 
    11191132        PauseUpdate; Silent 1           // building window... 
    1120         NewPanel /W=(720,45,1500,570)/N=VSANS_Det_Panels/K=1 
     1133        NewPanel /W=(720*sc,45*sc,1500*sc,570*sc)/N=VSANS_Det_Panels/K=1 
    11211134        DoWindow/C VSANS_Det_Panels 
    11221135//      ModifyPanel fixedSize=1,noEdit =1 
    11231136 
    11241137 
    1125         PopupMenu popup0,pos={15.00,10.00},size={77.00,23.00},proc=V_PickCarriagePopMenuProc,title="Carriage" 
     1138        PopupMenu popup0,pos={sc*15.00,10.00*sc},size={sc*77.00,23.00*sc},proc=V_PickCarriagePopMenuProc,title="Carriage" 
    11261139        PopupMenu popup0,mode=1,value= #"\"F;M;B;\"" 
    1127         PopupMenu popup1,pos={100.00,10.00},size={68.00,23.00},proc=V_PickFolderPopMenuProc,title="Folder" 
     1140        PopupMenu popup1,pos={sc*100.00,10.00*sc},size={sc*68.00,23.00*sc},proc=V_PickFolderPopMenuProc,title="Folder" 
    11281141        PopupMenu popup1,mode=1,popvalue="RAW",value= #"\"SAM;EMP;BGD;DIV;COR;CAL;RAW;ABS;STO;SUB;DRK;MSK;ADJ;VCALC;\"" 
    11291142//      PopupMenu popup1,mode=1,popvalue="RAW",value= #"\"SAM;EMP;BGD;DIV;COR;CAL;RAW;ABS;STO;SUB;DRK;MSK;ADJ;VCALC;\"" 
    1130         PopupMenu popup2,pos={200.00,10.00},size={83.00,23.00},title="Bin Type"//,proc=V_DummyPopMenuProc 
     1143        PopupMenu popup2,pos={sc*200.00,10.00*sc},size={sc*83.00,23.00*sc},title="Bin Type"//,proc=V_DummyPopMenuProc 
    11311144        PopupMenu popup2,mode=1,value= ksBinTypeStr 
    1132         PopupMenu popup3,pos={350,10.00},size={83.00,23.00},title="Average Type"//,proc=V_DummyPopMenuProc 
     1145        PopupMenu popup3,pos={sc*350,10.00*sc},size={sc*83.00,23.00*sc},title="Average Type"//,proc=V_DummyPopMenuProc 
    11331146        PopupMenu popup3,mode=1,value= #"\"Circular;Sector;Annular;\"" 
    1134 //      Button button0,pos={520.00,10.00},size={110.00,20.00},proc=V_UpdatePanelsButtonProc,title="Update Display" 
    1135         Button button1,pos={520.00,40.00},size={100.00,20.00},proc=V_ToggleFourMaskButtonProc,title="Toggle Mask" 
    1136         Button button2,pos={350.00,40.00},size={120.00,20.00},proc=V_ShowAvgRangeButtonProc,title="Show Avg Range" 
    1137         Button button3,pos={350.00,70.00},size={100.00,20.00},proc=V_DoPanelAvgButtonProc,title="Do Average" 
    1138         Button button4,pos={720.00,10.00},size={25.00,20.00},proc=V_AvgPanelHelpButtonProc,title="?" 
    1139  
    1140         SetVariable setvar0,pos={20,40},size={160,23},title="Annulus q-center (A)" 
     1147//      Button button0,pos={sc*520.00,10.00*sc},size={sc*110.00,20.00*sc},proc=V_UpdatePanelsButtonProc,title="Update Display" 
     1148        Button button1,pos={sc*520.00,40.00*sc},size={sc*100.00,20.00*sc},proc=V_ToggleFourMaskButtonProc,title="Toggle Mask" 
     1149        Button button2,pos={sc*350.00,40.00*sc},size={sc*120.00,20.00*sc},proc=V_ShowAvgRangeButtonProc,title="Show Avg Range" 
     1150        Button button3,pos={sc*350.00,70.00*sc},size={sc*100.00,20.00*sc},proc=V_DoPanelAvgButtonProc,title="Do Average" 
     1151        Button button4,pos={sc*720.00,10.00*sc},size={sc*25.00,20.00*sc},proc=V_AvgPanelHelpButtonProc,title="?" 
     1152 
     1153        SetVariable setvar0,pos={sc*20,40*sc},size={sc*160,23*sc},title="Annulus q-center (A)" 
    11411154        SetVariable setvar0,limits={0,1,0.001},value=root:Packages:NIST:VSANS:Globals:Mask:gAnnularQCtr 
    1142         SetVariable setvar1,pos={20,70},size={160,23},title="Annulus (+/-) q (A)" 
     1155        SetVariable setvar1,pos={sc*20,70*sc},size={sc*160,23*sc},title="Annulus (+/-) q (A)" 
    11431156        SetVariable setvar1,limits={0,1,0.001},value=root:Packages:NIST:VSANS:Globals:Mask:gAnnularDQ 
    1144         SetVariable setvar2,pos={190,40},size={150,23},title="Sector Angle (deg)" 
     1157        SetVariable setvar2,pos={sc*190,40*sc},size={sc*150,23*sc},title="Sector Angle (deg)" 
    11451158        SetVariable setvar2,limits={-90,90,1},value=root:Packages:NIST:VSANS:Globals:Mask:gSectorAngle 
    1146         SetVariable setvar3,pos={190,70},size={150,23},title="Sector (+/-) (deg)" 
     1159        SetVariable setvar3,pos={sc*190,70*sc},size={sc*150,23*sc},title="Sector (+/-) (deg)" 
    11471160        SetVariable setvar3,limits={0,90,1},value=root:Packages:NIST:VSANS:Globals:Mask:gSectorDQ 
    11481161 
    1149         PopupMenu popup4,pos={200,100},size={90,23.00},title="Sector Side(s)"//,proc=V_DummyPopMenuProc 
     1162        PopupMenu popup4,pos={sc*200,100*sc},size={sc*90,23.00*sc},title="Sector Side(s)"//,proc=V_DummyPopMenuProc 
    11501163        PopupMenu popup4,mode=1,value= #"\"both;left;right;\"" 
    11511164 
     
    11591172         
    11601173//      Display/W=(745,45,945,425)/HOST=#  
    1161         Display/W=(10,45+80,210,425+80)/HOST=#  
     1174        Display/W=(10*sc,(45+80)*sc,210*sc,(425+80)*sc)/HOST=#  
    11621175        //  root:Packages:NIST:VSANS:RAW:entry:instrument:detector_FL:data 
    11631176        AppendImage/T/G=1 tmpLR         //  /G=1 flag prevents interpretation as RGB so 3, 4 slices display correctly 
     
    11781191 
    11791192//      Display/W=(1300,45,1500,425)/HOST=#  
    1180         Display/W=(565,45+80,765,425+80)/HOST=#  
     1193        Display/W=(565*sc,(45+80)*sc,765*sc,(425+80)*sc)/HOST=#  
    11811194        AppendImage/T/G=1 tmpLR         //  /G=1 flag prevents interpretation as RGB so 3, 4 slices display correctly 
    11821195        ModifyImage tmpLR ctab= {*,*,ColdWarm,0} 
     
    11951208 
    11961209//      Display/W=(945,45,1300,235)/HOST=#  
    1197         Display/W=(210,45+80,565,235+80)/HOST=#  
     1210        Display/W=(210*sc,(45+80)*sc,565*sc,(235+80)*sc)/HOST=#  
    11981211        AppendImage/T/G=1 tmpTB         //  /G=1 flag prevents interpretation as RGB so 3, 4 slices display correctly 
    11991212        ModifyImage tmpTB ctab= {*,*,ColdWarm,0} 
     
    12121225 
    12131226//      Display/W=(945,235,1300,425)/HOST=#  
    1214         Display/W=(210,235+80,565,425+80)/HOST=#  
     1227        Display/W=(210*sc,(235+80)*sc,565*sc,(425+80)*sc)/HOST=#  
    12151228        AppendImage/T/G=1 tmpTB         //  /G=1 flag prevents interpretation as RGB so 3, 4 slices display correctly 
    12161229        ModifyImage tmpTB ctab= {*,*,ColdWarm,0} 
     
    12371250// 
    12381251Function V_UpdateFourPanelDisp() 
     1252 
     1253 
     1254        Variable sc = 1 
     1255         
     1256        NVAR gLaptopMode = root:Packages:NIST:VSANS:Globals:gLaptopMode 
     1257                 
     1258        if(gLaptopMode == 1) 
     1259                sc = 0.7 
     1260        endif 
    12391261 
    12401262        ControlInfo/W=VSANS_Det_Panels popup0 
Note: See TracChangeset for help on using the changeset viewer.