[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] Meaning of wxFLP_FILE_MUST_EXIST
From: |
Greg Chicares |
Subject: |
[lmi] Meaning of wxFLP_FILE_MUST_EXIST |
Date: |
Thu, 9 Jun 2016 14:09:11 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0 |
Using lmi HEAD, I can enter a nonexistent file in this control:
<object class="wxFilePickerCtrl" name="DefaultInputFilename">
<style>wxFLP_OPEN|wxFLP_FILE_MUST_EXIST|wxFLP_USE_TEXTCTRL|wxFLP_SMALL</style>
^^^^^^^^^^^^^^^^^^^^^
and it's accepted--and I like that behavior, because I can
manually type the name of a nonexistent file in order to have
no custom default. I do however think the wx documentation
http://docs.wxwidgets.org/3.0/classwx_file_picker_ctrl.html
could be improved.
It says
| wxFLP_FILE_MUST_EXIST:
| Can be combined with wxFLP_OPEN only: the selected file must be an existing
file.
which isn't necessarily wrong if "selected" means picked in
the popup. It wouldn't hurt to mention that a nonexisting file
name can always be manually typed into the managed text control
(when wxFLP_USE_TEXTCTRL is specified), and will be accepted.
Then it also says
| void wxFilePickerCtrl::SetPath(const wxString & filename)
| Sets the absolute path of the currently selected file.
| This must be a valid file if the wxFLP_FILE_MUST_EXIST style was given.
I think the last sentence is incorrect and should be deleted.
This lmi code calls SetPath():
bool Transfer(transfer_direction td, std::string& data, wxFilePickerCtrl&
control)
{
if(td == from_string_to_control)
{
control.SetPath(data);
}
and it successfully passes the nonexistent filename I enter.
I would strongly prefer that the code not change. I'm only
saying that the documentation could describe it better.
- [lmi] Meaning of wxFLP_FILE_MUST_EXIST,
Greg Chicares <=