wip on resizeable view & adding tabs to pns_debug_tool

This commit is contained in:
Tomasz Wlostowski 2024-03-02 23:35:18 +01:00
parent 13c647ef6f
commit 2280c696d0
9 changed files with 854 additions and 110 deletions

View File

@ -40,6 +40,8 @@
#include <pcb_draw_panel_gal.h>
#include <view/wx_view_controls.h>
#include <pcb_painter.h>
#include <pcb_actions.h>
#include <functional>
#include <pad.h>
#include <footprint.h>
@ -48,36 +50,39 @@
#include <pcb_edit_frame.h>
#include <connectivity/connectivity_data.h>
#include <connectivity/from_to_cache.h>
#include <pcb_io/pcb_io_mgr.h>
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h>
#include <memory>
#include <tool/actions.h>
#include <trace_helpers.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tools/pcb_tool_base.h>
#include <tools/pcb_selection_tool.h>
#include "pcb_test_frame.h"
#include <trace_helpers.h>
#include "pcb_test_selection_tool.h"
using namespace KIGFX;
void PCB_TEST_FRAME_BASE::SetBoard( std::shared_ptr<BOARD> b )
{
m_board = b;
printf("TestFrameBase::SetBoard %p\n", b.get() );
PROF_TIMER cntConnectivity( "connectivity-build" );
m_board->BuildListOfNets();
m_board->BuildConnectivity();
cntConnectivity.Stop();
cntConnectivity.Show();
PROF_TIMER cntView("view-build");
m_galPanel->DisplayBoard( m_board.get() );
cntView.Stop();
cntView.Show();
PROF_TIMER cntFromTo("fromto-cache-update");
m_board->GetConnectivity()->GetFromToCache()->Rebuild( m_board.get() );
cntFromTo.Show();
m_galPanel->UpdateColors();
@ -91,10 +96,33 @@ void PCB_TEST_FRAME_BASE::SetBoard( std::shared_ptr<BOARD> b )
PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>();
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( m_board.get(), m_galPanel->GetView(),
m_galPanel->GetViewControls(), cfg, nullptr );
m_galPanel->GetViewControls(), cfg, this );
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
m_selectionTool.reset( new PCB_TEST_SELECTION_TOOL );
m_toolManager->RegisterTool( m_selectionTool.get() );
createUserTools();
for( TOOL_BASE* tool : m_toolManager->Tools() )
{
if( PCB_TOOL_BASE* pcbTool = dynamic_cast<PCB_TOOL_BASE*>( tool ) )
pcbTool->SetIsBoardEditor( true );
}
m_toolManager->InitTools();
m_galPanel->SetEventDispatcher( m_toolDispatcher );
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
#endif
}
@ -119,10 +147,11 @@ BOARD* PCB_TEST_FRAME_BASE::LoadAndDisplayBoard( const std::string& filename )
return brd;
}
class TEST_ACTIONS : public ACTIONS
void PCB_TEST_FRAME_BASE::SetSelectableItemTypes( const std::vector<KICAD_T> aTypes )
{
};
m_selectionTool->SetSelectableItemTypes( aTypes );
}
void PCB_TEST_FRAME_BASE::createView( wxWindow *aParent, PCB_DRAW_PANEL_GAL::GAL_TYPE aGalType )
@ -154,23 +183,7 @@ void PCB_TEST_FRAME_BASE::createView( wxWindow *aParent, PCB_DRAW_PANEL_GAL::GAL
m_galPanel->GetViewControls()->ShowCursor( true );
#ifdef USE_TOOL_MANAGER
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>();
m_toolManager = std::make_unique<TOOL_MANAGER>( );
m_toolManager->SetEnvironment( m_board.get(), m_galPanel->GetView(),
m_galPanel->GetViewControls(), cfg, nullptr );
m_pcbActions = std::make_unique<TEST_ACTIONS>( );
m_toolDispatcher = std::make_unique<TOOL_DISPATCHER>( m_toolManager.get() );
m_toolManager->RegisterTool( new PCB_SELECTION_TOOL );
createUserTools();
m_toolManager->InitTools();
m_toolManager->InvokeTool( "test.DefaultTool" );
#endif
//SetBoard( std::make_shared<BOARD>( new BOARD ));
}
@ -196,3 +209,14 @@ void PCB_TEST_FRAME_BASE::LoadSettings()
mgr.RegisterSettings( new CVPCB_SETTINGS );
mgr.GetColorSettings()->Load();
}
void PCB_TEST_FRAME_BASE::SetSelectionHook( std::function<void(PCB_TEST_FRAME_BASE*, PCB_SELECTION*)> aHook )
{
auto tool = m_toolManager->FindTool("pcbnew.InteractiveSelection");
if (!tool)
return;
auto casted = static_cast<PCB_TEST_SELECTION_TOOL*>( tool );
casted->SetSelectionHook( aHook );
}

View File

@ -33,6 +33,8 @@
#include <pcb_draw_panel_gal.h>
#include <gal/graphics_abstraction_layer.h>
#include <tool/tools_holder.h>
using std::unique_ptr;
class PCB_DRAW_PANEL_GAL;
@ -41,13 +43,14 @@ class BOARD;
class TOOL_MANAGER;
class TOOL_DISPATCHER;
class ACTIONS;
class PCB_SELECTION;
class PCB_TEST_SELECTION_TOOL;
namespace KIGFX {
class VIEW;
};
class PCB_TEST_FRAME_BASE
class PCB_TEST_FRAME_BASE : public TOOLS_HOLDER
{
public:
PCB_TEST_FRAME_BASE();
@ -61,6 +64,15 @@ public:
void LoadSettings();
virtual wxWindow* GetToolCanvas() const override
{
return m_galPanel.get();
}
void SetSelectionHook( std::function<void(PCB_TEST_FRAME_BASE*, PCB_SELECTION*)> aHook );
void SetSelectableItemTypes( const std::vector<KICAD_T> aTypes );
std::shared_ptr< PCB_TEST_SELECTION_TOOL> GetSelectionTool() const { return m_selectionTool; }
protected:
void createView( wxWindow *aParent, PCB_DRAW_PANEL_GAL::GAL_TYPE aGalType = PCB_DRAW_PANEL_GAL::GAL_TYPE_OPENGL );
@ -68,14 +80,9 @@ protected:
std::shared_ptr < PCB_DRAW_PANEL_GAL > m_galPanel;
std::shared_ptr < BOARD > m_board;
std::shared_ptr < PCB_TEST_SELECTION_TOOL> m_selectionTool;
KIGFX::GAL_DISPLAY_OPTIONS m_displayOptions;
wxString m_mruPath;
#ifdef USE_TOOL_MANAGER
unique_ptr < TOOL_MANAGER > m_toolManager;
unique_ptr < TOOL_DISPATCHER > m_toolDispatcher;
unique_ptr < ACTIONS > m_pcbActions;
#endif
};
void SetTopFrame ( wxFrame* aFrame );

View File

@ -0,0 +1,226 @@
#include "pcb_test_frame.h"
#include "pcb_test_selection_tool.h"
#include <pcbnew/tools/pcb_actions.h>
#include <tool/actions.h>
#include <tool/tool_manager.h>
PCB_TEST_SELECTION_TOOL::PCB_TEST_SELECTION_TOOL()
: SELECTION_TOOL( "pcbnew.InteractiveSelection" )
{
}
PCB_TEST_SELECTION_TOOL::~PCB_TEST_SELECTION_TOOL()
{
view()->Remove( &m_selection );
}
bool PCB_TEST_SELECTION_TOOL::Init()
{
view()->Remove( &m_selection );
view()->Add( &m_selection );
return true;
}
void PCB_TEST_SELECTION_TOOL::Reset( RESET_REASON aReason )
{
}
void PCB_TEST_SELECTION_TOOL::ClearSelection()
{
if( m_selection.Empty() )
return;
while( m_selection.GetSize() )
unhighlight( m_selection.Front(), SELECTED, &m_selection );
view()->Update( &m_selection );
m_selection.SetIsHover( false );
m_selection.ClearReferencePoint();
}
#include <collectors.h>
const GENERAL_COLLECTORS_GUIDE PCB_TEST_SELECTION_TOOL::getCollectorsGuide() const
{
GENERAL_COLLECTORS_GUIDE guide( board()->GetVisibleLayers(),
(PCB_LAYER_ID) view()->GetTopLayer(), view() );
bool padsDisabled = !board()->IsElementVisible( LAYER_PADS );
// account for the globals
guide.SetIgnoreMTextsMarkedNoShow( !board()->IsElementVisible( LAYER_HIDDEN_TEXT ) );
guide.SetIgnoreMTextsOnBack( !board()->IsElementVisible( LAYER_FP_TEXT ) );
guide.SetIgnoreMTextsOnFront( !board()->IsElementVisible( LAYER_FP_TEXT ) );
guide.SetIgnoreModulesOnBack( !board()->IsElementVisible( LAYER_FOOTPRINTS_BK ) );
guide.SetIgnoreModulesOnFront( !board()->IsElementVisible( LAYER_FOOTPRINTS_FR ) );
guide.SetIgnorePadsOnBack( padsDisabled || !board()->IsElementVisible( LAYER_PADS_SMD_BK ) );
guide.SetIgnorePadsOnFront( padsDisabled || !board()->IsElementVisible( LAYER_PADS_SMD_FR ) );
guide.SetIgnoreThroughHolePads( padsDisabled || !board()->IsElementVisible( LAYER_PADS_TH ) );
guide.SetIgnoreModulesVals( !board()->IsElementVisible( LAYER_FP_VALUES ) );
guide.SetIgnoreModulesRefs( !board()->IsElementVisible( LAYER_FP_REFERENCES ) );
guide.SetIgnoreThroughVias( !board()->IsElementVisible( LAYER_VIAS ) );
guide.SetIgnoreBlindBuriedVias( !board()->IsElementVisible( LAYER_VIAS ) );
guide.SetIgnoreMicroVias( !board()->IsElementVisible( LAYER_VIAS ) );
guide.SetIgnoreTracks( !board()->IsElementVisible( LAYER_TRACKS ) );
return guide;
}
bool PCB_TEST_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere )
{
GENERAL_COLLECTORS_GUIDE guide = getCollectorsGuide();
GENERAL_COLLECTOR collector;
for( auto item : m_selection.Items() )
{
unhighlight( item, SELECTED, &m_selection );
}
m_selection.Clear();
m_selection.ClearReferencePoint();
if( m_selectableTypes.empty() )
collector.Collect( board(), GENERAL_COLLECTOR::AllBoardItems, aWhere, guide );
else
collector.Collect( board(), m_selectableTypes, aWhere, guide );
if( collector.GetCount() > 0 )
{
for( int i = 0; i < collector.GetCount(); ++i )
{
{
select( collector[i] );
}
}
}
m_toolMgr->ProcessEvent( EVENTS::SelectedEvent );
if( m_selectionHook )
m_selectionHook( frame(), &m_selection );
return false;
}
void PCB_TEST_SELECTION_TOOL::setTransitions()
{
Go( &PCB_TEST_SELECTION_TOOL::Main, PCB_ACTIONS::selectionActivate.MakeEvent() );
}
void PCB_TEST_SELECTION_TOOL::highlightInternal( EDA_ITEM* aItem, int aMode, bool aUsingOverlay )
{
if( aMode == SELECTED )
aItem->SetSelected();
else if( aMode == BRIGHTENED )
aItem->SetBrightened();
if( aUsingOverlay && aMode != BRIGHTENED )
view()->Hide( aItem, true ); // Hide the original item, so it is shown only on overlay
if( BOARD_ITEM* boardItem = dynamic_cast<BOARD_ITEM*>( aItem ) )
{
boardItem->RunOnDescendants( std::bind( &PCB_TEST_SELECTION_TOOL::highlightInternal, this,
std::placeholders::_1, aMode, aUsingOverlay ) );
}
}
void PCB_TEST_SELECTION_TOOL::unhighlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup )
{
if( aGroup )
aGroup->Remove( aItem );
unhighlightInternal( aItem, aMode, aGroup != nullptr );
view()->Update( aItem, KIGFX::REPAINT );
// Many selections are very temporal and updating the display each time just creates noise.
if( aMode == BRIGHTENED )
getView()->MarkTargetDirty( KIGFX::TARGET_OVERLAY );
}
void PCB_TEST_SELECTION_TOOL::unhighlightInternal( EDA_ITEM* aItem, int aMode, bool aUsingOverlay )
{
if( aMode == SELECTED )
aItem->ClearSelected();
else if( aMode == BRIGHTENED )
aItem->ClearBrightened();
if( aUsingOverlay && aMode != BRIGHTENED )
{
view()->Hide( aItem, false ); // Restore original item visibility...
view()->Update( aItem ); // ... and make sure it's redrawn un-selected
}
if( BOARD_ITEM* boardItem = dynamic_cast<BOARD_ITEM*>( aItem ) )
{
boardItem->RunOnDescendants( std::bind( &PCB_TEST_SELECTION_TOOL::unhighlightInternal, this,
std::placeholders::_1, aMode, aUsingOverlay ) );
}
}
void PCB_TEST_SELECTION_TOOL::highlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup )
{
if( aGroup )
aGroup->Add( aItem );
highlightInternal( aItem, aMode, aGroup != nullptr );
view()->Update( aItem, KIGFX::REPAINT );
}
void PCB_TEST_SELECTION_TOOL::select( EDA_ITEM* aItem )
{
if( aItem->IsSelected() )
return;
highlight( aItem, SELECTED, &m_selection );
}
void PCB_TEST_SELECTION_TOOL::unselect( EDA_ITEM* aItem )
{
unhighlight( aItem, SELECTED, &m_selection );
}
int PCB_TEST_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
{
// Main loop: keep receiving events
while( TOOL_EVENT* evt = Wait() )
{
if( evt->IsClick( BUT_LEFT ) )
{
selectPoint( evt->Position() );
}
else if( evt->IsCancel() )
{
if( !GetSelection().Empty() )
{
ClearSelection();
}
}
else
{
evt->SetPassEvent();
}
}
// Shutting down; clear the selection
m_selection.Clear();
m_disambiguateTimer.Stop();
return 0;
}
void PCB_TEST_SELECTION_TOOL::SetSelectableItemTypes( const std::vector<KICAD_T> aTypes )
{
m_selectableTypes = aTypes;
}

View File

@ -0,0 +1,75 @@
#ifndef __PCB_TEST_SELECTION_TOOL_H
#define __PCB_TEST_SELECTION_TOOL_H
#include <tool/action_menu.h>
#include <tool/selection_tool.h>
#include <tool/tool_menu.h>
#include <tools/pcb_selection_conditions.h>
#include <tools/pcb_tool_base.h>
#include <tools/pcb_selection.h>
class PCB_TEST_FRAME_BASE;
class PCB_TEST_SELECTION_TOOL : public SELECTION_TOOL
{
public:
PCB_TEST_SELECTION_TOOL();
virtual ~PCB_TEST_SELECTION_TOOL();
/// @copydoc TOOL_BASE::Init()
bool Init() override;
/// @copydoc TOOL_BASE::Reset()
void Reset( RESET_REASON aReason ) override;
int Main( const TOOL_EVENT& aEvent );
PCB_SELECTION& GetSelection() { return m_selection; }
void ClearSelection();
void SetSelectionHook( std::function<void(PCB_TEST_FRAME_BASE*, PCB_SELECTION*)> aHook )
{
m_selectionHook = aHook;
}
void SetSelectableItemTypes( const std::vector<KICAD_T> aTypes );
protected:
const GENERAL_COLLECTORS_GUIDE getCollectorsGuide() const;
bool selectPoint( const VECTOR2I& aWhere );
void setTransitions() override;
KIGFX::PCB_VIEW* view() const { return static_cast<KIGFX::PCB_VIEW*>( getView() ); }
KIGFX::VIEW_CONTROLS* controls() const { return getViewControls(); }
PCB_TEST_FRAME_BASE* frame() const { return getEditFrame<PCB_TEST_FRAME_BASE>(); }
BOARD* board() const { return getModel<BOARD>(); }
PCB_DRAW_PANEL_GAL* canvas() const
{
return static_cast<PCB_DRAW_PANEL_GAL*>( frame()->GetPanel().get() );
}
SELECTION& selection() override { return m_selection; }
void highlightInternal( EDA_ITEM* aItem, int aMode, bool aUsingOverlay );
void unhighlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup ) override;
void unhighlightInternal( EDA_ITEM* aItem, int aMode, bool aUsingOverlay );
void highlight( EDA_ITEM* aItem, int aMode, SELECTION* aGroup ) override;
void select( EDA_ITEM* aItem ) override;
void unselect( EDA_ITEM* aItem ) override;
private:
std::function<void(PCB_TEST_FRAME_BASE*,PCB_SELECTION*)> m_selectionHook;
PCB_SELECTION m_selection; // Current state of selection
std::vector<KICAD_T> m_selectableTypes;
};
#endif

View File

@ -144,9 +144,9 @@
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">fgSizer3</property>
<property name="name">m_topBarSizer</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="permission">protected</property>
<property name="rows">3</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="false">
@ -495,11 +495,11 @@
<event name="OnTextEnter">onRewindCountText</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -557,11 +557,11 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="true">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -623,11 +623,11 @@
<event name="OnText">onFilterText</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -689,11 +689,11 @@
<event name="OnCheckBox">onShowRPIsChecked</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -755,11 +755,11 @@
<event name="OnCheckBox">onShowThinLinesChecked</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -821,11 +821,11 @@
<event name="OnCheckBox">onShowVerticesChecked</event>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -883,21 +883,21 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="true">
<object class="spacer" expanded="false">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="true">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -955,11 +955,11 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="true">
<object class="wxChoice" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1022,31 +1022,70 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">m_viewSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">protected</property>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="true">
<object class="wxSplitterWindow" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_pane_size">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="name">bSizer6</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxTreeListCtrl" expanded="false">
<property name="moveable">1</property>
<property name="name">m_mainSplitter</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="sashgravity">0.0</property>
<property name="sashpos">0</property>
<property name="sashsize">-1</property>
<property name="show">1</property>
<property name="size"></property>
<property name="splitmode">wxSPLIT_HORIZONTAL</property>
<property name="style">wxSP_3D</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<object class="splitteritem" expanded="true">
<object class="wxPanel" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1082,7 +1121,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_itemList</property>
<property name="name">m_panelProps</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1092,13 +1131,330 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxTL_CHECKBOX|wxTL_DEFAULT_STYLE|wxTL_MULTIPLE</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bSizer5</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">1</property>
<object class="wxNotebook" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmapsize"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_propsNotebook</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<object class="notebookpage" expanded="false">
<property name="bitmap"></property>
<property name="label">Geometry</property>
<property name="select">0</property>
<object class="wxPanel" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_panelListView</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="false">
<property name="minimum_size"></property>
<property name="name">bSizer6</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxTreeListCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_itemList</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxTL_CHECKBOX|wxTL_DEFAULT_STYLE|wxTL_MULTIPLE</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
</object>
<object class="notebookpage" expanded="true">
<property name="bitmap"></property>
<property name="label">Console</property>
<property name="select">0</property>
<object class="wxPanel" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_panelConsole</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bSizer7</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_consoleText</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>

View File

