File: infopopup.cpp

package info (click to toggle)
asc 2.6.1.0-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 81,740 kB
  • sloc: cpp: 158,704; sh: 11,544; ansic: 6,736; makefile: 604; perl: 138
file content (62 lines) | stat: -rw-r--r-- 1,562 bytes parent folder | download | duplicates (4)
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
//
// C++ Implementation: infopopup
//
// Description: 
//
//
// Author: Kevin Hirschmann <hirsch@dhcppc0>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include <iostream>
#include "infopopup.h"
#include "sg.h"

InfoPopUp::InfoPopUp(PG_Widget* parent): PG_PopupMenu(parent, 20, 20 ) {
  addMenuItem("Unit Type", 1, slot(showUnitInfo));
  addMenuItem("Unit Weight", 2, slot(showUnitWeight));
  addMenuItem("Weapon Range", 3, slot(showWeaponRange));
  addMenuItem("Movement Range", 4, slot(showMovementRange));
  addMenuItem("", 5,MenuItem::MIF_SEPARATOR );
  addMenuItem("Terrain", 6, slot(showTerrainInfo));
  //ut = new PG_PopupMenu::MenuItem(this, "Unit Type",  1, MenuItem::MIF_NONE);
  //ut->sigSelectMenuItem.connect(sigc::mem_fun(*this, &InfoPopUp::showUnitInfo));
  //actmap->getField(mc)->vehicle;
  Hide();
}


InfoPopUp::~InfoPopUp()
{

}

bool showUnitInfo(PG_PopupMenu::MenuItem* item, PG_Pointer clientdata){
  
  execUserAction_ev(ua_vehicleinfo);
return true;
}

bool showUnitWeight(PG_PopupMenu::MenuItem* item, PG_Pointer clientdata){
  
  execUserAction_ev(ua_unitweightinfo);
return true;
}

bool showWeaponRange(PG_PopupMenu::MenuItem* item, PG_Pointer clientdata){
   execUserAction_ev(ua_viewunitweaponrange);
return true;
}
bool showMovementRange(PG_PopupMenu::MenuItem* item, PG_Pointer clientdata){
   execUserAction_ev(ua_viewunitmovementrange);
return true;

}

bool showTerrainInfo(PG_PopupMenu::MenuItem* item, PG_Pointer clientdata){
   execUserAction_ev(ua_viewterraininfo);
return true;
}