Commit Graph

2874 Commits

Author SHA1 Message Date
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