-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemos.diff
185 lines (168 loc) · 5.57 KB
/
demos.diff
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
bin/examples/LuaJIT-ImGui/examples/CTE_Objects_sample.lua | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/bin/examples/LuaJIT-ImGui/examples/CTE_Objects_sample.lua b/bin/examples/LuaJIT-ImGui/examples/CTE_Objects_sample.lua
index 2fccc88..2a280cb 100644
--- a/bin/examples/LuaJIT-ImGui/examples/CTE_Objects_sample.lua
+++ b/bin/examples/LuaJIT-ImGui/examples/CTE_Objects_sample.lua
@@ -11,9 +11,9 @@ local editor = ig.TextEditor()
editor:SetLanguageDefinition(ig.lib.Cpp)
-local fileN = [[../cimCTE/cimCTE.cpp]]
+--local fileN = [[../cimCTE/cimCTE.cpp]]
--local fileN = [[C:\LuaGL\gitsources\anima\LuaJIT-ImGui\cimCTE\ImGuiColorTextEdit\TextEditor.cpp]]
--- local fileN = [[CTE_sample.lua]]
+local fileN = [[CTE_sample.lua]]
local file,err = io.open(fileN,"r")
assert(file,err)
local strtext = file:read"*a"
@@ -42,7 +42,7 @@ function win:draw(ig)
end
ig.EndMenu();
end
-
+
if (ig.BeginMenu("Edit"))
then
local ro = ffi.new("bool[?]",1,editor:IsReadOnlyEnabled());
@@ -78,7 +78,7 @@ function win:draw(ig)
end
if (ig.BeginMenu("View")) then
-
+
if (ig.MenuItem("Dark palette")) then
editor:SetPalette(ig.lib.Dark);
end
@@ -95,16 +95,16 @@ function win:draw(ig)
end
ig.EndMenuBar();
end
-
+
ig.Text("%6d/%-6d %6d lines | %s | %s | %s | %s", toint(mLine[0] + 1), toint(mColumn[0] + 1), toint(editor:GetLineCount()),
editor:IsOverwriteEnabled() and "Ovr" or "Ins",
editor:CanUndo() and "*" or " ",
langNames[tonumber(editor:GetLanguageDefinition())],
fileN)
-
+
editor:Render("texteditor")
ig.End()
end
-win:start()
\ No newline at end of file
+win:start()
bin/examples/LuaJIT-ImGui/examples/CTE_sample.lua | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/bin/examples/LuaJIT-ImGui/examples/CTE_sample.lua b/bin/examples/LuaJIT-ImGui/examples/CTE_sample.lua
index 74e7b67..92bfdf2 100644
--- a/bin/examples/LuaJIT-ImGui/examples/CTE_sample.lua
+++ b/bin/examples/LuaJIT-ImGui/examples/CTE_sample.lua
@@ -12,9 +12,9 @@ local editor = lib.TextEditor_TextEditor()
lib.TextEditor_SetLanguageDefinition(editor,lib.Cpp);
-local fileN = [[../cimCTE/cimCTE.cpp]]
+--local fileN = [[../cimCTE/cimCTE.cpp]]
--local fileN = [[C:\LuaGL\gitsources\anima\LuaJIT-ImGui\cimCTE\ImGuiColorTextEdit\TextEditor.cpp]]
--- local fileN = [[CTE_sample.lua]]
+local fileN = [[CTE_sample.lua]]
local file,err = io.open(fileN,"r")
assert(file,err)
local strtext = file:read"*a"
@@ -43,7 +43,7 @@ function win:draw(ig)
end
ig.EndMenu();
end
-
+
if (ig.BeginMenu("Edit"))
then
local ro = ffi.new("bool[?]",1,ig.lib.TextEditor_IsReadOnlyEnabled(editor));
@@ -79,7 +79,7 @@ function win:draw(ig)
end
if (ig.BeginMenu("View")) then
-
+
if (ig.MenuItem("Dark palette")) then
ig.lib.TextEditor_SetPalette(editor,ig.lib.Dark);
end
@@ -96,15 +96,15 @@ function win:draw(ig)
end
ig.EndMenuBar();
end
-
+
ig.Text("%6d/%-6d %6d lines | %s | %s | %s | %s", toint(mLine[0] + 1), toint(mColumn[0] + 1), toint(ig.lib.TextEditor_GetLineCount(editor)),
ig.lib.TextEditor_IsOverwriteEnabled(editor) and "Ovr" or "Ins",
ig.lib.TextEditor_CanUndo(editor) and "*" or " ",
langNames[ig.lib.TextEditor_GetLanguageDefinition(editor)],fileN)
-
+
ig.lib.TextEditor_Render(editor, "texteditor",false,ig.ImVec2(),false)
ig.End()
end
-win:start()
\ No newline at end of file
+win:start()
bin/examples/LuaJIT-ImGui/examples/CTE_windows.lua | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/bin/examples/LuaJIT-ImGui/examples/CTE_windows.lua b/bin/examples/LuaJIT-ImGui/examples/CTE_windows.lua
index bc30509..a1d9ba7 100644
--- a/bin/examples/LuaJIT-ImGui/examples/CTE_windows.lua
+++ b/bin/examples/LuaJIT-ImGui/examples/CTE_windows.lua
@@ -42,27 +42,27 @@ local fbs = gui.FileBrowser(nil,{key="saver",check_existence=true},
local doc = opendocs[curr_opendoc]
doc:Save(fname)
end)
-
+
--add two editors
-addEditor(gui.pathut.abspath([[../cimgui/imgui/imgui.cpp]]))
+addEditor(gui.pathut.abspath("dock.lua"))
addEditor(gui.pathut.abspath("CTE_sample.lua"))
function win:draw(ig)
--ig.ShowDemoWindow()
-
+
local openfilepopup = false
local savefilepopup = false
local doclosefile = false
-
+
local viewport = ig.GetMainViewport();
--Submit a window filling the entire viewport
ig.SetNextWindowPos(viewport.WorkPos);
ig.SetNextWindowSize(viewport.WorkSize);
ig.SetNextWindowViewport(viewport.ID);
-
+
local host_window_flags = bit.bor( ig.lib.ImGuiWindowFlags_NoTitleBar , ig.lib.ImGuiWindowFlags_NoCollapse, ig.lib.ImGuiWindowFlags_NoResize , ig.lib.ImGuiWindowFlags_NoMove , ig.lib.ImGuiWindowFlags_NoDocking, ig.lib.ImGuiWindowFlags_NoBringToFrontOnFocus, ig.lib.ImGuiWindowFlags_NoNavFocus,ig.lib.ImGuiWindowFlags_MenuBar)
-
+
ig.Begin("Documents",nil, host_window_flags) --ig.lib.ImGuiWindowFlags_MenuBar)
if (ig.BeginMenuBar()) then
if (ig.BeginMenu("File")) then
@@ -96,7 +96,7 @@ function win:draw(ig)
v:Render()
ig.EndTabItem();
end
- if not opened[0] then
+ if not opened[0] then
curr_opendoc = i
doclosefile = true
break
@@ -105,7 +105,7 @@ function win:draw(ig)
ig.EndTabBar();
end
local doit = false
- if doclosefile then
+ if doclosefile then
doit = CheckCloseEditor(curr_opendoc)
end
if confirm_close.draw(doit) then
@@ -113,7 +113,7 @@ function win:draw(ig)
end
ig.End()
-
+
end
-win:start()
\ No newline at end of file
+win:start()