Commit d0a69ac7 authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

EHNANCE: add a "Show" button to the two text field properties

dialogs which allow editing of component properties.  The button
is active when the table row cursor is on the DATASHEET field only.
When active, and your datasheet is a URI, then your default
browser will be launced to show that datasheet if it can find it.
This incentivizes use of http:// links for datasheets.
parent 92baa531
Loading
Loading
Loading
Loading
+18 −7
Original line number Original line Diff line number Diff line
@@ -26,6 +26,7 @@
 */
 */


#include <wx/tooltip.h>
#include <wx/tooltip.h>
#include <wx/hyperlink.h>


#include <fctsys.h>
#include <fctsys.h>
#include <appl_wxstruct.h>
#include <appl_wxstruct.h>
@@ -112,6 +113,7 @@ private:
    void addFieldButtonHandler( wxCommandEvent& event );
    void addFieldButtonHandler( wxCommandEvent& event );
    void deleteFieldButtonHandler( wxCommandEvent& event );
    void deleteFieldButtonHandler( wxCommandEvent& event );
    void moveUpButtonHandler( wxCommandEvent& event );
    void moveUpButtonHandler( wxCommandEvent& event );
    void showButtonHandler( wxCommandEvent& event );


    SCH_FIELD* findField( const wxString& aFieldName );
    SCH_FIELD* findField( const wxString& aFieldName );


