void wxToolBarBase::AdjustToolBitmapSize()
{
    if ( HasFlag(wxTB_NOICONS) )
    {
        SetToolBitmapSize(wxSize(0, 0));
        return;
    }

    const wxSize sizeOrig(m_defaultWidth, m_defaultHeight);

    wxSize sizeActual(sizeOrig);

#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
#   pragma ivdep
#   pragma swp
#   pragma unroll
#   pragma prefetch
#   if 0
#       pragma simd noassert
#   endif
#endif /* VDM auto patch */
    for ( wxToolBarToolsList::const_iterator i = m_tools.begin();
          i != m_tools.end();
          ++i )
    {
        const wxBitmap& bmp = (*i)->GetNormalBitmap();
        if ( bmp.IsOk() )
            sizeActual.IncTo(bmp.GetScaledSize());
    }

    if ( sizeActual != sizeOrig )
        SetToolBitmapSize(sizeActual);
}
Exemple #2
0
	CBreakPointBar(CBreakPointWindow* parent, const wxWindowID id)
		: wxAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
				wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
	{
		SetToolBitmapSize(wxSize(24, 24));

		m_Bitmaps[Toolbar_Delete] = wxBitmap(wxGetBitmapFromMemory(toolbar_delete_png).ConvertToImage().Rescale(24, 24));
		m_Bitmaps[Toolbar_Add_BP] = wxBitmap(wxGetBitmapFromMemory(toolbar_add_breakpoint_png).ConvertToImage().Rescale(24, 24));
		m_Bitmaps[Toolbar_Add_MC] = wxBitmap(wxGetBitmapFromMemory(toolbar_add_memcheck_png).ConvertToImage().Rescale(24, 24));

		AddTool(ID_DELETE, wxT("Delete"), m_Bitmaps[Toolbar_Delete]);
		Bind(wxEVT_COMMAND_TOOL_CLICKED, &CBreakPointWindow::OnDelete, parent, ID_DELETE);

		AddTool(ID_CLEAR, wxT("Clear"), m_Bitmaps[Toolbar_Delete]);
		Bind(wxEVT_COMMAND_TOOL_CLICKED, &CBreakPointWindow::OnClear, parent, ID_CLEAR);

		AddTool(ID_ADDBP, wxT("+BP"), m_Bitmaps[Toolbar_Add_BP]);
		Bind(wxEVT_COMMAND_TOOL_CLICKED, &CBreakPointWindow::OnAddBreakPoint, parent, ID_ADDBP);

		// Add memory breakpoints if you can use them
		if (Memory::AreMemoryBreakpointsActivated())
		{
			AddTool(ID_ADDMC, wxT("+MC"), m_Bitmaps[Toolbar_Add_MC]);
			Bind(wxEVT_COMMAND_TOOL_CLICKED, &CBreakPointWindow::OnAddMemoryCheck, parent, ID_ADDMC);
		}

		AddTool(ID_LOAD, wxT("Load"), m_Bitmaps[Toolbar_Delete]);
		Bind(wxEVT_COMMAND_TOOL_CLICKED, &CBreakPointWindow::LoadAll, parent, ID_LOAD);

		AddTool(ID_SAVE, wxT("Save"), m_Bitmaps[Toolbar_Delete]);
		Bind(wxEVT_COMMAND_TOOL_CLICKED, &CBreakPointWindow::Event_SaveAll, parent, ID_SAVE);
	}
