compilation fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4480 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-11-12 03:12:51 +00:00
parent 2ccf68ce7c
commit c8f1f08817
3 changed files with 18 additions and 16 deletions

View File

@@ -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"); toolBar->AddTool(wxID_NEW, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "New file");
currentX += width + 5; currentX += width + 5;
toolBar->AddTool(wxID_OPEN, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Open file"); 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(); toolBar->AddSeparator();
wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO); wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO);
@@ -223,11 +226,7 @@ bool MyApp::InitToolbar(wxToolBar* toolBar, bool smallicons)
if ( !smallicons ) if ( !smallicons )
{ {
toolBar->AddSeparator();
currentX += width + 5; 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"); toolBar->AddTool(wxID_COPY, *(toolBarBitmaps[3]), wxNullBitmap, TRUE, currentX, -1, (wxObject *) NULL, "Toggle button 2");
currentX += width + 5; currentX += width + 5;
toolBar->AddTool(wxID_CUT, *(toolBarBitmaps[4]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Toggle/Untoggle help button"); 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(); toolBar->Realize();
// Can delete the bitmaps since they're reference counted // 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++) for (i = 0; i < max; i++)
delete toolBarBitmaps[i]; delete toolBarBitmaps[i];

View File

@@ -96,6 +96,7 @@ wxToolBarTool::wxToolBarTool(wxControl *control)
{ {
m_toolStyle = wxTOOL_STYLE_CONTROL; m_toolStyle = wxTOOL_STYLE_CONTROL;
m_control = control; m_control = control;
m_index = control->GetId();
} }
wxToolBarTool::~wxToolBarTool() wxToolBarTool::~wxToolBarTool()

View File

@@ -134,14 +134,6 @@ bool wxToolBar95::Create(wxWindow *parent,
if ( !CreateControl(parent, id, pos, size, style, name) ) if ( !CreateControl(parent, id, pos, size, style, name) )
return FALSE; 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 // prepare flags
DWORD msflags = 0; // WS_VISIBLE | WS_CHILD always included DWORD msflags = 0; // WS_VISIBLE | WS_CHILD always included
if (style & wxBORDER) if (style & wxBORDER)
@@ -151,16 +143,22 @@ bool wxToolBar95::Create(wxWindow *parent,
if (style & wxTB_FLAT) if (style & wxTB_FLAT)
{ {
if (wxTheApp->GetComCtl32Version() > 400) if (wxTheApp->GetComCtl32Version() > 400)
msflags |= TBSTYLE_FLAT | TBSTYLE_TRANSPARENT; msflags |= TBSTYLE_FLAT;
} }
// MSW-specific initialisation // MSW-specific initialisation
if ( !wxControl::MSWCreateControl(TOOLBARCLASSNAME, msflags) ) if ( !wxControl::MSWCreateControl(TOOLBARCLASSNAME, msflags) )
return FALSE; return FALSE;
// Toolbar-specific initialisation // toolbar-specific post initialisation
::SendMessage(GetHwnd(), TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); ::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 // position it
int x = pos.x; int x = pos.x;
int y = pos.y; int y = pos.y;
@@ -423,7 +421,11 @@ bool wxToolBar95::CreateTools()
// and position the control itself correctly vertically // and position the control itself correctly vertically
RECT r; 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 height = r.bottom - r.top;
int diff = height - size.y; int diff = height - size.y;