Skip to content

Commit

Permalink
Fix setting code navigation meta-key choices
Browse files Browse the repository at this point in the history
The previous code accidentally prevented the Alt key from staying set.
Note that the shift key is no longer allowed to be used for this purpose, but Opt_NavKey_Shift is still used to unset any old setting.
  • Loading branch information
dghart committed Dec 3, 2015
1 parent 83fa1cd commit bdc1cea
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 88 deletions.
6 changes: 3 additions & 3 deletions LiteEditor/editor_options_comments_base.wxcp
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@
}, {
"type": "string",
"m_label": "Label:",
"m_value": "Hitting <ENTER> in a C++ style comment section automatically adds a'//' to the next line"
"m_value": "Hitting <ENTER> in a C++ style comment section automatically adds a '//' to the next line"
}, {
"type": "bool",
"m_label": "Value:",
Expand Down Expand Up @@ -799,7 +799,7 @@
}, {
"type": "multi-string",
"m_label": "Tooltip:",
"m_value": "When using quick code navigation use this keys in combination with mouse click\\nTo quickly go to implementation / declaration"
"m_value": "When using quick code navigation use this keys in combination with mouse click\\nTo quickly go to implementation/declaration.\\nNote that at least one box must be ticked, or it would be triggered by every left-click."
}, {
"type": "colour",
"m_label": "Bg Colour:",
Expand Down Expand Up @@ -993,7 +993,7 @@
}, {
"type": "bool",
"m_label": "Value:",
"m_value": false
"m_value": true
}],
"m_events": [],
"m_children": []
Expand Down
94 changes: 47 additions & 47 deletions LiteEditor/editor_options_comments_base_liteeditor_bitmaps.cpp
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
//
// This file was automatically generated by wxrc, do not edit by hand.
//

#include <wx/wxprec.h>

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#include <wx/filesys.h>
#include <wx/fs_mem.h>
#include <wx/xrc/xmlres.h>
#include <wx/xrc/xh_all.h>

#if wxCHECK_VERSION(2,8,5) && wxABI_VERSION >= 20805
#define XRC_ADD_FILE(name, data, size, mime) \
wxMemoryFSHandler::AddFileWithMimeType(name, data, size, mime)
#else
#define XRC_ADD_FILE(name, data, size, mime) \
wxMemoryFSHandler::AddFile(name, data, size)
#endif

static size_t xml_res_size_0 = 90;
static unsigned char xml_res_file_0[] = {
60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101,
110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,63,62,10,60,114,101,
115,111,117,114,99,101,32,120,109,108,110,115,61,34,104,116,116,112,58,
47,47,119,119,119,46,119,120,119,105,110,100,111,119,115,46,111,114,103,
47,119,120,120,114,99,34,47,62,10};

void wxCD0F0InitBitmapResources()
{

// Check for memory FS. If not present, load the handler:
{
wxMemoryFSHandler::AddFile(wxT("XRC_resource/dummy_file"), wxT("dummy one"));
wxFileSystem fsys;
wxFSFile *f = fsys.OpenFile(wxT("memory:XRC_resource/dummy_file"));
wxMemoryFSHandler::RemoveFile(wxT("XRC_resource/dummy_file"));
if (f) delete f;
else wxFileSystem::AddHandler(new wxMemoryFSHandlerBase);
}

XRC_ADD_FILE(wxT("XRC_resource/editor_options_comments_base_liteeditor_bitmaps.cpp$C__src_codelite_LiteEditor_editor_options_comments_base_liteeditor_bitmaps.xrc"), xml_res_file_0, xml_res_size_0, wxT("text/xml"));
wxXmlResource::Get()->Load(wxT("memory:XRC_resource/editor_options_comments_base_liteeditor_bitmaps.cpp$C__src_codelite_LiteEditor_editor_options_comments_base_liteeditor_bitmaps.xrc"));
}
//
// This file was automatically generated by wxrc, do not edit by hand.
//

#include <wx/wxprec.h>

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#include <wx/filesys.h>
#include <wx/fs_mem.h>
#include <wx/xrc/xmlres.h>
#include <wx/xrc/xh_all.h>

#if wxCHECK_VERSION(2,8,5) && wxABI_VERSION >= 20805
#define XRC_ADD_FILE(name, data, size, mime) \
wxMemoryFSHandler::AddFileWithMimeType(name, data, size, mime)
#else
#define XRC_ADD_FILE(name, data, size, mime) \
wxMemoryFSHandler::AddFile(name, data, size)
#endif

static size_t xml_res_size_0 = 90;
static unsigned char xml_res_file_0[] = {
60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101,
110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,63,62,10,60,114,101,
115,111,117,114,99,101,32,120,109,108,110,115,61,34,104,116,116,112,58,
47,47,119,119,119,46,119,120,119,105,100,103,101,116,115,46,111,114,103,
47,119,120,120,114,99,34,47,62,10};

void wxCD0F0InitBitmapResources()
{

// Check for memory FS. If not present, load the handler:
{
wxMemoryFSHandler::AddFile(wxT("XRC_resource/dummy_file"), wxT("dummy one"));
wxFileSystem fsys;
wxFSFile *f = fsys.OpenFile(wxT("memory:XRC_resource/dummy_file"));
wxMemoryFSHandler::RemoveFile(wxT("XRC_resource/dummy_file"));
if (f) delete f;
else wxFileSystem::AddHandler(new wxMemoryFSHandlerBase);
}

XRC_ADD_FILE(wxT("XRC_resource/editor_options_comments_base_liteeditor_bitmaps.cpp$_mnt_SanDisk128-common_david_devel_git_CL_LiteEditor_editor_options_comments_base_liteeditor_bitmaps.xrc"), xml_res_file_0, xml_res_size_0, wxT("text/xml"));
wxXmlResource::Get()->Load(wxT("memory:XRC_resource/editor_options_comments_base_liteeditor_bitmaps.cpp$_mnt_SanDisk128-common_david_devel_git_CL_LiteEditor_editor_options_comments_base_liteeditor_bitmaps.xrc"));
}
9 changes: 4 additions & 5 deletions LiteEditor/editorsettingscomments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ EditorSettingsComments::EditorSettingsComments( wxWindow* parent )

size_t flags = EditorConfigST::Get()->GetOptions()->GetOptions();

if ( !(flags & (OptionsConfig::Opt_NavKey_Alt|OptionsConfig::Opt_NavKey_Control|OptionsConfig::Opt_NavKey_Shift)) ) {
flags = OptionsConfig::Opt_NavKey_Shift; // force at least one meta key
if ( !(flags & (OptionsConfig::Opt_NavKey_Alt|OptionsConfig::Opt_NavKey_Control)) ) {
flags = OptionsConfig::Opt_NavKey_Alt|OptionsConfig::Opt_NavKey_Control; // force the least-instrusive meta key default
}

m_checkBoxAlt->SetValue( flags & OptionsConfig::Opt_NavKey_Alt );
m_checkBoxCtrl->SetValue( flags & OptionsConfig::Opt_NavKey_Control );
m_checkBoxAlt->SetValue( flags & OptionsConfig::Opt_NavKey_Shift );
}

void EditorSettingsComments::Save(OptionsConfigPtr options)
Expand All @@ -72,8 +71,8 @@ void EditorSettingsComments::Save(OptionsConfigPtr options)
if( m_checkBoxAlt->IsChecked() )
flags |= OptionsConfig::Opt_NavKey_Alt;