@@ -327,13 +329,13 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event
                && !m_Parent->GetTemplates().HasFieldName( m_FieldsBuf[i].GetName( false ) )
                && !m_Parent->GetTemplates().HasFieldName( m_FieldsBuf[i].GetName( false ) )
                && !removeRemainingFields )
                && !removeRemainingFields )
            {
            {
                wxString msg;
                wxString msg = wxString::Format(

                    _( "The field name <%s> does not have a value and is not defined in "
                msg.Printf( _( "The field name <%s> does not have a value and is not defined in "
                       "the field template list.  Empty field values are invalid an will "
                       "the field template list.  Empty field values are invalid an will "
                       "be removed from the component.  Do you wish to remove this and "
                       "be removed from the component.  Do you wish to remove this and "
                       "all remaining undefined fields?" ),
                       "all remaining undefined fields?" ),
                            GetChars( m_FieldsBuf[i].GetName( false ) ) );
                    GetChars( m_FieldsBuf[i].GetName( false ) )
                    );


                wxMessageDialog dlg( this, msg, _( "Remove Fields" ), wxYES_NO | wxNO_DEFAULT );
                wxMessageDialog dlg( this, msg, _( "Remove Fields" ), wxYES_NO | wxNO_DEFAULT );


@@ -428,6 +430,13 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::deleteFieldButtonHandler( wxCommandEven
}
}




void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::showButtonHandler( wxCommandEvent& event )
{
    wxString datasheet_uri = fieldValueTextCtrl->GetValue();
    ::wxLaunchDefaultBrowser( datasheet_uri );
}


void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::moveUpButtonHandler( wxCommandEvent& event )
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::moveUpButtonHandler( wxCommandEvent& event )
{
{
    unsigned fieldNdx = getSelectedFieldNdx();
    unsigned fieldNdx = getSelectedFieldNdx();
@@ -721,6 +730,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()


    fieldValueTextCtrl->SetValue( field.GetText() );
    fieldValueTextCtrl->SetValue( field.GetText() );


    m_show_datasheet_button->Enable( fieldNdx == DATASHEET );

    // For power symbols, the value is NOR editable, because value and pin
    // For power symbols, the value is NOR editable, because value and pin
    // name must be same and can be edited only in library editor
    // name must be same and can be edited only in library editor
    if( fieldNdx == VALUE && m_LibEntry && m_LibEntry->IsPower() )
    if( fieldNdx == VALUE && m_LibEntry && m_LibEntry->IsPower() )
+12 −10
Original line number Original line Diff line number Diff line
@@ -178,26 +178,25 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	fieldNameTextCtrl->SetMaxLength( 0 ); 
	fieldNameTextCtrl->SetMaxLength( 0 ); 
	fieldNameTextCtrl->SetToolTip( _("The name of the currently selected field\nSome fixed fields names are not editable") );
	fieldNameTextCtrl->SetToolTip( _("The name of the currently selected field\nSome fixed fields names are not editable") );
	
	
	fieldNameBoxSizer->Add( fieldNameTextCtrl, 0, wxEXPAND, 5 );
	fieldNameBoxSizer->Add( fieldNameTextCtrl, 0, wxBOTTOM|wxEXPAND, 5 );
	
	
	fieldEditBoxSizer->Add( fieldNameBoxSizer, 0, wxEXPAND, 5 );
	
	wxBoxSizer* fieldTextBoxSizer;
	fieldTextBoxSizer = new wxBoxSizer( wxVERTICAL );
	
	
	fieldValueLabel = new wxStaticText( this, wxID_ANY, _("Field Value"), wxDefaultPosition, wxDefaultSize, 0 );
	fieldValueLabel = new wxStaticText( this, wxID_ANY, _("Field Value"), wxDefaultPosition, wxDefaultSize, 0 );
	fieldValueLabel->Wrap( -1 );
	fieldValueLabel->Wrap( -1 );
	fieldTextBoxSizer->Add( fieldValueLabel, 0, wxTOP, 5 );
	fieldNameBoxSizer->Add( fieldValueLabel, 0, wxTOP, 5 );
	
	
	fieldValueTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fieldValueTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fieldValueTextCtrl->SetMaxLength( 0 ); 
	fieldValueTextCtrl->SetMaxLength( 0 ); 
	fieldValueTextCtrl->SetToolTip( _("The text (or value) of the currently selected field") );
	fieldValueTextCtrl->SetToolTip( _("The text (or value) of the currently selected field") );
	
	
	fieldTextBoxSizer->Add( fieldValueTextCtrl, 0, wxEXPAND, 5 );
	fieldNameBoxSizer->Add( fieldValueTextCtrl, 0, wxEXPAND, 5 );
	
	m_show_datasheet_button = new wxButton( this, wxID_ANY, _("Show"), wxDefaultPosition, wxDefaultSize, 0 );
	m_show_datasheet_button->SetToolTip( _("If your datasheet is an http:// link or a complete file path, then it may show in your browser by pressing this button.") );
	
	fieldNameBoxSizer->Add( m_show_datasheet_button, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
	
	
	
	
	fieldEditBoxSizer->Add( fieldTextBoxSizer, 0, wxEXPAND, 5 );
	fieldEditBoxSizer->Add( fieldNameBoxSizer, 0, wxBOTTOM|wxEXPAND, 5 );
	
	
	wxFlexGridSizer* fgSizerPosSize;
	wxFlexGridSizer* fgSizerPosSize;
	fgSizerPosSize = new wxFlexGridSizer( 3, 3, 0, 0 );
	fgSizerPosSize = new wxFlexGridSizer( 3, 3, 0, 0 );
@@ -271,6 +270,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	
	
	this->SetSizer( mainSizer );
	this->SetSizer( mainSizer );
	this->Layout();
	this->Layout();
	mainSizer->Fit( this );
	
	
	// Connect Events
	// Connect Events
	defaultsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::SetInitCmp ), NULL, this );
	defaultsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::SetInitCmp ), NULL, this );
@@ -279,6 +279,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	addFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::addFieldButtonHandler ), NULL, this );
	addFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::addFieldButtonHandler ), NULL, this );
	deleteFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::deleteFieldButtonHandler ), NULL, this );
	deleteFieldButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::deleteFieldButtonHandler ), NULL, this );
	moveUpButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::moveUpButtonHandler ), NULL, this );
	moveUpButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::moveUpButtonHandler ), NULL, this );
	m_show_datasheet_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::showButtonHandler ), NULL, this );
	stdDialogButtonSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnCancelButtonClick ), NULL, this );
	stdDialogButtonSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnCancelButtonClick ), NULL, this );
	stdDialogButtonSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnOKButtonClick ), NULL, this );
	stdDialogButtonSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnOKButtonClick ), NULL, this );
}
}
@@ -292,6 +293,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	addFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::addFieldButtonHandler ), NULL, this );
	addFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::addFieldButtonHandler ), NULL, this );
	deleteFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::deleteFieldButtonHandler ), NULL, this );
	deleteFieldButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::deleteFieldButtonHandler ), NULL, this );
	moveUpButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::moveUpButtonHandler ), NULL, this );
	moveUpButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::moveUpButtonHandler ), NULL, this );
	m_show_datasheet_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::showButtonHandler ), NULL, this );
	stdDialogButtonSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnCancelButtonClick ), NULL, this );
	stdDialogButtonSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnCancelButtonClick ), NULL, this );
	stdDialogButtonSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnOKButtonClick ), NULL, this );
	stdDialogButtonSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnOKButtonClick ), NULL, this );
	
	
