Commit Graph

3447 Commits

Author SHA1 Message Date
Maciej Suminski e03bc32e49 Eagle plugin: Code formatting 2017-10-20 08:38:38 +02:00
Maciej Suminski f049b01a59 Eagle plugin: Added 'static' and 'const T&' as applicable 2017-10-20 08:38:38 +02:00
Russell Oliver ea8f7ed02d Eeschema: Eagle plugin> work on schematic and symbol elements 2017-10-20 08:38:37 +02:00
Maciej Suminski c727423979 Work in progress
- !! Eeschema uses Eagle plugin for loading schematics (i.e. it does not
use KiCad format anymore)
- Fixed build errors
- Fixed a few crashes
- Code formatting
2017-10-20 08:38:37 +02:00
Maciej Suminski f5b2a2ea57 Code formatting and cleanup 2017-10-20 08:38:37 +02:00
Tomasz Włostowski bcde2a77e2 common/single_top: allow to launch footprint editor from the command line (--frame switch) 2017-10-19 23:15:48 +02:00
Tomasz Włostowski dc7b743782 common: VECTOR2I-based RotatePoint() 2017-10-19 23:15:13 +02:00
Tomasz Włostowski d2c9a5d81a geometry: Area() method in SHAPE_LINE_CHAIN 2017-10-19 23:14:36 +02:00
jean-pierre charras b5f23befeb Fix incorrect initialization of default colors for some items.
Fix incorrect detection of key handled in footprint_wizard_frame.cpp
2017-10-09 10:35:53 +02:00
jean-pierre charras 246f8cae24 Fix missing initialization of colors settings of a board, when created by a python script.
A pointer was not initialized, therefore plots from a python script sometimes crash.

Fixes: lp:1721166
https://bugs.launchpad.net/kicad/+bug/1721166
2017-10-08 16:21:27 +02:00
jean-pierre charras 4905bbe500 hotkey management: enhancements in code to know if a hotkey was handled by an event or not.
No actual change in key management: in legacy it was partially existing, and not yet used in GAL mode.
2017-10-06 09:23:13 +02:00
jean-pierre charras 1164eaab72 Make the "No Net" mark color editable (mark for pads having no net name)
Note: this mark is currently drawn only in legacy canvas.
2017-10-05 20:11:55 +02:00
jean-pierre charras acccb10ca5 Minor fix: Fix a incorrect min size of COLOR4D_PICKER_DLG on Linux+KDE 2017-10-04 16:35:57 +02:00
jean-pierre charras 4b010ca129 Fix useless trailing and leading spaces in a few messages. Fix also capitalization in a few menus. 2017-10-02 09:25:48 +02:00
Kristoffer Ödmark c0981b8444 Added a new plugin that can save and load to clipboard, using ctrl+shift+c/v for copy pasting
Added the needed kicad_clipboard files and made copy pasted modules have no path
2017-09-30 14:28:53 +02:00
Maciej Suminski 4bd51b7049 Fixed EDA_BASE_FRAME::removePaneBorder() for classes not using AUI
Fixes: lp:1720386
* https://bugs.launchpad.net/kicad/+bug/1720386

Fixes: lp:1720388
* https://bugs.launchpad.net/kicad/+bug/1720388

Fixes: lp:1720389
* https://bugs.launchpad.net/kicad/+bug/1720389
2017-09-29 17:08:32 +02:00
jean-pierre charras 5aeb6129ca Fix a bug in KIGFX::COLOR4D ctor: . The alpha channel (opacity) was set to 0. this is a mistake. It is now set to 1.0
Fixes lp:1718389
2017-09-29 14:52:51 +02:00
Maciej Suminski 6006b54dd9 Fixed a crash when editing a pad of a bottom layer module
Fixes: lp:1720007
* https://bugs.launchpad.net/kicad/+bug/1720007
2017-09-28 09:58:34 +02:00
Maciej Suminski 068a29952c Changed AUI toolbars background from gradient to solid
Based on patches from Windsor Schmidt <windsor.schmidt@gmail.com>
2017-09-27 23:23:06 +02:00
jean-pierre charras b4a59eb96d Fix minor issues in DIALOG_KEEPOUT_AREA_PROPERTIES.
Fix keepout zone creation in legacy canvas.
Add a comment in lset.cpp
2017-09-27 16:54:28 +02:00
Oliver Walters 363fc598c0 Fixed bug in FlipLayerMask
- Offset for internal copper layers was incorrect
- Incorrect mask was used
2017-09-27 10:35:00 +02:00
Oliver Walters 0f6ec7632b Enable multi-layer for keepout zones
- Load / save from PCB file correctly
- Doesn't display properly yet
- Keepout only actually applies to one layer (for now)
2017-09-27 10:34:59 +02:00
Kevin Zheng 6487ec5c21 Reword hotkey reset menu items
Fixes lp:1717637
2017-09-26 09:21:48 -04:00
Jon Evans 9383987b1c Skip calling RTREE::Remove() when adding items to a VIEW 2017-09-25 13:39:38 +02:00
Maciej Suminski 05a120f09f Unified {Load,Save]CanvasTypeSetting in EDA_DRAW_FRAME 2017-09-25 13:39:32 +02:00
Jon Evans 77bf22359e Move zoom_tool.h to include 2017-09-25 13:35:01 +02:00
Jon Evans 0b9b8d3e93 Add support for reversed draw order and Cairo negative draw mode 2017-09-25 13:35:01 +02:00
Maciej Suminski df472e6426 Added mouse position refresh event WX_VIEW_CONTROLS::WarpCursor() 2017-09-22 11:13:45 +02:00
Michael Geselbracht da037027fb Do not warp viewport when dragging FPs
Fixes: lp:1714611
* https://bugs.launchpad.net/kicad/+bug/1714611
2017-09-22 11:13:40 +02:00
Wayne Stambaugh 427e5ec461 Eeschema: fix crash when undo called during item edit.
Add EDA_DRAW_FRAME::isBusy() method to test if the current item is being
edited or a block operation is in progress.

Ignore undo and redo commands when editor is busy.

Fixes lp:1718656

https://bugs.launchpad.net/kicad/+bug/1718656
2017-09-21 12:37:52 -04:00
Wayne Stambaugh cb764d73c5 Minor trace logging improvements.
Make all trace environment variable strings upper case and prefix with
KICAD_TRACE_ for consistency.

Add Doxygen group for the trace environment variable strings.
2017-09-21 08:58:41 -04:00
jean-pierre charras b18601dfc6 Send wxEVENT_CHAR to GUI (if the key is not a special key that scrolls the draw panel) both on Linux and Windows
fix lp:1718488
2017-09-20 20:21:54 +02:00
jean-pierre charras 4e8ad8516a Update gerber job file format and job file extension.
Gerber job file extension is now .gbrjob, according to latest changes in Gerber job file spec.
2017-09-20 18:14:20 +02:00
jean-pierre charras d8ade988ce workaround for a minor and strange issue: size of chars '-' and '_' are incorrect in msdf_atlasgen fonte. the size of 'x' char is used instead. 2017-09-19 18:56:33 +02:00
jean-pierre charras e2d3fcec02 Add support for custom pad shape. Full support in DRC and PnS.
add option to use shape or convex hull as clearance area in zones.
simplify code to handle clearance area
2017-09-19 09:02:53 +02:00
jean-pierre charras 48393c605e Try to fix special keys (ARROWS, PAGE UP/DOWN) issues both on Linux and Windows in GAL mode
Fixes: lp:1717270
https://bugs.launchpad.net/kicad/+bug/1717270
2017-09-18 16:04:31 +02:00
jean-pierre charras e2505cb2fd better fix than commit c0bc2f1 that tried to fix an overzealous event propagation:
The fix is now only for Windows, because it creates issues and does not fix the special keys issues on Linux.
This is due to the serious differences in event management between platforms.
2017-09-15 16:29:26 +02:00
Jon Evans d9396616ef Add support for panning with left and right mouse buttons 2017-09-15 13:35:52 +02:00
jean-pierre charras c0bc2f1bee Try to fix an overzealous event propagation that creates some key events (arrows, page up page down and some others) and mouse events called twice.
the first call is the right call, the last call being the default handler.
2017-09-15 11:29:50 +02:00
jean-pierre charras cf178fd20a add a wxASSERT just in case. 2017-09-15 11:29:49 +02:00
Jon Evans 93de82f0b2 Fix scrollbars in macOS GAL canvases 2017-09-15 11:29:49 +02:00
Jon Evans 5364cd9681 Improved zoom behavior on MacOS 2017-09-15 11:27:35 +02:00
Jon Evans 49a3e7ec2d Support scrollbar controls in GAL canvas 2017-09-14 07:34:29 +02:00
Wayne Stambaugh 33cc7b3f99 Fix broken default icons in menus setting for OSX. 2017-09-13 12:59:42 -04:00
Jon Evans 8182369c64 Make RULER_ITEM generic and ensure text mirroring is disabled 2017-09-12 12:49:43 +02:00
Jon Evans b6298a0a41 Don't force grid color to LAYER_GRID in EDA_DRAW_PANEL_GAL 2017-09-12 12:49:17 +02: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
Maciej Suminski 8c7175b00d Upload correct amount of vertex data in CACHED_CONTAINER_RAM
Previous implementation uploaded only vertices with indices less
or equal to the number of stored vertices, which is invalid when
the container become fragmented.

Fixes: lp:1712887
* https://bugs.launchpad.net/kicad/+bug/1712887
2017-09-09 21:07:32 +02:00
Maciej Suminski 342bb2bf78 Code formatting
Renamed VERTEX related constants to follow UPPER_CASE naming.
2017-09-09 21:07:32 +02:00
jean-pierre charras 8c70681b31 Remove useless includes and more fixes to avoid including curl.h in files, when not mandatory. 2017-09-05 08:07:31 +02:00
jean-pierre charras 6ea6c7219a Avoid including curl.h in dialog about (including curl.h creates constraints with wxWidgets especially on Windows)
and remove duplicate code.
2017-09-04 12:53:50 +02:00
Wayne Stambaugh d190aa423f Minor version information improvements.
Include GTK+ version when appropriate so developers don't have to try to
figure out which version of GTK+ wxWidgets was built against.

Add KICAD_SPICE option status.
2017-09-01 08:19:17 -04:00
Jon Evans eec1366ead Move ZOOM_TOOL to common; add RMB-drag to zoom out 2017-08-31 10:04:00 +02:00
jean-pierre charras 50164e9968 Add Gerber job file writer in Pcbnew, and a basic reader in Gerbview. Currently disabled
Fix also very minor issues in Gerbview
2017-08-30 11:04:33 +02:00
Tomasz Włostowski 2e4c22f718 router: fix corruption of board data when the inline drag is activated while the router tool is running
Fixes: lp:1712838
* https://bugs.launchpad.net/kicad/+bug/1712838
2017-08-30 01:16:06 +02:00
Michael Kavanagh 82ce90ecdc PL Editor UI Improvements: Menubar, toolbar and hotkeys 2017-08-29 11:52:34 -04:00
jean-pierre charras 758445e33e Fix a compil warning and a wxASSERT in COLOR4D_PICKER_DLG_BASE 2017-08-28 17:40:26 +02:00
jean-pierre charras e3c64f1f06 Slightly modify keywords used to store color config of Eeschema and Pcbnew, to avoid this config destroyed each time a stable version is run. 2017-08-27 09:06:26 +02:00
Mathias Grimmberger ffeba9de93 Change track width setting to dropbox 2017-08-25 16:46:49 +02:00
Maciej Suminski 31ef52a365 Fix fine-grid cursor movement using arrow keys
Fixes: lp:1497976
* https://bugs.launchpad.net/kicad/+bug/1497976
2017-08-22 15:14:33 +02:00
Maciej Suminski d4fddf1929 Fix eeschema crash when saving LIB_BEZIER objects 2017-08-22 13:29:53 +02:00
Maciej Suminski b5db6a7d5d Map/unmap vertices once per layer order update
Multiple memory map/unmap operations cause a significant delay on
GPUs that fetch vertices from RAM.

