Pl_editor rework: refinements in Design inspector.
This commit is contained in:
parent
2dd82cbca7
commit
96935e0a7e
|
@ -301,6 +301,8 @@ void KIGFX::WS_PAINTER::draw( const WS_DRAW_ITEM_TEXT* aItem, int aLayer ) const
|
||||||
m_gal->SetStrokeColor( m_renderSettings.GetColor( aItem, aLayer ) );
|
m_gal->SetStrokeColor( m_renderSettings.GetColor( aItem, aLayer ) );
|
||||||
m_gal->SetLineWidth( aItem->GetThickness() );
|
m_gal->SetLineWidth( aItem->GetThickness() );
|
||||||
m_gal->SetTextAttributes( aItem );
|
m_gal->SetTextAttributes( aItem );
|
||||||
|
m_gal->SetIsFill( false );
|
||||||
|
m_gal->SetIsStroke( true );
|
||||||
m_gal->StrokeText( aItem->GetShownText(), VECTOR2D( 0, 0 ), 0.0 );
|
m_gal->StrokeText( aItem->GetShownText(), VECTOR2D( 0, 0 ), 0.0 );
|
||||||
m_gal->Restore();
|
m_gal->Restore();
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,11 +167,15 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
// Column ids for m_gridListItems
|
// Column ids for m_gridListItems
|
||||||
#define COL_BITMAP 0
|
enum COL_INDEX
|
||||||
#define COL_TYPENAME 1
|
{
|
||||||
#define COL_COUNT 2
|
COL_BITMAP,
|
||||||
#define COL_COMMENT 3
|
COL_TYPENAME,
|
||||||
#define COL_TEXTSTRING 4
|
COL_REPEAT_NUMBER,
|
||||||
|
COL_COMMENT,
|
||||||
|
COL_TEXTSTRING,
|
||||||
|
COL_COUNT //Sentinel
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
DIALOG_INSPECTOR::DIALOG_INSPECTOR( PL_EDITOR_FRAME* aParent ) :
|
DIALOG_INSPECTOR::DIALOG_INSPECTOR( PL_EDITOR_FRAME* aParent ) :
|
||||||
|
@ -194,6 +198,7 @@ DIALOG_INSPECTOR::~DIALOG_INSPECTOR()
|
||||||
void DIALOG_INSPECTOR::ReCreateDesignList()
|
void DIALOG_INSPECTOR::ReCreateDesignList()
|
||||||
{
|
{
|
||||||
wxWindowUpdateLocker dummy( this ); // Avoid flicker when rebuilding the tree
|
wxWindowUpdateLocker dummy( this ); // Avoid flicker when rebuilding the tree
|
||||||
|
const PAGE_INFO& page_info = m_editorFrame->GetPageLayout().GetPageSettings();
|
||||||
|
|
||||||
if( m_gridListItems->GetNumberRows() > 1 )
|
if( m_gridListItems->GetNumberRows() > 1 )
|
||||||
m_gridListItems->DeleteRows( 1, m_gridListItems->GetNumberRows() - 1 );
|
m_gridListItems->DeleteRows( 1, m_gridListItems->GetNumberRows() - 1 );
|
||||||
|
@ -205,16 +210,18 @@ void DIALOG_INSPECTOR::ReCreateDesignList()
|
||||||
wxFileName fn( ((PL_EDITOR_FRAME*) GetParent())->GetCurrFileName() );
|
wxFileName fn( ((PL_EDITOR_FRAME*) GetParent())->GetCurrFileName() );
|
||||||
|
|
||||||
if( fn.GetName().IsEmpty() )
|
if( fn.GetName().IsEmpty() )
|
||||||
SetTitle( "<default>" );
|
SetTitle( "<default page layout>" );
|
||||||
else
|
else
|
||||||
SetTitle( fn.GetName() );
|
SetTitle( fn.GetName() );
|
||||||
|
|
||||||
// The first item is the entire page
|
// The first item is the layout: Display info about the page: fmt, size...
|
||||||
int row = 0;
|
int row = 0;
|
||||||
GetGridList()->SetCellValue( row, COL_TYPENAME, _( "Page" ) );
|
GetGridList()->SetCellValue( row, COL_TYPENAME, _( "Layout" ) );
|
||||||
GetGridList()->SetCellValue( row, COL_COMMENT, _( "A4" ) );
|
GetGridList()->SetCellValue( row, COL_COMMENT, page_info.GetType() ); // Display page format name
|
||||||
GetGridList()->SetCellValue( row, COL_COUNT, "-" );
|
GetGridList()->SetCellValue( row, COL_REPEAT_NUMBER, "-" );
|
||||||
GetGridList()->SetCellValue( row, COL_TEXTSTRING, _( "The current page" ) );
|
wxSize page_sizeIU = m_editorFrame->GetPageSizeIU();
|
||||||
|
GetGridList()->SetCellValue( row, COL_TEXTSTRING, wxString::Format( _( "Size: %.1fx%.1fmm" ),
|
||||||
|
Iu2Millimeter( page_sizeIU.x ), Iu2Millimeter( page_sizeIU.y ) ) );
|
||||||
GetGridList()->SetCellRenderer (row, COL_BITMAP, new BitmapGridCellRenderer( root_xpm ) );
|
GetGridList()->SetCellRenderer (row, COL_BITMAP, new BitmapGridCellRenderer( root_xpm ) );
|
||||||
GetGridList()->SetReadOnly( row, COL_BITMAP );
|
GetGridList()->SetReadOnly( row, COL_BITMAP );
|
||||||
m_itemsList.push_back( nullptr ); // this item is not a WS_DATA_ITEM, just a pseudo item
|
m_itemsList.push_back( nullptr ); // this item is not a WS_DATA_ITEM, just a pseudo item
|
||||||
|
@ -252,7 +259,7 @@ void DIALOG_INSPECTOR::ReCreateDesignList()
|
||||||
GetGridList()->SetCellRenderer (row, COL_BITMAP, new BitmapGridCellRenderer( img ) );
|
GetGridList()->SetCellRenderer (row, COL_BITMAP, new BitmapGridCellRenderer( img ) );
|
||||||
GetGridList()->SetReadOnly( row, COL_BITMAP );
|
GetGridList()->SetReadOnly( row, COL_BITMAP );
|
||||||
GetGridList()->SetCellValue( row, COL_TYPENAME,item->GetClassName() );
|
GetGridList()->SetCellValue( row, COL_TYPENAME,item->GetClassName() );
|
||||||
GetGridList()->SetCellValue( row, COL_COUNT,
|
GetGridList()->SetCellValue( row, COL_REPEAT_NUMBER,
|
||||||
wxString::Format( "%d", item->m_RepeatCount ) );
|
wxString::Format( "%d", item->m_RepeatCount ) );
|
||||||
GetGridList()->SetCellValue( row, COL_COMMENT, item->m_Info );
|
GetGridList()->SetCellValue( row, COL_COMMENT, item->m_Info );
|
||||||
|
|
||||||
|
@ -265,6 +272,31 @@ void DIALOG_INSPECTOR::ReCreateDesignList()
|
||||||
m_itemsList.push_back( item );
|
m_itemsList.push_back( item );
|
||||||
row++;
|
row++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Now resize the columns:
|
||||||
|
int cols_to_resize[] =
|
||||||
|
{
|
||||||
|
COL_BITMAP, COL_TYPENAME, COL_REPEAT_NUMBER, COL_COMMENT, COL_TEXTSTRING, COL_COUNT
|
||||||
|
};
|
||||||
|
|
||||||
|
for( int ii = 0; ; ii++ )
|
||||||
|
{
|
||||||
|
int col = cols_to_resize[ii];
|
||||||
|
|
||||||
|
if( col == COL_COUNT )
|
||||||
|
break;
|
||||||
|
|
||||||
|
if( col == COL_BITMAP )
|
||||||
|
{
|
||||||
|
#define BITMAP_SIZE 16
|
||||||
|
GetGridList()->SetColMinimalWidth( col, BITMAP_SIZE*2 );
|
||||||
|
GetGridList()->AutoSizeColumn( col, false );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
GetGridList()->AutoSizeColumn( col );
|
||||||
|
|
||||||
|
GetGridList()->AutoSizeColLabelSize( col );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,8 @@ DIALOG_INSPECTOR_BASE::DIALOG_INSPECTOR_BASE( wxWindow* parent, wxWindowID id, c
|
||||||
m_gridListItems->EnableDragColMove( false );
|
m_gridListItems->EnableDragColMove( false );
|
||||||
m_gridListItems->EnableDragColSize( true );
|
m_gridListItems->EnableDragColSize( true );
|
||||||
m_gridListItems->SetColLabelSize( 30 );
|
m_gridListItems->SetColLabelSize( 30 );
|
||||||
m_gridListItems->SetColLabelValue( 0, _("Type") );
|
m_gridListItems->SetColLabelValue( 0, _("-") );
|
||||||
m_gridListItems->SetColLabelValue( 1, _("Name") );
|
m_gridListItems->SetColLabelValue( 1, _("Type") );
|
||||||
m_gridListItems->SetColLabelValue( 2, _("Count") );
|
m_gridListItems->SetColLabelValue( 2, _("Count") );
|
||||||
m_gridListItems->SetColLabelValue( 3, _("Comment") );
|
m_gridListItems->SetColLabelValue( 3, _("Comment") );
|
||||||
m_gridListItems->SetColLabelValue( 4, _("Text") );
|
m_gridListItems->SetColLabelValue( 4, _("Text") );
|
||||||
|
|
|
@ -146,7 +146,7 @@
|
||||||
<property name="close_button">1</property>
|
<property name="close_button">1</property>
|
||||||
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
|
<property name="col_label_horiz_alignment">wxALIGN_CENTER</property>
|
||||||
<property name="col_label_size">30</property>
|
<property name="col_label_size">30</property>
|
||||||
<property name="col_label_values">"Type" "Name" "Count" "Comment" "Text"</property>
|
<property name="col_label_values">"-" "Type" "Count" "Comment" "Text"</property>
|
||||||
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
<property name="col_label_vert_alignment">wxALIGN_CENTER</property>
|
||||||
<property name="cols">5</property>
|
<property name="cols">5</property>
|
||||||
<property name="column_sizes"></property>
|
<property name="column_sizes"></property>
|
||||||
|
|
Loading…
Reference in New Issue