Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
e095b07c
Commit
e095b07c
authored
Nov 18, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleaning
parent
2cdce05d
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
306 additions
and
410 deletions
+306
-410
displlst.cpp
common/displlst.cpp
+1
-0
drawframe.cpp
common/drawframe.cpp
+1
-0
wxwineda.cpp
common/wxwineda.cpp
+1
-63
database.cpp
eeschema/database.cpp
+10
-4
dialog_edit_component_in_schematic.cpp
eeschema/dialog_edit_component_in_schematic.cpp
+3
-2
dialog_edit_libentry_fields_in_lib.cpp
eeschema/dialog_edit_libentry_fields_in_lib.cpp
+1
-0
libeditframe.cpp
eeschema/libeditframe.cpp
+1
-0
netlist_control.cpp
eeschema/netlist_control.cpp
+2
-1
schframe.cpp
eeschema/schframe.cpp
+1
-0
selpart.cpp
eeschema/selpart.cpp
+1
-0
sheetlab.cpp
eeschema/sheetlab.cpp
+1
-0
tool_lib.cpp
eeschema/tool_lib.cpp
+1
-0
tool_viewlib.cpp
eeschema/tool_viewlib.cpp
+1
-0
viewlib_frame.cpp
eeschema/viewlib_frame.cpp
+1
-0
viewlibs.cpp
eeschema/viewlibs.cpp
+1
-0
dialog_gerber_config.cpp
gerbview/dialogs/dialog_gerber_config.cpp
+1
-0
edit.cpp
gerbview/edit.cpp
+1
-0
gerberframe.cpp
gerbview/gerberframe.cpp
+1
-0
toolbars_gerber.cpp
gerbview/toolbars_gerber.cpp
+1
-0
dialog_helpers.h
include/dialog_helpers.h
+250
-0
wxPcbStruct.h
include/wxPcbStruct.h
+2
-0
wxstruct.h
include/wxstruct.h
+0
-268
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+0
-1
dialog_layers_setup.cpp
pcbnew/dialog_layers_setup.cpp
+3
-5
dialog_pcb_text_properties.cpp
pcbnew/dialog_pcb_text_properties.cpp
+1
-0
dimension.cpp
pcbnew/dimension.cpp
+1
-0
event_handlers_tracks_vias_sizes.cpp
pcbnew/event_handlers_tracks_vias_sizes.cpp
+1
-0
librairi.cpp
pcbnew/librairi.cpp
+1
-1
loadcmp.cpp
pcbnew/loadcmp.cpp
+1
-1
mirepcb.cpp
pcbnew/mirepcb.cpp
+1
-0
moduleframe.cpp
pcbnew/moduleframe.cpp
+1
-0
muonde.cpp
pcbnew/muonde.cpp
+1
-0
netlist.cpp
pcbnew/netlist.cpp
+1
-0
pcbframe.cpp
pcbnew/pcbframe.cpp
+1
-0
pcbnew_config.cpp
pcbnew/pcbnew_config.cpp
+1
-1
protos.h
pcbnew/protos.h
+0
-51
tool_modedit.cpp
pcbnew/tool_modedit.cpp
+3
-5
tool_pcb.cpp
pcbnew/tool_pcb.cpp
+1
-2
toolbars_update_user_interface.cpp
pcbnew/toolbars_update_user_interface.cpp
+1
-0
zones_by_polygon.cpp
pcbnew/zones_by_polygon.cpp
+2
-2
zones_non_copper_type_functions.cpp
pcbnew/zones_non_copper_type_functions.cpp
+2
-3
No files found.
common/displlst.cpp
View file @
e095b07c
...
...
@@ -8,6 +8,7 @@
#include "common.h"
#include "macros.h"
#include "kicad_string.h"
#include "dialog_helpers.h"
enum
listbox
{
...
...
common/drawframe.cpp
View file @
e095b07c
...
...
@@ -18,6 +18,7 @@
#include "wxstruct.h"
#include "confirm.h"
#include "kicad_device_context.h"
#include "dialog_helpers.h"
#include <wx/fontdlg.h>
...
...
common/wxwineda.cpp
View file @
e095b07c
...
...
@@ -2,14 +2,10 @@
/* wxwineda.cpp */
/****************/
#ifdef __GNUG__
#pragma implementation
#endif
#include "fctsys.h"
#include "common.h"
#include "wxstruct.h"
#include "dialog_helpers.h"
/*
* Text entry dialog to enter one or more lines of text.
...
...
@@ -390,61 +386,3 @@ void WinEDA_ValueCtrl::Enable( bool enbl )
m_ValueCtrl
->
Enable
(
enbl
);
m_Text
->
Enable
(
enbl
);
}
/**********************************************************************/
/* Class to display and edit a double precision floating point value. */
/**********************************************************************/
WinEDA_DFloatValueCtrl
::
WinEDA_DFloatValueCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
double
value
,
wxBoxSizer
*
BoxSizer
)
{
wxString
buffer
;
wxString
label
=
title
;
m_Value
=
value
;
m_Text
=
new
wxStaticText
(
parent
,
-
1
,
label
);
BoxSizer
->
Add
(
m_Text
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxTOP
,
5
);
buffer
.
Printf
(
wxT
(
"%f"
),
m_Value
);
m_ValueCtrl
=
new
wxTextCtrl
(
parent
,
-
1
,
buffer
);
BoxSizer
->
Add
(
m_ValueCtrl
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
,
5
);
}
WinEDA_DFloatValueCtrl
::~
WinEDA_DFloatValueCtrl
()
{
delete
m_ValueCtrl
;
delete
m_Text
;
}
double
WinEDA_DFloatValueCtrl
::
GetValue
()
{
double
coord
=
0
;
m_ValueCtrl
->
GetValue
().
ToDouble
(
&
coord
);
return
coord
;
}
void
WinEDA_DFloatValueCtrl
::
SetValue
(
double
new_value
)
{
wxString
buffer
;
m_Value
=
new_value
;
buffer
.
Printf
(
wxT
(
"%f"
),
m_Value
);
m_ValueCtrl
->
SetValue
(
buffer
);
}
void
WinEDA_DFloatValueCtrl
::
Enable
(
bool
enbl
)
{
m_ValueCtrl
->
Enable
(
enbl
);
m_Text
->
Enable
(
enbl
);
}
eeschema/database.cpp
View file @
e095b07c
...
...
@@ -14,6 +14,7 @@
#include "general.h"
#include "protos.h"
#include "class_library.h"
#include "dialog_helpers.h"
#include <boost/foreach.hpp>
...
...
@@ -64,13 +65,18 @@ wxString DataBaseGetName( WinEDA_DrawFrame* frame, wxString& Keys, wxString& Buf
return
wxEmptyString
;
}
wxSingleChoiceDialog
dlg
(
frame
,
wxEmptyString
,
_
(
"Select Component"
),
nameList
);
// Show candidate list:
wxString
cmpname
;
WinEDAListBox
dlg
(
frame
,
_
(
"Select Component"
),
NULL
,
cmpname
,
DisplayCmpDoc
);
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
||
dlg
.
GetStringSelection
().
IsEmpty
()
)
dlg
.
InsertItems
(
nameList
);
int
selection
=
dlg
.
ShowModal
();
if
(
selection
<
0
)
return
wxEmptyString
;
return
dlg
.
GetStringSelection
();
cmpname
=
nameList
[
selection
];
return
cmpname
;
}
...
...
eeschema/dialog_edit_component_in_schematic.cpp
View file @
e095b07c
...
...
@@ -15,6 +15,7 @@
#include "protos.h"
#include "class_library.h"
#include "sch_component.h"
#include "dialog_helpers.h"
#include "dialog_edit_component_in_schematic.h"
...
...
@@ -685,9 +686,9 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField()
else
field
.
m_Bold
=
false
;
field
.
m_Pos
.
x
=
ReturnValueFromString
(
g_UserUnit
,
posXTextCtrl
->
GetValue
(),
field
.
m_Pos
.
x
=
ReturnValueFromString
(
g_UserUnit
,
posXTextCtrl
->
GetValue
(),
EESCHEMA_INTERNAL_UNIT
);
field
.
m_Pos
.
y
=
ReturnValueFromString
(
g_UserUnit
,
posYTextCtrl
->
GetValue
(),
field
.
m_Pos
.
y
=
ReturnValueFromString
(
g_UserUnit
,
posYTextCtrl
->
GetValue
(),
EESCHEMA_INTERNAL_UNIT
);
return
true
;
...
...
eeschema/dialog_edit_libentry_fields_in_lib.cpp
View file @
e095b07c
...
...
@@ -17,6 +17,7 @@
#include "class_library.h"
#include "sch_field.h"
#include "template_fieldnames.h"
#include "dialog_helpers.h"
#include "dialog_edit_libentry_fields_in_lib_base.h"
...
...
eeschema/libeditframe.cpp
View file @
e095b07c
...
...
@@ -28,6 +28,7 @@
#include "dialogs/dialog_lib_edit_text.h"
#include "dialogs/dialog_SVG_print.h"
#include "dialog_helpers.h"
#include <boost/foreach.hpp>
...
...
eeschema/netlist_control.cpp
View file @
e095b07c
...
...
@@ -23,8 +23,9 @@
#include "general.h"
#include "netlist.h"
#include "protos.h"
#include "netlist_control.h"
#include "sch_sheet.h"
#include "dialog_helpers.h"
#include "netlist_control.h"
//Imported function:
...
...
eeschema/schframe.cpp
View file @
e095b07c
...
...
@@ -22,6 +22,7 @@
#include "wxEeschemaStruct.h"
#include "class_sch_screen.h"
#include "dialog_helpers.h"
#include "netlist_control.h"
#include "libeditframe.h"
#include "viewlib_frame.h"
...
...
eeschema/selpart.cpp
View file @
e095b07c
...
...
@@ -11,6 +11,7 @@
#include "general.h"
#include "protos.h"
#include "class_library.h"
#include "dialog_helpers.h"
CMP_LIBRARY
*
SelectLibraryFromList
(
WinEDA_DrawFrame
*
frame
)
...
...
eeschema/sheetlab.cpp
View file @
e095b07c
...
...
@@ -14,6 +14,7 @@
#include "general.h"
#include "protos.h"
#include "sch_sheet.h"
#include "dialog_helpers.h"
static
void
ExitPinSheet
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
);
...
...
eeschema/tool_lib.cpp
View file @
e095b07c
...
...
@@ -11,6 +11,7 @@
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
#include "dialog_helpers.h"
#include "help_common_strings.h"
...
...
eeschema/tool_viewlib.cpp
View file @
e095b07c
...
...
@@ -14,6 +14,7 @@
#include "hotkeys.h"
#include "class_library.h"
#include "viewlib_frame.h"
#include "dialog_helpers.h"
void
WinEDA_ViewlibFrame
::
ReCreateHToolbar
()
...
...
eeschema/viewlib_frame.cpp
View file @
e095b07c
...
...
@@ -16,6 +16,7 @@
#include "viewlib_frame.h"
#include "class_library.h"
#include "hotkeys.h"
#include "dialog_helpers.h"
/**
...
...
eeschema/viewlibs.cpp
View file @
e095b07c
...
...
@@ -17,6 +17,7 @@
#include "viewlib_frame.h"
#include "eeschema_id.h"
#include "class_library.h"
#include "dialog_helpers.h"
#define NEXT_PART 1
...
...
gerbview/dialogs/dialog_gerber_config.cpp
View file @
e095b07c
...
...
@@ -11,6 +11,7 @@
#include "appl_wxstruct.h"
#include "common.h"
#include "gerbview.h"
#include "dialog_helpers.h"
enum
...
...
gerbview/edit.cpp
View file @
e095b07c
...
...
@@ -14,6 +14,7 @@
#include "kicad_device_context.h"
#include "gerbview_id.h"
#include "class_GERBER.h"
#include "dialog_helpers.h"
/* Process the command triggered by the left button of the mouse when a tool
...
...
gerbview/gerberframe.cpp
View file @
e095b07c
...
...
@@ -19,6 +19,7 @@
#include "gerbview_id.h"
#include "hotkeys.h"
#include "class_GERBER.h"
#include "dialog_helpers.h"
#include "build_version.h"
...
...
gerbview/toolbars_gerber.cpp
View file @
e095b07c
...
...
@@ -14,6 +14,7 @@
#include "hotkeys.h"
#include "class_GERBER.h"
#include "class_layerchoicebox.h"
#include "dialog_helpers.h"
void
WinEDA_GerberFrame
::
ReCreateHToolbar
(
void
)
{
...
...
include/dialog_helpers.h
0 → 100644
View file @
e095b07c
// file dialog_helpers.h
#ifndef _DIALOG_HELPERS_H_
#define _DIALOG_HELPERS_H_
/* some small helper classes used in dialogs
* Due to use of wxFormBuilder to create dialogs
* most of them should be removed
*/
/************************************************/
/* Class to enter a line, is some dialog frames */
/************************************************/
class
WinEDA_EnterText
{
public
:
bool
m_Modify
;
private
:
wxString
m_NewText
;
wxTextCtrl
*
m_FrameText
;
wxStaticText
*
m_Title
;
public
:
WinEDA_EnterText
(
wxWindow
*
parent
,
const
wxString
&
Title
,
const
wxString
&
TextToEdit
,
wxBoxSizer
*
BoxSizer
,
const
wxSize
&
Size
,
bool
Multiline
=
false
);
~
WinEDA_EnterText
()
{
}
wxString
GetValue
();
void
GetValue
(
char
*
buffer
,
int
lenmax
);
void
SetValue
(
const
wxString
&
new_text
);
void
Enable
(
bool
enbl
);
void
SetFocus
()
{
m_FrameText
->
SetFocus
();
}
void
SetInsertionPoint
(
int
n
)
{
m_FrameText
->
SetInsertionPoint
(
n
);
}
void
SetSelection
(
int
n
,
int
m
)
{
m_FrameText
->
SetSelection
(
n
,
m
);
}
};
/************************************************************************/
/* Class to edit/enter a graphic text and its dimension ( INCHES or MM )*/
/************************************************************************/
class
WinEDA_GraphicTextCtrl
{
public
:
UserUnitType
m_UserUnit
;
int
m_Internal_Unit
;
wxTextCtrl
*
m_FrameText
;
wxTextCtrl
*
m_FrameSize
;
private
:
wxStaticText
*
m_Title
;
public
:
WinEDA_GraphicTextCtrl
(
wxWindow
*
parent
,
const
wxString
&
Title
,
const
wxString
&
TextToEdit
,
int
textsize
,
UserUnitType
user_unit
,
wxBoxSizer
*
BoxSizer
,
int
framelen
=
200
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
~
WinEDA_GraphicTextCtrl
();
wxString
GetText
();
int
GetTextSize
();
void
Enable
(
bool
state
);
void
SetTitle
(
const
wxString
&
title
);
void
SetFocus
()
{
m_FrameText
->
SetFocus
();
}
void
SetValue
(
const
wxString
&
value
);
void
SetValue
(
int
value
);
/**
* Function FormatSize
* formats a string containing the size in the desired units.
*/
static
wxString
FormatSize
(
int
internalUnit
,
UserUnitType
user_unit
,
int
textSize
);
static
int
ParseSize
(
const
wxString
&
sizeText
,
int
internalUnit
,
UserUnitType
user_unit
);
};
/**************************************************************************/
/* Class to edit/enter a coordinate (pair of values) ( INCHES or MM ) in */
/* dialog boxes, */
/**************************************************************************/
class
WinEDA_PositionCtrl
{
public
:
UserUnitType
m_UserUnit
;
int
m_Internal_Unit
;
wxPoint
m_Pos_To_Edit
;
wxTextCtrl
*
m_FramePosX
;
wxTextCtrl
*
m_FramePosY
;
private
:
wxStaticText
*
m_TextX
,
*
m_TextY
;
public
:
WinEDA_PositionCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
const
wxPoint
&
pos_to_edit
,
UserUnitType
user_unit
,
wxBoxSizer
*
BoxSizer
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
~
WinEDA_PositionCtrl
();
void
Enable
(
bool
x_win_on
,
bool
y_win_on
);
void
SetValue
(
int
x_value
,
int
y_value
);
wxPoint
GetValue
();
};
/*************************************************************
* Class to edit/enter a size (pair of values for X and Y size)
* ( INCHES or MM ) in dialog boxes
***************************************************************/
class
WinEDA_SizeCtrl
:
public
WinEDA_PositionCtrl
{
public
:
WinEDA_SizeCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
const
wxSize
&
size_to_edit
,
UserUnitType
user_unit
,
wxBoxSizer
*
BoxSizer
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
~
WinEDA_SizeCtrl
()
{
}
wxSize
GetValue
();
};
/****************************************************************/
/* Class to edit/enter a value ( INCHES or MM ) in dialog boxes */
/****************************************************************/
class
WinEDA_ValueCtrl
{
public
:
UserUnitType
m_UserUnit
;
int
m_Value
;
wxTextCtrl
*
m_ValueCtrl
;
private
:
int
m_Internal_Unit
;
wxStaticText
*
m_Text
;
public
:
WinEDA_ValueCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
int
value
,
UserUnitType
user_unit
,
wxBoxSizer
*
BoxSizer
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
~
WinEDA_ValueCtrl
();
int
GetValue
();
void
SetValue
(
int
new_value
);
void
Enable
(
bool
enbl
);
void
SetToolTip
(
const
wxString
&
text
)
{
m_ValueCtrl
->
SetToolTip
(
text
);
}
};
/***********************/
/* class WinEDAListBox */
/***********************/
class
WinEDAListBox
:
public
wxDialog
{
public
:
WinEDA_DrawFrame
*
m_Parent
;
wxListBox
*
m_List
;
wxTextCtrl
*
m_WinMsg
;
const
wxChar
**
m_ItemList
;
private
:
void
(
*
m_MoveFct
)(
wxString
&
Text
);
public
:
WinEDAListBox
(
WinEDA_DrawFrame
*
parent
,
const
wxString
&
title
,
const
wxChar
**
ItemList
,
const
wxString
&
RefText
,
void
(
*
movefct
)(
wxString
&
Text
)
=
NULL
,
const
wxColour
&
colour
=
wxNullColour
,
wxPoint
dialog_position
=
wxDefaultPosition
);
~
WinEDAListBox
();
void
SortList
();
void
Append
(
const
wxString
&
item
);
void
InsertItems
(
const
wxArrayString
&
itemlist
,
int
position
=
0
);
void
MoveMouseToOrigin
();
wxString
GetTextSelection
();
private
:
void
OnClose
(
wxCloseEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
void
OnOkClick
(
wxCommandEvent
&
event
);
void
ClickOnList
(
wxCommandEvent
&
event
);
void
D_ClickOnList
(
wxCommandEvent
&
event
);
void
OnKeyEvent
(
wxKeyEvent
&
event
);
DECLARE_EVENT_TABLE
()
};
/*************************/
/* class WinEDAChoiceBox */
/*************************/
/* class to display a choice list.
* This is a wrapper to wxComboBox (or wxChoice)
* but because they have some problems, WinEDAChoiceBox uses workarounds:
* - in wxGTK 2.6.2 wxGetSelection() does not work properly,
* - and wxChoice crashes if compiled in non unicode mode and uses utf8 codes
*/
#define EVT_KICAD_CHOICEBOX EVT_COMBOBOX
class
WinEDAChoiceBox
:
public
wxComboBox
{
public
:
WinEDAChoiceBox
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxDefaultSize
,
int
n
=
0
,
const
wxString
choices
[]
=
NULL
)
:
wxComboBox
(
parent
,
id
,
wxEmptyString
,
pos
,
size
,
n
,
choices
,
wxCB_READONLY
)
{
}
WinEDAChoiceBox
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
const
wxArrayString
&
choices
)
:
wxComboBox
(
parent
,
id
,
wxEmptyString
,
pos
,
size
,
choices
,
wxCB_READONLY
)
{
}
int
GetChoice
()
{
return
GetCurrentSelection
();
}
};
#endif
include/wxPcbStruct.h
View file @
e095b07c
...
...
@@ -570,6 +570,8 @@ public:
void
OnConfigurePcbOptions
(
wxCommandEvent
&
aEvent
);
void
InstallDisplayOptionsDialog
(
wxCommandEvent
&
aEvent
);
void
InstallPcbGlobalDeleteFrame
(
const
wxPoint
&
pos
);
bool
InstallDialogNonCopperZonesEditor
(
ZONE_CONTAINER
*
aZone
);
void
InstallDialogLayerSetup
();
void
GenModulesPosition
(
wxCommandEvent
&
event
);
void
GenModuleReport
(
wxCommandEvent
&
event
);
...
...
include/wxstruct.h
View file @
e095b07c
...
...
@@ -626,192 +626,6 @@ public:
DECLARE_EVENT_TABLE
()
};
/************************************************/
/* Class to enter a line, is some dialog frames */
/************************************************/
class
WinEDA_EnterText
{
public
:
bool
m_Modify
;
private
:
wxString
m_NewText
;
wxTextCtrl
*
m_FrameText
;
wxStaticText
*
m_Title
;
public
:
WinEDA_EnterText
(
wxWindow
*
parent
,
const
wxString
&
Title
,
const
wxString
&
TextToEdit
,
wxBoxSizer
*
BoxSizer
,
const
wxSize
&
Size
,
bool
Multiline
=
false
);
~
WinEDA_EnterText
()
{
}
wxString
GetValue
();
void
GetValue
(
char
*
buffer
,
int
lenmax
);
void
SetValue
(
const
wxString
&
new_text
);
void
Enable
(
bool
enbl
);
void
SetFocus
()
{
m_FrameText
->
SetFocus
();
}
void
SetInsertionPoint
(
int
n
)
{
m_FrameText
->
SetInsertionPoint
(
n
);
}
void
SetSelection
(
int
n
,
int
m
)
{
m_FrameText
->
SetSelection
(
n
,
m
);
}
};
/************************************************************************/
/* Class to edit/enter a graphic text and its dimension ( INCHES or MM )*/
/************************************************************************/
class
WinEDA_GraphicTextCtrl
{
public
:
UserUnitType
m_UserUnit
;
int
m_Internal_Unit
;
wxTextCtrl
*
m_FrameText
;
wxTextCtrl
*
m_FrameSize
;
private
:
wxStaticText
*
m_Title
;
public
:
WinEDA_GraphicTextCtrl
(
wxWindow
*
parent
,
const
wxString
&
Title
,
const
wxString
&
TextToEdit
,
int
textsize
,
UserUnitType
user_unit
,
wxBoxSizer
*
BoxSizer
,
int
framelen
=
200
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
~
WinEDA_GraphicTextCtrl
();
wxString
GetText
();
int
GetTextSize
();
void
Enable
(
bool
state
);
void
SetTitle
(
const
wxString
&
title
);
void
SetFocus
()
{
m_FrameText
->
SetFocus
();
}
void
SetValue
(
const
wxString
&
value
);
void
SetValue
(
int
value
);
/**
* Function FormatSize
* formats a string containing the size in the desired units.
*/
static
wxString
FormatSize
(
int
internalUnit
,
UserUnitType
user_unit
,
int
textSize
);
static
int
ParseSize
(
const
wxString
&
sizeText
,
int
internalUnit
,
UserUnitType
user_unit
);
};
/**************************************************************************/
/* Class to edit/enter a coordinate (pair of values) ( INCHES or MM ) in */
/* dialog boxes, */
/**************************************************************************/
class
WinEDA_PositionCtrl
{
public
:
UserUnitType
m_UserUnit
;
int
m_Internal_Unit
;
wxPoint
m_Pos_To_Edit
;
wxTextCtrl
*
m_FramePosX
;
wxTextCtrl
*
m_FramePosY
;
private
:
wxStaticText
*
m_TextX
,
*
m_TextY
;
public
:
WinEDA_PositionCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
const
wxPoint
&
pos_to_edit
,
UserUnitType
user_unit
,
wxBoxSizer
*
BoxSizer
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
~
WinEDA_PositionCtrl
();
void
Enable
(
bool
x_win_on
,
bool
y_win_on
);
void
SetValue
(
int
x_value
,
int
y_value
);
wxPoint
GetValue
();
};
/*************************************************************
* Class to edit/enter a size (pair of values for X and Y size)
* ( INCHES or MM ) in dialog boxes
***************************************************************/
class
WinEDA_SizeCtrl
:
public
WinEDA_PositionCtrl
{
public
:
WinEDA_SizeCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
const
wxSize
&
size_to_edit
,
UserUnitType
user_unit
,
wxBoxSizer
*
BoxSizer
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
~
WinEDA_SizeCtrl
()
{
}
wxSize
GetValue
();
};
/****************************************************************/
/* Class to edit/enter a value ( INCHES or MM ) in dialog boxes */
/****************************************************************/
class
WinEDA_ValueCtrl
{
public
:
UserUnitType
m_UserUnit
;
int
m_Value
;
wxTextCtrl
*
m_ValueCtrl
;
private
:
int
m_Internal_Unit
;
wxStaticText
*
m_Text
;
public
:
WinEDA_ValueCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
int
value
,
UserUnitType
user_unit
,
wxBoxSizer
*
BoxSizer
,
int
internal_unit
=
EESCHEMA_INTERNAL_UNIT
);
~
WinEDA_ValueCtrl
();
int
GetValue
();
void
SetValue
(
int
new_value
);
void
Enable
(
bool
enbl
);
void
SetToolTip
(
const
wxString
&
text
)
{
m_ValueCtrl
->
SetToolTip
(
text
);
}
};
/************************************************************************/
/* Class to edit/enter a pair of float (double) values in dialog boxes */
/************************************************************************/
class
WinEDA_DFloatValueCtrl
{
public
:
double
m_Value
;
wxTextCtrl
*
m_ValueCtrl
;
private
:
wxStaticText
*
m_Text
;
public
:
WinEDA_DFloatValueCtrl
(
wxWindow
*
parent
,
const
wxString
&
title
,
double
value
,
wxBoxSizer
*
BoxSizer
);
~
WinEDA_DFloatValueCtrl
();
double
GetValue
();
void
SetValue
(
double
new_value
);
void
Enable
(
bool
enbl
);
void
SetToolTip
(
const
wxString
&
text
)
{
m_ValueCtrl
->
SetToolTip
(
text
);
}
};
/*************************/
/* class WinEDA_Toolbar */
/*************************/
...
...
@@ -852,86 +666,4 @@ public:
};
/***********************/
/* class WinEDAListBox */
/***********************/
class
WinEDAListBox
:
public
wxDialog
{
public
:
WinEDA_DrawFrame
*
m_Parent
;
wxListBox
*
m_List
;
wxTextCtrl
*
m_WinMsg
;
const
wxChar
**
m_ItemList
;
private
:
void
(
*
m_MoveFct
)(
wxString
&
Text
);
public
:
WinEDAListBox
(
WinEDA_DrawFrame
*
parent
,
const
wxString
&
title
,
const
wxChar
**
ItemList
,
const
wxString
&
RefText
,
void
(
*
movefct
)(
wxString
&
Text
)
=
NULL
,
const
wxColour
&
colour
=
wxNullColour
,
wxPoint
dialog_position
=
wxDefaultPosition
);
~
WinEDAListBox
();
void
SortList
();
void
Append
(
const
wxString
&
item
);
void
InsertItems
(
const
wxArrayString
&
itemlist
,
int
position
=
0
);
void
MoveMouseToOrigin
();
wxString
GetTextSelection
();
private
:
void
OnClose
(
wxCloseEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
void
OnOkClick
(
wxCommandEvent
&
event
);
void
ClickOnList
(
wxCommandEvent
&
event
);
void
D_ClickOnList
(
wxCommandEvent
&
event
);
void
OnKeyEvent
(
wxKeyEvent
&
event
);
DECLARE_EVENT_TABLE
()
};
/*************************/
/* class WinEDAChoiceBox */
/*************************/
/* class to display a choice list.
* This is a wrapper to wxComboBox (or wxChoice)
* but because they have some problems, WinEDAChoiceBox uses workarounds:
* - in wxGTK 2.6.2 wxGetSelection() does not work properly,
* - and wxChoice crashes if compiled in non unicode mode and uses utf8 codes
*/
#define EVT_KICAD_CHOICEBOX EVT_COMBOBOX
class
WinEDAChoiceBox
:
public
wxComboBox
{
public
:
WinEDAChoiceBox
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxDefaultSize
,
int
n
=
0
,
const
wxString
choices
[]
=
NULL
)
:
wxComboBox
(
parent
,
id
,
wxEmptyString
,
pos
,
size
,
n
,
choices
,
wxCB_READONLY
)
{
}
WinEDAChoiceBox
(
wxWindow
*
parent
,
wxWindowID
id
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
const
wxArrayString
&
choices
)
:
wxComboBox
(
parent
,
id
,
wxEmptyString
,
pos
,
size
,
choices
,
wxCB_READONLY
)
{
}
int
GetChoice
()
{
return
GetCurrentSelection
();
}
};
#endif
/* WXSTRUCT_H */
pcbnew/basepcbframe.cpp
View file @
e095b07c
...
...
@@ -14,7 +14,6 @@
#include "pcbnew.h"
#include "bitmaps.h"
#include "protos.h"
#include "pcbnew_id.h"
#include "class_board_design_settings.h"
...
...
pcbnew/dialog_layers_setup.cpp
View file @
e095b07c
...
...
@@ -698,10 +698,8 @@ bool DIALOG_LAYERS_SETUP::testLayerNames()
}
void
DisplayDialogLayerSetup
(
WinEDA_PcbFrame
*
parent
)
void
WinEDA_PcbFrame
::
InstallDialogLayerSetup
(
)
{
DIALOG_LAYERS_SETUP
frame
(
parent
);
frame
.
ShowModal
();
frame
.
Destroy
();
DIALOG_LAYERS_SETUP
dlg
(
this
);
dlg
.
ShowModal
();
}
pcbnew/dialog_pcb_text_properties.cpp
View file @
e095b07c
...
...
@@ -10,6 +10,7 @@
#include "wxPcbStruct.h"
#include "drawtxt.h"
#include "confirm.h"
#include "dialog_helpers.h"
enum
id_TextPCB_properties
{
ID_TEXTPCB_SELECT_LAYER
=
1900
...
...
pcbnew/dimension.cpp
View file @
e095b07c
...
...
@@ -10,6 +10,7 @@
#include "wxPcbStruct.h"
#include "class_board_design_settings.h"
#include "drawtxt.h"
#include "dialog_helpers.h"
/* Loca functions */
static
void
Exit_EditDimension
(
WinEDA_DrawPanel
*
Panel
,
wxDC
*
DC
);
...
...
pcbnew/event_handlers_tracks_vias_sizes.cpp
View file @
e095b07c
...
...
@@ -15,6 +15,7 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "class_board_design_settings.h"
#include "dialog_helpers.h"
/**
* Function Tracks_and_Vias_Size_Event
...
...
pcbnew/librairi.cpp
View file @
e095b07c
...
...
@@ -12,7 +12,7 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "module_editor_frame.h"
#include "
proto
s.h"
#include "
dialog_helper
s.h"
/*
* Module library header format:
...
...
pcbnew/loadcmp.cpp
View file @
e095b07c
...
...
@@ -16,7 +16,7 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "module_editor_frame.h"
#include "
proto
s.h"
#include "
dialog_helper
s.h"
class
ModList
{
...
...
pcbnew/mirepcb.cpp
View file @
e095b07c
...
...
@@ -9,6 +9,7 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "class_board_design_settings.h"
#include "dialog_helpers.h"
#include "protos.h"
...
...
pcbnew/moduleframe.cpp
View file @
e095b07c
...
...
@@ -14,6 +14,7 @@
#include "protos.h"
#include "pcbnew_id.h"
#include "hotkeys.h"
#include "dialog_helpers.h"
#include "3d_viewer.h"
...
...
pcbnew/muonde.cpp
View file @
e095b07c
...
...
@@ -13,6 +13,7 @@
#include "wxPcbStruct.h"
#include "class_board_design_settings.h"
#include "protos.h"
#include "dialog_helpers.h"
#define COEFF_COUNT 6
...
...
pcbnew/netlist.cpp
View file @
e095b07c
...
...
@@ -36,6 +36,7 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "richio.h"
#include "dialog_helpers.h"
#include "dialog_netlist.h"
...
...
pcbnew/pcbframe.cpp
View file @
e095b07c
...
...
@@ -50,6 +50,7 @@
#include "pcbnew_config.h"
#include "module_editor_frame.h"
#include "dialog_SVG_print.h"
#include "dialog_helpers.h"
extern
int
g_DrawDefaultLineThickness
;
...
...
pcbnew/pcbnew_config.cpp
View file @
e095b07c
...
...
@@ -54,7 +54,7 @@ void WinEDA_PcbFrame::Process_Config( wxCommandEvent& event )
break
;
case
ID_PCB_LAYERS_SETUP
:
DisplayDialogLayerSetup
(
this
);
InstallDialogLayerSetup
(
);
break
;
case
ID_CONFIG_REQ
:
...
...
pcbnew/protos.h
View file @
e095b07c
...
...
@@ -22,10 +22,6 @@ class COMMAND;
void
SwapData
(
BOARD_ITEM
*
aItem
,
BOARD_ITEM
*
aImage
);
/* install function for DialogNonCopperZonesEditor dialog frame :*/
bool
InstallDialogNonCopperZonesEditor
(
WinEDA_PcbFrame
*
aParent
,
ZONE_CONTAINER
*
aZone
);
/*******************/
/* PAD_CONNECT.CPP */
/*******************/
...
...
@@ -213,10 +209,6 @@ void Montre_Position_Empreinte( WinEDA_DrawPanel* panel,
bool
erase
);
/* LOADCMP.C : */
MODULE
*
Load_Module_From_Library
(
WinEDA_DrawFrame
*
frame
,
wxDC
*
DC
);
/****************/
/* EDITRACK.C : */
/****************/
...
...
@@ -277,32 +269,11 @@ int ReturnEndsTrack( TRACK* RefTrack, int NbSegm,
void
ListSetState
(
EDA_BaseStruct
*
Start
,
int
Nbitem
,
int
State
,
int
onoff
);
/**************/
/* CLEAN.CPP : */
/**************/
/* Remove segments connected incorrectly.
*/
int
Netliste_Controle_piste
(
WinEDA_PcbFrame
*
frame
,
wxDC
*
DC
,
int
affiche
);
/************/
/* ZONES.CPP */
/************/
int
Propagation
(
WinEDA_PcbFrame
*
frame
);
/****************/
/* ATTRIBUT.CPP */
/****************/
/* Compute the attributes that are 0 (masque_clr) and put a 1
* (Masque_set), depending on the options attribute.
*
* These attributes are normally the member flags of the structure TRACK
* Pointers NULLs are accepted.
*/
void
MasqueAttributs
(
int
*
masque_set
,
int
*
masque_clr
);
/***************/
/* DUPLTRAC.CPP */
...
...
@@ -347,26 +318,4 @@ void RemoteCommand( const char* cmdline );
bool
Project
(
wxPoint
*
res
,
wxPoint
on_grid
,
const
TRACK
*
track
);
/***************/
/* AUTOROUT.CPP */
/***************/
void
DisplayBoard
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
);
/* for Debugging */
/**************/
/* NETLIST.CPP */
/**************/
/* List the names of the modules of PCB
* Returns a pointer to the module selected or NULL if no selection.
*/
MODULE
*
ListAndSelectModuleName
(
COMMAND
*
Cmd
);
/***************************/
/* DIALOG_LAYERS_SETUP.CPP */
/***************************/
void
DisplayDialogLayerSetup
(
WinEDA_PcbFrame
*
parent
);
#endif
/* #define PROTO_H */
pcbnew/tool_modedit.cpp
View file @
e095b07c
...
...
@@ -8,15 +8,13 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "module_editor_frame.h"
#include "protos.h"
#include "dialog_helpers.h"
#include "bitmaps.h"
#include "pcbnew_id.h"
#include "hotkeys.h"
//#include "protos.h"
#ifdef __UNIX__
#define LISTBOX_WIDTH 140
#else
...
...
pcbnew/tool_pcb.cpp
View file @
e095b07c
...
...
@@ -10,9 +10,8 @@
#include "wxPcbStruct.h"
#include "class_board_design_settings.h"
#include "colors_selection.h"
#include "dialog_helpers.h"
#include "bitmaps.h"
#include "pcbnew_id.h"
#ifdef __UNIX__
...
...
pcbnew/toolbars_update_user_interface.cpp
View file @
e095b07c
...
...
@@ -17,6 +17,7 @@
#include "drc_stuff.h"
#include "3d_viewer.h"
#include "class_board_design_settings.h"
#include "dialog_helpers.h"
/* helper to convert an integer value to a string, using mils or mm
* according to g_UserUnit value
...
...
pcbnew/zones_by_polygon.cpp
View file @
e095b07c
...
...
@@ -526,7 +526,7 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
}
else
// Put a zone on a non copper layer (technical layer)
{
diag
=
InstallDialogNonCopperZonesEditor
(
this
,
zone
);
diag
=
InstallDialogNonCopperZonesEditor
(
zone
);
g_Zone_Default_Setting
.
m_NetcodeSelection
=
0
;
// No net for non copper zones
}
DrawPanel
->
MouseToCursorSchema
();
...
...
@@ -787,7 +787,7 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
frame
->
Destroy
();
}
else
// edit a zone on a non copper layer (technical layer)
diag
=
InstallDialogNonCopperZonesEditor
(
this
,
zone_container
);
diag
=
InstallDialogNonCopperZonesEditor
(
zone_container
);
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
m_IgnoreMouseEvents
=
FALSE
;
...
...
pcbnew/zones_non_copper_type_functions.cpp
View file @
e095b07c
...
...
@@ -62,10 +62,9 @@ DialogNonCopperZonesEditor::~DialogNonCopperZonesEditor()
}
/* install function for DialogNonCopperZonesEditor dialog frame :*/
bool
InstallDialogNonCopperZonesEditor
(
WinEDA_PcbFrame
*
aParent
,
ZONE_CONTAINER
*
aZone
)
bool
WinEDA_PcbFrame
::
InstallDialogNonCopperZonesEditor
(
ZONE_CONTAINER
*
aZone
)
{
DialogNonCopperZonesEditor
frame
(
aParent
,
aZone
,
&
g_Zone_Default_Setting
);
DialogNonCopperZonesEditor
frame
(
this
,
aZone
,
&
g_Zone_Default_Setting
);
bool
diag
=
frame
.
ShowModal
();
return
diag
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment