106 lines
4.9 KiB
MQL5
106 lines
4.9 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| Main.mqh |
|
|
//| Copyright 2025, Niquel Mendoza. |
|
|
//| https://www.mql5.com/es/users/nique_372 |
|
|
//+------------------------------------------------------------------+
|
|
#property copyright "Copyright 2025, Niquel Mendoza."
|
|
#property link "https://www.mql5.com/es/users/nique_372"
|
|
#property strict
|
|
|
|
#ifndef AIDATATASKRUNER_UI_FEATURESEDITOR_MAIN_MQH
|
|
#define AIDATATASKRUNER_UI_FEATURESEDITOR_MAIN_MQH
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
#include "FeaturesEditor.mqh"
|
|
#include "..\\Defines.mqh"
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
class CFeaturesEditorTab : public CGuiBaseComponent<CLoggerBase>
|
|
{
|
|
private:
|
|
CFeaturesCodeEditor m_code_editor;
|
|
|
|
public:
|
|
CFeaturesEditorTab(void) : CGuiBaseComponent<CLoggerBase>("CFeaturesEditorTab") {}
|
|
~CFeaturesEditorTab(void) {}
|
|
//---
|
|
__forceinline bool OnClickButtom(const long lparam, const string& sparam) { return m_code_editor.OnClickButtom(lparam); }
|
|
__forceinline bool OnComboxItemClick(const long lparam) { return m_code_editor.OnComboxItemClick(lparam); }
|
|
__forceinline bool OnEndEdit(const long lparam) { return m_code_editor.OnEndEdit(lparam); }
|
|
__forceinline bool OnClickInc(const long lparam) { return m_code_editor.OnClickInc(lparam); }
|
|
__forceinline bool OnClickDec(const long lparam) { return m_code_editor.OnClickDec(lparam); }
|
|
__forceinline bool OnModifyTextBox(const long lparam) { return m_code_editor.OnModifyTextBox(lparam); }
|
|
|
|
//---
|
|
void OnLenguajeChange() override final { m_code_editor.OnLenguajeChange(); }
|
|
|
|
//---
|
|
bool Create(CWndCreate* p, CWindow& main_window, int top_gap, int left_gap, int right_gap, int bottom_gag, bool comon_flag);
|
|
};
|
|
//+------------------------------------------------------------------+
|
|
bool CFeaturesEditorTab::Create(CWndCreate *p, CWindow &main_window, int top_gap, int left_gap, int right_gap, int bottom_gag, bool comon_flag)
|
|
{
|
|
// Especfiico del editor
|
|
m_code_editor.AddLogFlags(LogFlags());
|
|
m_code_editor.SetInitValues(m_language, m_base_tab, m_base_tab_idx);
|
|
|
|
// Colores
|
|
CodeEditorColors clrs;
|
|
clrs.bg = AIDATATASKRUNER_COLOR_FONDO_TAB_PRESSED;
|
|
clrs.textbox_bg = C'30,31,34';
|
|
clrs.textbox_text = C'212,212,212';
|
|
clrs.textbox_selected_bg = C'38,79,120';
|
|
clrs.textbox_selected_text = AIDATATASKRUNER_COLOR_TEXT_PRIMARY;
|
|
clrs.textbox_border = AIDATATASKRUNER_COLOR_BORDER;
|
|
clrs.textbox_border_hover = AIDATATASKRUNER_COLOR_BORDER_HOVER;
|
|
clrs.btn_bg = AIDATATASKRUNER_COLOR_BTN_BACK;
|
|
clrs.btn_text = AIDATATASKRUNER_COLOR_TEXT_SECONDARY;
|
|
clrs.btn_border = AIDATATASKRUNER_COLOR_BTN_BORDER;
|
|
clrs.combox_text = AIDATATASKRUNER_COLOR_TEXT_SECONDARY;
|
|
clrs.combox_list_bg = AIDATATASKRUNER_COLOR_EDIT_BACK;
|
|
clrs.combox_list_border = AIDATATASKRUNER_COLOR_EDIT_BORDER;
|
|
clrs.combox_list_text = AIDATATASKRUNER_COLOR_TEXT_SECONDARY;
|
|
clrs.combox_btn_bg = AIDATATASKRUNER_COLOR_EDIT_BACK;
|
|
clrs.combox_btn_border = AIDATATASKRUNER_COLOR_EDIT_BORDER;
|
|
clrs.combox_btn_text = AIDATATASKRUNER_COLOR_TEXT_SECONDARY;
|
|
clrs.label_text = AIDATATASKRUNER_COLOR_TEXT_SECONDARY;
|
|
clrs.edit_label_text = AIDATATASKRUNER_COLOR_TEXT_SECONDARY;
|
|
clrs.edit_input_bg = AIDATATASKRUNER_COLOR_EDIT_BACK;
|
|
clrs.edit_input_border = AIDATATASKRUNER_COLOR_EDIT_BORDER;
|
|
clrs.edit_input_text = AIDATATASKRUNER_COLOR_EDIT_TEXT_NORMAL;
|
|
clrs.edit_input_selected_bg = AIDATATASKRUNER_COLOR_EDIT_TEXT_SELECTED;
|
|
clrs.edit_input_selected_text = AIDATATASKRUNER_COLOR_EDIT_TEXT_HIGHLIGHT;
|
|
clrs.combox_icon_up_idx = RESOURCE_UP_THIN_WHITE;
|
|
clrs.combox_icon_down_idx = RESOURCE_DOWN_THIN_WHITE;
|
|
|
|
|
|
// Template principal
|
|
string arr[];
|
|
if(StringSplit(g_panel_feditor_basetemplate, '\n', arr) == -1)
|
|
{
|
|
LogError("Fallo al hacer split de g_panel_feditor_basetemplate", FUNCION_ACTUAL);
|
|
return false;
|
|
}
|
|
|
|
// Creacion
|
|
if(!m_code_editor.Create(p, main_window, top_gap, left_gap, right_gap, bottom_gag, g_arr_feautres_editor_templates,
|
|
arr, "AiDataTaskRunnerByLeo", AIDATATASKRUNER_PATH_FEATURES_EDITOR, 70, AIDATATASK_RUNNER_COMON_FLAG, clrs))
|
|
{
|
|
GUIBASE_ERROR_CREATION(m_code_editor);
|
|
return false;
|
|
}
|
|
if(!m_code_editor.CreateExtra(main_window, comon_flag, clrs))
|
|
{
|
|
GUIBASE_ERROR_CREATION(m_code_editor);
|
|
return false;
|
|
}
|
|
|
|
//---
|
|
return true;
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
#endif // AIDATATASKRUNER_UI_FEATURESEDITOR_MAIN_MQH
|