Example #1
0
void SymbolMap::FillSymbolListBox(HWND listbox,SymbolType symmask)
{
    ShowWindow(listbox,SW_HIDE);
    ListBox_ResetContent(listbox);

    //int style = GetWindowLong(listbox,GWL_STYLE);

    ListBox_AddString(listbox,"(0x80000000)");
    ListBox_SetItemData(listbox,0,0x80000000);

    //ListBox_AddString(listbox,"(0x80002000)");
    //ListBox_SetItemData(listbox,1,0x80002000);

    for (size_t i = 0; i < entries.size(); i++)
    {
        if (entries[i].type & symmask)
        {
            char temp[256];
            sprintf(temp,"%s (%d)",entries[i].name,entries[i].size);
            int index = ListBox_AddString(listbox,temp);
            ListBox_SetItemData(listbox,index,entries[i].vaddress);
        }
    }

    ShowWindow(listbox,SW_SHOW);
}
Example #2
0
void SymbolMap::FillSymbolListBox(HWND listbox,SymbolType symmask)
{
    ShowWindow(listbox,SW_HIDE);
    ListBox_ResetContent(listbox);

    //int style = GetWindowLong(listbox,GWL_STYLE);

    ListBox_AddString(listbox,"(0x80000000)");
    ListBox_SetItemData(listbox,0,0x80000000);

    //ListBox_AddString(listbox,"(0x80002000)");
    //ListBox_SetItemData(listbox,1,0x80002000);

    SendMessage(listbox, WM_SETREDRAW, FALSE, 0);
    SendMessage(listbox, LB_INITSTORAGE, (WPARAM)entries.size(), (LPARAM)entries.size() * 30);
    for (size_t i = 0; i < entries.size(); i++)
    {
        if (entries[i].type & symmask)
        {
            char temp[256];
            sprintf(temp,"%s (%d)",entries[i].name,entries[i].size);
            int index = ListBox_AddString(listbox,temp);
            ListBox_SetItemData(listbox,index,entries[i].vaddress);
        }
    }
    SendMessage(listbox, WM_SETREDRAW, TRUE, 0);
    RedrawWindow(listbox, NULL, NULL, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);

    ShowWindow(listbox,SW_SHOW);
}
Example #3
0
void SymbolMap::FillSymbolListBox(HWND listbox,SymbolType symType) {
	if (activeNeedUpdate_)
		UpdateActiveSymbols();

	wchar_t temp[256];
	std::lock_guard<std::recursive_mutex> guard(lock_);

	SendMessage(listbox, WM_SETREDRAW, FALSE, 0);
	ListBox_ResetContent(listbox);

	switch (symType) {
	case ST_FUNCTION:
		{
			SendMessage(listbox, LB_INITSTORAGE, (WPARAM)activeFunctions.size(), (LPARAM)activeFunctions.size() * 30);

			for (auto it = activeFunctions.begin(), end = activeFunctions.end(); it != end; ++it) {
				const FunctionEntry& entry = it->second;
				const char* name = GetLabelName(it->first);
				if (name != NULL)
					wsprintf(temp, L"%S", name);
				else
					wsprintf(temp, L"0x%08X", it->first);
				int index = ListBox_AddString(listbox,temp);
				ListBox_SetItemData(listbox,index,it->first);
			}
		}
		break;

	case ST_DATA:
		{
			int count = ARRAYSIZE(defaultSymbols)+(int)activeData.size();
			SendMessage(listbox, LB_INITSTORAGE, (WPARAM)count, (LPARAM)count * 30);

			for (int i = 0; i < ARRAYSIZE(defaultSymbols); i++) {
				wsprintf(temp, L"0x%08X (%S)", defaultSymbols[i].address, defaultSymbols[i].name);
				int index = ListBox_AddString(listbox,temp);
				ListBox_SetItemData(listbox,index,defaultSymbols[i].address);
			}

			for (auto it = activeData.begin(), end = activeData.end(); it != end; ++it) {
				const DataEntry& entry = it->second;
				const char* name = GetLabelName(it->first);

				if (name != NULL)
					wsprintf(temp, L"%S", name);
				else
					wsprintf(temp, L"0x%08X", it->first);

				int index = ListBox_AddString(listbox,temp);
				ListBox_SetItemData(listbox,index,it->first);
			}
		}
		break;
	}

	SendMessage(listbox, WM_SETREDRAW, TRUE, 0);
	RedrawWindow(listbox, NULL, NULL, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
}
Example #4
0
void
wxListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
{
    wxCHECK_RET( IsValidInsert(pos),
                 wxT("invalid index in wxListBox::InsertItems") );

    unsigned int nItems = items.GetCount();
    for ( unsigned int i = 0; i < nItems; i++ )
    {
        int idx = ListBox_InsertString(GetHwnd(), i + pos, items[i]);

#if wxUSE_OWNER_DRAWN
        if ( m_windowStyle & wxLB_OWNERDRAW )
        {
            wxOwnerDrawn *pNewItem = CreateLboxItem(idx);
            pNewItem->SetName(items[i]);
            pNewItem->SetFont(GetFont());
            m_aItems.Insert(pNewItem, idx);

            ListBox_SetItemData(GetHwnd(), idx, pNewItem);
        }
#else
        wxUnusedVar(idx);
#endif // wxUSE_OWNER_DRAWN
    }

    m_noItems += nItems;

    SetHorizontalExtent();
}
Example #5
0
/*
 * StatsListChangeStat:  Redisplay current statistic, whose value has changed.
 *   Requires that s is a list type stat in the current group.
 */
void StatsListChangeStat(Statistic *s)
{
   int index, top;

   if (s->num < 0 || s->num > ListBox_GetCount(hList))
   {
      debug(("StatListChangeList got illegal stat #%d\n", (int) s->num));
      return;
   }

   top = ListBox_GetTopIndex(hList);

   index = StatListFindItem(s->num);   
   if (index == -1)
   {
      debug(("StatListChangeList got illegal stat #%d\n", (int) s->num));
      return;
   }

   WindowBeginUpdate(hList);
   ListBox_DeleteString(hList, index);

   index = ListBox_AddString(hList, LookupNameRsc(s->name_res));
   ListBox_SetItemData(hList, index, s);

   ListBox_SetTopIndex(hList, top);
   WindowEndUpdate(hList);
}
Example #6
0
/*
 * SetItemAttr()
 */
void TxLbx_SetItemAttr(HWND listBox, int lbxItem, TXLBX_ATTR attr)
{
    DWORD data = ListBox_GetItemData(listBox, lbxItem) & 0x00FFFFFF;

    data |= attr;
    ListBox_SetItemData(listBox, lbxItem, data);
}
Example #7
0
int ListBox_MoveString(HWND hwndListBox, int iIndex, int iNewIndex, BOOL bRelativeToOld)
{
    int iCount = ListBox_GetCount(hwndListBox);
    int nExactNewIndex;

    if (iIndex == 0 && iNewIndex < 0)
        iNewIndex = 0;

    nExactNewIndex = bRelativeToOld ? (iIndex + iNewIndex) : iNewIndex;

    if ((bRelativeToOld && (iIndex + iNewIndex) >= iCount) ||
        (iNewIndex >= iCount))
    {
        return (LB_ERR);
    }
    else
    {
        LPTSTR pszBuffer = (LPTSTR)Mem_AllocStr(ListBox_GetTextLen(hwndListBox, iIndex) + SZ);
        LPVOID lpVoid = (LPVOID)ListBox_GetItemData(hwndListBox, iIndex);

        ListBox_GetText(hwndListBox, iIndex, pszBuffer);
        ListBox_DeleteString(hwndListBox, iIndex);
        ListBox_InsertString(hwndListBox, nExactNewIndex, pszBuffer);
        ListBox_SetItemData(hwndListBox, nExactNewIndex, lpVoid);
    
        Mem_Free(pszBuffer);
    }

    return (nExactNewIndex);
}
Example #8
0
/////////////////////////////////////////////////////////////////////////
//Function:    AddItem
//Description: Add a item to Selected object list
/////////////////////////////////////////////////////////////////////////
void AddItem (HWND hDlg)
	{
	 int  		  nObjects ;
	 char   *lpszString ;
	 int       *SelectedIndexes ;
	 DWORD 	  	objectIndex ;
	 OBJECTID 	theObj ;
	 int		i ;

	 //nObjects = (int) SendDlgItemMessage (hDlg, IDD_OBJECTSLIST, LB_GETSELCOUNT, 0, 0L) ;
	 nObjects = ListBox_GetSelCount (GetDlgItem(hDlg, IDD_OBJECTSLIST)) ;
	 if (nObjects == 0) return ;

	 SelectedIndexes = new int[nObjects] ;
	 //SendDlgItemMessage (hDlg, IDD_OBJECTSLIST, LB_GETSELITEMS, (WPARAM)nObjects, (long)SelectedIndexes) ;
	 ListBox_GetSelItems (GetDlgItem (hDlg, IDD_OBJECTSLIST), nObjects, SelectedIndexes) ;
	 lpszString = new char[256] ;
	 for (i = 0; i < nObjects; i++)
		{
		 //SendDlgItemMessage (hDlg, IDD_OBJECTSLIST, LB_GETTEXT, SelectedIndexes[i], (long) lpszString) ;
		 //theObj =(OBJECTID)SendDlgItemMessage (hDlg, IDD_OBJECTSLIST, LB_GETITEMDATA, SelectedIndexes[i], 0) ;
		 //objectIndex = (DWORD)SendDlgItemMessage(hDlg, IDD_FIELDSLIST, LB_INSERTSTRING, -1, (long)lpszString) ;
		 //SendDlgItemMessage(hDlg, IDD_FIELDSLIST, LB_SETITEMDATA, (WPARAM)objectIndex, (long)theObj) ;
		 ListBox_GetText (GetDlgItem (hDlg, IDD_FIELDSLIST),SelectedIndexes[i], lpszString) ;
		 theObj = (OBJECTID)ListBox_GetItemData (GetDlgItem (hDlg, IDD_FIELDSLIST),SelectedIndexes[i]) ;
		 objectIndex = ListBox_InsertString (GetDlgItem (hDlg, IDD_FIELDSLIST), -1, lpszString) ;
		 ListBox_SetItemData (GetDlgItem(hDlg, IDD_FIELDSLIST), objectIndex, theObj) ;
		}
	 delete(SelectedIndexes) ;
	 delete(lpszString) ;
	 return ;
	}
Example #9
0
void CSetDlgNetwork::OnBnClickedButtonAddTcp()
{
	// TODO: ここにコントロール通知ハンドラー コードを追加します。
	DWORD ip = 0;
	SendDlgItemMessage(m_hWnd, IDC_IPADDRESS_TCP, IPM_GETADDRESS, 0, (LPARAM)&ip);
	UINT tcpPort = GetDlgItemInt(m_hWnd, IDC_EDIT_PORT_TCP, NULL, FALSE);

	NW_SEND_INFO item;
	item.ip = ip;
	item.port = tcpPort;
	Format(item.ipString, L"%d.%d.%d.%d",
		(item.ip&0xFF000000)>>24,
		(item.ip&0x00FF0000)>>16,
		(item.ip&0x0000FF00)>>8,
		(item.ip&0x000000FF) );

	wstring add = L"";
	Format(add, L"%s:%d",item.ipString.c_str(), item.port);
	item.broadcastFlag = FALSE;

	HWND hItem = GetDlgItem(IDC_LIST_IP_TCP);
	for( int i=0; i<ListBox_GetCount(hItem); i++ ){
		WCHAR buff[256]=L"";
		int len = ListBox_GetTextLen(hItem, i);
		if( 0 <= len && len < 256 ){
			ListBox_GetText(hItem, i, buff);
			if(lstrcmpi(buff, add.c_str()) == 0 ){
				return ;
			}
		}
	}
	int index = ListBox_AddString(hItem, add.c_str());
	ListBox_SetItemData(hItem, index, (int)tcpSendList.size());
	tcpSendList.push_back(item);
}
Example #10
0
  static char raise_killed_monster(HWND hDlg)
  {
    HWND listdlg = PrepareListWindow(hDlg);
    HWND list = GetDlgItem(listdlg,IDC_LIST);
    char buff[256];
    int i;
    int res;

    for (i = 0;i<MAX_MOBS;i++) if (~mobs[i].vlajky & MOB_LIVE && mobs[i].cislo_vzoru != 0) 
    {
      int p;
      _snprintf(buff,sizeof(buff),"%4d. %s (sector: %d home %d)",i,mobs[i].name,mobs[i].sector,mobs[i].home_pos);
      kamenik2windows(buff,strlen(buff),buff);
      p = ListBox_AddString(list,buff);
      ListBox_SetItemData(list,p,i);
    }
    res = PumpDialogMessages(listdlg);
    while (res == IDOK)
    {
      int cnt;
      for (i = 0,cnt = ListBox_GetCount(list);i<cnt;i++) if (ListBox_GetSel(list,i))
      {
        int idx = ListBox_GetItemData(list,i);
        mobs[idx].vlajky |= MOB_LIVE;
        mobs[idx].lives = mobs[idx].vlastnosti[VLS_MAXHIT];
        wzprintf("%s znovu povstal(a)\r\n",mobs[idx].name);
        SEND_LOG("(WIZARD) '%s' has been raised",mobs[idx].name,0);
      }
      res = PumpDialogMessages(listdlg);
    }
    CloseListWindow(listdlg);
    return 1;
  }
Example #11
0
void wxListBox::DoSetItemClientData(unsigned int n, void *clientData)
{
    if ( ListBox_SetItemData(GetHwnd(), n, clientData) == LB_ERR )
    {
        wxLogDebug(wxT("LB_SETITEMDATA failed"));
    }
}
Example #12
0
/*
 * ReplaceItem() - 
 */
void TxLbx_ReplaceItem(HWND listBox, int idx, const _TUCHAR *text, DWORD itemData
        , TXLBX_ATTR attr)
{
    ListBox_DeleteString(listBox, idx);
    ListBox_InsertString(listBox, idx, text);
    ListBox_SetItemData(listBox, idx, attr | (itemData & 0x00FFFFFF));
}
void CCreateBoundingWindow::OnClickCreateButton()
{
	int selectedIndex = ComboBox_GetCurSel(mBoundingCategoryComboBox);
	if (selectedIndex == -1)
		return;

	TCHAR boundingName[128];
	SendMessage(mBoundingCategoryComboBox, CB_GETLBTEXT, selectedIndex, (LPARAM)boundingName);

	CEditorScene* scene = CEditorScene::getInstance();
	

	int boundingCategory = selectedIndex;
	if (selectedIndex == BOX_BOUNDING)
	{
		scene->AddBoxBounding();
	}
	else if (selectedIndex == CYLINDER_BOUNDING)
	{
		scene->AddCylinderBounding();
	}


	int index = ListBox_AddString(mBoundingsList, boundingName);
	ListBox_SetItemData(mBoundingsList, index, boundingCategory);
}
Example #14
0
void CSetDlgNetwork::OnBnClickedButtonDelUdp()
{
	// TODO: ここにコントロール通知ハンドラー コードを追加します。
	HWND hItem = GetDlgItem(IDC_LIST_IP_UDP);
	int sel = ListBox_GetCurSel(hItem);
	if( sel != LB_ERR ){
		int index = (int)ListBox_GetItemData(hItem, sel);

		vector<NW_SEND_INFO>::iterator itr;
		itr = udpSendList.begin();
		advance(itr, index);
		udpSendList.erase(itr);

		ListBox_ResetContent(hItem);

		for( int i=0; i<(int)udpSendList.size(); i++ ){
			wstring add = L"";
			Format(add, L"%s:%d",udpSendList[i].ipString.c_str(), udpSendList[i].port);
			if( udpSendList[i].broadcastFlag == TRUE ){
				add+= L" ブロードキャスト";
			}
			index = ListBox_AddString(hItem, add.c_str());
			ListBox_SetItemData(hItem, index, i);
		}
	}
}
Example #15
0
void plAgeDescInterface::INewPage()
{
    ST::string name = ST_LITERAL("New Page Name");

    // Get the name of the new age from the user
    int ret = DialogBoxParam(hInstance,
                            MAKEINTRESOURCE(IDD_AGE_NAME),
                            GetCOREInterface()->GetMAXHWnd(),
                            NewAgeDlgProc,
                            (LPARAM)&name);
    if (ret != 1)
        return;

    HWND hPages = GetDlgItem(fhDlg, IDC_PAGE_LIST);

    // Make sure this page doesn't already exist
    int count = ListBox_GetCount(hPages);
    for (int i = 0; i < count; i++)
    {
        char pageName[256];
        ListBox_GetText(hPages, i, pageName);
        if (!name.compare_i(pageName))
            return;
    }

    // Add the new page and select it
    int idx = ListBox_AddString(hPages, name.c_str());

    // Choose a new sequence suffix for it
    plAgePage *newPage = new plAgePage( name, IGetFreePageSeqSuffix( hPages ), 0 );
    ListBox_SetItemData( hPages, idx, (LPARAM)newPage );
   
    fDirty = true;
}
void CCreateLightNodeWindow::Init()
{
	EditorScene* scene = EditorScene::getInstance();
	std::vector<SLightNodeInfo> nodeInfos;

	for (auto it = scene->mLightNodeInfos.begin(); it != scene->mLightNodeInfos.end(); it++)
	{
		nodeInfos.push_back(it->second);
	}

	std::sort(nodeInfos.begin(), nodeInfos.end(), [](SLightNodeInfo& a, SLightNodeInfo& b){
		return a.Id < b.Id;
	});

	char text[256];
	for (u32 i = 0; i < nodeInfos.size(); i++)
	{
		sprintf_s(text, "%s(%d)", nodeInfos[i].Name.c_str(), nodeInfos[i].Id);
		int itemIndex = SendMessageA(mLightNodesList, LB_ADDSTRING, 0, (LPARAM)(text));
		if (itemIndex != LB_ERR)
		{
			ListBox_SetItemData(mLightNodesList, itemIndex, nodeInfos[i].Id);
		}
	}
}
Example #17
0
void wxListBox::DoSetItemClientData(unsigned int n, void *clientData)
{
    wxCHECK_RET( IsValid(n),
                 wxT("invalid index in wxListBox::SetClientData") );

    if ( ListBox_SetItemData(GetHwnd(), n, clientData) == LB_ERR )
        wxLogDebug(wxT("LB_SETITEMDATA failed"));
}
Example #18
0
/*
 * InsertItem() - Inserts an item into the list box at a specific index.
 */
int TxLbx_InsertItem(HWND listBox, int idx, const _TUCHAR *text, DWORD itemData
        , TXLBX_ATTR attr)
{
    idx = ListBox_InsertString(listBox, idx, text);
    ListBox_SetItemData(listBox, idx, attr | (itemData & 0x00FFFFFF));

    return idx;
}
Example #19
0
static void DispInfoExt(HWND hDlg,CShellExt *lpcs)
{
	//クリア
	long items = ListBox_GetCount(GetDlgItem(hDlg,IDC_LIST_VALUE));
	if(items != LB_ERR)
	{
		for(int i=0; i<items; i++)
		{
			COggExt *oggExt = (COggExt *)ListBox_GetItemData(GetDlgItem(hDlg,IDC_LIST_VALUE),0);
			if(oggExt)
			{
				delete oggExt;
			}
			ListBox_DeleteString(GetDlgItem(hDlg,IDC_LIST_VALUE),0);
		}
	}

	CString strDisp;
	CStringArray strArray;
	lpcs->m_Ogg.GetCommentNames(strArray);
	items = 0;
	for(int i=0; i<strArray.GetSize(); i++)
	{
		CString strName = strArray.GetAt(i);
		CString strValue;
		CString _strValue;
		int j = 0;
		while(1)
		{
			if(!lpcs->m_Ogg.GetComment(strName,j++,strValue))
			{
				break;
			}

			//標準名は除外
			if((j == 1) &&
				(
				!strName.Compare(_T("TITLE")) ||
				!strName.Compare(_T("TRACKNUMBER")) ||
				!strName.Compare(_T("ARTIST")) ||
				!strName.Compare(_T("ALBUM")) ||
				!strName.Compare(_T("ALBUMARTIST")) ||
				!strName.Compare(_T("DISCNUMBER")) ||
				!strName.Compare(_T("DATE")) ||
				!strName.Compare(_T("GENRE")) ||
				!strName.Compare(_T("COMMENT")))
				)
			{
				continue;
			}
//			TRACE(_T("OGG %s %s\n"),strName,strValue);
			COggExt *oggExt = new COggExt(strName,strValue);
			ListBox_AddString(GetDlgItem(hDlg,IDC_LIST_VALUE),oggExt->Get1LineDisp());
			ListBox_SetItemData(GetDlgItem(hDlg,IDC_LIST_VALUE),items,oggExt);
			items++;
		}
	}
}
Example #20
0
void CInstanceInfoWindow::AddListBoxItem(u32 id)
{
	TCHAR text[256];

	_stprintf_s(text, TEXT("ID%d"), id);
	int itemIndex = ListBox_AddString(mInstancesListBox, text);
	ListBox_SetItemData(mInstancesListBox, itemIndex, id);

	SetFocus(mParentHwnd);
}
Example #21
0
/*
 * AddItem()
 */
int TxLbx_AddItem(HWND listBox, const _TUCHAR *text, DWORD itemData
        , TXLBX_ATTR attr)
{
    int lbxItem;

    lbxItem = ListBox_AddString(listBox, text);
    ListBox_SetItemData(listBox, lbxItem, attr | (itemData & 0x00FFFFFF));

    return lbxItem;
}
Example #22
0
/*
 * LookInitDialog:  Handle WM_INITDIALOG messages.
 */ 
BOOL LookInitDialog(HWND hDlg, HWND hwndFocus, LPARAM lParam) 
{
   DWORD style;
   int numItems, index;

   info = (LookDialogStruct *) lParam;

   CenterWindow(hDlg, GetParent(hDlg));
   info->hwndListBox = GetDlgItem(hDlg, IDC_ITEMLIST);
   info->hwndFind = GetDlgItem(hDlg, IDC_ITEMFIND);
   info->hwndQuanList = GetDlgItem(hDlg, IDC_QUANLIST);

   // Make list sorted if desired
   if (info->flags & LD_SORT)
   {
      style = GetWindowLong(info->hwndListBox, GWL_STYLE);
      SetWindowLong(info->hwndListBox, GWL_STYLE, style | LBS_SORT);
   }

   if (!(info->flags & LD_AMOUNTS))
   {
      ShowWindow(GetDlgItem(hDlg, IDC_STATIC1), SW_HIDE);
      ShowWindow(GetDlgItem(hDlg, IDC_QUANLIST), SW_HIDE);
   }
   
   // Draw objects in owner-drawn list box
   SetWindowLong(info->hwndListBox, GWL_USERDATA, OD_DRAWOBJ);
   
   SetWindowText(hDlg, info->title);  /* Set window's title */

   // Remember state of list box items
   info->selected = (Bool *) SafeMalloc(list_length(info->contents) * sizeof(Bool));
   memset(info->selected, 0, list_length(info->contents) * sizeof(Bool));
   
   LookListSetContents(info->hwndListBox, info->contents, info->flags);

   numItems = ListBox_GetCount(info->hwndListBox);
   for(index=0; index < numItems; index++)
   {
      ListBox_AddString(info->hwndQuanList," ");
      ListBox_SetItemData(info->hwndQuanList, index, 0);
   }
      
   Edit_LimitText(info->hwndFind, MAXNAME);
   SetWindowFont(info->hwndFind, GetFont(FONT_EDIT), TRUE);
   
   hwndLookDialog = hDlg;

   /* Subclass main list box */
   info->lpfnDefLookProc = SubclassWindow(info->hwndListBox, LookProc);

   return TRUE;
}
Example #23
0
void SymbolMap::FillSymbolListBox(HWND listbox,SymbolType symmask)
{
	ShowWindow(listbox,SW_HIDE);
	ListBox_ResetContent(listbox);

	if (symmask & ST_DATA)
	{
		for (int i = 0; i < defaultSymbolsAmount; i++)
		{
			char temp[256];
			sprintf(temp,"0x%08X (%s)",defaultSymbolsAddresses[i],defaultSymbolsNames[i]);
			int index = ListBox_AddString(listbox,temp);
			ListBox_SetItemData(listbox,index,defaultSymbolsAddresses[i]);
		}
	}

	SendMessage(listbox, WM_SETREDRAW, FALSE, 0);
	SendMessage(listbox, LB_INITSTORAGE, (WPARAM)entries.size(), (LPARAM)entries.size() * 30);
	for (size_t i = 0; i < entries.size(); i++)
	{
		if (entries[i].type & symmask)
		{
			char temp[256];
			if (entries[i].type & ST_FUNCTION || !(entries[i].type & ST_DATA))
			{
				sprintf(temp,"%s",entries[i].name);
			} else {
				sprintf(temp,"0x%08X (%s)",entries[i].vaddress,entries[i].name);
			}

			int index = ListBox_AddString(listbox,temp);
			ListBox_SetItemData(listbox,index,entries[i].vaddress);
		}
	}
	SendMessage(listbox, WM_SETREDRAW, TRUE, 0);
	RedrawWindow(listbox, NULL, NULL, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);

	ShowWindow(listbox,SW_SHOW);
}
void CCreateLightNodeWindow::AddListItem(u32 id)
{
	TCHAR text[256];
	GetWindowText(mNameTextField, text, 256);
	TCHAR szNodeName[256];
	_stprintf_s(szNodeName, TEXT("%s(%d)"), text, id);

	int itemIndex = ListBox_AddString(mLightNodesList, szNodeName);
	if (itemIndex != LB_ERR)
	{
		ListBox_SetItemData(mLightNodesList, itemIndex, id);
	}
}
Example #25
0
/*
 * AddNonbankItem()
 */
int TxLbx_AddNonbankItem(HWND listBox, const _TUCHAR *type, const _TUCHAR *name
        , DWORD itemData)
{
    _TUCHAR itemName[ITEMNAME_LEN];
    int lbxItem;

    _sntprintf(itemName, ITEMNAME_LEN, _T("%-4.4s %s"), type, name);
    itemName[ITEMNAME_LEN - 1] = '\0';
    lbxItem = ListBox_AddString(listBox, itemName);
    ListBox_SetItemData(listBox, lbxItem, itemData & 0x00FFFFFF);

    return lbxItem;
}
Example #26
0
/*
 * MailGetMessageList:  Load filenames of all mail messages, and store in a list box.
 */
void MailGetMessageList(void)
{
   HANDLE hFindFile;
   WIN32_FIND_DATA file_info;
   char path[MAX_PATH + FILENAME_MAX];
   int index, msgnum;
   MailHeader header;

   /* Load messages in, in sorted order */
   if (hMsgList == NULL)
      hMsgList = CreateWindow("listbox", "", WS_CHILD | LBS_SORT, 0, 0, 0, 0, 
                              cinfo->hMain, NULL, hInst, NULL);
   else ListBox_ResetContent(hMsgList);
   
   sprintf(path,"%s\\%s", MAIL_DIR, MAIL_SPEC);
   hFindFile = FindFirstFile(path, &file_info);
   if (hFindFile == INVALID_HANDLE_VALUE)
      return;
   
   while (1)
   {
      // Skip directories
      if (!(file_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
      {
         /* Set itemdata of each entry to message header info */
         msgnum = atoi(file_info.cFileName);
         sprintf(path, "%s\\%s", MAIL_DIR, file_info.cFileName);
         
         index = ListBox_AddString(hMsgList, path);
         
         ListBox_SetItemData(hMsgList, index, msgnum);
      }
      
      if (FindNextFile(hFindFile, &file_info) == FALSE)
         break;
   }
   FindClose(hFindFile);
   
   // Add messages to mail dialog
   for (index = 0; index < ListBox_GetCount(hMsgList); index++)
   {
      msgnum = ListBox_GetItemData(hMsgList, index);
      ListBox_GetText(hMsgList, index, path);
      
      // Send summary string to mail dialog
      if (hReadMailDlg != NULL && MailParseMessageHeader(msgnum, path, &header))
         SendMessage(hReadMailDlg, BK_NEWMAIL, msgnum, (LPARAM) &header); 
   }
}
Example #27
0
static BOOL CALLBACK PickMtlProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
    static plPickMaterialInfo* info;

    if (msg == WM_INITDIALOG)
    {
        info = (plPickMaterialInfo*)lParam;

        MtlSet mtls;
        plMtlCollector::GetMtls(&mtls, nil, info->fFlags);
        
        HWND hList = GetDlgItem(hDlg, IDC_MTL_LIST);

        MtlSet::iterator it = mtls.begin();
        for (; it != mtls.end(); it++)
        {
            int idx = ListBox_AddString(hList, (*it)->GetName());
            ListBox_SetItemData(hList, idx, (*it));
        }

        return TRUE;
    }
    else if (msg == WM_COMMAND)
    {
        if (HIWORD(wParam) == BN_CLICKED && (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL))
        {
            if (LOWORD(wParam) == IDOK)
            {
                if (GetPickedMtl(hDlg, &info->fMtl))
                {
                    EndDialog(hDlg, 1);
                    return TRUE;
                }
            }

            EndDialog(hDlg, 0);
            return TRUE;
        }
        else if (HIWORD(wParam) == LBN_DBLCLK && LOWORD(wParam) == IDC_MTL_LIST)
        {
            if (GetPickedMtl(hDlg, &info->fMtl))
                EndDialog(hDlg, 1);
            return TRUE;
        }
    }

    return FALSE;
}
Example #28
0
void SymbolMap::FillListBoxBLinks(HWND listbox, int num)
{
    ListBox_ResetContent(listbox);

    int style = GetWindowLong(listbox,GWL_STYLE);

    MapEntry &e = entries[num];
#ifdef BWLINKS
    for (int i=0; i<e.backwardLinks.size(); i++)
    {
        u32 addr = e.backwardLinks[i];
        int index = ListBox_AddString(listbox,SymbolMap::GetSymbolName(SymbolMap::GetSymbolNum(addr)));
        ListBox_SetItemData(listbox,index,addr);
    }
#endif
}
Example #29
0
void ECP_AddItem(HWND hwndList, PECPITEM pItem)
{
    if (pItem->pszBody == NULL)
    {
        // We have an empty item! try title instead
        pItem->pszBody = (LPTSTR)Mem_AllocStr(_tcslen(pItem->pszTitle) + SZ);
        _tcscpy(pItem->pszBody, pItem->pszTitle);
    }

    String_TrimRight(pItem->pszBody, _T('\n'));
    String_TrimRight(pItem->pszBody, _T('\r'));

    // i can't read this at all =)
    ListBox_SetItemData(hwndList, ListBox_AddString(hwndList, pItem->pszTitle), pItem);
    Mem_Free(pItem->pszTitle);
}
Example #30
0
BOOL FAR PASCAL EXPORT EnumMDIChild(HWND hChild, LPARAM lParam)
{
  unsigned char work[120];
  short index;
  HWND  hDlg;
  LPENUMDATA lpdata = (LPENUMDATA)lParam;
  hDlg=lpdata->hDlg;
  GetWindowText(hChild,work,sizeof(work));
  if (work[0] && GetParent(hChild) == lpdata->hmdi)
    {
    HWND hwndList = GetDlgItem(hDlg, 100);
    index=(short)ListBox_AddString(hwndList, work);
    ListBox_SetItemData(hwndList, index, (LPARAM)hChild);
    }
  return(TRUE);
}