No horizontal scrollbar in wxTextCtrl on Mac Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
rex666
Earned a small fee
Earned a small fee
Posts: 20
Joined: Mon Nov 08, 2004 12:15 am

No horizontal scrollbar in wxTextCtrl on Mac

Post by rex666 » Tue Oct 13, 2009 12:51 am

Using wxWidgets 2.8.10 on Windows and Mac. I create a window with a wxTextCtrl with the following style:

Code: Select all

m_Output = new wxTextCtrl( this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP | wxTE_RICH );
On Windows, if the text I use to fill the control has lines that are wider than the control width, the control properly shows the horizontal scroll bar. This is the behavior that I want, and it works perfectly.

On OS-X, the space for the scroll bar is there, but the scroll bar itself never shows up. If I remove the wxTE_DONTWRAP style, it will wrap long lines to the control width, and adjust if I resize the control. With the wxTE_DONTWRAP, it doesn't wrap the text, and I can scroll manually by drag selecting with the mouse. But I never see the horizontal scrollbar or the arrow buttons to move it.

This happens on both Intel and PPC macs, running OS-X 10.5

Any ideas? Am I missing something silly? Thanks
-robin

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Tue Oct 13, 2009 1:19 pm

I can reproduce this issue :

Code: Select all

#include "wx/wx.h"

class MyFrame : public wxFrame
    {
    public:
        MyFrame() : wxFrame(NULL, wxID_ANY,  wxT("Hello wxWidgets"), wxPoint(50,50), wxSize(800,600))
        {
            wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
            
            wxTextCtrl* m_Output = new wxTextCtrl( this, wxID_ANY, wxT("Some very very very long text goes here\nAnother very very long line below too\nAnother very very long line below too\nAnother very very long line below too\nAnother very very long line below too"),
                                                  wxDefaultPosition, wxDefaultSize, wxHSCROLL | wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP | wxTE_RICH );
            sizer->Add(m_Output, 1, wxEXPAND | wxALL, 100);
            
            SetSizer(sizer);
        }
    };

class MyApp: public wxApp
    {
        
        wxFrame *frame;
    public:
        bool MyApp::OnInit()
        {
            frame = new MyFrame();
            frame->Show();
            return true;
        } 
        
    };

IMPLEMENT_APP(MyApp)

Unfortunately, that seems like a candidate for bug report.
I also tried with style "wxHSCROLL", but to no avail.
"Keyboard not detected. Press F1 to continue"
-- Windows

rex666
Earned a small fee
Earned a small fee
Posts: 20
Joined: Mon Nov 08, 2004 12:15 am

Post by rex666 » Tue Oct 13, 2009 11:20 pm

I've never done that before. How does one go about posting a bug report?

Thanks
-robin

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Tue Oct 13, 2009 11:33 pm

Simply go there : http://trac.wxwidgets.org/
"Keyboard not detected. Press F1 to continue"
-- Windows

rex666
Earned a small fee
Earned a small fee
Posts: 20
Joined: Mon Nov 08, 2004 12:15 am

Post by rex666 » Wed Oct 14, 2009 5:48 am

Thank you. I posted a new ticket:

http://trac.wxwidgets.org/ticket/11321

I used your sample reproduced project in the ticket, I hope that's OK.

-robin

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Wed Oct 14, 2009 4:34 pm

rex666 wrote:I hope that's OK.
Sure :) Anyway, IIRC all code posted here without explicit licernsing can be assumed to be released under wxWidgets license
"Keyboard not detected. Press F1 to continue"
-- Windows

Post Reply