wxfile name dialog Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Emerald2240
Knows some wx things
Knows some wx things
Posts: 30
Joined: Tue Dec 11, 2018 1:38 pm

wxfile name dialog

Post by Emerald2240 » Mon Jan 21, 2019 5:43 pm

Hi I'm a beginner in wxwidgets/wxsmith programming,
Thanks to this Awesome forum I was able to create my very first texteditor... My question is how can I be able to edit the filename before it's saved. I tried using the filedialog save property but it jus shows, I input a name and it displays an error.
Please can I get an example of how my user can input the desired file name and directory he so wishes
Here'sand example of how I save hopefully it can be edited and fit in

void textFrame::OnButton3Click(wxCommandEvent& event)
{
Wxstring s(TextCtrl1->GetValue());
Wxfile f("c:\\Fileone.txt",wxFile::write);
f.Write(s);
f.Close();
TextCtrl1->SetValue("Your file's Been saved Successfully")
}

Kvaz1r
Earned some good credits
Earned some good credits
Posts: 136
Joined: Tue Jun 07, 2016 1:07 pm

Re: wxfile name dialog

Post by Kvaz1r » Mon Jan 21, 2019 6:42 pm

Emerald2240 wrote:I tried using the filedialog save property but it jus shows, I input a name and it displays an error.
What kind of error did you get? Can you post full code for reproducing?

Though, there is enough material with examples of using wxFileDialog you can just copy-paste code from there and fit it for your needs.

Documentation - wxFileDialog Class Reference
wxWiki - Writing Your First Application-Common Dialogs
Emerald2240 wrote:Here'sand example of how I save hopefully it can be edited and fit in
Great. Do you understand each line of the code? Which part is need to be updated?

Emerald2240
Knows some wx things
Knows some wx things
Posts: 30
Joined: Tue Dec 11, 2018 1:38 pm

Re: wxfile name dialog

Post by Emerald2240 » Mon Jan 21, 2019 10:16 pm

Kvaz1r wrote:
Emerald2240 wrote:I tried using the filedialog save property but it jus shows, I input a name and it displays an error.
What kind of error did you get? Can you post full code for reproducing?

Though, there is enough material with examples of using wxFileDialog you can just copy-paste code from there and fit it for your needs.

Documentation - wxFileDialog Class Reference
wxWiki - Writing Your First Application-Common Dialogs
Emerald2240 wrote:Here'sand example of how I save hopefully it can be edited and fit in
Great. Do you understand each line of the code? Which part is need to be updated?
Thanks! The tutorials were helpful.

Post Reply