Added an option change grid style. Refactored DIALOG_SET_GRID. GAL can draw grid using lines or dots now. DIALOG_SET_GRID was refactored to use Transfer{From,To}Window() methods.

This commit is contained in:
Maciej Suminski 2016-05-02 16:15:24 +02:00
parent f3fae70fb2
commit ed0b95d710
5 changed files with 290 additions and 175 deletions

View File

@ -858,6 +858,14 @@ public:
gridStyle = aGridStyle;
}
/**
* @brief Returns the current grid drawing style.
*/
virtual GRID_STYLE GetGridStyle() const
{
return gridStyle;
}
/**
* @brief Compute the point position in world coordinates from given screen coordinates.
*

View File

@ -1,11 +1,7 @@
/**
* @file dialog_set_grid.cpp
* @brief Manage user grid.
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -25,49 +21,48 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h>
#include <macros.h>
#include <common.h>
#include <base_units.h>
#include <macros.h>
/**
* @file dialog_set_grid.cpp
* @brief Manage user grid.
*/
#include <pcbnew.h>
#include <pcbnew_id.h>
#include <dialog_set_grid_base.h>
#include <invoke_pcb_dialog.h>
#include <base_units.h>
#include <convert_to_biu.h>
#include <common.h>
#include <wxBasePcbFrame.h>
#include <class_drawpanel.h>
#include <class_draw_panel_gal.h>
#include <gal/graphics_abstraction_layer.h>
#include <class_draw_panel_gal.h>
#include <tool/tool_manager.h>
#include <tools/common_actions.h>
#include <tool/tool_manager.h>
#include <limits.h>
// Max values for grid size
#define MAX_GRID_SIZE ( 50.0 * IU_PER_MM )
#define MIN_GRID_SIZE ( 0.001 * IU_PER_MM )
static const double MAX_GRID_SIZE = 50.0 * IU_PER_MM;
static const double MIN_GRID_SIZE = 0.001 * IU_PER_MM;
// Min/Max value for grid offset
#define MAX_GRID_OFFSET ((double)INT_MAX/2)
static const double MAX_GRID_OFFSET = INT_MAX / 2.0;
class DIALOG_SET_GRID : public DIALOG_SET_GRID_BASE
{
public:
/// This has no dependencies on calling wxFrame derivative, such as PCB_BASE_FRAME.
DIALOG_SET_GRID( wxFrame* aCaller, EDA_UNITS_T* aGridUnits, EDA_UNITS_T aBoardUnits,
wxRealPoint* aUserSize, wxPoint* aOrigin,
int* aFastGrid1, int* aFastGrid2, const wxArrayString& aGridChoices );
DIALOG_SET_GRID( PCB_BASE_FRAME* aParent, const wxArrayString& aGridChoices );
bool TransferDataFromWindow();
bool TransferDataToWindow();
private:
void OnResetGridOrgClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void OnOkClick( wxCommandEvent& event );
EDA_UNITS_T& m_callers_grid_units;
EDA_UNITS_T m_callers_board_units;
wxRealPoint& m_callers_user_size;
wxPoint& m_callers_origin;
int& m_callers_fast_grid1;
int& m_callers_fast_grid2;
PCB_BASE_FRAME* m_parent;
wxArrayString m_fast_grid_opts;
void setGridUnits( EDA_UNITS_T units );
EDA_UNITS_T getGridUnits();
@ -80,28 +75,21 @@ private:
void setGridForFastSwitching( const wxArrayString& aGrids, int aGrid1, int aGrid2 );
void getGridForFastSwitching( int& aGrid1, int& aGrid2 );
void setGridStyle( KIGFX::GRID_STYLE aStyle );
KIGFX::GRID_STYLE getGridStyle() const;
};
DIALOG_SET_GRID::DIALOG_SET_GRID( wxFrame* aCaller, EDA_UNITS_T* aGridUnits, EDA_UNITS_T aBoardUnits,
wxRealPoint* aUserSize, wxPoint* aOrigin, int* aFastGrid1, int* aFastGrid2, const wxArrayString& aGridChoices ):
DIALOG_SET_GRID_BASE( aCaller ),
m_callers_grid_units( *aGridUnits ),
m_callers_board_units( aBoardUnits ),
m_callers_user_size( *aUserSize ),
m_callers_origin( *aOrigin ),
m_callers_fast_grid1( *aFastGrid1 ),
m_callers_fast_grid2( *aFastGrid2 )
DIALOG_SET_GRID::DIALOG_SET_GRID( PCB_BASE_FRAME* aParent, const wxArrayString& aGridChoices ):
DIALOG_SET_GRID_BASE( aParent ),
m_parent( aParent ),
m_fast_grid_opts( aGridChoices )
{
m_TextPosXUnits->SetLabel( GetUnitsLabel( m_callers_board_units ) );
m_TextPosYUnits->SetLabel( GetUnitsLabel( m_callers_board_units ) );
m_sdbSizer1OK->SetDefault(); // set OK button as default response to 'Enter' key
setGridUnits( m_callers_grid_units );
setGridSize( m_callers_user_size );
setGridOrigin( m_callers_origin );
setGridForFastSwitching( aGridChoices, m_callers_fast_grid1, m_callers_fast_grid2 );
m_TextPosXUnits->SetLabel( GetUnitsLabel( m_parent->m_UserGridUnit ) );
m_TextPosYUnits->SetLabel( GetUnitsLabel( m_parent->m_UserGridUnit ) );
GetSizer()->SetSizeHints( this );
Fit();
@ -109,9 +97,88 @@ DIALOG_SET_GRID::DIALOG_SET_GRID( wxFrame* aCaller, EDA_UNITS_T* aGridUnits, EDA
}
bool DIALOG_SET_GRID::TransferDataFromWindow()
{
// Validate new settings
wxRealPoint gridSize;
if( !getGridSize( gridSize ) )
{
wxMessageBox( wxString::Format( _( "Incorrect grid size "
"(size must be >= %.3f mm and <= %.3f mm)" ),
MIN_GRID_SIZE/IU_PER_MM, MAX_GRID_SIZE/IU_PER_MM ) );
return false;
}
wxPoint gridOrigin;
if( !getGridOrigin( gridOrigin ) )
{
wxMessageBox( wxString::Format( _( "Incorrect grid origin "
"(coordinates must be >= %.3f mm and <= %.3f mm)" ),
-MAX_GRID_OFFSET/IU_PER_MM, MAX_GRID_OFFSET/IU_PER_MM ) );
return false;
}
int fastGrid1, fastGrid2;
getGridForFastSwitching( fastGrid1, fastGrid2 );
EDA_UNITS_T units = getGridUnits();
// Apply the new settings
// Because grid origin is saved in board, show as modified
m_parent->OnModify();
m_parent->SetGridOrigin( gridOrigin );
m_parent->m_UserGridUnit = units;
m_parent->m_UserGridSize = gridSize;
m_parent->m_FastGrid1 = fastGrid1;
m_parent->m_FastGrid2 = fastGrid2;
// User grid
BASE_SCREEN* screen = m_parent->GetScreen();
screen->AddGrid( gridSize, units, ID_POPUP_GRID_USER );
// If the user grid is the current option, recall SetGrid()
// to force new values put in list as current grid value
if( screen->GetGridCmdId() == ID_POPUP_GRID_USER )
screen->SetGrid( ID_POPUP_GRID_USER );
// Notify GAL
TOOL_MANAGER* mgr = m_parent->GetToolManager();
if( mgr && m_parent->IsGalCanvasActive() )
{
mgr->RunAction( "common.Control.gridPreset", true,
screen->GetGridCmdId() - ID_POPUP_GRID_LEVEL_1000 );
TOOL_EVENT gridOriginUpdate = COMMON_ACTIONS::gridSetOrigin.MakeEvent();
gridOriginUpdate.SetParameter( new VECTOR2D( gridOrigin ) );
mgr->ProcessEvent( gridOriginUpdate );
}
m_parent->GetGalCanvas()->GetGAL()->SetGridStyle( getGridStyle() );
m_parent->GetCanvas()->Refresh();
return wxDialog::TransferDataFromWindow();
}
bool DIALOG_SET_GRID::TransferDataToWindow()
{
setGridUnits( m_parent->m_UserGridUnit );
setGridSize( m_parent->m_UserGridSize );
setGridOrigin( m_parent->GetGridOrigin() );
setGridForFastSwitching( m_fast_grid_opts, m_parent->m_FastGrid1, m_parent->m_FastGrid2 );
setGridStyle( m_parent->GetGalCanvas()->GetGAL()->GetGridStyle() );
return wxDialog::TransferDataToWindow();
}
void DIALOG_SET_GRID::setGridUnits( EDA_UNITS_T aUnits )
{
m_UnitGrid->SetSelection( aUnits != INCHES );
m_UnitGrid->SetSelection( aUnits != INCHES );
}
@ -136,15 +203,12 @@ void DIALOG_SET_GRID::setGridSize( const wxRealPoint& grid )
bool DIALOG_SET_GRID::getGridSize( wxRealPoint& aGrisSize )
{
wxRealPoint grid;
m_callers_grid_units = getGridUnits();
double grid_unit_to_iu = m_callers_grid_units == INCHES ? IU_PER_MILS*1000 : IU_PER_MM;
wxString val = m_OptGridSizeX->GetValue();
double grid_unit_to_iu = ( getGridUnits() == INCHES ? IU_PER_MILS * 1000 : IU_PER_MM );
double tmp;
if( !val.ToDouble( &tmp ) ||
tmp*grid_unit_to_iu < MIN_GRID_SIZE || tmp*grid_unit_to_iu > MAX_GRID_SIZE )
tmp * grid_unit_to_iu < MIN_GRID_SIZE || tmp * grid_unit_to_iu > MAX_GRID_SIZE )
{
return false;
}
@ -167,22 +231,33 @@ bool DIALOG_SET_GRID::getGridSize( wxRealPoint& aGrisSize )
bool DIALOG_SET_GRID::getGridOrigin( wxPoint& aGridOrigin )
{
double tmp;
double x, y;
tmp = DoubleValueFromString( g_UserUnit, m_GridOriginXCtrl->GetValue() );
const wxString& x_str = m_GridOriginXCtrl->GetValue();
if( !x_str.ToDouble( &x ) )
return false;
x = DoubleValueFromString( g_UserUnit, x_str );
// Some error checking here is a good thing.
if( tmp < -MAX_GRID_OFFSET || tmp > MAX_GRID_OFFSET )
if( x < -MAX_GRID_OFFSET || x > MAX_GRID_OFFSET )
return false;
aGridOrigin.x = KiROUND( tmp );
tmp = DoubleValueFromString( g_UserUnit, m_GridOriginYCtrl->GetValue() );
const wxString& y_str = m_GridOriginYCtrl->GetValue();
if( tmp < -MAX_GRID_OFFSET || tmp > MAX_GRID_OFFSET )
if( !y_str.ToDouble( &y ) )
return false;
aGridOrigin.y = KiROUND( tmp );
y = DoubleValueFromString( g_UserUnit, y_str );
if( y < -MAX_GRID_OFFSET || y > MAX_GRID_OFFSET )
return false;
aGridOrigin.x = KiROUND( x );
aGridOrigin.y = KiROUND( y );
return true;
}
@ -212,90 +287,26 @@ void DIALOG_SET_GRID::getGridForFastSwitching( int& aGrid1, int& aGrid2 )
}
void DIALOG_SET_GRID::setGridStyle( KIGFX::GRID_STYLE aStyle )
{
m_Style->SetSelection( aStyle != KIGFX::GRID_STYLE_DOTS );
}
KIGFX::GRID_STYLE DIALOG_SET_GRID::getGridStyle() const
{
return m_Style->GetSelection() == 0 ? KIGFX::GRID_STYLE_DOTS : KIGFX::GRID_STYLE_LINES;
}
void DIALOG_SET_GRID::OnResetGridOrgClick( wxCommandEvent& event )
{
setGridOrigin( wxPoint( 0, 0 ) );
}
void DIALOG_SET_GRID::OnCancelClick( wxCommandEvent& event )
{
EndModal( wxID_CANCEL );
}
void DIALOG_SET_GRID::OnOkClick( wxCommandEvent& event )
{
bool success = getGridSize( m_callers_user_size );
if( !success )
{
wxMessageBox( wxString::Format( _( "Incorrect grid size (size must be >= %.3f mm and <= %.3f mm)"),
MIN_GRID_SIZE/IU_PER_MM, MAX_GRID_SIZE/IU_PER_MM ) );
return;
}
success = getGridOrigin( m_callers_origin );
if( !success )
{
wxMessageBox( wxString::Format( _( "Incorrect grid origin (coordinates must be >= %.3f mm and <= %.3f mm)" ),
-MAX_GRID_OFFSET/IU_PER_MM, MAX_GRID_OFFSET/IU_PER_MM ) );
return;
}
getGridForFastSwitching( m_callers_fast_grid1, m_callers_fast_grid2 );
EndModal( wxID_OK );
}
#include <class_drawpanel.h>
#include <wxBasePcbFrame.h>
bool PCB_BASE_FRAME::InvokeDialogGrid()
{
wxPoint grid_origin = GetGridOrigin();
DIALOG_SET_GRID dlg( this, &m_UserGridUnit, g_UserUnit, &m_UserGridSize,
&grid_origin, &m_FastGrid1, &m_FastGrid2,
m_gridSelectBox->GetStrings() );
int ret = dlg.ShowModal();
if( ret == wxID_OK )
{
if( GetGridOrigin() != grid_origin && IsType( FRAME_PCB ) )
OnModify(); // because grid origin is saved in board, show as modified
SetGridOrigin( grid_origin );
BASE_SCREEN* screen = GetScreen();
screen->AddGrid( m_UserGridSize, m_UserGridUnit, ID_POPUP_GRID_USER );
// If the user grid is the current option, recall SetGrid()
// to force new values put in list as current grid value
if( screen->GetGridCmdId() == ID_POPUP_GRID_USER )
screen->SetGrid( ID_POPUP_GRID_USER );
// Notify GAL
TOOL_MANAGER* mgr = GetToolManager();
if( mgr && IsGalCanvasActive() )
{
mgr->RunAction( "common.Control.gridPreset", true,
screen->GetGridCmdId() - ID_POPUP_GRID_LEVEL_1000 );
TOOL_EVENT gridOriginUpdate = COMMON_ACTIONS::gridSetOrigin.MakeEvent();
gridOriginUpdate.SetParameter( new VECTOR2D( grid_origin ) );
mgr->ProcessEvent( gridOriginUpdate );
}
m_canvas->Refresh();
return true;
}
return false;
DIALOG_SET_GRID dlg( this, m_gridSelectBox->GetStrings() );
return dlg.ShowModal();
}

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 9 2015)
// C++ code generated with wxFormBuilder (version Apr 13 2016)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -24,7 +24,7 @@ DIALOG_SET_GRID_BASE::DIALOG_SET_GRID_BASE( wxWindow* parent, wxWindowID id, con
wxString m_UnitGridChoices[] = { _("Inches"), _("Millimeters") };
int m_UnitGridNChoices = sizeof( m_UnitGridChoices ) / sizeof( wxString );
m_UnitGrid = new wxRadioBox( this, wxID_ANY, _("Units"), wxDefaultPosition, wxDefaultSize, m_UnitGridNChoices, m_UnitGridChoices, 1, wxRA_SPECIFY_COLS );
m_UnitGrid = new wxRadioBox( sbLeftSizer->GetStaticBox(), wxID_ANY, _("Units"), wxDefaultPosition, wxDefaultSize, m_UnitGridNChoices, m_UnitGridChoices, 1, wxRA_SPECIFY_COLS );
m_UnitGrid->SetSelection( 0 );
sbLeftSizer->Add( m_UnitGrid, 0, wxALL|wxEXPAND, 5 );
@ -34,20 +34,18 @@ DIALOG_SET_GRID_BASE::DIALOG_SET_GRID_BASE( wxWindow* parent, wxWindowID id, con
fgSizer31->SetFlexibleDirection( wxBOTH );
fgSizer31->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticTextSizeX = new wxStaticText( this, wxID_ANY, _("Size X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextSizeX = new wxStaticText( sbLeftSizer->GetStaticBox(), wxID_ANY, _("Size X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextSizeX->Wrap( -1 );
fgSizer31->Add( m_staticTextSizeX, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OptGridSizeX = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_OptGridSizeX->SetMaxLength( 0 );
m_OptGridSizeX = new wxTextCtrl( sbLeftSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer31->Add( m_OptGridSizeX, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_staticTextSizeY = new wxStaticText( this, wxID_ANY, _("Size Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextSizeY = new wxStaticText( sbLeftSizer->GetStaticBox(), wxID_ANY, _("Size Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextSizeY->Wrap( -1 );
fgSizer31->Add( m_staticTextSizeY, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OptGridSizeY = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_OptGridSizeY->SetMaxLength( 0 );
m_OptGridSizeY = new wxTextCtrl( sbLeftSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer31->Add( m_OptGridSizeY, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
@ -68,34 +66,32 @@ DIALOG_SET_GRID_BASE::DIALOG_SET_GRID_BASE( wxWindow* parent, wxWindowID id, con
fgSizerGridOrigin->SetFlexibleDirection( wxBOTH );
fgSizerGridOrigin->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticTextGridPosX = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextGridPosX = new wxStaticText( sbRightSizer->GetStaticBox(), wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextGridPosX->Wrap( -1 );
fgSizerGridOrigin->Add( m_staticTextGridPosX, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxTOP, 5 );
m_GridOriginXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_GridOriginXCtrl->SetMaxLength( 0 );
m_GridOriginXCtrl = new wxTextCtrl( sbRightSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerGridOrigin->Add( m_GridOriginXCtrl, 0, wxEXPAND|wxLEFT|wxTOP, 5 );
m_TextPosXUnits = new wxStaticText( this, wxID_ANY, _("Inches"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextPosXUnits = new wxStaticText( sbRightSizer->GetStaticBox(), wxID_ANY, _("Inches"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextPosXUnits->Wrap( -1 );
fgSizerGridOrigin->Add( m_TextPosXUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxLEFT|wxTOP, 5 );
m_staticTextGridPosY = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextGridPosY = new wxStaticText( sbRightSizer->GetStaticBox(), wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextGridPosY->Wrap( -1 );
fgSizerGridOrigin->Add( m_staticTextGridPosY, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_GridOriginYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_GridOriginYCtrl->SetMaxLength( 0 );
m_GridOriginYCtrl = new wxTextCtrl( sbRightSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerGridOrigin->Add( m_GridOriginYCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_TextPosYUnits = new wxStaticText( this, wxID_ANY, _("Inches"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextPosYUnits = new wxStaticText( sbRightSizer->GetStaticBox(), wxID_ANY, _("Inches"), wxDefaultPosition, wxDefaultSize, 0 );
m_TextPosYUnits->Wrap( -1 );
fgSizerGridOrigin->Add( m_TextPosYUnits, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL, 5 );
sbRightSizer->Add( fgSizerGridOrigin, 0, wxALL|wxEXPAND, 5 );
m_buttonReset = new wxButton( this, wxID_ANY, _("Reset Grid Origin"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonReset = new wxButton( sbRightSizer->GetStaticBox(), wxID_ANY, _("Reset Grid Origin"), wxDefaultPosition, wxDefaultSize, 0 );
sbRightSizer->Add( m_buttonReset, 0, wxALL|wxEXPAND, 5 );
@ -110,18 +106,18 @@ DIALOG_SET_GRID_BASE::DIALOG_SET_GRID_BASE( wxWindow* parent, wxWindowID id, con
fgSizer3->SetFlexibleDirection( wxBOTH );
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticTextGrid1 = new wxStaticText( this, wxID_ANY, _("Grid 1:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextGrid1 = new wxStaticText( sbSizer4->GetStaticBox(), wxID_ANY, _("Grid 1:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextGrid1->Wrap( -1 );
fgSizer3->Add( m_staticTextGrid1, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxTOP, 5 );
m_comboBoxGrid1 = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
m_comboBoxGrid1 = new wxComboBox( sbSizer4->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
fgSizer3->Add( m_comboBoxGrid1, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
m_staticTextGrid2 = new wxStaticText( this, wxID_ANY, _("Grid 2:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextGrid2 = new wxStaticText( sbSizer4->GetStaticBox(), wxID_ANY, _("Grid 2:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextGrid2->Wrap( -1 );
fgSizer3->Add( m_staticTextGrid2, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_comboBoxGrid2 = new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
m_comboBoxGrid2 = new wxComboBox( sbSizer4->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
fgSizer3->Add( m_comboBoxGrid2, 1, wxALL|wxEXPAND, 5 );
@ -133,6 +129,12 @@ DIALOG_SET_GRID_BASE::DIALOG_SET_GRID_BASE( wxWindow* parent, wxWindowID id, con
bUpperSizer->Add( bSizer4, 1, wxEXPAND, 5 );
wxString m_StyleChoices[] = { _("Dots"), _("Lines") };
int m_StyleNChoices = sizeof( m_StyleChoices ) / sizeof( wxString );
m_Style = new wxRadioBox( this, wxID_ANY, _("Style (OpenGL && Cairo)"), wxDefaultPosition, wxDefaultSize, m_StyleNChoices, m_StyleChoices, 1, wxRA_SPECIFY_COLS );
m_Style->SetSelection( 0 );
bUpperSizer->Add( m_Style, 0, wxALL|wxEXPAND, 5 );
bSizerMain->Add( bUpperSizer, 1, wxEXPAND, 5 );

View File

@ -112,6 +112,7 @@
<property name="minimum_size"></property>
<property name="name">sbLeftSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
@ -204,11 +205,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="1">
<object class="wxFlexGridSizer" expanded="0">
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
@ -581,16 +582,17 @@
<property name="name">bSizer4</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property>
<property name="label">Origin</property>
<property name="minimum_size"></property>
<property name="name">sbRightSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
@ -1215,23 +1217,24 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property>
<property name="label">Fast Switching</property>
<property name="minimum_size"></property>
<property name="name">sbSizer4</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxFlexGridSizer" expanded="1">
<object class="wxFlexGridSizer" expanded="0">
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
@ -1243,11 +1246,11 @@
<property name="permission">none</property>
<property name="rows">2</property>
<property name="vgap">0</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1326,11 +1329,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
<property name="proportion">1</property>
<object class="wxComboBox" expanded="1">
<object class="wxComboBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1417,11 +1420,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1500,11 +1503,11 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxComboBox" expanded="1">
<object class="wxComboBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1597,6 +1600,96 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="0">
<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="choices">&quot;Dots&quot; &quot;Lines&quot;</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="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="label">Style (OpenGL &amp;&amp; Cairo)</property>
<property name="majorDimension">1</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_Style</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="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></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="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRadioBox"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 9 2015)
// C++ code generated with wxFormBuilder (version Apr 13 2016)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -55,6 +55,7 @@ class DIALOG_SET_GRID_BASE : public DIALOG_SHIM
wxComboBox* m_comboBoxGrid1;
wxStaticText* m_staticTextGrid2;
wxComboBox* m_comboBoxGrid2;
wxRadioBox* m_Style;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;