@ -117,12 +117,18 @@ void PNS_LOG_VIEWER_OVERLAY::DrawAnnotations()
PNS_LOG_VIEWER_FRAME::PNS_LOG_VIEWER_FRAME( wxFrame* frame ) :
PNS_LOG_VIEWER_FRAME_BASE( frame ), m_rewindIter( 0 ), m_reporter( &m_consoleLog )
PNS_LOG_VIEWER_FRAME_BASE( frame ), m_rewindIter( 0 )
{
LoadSettings();
createView( this, PCB_DRAW_PANEL_GAL::GAL_TYPE_OPENGL );
m_viewSizer->Add( m_galPanel.get(), 1, wxEXPAND, 5 );
m_reporter.reset( new WX_TEXT_CTRL_REPORTER( m_consoleText ) );
m_galPanel->SetParent( m_mainSplitter );
m_mainSplitter->Initialize( m_galPanel.get() );
m_mainSplitter->SplitHorizontally( m_galPanel.get(), m_panelProps );
m_galPanel->Layout();
m_topBarSizer->Layout();
m_mainSizer->Layout();
Layout();
@ -329,7 +335,7 @@ void PNS_LOG_VIEWER_FRAME::LoadLogFile( const wxString& aFile )
{
std::unique_ptr<PNS_LOG_FILE> logFile( new PNS_LOG_FILE );
if( logFile->Load( wxFileName( aFile ), &m_reporter ) )
if( logFile->Load( wxFileName( aFile ), m_reporter.get() ) )
SetLogFile( logFile.release() );
}
@ -417,7 +423,7 @@ void PNS_LOG_VIEWER_FRAME::onSaveAs( wxCommandEvent& event )
wxASSERT_MSG( create_me.IsAbsolute(), wxS( "wxFileDialog returned non-absolute path" ) );
m_logFile->SaveLog( create_me, &m_reporter );
m_logFile->SaveLog( create_me, m_reporter.get() );
m_mruPath = create_me.GetPath();
}
@ -933,6 +939,12 @@ void PNS_LOG_VIEWER_FRAME::updatePnsPreviewItems( int iter )
//view->UpdateAllItems( KIGFX::ALL );
}
REPORTER* PNS_LOG_VIEWER_FRAME::GetConsoleReporter()
{
return m_reporter.get();
}
#if 0
static BOARD* loadBoard( const std::string& filename )

View File

@ -31,6 +31,7 @@
#include <pcb_painter.h>
#include <pcb_test_frame.h>
#include <pcbnew_utils/board_test_utils.h>
#include <reporter.h>
#include "pns_log_file.h"
#include "pns_log_player.h"
@ -55,6 +56,7 @@ public:
void LoadLogFile( const wxString& aFile );
void SetLogFile( PNS_LOG_FILE* aLog );
void SetBoard2( std::shared_ptr<BOARD> aBoard );
REPORTER* GetConsoleReporter();
std::shared_ptr<PNS_LOG_VIEWER_OVERLAY> GetOverlay() const { return m_overlay; }
@ -96,8 +98,8 @@ private:
bool m_showRPIs = true;
bool m_showVertices = false;
wxString m_searchString;
KI_TEST::CONSOLE_LOG m_consoleLog;
KI_TEST::CONSOLE_MSG_REPORTER m_reporter;
//KI_TEST::CONSOLE_LOG m_consoleLog;
std::shared_ptr<WX_TEXT_CTRL_REPORTER> m_reporter;
};
class LABEL_MANAGER;

View File

