2 * Copyright (c) 1999-2000, Eric Moon.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions, and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions, and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
27 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 // ValCtrlValCtrlLayoutEntry.h
33 // +++++ cortex integration 23aug99:
37 #ifndef VAL_CTRL_LAYOUT_ENTRY_H
38 #define VAL_CTRL_LAYOUT_ENTRY_H
41 #include "cortex_defs.h"
46 __BEGIN_CORTEX_NAMESPACE
48 // a ValCtrlLayoutEntry manages the layout state information for
49 // a single child view
51 class ValCtrlLayoutEntry
{
53 friend class ValControl
;
55 public: // static instances
56 static ValCtrlLayoutEntry decimalPoint
;
67 LAYOUT_NO_PADDING
= 1, // disables left/right padding
71 ValCtrlLayoutEntry() {}
72 // stl compatibility ctor
74 // standard: yes, the frame is left invalid; that's for
75 // ValControl::insertEntry() to fix
76 ValCtrlLayoutEntry(BView
* _pView
, entry_type t
,
77 layout_flags f
= LAYOUT_NONE
)
85 ValCtrlLayoutEntry(entry_type t
, layout_flags f
= LAYOUT_NONE
)
93 ValCtrlLayoutEntry(const ValCtrlLayoutEntry
& clone
) {
97 ValCtrlLayoutEntry
& operator=(const ValCtrlLayoutEntry
& clone
) {
103 fPadding
= clone
.fPadding
;
107 // order first by x position, then by y:
108 bool operator<(const ValCtrlLayoutEntry
& b
) const {
109 return frame
.left
< b
.frame
.left
||
110 frame
.top
< b
.frame
.top
;
114 // move & size ref'd child view to match 'frame'
115 static void InitChildFrame(ValCtrlLayoutEntry
& e
);
123 // layout state info (filled in by ValControl):
128 __END_CORTEX_NAMESPACE
129 #endif // VAL_CTRL_LAYOUT_ENTRY_H