Print Page | Close Window

CXTPPropertySheet bitmap

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=22807
Printed Date: 05 October 2024 at 5:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPPropertySheet bitmap
Posted By: guiuser1
Subject: CXTPPropertySheet bitmap
Date 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.




Replies:
Posted By: guiuser1
Date 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...




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net