source: golgotha/src/golg/editor/dialogs/scroll_picker.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 14 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: 2.2 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 G1_SCROLL_PICKER_HH
10#define G1_SCROLL_PICKER_HH
11
12
13#include "window/window.hh"
14#include "window/colorwin.hh"
15#include "memory/array.hh"
16#include "r1_win.hh"
17
18class i4_graphical_style_class;
19class i4_scroll_bar;
20
21struct g1_scroll_picker_info
22{
23  int scroll_offset;
24  int object_size;
25  int max_object_size, min_object_size;
26  int max_objects_down;
27  int win_x, win_y;
28
29
30  g1_scroll_picker_info()
31  {
32    scroll_offset=0;
33    object_size=64;
34    max_object_size=128;
35    min_object_size=16;
36    max_objects_down=3;
37    win_x=win_y=-1;
38  }
39};
40
41class g1_scroll_picker_class : public i4_color_window_class
42{
43protected:
44  i4_array<i4_window_class *> windows;
45  i4_array<r1_render_window_class *> render_windows;
46
47  int start_y, show_area_w;
48  i4_scroll_bar *scroll_bar;
49  g1_scroll_picker_info *info;
50
51
52
53  // this should return 0 if scroll_object_num is too big
54  virtual i4_window_class *create_window(w16 w, w16 h, int scroll_object_num) = 0;
55  virtual void change_window_object_num(i4_window_class *win, int new_scroll_object_num) = 0;
56  virtual int total_objects() = 0;
57  virtual void rotate() { ; }
58  virtual void mirror() { ; }
59
60public:
61  enum { ROTATE, MIRROR, GROW, SHRINK, SCROLL };
62
63  void refresh();
64  void create_windows();
65  // option_flags can include (1<<ROTATE) | (1<<MIRROR) | (1<<GROW) | (1<<SHRINK) | (1<<SCROLL))
66  g1_scroll_picker_class(i4_graphical_style_class *style,
67                         w32 option_flags,
68                         g1_scroll_picker_info *info,
69                         int total_objects);
70
71  void receive_event(i4_event *ev);
72  void parent_draw(i4_draw_context_class &context);
73  void change_current_select();
74};
75
76
77#endif
Note: See TracBrowser for help on using the repository browser.