1
#include "configmanager.h"
2
#include "dragscrollcfg.h"
4
BEGIN_EVENT_TABLE(cbDragScrollCfg,cbConfigurationPanel)
5
// //(*EventTable(cbDragScrollCfg)
6
// EVT_BUTTON(ID_DONEBUTTON,cbDragScrollCfg::OnDoneButtonClick)
10
// ----------------------------------------------------------------------------
11
cbDragScrollCfg::cbDragScrollCfg(wxWindow* parent, cbDragScroll* pOwner, wxWindowID /*id*/)
12
// ----------------------------------------------------------------------------
15
cbConfigurationPanel::Create(parent, -1, wxDefaultPosition, wxDefaultSize,
16
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
19
bSizer1 = new wxBoxSizer( wxVERTICAL );
22
bSizer2 = new wxBoxSizer( wxVERTICAL );
24
bSizer2->SetMinSize(wxSize( -1,50 ));
25
StaticText1 = new wxStaticText( this, wxID_ANY, _("Mouse Drag Scrolling Configuration"), wxDefaultPosition, wxDefaultSize, 0 );
26
bSizer2->Add( StaticText1, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
28
bSizer2->Add( 0, 0, 1, wxEXPAND, 0 );
30
bSizer1->Add( bSizer2, 0, wxEXPAND, 5 );
33
bSizer5 = new wxBoxSizer( wxHORIZONTAL );
35
ScrollEnabled = new wxCheckBox( this, wxID_ANY, _("Scrolling Enabled"), wxDefaultPosition, wxDefaultSize, 0 );
37
bSizer5->Add( ScrollEnabled, 0, wxALL, 5 );
39
bSizer1->Add( bSizer5, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
42
bSizer6 = new wxBoxSizer( wxHORIZONTAL );
44
EditorFocusEnabled = new wxCheckBox( this, wxID_ANY, _("Auto Focus Editors"), wxDefaultPosition, wxDefaultSize, 0 );
46
bSizer6->Add( EditorFocusEnabled, 0, wxALL, 5 );
48
MouseFocusEnabled = new wxCheckBox( this, wxID_ANY, _("Focus follows Mouse"), wxDefaultPosition, wxDefaultSize, 0 );
50
bSizer6->Add( MouseFocusEnabled, 0, wxALL, 5 );
52
bSizer1->Add( bSizer6, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
54
wxBoxSizer* MouseWheelSizer1;
55
MouseWheelSizer1 = new wxBoxSizer( wxHORIZONTAL );
56
MouseWheelZoom = new wxCheckBox( this, wxID_ANY, _("Log MouseWheelZoom"), wxDefaultPosition, wxDefaultSize, 0 );
57
MouseWheelSizer1->Add( MouseWheelZoom, 0, wxALL, 5 );
58
PropagateLogZoomSize = new wxCheckBox( this, wxID_ANY, _("Propagate Log Zooms"), wxDefaultPosition, wxDefaultSize, 0 );
59
MouseWheelSizer1->Add( PropagateLogZoomSize, 0, wxALL, 5 );
60
bSizer1->Add( MouseWheelSizer1, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
63
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
65
wxString ScrollDirectionChoices[] = { _("With Mouse"), _("Opposite Mouse") };
66
int ScrollDirectionNChoices = sizeof( ScrollDirectionChoices ) / sizeof( wxString );
67
ScrollDirection = new wxRadioBox( this, wxID_ANY, _("Scroll Direction"), wxDefaultPosition, wxDefaultSize, ScrollDirectionNChoices, ScrollDirectionChoices, 2, wxRA_SPECIFY_COLS );
68
bSizer3->Add( ScrollDirection, 0, wxALL, 5 );
70
bSizer1->Add( bSizer3, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
73
bSizer4 = new wxBoxSizer( wxHORIZONTAL );
75
StaticText2 = new wxStaticText( this, wxID_ANY, _("Mouse Key To Use:"), wxDefaultPosition, wxDefaultSize, 0 );
76
bSizer4->Add( StaticText2, 0, wxALL, 5 );
78
wxString MouseKeyChoiceChoices[] = { _("Right"), _("Middle") };
79
int MouseKeyChoiceNChoices = sizeof( MouseKeyChoiceChoices ) / sizeof( wxString );
80
MouseKeyChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, MouseKeyChoiceNChoices, MouseKeyChoiceChoices, 0 );
81
bSizer4->Add( MouseKeyChoice, 0, wxALL, 5 );
83
bSizer1->Add( bSizer4, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
86
bSizer7 = new wxBoxSizer( wxVERTICAL );
88
bSizer7->SetMinSize(wxSize( 300,-1 ));
89
bSizer7->Add( 0, 0, 1, wxEXPAND, 0 );
91
StaticText3 = new wxStaticText( this, wxID_ANY, _("-- Adaptive Mouse Speed Sensitivity --"), wxDefaultPosition, wxDefaultSize, 0 );
92
bSizer7->Add( StaticText3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
94
Sensitivity = new wxSlider( this, wxID_ANY, 8, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS|wxSL_TOP );
95
#if wxCHECK_VERSION(2,9,0)
96
if ( 1 ) Sensitivity->SetTickFreq(1);
98
if ( 1 ) Sensitivity->SetTickFreq(1,0);
100
if ( 1 ) Sensitivity->SetPageSize(1);
101
if ( 0 ) Sensitivity->SetLineSize(0);
102
if ( 0 ) Sensitivity->SetThumbLength(0);
103
if ( 1 ) Sensitivity->SetTick(1);
104
if ( 1 ) Sensitivity->SetSelection(1,10);
105
bSizer7->Add( Sensitivity, 0, wxALL|wxEXPAND, 5 );
107
bSizer7->Add( 0, 0, 1, wxEXPAND, 0 );
109
StaticText4 = new wxStaticText( this, wxID_ANY, _("-- Mouse Movement to Text Scroll Ratio --"), wxDefaultPosition, wxDefaultSize, 0 );
110
bSizer7->Add( StaticText4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
112
MouseToLineRatio = new wxSlider( this, wxID_ANY, 30, 10, 100, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS|wxSL_TOP );
113
#if wxCHECK_VERSION(2,9,0)
114
if ( 1 ) MouseToLineRatio->SetTickFreq(10);
116
if ( 1 ) MouseToLineRatio->SetTickFreq(10,10);
118
if ( 1 ) MouseToLineRatio->SetPageSize(10);
119
if ( 0 ) MouseToLineRatio->SetLineSize(0);
120
if ( 0 ) MouseToLineRatio->SetThumbLength(0);
121
if ( 1 ) MouseToLineRatio->SetTick(10);
122
if ( 1 ) MouseToLineRatio->SetSelection(10,100);
123
bSizer7->Add( MouseToLineRatio, 0, wxALL|wxEXPAND, 5 );
125
bSizer7->Add( 0, 0, 1, wxEXPAND, 0 );
127
StaticText5 = new wxStaticText( this, wxID_ANY, _("-- Unix Context Menu Watch for Drag (millisecs) --"), wxDefaultPosition, wxDefaultSize, 0 );
128
bSizer7->Add( StaticText5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
130
MouseContextDelay = new wxSlider( this, wxID_ANY, 50, 10, 500, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS|wxSL_TOP );
131
// Above values are: default mil delay, min, max
132
#if wxCHECK_VERSION(2,9,0)
133
if ( 1 ) MouseContextDelay->SetTickFreq(10);
135
if ( 1 ) MouseContextDelay->SetTickFreq(10,10);
137
if ( 1 ) MouseContextDelay->SetPageSize(10);
138
if ( 1 ) MouseContextDelay->SetLineSize(10);
139
if ( 1 ) MouseContextDelay->SetThumbLength(10);
140
if ( 1 ) MouseContextDelay->SetTick(100);
141
if ( 1 ) MouseContextDelay->SetSelection(10,500);
142
bSizer7->Add( MouseContextDelay, 0, wxALL|wxEXPAND, 5 );
144
bSizer7->Add( 0, 0, 1, wxEXPAND, 0 );
146
bSizer1->Add( bSizer7, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
148
this->SetSizer( bSizer1 );
152
// ----------------------------------------------------------------------------
153
void cbDragScrollCfg::OnApply()
154
// ----------------------------------------------------------------------------
156
pOwnerClass->OnDialogDone(this);
158
// ----------------------------------------------------------------------------
159
cbDragScrollCfg::~cbDragScrollCfg()
160
// ----------------------------------------------------------------------------
163
// ----------------------------------------------------------------------------
164
void cbDragScrollCfg::OnDoneButtonClick(wxCommandEvent& /*event*/)
165
// ----------------------------------------------------------------------------
169
LOGIT( _T("cbDragScrollCfg::OnDoneButtonClick erroniously called") );
172
// ----------------------------------------------------------------------------
173
wxString cbDragScrollCfg::GetBitmapBaseName() const
176
//LOGIT( _T("Config:%s"),ConfigManager::GetConfigFolder().GetData() );
177
//LOGIT( _T("Plugins:%s"),ConfigManager::GetPluginsFolder().GetData() );
178
//LOGIT( _T("Data:%s"),ConfigManager::GetDataFolder().GetData() );
179
//LOGIT( _T("Executable:%s"),ConfigManager::GetExecutableFolder().GetData() );
181
wxString pngName = _T("generic-plugin");
182
//if file exist "./share/codeblocks/images/settings/cbdragscroll.png";
184
if ( ::wxFileExists(ConfigManager::GetDataFolder() + _T("/images/settings/dragscroll.png")) )
186
if ( ::wxFileExists(ConfigManager::GetDataFolder() + _T("\\images\\settings\\dragscroll.png")) )
188
pngName = _T("dragscroll") ;
189
// else return "generic-plugin"
192
// ----------------------------------------------------------------------------