Beispiel #1
0
void FocusState(bool bHasFocus) //maks
{
    if(bHasFocus && CanOpenSIP())
    {
        SHSipPreference(SDL_Window, SIP_UP);
        sipHwnd = FindWindow(_T("SipWndClass"), NULL);
    }

    if(!bHasFocus)
    {
        sipHwnd = NULL;
        SHSipPreference(SDL_Window, SIP_DOWN);
        InvalidateGameScreen();
    }
}
Beispiel #2
0
void CUIDialog::OnTimer(UINT_PTR nIDEvent)
{
	if(nIDEvent == 1)
	{
		KillTimer(1);

		// As classes derivadas devem criar os controles... 
		if(!_CreateControls())
		{
			CString msg;
			msg.LoadString(IDS_ERROUICONTROL);

			MessageBox(msg, L"Mensagem", MB_ICONERROR|MB_OK);
			STLOG_WRITE(L"CUIDialog::OnTimer(): Erro criando controles.");
			return;
		}

		_UpdatePanel();
		_TogglePage(m_nAtualPage);

		m_scroll.ShowWindow(SW_SHOW);
		m_panel.ShowWindow(SW_SHOW);

#ifdef _WIN32_WCE
		SHSipPreference(GetSafeHwnd(), SIP_UP);
#endif
	}

	CDialogEx::OnTimer(nIDEvent);
}
void
nsSoftKeyBoardService::CloseSIP()
{
#ifdef WINCE

  HWND hWndSIP = FindWindow( _T( "SipWndClass" ), NULL );
  if (hWndSIP)
  {
    ShowWindow( hWndSIP, SW_HIDE );
  }

  hWndSIP = FindWindow( _T( "MS_SIPBUTTON" ), NULL );
  if (hWndSIP) 
  {
    ShowWindow( hWndSIP, SW_HIDE );
    SetWindowPos(hWndSIP, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
  }

  SHSipPreference(NULL, SIP_DOWN);

  SHFullScreen(GetForegroundWindow(), SHFS_HIDESIPBUTTON);
#endif

  nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1");
  if (observerService)
    observerService->NotifyObservers(nsnull, "software-keyboard", NS_LITERAL_STRING("close").get());

}
void
nsSoftKeyBoardService::OpenSIP()
{
  if (!gUseSoftwareKeyboard)
    return;

#ifdef WINCE
  HWND hWndSIP = ::FindWindow( _T( "SipWndClass" ), NULL );
  if (hWndSIP)
    ::ShowWindow( hWndSIP, SW_SHOW);

  SHSipPreference(NULL, SIP_UP);

  //  SHFullScreen(GetForegroundWindow(), SHFS_SHOWSIPBUTTON);

  // keep the sip button hidden!
  
  hWndSIP = FindWindow( _T( "MS_SIPBUTTON" ), NULL );
  if (hWndSIP) 
  {
    ShowWindow( hWndSIP, SW_HIDE );
    SetWindowPos(hWndSIP, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
  }

#endif

  nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1");
  if (observerService)
    observerService->NotifyObservers(nsnull, "software-keyboard", NS_LITERAL_STRING("open").get());
}
Beispiel #5
0
void CRcGen::_SetMaxY()
{
	CRect rect;
#ifdef _WIN32_WCE
	SHSipPreference(m_pThis->GetSafeHwnd(), SIP_UP);
	SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, NULL);
	SHSipPreference(m_pThis->GetSafeHwnd(), SIP_FORCEDOWN);
	m_nMaxY = 300;
#endif
	if(m_nMaxY>0)
	{
		m_pThis->GetWindowRect(&rect);
		m_pThis->ScreenToClient(rect);
		//nMaxY = rect.bottom-35; //Desconta tamanho do header do tabcontrol
		//m_nMaxY = rect.right;
	}
}
Beispiel #6
0
    bool sipPreference(SIPSTATE state)
    {
#ifdef SHELL_SIP            
        return FALSE != SHSipPreference(handle(), state);
#else
        return true;
#endif
    }
Beispiel #7
0
void CDlgInput::OnCancel() 
{
#ifndef DESKTOP
    SHSipPreference( m_hWnd, SIP_DOWN );
#endif
    m_Edit.Empty();
	
	CDialog::OnCancel();
}
Beispiel #8
0
void CDlgInput::OnOK() 
{
#ifndef DESKTOP
    SHSipPreference( m_hWnd, SIP_DOWN );
#endif
    UpdateData(TRUE);
	
	CDialog::OnOK();
}
Beispiel #9
0
/**
\brief
	Método chamado quando é mudado algum parâmetro de sistema na janela.
\details
	Funções executadas por este método:
	- Manter a janela no lugar ao chamar/esconder o teclado virtual
*/
void CUIDialog::OnSettingChange(UINT uFlags, LPCTSTR lpszSection)
{
#ifdef _WIN32_WCE
	if(m_bKeepSIPUp)
		SHSipPreference(GetSafeHwnd(), SIP_UP);
	else
#endif
		CDialogEx::OnSettingChange(uFlags, lpszSection);
}
Beispiel #10
0
void CheckInputDialog(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
#if defined(WIN_CE_POCKETPC)
	PNHMenuWindow data;

	data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);

	if( !( data && 
		   data->type==MENU_TYPE_MENU &&
		   (data->how==PICK_ONE || data->how==PICK_ANY) ) ) return;
	
	switch(message) {
	case WM_SETFOCUS:
		if( GetNHApp()->bUseSIP ) SHSipPreference(hWnd, SIP_UP);
	return;

	case WM_DESTROY:
	case WM_KILLFOCUS:
		if( GetNHApp()->bUseSIP ) SHSipPreference(hWnd, SIP_DOWN);
	return;

	case WM_NOTIFY:
	{
		LPNMHDR	lpnmhdr = (LPNMHDR)lParam;
		switch(lpnmhdr->code) {
		case NM_SETFOCUS:
			if( GetNHApp()->bUseSIP ) SHSipPreference(hWnd, SIP_UP);
		break;
		case NM_KILLFOCUS:
			if( GetNHApp()->bUseSIP ) SHSipPreference(hWnd, SIP_DOWN);
		break;
		}
	} return;

	case WM_COMMAND:
		switch(HIWORD(wParam)) {
		case BN_SETFOCUS:
			if( GetNHApp()->bUseSIP ) SHSipPreference(hWnd, SIP_UP);
		break;
		case BN_KILLFOCUS:
			if( GetNHApp()->bUseSIP ) SHSipPreference(hWnd, SIP_DOWN);
		break;
		}
	return;

	} /* end switch */
#endif
}
Beispiel #11
0
/***********************************************************************

FUNCTION: 
  WndProc

PURPOSE: 
  Processes messages sent to the main window.
  
***********************************************************************/
LRESULT FileInfo::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
{
    SHINITDLGINFO shidi;

    switch( msg )
    {
    case WM_INITDIALOG: 
        shidi.dwMask = SHIDIM_FLAGS;
        shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN |
            SHIDIF_FULLSCREENNOMENUBAR;//SHIDIF_SIZEDLGFULLSCREEN;
        shidi.hDlg = hwnd;
        SHInitDialog( &shidi );
        CreateTreeView( hwnd );
        UpdateWindow( hwnd );
        SHFullScreen( GetForegroundWindow(), SHFS_HIDESIPBUTTON );
        break;

    case WM_CLOSE:
        EndDialog( hwnd, LOWORD( wp ) );
        break;

    case WM_SETFOCUS:
        SHSipPreference( hwnd, SIP_DOWN ); 
        SHFullScreen( hwnd, SHFS_HIDESIPBUTTON );
        break;

    case WM_COMMAND:
        if ( LOWORD(wp) == IDOK )
        {
            EndDialog( hwnd, LOWORD( wp ) );
        }
        break;

    default:
        break;
    }

    return FALSE;
}
Beispiel #12
0
BOOL CDlgInput::OnInitDialog() 
{
	CDialog::OnInitDialog();

#ifndef DESKTOP
	m_wndCommandBar.m_bShowSharedNewButton = FALSE;
    if(    !m_wndCommandBar.Create(this)
	    || !m_wndCommandBar.AddAdornments()
      )
    { 
        TRACE0("Failed to create CommandBar\n"); 
    }
    else
    {
        CString ok     = L"OK"; //GetTranslation( okLabel );
        CString cancel = L"Cancel"; //GetTranslation( IDS_CANCEL );

        TCHAR texts[MAX_PATH];
        wcscpy( texts, ok );
        texts[ok.GetLength()] = '\0';
        wcscpy( texts+ok.GetLength()+1, cancel );
        texts[ok.GetLength()+cancel.GetLength()+1] = '\0';
        texts[ok.GetLength()+cancel.GetLength()+2] = '\0';
        int idx = m_wndCommandBar.SendMessage(TB_ADDSTRING, 0, (LPARAM)texts );
        
        TBBUTTON tbbi[2];
        tbbi[0].idCommand = IDOK;
        tbbi[0].fsState = TBSTATE_ENABLED;
        tbbi[0].fsStyle = TBSTYLE_BUTTON|TBSTYLE_AUTOSIZE;
        tbbi[0].dwData  = 0;
        tbbi[0].iBitmap = -2;
        tbbi[0].iString = idx;

        tbbi[1].idCommand = IDCANCEL;
        tbbi[1].fsState = TBSTATE_ENABLED;
        tbbi[1].fsStyle = (BYTE)TBSTYLE_FLAT|TBSTYLE_AUTOSIZE;
        tbbi[1].dwData  = 0;
        tbbi[1].iBitmap = -2;
        tbbi[1].iString = idx+1;

        m_wndCommandBar.SendMessage(TB_ADDBUTTONS, 2, (LPARAM)&tbbi);
    }
#endif
	
	if ( Title.IsEmpty() ) SetWindowText( L"JScripts" );
                      else SetWindowText( Title );
	if ( Numeric ) ((CEdit*)GetDlgItem(IDC_EDIT))->ModifyStyle( 0, ES_NUMBER );
	if ( Multiline )
	{
		RECT pos;
		int height;

		GetDlgItem(IDC_EDIT)->GetWindowRect( &pos );
		ScreenToClient( &pos );
		height = pos.bottom-pos.top;
		pos.bottom += height*4;
		GetDlgItem(IDC_EDIT)->MoveWindow( &pos );

#ifdef DESKTOP
		GetWindowRect( &pos );
		pos.bottom += height*4;
		MoveWindow( &pos );
#endif

		/*
		GetDlgItem(IDOK)->GetWindowRect( &pos );
		ScreenToClient( &pos );
		pos.top += height*4;
		pos.bottom += height*4;
		GetDlgItem(IDOK)->MoveWindow( &pos );

		GetDlgItem(IDCANCEL)->GetWindowRect( &pos );
		ScreenToClient( &pos );
		pos.top += height*4;
		pos.bottom += height*4;
		GetDlgItem(IDCANCEL)->MoveWindow( &pos );
		*/
	}
	else
	{
		((CEdit*)GetDlgItem(IDC_EDIT))->ModifyStyle( ES_MULTILINE|ES_WANTRETURN|WS_VSCROLL, 0 );
		//((CEdit*)GetDlgItem(IDC_EDIT))->ModifyStyleEx( 0, ES_MULTILINE|ES_WANTRETURN|WS_VSCROLL );
	}
#ifndef DESKTOP
    UpdateData(FALSE);
    SHSipPreference( m_hWnd, SIP_UP );
#endif
	if ( MsgFont != NULL )
		GetDlgItem(IDC_LABEL)->SetFont( CFont::FromHandle( MsgFont ) );

	((CEdit*)GetDlgItem(IDC_EDIT))->SetSel(0,0,FALSE);

	CRect wndPos;
	GetClientRect( wndPos );
	::PostMessage( m_hWnd, WM_SIZE, SIZE_RESTORED, MAKEWPARAM( wndPos.Width(), wndPos.Height() ) ); // initialize control positions
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}