Commit 80a93814 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wince/*: improvements to the WinCE interface.

parent db4be852
......@@ -661,29 +661,6 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp,
RefreshNavigMenu( p_intf,
(HMENU)SendMessage( hwndCB, SHCMBM_GETSUBMENU, (WPARAM)0,
(LPARAM)IDM_NAVIGATION ) );
#if 0
// Undo the video display because menu is opened
// due to GAPI, menu top display is not assumed
// FIXME verify if p_child_window exits
SendMessage( p_intf->p_sys->p_video_window->p_child_window,
WM_INITMENUPOPUP, wp, lp );
#endif
//refresh screen
/* InvalidateRect(hwnd, NULL, TRUE);
/UpdateWindow(hwndCB); // NULL*/
break;
#if 0
case WM_NOTIFY:
// Redo the video display because menu can be closed
// FIXME verify if p_child_window exits
if( (((NMHDR *)lp)->code) == NM_CUSTOMDRAW )
SendMessage( p_intf->p_sys->p_video_window->p_child_window,
WM_NOTIFY, wp, lp );
return lResult;
#endif
break;
case WM_LBUTTONDOWN:
......@@ -709,6 +686,18 @@ LRESULT CALLBACK Interface::WndProc( HWND hwnd, UINT msg, WPARAM wp,
DestroyWindow( hwnd );
break;
case WM_ENTERMENULOOP:
case WM_KILLFOCUS:
if( video && video->hWnd )
SendMessage( video->hWnd, WM_KILLFOCUS, 0, 0 );
break;
case WM_EXITMENULOOP:
case WM_SETFOCUS:
if( video && video->hWnd )
SendMessage( video->hWnd, WM_SETFOCUS, 0, 0 );
break;
case WM_DESTROY:
PostQuitMessage( 0 );
break;
......
......@@ -88,6 +88,11 @@ void PopupMenu( intf_thread_t *p_intf, HWND p_parent, POINT point )
/* Initializations */
memset( pi_objects, 0, MAX_POPUP_ITEMS * sizeof(int) );
ppsz_varnames[i] = "VLC media player";
pi_objects[i++] = 0;
ppsz_varnames[i++] = NULL; /* Separator */
i_last_separator = i;
/* Input menu */
p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
......@@ -302,7 +307,7 @@ void RefreshVideoMenu( intf_thread_t *p_intf, HMENU hMenu )
/* Delete old menu */
int count = wce_GetMenuItemCount( hMenu );
for( i = 0; i <= count; i++ ) RemoveMenu( hMenu, 0, MF_BYPOSITION );
if( p_intf->p_sys->p_video_menu )
{
for( iter = p_intf->p_sys->p_video_menu->begin();
......@@ -311,7 +316,7 @@ void RefreshVideoMenu( intf_thread_t *p_intf, HMENU hMenu )
p_intf->p_sys->p_video_menu->clear();
}
else p_intf->p_sys->p_video_menu = new vector<MenuItemExt*>;
/* Initializations */
memset( pi_objects, 0, MAX_VIDEO_ITEMS * sizeof(int) );
i = 0;
......
......@@ -98,6 +98,7 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, HWND _p_parent )
p_intf->pf_request_window = ::GetWindow;
p_intf->pf_release_window = ::ReleaseWindow;
p_intf->pf_control_window = ::ControlWindow;
p_intf->p_sys->p_video_window = this;
......@@ -116,7 +117,8 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, HWND _p_parent )
RegisterClass( &wc );
p_child_window = CreateWindow (
_T("VIDEOWINDOW"), _T(""), WS_CHILD | WS_VISIBLE | WS_BORDER,
_T("VIDEOWINDOW"), _T(""),
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | WS_BORDER,
0, 20, rect.right - rect.left,
rect.bottom - rect.top - 2*(MENU_HEIGHT-1) - SLIDER_HEIGHT - 20,
p_parent, NULL, GetModuleHandle(0), (void *)this );
......@@ -192,7 +194,24 @@ PURPOSE:
***********************************************************************/
LRESULT VideoWindow::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
{
return DefWindowProc( hwnd, msg, wp, lp );
switch( msg )
{
case WM_KILLFOCUS:
msg_Err( p_intf, "WM_KILLFOCUS1" );
if( p_vout )
vout_Control( p_vout, VOUT_SET_FOCUS, (vlc_bool_t)VLC_FALSE );
return TRUE;
case WM_SETFOCUS:
msg_Err( p_intf, "WM_SETFOCUS1" );
if( p_vout )
vout_Control( p_vout, VOUT_SET_FOCUS, (vlc_bool_t)VLC_TRUE );
return TRUE;
default:
return DefWindowProc( hwnd, msg, wp, lp );
}
}
static int ControlWindow( intf_thread_t *p_intf, void *p_window,
......
......@@ -100,7 +100,7 @@ struct intf_sys_t
class CBaseWindow
{
public:
CBaseWindow(){ hInst = 0; }
CBaseWindow() : hWnd(0), hInst(0) {};
virtual ~CBaseWindow() {};
HWND hWnd; // The main window handle
......@@ -158,7 +158,6 @@ public:
Timer *ti;
OpenDialog *open;
CBaseWindow *video;
HWND hwndVideo;
protected:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment