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


C++ list_t::remove_all方法代码示例

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


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

示例1: on_message


//.........这里部分代码省略.........
		{
			if (lp) SetFocus(wnd_menu);
			active_item = wp;

			make_menu(wp);
			break;
		}
		case WM_MENUSELECT:
		{
			if (HIWORD(wp) & MF_POPUP)
			{
				is_submenu = true;
				m_status_override.release();
			}
			else
			{
				is_submenu = false;
				if (p_manager.is_valid())
				{
					unsigned id = LOWORD(wp);

					bool set = false;

					pfc::string8 blah;

					set = p_manager->get_description(id - 1, blah);

					service_ptr_t<ui_status_text_override> p_status_override;

					if (set)
					{
						get_host()->override_status_text_create(p_status_override);

						if (p_status_override.is_valid())
						{
							p_status_override->override_text(blah);
						}
					}
					m_status_override = p_status_override;
				}
			}
			break;
		}
		case WM_INITMENUPOPUP:
		{
			sub_menu_ref_count++;
			break;
		}
		case WM_UNINITMENUPOPUP:
		{
			sub_menu_ref_count--;
			break;
		}
		case WM_GETMINMAXINFO:
		{
			LPMINMAXINFO mmi = LPMINMAXINFO(lp);

			RECT rc = { 0,0,0,0 };
			SendMessage(wnd_menu, TB_GETITEMRECT, m_buttons.get_count() - 1, (LPARAM)(&rc));

			//SIZE sz = {0,0};
			//SendMessage(wnd_menu, TB_GETMAXSIZE, NULL, (LPARAM)&sz);
			//console::formatter() << sz.cx << sz.cy;

			mmi->ptMinTrackSize.x = rc.right;
			mmi->ptMinTrackSize.y = rc.bottom;
			mmi->ptMaxTrackSize.y = rc.bottom;
			return 0;
		}
		case WM_SETTINGCHANGE:
		{
			if (wp == SPI_SETNONCLIENTMETRICS)
			{
				PostMessage(wnd, MSG_SIZE_LIMIT_CHANGE, 0, 0);
			}
			break;
		}
		case SPI_GETKEYBOARDCUES:
		{
			BOOL a = TRUE;
			SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &a, 0);
			SendMessage(wnd_menu, WM_UPDATEUISTATE, MAKEWPARAM((a || GetFocus() == wnd_menu) ? UIS_CLEAR : UIS_SET, UISF_HIDEACCEL), 0);
			break;
		}
		case MSG_SIZE_LIMIT_CHANGE:
		{
			get_host()->on_size_limit_change(wnd, uie::size_limit_minimum_height | uie::size_limit_maximum_height | uie::size_limit_minimum_width);
			break;
		}
		case WM_DESTROY:
		{
			DestroyWindow(wnd_menu);
			wnd_menu = NULL;
			m_buttons.remove_all();
			initialised = false;
			break;
		}
	}
	return DefWindowProc(wnd, msg, wp, lp);
}
开发者ID:i7voodoo,项目名称:columns_ui,代码行数:101,代码来源:menubar.cpp

示例2: findDspNames

void dsp_preset_switcher::findDspNames( pfc::list_t<pfc::string8> &out ) const
{
	// storing menu handles may not be a good idea, since the user can change DSP preset settings without notify this component

	out.remove_all();

	// enumerate mainmenu items
	service_enum_t<mainmenu_commands> e;
	service_ptr_t<mainmenu_commands_v2> ptr;
	while( e.next( ptr ) )
	{
		for( t_uint32 i = 0 , imax = ptr->get_command_count(); i < imax; ++i )
		{
			// lock-on on DSP settings
			pfc::string8 group_name;
			ptr->get_name( i , group_name );
			const char *DSP_PARENT_STR = "DSP";  // partial match, hope to work with non-English locale
			if( strstr( group_name.toString() , DSP_PARENT_STR ) == nullptr )
				continue;

			// should be a dynamic item
			if( !ptr->is_command_dynamic( i ) )
			{
				console::printf( CONSOLE_HEADER "%s(): item is NOT dynamic!!" , __FUNCTION__ );
				continue;
			}
			const mainmenu_node::ptr dsp_group_node = ptr->dynamic_instantiate( i );

			// should be a group node
			if( dsp_group_node->get_type() != mainmenu_node::type_group )
			{
				console::printf( CONSOLE_HEADER "%s(): node is NOT type_group!!" , __FUNCTION__ );
				continue;
			}

			// enumerate dsp names
			for( t_size j = 0 , jmax = dsp_group_node->get_children_count(); ( j < jmax ) && ( jmax > 1 ) ; ++j )  // jmax == 1 when there only exist "Preferences" items
			{
				const mainmenu_node::ptr dsp_item_node = dsp_group_node->get_child( j );
				if( dsp_item_node->get_type() == mainmenu_node::type_command )
				{
					pfc::string8 n;
					t_uint32 d;
					dsp_item_node->get_display( n , d );
					out.add_item( n );
					//console::printf( CONSOLE_HEADER "%s" , n.toString() );
				}
				else if( dsp_item_node->get_type() == mainmenu_node::type_separator )
				{
					// stop when encountered type_separator
					break;
				}
			}
			return;
		}
	}

	return;
}
开发者ID:Chocobo1,项目名称:foo_uie_dsp_switcher,代码行数:59,代码来源:main.cpp

示例3: get_num_items

//public:
   unsigned get_num_items()
   {
      //return 1;
      // see if we already cached all this jazz
      if ( g_mm_names.get_count() > 0 )
      {
         return g_mm_names.get_count();
      }

      unsigned total = 0;
	   service_enum_t<mainmenu_commands> e;
	   service_ptr_t<mainmenu_commands> ptr;

      g_mm_names.remove_all();
      g_mm_guids.remove_all();
      while(e.next(ptr)) 
      {
		   unsigned count = ptr->get_command_count();

         for ( unsigned n = 0; n < count; n++ )
         {
            pfc::string8 path;
            pfc::string8 name;
            GUID guid;

            t_uint32 p_flags;
            pfc::string8 str_display;

            ptr->get_display( n, str_display, p_flags );

            ptr->get_name( n, name );
            guid = ptr->get_command( n );
            find_menu_path( ptr->get_parent(), path );
            
            g_mm_names.add_item( name );
            g_mm_guids.add_item( guid );
            g_mm_paths.add_item( path );
         }

         total += count;
      }
      return total;
   }
开发者ID:cwbowron,项目名称:foobar2000-plugins,代码行数:44,代码来源:foo_notitlebar.cpp

示例4: initEntries

void dsp_preset_switcher::initEntries( pfc::list_t<pfc::string8> &out ) const
{
	// clear existing entries
	addEntry( "" );  // ensure a 1-item height empty item-list is displayed
	clearEntires();

	// get dsp names
	out.remove_all();
	findDspNames( out );

	// add to combo box
	for( t_size i = 0 , imax = out.get_count(); i < imax ; ++i )
	{
		addEntry( out[i] );
	}

	return;
}
开发者ID:Chocobo1,项目名称:foo_uie_dsp_switcher,代码行数:18,代码来源:main.cpp


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