File: form.cpp

package info (click to toggle)
warzone2100 4.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 660,348 kB
  • sloc: cpp: 675,711; ansic: 387,204; javascript: 75,107; python: 16,628; php: 4,294; sh: 3,941; makefile: 2,330; lisp: 1,492; cs: 489; xml: 404; perl: 224; ruby: 156; java: 89
file content (610 lines) | stat: -rw-r--r-- 16,900 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
/*
	This file is part of Warzone 2100.
	Copyright (C) 1999-2004  Eidos Interactive
	Copyright (C) 2005-2021  Warzone 2100 Project

	Warzone 2100 is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	Warzone 2100 is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with Warzone 2100; if not, write to the Free Software
	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/** @file
 *  Functionality for the form widget.
 */

#include <string.h>

#include "lib/framework/frame.h"
#include "lib/framework/math_ext.h"
#include "widget.h"
#include "widgint.h"
#include "form.h"
#include "tip.h"
#include "label.h"
#include "lib/ivis_opengl/pieblitfunc.h"
#include "lib/ivis_opengl/piepalette.h"

#include <array>

#define WZ_FORM_MINIMIZED_LEFT_PADDING 5
#define WZ_FORM_MINIMIZED_MAXBUTTON_RIGHT_PADDING WZ_FORM_MINIMIZED_LEFT_PADDING

W_FORMINIT::W_FORMINIT()
	: disableChildren(false)
{}

W_FORM::W_FORM(W_FORMINIT const *init)
	: WIDGET(init, WIDG_FORM)
	, disableChildren(init->disableChildren)
{
	ASSERT((init->style & ~(WFORM_INVISIBLE | WFORM_CLICKABLE | WFORM_NOCLICKMOVE | WFORM_NOPRIMARY | WFORM_SECONDARY | WIDG_HIDDEN)) == 0, "Unknown style bit");
	ASSERT((init->style & WFORM_INVISIBLE) == 0 || (init->style & WFORM_CLICKABLE) == 0, "Cannot have an invisible clickable form");
	ASSERT((init->style & WFORM_CLICKABLE) != 0 || (init->style & (WFORM_NOPRIMARY | WFORM_SECONDARY)) == 0, "Cannot set keys if the form isn't clickable");
}

W_FORM::W_FORM()
	: WIDGET(WIDG_FORM)
	, disableChildren(false)
{}

W_CLICKFORM::W_CLICKFORM(W_FORMINIT const *init)
	: W_FORM(init)
	, state(WBUT_PLAIN)
	, pTip(init->pTip)
	, HilightAudioID(WidgGetHilightAudioID())
	, ClickedAudioID(WidgGetClickedAudioID())
	, AudioCallback(WidgGetAudioCallback())
{}

W_CLICKFORM::W_CLICKFORM()
	: W_FORM()
	, state(WBUT_PLAIN)
	, HilightAudioID(WidgGetHilightAudioID())
	, ClickedAudioID(WidgGetClickedAudioID())
	, AudioCallback(WidgGetAudioCallback())
{}

unsigned W_CLICKFORM::getState() const
{
	return state & (WBUT_DISABLE | WBUT_LOCK | WBUT_CLICKLOCK | WBUT_FLASH | WBUT_DOWN | WBUT_HIGHLIGHT);
}

void W_CLICKFORM::setState(unsigned newState)
{
	ASSERT(!((newState & WBUT_LOCK) && (newState & WBUT_CLICKLOCK)), "Cannot have both WBUT_LOCK and WBUT_CLICKLOCK");

	unsigned mask = WBUT_DISABLE | WBUT_LOCK | WBUT_CLICKLOCK;
	state = (state & ~mask) | (newState & mask);
	dirty = true;
}

void W_CLICKFORM::setFlash(bool enable)
{
	if (enable)
	{
		state |= WBUT_FLASH;
	}
	else
	{
		state &= ~WBUT_FLASH;
	}
	dirty = true;
}

void W_CLICKFORM::run(W_CONTEXT *psContext)
{
	W_FORM::run(psContext);

	if (clickDownStart.has_value())
	{
		const std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
		if (std::chrono::duration_cast<std::chrono::milliseconds>(now - clickDownStart.value()) >= widgGetClickHoldMS())
		{
			if (clickDownKey.has_value())
			{
				if (clickHeld(psContext, clickDownKey.value()))
				{
					// clear button down state, as the clickHeld event "consumed" this click
					state &= ~WBUT_DOWN;
				}
			}
			clickDownStart.reset();
		}
	}
}

