File size: 1,130 Bytes
17f5b5c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Generated with ImRAD 0.9
// github.com/xyz

#pragma once
#include <string>
#include <functional>
#include <imgui.h>
#include "imrad.h"
#include "cppgen.h"

class BindingDlg
{
public:
    /// @begin interface
    void OpenPopup(std::function<void(ImRad::ModalResult)> clb = [](ImRad::ModalResult){});
    void ClosePopup(ImRad::ModalResult mr = ImRad::Cancel);
    void Draw();

    void OnNewField();
    void OnVarClicked();
    int OnTextInputFilter(ImGuiInputTextCallbackData& args);
    void Refresh();

    std::string name;
    std::string expr;
    std::string type;
    CppGen* codeGen;
    std::string curArray;
    bool forceReference;
    ImFont* font = nullptr;
    /// @end interface

private:
    /// @begin impl
    void ResetLayout();
    void Init();

    void OkButton_Change();

    ImGuiID ID = 0;
    ImRad::ModalResult modalResult;
    std::function<void(ImRad::ModalResult)> callback;
    bool showAll;
    std::vector<std::pair<std::string,std::string>> vars;
    bool focusExpr = false;
    ImRad::HBox hb1;
    ImRad::HBox hb3;
    ImRad::HBox hb5;
    /// @end impl
};

extern BindingDlg bindingDlg;