[resolved] Show a error message from a dialog box

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

[resolved] Show a error message from a dialog box

Post by GianT »

Hi, that's me again :D I made a dialog box and I would like to send a message in function of what the user wrote n the fields of the dialog box.
In fact, if he writes something wrong, I want to show a error message; if not, I want to validate the dialog box and show another message. I guess that some of you will talk me about wxvalidator, but I'm sure there is another solution...

I tried to do a message dialog in the main frame, but I cant access to it from the dialog box...
Last edited by GianT on Thu Apr 28, 2005 3:02 pm, edited 1 time in total.
NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL »

Have a look at TransferDataFromWindow? Perhaps this is what you need?
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
Contact:

Post by GianT »

Where can I find information about this?
I can't find it in the help file
NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL »

There is some information in the help file, and you could also look at the wizard and dnd samples for examples of using it.
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
Contact:

Post by GianT »

I'm afraid I can't find any information about this in the help file, I just got ToULong and Treectrl sample when I search for TransferDataFromWindow.
NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL »

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
Contact:

Post by GianT »

I read about this, but it doesn't seem to be what I need :? . It talks about transferring data to a child but how do I make this child? I remind that I want to show a validate or an error message when I click on the "OK" button of the dialog.
Do I have to make and place the code of a wxwindow in the code of the dialog box? So I could call a function named GetWIndow if I remeber well..

I have to find this, it is something which presence is really needed in all applications (in my opinion).
GianT
Earned some good credits
Earned some good credits
Posts: 124
Joined: Wed Mar 16, 2005 5:44 pm
Location: Guadeloupe, French West Indies
Contact:

Post by GianT »

Well I found what I was searching for. It was so simple...but as I didn't know, I couldn't do it obviously... It takes only one line or 2. When I check whether the condition is verified or not, I just write this:

- If it's ok:
wxMessageBox("User added.", "Error",wxOK, this);
Then I close the dialog box by
NewUserDlg::NewUserDlgClose((wxCloseEvent&)event);


-If it's not ok
wxMessageBox("Login already used.", "Error",wxOK, this);


As you see that is very simple. I wonder if nobody did know about this answer, and the lack of help on this forum sometimes disappoints me...I think there are some users that know a lot and they should be more active (to my mind). Of course, I know that some people don't have much time; personally I come in the forum just when I have a problem to solve and when I'm there I answer to a question if I know the answer. That is just an observation, so don't worry about that.

Well thank you anyway to those who have already tried to answer me and those who managed to do it.
Post Reply