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()
/*************************************************************************/
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_gllist = 0;
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();
}
......@@ -79,6 +85,7 @@ Pcb3D_GLCanvas::~Pcb3D_GLCanvas()
{
ClearLists();
m_init = FALSE;
delete m_glRC;
}
......@@ -484,6 +491,7 @@ void Pcb3D_GLCanvas::OnPaint( wxPaintEvent& event )
const wxSize ClientSize = GetClientSize();
glViewport( 0, 0, ClientSize.x, ClientSize.y );
Redraw();
event.Skip();
}
......
......@@ -46,8 +46,7 @@ static GLfloat Get3DLayerSide( int act_layer );
void Pcb3D_GLCanvas::Redraw( bool finish )
/******************************************/
{
SetCurrent();
SetCurrent(*m_glRC);
InitGL();
glMatrixMode( GL_MODELVIEW ); /* position viewer */
......
......@@ -79,6 +79,7 @@ public:
private:
bool m_init;
GLuint m_gllist;
wxGLContext* m_glRC;
public:
Pcb3D_GLCanvas( WinEDA3D_DrawFrame *parent );
......
......@@ -13,6 +13,7 @@
#include "macros.h"
#include "class_drawpanel.h"
#include "class_marker_base.h"
#include "dialog_display_info_HTML_base.h"
// Default marquer shape:
......@@ -170,3 +171,18 @@ void MARKER_BASE::DrawMarker( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode
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)
/** Function ListSet
* 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)
{
......@@ -42,7 +42,7 @@ void DIALOG_LOAD_ERROR::ListSet(const wxString &list)
/** Function MessageSet
* 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)
{
......
......@@ -11,7 +11,6 @@
#include "class_marker_sch.h"
#include "erc.h"
#include "dialog_display_info_HTML_base.h"
/* Marker are mainly used to show an ERC error
* but they could be used to give a specifi info
......@@ -130,17 +129,3 @@ EDA_Rect MARKER_SCH::GetBoundingBox()
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();
}
......@@ -76,10 +76,6 @@ public:
*/
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)
void Show( int nestLevel, std::ostream& os );
......
......@@ -502,7 +502,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</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="permission">protected</property>
<property name="pos"></property>
......
......@@ -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 );
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 );
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
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->SetMinSize( wxSize( 220,-1 ) );
gridStaticBoxSizer->Add( fieldListCtrl, 1, wxALL|wxEXPAND, 8 );
addFieldButton = new wxButton( this, wxID_ANY, _("Add Field"), wxDefaultPosition, wxDefaultSize, 0 );
......
......@@ -112,7 +112,7 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</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="permission">protected</property>
<property name="pos"></property>
......
......@@ -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
* tests if the given wxPoint is within the bounds of this object.
......
......@@ -626,7 +626,7 @@ enum main_id {
ID_POPUP_PCB_DRAG_TRACK_SEGMENT,
ID_POPUP_PCB_MOVE_TRACK_SEGMENT,
ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST,
ID_POPUP_PCB_UNUSED5,
ID_POPUP_PCB_GETINFO_MARKER,
ID_POPUP_PCB_UNUSED6,
ID_POPUP_PCB_UNUSED7,
ID_POPUP_PCB_UNUSED8,
......
......@@ -395,6 +395,7 @@ private:
void createPopupMenuForTracks( TRACK* aTrack, wxMenu* aPopMenu );
void createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu );
void createPopUpBlockMenu( wxMenu* menu );
void createPopUpMenuForMarkers( MARKER* aMarker, wxMenu* aPopMenu );
public:
WinEDA_PcbFrame( wxWindow* father, const wxString& title,
......
......@@ -90,3 +90,4 @@ void MARKER::DisplayInfo( WinEDA_DrawFrame* frame )
text_pos = 25;
Affiche_1_Parametre( frame, text_pos, txtA, txtB, DARKBROWN );
}
......@@ -78,7 +78,6 @@ public:
*/
void DisplayInfo( WinEDA_DrawFrame* frame );
/**
* Function Save
* 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 )
case ID_POPUP_PCB_VIA_HOLE_RESET_TO_DEFAULT:
case ID_POPUP_PCB_VIA_HOLE_EXPORT_TO_OTHERS:
case ID_POPUP_PCB_EDIT_DRAWING:
case ID_POPUP_PCB_GETINFO_MARKER:
break;
case ID_POPUP_CANCEL_CURRENT_COMMAND:
......@@ -1019,6 +1020,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->MouseToCursorSchema();
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:
Delete_Drawings_All_Layer( (DRAWSEGMENT*) GetCurItem(), &dc );
SetCurItem( NULL );
......
......@@ -272,8 +272,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
break;
case TYPE_MARKER:
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_MARKER,
_( "Delete Marker" ), delete_xpm );
createPopUpMenuForMarkers( (MARKER*) item, aPopMenu );
break;
case TYPE_COTATION:
......@@ -874,3 +873,11 @@ void WinEDA_PcbFrame::createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu )
ADD_MENUITEM( sub_menu_Text, ID_POPUP_PCB_DELETE_TEXTEPCB,
_( "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