wxToolBar* ImageViewer::buildToolbar()
{
    auto toolbar = new wxToolBar(this, wxID_ANY);
    auto id      = this->NewControlId(4);

    // Add the newly generated IDs
    for (uint i = 0; i < 4; i++) {
        m_toolbarButtonIds.Add(id++);
    }

    // Load all toolbar button icons
    toolbar->SetToolBitmapSize(wxSize(16, 16));
    m_toolbarButtonIcons.push_back(data::loadPNG(data::toggle_red_png,   data::toggle_red_png_size));
    m_toolbarButtonIcons.push_back(data::loadPNG(data::toggle_green_png, data::toggle_green_png_size));
    m_toolbarButtonIcons.push_back(data::loadPNG(data::toggle_blue_png,  data::toggle_blue_png_size));
    m_toolbarButtonIcons.push_back(data::loadPNG(data::toggle_alpha_png, data::toggle_alpha_png_size));

    // Toggle channel buttons
    for (uint i = 0; i < 4; i++) {
        auto button = new wxToolBarToolBase(toolbar, m_toolbarButtonIds[i], wxEmptyString, m_toolbarButtonIcons[i], m_toolbarButtonIcons[i], wxITEM_CHECK);
        toolbar->AddTool(button);
        button->Toggle(true);
        m_toolbarButtons.Add(button);
        this->Connect(m_toolbarButtonIds[i], wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(ImageViewer::onToolbarClickedEvt));
    }

    toolbar->Realize();
    return toolbar;
}
  CBreakPointBar(CBreakPointWindow* parent, const wxWindowID id)
      : DolphinAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
                          wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
  {
    wxSize bitmap_size = FromDIP(wxSize(24, 24));
    SetToolBitmapSize(bitmap_size);

    static const std::array<const char* const, Num_Bitmaps> image_names{
        {"toolbar_debugger_delete", "toolbar_add_breakpoint", "toolbar_add_memorycheck"}};
    for (std::size_t i = 0; i < image_names.size(); ++i)
      m_Bitmaps[i] =
          WxUtils::LoadScaledResourceBitmap(image_names[i], this, bitmap_size, wxDefaultSize,
                                            WxUtils::LSI_SCALE_DOWN | WxUtils::LSI_ALIGN_CENTER);

    AddTool(ID_DELETE, _("Delete"), m_Bitmaps[Toolbar_Delete]);
    Bind(wxEVT_TOOL, &CBreakPointWindow::OnDelete, parent, ID_DELETE);

    AddTool(ID_CLEAR, _("Clear"), m_Bitmaps[Toolbar_Delete]);
    Bind(wxEVT_TOOL, &CBreakPointWindow::OnClear, parent, ID_CLEAR);

    AddTool(ID_ADDBP, "+BP", m_Bitmaps[Toolbar_Add_BP]);
    Bind(wxEVT_TOOL, &CBreakPointWindow::OnAddBreakPoint, parent, ID_ADDBP);

    AddTool(ID_ADDMC, "+MBP", m_Bitmaps[Toolbar_Add_MC]);
    Bind(wxEVT_TOOL, &CBreakPointWindow::OnAddMemoryCheck, parent, ID_ADDMC);

    AddTool(ID_LOAD, _("Load"), m_Bitmaps[Toolbar_Delete]);
    Bind(wxEVT_TOOL, &CBreakPointWindow::Event_LoadAll, parent, ID_LOAD);

    AddTool(ID_SAVE, _("Save"), m_Bitmaps[Toolbar_Delete]);
    Bind(wxEVT_TOOL, &CBreakPointWindow::Event_SaveAll, parent, ID_SAVE);
  }
Exemple #5
0
void wxGISToolBar::Serialize(IApplication* pApp, wxXmlNode* pNode, bool bStore)
{
	if(bStore)
	{
		pNode->AddProperty(wxT("size"), wxString::Format(wxT("%u"), GetToolBitmapSize().GetWidth()));
		pNode->AddProperty(wxT("LeftDockable"), m_bLDock == true ? wxT("t") : wxT("f"));
		pNode->AddProperty(wxT("RightDockable"), m_bRDock == true ? wxT("t") : wxT("f"));
		wxGISCommandBar::Serialize(pApp, pNode, bStore);
	}
	else
	{
		m_bLDock = pNode->GetPropVal(wxT("LeftDockable"), wxT("f")) == wxT("f") ? false : true;
		m_bRDock = pNode->GetPropVal(wxT("RightDockable"), wxT("f")) == wxT("f") ? false : true;
		short iSize = wxAtoi(pNode->GetPropVal(wxT("size"), wxT("16")));
		SetToolBitmapSize(wxSize(iSize,iSize));

		wxAuiToolBarItemArray prepend_items;
		wxAuiToolBarItemArray append_items;
		ICommand* pCmd = pApp->GetCommand(wxT("wxGISCommonCmd"), 2);
		if(pCmd)
		{				
			wxAuiToolBarItem item;
			item.SetKind(wxITEM_SEPARATOR);
			append_items.Add(item);
			item.SetKind(pCmd->GetKind());
			item.SetId(pCmd->GetID());
			item.SetLabel(pCmd->GetCaption());
			append_items.Add(item);
		}
		SetCustomOverflowItems(prepend_items, append_items);
		wxGISCommandBar::Serialize(pApp, pNode, bStore);
		Realize();
	}
}
WxAnimTreeEditorToolBar::WxAnimTreeEditorToolBar( wxWindow* InParent, wxWindowID InID )
	:	wxToolBar( InParent, InID, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL | wxTB_3DBUTTONS )
{
	// create the return to parent sequence button
	TickTreeB.Load(TEXT("AnimTree_TickTree"));
	PreviewNodeB.Load(TEXT("AnimTree_PrevNode"));
	ShowNodeWeightB.Load(TEXT("AnimTree_ShowNodeWeight"));
	ShowBonesB.Load(TEXT("AnimTree_ShowBones"));
	ShowBoneNamesB.Load(TEXT("AnimTree_ShowBoneNames"));
	ShowWireframeB.Load(TEXT("AnimTree_ShowWireframe"));
	ShowFloorB.Load(TEXT("AnimTree_ShowFloor"));
	CurvesB.Load(TEXT("KIS_DrawCurves"));

	SetToolBitmapSize( wxSize( 16, 16 ) );

	AddSeparator();
	AddCheckTool(IDM_ANIMTREE_TOGGLETICKTREE, TEXT("PauseAnimTree"), TickTreeB, wxNullBitmap, TEXT("PauseAnimTree"));
	AddSeparator();
	AddTool(IDM_ANIMTREE_PREVIEWSELECTEDNODE, PreviewNodeB, TEXT("PreviewSelectedNode"));
	AddCheckTool(IDM_ANIMTREE_SHOWNODEWEIGHT, TEXT("ShowNodeWeight"), ShowNodeWeightB, wxNullBitmap, TEXT("ShowNodeWeight"));
	AddSeparator();
	AddCheckTool(IDM_ANIMTREE_SHOWHIERARCHY, TEXT("ShowSkeleton"), ShowBonesB, wxNullBitmap, TEXT("ShowSkeleton"));
	AddCheckTool(IDM_ANIMTREE_SHOWBONENAMES, TEXT("ShowBoneNames"), ShowBoneNamesB, wxNullBitmap, TEXT("ShowBoneNames"));
	AddCheckTool(IDM_ANIMTREE_SHOWWIREFRAME, TEXT("ShowWireframe"), ShowWireframeB, wxNullBitmap, TEXT("ShowWireframe"));
	AddCheckTool(IDM_ANIMTREE_SHOWFLOOR, TEXT("ShowFloor"), ShowFloorB, wxNullBitmap, TEXT("ShowFloor"));
	AddCheckTool(IDM_ANIMTREE_SHOWCURVES, TEXT("ToggleCurvedConnections"), CurvesB, wxNullBitmap, TEXT("ToggleCurvedConnections"));

	Realize();
}
Exemple #7
0
  CBreakPointBar(CBreakPointWindow* parent, const wxWindowID id)
      : DolphinAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
                          wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
  {
    SetToolBitmapSize(wxSize(24, 24));

    m_Bitmaps[Toolbar_Delete] = WxUtils::LoadResourceBitmap("toolbar_debugger_delete");
    m_Bitmaps[Toolbar_Add_BP] = WxUtils::LoadResourceBitmap("toolbar_add_breakpoint");
    m_Bitmaps[Toolbar_Add_MC] = WxUtils::LoadResourceBitmap("toolbar_add_memorycheck");

    AddTool(ID_DELETE, _("Delete"), m_Bitmaps[Toolbar_Delete]);
    Bind(wxEVT_TOOL, &CBreakPointWindow::OnDelete, parent, ID_DELETE);

    AddTool(ID_CLEAR, _("Clear"), m_Bitmaps[Toolbar_Delete]);
    Bind(wxEVT_TOOL, &CBreakPointWindow::OnClear, parent, ID_CLEAR);

    AddTool(ID_ADDBP, "+BP", m_Bitmaps[Toolbar_Add_BP]);
    Bind(wxEVT_TOOL, &CBreakPointWindow::OnAddBreakPoint, parent, ID_ADDBP);

    AddTool(ID_ADDMC, "+MC", m_Bitmaps[Toolbar_Add_MC]);
    Bind(wxEVT_TOOL, &CBreakPointWindow::OnAddMemoryCheck, parent, ID_ADDMC);

    AddTool(ID_LOAD, _("Load"), m_Bitmaps[Toolbar_Delete]);
    Bind(wxEVT_TOOL, &CBreakPointWindow::Event_LoadAll, parent, ID_LOAD);

    AddTool(ID_SAVE, _("Save"), m_Bitmaps[Toolbar_Delete]);
    Bind(wxEVT_TOOL, &CBreakPointWindow::Event_SaveAll, parent, ID_SAVE);
  }
CWatchToolbar(CWatchWindow* parent, const wxWindowID id)
	: wxAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
			wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
{
	SetToolBitmapSize(wxSize(16, 16));

	m_Bitmaps[Toolbar_File] = wxBitmap(wxGetBitmapFromMemory(toolbar_delete_png).ConvertToImage().Rescale(16, 16));

	AddTool(ID_LOAD, _("Load"), m_Bitmaps[Toolbar_File]);
	Bind(wxEVT_TOOL, &CWatchWindow::Event_LoadAll, parent, ID_LOAD);

	AddTool(ID_SAVE, _("Save"), m_Bitmaps[Toolbar_File]);
	Bind(wxEVT_TOOL, &CWatchWindow::Event_SaveAll, parent, ID_SAVE);
}
Exemple #9
0
  void InitialiseThemedBitmaps()
  {
    wxSize bitmap_size = FromDIP(wxSize(24, 24));
    SetToolBitmapSize(bitmap_size);

    static const std::array<const char* const, Num_Bitmaps> m_image_names{
        {"debugger_load", "debugger_save"}};

    for (std::size_t i = 0; i < m_image_names.size(); ++i)
    {
      m_Bitmaps[i] =
          WxUtils::LoadScaledThemeBitmap(m_image_names[i], this, bitmap_size, wxDefaultSize,
                                         WxUtils::LSI_SCALE_DOWN | WxUtils::LSI_ALIGN_CENTER);
    }
  }
Exemple #10
0
void wxToolBarBase::AdjustToolBitmapSize()
{
    if ( HasFlag(wxTB_NOICONS) )
    {
        SetToolBitmapSize(wxSize(0, 0));
        return;
    }

    const wxSize sizeOrig(m_defaultWidth, m_defaultHeight);

    wxSize sizeActual(sizeOrig);

    for ( wxToolBarToolsList::const_iterator i = m_tools.begin();
          i != m_tools.end();
          ++i )
    {
        const wxBitmap& bmp = (*i)->GetNormalBitmap();
        if ( bmp.IsOk() )
            sizeActual.IncTo(bmp.GetSize());
    }

    if ( sizeActual != sizeOrig )
        SetToolBitmapSize(sizeActual);
}
void MainToolBar::set_properties()
{
#ifdef __WXMAC__
	SetToolBitmapSize(wxSize(96, 24));
    AddTool(IDM_MENU, wxT("Menu"), wxBitmap(menu_xpm), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""));
	AddSeparator();
    AddTool(IDM_SHOW_DESK, wxT("Desk"), wxBitmap(desk_xpm), wxNullBitmap, wxITEM_RADIO, wxT(""), wxT(""));
    AddTool(IDM_SHOW_DESK_SETUP, wxT("Desk Setup"), wxBitmap(desk_setup_xpm), wxNullBitmap, wxITEM_RADIO, wxT(""), wxT(""));
    AddTool(IDM_SHOW_FUNCTION_SETUP, wxT("Function Setup"), wxBitmap(function_setup_xpm), wxNullBitmap, wxITEM_RADIO, wxT(""), wxT(""));
    AddSeparator();
    AddTool(IDM_IO_SETUP, wxT("IO Setup"), wxBitmap(io_setup_xpm), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""));
    AddTool(IDM_GROUP_SETUP, wxT("Group Setup"), wxBitmap(group_setup_xpm), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""));
    AddTool(IDM_CHANNEL_SETUP, wxT("Channel Setup"), wxBitmap(channel_setup_xpm), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""));
    AddTool(IDM_LIBRARY, wxT("Library"), wxBitmap(library_xpm), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""));
    AddTool(IDM_DMX_PATCH, wxT("DMX Patch"), wxBitmap(dmx_patch_xpm), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""));
    AddSeparator();
    AddTool(IDM_SETUP_OUTPUT, wxT("Setup Output"), wxBitmap(setup_output_xpm), wxNullBitmap, wxITEM_CHECK, wxT(""), wxT(""));