+11 −25
Original line number Original line Diff line number Diff line
@@ -42,7 +42,7 @@
            <property name="minimum_size"></property>
            <property name="minimum_size"></property>
            <property name="name">DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP</property>
            <property name="name">DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP</property>
            <property name="pos"></property>
            <property name="pos"></property>
            <property name="size">700,496</property>
            <property name="size">-1,-1</property>
            <property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU</property>
            <property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU</property>
            <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
            <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
            <property name="title">Component Properties</property>
            <property name="title">Component Properties</property>
@@ -1808,7 +1808,7 @@
                                        </object>
                                        </object>
                                        <object class="sizeritem" expanded="1">
                                        <object class="sizeritem" expanded="1">
                                            <property name="border">5</property>
                                            <property name="border">5</property>
                                            <property name="flag">wxEXPAND</property>
                                            <property name="flag">wxBOTTOM|wxEXPAND</property>
                                            <property name="proportion">0</property>
                                            <property name="proportion">0</property>
                                            <object class="wxBoxSizer" expanded="1">
                                            <object class="wxBoxSizer" expanded="1">
                                                <property name="minimum_size"></property>
                                                <property name="minimum_size"></property>
@@ -1900,7 +1900,7 @@
                                                </object>
                                                </object>
                                                <object class="sizeritem" expanded="0">
                                                <object class="sizeritem" expanded="0">
                                                    <property name="border">5</property>
                                                    <property name="border">5</property>
                                                    <property name="flag">wxEXPAND</property>
                                                    <property name="flag">wxBOTTOM|wxEXPAND</property>
                                                    <property name="proportion">0</property>
                                                    <property name="proportion">0</property>
                                                    <object class="wxTextCtrl" expanded="0">
                                                    <object class="wxTextCtrl" expanded="0">
                                                        <property name="BottomDockable">1</property>
                                                        <property name="BottomDockable">1</property>
@@ -1989,17 +1989,6 @@
                                                        <event name="OnUpdateUI"></event>
                                                        <event name="OnUpdateUI"></event>
                                                    </object>
                                                    </object>
                                                </object>
                                                </object>
                                            </object>
                                        </object>
                                        <object class="sizeritem" expanded="1">
                                            <property name="border">5</property>
                                            <property name="flag">wxEXPAND</property>
                                            <property name="proportion">0</property>
                                            <object class="wxBoxSizer" expanded="1">
                                                <property name="minimum_size"></property>
                                                <property name="name">fieldTextBoxSizer</property>
                                                <property name="orient">wxVERTICAL</property>
                                                <property name="permission">none</property>
                                                <object class="sizeritem" expanded="0">
                                                <object class="sizeritem" expanded="0">
                                                    <property name="border">5</property>
                                                    <property name="border">5</property>
                                                    <property name="flag">wxTOP</property>
                                                    <property name="flag">wxTOP</property>
@@ -2083,11 +2072,11 @@
                                                        <event name="OnUpdateUI"></event>
                                                        <event name="OnUpdateUI"></event>
                                                    </object>
                                                    </object>
                                                </object>
                                                </object>
                                                <object class="sizeritem" expanded="0">
                                                <object class="sizeritem" expanded="1">
                                                    <property name="border">5</property>
                                                    <property name="border">5</property>
                                                    <property name="flag">wxEXPAND</property>
                                                    <property name="flag">wxBOTTOM|wxEXPAND|wxTOP</property>
                                                    <property name="proportion">0</property>
                                                    <property name="proportion">0</property>
                                                    <object class="wxTextCtrl" expanded="0">
                                                    <object class="wxButton" expanded="1">
                                                        <property name="BottomDockable">1</property>
                                                        <property name="BottomDockable">1</property>
                                                        <property name="LeftDockable">1</property>
                                                        <property name="LeftDockable">1</property>
                                                        <property name="RightDockable">1</property>
                                                        <property name="RightDockable">1</property>
