Commit Graph

77 Commits

Author SHA1 Message Date
jean-pierre charras fde2cfee27 Minor changes: remove a few local shadowed local variables detected using " -Wshadow" gcc compil option ( No bug, just a better code readability ) and fix minor coding style issues. 2016-04-18 20:15:44 +02:00
jean-pierre charras 99d18faca9 Change the way main editor frames are managed by Kicad: before this change, they had the Kicad manager frame as parent frame, and it creates a few issues:
- When the Kicad manager is iconized, all other child frames are iconized (normal wxWidgets behavior)
- For viewer frames in modal mode, there is a more annoying issue: they have the wxFLOAT_ON_PARENT frame style on unix, and wxSTAY_ON_TOP on Windows.
wxFLOAT_ON_PARENT frame style is incorrect (although on most WM it works) because the parent frame (Kicad manager Frame) is not the caller. It is usually a main editor frame.
It does not work on Windows (wx STAY_ON_TOP is used).
* Now each editor frame has a null parent.
Therefore iconizing the Kicad manager frame does not iconize other frames.
* Viewer frames have null parent in normal mode and the caller parent in modal mode (therefore wxFLOAT_ON_PARENT frame style is always and correctly used)
* References to opened/closed main frames are no more managed by the (complicated) kicad code. Instead of, a non critical and more easy to understand code just uses FindWindowByName to know if a main window exists or not.

These changes do not fix all issues about Kicad frames brought to the foreground or the background, but it fixes a few issues, and AFAIK do not add other issues.
2016-03-21 17:36:06 +01:00
Chris Pavlina c490e7dd06 Fix typing problems with GR_KB_* constants 2016-01-20 07:11:17 -05:00
jean-pierre charras 6ff0092e21 Github plugin: fix lack of message when trying to download a non existing footprint library (Curl does not return an error: the message "Not Fount" is stored in buffer, and the zip handler returns a not suitable error message)
Minor and very minor other fixes.
2015-12-30 08:46:32 +01:00
jean-pierre charras 59d02cf1a4 Minor fixes:
* fix minor coding style issues.
* remove unused member in modview_frame.
* use different frame names in ctor of modview_frame and viewlib_frame depending on the fact they are built modal or not modal (allowing identifications when calling wxFindWindowByName)
* change questionnable code in  class_libentry.cpp.
* remove unused code in class_treeproject_item.cpp
2015-12-22 12:58:26 +01:00
unknown 0ea1c67caf eeschema plot dialog: cosmetic enhancement:
Including the inline of the Output directory and its text field/browse button.
Moving the plot format to the left of the plot options as the plot options depend on the plot format.
2015-12-21 16:08:37 +01:00
jean-pierre charras a11bbffe9b Code reorganization, and change the way 3D viewer frame is managed (now using wxWidgets wxWindow::FindWindowByName() to know if it is existing) , to prepare others fixes. 2015-12-21 12:52:00 +01:00
unknown 1ee7458140 1. Fixed copy paste error in append_board_to_current.cpp ruining a if else condition, should fix a possible bounding box computation bug
2. Whole bunch of pointless casts removed
3. Unused variables removed
4. Fix bug caused by JP on April 25, 2015 where strings were adjusted for translation and the hotkeys section table accidentally swapped the footprint editor title with tag, resulting in "footprint editor" being exported instead of "[footprinteditor]"
No functional changes besides #4, technically it'll "break" imports hotkeys files but April 25 broke imports as well.
2015-11-04 09:48:34 +01:00
jean-pierre charras a112a33fa2 Fix Bug #1498252 (segfault + assert failed in Yield(): wxYield called recursively) and a few other issues (footprint viewer or 3D viewer not always raised in some cases). Linux specific 2015-10-06 08:23:05 +02:00
jean-pierre charras f7f7e3e918 Remove useless or not working code used in Load/Save config. 2015-08-31 08:43:33 +02:00
Maciej Suminski 1d6fc920e6 Simplified code for switching canvases.
Moved SwitchCanvas() to PCB_BASE_FRAME and made it common for all subclasses.
More code from UseGalCanvas() is shared between classes.
2015-08-07 19:15:36 +02:00
jean-pierre charras 2ee222e3bc Fix issues on Linux/Unity (dialogs not always raised) 2015-07-15 14:41:30 +02:00
jean-pierre charras ac1deb32ee Fix issues on Linux/Unity (dialogs not always raised) 2015-07-15 10:18:48 +02:00
jean-pierre charras bf2f480b7c Dialog exchange modules: add a fp selection from the fp viewer
Fix also an issue on Windows, when using the footprint viewer or the component viewer in modal mode:
Reason: these frames (when run under the Kicad manager) have the Kicad manager as parent, and were built with wxFRAME_FLOAT_ON_PARENT style.
On windows, when the frame with style wxFRAME_FLOAT_ON_PARENT is displayed  its parent frame is brought to the foreground, on the top of the calling frame.
and stays displayed when closing the  frame in modal mode.
This issue does not happen on unix so we use now wxSTAY_ON_TOP on Windows, and wxFRAME_FLOAT_ON_PARENT on unix to simulate a dialog called by ShowModal.
This is not perfect, but at least it works.
2015-06-22 19:21:34 +02:00
jean-pierre charras 84ba36fa72 Allows switching GAL or legacy mode in footprint editor (previously, the mode was inherited from the board editor, and was not modifiable without closing the footprint editor) by menu or F9, F11 and F12 keys) 2015-05-19 18:39:05 +02:00
jean-pierre charras f25f465d4c Make strings translatable in Create Array dialog (and a minor cosmetic enhancement).
Modview: fix issue about mouse on wrong monitor when starting Modview.
2015-04-05 11:52:41 +02:00
Wayne Stambaugh ec4d74c984 Minor 3D viewer improvements (fixes lp:1406680).
* Make OK button the default action in the 3D viewer option dialog per UI
  policy.
