CIwLayoutElementToolbarToggleButton(wxWindow* parent,int id,CIwLayoutMenuDef* Def,wxBitmap icon,void* context) : wxCustomButton(parent,id,icon,wxPoint(-1,-1),wxSize(32,32)),m_Def(Def),m_Context(context) { m_Def->m_Ctrl=this; m_Def->m_Context=m_Context; m_Def->Update(); if (m_Def->m_Action!=NULL && m_Def->m_Action->GetValue()!=0) SetValue(true); SetToolTip(m_Def->m_String); if (m_Def->m_Conditions.size()<2) return; wxString file=CIwTheApp->MakeAbsoluteFilename(L"{viewer}"+m_Def->m_Conditions[1]); SetBitmapSelected(wxBitmap(file,wxBITMAP_TYPE_PNG)); }
wxComboButton(wxComboControl *combo) : wxBitmapButton(combo->GetParent(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | wxBU_EXACTFIT) { m_combo = combo; wxBitmap bmpNormal, bmpFocus, bmpPressed, bmpDisabled; GetRenderer()->GetComboBitmaps(&bmpNormal, &bmpFocus, &bmpPressed, &bmpDisabled); SetBitmapLabel(bmpNormal); SetBitmapFocus(bmpFocus.Ok() ? bmpFocus : bmpNormal); SetBitmapSelected(bmpPressed.Ok() ? bmpPressed : bmpNormal); SetBitmapDisabled(bmpDisabled.Ok() ? bmpDisabled : bmpNormal); SetBestSize(wxDefaultSize); }