@@ -2104,6 +2093,7 @@
                                                        <property name="close_button">1</property>
                                                        <property name="close_button">1</property>
                                                        <property name="context_help"></property>
                                                        <property name="context_help"></property>
                                                        <property name="context_menu">1</property>
                                                        <property name="context_menu">1</property>
                                                        <property name="default">0</property>
                                                        <property name="default_pane">0</property>
                                                        <property name="default_pane">0</property>
                                                        <property name="dock">Dock</property>
                                                        <property name="dock">Dock</property>
                                                        <property name="dock_fixed">0</property>
                                                        <property name="dock_fixed">0</property>
@@ -2115,15 +2105,15 @@
                                                        <property name="gripper">0</property>
                                                        <property name="gripper">0</property>
                                                        <property name="hidden">0</property>
                                                        <property name="hidden">0</property>
                                                        <property name="id">wxID_ANY</property>
                                                        <property name="id">wxID_ANY</property>
                                                        <property name="label">Show</property>
                                                        <property name="max_size"></property>
                                                        <property name="max_size"></property>
                                                        <property name="maximize_button">0</property>
                                                        <property name="maximize_button">0</property>
                                                        <property name="maximum_size"></property>
                                                        <property name="maximum_size"></property>
                                                        <property name="maxlength">0</property>
                                                        <property name="min_size"></property>
                                                        <property name="min_size"></property>
                                                        <property name="minimize_button">0</property>
                                                        <property name="minimize_button">0</property>
                                                        <property name="minimum_size"></property>
                                                        <property name="minimum_size"></property>
                                                        <property name="moveable">1</property>
                                                        <property name="moveable">1</property>
                                                        <property name="name">fieldValueTextCtrl</property>
                                                        <property name="name">m_show_datasheet_button</property>
                                                        <property name="pane_border">1</property>
                                                        <property name="pane_border">1</property>
                                                        <property name="pane_position"></property>
                                                        <property name="pane_position"></property>
                                                        <property name="pane_size"></property>
                                                        <property name="pane_size"></property>
@@ -2136,15 +2126,15 @@
                                                        <property name="style"></property>
                                                        <property name="style"></property>
                                                        <property name="subclass"></property>
                                                        <property name="subclass"></property>
                                                        <property name="toolbar_pane">0</property>
                                                        <property name="toolbar_pane">0</property>
                                                        <property name="tooltip">The text (or value) of the currently selected field</property>
                                                        <property name="tooltip">If your datasheet is an http:// link or a complete file path, then it may show in your browser by pressing this button.</property>
                                                        <property name="validator_data_type"></property>
                                                        <property name="validator_data_type"></property>
                                                        <property name="validator_style">wxFILTER_NONE</property>
                                                        <property name="validator_style">wxFILTER_NONE</property>
                                                        <property name="validator_type">wxDefaultValidator</property>
                                                        <property name="validator_type">wxDefaultValidator</property>
                                                        <property name="validator_variable"></property>
                                                        <property name="validator_variable"></property>
                                                        <property name="value"></property>
                                                        <property name="window_extra_style"></property>
                                                        <property name="window_extra_style"></property>
                                                        <property name="window_name"></property>
                                                        <property name="window_name"></property>
                                                        <property name="window_style"></property>
                                                        <property name="window_style"></property>
                                                        <event name="OnButtonClick">showButtonHandler</event>
                                                        <event name="OnChar"></event>
                                                        <event name="OnChar"></event>
                                                        <event name="OnEnterWindow"></event>
                                                        <event name="OnEnterWindow"></event>
                                                        <event name="OnEraseBackground"></event>
                                                        <event name="OnEraseBackground"></event>
