Author Topic: Problem with wxSmith  (Read 6699 times)

Offline TexasRanger

  • Single posting newcomer
  • *
  • Posts: 4
Problem with wxSmith
« on: November 21, 2010, 03:42:57 am »
Hi, does someone know how to put layout the bitmap in backgroud and buttons correctly?
I can't do it. When I'm clicking on buttons and chosing 'send to front' it doesn't work, buttons are still behind bitmap.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Problem with wxSmith
« Reply #1 on: November 21, 2010, 09:47:27 am »
Sorry, I don't get you.

Please describe more exactly what you try to do.
And explain step by step what you have done.
Or attach a simple project that does not work.

Offline TexasRanger

  • Single posting newcomer
  • *
  • Posts: 4
Re: Problem with wxSmith
« Reply #2 on: November 21, 2010, 11:29:47 am »
This picture shows the problem.
I can't bring this button on front.


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Problem with wxSmith
« Reply #3 on: November 21, 2010, 11:54:11 am »
Did you try to send the bitmap and/or the textctrl to back ?
Works for me here (debian 64 bit wx2.8.10).

Offline TexasRanger

  • Single posting newcomer
  • *
  • Posts: 4
Re: Problem with wxSmith
« Reply #4 on: November 21, 2010, 11:57:26 am »
Yes, I've tried. Not working for me [Windows Vista].

The code also looks for me fine:
Code
wxwidgetstest4Frame::wxwidgetstest4Frame(wxWindow* parent,wxWindowID id)
{
    //(*Initialize(wxwidgetstest4Frame)
    wxMenuItem* MenuItem2;
    wxMenuItem* MenuItem1;
    wxMenu* Menu1;
    wxMenuBar* MenuBar1;
    wxMenu* Menu2;

    Create(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY"));
    SetClientSize(wxSize(640,480));
    SetMinSize(wxSize(640,480));
    SetMaxSize(wxSize(640,480));
    StaticBitmap1 = new wxStaticBitmap(this, ID_STATICBITMAP1, wxBitmap(wxImage(_T("E:\\prywatne\\study\\informatics\\C,C++\\codebloks\\C++\\wxwidgetstest4\\Eksplodia kopia.bmp")).Rescale(wxSize(640,480).GetWidth(),wxSize(640,480).GetHeight())), wxDefaultPosition, wxSize(640,480), 0, _T("ID_STATICBITMAP1"));
    StaticBitmap1->Disable();
    TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, wxEmptyString, wxPoint(24,48), wxSize(136,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
    TextCtrl1->Disable();
    Button1 = new wxButton(this, ID_BUTTON1, _("Rozpocznij odliczanie"), wxPoint(32,72), wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
    Button1->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENU));
    Button1->SetHelpText(_T("Rozpocznij odliczanie"));
    MenuBar1 = new wxMenuBar();
    Menu1 = new wxMenu();
    MenuItem1 = new wxMenuItem(Menu1, idMenuQuit, _("Quit\tAlt-F4"), _("Quit the application"), wxITEM_NORMAL);
    Menu1->Append(MenuItem1);
    MenuBar1->Append(Menu1, _("&File"));
    Menu2 = new wxMenu();
    MenuItem2 = new wxMenuItem(Menu2, idMenuAbout, _("About\tF1"), _("Show info about this application"), wxITEM_NORMAL);
    Menu2->Append(MenuItem2);
    MenuBar1->Append(Menu2, _("Help"));
    SetMenuBar(MenuBar1);
    StatusBar1 = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1"));
    int __wxStatusBarWidths_1[1] = { -1 };
    int __wxStatusBarStyles_1[1] = { wxSB_NORMAL };
    StatusBar1->SetFieldsCount(1,__wxStatusBarWidths_1);
    StatusBar1->SetStatusStyles(1,__wxStatusBarStyles_1);
    SetStatusBar(StatusBar1);
« Last Edit: November 21, 2010, 12:05:20 pm by TexasRanger »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Problem with wxSmith
« Reply #5 on: November 21, 2010, 12:01:40 pm »
Just a guess, this can be a vista/windows problem, because wxWidgets uses native conrols wherever possible and windows native controls sometimes behave a little strange (or at least unexpected).
My Vista-vm is broken, but I will try to repair it and/or test on XP and win7.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Problem with wxSmith
« Reply #6 on: November 21, 2010, 12:48:56 pm »
Happens on XP also, so it seems to be a wxMSW or more likely windows problem.

As workaround, you can create a wxPanel and place just the button into it.

Offline TexasRanger

  • Single posting newcomer
  • *
  • Posts: 4
Re: Problem with wxSmith
« Reply #7 on: November 21, 2010, 01:20:47 pm »
Thx very much. It seems very strange for me that none has solved that bug. Does none use wxSmith on windows? And I think that this is very serious bug for programmers.  :?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Problem with wxSmith
« Reply #8 on: November 21, 2010, 01:59:25 pm »
Thx very much. It seems very strange for me that none has solved that bug. Does none use wxSmith on windows? And I think that this is very serious bug for programmers.  :?
There have been similar bugs in InternetExplorer (textcontrols can not be hidden, the only way to hide is to cover them with a dummy iframe), I don't know if it still exists.
But that's most likely the cause for such an issue.

The cause nobody has reported it, might be that nobody ever did it, or (more likely) that the workaround (or a similar one),I gave you, is used.

Offline rcoll

  • Almost regular
  • **
  • Posts: 150
Re: Problem with wxSmith
« Reply #9 on: November 21, 2010, 03:45:20 pm »
Actually, this is kind of strange.  After putting down a StaticBitmap, then placing other objects on there (a button, another panel, an edit control, a checkbox, etc), some of these objects are drawn properly, and some are not.  For example, a button is alway over-drawn by the bitmap, regardless of Z-order.  But a panel is drawn properly, so is an edit control and a checkbox.  A combo-box is not drawn properly.

This is definitely a bug, but whether it's in Windows or in wxWidgets or in wxSmith I can't say yet.

I'll try to investigate this further.

The work-around for now:  put a panel on the bitmap, of the exact size and placement that you want, then but the button (or other control) on the new panel.

Ringo

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Problem with wxSmith
« Reply #10 on: November 21, 2010, 03:56:38 pm »
I think it's definitely not in wxSmith, because it works on linux and the order of creation is correct, as far as I know.
« Last Edit: November 21, 2010, 03:59:30 pm by jens »