if ( !(flags & (OptionsConfig::Opt_NavKey_Alt|OptionsConfig::Opt_NavKey_Control|OptionsConfig::Opt_NavKey_Shift)) ) {
flags |= OptionsConfig::Opt_NavKey_Shift; // force at least one meta key
if ( !(flags & (OptionsConfig::Opt_NavKey_Alt|OptionsConfig::Opt_NavKey_Control)) ) {
flags |= OptionsConfig::Opt_NavKey_Alt|OptionsConfig::Opt_NavKey_Control; // force the least-instrusive meta key default
}

options->SetOptions(flags);
Expand Down
9 changes: 4 additions & 5 deletions LiteEditor/editorsettingscommentsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ EditorSettingsCommentsBase::EditorSettingsCommentsBase(wxWindow* parent, wxWindo

boxSizer4->Add(m_checkBoxContCComment, 0, wxALL, 5);

m_checkBoxContinueCppComment = new wxCheckBox(this, wxID_ANY, _("Hitting <ENTER> in a C++ style comment section automatically adds a'//' to the next line"), wxDefaultPosition, wxSize(-1, -1), 0);
m_checkBoxContinueCppComment = new wxCheckBox(this, wxID_ANY, _("Hitting <ENTER> in a C++ style comment section automatically adds a '//' to the next line"), wxDefaultPosition, wxSize(-1, -1), 0);
m_checkBoxContinueCppComment->SetValue(false);

boxSizer4->Add(m_checkBoxContinueCppComment, 0, wxALL, 5);
Expand All @@ -80,7 +80,7 @@ EditorSettingsCommentsBase::EditorSettingsCommentsBase(wxWindow* parent, wxWindo
bSizer2->Add(bSizer3, 0, wxALL|wxALIGN_LEFT, 5);

m_staticText1 = new wxStaticText(this, wxID_ANY, _("Code navigation key:"), wxDefaultPosition, wxSize(-1, -1), 0);
m_staticText1->SetToolTip(_("When using quick code navigation use this keys in combination with mouse click\nTo quickly go to implementation / declaration"));
m_staticText1->SetToolTip(_("When using quick code navigation use this keys in combination with mouse click\nTo quickly go to implementation/declaration.\nNote that at least one box must be ticked, or it would be triggered by every left-click."));

bSizer3->Add(m_staticText1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);

Expand All @@ -89,7 +89,7 @@ EditorSettingsCommentsBase::EditorSettingsCommentsBase(wxWindow* parent, wxWindo
bSizer3->Add(m_staticText2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);

m_checkBoxCtrl = new wxCheckBox(this, wxID_ANY, _("Ctrl"), wxDefaultPosition, wxSize(-1, -1), 0);
m_checkBoxCtrl->SetValue(false);
m_checkBoxCtrl->SetValue(true);

bSizer3->Add(m_checkBoxCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);

Expand All @@ -100,10 +100,9 @@ EditorSettingsCommentsBase::EditorSettingsCommentsBase(wxWindow* parent, wxWindo

SetName(wxT("EditorSettingsCommentsBase"));
SetSizeHints(-1,-1);
if ( GetSizer() ) {
if (GetSizer()) {
GetSizer()->Fit(this);
}
CentreOnParent(wxBOTH);
}

EditorSettingsCommentsBase::~EditorSettingsCommentsBase()
Expand Down
29 changes: 2 additions & 27 deletions LiteEditor/editorsettingscommentsbase.h
Original file line number Diff line number Diff line change
@@ -1,36 +1,11 @@
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// Copyright : (C) 2015 The CodeLite Team
// File name : editorsettingscommentsbase.h
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////
// This file was auto-generated by codelite's wxCrafter Plugin
// wxCrafter project file: editor_options_comments_base.wxcp
// Do not modify this file by hand!
//////////////////////////////////////////////////////////////////////

#ifndef CODELITE_LITEEDITOR_EDITOR_OPTIONS_COMMENTS_BASE_BASE_CLASSES_H
#define CODELITE_LITEEDITOR_EDITOR_OPTIONS_COMMENTS_BASE_BASE_CLASSES_H
#ifndef CL_LITEEDITOR_EDITOR_OPTIONS_COMMENTS_BASE_BASE_CLASSES_H
#define CL_LITEEDITOR_EDITOR_OPTIONS_COMMENTS_BASE_BASE_CLASSES_H

#include <wx/settings.h>
#include <wx/xrc/xmlres.h>
Expand Down
2 changes: 1 addition & 1 deletion Plugin/optionsconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class WXDLLIMPEXP_SDK OptionsConfig : public ConfObject
Opt_IconSet_FreshFarm = 0x00000040,
Opt_IconSet_Classic = 0x00000100,
Opt_AutoCompleteDoubleQuotes = 0x00000200,
Opt_NavKey_Shift = 0x00000400,
Opt_NavKey_Shift = 0x00000400, // (No longer actively used)
Opt_NavKey_Alt = 0x00000800,
Opt_NavKey_Control = 0x00001000,
Opt_IconSet_Classic_Dark = 0x00002000,
Expand Down

0 comments on commit bdc1cea

Please sign in to comment.