summaryrefslogtreecommitdiff
path: root/basctl/source/basicide
diff options
context:
space:
mode:
Diffstat (limited to 'basctl/source/basicide')
-rw-r--r--basctl/source/basicide/baside2.cxx13
-rw-r--r--basctl/source/basicide/codecompleteoptionsdlg.cxx74
-rw-r--r--basctl/source/basicide/codecompleteoptionsdlg.hxx54
3 files changed, 132 insertions, 9 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 1fff14a428c5..bc24c579ae52 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -54,6 +54,7 @@
#include <cassert>
#include <basic/codecompletecache.hxx>
#include <svtools/miscopt.hxx>
+#include "codecompleteoptionsdlg.hxx"
namespace basctl
{
@@ -1013,8 +1014,8 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
break;
case SID_BASICIDE_CODECOMPLETITION:
{
- SFX_REQUEST_ARG(rReq, pItem, SfxBoolItem, rReq.GetSlot(), false);
- CodeCompleteOptions::SetCodeCompleteOn( pItem && pItem->GetValue() );
+ boost::scoped_ptr< CodeCompleteOptionsDlg > pDlg( new CodeCompleteOptionsDlg( this ) );
+ pDlg->Execute();
}
break;
case SID_CUT:
@@ -1166,15 +1167,9 @@ void ModulWindow::GetState( SfxItemSet &rSet )
case SID_BASICIDE_CODECOMPLETITION:
{
SvtMiscOptions aMiscOptions;
- if( aMiscOptions.IsExperimentalMode() )
- {
- rSet.Put(SfxBoolItem( nWh, CodeCompleteOptions::IsCodeCompleteOn() ));
- std::cerr <<"code complete set to: " << CodeCompleteOptions::IsCodeCompleteOn() << std::endl;
- }
- else
+ if( !aMiscOptions.IsExperimentalMode() )
{
rSet.Put( SfxVisibilityItem(nWh, false) );
- //CodeCompleteOptions::SetCodeCompleteOn( false );
}
}
break;
diff --git a/basctl/source/basicide/codecompleteoptionsdlg.cxx b/basctl/source/basicide/codecompleteoptionsdlg.cxx
new file mode 100644
index 000000000000..a948ab60e142
--- /dev/null
+++ b/basctl/source/basicide/codecompleteoptionsdlg.cxx
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "codecompleteoptionsdlg.hxx"
+#include <basic/codecompletecache.hxx>
+#include <svtools/miscopt.hxx>
+#include <basidesh.hrc>
+#include <iostream>
+
+namespace basctl
+{
+
+CodeCompleteOptionsDlg::CodeCompleteOptionsDlg( Window* pWindow )
+: ModalDialog(pWindow, "CodeCompleteOptionsDialog", "modules/BasicIDE/ui/codecompleteoptionsdlg.ui")
+{
+ get(pCancelBtn, "cancel");
+ get(pOkBtn, "ok");
+
+ get(pCodeCompleteChk, "codecomplete_enable");
+ get(pAutocloseProcChk, "autoclose_proc");
+ get(pAutocloseBracesChk, "autoclose_braces");
+ get(pAutocloseQuotesChk, "autoclose_quotes");
+
+ pOkBtn->SetClickHdl( LINK( this, CodeCompleteOptionsDlg, OkHdl ) );
+ pCancelBtn->SetClickHdl( LINK( this, CodeCompleteOptionsDlg, CancelHdl ) );
+
+ pCodeCompleteChk->Check(CodeCompleteOptions::IsCodeCompleteOn()); //set it on, if needed
+
+ pAutocloseProcChk->Enable( false );
+ pAutocloseBracesChk->Enable( false );
+ pAutocloseQuotesChk->Enable( false );
+}
+
+CodeCompleteOptionsDlg::~CodeCompleteOptionsDlg()
+{
+}
+
+IMPL_LINK_NOARG(CodeCompleteOptionsDlg, OkHdl)
+{
+ CodeCompleteOptions::SetCodeCompleteOn( pCodeCompleteChk->IsChecked() );
+ Close();
+ return 0;
+}
+
+IMPL_LINK_NOARG(CodeCompleteOptionsDlg, CancelHdl)
+{
+ Close();
+ return 0;
+}
+
+short CodeCompleteOptionsDlg::Execute()
+{
+ return ModalDialog::Execute();
+}
+
+} // namespace basctl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/codecompleteoptionsdlg.hxx b/basctl/source/basicide/codecompleteoptionsdlg.hxx
new file mode 100644
index 000000000000..9549b99a09f3
--- /dev/null
+++ b/basctl/source/basicide/codecompleteoptionsdlg.hxx
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef BASCTL_CODECOMPLETEOPTIONSDLG_HXX
+#define BASCTL_CODECOMPLETEOPTIONSDLG_HXX
+
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+
+namespace basctl
+{
+
+class CodeCompleteOptionsDlg: public ModalDialog
+{
+private:
+ CancelButton* pCancelBtn;
+ OKButton* pOkBtn;
+
+ CheckBox* pCodeCompleteChk;
+ CheckBox* pAutocloseProcChk;
+ CheckBox* pAutocloseBracesChk;
+ CheckBox* pAutocloseQuotesChk;
+
+ DECL_LINK(OkHdl, void*);
+ DECL_LINK(CancelHdl, void*);
+
+public:
+ CodeCompleteOptionsDlg( Window* pWindow );
+ ~CodeCompleteOptionsDlg();
+
+ virtual short Execute();
+};
+
+} // namespace basctl
+
+#endif //BASCTL_CODECOMPLETEOPTIONSDLG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */