1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
////////////////////////////////////////////////////////////
///////////////// LE CODE POUR MA BARRE D''OUTILS 1/////////
// Ajoute ma barre d'outils n°1
int iTBCtlID;
int i;
// Crée ma barre d'outils n°1
if (!m_wndMyToolbar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD |
WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS |
CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndMyToolbar.LoadToolBar(IDR_MYTOOLBAR))
{
TRACE0("Echec de création de la barre d'outils\n");
return -1; // Echec de création
}
// Trouve le premier bouton dans ma barre d'outils n°1
iTBCtlID = m_wndMyToolbar.CommandToIndex(ID_FIRST_BOUTON);
if (iTBCtlID >= 0)
{
// Boucle en configurant tous les boutons pour qu'ils agissent
// comme des boutons radio
for (i= iTBCtlID; i < (iTBCtlID + 6); i++)
m_wndMyToolbar.SetButtonStyle(i, TBSTYLE_BUTTON);
}
// Active l'ancrage pour ma barre d'outils n°1
m_wndMyToolbar.EnableDocking(CBRS_ALIGN_ANY);
// Ancre ma barre d'outils n°1
DockControlBar(&m_wndMyToolbar);
///////////////////////////////////////////////////////
////////// FIN DU CODE POUR MA BARRE D'OUTILS 1 ////////// |