← Back to team overview

kicad-developers team mailing list archive

Re: wxFileDialog issues

 

On 5/11/2010 8:44 AM, Lorenzo Marcantonio wrote:
> A minor nuisance... but I don't get why it does this on pcbnew:
> 
> - If at the beginning you do an 'Open board' you get the dialog with the
>   'Printed circuit board file' wildcard active, and thats good.
> 
> - If there is a board loaded, doing an 'Open board' starts with no
>   wildcard active and you must select it to show only the .brd files...
> 
> I presume this is because pcbnew does this:
> 
>         wxFileName fn = GetScreen()->m_FileName;
> 
>         wxFileDialog dlg( this, _( "Open Board File" ), wxEmptyString,
> fn.GetFullName(),
>                           PcbFileWildcard, wxFD_OPEN |
> wxFD_FILE_MUST_EXIST );
> 
> ... and the fnGetFullName() somewhat confuses the wxFileDialog...

Lorenzo,

Are you using Linux?  The GTK file chooser doesn't always behave the
same way as the Window's file chooser.  Let me know and I will take a
look at it.

Wayne

> 
> Oh, BTW PcbFileWildcard is mostly the same as BoardFileWildcard,
> I propose to pick one and junk the other one (no sense in keeping both
> of them).
> 
> Eeschema doesn't suffer the problem... what it does is:
> 
>         wxFileDialog dlg( this, _( "Open Schematic" ), wxGetCwd(),
>                           wxEmptyString, SchematicFileWildcard,
>                           wxFD_OPEN | wxFD_FILE_MUST_EXIST );
> 
> I don't get why it's done differently (I'm no expert in wx), but I guess
> that doing the same in pcbnew would fix the nuisance. I'll try that
> later...
> 



Follow ups

References