@@ -41,7 +41,7 @@ print(edit_text:GetControlID())
4141local tabstop_width = calc_tab_width (edit_font , 4 )
4242edit_text :SetTabstopWidth (tabstop_width )
4343edit_text :SetAutomaticEditing (true )
44- dlg :RegisterHandleControlEvent (edit_text , function (control )
44+ dlg :RegisterHandleControlEvent (edit_text , function (control ) -- luacheck: ignore
4545-- local finale.FCString = control:CreateEnigmaString()
4646-- print("Got Enigma String: "..finale.FCString.LuaString)
4747 end )
@@ -53,7 +53,7 @@ local non_bmp_text = [[𝒜𝓈 𝒸𝒽
5353𝓊𝓃𝓈𝑒
5454𝓉𝓈 𝒾𝓃 𝓉𝒽𝑒 𝓋𝒶𝓈𝓉 𝒾𝓃𝓉𝓸 𝓉𝒽𝑒 𝓊𝓃𝓀𝓃𝑜𝓌𝓃
5555𝒾𝓈 𝒶 𝒷𝑒𝒶𝓊𝓉𝒾𝒻𝓊𝓁 𝓂𝒶𝑔𝒾𝒸 𝑜𝒻 𝒸𝒽𝒶𝓇𝒶𝒸𝓉𝑒𝓇𝓈.]]
56- local long_line_text = " This is a test. Now is the time for a very long string to come to the aid and comfort of their friends and enemies to create a very, very long string."
56+ local long_line_text = " This is a test. Now is the time for a very long string to come to the aid and comfort of their friends and enemies to create a very, very long string." -- luacheck: ignore
5757local rtf_text = [[ {\rtf1\ansi
5858This is some {\b bold} text.
5959This is some {\i italic} text.
@@ -80,40 +80,41 @@ dlg:RegisterHandleControlEvent(enabler, function(control)
8080 end )
8181local visifier = dlg :CreateButton (90 , 200 )
8282visifier :SetText (finale .FCString (" Visible" ))
83- dlg :RegisterHandleControlEvent (visifier , function (control )
83+ dlg :RegisterHandleControlEvent (visifier , function (control ) -- luacheck: ignore
8484 edit_text :SetVisible (not edit_text :GetVisible ())
8585 enabler :SetVisible (not enabler :GetVisible ())
8686 edit_text :SetKeyboardFocus ()
8787 end )
8888local readonly = dlg :CreateButton (170 , 200 )
8989readonly :SetText (finale .FCString (" Readonly" ))
90- dlg :RegisterHandleControlEvent (readonly , function (control )
90+ dlg :RegisterHandleControlEvent (readonly , function (control ) -- luacheck: ignore
9191 edit_text :SetReadOnly (not edit_text :GetReadOnly ())
9292 edit_text :SetKeyboardFocus ()
9393 end )
9494local sizer = dlg :CreateButton (250 , 200 )
9595sizer :SetText (finale .FCString (" Size" ))
96- dlg :RegisterHandleControlEvent (sizer , function (control )
97- if not glob_size then glob_size = 10 end
98- glob_size = glob_size * 1.25
99- edit_text :SetFontSizeForSelection (glob_size )
96+ local size_incrementer
97+ dlg :RegisterHandleControlEvent (sizer , function (control ) -- luacheck: ignore
98+ if not size_incrementer then size_incrementer = 10 end
99+ size_incrementer = size_incrementer * 1.25
100+ edit_text :SetFontSizeForSelection (size_incrementer )
100101 end )
101102local copier = dlg :CreateButton (330 , 200 )
102103copier :SetText (finale .FCString (" Copy" ))
103- dlg :RegisterHandleControlEvent (copier , function (control )
104+ dlg :RegisterHandleControlEvent (copier , function (control ) -- luacheck: ignore
104105 edit_text :TextToClipboard ()
105106 end )
106107local replacer = dlg :CreateButton (10 , 225 )
107108replacer :SetText (finale .FCString (" Replace" ))
108- dlg :RegisterHandleControlEvent (replacer , function (control )
109+ dlg :RegisterHandleControlEvent (replacer , function (control ) -- luacheck: ignore
109110 if not edit_text :ReplaceSelectedText (finale .FCString (" *** replaced\n text ***" )) then
110111 print (" ReplaceSelectedText failed because no selected text." )
111112 end
112113 edit_text :SetKeyboardFocus ()
113114 end )
114115local restorer = dlg :CreateButton (90 , 225 )
115116restorer :SetText (finale .FCString (" Restore" ))
116- dlg :RegisterHandleControlEvent (restorer , function (control )
117+ dlg :RegisterHandleControlEvent (restorer , function (control ) -- luacheck: ignore
117118-- local vers1 = finale.FCVerseLyricsText()
118119-- if not vers1:Load(1) then print("lyrics load failed") end
119120-- local versstr = vers1:CreateString()
@@ -125,21 +126,21 @@ dlg:RegisterHandleControlEvent(restorer, function(control)
125126 end )
126127local inserter = dlg :CreateButton (170 , 225 )
127128inserter :SetText (finale .FCString (" Insert" ))
128- dlg :RegisterHandleControlEvent (inserter , function (control )
129+ dlg :RegisterHandleControlEvent (inserter , function (control ) -- luacheck: ignore
129130 edit_text :InsertTextAtCursor (finale .FCString (" *** inserted text ***" ))
130131 edit_text :SetKeyboardFocus ()
131132 end )
132133local selectall = dlg :CreateButton (250 , 225 )
133134selectall :SetText (finale .FCString (" SelAll" ))
134- dlg :RegisterHandleControlEvent (selectall , function (control )
135+ dlg :RegisterHandleControlEvent (selectall , function (control ) -- luacheck: ignore
135136 local range = finale .FCRange ()
136137 edit_text :GetTotalTextRange (range )
137138 edit_text :SetSelection (range )
138139 edit_text :SetKeyboardFocus ()
139140 end )
140141local tabber = dlg :CreateButton (10 , 250 )
141142tabber :SetText (finale .FCString (" Tabs" ))
142- dlg :RegisterHandleControlEvent (tabber , function (control )
143+ dlg :RegisterHandleControlEvent (tabber , function (control ) -- luacheck: ignore
143144 tabstop_width = tabstop_width - 12
144145 if tabstop_width < 12 then
145146 tabstop_width = 12
@@ -171,7 +172,7 @@ dlg:RegisterHandleControlEvent(italicer, function(control)
171172local locinfo = dlg :CreateButton (330 , 250 )
172173locinfo :SetText (finale .FCString (" Loc." ))
173174locinfo :SetWidth (70 )
174- dlg :RegisterHandleControlEvent (locinfo , function (control )
175+ dlg :RegisterHandleControlEvent (locinfo , function (control ) -- luacheck: ignore
175176 local selrange = finale .FCRange ()
176177 edit_text :GetSelection (selrange )
177178 local posrange = finale .FCRange ()
@@ -195,7 +196,7 @@ wordonly:SetWidth(70)
195196local igncase = dlg :CreateCheckbox (250 , 275 )
196197igncase :SetText (finale .FCString (" Ign Case" ))
197198igncase :SetWidth (70 )
198- dlg :RegisterHandleControlEvent (finder , function (control )
199+ dlg :RegisterHandleControlEvent (finder , function (control ) -- luacheck: ignore
199200 local str = finale .FCString ()
200201 findtext :GetText (str )
201202 local options = 0
@@ -223,7 +224,7 @@ dlg:RegisterHandleControlEvent(finder, function(control)
223224local dumper = dlg :CreateButton (330 , 275 )
224225dumper :SetText (finale .FCString (" DumpText" ))
225226dumper :SetWidth (70 )
226- dlg :RegisterHandleControlEvent (dumper , function (control )
227+ dlg :RegisterHandleControlEvent (dumper , function (control ) -- luacheck: ignore
227228 local range = finale .FCRange ()
228229 edit_text :GetSelection (range )
229230 if range .Length == 0 then
@@ -252,15 +253,15 @@ dlg:RegisterHandleControlEvent(dumper, function(control)
252253local colorizer = dlg :CreateButton (10 , 300 )
253254colorizer :SetText (finale .FCString (" Sel2Red" ))
254255colorizer :SetWidth (90 )
255- dlg :RegisterHandleControlEvent (colorizer , function (control )
256+ dlg :RegisterHandleControlEvent (colorizer , function (control ) -- luacheck: ignore
256257 local range = finale .FCRange ()
257258 edit_text :GetSelection (range )
258259 edit_text :SetTextColorInRange (247 , 0 , 0 , range )
259260 end )
260261local find2color = dlg :CreateButton (110 , 300 )
261262find2color :SetText (finale .FCString (" Find2Green" ))
262263find2color :SetWidth (90 )
263- dlg :RegisterHandleControlEvent (find2color , function (control )
264+ dlg :RegisterHandleControlEvent (find2color , function (control ) -- luacheck: ignore
264265 local str = finale .FCString ()
265266 findtext :GetText (str )
266267 local options = 0
@@ -282,7 +283,7 @@ dlg:RegisterHandleControlEvent(find2color, function(control)
282283local colorreporter = dlg :CreateButton (210 , 300 )
283284colorreporter :SetText (finale .FCString (" Color Starts" ))
284285colorreporter :SetWidth (90 )
285- dlg :RegisterHandleControlEvent (colorreporter , function (control )
286+ dlg :RegisterHandleControlEvent (colorreporter , function (control ) -- luacheck: ignore
286287 local ranges = edit_text :CreateTextColorChanges ()
287288 if not ranges then
288289 print (" No colors returned." )
@@ -299,7 +300,7 @@ dlg:RegisterHandleControlEvent(colorreporter, function(control)
299300 end )
300301local colorreverter = dlg :CreateButton (310 , 300 )
301302colorreverter :SetText (finale .FCString (" Default" ))
302- dlg :RegisterHandleControlEvent (colorreverter , function (control )
303+ dlg :RegisterHandleControlEvent (colorreverter , function (control ) -- luacheck: ignore
303304 edit_text :SetFont (finale .FCFontInfo (" Arial" , 12 ))
304305 -- local range = finale.FCRange()
305306 -- edit_text:GetTotalTextRange(range)
@@ -314,11 +315,10 @@ curr_sel:SetWidth(200)
314315dlg :RegisterTextSelectionChanged (function (control )
315316 local fstr = finale .FCString ()
316317 control :GetSelectedText (fstr ) -- if no selection, fstr is unchanged and empty
317- local seltext = fstr .LuaString
318- -- print("Selected Text: "..seltext)
318+ -- print("Selected Text: "..fstr.LuaString)
319319 curr_sel :SetText (fstr )
320320 end )
321- local ok = dlg :CreateOkButton ()
321+ dlg :CreateOkButton ()
322322dlg :RegisterInitWindow (function ()
323323 if init_with_rtf then
324324 edit_text :SetFont (finale .FCFontInfo (" Arial" , 12 ))
0 commit comments