Commit 2ab98f76 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Try to fix an issue on Ubuntu/Unity for some dialogs which are not displayed....

Try to fix an issue on Ubuntu/Unity for some dialogs which are not displayed. For most, adding GetSizer()->Fit( this ) in dialog constructor fix the issue, but at least one dialog still is not displayed.
parent 1a550b8e
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov  5 2013)
// C++ code generated with wxFormBuilder (version Jun  5 2014)
// http://www.wxformbuilder.org/
// http://www.wxformbuilder.org/
//
//
// PLEASE DO "NOT" EDIT THIS FILE!
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -11,7 +11,7 @@


EDA_LIST_DIALOG_BASE::EDA_LIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
EDA_LIST_DIALOG_BASE::EDA_LIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	this->SetSizeHints( wxSize( 400,400 ), wxDefaultSize );
	
	
	wxBoxSizer* bSizerMain;
	wxBoxSizer* bSizerMain;
	bSizerMain = new wxBoxSizer( wxVERTICAL );
	bSizerMain = new wxBoxSizer( wxVERTICAL );
@@ -55,7 +55,6 @@ EDA_LIST_DIALOG_BASE::EDA_LIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, con
	
	
	this->SetSizer( bSizerMain );
	this->SetSizer( bSizerMain );
	this->Layout();
	this->Layout();
	bSizerMain->Fit( this );
	
	
	this->Centre( wxBOTH );
	this->Centre( wxBOTH );
	
	
+3 −3
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<wxFormBuilder_Project>
    <FileVersion major="1" minor="11" />
    <FileVersion major="1" minor="13" />
    <object class="Project" expanded="1">
    <object class="Project" expanded="1">
        <property name="class_decoration"></property>
        <property name="class_decoration"></property>
        <property name="code_generation">C++</property>
        <property name="code_generation">C++</property>
@@ -41,10 +41,10 @@
            <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">400,400</property>
            <property name="name">EDA_LIST_DIALOG_BASE</property>
            <property name="name">EDA_LIST_DIALOG_BASE</property>
            <property name="pos"></property>
            <property name="pos"></property>
            <property name="size">-1,-1</property>
            <property name="size">400,400</property>
            <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
            <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
            <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
            <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
            <property name="title"></property>
            <property name="title"></property>
+2 −2
Original line number Original line Diff line number Diff line
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov  5 2013)
// C++ code generated with wxFormBuilder (version Jun  5 2014)
// http://www.wxformbuilder.org/
// http://www.wxformbuilder.org/
//
//
// PLEASE DO "NOT" EDIT THIS FILE!
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -58,7 +58,7 @@ class EDA_LIST_DIALOG_BASE : public DIALOG_SHIM
	
	
	public:
	public:
		
		
		EDA_LIST_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 
		EDA_LIST_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 400,400 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 
		~EDA_LIST_DIALOG_BASE();
		~EDA_LIST_DIALOG_BASE();
	
	
};
};
+24 −13
Original line number Original line Diff line number Diff line
@@ -47,6 +47,27 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl
    m_cb_data     = aCallBackFunctionData;
    m_cb_data     = aCallBackFunctionData;
    m_itemsListCp = &aItemList;
    m_itemsListCp = &aItemList;


    initDialog( aItemHeaders, aSelection );

    // DIALOG_SHIM needs a unique hash_key because classname is not sufficient
    // because so many dialogs share this same class, with different numbers of
    // columns, different column names, and column widths.
    m_hash_key = TO_UTF8( aTitle );

    m_filterBox->SetFocus();

    // this line fixes an issue on Linux Ubuntu using Unity (dialog not shown),
    // and works fine on all systems
    GetSizer()->Fit(  this );

    Centre();
}


void EDA_LIST_DIALOG::initDialog( const wxArrayString& aItemHeaders,
                                  const wxString& aSelection)
{

    for( unsigned i = 0; i < aItemHeaders.Count(); i++ )
    for( unsigned i = 0; i < aItemHeaders.Count(); i++ )
    {
    {
        wxListItem column;
        wxListItem column;
@@ -57,7 +78,7 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl
        m_listBox->InsertColumn( i, column );
        m_listBox->InsertColumn( i, column );
    }
    }


    InsertItems( aItemList, 0 );
    InsertItems( *m_itemsListCp, 0 );


    if( m_cb_func == NULL )
    if( m_cb_func == NULL )
    {
    {
@@ -112,14 +133,11 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl
    }
    }
#endif
#endif


    Fit();
    Centre();

    if( !!aSelection )
    if( !!aSelection )
    {
    {
        for( unsigned row = 0; row < aItemList.size(); ++row )
        for( unsigned row = 0; row < m_itemsListCp->size(); ++row )
        {
        {
            if( aItemList[row][0] == aSelection )
            if( (*m_itemsListCp)[row][0] == aSelection )
            {
            {
                m_listBox->SetItemState( row, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
                m_listBox->SetItemState( row, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
                m_listBox->EnsureVisible( row );
                m_listBox->EnsureVisible( row );
@@ -127,13 +145,6 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl
            }
            }
        }
        }
    }
    }

    // DIALOG_SHIM needs a unique hash_key because classname is not sufficient
    // because so many dialogs share this same class, with different numbers of
    // columns, different column names, and column widths.
    m_hash_key = TO_UTF8( aTitle );

    m_filterBox->SetFocus();
}
}




+1 −1
Original line number Original line Diff line number Diff line
@@ -199,7 +199,7 @@ DIALOG_BOM::DIALOG_BOM( SCH_EDIT_FRAME* parent ) :
    m_config = Kiface().KifaceSettings();
    m_config = Kiface().KifaceSettings();
    installPluginsList();
    installPluginsList();


    GetSizer()->SetSizeHints( this );
    GetSizer()->Fit( this );
    Centre();
    Centre();
}
}


Loading