Commit a67a4f7e authored by CHARRAS's avatar CHARRAS

listboxes.cpp problem: apply to window version only. Some other very minor...

listboxes.cpp problem: apply to window version only. Some other very minor enhancements and bug fixes
parent 58c51a6f
......@@ -4,6 +4,17 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Oct-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+cvpcb: listboxes.cpp problem solved: exists only under windows
now apply to windows only, because this Workaround creates a problem undex linux
+others:
some very minor problems solved
+eeschema:
in B.O.M.: the footprint field can be added to the field list
2007-Oct-29 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+cvpcb: listboxes.cpp problem solved: Workaround for a curious bug in wxWidgets:
......
......@@ -406,6 +406,7 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw )
{
bool old_selection = m_UseFootprintFullList;
#ifdef __WINDOWS__
/* Workaround for a curious bug in wxWidgets:
* if we switch from a long list of footprints to a short list (a filtered footprint list),
* and if the selected item is near the end of the long list,
......@@ -419,7 +420,7 @@ void FootprintListBox::SetActiveFootprintList( bool FullList, bool Redraw )
if( new_selection != old_selection )
SetSelection( 0, TRUE );
}
#endif
if( FullList )
{
m_UseFootprintFullList = TRUE;
......
......@@ -76,6 +76,7 @@ static bool s_ListBySheet;
static bool s_BrowsList;
static int s_OutputFormOpt;
static int s_OutputSeparatorOpt;
static bool s_Add_FpField_state;
static bool s_Add_F1_state;
static bool s_Add_F2_state;
static bool s_Add_F3_state;
......@@ -85,6 +86,7 @@ static bool s_Add_F6_state;
static bool s_Add_F7_state;
static bool s_Add_F8_state;
static bool * s_AddFieldList[] = {
& s_Add_FpField_state,
& s_Add_F1_state,
& s_Add_F2_state,
& s_Add_F3_state,
......@@ -194,6 +196,7 @@ bool WinEDA_Build_BOM_Frame::Create( wxWindow* parent, wxWindowID id, const wxSt
m_OutputSeparatorCtrl = NULL;
m_GetListBrowser = NULL;
m_FieldsToAppendListSizer = NULL;
m_AddFootprintField = NULL;
m_AddField1 = NULL;
m_AddField2 = NULL;
m_AddField3 = NULL;
......@@ -209,7 +212,7 @@ bool WinEDA_Build_BOM_Frame::Create( wxWindow* parent, wxWindowID id, const wxSt
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if( GetSizer() )
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
......@@ -227,7 +230,7 @@ void WinEDA_Build_BOM_Frame::CreateControls()
SetFont(*g_DialogFont);
////@begin WinEDA_Build_BOM_Frame content construction
// Generated by DialogBlocks, 13/10/2007 00:04:07 (unregistered)
// Generated by DialogBlocks, 30/10/2007 12:13:46 (unregistered)
WinEDA_Build_BOM_Frame* itemDialog1 = this;
......@@ -294,58 +297,62 @@ void WinEDA_Build_BOM_Frame::CreateControls()
m_FieldsToAppendListSizer = new wxStaticBoxSizer(itemStaticBoxSizer16Static, wxVERTICAL);
itemBoxSizer15->Add(m_FieldsToAppendListSizer, 0, wxALIGN_LEFT|wxALL, 5);
m_AddFootprintField = new wxCheckBox( itemDialog1, ID_CHECKBOX_FOOTPRINT_FIELD, _("Add Footprint Field"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_AddFootprintField->SetValue(false);
m_FieldsToAppendListSizer->Add(m_AddFootprintField, 0, wxGROW|wxALL, 5);
m_AddField1 = new wxCheckBox( itemDialog1, ID_CHECKBOX_FIELD1, _("Add Field 1"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_AddField1->SetValue(false);
m_FieldsToAppendListSizer->Add(m_AddField1, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_FieldsToAppendListSizer->Add(m_AddField1, 0, wxGROW|wxALL, 5);
m_AddField2 = new wxCheckBox( itemDialog1, ID_CHECKBOX_FIELD2, _("Add Field 2"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_AddField2->SetValue(false);
m_FieldsToAppendListSizer->Add(m_AddField2, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_FieldsToAppendListSizer->Add(m_AddField2, 0, wxGROW|wxALL, 5);
m_AddField3 = new wxCheckBox( itemDialog1, ID_CHECKBOX_FIELD3, _("Add Field 3"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_AddField3->SetValue(false);
m_FieldsToAppendListSizer->Add(m_AddField3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_FieldsToAppendListSizer->Add(m_AddField3, 0, wxGROW|wxALL, 5);
m_AddField4 = new wxCheckBox( itemDialog1, ID_CHECKBOX_FIELD4, _("Add Field 4"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_AddField4->SetValue(false);
m_FieldsToAppendListSizer->Add(m_AddField4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_FieldsToAppendListSizer->Add(m_AddField4, 0, wxGROW|wxALL, 5);
m_AddField5 = new wxCheckBox( itemDialog1, ID_CHECKBOX_FIELD5, _("Add Field 5"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_AddField5->SetValue(false);
m_FieldsToAppendListSizer->Add(m_AddField5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_FieldsToAppendListSizer->Add(m_AddField5, 0, wxGROW|wxALL, 5);
m_AddField6 = new wxCheckBox( itemDialog1, ID_CHECKBOX_FIELD6, _("Add Field 6"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_AddField6->SetValue(false);
m_FieldsToAppendListSizer->Add(m_AddField6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_FieldsToAppendListSizer->Add(m_AddField6, 0, wxGROW|wxALL, 5);
m_AddField7 = new wxCheckBox( itemDialog1, ID_CHECKBOX_FIELD7, _("Add Field 7"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_AddField7->SetValue(false);
m_FieldsToAppendListSizer->Add(m_AddField7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_FieldsToAppendListSizer->Add(m_AddField7, 0, wxGROW|wxALL, 5);
m_AddField8 = new wxCheckBox( itemDialog1, ID_CHECKBOX_FIELD8, _("Add Field 8"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_AddField8->SetValue(false);
m_FieldsToAppendListSizer->Add(m_AddField8, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_FieldsToAppendListSizer->Add(m_AddField8, 0, wxGROW|wxALL, 5);
itemBoxSizer15->Add(5, 5, 0, wxGROW|wxALL, 10);
wxButton* itemButton26 = new wxButton( itemDialog1, ID_CREATE_LIST, _("Create &List"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton26->SetDefault();
itemButton26->SetForegroundColour(wxColour(166, 0, 0));
itemBoxSizer15->Add(itemButton26, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxButton* itemButton27 = new wxButton( itemDialog1, ID_CREATE_LIST, _("Create &List"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton27->SetDefault();
itemButton27->SetForegroundColour(wxColour(166, 0, 0));
itemBoxSizer15->Add(itemButton27, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer27, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5);
wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer28, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5);
wxButton* itemButton28 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton28->SetForegroundColour(wxColour(255, 0, 0));
itemBoxSizer27->Add(itemButton28, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton29 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton29->SetForegroundColour(wxColour(255, 0, 0));
itemBoxSizer28->Add(itemButton29, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton29 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton29->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer27->Add(itemButton29, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton30 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton30->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer28->Add(itemButton30, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton30 = new wxButton( itemDialog1, wxID_APPLY, _("&Apply"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer27->Add(itemButton30, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton31 = new wxButton( itemDialog1, wxID_APPLY, _("&Apply"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer28->Add(itemButton31, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
// Set validators
m_ListCmpbyRefItems->SetValidator( wxGenericValidator(& s_ListByRef) );
......@@ -356,6 +363,7 @@ void WinEDA_Build_BOM_Frame::CreateControls()
m_OutputFormCtrl->SetValidator( wxGenericValidator(& s_OutputFormOpt) );
m_OutputSeparatorCtrl->SetValidator( wxGenericValidator(& s_OutputSeparatorOpt) );
m_GetListBrowser->SetValidator( wxGenericValidator(& s_BrowsList) );
m_AddFootprintField->SetValidator( wxGenericValidator(& s_Add_FpField_state) );
m_AddField1->SetValidator( wxGenericValidator(& s_Add_F1_state) );
m_AddField2->SetValidator( wxGenericValidator(& s_Add_F2_state) );
m_AddField3->SetValidator( wxGenericValidator(& s_Add_F3_state) );
......
......@@ -47,6 +47,7 @@
#define ID_RADIOBOX_SELECT_FORMAT 10006
#define ID_RADIOBOX_SEPARATOR 10007
#define ID_CHECKBOX6 10008
#define ID_CHECKBOX_FOOTPRINT_FIELD 10018
#define ID_CHECKBOX_FIELD1 10009
#define ID_CHECKBOX_FIELD2 10010
#define ID_CHECKBOX_FIELD3 10011
......@@ -149,6 +150,7 @@ public:
wxRadioBox* m_OutputSeparatorCtrl;
wxCheckBox* m_GetListBrowser;
wxStaticBoxSizer* m_FieldsToAppendListSizer;
wxCheckBox* m_AddFootprintField;
wxCheckBox* m_AddField1;
wxCheckBox* m_AddField2;
wxCheckBox* m_AddField3;
......
This diff is collapsed.
......@@ -183,7 +183,7 @@ public:
void Clear_D_CODE_Data();
};
eda_global wxChar *g_GERBER_Tool_Type[6]
eda_global const wxChar *g_GERBER_Tool_Type[6]
#ifdef MAIN
= { wxT("????"), wxT("Rond"), wxT("Rect"), wxT("Line"), wxT("Oval"), wxT("Macro")
}
......
......@@ -51,7 +51,7 @@ class StructColors
{
public:
unsigned char m_Blue, m_Green, m_Red, m_Numcolor;
wxChar* m_Name;
const wxChar* m_Name;
int m_LightColor;
};
......
......@@ -652,9 +652,8 @@ public:
int Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone );
void Install_Test_DRC_Frame( wxDC* DC );
void Trace_Pcb( wxDC* DC, int mode );
void Trace_PcbEdges( wxDC* DC, int mode_color );
// Gestion des textes sur pcb
// Handling texts on the board
void Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
TEXTE_PCB* Create_Texte_Pcb( wxDC* DC );
void Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
......@@ -663,17 +662,17 @@ public:
void InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB,
wxDC* DC, const wxPoint& pos );
// Gestion des Segments type DRAWITEM
// Graphic Segments type DRAWSEGMENT
void Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
void Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
// Gestion des modules (voir egalement WinEDA_BasePcbFrame)
// Footprint edition (see also WinEDA_BasePcbFrame)
void StartMove_Module( MODULE* module, wxDC* DC );
bool Delete_Module( MODULE* module, wxDC* DC );
// loading modules: see WinEDA_BasePcbFrame
// Gestion du PCB
// Borad handling
void Erase_Zones( wxDC* DC, bool query );
void Erase_Segments_Pcb( wxDC* DC, bool is_edges, bool query );
void Erase_Pistes( wxDC* DC, int masque_type, bool query );
......
......@@ -772,7 +772,7 @@ int D_PAD::WriteDescr( FILE* File )
{
int cshape, NbLigne = 0;;
char* texttype;
const char* texttype;
if( GetState( DELETED ) )
return NbLigne;
......
......@@ -1057,7 +1057,7 @@ void WinEDA_DrillFrame::GenDrillMap( int format )
break;
}
/* Trace du contour ( couche EDGE ) */
/* Draw items on edge layer */
PtStruct = m_Parent->m_Pcb->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Pnext )
{
......@@ -1079,6 +1079,9 @@ void WinEDA_DrillFrame::GenDrillMap( int format )
PlotMirePcb( (MIREPCB*) PtStruct, format, EDGE_LAYER );
break;
case TYPEMARQUEUR: // do not draw
break;
default:
DisplayError( this, wxT( "WinEDA_DrillFrame::GenDrillMap() : Unexpected Draw Type" ) );
break;
......
......@@ -19,10 +19,11 @@
/* class WinEDA_ModuleEditFrame */
/********************************/
BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, wxFrame )
COMMON_EVENTS_DRAWFRAME EVT_MENU_RANGE( ID_POPUP_PCB_ITEM_SELECTION_START,
ID_POPUP_PCB_ITEM_SELECTION_END,
WinEDA_BasePcbFrame::ProcessItemSelection )
COMMON_EVENTS_DRAWFRAME EVT_CLOSE( WinEDA_ModuleEditFrame::OnCloseWindow )
COMMON_EVENTS_DRAWFRAME
EVT_MENU_RANGE( ID_POPUP_PCB_ITEM_SELECTION_START,
ID_POPUP_PCB_ITEM_SELECTION_END,
WinEDA_BasePcbFrame::ProcessItemSelection )
EVT_CLOSE( WinEDA_ModuleEditFrame::OnCloseWindow )
EVT_SIZE( WinEDA_ModuleEditFrame::OnSize )
EVT_KICAD_CHOICEBOX( ID_ON_ZOOM_SELECT, WinEDA_PcbFrame::OnSelectZoom )
......
......@@ -27,8 +27,7 @@
void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
/**********************************************************************/
/* Trace le PCB, et les elements complementaires ( axes, grille .. )
* pour l'ecran actif et ses sous ecran
/* Draw the footprint editor BOARD, and others elements : axis, grid ..
*/
{
......@@ -47,6 +46,7 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawPanel->DrawBackGround( DC );
TraceWorkSheet( DC, screen, 0 );
/* Redraw the footprint */
Module = (MODULE*) m_Pcb->m_Modules;
for( ; Module != NULL; Module = (MODULE*) Module->Pnext )
{
......@@ -58,7 +58,7 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
/* Reaffichage du curseur */
/* Redraw the cursor */
DrawPanel->Trace_Curseur( DC );
screen->ClrRefreshReq();
......@@ -69,8 +69,7 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
/****************************************************************/
/* Trace le PCB, et les elements complementaires ( axes, grille .. )
* pour l'ecran actif et ses sous ecran
/* Draw the BOARD, and others elements : axis, grid ..
*/
{
PCB_SCREEN* Screen = GetScreen();
......@@ -90,20 +89,17 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
TraceWorkSheet( DC, GetScreen(), 0 );
Affiche_Status_Box();
/* Reaffichage des curseurs */
for( Screen = GetScreen(); Screen != NULL; Screen = Screen->Next() )
{
if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
DrawPanel->Trace_Curseur( DC );
}
if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
/* Redraw the cursor */
DrawPanel->Trace_Curseur( DC );
}
/****************************************************/
void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode )
/****************************************************/
/* Trace l'ensemble des elements du PCB sur l'ecran actif*/
/* Redraw the BOARD items but not cursors, axis or grid */
{
MARQUEUR* Marqueur;
MODULE* Module;
......@@ -140,7 +136,7 @@ void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode )
Trace_Pads_Only( DrawPanel, DC, Module, 0, 0, MaskLay, mode );
}
/* Trace des elements particuliers de Drawings Pcb */
/* Draw the graphic items */
PtStruct = m_Pcb->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Pnext )
......@@ -167,7 +163,11 @@ void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode )
Marqueur->Draw( DrawPanel, DC, mode );
break;
default:
case TYPEDRAWSEGMENT:
Trace_DrawSegmentPcb( DrawPanel, DC, (DRAWSEGMENT*) PtStruct, mode );
break;
default:
break;
}
}
......@@ -184,28 +184,8 @@ void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode )
Trace_DrawSegmentPcb( DrawPanel, DC, segment, mode );
}
Trace_PcbEdges( DC, mode );
DrawGeneralRatsnest( DC );
m_CurrentScreen->ClrRefreshReq();
}
/**************************************************************/
void WinEDA_PcbFrame::Trace_PcbEdges( wxDC* DC, int mode_color )
/**************************************************************/
/* impression des contours ( edge pcb) : et draw */
{
EDA_BaseStruct* PtStruct;
if( !m_Pcb )
return;
for( PtStruct = m_Pcb->m_Drawings; PtStruct != NULL; PtStruct = PtStruct->Pnext )
{
if( PtStruct->m_Flags & IS_MOVED )
continue;
if( PtStruct->Type() != TYPEDRAWSEGMENT )
continue;
Trace_DrawSegmentPcb( DrawPanel, DC, (DRAWSEGMENT*) PtStruct, mode_color );
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment