Commit d188bf5a authored by charras's avatar charras

better compatibility with wxWidgets 2.9. Markers enhancement in pcbnew (right...

better compatibility with wxWidgets 2.9. Markers enhancement in pcbnew (right click can display marker info)
parent 3be6ba42
...@@ -63,12 +63,18 @@ END_EVENT_TABLE() ...@@ -63,12 +63,18 @@ END_EVENT_TABLE()
/*************************************************************************/ /*************************************************************************/
Pcb3D_GLCanvas::Pcb3D_GLCanvas( WinEDA3D_DrawFrame* parent ) : Pcb3D_GLCanvas::Pcb3D_GLCanvas( WinEDA3D_DrawFrame* parent ) :
wxGLCanvas( parent, -1, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE ) wxGLCanvas( parent, -1, NULL, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE )
/*************************************************************************/ /*************************************************************************/
{ {
m_init = FALSE; m_init = FALSE;
m_gllist = 0; m_gllist = 0;
m_Parent = parent; m_Parent = parent;
// Explicitly create a new rendering context instance for this canvas.
m_glRC = new wxGLContext(this);
// Make the new context current (activate it for use) with this canvas.
SetCurrent(*m_glRC);
DisplayStatus(); DisplayStatus();
} }
...@@ -79,6 +85,7 @@ Pcb3D_GLCanvas::~Pcb3D_GLCanvas() ...@@ -79,6 +85,7 @@ Pcb3D_GLCanvas::~Pcb3D_GLCanvas()
{ {
ClearLists(); ClearLists();
m_init = FALSE; m_init = FALSE;
delete m_glRC;
} }
...@@ -484,6 +491,7 @@ void Pcb3D_GLCanvas::OnPaint( wxPaintEvent& event ) ...@@ -484,6 +491,7 @@ void Pcb3D_GLCanvas::OnPaint( wxPaintEvent& event )
const wxSize ClientSize = GetClientSize(); const wxSize ClientSize = GetClientSize();
glViewport( 0, 0, ClientSize.x, ClientSize.y ); glViewport( 0, 0, ClientSize.x, ClientSize.y );
Redraw(); Redraw();
event.Skip(); event.Skip();
} }
......
...@@ -46,8 +46,7 @@ static GLfloat Get3DLayerSide( int act_layer ); ...@@ -46,8 +46,7 @@ static GLfloat Get3DLayerSide( int act_layer );
void Pcb3D_GLCanvas::Redraw( bool finish ) void Pcb3D_GLCanvas::Redraw( bool finish )
/******************************************/ /******************************************/
{ {
SetCurrent(); SetCurrent(*m_glRC);
InitGL(); InitGL();
glMatrixMode( GL_MODELVIEW ); /* position viewer */ glMatrixMode( GL_MODELVIEW ); /* position viewer */
......
...@@ -79,6 +79,7 @@ public: ...@@ -79,6 +79,7 @@ public:
private: private:
bool m_init; bool m_init;
GLuint m_gllist; GLuint m_gllist;
wxGLContext* m_glRC;
public: public:
Pcb3D_GLCanvas( WinEDA3D_DrawFrame *parent ); Pcb3D_GLCanvas( WinEDA3D_DrawFrame *parent );
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "macros.h" #include "macros.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "class_marker_base.h" #include "class_marker_base.h"
#include "dialog_display_info_HTML_base.h"
// Default marquer shape: // Default marquer shape:
...@@ -170,3 +171,18 @@ void MARKER_BASE::DrawMarker( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode ...@@ -170,3 +171,18 @@ void MARKER_BASE::DrawMarker( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode
m_Color // fill collor m_Color // fill collor
); );
} }
/** Function DisplayMarkerInfo()
* Displays the full info of this marker, within an HTML window
*/
void MARKER_BASE::DisplayMarkerInfo( WinEDA_DrawFrame* aFrame )
{
wxString msg = m_drc.ShowHtml();
DIALOG_DISPLAY_HTML_TEXT_BASE
infodisplay( (wxWindow*)aFrame, wxID_ANY, _("Marker Info"),
wxGetMousePosition(), wxSize( 550, 140 ) );
infodisplay.m_htmlWindow->SetPage( msg );
infodisplay.ShowModal();
}
...@@ -21,7 +21,7 @@ void DIALOG_LOAD_ERROR::ListClear(void) ...@@ -21,7 +21,7 @@ void DIALOG_LOAD_ERROR::ListClear(void)
/** Function ListSet /** Function ListSet
* Add a list of items. * Add a list of items.
* @param list = a pointer on a string containing items. Items are separated by '\n' * @param list = a string containing items. Items are separated by '\n'
*/ */
void DIALOG_LOAD_ERROR::ListSet(const wxString &list) void DIALOG_LOAD_ERROR::ListSet(const wxString &list)
{ {
...@@ -42,7 +42,7 @@ void DIALOG_LOAD_ERROR::ListSet(const wxString &list) ...@@ -42,7 +42,7 @@ void DIALOG_LOAD_ERROR::ListSet(const wxString &list)
/** Function MessageSet /** Function MessageSet
* Add a message (in bold) to message list. * Add a message (in bold) to message list.
* @param message = a pointer to the message * @param message = the message
*/ */
void DIALOG_LOAD_ERROR::MessageSet(const wxString &message) void DIALOG_LOAD_ERROR::MessageSet(const wxString &message)
{ {
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "class_marker_sch.h" #include "class_marker_sch.h"
#include "erc.h" #include "erc.h"
#include "dialog_display_info_HTML_base.h"
/* Marker are mainly used to show an ERC error /* Marker are mainly used to show an ERC error
* but they could be used to give a specifi info * but they could be used to give a specifi info
...@@ -130,17 +129,3 @@ EDA_Rect MARKER_SCH::GetBoundingBox() ...@@ -130,17 +129,3 @@ EDA_Rect MARKER_SCH::GetBoundingBox()
return GetBoundingBoxMarker(); return GetBoundingBoxMarker();
} }
/** Function DisplayMarkerInfo()
* Displays the full info of this marker, within an HTML window
*/
void MARKER_SCH::DisplayMarkerInfo( WinEDA_SchematicFrame* aFrame )
{
wxString msg = GetReporter().ShowHtml();
DIALOG_DISPLAY_HTML_TEXT_BASE infodisplay( aFrame, -1, _("Marker Info"),
wxGetMousePosition(), wxSize( 550, 140 ) );
infodisplay.m_htmlWindow->SetPage( msg );
infodisplay.ShowModal();
}
...@@ -75,11 +75,7 @@ public: ...@@ -75,11 +75,7 @@ public:
* It is OK to overestimate the size by a few counts. * It is OK to overestimate the size by a few counts.
*/ */
virtual EDA_Rect GetBoundingBox(); virtual EDA_Rect GetBoundingBox();
/** Function DisplayMarkerInfo()
* Displays the full info of this marker, in a HTML window
*/
void DisplayMarkerInfo(WinEDA_SchematicFrame * aFrame);
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );
......
...@@ -502,7 +502,7 @@ ...@@ -502,7 +502,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size">220,-1</property>
<property name="name">fieldListCtrl</property> <property name="name">fieldListCtrl</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
......
...@@ -89,6 +89,8 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( ...@@ -89,6 +89,8 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
gridStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); gridStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL );
fieldListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES ); fieldListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES );
fieldListCtrl->SetMinSize( wxSize( 220,-1 ) );
gridStaticBoxSizer->Add( fieldListCtrl, 1, wxALL|wxEXPAND, 8 ); gridStaticBoxSizer->Add( fieldListCtrl, 1, wxALL|wxEXPAND, 8 );
addFieldButton = new wxButton( this, wxID_ANY, _("Add Field"), wxDefaultPosition, wxDefaultSize, 0 ); addFieldButton = new wxButton( this, wxID_ANY, _("Add Field"), wxDefaultPosition, wxDefaultSize, 0 );
......
...@@ -23,6 +23,8 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE ...@@ -23,6 +23,8 @@ DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE::DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB_BASE
gridStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); gridStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL );
fieldListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES ); fieldListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES );
fieldListCtrl->SetMinSize( wxSize( 220,-1 ) );
gridStaticBoxSizer->Add( fieldListCtrl, 1, wxALL|wxEXPAND, 8 ); gridStaticBoxSizer->Add( fieldListCtrl, 1, wxALL|wxEXPAND, 8 );
addFieldButton = new wxButton( this, wxID_ANY, _("Add Field"), wxDefaultPosition, wxDefaultSize, 0 ); addFieldButton = new wxButton( this, wxID_ANY, _("Add Field"), wxDefaultPosition, wxDefaultSize, 0 );
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size">220,-1</property>
<property name="name">fieldListCtrl</property> <property name="name">fieldListCtrl</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
......
...@@ -158,6 +158,11 @@ public: ...@@ -158,6 +158,11 @@ public:
} }
/** Function DisplayMarkerInfo()
* Displays the full info of this marker, in a HTML window
*/
void DisplayMarkerInfo(WinEDA_DrawFrame * aFrame);
/** /**
* Function HitTestMarker * Function HitTestMarker
* tests if the given wxPoint is within the bounds of this object. * tests if the given wxPoint is within the bounds of this object.
......
...@@ -626,7 +626,7 @@ enum main_id { ...@@ -626,7 +626,7 @@ enum main_id {
ID_POPUP_PCB_DRAG_TRACK_SEGMENT, ID_POPUP_PCB_DRAG_TRACK_SEGMENT,
ID_POPUP_PCB_MOVE_TRACK_SEGMENT, ID_POPUP_PCB_MOVE_TRACK_SEGMENT,
ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST, ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST,
ID_POPUP_PCB_UNUSED5, ID_POPUP_PCB_GETINFO_MARKER,
ID_POPUP_PCB_UNUSED6, ID_POPUP_PCB_UNUSED6,
ID_POPUP_PCB_UNUSED7, ID_POPUP_PCB_UNUSED7,
ID_POPUP_PCB_UNUSED8, ID_POPUP_PCB_UNUSED8,
......
...@@ -296,17 +296,17 @@ public: ...@@ -296,17 +296,17 @@ public:
// Plotting // Plotting
void ToPlotter( wxCommandEvent& event ); void ToPlotter( wxCommandEvent& event );
void Genere_GERBER( const wxString& FullFileName, int Layer, void Genere_GERBER( const wxString& FullFileName, int Layer,
bool PlotOriginIsAuxAxis, bool PlotOriginIsAuxAxis,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
void Genere_HPGL( const wxString& FullFileName, int Layer, void Genere_HPGL( const wxString& FullFileName, int Layer,
GRTraceMode trace_mode); GRTraceMode trace_mode);
void Genere_PS( const wxString& FullFileName, int Layer, void Genere_PS( const wxString& FullFileName, int Layer,
bool useA4, GRTraceMode trace_mode ); bool useA4, GRTraceMode trace_mode );
void Genere_DXF( const wxString& FullFileName, int Layer, void Genere_DXF( const wxString& FullFileName, int Layer,
GRTraceMode trace_mode); GRTraceMode trace_mode);
void Plot_Layer(Plotter *plotter, int Layer, GRTraceMode trace_mode ); void Plot_Layer(Plotter *plotter, int Layer, GRTraceMode trace_mode );
void Plot_Standard_Layer( Plotter *plotter, int masque_layer, void Plot_Standard_Layer( Plotter *plotter, int masque_layer,
int garde, bool trace_via, int garde, bool trace_via,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
void Plot_Serigraphie( Plotter *plotter, int masque_layer, void Plot_Serigraphie( Plotter *plotter, int masque_layer,
GRTraceMode trace_mode); GRTraceMode trace_mode);
...@@ -395,6 +395,7 @@ private: ...@@ -395,6 +395,7 @@ private:
void createPopupMenuForTracks( TRACK* aTrack, wxMenu* aPopMenu ); void createPopupMenuForTracks( TRACK* aTrack, wxMenu* aPopMenu );
void createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ); void createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu );
void createPopUpBlockMenu( wxMenu* menu ); void createPopUpBlockMenu( wxMenu* menu );
void createPopUpMenuForMarkers( MARKER* aMarker, wxMenu* aPopMenu );
public: public:
WinEDA_PcbFrame( wxWindow* father, const wxString& title, WinEDA_PcbFrame( wxWindow* father, const wxString& title,
......
...@@ -90,3 +90,4 @@ void MARKER::DisplayInfo( WinEDA_DrawFrame* frame ) ...@@ -90,3 +90,4 @@ void MARKER::DisplayInfo( WinEDA_DrawFrame* frame )
text_pos = 25; text_pos = 25;
Affiche_1_Parametre( frame, text_pos, txtA, txtB, DARKBROWN ); Affiche_1_Parametre( frame, text_pos, txtA, txtB, DARKBROWN );
} }
...@@ -78,7 +78,6 @@ public: ...@@ -78,7 +78,6 @@ public:
*/ */
void DisplayInfo( WinEDA_DrawFrame* frame ); void DisplayInfo( WinEDA_DrawFrame* frame );
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format.
......
...@@ -141,6 +141,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -141,6 +141,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT: case ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT:
case ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS: case ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS:
case ID_POPUP_PCB_EDIT_DRAWING: case ID_POPUP_PCB_EDIT_DRAWING:
case ID_POPUP_PCB_GETINFO_MARKER:
break; break;
case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND:
...@@ -1019,6 +1020,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -1019,6 +1020,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
case ID_POPUP_PCB_GETINFO_MARKER:
if( GetCurItem() && GetCurItem()->Type() == TYPE_MARKER )
((MARKER*)GetCurItem())->DisplayMarkerInfo( this );
DrawPanel->MouseToCursorSchema();
break;
case ID_POPUP_PCB_DELETE_DRAWING_LAYER: case ID_POPUP_PCB_DELETE_DRAWING_LAYER:
Delete_Drawings_All_Layer( (DRAWSEGMENT*) GetCurItem(), &dc ); Delete_Drawings_All_Layer( (DRAWSEGMENT*) GetCurItem(), &dc );
SetCurItem( NULL ); SetCurItem( NULL );
......
...@@ -272,8 +272,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -272,8 +272,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
break; break;
case TYPE_MARKER: case TYPE_MARKER:
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, createPopUpMenuForMarkers( (MARKER*) item, aPopMenu );
_( "Delete Marker" ), delete_xpm );
break; break;
case TYPE_COTATION: case TYPE_COTATION:
...@@ -874,3 +873,11 @@ void WinEDA_PcbFrame::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu ) ...@@ -874,3 +873,11 @@ void WinEDA_PcbFrame::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB, ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB,
_( "Delete" ), delete_text_xpm ); _( "Delete" ), delete_text_xpm );
} }
/**********************************************************************/
void WinEDA_PcbFrame::createPopUpMenuForMarkers( MARKER* aMarker, wxMenu* aPopMenu )
/**********************************************************************/
{
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MARKER, _( "Delete Marker" ), delete_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_GETINFO_MARKER, _( "Marker Error Info" ), info_xpm );
}
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