Fixes: lp:1701936
* https://bugs.launchpad.net/kicad/+bug/1701936
2017-08-21 13:28:09 +02:00
jean-pierre charras 6be2f2934e Exchange footprint dialog uses now the reporter widget for a better report of actions and errors.
Fixes: lp:1711379
https://bugs.launchpad.net/kicad/+bug/1711379
2017-08-18 20:26:45 +02:00
jean-pierre charras 28c04cbbf5 Fix filename in a include 2017-08-18 16:56:49 +02:00
jean-pierre charras 4c9d0b9c0a Refactor About dialog:
Code refactor
Fix coding style issues
Add a button to display the build version info, and add a tooltip to the copy button.
2017-08-18 16:16:48 +02:00
Maciej Suminski 6ff065fa63 Fixed recognition of GPUs not handling glMapBuffer() efficiently
Fixes: lp:1685335
* https://bugs.launchpad.net/kicad/+bug/1685335

Fixes: lp:1683041
* https://bugs.launchpad.net/kicad/+bug/1683041
2017-08-18 15:02:46 +02:00
jean-pierre charras 0999b5cb77 Make texts search-able in PDF files (using invisible texts behind stroked texts) 2017-08-15 15:53:00 +02:00
Wayne Stambaugh f781691049 Eeschema: add symbol library table editor dialog.
Create a new dialog to edit global and project specific symbol library
tables.

Add menu entries for new symbol library table editor in schematic editor
and symbol library editor main frame menus.

Add command event handler for symbol library table editor dialog to
SCH_BASE_FRAME so it is accessible from derived frames.

Fix bug in default environment variables initialization.  A test for
existing user defined environment variables was preventing any new
default environment variables added to the list from being initialized.
2017-08-12 08:10:34 -04:00
jean-pierre charras 84f1c8e0c6 color4Dpickerdlg.cpp: avoid selecting accidentally a new color when the mouse cursor is inside a color map when opening the dialog 2017-08-12 07:52:15 +02:00
jean-pierre charras 8a1a3ed36c Better fix for compil problems in utils.cpp 2017-08-09 15:30:01 +02:00
jean-pierre charras 7ab6368869 Fix compil problems in utils.cpp, to be compatible with msys2/windows and linux. 2017-08-09 14:05:10 +02:00
Maciej Suminski c18d148589 Moved VERTEX_CONTAINERs intialization to the constructors 2017-08-08 15:33:57 +02:00
Maciej Suminski 4ae29aa693 Fixed a shadowing variable warning 2017-08-08 15:31:45 +02:00
Maciej Suminski 2697a21a7a Yet another try for correct function signature type cast 2017-08-08 15:26:50 +02:00
Maciej Suminski ef6910faa9 Take two for satisyfing picky compilers (casting nullptr to void*) 2017-08-08 14:53:34 +02:00
Maciej Suminski e91ce300fb Cast nullptr to const void* to satisfy picky compilers 2017-08-08 14:47:27 +02:00
Maciej Suminski 262fcc91af Fixes for video cards unable to use gl{Un,}MapBuffer correctly
Fixes: lp:1685335
* https://bugs.launchpad.net/kicad/+bug/1685335

Fixes: lp:1683041
* https://bugs.launchpad.net/kicad/+bug/1683041
2017-08-08 14:26:05 +02:00
Maciej Suminski 46b5575c51 OpenGL driver debug routines 2017-08-08 09:31:57 +02:00
Maciej Suminski ef22c2589d Store forced cursor position in VC_SETTINGS 2017-08-07 08:59:32 +02:00
Maciej Suminski e8345dce51 Display GRID_HELPER auxiliary axes and snap points 2017-08-07 08:59:32 +02:00
jean-pierre charras b8c621a991 fix a few Coverity warnings. 2017-08-06 14:23:03 +02:00
jean-pierre charras 4e96f9990d Use the new color4Dpicker to choose a color in Eeschema.
However, the opacity is not modifiable because the wxDC used in Eeschema does not know the alpha channel.
2017-08-06 10:42:11 +02:00
Tomasz Włostowski 32185ddcd3 Multiple improvements concerning colors, configuration handling and legacy features in pcbnew:
- support for background color setting
    - removed several global config settings (such as g_Drc_On)
    - wrapped most of global config settings in PCB_GENERAL_SETTINGS class
    - reorganized PCB general options dialog to clearly mark which options concern only the legacy canvas
    - new GAL feature for legacy users: double-click (or E) to change track width available as an option.

Fixes: lp:1530543
* https://bugs.launchpad.net/kicad/+bug/1530543

Fixes: lp:1707145
* https://bugs.launchpad.net/kicad/+bug/1707145
2017-08-04 16:06:57 +02:00
jean-pierre charras 1f6854f2b8 Make internal errors messages not translatable 2017-08-01 13:12:59 +02:00
jean-pierre charras abe2a46ae7 Pcbnew: Fix plot PDF, broken by commit f3457794cf
Also disable option to use native font in PDF and PS plotter format, because this option has never worked.

Fixes: lp:1707412
https://bugs.launchpad.net/kicad/+bug/1707412
2017-07-31 20:05:30 +02:00
Maciej Suminski 76bd05a69b Prevent creating too many transitions by TOOL_MANAGER
- added TOOL_INTERACTIVE::resetTransitions()
- made protected and moved TOOL_BASE::setTransitions() to TOOL_INTERACTIVE
- TOOL_MANAGER calls TOOL_INTERACTIVE::resetTransitions() instead of
setTransitions()
2017-07-31 15:09:19 +02:00
jean-pierre charras e10f0c729b Fix minor compil warnings 2017-07-30 14:24:21 +02:00
Maciej Suminski 2652cfeafd Restore the cursor position after the context menu is closed
Fixes: lp:1696328
* https://bugs.launchpad.net/kicad/+bug/1696328
2017-07-28 10:55:38 +02:00
Maciej Suminski 7399759b3b Fixed polygon DRAWSEGMENT rendering in OpenGL GAL
Fixes: lp:1704542
* https://bugs.launchpad.net/kicad/+bug/1704542
2017-07-28 10:34:47 +02:00
Tomasz Włostowski b964569db7 pcbnew: enable net selection combobox in Track/Via properties dialog 2017-07-27 16:21:54 +02:00
Maciej Suminski 950d87a920 Removed boost::adaptor from ACTION_MANAGER 2017-07-27 16:06:30 +02:00
Maciej Suminski 75f68061a4 Save the drag origin only on the first click 2017-07-27 10:54:08 +02:00
jean-pierre charras 58c32367ee filter useless autosave tests, and optimization of autosave test in Eechema 2017-07-26 18:06:04 +02:00
Dick Hollenbeck 19e6bde09a Rewrite class UTF8 to contain rather than extend std::string storage.
This forces the compiler class specific features rather than borrowing
from the base class's std::string.  In some cases prior to this,
wxString( std::string ) was being called rather than UTF8::operator
wxString() leading to garbled wxStrings.

Added function UTF8::wx_str() which is of great convenience also.

Implicit conversions still work as before, and hopefully more reliably.
2017-07-26 08:30:12 -04:00
Dick Hollenbeck 4e7de8a761 Reverse commit 4011ed4e31.
This commit was too broad and not cognizant of the purpose of the class
UTF8.

Add MAYBE_VERIFY_UTF8() macro, which can trap non-UTF8 encoded strings in
debug builds.

Use that macro conditionally in class UTF8 to trap non-UTF8 encoded strings
being put into UTF8 instances.
2017-07-26 08:26:56 -04:00
Oliver Walters 161045f17d Speed improvement for select / deselect in GAL
- No longer invalidates the item layers
- For multiple items, this results in a drastic speed improvement
2017-07-25 16:34:03 +02:00
Oliver Walters c27f5b725d Improved various error messages
- Moved developer "jargon" to details pane
- Changed error messages to "WHAT" rather than "WHY" or "WHERE"
2017-07-25 07:37:14 -04:00
Oliver Walters a0a3ca6646 Added extra information to error and info messages
Optional extra information string which is displayed in a drop-down "details" box
2017-07-25 07:37:13 -04:00
Fabrizio Tappero cef616fcd8 fixed text titles that should have only the first word capitilized 2017-07-21 10:19:29 -04:00
Fabrizio Tappero 7be14f774d fixed plot menu labels 2017-07-21 10:19:29 -04:00
Maciej Suminski fe89fdfb24 Removed incorrectly defined assert 2017-07-19 13:05:30 +02:00
jean-pierre charras cb75b72978 Refinements if new color 4D selector 2017-07-19 11:26:28 +02:00
Maciej Suminski 984ac70106 Added COMMIT::GetStatus() and minor refactor
Moved duplicated code to a new function and added
an assert to warn against possible memory leak.
2017-07-19 10:46:10 +02:00
jean-pierre charras 5f4599fb56 Add a new color selector, to adjust color selection for GAL mode, with support of opacity (alpha channel)
Pcbnew: save opacity value in color config, and keep it when switching between legacy and gal mode.
2017-07-18 19:07:47 +02:00
Chris Pavlina 5755582c53 Minor FOOTPRINT_FILTER fix 2017-07-17 15:00:13 -06:00
jean-pierre charras ed66496242 Fix an issue (created by commit 16cb6a6ca0) when converting a color4D to a legacy color
Fixes: lp:1704724
https://bugs.launchpad.net/kicad/+bug/1704724
2017-07-17 09:59:34 +02:00
jean-pierre charras 16cb6a6ca0 color4d: fix incorrect conversion from rgb to HSV when r = g = b. 2017-07-16 17:10:24 +02:00
jean-pierre charras d3b382c281 GAL mode: the grid don't fill the full screen when moving the grid origin to negative values.
Fixes: lp:1703330
https://bugs.launchpad.net/kicad/+bug/1703330
2017-07-14 20:18:37 +02:00
Wayne Stambaugh e01eb29758 Symbol and footprint library table parser fixes.
Fix potential memory leak in both footprint and symbol library table
parsers when a duplicate library nickname entry exists.

Parse entire symbol library table before raising duplicate nickname
exception.

Improve the duplicate library table nickname error message to make
life easier for users to fix broken tables.
2017-07-13 10:09:38 -04:00
Maciej Suminski d5095252a0 eeschema: Fixed use-after-free on exit when paste operation is aborted 2017-07-13 13:33:13 +02:00
jean-pierre charras c93ab4d5da Fix possible crash and issues when a incorrect fp lib table is loaded:
correct lines are loaded, and pcbnew / eeschema is no more aborted.
Fixes: lp:1701627
https://bugs.launchpad.net/kicad/+bug/1701627
2017-07-12 20:24:35 +02:00
Maciej Suminski 08c4a0bc7b Fixed SELECTION_TOOL::selectCursor()
In the previous version the method did not work correctly
when an action was invoked from context menu. In such case,
the cursor position was obtained in the moment of selecting
the action, instead of using the right click location.
2017-07-12 09:34:20 +02:00
jean-pierre charras 969209c2cc Fix a few doxygen warnings and add a few comments. 2017-07-04 11:08:27 +02:00
Maciej Suminski 098814e205 Fixed a memory leak in BLOCK_SELECTOR 2017-07-04 10:14:58 +02:00
Maciej Suminski e18475f220 Renamed remaining constants to match the action (see ab44e7cc) 2017-07-04 10:08:33 +02:00
Kristoffer Ödmark 4fb2f80dd4 Eeschema copy/cut/paste to ctrl+c/x/v cut is now undoable Highlight net is now at ctrl+b by default 2017-07-03 16:41:47 +02:00
jean-pierre charras f074b57094 Pcbnew: fix minor issue in %TO.C advanced attribute, and avoid creating an unused D10 tool in Gerber files. 2017-07-02 16:41:31 +02:00
Maciej Suminski 3afef4e19d Display an error when pcbnew.kiface is not available for FP selector
DIALOG_COMPONENT_CHOOSE displays footprint preview when pcbnew kiface
is available, but it crashed when it was not in the same directory
as the executable. Now it displays an error message that allows the
user to quickly identify the problem.

