minor bug fixed and minor enhancements

This commit is contained in:
charras 2009-12-08 13:41:20 +00:00
parent 47409788f0
commit cad5f9da24
13 changed files with 1518 additions and 1274 deletions

View File

@ -144,11 +144,11 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar()
}
int jj = 1;
int parts_count = 1;
if( component )
jj = MAX( component->GetPartCount(), 1 );
parts_count = MAX( component->GetPartCount(), 1 );
SelpartBox->Clear();
for( ii = 0; ii < jj; ii++ )
for( ii = 0; ii < parts_count; ii++ )
{
wxString msg;
msg.Printf( _( "Part %c" ), 'A' + ii );
@ -156,7 +156,7 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar()
}
SelpartBox->SetSelection( (m_unit > 0 ) ? m_unit - 1 : 0 );
SelpartBox->Enable( component && component->HasConversion() );
SelpartBox->Enable( parts_count > 1 );
m_HToolBar->EnableTool( ID_LIBVIEW_VIEWDOC,
entry && ( entry->m_DocFile != wxEmptyString ) );

View File

@ -98,7 +98,7 @@ bool WinEDA_ViewlibFrame::OnRightClick( const wxPoint& MousePos,
}
/* Affiche en Ligne d'info la librairie en cours de visualisation */
/* Displays the name of the current opened library in the caption */
void WinEDA_ViewlibFrame::DisplayLibInfos()
{
wxString msg;
@ -120,7 +120,7 @@ void WinEDA_ViewlibFrame::DisplayLibInfos()
/*****************************************/
/* Routine to Select Current library */
/* Function to Select Current library */
/*****************************************/
void WinEDA_ViewlibFrame::SelectCurrentLibrary()
{
@ -246,10 +246,10 @@ void WinEDA_ViewlibFrame::ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag )
}
/*****************************************************************************/
/* Routine d'affichage du composant selectionne */
/* Si Le composant est un alias, le composant ROOT est recherche et affiche */
/*****************************************************************************/
/** function RedrawActiveWindow
* Display the current selected component.
* If the component is an alias, the ROOT component is displayed
*/
void WinEDA_ViewlibFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
{
LIB_COMPONENT* component;

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,7 @@ DIALOG_MODULE_BOARD_EDITOR_BASE::DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* pare
sbSizerOrientation->Add( m_staticText4, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OrientValue = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerOrientation->Add( m_OrientValue, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbSizerOrientation->Add( m_OrientValue, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
PropLeftSizer->Add( sbSizerOrientation, 0, wxEXPAND, 5 );
@ -271,7 +271,7 @@ DIALOG_MODULE_BOARD_EDITOR_BASE::DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* pare
m_sdbSizerStdButtonsCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizerStdButtons->AddButton( m_sdbSizerStdButtonsCancel );
m_sdbSizerStdButtons->Realize();
m_GeneralBoxSizer->Add( m_sdbSizerStdButtons, 0, wxEXPAND|wxALIGN_RIGHT, 5 );
m_GeneralBoxSizer->Add( m_sdbSizerStdButtons, 0, wxEXPAND|wxALIGN_RIGHT|wxALL, 5 );
this->SetSizer( m_GeneralBoxSizer );
this->Layout();

View File

@ -603,7 +603,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
@ -2605,7 +2605,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALIGN_RIGHT</property>
<property name="flag">wxEXPAND|wxALIGN_RIGHT|wxALL</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>

View File

@ -240,7 +240,7 @@ DIALOG_MODULE_MODULE_EDITOR_BASE::DIALOG_MODULE_MODULE_EDITOR_BASE( wxWindow* pa
m_sdbSizerStdButtonsCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizerStdButtons->AddButton( m_sdbSizerStdButtonsCancel );
m_sdbSizerStdButtons->Realize();
m_GeneralBoxSizer->Add( m_sdbSizerStdButtons, 0, wxEXPAND|wxALIGN_RIGHT, 5 );
m_GeneralBoxSizer->Add( m_sdbSizerStdButtons, 0, wxEXPAND|wxALIGN_RIGHT|wxALL, 5 );
this->SetSizer( m_GeneralBoxSizer );
this->Layout();

View File

@ -2195,7 +2195,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALIGN_RIGHT</property>
<property name="flag">wxEXPAND|wxALIGN_RIGHT|wxALL</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>

View File

@ -42,11 +42,20 @@ void DIALOG_PADS_MASK_CLEARANCE::MyInit()
PutValueInLocalUnits( *m_SolderMaskMarginCtrl,
g_DesignSettings.m_SolderMaskMargin,
Internal_Unit );
// These 2 parameters are usually < 0, so prepare entering a negative
// value, if current is 0
PutValueInLocalUnits( *m_SolderPasteMarginCtrl,
g_DesignSettings.m_SolderPasteMargin,
Internal_Unit );
if( g_DesignSettings.m_SolderPasteMargin == 0 )
m_SolderPasteMarginCtrl->SetValue( wxT( "-" ) +
m_SolderPasteMarginCtrl->GetValue() );
wxString msg;
msg.Printf( wxT( "%f" ), g_DesignSettings.m_SolderPasteMarginRatio * 100.0 );
if( g_DesignSettings.m_SolderPasteMarginRatio == 0 )
msg.Printf( wxT( "-%f" ), g_DesignSettings.m_SolderPasteMarginRatio * 100.0 );
else
msg.Printf( wxT( "%f" ), g_DesignSettings.m_SolderPasteMarginRatio * 100.0 );
m_SolderPasteMarginRatioCtrl->SetValue( msg );
}

View File

@ -84,13 +84,16 @@ DIALOG_PADS_MASK_CLEARANCE_BASE::DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* pare
bMainSizer->Add( bMainUpperSizer, 1, wxEXPAND, 5 );
m_staticline11 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline11, 0, wxEXPAND | wxALL, 5 );
m_sdbButtonsSizer = new wxStdDialogButtonSizer();
m_sdbButtonsSizerOK = new wxButton( this, wxID_OK );
m_sdbButtonsSizer->AddButton( m_sdbButtonsSizerOK );
m_sdbButtonsSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbButtonsSizer->AddButton( m_sdbButtonsSizerCancel );
m_sdbButtonsSizer->Realize();
bMainSizer->Add( m_sdbButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
bMainSizer->Add( m_sdbButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 );
this->SetSizer( bMainSizer );
this->Layout();

View File

@ -32,7 +32,7 @@
<property name="minimum_size"></property>
<property name="name">DIALOG_PADS_MASK_CLEARANCE_BASE</property>
<property name="pos"></property>
<property name="size">358,237</property>
<property name="size">361,253</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property>
<property name="title">Pads Mask Clearance</property>
@ -691,7 +691,56 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_staticline11</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxLI_HORIZONTAL</property>
<property name="subclass"></property>
<property name="tooltip"></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="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 class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property>

View File

@ -50,6 +50,7 @@ class DIALOG_PADS_MASK_CLEARANCE_BASE : public wxDialog
wxStaticText* m_staticTextRatio;
wxTextCtrl* m_SolderPasteMarginRatioCtrl;
wxStaticText* m_SolderPasteRatioMarginUnits;
wxStaticLine* m_staticline11;
wxStdDialogButtonSizer* m_sdbButtonsSizer;
wxButton* m_sdbButtonsSizerOK;
wxButton* m_sdbButtonsSizerCancel;
@ -60,7 +61,7 @@ class DIALOG_PADS_MASK_CLEARANCE_BASE : public wxDialog
public:
DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pads Mask Clearance"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 358,237 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pads Mask Clearance"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 361,253 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PADS_MASK_CLEARANCE_BASE();
};

View File

@ -35,9 +35,9 @@
/* local variables */
/* Hotkey list: */
static Ki_HotkeyInfo HkSwitch2CopperLayer( wxT( "Switch to Copper layer" ),
HK_SWITCH_LAYER_TO_COPPER, WXK_PAGEUP );
HK_SWITCH_LAYER_TO_COPPER, WXK_PAGEDOWN );
static Ki_HotkeyInfo HkSwitch2ComponentLayer( wxT( "Switch to Component layer" ),
HK_SWITCH_LAYER_TO_COMPONENT, WXK_PAGEDOWN );
HK_SWITCH_LAYER_TO_COMPONENT, WXK_PAGEUP );
static Ki_HotkeyInfo HkSwitch2InnerLayer1( wxT( "Switch to Inner layer 1" ),
HK_SWITCH_LAYER_TO_INNER1, WXK_F5 );
static Ki_HotkeyInfo HkSwitch2InnerLayer2( wxT( "Switch to Inner layer 2" ),
@ -112,7 +112,7 @@ Ki_HotkeyInfo* s_board_edit_Hotkey_List[] =
{
&HkTrackDisplayMode, &HkDelete,
&HkBackspace,
&HkAddNewTrack, &HkAddVia, &HkAddMicroVia,
&HkAddNewTrack, &HkAddVia, &HkAddMicroVia,
&HkEndTrack, &HkMoveFootprint,
&HkFlipFootprint, &HkRotateFootprint, &HkDragFootprint,
&HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile,
@ -128,55 +128,40 @@ Ki_HotkeyInfo* s_board_edit_Hotkey_List[] =
Ki_HotkeyInfo* s_module_edit_Hotkey_List[] = { NULL };
// list of sections and corresponding hotkey list for pcbnew (used to create an hotkey config file)
struct Ki_HotkeyInfoSectionDescriptor s_Pcbnew_Editor_Hokeys_Descr[] = { {
&g_CommonSectionTag,
s_Common_Hotkey_List,
"Common keys"
},
{
&
g_BoardEditorSectionTag,
s_board_edit_Hotkey_List,
"Board editor keys"
}, {
&
g_ModuleEditSectionTag,
s_module_edit_Hotkey_List,
"Footprint editor keys"
}, {
NULL,
NULL, NULL
} };
struct Ki_HotkeyInfoSectionDescriptor s_Pcbnew_Editor_Hokeys_Descr[] =
{ {
&g_CommonSectionTag, s_Common_Hotkey_List, "Common keys"
},
{
&g_BoardEditorSectionTag, s_board_edit_Hotkey_List, "Board editor keys"
},{
&g_ModuleEditSectionTag, s_module_edit_Hotkey_List, "Footprint editor keys"
},{
NULL, NULL, NULL
} };
// list of sections and corresponding hotkey list for the board editor (used to list current hotkeys)
struct Ki_HotkeyInfoSectionDescriptor s_Board_Editor_Hokeys_Descr[] = { {
&g_CommonSectionTag,
s_Common_Hotkey_List,
NULL
}, {
&
g_BoardEditorSectionTag,
s_board_edit_Hotkey_List,
NULL
}, {
NULL,
NULL, NULL
} };
struct Ki_HotkeyInfoSectionDescriptor s_Board_Editor_Hokeys_Descr[] =
{ {
&g_CommonSectionTag,
s_Common_Hotkey_List,
NULL
},{
&g_BoardEditorSectionTag, s_board_edit_Hotkey_List, NULL
},{
NULL, NULL, NULL
} };
// list of sections and corresponding hotkey list for the footprint editor (used to list current hotkeys)
struct Ki_HotkeyInfoSectionDescriptor s_Module_Editor_Hokeys_Descr[] = { {
&g_CommonSectionTag,
s_Common_Hotkey_List,
NULL
}, {
&
g_ModuleEditSectionTag,
s_module_edit_Hotkey_List,
NULL
}, {
NULL,
NULL, NULL
} };
struct Ki_HotkeyInfoSectionDescriptor
s_Module_Editor_Hokeys_Descr[] =
{ {
&g_CommonSectionTag, s_Common_Hotkey_List, NULL
},{
&g_ModuleEditSectionTag, s_module_edit_Hotkey_List, NULL
},{
NULL, NULL, NULL
} };
/***********************************************************/
void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct )
@ -475,22 +460,23 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
if( m_ID_current_state != ID_TRACK_BUTT )
break;
if( ItemFree ) // no track in progress:
{
TRACK* track = Begin_Route( NULL, DC );
SetCurItem( track );
if( track )
DrawPanel->m_AutoPAN_Request = true;
}
else if( GetCurItem()->m_Flags & IS_NEW )
{
TRACK* track = Begin_Route( (TRACK*) GetCurItem(), DC );
// SetCurItem() must not write to the msg panel
// because a track info is displayed while moving the mouse cursor
if( track ) // A new segment was created
SetCurItem( track, false );
if( ItemFree ) // no track in progress:
{
TRACK* track = Begin_Route( NULL, DC );
SetCurItem( track );
if( track )
DrawPanel->m_AutoPAN_Request = true;
}
}
else if( GetCurItem()->m_Flags & IS_NEW )
{
TRACK* track = Begin_Route( (TRACK*) GetCurItem(), DC );
// SetCurItem() must not write to the msg panel
// because a track info is displayed while moving the mouse cursor
if( track ) // A new segment was created
SetCurItem( track, false );
DrawPanel->m_AutoPAN_Request = true;
}
break;
// Footprint edition:
@ -605,13 +591,13 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
switch( HK_Descr->m_Idcommand )
{
case HK_ROTATE_FOOTPRINT: // Rotation
case HK_ROTATE_FOOTPRINT: // Rotation
if( module->m_Flags == 0 ) // not currently in edit, prepare undo command
SaveCopyInUndoList( module, UR_ROTATED, module->m_Pos );
Rotate_Module( DC, module, 900, TRUE );
break;
case HK_FLIP_FOOTPRINT: // move to other side
case HK_FLIP_FOOTPRINT: // move to other side
if( module->m_Flags == 0 ) // not currently in edit, prepare undo command
SaveCopyInUndoList( module, UR_FLIPPED, module->m_Pos );
Change_Side_Module( module, DC );