Commit Graph

97 Commits

Author SHA1 Message Date
Jeff Young 4e3109a633 Wide string decls for gerbview. 2022-02-05 22:34:45 +00:00
Jeff Young d28714167c All the preferences, all the time.
Fixes https://gitlab.com/kicad/code/kicad/issues/7877

Fixes https://gitlab.com/kicad/code/kicad/issues/5153
2021-12-24 13:08:44 +00:00
Jeff Young b84d1456d5 KIFACE_I -> KIFACE_BASE. 2021-09-14 23:45:14 +01:00
Wayne Stambaugh cb72da294a More NULL expunging. 2021-07-16 16:13:41 -04:00
Jeff Young 1722bc03b0 Consistent terminology and punctuation. 2021-06-17 00:05:17 +01:00
Jon Evans c04e19f9ac Include optimization: move some things from common.h to point-of-use 2021-03-20 12:09:18 -04:00
Marek Roszko d67cf2f9af Replace wxFile usage with wxFFile
Buffered libc wxFFile is better thinking about syscall wxFile going wrong.
2020-12-12 13:16:23 -05:00
Jeff Young 0bc7bbbadb Report silk/edge collisions.
Fixes https://gitlab.com/kicad/code/kicad/issues/5854

Fixes https://gitlab.com/kicad/code/kicad/issues/4892
2020-10-06 14:21:18 +01:00
jean-pierre charras b38cef409b Rename CopyFile() to KiCopyFile() to avoid name colliding with a windows header.
Using CopyFile() that can collide with a windows header create hard to
understand errors, including link errors.

Renaming this function avoids these strange errors.
2020-10-03 10:08:21 +02:00
jean-pierre charras 04aa5519d0 Gerbview: code cleanup. Remove many include, now useless. 2020-09-30 12:56:55 +02:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
Jeff Young a04fdf64da Improve directory handling for Project Save As.
1) don't change directory names that we don't recognize
2) when we do, make sure the child files get copied to the
changed name.

Fixes https://gitlab.com/kicad/code/kicad/issues/3834
2020-02-03 15:08:01 +00:00
Jon Evans 4ae4c4e243 Switch from JSON11 to nlohmann/json in GerbView
See #3638
2020-01-04 10:46:49 -05:00
Jeff Young 04b0feb365 Fix a couple of issues in new Save As command.
Handle symbols as well as strings in the "source" lists of
netlist files.

Handle Protex gerber file extensions.

Check for project_name-whatever pattern for files that we
don't recognize (such as project_name-NPTH-drl_map.ps)
2019-11-11 20:36:48 +00:00
Jeff Young 10abc6097f Cleanup, commenting, etc. 2019-11-10 14:52:01 +00:00
jean-pierre charras 4de6ed6206 Fix issues created by Adds Save As... to the Kicad manger.
Mainly replacing std::string by wxString to manage filenames.
On Windows, a sdt::string cannot manage a filename, unless using
in many places TO_UTF8 and FROM_UTF8.
So the best way is to use a wxString for filenames and error messages.
2019-11-10 09:37:39 +01:00
Jeff Young b5904b0401 Installment one of project Save As... feature.
ADD: Adds Save As... to the File menu for the project window.