Fixes: lp:1695005
* https://bugs.launchpad.net/kicad/+bug/1695005
2017-06-30 23:01:21 +02:00
jean-pierre charras e3d69b619f Pcbnew: fix issue in dialog_fp_lib_table: when the only changes were the plugin name, changes were not taken in account.
Because the FP_LIB_TABLE::operator == was incorrect
2017-06-30 16:03:17 +02:00
jean-pierre charras 1e770f56a6 Fix a non ASCII7 string in a message. Only ASCII7 chars can be used in sources.
Non ASCII7 symbols are not allowed because the encoding is OS dependent.
2017-06-24 20:05:11 +02:00
jean-pierre charras 0719b99ad8 Minor enhancement in color selection on Windows 2017-06-24 10:45:26 +02:00
Tomasz Włostowski 5c0edbabab Fixes for the connectivity & board cleanup algorithms 2017-06-23 11:12:38 +02:00
Tomasz Włostowski de7f4d7aa4 fixed unresolved symbols while running cvpcb 2017-06-23 11:12:37 +02:00
Tomasz Włostowski 3b16d3cffe further DLIST/Iterators cleanup, some code formatting 2017-06-23 11:12:37 +02:00
Tomasz Włostowski 9ad886344b New connectivity algorithm. 2017-06-23 11:12:36 +02:00
jean-pierre charras 996bcdf458 Fix a few doxygen warnings 2017-06-16 09:18:31 +02:00
jean-pierre charras 2476e88c9d Fix a few doxygen warnings 2017-06-15 13:13:24 +02:00
Wayne Stambaugh 66e97fa905 Doxygen comment improvements.
Fix lots of Doxygen warnings.

Fix Doxygen comment for IO_MGR::FootprintEnumerate() which was recently
changed.
2017-06-13 19:47:46 -04:00
Kristoffer Ödmark 19d5cc7548 Removed all exception specifiers since deprecated.
Exception specifiers are deprecated in cpp11, so went through them all
and removed them from the code.
2017-06-12 13:54:55 -04:00
Maciej Suminski dcc803ecb1 VIEW_CONTROLS::GetMousePosition() returns the mouse position in world coordinates. 2017-06-12 16:24:52 +02:00
jean-pierre charras ad48cd435d Replace SetToolID( ID_NO_TOOL_SELECTED, ...) by SetNoToolSelected() in code 2017-06-12 16:17:48 +02:00
jean-pierre charras 6ed4f9b208 Make EDA_DRAW_FRAME::SetToolID and mouse cursor shape setting working in GAL canvases, and uses same mouse cursor shapes in legacy and gal canvases.
Starting fixing incorrect UI behavior of Zoom to selection in Pcbnew.
2017-06-12 15:16:09 +02:00
Wayne Stambaugh 3cec63e9b9 Pcbnew: plugin improvements.
Allow partial library reads in libraries that support footprint per file.
This includes the KiCad and GEDA footprint libraries.

Allow for partially cached libraries rather than ignoring all valid files
when an error occurs.
2017-06-11 16:21:19 -04:00
jean-pierre charras 526b5e2cd3 Fix broken behavior of the "Zoom to selection" tool in Gerbview and Eeschema. 2017-06-10 09:07:17 +02:00
Fabrizio Tappero 1a30b4fb05 Launch correct default system PDF viewer on Linux.
The is a bug in the wxMimeTypeManager object that sets the wrong default
PDF viewer on Linux.  Using wxLaunchDefaultApplication resolves the issue.

Remove angle brackets <> from error message as this causes issues with
controls that interpret HTML text.

Remove GetChars() from string formatting functions since it is not
required with wxWidgets 3 or greater.
2017-06-07 12:41:04 -04:00
Fabrizio Tappero ac9a64a173 general UI fix. Fixed a lot of icons and a lot of menu.
Also a few no longer used .cpp icon files are removed.
2017-06-02 11:51:11 +02:00
Maciej Suminski e79f97860c Bezier2Poly refactor
Before the refactor library browser display Bezier curves correctly only
once, at other times they were just straight lines or crashed the
application.
2017-05-16 17:58:09 +02:00
jean-pierre charras 5ad1a13096 Fix a compil issue on Windows (W7 32bits). Could be an obscure conflict in var/keyword names. 2017-05-10 14:32:36 +02:00
Maciej Suminski b71fc5564a Code formatting fixes 2017-05-10 11:40:49 +02:00
Oliver Walters cd738297b0 SELECTION_AREA color now indicates selection mode
BLUE = Normal
GREEN = Addition
RED = Subtraction

Line color indicates "window" or "crossing" selection mode
2017-05-10 10:57:29 +02:00
Oliver Walters 1f1143743e HitTest improvement for EDA_TEXT 2017-05-10 10:57:29 +02:00
Oliver Walters b53ba56ac2 Use CTRL modifier to deselect items 2017-05-10 10:57:29 +02:00
Oliver Walters 8b49c6e5ed Alter selection area colours based on selection mode
- Left to Right is slightly blue (as current)
- Right to left is slightly green
2017-05-10 10:57:29 +02:00
Oliver Walters f338d46476 HitTest for Rectangular pads
HitTest for Rectangular pads

- Works at any rotation, even with Shape Offset
- Fixed bugs in D_PAD BoundingBox calculation
2017-05-10 10:57:28 +02:00
Oliver Walters f8734bd057 Fixed ::HitTest for Circle shape
- Testing against rectangle intersection now works correctly
- Previously tested against BoundingBox() not circle outline
2017-05-10 10:57:28 +02:00
Maciej Suminski 99f65f4dbf Added const T& to Eagle PCB import plugin methods 2017-05-04 15:44:14 +02:00
Alejandro García Montoro 9cf934ef17 Moves Eagle XML parser to common, replacing boost with wx.
All E'STRUCTS' are moved to common except for ERULES (which is
specific to pcbnew and needs its internal units), still in
pcbnew/eagle_plugin.{h,cpp}

In order to get rid of another boost dependency, this also changes
the parsing of the XML from Boost.PropertyTree to wxXml.

To replace boost::optional, an OPTIONAL_XML_ATTRIBUTE class has
been implemented. This could be replaced with std::optional when
C++17 is ready.
2017-05-04 15:29:45 +02:00
jean-pierre charras 4f2ed1b05f Plot gerber: fix a minor issue: an aperture attribute was incorrectly set on non copper layers when drawing some pads. 2017-05-04 08:55:17 +02:00
Wayne Stambaugh 096d9fbbf9 Pcbnew: continue loading footprints after first failure.
The footprint library cache handler would throw an exception on the
first error it encountered preventing all subsequent footprint files
from being parsed even if there was nothing wrong with them.  This
commit queues errors until all of the footprint files in the folder
have been parsed.

Fixes lp:1416736

https://bugs.launchpad.net/kicad/+bug/1416736
2017-05-03 15:27:07 -04:00
Eldar Khayrullin f3457794cf Pcbnew: add option to plot DXF editable text
Add option to plot DXF oneline ASCII text as editable text (in non-outline mode)

Fixes: lp:1423515
* https://bugs.launchpad.net/kicad/+bug/1423515
2017-05-02 15:07:19 -04:00
Oliver a39856485c Added component table dialog
- Allows grouping of matched components
- Bulk edit of components in a spreadsheet window
- User can choose to save / undo changes
- All changes are pushed to the undo stack in a single operation
- Export table to HTML / CSV output
2017-05-02 09:39:01 -04:00
jean-pierre charras c8706e9c15 Fix compil issue in Python support. 2017-05-01 14:19:38 +02:00
jean-pierre charras afe92c7bfc Pcbnew: Add creation of Drill Files in Gerber X2 format.
Gerbview: add support of drill files in Gerber format.
Fix also an issue in drill dialog: Axis choice is now common to plot a drill files.
2017-05-01 12:43:40 +02:00
jean-pierre charras a92ea8c75b Fixes: lp:1687014 Footpring editor disappearing axes crosshair
https://bugs.launchpad.net/kicad/+bug/1687014
2017-04-29 11:43:02 +02:00
Eldar Khayrullin 0af5695e51 Pcbnew: add option to plot DXF lines in outline mode.
Add option to plot dialog to plot DXF layers *.Cu, *.Adhes, *.Paste, and
*.Mask in outline mode or line mode.

Fixes lp:1643330

https://bugs.launchpad.net/kicad/+bug/1643330
2017-04-25 08:24:55 -04:00
jean-pierre charras 0e6723bb10 Fix color management in DXF files, broken since a long time. 2017-04-21 16:44:15 +02:00
jean-pierre charras 873e57e63e remove useless or incorrect wxASSERTs 2017-04-21 14:32:06 +02:00
Maciej Suminski 481fd233d4 Enable cursor snapping by default
Fixes: lp:1671869
* https://bugs.launchpad.net/kicad/+bug/1671869
2017-04-20 15:04:05 +02:00
Maciej Suminski 74847bf8ff Code formatting and clean-up 2017-04-20 14:01:38 +02:00
jean-pierre charras e97c91b025 Fixes: lp:1683128 (pcbnew: the cairo canvas ignore arc width)
https://bugs.launchpad.net/kicad/+bug/1683128
2017-04-16 19:21:31 +02:00
jean-pierre charras 88105f891f Fixes Pcbnew bug: Drag Zone Outlines no longer working in legacy view 2017-04-16 18:32:47 +02:00
jean-pierre charras 50fd7a27cf Fix a few coding issues in dialog_edit_module_for_Modedit.
(Mainly, remove OnOkClick and OnCancelClick to use default handlers, and use TransferDataFromWindow to update fields)
Fix also a minor issue in lib_id
2017-04-16 15:09:05 +02:00
Miles McCoo b321efffaf Minor Pcbnew Python scripting fix to expose SHAPE_POLY_SET interface
The recent refactoring work to move zones from CPolyLine to
SHAPE_POLY_SET resulted in a reduction in pcbnew's python
capabilities.  This change exposed SHAPE_POLY_SET to restore
that functionality (albeit with slightly different method names)
2017-04-14 10:23:42 -04:00
Konrad Beckmann c4ea54227e Remove redundant statement in DSNLEXER::PopReader 2017-04-13 14:03:37 -04:00
Simon Wells 117faf898f Disable icons in menus by default on osx 2017-04-13 13:49:55 -04:00
jean-pierre charras 80371134d7 better fix than commit 6c083ebf4c, because the issue was existing in other dialogs
Fix incorrect frame deletion, only noticeable when eeschema is run in stand alone mode.
After selecting a footprint using the footprint viewer, the application cannot be closed.
Reason:
the footprint viewer ctor creates an instance (not shown) of a FRAME_PCB.
Unfortunately, this pcb frame was not deleted by Eeschema, in stand alone mode,
preventing the application to be closed because a frame was still active after closing the schematic editor frame.
Now the footprint viewer ctor delete this instance after use, if it was not previously existing.
2017-04-13 18:28:16 +02:00
jean-pierre charras 6c083ebf4c FOOTPRINT_SELECT_WIDGET: fix incorrect frame deletion, only noticeable when eeschema is run in stand alone mode.
After selecting a footprint using the footprint viewer, the application cannot be closed.
Reason:
the footprint viewer ctor creates an instance (not shown) of a FRAME_PCB.
Unfortunately, this pcb frame was not deleted by Eeschema, in stand alone mode,
preventing the application to be closed because a frame was still active after closing the schematic editor frame.
2017-04-13 15:17:30 +02:00
jean-pierre charras 57ded58231 Cvpcb: fix not working footprint filtering by component keyword. 2017-04-11 08:27:20 +02:00
jean-pierre charras ba37d6fca3 Temporary fix of broken command add corner to zone in GAL mode.
Fixes: lp:1680339
https://bugs.launchpad.net/kicad/+bug/1680339
2017-04-06 19:04:47 +02:00
Maciej Suminski bf590780b8 Do not store 'force cursor position' setting in VIEW_CONTROLS::SETTINGS
Fixes: lp:1678875
* https://bugs.launchpad.net/kicad/+bug/1678875
2017-04-04 00:57:54 +02:00
jean-pierre charras 6eb2000b69 fix Coverity warning (CID 151565) (CID 155147) 2017-04-01 20:05:33 +02:00
jean-pierre charras 04e24282a8 Fix bug: Render->Grid(Color) doesn't saved between kicad sessions.
Fixes: lp:1670084
https://bugs.launchpad.net/kicad/+bug/1670084
2017-04-01 11:48:02 +02:00
Wayne Stambaugh 9c2ebf32f1 Initial symbol library table implementation prep work.
Add loading symbol library table code to schematic PROJECT object.

