Ejemplo n.º 1
0
void MpButton::AddIcon (const char *pxmap[], int align, bool bitmask)
{
  // remove possible previous icon
  DeleteIcon();

  // allocate pixmap
  int status = XpmCreatePixmapFromData(Mp.theDisplay, Win(), 
				       (char**) pxmap,
				       &pixmap, 
				       (bitmask) ? &mask : NULL, 
				       NULL); 
  if (status)      
    Mp.Warn("MpButton::AddIcon(XPM): Can't allocate icon pixmap");
  else {

    // parse size
    long w, h;
    char *endptr,*dummy;
    w = strtol(pxmap[0],&endptr,10);
    h = strtol(endptr,&dummy,10);

    // remember size
    icon_width  = short(w);
    icon_height = short(h);
    // remember alignment
    if (align & AlignLeft) 
      state |= icon_align_left;
    else if (align & AlignRight)
      state |= icon_align_right;
  }
}
Ejemplo n.º 2
0
BOOL CWearedExDialog::DeleteItem(WORD relPos, cIcon ** outIcon)
{
    CHero* pHero = OBJECTMGR->GetHero();
    //KES 031128 ¹«°ø¾ÆÀÌÅÛ ÀåÂø°¡´É ÅøÆÁ º¯°æ
    if( ! DeleteIcon(relPos, outIcon) )
    {
        return FALSE;
    }

    pHero->SetWearedItemIdx(relPos, 0);
    pHero->SetCurComboNum(SKILL_COMBO_NUM);

    APPEARANCEMGR->AddCharacterPartChange(pHero->GetID(), eCHAPPEAR_INIT);

    CItem* item	= ( CItem* )( *outIcon );

    if( ! item )
    {
        return FALSE;
    }

    CHARCALCMGR->RemoveItem( pHero, item->GetItemBaseInfo() );
    //CHARCALCMGR->Initialize( pHero );
    GAMEIN->GetCharacterDialog()->RefreshInfo();
    RefreshSetItem(
        item->GetItemBaseInfo());

    item->SetImageRGB(
        ICONCLR_USABLE);
    item->SetDeffenceTooltip(
        FALSE);

    HERO->DoGetDefenseRate();

    RefreshArmorItem();
    //----------------------------------

    return TRUE;
}
Ejemplo n.º 3
0
void MpButton::AddIcon (const char *btmp, int w, int h, int align, bool bitmask)
{
  // remove possible previous icon
  DeleteIcon();

  // link bitmap
  bitmap = btmp;
  icon_width  = w;
  icon_height = h;

  pixmap = XCreatePixmapFromBitmapData(Mp.theDisplay, Win(), 
                                       (char*) btmp, w, h, 
                                       Mp.TextColor.Pixel(),   // foreground 
                                       Mp.CanvasColor.Pixel(), // background
                                       Mp.theDepth);

  if (bitmask) {
    mask = XCreatePixmapFromBitmapData(Mp.theDisplay, Win(), 
                                       (char*) btmp, w, h, 
                                       Mp.WhiteColor.Pixel(),  // foreground 
                                       Mp.BlackColor.Pixel(),  // background
                                       1);
    if (!mask) Mp.Warn("MpButton::AddIcon(XBM): Can't allocate icon bitmap mask");
  }

  if (pixmap) {
    // remember size
    icon_width  = w;
    icon_height = h;
    // remember alignment
    if (align == MpBase::AlignLeft) 
      state |= icon_align_left;
    else if (align == MpBase::AlignRight)
      state |= icon_align_right;
  } else
    Mp.Warn("MpButton::AddIcon(XBM): Can't allocate icon pixmap");
}
Ejemplo n.º 4
0
//*****************************************************************************************
CBCGPUserTool::~CBCGPUserTool()
{
	DeleteIcon ();
}
Ejemplo n.º 5
0
	CULTrayIcon::~CULTrayIcon(void)
	{
		for(UINT i=1;i<=m_nIconCount;++i)
			DeleteIcon(i);
		delete m_pNotifyIconData;
	}