Example #1
0
void wxFbPalette::OnSpinDown( wxSpinEvent& )
{
#if wxVERSION_NUMBER < 2900
	int page = m_notebook->GetSelection();
	if ( m_posVector[page] <= 0 ) return;

	m_posVector[page]--;
	wxToolBar *toolbar = m_tv[page];
	PObjectPackage pkg = AppData()->GetPackage( page );
	wxString widget( pkg->GetObjectInfo( m_posVector[page] )->GetClassName() );
	wxBitmap icon = pkg->GetObjectInfo( m_posVector[page] )->GetIconFile();

	#ifdef __WXMAC__
		wxBitmapButton* button = new wxBitmapButton( toolbar, nextId++, icon );
		button->SetToolTip( widget );
		toolbar->InsertControl( 0, button );
	#else
        #if wxVERSION_NUMBER < 2900
            toolbar->InsertTool( 0, nextId++, icon, wxNullBitmap, false, NULL, widget, widget );
        #else
            toolbar->InsertTool( 0, nextId++, widget, icon );
        #endif
	#endif

	toolbar->Realize();
#endif
}
Example #2
0
void wxFbPalette::PopulateToolbar(PObjectPackage pkg, wxToolBar *toolbar)
{
  unsigned int j = 0;
  while (j < pkg->GetObjectCount())
  {
    wxString widget( pkg->GetObjectInfo(j)->GetClassName() );

    wxBitmap icon = pkg->GetObjectInfo(j)->GetIconFile();
    toolbar->AddTool(nextId++, widget, icon, widget);
    toolbar->Realize();
    j++;
  }
}
Example #3
0
void wxFbPalette::OnSpinDown(wxSpinEvent& e)
{
  int page = m_notebook->GetSelection();
  if (m_posVector[page] <= 0) return;

  m_posVector[page]--;
  wxToolBar *toolbar = m_tv[page];
  PObjectPackage pkg = AppData()->GetPackage(page);
  wxString widget( pkg->GetObjectInfo( m_posVector[page] )->GetClassName() );
  wxBitmap icon = pkg->GetObjectInfo(m_posVector[page])->GetIconFile();
  toolbar->InsertTool(0, nextId++, icon, wxNullBitmap, false, NULL, widget, widget);
  toolbar->Realize();
}
Example #4
0
void wxFbPalette::PopulateToolbar( PObjectPackage pkg, wxToolBar *toolbar )
#endif
{
	unsigned int j = 0;
	while ( j < pkg->GetObjectCount() )
	{
		PObjectInfo info = pkg->GetObjectInfo( j );
		if ( info->IsStartOfGroup() )
		{
			toolbar->AddSeparator();
		}
		if ( NULL == info->GetComponent() )
		{
#if wxVERSION_NUMBER < 2900
			LogDebug( _( "Missing Component for Class \"%s\" of Package \"%s\"." ), info->GetClassName().c_str(), pkg->GetPackageName().c_str() );
#else
			LogDebug(_("Missing Component for Class \"" + info->GetClassName() + "\" of Package \"" + pkg->GetPackageName() + "\".") );
#endif
		}
		else
		{
			wxString widget( info->GetClassName() );

			wxBitmap icon = info->GetIconFile();

			#ifdef __WXMAC__
				wxBitmapButton* button = new wxBitmapButton( toolbar, nextId++, icon );
				button->SetToolTip( widget );
				toolbar->AddControl( button );
			#else
				toolbar->AddTool(nextId++, widget, icon, widget);
			#endif

			toolbar->Realize();
		}
		j++;
	}
}