Wed, 19 Nov 2025 12:17:59 +0100
implement single row listview update (Win32)
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | /* |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | * |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4 | * Copyright 2024 Olaf Wintermann. All rights reserved. |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | * |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | * Redistribution and use in source and binary forms, with or without |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | * modification, are permitted provided that the following conditions are met: |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | * |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | * 1. Redistributions of source code must retain the above copyright |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | * notice, this list of conditions and the following disclaimer. |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | * |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | * 2. Redistributions in binary form must reproduce the above copyright |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | * notice, this list of conditions and the following disclaimer in the |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | * documentation and/or other materials provided with the distribution. |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | * |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26 | * POSSIBILITY OF SUCH DAMAGE. |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | /* |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | * |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
33 | #define _GNU_SOURCE |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | #include <stdio.h> |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | #include <stdlib.h> |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | #include <string.h> |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | #include "Grid.h" |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | #include <X11/Xlib.h> |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
43 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
44 | static XtActionsRec actionslist[] = { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
45 | {"getfocus",grid_getfocus}, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46 | {"loosefocus",grid_loosefocus}, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
47 | {"NULL",NULL} |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
48 | }; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
49 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
50 | //static char defaultTranslations[] = "<BtnDown>: mousedown()\n"; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | static char defaultTranslations[] = "\ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52 | <EnterWindow>: getfocus()\n\ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
53 | <LeaveWindow>: loosefocus()\n"; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
54 | |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
55 | static XtResource resources[] = |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
56 | { |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
57 | { |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
58 | gridColumnSpacing, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
59 | gridColumnSpacing, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
60 | XmRDimension, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
61 | sizeof (Dimension), |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
62 | XtOffsetOf( GridRec, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
63 | mywidget.columnspacing), |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
64 | XmRImmediate, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
65 | (XtPointer) 0 |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
66 | }, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
67 | { |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
68 | gridRowSpacing, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
69 | gridRowSpacing, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
70 | XmRDimension, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
71 | sizeof (Dimension), |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
72 | XtOffsetOf( GridRec, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
73 | mywidget.rowspacing), |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
74 | XmRImmediate, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
75 | (XtPointer) 0 |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
76 | }, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
77 | { |
|
901
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
78 | gridPaddingLeft, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
79 | gridPaddingLeft, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
80 | XmRDimension, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
81 | sizeof (Dimension), |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
82 | XtOffsetOf( GridRec, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
83 | mywidget.padding_left), |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
84 | XmRImmediate, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
85 | (XtPointer) 0 |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
86 | }, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
87 | { |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
88 | gridPaddingRight, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
89 | gridPaddingRight, |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
90 | XmRDimension, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
91 | sizeof (Dimension), |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
92 | XtOffsetOf( GridRec, |
|
901
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
93 | mywidget.padding_right), |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
94 | XmRImmediate, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
95 | (XtPointer) 0 |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
96 | }, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
97 | { |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
98 | gridPaddingTop, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
99 | gridPaddingTop, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
100 | XmRDimension, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
101 | sizeof (Dimension), |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
102 | XtOffsetOf( GridRec, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
103 | mywidget.padding_top), |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
104 | XmRImmediate, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
105 | (XtPointer) 0 |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
106 | }, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
107 | { |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
108 | gridPaddingBottom, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
109 | gridPaddingBottom, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
110 | XmRDimension, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
111 | sizeof (Dimension), |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
112 | XtOffsetOf( GridRec, |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
113 | mywidget.padding_bottom), |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
114 | XmRImmediate, |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
115 | (XtPointer) 0 |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
116 | } |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
117 | }; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
118 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
119 | ///* |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
120 | static XtResource constraints[] = |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
121 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
122 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
123 | gridColumn, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
124 | gridColumn, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
125 | XmRDimension, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
126 | sizeof (Dimension), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
127 | XtOffsetOf( GridConstraintRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
128 | grid.x), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
129 | XmRImmediate, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
130 | (XtPointer) 0 |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
131 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
132 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
133 | gridRow, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
134 | gridRow, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
135 | XmRDimension, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
136 | sizeof (Dimension), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
137 | XtOffsetOf( GridConstraintRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
138 | grid.y), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
139 | XmRImmediate, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
140 | (XtPointer) 0 |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
141 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
142 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
143 | gridColspan, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
144 | gridColspan, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
145 | XmRDimension, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
146 | sizeof (Dimension), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
147 | XtOffsetOf( GridConstraintRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
148 | grid.colspan), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
149 | XmRImmediate, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
150 | (XtPointer) 0 |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
151 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
152 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
153 | gridRowspan, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
154 | gridRowspan, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
155 | XmRDimension, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
156 | sizeof (Dimension), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
157 | XtOffsetOf( GridConstraintRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
158 | grid.rowspan), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
159 | XmRImmediate, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
160 | (XtPointer) 0 |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
161 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
162 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
163 | gridMarginLeft, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
164 | gridMarginLeft, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
165 | XmRDimension, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
166 | sizeof (Dimension), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
167 | XtOffsetOf( GridConstraintRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
168 | grid.margin_left), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
169 | XmRImmediate, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
170 | (XtPointer) 0 |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
171 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
172 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
173 | gridMarginRight, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
174 | gridMarginRight, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
175 | XmRDimension, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
176 | sizeof (Dimension), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
177 | XtOffsetOf( GridConstraintRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
178 | grid.margin_right), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
179 | XmRImmediate, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
180 | (XtPointer) 0 |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
181 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
182 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
183 | gridMarginTop, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
184 | gridMarginTop, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
185 | XmRDimension, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
186 | sizeof (Dimension), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
187 | XtOffsetOf( GridConstraintRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
188 | grid.margin_top), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
189 | XmRImmediate, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
190 | (XtPointer) 0 |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
191 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
192 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
193 | gridMarginBottom, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
194 | gridMarginBottom, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
195 | XmRDimension, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
196 | sizeof (Dimension), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
197 | XtOffsetOf( GridConstraintRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
198 | grid.margin_bottom), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
199 | XmRImmediate, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
200 | (XtPointer) 0 |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
201 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
202 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
203 | gridHExpand, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
204 | gridHExpand, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
205 | XmRBoolean, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
206 | sizeof (Boolean), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
207 | XtOffsetOf( GridConstraintRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
208 | grid.hexpand), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
209 | XmRImmediate, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
210 | (XtPointer) 0 |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
211 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
212 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
213 | gridVExpand, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
214 | gridVExpand, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
215 | XmRBoolean, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
216 | sizeof (Boolean), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
217 | XtOffsetOf( GridConstraintRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
218 | grid.vexpand), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
219 | XmRImmediate, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
220 | (XtPointer) 0 |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
221 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
222 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
223 | gridHFill, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
224 | gridHFill, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
225 | XmRBoolean, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
226 | sizeof (Boolean), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
227 | XtOffsetOf( GridConstraintRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
228 | grid.hfill), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
229 | XmRImmediate, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
230 | (XtPointer) 0 |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
231 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
232 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
233 | gridVFill, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
234 | gridVFill, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
235 | XmRBoolean, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
236 | sizeof (Boolean), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
237 | XtOffsetOf( GridConstraintRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
238 | grid.vfill), |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
239 | XmRImmediate, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
240 | (XtPointer) 0 |
|
433
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
241 | }, |
|
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
242 | { |
|
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
243 | gridMinWidth, |
|
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
244 | gridMinWidth, |
|
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
245 | XmRDimension, |
|
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
246 | sizeof (Dimension), |
|
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
247 | XtOffsetOf( GridConstraintRec, |
|
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
248 | grid.min_width), |
|
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
249 | XmRImmediate, |
|
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
250 | (XtPointer) 0 |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
251 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
252 | }; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
253 | //*/ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
254 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
255 | GridClassRec gridClassRec = { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
256 | // Core Class |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
257 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
258 | //(WidgetClass)&constraintClassRec, // superclass |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
259 | (WidgetClass)&xmManagerClassRec, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
260 | "Grid", // class_name |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
261 | sizeof(GridRec), // widget_size |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
262 | grid_class_initialize, // class_initialize |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
263 | NULL, // class_part_initialize |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
264 | FALSE, // class_inited |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
265 | (XtInitProc)grid_initialize, // initialize |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
266 | NULL, // initialize_hook |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
267 | grid_realize, // realize |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
268 | actionslist, // actions |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
269 | XtNumber(actionslist), // num_actions |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
270 | resources, // resources |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
271 | XtNumber(resources), // num_resources |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
272 | NULLQUARK, // xrm_class |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
273 | True, // compress_motion |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
274 | True, // compress_exposure |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
275 | True, // compress_enterleave |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
276 | False, // visible_interest |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
277 | (XtWidgetProc)grid_destroy, // destroy |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
278 | (XtWidgetProc)grid_resize, // resize |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
279 | (XtExposeProc)grid_expose, // expose |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
280 | grid_set_values, // set_values |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
281 | NULL, // set_values_hook |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
282 | XtInheritSetValuesAlmost, // set_values_almost |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
283 | NULL, // get_values_hook |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
284 | (XtAcceptFocusProc)grid_acceptfocus, // accept_focus |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
285 | XtVersion, // version |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
286 | NULL, // callback_offsets |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
287 | //NULL, // tm_table |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
288 | defaultTranslations, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
289 | XtInheritQueryGeometry, // query_geometry |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
290 | NULL, // display_accelerator |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
291 | NULL, // extension |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
292 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
293 | // Composite Class |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
294 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
295 | GridGeometryManager, /* geometry_manager */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
296 | GridChangeManaged, /* change_managed */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
297 | XtInheritInsertChild, /* insert_child */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
298 | XtInheritDeleteChild, /* delete_child */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
299 | NULL, /* extension */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
300 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
301 | // Constraint Class |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
302 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
303 | constraints, /* resources */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
304 | XtNumber(constraints), /* num_resources */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
305 | sizeof(GridConstraintRec), /* constraint_size */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
306 | grid_constraint_init, /* initialize */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
307 | NULL, /* destroy */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
308 | ConstraintSetValues, /* set_values */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
309 | NULL, /* extension */ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
310 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
311 | // XmManager Class |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
312 | ///* |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
313 | { |
|
425
effdc7283337
fix Grid XmManager class fields
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
424
diff
changeset
|
314 | XtInheritTranslations, |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
315 | NULL, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
316 | 0, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
317 | NULL, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
318 | 0, |
|
425
effdc7283337
fix Grid XmManager class fields
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
424
diff
changeset
|
319 | XmInheritParentProcess, |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
320 | NULL |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
321 | }, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
322 | //*/ |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
323 | // MyWidget Class |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
324 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
325 | 0 |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
326 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
327 | }; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
328 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
329 | WidgetClass gridClass = (WidgetClass)&gridClassRec; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
330 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
331 | |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
332 | void grid_class_initialize(void) { |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
333 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
334 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
335 | void grid_initialize(Widget request, Widget new, ArgList args, Cardinal num_args) { |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
336 | Grid mn = (Grid)new; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
337 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
338 | mn->mywidget.max_col = 0; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
339 | mn->mywidget.max_row = 0; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
340 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
341 | } |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
342 | void grid_realize(Widget w,XtValueMask *valueMask,XSetWindowAttributes *attributes) { |
|
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
343 | Grid grid = (Grid)w; |
|
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
344 | XtMakeResizeRequest(w, 400, 400, NULL, NULL); |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
345 | (coreClassRec.core_class.realize)((Widget)w, valueMask, attributes); |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
346 | grid_place_children(grid); |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
347 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
348 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
349 | |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
350 | void grid_destroy(Grid widget) { |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
351 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
352 | } |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
353 | void grid_resize(Grid widget) { |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
354 | grid_place_children(widget); |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
355 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
356 | |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
357 | void grid_expose(Grid widget, XEvent *event, Region region) { |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
358 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
359 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
360 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
361 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
362 | Boolean grid_set_values(Widget old, Widget request, Widget neww, ArgList args, Cardinal *num_args) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
363 | return False; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
364 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
365 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
366 | Boolean grid_acceptfocus(Widget w, Time *t) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
367 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
368 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
369 | |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
370 | void grid_getfocus(Widget myw, XEvent *event, String *params, Cardinal *nparam) { |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
371 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
372 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
373 | |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
374 | void grid_loosefocus(Widget myw, XEvent *event, String *params, Cardinal *nparam) { |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
375 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
376 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
377 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
378 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
379 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
380 | XtGeometryResult GridGeometryManager(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *reply) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
381 | GridRec *grid = (GridRec*)XtParent(widget); |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
382 | GridConstraintRec *constraints = widget->core.constraints; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
383 | //XtVaSetValues(widget, XmNwidth, request->width, XmNheight, request->height, NULL); |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
384 | if((request->request_mode & CWWidth) == CWWidth) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
385 | widget->core.width = request->width; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
386 | constraints->grid.pref_width = request->width; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
387 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
388 | if((request->request_mode & CWHeight) == CWHeight) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
389 | widget->core.height = request->height; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
390 | constraints->grid.pref_height = request->height; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
391 | } |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
392 | grid_place_children((Grid)XtParent(widget)); |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
393 | return XtGeometryYes; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
394 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
395 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
396 | void GridChangeManaged(Widget widget) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
397 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
398 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
399 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
400 | Boolean ConstraintSetValues(Widget old, Widget request, Widget neww, ArgList args, Cardinal *num_args) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
401 | GridConstraintRec *constraints = neww->core.constraints; |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
402 | Grid grid = (Grid)XtParent(neww); |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
403 | if(constraints->grid.x > grid->mywidget.max_col) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
404 | grid->mywidget.max_col = constraints->grid.x; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
405 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
406 | if(constraints->grid.y > grid->mywidget.max_row) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
407 | grid->mywidget.max_row = constraints->grid.y; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
408 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
409 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
410 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
411 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
412 | void grid_constraint_init( |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
413 | Widget request, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
414 | Widget neww, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
415 | ArgList args, |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
416 | Cardinal* num_args |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
417 | ) |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
418 | { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
419 | GridConstraintRec *constraints = neww->core.constraints; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
420 | |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
421 | Grid grid = (Grid)XtParent(neww); |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
422 | if(constraints->grid.x > grid->mywidget.max_col) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
423 | grid->mywidget.max_col = constraints->grid.x; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
424 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
425 | if(constraints->grid.y > grid->mywidget.max_row) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
426 | grid->mywidget.max_row = constraints->grid.y; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
427 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
428 | constraints->grid.pref_width = neww->core.width; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
429 | constraints->grid.pref_height = neww->core.height; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
430 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
431 | |
|
752
08a2421957f1
fix motif build
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
459
diff
changeset
|
432 | void grid_place_children(Grid w) { |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
433 | int ncols = w->mywidget.max_col+1; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
434 | int nrows = w->mywidget.max_row+1; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
435 | GridDef *cols = calloc(ncols, sizeof(GridDef)); |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
436 | GridDef *rows = calloc(nrows, sizeof(GridDef)); |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
437 | int num_cols_expanding = 0; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
438 | int num_rows_expanding = 0; |
|
901
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
439 | int req_width = w->mywidget.padding_left + w->mywidget.padding_right; |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
440 | int req_height = w->mywidget.padding_top + w->mywidget.padding_bottom; |
|
913
3012ec57d84a
fix grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
901
diff
changeset
|
441 | int width = w->core.width; |
|
3012ec57d84a
fix grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
901
diff
changeset
|
442 | int height = w->core.height; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
443 | |
|
424
51e856688fba
add form widget to a window to fix layout problems (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
408
diff
changeset
|
444 | //printf("container width: %d\n", (int)w->core.width); |
|
51e856688fba
add form widget to a window to fix layout problems (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
408
diff
changeset
|
445 | |
|
408
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
446 | // calculate the minimum size requirements for all columns and rows |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
447 | // we need to run this 2 times: for widgets without colspan/rowspan first |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
448 | // and then again for colspan/rowspan > 1 |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
449 | int span_max = 1; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
450 | for(int r=0;r<2;r++) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
451 | for(int i=0;i<w->composite.num_children;i++) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
452 | Widget child = w->composite.children[i]; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
453 | GridConstraintRec *constraints = child->core.constraints; |
|
429
0921f8a5d535
implement progressbar (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
426
diff
changeset
|
454 | if(constraints->grid.pref_width == 0) { |
|
0921f8a5d535
implement progressbar (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
426
diff
changeset
|
455 | constraints->grid.pref_width = child->core.width; |
|
0921f8a5d535
implement progressbar (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
426
diff
changeset
|
456 | } |
|
0921f8a5d535
implement progressbar (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
426
diff
changeset
|
457 | if(constraints->grid.pref_height == 0) { |
|
0921f8a5d535
implement progressbar (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
426
diff
changeset
|
458 | constraints->grid.pref_height = child->core.height; |
|
0921f8a5d535
implement progressbar (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
426
diff
changeset
|
459 | } |
|
433
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
460 | if(constraints->grid.pref_width < constraints->grid.min_width) { |
|
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
461 | constraints->grid.pref_width = constraints->grid.min_width; |
|
605bb5dc34f1
implement progress spinner (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
429
diff
changeset
|
462 | } |
|
901
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
463 | int elm_width = constraints->grid.pref_width + constraints->grid.margin_left + constraints->grid.margin_right; |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
464 | int elm_height = constraints->grid.pref_height + constraints->grid.margin_top + constraints->grid.margin_bottom; |
|
408
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
465 | |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
466 | if(constraints->grid.colspan > span_max || constraints->grid.rowspan > span_max) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
467 | continue; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
468 | } |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
469 | |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
470 | int x = constraints->grid.x; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
471 | int y = constraints->grid.y; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
472 | // make sure ncols/nrows is correct |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
473 | // errors shouldn't happen, unless someone messes up the grid internals |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
474 | if(x >= ncols) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
475 | fprintf(stderr, "Error: widget x out of bounds\n"); |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
476 | continue; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
477 | } |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
478 | if(y >= nrows) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
479 | fprintf(stderr, "Error: widget y out of bounds\n"); |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
480 | continue; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
481 | } |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
482 | GridDef *col = &cols[x]; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
483 | GridDef *row = &rows[y]; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
484 | |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
485 | if(constraints->grid.hexpand) { |
|
408
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
486 | if(constraints->grid.colspan > 1) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
487 | // check if any column in the span is expanding |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
488 | // if not, make the last column expanding |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
489 | GridDef *last_col = col; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
490 | for(int c=x;c<ncols;c++) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
491 | last_col = &cols[c]; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
492 | if(last_col->expand) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
493 | break; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
494 | } |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
495 | } |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
496 | last_col->expand = TRUE; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
497 | } else { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
498 | col->expand = TRUE; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
499 | } |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
500 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
501 | if(constraints->grid.vexpand) { |
|
408
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
502 | if(constraints->grid.rowspan > 1) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
503 | GridDef *last_row = row; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
504 | for(int c=x;c<nrows;c++) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
505 | last_row = &rows[c]; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
506 | if(last_row->expand) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
507 | break; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
508 | } |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
509 | } |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
510 | last_row->expand = TRUE; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
511 | } else { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
512 | row->expand = TRUE; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
513 | } |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
514 | } |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
515 | |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
516 | // column size |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
517 | if(constraints->grid.colspan > 1) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
518 | // check size of all columns in span |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
519 | Dimension span_width = col->size; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
520 | GridDef *last_col = col; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
521 | for(int s=x+1;s<ncols;s++) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
522 | last_col = &cols[s]; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
523 | span_width = last_col->size; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
524 | |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
525 | } |
|
901
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
526 | int diff = elm_width - span_width; |
|
408
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
527 | if(diff > 0) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
528 | last_col->size += diff; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
529 | } |
|
901
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
530 | } else if(elm_width > col->size) { |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
531 | col->size = elm_width; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
532 | } |
|
408
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
533 | // row size |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
534 | if(constraints->grid.rowspan > 1) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
535 | Dimension span_height = row->size; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
536 | GridDef *last_row = row; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
537 | for(int s=x+1;s<nrows;s++) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
538 | last_row = &rows[s]; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
539 | span_height = last_row->size; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
540 | |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
541 | } |
|
901
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
542 | int diff = elm_height - span_height; |
|
408
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
543 | if(diff > 0) { |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
544 | last_row->size += diff; |
|
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
545 | } |
|
901
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
546 | } else if(elm_height > row->size) { |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
547 | row->size = elm_height; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
548 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
549 | } |
|
408
b06e43f1edd4
fix grid colspan/rowspan
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
407
diff
changeset
|
550 | span_max = 50000; // not sure if this is unreasonable low or high |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
551 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
552 | |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
553 | // calc required size |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
554 | for(int i=0;i<ncols;i++) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
555 | if(cols[i].expand) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
556 | num_cols_expanding++; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
557 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
558 | req_width += cols[i].size; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
559 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
560 | for(int i=0;i<nrows;i++) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
561 | if(rows[i].expand) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
562 | num_rows_expanding++; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
563 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
564 | req_height += rows[i].size; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
565 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
566 | |
|
407
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
567 | if(req_width > 0 && req_height > 0) { |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
568 | // add col/row spacing |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
569 | req_width += (ncols-1)*w->mywidget.columnspacing; |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
570 | req_height += (nrows-1)*w->mywidget.rowspacing; |
|
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
571 | |
|
407
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
572 | Widget parent = w->core.parent; |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
573 | Dimension rwidth = req_width; |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
574 | Dimension rheight = req_height; |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
575 | if(rwidth < w->core.width) { |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
576 | //rwidth = w->core.width; |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
577 | } |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
578 | if(rheight < w->core.height) { |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
579 | //rheight = w->core.height; |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
580 | } |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
581 | |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
582 | if(!w->mywidget.sizerequest) { |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
583 | Dimension actual_width, actual_height; |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
584 | w->mywidget.sizerequest = TRUE; |
|
424
51e856688fba
add form widget to a window to fix layout problems (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
408
diff
changeset
|
585 | |
|
459
4ea4bb379273
limit textarea width (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
433
diff
changeset
|
586 | //printf("sizerequest: %d x %d\n", (int)req_width, (int)req_height); |
|
4ea4bb379273
limit textarea width (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
433
diff
changeset
|
587 | |
|
424
51e856688fba
add form widget to a window to fix layout problems (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
408
diff
changeset
|
588 | //XtWidgetGeometry request; |
|
51e856688fba
add form widget to a window to fix layout problems (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
408
diff
changeset
|
589 | //request.width = req_width; |
|
51e856688fba
add form widget to a window to fix layout problems (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
408
diff
changeset
|
590 | //request.request_mode = CWWidth; |
|
51e856688fba
add form widget to a window to fix layout problems (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
408
diff
changeset
|
591 | //XtWidgetGeometry reply; |
|
51e856688fba
add form widget to a window to fix layout problems (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
408
diff
changeset
|
592 | //XtGeometryResult result = XtMakeGeometryRequest((Widget)w, &request, &reply); |
|
51e856688fba
add form widget to a window to fix layout problems (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
408
diff
changeset
|
593 | |
|
407
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
594 | XtMakeResizeRequest((Widget)w, req_width, req_height, &actual_width, &actual_height); |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
595 | w->mywidget.sizerequest = FALSE; |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
596 | //printf("size request: %d %d\n", (int)actual_width, (int)actual_height); |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
597 | } |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
598 | |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
599 | |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
600 | |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
601 | } |
|
8ea123dd89db
semi functional grid container (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
406
diff
changeset
|
602 | |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
603 | // how much space can we add to each expanding col/row |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
604 | int hexpand = 0; |
|
913
3012ec57d84a
fix grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
901
diff
changeset
|
605 | int width_diff = width - req_width; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
606 | int hexpand2 = 0; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
607 | if(width_diff > 0 && num_cols_expanding > 0) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
608 | hexpand = width_diff / num_cols_expanding; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
609 | hexpand2 = width_diff-hexpand*num_cols_expanding; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
610 | } |
|
901
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
611 | int x = w->mywidget.padding_left; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
612 | for(int i=0;i<ncols;i++) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
613 | cols[i].pos = x; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
614 | if(cols[i].expand) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
615 | cols[i].size += hexpand + hexpand2; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
616 | } |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
617 | x += cols[i].size + w->mywidget.columnspacing; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
618 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
619 | hexpand2 = 0; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
620 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
621 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
622 | int vexpand = 0; |
|
913
3012ec57d84a
fix grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
901
diff
changeset
|
623 | int height_diff = height - req_height; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
624 | int vexpand2 = 0; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
625 | if(height_diff > 0 && num_rows_expanding > 0) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
626 | vexpand = height_diff / num_rows_expanding; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
627 | vexpand2 = height_diff-vexpand*num_rows_expanding; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
628 | } |
|
901
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
629 | int y = w->mywidget.padding_bottom; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
630 | for(int i=0;i<nrows;i++) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
631 | rows[i].pos = y; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
632 | if(rows[i].expand) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
633 | rows[i].size += vexpand + vexpand2; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
634 | } |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
635 | y += rows[i].size += w->mywidget.rowspacing; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
636 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
637 | vexpand2 = 0; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
638 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
639 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
640 | for(int i=0;i<w->composite.num_children;i++) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
641 | Widget child = w->composite.children[i]; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
642 | GridConstraintRec *constraints = child->core.constraints; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
643 | GridDef c = cols[constraints->grid.x]; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
644 | GridDef r = rows[constraints->grid.y]; |
|
901
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
645 | int x = c.pos + constraints->grid.margin_left; |
|
884d70e847a3
implement grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
900
diff
changeset
|
646 | int y = r.pos + constraints->grid.margin_top; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
647 | int width = constraints->grid.pref_width; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
648 | int height = constraints->grid.pref_height; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
649 | if(constraints->grid.hfill) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
650 | if(constraints->grid.colspan > 1) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
651 | Dimension cwidth = 0; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
652 | for(int j=0;j<constraints->grid.colspan;j++) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
653 | if(constraints->grid.x+j < ncols) { |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
654 | cwidth += cols[constraints->grid.x+j].size + (j > 0 ? w->mywidget.columnspacing : 0); |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
655 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
656 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
657 | width = cwidth; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
658 | } else { |
|
913
3012ec57d84a
fix grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
901
diff
changeset
|
659 | width = c.size - w->mywidget.columnspacing - constraints->grid.margin_left - constraints->grid.margin_right; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
660 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
661 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
662 | if(constraints->grid.vfill) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
663 | if(constraints->grid.rowspan > 1) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
664 | Dimension cheight = 0; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
665 | for(int j=0;j<constraints->grid.rowspan;j++) { |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
666 | if(constraints->grid.y+j < nrows) { |
|
426
3eb26df703bf
implement Grid col/row spacing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
425
diff
changeset
|
667 | cheight += rows[constraints->grid.y+j].size + (j > 0 ? w->mywidget.rowspacing : 0); |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
668 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
669 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
670 | height = cheight; |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
671 | } else { |
|
913
3012ec57d84a
fix grid margin (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
901
diff
changeset
|
672 | height = r.size - w->mywidget.rowspacing - constraints->grid.margin_top - constraints->grid.margin_bottom; |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
673 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
674 | } |
|
900
6e1485d5451a
fix tabbar resizing (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
752
diff
changeset
|
675 | |
|
429
0921f8a5d535
implement progressbar (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
426
diff
changeset
|
676 | if(width > 0 && height > 0) { |
|
0921f8a5d535
implement progressbar (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
426
diff
changeset
|
677 | XtConfigureWidget(child, x, y, width, height, child->core.border_width); |
|
0921f8a5d535
implement progressbar (Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
426
diff
changeset
|
678 | } |
|
406
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
679 | //printf("child %d %d - %d %d\n", (int)child->core.x, (int)child->core.y, (int)child->core.width, (int)child->core.height); |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
680 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
681 | |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
682 | free(cols); |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
683 | free(rows); |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
684 | } |
|
0ebf9d7b23e8
add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
685 |