// Returns true if "consumed" held click
bool W_CLICKFORM::clickHeld(W_CONTEXT *psContext, WIDGET_KEY key)
{
	return false;
}

bool W_FORM::isUserMovable() const
{
	return userMovable || formState == FormState::MINIMIZED;
}

void W_FORM::clicked(W_CONTEXT *psContext, WIDGET_KEY key)
{
	dirty = true;
	if (isUserMovable() && key == WKEY_PRIMARY)
	{
		if (formState == FormState::MINIMIZED && (psContext->mx <= minimizedGeometry().x() + minimizedLeftButtonWidth))
		{
			return;
		}
		dragStart = Vector2i(psContext->mx, psContext->my);
	}
}

void W_FORM::released(W_CONTEXT *psContext, WIDGET_KEY)
{
	if (formState == FormState::MINIMIZED
		&& !dragStart.has_value()	// mousedown was on "re-open" button (drag is only started when mouse is over the rest of the minimized frame)
		&& (psContext->mx <= minimizedGeometry().x() + minimizedLeftButtonWidth)) // mouse is still over "re-open" button
	{
		// clicked + released mouse-button on "re-open" button
		toggleMinimized();
		return;
	}
	if (!isUserMovable() || !dragStart.has_value()) { return; }
	dragStart = nullopt;
	dirty = true;
}

void W_FORM::run(W_CONTEXT *psContext)
{
	// currently, no-op
}

bool W_FORM::capturesMouseDrag(WIDGET_KEY wkey)
{
	return isUserMovable() && (wkey == WKEY_PRIMARY) && dragStart.has_value();
}

void W_FORM::mouseDragged(WIDGET_KEY wkey, W_CONTEXT *psStartContext, W_CONTEXT *psContext)
{
	if (wkey != WKEY_PRIMARY)
	{
		return;
	}

	if (!userMovable || !dragStart.has_value()) { return; }

	Vector2i currentMousePos(psContext->mx, psContext->my);
	if (currentMousePos == dragStart.value()) { return; }
	Vector2i dragDelta(currentMousePos.x - dragStart.value().x, currentMousePos.y - dragStart.value().y);

	const WzRect *pRectToMove = &(geometry());
	if (formState == FormState::MINIMIZED)
	{
		pRectToMove = &(minimizedGeometry());
	}
	Vector2i newPosition(pRectToMove->x() + dragDelta.x, pRectToMove->y() + dragDelta.y);

	int maxPossibleX = pie_GetVideoBufferWidth() - pRectToMove->width();
	int maxPossibleY = pie_GetVideoBufferHeight() - pRectToMove->height();
	newPosition.x = clip<int>(newPosition.x, 0, maxPossibleX);
	newPosition.y = clip<int>(newPosition.y, 0, maxPossibleY);
	if (formState != FormState::MINIMIZED)
	{
		move(newPosition.x, newPosition.y);
	}
	else
	{
		minimizedRect = WzRect(newPosition.x, newPosition.y, minimizedRect.width(), minimizedRect.height());
	}
	dirty = true;
	dragStart = currentMousePos;
}

/* Respond to a mouse click */
void W_CLICKFORM::clicked(W_CONTEXT *psContext, WIDGET_KEY key)
{
	W_FORM::clicked(psContext, key);

	// Can't click a button if it is disabled or locked down.
	if ((state & (WBUT_DISABLE | WBUT_LOCK)) == 0)
	{
		// Check this is the correct key
		if ((!(style & WFORM_NOPRIMARY) && key == WKEY_PRIMARY) ||
		    ((style & WFORM_SECONDARY) && key == WKEY_SECONDARY))
		{
			state &= ~WBUT_FLASH;  // Stop it flashing
			state |= WBUT_DOWN;
			clickDownStart = std::chrono::steady_clock::now();
			clickDownKey = key;
			dirty = true;

			if (AudioCallback != nullptr)
			{
				AudioCallback(ClickedAudioID);
			}
		}
	}
}

void W_CLICKFORM::released(W_CONTEXT *, WIDGET_KEY key)
{
	if ((state & WBUT_DOWN) != 0)
	{
		// Check this is the correct key.
		if ((!(style & WFORM_NOPRIMARY) && key == WKEY_PRIMARY) ||
		    ((style & WFORM_SECONDARY) && key == WKEY_SECONDARY))
		{
			if (auto lockedScreen = screenPointer.lock())
			{
				lockedScreen->setReturn(shared_from_this());
			}
			state &= ~WBUT_DOWN;
			dirty = true;
		}
	}

	clickDownStart = nullopt;
	clickDownKey = nullopt;
}


/* Respond to a mouse moving over a form */
void W_CLICKFORM::highlight(W_CONTEXT *psContext)
{
	state |= WBUT_HIGHLIGHT;

	if (AudioCallback != nullptr)
	{
		AudioCallback(HilightAudioID);
	}
}


/* Respond to the mouse moving off a form */
void W_FORM::highlightLost()
{
	dirty = true;
}

void W_CLICKFORM::highlightLost()
{
	W_FORM::highlightLost();

	state &= ~(WBUT_DOWN | WBUT_HIGHLIGHT);
	clickDownStart = nullopt;
	clickDownKey = nullopt;
	dirty = true;
}

void W_FORM::display(int xOffset, int yOffset)
{
	if ((style & WFORM_INVISIBLE) == 0)
	{
		int x0 = x() + xOffset;
		int y0 = y() + yOffset;
		int x1 = x0 + width();
		int y1 = y0 + height();

		iV_ShadowBox(x0, y0, x1, y1, 1, WZCOL_FORM_LIGHT, WZCOL_FORM_DARK, WZCOL_FORM_BACKGROUND);
	}
}

void W_FORM::screenSizeDidChange(int oldWidth, int oldHeight, int newWidth, int newHeight)
{
	if (formState == FormState::MINIMIZED)
	{
		// must ensure that the minimizedRect is fully within the new screen bounds
		int newMinX0 = std::max(0, std::min(minimizedRect.x(), newWidth - minimizedRect.width()));
		int newMinY0 = std::max(0, std::min(minimizedRect.y(), newHeight - minimizedRect.height()));
		minimizedRect = WzRect(newMinX0, newMinY0, minimizedRect.width(), minimizedRect.height());
	}
	WIDGET::screenSizeDidChange(oldWidth, oldHeight, newWidth, newHeight);
}

bool W_FORM::hitTest(int x, int y) const
{
	if (!minimizable || formState != FormState::MINIMIZED)
	{
		return WIDGET::hitTest(x, y);
	}
	// handle: minimized
	return minimizedGeometry().contains(x, y);
}

std::shared_ptr<WIDGET> W_FORM::findMouseTargetRecursive(W_CONTEXT *psContext, WIDGET_KEY key, bool wasPressed)
{
	if ((!minimizable || formState != FormState::MINIMIZED) && !disableChildren)
	{
		return WIDGET::findMouseTargetRecursive(psContext, key, wasPressed);
	}

	if (!visible())
	{
		return nullptr;
	}

	if (transparentToMouse())
	{
		return nullptr;
	}

	return shared_from_this();
}

void W_FORM::displayRecursive(WidgetGraphicsContext const &context)
{
	if (!minimizable || formState != FormState::MINIMIZED)
	{
		WIDGET::displayRecursive(context);
		return;
	}

	// handle: minimized
	displayMinimized(context.getXOffset(), context.getYOffset());
}

void W_FORM::displayMinimized(int xOffset, int yOffset)
{
	auto minDim = minimizedGeometry();

	int x0 = minDim.x() + xOffset;
	int y0 = minDim.y() + yOffset;
	int x1 = x0 + minDim.width();
	int y1 = y0 + minDim.height();

	// draw "drop-shadow"
	int dropShadowX0 = std::max<int>(x0 - 5, 0);
	int dropShadowY0 = std::max<int>(y0 - 5, 0);
	int dropShadowX1 = std::min<int>(x1 + 5, pie_GetVideoBufferWidth());
	int dropShadowY1 = std::min<int>(y1 + 5, pie_GetVideoBufferHeight());
	pie_UniTransBoxFill((float)dropShadowX0, (float)dropShadowY0, (float)dropShadowX1, (float)dropShadowY1, pal_RGBA(0, 0, 0, 40));

	// draw background + border
	iV_TransBoxFill((float)x0, (float)y0, (float)x1, (float)y1);
	iV_Box(x0, y0, x1, y1, pal_RGBA(255, 255, 255, 150));

	// draw minimized title
	int titleY0 = y0 + (minDim.height() - minimizedTitle->height()) / 2;
	minimizedTitle->display(x0 + WZ_FORM_MINIMIZED_LEFT_PADDING, titleY0);

	if (isMouseOverWidget() && (mouseX() <= x0 + minimizedLeftButtonWidth))
	{
		// Draw "re-open" button border when mouse is over
		iV_Box(x0 + 1, y0 + 1, x0 + minimizedLeftButtonWidth, y1 - 1, pal_RGBA(255, 255, 255, 150));
	}
}