Fix minor issues with loading global symbol library table.

Add default symbol library path environment variable to the environment
variable list and change the variable name to KICAD_SYMBOL_DIR.

Add code to SCH_SCREENS to test if all library nicknames of the symbol
library IDs are empty.

Remove unnecessary KICAD_USE_SCH_IO_MANAGER build option.
2017-03-31 16:29:34 -04:00
John Beard c3ff34e0df Add reset text attributes function to GAL - use for arc tool
Independent drawing functions (that don't expect any particular state to
be set up fo them) on the GAL need to reset the GAL properties they
use. This adds GAL::ResetTextAttributes() to make this easier.

This is important, as failing to reset mirroring can cause asserts in
OpenGL.

This is used in the Ruler tool (which previously did it one attribute at
a time) and also the Arc layout assistant, which previously failed to
reset mirroring.

Also reset on GAL construction, as these members appear to be
uninitialised.
2017-03-31 15:59:31 +02:00
Jon Evans 8cd1df0524 Add output stream operator for COLOR4D 2017-03-31 06:48:04 -04:00
Chris Pavlina 3234087dc9 Move wxDataViewCtrl manipulators out of dialog_choose_component.cpp
Fixes: lp:1677925
* https://bugs.launchpad.net/kicad/+bug/1677925
2017-03-30 21:47:14 -04:00
Wayne Stambaugh b4e2757119 Make FP_TBL_MODEL reusable.
Factor out the FP_LIB_TABLE specific content from FP_TBL_MODEL into a new
LIB_TABLE_GRID class that can be used for any library table grid mix in.

Create new FP_LIB_TABLE_GRID object for the footprint library edit dialog.

Add method GetEnvVariables() to return any environment variables found in
a LIB_TABLE object.
2017-03-30 18:36:37 -04:00
Jon Evans 3ec28e2acf Refactor layer enumerations to all live in the same place 2017-03-30 16:01:48 -04:00
John Beard ef9f8d40c6 Init GAL class members (Coverity fixes)
Fixes: CID 157139 (GAL)
       CID 157138 (CAIRO_GAL)
2017-03-30 16:05:56 +02:00
John Beard fc7dad600f Ruler tool: reset text mirror/bold/italic before painting
This is required as the OpenGL GAL doesn't support mirrored
text, and if the state is not cleared after painting other mirrored
text, this is what is attempted.

Fixes: lp:1677210
* https://bugs.launchpad.net/kicad/+bug/1677210
2017-03-29 23:27:44 +02:00
Chris Pavlina c8cdb51fa8 Add relational operators to component search
Fixes: lp:1578264
* https://bugs.launchpad.net/kicad/+bug/1578264
2017-03-27 21:26:49 -04:00
Chris Pavlina 4011ed4e31 Convert UTF8 to/from wxString correctly around LIB_ID
Fixes: lp:1675942
* https://bugs.launchpad.net/kicad/+bug/1675942
2017-03-24 21:38:00 -04:00
Chris Pavlina 849b3c2a4b Add footprint select dropdown to component chooser, serious refactoring
- DIALOG_CHOOSE_COMPONENT has footprint select widget
- FOOTPRINT_SELECT_WIDGET
- FOOTPRINT_CHOICE widget (customized wxComboCtrl)
- FOOTPRINT_FILTER class
- FOOTPRINT_INFO rework:
    - FOOTPRINT_ASYNC_LOADER to load without freezing UI
    - Rewrite loader threads as queue-driven thread pool
    - Make FOOTPRINT_INFO available via kiway
- FP_LIB_TABLE::PrefetchLib
- Access to global fp-lib-table via kiway
- SYNC_QUEUE threadsafe queue template
- Remove KICAD_FOOTPRINT_SELECTOR build option
2017-03-24 09:20:27 -04:00
Alejandro García Montoro f68ce306bd CPolyLine -> SHAPE_POLY_SET refactor.
Removes the need of using the legacy code in polygon/PolyLine.{h,cpp},
refactoring all CPolyLine instances with SHAPE_POLY_SET instances.

The remaining legacy methods have been ported to SHAPE_POLY_SET;
mainly: Chamfer, Fillet, {,Un}Hatch.

The iteration over the polygon vertices have been simplified using the
family of ITERATOR classes.
2017-03-24 10:43:47 +01:00
John Beard 5aa1610362 Remove unused g_ShowPageLimits global variable
This variable was only defined, not declared in any header.
2017-03-23 12:47:05 -04:00
John Beard f723a5319c Move some unit related util function to base_units.h 2017-03-23 12:47:05 -04:00
John Beard e98ae3e463 Move executable name constants to own file
The executable name constants are only used by two files, they do not
have to be in common.h.

Also converted to const wxString for better type-safety and removed
old-style wxT macros.
2017-03-23 09:23:45 -04:00
John Beard ece7eeb280 Move SystemDirsAppend to own header
This function is called only from three sites, it doesn't need to be in
common.h.

The implementation was already in systemdirsappend.cpp, so a matching
header was created for it.

This reduces the visibility of the function to only the files that need
it and slightly shrinks common.h.
2017-03-23 09:23:45 -04:00
John Beard 27374c0aa3 Move file locking utilities to a separate file
The global ::LockFile() function is used in a single place, but it's in
common.h, so visible to all files.

The GetKicadLockFilePath function is used in only two places, and one of
them is LockFile.

This commit puts them both in a separate header, so they're only visible
to code using them.

The implementation of GetKicadLockFilePath is moved to lockfile.cpp,
where LockFile already was.

Also removed a (large) handful of wxT macros, which aren't needed any
more and make code less readable.
2017-03-23 09:23:45 -04:00
John Beard 0799d9e45c OPENGL_GAL: Init currentTarget
The currentTarget member of OPENGL_GAL is not initialised, but the
currentManager member is.

This commit uses SetTarget to initialise both target and manager to a
consistent state at construction.
2017-03-23 14:08:26 +01:00
John Beard 9fe780f1b3 Rework zone creation in GAL
The zone creation in DRAWING_TOOL was a complex event loop whici
simultaneously managed the event handling, construction of the preview
polygon and the creation and commiting of the zone, all in the same
scope. This has been broken into several pieces:

* POLYGON_ITEM preview item, used to preview the polygon in progress
* POLYGON_GEOM_MANAGER is a class that collects points from user input
  and used them to describe a polygon's geometry, including calculation
  of 45-degree constrained leader lines
* ZONE_CREATE_HELPER is a class which deals with creating zones based on
  geometry from a geometry manager and parameters from the DRAWING_TOOL
* The (much simpler) event loop in DRAWING_TOOL drives the
  POLYGON_GEOM_MANAGER. With a minor refactor, this loop can be reused
  in future for other polygonal tools if wanted.

The polygon preview now has a translucent fill which makes it easier to
visualise the zone.

This also adds the Close Zone Outline and Delete Last Corner actions as
part of the new event loop.

Fixes: lp:1663885
* https://bugs.launchpad.net/kicad/+bug/1663885

Fixes: lp:1667885
* https://bugs.launchpad.net/kicad/+bug/1667885
2017-03-22 17:18:12 +01:00
John Beard d99fbddc22 Enable angle snap for pcbnew GAL ruler tool
This uses the two-point geometry manager to split the logic of the ruler
geometry and the preview item display. This allows the ruler to use that
manager's angle snap feature.
2017-03-22 10:59:47 +01:00
Maciej Suminski ddf4f3b2bc Remove not used cursor fields & methods in Cairo GAL 2017-03-22 10:37:43 +01:00
John Beard b8edecc10f Move cursor shape flag into GAL settings
The motivation here is to concentrate display options in the GAL display
settings, ready for removal of legacy canvases. Instead of having the
property as a member of the DRAW_FRAME, with the GAL canvas retreiving
it from there, it is now in the GAL_DISPLAY_OPTIONS struct, and both GAL
and legacy get it from there.

The options for setting cursor shape are then moved out of the general
options dialog, and into the GAL display options widget, where they can
be used in all GAL-aware programs.

GAL cursor shape works on GAL, but not legacy, so the option is now
available on OSX (but only affects GAL, and is labelled as such).
2017-03-22 10:24:48 +01:00
John Beard b4a4748672 Move sketch mode area in pcbnew display options
This gives a bit more space to the GAL options in the left panel

Also tidy up some code style and unnecessary default arguments in the
GAL display planel widget.
2017-03-22 10:24:48 +01:00
John Beard 01c733bdb5 Dim GAL cursor when forced but no interactive tool
This makes it clearer when a tool is active, otherwise interactive tool
effects like auto-pan can come as a surprise when the cursor is forced
to display all the time.
2017-03-22 10:24:48 +01:00
John Beard 78a5185857 Allow GAL cursor to be always displayed
A new items is added to the GAL display options (and the dialog), and a
hotkey (Ctrl+Shift+x) is added to toggle it.

Fixes: lp:1673633
* https://bugs.launchpad.net/kicad/+bug/1673633
2017-03-22 10:04:56 +01:00
jean-pierre charras c20cf4a3e0 Fix incorrect calculations in GAL DrawGrid() methods, that create very long calculation time when the grid origin is not 0 2017-03-21 13:09:24 +01:00
jean-pierre charras c2227abb36 Specctra import: accept layer names like numbers (i.e. +12). 2017-03-20 19:50:07 +01:00
jean-pierre charras 230980fc9d Compile specctra file with pcbnew files, not with pcbcommon files (they are now used only by pcbnew) 2017-03-20 19:49:10 +01:00
John Beard ce731f8b62 Add GAL microwave tools
This adds the microwave tools to GAL in Pcbnew as a new tool:
MICROWAVE_TOOL.

Some new preview items are introduced to support this:

* TWO_POINT_GEOM_MANAGER for managing construction of two-point
  geometries, such as that used to construct the inductor.
* CENTRELINE_RECT_ITEM a preview item to draw ractangle with a given
  aspect ratio along a line (specified using a TWO_POINT_GEOM_MANAGER)

PCB_TOOL gets a generic event loops which should be useful for more
than just microwave tools:

* doInteractiveItemPlacement() - handles event loops that wait for a
  click, create an item on click and then allow moving it
  around/flipping, etc.

Fixes: lp:1531323
* https://bugs.launchpad.net/kicad/+bug/1531323
2017-03-20 16:10:51 +01:00
Tomasz Włostowski f599f10a03 gal: reset autopan state when autopanning is disabled
Fixes: lp:1674022
* https://bugs.launchpad.net/kicad/+bug/1674022
2017-03-20 11:45:57 +01:00
jean-pierre charras 2637835a1e First version of courtyard overlap detection 2017-03-19 20:27:45 +01:00
Chris Pavlina 200c3f78a0 LSET: undefined behavior in va_start() 2017-03-17 22:43:54 -04:00
Chris Pavlina 7360bdb7eb SPIN_INCREMENTAL_TEXT_CTRL: unused member warning 2017-03-17 22:42:43 -04:00
John Beard 5f303f7b25 Enhance Pcbnew arc construction
This adds a richer overlay to the arc-by-three-points tool in Pcbnew,
including more guide-lines and a live display of radius and angle.

Also included is ability to go back to the previous step (if setting end
angle, you can go back to setting start point, etc) using Backspace, and
Ctrl snaps the start/end angles to 45 degree multiples.

This adds new classes

