RAD GENERATING CODES FROM BOTTOM TO TOP

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
aprilmot
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Jun 27, 2010 12:25 pm

RAD GENERATING CODES FROM BOTTOM TO TOP

Post by aprilmot » Fri Jan 21, 2011 5:23 pm

Hello All,
I am new to wxDev-CPP and the wxform RAD. I tried to create a sample program in which I added four wxEdit control onebyone from top to bottom (named wxEdit1, wxEdit2, wxEdit3 and wxEdit4) on a wxDialog. wxEdit1 at the top and wxEdit4 at the bottom. When I generated the code I found that these controls are created in the reverse order

Code: Select all

	WxEdit4 = new wxTextCtrl(this, ID_WXEDIT4, wxT("WxEdit4"), wxPoint(112, 176), wxSize(121, 19), 0, wxDefaultValidator, wxT("WxEdit4"));

	WxEdit3 = new wxTextCtrl(this, ID_WXEDIT3, wxT("WxEdit3"), wxPoint(112, 128), wxSize(121, 19), 0, wxDefaultValidator, wxT("WxEdit3"));

	WxEdit2 = new wxTextCtrl(this, ID_WXEDIT2, wxT("WxEdit2"), wxPoint(112, 72), wxSize(121, 19), 0, wxDefaultValidator, wxT("WxEdit2"));

	WxEdit1 = new wxTextCtrl(this, ID_WXEDIT1, wxT("WxEdit1"), wxPoint(112, 32), wxSize(121, 19), 0, wxDefaultValidator, wxT("WxEdit1"));
When I compile and execute the application the control goes from bottom to top ie., wxEdit4 is focussed first then the focus goes to wxEdit3 on pressing tab or enter Key. Whereas I would like to have the order in the reverse way ie., wxEdit1 focussed first, and then the focus should move to wxEdit2 on pressing Tab key. I tried to reorder the code directly but each time it is getting overwritten by wxDsgn.

I am using the following setup
wxDev-c++ version - 7.3.1.3
compiler - mingw3.4.5
OS - windows.
Attachments
dummy.zip
(12.98 KiB) Downloaded 75 times

NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL » Fri Jan 21, 2011 9:06 pm

This looks like a possible bug.

You can force the focus jump using the following code

Code: Select all

	////GUI Items Creation End
	
	WxEdit1->MoveBeforeInTabOrder(WxEdit2);
	WxEdit1->MoveBeforeInTabOrder(WxEdit3);
	WxEdit1->MoveBeforeInTabOrder(WxEdit4);
	WxEdit2->MoveBeforeInTabOrder(WxEdit3);
	WxEdit2->MoveBeforeInTabOrder(WxEdit4);
	WxEdit3->MoveBeforeInTabOrder(WxEdit4);
   
        WxEdit1->SetFocus();
	
in Project1Dlg.cpp
which seems to cause the effect you wish.
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/

aprilmot
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Jun 27, 2010 12:25 pm

Is Old Version of this tool available

Post by aprilmot » Sat Jan 22, 2011 3:38 am

Hello NinjaNL,
Thank you for your reply. I am try to download older version(7.xx) of this tool to check whether it works fine. But I cant find it on sourceforge.net. Could you please let me know the location for the older version (7.x.x.x) of this tool.

Shall I raise a Bug Report on this issue.

Thank you in Advance
Aprilmot

NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Re: Is Old Version of this tool available

Post by NinjaNL » Sat Jan 22, 2011 8:02 am

aprilmot wrote:Hello NinjaNL,
Thank you for your reply. I am try to download older version(7.xx) of this tool to check whether it works fine. But I cant find it on sourceforge.net. Could you please let me know the location for the older version (7.x.x.x) of this tool.
I'm not sure you can. If I remember correctly, we only maintained the latest release and the last release from the previous version. Both available from the sourceforge site.
aprilmot wrote:Shall I raise a Bug Report on this issue.
If you feel that it is enough of a bug to warrant reporting, then by all means. That goes for anything that you consider a bug, even anything we do "by design".

Note however that development of wxDevCpp is rather low at the moment and that Tony and I are currently developing a wxWidgets "clone" of the program, wxDevIDE in C++. Any and all help greatly appreciated.
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Re: Is Old Version of this tool available

Post by tbreina » Sat Jan 22, 2011 4:52 pm

aprilmot wrote:Could you please let me know the location for the older version (7.x.x.x) of this tool.
http://sourceforge.net/projects/wxdsgn/ ... rsion%206/
Everybody's got something to hide except for me and my monkey.

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina » Sun Jan 23, 2011 12:13 am

NinjaNL wrote:This looks like a possible bug.

...

in Project1Dlg.cpp
which seems to cause the effect you wish.
Yes, this is the way the program has always worked, but I agree it is backward. It just never got high enough up on my todo list.

As a temporary fix, you can re-order the controls by right clicking on the designer form and selecting 'Change creation order'. Note that since things are run backward, you'll change the creation order so that it is 4, 3, 2, 1 to get the controls to be written as 1, 2, 3, 4.

I'll try to put in a proper fix when I get the chance.

-Tony
Everybody's got something to hide except for me and my monkey.

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina » Sun Feb 27, 2011 3:39 am

I've had a chance to work on the reverse generation bug. It'd be useful if I had some beta testers. Anyone interested in the latest version?

-Tony
Everybody's got something to hide except for me and my monkey.

Sof_T
Can't get richer than this
Can't get richer than this
Posts: 864
Joined: Thu Jul 28, 2005 9:48 pm
Location: New Forest, United Kingdom
Contact:

Post by Sof_T » Mon Mar 14, 2011 9:05 pm

Finally back to programming, I'll gladly beta test any new versions Tony.
The home of Sof.T http://www.sof-t.site88.net/
Author of Programming with wxDevC++
http://sourceforge.net/projects/wxdevcpp-book/

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina » Tue Mar 15, 2011 3:25 pm

Sof_T wrote:Finally back to programming, I'll gladly beta test any new versions Tony.
I've put an alpha on http://wxdsgn.sourceforge.net/uploads/devcpp.7z

Note that Robert and I are still working on the debugger section. So I think this one might hang your computer if you try the debugger. We'll hopefully be fixing that in the next few weeks (depending on our schedules).

However, the RAD code generation should proceed in the ascending order now. Plus, the bitmap file name bug that you reported should be fixed.

Again, this is an alpha.

-Tony
Everybody's got something to hide except for me and my monkey.

Post Reply