Reply To: export restricted instance + zoom panel problem

Home Forums General Programming export restricted instance + zoom panel problem Reply To: export restricted instance + zoom panel problem

#72805
human fly
Participant
  • Topics: 124
  • Replies: 1070
  • Total: 1194
  • ★★★★

waaaah 😀 zoom is awesome !! i just tried it out
with -/+/reset buttons and three zoom methods.
everybody needs this.

zoom zero (reset):

zoomZero=function()

	-- This stops issues during panel bootup
	if panel:getRestoreState() or panel:getProgramState() then return end

	panel:getPanelEditor():setPropertyInt("uiPanelZoom", 1)

--	panel:getModulator("GUI_Style"):setValue(0,false,false)

end

zoom in:

zoomIn=function()

	-- This stops issues during panel bootup
	if panel:getRestoreState() or panel:getProgramState() then return end

	local actual=panel:getPanelEditor():getProperty("uiPanelZoom")

	local val=actual+0.0999999999999999778

	panel:getPanelEditor():setProperty("uiPanelZoom", val,false)
end

zoom out:

zoomOut=function()

	-- This stops issues during panel bootup
	if panel:getRestoreState() or panel:getProgramState() then return end

	local actual=panel:getPanelEditor():getProperty("uiPanelZoom")

	local val=actual-0.0999999999999999778

	panel:getPanelEditor():setProperty("uiPanelZoom", val,false)
end

this is of course cribbed from an existing panel, by Possemo, i believe.
i’ve linked them via ‘when mouse is down’. very happy with this. took
a few minutes to make a few buttons and copy these methods in. i’m using
your scaling values as i found them. *thank you-u*

  • This reply was modified 4 years, 8 months ago by human fly. Reason: code tags
Ctrlr