* MULTISTEP_GEOM_MANAGER: represents a generic "geometry manager" that
  builds up some geometrical construction based on a sequence of points.
  Used by:
* ARC_GEOM_MANAGER: handles the logical flow of constructing an
  arc by centre-point, set radius, set angle. This moves the logic out
  of the Pcbnew DRAWING_TOOL event loop in drawArc().
* ARC_ASSISTANT: graphical overlay to communicate current arc shape to
  the user during the drawing process
2017-03-17 20:56:54 +01:00
Miles McCoo db174862c8 Minor Pcbnew Python scripting improvements.
Add typedef for wxCoord to wx.i to enable usage of methods like
EDA_RECT.Inflate.

Added id.h to pcbnew.i to expose window toolbar identifier names.

Added Refresh() and WindowZoom() to pcbnew_scripting_helper.
2017-03-17 10:41:00 -04:00
Wayne Stambaugh 9ddb4fe67e Fix uncaught exception in footprint and symbol library table parsers.
Fixes Coverity CID 154580
Fixes Coverity CID 154581
Fixes Coverity CID 154582
Fixes Coverity CID 154583
Fixes Coverity CID 154584
Fixes Coverity CID 154585
2017-03-17 07:56:47 -04:00
John Beard 996cba7e7f Fix GAL display properties spin buttons on Windows 2017-03-16 10:40:06 -04:00
John Beard f2aa4d2911 Make GAL options panel a reusable panel
The primary motivation here is to allow other GAL canvas users (eg
Modedit, and soon Gerbview) to be able to easily modify GAL canvas
options.

For now, this doesn't change the display properties dialog in
appearance, but if more GAL options are added, it might need a bit of
tweak and maybe tabs or similar, like Eeschema preferences.
2017-03-16 08:01:26 -04:00
Tomasz Włostowski 3cc90ce2d2 Fixed center-on-zoom behaviour in the GAL canvas
Fixes: lp:1672868
* https://bugs.launchpad.net/kicad/+bug/1672868
2017-03-15 11:48:35 +01:00
Maciej Suminski fe4f02f5b9 Coverity fixes
CIDs:
- 153097
- 157120
- 157119
- 155148
- 155146
- 153103
- 153099
- 153095
- 153087
- 153086
2017-03-11 22:20:08 +01:00
Jon Evans 082b8dd2a9 Refactor BRIGHT_BOX to common so it can be used by other programs 2017-03-11 21:38:01 +01:00
Chris Pavlina bbaa29fbc4 Refactor FOOTPRINT_PREVIEW_PANEL
- Pull out compound widget bits into FOOTPRINT_PREVIEW_WIDGET
- Move all pcbnew-specific bits *inside* pcbnew; implementation should
  be private for users
- Make a few class members and inner types private
2017-03-10 23:26:45 -05:00
Maciej Suminski f46961d003 Fix a memleak in COLOR_SWATCH 2017-03-10 17:56:41 +01:00
John Beard 8c3b8ee693 Add a ruler tool to pcbnew GAL
This allows to measure between features on a PCB. It uses a preview
EDA_ITEM in common, but due to the use of the IDs, it's currently
Pcbnew/Modedit only.

This also adds several "utils" for graphical functons useful when
drawing preview items on GAL canvases.

Fixes: lp:1467313
* https://bugs.launchpad.net/kicad/+bug/1467313
2017-03-10 16:21:44 +01:00
John Beard 9c08873210 Make SELECTION_AREA a generic overlay item
This simplifies the (already simple) SELECTION_AREA class. It is also
moved into KIGFX::PREVIEW and put in the common library, where it can be
reused by other GAL-aware tools (not just in Pcbnew) in future.
2017-03-10 16:21:44 +01:00
John Beard 5e84e953f3 Add a simple item class for graphical overlays
This introduces SIMPLE_OVERLAT_ITEM, which is an abstract EDA_ITEM,
designed for use as an overlay for assisting interactive tools.

The item is drawn only on the GP_OVERLAY layer, and sets the fill,
stroke and line properties before calling a virtual function to draw the
shape, which will depend on the implementaiton of the derived class.

The motivation here is to simplify and unify basic overlays used when
in interactive tools. It is not designed to be the base class of all
possible overlays - more complex ones would be more clearly represented
as their own derivative of EDA_ITEM.

Applications of this class can include: zoom/select rectangles, zone
polygon previews, geometric shape helpers, and so on.
2017-03-10 16:21:44 +01:00
Maciej Suminski 11f8e53e27 Smoother arc rendering in OpenGL GAL
Fixes: lp:1496114
* https://bugs.launchpad.net/kicad/+bug/1496114
2017-03-10 14:08:59 +01:00
Jon Evans 3208d24ad4 Add DrawArcSegment() GAL method, to support drawing outlined arcs 2017-03-10 14:08:59 +01:00
Simon Richter bb61cd5a50 Add missing header
color_swatch.cpp uses std::unique_ptr
2017-03-08 10:39:11 -05:00
Simon Richter ef0a5ff71c Make Mac-specific function conditional
If we want to have an override marker on this function, it needs to be
conditional on Mac.
2017-03-08 10:24:59 -05:00
Maciej Suminski 62235348d1 Use GAL axes instead of a ORIGIN_VIEWITEM in module editor 2017-03-08 10:35:51 +01:00
Jon Evans 2513f0b002 Add setting to have GAL draw axes on the grid 2017-03-08 09:37:40 +01:00
Chris Pavlina cf373e543f Fix Windows (and macOS?) build error caused by 11f4622ea 2017-03-07 17:51:25 -05:00
Chris Pavlina 11f4622ea5 Fix GL assertion failure during GAL teardown 2017-03-07 14:37:02 -05:00
Wayne Stambaugh ef74f245cb Fix broken HTML formatting in about dialog. 2017-03-07 14:18:37 -05:00
Tomasz Włostowski eedf7cb243 Switched coroutine library from Boost libcotext to custom libcontext.
Fixes lp:1658249

https://bugs.launchpad.net/kicad/+bug/1658249
2017-03-07 11:45:29 -05:00
Maciej Suminski 338735c5bf Added a missing include to tool_manager.h
Previously full information about VC_SETTINGS type was not
available, so it was not possible to create a VC_SETTINGS stack
for some compilers.
2017-03-07 17:18:58 +01:00
Maciej Suminski c6e3ac7067 Removed boost::adaptors from TOOL_MANAGER 2017-03-07 17:18:22 +01:00
John Beard c86773462f GAL: Respect SHAPE_LINE_CHAIN closed setting
When drawing polylines using SHAPE_LINE_CHAIN, the polyline is always
was drawn closed in GAL and open in Cairo, regardless of the state of
SHAPE_LINE_CHAIN.
2017-03-07 13:28:14 +01:00
Chris Pavlina f8415633bd Switch component chooser to wxDataViewCtrl, refactor
This refactors COMPONENT_TREE_SEARCH_CONTAINER into a Model-View-Adapter
architecture comprising:

- eeschema/cmp_tree_model.h
    - CMP_TREE_NODE: Base class representing a searchable library
        set with scoring and sorting

        - CMP_TREE_NODE_UNIT
        - CMP_TREE_NODE_ALIAS
        - CMP_TREE_NODE_LIB
        - CMP_TREE_NODE_ROOT

- eeschema/cmp_tree_model_adapter.h
    - CMP_TREE_MODEL_ADAPTER: mediator between wxDataViewCtrl (via
        wxDataViewModel) and CMP_TREE_NODE*

                   +---+                      +------------------+
 +---+  Generates  | A |                      |       VIEW       |
 | M |  from libs  | D |   wxDataViewModel    |------------------|
 | O | <---------- | A | <------------------> |  wxDataViewCtrl  |
 | D |             | P |                      |------------------|
 | E | <---------> | T | <------------------- |    wxTextCtrl    |
 | L | UpdateScore | E | UpdateSearchString() |------------------|
 +---+             | R |                      |                  |
                   +---+                      +------------------+

Representing the data with a proper model allows the wxDataViewCtrl to
be updated in bulk, which is significantly faster than the old method of
populating it one item at a time. This also adds flexibility if more
data is to be added in the future (which may come in handy with the
upcoming .sweet format, as that adds more ways components can be related
to each other).

Replacing the wxTreeListCtrl with a wxDataViewCtrl also significantly
reduces the general GUI quirkiness, as wxDataViewCtrl is much more well
behaved.
2017-03-06 09:50:48 -05:00
Maciej Suminski fc4240886b Store VIEW_CONTROLS settings on a stack
This is the right implementation of the commit b25ded4d.
Previously if there were tools launched from another tool,
the settings could be stored in a wrong TOOL_STATE object.
2017-03-06 15:04:27 +01:00
Maciej Suminski d1550b0cdb Renamed VIEW_CONTROLS::SETTINGS to VC_SETTINGS.
Because nested types cannot be forwarded.
2017-03-06 15:04:27 +01:00
Maciej Suminski ac38f1112d Removed duplicated code from TOOL_MANAGER::RunAction() 2017-03-06 15:04:27 +01:00
Chris Pavlina 1cee5780a5 Fix GAL focus bug
Caused by yours truly in 4618e6c7
2017-03-05 13:58:31 -05:00
Chris Pavlina 4618e6c7f8 Component chooser: event and focus cleanup 2017-03-04 11:14:04 -05:00
Maciej Suminski e6cfb6af52 Revert "Fix setting the background color in OPENGL_GAL"
Causes flickering on some GPUs.
This reverts commit ca985791bc.
2017-03-04 08:51:35 +01:00
Maciej Suminski 94d8e1e69c Fixed a memleak in ReadHotkeyConfig() 2017-03-04 08:38:35 +01:00
Cirilo Bernardo 68bcdec87e Workaround for non-ASCII filenames in Windows 2017-03-03 14:30:47 -05:00
jean-pierre charras 4eeed8d04f Icons options menu: code rework 2017-03-03 14:18:25 +01:00
Jon Evans 88f7c55d95 Move ZoomFitScreen and ZoomPreset from PCBNEW_CONTROL to COMMON_TOOLS
BOARD::GetBoundingBox() now directly calls BOARD::ComputeBoundingBox()
and there is a new method BOARD::GetBoardEdgesBoundingBox() used for
call sites that needed to use ComputeBoundingBox( true ) in the past.

This allows COMMON_TOOLS to implement ZoomFitScreen without knowledge
of the BOARD class.
2017-03-03 13:28:19 +01:00
Maciej Suminski 906ee77dbf Fixed VIEW_ITEM memory leaks 2017-03-02 23:57:13 +01:00
jean-pierre charras e7e972804a Make show/hide icons in menus a run time option, instead of compil option. 2017-03-02 15:45:54 +01:00
Maciej Suminski 1d8730752c Restore valid force cursor setting before saving VIEW_CONTROLS settings
There are times, when TOOL_MANAGER has to force cursor position
to make tools work as expected (e.g. when popping up a menu,
so tools get the right click position instead of current position
pointing to an entry in the menu).

If another tool is invoked, VIEW_CONTROLS settings have to be stored
in the TOOL_STATE object. In such case, it is necessary to revert the
force cursor setting when saving VIEW_CONTROLS settings.

Fixes: lp:1668712
* https://bugs.launchpad.net/kicad/+bug/1668712
2017-03-02 12:07:09 +01:00
Maciej Suminski ca985791bc Fix setting the background color in OPENGL_GAL
Fixes: lp:1669098
* https://bugs.launchpad.net/kicad/+bug/1669098
2017-03-02 09:32:10 +01:00
John Beard 4547b2e26d Don't init wxBitmaps before GUI is ready
Init'ing static wxBitmaps in the global scope happens before the GUI is
ready, which segfaults, at least on GTK+. This can happen in, for
example, the Python module. In normal use, the singletop/kicad
loader has initialised the GUI first, so it doesn't manifest there.
2017-03-01 13:28:10 +01:00
jean-pierre charras 8526935183 GAL: better progression between zoom in/zoom out (in/out/in sequence keeps the same zoom value) 2017-03-01 13:00:42 +01:00
jean-pierre charras 1cffcafe2d GAL mode: Add small cross option to grid style (now: options are Dots, Grid, Small cross) 2017-03-01 10:29:19 +01:00
John Beard 1d039cb4c1 Break row indicators out to own class
The introduces INDICATOR_ICON, which is a very simple class holding a
bitmap that can toggle on or off.

The ICON_PROVIDER class then provides icons to INDICATOR_ICONS, which
means the class can be used for more than just row indicators.

A default row icon provider is also provided for use in the standard row
selector.
2017-03-01 09:44:41 +01:00
John Beard b8d0b0d7be Move layer/render swatches to own class
This introduces COLOR_SWATCH, which is a reusable
widget that shows a color swatch and can invoke the colour picker
when duble/middle clicked.

It uses it's own wxCommandEvent to signal the change.

This makes the layer widget simpler internally, and also allows other
code to show identical swatches if needed.
2017-03-01 09:44:41 +01:00
Jon Evans fd4e2b042c Refactor SELECTION, SELECTION_CONDITIONS, and context menus to common
SELECTION now holds EDA_ITEMs not BOARD_ITEMs so various places had to
change to casting the selected items to BOARD_ITEMs.

Fixed compilation warnings on clang (Tom)
2017-02-28 14:47:20 +01:00
Jon Evans 0afb249447 Add drawing priority support to VIEW
Call UseDrawPriority( true ) after creating GAL to enable.

VIEW::Add() gets a new optional argument to specify the draw order
when adding an item.  If the new argument is left default, the draw
order will increment with each call of VIEW::Add().

Fix std::bind calls after change to VIEW::Add
2017-02-28 14:47:20 +01:00
Maciej Suminski 9ead2b068b Fixed crash when placing a component in standalone eeschema
Fixes: lp:1668157
* https://bugs.launchpad.net/kicad/+bug/1668157
2017-02-27 10:29:53 +01:00
Chris Pavlina 23d4da9e49 Optimize TWO_COLUMN_TREE_LIST column sizing
This was particularly slow for very long lists on macOS.
2017-02-24 12:51:53 -05:00
Maciej Suminski adba96fd2b Changed optional::value_or() to optional::get_value_or()
get_value_or() is considered deprecated, but still works in the newest
boost (1.63). On the other hand, value_or() is not available in some
versions that are still used by major distros.
2017-02-24 17:34:23 +01:00
Maciej Suminski e34b73e187 Do not freeze cursor when a tool was cancelled using the context menu
dispatchContextMenu() stores the cursor position before displaying a
menu, so the tools use the original cursor position when processing
events (instead of the mouse position pointing to a menu entry). Later,
the previous position has to be restored, but if in the meantime the
tool was cancelled - previous settings were restored to a wrong tool.
2017-02-24 16:55:18 +01:00
Maciej Suminski b25ded4d90 Store VIEW_CONTROLS settings when tools are switched
Fixes: lp:1663783
* https://bugs.launchpad.net/kicad/+bug/1663783

Fixes: lp:1667580
* https://bugs.launchpad.net/kicad/+bug/1667580
2017-02-24 16:47:19 +01:00
Maciej Suminski 57050cdeb3 Introduced VIEW_CONTROLS::SETTINGS to keep settings
The new class facilitates saving and restoring VIEW_CONTROLS
settings such as cursor visibility, snapping, etc.
2017-02-24 13:33:17 +01:00
Maciej Suminski 72cae92320 Disable context menu trigger if the assigned menu is set to null 2017-02-24 13:32:43 +01:00
John Beard c001c6114f Add cancel interactive tool action to GAL
This is used to provide menu entries that allows cancellation of
interactive drawing and routing tools without needing the keyboard.

It is provided in the drawing tools and the router tool.

The cancel event doesn't have any new functionality (e.g. track rip-up
for the PNS router - lp:1448460), this just adds it to the menu, where
it behaves the same as an Escape keypress.
2017-02-24 10:37:07 +01:00
jean-pierre charras 04d1b2fca7 fix incorrect COLOR4D::COLOR4D( EDA_COLOR_T aColor ) ctor for UNDEFINED_COLOR 2017-02-23 18:17:47 +01:00
jean-pierre charras 2f24b31b28 simplify color calculation. 2017-02-23 17:55:55 +01:00
jean-pierre charras 1f345052cd Fix erroneous conversion between wxColor and COLOR4D 2017-02-23 14:30:43 +01:00
jean-pierre charras 11dcb76fc9 Add -Wshadow compil option, if exists to warn about shadowed variables.
Swig auto generated .cxx file has a lot of shadowed variables, so this option cannot be used to compil all files.
2017-02-23 13:17:23 +01:00
jean-pierre charras a9d6af8001 Fix a comment 2017-02-23 13:17:23 +01:00
jean-pierre charras 10396ff435 Tool manager: renames Yield() to KiYield(), due to a collision name between the Yield macro in wxWidgets and Tool manager Yield.
Can be dependent on platforms.
2017-02-23 08:30:29 +01:00
Chris Pavlina d1a2ed63c0 Add gal as dependency of common
This is required due to the use of COLOR4D in common
2017-02-22 19:45:52 -05:00
Jon Evans f9bc5914b3 Wrong type of arguments in wxPen constructor
Has pointed out by Jon Evans the constructor need the .ToColour() and should be called like:
wxPen pen( GetParent()->GetGridColor().ToColour(), h );

Submitted-by: Diogo Condeco <diogocondeco@gmail.com>
2017-02-22 14:12:58 -05:00
Maciej Suminski d7bf44eee0 Removed a few more headers from base_struct.h 2017-02-22 17:54:01 +01:00
Maciej Suminski 0dc88bb4cf Changed COLOR4D defines to static consts 2017-02-22 17:35:00 +01:00
Jon Evans a52250a91e Change from EDA_COLOR_T to COLOR4D globally; arbitrary color support
eeschema now supports arbitrary colors for all object types, and
pcbnew does in GAL canvas.  When switching from GAL to legacy canvas,
pcbnew will convert colors to the nearest legacy color.
2017-02-22 17:35:00 +01:00
Jon Evans 4c83b0a94d Move TOOL_ACTIONs to their corresponding tools; create COMMON_TOOLS
Some grid/zoom tools are left in PCBNEW_CONTROL because they currently
depend on Pcbnew-specific class members.  Once refactoring is done to
make it possible to use all zoom and grid controls outside of pcbnew,
these last tools can be moved to common to match their ACTIONs.
2017-02-22 10:32:48 +01:00
Jon Evans 167f45ca2b Refactor COMMON_ACTIONS into a base and derived class
New virtual class ACTIONS is added as a member to EDA_DRAW_FRAME so
that the TOOL_DISPATCHER can have access to the appropriate derived
version of TranslateLegacyId()
2017-02-22 10:32:48 +01:00
John Beard ca91c27852 Adjust pad sub-menu enablements
The apply settings and push settings options now take account of the
validity of the global pad settings when deciding whether to show or
not.

Global pad push now requires a source pad and doesn't push from the
global pad setting when there is no selection.

The whole submenu is hidden when there are no enabled items.

Fixes: lp:1664016
* https://bugs.launchpad.net/kicad/+bug/1664016
2017-02-20 11:08:34 +01:00
John Beard 8766b475c6 Sanitise incoming GAL config options using mapping tables
When reading config options from files, it's important to make sure the
value makes sense - the incoming data could be anything, and may have
incompatible values or be otherwise unreliable.

This introduces a simple way to define and use "mapping tables" which
can map between a "native" value, probably an enum (but not necessarily)
and some external value, for example the value written to file.

This provides a decoupling between the two values, as well as sanitising
inputs and outputs. This is important, as over time, if there isn't a
decoupled interface, changing options result in corrupt configs, or a
proliferation of obsolete enum values kept for compatibility.
2017-02-20 10:52:34 +01:00
John Beard 0bf3a19967 Add user control for grid minimum spacing in GAL
This allows the user to set a thicker grid line without causing the
grid lines to become over dense, or just make the grid denser according
to preference.

The term "density" is modified to "minimum grid spacing", which is
the pixel spacing between adjacent grid lines.

The spacing settings now comes in along, with other GAL display settings,
as part of GAL_DISPLAY_OPTIONS observer functionality. To this end, the
setter in GAL interface is removed, as an external user should be
setting this parameter via the GAL_DISPLAY_OPTIONS interface.
2017-02-20 10:52:34 +01:00
John Beard 970e4f8eb4 Add grid line thickness control to Display Options Dialog
This adds a user-settable control for the grid line thickness on GAL
canvases to the display options dialog.

The thickness settings now comes in, along with other GAL display
settings, as part of GAL_DISPLAY_OPTIONS observer functionality. To this
end, the setter in GAL interface is removed, as an external user should
be setting this parameter via the GAL_DISPLAY_OPTIONS interface.

Fixes: lp:1662482
* https://bugs.launchpad.net/kicad/+bug/1662482
2017-02-20 10:52:34 +01:00
John Beard 061d659bb1 Add a class to govern an "incrementing" text control
This class, INCREMENTAL_TEXT_CTRL, is used to provide a frameworks for
classes that want to control a text control that can be incremented
according to some scheme.

Also provided is a wxWidgets implementation with spin buttons for
control, as well as mousewheel support.
2017-02-20 10:52:34 +01:00
John Beard ff3bfaf82b Make KIGFX::GRID_STYLE an enum class
This provides stronger typing to these values.
2017-02-20 10:52:34 +01:00
John Beard 7ad30b7167 Move Grid style to Graphics Options dialog
This puts the graphical/display options with the other similar options
in that dialog, rather than with the dimension options found in the Set
Grid dialog, which is in the Dimensions menu.

Also place the option itself in the GAL Display Options structure, so it
can be updated using the observer mechanism there.

The setter for the style in the GAL interface is removed, as the public
interface for setting this option is now to modify the
GAL_DISPLAY_OPTIONS structure and notify the GAL when done.
2017-02-20 10:52:34 +01:00
John Beard ddded86a06 Give all GAL canvases access to a GAL_DISPLAY_OPTIONS structure instance
Also loads the gal options when loading a canvas, as the canvas
otherwise might not register the initial settings.
2017-02-20 10:52:34 +01:00
John Beard cdfcc9a2ab Put draw_frame.h GAL_DISPLAY_OPTIONS behind firewall
The GAL_DISPLAY_OPTIONS member of EDA_DRAW_FRAME is a private member and
is used in only a couple of places in the class. The real use of this
member is by a by-ref interface, GetGalDisplayOptions.

Because te GAL options are used by a very select few users of
EDA_DRAW_FRAME, it makes little sense to force all the (many) files
including draw_frame.h to also include gal_display_options.h, when the
vast majority have no need for it.

This massively speeds up compilation of the project when
gal_display_options.h is changed.

More isolation could be acheived by separating the GAL config types (eg
OpenGL antialias modes and grid style) from the options header, as,
although the GAL class uses them, not many includers of the GAL header
need the options struct as well.
2017-02-20 10:52:33 +01:00
Jon Evans 9d68c970dc Remove dependence on LAYER_ID from EDA_DRAW_PANEL_GAL 2017-02-20 09:15:55 +01:00
Chris Pavlina 2e07d83461 Reduce footprint preview flickering in component selector 2017-02-19 14:54:36 -05:00
Chris Pavlina 3d88cc2a36 Rename method for consistency with similar class
FOOTPRINT_PREVIEW_PANEL::AddToPanel -> InstallOnPanel
2017-02-19 07:53:02 -05:00
Chris Pavlina fb6bf0c861 Fix SetColumnWidth() assertion in TWO_COLUMN_TREE_LIST
Fixes: lp:1665982
* https://bugs.launchpad.net/kicad/+bug/1665982
2017-02-19 06:38:53 -05:00
Chris Pavlina 2632b1d1a0 Revamp component chooser and add footprint preview
This commit brings several changes:

- Add a footprint preview pane to the eeschema component selector
- Upgrade component list to wxTreeListCtrl
- Factor out wxTreeListCtrl subclass TWO_COLUMN_TREE_LIST which
  patches a column size bug