void W_FORM::enableMinimizing(const std::string& _minimizedTitle, PIELIGHT titleColour)
{
	minimizedTitle = std::make_shared<W_LABEL>();
	minimizedTitle->setFont(font_regular_bold, titleColour);
	WzString titleString = WzString("\u21F2  "); // ⇲
	if (!_minimizedTitle.empty())
	{
		titleString += WzString::fromUtf8(_minimizedTitle);
	}
	else
	{
		titleString += _("(untitled)");
	}
	minimizedLeftButtonWidth = WZ_FORM_MINIMIZED_LEFT_PADDING + iV_GetTextWidth("\u21F2", font_regular_bold) + WZ_FORM_MINIMIZED_MAXBUTTON_RIGHT_PADDING;
	minimizedTitle->setString(titleString);
	minimizedTitle->setGeometry(0, 0, minimizedTitle->getMaxLineWidth(), iV_GetTextLineSize(font_regular_bold));
	minimizable = true;
}

void W_FORM::disableMinimizing()
{
	minimizedTitle.reset();
	minimizable = false;
	if (formState == FormState::MINIMIZED)
	{
		setFormState(FormState::NORMAL);
	}
}

bool W_FORM::setFormState(FormState state)
{
	if (formState == state) { return true; }
	if (formState == FormState::MINIMIZED)
	{
		disableChildren = false;
	}
	switch(state)
	{
		case FormState::NORMAL:
			break;
		case FormState::MINIMIZED:
		{
			if (!minimizable)
			{
				return false;
			}
			auto minimizedSize = calcMinimizedSize();
			minimizedRect = WzRect(x(), y(), minimizedSize.x, minimizedSize.y);
			disableChildren = true;
			break;
		}
	}
	formState = state;
	return true;
}

bool W_FORM::toggleMinimized()
{
	FormState desiredState = FormState::MINIMIZED;
	if (formState == FormState::MINIMIZED)
	{
		desiredState = FormState::NORMAL;
	}
	return setFormState(desiredState);
}

Vector2i W_FORM::calcMinimizedSize() const
{
	Vector2i minimizedSize = {0,0};
	if (!minimizable) { return minimizedSize; }
	// width = width of the minimizedTitle (which includes the "re-open button" as a unicode character) + padding
	if (minimizedTitle != nullptr)
	{
		minimizedSize.x = minimizedTitle->getMaxLineWidth() + 15;
	}
	// height = height of the font's line height + padding
	minimizedSize.y = iV_GetTextLineSize(font_regular_bold) + 6;
	return minimizedSize;
}

const WzRect& W_FORM::minimizedGeometry() const
{
	return minimizedRect;
}

void W_CLICKFORM::setTip(std::string string)
{
	pTip = string;
}

void W_CLICKFORM::setHelp(optional<WidgetHelp> _help)
{
	help = _help;
}

bool W_CLICKFORM::isDown() const
{
	return (state & (WBUT_DOWN | WBUT_LOCK | WBUT_CLICKLOCK)) != 0;
}

bool W_CLICKFORM::isHighlighted() const
{
	return (state & WBUT_HIGHLIGHT) != 0;
}

void W_CLICKFORM::display(int xOffset, int yOffset)
{
	ASSERT(false, "No default implementation exists for click forms");
}

// MARK: - W_FULLSCREENOVERLAY_CLICKFORM

W_FULLSCREENOVERLAY_CLICKFORM::W_FULLSCREENOVERLAY_CLICKFORM(W_FORMINIT const *init) : W_CLICKFORM(init) {}
W_FULLSCREENOVERLAY_CLICKFORM::W_FULLSCREENOVERLAY_CLICKFORM() : W_CLICKFORM() {}

