资源简介

炫彩界面库源码(DirectUI,v1.5.1)

资源截图

代码片段和文件信息

/**************************************************************************\
*
* Copyright (c)  炫彩界面库. All Rights Reserved.
*
* 炫彩界面库 - 官方网站 : http://www.xcgui.com
*
\**************************************************************************/
#include “StdAfx.h“


HELE WINAPI XBtn_Create(int x int y int cx int cywchar_t *ptitleHXCGUI hParent)
{
button_ *pNew=(button_*)malloc(sizeof(button_));
if(pNew)
{
memset(pNew0sizeof(button_));

Btn_Init((HELE)pNewxycxcyXC_BUTTONptitlehParent);

return (HELE)pNew;
}
return NULL;
}

void Btn_Init(HELE hEleint xint yint cxint cyint eleTypewchar_t *ptitleHXCGUI hParent)
{
Ele_Init(hElexycxcyeleTypehParent);

AddTypeDebug(hEleXC_BUTTON);
BUTTON(hEle)->textFlag= DT_VCENTER | DT_SINGLELINE | DT_CENTER | DT_END_ELLIPSIS;
XEle_EnableFocus(hEleTRUE);
XBtn_SetText(hEleptitle);

XEle_RegisterMessage(hEleXM_PAINTBtn_OnDraw);

XEle_RegisterMessage(hEleXM_LBUTTONDOWNBtn_OnLButtonDown);
XEle_RegisterMessage(hEleXM_LBUTTONUPBtn_OnLButtonUp);
XEle_RegisterEvent(hEleXE_KEYDOWNBtn_OnEventKeyDown);

XEle_RegisterEvent(hEleXE_MOUSESTAYBtn_OnEventMouseStay);
XEle_RegisterEvent(hEleXE_MOUSELEAVEBtn_OnEventMouseLeave);
XEle_RegisterEvent(hEleXE_SETFOCUSBtn_OnEventSetFocus);
XEle_RegisterEvent(hEleXE_KILLFOCUSBtn_OnEventKillFocus);
XEle_RegisterEvent(hEleXE_DESTROYBtn_OnDestroy);
XEle_RegisterMessage(hEleXM_MOUSEMOVEBtn_onmousemove);
}

void CALLBACK Btn_OnDestroy(HELE hEle)  //销毁
{
button_ *pButton=BUTTON(hEle);
if(pButton->hString)
XStr_Destroy(pButton->hString);

if(pButton->hImage_leave) XImage_Destroy(pButton->hImage_leave);
if(pButton->hImage_stay) XImage_Destroy(pButton->hImage_stay);
if(pButton->hImage_down) XImage_Destroy(pButton->hImage_down);
if(pButton->hImage_check) XImage_Destroy(pButton->hImage_check);
if(pButton->hImage_disable) XImage_Destroy(pButton->hImage_disable);
if(pButton->hImage_icon) XImage_Destroy(pButton->hImage_icon);

if(pButton->pAnimation)
{
Animation_Remove(pButton->pAnimation);

int count=XArray_GetCount(pButton->pAnimation->hArrayItem);
for (int i=0;i {
button_animation_item_ *pItem=(button_animation_item_*)XArray_GetAt(pButton->pAnimation->hArrayItemi);
if(pItem->hImage) XImage_Destroy(pItem->hImage);
free(pItem);
}
XArray_Destroy(pButton->pAnimation->hArrayItem);
free(pButton->pAnimation);
pButton->pAnimation=NULL;
}
}

wchar_t * WINAPI XBtn_GetText(HELE hEle)
{
IsButtonDebug(hEle__FUNCTION__);
if(BUTTON(hEle)->hString)
return XStr_GetBuffer(BUTTON(hEle)->hString);
return NULL;
}

void WINAPI XBtn_SetText(HELE hElewchar_t *pText)
{
IsButtonDebug(hEle__FUNCTION__);
if(pText)
{
if(NULL==BUTTON(hEle)->hString)
BUTTON(hEle)->hString=XStr_Create();
XStr_SetString(BUTTON(hEle)->hStringpText);
}
}

int WINAPI XBtn_GetState(HELE hEle)
{
IsButtonDebug(hEle__FUNCTI

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        431  2012-03-22 14:37  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\360.xcproj

     文件      15930  2012-03-20 12:36  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\all_opened.png

     文件        114  2011-05-13 18:32  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\DlgBackground_simple.png

     文件     193448  2011-12-29 10:44  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\frame.jpg

     文件       4258  2011-04-25 12:11  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\ico_AdvTools.png

     文件       4636  2011-04-25 12:11  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\ico_dsmain.png

     文件       5259  2011-04-25 12:11  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\ico_Examine.png

     文件       3437  2011-04-25 12:11  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\ico_PluginCleaner.png

     文件       6545  2011-08-08 10:43  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\ico_softmgr.png

     文件       8569  2011-07-21 13:50  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\ico_SpeedupOpt.png

     文件       3613  2011-04-25 12:11  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\ico_SysRepair.png

     文件       3963  2011-04-25 12:11  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\ico_TraceCleaner.png

     文件       5456  2011-04-25 12:11  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\ico_VulRepair.png

     文件      19215  2011-12-29 14:45  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\logo.png

     文件       3233  2012-03-19 18:05  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\page1_bk.png

     文件      24400  2012-03-20 19:12  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\page2_btn1_down.png

     文件      24627  2012-03-20 17:46  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\page2_btn1_leave.png

     文件      28433  2012-03-20 19:15  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\page2_btn1_stay.png

     文件      21504  2012-03-20 12:15  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\Radar0.png

     文件       3357  2011-08-05 19:32  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\recommend\360desktop.png

     文件       2884  2011-09-21 14:19  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\recommend\360MobileMgr.png

     文件       3832  2011-08-09 14:11  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\recommend\360WDMain.png

     文件        845  2011-04-25 12:11  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\recommend\autorun.png

     文件        858  2011-04-25 12:11  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\recommend\hover_btn.png

     文件       5231  2011-05-27 13:05  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\recommend\netmon.png

     文件       3140  2011-08-05 19:38  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\recommend\procmgr.png

     文件       1481  2011-04-25 12:11  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\recommend\softmgr.png

     文件        605  2011-05-19 14:39  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\toolbar_hover.png

     文件       1136  2011-05-19 14:39  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\toolbar_pushed.png

     文件       2799  2012-03-19 10:53  炫彩界面库源码(DirectUIv1.5.1)\XCGUI\360\image\transparent.png

............此处省略381个文件信息

评论

共有 条评论