Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

toolbar bottom edge is not shown corectly under C::B build with wx git master

<< < (6/7) > >>

oBFusCATed:
Search the wiki for tutorials about building. For experiments you can use autotools. Just set the --prefix to something in your home folder.
This method Manager::CreateEmptyToolbar is probably the place to start the investigation.

cacb:

--- Quote from: oBFusCATed on March 14, 2017, 09:08:22 am ---Search the wiki for tutorials about building. For experiments you can use autotools. Just set the --prefix to something in your home folder.
This method Manager::CreateEmptyToolbar is probably the place to start the investigation.

--- End quote ---

I added
    toolbar->SetToolPacking(0);
    toolbar->SetToolSeparation(0);
in Manager::CreateEmptyToolbar and rebuilt C::B, but I could not observe any visual difference.

Then I tried
    toolbar->SetMargins(0,0);
This also did not make any difference that I could observe.

oBFusCATed:
Then the next step is to replace wxToolbar with wxAuiToolbar in C::B or vice-versa in auidemo and see if this fixes/reproduces it.

ollydbg:
For this issue, I create a simple demo code to demonstrate.


--- Code: ---
#include <wx/wx.h>
#include <wx/frame.h>
#include <wx/artprov.h>
#include <wx/aui/aui.h>

/*---------------------------------------------------------------------------------------------------------*/
// HEADER

enum
{
ID_ShowNormal = wxID_HIGHEST,
    ID_ShowBug,
    ID_ShowWorkaround,
};

class MyApp : public wxApp
{
public:
bool OnInit();
};

class MyFrame : public wxFrame
{
public:
MyFrame(wxFrame *parent,
wxWindowID id = wxID_ANY,
const wxString& title = _T("wxToolBar Bug Demo"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE);
virtual ~MyFrame();

wxToolBar *m_tb;
wxToolBar *m_tb2;
    wxToolBar *m_tb3;
wxAuiManager m_mngr;

DECLARE_EVENT_TABLE()
};

/*---------------------------------------------------------------------------------------------------------*/
// SOURCE

IMPLEMENT_APP(MyApp)

bool MyApp::OnInit()
{
MyFrame* frame = new MyFrame((wxFrame *) NULL, wxID_ANY,
_T("wxToolbar Bug Demo"),
wxPoint(100, 100), wxSize(550, 300));

frame->Show(true);

wxInitAllImageHandlers();

SetTopWindow(frame);

return true;
}

BEGIN_EVENT_TABLE(MyFrame,wxFrame)
END_EVENT_TABLE()

MyFrame::MyFrame(wxFrame* parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style)
: wxFrame(parent, id, title, pos, size, style)
,m_tb(0), m_tb2(0),m_tb3(0)
{
m_mngr.SetManagedWindow(this);
wxMenu *menuFile=new wxMenu;
menuFile->Append(ID_ShowNormal,wxT("Show Normal"));
menuFile->Append(ID_ShowBug,wxT("Show Bug"));
menuFile->Append(ID_ShowWorkaround,wxT("Show Workaround"));
wxMenuBar *menuBar = new wxMenuBar();
menuBar->Append(menuFile,wxT("Mode"));
SetMenuBar(menuBar);
//m_mngr.Update();



m_tb=new wxToolBar(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxTB_FLAT|wxTB_NODIVIDER);
//m_tb->AddTool(wxID_ANY,wxT("tool1"),wxArtProvider::GetBitmap(wxART_FILE_OPEN,wxART_TOOLBAR));
//m_tb->AddTool(wxID_ANY,wxT("tool2"),wxArtProvider::GetBitmap(wxART_FILE_SAVE,wxART_TOOLBAR));
    m_tb->AddTool(wxID_ANY,wxT("tool1"),wxBitmap(16,15));
m_tb->AddTool(wxID_ANY,wxT("tool2"),wxBitmap(16,15));

m_tb->Realize();
wxAuiPaneInfo pi = wxAuiPaneInfo() .Name(wxT("toolbar"))
.Caption(wxT("toolbar"))
.ToolbarPane()
.Floatable()
.Direction(wxAUI_DOCK_TOP) // see also ticket #9722
.LeftDockable(false)
.RightDockable(false);
m_mngr.AddPane(m_tb,pi);

    m_tb2=new wxToolBar(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxTB_FLAT|wxTB_NODIVIDER);
//m_tb2->AddTool(wxID_ANY,wxT("tool1"),wxArtProvider::GetBitmap(wxART_FILE_OPEN,wxART_TOOLBAR));
//m_tb2->AddTool(wxID_ANY,wxT("tool2"),wxArtProvider::GetBitmap(wxART_FILE_SAVE,wxART_TOOLBAR));
m_tb2->AddTool(wxID_ANY,wxT("tool1"),wxBitmap(16,15));
m_tb2->AddTool(wxID_ANY,wxT("tool2"),wxBitmap(16,15));
m_tb2->Realize();
wxAuiPaneInfo pi2 = wxAuiPaneInfo() .Name(wxT("toolbar2"))
.Caption(wxT("toolbar2"))
.ToolbarPane()
.Floatable()
.Direction(wxAUI_DOCK_TOP) // see also ticket #9722
.LeftDockable(false)
.RightDockable(false);
m_mngr.AddPane(m_tb2,pi2);


    m_tb3=new wxToolBar(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxTB_FLAT|wxTB_NODIVIDER);
//m_tb3->AddTool(wxID_ANY,wxT("tool1"),wxArtProvider::GetBitmap(wxART_FILE_OPEN,wxART_TOOLBAR));
//m_tb3->AddTool(wxID_ANY,wxT("tool2"),wxArtProvider::GetBitmap(wxART_FILE_SAVE,wxART_TOOLBAR));
m_tb3->AddTool(wxID_ANY,wxT("tool1"),wxBitmap(16,15));
m_tb3->AddTool(wxID_ANY,wxT("tool2"),wxBitmap(16,15));
wxChoice* choice = new wxChoice(m_tb3, wxID_ANY);
    choice->AppendString(wxT("One choice"));
    choice->AppendString(wxT("Another choice"));
    m_tb3->AddControl(choice);
m_tb3->Realize();
wxAuiPaneInfo pi3 = wxAuiPaneInfo() .Name(wxT("toolbar3"))
.Caption(wxT("toolbar3"))
.ToolbarPane()
.Floatable()
.Direction(wxAUI_DOCK_TOP) // see also ticket #9722
.LeftDockable(false)
.RightDockable(false);
m_mngr.AddPane(m_tb3,pi3);

m_mngr.Update();
}

MyFrame::~MyFrame()
{
m_mngr.UnInit();
}


--- End code ---

When the toolbar button is small, such as "16*15", then you drag the toolbar to move horizontally, you see the screen shot as attachment.

If you use the standard toolbar size, such as the commented line, you don't have such issue.



ollydbg:
I report the bug here: #18138 (wxToolbar managed by wxAui: the bottom edge of the toolbar are not drawn correctly) – wxWidgets

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version