source: trunk/include/private/cnr.h@ 242

Last change on this file since 242 was 242, checked in by umoeller, 23 years ago

First attempt at new container contol.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 6.9 KB
Line 
1/*
2 *@@sourcefile cnr.h.h:
3 * private header file for cctl_cnr.c. See remarks there.
4 *
5 * Note: Version numbering in this file relates to XWorkplace version
6 * numbering.
7 */
8
9/* Copyright (C) 2003 Ulrich M”ller.
10 * This file is part of the "XWorkplace helpers" source package.
11 * This is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published
13 * by the Free Software Foundation, in version 2 as it comes in the
14 * "COPYING" file of the XWorkplace main distribution.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 */
21
22#if __cplusplus
23extern "C" {
24#endif
25
26#ifndef PRIVATE_CNR_HEADER_INCLUDED
27 #define PRIVATE_CNR_HEADER_INCLUDED
28
29 /* ******************************************************************
30 *
31 * Global stuff
32 *
33 ********************************************************************/
34
35 #define WC_CCTL_CNR_DETAILS "ComctlCnrDtls"
36
37 extern const SYSCOLORSET G_scsCnr;
38
39 #define COLUMN_PADDING_X 7
40 #define COLUMN_PADDING_Y 3
41 // padding to apply between column border and column data
42
43 #define DEFAULT_BORDER_WIDTH 1
44 // default width of lines used for details and tree view lines
45
46 /*
47 *@@ DETAILCOLUMN:
48 * private wrapper data around FIELDINFO.
49 */
50
51 typedef struct _DETAILCOLUMN
52 {
53 const FIELDINFO *pfi; // ptr to fieldinfo for this column
54
55 LONG cxTotal; // current width of the column (excluding padding);
56 // -- if pfi->cxWidth == 0, this is the computed auto-size;
57 // -- otherwise this is a copy of the pfi->cxWidth value
58
59 LONG cxWidestRecord; // width of widest record data in this column (excluding padding)
60
61 SIZEL szlTitleData; // dimensions of title data (excluding padding)
62
63 LONG xLeft; // position of column in cnr workspace coordinates
64
65 } DETAILCOLUMN, *PDETAILCOLUMN;
66
67 /*
68 *@@ RECORDLISTITEM:
69 * private wrapper data around an app's RECORDCORE
70 * that is currently inserted somewhere.
71 *
72 * We create both a list node and a tree node for
73 * each record that is currently inserted.
74 */
75
76 typedef struct _RECORDLISTITEM
77 {
78 const RECORDCORE
79 *precc, // ptr to app's RECORDCORE buffer
80 *preccParent; // parent of record or NULL if root
81
82 SIZEL szlContent; // space that records needs in current cnr view
83 // (excluding padding)
84 SIZEL szlBox; // space that records needs in current cnr view
85 // (including padding)
86 LONG yOfs; // y offset of the top of this record's rectangle
87 // from the top of the cnr workspace. Positive
88 // values mean the record is further down.
89 // In Details view, the topmost record has an
90 // offset of 0.
91
92 } RECORDLISTITEM, *PRECORDLISTITEM;
93
94 /*
95 *@@ RECORDTREEITEM:
96 * second private wrapper data around a
97 * RECORDCORE that is currently inserted somewhere.
98 *
99 * We create both a list node and a tree node for
100 * each record that is currently inserted.
101 */
102
103 typedef struct _RECORDTREEITEM
104 {
105 TREE Tree; // ulKey is app's PRECORDCORE
106 PLISTNODE pListNode; // points to the LISTNODE corresponding to record
107 } RECORDTREEITEM, *PRECORDTREEITEM;
108
109 /*
110 *@@ CNRDATA:
111 *
112 */
113
114 typedef struct _CNRDATA
115 {
116 DEFWINDATA dwdMain,
117 dwdContent;
118
119 BOOL fMiniRecords;
120
121 CNRINFO CnrInfo;
122
123 LINKLIST llAllocatedFIs; // contains PFIELDINFO's that were allocated, auto-free
124 LINKLIST llColumns; // contains PDETAILCOLUMN's with FIELDINFO's that are
125 // currently inserted, auto-free
126
127 LINKLIST llAllocatedRecs; // contains PRECORDCORE's that were allocated, auto-free
128 LINKLIST llRootRecords; // contains PRECORDLISTITEM's with RECORDCORE's that are
129 // currently inserted at root level (i.e. have no parent
130 // record), auto-free
131 TREE *RecordsTree; // tree of _all_ currently inserted RECORDLISTITEM's;
132 // we use CnrInfo.cRecords for the tree count
133
134 // paint data
135 FONTMETRICS fm;
136 COUNTRYSETTINGS2 cs;
137
138 HWND hwndDetails; // child of main cnr window
139
140 HWND hwndVScroll, // child of hwndDetails
141 hwndHScroll;
142
143 LONG cxScrollBar,
144 cyScrollBar;
145
146 LONG cyColTitlesContent, // if CnrInfo.flWindowAttr & CA_DETAILSVIEWTITLES, height of
147 // column titles area (excluding padding and horz. separator)
148 cyColTitlesBox; // ... and including those
149
150 SIZEL szlWorkarea; // dimensions of cnr workarea (area that window scrolls over)
151
152 POINTL ptlScrollOfs; // scroll ofs: x = 0 means topmost, y = 0 means leftmost
153
154 } CNRDATA, *PCNRDATA;
155
156 // bits for WM_SEM2
157 #define DDFL_INVALIDATECOLUMNS 0x0001
158 // no. of columns changed
159
160 #define DDFL_INCALIDATERECORDS 0x0002
161
162 #define DDFL_WINDOWSIZECHANGED 0x0004
163
164 #define DDFL_WORKAREACHANGED 0x0008
165
166 #define DDFL_ALL 0xFFFF
167
168 /* ******************************************************************
169 *
170 * Cnr details view stuff
171 *
172 ********************************************************************/
173
174 VOID cnrDrawString(HPS hps,
175 PCSZ pcsz,
176 PRECTL prcl,
177 ULONG fl,
178 PFONTMETRICS pfm);
179
180 VOID cnrPresParamChanged(HWND hwnd,
181 ULONG ulpp);
182
183 VOID cdtlRecalcDetails(PCNRDATA pData,
184 HPS hps,
185 PULONG pfl);
186
187 MRESULT EXPENTRY fnwpCnrDetails(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
188
189#endif
190
191#if __cplusplus
192}
193#endif
194
Note: See TracBrowser for help on using the repository browser.