win32_popup.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * win32_popup.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id$
00006  *
00007  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef WIN32_POPUP_HPP
00025 #define WIN32_POPUP_HPP
00026 
00027 #include "../src/os_popup.hpp"
00028 #include <windows.h>
00029 
00030 
00031 /// Win32 implementation of OSPopup
00032 class Win32Popup: public OSPopup
00033 {
00034     public:
00035         Win32Popup( intf_thread_t *pIntf, HWND hAssociatedWindow );
00036 
00037         virtual ~Win32Popup();
00038 
00039         /// Show the popup menu at the given (absolute) corrdinates
00040         virtual void show( int xPos, int yPos );
00041 
00042         /// Hide the popup menu
00043         virtual void hide();
00044 
00045         /// Append a new menu item with the given label to the popup menu
00046         virtual void addItem( const string &rLabel, int pos );
00047 
00048         /// Create a dummy menu item to separate sections
00049         virtual void addSeparator( int pos );
00050 
00051         /// Return the position of the item identified by the given id
00052         virtual int getPosFromId( int id ) const { return id; }
00053 
00054     private:
00055         /// Menu handle
00056         HMENU m_hMenu;
00057         /// Handle of the window which will receive the menu events
00058         HWND m_hWnd;
00059 
00060         /**
00061          * Find the item before which to insert another item so that the
00062          * newly added item is at the position pos _when the whole menu has
00063          * been built_ (no assumption is made for the order of insertion of the
00064          * items)
00065          */
00066         unsigned int findInsertionPoint( unsigned int pos ) const;
00067 };
00068 
00069 
00070 #endif

Generated on Wed Aug 13 08:02:38 2008 for VLC by  doxygen 1.5.1