- Linkify datasheet URL in info pane
2017-02-18 21:39:55 -05:00
Jon Evans 7cd72d6ffb Move layer colors from PCB_RENDER_SETTINGS to RENDER_SETTINGS 2017-02-16 17:30:31 +01:00
Jon Evans 7058e4eb21 Setup painter in PCB_DRAW_PANEL_GAL instead of EDA_DRAW_PANEL_GAL 2017-02-16 17:30:31 +01:00
Wayne Stambaugh eb06b35852 Eeschema: fix schematic I/O plugin symbol name issue.
LIB_ID was changing the symbol name due to the parser dropping everything
past the first '/' character which is interpreted by LIB_ID as the item
version.  Add flag to ignore this in LIB_ID::SetLibItemName() and add a
new ctor so the library nickname, item name, and revision can be set as
required to prevent the standard LIB_ID parsing.

Fix a few places where PART_LIBS functions FindLibraryAlias() and
FindLibPar() were translating wxString symbol names to LIB_IDs where the
LIB_ID parser was truncating the symbol name.
2017-02-11 13:44:17 -05:00
Wayne Stambaugh 899fe08f20 Remove KICAD_USE_SCH_IO_MANAGER build option from docs and build info. 2017-02-10 11:58:15 -05:00
jean-pierre charras 283ba553ba Change wxItemMenu GetLabel (deprecated) to GetItemLabelText
GetLabel can compile or not, depending on the compatibility level used to build wxWidgets.
2017-02-10 08:33:48 +01:00
Maciej Suminski 1bcbbb41cd Fixed double menu entries in context menus 2017-02-10 00:08:53 +01:00
Maciej Suminski 060e163511 Fixed invoking TOOL_ACTIONs in submenus
Fixes: lp:1663101
* https://bugs.launchpad.net/kicad/+bug/1663101
2017-02-10 00:08:23 +01:00
Chris Pavlina bca74853d1 Display more information in component selector 2017-02-07 15:01:20 -05:00
Maciej Suminski 6561c8e61a Fixed a crash occuring on closing pad properties dialog in Windows
Fixes: lp:1660276
* https://bugs.launchpad.net/kicad/+bug/1660276
2017-02-07 00:07:43 +01:00
jean-pierre charras 1338ff02f9 Fix a build issue, broken by commit 78a5f450ce 2017-02-04 10:08:54 +01:00
Maciej Suminski 77af6547c1 Coverity fixes (mostly initializing variables) 2017-02-01 17:31:55 +01:00
jean-pierre charras 6ae65b4cba Dialog about: remove dead url link 2017-01-31 08:56:31 +01:00
Maciej Suminski 4b9243e0bf Allow registering TOOLs in any order. 2017-01-30 13:21:43 +01:00
Diogo Condeco 75ffcbcef5 MACOS Setfocus and CancelButtonIssue moved into dialog_shim.
Setfocus now works on macos dialogs by setting DLGSHIM_USE_SETFOCUS.
This option is only enabled __WXMAC__ is defined.

FixOSXCancelButtonIssue() is now called inside DIALOG_SHIM::SHOW.
All other calls from within the dialogs were removed.
2017-01-29 23:51:35 +01:00
jean-pierre charras 6c5808fd18 Update dale of last change. Add a small comment about CTL_OMIT_HIDE. 2017-01-29 09:29:49 +01:00
Dick Hollenbeck 35fc1f3361 Move "hide" back to prior fp_text location 2017-01-28 09:33:25 -05:00
Maciej Suminski 80956ef1e6 Added GAL::DrawPolygon(SHAPE_POLY_SET) & GAL::DrawPolyLine(SHAPE_LINE_CHAIN) 2017-01-27 19:08:32 +01:00
Chris Pavlina 498e8b122a Clean up file format error message a bit more
If a FUTURE_FORMAT_ERROR wraps another FUTURE_FORMAT_ERROR, only print
the error for it once.
2017-01-27 07:27:53 -05:00
Dick Hollenbeck d4acfb9f5a Remove doubled fp_text "hide" output, change *.kicad_pcb format under authorization of Wayne. Fix exceptions.cpp PARSE_PROBLEM which was missing the offset %d. 2017-01-26 08:02:35 -05:00
Maciej Suminski 8f82f04153 Copy menu title in CONTEXT_MENU::copyFrom() 2017-01-25 20:29:27 +01:00
Dick Hollenbeck 0c459ced97 EDA_TEXT object refactor.
Make all EDA_TEXT data private and rename accessors to avoid function
name collisions in derived classes.

Overload EDA_TEXT's SetTextAngle() and SetEffects() in TEXTE_PCB.

Add support for preserving Reference text position, size, orientation
during a netlist import into a BOARD, as well as the one off footprint
update dialog.
2017-01-25 08:03:32 -05:00
Maciej Suminski 5d9190038f TOOL_EVENTs of "message" type are passed to all tools
Message type is a kind of notification, so it should be received by all
interested tools. It used to be like that in the past, but has been
broken recently.
2017-01-25 11:31:55 +01:00
Maciej Suminski 1102eb0d0d Store menu titles in CONTEXT_MENU
Previously a title had to be provided when a submenu was added,
but this led to storing the same title in many places.
2017-01-23 14:52:11 +01:00
jean-pierre charras 2b5769c0a8 Action plugins: simplify code, and fix an issue: the menubar was not correctly rebuilt after closing and reopening pcbnew from kicad.
It was also not correctly rebuilt after language change.
2017-01-23 13:27:49 +01:00
John Beard 7863e70181 Move PostCommandMenuEvent to EDA_BASE_FRAME
There is nothing PCB-frame-specific about this function,
it is equally applicable to an frame, for example
PCB_EDIT_FRAME and CVPCB_MAINFRAME, which have EDA_BASE_FRAME
as the nearest common ancestor, except KIWAY_PLAYER,
which is not really concerned with this kind of UI event method.
2017-01-23 11:41:00 +01:00
Maciej Suminski fc7be1a497 Removed redundant CONTEXT_MENU::m_parent field. 2017-01-23 11:40:59 +01:00
Maciej Suminski 682da70a86 Fixed the issue of creating and event handling in context menus (GAL).
When creating a copy of CONTEXT_MENU, always a CONTEXT_MENU instance was
constructed, whereas an inherited type should be used. Solved with
CONTEXT_MENU::create() that has to be overridden in inheriting classes.

Event & update handlers are now virtual functions, instead of setting
the handlers with Set{Event,Update}Handler().
2017-01-23 11:40:59 +01:00
jean-pierre charras d7ed3ede72 Ensure paths and filenames are always stored with '/' as separator in fp_lib_table, like in other kicad files.
Ensure also paths and filenames read from a fp_lib_table always use '/' as separator (works fine on Windows)
Fixes: lp:1658534
https://bugs.launchpad.net/kicad/+bug/1658534
2017-01-23 11:32:58 +01:00
Baranovskiy Konstantin 4be2c79b87 Make doc extension (pdf) case insensitive. 2017-01-22 10:40:37 -05:00
Robbert Lagerweij 550a1ea4d6 eeschema: set title of plotted pdf to sheet title
Fixes: lp:1656956
https://bugs.launchpad.net/kicad/+bug/1656956
2017-01-20 17:11:12 -05:00
jean-pierre charras 2de913797a Fix a UI policy issue. Very minor cosmetic change: give same look to Zoom and Grid selection in 2 menus. 2017-01-20 11:35:24 +01:00
jean-pierre charras adb679dc46 ROUTER_TOOL_MENU: add zoom selection to this menu. 2017-01-20 08:51:12 +01:00
jean-pierre charras e710b8b370 Fix incorrect parameter type when appending zoom and grid menuitems 2017-01-19 20:26:57 +01:00
Tomasz Włostowski ba9576b014 router: snap to clearance boundaries in Highlight Collisions mode
Fixes: lp:1655819
* https://bugs.launchpad.net/kicad/+bug/1655819
2017-01-19 17:47:15 +01:00
Maciej Suminski 838c6097d9 Removed a redundant assert in OPENGL_COMPOSITOR. 2017-01-18 14:30:08 +01:00
Maciej Suminski 196c5aca83 Fixed 'unreferenced local variable' warning in OPENGL_GAL. 2017-01-18 14:23:06 +01:00
Maciej Suminski 75fb04d650 TOOL_ACTIONs are handled with transitions, no handlers needed in the event loops
There used to be a number of TOOL_ACTIONs that had entries both in
SetTransitions() and the event loop, which seemed redundant and
troublesome.
Now it is not necessary anymore, transitions setup is enough to execute
associated actions.
2017-01-18 14:20:39 +01:00
Maciej Suminski 3c61b16e7b Code formatting 2017-01-18 13:22:40 +01:00
Maciej Suminski c758f434c0 Removed unused fields in VIEW & ANTIALIASING_SMAA classes 2017-01-18 13:22:18 +01:00
Baranovskiy Konstantin 3dc2050498 Improved MousewheelPAN mode. 2017-01-17 16:34:11 -05:00
Maciej Suminski 004ca3c6f9 Fixed a memory leak in VIEW_ITEM (proper way of doing 9bc2bb2)
The problem with simple deleting VIEW_ITEM_DATA upon VIEW_ITEM removal was
caused by the default copy constructors that copied pointers.
Once a copy of an item was destroyed, the VIEW_ITEM_DATA has been
destroyed, effectively invalidating m_viewPrivData for the other item.
2017-01-16 14:57:50 +01:00
Chris Pavlina 99bfa2fea2 Revert "Fixed a VIEW_ITEM memory leak"
This reverts commit 9bc2bb2651.

Fixes: lp:1656481 (pcbnew segfault in KIGFX::VIEW_ITEM_DATA::getGroup)
https://bugs.launchpad.net/kicad/+bug/1656481
2017-01-13 21:37:31 -05:00
Maciej Suminski bf735b6fe7 Yet another trial to use wxString as a std::runtime_error message 2017-01-13 22:48:26 +01:00
Maciej Suminski 90710cfcc5 Added a missing #include directive 2017-01-13 17:15:32 +01:00
Maciej Suminski 7eacd1b15d Restored cursor in OpenGL canvas (still an issue with subpixel AA) 2017-01-13 17:10:16 +01:00
Maciej Suminski 7cf1cfedb3 Change exception message time from wxString to std::string 2017-01-13 16:59:31 +01:00
Maciej Suminski 88eb648cbb Alternative way of handling OpenGL initialization & errors
Some faults could result in a crash, as they were not properly
handled. Now the rendering loop is wrapped with try..catch block
which will revert to Cairo in case of an error and display an
error message.

