Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
DataEditorX
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
DataEditorX
Commits
b0eeb519
Commit
b0eeb519
authored
Jun 12, 2020
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hint when use different card code at function
parent
44764797
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
19 deletions
+37
-19
DataEditorX/CodeEditForm.cs
DataEditorX/CodeEditForm.cs
+25
-3
DataEditorX/Controls/FastColoredTextBoxEx.cs
DataEditorX/Controls/FastColoredTextBoxEx.cs
+4
-2
DataEditorX/Controls/MySyntaxHighlighter.cs
DataEditorX/Controls/MySyntaxHighlighter.cs
+5
-3
DataEditorX/Language/MyMsg.cs
DataEditorX/Language/MyMsg.cs
+3
-10
DataEditorX/MainForm.cs
DataEditorX/MainForm.cs
+0
-1
No files found.
DataEditorX/CodeEditForm.cs
View file @
b0eeb519
...
...
@@ -83,6 +83,7 @@ void InitForm()
{
MinFragmentLength
=
2
};
this
.
fctb
.
TextChanged
+=
this
.
Fctb_TextChanged
;
this
.
popupMenu
.
ToolTip
.
Popup
+=
this
.
ToolTip_Popup
;
this
.
popupMenu
.
Items
.
Font
=
ft
;
this
.
popupMenu
.
AutoSize
=
true
;
...
...
@@ -92,11 +93,16 @@ void InitForm()
this
.
popupMenu
.
Closed
+=
new
ToolStripDropDownClosedEventHandler
(
this
.
popupMenu_Closed
);
this
.
popupMenu
.
SelectedColor
=
Color
.
LightGray
;
this
.
popupMenu
.
VisibleChanged
+=
this
.
PopupMenu_VisibleChanged
;
this
.
popupMenu
.
Opened
+=
this
.
PopupMenu_VisibleChanged
;
this
.
popupMenu
.
Items
.
FocussedItemIndexChanged
+=
this
.
Items_FocussedItemIndexChanged
;
this
.
title
=
this
.
Text
;
}
private
void
Fctb_TextChanged
(
object
sender
,
TextChangedEventArgs
e
)
{
this
.
PopupMenu_VisibleChanged
(
null
,
null
);
}
private
void
ToolTip_Popup
(
object
sender
,
PopupEventArgs
e
)
{
e
.
Cancel
=
true
;
...
...
@@ -104,13 +110,22 @@ private void ToolTip_Popup(object sender, PopupEventArgs e)
private
void
PopupMenu_VisibleChanged
(
object
sender
,
EventArgs
e
)
{
this
.
AdjustPopupMenuSize
();
if
(!
this
.
popupMenu
.
Visible
||
this
.
popupMenu
.
Items
.
FocussedItem
==
null
)
if
(!
this
.
popupMenu
.
Visible
)
{
this
.
AdjustPopupMenuSize
();
return
;
}
if
(
this
.
popupMenu
.
Items
.
FocussedItem
==
null
)
{
if
(
this
.
popupMenu
.
Items
.
Count
==
0
)
{
return
;
}
this
.
popupMenu
.
Items
.
FocussedItemIndex
=
0
;
}
this
.
fctb
.
ShowTooltipWithLabel
(
this
.
popupMenu
.
Items
.
FocussedItem
.
ToolTipTitle
,
this
.
popupMenu
.
Items
.
FocussedItem
.
ToolTipText
);
this
.
AdjustPopupMenuSize
();
}
private
void
AdjustPopupMenuSize
()
{
...
...
@@ -118,6 +133,7 @@ private void AdjustPopupMenuSize()
{
this
.
popupMenu
.
Size
=
new
Size
(
300
,
0
);
this
.
popupMenu
.
MinimumSize
=
new
Size
(
300
,
0
);
return
;
}
Size
s
=
TextRenderer
.
MeasureText
(
this
.
popupMenu
.
Items
.
FocussedItem
.
ToolTipTitle
,
this
.
popupMenu
.
Items
.
Font
,
new
Size
(
0
,
0
),
TextFormatFlags
.
NoPadding
);
...
...
@@ -176,6 +192,12 @@ public bool Open(string file)
fs
.
Close
();
}
this
.
nowFile
=
file
;
FileInfo
fi
=
new
FileInfo
(
file
);
if
(
fi
.
Name
.
ToUpper
().
EndsWith
(
".LUA"
))
{
(
this
.
fctb
.
SyntaxHighlighter
as
MySyntaxHighlighter
).
cCode
=
fi
.
Name
.
Substring
(
0
,
fi
.
Name
.
Length
-
4
);
}
string
cdb
=
MyPath
.
Combine
(
Path
.
GetDirectoryName
(
file
),
"../cards.cdb"
);
this
.
SetCardDB
(
cdb
);
//后台加载卡片数据
...
...
DataEditorX/Controls/FastColoredTextBoxEx.cs
View file @
b0eeb519
...
...
@@ -15,7 +15,6 @@ public class FastColoredTextBoxEx : FastColoredTextBox
{
public
Label
lbTooltip
;
Point
lastMouseCoord
;
public
FastColoredTextBoxEx
()
:
base
()
{
this
.
SyntaxHighlighter
=
new
MySyntaxHighlighter
();
...
...
@@ -67,7 +66,10 @@ protected override void OnToolTip()
this
.
ShowTooltipWithLabel
(
ea
.
ToolTipTitle
,
ea
.
ToolTipText
);
}
}
public
void
ShowTooltipWithLabel
(
AutocompleteItem
item
)
{
this
.
ShowTooltipWithLabel
(
item
.
ToolTipTitle
,
item
.
ToolTipText
);
}
public
void
ShowTooltipWithLabel
(
string
title
,
string
text
,
int
height
)
{
this
.
lbTooltip
.
Visible
=
true
;
...
...
DataEditorX/Controls/MySyntaxHighlighter.cs
View file @
b0eeb519
...
...
@@ -14,13 +14,14 @@ namespace FastColoredTextBoxNS
/// </summary>
public
class
MySyntaxHighlighter
:
SyntaxHighlighter
{
public
string
cCode
=
""
;
readonly
TextStyle
mNumberStyle
=
new
TextStyle
(
Brushes
.
Orange
,
null
,
FontStyle
.
Regular
);
readonly
TextStyle
mStrStyle
=
new
TextStyle
(
Brushes
.
Gold
,
null
,
FontStyle
.
Regular
);
readonly
TextStyle
conStyle
=
new
TextStyle
(
Brushes
.
YellowGreen
,
null
,
FontStyle
.
Regular
);
readonly
TextStyle
mKeywordStyle
=
new
TextStyle
(
Brushes
.
DeepSkyBlue
,
null
,
FontStyle
.
Regular
);
readonly
TextStyle
mGrayStyle
=
new
TextStyle
(
Brushes
.
Gray
,
null
,
FontStyle
.
Regular
);
readonly
TextStyle
mFunStyle
=
new
TextStyle
(
Brushes
.
LightGray
,
null
,
FontStyle
.
Bold
);
readonly
TextStyle
mErrorStyle
=
new
TextStyle
(
Brushes
.
Red
,
null
,
FontStyle
.
Bold
);
/// <summary>
/// Highlights Lua code
...
...
@@ -39,7 +40,7 @@ public override void LuaSyntaxHighlight(Range range)
=
@"^\s*[\w\.]+(\s\w+)?\s*(?<range>=)\s*(?<range>.+)"
;
//clear style of changed range
range
.
ClearStyle
(
this
.
mStrStyle
,
this
.
mGrayStyle
,
this
.
conStyle
,
this
.
mNumberStyle
,
this
.
mKeywordStyle
,
this
.
mFunStyle
);
range
.
ClearStyle
(
this
.
mStrStyle
,
this
.
mGrayStyle
,
this
.
conStyle
,
this
.
mNumberStyle
,
this
.
mKeywordStyle
,
this
.
mFunStyle
,
this
.
mErrorStyle
);
//
if
(
this
.
LuaStringRegex
==
null
)
{
...
...
@@ -58,7 +59,8 @@ public override void LuaSyntaxHighlight(Range range)
range
.
SetStyle
(
this
.
mKeywordStyle
,
this
.
LuaKeywordRegex
);
//functions highlighting
range
.
SetStyle
(
this
.
mFunStyle
,
this
.
LuaFunctionsRegex
);
range
.
SetStyle
(
this
.
mNumberStyle
,
@"\bc\d+\b"
);
range
.
SetStyle
(
this
.
mErrorStyle
,
@"\bc\d+\b"
);
range
.
SetStyle
(
this
.
mNumberStyle
,
$@"\b
{
cCode
}
\b"
);
range
.
SetStyle
(
this
.
conStyle
,
@"[\s|\(|+|,]{0,1}(?<range>[A-Z_]+?)[\)|+|\s|,|;]"
);
//range.SetStyle(mFunStyle, @"[:|\.|\s](?<range>[a-zA-Z0-9_]*?)[\(|\)|\s]");
...
...
DataEditorX/Language/MyMsg.cs
View file @
b0eeb519
...
...
@@ -67,16 +67,9 @@ public static void Error(LMSG msg)
}
public
static
bool
Question
(
LMSG
msg
)
{
if
(
MessageBox
.
Show
(
LanguageHelper
.
GetMsg
(
msg
),
_question
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
)
==
DialogResult
.
OK
)
{
return
true
;
}
else
{
return
false
;
}
return
(
MessageBox
.
Show
(
LanguageHelper
.
GetMsg
(
msg
),
_question
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
)
==
DialogResult
.
OK
);
}
}
}
DataEditorX/MainForm.cs
View file @
b0eeb519
...
...
@@ -535,7 +535,6 @@ private void bgWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventAr
this
.
Init
();
}
private
void
bgWorker1_RunWorkerCompleted
(
object
sender
,
System
.
ComponentModel
.
RunWorkerCompletedEventArgs
e
)
{
//更新UI
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment