Commit Graph

44 Commits

Author SHA1 Message Date
Jeff Young fbb807f3bb Move some more menu & toolbar items to modern toolset. 2019-05-16 19:57:06 +01:00
Jeff Young 69afa27a5f Implement ACTION_TOOLBAR and update some of the menus to ACTION_MENU.
This gives us better separation of MVC in line with the design of
the modern toolset.  It also reduces a whole bunch of duplicated
data.
2019-05-15 17:50:52 +01:00
Jeff Young ea0941cab3 Implement modern tools for LibEdit. 2019-05-10 16:11:57 +01:00
Jeff Young 1c8461bec7 Transition mirroring to modern toolset. 2019-05-05 17:12:59 +01:00
Jeff Young f200c61897 Start transitioning block operations to modern toolset. 2019-05-05 17:12:59 +01:00
Jeff Young 2e8d930250 Fix merge issue.
Some legacy_gal code leaked into legacy_wx.

Fixes: lp:1827270
* https://bugs.launchpad.net/kicad/+bug/1827270
2019-05-03 00:11:38 +01:00
John Beard e687d14903 Remove useless const_casts
Both versions of EDA_DRAW_FRAME::isBusy have a useless const_cast.

GetScreen() const returns a non-const SCH_SCREEN already, it doesn't
need to be cast, and it's stored in const SCH_SCREEN anyway.
2019-04-24 09:46:01 +01:00
Jeff Young a461eae8b9 Fix 100s of usages of GetFlags() which conflated != 0 with being edited.
While this was true long ago, many flags have been added since which
have nothing to do with editing (HIGHLIGHTED, BEGIN_ONPAD, etc.)
2019-04-22 09:58:06 +01:00
Jeff Young 94a948fdd1 Move grid selection for both Eeschema and Pcbnew to COMMON_TOOLS. 2019-04-13 18:43:35 +01:00
Jeff Young fc7f5630c7 Move eeschema zoom operations to modern toolset. 2019-04-13 18:43:26 +01:00
John Beard ab2281d26f 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
2019-04-12 16:08:11 +01:00
Jeff Young 2aad4a5e57 Remove dead code from removal of eeschema legacy canvas. 2019-04-05 15:54:31 +01:00
John Beard 567bdd9b9d 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
2019-03-25 15:00:55 +00:00
jean-pierre charras ec59361f75 Fix a few coverity errors 2019-02-16 14:09:21 +01:00
Jeff Young b6a06aa129 Improve default canvas handling.
Fixes: lp:1813973
* https://bugs.launchpad.net/kicad/+bug/1813973
2019-01-31 19:43:31 +00:00
Seth Hillbrand 9d99fd188f Revert "Change top selection drop-down to combobox"
This reverts commit 7d06651a10.
2019-01-28 10:15:32 -08:00
Seth Hillbrand 823dce1a50 modedit: Allow name input for new footprint library
When prompting for a new footprint library, we need to treat the input
as a file for creation rather than a directory for selection.
Otherwise, users cannot specify the name of their new footprint library
independently of the existing directory names.

Fixes: lp:1812135
* https://bugs.launchpad.net/kicad/+bug/1812135
2019-01-22 15:40:10 -08:00
jean-pierre charras cdadb48d84 Fix incorrect #ifdef definition
Fixes: lp:1811906
https://bugs.launchpad.net/kicad/+bug/1811906
2019-01-16 17:39:47 +01:00
jean-pierre charras 644855c5ba Fix incorrect (broken) canvas type saving in config.
The config was saving a canvas type EDA_DRAW_FRAME member not always accurately initialized.
And the last canvas opened frame setup was saved, not necessary a frame having a canvas type that can be set by user.
This is a broken feature especially because the footprint viewer has a fixed canvas setting.
2019-01-11 13:19:46 +01:00
Seth Hillbrand fe30460aeb gal: Save canvas type unconditionally
The canvas type might change without the frame being notified.  If this
happens, the user is presented with repeated notifications of OpenGL
issues.  Howver, switching canvas is not an error and should be
presented to the user as an info message to clarify that the system is
still working but it has changed how it renders the screen.

