Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
wxSmith development
Loaden:
I want set Frame size like wxSize(700, 500), and all control resize self to fit Frame's size.
But now, parent size must fit controls.
hirofield:
Hi,
A few days ago, I posted almost the same message as this on "General" forum.
But I think that forum is not appropriate to post this kind of message,
so let me post it on this board again.
I have a request for auto-generated codes by wxSmith.
I'm testing a frame which has fixed size.
I created a new frame based wxSmith project by the wizard, then deleted the
MenuBar1 and the StatusBar1 which are automatically added by default.
The followings are the codes of frame constructor in this situation.
--- Code: ---SizeTestFrame::SizeTestFrame(wxWindow* parent,wxWindowID id)
{
//(*Initialize(SizeTestFrame)
Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id"));
//*)
}
--- End code ---
Next, I unchecked the [Default size] checkbox in the property editor, then set
Width to 300 and Height to 200. The codes of constructor was changed as follows.
--- Code: ---SizeTestFrame::SizeTestFrame(wxWindow* parent,wxWindowID id)
{
//(*Initialize(SizeTestFrame)
Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id"));
SetClientSize(wxSize(300,200));
//*)
}
--- End code ---
After that, I placed a BoxSizer into the Frame on the GUI designer screen.
Then the frame was shrunk to very small size, and the constructor codes are
changed:
--- Code: ---SizeTestFrame::SizeTestFrame(wxWindow* parent,wxWindowID id)
{
//(*Initialize(SizeTestFrame)
wxBoxSizer* BoxSizer1;
Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id"));
SetClientSize(wxSize(300,200));
BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
SetSizer(BoxSizer1);
BoxSizer1->SetSizeHints(this);
//*)
}
--- End code ---
This means the size setting by SetClientSize(wxSize(300,200)); is ignored.
So I added SetClientSize(wxSize(300,200)); again after the auto-generated codes
by manual as follows:
--- Code: ---SizeTestFrame::SizeTestFrame(wxWindow* parent,wxWindowID id)
{
//(*Initialize(SizeTestFrame)
wxBoxSizer* BoxSizer1;
Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id"));
SetClientSize(wxSize(300,200));
BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
SetSizer(BoxSizer1);
BoxSizer1->SetSizeHints(this);
//*)
SetClientSize(wxSize(300,200));
}
--- End code ---
Then the frame was shown at the expected size on runtime.
But the frame is still shrunk on the GUI designer even clicking " Show preview"
button.
Although I guess it might be a kind of spec or bug of wxWidgets, but I think
it's better that wxSmith places SetClientSize(wxSize(x, y)); at the end of the
auto-generated codes of constructor, and it's reflected in the GUI designer
screen.
In addition, I think it affects the usability of the GUI designer. Actually,
it's rather difficult for me to place a widgets on the exact position in the
narrow space.
That's my request.
I would be happy if this issue is resolved.
Regards,
hirofield
noblus:
Hi. I have a minor problem when using wxSmith (C::B 2.8.10, newest nightly builds).
The listed events in "Events Window" for wxSlider are wxEVT_COMMAND_SCROLL + (_TOP, _BOTTOM, etc). They works almost fine, except when I want to add a handler for wxEVT_COMMAND_SLIDER_UPDATED event. wxEVT_COMMAND_SLIDER_UPDATED event handler can be triggered when mouse drags the thumb, but wxEVT_COMMAND_SCROLL_XXXX's can't.
So if there is a solution please tell me. Thanks in advance.
Jenna:
As workaround (until the wxEVT_COMMAND_SLIDER_UPDATED) is added you can use wxEVT_SCROLL_THUMBTRACK to fetch any event generated by tracking the slider with the mouse and wxEVT_SCROLL_CHANGED to fetch also events triggered by the keyboard or by clicking next to the slider (this event is also triggered by mouse-dragging, but only after releasing the mouse-button).
Anyway the wxEVT_COMMAND_SLIDER_UPDATED will most likely be added soon.
Thanks for reporting.
EDIT:
Just added it in my local copy, will commit this later.
Jenna:
--- Quote from: jens on December 18, 2009, 07:18:29 am ---Just added it in my local copy, will commit this later.
--- End quote ---
Done (svn r5986).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version