Creating complete dialog box, with forms, check buttons...

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
GianT
Earned some good credits
Earned some good credits
Posts: 124
Joined: Wed Mar 16, 2005 5:44 pm
Location: Guadeloupe, French West Indies

Creating complete dialog box, with forms, check buttons...

Post by GianT »

Hi, I need to crate dialog boxes in my program in order to add some users and link the informations to a database. For example, the informations could be the name, first name, age etc which are entered by taping on the keyboard, and some other informations like the category (student, worker, etc) which should be choosen in a list box. Could somebody help me?
PS: My english is not perfect so I appologize for the mistakes that could appear in the messages that I post.
upCASE
Moderator
Moderator
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE »

Hi!
Hi, I need to crate dialog boxes in my program in order to add some users and link the informations to a database. For example, the informations could be the name, first name, age etc which are entered by taping on the keyboard, and some other informations like the category (student, worker, etc) which should be choosen in a list box. Could somebody help me?
Sure we can :D
What seems to be the exact problem?
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
GianT
Earned some good credits
Earned some good credits
Posts: 124
Joined: Wed Mar 16, 2005 5:44 pm
Location: Guadeloupe, French West Indies

Post by GianT »

The problem is just that I have no idea how to do it (-.-)' :oops: . If you want some precision, I don't see with which button I can create such a dialog box containing fields to fill and cheklistbox. I want to add these information to a database after, but I think that I just need to find a connexion script for this part.
NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL »

GianT wrote:The problem is just that I have no idea how to do it (-.-)' :oops: . If you want some precision, I don't see with which button I can create such a dialog box containing fields to fill and cheklistbox. I want to add these information to a database after, but I think that I just need to find a connexion script for this part.
If you are using wxDevCpp then (assuming you already have an initial form for your main program, and you want to add a new dialog, then you select File - New - and then choose New wxDialog. You will be asked if you want to add the dialog to the current project. Select Yes.

You will need to fill in a few options (name and such) and then click on Create.

You will have a new dialog form for you to design.

Add a text control etc just as with the main form. Communicating between the dialog and your original for is then up to you.
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/
GianT
Earned some good credits
Earned some good credits
Posts: 124
Joined: Wed Mar 16, 2005 5:44 pm
Location: Guadeloupe, French West Indies

Post by GianT »

OK!! Thx I will now be abble to do my dialog... But could somebody link me to a tutorial which shows how to link the main program to the dialog when I click on a button? I don't manage to code the execution of the dialog box :cry:
GianT
Earned some good credits
Earned some good credits
Posts: 124
Joined: Wed Mar 16, 2005 5:44 pm
Location: Guadeloupe, French West Indies

Post by GianT »

I did it! I manage to open my dialog by cliking on a button: For those who don't know how to do it, just copy those 3 lines from the function newProgramFrameApp::OnInit() in the newProgramFrameApp.cpp file, and paste them in the place where is to be the code of the button :

newProgramFrame *myFrame = new newProgramFrame(NULL);
//SetTopWindow(myFrame);
myFrame->Show(TRUE);

I put the second one in comment because I got compiling errors and I have not found yet which file to include. And commenting this line may be the reason why I got this problem: My dialog doesn't stay on top of the main frame... I sure put the option wx_stay_on_top but it does not work...
So if someone has an idea...

Ohh I was going to forgot, in the dialog which is added, you have to change this name #define THIS_DIALOG_STYLE to another in the header file of the dialog, if not you will get errors of compilation because the same name is used for the main frame.
GianT
Earned some good credits
Earned some good credits
Posts: 124
Joined: Wed Mar 16, 2005 5:44 pm
Location: Guadeloupe, French West Indies

Post by GianT »

Well, I found the solution again, I just had to put the option of no_parent to false.