コード例 #1
0
/**
 *	@brief	Makes the control enabled or disabled.
 *	@param[in]	doEnable	true to enable the control, or false to disable the control.
 */
void BeListViewAdapter::Enable(bool doEnable)
{
	BListView* listView = getListView();
	int32 count = listView->CountItems();
	int32 index;
	for (index = 0; index < count; index++)
	{
		BListItem* listItem = listView->ItemAt(index);
		listItem->SetEnabled(doEnable);
	}
	listView->LockLooper();
	listView->Invalidate();
	listView->UnlockLooper();
	
	isEnabled = doEnable;
}
コード例 #2
0
void iupdrvListAppendItem(Ihandle* ih, const char* value)
{
  BView* view = (BView*)ih->handle;

  BMenuField* menu = dynamic_cast<BMenuField*>(view);
  if(menu)
  {
    menu->Menu()->AddItem(new BMenuItem(value, NULL));
	return;
  }

  BListView* listview = iuphaikuGetListView(view);

  if(listview)
  {
    BListItem* item = new BStringItem(value);
	listview->LockLooper();
    listview->AddItem(item);
	listview->UnlockLooper();
  } else {
    fprintf(stderr, "View hierarchy problem\n");
  }

}