wyBool
TableTabInterfaceTabMgmt::CreatePreviewTab()
{
    wyBool      retval = wyTrue;
    wyString    tabtitle;

    tabtitle.SetAs(_("&5 SQL Preview"));

    m_tabpreview = new TabPreview(m_hcommonwnd, this);

    /// Creating Preview instance
    m_tabpreview->Create();

    /// Inserting tab into CustomTab
    InsertTab(m_hwnd, CustomTab_GetItemCount(m_hwnd), IDI_TABPREVIEW, tabtitle, (LPARAM)m_tabpreview);

    return retval;
}
wyBool
TableTabInterfaceTabMgmt::CreateIndexesTab()
{
    wyBool      retval = wyTrue;
    wyString    tabtitle;

    tabtitle.SetAs(_("&2 Indexes"));

    m_tabindexes = new TabIndexes(m_hcommonwnd, this);
    
    /// Creating Index-tab
    m_tabindexes->Create();

    /// Inserting Index-tab into tab-management
    InsertTab(m_hwnd, CustomTab_GetItemCount(m_hwnd), IDI_MANINDEX_16, tabtitle, (LPARAM)m_tabindexes);

    return retval;
}
wyBool
TableTabInterfaceTabMgmt::CreateForeignKeysTab()
{
    wyBool      retval = wyTrue;
    wyString    tabtitle;

    tabtitle.SetAs(_("&3 Foreign Keys"));
    
    m_tabfk = new TabForeignKeys(m_hcommonwnd, this);
    
    /// Creating Foreign-Keys tab
    if(!m_tabfk->Create())
        return wyFalse;

    /// Inserting tab into CustomTab
    InsertTab(m_hwnd, CustomTab_GetItemCount(m_hwnd), IDI_MANREL_16, tabtitle, (LPARAM)m_tabfk);
    return retval;
}
wyBool
TableTabInterfaceTabMgmt::CreateAdvancedPropertiesTab()
{
    wyBool      retval = wyTrue;
    wyString    tabtitle;
   
	tabtitle.SetAs(_("&4 Advanced"));
    
    m_tabadvprop = new TabAdvancedProperties(m_hcommonwnd, this);


    /// Creating Advanced Properties instance
    if(!m_tabadvprop->Create())
        return wyFalse;
    
    /// Inserting tab into CustomTab
    InsertTab(m_hwnd, CustomTab_GetItemCount(m_hwnd), IDI_TABLEOPTIONS, tabtitle, (LPARAM)m_tabadvprop);
    return retval;
}
wyBool
TableTabInterfaceTabMgmt::CreateFieldsTab()
{
    wyBool      retval = wyTrue;
    wyString    fieldstab;

    fieldstab.SetAs(_("&1 Columns"));

    m_tabfields = new TabFields(m_hcommonwnd, this);

    /// Creating Fields tab
    if(!m_tabfields->Create())
        return wyFalse;

    /// Inserting tab into tab-management
    InsertTab(m_hwnd, CustomTab_GetItemCount(m_hwnd), IDI_COLUMN, fieldstab, (LPARAM)m_tabfields);
    
    return retval;
}
void CGraphicTabControl::ChangeTabClient( int iTab, CWnd* pClient )
{
	if( m_bChangingClient )
		return;
	ASSERT_RETURN( iTab >= 0 && iTab < GetTabCount() && pClient != NULL );

	if( TabExists( pClient ) ) {
		// make sure window is shown and update tab bar layout
		pClient->ShowWindow(SW_SHOW);
		RecalcLayout();
		UpdateWindow();
		return;  // nothing to do
	}

	SECTab* ptab = GetTabPtr(iTab);
	ASSERT_RETURN( ptab );
	CWnd* pOldClient = (CWnd*)ptab->m_pClient;
	// check to see if we really need to do anything
	if( pOldClient == pClient ) {
		pClient->ShowWindow( SW_SHOW );
		return;
	} 
	m_bChangingClient = true;
	// hide both windows
	pClient->ShowWindow(SW_HIDE);
	pOldClient->ShowWindow(SW_HIDE);
	CString tabName = ptab->m_csLabel;
	InsertTab( iTab, tabName, pClient, NULL, NULL );
	// remove old tab
	ActivateTab( iTab );
	DeleteTab( iTab + 1 );
	pClient->ShowWindow(SW_SHOW);
	RecalcLayout();
	UpdateWindow();
	m_bChangingClient = false;
	return;
}
Exemple #7
0
wyBool
BlobMgmt::InitDlgVales()
{
	wyString codepage;

    //if find dialog is open, we need to close find dialog 
	if(pGlobals->m_pcmainwin->m_finddlg)
	{
		DestroyWindow(pGlobals->m_pcmainwin->m_finddlg);
		pGlobals->m_pcmainwin->m_finddlg = NULL;
	}

	VERIFY(m_hwndtab   = GetDlgItem(m_hwnddlg, IDC_MAINTAB));
	VERIFY(m_hwndedit  = GetDlgItem(m_hwnddlg, IDC_TEXT));
	VERIFY(m_hwndimage = GetDlgItem(m_hwnddlg, IDC_IMAGE));
	VERIFY(m_hwndnull  = GetDlgItem(m_hwnddlg, IDC_SETNULL));
	VERIFY(m_hwndcombo = GetDlgItem(m_hwnddlg, IDC_COMBO));
    
	InsertTab(m_hwndtab, 0, _(L"Text"));
    InsertTab(m_hwndtab, 1, _(L"Image"));
	
	// if its not word wrap then we need to destroy it.
	SetEditWordWrap(m_hwndedit, wyTrue, wyTrue);
    
	// just for the sake hide both of them
	VERIFY(ShowWindow(m_hwndimage, FALSE));
	VERIFY(ShowWindow(m_hwndedit, FALSE));

	if(m_piub && m_piub->m_isnull == wyTrue)
    {
		SendMessage(GetDlgItem(m_hwnddlg, IDC_SETNULL), BM_SETCHECK, BST_CHECKED, 0);
		DisableAll();
	}

	SetWindowLongPtr(m_hwndimage, GWLP_USERDATA,(LONG_PTR)this);
	SetWindowLongPtr(m_hwndedit, GWLP_USERDATA,(LONG_PTR)this);
	
	SendMessage(m_hwndedit, SCI_SETCODEPAGE, SC_CP_UTF8, 0);
	
	//To avoid printing of special characters in scintilla on ctrl+F and ctrl+H
	SendMessage (m_hwndedit, SCI_CLEARCMDKEY, (SCMOD_CTRL << 16)|'F', 0);
	SendMessage (m_hwndedit, SCI_CLEARCMDKEY, (SCMOD_CTRL << 16)|'H', 0);
	
    //Line added because to turn off the margin
    SendMessage(m_hwndedit, SCI_SETMARGINWIDTHN,1,0);
    
	//m_encodingtype.SetAs(codepage.GetString());
	
	//InitEncodingType();
	m_wporigtextproc =(WNDPROC)SetWindowLongPtr(m_hwndedit, GWLP_WNDPROC,(LONG_PTR)TextProc);
	m_wporigpaintproc =(WNDPROC)SetWindowLongPtr(m_hwndimage, GWLP_WNDPROC,(LONG_PTR)ImageProc);
	
	//initializing text in combobox
	InitComboText();
	ShowData();

    // set the font after reading it from ini file.
	SetEditFont(m_hwndedit);

	// if its not editable then we disable all except the ok button
	if(m_edit == wyFalse)
    {
		DisableAll();
		EnableWindow(GetDlgItem(m_hwnddlg, IDC_SETNULL), FALSE);
        EnableWindow(GetDlgItem(m_hwnddlg, IDC_TEXT), TRUE);
        SendMessage(GetDlgItem(m_hwnddlg, IDC_TEXT), EM_SETREADONLY, TRUE, TRUE);
        SetFocus(GetDlgItem(m_hwnddlg, IDC_TEXT));
	}

	m_checkboxstate = SendMessage(GetDlgItem(m_hwnddlg, IDC_SETNULL), BM_GETCHECK, 0, 0);
    SendMessage(m_hwndedit, SCI_EMPTYUNDOBUFFER, 0, 0);

	return wyTrue;
}
/**
 * AddCustomPane
 *
 * @param           [in] crstrName: name of pane (default is empty)
 *                       if empty, a default name is created and
 *                       the pane is regarded as automatic pane,
 *                       i.e. the name is always "Watch x" where x is
 *                       the pane index + 1
 * @return          Index of newly added custom pane
 *                  (0..number of custom panes - 1)
 * @exception       -
 * @see             
*/
int CWatchWindow::AddCustomPane(const CString& crstrName /*=_T("")*/)
{
    int iTabIndex;
    int iCustomPane;
    CWatchControlWrapper *pWrapper;
    SECTab* pTab = NULL;
    CString strName(crstrName);
    ETabType    eType = eImportExport;

    if (m_pTabWindow == NULL)
        return (-1);


    // We insert new custom panes to the right of existing custom panes.
    // Thus current custom pane count will be index of new custom pane.
    ////////////////////////////////////////////////////////////////////

    iCustomPane = m_iCustomPaneCount;
    if(strName.IsEmpty())
    {
        strName = BuildCustomPaneCaption (iCustomPane);
        eType = eAutomatic;
    }

    // Add a tab for our custom pane. We have to add the tab index base for custom panes
    // to our custom pane index to get the effective tab index. Note that Stingrays tab
    // window does not allow to use the InsertTab method to append a tab. Instead we have
    // to use AddTab in this case. Set scroll style of new tab.
    /////////////////////////////////////////////////////////////////////////////////////

    iTabIndex = iCustomPane;

    if(!InsertTab(iTabIndex, strName, eType))
    {
        return -1;
    }

    m_pTabWindow->SetScrollStyle (iTabIndex, 0);


    // Obviously have to increase number of custom panes.
    /////////////////////////////////////////////////////

    ++m_iCustomPaneCount;


    // If we have a forced pane and we inserted before the forced
    // pane we have to increase the forced panes tab index.
    /////////////////////////////////////////////////////////////

    if (m_iForcedPaneTab != -1 && m_iForcedPaneTab >= 0)
        ++m_iForcedPaneTab;


    // Propagate project path to the Active X Control wrapper, if already 
    //set (may be not set yet if OnCreate).
    //////////////////////////////////////////////////////////

    pWrapper = GetCustomPaneWrapper (iCustomPane);
    if (pWrapper != NULL && m_strProjectPath.GetLength())
        pWrapper->SetProjectPath (m_strProjectPath);


    return (iCustomPane);
}
	int SeparateTabWidget::InsertTab (int index, QWidget *page,
			const QString& text)
	{
		return InsertTab (index, page, QIcon (), text);
	}