Commit Graph

610 Commits

Author SHA1 Message Date
Ian McInerney 3d47eb0d49 Fix localization of the menu strings with accelerator strings
The accelerator strings really shouldn't be part of the translation,
and some translations have cause the accelerator keys to be incorrectly
handled. It is simpler to make it separate and just join them to the
translated string.

Make all accelerator modifiers use lowercased Ctrl instead of CTRL
to be the same as the other modifiers.

Fixes https://gitlab.com/kicad/code/kicad/issues/5992
2020-11-04 01:31:52 +00:00
Mark Roszko 98ece9df72 Remove infinitely recursive loop on Windows (in special cases)
This looks like it was always intended for macOS but was accidentally changed for Windows as well.
If this is a requirement on windows, I'm sure theres better ways to fix it....
2020-10-31 13:44:50 +00:00
Jeff Young bddc97df30 LibEdit -> SymbolEditor 2020-10-31 10:28:21 +00:00
Jeff Young 5a644aa3fb QuasiModal needs to be used for any dialog hosting a help window.
Fixes https://gitlab.com/kicad/code/kicad/issues/5897
2020-10-28 23:07:15 +00:00
Jeff Young 89f8078381 Bi-directional tooltips for Update PCB from Schematic and viceversa.
Fixes https://gitlab.com/kicad/code/kicad/issues/6186
2020-10-27 22:54:22 +00:00
Werni a7d5d1f091 Add more consts all over the place 2020-10-27 11:03:35 +00:00
Marek Roszko 91e5611341 Move dialog_configure_paths.h and dialog_edit_library_tables.h to dialogs folder 2020-10-25 20:01:12 -04:00
Jon Evans 09ade9fe51 Inhibit point editor while drag-selecting
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6155
2020-10-25 12:13:25 -04:00
jean-pierre charras 34179cd039 Add missing icon in menu, and fix them in other menus 2020-10-25 14:51:08 +01:00
Marek Roszko e928b2d8fd Split EDA_UNITS out from common. 2020-10-25 00:02:52 -04:00
Marek Roszko 81a7afc76e Use kicad_algo directly rather than common.h 2020-10-24 08:53:11 -04:00
Jon Evans 35c7ba0a8a Fix hover/highlight of line edit points
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6104
2020-10-21 20:37:15 -04:00
Marek Roszko f1e2bdc2d0 Prevent zoom to fit from going to crazy zooms on blank canvas
Fix #6062
2020-10-19 18:51:32 -04:00
Marek Roszko f38676fc46 Move the timer fix to the dispatcher to just always run 2020-10-15 00:38:32 -04:00
Jon Evans 858718b949 CHANGED: High-contrast mode is now called single layer view mode
This makes it more obvious what the tool is for, and also clarifies
the difference between the 2-state and 3-state actions in the
hotkey dialog
2020-10-14 20:16:49 -04:00
Marek Roszko f59551d6ad Remove painter.h from eda_text.h 2020-10-14 19:18:38 -04:00
Marek Roszko 511bdb64e1 Fix the delete tool not immediately setting cursor
Fix #5939
2020-10-09 18:51:10 -04:00
Marek Roszko 8fa42a74bd Add zoom cursors 2020-10-08 20:52:58 -04:00
Mark Roszko d9485129c8 Implement more context specific cursors using both stock and custom cursors. 2020-10-08 00:50:28 +00:00
Jeff Young ee95d8fe2e Improve SNR in status bar (and use common code). 2020-10-06 12:08:31 +01:00
Ian McInerney 43c14face0 Switch to showing metric/imperial units in comboboxes and menus
This will always show 1 unit from each system, with the primary unit
being the current frame unit and the secondary unit being the
most recent unit used from the other system. These are saved in
the settings, so they are saved between runs.
2020-10-05 20:26:33 +01:00
Ian McInerney 3a570c27f0 Update unit handling in the preview ruler
* Make the ruler able to switch to mils after creation
* Cleanup an unused flag in Pcbnew dimensions
* Move unit changed notification into EDA_DRAW_FRAME so more
  frames to use it.
