Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8760035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:56:59+00:00 2026-06-13T14:56:59+00:00

I’m trying out the wxAuiToolBar class as a replacement for an existing wxToolbar. My

  • 0

I’m trying out the wxAuiToolBar class as a replacement for an existing wxToolbar.

My initialization is working fine — I’m even able to set embedded / vectorized .png files as the bitmaps for the items, which is really cool — but I’d like for the user to be able to specify what toolbar size they want (16×16, 22×22 or 32×32). I think that means calling wxAuiToolBarItem.SetBitmap() for each toolbar item and then wxToolBar.Realize() to redraw the changes. Correct me if there’s a better way to do this!

As an example, I’ve got a standard File toolbar with new/open/save/print buttons. These are added to a member wxAuiManager guy like so:

auiFileToolBar = new wxAuiToolbar(pFrame, ID_AUIFILETOOLBAR, wxDefaultPosition, wxDefaultSize, wxAUI_TB_DEFAULT_STYLE);
auiFileToolBar->AddTool(ID_TBI_FILE_NEW, _("New"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL);
// ... other toolbar items
auiFileToolBar->Realize();
m_AuiManager->AddPane(auiFileToolBar, wxAuiPaneInfo().Name(_T("File")).ToolbarPane().Caption(_T("File")).Layer(10).Top.Gripper(false));

So now that I have all that set up, how do I get at a given ToolBarItem, given the member wxAuiManager (m_AuiManager) associated with the frame? Or is there a better way to resize the toolbars?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:57:00+00:00Added an answer on June 13, 2026 at 2:57 pm

    Okay, so maybe this was a two-part question:

    1. How do I get at a wxAuiToolBarItem once it’s created?
    2. What’s the best way to change the size of a toolbar once it’s created?

    I was able to get at the wxToolBarItem by using the wxAuiToolBar->FindTool() method. I’ve got the toolbar as a member variable, which makes access fairly easy. The code looks something like this:

    wxAuiToolBarItem *tbi;
    tbi = pMainFrame->m_AuiToolbar-FindTool(ID_TBI_FILE_NEW);
    // do something with the toolbar item
    tbi->SetBitmap(random_bitmap_thingy);
    

    For the second part of the question–the question of best practices for switching between a big and little toolbar–I’m not sure that I have an answer. Right now I’ve got a method that calls:

    pMainFrame->m_AuiToolbar->ClearTools();
    

    and then calls m_AuiToolbar->AddTool() with the new bitmaps passed in as params to the AddTool() method. This does seem to work, as I can switch between small and large bitmaps without issue. Is it the best way to do it? No idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group
I know there's a lot of other questions out there that deal with this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.