-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate source text editor to its own class and add line numbers
Note that currently line numbers aren't really that visible, so going forward some better styling has to be sorted (which will probably be done when lexers are added to the SrcEditor class)
- Loading branch information
Showing
5 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (c) 2024 Jack Bennett. | ||
* All Rights Reserved. | ||
* | ||
* See the LICENCE file for more information. | ||
*/ | ||
|
||
#include "src_editor_component.hpp" | ||
|
||
namespace te::gui::editor { | ||
SrcEditor::SrcEditor(wxWindow *parent) : wxStyledTextCtrl(parent) { | ||
// TODO: set colours depending on dark or light theme | ||
// TODO: note that the theme might be system dependent, as on macOS, so properly managing themes with some sort of manager class would be best | ||
SetMarginType(1, wxSTC_MARGIN_NUMBER); | ||
SetMarginMask(1, 0); | ||
SetMarginWidth(1, 20); | ||
|
||
// TODO lexers for styling and syntax highlighting. | ||
} | ||
|
||
SrcEditor::~SrcEditor() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2024 Jack Bennett. | ||
* All Rights Reserved. | ||
* | ||
* See the LICENCE file for more information. | ||
*/ | ||
|
||
#pragma once | ||
#ifndef __devinit__src_editor_component_hpp__ | ||
#define __devinit__src_editor_component_hpp__ | ||
|
||
#include <wx/stc/stc.h> | ||
|
||
namespace te::gui::editor { | ||
class SrcEditor : public wxStyledTextCtrl { | ||
public: | ||
SrcEditor(wxWindow *parent); | ||
~SrcEditor(); | ||
|
||
private: | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters