Пример #1
0
SpawnPointListMenu::SpawnPointListMenu(SpawnPointList* spawnPointList,
				       QWidget* parent, const char* name)
  : QPopupMenu(parent, name),
    m_spawnPointList(spawnPointList),
    m_currentItem(NULL)
{
  m_id_rename = insertItem("&Rename Spawn Point...",
			   this, SLOT(rename_item(int)));
  m_id_delete = insertItem("&Delete Spawn Point...",
			   this, SLOT(delete_item(int)));
  insertItem("&Clear Spawn Points...",
	     m_spawnPointList, SLOT(clearItems(void)));

  QPopupMenu* listColMenu = new QPopupMenu;
  insertItem("Show &Column", listColMenu);
  listColMenu->setCheckable(true);

  int x = tSpawnPointCoord1;
  m_id_cols[x] = listColMenu->insertItem("Coord &1");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("Coord &2");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("Coord &3");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Remaining");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Name");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Last");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Spawned");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Count");
  listColMenu->setItemParameter(m_id_cols[x], x);
  
  connect (listColMenu, SIGNAL(activated(int)), 
	   this, SLOT(toggle_col(int)));
  
  insertSeparator(-1);
  insertItem("&Font...", this, SLOT(set_font(int)));
  insertItem("&Caption...", this, SLOT(set_caption(int)));

  insertSeparator(-1);
  x = insertItem("Keep Sorted", this, SLOT(toggle_keepSorted(int)));
  setItemChecked(x, m_spawnPointList->keepSorted());

  connect(this, SIGNAL(aboutToShow()),
	  this, SLOT(init_menu()));
}
Пример #2
0
SpawnListMenu::SpawnListMenu(SEQListView* spawnlist,
                             SEQWindow* spawnlistWindow,
                             FilterMgr* filterMgr,
                             CategoryMgr* categoryMgr,
                             QWidget* parent, const char* name)
    : m_spawnlist(spawnlist),
      m_spawnlistWindow(spawnlistWindow),
      m_filterMgr(filterMgr),
      m_categoryMgr(categoryMgr)
{
    // Show Columns
    QPopupMenu* spawnListColMenu = new QPopupMenu;
    insertItem( "Show &Column", spawnListColMenu);
    spawnListColMenu->setCheckable(true);
    m_id_spawnList_Cols[tSpawnColName] =
        spawnListColMenu->insertItem("&Name");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColName],
                                       tSpawnColName);
    m_id_spawnList_Cols[tSpawnColLevel] = spawnListColMenu->insertItem("&Level");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColLevel],
                                       tSpawnColLevel);
    m_id_spawnList_Cols[tSpawnColHP] = spawnListColMenu->insertItem("&HP");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColHP],
                                       tSpawnColHP);
    m_id_spawnList_Cols[tSpawnColMaxHP] = spawnListColMenu->insertItem("&Max HP");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColMaxHP],
                                       tSpawnColMaxHP);
    m_id_spawnList_Cols[tSpawnColXPos] = spawnListColMenu->insertItem("Coord &1");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColXPos],
                                       tSpawnColXPos);
    m_id_spawnList_Cols[tSpawnColYPos] = spawnListColMenu->insertItem("Coord &2");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColYPos],
                                       tSpawnColYPos);
    m_id_spawnList_Cols[tSpawnColZPos] = spawnListColMenu->insertItem("Coord &3");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColZPos],
                                       tSpawnColZPos);
    m_id_spawnList_Cols[tSpawnColID] = spawnListColMenu->insertItem("I&D");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColID],
                                       tSpawnColID);
    m_id_spawnList_Cols[tSpawnColDist] = spawnListColMenu->insertItem("&Dist");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColDist],
                                       tSpawnColDist);
    m_id_spawnList_Cols[tSpawnColRace] = spawnListColMenu->insertItem("&Race");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColRace],
                                       tSpawnColRace);
    m_id_spawnList_Cols[tSpawnColClass] = spawnListColMenu->insertItem("&Class");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColClass],
                                       tSpawnColClass);
    m_id_spawnList_Cols[tSpawnColInfo] = spawnListColMenu->insertItem("&Info");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColInfo],
                                       tSpawnColInfo);
    m_id_spawnList_Cols[tSpawnColSpawnTime] = spawnListColMenu->insertItem("Spawn &Time");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColSpawnTime],
                                       tSpawnColSpawnTime);
    m_id_spawnList_Cols[tSpawnColDeity] = spawnListColMenu->insertItem("&Deity");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColDeity],
                                       tSpawnColDeity);
    m_id_spawnList_Cols[tSpawnColBodyType] = spawnListColMenu->insertItem("&Body Type");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColBodyType],
                                       tSpawnColBodyType);
    m_id_spawnList_Cols[tSpawnColGuildID] = spawnListColMenu->insertItem("Guild Tag");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColGuildID],
                                       tSpawnColGuildID);

    connect (spawnListColMenu, SIGNAL(activated(int)),
             this, SLOT(toggle_spawnListCol(int)));

    int x;
    QPopupMenu* filterMenu = new QPopupMenu;
    m_id_filterMenu = insertItem("Add &Filter", filterMenu);
    setItemEnabled(m_id_filterMenu, false);
    x = filterMenu->insertItem("&Hunt...");
    filterMenu->setItemParameter(x, HUNT_FILTER);
    x = filterMenu->insertItem("&Caution...");
    filterMenu->setItemParameter(x, CAUTION_FILTER);
    x = filterMenu->insertItem("&Danger...");
    filterMenu->setItemParameter(x, DANGER_FILTER);
    x = filterMenu->insertItem("&Locate...");
    filterMenu->setItemParameter(x, LOCATE_FILTER);
    x = filterMenu->insertItem("&Alert...");
    filterMenu->setItemParameter(x, ALERT_FILTER);
    x = filterMenu->insertItem("&Filtered...");
    filterMenu->setItemParameter(x, FILTERED_FILTER);
    x = filterMenu->insertItem("&Tracer...");
    filterMenu->setItemParameter(x, TRACER_FILTER);
    connect (filterMenu, SIGNAL(activated(int)),
             this, SLOT(add_filter(int)));

    QPopupMenu* zoneFilterMenu = new QPopupMenu;
    m_id_zoneFilterMenu = insertItem("Add &Zone Filter", zoneFilterMenu);
    setItemEnabled(m_id_zoneFilterMenu, false);
    x = zoneFilterMenu->insertItem("&Hunt...");
    zoneFilterMenu->setItemParameter(x, HUNT_FILTER);
    x = zoneFilterMenu->insertItem("&Caution...");
    zoneFilterMenu->setItemParameter(x, CAUTION_FILTER);
    x = zoneFilterMenu->insertItem("&Danger...");
    zoneFilterMenu->setItemParameter(x, DANGER_FILTER);
    x = zoneFilterMenu->insertItem("&Locate...");
    zoneFilterMenu->setItemParameter(x, LOCATE_FILTER);
    x = zoneFilterMenu->insertItem("&Alert...");
    zoneFilterMenu->setItemParameter(x, ALERT_FILTER);
    x = zoneFilterMenu->insertItem("&Filtered...");
    zoneFilterMenu->setItemParameter(x, FILTERED_FILTER);
    x = zoneFilterMenu->insertItem("&Tracer...");
    zoneFilterMenu->setItemParameter(x, TRACER_FILTER);
    connect (zoneFilterMenu, SIGNAL(activated(int)),
             this, SLOT(add_zoneFilter(int)));

    insertSeparator(-1);

    x = insertItem("&Add Category...", this, SLOT(add_category(int)));
    m_id_edit_category =
        insertItem("&Edit Category...", this, SLOT(edit_category(int)));
    m_id_delete_category =
        insertItem("&Delete Category...", this, SLOT(delete_category(int)));
    insertItem("&Reload Categories", this, SLOT(reload_categories(int)));
    insertSeparator(-1);
    insertItem("&Font...", this, SLOT(set_font(int)));
    insertItem("&Caption...", this, SLOT(set_caption(int)));

    connect(this, SIGNAL(aboutToShow()),
            this, SLOT(init_Menu()));
}
Пример #3
0
 Client(const string &name, QPopupMenu &m):Name(name) {
   ChildM = new QPopupMenu;
   m.setItemParameter(m.insertItem(Name, ChildM), 1);
 }
Пример #4
0
 void addPort(const char * name)
 {
   Port *P;
   Ports.push_back(P = new Port(name));
   ChildM->setItemParameter(ChildM->insertItem(P->name()), 0);
 }