Commit Graph

70 Commits

Author SHA1 Message Date
Jeff Young 9edfd25b95 Select best-matching component when filtering.
This also fixes the old bug of scrolling to the selected best
match.

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

Fixes: lp:1744703
* https://bugs.launchpad.net/kicad/+bug/1744703
2018-06-10 23:21:05 +01:00
Jeff Young b9874da3a6 Remove background fp loading from Choose Symbol dlg.
There are a bunch of problems with event processing and closing
documents, etc., when enabled.  See the bug report for more
info.

Fixes: lp:1774777
* https://bugs.launchpad.net/kicad/+bug/1774777
2018-06-09 00:51:39 +01:00
Maciej Suminski 64e98c8e54 Fixed Symbol Library editor crash on start
Added a null pointer check missing in 51c7381f

Fixes: lp:1775414
* https://bugs.launchpad.net/kicad/+bug/1775414
2018-06-06 17:01:06 +02:00
Maciej Suminski 51c7381fd5 Fix Choose Symbol dialog freezes in eeschema
Scrollbars are always enabled to prevent an infinite event loop caused
by alternating CreateLayout() and OnSize event handler.
More details: http://trac.wxwidgets.org/ticket/18141

Fixes: lp:1767848
* https://bugs.launchpad.net/kicad/+bug/1767848
2018-06-06 09:11:15 +02:00
jean-pierre charras a288d6199e Add KI_PARAM_ERROR, similar to std::invalid_argument but using wxString instead of std::string to throw errors.
std::invalid_argument does not work fine with translated strings as argument for message.
(the translated message is incorrectly or not displayed if it contains non ascii8 chars, at least on Windows).
KI_PARAM_ERROR can be throw-ed with a translatable/translated string (a wxString)
2018-06-05 13:29:51 +02:00
Maciej Suminski 539d12b08f Spice simulator: more elegant approach to generating Spice device names
Code fixing Spice device names (prefixing reference with a character
corresponding to the assigned device model type) that was duplicated in
a few places has been moved to a function (NETLIST_EXPORTER_PSPICE::GetSpiceDevice()).
2018-04-28 01:14:00 +02:00
Maciej Suminski 50588dcd1e Fix disabled 'save library' button in the symbol editor
With uninitialized COMPONENT_TREE::m_menuActive there were cases when
application logic erroneously decided to fetch the current library name
from the right click menu selection, even though there was no menu
opened, so an empty string was returned. Empty library name is
equivalent to no library loaded, therefore the save button appeared
disabled.

Fixes: lp:1765937
* https://bugs.launchpad.net/kicad/+bug/1765937
2018-04-23 15:29:26 +02:00
Simon Richter 7e47ef7471 Fix warnings for unreferenced local variables 2018-04-18 15:08:37 -04:00
Jeff Young e7d98f89a1 Fix display of datasheet URLs and shorten them if necessary.
Fixes: lp:1676174
* https://bugs.launchpad.net/kicad/+bug/1676174
2018-02-15 22:01:35 +01:00
jean-pierre charras 8022f1cc01 fix code after renamin files 2018-01-30 11:49:51 +01:00
Maciej Suminski 2d3ef0fa6e Symbol Editor: Remove a redundant separator from symbol context menu 2018-01-23 12:19:19 +01:00
Jeff Young 2201482e47 Add '*' to modified files in libedit cmptree, and change highlighting.
The highlight colour on some platforms (OSX, for instance)
renders nearly invisible against a white background.  However,
wxWidgets doesn't handle background colours on OSX and GTK+.
A separate commit to the new kicad/wxWidgets fork fixes OSX,
and we continue to use the old highlighting on GTK+

Fixes: lp:1741719
* https://bugs.launchpad.net/kicad/+bug/1741719
2018-01-22 10:37:06 +01:00
Maciej Suminski 8721f7ed70 Changed remaining occurences of 'part' to 'symbol' in the symbol editor 2018-01-18 11:24:02 +01:00
Maciej Suminski 8c42abc10c Symbol Library Editor: fix crash after renaming a symbol
Crash was caused by removal of the selected item from the
wxDataViewModel, which was later accessed in
COMPONENT_TREE::GetSelectedLibId(). To avoid the problem, the selection
is validated before regenerating the tree widget.