Fixes: lp:1795240
* https://bugs.launchpad.net/kicad/+bug/1795240
2019-01-09 10:36:01 -08:00
Seth Hillbrand 1e5ba6f1b1 Replace DIM() macro
The standard DIM() macro was not typesafe as it happily deferred errors
to runtime that can be caught at compile time.  Replacing it with a
generic C++11 constexpr allows for typecasting, comparison and compile
time error checking.
2019-01-06 08:43:12 -08:00
Seth Hillbrand e8333633fe GAL: Add antialiasing options to Cairo
Cairo supports antialiasing when rendering but can be slow when set to
sub-pixel mode.  This bumps the minimum version of Cairo to 1.12
(available in 14.04 LTS as well as mingw) to support three antialias
settings (fast, good, best) that offer speed/appearance tradeoffs.

This can provide a higher-quality eeschema render as it works on a
per-element basis as opposed to the OpenGL per-screen antialias.
2019-01-04 13:39:56 -08:00
John Beard b743c39ed8 On start without config, start pcbnew in Cairo GAL
Currently, GAL is initialised to NONE (i.e. off). This causes
issues when Legacy canvas is broken (i.e. GTK3).

This changes the default to GAL Cairo, both in PCB_EDIT_FRAME
init, and in the config load.

Now, when the user starts with no config, they are prompted for
a choice: OpenGL or Cairo, and one of them will be set up, with
Cairo as fall back.

Users on platforms that still support legacy can go to it as normal
from the menu, but it will not be the default in any circumstance.

Fixes: lp:1809997
* https://bugs.launchpad.net/kicad/+bug/1809997
2019-01-04 15:22:34 -05:00
Seth Hillbrand 7d06651a10 Change top selection drop-down to combobox
wxChoice centers the selection on GTK.  So when switching from a
mid-list item to an item at the top, the list is always cut off for
choice lists located on the top toolbar.  Using a combobox provides a
drop-down that allows easier access to all elements in the box.

Fixes: lp:1808569
* https://bugs.launchpad.net/kicad/+bug/1808569
2019-01-03 14:48:28 -08:00
John Beard e856a7a09c Disable legacy canvas on GTK3
This make the use of legacy canvas on GTK3 a default-off
advanced config. Legacy is substantially broken on GTK3
and is of basically no use at all to general users on this
platform.

If the program starts with legacy canvas in the config,
it is forced into a GAL mode, as otherwise it could happen
that the user is stuck and unable to get into pcbnew to change
the setting.

Fixes: lp:1803156
* https://bugs.launchpad.net/kicad/+bug/1803156
2018-12-28 11:36:09 -05:00
jean-pierre charras 15843ae01a class MARKER rework: fix a few minor issues, remove duplicate code and add comments. 2018-12-19 15:13:31 +01:00
Maciej Suminski 63d4afb3ee Support autopanning in GALified eeschema
Fixes: lp:1807234
* https://bugs.launchpad.net/kicad/+bug/1807234
2018-12-11 17:49:34 +01:00
Jeff Young 82f657ed03 Replace some accidentally deleted code.
Fixes: lp:1804526
* https://bugs.launchpad.net/kicad/+bug/1804526
2018-11-22 01:10:18 +00:00
jean-pierre charras 2fdf13ab79 Fix minor compil warnings. 2018-11-18 10:12:34 +01:00
Jeff Young 0de9cb345c Add shortcuts to setting dialogs for track widths, via sizes and grid sizes.
Fixes: lp:1803671
* https://bugs.launchpad.net/kicad/+bug/1803671
2018-11-17 00:35:06 +00:00
jean-pierre charras f90ca7408d Legacy canvas: fix missing code to draw block outline.
Due to recent changes in legacy canvas code, when starting a block command,
the block outline was not drawn in pcbnew and pl_editor during block definition.

Fixes: lp:1803668
https://bugs.launchpad.net/kicad/+bug/1803668
2018-11-16 21:03:04 +01:00
Jeff Young 4050991d28 Move ERC marker focusing to GAL architecture.
Fixes: lp:1802537
* https://bugs.launchpad.net/kicad/+bug/1802537
2018-11-16 10:38:44 +00:00
Wayne Stambaugh f1f4473d8b Footprint editor: add save view to PNG file.
Factor out save current canvas view to image file code from symbol editor
code so it can be used anywhere.

