diff options
author | Gergo Mocsi <gmocsi91@gmail.com> | 2013-07-15 15:14:23 +0200 |
---|---|---|
committer | Gergo Mocsi <gmocsi91@gmail.com> | 2013-07-15 15:14:23 +0200 |
commit | cf8d21808a3a5365f0de2419ab60bdec03f84434 (patch) | |
tree | d4af4b045336a6b6f101d30a03a7f1f940fb6789 /basctl/source/basicide/baside2.hxx | |
parent | 84b18461e5fad248dc9a80f90d1e3296722fda9b (diff) |
GSOC work, Window instead a FloatingWindow
Changed CodeCompleteListBox into a Window which contains a single ListBox.
Navigation with arrows is enabled, window closes on ESC key.
Double click inserts the selected method into the source code.
Visible line count in ListBox is set to 8 lines, width is adopted from the
longest entry.
Change-Id: I6b6ceb0ce78f9fc727aed53952dc6ee24cba47df
Diffstat (limited to 'basctl/source/basicide/baside2.hxx')
-rw-r--r-- | basctl/source/basicide/baside2.hxx | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx index e949a192f086..3d8afde0d1ed 100644 --- a/basctl/source/basicide/baside2.hxx +++ b/basctl/source/basicide/baside2.hxx @@ -51,6 +51,9 @@ class SvxSearchItem; #include <set> #include <boost/scoped_ptr.hpp> +#include <vcl/floatwin.hxx> +#include <vcl/textdata.hxx> + namespace com { namespace sun { namespace star { namespace beans { class XMultiPropertySet; } } } } @@ -60,6 +63,7 @@ namespace basctl class ObjectCatalog; class CodeCompleteListBox; +class CodeCompleteFloatWindow; DBG_NAMEEX( ModulWindow ) @@ -112,7 +116,8 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > GetComponentInterface(sal_Bool bCreate = true); std::vector< CodeCompleteData > aCodeCompleteCache; - CodeCompleteListBox* aListBox; + CodeCompleteFloatWindow* pCodeCompleteWnd; + //CodeCompleteListBox* aListBox; OUString GetActualSubName( sal_uLong nLine ); // gets the actual subroutine name according to line number std::vector< OUString > Split( const OUString& sStr, const sal_Unicode& aChar ); @@ -469,6 +474,29 @@ private: } aSyntaxColors; }; +class CodeCompleteFloatWindow: public Window +{ +private: + EditorWindow* pParent; // parent window + TextSelection aTextSelection; + ListBox* pListBox; + + void InitListBox(); // initialize the ListBox + DECL_LINK(ImplDoubleClickHdl, void*); + +public: + CodeCompleteFloatWindow( EditorWindow* pPar ); + virtual ~CodeCompleteFloatWindow(); + + void InsertEntry( const OUString& aStr ); + void ClearListBox(); + void SetTextSelection( const TextSelection& aSel ); + void ResizeListBox(); + +protected: + virtual void KeyInput( const KeyEvent& rKeyEvt ); +}; + class CodeCompleteListBox: public ListBox { private: |