#else
 	SetToolBitmapSize(wxSize(0, 0));
    AddTool(IDM_MENU, wxT("Menu"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""));
	AddSeparator();
    AddTool(IDM_SHOW_DESK, wxT("Desk"), wxNullBitmap, wxNullBitmap, wxITEM_RADIO, wxT(""), wxT(""));
    AddTool(IDM_SHOW_DESK_SETUP, wxT("Desk Setup"), wxNullBitmap, wxNullBitmap, wxITEM_RADIO, wxT(""), wxT(""));
    AddTool(IDM_SHOW_FUNCTION_SETUP, wxT("Function Setup"), wxNullBitmap, wxNullBitmap, wxITEM_RADIO, wxT(""), wxT(""));
    AddSeparator();
    AddTool(IDM_IO_SETUP, wxT("IO Setup"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""));
    AddTool(IDM_GROUP_SETUP, wxT("Group Setup"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""));
    AddTool(IDM_CHANNEL_SETUP, wxT("Channel Setup"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""));
    AddTool(IDM_LIBRARY, wxT("Library"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""));
    AddTool(IDM_DMX_PATCH, wxT("DMX Patch"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""));
    AddSeparator();
    AddTool(IDM_SETUP_OUTPUT, wxT("Setup Output"), wxNullBitmap, wxNullBitmap, wxITEM_CHECK, wxT(""), wxT(""));
#endif
	
    Realize();
}
Exemple #12
0
HRPosToolBar::HRPosToolBar(wxWindow *parent)
: wxToolBar(parent, wxID_ANY, wxPoint(20,20)/*DefaultPosition*/,
	wxSize(parent->GetSize().GetWidth(), 30), wxBORDER_NONE|wxTB_HORIZONTAL|wxTB_NODIVIDER|wxTB_FLAT|wxTB_TEXT|wxTAB_TRAVERSAL )
{
  try
  {
	SetToolBitmapSize(wxSize(30, 30));
	AddTool(1, local->get("HR_f", "add_pos", "Add"), HR_tool(2));  //BITMAP_TYPE_BMP
	AddTool(3, local->get("HR_f", "edit_pos", "Edit"), HR_tool(1));  //BITMAP_TYPE_BMP
	AddTool(2, local->get("HR_f", "del_pos", "Delete"), HR_tool(0));

	AddSeparator();
	
	if (!(users->user().administrator())) 
	{
		EnableTool(1, false);
		EnableTool(2, false);
		EnableTool(3, false);
	}

	if (!positionrole->loaded()) positionrole->load_positionrole();
	wxString pposition [1000];
	for ( int i=0; i< positionrole->size(); i++) pposition[i] = to_uc(positionrole->get_name(i));
	lb_position = new HRListBox(parent, positionrole->size(), pposition);
	wxCommandEvent evt = wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED, 0);  
	lb_position->OnClickPos(evt);
	lb_position->Select(0);
	pos = 0;

	Realize();
  }
  catch(exception_t &e)
  {
	wxMessageBox(to_uc(e.message()));
  }
  catch(std::exception &e)
  {
	wxMessageBox(to_uc(e.what()));
  }
  catch(...)
  {
	exception_t e(5022, "unexpected error", "HRPosToolBar::HRPosToolBar");
	wxMessageBox(to_uc(e.message()));
  }
}