* Allow switching units when GerbView ruler tool is active
2020-10-04 17:53:55 +01:00
Ian McInerney b1bd1f2a97 Introduce new action to switch to mils as a unit 2020-10-04 17:53:55 +01:00
Seth Hillbrand 8e515d0069 Standardize default hotkey refresh 2020-10-04 05:48:26 -07:00
Mikolaj Wielgus 400c15b8eb Add mils to units, remove useMils variables 2020-10-03 20:06:56 +00:00
Ian McInerney b69d396afc Turn the toolbar context menus into unique_ptr for easier management 2020-10-03 19:09:18 +01:00
Jon Evans 3b252c696d Make tool init order dependent on registration order
Previously, init order depended on the ordering of the
tool state map, which is opaque from the point of view of
registration.  This makes it challenging to make one tool's
init depend on another.  With this change, registration
order defines init order.
2020-10-02 18:42:41 -04:00
Seth Hillbrand 394b3b3a36 Use standard refresh icon in toolbar
Fixes https://gitlab.com/kicad/code/kicad/issues/5852
2020-10-02 12:01:33 -07:00
jean-pierre charras 8285110c2a more cleanup about removing useless include 2020-10-02 08:58:19 +02:00
Ian McInerney 8e7e1ffaaa Fix the mouse handling in the toolbar palettes
There were issues on OSX where the mouse being captured
by the parent toolbar would lead to seg faults, so release
the mouse on opening the palette.

Releasing the mouse then means that the mouse states become
confused, so we need to manually clear all the mouse states
when we open the popup.

Fixes https://gitlab.com/kicad/code/kicad/issues/5803
2020-09-28 00:42:47 +01:00
Ian McInerney 4ec46dabf8 Make the toolbar palettes open at a right angle to the toolbar
This opening is easier when using the drag-to-open system.
2020-09-27 23:20:17 +01:00
Ian McInerney 6dfe7b6eb0 Switch toolbar palettes to use AUI drag event
This isn't as much a hack as trying to detect it ourselves and
hope we don't clobber the internal toolbar workings.
2020-09-27 23:20:17 +01:00
Ian McInerney d5f781c7ca Allow dragging on the toolbar item to open a group 2020-09-27 02:22:22 +01:00
Ian McInerney df3018832b Fix toolbar palette location
This better aligns the first button in the palette with the
group button on the toolbar.
2020-09-27 01:58:41 +01:00
Ian McInerney fc565edb33 Add a palette to the toolbars to display groups of actions
This adds a palette to toolbar items that displays groups
of actions when long-pressed on a button.
2020-09-27 01:00:44 +01:00
Jeff Young f8875bc5a6 Move std::contains to alg::contains. 2020-09-26 14:42:40 +01:00
Jeff Young d7e80f8008 Add std::contains() to simplify a lot of code. 2020-09-26 12:40:32 +01:00
PJM d1322e7d1d Refactor GetDocumentExtents()
CHANGED: GetDocumentExtents() in 'eda_draw_frame.h' now has a bool
parameter "aIncludeAllVisible" with a default value "true" which makes
it behave as it did before adding parameter.  If "aIncludeAllVisible"
is false, the returned bbox ignores some items depending on which
program it is running in.

CHANGED: Made "Zoom to Objects" use only PCB edge in Pcbnew.  This
allows text, notes, etc outside the PCB edge to be excluded in the
zoom calculation.

CHANGED: Added "Zoom to Objects" to Pcbnew main menu, and to RMB context
menus for Eeschema and Pcbnew.

Fixes https://gitlab.com/kicad/code/kicad/issues/5787
2020-09-25 00:31:56 -07:00
Jon Evans 690575e2b6 Improve edit point legibility with a hover state 2020-09-23 21:27:23 -04:00
jean-pierre charras e64806cd20 Menus/Submenus: fix incorrect bitmap for checkable menuitems in submenus.
Windows specific, because other OS do not accept user bitmaps in ckeckable menuitems
the bug was due to the same bitmap was set for each state for these menuitems.

Fixes #5622
https://gitlab.com/kicad/code/kicad/issues/5622
2020-09-20 16:30:23 +02:00
Ian McInerney 89dcc46898 Coverity cleanup and remove unused variables 2020-09-20 02:20:41 +01:00
Jeff Young 1a988e8d85 Fix event processing bug which kept ModEdit's context menu from working. 2020-09-18 11:49:34 +01:00
Jeff Young 8dd725469f Process properties command locally within drawing tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/5612

Fixes https://gitlab.com/kicad/code/kicad/issues/5615
2020-09-17 22:32:22 +01:00
PJM abdd1906c2 Change 'Zoom to Fit' margins and add 'Zoom to Objects'
CHANGED: The margin used in 'Zoom to Fit' is now 2% instead of 10%.

ADDED: Added 'Zoom to Objects' to Eeschema which does not include
the page and border in the bbox calculations.

CHANGED: Removed pre-existing code that tweaked the center to account
for the scrollbars.  It actually made the view off center.  Removing it
results in perfectly centered zooms.

