Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Toolbar buttons differ in size when loaded as icons Collapse All
Subject Author Date
Dominic Tioseco Dec 5, 2017 - 8:02 PM

Hi,

Somehow when I load a toolbar using a regular bitmap assigned to it, compared to a toolbar where its buttons are loaded as icons using CmdSetIcon, the bitmap toolbar has its buttons bigger. See that attached picture:

Is there a way to make the icon buttons as big as the regular bitmap buttons?

Thanks,
Dominic


Picture is here:
Regular bitmap toolbar on top
https://drive.google.com/file/d/1UpKoLQ3gXsjQWeHcuVT-GawQI7nhyaJb/view?usp=sharing


// sample code we use:

IDR_TOOLBAR_VIEW TOOLBAR 32, 32
BEGIN
BUTTON ID_VIEW_HOME
SEPARATOR
BUTTON ID_VIEW_ROLL_LEFT
...
END


CExtTabbedToolControlBarOneNote wndTabbedBarFlat.Create(_T(""), this, ID_VIEW_TABBEDTOOLBAR);
CExtToolControlBar *ptoolbar = m_wndTabbedBarFlat.BarInsert( "View", NULL, -1);
ptoolbar->LoadToolBar( IDR_TOOLBAR_VIEW );

        
         // Later, if icons are loaded for the toolbar buttons:

CExtCmdItem cmd(ID_VIEW_HOME);

bool bWasAddedNew;
g_CmdManager->CmdSetup(g_CmdManager->ProfileNameFromWnd(GetSafeHwnd()), cmd, true, &bWasAddedNew);

// Get pointer so we can add tooltips
CExtCmdItem * p_cmd = g_CmdManager->CmdGetPtr(g_CmdManager->ProfileNameFromWnd(GetSafeHwnd()), ID_VIEW_HOME);
if (p_cmd != NULL)
{
p_cmd->m_sTipTool.LoadString(IDS_VIEW1_TOOLTIP); // Tooltip
p_cmd->m_sTipStatus.LoadString(IDS_VIEW1_STATUS); // Statusbar
}

HICON hIcon =(HICON)::LoadImage(::AfxGetResourceHandle(), MAKEINTRESOURCE( IDI_ICON_VIEW ), IMAGE_ICON, 32, 32, 0);
g_CmdManager->CmdSetIcon(g_CmdManager->ProfileNameFromWnd(GetSafeHwnd()), ID_VIEW_HOME, hIcon, false);

TSELLC Support Dec 27, 2017 - 4:14 AM

This was answered in a separate email.

TSELLC_Support