File: tools.hpp

package info (click to toggle)
abuse 2.00-12
  • links: PTS
  • area: main
  • in suites: slink
  • size: 12,708 kB
  • ctags: 15,389
  • sloc: ansic: 115,852; cpp: 6,792; lisp: 2,066; sh: 1,734; makefile: 1,601; asm: 264
file content (45 lines) | stat: -rw-r--r-- 1,088 bytes parent folder | download | duplicates (7)
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
#ifndef __TOOLS_HPP_
#define __TOOLS_HPP_

#include "jwindow.hpp"
#include "input.hpp"
#include "specs.hpp"
#include "scroller.hpp"
#include "visobj.hpp"

class tool_picker : public spicker
{
  filter *map;
  visual_object **icons; 
  int *ids;
  int total_icons;
  int iw,ih;
  palette *old_pal;

  public :

  // you are expected keep image and id list in memory, tool_picker does not copy them
  tool_picker(int X, int Y, int ID, 
	      int show_h, visual_object **Icons, int *Ids, int total_ic, 
	      palette *icon_palette, palette *pal, window_manager *wm, ifield *Next);

  virtual void draw_item(window_manager *wm, image *screen, int x, int y, int num, int active);
  virtual int total() { return total_icons; }
  virtual int item_width(window_manager *wm) { return iw; } 
  virtual int item_height(window_manager *wm) { return ih; }
  virtual void note_new_current(window_manager *wm, image *screen, input_manager *inm, int x) 
  { wm->push_event(new event(ids[x],NULL)); }

  void remap(palette *pal, window_manager *wm, image *screen);
  ~tool_picker();
} ;


#endif