Fixes https://gitlab.com/kicad/code/kicad/issues/5145
2020-09-16 00:53:39 +00:00
Seth Hillbrand 4026904cc4 Make grid snapping depend on grid visibility
Turning the grid view on enables snapping to the grid.  Turning it off
removes the snap and allows free draw
2020-09-09 10:18:15 -07:00
Ian McInerney f28b60896c Allow toolbar items to cancel tools when pressed
There was a regression in v6 where the zoom to selection toolbar
item wasn't canceling the tool when pressed and the tool was active
(it was in v5). This implements a more generic framework for canceling
tools on button presses.

Fixes https://gitlab.com/kicad/code/kicad/issues/5103
2020-09-05 01:49:38 +01:00
Jeff Young 08dee31d9e Try and unify the background colors between panels and platforms.
Also moves to WX_GRID to get rid of some wxGrid bugs, and moves the
provision of attrs to the GRID_TABLE (as those applied to the grid
are ignored when a table is specified).

Fixes https://gitlab.com/kicad/code/kicad/issues/5260
2020-09-04 20:47:50 +01:00
Jeff Young 8d57136ad6 Fix bone-headed previous check-in. 2020-08-31 20:45:22 +01:00
Jeff Young 1f9aa2d198 Remove hotkeys for canvases.
Fixes https://gitlab.com/kicad/code/kicad/issues/4788
2020-08-31 20:34:24 +01:00
Jeff Young 2697fc3864 Remove canvas-switching from OSX.
The Cairo renderer doesn't work on Retina displays.

Fixes https://gitlab.com/kicad/code/kicad/issues/4788
2020-08-31 18:48:25 +01:00
Fabien Corona 4a0d6297ab pcbnew: Add an alternate edit method for arcs
The alternate edit methods keeps the radius constant

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5369
2020-08-29 22:59:11 +00:00
Seth Hillbrand 1e461c2259 ADDED: Improved center point dragging
The center point on polygons now maintains the axis of the dragged line
and, optionally with Ctrl pressed, maintains the slope of the adjacent
segments as well.

This also fixes a longstanding issue that prevented the ctrl-snapping
from using the original point rather than the last updated point when
constraining.

Fixes https://gitlab.com/kicad/code/kicad/issues/2465
2020-08-27 10:34:12 -07:00
Jeff Young 1138c32bf3 Don't pass Cancel event where there was a specific action cancelled.
For instance, if during a move the user hits ESC they only want the
move cancelled, not (for instance) the selection dropped.

Fixes https://gitlab.com/kicad/code/kicad/issues/5356
2020-08-25 12:54:40 +01:00
Jeff Young b8bbe72e48 Another attempt to fix the select-reference-point toolstack thing.
This time remove the push/pop from the picker tools as that's
responsible for the issue of trying to re-activate the move action
when its popped.  Instead do the push/pop from the client code
of other actions that need it, and not at all from the move-with-
reference action.

Fixes https://gitlab.com/kicad/code/kicad/issues/5336
2020-08-24 22:47:24 +01:00
Jeff Young a4ff339a1e Clear toolstack after cancel.
Fixes https://gitlab.com/kicad/code/kicad/issues/5336
2020-08-24 19:28:53 +01:00
Seth Hillbrand ffdf4deb59 Fix copy-pasta 2020-08-20 20:18:39 -07:00
Seth Hillbrand 7565a08396 eeschema: Add select all to schematic and library editor
Fixes https://gitlab.com/kicad/code/kicad/issues/2497
2020-08-20 16:07:10 -07:00
Seth Hillbrand 1e315bc3fe pcbnew: Add "Select All" Action to pcbnew and fpedit
Fixes https://gitlab.com/kicad/code/kicad/issues/2497
2020-08-20 16:07:10 -07:00
Wayne Stambaugh ede39780e2 Remove all debugging output that cannot be disabled.
The use of printf, wxLogDebug, and std::err/std::out causes excessive
debugging output which makes finding specific debugging messages more
difficult than it needs to be.

There is still some debugging output in test code that really needs to
be moved into a unit test.

Add debugging output section to the coding policy regarding debugging
output.
2020-08-18 10:17:36 -04:00
Marek Roszko a417da4ce0 Split selecteditemmodified to a selecteditemmoved to reduce updatemsgpanel spam 2020-08-18 13:11:47 +00:00
Ian McInerney 5955091eb3 Turn CONDITIONAL_MENU's conditions into only show/hide conditions
This leaves the decision to check/enable menu items to the main UI
conditions, and only the menu has control over showing/hiding the menu
items. Also rip out a special case for the preferenes item that isn't
needed on OSX anymore since all the main menus have been moved to
ACTION_MENUs now.
2020-08-17 23:40:02 +01:00
Ian McInerney dbe5537fa9 Don't run the hotkey if the action isn't enabled
CHANGED: Don't run the hotkey if the action's UI elements aren't enabled