Fixes: lp:1740952
* https://bugs.launchpad.net/kicad/+bug/1740952
2018-01-10 08:52:17 +01:00
jean-pierre charras 504e7a4a51 Very minor fix in a menuitem label 2018-01-07 16:31:15 +01:00
jean-pierre charras 20e66253bb symbol editor: add icons in popup menus of the symbol tree list. 2018-01-07 13:18:18 +01:00
Chris Pavlina 917804ef12 Make eeschema color select widget DPI-independent 2018-01-06 17:29:07 -07:00
Chris Pavlina 13bc706518 Fix several dialogs with bad default sizing
- Add helper methods for DPI-independent sizes
- Make splitter sashes visible on macOS
- Remove SetSizeInChars() - wx has a built-in way that I missed
- DIALOG_CHOOSE_COMPONENT: DPI-indep splitter sizes
- DIALOG_RESCUE_EACH: DPI-indep default size and sensible HTML window
  size
- COMPONENT_TREE: DPI-indep sizing
- DIALOG_FP_LIB_TABLE, DIALOG_SYMBOL_LIB_TABLE
2018-01-06 14:39:17 -07:00
Chris Pavlina 0945c319f0 eeschema: make footprint preview optional
The footprint preview and selection has been problematic for some users;
I'd rather option it out for 5.0 and work on polishing it for 6.0.
2018-01-03 18:28:44 -07:00
Maciej Suminski 7f9876ec27 Fix lexical sort in component tree widget on Windows
Apparently explicitly requesting a column to be sorted breaks component
filtering on Windows. Without SetSortOrder() call the list is sorted and
filtering still works as expected.

Fixes: lp:1739412
* https://bugs.launchpad.net/kicad/+bug/1739412
2017-12-20 14:50:36 +01:00
Maciej Suminski 320fa7120d Expand/collapse library nodes with Enter key in component chooser 2017-12-20 12:25:12 +01:00
Maciej Suminski 5fac73fc21 Fixed browsing order with arrow keys in component chooser on Windows
As Windows displays the component list in inverted order, the direction
of scrolling had to be reversed as well.
2017-12-20 12:23:05 +01:00
Maciej Suminski 6344e238b3 Fix random node selection in symbol library editor on Windows
Selecting a node while wxDataViewCtrl is frozen selects a random node on
Windows.

Fixes: lp:1739202
* https://bugs.launchpad.net/kicad/+bug/1739202
2017-12-20 12:06:21 +01:00
Maciej Suminski 017fc4da8f Fixed capitalization and accelerators in Symbol Library Editor
Menu item labels follow the KiCad UI guideline.
Removed an accelerator conflict for 'Place' and 'Part' menus.
2017-12-19 12:21:07 +01:00
jean-pierre charras 33c2d6e4ba Fixed disappearing components in COMPONENT_TREE in library editor
The reason the component tree widget was cleared on Windows is the fact
m_adapter->UpdateSearchString( m_query_ctrl->GetLineText( 0 ) ) is
called on any change of the symbol. But if m_query_ctrl is empty,
m_query_ctrl->GetLineText( 0 ) returns the "hint" (currently the word
"Search") not the actual value, so there is no "candidate" symbol in
list. Using m_query_ctrl->GetValue() returns the actual value and fixes
this issue.

Fixes: lp:1737132
* https://bugs.launchpad.net/kicad/+bug/1737132
2017-12-13 10:34:14 +01:00
Maciej Suminski aedf24d944 Fix crash when renaming a component in symbol library editor
COMPONENT_TREE::STATE used wxDataViewItem to store the selection, but it
will point to a deleted object if the selection was removed. Switched to
storing the selection using LIB_ID as it is much safer to use.
2017-12-11 11:22:24 +01:00
Maciej Suminski 45bf919923 Restoring the previous performance of COMPONENT_TREE widget
It turns out the fastest way to update wxDataViewCtrl is to nuke the
model and rebuild it from scratch rather than via
ItemAdded()/ItemDeleted() update notifications.

