Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPPropertySheet bitmap
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPPropertySheet bitmap

 Post Reply Post Reply
Author
Message
guiuser1 View Drop Down
Groupie
Groupie
Avatar

Joined: 17 November 2015
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote guiuser1 Quote  Post ReplyReply Direct Link To This Post Topic: CXTPPropertySheet bitmap
    Posted: 01 December 2015 at 4:05pm
We're looking at using the CXTPPropertySheet for our app settings.  We something similar to the
example  under  \PropertySheet\ specifically like the

CXTPPropertySheet ps(_T("CXTPPropertyPageTreeNavigator Sample")); 

We currently have a custom set of classes that manage this and inherently use the CPropertyPage classes and display images for each property page via the m_psp. Works great....

We're trying to retain this functionality and port our existing code to the ToolKit Pro CXTPPropertySheet classes....but can't find anyway to retain the images for each page.

It should be similar to:

  pageProperties.m_psp.dwFlags |= ( PSP_USEHICON );
  HICON hIconTab = AfxGetApp()->LoadIcon( IDI_PRINTER );
  pageProperties.m_psp.hIcon = hIconTab;

But ToolKitPro ignores the m_psp with respect to image displays...and thus does not display it. 

Has anybody touched this area?
Not sure why this is not a standard method...seems like many apps require this type of support.

Back to Top
guiuser1 View Drop Down
Groupie
Groupie
Avatar

Joined: 17 November 2015
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote guiuser1 Quote  Post ReplyReply Direct Link To This Post Posted: 02 December 2015 at 11:53am
OK...so after some hacking...we figured it out.  We still feel this should be an inherent part of the PropertySheets but at least we have it working.

Here's a code snippet from the PropertySheets Example (unrefined):

class CCategoriesTreeNavigator : public CXTPPropertyPageTreeNavigator
{
public:

    CImageList  m_imageList;

    CCategoriesTreeNavigator()
        : CXTPPropertyPageTreeNavigator(TVS_SHOWSELALWAYS | TVS_TRACKSELECT | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT)
    {
       
    }
   
    BOOL CreateTree()
    {
        ASSERT(m_pSheet->GetPageCount() == 2);
        if (m_pSheet->GetPageCount() != 2)
            return FALSE;

      CBitmap bitmap;
      bitmap.LoadBitmap(IDI_PRINTER);

      m_imageList.Create(24, 24, ILC_COLOR24|ILC_MASK, 2, 1);
      m_imageList.Add(&bitmap, RGB(255,0,255));
      SetImageList(&m_imageList, TVSIL_NORMAL);

        HTREEITEM hItemGeneral = InsertItem(_T("General"), 0, 0);
        HTREEITEM hItemOptions = InsertItem(_T("Options"), 1, 1);
       
CTreeCtrl is a bit of pain to work with...we tried various other ways to plug in the image which only resulted in the 'blank' space where the image would appear but at least it showed that the control was trying to display something.

The TreeCtrl example hinted at what need to be done...

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.140 seconds.