Skip to content

Commit f5574d4

Browse files
committed
Fix first rollup object menu btn crash
It looks like you can't use 0 as nId Closes #3
1 parent 9d59a77 commit f5574d4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Editor/MainTools.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ BOOL CMainTools::OnCommand(WPARAM wParam, LPARAM lParam)
7878
{
7979
int ctrlId = LOWORD(wParam);
8080

81-
OnButtonPressed( ctrlId );
81+
OnButtonPressed( ctrlId - 1 );
8282
return TRUE;
8383
}
8484

@@ -140,7 +140,7 @@ void CMainTools::CreateButtons()
140140

141141
//button->Create( category,WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_AUTORADIOBUTTON|BS_PUSHLIKE,brc,this,i );
142142
//button->Create( category,WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,brc,this,i );
143-
button->Create( category,WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_PUSHBUTTON,brc,this,i );
143+
ASSERT(button->Create( category,WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_PUSHBUTTON,brc,this,i + 1 ));
144144
button->SetFont( CFont::FromHandle( (HFONT)::GetStockObject(DEFAULT_GUI_FONT)) );
145145
//button->ModifyStyleEx( 0,WS_EX_STATICEDGE,SWP_FRAMECHANGED );
146146
button->SetCheck(0);

0 commit comments

Comments
 (0)