Author Topic: wxSmith development  (Read 128323 times)

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith development
« Reply #150 on: October 27, 2008, 07:43:09 pm »
well by saying the flash buttons , i mean a button made using some flash button creation software such as Armada flash suit or adobe Flash Cs3!( i wonder if you saw KmPlayer, the latest version, it uses such buttons if think!), so that you can use them in your project !the  mouse hovers,and  it changes ! you know that !
(if again these things need to use plugins , tell me please! )

Usually you won't need such huge products like flash to do this. Everything is alreay available. For the reference I attach project with simple "button-like" item which changes colour when mouse is over it. The project is made on linux but source and header files should work fine on windows too. Just need to create new project.

KmPlayer is definitely not using flash. That would equal to using plane to buy some vegetables in a shop on the other side of the street.

Anyway, we should if you want to continue this conversation, please add new topic into other group.

Regards
   BYO

[attachment deleted by admin]

kakaroto

  • Guest
Re: wxSmith development
« Reply #151 on: November 03, 2008, 03:27:05 am »
Hello all!

I'm and experienced developer but I'm new to Code::Blocks and wxWidgets, so please be indulgent with me (at least the first few questions  :D )

I've been looking at the wxWidgets sample code and found a quite useful widget for a project I have in mind: wxFilePicker. Unfortunately it seems that this widget is not available/supported in wxSmith; am I right? or am I missing something?

If I'm doing something wrong I'd be thankful if you could point me to the appropriate documentation.

Thanks in advance!


PS: Just in case it matters, I'm using Code::Blocks 8.02 and wxWidgets 2.8 under Kubuntu 8.10
« Last Edit: November 03, 2008, 03:38:03 am by kakaroto »

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith development
« Reply #152 on: November 03, 2008, 11:48:50 pm »
I've been looking at the wxWidgets sample code and found a quite useful widget for a project I have in mind: wxFilePicker. Unfortunately it seems that this widget is not available/supported in wxSmith; am I right? or am I missing something?

Unfortunately there's no support for wxFilePickerCtrl in wxSmith now. But if you only want to show file-choose dialog there's wxFileDialog object which can be used instead. More info on this class can be found here.

I don't remember exactly whether it was supported on the 8.02 release. If it was not, I can only suggest some newer nightly build ;)

Regards
   BYO

Offline lesnewell

  • Multiple posting newcomer
  • *
  • Posts: 43
Re: wxSmith development
« Reply #153 on: November 17, 2008, 12:04:12 pm »
Hi byo,

Is it possible to set the default border, placement and proportion when placing widgets? For instance I usually use 3 dialog unit borders with a proportion of 0. It can be a pain to place all my widgets then go through them all, changing these values.

While I am asking is there any way to convert a wxSmith project to use xrc?

Thanks,
Les

Offline riban

  • Multiple posting newcomer
  • *
  • Posts: 26
Re: wxSmith development
« Reply #154 on: November 17, 2008, 07:32:47 pm »
Hi

I read in Jan 2006 (http://forums.codeblocks.org/index.php?topic=1987.0) a reference to cut, copy and paste. Is this features going to be implemented. It would be an extremely useful features that is missing from an otherwise excellent application. I am using Code::Blocks with wxSmith extensively and encouraging many of my colleagues to do so. The lack of cut, copy & paste is slowing their migration (from an M$ product) and does slow my development often.

If there is feature request system that I have missed, please kick me in the right direction.

Keep up the good work.

Offline lesnewell

  • Multiple posting newcomer
  • *
  • Posts: 43
Re: wxSmith development
« Reply #155 on: November 19, 2008, 08:48:10 am »
Copy/paste works for me. Select the items, hit ctrl-C, got to your target, hit ctrl-V.

You have to be a little careful what you select. Fro instance if you select a sizer, the sizer and all of it's contents will be copied. When pasting, be aware of what inser mode you are using (before, after, into etc).

Les

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: wxSmith development
« Reply #156 on: February 05, 2009, 10:29:35 am »
I hope wxSmith can write code like this:

[attachment deleted by admin]
« Last Edit: February 05, 2009, 10:31:30 am by Loaden »

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: wxSmith development
« Reply #157 on: February 05, 2009, 10:36:13 am »

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith development
« Reply #158 on: February 05, 2009, 11:34:03 pm »
I hope wxSmith can write code like this:

There's one problem with enums - if you mix two or more resources in one aplication you may have ids that are same. Let's take an example:

Theres one resource of type wxDialog - it has button with id of value let's say 10. Now we would like to add separate wxPanel resource into that dialog. This resource may also have button with id of value 10. If event handling occurs there's confusion because event handling is filtered through ids.

I decided to switch to static const long time ago (there were enums before) because:
  • Static members are not created per instance of class. They are global so the total extra memory requirement for them is up to few hundred bytes per application.
  • These members are initialized using wxNewId() function which is said to create unique ids in whole application scope which allows to mix multiple resources simultaneously in one window

Regards
   BYO

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: wxSmith development
« Reply #159 on: February 06, 2009, 12:43:23 am »
I hope wxSmith can write code like this:
There's one problem with enums - if you mix two or more resources in one aplication you may have ids that are same.
I see.
but why can not set all control id to wxID_ANY? or wxID_* ? i think this is a bug.
DialogBlocks not have this question. it's support wxID_* in every control.

And i hope wxSmith can offer more option, to let's user choice.
example: _("") or _T(""), because more application not support I18N.
example: const static id OR enums id.

Final, there have some question:
http://forums.codeblocks.org/index.php/topic,10040.msg69882.html#msg69882
I can't set size. it's not work.
I found it's always call 'SetSizeHints'.
Code: [Select]
Index: src/plugins/contrib/wxSmith/wxwidgets/wxscontainer.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/wxscontainer.cpp (revision 5440)
+++ src/plugins/contrib/wxSmith/wxwidgets/wxscontainer.cpp (working copy)
@@ -215,7 +215,7 @@
                         Codef(_T("%sFit(%O);\n"),ChildAccessPrefix.c_str());
                     }
 
-                    Codef(_T("%sSetSizeHints(%O);\n"),ChildAccessPrefix.c_str());
+                    //Codef(_T("%sSetSizeHints(%O);\n"),ChildAccessPrefix.c_str());
                 }
             }

thanks!!
« Last Edit: February 06, 2009, 12:51:31 am by Loaden »

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: wxSmith development
« Reply #160 on: February 06, 2009, 12:54:18 am »
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.

Offline hirofield

  • Single posting newcomer
  • *
  • Posts: 4
Re: wxSmith development
« Reply #161 on: September 21, 2009, 02:37:16 pm »
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: [Select]
SizeTestFrame::SizeTestFrame(wxWindow* parent,wxWindowID id)
{
    //(*Initialize(SizeTestFrame)
    Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id"));
    //*)
}

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: [Select]
SizeTestFrame::SizeTestFrame(wxWindow* parent,wxWindowID id)
{
    //(*Initialize(SizeTestFrame)
    Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id"));
    SetClientSize(wxSize(300,200));
    //*)
}

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: [Select]
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);
    //*)
}

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: [Select]
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));
}

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
« Last Edit: September 21, 2009, 03:24:23 pm by hirofield »

Offline noblus

  • Single posting newcomer
  • *
  • Posts: 2
Re: wxSmith development
« Reply #162 on: December 18, 2009, 05:12:12 am »
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.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: wxSmith development
« Reply #163 on: December 18, 2009, 07:18:29 am »
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.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: wxSmith development
« Reply #164 on: December 18, 2009, 02:33:38 pm »
Just added it in my local copy, will commit this later.

Done (svn r5986).