-
-
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.
New forms: - WindowMain - WindowView - WindowSplash - WindowLog New files: ELog.h/cpp UI_MainCommand.h/cpp Token.h moved to Core folder Other minor changes
- Loading branch information
1 parent
bd869e1
commit fc57908
Showing
22 changed files
with
10,016 additions
and
48 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "pch.hpp" | ||
#include "ELog.h" | ||
#include "Props/WindowLog.h" | ||
|
||
gcroot<EditorLog^> ELog; | ||
|
||
using namespace XRay::ECore::Props; | ||
|
||
XRECORE_API void ELogCallback(void* context, pcstr message) | ||
{ | ||
if (0 == message[0]) | ||
return; | ||
bool isDialog = ('#' == message[0]) || ((0 != message[1]) && ('#' == message[1])); | ||
MessageType type = ('!' == message[0]) || ((0 != message[1]) && ('!' == message[1])) ? MessageType::Error : MessageType::Information; | ||
if (('!' == message[0]) || ('#' == message[0])) | ||
message++; | ||
if (('!' == message[0]) || ('#' == message[0])) | ||
message++; | ||
|
||
auto windowLog = safe_cast<WindowLog^>(Form::FromHandle(IntPtr(context))); | ||
|
||
if (windowLog) | ||
{ | ||
if (isDialog) | ||
windowLog->AddDialogMessage(type, message); | ||
else | ||
windowLog->AddMessage(type, message); | ||
} | ||
} |
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,82 @@ | ||
#pragma once | ||
|
||
enum class MessageType | ||
{ | ||
Information, | ||
Warning, | ||
Error, | ||
Confirmation, | ||
Custom | ||
}; | ||
|
||
ref class EditorLog | ||
{ | ||
public: | ||
bool in_use; | ||
|
||
EditorLog() : in_use(false) {} | ||
|
||
public: System::Windows::Forms::DialogResult DlgMsg(MessageType type, System::String^ message) | ||
{ | ||
using namespace System::Windows::Forms; | ||
|
||
in_use = true; | ||
|
||
//ExecCommand(COMMAND_RENDER_FOCUS); | ||
|
||
DialogResult result; | ||
|
||
if (type == MessageType::Confirmation) | ||
{ | ||
result = MessageBox::Show(message, "Message", MessageBoxButtons::YesNoCancel); | ||
switch (result) | ||
{ | ||
case DialogResult::Yes: message->Concat(" - Yes."); break; | ||
case DialogResult::No: message->Concat(" - No."); break; | ||
case DialogResult::Cancel: message->Concat(" - Cancel."); break; | ||
default: message->Concat(" - Something."); | ||
} | ||
} | ||
else | ||
result = MessageBox::Show(message, "Message", MessageBoxButtons::OK); | ||
|
||
msclr::interop::marshal_context ctx; | ||
Log(ctx.marshal_as<pcstr>(message)); | ||
|
||
in_use = false; | ||
|
||
return result; | ||
} | ||
|
||
public: System::Windows::Forms::DialogResult DlgMsg(MessageType type, System::String^ message, System::Windows::Forms::MessageBoxButtons buttons) | ||
{ | ||
using namespace System::Windows::Forms; | ||
|
||
in_use = true; | ||
|
||
//ExecCommand(COMMAND_RENDER_FOCUS); | ||
|
||
DialogResult result = MessageBox::Show(message, "Message", buttons);; | ||
if (type == MessageType::Confirmation) | ||
{ | ||
switch (result) | ||
{ | ||
case DialogResult::Yes: message->Concat(" - Yes."); break; | ||
case DialogResult::No: message->Concat(" - No."); break; | ||
case DialogResult::Cancel: message->Concat(" - Cancel."); break; | ||
default: message->Concat(" - Something."); | ||
} | ||
} | ||
|
||
msclr::interop::marshal_context ctx; | ||
Log(ctx.marshal_as<pcstr>(message)); | ||
|
||
in_use = false; | ||
|
||
return result; | ||
} | ||
}; | ||
|
||
void XRECORE_API ELogCallback(void* context, pcstr message); | ||
|
||
extern XRECORE_API gcroot<EditorLog^> ELog; |
File renamed without changes.
Oops, something went wrong.