compilation fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4480 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
2ccf68ce7c
commit
c8f1f08817
@ -211,6 +211,9 @@ bool MyApp::InitToolbar(wxToolBar* toolBar, bool smallicons)
|
||||
toolBar->AddTool(wxID_NEW, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "New file");
|
||||
currentX += width + 5;
|
||||
toolBar->AddTool(wxID_OPEN, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Open file");
|
||||
currentX += width + 5;
|
||||
toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Toggle button 1");
|
||||
|
||||
toolBar->AddSeparator();
|
||||
|
||||
wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO);
|
||||
@ -223,11 +226,7 @@ bool MyApp::InitToolbar(wxToolBar* toolBar, bool smallicons)
|
||||
|
||||
if ( !smallicons )
|
||||
{
|
||||
toolBar->AddSeparator();
|
||||
currentX += width + 5;
|
||||
toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Toggle button 1");
|
||||
currentX += width + 5;
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(wxID_COPY, *(toolBarBitmaps[3]), wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Toggle button 2");
|
||||
currentX += width + 5;
|
||||
toolBar->AddTool(wxID_CUT, *(toolBarBitmaps[4]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Toggle/Untoggle help button");
|
||||
@ -249,7 +248,7 @@ bool MyApp::InitToolbar(wxToolBar* toolBar, bool smallicons)
|
||||
toolBar->Realize();
|
||||
|
||||
// Can delete the bitmaps since they're reference counted
|
||||
int i, max = smallicons ? 2 : WXSIZEOF(toolBarBitmaps);
|
||||
int i, max = smallicons ? 3 : WXSIZEOF(toolBarBitmaps);
|
||||
for (i = 0; i < max; i++)
|
||||
delete toolBarBitmaps[i];
|
||||
|
||||
|
@ -96,6 +96,7 @@ wxToolBarTool::wxToolBarTool(wxControl *control)
|
||||
{
|
||||
m_toolStyle = wxTOOL_STYLE_CONTROL;
|
||||
m_control = control;
|
||||
m_index = control->GetId();
|
||||
}
|
||||
|
||||
wxToolBarTool::~wxToolBarTool()
|
||||
|
@ -134,14 +134,6 @@ bool wxToolBar95::Create(wxWindow *parent,
|
||||
if ( !CreateControl(parent, id, pos, size, style, name) )
|
||||
return FALSE;
|
||||
|
||||
// set up the colors and fonts
|
||||
#if 0
|
||||
wxRGBToColour(m_backgroundColour, GetSysColor(COLOR_BTNFACE));
|
||||
m_foregroundColour = *wxBLACK;
|
||||
|
||||
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
|
||||
#endif
|
||||
|
||||
// prepare flags
|
||||
DWORD msflags = 0; // WS_VISIBLE | WS_CHILD always included
|
||||
if (style & wxBORDER)
|
||||
@ -151,16 +143,22 @@ bool wxToolBar95::Create(wxWindow *parent,
|
||||
if (style & wxTB_FLAT)
|
||||
{
|
||||
if (wxTheApp->GetComCtl32Version() > 400)
|
||||
msflags |= TBSTYLE_FLAT | TBSTYLE_TRANSPARENT;
|
||||
msflags |= TBSTYLE_FLAT;
|
||||
}
|
||||
|
||||
// MSW-specific initialisation
|
||||
if ( !wxControl::MSWCreateControl(TOOLBARCLASSNAME, msflags) )
|
||||
return FALSE;
|
||||
|
||||
// Toolbar-specific initialisation
|
||||
// toolbar-specific post initialisation
|
||||
::SendMessage(GetHwnd(), TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
|
||||
|
||||
// set up the colors and fonts
|
||||
wxRGBToColour(m_backgroundColour, GetSysColor(COLOR_BTNFACE));
|
||||
m_foregroundColour = *wxBLACK;
|
||||
|
||||
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
|
||||
|
||||
// position it
|
||||
int x = pos.x;
|
||||
int y = pos.y;
|
||||
@ -423,7 +421,11 @@ bool wxToolBar95::CreateTools()
|
||||
|
||||
// and position the control itself correctly vertically
|
||||
RECT r;
|
||||
SendMessage(GetHwnd(), TB_GETRECT, 0, (LPARAM)(LPRECT)&r);
|
||||
if ( !SendMessage(GetHwnd(), TB_GETRECT,
|
||||
tool->m_index, (LPARAM)(LPRECT)&r) )
|
||||
{
|
||||
wxLogLastError("TB_GETRECT");
|
||||
}
|
||||
|
||||
int height = r.bottom - r.top;
|
||||
int diff = height - size.y;
|
||||
|
Loading…
Reference in New Issue
Block a user