当前位置: 首页>>代码示例>>C++>>正文


C++ AutoAlloc::Select方法代码示例

本文整理汇总了C++中AutoAlloc::Select方法的典型用法代码示例。如果您正苦于以下问题:C++ AutoAlloc::Select方法的具体用法?C++ AutoAlloc::Select怎么用?C++ AutoAlloc::Select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AutoAlloc的用法示例。


在下文中一共展示了AutoAlloc::Select方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetData

/*********************************************************************\
	Function name    : CCustomElementSettings::SetData
	Description      :
	Created at       : 11.08.01, @ 23:18:59
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CCustomElementSettings::SetData()
{
    _Init();

    CreateElementList();

    // fill the list view with the elements
    Int32 a = 0;
    while (m_wndListView.RemoveItem(a)) {
        a++;
    }


    if (!g_pCustomElements) return;
    Int32 lElementCount = g_pCustomElements->Entries();
    if (lElementCount == 0) return;

    CCustomElements* pFirst = g_pCustomElements->First();
    a = 0;

    while (pFirst)
    {
        BaseContainer data;
        data.SetString('name', pFirst->m_strName);
        data.SetString('resy', pFirst->m_pChResSym);
        data.SetString('ceid', String::IntToString(pFirst->m_lID));

        m_wndListView.SetItem(a, data);
        a++;
        pFirst = g_pCustomElements->Next(pFirst);
    }

    m_wndListView.DataChanged();

    AutoAlloc<BaseSelect> pSel;
    if (pSel)
    {
        pSel->Select(m_pElement->m_lElement);
        m_lLastID = -1;
        m_wndListView.SetSelection(pSel);
        m_wndListView.DataChanged();
    }

    // write the custom object properties
    if (g_pCustomElements && m_pElement->m_lElement >= 0 && m_pElement->m_lElement < g_pCustomElements->Entries())
    {
        CCustomElements* pElement = g_pCustomElements->GetItem(m_pElement->m_lElement);
        BasePlugin* pPlug = nullptr;
        if (pElement) pPlug = pElement->m_pPlug;
        if (pPlug)
        {
            CustomProperty *prop = CallCustomGuiCmd(pPlug, GetProperties)();
            m_wndSubDlg.Refresh(m_pSettingsDialog, prop, m_pElement);
        }
    }
}
开发者ID:nr-plugins,项目名称:resedit,代码行数:63,代码来源:DialogCustomElement.cpp

示例2: Command

Bool ListViewDialog::Command(LONG id,const BaseContainer &msg)
{
	switch (id)
	{
		case GADGET_LISTVIEW1:
		case GADGET_LISTVIEW2:
			{
				switch (msg.GetLong(BFM_ACTION_VALUE))
				{
					case LV_SIMPLE_SELECTIONCHANGED:
						GePrintF("Selection changed, id: %d, val: %p ",msg.GetLong(LV_SIMPLE_ITEM_ID),msg.GetVoid(LV_SIMPLE_DATA));
						break;

					case LV_SIMPLE_CHECKBOXCHANGED:
						GePrintF("CheckBox changed, id: %d, col: %d, val: %p",msg.GetLong(LV_SIMPLE_ITEM_ID),msg.GetLong(LV_SIMPLE_COL_ID),msg.GetVoid(LV_SIMPLE_DATA));
						break;

					case LV_SIMPLE_FOCUSITEM:
						GePrintF("Focus set id: %d, col: %d",msg.GetLong(LV_SIMPLE_ITEM_ID),msg.GetLong(LV_SIMPLE_COL_ID));
						break;

					case LV_SIMPLE_BUTTONCLICK:
						GePrintF("Button clicked id: %d, col: %d",msg.GetLong(LV_SIMPLE_ITEM_ID),msg.GetLong(LV_SIMPLE_COL_ID));
						break;
				}
			}
			UpdateButtons();
			break;

//		case GADGET_LISTVIEW2:
//			break;

		case GADGET_INSERT:
			{
				AutoAlloc<BaseSelect> s2;
				if (selection && s2)
				{
					// TEST
					LONG i,id,count = listview1.GetItemCount();
					BaseContainer test;

					for (i=0;i<count;i++)
					{
						listview1.GetItemLine(i,&id,&test);
					}
					// TEST

					if (!listview1.GetSelection(selection))
					{
						GePrint("No Selection");
					}
					else
					{
						LONG i,a,b;
						String str;
						for (i=0;selection->GetRange(i,MAXLONGl,&a,&b);i++)
						{
							if (a==b) str += LongToString(a)+" ";
							else str += LongToString(a)+"-"+LongToString(b)+" ";
						}
		//				str.Delete(str.GetLength()-1,1);
						GePrint("Selection: "+str);

						BaseContainer data;
						for (i=0;testdata[i].id;i++)
						{
							if (selection->IsSelected(testdata[i].id))
							{
								data.SetLong('chck',TRUE);
								data.SetString('name',testdata[i].name);
								data.SetString('bttn',"...");
								selection->Select(counter2);
								listview2.SetItem(counter2++,data);
							}
						}
						listview2.SetSelection(selection);
						listview2.DataChanged();
					}
				}
			}
			UpdateButtons();
			break;

		case GADGET_REMOVE:
			{
				if (selection && listview2.GetSelection(selection))
				{
					LONG i,a,b;
					for (i=0;selection->GetRange(i,MAXLONGl,&a,&b);i++)
					{
						for (;a<=b;a++)
						{
							listview2.RemoveItem(a);
						}
					}
					listview2.DataChanged();
				}
			}
			UpdateButtons();
			break;
//.........这里部分代码省略.........
开发者ID:vidarn,项目名称:color4d,代码行数:101,代码来源:listview.cpp


注:本文中的AutoAlloc::Select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。