Compare commits

...

138 Commits

Author SHA1 Message Date
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
257 changed files with 21606 additions and 29907 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
@@ -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
+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()
{
}
}
+85 -17
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>
/**
@@ -168,10 +172,6 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent,
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 +190,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 +291,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:
@@ -869,6 +902,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 +990,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 +1274,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
*/
+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.2" )
@@ -70,20 +70,31 @@ 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:
tools/check_coding.sh --diff
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 fix your
staged changes automatically with this tool:
tools/check_coding.sh
Or you can proceed anyway, if you are sure your style is correct:
git commit --no-verify
The `check_coding.sh` tool has other modes:
* Make (or see only) changes to files modified in the previous commit:
* `check_coding.sh --amend [--diff]`
# 2. Naming Conventions # {#naming_conventions}
Before delving into anything as esoteric as indentation and formatting,
+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.
+21 -19
View File
@@ -1,19 +1,21 @@
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
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 CC-BY-SA-4.0:
- All the demo files provided in demos/*
Licensed under GPLv3 (or later):
- All remaining code not listed above
+1 -1
View File
@@ -13,7 +13,7 @@ AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: NonAssignment
+3
View File
@@ -293,8 +293,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
@@ -429,6 +431,7 @@ target_link_libraries( common
${Boost_LIBRARIES}
${CURL_LIBRARIES}
${OPENSSL_LIBRARIES} # empty on Apple
${wxWidgets_LIBRARIES}
)
+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);
}
+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;
}
+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>
+87 -25
View File
@@ -21,20 +21,50 @@
* 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 <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 +93,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 +147,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 +172,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:
+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;
}
+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;
}
+1
View File
@@ -245,6 +245,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 );
+10 -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,14 @@ 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 are 72 DPI by default. This is an ususable resolution for us.
// A reasonable resolution is 600 DPI
// so modify the default:
#define DEFAULT_DPI 72.0
#define KICAD_PRINTER_DPI 600.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 +128,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() );
}
+54 -17
View File
@@ -22,9 +22,12 @@
*/
#include <gal/gal_display_options.h>
#include <wx/config.h>
#include <config_map.h>
#include <dpi_scaling.h>
#include <pgm_base.h>
using namespace KIGFX;
@@ -55,42 +58,76 @@ 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;
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,
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 )
{
ReadAppConfig( aAppConfig, aBaseCfgName );
ReadCommonConfig( aCommonConfig, aWindow );
}
void GAL_DISPLAY_OPTIONS::WriteConfig( wxConfigBase& aCfg, const wxString& aBaseName )
{
const wxString baseName = aBaseName + GAL_DISPLAY_OPTIONS_KEY;
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()
{
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;
+8 -1
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
+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 )
sa += 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 );
+6
View File
@@ -43,6 +43,12 @@ EDA_UNITS_T KIWAY_HOLDER::GetUserUnits() const
}
TOOL_MANAGER* KIWAY_HOLDER::GetToolManager() const
{
return nullptr;
}
// this is not speed critical, hide it out of line.
void KIWAY_HOLDER::SetKiway( wxWindow* aDest, KIWAY* aKiway )
{
+3 -19
View File
@@ -294,14 +294,7 @@ void EDA_DRAW_FRAME::CommonSettingsChanged()
settings->Read( ENBL_AUTO_PAN_KEY, &option );
m_canvas->SetEnableAutoPan( option );
int tmp;
settings->Read( GAL_ANTIALIASING_MODE_KEY, &tmp, (int) KIGFX::OPENGL_ANTIALIASING_MODE::NONE );
m_galDisplayOptions.gl_antialiasing_mode = (KIGFX::OPENGL_ANTIALIASING_MODE) tmp;
settings->Read( CAIRO_ANTIALIASING_MODE_KEY, &tmp, (int) KIGFX::CAIRO_ANTIALIASING_MODE::NONE );
m_galDisplayOptions.cairo_antialiasing_mode = (KIGFX::CAIRO_ANTIALIASING_MODE) tmp;
m_galDisplayOptions.NotifyChanged();
m_galDisplayOptions.ReadCommonConfig( *settings, this );
}
@@ -843,16 +836,7 @@ void EDA_DRAW_FRAME::LoadSettings( wxConfigBase* aCfg )
aCfg->Read( baseCfgName + FirstRunShownKeyword, &m_firstRunDialogSetting, 0L );
m_galDisplayOptions.ReadConfig( aCfg, baseCfgName + GAL_DISPLAY_OPTIONS_KEY );
int temp;
cmnCfg->Read( GAL_ANTIALIASING_MODE_KEY, &temp, (int) KIGFX::OPENGL_ANTIALIASING_MODE::NONE );
m_galDisplayOptions.gl_antialiasing_mode = (KIGFX::OPENGL_ANTIALIASING_MODE) temp;
cmnCfg->Read( CAIRO_ANTIALIASING_MODE_KEY, &temp, (int) KIGFX::CAIRO_ANTIALIASING_MODE::NONE );
m_galDisplayOptions.cairo_antialiasing_mode = (KIGFX::CAIRO_ANTIALIASING_MODE) temp;
m_galDisplayOptions.NotifyChanged();
m_galDisplayOptions.ReadConfig( *cmnCfg, *aCfg, baseCfgName, this );
}
@@ -870,7 +854,7 @@ void EDA_DRAW_FRAME::SaveSettings( wxConfigBase* aCfg )
if( GetScreen() )
aCfg->Write( baseCfgName + MaxUndoItemsEntry, long( GetScreen()->GetMaxUndoItems() ) );
m_galDisplayOptions.WriteConfig( aCfg, baseCfgName + GAL_DISPLAY_OPTIONS_KEY );
m_galDisplayOptions.WriteConfig( *aCfg, baseCfgName );
}
+3 -19
View File
@@ -296,14 +296,7 @@ void EDA_DRAW_FRAME::CommonSettingsChanged()
settings->Read( ENBL_AUTO_PAN_KEY, &option );
m_canvas->SetEnableAutoPan( option );
int tmp;
settings->Read( GAL_ANTIALIASING_MODE_KEY, &tmp, (int) KIGFX::OPENGL_ANTIALIASING_MODE::NONE );
m_galDisplayOptions.gl_antialiasing_mode = (KIGFX::OPENGL_ANTIALIASING_MODE) tmp;
settings->Read( CAIRO_ANTIALIASING_MODE_KEY, &tmp, (int) KIGFX::CAIRO_ANTIALIASING_MODE::NONE );
m_galDisplayOptions.cairo_antialiasing_mode = (KIGFX::CAIRO_ANTIALIASING_MODE) tmp;
m_galDisplayOptions.NotifyChanged();
m_galDisplayOptions.ReadCommonConfig( *settings, this );
}
@@ -862,16 +855,7 @@ void EDA_DRAW_FRAME::LoadSettings( wxConfigBase* aCfg )
aCfg->Read( baseCfgName + FirstRunShownKeyword, &m_firstRunDialogSetting, 0L );
m_galDisplayOptions.ReadConfig( aCfg, baseCfgName + GAL_DISPLAY_OPTIONS_KEY );
int temp;
cmnCfg->Read( GAL_ANTIALIASING_MODE_KEY, &temp, (int) KIGFX::OPENGL_ANTIALIASING_MODE::NONE );
m_galDisplayOptions.gl_antialiasing_mode = (KIGFX::OPENGL_ANTIALIASING_MODE) temp;
cmnCfg->Read( CAIRO_ANTIALIASING_MODE_KEY, &temp, (int) KIGFX::CAIRO_ANTIALIASING_MODE::NONE );
m_galDisplayOptions.cairo_antialiasing_mode = (KIGFX::CAIRO_ANTIALIASING_MODE) temp;
m_galDisplayOptions.NotifyChanged();
m_galDisplayOptions.ReadConfig( *cmnCfg, *aCfg, baseCfgName, this );
}
@@ -891,7 +875,7 @@ void EDA_DRAW_FRAME::SaveSettings( wxConfigBase* aCfg )
if( GetScreen() )
aCfg->Write( baseCfgName + MaxUndoItemsEntry, long( GetScreen()->GetMaxUndoItems() ) );
m_galDisplayOptions.WriteConfig( aCfg, baseCfgName + GAL_DISPLAY_OPTIONS_KEY );
m_galDisplayOptions.WriteConfig( *aCfg, baseCfgName );
}
+11 -1
View File
@@ -104,7 +104,17 @@ void NUMERIC_EVALUATOR::parseOk()
void NUMERIC_EVALUATOR::parseSetResult( double val )
{
snprintf( m_token.token, m_token.OutLen, "%.10g", val );
if( std::isnan( val ) )
{
// Naively printing this with %g produces "nan" on some platforms
// and "-nan(ind)" on others (e.g. MSVC). So force a "standard" string.
snprintf( m_token.token, m_token.OutLen, "%s", "NaN" );
}
else
{
// Can be printed as a floating point
snprintf( m_token.token, m_token.OutLen, "%.10g", val );
}
}
+8
View File
@@ -612,6 +612,12 @@ void PGM_BASE::loadCommonSettings()
{
wxLogTrace( traceEnvVars,
"Enumerating over entry %s, %ld.", GetChars( entry ), index );
// Do not store the env var PROJECT_VAR_NAME ("KIPRJMOD") definition if for some reason
// it is found in config. (It is reserved and defined as project path)
if( entry == PROJECT_VAR_NAME )
continue;
entries.Add( entry );
}
@@ -626,7 +632,9 @@ void PGM_BASE::loadCommonSettings()
}
for( ENV_VAR_MAP_ITER it = m_local_env_vars.begin(); it != m_local_env_vars.end(); ++it )
{
SetLocalEnvVariable( it->first, it->second.GetValue() );
}
m_common_settings->SetPath( oldPath );
}
+2 -2
View File
@@ -566,7 +566,7 @@ int SplitString( wxString strToSplit,
for( ii = (strToSplit.length() - 1); ii >= 0; ii-- )
{
if( isdigit( strToSplit[ii] ) )
if( wxIsdigit( strToSplit[ii] ) )
break;
}
@@ -585,7 +585,7 @@ int SplitString( wxString strToSplit,
for( ; ii >= 0; ii-- )
{
if( !isdigit( strToSplit[ii] ) && separators.Find( strToSplit[ii] ) < 0 )
if( !wxIsdigit( strToSplit[ii] ) && separators.Find( strToSplit[ii] ) < 0 )
break;
}
+5 -2
View File
@@ -703,8 +703,8 @@ void TOOL_MANAGER::dispatchContextMenu( const TOOL_EVENT& aEvent )
if( frame )
frame->PopupMenu( menu.get() );
// Warp the cursor as long as the menu wasn't clicked out of
if( menu->GetSelected() >= 0 )
// Warp the cursor if a menu item was selected
if( menu->GetSelected() >= 0 && m_warpMouseAfterContextMenu )
m_viewControls->WarpCursor( m_menuCursor, true, false );
// Otherwise notify the tool of a cancelled menu
else
@@ -714,6 +714,9 @@ void TOOL_MANAGER::dispatchContextMenu( const TOOL_EVENT& aEvent )
dispatchInternal( evt );
}
// Restore setting in case it was vetoed
m_warpMouseAfterContextMenu = true;
// Notify the tools that menu has been closed
TOOL_EVENT evt( TC_COMMAND, TA_CONTEXT_MENU_CLOSED );
evt.SetParameter( m );
+2 -2
View File
@@ -100,7 +100,7 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI
m_gridLineWidthSpinBtn = new wxSpinButton( sGridSettings->GetStaticBox(),
wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS );
sGridSettingsGrid->Add( m_gridLineWidthSpinBtn, 0, wxEXPAND | wxALL, 0 );
sGridSettingsGrid->Add( m_gridLineWidthSpinBtn, 0, wxALL | wxALIGN_CENTER_VERTICAL, 0 );
l_gridLineWidthUnits = new wxStaticText( sGridSettings->GetStaticBox(),
wxID_ANY, _( "px" ) );
@@ -117,7 +117,7 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI
m_gridMinSpacingSpinBtn = new wxSpinButton( sGridSettings->GetStaticBox(),
wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS );
sGridSettingsGrid->Add( m_gridMinSpacingSpinBtn, 0, wxEXPAND | wxALL, 0 );
sGridSettingsGrid->Add( m_gridMinSpacingSpinBtn, 0, wxALL | wxALIGN_CENTER_VERTICAL, 0 );
l_gridMinSpacingUnits = new wxStaticText( sGridSettings->GetStaticBox(),
wxID_ANY, _( "px" ) );
+1 -4
View File
@@ -279,10 +279,7 @@ protected:
wxString filename = GetValue();
if( !filename.IsEmpty() && filename != wxT( "~" ) )
{
wxString uri = ResolveUriByEnvVars( GetValue() );
GetAssociatedDocument( m_dlg, uri );
}
GetAssociatedDocument( m_dlg, GetValue() );
}
DIALOG_SHIM* m_dlg;
+6 -44
View File
@@ -699,9 +699,6 @@ void mpFXY::Plot( wxDC& dc, mpWindow& w )
wxCoord x0, y0;
bool first = true;
wxCoord minY, maxY;
bool minFirst = true;
while( GetNextXY( x, y ) )
{
double px = m_scaleX->TransformToPlot( x );
@@ -713,58 +710,23 @@ void mpFXY::Plot( wxDC& dc, mpWindow& w )
if( first )
{
first = false;
x0 = x1; y0 = y1;
minY = y1;
maxY = y1;
x0 = x1;
y0 = y1;
continue;
}
if( x0 == x1 ) // continue until a new X coordinate is reached
{
// determine min and max, so they can also be marked on the plot
if( y1 > maxY )
{
maxY = y1;
minFirst = true;
}
if( y1 < minY )
{
minY = y1;
minFirst = false;
}
continue;
}
wxCoord firstY = minFirst ? minY : maxY;
wxCoord secondY = minFirst ? maxY : minY;
if( ( x0 >= startPx ) && ( x0 <= endPx ) )
{
bool outDown = ( y0 > maxYpx ) && ( firstY > maxYpx );
bool outUp = ( y0 < minYpx ) && ( firstY < minYpx );
if( !outUp && !outDown )
{
dc.DrawLine( x0, y0, x0, firstY );
// UpdateViewBoundary(x1, firstY);
}
}
bool outDown = ( firstY > maxYpx ) && ( secondY > maxYpx );
bool outUp = ( firstY < minYpx ) && ( secondY < minYpx );
bool outDown = ( y0 > maxYpx ) && ( y1 > maxYpx );
bool outUp = ( y0 < minYpx ) && ( y1 < minYpx );
bool outLeft = ( x1 < startPx ) && ( x0 < startPx );
bool outRight = ( x1 > endPx ) && ( x0 > endPx );
if( !( outUp || outDown || outLeft || outRight ) )
{
dc.DrawLine( x0, firstY, x1, secondY );
// UpdateViewBoundary(x1, secondY);
}
dc.DrawLine( x0, y0, x1, y1 );
x0 = x1;
y0 = secondY;
minY = y1;
maxY = y1;
y0 = y1;
}
}
+4
View File
@@ -811,8 +811,12 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
// So we want to put it to front, second after our CVPCB_MAINFRAME.
// We do this by a little dance of bringing it to front then the main
// frame back.
wxWindow* focus = FindFocus();
fpframe->Raise(); // Make sure that is visible.
Raise(); // .. but still we want the focus.
focus->SetFocus();
}
fpframe->InitDisplay();
+8 -1
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2007-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2007-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
@@ -67,7 +67,14 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
KiScaledBitmap( delete_association_xpm, this ),
_( "Delete all footprint associations" ) );
// Add tools for footprint names filtering:
KiScaledSeparator( m_mainToolBar, this );
m_mainToolBar->AddSpacer( 15 );
wxStaticText* text = new wxStaticText( m_mainToolBar, wxID_ANY,
_( "Footprint Filters:" ) );
text->SetFont( m_mainToolBar->GetFont().Bold() );
m_mainToolBar->AddControl( text );
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
KiScaledBitmap( module_filtered_list_xpm, this ),
wxNullBitmap,
-1
View File
@@ -1,4 +1,3 @@
(sym_lib_table
(lib (name pic_programmer_schlib)(type Legacy)(uri ${KIPRJMOD}/libs/pic_programmer_schlib.lib)(options "")(descr ""))
(lib (name Logic_74xx)(type Legacy)(uri ${KICAD_SYMBOL_DIR}/Logic_74xx.lib)(options "")(descr ""))
)
-1
View File
@@ -1,4 +1,3 @@
(sym_lib_table
(lib (name schematic_libspice)(type Legacy)(uri ${KIPRJMOD}/schematic_libspice.lib)(options "")(descr ""))
(lib (name power1)(type Legacy)(uri ${KICAD_SYMBOL_DIR}/power.lib)(options "")(descr ""))
)
+3
View File
@@ -356,6 +356,9 @@ target_link_libraries( eeschema_kiface
${wxWidgets_LIBRARIES}
${GDI_PLUS_LIBRARIES}
)
target_include_directories( eeschema_kiface PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
if( KICAD_SPICE )
target_link_libraries( eeschema_kiface
+7 -4
View File
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.fr
* Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2019 KiCad Developers, see change_log.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
@@ -208,8 +208,8 @@ void SCH_EDIT_FRAME::BeginSegment( int type )
{
SCH_LINE* prevSegment = segment->Back();
// Be aware prevSegment can be null when the horizontal and vertical lines only switch is off
// when we create the first segment.
// Be aware prevSegment can be null when the horizontal and vertical lines only switch
// is off when we create the first segment.
if( !GetForceHVLines() )
{
@@ -618,7 +618,10 @@ bool SCH_EDIT_FRAME::SchematicCleanUp( bool aAppend )
SCH_LINE* line = NULL;
bool needed = false;
if( !secondLine->IsParallel( firstLine ) )
if( !secondLine->IsParallel( firstLine )
|| secondLine->GetLineStyle() != firstLine->GetLineStyle()
|| secondLine->GetLineColor() != firstLine->GetLineColor()
|| secondLine->GetLineSize() != firstLine->GetLineSize() )
continue;
// Remove identical lines
+13 -2
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-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
@@ -152,10 +152,21 @@ const EDA_RECT LIB_ALIAS::GetBoundingBox() const
// a LIB_ALIAS does not really have a bounding box.
// return a 0 size rect.
EDA_RECT dummy;
return dummy;
};
const BOX2I LIB_ALIAS::ViewBBox() const
{
// LIB_ALIAS may be displayed in preview windows, so ensure that it is always
// selected for drawing.
BOX2I bbox;
bbox.SetMaximum();
return bbox;
}
wxString LIB_ALIAS::GetSearchText()
{
// Matches are scored by offset from front of string, so inclusion of this spacer
@@ -975,7 +986,7 @@ bool LIB_PART::HasConversion() const
{
for( const LIB_ITEM& item : m_drawings )
{
if( item.m_Convert > 1 )
if( item.m_Convert > LIB_ITEM::LIB_CONVERT::BASE )
return true;
}
+11 -1
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2018 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-2019 KiCad Developers, see change_log.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
@@ -106,6 +106,16 @@ public:
// to avoid useless messages in debug mode
const EDA_RECT GetBoundingBox() const override;
/**
* Returns a default bounding box for the alias. This will be set to the full
* bounding size, ensuring that the alias is always drawn when it is used on screen.
*
* N.B. This is acceptable only because there is typically only a single LIB_ALIAS
* element being drawn (e.g. in the symbol browser)
* @return a maximum size view bounding box
*/
virtual const BOX2I ViewBBox() const override;
/**
* Get the shared LIB_PART.
*
@@ -91,6 +91,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRA
// Show/hide columns according to the user's preference
m_config->Read( LibEditFieldsShownColumnsKey, &m_shownColumns, wxT( "0 1 2 3 4 5 6 7" ) );
m_grid->ShowHideColumns( m_shownColumns );
// Hide non-overridden rows in aliases grid
m_aliasGrid->HideRow( REFERENCE );
m_aliasGrid->HideRow( FOOTPRINT );
@@ -99,7 +100,8 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRA
attr->SetReadOnly();
m_aliasGrid->SetColAttr( FDC_NAME, attr );
m_aliasGrid->SetCellValue( VALUE, FDC_NAME, TEMPLATE_FIELDNAME::GetDefaultFieldName( VALUE ) );
m_aliasGrid->SetCellValue( DATASHEET, FDC_NAME, TEMPLATE_FIELDNAME::GetDefaultFieldName( DATASHEET ) );
m_aliasGrid->SetCellValue( DATASHEET, FDC_NAME,
TEMPLATE_FIELDNAME::GetDefaultFieldName( DATASHEET ) );
attr = new wxGridCellAttr;
attr->SetEditor( new GRID_CELL_URL_EDITOR( this ) );
@@ -125,8 +127,12 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRA
#endif
// wxFormBuilder doesn't include this event...
m_grid->Connect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnGridCellChanging ), NULL, this );
m_aliasGrid->Connect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAliasGridCellChanging ), NULL, this );
m_grid->Connect( wxEVT_GRID_CELL_CHANGING,
wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnGridCellChanging ),
NULL, this );
m_aliasGrid->Connect( wxEVT_GRID_CELL_CHANGING,
wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAliasGridCellChanging ),
NULL, this );
m_grid->GetParent()->Layout();
m_aliasGrid->GetParent()->Layout();
@@ -145,8 +151,12 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::~DIALOG_EDIT_COMPONENT_IN_LIBRARY()
// Prevents crash bug in wxGrid's d'tor
m_grid->DestroyTable( m_fields );
m_grid->Disconnect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnGridCellChanging ), NULL, this );
m_aliasGrid->Disconnect( wxEVT_GRID_CELL_CHANGING, wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAliasGridCellChanging ), NULL, this );
m_grid->Disconnect( wxEVT_GRID_CELL_CHANGING,
wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnGridCellChanging ),
NULL, this );
m_aliasGrid->Disconnect( wxEVT_GRID_CELL_CHANGING,
wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAliasGridCellChanging ),
NULL, this );
// Delete the GRID_TRICKS.
m_grid->PopEventHandler( true );
@@ -213,12 +223,10 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow()
}
if( m_aliasListBox->GetCount() )
{
m_aliasListBox->SetSelection( 0 );
wxCommandEvent dummy;
OnSelectAlias( dummy );
}
wxCommandEvent dummy;
OnSelectAlias( dummy );
adjustAliasGridColumns( m_aliasGrid->GetClientRect().GetWidth() - 4 );
@@ -293,7 +301,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::Validate()
bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow()
{
if( !Validate() )
if( !wxDialog::TransferDataFromWindow() )
return false;
LIB_ALIAS* rootAlias = m_libEntry->GetAlias( m_libEntry->GetName() );
@@ -480,7 +488,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnMoveDown( wxCommandEvent& event )
int i = m_grid->GetGridCursorRow();
if( i >= MANDATORY_FIELDS )
if( i >= MANDATORY_FIELDS && i + 1 < m_fields->GetNumberRows() )
{
LIB_FIELD tmp = m_fields->at( (unsigned) i );
m_fields->erase( m_fields->begin() + i, m_fields->begin() + i + 1 );
@@ -615,21 +623,29 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnSelectAlias( wxCommandEvent& event )
m_aliasGrid->SetCellValue( VALUE, FDC_VALUE, alias->GetName() );
m_aliasGrid->SetCellValue( DATASHEET, FDC_VALUE, alias->GetDocFileName() );
m_aliasGrid->Enable( true );
// Use ChangeValue() so we don't generate events
m_AliasNameCtrl->ChangeValue( alias->GetName() );
m_AliasNameCtrl->Enable( true );
m_AliasDescCtrl->ChangeValue( alias->GetDescription() );
m_AliasDescCtrl->Enable( true );
m_AliasKeywordsCtrl->ChangeValue( alias->GetKeyWords() );
m_AliasKeywordsCtrl->Enable( true );
}
else
{
m_aliasGrid->SetCellValue( VALUE, FDC_VALUE, wxEmptyString );
m_aliasGrid->SetCellValue( DATASHEET, FDC_VALUE, wxEmptyString );
m_aliasGrid->Enable( false );
// Use ChangeValue() so we don't generate events
m_AliasNameCtrl->ChangeValue( wxEmptyString );
m_AliasNameCtrl->Enable( false );
m_AliasDescCtrl->ChangeValue( wxEmptyString );
m_AliasDescCtrl->Enable( false );
m_AliasKeywordsCtrl->ChangeValue( wxEmptyString );
m_AliasKeywordsCtrl->Enable( false );
}
m_currentAlias = newIdx;
@@ -641,6 +657,14 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkAliasName( const wxString& aName )
if( aName.IsEmpty() )
return false;
if( m_SymbolNameCtrl->GetValue().CmpNoCase( aName ) == 0 )
{
wxString msg;
msg.Printf( _( "Alias can not have same name as symbol." ) );
DisplayInfoMessage( this, msg );
return false;
}
for( int i = 0; i < (int)m_aliasListBox->GetCount(); ++i )
{
if( i == m_aliasListBox->GetSelection() )
@@ -664,7 +688,8 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkAliasName( const wxString& aName )
if( existing && existing->GetPart()->GetName() != m_libEntry->GetName() )
{
wxString msg;
msg.Printf( _( "Symbol name \"%s\" already exists in library \"%s\"." ), aName, library );
msg.Printf( _( "Symbol name \"%s\" already exists in library \"%s\"." ),
aName, library );
DisplayErrorMessage( this, msg );
return false;
}
@@ -683,7 +708,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAddAlias( wxCommandEvent& event )
wxString aliasname = _( "untitled" );
int suffix = 1;
while( m_libEntry->HasAlias( aliasname ) )
while( m_aliasListBox->FindString( aliasname ) != wxNOT_FOUND )
aliasname = wxString::Format( _( "untitled%i" ), suffix++ );
LIB_ALIAS* alias = new LIB_ALIAS( aliasname, m_libEntry );
@@ -783,6 +808,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnDeleteFootprintFilter( wxCommandEvent&
}
}
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnEditFootprintFilter( wxCommandEvent& event )
{
int idx = m_FootprintFilterListBox->GetSelection();
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 1 2018)
// C++ code generated with wxFormBuilder (version Mar 20 2019)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -168,7 +168,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
sbSizerSymbol->Add( m_AsConvertButt, 0, wxRIGHT|wxLEFT, 5 );
m_OptionPower = new wxCheckBox( sbSizerSymbol->GetStaticBox(), wxID_ANY, _("Define as power symbol"), wxDefaultPosition, wxDefaultSize, 0 );
m_OptionPower->SetToolTip( _("Check this option when the symbol is a power symbol") );
m_OptionPower->SetToolTip( _("Setting this option makes the symbol in question appear in the\n\"add power port\" dialog. It will lock the value text to protect it\nfrom editing in Eeschema. The symbol will not be included in\nthe BOM and cannot be assigned a footprint.") );
sbSizerSymbol->Add( m_OptionPower, 0, wxALL, 5 );
@@ -14,6 +14,7 @@
<property name="file">dialog_edit_component_in_lib_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_EDIT_COMPONENT_IN_LIBRARY_FBP</property>
@@ -25,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">
@@ -1155,7 +1157,7 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Check this option when the symbol is a power symbol</property>
<property name="tooltip">Setting this option makes the symbol in question appear in the&#x0A;&quot;add power port&quot; dialog. It will lock the value text to protect it&#x0A;from editing in Eeschema. The symbol will not be included in&#x0A;the BOM and cannot be assigned a footprint.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 1 2018)
// C++ code generated with wxFormBuilder (version Mar 20 2019)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -175,7 +175,7 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataToWindow()
if( m_part != nullptr && m_part->HasConversion() )
{
if( m_cmp->GetConvert() > 1 )
if( m_cmp->GetConvert() > LIB_ITEM::LIB_CONVERT::BASE )
m_cbAlternateSymbol->SetValue( true );
}
else
@@ -235,11 +235,43 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnBrowseLibrary( wxCommandEvent& event
m_libraryNameTextCtrl->SetValue( sel.LibId.Format() );
// Update the value field for Power symbols
LIB_PART* entry = GetParent()->GetLibPart( sel.LibId );
if( entry && entry->IsPower() )
m_grid->SetCellValue( VALUE, FDC_VALUE, sel.LibId.GetLibItemName() );
if( entry )
{
// Update the value field for Power symbols
if( entry->IsPower() )
m_grid->SetCellValue( VALUE, FDC_VALUE, sel.LibId.GetLibItemName() );
// Update the units control
int unit = m_unitChoice->GetSelection();
m_unitChoice->Clear();
if( entry->GetUnitCount() > 1 )
{
for( int ii = 1; ii <= entry->GetUnitCount(); ii++ )
m_unitChoice->Append( LIB_PART::SubReference( ii, false ) );
if( unit < 0 || static_cast<unsigned>( unit )>= m_unitChoice->GetCount() )
unit = 0;
m_unitChoice->SetSelection( unit );
m_unitLabel->Enable( true );
m_unitChoice->Enable( true );
}
else
{
m_unitChoice->SetSelection( -1 );
m_unitLabel->Enable( false );
m_unitChoice->Enable( false );
}
// Update the deMorgan conversion controls
bool conversion = m_cbAlternateSymbol->GetValue();
m_cbAlternateSymbol->SetValue( conversion && entry->HasConversion() );
m_cbAlternateSymbol->Enable( entry->HasConversion() );
}
}
@@ -373,17 +405,17 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow()
m_cmp->SetLibId( id, Prj().SchSymbolLibTable(), Prj().SchLibs()->GetCacheLibrary() );
// For symbols with multiple shapes (De Morgan representation) Set the selected shape:
if( m_cbAlternateSymbol->IsEnabled() )
m_cmp->SetConvert( m_cbAlternateSymbol->GetValue() ? 2 : 1 );
if( m_cbAlternateSymbol->IsEnabled() && m_cbAlternateSymbol->GetValue() )
m_cmp->SetConvert( LIB_ITEM::LIB_CONVERT::DEMORGAN );
else
m_cmp->SetConvert( LIB_ITEM::LIB_CONVERT::BASE );
//Set the part selection in multiple part per package
if( m_cmp->GetUnitCount() > 1 )
{
int unit_selection = m_unitChoice->GetCurrentSelection() + 1;
m_cmp->SetUnitSelection( &GetParent()->GetCurrentSheet(), unit_selection );
m_cmp->SetUnit( unit_selection );
}
int unit_selection = m_unitChoice->IsEnabled()
? m_unitChoice->GetSelection() + 1
: 1;
m_cmp->SetUnitSelection( &GetParent()->GetCurrentSheet(), unit_selection );
m_cmp->SetUnit( unit_selection );
switch( m_rbOrientation->GetSelection() )
{
@@ -606,6 +638,9 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::UpdateFieldsFromLibrary( wxCommandEvent
components.push_back( &copy );
InvokeDialogUpdateFields( GetParent(), components, false );
wxGridTableMessage clear( m_fields, wxGRIDTABLE_NOTIFY_ROWS_DELETED, 0, m_fields->size() );
m_grid->ProcessTableMessage( clear );
// Copy fields from the component copy to the dialog buffer
m_fields->clear();
std::set<wxString> defined;
@@ -629,7 +664,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::UpdateFieldsFromLibrary( wxCommandEvent
}
}
m_grid->ForceRefresh();
wxGridTableMessage refresh( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, m_fields->size() );
m_grid->ProcessTableMessage( refresh );
}
+3 -2
View File
@@ -255,9 +255,10 @@ void DIALOG_ERC::OnLeftClickMarkersList( wxHtmlLinkEvent& event )
if( sheetList[i] != m_parent->GetCurrentSheet() )
{
sheetList[i].LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
m_parent->SetCurrentSheet( sheetList[i] );
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
m_parent->DisplayCurrentSheet();
sheetList[i].LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
m_parent->RedrawScreen( m_parent->GetScrollCenterPosition(), false );
}
m_lastMarkerFound = marker;
@@ -95,7 +95,6 @@ protected:
else if (event.GetId() == MYID_SHOW_DATASHEET )
{
wxString datasheet_uri = m_grid->GetCellValue( m_grid->GetGridCursorRow(), DATASHEET );
datasheet_uri = ResolveUriByEnvVars( datasheet_uri );
GetAssociatedDocument( m_dlg, datasheet_uri );
}
else
@@ -591,26 +590,29 @@ public:
{
for( unsigned i = 0; i < m_componentRefs.GetCount(); ++i )
{
SCH_COMPONENT* comp = m_componentRefs[ i ].GetComp();
SCH_COMPONENT& comp = *m_componentRefs[i].GetComp();
m_frame->SetCurrentSheet( m_componentRefs[ i ].GetSheetPath() );
m_frame->SaveCopyInUndoList( comp, UR_CHANGED, true );
m_frame->SetCurrentSheet( m_componentRefs[i].GetSheetPath() );
m_frame->SaveCopyInUndoList( &comp, UR_CHANGED, true );
std::map<wxString, wxString>& fieldStore = m_dataStore[ comp->GetTimeStamp() ];
const std::map<wxString, wxString>& fieldStore = m_dataStore[comp.GetTimeStamp()];
for( std::pair<wxString, wxString> srcData : fieldStore )
for( const std::pair<wxString, wxString> srcData : fieldStore )
{
wxString srcName = srcData.first;
wxString srcValue = srcData.second;
SCH_FIELD* destField = comp->FindField( srcName );
const wxString& srcName = srcData.first;
const wxString& srcValue = srcData.second;
SCH_FIELD* destField = comp.FindField( srcName );
if( !destField && !srcValue.IsEmpty() )
destField = comp->AddField( SCH_FIELD( wxPoint( 0, 0 ), -1, comp, srcName ) );
{
const auto compOrigin = comp.GetPosition();
destField = comp.AddField( SCH_FIELD( compOrigin, -1, &comp, srcName ) );
}
if( destField && !srcValue.IsEmpty() )
destField->SetText( srcValue );
else
comp->RemoveField( srcName );
comp.RemoveField( srcName );
}
}
@@ -547,6 +547,9 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnDeleteRow( wxCommandEvent& event )
if( !m_grid->CommitPendingChanges() )
return;
if( m_pins.size() == 0 ) // empty table
return;
int curRow = m_grid->GetGridCursorRow();
if( curRow < 0 )
+55 -49
View File
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jul 11 2018)
// C++ code generated with wxFormBuilder (version Feb 10 2019)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -12,110 +12,116 @@
DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_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( 400,-1 ), wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer8;
bSizer8 = new wxBoxSizer( wxVERTICAL );
m_htmlPrompt = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
m_htmlPrompt->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
m_htmlPrompt->SetMinSize( wxSize( -1,50 ) );
bSizerMain->Add( m_htmlPrompt, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_htmlPrompt->SetMinSize( wxSize( -1,80 ) );
bSizer8->Add( m_htmlPrompt, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_titleSymbols = new wxStaticText( this, wxID_ANY, _("Symbols to update:"), wxDefaultPosition, wxDefaultSize, 0 );
m_titleSymbols->Wrap( -1 );
m_titleSymbols->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizerMain->Add( m_titleSymbols, 0, wxLEFT|wxRIGHT, 10 );
bSizer8->Add( m_titleSymbols, 0, wxLEFT|wxRIGHT, 10 );
m_ListOfConflicts = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
bSizerMain->Add( m_ListOfConflicts, 3, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
bSizer8->Add( m_ListOfConflicts, 2, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
m_titleInstances = new wxStaticText( this, wxID_ANY, _("Instances of this symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
m_titleInstances->Wrap( -1 );
m_titleInstances->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizerMain->Add( m_titleInstances, 0, wxRIGHT|wxLEFT, 10 );
bSizer8->Add( m_titleInstances, 0, wxRIGHT|wxLEFT, 10 );
m_ListOfInstances = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
bSizerMain->Add( m_ListOfInstances, 2, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
bSizer8->Add( m_ListOfInstances, 2, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
bSizerMain->Add( bSizer8, 2, wxEXPAND, 5 );
wxBoxSizer* bSizerPreviews;
bSizerPreviews = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerLeftPreview;
bSizerLeftPreview = new wxBoxSizer( wxVERTICAL );
m_previewOldLabel = new wxStaticText( this, wxID_ANY, _("Cached Symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
m_previewOldLabel->Wrap( -1 );
m_previewOldLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizerLeftPreview->Add( m_previewOldLabel, 0, 0, 5 );
m_previewOldPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_SizerOldPanel = new wxBoxSizer( wxVERTICAL );
m_previewOldPanel->SetSizer( m_SizerOldPanel );
m_previewOldPanel->Layout();
m_SizerOldPanel->Fit( m_previewOldPanel );
bSizerLeftPreview->Add( m_previewOldPanel, 1, wxEXPAND | wxALL, 5 );
bSizerPreviews->Add( bSizerLeftPreview, 1, wxEXPAND, 5 );
wxBoxSizer* bSizerRightPreview;
bSizerRightPreview = new wxBoxSizer( wxVERTICAL );
m_previewNewLabel = new wxStaticText( this, wxID_ANY, _("Library Symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
m_previewNewLabel->Wrap( -1 );
m_previewNewLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
bSizerRightPreview->Add( m_previewNewLabel, 0, 0, 5 );
m_previewNewPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_SizerNewPanel = new wxBoxSizer( wxVERTICAL );
m_previewNewPanel->SetSizer( m_SizerNewPanel );
m_previewNewPanel->Layout();
m_SizerNewPanel->Fit( m_previewNewPanel );
bSizerRightPreview->Add( m_previewNewPanel, 1, wxEXPAND | wxALL, 5 );
bSizerPreviews->Add( bSizerRightPreview, 1, wxEXPAND, 5 );
bSizerMain->Add( bSizerPreviews, 3, wxEXPAND|wxRIGHT|wxLEFT, 10 );
bSizerMain->Add( bSizerPreviews, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );
wxBoxSizer* bSizer5;
bSizer5 = new wxBoxSizer( wxHORIZONTAL );
m_btnNeverShowAgain = new wxButton( this, wxID_ANY, _("Never Show Again"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer5->Add( m_btnNeverShowAgain, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 );
bSizer5->Add( 0, 0, 1, wxEXPAND, 5 );
m_stdButtons = new wxStdDialogButtonSizer();
m_stdButtonsOK = new wxButton( this, wxID_OK );
m_stdButtons->AddButton( m_stdButtonsOK );
m_stdButtonsCancel = new wxButton( this, wxID_CANCEL );
m_stdButtons->AddButton( m_stdButtonsCancel );
m_stdButtons->Realize();
bSizer5->Add( m_stdButtons, 0, wxALL|wxEXPAND, 5 );
bSizerMain->Add( bSizer5, 0, wxEXPAND, 5 );
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
this->Centre( wxBOTH );
// Connect Events
this->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_RESCUE_EACH_BASE::OnDialogResize ) );
m_ListOfConflicts->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_RESCUE_EACH_BASE::OnConflictSelect ), NULL, this );
@@ -130,5 +136,5 @@ DIALOG_RESCUE_EACH_BASE::~DIALOG_RESCUE_EACH_BASE()
m_ListOfConflicts->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_RESCUE_EACH_BASE::OnConflictSelect ), NULL, this );
m_btnNeverShowAgain->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_RESCUE_EACH_BASE::OnNeverShowClick ), NULL, this );
m_stdButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_RESCUE_EACH_BASE::OnCancelClick ), NULL, this );
}
+244 -624
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="14" />
<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_rescue_each_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_rescue_each_base</property>
@@ -25,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">
@@ -53,55 +55,7 @@
<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="OnAuiPaneActivated"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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="OnMaximize"></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="OnMove"></event>
<event name="OnMoveEnd"></event>
<event name="OnMoveStart"></event>
<event name="OnMoving"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnShow"></event>
<event name="OnSize">OnDialogResize</event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerMain</property>
@@ -109,431 +63,254 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxHtmlWindow" 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">wxSYS_COLOUR_BTNFACE</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">-1,80</property>
<property name="moveable">1</property>
<property name="name">m_htmlPrompt</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">wxHW_SCROLLBAR_AUTO</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>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHtmlCellClicked"></event>
<event name="OnHtmlCellHover"></event>
<event name="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">10</property>
<property name="flag">wxLEFT|wxRIGHT</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">Symbols to update:</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_titleSymbols</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>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">3</property>
<object class="wxDataViewListCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</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">m_ListOfConflicts</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnDataViewListCtrlColumnHeaderClick"></event>
<event name="OnDataViewListCtrlColumnHeaderRightClick"></event>
<event name="OnDataViewListCtrlColumnReordered"></event>
<event name="OnDataViewListCtrlColumnSorted"></event>
<event name="OnDataViewListCtrlItemActivated"></event>
<event name="OnDataViewListCtrlItemBeginDrag"></event>
<event name="OnDataViewListCtrlItemCollapsed"></event>
<event name="OnDataViewListCtrlItemCollapsing"></event>
<event name="OnDataViewListCtrlItemContextMenu"></event>
<event name="OnDataViewListCtrlItemDrop"></event>
<event name="OnDataViewListCtrlItemDropPossible"></event>
<event name="OnDataViewListCtrlItemEditingDone"></event>
<event name="OnDataViewListCtrlItemEditingStarted"></event>
<event name="OnDataViewListCtrlItemExpanded"></event>
<event name="OnDataViewListCtrlItemExpanding"></event>
<event name="OnDataViewListCtrlItemStartEditing"></event>
<event name="OnDataViewListCtrlItemValueChanged"></event>
<event name="OnDataViewListCtrlSelectionChanged">OnConflictSelect</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">
<property name="border">10</property>
<property name="flag">wxRIGHT|wxLEFT</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">Instances of this symbol:</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_titleInstances</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>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">2</property>
<object class="wxDataViewListCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</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>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_ListOfInstances</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnDataViewListCtrlColumnHeaderClick"></event>
<event name="OnDataViewListCtrlColumnHeaderRightClick"></event>
<event name="OnDataViewListCtrlColumnReordered"></event>
<event name="OnDataViewListCtrlColumnSorted"></event>
<event name="OnDataViewListCtrlItemActivated"></event>
<event name="OnDataViewListCtrlItemBeginDrag"></event>
<event name="OnDataViewListCtrlItemCollapsed"></event>
<event name="OnDataViewListCtrlItemCollapsing"></event>
<event name="OnDataViewListCtrlItemContextMenu"></event>
<event name="OnDataViewListCtrlItemDrop"></event>
<event name="OnDataViewListCtrlItemDropPossible"></event>
<event name="OnDataViewListCtrlItemEditingDone"></event>
<event name="OnDataViewListCtrlItemEditingStarted"></event>
<event name="OnDataViewListCtrlItemExpanded"></event>
<event name="OnDataViewListCtrlItemExpanding"></event>
<event name="OnDataViewListCtrlItemStartEditing"></event>
<event name="OnDataViewListCtrlItemValueChanged"></event>
<event name="OnDataViewListCtrlSelectionChanged"></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>
<property name="name">bSizer8</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|wxTOP|wxBOTTOM</property>
<property name="proportion">1</property>
<object class="wxHtmlWindow" 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">wxSYS_COLOUR_BTNFACE</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">-1,80</property>
<property name="moveable">1</property>
<property name="name">m_htmlPrompt</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">wxHW_SCROLLBAR_AUTO</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>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxLEFT|wxRIGHT</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">Symbols to update:</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_titleSymbols</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">10</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">2</property>
<object class="wxDataViewListCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</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">m_ListOfConflicts</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnDataViewListCtrlSelectionChanged">OnConflictSelect</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxRIGHT|wxLEFT</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">Instances of this symbol:</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_titleInstances</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">10</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">2</property>
<object class="wxDataViewListCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</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">m_ListOfInstances</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">3</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerPreviews</property>
@@ -607,36 +384,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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">
@@ -694,36 +441,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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 class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_SizerOldPanel</property>
@@ -802,36 +519,6 @@
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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">
@@ -889,36 +576,6 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></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 class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">m_SizerNewPanel</property>
@@ -1010,37 +667,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnButtonClick">OnNeverShowClick</event>
<event name="OnChar"></event>
<event name="OnCharHook"></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">
@@ -1069,14 +696,7 @@
<property name="minimum_size"></property>
<property name="name">m_stdButtons</property>
<property name="permission">protected</property>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick">OnCancelClick</event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick"></event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>
</object>
</object>
+9 -11
View File
@@ -1,12 +1,11 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jul 11 2018)
// C++ code generated with wxFormBuilder (version Feb 10 2019)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_RESCUE_EACH_BASE_H__
#define __DIALOG_RESCUE_EACH_BASE_H__
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
@@ -37,7 +36,7 @@
class DIALOG_RESCUE_EACH_BASE : public DIALOG_SHIM
{
private:
protected:
wxHtmlWindow* m_htmlPrompt;
wxStaticText* m_titleSymbols;
@@ -54,19 +53,18 @@ class DIALOG_RESCUE_EACH_BASE : public DIALOG_SHIM
wxStdDialogButtonSizer* m_stdButtons;
wxButton* m_stdButtonsOK;
wxButton* m_stdButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnDialogResize( wxSizeEvent& event ) { event.Skip(); }
virtual void OnConflictSelect( wxDataViewEvent& event ) { event.Skip(); }
virtual void OnNeverShowClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Project Rescue Helper"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Project Rescue Helper"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_RESCUE_EACH_BASE();
};
#endif //__DIALOG_RESCUE_EACH_BASE_H__
+12
View File
@@ -63,6 +63,15 @@ DIALOG_SIM_SETTINGS::DIALOG_SIM_SETTINGS( wxWindow* aParent )
m_transFinal->SetValidator( m_spiceValidator );
m_transInitial->SetValidator( m_spiceEmptyValidator );
// Hide pages that aren't fully implemented yet
// wxPanel::Hide() isn't enough on some platforms
m_simPages->RemovePage( m_simPages->FindPage( m_pgDistortion ) );
m_simPages->RemovePage( m_simPages->FindPage( m_pgNoise ) );
m_simPages->RemovePage( m_simPages->FindPage( m_pgOP ) );
m_simPages->RemovePage( m_simPages->FindPage( m_pgPoleZero ) );
m_simPages->RemovePage( m_simPages->FindPage( m_pgSensitivity ) );
m_simPages->RemovePage( m_simPages->FindPage( m_pgTransferFunction ) );
m_sdbSizerOK->SetDefault();
updateNetlistOpts();
@@ -158,6 +167,9 @@ bool DIALOG_SIM_SETTINGS::TransferDataFromWindow()
{
wxString dcSource = m_exporter->GetSpiceDevice( m_dcSource2->GetValue() );
if( m_dcEnable1->IsChecked() )
simCmd += " ";
simCmd += wxString::Format( "%s %s %s %s",
dcSource,
SPICE_VALUE( m_dcStart2->GetValue() ).ToSpiceString(),
+2 -2
View File
@@ -290,10 +290,10 @@ void IncrementLabelMember( wxString& name, int aIncrement )
ii = name.Len() - 1; nn = 0;
if( !isdigit( name.GetChar( ii ) ) )
if( !wxIsdigit( name.GetChar( ii ) ) )
return;
while( (ii >= 0) && isdigit( name.GetChar( ii ) ) )
while( (ii >= 0) && wxIsdigit( name.GetChar( ii ) ) )
{
ii--; nn++;
}
+1 -1
View File
@@ -258,7 +258,7 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
// Must be called before creating the main frame in order to
// display the real hotkeys in menus or tool tips
ReadHotkeyConfig( SCH_EDIT_FRAME_NAME, g_Eeschema_Hokeys_Descr );
ReadHotkeyConfig( SCH_EDIT_FRAME_NAME, g_Eeschema_Hotkeys_Descr );
wxConfigLoadSetups( KifaceSettings(), cfg_params() );
+19 -21
View File
@@ -133,7 +133,7 @@ void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
{
case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST:
// Display current hotkey list for LibEdit.
DisplayHotkeyList( this, g_Libedit_Hokeys_Descr );
DisplayHotkeyList( this, g_Libedit_Hotkeys_Descr );
break;
default:
@@ -158,9 +158,8 @@ void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event )
fn = g_RootSheet->GetScreen()->GetFileName();
fn.SetExt( ProjectFileExtension );
wxFileDialog dlg( this, _( "Load Project File" ), fn.GetPath(),
fn.GetFullName(), ProjectFileWildcard(),
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
wxFileDialog dlg( this, _( "Load Project File" ), fn.GetPath(), fn.GetFullName(),
ProjectFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
if( dlg.ShowModal() == wxID_CANCEL )
break;
@@ -173,17 +172,17 @@ void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event )
{
// Read library list and library path list
Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH,
GetProjectFileParametersList() );
GetProjectFileParameters() );
// Read schematic editor setup
Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDITOR,
GetProjectFileParametersList() );
Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDIT,
GetProjectFileParameters() );
}
}
break;
case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST:
// Display current hotkey list for eeschema.
DisplayHotkeyList( this, g_Schematic_Hokeys_Descr );
DisplayHotkeyList( this, g_Schematic_Hotkeys_Descr );
break;
default:
@@ -194,7 +193,7 @@ void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event )
void SCH_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
{
if( ShowPreferences( g_Eeschema_Hokeys_Descr, g_Schematic_Hokeys_Descr, wxT( "eeschema" ) ) )
if( ShowPreferences( g_Eeschema_Hotkeys_Descr, g_Schematic_Hotkeys_Descr, wxT( "eeschema" ) ) )
{
SaveSettings( config() ); // save values shared by eeschema applications.
m_canvas->Refresh( true );
@@ -213,7 +212,7 @@ void SCH_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent )
}
PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParametersList()
PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters()
{
if( !m_projectFileParams.empty() )
@@ -259,12 +258,10 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParametersList()
bool SCH_EDIT_FRAME::LoadProjectFile()
{
// Read library list and library path list
bool isRead = Prj().ConfigLoad( Kiface().KifaceSearch(),
GROUP_SCH, GetProjectFileParametersList() );
bool ret = Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParameters() );
// Read schematic editor setup
isRead = isRead && Prj().ConfigLoad( Kiface().KifaceSearch(),
GROUP_SCH_EDITOR, GetProjectFileParametersList() );
ret &= Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters() );
// Verify some values, because the config file can be edited by hand,
// and have bad values:
@@ -282,7 +279,7 @@ bool SCH_EDIT_FRAME::LoadProjectFile()
pglayout.SetPageLayout( pg_fullfilename );
return isRead;
return ret;
}
@@ -298,8 +295,7 @@ void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
if( aAskForSave )
{
wxFileDialog dlg( this, _( "Save Project File" ),
fn.GetPath(), fn.GetFullName(),
wxFileDialog dlg( this, _( "Save Project File" ), fn.GetPath(), fn.GetFullName(),
ProjectFileWildcard(), wxFD_SAVE );
if( dlg.ShowModal() == wxID_CANCEL )
@@ -308,7 +304,9 @@ void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
fn = dlg.GetPath();
}
prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDITOR, GetProjectFileParametersList() );
wxString path = fn.GetFullPath();
prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters(), path );
}
///@{
@@ -390,7 +388,7 @@ void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
long tmp;
ReadHotkeyConfig( SCH_EDIT_FRAME_NAME, g_Schematic_Hokeys_Descr );
ReadHotkeyConfig( SCH_EDIT_FRAME_NAME, g_Schematic_Hotkeys_Descr );
wxConfigLoadSetups( aCfg, GetConfigurationSettings() );
SetDefaultBusThickness( (int) aCfg->Read( DefaultBusWidthEntry, DEFAULTBUSTHICKNESS ) );
@@ -519,7 +517,7 @@ void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
{
EDA_DRAW_FRAME::LoadSettings( aCfg );
ReadHotkeyConfig( LIB_EDIT_FRAME_NAME, g_Libedit_Hokeys_Descr );
ReadHotkeyConfig( LIB_EDIT_FRAME_NAME, g_Libedit_Hotkeys_Descr );
SetDefaultLineThickness( (int) aCfg->Read( DefaultDrawLineWidthEntry, DEFAULTDRAWLINETHICKNESS ) );
SetDefaultPinLength( (int) aCfg->Read( DefaultPinLengthEntry, DEFAULTPINLENGTH ) );
@@ -581,7 +579,7 @@ void LIB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
void LIB_EDIT_FRAME::OnPreferencesOptions( wxCommandEvent& event )
{
if( ShowPreferences( g_Eeschema_Hokeys_Descr, g_Libedit_Hokeys_Descr, wxT( "eeschema" ) ) )
if( ShowPreferences( g_Eeschema_Hotkeys_Descr, g_Libedit_Hotkeys_Descr, wxT( "eeschema" ) ) )
{
SaveSettings( config() ); // save values shared by eeschema applications.
m_canvas->Refresh( true );
-1
View File
@@ -522,7 +522,6 @@ void FIELDS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
else if (event.GetId() == MYID_SHOW_DATASHEET )
{
wxString datasheet_uri = m_grid->GetCellValue( DATASHEET, FDC_VALUE );
datasheet_uri = ResolveUriByEnvVars( datasheet_uri );
GetAssociatedDocument( m_dlg, datasheet_uri );
}
else
+8 -3
View File
@@ -135,7 +135,7 @@ bool SCH_EDIT_FRAME::SaveEEFile( SCH_SCREEN* aScreen, bool aSaveUnderNewName,
{
// Delete auto save file.
wxFileName autoSaveFileName = schematicFileName;
autoSaveFileName.SetName( AUTOSAVE_PREFIX_FILENAME + schematicFileName.GetName() );
autoSaveFileName.SetName( GetAutoSaveFilePrefix() + schematicFileName.GetName() );
if( autoSaveFileName.FileExists() )
{
@@ -289,6 +289,9 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
g_RootSheet = NULL; // Force CreateScreens() to build new empty project on load failure.
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_LEGACY ) );
// This will rename the file if there is an autosave and the user want to recover
CheckForAutoSaveFile( fullFileName );
try
{
g_RootSheet = pi->Load( fullFileName, &Kiway() );
@@ -375,6 +378,8 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
SyncView();
GetScreen()->ClearDrawingState();
UpdateTitle();
return true;
}
@@ -743,8 +748,8 @@ bool SCH_EDIT_FRAME::doAutoSave()
tmpFileName = fn = screen->GetFileName();
// Auto save file name is the normal file name prefixed with AUTOSAVE_PREFIX_FILENAME.
fn.SetName( AUTOSAVE_PREFIX_FILENAME + fn.GetName() );
// Auto save file name is the normal file name prefixed with GetAutoSavePrefix().
fn.SetName( GetAutoSaveFilePrefix() + fn.GetName() );
screen->SetFileName( fn.GetFullPath() );
+4 -4
View File
@@ -372,14 +372,14 @@ void SCH_EDIT_FRAME::ConvertPart( SCH_COMPONENT* aComponent )
aComponent->SetConvert( aComponent->GetConvert() + 1 );
// ensure m_Convert = 0, 1 or 2
// 0 and 1 = shape 1 = not converted
// ensure m_Convert = 1 or 2
// 1 = shape 1 = not converted
// 2 = shape 2 = first converted shape
// > 2 is not used but could be used for more shapes
// like multiple shapes for a programmable component
// When m_Convert = val max, return to the first shape
if( aComponent->GetConvert() > 2 )
aComponent->SetConvert( 1 );
if( aComponent->GetConvert() > LIB_ITEM::LIB_CONVERT::DEMORGAN )
aComponent->SetConvert( LIB_ITEM::LIB_CONVERT::BASE );
// The alternate symbol may cause a change in the connection status so test the
// connections so the connection indicators are drawn correctly.
+3 -1
View File
@@ -3,7 +3,7 @@
*
* Copyright (C) 2004 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2017 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-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
@@ -301,5 +301,7 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
// Some items (wires, labels) can be highlighted. So prepare the highlight flag:
SetCurrentSheetHighlightFlags( nullptr );
UpdateTitle();
GetCanvas()->Refresh();
}
+19 -7
View File
@@ -116,6 +116,7 @@ static EDA_HOTKEY HkZoomOut( _HKI( "Zoom Out" ), HK_ZOOM_OUT, GR_KB_CTRL + '-',
#endif
static EDA_HOTKEY HkHelp( _HKI( "List Hotkeys" ), HK_HELP, GR_KB_CTRL + WXK_F1 );
static EDA_HOTKEY HkPreferences( _HKI( "Preferences" ), HK_PREFERENCES, GR_KB_CTRL + ',', (int) wxID_PREFERENCES );
static EDA_HOTKEY HkResetLocalCoord( _HKI( "Reset Local Coordinates" ), HK_RESET_LOCAL_COORD, ' ' );
static EDA_HOTKEY HkLeaveSheet( _HKI( "Leave Sheet" ), HK_LEAVE_SHEET, GR_KB_ALT + WXK_BACK,
ID_POPUP_SCH_LEAVE_SHEET );
@@ -262,6 +263,7 @@ static EDA_HOTKEY* common_Hotkey_List[] =
&HkUndo, &HkRedo,
&HkEditCut, &HkEditCopy, &HkEditPaste,
&HkHelp,
&HkPreferences,
&HkZoomIn,
&HkZoomOut,
&HkZoomRedraw,
@@ -367,7 +369,7 @@ static wxString libEditSectionTitle( _HKI( "Library Editor" ) );
// list of sections and corresponding hotkey list for Eeschema (used to create
// an hotkey config file)
struct EDA_HOTKEY_CONFIG g_Eeschema_Hokeys_Descr[] =
struct EDA_HOTKEY_CONFIG g_Eeschema_Hotkeys_Descr[] =
{
{ &g_CommonSectionTag, common_Hotkey_List, &commonSectionTitle },
{ &schematicSectionTag, schematic_Hotkey_List, &schematicSectionTitle },
@@ -377,7 +379,7 @@ struct EDA_HOTKEY_CONFIG g_Eeschema_Hokeys_Descr[] =
// list of sections and corresponding hotkey list for the schematic editor
// (used to list current hotkeys)
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[] =
struct EDA_HOTKEY_CONFIG g_Schematic_Hotkeys_Descr[] =
{
{ &g_CommonSectionTag, common_Hotkey_List, &commonSectionTitle },
{ &schematicSectionTag, schematic_Hotkey_List, &schematicSectionTitle },
@@ -386,7 +388,7 @@ struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[] =
// list of sections and corresponding hotkey list for the component editor
// (used to list current hotkeys)
struct EDA_HOTKEY_CONFIG g_Libedit_Hokeys_Descr[] =
struct EDA_HOTKEY_CONFIG g_Libedit_Hotkeys_Descr[] =
{
{ &g_CommonSectionTag, common_Hotkey_List, &commonSectionTitle },
{ &libEditSectionTag, libEdit_Hotkey_List, &libEditSectionTitle },
@@ -395,7 +397,7 @@ struct EDA_HOTKEY_CONFIG g_Libedit_Hokeys_Descr[] =
// list of sections and corresponding hotkey list for the component browser
// (used to list current hotkeys)
struct EDA_HOTKEY_CONFIG g_Viewlib_Hokeys_Descr[] =
struct EDA_HOTKEY_CONFIG g_Viewlib_Hotkeys_Descr[] =
{
{ &g_CommonSectionTag, common_basic_Hotkey_List, &commonSectionTitle },
{ NULL, NULL, NULL }
@@ -459,7 +461,12 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
return false;
case HK_HELP: // Display Current hotkey list
DisplayHotkeyList( this, g_Schematic_Hokeys_Descr );
DisplayHotkeyList( this, g_Schematic_Hotkeys_Descr );
break;
case HK_PREFERENCES:
cmd.SetId( wxID_PREFERENCES );
GetEventHandler()->ProcessEvent( cmd );
break;
case HK_RESET_LOCAL_COORD: // Reset the relative coord
@@ -707,7 +714,12 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
return false;
case HK_HELP: // Display Current hotkey list
DisplayHotkeyList( this, g_Libedit_Hokeys_Descr );
DisplayHotkeyList( this, g_Libedit_Hotkeys_Descr );
break;
case HK_PREFERENCES:
cmd.SetId( wxID_PREFERENCES );
GetEventHandler()->ProcessEvent( cmd );
break;
case HK_RESET_LOCAL_COORD: // Reset the relative coord
@@ -925,7 +937,7 @@ bool LIB_VIEW_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
return false;
case HK_HELP: // Display Current hotkey list
DisplayHotkeyList( this, g_Viewlib_Hokeys_Descr );
DisplayHotkeyList( this, g_Viewlib_Hotkeys_Descr );
break;
case HK_RESET_LOCAL_COORD: // set local (relative) coordinate origin
+4 -4
View File
@@ -85,15 +85,15 @@ enum hotkey_id_commnand {
};
// List of hotkey descriptors for Eeschema
extern struct EDA_HOTKEY_CONFIG g_Eeschema_Hokeys_Descr[];
extern struct EDA_HOTKEY_CONFIG g_Eeschema_Hotkeys_Descr[];
// List of hotkey descriptors for the schematic editor only
extern struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[];
extern struct EDA_HOTKEY_CONFIG g_Schematic_Hotkeys_Descr[];
// List of hotkey descriptors for the lib editor only
extern struct EDA_HOTKEY_CONFIG g_Libedit_Hokeys_Descr[];
extern struct EDA_HOTKEY_CONFIG g_Libedit_Hotkeys_Descr[];
// List of hotkey descriptors for the lib browser only
extern struct EDA_HOTKEY_CONFIG g_Viewlib_Hokeys_Descr[];
extern struct EDA_HOTKEY_CONFIG g_Viewlib_Hotkeys_Descr[];
#endif // EESCHEMA_KOTKEYS_H_
+8 -2
View File
@@ -302,8 +302,14 @@ void LIB_ARC::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
}
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
aPlotter->Arc( pos, -t2, -t1, m_Radius, already_filled ? NO_FILL : m_Fill, GetPenSize() );
auto pen_size = GetPenSize();
if( !already_filled || pen_size > 0 )
{
pen_size = std::max( 0, pen_size );
aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
aPlotter->Arc( pos, -t2, -t1, m_Radius, already_filled ? NO_FILL : m_Fill, GetPenSize() );
}
}
+8 -2
View File
@@ -205,8 +205,14 @@ void LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
}
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, GetPenSize() );
auto pen_size = GetPenSize();
if( !already_filled || pen_size > 0 )
{
pen_size = std::max( 0, pen_size );
aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, GetPenSize() );
}
}
+8 -2
View File
@@ -157,8 +157,14 @@ void LIB_CIRCLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
}
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
aPlotter->Circle( pos, m_Radius * 2, already_filled ? NO_FILL : m_Fill, GetPenSize() );
auto pen_size = GetPenSize();
if( !already_filled || pen_size > 0 )
{
pen_size = std::max( 0, pen_size );
aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
aPlotter->Circle( pos, m_Radius * 2, already_filled ? NO_FILL : m_Fill, GetPenSize() );
}
}
+2 -4
View File
@@ -68,11 +68,9 @@ void LIB_ITEM::GetMsgPanelInfo( EDA_UNITS_T aUnits, MSG_PANEL_ITEMS& aList )
aList.push_back( MSG_PANEL_ITEM( _( "Unit" ), msg, BROWN ) );
if( m_Convert == 0 )
msg = _( "All" );
else if( m_Convert == 1 )
if( m_Convert == LIB_ITEM::LIB_CONVERT::BASE )
msg = _( "no" );
else if( m_Convert == 2 )
else if( m_Convert == LIB_ITEM::LIB_CONVERT::DEMORGAN )
msg = _( "yes" );
else
msg = wxT( "?" );
+4 -1
View File
@@ -92,7 +92,6 @@ class LIB_ITEM : public EDA_ITEM
* @param aColor Draw color
*/
virtual void drawEditGraphics( EDA_RECT* aClipBox, wxDC* aDC, COLOR4D aColor ) {}
friend class LIB_PART;
@@ -134,6 +133,10 @@ public:
virtual ~LIB_ITEM() { }
// Define the enums for basic
enum LIB_CONVERT : int { BASE = 1, DEMORGAN = 2 };
/**
* Provide a user-consumable name of the object type. Perform localization when
* called so that run-time language selection works.
+8 -2
View File
@@ -163,8 +163,14 @@ void LIB_POLYLINE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
}
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, GetPenSize() );
auto pen_size = GetPenSize();
if( !already_filled || pen_size > 0 )
{
pen_size = std::max( 0, pen_size );
aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
aPlotter->PlotPoly( cornerList, already_filled ? NO_FILL : m_Fill, GetPenSize() );
}
}
+8 -2
View File
@@ -147,8 +147,14 @@ void LIB_RECTANGLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
}
bool already_filled = m_Fill == FILLED_WITH_BG_BODYCOLOR;
aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
aPlotter->Rect( pos, end, already_filled ? NO_FILL : m_Fill, GetPenSize() );
auto pen_size = GetPenSize();
if( !already_filled || pen_size > 0 )
{
pen_size = std::max( 0, pen_size );
aPlotter->SetColor( GetLayerColor( LAYER_DEVICE ) );
aPlotter->Rect( pos, end, already_filled ? NO_FILL : m_Fill, GetPenSize() );
}
}
+1 -3
View File
@@ -205,7 +205,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
SetShowDeMorgan( false );
m_drawSpecificConvert = true;
m_drawSpecificUnit = false;
m_hotkeysDescrList = g_Libedit_Hokeys_Descr;
m_hotkeysDescrList = g_Libedit_Hotkeys_Descr;
m_syncPinEdit = false;
m_repeatPinStep = DEFAULT_REPEAT_OFFSET_PIN;
SetShowElectricalType( true );
@@ -617,8 +617,6 @@ void LIB_EDIT_FRAME::OnViewEntryDoc( wxCommandEvent& event )
else
filename = part->GetAlias( 0 )->GetDocFileName();
filename = ResolveUriByEnvVars( filename );
if( !filename.IsEmpty() && filename != wxT( "~" ) )
{
SEARCH_STACK* lib_search = Prj().SchSearchS();
+12 -9
View File
@@ -645,14 +645,15 @@ bool LIB_MANAGER::addLibrary( const wxString& aFilePath, bool aCreate, SYMBOL_LI
if( aCreate )
{
// CreateSymbolLib() fails if the file exists
if( wxFileName::Exists( aFilePath ) )
try
{
if( !wxRemoveFile( aFilePath ) )
return false;
aTable->CreateSymbolLib( libName );
}
catch( const IO_ERROR& e )
{
aTable->RemoveRow( libRow );
return false;
}
aTable->CreateSymbolLib( libName );
}
m_frame.SyncLibraries( false );
@@ -682,10 +683,12 @@ std::set<LIB_PART*> LIB_MANAGER::getOriginalParts( const wxString& aLibrary )
LIB_ALIAS* alias = symTable()->LoadSymbol( aLibrary, aliasName );
parts.insert( alias->GetPart() );
}
} catch( const IO_ERROR& e )
}
catch( const IO_ERROR& e )
{
DisplayErrorMessage( &m_frame, wxString::Format( _( "Cannot enumerate "
"library \"%s\"" ), aLibrary ), e.What() );
DisplayErrorMessage( &m_frame, wxString::Format( _( "Cannot enumerate library \"%s\"" ),
aLibrary ),
e.What() );
}
return parts;
+34 -34
View File
@@ -102,7 +102,7 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
if( GetToolId() == ID_NO_TOOL_SELECTED )
{
msg = AddHotkeyName( _( "&Paste" ), g_Libedit_Hokeys_Descr, HK_EDIT_PASTE );
msg = AddHotkeyName( _( "&Paste" ), g_Libedit_Hotkeys_Descr, HK_EDIT_PASTE );
AddMenuItem( PopMenu, ID_POPUP_PASTE_BLOCK, msg, _( "Pastes copied item(s)" ),
KiBitmap( paste_xpm ) );
PopMenu->AppendSeparator();
@@ -123,20 +123,20 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
case LIB_ARC_T:
if( not_edited )
{
msg = AddHotkeyName( _( "Move" ), g_Libedit_Hokeys_Descr,
msg = AddHotkeyName( _( "Move" ), g_Libedit_Hotkeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg,
KiBitmap( move_xpm ) );
msg = AddHotkeyName( _( "Drag Arc Edge" ), g_Libedit_Hokeys_Descr, HK_DRAG );
msg = AddHotkeyName( _( "Drag Arc Edge" ), g_Libedit_Hotkeys_Descr, HK_DRAG );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, KiBitmap( move_xpm ) );
}
msg = AddHotkeyName( _( "Edit Arc Options" ), g_Libedit_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit Arc Options" ), g_Libedit_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, KiBitmap( options_arc_xpm ) );
if( not_edited )
{
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, KiBitmap( delete_xpm ) );
}
break;
@@ -144,22 +144,22 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
case LIB_CIRCLE_T:
if( not_edited )
{
msg = AddHotkeyName( _( "Move" ), g_Libedit_Hokeys_Descr,
msg = AddHotkeyName( _( "Move" ), g_Libedit_Hotkeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg,
KiBitmap( move_xpm ) );
msg = AddHotkeyName( _( "Drag Circle Outline" ), g_Libedit_Hokeys_Descr, HK_DRAG );
msg = AddHotkeyName( _( "Drag Circle Outline" ), g_Libedit_Hotkeys_Descr, HK_DRAG );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg,
KiBitmap( move_rectangle_xpm ) );
}
msg = AddHotkeyName( _( "Edit Circle Options..." ), g_Libedit_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit Circle Options..." ), g_Libedit_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg,
KiBitmap( options_circle_xpm ) );
if( not_edited )
{
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg,
KiBitmap( delete_circle_xpm ) );
}
@@ -168,22 +168,22 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
case LIB_RECTANGLE_T:
if( not_edited )
{
msg = AddHotkeyName( _( "Move Rectangle" ), g_Libedit_Hokeys_Descr,
msg = AddHotkeyName( _( "Move Rectangle" ), g_Libedit_Hotkeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg,
KiBitmap( move_rectangle_xpm ) );
}
msg = AddHotkeyName( _( "Edit Rectangle Options..." ), g_Libedit_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit Rectangle Options..." ), g_Libedit_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg,
KiBitmap( options_rectangle_xpm ) );
if( not_edited )
{
msg = AddHotkeyName( _( "Drag Rectangle Edge" ), g_Libedit_Hokeys_Descr, HK_DRAG );
msg = AddHotkeyName( _( "Drag Rectangle Edge" ), g_Libedit_Hotkeys_Descr, HK_DRAG );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg,
KiBitmap( move_rectangle_xpm ) );
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg,
KiBitmap( delete_rectangle_xpm ) );
}
@@ -193,21 +193,21 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
case LIB_TEXT_T:
if( not_edited )
{
msg = AddHotkeyName( _( "Move" ), g_Libedit_Hokeys_Descr,
msg = AddHotkeyName( _( "Move" ), g_Libedit_Hotkeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg,
KiBitmap( move_xpm ) );
}
msg = AddHotkeyName( _( "Edit..." ), g_Libedit_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit..." ), g_Libedit_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Libedit_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Libedit_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( PopMenu, ID_LIBEDIT_ROTATE_ITEM, msg, KiBitmap( rotate_cw_xpm ) );
if( not_edited )
{
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, KiBitmap( delete_xpm ) );
}
break;
@@ -215,11 +215,11 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
case LIB_POLYLINE_T:
if( not_edited )
{
msg = AddHotkeyName( _( "Move" ), g_Libedit_Hokeys_Descr,
msg = AddHotkeyName( _( "Move" ), g_Libedit_Hotkeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg,
KiBitmap( move_xpm ) );
msg = AddHotkeyName( _( "Drag Edge Point" ), g_Libedit_Hokeys_Descr, HK_DRAG );
msg = AddHotkeyName( _( "Drag Edge Point" ), g_Libedit_Hotkeys_Descr, HK_DRAG );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MODIFY_ITEM, msg, KiBitmap( move_exactly_xpm ) );
}
@@ -229,13 +229,13 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
KiBitmap( checked_ok_xpm ) );
}
msg = AddHotkeyName( _( "Edit Line Options..." ), g_Libedit_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit Line Options..." ), g_Libedit_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_BODY_EDIT_ITEM, msg,
KiBitmap( options_segment_xpm ) );
if( not_edited )
{
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg,
KiBitmap( delete_xpm ) );
}
@@ -244,7 +244,7 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
if( ( (LIB_POLYLINE*) item )->GetCornerCount() > 2 )
{
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT,
msg, KiBitmap( delete_xpm ) );
}
@@ -255,15 +255,15 @@ bool LIB_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
case LIB_FIELD_T:
if( not_edited )
{
msg = AddHotkeyName( _( "Move" ), g_Libedit_Hokeys_Descr,
msg = AddHotkeyName( _( "Move" ), g_Libedit_Hotkeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg,
KiBitmap( move_xpm ) );
}
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Libedit_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Libedit_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( PopMenu, ID_LIBEDIT_ROTATE_ITEM, msg, KiBitmap( rotate_cw_xpm ) );
msg = AddHotkeyName( _( "Edit..." ), g_Libedit_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit..." ), g_Libedit_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_FIELD_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );
break;
@@ -287,20 +287,20 @@ void AddMenusForPin( wxMenu* PopMenu, LIB_PIN* Pin, LIB_EDIT_FRAME* frame )
if( not_in_move )
{
msg = AddHotkeyName( _( "Move" ), g_Libedit_Hokeys_Descr,
msg = AddHotkeyName( _( "Move" ), g_Libedit_Hotkeys_Descr,
HK_LIBEDIT_MOVE_GRAPHIC_ITEM );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_MOVE_ITEM_REQUEST, msg, KiBitmap( move_xpm ) );
}
msg = AddHotkeyName( _( "Edit..." ), g_Libedit_Hokeys_Descr, HK_EDIT);
msg = AddHotkeyName( _( "Edit..." ), g_Libedit_Hotkeys_Descr, HK_EDIT);
AddMenuItem( PopMenu, ID_LIBEDIT_EDIT_PIN, msg, KiBitmap( edit_xpm ) );
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Libedit_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Libedit_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( PopMenu, ID_LIBEDIT_ROTATE_ITEM, msg, KiBitmap( rotate_cw_xpm ) );
if( not_in_move )
{
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Libedit_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_LIBEDIT_DELETE_ITEM, msg, KiBitmap( delete_xpm ) );
}
@@ -345,25 +345,25 @@ void AddMenusForBlock( wxMenu* PopMenu, LIB_EDIT_FRAME* frame )
AddMenuItem( PopMenu, ID_POPUP_SELECT_ITEMS_BLOCK, _( "Select Items" ),
KiBitmap( green_xpm ) );
msg = AddHotkeyName( _( "Cut Block" ), g_Schematic_Hokeys_Descr, HK_EDIT_CUT );
msg = AddHotkeyName( _( "Cut Block" ), g_Schematic_Hotkeys_Descr, HK_EDIT_CUT );
AddMenuItem( PopMenu, ID_POPUP_CUT_BLOCK, msg, KiBitmap( cut_xpm ) );
msg = AddHotkeyName( _( "Copy Block" ), g_Schematic_Hokeys_Descr, HK_EDIT_COPY );
msg = AddHotkeyName( _( "Copy Block" ), g_Schematic_Hotkeys_Descr, HK_EDIT_COPY );
AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK, msg,
KiBitmap( copy_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_DUPLICATE_BLOCK, _( "Duplicate Block" ),
KiBitmap( duplicate_xpm ) );
msg = AddHotkeyName( _( "Mirror Block Around Horizontal(X) Axis" ), g_Libedit_Hokeys_Descr, HK_MIRROR_X );
msg = AddHotkeyName( _( "Mirror Block Around Horizontal(X) Axis" ), g_Libedit_Hotkeys_Descr, HK_MIRROR_X );
AddMenuItem( PopMenu, ID_POPUP_MIRROR_X_BLOCK, msg,
KiBitmap( mirror_v_xpm ) );
msg = AddHotkeyName( _( "Mirror Block Around Vertical(Y) Axis" ), g_Libedit_Hokeys_Descr, HK_MIRROR_Y );
msg = AddHotkeyName( _( "Mirror Block Around Vertical(Y) Axis" ), g_Libedit_Hotkeys_Descr, HK_MIRROR_Y );
AddMenuItem( PopMenu, ID_POPUP_MIRROR_Y_BLOCK, msg,
KiBitmap( mirror_h_xpm ) );
msg = AddHotkeyName( _( "Rotate Counterclockwise" ), g_Libedit_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( _( "Rotate Counterclockwise" ), g_Libedit_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( PopMenu, ID_POPUP_ROTATE_BLOCK, msg,
KiBitmap( rotate_ccw_xpm ) );
+13 -14
View File
@@ -72,14 +72,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
fileMenu->AppendSeparator();
text = AddHotkeyName( _( "&Save" ), g_Libedit_Hokeys_Descr, HK_SAVE );
text = AddHotkeyName( _( "&Save" ), g_Libedit_Hotkeys_Descr, HK_SAVE );
AddMenuItem( fileMenu,
ID_LIBEDIT_SAVE,
text,
_( "Save changes" ),
KiBitmap( save_xpm ) );
text = AddHotkeyName( _( "Save &As..." ), g_Libedit_Hokeys_Descr, HK_SAVEAS );
text = AddHotkeyName( _( "Save &As..." ), g_Libedit_Hotkeys_Descr, HK_SAVEAS );
AddMenuItem( fileMenu,
ID_LIBEDIT_SAVE_AS,
text,
@@ -135,14 +135,14 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
// Edit menu
wxMenu* editMenu = new wxMenu;
text = AddHotkeyName( _( "&Undo" ), g_Libedit_Hokeys_Descr, HK_UNDO );
text = AddHotkeyName( _( "&Undo" ), g_Libedit_Hotkeys_Descr, HK_UNDO );
AddMenuItem( editMenu,
wxID_UNDO,
text,
_( "Undo last edit" ),
KiBitmap( undo_xpm ) );
text = AddHotkeyName( _( "&Redo" ), g_Libedit_Hokeys_Descr, HK_REDO );
text = AddHotkeyName( _( "&Redo" ), g_Libedit_Hotkeys_Descr, HK_REDO );
AddMenuItem( editMenu,
wxID_REDO,
text,
@@ -196,16 +196,16 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
AddMenuItem( viewMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
// Fit on screen
text = AddHotkeyName( _( "&Zoom to Fit" ), g_Libedit_Hokeys_Descr, HK_ZOOM_AUTO );
text = AddHotkeyName( _( "&Zoom to Fit" ), g_Libedit_Hotkeys_Descr, HK_ZOOM_AUTO );
AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, _( "Zoom to fit symbol" ),
KiBitmap( zoom_fit_in_page_xpm ) );
text = AddHotkeyName( _( "Zoom to Selection" ),
g_Schematic_Hokeys_Descr, HK_ZOOM_SELECTION );
g_Schematic_Hotkeys_Descr, HK_ZOOM_SELECTION );
AddMenuItem( viewMenu, ID_MENU_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ) );
// Redraw
text = AddHotkeyName( _( "&Redraw" ), g_Libedit_Hokeys_Descr, HK_ZOOM_REDRAW );
text = AddHotkeyName( _( "&Redraw" ), g_Libedit_Hotkeys_Descr, HK_ZOOM_REDRAW );
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
viewMenu->AppendSeparator();
@@ -296,7 +296,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
wxMenu* inspectMenu = new wxMenu;
text = AddHotkeyName( _( "Show Datasheet" ), g_Libedit_Hokeys_Descr, HK_LIBEDIT_VIEW_DOC );
text = AddHotkeyName( _( "Show Datasheet" ), g_Libedit_Hotkeys_Descr, HK_LIBEDIT_VIEW_DOC );
AddMenuItem( inspectMenu,
ID_LIBEDIT_VIEW_DOC,
text,
@@ -329,9 +329,8 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
preferencesMenu->AppendSeparator();
// Default values and options
AddMenuItem( preferencesMenu,
wxID_PREFERENCES,
_( "&Preferences..." ),
text = AddHotkeyName( _( "&Preferences..." ), g_Libedit_Hotkeys_Descr, HK_PREFERENCES );
AddMenuItem( preferencesMenu, wxID_PREFERENCES, text,
_( "Show preferences for all open tools" ),
KiBitmap( preference_xpm ) );
@@ -340,13 +339,13 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
preferencesMenu->AppendSeparator();
text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), g_Libedit_Hokeys_Descr,
text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), g_Libedit_Hotkeys_Descr,
HK_CANVAS_OPENGL );
AddMenuItem( preferencesMenu, ID_MENU_CANVAS_OPENGL, text,
_( "Use Modern Toolset with hardware-accelerated graphics (recommended)" ),
KiBitmap( tools_xpm ), wxITEM_RADIO );
text = AddHotkeyName( _( "Modern Toolset (Fallba&ck)" ), g_Libedit_Hokeys_Descr,
text = AddHotkeyName( _( "Modern Toolset (Fallba&ck)" ), g_Libedit_Hotkeys_Descr,
HK_CANVAS_CAIRO );
AddMenuItem( preferencesMenu, ID_MENU_CANVAS_CAIRO, text,
_( "Use Modern Toolset with software graphics (fall-back)" ),
@@ -370,7 +369,7 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
text = AddHotkeyName( _( "&List Hotkeys..." ), g_Libedit_Hokeys_Descr, HK_HELP );
text = AddHotkeyName( _( "&List Hotkeys..." ), g_Libedit_Hotkeys_Descr, HK_HELP );
AddMenuItem( helpMenu,
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
text,
+6 -6
View File
@@ -121,25 +121,25 @@ void LIB_EDIT_FRAME::ReCreateHToolbar()
KiScaledSeparator( m_mainToolBar, this );
msg = AddHotkeyName( HELP_UNDO, g_Libedit_Hokeys_Descr, HK_UNDO, IS_COMMENT );
msg = AddHotkeyName( HELP_UNDO, g_Libedit_Hotkeys_Descr, HK_UNDO, IS_COMMENT );
m_mainToolBar->AddTool( wxID_UNDO, wxEmptyString, KiScaledBitmap( undo_xpm, this ), msg );
msg = AddHotkeyName( HELP_REDO, g_Libedit_Hokeys_Descr, HK_REDO, IS_COMMENT );
msg = AddHotkeyName( HELP_REDO, g_Libedit_Hotkeys_Descr, HK_REDO, IS_COMMENT );
m_mainToolBar->AddTool( wxID_REDO, wxEmptyString, KiScaledBitmap( redo_xpm, this ), msg );
KiScaledSeparator( m_mainToolBar, this );
msg = AddHotkeyName( HELP_ZOOM_REDRAW, g_Libedit_Hokeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
msg = AddHotkeyName( HELP_ZOOM_REDRAW, g_Libedit_Hotkeys_Descr, HK_ZOOM_REDRAW, IS_COMMENT );
m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
KiScaledBitmap( zoom_redraw_xpm, this ), msg );
msg = AddHotkeyName( HELP_ZOOM_IN, g_Libedit_Hokeys_Descr, HK_ZOOM_IN, IS_COMMENT );
msg = AddHotkeyName( HELP_ZOOM_IN, g_Libedit_Hotkeys_Descr, HK_ZOOM_IN, IS_COMMENT );
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, KiScaledBitmap( zoom_in_xpm, this ), msg );
msg = AddHotkeyName( HELP_ZOOM_OUT, g_Libedit_Hokeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
msg = AddHotkeyName( HELP_ZOOM_OUT, g_Libedit_Hotkeys_Descr, HK_ZOOM_OUT, IS_COMMENT );
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, KiScaledBitmap( zoom_out_xpm, this ), msg );
msg = AddHotkeyName( _( "Zoom to fit symbol" ), g_Libedit_Hokeys_Descr,
msg = AddHotkeyName( _( "Zoom to fit symbol" ), g_Libedit_Hotkeys_Descr,
HK_ZOOM_AUTO, IS_COMMENT );
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
KiScaledBitmap( zoom_fit_in_page_xpm, this ), msg );
+38 -37
View File
@@ -140,7 +140,7 @@ void prepareViewMenu( wxMenu* aParentMenu )
_( "Navigate schematic hierarchy" ),
KiBitmap( hierarchy_nav_xpm ) );
text = AddHotkeyName( _( "&Leave Sheet" ), g_Schematic_Hokeys_Descr, HK_LEAVE_SHEET );
text = AddHotkeyName( _( "&Leave Sheet" ), g_Schematic_Hotkeys_Descr, HK_LEAVE_SHEET );
AddMenuItem( aParentMenu,
ID_POPUP_SCH_LEAVE_SHEET, text,
_( "Return to parent schematic sheet" ),
@@ -163,24 +163,24 @@ void prepareViewMenu( wxMenu* aParentMenu )
* using in AddHotkeyName call the option "false" (not a shortcut)
*/
text = AddHotkeyName( _( "Zoom &In" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "Zoom &In" ), g_Schematic_Hotkeys_Descr,
HK_ZOOM_IN, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_ZOOM_IN, text, HELP_ZOOM_IN, KiBitmap( zoom_in_xpm ) );
text = AddHotkeyName( _( "Zoom &Out" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "Zoom &Out" ), g_Schematic_Hotkeys_Descr,
HK_ZOOM_OUT, IS_ACCELERATOR ); // add accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_ZOOM_OUT, text, HELP_ZOOM_OUT, KiBitmap( zoom_out_xpm ) );
text = AddHotkeyName( _( "&Zoom to Fit" ), g_Schematic_Hokeys_Descr, HK_ZOOM_AUTO );
text = AddHotkeyName( _( "&Zoom to Fit" ), g_Schematic_Hotkeys_Descr, HK_ZOOM_AUTO );
AddMenuItem( aParentMenu, ID_ZOOM_PAGE, text,
HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
text = AddHotkeyName( _( "Zoom to Selection" ), g_Eeschema_Hokeys_Descr, HK_ZOOM_SELECTION );
text = AddHotkeyName( _( "Zoom to Selection" ), g_Eeschema_Hotkeys_Descr, HK_ZOOM_SELECTION );
AddMenuItem( aParentMenu, ID_MENU_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ) );
text = AddHotkeyName( _( "&Redraw" ), g_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
text = AddHotkeyName( _( "&Redraw" ), g_Schematic_Hotkeys_Descr, HK_ZOOM_REDRAW );
AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text,
HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
@@ -232,59 +232,59 @@ void preparePlaceMenu( wxMenu* aParentMenu )
{
wxString text;
text = AddHotkeyName( _( "&Symbol" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "&Symbol" ), g_Schematic_Hotkeys_Descr,
HK_ADD_NEW_COMPONENT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_PLACE_COMPONENT, text,
HELP_PLACE_COMPONENTS,
KiBitmap( add_component_xpm ) );
text = AddHotkeyName( _( "&Power Port" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "&Power Port" ), g_Schematic_Hotkeys_Descr,
HK_ADD_NEW_POWER, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_PLACE_POWER_BUTT, text,
HELP_PLACE_POWERPORT,
KiBitmap( add_power_xpm ) );
text = AddHotkeyName( _( "&Wire" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "&Wire" ), g_Schematic_Hotkeys_Descr,
HK_BEGIN_WIRE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_WIRE_BUTT, text,
HELP_PLACE_WIRE,
KiBitmap( add_line_xpm ) );
text = AddHotkeyName( _( "&Bus" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "&Bus" ), g_Schematic_Hotkeys_Descr,
HK_BEGIN_BUS, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_BUS_BUTT, text,
HELP_PLACE_BUS,
KiBitmap( add_bus_xpm ) );
text = AddHotkeyName( _( "Wire to Bus &Entry" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "Wire to Bus &Entry" ), g_Schematic_Hotkeys_Descr,
HK_ADD_WIRE_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_WIRETOBUS_ENTRY_BUTT, text,
HELP_PLACE_WIRE2BUS_ENTRY,
KiBitmap( add_line2bus_xpm ) );
text = AddHotkeyName( _( "Bus &to Bus Entry" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "Bus &to Bus Entry" ), g_Schematic_Hotkeys_Descr,
HK_ADD_BUS_ENTRY, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_BUSTOBUS_ENTRY_BUTT, text,
HELP_PLACE_BUS2BUS_ENTRY,
KiBitmap( add_bus2bus_xpm ) );
text = AddHotkeyName( _( "&No Connect Flag" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "&No Connect Flag" ), g_Schematic_Hotkeys_Descr,
HK_ADD_NOCONN_FLAG, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_NOCONN_BUTT, text, HELP_PLACE_NC_FLAG, KiBitmap( noconn_xpm ) );
text = AddHotkeyName( _( "&Junction" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "&Junction" ), g_Schematic_Hotkeys_Descr,
HK_ADD_JUNCTION, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_JUNCTION_BUTT, text,
HELP_PLACE_JUNCTION,
KiBitmap( add_junction_xpm ) );
text = AddHotkeyName( _( "&Label" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "&Label" ), g_Schematic_Hotkeys_Descr,
HK_ADD_LABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_LABEL_BUTT, text,
HELP_PLACE_NETLABEL,
KiBitmap( add_line_label_xpm ) );
text = AddHotkeyName( _( "Gl&obal Label" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "Gl&obal Label" ), g_Schematic_Hotkeys_Descr,
HK_ADD_GLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_GLABEL_BUTT, text,
HELP_PLACE_GLOBALLABEL,
@@ -292,14 +292,14 @@ void preparePlaceMenu( wxMenu* aParentMenu )
aParentMenu->AppendSeparator();
text = AddHotkeyName( _( "&Hierarchical Label" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "&Hierarchical Label" ), g_Schematic_Hotkeys_Descr,
HK_ADD_HLABEL, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_HIERLABEL_BUTT,
text, HELP_PLACE_HIER_LABEL,
KiBitmap( add_hierarchical_label_xpm ) );
text = AddHotkeyName( _( "Hierar&chical Sheet" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "Hierar&chical Sheet" ), g_Schematic_Hotkeys_Descr,
HK_ADD_HIER_SHEET, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_SHEET_SYMBOL_BUTT, text,
HELP_PLACE_SHEET,
@@ -319,13 +319,13 @@ void preparePlaceMenu( wxMenu* aParentMenu )
aParentMenu->AppendSeparator();
text = AddHotkeyName( _( "Graphic Pol&yline" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "Graphic Pol&yline" ), g_Schematic_Hotkeys_Descr,
HK_ADD_GRAPHIC_POLYLINE, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_LINE_COMMENT_BUTT, text,
HELP_PLACE_GRAPHICLINES,
KiBitmap( add_dashed_line_xpm ) );
text = AddHotkeyName( _( "&Graphic Text" ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "&Graphic Text" ), g_Schematic_Hotkeys_Descr,
HK_ADD_GRAPHIC_TEXT, IS_ACCELERATOR ); // add an accelerator, not a shortcut
AddMenuItem( aParentMenu, ID_MENU_TEXT_COMMENT_BUTT, text,
HELP_PLACE_GRAPHICTEXTS,
@@ -358,12 +358,12 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
if( aIsOutsideProject ) // not when under a project mgr
{
text = AddHotkeyName( _( "&New..." ), g_Schematic_Hokeys_Descr, HK_NEW );
text = AddHotkeyName( _( "&New..." ), g_Schematic_Hotkeys_Descr, HK_NEW );
AddMenuItem( aParentMenu, ID_NEW_PROJECT, text,
_( "Start new schematic root sheet" ),
KiBitmap( new_document_xpm ) );
text = AddHotkeyName( _( "&Open..." ), g_Schematic_Hokeys_Descr, HK_OPEN );
text = AddHotkeyName( _( "&Open..." ), g_Schematic_Hotkeys_Descr, HK_OPEN );
AddMenuItem( aParentMenu, ID_LOAD_PROJECT, text,
_( "Open existing schematic" ),
KiBitmap( open_document_xpm ) );
@@ -375,7 +375,7 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
aParentMenu->AppendSeparator();
}
text = AddHotkeyName( _( "&Save" ), g_Schematic_Hokeys_Descr, HK_SAVE );
text = AddHotkeyName( _( "&Save" ), g_Schematic_Hotkeys_Descr, HK_SAVE );
AddMenuItem( aParentMenu, ID_SAVE_PROJECT, text,
_( "Save changes" ),
KiBitmap( save_xpm ) );
@@ -384,7 +384,7 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
_( "Save only the current sheet" ),
KiBitmap( save_xpm ) );
text = AddHotkeyName( _( "Save C&urrent Sheet As..." ), g_Schematic_Hokeys_Descr, HK_SAVEAS );
text = AddHotkeyName( _( "Save C&urrent Sheet As..." ), g_Schematic_Hotkeys_Descr, HK_SAVEAS );
AddMenuItem( aParentMenu, ID_SAVE_ONE_SHEET_UNDER_NEW_NAME, text,
_( "Save a copy of the current sheet" ),
KiBitmap( save_as_xpm ) );
@@ -431,7 +431,7 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
_( "Settings for sheet size and frame references" ),
KiBitmap( sheetset_xpm ) );
text = AddHotkeyName( _( "&Print..." ), g_Schematic_Hokeys_Descr, HK_PRINT );
text = AddHotkeyName( _( "&Print..." ), g_Schematic_Hotkeys_Descr, HK_PRINT );
AddMenuItem( aParentMenu, wxID_PRINT, text,
_( "Print schematic sheet" ),
KiBitmap( print_button_xpm ) );
@@ -454,28 +454,28 @@ void prepareEditMenu( wxMenu* aParentMenu )
wxString text;
// Undo
text = AddHotkeyName( _( "&Undo" ), g_Schematic_Hokeys_Descr, HK_UNDO );
text = AddHotkeyName( _( "&Undo" ), g_Schematic_Hotkeys_Descr, HK_UNDO );
AddMenuItem( aParentMenu, wxID_UNDO, text, HELP_UNDO, KiBitmap( undo_xpm ) );
// Redo
text = AddHotkeyName( _( "&Redo" ), g_Schematic_Hokeys_Descr, HK_REDO );
text = AddHotkeyName( _( "&Redo" ), g_Schematic_Hotkeys_Descr, HK_REDO );
AddMenuItem( aParentMenu, wxID_REDO, text, HELP_REDO, KiBitmap( redo_xpm ) );
aParentMenu->AppendSeparator();
text = AddHotkeyName( _( "&Cut" ), g_Schematic_Hokeys_Descr, HK_EDIT_CUT );
text = AddHotkeyName( _( "&Cut" ), g_Schematic_Hotkeys_Descr, HK_EDIT_CUT );
AddMenuItem( aParentMenu, wxID_CUT, text,
_( "Cuts the selected item(s) to the Clipboard" ),
KiBitmap( cut_xpm ) );
text = AddHotkeyName( _( "&Copy" ), g_Schematic_Hokeys_Descr, HK_EDIT_COPY );
text = AddHotkeyName( _( "&Copy" ), g_Schematic_Hotkeys_Descr, HK_EDIT_COPY );
AddMenuItem( aParentMenu, wxID_COPY, text,
_( "Copies the selected item(s) to the Clipboard" ),
KiBitmap( copy_xpm ) );
text = AddHotkeyName( _( "&Paste" ), g_Schematic_Hokeys_Descr, HK_EDIT_PASTE );
text = AddHotkeyName( _( "&Paste" ), g_Schematic_Hotkeys_Descr, HK_EDIT_PASTE );
AddMenuItem( aParentMenu, wxID_PASTE, text,
_( "Pastes item(s) from the Clipboard" ),
KiBitmap( paste_xpm ) );
@@ -488,11 +488,11 @@ void prepareEditMenu( wxMenu* aParentMenu )
// Find
aParentMenu->AppendSeparator();
text = AddHotkeyName( _( "&Find..." ), g_Schematic_Hokeys_Descr, HK_FIND_ITEM );
text = AddHotkeyName( _( "&Find..." ), g_Schematic_Hotkeys_Descr, HK_FIND_ITEM );
AddMenuItem( aParentMenu, ID_FIND_ITEMS, text, HELP_FIND, KiBitmap( find_xpm ) );
// Find/Replace
text = AddHotkeyName( _( "Find and Re&place..." ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "Find and Re&place..." ), g_Schematic_Hotkeys_Descr,
HK_FIND_REPLACE );
AddMenuItem( aParentMenu, wxID_REPLACE, text, HELP_REPLACE,
KiBitmap( find_replace_xpm ) );
@@ -520,7 +520,7 @@ void prepareToolsMenu( wxMenu* aParentMenu )
{
wxString text;
text = AddHotkeyName( _( "Update PCB from Schematic..." ), g_Schematic_Hokeys_Descr,
text = AddHotkeyName( _( "Update PCB from Schematic..." ), g_Schematic_Hotkeys_Descr,
HK_UPDATE_PCB_FROM_SCH );
AddMenuItem( aParentMenu,
@@ -600,7 +600,7 @@ void prepareHelpMenu( wxMenu* aParentMenu )
_( "Open \"Getting Started in KiCad\" guide for beginners" ),
KiBitmap( help_xpm ) );
wxString text = AddHotkeyName( _( "&List Hotkeys..." ), g_Eeschema_Hokeys_Descr, HK_HELP );
wxString text = AddHotkeyName( _( "&List Hotkeys..." ), g_Eeschema_Hotkeys_Descr, HK_HELP );
AddMenuItem( aParentMenu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, text,
_( "Displays current hotkeys table and corresponding commands" ),
KiBitmap( hotkeys_xpm ) );
@@ -628,7 +628,8 @@ static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu
KiBitmap( library_table_xpm ) );
// Options (Preferences on WXMAC)
AddMenuItem( aParentMenu, wxID_PREFERENCES, _( "Preferences..." ),
wxString text = AddHotkeyName( _( "&Preferences..." ), g_Eeschema_Hotkeys_Descr, HK_PREFERENCES );
AddMenuItem( aParentMenu, wxID_PREFERENCES, text,
_( "Show preferences for all open tools" ),
KiBitmap( preference_xpm ) );
@@ -639,13 +640,13 @@ static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu
aParentMenu->AppendSeparator();
wxString text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), g_Eeschema_Hokeys_Descr,
text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), g_Eeschema_Hotkeys_Descr,
HK_CANVAS_OPENGL );
AddMenuItem( aParentMenu, ID_MENU_CANVAS_OPENGL, text,
_( "Use Modern Toolset with hardware-accelerated graphics (recommended)" ),
KiBitmap( tools_xpm ), wxITEM_RADIO );
text = AddHotkeyName( _( "Modern Toolset (Fallba&ck)" ), g_Eeschema_Hokeys_Descr,
text = AddHotkeyName( _( "Modern Toolset (Fallba&ck)" ), g_Eeschema_Hotkeys_Descr,
HK_CANVAS_CAIRO );
AddMenuItem( aParentMenu, ID_MENU_CANVAS_CAIRO, text,
_( "Use Modern Toolset with software graphics (fall-back)" ),
@@ -150,6 +150,15 @@ bool NETLIST_EXPORTER_PSPICE::Format( OUTPUTFORMATTER* aFormatter, unsigned aCtl
// Replace parenthesis with underscore to prevent parse issues with simulators
ReplaceForbiddenChars( netName );
// Add quotes to nets containing slashes. This isn't added to ReplaceForbidenChars
// because this is only necessary for file writing; nets with slashes can be
// handled by ngspice after loading.
if( netName.Contains( "/" ) )
{
netName.Prepend( '"' );
netName.Append( '"' );
}
// Borrow LTSpice's nomenclature for unconnected nets
if( netName.IsEmpty() )
netName = wxString::Format( wxT( "NC_%.2u" ), NC_counter++ );
+84 -84
View File
@@ -101,33 +101,33 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
break;
case SCH_TEXT_T:
msg = AddHotkeyName( _( "Edit Text..." ), g_Schematic_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit Text..." ), g_Schematic_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );
PopMenu->AppendSeparator();
break;
case SCH_LABEL_T:
msg = AddHotkeyName( _( "Edit Label..." ), g_Schematic_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit Label..." ), g_Schematic_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );
PopMenu->AppendSeparator();
break;
case SCH_GLOBAL_LABEL_T:
msg = AddHotkeyName( _( "Edit Global Label..." ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Edit Global Label..." ), g_Schematic_Hotkeys_Descr,
HK_EDIT );
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );
PopMenu->AppendSeparator();
break;
case SCH_HIERARCHICAL_LABEL_T:
msg = AddHotkeyName( _( "Edit Hierarchical Label..." ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Edit Hierarchical Label..." ), g_Schematic_Hotkeys_Descr,
HK_EDIT );
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );
PopMenu->AppendSeparator();
break;
case SCH_BITMAP_T:
msg = AddHotkeyName( _( "Edit Image..." ), g_Schematic_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit Image..." ), g_Schematic_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( image_xpm ) );
PopMenu->AppendSeparator();
break;
@@ -201,7 +201,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
{
if( GetToolId() == ID_NO_TOOL_SELECTED && m_blockItems.GetCount() > 0 )
{
msg = AddHotkeyName( _( "&Paste" ), g_Schematic_Hokeys_Descr, HK_EDIT_PASTE );
msg = AddHotkeyName( _( "&Paste" ), g_Schematic_Hotkeys_Descr, HK_EDIT_PASTE );
AddMenuItem( PopMenu, wxID_PASTE, msg,
_( "Pastes item(s) from the Clipboard" ),
KiBitmap( paste_xpm ) );
@@ -210,7 +210,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
if( m_CurrentSheet->Last() != g_RootSheet )
{
msg = AddHotkeyName( _( "Leave Sheet" ), g_Schematic_Hokeys_Descr, HK_LEAVE_SHEET );
msg = AddHotkeyName( _( "Leave Sheet" ), g_Schematic_Hotkeys_Descr, HK_LEAVE_SHEET );
AddMenuItem( PopMenu, ID_POPUP_SCH_LEAVE_SHEET, msg,
KiBitmap( leave_sheet_xpm ) );
PopMenu->AppendSeparator();
@@ -326,7 +326,7 @@ void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field )
default: name = _( "Move Field" ); break;
}
msg = AddHotkeyName( name, g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( name, g_Schematic_Hotkeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
}
@@ -339,7 +339,7 @@ void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field )
default: name = _( "Rotate Field" ); break;
}
msg = AddHotkeyName( name, g_Schematic_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( name, g_Schematic_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( PopMenu, ID_SCH_ROTATE_CLOCKWISE, msg, KiBitmap( rotate_cw_xpm ) );
// Ref, value and footprint have specific hotkeys. Show the specific hotkey:
@@ -367,7 +367,7 @@ void AddMenusForComponentField( wxMenu* PopMenu, SCH_FIELD* Field )
name = _( "Edit Field..." );
break;
}
msg = AddHotkeyName( name, g_Schematic_Hokeys_Descr, id );
msg = AddHotkeyName( name, g_Schematic_Hotkeys_Descr, id );
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );
}
@@ -385,24 +385,24 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component, SYMBOL_LIB
if( !Component->GetFlags() )
{
msg.Printf( _( "Move %s" ), Component->GetField( REFERENCE )->GetText() );
msg = AddHotkeyName( msg, g_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
msg = AddHotkeyName( msg, g_Schematic_Hotkeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hokeys_Descr, HK_DRAG );
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hotkeys_Descr, HK_DRAG );
AddMenuItem( PopMenu, ID_SCH_DRAG_ITEM, msg, KiBitmap( drag_xpm ) );
}
wxMenu* orientmenu = new wxMenu;
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Schematic_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Schematic_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( orientmenu, ID_SCH_ROTATE_CLOCKWISE, msg, KiBitmap( rotate_cw_xpm ) );
AddMenuItem( orientmenu, ID_SCH_ROTATE_COUNTERCLOCKWISE, _( "Rotate Counterclockwise" ),
KiBitmap( rotate_ccw_xpm ) );
msg = AddHotkeyName( _( "Mirror Around Horizontal(X) Axis" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Mirror Around Horizontal(X) Axis" ), g_Schematic_Hotkeys_Descr,
HK_MIRROR_X );
AddMenuItem( orientmenu, ID_SCH_MIRROR_X, msg, KiBitmap( mirror_v_xpm ) );
msg = AddHotkeyName( _( "Mirror Around Vertical(Y) Axis" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Mirror Around Vertical(Y) Axis" ), g_Schematic_Hotkeys_Descr,
HK_MIRROR_Y );
AddMenuItem( orientmenu, ID_SCH_MIRROR_Y, msg, KiBitmap( mirror_h_xpm ) );
msg = AddHotkeyName( _( "Reset to Default" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Reset to Default" ), g_Schematic_Hotkeys_Descr,
HK_ORIENT_NORMAL_COMPONENT );
AddMenuItem( orientmenu, ID_SCH_ORIENT_NORMAL, msg, KiBitmap( normal_xpm ) );
AddMenuItem( PopMenu, orientmenu, ID_POPUP_SCH_GENERIC_ORIENT_CMP,
@@ -412,14 +412,14 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component, SYMBOL_LIB
if( !Component->GetFlags() )
{
msg = AddHotkeyName( _( "Duplicate" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Duplicate" ), g_Schematic_Hotkeys_Descr,
HK_DUPLICATE_ITEM );
AddMenuItem( PopMenu, ID_POPUP_SCH_DUPLICATE_ITEM, msg, KiBitmap( duplicate_xpm ) );
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE_CMP, msg, KiBitmap( delete_xpm ) );
}
msg = AddHotkeyName( _( "Autoplace Fields" ), g_Schematic_Hokeys_Descr, HK_AUTOPLACE_FIELDS );
msg = AddHotkeyName( _( "Autoplace Fields" ), g_Schematic_Hotkeys_Descr, HK_AUTOPLACE_FIELDS );
AddMenuItem( PopMenu, ID_AUTOPLACE_FIELDS, msg, KiBitmap( autoplace_fields_xpm ) );
if( !Component->GetField( DATASHEET )->GetFullyQualifiedText().IsEmpty() )
@@ -452,27 +452,27 @@ void AddMenusForEditComponent( wxMenu* PopMenu, SCH_COMPONENT* Component, SYMBOL
part = alias->GetPart();
wxMenu* editmenu = new wxMenu;
msg = AddHotkeyName( _( "Edit Properties..." ), g_Schematic_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit Properties..." ), g_Schematic_Hotkeys_Descr, HK_EDIT );
AddMenuItem( editmenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( config_xpm ) );
if( part && part->IsNormal() )
{
msg = AddHotkeyName( _( "Edit Value..." ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Edit Value..." ), g_Schematic_Hotkeys_Descr,
HK_EDIT_COMPONENT_VALUE );
AddMenuItem( editmenu, ID_SCH_EDIT_COMPONENT_VALUE, msg,
KiBitmap( edit_comp_value_xpm ) );
msg = AddHotkeyName( _( "Edit Reference..." ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Edit Reference..." ), g_Schematic_Hotkeys_Descr,
HK_EDIT_COMPONENT_REFERENCE );
AddMenuItem( editmenu, ID_SCH_EDIT_COMPONENT_REFERENCE, msg,
KiBitmap( edit_comp_ref_xpm ) );
msg = AddHotkeyName( _( "Edit Footprint..." ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Edit Footprint..." ), g_Schematic_Hotkeys_Descr,
HK_EDIT_COMPONENT_FOOTPRINT );
AddMenuItem( editmenu, ID_SCH_EDIT_COMPONENT_FOOTPRINT, msg,
KiBitmap( edit_comp_footprint_xpm ) );
msg = AddHotkeyName( _( "Show Datasheet" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Show Datasheet" ), g_Schematic_Hotkeys_Descr,
HK_SHOW_COMPONENT_DATASHEET );
AddMenuItem( editmenu, ID_POPUP_SCH_DISPLAYDOC_CMP, msg,
KiBitmap( datasheet_xpm ) );
@@ -509,7 +509,7 @@ void AddMenusForEditComponent( wxMenu* PopMenu, SCH_COMPONENT* Component, SYMBOL
if( !Component->GetFlags() )
{
msg = AddHotkeyName( _( "Edit with Library Editor" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Edit with Library Editor" ), g_Schematic_Hotkeys_Descr,
HK_EDIT_COMPONENT_WITH_LIBEDIT );
AddMenuItem( editmenu, ID_POPUP_SCH_CALL_LIBEDIT_AND_LOAD_CMP,
msg, KiBitmap( libedit_xpm ) );
@@ -527,22 +527,22 @@ void AddMenusForGLabel( wxMenu* PopMenu, SCH_GLOBALLABEL* GLabel )
if( !GLabel->GetFlags() )
{
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hotkeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hotkeys_Descr,
HK_DRAG );
AddMenuItem( PopMenu, ID_SCH_DRAG_ITEM, msg, KiBitmap( drag_xpm ) );
msg = AddHotkeyName( _( "Duplicate" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Duplicate" ), g_Schematic_Hotkeys_Descr,
HK_DUPLICATE_ITEM );
AddMenuItem( PopMenu, ID_POPUP_SCH_DUPLICATE_ITEM, msg, KiBitmap( duplicate_xpm ) );
}
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Schematic_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Schematic_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( PopMenu, ID_SCH_ROTATE_CLOCKWISE, msg, KiBitmap( rotate_cw_xpm ) );
msg = AddHotkeyName( _( "Edit..." ), g_Schematic_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit..." ), g_Schematic_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, KiBitmap( delete_xpm ) );
// add menu change type text (to label, glabel, text):
@@ -564,21 +564,21 @@ void AddMenusForHLabel( wxMenu* PopMenu, SCH_HIERLABEL* HLabel )
if( !HLabel->GetFlags() )
{
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hotkeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hokeys_Descr, HK_DRAG );
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hotkeys_Descr, HK_DRAG );
AddMenuItem( PopMenu, ID_SCH_DRAG_ITEM, msg, KiBitmap( drag_xpm ) );
msg = AddHotkeyName( _( "Copy" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Copy" ), g_Schematic_Hotkeys_Descr,
HK_DUPLICATE_ITEM );
AddMenuItem( PopMenu, ID_POPUP_SCH_DUPLICATE_ITEM, msg, KiBitmap( copy_xpm ) );
}
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Schematic_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Schematic_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( PopMenu, ID_SCH_ROTATE_CLOCKWISE, msg, KiBitmap( rotate_cw_xpm ) );
msg = AddHotkeyName( _( "Edit..." ), g_Schematic_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit..." ), g_Schematic_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, KiBitmap( delete_xpm ) );
// add menu change type text (to label, glabel, text):
@@ -600,19 +600,19 @@ void AddMenusForLabel( wxMenu* PopMenu, SCH_LABEL* Label )
if( !Label->GetFlags() )
{
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hotkeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hokeys_Descr, HK_DRAG );
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hotkeys_Descr, HK_DRAG );
AddMenuItem( PopMenu, ID_SCH_DRAG_ITEM, msg, KiBitmap( drag_xpm ) );
msg = AddHotkeyName( _( "Duplicate" ), g_Schematic_Hokeys_Descr, HK_DUPLICATE_ITEM );
msg = AddHotkeyName( _( "Duplicate" ), g_Schematic_Hotkeys_Descr, HK_DUPLICATE_ITEM );
AddMenuItem( PopMenu, ID_POPUP_SCH_DUPLICATE_ITEM, msg, KiBitmap( duplicate_xpm ) );
}
msg = AddHotkeyName( _( "Rotate Counterclockwise" ), g_Schematic_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( _( "Rotate Counterclockwise" ), g_Schematic_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( PopMenu, ID_SCH_ROTATE_CLOCKWISE, msg, KiBitmap( rotate_ccw_xpm ) );
msg = AddHotkeyName( _( "Edit..." ), g_Schematic_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit..." ), g_Schematic_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, KiBitmap( delete_xpm ) );
// add menu change type text (to label, glabel, text):
@@ -634,17 +634,17 @@ void AddMenusForText( wxMenu* PopMenu, SCH_TEXT* Text )
if( !Text->GetFlags() )
{
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hotkeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
msg = AddHotkeyName( _( "Duplicate" ), g_Schematic_Hokeys_Descr, HK_DUPLICATE_ITEM );
msg = AddHotkeyName( _( "Duplicate" ), g_Schematic_Hotkeys_Descr, HK_DUPLICATE_ITEM );
AddMenuItem( PopMenu, ID_POPUP_SCH_DUPLICATE_ITEM, msg, KiBitmap( duplicate_xpm ) );
}
msg = AddHotkeyName( _( "Rotate Counterclockwise" ), g_Schematic_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( _( "Rotate Counterclockwise" ), g_Schematic_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( PopMenu, ID_SCH_ROTATE_CLOCKWISE, msg, KiBitmap( rotate_ccw_xpm ) );
msg = AddHotkeyName( _( "Edit..." ), g_Schematic_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit..." ), g_Schematic_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_text_xpm ) );
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, KiBitmap( delete_xpm ) );
/* add menu change type text (to label, glabel, text),
@@ -669,7 +669,7 @@ void SCH_EDIT_FRAME::addJunctionMenuEntries( wxMenu* aMenu, SCH_JUNCTION* aJunct
wxString msg;
SCH_SCREEN* screen = GetScreen();
msg = AddHotkeyName( _( "Delete Junction" ), g_Schematic_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete Junction" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
AddMenuItem( aMenu, ID_POPUP_SCH_DELETE, msg, KiBitmap( delete_xpm ) );
if( !aJunction->IsNew() )
@@ -700,22 +700,22 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame )
if( Wire == NULL )
{
msg = AddHotkeyName( _( "Begin Wire" ), g_Schematic_Hokeys_Descr, HK_BEGIN_WIRE );
msg = AddHotkeyName( _( "Begin Wire" ), g_Schematic_Hotkeys_Descr, HK_BEGIN_WIRE );
AddMenuItem( PopMenu, ID_POPUP_SCH_BEGIN_WIRE, msg, KiBitmap( add_line_xpm ) );
return;
}
if( Wire->IsNew() )
{
msg = AddHotkeyName( _( "Wire End" ), g_Schematic_Hokeys_Descr, HK_END_CURR_LINEWIREBUS );
msg = AddHotkeyName( _( "Wire End" ), g_Schematic_Hotkeys_Descr, HK_END_CURR_LINEWIREBUS );
AddMenuItem( PopMenu, ID_POPUP_END_LINE, msg, KiBitmap( checked_ok_xpm ) );
return;
}
msg = AddHotkeyName( _( "Drag Wire" ), g_Schematic_Hokeys_Descr, HK_DRAG );
msg = AddHotkeyName( _( "Drag Wire" ), g_Schematic_Hotkeys_Descr, HK_DRAG );
AddMenuItem( PopMenu, ID_SCH_DRAG_ITEM, msg, KiBitmap( drag_xpm ) );
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Delete Wire" ), g_Schematic_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete Wire" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, KiBitmap( delete_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE_NODE, _( "Delete Node" ),
KiBitmap( delete_node_xpm ) );
@@ -730,9 +730,9 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame )
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Add Junction" ), g_Schematic_Hokeys_Descr, HK_ADD_JUNCTION );
msg = AddHotkeyName( _( "Add Junction" ), g_Schematic_Hotkeys_Descr, HK_ADD_JUNCTION );
AddMenuItem( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, msg, KiBitmap( add_junction_xpm ) );
msg = AddHotkeyName( _( "Add Label..." ), g_Schematic_Hokeys_Descr, HK_ADD_LABEL );
msg = AddHotkeyName( _( "Add Label..." ), g_Schematic_Hotkeys_Descr, HK_ADD_LABEL );
AddMenuItem( PopMenu, ID_POPUP_SCH_ADD_LABEL, msg, KiBitmap( add_line_label_xpm ) );
// Add global label command only if the cursor is over one end of the wire.
@@ -749,27 +749,27 @@ void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, SCH_EDIT_FRAME* frame )
if( Bus == NULL )
{
msg = AddHotkeyName( _( "Begin Bus" ), g_Schematic_Hokeys_Descr, HK_BEGIN_BUS );
msg = AddHotkeyName( _( "Begin Bus" ), g_Schematic_Hotkeys_Descr, HK_BEGIN_BUS );
AddMenuItem( PopMenu, ID_POPUP_SCH_BEGIN_BUS, msg, KiBitmap( add_bus_xpm ) );
return;
}
if( Bus->IsNew() )
{
msg = AddHotkeyName( _( "Bus End" ), g_Schematic_Hokeys_Descr, HK_END_CURR_LINEWIREBUS );
msg = AddHotkeyName( _( "Bus End" ), g_Schematic_Hotkeys_Descr, HK_END_CURR_LINEWIREBUS );
AddMenuItem( PopMenu, ID_POPUP_END_LINE, msg, KiBitmap( checked_ok_xpm ) );
return;
}
msg = AddHotkeyName( _( "Delete Bus" ), g_Schematic_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete Bus" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, KiBitmap( delete_bus_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Bus" ), KiBitmap( break_bus_xpm ) );
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Add Junction" ), g_Schematic_Hokeys_Descr, HK_ADD_JUNCTION );
msg = AddHotkeyName( _( "Add Junction" ), g_Schematic_Hotkeys_Descr, HK_ADD_JUNCTION );
AddMenuItem( PopMenu, ID_POPUP_SCH_ADD_JUNCTION, msg, KiBitmap( add_junction_xpm ) );
msg = AddHotkeyName( _( "Add Label..." ), g_Schematic_Hokeys_Descr, HK_ADD_LABEL );
msg = AddHotkeyName( _( "Add Label..." ), g_Schematic_Hotkeys_Descr, HK_ADD_LABEL );
AddMenuItem( PopMenu, ID_POPUP_SCH_ADD_LABEL, msg, KiBitmap( add_line_label_xpm ) );
// Add global label command only if the cursor is over one end of the bus.
@@ -788,30 +788,30 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet )
AddMenuItem( PopMenu, ID_POPUP_SCH_ENTER_SHEET, _( "Enter Sheet" ),
KiBitmap( enter_sheet_xpm ) );
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hotkeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hokeys_Descr, HK_DRAG );
msg = AddHotkeyName( _( "Drag" ), g_Schematic_Hotkeys_Descr, HK_DRAG );
AddMenuItem( PopMenu, ID_SCH_DRAG_ITEM, msg, KiBitmap( drag_xpm ) );
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Select Items On PCB" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Select Items On PCB" ), g_Schematic_Hotkeys_Descr,
HK_SELECT_ITEMS_ON_PCB );
AddMenuItem( PopMenu, ID_POPUP_SCH_SELECT_ON_PCB, msg, KiBitmap( select_same_sheet_xpm ) );
PopMenu->AppendSeparator();
wxMenu* orientmenu = new wxMenu;
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Schematic_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( _( "Rotate Clockwise" ), g_Schematic_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( orientmenu, ID_SCH_ROTATE_CLOCKWISE, msg, KiBitmap( rotate_cw_xpm ) );
AddMenuItem( orientmenu, ID_SCH_ROTATE_COUNTERCLOCKWISE, _( "Rotate Counterclockwise" ),
KiBitmap( rotate_ccw_xpm ) );
msg = AddHotkeyName( _( "Mirror Around Horizontal(X) Axis" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Mirror Around Horizontal(X) Axis" ), g_Schematic_Hotkeys_Descr,
HK_MIRROR_X );
AddMenuItem( orientmenu, ID_SCH_MIRROR_X, msg, KiBitmap( mirror_v_xpm ) );
msg = AddHotkeyName( _( "Mirror Around Vertical(Y) Axis" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Mirror Around Vertical(Y) Axis" ), g_Schematic_Hotkeys_Descr,
HK_MIRROR_Y );
AddMenuItem( orientmenu, ID_SCH_MIRROR_Y, msg, KiBitmap( mirror_h_xpm ) );
@@ -825,7 +825,7 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet )
}
else
{
msg = AddHotkeyName( _( "Edit..." ), g_Schematic_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit..." ), g_Schematic_Hotkeys_Descr, HK_EDIT );
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( editor_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_SCH_RESIZE_SHEET, _( "Resize" ),
@@ -839,7 +839,7 @@ void AddMenusForHierchicalSheet( wxMenu* PopMenu, SCH_SHEET* Sheet )
KiBitmap( options_pinsheet_xpm ) );
PopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, KiBitmap( delete_sheet_xpm ) );
}
}
@@ -851,7 +851,7 @@ void AddMenusForSheetPin( wxMenu* PopMenu, SCH_SHEET_PIN* PinSheet )
if( !PinSheet->GetFlags() )
{
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hotkeys_Descr, HK_MOVE_COMPONENT_OR_ITEM );
AddMenuItem( PopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
}
@@ -880,26 +880,26 @@ void AddMenusForBlock( wxMenu* PopMenu, SCH_EDIT_FRAME* frame )
// a block function.
if( frame->GetScreen()->m_BlockLocate.GetCommand() == BLOCK_MOVE )
{
msg = AddHotkeyName( _( "Cut Block" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Cut Block" ), g_Schematic_Hotkeys_Descr,
HK_EDIT_CUT );
AddMenuItem( PopMenu, ID_POPUP_CUT_BLOCK, msg, KiBitmap( cut_xpm ) );
msg = AddHotkeyName( _( "Copy Block" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Copy Block" ), g_Schematic_Hotkeys_Descr,
HK_EDIT_COPY );
AddMenuItem( PopMenu, ID_POPUP_COPY_BLOCK, msg, KiBitmap( copy_xpm ) );
AddMenuItem( PopMenu, ID_POPUP_DUPLICATE_BLOCK, _( "Duplicate Block" ),
KiBitmap( duplicate_xpm ) );
msg = AddHotkeyName( _( "Drag Block" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Drag Block" ), g_Schematic_Hotkeys_Descr,
HK_MOVEBLOCK_TO_DRAGBLOCK );
AddMenuItem( PopMenu, ID_POPUP_DRAG_BLOCK, msg, KiBitmap( drag_xpm ) );
msg = AddHotkeyName( _( "Delete Block" ), g_Schematic_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete Block" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
AddMenuItem( PopMenu, ID_POPUP_DELETE_BLOCK, msg, KiBitmap( delete_xpm ) );
msg = AddHotkeyName( _( "Mirror Block Around Vertical(Y) Axis" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Mirror Block Around Vertical(Y) Axis" ), g_Schematic_Hotkeys_Descr,
HK_MIRROR_Y );
AddMenuItem( PopMenu, ID_SCH_MIRROR_Y, msg, KiBitmap( mirror_h_xpm ) );
msg = AddHotkeyName( _( "Mirror Block Around Horizontal(X) Axis" ),
g_Schematic_Hokeys_Descr, HK_MIRROR_X );
g_Schematic_Hotkeys_Descr, HK_MIRROR_X );
AddMenuItem( PopMenu, ID_SCH_MIRROR_X, msg, KiBitmap( mirror_v_xpm ) );
msg = AddHotkeyName( _( "Rotate Block CCW" ), g_Schematic_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( _( "Rotate Block CCW" ), g_Schematic_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( PopMenu, ID_SCH_ROTATE_CLOCKWISE, msg, KiBitmap( rotate_ccw_xpm ) );
#if 0
@@ -926,26 +926,26 @@ void AddMenusForBitmap( wxMenu* aPopMenu, SCH_BITMAP * aBitmap )
if( aBitmap->GetFlags() == 0 )
{
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Move" ), g_Schematic_Hotkeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
AddMenuItem( aPopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
}
msg = AddHotkeyName( _( "Rotate Counterclockwise" ), g_Schematic_Hokeys_Descr, HK_ROTATE );
msg = AddHotkeyName( _( "Rotate Counterclockwise" ), g_Schematic_Hotkeys_Descr, HK_ROTATE );
AddMenuItem( aPopMenu, ID_SCH_ROTATE_CLOCKWISE, msg, KiBitmap( rotate_ccw_xpm ) );
msg = AddHotkeyName( _( "Mirror Around Horizontal(X) Axis" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Mirror Around Horizontal(X) Axis" ), g_Schematic_Hotkeys_Descr,
HK_MIRROR_X );
AddMenuItem( aPopMenu, ID_SCH_MIRROR_X, msg, KiBitmap( mirror_v_xpm ) );
msg = AddHotkeyName( _( "Mirror Around Vertical(Y) Axis" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Mirror Around Vertical(Y) Axis" ), g_Schematic_Hotkeys_Descr,
HK_MIRROR_Y );
AddMenuItem( aPopMenu, ID_SCH_MIRROR_Y, msg, KiBitmap( mirror_h_xpm ) );
msg = AddHotkeyName( _( "Edit Image..." ), g_Schematic_Hokeys_Descr, HK_EDIT );
msg = AddHotkeyName( _( "Edit Image..." ), g_Schematic_Hotkeys_Descr, HK_EDIT );
AddMenuItem( aPopMenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( image_xpm ) );
if( aBitmap->GetFlags() == 0 )
{
aPopMenu->AppendSeparator();
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
AddMenuItem( aPopMenu, ID_POPUP_SCH_DELETE, msg, KiBitmap( delete_xpm ) );
}
}
@@ -957,7 +957,7 @@ void AddMenusForBusEntry( wxMenu* aPopMenu, SCH_BUS_ENTRY_BASE* aBusEntry )
if( !aBusEntry->GetFlags() )
{
msg = AddHotkeyName( _( "Move Bus Entry" ), g_Schematic_Hokeys_Descr,
msg = AddHotkeyName( _( "Move Bus Entry" ), g_Schematic_Hotkeys_Descr,
HK_MOVE_COMPONENT_OR_ITEM );
AddMenuItem( aPopMenu, ID_SCH_MOVE_ITEM, msg, KiBitmap( move_xpm ) );
}
@@ -969,6 +969,6 @@ void AddMenusForBusEntry( wxMenu* aPopMenu, SCH_BUS_ENTRY_BASE* aBusEntry )
AddMenuItem( aPopMenu, ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH,
_( "Set Bus Entry Shape \\" ), KiBitmap( change_entry_orient_xpm ) );
msg = AddHotkeyName( _( "Delete Bus Entry" ), g_Schematic_Hokeys_Descr, HK_DELETE );
msg = AddHotkeyName( _( "Delete Bus Entry" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
AddMenuItem( aPopMenu, ID_POPUP_SCH_DELETE, msg, KiBitmap( delete_xpm ) );
}
+10 -9
View File
@@ -23,6 +23,7 @@
*/
#include "pin_number.h"
#include <wx/crt.h>
namespace {
@@ -33,16 +34,16 @@ wxString GetNextComponent( const wxString& str, wxString::size_type& cursor )
wxString::size_type begin = cursor;
wxUniChar c = str[cursor];
wxChar c = str[cursor];
if( isdigit( c ) || c == '+' || c == '-' )
if( wxIsdigit( c ) || c == '+' || c == '-' )
{
// number, possibly with sign
while( ++cursor < str.size() )
{
c = str[cursor];
if( isdigit( c ) || c == 'v' || c == 'V' )
if( wxIsdigit( c ) || c == 'v' || c == 'V' )
continue;
else
break;
@@ -54,7 +55,7 @@ wxString GetNextComponent( const wxString& str, wxString::size_type& cursor )
{
c = str[cursor];
if( isdigit( c ) )
if( wxIsdigit( c ) )
break;
else
continue;
@@ -128,12 +129,12 @@ int PinNumbers::Compare( const PinNumber& lhs, const PinNumber& rhs )
if( comp2.empty() )
return 2;
wxUniChar c1 = comp1[0];
wxUniChar c2 = comp2[0];
wxChar c1 = comp1[0];
wxChar c2 = comp2[0];
if( isdigit( c1 ) || c1 == '-' || c1 == '+' )
if( wxIsdigit( c1 ) || c1 == '-' || c1 == '+' )
{
if( isdigit( c2 ) || c2 == '-' || c2 == '+' )
if( wxIsdigit( c2 ) || c2 == '-' || c2 == '+' )
{
// numeric comparison
wxString::size_type v1 = comp1.find_first_of( "vV" );
@@ -172,7 +173,7 @@ int PinNumbers::Compare( const PinNumber& lhs, const PinNumber& rhs )
}
else
{
if( isdigit( c2 ) || c2 == '-' || c2 == '+' )
if( wxIsdigit( c2 ) || c2 == '-' || c2 == '+' )
return 2;
int res = comp1.Cmp( comp2 );
+3 -1
View File
@@ -162,8 +162,10 @@ void SCH_BUS_ENTRY_BASE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint&
if( aColor != COLOR4D::UNSPECIFIED )
color = aColor;
else if( aPanel->GetScreen() && !aPanel->GetScreen()->m_IsPrinting && GetState( BRIGHTENED ) )
color = GetLayerColor( LAYER_BRIGHTENED );
else
color = GetLayerColor( GetState( BRIGHTENED ) ? LAYER_BRIGHTENED : m_Layer );
color = GetLayerColor( m_Layer );
GRSetDrawMode( aDC, aDrawMode );
+1
View File
@@ -135,6 +135,7 @@ const KICAD_T SCH_COLLECTOR::MovableItems[] = {
const KICAD_T SCH_COLLECTOR::DraggableItems[] = {
SCH_JUNCTION_T,
SCH_NO_CONNECT_T,
SCH_BUS_BUS_ENTRY_T,
SCH_BUS_WIRE_ENTRY_T,
SCH_LINE_T,
+4 -4
View File
@@ -193,8 +193,8 @@ SCH_COMPONENT::SCH_COMPONENT( const SCH_COMPONENT& aComponent ) :
void SCH_COMPONENT::Init( const wxPoint& pos )
{
m_Pos = pos;
m_unit = 0; // In multi unit chip - which unit to draw.
m_convert = 0; // De Morgan Handling
m_unit = 1; // In multi unit chip - which unit to draw.
m_convert = LIB_ITEM::LIB_CONVERT::BASE; // De Morgan Handling
// The rotation/mirror transformation matrix. pos normal
m_transform = TRANSFORM();
@@ -732,7 +732,7 @@ bool SCH_COMPONENT::IsReferenceStringValid( const wxString& aReferenceString )
bool ok = true;
// Try to unannotate this reference
while( !text.IsEmpty() && ( text.Last() == '?' || std::isdigit( text.Last().GetValue() ) ) )
while( !text.IsEmpty() && ( text.Last() == '?' || wxIsdigit( text.Last() ) ) )
text.RemoveLast();
if( text.IsEmpty() )
@@ -795,7 +795,7 @@ void SCH_COMPONENT::SetRef( const SCH_SHEET_PATH* sheet, const wxString& ref )
if( IsReferenceStringValid( prefix ) )
{
while( prefix.Last() == '?' || std::isdigit( prefix.Last().GetValue() ) )
while( prefix.Last() == '?' || wxIsdigit( prefix.Last() ) )
prefix.RemoveLast();
}
else
+8 -5
View File
@@ -3,6 +3,7 @@
*
* Copyright (C) 2014-2019 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
* Copyright (C) 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
@@ -626,9 +627,8 @@ void SCH_DRAW_PANEL::OnCharHook( wxKeyEvent& event )
void SCH_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
{
int localkey;
localkey = event.GetKeyCode();
int localkey = event.GetKeyCode();
bool keyWasHandled = false;
switch( localkey )
{
@@ -642,6 +642,8 @@ void SCH_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
EndMouseCapture();
else
EndMouseCapture( ID_NO_TOOL_SELECTED, 0 /*m_defaultCursor*/, wxEmptyString );
keyWasHandled = true; // The key is captured: the key event will be not skipped
break;
}
@@ -683,14 +685,15 @@ void SCH_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
GetParent()->SetMousePosition( pos );
if( !GetParent()->GeneralControl( nullptr, pos, localkey ) )
// a Key event has to be skipped only if it is not handled:
if( !GetParent()->GeneralControl( nullptr, pos, localkey ) && !keyWasHandled )
event.Skip();
}
void SCH_DRAW_PANEL::onPaint( wxPaintEvent& aEvent )
{
if( !m_gal->IsInitialized() )
if( !m_gal->IsInitialized() || !m_gal->IsVisible() )
// The first wxPaintEvent can be fired at startup before the GAL engine is fully initialized
// (depending on platforms). Do nothing in this case
return;
+9 -13
View File
@@ -380,7 +380,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ):
m_printMonochrome = true;
m_printSheetReference = true;
SetShowPageLimits( true );
m_hotkeysDescrList = g_Schematic_Hokeys_Descr;
m_hotkeysDescrList = g_Schematic_Hotkeys_Descr;
m_dlgFindReplace = NULL;
m_findReplaceData = new wxFindReplaceData( wxFR_DOWN );
m_findReplaceStatus = new wxString( wxEmptyString );
@@ -444,6 +444,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ):
Bind( wxEVT_COMMAND_MENU_SELECTED, &SCH_EDIT_FRAME::OnEditSymbolLibTable, this,
ID_EDIT_SYM_LIB_TABLE );
UpdateTitle();
}
@@ -687,8 +689,8 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& aEvent )
{
fn = Prj().AbsolutePath( screen->GetFileName() );
// Auto save file name is the normal file name prepended with AUTOSAVE_PREFIX_FILENAME.
fn.SetName( AUTOSAVE_PREFIX_FILENAME + fn.GetName() );
// Auto save file name is the normal file name prepended with GetAutoSaveFilePrefix().
fn.SetName( GetAutoSaveFilePrefix() + fn.GetName() );
if( fn.FileExists() && fn.IsFileWritable() )
wxRemoveFile( fn.GetFullPath() );
@@ -1291,11 +1293,7 @@ void SCH_EDIT_FRAME::OnPrint( wxCommandEvent& event )
wxFileName fn = Prj().AbsolutePath( g_RootSheet->GetScreen()->GetFileName() );
if( fn.GetName() != NAMELESS_PROJECT )
{
// was: wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParametersList() );
Prj().ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDITOR,
GetProjectFileParametersList() );
}
Prj().ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDIT, GetProjectFileParameters() );
}
@@ -1478,7 +1476,7 @@ void SCH_EDIT_FRAME::UpdateTitle()
if( GetScreen()->GetFileName() == m_DefaultSchematicFileName )
{
title.Printf( _( "Eeschema" ) + wxT( " \u2014 %s" ), GetChars( GetScreen()->GetFileName() ) );
title.Printf( _( "Eeschema" ) + wxT( " \u2014 %s" ), GetScreen()->GetFileName() );
}
else
{
@@ -1486,9 +1484,8 @@ void SCH_EDIT_FRAME::UpdateTitle()
wxFileName fn = fileName;
title.Printf( _( "Eeschema" ) + wxT( " \u2014 %s [%s] \u2014 %s" ),
GetChars( fn.GetName() ),
GetChars( m_CurrentSheet->PathHumanReadable() ),
GetChars( fn.GetPath() ) );
fn.GetFullName(), m_CurrentSheet->PathHumanReadable(),
fn.GetPath() );
if( fn.FileExists() )
{
@@ -1560,4 +1557,3 @@ const BOX2I SCH_EDIT_FRAME::GetDocumentExtents() const
return BOX2I( VECTOR2I(0, 0), VECTOR2I( sizeX, sizeY ) );
}
+1 -7
View File
@@ -261,7 +261,7 @@ public:
* already been populated and return a reference to the array to the caller.
* </p>
*/
PARAM_CFG_ARRAY& GetProjectFileParametersList();
PARAM_CFG_ARRAY& GetProjectFileParameters();
/**
* Save changes to the project settings to the project (.pro) file.
@@ -1506,12 +1506,6 @@ public:
virtual const BOX2I GetDocumentExtents() const override;
///> Probe cursor, used by circuit simulator
const static wxCursor CURSOR_PROBE;
///> Tuner cursor, used by circuit simulator
const static wxCursor CURSOR_TUNE;
DECLARE_EVENT_TABLE()
};
+3 -1
View File
@@ -98,8 +98,10 @@ void SCH_JUNCTION::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffs
if( aColor != COLOR4D::UNSPECIFIED )
color = aColor;
else if( aPanel->GetScreen() && !aPanel->GetScreen()->m_IsPrinting && GetState( BRIGHTENED ) )
color = GetLayerColor( LAYER_BRIGHTENED );
else
color = GetLayerColor( GetState( BRIGHTENED ) ? LAYER_BRIGHTENED : m_Layer );
color = GetLayerColor( m_Layer );
GRSetDrawMode( aDC, aDrawMode );

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