Posted: Thu May 09, 2024 2:12 pm Post subject: [UPDATE] Edit CE all forms font size!
This list includes the Address list and Memory Browser.
Move: Hold down L'Ctrl (Left Ctrl) and move the mouse wheel.
Back: To return to the original size, hold down R'Ctrl (Right Ctrl key) and move the mouse wheel.
There is a feature to save the last edit (last font value).
For the registration; You have changed the last font range based on the form and just press "Ctrl + Enter" keys simultaneously as mentioned in the code.
At the next DT opening, it will probably open at the recorded value.
You must change the font value at least once before saving.
Increase font value: L'Ctrl + Mouse Wheel Up.
Decrease font value: L'Ctrl + Mouse Wheel Down.
Default font value: R'Ctrl + Mouse Wheel (Up or down).
Saving the last value: L'Ctrl + Enter
Size ranging from 7 ~20 maximum.
Copy the code, paste it into a ".lua" file, save it and drop it into the CE >> Autorun folder and start using it.
Code:
------------------------------------- Save all font size -----------------------
fntSttng1 = getSettings("fntSzSv")
local svClsNm1 = ""
local svFntSz1 = 0
alist = getAddressList()
mvf = getMemoryViewForm().DisassemblerView
mvf1 = getMemoryViewForm().HexadecimalView.Osb.Canvas
function saveFnt(fcn,val)
fntSttng1.Value[fcn] = val
end
function loadFnt(frm,frmcls1)
local frmcls = frmcls1
if frmcls=="TDisassemblerview" then
if fntSttng1.Value[frmcls] ~= nil then
mvf.Font.Size = fntSttng1.Value[frmcls]
mvf1.Font.Size = fntSttng1.Value[frmcls]
for i=1, mvf.Header.Sections.count -1 do
nm1 = frmcls..i
if tonumber(fntSttng1.Value[nm1])~=nil then
mvf.Header.Sections[i].width=fntSttng1.Value[nm1]
end
end
end
elseif frmcls=="TAddresslist" then
clnm = fntSttng1.Value[frmcls] or nil
if clnm ~= nil then
alist.List.Font.Size = fntSttng1.Value[frmcls]
for i=1, alist.Header.Sections.count -1 do
nm2 = frmcls..i
if tonumber(fntSttng1.Value[nm2])~=nil then
alist.Header.Sections[i].width=fntSttng1.Value[nm2]
end
end
end
else
if tonumber(fntSttng1.Value[nm2])~=nil then
frm.Font.Size = fntSttng1.Value[frmcls]
end
end
end
function formFontEffect(form1)
local form = form1
form.OnMouseWheelUp=function(sender)
sleep(200)
if isKeyPressed(VK_LCONTROL) then
if sender.Font.Size==0 then sender.Font.Size=10 end
if sender.Font.Size < 20 then -- max = 20
sender.Font.Size = sender.Font.Size + 1
svClsNm1=sender.className
svFntSz1=sender.Font.Size
end
end
if isKeyPressed(VK_RCONTROL) then
svFntSz1=9
svClsNm1=sender.className
sender.Font.Size=9
end
end
form.OnMouseWheelDown=function(sender)
sleep(200)
if isKeyPressed(VK_LCONTROL) then
if sender.Font.Size==0 then sender.Font.Size=8 end
if sender.Font.Size > 7 then -- min = 7
sender.Font.Size = sender.Font.Size - 1
svClsNm1=sender.className
svFntSz1=sender.Font.Size
end
end
if isKeyPressed(VK_RCONTROL) then
svFntSz1=9
svClsNm1=sender.className
sender.Font.Size=9
end
end
end
registerFormAddNotification(function (form)
--print(form.className)
if not allowedTForms(form.className) then return end
local t=createTimer()
t.Interval = 1
t.OnTimer = function (timer)
timer.destroy()
formFontEffect(form)
loadFnt(form,form.className)
end
end)
----------------------------------- CE built forms -----------------------------
------------------------------- address list ---------------------------
alistTbl1 = {9,50,160,115,80,10000}
function dftText()
alist.List.Font.Size = alistTbl1[1]
local idx = 1
for i=0, alist.Header.Sections.count -1 do
idx = tonumber(idx) + 1
alist.Header.Sections[i].width = alistTbl1[idx]
end
end
alist.List.OnMouseWheelUp=function(sender)
sleep(200)
if isKeyPressed(VK_LCONTROL) then
if alist.List.Font.Size==0 then alist.List.Font.Size=10 end
if alist.List.Font.Size < 20 then -- max = 20
alist.List.Font.Size = alist.List.Font.Size + 1
svClsNm1=sender.className
svFntSz1=sender.Font.Size
for i=1, alist.Header.Sections.count -1 do
alist.Header.Sections[i].width=alist.Header.Sections[i].width + 4
end
end
end
if isKeyPressed(VK_RCONTROL) then
svFntSz1=sender.Font.Size
svClsNm1=sender.className
dftText()
end
end
alist.List.OnMouseWheelDown=function(sender)
sleep(200)
if isKeyPressed(VK_LCONTROL) then
if alist.List.Font.Size==0 then alist.List.Font.Size=8 end
if alist.List.Font.Size > 7 then -- min = 7
alist.List.Font.Size = alist.List.Font.Size - 1
svClsNm1=sender.className
svFntSz1=sender.Font.Size
for i=1, alist.Header.Sections.count -1 do
alist.Header.Sections[i].width=alist.Header.Sections[i].width - 4
end
end
end
if isKeyPressed(VK_RCONTROL) then
svFntSz1=sender.Font.Size
svClsNm1=sender.className
dftText()
end
end
function dftText1()
mvf.Font.Size = 9
mvf1.Font.Size = 9
local idx = 1
for i=0, mvf.Header.Sections.count -1 do
idx = tonumber(idx) + 1
mvf.Header.Sections[i].width = mvfTbl1[idx]
end
end
mvf.OnMouseWheelUp=function(sender)
sleep(200)
if isKeyPressed(VK_LCONTROL) then
if mvf.Font.Size==0 then mvf.Font.Size=10 mvf1.Font.Size=10 end
if mvf.Font.Size < 20 then -- max = 20
mvf.Font.Size = mvf.Font.Size + 1
mvf1.Font.Size = mvf1.Font.Size + 1
for i=1, mvf.Header.Sections.count -1 do
mvf.Header.Sections[i].width=mvf.Header.Sections[i].width + 4
end
end
end
if isKeyPressed(VK_RCONTROL) then svClsNm1=mvf.className dftText1() end
end
mvf.OnMouseWheelDown=function(sender)
sleep(200)
if isKeyPressed(VK_LCONTROL) then
if mvf.Font.Size==0 then mvf.Font.Size=8 mvf1.Font.Size=8 end
if mvf.Font.Size > 7 then -- min = 7
mvf.Font.Size = mvf.Font.Size - 1
mvf1.Font.Size = mvf1.Font.Size - 1
svFntSz1=mvf.Font.Size
svClsNm1=mvf.className
for i=1, mvf.Header.Sections.count -1 do
mvf.Header.Sections[i].width=mvf.Header.Sections[i].width - 3
end
end
end
if isKeyPressed(VK_RCONTROL) then
svFntSz1=mvf.Font.Size
svClsNm1=mvf.className
dftText1()
end
end
--------------------------------- save key options -----------------------------
----------------------- save keys: Ctrl + Enter
function svKyOpt()
sleep(200)
if isKeyPressed(VK_RETURN) then
if svClsNm1=="TDisassemblerview" then
saveFnt(svClsNm1,svFntSz1)
local hdr = 0
for i=1, mvf.Header.Sections.count -1 do
nm1 = svClsNm1..i
hdrw1 = mvf.Header.Sections[i].width
saveFnt(nm1,hdrw1)
end
elseif svClsNm1=="TAddresslist" then
saveFnt(svClsNm1,svFntSz1)
for i=1, alist.Header.Sections.count -1 do
nm2 = svClsNm1..i
hdrw2 = alist.Header.Sections[i].width
saveFnt(nm2,hdrw2)
end
else
saveFnt(svClsNm1,svFntSz1)
end
end
end
if svOptKy2 then svOptKy2.Destroy() svOptKy2=nil end
svOptKy2=createHotkey(svKyOpt,VK_LCONTROL)
------------------------------------- THE END ----------------------------------
For more, please vote and support from the reputation icon under the profile picture.
Until we meet again on another crazy project, enjoy it! _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum