Commit d55989cc authored by charras's avatar charras

patch for 3D viewer from Emanuel Rumpf and minor other changes

parent 680762a9
......@@ -172,6 +172,14 @@ Info_3D_Visu::Info_3D_Visu()
m_Layers = 1;
m_BoardSettings = NULL;
m_Draw3DAxis = TRUE;
m_Draw3DModule = TRUE;
m_Draw3DPlace = TRUE;
m_Draw3DZone = TRUE;
m_Draw3DComments = TRUE;
m_Draw3DDrawings = TRUE;
m_Draw3DEco1 = TRUE;
m_Draw3DEco2 = TRUE;
}
......
......@@ -83,6 +83,7 @@ Pcb3D_GLCanvas::~Pcb3D_GLCanvas()
/*************************************/
{
ClearLists();
m_init = FALSE;
}
......@@ -92,7 +93,7 @@ void Pcb3D_GLCanvas::ClearLists()
{
if( m_gllist > 0 )
glDeleteLists( m_gllist, 1 );
m_init = FALSE;
// m_init = FALSE;
m_gllist = 0;
}
......
//////////////////////////////////////
// Name: 3d_draw.cpp
//////////////////////////////////////
......@@ -47,7 +46,8 @@ static void Draw3D_ArcSegment(double startx, double starty,
double endx, double endy,double width, double zpos);
static void Draw3D_CircleSegment(double startx, double starty,
double endx, double endy,double width, double zpos);
static int Get3DLayerEnable(int act_layer);
static GLfloat Get3DLayerSide(int act_layer);
/******************************************/
void Pcb3D_GLCanvas::Redraw( bool finish )
......@@ -122,7 +122,8 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
g_Parm_3D_Visu.m_LayerZcoord[ii] = g_Parm_3D_Visu.m_Epoxy_Width;
}
GLfloat zpos_cu = 500 * g_Parm_3D_Visu.m_BoardScale;
//GLfloat zpos_cu = 500 * g_Parm_3D_Visu.m_BoardScale;
GLfloat zpos_cu = 10 * g_Parm_3D_Visu.m_BoardScale;
GLfloat zpos_cmp = g_Parm_3D_Visu.m_Epoxy_Width + zpos_cu;
g_Parm_3D_Visu.m_LayerZcoord[ADHESIVE_N_CU] = -zpos_cu * 2;
g_Parm_3D_Visu.m_LayerZcoord[ADHESIVE_N_CMP] = zpos_cmp + zpos_cu;
......@@ -138,6 +139,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
/* draw axes */
if (g_Parm_3D_Visu.m_Draw3DAxis){
glEnable( GL_COLOR_MATERIAL );
SetGLColor( WHITE );
glBegin( GL_LINES );
......@@ -150,6 +152,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
glVertex3f( 0.0, 0.0, 0.0 );
glVertex3f( 0.0, 0.0, 0.3 ); // Z axis
glEnd();
}
/* Draw epoxy limits (do not use, works and test in progress) */
#if 0
......@@ -198,16 +201,33 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
else
Draw3D_Track( pt_piste );
}
if (g_Parm_3D_Visu.m_Draw3DZone){
for( pt_piste = pcb->m_Zone; pt_piste != NULL; pt_piste = (TRACK*) pt_piste->Pnext )
{
if( pt_piste->Type() == TYPEZONE )
Draw3D_Track( pt_piste );
}
}
/* Trac des edges */
EDA_BaseStruct* PtStruct;
for( PtStruct = pcb->m_Drawings; PtStruct != NULL; PtStruct = PtStruct->Pnext )
{
//if( PtStruct->Type() != TYPEDRAWSEGMENT )
// continue;
if( PtStruct->Type() == TYPEDRAWSEGMENT )
{
#undef STRUCT
#define STRUCT ( (DRAWSEGMENT*) PtStruct )
if( PtStruct->Type() != TYPEDRAWSEGMENT )
continue;
Draw3D_DrawSegment( STRUCT );
}
if( PtStruct->Type() == TYPETEXTE )
{
#undef STRUCT
#define STRUCT ( (TEXTE_PCB*) PtStruct )
Draw3D_DrawText( STRUCT );
}
}
/* trac des modules */
MODULE* Module = (MODULE*) pcb->m_Modules;
......@@ -284,8 +304,11 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via )
color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[CMP_N];
if( color & ITEM_NOT_SHOW )
continue;
SetGLColor( color );
//SetGLColor( color );
SetGLColor( LIGHTGRAY );
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
if (layer == COPPER_LAYER_N) zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
else zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
Draw3D_FilledCircle( x, -y, r, hole, zpos );
if( layer >= top_layer )
break;
......@@ -339,11 +362,75 @@ void Pcb3D_GLCanvas::Draw3D_DrawSegment( DRAWSEGMENT* segment )
}
else
{
zpos = g_Parm_3D_Visu.m_LayerZcoord[segment->GetLayer()];
Draw3D_FilledSegment( x, -y, xf, -yf, w, zpos );
layer = segment->GetLayer();
glNormal3f( 0.0, 0.0, Get3DLayerSide(layer) );
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
if (Get3DLayerEnable(layer))
{
switch( segment->m_Shape )
{
case S_ARC:
Draw3D_ArcSegment( x, -y, xf, -yf, w, zpos);
break;
case S_CIRCLE:
Draw3D_CircleSegment( x, -y, xf, -yf, w, zpos);
break;
default :
Draw3D_FilledSegment( x, -y, xf, -yf, w, zpos);
break;
}
}
}
}
/*************************************************************/
void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
/*************************************************************/
{
int layer = text->GetLayer();
double x, y, xf, yf;
double zpos, w;
int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
int coord[104];
int ii, jj, kk, ll, nbpoints;
if (Get3DLayerEnable(layer))
{
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
glNormal3f( 0.0, 0.0, Get3DLayerSide(layer) );
text->CreateDrawData();
jj = 5; ii = jj + 1;
while( ii < text->m_TextDrawingsSize )
{
nbpoints = text->m_TextDrawings[jj];
if( nbpoints > 50 )
nbpoints = 50;
for( kk = 0, ll = 0; (kk < nbpoints) && (ii < text->m_TextDrawingsSize); kk++ )
{
coord[ll++] = text->m_TextDrawings[ii++] + text->m_Pos.x;
coord[ll++] = text->m_TextDrawings[ii++] + text->m_Pos.y;
}
jj = ii++;
for( kk = 0, ll = 0; kk < (nbpoints - 1); kk++, ll += 2 )
{
SetGLColor( color );
w = text->m_Width * g_Parm_3D_Visu.m_BoardScale;
x = coord[ll] * g_Parm_3D_Visu.m_BoardScale;
y = coord[ll + 1] * g_Parm_3D_Visu.m_BoardScale;
xf = coord[ll + 2] * g_Parm_3D_Visu.m_BoardScale;
yf = coord[ll + 3] * g_Parm_3D_Visu.m_BoardScale;
//printf("text koordinata x=%d, y=%d, x2=%d, y2=%d\n",x,y,xf,yf);
Draw3D_FilledSegment( x, -y, xf, -yf, w, zpos );
}
}
}
}
/*********************************************/
void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
......@@ -375,6 +462,15 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
/* Draw module shape: 3D shape if exists (or module edge if not exists) */
Struct3D_Master* Struct3D = m_3D_Drawings;
bool As3dShape = FALSE;
bool Place3D;
if ( (Struct3D->m_Shape3DName.Find(wxString(wxT("placa"))) != -1) ||
(Struct3D->m_Shape3DName.Find(wxString(wxT("place"))) != -1) )
Place3D = TRUE;
else Place3D = FALSE;
if ( (g_Parm_3D_Visu.m_Draw3DModule && !Place3D) ||
(g_Parm_3D_Visu.m_Draw3DPlace && Place3D) )
{
glPushMatrix();
glTranslatef( m_Pos.x * g_Parm_3D_Visu.m_BoardScale,
-m_Pos.y * g_Parm_3D_Visu.m_BoardScale,
......@@ -398,8 +494,8 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
Struct3D->ReadData();
}
}
glPopMatrix();
}
if( !As3dShape )
{
......@@ -546,9 +642,12 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
if( color & ITEM_NOT_SHOW )
continue;
SetGLColor( color );
//SetGLColor( color );
SetGLColor( LIGHTGRAY );
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
if (layer == COPPER_LAYER_N) zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
else zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
Draw3D_FilledCircle( x, -y, r, hole, zpos );
}
......@@ -591,8 +690,11 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
if( color & ITEM_NOT_SHOW )
continue;
SetGLColor( color );
//SetGLColor( color );
SetGLColor( LIGHTGRAY );
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
if (layer == COPPER_LAYER_N) zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
else zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
Draw3D_FilledSegmentWithHole( ox, -oy, fx, -fy, w, drillx, -drilly, hole, zpos );
}
}
......@@ -662,8 +764,11 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
if( color & ITEM_NOT_SHOW )
continue;
SetGLColor( color );
//SetGLColor( color );
SetGLColor( LIGHTGRAY );
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
if (layer == COPPER_LAYER_N) zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
else zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
glBegin( GL_QUAD_STRIP );
for( ii = 0; ii < 8; ii++ )
{
......@@ -946,3 +1051,40 @@ double x, y, hole, rayon;
}
glEnd();
}
/******************************************/
static int Get3DLayerEnable(int act_layer)
/******************************************/
{
bool enablelayer;
enablelayer = TRUE;
if (act_layer == DRAW_N && !g_Parm_3D_Visu.m_Draw3DDrawings)
enablelayer = FALSE;
if (act_layer == COMMENT_N && !g_Parm_3D_Visu.m_Draw3DComments)
enablelayer = FALSE;
if (act_layer == ECO1_N && !g_Parm_3D_Visu.m_Draw3DEco1)
enablelayer = FALSE;
if (act_layer == ECO2_N && !g_Parm_3D_Visu.m_Draw3DEco2)
enablelayer = FALSE;
return enablelayer;
}
/******************************************/
static GLfloat Get3DLayerSide(int act_layer)
/******************************************/
{
GLfloat nZ;
nZ = 1.0;
if (
(act_layer <= LAST_COPPER_LAYER-1) ||
(act_layer == ADHESIVE_N_CU) ||
(act_layer == SOLDERPASTE_N_CU) ||
(act_layer == SILKSCREEN_N_CU) ||
(act_layer == SOLDERMASK_N_CU)
)
nZ = -1.0;
return nZ;
}
......@@ -293,6 +293,38 @@ void WinEDA3D_DrawFrame::Process_Special_Functions( wxCommandEvent& event )
Set3DBgColor();
return;
case ID_MENU3D_AXIS_ONOFF:
Set3DAxisOnOff();
return;
case ID_MENU3D_MODULE_ONOFF:
Set3DModuleOnOff();
return;
case ID_MENU3D_PLACE_ONOFF:
Set3DPlaceOnOff();
return;
case ID_MENU3D_ZONE_ONOFF:
Set3DZoneOnOff();
return;
case ID_MENU3D_COMMENTS_ONOFF:
Set3DCommentsOnOff();
return;
case ID_MENU3D_DRAWINGS_ONOFF:
Set3DDrawingsOnOff();
return;
case ID_MENU3D_ECO1_ONOFF:
Set3DEco1OnOff();
return;
case ID_MENU3D_ECO2_ONOFF:
Set3DEco2OnOff();
return;
default:
wxMessageBox(
wxT( "WinEDA3D_DrawFrame::Process_Special_Functions() error: unknown command" ) );
......@@ -315,7 +347,6 @@ void WinEDA3D_DrawFrame::NewDisplay()
m_Canvas->Refresh( true );
}
/******************************************/
void WinEDA3D_DrawFrame::Set3DBgColor()
/******************************************/
......@@ -339,3 +370,75 @@ void WinEDA3D_DrawFrame::Set3DBgColor()
NewDisplay();
}
}
/******************************************/
void WinEDA3D_DrawFrame::Set3DAxisOnOff()
/******************************************/
{
if (g_Parm_3D_Visu.m_Draw3DAxis) g_Parm_3D_Visu.m_Draw3DAxis = FALSE;
else g_Parm_3D_Visu.m_Draw3DAxis = TRUE;
NewDisplay();
}
/******************************************/
void WinEDA3D_DrawFrame::Set3DModuleOnOff()
/******************************************/
{
if (g_Parm_3D_Visu.m_Draw3DModule) g_Parm_3D_Visu.m_Draw3DModule = FALSE;
else g_Parm_3D_Visu.m_Draw3DModule = TRUE;
NewDisplay();
}
/******************************************/
void WinEDA3D_DrawFrame::Set3DPlaceOnOff()
/******************************************/
{
if (g_Parm_3D_Visu.m_Draw3DPlace) g_Parm_3D_Visu.m_Draw3DPlace = FALSE;
else g_Parm_3D_Visu.m_Draw3DPlace = TRUE;
NewDisplay();
}
/******************************************/
void WinEDA3D_DrawFrame::Set3DZoneOnOff()
/******************************************/
{
if (g_Parm_3D_Visu.m_Draw3DZone) g_Parm_3D_Visu.m_Draw3DZone = FALSE;
else g_Parm_3D_Visu.m_Draw3DZone = TRUE;
NewDisplay();
}
/******************************************/
void WinEDA3D_DrawFrame::Set3DCommentsOnOff()
/******************************************/
{
if (g_Parm_3D_Visu.m_Draw3DComments) g_Parm_3D_Visu.m_Draw3DComments = FALSE;
else g_Parm_3D_Visu.m_Draw3DComments = TRUE;
NewDisplay();
}
/******************************************/
void WinEDA3D_DrawFrame::Set3DDrawingsOnOff()
/******************************************/
{
if (g_Parm_3D_Visu.m_Draw3DDrawings) g_Parm_3D_Visu.m_Draw3DDrawings = FALSE;
else g_Parm_3D_Visu.m_Draw3DDrawings = TRUE;
NewDisplay();
}
/******************************************/
void WinEDA3D_DrawFrame::Set3DEco1OnOff()
/******************************************/
{
if (g_Parm_3D_Visu.m_Draw3DEco1) g_Parm_3D_Visu.m_Draw3DEco1 = FALSE;
else g_Parm_3D_Visu.m_Draw3DEco1 = TRUE;
NewDisplay();
}
/******************************************/
void WinEDA3D_DrawFrame::Set3DEco2OnOff()
/******************************************/
{
if (g_Parm_3D_Visu.m_Draw3DEco2) g_Parm_3D_Visu.m_Draw3DEco2 = FALSE;
else g_Parm_3D_Visu.m_Draw3DEco2 = TRUE;
NewDisplay();
}
......@@ -120,6 +120,29 @@ void WinEDA3D_DrawFrame::ReCreateMenuBar()
ADD_MENUITEM( referencesMenu, ID_MENU3D_BGCOLOR_SELECTION,
_( "Choose background color" ), palette_xpm );
ADD_MENUITEM( referencesMenu, ID_MENU3D_AXIS_ONOFF,
_( "Axis On/Off" ), axis3d_front_xpm );
ADD_MENUITEM( referencesMenu, ID_MENU3D_MODULE_ONOFF,
_( "Module 3D On/Off" ), add_component_xpm );
ADD_MENUITEM( referencesMenu, ID_MENU3D_PLACE_ONOFF,
_( "PCB place 3D On/off" ), select_w_layer_xpm );
ADD_MENUITEM( referencesMenu, ID_MENU3D_ZONE_ONOFF,
_( "Zone On/Off" ), add_zone_xpm );
ADD_MENUITEM( referencesMenu, ID_MENU3D_COMMENTS_ONOFF,
_( "Comments On/Off" ), edit_sheet_xpm );
ADD_MENUITEM( referencesMenu, ID_MENU3D_DRAWINGS_ONOFF,
_( "Drawings On/Off" ), options_text_xpm );
ADD_MENUITEM( referencesMenu, ID_MENU3D_ECO1_ONOFF,
_( "Eco1 On/Off" ), options_text_xpm );
ADD_MENUITEM( referencesMenu, ID_MENU3D_ECO2_ONOFF,
_( "Eco2 On/Off" ), options_text_xpm );
SetMenuBar( menuBar );
}
......
......@@ -54,6 +54,14 @@ public:
float m_Rot[4]; /* man rotation of object */
float m_Zoom; /* field of view in degrees */
S3D_Color m_BgColor;
bool m_Draw3DAxis;
bool m_Draw3DModule;
bool m_Draw3DPlace;
bool m_Draw3DZone;
bool m_Draw3DComments;
bool m_Draw3DDrawings;
bool m_Draw3DEco1;
bool m_Draw3DEco2;
wxPoint m_BoardPos;
wxSize m_BoardSize;
int m_Layers;
......@@ -107,6 +115,8 @@ public:
void Draw3D_Track(TRACK * track);
void Draw3D_Via(SEGVIA * via);
void Draw3D_DrawSegment(DRAWSEGMENT * segment);
void Draw3D_DrawText(TEXTE_PCB * text);
//int Get3DLayerEnable(int act_layer);
DECLARE_EVENT_TABLE()
};
......@@ -151,6 +161,14 @@ public:
void NewDisplay();
void Set3DBgColor();
void Set3DAxisOnOff();
void Set3DModuleOnOff();
void Set3DPlaceOnOff();
void Set3DZoneOnOff();
void Set3DCommentsOnOff();
void Set3DDrawingsOnOff();
void Set3DEco1OnOff();
void Set3DEco2OnOff();
DECLARE_EVENT_TABLE()
};
......
......@@ -15,7 +15,7 @@ OBJECTS= \
common_plotHPGL_functions.o\
hotkeys_basic.o\
drawtxt.o \
infospgm.o\
about_kicad.o\
wxwineda.o \
string.o \
gr_basic.o\
......
......@@ -852,6 +852,14 @@ enum main_id {
ID_MOVE3D_UP,
ID_MOVE3D_DOWN,
ID_MENU3D_BGCOLOR_SELECTION,
ID_MENU3D_AXIS_ONOFF,
ID_MENU3D_MODULE_ONOFF,
ID_MENU3D_PLACE_ONOFF,
ID_MENU3D_ZONE_ONOFF,
ID_MENU3D_DRAWINGS_ONOFF,
ID_MENU3D_COMMENTS_ONOFF,
ID_MENU3D_ECO1_ONOFF,
ID_MENU3D_ECO2_ONOFF,
ID_3D_UNUSED0,
ID_3D_UNUSED1,
ID_3D_UNUSED2,
......
No preview for this file type
This diff is collapsed.
......@@ -53,7 +53,7 @@ BEGIN_EVENT_TABLE( WinEDA_DrillFrame, wxDialog )
EVT_BUTTON( wxID_OK, WinEDA_DrillFrame::OnOkClick )
EVT_BUTTON( wxID_CLOSE, WinEDA_DrillFrame::OnCloseClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_DrillFrame::OnCancelClick )
////@end WinEDA_DrillFrame event table entries
......@@ -139,6 +139,8 @@ void WinEDA_DrillFrame::Init()
m_ThroughViasInfoMsg = NULL;
m_MicroViasInfoMsg = NULL;
m_BuriedViasInfoMsg = NULL;
m_OkButton = NULL;
m_CancelButton = NULL;
////@end WinEDA_DrillFrame member initialisation
}
......@@ -150,7 +152,7 @@ void WinEDA_DrillFrame::Init()
void WinEDA_DrillFrame::CreateControls()
{
////@begin WinEDA_DrillFrame content construction
// Generated by DialogBlocks, 14/01/2008 08:32:06 (unregistered)
// Generated by DialogBlocks, 12/08/2008 13:05:18 (unregistered)
WinEDA_DrillFrame* itemDialog1 = this;
......@@ -174,6 +176,8 @@ void WinEDA_DrillFrame::CreateControls()
m_Choice_Zeros_FormatStrings.Add(_("keep zeros"));
m_Choice_Zeros_Format = new wxRadioBox( itemDialog1, ID_SEL_ZEROS_FMT, _("Zeros Format"), wxDefaultPosition, wxDefaultSize, m_Choice_Zeros_FormatStrings, 1, wxRA_SPECIFY_COLS );
m_Choice_Zeros_Format->SetSelection(0);
if (WinEDA_DrillFrame::ShowToolTips())
m_Choice_Zeros_Format->SetToolTip(_("Choose EXCELLON numbers notation"));
m_LeftBoxSizer->Add(m_Choice_Zeros_Format, 0, wxALIGN_LEFT|wxALL, 5);
wxArrayString m_Choice_PrecisionStrings;
......@@ -181,6 +185,8 @@ void WinEDA_DrillFrame::CreateControls()
m_Choice_PrecisionStrings.Add(_("2:4"));
m_Choice_Precision = new wxRadioBox( itemDialog1, ID_SEL_PRECISION, _("Precision"), wxDefaultPosition, wxDefaultSize, m_Choice_PrecisionStrings, 1, wxRA_SPECIFY_COLS );
m_Choice_Precision->SetSelection(0);
if (WinEDA_DrillFrame::ShowToolTips())
m_Choice_Precision->SetToolTip(_("Choose EXCELLON numbers precision"));
m_LeftBoxSizer->Add(m_Choice_Precision, 0, wxGROW|wxALL, 5);
wxArrayString m_Choice_Drill_OffsetStrings;
......@@ -188,6 +194,8 @@ void WinEDA_DrillFrame::CreateControls()
m_Choice_Drill_OffsetStrings.Add(_("auxiliary axis"));
m_Choice_Drill_Offset = new wxRadioBox( itemDialog1, ID_SEL_DRILL_SHEET, _("Drill Origin:"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_OffsetStrings, 1, wxRA_SPECIFY_COLS );
m_Choice_Drill_Offset->SetSelection(0);
if (WinEDA_DrillFrame::ShowToolTips())
m_Choice_Drill_Offset->SetToolTip(_("Choose the coordinate origin: absolute or relative to the auxiliray axis"));
m_LeftBoxSizer->Add(m_Choice_Drill_Offset, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL);
......@@ -199,6 +207,8 @@ void WinEDA_DrillFrame::CreateControls()
m_Choice_Drill_MapStrings.Add(_("drill sheet (PostScript)"));
m_Choice_Drill_Map = new wxRadioBox( itemDialog1, ID_SEL_DRILL_SHEET, _("Drill Sheet:"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_MapStrings, 1, wxRA_SPECIFY_COLS );
m_Choice_Drill_Map->SetSelection(0);
if (WinEDA_DrillFrame::ShowToolTips())
m_Choice_Drill_Map->SetToolTip(_("Creates a drill map in PS or HPGL format"));
itemBoxSizer8->Add(m_Choice_Drill_Map, 0, wxGROW|wxALL, 5);
wxArrayString m_Choice_Drill_ReportStrings;
......@@ -206,6 +216,8 @@ void WinEDA_DrillFrame::CreateControls()
m_Choice_Drill_ReportStrings.Add(_("Drill report"));
m_Choice_Drill_Report = new wxRadioBox( itemDialog1, ID_SEL_DRILL_REPORT, _("Drill Report:"), wxDefaultPosition, wxDefaultSize, m_Choice_Drill_ReportStrings, 1, wxRA_SPECIFY_COLS );
m_Choice_Drill_Report->SetSelection(0);
if (WinEDA_DrillFrame::ShowToolTips())
m_Choice_Drill_Report->SetToolTip(_("Creates a plain text report"));
itemBoxSizer8->Add(m_Choice_Drill_Report, 0, wxGROW|wxALL, 5);
wxStaticBox* itemStaticBoxSizer11Static = new wxStaticBox(itemDialog1, wxID_ANY, _("HPGL plotter Options:"));
......@@ -234,6 +246,8 @@ void WinEDA_DrillFrame::CreateControls()
m_Check_Minimal = new wxCheckBox( itemDialog1, ID_CHECKBOX3, _("minimal header"), wxDefaultPosition, wxDefaultSize, 0 );
m_Check_Minimal->SetValue(false);
if (WinEDA_DrillFrame::ShowToolTips())
m_Check_Minimal->SetToolTip(_("If checked, the EXCELLON header is minimal"));
itemStaticBoxSizer16->Add(m_Check_Minimal, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxVERTICAL);
......@@ -275,13 +289,14 @@ void WinEDA_DrillFrame::CreateControls()
itemBoxSizer19->Add(5, 5, 1, wxGROW|wxALL, 5);
wxButton* itemButton31 = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton31->SetForegroundColour(wxColour(156, 1, 5));
itemBoxSizer19->Add(itemButton31, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_OkButton = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_OkButton->SetDefault();
m_OkButton->SetForegroundColour(wxColour(156, 1, 5));
itemBoxSizer19->Add(m_OkButton, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxButton* itemButton32 = new wxButton( itemDialog1, wxID_CLOSE, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton32->SetForegroundColour(wxColour(16, 1, 205));
itemBoxSizer19->Add(itemButton32, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_CancelButton = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_CancelButton->SetForegroundColour(wxColour(16, 1, 205));
itemBoxSizer19->Add(m_CancelButton, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
// Set validators
m_Choice_Unit->SetValidator( wxGenericValidator(& s_Unit_Drill_is_Inch) );
......@@ -290,6 +305,7 @@ void WinEDA_DrillFrame::CreateControls()
m_Check_Minimal->SetValidator( wxGenericValidator(& Minimal) );
////@end WinEDA_DrillFrame content construction
SetFocus(); // Under wxGTK: mandatory to close dialog by the ESC key
InitDisplayParams();
}
......@@ -318,10 +334,10 @@ void WinEDA_DrillFrame::OnOkClick( wxCommandEvent& event )
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE
*/
void WinEDA_DrillFrame::OnCloseClick( wxCommandEvent& event )
void WinEDA_DrillFrame::OnCancelClick( wxCommandEvent& event )
{
UpdateConfig(); /* Save drill options: */
Close( true ); // true is to force the frame to close
event.Skip(); // Process the default cancel event (close dialog)
}
......
......@@ -47,7 +47,7 @@ class wxBoxSizer;
#define ID_CHECKBOX2 10011
#define ID_CHECKBOX3 10012
#define SYMBOL_WINEDA_DRILLFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
#define SYMBOL_WINEDA_DRILLFRAME_TITLE _("WinEDA_DrillFrame")
#define SYMBOL_WINEDA_DRILLFRAME_TITLE _("Drill Files Generation")
#define SYMBOL_WINEDA_DRILLFRAME_IDNAME ID_WINEDA_DRILLFRAME
#define SYMBOL_WINEDA_DRILLFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_DRILLFRAME_POSITION wxDefaultPosition
......@@ -99,8 +99,8 @@ public:
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnOkClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE
void OnCloseClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event );
////@end WinEDA_DrillFrame event handler declarations
......@@ -136,6 +136,8 @@ public:
wxStaticText* m_ThroughViasInfoMsg;
wxStaticText* m_MicroViasInfoMsg;
wxStaticText* m_BuriedViasInfoMsg;
wxButton* m_OkButton;
wxButton* m_CancelButton;
////@end WinEDA_DrillFrame member variables
private:
......
......@@ -128,6 +128,7 @@
<long name="locked">0</long>
<string name="template-name">""</string>
<bool name="dirty">1</bool>
<long name="makefile-last-written">-8519680</long>
<string name="Compiler name">""</string>
<string name="Build mode">"Debug"</string>
<string name="Unicode mode">"ANSI"</string>
......@@ -169,6 +170,8 @@
<string name="wxWidgets build command">"%AUTO%"</string>
<string name="wxWidgets clean command">"%AUTO%"</string>
<string name="PATH variable">"%AUTO%"</string>
<bool name="Suppress source rules">0</bool>
<bool name="Enable makefile generation">1</bool>
</document>
</document>
</data>
......@@ -219,7 +222,7 @@
<string name="proxy-Implementation filename">"dialog_gendrill.cpp"</string>
<string name="proxy-Header filename">"dialog_gendrill.h"</string>
<string name="proxy-XRC filename">""</string>
<string name="proxy-Title">"WinEDA_DrillFrame"</string>
<string name="proxy-Title">"Drill Files Generation"</string>
<bool name="proxy-Centre">1</bool>
<string name="proxy-Icon">""</string>
<bool name="proxy-Dialog units">0</bool>
......@@ -405,7 +408,7 @@
<string name="proxy-Items">"decimal format|suppress leading zeros|suppress trailing zeros|keep zeros"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Tooltip text">"Choose EXCELLON numbers notation"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
......@@ -469,7 +472,7 @@
<string name="proxy-Items">"2:3|2:4"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Tooltip text">"Choose EXCELLON numbers precision"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
......@@ -533,7 +536,7 @@
<string name="proxy-Items">"absolute|auxiliary axis"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Tooltip text">"Choose the coordinate origin: absolute or relative to the auxiliray axis"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
......@@ -623,7 +626,7 @@
<string name="proxy-Items">"None|drill sheet (HPGL)|drill sheet (PostScript)"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Tooltip text">"Creates a drill map in PS or HPGL format"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
......@@ -687,7 +690,7 @@
<string name="proxy-Items">"None|Drill report"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Tooltip text">"Creates a plain text report"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
......@@ -1185,7 +1188,7 @@
<string name="proxy-Label">"minimal header"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Tooltip text">"If checked, the EXCELLON header is minimal"</string>
<string name="proxy-Data variable">"Minimal"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Data source">""</string>
......@@ -1860,9 +1863,9 @@
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Member variable name">"m_OkButton"</string>
<string name="proxy-Label">"OK"</string>
<bool name="proxy-Default">0</bool>
<bool name="proxy-Default">1</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">""</string>
......@@ -1907,7 +1910,7 @@
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxButton: wxID_CLOSE"</string>
<string name="title">"wxButton: wxID_CANCEL"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialogcontrol"</string>
......@@ -1917,9 +1920,9 @@
<long name="locked">0</long>
<string name="created">"13/1/2008"</string>
<string name="proxy-type">"wbButtonProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnCloseClick|NONE||WinEDA_DrillFrame"</string>
<string name="proxy-Id name">"wxID_CLOSE"</string>
<long name="proxy-Id value">5001</long>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick|NONE||WinEDA_DrillFrame"</string>
<string name="proxy-Id name">"wxID_CANCEL"</string>
<long name="proxy-Id value">5101</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxButton"</string>
<string name="proxy-Base class">"wxButton"</string>
......@@ -1927,8 +1930,8 @@
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"&amp;Close"</string>
<string name="proxy-Member variable name">"m_CancelButton"</string>
<string name="proxy-Label">"Cancel"</string>
<bool name="proxy-Default">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
......
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