Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. On the Origin of CTabCtrlEx used in Tabbed Dialogs

On the Origin of CTabCtrlEx used in Tabbed Dialogs

Scheduled Pinned Locked Moved C / C++ / MFC
c++questiondebugging
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    federico strati
    wrote on last edited by
    #1

    Hello, this is a bit of a strange question: I have a CTabCtrlEx class that was passed to me for doing tabbed dialog forms: in substance it is a class that allows dialogs to be inscribed inside a tabbed control. It is probably a well known class but I cannot find the origin of it (maybe Jeff Prosise's, but I don't know for certain). Hence the question is, do you know any reference to this class in the literature ? I attach here the class itself ---- header ----

    #if !defined(AFX_TABCTRLEX_H__INCLUDED_)
    #define AFX_TABCTRLEX_H__INCLUDED_

    #if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000
    // TabCtrlEx.h : header file

    #define TBC_NO_IMAGE -1

    class CTabCtrlEx : public CTabCtrl
    {
    private:
    BOOL m_bDeleteItemDlg;
    BOOL m_itemRectIsValid;
    CRect m_itemDlgRect;
    CDialog* m_pLastSelDlg;

    public:
    CTabCtrlEx(BOOL bDeleteItemDlg = FALSE);
    ~CTabCtrlEx();

    BOOL InitItem(UINT nIDTemplate, CDialog\* pDlg, CDialog\* pParent);
    
    int AddItem(LPTSTR lpczText, CDialog\* pDlg, int nImage = TBC\_NO\_IMAGE);
    
    int GetItem(CDialog\* pDlg);
    int GetItem(LPCTSTR lpczText);
    
    CDialog\* GetNextItem(int nItem);
    
    BOOL RemoveItem(CDialog\* pDlg);
    BOOL RemoveItem(LPCTSTR lpczText);
    
    void RemoveAllItems(BOOL bDeleteDlg);
    
    CDialog\* GetSelectedItemDlg();
    BOOL SetSelectedItemDlg(CDialog\* pDlg);
    
    void SetItemDlgRect(LPRECT lprect);
    BOOL GetItemDlgRect(LPRECT lprect);
    
    BOOL ShowSelectedItemDlg();
    
    virtual BOOL DestroyWindow();
    

    protected:
    afx_msg void OnTcnSelchange(NMHDR *pNMHDR, LRESULT *pResult);
    DECLARE_MESSAGE_MAP()
    };

    //{{AFX_INSERT_LOCATION}}
    // Microsoft Visual C++ will insert additional declarations immediately before the previous line.

    #endif // !defined(AFX_TABCTRLEX_H__INCLUDED_)

    ---- header ---- ---- body ----

    // TabCtrlEx.cpp : implementation file
    //

    #include "stdafx.h"
    #include "TabCtrlEx.h"

    #ifdef _DEBUG
    #define new DEBUG_NEW
    #endif

    /////////////////////////////////////////////////////////////////////////////
    // CTabCtrlEx dialog
    CTabCtrlEx::CTabCtrlEx(BOOL bDeleteItemDlg /*FALSE*/)
    {
    m_bDeleteItemDlg = bDeleteItemDlg;
    m_itemRectIsValid = FALSE;
    m_pLastSelDlg = NULL;
    }

    CTabCtrlEx::~CTabCtrlEx()
    {
    }

    BEGIN_MESSAGE_MAP(CTabCtrlEx, CTabCtrl)
    ON_NOTIFY_REFLECT(TCN_SELCHANGE, OnTcnSelchange)
    END_MESSAGE_MAP()

    BOOL CTabCtrlEx::DestroyWindow()
    {
    if(m_bDeleteItemDlg)
    RemoveAllItems(m_bDeleteItemDlg);
    return CTabCtrl::DestroyWindow();
    }

    int CTabCtrlEx::AddItem(LPTSTR lpczText,

    E 1 Reply Last reply
    0
    • F federico strati

      Hello, this is a bit of a strange question: I have a CTabCtrlEx class that was passed to me for doing tabbed dialog forms: in substance it is a class that allows dialogs to be inscribed inside a tabbed control. It is probably a well known class but I cannot find the origin of it (maybe Jeff Prosise's, but I don't know for certain). Hence the question is, do you know any reference to this class in the literature ? I attach here the class itself ---- header ----

      #if !defined(AFX_TABCTRLEX_H__INCLUDED_)
      #define AFX_TABCTRLEX_H__INCLUDED_

      #if _MSC_VER > 1000
      #pragma once
      #endif // _MSC_VER > 1000
      // TabCtrlEx.h : header file

      #define TBC_NO_IMAGE -1

      class CTabCtrlEx : public CTabCtrl
      {
      private:
      BOOL m_bDeleteItemDlg;
      BOOL m_itemRectIsValid;
      CRect m_itemDlgRect;
      CDialog* m_pLastSelDlg;

      public:
      CTabCtrlEx(BOOL bDeleteItemDlg = FALSE);
      ~CTabCtrlEx();

      BOOL InitItem(UINT nIDTemplate, CDialog\* pDlg, CDialog\* pParent);
      
      int AddItem(LPTSTR lpczText, CDialog\* pDlg, int nImage = TBC\_NO\_IMAGE);
      
      int GetItem(CDialog\* pDlg);
      int GetItem(LPCTSTR lpczText);
      
      CDialog\* GetNextItem(int nItem);
      
      BOOL RemoveItem(CDialog\* pDlg);
      BOOL RemoveItem(LPCTSTR lpczText);
      
      void RemoveAllItems(BOOL bDeleteDlg);
      
      CDialog\* GetSelectedItemDlg();
      BOOL SetSelectedItemDlg(CDialog\* pDlg);
      
      void SetItemDlgRect(LPRECT lprect);
      BOOL GetItemDlgRect(LPRECT lprect);
      
      BOOL ShowSelectedItemDlg();
      
      virtual BOOL DestroyWindow();
      

      protected:
      afx_msg void OnTcnSelchange(NMHDR *pNMHDR, LRESULT *pResult);
      DECLARE_MESSAGE_MAP()
      };

      //{{AFX_INSERT_LOCATION}}
      // Microsoft Visual C++ will insert additional declarations immediately before the previous line.

      #endif // !defined(AFX_TABCTRLEX_H__INCLUDED_)

      ---- header ---- ---- body ----

      // TabCtrlEx.cpp : implementation file
      //

      #include "stdafx.h"
      #include "TabCtrlEx.h"

      #ifdef _DEBUG
      #define new DEBUG_NEW
      #endif

      /////////////////////////////////////////////////////////////////////////////
      // CTabCtrlEx dialog
      CTabCtrlEx::CTabCtrlEx(BOOL bDeleteItemDlg /*FALSE*/)
      {
      m_bDeleteItemDlg = bDeleteItemDlg;
      m_itemRectIsValid = FALSE;
      m_pLastSelDlg = NULL;
      }

      CTabCtrlEx::~CTabCtrlEx()
      {
      }

      BEGIN_MESSAGE_MAP(CTabCtrlEx, CTabCtrl)
      ON_NOTIFY_REFLECT(TCN_SELCHANGE, OnTcnSelchange)
      END_MESSAGE_MAP()

      BOOL CTabCtrlEx::DestroyWindow()
      {
      if(m_bDeleteItemDlg)
      RemoveAllItems(m_bDeleteItemDlg);
      return CTabCtrl::DestroyWindow();
      }

      int CTabCtrlEx::AddItem(LPTSTR lpczText,

      E Offline
      E Offline
      Electron Shepherd
      wrote on last edited by
      #2

      federico.strati wrote:

      do you know any reference to this class in the literature ?

      What information are you after? You have the full source, so in one sense it is fully documented. Are you concerned about using copyrighted code?

      Server and Network Monitoring

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups