Compare commits

...

496 Commits

Author SHA1 Message Date
Wayne Stambaugh ba7e400e13 Tag release version 5.1.5-rc1. 2019-10-25 14:24:51 -04:00
Seth Hillbrand 57f0f88552 pcbnew: Treat circular ovals as circles
The oval clearance adds an edge on the 0-length side of a circular oval.
This is not needed and can affect the fill algorithm.  Instead, we treat
round ovals as circles for pad polygons

Fixes: lp:1849846
* https://bugs.launchpad.net/kicad/+bug/1849846
2019-10-25 09:28:09 -07:00
jean-pierre charras 42a0cf6283 PCB_BASE_FRAME::SelectFootprintFromLibTree(): fix annoying issue: the progress reporter was displayed after loading libraries, because it was destroyed too late. 2019-10-25 18:08:02 +02:00
Seth Hillbrand b67acd5ea1 pcbnew: Fix 45° snapping polygons
The constrained draw was constraining the polygon size to fit the
existing points rather than extending the existing points to fit the
user's intent.

This adds a 90° double-joint for the completion polygon that allows the
user to complete common constrained polygons visually based on the
preview with a double-click to finish.

(cherry picked from commit bae50fab9f)

Fixes: lp:1849299
* https://bugs.launchpad.net/kicad/+bug/1849299
2019-10-24 16:05:27 -07:00
Seth Hillbrand 5e2721d2f5 Increase visibility of polygon preview
This set the polygon preview item to wider size and adjusts the draw
order to ensure it remains visible even when antialiasing

(cherry picked from commit ea1c8525ce)
2019-10-24 16:05:12 -07:00
jean-pierre charras 2cd43aee0a Gerber output: fix some (minor) issues related to attributes when plotting polygonal pads.
rect (when not horizontal or vertical), trapezoid and custom shapes are draw as polygons.

The dummy pad used to give attributes is removed, and TO attributes are used in Regions (polygons in Gerber dialect)

This is due to some modifications in Gerber format since the attributes are added in Kicad.
2019-10-24 09:32:40 +02:00
jean-pierre charras fb1570d290 DIALOG_POSITION_RELATIVE_BASE: fix wxWidget alerts 2019-10-23 20:41:00 +02:00
Seth Hillbrand 79972ad4db pcbnew: Fix DXF Import with blocks
BLOCK elements in DXF are re-usable bits that are useful when editing
the file but should not be shown when importing the model.  This skips
all references except those that exist in the default "*Model_Space".
This block is required in each DXF file and cannot be renamed.

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

(cherry picked from commit df3fabfa21)
2019-10-23 11:31:43 -07:00
Ian McInerney 61934c285c pcbnew: Fix deletion of vias in global delete window
Fixes: lp:1847580
* https://bugs.launchpad.net/kicad/+bug/1847580

(cherry picked from commit 3b1817ee32)
2019-10-23 12:25:00 -04:00
Seth Hillbrand a7d554971c eeschema: Pad spice ops to differentiate
The .op command is isolated, so differentiating from .option with a
space will only work if we ensure all commandlines have a space at their
end.

(cherry picked from commit 4004c733c8)
2019-10-23 06:33:10 -07:00
jean-pierre charras e54ea90607 PROGRESS_REPORTER: fix serious bug in its DTOR: the DTOR was calling Destroy. But Destroy() in wxWidgets calls the DTOR.
It can create recursive calls of the DTOR.
2019-10-23 11:29:44 +02:00
jean-pierre charras fda403a079 Fix potential issue 2019-10-21 08:26:22 +02:00
Sylwester Kocjan f2e75c96be eeschema: fixed recognizing SPICE sim directive
(cherry picked from commit 1c01cc001d)
2019-10-20 12:11:38 -07:00
Seth Hillbrand 322eb2b8a8 pcbnew: Commit polygon points to new constrained zone
Adds leader points if they are not already existing in the zone

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

(cherry picked from commit 2e1af66a2b)
2019-10-20 10:31:08 -07:00
Seth Hillbrand 6f71183d0e Revert "kicad2step: scale models"
This reverts commit 5064df4ba2.

There were un-addressed issues with the VRML substitution and concerns
by MCAD folks that ECAD designers should not be allowed to perform this
action.  Full addressing in v6.
2019-10-20 10:06:43 -07:00
Seth Hillbrand 5d852cf6ae pcbnew: Don't limit editing of the polygons
45 deg contraints are not saved per polygon, so don't limit per polygon.
The constraint is only enforced during creation.

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

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

(cherry picked from commit 8f1c1cf298)
2019-10-20 09:31:26 -07:00
Seth Hillbrand 2d1ea1618b pcbnew: prevent assert with first pt
Finding the pt-to-end intersection requires a segment, so check for
multiple points.

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

(cherry picked from commit 70c64d93e4)
2019-10-20 07:41:48 -07:00
Seth Hillbrand 50723d07a6 GAL: Use vector for stroke elements
deque structures have higher overhead than vectors.  Not usually
problematic, but with hundreds of thousands of characters each with only
a few strokes, the overhead becomes dominant.

(cherry picked from commit 6084614371)
2019-10-19 07:28:25 -07:00
Seth Hillbrand 1161562bc8 Remove Yahoo Groups link
Yahoo has discontinued its groups.

See https://help.yahoo.com/kb/groups/SLN31010.html
2019-10-17 15:59:06 -07:00
Seth Hillbrand 0c8b3aaced eeschema: Don't warp before processing right-click
The logic handling the two bug reports attached to this code is now
higher up in the chain.  As it stood, warping before right-click meant
that we cannot affect any point on the wire that is not an endpoint.
2019-10-17 13:49:49 -07:00
Seth Hillbrand b81b7decf6 eeschema: Add junction when breaking overlapping wires
This is the v5 version of 363281dd4.

Fixes: lp:1848450
* https://bugs.launchpad.net/kicad/+bug/1848450
2019-10-17 13:32:14 -07:00
Seth Hillbrand e5463330ef view: Check for viewData in IsVisible()
viewData can be NULL, make sure we verify it before dereferencing.

(cherry picked from commit 5b8661f2ab)
2019-10-15 09:46:47 -07:00
Seth Hillbrand 17c0b3e460 pcbnew: Check all layers for routing snaps
Flipped footprint pads may report their "primary" layer as not the front
layer in high contrast.  We need to check whether the board item for
snaps is visible on the active layers.

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

(cherry picked from commit 07c8596084)
2019-10-15 09:46:39 -07:00
jean-pierre charras 3bc3193805 Fix typo 2019-10-15 17:50:40 +02:00
jean-pierre charras d6db6dedca Gerber file export: avoid duplicate corner when creating polygons (regions in Gerber dialect)
Fixes: lp:1847714
https://bugs.launchpad.net/kicad/+bug/1847714
2019-10-11 21:01:40 +02:00
Seth Hillbrand d931bc72c7 pcbnew: Snap during routing needs active parent
The router items may not yet have a board item parent.  In this case,
the reference to the parent needs to be guarded before dereferencing.

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

(cherry picked from commit 0f8a1c22ad)
2019-10-11 09:16:58 -07:00
jean-pierre charras 6506f77689 Gencad export: fix an issue in hash_eda calculation,
that can generate the same hash for 2 different footprints.
Therefore, for some footprints, the right footprint was not associated to the component.
The hash calculation was using a XOR to combine 2 sub hash values.
This is not a reliable way to combine these hash values.
They are now added.
Looks better to identify similar and different footprints.

Fixes: lp:1847575
https://bugs.launchpad.net/kicad/+bug/1847575
2019-10-10 20:20:45 +02:00
Seth Hillbrand 0d64b38dbc pcbnew: Remove snapping to hidden items
Items and layers that are hidden in the view should not be used as snap
points.  This happens in multiple locations:
1) Grid Helper for normal tools
2) TOOL_BASE::snapToItem for router

Resolves KiPro Issue #116

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

(cherry picked from commit cecfeea947)
2019-10-10 09:47:34 -07:00
jean-pierre charras 7856061cf0 Fix a few wxWidget asserts related to not existing block operations from mouse drag command.
block rotate and block mirror are not implemented in HandleBlockPlace.
(only available from context menu)

Fixes: lp:1847554
https://bugs.launchpad.net/kicad/+bug/1847554
2019-10-10 10:07:15 +02:00
jean-pierre charras 0210e414d2 Fp editor, DIALOG_FOOTPRINT_FP_EDITOR: fix a very annoying issue: the value field was copuled to the fp name. Unlike schematic symbols, the value field and the footprint name are 2 different fields. So coupling these fields in the DIALOG_FOOTPRINT_FP_EDITOR dialog created serious issues.
Fixes: lp:1846533
https://bugs.launchpad.net/kicad/+bug/1846533
2019-10-09 18:58:23 +02:00
jean-pierre charras 41231e8ae2 Gerber file generation: fix incorrect aperFunction attribute for graphic items on edge cut layer.
Was NonConductor. Must be Profile.
From master branch.
2019-10-09 16:02:45 +02:00
jean-pierre charras ba2e34682e Gerbview: enhancement: show attributes for polygons (Regions in Gerber dialect) that have no DCode
This change is needed to follow current specifications in Gerber X2
2019-10-08 10:25:25 +02:00
jean-pierre charras b234ff9234 Eeschema: fix issues with pin shapes related to clock input pin shapes.
Fixes from master, commit eaea03217:
* Fix not drawn shapes for clock low, inverted clock and broken shape for falling edge clock
* Especially, shape for falling edge clock was a not existing shape, therefore useless.
* now falling edge clock and clock low shape are similar.
2019-10-08 10:11:56 +02:00
Ian McInerney 3442cc3d1a pcbnew: Don't reset router settings when breaking a track
Calling Init() in an action routine will reset the router
settings to the state they were in when first starting pcbnew.
The Init() function is automatically called when the tool is created.

Fixes: lp:1843810
* https://bugs.launchpad.net/kicad/+bug/1843810
2019-10-07 16:10:22 -04:00
Ian McInerney e618e34c94 pcbnew: Clean up extension handling in graphics plugins
* Fix wildcard display in the file selector dialog (on GTK
  it would show the regex to the user)
* Move the file extension comparison into a common function

(cherry picked from commit b33c3a5ad8)
2019-10-04 16:01:15 -04:00
Adam Wolf 105c3b0a4c Add additional ngspice codemodel path for launching from standalone eeschema on macOS.
(cherry picked from commit c7c49cee5a)
2019-10-04 14:33:23 -04:00
Ian McInerney 69d0446019 Update pleditor path for run from build directory
(cherry picked from commit 3a2dbf7786)
2019-10-04 07:58:17 -04:00
jean-pierre charras 078045f73b Gerbview: fix incorrect canvas type saving after closing Gerbview.
Was due to the fact the canvas type was now saved into m_canvasType when opening Gerbview.
2019-10-02 18:30:36 +02:00
jean-pierre charras 78af1daa2e Fix an issue in DIALOG_NETLIST: if the netlist filename does not exist, one cannot always modify the entered name.
(from master branch)
2019-09-30 19:43:25 +02:00
jean-pierre charras 0bd0d57a81 Cairo print, on GTK: use a better DPI definition to avoid artifacts rendering (GTK specific) Previously, a 600 DPI was used to set device scale (can create minor visible rounding issues). Using now 4800 DPI to reduce these rounding artifacts.
Fixes: lp:1845229
https://bugs.launchpad.net/kicad/+bug/1845229
2019-09-27 11:17:58 +02:00
jean-pierre charras 9dd5b6ce37 simulator: plot curves: fix incorrect draw area limits calculation when zooming.
Fixes: lp:1674132
https://bugs.launchpad.net/kicad/+bug/1674132
2019-09-26 16:30:28 +02:00
Seth Hillbrand d862cdaa72 pcbnew: properly close tags when handling bad poly
The parenthesis depth is 2 when the polygon isn't closed.  This
shouldn't happen but we have the fall-through to handle odd cases

Fixes: lp:1844872
* https://bugs.launchpad.net/kicad/+bug/1844872
2019-09-21 09:25:16 -07:00
Seth Hillbrand 4f57de9688 connectivity: Use pad anchor for connections
The pad should use its anchor point rather than the geometrical center
of the pad for connections.
2019-09-19 13:25:26 -07:00
Seth Hillbrand 92b6e05909 connectivity: Check all anchors for connection
With pads, we should check available anchor points for each connection,
increasing probability of finding connection to match fill algorithm

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

(cherry picked from commit b7128639f8)
2019-09-19 12:46:03 -07:00
Ian McInerney 2bd0bae2f7 Remove unneeded wxWidgets version checks in the code
Now that the minimum version is 3.0.0, we don't need to actually
check if the version is greater than 3.0.0 inside the code.

(cherry picked from commit a37d8f2859)
2019-09-18 14:27:30 -04:00
Wayne Stambaugh 69b5d24f28 Eeschema: do not save legacy symbol libraries in schematic file.
Fixes lp:1843473

https://bugs.launchpad.net/kicad/+bug/1843473
(cherry picked from commit 7cf42bb308)
2019-09-18 14:24:20 -04:00
Wayne Stambaugh e5dcb9d9da Eeschema: improve error message when writing cache library.
Remove duplicate missing symbol names from the extended error message.

Fixes lp:1842452

https://bugs.launchpad.net/kicad/+bug/1842452
(cherry picked from commit 18667377f7)
2019-09-13 15:58:37 -04:00
jean-pierre charras 4db8638f7e PANEL_SETUP_NETCLASSES: fix not working (immediately closed) wxChoice widgets to select a filter This happens with wxWidgets 3.0.4 on Windows and is a side effect of a call to Layout(). The fix just calls Layout() only when needed.
Fixes: lp:1843594
https://bugs.launchpad.net/kicad/+bug/1843594
2019-09-13 11:53:03 +02:00
Jeff Young cec885daf9 Partial cherry-pick of f1790c24e5.
Fixes: lp:1842199
* https://bugs.launchpad.net/kicad/+bug/1842199
2019-09-12 22:15:36 +01:00
Michal Jahelka 90fbf27114 c3d_render_ogl_legacy.cpp: initialize m_Emissive member of SMATERIAL to be sure it is set to 0, 0, 0 2019-09-10 17:46:35 +02:00
Jeff Young f1436cec9b Restore PointCloserThan() behaviour to really be "closer than".
Change calls which really want it to be "closer than or equal" to
distance + 1.

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

(cherry picked from commit 25fa2131d2)
2019-09-10 12:57:52 +01:00
Jeff Young cf968cb6b5 Performance enhancement. 2019-09-09 23:22:29 +01:00
Jeff Young 2278f40051 Fix zero failure in SEG::PointCloserThan().
Fixes: lp:1843329
* https://bugs.launchpad.net/kicad/+bug/1843329
2019-09-09 23:22:29 +01:00
Ian McInerney 18a76d3a87 Manually put the UNIT_BINDER text on the primary selection clipboard
The OnKillFocus handler of the UNIT_BINDER replaces the text in the
control with the evaluated string, which removes the selection. To
get the original text on the primary selection clipboard, we must
add it ourselves.

Fixes: lp:1794623
* https://bugs.launchpad.net/kicad/+bug/1794623
2019-09-09 09:02:23 -07:00
Jeff Young 6a65461ec7 Replace buggy code in TestSegmentHit() with call to SEG::PointCloserThan()
Fixes: lp:1843101
* https://bugs.launchpad.net/kicad/+bug/1843101

(cherry picked from commit 6f0d8c3eac)
2019-09-08 12:40:33 +01:00
Jeff Young a5a0a7c4f3 Fix bug with high-frequency plots.
Fixes: lp:1839712
* https://bugs.launchpad.net/kicad/+bug/1839712

(cherry picked from commit 2ac270ce8e)
2019-09-08 01:12:33 +01:00
Jeff Young f1e6f8042c Check for dup layer names in the GUI, not in the internals.
Doing so in the internals keeps users from being able to swap layer
names as the dialog does each layer name change individually.

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

(cherry picked from commit f491b7fff7)
2019-09-07 23:57:49 +01:00
Jeff Young 848873d87e Add some protection against newlines sneaking into the file.
Fixes: lp:1842943
* https://bugs.launchpad.net/kicad/+bug/1842943
2019-09-07 02:32:56 +01:00
Jeff Young 75bb864237 Workaround wxWidgets inability to find the default PDF viewer.
Fixes: lp:1843061
* https://bugs.launchpad.net/kicad/+bug/1843061

(cherry picked from commit d55f4d05b4)
2019-09-07 00:07:06 +01:00
Ian McInerney d5275b16aa eeschema: Find the closest line end to the mouse when grabbing
Fixes: lp:1842175
* https://bugs.launchpad.net/kicad/+bug/1842175
2019-09-06 14:16:56 -07:00
Seth Hillbrand 15d1b6cef0 eeschema: Handle broken spin style value
The spin style is stored as a numeric and can be corrupted.  We handle
this by triggering assertions for debugging the bad value while
resetting to default if we have non-valid spin values that are outside
the array.

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

(cherry picked from commit c3226653cc)
2019-09-06 13:18:34 -07:00
Wayne Stambaugh 6d4dd3e17a Pcbnew: fix size of graphics import warning dialog.
Use the HTML_MESSAGE_BOX window to present the warning messages rather
than wxMessageBox which would overflow the display when there were a lot
of graphic items that could not be parsed.

Fixes lp:1839565

https://bugs.launchpad.net/kicad/+bug/1839565

(cherry picked from commit 24454f5105)
2019-09-06 14:59:40 -04:00
Ian McInerney 649c22a34e wxWidgets compatibility fixes
* Remove unneeded check
* Fix WX_GRID since upstream renamed a variable in 3.1.3

(cherry picked from commit 8d86d94a4d)
2019-09-06 08:48:03 -04:00
Jeff Young 8d04d39036 Cherry-pick of https://git.launchpad.net/kicad/patch/?id=c03535343c67c17ddf0ac18621743d9cf762eb05
Fixes: lp:1842652
* https://bugs.launchpad.net/kicad/+bug/1842652
2019-09-04 20:08:39 +01:00
Jeff Young 0e90c719b0 Update description in footprint tree when it's edited.
Fixes: lp:1842660
* https://bugs.launchpad.net/kicad/+bug/1842660

(cherry picked from commit 6688e80131)
2019-09-04 17:24:17 +01:00
jean-pierre charras a79526cad8 Footprint viewers: force cairo canvas instead of legacy canvas when the legacy canvas is selected in the board editor.
Legacy canvas does not work in footprint preview panel and does not work fine in footprint viewer frame.

Fixes: lp:1842483
https://bugs.launchpad.net/kicad/+bug/1842483
2019-09-04 16:00:54 +02:00
jean-pierre charras d05d8b6100 Pcbnew: Fix incorrect canvas type saved in config, when the type is legacy canvas. 2019-09-04 11:22:55 +02:00
Jeff Young 9856867954 Correct tooltip for Footprint Filter icon on Cvpcb toolbar.
Fixes: lp:1842477
* https://bugs.launchpad.net/kicad/+bug/1842477
2019-09-03 19:46:39 +01:00
Ian McInerney 19064b680e Make the extension check for graphics import case insensitive
The regex for the file extension that matches against all case
possibilities is only built on Linux.

Fixes: lp:1842180
* https://bugs.launchpad.net/kicad/+bug/1842180
2019-09-02 10:03:39 +02:00
jean-pierre charras 95265c765b Pcbnew, DIALOG_TEXT_PROPERTIES: make lines thickness editable when editing a dimension.
From Master branch (commit 762dabd7)

Fixes: lp:1841797
https://bugs.launchpad.net/kicad/+bug/1841797
2019-09-02 10:03:39 +02:00
Jeff Young 1ed8912f57 Workaround an issue where a throw terminates (even when there's a catch for it).
You can trigger it before this fix by running Cvpcb when a .kicad_mod file is
incorrectly set as "Legacy" in your footprint table.

(cherry picked from commit e269b5d1b9)
2019-09-01 12:37:58 +01:00
Jeff Young 82a0eb4413 Use Move() instead of SetPosition() so that the second pt gets updated too.
Fixes: lp:1841989
* https://bugs.launchpad.net/kicad/+bug/1841989

(cherry picked from commit 315a99e0fe)
2019-08-30 23:32:54 +01:00
Jeff Young be7215402b Partial cherry-pick of 79d062aefc. 2019-08-30 13:47:39 +01:00
Seth Hillbrand 4500b064d8 Handle active layer overloading
Setting the active layer should be tied to the events that are triggered
by the layer change and overloaded for each frame.  This ties the hotkey
back to these events.

Note: In the 5.1 cherry-pick this also adds the missing hotkey to
footprint editor

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

(cherry picked from commit 494d0de9b8)
2019-08-28 05:57:48 -07:00
jean-pierre charras 93d191d7c9 fix compil error 2019-08-28 10:05:25 +02:00
jean-pierre charras 1607ceaf3e Eeschema, symbol tree selector: make the selected lib and symbol readable.
Previously, the background was highlighted, but not the text.
On Windows, the text was unreadable, until it was selected.

From Master, commit 34e00bdb.
2019-08-28 09:34:46 +02:00
Jeff Young 5b24ea9dd9 Clearance should be in mils, not inches.
Fixes: lp:1841360
* https://bugs.launchpad.net/kicad/+bug/1841360

(cherry picked from commit 7c85dc6cd7)
2019-08-27 21:15:54 +01:00
Jeff Young c879dcaf7d Sort pins by number when grouping by name.
Fixes: lp:1828648
* https://bugs.launchpad.net/kicad/+bug/1828648

(cherry picked from commit 97212acecb)
2019-08-27 21:15:17 +01:00
Jeff Young 86691dabbf Partial cherry-pick of 03da721030.
Fixes: lp:1841361
* https://bugs.launchpad.net/kicad/+bug/1841361
2019-08-27 18:16:25 +01:00
Seth Hillbrand fe71a66bb9 pcbnew: Force resize event when changing pad type
The local settings panel needs to have its children sized when shown.
Triggering a resize event on changing the pad shape accomplishes this.
This is not triggered in master due to refactor of the custom pad
connection options.

Fixes: lp:1837789
* https://bugs.launchpad.net/kicad/+bug/1837789
2019-08-27 05:55:04 -07:00
Seth Hillbrand 80e0d848f2 eeschema: Modify all units at the same time
When editing symbol library reference, this ensures that all units are
modified by the same action and the component is not represented by its
subunits.

Fixes: lp:1834509
* https://bugs.launchpad.net/kicad/+bug/1834509
2019-08-26 20:42:29 -07:00
Seth Hillbrand 8b3a2984bf pcbnew: Two layer boards need both masks
Adds the missing default layer to the default board setups for two
layers with parts on single side (either top or bottom)

Fixes: lp:1841294
* https://bugs.launchpad.net/kicad/+bug/1841294
2019-08-26 17:14:13 -07:00
Seth Hillbrand fccce265aa pcbnew: Retain 45° constraint
This also finishes the polygon with 45° lines when chosen as a create
option.

Fixes: lp:1833673
* https://bugs.launchpad.net/kicad/+bug/1833673
2019-08-26 14:33:30 -07:00
Seth Hillbrand a43a228f78 eagle: Set module-relative position of ref/val
We need to set the footprint local coordinates of the footprint
reference and value fields at instantiation separately from the
TEXT_DIVERS elements.

Fixes: lp:1829727
* https://bugs.launchpad.net/kicad/+bug/1829727
2019-08-26 09:56:42 -07:00
Jeff Young dd8610fd5c Don't apply GTK fix to OSX as it causes a hang.
Fixes: lp:1841379
* https://bugs.launchpad.net/kicad/+bug/1841379

(cherry picked from commit de8f97be6b)
2019-08-26 00:50:54 +01:00
Seth Hillbrand b991beb712 pcbnew: Fix error in connecitivty calculation
Point in polygon should test against half the stroke width as the stroke
is performed _on_ the polygon edge.

(cherry picked from commit 820c2d2722)
2019-08-23 10:52:11 -07:00
Seth Hillbrand 25f6483488 gerbview: Ensure selection lives on top
Just picking the next layer will be overwritten when we have multiple
objects on the same layer in gerbview.  Move the selection to the top to
ensure it is out top-most layer when drawing.

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

(cherry picked from commit 77488e379c)
2019-08-22 10:52:56 -07:00
Seth Hillbrand efc0325e14 Handle wx scrollbar thumbs in system-independent way
The thumb size changes between system versions and (on GTK) render
managers, so hard-coded wasn't working.  This gets the actual value from
the system and uses to adjust the range.  Changes in the range can also
trigger the refresh.

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

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

(cherry picked from commit 85df994eda)
2019-08-22 10:16:25 -07:00
Seth Hillbrand d19ec021fe PNS: Check that we are optimizing a pad
Vias are also sent to breakout optimizer, so we need to check for the
solid cast before dereference.

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

(cherry picked from commit 03d5bf0df5)
2019-08-22 09:03:12 -07:00
Seth Hillbrand b34a307936 pcbnew: Scale line width for import
The line width in the import dialog is meant to reflect the resulting
width and not the given width of the file.

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

(cherry picked from commit 22fdc7f51f)
2019-08-21 10:35:40 -07:00
Seth Hillbrand fb565caf7b pcbnew: Optimize pad connection revision
This modifies that logic for optimizing pad connections.

1) Custom pads now prefer the connections to their longer side.  This is
particularly important to match the behavior in a rectangular pad
2) Costs for straight lines are non-zero.  This favors fewer connections
3) Custom pad breakouts are at the polygon boundary rather than offset
by 0.1mm.  This also matches the circular and rectangular paradigm.
4) Line Heads contained in the pad itself are not optimized.  This
prevents escaping the pad unnecessarily

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

(cherry picked from commit 06cb21cc47)
2019-08-20 19:37:59 -07:00
Seth Hillbrand 6796e8fff6 EEschema: Plot stroked edges over BG
Items that have BG fill need to be plotted in the background but we
still need their stroked edges to be in the FG.  This is a workaround
that overplots the edges ensuring visual similarity.  Re-working the
plot engine to support layers is a larger project.

Fixes: lp:1833428
* https://bugs.launchpad.net/kicad/+bug/1833428
2019-08-20 12:03:19 -07:00
Seth Hillbrand 213547f545 SVG: Correct plot fills for arcs/polylines
When plotting in Eeschema, various elements may be filled with either
the foreground or background colors.  The fill mode is rather unique,
requiring un-stroked pie wedges for arcs and both closed and open filled
polylines.

Fixes: lp:1840769
* https://bugs.launchpad.net/kicad/+bug/1840769
2019-08-20 12:01:00 -07:00
Jeff Young 73851e962b Implement undo/redo for lock/unlock/toggle lock.
Fixes: lp:1840770
* https://bugs.launchpad.net/kicad/+bug/1840770

(cherry picked from commit b219fbc3d2)
2019-08-20 16:42:20 +01:00
Jeff Young de22204514 Allow mouse drag to initiate a router drag if over a track or via.
Fixes: lp:1840694
* https://bugs.launchpad.net/kicad/+bug/1840694

(cherry picked from commit 1bfefc61ea)
2019-08-19 23:32:56 +01:00
Seth Hillbrand ebba15fe67 Alphabetize Library Table returns
KiCad is case sensitive but we need to be consistent in displaying sort
order as case insensitive (same as file systems)

Fixes: lp:1836911
* https://bugs.launchpad.net/kicad/+bug/1836911
2019-08-19 15:23:29 -07:00
Jeff Young c1cd3339fa Fix assertion in new Duplicate Hotkey warning message. 2019-08-19 14:24:26 +01:00
Jeff Young 713a296a59 Update all aliases of current node after Symbol Properties dialog.
Fixes: lp:1840466
* https://bugs.launchpad.net/kicad/+bug/1840466
2019-08-19 10:55:17 +01:00
jean-pierre charras 06bde527d5 Pcbnew, layer manager: fix flicker when loading a file, and incorrect size on start when no file is loaded
From master, commit b25ffc0
2019-08-19 10:58:45 +02:00
Erik Bosman dcd31f5701 Fix a null-pointer dereference in 5.1 branch
TRACK::GetEndNetCode() can get called using a NULL-pointer as 'this'.
The compiler assumes this won't happen and optimizes away a NULL pointer
check at the start of the function (so we might as well remove this check.)

Fixes: lp:1840562
https://bugs.launchpad.net/kicad/+bug/1840562
2019-08-18 14:59:58 +02:00
Seth Hillbrand 65f2af5849 3d: Disable floor rendering by default
The floor render in raytracing creates interesting shadow effects but
significantly increasing the processing time for renders and has the
side effect of making the bottom of the board very dark if you simply
flip it over.  Making this option off by default, we allow power users
to turn it on if needed for their renders while speeding up the default
raytrace and preventing new user confusion.

(cherry picked from commit 4fcfd266e0)
2019-08-16 11:42:21 -07:00
Seth Hillbrand 2dd7a8637c pcbnew: Handle edge cuts in footprints for bbox
The Board bounding box calculation has two modes: edges only and
everything.  While the everything mode works as expected, the edges only
calculation (and everything that depends on it) was seeing only the edge
cuts on the board drawings layer and not the footprint edge cuts.

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

(cherry picked from commit 99859727e8)
2019-08-16 11:14:14 -07:00
Seth Hillbrand 211d056728 3d-viewer: Remove dead code
The 2d-bbox of the 3d viewer was calculated and set but never used

(cherry picked from commit 59ed9f086f)
2019-08-16 11:01:01 -07:00
Seth Hillbrand dc0aed5b16 Allow EDA_RECT to properly be uninitialized
The base initialization of EDA_RECT sets a 0/0/0/0 rectangle that
prevents merging properly with valid EDA_RECT.  This sets the default to
be uninitialized until the internal data are set.

(cherry picked from commit 46feb76aba)
2019-08-16 11:01:01 -07:00
Simon Schubert 5064df4ba2 kicad2step: scale models
Fixes: lp:1784257
* https://bugs.launchpad.net/kicad/+bug/1784257

(cherry picked from commit a0ed40876d)
2019-08-15 14:32:32 -07:00
Simon Schubert 469c31da97 3d: min dot needs to be square
Given that we compare the dot product (square of length) to s_min_dot,
it means that s_min_dot also needs to be square, or we wind up
converting line segments into circles that are visually distinct from
circles, leading to gaps in polylines.

(cherry picked from commit 0823692dda)
2019-08-15 14:32:32 -07:00
Simon Schubert 5fb41e6ecc 3d canvas: use radius, not width for circles
(cherry picked from commit e01348cccc)
2019-08-15 14:32:32 -07:00
Simon Schubert a68a442bbb SVG plot: output invisible text in addition to plotting
Fixes: lp:1544918
* https://bugs.launchpad.net/kicad/+bug/1544918

(cherry picked from commit 176fe80425)
2019-08-15 14:32:32 -07:00
Seth Hillbrand 84db5644d6 pcbnew: Adjust drag snapping to avoid start
When dragging, you will seldom want to snap to the original item.  This
commit prevents the "size of track" snap to the original item and
replaces it with an auxilary grid origin for the snap.  This means
effectively that the snap will happen to grid for the original item
unless the cursor is closer to the original item line than it is to the
grid crossing.

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

(cherry picked from commit 0de25e557b)
2019-08-15 12:43:19 -07:00
Seth Hillbrand fc1fb7a590 PNS: Don't allow routing on hidden layers
If the layer is not shown, we should not be allowing it's items to be
selected and chosen as the start/end items in the router.
2019-08-15 12:38:16 -07:00
Wayne Stambaugh dc91d4eca8 Symbol editor: fix mnemonic issues in pin properties dialog.
Control ordering is critical to make dialog mnemonics work correct.  The
static text with the mnemonic must immediately proceed the control and
no additional controls can be added between static text/control pair.
Fixing this required adding the units static text controls after all of
the mnemonic static text controls and their associated edit controls.
Mnemonics do not work for read only controls so all of the combobox
controls were moved after the text controls.

Fixes lp:1818930

https://bugs.launchpad.net/kicad/+bug/1818930
(cherry picked from commit 92fe201c5b)
2019-08-15 15:10:43 -04:00
Shawn Anastasio f6a42a36d6 Fix libcontext on PPC64 ELFv2
libcontext currently restores and saves the FPSCR register
on ppc64. This behavior is fine (though unnecessary) on the
ELFv1 ABI which designates the register as volatile, but has
been observed to cause crashes on ELFv2 systems.

The ELFv2 ABI designates the FPSCR register as Limited-access
and specifies specific conditions that must be met to clobber
it. It does not seem that a context swap function meets these
conditions (and indeed, the save/restore register example in the
ABI document does not modify FPSCR).

This patch fixes ELFv2 ABI compliance by removing the FPSCR
save/restore code in libcontext entirely. This fixes observed
crashes on the platform and should have no consequence for
ELFv1 support.

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

(cherry picked from commit 3e22b75948)
2019-08-14 11:18:25 -07:00
Wayne Stambaugh 2a769dc0b0 Eeschema: fix bug in sheet name comparisons on Windows.
The use of wxPATH_UNIX when calling GetFullPath() on windows drops the
volume identifier (c:\) from the file name which will cause comparison
failures.

(cherry picked from commit 0328f3e33b)
2019-08-13 16:36:01 -04:00
Jeff Young 3475bfb2aa New move tool doesn't require GetAndPlace to jump through hoops.
And at least one of those hoops leaves the cursor forced.

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

(cherry picked from commit dd938b02df)
2019-08-13 10:02:57 +01:00
jean-pierre charras f9f8fade89 Pcbnew plot: fix missing footprint texts on solder mask layers.
Fix from master branch commit 1c295d46a9
2019-08-13 09:55:11 +02:00
Jeff Young e404fb772b Invoke move by ACTION; the EDIT_TOOL does lots of other stuff too.
Fixes: lp:1839877
* https://bugs.launchpad.net/kicad/+bug/1839877

(cherry picked from commit f3f0a6899f)
2019-08-12 23:00:55 +01:00
Wayne Stambaugh 2a9412042c Eeschema: remove dead code from LIB_PART object.
(cherry picked from commit 9020a3a26c)
2019-08-12 12:55:21 -04:00
Wayne Stambaugh e8ab661504 PCB calculator: fix regulator dialog layout.
Set default dialog size to -1,-1 to allow the dialog to size itself
properly to prevent the buttons in the standard dialog button sizer
from being truncated.

Fixes lp:1839695

https://bugs.launchpad.net/kicad/+bug/1839695
(cherry picked from commit e3e546f7d2)
2019-08-12 10:02:15 -04:00
Jeff Young 3f91db25d4 Minimal cherry-pick of c836cc9cf8.
Fixes: lp:1839534
* https://bugs.launchpad.net/kicad/+bug/1839534
2019-08-10 22:27:05 +01:00
Wayne Stambaugh 300381ba4d KiCad: fix new project from template bug.
Do no rename symbol library files to the new project name.  Only rename
the cache library.  This prevents breaking symbol library links in the
schematic due to the project symbol library table pointing to the wrong
library file name.

Fixes lp:1837667

https://bugs.launchpad.net/kicad/+bug/1837667
(cherry picked from commit c7fc54b348)
2019-08-07 15:39:19 -04:00
Seth Hillbrand 4363e6a213 eeschema: Fix list invalidation
When removing a junction, we need to keep the next pointer for deleted
item, marking them with a flag until committed.

Fixes: lp:1837398
* https://bugs.launchpad.net/kicad/+bug/1837398
2019-08-05 09:03:38 -07:00
Wayne Stambaugh 450dac4b1e Revert "Revert "Eeschema: remove rogue symbol libraries from project file.""
This reverts commit 0893e0043f.
2019-08-04 13:05:47 -04:00
Wayne Stambaugh 278127fe29 Revert "Revert "Eeschema: fix edit sheet bug.""
This reverts commit 2d48c81d58.
2019-08-04 13:05:35 -04:00
Wayne Stambaugh 23d71de75f Revert "Revert "Eeschema: fix many append schematic bugs.""
This reverts commit 238fb00727.
2019-08-04 13:05:09 -04:00
Wayne Stambaugh d86789898d Begin version 5.1.5 development. 2019-08-04 12:38:05 -04:00
Wayne Stambaugh c3dc1f65d4 Tag release version 5.1.4. 2019-08-04 12:36:25 -04:00
Wayne Stambaugh 238fb00727 Revert "Eeschema: fix many append schematic bugs."
This reverts commit 3518153d5b.
2019-08-04 12:34:25 -04:00
Wayne Stambaugh 2d48c81d58 Revert "Eeschema: fix edit sheet bug."
This reverts commit 6051dfae30.
2019-08-04 12:33:55 -04:00
Wayne Stambaugh 0893e0043f Revert "Eeschema: remove rogue symbol libraries from project file."
This reverts commit 5d60fe6812.
2019-08-04 12:33:19 -04:00
Jeff Young 72c0267fe6 Ativate delete tool so it can display the selection clarification menu when needed.
Fixes: lp:1835371
* https://bugs.launchpad.net/kicad/+bug/1835371

(cherry picked from commit c60118b6a4)
2019-08-03 22:49:27 -06:00
Seth Hillbrand c9956def36 pcbnew: Fix copy-paste error from 161dc9ce7
create_vrml_shell() needed the idxSide check but create_vrml_plane only
had an extra variable that wasn't used and so shouldn't be checked.
2019-08-02 13:14:02 -07:00
Wayne Stambaugh 5d60fe6812 Eeschema: remove rogue symbol libraries from project file.
Check for symbol libraries that somehow ended up in the project file
after remapping occurred and remove all of them to prevent potentially
broken symbol library links.

Add nagware dialog to warn the user and a checkbox to never show the
dialog again.

Fixes lp:1838185

https://bugs.launchpad.net/kicad/+bug/1838185
(cherry picked from commit 8789ab9265)
2019-08-01 15:24:55 -04:00
Wayne Stambaugh 6051dfae30 Eeschema: fix edit sheet bug.
Remove an existing sheet from the current page that requires a schematic
load from file to prevent a corrupt screen list from causing a segfault.

Merge the edit sheet file loading with the append schematic code since
they are functionally the same.  This allows the sheet edit code to
take advantage of all of the added broken symbol library links added in
the recent append schematic fixes.

Fixes lp:1835841

https://bugs.launchpad.net/kicad/+bug/1835841
(cherry picked from commit b595dc0d3b)
2019-08-01 15:24:55 -04:00
Wayne Stambaugh 3518153d5b Eeschema: fix many append schematic bugs.
Do not add cache library from another project to old library list.  This
is wrong and can cause all kinds of symbol library linking issues.  It's
better to force the user to fix broken symbol library links than the false
security of using multiple cache libraries.

Use correct paths when appending schematic outside of the current project
path when hierarchical sheets are appended.  If the path can be relative,
give the user the option to use either relative or absolute paths.

Do not change symbol library names in schematics appended from a source
outside the current project.  This will almost ensure the symbol library
links will be broken in the source project.

When the appended schematic is from another project, attempt to check all
of the possible combinations of symbol library table importing that could
cause broken symbol library links and give the user the option of canceling
the append operation or live with the possibility that there may be broken
symbol library links.

When the append schematic is in the current project path but not part of
the schematic, check to see if there are any library nicknames that do
no exist in the project symbol library table and give the user a chance
to cancel the append process.

(cherry picked from commit 9fae30162d)
2019-08-01 15:24:55 -04:00
Seth Hillbrand cf949609b2 eeschema: Properly map edge cases of legacy onto GAL
While we do not generate these arcs internally, some external tools
generate arcs that are technically valid but display correctly only
because of an oddity in the degeneracy mapping.

Fixes: lp:1838557
* https://bugs.launchpad.net/kicad/+bug/1838557
2019-08-01 11:45:10 -07:00
Jeff Young d482a8805c Perform better cleanup after cancelling text placement.
Fixes: lp:1838452
* https://bugs.launchpad.net/kicad/+bug/1838452
2019-07-31 23:17:08 -06:00
Seth Hillbrand 161dc9ce7e pcbnew: Fix VRML export checking
In rare cases, the VRML triangulator may claim to work but return empty
vectors.  These cases need to be caught before we dereference the vector
elements.

Fixes: lp:1838448
* https://bugs.launchpad.net/kicad/+bug/1838448
2019-07-31 20:03:49 -07:00
jean-pierre charras 090073cc3b Pcbnew, exchange footprints: fix a bug that prevent the new footprint to be at the right place.
Fixes: lp:1838446
https://bugs.launchpad.net/kicad/+bug/1838446
2019-07-31 12:07:49 +02:00
Ian McInerney 6ae718e4d6 pcbnew: Fix DXF units in drill map plotting
Fixes: lp:1836924
* https://bugs.launchpad.net/kicad/+bug/1836924

(cherry picked from commit 6c401ecce7)
2019-07-30 17:20:38 -04:00
Thomas Pointhuber 783b1cb611 Fix handling of filled circle in eagle importer (was only partly fixed)
Partly fixed in 4fc692f04b, but missed
that there is a loadPlain where I need to handle this case as well.

(cherry picked from commit 5f438b7a85)
2019-07-30 15:33:39 -04:00
Jeff Young 4b01f80e8d Fix typo in cherry-pick.
Fixes: lp:1838006
* https://bugs.launchpad.net/kicad/+bug/1838006
2019-07-30 11:49:06 -06:00
Jeff Young c8278f377b Alternative to cherry-picking b70df18939.
Fixes: lp:1838158
* https://bugs.launchpad.net/kicad/+bug/1838158
2019-07-29 20:19:46 -06:00
jean-pierre charras d34b664933 Simulation: do not add .save V(0) and/or .save V(GND) to ngspice.
These 2 nets are internally added by ngspice (info from Holger Vogt)

(cherry picked from commit d92396341e)
2019-07-28 04:52:57 -07:00
jean-pierre charras c8f40e1d26 PANEL_SETUP_NETCLASSES_BASE: fix minor wxAlert. 2019-07-28 13:26:58 +02:00
jean-pierre charras 185a8d7582 Try to fix UI issues in select layer pair dialog and slect layer dialog.
Fixes: lp:1838173
https://bugs.launchpad.net/kicad/+bug/1838173
2019-07-28 12:55:47 +02:00
jean-pierre charras 8373e91a1b Python scripting: fix missing definition of uint32_t (and some other similar defs).
Fixes: lp:1837867
https://bugs.launchpad.net/kicad/+bug/1837867
2019-07-27 08:22:10 +02:00
Jeff Young 6aeedfb70c Partial cherry-pick of 3904d7ccfc.
Fixes: lp:1838006
* https://bugs.launchpad.net/kicad/+bug/1838006
2019-07-26 20:46:12 -06:00
Stefan Hamminga e7f3851212 Rebased LTO fix for coroutines
Fixes: lp:1793329
* https://bugs.launchpad.net/kicad/+bug/1793329

(cherry picked from commit e58d9606dd)
2019-07-25 12:17:11 -07:00
jean-pierre charras 7df05ade4c Pcbnew: Fix bug in MODULE::FindPadByName( const wxString& aPadName ). This method was using a case insensitive comparison to find the pad matching aPadName. But in netlist we are using case sensitive comparisons to attribute a net to a pad. So if in the netlist there is a pad name that does not match any footprint pad name using case sensitive comparison but if it matches some pads using case insensitive comparison, the net is not set, but the test to detect non existing pads fails. 2019-07-25 17:57:38 +02:00
Seth Hillbrand 24b032ce5b Project Templates: Allow multiple line titles
This fixes two display issues in the project template selector.  The
first captured HTML tags in the template title display and the second
prevented more than one line for showing (at least on GTK) in the
preview.  This prevented disambiguation between the various templates.
2019-07-23 15:05:25 -07:00
Seth Hillbrand b6fe4ff637 eeschema: Clean up backup name
This fixes the last suffix that was missed by 168fa09f5.  The schematic
backup files should have the suffix .sch-bak to distinguish from
.kicad_pcb-bak or other backups.
2019-07-23 10:47:15 -07:00
Wayne Stambaugh 8f1aa28b37 Begin version 5.1.4 development. 2019-07-23 08:16:06 -04:00
Wayne Stambaugh 55c1e22a67 Tag release version 5.1.3. 2019-07-23 08:07:28 -04:00
Jeff Young ca0d4511a9 Copy ratsnest flags when exchanging modules.
Fixes: lp:1834214
* https://bugs.launchpad.net/kicad/+bug/1834214

(cherry picked from commit 2ca379b281)
2019-07-21 20:27:12 -06:00
Jeff Young b56855c542 Don't shove stitching vias.
Whether or not it's a good idea, the current algorithm doesn't support
it and leaves them on top of each other.

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

(cherry picked from commit aa4d7682ca)
2019-07-21 16:41:56 -06:00
Jeff Young 72e8eb3b94 Initialize plot with aux origin checkbox.
Fixes: lp:1836923
* https://bugs.launchpad.net/kicad/+bug/1836923

(cherry picked from commit b5e01ea163)
2019-07-20 07:58:43 -06:00
Jeff Young 281a1cdc2c Update DXF units drop-down.
Fixes: lp:1836927
* https://bugs.launchpad.net/kicad/+bug/1836927

(cherry picked from commit 4a1edf581e)
2019-07-20 07:58:38 -06:00
jean-pierre charras 3c8f901a1f Revert "Fix ngspice netlisting when net names contain '/'"
This reverts commit 216573bf48,
because the issue with net names containing '/' is not actually inside the netlist.
This commit 2165 creates issues with ngspice 2.8 and older, and do not fix anything in ngspice
2019-07-19 15:52:18 +02:00
Seth Hillbrand e0589d2908 pcbnew: Make clearance translucent
This sets the clearance outline to a slightly better opacity to allow
viewing of items behind the routed track clearance.  Future work should
include making this a configuration option.

Fixes: lp:1826719
* https://bugs.launchpad.net/kicad/+bug/1826719
2019-07-18 10:44:44 -07:00
Jeff Young dfd53976d4 Fix double-highlighted radio buttons on GTK.
Fixes: lp:1836538
* https://bugs.launchpad.net/kicad/+bug/1836538
2019-07-17 12:57:21 +01:00
Ian McInerney 02d43be93c pcbnew: Make the netlist class panel usable with a lot of classes
Fixes: lp:1826154
* https://bugs.launchpad.net/kicad/+bug/1826154

(cherry picked from commit 39954b20fe)
2019-07-15 06:12:13 -07:00
jean-pierre charras 2e8bceb676 Fix a minor wxWidgets alert, already fixed in master branch. 2019-07-15 12:27:54 +02:00
Jeff Young 16f9e697ab Allow edits to self-intersecting polygons.
1) Intermediate states might be self-intersecting, and we shouldn't
be policing our users on what order to do things in
2) The polygon might already be self-intersecting, at which point we're
preventing the user from fixing it.

Also includes better const management for SHAPE_POLY_SET API.

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

(cherry picked from commit a3c74051c2)
2019-07-14 18:36:47 +01:00
jean-pierre charras 269f88ee28 Fix incorrect handling of unicode chars (non ASCII7) in filenames in .gbrjob files. 2019-07-14 11:19:03 +02:00
Jeff Young f11d950448 Don't let visibility bit get nuked when updating effects.
Fixes: lp:1836183
* https://bugs.launchpad.net/kicad/+bug/1836183

(cherry picked from commit 6c9e34e799)
2019-07-11 23:01:54 +01:00
Jeff Young 6ba2c44e88 Add FootprintExists() which can be more careful about FS differences.
(And in particular, MSW's case-insensitive FS.)

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

(cherry picked from commit 20036f8105)
2019-07-11 23:01:25 +01:00
Jeff Young d1ed4665de OSX compiler didn't like the other syntax.
(cherry picked from commit f14e41133b)
2019-07-11 12:35:11 -07:00
Seth Hillbrand 5b68cfa018 Fix import graphics routines and tests
The returns of KiCad file extensions on GTK contain basic regex matching
case-insensitive file extensions.  We need to match these in the
provider and tests

(cherry picked from commit 1956c074ba)
2019-07-10 10:47:13 -07:00
Seth Hillbrand 85f88b6b05 Fix case-sensitive import using KiCad std
Fixes: lp:1832853
* https://bugs.launchpad.net/kicad/+bug/1832853

(cherry picked from commit 79e2000af4)
2019-07-10 10:33:03 -07:00
Seth Hillbrand ea467441d2 import_gfx: Make file selection case-insensitive
This adds the upper-case version of files names to the selection box for
filesystems that support case-sensitive file names.

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

(cherry picked from commit 36f70704eb)
2019-07-10 10:32:48 -07:00
Ian McInerney 40ba502853 pcbnew: Clean up warnings with unit handling in the DXF export
(cherry picked from commit ff9d899ae0)
2019-07-10 12:42:54 -04:00
Ian McInerney 09d7d0f1bc Update ngspice build tool script to ngspice-30
(cherry picked from commit 6186dd5c51)
2019-07-10 09:20:41 -04:00
Jeff Young 3418d53a6d Update symbol ID before running Update Fields from Library.
Fixes: lp:1827707
* https://bugs.launchpad.net/kicad/+bug/1827707

(cherry picked from commit fb881ee209)
2019-07-08 22:57:15 +01:00
Ian McInerney d5440d60ab eeschema: Fix initial selected text in reference value dialog
Fixes: lp:1834741
* https://bugs.launchpad.net/kicad/+bug/1834741

(cherry picked from commit e32306c232)
2019-07-08 14:50:53 -04:00
Jeff Young 2ba237ec12 Test for crash bug fix. 2019-07-08 15:34:01 +01:00
Jeff Young 01a343f28e Fix crash when re-entering a drag operation with a move.
Fixes: lp:1834111
* https://bugs.launchpad.net/kicad/+bug/1834111
2019-07-05 02:24:15 +01:00
Jeff Young 85220591e2 Fix bugs in keyboard cursor movement.
1) Generate refreshPreview events so the modern toolset doesn't
fall behind by one event (see LP:1818667)
2) In the legacy toolset don't call unimplemented routines and don't
snap to grid on the non-movement axis.
2019-07-05 01:32:15 +01:00
Jeff Young ecadc8bbba Fix bugs in new wire/line-width split.
If Symbol Editor isn't open then Eeschema needs to read in the
default line width.

Symbol Editor was failing to write line width parameter back to
properties.

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

(cherry picked from commit ef03afe289)
2019-07-03 14:34:11 +01:00
Jeff Young 26c92eaf0f Give up on KillFocus validation.
wxWidgets sends the KillFocus event before the Cancel button event,
and it sets the receiving-focus window pointer to NULL (so you can't
even check for it being the Cancel button.  Last time around (with
the UNIT_BINDER) I also tried a bunch of hacks for whether the window
pointer is NULL, etc., but they aren't discriminatory either.

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

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

(cherry picked from commit 1c30f3d9a9)
2019-07-02 18:13:27 +01:00
jean-pierre charras d129abb9c9 Eeschema, lib editor: fix a message error when loading a symbol from the schematic editor.
Adaptation from master branch, commit ff995bb7
2019-07-02 18:40:48 +02:00
Jeff Young 3b98b00d6f Only warn once in KillFocus for each error value in footprint name.
More than that just gets annoying, and there is at least one edge case
which throws us into an infinite loop if we don't have something to
break us out.

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

(cherry picked from commit 29db6152b3)
2019-07-02 00:48:57 +01:00
Jeff Young ce329e13fb Set library selection when pre-loading the Footprint Viewer.
Fixes: lp:1826932
* https://bugs.launchpad.net/kicad/+bug/1826932

(cherry picked from commit 8efe8d1835)
2019-07-01 22:17:57 +01:00
Seth Hillbrand be9cd98cb1 Move zone refill to action
This unifies the zone refill across architecture into the tool-based
architecture.  Also provides ZONE_FILLER-based progress managment for
tools.
2019-07-01 09:16:32 -07:00
Jeff Young 216acd98d6 Separate default line and wire thicknesses.
Fixes: lp:1834324
* https://bugs.launchpad.net/kicad/+bug/1834324
2019-06-30 11:13:17 +01:00
Jeff Young 10fd8a59b2 Apply relevant fixes from 51479c2042.
Fixes: lp:1834703
* https://bugs.launchpad.net/kicad/+bug/1834703
2019-06-29 21:17:22 +01:00
Seth Hillbrand 3974c6fd89 Enforcing rational limits on length tuner
The length tuning dialog needed validators on close to prevent negative
and percentages >100%

Fixes: lp:1834734
* https://bugs.launchpad.net/kicad/+bug/1834734
2019-06-29 09:37:47 -07:00
Ian McInerney f82962e42c eeschema: Fix python BOM generators to handle symbols
* Implement proper natural sorting of the reference values
* Perform quoting of all items in BOM generators that use csv.writer

Fixes: lp:1833822
* https://bugs.launchpad.net/kicad/+bug/1833822
2019-06-29 17:17:20 +02:00
Seth Hillbrand bf1ced4184 Allow more segments for large-arc footprints
When approximating arcs for polygons, we should allow for large radius
arcs/circles without coarsening the arc beyond a limit.  This is a
5.1.x-only patch to address this issue.  It should not be picked to
master as this is already addressed separately by max_error
2019-06-28 19:25:42 -07:00
Seth Hillbrand cabfcbc73c pcbnew: Drop tracks not on copper
We do not allow non-copper routed tracks and they will break assumptions
elsewhere in the code.  We drop them in the beginning so that they are
not saved.
2019-06-28 19:25:28 -07:00
Wayne Stambaugh 574473c480 Pcbnew: fix clean up tracks and vias segfault bug.
If a track has no connected items, do not attempt to access an empty
connected item map.

Fixes lp:1823973

https://bugs.launchpad.net/kicad/+bug/1823973
2019-06-28 13:12:23 -04:00
jean-pierre charras 17143fd53f Pcbnew, connectivity: fix incorrect detection of dangling track ends when a end is inside a zone.
This end was not detected as connected by the IsDangling method
2019-06-28 15:27:01 +02:00
Jeff Young b8fff99e68 Hook up zone-connection controls in Edit Footprint dialog.
Fixes: lp:1834629
* https://bugs.launchpad.net/kicad/+bug/1834629
2019-06-28 12:26:28 +01:00
Ian McInerney 3b038feae0 Cleanup cmake python dependency handling to catch errors
* Changed the KICAD_SCRIPTING flag to be a global disable, so it
  will disable all other scripting flags when set to OFF
* Added version testing with the wxPython flags to ensure the
  proper version is found for the flags provided

(cherry picked from commit 42e14b5a4e)
2019-06-27 13:41:55 -04:00
jean-pierre charras 032bda223e Gerber drill file: Modify a aperture attribute for oblong holes (slots).
Oblong holes (slots) use now a aperture attribute similar to round holes.
(The previous attribute "slot" is now deprecated)
However they have a specific aperture, and a comment is added in drill files for these apertures.
2019-06-26 17:53:09 +02:00
Jeff Young b16d4d18e0 Don't select items on inactive layers in high-contrast mode.
Fixes: lp:1833870
* https://bugs.launchpad.net/kicad/+bug/1833870
2019-06-26 01:18:59 +01:00
Wayne Stambaugh df3a57dcda Symbol and footprint library table editor fix.
Prevent the symbol and footprint library table editors from substituting
the current project path (${KIPRJMOD}) when adding libraries to the global
library table.  This will almost assuredly fail when opening a different
project.  We still allow users to manually use ${KIPRJMOD} in global table
paths under the assumption that if they are typing this in then they most
likely understand environment variable substitution.

Fixes lp:1830694

https://bugs.launchpad.net/kicad/+bug/1830694

(cherry picked from commit 288982b15d)
2019-06-25 08:46:27 -04:00
Tomasz Włostowski 3bf7ab910f TestSegmentHit: add corner case for null segment (start == end)
Fixes: lp:1833059
* https://bugs.launchpad.net/kicad/+bug/1833059

(cherry picked from commit 6180687bbd)
2019-06-25 08:45:27 -04:00
Seth Hillbrand e8ce0ba6ef pcbnew: Avoid wxassert in message
wxstring::Printf() needs size_t cast to acceptable type or it gives an
assertion in debug mode.
2019-06-24 09:42:06 -07:00
Wayne Stambaugh d8fff5c820 Footprint library nickname comparison fixes.
Footprint library nicknames are case sensitive but the comparison for
the library tree control was case insensitive.

Also make the footprint name comparisons case sensitive as well.  While
not strictly necessary, the plan is to start using the name defined in
the footprint file instead of the file name which will allow for case
sensitivity.

Fixes lp:1833701

https://bugs.launchpad.net/kicad/+bug/1833701
2019-06-24 08:00:21 -04:00
Seth Hillbrand aa9897d932 Fix bug in tesselation
When we hit a self-intersection, we need to be careful that we don't
lose the stop vertex.

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

(cherry picked from commit 6d60b98dc8)
2019-06-23 20:56:29 -07:00
Seth Hillbrand f265a52c96 Enforce build order with qa system
The QA objects link to the direct kiface objects, which creates a second
dependency on the generated lexer files.  To ensure that the primary
apps are finished building them in a (potentially) different thread, we
set a false dependency on the final build product in the qa CMake.

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

(cherry picked from commit 172542cfc4)
2019-06-23 12:53:19 -07:00
Jeff Young f214cfae12 Don't try to show sub-dialog in OnActivate(). High Sierra asserts.
Fixes: lp:1832635
* https://bugs.launchpad.net/kicad/+bug/1832635
2019-06-23 15:39:05 +01:00
Seth Hillbrand febc8cd6aa pcbnew: Ensure save dialog with zones
Fixes: lp:1833748
* https://bugs.launchpad.net/kicad/+bug/1833748
2019-06-22 08:45:00 -07:00
Seth Hillbrand 463e061740 Clear non-copper edge rounding
Non-copper zones do not have a fillet/chamfer option, so we need to
clear it before the zone tool uses the last-used option.

Fixes: lp:1833672
* https://bugs.launchpad.net/kicad/+bug/1833672
2019-06-22 08:25:38 -07:00
Ian McInerney d80759efb8 cvpcb: Implement delete/cut/copy/paste for individual associations
Fixes: lp:1794883
* https://bugs.launchpad.net/kicad/+bug/1794883
2019-06-21 09:58:53 -04:00
Ian McInerney 1d66aad4df cvpcb: Allow the escape key to close the window
Fixes: lp:1830483
* https://bugs.launchpad.net/kicad/+bug/1830483
2019-06-21 09:22:51 -04:00
Seth Hillbrand f5284ced54 Allow null path in 3d model
This allows a setting where the path is not one of the options.  This
permits the user to select once to go to any path option (rather than
off the current and then back to currect) when the filetree doesn't
match the dropdown.  This also selects the drop down item if it matches
the tree.
2019-06-20 20:10:25 -07:00
Ian McInerney c951ca6f47 cvpcb: Added library location to status bar
Fixes: lp:1782805
* https://bugs.launchpad.net/kicad/+bug/1782805
2019-06-20 16:20:15 -04:00
Seth Hillbrand f25ae373bb Fixup previous move commit
The previous commit missed a case where the number was so large that it
overflowed the integer invalidating the comparison.  This protects
against that case by using floating point comparison.
2019-06-20 06:46:41 -07:00
Seth Hillbrand 845833e8fd pcbnew: Enforce maximum movement in Move Exact
This checks the movement against a maximum value that would place the
selection outside of the valid area for the footprint or board.

Fixes: lp:1833478
* https://bugs.launchpad.net/kicad/+bug/1833478
2019-06-20 06:29:53 -07:00
jean-pierre charras f0ac61a8fd Eeschema: minor fix for root sheet plot file name.
Fixes: lp:1833487
https://bugs.launchpad.net/kicad/+bug/1833487
2019-06-20 13:41:04 +02:00
Seth Hillbrand 8f7278e34f Eeschema: Normalize layer ordering between plot and screen
Fixes: lp:1833428
* https://bugs.launchpad.net/kicad/+bug/1833428
2019-06-19 10:49:28 -07:00
Seth Hillbrand b124599de3 Don't skip handled events in GTK
Now that our tool framework handles the hotkeys, we need to skip the
passed handling work-around for actions that are already handled in the
event.

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

(cherry picked from commit b876309999)

Fixes: lp:1819210
* https://bugs.launchpad.net/kicad/+bug/1819210
2019-06-18 22:06:10 -07:00
Seth Hillbrand 697234dd51 eeschema: Insert junctions when repeating
Fixes: lp:1832253
* https://bugs.launchpad.net/kicad/+bug/1832253
2019-06-18 19:38:13 -07:00
Seth Hillbrand ba97494d6f Update toolbar to get new icon/tooltip
After a save-as the footprint belongs to the library, we need to refresh
the toolbar to get the correct icon.

Fixes: lp:1826889
* https://bugs.launchpad.net/kicad/+bug/1826889
2019-06-18 19:24:47 -07:00
Jeff Young 1996fba8a6 Check for a tree selection before checking it against the board item.
Fixes: lp:1833295
* https://bugs.launchpad.net/kicad/+bug/1833295
2019-06-19 00:11:23 +01:00
Wayne Stambaugh a6bbe907ee Set about dialog name for 3D viewer frame.
(cherry picked from commit 2f2c358aef)
2019-06-18 15:32:09 -04:00
Wayne Stambaugh 43579f4c02 Minor library identifier validator change.
Use the wxTextValidator style flag to allow the user to clear the library
identifier string.  Use wxTextValidator::SetStyle( wxFILTER_EMPTY ) to
prevent empty library identifier strings which is the current behavior.

(cherry picked from commit 9f9e87f11f)
2019-06-18 12:16:51 -04:00
Seth Hillbrand 909a25c147 pcbnew: Correct polygon flipping in custom pads
Custom pads are referenced to the anchor pad 0-point, so flipping the
polygon should be about 0 and not the flip point.

Fixes: lp:1831311
* https://bugs.launchpad.net/kicad/+bug/1831311
2019-06-17 15:26:56 -07:00
Wayne Stambaugh aa3aafc4ff Eeschema: fix sheet plotting bug.
Prefix the sheet name with "Sheet: " and the sheet file name with "File: "
when plotting so that it matches the display sheet rendering.

Improve the root sheet plot file name.

Fixes lp:1832081

https://bugs.launchpad.net/kicad/+bug/1832081
(cherry picked from commit 7235da0979)
2019-06-17 17:02:21 -04:00
Seth Hillbrand b32439a694 Plotting: Handle mask transparency
This handles images with transparent colors by mapping the transparent
color to white.  This only works when plotted into the background.
2019-06-17 13:27:58 -07:00
Seth Hillbrand ddbc25077c Eeschema: Plot in same order as drawing
This ensures the junctions are on top and the bitmaps are on bottom
2019-06-17 13:27:11 -07:00
Seth Hillbrand b075886b19 DC printing: Place worksheet behind schematic
And place bitmaps behind other items.  This ensures they are drawn in
the background of the page rather than covering schematic elements.

This also hacks around the buggy wxPostScriptDC implementation that
resets the page to print an image.

Fixes: lp:1819934
* https://bugs.launchpad.net/kicad/+bug/1819934
2019-06-17 13:03:00 -07:00
Wayne Stambaugh eae999a85a Eeschema: allow empty field strings in field table editor.
The grid apply code was always preventing empty fields.  Change this the
broken behavior to allow any field to be empty except the reference and
value fields.

Fixes lp:1832722

https://bugs.launchpad.net/kicad/+bug/1832722
(cherry picked from commit d74ec1a1b2)
2019-06-17 15:06:27 -04:00
Seth Hillbrand 77f0799750 Print bitmaps using BW setting
When selecting the "Print in B&W", all items on the schematic should be
printed using black and white.  This converts the embedded images
greyscale before outputting to the printer
2019-06-17 09:54:52 -07:00
jean-pierre charras 8de93ad8b4 Eeschema: fix incorrect size of junctions on screen.
Fixes: lp:1831931
https://bugs.launchpad.net/kicad/+bug/1831931
2019-06-17 18:08:44 +02:00
Ian McInerney b377b5bbed pcbnew: Fix invalid hotkeys 2019-06-17 08:11:01 -04:00
Seth Hillbrand 75b5324762 Eeschema: Allow junction dots to be hidden
Drawing junction dots at the line width allows users who do not like
them in their schematics to avoid having them drawn.
2019-06-17 04:48:10 -07:00
Wayne Stambaugh 610d200e8a Fix spelling error in symbol library table warning string.
(cherry picked from commit be8fe3884f)
2019-06-16 12:28:56 -04:00
Wayne Stambaugh 8002692f3e CvPcb: fix save changes dialog layout issue.
DIALOG_EXIT was not being laid out correctly after setting the dialog
message.  Rather than fix our custom DIALOG_EXIT, wxMessageDialog and
wxRichMessageDialog were substituted as direct replacements for all
of the variants of DIALOG_EXIT.  This make message dialogs appear more
consistent because wxMessageDialog uses the default platform message
dialog and wxRichMessageDialog uses the default platform rich message
dialog on windows.

Remove DIALOG_EXIT_BASE as it is no longer required.

Fixes lp:1832899

https://bugs.launchpad.net/kicad/+bug/1832899

(cherry picked from commit 3f665318f4ab5c02b7d3c29b5233a273fdac2e4e)
2019-06-16 12:28:35 -04:00
Seth Hillbrand 9496b57b01 tool_mgr: Don't invalidate our own iterators
Re-arranging the stack will invalidate the iterator that is removed and
inserted (begin()).  Because this is not a threaded operation, we can
only do it to ourselves, so check that the operation isn't a NOP before
performing.

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

(cherry picked from commit 552815d486)
2019-06-15 17:49:52 -07:00
jean-pierre charras a5cd5844ec Fix invalid wxImageList build.
Fixes: lp:1832905
https://bugs.launchpad.net/kicad/+bug/1832905
2019-06-15 16:08:07 +02:00
Ian McInerney da16b479a0 Make DXF monochrome output only contain Black layer
Fixes: lp:1832359
* https://bugs.launchpad.net/kicad/+bug/1832359

(cherry picked from commit dc56678289)
2019-06-13 16:10:17 -07:00
Ian McInerney 44f1059000 Allow DXF to be exported in either inches or millimeters
Fixes: lp:1832188
* https://bugs.launchpad.net/kicad/+bug/1832188

(cherry picked from commit d5f680ecd2)
2019-06-13 16:10:12 -07:00
Ian McInerney cf4b41f7d9 pcbnew: Update plot dialog to contain a unit selector for DXF
(cherry picked from commit b2c848579a)
2019-06-13 16:10:03 -07:00
Seth Hillbrand a84ca5b147 cmake: Further petting dependencies
eeschema cpp files consume generated header files that have targets in
the common directory, so no dependencies get created from eeschema.  We
add the dependencies in common to force the setting through libraries.

Fixes: lp:1831643
* https://bugs.launchpad.net/kicad/+bug/1831643
2019-06-13 16:09:45 -07:00
Ian McInerney 71f5f96e64 Remove help from F1 key and move it to an action
Create a new action in pcbnew, gerbview and the footprint viewer/
editor to display the help documentation. Disconnect the wxID_HELP
event from the window so that it no longer conflicts with the zoom
action.

Fixes: lp:1822041
* https://bugs.launchpad.net/kicad/+bug/1822041
2019-06-13 14:11:24 -04:00
Ian McInerney 2aa8e444ee Added hotkey validity checking to the preferences menu 2019-06-13 13:53:04 -04:00
Steven A. Falco cfa187f477 Show the current grid setting. 2019-06-13 12:14:41 -04:00
Wayne Stambaugh 1ed411e431 LibEdit: fix library tree refresh issue when library is removed.
A bug in LIB_MANAGER::LibraryExists() prevented a library removed from
the symbol library table from being removed from the tree view.  Add the
proper check to SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync().

This exposed another issue with synchronization between the library
table editor and the tree view which could lead to orphaned library
modifications and/or a segfault when the currently selected library was
removed from the symbol library table.  Give the user a chance to save
or revert any changes before allowing changes to the symbol library
table.

Fixes lp:1821691

https://bugs.launchpad.net/kicad/+bug/1821691

(cherry picked from commit 028973d182)
2019-06-13 08:59:26 -04:00
Seppe Stas 9233ae97d0 Set KiCad version in MacOS apps
Uses CMake's configure_file function [1] to automaticaly set the
CFBundleShortVersionString [2] value in every app's Info.plist file.

Also updates the CFBundleLongVersionString and CFBundleVersion with the
extended KiCad Version

[1]: https://cmake.org/cmake/help/latest/command/configure_file.html
[2]: https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring

(cherry picked from commit 455ee4c08c)
2019-06-12 14:12:01 -07:00
Seth Hillbrand 0ee38653f7 Fix default User Template location
When we assign a string to the wxFilename, it takes the last section as
the filename (unless there is a trailing '/').  So on Linux, we got
/home/user for the Documents dir and /home/ was the directory while
'user' was the filename.  Appending directories 'kicad/templates' made
the final directory '/home/kicad/templates'.  Forcing this to be a
directory restores correct behavior.
2019-06-11 13:46:10 -07:00
Seth Hillbrand df89b5bf8a eeschema: Don't extend the block when finalizing action
The block draw function is called during the mouse capture callback.  It
shouldn't be called after the block size is finalized.

Fixes: lp:1832289
* https://bugs.launchpad.net/kicad/+bug/1832289
2019-06-11 12:17:25 -07:00
Seth Hillbrand cca4037fec CMake: Another go at linear dependencies
This simplifies the linear dependencies for custom targets.  Should be
single shot for make this time.

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

(cherry picked from commit 720889edd0)
2019-06-10 14:55:01 -07:00
jean-pierre charras e015da8d95 Add a search path to allow find ngspice include dir on some msys2 installs 2019-06-10 20:42:21 +02:00
jean-pierre charras 4ceb186251 Eeschema: fix incorrect saving in prj config on the default netlist format. It was not always saved, and this was not the default, but the last used format. 2019-06-10 20:37:34 +02:00
Seth Hillbrand 370109b868 Eagle: Fix stacked NC pin import
Since Eagle does not connect stacked NC pins but KiCad will if the pins
are coincident, we choose to only import the first of the stacked NC
pins.  While this creates symbols that are slightly different in pin
count from the Eagle version, it keeps the schematic and netlist
functionally correct relative to the Eagle version.

Fixes: lp:1821319
* https://bugs.launchpad.net/kicad/+bug/1821319
2019-06-09 17:02:46 -07:00
Seth Hillbrand 3b3165ad51 pcbnew: Allow DRC violations when marked
We shouldn't consider any obstacles when we are routing in DRC violation
mode.

Fixes: lp:1826723
* https://bugs.launchpad.net/kicad/+bug/1826723
2019-06-09 13:00:13 -07:00
Seth Hillbrand 98e68cd66a Adding MIT license
The tinyspline library is under MIT, so needs to be included in our
license bundle.
2019-06-09 08:38:54 -07:00
jean-pierre charras 407301a28c Fix issue in cairo_gal when drawing a 360 deg arc (in fact a circle). It was due to a angle normalization between -360 and 360 degrees. So, in arcs, if the start angle and end angle diff is n*360 deg, this normalization gives start angle = end angle. The fix forces end angle = start angle+360deg in this case.
Fixes: lp:1832096
https://bugs.launchpad.net/kicad/+bug/1832096
2019-06-09 11:09:43 +02:00
Seth Hillbrand 5ce0e7265b modedit: Clear undo when importing
Importing a footprint is creating a new board.  Undo breaks here as we
don't maintain undo/redo across boards.

Fixes: lp:1832107
* https://bugs.launchpad.net/kicad/+bug/1832107
2019-06-08 13:05:02 -07:00
Seth Hillbrand f1704fd61a bitmap2component: Fix logic for alpha mask
For POTRACE, black is the foreground and white is the background.  We
should keep the convention by requiring the pixin to be less than the
black threshhold as well as the alpha to be at least the alpha
threshhold.

Fixes: lp:1821563
* https://bugs.launchpad.net/kicad/+bug/1821563
2019-06-08 12:03:48 -07:00
Seth Hillbrand 35e87128f5 pcbnew: Ensure cursor remains set during tool activity
Mouse capture end is called by some actions such as save board.  This
resets the cursor image but doesn't change the current tool.  Resetting
the cursor image during action prevents this.
2019-06-08 10:23:38 -07:00
Seth Hillbrand dd93f89931 Import Vector Dialog formatting
This standardizes the import vector graphics file dialog to use the
sbSizer titles instead of bold+lines.  Tooltip changes will be in the
next change as we don't change strings for bugfix releases and this
commit is targeted for 5.1.3

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

(cherry picked from commit f7550940ee)
2019-06-08 09:47:29 -07:00
Seth Hillbrand fb85612f81 eagle: Strip newlines from description
Eeschema old format is line-terminated so the newlines in descriptions
will break the schematic file if saved.

Fixes: lp:1829707
* https://bugs.launchpad.net/kicad/+bug/1829707
2019-06-07 22:08:06 -07:00
Seth Hillbrand 966173c129 pcbnew: Don't reset triangular points for intersection
We prevent the creation of invalid polygons by keeping the converging
lines from intersecting.  This test doesn't make sense for triangular
polygons as they always intersect and we want to allow them to move
outside of the singular point.

Fixes: lp:1831481
* https://bugs.launchpad.net/kicad/+bug/1831481
2019-06-07 21:35:03 -07:00
jean-pierre charras 55757039fa Custom pads: fix a bug when plotting the custom shape. This bug was seen only with some shapes, not all, and only for layers having a negative margin.
Fixes: lp:1831941
https://bugs.launchpad.net/kicad/+bug/
2019-06-07 10:51:43 +02:00
jean-pierre charras 1113e18c40 Fix incorrect initialization of some menuitems IDs.
Although is is currently working, it is a potential issue.
2019-06-06 08:01:24 +02:00
Jon Evans 02947345e8 Mathplot: properly set foreground color when saving screenshots
Fixes: lp:1810914
* https://bugs.launchpad.net/kicad/+bug/1810914

(cherry picked from commit 27a5ed1a9f)
2019-06-05 22:44:18 -04:00
Seth Hillbrand 63f18f0b03 CMake: Handle custom_target indirection
Building custom targets that depend on custom commands such as our
keyword lexer requires two layers of indirection to pick up changes
properly and not overwrite the same file in parallel builds.

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

(cherry picked from commit c6af38477d)
2019-06-05 13:10:00 -07:00
Jeff Young cd6da987cc Make sure the current desc is shown for parts being edited.
Fixes: lp:1820298
* https://bugs.launchpad.net/kicad/+bug/1820298

(cherry picked from commit 7c337ec45d)
2019-06-04 16:30:59 +01:00
Ian McInerney 006d7ddd31 pcbnew: Add context menu for measure tool
Fixes: lp:1831063
* https://bugs.launchpad.net/kicad/+bug/1831063
2019-06-02 07:57:41 -07:00
Ian McInerney 81842fc9d0 eeschema: Make symbol editor cursor track crosshairs with arrow keys
Fixes: lp:1829280
* https://bugs.launchpad.net/kicad/+bug/1829280
2019-05-31 07:47:18 -04:00
Ian McInerney ec9e0b2086 pcbnew: Fix export of edge.cuts layer to STEP format
Fixes: lp:1820841
* https://bugs.launchpad.net/kicad/+bug/1820841

(cherry picked from commit 55261eb223)
2019-05-29 19:43:16 -07:00
Jon Evans 64b71644bb Zoom to fit: only consider worksheet if there are no other items
(cherry picked from commit 04d6ec7de7e7f90482310311fcee416e8ed6410f)
2019-05-29 20:52:07 -04:00
Seth Hillbrand 1e58b09d96 Don't change the board without user action
Grid and ratsnest visibility are stored in the board file and should not
be changed without the user explicitly modifying them.

In the future, we'll move these settings out of the board file but we
shouldn't cause extra file-churn for flipped bits.

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

(cherry picked from commit e7e20b85b5)
2019-05-29 11:28:28 -07:00
Seth Hillbrand 455136ee50 eeschema: end mouse capture before exiting sheet
The mouse capture has a cleanup associated that we call to cancel the
action.  This prevents issues when trying to copy between hierarchical
sheets.

Fixes: lp:1819278
* https://bugs.launchpad.net/kicad/+bug/1819278
2019-05-28 21:19:21 -07:00
Jon Evans 1058ba6a0f PcbNew: ensure Bezier points are updated before plotting
(cherry picked from commit b060880aacfb5e2ff44dea0000733e835d0b8b2a)
2019-05-29 00:07:22 -04:00
Jon Evans f8c541c0d7 PcbNew: fix Bezier curves not having bounding boxes at startup
(cherry picked from commit 40621de3559ee3993d7193a0faee5d0a777be848)
2019-05-29 00:06:55 -04:00
Ian McInerney b485e78030 gal: Decoupled X and Y grid step sizes
Made the X and Y step sizes for the grid separate in the GAL.

Cleaned up the types inside the DrawGrid functions.

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

(cherry picked from commit 45f10fcff1)
2019-05-28 20:37:07 -07:00
Ian McInerney d8e7892081 pcbnew: Fix reload of python plugins in python 3
Update the reload function call to be python3 compatible along with
simplifying the load function to unify the loading of simple and
complex plugins.

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

(cherry picked from commit 59b729c731)
2019-05-28 17:21:00 -07:00
Wayne Stambaugh 1638c3b1c2 Eeschema: fix broken symbol library links after sheet edit.
Refresh the currently edit sheet screen symbol links when the sheet file
name is changed.

This fix was better than the previous fix as it was the same diff between
the master and 5.1 branches.

https://bugs.launchpad.net/kicad/+bug/1830315

Fixes lp:1830315

(cherry picked from commit 89ada624d3d3b28ad5ee1477b353501d46dae3a2)
2019-05-28 17:29:48 -04:00
Wayne Stambaugh 2d0e92d412 Revert "Eeschema: fix broken symbol library links after sheet edit."
This reverts commit f1a43f4977.
2019-05-28 17:07:46 -04:00
Wayne Stambaugh f1a43f4977 Eeschema: fix broken symbol library links after sheet edit.
Refresh the currently edit sheet screen symbol links when the sheet file
name is changed.

https://bugs.launchpad.net/kicad/+bug/1830315

Fixes lp:1830315
2019-05-28 14:49:02 -04:00
Michael Kavanagh 18f7d0129a Stop PNS router settings from being overwritten when switching modes
Fixes: lp:1824967
* https://bugs.launchpad.net/kicad/+bug/1824967

(cherry picked from commit 27d097a78c)
2019-05-27 16:16:55 -07:00
Jon Evans 356ccd0314 Eeschema: improve simulator behavior for two-source DC analysis
Fixes: lp:1830478
* https://bugs.launchpad.net/kicad/+bug/1830478
2019-05-27 18:13:07 -04:00
Jon Evans 4adf89b40b Improve image alpha handling in PDF and PS plotters
Fixes: lp:1825276
* https://bugs.launchpad.net/kicad/+bug/1825276
2019-05-27 12:35:12 -04:00
Jon Evans eb4aded5d6 PcbNew: Fix ordering of fab and courtyard layers
Fixes: lp:1829511
* https://bugs.launchpad.net/kicad/+bug/1829511
2019-05-27 11:54:43 -04:00
Jon Evans 5230f45658 Prevent unbalanced PTH pad labels from being hidden by drills
Fixes: lp:1829067
* https://bugs.launchpad.net/kicad/+bug/1829067
2019-05-27 11:54:43 -04:00
Seth Hillbrand b4e70e56a6 Eagle: Fix crash when importing Eagle V6
This fixes multiple issues when importing Eagle V6 files.

Crashes occured when arcs of 0-length were found and when parts were
referenced in the schematic that were not found in the library.  This
could happen if the library and schematic were different cases.

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

(cherry picked from commit 0e5cc54ec9)
2019-05-26 20:34:05 -07:00
Jon Evans cb3edf2607 PcbNew: Fix layer alpha overrides being overwritten by color changes
Fixes: lp:1827518
* https://bugs.launchpad.net/kicad/+bug/1827518
2019-05-26 20:20:31 -04:00
Jon Evans 720b26d11e Eeschema: fix worksheet and background color for printing
Fixes: lp:1820611
* https://bugs.launchpad.net/kicad/+bug/1820611
2019-05-26 14:25:57 -04:00
Jon Evans e35be13b23 Eeschema: use worksheet color when plotting
Fixes: lp:1825568
* https://bugs.launchpad.net/kicad/+bug/1825568
2019-05-26 12:21:08 -04:00
Jon Evans ba19d93df9 GerbView: Fix selection of the last two grid settings
Fixes: lp:1827642
* https://bugs.launchpad.net/kicad/+bug/1827642
2019-05-25 17:14:35 -04:00
Jon Evans 5d1dcb4387 GerbView: properly load worksheet visibility at startup 2019-05-25 16:58:10 -04:00
Jon Evans f101934909 Report actual intersection position for crossing tracks
Fixes: lp:1825588
* https://bugs.launchpad.net/kicad/+bug/1825588
2019-05-25 15:02:06 -04:00
Jon Evans ede2575018 Exclude invisible items from view bounding box for zoom-to-fit
Fixes: lp:1116457
* https://bugs.launchpad.net/kicad/+bug/1116457
2019-05-25 10:44:15 -04:00
Jon Evans fb80ee5a0e Store items changed by connectivity algorithm in undo list
Fixes: lp:1828442
* https://bugs.launchpad.net/kicad/+bug/1828442
2019-05-24 21:55:49 -04:00
Michael Kavanagh 44fc69398c Fix footprint marked as modified when layer visibility changed
Fixes: lp:1830330
* https://bugs.launchpad.net/kicad/+bug/1830330

(cherry picked from commit 741140e4a4)
2019-05-24 16:17:43 -04:00
Wayne Stambaugh c162337cab Pcbnew: Python scripting support clean up.
Always check the return value of PyRun_SimpleString() for errors when a
Python script is run and show an error message rather than fail silently.

Enable Python interpreter I/O redirection in debug builds so that script
string errors will be shown when PyRun_SimpleString() is called.

Do not call PyErr_Print() after a PyRun_SimpleString() call failure.  It
doesn't do anything useful.

Do not call Py_Finalize() after a PyRun_SimpleString() call failure.  It
seems to cause Pcbnew to crash.

(cherry picked from commit 816f6db310)
2019-05-24 08:01:57 -04:00
John Beard 821faaf3c0 Format: add some formatting aliases, improve dev docs
The aliases are easier than calling check_coding.sh manually,
and we already provide an alias file for the fixes alias, so
do the same for these.

(cherry picked from commit 241127788e)
2019-05-23 21:29:36 +01:00
Ian McInerney bf85eb9b4e pcbnew: Fixed listing of 3D libraries in the github wizard
Fixes: lp:1830137
* https://bugs.launchpad.net/kicad/+bug/1830137

(cherry picked from commit 0daf14f9c3)
2019-05-23 09:51:10 -07:00
Seth Hillbrand 691c6614a8 Plotter: Ensure group style is respected in SVG
Graphics Changed is cleared when setting graphics for a group but needs
to be reset when the group ends.

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

(cherry picked from commit 1a56dfe342)
2019-05-23 09:48:38 -07:00
Wayne Stambaugh 6db7cb8937 Symbol Editor: fix datasheet field bug loading old symbol libraries.
This only applies to the root symbol when the datasheet field is not
empty and the datasheet for root symbol alias in the document file is
empty.  Use the root symbol datasheet field value when adding a new
symbol that meets this criteria.

The root symbol datasheet field gets copied to the root symbol alias
datasheet member variable so if the symbol is modified and saved, the
datasheet information is saved in the .dcm file.

https://bugs.launchpad.net/kicad/+bug/1830078

Fixes lp:1830078

(cherry picked from commit c52ff1ca23)
2019-05-23 09:02:21 -04:00
Wayne Stambaugh 6afc572eae Eeschema: fix datasheet field bug loading old symbol libraries.
This only applies to the root symbol when the datasheet field is not
empty and the datasheet for root symbol alias in the document file is
empty.  Use the root symbol datasheet field value when adding a new
symbol that meets this criteria.

https://bugs.launchpad.net/kicad/+bug/1830083

Fixes lp:1830083

(cherry picked from commit 300f5cb082)
2019-05-23 07:35:10 -04:00
Michael Kavanagh 2a932a2176 Allow setting cursor and aux items colour in footprint editor
Fixes: lp:1829850
* https://bugs.launchpad.net/kicad/+bug/1829850
2019-05-22 15:11:20 -04:00
Seth Hillbrand b2bcde1bfc EAGLE: Correct pcb text orientation
Fixes: lp:1829711
* https://bugs.launchpad.net/kicad/+bug/1829711

(cherry picked from commit 1181b9f9b4)
2019-05-22 10:38:16 -07:00
Seth Hillbrand ec6fd23636 EAGLE: Prevent numeric-only component references
KiCad does not allow references to be numeric only.  This prefixes such
references with "UNK" to note that the reference designator type is
unknown.

(cherry picked from commit a62a89eac3)
2019-05-22 10:38:16 -07:00
Seth Hillbrand 6f34f95c52 Allow squared inflation and inflate Eagle Zones
Sometimes we want to inflate a polygon without adding rounded edges.
This add the option using the jtMiter setting.

This is used in the Eagle parser to expand the Eagle zones for KiCad.
Eagle Zones are drawn on the polygon edge, so they extend out from the
outline.  KiCad zones are drawn inside the polygon.  We need to both
increase the zone size and decrease the minimum pen width to account for
this.

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

(cherry picked from commit 490c805319)
2019-05-22 10:38:16 -07:00
Seth Hillbrand 94e5b36279 pcbnew: Allow adding SHAPE_LINE_CHAIN to zones
(cherry picked from commit bf0a466642)
2019-05-22 10:38:16 -07:00
Seth Hillbrand f0ce4d6336 eagle: Use width on imported lines if available
If not, use the current board design settings for line thickness based
on the board layer.

(cherry picked from commit c80e3e0ffc)
2019-05-22 10:33:24 -07:00
Seth Hillbrand d06b42b917 Eagle: Allow directory creation when importing
The DD_MUST_EXIST flag prevents users from creating a new directory for
their imported eagle project.  This is a UX annoyance.

(cherry picked from commit 9992839c78)
2019-05-22 10:33:09 -07:00
jean-pierre charras 764986a9b0 Fix a compil issue 2019-05-22 18:35:58 +02:00
jean-pierre charras c4efa95b4a * Eeschema: Ensure axis are always drawn in libedit and viewlib
(From master branch)
2019-05-22 17:56:08 +02:00
Wayne Stambaugh 5a655779d7 Eeschema: fix broken cursor after mouse wheel pan.
Fixes lp:1827787

https://bugs.launchpad.net/kicad/+bug/1827787
2019-05-21 14:21:53 -04:00
Wayne Stambaugh 0403437ad0 Eeschema: replace invalid characters when converting from text to label.
Fixes lp:1829664

https://bugs.launchpad.net/kicad/+bug/1829664
2019-05-20 14:49:49 -04:00
jean-pierre charras b62f94f5c2 Pcbnew: release the lock file if a board was loaded, and when clearing the board currently edited. When the board is cleared, the previous loaded board is no longer in edit. 2019-05-20 18:38:03 +02:00
jean-pierre charras daf09ed9fe Pcbnew: fix a (minor) lock file issue: the lock was too early set. If the file was (for some reason) not actually loaded, it was locked. Now, the file is locked only if it is actually loaded. 2019-05-20 18:37:49 +02:00
Seth Hillbrand 72794f1416 eagle: Use the "first" tag instead of pin num
Eagle parsing allows pin 1 to be different from the other pins in the
package but this is set by a tag marking the pin as "first" rather than
the actual number of the pin.

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

(cherry picked from commit dbc40096db)
2019-05-20 06:03:07 -07:00
Jon Evans b00e20b23f GerbView: fix saving of canvas type and lingering legacy menu item
Fixes: lp:1829647
* https://bugs.launchpad.net/kicad/+bug/1829647
2019-05-19 15:28:27 -04:00
John Beard e99a2181ff Correct Slovenian flag
The symbol was wrong (copied from Slovakian flag) and the
blue colour was not the same as the flag on Wikipedia (which
does admittedly seem contentious, but they seem to have reached
some kind of consensus).

(cherry picked from commit de055031a3)
2019-05-17 21:06:32 +01:00
Seth Hillbrand 65b38e8dcf pcbnew: Check for valid data before deleting
We need to check for valid rows and iterators before removing a 3d model

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

(cherry picked from commit f32c95229e)
2019-05-17 09:36:18 -07:00
Wayne Stambaugh 9b8780a2fd Pcbnew: fix bug in Eagle footprint plugin.
Some how a board object was required to fetch the line width when a
footprint is being parsed.  The problem is that there is no board
defined when loading Eagle footprint libraries so there was a nullptr
segfault as a result.  When there is no board defined, use the default
KiCad layer line widths.

Fixes lp:1829243

https://bugs.launchpad.net/kicad/+bug/1829243

(cherry picked from commit 97166a72f5)
2019-05-17 08:40:05 -04:00
jean-pierre charras 9c0e4cae74 Eeschema: fix incorrect position of fields of a hierarchical sheet when rotated
(From master branch)

Fixes: lp:1829048
https://bugs.launchpad.net/kicad/+bug/1829048
2019-05-17 08:36:09 +02:00
Wayne Stambaugh deb387f54c A better fix for commit d34433a1.
Replace INCREMENTAL_TEXT_CTRL with wxSpinCtrlDouble because it looks
and works better.

Remove INCREMENTAL_TEXT_CTRL header and source files because the only
place they were used was in GAL_OPTIONS_PANEL.

(cherry picked from commit f08d040c02)
2019-05-15 18:19:40 -04:00
Seth Hillbrand 5d5422b4c5 Fix default button option on close
The default is meant to be "Save" but "Discard" was selected due to ID
ordering on creation.  Setting the focus before setting the default
makes the "Save" option the highlighted option that can be selected
immediately by pressing enter.

(cherry picked from commit a0f477cc5f)
2019-05-15 14:55:12 -07:00
Seth Hillbrand 85b8dd8b34 plotter: We we trying to export mm but chose in
Note that the comment in line 142 where the scale factor was set had the
correct value to indicate metric (1) but in the actual boilerplate, we
set imperial (0).  This has been around for 6-8 years, so it would seem
DXF is not our most popular export.

Note, I initially tried to use '1' to specify metric units but this was
not handled by DXF readers (QCAM, Inkscape).  Instead, scaling the page
units to inches properly seems to work.

(cherry picked from commit 0eb391b13f)
2019-05-15 14:55:00 -07:00
Wayne Stambaugh b93d34dff4 Fix GAL display options panel spin button layout on windows.
Fixes lp:1829224

https://bugs.launchpad.net/kicad/+bug/1829224

(cherry picked from commit d34433a1df)
2019-05-15 15:01:00 -04:00
jean-pierre charras e997a7db9a Gerbview: Sync issue between the D Code drop list and the active layer
Fixes: lp:1829234
https://bugs.launchpad.net/kicad/+bug/1829234
2019-05-15 16:28:18 +02:00
Wayne Stambaugh d1a065119e Pcbnew: fix crash when deleting DRC errors from DRC dialog.
Fixes lp:1828726

https://bugs.launchpad.net/kicad/+bug/1828726

(cherry picked from commit a32bb4e9a5)
2019-05-14 18:42:03 -04:00
Mario Luzeiro 1dab468e20 Add some epsilon value to ray dir on orthographic mode
so they will not be zero when viewing the board com the top/bot.
This was causing problems with BBox intersect function that was using
invDir values.

Fixes lp:1828747
https://bugs.launchpad.net/kicad/+bug/1828747
2019-05-14 16:10:54 +02:00
Henner Zeller c5cd0c73a3 Raytracing - a more pleasing way sequencing blocks to render.
(cherry picked from commit 2aea26de1e)
2019-05-14 09:28:55 -04:00
Wayne Stambaugh ae139403e4 Fix library table editor dialog environment variable grid column names.
Fixes lp:1825977

https://bugs.launchpad.net/kicad/+bug/1828459
(cherry picked from commit 6f27ef7f66)
2019-05-14 07:59:22 -04:00
Wayne Stambaugh d3c9154f9a Fix frame name capitalization in all about dialogs.
This is a stop gap fix.  It should be possible to use the wxFrame title
string for this but some of the frame windows have appropriated the title
string for configuration file naming purposes which is less than ideal.

Fixes lp:1825977

https://bugs.launchpad.net/kicad/+bug/1825977
(cherry picked from commit 3c4f8c1bf7)
2019-05-13 16:22:52 -04:00
jean-pierre charras caba60968a Python fp wizards: fix a few issues in qrcode_footprint_wizard.py
Fixes: lp:1828744
https://bugs.launchpad.net/kicad/+bug/1828744
2019-05-13 13:26:08 +02:00
Jeff Young 2e0def8670 Defensive coding that will possibly fix a crash when scrolling through footprints.
Fixes: lp:1828289
* https://bugs.launchpad.net/kicad/+bug/1828289

(cherry picked from commit 717b1d37be)
2019-05-11 23:55:08 +01:00
Martin McNamara 8c3d16a395 PCBnew: Fixes crosshair issue with "Place Text" and "Add Dimension".
When using "Place Text" the crosshair was freezing if cancelled before
placing text.

After the crosshair freezes, the next uses of the "Place Text" or
"Add Dimension" caused the crosshair to jump to the screen location
where the previously the crosshair was frozen.

Cancelling the "Add Dimension" caused the crosshair to jump to the
screen location where the crosshair was when cancelled on the next use
of the "Place Text" or "Add Dimension".

Fixes: lp:1822578
* https://bugs.launchpad.net/kicad/+bug/1822578
2019-05-11 06:54:40 -07:00
jean-pierre charras 3f48531da7 DIALOG_EDIT_COMPONENT_IN_LIBRARY: fix a dialog resize issue (grid not resized). 2019-05-11 10:09:32 +02:00
Mark 128cdca068 Fix for SWIG 4.0.0
(cherry picked from commit 5685174808)
2019-05-10 14:38:26 -04:00
Michael Kavanagh bd997a3900 Add Save As hotkey to footprint editor
Fixes: lp:1828481
* https://bugs.launchpad.net/kicad/+bug/1828481

(cherry picked from commit a3483f44d2)
2019-05-10 15:39:33 +01:00
Wayne Stambaugh 8e93eda449 Eeschema: fix corrupted schematic and symbol library files.
Prevent user from pasting text with carriage return and/or line feed
characters in field value edit control in the schematic symbol and symbol
library properties dialogs.

Make all objects derived from GRID_CELL_TEXT_BUTTON use validators
correctly.

Add validators to FIELDS_GRID_TABLE object for field values other than
the mandatory fields.

Create a validator to check that a string is a valid LIB_ID.

Fixes lp:1828214

https://bugs.launchpad.net/kicad/+bug/1828214
(cherry picked from commit ae54f34392)
2019-05-10 09:16:38 -04:00
John Beard a6674ecd56 Pcbnew: remove SVG from menu text
The SVG importer is an advanced config. It's not supported or
normally available in 5.1, so don't advertise in the menu.

If the advanced config is enabled, the dialog will be able
to import SVG.

This could have been "Import *Vector* Graphics" like in master,
5.1 documentation will probably still say "DXF", so keep consistent.

Fixes: lp:1821571
* https://bugs.launchpad.net/kicad/+bug/1821571
2019-05-10 12:41:29 +01:00
jean-pierre charras 654651856f Custom pads: minor fix in legacy mode related to commit a155289f. 2019-05-09 16:46:13 +02:00
jean-pierre charras c489659a20 Custom pads: fix incorrect shape of masks when the shape is a polygon with holes and the mask margin is < 0. This is mainly the solder paste layer that shows this issue. This is due to the fact SHAPE_POLY_SET::Inflate does not work fine with polygons with linked holes. SHAPE_POLY_SET::InflateWithLinkedHoles it added to fix this issue.
Fixes: lp:1828287
https://bugs.launchpad.net/kicad/+bug/1828287
2019-05-09 16:24:39 +02:00
Wayne Stambaugh 18377e0c9f Developer documentation updates.
Remove version 5 road map since version 5 has been released.

Update version 6 road map to reflect current development goals.

Cleaned out old goals from generic road map in preparation for version
7 development.

Add note to compiling document about building with Boost 1.70 on Windows.

Fix link to Linux coding style policy in KiCad Coding Style Guide.

Update tool framework documentation to reflect changes in the tool
framework code.

(cherry picked from commit 3caa4376a5)
2019-05-08 08:39:00 -04:00
jean-pierre charras cebba6c0b9 Cairo GAL: fix incorrect arc position in mirror mode. the previous fix
(c56e540e5d) did not really work.

Fix from master branch.
2019-05-08 14:25:14 +02:00
John Beard 89f9bf545d All: fix horizontal touchpad panning
Commit e10c01aaf didn't work when touchpad panning was enabled.

This commit changes it to only discard horizontal wheel events
when in "scroll mode" rather than "pan mode".

Based on a patch by Adrian Scripcă <benishor@gmail.com>.

Follow-up to fix: lp:1828080
https://bugs.launchpad.net/kicad/+bug/1828080

(cherry picked from commit e6fe220f84)
2019-05-08 11:07:45 +01:00
Adrian Scripca 055d36abd7 All: fix spurious wheel scroll events caused when using modern mice.
Modern mice feature horizontal scrolling capabilities and those end
up being treated by KiCad as regular scroll events causing confusion
among users.

The fix works by discarding the handling of wheel events other than
the ones for the vertical axis.

Fixes: lp:1828080
https://bugs.launchpad.net/kicad/+bug/1828080
(cherry picked from commit e10c01aaff)
2019-05-07 17:36:23 +01:00
John Beard 7bafc5fa8b About dialog: Add mnemonics to the buttons
(cherry picked from commit 4a3add7ac5)
2019-05-07 11:15:13 +01:00
John Beard 6946c0bedb About dialog: update wxFB version
Avoid contaminating wxFB files with version fluff, which hides real
changes in the version history.

(cherry picked from commit cc28fb18fd)
2019-05-07 11:15:13 +01:00
jean-pierre charras bb40f86daa * Eeschema: fix incorrect display of the page number in a complex hierarchy.
When, inside a complex hierarchy, one switch from an instance of a sheet to an other instance of this sheet,
the page number shown in the worksheet was not updated on screen, and the initial number was displayed.

Fix from master branch.
2019-05-07 11:02:05 +02:00
John Beard 89d198659c Format: Default to switch cases on separate lines by default
Currently, the format enforces single lines when possible, but does
not enforce readable column-based alignment (and, moreover, *removes*
such manually added alignment:

    switch( m_orientation )
    {
    case PIN_RIGHT: m_orientation = PIN_UP; break;
    case PIN_UP: m_orientation = PIN_LEFT; break;
    }

Change this to multi-line by default:

    switch( m_orientation )
    {
    case PIN_RIGHT:
        m_orientation = PIN_UP;
        break;
    case PIN_UP:
        m_orientation = PIN_LEFT;
        break;
    }

If the developer wishes for column-aligned single-line cases, this
is permitted, but much be done manually:

    switch( m_orientation )
    {
    case PIN_RIGHT: m_orientation = PIN_DOWN;  break;
    case PIN_UP:    m_orientation = PIN_RIGHT; break;
    }

CHANGE: the _clang-format file to reflect this, and add note about
manual override in the dev docs.

(cherry picked from commit 272c045c37)
2019-05-07 09:50:22 +01:00
jean-pierre charras c56e540e5d Cairo GAL: fix incorrect arc position in mirror mode. It happens in print mode and also when the Pcb view is flipped.
Fixes: lp:1824720
https://bugs.launchpad.net/kicad/+bug/1824720

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

Fixes: lp:1823147
https://bugs.launchpad.net/kicad/+bug/1823147
2019-05-06 11:30:15 +02:00
Seth Hillbrand d3fd74246f Merge remote-tracking branch 'andrei/pr-gitignore'
(cherry picked from commit 4d776034ca)

This also picks up an additional line from 45aa514591 that keeps
CMakeModules/*.cmake.  The rest of that commit does not merge cleanly.
2019-05-02 10:38:40 -07:00
Wayne Stambaugh 616061a6ca Eeschema: fix broken symbol library links.
Force the symbol library links whenever the symbol library table has been
modified.  This will use the cache as a fallback when a library has been
removed that contains links in the schematic rather than display.

Fix the SCH_COMPONENT symbol resolver when falling back to the cache.  The
resolver was using the LIB_ID ':' notation which was failing.  Replacing
':' with '_' fixed this issue.  This was also an issue when generating the
symbol message panel information.

Convert wxLogDebug to wxLogTrace in symbol resolver code path.  Add new
trace type KICAD_SYM_RESOLVE.

Fixes lp:1821606

https://bugs.launchpad.net/kicad/+bug/1821606
(cherry picked from commit 7d803437e2)
2019-05-02 12:13:30 -04:00
Tomasz Włostowski d94b8b9c0e router: copy m_maxClearance when cloning/branching PNS::NODEs
Fixes: lp:1813328
* https://bugs.launchpad.net/kicad/+bug/1813328

(cherry picked from commit 9e00f48efc)
2019-05-01 11:39:15 +01:00
John Beard 89d39cf8ff Pcbnew: use same null check as eeschema for recently used
When Pcbnew's add footprint browser is run up, it constructs
the recently used list without checking for nulls.

Although the DoAddLibrary call does internally check for
null, it's easier to filter these out before placing into
the vector in the first place.

The same logic in the symbol tree is already handled in the
same way.

(cherry picked from commit 42d20cbd96)
2019-04-29 17:00:42 +01:00
jean-pierre charras 0ba130dbd3 Pcbnew: fix in board editor crash when try to load a footprint from Add footprint tool if the latest loaded footprint was deleted. In this case, the history has a cleared link that created the crash when the dialog tried to select this deleted FootprintEnumerate
Fixes: lp:1826794
https://bugs.launchpad.net/kicad/+bug/1826794
2019-04-29 17:23:27 +02:00
John Beard 434935613c Eeschema: Fix/circumvert GTK3 tree view bug
There is a rendering bug in GTK3, which appears to be
an upstream GTK issue.

This can be worked around by, when filtering, ensuring the
*parent* item of the selected item is visible. This will
not cause the selected item to not be visible, as the selected
item will be the first shown child. So it will be visible, as long
as the list box is greater than a single row high, which it will be
in all practical scenarios.

This is done on all platforms, as it has a beneficial side-effect:
the parent library of the selection is naturally shown to the
user, so they don't need to scroll up to see what library their
current filter selection was in.

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

(cherry picked from commit 10900c918f)
2019-04-28 17:18:09 +01:00
John Beard 454585d3d2 GAL: add some trace to GAL display options config
This can be helpful when tracing where certain configurations
come from (some apps load from other apps' config basenames).

(cherry picked from commit fcc4a84e0e)
2019-04-27 14:58:50 +01:00
John Beard 65a6e341ad Eeschema: Symbol preview widget needs common config for Hi-DPI
Currently, this widget doesn't read the common library settings.
This means it doesn't use the configured DPI scaling or anti-aliasing
settings.

Use the ReadConfig method on the GAL options to fix (rather than
only ReadAppConfig).

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

(cherry picked from commit 33fe9a2761)
2019-04-27 14:58:50 +01:00
John Beard fc933034db Eeschema: fix resizing of pin table and edit symbol dialog
These dialogs had logic to avoid a table re-adjustment unless
the width changed. This was done to avoid spurious resizing
calls under GTK+3. This was commit
13249b723b, fixing bug lp:1817810.

However, by only calling event.Skip() when the width changed,
redraws were inhibited when only the height changed.

Placing the Skip() outside the width-change check fixes this,
and does not re-introduce the lp:1817810 bug (it is the column
adjust call that causes that).

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

(cherry picked from commit eccadd92fb)
2019-04-27 14:12:00 +01:00
John Beard 20c8b094d6 SHAPE_ARC: Fix bug introduced in 5813164d1.
This fixes the bug exposed in the previous commit.
The tests which exposed it now pass and expected failures
removed.

(cherry picked from commit d89d0e6b74)
2019-04-25 23:51:01 +01:00
John Beard 552ddfbdfa SHAPE_ARC: Expose bug introduced by 5813164d1 in tests
The angle needs to be added to the start angle.

Add tests to cover this:

* Check end point is correct
* Check midpoints are within tolerance

This would have prevented the bug fixed in 5813164d1,
as well as the bug fixed in this commit.

As well as failed tests, this manifests when routing across
Edge.Cuts arcs (unless they happen to start at 0 degrees
staritng angle).

Expose as expected failure to prove tests catch it.
Fix to follow in separate commit.

(cherry picked from commit 183f4fe9a5)
2019-04-25 23:51:01 +01:00
Tomasz Włostowski 9743eec3ab SHAPE_ARC: fixed polyline conversion bug introduced in e312e2b286
Fixes: lp:1826278
* https://bugs.launchpad.net/kicad/+bug/1826278

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

(cherry picked from commit 5813164d15)
2019-04-25 23:51:01 +01:00
Michael Kavanagh b3ad1dc26e PL editor: fix delete hotkey behaviour
Fixes: lp:1819419
* https://bugs.launchpad.net/kicad/+bug/1819419
2019-04-25 20:27:10 +02:00
Seth Hillbrand b6c9d4a88c Add missing header to qa
(cherry picked from commit 9c00a7a5c3)
2019-04-24 14:33:28 +01:00
Wayne Stambaugh 25b6ac61cb Begin version 5.1.2 development. 2019-04-22 17:16:51 -04:00
Wayne Stambaugh 9c9252e8a3 Tag release version 5.1.2. 2019-04-22 17:14:54 -04:00
John Beard 3a744ad72f Use old-style boost includes
The Boost::boost style library dependencies don't work
on some CMake versions (couldn't find library -lBoost::boost)

Use ${Boost_INCLUDE_DIRS} in the target_include_dirs() instead.

Cherry-picked (with changes) from: 1a9aa2e92d
2019-04-22 01:10:50 +01:00
jean-pierre charras 554e2a4bce qfn_wizard.py fixes. 2019-04-21 14:08:01 +02:00
Jeff Young 6e8979d8d8 Add try/catch block around writing a new library.
Fixes: lp:1825203
* https://bugs.launchpad.net/kicad/+bug/1825203

(cherry picked from commit 2bcf38d2b6)
2019-04-18 22:02:24 +01:00
jean-pierre charras 583d416640 DIALOG_CONFIGURE_PATHS: do not allow users to define the env var KIPRJMOD It always defines the project path, and should never be defined by users.
Fixes: lp:1824912
https://bugs.launchpad.net/kicad/+bug/1824912
2019-04-17 14:55:14 +02:00
jean-pierre charras 03b50b4f85 BOARD_NETLIST_UPDATER: fix 2 serious issues in dry run (memory leak and incorrect single pad nets deletion) Single pad nets deletion in dry run was incorrect when a new footprint was added, because in dry run it is not actually added, and the single pad nets deletion does not see these new pads, and can (incorrectly) delete some nets. 2019-04-17 14:55:13 +02:00
John Beard 440e135e3a QA: Remove expected failure from fixed tests
Commit 55fcbddde8 fixed a couple of
failures in the SHAPE_POLY_SET tests, so these no longer
need the expected failure markers.

(cherry picked from commit 371149756d)
2019-04-17 11:48:11 +01:00
John Beard ab39f06003 SHAPE_ARC: fix polyline conversion when radius=0
Prevent a divide-by-zero bug in SHAPE_ARC::ConvertToPolyline.

When the radius is zero, just use the initial angle (it makes
no different anyway, the result is the centre point, which is
the start point.

(cherry picked from commit e312e2b286)
2019-04-17 11:29:28 +01:00
John Beard 98f78f534c QA: Test arc to polylines - this has a bug
Add unit test of SHAPE_ARC::ConvertToPolyline.

This function has a bug when the arc is of zero radius. This
test shows the bug, but does not fix it yet.

(cherry picked from commit ce84c19a38)
2019-04-17 11:29:28 +01:00
Jon Evans d18b12c1a3 Hide simulator settings tabs that aren't implemented yet
Calling Hide() is apparently not enough in Windows

(cherry picked from commit 895d4c9e1a)
2019-04-15 23:21:31 -04:00
Simon Richter 6a7b1aa39a List Boost as a dependency for kicad2step
This is not technically correct (the Boost dependency is introduced through
libcommon), but less invasive as it doesn't pull in libcommon on the linker
command line.
2019-04-15 23:43:42 +01:00
Seth Hillbrand c4be74a9d0 eeschema: Prevent invalid '0' element in components
In the component, an m_unit/m_convert element is 1-indexed as opposed to
the library where they are 0-indexed.  The 0-index in the library is
reserved for those elements that are shared across all conversion/unit
whereas it is invalid for the component.

Fixes: lp:1824764
* https://bugs.launchpad.net/kicad/+bug/1824764
2019-04-15 12:32:29 -07:00
John Beard 9092048dbc Kicad2Step: handle quoted layers
More recent Kicad_pcb files have quoted layer names (i.e.
strings, not symbols). The importer in K2S doesn't handle that,
so it chokes on elements like (layer "Edge.Cuts").

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

(cherry picked from commit c135158364)
2019-04-15 15:01:57 +01:00
Wayne Stambaugh bb419f1201 Begin version 5.1.2 development. 2019-04-14 15:36:47 -04:00
Wayne Stambaugh d505fd2b60 Tag release version 5.1.1. 2019-04-14 15:32:40 -04:00
Jon Evans a771e0eccb Set new module parent early enough to allow pad clearance to be shown
Fixes: lp:1824587
* https://bugs.launchpad.net/kicad/+bug/1824587
2019-04-14 14:26:15 -04:00
Jon Evans 593a5181d7 Fix rotation of global and hierarchical labels
Fixes: lp:1824432
* https://bugs.launchpad.net/kicad/+bug/1824432
2019-04-13 17:02:33 -04:00
Jon Evans c29274e760 Fix ngspice nested DC sweep command
Fixes: lp:1824336
* https://bugs.launchpad.net/kicad/+bug/1824336
2019-04-13 16:38:31 -04:00
Jon Evans 216573bf48 Fix ngspice netlisting when net names contain '/'
Fixes: lp:1821502
* https://bugs.launchpad.net/kicad/+bug/1821502
2019-04-13 15:35:00 -04:00
Jon Evans 1c235a5c89 Properly initialize sheets when loading them from ERC dialog
When displaying a sheet from this path, it's possible the sheet will
not have been initialized yet.  Call DisplayCurrentSheet() to make sure
it is initialized, and then call RedrawScreen to update the zoom level.

Fixes: lp:1824362
* https://bugs.launchpad.net/kicad/+bug/1824362
2019-04-13 12:25:06 -04:00
Jon Evans f90049dd9e Veto mouse warping from DRC dialog
Fixes: lp:1824630
* https://bugs.launchpad.net/kicad/+bug/1824630

(cherry picked from commit dec5d80180)
2019-04-13 11:30:21 -04:00
Jeff Young 90787e84bf Allow dialogs to veto mouse-warping when called from context menu.
Fixes: lp:1745731
* https://bugs.launchpad.net/kicad/+bug/1745731

(cherry picked from commit adf3637476)
2019-04-13 11:30:09 -04:00
John Beard c36c80a077 Fix GAL option spin button layout
These need to not be wxEXPAND and to be vertically centred
to match the adjacent text controls.

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

(cherry picked from commit 203019d959)
2019-04-12 23:36:56 +01:00
Jon Evans 227333239f Improve selection behavior of DRC markers in DRC dialog list 2019-04-12 12:58:47 -04:00
John Beard 2d43fcf9ee GAL opts: move config reading into GAL_DISPLAY_OPTIONS
Move repeated GAL config reading routines into GAL_DISPLAY_OPTIONS.
THe app-level config is in here already, do the same for the
common config.

This means that the configs are loaded consistently, which fixes
the symbol-chooser preview window, which previously didn't use the
same config routine as other GAL canvases.

Future work could move these functions to free functions that
act on the public interface of GAL_DISPLAY_OPTIONS to avoid
GAL_DISPLAY_OPTIONS having to know about wxConfig and wxWindow.

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

(cherry picked from commit ab2281d26f)
2019-04-12 16:48:50 +01:00
Jeff Young 3edad56e6b Refocus control after doing our little raise/raise dance.
Fixes: lp:1821451
* https://bugs.launchpad.net/kicad/+bug/1821451

(cherry picked from commit 4020b5689b)
2019-04-12 00:30:50 +01:00
John Beard 4e2d900775 Pcbnew: FOOTPRINT_PREVIEW_PANEL passes reference to local
Previously, the GAL_DISPLAY_OPTIONS object in FOOTPRINT_PREVIEW_PANEL::New
was passed by reference in the ctor, down to EDA_DRAW_PANEL_GAL, which stored
it as a reference. The object in New() then goes out of scope, so the
referencing panel outlives the options.

Fix this by making a copy in a std::unique_ptr of the options, and giving
ownership to the panel.

There is another issue here: when the Pcbnew options are copies, the
OBSERVABLE subscriber list is copied too. This means if the panel called
NotifyChanged() on the options, Pcbnew would get updates, even though a copy
of the options changed. However, the panel doesn't change the options or
notify, so it's OK for now.

(cherry picked from commit 17e88d0944)
2019-04-11 17:14:07 +01:00
Jeff Young 4dae82054e Increase GervView layers to 51.
This also makes its use of LSET consistent with PCBNew.

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

(cherry picked from commit b7c12b238f)
2019-04-10 21:23:29 +01:00
Jeff Young cb5948d3a5 When checking for duplicate aliases look in the dialog not the symbol.
Fixes: lp:1821543
* https://bugs.launchpad.net/kicad/+bug/1821543

(cherry picked from commit e90452d0e2)
2019-04-10 21:23:14 +01:00
jean-pierre charras 9fc7281fab Zone filler: fix missing calculation of filled polygons when fill mode is ZFM::SEGMENTS 2019-04-10 18:13:15 +02:00
Seth Hillbrand bb779b237a 3d-viewer: Refresh raytracing on rotate
(cherry picked from commit 89d2e67e45)
2019-04-09 15:18:48 -07:00
Seth Hillbrand 1294b4fec8 3d-viewer: Force canvas refresh before screenshot
In some linux configurations, the canvas refresh must be posted before
being handled.  Simply requesting the refresh can queue the event,
preventing an up to date GL canvas from being saved.

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

(cherry picked from commit 707e7b4b65)
2019-04-09 14:47:54 -07:00
Seth Hillbrand 0b754562f6 pcbnew: Handle missing footprint wizards
When we do not have any footprint wizards to display, we cannot select
the grid rows.

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

(cherry picked from commit 7cf394e34f)
2019-04-09 12:07:08 -07:00
Jeff Young 15cb032ab7 Readjust Edit Symbol Properties when symbol references changes.
The new reference may contain different numbers of units and/or
different deMorgan conversion settings.

Fixes: lp:1822316
* https://bugs.launchpad.net/kicad/+bug/1822316
2019-04-09 17:02:29 +01:00
jean-pierre charras c85d2fd3bf Pcbnew: fix a serious issue in ZONE_FILLER. 2019-04-09 16:34:38 +02:00
Wayne Stambaugh bc821ff47d Eeschema: fix schematic text object plotting issue.
Save and restore text thickness in SCH_TEXT::Plot() function to prevent
the plotting default thickness value from stepping on the original text
thickness and causing all of the text objects to magically change to bold.

Fixes lp:1823165

https://bugs.launchpad.net/kicad/+bug/1823165
(cherry picked from commit 3d33cba574)
2019-04-09 10:18:08 -04:00
Jeff Young 42d9f42807 Allow no-connects to be dragged.
Fixes: lp:1821342
* https://bugs.launchpad.net/kicad/+bug/1821342

(cherry picked from commit c78c3c8198)
2019-04-09 11:20:03 +01:00
Jeff Young 7ceff4cf5d Trim zone fills to board outline.
Fixes: lp:1820306
* https://bugs.launchpad.net/kicad/+bug/1820306

(cherry picked from commit 52e3a1d7c4)
2019-04-09 11:20:03 +01:00
Jeff Young 4147da312b Adjust justified text for rotation.
Fixes: lp:1823090
* https://bugs.launchpad.net/kicad/+bug/1823090

(cherry picked from commit a81512ca96)
2019-04-09 00:36:17 +01:00
Jeff Young 439891c31f Adjust left- or right-justified text for mirroring.
(cherry picked from commit 97063440bb)
2019-04-09 00:36:06 +01:00
John Beard 322524101d Libeval: consistent formatting for NaN
On some platforms like MSVC, NaN prints as "-nan(ind)". This
is a bit needlessly ugly, so print "NaN" on all platforms
consistently.

This fixes a test failure on MSVC.

(cherry picked from commit dd17f24c04)
2019-04-08 16:29:24 +01:00
John Beard fd698653d9 QA: numeric evaluator: add a context to tests
This allows a failing test to report which case failed more clearly.

Add a quick helper to make an "in -> out" context string.

(cherry picked from commit 3f32dc9a64)
2019-04-08 15:58:59 +01:00
John Beard 8b503a06fa 3D viewer: update icons from common settings
Use the icon scaling logic and call a toolbar rebuild when the
common settings change (echos the handling in Pcbnew and friends).

Remove an unused function.

(cherry picked from commit 8548e69382)
2019-04-08 14:30:26 +01:00
John Beard 4a201df556 3D viewer: use hi-DPI settings for canvases
The 3D viewer also uses OpenGL, so it also needs to
adjust based on DPI scale factors.

This patch moves the 3D viewer common config code solely
within the 3D viewer, and adds handling of the DPI scale. This
also avoids duplicated logic in PCB_BASE_FRAME::CommonSettingsChanged.

For now, as EDA_3D_VIEWER is not included in the Kiway settings
dispatch, still manually invoke the settings update from
PCB_BASE_FRAME.

The PANEL_3D_PREV gets a similar function to read the config, but
it doesn't have a listener for the update, so it's set just once
at dialog init, just like the existing pan settings.

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

(cherry picked from commit 124dd5e59a)
2019-04-08 14:30:26 +01:00
Seth Hillbrand 577b9f478b pcbnew: Show clearance when editing tracks
When requested by display options, we should show the track clearance
when dragging tracks.

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

(cherry picked from commit cf63ae7ae2)
2019-04-07 21:26:06 -07:00
Seth Hillbrand f5a2eb1ab0 pcbnew: Allow click+drag of tracks
This behavior existed in 5.0.x but did not properly exit the edit tool
in 5.1.  This removes stops the edit tool when we begin dragging a track
using the interactive router.

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

(cherry picked from commit c8118e3ce4)
2019-04-07 20:59:38 -07:00
Michael Kavanagh 4379480d4b Change "Switch track width to previous" default hotkey from Ctrl+W to Shift+W
Tiny improvement in consistency.

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

(cherry picked from commit 27e6f5b9e8)
2019-04-07 10:52:15 -07:00
Seth Hillbrand dfa4afa826 pcbnew: Freeze the netclasses dialog on init
Prevents the size events from firing on Mac when we set up the netclass
panel

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

(cherry picked from commit a300ae105d)
2019-04-07 07:08:35 -07:00
Wayne Stambaugh a533514763 Minor symbol library rescue dialog fixes.
Adjust the sizer proportions slightly to eliminate the reported bug.
This may not be the ideal way to do this and there could be some issues
on other platforms but it does resolve the issue on gtk3.

Fixes lp:1820084

https://bugs.launchpad.net/kicad/+bug/1820084

(cherry picked from commit 615c49315f)
2019-04-06 08:19:06 -04:00
Wayne Stambaugh 952aaef52a Minor drill file dialog improvements.
(cherry picked from commit b6a0bf1142)
2019-04-05 16:49:51 -04:00
Wayne Stambaugh a54016a6f7 Minor footprint position dialog improvements.
(cherry picked from commit dfee7bddd3)
2019-04-05 16:17:00 -04:00
Michael Kavanagh 0c8a95c44b Invert maximum and minimum endpoints on color picker sliders
Put the maximum values at the "top" of the sliders.

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

(cherry picked from commit 1ccef6dc80)
2019-04-05 14:38:48 +01:00
John Beard 403633d21f Regenerate DIALOG_COLOR_PICKER_BASE wxFB files
This avoids the wxFB automatic changes hiding substantive changes
to be made in later commits.

(cherry picked from commit 0f39d4907f)
2019-04-05 14:38:48 +01:00
jean-pierre charras cc6f1d784d DIALOG_COPPER_ZONE: fix bug that prevent to convert a zone filled by segments to a zone filled by solid polygons 2019-04-05 10:21:16 +02:00
Wayne Stambaugh e07ef3be9c Minor schematic formatter fix.
Apparently at some point in KiCad's development, a '~' character was
prefixed to the symbol name to indicate that it was not visible.  The
visibility state is now saved in the name field so remove the prefix.
The parser was kept unchanged.

Fixes lp:1632048

https://bugs.launchpad.net/kicad/+bug/1632048

(cherry picked from commit ee14da3093)
2019-04-04 10:50:23 -04:00
jean-pierre charras f35f534ff4 DIALOG_PAD_PROPERTIES: Fix incorrect calculation of Round Rect Radius Ratio, when inches are selected.
Fix from master branch.
2019-04-04 15:56:06 +02:00
Jeff Young 3899ec136b Use a bigger hammer when refreshing fields in table.
Fixes: lp:1823050
* https://bugs.launchpad.net/kicad/+bug/1823050
2019-04-04 12:27:29 +01:00
Seth Hillbrand 91ee809558 pcbnew: Prevent aux axis after-image
Grid helper in the router tool is persistent, so remember to turn off
the aux axes after setting.

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

(cherry picked from commit 428e7a900b)
2019-04-03 16:27:37 -07:00
jean-pierre charras 4c94e2729f geometry/geometry_utils.cpp: Fix a minimal value (6) to calculate the segments by circle count to approximate a circle.
Use also this minimal value to calculate  the circle to poly correction factor
Also, remove a useless code.

(cherry picked from commit 0d2dd48cad)
2019-04-03 16:25:52 -07:00
Seth Hillbrand 2a5a207148 pcbnew: Update points before refresh
When removing a point from the polygon, the vertex is removed before it
is tested for validity.  If it fails validation, the edit is reverted
and the point count doesn't change, so the view update only modifies the
existing points.  But the revert may also have changed the shared
pointer to the point array, invalidating the view's copy.

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

(cherry picked from commit 940aef77af)
2019-04-03 16:13:20 -07:00
Seth Hillbrand c75bd89d63 GAL: Deal with thick circles
Both Cairo and OpenGL had issues (different, though) with circles that are
thicker in line width than they have radius.  This corrects the OpenGL
implementation (radius is calculated to the outer edge) as well as Cairo
(line width needs to be clamped to twice the radius)

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

(cherry picked from commit db0523626c)
2019-04-03 16:03:49 -07:00
Seth Hillbrand f58844bf8b pcbnew: Allow Missing legacy option
LEGACY is disabled for GTK3, so we may not find the menu item

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

(cherry picked from commit ce254d1061)
2019-04-03 16:03:21 -07:00
Wayne Stambaugh 07ac3499f3 Remove debugging code added in commit d2cb0ca7.
(cherry picked from commit 75366bce74)
2019-04-03 12:20:37 -04:00
Wayne Stambaugh 050b64b822 Pcbnew: fix DXF import line width bug.
There is a circular dependency between the GRAPHICS_IMPORTER object and
the GRAPHICS_IMPORT_PLUGIN object which makes sharing the settings in
the GRAPHICS_IMPORTER unwieldy.  This fix is a ugly hack that resolves
the issue.  The underlying issue will require some major refactoring.

Fixes lp:1821234

https://bugs.launchpad.net/kicad/+bug/1821234

(cherry picked from commit 120ab06db4)
2019-04-03 11:32:30 -04:00
Wayne Stambaugh 43aa94dcfc Pcbnew: fix import graphics dialog issues.
Improve padding, spacing and alignment of dialog layout.

Fix title capitalization.

Make file dialog wildcard string translatable.

Remove fixed initial dialog size to allow sizers to work their magic.

Replace OK button event handler with TransferDataFromWindow.

Remember last line width units between dialog instances and sessions.

Save configuration file settings in a separate group and remove GfxImport
prefix from the entry names.

Add fencing to dialog header file to prevent nested includes.

Fixes lp:1822568

https://bugs.launchpad.net/kicad/+bug/1822568

(cherry picked from commit d2cb0ca75f)
2019-04-03 11:32:09 -04:00
John Beard b2e54a432b QA: Use own unit test headers for eagle test
These include the appropriate "polyfills" for things like
Boost versions.

(cherry picked from commit 20d36c18350fcccb1bee835553a68da8a0c96b0b)
2019-04-02 23:31:33 +01:00
John Beard e766732020 QA: Eagle test: look up test data in the source tree
Also provide a utility function to get this path, and
a way to override at run time to quickly sub in alternative
data.

The test itself is still broken, as this plugin won't accept
a call to Load() without a KiWay.

(cherry picked from commit 88faac309f)
2019-04-02 19:08:26 +01:00
John Beard 3a5e01c44a QA: Enable eeschema tests
Redesignate the eagle test as eeschema tests and build
more like the other unit tests.

Enable as a test in Ctest now that the test executes without
crashing.

The loading of the file with the hardocded part is still
not enabled, as this needs more infrastructure to support it.

(cherry picked from commit 4eb30f6b85)
2019-04-02 19:08:26 +01:00
John Beard d4883da98b Eeschema: construct simulator cursors on demand
Statically constructing wxCursors as used for the probe
and tune cursors crashes the qa_eagle_plugin test
instantly.

Fix this by introducing a new class CURSOR_STORE,
which allows to abstract the platform wierdness of wxCursors
and allow the simulator to laziliy init its own cursors
at runtime.

This code isn't properly tested, as these cursors are never
actually used. However, it does allow the eeschema unit test
to run.

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

(cherry picked from commit 6f1c3f5ef8)
2019-04-02 19:08:26 +01:00
Michael Kavanagh 7cc3e9a16d Add Ctrl+, hotkey to preferences dialog
Also change interactive router settings from Ctrl+, to Ctrl+Shift+,

(cherry picked from commit b0674b8802)
2019-04-02 13:17:37 -04:00
Michael Kavanagh 9ad352d4bd Fix 'hokey' -> 'hotkey' typo
(cherry picked from commit fe6bc411dd)
2019-04-02 13:17:18 -04:00
Seth Hillbrand 031173bc47 pcbnew: Handle old stable translated layers
This inserts a translation map in the layer names so that the old stable
files with Italian/French layer names get updated to the standard
English layer names (instead of not opening).

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

(cherry picked from commit 6f4d1345f3)
2019-04-01 14:25:27 -07:00
Seth Hillbrand 658820a25e pcbnew: Ensure DRC circles have at least 4 points
This prevents invalid outline errors for small circles.

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

(cherry picked from commit 5eb2a33498)
2019-04-01 14:25:27 -07:00
Wayne Stambaugh 17fdce01a9 GerbView: remember last open gerber file dialog wildcard.
This is only for the current GerbView session.  When GerbView is closed,
the last open gerber file dialog wildcard setting is lost.

(cherry picked from commit f20a1314ff)
2019-04-01 12:47:45 -04:00
Jeff Young bc4cc00332 Update description when tree item is in editor.
Fixes: lp:1820298
* https://bugs.launchpad.net/kicad/+bug/1820298
2019-04-01 13:47:40 +01:00
Jeff Young b57e9492b1 Disable alias controls when no alias is selected.
Fixes: lp:1821698
* https://bugs.launchpad.net/kicad/+bug/1821698
2019-04-01 13:47:31 +01:00
Jeff Young 712bdc9d8d Set initial focus to track width / via size.
Fixes: lp:1822177
* https://bugs.launchpad.net/kicad/+bug/1822177
2019-04-01 13:47:22 +01:00
Jeff Young 33a7c95455 Remove angle brackets from indeterminate string.
They don't really help any, and they confuse some users into
thinking they need angle brackets around real values.

Fixes: lp:1821601
* https://bugs.launchpad.net/kicad/+bug/1821601
2019-04-01 13:47:13 +01:00
Jeff Young f054dcc77d Allow save after importing footprint.
Fixes: lp:1819777
* https://bugs.launchpad.net/kicad/+bug/1819777
2019-04-01 13:47:02 +01:00
Jeff Young 95858b77c1 Ignore BRIGHTENED state when printing.
Fixes: lp:1788480
* https://bugs.launchpad.net/kicad/+bug/1788480
2019-04-01 13:46:46 +01:00
Jeff Young 4afbce5ad6 Fixes for importing board setup properties.
Save/restore default netclass.
Read layers back in with correct syntax ('.' between keyword and layer name).
Write layers to project file.
Read/write layer enablement bits.
Don't set solder paste margin min to 0 (most of them are negative).

Fixes: lp:1811990
* https://bugs.launchpad.net/kicad/+bug/1811990
2019-04-01 13:46:33 +01:00
Wayne Stambaugh 93956002ac Tag version 5.1.0-dev. 2019-04-01 13:32:55 +01:00
Wayne Stambaugh 006dd290e9 Revert "appdata.xml: Remove additional license metadata"
This reverts commit 8a7e501fe6.
2019-03-31 14:35:26 -04:00
Michael Kavanagh fb875145aa Read Footprint Library Browser grid settings from Footprint Editor.
Implements commit 3a0dbf48c8 for Footprint Library Browser/Editor.

Fixes: lp:1822401
https://bugs.launchpad.net/kicad/+bug/1822401
(cherry picked from commit a611269975)
2019-03-31 07:07:52 -07:00
jean-pierre charras 77993ced7e Symbol editor, DIALOG_LIB_EDIT_PIN_TABLE: fix crash when trying to delete a pin when the table is empty.
Fixes: lp:1822406
https://bugs.launchpad.net/kicad/+bug/1822406
2019-03-30 09:32:32 +01:00
jean-pierre charras e1f64d6283 Kicad and Gerbview: add .nc and .xnc file ext to files seen as drill files. .nc is an other usual Excellon drill file ext, and .xnc will be soon also in use. 2019-03-30 09:32:32 +01:00
John Beard 2b60ce484e Formatting: prefer a Git config variable to env var
The keeps all the formatting config together in the Git ecosystem
and keeps the config on a per-repo basis, unless the user explicitly
sets it --global.

Keep the old env var behaviour for now for backwards compatibility.

(cherry picked from commit a7270f8c1c)
2019-03-29 15:12:36 +00:00
John Beard a21b336138 Formatting: exclude generated files from git formatting hook
Add a .gitattributes files to provide a place to store file
attributes. Add a custom attribute for files that should be under
KiCad style guidelines.

Exclude generated files from the style enforcement. So far:

* bitmap .cpp files
* wxFormBuilder base classes
* Lemon grammars

It's now trivial to add the 'generated' attribute to any such
file.

Putting this into .gitattributes also means it can be retreived
programmatically, by other scripts, git alaises or on the command
line.

Use the attributes to provide a utility script to show or apply
formatting to controlled files (plain git clang-format won't
pick up our custom git attributes). Add details for the script in
the dev docs.

Also modiify the check-format hook to follow the .gitattributes
and only apply to cached (staged for commit) changes. Then you
won't be stopped committing because of bad formatting in unstaged
changed, or uncontrolled files.

Concept and some aspects of the implementation inspired by
CMake commit d5f39a56 [1].

[1]: https://gitlab.kitware.com/cmake/cmake/commit/d5f39a56a44fe061018c6acc15e1c3aa7337ff54

tool

(cherry picked from commit a69cdf1793)
2019-03-29 15:12:36 +00:00
John Beard 0655280f2c QA: nullptr_t -> std::nullptr_t
This fixes a build failure on some systems.

(cherry picked from commit 49d75e2383)
2019-03-29 12:49:16 +00:00
John Beard 2793578dcb QA: Allow BOOST_CHECKing of nullptr_t
Before Boost 1.64, there was no test logging function
for std::nullptr_t.

Add a logging struct to Boost to deal with this, and some
macros to assist in similar cases. These macros are bit
untidy-looking, but due to GCC bug #56480, we can't use
namespace aliasing to solve this. From Boost 1.64 onwards,
these namespaces are not needed at all.

Remove some code added to work around lack of nullptr printing
in the past.

These macros, and the nullptr printer, can be removed when
the Boost min version is 1.64 or greater.

(cherry picked from commit ad76ebd82a)
2019-03-29 10:11:19 +00:00
Wayne Stambaugh f1a70662c5 Eeschema: do not merge graphical lines with different attributes.
Fixes lp:1821728

https://bugs.launchpad.net/kicad/+bug/1821728

(cherry picked from commit 2447933b54)
2019-03-28 13:47:58 -04:00
Carsten Schoenert 8a7e501fe6 appdata.xml: Remove additional license metadata
The extra field metadata is not really needed nor helpful as various
other additional licenses are used within the KiCad project.
All used licenses are documented with the file LICENSE.README within top
root folder of the source.

(cherry picked from commit e5de787f88)
2019-03-27 14:50:23 -04:00
Carsten Schoenert 86fc2dc2ba Adding license text for CC-BY-SA-4.0 for completeness
As for the other used licenses adding also the license content for the
CC-BY-SA-4.0 license.

(cherry picked from commit 54aed9b17e)
2019-03-27 14:50:05 -04:00
Carsten Schoenert 9cff42b4ed Adding license information for demo files
The demo files are covered by the CC-BY-SA-4.0 license.
Please note some discussion about this on the developers mailing list:

https://lists.launchpad.net/kicad-developers/msg39174.html
(cherry picked from commit 444050c7d5)
2019-03-27 14:49:44 -04:00
John Beard 55546126a1 Clang-format: break after templates
Enforce the following format:

template<>
void function<TYPE>()

Rather than:

template<> void function<TYPE>()

This is the more common format in KiCad (about 8:1) and agrees
with the uncrustify.cfg rules.

(cherry picked from commit 3536840f52)
2019-03-27 14:38:52 +00:00
John Beard 5a11dacd9e Pcbnew: Improve tab traversal in text properties dialog
Tab through the grid vertically, then horizontally, as the fields
are laid out with "related" fields (like the co-ords) vertically.

Also neaten headers.

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

(cherry picked from commit d6b8e9e037)
2019-03-27 14:06:16 +00:00
John Beard bb5873bf20 Pcbnew: Align right margins in text properties dialog
(cherry picked from commit b7017167f0)
2019-03-27 14:06:16 +00:00
John Beard 20eda54349 Pcbnew: update text properties dialog wxFB version
No actual changes, but this keeps the diffs clean(er).

(cherry picked from commit dd3252445d)
2019-03-27 14:06:16 +00:00
Michael Kavanagh c98461f59e Open drill file in gerbview from KiCad manager tree
Fixes lp:1819754
https://bugs.launchpad.net/kicad/+bug/1819754

(cherry picked from commit b681e4a68e)
2019-03-27 09:13:23 -04:00
jean-pierre charras b154c9a5c4 Eeschema: Force time stamp to 32 bits unsigned values, and make it
tolerant to files using 64 bits values. define timestamp_t as uint32_t.

This fix is adapted from master, commit 175a2bc0b (bug fix lp:1821476)
2019-03-27 13:17:54 +01:00
jean-pierre charras 12255e3680 Eeschema: fix incorrect handling of Escape key. Key events do not have to be skipped after they are handled. 2019-03-27 13:17:54 +01:00
John Beard 473c41ddbf Eeschema: internal tidying of field editor ApplyData
Make a few things const (specficially the reference into
m_fieldStore - we should commit to not modifying that in this
function.

Also avoid a couple of needless string copies.

Also explicitly dereference the into a (non-const) reference at the outset.
For the whole if this function, comp is the same object and may not
be null (as it is used unchecked).

(cherry picked from commit edd94ce2d6)
2019-03-27 10:29:36 +00:00
Baranovskiy Konstantin b93382831c Eeschema: place new field near parent component
For now fields created in Fields Editor are placed at
position (0, 0).
Every new field must be placed at the origin of
the parent component.

(cherry picked from commit 11f03c8551)
2019-03-27 10:29:36 +00:00
Michael Kavanagh 5ee61f5ae7 Fix mnemonic typo in pcbnew menubar
(cherry picked from commit bbcea3c98d)
2019-03-26 19:19:11 -04:00
Seth Hillbrand 082bbd49e7 sim: Prevent stepping
Introduced by 416e64a334.  The code
appears to have been stepped on purpose but this would be incorrect for
most applications.  There remains a good deal of cleanup in mathplot
available for the motivated dev.

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

(cherry picked from commit c1c4a0925d)
2019-03-26 14:59:18 -07:00
John Beard 4e2e69c9cb Fix MSYS2 build breakage
wxPlatformInfo::Get() causes a linker error on Msys2.

Fix this by making common link wx explicitly, rather
than implicity via it's dependencies, which cause
wrong-order linker command lines on windows.

(cherry picked from commit aef369f4af)
2019-03-26 10:53:31 +00:00
John Beard 6f78bb6960 Add configuration of Hi-DPI canvas scaling in OpenGL
First, add automatic detection of toolkit DPI scaling options. For now, this
is, in order,

* Check the GDK_SCALE option under GTK+ (users can set this to force the scaling)
* Check the value from WX's GetContentScalingFactor(). This will start to work
  correctly from WX 3.1 and GTK+ 3.10.

Then, add a user-settable override in the main prefs panel, next to the icon
scaling. This is independent of the icon scaling options.

DPI handling is performed in a standalone class, so they can be shared between
the prefs UI and the OpenGL backend easily. Also means Cairo could use the same
interface in future.

Also adjust the OpenGL grid drawing code to use the computed scale factor,
which avoids over-thick grids in scaled environments (the user can manually
thicken the grid if wanted).

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

Cherry-pick of: 567bdd9b9 (master)
2019-03-25 15:16:18 +00:00
jean-pierre charras a00caac789 Gerbview: fix crash when reading a .gbrjob, and when a file given by the .gbrjob is not found. A incorrect gerber image was created, creating crash on exit or when enable the layer view. 2019-03-24 17:40:16 +01:00
Brian Henning 4e8f191f43 Added an include to tell the compiler where to find wxIsdigit 2019-03-24 15:38:59 +01:00
jean-pierre charras b1c5afd72f Drc dialog: make track to copper zones test optional, because it can be really very time consuming 2019-03-24 15:38:59 +01:00
jean-pierre charras aa5a2225e7 Fix incorrect detection of filled zones changes in DRC check.
Commit 6006703798 fixed a crash but broke the filled zones changes detection.
Filled zones were always seen as not up to date due to the fact the filled areas were cleared too early.

The up to date detection is also optimized: the old filled polygons are no longer stored.
Instead of, the MD5_HASH is calculated and stored before clearing the filled polygons.
2019-03-24 15:38:59 +01:00
jean-pierre charras 4c7672b581 Cvpcb: cosmetic enhancement in toolbar: add a text. 2019-03-24 15:38:59 +01:00
Jon Evans 5f9fa05e21 Fix loading of components with convert parameter set to zero
(cherry picked from commit ab74445df4)
2019-03-23 18:58:17 -04:00
Wayne Stambaugh ee92fa51bc Symbol editor: improve tooltip in symbol properties dialog.
Make the "Define as power symbol" checkbox tooltip more descriptive so
the user has a better understanding of enabling this option.

Fixes lp:1804932

https://bugs.launchpad.net/kicad/+bug/1804932

(cherry picked from commit a7c8df5666)
2019-03-20 15:58:11 -04:00
Simon Richter 63b3960120 Update/regenerate pcb_calculator_frame_base.fbp
(cherry picked from commit 4896daaae5)
2019-03-19 15:21:38 -04:00
Simon Richter e5c76ddf3e Fix line endings in pcb_calculator_frame_base.fbp
No text changes

(cherry picked from commit e286ca170d)
2019-03-19 15:21:19 -04:00
Simon Richter 4b07979008 Add a few dielectric values
- Isola FR408
   https://www.isola-group.com/wp-content/uploads/data-sheets/fr408.pdf
 - Isola 370HR
   https://www.isola-group.com/wp-content/uploads/data-sheets/370hr.pdf
 - Rogers RO4003C
   https://www.rogerscorp.com/documents/726/acm/RO4000-Laminates---Data-sheet.pdf
 - Rogers RO4350B
   (as above)

(cherry picked from commit 432e12effd)
2019-03-19 10:38:43 -04:00
Seth Hillbrand 168fa09f5f Unify and correct Autosave functions
Autosave was not working correctly, partly due to different
implementations in eeschema and pcbnew and partly due to a mistaken
refactor at some point during v5 development.  This unifies the expected
autosave prefix to _autosave- for both pcbnew and eeschema.  It also
unifies the expected suffix for the backup files to -bak.

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

(cherry picked from commit 078320e2fb)
2019-03-18 10:27:09 -07:00
Seth Hillbrand 4facd57cb7 libedit: Don't move the field below the last item
There needs to be at least one item below the one we want to move down
in order to allow the action.

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

(cherry picked from commit 0943c176a3)
2019-03-18 10:27:09 -07:00
Wayne Stambaugh e999636048 Symbol editor: fix superfluous dialog display.
Call base object TransferDataFromWindow() to prevent Validate() from
being called twice.  Validation is handled completely under the hood
so there is no need to call Validate() directly.

Fixes lp:1820301

https://bugs.launchpad.net/kicad/+bug/1820301
2019-03-18 11:46:03 -04:00
Seth Hillbrand 5bd769ea40 Remove global library from pspice simulation 2019-03-17 20:56:24 +01:00
jean-pierre charras bd693f97a1 Print on Linux: use 600 DPI instead of the default 72 DPI (noticeable in Pcbnew) 2019-03-17 20:52:42 +01:00
jean-pierre charras af0cb68c1b Eeschema: do not draw dangling symbol (circle) for PIN_NC pin types. These pins are never connected, so a dangling symbol makes no sense.
Fix also a fex minor coding style issues.
2019-03-17 20:52:42 +01:00
jean-pierre charras 761d7fd438 Demo pic_programmer: remove unused schematic library from list. 2019-03-17 08:52:00 +01:00
jean-pierre charras c537e8a892 Eeschema: shows the opened sheet info in title bar.
Fixes: lp:1819564
https://bugs.launchpad.net/kicad/+bug/1819564
2019-03-17 08:52:00 +01:00
jean-pierre charras 702e85cd96 Pcbnew: disable commit 3692c511 on non Windows platforms A zone refill display progress bar is shown when deselecting the zone after geometry changes. However, on Linux, there are some artifact between the progress bar refresh and the board view refresh: the filled areas are incorrectly shown: the insulated islands remain displayed, although they are removed from the actual filled areas list So it is disabled until a fix is found. 2019-03-17 08:52:00 +01:00
Wayne Stambaugh c93e0b6c5e Minor board editor menu fixes.
Correct menu string capitalization.

Remove duplicate mnemonic characters.

Fixes lp:1818906

https://bugs.launchpad.net/kicad/+bug/1818906
2019-03-16 10:37:35 -04:00
Wayne Stambaugh f7b4a20066 Replace isdigit() with wxIsdigit() when testing wxString characters.
This is a continuation of commit 8a03025a.  All known instances of
using isdigit() to test a character in a wxString have been replaced
by wxIsdigit().
2019-03-15 15:54:49 -04:00
Seth Hillbrand 49ac89bfed pcbnew: Don't refresh S_CURVE in bbox()
The bounding box calculation needs to be fast and is threaded in many
places in pcbnew.  We cannot invalidate items (the function is const but
this wasn't caught at compile-time for some reason) when getting the
bbox. This shouldn't be an issue as the m_BezierPoints is rebuilt each
time the curve is updated, so rebuilding during the bbox seems extra.

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

(cherry picked from commit ec24981cc8)
2019-03-14 05:49:30 -07:00
jean-pierre charras 16e62b29f9 Zone fill: display progress bar when refilling a zone after edition.
Previously, refilling a zone after edition was made silently,
thus creating not understandable but very noticeable freeze time for complex zones.

(cherry picked from commit 3692c511d0)
2019-03-14 05:49:30 -07:00
jean-pierre charras b8180b0459 PROF_COUNTER: add a helper method.
(cherry picked from commit 3fc681c1b7)
2019-03-14 05:49:30 -07:00
Seth Hillbrand 37f250b384 pcbnew: Remove fills prior to updates
Removing existing fills will prevent re-drawing invalid polygons before
they are ready.  This seems to happen on Macs more easily due to redraw
timing.

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

(cherry picked from commit 6006703798)
2019-03-11 16:29:02 -07:00
Seth Hillbrand 5685ec525b GAL: Handle negative line widths
When displaying negative line width elements, the outline of the item
should be hidden rather than displayed.

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

(cherry picked from commit c61ec8ee3b)
2019-03-11 12:38:26 -07:00
Seth Hillbrand 5be59ea8dd eeschema: Fix plot line width for negative lines
Negative width lines are used to hide the outline of shapes in eeschema.
Plot should not show these lines.

(cherry picked from commit 94fa734c61)
2019-03-11 12:38:19 -07:00
Seth Hillbrand 5855f2d909 Ensure LIB_ALIAS elements are always drawn
We add LIB_ALIAS to the VIEW rtree when choosing a new symbol or
browsing.  The actual display element may change based on the unit or
demorgan representation but there will only ever be a single one drawn.
This will set the view bbox to maximum to ensure it is always checked
for drawing.

 Related to lp:1796960
 https://bugs.launchpad.net/kicad/+bug/1796960

(cherry picked from commit d25d62295a)
2019-03-10 20:18:12 -07:00
jean-pierre charras 5424223949 Thermal reliefs: fix a corner case that wrongly removes a stub in a thermal shape.
This was due to the stub removal tests if a stub end is outside a solid area to remove it.
There is a corner case: is the stub end is exactly on a solid area outline extra segment
created by Fracture() used in calculations.

The stub removal tests are now made before fracturing.

Fixes: lp:1819317
https://bugs.launchpad.net/kicad/+bug/1819317
(cherry picked from commit b9944e2c06)
2019-03-10 11:50:33 -07:00
Seth Hillbrand de22148b44 Move env var substitution into GetAssociatedDocument
We always want the documents to have their variables replaced when
opening the associated file.

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

(cherry picked from commit 9bfce26ce7)
2019-03-10 10:44:23 -07:00
Wayne Stambaugh 73664e610b Begin version 5.1.1 development. 2019-03-08 13:11:03 -05:00
609 changed files with 36997 additions and 48002 deletions
+31
View File
@@ -0,0 +1,31 @@
# Custom attribute to mark source files using KiCad C++ formatting
[attr]kicad-cpp-source whitepace=tab-in-indent format.clang-format-kicad
# Custom attribute to mark KiCad's own CMake files
[attr]kicad-cmake-source whitespace=tab-in-indent
# Custom attribute for auto-generated sources:
# * Do not perform whitespace checking
# * Do not format
[attr]generated whitespace=-tab-in-indent,-indent-with-non-tab -format.clang-format-kicad
# By default, all C and C++ files conform to KiCad formatting,
# unless overridden
*.c kicad-cpp-source
*.cpp kicad-cpp-source
*.h kicad-cpp-source
*.cmake kicad-cmake-source
*.txt kicad-cmake-source
# Compiled bitmap sources
bitmaps_png/cpp_*/*.cpp generated
# wxFormBuilder-generated files
**/dialog*/*_base.cpp generated
**/dialog*/*_base.h generated
# Lemon grammars
common/libeval/grammar.c generated
common/libeval/grammar.h generated
+49 -7
View File
@@ -7,10 +7,24 @@
# Based on clang-format pre-commit hook by Alex Eagle
# https://gist.github.com/alexeagle/c8ed91b14a407342d9a8e112b5ac7dab
# Set KICAD_CHECK_FORMAT to allow this hook to run
# if not set, the hook always succeeds.
if [ -z "$KICAD_CHECK_FORMAT" ]; then
exit 0
# Set kicad.check-format to allow this hook to run
# If not set, the hook always succeeds.
do_format=false
# Check if formatting is configured
if [ "$(git config --get kicad.check-format)" = true ]; then
do_format=true
fi
# Older env variable method
if [ ! -z "$KICAD_CHECK_FORMAT" ]; then
do_format=true
fi
if [ ! ${do_format} = true ]; then
# No formatting required
exit 0;
fi
check_clang_format() {
@@ -30,20 +44,48 @@ check_git_config() {
fi
}
get_filtered_filenames()
{
format_attr='clang-format-kicad'
# command to get list of candidate files
git_list_files='git diff --cached --name-only --diff-filter=ACM'
files=$(${git_list_files} |
# Filter for format-controlled files
git check-attr --stdin format.${format_attr} |
# output only the file names
grep ": set$" |
cut -d: -f1)
echo ${files}
}
check_clang_format
check_git_config
readonly out=$(git clang-format -v --diff)
files_to_check=$(get_filtered_filenames)
if [ -z "${files_to_check}" ]; then
# No controlled files to check
exit 0;
fi
git_clang_format_cmd="git clang-format -v --diff -- ${files_to_check}"
readonly out=$(${git_clang_format_cmd})
# In these cases, there is no formatting issues, so we succeed
if [[ "$out" == *"no modified files to format"* ]]; then exit 0; fi
if [[ "$out" == *"clang-format did not modify any files"* ]]; then exit 0; fi
# Any other case implies formatting results
echo "ERROR: you need to run git clang-format on your commit"
echo "ERROR: you need to run clang-format (e.g. using tools/check_coding.sh) on your commit"
# print the errors to show what's the issue
git clang-format -v --diff
${git_clang_format_cmd}
# fail the pre-commit
exit 1
+19
View File
@@ -59,6 +59,16 @@ demos/**/*-bak
demos/**/_autosave-*
demos/**/fp-info-cache
# MacOS package info created by CMake
bitmap2component/Info.plist
cvpcb/Info.plist
eeschema/Info.plist
gerbview/Info.plist
kicad/Info.plist
pagelayout_editor/Info.plist
pcb_calculator/Info.plist
pcbnew/Info.plist
# editor/OS fluff
.*.swp
*~
@@ -76,3 +86,12 @@ demos/**/fp-info-cache
*.gch
*.orig
*.patch
# These CMake files are wanted
!CMakeModules/*.cmake
# Eclipse IDE
.project
.cproject
.pydevproject
__pycache__
@@ -221,7 +221,7 @@ void DLG_SELECT_3DMODEL::OnFileActivated( wxTreeEvent& event )
void DLG_SELECT_3DMODEL::SetRootDir( wxCommandEvent& event )
{
if( m_FileTree )
if( m_FileTree && dirChoices->GetSelection() > 0 )
m_FileTree->SetPath( dirChoices->GetString( dirChoices->GetSelection() ) );
return;
@@ -263,21 +263,31 @@ void DLG_SELECT_3DMODEL::updateDirChoiceList( void )
if( !cl.empty() )
{
unsigned int choice = 0;
dirChoices->Clear();
dirChoices->Append( "" ); //Insert a blank string at the beginning to allow selection
if( !prjDir.empty() )
{
dirChoices->Append( prjDir );
if( prjDir == m_FileTree->GetPath() )
choice = 1;
}
std::set< wxString >::const_iterator sI = cl.begin();
std::set< wxString >::const_iterator eI = cl.end();
while( sI != eI )
{
if( *sI == m_FileTree->GetPath() )
choice = dirChoices->GetCount();
dirChoices->Append( *sI );
++sI;
}
dirChoices->Select( 0 );
dirChoices->Select( choice );
}
return;
@@ -28,16 +28,20 @@
* @file panel_prev_model.cpp
*/
#include "panel_prev_model.h"
#include <3d_canvas/eda_3d_canvas.h>
#include <common_ogl/cogl_att_list.h>
#include <bitmaps.h>
#include <base_units.h>
#include "project.h"
#include "panel_prev_model.h"
#include <class_board.h>
#include <base_units.h>
#include <bitmaps.h>
#include <class_drawpanel.h>
#include <dpi_scaling.h>
#include <pgm_base.h>
#include <project.h>
PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aModule,
std::vector<MODULE_3D_SETTINGS> *aParentModelList ) :
@@ -58,15 +62,13 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE*
// Set 3d viewer configuration for preview
m_settings3Dviewer = new CINFO3D_VISU();
bool option;
Pgm().CommonSettings()->Read( ENBL_MOUSEWHEEL_PAN_KEY, &option, false );
m_settings3Dviewer->SetFlag( FL_MOUSEWHEEL_PANNING, option );
// Create the 3D canvas
m_previewPane = new EDA_3D_CANVAS( this, COGL_ATT_LIST::GetAttributesList( true ),
m_dummyBoard, *m_settings3Dviewer,
aFrame->Prj().Get3DCacheManager() );
loadCommonSettings();
m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
}
@@ -111,6 +113,25 @@ void PANEL_PREV_3D::initPanel()
}
void PANEL_PREV_3D::loadCommonSettings()
{
wxCHECK_RET( m_previewPane, "Cannot load settings to null canvas" );
wxConfigBase& cmnCfg = *Pgm().CommonSettings();
{
const DPI_SCALING dpi{ &cmnCfg, this };
m_previewPane->SetScaleFactor( dpi.GetScaleFactor() );
}
{
bool option;
cmnCfg.Read( ENBL_MOUSEWHEEL_PAN_KEY, &option, false );
m_settings3Dviewer->SetFlag( FL_MOUSEWHEEL_PANNING, option );
}
}
/**
* @brief rotationFromString
* Ensure -MAX_ROTATION <= rotation <= MAX_ROTATION
@@ -93,6 +93,11 @@ private:
private:
void initPanel();
/**
* Load 3D relevant settings from the user configuration
*/
void loadCommonSettings();
/**
* @brief updateOrientation - it will receive the events from editing the fields
* @param event
-3
View File
@@ -66,7 +66,6 @@ CINFO3D_VISU::CINFO3D_VISU() :
m_boardCenter = SFVEC3F( 0.0f );
m_boardBoudingBox.Reset();
m_board2dBBox3DU.Reset();
m_layers_container2D.clear();
m_layers_holes2D.clear();
@@ -462,8 +461,6 @@ void CINFO3D_VISU::createBoardPolygon()
errmsg.append( _( "Cannot determine the board outline." ) );
wxLogMessage( errmsg );
}
Polygon_Calc_BBox_3DU( m_board_poly, m_board2dBBox3DU, m_biuTo3Dunits );
}
-3
View File
@@ -550,9 +550,6 @@ class CINFO3D_VISU
/// 3d bouding box of the pcb board in 3d units
CBBOX m_boardBoudingBox;
/// 2d bouding box of the pcb board in 3d units
CBBOX2D m_board2dBBox3DU;
/// It contains polygon contours for each layer
MAP_POLY m_layers_poly;
@@ -62,13 +62,11 @@
static int s_textWidth;
static CGENERICCONTAINER2D *s_dstcontainer = NULL;
static float s_biuTo3Dunits;
static const CBBOX2D *s_boardBBox3DU = NULL;
static const BOARD_ITEM *s_boardItem = NULL;
// This is a call back function, used by DrawGraphicText to draw the 3D text shape:
void addTextSegmToContainer( int x0, int y0, int xf, int yf, void* aData )
{
wxASSERT( s_boardBBox3DU != NULL );
wxASSERT( s_dstcontainer != NULL );
const SFVEC2F start3DU( x0 * s_biuTo3Dunits, -y0 * s_biuTo3Dunits );
@@ -76,7 +74,7 @@ void addTextSegmToContainer( int x0, int y0, int xf, int yf, void* aData )
if( Is_segment_a_circle( start3DU, end3DU ) )
s_dstcontainer->Add( new CFILLEDCIRCLE2D( start3DU,
s_textWidth * s_biuTo3Dunits,
( s_textWidth / 2 ) * s_biuTo3Dunits,
*s_boardItem) );
else
s_dstcontainer->Add( new CROUNDSEGMENT2D( start3DU,
@@ -103,7 +101,6 @@ void CINFO3D_VISU::AddShapeWithClearanceToContainer( const TEXTE_PCB* aTextPCB,
s_dstcontainer = aDstContainer;
s_textWidth = aTextPCB->GetThickness() + ( 2 * aClearanceValue );
s_biuTo3Dunits = m_biuTo3Dunits;
s_boardBBox3DU = &m_board2dBBox3DU;
// not actually used, but needed by DrawGraphicText
const COLOR4D dummy_color = COLOR4D::BLACK;
@@ -228,7 +225,6 @@ void CINFO3D_VISU::AddGraphicsShapesWithClearanceToContainer( const MODULE* aMod
s_boardItem = (const BOARD_ITEM *)&aModule->Value();
s_dstcontainer = aDstContainer;
s_biuTo3Dunits = m_biuTo3Dunits;
s_boardBBox3DU = &m_board2dBBox3DU;
for( unsigned ii = 0; ii < texts.size(); ++ii )
{
@@ -198,6 +198,7 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
0.00f, 0.30f );
m_materials.m_Copper.m_Shininess = shininessfactor * 128.0f;
m_materials.m_Copper.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
// Paste material mixed with paste color
@@ -213,6 +214,7 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
m_settings.m_SolderPasteColor.b );
m_materials.m_Paste.m_Shininess = 0.1f * 128.0f;
m_materials.m_Paste.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
// Silk screen material mixed with silk screen color
@@ -228,6 +230,7 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
m_settings.m_SilkScreenColor.b + 0.10f );
m_materials.m_SilkS.m_Shininess = 0.078125f * 128.0f;
m_materials.m_SilkS.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
// Solder mask material mixed with solder mask color
@@ -244,6 +247,7 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
m_materials.m_SolderMask.m_Shininess = 0.8f * 128.0f;
m_materials.m_SolderMask.m_Transparency = 0.17f;
m_materials.m_SolderMask.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
// Epoxy material
@@ -258,6 +262,7 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
20.0f / 255.0f );
m_materials.m_EpoxyBoard.m_Shininess = 0.1f * 128.0f;
m_materials.m_EpoxyBoard.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
}
else // Technical Mode
{
@@ -269,34 +274,40 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
m_materials.m_Copper.m_Ambient = matAmbientColor;
m_materials.m_Copper.m_Specular = matSpecularColor;
m_materials.m_Copper.m_Shininess = matShininess;
m_materials.m_Copper.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
// Paste material
m_materials.m_Paste.m_Ambient = matAmbientColor;
m_materials.m_Paste.m_Specular = matSpecularColor;
m_materials.m_Paste.m_Shininess = matShininess;
m_materials.m_Paste.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
// Silk screen material
m_materials.m_SilkS.m_Ambient = matAmbientColor;
m_materials.m_SilkS.m_Specular = matSpecularColor;
m_materials.m_SilkS.m_Shininess = matShininess;
m_materials.m_SilkS.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
// Solder mask material
m_materials.m_SolderMask.m_Ambient = matAmbientColor;
m_materials.m_SolderMask.m_Specular = matSpecularColor;
m_materials.m_SolderMask.m_Shininess = matShininess;
m_materials.m_SolderMask.m_Transparency = 0.17f;
m_materials.m_SolderMask.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
// Epoxy material
m_materials.m_EpoxyBoard.m_Ambient = matAmbientColor;
m_materials.m_EpoxyBoard.m_Diffuse = m_settings.m_BoardBodyColor;
m_materials.m_EpoxyBoard.m_Specular = matSpecularColor;
m_materials.m_EpoxyBoard.m_Shininess = matShininess;
m_materials.m_EpoxyBoard.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
// Gray material (used for example in technical vias and pad holes)
m_materials.m_GrayMaterial.m_Ambient = SFVEC3F( 0.8f, 0.8f, 0.8f );
m_materials.m_GrayMaterial.m_Diffuse = SFVEC3F( 0.3f, 0.3f, 0.3f );
m_materials.m_GrayMaterial.m_Specular = SFVEC3F( 0.4f, 0.4f, 0.4f );
m_materials.m_GrayMaterial.m_Shininess = 0.01f * 128.0f;
m_materials.m_GrayMaterial.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
}
}
@@ -347,6 +358,7 @@ void C3D_RENDER_OGL_LEGACY::set_layer_material( PCB_LAYER_ID aLayerID )
m_materials.m_Plastic.m_Diffuse.b * 0.7f );
m_materials.m_Plastic.m_Shininess = 0.078125f * 128.0f;
m_materials.m_Plastic.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
OGL_SetMaterial( m_materials.m_Plastic );
break;
@@ -28,10 +28,11 @@
*/
#include <GL/glew.h>
#include <climits>
#include <algorithm>
#include <atomic>
#include <thread>
#include <chrono>
#include <climits>
#include <thread>
#include "c3d_render_raytracing.h"
#include "mortoncodes.h"
@@ -2074,6 +2075,13 @@ bool C3D_RENDER_RAYTRACING::initializeOpenGL()
}
static float distance( const SFVEC2UI& a, const SFVEC2UI& b )
{
const float dx = (float) a.x - (float) b.x;
const float dy = (float) a.y - (float) b.y;
return hypotf( dx, dy );
}
void C3D_RENDER_RAYTRACING::initialize_block_positions()
{
@@ -2123,26 +2131,24 @@ void C3D_RENDER_RAYTRACING::initialize_block_positions()
m_postshader_ssao.UpdateSize( m_realBufferSize );
// Calc block positions
// Calc block positions for regular rendering. Choose an 'inside out'
// style of rendering
// /////////////////////////////////////////////////////////////////////
m_blockPositions.clear();
m_blockPositions.reserve( (m_realBufferSize.x / RAYPACKET_DIM) *
(m_realBufferSize.y / RAYPACKET_DIM) );
const int blocks_x = m_realBufferSize.x / RAYPACKET_DIM;
const int blocks_y = m_realBufferSize.y / RAYPACKET_DIM;
m_blockPositions.reserve( blocks_x * blocks_y );
i = 0;
for( int x = 0; x < blocks_x; ++x )
for( int y = 0; y < blocks_y; ++y )
m_blockPositions.push_back( SFVEC2UI( x * RAYPACKET_DIM, y * RAYPACKET_DIM ) );
while(1)
{
SFVEC2UI blockPos( DecodeMorton2X(i) * RAYPACKET_DIM,
DecodeMorton2Y(i) * RAYPACKET_DIM );
i++;
if( (blockPos.x >= m_realBufferSize.x) && (blockPos.y >= m_realBufferSize.y) )
break;
if( (blockPos.x < m_realBufferSize.x) && (blockPos.y < m_realBufferSize.y) )
m_blockPositions.push_back( blockPos );
}
const SFVEC2UI center( m_realBufferSize.x / 2, m_realBufferSize.y / 2 );
std::sort( m_blockPositions.begin(), m_blockPositions.end(),
[&]( const SFVEC2UI& a, const SFVEC2UI& b ) {
// Sort order: inside out.
return distance( a, center ) < distance( b, center );
} );
// Create m_shader buffer
delete[] m_shaderBuffer;
@@ -711,35 +711,6 @@ void Convert_path_polygon_to_polygon_blocks_and_dummy_blocks(
}
void Polygon_Calc_BBox_3DU( const SHAPE_POLY_SET &aPolysList,
CBBOX2D &aOutBBox ,
float aBiuTo3DunitsScale )
{
aOutBBox.Reset();
for( int idx = 0; idx < aPolysList.OutlineCount(); ++idx )
{
// Each polygon in aPolysList is a polygon with holes
const SHAPE_POLY_SET::POLYGON& curr_polywithholes = aPolysList.CPolygon( idx );
for( unsigned ipoly = 0; ipoly < curr_polywithholes.size(); ++ipoly )
{
const SHAPE_LINE_CHAIN& path = curr_polywithholes[ipoly]; // a simple polygon
for( int jj = 0; jj < path.PointCount(); jj++ )
{
const VECTOR2I& a = path.CPoint( jj );
aOutBBox.Union( SFVEC2F( (float) a.x * aBiuTo3DunitsScale,
(float)-a.y * aBiuTo3DunitsScale ) );
}
}
}
aOutBBox.ScaleNextUp();
}
#ifdef DEBUG
static void polygon_Convert( const ClipperLib::Path &aPath,
SEGMENTS &aOutSegment,
@@ -150,10 +150,6 @@ void Convert_path_polygon_to_polygon_blocks_and_dummy_blocks(
float aDivFactor,
const BOARD_ITEM &aBoardItem );
void Polygon_Calc_BBox_3DU( const SHAPE_POLY_SET &aPolysList,
CBBOX2D &aOutBBox,
float aBiuTo3DunitsScale );
void Polygon2d_TestModule();
#endif // _CPOLYGON2D_H_
@@ -85,7 +85,7 @@ public:
bool IsPointInside( const SFVEC2F &aPoint ) const override;
};
static const float s_min_dot = (FLT_EPSILON * 4.0f) ;
static const float s_min_dot = (FLT_EPSILON * 4.0f * FLT_EPSILON * 4.0f) ;
/**
* @brief Segment_is_a_circle - check if segment start and end is very close to each other
+3 -3
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -310,7 +310,7 @@ void CCAMERA::MakeRay( const SFVEC2I &aWindowPos,
case PROJECTION_ORTHO:
aOutOrigin = up_plus_right * 0.5f + m_frustum.nc;
aOutDirection = -m_dir;
aOutDirection = -m_dir + SFVEC3F( FLT_EPSILON );
break;
}
}
@@ -341,7 +341,7 @@ void CCAMERA::MakeRay( const SFVEC2F &aWindowPos, SFVEC3F &aOutOrigin, SFVEC3F &
case PROJECTION_ORTHO:
aOutOrigin = up_plus_right * 0.5f + m_frustum.nc;
aOutDirection = -m_dir;
aOutDirection = -m_dir + SFVEC3F( FLT_EPSILON );
break;
}
}
+52 -41
View File
@@ -40,100 +40,111 @@ void EDA_3D_VIEWER::ReCreateMainToolbar()
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::ReCreateMainToolbar" );
if( m_mainToolBar != NULL )
{
// Simple update to the list of old files.
SetToolbars();
return;
}
wxWindowUpdateLocker dummy( this );
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
if( m_mainToolBar )
{
m_mainToolBar->Clear();
}
else
{
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
}
// Set up toolbar
m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
KiBitmap( import3d_xpm ), _( "Reload board" ) );
KiScaledBitmap( import3d_xpm, this ), _( "Reload board" ) );
m_mainToolBar->AddSeparator();
KiScaledSeparator( m_mainToolBar, this );
m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
KiBitmap( copy_xpm ),
KiScaledBitmap( copy_xpm, this ),
_( "Copy 3D image to clipboard" ) );
m_mainToolBar->AddSeparator();
KiScaledSeparator( m_mainToolBar, this );
m_mainToolBar->AddTool( ID_TOOL_SET_VISIBLE_ITEMS, wxEmptyString,
KiBitmap( read_setup_xpm ),
KiScaledBitmap( read_setup_xpm, this ),
_( "Set display options, and some layers visibility" ) );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString, KiBitmap( render_mode_xpm ),
m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString,
KiScaledBitmap( render_mode_xpm, this ),
_( "Render current view using Raytracing" ), wxITEM_CHECK );
m_mainToolBar->AddSeparator();
KiScaledSeparator( m_mainToolBar, this );
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiBitmap( zoom_in_xpm ),
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString,
KiScaledBitmap( zoom_in_xpm, this ),
_( "Zoom in" ) );
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiBitmap( zoom_out_xpm ),
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString,
KiScaledBitmap( zoom_out_xpm, this ),
_( "Zoom out" ) );
m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
KiBitmap( zoom_redraw_xpm ),
KiScaledBitmap( zoom_redraw_xpm, this ),
_( "Redraw view" ) );
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, KiBitmap( zoom_fit_in_page_xpm ),
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
KiScaledBitmap( zoom_fit_in_page_xpm, this ),
_( "Zoom to fit 3D model" ) );
m_mainToolBar->AddSeparator();
KiScaledSeparator( m_mainToolBar, this );
m_mainToolBar->AddTool( ID_ROTATE3D_X_NEG, wxEmptyString,
KiBitmap( rotate_neg_x_xpm ),
KiScaledBitmap( rotate_neg_x_xpm, this ),
_( "Rotate X Clockwise" ) );
m_mainToolBar->AddTool( ID_ROTATE3D_X_POS, wxEmptyString,
KiBitmap( rotate_pos_x_xpm ),
KiScaledBitmap( rotate_pos_x_xpm, this ),
_( "Rotate X Counterclockwise" ) );
m_mainToolBar->AddSeparator();
KiScaledSeparator( m_mainToolBar, this );
m_mainToolBar->AddTool( ID_ROTATE3D_Y_NEG, wxEmptyString,
KiBitmap( rotate_neg_y_xpm ),
KiScaledBitmap( rotate_neg_y_xpm, this ),
_( "Rotate Y Clockwise" ) );
m_mainToolBar->AddTool( ID_ROTATE3D_Y_POS, wxEmptyString,
KiBitmap( rotate_pos_y_xpm ),
KiScaledBitmap( rotate_pos_y_xpm, this ),
_( "Rotate Y Counterclockwise" ) );
m_mainToolBar->AddSeparator();
KiScaledSeparator( m_mainToolBar, this );
m_mainToolBar->AddTool( ID_ROTATE3D_Z_NEG, wxEmptyString,
KiBitmap( rotate_neg_z_xpm ),
KiScaledBitmap( rotate_neg_z_xpm, this ),
_( "Rotate Z Clockwise" ) );
m_mainToolBar->AddTool( ID_ROTATE3D_Z_POS, wxEmptyString,
KiBitmap( rotate_pos_z_xpm ),
KiScaledBitmap( rotate_pos_z_xpm, this ),
_( "Rotate Z Counterclockwise" ) );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_MOVE3D_LEFT, wxEmptyString, KiBitmap( left_xpm ),
KiScaledSeparator( m_mainToolBar, this );
m_mainToolBar->AddTool( ID_MOVE3D_LEFT, wxEmptyString,
KiScaledBitmap( left_xpm, this ),
_( "Move left" ) );
m_mainToolBar->AddTool( ID_MOVE3D_RIGHT, wxEmptyString, KiBitmap( right_xpm ),
m_mainToolBar->AddTool( ID_MOVE3D_RIGHT, wxEmptyString,
KiScaledBitmap( right_xpm, this ),
_( "Move right" ) );
m_mainToolBar->AddTool( ID_MOVE3D_UP, wxEmptyString, KiBitmap( up_xpm ),
m_mainToolBar->AddTool( ID_MOVE3D_UP, wxEmptyString,
KiScaledBitmap( up_xpm, this ),
_( "Move up" ) );
m_mainToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString, KiBitmap( down_xpm ),
m_mainToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString,
KiScaledBitmap( down_xpm, this ),
_( "Move down" ) );
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_ORTHO, wxEmptyString, KiBitmap( ortho_xpm ),
KiScaledSeparator( m_mainToolBar, this );
m_mainToolBar->AddTool( ID_ORTHO, wxEmptyString,
KiScaledBitmap( ortho_xpm, this ),
_( "Enable/Disable orthographic projection" ),
wxITEM_CHECK );
m_mainToolBar->Realize();
}
void EDA_3D_VIEWER::SetToolbars()
{
}
}
+88 -18
View File
@@ -28,18 +28,22 @@
*/
#include "eda_3d_viewer.h"
#include "../3d_viewer_id.h"
#include <project.h>
#include "../common_ogl/cogl_att_list.h"
#include <bitmaps.h>
#include <dpi_scaling.h>
#include <gestfich.h>
#include <lru_cache.h>
#include <pgm_base.h>
#include <project.h>
#include <wildcards_and_files_ext.h>
#include <hotkeys_basic.h>
#include <wx/colordlg.h>
#include <wx/colourdata.h>
#include <lru_cache.h>
#include "../common_ogl/cogl_att_list.h"
#include <hotkeys_basic.h>
#include <wx/toolbar.h>
#include <bitmaps.h>
#include <pgm_base.h>
/**
@@ -162,16 +166,14 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent,
m_canvas = NULL;
m_disable_ray_tracing = false;
m_mainToolBar = nullptr;
m_AboutTitle = "3D Viewer";
// Give it an icon
wxIcon icon;
icon.CopyFromBitmap( KiBitmap( icon_3d_xpm ) );
SetIcon( icon );
bool option;
Pgm().CommonSettings()->Read( ENBL_MOUSEWHEEL_PAN_KEY, &option, false );
m_settings.SetFlag( FL_MOUSEWHEEL_PANNING, option );
LoadSettings( config() );
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
@@ -190,6 +192,9 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent,
if( m_canvas )
m_canvas->SetStatusBar( status_bar );
// Some settings need the canvas
loadCommonSettings();
CreateMenuBar();
ReCreateMainToolbar();
@@ -288,32 +293,62 @@ void EDA_3D_VIEWER::Process_Special_Functions( wxCommandEvent &event )
case ID_ROTATE3D_X_POS:
m_settings.CameraGet().RotateX( glm::radians(ROT_ANGLE) );
m_canvas->Request_refresh();
if( m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY )
m_canvas->Request_refresh();
else
m_canvas->RenderRaytracingRequest();
break;
case ID_ROTATE3D_X_NEG:
m_settings.CameraGet().RotateX( -glm::radians(ROT_ANGLE) );
m_canvas->Request_refresh();
if( m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY )
m_canvas->Request_refresh();
else
m_canvas->RenderRaytracingRequest();
break;
case ID_ROTATE3D_Y_POS:
m_settings.CameraGet().RotateY( glm::radians(ROT_ANGLE) );
m_canvas->Request_refresh();
if( m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY )
m_canvas->Request_refresh();
else
m_canvas->RenderRaytracingRequest();
break;
case ID_ROTATE3D_Y_NEG:
m_settings.CameraGet().RotateY( -glm::radians(ROT_ANGLE) );
m_canvas->Request_refresh();
if( m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY )
m_canvas->Request_refresh();
else
m_canvas->RenderRaytracingRequest();
break;
case ID_ROTATE3D_Z_POS:
m_settings.CameraGet().RotateZ( glm::radians(ROT_ANGLE) );
m_canvas->Request_refresh();
if( m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY )
m_canvas->Request_refresh();
else
m_canvas->RenderRaytracingRequest();
break;
case ID_ROTATE3D_Z_NEG:
m_settings.CameraGet().RotateZ( -glm::radians(ROT_ANGLE) );
m_canvas->Request_refresh();
if( m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY )
m_canvas->Request_refresh();
else
m_canvas->RenderRaytracingRequest();
break;
case ID_MOVE3D_LEFT:
@@ -726,7 +761,7 @@ void EDA_3D_VIEWER::LoadSettings( wxConfigBase *aCfg )
aCfg->Read( keyRenderRAY_Shadows, &tmp, true );
m_settings.SetFlag( FL_RENDER_RAYTRACING_SHADOWS, tmp );
aCfg->Read( keyRenderRAY_Backfloor, &tmp, true );
aCfg->Read( keyRenderRAY_Backfloor, &tmp, false );
m_settings.SetFlag( FL_RENDER_RAYTRACING_BACKFLOOR, tmp );
aCfg->Read( keyRenderRAY_Refractions, &tmp, true );
@@ -869,6 +904,22 @@ void EDA_3D_VIEWER::SaveSettings( wxConfigBase *aCfg )
}
void EDA_3D_VIEWER::CommonSettingsChanged()
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::CommonSettingsChanged" );
// Regen menu bars, etc
EDA_BASE_FRAME::CommonSettingsChanged();
// There is no base class that handles toolbars for this frame
ReCreateMainToolbar();
loadCommonSettings();
NewDisplay( true );
}
void EDA_3D_VIEWER::OnLeftClick( wxDC *DC, const wxPoint &MousePos )
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::OnLeftClick" );
@@ -941,7 +992,7 @@ void EDA_3D_VIEWER::takeScreenshot( wxCommandEvent& event )
}
// Be sure we have the latest 3D view (remember 3D view is buffered)
Refresh();
m_canvas->Request_refresh( true );
wxYield();
// Build image from the 3D buffer
@@ -1225,3 +1276,22 @@ void EDA_3D_VIEWER::OnUpdateUIAxis( wxUpdateUIEvent& aEvent )
{
aEvent.Check( m_settings.GetFlag( FL_AXIS ) );
}
void EDA_3D_VIEWER::loadCommonSettings()
{
wxCHECK_RET( m_canvas, "Cannot load settings to null canvas" );
wxConfigBase& cmnCfg = *Pgm().CommonSettings();
{
const DPI_SCALING dpi{ &cmnCfg, this };
m_canvas->SetScaleFactor( dpi.GetScaleFactor() );
}
{
bool option;
cmnCfg.Read( ENBL_MOUSEWHEEL_PAN_KEY, &option, false );
m_settings.SetFlag( FL_MOUSEWHEEL_PANNING, option );
}
}
+17
View File
@@ -154,6 +154,15 @@ class EDA_3D_VIEWER : public KIWAY_PLAYER
*/
bool Set3DSilkScreenColorFromUser();
/**
* Notification that common settings are updated.
*
* This would be private (and only called by the Kiway), but we
* need to do this manually from the PCB frame because the 3D viewer isn't
* updated via the #KIWAY.
*/
void CommonSettingsChanged() override;
private:
/// Called when user press the File->Exit
void Exit3DFrame( wxCommandEvent &event );
@@ -188,6 +197,9 @@ class EDA_3D_VIEWER : public KIWAY_PLAYER
DisplayHotkeyList( this, GetHotkeyConfig() );
}
/**
* Equivalent of EDA_DRAW_FRAME::ReCreateHToolbar
*/
void ReCreateMainToolbar();
void SetToolbars();
@@ -217,6 +229,11 @@ class EDA_3D_VIEWER : public KIWAY_PLAYER
private:
/**
* Load configuration from common settings.
*/
void loadCommonSettings();
/**
* Filename to propose for save a screenshot
*/
+53 -20
View File
@@ -102,28 +102,43 @@ option( KICAD_INSTALL_DEMOS
"Install KiCad demos and examples (default ON)"
ON )
option( KICAD_BUILD_QA_TESTS
"Build software Quality assurance unit tests (default ON)"
ON )
option( BUILD_GITHUB_PLUGIN
"Build the GITHUB_PLUGIN for pcbnew."
ON )
option( KICAD_SPICE
"Build KiCad with internal Spice simulator."
ON )
# when option KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES is enabled:
# PYTHON_EXECUTABLE can be defined when invoking cmake
# ( use -DPYTHON_EXECUTABLE=<python path>/python.exe or python2 )
# when not defined by user, the default is python.exe under Windows and python2 for others
# python binary file should be in exec path.
# KICAD_SCRIPTING_MODULES requires KICAD_SCRIPTING enable it here if KICAD_SCRIPTING_MODULES is ON
if ( KICAD_SCRIPTING_MODULES AND NOT KICAD_SCRIPTING )
message(STATUS "Changing KICAD_SCRIPTING to ON as needed by KICAD_SCRIPTING_MODULES")
set ( KICAD_SCRIPTING ON )
# KICAD_SCRIPTING controls the entire python scripting system. If it is off, no other scripting
# functions are available.
if ( NOT KICAD_SCRIPTING )
message( STATUS "KICAD_SCRIPTING is OFF: Disabling all python scripting support" )
set( KICAD_SCRIPTING_MODULES OFF )
set( KICAD_SCRIPTING_ACTION_MENU OFF )
set( KICAD_SCRIPTING_PYTHON3 OFF )
set( KICAD_SCRIPTING_WXPYTHON OFF )
set( KICAD_SCRIPTING_WXPYTHON_PHOENIX OFF)
endif()
# same with KICAD_SCRIPTING_ACTION_MENUS
if ( KICAD_SCRIPTING_ACTION_MENU AND NOT KICAD_SCRIPTING )
message(STATUS "Changing KICAD_SCRIPTING to ON as needed by KICAD_SCRIPTING_ACTION_MENU")
set ( KICAD_SCRIPTING ON )
# KICAD_SCRIPTING_WXPYTHON_PHOENIX requires enabling the KICAD_SCRIPTING_WXPYTHON flag
# so that the wxWidgets library is properly versioned
if ( KICAD_SCRIPTING AND NOT KICAD_SCRIPTING_WXPYTHON AND KICAD_SCRIPTING_WXPYTHON_PHOENIX )
message( STATUS
"KICAD_SCRIPTING_WXPYTHON_PHOENIX has been requested, setting KICAD_SCRIPTING_WXPYTHON to ON")
set( KICAD_SCRIPTING_WXPYTHON ON)
endif()
option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." ON )
option( KICAD_SPICE "Build KiCad with internal Spice simulator." ON )
# Global setting: exports are explicit
set( CMAKE_CXX_VISIBILITY_PRESET "hidden" )
set( CMAKE_VISIBILITY_INLINES_HIDDEN ON )
@@ -655,8 +670,9 @@ set( INC_AFTER
${CMAKE_BINARY_DIR}
)
#
# Find Python and other scripting resources
#
if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
# SWIG 3.0 or later require for C++11 support.
@@ -714,19 +730,36 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
find_package( PythonLibs 2.6 REQUIRED )
endif()
if( KICAD_SCRIPTING_WXPYTHON )
find_package( wxPython REQUIRED )
message( STATUS "Found ${WXPYTHON_FLAVOR} "
"${WXPYTHON_VERSION}/${WXPYTHON_TOOLKIT} "
"(wxWidgets ${WXPYTHON_WXVERSION})" )
endif()
# Infrequently needed headers go at end of search paths, append to INC_AFTER which
# although is used for all components, should be a harmless hit for something like eeschema
# so long as unused search paths are at the end like this.
set( INC_AFTER ${INC_AFTER} ${PYTHON_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/scripting )
endif()
# Find the wxPython installation if requested
if( KICAD_SCRIPTING_WXPYTHON )
find_package( wxPython REQUIRED )
if( KICAD_SCRIPTING_WXPYTHON_PHOENIX AND WXPYTHON_VERSION VERSION_LESS 4.0.0 )
message( FATAL_ERROR
"Unable to find wxPython Phoenix,"
" instead found wxPython Classic ${WXPYTHON_VERSION}" )
endif()
# The test VERSION_GREATER_EQUAL is only available in cmake >3.7, so use the max possible
# version for the 3.0 line as the basis of the comparison
if( NOT KICAD_SCRIPTING_WXPYTHON_PHOENIX AND WXPYTHON_VERSION VERSION_GREATER 3.9.999 )
message( FATAL_ERROR
"Unable to find wxPython Classic,"
" instead found wxPython Phoenix ${WXPYTHON_VERSION}" )
endif()
message( STATUS "Found ${WXPYTHON_FLAVOR} "
"${WXPYTHON_VERSION}/${WXPYTHON_TOOLKIT} "
"(wxWidgets ${WXPYTHON_WXVERSION})" )
endif()
#
# Find wxWidgets library, required
#
+1
View File
@@ -22,6 +22,7 @@
find_path( NGSPICE_INCLUDE_DIR ngspice/sharedspice.h
PATHS ${NGSPICE_ROOT_DIR} $ENV{NGSPICE_ROOT_DIR} ${NGSPICE_INCLUDE_PATH}
${NGSPICE_ROOT_DIR}/include
PATH_SUFFIXES src/include share/ngspice/include share/ngspice/include/ngspice
)
+11 -4
View File
@@ -25,9 +25,13 @@
# Function make_lexer
# is a standard way to invoke TokenList2DsnLexer.cmake.
# Extra arguments are treated as source files which depend on the generated
# outHeaderFile
# files. Some detail here on the indirection:
# - Parallel builds all depend on the same files, and CMake will generate the same file multiple times in the same location.
# This can be problematic if the files are generated at the same time and overwrite each other.
# - To fix this, we create a custom target (outputTarget) that the parallel builds depend on.
# AND build dependencies. This creates the needed rebuild for appropriate source object changes.
function( make_lexer outputTarget inputFile outHeaderFile outCppFile enum )
function( make_lexer inputFile outHeaderFile outCppFile enum )
add_custom_command(
OUTPUT ${outHeaderFile}
${outCppFile}
@@ -37,14 +41,17 @@ function( make_lexer inputFile outHeaderFile outCppFile enum )
-DoutHeaderFile=${outHeaderFile}
-DoutCppFile=${outCppFile}
-P ${CMAKE_MODULE_PATH}/TokenList2DsnLexer.cmake
DEPENDS ${inputFile}
${CMAKE_MODULE_PATH}/TokenList2DsnLexer.cmake
COMMENT "TokenList2DsnLexer.cmake creating:
${outHeaderFile} and
${outCppFile} from
${inputFile}"
)
add_custom_target( ${outputTarget}
DEPENDS ${outHeaderFile} ${outCppFile}
${CMAKE_MODULE_PATH}/TokenList2DsnLexer.cmake
)
# extra_args, if any, are treated as source files (typically headers) which
# are known to depend on the generated outHeader.
foreach( extra_arg ${ARGN} )
+31 -31
View File
@@ -1,38 +1,38 @@
#
# This program source code file is part of KICAD, a free EDA CAD application.
#
#
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2016 Wayne Stambaugh <stambaughw@gmail.com>
# Copyright (C) 2016 - 2018 KiCad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# Note: unless you are the person responsible for creating releases,
# do *not* change these variables. This way the KiCad project
# can maintain control over what is an official KiCad build and
# what is not. Setting these variable that conflict with KiCad
# releases is a shooting offense.
#
# This file gets included in the WriteVersionHeader.cmake file to set
# Copyright (C) 2016 - 2019 KiCad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# Note: unless you are the person responsible for creating releases,
# do *not* change these variables. This way the KiCad project
# can maintain control over what is an official KiCad build and
# what is not. Setting these variable that conflict with KiCad
# releases is a shooting offense.
#
# This file gets included in the WriteVersionHeader.cmake file to set
# the default KiCad version when the source is provided in an archive
# file or git is not available on the build system. When KiCad is
# cloned using git, the git version is used. This version string should
# be set after each version tag is added to the git repo. This will
# give developers a reasonable idea where which branch was used to build
# KiCad.
set( KICAD_VERSION "5.1.0" )
set( KICAD_VERSION "5.1.5-rc1" )
@@ -70,20 +70,43 @@ Set the `git clang-format` tool to use the provided `_clang-format` file:
git config clangFormat.style file
Then, to enable the format checker, set the `KICAD_CHECK_FORMAT` environment
variable in your shell. Without this variable, the format checker will not
run on commit, but you can still use `git clang-format --diff` to check manually.
Then, to enable the format checker, set the `kicad.check-format` Git config
to "true" for the KiCad repo:
If enabled, when you commit a change, you will be told if you have caused any
style violations (only in your changed code). You can fix them automatically
with:
git config kicad.check-format true
git clang-format
Without this config, the format checker will not run on commit, but you can
still check files staged for commit manually (see below).
Or you can proceed anyway, if you are sure your style is correct:
If the hook is enabled, when you commit a change, you will be told if you
have caused any style violations (only in your changed code). You can then fix
the errors, either manually, or with the tools below.
If you are warned about formatting errors, but you are sure your style is correct,
you can still commit:
git commit --no-verify
### Correcting Formatting Errors ## {#correcting-formatting-errors}
There is a Git aliases file that provides the right commands to show and correct
formatting errors. Add to your repository config by running this command from
the source directory:
git config --add include.path $(pwd)/helpers/git/format_alias
Then you can use the following aliases:
* `git check-format`: show any formatting warnings (but make no changes)
* `git fix-format`: correct formatting (you will need to `git add` afterwards)
These aliases use a script, `tools/check-coding.sh`, which takes care of only
checking the formatting for files that should be formatted. This script has
other uses:
* Make (or see only) violations in files modified in the previous commit (useful
when interactive-rebasing):
* `check_coding.sh --amend [--diff]`
# 2. Naming Conventions # {#naming_conventions}
Before delving into anything as esoteric as indentation and formatting,
@@ -456,6 +479,20 @@ The case statement is to be indented to the same level as the switch.
}
~~~~~~~~~~~~~
It is permitted to place all cases on a single line each, if that makes the
code more readable. This is often done for look-ups or translation functions. In
this case, you will have to manually align for readability as appropriate and
reject clang-format's suggested changes, if you use it:
~~~~~~~~~~~~~{.cpp}
switch( m_orientation )
{
case PIN_RIGHT: m_orientation = PIN_UP; break;
case PIN_UP: m_orientation = PIN_LEFT; break;
case PIN_LEFT: m_orientation = PIN_DOWN; break;
case PIN_DOWN: m_orientation = PIN_RIGHT; break;
}
~~~~~~~~~~~~~
# 5. License Statement # {#license_statement}
There is a the file copyright.h which you can copy into the top of
@@ -824,6 +861,6 @@ learn something new.
[clang-format]: https://clang.llvm.org/docs/ClangFormat.html
[cppstandard]:http://www.possibility.com/Cpp/CppCodingStandard.html
[kernel]:http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/CodingStyle
[kernel]:https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/process/coding-style.rst
[overloading]:http://www.cs.caltech.edu/courses/cs11/material/cpp/donnie/cpp-ops.html
[style]:http://en.wikipedia.org/wiki/Programming_style
+28 -9
View File
@@ -149,27 +149,40 @@ on macOS. This is enabled on macOS by default and disabled on all other platfor
## Scripting Support ## {#scripting_opt}
The KICAD_SCRIPTING option is used to enable building the Python scripting support into Pcbnew.
This options is enabled by default.
This options is enabled by default, and will disable all other KICAD_SCRIPTING_* options when
it is disabled.
## Python 3 Scripting Support ## {#python3}
The KICAD_SCRIPTING_PYTHON3 option is used to enable using Python 3 for the scripting support
instead of Python 2. This option is disabled by default and only is relevant if
[KICAD_SCRIPTING](#scripting_opt) is enabled.
## Scripting Module Support ## {#scripting_mod_opt}
The KICAD_SCRIPTING_MODULES option is used to enable building and installing the Python modules
supplied by KiCad. This option is enabled by default.
## Python 3 Scripting Support ## {#python3}
The KICAD_SCRIPTING_PYTHON3 option is used to enable building of the Python 3 interface instead
of Python 2. This option is disabled by default.
supplied by KiCad. This option is enabled by default, but will be disabled if
[KICAD_SCRIPTING](#scripting_opt) is disabled.
## wxPython Scripting Support ## {#wxpython_opt}
The KICAD_SCRIPTING_WXPYTHON option is used to enable building the wxPython interface into
Pcbnew including the wxPython console. This option is enabled by default.
Pcbnew including the wxPython console. This option is enabled by default, but will be disabled if
[KICAD_SCRIPTING](#scripting_opt) is disabled.
## wxPython Phoenix Scripting Support ## {#wxpython_phoenix}
The KICAD_SCRIPTING_WXPYTHON_PHOENIX option is used to enable building the wxPython interface with
the new Phoenix binding instead of the legacy one. This option is disabled by default.
the new Phoenix binding instead of the legacy one. This option is disabled by default, and
enabling it requires [KICAD_SCRIPTING](#scripting_opt) to be enabled.
## Python Scripting Action Menu Support ## {#python_action_menu_opt}
The KICAD_SCRIPTING_ACTION_MENU option allows Python scripts to be added directly to the Pcbnew
menu. This option is enabled by default, but will be disabled if
[KICAD_SCRIPTING](#scripting_opt) is disabled. Please note that this option is highly
experimental and can cause Pcbnew to crash if Python scripts create an invalid object state
within Pcbnew.
## GitHub Plugin ## {#github_opt}
@@ -336,6 +349,12 @@ configure pacman to prevent upgrading the 64-bit Boost package by adding:
to your /etc/pacman.conf file.
### Building with Boost 1.70 ### {#ki_msys2_boost_1_70}
There is an issue building KiCad with Boost version 1.70 due to CMake not defining the proper
link libraries during configuration. Boost 1.70 can be used but `-DBoost_NO_BOOST_CMAKE=ON`
needs to be added during CMake configuration to insure the link libraries are properly generated.
### Building OCE from source
KiCad requires OCE by default, and the version installed by `pacman` can cause build errors in
-461
View File
@@ -1,461 +0,0 @@
# Version 5 Road Map # {#v5_road_map}
This document is the KiCad version 5 Developer's road map document. It is
living document that should be maintained during the version 5 development
cycle. The goal of this document is to provide an overview for developers
of the goals for the project for the version 5 release of KiCad. It is
broken into sections for each major component of the KiCad source code and
documentation. It defines tasks that developers an use to contribute to the
project and provides updated status information. Tasks should define clear
objectives and avoid vague generalizations so that a new developer can complete
the task. It is not a place for developers to add their own personal wish.
list. It should only be updated with approval of the project manager after
discussion with the lead developers.
Each entry in the road map is made up of four sections. The goal should
be a brief description of the what the road map entry will accomplish. The
task section should be a list of deliverable items that are specific enough
hat they can be documented as completed. The dependencies sections is a list
of requirements that must be completed before work can begin on any of the
tasks. The status section should include a list of completed tasks or marked
as complete as when the goal is met.
[TOC]
# Project # {#v5_project}
This section defines the tasks for the project related goals that are not
related to coding or documentation. It is a catch all for issues such as
developer and user relations, dissemination of information on websites,
policies, etc.
# General # {#v5_general}
This section defines the tasks that affect all or most of KiCad or do not
fit under as specific part of the code such as the board editor or the
schematic editor.
## Search Tree Control ## {#v5_re_search_control}
**Goal:**
Create a user interface element that allows searching through a list of
items in a tree control for library searching.
**Task:**
- Create hybrid tree control with search text control for displaying filtered
objects (both symbol and footprint libraries) in a parent window.
**Dependencies:**
- None
**Status:**
- Initial container searching code completed.
- Wildcard and regular expression container searching completed.
- Control code in progress.
# Common Library # {#v5_common_lib}
This section covers the source code shared between all of the KiCad
applications
## Unified Rendering Framework ## {#v5_unified_rendering}
**Goal:**
Provide a single framework for developing new tools. Port existing tools
to the new framework and remove the legacy framework tools.
**Task:**
- Port wxDC to GAL or get Cairo rendering to nearly the performance of the
current wxDC rendering so that we have a single framework to develop new
tools and we can continue to support systems that don't have a complete
OpenGL stack.
**Dependencies**
- [Tool framework](http://www.ohwr.org/projects/cern-kicad/wiki/WorkPackages)
**Status**
- In progress
## Printing Improvements ## {#v5_print}
**Goal:**
Make printing quality consistent across platforms.
**Task:**
- Resolve printing issues on all platforms.
**Dependencies**
- None
**Status**
- No progress.
## Object Properties and Introspection ## {#v5_object_props}
**Goal:**
Provide an object introspection system using properties.
**Task:**
- Select existing or develop property system.
- Add definable properties to base objects.
- Create introspection framework for manipulating object properties.
- Serialization of properties to and from files and/or other I/O structures.
- Create tool to edit property namespace/object name/name/type/value table.
**Dependencies:**
- None
**Status:**
- No progress.
## 3D Viewer Dynamic Library Plugin ## {#v5_plugin_base}
**Goal:**
Create a base library plugin for handling external file I/O for the 3D viewer.
This will allow plugins to be provided that are external to the project such
as providing solid model file support (STEP, IGES, etc.) using OpenCascade
without making it a project dependency.
**Task:**
- Create a plugin to handle dynamically registered plugins for loading and
saving file formats.
- This object should be flexible enough to be extended for handling all file
plugin types including schematic, board, footprint library, component
library, etc. (optional)
- See [blueprint](https://blueprints.launchpad.net/kicad/+spec/pluggable-file-io)
on Launchpad for more information.
**Dependencies:**
- None
**Status:**
- 3D plugin code complete and legacy formats implemented.
# Eeschema: Schematic Editor # {#v5_eeschema}
This section applies to the source code for the Eeschema schematic editor.
## Coherent SCHEMATIC Object ## {#v5_sch_object}
**Goal:**
Clean up the code related to the schematic object(s) into a coherent object for
managing and manipulating the schematic that can be used by third party tools
and Python scripting.
**Task:**
- Move handling of root sheet object to SCHEMATIC object.
- Move SCH_SCREENS code into SCH_OBJECT.
- Build and maintain schematic hierarchy in SCHEMATIC object rather than
recreating on the fly every time the hierarchical information is required.
- Optionally build and maintain netlist during editing for extended editing
features.
- Add any missing functionality to the SCHEMATIC object.
**Dependencies:**
- [Schematic and Component Library Plugin](#v5_sch_plugin)
**Status:**
- In progress.
## Schematic and Component Library I/O Manager Plugin ## {#v5_sch_plugin}
**Goal:**
Create a plugin manager for loading and saving schematics and component
libraries similar to the board plugin manager.
**Task:**
- Design plugin manager for schematics and component libraries.
- Port the current schematic and component library file formats to use the
plugin.
**Dependencies:**
- None
**Status:**
- I/O manager and plugin objects are complete.
- Legacy schematic file parser almost ready to commit.
## S-Expression File Format ## {#v5_sch_sexpr}
**Goal:**
Make schematic file format more readable, add new features, and take advantage
of the s-expression parser and formatter capability used in Pcbnew.
**Task:**
- Finalize feature set and file format.
- Discuss the possibility of dropping the unit-less proposal temporarily to get
the s-expression file format and SWEET library format implemented without
completely rewriting Eeschema.
- Add new s-expression file format to plugin.
**Dependencies:**
- [Schematic and component I/O manager plugin](#v5_sch_plugin)
**Status:**
- File format document nearly complete.
## Implement Sweet Component Libraries ## {#v5_sch_sweet}
**Goal:**
Make component library design more robust and feature rich. Use s-expressions
to make component library files more readable.
**Task:**
- Use sweet component file format for component libraries.
**Dependencies:**
- [S-expression file format](#v5_sch_sexpr).
[Schematic and component I/O manager plugin](#v5_sch_plugin)
**Status:**
- Initial SWEET library file format document written.
## Component Library Editor Usability Improvements ## {#v5_lib_editor_usability}
**Goal:**
Make editing schematic symbol libraries easier to manage.
**Task:**
- Determine usability improvements in the library editor for components with
multiple units and/or alternate graphical representations.
- Replace current library/symbols selection process with new hybrid tree search
widget in new window pain for selection libraries and symbols. Provide drag
and drop symbol copy/move between libraries.
- Allow editing of symbol libraries not defined in footprint library table(s)
using the file/path dialog to open a library.
**Dependencies:**
- [Search Tree Control](#v5_re_search_control)
**Status:**
- Determined alternate UI designs using new hybrid search tree control.
## Component and Netlist Attributes ## {#v5_netlist_attributes}
**Goal:**
Provide a method of passing information to other tools via the net list.
**Task:**
- Add virtual components and attributes to netlist to define properties that
can be used by other tools besides the board editor.
- Attributes (properties) are automatically included as part of the new file
format.
**Dependencies:**
- [S-expression schematic file format](#v5_sch_sexpr).
**Status:**
- No progress.
# Circuit Simulation # {#simulation}
**Goal:**
Provide quality circuit simulation capabilities similar to commercial products.
**Task:**
- Evaluate and select simulation library (ngspice, gnucap, qucs, etc).
- Evaluate and select plotting library with wxWidgets support.
- Confirm current spice netlist export is up to the task and add missing
support for simulations.
- Use plotting library to handle simulator output in a consistent manor similar
to LTSpice.
- Develop a tool that allows fine tuning of components on the fly.
- Use plugin for the simulation code to allow support of different simulation
libraries.
- Create dialogs for configuring of simulation of Spice primitive components
such as voltage sources, current sources, etc.
- Create dialog(s) for configuration of simulation types transient, DC operating
point, AC analysis, etc.
**Dependencies:**
- None
**Status:**
- Complete ([announcement message](https://lists.launchpad.net/kicad-developers/msg25483.html))
# Pcbnew: Circuit Board Editor # {#v5_pcbnew}
This section covers the source code of the board editing application Pcbnew.
## Tool Framework ## {#v5_pcb_tool_framework}
**Goal:**
Unify all board editing tools under a single framework.
**Task:**
- Drop footprint edit mode.
- Port auto-router to GAL.
- Complete porting of all board editing tools to new tool framework so they
are available in the OpenGL and Cairo canvases.
- Remove all duplicate legacy editing tools.
**Dependencies:**
- In progress.
**Status:**
- Initial porting work in progress.
## Modeling ## {#v5_modeling}
**Goal:**
Provide improved solid modeling support for KiCad including the file formats
available in OpenCascade.
**Task:**
- Improve low level code design.
- Design plugin architecture to handle loading and saving 3D models.
- Back port existing 3D formats (IDF and S3D) to plugin
**Dependencies:**
- [Dynamic library plugin](#v5_plugin_base).
**Status:**
- Completed.
## Push and Shove Router Improvements ## {#v5_ps_router_improvements}
**Goal:**
Add finishing touches to push and shove router.
**Task:**
- Determine which features are feasible.
- Factor out KiCad-specific code from PNS_ROUTER class.
- Delete and backspace in idle mode
- Differential pair clearance fixes.
- Differential pair optimizer improvements (recognize differential pairs)
- Persistent differential pair gap/width setting.
- Walk around in drag mode.
- Optimize trace being dragged too. (currently no optimization)
- Backspace to erase last routed segment.
- Auto-finish traces (if time permits)
- Additional optimization pass for spring back algorithm using area-minimization
strategy. (improves tightness of routing)
- Restrict optimization area to view port (if user wants to)
- Support 45 degree tuning meanders.
- Respect trace/via locking!
- Keep out zone support.
**Dependencies:**
- None
**Status:**
- Feature feasibility determined.
- In Progress.
## Selection Filtering ## {#v5_pcb_selection_filtering}
**Goal:**
Make the selection tool easier for the user to determine which object(s) are
being selected by filtering.
**Task:**
- Provide filtered object selection by adding a third tab to the layer manager
or possibly some other UI element to provide filtered selection options.
**Dependencies:**
- None
**Status:**
- Initial design concept discussed.
## Segment End Point Snapping. ## {#v5_segment_snapping}
**Goal:**
It is not uncommon for board edge segment end points to inadvertently not
be closed causing issues for the 3D viewer and exporting to different file
formats due the board outline not being a fully enclosed polygon. This
feature would add segment end snapping support to allow the board outline
to be fully enclosed. This feature would only need to be supported by the
GAL rendering.
**Tasks**
- Mark board edge segment ends with a drag indicator to make it visible to the
user that the segment end does not have an endpoint with any other board edge
segment.
- Allow the user to snap the unconnected segment end to the nearest segment end
point.
- Automatically connect unconnected segments with and additional segment when
opening the 3D viewer or exporting the board to another format. Warn the
user that an addition segment has be added and should be verified.
**Dependencies:**
- None
**Progress:**
- Initial discussion.
## Stitching Via Support ## {#v5_pcb_stitching_vias}
**Goal:**
Add capability to add vias for stitching and thermal transfer purposes
that do not require being attached to tracks.
**Task:**
- Develop more robust connectivity checking algorithm.
- Create a UI element to allow the user to select a net from the list of
valid nets.
- Connection propagation fix for the current issue of vias that are not
connected to tracks being tagged as unassigned and removed.
- Manual via placement tool.
- Improve the DRC to handle cases of orphaned vias.
**Dependencies:**
- None
**Progress:**
- Patch available to fix via propagation issue.
# Documentation # {#v5_documentation}
This section defines the tasks for both the user and developer documentation.
## Grammar Check ## {#v5_doc_grammar}
**Goal:**
Improve user documentation readability and make life easier to for translators.
**Task:**
- Review and revise all of the English documentation so that it is update with
the current functionality of the code.
- Translate the update documentation into other languages.
**Dependencies:**
- None
**Status:**
- No progress.
## Maintenance ## {#v5_doc_maintenance}
**Task:**
- Keep screen shots current with the source changes.
**Dependencies:**
- None.
**Status:**
- No progress.
## Convert Developer Documentation to Markup/down Format ## {#v5_dev_doc_format}
**Goal:**
Improve developers documentation to make life easier for new developers to get
involved with the project.
**Task:**
- Convert platform build instructions from plain text to new format to be
merged with the developer documentation.
- Convert how to contribute to KiCad instructions from plain text to the new
format to merged with the developer documentation.
**Dependencies:**
- None.
**Status:**
- In progress. Most of the developer documentation has been converted to
[Doxygen markdown](http://www.doxygen.nl/manual/markdown.html)
and the [output][kicad-docs] is rebuilt automatically when a commit is
made to the KiCad repo.
[kicad-website]:http://kicad-pcb.org/
[kicad-docs]:http://ci.kicad-pcb.org/job/kicad-doxygen/ws/Documentation/doxygen/html/index.html
+520 -79
View File
@@ -54,10 +54,84 @@ Create perspectives to allow users to arrange dockable windows as they prefer.
**Status:**
- No progress.
## Object Properties and Introspection ## {#v6_object_props}
**Goal:**
Provide an object introspection system using properties.
**Task:**
- Select existing or develop property system.
- Add definable properties to base objects.
- Create introspection framework for manipulating object properties.
- Serialization of properties to and from files and/or other I/O structures.
- Create tool to edit property namespace/object name/name/type/value table.
**Dependencies:**
- None
**Status:**
- In progress.
# Eeschema: Schematic Editor # {#v6_eeschema}
This section applies to the source code for the Eeschema schematic editor.
## Coherent SCHEMATIC Object ## {#v6_sch_object}
**Goal:**
Clean up the code related to the schematic object(s) into a coherent object for
managing and manipulating the schematic that can be used by third party tools
and Python scripting.
**Task:**
- Move handling of root sheet object to SCHEMATIC object.
- Move SCH_SCREENS code into SCH_OBJECT.
- Build and maintain schematic hierarchy in SCHEMATIC object rather than
recreating on the fly every time the hierarchical information is required.
- Optionally build and maintain netlist during editing for extended editing
features.
- Add any missing functionality to the SCHEMATIC object.
**Dependencies:**
- None
**Status:**
- In progress.
## Implement Sweet (S-Expression) Symbol Libraries ## {#v6_sch_sweet}
**Goal:**
Make symbol library design more robust and feature rich. Use s-expressions
to make component library files more readable.
**Task:**
- Use sweet component file format for component libraries.
**Dependencies:**
- None
**Status:**
- Initial SWEET library file format document written.
## S-Expression File Format ## {#v6_sch_sexpr}
**Goal:**
Make schematic file format more readable, add new features, and take advantage
of the s-expression parser and formatter capability used in Pcbnew.
**Task:**
- Finalize feature set and file format.
- Discuss the possibility of dropping the unit-less proposal temporarily to get
the s-expression file format and SWEET library format implemented without
completely rewriting Eeschema.
- Add new s-expression file format to plugin.
**Dependencies:**
- [S-expression file format](#v6_sch_sweet).
**Status:**
- File format document initial draft complete.
## Move Common Schematic Code into a Shared Object ## {#v6_sch_shared_object}
**Goal:**
@@ -93,37 +167,22 @@ Improve the coverage and usability of the electrical rules checker (ERC).
**Status:**
- No progress.
## Implement GAL and New Tool Framework ## {#v6_sch_gal}
**Goal:**
Implement the GAL and the tool framework used by Pcbnew in Eechema to
provide advanced graphics and tool capabilities.
**Task:**
- Implement graphics abstraction layer along side current legacy rendering
framework.
**Dependencies:**
- None
**Status:**
- Initial Discussion..
## Port Editing Tools ## {#v6_sch_tool_framework}
## Port Editing Tools to New Tool Framework ## {#v6_sch_tool_framework}
**Goal:**
Convert all editing tool to new tool framework.
-**Task:**
**Task:**
- Rewrite existing editing tools using the new tool framework.
- Add new capabilities supported by the new tool framework to existing
editing tools.
- Remove legacy tool framework.
-**Dependencies:**
- [GAL and new tool framework port](#v6_sch_gal).
**Dependencies:**
- None.
-**Status:**
- Initial Discussion..
**Status:**
- Schematic editor complete.
## Net Highlighting ## {#v6_sch_net_highlight}
**Goal:**
@@ -134,28 +193,11 @@ Highlight wires, buses, and junctions when corresponding net in Pcbnew is select
- Implement highlight algorithm for net objects.
- Highlight objects connected to net selected in Pcbnew.
**Dependencies:**
- [GAL and new tool framework port, maybe](#v6_sch_gal).
**Status:**
- No progress.
## Component Library Editor Improvements ## {#lib_editor_usability}
**Goal:**
Make editing components with multiple units and/or alternate graphical
representations easier.
**Task:**
- Determine usability improvements in the library editor for components with
multiple units and/or alternate graphical representations.
- Implement said usability improvements.
**Dependencies:**
- None.
**Status:**
- No progress.
- Complete.
## Allow Use of System Fonts ## {#v6_sch_sys_fonts}
**Goal:**
@@ -170,33 +212,112 @@ for schematic text.
- Add support for selecting text object fonts.
**Dependencies:**
- [S-expression schematic file format](#sch_sexpr).
- [S-expression schematic file format](#v6_sch_sexpr).
**Status:**
- No progress.
## Symbol and Netlist Attributes ## {#v6_netlist_attributes}
**Goal:**
Provide a method of passing information to other tools via the net list.
**Task:**
- Add virtual components and attributes to netlist to define properties that
can be used by other tools besides the board editor.
- Attributes (properties) are automatically included as part of the new file
format.
**Dependencies:**
- [S-expression schematic file format](#v6_sch_sexpr).
**Status:**
- No progress.
## Orthogonal Wire Drag ## {#v6_orthogonal_drag}
**Goal:**
Keep wires and buses orthogonal when dragging a symbol.
**Task:**
- Add code to new tool framework to allow for orthogonal dragging of symbols.
**Dependencies:**
- [New tool framework](#v6_sch_tool_framework).
**Status:**
- No progress.
## Custom Wire and Bus Attributes ## {#v6_sch_bus_wire_attr}
**Goal:**
Allow for wires and buses to have different widths, colors, and line types.
**Task:**
- Add code to support custom wire and bus attributes.
- Add user interface element to support changing wire and bus attributes.
**Dependencies:**
- [S-Expression File Format](#v6_sch_sexpr).
**Status:**
- No progress.
## Connectivity Improvements ## {#v6_sch_connectivity}
**Goal:**
Support structured buses, real time netlist calculations, and other
connectivity improvements.
**Task:**
- Keep netlist up to date real time.
- Add support for structured bus definitions.
- Possible real time ERC checking.
**Dependencies:**
- None.
**Status:**
- Real time netlist and structured bus support complete.
## ERC Improvements ## {#v6_sch_erc}
**Goal:**
Improve ERC test coverage and other ERC usability features.
**Task:**
- Add missing ERC tests to improve coverage.
- Save ERC settings in project file.
- Add mechanism to allow import and export of ERC settings.
- ERC user interface improvements.
**Dependencies:**
- None.
**Status:**
- Preliminary specification draft complete.
## Python Support ## {#v6_sch_python}
**Goal:**
SWIG all schematic low level objects and coherent schematic object to
provide Python interface for manipulating schematic objects.
**Task:**-
- Create SWIG wrappers for all low level schematic, symbol library, and
coherent schematic object code.
- Add Python interpreter launcher.
**Dependencies:**
- [Coherent Schematic Object](#v6_sch_object).
**Status:**
- No Progress.
# CvPcb: Footprint Association Tool # {#v6_cvpcb}
This section covers the source code of the footprint assignment tool CvPcb.
## Improved Footprint Search Tool ## {#v6_cvpcb_search}
**Goal:**
Provide advanced search features such as wild card and regular expression
searches using the type as you go feature of the current search dialog.
**Task:**
- Add code for wild card and regular expression pattern matching to search
container objects.
- Add search dialog to CvPcb to search container of footprint names.
**Dependencies:**
- [Search Tree Control](#v6_re_search_control)
**Status:**
- Pattern matching added to search container objects.
# Pcbnew: Circuit Board Editor # {#v6_pcbnew}
This section covers the source code of the board editing application Pcbnew.
@@ -208,14 +329,45 @@ This section covers the source code of the board editing application Pcbnew.
Add finishing touches to push and shove router.
**Task:**
- Microwave tools to be added as parametrized shapes generated by Python
- Delete and backspace in idle mode
- Differential pair clearance fixes.
- Differential pair optimizer improvements (recognize differential pairs)
- Persistent differential pair gap/width setting.
- Walk around in drag mode.
- Optimize trace being dragged too. (currently no optimization)
- Auto-finish traces (if time permits)
- Additional optimization pass for spring back algorithm using area-minimization
strategy. (improves tightness of routing)
- Restrict optimization area to view port (if user wants to)
- Support 45 degree tuning meanders.
- Respect trace/via locking!
- Keep out zone support.
- Microwave tools to be added as parameterized shapes generated by Python
scripts.
- BGA fan out support.
- Drag footprints with traces connected.
**Dependencies:**
- None.
**Status:**
- In progress.
## Selection Filtering ## {#v6_pcb_selection_filtering}
**Goal:**
Make the selection tool easier for the user to determine which object(s) are
being selected by filtering.
**Task:**
- Provide filtered object selection by adding a third tab to the layer manager
or possibly some other UI element to provide filtered selection options.
**Dependencies:**
- None
**Status:**
- None
- In progress.
## Design Rule Check (DRC) Improvements. ## {#v6_drc_improvements}
**Goal:**
@@ -223,7 +375,6 @@ Add finishing touches to push and shove router.
Create additional DRC tests for improved error checking.
**Task:**
- Replace geometry code with [unified geometry library](#v6_geometry_lib).
- Remove floating point code from clearance calculations to prevent rounding
errors.
- Add checks for component, silk screen, and mask clearances.
@@ -232,7 +383,7 @@ Create additional DRC tests for improved error checking.
- Add option for saving and loading DRC options.
**Dependencies:**
- [Unified geometry library.](#v6_geometry_lib)
- [Constraint Management System](#v6_pcb_constraint).
**Progress:**
- In progress.
@@ -273,7 +424,7 @@ does not have to do it in Eeschema and re-import the net list.
- Add support to handle net label back annotation changes.
**Dependencies:**
- None
- [S-Expression File Format](#v6_sch_sexpr).
**Status:**
- No progress.
@@ -292,7 +443,7 @@ Add support for keepout zones on boards and footprints.
- [DRC Improvements.](#v6_drc_improvements)
**Progress:**
- Planning
- In progress.
## Clipboard Support ## {#v6_fp_edit_clipboard}
**Goal:**
@@ -307,7 +458,7 @@ Provide clipboard cut and paste for footprints.
- None
**Status:**
- No progress.
- Complete.
## Net Highlighting ## {#v6_pcb_net_highlight}
**Goal:**
@@ -323,7 +474,7 @@ Highlight rats nest links and/or traces when corresponding net in Eeschema is se
- None.
**Status:**
- No progress.
- Complete.
## Hatched Zone Filling ## {#v6_pcb_hatched_zones}
**Goal:**
@@ -339,7 +490,7 @@ with hatching.
- None.
**Status:**
- No progress.
- Complete.
## Board Stack Up Impedance Calculator ## {#v6_pcb_impedance_calc}
**Goal:**
@@ -354,7 +505,7 @@ Maybe this should be included in the PCB calculator application.
- None.
**Status:**
- No progress.
- In progress.
## Net Class Improvements ## {#v6_pcb_net_class_improvements}
**Goal:**
@@ -378,9 +529,10 @@ Add support for route impedance, color selection, etc in net class object.
## Ratsnest Improvements ## {#v6_pcb_ratsnest_improvements}
**Goal:**
Add support for per net color and visibility settings.
Add support for curved rats and per net color and visibility settings.
**Task:**
- Implement rat curving to minimize overlapped rats.
- Implement UI code to configure ratsnest color and visibility.
- Update ratsnest code to handle per net color and visibility.
@@ -388,23 +540,312 @@ Add support for per net color and visibility settings.
- None.
**Status:**
- No progress.
- Curved rat support complete.
# GerbView: Gerber File Viewer # {#v6_gerbview}
This section covers the source code for the GerbView gerber file viewer.
## Graphics Abstraction Layer ## {#v6_gerbview_gal}
## DXF Improvements ## {#v6_pcb_dxf_import}
**Goal:**
Graphics rendering unification.
- Allow for anchor point setting and layer mapping support on DXF import and
export multiple board layers to a single DXF file.
**Task:**
- Port graphics rendering layer to GAL.
- Provide method to select DXF import anchor point.
- Add user interface to allow mapping DXF layers to board layers.
- Modify DXF plotting to export multiple layers to a single file.
**Dependencies:**
- None.
**Status:**
- No progress.
## Improve Dimension Tool ## {#v6_pcb_dim_tool}
**Goal:**
Make dimensions link to objects and change when objects are modified and add
basic mechanical constraints.
**Task:**
- Add code to link dimension to objects.
- Add basic mechanical constraints like linear distance and angle.
**Dependencies:**
- None.
**Status:**
- In progress.
## Constraint Management System ## {#v6_pcb_constraint}
**Goal:**
Implement full featured constraint management system to allow for complex
board constraints instead of netclass only constraints.
**Task:**
- Write specification to define requirement of new constraint system.
- Implement new constraint system including file format changes.
- Allow constraints to be defined in schematic editor and passed to board
editor via netlist.
- Update netlist file format to support constraints.
- Update DRC to test new constraints.
**Dependencies:**
- None.
**Status**
- No Progress.
## Append Board in Project Mode ## {#v6_pcb_append}
**Goal:**
Allow appending to the board when running Pcbnew in the project mode.
**Task:**
- Enable append board feature in project mode.
- Extend copy/paste feature to introduce paste special tool to add prefix
and/or suffix to nets of pasted/appended objects.
**Dependencies:**
- None.
**Status:**
- No progress.
## Grid and Auxiliary Origin Improvements ## {#v6_pcb_origin}
**Goal:**
Allow reset grid and auxiliary origin without hotkey only. Add support to
make all coordinates relative to the plot origin.
**Task:**
- Add reset grid and auxiliary origin commands to menu entry and/or toolbar
button.
- Add code to dialogs to allow coordinates to be specified relative to the
plot origin.
**Dependencies:**
- None.
**Status:**
- Relative coordinate entry in progress.
## Addition Mechanical Layers ## {#v6_pcb_mech_layers}
**Goal:**
Add more mechanical layers.
**Task:**
- Add remaining mechanical layers for a total of 32.
**Dependencies:**
- None.
**Status:**
- No progress.
## Layer Renaming ## {#v6_pcb_layer_rename}
**Goal:**
Allow mechanical layers to be renamed.
**Task:**
- Quote layer names in file format to support any printable characters in
layer names.
- Add user interface to allow mechanical layers to be renamed.
**Dependencies:**
- None.
**Status:**
- Quoted layer names complete.
## Stable Python API ## {#v6_pcb_python_api}
**Goal:**
Create a Python wrapper to hide the SWIG generated API.
**Task:**
- Document new Python API.
- Write Python API.
**Dependencies:**
- None.
**Status:**
- Initial technical specification drafted.
## Track Refining ## {#v6_pcb_track_refine}
**Goal:**
Add support for teardrops and automatically updating length tuning
meandering.
**Task:**
- Draft specification for track refining.
- Implement support for teardrops.
- Implement support for changing tuned length meandering.
**Dependencies:**
- None.
**Status:**
- Initial technical specification drafted.
## Groups and Rooms ## {#v6_pcb_groups}
**Goal:**
Support grouping board objects into reusable snippets.
**Task:**
- Write design specification.
- Update board file format to support grouped objects.
- Add user interface code to support grouped board objects.
**Dependencies:**
- None.
**Status:**
- Initial technical specification drafted.
## Pad Stack Support ## {#v6_pcb_padstack}
**Goal:**
Add padstack support.
**Task:**
- Write pad stack design specification.
- Update board file format to support pad stacks.
- Add user interface code to support designing pad stack objects.
- Update push and shove router to handle pad stacks.
- Update zone filling to handle pad stacks.
- Update DRC to handle pad stacks.
**Dependencies:**
- None.
**Status:**
- Initial technical specification drafted.
## Net Ties ## {#v6_pcb_net_ties}
**Goal:**
Add support for net ties.
**Task:**
- Write net tie design specification.
- Implement board file support for net ties.
- Implement schematic file support for net ties.
- Update ERC and DRC to handle net ties.
- Update netlist to pass net tie information from schematic to board.
- Add user interface support for net ties to editors.
**Dependencies:**
- [S-Expression File Format](#v6_sch_sexpr).
**Status:**
- No Progress.
## Anti-pad Improvements ## {#v6_pcb_anti_pad}
**Goal:**
Use anti-pads on vias and through hold pads on internal layers as required.
**Task:**-
- Revise zone filling algorithm to create anti-pad on internal layers.
**Dependencies:**
- None.
**Status:**
- No Progress.
## Thermal Relief Improvements ## {#v6_pcb_thermal_relief}
**Goal:**
Allow for custom thermal reliefs in zones and custom pad shapes.
**Task:**-
- Write technical specification to define requirements, alternate unions,
knockouts, union spokes, etc.
- Revise zone filling thermal relief support to handle new requirements.
- Update board file format for new thermal relief requirements.
- Add user interface support for thermal relief definitions.
**Dependencies:**
- None.
**Status:**
- No Progress.
## Merge KiCad2Step ## {#v6_pcb_kicad2step}
**Goal:**
Merge export to STEP file code from KiCad2Step so that conversion does
not run in a separate process.
**Task:**-
- Merge KiCad2Step code into Pcbnew code base.
- Remove unused parser code.
**Dependencies:**
- None.
**Status:**
- No Progress.
## 3D Model Improvements ## {#v6_pcb_3d_model_opacity}
**Goal:**
Add opacity to 3D model support and convert from path look up to library
table to access 3D models.
**Task:**-
- Add opacity support to footprint library file format.
- Add library table 3D model support to footprint library file format.
- Create remapping utility to map from path look up to library table look up.
- Add user interface support for 3D model opacity.
- Add user interface support accessing 3D models via library table.
**Dependencies:**
- None.
**Status:**
- No Progress.
## IPC-2581 Support ## {#v6_pcb_ipc_2581}
**Goal:**
Add support for exporting to and importing from IPC-2581.
**Task:**-
- Add IPC-2581 export code.
- Add IPC-2581 import code.
**Dependencies:**
- None.
**Status:**
- No Progress.
## Curved Trace Support ## {#v6_pcb}
**Goal:**
Add curved trace support to the board editor.
**Task:**-
- Add curved trace support to track object code.
- Add support to board file format for curved traces.
- Update zone fill algorithm to support curved fills.
- Update router to support curved traces.
- Update DRC to handle curved traces and fills.
**Dependencies:**
- None.
**Status:**
- No Progress.
# GerbView: Gerber File Viewer # {#v6_gerbview}
This section covers the source code for the GerbView gerber file viewer.
+13 -311
View File
@@ -3,14 +3,16 @@
This document is the KiCad Developer's road map document. It is a living
document that should be maintained as the project progresses. The goal of
this document is to provide an overview for developers of where the project
is headed to prevent resource conflicts and endless rehashing of previously
discussed topics. It is broken into sections for each major component of
the KiCad source code and documentation. It defines tasks that developers
an use to contribute to the project and provides updated status information.
Tasks should define clear objective and avoid vague generalizations so that
a new developer can complete the task. It is not a place for developers to
add their own personal wish list It should only be updated with approval
of the project manager after discussion with the lead developers.
is headed beyond the current development cycle road map (currently
[version 6](./v6_road_map.html) to prevent resource conflicts and endless
rehashing of previously discussed topics. It is broken into sections for
each major component of the KiCad source code and documentation. It defines
tasks that developers an use to contribute to the project and provides updated
status information. Tasks should define clear objectives and avoid vague
generalizations so that a new developer can complete the task. It is not a
place for developers to add their own personal wish list It should only be
updated with approval of the project manager after discussion with the lead
developers.
Each entry in the road map is made up of four sections. The goal should
be a brief description of the what the road map entry will accomplish. The
@@ -34,59 +36,16 @@ This section defines the tasks that affect all or most of KiCad or do not
fit under as specific part of the code such as the board editor or the
schematic editor.
## User Interface Modernization ## {#wxaui}
**Goal:**
Give KiCad a more modern user interface with dockable tool bars and windows.
Create perspectives to allow users to arrange dockable windows as they prefer.
**Task:**
- Take advantage of the advanced UI features in wxAui such as detaching and
hiding.
- Study ergonomics of various commercial/proprietary PCB applications (when
in doubt about any particular UI solution, check how it has been done in a
certain proprietary app that is very popular among OSHW folks and do exactly
opposite).
- Clean up menu structure. Menus must allow access to all features of the
program in a clear and logical way. Currently some functions of Pcbnew are
accessible only through tool bars
- Redesign dialogs, make sure they are following same style rules.
- Check quality of translations. Either fix or remove bad quality translations.
- Develop a global shortcut manager that allows the user assign arbitrary
shortcuts for any tool or action.
**Dependencies:**
- [wxWidgets 3](#wxwidgets3)
**Status:**
- No progress.
# Build Tools # {#build_tools}
This section covers build tools for both the KiCad source as well as the
custom dependency builds required to build KiCad.
# Common Library # {#common_lib}
This section covers the source code shared between all of the KiCad
applications
## Unified Rendering Framework ## {#unified_rendering}
**Goal:**
Provide a single framework for developing new tools. Port existing tools
to the new framework and remove the legacy framework tools.
**Task:**
- Port wxDC to GAL or get Cairo rendering to nearly the performance of the
current wxDC rendering so that we have a single framework to develop new
tools and we can continue to support systems that don't have a complete
OpenGL stack.
**Dependencies**
- [Tool framework](http://www.ohwr.org/projects/cern-kicad/wiki/WorkPackages)
**Status**
- No progress
# KiCad: Application Launcher # {#kicad}
This section applies to the source code for the KiCad application launcher.
@@ -95,277 +54,19 @@ This section applies to the source code for the KiCad application launcher.
# Eeschema: Schematic Editor # {#eeschema}
This section applies to the source code for the Eeschema schematic editor.
## Graphics Abstraction Layer Conversion ## {#sch_gal}
**Goal:**
Take advantage of advanced graphics rendering in Eeschema.
**Task:**
- Port graphics rendering to GAL.
**Dependencies:**
- None
**Status:**
- No progress.
## Port Editing Tools ## {#sch_tool_framework}
**Goal:**
Use standard tool framework across all applications.
**Task:**
- Rewrite editing tools using the new tool framework.
**Dependencies:**
- [GAL port](#sch_gal).
**Status:**
- No progress.
## Allow Use of System Fonts ## {#sch_sys_fonts}
**Goal:**
Currently the schematic editor uses the stroke drawn fonts which aren't really
necessary for accurated printing of schematics. Allow the use of system fonts
for schematic text.
**Task:**
- Determine which library for font handling makes the most sense, wxWidgets or
freetype.
- Add support for selecting text object fonts.
**Dependencies:**
- [S-expression schematic file format](#sch_sexpr).
**Status:**
- No progress.
# CvPcb: Footprint Association Tool # {#cvpcb}
This section covers the source code of the footprint assignment tool CvPcb.
# Pcbnew: Circuit Board Editor # {#pcbnew}
This section covers the source code of the board editing application Pcbnew.
## Model Export ## {#model_export}
**Goal:**
Provide improved solid modeling export to the file formats available in
OpenCascade.
**Task:**
- Add STEP 3D modeling capability.
- Add IGES 3D modeling capability.
- Add any other file formats supported by OpenCascade that make sense for
KiCad.
**Dependencies:**
- None
**Status:**
- None
## Linked Objects ## {#pcb_linked_objects}
**Goal:**
Provide a way to allow external objects such as footprints to be externally
linked in the board file so that changes in the footprint are automatically
updated. This will all a one to many object relationship which can pave the
way for real board modules.
**Task:**
- Add externally and internally linked objects to the file format to allow for
footprints and/or other board objects to be shared (one to many relationship)
instead of only supporting embedded objects (one to one relationship) that
can only be edited in place.
**Dependencies:**
- None.
**Status:**
- No progress.
## Pin and Part Swapping ## {#pcb_drc}
**Goal:**
Allow Pcbnew to perform pin and/or part swapping during layout so the user
does not have to do it in Eeschema and re-import the net list.
**Task:**
- Provide forward and back annotation between the schematic and board editors.
- Define netlist file format changes required to handle pin/part swapping.
- Update netlist file formatter and parser to handle file format changes.
- Develop a netlist comparison engine that will produce a netlist diff that
can be passed between the schematic and board editors.
- Create pin/part swap dialog to manipulate swappable pins and parts.
- Add support to handle net label back annotation changes.
**Dependencies:**
- [S-expression schematic file format](#sch_sexpr).
- [Convert to a single process application](#kiway).
**Status:**
- No progress.
## Clipboard Support ## {#fp_edit_clipboard}
**Goal:**
Provide clipboard cut and paste for footprints..
**Task:**
- Clipboard cut and paste to and from clipboard of footprints in footprint
editor.
**Dependencies:**
- None
**Status:**
- No progress.
## Segment End Point Snapping. ## {#segment_snapping}
**Goal:**
It is not uncommon for board edge segment end points to inadvertently not
be closed causing issues for the 3D viewer and exporting to different file
formats due the board outline not being a fully enclosed polygon. This
feature would add segment end snapping support to allow the board outline
to be fully enclosed. This feature would only need to be supported by the
GAL rendering.
**Tasks**
- Mark board edge segment ends with a drag indicator to make it visible to the
user that the segment end does not have an endpoint with any other board edge
segment.
- Allow the user to smap the unconnected segment end to the nearest segment end
point.
- Automatically connect unconnected segments with and additional segment when
opening the 3D viewer or exporting the board to another format. Warn the
user that an addition segment has be added and should be verified.
**Dependencies:**
- None
**Progress:**
- Initial discussion.
## Keepout Zones. ## {#keepout_zones}
**Goal:**
Add support for keepout zones on boards and footprints.
**Task:**
- Add keepout support to zone classes.
- Add keepout zone support to board editor.
- Add keepout zone support to library editor.
**Dependencies:**
- [DRC Improvements.](#drc_improvements)
**Progress:**
- Planning
## Net Highlighting ## {#pcb_net_highlight}
**Goal:**
Highlight rats nest links and/or traces when corresponding net in Eeschema is selected.
**Task:**
- Add communications link to handle net selection from Eeschema.
- Implement highlight algorithm for objects connected to the selected net.
- Highlight objects connected to net selected in Eeschema
**Dependencies:**
- None.
**Status:**
- No progress.
## Hatched Zone Filling ## {#pcb_hatched_zones}
**Goal:**
Currently Pcbnew only supports solid zone files. Add option to fill zones
with hatching.
**Task:**
- Determine zone fill method, required filling code, and file format requirements.
- Add hatch option and hatch configuration to zone dialog.
**Dependencies:**
- None.
**Status:**
- No progress.
## Board Stack Up Impedance Calculator ## {#pcb_impedance_calc}
**Goal:**
Provide a calculator to compute trace impedances using a full board stackup.
Maybe this should be included in the PCB calculator application.
**Task:**
- Design a trace impedance calculator that includes full board stackup.
**Dependencies:**
- None.
**Status:**
- No progress.
## Net Class Improvements ## {#pcb_net_class_improvements}
**Goal:**
Add support for route impedance, color selection, etc in net class object.
**Task:**
- Determine parameters to add to net class object.
- Implement file parser and formatter changes to support net class object
changes.
- Implement tools to work with new net class parameters.
- Create UI elements to configure new net class parameters.
- Update the render tab UI code to view traces by net class.
**Dependencies:**
- None.
**Status:**
- No progress.
## Ratsnest Improvements ## {#pcb_ratsnest_improvements}
**Goal:**
Add support for per net color and visibility settings.
**Task:**
- Implement UI code to configure ratsnest color and visibility.
- Update ratsnest code to handle per net color and visibility.
**Dependencies:**
- None.
**Status:**
- No progress.
# GerbView: Gerber File Viewer # {#gerbview}
This section covers the source code for the GerbView gerber file viewer.
## Graphics Abstraction Layer ## {#gerbview_gal}
**Goal:**
Graphics rendering unification.
**Task:**
- Port graphics rendering layer to GAL.
**Dependencies:**
- None.
**Status**
- No progress.
# Documentation # {#documentation}
This section defines the tasks for both the user and developer documentation.
@@ -380,6 +81,7 @@ This section defines the tasks for both the user and developer documentation.
**Status:**
- No progress.
# Unit Testing # {#unittest}
**Goal:**
+11 -11
View File
@@ -105,18 +105,18 @@ The major parts of tool's implementation are the functions used by the
when the GAL canvas is switched, and also just after tool registration.
Any resource claimed from the GAL view or the model must be released
in this function, as they could become invalid.
* `SetTransitions()` function, which maps tool actions to functions
* `setTransitions()` function, which maps tool actions to functions
within the tool class.
* One or more functions to call when actions are invoked. Many actions
can invoke the same function if desired. The functions have the
following signature:
* int TOOL_CLASS::FunctionName( const TOOL_EVENT& aEvent )
* Returning 0 means success.
* Returning 0 means success.
* These functions are called by the `TOOL_MANAGER` in case an associated
event arrives (association is created with TOOL_INTERACTIVE::Go() function).
* These can generally be private, as they are not called directly
by any other code, but are invoked by the tool manager's coroutine
framework according to the `SetTransitions()` map.
framework according to the `setTransitions()` map.
### Interactive actions {#interactive-actions}
@@ -171,7 +171,7 @@ provide their own context menu. Tools that are called only from other
tools' interactive modes add their menu items to those tools' menus.
To use a `TOOL_MENU` in a top level tool, simply add one as a member
and initialise it with a reference to the tools at construction time:
and initialize it with a reference to the tools at construction time:
TOOL_NAME: public PCB_TOOL
{
@@ -215,7 +215,7 @@ The procedure of a commit is:
unless you are going to abort the commit.
* When removing an item, call `Remove( item )`. You should not delete the
removed item, it will be stored in the undo buffer.
* Finalise the commit with `Push( "Description" )`. If you performed
* Finalize the commit with `Push( "Description" )`. If you performed
no modifications, additions or removals, this is a no-op, so you
don't need to check if you made any changes before pushing.
@@ -284,7 +284,7 @@ In `pcbnew/tools/pcb_actions.h`, we add the following to the
static TOOL_ACTION uselessFixedCircle;
Definitions of actions generally happen in the .cpp of the relevant tool.
It doesn't actually matter where the defintion occurs (the declaration
It doesn't actually matter where the definition occurs (the declaration
is enough to use the action), as long as it's linked in the end.
Similar tools should always be defined together.
@@ -337,11 +337,11 @@ the following class:
///> React to model/view changes
void Reset( RESET_REASON aReason ) override;
///> Basic initalization
///> Basic initialization
bool Init() override;
///> Bind handlers to corresponding TOOL_ACTIONs
void SetTransitions() override;
void setTransitions() override;
private:
///> 'Move selected left' interactive tool
@@ -392,7 +392,7 @@ Below you will find the contents of useless_tool.cpp:
/*
* Tool-specific action defintions
* Tool-specific action definitions
*/
TOOL_ACTION PCB_ACTIONS::uselessMoveItemLeft(
"pcbnew.UselessTool.MoveItemLeft",
@@ -443,7 +443,7 @@ Below you will find the contents of useless_tool.cpp:
void USELESS_TOOL::moveLeftInt()
{
// we will call actions on the selection tool to get the current
// selection. The selection tools will handle item deisambiguation
// selection. The selection tools will handle item disambiguation
SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
assert( selectionTool );
@@ -535,7 +535,7 @@ Below you will find the contents of useless_tool.cpp:
}
void USELESS_TOOL::SetTransitions()
void USELESS_TOOL::setTransitions()
{
Go( &USELESS_TOOL::fixedCircle, PCB_ACTIONS::uselessFixedCircle.MakeEvent() );
Go( &USELESS_TOOL::moveLeft, PCB_ACTIONS::uselessMoveItemLeft.MakeEvent() );
+255
View File
@@ -0,0 +1,255 @@
Creative Commons Attribution-ShareAlike 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree to
be bound by the terms and conditions of this Creative Commons
Attribution-ShareAlike 4.0 International Public License ("Public License").
To the extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of these
terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the Licensed
Material available under these terms and conditions.
Section 1 Definitions.
a. Adapted Material means material subject to Copyright and Similar Rights
that is derived from or based upon the Licensed Material and in which the
Licensed Material is translated, altered, arranged, transformed, or
otherwise modified in a manner requiring permission under the Copyright
and Similar Rights held by the Licensor. For purposes of this Public
License, where the Licensed Material is a musical work, performance, or
sound recording, Adapted Material is always produced where the Licensed
Material is synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright and
Similar Rights in Your contributions to Adapted Material in accordance
with the terms and conditions of this Public License.
c. BY-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative Commons as
essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights closely
related to copyright including, without limitation, performance,
broadcast, sound recording, and Sui Generis Database Rights, without
regard to how the rights are labeled or categorized. For purposes of this
Public License, the rights specified in Section 2(b)(1)-(2) are not
Copyright and Similar Rights.
e. Effective Technological Measures means those measures that, in the absence
of proper authority, may not be circumvented under laws fulfilling
obligations under Article 11 of the WIPO Copyright Treaty adopted on
December 20, 1996, and/or similar international agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or any other
exception or limitation to Copyright and Similar Rights that applies to
Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name of a
Creative Commons Public License. The License Elements of this Public
License are Attribution and ShareAlike.
h. Licensed Material means the artistic or literary work, database, or other
material to which the Licensor applied this Public License.
i. Licensed Rights means the rights granted to You subject to the terms and
conditions of this Public License, which are limited to all Copyright and
Similar Rights that apply to Your use of the Licensed Material and that
the Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights under this
Public License.
k. Share means to provide material to the public by any means or process thati
requires permission under the Licensed Rights, such as reproduction,
public display, public performance, distribution, dissemination,
communication, or importation, and to make material available to the
public including in ways that members of the public may access the
material from a place and at a time individually chosen by them.
l. Sui Generis Database Rights means rights other than copyright resulting
from Directive 96/9/EC of the European Parliament and of the Council of 11
March 1996 on the legal protection of databases, as amended and/or
succeeded, as well as other essentially equivalent rights anywhere in the
world.
m. You means the individual or entity exercising the Licensed Rights under
this Public License. Your has a corresponding meaning.
Section 2 Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License, the
Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to exercise the
Licensed Rights in the Licensed Material to:
A. reproduce and Share the Licensed Material, in whole or in part; and
B. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions
and Limitations apply to Your use, this Public License does not apply,
and you do not need to comply with its terms and conditions.
3. Term. The term of this Public License is specified in Section 6(a).
4. Media and formats; technical modifications allowed. The Licensor
authorizes You to exercise the Licensed Rights in all media and formats
whether now known or hereafter created, and to make technical
modifications necessary to do so. The Licensor waives and/or agrees not
to assert any right or authority to forbid You from making technical
modifications necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective Technological
Measures. For purposes of this Public License, simply making
modifications authorized by this Section 2(a)(4) never produces Adapted
Material.
5. Downstream recipients.
A. Offer from the Licensor Licensed Material. Every recipient of the
Licensed Material automatically receives an offer from the Licensor
to exercise the Licensed Rights under the terms and conditions of
this Public License.
B. Additional offer from the Licensor Adapted Material. Every
recipient of Adapted Material from You automatically receives an
offer from the Licensor to exercise the Licensed Rights in the
Adapted Material under the conditions of the Adapters License You
apply.
C. No downstream restrictions. You may not offer or impose any
additional or different terms or conditions on, or apply any
Effective Technological Measures to, the Licensed Material if doing
so restricts exercise of the Licensed Rights by any recipient of
the Licensed Material.
6. No endorsement. Nothing in this Public License constitutes or may be
construed as permission to assert or imply that You are, or that Your
use of the Licensed Material is, connected with, or sponsored,
endorsed, or granted official status by, the Licensor or others
designated to receive attribution as provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not licensed under
this Public License, nor are publicity, privacy, and/or other similar
personality rights; however, to the extent possible, the Licensor
waives and/or agrees not to assert any such rights held by the Licensor
to the limited extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this Public License.
3. To the extent possible, the Licensor waives any right to collect
royalties from You for the exercise of the Licensed Rights, whether
directly or through a collecting society under any voluntary or
waivable statutory or compulsory licensing scheme. In all other cases
the Licensor expressly reserves any right to collect such royalties.
Section 3 License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified form), You
must:
A. retain the following if it is supplied by the Licensor with the
Licensed Material:
i. identification of the creator(s) of the Licensed Material and any
others designated to receive attribution, in any reasonable manner
requested by the Licensor (including by pseudonym if designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of warranties;
v. a URI or hyperlink to the Licensed Material to the extent
reasonably practicable;
B. indicate if You modified the Licensed Material and retain an
indication of any previous modifications; and
C. indicate the Licensed Material is licensed under this Public
License, and include the text of, or the URI or hyperlink to, this
Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable
manner based on the medium, means, and context in which You Share the
Licensed Material. For example, it may be reasonable to satisfy the
conditions by providing a URI or hyperlink to a resource that includes
the required information.
3. If requested by the Licensor, You must remove any of the information
required by Section 3(a)(1)(A) to the extent reasonably practicable.
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share Adapted
Material You produce, the following conditions also apply.
1. The Adapters License You apply must be a Creative Commons license with
the same License Elements, this version or later, or a BY-SA Compatible
License.
2. You must include the text of, or the URI or hyperlink to, the Adapter's
License You apply. You may satisfy this condition in any reasonable
manner based on the medium, means, and context in which You Share
Adapted Material.
3. You may not offer or impose any additional or different terms or
conditions on, or apply any Effective Technological Measures to,
Adapted Material that restrict exercise of the rights granted under the
Adapter's License You apply.
Section 4 Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to
Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to
extract, reuse, reproduce, and Share all or a substantial portion of the
contents of the database;
b. if You include all or a substantial portion of the database contents in a
database in which You have Sui Generis Database Rights, then the database
in which You have Sui Generis Database Rights (but not its individual
contents) is Adapted Material, including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share all or a
substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace
Your obligations under this Public License where the Licensed Rights include
other Copyright and Similar Rights.
Section 5 Disclaimer of Warranties and Limitation of Liability.
a. Unless otherwise separately undertaken by the Licensor, to the extent
possible, the Licensor offers the Licensed Material as-is and as-available,
and makes no representations or warranties of any kind concerning the
Licensed Material, whether express, implied, statutory, or other. This
includes, without limitation, warranties of title, merchantability, fitness
for a particular purpose, non-infringement, absence of latent or other
defects, accuracy, or the presence or absence of errors, whether or not
known or discoverable. Where disclaimers of warranties are not allowed in
full or in part, this disclaimer may not apply to You.
b. To the extent possible, in no event will the Licensor be liable to You on
any legal theory (including, without limitation, negligence) or otherwise
for any direct, special, indirect, incidental, consequential, punitive,
exemplary, or other losses, costs, expenses, or damages arising out of
this Public License or use of the Licensed Material, even if the Licensor
has been advised of the possibility of such losses, costs, expenses, or
damages. Where a limitation of liability is not allowed in full or in
part, this limitation may not apply to You.
c. The disclaimer of warranties and limitation of liability provided above
shall be interpreted in a manner that, to the extent possible, most
closely approximates an absolute disclaimer and waiver of all liability.
Section 6 Term and Termination.
a. This Public License applies for the term of the Copyright and Similar
Rights licensed here. However, if You fail to comply with this Public
License, then Your rights under this Public License terminate
automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided it is
cured within 30 days of Your discovery of the violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any right
the Licensor may have to seek remedies for Your violations of this Public
License.
c. For the avoidance of doubt, the Licensor may also offer the Licensed
Material under separate terms or conditions or stop distributing the
Licensed Material at any time; however, doing so will not terminate this
Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different terms or
conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the Licensed
Material not stated herein are separate from and independent of the terms
and conditions of this Public License.
Section 8 Interpretation.
a. For the avoidance of doubt, this Public License does not, and shall not
be interpreted to, reduce, limit, restrict, or impose conditions on any use
of the Licensed Material that could lawfully be made without permission
under this Public License.
b. To the extent possible, if any provision of this Public License is deemed
unenforceable, it shall be automatically reformed to the minimum extent
necessary to make it enforceable. If the provision cannot be reformed, it
shall be severed from this Public License without affecting the
enforceability of the remaining terms and conditions.
c. No term or condition of this Public License will be waived and no failure
to comply consented to unless expressly agreed to by the Licensor.
d. Nothing in this Public License constitutes or may be interpreted as a
limitation upon, or waiver of, any privileges and immunities that apply to
the Licensor or You, including from the legal processes of any jurisdiction
or authority.
+17
View File
@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+23 -19
View File
@@ -1,19 +1,23 @@
The majority of KiCad's source code is developed and distributed under the terms
of the GPLv3 or later. However, It does include some third-party code licensed
under AGPLv3 or later as well as sections licensed under the BOOST license v1.0
and portions licensed under the ISC license.
These licenses are compatible, but a combined works as is will be governed under
the terms of the AGPLv3 (or later). This includes any binary distribution of the
KiCad EDA suite by the KiCad project or any third party, e.g. Linux distributor.
You are free to use the *sources* under the terms of their respective licenses.
Licensed under AGPLv3 (or later):
- TTL [https://www.sintef.no/projectweb/geometry-toolkits/ttl/], sources in include/ttl/*
Licensed under BOOSTv1:
- libcontext [https://github.com/boostorg/context], sources in common/system/libcontext.cpp
Licensed under ISC:
- portions of code in include/geometry/polygon_triangulation.h
Licensed under GPLv3 (or later):
- All remaining code not listed above
The majority of KiCad's source code is developed and distributed under the terms
of the GPLv3 or later. However, It does include some third-party code licensed
under AGPLv3 or later as well as sections licensed under the BOOST license v1.0,
the ISC license and the MIT license.
These licenses are compatible, but a combined works as is will be governed under
the terms of the AGPLv3 (or later). This includes any binary distribution of the
KiCad EDA suite by the KiCad project or any third party, e.g. Linux distributor.
You are free to use the *sources* under the terms of their respective licenses.
Licensed under AGPLv3 (or later):
- TTL [https://www.sintef.no/projectweb/geometry-toolkits/ttl/], sources in include/ttl/*
Licensed under BOOSTv1:
- libcontext [https://github.com/boostorg/context], sources in common/system/libcontext.cpp
Licensed under ISC:
- portions of code in include/geometry/polygon_triangulation.h
Licensed under MIT:
- tinyspline_lib in dxflib_qcad/tinyspline_lib
Licensed under CC-BY-SA-4.0:
- All the demo files provided in demos/*
Licensed under GPLv3 (or later):
- All remaining code not listed above
+2 -2
View File
@@ -7,13 +7,13 @@ AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: NonAssignment
+3
View File
@@ -54,6 +54,9 @@ target_link_libraries( bitmap2component
)
if( APPLE )
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist @ONLY )
set_target_properties( bitmap2component PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)
@@ -17,17 +17,17 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string></string>
<string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key>
<string>Bitmap 2 Component</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string></string>
<string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
+1 -1
View File
@@ -450,7 +450,7 @@ void BM2CMP_FRAME::Binarize( double aThreshold )
auto alpha = m_Greyscale_Image.HasAlpha() ?
m_Greyscale_Image.GetAlpha( x, y ) : wxALPHA_OPAQUE;
if( pixin < threshold || alpha < alpha_thresh )
if( pixin < threshold && alpha > alpha_thresh )
pixout = 0;
else
pixout = 255;
-1
View File
@@ -155,7 +155,6 @@ int bitmap2component( potrace_bitmap_t* aPotrace_bitmap, FILE* aOutfile,
return 1;
}
printf("Step 1\n");
BITMAPCONV_INFO info;
info.m_PixmapWidth = aPotrace_bitmap->w;
info.m_PixmapHeight = aPotrace_bitmap->h; // the bitmap size in pixels
+14 -8
View File
@@ -8,14 +8,20 @@
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
0x61, 0x00, 0x00, 0x00, 0x60, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x63, 0x90, 0x92, 0x92, 0xfa,
0x0f, 0xc2, 0x0c, 0xe4, 0x02, 0xaa, 0x19, 0x20, 0x2e, 0x2e, 0x2e, 0x46, 0x91, 0x01, 0xd2, 0xd2,
0xd2, 0x97, 0xc9, 0x32, 0x04, 0x66, 0x00, 0x14, 0x5f, 0x97, 0x97, 0x97, 0x97, 0x24, 0xd7, 0x80,
0x4b, 0x64, 0x19, 0x02, 0x33, 0x40, 0x42, 0x42, 0x42, 0x94, 0x2c, 0x43, 0x90, 0x63, 0x01, 0x14,
0x06, 0xa0, 0xb0, 0x40, 0xf3, 0x16, 0x5e, 0x4c, 0x3d, 0x03, 0xd0, 0xbd, 0x20, 0x2a, 0x2a, 0x2a,
0x41, 0x76, 0x20, 0x12, 0xad, 0x19, 0x5b, 0x34, 0x92, 0xa4, 0x99, 0xaa, 0x09, 0x89, 0xe2, 0xa4,
0x3c, 0x60, 0xb9, 0x11, 0x00, 0xd8, 0xbd, 0x63, 0x3e, 0x86, 0xe5, 0x97, 0x0f, 0x00, 0x00, 0x00,
0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
0x61, 0x00, 0x00, 0x00, 0xb9, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x63, 0x60, 0x40, 0x03, 0x52,
0x52, 0x52, 0xff, 0x41, 0x98, 0x01, 0x0b, 0x10, 0x11, 0x11, 0xe1, 0x95, 0x94, 0x94, 0xdc, 0xca,
0x80, 0x0f, 0xe0, 0x32, 0x40, 0x5a, 0x5a, 0x5a, 0x06, 0x28, 0x7e, 0x1e, 0x97, 0xe1, 0x70, 0x1b,
0xb0, 0x19, 0x20, 0x23, 0x23, 0x63, 0x06, 0x14, 0x7b, 0x81, 0xcf, 0x75, 0x20, 0xc0, 0x08, 0xb4,
0x65, 0x2d, 0xba, 0x22, 0xa0, 0x93, 0x83, 0x80, 0xfc, 0xaf, 0x30, 0x71, 0x9c, 0x06, 0x00, 0x35,
0xd7, 0xa0, 0x2b, 0x02, 0xd2, 0x65, 0x40, 0xfc, 0x17, 0x2a, 0x36, 0x0b, 0xa7, 0x01, 0x40, 0x41,
0x37, 0x20, 0xfe, 0x83, 0xa4, 0x18, 0x84, 0xa7, 0x42, 0xe9, 0x7f, 0x40, 0xdc, 0x80, 0x33, 0x7c,
0x80, 0xfe, 0x53, 0x05, 0x0a, 0xbe, 0x07, 0x49, 0x00, 0x9d, 0x5b, 0x85, 0xec, 0x0a, 0x20, 0xfe,
0x0e, 0xc4, 0x11, 0x78, 0x03, 0x18, 0x28, 0x70, 0x05, 0x24, 0x08, 0xf2, 0x3f, 0x28, 0x1c, 0xd0,
0x0c, 0x20, 0x88, 0x29, 0x37, 0x40, 0x5c, 0x5c, 0x5c, 0x11, 0xc8, 0x78, 0x03, 0x35, 0xa4, 0x9a,
0x50, 0x54, 0xe1, 0x4a, 0x3c, 0xae, 0xe8, 0x81, 0xc8, 0x40, 0x2a, 0x40, 0xb6, 0x9d, 0x2c, 0x03,
0x70, 0x25, 0x24, 0x92, 0x00, 0xae, 0xa4, 0x4c, 0x6a, 0x78, 0xd0, 0xd7, 0x00, 0x00, 0xe0, 0x1c,
0x80, 0xeb, 0x37, 0x41, 0x6c, 0xd9, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
0x60, 0x82,
};
const BITMAP_OPAQUE pinshape_clock_fall_xpm[1] = {{ png, sizeof( png ), "pinshape_clock_fall_xpm" }};
+17 -24
View File
@@ -7,30 +7,23 @@
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x01, 0x4b, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed, 0xd5, 0xbf, 0x4b, 0x02,
0x61, 0x00, 0x87, 0xf1, 0x77, 0x51, 0x9c, 0x0c, 0x91, 0xa0, 0x25, 0x30, 0xc2, 0xa0, 0x6c, 0x15,
0x22, 0xa4, 0xa8, 0x21, 0xa7, 0xa2, 0x21, 0xb2, 0x74, 0x09, 0x49, 0x73, 0x13, 0x13, 0xd4, 0x6a,
0x13, 0x5c, 0x0c, 0x44, 0xa4, 0x1f, 0xc4, 0x21, 0x35, 0xa4, 0x21, 0x18, 0x05, 0x81, 0x24, 0x38,
0x35, 0x34, 0x49, 0x4b, 0xfd, 0x07, 0x81, 0xe0, 0x12, 0xb7, 0x1c, 0x0d, 0x05, 0x4f, 0xc3, 0x91,
0x60, 0x5a, 0x17, 0x62, 0x11, 0xe1, 0xc1, 0x03, 0x77, 0xf0, 0x85, 0x0f, 0xef, 0xbb, 0x9c, 0xa8,
0xd5, 0x6a, 0xfc, 0x46, 0xa2, 0x07, 0xfd, 0x7d, 0x48, 0x96, 0x65, 0x7e, 0xfa, 0x51, 0x14, 0xa5,
0x07, 0x75, 0x1b, 0xaa, 0xd7, 0xc1, 0xef, 0x57, 0x8b, 0xc7, 0x21, 0x12, 0x51, 0xdf, 0xc3, 0xe1,
0xce, 0xa1, 0xeb, 0xca, 0x03, 0xa9, 0x83, 0xdb, 0xa6, 0xaa, 0xa7, 0x65, 0x10, 0x02, 0xec, 0x76,
0xc8, 0x64, 0x20, 0x10, 0x00, 0xab, 0x15, 0x8c, 0x46, 0xce, 0xce, 0xef, 0x5b, 0xf6, 0x5a, 0xe5,
0x8b, 0x77, 0x88, 0xf4, 0xe1, 0x0d, 0x7d, 0x43, 0xbb, 0x4d, 0x1d, 0x87, 0x24, 0x15, 0x72, 0xb9,
0x20, 0x97, 0x83, 0x44, 0x02, 0x1c, 0x0e, 0xd0, 0xeb, 0x99, 0x77, 0x17, 0x5a, 0xf6, 0x5a, 0xad,
0x07, 0x2f, 0xda, 0x43, 0x85, 0xf0, 0x11, 0xe8, 0x74, 0x50, 0x2a, 0xa9, 0x65, 0xb3, 0x20, 0xa9,
0xf8, 0xaa, 0xb7, 0xd8, 0x3d, 0x68, 0x7f, 0xf3, 0x44, 0x3d, 0x91, 0x10, 0x3c, 0x7b, 0x7d, 0xbc,
0x8e, 0xda, 0xd4, 0x6f, 0x93, 0x09, 0xe7, 0x52, 0xbe, 0x7b, 0xd0, 0xc4, 0x5c, 0x96, 0xaa, 0x6d,
0x86, 0x84, 0xc9, 0xc9, 0xd8, 0xe0, 0x0e, 0x8b, 0x03, 0x3e, 0x62, 0xe6, 0x05, 0x1e, 0xdd, 0x1b,
0xf4, 0x8f, 0xa4, 0x3a, 0x83, 0xca, 0xd2, 0x15, 0xe9, 0xd9, 0x50, 0x4b, 0x95, 0xe8, 0x1e, 0x16,
0x4b, 0xbc, 0x31, 0x9e, 0x1c, 0xde, 0xe6, 0x32, 0x98, 0x6e, 0xbb, 0xd5, 0x2a, 0xbf, 0x25, 0x21,
0xe4, 0x64, 0xb2, 0x71, 0x4d, 0x1f, 0x7b, 0x5a, 0x59, 0x63, 0x79, 0x3c, 0x4a, 0xcc, 0x11, 0xe5,
0x65, 0x6a, 0xfa, 0xd3, 0x9d, 0x56, 0x8a, 0xc7, 0xf3, 0x35, 0x84, 0x10, 0x60, 0x36, 0x83, 0xc1,
0xd0, 0x31, 0xf2, 0x7d, 0xa8, 0x0b, 0xfd, 0x53, 0xa8, 0xf7, 0x2b, 0xef, 0x41, 0xef, 0xbd, 0x01,
0xd4, 0x13, 0x20, 0xa3, 0x03, 0x4f, 0x86, 0x07, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44,
0xae, 0x42, 0x60, 0x82,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x02, 0x00, 0x00, 0x00, 0x26, 0x28, 0xdb,
0x99, 0x00, 0x00, 0x00, 0xdc, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0x63, 0x78, 0x46, 0x55, 0xc0,
0x30, 0x6a, 0x1c, 0xf9, 0xc6, 0x7d, 0xf8, 0xf0, 0xe1, 0x3f, 0x95, 0xc0, 0xd7, 0xaf, 0x5f, 0x69,
0x6c, 0xdc, 0xdd, 0xbb, 0xdf, 0x96, 0x2e, 0xbe, 0x3d, 0x73, 0xfa, 0x8d, 0xbd, 0x7b, 0xdf, 0xfd,
0xfe, 0xfd, 0x8f, 0x32, 0xe3, 0x7e, 0xff, 0x51, 0x55, 0x38, 0xcc, 0xcb, 0xbd, 0x55, 0x5d, 0x71,
0x11, 0x03, 0xc3, 0xfe, 0xed, 0xf3, 0xaf, 0x50, 0xea, 0x3a, 0x13, 0xdd, 0xa3, 0x2c, 0x2c, 0x07,
0x0c, 0x0d, 0x4f, 0x33, 0x32, 0xee, 0x3f, 0xbe, 0xe6, 0x2a, 0xc9, 0xc6, 0x6d, 0xd9, 0xf2, 0xb0,
0xa3, 0xe3, 0x2e, 0x1c, 0xb9, 0xd9, 0x1f, 0xbf, 0x71, 0xe3, 0xeb, 0x8b, 0x17, 0x3f, 0x6b, 0x6b,
0xef, 0x35, 0xa7, 0xed, 0x47, 0x96, 0x22, 0x88, 0x16, 0x2e, 0xbc, 0xc7, 0xd0, 0xd5, 0x75, 0x0d,
0xe8, 0x2f, 0x38, 0xf2, 0xb5, 0x3d, 0x34, 0x7f, 0xfe, 0x73, 0x20, 0x6a, 0x6a, 0xbc, 0x2f, 0xca,
0xbc, 0x11, 0x59, 0x8a, 0x20, 0x8a, 0x8e, 0x3e, 0x87, 0x6e, 0x9c, 0x08, 0xf3, 0xa6, 0x86, 0x9a,
0xdb, 0x3b, 0x76, 0xbc, 0xb5, 0x50, 0xd8, 0x4c, 0x92, 0x59, 0xd8, 0x8d, 0x03, 0x22, 0x1e, 0xc6,
0xed, 0x32, 0xcc, 0x6b, 0x48, 0x35, 0x0b, 0xa7, 0x71, 0x64, 0x23, 0x90, 0x71, 0x5b, 0x27, 0xef,
0xef, 0x34, 0x6e, 0xa7, 0x0a, 0x5a, 0x98, 0xb7, 0x9a, 0xe1, 0x43, 0x57, 0xd7, 0x7f, 0x06, 0x06,
0xaa, 0xa0, 0xaf, 0xd1, 0xd1, 0xa3, 0xc6, 0x51, 0x60, 0xdc, 0x68, 0x5d, 0x31, 0x58, 0x8c, 0x03,
0x00, 0x7a, 0x13, 0x67, 0x71, 0xe0, 0xcc, 0x56, 0x20, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
0x44, 0xae, 0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE lang_sl_xpm[1] = {{ png, sizeof( png ), "lang_sl_xpm" }};
+54 -40
View File
@@ -12,7 +12,7 @@
version="1.1"
viewBox="-2100 -1470 151.66666 151.66666"
id="svg2"
inkscape:version="0.48.4 r9939"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
sodipodi:docname="lang_sl.svg">
<metadata
id="metadata37">
@@ -22,6 +22,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Flag of Brazil</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@@ -34,29 +35,23 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="744"
inkscape:window-width="1015"
inkscape:window-height="938"
id="namedview35"
showgrid="false"
inkscape:zoom="0.921875"
inkscape:cx="-38.508475"
inkscape:cy="128"
inkscape:zoom="5.6568542"
inkscape:cx="5.7280975"
inkscape:cy="9.0111021"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
inkscape:window-y="90"
inkscape:window-maximized="0"
inkscape:current-layer="g918"
showguides="true"
inkscape:guide-bbox="true" />
<title
id="title4">Flag of Brazil</title>
<defs
id="defs6">
<clipPath
id="a">
<path
d="m 171.82,258.25 c -26.762,-12.893 -65.044,-38.479 -65.044,-89.094 0,-50.614 2.42,-73.633 2.42,-73.633 h 125.25 c 0,0 2.422,23.019 2.422,73.633 -0.001,50.616 -38.286,76.201 -65.05,89.094 z"
id="path9"
inkscape:connector-curvature="0" />
</clipPath>
</defs>
id="defs6" />
<clipPath
id="clipPath11">
<circle
@@ -86,7 +81,7 @@
y="-540.56"
x="-116.67"
id="rect19"
style="fill:#0f218b" />
style="fill:#0000bf;fill-opacity:1" />
<rect
height="252.78"
width="1225"
@@ -101,30 +96,49 @@
x="-116.67"
id="rect23"
style="fill:#ff0000" />
<path
d="m 121.41,-423.58 c 0,-111.98 7.1462,-174.77 7.1462,-174.77 h 321.57 c 0,0 7.1486,62.786 7.1486,174.77 0,119.2 -97.529,178.65 -161.74,207.37 l -6.1942,2.7706 -6.1871,-2.7706 c -64.207,-28.717 -161.74,-88.167 -161.74,-207.37 z"
id="path25"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-rule:evenodd" />
<path
d="m 289.34,-228.14 c -63.222,-28.283 -153.66,-84.409 -153.66,-195.44 0,-111.031 5.717,-161.52 5.717,-161.52 h 295.89 c 0,0 5.7217,50.495 5.7217,161.52 -0.002,111.03 -90.446,167.16 -153.67,195.44 z"
id="path27"
inkscape:connector-curvature="0"
style="fill:#ff0000" />
<path
d="m 302.86,-452.69 c 17.118,0.25665 50.522,0.87964 80.262,-8.3622 0,0 -0.78666,9.8824 -0.78666,21.395 0,11.514 0.78666,21.397 0.78666,21.397 -27.281,-8.4762 -60.971,-8.6539 -80.262,-8.4258 v 61.325 h -27.04 v -61.325 c -19.294,-0.22801 -52.979,-0.0506 -80.262,8.4258 0,0 0.78666,-9.8824 0.78666,-21.397 0,-11.512 -0.78666,-21.395 -0.78666,-21.395 29.74,9.2418 63.142,8.6188 80.262,8.3622 v -38.514 c -15.604,-0.12944 -38.089,0.56377 -63.51,8.4631 0,0 0.7867,-9.8824 0.7867,-21.397 0,-11.512 -0.7867,-21.395 -0.7867,-21.395 25.386,7.8862 47.841,8.5903 63.439,8.4631 -0.80085,-24.389 -8.4526,-55.126 -8.4526,-55.126 0,0 15.748,1.1429 22.041,1.1429 6.3028,0 22.046,-1.1429 22.046,-1.1429 0,0 -7.6495,30.74 -8.4526,55.126 15.601,0.1251 38.056,-0.57694 63.442,-8.4631 0,0 -0.7867,9.8823 -0.7867,21.395 0,11.514 0.7867,21.397 0.7867,21.397 -25.424,-7.8993 -47.909,-8.5925 -63.513,-8.4631 v 38.514 z"
id="path29"
inkscape:connector-curvature="0"
style="fill:#ffffff" />
<g
transform="matrix(2.3624,0,0,2.1936,-116.57,-794.65)"
clip-path="url(#a)"
id="g31">
transform="matrix(2.9274818,0,0,2.8240134,133.11513,-26.272245)"
id="g918">
<path
d="m 170.64,274.85 -55.454,-49.43 c 0,0 7.089,-22.927 20.927,-22.927 10.996,0 15.009,8.865 15.009,8.865 0,0 7.22,-18.689 20.696,-18.689 13.479,0 20.699,18.689 20.699,18.689 0,0 4.013,-8.865 15.01,-8.865 13.838,0 20.927,22.927 20.927,22.927 l -57.814,49.43 z"
id="path33"
inkscape:connector-curvature="0"
style="fill:#0f218b;fill-rule:evenodd" />
id="path13"
style="fill:#ed1c24;fill-opacity:1"
d="m -9.8011001,-221.38606 c -0.8919999,0.39333 -1.7773329,0.80166 -2.6559999,1.22466 l 2.7679999,43.79933 c 0.754,11.94066 5.831999,23.241 14.3419982,31.75066 5.8193329,5.819 12.9433319,10.034 20.6849979,12.358 h 6.67e-4 c 7.741666,-2.32433 14.865998,-6.539 20.684998,-12.358 8.509666,-8.50966 13.587999,-19.81 14.341665,-31.75066 l 2.768333,-43.79933 c -0.879,-0.423 -1.763666,-0.83133 -2.656333,-1.22466 l 6.67e-4,3.3e-4 -2.833333,44.83632 c -0.709,11.28567 -5.507,21.96667 -13.549332,30.009 -5.3,5.30067 -11.746666,9.19133 -18.756332,11.43167 h -10e-4 c -7.009999,-2.24034 -13.455998,-6.131 -18.7559979,-11.43167 -8.0426662,-8.04233 -12.8406652,-18.72333 -13.5493322,-30.009 l -2.833666,-44.83665 h 6.66e-4" />
<path
inkscape:connector-curvature="0"
id="path15"
style="fill:#0000bf;fill-opacity:1"
d="m 60.477893,-221.38573 c -10.967666,-4.83567 -22.921331,-7.403 -35.139663,-7.403 -12.218666,0 -24.1723311,2.56733 -35.1399971,7.403 l 2.834,44.83632 c 0.708666,11.28567 5.506666,21.96667 13.5493322,30.009 5.3003329,5.30067 11.7463319,9.19133 18.7559979,11.43167 h 0.001 c 7.009666,-2.24034 13.456332,-6.131 18.755665,-11.43167 8.042999,-8.04233 12.840998,-18.72333 13.549332,-30.009" />
<polyline
transform="matrix(0.3333333,0,0,0.3333333,-12.4571,-228.78873)"
points="119.764,62.917 124.434,56.539 116.574,57.394 113.386,50.161 110.197,57.394 102.338,56.539 107.008,62.917 102.338,69.295 110.197,68.44 113.386,75.673 116.574,68.44 124.434,69.295 "
id="polyline17"
style="fill:#ffdd00;fill-opacity:1" />
<polyline
transform="matrix(0.3333333,0,0,0.3333333,-12.4571,-228.78873)"
points="90,23.232 94.669,16.854 86.811,17.709 83.622,10.476 80.433,17.709 72.575,16.854 77.244,23.232 72.575,29.61 80.433,28.755 83.622,35.988 86.811,28.755 94.669,29.61 "
id="polyline19"
style="fill:#ffdd00;fill-opacity:1" />
<polyline
transform="matrix(0.3333333,0,0,0.3333333,-12.4571,-228.78873)"
points="149.527,23.232 154.195,16.854 146.338,17.709 143.148,10.476 139.959,17.709 132.102,16.854 136.771,23.232 132.102,29.61 139.959,28.755 143.148,35.988 146.338,28.755 154.195,29.61 "
id="polyline21"
style="fill:#ffdd00;fill-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path23"
style="fill:#ffffff"
d="m 53.684893,-170.02074 -14.173665,-18.89799 -5.669333,7.55933 -8.503999,-17.008 -8.503999,17.008 -5.669333,-7.55933 -14.1733321,18.89799 c 0,2.506 0.995667,4.909 2.76766698,6.681 1.77200002,1.77133 4.17499922,2.76767 6.68133222,2.76767 1.673334,0 3.301,-0.444 4.7249999,-1.26634 0.0093,-0.006 -0.01133,0.007 -0.0023,0.001 0.709666,-0.41 1.475333,-0.72934 2.280333,-0.94467 2.420666,-0.64833 4.999666,-0.30933 7.169999,0.94333 1.449,0.83667 3.080666,1.26634 4.725333,1.26634 0.007,0 -0.0087,0 -0.0017,0 1.645,0 3.276333,-0.42967 4.725666,-1.26634 2.17,-1.25266 4.749333,-1.59233 7.17,-0.94333 0.804666,0.21533 1.570333,0.53467 2.279999,0.94467 0.0097,0.005 -0.011,-0.007 -0.002,-0.001 1.424334,0.82234 3.051333,1.26634 4.724667,1.26634 2.506666,0 4.909666,-0.996 6.681666,-2.76767 1.771999,-1.772 2.767666,-4.175 2.767666,-6.681" />
<path
inkscape:connector-curvature="0"
id="path25-4"
style="fill:#ffffff"
d="m 0.34889888,-159.76041 c 0.650333,1.29234 1.36533322,2.55334 2.14233322,3.778 0,0 -3.33e-4,6.7e-4 0,10e-4 1.994666,0.91733 4.256333,1.11533 6.394666,0.54233 0.805333,-0.21533 1.5706659,-0.535 2.2803329,-0.94467 0.0093,-0.005 -0.01133,0.007 -0.002,0.001 1.424,-0.823 3.051666,-1.26634 4.724999,-1.26634 0.0033,0 -0.0043,0 -10e-4,0 1.644667,-6.6e-4 3.276334,0.429 4.725333,1.26634 2.170333,1.25266 4.749333,1.59166 7.170333,0.94333 0.804667,-0.21533 1.570333,-0.535 2.28,-0.94467 0.0097,-0.005 -0.011,0.007 -0.002,10e-4 1.423666,-0.823 3.051333,-1.26634 4.725333,-1.26634 0.0033,0 -0.0047,0 -0.0013,0 1.644667,-6.6e-4 3.276667,0.429 4.725333,1.26634 2.170667,1.25266 4.749333,1.59166 7.169999,0.94333 0.519667,-0.13867 1.022,-0.32167 1.504,-0.543 v 0 c 0.777333,-1.22533 1.492334,-2.48633 2.142667,-3.778 0,-6.7e-4 0,0 0,0 -0.472,0.17967 -0.929667,0.397 -1.368334,0.65033 -0.009,0.005 0.01167,-0.007 0.0027,-0.001 -0.709666,0.40967 -1.475333,0.72867 -2.280666,0.94467 -2.420667,0.64833 -4.999333,0.30933 -7.17,-0.944 -1.448666,-0.83667 -3.080666,-1.26567 -4.725332,-1.26567 -0.0033,0 0.0047,0 0.0013,0 -1.673667,0 -3.301333,0.444 -4.725333,1.26633 -0.009,0.005 0.01167,-0.007 0.002,-0.001 -0.709667,0.41 -1.475333,0.72933 -2.28,0.94467 -2.420999,0.649 -4.999999,0.31 -7.170332,-0.94334 -1.449,-0.83666 -3.080667,-1.26633 -4.725333,-1.26633 -0.0037,0 0.0043,0 10e-4,0 -1.673333,0 -3.301,0.444 -4.725,1.267 -0.0093,0.005 0.01133,-0.007 0.002,-10e-4 -0.709666,0.40966 -1.4749999,0.72866 -2.2803329,0.94466 -2.420666,0.64834 -4.999666,0.30934 -7.169999,-0.944 -0.4403332,-0.254 -0.89766722,-0.47066 -1.36700022,-0.649 -3.33e-4,0 0,-6.6e-4 0,0" />
<path
inkscape:connector-curvature="0"
id="path27-3"
style="fill:#ffffff"
d="m 45.737561,-152.50907 c -1.101,1.41066 -2.293,2.76099 -3.572333,4.03966 -4.78,4.78 -10.549332,8.34233 -16.827332,10.48833 h -3.33e-4 c -6.277999,-2.146 -12.047666,-5.70766 -16.8276649,-10.48833 -1.279,-1.27867 -2.471,-2.629 -3.572,-4.03966 0,0 -3.33e-4,0 0,0 1.303,0.20966 2.648333,0.146 3.947667,-0.20167 0.805333,-0.216 1.5706659,-0.535 2.2803329,-0.94467 0.0093,-0.005 -0.01133,0.007 -0.002,10e-4 1.423999,-0.823 3.051666,-1.26634 4.724999,-1.26634 0.0033,0 -0.0043,0 -10e-4,0 1.644667,-6.6e-4 3.276333,0.429 4.725333,1.26567 2.170333,1.25333 4.749333,1.59233 7.169999,0.944 0.805334,-0.216 1.571,-0.535 2.280667,-0.94467 0.009,-0.005 -0.01167,0.007 -0.002,0.001 1.423666,-0.823 3.051333,-1.26634 4.724666,-1.26634 0.0033,0 -0.004,0 -6.67e-4,0 1.644667,-6.6e-4 3.276,0.429 4.725333,1.26567 1.89,1.09167 4.091,1.48967 6.226666,1.14533 6.67e-4,0 0,0 -6.66e-4,6.7e-4" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

@@ -11,7 +11,7 @@
width="16"
version="1.1"
id="svg2"
inkscape:version="0.48.4 r9939"
inkscape:version="0.92.0 r15299"
sodipodi:docname="pinshape_clock_active_low.svg">
<metadata
id="metadata22">
@@ -21,8 +21,23 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
@@ -36,15 +51,15 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="744"
inkscape:window-width="1920"
inkscape:window-height="1033"
id="namedview18"
showgrid="true"
inkscape:zoom="24.969708"
inkscape:cx="4.4578733"
inkscape:cy="9.2981956"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1"
inkscape:current-layer="svg2">
<inkscape:grid

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

+31 -10
View File
@@ -11,8 +11,8 @@
width="16"
version="1.1"
id="svg2"
inkscape:version="0.48.4 r9939"
sodipodi:docname="pinshape_clock_fall.svg">
inkscape:version="0.92.0 r15299"
sodipodi:docname="pinshape_clock_active_low.svg">
<metadata
id="metadata22">
<rdf:RDF>
@@ -21,8 +21,23 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
@@ -36,15 +51,15 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="744"
inkscape:window-width="1920"
inkscape:window-height="1033"
id="namedview18"
showgrid="true"
inkscape:zoom="24.969708"
inkscape:cx="4.4578733"
inkscape:cy="9.2981956"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1"
inkscape:current-layer="svg2">
<inkscape:grid
@@ -56,19 +71,25 @@
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<path
d="M 1,0 1,16"
d="M 5,0 5,16"
id="path12"
inkscape:connector-curvature="0"
style="fill:none;stroke:#1a1a1a;stroke-width:2;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none"
sodipodi:nodetypes="cc" />
<path
d="M 6,8 16,8"
d="M 5,8 16,8"
id="path14"
inkscape:connector-curvature="0"
style="fill:none;stroke:#1a1a1a;stroke-width:2;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none"
sodipodi:nodetypes="cc" />
<path
d="M 1,13 6,8 1,3"
sodipodi:nodetypes="ccc"
style="fill:none;stroke:#1a1a1a;stroke-width:2;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none"
inkscape:connector-curvature="0"
id="path4010"
d="m 5,8 7,-6 0,6" />
<path
d="M 5,13 1,8 5,3"
id="path4094"
inkscape:connector-curvature="0"
style="fill:none;stroke:#1a1a1a;stroke-width:2;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none"

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

+21 -6
View File
@@ -11,8 +11,8 @@
width="16"
version="1.1"
id="svg2"
inkscape:version="0.48.4 r9939"
sodipodi:docname="pinshape_clock_normal.svg">
inkscape:version="0.92.0 r15299"
sodipodi:docname="pinshape_clock_invert.svg">
<metadata
id="metadata22">
<rdf:RDF>
@@ -22,7 +22,22 @@
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
@@ -36,15 +51,15 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="744"
inkscape:window-width="1920"
inkscape:window-height="1033"
id="namedview18"
showgrid="true"
inkscape:zoom="24.969708"
inkscape:cx="18.434809"
inkscape:cy="9.4183412"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1"
inkscape:current-layer="svg2">
<inkscape:grid

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

+22 -36
View File
@@ -188,7 +188,6 @@ set( COMMON_DLG_SRCS
dialogs/dialog_configure_paths_base.cpp
dialogs/dialog_display_info_HTML_base.cpp
dialogs/dialog_edit_library_tables.cpp
dialogs/dialog_exit_base.cpp
dialogs/dialog_file_dir_picker.cpp
dialogs/dialog_global_lib_table_config.cpp
dialogs/dialog_global_lib_table_config_base.cpp
@@ -293,8 +292,10 @@ set( COMMON_SRCS
config_params.cpp
confirm.cpp
convert_basic_shapes_to_polygon.cpp
cursor_store.cpp
dialog_shim.cpp
displlst.cpp
dpi_scaling.cpp
draw_graphic_text.cpp
dsnlexer.cpp
eagle_parser.cpp
@@ -321,7 +322,6 @@ set( COMMON_SRCS
hotkey_store.cpp
hotkeys_basic.cpp
html_messagebox.cpp
incremental_text_ctrl.cpp
kiface_i.cpp
kiway.cpp
kiway_express.cpp
@@ -380,6 +380,14 @@ if( BUILD_GITHUB_PLUGIN )
)
endif()
# Link-time optimization (LTO) on GCC conflicts with embedded assembly (__asm),
# following GCC's recommendation to disable LTO per translation unit.
if( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set_source_files_properties( system/libcontext.cpp PROPERTIES
COMPILE_FLAGS "-fno-lto"
)
endif()
set( COMMON_SRCS
${COMMON_SRCS}
system/libcontext.cpp
@@ -429,6 +437,7 @@ target_link_libraries( common
${Boost_LIBRARIES}
${CURL_LIBRARIES}
${OPENSSL_LIBRARIES} # empty on Apple
${wxWidgets_LIBRARIES}
)
@@ -513,6 +522,7 @@ target_link_libraries( pcbcommon PUBLIC
# auto-generate netlist_lexer.h and netlist_keywords.cpp
make_lexer(
netlist_lexer_source_files
${CMAKE_CURRENT_SOURCE_DIR}/netlist.keywords
${PROJECT_SOURCE_DIR}/include/netlist_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/netlist_keywords.cpp
@@ -522,18 +532,12 @@ make_lexer(
${CMAKE_PROJECT_SOURCE_DIR}/pcbnew/netlist_reader.h
)
add_custom_target(
netlist_lexer_source_files ALL
DEPENDS
${PROJECT_SOURCE_DIR}/include/netlist_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/netlist_keywords.cpp
)
add_dependencies( common netlist_lexer_source_files )
add_dependencies( pcbcommon netlist_lexer_source_files )
# auto-generate pcb_plot_params_lexer.h and pcb_plot_params_keywords.cpp
make_lexer(
pcb_plot_lexer_source_files
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params.keywords
${PROJECT_SOURCE_DIR}/include/pcb_plot_params_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_keywords.cpp
@@ -543,17 +547,11 @@ make_lexer(
${PROJECT_SOURCE_DIR}/pcbnew/pcb_plot_params.h
)
add_custom_target(
pcb_plot_lexer_source_files ALL
DEPENDS
${PROJECT_SOURCE_DIR}/include/pcb_plot_params_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_keywords.cpp
)
add_dependencies( pcbcommon pcb_plot_lexer_source_files )
# auto-generate pcbnew_sexpr.h and pcbnew_sexpr.cpp
make_lexer(
pcb_lexer_source_files
${CMAKE_CURRENT_SOURCE_DIR}/pcb.keywords
${PROJECT_SOURCE_DIR}/include/pcb_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/pcb_keywords.cpp
@@ -563,28 +561,22 @@ make_lexer(
${PROJECT_SOURCE_DIR}/pcbnew/pcb_parser.h
)
add_custom_target(
pcb_lexer_source_files ALL
DEPENDS
${PROJECT_SOURCE_DIR}/include/pcb_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/pcb_keywords.cpp
)
add_dependencies( pcbcommon pcb_lexer_source_files )
# auto-generate s-expression library table code.
make_lexer(
lib_table_lexer_source_files
${CMAKE_CURRENT_SOURCE_DIR}/lib_table.keywords
${PROJECT_SOURCE_DIR}/include/lib_table_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/lib_table_keywords.cpp
LIB_TABLE_T
)
add_custom_target(
lib_table_lexer_source_files ALL
DEPENDS
${PROJECT_SOURCE_DIR}/include/lib_table_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/lib_table_keywords.cpp
# These files consume *_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/fp_lib_table.cpp
${CMAKE_CURRENT_SOURCE_DIR}/lib_table_base.cpp
${PROJECT_SOURCE_DIR}/pcbnew/dialogs/panel_fp_lib_table.cpp
${PROJECT_SOURCE_DIR}/eeschema/symbol_lib_table.cpp
${PROJECT_SOURCE_DIR}/eeschema/dialogs/panel_sym_lib_table.cpp
)
add_dependencies( common lib_table_lexer_source_files )
@@ -593,19 +585,13 @@ add_dependencies( pcbcommon lib_table_lexer_source_files )
# auto-generate page layout reader s-expression page_layout_reader_lexer.h
# and title_block_reader_keywords.cpp.
make_lexer(
page_layout_lexer_source_files
${CMAKE_CURRENT_SOURCE_DIR}/page_layout/page_layout_reader.keywords
${PROJECT_SOURCE_DIR}/include/page_layout_reader_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/page_layout/page_layout_reader_keywords.cpp
TB_READER_T
)
add_custom_target(
page_layout_lexer_source_files ALL
DEPENDS
${PROJECT_SOURCE_DIR}/include/page_layout_reader_lexer.h
${CMAKE_CURRENT_SOURCE_DIR}/page_layout/page_layout_reader_keywords.cpp
)
add_dependencies( common page_layout_lexer_source_files )
# This one gets made only when testing.
+30
View File
@@ -405,6 +405,9 @@ bool EDA_RECT::Intersects( const wxPoint& aPoint1, const wxPoint& aPoint2 ) cons
bool EDA_RECT::Intersects( const EDA_RECT& aRect ) const
{
if( !m_init )
return false;
// this logic taken from wxWidgets' geometry.cpp file:
bool rc;
EDA_RECT me(*this);
@@ -433,6 +436,9 @@ bool EDA_RECT::Intersects( const EDA_RECT& aRect ) const
bool EDA_RECT::Intersects( const EDA_RECT& aRect, double aRot ) const
{
if( !m_init )
return false;
/* Most rectangles will be axis aligned.
* It is quicker to check for this case and pass the rect
* to the simpler intersection test
@@ -565,6 +571,9 @@ const wxPoint EDA_RECT::FarthestPointTo( const wxPoint& aPoint ) const
bool EDA_RECT::IntersectsCircle( const wxPoint& aCenter, const int aRadius ) const
{
if( !m_init )
return false;
wxPoint closest = ClosestPointTo( aCenter );
double dx = aCenter.x - closest.x;
@@ -578,6 +587,9 @@ bool EDA_RECT::IntersectsCircle( const wxPoint& aCenter, const int aRadius ) con
bool EDA_RECT::IntersectsCircleEdge( const wxPoint& aCenter, const int aRadius, const int aWidth ) const
{
if( !m_init )
return false;
EDA_RECT me( *this );
me.Normalize(); // ensure size is >= 0
@@ -675,6 +687,17 @@ EDA_RECT& EDA_RECT::Inflate( wxCoord dx, wxCoord dy )
void EDA_RECT::Merge( const EDA_RECT& aRect )
{
if( !m_init )
{
if( aRect.IsValid() )
{
m_Pos = aRect.GetPosition();
m_Size = aRect.GetSize();
m_init = true;
}
return;
}
Normalize(); // ensure width and height >= 0
EDA_RECT rect = aRect;
rect.Normalize(); // ensure width and height >= 0
@@ -692,6 +715,13 @@ void EDA_RECT::Merge( const EDA_RECT& aRect )
void EDA_RECT::Merge( const wxPoint& aPoint )
{
if( !m_init )
{
m_Pos = aPoint;
m_Size = wxSize( 0, 0 );
return;
}
Normalize(); // ensure width and height >= 0
wxPoint end = GetEnd();
+8
View File
@@ -266,6 +266,10 @@ wxString StringFromValue( EDA_UNITS_T aUnits, int aValue, bool aAddUnitSymbol, b
stringValue += wxT( " deg" );
break;
case PERCENT:
stringValue += wxT( "%" );
break;
case UNSCALED_UNITS:
break;
}
@@ -294,6 +298,7 @@ double From_User_Unit( EDA_UNITS_T aUnits, double aValue, bool aUseMils )
default:
case UNSCALED_UNITS:
case PERCENT:
return aValue;
}
}
@@ -442,6 +447,9 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS_T aUnit, bool aUseMils )
case MILLIMETRES:
return _( "mm" );
case PERCENT:
return _( "%" );
case UNSCALED_UNITS:
return wxEmptyString;
+1
View File
@@ -25,6 +25,7 @@
#include <bin_mod.h>
#include <common.h>
#include <pgm_base.h>
#include <id.h>
BIN_MOD::BIN_MOD( const char* aName ) :
+14 -4
View File
@@ -36,6 +36,7 @@
#include "bitmap_base.h"
#include <wx/dc.h>
#include <wx/mstream.h>
@@ -238,10 +239,19 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
aDC->SetUserScale( scale * GetScalingFactor(), scale * GetScalingFactor() );
aDC->SetLogicalOrigin( logicalOriginX / GetScalingFactor(),
logicalOriginY / GetScalingFactor() );
aDC->DrawBitmap( *m_bitmap,
KiROUND( pos.x / GetScalingFactor() ),
KiROUND( pos.y / GetScalingFactor() ),
true );
if( GetGRForceBlackPenState() )
{
wxBitmap result( m_bitmap->ConvertToImage().ConvertToGreyscale() );
aDC->DrawBitmap( result, KiROUND( pos.x / GetScalingFactor() ),
KiROUND( pos.y / GetScalingFactor() ), true );
}
else
{
aDC->DrawBitmap( *m_bitmap, KiROUND( pos.x / GetScalingFactor() ),
KiROUND( pos.y / GetScalingFactor() ), true );
}
aDC->SetUserScale( scale, scale );
aDC->SetLogicalOrigin( logicalOriginX, logicalOriginY );
}
+3 -3
View File
@@ -167,12 +167,12 @@ void SelectReferenceNumber( wxTextEntry* aTextEntry )
{
wxString num = ref;
while( !num.IsEmpty() && ( !isdigit( num.Last() ) || !isdigit( num.GetChar( 0 ) ) ) )
while( !num.IsEmpty() && ( !wxIsdigit( num.Last() ) || !wxIsdigit( num.GetChar( 0 ) ) ) )
{
if( !isdigit( num.Last() ) )
if( !wxIsdigit( num.Last() ) )
num.RemoveLast();
if( !isdigit( num.GetChar ( 0 ) ) )
if( !wxIsdigit( num.GetChar ( 0 ) ) )
num = num.Right( num.Length() - 1);
}
+41 -46
View File
@@ -33,7 +33,6 @@
#include <confirm.h>
#include <bitmaps.h>
#include <html_messagebox.h>
#include <dialog_exit_base.h>
#include <functional>
#include <unordered_map>
@@ -153,65 +152,56 @@ long KIDIALOG::getStyle( KD_TYPE aType )
}
class DIALOG_EXIT: public DIALOG_EXIT_BASE
{
public:
DIALOG_EXIT( wxWindow *aParent, const wxString& aWarning, const wxString& aMessage,
const wxString& aOKLabel, const wxString& aCancelLabel ) :
DIALOG_EXIT_BASE( aParent )
{
m_bitmap->SetBitmap( KiBitmap( dialog_warning_xpm ) );
m_TextInfo->SetLabel( aWarning );
m_staticTextWarningMessage->SetLabel( aMessage );
m_sdbSizerOK->SetLabel( aOKLabel );
m_sdbSizerCancel->SetLabel( aCancelLabel );
m_sdbSizerOK->SetDefault();
FinishDialogSettings();
};
private:
void OnSave( wxCommandEvent& event ) override { EndModal( wxID_YES ); }
void OnDiscard( wxCommandEvent& event ) override { EndModal( wxID_NO ); }
};
int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage, bool* aApplyToAll )
{
DIALOG_EXIT dlg( parent, aMessage,
_( "If you don't save, all your changes will be permanently lost." ),
_( "Save" ), _( "Cancel" ) );
wxRichMessageDialog dlg( parent, aMessage, wxEmptyString,
wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
dlg.ShowDetailedText( _( "If you don't save, all your changes will be permanently lost." ) );
dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Save" ) ),
wxMessageDialog::ButtonLabel( _( "Discard Changes" ) ) );
dlg.m_ApplyToAllOpt->Show( aApplyToAll != nullptr );
if( aApplyToAll )
dlg.ShowCheckBox( _( "Apply to all" ), true );
int ret = dlg.ShowModal();
if( aApplyToAll )
*aApplyToAll = dlg.m_ApplyToAllOpt->GetValue();
*aApplyToAll = dlg.IsCheckBoxChecked();
// Returns wxID_YES, wxID_NO, or wxID_CANCEL
return ret;
}
int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage )
{
wxMessageDialog dlg( parent, aMessage, wxEmptyString,
wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." ) );
dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Save" ) ),
wxMessageDialog::ButtonLabel( _( "Discard Changes" ) ) );
// Returns wxID_YES, wxID_NO, or wxID_CANCEL
return dlg.ShowModal();
}
bool ConfirmRevertDialog( wxWindow* parent, const wxString& aMessage )
{
DIALOG_EXIT dlg( parent, aMessage,
_( "Your current changes will be permanently lost." ),
_( "Revert" ), _( "Cancel" ) );
wxMessageDialog dlg( parent, aMessage, wxEmptyString,
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
dlg.SetExtendedMessage( _( "Your current changes will be permanently lost." ) );
dlg.SetOKCancelLabels( wxMessageDialog::ButtonLabel( _( "Revert" ) ),
wxMessageDialog::ButtonLabel( _( "Cancel" ) ) );
dlg.m_ApplyToAllOpt->Show( false );
dlg.m_DiscardButton->Show( false );
return dlg.ShowModal() == wxID_YES;
return dlg.ShowModal() == wxID_OK;
}
bool HandleUnsavedChanges( wxWindow* aParent, const wxString& aMessage,
const std::function<bool()>& aSaveFunction )
{
switch( UnsavedChangesDialog( aParent, aMessage, nullptr ) )
switch( UnsavedChangesDialog( aParent, aMessage ) )
{
case wxID_YES: return aSaveFunction();
case wxID_NO: return true;
@@ -221,20 +211,24 @@ bool HandleUnsavedChanges( wxWindow* aParent, const wxString& aMessage,
}
int YesOrCancelDialog( wxWindow* aParent, const wxString& aWarning, const wxString& aMessage,
const wxString& aOKLabel, const wxString& aCancelLabel, bool* aApplyToAll )
int OKOrCancelDialog( wxWindow* aParent, const wxString& aWarning, const wxString& aMessage,
const wxString& aOKLabel, const wxString& aCancelLabel, bool* aApplyToAll )
{
DIALOG_EXIT dlg( aParent, aWarning, aMessage, aOKLabel, aCancelLabel );
wxRichMessageDialog dlg( aParent, aMessage, wxEmptyString,
wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
dlg.ShowDetailedText( _( "If you don't save, all your changes will be permanently lost." ) );
dlg.SetOKCancelLabels( wxMessageDialog::ButtonLabel( aOKLabel ),
wxMessageDialog::ButtonLabel( aCancelLabel ) );
dlg.m_ApplyToAllOpt->Show( aApplyToAll != nullptr );
dlg.m_DiscardButton->Show( false );
if( aApplyToAll )
dlg.ShowCheckBox( _( "Apply to all" ), true );
int ret = dlg.ShowModal();
if( aApplyToAll )
*aApplyToAll = dlg.m_ApplyToAllOpt->GetValue();
*aApplyToAll = dlg.IsCheckBoxChecked();
// Returns wxID_YES, wxID_NO, or wxID_CANCEL
// Returns wxID_OK or wxID_CANCEL
return ret;
}
@@ -300,7 +294,8 @@ bool IsOK( wxWindow* aParent, const wxString& aMessage )
}
int SelectSingleOption( wxWindow* aParent, const wxString& aTitle, const wxString& aMessage, const wxArrayString& aOptions )
int SelectSingleOption( wxWindow* aParent, const wxString& aTitle,
const wxString& aMessage, const wxArrayString& aOptions )
{
wxSingleChoiceDialog dlg( aParent, aMessage, aTitle, aOptions );
+39 -34
View File
@@ -32,11 +32,42 @@
#include <common.h>
#include <convert_basic_shapes_to_polygon.h>
/**
* Function TransformCircleToPolygon
* convert a circle to a polygon, using multiple straight lines
* @param aBuffer = a SHAPE_LINE_CHAIN to store the polygon corners
* @param aCenter = the center of the circle
* @param aRadius = the radius of the circle
* @param aCircleToSegmentsCount = the number of segments to approximate a circle
* Note: the polygon is inside the circle, so if you want to have the polygon
* outside the circle, you should give aRadius calculated with a correction factor
*/
void TransformCircleToPolygon( SHAPE_LINE_CHAIN& aBuffer,
wxPoint aCenter, int aRadius,
int aCircleToSegmentsCount )
{
wxPoint corner_position;
double delta = 3600.0 / aCircleToSegmentsCount; // rot angle in 0.1 degree
double halfstep = delta/2; // the starting value for rot angles
for( int ii = 0; ii < aCircleToSegmentsCount; ii++ )
{
corner_position.x = aRadius;
corner_position.y = 0;
double angle = (ii * delta) + halfstep;
RotatePoint( &corner_position, angle );
corner_position += aCenter;
aBuffer.Append( corner_position.x, corner_position.y );
}
aBuffer.SetClosed( true );
}
/**
* Function TransformCircleToPolygon
* convert a circle to a polygon, using multiple straight lines
* @param aCornerBuffer = a buffer to store the polygon
* @param aCornerBuffer = a SHAPE_POLY_SET to store the polygon
* @param aCenter = the center of the circle
* @param aRadius = the radius of the circle
* @param aCircleToSegmentsCount = the number of segments to approximate a circle
@@ -397,40 +428,14 @@ void TransformRingToPolygon( SHAPE_POLY_SET& aCornerBuffer,
return;
}
aCornerBuffer.NewOutline();
SHAPE_POLY_SET buffer;
// Draw the inner circle of the ring
int delta = 3600 / aCircleToSegmentsCount; // rotate angle in 0.1 degree
TransformCircleToPolygon( buffer, aCentre, outer_radius, aCircleToSegmentsCount );
for( int ii = 0; ii < 3600; ii += delta )
{
curr_point.x = inner_radius;
curr_point.y = 0;
RotatePoint( &curr_point, ii );
curr_point += aCentre;
aCornerBuffer.Append( curr_point.x, curr_point.y );
}
// Build the hole:
buffer.NewHole();
TransformCircleToPolygon( buffer.Hole( 0, 0 ), aCentre, inner_radius, aCircleToSegmentsCount );
// Draw the last point of inner circle
aCornerBuffer.Append( aCentre.x + inner_radius, aCentre.y );
// Draw the outer circle of the ring
// the first point creates also a segment from the inner to the outer polygon
for( int ii = 0; ii < 3600; ii += delta )
{
curr_point.x = outer_radius;
curr_point.y = 0;
RotatePoint( &curr_point, -ii );
curr_point += aCentre;
aCornerBuffer.Append( curr_point.x, curr_point.y );
}
// Draw the last point of outer circle
aCornerBuffer.Append( aCentre.x + outer_radius, aCentre.y );
// And connect the outer polygon to the inner polygon,.
// because a segment from inner to the outer polygon was already created,
// the final polygon is the inner and the outer outlines connected by
// 2 overlapping segments
aCornerBuffer.Append( aCentre.x + inner_radius, aCentre.y );
buffer.Fracture( SHAPE_POLY_SET::PM_FAST );
aCornerBuffer.Append( buffer );
}
+100
View File
@@ -0,0 +1,100 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <cursor_store.h>
#include <wx/bitmap.h>
#include <wx/debug.h>
/**
* Construct a cursor for the given definition.
*
* How to do this depends on the platform, see
* http://docs.wxwidgets.org/trunk/classwx_cursor.html
*
* @param aDef the cursor definition
* @return a newly constructed cursor if the platform is supported,
* else wxNullCursor
*/
wxCursor constructCursor( const CURSOR_STORE::CURSOR_DEF& aDef )
{
#if defined( __WXMSW__ ) or defined( __WXMAC__ )
wxBitmap img_bitmap(
reinterpret_cast<const char*>( aDef.m_image_data ), aDef.m_size.x, aDef.m_size.y );
wxBitmap msk_bitmap(
reinterpret_cast<const char*>( aDef.m_mask_data ), aDef.m_size.x, aDef.m_size.y );
img_bitmap.SetMask( new wxMask( msk_bitmap ) );
wxImage image( img_bitmap.ConvertToImage() );
#if defined( __WXMSW__ )
image.SetMaskColour( 255, 255, 255 );
#endif
image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, aDef.m_hotspot.x );
image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, aDef.m_hotspot.y );
return wxCursor{ image };
#elif defined( __WXGTK__ ) or defined( __WXMOTIF__ )
return wxCursor{
reinterpret_cast<const char*>( aDef.m_image_data ),
aDef.m_size.x,
aDef.m_size.y,
aDef.m_hotspot.x,
aDef.m_hotspot.y,
reinterpret_cast<const char*>( aDef.m_mask_data ),
};
#else
wxASSERT_MSG( false, "Unknown platform for cursor construction." );
return wxNullCursor;
#endif
}
CURSOR_STORE::CURSOR_STORE( const std::vector<CURSOR_DEF>& aDefs )
{
for( const auto& def : aDefs )
{
m_store[def.m_id_key] = constructCursor( def );
}
}
const wxCursor& CURSOR_STORE::Get( int aIdKey ) const
{
const auto find_iter = m_store.find( aIdKey );
if( find_iter != m_store.end() )
{
return find_iter->second;
}
wxASSERT_MSG( false,
wxString::Format( "Could not find cursor with ID %d", static_cast<int>( aIdKey ) ) );
return wxNullCursor;
}
-5
View File
@@ -167,11 +167,6 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
<< HtmlHyperlink( "https://forum.kicad.info" )
<< "</li>";
description << "<li>"
<<_( "KiCad user's group - " )
<< HtmlHyperlink( "https://groups.yahoo.com/neo/groups/kicad-users/info" )
<< "</li>";
description << "</ul></p>";
aInfo.SetDescription( description );
+15 -7
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2010 Rafael Sokolowski <Rafael.Sokolowski@web.de>
* Copyright (C) 2017 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2017-2019 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -68,6 +68,8 @@ extern std::string GetCurlLibVersion();
DIALOG_ABOUT::DIALOG_ABOUT( EDA_BASE_FRAME *aParent, ABOUT_APP_INFO& aAppInfo )
: DIALOG_ABOUT_BASE( aParent ), m_info( aAppInfo )
{
wxASSERT( aParent != nullptr );
m_picInformation = KiBitmap( info_xpm );
m_picDevelopers = KiBitmap( preference_xpm );
m_picDocWriters = KiBitmap( editor_xpm );
@@ -89,11 +91,13 @@ DIALOG_ABOUT::DIALOG_ABOUT( EDA_BASE_FRAME *aParent, ABOUT_APP_INFO& aAppInfo )
m_bitmapApp->SetBitmap( icon );
}
m_staticTextAppTitle->SetLabel( m_info.GetAppName() );
m_titleName = aParent->GetAboutTitle();
m_staticTextAppTitle->SetLabel( m_titleName );
m_staticTextCopyright->SetLabel( m_info.GetCopyright() );
m_staticTextBuildVersion->SetLabel( "Version: " + m_info.GetBuildVersion() );
m_staticTextLibVersion->SetLabel( m_info.GetLibVersion() );
SetTitle( wxString::Format( _( "About %s" ), m_titleName ) );
createNotebooks();
GetSizer()->SetSizeHints( this );
@@ -124,10 +128,13 @@ void DIALOG_ABOUT::createNotebooks()
createNotebookHtmlPage( m_auiNotebook, _( "Information" ), m_picInformation,
m_info.GetDescription() );
createNotebookPage( m_auiNotebook, _( "Developers" ) , m_picDevelopers, m_info.GetDevelopers() );
createNotebookPage( m_auiNotebook, _( "Doc Writers" ), m_picDocWriters, m_info.GetDocWriters() );
createNotebookPage( m_auiNotebook, _( "Developers" ) , m_picDevelopers,
m_info.GetDevelopers() );
createNotebookPage( m_auiNotebook, _( "Doc Writers" ), m_picDocWriters,
m_info.GetDocWriters() );
createNotebookPageByCategory( m_auiNotebook, _( "Artists" ), m_picArtists, m_info.GetArtists() );
createNotebookPageByCategory( m_auiNotebook, _( "Artists" ), m_picArtists,
m_info.GetArtists() );
createNotebookPageByCategory( m_auiNotebook, _( "Translators" ), m_picTranslators,
m_info.GetTranslators() );
createNotebookPageByCategory( m_auiNotebook, _( "Packagers" ), m_picPackagers,
@@ -237,7 +244,8 @@ void DIALOG_ABOUT::createNotebookPageByCategory(wxAuiNotebook* aParent, const wx
wxStaticText* m_staticText1 = new wxStaticText( m_scrolledWindow1, wxID_ANY,
contributor->GetCategory() + wxT( ":" ),
wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->SetFont( wxFont( -1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false,
m_staticText1->SetFont( wxFont( -1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_BOLD, false,
wxEmptyString ) ); // bold font
m_staticText1->Wrap( -1 );
fgSizer1->Add( m_staticText1, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
@@ -444,7 +452,7 @@ void DIALOG_ABOUT::buildVersionInfoData( wxString& aMsg, bool aFormatHtml )
#define OFF "OFF" << eol
wxPlatformInfo platform;
aMsg << "Application: " << m_info.GetAppName() << eol;
aMsg << "Application: " << m_titleName << eol;
aMsg << "Version: " << m_info.GetBuildVersion() << eol;
aMsg << "Libraries:" << eol;
aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol;
+2 -1
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2010 Rafael Sokolowski <Rafael.Sokolowski@web.de>
* Copyright (C) 2010-2017 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2010-2019 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -49,6 +49,7 @@ private:
wxBitmap m_picTranslators;
wxBitmap m_picPackagers;
wxBitmap m_picLicense;
wxString m_titleName;
ABOUT_APP_INFO& m_info;
+42 -41
View File
@@ -1,8 +1,8 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version May 6 2016)
// C++ code generated with wxFormBuilder (version Mar 28 2019)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_about_base.h"
@@ -12,77 +12,78 @@
DIALOG_ABOUT_BASE::DIALOG_ABOUT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerTitle;
bSizerTitle = new wxBoxSizer( wxHORIZONTAL );
bSizerTitle->Add( 0, 0, 1, wxEXPAND, 5 );
m_bitmapApp = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bSizerTitle->Add( m_bitmapApp, 1, wxALIGN_CENTER|wxALL, 5 );
wxBoxSizer* b_apptitleSizer;
b_apptitleSizer = new wxBoxSizer( wxVERTICAL );
m_staticTextAppTitle = new wxStaticText( this, wxID_ANY, _("App Title"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
m_staticTextAppTitle = new wxStaticText( this, wxID_ANY, _("App Title"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
m_staticTextAppTitle->Wrap( -1 );
m_staticTextAppTitle->SetFont( wxFont( 14, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
b_apptitleSizer->Add( m_staticTextAppTitle, 0, wxALIGN_CENTER|wxALL, 5 );
m_staticTextCopyright = new wxStaticText( this, wxID_ANY, _("Copyright Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
m_staticTextCopyright = new wxStaticText( this, wxID_ANY, _("Copyright Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
m_staticTextCopyright->Wrap( -1 );
b_apptitleSizer->Add( m_staticTextCopyright, 0, wxALIGN_CENTER|wxALL, 1 );
m_staticTextBuildVersion = new wxStaticText( this, wxID_ANY, _("Build Version Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
m_staticTextBuildVersion = new wxStaticText( this, wxID_ANY, _("Build Version Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
m_staticTextBuildVersion->Wrap( -1 );
b_apptitleSizer->Add( m_staticTextBuildVersion, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 );
m_staticTextLibVersion = new wxStaticText( this, wxID_ANY, _("Lib Version Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
m_staticTextLibVersion = new wxStaticText( this, wxID_ANY, _("Lib Version Info"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL );
m_staticTextLibVersion->Wrap( -1 );
b_apptitleSizer->Add( m_staticTextLibVersion, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxTOP, 5 );
bSizerTitle->Add( b_apptitleSizer, 10, wxALL|wxEXPAND, 5 );
bSizerTitle->Add( 0, 0, 2, wxEXPAND, 5 );
bSizerMain->Add( bSizerTitle, 0, wxEXPAND, 5 );
m_auiNotebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_SCROLL_BUTTONS|wxAUI_NB_TAB_FIXED_WIDTH );
m_auiNotebook->SetMinSize( wxSize( 750,350 ) );
bSizerMain->Add( m_auiNotebook, 2, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizerButtons;
bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
m_btShowVersionInfo = new wxButton( this, wxID_COPY, _("Show Version Info"), wxDefaultPosition, wxDefaultSize, 0 );
m_btShowVersionInfo = new wxButton( this, wxID_COPY, _("&Show Version Info"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_btShowVersionInfo, 0, wxALL, 5 );
m_btCopyVersionInfo = new wxButton( this, wxID_COPY, _("Copy Version Info"), wxDefaultPosition, wxDefaultSize, 0 );
m_btCopyVersionInfo = new wxButton( this, wxID_COPY, _("&Copy Version Info"), wxDefaultPosition, wxDefaultSize, 0 );
m_btCopyVersionInfo->SetToolTip( _("Copy KiCad version info to the clipboard") );
bSizerButtons->Add( m_btCopyVersionInfo, 0, wxALL, 5 );
m_btOk = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_btOk->SetDefault();
m_btOk = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_btOk->SetDefault();
bSizerButtons->Add( m_btOk, 0, wxALL, 5 );
bSizerMain->Add( bSizerButtons, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
this->SetSizer( bSizerMain );
this->Layout();
// Connect Events
m_btShowVersionInfo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ABOUT_BASE::onShowVersionInfo ), NULL, this );
m_btCopyVersionInfo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ABOUT_BASE::onCopyVersionInfo ), NULL, this );
@@ -93,5 +94,5 @@ DIALOG_ABOUT_BASE::~DIALOG_ABOUT_BASE()
// Disconnect Events
m_btShowVersionInfo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ABOUT_BASE::onShowVersionInfo ), NULL, this );
m_btCopyVersionInfo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ABOUT_BASE::onCopyVersionInfo ), NULL, this );
}
+39 -260
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<FileVersion major="1" minor="15" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@@ -14,6 +14,8 @@
<property name="file">dialog_about_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">MyProject</property>
<property name="namespace"></property>
@@ -24,6 +26,7 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@@ -52,42 +55,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerMain</property>
@@ -168,29 +135,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
@@ -235,6 +179,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">App Title</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -252,7 +197,7 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxALIGN_CENTRE</property>
<property name="style">wxALIGN_CENTER_HORIZONTAL</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
@@ -260,29 +205,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
@@ -318,6 +240,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Copyright Info</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -335,7 +258,7 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxALIGN_CENTRE</property>
<property name="style">wxALIGN_CENTER_HORIZONTAL</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
@@ -343,29 +266,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
@@ -401,6 +301,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Build Version Info</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -418,7 +319,7 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxALIGN_CENTRE</property>
<property name="style">wxALIGN_CENTER_HORIZONTAL</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
@@ -426,29 +327,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
@@ -484,6 +362,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Lib Version Info</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -501,7 +380,7 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxALIGN_CENTRE</property>
<property name="style">wxALIGN_CENTER_HORIZONTAL</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
@@ -509,29 +388,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
@@ -606,37 +462,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAuiNotebookAllowDND"></event>
<event name="OnAuiNotebookBeginDrag"></event>
<event name="OnAuiNotebookButton"></event>
<event name="OnAuiNotebookDragMotion"></event>
<event name="OnAuiNotebookEndDrag"></event>
<event name="OnAuiNotebookPageChanged"></event>
<event name="OnAuiNotebookPageChanging"></event>
<event name="OnAuiNotebookPageClose"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
@@ -663,25 +488,31 @@
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_COPY</property>
<property name="label">Show Version Info</property>
<property name="label">&amp;Show Version Info</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -696,6 +527,8 @@
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
@@ -711,29 +544,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">onShowVersionInfo</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
@@ -751,25 +561,31 @@
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_COPY</property>
<property name="label">Copy Version Info</property>
<property name="label">&amp;Copy Version Info</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -784,6 +600,8 @@
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
@@ -799,29 +617,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">onCopyVersionInfo</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
@@ -839,25 +634,31 @@
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">1</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_OK</property>
<property name="label">OK</property>
<property name="label">&amp;OK</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -872,6 +673,8 @@
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
@@ -886,30 +689,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
+11 -13
View File
@@ -1,12 +1,11 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version May 6 2016)
// C++ code generated with wxFormBuilder (version Mar 28 2019)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_ABOUT_BASE_H__
#define __DIALOG_ABOUT_BASE_H__
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
@@ -31,10 +30,10 @@
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_ABOUT_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_ABOUT_BASE : public wxDialog
class DIALOG_ABOUT_BASE : public wxDialog
{
private:
protected:
wxStaticBitmap* m_bitmapApp;
wxStaticText* m_staticTextAppTitle;
@@ -45,17 +44,16 @@ class DIALOG_ABOUT_BASE : public wxDialog
wxButton* m_btShowVersionInfo;
wxButton* m_btCopyVersionInfo;
wxButton* m_btOk;
// Virtual event handlers, overide them in your derived class
virtual void onShowVersionInfo( wxCommandEvent& event ) { event.Skip(); }
virtual void onCopyVersionInfo( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_ABOUT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 750,471 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_ABOUT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 750,471 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_ABOUT_BASE();
};
#endif //__DIALOG_ABOUT_BASE_H__
+7
View File
@@ -26,6 +26,7 @@
#include <kiway_player.h>
#include <wx/evtloop.h>
#include <pgm_base.h>
#include <tool/tool_manager.h>
#include <eda_rect.h>
#include <wx/display.h>
#include <wx/grid.h>
@@ -92,6 +93,12 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl
// Inherit units from parent
m_units = kiwayHolder->GetUserUnits();
// Don't mouse-warp after a dialog run from the context menu
TOOL_MANAGER* toolMgr = kiwayHolder->GetToolManager();
if( toolMgr )
toolMgr->VetoContextMenuMouseWarp();
// Set up the message bus
SetKiway( this, &kiwayHolder->Kiway() );
}
+83 -83
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jul 11 2018)
// C++ code generated with wxFormBuilder (version Mar 28 2019)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -12,29 +12,29 @@
DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerUpperMain;
bSizerUpperMain = new wxBoxSizer( wxHORIZONTAL );
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_panelFreeColors = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerUpperFreeColors;
bSizerUpperFreeColors = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerPanels;
bSizerPanels = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbSizerViewRGB;
sbSizerViewRGB = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, _("RGB") ), wxVERTICAL );
m_RgbBitmap = new wxStaticBitmap( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 264,264 ), 0 );
m_RgbBitmap->SetMinSize( wxSize( 264,264 ) );
sbSizerViewRGB->Add( m_RgbBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
wxFlexGridSizer* fgSizerRGB;
fgSizerRGB = new wxFlexGridSizer( 0, 3, 0, 0 );
fgSizerRGB->AddGrowableCol( 0 );
@@ -42,109 +42,109 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
fgSizerRGB->AddGrowableCol( 2 );
fgSizerRGB->SetFlexibleDirection( wxBOTH );
fgSizerRGB->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticTextR = new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY, _("Red:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextR->Wrap( -1 );
fgSizerRGB->Add( m_staticTextR, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_staticTextG = new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY, _("Green:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextG->Wrap( -1 );
fgSizerRGB->Add( m_staticTextG, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_staticTextB = new wxStaticText( sbSizerViewRGB->GetStaticBox(), wxID_ANY, _("Blue:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextB->Wrap( -1 );
fgSizerRGB->Add( m_staticTextB, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_spinCtrlRed = new wxSpinCtrl( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 );
m_spinCtrlRed->SetMinSize( wxSize( 80,-1 ) );
fgSizerRGB->Add( m_spinCtrlRed, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_spinCtrlGreen = new wxSpinCtrl( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 );
m_spinCtrlGreen->SetMinSize( wxSize( 80,-1 ) );
fgSizerRGB->Add( m_spinCtrlGreen, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_spinCtrlBlue = new wxSpinCtrl( sbSizerViewRGB->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 );
m_spinCtrlBlue->SetMinSize( wxSize( 80,-1 ) );
fgSizerRGB->Add( m_spinCtrlBlue, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbSizerViewRGB->Add( fgSizerRGB, 0, wxEXPAND, 5 );
bSizerPanels->Add( sbSizerViewRGB, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* sbSizerViewHSV;
sbSizerViewHSV = new wxStaticBoxSizer( new wxStaticBox( m_panelFreeColors, wxID_ANY, _("HSV") ), wxHORIZONTAL );
wxBoxSizer* bSizer10;
bSizer10 = new wxBoxSizer( wxVERTICAL );
m_HsvBitmap = new wxStaticBitmap( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 264,264 ), 0 );
m_HsvBitmap->SetMinSize( wxSize( 264,264 ) );
bSizer10->Add( m_HsvBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
wxFlexGridSizer* fgSizerHSV;
fgSizerHSV = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizerHSV->AddGrowableCol( 0 );
fgSizerHSV->AddGrowableCol( 1 );
fgSizerHSV->SetFlexibleDirection( wxBOTH );
fgSizerHSV->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticTextHue = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, _("Hue:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextHue->Wrap( -1 );
fgSizerHSV->Add( m_staticTextHue, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_staticTextSat = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, _("Saturation:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextSat->Wrap( -1 );
fgSizerHSV->Add( m_staticTextSat, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_spinCtrlHue = new wxSpinCtrl( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 359, 0 );
m_spinCtrlHue->SetMinSize( wxSize( 80,-1 ) );
fgSizerHSV->Add( m_spinCtrlHue, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_spinCtrlSaturation = new wxSpinCtrl( sbSizerViewHSV->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 128 );
m_spinCtrlSaturation->SetMinSize( wxSize( 80,-1 ) );
fgSizerHSV->Add( m_spinCtrlSaturation, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizer10->Add( fgSizerHSV, 0, wxEXPAND, 5 );
sbSizerViewHSV->Add( bSizer10, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerBright;
bSizerBright = new wxBoxSizer( wxVERTICAL );
m_staticTextBright = new wxStaticText( sbSizerViewHSV->GetStaticBox(), wxID_ANY, _("Value:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextBright->Wrap( -1 );
bSizerBright->Add( m_staticTextBright, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_sliderBrightness = new wxSlider( sbSizerViewHSV->GetStaticBox(), wxID_ANY, 255, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL );
m_sliderBrightness = new wxSlider( sbSizerViewHSV->GetStaticBox(), wxID_ANY, 255, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_INVERSE|wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL );
bSizerBright->Add( m_sliderBrightness, 1, wxTOP|wxRIGHT|wxALIGN_CENTER_HORIZONTAL, 5 );
sbSizerViewHSV->Add( bSizerBright, 0, wxEXPAND, 5 );
bSizerPanels->Add( sbSizerViewHSV, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 );
bSizerUpperFreeColors->Add( bSizerPanels, 1, wxEXPAND, 5 );
m_panelFreeColors->SetSizer( bSizerUpperFreeColors );
m_panelFreeColors->Layout();
bSizerUpperFreeColors->Fit( m_panelFreeColors );
m_notebook->AddPage( m_panelFreeColors, _("Color Picker"), true );
m_panelDefinedColors = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_SizerDefinedColors = new wxBoxSizer( wxVERTICAL );
m_fgridColor = new wxFlexGridSizer( 0, 10, 0, 0 );
m_fgridColor->AddGrowableCol( 1 );
m_fgridColor->AddGrowableCol( 3 );
@@ -153,78 +153,78 @@ DIALOG_COLOR_PICKER_BASE::DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID
m_fgridColor->AddGrowableCol( 9 );
m_fgridColor->SetFlexibleDirection( wxBOTH );
m_fgridColor->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_SizerDefinedColors->Add( m_fgridColor, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 );
m_panelDefinedColors->SetSizer( m_SizerDefinedColors );
m_panelDefinedColors->Layout();
m_SizerDefinedColors->Fit( m_panelDefinedColors );
m_notebook->AddPage( m_panelDefinedColors, _("Defined Colors"), false );
bSizerUpperMain->Add( m_notebook, 0, wxEXPAND | wxALL, 5 );
m_SizerTransparency = new wxBoxSizer( wxVERTICAL );
m_SizerTransparency->Add( 0, 20, 0, wxTOP, 5 );
m_opacityLabel = new wxStaticText( this, wxID_ANY, _("Opacity:"), wxDefaultPosition, wxDefaultSize, 0 );
m_opacityLabel->Wrap( -1 );
m_SizerTransparency->Add( m_opacityLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxLEFT, 5 );
m_sliderTransparency = new wxSlider( this, wxID_ANY, 80, 20, 100, wxDefaultPosition, wxDefaultSize, wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL );
m_sliderTransparency = new wxSlider( this, wxID_ANY, 80, 20, 100, wxDefaultPosition, wxDefaultSize, wxSL_INVERSE|wxSL_LABELS|wxSL_LEFT|wxSL_VERTICAL );
m_SizerTransparency->Add( m_sliderTransparency, 1, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_HORIZONTAL, 10 );
bSizerUpperMain->Add( m_SizerTransparency, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bSizerUpperMain->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bSizerMain->Add( bSizerUpperMain, 0, wxEXPAND, 5 );
m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticline, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bButtonsSizer;
bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
m_staticTextOldColor = new wxStaticText( this, wxID_ANY, _("Preview (old / new):"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextOldColor->Wrap( -1 );
bButtonsSizer->Add( m_staticTextOldColor, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_OldColorRect = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 );
m_OldColorRect->SetMinSize( wxSize( 30,22 ) );
bButtonsSizer->Add( m_OldColorRect, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_NewColorRect = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 );
m_NewColorRect->SetMinSize( wxSize( 30,22 ) );
bButtonsSizer->Add( m_NewColorRect, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bButtonsSizer->Add( m_sdbSizer, 1, wxALL, 5 );
bSizerMain->Add( bButtonsSizer, 1, wxEXPAND|wxLEFT, 10 );
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
this->Centre( wxBOTH );
// Connect Events
m_RgbBitmap->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( DIALOG_COLOR_PICKER_BASE::onRGBMouseClick ), NULL, this );
m_RgbBitmap->Connect( wxEVT_MOTION, wxMouseEventHandler( DIALOG_COLOR_PICKER_BASE::onRGBMouseDrag ), NULL, this );
@@ -285,5 +285,5 @@ DIALOG_COLOR_PICKER_BASE::~DIALOG_COLOR_PICKER_BASE()
m_sliderTransparency->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeAlpha ), NULL, this );
m_sliderTransparency->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeAlpha ), NULL, this );
m_sliderTransparency->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( DIALOG_COLOR_PICKER_BASE::OnChangeAlpha ), NULL, this );
}
File diff suppressed because it is too large Load Diff
+9 -11
View File
@@ -1,12 +1,11 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jul 11 2018)
// C++ code generated with wxFormBuilder (version Mar 28 2019)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_COLOR_PICKER_BASE_H__
#define __DIALOG_COLOR_PICKER_BASE_H__
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
@@ -41,7 +40,7 @@
class DIALOG_COLOR_PICKER_BASE : public DIALOG_SHIM
{
private:
protected:
wxNotebook* m_notebook;
wxPanel* m_panelFreeColors;
@@ -72,7 +71,7 @@ class DIALOG_COLOR_PICKER_BASE : public DIALOG_SHIM
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void onRGBMouseClick( wxMouseEvent& event ) { event.Skip(); }
virtual void onRGBMouseDrag( wxMouseEvent& event ) { event.Skip(); }
@@ -85,13 +84,12 @@ class DIALOG_COLOR_PICKER_BASE : public DIALOG_SHIM
virtual void OnChangeEditSat( wxSpinEvent& event ) { event.Skip(); }
virtual void OnChangeBrightness( wxScrollEvent& event ) { event.Skip(); }
virtual void OnChangeAlpha( wxScrollEvent& event ) { event.Skip(); }
public:
DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Color Picker"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_COLOR_PICKER_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Color Picker"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_COLOR_PICKER_BASE();
};
#endif //__DIALOG_COLOR_PICKER_BASE_H__
+9 -2
View File
@@ -339,8 +339,15 @@ void DIALOG_CONFIGURE_PATHS::OnGridCellChanging( wxGridEvent& event )
}
else if( col == EV_NAME_COL && m_EnvVars->GetCellValue( row, EV_NAME_COL ) != text )
{
// Changing name; clear external flag
m_EnvVars->SetCellValue( row, EV_FLAG_COL, wxEmptyString );
if( text == PROJECT_VAR_NAME ) // This env var name is reserved and cannot be added here:
{
wxMessageBox( wxString::Format(
_( "The name %s is reserved, and cannot be used here" ),
PROJECT_VAR_NAME ) );
event.Veto();
}
else // Changing name; clear external flag
m_EnvVars->SetCellValue( row, EV_FLAG_COL, wxEmptyString );
}
}
}
+40 -309
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<FileVersion major="1" minor="15" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@@ -14,6 +14,7 @@
<property name="file">dialog_configure_paths_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">DIALOG_CONFIGURE_PATHS_BASE</property>
<property name="namespace"></property>
@@ -52,41 +53,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI">OnUpdateUI</event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
@@ -105,7 +71,6 @@
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
@@ -132,10 +97,10 @@
<property name="cell_vert_alignment">wxALIGN_TOP</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="col_label_size">22</property>
<property name="col_label_values">&quot;Name&quot; &quot;Path&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
<property name="cols">2</property>
<property name="column_sizes">150,454</property>
<property name="context_help"></property>
@@ -178,10 +143,10 @@
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="row_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="row_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="row_label_size">0</property>
<property name="row_label_values"></property>
<property name="row_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
<property name="row_sizes"></property>
<property name="rows">1</property>
<property name="show">1</property>
@@ -192,61 +157,8 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnGridCellChange">OnGridCellChange</event>
<event name="OnGridCellLeftClick"></event>
<event name="OnGridCellLeftDClick"></event>
<event name="OnGridCellRightClick"></event>
<event name="OnGridCellRightDClick"></event>
<event name="OnGridCmdCellChange"></event>
<event name="OnGridCmdCellLeftClick"></event>
<event name="OnGridCmdCellLeftDClick"></event>
<event name="OnGridCmdCellRightClick"></event>
<event name="OnGridCmdCellRightDClick"></event>
<event name="OnGridCmdColSize"></event>
<event name="OnGridCmdEditorCreated"></event>
<event name="OnGridCmdEditorHidden"></event>
<event name="OnGridCmdEditorShown"></event>
<event name="OnGridCmdLabelLeftClick"></event>
<event name="OnGridCmdLabelLeftDClick"></event>
<event name="OnGridCmdLabelRightClick"></event>
<event name="OnGridCmdLabelRightDClick"></event>
<event name="OnGridCmdRangeSelect"></event>
<event name="OnGridCmdRowSize"></event>
<event name="OnGridCmdSelectCell"></event>
<event name="OnGridColSize"></event>
<event name="OnGridEditorCreated"></event>
<event name="OnGridEditorHidden"></event>
<event name="OnGridEditorShown"></event>
<event name="OnGridLabelLeftClick"></event>
<event name="OnGridLabelLeftDClick"></event>
<event name="OnGridLabelRightClick"></event>
<event name="OnGridLabelRightDClick"></event>
<event name="OnGridRangeSelect"></event>
<event name="OnGridRowSize"></event>
<event name="OnGridSelectCell"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize">OnGridSize</event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
@@ -280,6 +192,7 @@
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
@@ -293,9 +206,10 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="hover"></property>
<property name="id">wxID_ANY</property>
<property name="label">Add Environment Variable</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -310,8 +224,9 @@
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="selected"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
@@ -326,29 +241,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnAddEnvVar</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
@@ -383,6 +275,7 @@
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
@@ -396,9 +289,10 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="hover"></property>
<property name="id">wxID_ANY</property>
<property name="label">Delete Environment Variable</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -413,8 +307,9 @@
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="selected"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
@@ -429,29 +324,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnRemoveEnvVar</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
@@ -470,7 +342,6 @@
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">protected</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
@@ -497,10 +368,10 @@
<property name="cell_vert_alignment">wxALIGN_TOP</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="col_label_size">22</property>
<property name="col_label_values">&quot;Alias&quot; &quot;Path&quot; &quot;Description&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
<property name="cols">3</property>
<property name="column_sizes">150,300,154</property>
<property name="context_help"></property>
@@ -543,10 +414,10 @@
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="row_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="row_label_horiz_alignment">wxALIGN_CENTER</property>
<property name="row_label_size">0</property>
<property name="row_label_values"></property>
<property name="row_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="row_label_vert_alignment">wxALIGN_CENTER</property>
<property name="row_sizes"></property>
<property name="rows">1</property>
<property name="show">1</property>
@@ -557,61 +428,8 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnGridCellChange">OnGridCellChange</event>
<event name="OnGridCellLeftClick"></event>
<event name="OnGridCellLeftDClick"></event>
<event name="OnGridCellRightClick">OnGridCellRightClick</event>
<event name="OnGridCellRightDClick"></event>
<event name="OnGridCmdCellChange"></event>
<event name="OnGridCmdCellLeftClick"></event>
<event name="OnGridCmdCellLeftDClick"></event>
<event name="OnGridCmdCellRightClick"></event>
<event name="OnGridCmdCellRightDClick"></event>
<event name="OnGridCmdColSize"></event>
<event name="OnGridCmdEditorCreated"></event>
<event name="OnGridCmdEditorHidden"></event>
<event name="OnGridCmdEditorShown"></event>
<event name="OnGridCmdLabelLeftClick"></event>
<event name="OnGridCmdLabelLeftDClick"></event>
<event name="OnGridCmdLabelRightClick"></event>
<event name="OnGridCmdLabelRightDClick"></event>
<event name="OnGridCmdRangeSelect"></event>
<event name="OnGridCmdRowSize"></event>
<event name="OnGridCmdSelectCell"></event>
<event name="OnGridColSize"></event>
<event name="OnGridEditorCreated"></event>
<event name="OnGridEditorHidden"></event>
<event name="OnGridEditorShown"></event>
<event name="OnGridLabelLeftClick"></event>
<event name="OnGridLabelLeftDClick"></event>
<event name="OnGridLabelRightClick"></event>
<event name="OnGridLabelRightDClick"></event>
<event name="OnGridRangeSelect"></event>
<event name="OnGridRowSize"></event>
<event name="OnGridSelectCell"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
@@ -645,6 +463,7 @@
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
@@ -658,9 +477,10 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="hover"></property>
<property name="id">wxID_ANY</property>
<property name="label">Add Path</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -675,8 +495,9 @@
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="selected"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
@@ -691,29 +512,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnAddSearchPath</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
@@ -738,6 +536,7 @@
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
@@ -751,9 +550,10 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="hover"></property>
<property name="id">wxID_ANY</property>
<property name="label">Move Up</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -768,8 +568,9 @@
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="selected"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
@@ -784,29 +585,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnSearchPathMoveUp</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
@@ -831,6 +609,7 @@
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
@@ -844,9 +623,10 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="hover"></property>
<property name="id">wxID_ANY</property>
<property name="label">Move Down</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -861,8 +641,9 @@
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="selected"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
@@ -877,29 +658,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnSearchPathMoveDown</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
@@ -934,6 +692,7 @@
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
@@ -947,9 +706,10 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="hover"></property>
<property name="id">wxID_ANY</property>
<property name="label">Delete Path</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@@ -964,8 +724,9 @@
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="selected"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
@@ -980,29 +741,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnDeleteSearchPath</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
@@ -1025,14 +763,7 @@
<property name="minimum_size"></property>
<property name="name">m_sdbSizer</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick"></event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick">OnHelp</event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick"></event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>
</object>
</object>
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 30 2017)
// C++ code generated with wxFormBuilder (version Aug 15 2019)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -12,33 +12,36 @@
DIALOG_DISPLAY_HTML_TEXT_BASE::DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
m_htmlWindow = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
m_htmlWindow->SetMinSize( wxSize( 400,250 ) );
bMainSizer->Add( m_htmlWindow, 1, wxALL|wxEXPAND, 5 );
m_buttonClose = new wxButton( this, wxID_CANCEL, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonClose->SetDefault();
bMainSizer->Add( m_buttonClose, 0, wxALIGN_RIGHT|wxALL, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1->Realize();
bMainSizer->Add( m_sdbSizer1, 0, wxBOTTOM|wxEXPAND, 5 );
this->SetSizer( bMainSizer );
this->Layout();
bMainSizer->Fit( this );
// Connect Events
m_htmlWindow->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnHTMLLinkClicked ), NULL, this );
m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnCloseButtonClick ), NULL, this );
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnOKButtonClick ), NULL, this );
}
DIALOG_DISPLAY_HTML_TEXT_BASE::~DIALOG_DISPLAY_HTML_TEXT_BASE()
{
// Disconnect Events
m_htmlWindow->Disconnect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnHTMLLinkClicked ), NULL, this );
m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnCloseButtonClick ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnOKButtonClick ), NULL, this );
}
+18 -145
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<FileVersion major="1" minor="15" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@@ -14,6 +14,8 @@
<property name="file">dialog_display_info_HTML_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_display_info_HTML</property>
<property name="namespace"></property>
@@ -24,6 +26,7 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@@ -52,52 +55,16 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size">-1,-1</property>
<property name="name">bMainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxHtmlWindow" expanded="1">
<object class="wxHtmlWindow" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@@ -149,120 +116,26 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHtmlCellClicked"></event>
<event name="OnHtmlCellHover"></event>
<event name="OnHtmlLinkClicked">OnHTMLLinkClicked</event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxALL</property>
<property name="flag">wxBOTTOM|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_CANCEL</property>
<property name="label">OK</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>
<property name="Cancel">0</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">1</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_buttonClose</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="name">m_sdbSizer1</property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnCloseButtonClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<event name="OnOKButtonClick">OnOKButtonClick</event>
</object>
</object>
</object>
+13 -14
View File
@@ -1,12 +1,11 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 30 2017)
// C++ code generated with wxFormBuilder (version Aug 15 2019)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_DISPLAY_INFO_HTML_BASE_H__
#define __DIALOG_DISPLAY_INFO_HTML_BASE_H__
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
@@ -18,8 +17,8 @@
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
@@ -31,21 +30,21 @@
class DIALOG_DISPLAY_HTML_TEXT_BASE : public DIALOG_SHIM
{
private:
protected:
wxButton* m_buttonClose;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
// Virtual event handlers, overide them in your derived class
virtual void OnHTMLLinkClicked( wxHtmlLinkEvent& event ) { event.Skip(); }
virtual void OnCloseButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxHtmlWindow* m_htmlWindow;
DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DISPLAY_HTML_TEXT_BASE();
};
#endif //__DIALOG_DISPLAY_INFO_HTML_BASE_H__
-91
View File
@@ -1,91 +0,0 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 21 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_exit_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_EXIT_BASE::DIALOG_EXIT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerUpper;
bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
m_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bSizerUpper->Add( m_bitmap, 0, wxALL, 5 );
wxBoxSizer* bSizerMessages;
bSizerMessages = new wxBoxSizer( wxVERTICAL );
m_TextInfo = new wxStaticText( this, wxID_ANY, _("Save changes?"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextInfo->Wrap( -1 );
m_TextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizerMessages->Add( m_TextInfo, 0, wxALL, 5 );
m_staticTextWarningMessage = new wxStaticText( this, wxID_ANY, _("If you don't save, all your changes will be permanently lost."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextWarningMessage->Wrap( 300 );
bSizerMessages->Add( m_staticTextWarningMessage, 0, wxALL, 5 );
bSizerUpper->Add( bSizerMessages, 1, wxEXPAND, 5 );
bSizerMain->Add( bSizerUpper, 1, wxEXPAND|wxALL, 5 );
m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticline, 0, wxEXPAND|wxLEFT|wxRIGHT, 10 );
m_buttonSizer = new wxBoxSizer( wxHORIZONTAL );
m_ApplyToAllOpt = new wxCheckBox( this, wxID_ANY, _("Apply to all"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonSizer->Add( m_ApplyToAllOpt, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxTOP, 5 );
m_buttonSizer->Add( 20, 0, 1, wxRIGHT|wxLEFT, 5 );
m_DiscardButton = new wxButton( this, wxID_ANY, _("Discard Changes"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonSizer->Add( m_DiscardButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_buttonSizer->Add( 20, 0, 0, wxRIGHT|wxLEFT, 5 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
m_buttonSizer->Add( m_sdbSizer, 0, wxBOTTOM|wxTOP, 5 );
bSizerMain->Add( m_buttonSizer, 0, wxEXPAND|wxLEFT, 5 );
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
this->Centre( wxBOTH );
// Connect Events
m_DiscardButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXIT_BASE::OnDiscard ), NULL, this );
m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXIT_BASE::OnSave ), NULL, this );
}
DIALOG_EXIT_BASE::~DIALOG_EXIT_BASE()
{
// Disconnect Events
m_DiscardButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXIT_BASE::OnDiscard ), NULL, this );
m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXIT_BASE::OnSave ), NULL, this );
}
-511
View File
@@ -1,511 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="15" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_exit_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_exit_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center">wxBOTH</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">DIALOG_EXIT_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerUpper</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBitmap" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap">Load From File; </property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_bitmap</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerMessages</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font">,90,92,-1,70,0</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Save changes?</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_TextInfo</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">If you don&apos;t save, all your changes will be permanently lost.</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextWarningMessage</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">300</property>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticline</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxLI_HORIZONTAL</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size">-1,-1</property>
<property name="name">m_buttonSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxTOP</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Apply to all</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_ApplyToAllOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">public</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">20</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="current"></property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="disabled"></property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="focus"></property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Discard Changes</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_DiscardButton</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">public</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="pressed"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnDiscard</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">20</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>
<property name="Help">0</property>
<property name="No">0</property>
<property name="OK">1</property>
<property name="Save">0</property>
<property name="Yes">0</property>
<property name="minimum_size"></property>
<property name="name">m_sdbSizer</property>
<property name="permission">protected</property>
<event name="OnOKButtonClick">OnSave</event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>
-63
View File
@@ -1,63 +0,0 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 21 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "dialog_shim.h"
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/statbmp.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/checkbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_EXIT_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_EXIT_BASE : public DIALOG_SHIM
{
private:
protected:
wxStaticBitmap* m_bitmap;
wxStaticText* m_TextInfo;
wxStaticText* m_staticTextWarningMessage;
wxStaticLine* m_staticline;
wxBoxSizer* m_buttonSizer;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnDiscard( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSave( wxCommandEvent& event ) { event.Skip(); }
public:
wxCheckBox* m_ApplyToAllOpt;
wxButton* m_DiscardButton;
DIALOG_EXIT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EXIT_BASE();
};
+88 -25
View File
@@ -21,20 +21,51 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <pgm_base.h>
#include <dialog_shim.h>
#include <kiface_i.h>
#include <bitmap_types.h>
#include <bitmaps.h>
#include <wx/graphics.h>
#include "panel_common_settings.h"
PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( DIALOG_SHIM* aDialog, wxWindow* aParent ) :
PANEL_COMMON_SETTINGS_BASE( aParent ),
m_dialog( aDialog ),
m_last_scale( -1 )
#include <bitmap_types.h>
#include <bitmaps.h>
#include <dialog_shim.h>
#include <dpi_scaling.h>
#include <kiface_i.h>
#include <pgm_base.h>
#include <id.h>
#include <wx/graphics.h>
static constexpr int dpi_scaling_precision = 1;
static constexpr double dpi_scaling_increment = 0.5;
PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( DIALOG_SHIM* aDialog, wxWindow* aParent )
: PANEL_COMMON_SETTINGS_BASE( aParent ),
m_dialog( aDialog ),
m_last_scale( -1 )
{
m_scaleSlider->SetStep( 25 );
m_canvasScaleCtrl->SetRange(
DPI_SCALING::GetMinScaleFactor(), DPI_SCALING::GetMaxScaleFactor() );
m_canvasScaleCtrl->SetDigits( dpi_scaling_precision );
m_canvasScaleCtrl->SetIncrement( dpi_scaling_increment );
m_canvasScaleCtrl->SetValue( DPI_SCALING::GetDefaultScaleFactor() );
m_canvasScaleCtrl->SetToolTip(
_( "Set the scale for the canvas."
"\n\n"
"On high-DPI displays on some platforms, KiCad cannot determine the "
"scaling factor. In this case you may need to set this to a value to "
"match your system's DPI scaling. 2.0 is a common value. "
"\n\n"
"If this does not match the system DPI scaling, the canvas will "
"not match the window size and cursor position." ) );
m_canvasScaleAuto->SetToolTip(
_( "Use an automatic value for the canvas scale."
"\n\n"
"On some platforms, the automatic value is incorrect and should be "
"set manually." ) );
m_iconScaleSlider->SetStep( 25 );
m_textEditorBtn->SetBitmap( KiBitmap( folder_xpm ) );
m_pdfViewerBtn->SetBitmap( KiBitmap( folder_xpm ) );
@@ -63,18 +94,24 @@ bool PANEL_COMMON_SETTINGS::TransferDataToWindow()
commonSettings->Read( CAIRO_ANTIALIASING_MODE_KEY, &antialiasingMode, 0 );
m_antialiasingFallback->SetSelection( antialiasingMode );
int scale_fourths;
commonSettings->Read( ICON_SCALE_KEY, &scale_fourths );
int icon_scale_fourths;
commonSettings->Read( ICON_SCALE_KEY, &icon_scale_fourths );
if( scale_fourths <= 0 )
if( icon_scale_fourths <= 0 )
{
m_scaleAuto->SetValue( true );
m_scaleSlider->SetValue( 25 * KiIconScale( GetParent() ) );
m_iconScaleAuto->SetValue( true );
m_iconScaleSlider->SetValue( 25 * KiIconScale( GetParent() ) );
}
else
{
m_scaleAuto->SetValue( false );
m_scaleSlider->SetValue( scale_fourths * 25 );
m_iconScaleAuto->SetValue( false );
m_iconScaleSlider->SetValue( icon_scale_fourths * 25 );
}
{
const DPI_SCALING dpi( commonSettings, this );
m_canvasScaleCtrl->SetValue( dpi.GetScaleFactor() );
m_canvasScaleAuto->SetValue( dpi.GetCanvasIsAutoScaled() );
}
bool option;
@@ -111,9 +148,14 @@ bool PANEL_COMMON_SETTINGS::TransferDataFromWindow()
commonSettings->Write( CAIRO_ANTIALIASING_MODE_KEY, m_antialiasingFallback->GetSelection() );
const int scale_fourths = m_scaleAuto->GetValue() ? -1 : m_scaleSlider->GetValue() / 25;
const int scale_fourths = m_iconScaleAuto->GetValue() ? -1 : m_iconScaleSlider->GetValue() / 25;
commonSettings->Write( ICON_SCALE_KEY, scale_fourths );
{
DPI_SCALING dpi( commonSettings, this );
dpi.SetDpiConfig( m_canvasScaleAuto->GetValue(), m_canvasScaleCtrl->GetValue() );
}
commonSettings->Write( USE_ICONS_IN_MENUS_KEY, m_checkBoxIconsInMenus->GetValue() );
commonSettings->Write( ENBL_ZOOM_NO_CENTER_KEY, !m_ZoomCenterOpt->GetValue() );
commonSettings->Write( ENBL_MOUSEWHEEL_PAN_KEY, m_MousewheelPANOpt->GetValue() );
@@ -131,21 +173,42 @@ bool PANEL_COMMON_SETTINGS::TransferDataFromWindow()
void PANEL_COMMON_SETTINGS::OnScaleSlider( wxScrollEvent& aEvent )
{
m_scaleAuto->SetValue( false );
m_iconScaleAuto->SetValue( false );
}
void PANEL_COMMON_SETTINGS::OnScaleAuto( wxCommandEvent& aEvent )
void PANEL_COMMON_SETTINGS::OnIconScaleAuto( wxCommandEvent& aEvent )
{
if( m_scaleAuto->GetValue() )
if( m_iconScaleAuto->GetValue() )
{
m_last_scale = m_scaleSlider->GetValue();
m_scaleSlider->SetValue( 25 * KiIconScale( GetParent() ) );
m_last_scale = m_iconScaleAuto->GetValue();
m_iconScaleSlider->SetValue( 25 * KiIconScale( GetParent() ) );
}
else
{
if( m_last_scale >= 0 )
m_scaleSlider->SetValue( m_last_scale );
m_iconScaleSlider->SetValue( m_last_scale );
}
}
void PANEL_COMMON_SETTINGS::OnCanvasScaleChange( wxCommandEvent& aEvent )
{
m_canvasScaleAuto->SetValue( false );
}
void PANEL_COMMON_SETTINGS::OnCanvasScaleAuto( wxCommandEvent& aEvent )
{
const bool automatic = m_canvasScaleAuto->GetValue();
if( automatic )
{
// set the scale to the auto value, without consulting the config
DPI_SCALING dpi( nullptr, this );
// update the field (no events sent)
m_canvasScaleCtrl->SetValue( dpi.GetScaleFactor() );
}
}
+12 -2
View File
@@ -40,10 +40,20 @@ protected:
bool TransferDataToWindow() override;
void OnScaleSlider( wxScrollEvent& aEvent ) override;
void OnScaleAuto( wxCommandEvent& aEvent ) override;
void OnIconScaleAuto( wxCommandEvent& aEvent ) override;
void OnTextEditorClick( wxCommandEvent& event ) override;
void OnPDFViewerClick( wxCommandEvent& event ) override;
void onUpdateUIPdfPath( wxUpdateUIEvent& event ) override;
void onUpdateUIPdfPath( wxUpdateUIEvent& event ) override;
/**
* Event fired when the canvas scale field is modified
*/
void OnCanvasScaleChange( wxCommandEvent& aEvent ) override;
/**
* Event fired when the canvas auto-scale option is changed
*/
void OnCanvasScaleAuto( wxCommandEvent& aEvent ) override;
DIALOG_SHIM* m_dialog;
+39 -34
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jan 5 2019)
// C++ code generated with wxFormBuilder (version Nov 10 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -136,25 +136,26 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
m_staticTexticonscale = new wxStaticText( sbSizerIconsOpts->GetStaticBox(), wxID_ANY, _("Icon scale:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTexticonscale->Wrap( -1 );
fgSizer11->Add( m_staticTexticonscale, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 4 );
fgSizer11->Add( m_staticTexticonscale, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 4 );
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxHORIZONTAL );
m_iconScaleSlider = new STEPPED_SLIDER( sbSizerIconsOpts->GetStaticBox(), wxID_ANY, 50, 50, 275, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
m_iconScaleSlider->SetMinSize( wxSize( 240,-1 ) );
m_scaleSlider = new STEPPED_SLIDER( sbSizerIconsOpts->GetStaticBox(), wxID_ANY, 50, 50, 275, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
m_scaleSlider->SetMinSize( wxSize( 240,-1 ) );
fgSizer11->Add( m_iconScaleSlider, 1, wxBOTTOM|wxEXPAND, 4 );
bSizer4->Add( m_scaleSlider, 1, wxBOTTOM|wxEXPAND, 4 );
m_iconScaleAuto = new wxCheckBox( sbSizerIconsOpts->GetStaticBox(), wxID_ANY, _("Automatic"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer11->Add( m_iconScaleAuto, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 25 );
m_staticTextPerCent = new wxStaticText( sbSizerIconsOpts->GetStaticBox(), wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPerCent->Wrap( -1 );
bSizer4->Add( m_staticTextPerCent, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 );
m_staticTextCanvasScale = new wxStaticText( sbSizerIconsOpts->GetStaticBox(), wxID_ANY, _("Canvas scale:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextCanvasScale->Wrap( -1 );
fgSizer11->Add( m_staticTextCanvasScale, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_canvasScaleCtrl = new wxSpinCtrlDouble( sbSizerIconsOpts->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 0, 1 );
m_canvasScaleCtrl->SetDigits( 0 );
fgSizer11->Add( m_canvasScaleCtrl, 0, wxALL|wxEXPAND, 5 );
fgSizer11->Add( bSizer4, 1, wxEXPAND, 5 );
m_scaleAuto = new wxCheckBox( sbSizerIconsOpts->GetStaticBox(), wxID_ANY, _("Automatic"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer11->Add( m_scaleAuto, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 25 );
m_canvasScaleAuto = new wxCheckBox( sbSizerIconsOpts->GetStaticBox(), wxID_ANY, _("Automatic"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer11->Add( m_canvasScaleAuto, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 25 );
fgSizer11->Add( 0, 0, 0, wxEXPAND, 5 );
@@ -202,16 +203,18 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
m_PDFViewerPath->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_COMMON_SETTINGS_BASE::onUpdateUIPdfPath ), NULL, this );
m_pdfViewerBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnPDFViewerClick ), NULL, this );
m_pdfViewerBtn->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_COMMON_SETTINGS_BASE::onUpdateUIPdfPath ), NULL, this );
m_scaleSlider->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleAuto->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleAuto ), NULL, this );
m_iconScaleSlider->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleAuto->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnIconScaleAuto ), NULL, this );
m_canvasScaleCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnCanvasScaleChange ), NULL, this );
m_canvasScaleAuto->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnCanvasScaleAuto ), NULL, this );
}
PANEL_COMMON_SETTINGS_BASE::~PANEL_COMMON_SETTINGS_BASE()
@@ -221,15 +224,17 @@ PANEL_COMMON_SETTINGS_BASE::~PANEL_COMMON_SETTINGS_BASE()
m_PDFViewerPath->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_COMMON_SETTINGS_BASE::onUpdateUIPdfPath ), NULL, this );
m_pdfViewerBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnPDFViewerClick ), NULL, this );
m_pdfViewerBtn->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_COMMON_SETTINGS_BASE::onUpdateUIPdfPath ), NULL, this );
m_scaleSlider->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleSlider->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_scaleAuto->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleAuto ), NULL, this );
m_iconScaleSlider->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleSlider->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( PANEL_COMMON_SETTINGS_BASE::OnScaleSlider ), NULL, this );
m_iconScaleAuto->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnIconScaleAuto ), NULL, this );
m_canvasScaleCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnCanvasScaleChange ), NULL, this );
m_canvasScaleAuto->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnCanvasScaleAuto ), NULL, this );
}
+257 -138
View File
@@ -1219,7 +1219,7 @@
<property name="vgap">0</property>
<object class="sizeritem" expanded="0">
<property name="border">4</property>
<property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@@ -1278,142 +1278,70 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<object class="sizeritem" expanded="0">
<property name="border">4</property>
<property name="flag">wxBOTTOM|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer4</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">4</property>
<property name="flag">wxBOTTOM|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxSlider" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maxValue">275</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="minValue">50</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">240,-1</property>
<property name="moveable">1</property>
<property name="name">m_scaleSlider</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxSL_HORIZONTAL|wxSL_LABELS</property>
<property name="subclass">STEPPED_SLIDER; widgets/stepped_slider.h; Not forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value">50</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnScroll">OnScaleSlider</event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">2</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">%</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextPerCent</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="wxSlider" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maxValue">275</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="minValue">50</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">240,-1</property>
<property name="moveable">1</property>
<property name="name">m_iconScaleSlider</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxSL_HORIZONTAL|wxSL_LABELS</property>
<property name="subclass">STEPPED_SLIDER; widgets/stepped_slider.h; Not forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value">50</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnScroll">OnScaleSlider</event>
</object>
</object>
<object class="sizeritem" expanded="0">
@@ -1457,7 +1385,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_scaleAuto</property>
<property name="name">m_iconScaleAuto</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@@ -1478,7 +1406,198 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">OnScaleAuto</event>
<event name="OnCheckBox">OnIconScaleAuto</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Canvas scale:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticTextCanvasScale</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxSpinCtrlDouble" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="digits">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="inc">1</property>
<property name="initial">0</property>
<property name="max">100</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_canvasScaleCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxSP_ARROW_KEYS</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnSpinCtrlText">OnCanvasScaleChange</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">25</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Automatic</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_canvasScaleAuto</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">OnCanvasScaleAuto</event>
</object>
</object>
<object class="sizeritem" expanded="0">
+9 -5
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jan 5 2019)
// C++ code generated with wxFormBuilder (version Nov 10 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -61,9 +61,11 @@ class PANEL_COMMON_SETTINGS_BASE : public wxPanel
wxTextCtrl* m_PDFViewerPath;
wxBitmapButton* m_pdfViewerBtn;
wxStaticText* m_staticTexticonscale;
STEPPED_SLIDER* m_scaleSlider;
wxStaticText* m_staticTextPerCent;
wxCheckBox* m_scaleAuto;
STEPPED_SLIDER* m_iconScaleSlider;
wxCheckBox* m_iconScaleAuto;
wxStaticText* m_staticTextCanvasScale;
wxSpinCtrlDouble* m_canvasScaleCtrl;
wxCheckBox* m_canvasScaleAuto;
wxCheckBox* m_checkBoxIconsInMenus;
wxCheckBox* m_ZoomCenterOpt;
wxCheckBox* m_MousewheelPANOpt;
@@ -74,7 +76,9 @@ class PANEL_COMMON_SETTINGS_BASE : public wxPanel
virtual void onUpdateUIPdfPath( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnPDFViewerClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnScaleSlider( wxScrollEvent& event ) { event.Skip(); }
virtual void OnScaleAuto( wxCommandEvent& event ) { event.Skip(); }
virtual void OnIconScaleAuto( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCanvasScaleChange( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCanvasScaleAuto( wxCommandEvent& event ) { event.Skip(); }
public:
+83 -7
View File
@@ -21,13 +21,16 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <panel_hotkeys_editor.h>
#include <bitmaps.h>
#include <confirm.h>
#include <eda_base_frame.h>
#include <panel_hotkeys_editor.h>
#include <wx/srchctrl.h>
#include <wx/panel.h>
#include <wx/button.h>
#include <wx/panel.h>
#include <wx/sizer.h>
#include <wx/srchctrl.h>
#include <wx/statline.h>
#include <widgets/button_row_panel.h>
#include <widgets/ui_common.h>
@@ -70,7 +73,33 @@ PANEL_HOTKEYS_EDITOR::PANEL_HOTKEYS_EDITOR( EDA_BASE_FRAME* aFrame, wxWindow* aW
m_hotkeyStore( aShowHotkeys )
{
const auto margin = KIUI::GetStdMargin();
auto mainSizer = new wxBoxSizer( wxVERTICAL );
m_mainSizer = new wxBoxSizer( wxVERTICAL );
m_errorMessageSizer = new wxBoxSizer( wxVERTICAL );
// Setup the sub-sizer to contain the bitmap and header text
wxBoxSizer* errImgHeadSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBitmap* valid_img = new wxStaticBitmap(
this, wxID_ANY, KiBitmap( cancel_xpm ), wxDefaultPosition, wxDefaultSize, 0 );
wxStaticText* err_head = new wxStaticText( this, wxID_ANY, _( "Hotkey errors detected" ),
wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
errImgHeadSizer->Add( valid_img, 0, wxALL, 5 );
errImgHeadSizer->Add( err_head, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
m_errorMessageSizer->Add( errImgHeadSizer, 0, wxTOP | wxLEFT | wxRIGHT, margin );
// Setup the error message to give the user information about any problems with the hotkeys,
// but only do this if they can actually change them
if( !m_readOnly )
{
m_errorMessage = new wxStaticText(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
m_errorMessageSizer->Add( m_errorMessage, 0, wxALL, 5 );
}
m_errorMessageSizer->Add( new wxStaticLine( this ), 0, wxALL | wxEXPAND, 2 );
// Add the validity text to the main sizer and hide the entire sizer
m_mainSizer->Add( m_errorMessageSizer, 0, wxTOP | wxLEFT | wxRIGHT | wxEXPAND, margin );
// Sub-sizer for setting a wider side margin
// TODO: Can this be set by the parent widget- doesn't seem to be
@@ -87,9 +116,9 @@ PANEL_HOTKEYS_EDITOR::PANEL_HOTKEYS_EDITOR( EDA_BASE_FRAME* aFrame, wxWindow* aW
if( !m_readOnly )
installButtons( bMargins );
mainSizer->Add( bMargins, 1, wxEXPAND | wxRIGHT | wxLEFT, side_margins );
m_mainSizer->Add( bMargins, 1, wxEXPAND | wxRIGHT | wxLEFT, side_margins );
this->SetSizer( mainSizer );
this->SetSizer( m_mainSizer );
this->Layout();
// Connect Events
@@ -125,7 +154,7 @@ void PANEL_HOTKEYS_EDITOR::installButtons( wxSizer* aSizer )
_( "Import..." ),
_( "Import hotkey definitions from an external file, replacing the current values" ),
[this]( wxCommandEvent& ){
m_frame->ImportHotkeyConfigFromFile( m_hotkeys, m_nickname );
onImportHotkeyConfigFromFile();
}
},
{
@@ -144,6 +173,22 @@ void PANEL_HOTKEYS_EDITOR::installButtons( wxSizer* aSizer )
}
void PANEL_HOTKEYS_EDITOR::onImportHotkeyConfigFromFile()
{
m_frame->ImportHotkeyConfigFromFile( m_hotkeys, m_nickname );
if( !m_hotkeyStore.TestStoreValidity() )
{
wxString msg = _( "The imported file contains invalid hotkeys. "
"Please correct the errors before continuing." );
wxString errKeys;
m_hotkeyStore.GetStoreValidityMessage( errKeys );
DisplayErrorMessage( this, msg, errKeys );
}
}
bool PANEL_HOTKEYS_EDITOR::TransferDataToWindow()
{
return m_hotkeyListCtrl->TransferDataToControl();
@@ -167,3 +212,34 @@ void PANEL_HOTKEYS_EDITOR::OnFilterSearch( wxCommandEvent& aEvent )
const auto searchStr = aEvent.GetString();
m_hotkeyListCtrl->ApplyFilterString( searchStr );
}
void PANEL_HOTKEYS_EDITOR::UpdateErrorMessage()
{
wxString validMessage;
bool isValid = m_hotkeyStore.GetStoreValidityMessage( validMessage );
if( isValid )
{
// Hide the error message sizer if all the hotkeys are valid
if( !m_readOnly )
{
m_errorMessage->SetLabelText( wxEmptyString );
m_errorMessage->Update();
}
m_mainSizer->Hide( m_errorMessageSizer );
}
else
{
// Update the message text and ensure it is showing if there are errors
if( !m_readOnly )
{
m_errorMessage->SetLabelText( validMessage );
m_errorMessage->Update();
}
m_mainSizer->Show( m_errorMessageSizer );
}
m_mainSizer->Layout();
}
+178
View File
@@ -0,0 +1,178 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <dpi_scaling.h>
#include <core/optional.h>
#include <env_vars.h>
#include <pgm_base.h>
#include <wx/config.h>
#include <wx/log.h>
/**
* Flag to enable trace for HiDPI scaling factors
*
* Use "KICAD_TRACE_HIGH_DPI" to enable.
*
* @ingroup trace_env_vars
*/
const wxChar* const traceHiDpi = wxT( "KICAD_TRACE_HIGH_DPI" );
/**
* Get a user-configured scale factor from KiCad config file
*
* @return the scale factor, if set
*/
static OPT<double> getKiCadConfiguredScale( const wxConfigBase& aConfig )
{
OPT<double> scale;
double canvas_scale = 0.0;
aConfig.Read( CANVAS_SCALE_KEY, &canvas_scale, 0.0 );
if( canvas_scale > 0.0 )
{
scale = canvas_scale;
}
if( scale )
{
wxLogTrace( traceHiDpi, "Scale factor (configured): %f", *scale );
}
return scale;
}
/**
* Get the toolkit scale factor from a user-set environment variable
* (for example GDK_SCALE on GTK).
*
* @return the scale factor, if set
*/
static OPT<double> getEnviromentScale()
{
const wxPortId port_id = wxPlatformInfo::Get().GetPortId();
OPT<double> scale;
if( port_id == wxPORT_GTK )
{
// Under GTK, the user can use GDK_SCALE to force the scaling
scale = GetEnvVar<double>( "GDK_SCALE" );
}
if( scale )
{
wxLogTrace( traceHiDpi, "Scale factor (environment): %f", *scale );
}
return scale;
}
DPI_SCALING::DPI_SCALING( wxConfigBase* aConfig, const wxWindow* aWindow )
: m_config( aConfig ), m_window( aWindow )
{
}
double DPI_SCALING::GetScaleFactor() const
{
OPT<double> val;
if( m_config )
{
val = getKiCadConfiguredScale( *m_config );
}
if( !val )
{
val = getEnviromentScale();
}
if( !val && m_window )
{
// Use the native WX reporting.
// On Linux, this will not work until WX 3.2 and GTK >= 3.10
// Otherwise it returns 1.0
val = m_window->GetContentScaleFactor();
wxLogTrace( traceHiDpi, "Scale factor (WX): %f", *val );
}
if( !val )
{
// Nothing else we can do, give it a default value
val = GetDefaultScaleFactor();
wxLogTrace( traceHiDpi, "Scale factor (default): %f", *val );
}
return *val;
}
bool DPI_SCALING::GetCanvasIsAutoScaled() const
{
if( m_config == nullptr )
{
// No configuration given, so has to be automatic scaling
return true;
}
const bool automatic = getKiCadConfiguredScale( *m_config ) == boost::none;
wxLogTrace( traceHiDpi, "Scale is automatic: %d", automatic );
return automatic;
}
void DPI_SCALING::SetDpiConfig( bool aAuto, double aValue )
{
wxCHECK_RET( m_config != nullptr, "Setting DPI config without a config store." );
const double value = aAuto ? 0.0 : aValue;
m_config->Write( CANVAS_SCALE_KEY, value );
}
double DPI_SCALING::GetMaxScaleFactor()
{
// displays with higher than 4.0 DPI are not really going to be useful
// for KiCad (even an 8k display would be effectively only ~1080p at 4x)
return 6.0;
}
double DPI_SCALING::GetMinScaleFactor()
{
// scales under 1.0 don't make sense from a HiDPI perspective
return 1.0;
}
double DPI_SCALING::GetDefaultScaleFactor()
{
// no scaling => 1.0
return 1.0;
}
+2 -2
View File
@@ -148,8 +148,6 @@ void EDA_DRAW_PANEL_GAL::SetFocus()
void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
{
m_viewControls->UpdateScrollbars();
// Update current zoom settings if the canvas is managed by a EDA frame
// (i.e. not by a preview panel in a dialog)
if( GetParentEDAFrame() && GetParentEDAFrame()->GetScreen() )
@@ -160,6 +158,8 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
GetParentEDAFrame()->SetScrollCenterPosition( wxPoint( center.x, center.y ) );
}
m_viewControls->UpdateScrollbars();
if( !m_gal->IsVisible() )
return;
+11 -4
View File
@@ -109,7 +109,9 @@ long long int ECOORD::ConvertToNm( int aValue, enum EAGLE_UNIT aUnit )
case EU_MIL: ret = (long long) aValue * 25400; break;
}
wxASSERT( ( ret > 0 ) == ( aValue > 0 ) ); // check for overflow
if( ( ret > 0 ) != ( aValue > 0 ) )
wxLogError( _( "Invalid size %lld: too large" ), aValue );
return ret;
}
@@ -283,8 +285,13 @@ wxPoint ConvertArcCenter( const wxPoint& aStart, const wxPoint& aEnd, double aAn
wxPoint mid = ( aStart + aEnd ) / 2;
double dlen = sqrt( dx*dx + dy*dy );
wxASSERT( dlen != 0 );
wxASSERT( aAngle != 0 );
if( !std::isnormal( dlen ) || !std::isnormal( aAngle ) )
{
THROW_IO_ERROR(
wxString::Format( _( "Invalid Arc with radius %f and angle %f" ), dlen, aAngle ) );
}
double dist = dlen / ( 2 * tan( DEG2RAD( aAngle ) / 2 ) );
wxPoint center(
@@ -608,7 +615,7 @@ wxSize ETEXT::ConvertSize() const
}
else
{
wxASSERT( false );
wxLogDebug( "Invalid font name \"%s\"", fontName );
textsize = wxSize( size.ToSchUnits(), size.ToSchUnits() );
}
}
+4 -10
View File
@@ -582,16 +582,14 @@ bool EDA_BASE_FRAME::IsWritable( const wxFileName& aFileName )
}
void EDA_BASE_FRAME::CheckForAutoSaveFile( const wxFileName& aFileName,
const wxString& aBackupFileExtension )
void EDA_BASE_FRAME::CheckForAutoSaveFile( const wxFileName& aFileName )
{
wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
wxCHECK_RET( !aBackupFileExtension.IsEmpty(), wxT( "Invalid backup file extension!" ) );
wxFileName autoSaveFileName = aFileName;
// Check for auto save file.
autoSaveFileName.SetName( AUTOSAVE_PREFIX_FILENAME + aFileName.GetName() );
autoSaveFileName.SetName( GetAutoSaveFilePrefix() + aFileName.GetName() );
wxLogTrace( traceAutoSave,
wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
@@ -615,18 +613,14 @@ void EDA_BASE_FRAME::CheckForAutoSaveFile( const wxFileName& aFileName,
{
// Get the backup file name.
wxFileName backupFileName = aFileName;
backupFileName.SetExt( aBackupFileExtension );
backupFileName.SetExt( aFileName.GetExt() + GetBackupSuffix() );
// If an old backup file exists, delete it. If an old copy of the file exists, rename
// it to the backup file name
if( aFileName.FileExists() )
{
// Remove the old file backup file.
if( backupFileName.FileExists() )
wxRemoveFile( backupFileName.GetFullPath() );
// Rename the old file to the backup file name.
if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath() ) )
if( !wxRenameFile( aFileName.GetFullPath(), backupFileName.GetFullPath(), true ) )
{
msg.Printf( _( "Could not create backup file \"%s\"" ),
GetChars( backupFileName.GetFullPath() ) );
+12 -11
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2014-2017 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2014-2019 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -103,18 +103,19 @@ bool GetAssociatedDocument( wxWindow* aParent,
wxT( "file:" )
};
// Replace before resolving as we might have a URL in a variable
docname = ResolveUriByEnvVars( aDocName );
for( unsigned ii = 0; ii < arrayDim(url_header); ii++ )
{
if( aDocName.First( url_header[ii] ) == 0 ) // looks like an internet url
if( docname.First( url_header[ii] ) == 0 ) // looks like an internet url
{
wxURI uri( aDocName );
wxURI uri( docname );
wxLaunchDefaultBrowser( uri.BuildURI() );
return true;
}
}
docname = aDocName;
#ifdef __WINDOWS__
docname.Replace( UNIX_STRING_DIR_SEP, WIN_STRING_DIR_SEP );
#else
@@ -123,17 +124,17 @@ bool GetAssociatedDocument( wxWindow* aParent,
/* Compute the full file name */
if( wxIsAbsolutePath( aDocName ) || aPaths == NULL)
fullfilename = aDocName;
if( wxIsAbsolutePath( docname ) || aPaths == NULL)
fullfilename = docname;
/* If the file exists, this is a trivial case: return the filename
* "as this". the name can be an absolute path, or a relative path
* like ./filename or ../<filename>
*/
else if( wxFileName::FileExists( aDocName ) )
fullfilename = aDocName;
else if( wxFileName::FileExists( docname ) )
fullfilename = docname;
else
{
fullfilename = aPaths->FindValidPath( aDocName );
fullfilename = aPaths->FindValidPath( docname );
}
wxString mask( wxT( "*" ) ), extension;
@@ -160,7 +161,7 @@ bool GetAssociatedDocument( wxWindow* aParent,
if( !wxFileExists( fullfilename ) )
{
msg.Printf( _( "Doc File \"%s\" not found" ), GetChars( aDocName ) );
msg.Printf( _( "Doc File \"%s\" not found" ), GetChars( docname ) );
DisplayError( aParent, msg );
return false;
}
+35
View File
@@ -23,6 +23,8 @@
#include <common.h>
#include <wx/utils.h>
using STRING_MAP = std::map<wxString, wxString>;
/*
@@ -102,4 +104,37 @@ wxString LookUpEnvVarHelp( const wxString& aEnvVar )
initialiseEnvVarHelp( env_var_help_text );
return env_var_help_text[aEnvVar];
}
template<>
OPT<double> GetEnvVar( const wxString& aEnvVarName )
{
OPT<double> opt_value;
wxString env;
if( wxGetEnv( aEnvVarName, &env ) )
{
double value;
if( env.ToDouble( &value ) )
{
opt_value = value;
}
}
return opt_value;
}
template<>
OPT<wxString> GetEnvVar( const wxString& aEnvVarName )
{
OPT<wxString> opt_value;
wxString env;
if( wxGetEnv( aEnvVarName, &env ) )
{
opt_value = env;
}
return opt_value;
}
+8 -4
View File
@@ -259,11 +259,12 @@ long long FP_LIB_TABLE::GenerateTimestamp( const wxString* aNickname )
}
void FP_LIB_TABLE::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aNickname )
void FP_LIB_TABLE::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aNickname,
bool aBestEfforts )
{
const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
wxASSERT( (PLUGIN*) row->plugin );
row->plugin->FootprintEnumerate( aFootprintNames, row->GetFullURI( true ),
row->plugin->FootprintEnumerate( aFootprintNames, row->GetFullURI( true ), aBestEfforts,
row->GetProperties() );
}
@@ -341,8 +342,11 @@ bool FP_LIB_TABLE::FootprintExists( const wxString& aNickname, const wxString& a
{
try
{
std::unique_ptr<MODULE> m( FootprintLoad( aNickname, aFootprintName ) );
return m.get() != nullptr;
const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
wxASSERT( (PLUGIN*) row->plugin );
return row->plugin->FootprintExists( row->GetFullURI( true ), aFootprintName,
row->GetProperties() );
}
catch( ... )
{
+79 -37
View File
@@ -117,9 +117,47 @@ const VECTOR2D CAIRO_GAL_BASE::xform( const VECTOR2D& aP )
const double CAIRO_GAL_BASE::angle_xform( const double aAngle )
{
double world_angle = -std::atan2( currentWorld2Screen.xy, currentWorld2Screen.xx );
// calculate rotation angle due to the rotation transform
// and if flipped on X axis.
double world_rotation = -std::atan2( currentWorld2Screen.xy, currentWorld2Screen.xx );
return std::fmod( aAngle + world_angle, 2.0 * M_PI );
// When flipped on X axis, the rotation angle is M_PI - initial angle:
if( IsFlippedX() )
world_rotation = M_PI - world_rotation;
return std::fmod( aAngle + world_rotation, 2.0 * M_PI );
}
void CAIRO_GAL_BASE::arc_angles_xform_and_normalize( double& aStartAngle, double& aEndAngle )
{
double startAngle = aStartAngle;
double endAngle = aEndAngle;
// When the view is flipped, the coordinates are flipped by the matrix transform
// However, arc angles need to be "flipped": the flipped angle is M_PI - initial angle.
if( IsFlippedX() )
{
startAngle = M_PI - startAngle;
endAngle = M_PI - endAngle;
}
// Normalize arc angles
SWAP( startAngle, >, endAngle );
// now rotate arc according to the rotation transform matrix
// Remark:
// We call angle_xform() to calculate angles according to the flip/rotation
// transform and normatize between -2M_PI and +2M_PI.
// Therefore, if aStartAngle = aEndAngle + 2*n*M_PI, the transform gives
// aEndAngle = aStartAngle
// So, if this is the case, force the aEndAngle value to draw a circle.
aStartAngle = angle_xform( startAngle );
if( std::abs( aEndAngle - aStartAngle ) >= 2*M_PI ) // arc is a full circle
aEndAngle = aStartAngle + 2*M_PI;
else
aEndAngle = angle_xform( endAngle );
}
@@ -245,6 +283,7 @@ void CAIRO_GAL_BASE::DrawCircle( const VECTOR2D& aCenterPoint, double aRadius )
auto c = roundp( xform( aCenterPoint ) );
auto r = ::roundp( xform( aRadius ) );
cairo_set_line_width( currentContext, std::min( 2.0 * r, lineWidthInPixels ) );
cairo_new_sub_path( currentContext );
cairo_arc( currentContext, c.x, c.y, r, 0.0, 2 * M_PI );
cairo_close_path( currentContext );
@@ -258,10 +297,11 @@ void CAIRO_GAL_BASE::DrawArc( const VECTOR2D& aCenterPoint, double aRadius, doub
{
syncLineWidth();
SWAP( aStartAngle, >, aEndAngle );
auto startAngleS = angle_xform( aStartAngle );
auto endAngleS = angle_xform( aEndAngle );
auto r = xform( aRadius );
// calculate start and end arc angles according to the rotation transform matrix
// and normalize:
arc_angles_xform_and_normalize( aStartAngle, aEndAngle );
double r = xform( aRadius );
// N.B. This is backwards. We set this because we want to adjust the center
// point that changes both endpoints. In the worst case, this is twice as far.
@@ -277,7 +317,7 @@ void CAIRO_GAL_BASE::DrawArc( const VECTOR2D& aCenterPoint, double aRadius, doub
if( isFillEnabled )
cairo_move_to( currentContext, mid.x, mid.y );
cairo_arc( currentContext, mid.x, mid.y, r, startAngleS, endAngleS );
cairo_arc( currentContext, mid.x, mid.y, r, aStartAngle, aEndAngle );
if( isFillEnabled )
cairo_close_path( currentContext );
@@ -303,10 +343,14 @@ void CAIRO_GAL_BASE::DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadiu
}
syncLineWidth();
SWAP( aStartAngle, >, aEndAngle );
auto startAngleS = angle_xform( aStartAngle );
auto endAngleS = angle_xform( aEndAngle );
auto r = xform( aRadius );
// calculate start and end arc angles according to the rotation transform matrix
// and normalize:
double startAngleS = aStartAngle;
double endAngleS = aEndAngle;
arc_angles_xform_and_normalize( startAngleS, endAngleS );
double r = xform( aRadius );
// N.B. This is backwards. We set this because we want to adjust the center
// point that changes both endpoints. In the worst case, this is twice as far.
@@ -315,7 +359,7 @@ void CAIRO_GAL_BASE::DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadiu
lineWidthIsOdd = !( static_cast<int>( aRadius ) % 1 );
auto mid = roundp( xform( aCenterPoint ) );
auto width = xform( aWidth / 2.0 );
double width = xform( aWidth / 2.0 );
auto startPointS = VECTOR2D( r, 0.0 ).Rotate( startAngleS );
auto endPointS = VECTOR2D( r, 0.0 ).Rotate( endAngleS );
@@ -1490,14 +1534,6 @@ void CAIRO_GAL_BASE::DrawGrid()
VECTOR2D worldStartPoint = screenWorldMatrix * VECTOR2D( 0.0, 0.0 );
VECTOR2D worldEndPoint = screenWorldMatrix * VECTOR2D( screenSize );
double gridThreshold = KiROUND( computeMinGridSpacing() / worldScale );
if( gridStyle == GRID_STYLE::SMALL_CROSS )
gridThreshold *= 2.0;
int gridScreenSizeDense = gridSize.x;
int gridScreenSizeCoarse = KiROUND( gridSize.x * static_cast<double>( gridTick ) );
// Compute the line marker or point radius of the grid
// Note: generic grids can't handle sub-pixel lines without
// either losing fine/course distinction or having some dots
@@ -1515,21 +1551,27 @@ void CAIRO_GAL_BASE::DrawGrid()
if( !gridVisibility )
return;
VECTOR2D gridScreenSize( gridSize );
double gridThreshold = KiROUND( computeMinGridSpacing() / worldScale );
if( gridStyle == GRID_STYLE::SMALL_CROSS )
gridThreshold *= 2.0;
// If we cannot display the grid density, scale down by a tick size and
// try again. Eventually, we get some representation of the grid
while( std::min( gridScreenSizeDense, gridScreenSizeCoarse ) <= gridThreshold )
while( std::min( gridScreenSize.x, gridScreenSize.y ) <= gridThreshold )
{
gridScreenSizeCoarse *= gridTick;
gridScreenSizeDense *= gridTick;
gridScreenSize = gridScreenSize * static_cast<double>( gridTick );
}
// Compute grid starting and ending indexes to draw grid points on the
// visible screen area
// Note: later any point coordinate will be offsetted by gridOrigin
int gridStartX = KiROUND( ( worldStartPoint.x - gridOrigin.x ) / gridScreenSizeDense );
int gridEndX = KiROUND( ( worldEndPoint.x - gridOrigin.x ) / gridScreenSizeDense );
int gridStartY = KiROUND( ( worldStartPoint.y - gridOrigin.y ) / gridScreenSizeDense );
int gridEndY = KiROUND( ( worldEndPoint.y - gridOrigin.y ) / gridScreenSizeDense );
int gridStartX = KiROUND( ( worldStartPoint.x - gridOrigin.x ) / gridScreenSize.x );
int gridEndX = KiROUND( ( worldEndPoint.x - gridOrigin.x ) / gridScreenSize.x );
int gridStartY = KiROUND( ( worldStartPoint.y - gridOrigin.y ) / gridScreenSize.y );
int gridEndY = KiROUND( ( worldEndPoint.y - gridOrigin.y ) / gridScreenSize.y );
// Ensure start coordinate > end coordinate
@@ -1550,27 +1592,27 @@ void CAIRO_GAL_BASE::DrawGrid()
// Vertical lines
for( int j = gridStartY; j <= gridEndY; j++ )
{
const double y = j * gridScreenSizeDense + gridOrigin.y;
const double y = j * gridScreenSize.y + gridOrigin.y;
if( axesEnabled && y == 0 )
if( axesEnabled && y == 0.0 )
continue;
SetLineWidth( ( j % gridTick ) ? marker : doubleMarker );
drawGridLine( VECTOR2D( gridStartX * gridScreenSizeDense + gridOrigin.x, y ),
VECTOR2D( gridEndX * gridScreenSizeDense + gridOrigin.x, y ) );
drawGridLine( VECTOR2D( gridStartX * gridScreenSize.x + gridOrigin.x, y ),
VECTOR2D( gridEndX * gridScreenSize.x + gridOrigin.x, y ) );
}
// Horizontal lines
for( int i = gridStartX; i <= gridEndX; i++ )
{
const double x = i * gridScreenSizeDense + gridOrigin.x;
const double x = i * gridScreenSize.x + gridOrigin.x;
if( axesEnabled && x == 0 )
if( axesEnabled && x == 0.0 )
continue;
SetLineWidth( ( i % gridTick ) ? marker : doubleMarker );
drawGridLine( VECTOR2D( x, gridStartY * gridScreenSizeDense + gridOrigin.y ),
VECTOR2D( x, gridEndY * gridScreenSizeDense + gridOrigin.y ) );
drawGridLine( VECTOR2D( x, gridStartY * gridScreenSize.y + gridOrigin.y ),
VECTOR2D( x, gridEndY * gridScreenSize.y + gridOrigin.y ) );
}
}
@@ -1584,8 +1626,8 @@ void CAIRO_GAL_BASE::DrawGrid()
{
bool tickX = ( i % gridTick == 0 );
SetLineWidth( ( ( tickX && tickY ) ? doubleMarker : marker ) );
auto pos = VECTOR2D( i * gridScreenSizeDense + gridOrigin.x,
j * gridScreenSizeDense + gridOrigin.y );
auto pos = VECTOR2D( i * gridScreenSize.x + gridOrigin.x,
j * gridScreenSize.y + gridOrigin.y );
if( gridStyle == GRID_STYLE::SMALL_CROSS )
drawGridCross( pos );
+12 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 CERN
* Copyright (C) 2019 CERN
* Author: Maciej Suminski <maciej.suminski@cern.ch>
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
@@ -63,8 +63,16 @@ CAIRO_PRINT_CTX::CAIRO_PRINT_CTX( wxDC* aDC )
#ifdef __WXGTK__
m_ctx = static_cast<cairo_t*>( gctx->GetNativeContext() );
m_surface = cairo_get_target( m_ctx );
// Magic value: apparently for linux, all printers are 72 DPI
m_dpi = 72.0;
// On linux, cairo printers have 72 DPI by default.
// This is an unusable resolution for us.
// A better resolution could be 4800 DPI (at 600 DPI, we still have minor
// but visible artifacts, for instance with arcs, but not at 4800 DPI)
// so modify the default:
#define DEFAULT_DPI 72.0
#define KICAD_PRINTER_DPI 4800.0
// our device scale is DEFAULT_DPI / KICAD_PRINTER_DPI
cairo_surface_set_device_scale( m_surface, DEFAULT_DPI/KICAD_PRINTER_DPI, DEFAULT_DPI/KICAD_PRINTER_DPI );
m_dpi = KICAD_PRINTER_DPI;
#endif /* __WXGTK__ */
#ifdef __WXMSW__
@@ -122,6 +130,7 @@ CAIRO_PRINT_GAL::CAIRO_PRINT_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions,
m_clearColor = COLOR4D( 1.0, 1.0, 1.0, 1.0 );
m_hasNativeLandscapeRotation = false;
resetContext();
SetScreenDPI( m_printCtx->GetNativeDPI() );
}
+75 -17
View File
@@ -22,9 +22,13 @@
*/
#include <gal/gal_display_options.h>
#include <wx/config.h>
#include <wx/log.h>
#include <config_map.h>
#include <dpi_scaling.h>
#include <pgm_base.h>
using namespace KIGFX;
@@ -47,6 +51,16 @@ static const UTIL::CFG_MAP<KIGFX::GRID_STYLE> gridStyleConfigVals =
};
/**
* Flag to enable GAL_DISPLAY_OPTIONS loggin
*
* Use "KICAD_GAL_DISPLAY_OPTIONS" to enable.
*
* @ingroup trace_env_vars
*/
static const wxChar* traceGalDispOpts = wxT( "KICAD_GAL_DISPLAY_OPTIONS" );
GAL_DISPLAY_OPTIONS::GAL_DISPLAY_OPTIONS()
: gl_antialiasing_mode( OPENGL_ANTIALIASING_MODE::NONE ),
cairo_antialiasing_mode( CAIRO_ANTIALIASING_MODE::NONE ),
@@ -55,42 +69,86 @@ GAL_DISPLAY_OPTIONS::GAL_DISPLAY_OPTIONS()
m_gridMinSpacing( 10.0 ),
m_axesEnabled( false ),
m_fullscreenCursor( false ),
m_forceDisplayCursor( false )
m_forceDisplayCursor( false ),
m_scaleFactor( DPI_SCALING::GetDefaultScaleFactor() )
{}
void GAL_DISPLAY_OPTIONS::ReadConfig( wxConfigBase* aCfg, const wxString& aBaseName )
void GAL_DISPLAY_OPTIONS::ReadAppConfig( wxConfigBase& aCfg, const wxString& aBaseName )
{
const wxString baseName = aBaseName + GAL_DISPLAY_OPTIONS_KEY;
wxLogTrace( traceGalDispOpts, "Reading options with base name '%s'", baseName );
long readLong; // Temp value buffer
aCfg->Read( aBaseName + GalGridStyleConfig, &readLong,
static_cast<long>( KIGFX::GRID_STYLE::DOTS ) );
aCfg.Read( baseName + GalGridStyleConfig, &readLong,
static_cast<long>( KIGFX::GRID_STYLE::DOTS ) );
m_gridStyle = UTIL::GetValFromConfig( gridStyleConfigVals, readLong );
aCfg->Read( aBaseName + GalGridLineWidthConfig, &m_gridLineWidth, 1.0 );
aCfg->Read( aBaseName + GalGridMaxDensityConfig, &m_gridMinSpacing, 10 );
aCfg->Read( aBaseName + GalGridAxesEnabledConfig, &m_axesEnabled, false );
aCfg->Read( aBaseName + GalFullscreenCursorConfig, &m_fullscreenCursor, false );
aCfg->Read( aBaseName + GalForceDisplayCursorConfig, &m_forceDisplayCursor, true );
aCfg.Read( baseName + GalGridLineWidthConfig, &m_gridLineWidth, 1.0 );
aCfg.Read( baseName + GalGridMaxDensityConfig, &m_gridMinSpacing, 10 );
aCfg.Read( baseName + GalGridAxesEnabledConfig, &m_axesEnabled, false );
aCfg.Read( baseName + GalFullscreenCursorConfig, &m_fullscreenCursor, false );
aCfg.Read( baseName + GalForceDisplayCursorConfig, &m_forceDisplayCursor, true );
NotifyChanged();
}
void GAL_DISPLAY_OPTIONS::WriteConfig( wxConfigBase* aCfg, const wxString& aBaseName )
void GAL_DISPLAY_OPTIONS::ReadCommonConfig( wxConfigBase& aCommonConfig, wxWindow* aWindow )
{
aCfg->Write( aBaseName + GalGridStyleConfig,
wxLogTrace( traceGalDispOpts, "Reading common config" );
int temp;
aCommonConfig.Read(
GAL_ANTIALIASING_MODE_KEY, &temp, (int) KIGFX::OPENGL_ANTIALIASING_MODE::NONE );
gl_antialiasing_mode = (KIGFX::OPENGL_ANTIALIASING_MODE) temp;
aCommonConfig.Read(
CAIRO_ANTIALIASING_MODE_KEY, &temp, (int) KIGFX::CAIRO_ANTIALIASING_MODE::NONE );
cairo_antialiasing_mode = (KIGFX::CAIRO_ANTIALIASING_MODE) temp;
{
const DPI_SCALING dpi{ &aCommonConfig, aWindow };
m_scaleFactor = dpi.GetScaleFactor();
}
NotifyChanged();
}
void GAL_DISPLAY_OPTIONS::ReadConfig( wxConfigBase& aCommonConfig, wxConfigBase& aAppConfig,
const wxString& aBaseCfgName, wxWindow* aWindow )
{
wxLogTrace( traceGalDispOpts, "Reading common and app config (%s)", aBaseCfgName );
ReadAppConfig( aAppConfig, aBaseCfgName );
ReadCommonConfig( aCommonConfig, aWindow );
}
void GAL_DISPLAY_OPTIONS::WriteConfig( wxConfigBase& aCfg, const wxString& aBaseName )
{
const wxString baseName = aBaseName + GAL_DISPLAY_OPTIONS_KEY;
wxLogTrace( traceGalDispOpts, "Writing app config (%s)", baseName );
aCfg.Write( baseName + GalGridStyleConfig,
UTIL::GetConfigForVal( gridStyleConfigVals, m_gridStyle ) );
aCfg->Write( aBaseName + GalGridLineWidthConfig, m_gridLineWidth );
aCfg->Write( aBaseName + GalGridMaxDensityConfig, m_gridMinSpacing );
aCfg->Write( aBaseName + GalGridAxesEnabledConfig, m_axesEnabled );
aCfg->Write( aBaseName + GalFullscreenCursorConfig, m_fullscreenCursor );
aCfg->Write( aBaseName + GalForceDisplayCursorConfig, m_forceDisplayCursor );
aCfg.Write( baseName + GalGridLineWidthConfig, m_gridLineWidth );
aCfg.Write( baseName + GalGridMaxDensityConfig, m_gridMinSpacing );
aCfg.Write( baseName + GalGridAxesEnabledConfig, m_axesEnabled );
aCfg.Write( baseName + GalFullscreenCursorConfig, m_fullscreenCursor );
aCfg.Write( baseName + GalForceDisplayCursorConfig, m_forceDisplayCursor );
}
void GAL_DISPLAY_OPTIONS::NotifyChanged()
{
wxLogTrace( traceGalDispOpts, "Change notification" );
Notify( &GAL_DISPLAY_OPTIONS_OBSERVER::OnGalDisplayOptionsChanged, *this );
}
}
+23 -12
View File
@@ -26,16 +26,14 @@
#include <gal/hidpi_gl_canvas.h>
#include <dpi_scaling.h>
HIDPI_GL_CANVAS::HIDPI_GL_CANVAS( wxWindow *parent,
wxWindowID id,
const int *attribList,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name,
const wxPalette& palette ) :
wxGLCanvas( parent, id, attribList, pos, size, style, name, palette )
HIDPI_GL_CANVAS::HIDPI_GL_CANVAS( wxWindow* parent, wxWindowID id, const int* attribList,
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
const wxPalette& palette )
: wxGLCanvas( parent, id, attribList, pos, size, style, name, palette ),
m_scale_factor( DPI_SCALING::GetDefaultScaleFactor() )
{
#ifdef RETINA_OPENGL_PATCH
SetViewWantsBestResolution( true );
@@ -47,15 +45,14 @@ wxSize HIDPI_GL_CANVAS::GetNativePixelSize() const
{
wxSize size = wxGLCanvas::GetClientSize();
#ifdef RETINA_OPENGL_PATCH
const float scaleFactor = GetBackingScaleFactor();
size.x *= scaleFactor;
size.y *= scaleFactor;
#endif
return size;
}
float HIDPI_GL_CANVAS::GetBackingScaleFactor() const
{
#ifdef RETINA_OPENGL_PATCH
@@ -63,6 +60,20 @@ float HIDPI_GL_CANVAS::GetBackingScaleFactor() const
// => clean up when it officially has arrived in wxWidgets
return static_cast< wxGLCanvas* >( const_cast< HIDPI_GL_CANVAS* >( this ))->GetBackingScaleFactor();
#else
return 1.0f;
// Return the cached value (which originally was set from config or automatically)
return m_scale_factor;
#endif
}
void HIDPI_GL_CANVAS::SetScaleFactor( double aNewScaleFactor )
{
m_scale_factor = aNewScaleFactor;
}
double HIDPI_GL_CANVAS::GetScaleFactor() const
{
return m_scale_factor;
}
+3 -4
View File
@@ -333,12 +333,11 @@ int isPixelInSegment( vec2 aCoord )
void strokedCircle( vec2 aCoord, float aRadius, float aWidth )
{
float outerRadius = max( aRadius + ( aWidth / 2 ), 0.0 );
float innerRadius = max( aRadius - ( aWidth / 2 ), 0.0 );
float relWidth = innerRadius / outerRadius;
float outerRadius = max( aRadius, 0.0 );
float innerRadius = max( aRadius - aWidth, 0.0 );
if( ( dot( aCoord, aCoord ) < 1.0 ) &&
( dot( aCoord, aCoord ) > relWidth * relWidth ) )
( dot( aCoord, aCoord ) * ( outerRadius * outerRadius ) > innerRadius * innerRadius ) )
gl_FragColor = gl_Color;
else
discard;
+27 -22
View File
@@ -336,6 +336,12 @@ bool OPENGL_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions )
refresh = true;
}
if( options.m_scaleFactor != GetScaleFactor() )
{
SetScaleFactor( options.m_scaleFactor );
refresh = true;
}
if( super::updatedGalDisplayOptions( aOptions ) || refresh )
{
Refresh();
@@ -1224,7 +1230,8 @@ void OPENGL_GAL::DrawGrid()
nonCachedManager->EnableDepthTest( false );
// sub-pixel lines all render the same
float minorLineWidth = std::fmax( 1.0f, gridLineWidth ) * getWorldPixelSize();
float minorLineWidth =
std::fmax( 1.0f, gridLineWidth ) * getWorldPixelSize() / GetBackingScaleFactor();
float majorLineWidth = minorLineWidth * 2.0f;
// Draw the axis and grid
@@ -1249,29 +1256,27 @@ void OPENGL_GAL::DrawGrid()
if( !gridVisibility )
return;
int gridScreenSizeDense = gridSize.x;
int gridScreenSizeCoarse = KiROUND( gridSize.x * static_cast<double>( gridTick ) );
VECTOR2D gridScreenSize( gridSize );
double gridThreshold = KiROUND( computeMinGridSpacing() / worldScale );
double gridThreshold = computeMinGridSpacing() / worldScale;
if( gridStyle == GRID_STYLE::SMALL_CROSS )
gridThreshold *= 2.0;
// If we cannot display the grid density, scale down by a tick size and
// try again. Eventually, we get some representation of the grid
while( std::min( gridScreenSizeDense, gridScreenSizeCoarse ) <= gridThreshold )
while( std::min( gridScreenSize.x, gridScreenSize.y ) <= gridThreshold )
{
gridScreenSizeCoarse *= gridTick;
gridScreenSizeDense *= gridTick;
gridScreenSize = gridScreenSize * static_cast<double>( gridTick );
}
// Compute grid staring and ending indexes to draw grid points on the
// Compute grid starting and ending indexes to draw grid points on the
// visible screen area
// Note: later any point coordinate will be offsetted by gridOrigin
int gridStartX = KiROUND( ( worldStartPoint.x - gridOrigin.x ) / gridScreenSizeDense );
int gridEndX = KiROUND( ( worldEndPoint.x - gridOrigin.x ) / gridScreenSizeDense );
int gridStartY = KiROUND( ( worldStartPoint.y - gridOrigin.y ) / gridScreenSizeDense );
int gridEndY = KiROUND( ( worldEndPoint.y - gridOrigin.y ) / gridScreenSizeDense );
int gridStartX = KiROUND( ( worldStartPoint.x - gridOrigin.x ) / gridScreenSize.x );
int gridEndX = KiROUND( ( worldEndPoint.x - gridOrigin.x ) / gridScreenSize.x );
int gridStartY = KiROUND( ( worldStartPoint.y - gridOrigin.y ) / gridScreenSize.y );
int gridEndY = KiROUND( ( worldEndPoint.y - gridOrigin.y ) / gridScreenSize.y );
// Ensure start coordinate > end coordinate
SWAP( gridStartX, >, gridEndX );
@@ -1305,7 +1310,7 @@ void OPENGL_GAL::DrawGrid()
for( int j = gridStartY; j <= gridEndY; j++ )
{
bool tickY = ( j % gridTick == 0 );
int posY = j * gridScreenSizeDense + gridOrigin.y;
const double posY = j * gridScreenSize.y + gridOrigin.y;
// Horizontal positions
for( int i = gridStartX; i <= gridEndX; i++ )
@@ -1313,7 +1318,7 @@ void OPENGL_GAL::DrawGrid()
bool tickX = ( i % gridTick == 0 );
SetLineWidth( ( ( tickX && tickY ) ? majorLineWidth : minorLineWidth ) );
auto lineLen = 2.0 * GetLineWidth();
auto posX = i * gridScreenSizeDense + gridOrigin.x;
auto posX = i * gridScreenSize.x + gridOrigin.x;
DrawLine( VECTOR2D( posX - lineLen, posY ), VECTOR2D( posX + lineLen, posY ) );
DrawLine( VECTOR2D( posX, posY - lineLen ), VECTOR2D( posX, posY + lineLen ) );
@@ -1327,15 +1332,15 @@ void OPENGL_GAL::DrawGrid()
// Vertical lines
for( int j = gridStartY; j <= gridEndY; j++ )
{
const double y = j * gridScreenSizeDense + gridOrigin.y;
const double y = j * gridScreenSize.y + gridOrigin.y;
// If axes are drawn, skip the lines that would cover them
if( axesEnabled && y == 0 )
if( axesEnabled && y == 0.0 )
continue;
SetLineWidth( ( j % gridTick == 0 ) ? majorLineWidth : minorLineWidth );
VECTOR2D a ( gridStartX * gridScreenSizeDense + gridOrigin.x, y );
VECTOR2D b ( gridEndX * gridScreenSizeDense + gridOrigin.x, y );
VECTOR2D a ( gridStartX * gridScreenSize.x + gridOrigin.x, y );
VECTOR2D b ( gridEndX * gridScreenSize.x + gridOrigin.x, y );
DrawLine( a, b );
}
@@ -1352,15 +1357,15 @@ void OPENGL_GAL::DrawGrid()
// Horizontal lines
for( int i = gridStartX; i <= gridEndX; i++ )
{
const double x = i * gridScreenSizeDense + gridOrigin.x;
const double x = i * gridScreenSize.x + gridOrigin.x;
// If axes are drawn, skip the lines that would cover them
if( axesEnabled && x == 0 )
if( axesEnabled && x == 0.0 )
continue;
SetLineWidth( ( i % gridTick == 0 ) ? majorLineWidth : minorLineWidth );
VECTOR2D a ( x, gridStartY * gridScreenSizeDense + gridOrigin.y );
VECTOR2D b ( x, gridEndY * gridScreenSizeDense + gridOrigin.y );
VECTOR2D a ( x, gridStartY * gridScreenSize.y + gridOrigin.y );
VECTOR2D b ( x, gridEndY * gridScreenSize.y + gridOrigin.y );
DrawLine( a, b );
}
+9 -12
View File
@@ -60,7 +60,7 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe
double glyphEndX = 0.0;
VECTOR2D glyphBoundingX;
std::deque<VECTOR2D>* pointList = nullptr;
std::vector<VECTOR2D>* pointList = nullptr;
int i = 0;
@@ -105,7 +105,7 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe
if( !pointList )
{
glyph.emplace_back( std::deque<VECTOR2D>() );
glyph.emplace_back( std::vector<VECTOR2D>() );
pointList = &glyph.back();
}
@@ -140,17 +140,16 @@ BOX2D STROKE_FONT::computeBoundingBox( const GLYPH& aGLYPH, const VECTOR2D& aGLY
{
BOX2D boundingBox;
std::deque<VECTOR2D> boundingPoints;
std::vector<VECTOR2D> boundingPoints;
boundingPoints.emplace_back( VECTOR2D( aGLYPHBoundingX.x, 0 ) );
boundingPoints.emplace_back( VECTOR2D( aGLYPHBoundingX.y, 0 ) );
for( GLYPH::const_iterator pointListIt = aGLYPH.begin(); pointListIt != aGLYPH.end(); ++pointListIt )
for( const auto& pointList : aGLYPH )
{
for( std::deque<VECTOR2D>::const_iterator pointIt = pointListIt->begin();
pointIt != pointListIt->end(); ++pointIt )
for( const auto& pt : pointList )
{
boundingPoints.emplace_back( VECTOR2D( aGLYPHBoundingX.x, pointIt->y ) );
boundingPoints.emplace_back( aGLYPHBoundingX.x, pt.y );
}
}
@@ -341,15 +340,13 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText )
last_had_overbar = false;
}
for( GLYPH::iterator pointListIt = glyph.begin(); pointListIt != glyph.end();
++pointListIt )
for( const auto& pointList : glyph )
{
std::deque<VECTOR2D> pointListScaled;
for( std::deque<VECTOR2D>::iterator pointIt = pointListIt->begin();
pointIt != pointListIt->end(); ++pointIt )
for( const auto& pt : pointList )
{
VECTOR2D pointPos( pointIt->x * glyphSize.x + xOffset, pointIt->y * glyphSize.y );
VECTOR2D pointPos( pt.x * glyphSize.x + xOffset, pt.y * glyphSize.y );
if( m_gal->IsFontItalic() )
{
+20 -9
View File
@@ -150,7 +150,8 @@ wxString GbrMakeProjectGUIDfromString( wxString& aText )
std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribute,
bool aUseX1StructuredComment )
{
std::string attribute_string;
std::string attribute_string; // the specific aperture attribute (TA.xxx)
std::string comment_string; // a optional G04 comment line to write before the TA. line
// generate a string to print a Gerber Aperture attribute
switch( aAttribute )
@@ -169,8 +170,8 @@ std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribu
attribute_string = "TA.AperFunction,Conductor";
break;
case GBR_APERTURE_ATTRIB_CUTOUT: // print info associated to a outline
attribute_string = "TA.AperFunction,CutOut";
case GBR_APERTURE_ATTRIB_EDGECUT: // print info associated to a board outline (edge.cut layer)
attribute_string = "TA.AperFunction,Profile";
break;
case GBR_APERTURE_ATTRIB_VIAPAD: // print info associated to a flashed via
@@ -226,13 +227,18 @@ std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribu
break;
case GBR_APERTURE_ATTRIB_COMPONENTDRILL: // print info associated to a component
// round hole in drill files
// round pad hole in drill files
attribute_string = "TA.AperFunction,ComponentDrill";
break;
case GBR_APERTURE_ATTRIB_SLOTDRILL: // print info associated to a oblong hole in drill files
attribute_string = "TA.AperFunction,Slot";
break;
// print info associated to a component oblong pad hole in drill files
// Same as a round pad hole, but is a specific aperture in drill file and
// a G04 comment is added to the aperture function
case GBR_APERTURE_ATTRIB_COMPONENTOBLONGDRILL:
comment_string = "aperture for slot hole";
attribute_string = "TA.AperFunction,ComponentDrill";
break;
}
std::string full_attribute_string;
@@ -240,14 +246,19 @@ std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribu
if( !attribute_string.empty() )
{
if( !comment_string.empty() )
{
full_attribute_string = "G04 " + comment_string + "*\n";
}
if( aUseX1StructuredComment )
{
full_attribute_string = "G04 #@! ";
full_attribute_string += "G04 #@! ";
eol_string = "*\n";
}
else
{
full_attribute_string = "%";
full_attribute_string += "%";
eol_string = "*%\n";
}
}
+21 -10
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -30,6 +30,9 @@
#include <eda_rect.h>
#include <geometry/geometry_utils.h>
// To approximate a circle by segments, a minimal seg count is mandatory
#define MIN_SEGCOUNT_FOR_CIRCLE 6
int GetArcToSegmentCount( int aRadius, int aErrorMax, double aArcAngleDegree )
{
// calculate the number of segments to approximate a circle by segments
@@ -38,11 +41,15 @@ int GetArcToSegmentCount( int aRadius, int aErrorMax, double aArcAngleDegree )
// error relative to the radius value:
double rel_error = (double)aErrorMax / aRadius;
// minimal arc increment in degrees:
double step = 180 / M_PI * acos( 1.0 - rel_error ) * 2;
// the minimal seg count for a arc
int segCount = round_nearest( fabs( aArcAngleDegree ) / step );
double arc_increment = 180 / M_PI * acos( 1.0 - rel_error ) * 2;
// Ensure at least one segment is used
// Ensure a minimal arc increment reasonable value for a circle
// (360.0 degrees). For very small radius values, this is mandatory.
arc_increment = std::min( 360.0/MIN_SEGCOUNT_FOR_CIRCLE, arc_increment );
int segCount = round_nearest( fabs( aArcAngleDegree ) / arc_increment );
// Ensure at least one segment is used (can happen for small arcs)
return std::max( segCount, 1 );
}
@@ -53,13 +60,13 @@ double GetCircletoPolyCorrectionFactor( int aSegCountforCircle )
* due to the segment approx.
* For a circle the min radius is radius * cos( 2PI / aSegCountforCircle / 2)
* this is the distance between the center and the middle of the segment.
* therfore, to move the middle of the segment to the circle (distance = radius)
* therefore, to move the middle of the segment to the circle (distance = radius)
* the correctionFactor is 1 /cos( PI/aSegCountforCircle )
*/
if( aSegCountforCircle < 6 )
aSegCountforCircle = 6;
if( 1 || aSegCountforCircle > 64 )
return 1.0 / cos( M_PI / aSegCountforCircle );
if( aSegCountforCircle < MIN_SEGCOUNT_FOR_CIRCLE )
aSegCountforCircle = MIN_SEGCOUNT_FOR_CIRCLE;
return 1.0 / cos( M_PI / aSegCountforCircle );
}
@@ -70,16 +77,19 @@ double GetCircletoPolyCorrectionFactor( int aSegCountforCircle )
inline int clipOutCode( const EDA_RECT *aClipBox, int x, int y )
{
int code;
if( y < aClipBox->GetY() )
code = 2;
else if( y > aClipBox->GetBottom() )
code = 1;
else
code = 0;
if( x < aClipBox->GetX() )
code |= 4;
else if( x > aClipBox->GetRight() )
code |= 8;
return code;
}
@@ -98,6 +108,7 @@ bool ClipLine( const EDA_RECT *aClipBox, int &x1, int &y1, int &x2, int &y2 )
// Choose a side to clip
int thisoutcode, x, y;
if( outcode1 )
thisoutcode = outcode1;
else
+5 -1
View File
@@ -256,7 +256,11 @@ const SHAPE_LINE_CHAIN SHAPE_ARC::ConvertToPolyline( double aAccuracy ) const
for( int i = 0; i <= n ; i++ )
{
double a = sa + m_centralAngle * (double) i / (double) n;
double a = sa;
if( n != 0 )
a += m_centralAngle * (double) i / (double) n;
double x = c.x + r * cos( a * M_PI / 180.0 );
double y = c.y + r * sin( a * M_PI / 180.0 );
+20 -7
View File
@@ -396,12 +396,12 @@ bool SHAPE_POLY_SET::GetNeighbourIndexes( int aGlobalIndex, int* aPrevious, int*
}
bool SHAPE_POLY_SET::IsPolygonSelfIntersecting( int aPolygonIndex )
bool SHAPE_POLY_SET::IsPolygonSelfIntersecting( int aPolygonIndex ) const
{
SEGMENT_ITERATOR iterator = IterateSegmentsWithHoles( aPolygonIndex );
SEGMENT_ITERATOR innerIterator;
CONST_SEGMENT_ITERATOR iterator = CIterateSegmentsWithHoles( aPolygonIndex );
CONST_SEGMENT_ITERATOR innerIterator;
for( iterator = IterateSegmentsWithHoles( aPolygonIndex ); iterator; iterator++ )
for( iterator = CIterateSegmentsWithHoles( aPolygonIndex ); iterator; iterator++ )
{
SEG firstSegment = *iterator;
@@ -423,7 +423,7 @@ bool SHAPE_POLY_SET::IsPolygonSelfIntersecting( int aPolygonIndex )
}
bool SHAPE_POLY_SET::IsSelfIntersecting()
bool SHAPE_POLY_SET::IsSelfIntersecting() const
{
for( unsigned int polygon = 0; polygon < m_polys.size(); polygon++ )
{
@@ -544,7 +544,15 @@ void SHAPE_POLY_SET::BooleanIntersection( const SHAPE_POLY_SET& a,
}
void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount )
void SHAPE_POLY_SET::InflateWithLinkedHoles( int aFactor, int aCircleSegmentsCount, POLYGON_MODE aFastMode )
{
Simplify( aFastMode );
Inflate( aFactor, aCircleSegmentsCount );
Fracture( aFastMode );
}
void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount, bool aPreseveCorners )
{
// A static table to avoid repetitive calculations of the coefficient
// 1.0 - cos( M_PI/aCircleSegmentsCount)
@@ -554,10 +562,14 @@ void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount )
ClipperOffset c;
// N.B. using jtSquare here does not create square corners. They end up mitered by
// aFactor. Setting jtMiter and forcing the limit to be aFactor creates sharp corners.
JoinType type = aPreseveCorners ? jtMiter : jtRound;
for( const POLYGON& poly : m_polys )
{
for( size_t i = 0; i < poly.size(); i++ )
c.AddPath( poly[i].convertToClipper( i == 0 ), jtRound, etClosedPolygon );
c.AddPath( poly[i].convertToClipper( i == 0 ), type, etClosedPolygon );
}
PolyTree solution;
@@ -583,6 +595,7 @@ void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount )
coeff = arc_tolerance_factor[aCircleSegmentsCount];
c.ArcTolerance = std::abs( aFactor ) * coeff;
c.MiterLimit = std::abs( aFactor );
c.Execute( solution, aFactor );
+12 -22
View File
@@ -32,6 +32,7 @@
#include <trigo.h>
#include <common.h>
#include <math_for_graphics.h>
#include <geometry/seg.h>
// Returns true if the point P is on the segment S.
// faster than TestSegmentHit() because P should be exactly on S
@@ -56,7 +57,8 @@ bool IsPointOnSegment( const wxPoint& aSegStart, const wxPoint& aSegEnd,
// Returns true if the segment 1 intersectd the segment 2.
bool SegmentIntersectsSegment( const wxPoint &a_p1_l1, const wxPoint &a_p2_l1,
const wxPoint &a_p1_l2, const wxPoint &a_p2_l2 )
const wxPoint &a_p1_l2, const wxPoint &a_p2_l2,
wxPoint* aIntersectionPoint )
{
//We are forced to use 64bit ints because the internal units can oveflow 32bit ints when
@@ -87,10 +89,13 @@ bool SegmentIntersectsSegment( const wxPoint &a_p1_l1, const wxPoint &a_p2_l1,
num_a = dY_ab * dX_b - dY_b * dX_ab;
num_b = dY_ab * dX_a - dY_a * dX_ab;
//We wont calculate directly the u_k of the intersection point to avoid floating point
// division but they could be calculated with:
// u_a = (float) num_a / (float) den;
// u_b = (float) num_b / (float) den;
// Only compute the intersection point if requested
if( aIntersectionPoint )
{
*aIntersectionPoint = a_p1_l1;
aIntersectionPoint->x += KiROUND( dX_a * ( double )num_a / ( double )den );
aIntersectionPoint->y += KiROUND( dY_a * ( double )num_b / ( double )den );
}
if( den < 0 )
{
@@ -147,23 +152,8 @@ bool TestSegmentHit( const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int
if( aStart.y == aEnd.y && aRefPoint.x > xmin && aRefPoint.x < xmax )
return std::abs( delta.y ) <= aDist;
wxPoint len = aEnd - aStart;
// Precision note here:
// These are 32-bit integers, so squaring requires 64 bits to represent
// exactly. 64-bit Doubles have only 52 bits in the mantissa, so we start to lose
// precision at 2^53, which corresponds to ~ ±1nm @ 9.5cm, 2nm at 90cm, etc...
// Long doubles avoid this ambiguity as well as the more expensive denormal double calc
// Long doubles usually (sometimes more if SIMD) have at least 64 bits in the mantissa
long double length_square = (long double) len.x * len.x + (long double) len.y * len.y;
long double cross = std::abs( (long double) len.x * delta.y - (long double) len.y * delta.x );
long double dist_square = (long double) aDist * aDist;
// The perpendicular distance to a line is the vector magnitude of the line from
// a test point to the test line. That is the 2d determinant. Because we handled
// the zero length case above, so we are guaranteed a unique solution.
return ( ( length_square >= cross && dist_square >= cross ) ||
( length_square * dist_square >= cross * cross ) );
SEG segment( aStart, aEnd );
return segment.PointCloserThan( aRefPoint, aDist + 1 );
}
+5 -5
View File
@@ -347,27 +347,27 @@ bool OpenPDF( const wxString& file )
wxString command;
wxString filename = file;
// Quote in case there are spaces in the file name.
AddDelimiterString( filename );
Pgm().ReadPdfBrowserInfos();
if( !Pgm().UseSystemPdfBrowser() ) // Run the preferred PDF Browser
{
command = Pgm().GetPdfBrowserName() + wxT( " " ) + filename;
command = Pgm().GetPdfBrowserName() + wxT( " '" ) + filename + wxT( "'" );
}
else
{
if( wxLaunchDefaultApplication( filename ) )
return true;
#ifdef __WXMAC__
command = wxT( "/usr/bin/open -a '" ) + filename + wxT( "'" );
#endif
// If launching the system default PDF viewer fails, fall through with empty command
// string so the error message is displayed.
}
if( !command.IsEmpty() )
{
if( ProcessExecute( command ) )
if( ProcessExecute( command ) != -1 )
{
return true;
}
+50 -50
View File
@@ -39,7 +39,7 @@ static inline size_t hash_board_item( const BOARD_ITEM* aItem, int aFlags )
size_t ret = 0;
if( aFlags & LAYER )
ret ^= hash<unsigned long long>{}( aItem->GetLayerSet().to_ullong() );
ret = hash<unsigned long long>{}( aItem->GetLayerSet().to_ullong() );
return ret;
}
@@ -55,57 +55,57 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags )
{
const MODULE* module = static_cast<const MODULE*>( aItem );
ret ^= hash_board_item( module, aFlags );
ret += hash_board_item( module, aFlags );
if( aFlags & POSITION )
{
ret ^= hash<int>{}( module->GetPosition().x );
ret ^= hash<int>{}( module->GetPosition().y );
ret += hash<int>{}( module->GetPosition().x );
ret += hash<int>{}( module->GetPosition().y );
}
if( aFlags & ROTATION )
ret ^= hash<double>{}( module->GetOrientation() );
ret += hash<double>{}( module->GetOrientation() );
for( const BOARD_ITEM* i = module->GraphicalItemsList(); i; i = i->Next() )
ret ^= hash_eda( i, aFlags );
ret += hash_eda( i, aFlags );
for( const D_PAD* i = module->PadsList(); i; i = i->Next() )
ret ^= hash_eda( i, aFlags );
ret += hash_eda( i, aFlags );
}
break;
case PCB_PAD_T:
{
const D_PAD* pad = static_cast<const D_PAD*>( aItem );
ret ^= hash_board_item( pad, aFlags );
ret ^= hash<int>{}( pad->GetShape() << 16 );
ret ^= hash<int>{}( pad->GetDrillShape() << 18 );
ret ^= hash<int>{}( pad->GetSize().x << 8 );
ret ^= hash<int>{}( pad->GetSize().y << 9 );
ret ^= hash<int>{}( pad->GetOffset().x << 6 );
ret ^= hash<int>{}( pad->GetOffset().y << 7 );
ret ^= hash<int>{}( pad->GetDelta().x << 4 );
ret ^= hash<int>{}( pad->GetDelta().y << 5 );
ret += hash_board_item( pad, aFlags );
ret += hash<int>{}( pad->GetShape() << 16 );
ret += hash<int>{}( pad->GetDrillShape() << 18 );
ret += hash<int>{}( pad->GetSize().x << 8 );
ret += hash<int>{}( pad->GetSize().y << 9 );
ret += hash<int>{}( pad->GetOffset().x << 6 );
ret += hash<int>{}( pad->GetOffset().y << 7 );
ret += hash<int>{}( pad->GetDelta().x << 4 );
ret += hash<int>{}( pad->GetDelta().y << 5 );
if( aFlags & POSITION )
{
if( aFlags & REL_COORD )
{
ret ^= hash<int>{}( pad->GetPos0().x );
ret ^= hash<int>{}( pad->GetPos0().y );
ret += hash<int>{}( pad->GetPos0().x );
ret += hash<int>{}( pad->GetPos0().y );
}
else
{
ret ^= hash<int>{}( pad->GetPosition().x );
ret ^= hash<int>{}( pad->GetPosition().y );
ret += hash<int>{}( pad->GetPosition().x );
ret += hash<int>{}( pad->GetPosition().y );
}
}
if( aFlags & ROTATION )
ret ^= hash<double>{}( pad->GetOrientation() );
ret += hash<double>{}( pad->GetOrientation() );
if( aFlags & NET )
ret ^= hash<int>{}( pad->GetNetCode() << 6 );
ret += hash<int>{}( pad->GetNetCode() << 6 );
}
break;
@@ -119,64 +119,64 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags )
if( !( aFlags & VALUE ) && text->GetType() == TEXTE_MODULE::TEXT_is_VALUE )
break;
ret ^= hash_board_item( text, aFlags );
ret ^= hash<string>{}( text->GetText().ToStdString() );
ret ^= hash<bool>{}( text->IsItalic() );
ret ^= hash<bool>{}( text->IsBold() );
ret ^= hash<bool>{}( text->IsMirrored() );
ret ^= hash<int>{}( text->GetTextWidth() );
ret ^= hash<int>{}( text->GetTextHeight() );
ret ^= hash<int>{}( text->GetHorizJustify() );
ret ^= hash<int>{}( text->GetVertJustify() );
ret += hash_board_item( text, aFlags );
ret += hash<string>{}( text->GetText().ToStdString() );
ret += hash<bool>{}( text->IsItalic() );
ret += hash<bool>{}( text->IsBold() );
ret += hash<bool>{}( text->IsMirrored() );
ret += hash<int>{}( text->GetTextWidth() );
ret += hash<int>{}( text->GetTextHeight() );
ret += hash<int>{}( text->GetHorizJustify() );
ret += hash<int>{}( text->GetVertJustify() );
if( aFlags & POSITION )
{
if( aFlags & REL_COORD )
{
ret ^= hash<int>{}( text->GetPos0().x );
ret ^= hash<int>{}( text->GetPos0().y );
ret += hash<int>{}( text->GetPos0().x );
ret += hash<int>{}( text->GetPos0().y );
}
else
{
ret ^= hash<int>{}( text->GetPosition().x );
ret ^= hash<int>{}( text->GetPosition().y );
ret += hash<int>{}( text->GetPosition().x );
ret += hash<int>{}( text->GetPosition().y );
}
}
if( aFlags & ROTATION )
ret ^= hash<double>{}( text->GetTextAngle() );
ret += hash<double>{}( text->GetTextAngle() );
}
break;
case PCB_MODULE_EDGE_T:
{
const EDGE_MODULE* segment = static_cast<const EDGE_MODULE*>( aItem );
ret ^= hash_board_item( segment, aFlags );
ret ^= hash<int>{}( segment->GetType() );
ret ^= hash<int>{}( segment->GetShape() );
ret ^= hash<int>{}( segment->GetWidth() );
ret ^= hash<int>{}( segment->GetRadius() );
ret += hash_board_item( segment, aFlags );
ret += hash<int>{}( segment->GetType() );
ret += hash<int>{}( segment->GetShape() );
ret += hash<int>{}( segment->GetWidth() );
ret += hash<int>{}( segment->GetRadius() );
if( aFlags & POSITION )
{
if( aFlags & REL_COORD )
{
ret ^= hash<int>{}( segment->GetStart0().x );
ret ^= hash<int>{}( segment->GetStart0().y );
ret ^= hash<int>{}( segment->GetEnd0().x );
ret ^= hash<int>{}( segment->GetEnd0().y );
ret += hash<int>{}( segment->GetStart0().x );
ret += hash<int>{}( segment->GetStart0().y );
ret += hash<int>{}( segment->GetEnd0().x );
ret += hash<int>{}( segment->GetEnd0().y );
}
else
{
ret ^= hash<int>{}( segment->GetStart().x );
ret ^= hash<int>{}( segment->GetStart().y );
ret ^= hash<int>{}( segment->GetEnd().x );
ret ^= hash<int>{}( segment->GetEnd().y );
ret += hash<int>{}( segment->GetStart().x );
ret += hash<int>{}( segment->GetStart().y );
ret += hash<int>{}( segment->GetEnd().x );
ret += hash<int>{}( segment->GetEnd().y );
}
}
if( aFlags & ROTATION )
ret ^= hash<double>{}( segment->GetAngle() );
ret += hash<double>{}( segment->GetAngle() );
}
break;
+103 -5
View File
@@ -25,6 +25,9 @@
HOTKEY_STORE::HOTKEY_STORE( EDA_HOTKEY_CONFIG* aHotkeys )
{
m_isValid = false;
m_invalidityCauses = _( "Hotkeys not checked" );
for( EDA_HOTKEY_CONFIG* section = aHotkeys; section->m_HK_InfoList; ++section )
{
m_hk_sections.push_back( genSection( *section ) );
@@ -113,13 +116,13 @@ void HOTKEY_STORE::ResetAllHotkeysToOriginal()
}
bool HOTKEY_STORE::CheckKeyConflicts( long aKey, const wxString& aSectionTag,
EDA_HOTKEY** aConfKey, EDA_HOTKEY_CONFIG** aConfSect )
bool HOTKEY_STORE::CheckKeyConflicts( long aKey, const wxString& aSectionTag, EDA_HOTKEY** aConfKey,
EDA_HOTKEY_CONFIG** aConfSect, const int aIdCommand )
{
EDA_HOTKEY* conflicting_key = nullptr;
EDA_HOTKEY_CONFIG* conflicting_section = nullptr;
for( auto& section: m_hk_sections )
for( auto& section : m_hk_sections )
{
const auto& sectionTag = *section.m_section.m_SectionTag;
@@ -135,7 +138,7 @@ bool HOTKEY_STORE::CheckKeyConflicts( long aKey, const wxString& aSectionTag,
for( auto& hotkey: section.m_hotkeys )
{
auto& curr_hk = hotkey.GetCurrentValue();
if( aKey == curr_hk.m_KeyCode )
if( ( aKey == curr_hk.m_KeyCode ) && ( aIdCommand != curr_hk.m_Idcommand ) )
{
conflicting_key = &curr_hk;
conflicting_section = &section.m_section;
@@ -151,4 +154,99 @@ bool HOTKEY_STORE::CheckKeyConflicts( long aKey, const wxString& aSectionTag,
*aConfSect = conflicting_section;
return conflicting_key == nullptr;
}
}
bool HOTKEY_STORE::CheckKeyValidity( long aKey, wxString& aMessage )
{
// Extract the modifiers and the keycode
int modifiers = aKey & ( GR_KB_SHIFT | GR_KB_CTRL | GR_KB_ALT );
int keycode = aKey & 0x00FFFFFF;
// Hotkeys may not contain the shift+SYMBOL sequence.
// This sequence gets mapped to (UPPER SYMBOL) in the hotkey logic
if( modifiers & GR_KB_SHIFT )
{
// These catch the ASCII codes for the special characters
if( ( keycode <= 64 && keycode >= 32 ) ||
( keycode <= 96 && keycode >= 91 ) ||
( keycode <= 126 && keycode >= 123 ) )
{
aMessage = _( "A hotkey cannot contain the shift key and a symbol key." );
return false;
}
}
// This code block can be used to test the key validity checks
#if 0
if( modifiers & GR_KB_CTRL )
{
if( keycode == 'K' )
{
aMessage = "A hotkey cannot be ctrl+K";
return false;
}
}
#endif
return true;
}
bool HOTKEY_STORE::TestStoreValidity()
{
m_isValid = true;
m_invalidityCauses.Clear();
// Iterate over every key to test it
for( HOTKEY_SECTION& section : m_hk_sections )
{
for( CHANGED_HOTKEY& hotkey : section.m_hotkeys )
{
EDA_HOTKEY& curr_hk = hotkey.GetCurrentValue();
wxString validMessage;
bool isValid = CheckKeyValidity( curr_hk.m_KeyCode, validMessage );
// If the key isn't valid, set it and continue
if( !isValid )
{
hotkey.SetValidity( false, validMessage );
m_invalidityCauses << wxGetTranslation( curr_hk.m_InfoMsg );
m_invalidityCauses << ": " << validMessage << "\n";
m_isValid = false;
continue;
}
// Test for duplication
const wxString& sectionTag = *section.m_section.m_SectionTag;
EDA_HOTKEY* conflicting_key = nullptr;
EDA_HOTKEY_CONFIG* conflicting_section = nullptr;
CheckKeyConflicts( curr_hk.m_KeyCode, sectionTag, &conflicting_key,
&conflicting_section, curr_hk.m_Idcommand );
// Not valid if a conflicting key was found
if( conflicting_key != nullptr )
{
wxString keyInfoMsg = wxGetTranslation( conflicting_key->m_InfoMsg );
validMessage =
wxString::Format( _( "Duplicate of hotkey for \"%s\"" ), keyInfoMsg );
hotkey.SetValidity( false, validMessage );
m_invalidityCauses << wxGetTranslation( curr_hk.m_InfoMsg );
m_invalidityCauses << ": " << validMessage << "\n";
m_isValid = false;
continue;
}
// If it made it this far, it is a valid hotkey
validMessage = _( "Hotkey is valid" );
hotkey.SetValidity( true, validMessage );
}
}
return m_isValid;
}
+13 -7
View File
@@ -28,16 +28,20 @@
#include <common.h>
HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* parent, const wxString& aTitle) :
DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, aTitle )
HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* aParent, const wxString& aTitle,
const wxPoint& aPosition, const wxSize& aSize ) :
DIALOG_DISPLAY_HTML_TEXT_BASE( aParent, wxID_ANY, aTitle, aPosition, aSize )
{
m_htmlWindow->SetLayoutDirection( wxLayout_LeftToRight );
ListClear();
// Gives a default logical size (the actual size depends on the display definition)
SetSizeInDU( 320, 120 );
if( aSize != wxDefaultSize )
SetSizeInDU( aSize.x, aSize.y );
Center();
m_sdbSizer1OK->SetDefault();
}
@@ -49,12 +53,14 @@ HTML_MESSAGE_BOX::~HTML_MESSAGE_BOX()
}
void HTML_MESSAGE_BOX::OnCloseButtonClick( wxCommandEvent& event )
void HTML_MESSAGE_BOX::OnOKButtonClick( wxCommandEvent& event )
{
// the dialog can be shown modal or not modal.
// the dialog can be shown quasi-model, modal, or not modeless.
// therefore, use the right way to close it.
if( IsModal() )
EndModal( 0 );
if( IsQuasiModal() )
EndQuasiModal( wxID_OK );
else if( IsModal() )
EndModal( wxID_OK );
else
Destroy();
}
-188
View File
@@ -1,188 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <incremental_text_ctrl.h>
#include <utility>
/**
* Check that a string looks like a floating point number that can
* be dealt with.
*/
static bool validateFloatField( const wxString& aStr )
{
// Skip empty fields
if( aStr.size() == 0 )
return false;
// a single . or , doesn't count as number, although valid in a float
if( aStr.size() == 1 )
{
if( (aStr.compare( "." ) == 0) ||
(aStr.compare( "," ) == 0) )
return false;
}
return true;
}
INCREMENTAL_TEXT_CTRL::INCREMENTAL_TEXT_CTRL() :
m_minVal( 0.0 ),
m_maxVal( 1.0 ),
m_currentValue( 0.0 ),
m_precision( 4 )
{}
void INCREMENTAL_TEXT_CTRL::SetStep( double aMin, double aMax,
STEP_FUNCTION aStepFunc )
{
wxASSERT( aMin <= aMax );
m_minVal = std::min( aMin, aMax );
m_maxVal = std::max( aMin, aMax );
m_stepFunc = std::move( aStepFunc );
// finally, clamp the current value and re-display
updateTextValue();
}
void INCREMENTAL_TEXT_CTRL::updateTextValue()
{
if( m_currentValue > m_maxVal )
m_currentValue = m_maxVal;
if( m_currentValue < m_minVal )
m_currentValue = m_minVal;
wxString fmt = wxString::Format( "%%.%df", m_precision );
setTextCtrl( wxString::Format( fmt, m_currentValue ) );
}
void INCREMENTAL_TEXT_CTRL::incrementCtrlBy( double aInc )
{
const wxString txt = getCtrlText();
if( !validateFloatField( txt ) )
return;
txt.ToDouble( &m_currentValue );
m_currentValue += aInc;
updateTextValue();
}
void INCREMENTAL_TEXT_CTRL::incrementCtrl( bool aUp )
{
incrementCtrlBy( m_stepFunc( aUp, m_currentValue ) );
}
void INCREMENTAL_TEXT_CTRL::SetPrecision( int aPrecision )
{
m_precision = aPrecision;
}
void INCREMENTAL_TEXT_CTRL::SetValue( double aValue )
{
m_currentValue = aValue;
updateTextValue();
}
double INCREMENTAL_TEXT_CTRL::GetValue()
{
// sanitise before handing the value - if the user did something
// like close a window with outstanding text changes, we need
// to clamp the value and re-interpret the text
incrementCtrlBy( 0.0 );
return m_currentValue;
}
SPIN_INCREMENTAL_TEXT_CTRL::SPIN_INCREMENTAL_TEXT_CTRL( wxSpinButton& aSpinBtn,
wxTextCtrl& aTextCtrl ):
m_spinBtn( aSpinBtn ),
m_textCtrl( aTextCtrl )
{
(void) m_spinBtn;
// set always enabled, otherwise it's very hard to keep in sync
aSpinBtn.SetRange( -INT_MAX, INT_MAX );
auto spinUpHandler = [this] ( wxSpinEvent& event )
{
incrementCtrl( true );
};
// spin up/down if a single step of the field
auto spinDownHandler = [this] ( wxSpinEvent& event )
{
incrementCtrl( false );
};
auto mouseWheelHandler = [this] ( wxMouseEvent& aEvent )
{
incrementCtrl( aEvent.GetWheelRotation() >= 0 );
};
aSpinBtn.Bind( wxEVT_SPIN_UP, spinUpHandler );
aSpinBtn.Bind( wxEVT_SPIN_DOWN, spinDownHandler );
m_textCtrl.Bind( wxEVT_MOUSEWHEEL, mouseWheelHandler );
m_textCtrl.Bind( wxEVT_KILL_FOCUS, &SPIN_INCREMENTAL_TEXT_CTRL::onFocusLoss, this );
}
SPIN_INCREMENTAL_TEXT_CTRL::~SPIN_INCREMENTAL_TEXT_CTRL()
{
// this must be unbound, as kill focus can arrive after the
// text control is gone
m_textCtrl.Unbind( wxEVT_KILL_FOCUS, &SPIN_INCREMENTAL_TEXT_CTRL::onFocusLoss, this );
}
void SPIN_INCREMENTAL_TEXT_CTRL::onFocusLoss( wxFocusEvent& aEvent )
{
// re-read the input and sanitize any user changes
incrementCtrlBy( 0.0 );
}
void SPIN_INCREMENTAL_TEXT_CTRL::setTextCtrl( const wxString& val )
{
m_textCtrl.SetValue( val );
}
wxString SPIN_INCREMENTAL_TEXT_CTRL::getCtrlText() const
{
return m_textCtrl.GetValue();
}
+27
View File
@@ -94,6 +94,7 @@ void KIWAY::SetTop( wxFrame* aTop )
const wxString KIWAY::dso_search_path( FACE_T aFaceId )
{
const char* name;
const char* dirName;
switch( aFaceId )
{
@@ -110,6 +111,13 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId )
return wxEmptyString;
}
// The subdirectories usually have the same name as the kiface
switch( aFaceId )
{
case FACE_PL_EDITOR: dirName = "pagelayout_editor"; break;
default: dirName = name + 1; break;
}
#ifndef __WXMAC__
wxString path;
@@ -131,6 +139,25 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId )
fn.SetName( name );
#ifdef DEBUG
// To speed up development, it's sometimes nice to run kicad from inside
// the build path. In that case, each program will be in a subdirectory.
// To find the DSOs, we need to go up one directory and then enter a subdirectory.
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
{
#ifdef __WXMAC__
fn = wxStandardPaths::Get().GetExecutablePath();
fn.RemoveLastDir();
fn.AppendDir( wxT( "PlugIns" ) );
fn.SetName( name );
#else
fn.RemoveLastDir();
fn.AppendDir( dirName );
#endif
}
#endif
// Here a "suffix" == an extension with a preceding '.',
// so skip the preceding '.' to get an extension
fn.SetExt( KIFACE_SUFFIX + 1 ); // + 1 => &KIFACE_SUFFIX[1]

Some files were not shown because too many files have changed in this diff Show More