This makes it so the action can't be run from either the hotkey or the
UI if its enabling conditions are not met.
2020-08-16 19:10:26 +00:00
Ian McInerney 4491f24d5e Ripout the old SyncToolbars infrastructure reminants
The tool framework no longer needs to request updates of the UI
state for the controls, wxWidgets will do it for us.
2020-08-16 19:10:26 +00:00
Ian McInerney e8b11c911e Migrate Pcbnew/footprint viewer/footprint editor to the new UI update system 2020-08-16 19:10:26 +00:00
Ian McInerney fd4388710d Migrate eeschema, libview and libedit to the UI condition framework
Also, fix some issues in other frames identified along the way.
2020-08-16 19:10:25 +00:00
Ian McInerney 3b05d7cddd Move more frames to the new UI condition framework
* Frames moved: cvpcb, cvpcb footprints frame, gerbview, pagelayout editor

This also introduces new EDITOR_CONDITIONS that are used to set the
conditions of very common editor settings.

Also, some IDs were converted to tools in the pagelayout editor.
2020-08-16 19:10:25 +00:00
Ian McInerney 72a1c71e07 Implement a framework to handle wxUpdateUIEvents for tool actions
This allows for the tool framework to keep track of a universal
set of conditions for the UI state (enabled/checked/shown) for
controls of actions. It removes the need for the main menubar
menus to be CONDITIONAL_MENUs and be rebuilt on each open,
and instead makes the updates of the check and enabling of
items handled in the native wxWidgets way.

This commit switchs the 3d viewer and kicad project manager window
over to this system.
2020-08-16 19:10:25 +00:00
Ian McInerney d19ff3e595 Unify the UI IDs for actions between the menus and toolbars
By unifying the IDs so that an action only has one UI ID,
it will receive only one update event that will work for
all controls using the action.
2020-08-16 19:10:24 +00:00
jean-pierre charras 98b1f55e29 Eeschema: minor fixes: fix incorrect label in DIALOG_LIB_EDIT_PIN, electrical pin list.
Gives also to functions GetText() and GetBitmap() a more significant name.

Fixes #5007
https://gitlab.com/kicad/code/kicad/issues/5007
2020-07-29 17:04:52 +02:00
Mark Roszko 7bdb98f961 libedit: Make context menu follow context 2020-07-26 20:16:38 +00:00
Ian McInerney 50b2271f84 Fix missing variable initialization 2020-07-18 23:56:39 +01:00
Jeff Young 3fd0a3f842 Update text variables even when they're changed from other binary.
For instance, you might have PCBNew open but change the variable
value through EEschema > Schematic Setup.

Fixes https://gitlab.com/kicad/code/kicad/issues/4918
2020-07-17 21:05:11 +01:00
Jeff Young e9da02e2d5 Only reserve hotkeys for focused textCtrls that are editabled.
Otherwise just send Ctrl-C to the disabled control, and everything
else to the tool framework.

Fixes https://gitlab.com/kicad/code/kicad/issues/4801
2020-07-14 13:30:43 +01:00
Jeff Young 940570e9ec Catch exception so that we at least throw up an error message.
Fixes https://gitlab.com/kicad/code/kicad/issues/4677
2020-07-13 22:41:56 +01:00
Jon Evans 5d118b0700 More visibility settings infrastructure
ADDED: Three-state high contrast mode action
ADDED: Save contrast mode in local settings

Also some initial infrastructure for layer presets
2020-07-11 21:59:07 -04:00
jean-pierre charras 3993181de5 D_PAD::BuildEffectiveShapes(): fix incorrect rect shape size for rect pads
rotated by +-90 deg
Noticeable in PnS router.

Fixes #4771
https://gitlab.com/kicad/code/kicad/issues/4771
2020-07-01 16:06:31 +02:00
Ian McInerney fb10406e67 Add right-click context menus for toolbar items 2020-06-26 21:29:03 +00:00
Ian McInerney 52856a8ce4 Move scaled toolbar separator into ACTION_TOOLBAR
* Ensure all separators are scaled separators
* Clean up toolbar creation functions
2020-06-26 21:29:03 +00:00
Jeff Young 5ee806c3a3 The dispatch-behind & whitelist stuff got broken again, so I've
retired them in favour of a much dumber hack that special-cases
only ctrl-U for units switch.
2020-06-24 12:22:42 +01:00
Jeff Young 18ab3c4714 Fix missing user grid in COMMON_TOOLS.
Fixes https://gitlab.com/kicad/code/kicad/issues/4702
2020-06-23 11:17:15 +01:00
Jon Evans 713cd4a47a Point editor: show dragged points with a highlight
Take points editor colors from color theme