@@ -2167,10 +2157,6 @@
                                                        <event name="OnRightUp"></event>
                                                        <event name="OnRightUp"></event>
                                                        <event name="OnSetFocus"></event>
                                                        <event name="OnSetFocus"></event>
                                                        <event name="OnSize"></event>
                                                        <event name="OnSize"></event>
                                                        <event name="OnText"></event>
                                                        <event name="OnTextEnter"></event>
                                                        <event name="OnTextMaxLen"></event>
                                                        <event name="OnTextURL"></event>
                                                        <event name="OnUpdateUI"></event>
                                                        <event name="OnUpdateUI"></event>
                                                    </object>
                                                    </object>
                                                </object>
                                                </object>
+3 −1
Original line number Original line Diff line number Diff line
@@ -63,6 +63,7 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public DIALOG_SHIM
		wxTextCtrl* fieldNameTextCtrl;
		wxTextCtrl* fieldNameTextCtrl;
		wxStaticText* fieldValueLabel;
		wxStaticText* fieldValueLabel;
		wxTextCtrl* fieldValueTextCtrl;
		wxTextCtrl* fieldValueTextCtrl;
		wxButton* m_show_datasheet_button;
		wxStaticText* textSizeLabel;
		wxStaticText* textSizeLabel;
		wxTextCtrl* textSizeTextCtrl;
		wxTextCtrl* textSizeTextCtrl;
		wxStaticText* m_staticTextUnitSize;
		wxStaticText* m_staticTextUnitSize;
@@ -83,13 +84,14 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public DIALOG_SHIM
		virtual void addFieldButtonHandler( wxCommandEvent& event ) { event.Skip(); }
		virtual void addFieldButtonHandler( wxCommandEvent& event ) { event.Skip(); }
		virtual void deleteFieldButtonHandler( wxCommandEvent& event ) { event.Skip(); }
		virtual void deleteFieldButtonHandler( wxCommandEvent& event ) { event.Skip(); }
		virtual void moveUpButtonHandler( wxCommandEvent& event ) { event.Skip(); }
		virtual void moveUpButtonHandler( wxCommandEvent& event ) { event.Skip(); }
		virtual void showButtonHandler( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
		
		
	
	
	public:
	public:
		
		
		DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 700,496 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU ); 
		DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU ); 
		~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP();
		~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP();
	
	
};
};
+10 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,7 @@ private:
    void moveUpButtonHandler( wxCommandEvent& event );
    void moveUpButtonHandler( wxCommandEvent& event );
    void OnCancelButtonClick( wxCommandEvent& event );
    void OnCancelButtonClick( wxCommandEvent& event );
    void OnOKButtonClick( wxCommandEvent& event );
    void OnOKButtonClick( wxCommandEvent& event );
    void showButtonHandler( wxCommandEvent& event );


    // internal functions:
    // internal functions:
    void setSelectedFieldNdx( int aFieldNdx );
    void setSelectedFieldNdx( int aFieldNdx );
@@ -379,6 +380,13 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB:: moveUpButtonHandler( wxCommandEvent& e
}
}




void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::showButtonHandler( wxCommandEvent& event )
{
    wxString datasheet_uri = fieldValueTextCtrl->GetValue();
    ::wxLaunchDefaultBrowser( datasheet_uri );
}


void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::setSelectedFieldNdx( int aFieldNdx )
void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::setSelectedFieldNdx( int aFieldNdx )
{
{
    // deselect old selection, but I think this is done by single selection
    // deselect old selection, but I think this is done by single selection
@@ -645,6 +653,8 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel()


    textSizeTextCtrl->SetValue( EDA_GRAPHIC_TEXT_CTRL::FormatSize( g_UserUnit, field.GetSize().x ) );
    textSizeTextCtrl->SetValue( EDA_GRAPHIC_TEXT_CTRL::FormatSize( g_UserUnit, field.GetSize().x ) );


    m_show_datasheet_button->Enable( fieldNdx == DATASHEET );

    wxPoint coord = field.GetTextPosition();
    wxPoint coord = field.GetTextPosition();
    wxPoint zero;
    wxPoint zero;


Loading