* Fix standard button sizer padding in 3D viewer options dialog.
* Let sizers do their job by using default size for 3D viewer options
  dialog.
* Set 3D viewer hot key to Alt+3 in all parent windows where 3D viewer is
  accessible.
* Minor code cleaning and coding policy fixes.
2015-03-26 15:04:52 -04:00
jean-pierre charras c7d04c3d08 Code cleaning: Remove EDA_BASE_FRAME::m_FrameName member which is a duplicate of wxFrame name. 2015-03-03 15:53:47 +01:00
Wayne Stambaugh ca065833ea Remove EDA_DRAW_FRAME::IsActive() and replace with wxFrame::IsActive(). 2015-01-22 08:42:24 -05:00
jean-pierre charras 9cfb97d8b4 Add hight contrast option in Modedit. In hight contrast mode, solder masks and solder paste are shown.
this option was possible only by modifying the way display options are managed.
before these changes, display options were a global DISPLAY_OPTIONS class instance.
Now each EDA_DRAW_FRAME(and derivated classes)  includes its own DISPLAY_OPTIONS class instance.
As a consequence, some duplicate display option variables in these classes have been removed, because there were just duplicate variables of the  DISPLAY_OPTIONS class instance.
2015-01-10 11:27:49 +01:00
jean-pierre charras d82f403fd7 Libview and Modview: fix issues relative to hotkeys (hardcoded keys instead of user defined keys) and not working tools and popup menus.
Fix also some minor coding style issues.
2014-10-15 13:40:38 +02:00
Wayne Stambaugh ec9cd765bc Fix default menu alt key accelerator bug. (fixes lp:1035151)
* Add hot key handled return indicator to DRAW_FRAME::GeneralControl() and
  DRAW_FRAME::OnHotKey() and all classed derived from DRAW_FRAME.
* Add code to all GeneralControl() and OnHotKey() functions to return true if
  hot key was handled.
