summaryrefslogtreecommitdiffstats
path: root/basctl/source/basicide/baside2.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'basctl/source/basicide/baside2.hxx')
-rw-r--r--basctl/source/basicide/baside2.hxx61
1 files changed, 45 insertions, 16 deletions
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 8d07cd81ddc1..cd0485c46b4b 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -24,6 +24,7 @@
#include <layout.hxx>
#include "breakpoint.hxx"
#include "linenumberwindow.hxx"
+#include <colorscheme.hxx>
#include <basic/sbmod.hxx>
#include <basic/sbstar.hxx>
@@ -32,10 +33,12 @@
#include <vcl/weld.hxx>
#include <svtools/colorcfg.hxx>
+#include <svtools/scrolladaptor.hxx>
#include <o3tl/enumarray.hxx>
#include <rtl/ustrbuf.hxx>
#include <set>
+#include <map>
#include <string_view>
#include <vcl/textdata.hxx>
@@ -94,17 +97,23 @@ private:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
- void ImpDoHighlight( sal_uLong nLineOff );
+ void ImpDoHighlight( sal_uInt32 nLineOff );
void ImplSetFont();
+ sal_uInt16 nCurrentZoomLevel;
bool bHighlighting;
bool bDoSyntaxHighlight;
bool bDelayHighlight;
- virtual css::uno::Reference< css::awt::XWindowPeer > GetComponentInterface(bool bCreate = true) override;
+ // Used to determine if the highlighted line has changed, which would require redrawing the highlight
+ sal_uInt32 m_nLastHighlightPara;
+
+ Color m_aLineHighlightColor;
+
+ virtual css::uno::Reference< css::awt::XVclWindowPeer > GetComponentInterface(bool bCreate = true) override;
CodeCompleteDataCache aCodeCompleteCache;
VclPtr<CodeCompleteWindow> pCodeCompleteWnd;
- OUString GetActualSubName( sal_uLong nLine ); // gets the actual subroutine name according to line number
+ OUString GetActualSubName( sal_uInt32 nLine ); // gets the actual subroutine name according to line number
void SetupAndShowCodeCompleteWnd(const std::vector< OUString >& aEntryVect, TextSelection aSel );
void HandleAutoCorrect();
void HandleAutoCloseParen();
@@ -123,9 +132,10 @@ private:
virtual void LoseFocus() override;
virtual void RequestHelp( const HelpEvent& rHEvt ) override;
- void DoSyntaxHighlight( sal_uLong nPara );
+ void DoSyntaxHighlight( sal_uInt32 nPara );
OUString GetWordAtCursor();
bool ImpCanModify();
+ void HighlightCurrentLine(vcl::RenderContext& rRenderContext);
public:
EditorWindow (vcl::Window* pParent, ModulWindow*);
@@ -138,8 +148,8 @@ public:
void CreateProgress( const OUString& rText, sal_uInt32 nRange );
void DestroyProgress();
- void ParagraphInsertedDeleted( sal_uLong nNewPara, bool bInserted );
- void DoDelayedSyntaxHighlight( sal_uLong nPara );
+ void ParagraphInsertedDeleted( sal_uInt32 nNewPara, bool bInserted );
+ void DoDelayedSyntaxHighlight( sal_uInt32 nPara );
void CreateEditEngine();
void SetScrollBarRanges();
@@ -152,8 +162,12 @@ public:
void ChangeFontColor( Color aColor );
void UpdateSyntaxHighlighting ();
+ void SetLineHighlightColor(Color aColor);
- bool GetProcedureName(OUString const & rLine, OUString& rProcType, OUString& rProcName) const;
+ void SetEditorZoomLevel(sal_uInt16 nNewZoomLevel);
+ sal_uInt16 GetCurrentZoom() { return nCurrentZoomLevel; }
+
+ bool GetProcedureName(std::u16string_view rLine, OUString& rProcType, OUString& rProcName) const;
FactoryFunction GetUITestFactory() const override;
};
@@ -253,12 +267,13 @@ private:
VclPtr<BreakPointWindow> aBrkWindow;
VclPtr<LineNumberWindow> aLineNumberWindow;
VclPtr<EditorWindow> aEdtWindow;
- VclPtr<ScrollBar> aEWVScrollBar;
+ VclPtr<ScrollAdaptor> aEWVScrollBar;
+ VclPtr<ScrollAdaptor> aEWHScrollBar;
virtual void DataChanged(DataChangedEvent const & rDCEvt) override;
virtual void Resize() override;
- DECL_LINK( ScrollHdl, ScrollBar*, void );
+ DECL_LINK(ScrollHdl, weld::Scrollbar&, void);
public:
explicit ComplexEditorWindow( ModulWindow* pParent );
@@ -267,7 +282,8 @@ public:
BreakPointWindow& GetBrkWindow() { return *aBrkWindow; }
LineNumberWindow& GetLineNumberWindow() { return *aLineNumberWindow; }
EditorWindow& GetEdtWindow() { return *aEdtWindow; }
- ScrollBar& GetEWVScrollBar() { return *aEWVScrollBar; }
+ ScrollAdaptor& GetEWVScrollBar() { return *aEWVScrollBar; }
+ ScrollAdaptor& GetEWHScrollBar() { return *aEWHScrollBar; }
void SetLineNumberDisplay(bool b);
};
@@ -283,6 +299,7 @@ private:
BasicStatus m_aStatus;
SbModuleRef m_xModule;
OUString m_aModule;
+ OUString m_sWinColorScheme;
void CheckCompileBasic();
void BasicExecute();
@@ -294,10 +311,10 @@ protected:
virtual void GetFocus() override;
virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) override;
virtual void DoInit() override;
- virtual void DoScroll( ScrollBar* pCurScrollBar ) override;
+ virtual void DoScroll(Scrollable* pCurScrollBar) override;
public:
- ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aName, OUString const & aModule );
+ ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aName, OUString aModule );
virtual ~ModulWindow() override;
virtual void dispose() override;
@@ -360,7 +377,8 @@ public:
EditorWindow& GetEditorWindow() { return m_aXEditorWindow->GetEdtWindow(); }
BreakPointWindow& GetBreakPointWindow() { return m_aXEditorWindow->GetBrkWindow(); }
LineNumberWindow& GetLineNumberWindow() { return m_aXEditorWindow->GetLineNumberWindow(); }
- ScrollBar& GetEditVScrollBar() { return m_aXEditorWindow->GetEWVScrollBar(); }
+ ScrollAdaptor& GetEditVScrollBar() { return m_aXEditorWindow->GetEWVScrollBar(); }
+ ScrollAdaptor& GetEditHScrollBar() { return m_aXEditorWindow->GetEWHScrollBar(); }
ExtTextEngine* GetEditEngine() { return GetEditorWindow().GetEditEngine(); }
TextView* GetEditView() { return GetEditorWindow().GetEditView(); }
BreakPointList& GetBreakPoints() { return GetBreakPointWindow().GetBreakPoints(); }
@@ -379,11 +397,13 @@ public:
virtual void Deactivating () override;
virtual void OnNewDocument () override;
- virtual OString GetHid () const override;
+ virtual OUString GetHid () const override;
virtual ItemType GetType () const override;
virtual bool HasActiveEditor () const override;
void UpdateModule ();
+ OUString GetEditorColorScheme() { return m_sWinColorScheme; }
+ void SetEditorColorScheme(const OUString& rColorScheme);
};
class ModulWindowLayout: public Layout
@@ -401,9 +421,15 @@ public:
public:
void BasicAddWatch (OUString const&);
void BasicRemoveWatch ();
+ void ShowWatchWindow(bool bVisible);
+ void ShowStackWindow(bool bVisible);
+ bool IsWatchWindowVisible() { return aWatchWindow->IsVisible(); }
+ bool IsStackWindowVisible() { return aStackWindow->IsVisible(); }
Color const & GetSyntaxBackgroundColor () const { return aSyntaxColors.GetBackgroundColor(); }
Color const & GetFontColor () const { return aSyntaxColors.GetFontColor(); }
Color const & GetSyntaxColor (TokenType eType) const { return aSyntaxColors.GetColor(eType); }
+ OUString GetActiveColorSchemeId() { return m_sColorSchemeId; }
+ void ApplyColorSchemeToCurrentWindow(const OUString& rSchemeId);
protected:
// Window:
@@ -418,6 +444,8 @@ private:
VclPtr<WatchWindow> aWatchWindow;
VclPtr<StackWindow> aStackWindow;
ObjectCatalog& rObjectCatalog;
+ // Active color scheme ID
+ OUString m_sColorSchemeId;
// SyntaxColors -- stores Basic syntax highlighting colors
class SyntaxColors : public utl::ConfigurationListener
@@ -427,25 +455,26 @@ private:
virtual ~SyntaxColors () override;
public:
void SetActiveEditor (EditorWindow* pEditor_) { pEditor = pEditor_; }
+ void SetActiveColorSchemeId(const OUString& rColorSchemeId) { m_sActiveSchemeId = rColorSchemeId; }
public:
Color const & GetBackgroundColor () const { return m_aBackgroundColor; };
Color const & GetFontColor () const { return m_aFontColor; }
Color const & GetColor(TokenType eType) const { return aColors[eType]; }
+ void ApplyColorScheme(OUString aSchemeId, bool bFirst);
private:
virtual void ConfigurationChanged (utl::ConfigurationBroadcaster*, ConfigurationHints) override;
- void NewConfig (bool bFirst);
private:
Color m_aBackgroundColor;
Color m_aFontColor;
+ OUString m_sActiveSchemeId;
// the color values (the indexes are TokenType, see comphelper/syntaxhighlight.hxx)
o3tl::enumarray<TokenType, Color> aColors;
// the configuration
svtools::ColorConfig aConfig;
// the active editor
VclPtr<EditorWindow> pEditor;
-
} aSyntaxColors;
};