<> <> <> <> <> <<>> DIRECTORY ViewerPrivate USING [], ViewerSpecs USING [iconHeight, iconWidth]; ViewerSpecsImpl: CEDAR PROGRAM EXPORTS ViewerPrivate, ViewerSpecs ~ BEGIN OPEN ViewerSpecs; bwScreenWidth: PUBLIC NAT _ 0; bwScreenHeight: PUBLIC NAT _ 0; colorScreenWidth: PUBLIC NAT _ 0; colorScreenHeight: PUBLIC NAT _ 0; windowBorderSize: PUBLIC NAT _ 0; captionHeight: PUBLIC NAT _ 0; menuHeight: PUBLIC NAT _ 0; menuBarHeight: PUBLIC NAT _ 0; scrollBarW: PUBLIC NAT _ 0; messageWindowHeight: PUBLIC NAT _ 0; openLeftLeftX: PUBLIC NAT _ 0; openLeftWidth: PUBLIC NAT _ 0; openRightLeftX: PUBLIC NAT _ 0; openRightWidth: PUBLIC NAT _ 0; openTopY: PUBLIC NAT _ 0; openBottomY: PUBLIC NAT _ 0; iconLeftX: PUBLIC NAT _ 0; iconAreaWidth: NAT _ 0; iconRightX: PUBLIC NAT _ 0; iconBottomY: PUBLIC NAT _ 0; iconAreaHeight: NAT _ 0; iconTopY: PUBLIC NAT _ 0; iconSpacing: PUBLIC NAT _ 0; iconRowHeight: PUBLIC NAT _ 0; iconRows: PUBLIC NAT _ 0; iconColumnWidth: PUBLIC NAT _ 0; iconColumns: PUBLIC NAT _ 0; SetDefaults: PROC ~ { bwScreenWidth _ 1024; bwScreenHeight _ 808; windowBorderSize _ 1; menuHeight _ 12; menuBarHeight _ 1; scrollBarW _ 12; messageWindowHeight _ 16; openLeftLeftX _ 0; openLeftWidth _ 600; openBottomY _ iconHeight+4; iconSpacing _ 4; -- should be multiple of 4 for grey background alignment iconLeftX _ 4; -- should be multiple of 4 for grey background alignment iconBottomY _ 0; }; ComputeDependencies: PROC ~ { captionHeight _ menuHeight; openRightLeftX _ openLeftLeftX+openLeftWidth; openRightWidth _ bwScreenWidth-openRightLeftX; openTopY _ bwScreenHeight-messageWindowHeight; iconRowHeight _ iconHeight+iconSpacing; iconRows _ (openTopY-iconBottomY)/iconRowHeight; iconAreaHeight _ iconRows*iconRowHeight; iconTopY _ iconBottomY+iconAreaHeight; iconColumnWidth _ iconWidth+iconSpacing; iconColumns _ (bwScreenWidth-iconLeftX)/iconColumnWidth; iconAreaWidth _ iconColumns*iconColumnWidth; iconRightX _ iconLeftX+iconAreaWidth; }; SetOpenLeftWidth: PUBLIC PROC [val: NAT] ~ { openLeftWidth _ MIN[val, bwScreenWidth]; ComputeDependencies[]; }; <<>> SetOpenBottomY: PUBLIC PROC [val: NAT] ~ { openBottomY _ MIN[val, openTopY]; ComputeDependencies[]; }; <<>> SetMenuHeight: PUBLIC PROC [val: NAT] ~ { menuHeight _ MIN[val, 200]; ComputeDependencies[]; }; <<>> SetScrollBarWidth: PUBLIC PROC [val: NAT] ~ { scrollBarW _ MIN[val, 200]; ComputeDependencies[]; }; <<>> SetWindowBorderSize: PUBLIC PROC [val: NAT] ~ { windowBorderSize _ MIN[val, 200]; ComputeDependencies[]; }; <<>> SetBWScreenSize: PUBLIC PROC [w, h: NAT] ~ { bwScreenWidth _ w; bwScreenHeight _ h; ComputeDependencies[]; }; <<>> SetColorScreenSize: PUBLIC PROC [w, h: NAT] ~ { colorScreenWidth _ w; colorScreenHeight _ h; ComputeDependencies[]; }; <<>> SetDefaults[]; ComputeDependencies[]; END.