source: golgotha/src/i4/gui/seperate.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.8 KB
Line 
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_SEPERATOR_HH
10#define I4_SEPERATOR_HH
11
12#include "menu/menuitem.hh"
13
14class i4_seperator_line_class : public i4_menu_item_class
15{
16  w16 lr,ud;
17  i4_graphical_style_class *style;
18  i4_color bg;
19public:
20  i4_seperator_line_class(i4_graphical_style_class *style,
21                          i4_color background,
22                          w16 left_right_space,
23                          w16 up_down_space)
24    : i4_menu_item_class(0,0, 0,0),
25      style(style),
26      lr(left_right_space),
27      ud(up_down_space),
28      bg(background)
29  {
30    w32 l,r,t,b;
31    style->get_in_deco_size(l,t,r,b);
32    resize(lr*2, t+b+ud*2);
33  }
34 
35  void reparent(i4_image_class *draw_area, i4_parent_window_class *parent)
36  {
37    i4_menu_item_class::reparent(draw_area, parent);
38    if (parent && draw_area)
39    {
40      w32 l,r,t,b;
41      style->get_in_deco_size(l,t,r,b);
42      resize(parent->width()-lr*2, t+b+ud*2);
43    }
44
45  }
46
47  void draw(i4_draw_context_class &context)
48  {
49    style->deco_neutral_fill(local_image, 0,0, width()-1, height()-1, context);
50    style->draw_in_deco(local_image, 0, ud, width()-1, height()-1-ud,
51                        i4_F, context);
52  }
53
54  i4_menu_item_class *copy() { return new i4_seperator_line_class(style, bg, lr, ud); }
55
56  char *name() { return "seperator_line"; }
57};
58
59
60#endif
Note: See TracBrowser for help on using the repository browser.