Fixes: lp:1655766
* https://bugs.launchpad.net/kicad/+bug/1655766
2017-01-13 16:50:36 +01:00
Maciej Suminski e0577c0218 checkGlError() may throw exceptions or display an error message 2017-01-13 16:46:02 +01:00
Maciej Suminski 5a7604cbb4 More code formatting 2017-01-13 10:36:59 +01:00
Maciej Suminski 9bc2bb2651 Fixed a VIEW_ITEM memory leak 2017-01-12 15:41:00 +01:00
Maciej Suminski aabf8300c3 Removed non-ASCII characters 2017-01-12 09:20:04 +01:00
Maciej Suminski 67b0a8c990 Fixed type casting in SHADER class 2017-01-11 17:37:10 +01:00
Maciej Suminski da00d64877 OpenGL antialising code clean up & formatting 2017-01-11 16:20:37 +01:00
decimad 32a125a767 improve class observable 2017-01-11 16:20:37 +01:00
decimad 5a4e247564 EDA_DRAW_PANEL_GAL now takes the gal display options per dependency injection
Add a hack so that the pad properties base dialog constructor can pass in the dependency. Since the derived dialog's constructor takes the parent by this exact type, the static cast is safe.
2017-01-11 16:20:37 +01:00
decimad e71070fe1b final touch-ups (license information, includes) 2017-01-11 16:20:37 +01:00
decimad 64cd1228ea Clearer error messages for OPENGL_COMPOSITOR::CreateBuffer() (thanks Orson) 2017-01-11 16:20:37 +01:00
decimad 77138e3702 Add UI control to set up gal opengl antialiasing and load/store the settings 2017-01-11 16:20:37 +01:00
decimad bbaeeceeac A model/subscribe helper-class OBSERVABLE to common 2017-01-11 16:20:37 +01:00
decimad 2a8dd508c4 Add smaa (subsample morphological antialiasing) 2017-01-11 16:20:37 +01:00
decimad afacee5d96 Add supersampling (2x/4x) antialiasing 2017-01-11 16:20:37 +01:00
decimad 02bb410cdb Refactor COMPOSITOR/OPENGL_COMPOSITOR to enable customization of scene rendering and presentation 2017-01-11 16:20:35 +01:00
decimad 77f9cd0cb0 remove custom shader header generation build-step in favor of c++11 raw string literals
rework shader loading code to handle an arbitrary amount of to-be-concatenated strings
2017-01-11 16:20:34 +01:00
decimad 047f52e7cb Move builtin font resources out of opengl_gal translation unit 2017-01-11 16:20:33 +01:00
Oliver Walters 66ee44cb1f Footprint Wizards Update 2017-01-03 16:01:47 +01:00
jean-pierre charras d56a49d218 Performance counter rework: More comments, code cleaning, and move GetRunningMicroSecs() prototype from common.h to profile.h.
profile.h should now contain all info for profiling.
2017-01-02 13:49:36 +01:00
jean-pierre charras fff449ecf0 Performance counter rework: Add comments, fix coding style issues. 2016-12-31 13:00:24 +01:00
Simon Richter ac9f858813 Performance counter rework 2016-12-31 12:57:42 +01:00
jean-pierre charras b8b08dafd6 Code cleaning: remove pcbcommon.* which contains nothing really useful. The very few lines of code are moved to a better place. 2016-12-31 12:56:21 +01:00
jean-pierre charras a9fbedfb12 More Coverity warnings fixes. 2016-12-30 14:36:23 +01:00
jean-pierre charras dec2d6e8cc Fix a few Coverity warnings. A bit of clean code in export_vrml.cpp. 2016-12-30 12:40:05 +01:00
Chris Pavlina aa27e9ff7e IO_ERROR: improve What() message 2016-12-29 13:50:38 -05:00
Maciej Suminski effc8bebb1 Store view flip setting between canvas changes 2016-12-12 16:45:52 +01:00
Maciej Suminski 027515f4e1 Fixed refreshing after flipping the view 2016-12-12 16:45:52 +01:00
Maciej Suminski 7ad5fca6de More code formatting, updated copyright headers 2016-12-12 16:45:52 +01:00
Maciej Suminski a2a950fdae Reduced the Cairo command entry size 2016-12-12 16:45:52 +01:00
Maciej Suminski 660e4ca9d4 Cairo group arguments are stored in a union. 2016-12-12 16:45:52 +01:00
Maciej Suminski 8f924ed125 Added checks to ensure VIEW_ITEM_DATA != nullptr. 2016-12-12 16:45:52 +01:00
Maciej Suminski 89055c4425 Code formatting 2016-12-12 16:45:52 +01:00
Tomasz Włostowski daf103d7e4 GAL: fix grid origin and grid rendering in flipped view mode 2016-12-12 16:45:52 +01:00
Tomasz Włostowski da28e163d2 Optimizations/fixes to the VIEW/GAL classes:
- much faster Cairo rendering (outperforms legacy)
- improvements in VIEW update handling
- fixed issue with grid rendering in flip view mode
2016-12-12 16:45:52 +01:00
Tomasz Włostowski 3f7c5a0845 fixed post-rebase issues 2016-12-12 16:45:52 +01:00
Tomasz Włostowski c661c30f68 pcbnew: added flip view mode 2016-12-12 16:45:52 +01:00
Tomasz Włostowski 1c1f4e9a50 Refactoring of VIEW/VIEW_ITEM classes:
- Remove dependency of EDA_ITEM on VIEW
- VIEW_ITEM is now a pure virtual interface
2016-12-12 16:45:52 +01:00
Tomasz Włostowski 27a10e8597 Multiple simplifications to GAL tools in PCBNew:
- Finalize transition to BOARD_COMMIT (removed all remaining uses of PICKED_ITEMS_LIST) and implicit view/ratsnest updates
- Simplified SELECTION class, it now can be directly added to a VIEW
- Removed unnecesary casts and templates
- Introduced C++11 features (range based for, lambdas) where they improve code readability
- Added non-undoable COMMITs, which can be used to propagate change notifications to interested listeners (e.g. ratsnest/view)
2016-12-12 16:45:52 +01:00
jean-pierre charras 5d7d210f28 Simulator, plot panel: fix incorrect calculation of the vertical size of the traces when resizing the simulator frame 2016-11-28 15:37:00 +01:00
jean-pierre charras c225af747f mathplot: fix a bug and remove unused variables ( it fixes a few compil warnings) from Coverity analysis.
Uncrustify mathplot.h and fix a few coding style issues.
2016-11-28 14:18:22 +01:00
jean-pierre charras 30df041de6 fix shadowed local variables 2016-11-25 18:17:34 +01:00
Wayne Stambaugh fd54d394bd Version string improvements.
Define empty string variable KICAD_BRANCH_NAME that can be used as an
optional version string element.  When git is used to build the version
string, this variable is set to the git branch name.  It can also be
defined at configuration time as an optional string appended to the
$KICAD_VERSION variable.

Define empty string variable KICAD_VERSION_EXTRA that can be set by
the user at configuration.

The variables KICAD_BRANCH_NAME and KICAD_VERSION_EXTRA are only
appended to KICAD_VERSION if they are set.  Otherwise, only KICAD_VERSION
is uses as the version string.

Update the developer building from source document to reflect the changes.
2016-11-25 09:09:10 -05:00
unknown 334c50477a Auto save: fix case of auto save interval is set to 0 (disabling auto save feature)
This fix allows also the new value of the auto save interval immediately taken in account.
2016-11-22 11:26:31 +01:00
Simon Richter f7cc0a9334 Add missing build dependency.
The generated lib_table_lexer.h file is required to build the pcbcommon
static library.
2016-11-21 07:38:15 -05:00
Wayne Stambaugh 64c892ee23 Make footprint ID into a generic library ID.
Rename FPID to LIB_ID as is now used as a generic library identifier and
is no longer specific to footprints.

Remove all mention of footprint from the new LIB_ID doxygen comments and
code.

Rename files fpid.h and fpid.cpp to lib_id.h and lib_id.cpp.

Rename fp_lib_table.keywords file to lib_table.keywords and adjust CMake
build dependencies accordingly.

Update all source files effected by the code and file name changes.

Update .gitignore for file name changes.
2016-11-20 18:35:08 -05:00
Wayne Stambaugh 4d018039aa Eeschema: lay the groundwork for symbol library tables.
Create SYM_LIB_TABLE and SYMBOL_LIB_TABLE_ROW objects derived from LIB_TABLE
and LIB_TABLE_ROW respectively for supporting symbol library tables.

Add FPID member to LIB_PART for associating a symbol to a specific library
nickname.  Please note, this is not used in any way at this time and will be
implemented when the symbol library table is actually implemented.

Add sym_lib_table keyword to keywords file.  This is a temporary measure
until a more elegant method for parsing and formatting library tables can
be implemented.

Build FPID support in the common library instead of the pcbcommon library
for use in Eeschema.
2016-11-20 13:38:20 -05:00
Wayne Stambaugh 40e93d263d Split out library table common code into separate source files. 2016-11-20 13:34:03 -05:00
Wayne Stambaugh b9c296420a Complete library table and library table row refactor.
Derive LIB_TABLE_ROW from boost::noncopyable for use in boost pointer
containers.

Use std::unique_ptr to manage PROPERTIES pointer.

Add clone support for boost pointer containers.

Split common library table code out from FP_LIB_TABLE into base LIB_TABLE
object.  The FP_LIB_TABLE object only contains the code specific to
footprint library tables.

Use boost::vector_ptr for storing library table row objects.

Fix move up and down bugs in footprint library table edit dialog.
2016-11-19 17:16:43 -05:00
Chris Pavlina b9c62b658e Bring back KICAD_REPO_NAME 2016-11-12 16:16:35 -05:00
Jean-Noel Avila 58af5bc3a4 Eeschema: Fix off-by-one in saving bitmaps 2016-11-09 09:46:35 +01:00
Wayne Stambaugh 192d4b87ad Rework footprint library table for use in symbol library table.
Factor out ROW object from FP_LIB_TABLE so it can be reused to create a
symbol library table row object.

Create base LIB_TABLE_ROW object from ROW object common code.

Derived FP_LIB_TABLE_ROW object from LIB_TABLE_ROW to provide support for
footprint library table rows.

Update all instances of FP_LIB_TABLE::ROW with FP_LIB_TABLE_ROW.

Purge wxT() macros from modified files where possible.
2016-10-28 09:12:28 -04:00
Maciej Suminski a2f06a9dc4 Merge branch 'font-refine' 2016-10-21 10:25:42 +02:00
Maciej Suminski 74b5858665 Fixed a crash when removing zones using the Global Deletion dialog
Fixes: lp:1635266
* https://bugs.launchpad.net/kicad/+bug/1635266
2016-10-20 17:15:50 +02:00
decimad 402f53a302 update font code along with the changes done in the msdf atlas tool (use codepoint spans and refined char placement)
add font coordinate system clarification drawing (svg)
2016-10-20 14:31:09 +02:00
decimad d9a8aac96c transfer font texture width to the fragment shader via uniform variable 2016-10-20 14:31:09 +02:00
Tomasz Włostowski bb20a7f592 common: remove dependency on libbitmaps in EDA_ITEM::GetMenuImage() 2016-10-19 17:54:00 +02:00
Tomasz Włostowski 69cd7177b9 SHAPE_POLY_SET: mark all newly added hole outlines as closed 2016-10-19 17:54:00 +02:00
jean-pierre charras 9fdcba8229 Gerbview: Fix 2 (minor) issues in aperture macro "moire". Add a .gbr test file for this aperture macro. 2016-10-13 10:26:49 +02:00
Wayne Stambaugh 03da56a9b5 Minor version string generation improvements.
Remove the KICAD_REPO_NAME option from the main cmake file and the
generated config.h file since it is no longer used.

Set the default branch name to "undefined" in CreateGitVersionHeader.cmake
instead of the KICAD_REPO_NAME option.

Remove generating KICAD_FULL_VERSION from CreateGitVersionHeader.cmake
and add it to WriteVersionHeader.cmake so that the default settings and
the new KiCadVersion.cmake definitions can be used to generate the full
version string as well.

Check to see if the branch name is set and only use the version to
generate the full version string.  This allows the use of the KiCad
version cmake file to create a version only string like "4.0.4" with
no trailing branch name.

Change build_version.cpp to use the full version string rather than
concatenating the version and branch strings.
2016-10-12 20:29:46 -04:00
Cirilo Bernardo 48ed9f080e Add Help Menu item to open browser at kicad-pcb.org/contribute 2016-10-10 19:01:45 -04:00
decimad 4248a7ffce remove boost::thread dependency 2016-10-09 10:33:52 -04:00
jean-pierre charras fdebcd8a6d Fixes: lp:1629387 (pagelayout text sometimes shrinking)
https://bugs.launchpad.net/kicad/+bug/1629387
2016-10-06 17:19:55 +02:00
Chris Pavlina 71263c32e8 Dismiss signed index warning in opengl_gal.cpp 2016-09-30 22:32:24 -04:00
Chris Pavlina 91c8201b8b Dismiss warning for inconsistent exception spec in ~KIWAY_PLAYER() 2016-09-30 22:32:24 -04:00
Maciej Suminski 7a5f72c948 Fixed a crash when drawing a single point polyline 2016-09-29 15:34:08 +02:00