SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
- return TRUE;
+ return true;
}
#ifndef TBSTYLE_NO_DROPDOWN_ARROW
#if defined(WINCE_WITHOUT_COMMANDBAR)
// Create the menubar.
SHMENUBARINFO mbi;
-
+
memset (&mbi, 0, sizeof (SHMENUBARINFO));
mbi.cbSize = sizeof (SHMENUBARINFO);
mbi.hwndParent = (HWND) GetParent()->GetHWND();
mbi.cBmpImages = 0;
mbi.dwFlags = 0 ; // SHCMBF_EMPTYBAR;
mbi.hInstRes = wxGetInstance();
-
+
if (!SHCreateMenuBar(&mbi))
{
wxFAIL_MSG( _T("SHCreateMenuBar failed") );
return false;
}
-
+
SetHWND((WXHWND) mbi.hwndMB);
#else
HWND hWnd = CommandBar_Create(wxGetInstance(), (HWND) GetParent()->GetHWND(), GetId());
if (menuBar)
menuBar->Create();
-
- return TRUE;
+
+ return true;
}
void wxToolBar::Recreate()
// Realize() later
tool->Attach(this);
- return TRUE;
+ return true;
}
bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
int x;
wxControl *control = tool2->GetControl();
control->GetPosition(&x, NULL);
- control->Move(x - width, -1);
+ control->Move(x - width, wxDefaultCoord);
}
}
- return TRUE;
+ return true;
}
struct wxToolBarIdMapping
static int wxFindIdForwxWinId(int id)
{
int i = 0;
- while (TRUE)
+ while (true)
{
if (sm_ToolBarIdMappingArray[i].m_wxwinId == 0)
return -1;
if ( nTools == 0 )
{
// nothing to do
- return TRUE;
+ return true;
}
#if 0
{
wxToolBarToolBase *tool = node->GetData();
- bool processedThis = TRUE;
+ bool processedThis = true;
TBBUTTON& button = buttons[i];
// radio items
button.fsState |= TBSTATE_CHECKED;
- tool->Toggle(TRUE);
+ tool->Toggle(true);
}
- isRadio = TRUE;
+ isRadio = true;
break;
case wxITEM_CHECK:
// note that we use TB_GETITEMRECT and not TB_GETRECT because the
// latter only appeared in v4.70 of comctl32.dll
RECT r;
- if ( !SendMessage(GetHwnd(), TB_GETITEMRECT,
- index, (LPARAM)(LPRECT)&r) )
+ if ( !::SendMessage(GetHwnd(), TB_GETITEMRECT,
+ index, (LPARAM)(LPRECT)&r) )
{
wxLogLastError(wxT("TB_GETITEMRECT"));
}
tbbi.cbSize = sizeof(tbbi);
tbbi.dwMask = TBIF_SIZE;
tbbi.cx = size.x;
- if ( !SendMessage(GetHwnd(), TB_SETBUTTONINFO,
- tool->GetId(), (LPARAM)&tbbi) )
+ if ( !::SendMessage(GetHwnd(), TB_SETBUTTONINFO,
+ tool->GetId(), (LPARAM)&tbbi) )
{
// the id is probably invalid?
wxLogLastError(wxT("TB_SETBUTTONINFO"));
size_t nSeparators = size.x / widthSep;
for ( size_t nSep = 0; nSep < nSeparators; nSep++ )
{
- if ( !SendMessage(GetHwnd(), TB_INSERTBUTTON,
- index, (LPARAM)&tbb) )
+ if ( !::SendMessage(GetHwnd(), TB_INSERTBUTTON,
+ index, (LPARAM)&tbb) )
{
wxLogLastError(wxT("TB_INSERTBUTTON"));
}
((wxToolBarTool *)tool)->SetSeparatorsCount(nSeparators);
// adjust the controls width to exactly cover the separators
- control->SetSize((nSeparators + 1)*widthSep, -1);
+ control->SetSize((nSeparators + 1)*widthSep, wxDefaultCoord);
}
// position the control itself correctly vertically
if ( diff < 0 )
{
// the control is too high, resize to fit
- control->SetSize(-1, height - 2);
+ control->SetSize(wxDefaultCoord, height - 2);
diff = 2;
}
}
}
- return TRUE;
+ return true;
}
bool wxToolBar::MSWOnNotify(int WXUNUSED(idCtrl),
// in an ANSI application - this seems to be a bug in comctl32.dll v5
UINT code = hdr->code;
if ( (code != (UINT) TTN_NEEDTEXTA) && (code != (UINT) TTN_NEEDTEXTW) )
- return FALSE;
+ return false;
HWND toolTipWnd = (HWND)::SendMessage((HWND)GetHWND(), TB_GETTOOLTIPS, 0, 0);
if ( toolTipWnd != hdr->hwndFrom )
- return FALSE;
+ return false;
LPTOOLTIPTEXT ttText = (LPTOOLTIPTEXT)lParam;
int id = (int)ttText->hdr.idFrom;
void wxToolBar::UpdateSize()
{
// the toolbar size changed
- SendMessage(GetHwnd(), TB_AUTOSIZE, 0, 0);
+ ::SendMessage(GetHwnd(), TB_AUTOSIZE, 0, 0);
// we must also refresh the frame after the toolbar size (possibly) changed
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);