1 | /********************************************************************** <BR>
|
---|
2 | This file is part of Crack dot Com's free source code release of
|
---|
3 | Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
|
---|
4 | information about compiling & licensing issues visit this URL</a>
|
---|
5 | <PRE> If that doesn't help, contact Jonathan Clark at
|
---|
6 | golgotha_source@usa.net (Subject should have "GOLG" in it)
|
---|
7 | ***********************************************************************/
|
---|
8 |
|
---|
9 | #ifndef I4_DECO_WIN_HH
|
---|
10 | #define I4_DECO_WIN_HH
|
---|
11 |
|
---|
12 | #include "window/style.hh"
|
---|
13 |
|
---|
14 | class i4_deco_window_class : public i4_parent_window_class
|
---|
15 | {
|
---|
16 | i4_bool in;
|
---|
17 | sw32 x1,y1;
|
---|
18 | i4_graphical_style_class *style;
|
---|
19 |
|
---|
20 | public:
|
---|
21 | i4_deco_window_class(w16 w, w16 h, // size not including deco border
|
---|
22 | i4_bool in, // pressed in or out look?
|
---|
23 | i4_graphical_style_class *style)
|
---|
24 | : i4_parent_window_class(0,0),
|
---|
25 | in(in),
|
---|
26 | style(style)
|
---|
27 | {
|
---|
28 | w32 l,r,t,b;
|
---|
29 | if (in)
|
---|
30 | style->get_in_deco_size(l,r,t,b);
|
---|
31 | else
|
---|
32 | style->get_out_deco_size(l,r,t,b);
|
---|
33 |
|
---|
34 | x1=l; y1=r;
|
---|
35 | resize(w+l+r, h+t+b);
|
---|
36 | }
|
---|
37 |
|
---|
38 | sw32 get_x1() { return x1; }
|
---|
39 | sw32 get_y1() { return y1; }
|
---|
40 |
|
---|
41 | virtual void parent_draw(i4_draw_context_class &context)
|
---|
42 | {
|
---|
43 | w32 l,r,t,b;
|
---|
44 | if (in)
|
---|
45 | {
|
---|
46 | style->get_in_deco_size(l,r,t,b);
|
---|
47 | style->draw_in_deco(local_image, 0,0, width()-1, height()-1, i4_F, context);
|
---|
48 | }
|
---|
49 | else
|
---|
50 | {
|
---|
51 | style->get_out_deco_size(l,r,t,b);
|
---|
52 | style->draw_in_deco(local_image, 0,0, width()-1, height()-1, i4_F, context);
|
---|
53 | }
|
---|
54 |
|
---|
55 |
|
---|
56 | style->deco_neutral_fill(local_image, l,t, width()-r, height()-b, context);
|
---|
57 | // local_image->bar(l,t, width()-r, height()-b,
|
---|
58 | // style->color_hint->window.passive.medium,
|
---|
59 | // context);
|
---|
60 | }
|
---|
61 |
|
---|
62 | char *name() { return "deco_window"; }
|
---|
63 | } ;
|
---|
64 |
|
---|
65 | #endif
|
---|