@ -33,65 +33,64 @@ PNS_LOG_VIEWER_FRAME_BASE::PNS_LOG_VIEWER_FRAME_BASE( wxWindow* parent, wxWindow
m_mainSizer = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizer3;
fgSizer3 = new wxFlexGridSizer( 3, 10, 0, 0 );
fgSizer3->SetFlexibleDirection( wxBOTH );
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_topBarSizer = new wxFlexGridSizer( 3, 10, 0, 0 );
m_topBarSizer->SetFlexibleDirection( wxBOTH );
m_topBarSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_rewindText = new wxStaticText( this, wxID_ANY, wxT("Rewind: "), wxDefaultPosition, wxDefaultSize, 0 );
m_rewindText->Wrap( -1 );
fgSizer3->Add( m_rewindText, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_topBarSizer->Add( m_rewindText, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_rewindLeft = new wxButton( this, wxID_ANY, wxT("<"), wxDefaultPosition, wxSize( 50,-1 ), 0 );
m_rewindLeft->SetMaxSize( wxSize( 50,-1 ) );
fgSizer3->Add( m_rewindLeft, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_topBarSizer->Add( m_rewindLeft, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_rewindSlider = new wxSlider( this, wxID_ANY, 50, 0, 100, wxDefaultPosition, wxSize( 200,-1 ), wxSL_HORIZONTAL );
m_rewindSlider->SetMinSize( wxSize( 200,-1 ) );
fgSizer3->Add( m_rewindSlider, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_topBarSizer->Add( m_rewindSlider, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_rewindRight = new wxButton( this, wxID_ANY, wxT(">"), wxDefaultPosition, wxSize( 50,-1 ), 0 );
m_rewindRight->SetMaxSize( wxSize( 50,-1 ) );
fgSizer3->Add( m_rewindRight, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_topBarSizer->Add( m_rewindRight, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_rewindPos = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 50,-1 ), wxTE_PROCESS_ENTER );
m_rewindPos->SetMaxSize( wxSize( 50,-1 ) );
fgSizer3->Add( m_rewindPos, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_topBarSizer->Add( m_rewindPos, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
m_staticText2 = new wxStaticText( this, wxID_ANY, wxT("Filter:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
fgSizer3->Add( m_staticText2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_topBarSizer->Add( m_staticText2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_filterString = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_filterString, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_topBarSizer->Add( m_filterString, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_chkShowRPItems = new wxCheckBox( this, wxID_ANY, wxT("Show RPIs"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_chkShowRPItems, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_topBarSizer->Add( m_chkShowRPItems, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_chkThinLines = new wxCheckBox( this, wxID_ANY, wxT("Thin lines"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_chkThinLines, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_topBarSizer->Add( m_chkThinLines, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_showVertices = new wxCheckBox( this, wxID_ANY, wxT("Show Vertices"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_showVertices, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_topBarSizer->Add( m_showVertices, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_algoStatus = new wxStaticText( this, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
m_algoStatus->Wrap( -1 );
m_algoStatus->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
fgSizer3->Add( m_algoStatus, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_topBarSizer->Add( m_algoStatus, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
m_topBarSizer->Add( 0, 0, 1, wxEXPAND, 5 );
m_ideLabel = new wxStaticText( this, wxID_ANY, wxT("Select your IDE:"), wxPoint( -1,-1 ), wxDefaultSize, 0 );
m_ideLabel->Wrap( -1 );
m_ideLabel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
fgSizer3->Add( m_ideLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_topBarSizer->Add( m_ideLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxString m_ideChoiceChoices[] = { wxT("VS Code"), wxT("Visual Studio (full)"), wxT("CLion"), wxT("Emacs") };
int m_ideChoiceNChoices = sizeof( m_ideChoiceChoices ) / sizeof( wxString );
@ -99,25 +98,53 @@ PNS_LOG_VIEWER_FRAME_BASE::PNS_LOG_VIEWER_FRAME_BASE( wxWindow* parent, wxWindow
m_ideChoice->SetSelection( 0 );
m_ideChoice->SetToolTip( wxT("Select IDE for go to line functionality") );
fgSizer3->Add( m_ideChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_topBarSizer->Add( m_ideChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_mainSizer->Add( fgSizer3, 0, wxEXPAND, 5 );
m_mainSizer->Add( m_topBarSizer, 0, wxEXPAND, 5 );
m_viewSizer = new wxBoxSizer( wxVERTICAL );
m_mainSplitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
m_mainSplitter->Connect( wxEVT_IDLE, wxIdleEventHandler( PNS_LOG_VIEWER_FRAME_BASE::m_mainSplitterOnIdle ), NULL, this );
m_panelProps = new wxPanel( m_mainSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer5;
bSizer5 = new wxBoxSizer( wxVERTICAL );
m_mainSizer->Add( m_viewSizer, 1, wxEXPAND, 5 );
m_propsNotebook = new wxNotebook( m_panelProps, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_panelListView = new wxPanel( m_propsNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer6;
bSizer6 = new wxBoxSizer( wxVERTICAL );
m_itemList = new wxTreeListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTL_CHECKBOX|wxTL_DEFAULT_STYLE|wxTL_MULTIPLE );
m_itemList = new wxTreeListCtrl( m_panelListView, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTL_CHECKBOX|wxTL_DEFAULT_STYLE|wxTL_MULTIPLE );
bSizer6->Add( m_itemList, 1, wxALL|wxEXPAND, 5 );
m_mainSizer->Add( bSizer6, 1, wxEXPAND, 5 );
m_panelListView->SetSizer( bSizer6 );
m_panelListView->Layout();
bSizer6->Fit( m_panelListView );
m_propsNotebook->AddPage( m_panelListView, wxT("Geometry"), false );
m_panelConsole = new wxPanel( m_propsNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer7;
bSizer7 = new wxBoxSizer( wxVERTICAL );
m_consoleText = new wxTextCtrl( m_panelConsole, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH );
bSizer7->Add( m_consoleText, 1, wxALL|wxEXPAND, 5 );
m_panelConsole->SetSizer( bSizer7 );
m_panelConsole->Layout();
bSizer7->Fit( m_panelConsole );
m_propsNotebook->AddPage( m_panelConsole, wxT("Console"), false );
bSizer5->Add( m_propsNotebook, 1, wxEXPAND | wxALL, 5 );
m_panelProps->SetSizer( bSizer5 );
m_panelProps->Layout();
bSizer5->Fit( m_panelProps );
m_mainSplitter->Initialize( m_panelProps );
m_mainSizer->Add( m_mainSplitter, 1, wxEXPAND, 5 );
this->SetSizer( m_mainSizer );

View File

@ -26,6 +26,9 @@
#include <wx/choice.h>
#include <wx/sizer.h>
#include <wx/treelist.h>
#include <wx/panel.h>
#include <wx/notebook.h>
#include <wx/splitter.h>
#include <wx/statusbr.h>
#include <wx/frame.h>
@ -43,6 +46,7 @@ class PNS_LOG_VIEWER_FRAME_BASE : public wxFrame
wxMenuBar* m_menubar1;
wxMenu* m_menu1;
wxBoxSizer* m_mainSizer;
wxFlexGridSizer* m_topBarSizer;
wxStaticText* m_rewindText;
wxButton* m_rewindLeft;
wxSlider* m_rewindSlider;
@ -56,8 +60,13 @@ class PNS_LOG_VIEWER_FRAME_BASE : public wxFrame
wxStaticText* m_algoStatus;
wxStaticText* m_ideLabel;
wxChoice* m_ideChoice;
wxBoxSizer* m_viewSizer;
wxSplitterWindow* m_mainSplitter;
wxPanel* m_panelProps;
wxNotebook* m_propsNotebook;
wxPanel* m_panelListView;
wxTreeListCtrl* m_itemList;
wxPanel* m_panelConsole;
wxTextCtrl* m_consoleText;
wxStatusBar* m_statusBar;
// Virtual event handlers, override them in your derived class
@ -81,5 +90,11 @@ class PNS_LOG_VIEWER_FRAME_BASE : public wxFrame
~PNS_LOG_VIEWER_FRAME_BASE();
void m_mainSplitterOnIdle( wxIdleEvent& )
{
m_mainSplitter->SetSashPosition( 0 );
m_mainSplitter->Disconnect( wxEVT_IDLE, wxIdleEventHandler( PNS_LOG_VIEWER_FRAME_BASE::m_mainSplitterOnIdle ), NULL, this );
}
};