Commit Graph

10225 Commits

Author SHA1 Message Date
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
Wayne Stambaugh 9636086f52 Fix build bug for const incorrectness. 2017-03-10 10:09:55 -05:00
Wayne Stambaugh cc64c6af1d Fix broken symbol link in schematic after editing.
The save current symbol command had a different code path then save current
library so the schematic symbol was not being refresh after is was modified
in symbol editor.

Split out the save current symbol command from Process_Special_Functions()
to help reduce function growth hormone imbalance syndrome.

Some coding policy fixes and wxT() macro removal.

Fixes lp:1671456

https://bugs.launchpad.net/kicad/+bug/1671456
2017-03-10 08:39:29 -05:00
Chris Pavlina 7bf4c90be5 Component chooser: properly normalize description/keywords
Fixes: lp:1671814
* https://bugs.launchpad.net/kicad/+bug/1671814
2017-03-10 08:34:20 -05:00
Maciej Suminski d337d08060 Sketch graphics mode for GAL 2017-03-10 14:08:59 +01:00
Maciej Suminski f21cfa167f Use DECIDEG2RAD function in PCB_PAINTER 2017-03-10 14:08:59 +01:00
Maciej Suminski 737dc20409 Make OpenGL GAL great again
Reenabled VIEW_ITEMs cache. Previously, the first init was called with
GAL_TYPE_NONE, causing all layers to be set to non-cached. During the
proper init, the layers were already set to non-cached and were not
changed.
2017-03-10 14:08:59 +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
jean-pierre charras 0be56451b1 More optimization in project rescue. 2017-03-10 10:31:50 +01:00
John Beard c523ba45e1 Fix shadowed variable in python_scripting.cpp 2017-03-10 09:08:45 +01:00
jean-pierre charras 4605cae588 Displays the number of instances to modify in rescue dialog. 2017-03-09 19:16:24 +01:00
jean-pierre charras ae7e3f725b Speed up project rescue calculations, by optimizing the number of searches in libs. 2017-03-09 18:13:03 +01:00
jean-pierre charras 2a91d7bc21 Speed up SCH_COMPONENT::ResolveAll(). 2017-03-09 15:46:12 +01:00
jean-pierre charras a592832886 fix I18n issue (empty string) 2017-03-09 11:47:40 +01:00
Chris Pavlina a73abbfc31 Fix possible threadsafety issue in FOOTPRINT_PREVIEW_PANEL 2017-03-08 17:02:10 -05:00
Chris Pavlina 82f587f4ff Show the busy cursor while loading component chooser 2017-03-08 15:34:11 -05:00
Chris Pavlina 2e4e0a9a05 Minor cleanup in cmp_tree_model_adapter.h 2017-03-08 14:49:00 -05:00
Chris Pavlina 7ee0adabd7 Optimize component chooser startup time more
- Stop wx from sorting the items. We've already sorted them, and
  profiling shows our sort is faster than theirs.

- Go back to using strings as cache keys, because using pointers means
  the cache doesn't survive from one invocation to the next. Switch to
  wxHashMap because it can use wxString keys in an unordered (faster)
  map.
2017-03-08 14:41:34 -05:00
Chris Pavlina 28848373ce CMP_TREE_MODEL: add the correct number of units
Fixes: lp:1671174
* https://bugs.launchpad.net/kicad/+bug/1671174
2017-03-08 12:39:44 -05:00
Chris Pavlina 3bddc14dc6 CMP_TREE_MODEL_ADAPTER: use more suitable cache type
Fixes: lp:1671086
* https://bugs.launchpad.net/kicad/+bug/1671086
2017-03-08 12:34:11 -05:00
Chris Pavlina 2232edfb87 Rewrite DIALOG_CHOOSE_COMPONENT without wxFormBuilder
This will allow near-future use of controls not supported by
wxFormBuilder with minimal hackery.
2017-03-08 12:00:49 -05:00
Simon Richter ae9bbf7aeb Fix building benchmark test
Passing a wxString to std::ifstream::ifstream() is ambiguous, at least on MSVC.
2017-03-08 10:45:26 -05: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
Maciej Suminski 14cbdcec1f Fixed mismatched new[]/delete in 3D viewer 2017-03-08 09:12:16 +01:00
Chris Pavlina cf373e543f Fix Windows (and macOS?) build error caused by 11f4622ea 2017-03-07 17:51:25 -05:00
Chris Pavlina 36e400ec5b Avoid collapsing component chooser column widths to zero
Fixes: lp:1670762
* https://bugs.launchpad.net/kicad/+bug/1670762
2017-03-07 14:59:51 -05:00
Chris Pavlina 11f4622ea5 Fix GL assertion failure during GAL teardown 2017-03-07 14:37:02 -05:00
Chris Pavlina 3854637ec5 Footprint preview: do not Freeze/Thaw
This causes issues under Ubuntu Unity (possibly due to calling Show()
while frozen).

Fixes: lp:1670705
* https://bugs.launchpad.net/kicad/+bug/1670705
2017-03-07 14:32: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
Julius Schmidt 29eb696ef7 Fix crash when switching from dragging to routine (PNS router)
The attached patch fixes a bug where triggering InlineDrag while routing
is in progress will crash pcbnew.  The problem is that the InlineDrag
event does not terminate performRouting.  Once InlineDrag is finished
it will call StopRouting which deletes the m_placer.  The Wait() in
performRouting will then return and it will crash as soon as it tries
to access the m_placer.
2017-03-07 13:56:44 +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
José Ignacio Romero 45d1082517 Make all layers slightly semitransparent as before 2017-03-07 11:57:52 +01:00
Chris Pavlina 2bb234d3f5 Fix assert in DIALOG_EESCHEMA_CONFIG when removing many libs at once 2017-03-06 17:24:12 -05:00
Simon Richter 12c1339296 Remove false "override" comments. 2017-03-06 16:34:56 -05:00
jean-pierre charras 0b3e5952b7 Eeschema: fix a crash if a schematic project was not loaded due to a incorrect file format error (Linux only)
Fixes: lp:1670322
https://bugs.launchpad.net/kicad/+bug/1670322
2017-03-06 21:41:43 +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 3174573361 Removed code resetting VIEW_CONTROLS settings
As the VIEW_CONTROLS settings are managed for each tool,
there is no need to restore the settings to initial state
when a tool is finished.
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 541b91fd15 Fix FOOTPRINT_PREVIEW_PANEL loader thread synchronization 2017-03-05 22:22:25 -05:00
Wayne Stambaugh 6f3ec438cb Add missing install package to the compiling document.
The base-devel package install was missing from the "MSYS2 The Easy Way"
section of the compiling developers document.

Fixes lp:1670067

https://bugs.launchpad.net/kicad/+bug/1670067
2017-03-05 14:08:12 -05:00