home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 5.6 KB | 189 lines | [TEXT/BROW] |
- //========================================================================================
- //
- // File: Views.fr
- // Release Version: $ ODF 1 $
- //
- // Contains: Common (Platform independent) resources for the Draw part
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWRESFIL_K
- #include "FWResFil.k"
- #endif
-
- #ifndef FWVIEWS_FR
- #include "FWViews.fr"
- #endif
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- //========================================================================================
- // type FW_RRuler
- //========================================================================================
-
- type FW_RRuler : FW_RSuperView(Label='rulr')
- {
- };
-
- //========================================================================================
- // type RDrawView
- //========================================================================================
-
- type RDrawView : FW_RSuperView(Label='drvw')
- {
- };
-
- //========================================================================================
- // resource RDrawFrame(kDrawView)
- //========================================================================================
- // See constants in "FWViews.k", macros & resource types in "FWViews.fr"
-
- // Reference size for the Draw frame (will be adjusted at runtime)
- #define H FW_FIX(1000)
- #define H1 H + FW_FIX(1)
-
- // Ruler width
- #define R FW_FIX(15)
-
- // Drawing extent (sizes defined in Defines.k to be used also in .cpp files)
- #define X FW_FIX(kDrawingSizeX)
- #define Y FW_FIX(kDrawingSizeY)
-
- resource FW_RFrameLayout(kDrawView)
- {
- {H,H}, // LayoutSize
- { // Start list of frame's subviews
- RDrawView
- (
- kDrawViewID, // View id
- {R, R, H-R-FW_SBSIZE, H-R-FW_SBSIZE},// Bounds
- FW_kFitToEnclosure, // bindings
- {X,Y}, // extent
- 1, // Make it the ContentView
- FW_kXYScrolling, // scrolling flag
- {} // no SubViews
- ),
- FW_RScrollBar // Horizontal SB
- (
- kHorzScrollBarID, // View id
- {-FW_ONE, H-FW_SBSIZE, H1-FW_SBSIZE, H1},// Bounds
- FW_kHScrollBarBinding, // Standard horizontal SB bindings
- 0, // control message
- 0, // control receiver
- 0, // control value
- 0, // SB Min Value (adjusted at runtime)
- 1, // SB Max Value (adjusted at runtime)
- FW_ONE, // SB Minor Units (adjusted at runtime)
- FW_ONE // SB Major Units (adjusted at runtime)
- ),
- FW_RScrollBar // Vertical SB
- (
- kVertScrollBarID, // View id
- {H-FW_SBSIZE,-FW_ONE, H1, H1-FW_SBSIZE},// Bounds
- FW_kVScrollBarBinding, // Standard vertical SB binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- 0, // SB Min Value (adjusted at runtime)
- 1, // SB Max Value (adjusted at runtime)
- FW_ONE, // SB Minor Units (adjusted at runtime)
- FW_ONE // SB Major Units (adjusted at runtime)
- ),
- FW_RGrowBox
- (
- kGrowBoxID, // View id
- {H - FW_SBSIZE, H - FW_SBSIZE, H1, H1}, // Bounds
- FW_kGrowBoxBinding // standard grow box binding
- ),
- FW_RRuler // Horizontal ruler
- (
- kHorzRulerID, // View id
- {R, 0, H-FW_SBSIZE, R}, // Bounds
- FW_kFixedBounds, // bindings
- {X,R}, // extent
- 0, // not the ContentView
- FW_kXScrolling, // scrolling flag
- {} // no SubViews
- ),
- FW_RRuler // Vertical ruler
- (
- kVertRulerID, // View id
- {0, R, R, H-FW_SBSIZE}, // Bounds
- FW_kFixedBounds, // bindings
- {R,Y}, // extent
- 0, // not the ContentView
- FW_kYScrolling, // scrolling flag
- {} // no SubViews
- )
- },
- { // Scroller
- FW_RScrollBarScroller
- (
- FW_FIX(15), // AutoScrollInset
- {FW_FIX(36), FW_FIX(36)}, // scroll Unit
- 1, // Responds to function key
- 0, // Live Scrolling
- kHorzScrollBarID, // horiz sb id
- kVertScrollBarID // vertical sb id
- )
- }
- };
-
- //-------------------------------------------------------------------------------------
- // Duplicate RDrawFrame resource without GrowBox and Scroll-bars for non-root frames
- //-------------------------------------------------------------------------------------
- // (See also how the Container sample avoids duplicating resources when there are
- // differences between root and non-root frames)
-
- resource FW_RFrameLayout(kDrawViewNotRoot)
- {
- {H,H}, // LayoutSize
- { // Start list of frame's subviews
- RDrawView
- (
- kDrawViewID, // View id
- {R, R, H-R-FW_SBSIZE, H-R-FW_SBSIZE},// Bounds
- FW_kFitToEnclosure, // bindings
- {X,Y}, // extent
- 1, // Make it the ContentView
- FW_kXYScrolling, // scrolling flag
- {} // no SubViews
- ),
- FW_RRuler // Horizontal ruler
- (
- kHorzRulerID, // View id
- {R, 0, H-FW_SBSIZE, R}, // Bounds
- FW_kFixedBounds, // bindings
- {X,R}, // extent
- 0, // not the ContentView
- FW_kXScrolling, // scrolling flag
- {} // no SubViews
- ),
- FW_RRuler // Vertical ruler
- (
- kVertRulerID, // View id
- {0, R, R, H-FW_SBSIZE}, // Bounds
- FW_kFixedBounds, // bindings
- {R,Y}, // extent
- 0, // not the ContentView
- FW_kYScrolling, // scrolling flag
- {} // no SubViews
- )
- },
- { // Scroller
- FW_RScrollBarScroller
- (
- FW_FIX(15), // AutoScrollInset
- {FW_FIX(36), FW_FIX(36)}, // ScrollUnit
- 1, // Responds to function key
- 0, // Live Scrolling
- kHorzScrollBarID, // horiz sb id
- kVertScrollBarID // vertical sb id
- )
- }
- };
-