-
-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
83 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,49 @@ | ||
#include "pch.hpp" | ||
|
||
#include <msclr/marshal.h> | ||
|
||
#include "TextEdit.h" | ||
|
||
System::Void XRay::ECore::Props::TextEdit::buttonClear_Click(System::Object^ sender, System::EventArgs^ e) | ||
namespace XRay | ||
{ | ||
namespace ECore | ||
{ | ||
namespace Props | ||
{ | ||
System::Void TextEdit::buttonClear_Click(System::Object^ sender, System::EventArgs^ e) | ||
{ | ||
textBox1->Clear(); | ||
} | ||
|
||
System::Void XRay::ECore::Props::TextEdit::buttonOk_Click(System::Object^ sender, System::EventArgs^ e) | ||
System::Void TextEdit::textBox1_SelectionChanged(System::Object^ sender, System::EventArgs^ e) | ||
{ | ||
auto line = textBox1->GetLineFromCharIndex(textBox1->SelectionStart); | ||
auto currline = textBox1->GetFirstCharIndexOfCurrentLine(); | ||
auto charpos = textBox1->SelectionStart - currline; | ||
toolStripStatusLabel1->Text = (line + 1) + " : " + (charpos + 1); | ||
} | ||
|
||
bool TextEdit::Run(xr_string& text, pcstr caption, bool read_only, int lim, | ||
pcstr apply_name, TOnApplyClick^ on_apply, TOnCloseClick^ on_close, | ||
TOnCodeInsight^ on_insight) | ||
{ | ||
Text = gcnew String(caption); | ||
m_text = &text; | ||
textBox1->ReadOnly = read_only; | ||
textBox1->Text = gcnew String(text.c_str()); | ||
textBox1->MaxLength = lim; | ||
|
||
buttonApply->Text = gcnew String(apply_name); | ||
//buttonApply->Click += gcnew EventHandler(on_apply); | ||
|
||
return ShowDialog() == Windows::Forms::DialogResult::OK; | ||
} | ||
|
||
System::Void TextEdit::buttonOk_Click(System::Object^ sender, System::EventArgs^ e) | ||
{ | ||
//marshal this | ||
//*m_text = textBox1->Text; | ||
msclr::interop::marshal_context ctx; | ||
*m_text = ctx.marshal_as<pcstr>(textBox1->Text); | ||
} | ||
} // namespace Props | ||
} // namespace ECore | ||
} // namespace XRay |
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
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 |
---|---|---|
@@ -1,17 +1,27 @@ | ||
#pragma once | ||
|
||
template <class T> | ||
struct _vector3; | ||
using Fvector = _vector3<float>; | ||
struct WaveForm; | ||
struct GameTypeChooser; | ||
|
||
using TOnApplyClick = fastdelegate::FastDelegate1<pcstr, bool>; | ||
using TOnCloseClick = fastdelegate::FastDelegate0<bool>; | ||
using TOnCodeInsight = fastdelegate::FastDelegate3<const xr_string&, xr_string&, bool&>; | ||
|
||
namespace XRay | ||
{ | ||
namespace ECore | ||
{ | ||
namespace Props | ||
{ | ||
bool NumericVectorRun(pcstr title, Fvector* data, int decimal, Fvector* reset_value, Fvector* min, Fvector* max, int* X, int* Y); | ||
bool ShaderFunctionRun(WaveForm* func); | ||
bool GameTypeRun(pcstr title, GameTypeChooser* data); | ||
XRECORE_API bool NumericVectorRun(pcstr title, Fvector* data, int decimal, Fvector* reset_value, Fvector* min, Fvector* max, int* X, int* Y); | ||
XRECORE_API bool ShaderFunctionRun(WaveForm* func); | ||
XRECORE_API bool GameTypeRun(pcstr title, GameTypeChooser* data); | ||
XRECORE_API bool TextEditRun(xr_string& text, pcstr caption = "Text", bool read_only = false, int lim = 0, | ||
pcstr apply_name = "Apply", TOnApplyClick on_apply = 0, TOnCloseClick on_close = 0, | ||
TOnCodeInsight on_insight = 0); | ||
} // namespace Props | ||
} // namespace ECore | ||
} // namespace XRay |