Add ability to save to any image format supported by wxBitmapType.  See
https://docs.wxwidgets.org/3.0/gdicmn_8h.html#a90a1eb6d85b5044a99b706fd979f27f5.
Currently only PNG output is implemented.

Please note that there is a minor bug that appears to be due to the
scroll bars which causes unfilled areas on the right and bottom edges
of the image.  This always existed in the save symbol editor view
image but it was not as noticeable because by default the background
color is white.  It is very noticeable in the footprint editor with
a black background.

The usual smattering of coding policy and comment fixes.

Fixes lp:1802127

https://bugs.launchpad.net/kicad/+bug/1802127
2018-11-09 08:32:36 -05:00
Jeff Young 589e1f6a96 MSW and GTK need a separate dialog for opening/saving directories.
Fixes: lp:1801528
* https://bugs.launchpad.net/kicad/+bug/1801528
2018-11-04 12:35:01 +00:00
Jeff Young 3bfd32cdc5 Inherit grid settings from PCBNew.
Fixes: lp:1801428
* https://bugs.launchpad.net/kicad/+bug/1801428
2018-11-04 12:35:01 +00:00
Maciej Suminski 64da77538f Fix bitmap scale in printouts
Display GALs had an incorrect world unit value set. Now the world unit
value says how many internal units are in an inch, in accord with the comments
in the GAL header. Bitmap drawing code relied on the information about DPI,
so scaling worked differently for display and print GALs.
2018-10-31 19:17:30 +01:00
Jeff Young 2d5baac77d Fix up zoom and pan issues entering/leaving sheets. 2018-10-09 11:08:56 +01:00
Jeff Young 6f89b41f18 Cleanup. 2018-10-09 11:08:56 +01:00
Jeff Young 3c82ad3220 Finish up the block rotate/mirror fixes.
Block rotate and mirror now work like they do in Pcbnew (that is
they're treated as part of the block move/duplicate/whatever
rather than finishing it).

Fixes: lp:1780794
* https://bugs.launchpad.net/kicad/+bug/1780794
2018-10-09 11:08:55 +01:00
Jeff Young 7216eda202 Fix bugs in block operations.
1) when duplicating don’t keep original hidden until end of drag
2) reset selectionArea when showing it so it doesn’t flash in its previous location
3) center a pasted block on the cursor
4) don’t draw the source selectionArea when pasting a block
5) implement selection-style highlighting for contents of blocks
6) add pasted items to view so they don’t disappear when the block is placed

Fixes: lp:1747197
* https://bugs.launchpad.net/kicad/+bug/1747197
2018-10-09 11:08:55 +01:00
Jeff Young cb8e6c0df5 Handle GAL view refresh for breaking wires. 2018-10-09 11:08:55 +01:00
Jeff Young afeebc8944 Grid settings for Eeschema GAL.
Split antialiasing options out from display options.  Move
antialiasing to common.  Duplicate the rest of display options
for Eeschema.

Implement OnSelectGrid and hookup GAL canvas refresh to
SetPresetGrid.

Add Grid Settings... to View menu and move Show Grid from
preferences to View Menu to match Pcbnew.
2018-10-09 11:08:55 +01:00
Jeff Young da4fb4ae3a Move galDisplayOptions access from pcbnew to common. 2018-10-09 11:08:55 +01:00
Tomasz Wlostowski 838458bc3a eeschema-gal: Base refactoring before GALification of the eeschema legacy canvas.
Note: it's only the renderer that is changed from wxDC to GAL. Tools stay the same, consider this a temporary hack.

This commit splits the EDA_DRAW_FRAME, EDA_DRAW_PANEL and BLOCK_SELECTOR classes into two variants, each independently compiled into a static library.
- "legacy_wx" for PCBnew/Gerbview - wxDC-based legacy canvas. We have full GAL support there anyway so it makes no sense to introduce GAL rendering API to the legacy tools.
- "legacy_gal" for EEschema and the rest - GAL-based legacy canvas, using legacy tools but with a GAL renderer.
Such split ensures only a small part of the common library and eeschema is affected, without messing around with already GALified tools.

The commit also removes some header dependencies on class_drawpanel.h
2018-10-09 11:08:52 +01:00