Also fix an issue where the edited object sometimes didn't
update when a point is dragged.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4600
2020-06-21 14:43:41 -04:00
Jeff Young a1332d76fe Remove SHAPE_EDITOR frame types before we forget about them.
They may go back at some point, or they may not....
2020-06-19 14:10:41 +01:00
Jeff Young cae493fe65 More infrastructure work for shape editor. 2020-06-18 15:38:01 +01:00
Jeff Young 754f958be2 Attempt to fix duplicate ID issue on MSW. 2020-06-17 18:44:39 +01:00
jean-pierre charras 5db2b6ed8d Action menu: ensure a wxEVT_COMMAND_MENU_SELECTED event is sent to the menu,
when a wxTextCtrl has the focus but is read only, and cannot use a CHAR event.
It fixes an issue in Kicad manager (menus with accelerator not working) when
the wxTextCtrl window showing messages has the focus.
2020-06-17 12:00:34 +02:00
Jon Evans 0dd34d197e Ensure currentGrid is valid on startup
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4666
2020-06-16 19:59:00 -04:00
Seth Hillbrand a18aea3a43 Fix signed/unsigned comparison 2020-06-15 12:40:02 -07:00
Jeff Young ad12c42e8b Push grid settings dialogs down into common.
This also gives support for fast grid switching and a user grid
to eeschema.

Fixes https://gitlab.com/kicad/code/kicad/issues/2200
2020-06-14 19:26:37 +01:00
Jeff Young 998fe12a5a Make sure COMMON_TOOLS initializes the grid. 2020-06-13 22:44:16 +01:00
Jeff Young c48f4272f3 Collapse a level out of the zoom settings.
The APP_SETTINGS_BASE now holds the list of zoom factors, and
the old legacy (screen-based) code has been removed.
2020-06-13 22:44:16 +01:00
Seth Hillbrand a02d8a5993 Fix a number of signed/unsigned comparisons 2020-06-13 11:55:59 -07:00
Jeff Young f84406009b Push a couple of layers of indirection out of grid settings. 2020-06-13 11:35:56 +01:00
Ian McInerney 4357c1d3b3 Coverity and compiler warning fixes
* Initialize variables
* Test dynamic casts

Fixes https://gitlab.com/kicad/code/kicad/issues/4620
2020-06-05 12:50:56 +01:00
Jeff Young b274b9f972 Fix type-checking which was too tight.
Also fixes a typo leaving the return statement in the wrong place.

Fixes https://gitlab.com/kicad/code/kicad/issues/4611
2020-06-04 22:35:01 +01:00
Johannes Pfister 8e8979e317 Fixed a memory leak in CONDITIONAL_MENU
CONDITIONAL_MENU::ENTRY now owns the wxItem object.
2020-06-04 19:08:59 +00:00
Jeff Young 0741bbb1b9 Move autocomplete to the remove filtered items paradigm.
Fixes https://gitlab.com/kicad/code/kicad/issues/4190
2020-05-30 20:09:09 +01:00
Jeff Young 449c90a0ae Some more work on getting wxWidgets to stop stealing textEntry keys.
Fixes https://gitlab.com/kicad/code/kicad/issues/1941
2020-05-30 12:32:33 +01:00
Jon Evans fbef52ec33 Don't process hotkeys on text entries
Thanks @jeffyoung for the suggestion

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4463
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1941
2020-05-29 21:20:44 -04:00
Jeff Young 112316cdfb Fixup kiway by hand when dynamic_cast fails.
Also allows a shortened version of Configure Paths without the 3D
paths when Pcbnew isn't already running.

Fixes https://gitlab.com/kicad/code/kicad/issues/4568
2020-05-29 22:06:48 +01:00
Jon Evans 695cdbbde8 Move bug reporting to COMMON_CONTROL; add to Help menu
Also make a shorter version of the version info string
and some other shortening edits to the issue template
to fix occasional 500 errors thrown by Cloudflare due
to excessively long URLs

Fixes https://gitlab.com/kicad/code/kicad/-/issues/3953
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4272
2020-05-26 21:18:32 -04:00