Fixes: lp:594051
* https://bugs.launchpad.net/kicad/+bug/594051
2019-11-09 20:22:44 +00:00
Jeff Young 5e49517781 Move hotkeys to ACTION architecture. 2019-06-10 23:46:00 +01:00
Jeff Young c2662b0e11 Retire EDA_DRAW_PANEL and legacy_wx/EDA_DRAW_FRAME. 2019-05-31 21:55:30 +01:00
Michael Kavanagh fe6bc411dd Fix 'hokey' -> 'hotkey' typo 2019-04-02 12:57:26 -04:00
Jeff Young 7841f8a466 Unified preferences dialog framework.
(cherry picked from commit 8ee3e77)
2018-07-17 15:11:17 +01:00
jean-pierre charras e15acbb00d Fp editor and board editor have now a separate color setup.
fp viewer uses the default colors, because it has no color setup dialog.
class_colors_design_settings: remove not used members.
Fix issue in modedit: the color config was never read.
2017-09-11 18:51:48 +02:00
Simon Richter ad088db6d2 Add more "override" markers. 2016-09-25 13:59:41 -04:00
Simon Richter 59c81976dc Explicitly mark overriding functions. 2016-09-24 14:53:15 -04:00
jean-pierre charras 1c21410f1f Gerbview: code cleanup (with the help of Mark Roszko's work) 2016-05-25 11:45:55 +02:00
jean-pierre charras 1c6ae1eac7 Gerbview: fix a crash when trying to edit hotkeys. Add a few missing hotkeys.
Very minor coding style issue fix in hotkey code (pl_editor and gerbview).
Fix a compil error  using c++11 option for painstaking compilers
2015-04-19 20:41:57 +02:00
jean-pierre charras 2804d2e566 Add hotkeys to Kicad manager, and some rework on hotkeys management. 2015-03-02 18:29:18 +01:00
jean-pierre charras 555ce68efe Gerbview: Add support for recent File Format Attribute metadata, both for X2 Gerber file format and X1 (R274X) format.
Pcbnew already uses this attribute when creating Gerber files.
Because Gerber files using this attribute identify the board layers stackup, Gerbview (if this attribute is defined) can sort gerber images stach up like the board.
(in layer manager, just right click to access to the sort menu)
2014-11-22 12:52:57 +01:00
Dick Hollenbeck 1e7495e634 merge 2014-06-30 00:46:18 -05:00
jean-pierre charras 013296cb1a Make gerbview compilable and working (does not use now layers and layer masks from Pcbnew).
Export to Pcbnew is broken, but it is a very rarely used feature. It will be fixed later.
2014-06-27 19:07:42 +02:00
jean-pierre charras 7c99a242cf Remove 2 global variables: g_DrawBgColor and g_ShowPageLimits.
They are now member of EDA_DRAW_FRAME.
This change could fix Bug #1330781 (Background color change in Eeschema affects background color in Pcbnew)
Show page limits has meaning only for the schematic editor,  the board editor and the page layout editor.
Draw background color selection exists only in eeschema and  page layout editor.
In pcbnew, only a black background is allowed.
A side effect is now the user should set the background color in schematic editor, and the library editor (2 different options).
The default is still the white color.
2014-06-20 13:13:04 +02:00
jean-pierre charras cfa67aa218 Pcbnew: plot dialog: remove obscure and useless option about texts which are not value or reference.
cosmetic enhancement in dialog.
page layout: fix bug Bug #1320839 (canvas refresh countinously called when moving an item)
2014-05-19 20:24:07 +02:00
Dick Hollenbeck 0d6560a218 *) Switch kicad.exe to using KIFACE modules for all major top level windows.
Eeschema, Pcbnew, and Cvpcb all run under the same process now,
    FOR THE VERY FIRST TIME!

*)  Added KIWAY::PlayerCreate(), PlayerClose(), and PlayersClose().

*)  Factored FRAME_T into <frame_type.h> from ID_DRAWFRAME_TYPE.

*)  Found that the following command line is helpful for collecting all the *.kiface
    files into the <build>/kicad/ directory so that kicad can find them.

      $ cp `find . -name '*.kiface'` kicad/

    Maybe somebody will want to rework how the CMake files are organized so all
    the binaries can go into the same place.  See python-a-mingw-us.

*)  This might fix the problem on the Mac where child process windows were not
    coming to the front.  See ->Raise() in kicad/mainframe.cpp.

*)  You can set USE_KIFACE to 0 in kicad/mainframe.cpp to chain load child exes
    instead of using the KIFACE modules directly, i.e. revert.
2014-04-19 13:47:20 -05:00
Dick Hollenbeck 5f65d0da93 *) Add KIFACE_I::StartFlags() and IsSingle() so a KIFACE implementation can know
if it is running under single_top.cpp or under a project manager.

*)  Test Kiface().IsSingle() when adding menus, some operations are not permitted
    when running under a project manager and the KIWAY_PLAYER is pegged to a
    specific project.

*)  Implemented KIWAY::KiFACE() so it loads *.kiface files.  They still have to be
    in the same directory as the main *.exe launcher, so this presents some difficulty
    when the binaries are not yet installed but rather the *.kiface files are still
    in their original build directories.  For today, I simply copied _pcbnew.kiface
    to build/kicad/.

*)  Add a test case to kicad/mainframe.cpp just to get an early peek at loading
    _pcbnew.kiface under the C++ project manager.  Got that working for one
    specific invocation just for proof of concept.  Surprise, it works.
2014-04-17 21:05:40 -05:00
Dick Hollenbeck 2c67c3ff80 * KIWAY Milestone A): Make major modules into DLL/DSOs.
!   The initial testing of this commit should be done using a Debug build so that
    all the wxASSERT()s are enabled.  Also, be sure and keep enabled the
    USE_KIWAY_DLLs option.  The tree won't likely build without it.  Turning it
    off is senseless anyways.  If you want stable code, go back to a prior version,
    the one tagged with "stable".

