Author Topic: Problems with wxSmith hello world prog  (Read 6546 times)

Matroc

  • Guest
Problems with wxSmith hello world prog
« on: April 23, 2006, 01:29:46 pm »
Hi,

im having some problems with the prog generated by wxSmith when creating a new app using the wizzard.
in the wizzard i used default options and enabled XRC.

When i compile and run it using the latest CB nightly with VCToolkit and WX 2.6.3 unicode, there seem to be some problems with the menu and statusbars.
They seem to overlay parts of the panel in the window.
The line "Hello World !!!" is not visible by default (its underneath the menu bar), but it becomes visible if i enlarge the window.
Any ideas?
« Last Edit: April 23, 2006, 01:31:18 pm by Matroc »

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
Re: Problems with wxSmith hello world prog
« Reply #1 on: April 23, 2006, 11:50:25 pm »
may you provide the the code generated by the wizard ? (with screenshot of the problem even better), thx

Matroc

  • Guest
Re: Problems with wxSmith hello world prog
« Reply #2 on: April 24, 2006, 03:58:09 pm »
Ok, no problem.
this is what it looks like on startup:

and this is how it should look (i resized the window):


ok now the generated code, this should be everything that's important:
Code
MainFrame::MainFrame(wxWindow* parent,wxWindowID id)
{
//(*Initialize(MainFrame)
wxXmlResource::Get()->LoadFrame(this,parent,_T("MainFrame"));
StaticText1 = XRCCTRL(*this,"ID_STATICTEXT1",wxStaticText);
//*)

wxMenuBar* mbar = new wxMenuBar();
wxMenu* fileMenu = new wxMenu(_(""));
fileMenu->Append(idMenuQuit, _("&Quit\tAlt-F4"), _("Quit the application"));
mbar->Append(fileMenu, _("&File"));

wxMenu* helpMenu = new wxMenu(_(""));
helpMenu->Append(idMenuAbout, _("&About\tF1"), _("Show info about this application"));
mbar->Append(helpMenu, _("&Help"));

SetMenuBar(mbar);

SetStatusBar(new wxStatusBar(this,-1));
}

and the xrc:
Code
<resource>
    <object class="wxFrame" name="MainFrame">
        <title>wxSmith template</title>
        <centered>1</centered>
        <style>wxCAPTION|wxTHICK_FRAME|wxSYSTEM_MENU|wxRESIZE_BOX|wxCLOSE_BOX|wxMINIMIZE_BOX</style>
        <bg>wxSYS_COLOUR_BTNFACE</bg>
        <object class="wxBoxSizer">
            <orient>wxHORIZONTAL</orient>
            <object class="sizeritem">
                <option>1</option>
                <border>5</border>
                <flag>wxALL|wxALIGN_CENTER</flag>
                <object class="wxStaticText" name="ID_STATICTEXT1">
                    <label>Hello world !!!&#x0A;==============&#x0A;&#x0A;This is template for wxWidgets application using wxSmith RAD gui editor&#x0A;You can add new resources through wxSmith menu.&#x0A;All resources managed inside wxSmith are listed in Resources tab.&#x0A;&#x0A;</label>
                    <pos>-1,-1</pos>
                    <style>wxALIGN_CENTRE</style>
                    <font>
                        <size>10</size>
                        <weight>bold</weight>
                        <face>MS Shell Dlg 2</face>
                    </font>
                </object>
            </object>
        </object>
    </object>
</resource>

my guess is, that this bug is caused by the fact that the xrc frame layout is altered within the source but im not shure about this...

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: Problems with wxSmith hello world prog
« Reply #3 on: April 24, 2006, 04:47:30 pm »
Try adding this:
Code: cpp
if ( GetSizer() )
{
  GetSizer()->SetSizeHints(this);
}
else
{
  Fit();
}
Layout();

at the end of MainFrame ctor, right after SetStatusBar(). Perhaps Layout could be skipped.

This is caused by fact that minimal window size is set up before adding menu/status bar.

Matroc

  • Guest
Re: Problems with wxSmith hello world prog
« Reply #4 on: April 24, 2006, 06:56:43 pm »
Thx, works perfectly :-D

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: Problems with wxSmith hello world prog
« Reply #5 on: April 24, 2006, 11:29:35 pm »
Glad to hear that :)

By the way, where have You this skin (WinXP I guess) from ? It looks interesting :)

sethjackson

  • Guest
Re: Problems with wxSmith hello world prog
« Reply #6 on: April 25, 2006, 12:42:03 am »
By the way, where have You this skin (WinXP I guess) from ? It looks interesting :)

Yeah please tell us. It looks nice. :D

takeshimiya

  • Guest
Re: Problems with wxSmith hello world prog
« Reply #7 on: April 25, 2006, 03:17:52 am »
Yeah please tell us. It looks nice. :D
It's "Thallos" from kol. Anything he makes is amazing stuff.
http://www.studiotwentyeight.com

Matroc

  • Guest
Re: Problems with wxSmith hello world prog
« Reply #8 on: April 25, 2006, 04:33:04 pm »
yep, its thallos.
i'm pretty happy with it, it doesnt like non standard dpi settings though (the screenshot is from my normal pc)...
well, many windows progs don't like different dpi settings (absolute pixel positioning sucks!).
It's a pain in the ass with a 1600x1200 15" laptop screen.