예제 #1
0
//Tabbar
bool rho_wmimpl_tabbar_isStarted()
{
#ifdef OS_WINCE
    return getAppWindow().isTabBarStarted();
#else
    return getAppWindow().isStarted();
#endif
}
예제 #2
0
int rho_wmimpl_tabbar_currentTabIndex()
{
#ifdef OS_WINCE
    return getAppWindow().getTabbar().GetCurrentTabIndexExternal();
#else
    return getAppWindow().tabbarGetCurrent();
#endif
}
예제 #3
0
void rho_wmimpl_tabbar_switchTab(int tabIndex)
{
#ifdef OS_WINCE
    getAppWindow().getTabbar().SwitchTab(tabIndex);
#else
    getAppWindow().tabbarSwitch(tabIndex);
#endif
}
예제 #4
0
void rho_wmimpl_tabbar_create( const rho::Vector<rho::String>& tabbarElements,  const rho::Hashtable<rho::String, rho::String>& tabBarProperties, rho::apiGenerator::CMethodResult& oResult)
{
#ifdef OS_WINCE
    getAppWindow().getTabbar().CreateTabbarEx(tabbarElements, tabBarProperties, oResult);
#else
    getAppWindow().createTabbarEx(tabbarElements, tabBarProperties, oResult);
#endif
}
예제 #5
0
void rho_wmimpl_tabbar_remove()
{
#ifdef OS_WINCE
    getAppWindow().getTabbar().RemoveTabbar();
#else
    getAppWindow().removeTabbar();
#endif
}
예제 #6
0
void rho_wmimpl_tabbar_setTabBadge(int tabIndex,  const rho::String& badge)
{
#ifdef OS_WINCE
    getAppWindow().getTabbar().SetBadge(tabIndex, badge.c_str());
#else
    getAppWindow().tabbarBadge(tabIndex, badge.c_str());
#endif

}
예제 #7
0
/// Function name  : onSplashWindowCreate
// Description     : 
// 
// SPLASH_WINDOW_DATA*  pWindowData : [in] 
// HWND                 hWnd        : [in] 
// 
VOID  onSplashWindowCreate(SPLASH_WINDOW_DATA*  pWindowData, HWND  hWnd)
{
   RECT    rcMainWindow,        // Main window rectangle
           rcSplashWindow;      // Splash window rectangle
   HDC     hDC;


   // Prepare
   GetWindowRect(getAppWindow(), &rcMainWindow);

   /// Store window data
   SetWindowLong(hWnd, 0, (LONG)pWindowData);
   pWindowData->hWnd = hWnd;

   /// Create drawing objects
   hDC = GetDC(hWnd);
   pWindowData->hProgressPen  = CreatePen(PS_SOLID, 2, clProgressBar);
   pWindowData->hProgressFont = utilCreateFont(hDC, TEXT("Tahoma Regular"), 7, FALSE, FALSE, FALSE);      //MS Sans Serif
   ReleaseDC(hWnd, hDC);

   // Calculate centered Spash window rectangle
   SetRect(&rcSplashWindow, 0, 0, siLogoBitmap.cx, siLogoBitmap.cy);
   utilCentreRectangle(&rcMainWindow, &rcSplashWindow, UCR_HORIZONTAL WITH UCR_VERTICAL);

   /// Position and display window
   SetWindowPos(hWnd, NULL, rcSplashWindow.left, rcSplashWindow.top, siLogoBitmap.cx, siLogoBitmap.cy, SWP_NOZORDER);
   ShowWindow(hWnd, SW_SHOW);

   /// Paint window
   drawSplashWindow(pWindowData);

   // Set update timer
   SetTimer(hWnd, SPLASH_TICKER, 200, NULL);
}
예제 #8
0
void CExtManager::setBrowserGesturing(bool bEnableGesturing)
{
#if !defined(OS_WINDOWS_DESKTOP)
    getAppWindow().getWebKitEngine()->setBrowserGesturing(bEnableGesturing);
#endif

}
예제 #9
0
void rho_wmimpl_tabbar_removeTab(int tabIndex)
{
#ifdef OS_WINCE
    getAppWindow().removeTab(tabIndex);
#else
#endif
}
예제 #10
0
void CExtManager::setBrowserGesturing(bool bEnableGesturing)
{
#ifndef RHODES_EMULATOR
    getAppWindow().getWebKitEngine()->setBrowserGesturing(bEnableGesturing);
#endif

}
예제 #11
0
void CExtManager::setBrowserGesturing(bool bEnableGesturing)
{
#if !defined(RHODES_EMULATOR) && !defined(RHODES_WIN32)
    getAppWindow().getWebKitEngine()->setBrowserGesturing(bEnableGesturing);
#endif

}
예제 #12
0
void CNativeToolbar::alignSeparatorWidth()
{
    int nSepPos = -1;
    for ( int i = 0; i < (int)m_arButtons.size()-1; i++ )
    {
        if ( m_arButtons.elementAt(i)->isSeparator() )
        {
            if ( nSepPos == -1 )
                nSepPos = i;
            else
                return; //if more than one separator, do anything
        }
    }

    if ( nSepPos == -1 )
        return;

    //right align all buttons after single separator
    CRect rcFirstBtn, rcLastBtn, rcToolbar, rcSep;
    GetItemRect(0,&rcFirstBtn);
    GetItemRect(m_arButtons.size()-1,&rcLastBtn);
    GetItemRect(nSepPos,&rcSep);
    getAppWindow().GetClientRect(&rcToolbar);
    int nAdd = rcToolbar.Width() - 2*rcFirstBtn.left - rcLastBtn.right;
    int nSepWidth = rcSep.Width();
    nSepWidth += nAdd;
    if ( nSepWidth < 0 )
        nSepWidth = 0;
    
    m_arButtons.elementAt(nSepPos)->m_nItemWidth = nSepWidth;

    DeleteButton(nSepPos);
    TBBUTTON btn = {0};
/*
    if ( nSepWidth <= 114 ) //maximum size for empty button
    {
        btn.fsStyle = TBSTYLE_BUTTON;
        btn.iBitmap = I_IMAGENONE;
            
        InsertButton(nSepPos, &btn);

        TBBUTTONINFO oBtnInfo = {0};
        oBtnInfo.cbSize = sizeof(TBBUTTONINFO);
        oBtnInfo.dwMask = TBIF_BYINDEX|TBIF_SIZE;

        oBtnInfo.cx = nSepWidth;

        SetButtonInfo(nSepPos, &oBtnInfo);

    }else   */
    {
        btn.fsStyle = TBSTYLE_SEP;
        btn.iBitmap = nSepWidth;

        InsertButton(nSepPos, &btn);
    }

    AutoSize();
}
예제 #13
0
int native_tabbar_get_current_tab() 
{
#if defined(OS_WINDOWS_DESKTOP)
	return getAppWindow().tabbarGetCurrent();
#else
	return 0;
#endif
}
예제 #14
0
int native_tabbar_get_current_tab() 
{
#ifdef RHODES_EMULATOR
	return getAppWindow().tabbarGetCurrent();
#else
	return 0;
#endif
}
예제 #15
0
void CNativeToolbar::removeToolbar()
{
    if ( m_hWnd )
    {
        ShowWindow(SW_HIDE);
        m_nHeight = 0;

#if defined (OS_WINDOWS)
        RECT rcWnd;
        getAppWindow().GetWindowRect(&rcWnd);
        getAppWindow().SetWindowPos( 0, 0,0,rcWnd.right-rcWnd.left-1,rcWnd.bottom-rcWnd.top, SWP_NOMOVE|SWP_NOZORDER|SWP_FRAMECHANGED);
        getAppWindow().SetWindowPos( 0, 0,0,rcWnd.right-rcWnd.left,rcWnd.bottom-rcWnd.top, SWP_NOMOVE|SWP_NOZORDER|SWP_FRAMECHANGED);
#else
        getAppWindow().SetWindowPos( 0, 0,0,0,0, SWP_NOMOVE|SWP_NOZORDER|SWP_NOSIZE|SWP_FRAMECHANGED);
#endif
    }
}
예제 #16
0
bool CExtManager::existsJavascript(const wchar_t* szJSFunction)
{
#ifndef RHODES_EMULATOR
    return getAppWindow().getWebKitEngine()->isExistJavascript(szJSFunction, rho_webview_active_tab());
#else
    return true;
#endif
}
예제 #17
0
int CExtManager::getTextZoom() //Enum (0 to 4)
{
#if !defined(OS_WINDOWS_DESKTOP)
    return getAppWindow().getWebKitEngine()->GetTextZoomOnTab(rho_webview_active_tab());
#else
    return 2;
#endif
}
예제 #18
0
bool CExtManager::RegisterForPrimaryBrowserMessage(unsigned int iMsgId)
{
#if !defined(OS_WINDOWS_DESKTOP)
    return getAppWindow().getWebKitEngine()->RegisterForPrimaryMessage(iMsgId);
#else
	return true;
#endif
}
예제 #19
0
bool CExtManager::existsJavascript(const wchar_t* szJSFunction)
{
#if !defined(OS_WINDOWS_DESKTOP)
    return getAppWindow().getWebKitEngine()->isExistJavascript(szJSFunction, rho_webview_active_tab());
#else
    return true;
#endif
}
예제 #20
0
int CExtManager::getTextZoom() //Enum (0 to 4)
{
#ifndef RHODES_EMULATOR
    return getAppWindow().getWebKitEngine()->GetTextZoomOnTab(rho_webview_active_tab());
#else
    return 2;
#endif
}
예제 #21
0
CRhoExtData CExtManager::makeExtData()
{
    CRhoExtData oData;
#ifndef RHODES_QT_PLATFORM
    oData.m_hWnd = getMainWnd();
    oData.m_hInstance = rho_wmimpl_get_appinstance();
#else
    oData.m_hWnd = 0;
    oData.m_hInstance = 0;
#endif
    oData.m_iTabIndex = rho_webview_active_tab();
#if !defined(OS_WINDOWS_DESKTOP)
	if(getAppWindow().getWebKitEngine())
		oData.m_hBrowserWnd = getAppWindow().getWebKitEngine()->GetHTMLWND(oData.m_iTabIndex);
#endif
    
    return oData;
}
예제 #22
0
StringW CExtManager::getPageTitle(UINT iTab)
{
#if !defined(OS_WINDOWS_DESKTOP)
    wchar_t szBuf[1025];
    szBuf[0]=0;
    getAppWindow().getWebKitEngine()->GetTitleOnTab( szBuf, 1024, iTab );    
    return szBuf ? szBuf : L"";
#else
    return L"";
#endif
}
예제 #23
0
bool CExtManager::DeRegisterForPrimaryBrowserMessage(unsigned int iMsgId)
{
#if !defined(OS_WINDOWS_DESKTOP)
    rho::IBrowserEngine* pEng = getAppWindow().getWebKitEngine();
    if (pEng)
        return pEng->DeRegisterForPrimaryMessage(iMsgId);
    return false;
#else
	return true;
#endif
}
예제 #24
0
StringW CExtManager::getPageTitle(UINT iTab)
{
#ifndef RHODES_EMULATOR
    wchar_t szBuf[1025];
    szBuf[0]=0;
    getAppWindow().getWebKitEngine()->GetTitleOnTab( szBuf, 1024, iTab );    
    return szBuf ? szBuf : L"";
#else
    return L"";
#endif
}
예제 #25
0
void create_native_toolbar(int bar_type, rho_param *p) 
{
    if ( bar_type == NOBAR_TYPE )
        remove_native_toolbar();
    else if ( bar_type == TOOLBAR_TYPE )
    {
        getAppWindow().performOnUiThread(new CNativeToolbar::CCreateTask(p) );
    }else
    {
    	RAWLOGC_ERROR("NativeBar", "Only Toolbar control is supported.");
    }
}
예제 #26
0
CRhoExtData CExtManager::makeExtData()
{
    CRhoExtData oData;
    oData.m_hWnd = getMainWnd();
    oData.m_hInstance = rho_wmimpl_get_appinstance();
#ifndef RHODES_EMULATOR
    oData.m_hBrowserWnd = getAppWindow().getWebKitEngine()->GetHTMLWND();
#endif

    oData.m_iTabIndex = rho_webview_active_tab();
    return oData;
}
/// Function name  : onArgumentPage_InsertArgument
// Description     : Display the 'Insert Argument' dialog and (if the user creates an argument) add the argument
//                    to the document's ScriptFile and the document properties dialog Argument ListView
// 
// SCRIPT_DOCUMENT*  pDocument   : [in] Active document
// HWND              hDialog     : [in] Window handle of the Arguments property page
// 
VOID   onArgumentPage_InsertArgument(SCRIPT_DOCUMENT*  pDocument, HWND  hDialog)
{
   // [VERBOSE]
   CONSOLE_COMMAND();

   /// Display 'Insert Argument' dialog
   if (displayInsertArgumentDialog(pDocument->pScriptFile, getAppWindow()))
   {
      // [NEW ARGUMENT] Update ListView item count
      ListView_SetItemCount(GetDlgItem(hDialog, IDC_ARGUMENTS_LIST), getScriptFileArgumentCount(pDocument->pScriptFile));

      // [EVENT] Notify document that a property has changed
      sendDocumentPropertyUpdated(AW_DOCUMENTS_CTRL, IDC_ARGUMENTS_LIST);
   }
}
예제 #28
0
/// Function name  : onSplashWindowDestroy
// Description     : 
// 
// SPLASH_WINDOW_DATA*  pWindowData : [in] 
// 
VOID  onSplashWindowDestroy(SPLASH_WINDOW_DATA*  pWindowData)
{

   // [CHECK] Are we running in windows 7
   if (getAppWindowsVersion() >= WINDOWS_7)
      /// [WINDOWS 7] Hide taskbar progress bar
      utilSetWindowProgressState(getAppWindow(), TBPF_NOPROGRESS);

   /// Destroy ticker
   KillTimer(pWindowData->hWnd, SPLASH_TICKER);

   // Sever and delete window data
   SetWindowLong(pWindowData->hWnd, 0, NULL);
   deleteSplashWindowData(pWindowData);

}
예제 #29
0
/// Function name  : wndprocSplashWindow
// Description     : Splash window procedure
// 
LRESULT  wndprocSplashWindow(HWND  hWnd, UINT  iMessage, WPARAM  wParam, LPARAM  lParam)
{
   SPLASH_WINDOW_DATA*  pWindowData;
   CREATESTRUCT*        pCreationData;
   BOOL                 bResult = TRUE;

   TRY
   {
      // Prepare
      pWindowData = (SPLASH_WINDOW_DATA*)GetWindowLong(hWnd, 0);

      // Examine message
      switch (iMessage)
      {
      /// [CREATE] Display window
      case WM_CREATE:
         // Prepare
         pCreationData = (CREATESTRUCT*)lParam;
         // Initialise window and store window data
         onSplashWindowCreate((SPLASH_WINDOW_DATA*)pCreationData->lpCreateParams, hWnd);
         break;

      /// [DESTROY] Destroy ticker
      case WM_DESTROY:
         onSplashWindowDestroy(pWindowData);
         break;

      /// [TIMER] Update window
      case WM_TIMER:
         onSplashWindowTimer(pWindowData);
         break;

      // [UNHANDLED]
      default:
         bResult = DefWindowProc(hWnd, iMessage, wParam, lParam);
         break;
      }

      return bResult;
   }
   /// [EXCEPTION HANDLER]
   CATCH3("iMessage=%s  wParam=%d  lParam=%d", identifyMessage(iMessage), wParam, lParam);
   EnableWindow(getAppWindow(), TRUE);
   return FALSE;
}
예제 #30
0
void create_native_tabbar(int bar_type, rho_param *p)
{
#if defined(OS_WINDOWS_DESKTOP)
    // check for iPad SplitTabBar type -> redirect to TabBar
    if (bar_type == VTABBAR_TYPE) {
        bar_type = TABBAR_TYPE;
    }

	if ( bar_type == NOBAR_TYPE )
        remove_native_tabbar();
    else if ( bar_type == TABBAR_TYPE )
    {
        getAppWindow().performOnUiThread(new CNativeTabbar::CCreateTask(bar_type, p) );
    } else
    {
    	RAWLOGC_ERROR("NativeTabbar", "Only Tabbar control is supported.");
    }
#endif
}