* Call event skip in DRAW_PANEL::OnKeyEvent() when key event is not handled to
  allow default menu event handler to function properly.
2014-08-29 16:23:40 -04:00
jean-pierre charras 5a38d2b657 Rework on env. variable KISYS3DMOD. Until now, was used in different files using different ways, so no consistency between files.
code cleanup.
2014-08-24 09:05:07 +02:00
Dick Hollenbeck 7e483f69bd Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
     get disassociated from their true PROJECT.
  *) Allow loading eeschema library editor from kicad.exe
  *) Allow loading pcbnew library editor from kicad.exe
  *) Rename LIB_COMPONENT to LIB_PART.
  *) Add class PART_LIBS, and PART_LIB.
  *) Make PART_LIBS non-global, i.e. PROJECT specific.
  *) Implement "data on demand" for PART_LIBS
  *) Implement "data on demand" for schematic SEARCH_STACK.
  *) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
  *) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
     a weak pointer.
  *) Remove all chdir() calls so projects don't need to be CWD.
  *) Romove APPEND support from OpenProjectFiles().
  *) Make OpenProjectFiles() robust, even for creating new projects.
  *) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
     and save them in the .eeschema config file, not in the project file.
  *) Fix bug with wxDir() while accessing protected dirs in kicad.exe
  *) Consolidate template copying into PROJECT class, not in kicad.exe source.
  *) Generally untangle eeschema, making its libraries not global but rather
     held in the PROJECT.
2014-08-13 15:28:54 -05:00
Michael Narigon 34b645daed warnings 2014-07-30 22:04:34 -05:00
Maciej Suminski 1d378cfcd1 View is automatically centered when a module editor or viewer are opened (GAL). 2014-07-23 12:06:24 +02:00
Maciej Suminski 14cfd173e6 Fixed the Module viewer crash when there is no footprint loaded. 2014-07-09 16:57:01 +02:00
Maciej Suminski 15f5c228cc Fixed autozooming with empty board/module. 2014-07-09 15:10:32 +02:00
Maciej Suminski 31e25ac4cf Fixed module viewer crash. 2014-07-09 15:10:32 +02:00
Maciej Suminski 1f7ce5416c Next/previous footprint toolbar buttons are handled in the Module Viewer using GAL canvas. 2014-07-09 11:22:43 +02:00
Maciej Suminski 0a6de2e13f FOOTPRINT_VIEWER_FRAME handles events from toolbar buttons and hot keys. 2014-07-09 11:22:43 +02:00
Maciej Suminski 8059f4ddd4 Added autozooming and display of the last chosen module for module viewer using GAL. 2014-07-09 11:22:42 +02:00
Maciej Suminski cc733a4966 Initial version of GAL-based module viewer in pcbnew. 2014-07-09 11:22:42 +02:00
Dick Hollenbeck 2ff53e95bd fix some bugs in FOOTPRINT_VIEWER_FRAME, get rid of statics 2014-06-16 14:00:26 -05:00
Lorenzo Marcantonio bee6b9f9b7 Fixes #1186269
- Refactored the common part of cursor key movement and crosshair update
  in the various GeneralControl
- Add x10 movement with the keyboard (CTRL modifier)
- Avoid fixup of the cursor position by dummy mouse movements generated
  by cursor warping (original analysis and idea Chris Gibson)
- Do key handling in a way to permit sub-pixel cursor movement
2014-06-12 18:12:14 +02:00
Dick Hollenbeck 9fe5ce67e6 Modular-Kicad milestone B), minor portion:
*)  Implement a framework for "Data Load On Demand".

*)  Implement FP_LIB_TABLE* PROJECT::PcbFootprintLibs(), which is the first
    prototype.

This allows the project specific footprint tables to be part of the Module Editor
when invoked from Eeschema.
2014-05-09 13:35:48 -05:00
Dick Hollenbeck a2227a75b4 Modular-Kicad milestone B), minor portions:
*) KIWAY_PLAYER::IsModal() is now a retained state, controlled by SetModal()

*) Fully re-work the KIWAY_PLAYER::ShowModal() to use a nested event loop.

*) Add support to DIALOG_SHIM for a "quasi-modal" dialog presentation and mode.
   See top of dialog_shim.cpp about that for benefits and need.

*) You can now pick footprint from the schematic component field dialog, although
   if you do this before you open the BOARD, you will only get the global footprint
   libraries, not also the project specific ones.  Opening the BOARD first avoids this
   problem.

This is the first example of cross KIFACE invocation, it is also the first
instance of using a TOP_FRAME other than FRAME_PCB as the first thing. It works,
but it's missing support for opening the project specific table because
historically the FRAME_PCB did that. This is now starting to expose all the near
term needs for KIWAY_PLAYER <-> PROJECT interaction, independence and out of
sequence usage.

A fix for this will be coming in a few days.

However it mostly starts to show why the KIWAY is terribly useful and important.
2014-05-04 13:22:27 -05:00
Dick Hollenbeck 991926d320 Modular-Kicad milestone B), major portions:
*) Rework the set language support, simplify it by using KIWAY.  Now any major
   frame with a "change language" menu can change the language for all KIWAY_PLAYERs
   in the whole KIWAY.  Multiple KIWAYs are not supported yet.

*) Simplify "modal wxFrame" support, and add that support exclusively to
   KIWAY_PLAYER where it is inherited by all derivatives.  The function
   KIWAY_PLAYER::ShowModal() is in the vtable and so is cross module capable.

*) Remove the requirements and assumptions that the wxFrame hierarchy always
   had PCB_EDIT_FRAME and SCH_EDIT_FRAME as immediate parents of their viewers
   and editors. This is no longer the case, nor required.

*) Use KIWAY::Player() everywhere to make KIWAY_PLAYERs, this registers the
   KIWAY_PLAYER within the KIWAY and makes it very easy to find an open frame
   quickly.  It also gives control to the KIWAY as to frame hierarchical
   relationships.

*) Change single_top to use the KIWAY for loading a KIFACE and instantiating
   the single KIWAY_PLAYER, see bullet immediately above.

*) Add KIWAY::OnKiwayEnd() and call it from PGM_BASE at program termination, this
   gives the KIFACEs a chance to save their final configuration dope to disk.

*) Add dedicated FRAME_T's for the modal frames, so m_Ident can be tested and
   these modal frames are distinctly different than their non-modal equivalents.
   KIWAY_PLAYER::IsModal() is !not! a valid test during the wxFrame's constructor,
   so this is another important reason for having a dedicated FRAME_T for each
   modal wxFrame.

On balance, more lines were deleted than were added to achieve all this.
2014-05-03 12:40:19 -05:00
Dick Hollenbeck 0d6560a218 *) Switch kicad.exe to using KIFACE modules for all major top level windows.
Eeschema, Pcbnew, and Cvpcb all run under the same process now,
    FOR THE VERY FIRST TIME!

*)  Added KIWAY::PlayerCreate(), PlayerClose(), and PlayersClose().

*)  Factored FRAME_T into <frame_type.h> from ID_DRAWFRAME_TYPE.

*)  Found that the following command line is helpful for collecting all the *.kiface
    files into the <build>/kicad/ directory so that kicad can find them.

      $ cp `find . -name '*.kiface'` kicad/

    Maybe somebody will want to rework how the CMake files are organized so all
    the binaries can go into the same place.  See python-a-mingw-us.

*)  This might fix the problem on the Mac where child process windows were not
    coming to the front.  See ->Raise() in kicad/mainframe.cpp.

*)  You can set USE_KIFACE to 0 in kicad/mainframe.cpp to chain load child exes
    instead of using the KIFACE modules directly, i.e. revert.
2014-04-19 13:47:20 -05:00
Dick Hollenbeck c0ed226682 remove a warning message 2014-04-04 13:43:12 -05:00
Dick Hollenbeck 6beacd6e95 Rework FOOTPRINT_VIEWER_FRAME::GetActiveFootprintViewer(), fix up comments and warnings. 2014-04-04 09:57:26 -05:00
Dick Hollenbeck 2c67c3ff80 * KIWAY Milestone A): Make major modules into DLL/DSOs.
!   The initial testing of this commit should be done using a Debug build so that
    all the wxASSERT()s are enabled.  Also, be sure and keep enabled the
    USE_KIWAY_DLLs option.  The tree won't likely build without it.  Turning it
    off is senseless anyways.  If you want stable code, go back to a prior version,
    the one tagged with "stable".

*   Relocate all functionality out of the wxApp derivative into more finely
    targeted purposes:
    a) DLL/DSO specific
    b) PROJECT specific
    c) EXE or process specific
    d) configuration file specific data
    e) configuration file manipulations functions.

    All of this functionality was blended into an extremely large wxApp derivative
    and that was incompatible with the desire to support multiple concurrently
    loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
    An amazing amount of organization come from simply sorting each bit of
    functionality into the proper box.

*   Switch to wxConfigBase from wxConfig everywhere except instantiation.
*   Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
    PGM_SINGLE_TOP,
*   Remove "Return" prefix on many function names.
*   Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
*   Fix building boost for use in a DSO on linux.
*   Remove some of the assumptions in the CMakeLists.txt files that windows had
    to be the host platform when building windows binaries.
*   Reduce the number of wxStrings being constructed at program load time via
    static construction.
*   Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
    these functions are useful even when the wxConfigBase comes from another
    source, as is the case in the KICAD_MANAGER_FRAME.
*   Move the setting of the KIPRJMOD environment variable into class PROJECT,
    so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
*   Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
    its child wxFrames and wxDialogs now have a Kiway() member function which
    returns a KIWAY& that that window tree branch is in support of.  This is like
    wxWindows DNA in that child windows get this member with proper value at time
    of construction.
*   Anticipate some of the needs for milestones B) and C) and make code
    adjustments now in an effort to reduce work in those milestones.
*   No testing has been done for python scripting, since milestone C) has that
    being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
jean-pierre charras ce6b907fe3 Add specific bitmaps in export IDF and export DSN menus.
Add missing calls to Show( false ) to some main frames (Kicad, eeschema, gerbview), to force config saving when closing these windows.
Code cleanup and minor coding style fixes  in footprint_wizard_frame
2014-01-29 18:01:42 +01:00
Dick Hollenbeck c63fa6ff31 Add EDA_BASE_FRAME::Show() and call SaveSettings() only from there for all derived wxFrames. Remove calls to SaveSettings() elsewhere. 2014-01-27 19:29:26 -06:00
Dick Hollenbeck 9afc4a0db6 Remove g_LibraryNames and all supporting infrastructure from pcbnew. FP_LIB_TABLE is now local to major wxFrames. 2014-01-27 01:23:02 -06:00
Dick Hollenbeck 6617ce58f3 Use factored SelectLibrary() from base class. Spelling and comments. 2014-01-27 00:41:40 -06:00
jean-pierre charras 5954910913 Fix some issues in modview, relative to some a bad use of some wxAuiManager functions. 2014-01-13 16:09:52 +01:00
Dick Hollenbeck 6b08cb4ca1 comment out broken tool_modview.cpp's useless footprint select button. somebody needs to fix this. 2014-01-03 17:19:54 -06:00
Dick Hollenbeck 7ba078b620 remove USE_FP_LIB_TABLE code, make it the norm. Add lazy loading support to FOOTPRINT_INFO. 2013-12-12 10:01:03 -06:00
Wayne Stambaugh b85a713395 Fix footprint viewer perspective save bug. 2013-12-11 15:08:13 -05:00