*   Relocate all functionality out of the wxApp derivative into more finely
    targeted purposes:
    a) DLL/DSO specific
    b) PROJECT specific
    c) EXE or process specific
    d) configuration file specific data
    e) configuration file manipulations functions.

    All of this functionality was blended into an extremely large wxApp derivative
    and that was incompatible with the desire to support multiple concurrently
    loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
    An amazing amount of organization come from simply sorting each bit of
    functionality into the proper box.

*   Switch to wxConfigBase from wxConfig everywhere except instantiation.
*   Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
    PGM_SINGLE_TOP,
*   Remove "Return" prefix on many function names.
*   Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
*   Fix building boost for use in a DSO on linux.
*   Remove some of the assumptions in the CMakeLists.txt files that windows had
    to be the host platform when building windows binaries.
*   Reduce the number of wxStrings being constructed at program load time via
    static construction.
*   Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
    these functions are useful even when the wxConfigBase comes from another
    source, as is the case in the KICAD_MANAGER_FRAME.
*   Move the setting of the KIPRJMOD environment variable into class PROJECT,
    so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
*   Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
    its child wxFrames and wxDialogs now have a Kiway() member function which
    returns a KIWAY& that that window tree branch is in support of.  This is like
    wxWindows DNA in that child windows get this member with proper value at time
    of construction.
*   Anticipate some of the needs for milestones B) and C) and make code
    adjustments now in an effort to reduce work in those milestones.
*   No testing has been done for python scripting, since milestone C) has that
    being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
Dick Hollenbeck 4f26386e8d Initial KIWAY (modular-kicad) work. Various tweeks. 2014-02-03 09:10:37 -06:00
jean-pierre charras 820153c7d4 Gerbview: remove fully outdated code (about reading DCode files) and fix erroneous comments. 2013-06-28 12:49:43 +02:00
Lorenzo Marcantonio 9fd79dfa91 Implemented the LAYER_NUM typedef (LAYER was already taken as a class name...) to represent a layer number. 2013-03-31 15:27:46 +02:00
Lorenzo Marcantonio e771112259 Enforced EDA_COLOR_T type and minor const-ification 2012-09-02 14:06:47 +02:00
jean-pierre charras 4125ea7789 Gerbview: remove dependencies from Pcbnew.
Should allow Pcbnew code easier to change and Gerbview code more understandable and easier to maintain.
Code cleaning (remove dead code, add comments).
Minor other enhancements.
2012-05-04 19:44:42 +02:00
jean-pierre charras f3e171797c Make Gerbview working with USE_PCBNEW_NANOMETRES option ON 2012-04-18 09:07:13 +02:00
Dick Hollenbeck b8a0ab4c52 switch to <> for includes from "" per conversation with Jean-Pierre and Wayne, adjust search paths 2012-01-22 22:33:36 -06:00
Dick Hollenbeck 697f912307 moving objects into BOARD which are saved in a *.brd file, for PLUGIN access 2011-12-30 23:44:00 -06:00
Dick Hollenbeck 0d4598656b rename Ki_PageDescr to PAGE_INFO, encapsulate it in accessors, and move it into the BOARD 2011-12-22 15:57:50 -06:00
Wayne Stambaugh de96452c41 Minor common PCB library code fixes.
* More common header file compiler fixes.
* Translate French code naming and comments.
* Remove global variable ScreenPcb.
* Dead code removal.
2011-09-24 14:33:28 -04:00
Wayne Stambaugh edd35b4e90 PCB common library header rationalization.
* All header files used to create the PCB common library now compile as
  stand alone code.  This prevents the need to define them in a specific
  order to make source code compile properly.  It should also now be
  possible to relocate the source code to build the common PCB library
  to a separate folder.
2011-09-23 09:57:12 -04:00
Wayne Stambaugh ebc7259a91 Rename WinEDA_App class to EDA_APP and remove redundant includes. 2011-09-06 10:09:40 -04:00
Jerry Jacobs 6b39096b03 Cleanup of all menubar code, see CHANGELOG.txt 2011-04-06 15:52:47 +02:00
jean-pierre charras 16e9ddc27a * Gerbview, Pcbnew: add SetLocaleTo_Default() after reading double in config to fix issues with decimal separator (when the separator is not a point).
(WxWidgets 2.9.1 seems call setlocale( LC_NUMERIC, "" ) when wxConfig read doubles stored in config, but forget to back to current locale.)
Note: perhaps there are some dialogs that need this call to  SetLocaleTo_Default() ).
* Minor  code cleanup in pcbnew/netlist.cpp
2011-04-02 18:14:07 +02:00
jean-pierre charras a97f5c2530 Gerbview: code cleanup and very minor fix. 2011-03-14 22:19:13 +01:00