Fixes: lp:1734773
* https://bugs.launchpad.net/kicad/+bug/1734773
2017-12-04 10:42:37 +01:00
Maciej Suminski 6b74f8ef48 Library Editor: fixed an assert after removing libraries with Symbol Library Table dialog 2017-11-22 14:15:51 +01:00
Maciej Suminski 8b0041bf9a Library Editor: progress dialog when loading libraries 2017-11-22 13:40:14 +01:00
Maciej Suminski e25a1feb25 Component Tree: restore expanded nodes after search query is cancelled 2017-11-21 23:18:55 +01:00
Maciej Suminski ed059383c7 Library Editor: removed library actions from the part context menu 2017-11-21 23:18:55 +01:00
Maciej Suminski 891cf783fb Library Editor: Windows fixes 2017-11-21 23:18:55 +01:00
Maciej Suminski 95754632c2 Library Editor: renamed 'component' to 'part' 2017-11-21 23:18:55 +01:00
Maciej Suminski ba4515885b Library Editor: select part in the widget component on create/paste/duplicate component 2017-11-21 23:18:55 +01:00
Tomasz Włostowski 7fc1e1d53c Library Editor: component cut/copy/paste/duplicate 2017-11-21 23:18:55 +01:00
Maciej Suminski a789b735e9 Library Manager: logic 2017-11-21 23:18:55 +01:00
Maciej Suminski 0d190639f1 Extracted CMP_TREE_MODEL_ADAPTER_BASE class 2017-11-21 23:18:55 +01:00
Maciej Suminski 3288a5f8b8 Right-click context menus for COMPONENT_TREE widget 2017-11-21 23:18:55 +01:00
Maciej Suminski 3bdcdd808b Fix minor warnings 2017-11-21 23:18:55 +01:00
Wayne Stambaugh 329fc18732 Convert component chooser dialog over to use symbol library table.
Change all of the component tree helper objects to use LIB_IDs instead of
LIB_ALIAS pointers.  LIB_ALIAS pointers are dangerous to use because they
can be deleted in the symbol library editor while the component chooser
dialog has copies of them.  With LIB_IDs, the LIB_ALIAS pointer is found
on demand and can be guaranteed to be valid.

Update the chooser dialog to load the symbol library table instead of the
libraries defined in the project file and return a LIB_ID instead of a
LIB_ALIAS pointer.

Modify SCH_BASE_FRAME::SelectComponentFromLibrary() to handle the LIB_IDs
returned from the component chooser dialog.
2017-11-09 18:50:18 -05:00
Chris Pavlina a20cce0753 Show component history at the top and preselect it
This was the behavior before the factoring out of COMPONENT_TREE. Moving
the history at the top just required inserting it at the right point;
fixing preselect involved wxEVT_INIT_DIALOG not propagating to the
panel. Simple solution was to move the parts of that event handler to
the constructor as they didn't have to be in an event handler anyway.

Fixes: lp:1707538
* https://bugs.launchpad.net/kicad/+bug/1707538
2017-08-19 00:41:21 -06:00
jean-pierre charras 4e96f9990d Use the new color4Dpicker to choose a color in Eeschema.
However, the opacity is not modifiable because the wxDC used in Eeschema does not know the alpha channel.
2017-08-06 10:42:11 +02:00
jean-pierre charras 895c0bb716 Fix a compil warning and a wxASSERT in netlist dialog and component_tree.cpp 2017-07-08 15:58:22 +02:00
Maciej Suminski ac688e688a Fixed selecting components with Enter (DIALOG_CHOOSE_COMPONENT)
Added dedicated event types: COMPONENT_SELECTED, COMPONENT_PRESELECTED.
2017-06-25 23:13:39 +02:00
Maciej Suminski 6733101c6f Flags to select additional widgets for COMPONENT_TREE 2017-06-19 14:48:54 +02:00
Maciej Suminski f667f54c52 Moved component tree widget to a separate class 2017-06-19 14:48:53 +02:00
Jon Evans 3ec28e2acf Refactor layer enumerations to all live in the same place 2017-03-30 16:01:48 -04:00
jean-pierre charras 6b431b4791 Fix transaltion issue.
Rebuild dialog_display_options_base with a recent wxFormbuilder version.
2017-02-26 13:03:38 +01:00
jean-pierre charras 6ae7c15d89 Rework on pcbnew menubar: make code more easy to read and modify. 2017-02-24 20:51:49 +01:00
Maciej Suminski 0dc88bb4cf Changed COLOR4D defines to static consts 2017-02-22 17:35:00 +01:00