std::shared_ptr<W_FULLSCREENOVERLAY_CLICKFORM> W_FULLSCREENOVERLAY_CLICKFORM::make(UDWORD formID)
{
	W_FORMINIT sInit;
	sInit.id = formID;
	sInit.style = WFORM_PLAIN | WFORM_CLICKABLE;
	sInit.x = 0;
	sInit.y = 0;
	sInit.width = screenWidth - 1;
	sInit.height = screenHeight - 1;
	sInit.calcLayout = LAMBDA_CALCLAYOUT_SIMPLE({
		psWidget->setGeometry(0, 0, screenWidth, screenHeight);
	});

	class make_shared_enabler: public W_FULLSCREENOVERLAY_CLICKFORM
	{
	public:
		make_shared_enabler(W_FORMINIT const *init): W_FULLSCREENOVERLAY_CLICKFORM(init) {}
	};
	return std::make_shared<make_shared_enabler>(&sInit);
}

void W_FULLSCREENOVERLAY_CLICKFORM::clicked(W_CONTEXT *psContext, WIDGET_KEY key)
{
	if (onClickedFunc)
	{
		onClickedFunc();
	}
}

void W_FULLSCREENOVERLAY_CLICKFORM::display(int xOffset, int yOffset)
{
	if (!visible())
	{
		// skip if hidden
		return;
	}

	if (backgroundColor.isTransparent())
	{
		return;
	}

	int x0 = x() + xOffset;
	int y0 = y() + yOffset;

	auto strongCutoutWidget = cutoutWidget.lock();
	WzRect screenRect = screenGeometry();
	WzRect cutoutRect = (strongCutoutWidget) ? screenRect.intersectionWith(strongCutoutWidget->screenGeometry()) : WzRect();

	if (cutoutRect.width() <= 0 || cutoutRect.height() <= 0)
	{
		// simple path - draw background over everything
		pie_UniTransBoxFill(x0, y0, x0 + width(), y0 + height(), backgroundColor);
	}
	else
	{
		std::array<WzRect, 4> surroundingRects = {
			// left column until left edge of cutout rect
			WzRect({screenRect.left(), screenRect.top()}, {cutoutRect.left(), screenRect.bottom()}),
			// top band above cutout rect
			WzRect({cutoutRect.left(), screenRect.top()}, {cutoutRect.right(), cutoutRect.top()}),
			// right column after cutout rect
			WzRect({cutoutRect.right(), screenRect.top()}, {screenRect.right(), screenRect.bottom()}),
			// bottom band below cutout rect
			WzRect({cutoutRect.left(), cutoutRect.bottom()}, {cutoutRect.right(), screenRect.bottom()})
		};

		for (const auto& rect : surroundingRects)
		{
			if (rect.width() <= 0 || rect.height() <= 0)
			{
				continue;
			}
			pie_UniTransBoxFill(rect.left(), rect.top(), rect.right(), rect.bottom(), backgroundColor);
		}
	}
}

void W_FULLSCREENOVERLAY_CLICKFORM::run(W_CONTEXT *psContext)
{
	if (keyPressed(KEY_ESC))
	{
		if (onCancelPressed)
		{
			onCancelPressed();
		}
	}
	inputLoseFocus();	// clear the input buffer.
}

void displayChildDropShadows(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset)
{
	PIELIGHT dropShadowColor = pal_RGBA(0, 0, 0, 40);
	const int widerPadding = 4;
	const int closerPadding = 2;
	int childXOffset = psWidget->x() + xOffset;
	int childYOffset = psWidget->y() + yOffset;
	for (auto& child : psWidget->children())
	{
		if (!child->visible()) { continue; }
		int childX0 = child->x() + childXOffset;
		int childY0 = child->y() + childYOffset;
		int childDropshadowWiderX0 = std::max(childX0 - widerPadding, 0);
		int childDropshadowWiderX1 = std::min(childX0 + child->width() + widerPadding, pie_GetVideoBufferWidth());
		int childDropshadowWiderY1 = std::min(childY0 + child->height() + widerPadding, pie_GetVideoBufferHeight());
		int childDropshadowCloserX0 = std::max(childX0 - closerPadding, 0);
		int childDropshadowCloserX1 = std::min(childX0 + child->width() + closerPadding, pie_GetVideoBufferWidth());
		int childDropshadowCloserY1 = std::min(childY0 + child->height() + closerPadding, pie_GetVideoBufferHeight());
		pie_UniTransBoxFill(childDropshadowWiderX0, childY0, childDropshadowWiderX1, childDropshadowWiderY1, dropShadowColor);
		pie_UniTransBoxFill(childDropshadowCloserX0, childY0, childDropshadowCloserX1, childDropshadowCloserY1, dropShadowColor);
	}
}